@snabcentr/vue-ui-lib 3.1.1 → 3.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- (function(W,A){typeof exports=="object"&&typeof module<"u"?A(exports,require("lodash-es"),require("vue"),require("naive-ui"),require("@snabcentr/common-lib"),require("date-fns"),require("ts-case-convert"),require("libphonenumber-js"),require("vue-tel-input")):typeof define=="function"&&define.amd?define(["exports","lodash-es","vue","naive-ui","@snabcentr/common-lib","date-fns","ts-case-convert","libphonenumber-js","vue-tel-input"],A):(W=typeof globalThis<"u"?globalThis:W||self,A(W.SC_VueUiLib={},W["lodash-es"],W.Vue,W["naive-ui"],W["@snabcentr/common-lib"],W["date-fns"],W["ts-case-convert"],W["libphonenumber-js"],W["vue-tel-input"]))})(this,function(W,A,i,V,G,Fn,Ps,Ji,Au){"use strict";var L2=Object.defineProperty;var Nu=W=>{throw TypeError(W)};var D2=(W,A,i)=>A in W?L2(W,A,{enumerable:!0,configurable:!0,writable:!0,value:i}):W[A]=i;var x=(W,A,i)=>D2(W,typeof A!="symbol"?A+"":A,i),Pu=(W,A,i)=>A.has(W)||Nu("Cannot "+i);var Tt=(W,A,i)=>(Pu(W,A,"read from private field"),i?i.call(W):A.get(W)),Aa=(W,A,i)=>A.has(W)?Nu("Cannot add the same private member more than once"):A instanceof WeakSet?A.add(W):A.set(W,i),Fu=(W,A,i,V)=>(Pu(W,A,"write to private field"),V?V.call(W,i):A.set(W,i),i);var pi,at,Rs;var Ge=(t=>(t.AttachedUser="attached_user",t.ClientInfo="client_info",t.CreatedAt="created_at",t.DeliveryInfo="delivery_info",t.Id="id",t.SalesDirections="sales_directions",t.Status="status",t))(Ge||{}),Ye=(t=>(t.phone="phone",t.tablet="tablet",t.laptop="laptop",t))(Ye||{});class Gn{static isVnodeEmpty(e){return e.every(n=>n.type===i.Comment||n.type===i.Text&&A.isString(n.children)&&!n.children.trim()?!0:n.type===i.Fragment&&Gn.isVnodeEmpty(n.children))}static hasSlotContent(e){return e?!Gn.isVnodeEmpty(e()):!1}}class Lt{static convertReferencesToOptionsList(e,n=!1,r=!1,s=!1,o=void 0,a=void 0){let l=e.map(c=>({label:o?o(c):c.name,value:c.id,item:c,disabled:a?a(c):!1}));return n&&(l=l.map(c=>`${c.label}-[${c.value}]`).sort().map(c=>l.find(d=>c===`${d.label}-[${d.value}]`))),r===!1?[...s?[{label:"",value:-1,disabled:!0}]:[],...l]:[...s?[{type:"group",label:"-",key:"default_group",children:[{label:"-- Отсутствует --",value:-1,disabled:!0}]}]:[],...Object.values(A.groupBy(l,r.key)).filter(c=>c.length>0).map(c=>{const d=c[0],h=A.isString(r.key)?A.get(d,r.key):r.key(c),u=A.isString(r.label)?A.get(d,r.label):r.label(c);return{type:"group",label:A.isEmpty(u)?"- Не определено -":u,key:`group_${h}`,children:c}})]}static convertReferencesToSelectOptionsList(e,n=!1,r=!1,s=!1,o=void 0,a=void 0){return Lt.convertReferencesToOptionsList(e,n,r,s,o,a)}static convertReferencesToAutocompleteOptionsList(e,n=!1,r=!1,s=!1,o=void 0,a=void 0){return Lt.convertReferencesToOptionsList(e,n,r,s,o,a)}}const Ou={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Vu(t,e){return i.openBlock(),i.createElementBlock("svg",Ou,[...e[0]||(e[0]=[i.createElementVNode("circle",{cx:"256",cy:"256",r:"48",fill:"currentColor"},null,-1),i.createElementVNode("circle",{cx:"256",cy:"416",r:"48",fill:"currentColor"},null,-1),i.createElementVNode("circle",{cx:"256",cy:"96",r:"48",fill:"currentColor"},null,-1)])])}const Va=i.markRaw({name:"ion-ellipsis-vertical-sharp",render:Vu}),Iu={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function zu(t,e){return i.openBlock(),i.createElementBlock("svg",Iu,[...e[0]||(e[0]=[i.createElementVNode("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[i.createElementVNode("path",{d:"M7 7H6a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h9a2 2 0 0 0 2-2v-1"}),i.createElementVNode("path",{d:"M20.385 6.585a2.1 2.1 0 0 0-2.97-2.97L9 12v3h3zM16 5l3 3"})],-1)])])}const Ia=i.markRaw({name:"tabler-edit",render:zu}),Lu={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Du(t,e){return i.openBlock(),i.createElementBlock("svg",Lu,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"currentColor",d:"M258.9 48C141.92 46.42 46.42 141.92 48 258.9c1.56 112.19 92.91 203.54 205.1 205.1c117 1.6 212.48-93.9 210.88-210.88C462.44 140.91 371.09 49.56 258.9 48m-16.79 192.47l51.55-59a16 16 0 0 1 24.1 21.06l-51.55 59a16 16 0 1 1-24.1-21.06m-38.86 90.85a16 16 0 0 1-22.62 0l-47.95-48a16 16 0 1 1 22.64-22.62l48 48a16 16 0 0 1-.07 22.62m176.8-128.79l-111.88 128a16 16 0 0 1-11.51 5.47h-.54a16 16 0 0 1-11.32-4.69l-47.94-48a16 16 0 1 1 22.64-22.62l29.8 29.83a8 8 0 0 0 11.68-.39l95-108.66a16 16 0 0 1 24.1 21.06Z"},null,-1)])])}const za=i.markRaw({name:"ion-checkmark-done-circle",render:Du}),Hu={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Wu(t,e){return i.openBlock(),i.createElementBlock("svg",Hu,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-miterlimit":"10","stroke-width":"32",d:"M448 256c0-106-86-192-192-192S64 150 64 256s86 192 192 192s192-86 192-192Z"},null,-1),i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M368 192L256.13 320l-47.95-48m-16.23 48L144 272m161.71-80l-51.55 59"},null,-1)])])}const La=i.markRaw({name:"ion-checkmark-done-circle-outline",render:Wu}),ju={viewBox:"0 0 32 32",width:"1.2em",height:"1.2em"};function qu(t,e){return i.openBlock(),i.createElementBlock("svg",ju,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"currentColor",d:"M22.15 3.237c-1.93-1.93-5.185-1.403-6.406 1.04l-3.175 6.35a1.5 1.5 0 0 1-.868.752L6.72 13.04a2 2 0 0 0-.782 3.312l4.149 4.149L4 26.586v1.415h1.414l6.086-6.086l4.149 4.149a2 2 0 0 0 3.311-.782l1.661-4.983a1.5 1.5 0 0 1 .752-.867l6.351-3.175c2.442-1.222 2.97-4.476 1.04-6.407zM17.533 5.17a2 2 0 0 1 3.203-.52l6.614 6.614a2 2 0 0 1-.52 3.203l-6.351 3.175a3.5 3.5 0 0 0-1.755 2.024l-1.661 4.982l-9.712-9.711l4.983-1.661a3.5 3.5 0 0 0 2.024-1.755z"},null,-1)])])}const Xu=i.markRaw({name:"fluent-pin32-regular",render:qu}),Yu={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Uu(t,e){return i.openBlock(),i.createElementBlock("svg",Yu,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M255.66 112c-77.94 0-157.89 45.11-220.83 135.33a16 16 0 0 0-.27 17.77C82.92 340.8 161.8 400 255.66 400c92.84 0 173.34-59.38 221.79-135.25a16.14 16.14 0 0 0 0-17.47C428.89 172.28 347.8 112 255.66 112"},null,-1),i.createElementVNode("circle",{cx:"256",cy:"256",r:"80",fill:"none",stroke:"currentColor","stroke-miterlimit":"10","stroke-width":"32"},null,-1)])])}const Gu=i.markRaw({name:"ion-eye-outline",render:Uu}),Ku={viewBox:"0 0 32 32",width:"1.2em",height:"1.2em"};function Zu(t,e){return i.openBlock(),i.createElementBlock("svg",Ku,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"currentColor",d:"M15.744 4.276c1.221-2.442 4.476-2.97 6.406-1.04l6.614 6.614c1.93 1.93 1.402 5.186-1.04 6.406l-6.35 3.176a1.5 1.5 0 0 0-.753.867l-1.66 4.983a2 2 0 0 1-3.312.782l-4.149-4.15l-6.086 6.087H4v-1.415l6.086-6.085l-4.149-4.15a2 2 0 0 1 .782-3.31l4.982-1.662a1.5 1.5 0 0 0 .868-.752z"},null,-1)])])}const Ju=i.markRaw({name:"fluent-pin32-filled",render:Zu}),Qu={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function ef(t,e){return i.openBlock(),i.createElementBlock("svg",Qu,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M352 48H160a48 48 0 0 0-48 48v368l144-128l144 128V96a48 48 0 0 0-48-48"},null,-1)])])}const tf=i.markRaw({name:"ion-bookmark-outline",render:ef}),nf={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function rf(t,e){return i.openBlock(),i.createElementBlock("svg",nf,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"currentColor",d:"m63.998 86.005l21.998-21.998L447.999 426.01l-21.998 21.998zM259.34 192.09l60.57 60.57a64.07 64.07 0 0 0-60.57-60.57m-6.68 127.82l-60.57-60.57a64.07 64.07 0 0 0 60.57 60.57"},null,-1),i.createElementVNode("path",{fill:"currentColor",d:"M256 352a96 96 0 0 1-92.6-121.34l-69.07-69.08C66.12 187.42 39.24 221.14 16 256c26.42 44 62.56 89.24 100.2 115.18C159.38 400.92 206.33 416 255.76 416A233.5 233.5 0 0 0 335 402.2l-53.61-53.6A95.8 95.8 0 0 1 256 352m0-192a96 96 0 0 1 92.6 121.34L419.26 352c29.15-26.25 56.07-61.56 76.74-96c-26.38-43.43-62.9-88.56-101.18-114.82C351.1 111.2 304.31 96 255.76 96a222.9 222.9 0 0 0-78.21 14.29l53.11 53.11A95.8 95.8 0 0 1 256 160"},null,-1)])])}const sf=i.markRaw({name:"ion-eye-off-sharp",render:rf}),of={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function af(t,e){return i.openBlock(),i.createElementBlock("svg",of,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"48",d:"m184 112l144 144l-144 144"},null,-1)])])}const lf=i.markRaw({name:"ion-chevron-forward-outline",render:af}),cf=["data-name"],df={class:"sc-collapse-item-header flex flex-row gap-2.5"},hf={class:"sc-collapse-item-arrow flex-none cursor-pointer pt-1.5"},uf={key:0},ff={class:"sc-collapse-item-pre-arrow flex flex-none flex-row gap-1"},gf={class:"flex flex-1 flex-col"},mf={key:0,class:"sc-collapse-item-sub-title flex-1"},pf={key:1,class:"sc-collapse-item-title-extra flex-none"},yf={key:0,class:"sc-collapse-item-content"},bf={},_f=i.defineComponent({...bf,__name:"collapse-item",props:{name:{default:""},title:{default:""},disabled:{type:Boolean,default:!1}},emits:["header:click"],setup(t,{expose:e,emit:n}){const r=t,s=n,o=i.inject("itemHeaderClickHandler",A.noop),a=i.inject("defaultExpandedNames",[]),l=i.inject("expandedNames",[]),c=A.some(a,p=>p===r.name),d=i.computed(()=>A.some(l,p=>p===r.name)),h=i.ref(c),u=()=>{r.disabled||(h.value=d.value||!h.value,s("header:click",r.name,h.value),o(r.name,h.value))};return e({expand:()=>{!r.disabled&&!h.value&&(h.value=!0,s("header:click",r.name,h.value),o(r.name,h.value))},toggle:()=>{r.disabled||u()},collapse:()=>{!r.disabled&&h.value&&!d.value&&(h.value=!1,s("header:click",r.name,h.value),o(r.name,h.value))},expanded:i.readonly(h)}),(p,b)=>{const y=lf;return i.openBlock(),i.createElementBlock("div",{"data-name":t.name,class:i.normalizeClass({"sc-collapse-item flex flex-col p-2":!0,"cursor-not-allowed text-gray-400":t.disabled})},[i.createElementVNode("div",df,[i.createElementVNode("div",hf,[i.createElementVNode("div",{class:i.normalizeClass({"rotate-90":h.value}),onClick:u},[i.renderSlot(p.$slots,"arrow",{},()=>[i.createVNode(y)],!0)],2)]),i.unref(Gn).hasSlotContent(p.$slots["pre-arrow"])?(i.openBlock(),i.createElementBlock("div",uf,[i.createElementVNode("div",ff,[i.renderSlot(p.$slots,"pre-arrow",{},void 0,!0)])])):i.createCommentVNode("",!0),i.createElementVNode("div",gf,[i.createElementVNode("div",{class:"sc-collapse-item-title flex flex-1 cursor-pointer flex-col text-lg font-semibold",onClick:u},[i.renderSlot(p.$slots,"header",{},()=>[i.createTextVNode(i.toDisplayString(t.title),1)],!0)]),i.unref(Gn).hasSlotContent(p.$slots["sub-header"])?(i.openBlock(),i.createElementBlock("div",mf,[i.renderSlot(p.$slots,"sub-header",{},void 0,!0)])):i.createCommentVNode("",!0)]),i.unref(Gn).hasSlotContent(p.$slots["header-extra"])?(i.openBlock(),i.createElementBlock("div",pf,[i.renderSlot(p.$slots,"header-extra",{},void 0,!0)])):i.createCommentVNode("",!0)]),i.createVNode(i.Transition,{name:"fade"},{default:i.withCtx(()=>[d.value||h.value?(i.openBlock(),i.createElementBlock("div",yf,[i.renderSlot(p.$slots,"default",{},void 0,!0)])):i.createCommentVNode("",!0)]),_:3})],10,cf)}}}),Kn=(t,e)=>{const n=t.__vccOpts||t;for(const[r,s]of e)n[r]=s;return n},Da=Kn(_f,[["__scopeId","data-v-415a3dda"]]),wf={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function xf(t,e){return i.openBlock(),i.createElementBlock("svg",wf,[...e[0]||(e[0]=[i.createElementVNode("circle",{cx:"176",cy:"416",r:"16",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),i.createElementVNode("circle",{cx:"400",cy:"416",r:"16",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M48 80h64l48 272h256"},null,-1),i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M160 288h249.44a8 8 0 0 0 7.85-6.43l28.8-144a8 8 0 0 0-7.85-9.57H128"},null,-1)])])}const vf=i.markRaw({name:"ion-cart-outline",render:xf}),$r=Symbol(),kf={Button:{border:"1px solid grey"},Card:{paddingMedium:"1rem"},Checkbox:{border:"1px solid rgb(12, 88, 32)"},Common:{borderRadius:"0.5rem",borderRadiusSmall:"0.25rem",fontWeight:"500",fontWeightStrong:"600",fontSize:"0.75rem",fontSizeMedium:"0.75rem",fontSizeLarge:"0.8125rem",lineHeight:"1.25rem",heightSmall:"24px",heightMedium:"30px",heightTiny:"20px",heightLarge:"36px",heightHuge:"42px",primaryColor:"#FFCC40FF",primaryColorHover:"#FFE49BFF",primaryColorPressed:"#FFBB00FF",primaryColorSuppl:"#FCC42AFF",successColor:"#4AC99BFF",successColorHover:"#4AC99BBF",successColorPressed:"#21AA78FF",errorColor:"#F45725FF",errorColorHover:"#F4572599",textColorBase:"#191C30E5",textColorDisabled:"#191C30E5"},DataTable:{borderColor:"rgb(207, 207, 207)",lineHeight:1.4,tdColorHover:"rgb(250,250,250)",thColor:"rgb(231, 231, 231)",thFontWeight:400,thPaddingMedium:"8px",tdPaddingMedium:"8px",thTextColor:"rgb(22, 0, 108)"},Drawer:{closeIconColor:"rgba(31, 34, 37, 1)",closeIconColorHover:"rgba(10, 157, 5, 1)"},Form:{marginBottom:0,lineHeight:1,labelFontSizeTopMedium:"0.75rem",labelHeightMedium:"20px",labelFontWeight:500,labelTextColor:"rgba(27, 31, 59, 0.65)",labelPaddingVertical:"0",labelPaddingHorizontal:"0"},Input:{paddingMedium:"0.5rem",fontSizeMedium:"0.9125rem",lineHeight:"1.25rem",lineHeightTextarea:"1.25rem",border:"1px solid #E0E0E0",borderRadius:"0.5rem",iconSize:"1,125rem"},Tabs:{tabFontSizeMedium:"0.9375rem",tabColorSegment:"#FFCC40FF",tabBorderColor:"#CCCCCCFF"}},Cf={class:"flex flex-col-reverse gap-2.5 sm:flex-row"},Sf={},Ha=i.defineComponent({...Sf,__name:"product-actions",props:{eventEmitter:{},showProductAddToCartButton:{type:[Boolean,String,Function],default:!1},showProductEditButton:{type:[Boolean,String,Function],default:!1},showProductRequiredButton:{type:[Boolean,String,Function],default:!1},productContextButtonsConfig:{type:Function,default:void 0},product:{}},setup(t){const e=t,n=i.inject($r,"medium"),r=i.computed(()=>A.isFunction(e.showProductAddToCartButton)?e.showProductAddToCartButton(e.product):e.showProductAddToCartButton),s=i.computed(()=>A.isFunction(e.showProductEditButton)?e.showProductEditButton(e.product):e.showProductEditButton),o=i.computed(()=>A.isFunction(e.showProductRequiredButton)?e.showProductRequiredButton(e.product):e.showProductRequiredButton),a=i.computed(()=>A.isNil(e.productContextButtonsConfig)?[]:A.isFunction(e.productContextButtonsConfig)?e.productContextButtonsConfig(e.product):e.productContextButtonsConfig),l=()=>{e.eventEmitter.emit("product:add-to-cart",{product:e.product})},c=()=>{e.eventEmitter.emit("product:edit",{product:e.product})},d=()=>{e.eventEmitter.emit("product:required",{product:e.product})},h=u=>{e.eventEmitter.emit("product:context-select",{product:e.product,key:u})};return(u,m)=>{var v;const f=La,g=za,p=V.NButton,b=V.NTooltip,y=Ia,_=vf,S=Va,C=V.NDropdown;return i.openBlock(),i.createElementBlock("div",Cf,[o.value?(i.openBlock(),i.createBlock(b,{key:0,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(p,{ghost:!0,size:i.unref(n),disabled:o.value==="disabled",type:t.product.isRequired?"primary":"default",onClick:d},{default:i.withCtx(()=>[t.product.isRequired?(i.openBlock(),i.createBlock(g,{key:1})):(i.openBlock(),i.createBlock(f,{key:0}))]),_:1},8,["size","disabled","type"])]),default:i.withCtx(()=>[m[0]||(m[0]=i.createTextVNode(" Товар, который нужно предлагать клиенту ",-1))]),_:1})):i.createCommentVNode("",!0),s.value?(i.openBlock(),i.createBlock(b,{key:1,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(p,{ghost:!0,size:i.unref(n),type:"primary",disabled:s.value==="disabled",onClick:c},{default:i.withCtx(()=>[i.createVNode(y)]),_:1},8,["size","disabled"])]),default:i.withCtx(()=>[m[1]||(m[1]=i.createTextVNode(" Редактировать ",-1))]),_:1})):i.createCommentVNode("",!0),r.value?(i.openBlock(),i.createBlock(b,{key:2,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(p,{ghost:!0,size:i.unref(n),disabled:r.value==="disabled",type:"primary",onClick:l},{default:i.withCtx(()=>[i.createVNode(_)]),_:1},8,["size","disabled"])]),default:i.withCtx(()=>[m[2]||(m[2]=i.createTextVNode(" Добавить в корзину ",-1))]),_:1})):i.createCommentVNode("",!0),((v=a.value)==null?void 0:v.length)>0?(i.openBlock(),i.createBlock(C,{key:3,options:a.value,size:i.unref(n),trigger:"click",onSelect:h},{default:i.withCtx(()=>[i.createVNode(p,{ghost:!0,size:i.unref(n),type:"primary"},{default:i.withCtx(()=>[i.createVNode(S)]),_:1},8,["size"])]),_:1},8,["options","size"])):i.createCommentVNode("",!0)])}}}),Bf={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Tf(t,e){return i.openBlock(),i.createElementBlock("svg",Bf,[...e[0]||(e[0]=[i.createElementVNode("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[i.createElementVNode("path",{d:"M12 8v4l2 2"}),i.createElementVNode("path",{d:"M3.05 11a9 9 0 1 1 .5 4m-.5 5v-5h5"})],-1)])])}const Rf=i.markRaw({name:"tabler-history",render:Tf}),$f={class:"flex flex-row gap-1"},Ef={key:0,class:"flex flex-row text-nowrap text-sm line-through"},Nf={key:1,class:"flex flex-row text-nowrap text-sm"},Pf={key:2,class:"flex flex-row gap-1 text-nowrap text-sm text-gray-600"},Ff={},Er=i.defineComponent({...Ff,__name:"product-cost",props:{product:{},additionalThroughFieldName:{},costFieldName:{},eventEmitter:{},allowPriceClick:{type:[Boolean,Function],default:!1},showTag:{type:Boolean,default:!1},showQuantityUnit:{type:Boolean,default:!1},showCostDate:{type:Boolean,default:!1},showPriceHistory:{type:Boolean,default:!1},currencyRates:{default:void 0}},setup(t){const e=t,n=i.computed(()=>A.find(e.product.priceCoefficients,["coefficient.slug",e.costFieldName])),r=i.computed(()=>n.value?n.value.cost:A.get(e.product,e.costFieldName)),s=i.computed(()=>e.additionalThroughFieldName?A.get(e.product,e.additionalThroughFieldName):void 0),o=i.computed(()=>e.product.costDate?Fn.format(e.product.costDate,G.AppConfigProvider.getConfig().dateFormats.uiDate):void 0),a=i.computed(()=>(A.isFunction(e.allowPriceClick)?e.allowPriceClick(e.product):e.allowPriceClick)&&!A.isNil(r.value)),l=i.computed(()=>A.isNil(r.value)?"-":new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:2}).format(Number.parseFloat(r.value))),c=i.computed(()=>{if(e.product.currencySignature==="RUB"||!e.currencyRates||!e.currencyRates[e.product.currencySignature])return null;const h=e.currencyRates[e.product.currencySignature];return new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:2}).format(Number.parseFloat(r.value)*h)}),d=i.computed(()=>A.isNil(s.value)?null:new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:2}).format(s.value));return(h,u)=>{var p;const m=V.NTag,f=V.NTooltip,g=Rf;return i.openBlock(),i.createElementBlock("div",$f,[t.showTag?(i.openBlock(),i.createBlock(f,{key:0},{trigger:i.withCtx(()=>[i.createVNode(m,{round:"",bordered:!1,size:"small",class:i.normalizeClass(["text-slate-600",{"font-bold":!n.value}])},{default:i.withCtx(()=>{var b;return[i.createTextVNode(i.toDisplayString(((b=n.value)==null?void 0:b.coefficient.slug)??"Ц"),1)]}),_:1},8,["class"])]),default:i.withCtx(()=>{var b;return[i.createTextVNode(" "+i.toDisplayString(((b=n.value)==null?void 0:b.coefficient.name)??"Розничная цена"),1)]}),_:1})):i.createCommentVNode("",!0),i.createElementVNode("div",null,[s.value&&s.value!==r.value?(i.openBlock(),i.createElementBlock("span",Ef,i.toDisplayString(d.value)+" "+i.toDisplayString(t.showQuantityUnit?` ${t.product.currency}/${t.product.quantityUnit}`:""),1)):i.createCommentVNode("",!0),i.createElementVNode("span",{class:i.normalizeClass(["whitespace-nowrap text-base",{"text-gray-600":(p=n.value)==null?void 0:p.readOnly,"font-bold":!n.value}])},[i.createElementVNode("span",{class:i.normalizeClass({"text-nowrap":!0,"cursor-pointer underline decoration-dashed":a.value&&t.eventEmitter}),onClick:u[0]||(u[0]=()=>{var b;a.value&&((b=t.eventEmitter)==null||b.emit("cost:click",{product:t.product,cost:r.value}))})},i.toDisplayString(l.value),3),i.createTextVNode(" "+i.toDisplayString(t.showQuantityUnit?` ${t.product.currency}/${t.product.quantityUnit}`:""),1)],2),c.value?(i.openBlock(),i.createElementBlock("span",Nf," ~ "+i.toDisplayString(c.value)+" "+i.toDisplayString(t.showQuantityUnit?`₽/${t.product.quantityUnit}`:""),1)):i.createCommentVNode("",!0),t.showCostDate&&!i.unref(A.isNil)(o.value)?(i.openBlock(),i.createElementBlock("span",Pf,[i.createTextVNode(i.toDisplayString(o.value)+" ",1),t.showPriceHistory&&t.eventEmitter?(i.openBlock(),i.createBlock(f,{key:0,placement:"top-end"},{trigger:i.withCtx(()=>[i.createVNode(g,{class:"cursor-pointer",onClick:u[1]||(u[1]=b=>{var y;return(y=t.eventEmitter)==null?void 0:y.emit("cost:show-price-history",{product:t.product})})})]),default:i.withCtx(()=>[u[2]||(u[2]=i.createTextVNode(" История цен ",-1))]),_:1})):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)])])}}}),Mf={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Af(t,e){return i.openBlock(),i.createElementBlock("svg",Mf,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-miterlimit":"10","stroke-width":"32",d:"M248 64C146.39 64 64 146.39 64 248s82.39 184 184 184s184-82.39 184-184S349.61 64 248 64Z"},null,-1),i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M220 220h32v116"},null,-1),i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-miterlimit":"10","stroke-width":"32",d:"M208 340h88"},null,-1),i.createElementVNode("path",{fill:"currentColor",d:"M248 130a26 26 0 1 0 26 26a26 26 0 0 0-26-26"},null,-1)])])}const Fs=i.markRaw({name:"ion-information-circle-outline",render:Af}),Of={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Vf(t,e){return i.openBlock(),i.createElementBlock("svg",Of,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"currentColor",d:"M450.29 112H142c-34 0-62 27.51-62 61.33v245.34c0 33.82 28 61.33 62 61.33h308c34 0 62-26.18 62-60V173.33c0-33.82-27.68-61.33-61.71-61.33m-77.15 61.34a46 46 0 1 1-46.28 46a46.19 46.19 0 0 1 46.28-46.01Zm-231.55 276c-17 0-29.86-13.75-29.86-30.66v-64.83l90.46-80.79a46.54 46.54 0 0 1 63.44 1.83L328.27 337l-113 112.33ZM480 418.67a30.67 30.67 0 0 1-30.71 30.66H259L376.08 333a46.24 46.24 0 0 1 59.44-.16L480 370.59Z"},null,-1),i.createElementVNode("path",{fill:"currentColor",d:"M384 32H64A64 64 0 0 0 0 96v256a64.11 64.11 0 0 0 48 62V152a72 72 0 0 1 72-72h326a64.11 64.11 0 0 0-62-48"},null,-1)])])}const Wa=i.markRaw({name:"ion-images",render:Vf});/*!
1
+ (function(W,O){typeof exports=="object"&&typeof module<"u"?O(exports,require("lodash-es"),require("vue"),require("naive-ui"),require("@snabcentr/common-lib"),require("date-fns"),require("ts-case-convert"),require("libphonenumber-js"),require("vue-tel-input")):typeof define=="function"&&define.amd?define(["exports","lodash-es","vue","naive-ui","@snabcentr/common-lib","date-fns","ts-case-convert","libphonenumber-js","vue-tel-input"],O):(W=typeof globalThis<"u"?globalThis:W||self,O(W.SC_VueUiLib={},W["lodash-es"],W.Vue,W["naive-ui"],W["@snabcentr/common-lib"],W["date-fns"],W["ts-case-convert"],W["libphonenumber-js"],W["vue-tel-input"]))})(this,(function(W,O,i,z,G,Mn,Ps,Ji,Au){"use strict";var eC=Object.defineProperty;var Nu=W=>{throw TypeError(W)};var tC=(W,O,i)=>O in W?eC(W,O,{enumerable:!0,configurable:!0,writable:!0,value:i}):W[O]=i;var x=(W,O,i)=>tC(W,typeof O!="symbol"?O+"":O,i),Pu=(W,O,i)=>O.has(W)||Nu("Cannot "+i);var Bt=(W,O,i)=>(Pu(W,O,"read from private field"),i?i.call(W):O.get(W)),Aa=(W,O,i)=>O.has(W)?Nu("Cannot add the same private member more than once"):O instanceof WeakSet?O.add(W):O.set(W,i),Fu=(W,O,i,z)=>(Pu(W,O,"write to private field"),z?z.call(W,i):O.set(W,i),i);var yi,ot,Rs;var Ke=(t=>(t.AttachedUser="attached_user",t.ClientInfo="client_info",t.CreatedAt="created_at",t.DeliveryInfo="delivery_info",t.Id="id",t.SalesDirections="sales_directions",t.Status="status",t))(Ke||{}),Ue=(t=>(t.phone="phone",t.tablet="tablet",t.laptop="laptop",t))(Ue||{});class Kn{static isVnodeEmpty(e){return e.every(n=>n.type===i.Comment||n.type===i.Text&&O.isString(n.children)&&!n.children.trim()?!0:n.type===i.Fragment&&Kn.isVnodeEmpty(n.children))}static hasSlotContent(e){return e?!Kn.isVnodeEmpty(e()):!1}}class zt{static convertReferencesToOptionsList(e,n=!1,r=!1,s=!1,o=void 0,a=void 0){let l=e.map(c=>({label:o?o(c):c.name,value:c.id,item:c,disabled:a?a(c):!1}));return n&&(l=l.map(c=>`${c.label}-[${c.value}]`).sort().map(c=>l.find(d=>c===`${d.label}-[${d.value}]`))),r===!1?[...s?[{label:"",value:-1,disabled:!0}]:[],...l]:[...s?[{type:"group",label:"-",key:"default_group",children:[{label:"-- Отсутствует --",value:-1,disabled:!0}]}]:[],...Object.values(O.groupBy(l,r.key)).filter(c=>c.length>0).map(c=>{const d=c[0],h=O.isString(r.key)?O.get(d,r.key):r.key(c),u=O.isString(r.label)?O.get(d,r.label):r.label(c);return{type:"group",label:O.isEmpty(u)?"- Не определено -":u,key:`group_${h}`,children:c}})]}static convertReferencesToSelectOptionsList(e,n=!1,r=!1,s=!1,o=void 0,a=void 0){return zt.convertReferencesToOptionsList(e,n,r,s,o,a)}static convertReferencesToAutocompleteOptionsList(e,n=!1,r=!1,s=!1,o=void 0,a=void 0){return zt.convertReferencesToOptionsList(e,n,r,s,o,a)}}const Vu={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Ou(t,e){return i.openBlock(),i.createElementBlock("svg",Vu,[...e[0]||(e[0]=[i.createElementVNode("circle",{cx:"256",cy:"256",r:"48",fill:"currentColor"},null,-1),i.createElementVNode("circle",{cx:"256",cy:"416",r:"48",fill:"currentColor"},null,-1),i.createElementVNode("circle",{cx:"256",cy:"96",r:"48",fill:"currentColor"},null,-1)])])}const Oa=i.markRaw({name:"ion-ellipsis-vertical-sharp",render:Ou}),Iu={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function zu(t,e){return i.openBlock(),i.createElementBlock("svg",Iu,[...e[0]||(e[0]=[i.createElementVNode("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[i.createElementVNode("path",{d:"M7 7H6a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h9a2 2 0 0 0 2-2v-1"}),i.createElementVNode("path",{d:"M20.385 6.585a2.1 2.1 0 0 0-2.97-2.97L9 12v3h3zM16 5l3 3"})],-1)])])}const Ia=i.markRaw({name:"tabler-edit",render:zu}),Lu={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Du(t,e){return i.openBlock(),i.createElementBlock("svg",Lu,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"currentColor",d:"M258.9 48C141.92 46.42 46.42 141.92 48 258.9c1.56 112.19 92.91 203.54 205.1 205.1c117 1.6 212.48-93.9 210.88-210.88C462.44 140.91 371.09 49.56 258.9 48m-16.79 192.47l51.55-59a16 16 0 0 1 24.1 21.06l-51.55 59a16 16 0 1 1-24.1-21.06m-38.86 90.85a16 16 0 0 1-22.62 0l-47.95-48a16 16 0 1 1 22.64-22.62l48 48a16 16 0 0 1-.07 22.62m176.8-128.79l-111.88 128a16 16 0 0 1-11.51 5.47h-.54a16 16 0 0 1-11.32-4.69l-47.94-48a16 16 0 1 1 22.64-22.62l29.8 29.83a8 8 0 0 0 11.68-.39l95-108.66a16 16 0 0 1 24.1 21.06Z"},null,-1)])])}const za=i.markRaw({name:"ion-checkmark-done-circle",render:Du}),Hu={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Wu(t,e){return i.openBlock(),i.createElementBlock("svg",Hu,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-miterlimit":"10","stroke-width":"32",d:"M448 256c0-106-86-192-192-192S64 150 64 256s86 192 192 192s192-86 192-192Z"},null,-1),i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M368 192L256.13 320l-47.95-48m-16.23 48L144 272m161.71-80l-51.55 59"},null,-1)])])}const La=i.markRaw({name:"ion-checkmark-done-circle-outline",render:Wu}),ju={viewBox:"0 0 32 32",width:"1.2em",height:"1.2em"};function qu(t,e){return i.openBlock(),i.createElementBlock("svg",ju,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"currentColor",d:"M22.15 3.237c-1.93-1.93-5.185-1.403-6.406 1.04l-3.175 6.35a1.5 1.5 0 0 1-.868.752L6.72 13.04a2 2 0 0 0-.782 3.312l4.149 4.149L4 26.586v1.415h1.414l6.086-6.086l4.149 4.149a2 2 0 0 0 3.311-.782l1.661-4.983a1.5 1.5 0 0 1 .752-.867l6.351-3.175c2.442-1.222 2.97-4.476 1.04-6.407zM17.533 5.17a2 2 0 0 1 3.203-.52l6.614 6.614a2 2 0 0 1-.52 3.203l-6.351 3.175a3.5 3.5 0 0 0-1.755 2.024l-1.661 4.982l-9.712-9.711l4.983-1.661a3.5 3.5 0 0 0 2.024-1.755z"},null,-1)])])}const Xu=i.markRaw({name:"fluent-pin32-regular",render:qu}),Yu={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Uu(t,e){return i.openBlock(),i.createElementBlock("svg",Yu,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M255.66 112c-77.94 0-157.89 45.11-220.83 135.33a16 16 0 0 0-.27 17.77C82.92 340.8 161.8 400 255.66 400c92.84 0 173.34-59.38 221.79-135.25a16.14 16.14 0 0 0 0-17.47C428.89 172.28 347.8 112 255.66 112"},null,-1),i.createElementVNode("circle",{cx:"256",cy:"256",r:"80",fill:"none",stroke:"currentColor","stroke-miterlimit":"10","stroke-width":"32"},null,-1)])])}const Gu=i.markRaw({name:"ion-eye-outline",render:Uu}),Ku={viewBox:"0 0 32 32",width:"1.2em",height:"1.2em"};function Zu(t,e){return i.openBlock(),i.createElementBlock("svg",Ku,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"currentColor",d:"M15.744 4.276c1.221-2.442 4.476-2.97 6.406-1.04l6.614 6.614c1.93 1.93 1.402 5.186-1.04 6.406l-6.35 3.176a1.5 1.5 0 0 0-.753.867l-1.66 4.983a2 2 0 0 1-3.312.782l-4.149-4.15l-6.086 6.087H4v-1.415l6.086-6.085l-4.149-4.15a2 2 0 0 1 .782-3.31l4.982-1.662a1.5 1.5 0 0 0 .868-.752z"},null,-1)])])}const Qu=i.markRaw({name:"fluent-pin32-filled",render:Zu}),Ju={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function ef(t,e){return i.openBlock(),i.createElementBlock("svg",Ju,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M352 48H160a48 48 0 0 0-48 48v368l144-128l144 128V96a48 48 0 0 0-48-48"},null,-1)])])}const tf=i.markRaw({name:"ion-bookmark-outline",render:ef}),nf={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function rf(t,e){return i.openBlock(),i.createElementBlock("svg",nf,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"currentColor",d:"m63.998 86.005l21.998-21.998L447.999 426.01l-21.998 21.998zM259.34 192.09l60.57 60.57a64.07 64.07 0 0 0-60.57-60.57m-6.68 127.82l-60.57-60.57a64.07 64.07 0 0 0 60.57 60.57"},null,-1),i.createElementVNode("path",{fill:"currentColor",d:"M256 352a96 96 0 0 1-92.6-121.34l-69.07-69.08C66.12 187.42 39.24 221.14 16 256c26.42 44 62.56 89.24 100.2 115.18C159.38 400.92 206.33 416 255.76 416A233.5 233.5 0 0 0 335 402.2l-53.61-53.6A95.8 95.8 0 0 1 256 352m0-192a96 96 0 0 1 92.6 121.34L419.26 352c29.15-26.25 56.07-61.56 76.74-96c-26.38-43.43-62.9-88.56-101.18-114.82C351.1 111.2 304.31 96 255.76 96a222.9 222.9 0 0 0-78.21 14.29l53.11 53.11A95.8 95.8 0 0 1 256 160"},null,-1)])])}const sf=i.markRaw({name:"ion-eye-off-sharp",render:rf}),of={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function af(t,e){return i.openBlock(),i.createElementBlock("svg",of,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"48",d:"m184 112l144 144l-144 144"},null,-1)])])}const lf=i.markRaw({name:"ion-chevron-forward-outline",render:af}),cf=["data-name"],df={class:"sc-collapse-item-header flex flex-row gap-2.5"},hf={class:"sc-collapse-item-arrow flex-none cursor-pointer pt-1.5"},uf={key:0},ff={class:"sc-collapse-item-pre-arrow flex flex-none flex-row gap-1"},gf={class:"flex flex-1 flex-col"},mf={key:0,class:"sc-collapse-item-sub-title flex-1"},pf={key:1,class:"sc-collapse-item-title-extra flex-none"},yf={key:0,class:"sc-collapse-item-content"},bf={},_f=i.defineComponent({...bf,__name:"collapse-item",props:{name:{default:""},title:{default:""},disabled:{type:Boolean,default:!1}},emits:["header:click"],setup(t,{expose:e,emit:n}){const r=t,s=n,o=i.inject("itemHeaderClickHandler",O.noop),a=i.inject("defaultExpandedNames",[]),l=i.inject("expandedNames",[]),c=O.some(a,p=>p===r.name),d=i.computed(()=>O.some(l,p=>p===r.name)),h=i.ref(c),u=()=>{r.disabled||(h.value=d.value||!h.value,s("header:click",r.name,h.value),o(r.name,h.value))};return e({expand:()=>{!r.disabled&&!h.value&&(h.value=!0,s("header:click",r.name,h.value),o(r.name,h.value))},toggle:()=>{r.disabled||u()},collapse:()=>{!r.disabled&&h.value&&!d.value&&(h.value=!1,s("header:click",r.name,h.value),o(r.name,h.value))},expanded:i.readonly(h)}),(p,y)=>{const b=lf;return i.openBlock(),i.createElementBlock("div",{"data-name":t.name,class:i.normalizeClass({"sc-collapse-item flex flex-col p-2":!0,"cursor-not-allowed text-gray-400":t.disabled})},[i.createElementVNode("div",df,[i.createElementVNode("div",hf,[i.createElementVNode("div",{class:i.normalizeClass({"rotate-90":h.value}),onClick:u},[i.renderSlot(p.$slots,"arrow",{},()=>[i.createVNode(b)],!0)],2)]),i.unref(Kn).hasSlotContent(p.$slots["pre-arrow"])?(i.openBlock(),i.createElementBlock("div",uf,[i.createElementVNode("div",ff,[i.renderSlot(p.$slots,"pre-arrow",{},void 0,!0)])])):i.createCommentVNode("",!0),i.createElementVNode("div",gf,[i.createElementVNode("div",{class:"sc-collapse-item-title flex flex-1 cursor-pointer flex-col text-lg font-semibold",onClick:u},[i.renderSlot(p.$slots,"header",{},()=>[i.createTextVNode(i.toDisplayString(t.title),1)],!0)]),i.unref(Kn).hasSlotContent(p.$slots["sub-header"])?(i.openBlock(),i.createElementBlock("div",mf,[i.renderSlot(p.$slots,"sub-header",{},void 0,!0)])):i.createCommentVNode("",!0)]),i.unref(Kn).hasSlotContent(p.$slots["header-extra"])?(i.openBlock(),i.createElementBlock("div",pf,[i.renderSlot(p.$slots,"header-extra",{},void 0,!0)])):i.createCommentVNode("",!0)]),i.createVNode(i.Transition,{name:"fade"},{default:i.withCtx(()=>[d.value||h.value?(i.openBlock(),i.createElementBlock("div",yf,[i.renderSlot(p.$slots,"default",{},void 0,!0)])):i.createCommentVNode("",!0)]),_:3})],10,cf)}}}),Zn=(t,e)=>{const n=t.__vccOpts||t;for(const[r,s]of e)n[r]=s;return n},Da=Zn(_f,[["__scopeId","data-v-415a3dda"]]),wf={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function xf(t,e){return i.openBlock(),i.createElementBlock("svg",wf,[...e[0]||(e[0]=[i.createElementVNode("circle",{cx:"176",cy:"416",r:"16",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),i.createElementVNode("circle",{cx:"400",cy:"416",r:"16",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M48 80h64l48 272h256"},null,-1),i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M160 288h249.44a8 8 0 0 0 7.85-6.43l28.8-144a8 8 0 0 0-7.85-9.57H128"},null,-1)])])}const vf=i.markRaw({name:"ion-cart-outline",render:xf}),$r=Symbol(),kf={Button:{border:"1px solid grey"},Card:{paddingMedium:"1rem"},Checkbox:{border:"1px solid rgb(12, 88, 32)"},Common:{borderRadius:"0.5rem",borderRadiusSmall:"0.25rem",fontWeight:"500",fontWeightStrong:"600",fontSize:"0.75rem",fontSizeMedium:"0.75rem",fontSizeLarge:"0.8125rem",lineHeight:"1.25rem",heightSmall:"24px",heightMedium:"30px",heightTiny:"20px",heightLarge:"36px",heightHuge:"42px",primaryColor:"#FFCC40FF",primaryColorHover:"#FFE49BFF",primaryColorPressed:"#FFBB00FF",primaryColorSuppl:"#FCC42AFF",successColor:"#4AC99BFF",successColorHover:"#4AC99BBF",successColorPressed:"#21AA78FF",errorColor:"#F45725FF",errorColorHover:"#F4572599",textColorBase:"#191C30E5",textColorDisabled:"#191C30E5"},DataTable:{borderColor:"rgb(207, 207, 207)",lineHeight:1.4,tdColorHover:"rgb(250,250,250)",thColor:"rgb(231, 231, 231)",thFontWeight:400,thPaddingMedium:"8px",tdPaddingMedium:"8px",thTextColor:"rgb(22, 0, 108)"},Drawer:{closeIconColor:"rgba(31, 34, 37, 1)",closeIconColorHover:"rgba(10, 157, 5, 1)"},Form:{marginBottom:0,lineHeight:1,labelFontSizeTopMedium:"0.75rem",labelHeightMedium:"20px",labelFontWeight:500,labelTextColor:"rgba(27, 31, 59, 0.65)",labelPaddingVertical:"0",labelPaddingHorizontal:"0"},Input:{paddingMedium:"0.5rem",fontSizeMedium:"0.9125rem",lineHeight:"1.25rem",lineHeightTextarea:"1.25rem",border:"1px solid #E0E0E0",borderRadius:"0.5rem",iconSize:"1,125rem"},Tabs:{tabFontSizeMedium:"0.9375rem",tabColorSegment:"#FFCC40FF",tabBorderColor:"#CCCCCCFF"}},Cf={class:"flex flex-col-reverse gap-2.5 sm:flex-row"},Sf={},Ha=i.defineComponent({...Sf,__name:"product-actions",props:{eventEmitter:{},showProductAddToCartButton:{type:[Boolean,String,Function],default:!1},showProductEditButton:{type:[Boolean,String,Function],default:!1},showProductRequiredButton:{type:[Boolean,String,Function],default:!1},productContextButtonsConfig:{type:Function,default:void 0},product:{}},setup(t){const e=t,n=i.inject($r,"medium"),r=i.computed(()=>O.isFunction(e.showProductAddToCartButton)?e.showProductAddToCartButton(e.product):e.showProductAddToCartButton),s=i.computed(()=>O.isFunction(e.showProductEditButton)?e.showProductEditButton(e.product):e.showProductEditButton),o=i.computed(()=>O.isFunction(e.showProductRequiredButton)?e.showProductRequiredButton(e.product):e.showProductRequiredButton),a=i.computed(()=>O.isNil(e.productContextButtonsConfig)?[]:O.isFunction(e.productContextButtonsConfig)?e.productContextButtonsConfig(e.product):e.productContextButtonsConfig),l=()=>{e.eventEmitter.emit("product:add-to-cart",{product:e.product})},c=()=>{e.eventEmitter.emit("product:edit",{product:e.product})},d=()=>{e.eventEmitter.emit("product:required",{product:e.product})},h=u=>{e.eventEmitter.emit("product:context-select",{product:e.product,key:u})};return(u,m)=>{var v;const g=La,f=za,p=z.NButton,y=z.NTooltip,b=Ia,_=vf,C=Oa,S=z.NDropdown;return i.openBlock(),i.createElementBlock("div",Cf,[o.value?(i.openBlock(),i.createBlock(y,{key:0,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(p,{ghost:!0,size:i.unref(n),disabled:o.value==="disabled",type:t.product.isRequired?"primary":"default",onClick:d},{default:i.withCtx(()=>[t.product.isRequired?(i.openBlock(),i.createBlock(f,{key:1})):(i.openBlock(),i.createBlock(g,{key:0}))]),_:1},8,["size","disabled","type"])]),default:i.withCtx(()=>[m[0]||(m[0]=i.createTextVNode(" Товар, который нужно предлагать клиенту ",-1))]),_:1})):i.createCommentVNode("",!0),s.value?(i.openBlock(),i.createBlock(y,{key:1,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(p,{ghost:!0,size:i.unref(n),type:"primary",disabled:s.value==="disabled",onClick:c},{default:i.withCtx(()=>[i.createVNode(b)]),_:1},8,["size","disabled"])]),default:i.withCtx(()=>[m[1]||(m[1]=i.createTextVNode(" Редактировать ",-1))]),_:1})):i.createCommentVNode("",!0),r.value?(i.openBlock(),i.createBlock(y,{key:2,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(p,{ghost:!0,size:i.unref(n),disabled:r.value==="disabled",type:"primary",onClick:l},{default:i.withCtx(()=>[i.createVNode(_)]),_:1},8,["size","disabled"])]),default:i.withCtx(()=>[m[2]||(m[2]=i.createTextVNode(" Добавить в корзину ",-1))]),_:1})):i.createCommentVNode("",!0),((v=a.value)==null?void 0:v.length)>0?(i.openBlock(),i.createBlock(S,{key:3,options:a.value,size:i.unref(n),trigger:"click",onSelect:h},{default:i.withCtx(()=>[i.createVNode(p,{ghost:!0,size:i.unref(n),type:"primary"},{default:i.withCtx(()=>[i.createVNode(C)]),_:1},8,["size"])]),_:1},8,["options","size"])):i.createCommentVNode("",!0)])}}}),Bf={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Tf(t,e){return i.openBlock(),i.createElementBlock("svg",Bf,[...e[0]||(e[0]=[i.createElementVNode("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[i.createElementVNode("path",{d:"M12 8v4l2 2"}),i.createElementVNode("path",{d:"M3.05 11a9 9 0 1 1 .5 4m-.5 5v-5h5"})],-1)])])}const Rf=i.markRaw({name:"tabler-history",render:Tf}),$f={class:"flex flex-row gap-1"},Ef={key:0,class:"flex flex-row text-nowrap text-sm line-through"},Nf={key:1,class:"flex flex-row text-nowrap text-sm"},Pf={key:2,class:"flex flex-row gap-1 text-nowrap text-sm text-gray-600"},Ff={},Er=i.defineComponent({...Ff,__name:"product-cost",props:{product:{},additionalThroughFieldName:{},costFieldName:{},eventEmitter:{},allowPriceClick:{type:[Boolean,Function],default:!1},showTag:{type:Boolean,default:!1},showQuantityUnit:{type:Boolean,default:!1},showCostDate:{type:Boolean,default:!1},showPriceHistory:{type:Boolean,default:!1},currencyRates:{default:void 0}},setup(t){const e=t,n=i.computed(()=>O.find(e.product.priceCoefficients,["coefficient.slug",e.costFieldName])),r=i.computed(()=>n.value?n.value.cost:O.get(e.product,e.costFieldName)),s=i.computed(()=>e.additionalThroughFieldName?O.get(e.product,e.additionalThroughFieldName):void 0),o=i.computed(()=>e.product.costDate?Mn.format(e.product.costDate,G.AppConfigProvider.getConfig().dateFormats.uiDate):void 0),a=i.computed(()=>(O.isFunction(e.allowPriceClick)?e.allowPriceClick(e.product):e.allowPriceClick)&&!O.isNil(r.value)),l=i.computed(()=>O.isNil(r.value)?"-":new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:2}).format(Number.parseFloat(r.value))),c=i.computed(()=>{if(e.product.currencySignature==="RUB"||!e.currencyRates||!e.currencyRates[e.product.currencySignature])return null;const h=e.currencyRates[e.product.currencySignature];return new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:2}).format(Number.parseFloat(r.value)*h)}),d=i.computed(()=>O.isNil(s.value)?null:new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:2}).format(s.value));return(h,u)=>{var p;const m=z.NTag,g=z.NTooltip,f=Rf;return i.openBlock(),i.createElementBlock("div",$f,[t.showTag?(i.openBlock(),i.createBlock(g,{key:0},{trigger:i.withCtx(()=>[i.createVNode(m,{round:"",bordered:!1,size:"small",class:i.normalizeClass(["text-slate-600",{"font-bold":!n.value}])},{default:i.withCtx(()=>{var y;return[i.createTextVNode(i.toDisplayString(((y=n.value)==null?void 0:y.coefficient.slug)??"Ц"),1)]}),_:1},8,["class"])]),default:i.withCtx(()=>{var y;return[i.createTextVNode(" "+i.toDisplayString(((y=n.value)==null?void 0:y.coefficient.name)??"Розничная цена"),1)]}),_:1})):i.createCommentVNode("",!0),i.createElementVNode("div",null,[s.value&&s.value!==r.value?(i.openBlock(),i.createElementBlock("span",Ef,i.toDisplayString(d.value)+" "+i.toDisplayString(t.showQuantityUnit?` ${t.product.currency}/${t.product.quantityUnit}`:""),1)):i.createCommentVNode("",!0),i.createElementVNode("span",{class:i.normalizeClass(["whitespace-nowrap text-base",{"text-gray-600":(p=n.value)==null?void 0:p.readOnly,"font-bold":!n.value}])},[i.createElementVNode("span",{class:i.normalizeClass({"text-nowrap":!0,"cursor-pointer underline decoration-dashed":a.value&&t.eventEmitter}),onClick:u[0]||(u[0]=()=>{var y;a.value&&((y=t.eventEmitter)==null||y.emit("cost:click",{product:t.product,cost:r.value}))})},i.toDisplayString(l.value),3),i.createTextVNode(" "+i.toDisplayString(t.showQuantityUnit?` ${t.product.currency}/${t.product.quantityUnit}`:""),1)],2),c.value?(i.openBlock(),i.createElementBlock("span",Nf," ~ "+i.toDisplayString(c.value)+" "+i.toDisplayString(t.showQuantityUnit?`₽/${t.product.quantityUnit}`:""),1)):i.createCommentVNode("",!0),t.showCostDate&&!i.unref(O.isNil)(o.value)?(i.openBlock(),i.createElementBlock("span",Pf,[i.createTextVNode(i.toDisplayString(o.value)+" ",1),t.showPriceHistory&&t.eventEmitter?(i.openBlock(),i.createBlock(g,{key:0,placement:"top-end"},{trigger:i.withCtx(()=>[i.createVNode(f,{class:"cursor-pointer",onClick:u[1]||(u[1]=y=>{var b;return(b=t.eventEmitter)==null?void 0:b.emit("cost:show-price-history",{product:t.product})})})]),default:i.withCtx(()=>[u[2]||(u[2]=i.createTextVNode(" История цен ",-1))]),_:1})):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)])])}}}),Mf={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Af(t,e){return i.openBlock(),i.createElementBlock("svg",Mf,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-miterlimit":"10","stroke-width":"32",d:"M248 64C146.39 64 64 146.39 64 248s82.39 184 184 184s184-82.39 184-184S349.61 64 248 64Z"},null,-1),i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M220 220h32v116"},null,-1),i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-miterlimit":"10","stroke-width":"32",d:"M208 340h88"},null,-1),i.createElementVNode("path",{fill:"currentColor",d:"M248 130a26 26 0 1 0 26 26a26 26 0 0 0-26-26"},null,-1)])])}const Fs=i.markRaw({name:"ion-information-circle-outline",render:Af}),Vf={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Of(t,e){return i.openBlock(),i.createElementBlock("svg",Vf,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"currentColor",d:"M450.29 112H142c-34 0-62 27.51-62 61.33v245.34c0 33.82 28 61.33 62 61.33h308c34 0 62-26.18 62-60V173.33c0-33.82-27.68-61.33-61.71-61.33m-77.15 61.34a46 46 0 1 1-46.28 46a46.19 46.19 0 0 1 46.28-46.01Zm-231.55 276c-17 0-29.86-13.75-29.86-30.66v-64.83l90.46-80.79a46.54 46.54 0 0 1 63.44 1.83L328.27 337l-113 112.33ZM480 418.67a30.67 30.67 0 0 1-30.71 30.66H259L376.08 333a46.24 46.24 0 0 1 59.44-.16L480 370.59Z"},null,-1),i.createElementVNode("path",{fill:"currentColor",d:"M384 32H64A64 64 0 0 0 0 96v256a64.11 64.11 0 0 0 48 62V152a72 72 0 0 1 72-72h326a64.11 64.11 0 0 0-62-48"},null,-1)])])}const Wa=i.markRaw({name:"ion-images",render:Of});/*!
2
2
  * lightgallery | 2.9.0 | October 1st 2025
3
3
  * http://www.lightgalleryjs.com/
4
4
  * Copyright (c) 2020 Sachin Neravath;
@@ -16,10 +16,10 @@
16
16
  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
17
17
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
18
18
  PERFORMANCE OF THIS SOFTWARE.
19
- ***************************************************************************** */var Nr=function(){return Nr=Object.assign||function(e){for(var n,r=1,s=arguments.length;r<s;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},Nr.apply(this,arguments)},If={thumbnail:!0,animateThumb:!0,currentPagerPosition:"middle",alignThumbnails:"middle",thumbWidth:100,thumbHeight:"80px",thumbMargin:5,appendThumbnailsTo:".lg-components",toggleThumb:!1,enableThumbDrag:!0,enableThumbSwipe:!0,thumbnailSwipeThreshold:10,loadYouTubeThumbnail:!0,youTubeThumbSize:1,thumbnailPluginStrings:{toggleThumbnails:"Toggle thumbnails"}},Qi={containerResize:"lgContainerResize",updateSlides:"lgUpdateSlides",beforeOpen:"lgBeforeOpen",beforeSlide:"lgBeforeSlide"},zf=function(){function t(e,n){return this.thumbOuterWidth=0,this.thumbTotalWidth=0,this.translateX=0,this.thumbClickable=!1,this.core=e,this.$LG=n,this}return t.prototype.init=function(){this.settings=Nr(Nr({},If),this.core.settings),this.thumbOuterWidth=0,this.thumbTotalWidth=this.core.galleryItems.length*(this.settings.thumbWidth+this.settings.thumbMargin),this.translateX=0,this.setAnimateThumbStyles(),this.core.settings.allowMediaOverlap||(this.settings.toggleThumb=!1),this.settings.thumbnail&&(this.build(),this.settings.animateThumb?(this.settings.enableThumbDrag&&this.enableThumbDrag(),this.settings.enableThumbSwipe&&this.enableThumbSwipe(),this.thumbClickable=!1):this.thumbClickable=!0,this.toggleThumbBar(),this.thumbKeyPress())},t.prototype.build=function(){var e=this;this.setThumbMarkup(),this.manageActiveClassOnSlideChange(),this.$lgThumb.first().on("click.lg touchend.lg",function(n){var r=e.$LG(n.target);r.hasAttribute("data-lg-item-id")&&setTimeout(function(){if(e.thumbClickable&&!e.core.lgBusy){var s=parseInt(r.attr("data-lg-item-id"));e.core.slide(s,!1,!0,!1)}},50)}),this.core.LGel.on(Qi.beforeSlide+".thumb",function(n){var r=n.detail.index;e.animateThumb(r)}),this.core.LGel.on(Qi.beforeOpen+".thumb",function(){e.thumbOuterWidth=e.core.outer.get().offsetWidth}),this.core.LGel.on(Qi.updateSlides+".thumb",function(){e.rebuildThumbnails()}),this.core.LGel.on(Qi.containerResize+".thumb",function(){e.core.lgOpened&&setTimeout(function(){e.thumbOuterWidth=e.core.outer.get().offsetWidth,e.animateThumb(e.core.index),e.thumbOuterWidth=e.core.outer.get().offsetWidth},50)})},t.prototype.setThumbMarkup=function(){var e="lg-thumb-outer ";this.settings.alignThumbnails&&(e+="lg-thumb-align-"+this.settings.alignThumbnails);var n='<div class="'+e+`">
19
+ ***************************************************************************** */var Nr=function(){return Nr=Object.assign||function(e){for(var n,r=1,s=arguments.length;r<s;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},Nr.apply(this,arguments)},If={thumbnail:!0,animateThumb:!0,currentPagerPosition:"middle",alignThumbnails:"middle",thumbWidth:100,thumbHeight:"80px",thumbMargin:5,appendThumbnailsTo:".lg-components",toggleThumb:!1,enableThumbDrag:!0,enableThumbSwipe:!0,thumbnailSwipeThreshold:10,loadYouTubeThumbnail:!0,youTubeThumbSize:1,thumbnailPluginStrings:{toggleThumbnails:"Toggle thumbnails"}},er={containerResize:"lgContainerResize",updateSlides:"lgUpdateSlides",beforeOpen:"lgBeforeOpen",beforeSlide:"lgBeforeSlide"},zf=(function(){function t(e,n){return this.thumbOuterWidth=0,this.thumbTotalWidth=0,this.translateX=0,this.thumbClickable=!1,this.core=e,this.$LG=n,this}return t.prototype.init=function(){this.settings=Nr(Nr({},If),this.core.settings),this.thumbOuterWidth=0,this.thumbTotalWidth=this.core.galleryItems.length*(this.settings.thumbWidth+this.settings.thumbMargin),this.translateX=0,this.setAnimateThumbStyles(),this.core.settings.allowMediaOverlap||(this.settings.toggleThumb=!1),this.settings.thumbnail&&(this.build(),this.settings.animateThumb?(this.settings.enableThumbDrag&&this.enableThumbDrag(),this.settings.enableThumbSwipe&&this.enableThumbSwipe(),this.thumbClickable=!1):this.thumbClickable=!0,this.toggleThumbBar(),this.thumbKeyPress())},t.prototype.build=function(){var e=this;this.setThumbMarkup(),this.manageActiveClassOnSlideChange(),this.$lgThumb.first().on("click.lg touchend.lg",function(n){var r=e.$LG(n.target);r.hasAttribute("data-lg-item-id")&&setTimeout(function(){if(e.thumbClickable&&!e.core.lgBusy){var s=parseInt(r.attr("data-lg-item-id"));e.core.slide(s,!1,!0,!1)}},50)}),this.core.LGel.on(er.beforeSlide+".thumb",function(n){var r=n.detail.index;e.animateThumb(r)}),this.core.LGel.on(er.beforeOpen+".thumb",function(){e.thumbOuterWidth=e.core.outer.get().offsetWidth}),this.core.LGel.on(er.updateSlides+".thumb",function(){e.rebuildThumbnails()}),this.core.LGel.on(er.containerResize+".thumb",function(){e.core.lgOpened&&setTimeout(function(){e.thumbOuterWidth=e.core.outer.get().offsetWidth,e.animateThumb(e.core.index),e.thumbOuterWidth=e.core.outer.get().offsetWidth},50)})},t.prototype.setThumbMarkup=function(){var e="lg-thumb-outer ";this.settings.alignThumbnails&&(e+="lg-thumb-align-"+this.settings.alignThumbnails);var n='<div class="'+e+`">
20
20
  <div class="lg-thumb lg-group">
21
21
  </div>
22
- </div>`;this.core.outer.addClass("lg-has-thumb"),this.settings.appendThumbnailsTo===".lg-components"?this.core.$lgComponents.append(n):this.core.outer.append(n),this.$thumbOuter=this.core.outer.find(".lg-thumb-outer").first(),this.$lgThumb=this.core.outer.find(".lg-thumb").first(),this.settings.animateThumb&&this.core.outer.find(".lg-thumb").css("transition-duration",this.core.settings.speed+"ms").css("width",this.thumbTotalWidth+"px").css("position","relative"),this.setThumbItemHtml(this.core.galleryItems)},t.prototype.enableThumbDrag=function(){var e=this,n={cords:{startX:0,endX:0},isMoved:!1,newTranslateX:0,startTime:new Date,endTime:new Date,touchMoveTime:0},r=!1;this.$thumbOuter.addClass("lg-grab"),this.core.outer.find(".lg-thumb").first().on("mousedown.lg.thumb",function(s){e.thumbTotalWidth>e.thumbOuterWidth&&(s.preventDefault(),n.cords.startX=s.pageX,n.startTime=new Date,e.thumbClickable=!1,r=!0,e.core.outer.get().scrollLeft+=1,e.core.outer.get().scrollLeft-=1,e.$thumbOuter.removeClass("lg-grab").addClass("lg-grabbing"))}),this.$LG(window).on("mousemove.lg.thumb.global"+this.core.lgId,function(s){e.core.lgOpened&&r&&(n.cords.endX=s.pageX,n=e.onThumbTouchMove(n))}),this.$LG(window).on("mouseup.lg.thumb.global"+this.core.lgId,function(){e.core.lgOpened&&(n.isMoved?n=e.onThumbTouchEnd(n):e.thumbClickable=!0,r&&(r=!1,e.$thumbOuter.removeClass("lg-grabbing").addClass("lg-grab")))})},t.prototype.enableThumbSwipe=function(){var e=this,n={cords:{startX:0,endX:0},isMoved:!1,newTranslateX:0,startTime:new Date,endTime:new Date,touchMoveTime:0};this.$lgThumb.on("touchstart.lg",function(r){e.thumbTotalWidth>e.thumbOuterWidth&&(r.preventDefault(),n.cords.startX=r.targetTouches[0].pageX,e.thumbClickable=!1,n.startTime=new Date)}),this.$lgThumb.on("touchmove.lg",function(r){e.thumbTotalWidth>e.thumbOuterWidth&&(r.preventDefault(),n.cords.endX=r.targetTouches[0].pageX,n=e.onThumbTouchMove(n))}),this.$lgThumb.on("touchend.lg",function(){n.isMoved?n=e.onThumbTouchEnd(n):e.thumbClickable=!0})},t.prototype.rebuildThumbnails=function(){var e=this;this.$thumbOuter.addClass("lg-rebuilding-thumbnails"),setTimeout(function(){e.thumbTotalWidth=e.core.galleryItems.length*(e.settings.thumbWidth+e.settings.thumbMargin),e.$lgThumb.css("width",e.thumbTotalWidth+"px"),e.$lgThumb.empty(),e.setThumbItemHtml(e.core.galleryItems),e.animateThumb(e.core.index)},50),setTimeout(function(){e.$thumbOuter.removeClass("lg-rebuilding-thumbnails")},200)},t.prototype.setTranslate=function(e){this.$lgThumb.css("transform","translate3d(-"+e+"px, 0px, 0px)")},t.prototype.getPossibleTransformX=function(e){return e>this.thumbTotalWidth-this.thumbOuterWidth&&(e=this.thumbTotalWidth-this.thumbOuterWidth),e<0&&(e=0),e},t.prototype.animateThumb=function(e){if(this.$lgThumb.css("transition-duration",this.core.settings.speed+"ms"),this.settings.animateThumb){var n=0;switch(this.settings.currentPagerPosition){case"left":n=0;break;case"middle":n=this.thumbOuterWidth/2-this.settings.thumbWidth/2;break;case"right":n=this.thumbOuterWidth-this.settings.thumbWidth}this.translateX=(this.settings.thumbWidth+this.settings.thumbMargin)*e-1-n,this.translateX>this.thumbTotalWidth-this.thumbOuterWidth&&(this.translateX=this.thumbTotalWidth-this.thumbOuterWidth),this.translateX<0&&(this.translateX=0),this.setTranslate(this.translateX)}},t.prototype.onThumbTouchMove=function(e){return e.newTranslateX=this.translateX,e.isMoved=!0,e.touchMoveTime=new Date().valueOf(),e.newTranslateX-=e.cords.endX-e.cords.startX,e.newTranslateX=this.getPossibleTransformX(e.newTranslateX),this.setTranslate(e.newTranslateX),this.$thumbOuter.addClass("lg-dragging"),e},t.prototype.onThumbTouchEnd=function(e){e.isMoved=!1,e.endTime=new Date,this.$thumbOuter.removeClass("lg-dragging");var n=e.endTime.valueOf()-e.startTime.valueOf(),r=e.cords.endX-e.cords.startX,s=Math.abs(r)/n;return s>.15&&e.endTime.valueOf()-e.touchMoveTime<30?(s+=1,s>2&&(s+=1),s=s+s*(Math.abs(r)/this.thumbOuterWidth),this.$lgThumb.css("transition-duration",Math.min(s-1,2)+"settings"),r=r*s,this.translateX=this.getPossibleTransformX(this.translateX-r),this.setTranslate(this.translateX)):this.translateX=e.newTranslateX,Math.abs(e.cords.endX-e.cords.startX)<this.settings.thumbnailSwipeThreshold&&(this.thumbClickable=!0),e},t.prototype.getThumbHtml=function(e,n,r){var s=this.core.galleryItems[n].__slideVideoInfo||{},o;s.youtube&&this.settings.loadYouTubeThumbnail?o="//img.youtube.com/vi/"+s.youtube[1]+"/"+this.settings.youTubeThumbSize+".jpg":o=e;var a=document.createElement("div");a.setAttribute("data-lg-item-id",n+""),a.className="lg-thumb-item "+(n===this.core.index?"active":""),a.style.cssText="width: "+this.settings.thumbWidth+"px; height: "+this.settings.thumbHeight+"; margin-right: "+this.settings.thumbMargin+"px;";var l=document.createElement("img");return l.alt=r||"",l.setAttribute("data-lg-item-id",n+""),l.src=o,a.appendChild(l),a},t.prototype.setThumbItemHtml=function(e){for(var n=0;n<e.length;n++){var r=this.getThumbHtml(e[n].thumb,n,e[n].alt);this.$lgThumb.append(r)}},t.prototype.setAnimateThumbStyles=function(){this.settings.animateThumb&&this.core.outer.addClass("lg-animate-thumb")},t.prototype.manageActiveClassOnSlideChange=function(){var e=this;this.core.LGel.on(Qi.beforeSlide+".thumb",function(n){var r=e.core.outer.find(".lg-thumb-item"),s=n.detail.index;r.removeClass("active"),r.eq(s).addClass("active")})},t.prototype.toggleThumbBar=function(){var e=this;this.settings.toggleThumb&&(this.core.outer.addClass("lg-can-toggle"),this.core.$toolbar.append('<button type="button" aria-label="'+this.settings.thumbnailPluginStrings.toggleThumbnails+'" class="lg-toggle-thumb lg-icon"></button>'),this.core.outer.find(".lg-toggle-thumb").first().on("click.lg",function(){e.core.outer.toggleClass("lg-components-open")}))},t.prototype.thumbKeyPress=function(){var e=this;this.$LG(window).on("keydown.lg.thumb.global"+this.core.lgId,function(n){!e.core.lgOpened||!e.settings.toggleThumb||(n.keyCode===38?(n.preventDefault(),e.core.outer.addClass("lg-components-open")):n.keyCode===40&&(n.preventDefault(),e.core.outer.removeClass("lg-components-open")))})},t.prototype.destroy=function(){this.settings.thumbnail&&(this.$LG(window).off(".lg.thumb.global"+this.core.lgId),this.core.LGel.off(".lg.thumb"),this.core.LGel.off(".thumb"),this.$thumbOuter.remove(),this.core.outer.removeClass("lg-has-thumb"))},t}();/*!
22
+ </div>`;this.core.outer.addClass("lg-has-thumb"),this.settings.appendThumbnailsTo===".lg-components"?this.core.$lgComponents.append(n):this.core.outer.append(n),this.$thumbOuter=this.core.outer.find(".lg-thumb-outer").first(),this.$lgThumb=this.core.outer.find(".lg-thumb").first(),this.settings.animateThumb&&this.core.outer.find(".lg-thumb").css("transition-duration",this.core.settings.speed+"ms").css("width",this.thumbTotalWidth+"px").css("position","relative"),this.setThumbItemHtml(this.core.galleryItems)},t.prototype.enableThumbDrag=function(){var e=this,n={cords:{startX:0,endX:0},isMoved:!1,newTranslateX:0,startTime:new Date,endTime:new Date,touchMoveTime:0},r=!1;this.$thumbOuter.addClass("lg-grab"),this.core.outer.find(".lg-thumb").first().on("mousedown.lg.thumb",function(s){e.thumbTotalWidth>e.thumbOuterWidth&&(s.preventDefault(),n.cords.startX=s.pageX,n.startTime=new Date,e.thumbClickable=!1,r=!0,e.core.outer.get().scrollLeft+=1,e.core.outer.get().scrollLeft-=1,e.$thumbOuter.removeClass("lg-grab").addClass("lg-grabbing"))}),this.$LG(window).on("mousemove.lg.thumb.global"+this.core.lgId,function(s){e.core.lgOpened&&r&&(n.cords.endX=s.pageX,n=e.onThumbTouchMove(n))}),this.$LG(window).on("mouseup.lg.thumb.global"+this.core.lgId,function(){e.core.lgOpened&&(n.isMoved?n=e.onThumbTouchEnd(n):e.thumbClickable=!0,r&&(r=!1,e.$thumbOuter.removeClass("lg-grabbing").addClass("lg-grab")))})},t.prototype.enableThumbSwipe=function(){var e=this,n={cords:{startX:0,endX:0},isMoved:!1,newTranslateX:0,startTime:new Date,endTime:new Date,touchMoveTime:0};this.$lgThumb.on("touchstart.lg",function(r){e.thumbTotalWidth>e.thumbOuterWidth&&(r.preventDefault(),n.cords.startX=r.targetTouches[0].pageX,e.thumbClickable=!1,n.startTime=new Date)}),this.$lgThumb.on("touchmove.lg",function(r){e.thumbTotalWidth>e.thumbOuterWidth&&(r.preventDefault(),n.cords.endX=r.targetTouches[0].pageX,n=e.onThumbTouchMove(n))}),this.$lgThumb.on("touchend.lg",function(){n.isMoved?n=e.onThumbTouchEnd(n):e.thumbClickable=!0})},t.prototype.rebuildThumbnails=function(){var e=this;this.$thumbOuter.addClass("lg-rebuilding-thumbnails"),setTimeout(function(){e.thumbTotalWidth=e.core.galleryItems.length*(e.settings.thumbWidth+e.settings.thumbMargin),e.$lgThumb.css("width",e.thumbTotalWidth+"px"),e.$lgThumb.empty(),e.setThumbItemHtml(e.core.galleryItems),e.animateThumb(e.core.index)},50),setTimeout(function(){e.$thumbOuter.removeClass("lg-rebuilding-thumbnails")},200)},t.prototype.setTranslate=function(e){this.$lgThumb.css("transform","translate3d(-"+e+"px, 0px, 0px)")},t.prototype.getPossibleTransformX=function(e){return e>this.thumbTotalWidth-this.thumbOuterWidth&&(e=this.thumbTotalWidth-this.thumbOuterWidth),e<0&&(e=0),e},t.prototype.animateThumb=function(e){if(this.$lgThumb.css("transition-duration",this.core.settings.speed+"ms"),this.settings.animateThumb){var n=0;switch(this.settings.currentPagerPosition){case"left":n=0;break;case"middle":n=this.thumbOuterWidth/2-this.settings.thumbWidth/2;break;case"right":n=this.thumbOuterWidth-this.settings.thumbWidth}this.translateX=(this.settings.thumbWidth+this.settings.thumbMargin)*e-1-n,this.translateX>this.thumbTotalWidth-this.thumbOuterWidth&&(this.translateX=this.thumbTotalWidth-this.thumbOuterWidth),this.translateX<0&&(this.translateX=0),this.setTranslate(this.translateX)}},t.prototype.onThumbTouchMove=function(e){return e.newTranslateX=this.translateX,e.isMoved=!0,e.touchMoveTime=new Date().valueOf(),e.newTranslateX-=e.cords.endX-e.cords.startX,e.newTranslateX=this.getPossibleTransformX(e.newTranslateX),this.setTranslate(e.newTranslateX),this.$thumbOuter.addClass("lg-dragging"),e},t.prototype.onThumbTouchEnd=function(e){e.isMoved=!1,e.endTime=new Date,this.$thumbOuter.removeClass("lg-dragging");var n=e.endTime.valueOf()-e.startTime.valueOf(),r=e.cords.endX-e.cords.startX,s=Math.abs(r)/n;return s>.15&&e.endTime.valueOf()-e.touchMoveTime<30?(s+=1,s>2&&(s+=1),s=s+s*(Math.abs(r)/this.thumbOuterWidth),this.$lgThumb.css("transition-duration",Math.min(s-1,2)+"settings"),r=r*s,this.translateX=this.getPossibleTransformX(this.translateX-r),this.setTranslate(this.translateX)):this.translateX=e.newTranslateX,Math.abs(e.cords.endX-e.cords.startX)<this.settings.thumbnailSwipeThreshold&&(this.thumbClickable=!0),e},t.prototype.getThumbHtml=function(e,n,r){var s=this.core.galleryItems[n].__slideVideoInfo||{},o;s.youtube&&this.settings.loadYouTubeThumbnail?o="//img.youtube.com/vi/"+s.youtube[1]+"/"+this.settings.youTubeThumbSize+".jpg":o=e;var a=document.createElement("div");a.setAttribute("data-lg-item-id",n+""),a.className="lg-thumb-item "+(n===this.core.index?"active":""),a.style.cssText="width: "+this.settings.thumbWidth+"px; height: "+this.settings.thumbHeight+"; margin-right: "+this.settings.thumbMargin+"px;";var l=document.createElement("img");return l.alt=r||"",l.setAttribute("data-lg-item-id",n+""),l.src=o,a.appendChild(l),a},t.prototype.setThumbItemHtml=function(e){for(var n=0;n<e.length;n++){var r=this.getThumbHtml(e[n].thumb,n,e[n].alt);this.$lgThumb.append(r)}},t.prototype.setAnimateThumbStyles=function(){this.settings.animateThumb&&this.core.outer.addClass("lg-animate-thumb")},t.prototype.manageActiveClassOnSlideChange=function(){var e=this;this.core.LGel.on(er.beforeSlide+".thumb",function(n){var r=e.core.outer.find(".lg-thumb-item"),s=n.detail.index;r.removeClass("active"),r.eq(s).addClass("active")})},t.prototype.toggleThumbBar=function(){var e=this;this.settings.toggleThumb&&(this.core.outer.addClass("lg-can-toggle"),this.core.$toolbar.append('<button type="button" aria-label="'+this.settings.thumbnailPluginStrings.toggleThumbnails+'" class="lg-toggle-thumb lg-icon"></button>'),this.core.outer.find(".lg-toggle-thumb").first().on("click.lg",function(){e.core.outer.toggleClass("lg-components-open")}))},t.prototype.thumbKeyPress=function(){var e=this;this.$LG(window).on("keydown.lg.thumb.global"+this.core.lgId,function(n){!e.core.lgOpened||!e.settings.toggleThumb||(n.keyCode===38?(n.preventDefault(),e.core.outer.addClass("lg-components-open")):n.keyCode===40&&(n.preventDefault(),e.core.outer.removeClass("lg-components-open")))})},t.prototype.destroy=function(){this.settings.thumbnail&&(this.$LG(window).off(".lg.thumb.global"+this.core.lgId),this.core.LGel.off(".lg.thumb"),this.core.LGel.off(".thumb"),this.$thumbOuter.remove(),this.core.outer.removeClass("lg-has-thumb"))},t})();/*!
23
23
  * lightgallery | 2.9.0 | October 1st 2025
24
24
  * http://www.lightgalleryjs.com/
25
25
  * Copyright (c) 2020 Sachin Neravath;
@@ -37,7 +37,7 @@
37
37
  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
38
38
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
39
39
  PERFORMANCE OF THIS SOFTWARE.
40
- ***************************************************************************** */var Pr=function(){return Pr=Object.assign||function(e){for(var n,r=1,s=arguments.length;r<s;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},Pr.apply(this,arguments)},Lf={scale:1,zoom:!0,infiniteZoom:!0,actualSize:!0,showZoomInOutIcons:!1,actualSizeIcons:{zoomIn:"lg-zoom-in",zoomOut:"lg-zoom-out"},enableZoomAfter:300,zoomPluginStrings:{zoomIn:"Zoom in",zoomOut:"Zoom out",viewActualSize:"View actual size"}},bn={containerResize:"lgContainerResize",beforeOpen:"lgBeforeOpen",afterOpen:"lgAfterOpen",slideItemLoad:"lgSlideItemLoad",afterSlide:"lgAfterSlide",rotateLeft:"lgRotateLeft",rotateRight:"lgRotateRight",flipHorizontal:"lgFlipHorizontal",flipVertical:"lgFlipVertical"},Ms=500,Df=function(){function t(e,n){return this.core=e,this.$LG=n,this.settings=Pr(Pr({},Lf),this.core.settings),this}return t.prototype.buildTemplates=function(){var e=this.settings.showZoomInOutIcons?'<button id="'+this.core.getIdName("lg-zoom-in")+'" type="button" aria-label="'+this.settings.zoomPluginStrings.zoomIn+'" class="lg-zoom-in lg-icon"></button><button id="'+this.core.getIdName("lg-zoom-out")+'" type="button" aria-label="'+this.settings.zoomPluginStrings.zoomOut+'" class="lg-zoom-out lg-icon"></button>':"";this.settings.actualSize&&(e+='<button id="'+this.core.getIdName("lg-actual-size")+'" type="button" aria-label="'+this.settings.zoomPluginStrings.viewActualSize+'" class="'+this.settings.actualSizeIcons.zoomIn+' lg-icon"></button>'),this.core.outer.addClass("lg-use-transition-for-zoom"),this.core.$toolbar.first().append(e)},t.prototype.enableZoom=function(e){var n=this,r=this.settings.enableZoomAfter+e.detail.delay;this.$LG("body").first().hasClass("lg-from-hash")&&e.detail.delay?r=0:this.$LG("body").first().removeClass("lg-from-hash"),this.zoomableTimeout=setTimeout(function(){n.isImageSlide(n.core.index)&&(n.core.getSlideItem(e.detail.index).addClass("lg-zoomable"),e.detail.index===n.core.index&&n.setZoomEssentials())},r+30)},t.prototype.enableZoomOnSlideItemLoad=function(){this.core.LGel.on(bn.slideItemLoad+".zoom",this.enableZoom.bind(this))},t.prototype.getDragCords=function(e){return{x:e.pageX,y:e.pageY}},t.prototype.getSwipeCords=function(e){var n=e.touches[0].pageX,r=e.touches[0].pageY;return{x:n,y:r}},t.prototype.getDragAllowedAxises=function(e,n){if(!this.containerRect)return{allowX:!1,allowY:!1};var r=this.core.getSlideItem(this.core.index).find(".lg-image").first().get(),s=0,o=0,a=r.getBoundingClientRect();e?(s=r.offsetHeight*e,o=r.offsetWidth*e):n?(s=a.height+n*a.height,o=a.width+n*a.width):(s=a.height,o=a.width);var l=s>this.containerRect.height,c=o>this.containerRect.width;return{allowX:c,allowY:l}},t.prototype.setZoomEssentials=function(){this.containerRect=this.core.$content.get().getBoundingClientRect()},t.prototype.zoomImage=function(e,n,r,s){if(!(!this.containerRect||Math.abs(n)<=0)){var o=this.containerRect.width/2+this.containerRect.left,a=this.containerRect.height/2+this.containerRect.top+this.scrollTop,l,c;e===1&&(this.positionChanged=!1);var d=this.getDragAllowedAxises(0,n),h=d.allowY,u=d.allowX;this.positionChanged&&(l=this.left/(this.scale-n),c=this.top/(this.scale-n),this.pageX=o-l,this.pageY=a-c,this.positionChanged=!1);var m=this.getPossibleSwipeDragCords(n),f,g,p=o-this.pageX,b=a-this.pageY;if(e-n>1){var y=(e-n)/Math.abs(n);p=(n<0?-p:p)+this.left*(y+(n<0?-1:1)),b=(n<0?-b:b)+this.top*(y+(n<0?-1:1)),f=p/y,g=b/y}else{var y=(e-n)*n;f=p*y,g=b*y}r&&(u?this.isBeyondPossibleLeft(f,m.minX)?f=m.minX:this.isBeyondPossibleRight(f,m.maxX)&&(f=m.maxX):e>1&&(f<m.minX?f=m.minX:f>m.maxX&&(f=m.maxX)),h?this.isBeyondPossibleTop(g,m.minY)?g=m.minY:this.isBeyondPossibleBottom(g,m.maxY)&&(g=m.maxY):e>1&&(g<m.minY?g=m.minY:g>m.maxY&&(g=m.maxY))),this.setZoomStyles({x:f,y:g,scale:e}),this.left=f,this.top=g,s&&this.setZoomImageSize()}},t.prototype.resetImageTranslate=function(e){if(this.isImageSlide(e)){var n=this.core.getSlideItem(e).find(".lg-image").first();this.imageReset=!1,n.removeClass("reset-transition reset-transition-y reset-transition-x"),this.core.outer.removeClass("lg-actual-size"),n.css("width","auto").css("height","auto"),setTimeout(function(){n.removeClass("no-transition")},10)}},t.prototype.setZoomImageSize=function(){var e=this,n=this.core.getSlideItem(this.core.index).find(".lg-image").first();setTimeout(function(){var r=e.getCurrentImageActualSizeScale();e.scale>=r&&(n.addClass("no-transition"),e.imageReset=!0)},Ms),setTimeout(function(){var r=e.getCurrentImageActualSizeScale();if(e.scale>=r){var s=e.getDragAllowedAxises(e.scale);n.css("width",n.get().naturalWidth+"px").css("height",n.get().naturalHeight+"px"),e.core.outer.addClass("lg-actual-size"),s.allowX&&s.allowY?n.addClass("reset-transition"):s.allowX&&!s.allowY?n.addClass("reset-transition-x"):!s.allowX&&s.allowY&&n.addClass("reset-transition-y")}},Ms+50)},t.prototype.setZoomStyles=function(e){var n=this.core.getSlideItem(this.core.index).find(".lg-img-wrap").first(),r=this.core.getSlideItem(this.core.index).find(".lg-image").first(),s=this.core.outer.find(".lg-current .lg-dummy-img").first();this.scale=e.scale,r.css("transform","scale3d("+e.scale+", "+e.scale+", 1)"),s.css("transform","scale3d("+e.scale+", "+e.scale+", 1)");var o="translate3d("+e.x+"px, "+e.y+"px, 0)";n.css("transform",o)},t.prototype.setActualSize=function(e,n){var r=this;if(!this.zoomInProgress){this.zoomInProgress=!0;var s=this.core.galleryItems[this.core.index];this.resetImageTranslate(e),setTimeout(function(){if(!(!s.src||r.core.outer.hasClass("lg-first-slide-loading"))){var o=r.getCurrentImageActualSizeScale(),a=r.scale;r.core.outer.hasClass("lg-zoomed")?r.scale=1:r.scale=r.getScale(o),r.setPageCords(n),r.beginZoom(r.scale),r.zoomImage(r.scale,r.scale-a,!0,!0)}},50),setTimeout(function(){r.core.outer.removeClass("lg-grabbing").addClass("lg-grab")},60),setTimeout(function(){r.zoomInProgress=!1},Ms+110)}},t.prototype.getNaturalWidth=function(e){var n=this.core.getSlideItem(e).find(".lg-image").first(),r=this.core.galleryItems[e].width;return r?parseFloat(r):n.get().naturalWidth},t.prototype.getActualSizeScale=function(e,n){var r,s;return e>=n?(r=e/n,s=r||2):s=1,s},t.prototype.getCurrentImageActualSizeScale=function(){var e=this.core.getSlideItem(this.core.index).find(".lg-image").first(),n=e.get().offsetWidth,r=this.getNaturalWidth(this.core.index)||n;return this.getActualSizeScale(r,n)},t.prototype.getPageCords=function(e){var n={};if(e)n.x=e.pageX||e.touches[0].pageX,n.y=e.pageY||e.touches[0].pageY;else{var r=this.core.$content.get().getBoundingClientRect();n.x=r.width/2+r.left,n.y=r.height/2+this.scrollTop+r.top}return n},t.prototype.setPageCords=function(e){var n=this.getPageCords(e);this.pageX=n.x,this.pageY=n.y},t.prototype.manageActualPixelClassNames=function(){var e=this.core.getElementById("lg-actual-size");e.removeClass(this.settings.actualSizeIcons.zoomIn).addClass(this.settings.actualSizeIcons.zoomOut)},t.prototype.beginZoom=function(e){return this.core.outer.removeClass("lg-zoom-drag-transition lg-zoom-dragging"),e>1?(this.core.outer.addClass("lg-zoomed"),this.manageActualPixelClassNames()):this.resetZoom(),e>1},t.prototype.getScale=function(e){var n=this.getCurrentImageActualSizeScale();return e<1?e=1:e>n&&(e=n),e},t.prototype.init=function(){var e=this;if(this.settings.zoom){this.buildTemplates(),this.enableZoomOnSlideItemLoad();var n=null;this.core.outer.on("dblclick.lg",function(r){e.$LG(r.target).hasClass("lg-image")&&e.setActualSize(e.core.index,r)}),this.core.outer.on("touchstart.lg",function(r){var s=e.$LG(r.target);r.touches.length===1&&s.hasClass("lg-image")&&(n?(clearTimeout(n),n=null,r.preventDefault(),e.setActualSize(e.core.index,r)):n=setTimeout(function(){n=null},300))}),this.core.LGel.on(bn.containerResize+".zoom "+bn.rotateRight+".zoom "+bn.rotateLeft+".zoom "+bn.flipHorizontal+".zoom "+bn.flipVertical+".zoom",function(){if(!(!e.core.lgOpened||!e.isImageSlide(e.core.index)||e.core.touchAction)){var r=e.core.getSlideItem(e.core.index).find(".lg-img-wrap").first();e.top=0,e.left=0,e.setZoomEssentials(),e.setZoomSwipeStyles(r,{x:0,y:0}),e.positionChanged=!0}}),this.$LG(window).on("scroll.lg.zoom.global"+this.core.lgId,function(){e.core.lgOpened&&(e.scrollTop=e.$LG(window).scrollTop())}),this.core.getElementById("lg-zoom-out").on("click.lg",function(){if(e.isImageSlide(e.core.index)){var r=0;e.imageReset&&(e.resetImageTranslate(e.core.index),r=50),setTimeout(function(){var s=e.scale-e.settings.scale;s<1&&(s=1),e.beginZoom(s),e.zoomImage(s,-e.settings.scale,!0,!e.settings.infiniteZoom)},r)}}),this.core.getElementById("lg-zoom-in").on("click.lg",function(){e.zoomIn()}),this.core.getElementById("lg-actual-size").on("click.lg",function(){e.setActualSize(e.core.index)}),this.core.LGel.on(bn.beforeOpen+".zoom",function(){e.core.outer.find(".lg-item").removeClass("lg-zoomable")}),this.core.LGel.on(bn.afterOpen+".zoom",function(){e.scrollTop=e.$LG(window).scrollTop(),e.pageX=e.core.outer.width()/2,e.pageY=e.core.outer.height()/2+e.scrollTop,e.scale=1}),this.core.LGel.on(bn.afterSlide+".zoom",function(r){var s=r.detail.prevIndex;e.scale=1,e.positionChanged=!1,e.zoomInProgress=!1,e.resetZoom(s),e.resetImageTranslate(s),e.isImageSlide(e.core.index)&&e.setZoomEssentials()}),this.zoomDrag(),this.pinchZoom(),this.zoomSwipe(),this.zoomableTimeout=!1,this.positionChanged=!1,this.zoomInProgress=!1}},t.prototype.zoomIn=function(){if(this.isImageSlide(this.core.index)){var e=this.scale+this.settings.scale;this.settings.infiniteZoom||(e=this.getScale(e)),this.beginZoom(e),this.zoomImage(e,Math.min(this.settings.scale,e-this.scale),!0,!this.settings.infiniteZoom)}},t.prototype.resetZoom=function(e){this.core.outer.removeClass("lg-zoomed lg-zoom-drag-transition");var n=this.core.getElementById("lg-actual-size"),r=this.core.getSlideItem(e!==void 0?e:this.core.index);n.removeClass(this.settings.actualSizeIcons.zoomOut).addClass(this.settings.actualSizeIcons.zoomIn),r.find(".lg-img-wrap").first().removeAttr("style"),r.find(".lg-image").first().removeAttr("style"),this.scale=1,this.left=0,this.top=0,this.setPageCords()},t.prototype.getTouchDistance=function(e){return Math.sqrt((e.touches[0].pageX-e.touches[1].pageX)*(e.touches[0].pageX-e.touches[1].pageX)+(e.touches[0].pageY-e.touches[1].pageY)*(e.touches[0].pageY-e.touches[1].pageY))},t.prototype.pinchZoom=function(){var e=this,n=0,r=!1,s=1,o=0,a=this.core.getSlideItem(this.core.index);this.core.outer.on("touchstart.lg",function(l){if(a=e.core.getSlideItem(e.core.index),!!e.isImageSlide(e.core.index)&&l.touches.length===2){if(l.preventDefault(),e.core.outer.hasClass("lg-first-slide-loading"))return;s=e.scale||1,e.core.outer.removeClass("lg-zoom-drag-transition lg-zoom-dragging"),e.setPageCords(l),e.resetImageTranslate(e.core.index),e.core.touchAction="pinch",n=e.getTouchDistance(l)}}),this.core.$inner.on("touchmove.lg",function(l){if(l.touches.length===2&&e.core.touchAction==="pinch"&&(e.$LG(l.target).hasClass("lg-item")||a.get().contains(l.target))){l.preventDefault();var c=e.getTouchDistance(l),d=n-c;if(!r&&Math.abs(d)>5&&(r=!0),r){o=e.scale;var h=Math.max(1,s+-d*.02);e.scale=Math.round((h+Number.EPSILON)*100)/100;var u=e.scale-o;e.zoomImage(e.scale,Math.round((u+Number.EPSILON)*100)/100,!1,!1)}}}),this.core.$inner.on("touchend.lg",function(l){if(e.core.touchAction==="pinch"&&(e.$LG(l.target).hasClass("lg-item")||a.get().contains(l.target))){if(r=!1,n=0,e.scale<=1)e.resetZoom();else{var c=e.getCurrentImageActualSizeScale();if(e.scale>=c){var d=c-e.scale;d===0&&(d=.01),e.zoomImage(c,d,!1,!0)}e.manageActualPixelClassNames(),e.core.outer.addClass("lg-zoomed")}e.core.touchAction=void 0}})},t.prototype.touchendZoom=function(e,n,r,s,o){var a=n.x-e.x,l=n.y-e.y,c=Math.abs(a)/o+1,d=Math.abs(l)/o+1;c>2&&(c+=1),d>2&&(d+=1),a=a*c,l=l*d;var h=this.core.getSlideItem(this.core.index).find(".lg-img-wrap").first(),u={};u.x=this.left+a,u.y=this.top+l;var m=this.getPossibleSwipeDragCords();(Math.abs(a)>15||Math.abs(l)>15)&&(s&&(this.isBeyondPossibleTop(u.y,m.minY)?u.y=m.minY:this.isBeyondPossibleBottom(u.y,m.maxY)&&(u.y=m.maxY)),r&&(this.isBeyondPossibleLeft(u.x,m.minX)?u.x=m.minX:this.isBeyondPossibleRight(u.x,m.maxX)&&(u.x=m.maxX)),s?this.top=u.y:u.y=this.top,r?this.left=u.x:u.x=this.left,this.setZoomSwipeStyles(h,u),this.positionChanged=!0)},t.prototype.getZoomSwipeCords=function(e,n,r,s,o){var a={};if(s){if(a.y=this.top+(n.y-e.y),this.isBeyondPossibleTop(a.y,o.minY)){var l=o.minY-a.y;a.y=o.minY-l/6}else if(this.isBeyondPossibleBottom(a.y,o.maxY)){var c=a.y-o.maxY;a.y=o.maxY+c/6}}else a.y=this.top;if(r){if(a.x=this.left+(n.x-e.x),this.isBeyondPossibleLeft(a.x,o.minX)){var d=o.minX-a.x;a.x=o.minX-d/6}else if(this.isBeyondPossibleRight(a.x,o.maxX)){var h=a.x-o.maxX;a.x=o.maxX+h/6}}else a.x=this.left;return a},t.prototype.isBeyondPossibleLeft=function(e,n){return e>=n},t.prototype.isBeyondPossibleRight=function(e,n){return e<=n},t.prototype.isBeyondPossibleTop=function(e,n){return e>=n},t.prototype.isBeyondPossibleBottom=function(e,n){return e<=n},t.prototype.isImageSlide=function(e){var n=this.core.galleryItems[e];return this.core.getSlideType(n)==="image"},t.prototype.getPossibleSwipeDragCords=function(e){var n=this.core.getSlideItem(this.core.index).find(".lg-image").first(),r=this.core.mediaContainerPosition.bottom,s=n.get().getBoundingClientRect(),o=s.height,a=s.width;e&&(o=o+e*o,a=a+e*a);var l=(o-this.containerRect.height)/2,c=(this.containerRect.height-o)/2+r,d=(a-this.containerRect.width)/2,h=(this.containerRect.width-a)/2,u={minY:l,maxY:c,minX:d,maxX:h};return u},t.prototype.setZoomSwipeStyles=function(e,n){e.css("transform","translate3d("+n.x+"px, "+n.y+"px, 0)")},t.prototype.zoomSwipe=function(){var e=this,n={},r={},s=!1,o=!1,a=!1,l=new Date,c=new Date,d,h,u=this.core.getSlideItem(this.core.index);this.core.$inner.on("touchstart.lg",function(m){if(e.isImageSlide(e.core.index)&&(u=e.core.getSlideItem(e.core.index),(e.$LG(m.target).hasClass("lg-item")||u.get().contains(m.target))&&m.touches.length===1&&e.core.outer.hasClass("lg-zoomed"))){m.preventDefault(),l=new Date,e.core.touchAction="zoomSwipe",h=e.core.getSlideItem(e.core.index).find(".lg-img-wrap").first();var f=e.getDragAllowedAxises(0);a=f.allowY,o=f.allowX,(o||a)&&(n=e.getSwipeCords(m)),d=e.getPossibleSwipeDragCords(),e.core.outer.addClass("lg-zoom-dragging lg-zoom-drag-transition")}}),this.core.$inner.on("touchmove.lg",function(m){if(m.touches.length===1&&e.core.touchAction==="zoomSwipe"&&(e.$LG(m.target).hasClass("lg-item")||u.get().contains(m.target))){m.preventDefault(),e.core.touchAction="zoomSwipe",r=e.getSwipeCords(m);var f=e.getZoomSwipeCords(n,r,o,a,d);(Math.abs(r.x-n.x)>15||Math.abs(r.y-n.y)>15)&&(s=!0,e.setZoomSwipeStyles(h,f))}}),this.core.$inner.on("touchend.lg",function(m){if(e.core.touchAction==="zoomSwipe"&&(e.$LG(m.target).hasClass("lg-item")||u.get().contains(m.target))){if(m.preventDefault(),e.core.touchAction=void 0,e.core.outer.removeClass("lg-zoom-dragging"),!s)return;s=!1,c=new Date;var f=c.valueOf()-l.valueOf();e.touchendZoom(n,r,o,a,f)}})},t.prototype.zoomDrag=function(){var e=this,n={},r={},s=!1,o=!1,a=!1,l=!1,c,d,h,u;this.core.outer.on("mousedown.lg.zoom",function(m){if(e.isImageSlide(e.core.index)){var f=e.core.getSlideItem(e.core.index);if(e.$LG(m.target).hasClass("lg-item")||f.get().contains(m.target)){c=new Date,u=e.core.getSlideItem(e.core.index).find(".lg-img-wrap").first();var g=e.getDragAllowedAxises(0);l=g.allowY,a=g.allowX,e.core.outer.hasClass("lg-zoomed")&&e.$LG(m.target).hasClass("lg-object")&&(a||l)&&(m.preventDefault(),n=e.getDragCords(m),h=e.getPossibleSwipeDragCords(),s=!0,e.core.outer.removeClass("lg-grab").addClass("lg-grabbing lg-zoom-drag-transition lg-zoom-dragging"))}}}),this.$LG(window).on("mousemove.lg.zoom.global"+this.core.lgId,function(m){if(s){o=!0,r=e.getDragCords(m);var f=e.getZoomSwipeCords(n,r,a,l,h);e.setZoomSwipeStyles(u,f)}}),this.$LG(window).on("mouseup.lg.zoom.global"+this.core.lgId,function(m){if(s){if(d=new Date,s=!1,e.core.outer.removeClass("lg-zoom-dragging"),o&&(n.x!==r.x||n.y!==r.y)){r=e.getDragCords(m);var f=d.valueOf()-c.valueOf();e.touchendZoom(n,r,a,l,f)}o=!1}e.core.outer.removeClass("lg-grabbing").addClass("lg-grab")})},t.prototype.closeGallery=function(){this.resetZoom(),this.zoomInProgress=!1},t.prototype.destroy=function(){this.$LG(window).off(".lg.zoom.global"+this.core.lgId),this.core.LGel.off(".lg.zoom"),this.core.LGel.off(".zoom"),clearTimeout(this.zoomableTimeout),this.zoomableTimeout=!1},t}();const Hf={ref:"gallery-container",class:"lightgallery-wrapper"},Wf={},ja=i.defineComponent({...Wf,__name:"lightgallery",props:{settings:{},onAfterAppendSlide:{type:Function},onInit:{type:Function},onHasVideo:{type:Function},onContainerResize:{type:Function},onAfterAppendSubHtml:{type:Function},onBeforeOpen:{type:Function},onAfterOpen:{type:Function},onSlideItemLoad:{type:Function},onBeforeSlide:{type:Function},onAfterSlide:{type:Function},onPosterClick:{type:Function},onDragStart:{type:Function},onDragMove:{type:Function},onDragEnd:{type:Function},onBeforeNextSlide:{type:Function},onBeforePrevSlide:{type:Function},onBeforeClose:{type:Function},onAfterClose:{type:Function},onRotateLeft:{type:Function},onRotateRight:{type:Function},onFlipHorizontal:{type:Function},onFlipVertical:{type:Function}},setup(t){const e=t,n={lgAfterAppendSlide:e.onAfterAppendSlide,lgInit:e.onInit,lgHasVideo:e.onHasVideo,lgContainerResize:e.onContainerResize,lgAfterAppendSubHtml:e.onAfterAppendSubHtml,lgBeforeOpen:e.onBeforeOpen,lgAfterOpen:e.onAfterOpen,lgSlideItemLoad:e.onSlideItemLoad,lgBeforeSlide:e.onBeforeSlide,lgAfterSlide:e.onAfterSlide,lgPosterClick:e.onPosterClick,lgDragStart:e.onDragStart,lgDragMove:e.onDragMove,lgDragEnd:e.onDragEnd,lgBeforeNextSlide:e.onBeforeNextSlide,lgBeforePrevSlide:e.onBeforePrevSlide,lgBeforeClose:e.onBeforeClose,lgAfterClose:e.onAfterClose,lgRotateLeft:e.onRotateLeft,lgRotateRight:e.onRotateRight,lgFlipHorizontal:e.onFlipHorizontal,lgFlipVertical:e.onFlipVertical},r=i.useTemplateRef("gallery-container"),s=i.ref(null);return i.onMounted(async()=>{if(!r.value)return;const o=await import("lightgallery");s.value=o.default(r.value,{...e.settings}),A.forOwn(n,(a,l)=>{var c;a&&((c=r.value)==null||c.addEventListener(l,a))})}),i.onBeforeUnmount(()=>{var o;s.value&&((o=s.value)==null||o.destroy(),s.value=null)}),(o,a)=>(i.openBlock(),i.createElementBlock("div",Hf,[i.renderSlot(o.$slots,"default")],512))}}),rt=class rt{static init(){rt.isInitialized||(rt.isInitialized=!0,rt.windowResizeHandler(),window.addEventListener("resize",rt.windowResizeHandler))}static destroy(){window.removeEventListener("resize",rt.windowResizeHandler),rt.isInitialized=!1}static getDeviceTypeByResolution(){const e=G.AppConfigProvider.getConfig().deviceTypeByResolution;return window.innerWidth<e.tablet?Ye.phone:window.innerWidth<e.laptop?Ye.tablet:Ye.laptop}static initRefDependingOnDeviceResolution(e,n,r){const s=i.ref(r);return rt.setRefValueDependingOnDeviceResolution(s,e,n,r),rt.refsDependingOnDeviceResolution.push({r:s,phoneValue:e,tabletValue:n,defaultValue:r}),s}static isPhoneDevice(){return rt.getDeviceTypeByResolution()===Ye.phone}static isTabletDevice(){return rt.getDeviceTypeByResolution()===Ye.tablet}static isLaptopDevice(){return rt.getDeviceTypeByResolution()===Ye.laptop}static setRefValueDependingOnDeviceResolution(e,n,r,s){switch(rt.getDeviceTypeByResolution()){case Ye.phone:e.value=n;break;case Ye.tablet:e.value=r;break;default:e.value=s;break}}static windowResizeHandler(){A.forEach(rt.refsDependingOnDeviceResolution,e=>{rt.setRefValueDependingOnDeviceResolution(e.r,e.phoneValue,e.tabletValue,e.defaultValue)})}};x(rt,"isInitialized",!1),x(rt,"refsDependingOnDeviceResolution",[]);let _t=rt;const jf=["href"],qf=["src","alt"],Xf={},qa=i.defineComponent({...Xf,__name:"image-gallery",props:{images:{}},setup(t,{expose:e}){const n=i.ref(!1),r=i.ref(!1),s=i.ref({plugins:[zf,Df],addClass:"sc-lg-container",licenseKey:"0000-0000-000-0000",strings:{closeGallery:"Закрыть",download:"Скачать",mediaLoadingFailed:"Ошибка загрузки контента...",nextSlide:"Следующее изображение",playVideo:"Воспроизвести видео",previousSlide:"Предыдущее изображение",toggleMaximize:"Расширить"}}),o=()=>window.innerWidth*(_t.getDeviceTypeByResolution()===Ye.phone?.7:.8),a=i.ref(o()),l=()=>{a.value=o()},c=()=>{n.value=!0};return i.onUnmounted(()=>{window.removeEventListener("resize",l)}),e({show:c}),window.addEventListener("resize",l),(d,h)=>{const u=Wa,m=V.NPopover;return i.openBlock(),i.createBlock(m,{trigger:"manual",show:n.value,class:"sc-image",placement:"top-start",onClickoutside:h[3]||(h[3]=()=>{r.value||(n.value=!1)})},{trigger:i.withCtx(()=>[i.createElementVNode("div",{class:"inline-flex",onClick:h[0]||(h[0]=f=>n.value=!n.value)},[i.renderSlot(d.$slots,"default",{},()=>[i.createVNode(u)])])]),default:i.withCtx(()=>[i.createVNode(ja,{settings:s.value,style:i.normalizeStyle(`max-width: ${a.value}px`),class:"flex flex-row overflow-x-scroll",onAfterOpen:h[1]||(h[1]=()=>{r.value=!0}),onAfterClose:h[2]||(h[2]=()=>{r.value=!1,n.value=!1})},{default:i.withCtx(()=>[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(t.images,(f,g)=>(i.openBlock(),i.createElementBlock("a",{key:g,href:f.image},[i.createElementVNode("img",{src:f.preview,alt:`Изображение #${g+1}`},null,8,qf)],8,jf))),128))]),_:1},8,["settings","style"])]),_:3},8,["show"])}}}),Yf={class:"flex flex-col text-sm"},Uf={},Gf=i.defineComponent({...Uf,__name:"product-stock-count",props:{product:{}},setup(t){return(e,n)=>{const r=Fs,s=V.NPopover;return i.openBlock(),i.createBlock(s,{trigger:"click",placement:"top-start",class:"sc-stock-count"},{trigger:i.withCtx(()=>[i.renderSlot(e.$slots,"default",{},()=>[i.createVNode(r)])]),default:i.withCtx(()=>[i.createElementVNode("div",Yf,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(t.product.stockCount,(o,a)=>(i.openBlock(),i.createElementBlock("span",{key:a},i.toDisplayString(o.warehouse.name)+": "+i.toDisplayString(o.count)+" "+i.toDisplayString(t.product.quantityUnit),1))),128))])]),_:3})}}}),Kf={class:"flex flex-row justify-between"},Zf={key:0},Jf={class:"ml-2 align-sub"},Qf={class:"flex cursor-pointer flex-row gap-2 whitespace-nowrap"},eg={class:"@container"},tg={class:"text-sc-dark-grey @sm:grid-cols-2 @2xl:grid-cols-3 grid grid-cols-1 gap-1 text-sm"},ng={key:0,class:"sc-supplier-sku col-span-2 whitespace-nowrap text-wrap sm:col-span-3"},ig={class:"text-sc-dark-grey"},rg={key:1,class:"sc-product-code col-start-1 whitespace-nowrap"},sg={class:"text-gray-600"},og={class:"flex cursor-pointer flex-row gap-1 whitespace-nowrap"},ag={key:3,class:"underline decoration-dashed"},lg={key:4,class:"sc-product-pack whitespace-nowrap"},cg={class:"text-gray-600"},dg={key:5,class:"sc-product-planning-incoming-date col-span-2 col-start-1 mt-1.5 text-wrap"},hg={class:"text-gray-600"},ug={key:0,class:"mt-3 flex flex-row gap-3 pb-2 text-base xl:text-lg"},fg={key:0},gg={class:"sc-product-properties m-0 mt-3 list-inside list-disc p-0 pl-1.5 text-xs text-gray-500"},mg={},er=i.defineComponent({...mg,__name:"product-name",props:{product:{},eventEmitter:{},showSlugs:{type:Boolean,default:!1},showProperties:{type:Boolean,default:!1},showCode:{type:Boolean,default:!0},showProductCosts:{type:[Boolean,Function],default:!1},showPlanningDates:{type:Boolean,default:!0},showPriceHistory:{type:Boolean,default:!1},showCostDate:{type:Boolean,default:!1},allowNameClick:{type:[Boolean,Function],default:!1},allowPriceClick:{type:[Boolean,Function],default:!1},currencyRates:{default:void 0},showProductAddToCartButton:{type:[Boolean,String,Function],default:!1},showProductEditButton:{type:[Boolean,String,Function],default:!1},showProductRequiredButton:{type:[Boolean,String,Function],default:!1},productContextButtonsConfig:{type:Function,default:void 0}},setup(t,{expose:e}){const n=t,r=i.computed(()=>A.isFunction(n.showProductCosts)?n.showProductCosts(n.product):n.showProductCosts),s=i.computed(()=>A.sortBy(n.product.priceCoefficients,["coefficient.slug"])),o=i.computed(()=>{var h,u;return(u=(h=n.product)==null?void 0:h.properties)==null?void 0:u.planingIncomingDate}),a=i.useTemplateRef("image-gallery"),l=()=>{var h;(h=a.value)==null||h.show()},c=i.computed(()=>A.isFunction(n.allowNameClick)?n.allowNameClick(n.product):n.allowNameClick),d=()=>{var h;c.value&&((h=n.eventEmitter)==null||h.emit("product:name-click",{product:n.product,exposedMethods:{showProductImagesPreview:l}}))};return e({showProductImagesPreview:l}),(h,u)=>{var y,_,S,C,v;const m=Wa,f=V.NText,g=Ha,p=Fs,b=V.NScrollbar;return i.openBlock(),i.createElementBlock("div",null,[i.createElementVNode("div",Kf,[i.createVNode(f,{type:"info",class:"sc-product-name text-balance text-base font-medium"},{default:i.withCtx(()=>[i.createElementVNode("span",{class:i.normalizeClass({"cursor-pointer":c.value&&t.eventEmitter}),onClick:d},i.toDisplayString(t.product.name),3),t.product.onOrder?(i.openBlock(),i.createElementBlock("span",Zf," [Под заказ] ")):i.createCommentVNode("",!0),i.createElementVNode("span",Jf,[t.product.images&&t.product.images.length>0?(i.openBlock(),i.createBlock(qa,{key:0,ref:"image-gallery",images:t.product.images},{default:i.withCtx(()=>[i.createElementVNode("div",Qf,[i.createVNode(m)])]),_:1},8,["images"])):i.createCommentVNode("",!0)])]),_:1}),t.showProductAddToCartButton||t.showProductEditButton||t.showProductRequiredButton||((y=t.productContextButtonsConfig)==null?void 0:y.length)>0?(i.openBlock(),i.createBlock(g,{key:0,product:t.product,"event-emitter":t.eventEmitter,"show-product-add-to-cart-button":t.showProductAddToCartButton,"show-product-edit-button":t.showProductEditButton,"show-product-required-button":t.showProductRequiredButton,"product-context-buttons-config":t.productContextButtonsConfig},null,8,["product","event-emitter","show-product-add-to-cart-button","show-product-edit-button","show-product-required-button","product-context-buttons-config"])):i.createCommentVNode("",!0)]),i.createElementVNode("div",eg,[i.createElementVNode("div",tg,[t.product.supplierSku?(i.openBlock(),i.createElementBlock("div",ng,[u[0]||(u[0]=i.createTextVNode(" Артикул производителя/поставщика: ",-1)),i.createElementVNode("span",ig,i.toDisplayString(t.product.supplierSku),1)])):i.createCommentVNode("",!0),t.showCode?(i.openBlock(),i.createElementBlock("span",rg,[u[1]||(u[1]=i.createTextVNode(" Артикул: ",-1)),i.createElementVNode("span",sg,i.toDisplayString(t.product.code),1)])):i.createCommentVNode("",!0),t.product.stockCount&&t.product.stockCount.length>0?(i.openBlock(),i.createBlock(Gf,{key:2,product:t.product},{default:i.withCtx(()=>[i.createElementVNode("span",og,[u[2]||(u[2]=i.createElementVNode("span",{class:"underline decoration-dashed"},"В наличии",-1)),i.createVNode(p,{class:"mt-0.5"})])]),_:1},8,["product"])):(i.openBlock(),i.createElementBlock("span",ag," Нет в наличии ")),(S=(_=t.product)==null?void 0:_.properties)!=null&&S.pack?(i.openBlock(),i.createElementBlock("span",lg,[u[3]||(u[3]=i.createTextVNode(" Норма упаковки: ",-1)),i.createElementVNode("span",cg,i.toDisplayString((v=(C=t.product)==null?void 0:C.properties)==null?void 0:v.pack),1)])):i.createCommentVNode("",!0),t.showPlanningDates&&o.value?(i.openBlock(),i.createElementBlock("span",dg,[u[4]||(u[4]=i.createTextVNode(" Планируемая дата поступления на основной склад: ",-1)),i.createElementVNode("span",hg,i.toDisplayString(o.value),1)])):i.createCommentVNode("",!0)])]),i.createVNode(b,{"x-scrollable":""},{default:i.withCtx(()=>[r.value?(i.openBlock(),i.createElementBlock("div",ug,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(s.value,B=>(i.openBlock(),i.createBlock(Er,{key:B.coefficient.slug,product:t.product,"cost-field-name":B.coefficient.slug??"","event-emitter":t.eventEmitter,"allow-price-click":t.allowPriceClick,"show-tag":!0,"show-price-history":t.showPriceHistory,"currency-rates":t.currencyRates},null,8,["product","cost-field-name","event-emitter","allow-price-click","show-price-history","currency-rates"]))),128)),i.createVNode(Er,{product:t.product,"event-emitter":t.eventEmitter,"allow-price-click":t.allowPriceClick,"show-tag":!0,"show-quantity-unit":!0,"show-cost-date":t.showCostDate,"show-price-history":t.showPriceHistory,"currency-rates":t.currencyRates,"cost-field-name":"cost","additional-through-field-name":"retailCost",style:{"background-color":"var(--n-merged-td-color)"},class:"sticky right-0 border-0 border-l-2 border-solid border-gray-300 pl-2"},null,8,["product","event-emitter","allow-price-click","show-cost-date","show-price-history","currency-rates"])])):i.createCommentVNode("",!0)]),_:1}),t.showSlugs||t.showProperties?(i.openBlock(),i.createElementBlock("div",fg,[i.createElementVNode("ul",gg,[t.showSlugs?(i.openBlock(!0),i.createElementBlock(i.Fragment,{key:0},i.renderList({id:t.product.id,slug:t.product.slug},(B,k)=>(i.openBlock(),i.createElementBlock("li",{key:k}," ("+i.toDisplayString(k)+"): "+i.toDisplayString(B),1))),128)):i.createCommentVNode("",!0),t.showProperties?(i.openBlock(!0),i.createElementBlock(i.Fragment,{key:1},i.renderList(t.product.properties,(B,k)=>(i.openBlock(),i.createElementBlock("li",{key:k}," ("+i.toDisplayString(k)+"): "+i.toDisplayString(B),1))),128)):i.createCommentVNode("",!0)])])):i.createCommentVNode("",!0)])}}}),pg=(t,e,n)=>({key:t,title:e,className:"align-top",resizable:!0,render:r=>i.h(Er,{product:r,costFieldName:t,eventEmitter:n.eventEmitter,allowPriceClick:n.allowPriceClick,currencyRates:n.currencyRates})}),yg=(t,e)=>{if(t.length===0)return[];const n=[],r={};switch(A.isNil(e.isProductItemSelected)||n.push({key:"checkbox",title:"",className:"align-top",width:"32",render:s=>{var o,a;return i.h(V.NCheckbox,{checked:!!((o=e.isProductItemSelected)!=null&&o.call(e,s)),disabled:((a=e.isProductItemSelected)==null?void 0:a.call(e,s))==="disabled",onUpdateChecked:l=>{e.eventEmitter.emit("product:checked",{product:s,checked:l})}})}}),_t.getDeviceTypeByResolution()){case Ye.phone:case Ye.tablet:n.push({key:"name",title:"Наименование",className:"align-top",render:s=>i.h(er,{product:s,eventEmitter:e.eventEmitter,showSlugs:e.showSlugs,showProperties:e.showProperties,showProductCosts:e.showProductCosts,allowNameClick:e.allowNameClick,allowPriceClick:e.allowPriceClick,showPriceHistory:e.showPriceHistory,showCostDate:e.showCostDate,showProductAddToCartButton:e.showProductAddToCartButton,showProductEditButton:e.showProductEditButton,showProductRequiredButton:e.showProductRequiredButton,currencyRates:e.currencyRates,productContextButtonsConfig:e.productContextButtonsConfig})});break;default:n.push({key:"name",title:"Наименование",className:"align-top",resizable:!0,render:s=>i.h(er,{product:s,eventEmitter:e.eventEmitter,showSlugs:e.showSlugs,showProperties:e.showProperties,allowNameClick:e.allowNameClick,allowPriceClick:e.allowPriceClick,showPriceHistory:e.showPriceHistory,showCostDate:e.showCostDate,currencyRates:e.currencyRates})}),e.showProductCosts&&(A.forEach(t,s=>{A.forEach(s.priceCoefficients,o=>{r[o.coefficient.slug??""]||(r[o.coefficient.slug??""]=o.coefficient)})}),A.forEach(A.sortBy(r,["slug"]),s=>{n.push(pg(s.slug??"",s.name,e))}),n.push({key:"cost",title:"Цена",className:"align-top",resizable:!0,render:s=>i.h(Er,{product:s,costFieldName:"cost",additionalThroughFieldName:"retailCost",eventEmitter:e.eventEmitter,allowPriceClick:e.allowPriceClick,showQuantityUnit:!0,showPriceHistory:e.showPriceHistory,showCostDate:e.showCostDate,currencyRates:e.currencyRates})})),(e.showProductEditButton||e.showProductRequiredButton||e.showProductAddToCartButton||!A.isNil(e.productContextButtonsConfig))&&n.push({key:"actions",title:"",className:"align-top",width:"50",render:s=>i.h(Ha,{product:s,eventEmitter:e.eventEmitter,showProductAddToCartButton:e.showProductAddToCartButton,showProductEditButton:e.showProductEditButton,showProductRequiredButton:e.showProductRequiredButton,productContextButtonsConfig:e.productContextButtonsConfig})});break}return n},bg={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function _g(t,e){return i.openBlock(),i.createElementBlock("svg",bg,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"none",d:"M296 64h-80a7.91 7.91 0 0 0-8 8v24h96V72a7.91 7.91 0 0 0-8-8"},null,-1),i.createElementVNode("path",{fill:"currentColor",d:"M432 96h-96V72a40 40 0 0 0-40-40h-80a40 40 0 0 0-40 40v24H80a16 16 0 0 0 0 32h17l19 304.92c1.42 26.85 22 47.08 48 47.08h184c26.13 0 46.3-19.78 48-47l19-305h17a16 16 0 0 0 0-32M192.57 416H192a16 16 0 0 1-16-15.43l-8-224a16 16 0 1 1 32-1.14l8 224A16 16 0 0 1 192.57 416M272 400a16 16 0 0 1-32 0V176a16 16 0 0 1 32 0Zm32-304h-96V72a7.91 7.91 0 0 1 8-8h80a7.91 7.91 0 0 1 8 8Zm32 304.57A16 16 0 0 1 320 416h-.58A16 16 0 0 1 304 399.43l8-224a16 16 0 1 1 32 1.14Z"},null,-1)])])}const Xa=i.markRaw({name:"ion-trash",render:_g}),wg={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function xg(t,e){return i.openBlock(),i.createElementBlock("svg",wg,[...e[0]||(e[0]=[i.createElementVNode("path",{d:"M448 224H288V64h-64v160H64v64h160v160h64V288h160z",fill:"currentColor"},null,-1)])])}const Ya=i.markRaw({name:"ion-plus",render:xg}),vg={key:0,class:"flex w-fit items-center gap-2"},kg={key:1,class:"flex flex-wrap gap-1"},Cg={key:0},Sg={},tr=i.defineComponent({...Sg,__name:"configurators-product-info",props:{isProductSearching:{type:Boolean,default:!1},product:{default:void 0}},setup(t){const e=t,n=i.computed(()=>{var r,s;return(s=(r=e.product)==null?void 0:r.properties)==null?void 0:s.planingProductionDate});return(r,s)=>{const o=V.NSpin;return t.isProductSearching?(i.openBlock(),i.createElementBlock("div",vg,[i.createVNode(o,{size:17,class:"w-fit"}),s[0]||(s[0]=i.createElementVNode("div",null,"Выполняется поиск товара ...",-1))])):t.product.isNewRec()?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("div",kg,[i.createElementVNode("div",null,i.toDisplayString(t.product.code)+" - "+i.toDisplayString(t.product.name)+" - "+i.toDisplayString(t.product.costRub.toLocaleString())+" ₽ / "+i.toDisplayString(t.product.unit),1),n.value?(i.openBlock(),i.createElementBlock("div",Cg,"(Планируемая дата производства: "+i.toDisplayString(n.value)+")",1)):i.createCommentVNode("",!0)]))}}}),Bg={class:"flex flex-col gap-4"},Tg={class:"flex flex-col gap-2"},Rg={class:"mt-8 font-bold"},$g={class:"grid grow grid-cols-2 items-start gap-2"},Eg={class:"flex flex-col gap-4"},Ng={class:"flex gap-3"},Pg={},Ua=i.defineComponent({...Pg,__name:"kozyrek-configurator-params-form",props:{value:{},settings:{},previewParams:{},isProductSearching:{type:Boolean,default:!1},isSubmitProcessing:{type:Boolean,default:!1},validation:{default:void 0},selectTemplateIndex:{}},emits:["update:value","update:params","click:view-switch","submit","click:add-line","click:remove-line","click:save-template"],setup(t,{emit:e}){const n=t,r=e,s=i.ref(structuredClone(i.toRaw(n.value.configuratorParams))),o=i.ref(!1),a=()=>{s.value.length>0&&(r("update:params",s.value),l("configuratorParams",s.value))},l=(c,d)=>{const h=new G.CartItemBase(n.value);h[c]=d,r("update:value",h)};return i.watch(()=>n.value.configuratorParams,c=>{s.value=A.cloneDeep(i.toRaw(c))},{deep:!0}),i.watch(()=>n.previewParams,c=>{s.value.linesWidths=c.linesWidths,s.value.linesAngles=c.linesAngles},{deep:!0}),(c,d)=>{const h=Ya,u=Xa,m=V.NInput;return i.openBlock(),i.createBlock(i.unref(V.NForm),{class:"grid gap-2 md:grid-cols-2 md:gap-6"},{default:i.withCtx(()=>{var f,g,p,b,y,_,S,C,v,B;return[i.createElementVNode("div",Bg,[d[10]||(d[10]=i.createElementVNode("span",{class:"w-full font-bold"},"Ширина участка, мм / Угол сгиба, ° (А)",-1)),t.settings.startTailConfigs&&t.settings.startTailConfigs.length>0?(i.openBlock(),i.createBlock(i.unref(V.NFormItem),{key:0,required:!0,"show-feedback":!1,label:"Тип стартового капельника"},{default:i.withCtx(()=>[i.createVNode(i.unref(V.NSelect),{value:s.value.startTailType,"onUpdate:value":[d[0]||(d[0]=k=>s.value.startTailType=k),a],options:t.settings.startTailConfigs.map(({label:k},R)=>({label:k,value:R})),placeholder:"Тип стартового капельника"},null,8,["value","options"])]),_:1})):i.createCommentVNode("",!0),i.createElementVNode("div",Tg,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(s.value.linesAngles,(k,R)=>{var $,F,D,L,M,z;return i.openBlock(),i.createElementBlock("div",{key:R,class:"flex items-start gap-2"},[i.createElementVNode("div",Rg,i.toDisplayString(R+1),1),i.createElementVNode("div",$g,[i.createVNode(i.unref(V.NFormItem),{label:"Ширина, мм",required:!0,feedback:(($=t.validation[`lines_widths[${R+1}]`])==null?void 0:$.feedback)||"","show-feedback":((F=t.validation[`lines_widths[${R+1}]`])==null?void 0:F.showFeedback)||!1,"validation-status":(D=t.validation[`lines_widths[${R+1}]`])==null?void 0:D.validationStatus},{default:i.withCtx(()=>[i.createVNode(i.unref(V.NInputNumber),{value:s.value.linesWidths[R],"onUpdate:value":[O=>s.value.linesWidths[R]=O,a],min:s.value.linesWidths.length>1?t.settings.minLineWidth:t.settings.stripMinWidth,max:t.settings.maxLineWidth,step:t.settings.lineWidthStep,validator:O=>O%t.settings.lineWidthStep===0,class:"w-full"},null,8,["value","onUpdate:value","min","max","step","validator"])]),_:2},1032,["feedback","show-feedback","validation-status"]),i.createVNode(i.unref(V.NFormItem),{label:"Угол сгиба, °",required:!0,feedback:((L=t.validation[`lines_angles[${R+1}]`])==null?void 0:L.feedback)||"","show-feedback":((M=t.validation[`lines_angles[${R+1}]`])==null?void 0:M.showFeedback)||!1,"validation-status":(z=t.validation[`lines_angles[${R+1}]`])==null?void 0:z.validationStatus},{default:i.withCtx(()=>[i.createVNode(i.unref(V.NInputNumber),{value:s.value.linesAngles[R],"onUpdate:value":[O=>s.value.linesAngles[R]=O,a],min:t.settings.minLineAngle,max:t.settings.maxLineAngle,step:t.settings.lineAngleStep,validator:O=>O%t.settings.lineAngleStep===0,class:"w-full"},null,8,["value","onUpdate:value","min","max","step","validator"])]),_:2},1032,["feedback","show-feedback","validation-status"])]),i.createVNode(i.unref(V.NFormItem),{label:void 0,"show-feedback":!1,required:!0,class:"shrink-0"},{default:i.withCtx(()=>[t.settings.showOnlyTemplates?i.createCommentVNode("",!0):(i.openBlock(),i.createBlock(i.unref(V.NButton),{key:0,size:"medium",onClick:O=>r("click:add-line",R)},{default:i.withCtx(()=>[i.createVNode(h)]),_:1},8,["onClick"])),t.settings.showOnlyTemplates?i.createCommentVNode("",!0):(i.openBlock(),i.createBlock(i.unref(V.NButton),{key:1,disabled:s.value.linesWidths.length===1,size:"medium",class:"ml-2",onClick:O=>r("click:remove-line",R)},{default:i.withCtx(()=>[i.createVNode(u)]),_:1},8,["disabled","onClick"]))]),_:2},1024)])}),128))]),t.settings.endTailConfigs&&t.settings.endTailConfigs.length>0?(i.openBlock(),i.createBlock(i.unref(V.NFormItem),{key:1,label:"Тип конечного капельника","show-feedback":!1,required:!0},{default:i.withCtx(()=>[i.createVNode(i.unref(V.NSelect),{value:s.value.endTailType,"onUpdate:value":[d[1]||(d[1]=k=>s.value.endTailType=k),a],options:t.settings.endTailConfigs.map(({label:k},R)=>({label:k,value:R})),placeholder:"Тип конечного капельника"},null,8,["value","options"])]),_:1})):i.createCommentVNode("",!0),i.createVNode(tr,{"is-product-searching":t.isProductSearching,product:t.value.product},null,8,["is-product-searching","product"]),t.settings.allowSaveTemplates&&t.selectTemplateIndex===((f=t.settings.allTemplates)==null?void 0:f.length)-1?(i.openBlock(),i.createBlock(i.unref(V.NButton),{key:2,type:"tertiary",class:"self-start",loading:o.value,onClick:d[2]||(d[2]=k=>r("click:save-template"))},{default:i.withCtx(()=>[...d[9]||(d[9]=[i.createTextVNode(" Сохранить шаблон ",-1)])]),_:1},8,["loading"])):i.createCommentVNode("",!0)]),i.createElementVNode("div",Eg,[i.createVNode(i.unref(V.NFormItem),{label:"С какой стороны изделие будет иметь цвет","show-feedback":!1},{default:i.withCtx(()=>[i.createVNode(i.unref(V.NSelect),{value:s.value.colorSide,"onUpdate:value":[d[3]||(d[3]=k=>s.value.colorSide=k),a],options:[{label:"Цвет сверху",value:"top"},{label:" Цвет снизу",value:"bottom"}],placeholder:"С какой стороны изделие будет иметь цвет"},null,8,["value"])]),_:1}),i.createVNode(i.unref(V.NFormItem),{required:!0,"show-feedback":((g=t.validation.length)==null?void 0:g.showFeedback)||!1,feedback:((p=t.validation.length)==null?void 0:p.feedback)||"","validation-status":(b=t.validation.length)==null?void 0:b.validationStatus,label:`Метраж${t.settings.stripMinLength?" от "+t.settings.stripMinLength:""}${t.settings.stripMaxLength?" до "+t.settings.stripMaxLength:""} мм`},{default:i.withCtx(()=>[i.createVNode(i.unref(V.NInputNumber),{value:s.value.length,"onUpdate:value":[d[4]||(d[4]=k=>s.value.length=k),a],required:!0,max:t.settings.stripMaxLength||void 0,min:t.settings.stripMinLength,step:t.settings.lengthStep,validator:k=>k%t.settings.lengthStep===0,placeholder:"Введите метраж",class:"w-full"},null,8,["value","max","min","step","validator"])]),_:1},8,["show-feedback","feedback","validation-status","label"]),i.createVNode(i.unref(V.NFormItem),{required:!0,"show-feedback":((y=t.validation.quantity)==null?void 0:y.showFeedback)||!1,feedback:((_=t.validation.quantity)==null?void 0:_.feedback)||"","validation-status":(S=t.validation.quantity)==null?void 0:S.validationStatus,label:"Количество"},{default:i.withCtx(()=>[i.createVNode(i.unref(V.NInputNumber),{value:t.value.quantity,"onUpdate:value":d[5]||(d[5]=k=>t.value.quantity=k),min:1,validator:k=>Number.isInteger(k),placeholder:"Введите количество",class:"w-full"},null,8,["value","validator"])]),_:1},8,["show-feedback","feedback","validation-status"]),i.createVNode(i.unref(V.NFormItem),{required:!0,"show-feedback":((C=t.validation.marker)==null?void 0:C.showFeedback)||!1,feedback:((v=t.validation.marker)==null?void 0:v.feedback)||"","validation-status":(B=t.validation.marker)==null?void 0:B.validationStatus,label:"Маркировка"},{default:i.withCtx(()=>[i.createVNode(m,{value:t.value.marker,"onUpdate:value":d[6]||(d[6]=k=>t.value.marker=k),placeholder:"Введите маркировку"},null,8,["value"])]),_:1},8,["show-feedback","feedback","validation-status"]),i.createElementVNode("div",Ng,[i.createVNode(i.unref(V.NButton),{loading:t.isSubmitProcessing,type:"primary",class:"self-start",onClick:d[7]||(d[7]=k=>r("submit",t.value))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(t.value.isNewRec()?"В корзину":"Изменить"),1)]),_:1},8,["loading"]),t.settings.allowShowTable?(i.openBlock(),i.createBlock(i.unref(V.NButton),{key:0,type:"tertiary",class:"self-start",onClick:d[8]||(d[8]=k=>r("click:view-switch"))},{default:i.withCtx(()=>[...d[11]||(d[11]=[i.createTextVNode(" Показать в виде списка ",-1)])]),_:1})):i.createCommentVNode("",!0)])])]}),_:1})}}});var Ga=Object.defineProperty,Fg=Object.defineProperties,Mg=Object.getOwnPropertyDescriptors,Ka=Object.getOwnPropertySymbols,Ag=Object.prototype.hasOwnProperty,Og=Object.prototype.propertyIsEnumerable,Za=t=>{throw TypeError(t)},As=(t,e,n)=>e in t?Ga(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Os=(t,e)=>{for(var n in e||(e={}))Ag.call(e,n)&&As(t,n,e[n]);if(Ka)for(var n of Ka(e))Og.call(e,n)&&As(t,n,e[n]);return t},Vs=(t,e)=>Fg(t,Mg(e)),Ja=(t,e)=>{for(var n in e)Ga(t,n,{get:e[n],enumerable:!0})},w=(t,e,n)=>As(t,typeof e!="symbol"?e+"":e,n),Qa=(t,e,n)=>e.has(t)||Za("Cannot "+n),Rt=(t,e,n)=>(Qa(t,e,"read from private field"),n?n.call(t):e.get(t)),el=(t,e,n)=>e.has(t)?Za("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),Vg=(t,e,n,r)=>(Qa(t,e,"write to private field"),e.set(t,n),n),wt={Image:null,isHeadless:!1,shim:function(t,e){return t.tagName=t.nodeName=e||"canvas",t.nodeType=1,t.getAttribute=function(n){return this[n]},t.setAttribute=function(n,r){return this[n]=r,this},t},polyfill:function(t,e){return wt.shim(t),typeof e<"u"&&(wt.Image=e),wt.isHeadless=!0,t}},tl={};Ja(tl,{Curve:()=>$i,getAnchorsFromArcData:()=>Lg,getComponentOnCubicBezier:()=>nr,getControlPoints:()=>ul,getCurveBoundingBox:()=>cl,getCurveFromPoints:()=>hl,getCurveLength:()=>ll,getReflection:()=>Ds,integrate:()=>dl,subdivide:()=>Ls});var nl={};Ja(nl,{HALF_PI:()=>Ze,NumArray:()=>nn,TWO_PI:()=>ct,decomposeMatrix:()=>Zn,getComputedMatrix:()=>Is,getEffectiveStrokeWidth:()=>rn,getPoT:()=>sl,lerp:()=>Pt,mod:()=>Ft,setMatrix:()=>rl,toFixed:()=>Ee});var ze;typeof window<"u"?ze=window:typeof global<"u"?ze=global:typeof self<"u"&&(ze=self);var il,ct=Math.PI*2,Ze=Math.PI*.5;function Zn(t,e,n,r,s,o){let a;return arguments.length<=1?(a=t.a,e=t.b,n=t.c,r=t.d,s=t.e,o=t.f):a=t,{translateX:s,translateY:o,scaleX:Math.sqrt(a*a+e*e),scaleY:Math.sqrt(n*n+r*r),rotation:180*Math.atan2(e,a)/Math.PI}}function rl(t){il=t}function Is(t,e){e=e&&e.identity()||new il;let n=t;const r=[];for(;n&&n._matrix;)r.push(n._matrix),n=n.parent;r.reverse();for(let s=0;s<r.length;s++){const a=r[s].elements;e.multiply(a[0],a[1],a[2],a[3],a[4],a[5],a[6],a[7],a[8])}return e}function Pt(t,e,n){return n*(e-t)+t}var zs=[2,4,8,16,32,64,128,256,512,1024,2048,4096];function sl(t){let e=0;for(;zs[e]&&zs[e]<t;)e++;return zs[e]}function Ft(t,e){for(;t<0;)t+=e;return t%e}var nn=ze.Float32Array||Array,Ig=Math.floor;function Ee(t){return Ig(t*1e6)/1e6}function rn(t,e){const n=t._linewidth;if(t.strokeAttenuation)return n;e||(e=t.worldMatrix||Is(t));const r=Zn(e.elements[0],e.elements[3],e.elements[1],e.elements[4],e.elements[2],e.elements[5]),s=Math.max(Math.abs(r.scaleX),Math.abs(r.scaleY));return s>0?n/s:n}var Q={move:"M",line:"L",curve:"C",arc:"A",close:"Z"},Y=class{constructor(){w(this,"_events",{}),w(this,"_bound",!1)}addEventListener(e,n){return(this._events[e]||(this._events[e]=[])).push(n),this._bound=!0,this}on(){return this.addEventListener.apply(this,arguments)}bind(){return this.addEventListener.apply(this,arguments)}removeEventListener(e,n){if(!this._events)return this;if(!e&&!n)return this._events={},this._bound=!1,this;const r=e?[e]:Object.keys(this._events);for(let s=0,o=r.length;s<o;s++){e=r[s];let a=this._events[e];if(a){let l=[];if(n)for(let c=0,d=a.length;c<d;c++){let h=a[c];h=h.handler?h.handler:h,n!==h&&l.push(h)}this._events[e]=l}}return this}off(){return this.removeEventListener.apply(this,arguments)}unbind(){return this.removeEventListener.apply(this,arguments)}dispatchEvent(e){if(!this._events)return this;const n=Array.prototype.slice.call(arguments,1),r=this._events[e];if(r)for(let s=0;s<r.length;s++)r[s].call(this,...n);return this}trigger(){return this.dispatchEvent.apply(this,arguments)}listen(e,n,r){const s=this;e&&(o.obj=e,o.name=n,o.handler=r,e.on(n,o));function o(){r.apply(s,arguments)}return s}ignore(e,n,r){return e.off(n,r),this}};w(Y,"Types",{play:"play",pause:"pause",update:"update",render:"render",resize:"resize",change:"change",remove:"remove",insert:"insert",order:"order",load:"load"}),w(Y,"Methods",["addEventListener","on","removeEventListener","off","unbind","dispatchEvent","trigger","listen","ignore"]);var ol={x:{enumerable:!0,get:function(){return this._x},set:function(t){this._x!==t&&(this._x=t,this._bound&&this.dispatchEvent(Y.Types.change))}},y:{enumerable:!0,get:function(){return this._y},set:function(t){this._y!==t&&(this._y=t,this._bound&&this.dispatchEvent(Y.Types.change))}}},Xt=class Ki extends Y{constructor(e=0,n=0){super(),w(this,"_x",0),w(this,"_y",0);for(let r in ol)Object.defineProperty(this,r,ol[r]);this.x=e,this.y=n}static add(e,n){return new Ki(e.x+n.x,e.y+n.y)}static sub(e,n){return new Ki(e.x-n.x,e.y-n.y)}static subtract(e,n){return Ki.sub(e,n)}static ratioBetween(e,n){return(e.x*n.x+e.y*n.y)/(e.length()*n.length())}static angleBetween(e,n){if(arguments.length>=4){const o=arguments[0]-arguments[2],a=arguments[1]-arguments[3];return Math.atan2(a,o)}const r=e.x-n.x,s=e.y-n.y;return Math.atan2(s,r)}static distanceBetween(e,n){return Math.sqrt(Ki.distanceBetweenSquared(e,n))}static distanceBetweenSquared(e,n){const r=e.x-n.x,s=e.y-n.y;return r*r+s*s}set(e,n){return this.x=e,this.y=n,this}copy(e){return this.x=e.x,this.y=e.y,this}clear(){return this.x=0,this.y=0,this}clone(){return new Ki(this.x,this.y)}add(e,n){return arguments.length<=0?this:(arguments.length<=1?typeof e=="number"?(this.x+=e,this.y+=e):e&&typeof e.x=="number"&&typeof e.y=="number"&&(this.x+=e.x,this.y+=e.y):(this.x+=e,this.y+=n),this)}addSelf(e){return this.add.apply(this,arguments)}sub(e,n){return arguments.length<=0?this:(arguments.length<=1?typeof e=="number"?(this.x-=e,this.y-=e):e&&typeof e.x=="number"&&typeof e.y=="number"&&(this.x-=e.x,this.y-=e.y):(this.x-=e,this.y-=n),this)}subtract(){return this.sub.apply(this,arguments)}subSelf(e){return this.sub.apply(this,arguments)}subtractSelf(e){return this.sub.apply(this,arguments)}multiply(e,n){return arguments.length<=0?this:(arguments.length<=1?typeof e=="number"?(this.x*=e,this.y*=e):e&&typeof e.x=="number"&&typeof e.y=="number"&&(this.x*=e.x,this.y*=e.y):(this.x*=e,this.y*=n),this)}multiplySelf(e){return this.multiply.apply(this,arguments)}multiplyScalar(e){return this.multiply(e)}divide(e,n){return arguments.length<=0?this:(arguments.length<=1?typeof e=="number"?(this.x/=e,this.y/=e):e&&typeof e.x=="number"&&typeof e.y=="number"&&(this.x/=e.x,this.y/=e.y):(this.x/=e,this.y/=n),isNaN(this.x)&&(this.x=0),isNaN(this.y)&&(this.y=0),this)}divideSelf(e){return this.divide.apply(this,arguments)}divideScalar(e){return this.divide(e)}negate(){return this.multiply(-1)}dot(e){return this.x*e.x+this.y*e.y}length(){return Math.sqrt(this.lengthSquared())}lengthSquared(){return this.x*this.x+this.y*this.y}normalize(){return this.divideScalar(this.length())}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const n=this.x-e.x,r=this.y-e.y;return n*n+r*r}setLength(e){return this.normalize().multiplyScalar(e)}equals(e,n){return n=typeof n>"u"?1e-4:n,this.distanceTo(e)<n}lerp(e,n){const r=(e.x-this.x)*n+this.x,s=(e.y-this.y)*n+this.y;return this.set(r,s)}isZero(e){return e=typeof e>"u"?1e-4:e,this.length()<e}toString(){return this.x+", "+this.y}toObject(){return{x:Ee(this.x),y:Ee(this.y)}}rotate(e){const n=this.x,r=this.y,s=Math.cos(e),o=Math.sin(e);return this.x=n*s-r*o,this.y=n*o+r*s,this}};w(Xt,"zero",new Xt),w(Xt,"left",new Xt(-1,0)),w(Xt,"right",new Xt(1,0)),w(Xt,"up",new Xt(0,-1)),w(Xt,"down",new Xt(0,1));var Z=Xt,ve=class Ns extends Z{constructor(e=0,n=0,r=0,s=0,o=0,a=0,l=Q.move){super(e,n),w(this,"controls",{left:new Z,right:new Z}),w(this,"_command",Q.move),w(this,"_relative",!0),w(this,"_rx",0),w(this,"_ry",0),w(this,"_xAxisRotation",0),w(this,"_largeArcFlag",0),w(this,"_sweepFlag",1);for(let d in al)Object.defineProperty(this,d,al[d]);this.command=l,this.relative=!0;const c=Ns.makeBroadcast(this);this.controls.left.set(r,s).addEventListener(Y.Types.change,c),this.controls.right.set(o,a).addEventListener(Y.Types.change,c)}static makeBroadcast(e){return n;function n(){e._bound&&e.dispatchEvent(Y.Types.change)}}static fromObject(e){return new Ns().copy(e)}copy(e){return this.x=e.x,this.y=e.y,typeof e.command=="string"&&(this.command=e.command),e.controls&&(e.controls.left&&this.controls.left.copy(e.controls.left),e.controls.right&&this.controls.right.copy(e.controls.right)),typeof e.relative=="boolean"&&(this.relative=e.relative),typeof e.rx=="number"&&(this.rx=e.rx),typeof e.ry=="number"&&(this.ry=e.ry),typeof e.xAxisRotation=="number"&&(this.xAxisRotation=e.xAxisRotation),typeof e.largeArcFlag=="number"&&(this.largeArcFlag=e.largeArcFlag),typeof e.sweepFlag=="number"&&(this.sweepFlag=e.sweepFlag),this}clone(){return new Ns().copy(this)}toObject(){return{x:Ee(this.x),y:Ee(this.y),command:this.command,relative:this.relative,controls:{left:this.controls.left.toObject(),right:this.controls.right.toObject()},rx:Ee(this.rx),ry:Ee(this.ry),xAxisRotation:Ee(this.xAxisRotation),largeArcFlag:Ee(this.largeArcFlag),sweepFlag:Ee(this.sweepFlag)}}toString(){return JSON.stringify(this.toObject())}},al={command:{enumerable:!0,get:function(){return this._command},set:function(t){this._command!==t&&(this._command=t,this._bound&&this.dispatchEvent(Y.Types.change))}},relative:{enumerable:!0,get:function(){return this._relative},set:function(t){this._relative!==!!t&&(this._relative=!!t,this._bound&&this.dispatchEvent(Y.Types.change))}},rx:{enumerable:!0,get:function(){return this._rx},set:function(t){this._rx!==t&&(this._rx=t,this._bound&&this.dispatchEvent(Y.Types.change))}},ry:{enumerable:!0,get:function(){return this._ry},set:function(t){this._ry!==t&&(this._ry=t,this._bound&&this.dispatchEvent(Y.Types.change))}},xAxisRotation:{enumerable:!0,get:function(){return this._xAxisRotation},set:function(t){this._xAxisRotation!==t&&(this._xAxisRotation=t,this._bound&&this.dispatchEvent(Y.Types.change))}},largeArcFlag:{enumerable:!0,get:function(){return this._largeArcFlag},set:function(t){this._largeArcFlag!==t&&(this._largeArcFlag=t,this._bound&&this.dispatchEvent(Y.Types.change))}},sweepFlag:{get:function(){return this._sweepFlag},set:function(t){this._sweepFlag!==t&&(this._sweepFlag=t,this._bound&&this.dispatchEvent(Y.Types.change))}}},zg=0,xt={NextFrameId:null,Types:{webgl:"WebGLRenderer",svg:"SVGRenderer",canvas:"CanvasRenderer"},Version:"v0.8.21",PublishDate:"2025-10-01T00:18:49.277Z",Identifier:"two-",Resolution:12,AutoCalculateImportedMatrices:!0,Instances:[],uniqueId:function(){return zg++}},$i={CollinearityEpsilon:Math.pow(10,-30),RecursionLimit:16,CuspLimit:0,Tolerance:{distance:.25,angle:0,epsilon:Number.EPSILON},abscissas:[[.5773502691896],[0,.7745966692415],[.3399810435849,.8611363115941],[0,.5384693101057,.9061798459387],[.2386191860832,.6612093864663,.9324695142032],[0,.4058451513774,.7415311855994,.9491079123428],[.1834346424956,.5255324099163,.7966664774136,.9602898564975],[0,.3242534234038,.6133714327006,.8360311073266,.9681602395076],[.1488743389816,.4333953941292,.679409568299,.865063366689,.9739065285172],[0,.2695431559523,.5190961292068,.730152005574,.8870625997681,.9782286581461],[.1252334085115,.3678314989982,.5873179542866,.7699026741943,.9041172563705,.9815606342467],[0,.2304583159551,.4484927510364,.6423493394403,.8015780907333,.917598399223,.9841830547186],[.1080549487073,.3191123689279,.5152486363582,.6872929048117,.8272013150698,.9284348836636,.9862838086968],[0,.2011940939974,.3941513470776,.5709721726085,.7244177313602,.8482065834104,.9372733924007,.9879925180205],[.0950125098376,.2816035507793,.4580167776572,.6178762444026,.755404408355,.8656312023878,.9445750230732,.9894009349916]],weights:[[1],[.8888888888889,.5555555555556],[.6521451548625,.3478548451375],[.5688888888889,.4786286704994,.2369268850562],[.4679139345727,.3607615730481,.1713244923792],[.4179591836735,.3818300505051,.2797053914893,.1294849661689],[.3626837833784,.3137066458779,.2223810344534,.1012285362904],[.3302393550013,.31234707704,.2606106964029,.1806481606949,.0812743883616],[.2955242247148,.26926671931,.219086362516,.1494513491506,.0666713443087],[.2729250867779,.2628045445102,.233193764592,.1862902109277,.1255803694649,.0556685671162],[.2491470458134,.2334925365384,.2031674267231,.1600783285433,.1069393259953,.0471753363865],[.2325515532309,.2262831802629,.2078160475369,.1781459807619,.1388735102198,.0921214998377,.0404840047653],[.2152638534632,.2051984637213,.1855383974779,.1572031671582,.1215185706879,.0801580871598,.0351194603318],[.2025782419256,.1984314853271,.1861610000156,.166269205817,.1395706779262,.1071592204672,.0703660474881,.0307532419961],[.1894506104551,.1826034150449,.169156519395,.1495959888166,.1246289712555,.0951585116825,.0622535239386,.0271524594118]]};function nr(t,e,n,r,s){const o=1-t;return o*o*o*e+3*o*o*t*n+3*o*t*t*r+t*t*t*s}function Ls(t,e,n,r,s,o,a,l,c){c=c||$i.RecursionLimit;const d=c+1;if(Math.abs(t-a)<.001&&Math.abs(e-l)<.001)return[new ve(a,l)];const h=[];for(let u=0;u<d;u++){const m=u/d,f=nr(m,t,n,s,a),g=nr(m,e,r,o,l);h.push(new ve(f,g))}return h}function ll(t,e,n,r,s,o,a,l,c){if(t===n&&e===r&&s===a&&o===l){const b=a-t,y=l-e;return Math.sqrt(b*b+y*y)}const d=9*(n-s)+3*(a-t),h=6*(t+s)-12*n,u=3*(n-t),m=9*(r-o)+3*(l-e),f=6*(e+o)-12*r,g=3*(r-e);function p(b){const y=(d*b+h)*b+u,_=(m*b+f)*b+g;return Math.sqrt(y*y+_*_)}return dl(p,0,1,c||$i.RecursionLimit)}function cl(t,e,n,r,s,o,a,l){const c=[],d=[[],[]];let h,u,m,f,g,p,b,y;for(let v=0;v<2;++v){if(v===0?(u=6*t-12*n+6*s,h=-3*t+9*n-9*s+3*a,m=3*n-3*t):(u=6*e-12*r+6*o,h=-3*e+9*r-9*o+3*l,m=3*r-3*e),Math.abs(h)<.001){if(Math.abs(u)<.001)continue;f=-m/u,0<f&&f<1&&c.push(f);continue}b=u*u-4*m*h,y=Math.sqrt(b),!(b<0)&&(g=(-u+y)/(2*h),0<g&&g<1&&c.push(g),p=(-u-y)/(2*h),0<p&&p<1&&c.push(p))}let _=c.length,S=_,C;for(;_--;)f=c[_],C=1-f,d[0][_]=C*C*C*t+3*C*C*f*n+3*C*f*f*s+f*f*f*a,d[1][_]=C*C*C*e+3*C*C*f*r+3*C*f*f*o+f*f*f*l;return d[0][S]=t,d[1][S]=e,d[0][S+1]=a,d[1][S+1]=l,d[0].length=d[1].length=S+2,{min:{x:Math.min.apply(0,d[0]),y:Math.min.apply(0,d[1])},max:{x:Math.max.apply(0,d[0]),y:Math.max.apply(0,d[1])}}}function dl(t,e,n,r){let s=$i.abscissas[r-2],o=$i.weights[r-2],a=.5*(n-e),l=a+e,c=0,d=r+1>>1,h=r&1?o[c++]*t(l):0;for(;c<d;){const u=a*s[c];h+=o[c++]*(t(l+u)+t(l-u))}return a*h}function hl(t,e){const n=t.length,r=n-1;for(let s=0;s<n;s++){const o=t[s],a=e?Ft(s-1,n):Math.max(s-1,0),l=e?Ft(s+1,n):Math.min(s+1,r),c=t[a],d=o,h=t[l];ul(c,d,h),d.command=s===0?Q.move:Q.curve}}function ul(t,e,n){const r=Z.angleBetween(t,e),s=Z.angleBetween(n,e);let o=Z.distanceBetween(t,e),a=Z.distanceBetween(n,e),l=(r+s)/2;return o<.001||a<.001?(typeof e.relative=="boolean"&&!e.relative&&(e.controls.left.copy(e),e.controls.right.copy(e)),e):(o*=.33,a*=.33,s<r?l+=Ze:l-=Ze,e.controls.left.x=Math.cos(l)*o,e.controls.left.y=Math.sin(l)*o,l-=Math.PI,e.controls.right.x=Math.cos(l)*a,e.controls.right.y=Math.sin(l)*a,typeof e.relative=="boolean"&&!e.relative&&(e.controls.left.x+=e.x,e.controls.left.y+=e.y,e.controls.right.x+=e.x,e.controls.right.y+=e.y),e)}function Ds(t,e,n){return new Z(2*t.x-(e.x+t.x)-(n?t.x:0),2*t.y-(e.y+t.y)-(n?t.y:0))}function Lg(t,e,n,r,s,o,a){const l=xt.Resolution;for(let c=0;c<l;c++){let d=(c+1)/l;a&&(d=1-d);const h=d*o+s,u=n*Math.cos(h),m=r*Math.sin(h),f=new ve(u,m);f.command=Q.line}}var fl=Array.prototype.slice;function Dg(t){if(t==null)return!1;const e=t.length;return typeof e=="number"&&e>=0&&e<4294967296}var K={isNaN:function(t){return typeof t=="number"&&t!==+t},isElement:function(t){return!!(t&&t.nodeType===1)},isObject:function(t){const e=typeof t;return e==="function"||e==="object"&&!!t},isFunction:function(t){return typeof t=="function"},extend:function(t){const e=fl.call(arguments,1);for(let n=0;n<e.length;n++){const r=e[n];for(let s in r)t[s]=r[s]}return t},defaults:function(t){const e=fl.call(arguments,1);for(let n=0;n<e.length;n++){const r=e[n];for(let s in r)t[s]===void 0&&(t[s]=r[s])}return t},each:function(t,e,n){const r=n||this,s=!Dg(t)&&Object.keys(t),o=(s||t).length;for(let a=0;a<o;a++){const l=s?s[a]:a;e.call(r,t[l],l,t)}return t},performance:ze.performance&&ze.performance.now?ze.performance:Date},Mt={hasEventListeners:typeof ze.addEventListener=="function",bind:function(t,e,n,r){return this.hasEventListeners?t.addEventListener(e,n,!!r):t.attachEvent("on"+e,n),Mt},unbind:function(t,e,n,r){return Mt.hasEventListeners?t.removeEventListeners(e,n,!!r):t.detachEvent("on"+e,n),Mt},getRequestAnimationFrame:function(){const t=["ms","moz","webkit","o"];let e=0,n=ze.requestAnimationFrame;if(!n){for(let s=0;s<t.length;s++)n=ze[t[s]+"RequestAnimationFrame"]||n;n=n||r}function r(s,o){const a=new Date().getTime(),l=Math.max(0,16-(a-e)),c=ze.setTimeout(d,l);e=a+l;function d(){s(a+l)}return c}return n}},Ei=ze.document?ze.document.createElement("div"):{};Ei.id="help-two-load",Object.defineProperty(Mt,"temp",{enumerable:!0,get:function(){return K.isElement(Ei)&&!ze.document.head.contains(Ei)&&(Ei.style.display="none",ze.document.head.appendChild(Ei)),Ei}});var $t=class extends Error{constructor(e){super(),w(this,"name","Two.js"),w(this,"message"),this.message=e}},Hg=ze.devicePixelRatio||1;function Wg(t){return t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1}function Hs(t){return Hg/Wg(t)}var Fr=class{constructor(){w(this,"map",{})}add(e,n){return this.map[e]=n,this}remove(e){return delete this.map[e],this}get(e){return this.map[e]}contains(e){return e in this.map}},dt,Mn=class extends Array{constructor(){super(),el(this,dt,new Y),arguments[0]&&Array.isArray(arguments[0])?arguments[0].length>0&&this.push.apply(this,arguments[0]):arguments.length>0&&this.push.apply(this,arguments)}get _events(){return Rt(this,dt)}set _events(e){Vg(this,dt,e)}get _bound(){return Rt(this,dt)._bound}set _bound(e){Rt(this,dt)._bound=e}addEventListener(){return Rt(this,dt).addEventListener.apply(this,arguments)}on(){return Rt(this,dt).on.apply(this,arguments)}bind(){return Rt(this,dt).bind.apply(this,arguments)}removeEventListener(){return Rt(this,dt).removeEventListener.apply(this,arguments)}off(){return Rt(this,dt).off.apply(this,arguments)}unbind(){return Rt(this,dt).unbind.apply(this,arguments)}dispatchEvent(){return Rt(this,dt).dispatchEvent.apply(this,arguments)}trigger(){return Rt(this,dt).trigger.apply(this,arguments)}listen(){return Rt(this,dt).listen.apply(this,arguments)}ignore(){return Rt(this,dt).ignore.apply(this,arguments)}pop(){const e=super.pop.apply(this,arguments);return this.trigger(Y.Types.remove,[e]),e}shift(){const e=super.shift.apply(this,arguments);return this.trigger(Y.Types.remove,[e]),e}push(){const e=super.push.apply(this,arguments);return this.trigger(Y.Types.insert,arguments),e}unshift(){const e=super.unshift.apply(this,arguments);return this.trigger(Y.Types.insert,arguments),e}splice(){const e=super.splice.apply(this,arguments);if(this.trigger(Y.Types.remove,e),arguments.length>2){const n=this.slice(arguments[0],arguments[0]+arguments.length-2);this.trigger(Y.Types.insert,n),this.trigger(Y.Types.order)}return e}sort(){return super.sort.apply(this,arguments),this.trigger(Y.Types.order),this}reverse(){return super.reverse.apply(this,arguments),this.trigger(Y.Types.order),this}indexOf(){return super.indexOf.apply(this,arguments)}map(e,n){const r=[];for(let s=0;s<this.length;s++){const o=this[s];let a;n?a=e.call(n,o,s):a=e(o,s),r.push(a)}return r}};dt=new WeakMap;var gl=class Mu extends Y{constructor(){super(),w(this,"_flagId",!1),w(this,"_flagClassName",!1),w(this,"_renderer",{}),w(this,"_id",xt.Identifier+xt.uniqueId()),w(this,"_className",""),w(this,"classList",[]);for(let e in ml)Object.defineProperty(this,e,ml[e])}static fromObject(e){const n=new Mu().copy(e);return"id"in e&&(n.id=e.id),n}flagReset(){return this._flagId=this._flagClassName=!1,this}copy(e){return e.renderer&&typeof e.renderer.type=="string"&&(this.renderer.type=e.renderer.type),typeof e.className=="string"&&(this.className=e.className),this}toObject(){return{renderer:{type:this.renderer.type},id:this.id,className:this.className}}dispose(){const e=this._renderer.type;return this._renderer={type:e},typeof this.unbind=="function"&&this.unbind(),this}};w(gl,"Properties",["renderer","id","className"]);var Ni=gl,ml={renderer:{enumerable:!1,get:function(){return this._renderer}},id:{enumerable:!0,get:function(){return this._id},set:function(t){const e=this._id;t!==this._id&&(this._id=t,this._flagId=!0,this.parent&&(delete this.parent.children.ids[e],this.parent.children.ids[this._id]=this))}},className:{enumerable:!0,get:function(){return this._className},set:function(t){this._className!==t&&(this._flagClassName=!0,this.classList=t.split(/\s+?/),this._className=t)}}},Mr,pl={video:/\.(mp4|webm|ogg)$/i,image:/\.(jpe?g|png|gif|tiff|webp)$/i,effect:/texture|gradient/i};ze.document&&(Mr=document.createElement("a"));var Yt=class Vt extends Ni{constructor(e,n){super(),w(this,"_flagSrc",!1),w(this,"_flagImage",!1),w(this,"_flagVideo",!1),w(this,"_flagLoaded",!1),w(this,"_flagRepeat",!1),w(this,"_flagOffset",!1),w(this,"_flagScale",!1),w(this,"_src",""),w(this,"_image",null),w(this,"_loaded",!1),w(this,"_repeat","no-repeat"),w(this,"_scale",1),w(this,"_offset",null);for(let r in yl)Object.defineProperty(this,r,yl[r]);if(this._renderer.type="texture",this._renderer.flagOffset=jg.bind(this),this._renderer.flagScale=qg.bind(this),this.loaded=!1,this.repeat="no-repeat",this.offset=new Z,typeof n=="function"){const r=(function(){this.unbind(Y.Types.load,r),typeof n=="function"&&n()}).bind(this);this.bind(Y.Types.load,r)}if(typeof e=="string")this.src=e;else if(typeof e=="object"){const r=Object.prototype.toString.call(e);(r==="[object HTMLImageElement]"||r==="[object HTMLCanvasElement]"||r==="[object HTMLVideoElement]"||r==="[object Image]")&&(this.image=e)}this._update()}fromObject(e){const n=new Vt().copy(e);return"id"in e&&(n.id=e.id),n}static getAbsoluteURL(e){return Mr?(Mr.href=e,Mr.href):e}static loadHeadlessBuffer(e,n){e.image.onload=n,e.image.src=e.src}static getTag(e){return e&&e.nodeName&&e.nodeName.toLowerCase()||"img"}static getImage(e){const n=Vt.getAbsoluteURL(e);if(Vt.ImageRegistry.contains(n))return Vt.ImageRegistry.get(n);let r;return wt.Image?(r=new wt.Image,wt.shim(r,"img")):ze.document?pl.video.test(n)?r=document.createElement("video"):r=document.createElement("img"):console.warn("Two.js: no prototypical image defined for Two.Texture"),r.crossOrigin="anonymous",r.referrerPolicy="no-referrer",r}static load(e,n){let r=e.image,s=Vt.getTag(r);e._flagImage&&(/canvas/i.test(s)?Vt.Register.canvas(e,n):(e._src=!wt.isHeadless&&r.getAttribute("two-src")||r.src,Vt.Register[s](e,n))),e._flagSrc&&(r||(r=Vt.getImage(e.src),e.image=r),s=Vt.getTag(r),Vt.Register[s](e,n))}clone(){const e=new Vt(this.src);return e.repeat=this.repeat,e.offset.copy(this.offset),e.scale=this.scale,e}copy(e){return this.src=e.src,this.repeat=e.repeat,this.offset=typeof e.offset=="number"||e.offset instanceof Z?e.offset:new Z().copy(e.offset),this.scale=typeof e.scale=="number"||e.scale instanceof Z?e.scale:new Z().copy(e.scale),this}toObject(){const e=super.toObject.call(this);return e.renderer.type="texture",e.src=this.src,e.repeat=this.repeat,e.offset=this.offset.toObject(),e.scale=typeof this.scale=="number"?this.scale:this.scale.toObject(),e}_update(){return(this._flagSrc||this._flagImage)&&(this.trigger(Y.Types.change),(this._flagSrc||this._flagImage)&&(this.loaded=!1,Vt.load(this,(function(){this.loaded=!0,this.trigger(Y.Types.change).trigger(Y.Types.load)}).bind(this)))),this._image&&this._image.readyState>=4&&(this._flagVideo=!0),this}flagReset(){return this._flagSrc=this._flagImage=this._flagLoaded=this._flagRepeat=this._flagVideo=this._flagScale=this._flagOffset=!1,super.flagReset.call(this),this}dispose(){if(super.dispose(),"elem"in this._renderer){const e=this._renderer.elem;e.parentNode.removeChild(e)}return"effect"in this._renderer&&(this._renderer.effect=null),this}};w(Yt,"Properties",["src","loaded","repeat","scale","offset","image"]),w(Yt,"RegularExpressions",pl),w(Yt,"ImageRegistry",new Fr),w(Yt,"Register",{canvas:function(t,e){t._src="#"+t.id,Yt.ImageRegistry.add(t.src,t.image),typeof e=="function"&&e()},img:function(t,e){const n=t.image,r=function(o){!wt.isHeadless&&n.removeEventListener&&typeof n.removeEventListener=="function"&&(n.removeEventListener("load",r,!1),n.removeEventListener("error",s,!1)),typeof e=="function"&&e()},s=function(o){throw!wt.isHeadless&&typeof n.removeEventListener=="function"&&(n.removeEventListener("load",r,!1),n.removeEventListener("error",s,!1)),new $t("unable to load "+t.src)};typeof n.width=="number"&&n.width>0&&typeof n.height=="number"&&n.height>0?r():!wt.isHeadless&&typeof n.addEventListener=="function"&&(n.addEventListener("load",r,!1),n.addEventListener("error",s,!1)),t._src=Yt.getAbsoluteURL(t._src),!(!wt.isHeadless&&n&&n.getAttribute("two-src"))&&(wt.isHeadless||n.setAttribute("two-src",t.src),Yt.ImageRegistry.add(t.src,n),wt.isHeadless?Yt.loadHeadlessBuffer(t,r):t.image.src=t.src)},video:function(t,e){if(wt.isHeadless)throw new $t("video textures are not implemented in headless environments.");const n=function(s){t.image.removeEventListener("canplaythrough",n,!1),t.image.removeEventListener("error",r,!1),t.image.width=t.image.videoWidth,t.image.height=t.image.videoHeight,typeof e=="function"&&e()},r=function(s){throw t.image.removeEventListener("canplaythrough",n,!1),t.image.removeEventListener("error",r,!1),new $t("unable to load "+t.src)};t._src=Yt.getAbsoluteURL(t._src),t.image.getAttribute("two-src")||(t.image.setAttribute("two-src",t.src),Yt.ImageRegistry.add(t.src,t.image)),t.image.readyState>=4?n():(t.image.addEventListener("canplaythrough",n,!1),t.image.addEventListener("error",r,!1),t.image.src=t.src,t.image.load())}});var Ne=Yt,yl={src:{enumerable:!0,get:function(){return this._src},set:function(t){this._src=t,this._flagSrc=!0}},loaded:{enumerable:!0,get:function(){return this._loaded},set:function(t){this._loaded=t,this._flagLoaded=!0}},repeat:{enumerable:!0,get:function(){return this._repeat},set:function(t){this._repeat=t,this._flagRepeat=!0}},image:{enumerable:!0,get:function(){return this._image},set:function(t){const e=Ne.getTag(t);let n;switch(e){case"canvas":n="#"+t.id;break;default:n=t.src}Ne.ImageRegistry.contains(n)?this._image=Ne.ImageRegistry.get(t.src):this._image=t,this._flagImage=!0}},offset:{enumerable:!0,get:function(){return this._offset},set:function(t){this._offset&&this._offset.unbind(Y.Types.change,this._renderer.flagOffset),this._offset=t,this._offset.bind(Y.Types.change,this._renderer.flagOffset),this._flagOffset=!0}},scale:{enumerable:!0,get:function(){return this._scale},set:function(t){this._scale instanceof Z&&this._scale.unbind(Y.Types.change,this._renderer.flagScale),this._scale=t,this._scale instanceof Z&&this._scale.bind(Y.Types.change,this._renderer.flagScale),this._flagScale=!0}}};function jg(){this._flagOffset=!0}function qg(){this._flagScale=!0}var Ws=class tn extends Ni{constructor(e,n,r){super(),w(this,"_flagOffset",!0),w(this,"_flagOpacity",!0),w(this,"_flagColor",!0),w(this,"_offset",0),w(this,"_opacity",1),w(this,"_color","#fff");for(let s in bl)Object.defineProperty(this,s,bl[s]);this._renderer.type="stop",this.offset=typeof e=="number"?e:tn.Index<=0?0:1,this.opacity=typeof r=="number"?r:1,this.color=typeof n=="string"?n:tn.Index<=0?"#fff":"#000",tn.Index=(tn.Index+1)%2}static fromObject(e){const n=new tn().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<tn.Properties.length;n++){const r=tn.Properties[n];r in e&&(this[r]=e[r])}return this}clone(e){const n=new tn;return K.each(tn.Properties,function(r){n[r]=this[r]},this),e&&e.stops&&e.stops.push(n),n}toObject(){const e=super.toObject.call(this);return e.renderer.type="stop",K.each(tn.Properties,n=>{e[n]=this[n]},this),e}flagReset(){return this._flagOffset=this._flagColor=this._flagOpacity=!1,super.flagReset.call(this),this}};w(Ws,"Index",0),w(Ws,"Properties",["offset","opacity","color"]);var An=Ws,bl={offset:{enumerable:!0,get:function(){return this._offset},set:function(t){this._offset=t,this._flagOffset=!0,this.parent&&(this.parent._flagStops=!0)}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(t){this._opacity=t,this._flagOpacity=!0,this.parent&&(this.parent._flagStops=!0)}},color:{enumerable:!0,get:function(){return this._color},set:function(t){this._color=t,this._flagColor=!0,this.parent&&(this.parent._flagStops=!0)}}},js=class xi extends Ni{constructor(e){super(),w(this,"_flagStops",!1),w(this,"_flagSpread",!1),w(this,"_flagUnits",!1),w(this,"_spread",""),w(this,"_units","");for(let n in _l)Object.defineProperty(this,n,_l[n]);this._renderer.type="gradient",this._renderer.flagStops=Xg.bind(this),this._renderer.bindStops=Yg.bind(this),this._renderer.unbindStops=Ug.bind(this),this.spread="pad",this.units="objectBoundingBox",e&&(this.stops=e)}static fromObject(e){let n=e.stops;n&&n.length>0&&(n=n.map(s=>s instanceof An?s:new An().copy(s)));const r=new xi(n).copy(e);return"id"in e&&(r.id=e.id),r}clone(e){const n=this.stops.map(s=>s.clone()),r=new xi(n);return K.each(xi.Properties,s=>{r[s]=this[s]},this),e&&e.add(r),r}copy(e){super.copy.call(this,e);for(let n=0;n<xi.Properties.length;n++){const r=xi.Properties[n];r in e&&(this[r]=e[r])}return this}toObject(){const e={stops:this.stops.map(n=>n.toObject())};return K.each(xi.Properties,n=>{e[n]=this[n]},this),e}_update(){return(this._flagSpread||this._flagStops)&&this.trigger(Y.Types.change),this}flagReset(){return this._flagSpread=this._flagUnits=this._flagStops=!1,super.flagReset.call(this),this}dispose(){if("elem"in this._renderer){const e=this._renderer.elem;e.parentNode.removeChild(e)}return"effect"in this._renderer&&(this._renderer.effect=null),this}};w(js,"Stop",An),w(js,"Properties",["spread","stops","units"]);var Je=js,_l={spread:{enumerable:!0,get:function(){return this._spread},set:function(t){this._spread=t,this._flagSpread=!0}},units:{enumerable:!0,get:function(){return this._units},set:function(t){this._units=t,this._flagUnits=!0}},stops:{enumerable:!0,get:function(){return this._stops},set:function(t){const e=this._renderer.bindStops,n=this._renderer.unbindStops;this._stops&&this._stops.unbind(Y.Types.insert,e).unbind(Y.Types.remove,n),this._stops=new Mn((t||[]).slice(0)),this._stops.bind(Y.Types.insert,e).bind(Y.Types.remove,n),e(this._stops)}}};function Xg(){this._flagStops=!0}function Yg(t){let e=t.length;for(;e--;)t[e].bind(Y.Types.change,this._renderer.flagStops),t[e].parent=this;this._renderer.flagStops()}function Ug(t){let e=t.length;for(;e--;)t[e].unbind(Y.Types.change,this._renderer.flagStops),delete t[e].parent;this._renderer.flagStops()}var qs=class Sr extends Je{constructor(e,n,r,s,o){super(o),w(this,"_flagEndPoints",!1),w(this,"_left",null),w(this,"_right",null);for(let a in wl)Object.defineProperty(this,a,wl[a]);this._renderer.type="linear-gradient",this._renderer.flagEndPoints=Gg.bind(this),this.left=new Z,this.right=new Z,typeof e=="number"&&(this.left.x=e),typeof n=="number"&&(this.left.y=n),typeof r=="number"&&(this.right.x=r),typeof s=="number"&&(this.right.y=s)}static fromObject(e){const n=new Sr().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<Sr.Properties.length;n++){const r=Sr.Properties[n];r in e&&(this[r]=e[r]instanceof Z?e[r]:new Z().copy(e[r]))}return this}clone(e){const n=this.stops.map(function(s){return s.clone()}),r=new Sr(this.left._x,this.left._y,this.right._x,this.right._y,n);return K.each(Je.Properties,function(s){r[s]=this[s]},this),e&&e.add(r),r}toObject(){const e=super.toObject.call(this);return e.left=this.left.toObject(),e.right=this.right.toObject(),e}_update(){return(this._flagEndPoints||this._flagSpread||this._flagStops)&&this.trigger(Y.Types.change),this}flagReset(){return this._flagEndPoints=!1,super.flagReset.call(this),this}};w(qs,"Stop",An),w(qs,"Properties",["left","right"]);var Le=qs,wl={left:{enumerable:!0,get:function(){return this._left},set:function(t){this._left instanceof Z&&this._left.unbind(Y.Types.change,this._renderer.flagEndPoints),this._left=t,this._left.bind(Y.Types.change,this._renderer.flagEndPoints),this._flagEndPoints=!0}},right:{enumerable:!0,get:function(){return this._right},set:function(t){this._right instanceof Z&&this._right.unbind(Y.Types.change,this._renderer.flagEndPoints),this._right=t,this._right.bind(Y.Types.change,this._renderer.flagEndPoints),this._flagEndPoints=!0}}};function Gg(){this._flagEndPoints=!0}var Xs=class vi extends Je{constructor(e,n,r,s,o,a){super(s),w(this,"_flagRadius",!1),w(this,"_flagCenter",!1),w(this,"_flagFocal",!1),w(this,"_radius",0),w(this,"_center",null),w(this,"_focal",null);for(let l in xl)Object.defineProperty(this,l,xl[l]);this._renderer.type="radial-gradient",this._renderer.flagCenter=Kg.bind(this),this._renderer.flagFocal=Zg.bind(this),this.center=new Z,this.radius=typeof r=="number"?r:1,this.focal=new Z,typeof e=="number"&&(this.center.x=e),typeof n=="number"&&(this.center.y=n),this.focal.copy(this.center),typeof o=="number"&&(this.focal.x=o),typeof a=="number"&&(this.focal.y=a)}static fromObject(e){const n=new vi().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<vi.Properties.length;n++){const r=vi.Properties[n];r in e&&(/(center|focal)i/.test(r)?this[r]=e[r]instanceof Z?e[r]:new Z().copy(e[r]):typeof e[r]=="number"&&(this[r]=e[MediaKeySystemAccess]))}return this}clone(e){const n=this.stops.map(function(s){return s.clone()}),r=new vi(this.center._x,this.center._y,this._radius,n,this.focal._x,this.focal._y);return K.each(Je.Properties.concat(vi.Properties),function(s){r[s]=this[s]},this),e&&e.add(r),r}toObject(){const e=super.toObject.call(this);return K.each(vi.Properties,function(n){e[n]=this[n]},this),e.center=this.center.toObject(),e.focal=this.focal.toObject(),e}_update(){return(this._flagRadius||this._flatCenter||this._flagFocal||this._flagSpread||this._flagStops)&&this.trigger(Y.Types.change),this}flagReset(){return this._flagRadius=this._flagCenter=this._flagFocal=!1,super.flagReset.call(this),this}};w(Xs,"Stop",An),w(Xs,"Properties",["center","radius","focal"]);var De=Xs,xl={radius:{enumerable:!0,get:function(){return this._radius},set:function(t){this._radius=t,this._flagRadius=!0}},center:{enumerable:!0,get:function(){return this._center},set:function(t){this._center&&this._center.unbind(Y.Types.change,this._renderer.flagCenter),this._center=t,this._center.bind(Y.Types.change,this._renderer.flagCenter),this._flagCenter=!0}},focal:{enumerable:!0,get:function(){return this._focal},set:function(t){this._focal&&this._focal.unbind(Y.Types.change,this._renderer.flagFocal),this._focal=t,this._focal.bind(Y.Types.change,this._renderer.flagFocal),this._flagFocal=!0}}};function Kg(){this._flagCenter=!0}function Zg(){this._flagFocal=!0}function vl(t,e){if(e===0||e===1)return!0;const r=t._length*e;let s=0;for(let o=0;o<t._lengths.length;o++){const a=t._lengths[o];if(s>=r)return r-s>=0;s+=a}return!1}function Ar(t,e){const n=t._length;if(e<=0)return 0;if(e>=n)return t._lengths.length-1;for(let r=0,s=0;r<t._lengths.length;r++){if(s+t._lengths[r]>=e)return e-=s,Math.max(r-1,0)+e/t._lengths[r];s+=t._lengths[r]}return-1}function kl(t,e,n){let r,s,o,a,l,c,d,h;const u=e.controls&&e.controls.right,m=t.controls&&t.controls.left;return r=e.x,l=e.y,s=(u||e).x,c=(u||e).y,o=(m||t).x,d=(m||t).y,a=t.x,h=t.y,u&&e._relative&&(s+=e.x,c+=e.y),m&&t._relative&&(o+=t.x,d+=t.y),ll(r,l,s,c,o,d,a,h,n)}function Cl(t,e,n){let r,s,o,a,l,c,d,h;const u=e.controls&&e.controls.right,m=t.controls&&t.controls.left;return r=e.x,l=e.y,s=(u||e).x,c=(u||e).y,o=(m||t).x,d=(m||t).y,a=t.x,h=t.y,u&&e._relative&&(s+=e.x,c+=e.y),m&&t._relative&&(o+=t.x,d+=t.y),Ls(r,l,s,c,o,d,a,h,n)}function Jn(t){switch(t.renderer.type){case"texture":return Ne.fromObject(t);case"gradient":return Je.fromObject(t);case"linear-gradient":return Le.fromObject(t);case"radial-gradient":return De.fromObject(t)}return t}var Jg=Math.cos,Qg=Math.sin,Sl=Math.tan,Ys=[],Bl=class It extends Y{constructor(e,n,r,s,o,a){super(),w(this,"elements",new nn(9)),w(this,"manual",!1);let l=e;Array.isArray(l)||(l=Array.prototype.slice.call(arguments)),this.identity(),l.length>0&&this.set(l)}static Multiply(e,n,r){if(n.length<=3){const B=e;let k,R,$;const F=n[0]||0,D=n[1]||0,L=n[2]||0;return k=B[0]*F+B[1]*D+B[2]*L,R=B[3]*F+B[4]*D+B[5]*L,$=B[6]*F+B[7]*D+B[8]*L,[k,R,$]}const s=e[0],o=e[1],a=e[2],l=e[3],c=e[4],d=e[5],h=e[6],u=e[7],m=e[8],f=n[0],g=n[1],p=n[2],b=n[3],y=n[4],_=n[5],S=n[6],C=n[7],v=n[8];return r=r||new nn(9),r[0]=s*f+o*b+a*S,r[1]=s*g+o*y+a*C,r[2]=s*p+o*_+a*v,r[3]=l*f+c*b+d*S,r[4]=l*g+c*y+d*C,r[5]=l*p+c*_+d*v,r[6]=h*f+u*b+m*S,r[7]=h*g+u*y+m*C,r[8]=h*p+u*_+m*v,r}static fromObject(e){return new It().copy(e)}set(e,n,r,s,o,a,l,c,d){if(typeof n>"u"){const h=e;e=h[0],n=h[1],r=h[2],s=h[3],o=h[4],a=h[5],l=h[6],c=h[7],d=h[8]}return this.elements[0]=e,this.elements[1]=n,this.elements[2]=r,this.elements[3]=s,this.elements[4]=o,this.elements[5]=a,this.elements[6]=l,this.elements[7]=c,this.elements[8]=d,this.trigger(Y.Types.change)}copy(e){return this.elements[0]=e.elements[0],this.elements[1]=e.elements[1],this.elements[2]=e.elements[2],this.elements[3]=e.elements[3],this.elements[4]=e.elements[4],this.elements[5]=e.elements[5],this.elements[6]=e.elements[6],this.elements[7]=e.elements[7],this.elements[8]=e.elements[8],this.manual=e.manual,this.trigger(Y.Types.change)}identity(){return this.elements[0]=It.Identity[0],this.elements[1]=It.Identity[1],this.elements[2]=It.Identity[2],this.elements[3]=It.Identity[3],this.elements[4]=It.Identity[4],this.elements[5]=It.Identity[5],this.elements[6]=It.Identity[6],this.elements[7]=It.Identity[7],this.elements[8]=It.Identity[8],this.trigger(Y.Types.change)}multiply(e,n,r,s,o,a,l,c,d){if(typeof n>"u")return this.elements[0]*=e,this.elements[1]*=e,this.elements[2]*=e,this.elements[3]*=e,this.elements[4]*=e,this.elements[5]*=e,this.elements[6]*=e,this.elements[7]*=e,this.elements[8]*=e,this.trigger(Y.Types.change);if(typeof r>"u"&&(r=1),typeof s>"u"){e=e||0,n=n||0,r=r||0,o=this.elements;const z=o[0]*e+o[1]*n+o[2]*r,O=o[3]*e+o[4]*n+o[5]*r,ne=o[6]*e+o[7]*n+o[8]*r;return[z,O,ne]}const h=this.elements,u=[e,n,r,s,o,a,l,c,d],m=h[0],f=h[1],g=h[2],p=h[3],b=h[4],y=h[5],_=h[6],S=h[7],C=h[8],v=u[0],B=u[1],k=u[2],R=u[3],$=u[4],F=u[5],D=u[6],L=u[7],M=u[8];return this.elements[0]=m*v+f*R+g*D,this.elements[1]=m*B+f*$+g*L,this.elements[2]=m*k+f*F+g*M,this.elements[3]=p*v+b*R+y*D,this.elements[4]=p*B+b*$+y*L,this.elements[5]=p*k+b*F+y*M,this.elements[6]=_*v+S*R+C*D,this.elements[7]=_*B+S*$+C*L,this.elements[8]=_*k+S*F+C*M,this.trigger(Y.Types.change)}inverse(e){const n=this.elements;e=e||new It;const r=n[0],s=n[1],o=n[2],a=n[3],l=n[4],c=n[5],d=n[6],h=n[7],u=n[8],m=u*l-c*h,f=-u*a+c*d,g=h*a-l*d;let p=r*m+s*f+o*g;return p?(p=1/p,e.elements[0]=m*p,e.elements[1]=(-u*s+o*h)*p,e.elements[2]=(c*s-o*l)*p,e.elements[3]=f*p,e.elements[4]=(u*r-o*d)*p,e.elements[5]=(-c*r+o*a)*p,e.elements[6]=g*p,e.elements[7]=(-h*r+s*d)*p,e.elements[8]=(l*r-s*a)*p,e):null}scale(e,n){return arguments.length<=1&&(n=e),this.multiply(e,0,0,0,n,0,0,0,1)}rotate(e){const n=Jg(e),r=Qg(e);return this.multiply(n,-r,0,r,n,0,0,0,1)}translate(e,n){return this.multiply(1,0,e,0,1,n,0,0,1)}skewX(e){const n=Sl(e);return this.multiply(1,n,0,0,1,0,0,0,1)}skewY(e){const n=Sl(e);return this.multiply(1,0,0,n,1,0,0,0,1)}toString(e){return Ys.length=0,this.toTransformArray(e,Ys),Ys.map(Ee).join(" ")}toTransformArray(e,n){const r=this.elements,s=!!n,o=r[0],a=r[1],l=r[2],c=r[3],d=r[4],h=r[5];if(e){const u=r[6],m=r[7],f=r[8];if(s){n[0]=o,n[1]=c,n[2]=u,n[3]=a,n[4]=d,n[5]=m,n[6]=l,n[7]=h,n[8]=f;return}return[o,c,u,a,d,m,l,h,f]}if(s){n[0]=o,n[1]=c,n[2]=a,n[3]=d,n[4]=l,n[5]=h;return}return[o,c,a,d,l,h]}toArray(e,n){const r=this.elements,s=!!n,o=r[0],a=r[1],l=r[2],c=r[3],d=r[4],h=r[5];if(e){const u=r[6],m=r[7],f=r[8];if(s){n[0]=o,n[1]=a,n[2]=l,n[3]=c,n[4]=d,n[5]=h,n[6]=u,n[7]=m,n[8]=f;return}return[o,a,l,c,d,h,u,m,f]}if(s){n[0]=o,n[1]=a,n[2]=l,n[3]=c,n[4]=d,n[5]=h;return}return[o,a,l,c,d,h]}toObject(){return{renderer:{type:"matrix"},elements:this.toArray(!0),manual:!!this.manual}}clone(){return new It().copy(this)}};w(Bl,"Identity",[1,0,0,0,1,0,0,0,1]);var Pi=Bl;rl(Pi);var Tl=class Oa extends Ni{constructor(){super(),w(this,"_flagMatrix",!0),w(this,"_flagScale",!1),w(this,"_matrix",null),w(this,"_worldMatrix",null),w(this,"_position",null),w(this,"_rotation",0),w(this,"_scale",1),w(this,"_skewX",0),w(this,"_skewY",0);for(let e in Or)Object.defineProperty(this,e,Or[e]);this._renderer.flagMatrix=Rl.bind(this),this.isShape=!0,this.matrix=new Pi,this.worldMatrix=new Pi,this.position=new Z,this.rotation=0,this.scale=1,this.skewX=0,this.skewY=0}static fromObject(e){const n=new Oa().copy(e);return"id"in e&&(n.id=e.id),n}get renderer(){return this._renderer}set renderer(e){this._renderer=e}get translation(){return Or.position.get.apply(this,arguments)}set translation(e){Or.position.set.apply(this,arguments)}addTo(e){return e.add(this),this}remove(){return this.parent?(this.parent.remove(this),this):this}copy(e){return super.copy.call(this,e),"position"in e&&(e.position instanceof Z?this.position=e.position:this.position.copy(e.position)),"rotation"in e&&(this.rotation=e.rotation),"scale"in e&&(this.scale=typeof e.scale=="number"||e.scale instanceof Z?e.scale:new Z(e.scale.x,e.scale.y)),"skewX"in e&&(this.skewX=e.skewX),"skewY"in e&&(this.skewY=e.skewY),"matrix"in e&&e.matrix.manual&&(this.matrix.copy(e.matrix),this.matrix.manual=!0),this}clone(e){const n=new Oa;return n.position.copy(this.position),n.rotation=this.rotation,n.scale=this.scale,n.skewX=this.skewX,n.skewY=this.skewY,this.matrix.manual&&n.matrix.copy(this.matrix),e&&e.add(n),n._update()}toObject(){const e=super.toObject.call(this);return e.renderer={type:"shape"},e.isShape=!0,e.translation=this.translation.toObject(),e.rotation=this.translation.rotation,e.scale=this.scale instanceof Z?this.scale.toObject():this.scale,e.skewX=this.skewX,e.skewY=this.skewY,e.matrix=this.matrix.toObject(),e}_update(e){return!this._matrix.manual&&this._flagMatrix&&(this._matrix.identity().translate(this.position.x,this.position.y),this._matrix.rotate(this.rotation),this._scale instanceof Z?this._matrix.scale(this._scale.x,this._scale.y):this._matrix.scale(this._scale),this._matrix.skewX(this.skewX),this._matrix.skewY(this.skewY)),e&&this.parent&&this.parent._update&&this.parent._update(),this}flagReset(){return this._flagMatrix=this._flagScale=!1,super.flagReset.call(this),this}};w(Tl,"Properties",["position","rotation","scale","skewX","skewY","matrix","worldMatrix"]);var On=Tl,Or={position:{enumerable:!0,get:function(){return this._position},set:function(t){this._position&&this._position.unbind(Y.Types.change,this._renderer.flagMatrix),this._position=t,this._position.bind(Y.Types.change,this._renderer.flagMatrix),Rl.call(this)}},rotation:{enumerable:!0,get:function(){return this._rotation},set:function(t){this._rotation=t,this._flagMatrix=!0}},scale:{enumerable:!0,get:function(){return this._scale},set:function(t){this._scale instanceof Z&&this._scale.unbind(Y.Types.change,this._renderer.flagMatrix),this._scale=t,this._scale instanceof Z&&this._scale.bind(Y.Types.change,this._renderer.flagMatrix),this._flagMatrix=!0,this._flagScale=!0}},skewX:{enumerable:!0,get:function(){return this._skewX},set:function(t){this._skewX=t,this._flagMatrix=!0}},skewY:{enumerable:!0,get:function(){return this._skewY},set:function(t){this._skewY=t,this._flagMatrix=!0}},matrix:{enumerable:!0,get:function(){return this._matrix},set:function(t){this._matrix=t,this._flagMatrix=!0}},worldMatrix:{enumerable:!0,get:function(){return Is(this,this._worldMatrix),this._worldMatrix},set:function(t){this._worldMatrix=t}}};function Rl(){this._flagMatrix=!0}var Fi=Math.min,Mi=Math.max,em=Math.ceil,tm=Math.floor,nm=new Z,Us=class Xn extends On{constructor(e,n,r,s){super(),w(this,"_flagVertices",!0),w(this,"_flagLength",!0),w(this,"_flagFill",!0),w(this,"_flagStroke",!0),w(this,"_flagLinewidth",!0),w(this,"_flagOpacity",!0),w(this,"_flagVisible",!0),w(this,"_flagCap",!0),w(this,"_flagJoin",!0),w(this,"_flagMiter",!0),w(this,"_flagStrokeAttenuation",!0),w(this,"_flagMask",!1),w(this,"_flagClip",!1),w(this,"_length",0),w(this,"_fill","#fff"),w(this,"_stroke","#000"),w(this,"_linewidth",1),w(this,"_opacity",1),w(this,"_visible",!0),w(this,"_cap","round"),w(this,"_join","round"),w(this,"_miter",4),w(this,"_closed",!0),w(this,"_curved",!1),w(this,"_automatic",!0),w(this,"_beginning",0),w(this,"_ending",1),w(this,"_mask",null),w(this,"_clip",!1),w(this,"_dashes",null),w(this,"_strokeAttenuation",!0);for(let o in $l)Object.defineProperty(this,o,$l[o]);this._renderer.type="path",this._renderer.flagVertices=El.bind(this),this._renderer.bindVertices=Nl.bind(this),this._renderer.unbindVertices=Pl.bind(this),this._renderer.flagFill=Fl.bind(this),this._renderer.flagStroke=Ml.bind(this),this._renderer.vertices=[],this._renderer.collection=[],this.closed=!!n,this.curved=!!r,this.beginning=0,this.ending=1,this.fill="#fff",this.stroke="#000",this.linewidth=1,this.opacity=1,this.className="",this.visible=!0,this.cap="butt",this.join="miter",this.miter=4,this.vertices=e,this.automatic=!s,this.dashes=[],this.dashes.offset=0}static fromObject(e){const n=typeof e.fill=="string"?e.fill:Jn(e.fill),r=typeof e.stroke=="string"?e.stroke:Jn(e.stroke),s=new Xn().copy(Vs(Os({},e),{fill:n,stroke:r}));return"id"in e&&(s.id=e.id),s}copy(e){if(super.copy.call(this,e),e.vertices){this.vertices=[];for(let n=0;n<e.vertices.length;n++){const r=e.vertices[n];r instanceof ve?this.vertices.push(e.vertices[n].clone()):this.vertices.push(new ve().copy(r))}}for(let n=0;n<Xn.Properties.length;n++){const r=Xn.Properties[n];r in e&&(this[r]=e[r])}return this}clone(e){const n=new Xn;for(let r=0;r<this.vertices.length;r++)n.vertices.push(this.vertices[r].clone());for(let r=0;r<Xn.Properties.length;r++){const s=Xn.Properties[r];n[s]=this[s]}return n.className=this.className,n.translation.copy(this.translation),n.rotation=this.rotation,n.scale=this.scale,n.skewX=this.skewX,n.skewY=this.skewY,this.matrix.manual&&n.matrix.copy(this.matrix),e&&e.add(n),n._update()}toObject(){const e=super.toObject.call(this);return e.renderer.type="path",e.vertices=this.vertices.map(n=>n.toObject()),K.each(Xn.Properties,n=>{typeof this[n]<"u"&&(this[n].toObject?e[n]=this[n].toObject():e[n]=this[n])},this),e}dispose(){if(super.dispose(),this.vertices&&typeof this.vertices.unbind=="function")try{this.vertices.unbind()}catch{}if(this.vertices)for(let e=0;e<this.vertices.length;e++){const n=this.vertices[e];typeof n.unbind=="function"&&n.unbind(),n.controls&&(n.controls.left&&typeof n.controls.left.unbind=="function"&&n.controls.left.unbind(),n.controls.right&&typeof n.controls.right.unbind=="function"&&n.controls.right.unbind())}return typeof this.fill=="object"&&this.fill&&"dispose"in this.fill?this.fill.dispose():typeof this.fill=="object"&&this.fill&&"unbind"in this.fill&&this.fill.unbind(),typeof this.stroke=="object"&&this.stroke&&"dispose"in this.stroke?this.stroke.dispose():typeof this.stroke=="object"&&this.stroke&&"unbind"in this.stroke&&this.stroke.unbind(),this}noFill(){return this.fill="none",this}noStroke(){return this.stroke="none",this.linewidth=0,this}corner(){const e=this.getBoundingClientRect(!0),n=e.width/2,r=e.height/2,s=e.left+e.width/2,o=e.top+e.height/2;for(let a=0;a<this.vertices.length;a++){const l=this.vertices[a];l.x-=s,l.y-=o,l.x+=n,l.y+=r}return this.mask&&(this.mask.translation.x-=s,this.mask.translation.x+=n,this.mask.translation.y-=o,this.mask.translation.y+=r),this}center(){const e=this.getBoundingClientRect(!0),n=e.left+e.width/2-this.translation.x,r=e.top+e.height/2-this.translation.y;for(let s=0;s<this.vertices.length;s++){const o=this.vertices[s];o.x-=n,o.y-=r}return this.mask&&(this.mask.translation.x-=n,this.mask.translation.y-=r),this}getBoundingClientRect(e){let n,r,s,o,a,l,c=1/0,d=-1/0,h=1/0,u=-1/0;if(this._update(!0),n=e?this.matrix:this.worldMatrix,r=(this.linewidth||0)/2,s=this._renderer.vertices.length,this.linewidth>0||this.stroke&&!/(transparent|none)/i.test(this.stroke))if(this.matrix.manual){const{scaleX:m,scaleY:f}=Zn(n.elements[0],n.elements[3],n.elements[1],n.elements[4],n.elements[2],n.elements[5]);typeof m=="number"&&typeof f=="number"&&(r=Math.max(m,f)*(this.linewidth||0)/2)}else r*=typeof this.scale=="number"?this.scale:Math.max(this.scale.x,this.scale.y);if(s<=0)return{width:0,height:0};for(o=0;o<s;o++){l=this._renderer.vertices[o],a=this._renderer.vertices[(o+s-1)%s];const[m,f]=n.multiply(a.x,a.y),[g,p]=n.multiply(l.x,l.y);if(a.controls&&l.controls){let b=a.controls.right.x,y=a.controls.right.y;a.relative&&(b+=a.x,y+=a.y);let[_,S]=n.multiply(b,y),C=l.controls.left.x,v=l.controls.left.y;l.relative&&(C+=l.x,v+=l.y);let[B,k]=n.multiply(C,v);const R=cl(m,f,_,S,B,k,g,p);h=Fi(R.min.y-r,h),c=Fi(R.min.x-r,c),d=Mi(R.max.x+r,d),u=Mi(R.max.y+r,u)}else o<=1&&(h=Fi(f-r,h),c=Fi(m-r,c),d=Mi(m+r,d),u=Mi(f+r,u)),h=Fi(p-r,h),c=Fi(g-r,c),d=Mi(g+r,d),u=Mi(p+r,u)}return{top:h,left:c,right:d,bottom:u,width:d-c,height:u-h}}getPointAt(e,n){let r,s,o,a,l,c,d,h,u,m,f,g,p,b,y,_=this.length*Math.min(Math.max(e,0),1);const S=this.vertices.length,C=S-1;let v=null,B=null;for(let P=0,E=this._lengths.length,X=0;P<E;P++){if(X+this._lengths[P]>=_){this._closed?(r=Ft(P,S),s=Ft(P-1,S),P===0&&(r=s,s=P)):(r=P,s=Math.min(Math.max(P-1,0),C)),v=this.vertices[r],B=this.vertices[s],_-=X,this._lengths[P]!==0?e=_/this._lengths[P]:e=0;break}X+=this._lengths[P]}if(v===null||B===null)return null;if(v){if(!B)return v}else return B;y=B.controls&&B.controls.right,b=v.controls&&v.controls.left,l=B.x,m=B.y,c=(y||B).x,f=(y||B).y,d=(b||v).x,g=(b||v).y,h=v.x,p=v.y,y&&B.relative&&(c+=B.x,f+=B.y),b&&v.relative&&(d+=v.x,g+=v.y),a=nr(e,l,c,d,h),u=nr(e,m,f,g,p);const k=Pt(l,c,e),R=Pt(m,f,e),$=Pt(c,d,e),F=Pt(f,g,e),D=Pt(d,h,e),L=Pt(g,p,e),M=Pt(k,$,e),z=Pt(R,F,e),O=Pt($,D,e),ne=Pt(F,L,e);return K.isObject(n)?(n.x=a,n.y=u,n instanceof ve&&(n.controls.left.x=M,n.controls.left.y=z,n.controls.right.x=O,n.controls.right.y=ne,(typeof n.relative!="boolean"||n.relative)&&(n.controls.left.x-=a,n.controls.left.y-=u,n.controls.right.x-=a,n.controls.right.y-=u)),n.t=e,n):(o=new ve(a,u,M-a,z-u,O-a,ne-u,this._curved?Q.curve:Q.line),o.t=e,o)}plot(){if(this.curved)return hl(this._collection,this.closed),this;for(let e=0;e<this._collection.length;e++)this._collection[e].command=e===0?Q.move:Q.line;return this}subdivide(e){this._update();const n=this.vertices.length-1,r=this._closed||this.vertices[n]._command===Q.close;let s=this.vertices[n],o=[],a;return K.each(this.vertices,function(l,c){if(c<=0&&!r){s=l;return}if(l.command===Q.move){o.push(new ve(s.x,s.y)),c>0&&(o[o.length-1].command=Q.line),s=l;return}a=Cl(l,s,e),o=o.concat(a),K.each(a,function(d,h){h<=0&&s.command===Q.move?d.command=Q.move:d.command=Q.line}),c>=n&&(this._closed&&this._automatic&&(s=l,a=Cl(l,s,e),o=o.concat(a),K.each(a,function(d,h){h<=0&&s.command===Q.move?d.command=Q.move:d.command=Q.line})),o.push(new ve(l.x,l.y)),o[o.length-1].command=r?Q.close:Q.line),s=l},this),this._automatic=!1,this._curved=!1,this.vertices=o,this}_updateLength(e,n){n||this._update();const s=this.vertices.length-1;let o=this.vertices[s],a=0;return typeof this._lengths>"u"&&(this._lengths=[]),K.each(this.vertices,function(l,c){if(c<=0||l.command===Q.move){o=l,this._lengths[c]=0;return}this._lengths[c]=kl(l,o,e),a+=this._lengths[c],o=l},this),this._length=a,this._flagLength=!1,this}_update(){if(this._flagVertices){this._automatic&&this.plot(),this._flagLength&&this._updateLength(void 0,!0);const e=this._collection.length,n=this._closed,r=Math.min(this._beginning,this._ending),s=Math.max(this._beginning,this._ending),o=Ar(this,r*this._length),a=Ar(this,s*this._length),l=em(o),c=tm(a);let d,h,u,m,f,g;for(this._renderer.vertices.length=0,g=0;g<e;g++)this._renderer.collection.length<=g&&this._renderer.collection.push(new ve),g>c&&!h?(f=this._renderer.collection[g].copy(this._collection[g]),this.getPointAt(s,f),f.command=this._renderer.collection[g].command,this._renderer.vertices.push(f),h=f,u=this._collection[g-1],u&&u.controls&&(f.relative?f.controls.right.clear():f.controls.right.copy(f),u.relative?this._renderer.collection[g-1].controls.right.copy(u.controls.right).lerp(Z.zero,1-f.t):this._renderer.collection[g-1].controls.right.copy(u.controls.right).lerp(u,1-f.t))):g>=l&&g<=c&&(f=this._renderer.collection[g].copy(this._collection[g]),this._renderer.vertices.push(f),g===c&&vl(this,s)?(h=f,!n&&h.controls&&(h.relative?h.controls.right.clear():h.controls.right.copy(h))):g===l&&vl(this,r)&&(d=f,d.command=Q.move,!n&&d.controls&&(d.relative?d.controls.left.clear():d.controls.left.copy(d))));l>0&&!d&&(g=l-1,f=this._renderer.collection[g].copy(this._collection[g]),this.getPointAt(r,f),f.command=Q.move,this._renderer.vertices.unshift(f),m=this._collection[g+1],m&&m.controls&&(f.controls.left.clear(),m.relative?this._renderer.collection[g+1].controls.left.copy(m.controls.left).lerp(Z.zero,f.t):(nm.copy(m),this._renderer.collection[g+1].controls.left.copy(m.controls.left).lerp(m,f.t))))}return On.prototype._update.apply(this,arguments),this}flagReset(){return this._flagVertices=this._flagLength=this._flagFill=this._flagStroke=this._flagLinewidth=this._flagOpacity=this._flagVisible=this._flagCap=this._flagJoin=this._flagMiter=this._flagClip=this._flagStrokeAttenuation=!1,On.prototype.flagReset.call(this),this}};w(Us,"Properties",["fill","stroke","linewidth","opacity","visible","cap","join","miter","closed","curved","automatic","beginning","ending","dashes","strokeAttenuation"]),w(Us,"Utils",{getCurveLength:kl});var ke=Us,$l={linewidth:{enumerable:!0,get:function(){return this._linewidth},set:function(t){this._linewidth=t,this._flagLinewidth=!0}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(t){this._opacity=t,this._flagOpacity=!0}},visible:{enumerable:!0,get:function(){return this._visible},set:function(t){this._visible=t,this._flagVisible=!0}},cap:{enumerable:!0,get:function(){return this._cap},set:function(t){this._cap=t,this._flagCap=!0}},join:{enumerable:!0,get:function(){return this._join},set:function(t){this._join=t,this._flagJoin=!0}},miter:{enumerable:!0,get:function(){return this._miter},set:function(t){this._miter=t,this._flagMiter=!0}},fill:{enumerable:!0,get:function(){return this._fill},set:function(t){(this._fill instanceof Je||this._fill instanceof Le||this._fill instanceof De||this._fill instanceof Ne)&&this._fill.unbind(Y.Types.change,this._renderer.flagFill),this._fill=t,this._flagFill=!0,(this._fill instanceof Je||this._fill instanceof Le||this._fill instanceof De||this._fill instanceof Ne)&&this._fill.bind(Y.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(t){(this._stroke instanceof Je||this._stroke instanceof Le||this._stroke instanceof De||this._stroke instanceof Ne)&&this._stroke.unbind(Y.Types.change,this._renderer.flagStroke),this._stroke=t,this._flagStroke=!0,(this._stroke instanceof Je||this._stroke instanceof Le||this._stroke instanceof De||this._stroke instanceof Ne)&&this._stroke.bind(Y.Types.change,this._renderer.flagStroke)}},length:{get:function(){return this._flagLength&&this._updateLength(),this._length}},closed:{enumerable:!0,get:function(){return this._closed},set:function(t){this._closed=!!t,this._flagVertices=!0}},curved:{enumerable:!0,get:function(){return this._curved},set:function(t){this._curved=!!t,this._flagVertices=!0}},automatic:{enumerable:!0,get:function(){return this._automatic},set:function(t){if(t===this._automatic)return;this._automatic=!!t;const e=this._automatic?"ignore":"listen";K.each(this.vertices,function(n){n[e]()})}},beginning:{enumerable:!0,get:function(){return this._beginning},set:function(t){this._beginning=t,this._flagVertices=!0}},ending:{enumerable:!0,get:function(){return this._ending},set:function(t){this._ending=t,this._flagVertices=!0}},vertices:{enumerable:!0,get:function(){return this._collection},set:function(t){const e=this._renderer.bindVertices,n=this._renderer.unbindVertices;this._collection&&this._collection.unbind(Y.Types.insert,e).unbind(Y.Types.remove,n),t instanceof Mn?this._collection=t:this._collection=new Mn(t||[]),this._collection.bind(Y.Types.insert,e).bind(Y.Types.remove,n),e(this._collection)}},mask:{enumerable:!0,get:function(){return this._mask},set:function(t){this._mask=t,this._flagMask=!0,K.isObject(t)&&!t.clip&&(t.clip=!0)}},clip:{enumerable:!0,get:function(){return this._clip},set:function(t){this._clip=t,this._flagClip=!0}},dashes:{enumerable:!0,get:function(){return this._dashes},set:function(t){typeof t.offset!="number"&&(t.offset=this.dashes&&this._dashes.offset||0),this._dashes=t}},strokeAttenuation:{enumerable:!0,get:function(){return this._strokeAttenuation},set:function(t){this._strokeAttenuation=!!t,this._flagStrokeAttenuation=!0,this._flagLinewidth=!0}}};function El(){this._flagVertices=!0,this._flagLength=!0,this.parent&&(this.parent._flagLength=!0)}function Nl(t){let e=t.length;for(;e--;)t[e].bind(Y.Types.change,this._renderer.flagVertices);this._renderer.flagVertices()}function Pl(t){let e=t.length;for(;e--;)t[e].unbind(Y.Types.change,this._renderer.flagVertices);this._renderer.flagVertices()}function Fl(){this._flagFill=!0}function Ml(){this._flagStroke=!0}var Al=class Br extends ke{constructor(e,n,r,s){const o=[new ve,new ve,new ve,new ve];super(o,!0,!1,!0),w(this,"_flagWidth",!1),w(this,"_flagHeight",!1),w(this,"_width",0),w(this,"_height",0),w(this,"_origin",null),this._renderer.type="rectangle";for(let a in Ol)Object.defineProperty(this,a,Ol[a]);this.width=typeof r=="number"?r:1,this.height=typeof s=="number"?s:1,this.origin=new Z,typeof e=="number"&&(this.translation.x=e),typeof n=="number"&&(this.translation.y=n),this._update()}static fromObject(e){const n=new Br().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<Br.Properties.length;n++){const r=Br.Properties[n];r in e&&(typeof e[r]=="number"?this[r]=e[r]:this[r]instanceof Z&&this[r].copy(e[r]))}return this}_update(){if(this._flagVertices||this._flagWidth||this._flagHeight){const e=this._width/2,n=this._height/2;!this._closed&&this.vertices.length===4&&this.vertices.push(new ve),this.vertices[0].set(-e,-n).sub(this._origin).command=Q.move,this.vertices[1].set(e,-n).sub(this._origin).command=Q.line,this.vertices[2].set(e,n).sub(this._origin).command=Q.line,this.vertices[3].set(-e,n).sub(this._origin).command=Q.line,this.vertices[4]&&(this.vertices[4].set(-e,-n).sub(this._origin).command=Q.line)}return super._update.call(this),this}flagReset(){return this._flagWidth=this._flagHeight=!1,super.flagReset.call(this),this}clone(e){const n=new Br(0,0,this.width,this.height);n.translation.copy(this.translation),n.rotation=this.rotation,n.scale=this.scale,n.skewX=this.skewX,n.skewY=this.skewY,this.matrix.manual&&n.matrix.copy(this.matrix);for(let r=0;r<ke.Properties.length;r++){const s=ke.Properties[r];n[s]instanceof Z?n[s].copy(this[s]):n[s]=this[s]}return e&&e.add(n),n}toObject(){const e=super.toObject.call(this);return e.renderer.type="rectangle",e.width=this.width,e.height=this.height,e.origin=this.origin.toObject(),e}};w(Al,"Properties",["width","height","origin"]);var Vn=Al,Ol={width:{enumerable:!0,get:function(){return this._width},set:function(t){this._width=t,this._flagWidth=!0}},height:{enumerable:!0,get:function(){return this._height},set:function(t){this._height=t,this._flagHeight=!0}},origin:{enumerable:!0,get:function(){return this._origin},set:function(t){this._origin&&this._origin.unbind(Y.Types.change,this._renderer.flagVertices),this._origin=t,this._origin.bind(Y.Types.change,this._renderer.flagVertices),this._renderer.flagVertices()}}},Vl=class Tr extends Vn{constructor(e,n,r,s,o,a){super(n,r,0,0),w(this,"_flagTexture",!1),w(this,"_flagColumns",!1),w(this,"_flagRows",!1),w(this,"_flagFrameRate",!1),w(this,"_flagIndex",!1),w(this,"_amount",1),w(this,"_duration",0),w(this,"_startTime",0),w(this,"_playing",!1),w(this,"_firstFrame",0),w(this,"_lastFrame",0),w(this,"_loop",!0),w(this,"_texture",null),w(this,"_columns",1),w(this,"_rows",1),w(this,"_frameRate",0),w(this,"_index",0),w(this,"_origin",null),this._renderer.type="sprite";for(let l in Il)Object.defineProperty(this,l,Il[l]);this.noStroke(),this.noFill(),e instanceof Ne?this.texture=e:typeof e=="string"&&(this.texture=new Ne(e)),this.origin=new Z,this._update(),typeof s=="number"&&(this.columns=s),typeof o=="number"&&(this.rows=o),typeof a=="number"&&(this.frameRate=a),this.index=0}static fromObject(e){const n=new Tr().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<Tr.Properties.length;n++){const r=Tr.Properties[n];r in e&&(this[r]=e[r])}return this}play(e,n,r){return this._playing=!0,this._firstFrame=0,this._lastFrame=this.amount-1,this._startTime=K.performance.now(),typeof e=="number"&&(this._firstFrame=e),typeof n=="number"&&(this._lastFrame=n),typeof r=="function"?this._onLastFrame=r:delete this._onLastFrame,this._index!==this._firstFrame&&(this._startTime-=1e3*Math.abs(this._index-this._firstFrame)/this._frameRate),this}pause(){return this._playing=!1,this}stop(){return this._playing=!1,this._index=0,this}clone(e){const n=new Tr(this.texture,this.translation.x,this.translation.y,this.columns,this.rows,this.frameRate);return this.playing&&n.play(this._firstFrame,this._lastFrame),n.loop=this.loop,n.firstFrame=this.firstFrame,n.lastFrame=this.lastFrame,e&&e.add(n),n}toObject(){const e=super.toObject.call(this);return e.renderer.type="sprite",e.texture=this.texture.toObject(),e.columns=this.columns,e.rows=this.rows,e.frameRate=this.frameRate,e.index=this.index,e.firstFrame=this.firstFrame,e.lastFrame=this.lastFrame,e.loop=this.loop,e}dispose(){return super.dispose(),this._playing&&(this._playing=!1),this._onLastFrame=null,this._startTime=0,this._texture&&typeof this._texture.dispose=="function"?this._texture.dispose():this._texture&&typeof this._texture.unbind=="function"&&this._texture.unbind(),this}_update(){const e=this._texture,n=this._columns,r=this._rows;let s,o,a,l,c,d,h,u,m;if(e&&((this._flagColumns||this._flagRows)&&(this._amount=this._columns*this._rows),this._flagFrameRate&&(this._duration=1e3*this._amount/this._frameRate),this._flagTexture&&(this.fill=e),e.loaded)){h=e.image.width,u=e.image.height,s=h/n,o=u/r,l=this._amount,this.width!==s&&(this.width=s),this.height!==o&&(this.height=o),this._playing&&this._frameRate>0&&(K.isNaN(this._lastFrame)&&(this._lastFrame=l-1),a=K.performance.now()-this._startTime,m=this._lastFrame+1,c=1e3*(m-this._firstFrame)/this._frameRate,this._loop?a=a%c:a=Math.min(a,c),d=Pt(this._firstFrame,m,a/c),d=Math.floor(d),d!==this._index&&(this._index=d,d>=this._lastFrame-1&&this._onLastFrame&&this._onLastFrame()));const f=this._index%n,g=Math.floor(this._index/n),p=-s*f+(h-s)/2,b=-o*g+(u-o)/2;p!==e.offset.x&&(e.offset.x=p),b!==e.offset.y&&(e.offset.y=b)}return super._update.call(this),this}flagReset(){return this._flagTexture=this._flagColumns=this._flagRows=this._flagFrameRate=!1,super.flagReset.call(this),this}};w(Vl,"Properties",["texture","columns","rows","frameRate","index","firstFrame","lastFrame","loop"]);var Vr=Vl,Il={texture:{enumerable:!0,get:function(){return this._texture},set:function(t){this._texture=t,this._flagTexture=!0}},columns:{enumerable:!0,get:function(){return this._columns},set:function(t){this._columns=t,this._flagColumns=!0}},rows:{enumerable:!0,get:function(){return this._rows},set:function(t){this._rows=t,this._flagRows=!0}},frameRate:{enumerable:!0,get:function(){return this._frameRate},set:function(t){this._frameRate=t,this._flagFrameRate=!0}},index:{enumerable:!0,get:function(){return this._index},set:function(t){this._index=t,this._flagIndex=!0}},firstFrame:{enumerable:!0,get:function(){return this._firstFrame},set:function(t){this._firstFrame=t}},lastFrame:{enumerable:!0,get:function(){return this._lastFrame},set:function(t){this._lastFrame=t}},loop:{enumerable:!0,get:function(){return this._loop},set:function(t){this._loop=!!t}}},Gs,zl=class extends Mn{constructor(e){e=Array.isArray(e)?e:Array.prototype.slice.call(arguments),super(e),el(this,Gs,{}),this.attach(e),this.on(Y.Types.insert,this.attach),this.on(Y.Types.remove,this.detach)}get ids(){return Rt(this,Gs)}attach(e){for(let n=0;n<e.length;n++){const r=e[n];r&&r.id&&(this.ids[r.id]=r)}return this}detach(e){for(let n=0;n<e.length;n++)delete this.ids[e[n].id];return this}};Gs=new WeakMap;var Ll=class ki extends ke{constructor(e,n,r,s,o,a,l){const c=l||xt.Resolution*3,d=[];for(let h=0;h<c;h++)d.push(new ve);super(d,!0,!1,!0),w(this,"_flagStartAngle",!1),w(this,"_flagEndAngle",!1),w(this,"_flagInnerRadius",!1),w(this,"_flagOuterRadius",!1),w(this,"_startAngle",0),w(this,"_endAngle",ct),w(this,"_innerRadius",0),w(this,"_outerRadius",0),this._renderer.type="arc-segment";for(let h in Dl)Object.defineProperty(this,h,Dl[h]);typeof r=="number"&&(this.innerRadius=r),typeof s=="number"&&(this.outerRadius=s),typeof o=="number"&&(this.startAngle=o),typeof a=="number"&&(this.endAngle=a),this._update(),typeof e=="number"&&(this.translation.x=e),typeof n=="number"&&(this.translation.y=n)}static fromObject(e){const n=new ki().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<ki.Properties.length;n++){const r=ki.Properties[n];r in e&&typeof e[r]=="number"&&(this[r]=e[r])}return this}_update(){if(this._flagVertices||this._flagStartAngle||this._flagEndAngle||this._flagInnerRadius||this._flagOuterRadius){const e=this._startAngle,n=this._endAngle,r=this._innerRadius,s=this._outerRadius,o=Ft(e,ct)===Ft(n,ct),a=r>0,l=this.vertices;let c=a?l.length/2:l.length,d,h=0,u,m,f,g,p,b,y,_,S;for(o?c--:a||(c-=2),u=0,m=c-1;u<c;u++){switch(f=u/m,g=l[h],p=f*(n-e)+e,b=(n-e)/c,y=s*Math.cos(p),_=s*Math.sin(p),u){case 0:d=Q.move;break;default:d=Q.curve}g.command=d,g.x=y,g.y=_,g.controls.left.clear(),g.controls.right.clear(),g.command===Q.curve&&(S=s*b/Math.PI,g.controls.left.x=S*Math.cos(p-Ze),g.controls.left.y=S*Math.sin(p-Ze),g.controls.right.x=S*Math.cos(p+Ze),g.controls.right.y=S*Math.sin(p+Ze),u===1&&g.controls.left.multiplyScalar(2),u===m&&g.controls.right.multiplyScalar(2)),h++}if(a){for(o?(l[h].command=Q.close,h++):(c--,m=c-1),u=0;u<c;u++)f=u/m,g=l[h],p=(1-f)*(n-e)+e,b=(n-e)/c,y=r*Math.cos(p),_=r*Math.sin(p),d=Q.curve,u<=0&&(d=o?Q.move:Q.line),g.command=d,g.x=y,g.y=_,g.controls.left.clear(),g.controls.right.clear(),g.command===Q.curve&&(S=r*b/Math.PI,g.controls.left.x=S*Math.cos(p+Ze),g.controls.left.y=S*Math.sin(p+Ze),g.controls.right.x=S*Math.cos(p-Ze),g.controls.right.y=S*Math.sin(p-Ze),u===1&&g.controls.left.multiplyScalar(2),u===m&&g.controls.right.multiplyScalar(2)),h++;l[h].copy(l[0]),l[h].command=Q.line}else o||(l[h].command=Q.line,l[h].x=0,l[h].y=0,h++,l[h].copy(l[0]),l[h].command=Q.line)}return super._update.call(this),this}flagReset(){return super.flagReset.call(this),this._flagStartAngle=this._flagEndAngle=this._flagInnerRadius=this._flagOuterRadius=!1,this}clone(e){const n=this.innerRadius,r=this.outerRadius,s=this.startAngle,o=this.endAngle,a=this.vertices.length,l=new ki(0,0,n,r,s,o,a);l.translation.copy(this.translation),l.rotation=this.rotation,l.scale=this.scale,l.skewX=this.skewX,l.skewY=this.skewY,this.matrix.manual&&l.matrix.copy(this.matrix);for(let c=0;c<ke.Properties.length;c++){const d=ke.Properties[c];l[d]=this[d]}return e&&e.add(l),l}toObject(){const e=super.toObject.call(this);e.renderer.type="arc-segment";for(let n=0;n<ki.Properties.length;n++){const r=ki.Properties[n];e[r]=this[r]}return e}};w(Ll,"Properties",["startAngle","endAngle","innerRadius","outerRadius"]);var Ks=Ll,Dl={startAngle:{enumerable:!0,get:function(){return this._startAngle},set:function(t){this._startAngle=t,this._flagStartAngle=!0}},endAngle:{enumerable:!0,get:function(){return this._endAngle},set:function(t){this._endAngle=t,this._flagEndAngle=!0}},innerRadius:{enumerable:!0,get:function(){return this._innerRadius},set:function(t){this._innerRadius=t,this._flagInnerRadius=!0}},outerRadius:{enumerable:!0,get:function(){return this._outerRadius},set:function(t){this._outerRadius=t,this._flagOuterRadius=!0}}},Zs=Math.cos,Js=Math.sin,Hl=class Ci extends ke{constructor(e,n,r,s){const o=s?Math.max(s,2):4,a=[];for(let l=0;l<o;l++)a.push(new ve(0,0,0,0,0,0));super(a,!0,!0,!0),w(this,"_flagRadius",!1),w(this,"_radius",0),this._renderer.type="circle";for(let l in Wl)Object.defineProperty(this,l,Wl[l]);typeof r=="number"&&(this.radius=r),this._update(),typeof e=="number"&&(this.translation.x=e),typeof n=="number"&&(this.translation.y=n)}static fromObject(e){const n=new Ci().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<Ci.Properties.length;n++){const r=Ci.Properties[n];r in e&&typeof e[r]=="number"&&(this[r]=e[r])}return this}_update(){if(this._flagVertices||this._flagRadius){let e=this.vertices.length;!this._closed&&e>2&&(e-=1);const n=4/3*Math.tan(Math.PI/(e*2)),r=this._radius,s=r*n;for(let o=0;o<this.vertices.length;o++){const l=o/e*ct,c=r*Zs(l),d=r*Js(l),h=s*Zs(l-Ze),u=s*Js(l-Ze),m=s*Zs(l+Ze),f=s*Js(l+Ze),g=this.vertices[o];g.command=o===0?Q.move:Q.curve,g.set(c,d),g.controls.left.set(h,u),g.controls.right.set(m,f)}}return super._update.call(this),this}flagReset(){return this._flagRadius=!1,super.flagReset.call(this),this}clone(e){const n=new Ci(0,0,this.radius,this.vertices.length);n.translation.copy(this.translation),n.rotation=this.rotation,n.scale=this.scale,n.skewX=this.skewX,n.skewY=this.skewY,this.matrix.manual&&n.matrix.copy(this.matrix);for(let r=0;r<ke.Properties.length;r++){const s=ke.Properties[r];n[s]=this[s]}return e&&e.add(n),n}toObject(){const e=super.toObject.call(this);e.renderer.type="circle";for(let n=0;n<Ci.Properties.length;n++){const r=Ci.Properties[n];e[r]=this[r]}return e}};w(Hl,"Properties",["radius"]);var Ir=Hl,Wl={radius:{enumerable:!0,get:function(){return this._radius},set:function(t){this._radius=t,this._flagRadius=!0}}},Qs=Math.cos,eo=Math.sin,jl=class Si extends ke{constructor(e,n,r,s,o){typeof s!="number"&&typeof r=="number"&&(s=r);const a=o?Math.max(o,2):4,l=[];for(let c=0;c<a;c++)l.push(new ve);super(l,!0,!0,!0),w(this,"_flagWidth",!1),w(this,"_flagHeight",!1),w(this,"_width",0),w(this,"_height",0),this._renderer.type="ellipse";for(let c in ql)Object.defineProperty(this,c,ql[c]);typeof r=="number"&&(this.width=r*2),typeof s=="number"&&(this.height=s*2),this._update(),typeof e=="number"&&(this.translation.x=e),typeof n=="number"&&(this.translation.y=n)}static fromObject(e){const n=new Si().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<Si.Properties.length;n++){const r=Si.Properties[n];r in e&&typeof e[r]=="number"&&(this[r]=e[r])}return this}_update(){if(this._flagVertices||this._flagWidth||this._flagHeight){let e=this.vertices.length;!this._closed&&e>2&&(e-=1);const n=4/3*Math.tan(Math.PI/(this.vertices.length*2)),r=this._width/2,s=this._height/2;for(let o=0;o<this.vertices.length;o++){const l=o/e*ct,c=r*Qs(l),d=s*eo(l),h=r*n*Qs(l-Ze),u=s*n*eo(l-Ze),m=r*n*Qs(l+Ze),f=s*n*eo(l+Ze),g=this.vertices[o];g.command=o===0?Q.move:Q.curve,g.set(c,d),g.controls.left.set(h,u),g.controls.right.set(m,f)}}return super._update.call(this),this}flagReset(){return this._flagWidth=this._flagHeight=!1,super.flagReset.call(this),this}clone(e){const n=this.width/2,r=this.height/2,s=this.vertices.length,o=new Si(0,0,n,r,s);o.translation.copy(this.translation),o.rotation=this.rotation,o.scale=this.scale,o.skewX=this.skewX,o.skewY=this.skewY,this.matrix.manual&&o.matrix.copy(this.matrix);for(let a=0;a<ke.Properties.length;a++){const l=ke.Properties[a];o[l]=this[l]}return e&&e.add(o),o}toObject(){const e=super.toObject.call(this);e.renderer.type="ellipse";for(let n=0;n<Si.Properties.length;n++){const r=Si.Properties[n];e[r]=this[r]}return e}};w(jl,"Properties",["width","height"]);var zr=jl,ql={width:{enumerable:!0,get:function(){return this._width},set:function(t){this._width=t,this._flagWidth=!0}},height:{enumerable:!0,get:function(){return this._height},set:function(t){this._height=t,this._flagHeight=!0}}},im=Math.ceil,rm=Math.floor,Xl=class Yn extends On{constructor(e){super(),w(this,"_flagVertices",!0),w(this,"_flagLength",!0),w(this,"_flagFill",!0),w(this,"_flagStroke",!0),w(this,"_flagLinewidth",!0),w(this,"_flagOpacity",!0),w(this,"_flagVisible",!0),w(this,"_flagSize",!0),w(this,"_flagSizeAttenuation",!0),w(this,"_flagStrokeAttenuation",!0),w(this,"_length",0),w(this,"_fill","#fff"),w(this,"_stroke","#000"),w(this,"_linewidth",1),w(this,"_opacity",1),w(this,"_visible",!0),w(this,"_size",1),w(this,"_sizeAttenuation",!1),w(this,"_beginning",0),w(this,"_ending",1),w(this,"_dashes",null),w(this,"_strokeAttenuation",!0),w(this,"noFill",ke.prototype.noFill),w(this,"noStroke",ke.prototype.noStroke),w(this,"corner",ke.prototype.corner),w(this,"center",ke.prototype.center),w(this,"getBoundingClientRect",ke.prototype.getBoundingClientRect),w(this,"_updateLength",ke.prototype._updateLength);for(let n in Yl)Object.defineProperty(this,n,Yl[n]);this._renderer.type="points",this._renderer.flagVertices=El.bind(this),this._renderer.bindVertices=Nl.bind(this),this._renderer.unbindVertices=Pl.bind(this),this._renderer.flagFill=Fl.bind(this),this._renderer.flagStroke=Ml.bind(this),this._renderer.vertices=null,this._renderer.collection=null,this.size=1,this.sizeAttenuation=!1,this.beginning=0,this.ending=1,this.fill="#fff",this.stroke="#000",this.linewidth=1,this.opacity=1,this.className="",this.visible=!0,this.vertices=e,this.dashes=[],this.dashes.offset=0}static fromObject(e){const n=typeof e.fill=="string"?e.fill:Jn(e.fill),r=typeof e.stroke=="string"?e.stroke:Jn(e.stroke),s=new Yn().copy(Vs(Os({},e),{fill:n,stroke:r}));return"id"in e&&(s.id=e.id),s}copy(e){super.copy.call(this,e);for(let n=0;n<e.vertices.length;n++){const r=e.vertices[n];r instanceof ve?this.vertices.push(e.vertices[n].clone()):this.vertices.push(new ve().copy(r))}for(let n=0;n<Yn.Properties.length;n++){const r=Yn.Properties[n];r in e&&(this[r]=e[r])}return this}clone(e){const n=new Yn;for(let r=0;r<this.vertices.length;r++)n.vertices.push(this.vertices[r].clone());for(let r=0;r<Yn.Properties.length;r++){const s=Yn.Properties[r];n[s]=this[s]}return n.className=this.className,n.translation.copy(this.translation),n.rotation=this.rotation,n.scale=this.scale,n.skewX=this.skewX,n.skewY=this.skewY,this.matrix.manual&&n.matrix.copy(this.matrix),e&&e.add(n),n._update()}toObject(){const e=super.toObject.call(this);return e.renderer.type="points",e.vertices=this.vertices.map(n=>n.toObject()),K.each(Yn.Properties,function(n){typeof this[n]<"u"&&(this[n].toObject?e[n]=this[n].toObject():e[n]=this[n])},this),e}dispose(){if(super.dispose(),this.vertices&&typeof this.vertices.unbind=="function")try{this.vertices.unbind()}catch{}if(this.vertices)for(let e=0;e<this.vertices.length;e++){const n=this.vertices[e];typeof n.unbind=="function"&&n.unbind()}return typeof this.fill=="object"&&this.fill&&"dispose"in this.fill?this.fill.dispose():typeof this.fill=="object"&&this.fill&&"unbind"in this.fill&&this.fill.unbind(),typeof this.stroke=="object"&&this.stroke&&"dispose"in this.stroke?this.stroke.dispose():typeof this.stroke=="object"&&this.stroke&&"unbind"in this.stroke&&this.stroke.unbind(),this}subdivide(e){this._update();let n=[];for(let r=0;r<this.vertices.length;r++){const s=this.vertices[r],o=this.vertices[r-1];if(!o)continue;const a=s.x,l=s.y,c=o.x,d=o.y,h=Ls(a,l,a,l,c,d,c,d,e);n=n.concat(h)}return this.vertices=n,this}_update(){if(this._flagVertices){this._flagLength&&this._updateLength(void 0,!0);const e=Math.min(this._beginning,this._ending),n=Math.max(this._beginning,this._ending),r=Ar(this,e*this._length),s=Ar(this,n*this._length),o=im(r),a=rm(s);let l=0,c;this._renderer.vertices=[],this._renderer.collection=[];for(let d=0;d<this._collection.length;d++)d>=o&&d<=a&&(c=this._collection[d],this._renderer.collection.push(c),this._renderer.vertices[l*2+0]=c.x,this._renderer.vertices[l*2+1]=c.y,l++)}return super._update.apply(this,arguments),this}flagReset(){return this._flagVertices=this._flagLength=this._flagFill=this._flagStroke=this._flagLinewidth=this._flagOpacity=this._flagVisible=this._flagSize=this._flagSizeAttenuation=!1,super.flagReset.call(this),this}};w(Xl,"Properties",["fill","stroke","linewidth","opacity","visible","size","sizeAttenuation","beginning","ending","dashes","strokeAttenuation"]);var to=Xl,Yl={linewidth:{enumerable:!0,get:function(){return this._linewidth},set:function(t){this._linewidth=t,this._flagLinewidth=!0}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(t){this._opacity=t,this._flagOpacity=!0}},visible:{enumerable:!0,get:function(){return this._visible},set:function(t){this._visible=t,this._flagVisible=!0}},size:{enumerable:!0,get:function(){return this._size},set:function(t){this._size=t,this._flagSize=!0}},sizeAttenuation:{enumerable:!0,get:function(){return this._sizeAttenuation},set:function(t){this._sizeAttenuation=t,this._flagSizeAttenuation=!0}},fill:{enumerable:!0,get:function(){return this._fill},set:function(t){(this._fill instanceof Je||this._fill instanceof Le||this._fill instanceof De||this._fill instanceof Ne)&&this._fill.unbind(Y.Types.change,this._renderer.flagFill),this._fill=t,this._flagFill=!0,(this._fill instanceof Je||this._fill instanceof Le||this._fill instanceof De||this._fill instanceof Ne)&&this._fill.bind(Y.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(t){(this._stroke instanceof Je||this._stroke instanceof Le||this._stroke instanceof De||this._stroke instanceof Ne)&&this._stroke.unbind(Y.Types.change,this._renderer.flagStroke),this._stroke=t,this._flagStroke=!0,(this._stroke instanceof Je||this._stroke instanceof Le||this._stroke instanceof De||this._stroke instanceof Ne)&&this._stroke.bind(Y.Types.change,this._renderer.flagStroke)}},length:{get:function(){return this._flagLength&&this._updateLength(),this._length}},beginning:{enumerable:!0,get:function(){return this._beginning},set:function(t){this._beginning=t,this._flagVertices=!0}},ending:{enumerable:!0,get:function(){return this._ending},set:function(t){this._ending=t,this._flagVertices=!0}},vertices:{enumerable:!0,get:function(){return this._collection},set:function(t){const e=this._renderer.bindVertices,n=this._renderer.unbindVertices;this._collection&&this._collection.unbind(Y.Types.insert,e).unbind(Y.Types.remove,n),t instanceof Mn?this._collection=t:this._collection=new Mn(t||[]),this._collection.bind(Y.Types.insert,e).bind(Y.Types.remove,n),e(this._collection)}},dashes:{enumerable:!0,get:function(){return this._dashes},set:function(t){typeof t.offset!="number"&&(t.offset=this.dashes&&this._dashes.offset||0),this._dashes=t}},strokeAttenuation:{enumerable:!0,get:function(){return this._strokeAttenuation},set:function(t){this._strokeAttenuation=!!t,this._flagStrokeAttenuation=!0,this._flagLinewidth=!0}}},sm=Math.cos,om=Math.sin,Ul=class Bi extends ke{constructor(e,n,r,s){s=Math.max(s||0,3),super(),w(this,"_flagWidth",!1),w(this,"_flagHeight",!1),w(this,"_flagSides",!1),w(this,"_radius",0),w(this,"_width",0),w(this,"_height",0),w(this,"_sides",0),this._renderer.type="polygon";for(let o in Gl)Object.defineProperty(this,o,Gl[o]);this.closed=!0,this.automatic=!1,typeof r=="number"&&(this.radius=r),typeof s=="number"&&(this.sides=s),this._update(),typeof e=="number"&&(this.translation.x=e),typeof n=="number"&&(this.translation.y=n)}static fromObject(e){const n=new Bi().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<Bi.Properties.length;n++){const r=Bi.Properties[n];r in e&&typeof e[r]=="number"&&(this[r]=e[r])}return this}_update(){if(this._flagVertices||this._flagWidth||this._flagHeight||this._flagSides){const e=this._sides,n=e+1;let r=this.vertices.length;r>e&&(this.vertices.splice(e-1,r-e),r=e);for(let s=0;s<n;s++){const o=(s+.5)/e,a=ct*o+Math.PI/2,l=this._width*sm(a)/2,c=this._height*om(a)/2;s>=r?this.vertices.push(new ve(l,c)):this.vertices[s].set(l,c),this.vertices[s].command=s===0?Q.move:Q.line}}return super._update.call(this),this}flagReset(){return this._flagWidth=this._flagHeight=this._flagSides=!1,super.flagReset.call(this),this}clone(e){const n=new Bi(0,0,0,this.sides);n.translation.copy(this.translation),n.rotation=this.rotation,n.scale=this.scale,n.skewX=this.skewX,n.skewY=this.skewY,n.width=this.width,n.height=this.height,this.matrix.manual&&n.matrix.copy(this.matrix);for(let r=0;r<ke.Properties.length;r++){const s=ke.Properties[r];n[s]=this[s]}return e&&e.add(n),n}toObject(){const e=super.toObject.call(this);e.renderer.type="polygon";for(let n=0;n<Bi.Properties.length;n++){const r=Bi.Properties[n];e[r]=this[r]}return e}};w(Ul,"Properties",["width","height","sides"]);var no=Ul,Gl={radius:{enumerable:!0,get:function(){return this._radius},set:function(t){this._radius=t,this.width=t*2,this.height=t*2}},width:{enumerable:!0,get:function(){return this._width},set:function(t){this._width=t,this._flagWidth=!0,this._radius=Math.max(this.width,this.height)/2}},height:{enumerable:!0,get:function(){return this._height},set:function(t){this._height=t,this._flagHeight=!0,this._radius=Math.max(this.width,this.height)/2}},sides:{enumerable:!0,get:function(){return this._sides},set:function(t){this._sides=t,this._flagSides=!0}}},Kl=class Ti extends ke{constructor(e,n,r,s,o){typeof o>"u"&&typeof r=="number"&&typeof s=="number"&&(o=Math.floor(Math.min(r,s)/12));const a=[];for(let l=0;l<10;l++)a.push(new ve(0,0,0,0,0,0,l===0?Q.move:Q.curve));super(a),w(this,"_flagWidth",!1),w(this,"_flagHeight",!1),w(this,"_flagRadius",!1),w(this,"_width",0),w(this,"_height",0),w(this,"_radius",12),this._renderer.type="rounded-rectangle";for(let l in Zl)Object.defineProperty(this,l,Zl[l]);this.closed=!0,this.automatic=!1,this._renderer.flagRadius=am.bind(this),typeof r=="number"&&(this.width=r),typeof s=="number"&&(this.height=s),(typeof o=="number"||o instanceof Z)&&(this.radius=o),this._update(),typeof e=="number"&&(this.translation.x=e),typeof n=="number"&&(this.translation.y=n)}static fromObject(e){const n=new Ti().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<Ti.Properties.length;n++){const r=Ti.Properties[n];if(r in e){const s=e[r];/radius/i.test(r)?this[r]=typeof s=="number"||s instanceof Z?s:new Z().copy(s):typeof s=="number"&&(this[r]=s)}}return this}_update(){if(this._flagVertices||this._flagWidth||this._flagHeight||this._flagRadius){const e=this._width,n=this._height;let r,s;this._radius instanceof Z?(r=this._radius.x,s=this._radius.y):(r=this._radius,s=this._radius);let o,a=e/2,l=n/2;o=this.vertices[0],o.x=-(a-r),o.y=-l,o=this.vertices[1],o.x=a-r,o.y=-l,o.controls.left.clear(),o.controls.right.x=r,o.controls.right.y=0,o=this.vertices[2],o.x=a,o.y=-(l-s),o.controls.right.clear(),o.controls.left.clear(),o=this.vertices[3],o.x=a,o.y=l-s,o.controls.left.clear(),o.controls.right.x=0,o.controls.right.y=s,o=this.vertices[4],o.x=a-r,o.y=l,o.controls.right.clear(),o.controls.left.clear(),o=this.vertices[5],o.x=-(a-r),o.y=l,o.controls.left.clear(),o.controls.right.x=-r,o.controls.right.y=0,o=this.vertices[6],o.x=-a,o.y=l-s,o.controls.left.clear(),o.controls.right.clear(),o=this.vertices[7],o.x=-a,o.y=-(l-s),o.controls.left.clear(),o.controls.right.x=0,o.controls.right.y=-s,o=this.vertices[8],o.x=-(a-r),o.y=-l,o.controls.left.clear(),o.controls.right.clear(),o=this.vertices[9],o.copy(this.vertices[8])}return super._update.call(this),this}flagReset(){return this._flagWidth=this._flagHeight=this._flagRadius=!1,super.flagReset.call(this),this}clone(e){const n=this.width,r=this.height,s=this.radius,o=new Ti(0,0,n,r,s);o.translation.copy(this.translation),o.rotation=this.rotation,o.scale=this.scale,o.skewX=this.skewX,o.skewY=this.skewY,this.matrix.manual&&o.matrix.copy(this.matrix);for(let a=0;a<ke.Properties.length;a++){const l=ke.Properties[a];o[l]=this[l]}return e&&e.add(o),o}toObject(){const e=super.toObject.call(this);e.renderer.type="rounded-rectangle";for(let n=0;n<Ti.Properties.length;n++){const r=Ti.Properties[n];e[r]=this[r]}return e.radius=typeof this.radius=="number"?this.radius:this.radius.toObject(),e}};w(Kl,"Properties",["width","height","radius"]);var Lr=Kl,Zl={width:{enumerable:!0,get:function(){return this._width},set:function(t){this._width=t,this._flagWidth=!0}},height:{enumerable:!0,get:function(){return this._height},set:function(t){this._height=t,this._flagHeight=!0}},radius:{enumerable:!0,get:function(){return this._radius},set:function(t){this._radius instanceof Z&&this._radius.unbind(Y.Types.change,this._renderer.flagRadius),this._radius=t,this._radius instanceof Z&&this._radius.bind(Y.Types.change,this._renderer.flagRadius),this._flagRadius=!0}}};function am(){this._flagRadius=!0}var lm=Math.cos,cm=Math.sin,Jl=class Ri extends ke{constructor(e,n,r,s,o){arguments.length<=3&&(s=r,r=s/2),(typeof o!="number"||o<=0)&&(o=5),super(),w(this,"_flagInnerRadius",!1),w(this,"_flagOuterRadius",!1),w(this,"_flagSides",!1),w(this,"_innerRadius",0),w(this,"_outerRadius",0),w(this,"_sides",0),this._renderer.type="star";for(let a in Ql)Object.defineProperty(this,a,Ql[a]);this.closed=!0,this.automatic=!1,typeof r=="number"&&(this.innerRadius=r),typeof s=="number"&&(this.outerRadius=s),typeof o=="number"&&(this.sides=o),this._update(),typeof e=="number"&&(this.translation.x=e),typeof n=="number"&&(this.translation.y=n)}static fromObject(e){const n=new Ri().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<Ri.Properties.length;n++){const r=Ri.Properties[n];r in e&&typeof e[r]=="number"&&(this[r]=e[r])}return this}_update(){if(this._flagVertices||this._flagInnerRadius||this._flagOuterRadius||this._flagSides){const e=this._sides*2,n=e+1;let r=this.vertices.length;r>e&&(this.vertices.splice(e-1,r-e),r=e);for(let s=0;s<n;s++){const o=(s+.5)/e,a=ct*o,l=(s%2?this._outerRadius:this._innerRadius)/2,c=l*lm(a),d=l*cm(a);s>=r?this.vertices.push(new ve(c,d)):this.vertices[s].set(c,d),this.vertices[s].command=s===0?Q.move:Q.line}}return super._update.call(this),this}flagReset(){return this._flagInnerRadius=this._flagOuterRadius=this._flagSides=!1,super.flagReset.call(this),this}clone(e){const n=this.innerRadius,r=this.outerRadius,s=this.sides,o=new Ri(0,0,n,r,s);o.translation.copy(this.translation),o.rotation=this.rotation,o.scale=this.scale,o.skewX=this.skewX,o.skewY=this.skewY,this.matrix.manual&&o.matrix.copy(this.matrix);for(let a=0;a<ke.Properties.length;a++){const l=ke.Properties[a];o[l]=this[l]}return e&&e.add(o),o}toObject(){const e=super.toObject.call(this);e.renderer.type="star";for(let n=0;n<Ri.Properties.length;n++){const r=Ri.Properties[n];e[r]=this[r]}return e}};w(Jl,"Properties",["innerRadius","outerRadius","sides"]);var io=Jl,Ql={innerRadius:{enumerable:!0,get:function(){return this._innerRadius},set:function(t){this._innerRadius=t,this._flagInnerRadius=!0}},outerRadius:{enumerable:!0,get:function(){return this._outerRadius},set:function(t){this._outerRadius=t,this._flagOuterRadius=!0}},sides:{enumerable:!0,get:function(){return this._sides},set:function(t){this._sides=t,this._flagSides=!0}}},ro,ec=Math.min,tc=Math.max;ze.document&&(ro=document.createElement("canvas"));var so=class zt extends On{constructor(e,n,r,s){super(),w(this,"_flagValue",!0),w(this,"_flagFamily",!0),w(this,"_flagSize",!0),w(this,"_flagLeading",!0),w(this,"_flagAlignment",!0),w(this,"_flagBaseline",!0),w(this,"_flagStyle",!0),w(this,"_flagWeight",!0),w(this,"_flagDecoration",!0),w(this,"_flagFill",!0),w(this,"_flagStroke",!0),w(this,"_flagLinewidth",!0),w(this,"_flagOpacity",!0),w(this,"_flagVisible",!0),w(this,"_flagMask",!1),w(this,"_flagClip",!1),w(this,"_flagDirection",!0),w(this,"_flagStrokeAttenuation",!0),w(this,"_value",""),w(this,"_family","sans-serif"),w(this,"_size",13),w(this,"_leading",17),w(this,"_alignment","center"),w(this,"_baseline","middle"),w(this,"_style","normal"),w(this,"_weight",500),w(this,"_decoration","none"),w(this,"_direction","ltr"),w(this,"_fill","#000"),w(this,"_stroke","none"),w(this,"_linewidth",1),w(this,"_opacity",1),w(this,"_visible",!0),w(this,"_mask",null),w(this,"_clip",!1),w(this,"_dashes",null),w(this,"_strokeAttenuation",!0);for(let o in nc)Object.defineProperty(this,o,nc[o]);if(this._renderer.type="text",this._renderer.flagFill=dm.bind(this),this._renderer.flagStroke=hm.bind(this),this.value=e,typeof n=="number"&&(this.translation.x=n),typeof r=="number"&&(this.translation.y=r),this.dashes=[],this.dashes.offset=0,!K.isObject(s))return this;for(let o=0;o<zt.Properties.length;o++){const a=zt.Properties[o];a in s&&(this[a]=s[a])}}static Measure(e){if(ro){const n=ro.getContext("2d");n.font=[e._style,e._weight,`${e._size}px/${e._leading}px`,e._family].join(" ");const r=n.measureText(e.value,0,0),s=r.actualBoundingBoxDescent+r.actualBoundingBoxAscent;return{width:r.width,height:s}}else{const n=this.value.length*this.size*zt.Ratio,r=this.leading;return console.warn("Two.Text: unable to accurately measure text, so using an approximation."),{width:n,height:r}}}static fromObject(e){const n=typeof e.fill=="string"?e.fill:Jn(e.fill),r=typeof e.stroke=="string"?e.stroke:Jn(e.stroke),s=new zt().copy(Vs(Os({},e),{fill:n,stroke:r}));return"id"in e&&(s.id=e.id),s}copy(e){super.copy.call(this,e);for(let n=0;n<zt.Properties.length;n++){const r=zt.Properties[n];r in e&&(this[r]=e[r])}return this}clone(e){const n=new zt(this.value);n.translation.copy(this.translation),n.rotation=this.rotation,n.scale=this.scale;for(let r=0;r<zt.Properties.length;r++){const s=zt.Properties[r];n[s]=this[s]}return this.matrix.manual&&n.matrix.copy(this.matrix),e&&e.add(n),n._update()}toObject(){const e=super.toObject.call(this);e.renderer.type="text";for(let n=0;n<zt.Properties.length;n++){const r=zt.Properties[n];e[r]=this[r]}return e}dispose(){return super.dispose(),typeof this.fill=="object"&&this.fill&&"dispose"in this.fill?this.fill.dispose():typeof this.fill=="object"&&this.fill&&"unbind"in this.fill&&this.fill.unbind(),typeof this.stroke=="object"&&this.stroke&&"dispose"in this.stroke?this.stroke.dispose():typeof this.stroke=="object"&&this.stroke&&"unbind"in this.stroke&&this.stroke.unbind(),this}noFill(){return this.fill="none",this}noStroke(){return this.stroke="none",this.linewidth=0,this}getBoundingClientRect(e){let n,r,s,o,a;this._update(!0),n=e?this.matrix:this.worldMatrix;const{width:l,height:c}=zt.Measure(this),d=(this._linewidth||0)/2;switch(this.alignment){case"left":r=-d,s=l+d;break;case"right":r=-(l+d),s=d;break;default:r=-(l/2+d),s=l/2+d}switch(this.baseline){case"middle":o=-(c/2+d),a=c/2+d;break;default:o=-(c+d),a=d}const[h,u]=n.multiply(r,o),[m,f]=n.multiply(r,a),[g,p]=n.multiply(s,o),[b,y]=n.multiply(s,a);return o=ec(u,f,p,y),r=ec(h,m,g,b),s=tc(h,m,g,b),a=tc(u,f,p,y),{top:o,left:r,right:s,bottom:a,width:s-r,height:a-o}}flagReset(){return super.flagReset.call(this),this._flagValue=this._flagFamily=this._flagSize=this._flagLeading=this._flagAlignment=this._flagFill=this._flagStroke=this._flagLinewidth=this._flagOpacity=this._flagVisible=this._flagClip=this._flagDecoration=this._flagClassName=this._flagBaseline=this._flagWeight=this._flagStyle=this._flagDirection=!1,this}};w(so,"Ratio",.6),w(so,"Properties",["value","family","size","leading","alignment","linewidth","style","weight","decoration","direction","baseline","opacity","visible","fill","stroke","dashes","strokeAttenuation"]);var sn=so,nc={value:{enumerable:!0,get:function(){return this._value},set:function(t){this._value=t,this._flagValue=!0}},family:{enumerable:!0,get:function(){return this._family},set:function(t){this._family=t,this._flagFamily=!0}},size:{enumerable:!0,get:function(){return this._size},set:function(t){this._size=t,this._flagSize=!0}},leading:{enumerable:!0,get:function(){return this._leading},set:function(t){this._leading=t,this._flagLeading=!0}},alignment:{enumerable:!0,get:function(){return this._alignment},set:function(t){this._alignment=t,this._flagAlignment=!0}},linewidth:{enumerable:!0,get:function(){return this._linewidth},set:function(t){this._linewidth=t,this._flagLinewidth=!0}},style:{enumerable:!0,get:function(){return this._style},set:function(t){this._style=t,this._flagStyle=!0}},weight:{enumerable:!0,get:function(){return this._weight},set:function(t){this._weight=t,this._flagWeight=!0}},decoration:{enumerable:!0,get:function(){return this._decoration},set:function(t){this._decoration=t,this._flagDecoration=!0}},direction:{enumerable:!0,get:function(){return this._direction},set:function(t){this._direction=t,this._flagDirection=!0}},baseline:{enumerable:!0,get:function(){return this._baseline},set:function(t){this._baseline=t,this._flagBaseline=!0}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(t){this._opacity=t,this._flagOpacity=!0}},visible:{enumerable:!0,get:function(){return this._visible},set:function(t){this._visible=t,this._flagVisible=!0}},fill:{enumerable:!0,get:function(){return this._fill},set:function(t){(this._fill instanceof Je||this._fill instanceof Le||this._fill instanceof De||this._fill instanceof Ne)&&this._fill.unbind(Y.Types.change,this._renderer.flagFill),this._fill=t,this._flagFill=!0,(this._fill instanceof Je||this._fill instanceof Le||this._fill instanceof De||this._fill instanceof Ne)&&this._fill.bind(Y.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(t){(this._stroke instanceof Je||this._stroke instanceof Le||this._stroke instanceof De||this._stroke instanceof Ne)&&this._stroke.unbind(Y.Types.change,this._renderer.flagStroke),this._stroke=t,this._flagStroke=!0,(this._stroke instanceof Je||this._stroke instanceof Le||this._stroke instanceof De||this._stroke instanceof Ne)&&this._stroke.bind(Y.Types.change,this._renderer.flagStroke)}},mask:{enumerable:!0,get:function(){return this._mask},set:function(t){this._mask=t,this._flagMask=!0,K.isObject(t)&&!t.clip&&(t.clip=!0)}},clip:{enumerable:!0,get:function(){return this._clip},set:function(t){this._clip=t,this._flagClip=!0}},dashes:{enumerable:!0,get:function(){return this._dashes},set:function(t){typeof t.offset!="number"&&(t.offset=this.dashes&&this._dashes.offset||0),this._dashes=t}},strokeAttenuation:{enumerable:!0,get:function(){return this._strokeAttenuation},set:function(t){this._strokeAttenuation=!!t,this._flagStrokeAttenuation=!0,this._flagLinewidth=!0}}};function dm(){this._flagFill=!0}function hm(){this._flagStroke=!0}var oo=class Zi extends Vn{constructor(e,n,r,s){super(n,r,0,0),w(this,"_flagTextures",!1),w(this,"_flagFrameRate",!1),w(this,"_flagIndex",!1),w(this,"_amount",1),w(this,"_duration",0),w(this,"_index",0),w(this,"_startTime",0),w(this,"_playing",!1),w(this,"_firstFrame",0),w(this,"_lastFrame",0),w(this,"_loop",!0),w(this,"_textures",null),w(this,"_frameRate",0),w(this,"_origin",null),this._renderer.type="image-sequence";for(let o in ic)Object.defineProperty(this,o,ic[o]);this._renderer.flagTextures=um.bind(this),this._renderer.bindTextures=fm.bind(this),this._renderer.unbindTextures=gm.bind(this),this.noStroke(),this.noFill(),Array.isArray(e)?this.textures=e.map(rc.bind(this)):typeof e=="string"&&(this.textures=[rc(e)]),this.origin=new Z,this._update(),typeof s=="number"?this.frameRate=s:this.frameRate=Zi.DefaultFrameRate,this.index=0}static fromObject(e){const n=new Zi().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<Zi.Properties.length;n++){const r=Zi.Properties[n];r in e&&(this[r]=e[r])}return this}play(e,n,r){return this._playing=!0,this._firstFrame=0,this._lastFrame=this.amount-1,this._startTime=K.performance.now(),typeof e=="number"&&(this._firstFrame=e),typeof n=="number"&&(this._lastFrame=n),typeof r=="function"?this._onLastFrame=r:delete this._onLastFrame,this._index!==this._firstFrame&&(this._startTime-=1e3*Math.abs(this._index-this._firstFrame)/this._frameRate),this}pause(){return this._playing=!1,this}stop(){return this._playing=!1,this._index=this._firstFrame,this}clone(e){const n=new Zi(this.textures,this.translation.x,this.translation.y,this.frameRate);return n._loop=this._loop,this._playing&&n.play(),e&&e.add(n),n}toObject(){const e=super.toObject.call(this);return e.renderer.type="image-sequence",e.textures=this.textures.map(function(n){return n.toObject()}),e.frameRate=this.frameRate,e.index=this.index,e.firstFrame=this.firstFrame,e.lastFrame=this.lastFrame,e.loop=this.loop,e}dispose(){if(super.dispose(),this._playing&&(this._playing=!1),this._onLastFrame=null,this.textures&&typeof this.textures.unbind=="function")try{this.textures.unbind()}catch{}if(this.textures)for(let e=0;e<this.textures.length;e++){const n=this.textures[e];typeof n.dispose=="function"?n.dispose():typeof n.unbind=="function"&&n.unbind()}return this}_update(){const e=this._textures;let n,r,s,o,a,l,c,d;return e&&(this._flagTextures&&(this._amount=e.length),this._flagFrameRate&&(this._duration=1e3*this._amount/this._frameRate),this._playing&&this._frameRate>0?(o=this._amount,K.isNaN(this._lastFrame)&&(this._lastFrame=o-1),s=K.performance.now()-this._startTime,d=this._lastFrame+1,a=1e3*(d-this._firstFrame)/this._frameRate,this._loop?s=s%a:s=Math.min(s,a),c=Pt(this._firstFrame,d,s/a),c=Math.floor(c),c!==this._index&&(this._index=c,l=e[this._index],l.loaded&&(n=l.image.width,r=l.image.height,this.width!==n&&(this.width=n),this.height!==r&&(this.height=r),this.fill=l,c>=this._lastFrame-1&&this._onLastFrame&&this._onLastFrame()))):(this._flagIndex||!(this.fill instanceof Ne))&&(l=e[this._index],l.loaded&&(n=l.image.width,r=l.image.height,this.width!==n&&(this.width=n),this.height!==r&&(this.height=r)),this.fill=l)),super._update.call(this),this}flagReset(){return this._flagTextures=this._flagFrameRate=!1,super.flagReset.call(this),this}};w(oo,"Properties",["textures","frameRate","index","firstFrame","lastFrame","loop"]),w(oo,"DefaultFrameRate",30);var ao=oo,ic={frameRate:{enumerable:!0,get:function(){return this._frameRate},set:function(t){this._frameRate=t,this._flagFrameRate=!0}},index:{enumerable:!0,get:function(){return this._index},set:function(t){this._index=t,this._flagIndex=!0}},textures:{enumerable:!0,get:function(){return this._textures},set:function(t){const e=this._renderer.bindTextures,n=this._renderer.unbindTextures;this._textures&&this._textures.unbind(Y.Types.insert,e).unbind(Y.Types.remove,n),this._textures=new Mn((t||[]).slice(0)),this._textures.bind(Y.Types.insert,e).bind(Y.Types.remove,n),e(this._textures)}},firstFrame:{enumerable:!0,get:function(){return this._firstFrame},set:function(t){this._firstFrame=t}},lastFrame:{enumerable:!0,get:function(){return this._lastFrame},set:function(t){this._lastFrame=t}},loop:{enumerable:!0,get:function(){return this._loop},set:function(t){this._loop=!!t}}};function um(){this._flagTextures=!0}function fm(t){let e=t.length;for(;e--;)t[e].bind(Y.Types.change,this._renderer.flagTextures);this._renderer.flagTextures()}function gm(t){let e=t.length;for(;e--;)t[e].unbind(Y.Types.change,this._renderer.flagTextures);this._renderer.flagTextures()}function rc(t){if(t instanceof Ne)return t;if(typeof t=="string")return new Ne(t)}var Dr=Math.min,Hr=Math.max,lo=class Un extends On{constructor(e){super(),w(this,"_flagAdditions",!1),w(this,"_flagSubtractions",!1),w(this,"_flagOrder",!1),w(this,"_flagOpacity",!0),w(this,"_flagBeginning",!1),w(this,"_flagEnding",!1),w(this,"_flagLength",!1),w(this,"_flagMask",!1),w(this,"_fill","#fff"),w(this,"_stroke","#000"),w(this,"_linewidth",1),w(this,"_opacity",1),w(this,"_visible",!0),w(this,"_cap","round"),w(this,"_join","round"),w(this,"_miter",4),w(this,"_closed",!0),w(this,"_curved",!1),w(this,"_automatic",!0),w(this,"_beginning",0),w(this,"_ending",1),w(this,"_length",0),w(this,"_mask",null),w(this,"_strokeAttenuation",!0);for(let n in sc)Object.defineProperty(this,n,sc[n]);this._renderer.type="group",this.additions=[],this.subtractions=[],this.children=Array.isArray(e)?e:Array.prototype.slice.call(arguments)}static InsertChildren(e){for(let n=0;n<e.length;n++)oc.call(this,e[n],this)}static RemoveChildren(e){for(let n=0;n<e.length;n++)oc.call(this,e[n])}static OrderChildren(e){this._flagOrder=!0}static fromObject(e){const n=new Un;for(let s=0;s<Un.Properties.length;s++){const o=Un.Properties[s];o in e&&(/(fill|stroke)/i.test(o)?n[o]=typeof e[o]=="string"?e[o]:Jn(e[o]):n[o]=e[o])}return"mask"in e&&(n.mask=r(e.mask)),"id"in e&&(n.id=e.id),n.children=e.children.map(r),n;function r(s){if(s&&s.renderer)switch(s.renderer.type){case"arc-segment":return Ks.fromObject(s);case"circle":return Ir.fromObject(s);case"element":return Ni.fromObject(s);case"ellipse":return zr.fromObject(s);case"group":return Un.fromObject(s);case"image":return Image.fromObject(s);case"image-sequence":return ao.fromObject(s);case"path":return ke.fromObject(s);case"points":return to.fromObject(s);case"polygon":return no.fromObject(s);case"rectangle":return Vn.fromObject(s);case"rounded-rectangle":return Lr.fromObject(s);case"shape":return On.fromObject(s);case"sprite":return Vr.fromObject(s);case"star":return io.fromObject(s);case"text":return sn.fromObject(s)}return s}}copy(e){super.copy.call(this,e),console.warn("Two.js: attempting to copy group. Two.Group.children copying not supported.");for(let n=0;n<Un.Properties.length;n++){const r=Un.Properties[n];r in e&&(this[r]=e[r])}return this}clone(e){const n=new Un,r=this.children.map(function(s){return s.clone()});return n.add(r),n.opacity=this.opacity,this.mask&&(n.mask=this.mask),n.translation.copy(this.translation),n.rotation=this.rotation,n.scale=this.scale,n.className=this.className,this.matrix.manual&&n.matrix.copy(this.matrix),e&&e.add(n),n._update()}toObject(){const e=super.toObject.call(this);return e.renderer.type="group",e.children=[],e.opacity=this.opacity,e.className=this.className,e.mask=this.mask?this.mask.toObject():null,K.each(this.children,(n,r)=>{e.children[r]=n.toObject()},this),e}dispose(){if(super.dispose(),this.children)for(let e=0;e<this.children.length;e++){const n=this.children[e];typeof n.dispose=="function"&&n.dispose()}if(this.children&&typeof this.children.unbind=="function")try{this.children.unbind()}catch{}return this}corner(){const e=this.getBoundingClientRect(!0);for(let n=0;n<this.children.length;n++){const r=this.children[n];r.translation.x-=e.left,r.translation.y-=e.top}return this.mask&&(this.mask.translation.x-=e.left,this.mask.translation.y-=e.top),this}center(){const e=this.getBoundingClientRect(!0),n=e.left+e.width/2-this.translation.x,r=e.top+e.height/2-this.translation.y;for(let s=0;s<this.children.length;s++){const o=this.children[s];o.isShape&&(o.translation.x-=n,o.translation.y-=r)}return this.mask&&(this.mask.translation.x-=n,this.mask.translation.y-=r),this}getById(e){let n=null;function r(s){if(s.id===e)return s;if(s.children){if(s.children.ids[e])return s.children.ids[e];for(let o=0;o<s.children.length;o++)if(n=r(s.children[o]),n)return n}return null}return r(this)}getByClassName(e){const n=[];function r(s){if(Array.prototype.indexOf.call(s.classList,e)>=0&&n.push(s),s.children)for(let o=0;o<s.children.length;o++){const a=s.children[o];r(a)}return n}return r(this)}getByType(e){const n=[];function r(s){if(s instanceof e&&n.push(s),s.children)for(let o=0;o<s.children.length;o++){const a=s.children[o];r(a)}return n}return r(this)}add(e){e instanceof Array?e=e.slice():e=Array.prototype.slice.call(arguments);for(let n=0;n<e.length;n++){const r=e[n];if(!(r&&r.id))continue;const s=Array.prototype.indexOf.call(this.children,r);s>=0&&this.children.splice(s,1),this.children.push(r)}return this}remove(e){const n=arguments.length,r=this.parent;if(n<=0&&r)return r.remove(this),this;e instanceof Array?e=e.slice():e=Array.prototype.slice.call(arguments);for(let s=0;s<e.length;s++){const o=e[s];if(!o||!this.children.ids[o.id])continue;const a=this.children.indexOf(o);a>=0&&this.children.splice(a,1)}return this}getBoundingClientRect(e){let n,r,s,o,a,l;this._update(!0);let c=1/0,d=-1/0,h=1/0,u=-1/0;const m=/texture|gradient/i;r=e?this.matrix:this.worldMatrix;for(let f=0;f<this.children.length;f++){const g=this.children[f];if(!(!g.visible||m.test(g._renderer.type))&&(n=g.getBoundingClientRect(e),s=typeof n.top!="number"||K.isNaN(n.top)||!isFinite(n.top),o=typeof n.left!="number"||K.isNaN(n.left)||!isFinite(n.left),a=typeof n.right!="number"||K.isNaN(n.right)||!isFinite(n.right),l=typeof n.bottom!="number"||K.isNaN(n.bottom)||!isFinite(n.bottom),!(s||o||a||l)))if(e){const[p,b]=r.multiply(n.left,n.top),[y,_]=r.multiply(n.right,n.top),[S,C]=r.multiply(n.left,n.bottom),[v,B]=r.multiply(n.right,n.bottom);h=Dr(b,_,C,B,h),c=Dr(p,y,S,v,c),d=Hr(p,y,S,v,d),u=Hr(b,_,C,B,u)}else h=Dr(n.top,h),c=Dr(n.left,c),d=Hr(n.right,d),u=Hr(n.bottom,u)}return{top:h,left:c,right:d,bottom:u,width:d-c,height:u-h}}noFill(){return this.children.forEach(function(e){e.noFill()}),this}noStroke(){return this.children.forEach(function(e){e.noStroke()}),this}subdivide(){const e=arguments;return this.children.forEach(function(n){n.subdivide.apply(n,e)}),this}_update(){let e,n,r;if(this._flagBeginning||this._flagEnding){const s=Math.min(this._beginning,this._ending),o=Math.max(this._beginning,this._ending),a=this.length;let l=0;const c=s*a,d=o*a;for(e=0;e<this.children.length;e++)r=this.children[e],n=r.length,c>l+n?(r.beginning=1,r.ending=1):d<l?(r.beginning=0,r.ending=0):c>l&&c<l+n?(r.beginning=(c-l)/n,r.ending=1):d>l&&d<l+n?(r.beginning=0,r.ending=(d-l)/n):(r.beginning=0,r.ending=1),l+=n}return super._update.apply(this,arguments)}flagReset(){return this._flagAdditions&&(this.additions.length=0,this._flagAdditions=!1),this._flagSubtractions&&(this.subtractions.length=0,this._flagSubtractions=!1),this._flagOrder=this._flagMask=this._flagOpacity=this._flagBeginning=this._flagEnding=!1,super.flagReset.call(this),this}};w(lo,"Children",zl),w(lo,"Properties",["fill","stroke","linewidth","cap","join","miter","closed","curved","automatic"]);var nt=lo,sc={visible:{enumerable:!0,get:function(){return this._visible},set:function(t){this._flagVisible=this._visible!==t||this._flagVisible,this._visible=t}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(t){this._flagOpacity=this._opacity!==t||this._flagOpacity,this._opacity=t}},beginning:{enumerable:!0,get:function(){return this._beginning},set:function(t){this._flagBeginning=this._beginning!==t||this._flagBeginning,this._beginning=t}},ending:{enumerable:!0,get:function(){return this._ending},set:function(t){this._flagEnding=this._ending!==t||this._flagEnding,this._ending=t}},length:{enumerable:!0,get:function(){if(this._flagLength||this._length<=0){if(this._length=0,!this.children)return this._length;for(let t=0;t<this.children.length;t++){const e=this.children[t];this._length+=e.length}}return this._length}},fill:{enumerable:!0,get:function(){return this._fill},set:function(t){this._fill=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.fill=t}}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(t){this._stroke=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.stroke=t}}},linewidth:{enumerable:!0,get:function(){return this._linewidth},set:function(t){this._linewidth=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.linewidth=t}}},join:{enumerable:!0,get:function(){return this._join},set:function(t){this._join=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.join=t}}},miter:{enumerable:!0,get:function(){return this._miter},set:function(t){this._miter=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.miter=t}}},cap:{enumerable:!0,get:function(){return this._cap},set:function(t){this._cap=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.cap=t}}},closed:{enumerable:!0,get:function(){return this._closed},set:function(t){this._closed=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.closed=t}}},curved:{enumerable:!0,get:function(){return this._curved},set:function(t){this._curved=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.curved=t}}},automatic:{enumerable:!0,get:function(){return this._automatic},set:function(t){this._automatic=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.automatic=t}}},children:{enumerable:!0,get:function(){return this._children},set:function(t){const e=nt.InsertChildren.bind(this),n=nt.RemoveChildren.bind(this),r=nt.OrderChildren.bind(this);this._children&&(this._children.unbind(),this._children.length>0&&n(this._children)),this._children=new zl(t),this._children.bind(Y.Types.insert,e),this._children.bind(Y.Types.remove,n),this._children.bind(Y.Types.order,r),t.length>0&&e(t)}},mask:{enumerable:!0,get:function(){return this._mask},set:function(t){this._mask=t,this._flagMask=!0,K.isObject(t)&&!t.clip&&(t.clip=!0)}},strokeAttenuation:{enumerable:!0,get:function(){return this._strokeAttenuation},set:function(t){this._strokeAttenuation=!!t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.strokeAttenuation!==void 0&&(n.strokeAttenuation=t)}}}};function oc(t,e){const n=t.parent;let r;if(n===e){s();return}if(n&&n.children.ids[t.id]&&(r=Array.prototype.indexOf.call(n.children,t),n.children.splice(r,1),o()),e){s();return}o(),n._flagAdditions&&n.additions.length===0&&(n._flagAdditions=!1),n._flagSubtractions&&n.subtractions.length===0&&(n._flagSubtractions=!1),delete t.parent;function s(){e.subtractions.length>0&&(r=Array.prototype.indexOf.call(e.subtractions,t),r>=0&&e.subtractions.splice(r,1)),e.additions.length>0&&(r=Array.prototype.indexOf.call(e.additions,t),r>=0&&e.additions.splice(r,1)),t.parent=e,e.additions.push(t),e._flagAdditions=!0}function o(){r=Array.prototype.indexOf.call(n.additions,t),r>=0&&n.additions.splice(r,1),r=Array.prototype.indexOf.call(n.subtractions,t),r<0&&(n.subtractions.push(t),n._flagSubtractions=!0)}}var Wr=class extends ke{constructor(e,n,r,s){const o=[new ve(e,n),new ve(r,s)];super(o);for(let a in ac)Object.defineProperty(this,a,ac[a]);this.vertices[0].command=Q.move,this.vertices[1].command=Q.line,this.automatic=!1}};w(Wr,"Properties",["left","right"]);var ac={left:{enumerable:!0,get:function(){return this.vertices[0]},set:function(t){if(K.isObject(t))this.vertices.splice(0,1,t),this.vertices[0].command=Q.move;else{const e=new $t("Two.Line.left argument is not an object.");console.warn(e.name,e.message)}}},right:{enumerable:!0,get:function(){return this.vertices[1]},set:function(t){if(K.isObject(t))this.vertices.splice(1,1,t),this.vertices[1].command=Q.line;else{const e=new $t("Two.Line.right argument is not an object.");console.warn(e.name,e.message)}}}},on={path:/[+-]?(?:\d*\.\d+|\d+)(?:[eE][+-]\d+)?/g,cssBackgroundImage:/url\(['"]?#([\w\d-_]*)['"]?\)/i,unitSuffix:/[a-zA-Z%]*/i},mm={start:"left",middle:"center",end:"right"},lc=["id","class","transform","xmlns","viewBox"],pm=["x","y","width","height","href","xlink:href"];function ym(t){return mm[t]}function bm(t){const e=t.getAttribute("dominant-baseline"),n=t.getAttribute("alignment-baseline");return e||n}function ir(t){return t.replace(/svg:/gi,"").toLowerCase()}function cc(t,e){if(e.x+=t.translateX,e.y+=t.translateY,e.x*=t.scaleX,e.y*=t.scaleY,t.rotation!==0){const n=e.length();e.x=n*Math.cos(t.rotation),e.y=n*Math.sin(t.rotation)}}function _m(t,e){e||(e={});const n=t.split(";");for(let r=0;r<n.length;r++){const s=n[r].split(":"),o=s[0],a=s[1];if(typeof o>"u"||typeof a>"u")continue;const l=o.replace(/\s/g,""),c=a.replace(/\s/g,"");e[l]=c}return e}function wm(t){const e={},n=xm(t),r=Math.max(n.length,t.style.length);for(let s=0;s<r;s++){const o=t.style[s],a=n[s];o&&(e[o]=t.style[o]),a&&(e[a]=t.getAttribute(a))}return e}function xm(t){const e=t.getAttributeNames();for(let n=0;n<lc.length;n++){const r=lc[n],s=Array.prototype.indexOf.call(e,r);s>=0&&e.splice(s,1)}return e}function vm(t,e){const n=e.split(/[\s,]/),r=-parseFloat(n[0]),s=-parseFloat(n[1]),o=parseFloat(n[2]),a=parseFloat(n[3]);if(r&&s)for(let u=0;u<t.children.length;u++){const m=t.children[u];"translation"in m?m.translation.add(r,s):"x"in m?m.x=r:"y"in m&&(m.y=s)}const l=typeof t.x=="number",c=typeof t.y=="number",d=typeof t.width=="number",h=typeof t.height=="number";return l&&(t.translation.x+=t.x),c&&(t.translation.y+=t.y),(d||h)&&(t.scale=new Z(1,1)),d&&(t.scale.x=t.width/o),h&&(t.scale.y=t.height/a),t.mask=new Vn(0,0,o,a),t.mask.origin.set(-o/2,-a/2),t}function Dt(t,e,n){const r={},s={},o={};let a,l,c,d,h,u,m,f,g,p,b,y,_,S,C,v,B;if(t===null)return r;if(ze.getComputedStyle){const k=ze.getComputedStyle(t);for(a=k.length;a--;)c=k[a],d=k[c],typeof d<"u"&&(r[c]=d)}for(a=0;a<t.attributes.length;a++)u=t.attributes[a],/style/i.test(u.nodeName)?_m(u.value,o):s[u.nodeName]=u.value;typeof r.opacity<"u"&&(r["stroke-opacity"]=r.opacity,r["fill-opacity"]=r.opacity,delete r.opacity),n&&K.defaults(r,n),K.extend(r,o,s),r.visible=!(typeof r.display>"u"&&/none/i.test(r.display))||typeof r.visibility>"u"&&/hidden/i.test(r.visibility);for(c in r)switch(d=r[c],c){case"gradientTransform":if(/none/i.test(d)||(l=t.gradientTransform&&t.gradientTransform.baseVal&&t.gradientTransform.baseVal.length>0?t.gradientTransform.baseVal[0].matrix:t.getCTM?t.getCTM():null,l===null))break;switch(m=Zn(l),e._renderer.type){case"linear-gradient":cc(m,e.left),cc(m,e.right);break;case"radial-gradient":e.center.x+=m.translateX,e.center.y+=m.translateY,e.focal.x+=m.translateX,e.focal.y+=m.translateY,e.radius*=Math.max(m.scaleX,m.scaleY);break}break;case"transform":if(/none/i.test(d)||(l=t.transform&&t.transform.baseVal&&t.transform.baseVal.length>0?t.transform.baseVal[0].matrix:t.getCTM?t.getCTM():null,l===null))break;m=Zn(l),e.translation.set(m.translateX,m.translateY),e.rotation=Math.PI*(m.rotation/180),e.scale=new Z(m.scaleX,m.scaleY),f=parseFloat((r.x+"").replace("px")),g=parseFloat((r.y+"").replace("px")),f&&(e.translation.x=f),g&&(e.translation.y=g);break;case"visible":if(e instanceof nt){e._visible=d;break}e.visible=d;break;case"stroke-linecap":if(e instanceof nt){e._cap=d;break}e.cap=d;break;case"stroke-linejoin":if(e instanceof nt){e._join=d;break}e.join=d;break;case"stroke-miterlimit":if(e instanceof nt){e._miter=d;break}e.miter=d;break;case"stroke-width":if(e instanceof nt){e._linewidth=parseFloat(d);break}e.linewidth=parseFloat(d);break;case"opacity":case"stroke-opacity":case"fill-opacity":if(e instanceof nt){e._opacity=parseFloat(d);break}e.opacity=parseFloat(d);break;case"clip-path":if(on.cssBackgroundImage.test(d)&&(p=d.replace(on.cssBackgroundImage,"$1"),Ve.defs.current&&Ve.defs.current.contains(p)&&(y=Ve.defs.current.get(p),y&&y.childNodes.length>0)))switch(y=y.childNodes[0],_=ir(y.nodeName),e.mask=Ve[_].call(this,y,{}),e._renderer.type){case"text":case"path":e.position.add(e.mask.position),e.mask.position.clear();break}break;case"fill":case"stroke":h=(e instanceof nt?"_":"")+c,on.cssBackgroundImage.test(d)?(p=d.replace(on.cssBackgroundImage,"$1"),Ve.defs.current&&Ve.defs.current.contains(p)?(y=Ve.defs.current.get(p),y.object||(_=ir(y.nodeName),y.object=Ve[_].call(this,y,{})),y=y.object):(b=Cm(this),y=b.getById(p)),e[h]=y):e[h]=d;break;case"id":e.id=d;break;case"class":case"className":e.classList=d.split(" "),e._flagClassName=!0;break;case"x":case"y":if(S=e instanceof Je,C=e instanceof Le,v=e instanceof De,S||C||v)break;d.match("[a-z%]$")&&!d.endsWith("px")&&(B=new $t("only pixel values are supported with the "+c+" attribute."),console.warn(B.name,B.message)),e.translation[c]=parseFloat(d);break;case"font-family":e instanceof sn&&(e.family=d);break;case"font-size":e instanceof sn&&(d.match("[a-z%]$")&&!d.endsWith("px")&&(B=new $t("only pixel values are supported with the "+c+" attribute."),console.warn(B.name,B.message)),e.size=parseFloat(d));break;case"font-weight":e instanceof sn&&(e.weight=d);break;case"font-style":e instanceof sn&&(e.style=d);break;case"text-decoration":e instanceof sn&&(e.decoration=d);break;case"line-height":e instanceof sn&&(e.leading=d);break}return Object.keys(t.dataset).length&&(e.dataset=t.dataset),r}function km(t,e){for(let n=0,r=t.childNodes.length;n<r;n++){const s=t.childNodes[n];!s.id||ir(t.nodeName)==="#text"||e.add(s.id,s)}}function Cm(t){for(;t.parent;)t=t.parent;return t.scene}var Ve={svg:function(t){const e=Ve.defs.current=new Fr,n=t.getElementsByTagName("defs");for(let g=0;g<n.length;g++)km(n[g],e);const r=Ve.g.call(this,t),s=t.getAttribute("viewBox"),o=t.getAttribute("x"),a=t.getAttribute("y"),l=t.getAttribute("width"),c=t.getAttribute("height");r.defs=e;const d=s!==null,h=o!==null,u=a!==null,m=l!==null,f=c!==null;return h&&(r.x=parseFloat(o.replace(on.unitSuffix,""))),u&&(r.y=parseFloat(a.replace(on.unitSuffix,""))),m&&(r.width=parseFloat(l.replace(on.unitSuffix,""))),f&&(r.height=parseFloat(c.replace(on.unitSuffix,""))),d&&vm(r,s),delete Ve.defs.current,r},defs:function(t){return null},use:function(t,e){let n;const r=t.getAttribute("href")||t.getAttribute("xlink:href");if(!r)return n=new $t("encountered <use /> with no href."),console.warn(n.name,n.message),null;const s=r.slice(1);if(!Ve.defs.current.contains(s))return n=new $t("unable to find element for reference "+r+"."),console.warn(n.name,n.message),null;const a=Ve.defs.current.get(s).cloneNode(!0);for(let c=0;c<t.attributes.length;c++){const d=t.attributes[c],h=pm.includes(d.nodeName),u=!a.hasAttribute(d.nodeName);(h||u)&&a.setAttribute(d.nodeName,d.value)}const l=ir(a.nodeName);return Ve[l].call(this,a,e)},g:function(t,e){const n=new nt;Dt.call(this,t,n,e),this.add(n);const r=wm.call(this,t);for(let s=0,o=t.childNodes.length;s<o;s++){const a=t.childNodes[s],l=a.nodeName;if(!l)return;const c=ir(l);if(c in Ve){const d=Ve[c].call(n,a,r);d&&!d.parent&&n.add(d)}}return n},polygon:function(t,e){let n;typeof t=="string"?n=t:n=t.getAttribute("points");const r=[];n.replace(/(-?[\d.eE-]+)[,|\s](-?[\d.eE-]+)/g,function(o,a,l){r.push(new ve(parseFloat(a),parseFloat(l)))});const s=new ke(r,!0);return s.stroke="none",s.fill="black",Dt.call(this,t,s,e),s},polyline:function(t,e){const n=Ve.polygon.call(this,t,e);return n.closed=!1,n},path:function(t,e){let n;typeof t=="string"?(n=t,t=null):n=t.getAttribute("d");let r=[],s=!1,o=!1;if(n){let l=new ve,c,d,h=n.match(/[a-df-z][^a-df-z]*/gi);const u=h.length-1;K.each(h.slice(0),function(m,f){const g=m.slice(1).trim().match(on.path),p=m[0],b=p.toLowerCase();let y,_,S,C,v;const B=[];switch(f===0&&(h=[]),b){case"h":case"v":g.length>1&&(y=1);break;case"m":case"l":case"t":g.length>2&&(y=2);break;case"s":case"q":g.length>4&&(y=4);break;case"c":g.length>6&&(y=6);break;case"a":g.length>7&&(y=7);break}if(y){for(_=0,S=g.length,v=0;_<S;_+=y){if(C=p,v>0)switch(p){case"m":C="l";break;case"M":C="L";break}B.push(C+g.slice(_,_+y).join(" ")),v++}h=Array.prototype.concat.apply(h,B)}else h.push(m)}),K.each(h,function(m,f){let g,p,b;const y=m[0],_=y.toLowerCase();d=m.slice(1).trim().match(on.path),o=y===_;let S,C,v,B,k,R,$,F,D,L,M,z,O,ne,P,E,X;switch(_){case"z":if(f>=u)s=!0;else{p=l.x,b=l.y,g=new ve(p,b,void 0,void 0,void 0,void 0,Q.close);for(let j=r.length-1;j>=0;j--){const H=r[j];if(/m/i.test(H.command)){l=H;break}}}break;case"m":case"l":c=void 0,p=parseFloat(d[0]),b=parseFloat(d[1]),g=new ve(p,b,void 0,void 0,void 0,void 0,/m/i.test(_)?Q.move:Q.line),o&&g.addSelf(l),l=g;break;case"h":case"v":L=/h/i.test(_)?"x":"y",M=/x/i.test(L)?"y":"x",g=new ve(void 0,void 0,void 0,void 0,void 0,void 0,Q.line),g[L]=parseFloat(d[0]),g[M]=l[M],o&&(g[L]+=l[L]),l=g;break;case"c":case"s":S=l.x,C=l.y,c||(c=new Z),/c/i.test(_)?(v=parseFloat(d[0]),B=parseFloat(d[1]),k=parseFloat(d[2]),R=parseFloat(d[3]),$=parseFloat(d[4]),F=parseFloat(d[5])):(D=Ds(l,c,o),v=D.x,B=D.y,k=parseFloat(d[0]),R=parseFloat(d[1]),$=parseFloat(d[2]),F=parseFloat(d[3])),o&&(v+=S,B+=C,k+=S,R+=C,$+=S,F+=C),l.controls.right.set(v-l.x,B-l.y),g=new ve($,F,k-$,R-F,void 0,void 0,Q.curve),l=g,c=g.controls.left;break;case"t":case"q":S=l.x,C=l.y,c||(c=new Z),/q/i.test(_)?(v=parseFloat(d[0]),B=parseFloat(d[1]),k=parseFloat(d[0]),R=parseFloat(d[1]),$=parseFloat(d[2]),F=parseFloat(d[3])):(D=Ds(l,c,o),v=D.x,B=D.y,k=D.x,R=D.y,$=parseFloat(d[0]),F=parseFloat(d[1])),o&&(v+=S,B+=C,k+=S,R+=C,$+=S,F+=C),l.controls.right.set((v-l.x)*.33,(B-l.y)*.33),g=new ve($,F,k-$,R-F,void 0,void 0,Q.curve),l=g,c=g.controls.left;break;case"a":S=l.x,C=l.y,O=parseFloat(d[0]),ne=parseFloat(d[1]),P=parseFloat(d[2]),E=parseFloat(d[3]),X=parseFloat(d[4]),$=parseFloat(d[5]),F=parseFloat(d[6]),o&&($+=S,F+=C),z=new ve($,F),z.command=Q.arc,z.rx=O,z.ry=ne,z.xAxisRotation=P,z.largeArcFlag=E,z.sweepFlag=X,g=z,l=z,c=void 0;break}g&&(Array.isArray(g)?r=r.concat(g):r.push(g))})}n=new ke(r,s,void 0,!0),n.stroke="none",n.fill="black";const a=n.getBoundingClientRect(!0);return a.centroid={x:a.left+a.width/2,y:a.top+a.height/2},K.each(n.vertices,function(l){l.subSelf(a.centroid)}),Dt.call(this,t,n,e),n.translation.addSelf(a.centroid),n},circle:function(t,e){const n=parseFloat(t.getAttribute("cx")),r=parseFloat(t.getAttribute("cy")),s=parseFloat(t.getAttribute("r")),o=new Ir(0,0,s);return o.stroke="none",o.fill="black",Dt.call(this,t,o,e),o.translation.x=n,o.translation.y=r,o},ellipse:function(t,e){const n=parseFloat(t.getAttribute("cx")),r=parseFloat(t.getAttribute("cy")),s=parseFloat(t.getAttribute("rx")),o=parseFloat(t.getAttribute("ry")),a=new zr(0,0,s,o);return a.stroke="none",a.fill="black",Dt.call(this,t,a,e),a.translation.x=n,a.translation.y=r,a},rect:function(t,e){const n=parseFloat(t.getAttribute("rx")),r=parseFloat(t.getAttribute("ry"));if(!K.isNaN(n)||!K.isNaN(r))return Ve["rounded-rect"](t);const s=parseFloat(t.getAttribute("width")),o=parseFloat(t.getAttribute("height")),a=s/2,l=o/2,c=new Vn(0,0,s,o);return c.stroke="none",c.fill="black",Dt.call(this,t,c,e),c.translation.x+=a,c.translation.y+=l,c},"rounded-rect":function(t,e){const n=parseFloat(t.getAttribute("rx"))||0,r=parseFloat(t.getAttribute("ry"))||0,s=parseFloat(t.getAttribute("width")),o=parseFloat(t.getAttribute("height")),a=s/2,l=o/2,c=new Z(n,r),d=new Lr(0,0,s,o,c);return d.stroke="none",d.fill="black",Dt.call(this,t,d,e),d.translation.x+=a,d.translation.y+=l,d},line:function(t,e){const n=parseFloat(t.getAttribute("x1")),r=parseFloat(t.getAttribute("y1")),s=parseFloat(t.getAttribute("x2")),o=parseFloat(t.getAttribute("y2")),a=new Wr(n,r,s,o).noFill();return Dt.call(this,t,a,e),a},lineargradient:function(t,e){let n=t.getAttribute("gradientUnits"),r=t.getAttribute("spreadMethod");n||(n="objectBoundingBox"),r||(r="pad");let s=parseFloat(t.getAttribute("x1")||0),o=parseFloat(t.getAttribute("y1")||0),a=parseFloat(t.getAttribute("x2")||0),l=parseFloat(t.getAttribute("y2")||0);const c=(a+s)/2,d=(l+o)/2;/userSpaceOnUse/i.test(n)&&(s-=c,o-=d,a-=c,l-=d);const h=[];for(let m=0;m<t.children.length;m++){const f=t.children[m];let g=f.getAttribute("offset");/%/gi.test(g)&&(g=parseFloat(g.replace(/%/gi,""))/100),g=parseFloat(g);let p=f.getAttribute("stop-color"),b=f.getAttribute("stop-opacity"),y=f.getAttribute("style"),_;p===null&&(_=y?y.match(/stop-color:\s?([#a-fA-F0-9]*)/):!1,p=_&&_.length>1?_[1]:void 0),b===null?(_=y?y.match(/stop-opacity:\s?([0-9.-]*)/):!1,b=_&&_.length>1?parseFloat(_[1]):1):b=parseFloat(b),h.push(new An(g,p,b))}const u=new Le(s,o,a,l,h);return u.spread=r,u.units=n,Dt.call(this,t,u,e),u},radialgradient:function(t,e){let n=t.getAttribute("gradientUnits"),r=t.getAttribute("spreadMethod");n||(n="objectBoundingBox"),r||(r="pad");let s=parseFloat(t.getAttribute("cx"))||0,o=parseFloat(t.getAttribute("cy"))||0,a=parseFloat(t.getAttribute("r")),l=parseFloat(t.getAttribute("fx")),c=parseFloat(t.getAttribute("fy"));K.isNaN(l)&&(l=s),K.isNaN(c)&&(c=o);const d=Math.abs(s+l)/2,h=Math.abs(o+c)/2;/userSpaceOnUse/i.test(n)&&(s-=d,o-=h,l-=d,c-=h);const u=[];for(let f=0;f<t.children.length;f++){const g=t.children[f];let p=g.getAttribute("offset");/%/gi.test(p)&&(p=parseFloat(p.replace(/%/gi,""))/100),p=parseFloat(p);let b=g.getAttribute("stop-color"),y=g.getAttribute("stop-opacity"),_=g.getAttribute("style"),S;b===null&&(S=_?_.match(/stop-color:\s?([#a-fA-F0-9]*)/):!1,b=S&&S.length>1?S[1]:void 0),y===null?(S=_?_.match(/stop-opacity:\s?([0-9.-]*)/):!1,y=S&&S.length>1?parseFloat(S[1]):1):y=parseFloat(y),u.push(new An(p,b,y))}const m=new De(s,o,a,u,l,c);return m.spread=r,m.units=n,Dt.call(this,t,m,e),m},text:function(t,e){const n=ym(t.getAttribute("text-anchor"))||"left",r=bm(t)||"baseline";let s="";t.childNodes.length>0&&t.childNodes[0].tagName==="TSPAN"?s=t.childNodes[0].textContent:s=t.textContent;const o=new sn(s);return Dt.call(this,t,o,e),o.alignment=n,o.baseline=r,o},clippath:function(t,e){return Ve.defs.current&&!Ve.defs.current.contains(t.id)&&Ve.defs.current.add(t.id,t),null},image:function(t,e){let n;const r=t.getAttribute("href")||t.getAttribute("xlink:href");if(!r)return n=new $t("encountered <image /> with no href."),console.warn(n.name,n.message),null;const s=parseFloat(t.getAttribute("x"))||0,o=parseFloat(t.getAttribute("y"))||0,a=parseFloat(t.getAttribute("width")),l=parseFloat(t.getAttribute("height")),c=new Vr(r,s,o);return K.isNaN(a)||(c.width=a),K.isNaN(l)||(c.height=l),Dt.call(this,t,c,e),c}};function dc(t,e){const n=new XMLHttpRequest;return n.open("GET",t),n.onreadystatechange=function(){n.readyState===4&&n.status===200&&e(n.responseText)},n.send(),n}var co=class yn extends Vn{constructor(e,n,r,s,o,a){super(n,r,s||1,o||1),w(this,"_flagTexture",!1),w(this,"_flagMode",!1),w(this,"_texture",null),w(this,"_mode","fill"),this._renderer.type="image";for(let l in uc)Object.defineProperty(this,l,uc[l]);this.noStroke(),this.noFill(),e instanceof Ne?this.texture=e:typeof e=="string"&&(this.texture=new Ne(e)),typeof a=="string"&&(this.mode=a),this._update()}static fromObject(e){const n=new yn().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<yn.Properties.length;n++){const r=yn.Properties[n];r in e&&(this[r]=e[r])}return this}clone(e){const n=new yn(this.texture,this.translation.x,this.translation.y,this.width,this.height);return e&&e.add(n),n}toObject(){const e=super.toObject.call(this);return e.renderer.type="image",e.texture=this.texture.toObject(),e.mode=this.mode,e}dispose(){return super.dispose(),this._texture&&typeof this._texture.dispose=="function"?this._texture.dispose():this._texture&&typeof this._texture.unbind=="function"&&this._texture.unbind(),this}_update(){const e=this._texture;if(e&&(this._flagTexture&&(this.fill=e),e.loaded)){const n=e.image.width,r=e.image.height,s=this.width,o=this.height,a=s/n,l=o/r;switch(this._mode){case yn.Modes.fill:{const c=Math.max(a,l);e.scale=c,e.offset.x=0,e.offset.y=0,e.repeat="repeat";break}case yn.Modes.fit:{const c=Math.min(a,l);e.scale=c,e.offset.x=0,e.offset.y=0,e.repeat="no-repeat";break}case yn.Modes.crop:break;case yn.Modes.tile:{e.offset.x=(n-s)/2,e.offset.y=(r-o)/2,e.repeat="repeat";break}case yn.Modes.stretch:default:e.scale=new Z(a,l),e.offset.x=0,e.offset.y=0,e.repeat="repeat"}}return super._update.call(this),this}flagReset(){return super.flagReset.call(this),this._flagTexture=this._flagMode=!1,this}};w(co,"Modes",{fill:"fill",fit:"fit",crop:"crop",tile:"tile",stretch:"stretch"}),w(co,"Properties",["texture","mode"]);var hc=co,uc={texture:{enumerable:!0,get:function(){return this._texture},set:function(t){this._texture=t,this._flagTexture=!0}},mode:{enumerable:!0,get:function(){return this._mode},set:function(t){this._mode=t,this._flagMode=!0}}},ho=[],uo=Math.max,Sm=Math.min,fc=Math.abs,jr=Math.sin,qr=Math.cos,Bm=Math.acos,Xr=Math.sqrt,Be={isHidden:/(undefined|none|transparent)/i,alignments:{left:"start",middle:"center",right:"end"},baselines:{top:"top",middle:"middle",bottom:"bottom",baseline:"alphabetic"},getRendererType:function(t){return t in Be?t:"path"},group:{renderChild:function(t){const e=Be.getRendererType(t._renderer.type);Be[e].render.call(t,this.ctx,!0,this.clip)},render:function(t){if(!this._visible)return this;K.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();const e=this._matrix.elements,n=this.parent;this._renderer.opacity=this._opacity*(n&&n._renderer?n._renderer.opacity:1);const r=this._mask,s=Yr(e),o=!s||!!r;if(this._renderer.context||(this._renderer.context={}),this._renderer.context.ctx=t,o&&(t.save(),s||t.transform(e[0],e[3],e[1],e[4],e[2],e[5])),r){const a=Be.getRendererType(r._renderer.type);Be[a].render.call(r,t,!0)}if(this._opacity>0&&this._scale!==0)for(let a=0;a<this.children.length;a++){const l=this.children[a],c=Be.getRendererType(l._renderer.type);Be[c].render.call(l,t)}return o&&t.restore(),K.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},path:{render:function(t,e,n){let r,s,o,a,l,c,d,h,u,m,f,g,p,b,y,_,S,C,v,B,k,R,$,F,D,L,M,z,O,ne,P,E,X,j;if(j=this.parent&&this.parent._renderer?this.parent._renderer.opacity:1,O=this._mask,ne=this._clip,l=this._opacity*(j||1),c=this._visible,!e&&(!c||ne||l===0))return this;if(K.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update(),r=this._matrix.elements,s=this._stroke,o=this._linewidth,a=this._fill,d=this._cap,h=this._join,u=this._miter,m=this._closed,f=this._renderer.vertices,g=f.length,p=g-1,P=Yr(r),X=this.dashes,P||(t.save(),t.transform(r[0],r[3],r[1],r[4],r[2],r[5])),O){const se=Be.getRendererType(O._renderer.type);Be[se].render.call(O,t,!0)}if(a)if(typeof a=="string")t.fillStyle=a;else{const se=Be.getRendererType(a._renderer.type);Be[se].render.call(a,t,this),t.fillStyle=a._renderer.effect}if(s){if(typeof s=="string")t.strokeStyle=s;else{const se=Be.getRendererType(s._renderer.type);Be[se].render.call(s,t,this),t.strokeStyle=s._renderer.effect}o&&(t.lineWidth=rn(this)),u&&(t.miterLimit=u),h&&(t.lineJoin=h),!m&&d&&(t.lineCap=d)}typeof l=="number"&&(t.globalAlpha=l),X&&X.length>0&&(t.lineDashOffset=X.offset||0,t.setLineDash(X)),t.beginPath();let H,N,I,J,ce,re,de;for(let se=0;se<g;se++)switch(_=f[se],M=_.x,z=_.y,_.command){case Q.close:t.closePath();break;case Q.arc:H=_.rx,N=_.ry,I=_.xAxisRotation,J=_.largeArcFlag,ce=_.sweepFlag,b=m?Ft(se-1,g):uo(se-1,0),y=f[b],re=y.x,de=y.y,Be.renderSvgArcCommand(t,re,de,H,N,J,ce,I,M,z);break;case Q.curve:b=m?Ft(se-1,g):Math.max(se-1,0),y=f[b],$=y.controls&&y.controls.right||Z.zero,F=_.controls&&_.controls.left||Z.zero,y._relative?(k=$.x+y.x,R=$.y+y.y):(k=$.x,R=$.y),_._relative?(v=F.x+_.x,B=F.y+_.y):(v=F.x,B=F.y),t.bezierCurveTo(k,R,v,B,M,z),se>=p&&m&&(S=C,D=_.controls&&_.controls.right||Z.zero,L=S.controls&&S.controls.left||Z.zero,_._relative?(k=D.x+_.x,R=D.y+_.y):(k=D.x,R=D.y),S._relative?(v=L.x+S.x,B=L.y+S.y):(v=L.x,B=L.y),M=S.x,z=S.y,t.bezierCurveTo(k,R,v,B,M,z));break;case Q.line:t.lineTo(M,z);break;case Q.move:C=_,t.moveTo(M,z);break}return m&&t.closePath(),!ne&&!n&&(Be.isHidden.test(a)||(E=a._renderer&&a._renderer.offset,E&&(t.save(),t.translate(-a._renderer.offset.x,-a._renderer.offset.y),t.scale(a._renderer.scale.x,a._renderer.scale.y)),t.fill(),E&&t.restore()),Be.isHidden.test(s)||(E=s._renderer&&s._renderer.offset,E&&(t.save(),t.translate(-s._renderer.offset.x,-s._renderer.offset.y),t.scale(s._renderer.scale.x,s._renderer.scale.y),t.lineWidth=o/s._renderer.scale.x),t.stroke(),E&&t.restore())),P||t.restore(),ne&&!n&&t.clip(),X&&X.length>0&&t.setLineDash(ho),K.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},points:{render:function(t,e,n){let r,s,o,a,l,c,d,h,u,m,f,g,p,b,y,_;if(_=this.parent&&this.parent._renderer?this.parent._renderer.opacity:1,l=this._opacity*(_||1),c=this._visible,!e&&(!c||l===0))return this;if(K.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update(),r=this._matrix.elements,s=this._stroke,o=this._linewidth,a=this._fill,h=this._renderer.collection,u=h.length,p=Yr(r),y=this.dashes,d=this._size,p||(t.save(),t.transform(r[0],r[3],r[1],r[4],r[2],r[5])),a)if(typeof a=="string")t.fillStyle=a;else{const v=Be.getRendererType(a._renderer.type);Be[v].render.call(a,t,this),t.fillStyle=a._renderer.effect}if(s){if(typeof s=="string")t.strokeStyle=s;else{const v=Be.getRendererType(s._renderer.type);Be[v].render.call(s,t,this),t.strokeStyle=s._renderer.effect}o&&(t.lineWidth=rn(this))}typeof l=="number"&&(t.globalAlpha=l),y&&y.length>0&&(t.lineDashOffset=y.offset||0,t.setLineDash(y)),t.beginPath();let S=d*.5,C;this._sizeAttenuation||(C=this.worldMatrix.elements,C=Zn(C[0],C[3],C[1],C[4],C[2],C[5]),S/=Math.max(C.scaleX,C.scaleY));for(let v=0;v<u;v++)m=h[v],f=m.x,g=m.y,t.moveTo(f+S,g),t.arc(f,g,S,0,ct);return n||(Be.isHidden.test(a)||(b=a._renderer&&a._renderer.offset,b&&(t.save(),t.translate(-a._renderer.offset.x,-a._renderer.offset.y),t.scale(a._renderer.scale.x,a._renderer.scale.y)),t.fill(),b&&t.restore()),Be.isHidden.test(s)||(b=s._renderer&&s._renderer.offset,b&&(t.save(),t.translate(-s._renderer.offset.x,-s._renderer.offset.y),t.scale(s._renderer.scale.x,s._renderer.scale.y),t.lineWidth=o/s._renderer.scale.x),t.stroke(),b&&t.restore())),p||t.restore(),y&&y.length>0&&t.setLineDash(ho),K.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},text:{render:function(t,e,n){const r=this.parent&&this.parent._renderer?this.parent._renderer.opacity:1,s=this._opacity*r,o=this._visible,a=this._mask,l=this._clip;if(!e&&(!o||l||s===0))return this;K.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();const c=this._matrix.elements,d=this._stroke,h=this._linewidth,u=this._fill,m=this._decoration,f=this._direction,g=Yr(c),p=u._renderer&&u._renderer.offset&&d._renderer&&d._renderer.offset,b=this.dashes,y=Be.alignments[this._alignment]||this._alignment,_=Be.baselines[this._baseline]||this._baseline;let S,C,v,B,k,R,$,F,D,L,M;if(g||(t.save(),t.transform(c[0],c[3],c[1],c[4],c[2],c[5])),a){const z=Be.getRendererType(a._renderer.type);Be[z].render.call(a,t,!0)}if(p||(t.font=[this._style,this._weight,this._size+"px/"+this._leading+"px",this._family].join(" ")),t.textAlign=y,t.textBaseline=_,t.direction=f,u)if(typeof u=="string")t.fillStyle=u;else{const z=Be.getRendererType(u._renderer.type);Be[z].render.call(u,t,this),t.fillStyle=u._renderer.effect}if(d){if(typeof d=="string")t.strokeStyle=d;else{const z=Be.getRendererType(d._renderer.type);Be[z].render.call(d,t,this),t.strokeStyle=d._renderer.effect}h&&(t.lineWidth=rn(this))}if(typeof s=="number"&&(t.globalAlpha=s),b&&b.length>0&&(t.lineDashOffset=b.offset||0,t.setLineDash(b)),!l&&!n&&(Be.isHidden.test(u)||(u._renderer&&u._renderer.offset?(R=u._renderer.scale.x,$=u._renderer.scale.y,t.save(),t.translate(-u._renderer.offset.x,-u._renderer.offset.y),t.scale(R,$),S=this._size/u._renderer.scale.y,C=this._leading/u._renderer.scale.y,t.font=[this._style,this._weight,S+"px/",C+"px",this._family].join(" "),v=u._renderer.offset.x/u._renderer.scale.x,B=u._renderer.offset.y/u._renderer.scale.y,t.fillText(this.value,v,B),t.restore()):t.fillText(this.value,0,0)),Be.isHidden.test(d)||(d._renderer&&d._renderer.offset?(R=d._renderer.scale.x,$=d._renderer.scale.y,t.save(),t.translate(-d._renderer.offset.x,-d._renderer.offset.y),t.scale(R,$),S=this._size/d._renderer.scale.y,C=this._leading/d._renderer.scale.y,t.font=[this._style,this._weight,S+"px/",C+"px",this._family].join(" "),v=d._renderer.offset.x/d._renderer.scale.x,B=d._renderer.offset.y/d._renderer.scale.y,k=h/d._renderer.scale.x,t.lineWidth=k,t.strokeText(this.value,v,B),t.restore()):t.strokeText(this.value,0,0))),/(underline|strikethrough)/i.test(m)){const z=t.measureText(this.value);let O=1;switch(m){case"underline":D=z.actualBoundingBoxDescent,M=z.actualBoundingBoxDescent;break;case"strikethrough":D=0,M=0,O=.5;break}switch(_){case"top":D+=this._size*O,M+=this._size*O;break;case"baseline":case"bottom":D-=this._size*O,M-=this._size*O;break}switch(y){case"left":case"start":F=0,L=z.width;break;case"right":case"end":F=-z.width,L=0;break;default:F=-z.width/2,L=z.width/2}t.lineWidth=Math.max(Math.floor(this._size/15),1),t.strokeStyle=t.fillStyle,t.beginPath(),t.moveTo(F,D),t.lineTo(L,M),t.stroke()}return g||t.restore(),l&&!n&&t.clip(),b&&b.length>0&&t.setLineDash(ho),K.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},"linear-gradient":{render:function(t,e){if(e){if(K.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update(),!this._renderer.effect||this._flagEndPoints||this._flagStops||this._flagUnits){let n,r=this.left._x,s=this.left._y,o=this.right._x,a=this.right._y;/objectBoundingBox/i.test(this._units)&&(n=e.getBoundingClientRect(!0),r=(r-.5)*n.width,s=(s-.5)*n.height,o=(o-.5)*n.width,a=(a-.5)*n.height),this._renderer.effect=t.createLinearGradient(r,s,o,a);for(let l=0;l<this.stops.length;l++){const c=this.stops[l];this._renderer.effect.addColorStop(c._offset,c._color)}}return K.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}}},"radial-gradient":{render:function(t,e){if(e){if(K.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update(),!this._renderer.effect||this._flagCenter||this._flagFocal||this._flagRadius||this._flagStops||this._flagUnits){let n,r=this.center._x,s=this.center._y,o=this.focal._x,a=this.focal._y,l=this._radius;/objectBoundingBox/i.test(this._units)&&(n=e.getBoundingClientRect(!0),r=(r-.5)*n.width*.5,s=(s-.5)*n.height*.5,o=(o-.5)*n.width*.5,a=(a-.5)*n.height*.5,l*=Math.min(n.width,n.height)),this._renderer.effect=t.createRadialGradient(r,s,0,o,a,l);for(let c=0;c<this.stops.length;c++){const d=this.stops[c];this._renderer.effect.addColorStop(d._offset,d._color)}}return K.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}}},texture:{render:function(t){K.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();const e=this.image;return(!this._renderer.effect||(this._flagLoaded||this._flagImage||this._flagVideo||this._flagRepeat)&&this.loaded)&&(this._renderer.effect=t.createPattern(this.image,this._repeat)),(this._flagOffset||this._flagLoaded||this._flagScale)&&(this._renderer.offset instanceof Z||(this._renderer.offset=new Z),this._renderer.offset.x=-this._offset.x,this._renderer.offset.y=-this._offset.y,e&&(this._renderer.offset.x+=e.width/2,this._renderer.offset.y+=e.height/2,this._scale instanceof Z?(this._renderer.offset.x*=this._scale.x,this._renderer.offset.y*=this._scale.y):(this._renderer.offset.x*=this._scale,this._renderer.offset.y*=this._scale))),(this._flagScale||this._flagLoaded)&&(this._renderer.scale instanceof Z||(this._renderer.scale=new Z),this._scale instanceof Z?this._renderer.scale.copy(this._scale):this._renderer.scale.set(this._scale,this._scale)),K.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},renderSvgArcCommand:function(t,e,n,r,s,o,a,l,c,d){l=l*Math.PI/180,r=fc(r),s=fc(s);const h=(e-c)/2,u=(n-d)/2,m=qr(l)*h+jr(l)*u,f=-jr(l)*h+qr(l)*u,g=m*m,p=f*f;let b=r*r,y=s*s;const _=g/b+p/y;if(_>1){const z=Xr(_);r=z*r,s=z*s,b=r*r,y=s*s}const S=b*p+y*g,C=(b*y-S)/S;let v=Xr(uo(0,C));o===a&&(v=-v);const B=v*r*f/s,k=-v*s*m/r,R=qr(l)*B-jr(l)*k+(e+c)/2,$=jr(l)*B+qr(l)*k+(n+d)/2,F=gc(1,0,(m-B)/r,(f-k)/s),D=gc((m-B)/r,(f-k)/s,(-m-B)/r,(-f-k)/s)%ct,L=F+D;Tm(t,R,$,r,s,F,L,a===0,l)}},ht=class extends Y{constructor(t){super();const e=t.smoothing!==!1;this.domElement=t.domElement||document.createElement("canvas"),this.ctx=this.domElement.getContext("2d"),this.overdraw=t.overdraw||!1,typeof this.ctx.imageSmoothingEnabled<"u"&&(this.ctx.imageSmoothingEnabled=e),this.scene=new nt,this.scene.parent=this}setSize(t,e,n){return this.width=t,this.height=e,this.ratio=typeof n>"u"?Hs(this.ctx):n,this.domElement.width=t*this.ratio,this.domElement.height=e*this.ratio,this.domElement.style&&K.extend(this.domElement.style,{width:t+"px",height:e+"px"}),this.trigger(Y.Types.resize,t,e,n)}render(){const t=this.ratio===1;return t||(this.ctx.save(),this.ctx.scale(this.ratio,this.ratio)),this.overdraw||this.ctx.clearRect(0,0,this.width,this.height),Be.group.render.call(this.scene,this.ctx),t||this.ctx.restore(),this}};w(ht,"Utils",Be);function Tm(t,e,n,r,s,o,a,l,c){const d=a-o,h=$i.Tolerance.epsilon,u=Math.abs(d)<h;let m=Ft(d,ct);m<h&&(u?m=0:m=ct),l===!0&&!u&&(m===ct?m=-ct:m=m-ct);for(let f=0;f<xt.Resolution;f++){const g=f/(xt.Resolution-1),p=o+g*m;let b=e+r*Math.cos(p),y=n+s*Math.sin(p);if(c!==0){const _=Math.cos(c),S=Math.sin(c),C=b-e,v=y-n;b=C*_-v*S+e,y=C*S+v*_+n}t.lineTo(b,y)}}function gc(t,e,n,r){const s=t*n+e*r,o=Xr(t*t+e*e)*Xr(n*n+r*r);let a=Bm(uo(-1,Sm(1,s/o)));return t*r-e*n<0&&(a=-a),a}function Yr(t){return t[0]===1&&t[3]===0&&t[1]===0&&t[4]===1&&t[2]===0&&t[5]===0}var oe={version:1.1,ns:"http://www.w3.org/2000/svg",xlink:"http://www.w3.org/1999/xlink",alignments:{left:"start",center:"middle",right:"end"},baselines:{top:"hanging",middle:"middle",bottom:"ideographic",baseline:"alphabetic"},createElement:function(t,e){const n=t,r=document.createElementNS(oe.ns,n);return n==="svg"&&(e=K.defaults(e||{},{version:oe.version})),e&&Object.keys(e).length>0&&oe.setAttributes(r,e),r},setAttributes:function(t,e){const n=Object.keys(e);for(let r=0;r<n.length;r++)/href/.test(n[r])?t.setAttributeNS(oe.xlink,n[r],e[n[r]]):t.setAttribute(n[r],e[n[r]]);return this},removeAttributes:function(t,e){for(let n in e)t.removeAttribute(n);return this},toString:function(t,e){let n=t.length,r=n-1,s,o="";for(let a=0;a<n;a++){const l=t[a],c=e?Ft(a-1,n):Math.max(a-1,0),d=t[c];let h,u,m,f,g,p,b,y,_,S,C,v,B,k,R,$=Ee(l.x),F=Ee(l.y);switch(l.command){case Q.close:h=Q.close;break;case Q.arc:C=l.rx,v=l.ry,B=l.xAxisRotation,k=l.largeArcFlag,R=l.sweepFlag,h=Q.arc+" "+C+" "+v+" "+B+" "+k+" "+R+" "+$+" "+F;break;case Q.curve:b=d.controls&&d.controls.right||Z.zero,y=l.controls&&l.controls.left||Z.zero,d.relative?(m=Ee(b.x+d.x),f=Ee(b.y+d.y)):(m=Ee(b.x),f=Ee(b.y)),l.relative?(g=Ee(y.x+l.x),p=Ee(y.y+l.y)):(g=Ee(y.x),p=Ee(y.y)),h=(a===0?Q.move:Q.curve)+" "+m+" "+f+" "+g+" "+p+" "+$+" "+F;break;case Q.move:s=l,h=Q.move+" "+$+" "+F;break;default:h=l.command+" "+$+" "+F}a>=r&&e&&(l.command===Q.curve&&(u=s,_=l.controls&&l.controls.right||l,S=u.controls&&u.controls.left||u,l.relative?(m=Ee(_.x+l.x),f=Ee(_.y+l.y)):(m=Ee(_.x),f=Ee(_.y)),u.relative?(g=Ee(S.x+u.x),p=Ee(S.y+u.y)):(g=Ee(S.x),p=Ee(S.y)),$=Ee(u.x),F=Ee(u.y),h+=" C "+m+" "+f+" "+g+" "+p+" "+$+" "+F),l.command!==Q.close&&(h+=" Z")),o+=h+" "}return o},pointsToString:function(t,e){let n="";const r=e*.5;for(let s=0;s<t.length;s++){const o=t[s].x,a=t[s].y-r;n+=Q.move+" "+o+" "+a+" ",n+="a "+r+" "+r+" 0 1 0 0.001 0 Z"}return n},getClip:function(t,e){let n=t._renderer.clip;return n||(n=t._renderer.clip=oe.createElement("clipPath",{"clip-rule":"nonzero"})),n.parentNode===null&&e.defs.appendChild(n),n},getRendererType:function(t){return t in oe?t:"path"},defs:{update:function(t){const{defs:e}=t;if(e._flagUpdate){const n=Array.prototype.slice.call(e.children,0);for(let r=0;r<n.length;r++){const s=n[r],o=s.id,a=`[fill="url(#${o})"],[stroke="url(#${o})"],[clip-path="url(#${o})"]`;t.querySelector(a)||e.removeChild(s)}e._flagUpdate=!1}}},group:{appendChild:function(t){const e=t._renderer.elem;if(!e)return;const n=e.nodeName;!n||/(radial|linear)gradient/i.test(n)||t._clip||this.elem.appendChild(e)},removeChild:function(t){const e=t._renderer.elem;!e||e.parentNode!=this.elem||!e.nodeName||t._clip||this.elem.removeChild(e)},orderChild:function(t){this.elem.appendChild(t._renderer.elem)},renderChild:function(t){const e=oe.getRendererType(t._renderer.type);oe[e].render.call(t,this)},render:function(t){if(!this._visible&&!this._flagVisible||this._opacity===0&&!this._flagOpacity)return this;K.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update(),this._renderer.elem||(this._renderer.elem=oe.createElement("g",{id:this.id}),t.appendChild(this._renderer.elem));const e=this._matrix.manual||this._flagMatrix,n={domElement:t,elem:this._renderer.elem};e&&this._renderer.elem.setAttribute("transform","matrix("+this._matrix.toString()+")");for(let r=0;r<this.children.length;r++){const s=this.children[r],o=oe.getRendererType(s._renderer.type);oe[o].render.call(s,t)}if(this._flagId&&this._renderer.elem.setAttribute("id",this._id),this._flagOpacity&&this._renderer.elem.setAttribute("opacity",this._opacity),this._flagVisible&&this._renderer.elem.setAttribute("display",this._visible?"inline":"none"),this._flagClassName&&this._renderer.elem.setAttribute("class",this.classList.join(" ")),this._flagAdditions&&this.additions.forEach(oe.group.appendChild,n),this._flagSubtractions&&this.subtractions.forEach(oe.group.removeChild,n),this._flagOrder&&this.children.forEach(oe.group.orderChild,n),this._flagMask)if(this._mask){const r=oe.getRendererType(this._mask._renderer.type);oe[r].render.call(this._mask,t),this._renderer.elem.setAttribute("clip-path","url(#"+this._mask.id+")")}else this._renderer.elem.removeAttribute("clip-path");return this.dataset&&Object.assign(this._renderer.elem.dataset,this.dataset),K.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},path:{render:function(t){if(this._opacity===0&&!this._flagOpacity)return this;K.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();const e={};if((this._matrix.manual||this._flagMatrix)&&(e.transform="matrix("+this._matrix.toString()+")"),this._flagId&&(e.id=this._id),this._flagVertices){const r=oe.toString(this._renderer.vertices,this._closed);e.d=r}if(this._fill&&this._fill._renderer){this._renderer.hasFillEffect=!0,this._fill._update();const r=oe.getRendererType(this._fill._renderer.type);oe[r].render.call(this._fill,t,!0)}if(this._flagFill&&(e.fill=this._fill&&this._fill.id?"url(#"+this._fill.id+")":this._fill,this._renderer.hasFillEffect&&typeof this._fill.id>"u"&&(t.defs._flagUpdate=!0,delete this._renderer.hasFillEffect)),this._stroke&&this._stroke._renderer){this._renderer.hasStrokeEffect=!0,this._stroke._update();const r=oe.getRendererType(this._stroke._renderer.type);oe[r].render.call(this._stroke,t,!0)}if(this._flagStroke&&(e.stroke=this._stroke&&this._stroke.id?"url(#"+this._stroke.id+")":this._stroke,this._renderer.hasStrokeEffect&&typeof this._stroke.id>"u"&&(t.defs._flagUpdate=!0,delete this._renderer.hasStrokeEffect)),this._flagLinewidth&&(e["stroke-width"]=rn(this)),this._flagOpacity&&(e["stroke-opacity"]=this._opacity,e["fill-opacity"]=this._opacity),this._flagClassName&&(e.class=this.classList.join(" ")),this._flagVisible&&(e.visibility=this._visible?"visible":"hidden"),this._flagCap&&(e["stroke-linecap"]=this._cap),this._flagJoin&&(e["stroke-linejoin"]=this._join),this._flagMiter&&(e["stroke-miterlimit"]=this._miter),this.dashes&&this.dashes.length>0&&(e["stroke-dasharray"]=this.dashes.join(" "),e["stroke-dashoffset"]=this.dashes.offset||0),this._renderer.elem?oe.setAttributes(this._renderer.elem,e):(e.id=this._id,this._renderer.elem=oe.createElement("path",e),t.appendChild(this._renderer.elem)),this._flagClip){const r=oe.getClip(this,t),s=this._renderer.elem;this._clip?(s.removeAttribute("id"),r.setAttribute("id",this.id),r.appendChild(s)):(r.removeAttribute("id"),s.setAttribute("id",this.id),this.parent._renderer.elem.appendChild(s))}if(this._flagMask)if(this._mask){const r=oe.getRendererType(this._mask._renderer.type);oe[r].render.call(this._mask,t),this._renderer.elem.setAttribute("clip-path","url(#"+this._mask.id+")")}else this._renderer.elem.removeAttribute("clip-path");return K.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},points:{render:function(t){if(this._opacity===0&&!this._flagOpacity)return this;K.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();const e={};if((this._matrix.manual||this._flagMatrix)&&(e.transform="matrix("+this._matrix.toString()+")"),this._flagId&&(e.id=this._id),this._flagVertices||this._flagSize||this._flagSizeAttenuation){let r=this._size;if(!this._sizeAttenuation){const o=this.worldMatrix.elements,a=Zn(o[0],o[3],o[1],o[4],o[2],o[5]);r/=Math.max(a.scaleX,a.scaleY)}const s=oe.pointsToString(this._renderer.collection,r);e.d=s}if(this._fill&&this._fill._renderer){this._renderer.hasFillEffect=!0,this._fill._update();const r=oe.getRendererType(this._fill._renderer.type);oe[r].render.call(this._fill,t,!0)}if(this._flagFill&&(e.fill=this._fill&&this._fill.id?"url(#"+this._fill.id+")":this._fill,this._renderer.hasFillEffect&&typeof this._fill.id>"u"&&(t.defs._flagUpdate=!0,delete this._renderer.hasFillEffect)),this._stroke&&this._stroke._renderer){this._renderer.hasStrokeEffect=!0,this._stroke._update();const r=oe.getRendererType(this._stroke._renderer.type);oe[r].render.call(this._stroke,t,!0)}return this._flagStroke&&(e.stroke=this._stroke&&this._stroke.id?"url(#"+this._stroke.id+")":this._stroke,this._renderer.hasStrokeEffect&&typeof this._stroke.id>"u"&&(t.defs._flagUpdate=!0,delete this._renderer.hasStrokeEffect)),this._flagLinewidth&&(e["stroke-width"]=rn(this)),this._flagOpacity&&(e["stroke-opacity"]=this._opacity,e["fill-opacity"]=this._opacity),this._flagClassName&&(e.class=this.classList.join(" ")),this._flagVisible&&(e.visibility=this._visible?"visible":"hidden"),this.dashes&&this.dashes.length>0&&(e["stroke-dasharray"]=this.dashes.join(" "),e["stroke-dashoffset"]=this.dashes.offset||0),this._renderer.elem?oe.setAttributes(this._renderer.elem,e):(e.id=this._id,this._renderer.elem=oe.createElement("path",e),t.appendChild(this._renderer.elem)),K.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},text:{render:function(t){this._update();const e={};if((this._matrix.manual||this._flagMatrix)&&(e.transform="matrix("+this._matrix.toString()+")"),this._flagId&&(e.id=this._id),this._flagFamily&&(e["font-family"]=this._family),this._flagSize&&(e["font-size"]=this._size),this._flagLeading&&(e["line-height"]=this._leading),this._flagAlignment&&(e["text-anchor"]=oe.alignments[this._alignment]||this._alignment),this._flagBaseline&&(e["dominant-baseline"]=oe.baselines[this._baseline]||this._baseline),this._flagStyle&&(e["font-style"]=this._style),this._flagWeight&&(e["font-weight"]=this._weight),this._flagDecoration&&(e["text-decoration"]=this._decoration),this._flagDirection&&(e.direction=this._direction),this._fill&&this._fill._renderer){this._renderer.hasFillEffect=!0,this._fill._update();const r=oe.getRendererType(this._fill._renderer.type);oe[r].render.call(this._fill,t,!0)}if(this._flagFill&&(e.fill=this._fill&&this._fill.id?"url(#"+this._fill.id+")":this._fill,this._renderer.hasFillEffect&&typeof this._fill.id>"u"&&(t.defs._flagUpdate=!0,delete this._renderer.hasFillEffect)),this._stroke&&this._stroke._renderer){this._renderer.hasStrokeEffect=!0,this._stroke._update();const r=oe.getRendererType(this._stroke._renderer.type);oe[r].render.call(this._stroke,t,!0)}if(this._flagStroke&&(e.stroke=this._stroke&&this._stroke.id?"url(#"+this._stroke.id+")":this._stroke,this._renderer.hasStrokeEffect&&typeof this._stroke.id>"u"&&(t.defs._flagUpdate=!0,delete this._renderer.hasStrokeEffect)),this._flagLinewidth&&(e["stroke-width"]=rn(this)),this._flagOpacity&&(e.opacity=this._opacity),this._flagClassName&&(e.class=this.classList.join(" ")),this._flagVisible&&(e.visibility=this._visible?"visible":"hidden"),this.dashes&&this.dashes.length>0&&(e["stroke-dasharray"]=this.dashes.join(" "),e["stroke-dashoffset"]=this.dashes.offset||0),this._renderer.elem?oe.setAttributes(this._renderer.elem,e):(e.id=this._id,this._renderer.elem=oe.createElement("text",e),t.appendChild(this._renderer.elem)),this._flagClip){const r=oe.getClip(this,t),s=this._renderer.elem;this._clip?(s.removeAttribute("id"),r.setAttribute("id",this.id),r.appendChild(s)):(r.removeAttribute("id"),s.setAttribute("id",this.id),this.parent._renderer.elem.appendChild(s))}if(this._flagMask)if(this._mask){const r=oe.getRendererType(this._mask._renderer.type);oe[r].render.call(this._mask,t),this._renderer.elem.setAttribute("clip-path","url(#"+this._mask.id+")")}else this._renderer.elem.removeAttribute("clip-path");return this._flagValue&&(this._renderer.elem.textContent=this._value),this.flagReset()}},"linear-gradient":{render:function(t,e){K.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),e||this._update();const n={};if(this._flagId&&(n.id=this._id),this._flagEndPoints&&(n.x1=this.left._x,n.y1=this.left._y,n.x2=this.right._x,n.y2=this.right._y),this._flagSpread&&(n.spreadMethod=this._spread),this._flagUnits&&(n.gradientUnits=this._units),this._renderer.elem?oe.setAttributes(this._renderer.elem,n):(n.id=this._id,this._renderer.elem=oe.createElement("linearGradient",n)),this._renderer.elem.parentNode===null&&t.defs.appendChild(this._renderer.elem),this._flagStops){const r=this._renderer.elem.childNodes.length!==this.stops.length;if(r)for(;this._renderer.elem.lastChild;)this._renderer.elem.removeChild(this._renderer.elem.lastChild);for(let s=0;s<this.stops.length;s++){const o=this.stops[s],a={};o._flagOffset&&(a.offset=100*o._offset+"%"),o._flagColor&&(a["stop-color"]=o._color),o._flagOpacity&&(a["stop-opacity"]=o._opacity),o._renderer.elem?oe.setAttributes(o._renderer.elem,a):o._renderer.elem=oe.createElement("stop",a),r&&this._renderer.elem.appendChild(o._renderer.elem),o.flagReset()}}return K.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},"radial-gradient":{render:function(t,e){K.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),e||this._update();const n={};if(this._flagId&&(n.id=this._id),this._flagCenter&&(n.cx=this.center._x,n.cy=this.center._y),this._flagFocal&&(n.fx=this.focal._x,n.fy=this.focal._y),this._flagRadius&&(n.r=this._radius),this._flagSpread&&(n.spreadMethod=this._spread),this._flagUnits&&(n.gradientUnits=this._units),this._renderer.elem?oe.setAttributes(this._renderer.elem,n):(n.id=this._id,this._renderer.elem=oe.createElement("radialGradient",n)),this._renderer.elem.parentNode===null&&t.defs.appendChild(this._renderer.elem),this._flagStops){const r=this._renderer.elem.childNodes.length!==this.stops.length;if(r)for(;this._renderer.elem.lastChild;)this._renderer.elem.removeChild(this._renderer.elem.lastChild);for(let s=0;s<this.stops.length;s++){const o=this.stops[s],a={};o._flagOffset&&(a.offset=100*o._offset+"%"),o._flagColor&&(a["stop-color"]=o._color),o._flagOpacity&&(a["stop-opacity"]=o._opacity),o._renderer.elem?oe.setAttributes(o._renderer.elem,a):o._renderer.elem=oe.createElement("stop",a),r&&this._renderer.elem.appendChild(o._renderer.elem),o.flagReset()}}return K.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},texture:{render:function(t,e){K.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),e||this._update();const n={},r={x:0,y:0},s=this.image;if(this._flagId&&(n.id=this._id),this._flagLoaded&&this.loaded)switch(s.nodeName.toLowerCase()){case"canvas":r.href=r["xlink:href"]=s.toDataURL("image/png");break;case"img":case"image":r.href=r["xlink:href"]=this.src;break}if((this._flagOffset||this._flagLoaded||this._flagScale)&&(n.x=this._offset.x,n.y=this._offset.y,s&&(n.x-=s.width/2,n.y-=s.height/2,this._scale instanceof Z?(n.x*=this._scale.x,n.y*=this._scale.y):(n.x*=this._scale,n.y*=this._scale)),n.x>0&&(n.x*=-1),n.y>0&&(n.y*=-1)),(this._flagScale||this._flagLoaded||this._flagRepeat)&&(n.width=0,n.height=0,s)){switch(n.width=s.width,n.height=s.height,this._repeat){case"no-repeat":n.width+=1,n.height+=1;break}this._scale instanceof Z?(n.width*=this._scale.x,n.height*=this._scale.y):(n.width*=this._scale,n.height*=this._scale),/no-repeat/i.test(this._repeat)?r.preserveAspectRatio="xMidYMid":r.preserveAspectRatio="none",r.width=n.width,r.height=n.height}return(this._flagScale||this._flagLoaded)&&(this._renderer.image?oe.setAttributes(this._renderer.image,r):this._renderer.image=oe.createElement("image",r)),this._renderer.elem?Object.keys(n).length!==0&&oe.setAttributes(this._renderer.elem,n):(n.id=this._id,n.patternUnits="userSpaceOnUse",this._renderer.elem=oe.createElement("pattern",n)),this._renderer.elem.parentNode===null&&t.defs.appendChild(this._renderer.elem),this._renderer.elem&&this._renderer.image&&!this._renderer.appended&&(this._renderer.elem.appendChild(this._renderer.image),this._renderer.appended=!0),K.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}}},mc=class extends Y{constructor(t){super(),this.domElement=t.domElement||oe.createElement("svg"),this.scene=new nt,this.scene.parent=this,this.defs=oe.createElement("defs"),this.defs._flagUpdate=!1,this.domElement.appendChild(this.defs),this.domElement.defs=this.defs,this.domElement.style.overflow="hidden"}setSize(t,e){return this.width=t,this.height=e,oe.setAttributes(this.domElement,{width:t,height:e}),this.trigger(Y.Types.resize,t,e)}render(){return oe.group.render.call(this.scene,this.domElement),oe.defs.update(this.domElement),this}};w(mc,"Utils",oe);var Ht={create:function(t,e,n){const r=t.createShader(t[n]);if(t.shaderSource(r,e),t.compileShader(r),!t.getShaderParameter(r,t.COMPILE_STATUS)){const o=t.getShaderInfoLog(r);throw t.deleteShader(r),new $t("unable to compile shader "+r+": "+o)}return r},types:{vertex:"VERTEX_SHADER",fragment:"FRAGMENT_SHADER"},path:{vertex:`
40
+ ***************************************************************************** */var Pr=function(){return Pr=Object.assign||function(e){for(var n,r=1,s=arguments.length;r<s;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},Pr.apply(this,arguments)},Lf={scale:1,zoom:!0,infiniteZoom:!0,actualSize:!0,showZoomInOutIcons:!1,actualSizeIcons:{zoomIn:"lg-zoom-in",zoomOut:"lg-zoom-out"},enableZoomAfter:300,zoomPluginStrings:{zoomIn:"Zoom in",zoomOut:"Zoom out",viewActualSize:"View actual size"}},_n={containerResize:"lgContainerResize",beforeOpen:"lgBeforeOpen",afterOpen:"lgAfterOpen",slideItemLoad:"lgSlideItemLoad",afterSlide:"lgAfterSlide",rotateLeft:"lgRotateLeft",rotateRight:"lgRotateRight",flipHorizontal:"lgFlipHorizontal",flipVertical:"lgFlipVertical"},Ms=500,Df=(function(){function t(e,n){return this.core=e,this.$LG=n,this.settings=Pr(Pr({},Lf),this.core.settings),this}return t.prototype.buildTemplates=function(){var e=this.settings.showZoomInOutIcons?'<button id="'+this.core.getIdName("lg-zoom-in")+'" type="button" aria-label="'+this.settings.zoomPluginStrings.zoomIn+'" class="lg-zoom-in lg-icon"></button><button id="'+this.core.getIdName("lg-zoom-out")+'" type="button" aria-label="'+this.settings.zoomPluginStrings.zoomOut+'" class="lg-zoom-out lg-icon"></button>':"";this.settings.actualSize&&(e+='<button id="'+this.core.getIdName("lg-actual-size")+'" type="button" aria-label="'+this.settings.zoomPluginStrings.viewActualSize+'" class="'+this.settings.actualSizeIcons.zoomIn+' lg-icon"></button>'),this.core.outer.addClass("lg-use-transition-for-zoom"),this.core.$toolbar.first().append(e)},t.prototype.enableZoom=function(e){var n=this,r=this.settings.enableZoomAfter+e.detail.delay;this.$LG("body").first().hasClass("lg-from-hash")&&e.detail.delay?r=0:this.$LG("body").first().removeClass("lg-from-hash"),this.zoomableTimeout=setTimeout(function(){n.isImageSlide(n.core.index)&&(n.core.getSlideItem(e.detail.index).addClass("lg-zoomable"),e.detail.index===n.core.index&&n.setZoomEssentials())},r+30)},t.prototype.enableZoomOnSlideItemLoad=function(){this.core.LGel.on(_n.slideItemLoad+".zoom",this.enableZoom.bind(this))},t.prototype.getDragCords=function(e){return{x:e.pageX,y:e.pageY}},t.prototype.getSwipeCords=function(e){var n=e.touches[0].pageX,r=e.touches[0].pageY;return{x:n,y:r}},t.prototype.getDragAllowedAxises=function(e,n){if(!this.containerRect)return{allowX:!1,allowY:!1};var r=this.core.getSlideItem(this.core.index).find(".lg-image").first().get(),s=0,o=0,a=r.getBoundingClientRect();e?(s=r.offsetHeight*e,o=r.offsetWidth*e):n?(s=a.height+n*a.height,o=a.width+n*a.width):(s=a.height,o=a.width);var l=s>this.containerRect.height,c=o>this.containerRect.width;return{allowX:c,allowY:l}},t.prototype.setZoomEssentials=function(){this.containerRect=this.core.$content.get().getBoundingClientRect()},t.prototype.zoomImage=function(e,n,r,s){if(!(!this.containerRect||Math.abs(n)<=0)){var o=this.containerRect.width/2+this.containerRect.left,a=this.containerRect.height/2+this.containerRect.top+this.scrollTop,l,c;e===1&&(this.positionChanged=!1);var d=this.getDragAllowedAxises(0,n),h=d.allowY,u=d.allowX;this.positionChanged&&(l=this.left/(this.scale-n),c=this.top/(this.scale-n),this.pageX=o-l,this.pageY=a-c,this.positionChanged=!1);var m=this.getPossibleSwipeDragCords(n),g,f,p=o-this.pageX,y=a-this.pageY;if(e-n>1){var b=(e-n)/Math.abs(n);p=(n<0?-p:p)+this.left*(b+(n<0?-1:1)),y=(n<0?-y:y)+this.top*(b+(n<0?-1:1)),g=p/b,f=y/b}else{var b=(e-n)*n;g=p*b,f=y*b}r&&(u?this.isBeyondPossibleLeft(g,m.minX)?g=m.minX:this.isBeyondPossibleRight(g,m.maxX)&&(g=m.maxX):e>1&&(g<m.minX?g=m.minX:g>m.maxX&&(g=m.maxX)),h?this.isBeyondPossibleTop(f,m.minY)?f=m.minY:this.isBeyondPossibleBottom(f,m.maxY)&&(f=m.maxY):e>1&&(f<m.minY?f=m.minY:f>m.maxY&&(f=m.maxY))),this.setZoomStyles({x:g,y:f,scale:e}),this.left=g,this.top=f,s&&this.setZoomImageSize()}},t.prototype.resetImageTranslate=function(e){if(this.isImageSlide(e)){var n=this.core.getSlideItem(e).find(".lg-image").first();this.imageReset=!1,n.removeClass("reset-transition reset-transition-y reset-transition-x"),this.core.outer.removeClass("lg-actual-size"),n.css("width","auto").css("height","auto"),setTimeout(function(){n.removeClass("no-transition")},10)}},t.prototype.setZoomImageSize=function(){var e=this,n=this.core.getSlideItem(this.core.index).find(".lg-image").first();setTimeout(function(){var r=e.getCurrentImageActualSizeScale();e.scale>=r&&(n.addClass("no-transition"),e.imageReset=!0)},Ms),setTimeout(function(){var r=e.getCurrentImageActualSizeScale();if(e.scale>=r){var s=e.getDragAllowedAxises(e.scale);n.css("width",n.get().naturalWidth+"px").css("height",n.get().naturalHeight+"px"),e.core.outer.addClass("lg-actual-size"),s.allowX&&s.allowY?n.addClass("reset-transition"):s.allowX&&!s.allowY?n.addClass("reset-transition-x"):!s.allowX&&s.allowY&&n.addClass("reset-transition-y")}},Ms+50)},t.prototype.setZoomStyles=function(e){var n=this.core.getSlideItem(this.core.index).find(".lg-img-wrap").first(),r=this.core.getSlideItem(this.core.index).find(".lg-image").first(),s=this.core.outer.find(".lg-current .lg-dummy-img").first();this.scale=e.scale,r.css("transform","scale3d("+e.scale+", "+e.scale+", 1)"),s.css("transform","scale3d("+e.scale+", "+e.scale+", 1)");var o="translate3d("+e.x+"px, "+e.y+"px, 0)";n.css("transform",o)},t.prototype.setActualSize=function(e,n){var r=this;if(!this.zoomInProgress){this.zoomInProgress=!0;var s=this.core.galleryItems[this.core.index];this.resetImageTranslate(e),setTimeout(function(){if(!(!s.src||r.core.outer.hasClass("lg-first-slide-loading"))){var o=r.getCurrentImageActualSizeScale(),a=r.scale;r.core.outer.hasClass("lg-zoomed")?r.scale=1:r.scale=r.getScale(o),r.setPageCords(n),r.beginZoom(r.scale),r.zoomImage(r.scale,r.scale-a,!0,!0)}},50),setTimeout(function(){r.core.outer.removeClass("lg-grabbing").addClass("lg-grab")},60),setTimeout(function(){r.zoomInProgress=!1},Ms+110)}},t.prototype.getNaturalWidth=function(e){var n=this.core.getSlideItem(e).find(".lg-image").first(),r=this.core.galleryItems[e].width;return r?parseFloat(r):n.get().naturalWidth},t.prototype.getActualSizeScale=function(e,n){var r,s;return e>=n?(r=e/n,s=r||2):s=1,s},t.prototype.getCurrentImageActualSizeScale=function(){var e=this.core.getSlideItem(this.core.index).find(".lg-image").first(),n=e.get().offsetWidth,r=this.getNaturalWidth(this.core.index)||n;return this.getActualSizeScale(r,n)},t.prototype.getPageCords=function(e){var n={};if(e)n.x=e.pageX||e.touches[0].pageX,n.y=e.pageY||e.touches[0].pageY;else{var r=this.core.$content.get().getBoundingClientRect();n.x=r.width/2+r.left,n.y=r.height/2+this.scrollTop+r.top}return n},t.prototype.setPageCords=function(e){var n=this.getPageCords(e);this.pageX=n.x,this.pageY=n.y},t.prototype.manageActualPixelClassNames=function(){var e=this.core.getElementById("lg-actual-size");e.removeClass(this.settings.actualSizeIcons.zoomIn).addClass(this.settings.actualSizeIcons.zoomOut)},t.prototype.beginZoom=function(e){return this.core.outer.removeClass("lg-zoom-drag-transition lg-zoom-dragging"),e>1?(this.core.outer.addClass("lg-zoomed"),this.manageActualPixelClassNames()):this.resetZoom(),e>1},t.prototype.getScale=function(e){var n=this.getCurrentImageActualSizeScale();return e<1?e=1:e>n&&(e=n),e},t.prototype.init=function(){var e=this;if(this.settings.zoom){this.buildTemplates(),this.enableZoomOnSlideItemLoad();var n=null;this.core.outer.on("dblclick.lg",function(r){e.$LG(r.target).hasClass("lg-image")&&e.setActualSize(e.core.index,r)}),this.core.outer.on("touchstart.lg",function(r){var s=e.$LG(r.target);r.touches.length===1&&s.hasClass("lg-image")&&(n?(clearTimeout(n),n=null,r.preventDefault(),e.setActualSize(e.core.index,r)):n=setTimeout(function(){n=null},300))}),this.core.LGel.on(_n.containerResize+".zoom "+_n.rotateRight+".zoom "+_n.rotateLeft+".zoom "+_n.flipHorizontal+".zoom "+_n.flipVertical+".zoom",function(){if(!(!e.core.lgOpened||!e.isImageSlide(e.core.index)||e.core.touchAction)){var r=e.core.getSlideItem(e.core.index).find(".lg-img-wrap").first();e.top=0,e.left=0,e.setZoomEssentials(),e.setZoomSwipeStyles(r,{x:0,y:0}),e.positionChanged=!0}}),this.$LG(window).on("scroll.lg.zoom.global"+this.core.lgId,function(){e.core.lgOpened&&(e.scrollTop=e.$LG(window).scrollTop())}),this.core.getElementById("lg-zoom-out").on("click.lg",function(){if(e.isImageSlide(e.core.index)){var r=0;e.imageReset&&(e.resetImageTranslate(e.core.index),r=50),setTimeout(function(){var s=e.scale-e.settings.scale;s<1&&(s=1),e.beginZoom(s),e.zoomImage(s,-e.settings.scale,!0,!e.settings.infiniteZoom)},r)}}),this.core.getElementById("lg-zoom-in").on("click.lg",function(){e.zoomIn()}),this.core.getElementById("lg-actual-size").on("click.lg",function(){e.setActualSize(e.core.index)}),this.core.LGel.on(_n.beforeOpen+".zoom",function(){e.core.outer.find(".lg-item").removeClass("lg-zoomable")}),this.core.LGel.on(_n.afterOpen+".zoom",function(){e.scrollTop=e.$LG(window).scrollTop(),e.pageX=e.core.outer.width()/2,e.pageY=e.core.outer.height()/2+e.scrollTop,e.scale=1}),this.core.LGel.on(_n.afterSlide+".zoom",function(r){var s=r.detail.prevIndex;e.scale=1,e.positionChanged=!1,e.zoomInProgress=!1,e.resetZoom(s),e.resetImageTranslate(s),e.isImageSlide(e.core.index)&&e.setZoomEssentials()}),this.zoomDrag(),this.pinchZoom(),this.zoomSwipe(),this.zoomableTimeout=!1,this.positionChanged=!1,this.zoomInProgress=!1}},t.prototype.zoomIn=function(){if(this.isImageSlide(this.core.index)){var e=this.scale+this.settings.scale;this.settings.infiniteZoom||(e=this.getScale(e)),this.beginZoom(e),this.zoomImage(e,Math.min(this.settings.scale,e-this.scale),!0,!this.settings.infiniteZoom)}},t.prototype.resetZoom=function(e){this.core.outer.removeClass("lg-zoomed lg-zoom-drag-transition");var n=this.core.getElementById("lg-actual-size"),r=this.core.getSlideItem(e!==void 0?e:this.core.index);n.removeClass(this.settings.actualSizeIcons.zoomOut).addClass(this.settings.actualSizeIcons.zoomIn),r.find(".lg-img-wrap").first().removeAttr("style"),r.find(".lg-image").first().removeAttr("style"),this.scale=1,this.left=0,this.top=0,this.setPageCords()},t.prototype.getTouchDistance=function(e){return Math.sqrt((e.touches[0].pageX-e.touches[1].pageX)*(e.touches[0].pageX-e.touches[1].pageX)+(e.touches[0].pageY-e.touches[1].pageY)*(e.touches[0].pageY-e.touches[1].pageY))},t.prototype.pinchZoom=function(){var e=this,n=0,r=!1,s=1,o=0,a=this.core.getSlideItem(this.core.index);this.core.outer.on("touchstart.lg",function(l){if(a=e.core.getSlideItem(e.core.index),!!e.isImageSlide(e.core.index)&&l.touches.length===2){if(l.preventDefault(),e.core.outer.hasClass("lg-first-slide-loading"))return;s=e.scale||1,e.core.outer.removeClass("lg-zoom-drag-transition lg-zoom-dragging"),e.setPageCords(l),e.resetImageTranslate(e.core.index),e.core.touchAction="pinch",n=e.getTouchDistance(l)}}),this.core.$inner.on("touchmove.lg",function(l){if(l.touches.length===2&&e.core.touchAction==="pinch"&&(e.$LG(l.target).hasClass("lg-item")||a.get().contains(l.target))){l.preventDefault();var c=e.getTouchDistance(l),d=n-c;if(!r&&Math.abs(d)>5&&(r=!0),r){o=e.scale;var h=Math.max(1,s+-d*.02);e.scale=Math.round((h+Number.EPSILON)*100)/100;var u=e.scale-o;e.zoomImage(e.scale,Math.round((u+Number.EPSILON)*100)/100,!1,!1)}}}),this.core.$inner.on("touchend.lg",function(l){if(e.core.touchAction==="pinch"&&(e.$LG(l.target).hasClass("lg-item")||a.get().contains(l.target))){if(r=!1,n=0,e.scale<=1)e.resetZoom();else{var c=e.getCurrentImageActualSizeScale();if(e.scale>=c){var d=c-e.scale;d===0&&(d=.01),e.zoomImage(c,d,!1,!0)}e.manageActualPixelClassNames(),e.core.outer.addClass("lg-zoomed")}e.core.touchAction=void 0}})},t.prototype.touchendZoom=function(e,n,r,s,o){var a=n.x-e.x,l=n.y-e.y,c=Math.abs(a)/o+1,d=Math.abs(l)/o+1;c>2&&(c+=1),d>2&&(d+=1),a=a*c,l=l*d;var h=this.core.getSlideItem(this.core.index).find(".lg-img-wrap").first(),u={};u.x=this.left+a,u.y=this.top+l;var m=this.getPossibleSwipeDragCords();(Math.abs(a)>15||Math.abs(l)>15)&&(s&&(this.isBeyondPossibleTop(u.y,m.minY)?u.y=m.minY:this.isBeyondPossibleBottom(u.y,m.maxY)&&(u.y=m.maxY)),r&&(this.isBeyondPossibleLeft(u.x,m.minX)?u.x=m.minX:this.isBeyondPossibleRight(u.x,m.maxX)&&(u.x=m.maxX)),s?this.top=u.y:u.y=this.top,r?this.left=u.x:u.x=this.left,this.setZoomSwipeStyles(h,u),this.positionChanged=!0)},t.prototype.getZoomSwipeCords=function(e,n,r,s,o){var a={};if(s){if(a.y=this.top+(n.y-e.y),this.isBeyondPossibleTop(a.y,o.minY)){var l=o.minY-a.y;a.y=o.minY-l/6}else if(this.isBeyondPossibleBottom(a.y,o.maxY)){var c=a.y-o.maxY;a.y=o.maxY+c/6}}else a.y=this.top;if(r){if(a.x=this.left+(n.x-e.x),this.isBeyondPossibleLeft(a.x,o.minX)){var d=o.minX-a.x;a.x=o.minX-d/6}else if(this.isBeyondPossibleRight(a.x,o.maxX)){var h=a.x-o.maxX;a.x=o.maxX+h/6}}else a.x=this.left;return a},t.prototype.isBeyondPossibleLeft=function(e,n){return e>=n},t.prototype.isBeyondPossibleRight=function(e,n){return e<=n},t.prototype.isBeyondPossibleTop=function(e,n){return e>=n},t.prototype.isBeyondPossibleBottom=function(e,n){return e<=n},t.prototype.isImageSlide=function(e){var n=this.core.galleryItems[e];return this.core.getSlideType(n)==="image"},t.prototype.getPossibleSwipeDragCords=function(e){var n=this.core.getSlideItem(this.core.index).find(".lg-image").first(),r=this.core.mediaContainerPosition.bottom,s=n.get().getBoundingClientRect(),o=s.height,a=s.width;e&&(o=o+e*o,a=a+e*a);var l=(o-this.containerRect.height)/2,c=(this.containerRect.height-o)/2+r,d=(a-this.containerRect.width)/2,h=(this.containerRect.width-a)/2,u={minY:l,maxY:c,minX:d,maxX:h};return u},t.prototype.setZoomSwipeStyles=function(e,n){e.css("transform","translate3d("+n.x+"px, "+n.y+"px, 0)")},t.prototype.zoomSwipe=function(){var e=this,n={},r={},s=!1,o=!1,a=!1,l=new Date,c=new Date,d,h,u=this.core.getSlideItem(this.core.index);this.core.$inner.on("touchstart.lg",function(m){if(e.isImageSlide(e.core.index)&&(u=e.core.getSlideItem(e.core.index),(e.$LG(m.target).hasClass("lg-item")||u.get().contains(m.target))&&m.touches.length===1&&e.core.outer.hasClass("lg-zoomed"))){m.preventDefault(),l=new Date,e.core.touchAction="zoomSwipe",h=e.core.getSlideItem(e.core.index).find(".lg-img-wrap").first();var g=e.getDragAllowedAxises(0);a=g.allowY,o=g.allowX,(o||a)&&(n=e.getSwipeCords(m)),d=e.getPossibleSwipeDragCords(),e.core.outer.addClass("lg-zoom-dragging lg-zoom-drag-transition")}}),this.core.$inner.on("touchmove.lg",function(m){if(m.touches.length===1&&e.core.touchAction==="zoomSwipe"&&(e.$LG(m.target).hasClass("lg-item")||u.get().contains(m.target))){m.preventDefault(),e.core.touchAction="zoomSwipe",r=e.getSwipeCords(m);var g=e.getZoomSwipeCords(n,r,o,a,d);(Math.abs(r.x-n.x)>15||Math.abs(r.y-n.y)>15)&&(s=!0,e.setZoomSwipeStyles(h,g))}}),this.core.$inner.on("touchend.lg",function(m){if(e.core.touchAction==="zoomSwipe"&&(e.$LG(m.target).hasClass("lg-item")||u.get().contains(m.target))){if(m.preventDefault(),e.core.touchAction=void 0,e.core.outer.removeClass("lg-zoom-dragging"),!s)return;s=!1,c=new Date;var g=c.valueOf()-l.valueOf();e.touchendZoom(n,r,o,a,g)}})},t.prototype.zoomDrag=function(){var e=this,n={},r={},s=!1,o=!1,a=!1,l=!1,c,d,h,u;this.core.outer.on("mousedown.lg.zoom",function(m){if(e.isImageSlide(e.core.index)){var g=e.core.getSlideItem(e.core.index);if(e.$LG(m.target).hasClass("lg-item")||g.get().contains(m.target)){c=new Date,u=e.core.getSlideItem(e.core.index).find(".lg-img-wrap").first();var f=e.getDragAllowedAxises(0);l=f.allowY,a=f.allowX,e.core.outer.hasClass("lg-zoomed")&&e.$LG(m.target).hasClass("lg-object")&&(a||l)&&(m.preventDefault(),n=e.getDragCords(m),h=e.getPossibleSwipeDragCords(),s=!0,e.core.outer.removeClass("lg-grab").addClass("lg-grabbing lg-zoom-drag-transition lg-zoom-dragging"))}}}),this.$LG(window).on("mousemove.lg.zoom.global"+this.core.lgId,function(m){if(s){o=!0,r=e.getDragCords(m);var g=e.getZoomSwipeCords(n,r,a,l,h);e.setZoomSwipeStyles(u,g)}}),this.$LG(window).on("mouseup.lg.zoom.global"+this.core.lgId,function(m){if(s){if(d=new Date,s=!1,e.core.outer.removeClass("lg-zoom-dragging"),o&&(n.x!==r.x||n.y!==r.y)){r=e.getDragCords(m);var g=d.valueOf()-c.valueOf();e.touchendZoom(n,r,a,l,g)}o=!1}e.core.outer.removeClass("lg-grabbing").addClass("lg-grab")})},t.prototype.closeGallery=function(){this.resetZoom(),this.zoomInProgress=!1},t.prototype.destroy=function(){this.$LG(window).off(".lg.zoom.global"+this.core.lgId),this.core.LGel.off(".lg.zoom"),this.core.LGel.off(".zoom"),clearTimeout(this.zoomableTimeout),this.zoomableTimeout=!1},t})();const Hf={ref:"gallery-container",class:"lightgallery-wrapper"},Wf={},ja=i.defineComponent({...Wf,__name:"lightgallery",props:{settings:{},onAfterAppendSlide:{type:Function},onInit:{type:Function},onHasVideo:{type:Function},onContainerResize:{type:Function},onAfterAppendSubHtml:{type:Function},onBeforeOpen:{type:Function},onAfterOpen:{type:Function},onSlideItemLoad:{type:Function},onBeforeSlide:{type:Function},onAfterSlide:{type:Function},onPosterClick:{type:Function},onDragStart:{type:Function},onDragMove:{type:Function},onDragEnd:{type:Function},onBeforeNextSlide:{type:Function},onBeforePrevSlide:{type:Function},onBeforeClose:{type:Function},onAfterClose:{type:Function},onRotateLeft:{type:Function},onRotateRight:{type:Function},onFlipHorizontal:{type:Function},onFlipVertical:{type:Function}},setup(t){const e=t,n={lgAfterAppendSlide:e.onAfterAppendSlide,lgInit:e.onInit,lgHasVideo:e.onHasVideo,lgContainerResize:e.onContainerResize,lgAfterAppendSubHtml:e.onAfterAppendSubHtml,lgBeforeOpen:e.onBeforeOpen,lgAfterOpen:e.onAfterOpen,lgSlideItemLoad:e.onSlideItemLoad,lgBeforeSlide:e.onBeforeSlide,lgAfterSlide:e.onAfterSlide,lgPosterClick:e.onPosterClick,lgDragStart:e.onDragStart,lgDragMove:e.onDragMove,lgDragEnd:e.onDragEnd,lgBeforeNextSlide:e.onBeforeNextSlide,lgBeforePrevSlide:e.onBeforePrevSlide,lgBeforeClose:e.onBeforeClose,lgAfterClose:e.onAfterClose,lgRotateLeft:e.onRotateLeft,lgRotateRight:e.onRotateRight,lgFlipHorizontal:e.onFlipHorizontal,lgFlipVertical:e.onFlipVertical},r=i.useTemplateRef("gallery-container"),s=i.ref(null);return i.onMounted(async()=>{if(!r.value)return;const o=await import("lightgallery");s.value=o.default(r.value,{...e.settings}),O.forOwn(n,(a,l)=>{var c;a&&((c=r.value)==null||c.addEventListener(l,a))})}),i.onBeforeUnmount(()=>{var o;s.value&&((o=s.value)==null||o.destroy(),s.value=null)}),(o,a)=>(i.openBlock(),i.createElementBlock("div",Hf,[i.renderSlot(o.$slots,"default")],512))}}),rt=class rt{static init(){rt.isInitialized||(rt.isInitialized=!0,rt.windowResizeHandler(),window.addEventListener("resize",rt.windowResizeHandler))}static destroy(){window.removeEventListener("resize",rt.windowResizeHandler),rt.isInitialized=!1}static getDeviceTypeByResolution(){const e=G.AppConfigProvider.getConfig().deviceTypeByResolution;return window.innerWidth<e.tablet?Ue.phone:window.innerWidth<e.laptop?Ue.tablet:Ue.laptop}static initRefDependingOnDeviceResolution(e,n,r){const s=i.ref(r);return rt.setRefValueDependingOnDeviceResolution(s,e,n,r),rt.refsDependingOnDeviceResolution.push({r:s,phoneValue:e,tabletValue:n,defaultValue:r}),s}static isPhoneDevice(){return rt.getDeviceTypeByResolution()===Ue.phone}static isTabletDevice(){return rt.getDeviceTypeByResolution()===Ue.tablet}static isLaptopDevice(){return rt.getDeviceTypeByResolution()===Ue.laptop}static setRefValueDependingOnDeviceResolution(e,n,r,s){switch(rt.getDeviceTypeByResolution()){case Ue.phone:e.value=n;break;case Ue.tablet:e.value=r;break;default:e.value=s;break}}static windowResizeHandler(){O.forEach(rt.refsDependingOnDeviceResolution,e=>{rt.setRefValueDependingOnDeviceResolution(e.r,e.phoneValue,e.tabletValue,e.defaultValue)})}};x(rt,"isInitialized",!1),x(rt,"refsDependingOnDeviceResolution",[]);let bt=rt;const jf=["href"],qf=["src","alt"],Xf={},qa=i.defineComponent({...Xf,__name:"image-gallery",props:{images:{}},setup(t,{expose:e}){const n=i.ref(!1),r=i.ref(!1),s=i.ref({plugins:[zf,Df],addClass:"sc-lg-container",licenseKey:"0000-0000-000-0000",strings:{closeGallery:"Закрыть",download:"Скачать",mediaLoadingFailed:"Ошибка загрузки контента...",nextSlide:"Следующее изображение",playVideo:"Воспроизвести видео",previousSlide:"Предыдущее изображение",toggleMaximize:"Расширить"}}),o=()=>window.innerWidth*(bt.getDeviceTypeByResolution()===Ue.phone?.7:.8),a=i.ref(o()),l=()=>{a.value=o()},c=()=>{n.value=!0};return i.onUnmounted(()=>{window.removeEventListener("resize",l)}),e({show:c}),window.addEventListener("resize",l),(d,h)=>{const u=Wa,m=z.NPopover;return i.openBlock(),i.createBlock(m,{trigger:"manual",show:n.value,class:"sc-image",placement:"top-start",onClickoutside:h[3]||(h[3]=()=>{r.value||(n.value=!1)})},{trigger:i.withCtx(()=>[i.createElementVNode("div",{class:"inline-flex",onClick:h[0]||(h[0]=g=>n.value=!n.value)},[i.renderSlot(d.$slots,"default",{},()=>[i.createVNode(u)])])]),default:i.withCtx(()=>[i.createVNode(ja,{settings:s.value,style:i.normalizeStyle(`max-width: ${a.value}px`),class:"flex flex-row overflow-x-scroll",onAfterOpen:h[1]||(h[1]=()=>{r.value=!0}),onAfterClose:h[2]||(h[2]=()=>{r.value=!1,n.value=!1})},{default:i.withCtx(()=>[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(t.images,(g,f)=>(i.openBlock(),i.createElementBlock("a",{key:f,href:g.image},[i.createElementVNode("img",{src:g.preview,alt:`Изображение #${f+1}`},null,8,qf)],8,jf))),128))]),_:1},8,["settings","style"])]),_:3},8,["show"])}}}),Yf={class:"flex flex-col text-sm"},Uf={},Gf=i.defineComponent({...Uf,__name:"product-stock-count",props:{product:{}},setup(t){return(e,n)=>{const r=Fs,s=z.NPopover;return i.openBlock(),i.createBlock(s,{trigger:"click",placement:"top-start",class:"sc-stock-count"},{trigger:i.withCtx(()=>[i.renderSlot(e.$slots,"default",{},()=>[i.createVNode(r)])]),default:i.withCtx(()=>[i.createElementVNode("div",Yf,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(t.product.stockCount,(o,a)=>(i.openBlock(),i.createElementBlock("span",{key:a},i.toDisplayString(o.warehouse.name)+": "+i.toDisplayString(o.count)+" "+i.toDisplayString(t.product.quantityUnit),1))),128))])]),_:3})}}}),Kf={class:"flex flex-row justify-between"},Zf={key:0},Qf={class:"ml-2 align-sub"},Jf={class:"flex cursor-pointer flex-row gap-2 whitespace-nowrap"},eg={class:"@container"},tg={class:"text-sc-dark-grey @sm:grid-cols-2 @2xl:grid-cols-3 grid grid-cols-1 gap-1 text-sm"},ng={key:0,class:"sc-supplier-sku col-span-2 whitespace-nowrap text-wrap sm:col-span-3"},ig={class:"text-sc-dark-grey"},rg={key:1,class:"sc-product-code col-start-1 whitespace-nowrap"},sg={class:"text-gray-600"},og={class:"flex cursor-pointer flex-row gap-1 whitespace-nowrap"},ag={key:3,class:"underline decoration-dashed"},lg={key:4,class:"sc-product-pack whitespace-nowrap"},cg={class:"text-gray-600"},dg={key:5,class:"sc-product-planning-incoming-date col-span-2 col-start-1 mt-1.5 text-wrap"},hg={class:"text-gray-600"},ug={key:0,class:"mt-3 flex flex-row gap-3 pb-2 text-base xl:text-lg"},fg={key:0},gg={class:"sc-product-properties m-0 mt-3 list-inside list-disc p-0 pl-1.5 text-xs text-gray-500"},mg={},tr=i.defineComponent({...mg,__name:"product-name",props:{product:{},eventEmitter:{},showSlugs:{type:Boolean,default:!1},showProperties:{type:Boolean,default:!1},showCode:{type:Boolean,default:!0},showProductCosts:{type:[Boolean,Function],default:!1},showPlanningDates:{type:Boolean,default:!0},showPriceHistory:{type:Boolean,default:!1},showCostDate:{type:Boolean,default:!1},allowNameClick:{type:[Boolean,Function],default:!1},allowPriceClick:{type:[Boolean,Function],default:!1},currencyRates:{default:void 0},showProductAddToCartButton:{type:[Boolean,String,Function],default:!1},showProductEditButton:{type:[Boolean,String,Function],default:!1},showProductRequiredButton:{type:[Boolean,String,Function],default:!1},productContextButtonsConfig:{type:Function,default:void 0}},setup(t,{expose:e}){const n=t,r=i.computed(()=>O.isFunction(n.showProductCosts)?n.showProductCosts(n.product):n.showProductCosts),s=i.computed(()=>O.sortBy(n.product.priceCoefficients,["coefficient.slug"])),o=i.computed(()=>{var h,u;return(u=(h=n.product)==null?void 0:h.properties)==null?void 0:u.planingIncomingDate}),a=i.useTemplateRef("image-gallery"),l=()=>{var h;(h=a.value)==null||h.show()},c=i.computed(()=>O.isFunction(n.allowNameClick)?n.allowNameClick(n.product):n.allowNameClick),d=()=>{var h;c.value&&((h=n.eventEmitter)==null||h.emit("product:name-click",{product:n.product,exposedMethods:{showProductImagesPreview:l}}))};return e({showProductImagesPreview:l}),(h,u)=>{var b,_,C,S,v;const m=Wa,g=z.NText,f=Ha,p=Fs,y=z.NScrollbar;return i.openBlock(),i.createElementBlock("div",null,[i.createElementVNode("div",Kf,[i.createVNode(g,{type:"info",class:"sc-product-name text-balance text-base font-medium"},{default:i.withCtx(()=>[i.createElementVNode("span",{class:i.normalizeClass({"cursor-pointer":c.value&&t.eventEmitter}),onClick:d},i.toDisplayString(t.product.name),3),t.product.onOrder?(i.openBlock(),i.createElementBlock("span",Zf," [Под заказ] ")):i.createCommentVNode("",!0),i.createElementVNode("span",Qf,[t.product.images&&t.product.images.length>0?(i.openBlock(),i.createBlock(qa,{key:0,ref:"image-gallery",images:t.product.images},{default:i.withCtx(()=>[i.createElementVNode("div",Jf,[i.createVNode(m)])]),_:1},8,["images"])):i.createCommentVNode("",!0)])]),_:1}),t.showProductAddToCartButton||t.showProductEditButton||t.showProductRequiredButton||((b=t.productContextButtonsConfig)==null?void 0:b.length)>0?(i.openBlock(),i.createBlock(f,{key:0,product:t.product,"event-emitter":t.eventEmitter,"show-product-add-to-cart-button":t.showProductAddToCartButton,"show-product-edit-button":t.showProductEditButton,"show-product-required-button":t.showProductRequiredButton,"product-context-buttons-config":t.productContextButtonsConfig},null,8,["product","event-emitter","show-product-add-to-cart-button","show-product-edit-button","show-product-required-button","product-context-buttons-config"])):i.createCommentVNode("",!0)]),i.createElementVNode("div",eg,[i.createElementVNode("div",tg,[t.product.supplierSku?(i.openBlock(),i.createElementBlock("div",ng,[u[0]||(u[0]=i.createTextVNode(" Артикул производителя/поставщика: ",-1)),i.createElementVNode("span",ig,i.toDisplayString(t.product.supplierSku),1)])):i.createCommentVNode("",!0),t.showCode?(i.openBlock(),i.createElementBlock("span",rg,[u[1]||(u[1]=i.createTextVNode(" Артикул: ",-1)),i.createElementVNode("span",sg,i.toDisplayString(t.product.code),1)])):i.createCommentVNode("",!0),t.product.stockCount&&t.product.stockCount.length>0?(i.openBlock(),i.createBlock(Gf,{key:2,product:t.product},{default:i.withCtx(()=>[i.createElementVNode("span",og,[u[2]||(u[2]=i.createElementVNode("span",{class:"underline decoration-dashed"},"В наличии",-1)),i.createVNode(p,{class:"mt-0.5"})])]),_:1},8,["product"])):(i.openBlock(),i.createElementBlock("span",ag," Нет в наличии ")),(C=(_=t.product)==null?void 0:_.properties)!=null&&C.pack?(i.openBlock(),i.createElementBlock("span",lg,[u[3]||(u[3]=i.createTextVNode(" Норма упаковки: ",-1)),i.createElementVNode("span",cg,i.toDisplayString((v=(S=t.product)==null?void 0:S.properties)==null?void 0:v.pack),1)])):i.createCommentVNode("",!0),t.showPlanningDates&&o.value?(i.openBlock(),i.createElementBlock("span",dg,[u[4]||(u[4]=i.createTextVNode(" Планируемая дата поступления на основной склад: ",-1)),i.createElementVNode("span",hg,i.toDisplayString(o.value),1)])):i.createCommentVNode("",!0)])]),i.createVNode(y,{"x-scrollable":""},{default:i.withCtx(()=>[r.value?(i.openBlock(),i.createElementBlock("div",ug,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(s.value,B=>(i.openBlock(),i.createBlock(Er,{key:B.coefficient.slug,product:t.product,"cost-field-name":B.coefficient.slug??"","event-emitter":t.eventEmitter,"allow-price-click":t.allowPriceClick,"show-tag":!0,"show-price-history":t.showPriceHistory,"currency-rates":t.currencyRates},null,8,["product","cost-field-name","event-emitter","allow-price-click","show-price-history","currency-rates"]))),128)),i.createVNode(Er,{product:t.product,"event-emitter":t.eventEmitter,"allow-price-click":t.allowPriceClick,"show-tag":!0,"show-quantity-unit":!0,"show-cost-date":t.showCostDate,"show-price-history":t.showPriceHistory,"currency-rates":t.currencyRates,"cost-field-name":"cost","additional-through-field-name":"retailCost",style:{"background-color":"var(--n-merged-td-color)"},class:"sticky right-0 border-0 border-l-2 border-solid border-gray-300 pl-2"},null,8,["product","event-emitter","allow-price-click","show-cost-date","show-price-history","currency-rates"])])):i.createCommentVNode("",!0)]),_:1}),t.showSlugs||t.showProperties?(i.openBlock(),i.createElementBlock("div",fg,[i.createElementVNode("ul",gg,[t.showSlugs?(i.openBlock(!0),i.createElementBlock(i.Fragment,{key:0},i.renderList({id:t.product.id,slug:t.product.slug},(B,k)=>(i.openBlock(),i.createElementBlock("li",{key:k}," ("+i.toDisplayString(k)+"): "+i.toDisplayString(B),1))),128)):i.createCommentVNode("",!0),t.showProperties?(i.openBlock(!0),i.createElementBlock(i.Fragment,{key:1},i.renderList(t.product.properties,(B,k)=>(i.openBlock(),i.createElementBlock("li",{key:k}," ("+i.toDisplayString(k)+"): "+i.toDisplayString(B),1))),128)):i.createCommentVNode("",!0)])])):i.createCommentVNode("",!0)])}}}),pg=(t,e,n)=>({key:t,title:e,className:"align-top",resizable:!0,render:r=>i.h(Er,{product:r,costFieldName:t,eventEmitter:n.eventEmitter,allowPriceClick:n.allowPriceClick,currencyRates:n.currencyRates})}),yg=(t,e)=>{if(t.length===0)return[];const n=[],r={};switch(O.isNil(e.isProductItemSelected)||n.push({key:"checkbox",title:"",className:"align-top",width:"32",render:s=>{var o,a;return i.h(z.NCheckbox,{checked:!!((o=e.isProductItemSelected)!=null&&o.call(e,s)),disabled:((a=e.isProductItemSelected)==null?void 0:a.call(e,s))==="disabled",onUpdateChecked:l=>{e.eventEmitter.emit("product:checked",{product:s,checked:l})}})}}),bt.getDeviceTypeByResolution()){case Ue.phone:case Ue.tablet:n.push({key:"name",title:"Наименование",className:"align-top",render:s=>i.h(tr,{product:s,eventEmitter:e.eventEmitter,showSlugs:e.showSlugs,showProperties:e.showProperties,showProductCosts:e.showProductCosts,allowNameClick:e.allowNameClick,allowPriceClick:e.allowPriceClick,showPriceHistory:e.showPriceHistory,showCostDate:e.showCostDate,showProductAddToCartButton:e.showProductAddToCartButton,showProductEditButton:e.showProductEditButton,showProductRequiredButton:e.showProductRequiredButton,currencyRates:e.currencyRates,productContextButtonsConfig:e.productContextButtonsConfig})});break;default:n.push({key:"name",title:"Наименование",className:"align-top",resizable:!0,render:s=>i.h(tr,{product:s,eventEmitter:e.eventEmitter,showSlugs:e.showSlugs,showProperties:e.showProperties,allowNameClick:e.allowNameClick,allowPriceClick:e.allowPriceClick,showPriceHistory:e.showPriceHistory,showCostDate:e.showCostDate,currencyRates:e.currencyRates})}),e.showProductCosts&&(O.forEach(t,s=>{O.forEach(s.priceCoefficients,o=>{r[o.coefficient.slug??""]||(r[o.coefficient.slug??""]=o.coefficient)})}),O.forEach(O.sortBy(r,["slug"]),s=>{n.push(pg(s.slug??"",s.name,e))}),n.push({key:"cost",title:"Цена",className:"align-top",resizable:!0,render:s=>i.h(Er,{product:s,costFieldName:"cost",additionalThroughFieldName:"retailCost",eventEmitter:e.eventEmitter,allowPriceClick:e.allowPriceClick,showQuantityUnit:!0,showPriceHistory:e.showPriceHistory,showCostDate:e.showCostDate,currencyRates:e.currencyRates})})),(e.showProductEditButton||e.showProductRequiredButton||e.showProductAddToCartButton||!O.isNil(e.productContextButtonsConfig))&&n.push({key:"actions",title:"",className:"align-top",width:"50",render:s=>i.h(Ha,{product:s,eventEmitter:e.eventEmitter,showProductAddToCartButton:e.showProductAddToCartButton,showProductEditButton:e.showProductEditButton,showProductRequiredButton:e.showProductRequiredButton,productContextButtonsConfig:e.productContextButtonsConfig})});break}return n},bg={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function _g(t,e){return i.openBlock(),i.createElementBlock("svg",bg,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"none",d:"M296 64h-80a7.91 7.91 0 0 0-8 8v24h96V72a7.91 7.91 0 0 0-8-8"},null,-1),i.createElementVNode("path",{fill:"currentColor",d:"M432 96h-96V72a40 40 0 0 0-40-40h-80a40 40 0 0 0-40 40v24H80a16 16 0 0 0 0 32h17l19 304.92c1.42 26.85 22 47.08 48 47.08h184c26.13 0 46.3-19.78 48-47l19-305h17a16 16 0 0 0 0-32M192.57 416H192a16 16 0 0 1-16-15.43l-8-224a16 16 0 1 1 32-1.14l8 224A16 16 0 0 1 192.57 416M272 400a16 16 0 0 1-32 0V176a16 16 0 0 1 32 0Zm32-304h-96V72a7.91 7.91 0 0 1 8-8h80a7.91 7.91 0 0 1 8 8Zm32 304.57A16 16 0 0 1 320 416h-.58A16 16 0 0 1 304 399.43l8-224a16 16 0 1 1 32 1.14Z"},null,-1)])])}const Xa=i.markRaw({name:"ion-trash",render:_g}),wg={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function xg(t,e){return i.openBlock(),i.createElementBlock("svg",wg,[...e[0]||(e[0]=[i.createElementVNode("path",{d:"M448 224H288V64h-64v160H64v64h160v160h64V288h160z",fill:"currentColor"},null,-1)])])}const Ya=i.markRaw({name:"ion-plus",render:xg}),vg={key:0,class:"flex w-fit items-center gap-2"},kg={key:1,class:"flex flex-wrap gap-1"},Cg={key:0},Sg={},nr=i.defineComponent({...Sg,__name:"configurators-product-info",props:{isProductSearching:{type:Boolean,default:!1},product:{default:void 0}},setup(t){const e=t,n=i.computed(()=>{var r,s;return(s=(r=e.product)==null?void 0:r.properties)==null?void 0:s.planingProductionDate});return(r,s)=>{const o=z.NSpin;return t.isProductSearching?(i.openBlock(),i.createElementBlock("div",vg,[i.createVNode(o,{size:17,class:"w-fit"}),s[0]||(s[0]=i.createElementVNode("div",null,"Выполняется поиск товара ...",-1))])):t.product.isNewRec()?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("div",kg,[i.createElementVNode("div",null,i.toDisplayString(t.product.code)+" - "+i.toDisplayString(t.product.name)+" - "+i.toDisplayString(t.product.costRub.toLocaleString())+" ₽ / "+i.toDisplayString(t.product.unit),1),n.value?(i.openBlock(),i.createElementBlock("div",Cg,"(Планируемая дата производства: "+i.toDisplayString(n.value)+")",1)):i.createCommentVNode("",!0)]))}}}),Bg={class:"flex flex-col gap-4"},Tg={class:"flex flex-col gap-2"},Rg={class:"mt-8 font-bold"},$g={class:"grid grow grid-cols-2 items-start gap-2"},Eg={class:"text-sm"},Ng={class:"font-medium"},Pg={key:0,class:"text-red-500"},Fg={key:2,class:"text-red-500 text-sm mb-2"},Mg={class:"flex flex-col gap-4"},Ag={key:0},Vg={class:"text-lg font-semibold"},Og={class:"flex gap-3"},Ig={},Ua=i.defineComponent({...Ig,__name:"kozyrek-configurator-params-form",props:{value:{},settings:{},previewParams:{},isProductSearching:{type:Boolean,default:!1},isSubmitProcessing:{type:Boolean,default:!1},validation:{default:void 0},selectTemplateIndex:{}},emits:["update:value","update:params","submit","click:add-line","click:remove-line","click:save-template"],setup(t,{emit:e}){const n=t,r=e,s=i.ref(structuredClone(i.toRaw(n.value.configuratorParams))),o=i.ref(!1),a=i.computed(()=>{var y;const{length:m}=s.value,{quantity:g}=n.value,f=((y=n.value.product)==null?void 0:y.costRub)||0;if(!m||!g||f===0)return null;const p=m/100;return(f*g*p).toLocaleString("ru-ru",{minimumFractionDigits:2})}),l=i.computed(()=>O.reduce(s.value.linesWidths,(m,g)=>m+(g||0),0)),c=i.computed(()=>{const m=l.value;return m>=n.settings.stripMinWidth&&m<=n.settings.stripMaxWidth}),d=i.computed(()=>{const m=O.every(s.value.linesWidths,y=>!!(y&&y>0)),g=O.every(s.value.linesAngles,y=>!O.isNil(y)),f=!!(n.value.quantity&&n.value.quantity>0),p=s.value.length>0&&s.value.length>0;return m&&g&&f&&p&&c.value}),h=()=>{d.value&&(r("update:params",s.value),u("configuratorParams",s.value))},u=(m,g)=>{const f=new G.CartItemBase(n.value);f[m]=g,r("update:value",f)};return i.watch(()=>n.value.configuratorParams,m=>{s.value=O.cloneDeep(i.toRaw(m))},{deep:!0}),i.watch(()=>n.previewParams,m=>{s.value.linesWidths=m.linesWidths,s.value.linesAngles=m.linesAngles},{deep:!0}),(m,g)=>{const f=Ya,p=Xa,y=z.NInput;return i.openBlock(),i.createBlock(i.unref(z.NForm),{class:"grid gap-2 md:grid-cols-2 md:gap-6"},{default:i.withCtx(()=>{var b,_,C,S,v,B,k,R,$,P;return[i.createElementVNode("div",Bg,[g[9]||(g[9]=i.createElementVNode("span",{class:"w-full font-bold"},"Ширина участка, мм / Угол сгиба, ° (А)",-1)),t.settings.startTailConfigs&&t.settings.startTailConfigs.length>0?(i.openBlock(),i.createBlock(i.unref(z.NFormItem),{key:0,required:!0,"show-feedback":!1,label:"Тип стартового капельника"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NSelect),{value:s.value.startTailType,"onUpdate:value":[g[0]||(g[0]=I=>s.value.startTailType=I),h],options:t.settings.startTailConfigs.map(({label:I},V)=>({label:I,value:V})),placeholder:"Тип стартового капельника"},null,8,["value","options"])]),_:1})):i.createCommentVNode("",!0),i.createElementVNode("div",Tg,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(s.value.linesAngles,(I,V)=>{var A,L,D,ee,E,N;return i.openBlock(),i.createElementBlock("div",{key:V,class:"flex items-start gap-2"},[i.createElementVNode("div",Rg,i.toDisplayString(V+1),1),i.createElementVNode("div",$g,[i.createVNode(i.unref(z.NFormItem),{label:"Ширина, мм",required:!0,feedback:((A=t.validation[`lines_widths[${V+1}]`])==null?void 0:A.feedback)||"","show-feedback":((L=t.validation[`lines_widths[${V+1}]`])==null?void 0:L.showFeedback)||!1,"validation-status":(D=t.validation[`lines_widths[${V+1}]`])==null?void 0:D.validationStatus},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInputNumber),{value:s.value.linesWidths[V],"onUpdate:value":[H=>s.value.linesWidths[V]=H,h],min:s.value.linesWidths.length>1?t.settings.minLineWidth:t.settings.stripMinWidth,max:t.settings.maxLineWidth,step:t.settings.lineWidthStep,validator:H=>!H||H>=(s.value.linesWidths.length>1?t.settings.minLineWidth:t.settings.stripMinWidth)&&H<=t.settings.maxLineWidth&&H%t.settings.lineWidthStep===0,class:"w-full"},null,8,["value","onUpdate:value","min","max","step","validator"])]),_:2},1032,["feedback","show-feedback","validation-status"]),i.createVNode(i.unref(z.NFormItem),{label:"Угол сгиба, °",required:!0,feedback:((ee=t.validation[`lines_angles[${V+1}]`])==null?void 0:ee.feedback)||"","show-feedback":((E=t.validation[`lines_angles[${V+1}]`])==null?void 0:E.showFeedback)||!1,"validation-status":(N=t.validation[`lines_angles[${V+1}]`])==null?void 0:N.validationStatus},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInputNumber),{value:s.value.linesAngles[V],"onUpdate:value":[H=>s.value.linesAngles[V]=H,h],min:t.settings.minLineAngle,max:t.settings.maxLineAngle,step:t.settings.lineAngleStep,validator:H=>!H||H%t.settings.lineAngleStep===0,class:"w-full"},null,8,["value","onUpdate:value","min","max","step","validator"])]),_:2},1032,["feedback","show-feedback","validation-status"])]),i.createVNode(i.unref(z.NFormItem),{label:void 0,"show-feedback":!1,required:!0,class:"shrink-0"},{default:i.withCtx(()=>[t.settings.showOnlyTemplates?i.createCommentVNode("",!0):(i.openBlock(),i.createBlock(i.unref(z.NButton),{key:0,size:"medium",onClick:H=>r("click:add-line",V)},{default:i.withCtx(()=>[i.createVNode(f)]),_:1},8,["onClick"])),t.settings.showOnlyTemplates?i.createCommentVNode("",!0):(i.openBlock(),i.createBlock(i.unref(z.NButton),{key:1,disabled:s.value.linesWidths.length===1,size:"medium",class:"ml-2",onClick:H=>r("click:remove-line",V)},{default:i.withCtx(()=>[i.createVNode(p)]),_:1},8,["disabled","onClick"]))]),_:2},1024)])}),128))]),t.settings.endTailConfigs&&t.settings.endTailConfigs.length>0?(i.openBlock(),i.createBlock(i.unref(z.NFormItem),{key:1,label:"Тип конечного капельника","show-feedback":!1,required:!0},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NSelect),{value:s.value.endTailType,"onUpdate:value":[g[1]||(g[1]=I=>s.value.endTailType=I),h],options:t.settings.endTailConfigs.map(({label:I},V)=>({label:I,value:V})),placeholder:"Тип конечного капельника"},null,8,["value","options"])]),_:1})):i.createCommentVNode("",!0),i.createVNode(nr,{"is-product-searching":t.isProductSearching,product:t.value.product},null,8,["is-product-searching","product"]),i.createElementVNode("div",Eg,[i.createElementVNode("div",Ng,"Суммарная ширина участков: "+i.toDisplayString(l.value)+" мм",1),c.value?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("div",Pg," Должна быть от "+i.toDisplayString(t.settings.stripMinWidth)+" до "+i.toDisplayString(t.settings.stripMaxWidth)+" мм ",1))]),d.value?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("div",Fg," Пожалуйста, заполните все обязательные поля корректно. ")),t.settings.allowSaveTemplates&&t.selectTemplateIndex===((b=t.settings.allTemplates)==null?void 0:b.length)-1?(i.openBlock(),i.createBlock(i.unref(z.NButton),{key:3,type:"tertiary",class:"self-start",loading:o.value,onClick:g[2]||(g[2]=I=>r("click:save-template"))},{default:i.withCtx(()=>[...g[8]||(g[8]=[i.createTextVNode(" Сохранить шаблон ",-1)])]),_:1},8,["loading"])):i.createCommentVNode("",!0)]),i.createElementVNode("div",Mg,[i.createVNode(i.unref(z.NFormItem),{label:"С какой стороны изделие будет иметь цвет","show-feedback":!1},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NSelect),{value:s.value.colorSide,"onUpdate:value":[g[3]||(g[3]=I=>s.value.colorSide=I),h],options:[{label:"Цвет сверху",value:"top"},{label:" Цвет снизу",value:"bottom"}],placeholder:"С какой стороны изделие будет иметь цвет"},null,8,["value"])]),_:1}),i.createVNode(i.unref(z.NFormItem),{required:!0,"show-feedback":((_=t.validation.length)==null?void 0:_.showFeedback)||!1,feedback:((C=t.validation.length)==null?void 0:C.feedback)||"","validation-status":(S=t.validation.length)==null?void 0:S.validationStatus,label:`Метраж${t.settings.stripMinLength?" от "+t.settings.stripMinLength:""}${t.settings.stripMaxLength?" до "+t.settings.stripMaxLength:""} мм`},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInputNumber),{value:s.value.length,"onUpdate:value":[g[4]||(g[4]=I=>s.value.length=I),h],required:!0,max:t.settings.stripMaxLength||void 0,min:t.settings.stripMinLength,step:t.settings.lengthStep,validator:I=>!I||I%t.settings.lengthStep===0,placeholder:"Введите метраж",class:"w-full"},null,8,["value","max","min","step","validator"])]),_:1},8,["show-feedback","feedback","validation-status","label"]),i.createVNode(i.unref(z.NFormItem),{required:!0,"show-feedback":((v=t.validation.quantity)==null?void 0:v.showFeedback)||!1,feedback:((B=t.validation.quantity)==null?void 0:B.feedback)||"","validation-status":(k=t.validation.quantity)==null?void 0:k.validationStatus,label:"Количество"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInputNumber),{value:t.value.quantity,"onUpdate:value":g[5]||(g[5]=I=>t.value.quantity=I),min:1,validator:I=>Number.isInteger(I),placeholder:"Введите количество",class:"w-full"},null,8,["value","validator"])]),_:1},8,["show-feedback","feedback","validation-status"]),i.createVNode(i.unref(z.NFormItem),{required:!1,"show-feedback":((R=t.validation.marker)==null?void 0:R.showFeedback)||!1,feedback:(($=t.validation.marker)==null?void 0:$.feedback)||"","validation-status":(P=t.validation.marker)==null?void 0:P.validationStatus,label:"Маркировка"},{default:i.withCtx(()=>[i.createVNode(y,{value:t.value.marker,"onUpdate:value":g[6]||(g[6]=I=>t.value.marker=I),placeholder:"Введите маркировку"},null,8,["value"])]),_:1},8,["show-feedback","feedback","validation-status"]),a.value?(i.openBlock(),i.createElementBlock("div",Ag,[g[10]||(g[10]=i.createTextVNode(" ИТОГО: ",-1)),i.createElementVNode("span",Vg,i.toDisplayString(a.value)+" ₽",1)])):i.createCommentVNode("",!0),i.createElementVNode("div",Og,[i.createVNode(i.unref(z.NButton),{loading:t.isSubmitProcessing,disabled:!d.value,type:"primary",class:"self-start",onClick:g[7]||(g[7]=I=>r("submit",t.value))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(t.value.isNewRec()?"В корзину":"Изменить"),1)]),_:1},8,["loading","disabled"])])])]}),_:1})}}});var Ga=Object.defineProperty,zg=Object.defineProperties,Lg=Object.getOwnPropertyDescriptors,Ka=Object.getOwnPropertySymbols,Dg=Object.prototype.hasOwnProperty,Hg=Object.prototype.propertyIsEnumerable,Za=t=>{throw TypeError(t)},As=(t,e,n)=>e in t?Ga(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Vs=(t,e)=>{for(var n in e||(e={}))Dg.call(e,n)&&As(t,n,e[n]);if(Ka)for(var n of Ka(e))Hg.call(e,n)&&As(t,n,e[n]);return t},Os=(t,e)=>zg(t,Lg(e)),Qa=(t,e)=>{for(var n in e)Ga(t,n,{get:e[n],enumerable:!0})},w=(t,e,n)=>As(t,typeof e!="symbol"?e+"":e,n),Ja=(t,e,n)=>e.has(t)||Za("Cannot "+n),Tt=(t,e,n)=>(Ja(t,e,"read from private field"),n?n.call(t):e.get(t)),el=(t,e,n)=>e.has(t)?Za("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),Wg=(t,e,n,r)=>(Ja(t,e,"write to private field"),e.set(t,n),n),_t={Image:null,isHeadless:!1,shim:function(t,e){return t.tagName=t.nodeName=e||"canvas",t.nodeType=1,t.getAttribute=function(n){return this[n]},t.setAttribute=function(n,r){return this[n]=r,this},t},polyfill:function(t,e){return _t.shim(t),typeof e<"u"&&(_t.Image=e),_t.isHeadless=!0,t}},tl={};Qa(tl,{Curve:()=>Ei,getAnchorsFromArcData:()=>Xg,getComponentOnCubicBezier:()=>ir,getControlPoints:()=>ul,getCurveBoundingBox:()=>cl,getCurveFromPoints:()=>hl,getCurveLength:()=>ll,getReflection:()=>Ds,integrate:()=>dl,subdivide:()=>Ls});var nl={};Qa(nl,{HALF_PI:()=>Ze,NumArray:()=>nn,TWO_PI:()=>at,decomposeMatrix:()=>Qn,getComputedMatrix:()=>Is,getEffectiveStrokeWidth:()=>rn,getPoT:()=>sl,lerp:()=>Nt,mod:()=>Pt,setMatrix:()=>rl,toFixed:()=>Ne});var He;typeof window<"u"?He=window:typeof global<"u"?He=global:typeof self<"u"&&(He=self);var il,at=Math.PI*2,Ze=Math.PI*.5;function Qn(t,e,n,r,s,o){let a;return arguments.length<=1?(a=t.a,e=t.b,n=t.c,r=t.d,s=t.e,o=t.f):a=t,{translateX:s,translateY:o,scaleX:Math.sqrt(a*a+e*e),scaleY:Math.sqrt(n*n+r*r),rotation:180*Math.atan2(e,a)/Math.PI}}function rl(t){il=t}function Is(t,e){e=e&&e.identity()||new il;let n=t;const r=[];for(;n&&n._matrix;)r.push(n._matrix),n=n.parent;r.reverse();for(let s=0;s<r.length;s++){const a=r[s].elements;e.multiply(a[0],a[1],a[2],a[3],a[4],a[5],a[6],a[7],a[8])}return e}function Nt(t,e,n){return n*(e-t)+t}var zs=[2,4,8,16,32,64,128,256,512,1024,2048,4096];function sl(t){let e=0;for(;zs[e]&&zs[e]<t;)e++;return zs[e]}function Pt(t,e){for(;t<0;)t+=e;return t%e}var nn=He.Float32Array||Array,jg=Math.floor;function Ne(t){return jg(t*1e6)/1e6}function rn(t,e){const n=t._linewidth;if(t.strokeAttenuation)return n;e||(e=t.worldMatrix||Is(t));const r=Qn(e.elements[0],e.elements[3],e.elements[1],e.elements[4],e.elements[2],e.elements[5]),s=Math.max(Math.abs(r.scaleX),Math.abs(r.scaleY));return s>0?n/s:n}var te={move:"M",line:"L",curve:"C",arc:"A",close:"Z"},X=class{constructor(){w(this,"_events",{}),w(this,"_bound",!1)}addEventListener(e,n){return(this._events[e]||(this._events[e]=[])).push(n),this._bound=!0,this}on(){return this.addEventListener.apply(this,arguments)}bind(){return this.addEventListener.apply(this,arguments)}removeEventListener(e,n){if(!this._events)return this;if(!e&&!n)return this._events={},this._bound=!1,this;const r=e?[e]:Object.keys(this._events);for(let s=0,o=r.length;s<o;s++){e=r[s];let a=this._events[e];if(a){let l=[];if(n)for(let c=0,d=a.length;c<d;c++){let h=a[c];h=h.handler?h.handler:h,n!==h&&l.push(h)}this._events[e]=l}}return this}off(){return this.removeEventListener.apply(this,arguments)}unbind(){return this.removeEventListener.apply(this,arguments)}dispatchEvent(e){if(!this._events)return this;const n=Array.prototype.slice.call(arguments,1),r=this._events[e];if(r)for(let s=0;s<r.length;s++)r[s].call(this,...n);return this}trigger(){return this.dispatchEvent.apply(this,arguments)}listen(e,n,r){const s=this;e&&(o.obj=e,o.name=n,o.handler=r,e.on(n,o));function o(){r.apply(s,arguments)}return s}ignore(e,n,r){return e.off(n,r),this}};w(X,"Types",{play:"play",pause:"pause",update:"update",render:"render",resize:"resize",change:"change",remove:"remove",insert:"insert",order:"order",load:"load"}),w(X,"Methods",["addEventListener","on","removeEventListener","off","unbind","dispatchEvent","trigger","listen","ignore"]);var ol={x:{enumerable:!0,get:function(){return this._x},set:function(t){this._x!==t&&(this._x=t,this._bound&&this.dispatchEvent(X.Types.change))}},y:{enumerable:!0,get:function(){return this._y},set:function(t){this._y!==t&&(this._y=t,this._bound&&this.dispatchEvent(X.Types.change))}}},qt=class Zi extends X{constructor(e=0,n=0){super(),w(this,"_x",0),w(this,"_y",0);for(let r in ol)Object.defineProperty(this,r,ol[r]);this.x=e,this.y=n}static add(e,n){return new Zi(e.x+n.x,e.y+n.y)}static sub(e,n){return new Zi(e.x-n.x,e.y-n.y)}static subtract(e,n){return Zi.sub(e,n)}static ratioBetween(e,n){return(e.x*n.x+e.y*n.y)/(e.length()*n.length())}static angleBetween(e,n){if(arguments.length>=4){const o=arguments[0]-arguments[2],a=arguments[1]-arguments[3];return Math.atan2(a,o)}const r=e.x-n.x,s=e.y-n.y;return Math.atan2(s,r)}static distanceBetween(e,n){return Math.sqrt(Zi.distanceBetweenSquared(e,n))}static distanceBetweenSquared(e,n){const r=e.x-n.x,s=e.y-n.y;return r*r+s*s}set(e,n){return this.x=e,this.y=n,this}copy(e){return this.x=e.x,this.y=e.y,this}clear(){return this.x=0,this.y=0,this}clone(){return new Zi(this.x,this.y)}add(e,n){return arguments.length<=0?this:(arguments.length<=1?typeof e=="number"?(this.x+=e,this.y+=e):e&&typeof e.x=="number"&&typeof e.y=="number"&&(this.x+=e.x,this.y+=e.y):(this.x+=e,this.y+=n),this)}addSelf(e){return this.add.apply(this,arguments)}sub(e,n){return arguments.length<=0?this:(arguments.length<=1?typeof e=="number"?(this.x-=e,this.y-=e):e&&typeof e.x=="number"&&typeof e.y=="number"&&(this.x-=e.x,this.y-=e.y):(this.x-=e,this.y-=n),this)}subtract(){return this.sub.apply(this,arguments)}subSelf(e){return this.sub.apply(this,arguments)}subtractSelf(e){return this.sub.apply(this,arguments)}multiply(e,n){return arguments.length<=0?this:(arguments.length<=1?typeof e=="number"?(this.x*=e,this.y*=e):e&&typeof e.x=="number"&&typeof e.y=="number"&&(this.x*=e.x,this.y*=e.y):(this.x*=e,this.y*=n),this)}multiplySelf(e){return this.multiply.apply(this,arguments)}multiplyScalar(e){return this.multiply(e)}divide(e,n){return arguments.length<=0?this:(arguments.length<=1?typeof e=="number"?(this.x/=e,this.y/=e):e&&typeof e.x=="number"&&typeof e.y=="number"&&(this.x/=e.x,this.y/=e.y):(this.x/=e,this.y/=n),isNaN(this.x)&&(this.x=0),isNaN(this.y)&&(this.y=0),this)}divideSelf(e){return this.divide.apply(this,arguments)}divideScalar(e){return this.divide(e)}negate(){return this.multiply(-1)}dot(e){return this.x*e.x+this.y*e.y}length(){return Math.sqrt(this.lengthSquared())}lengthSquared(){return this.x*this.x+this.y*this.y}normalize(){return this.divideScalar(this.length())}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const n=this.x-e.x,r=this.y-e.y;return n*n+r*r}setLength(e){return this.normalize().multiplyScalar(e)}equals(e,n){return n=typeof n>"u"?1e-4:n,this.distanceTo(e)<n}lerp(e,n){const r=(e.x-this.x)*n+this.x,s=(e.y-this.y)*n+this.y;return this.set(r,s)}isZero(e){return e=typeof e>"u"?1e-4:e,this.length()<e}toString(){return this.x+", "+this.y}toObject(){return{x:Ne(this.x),y:Ne(this.y)}}rotate(e){const n=this.x,r=this.y,s=Math.cos(e),o=Math.sin(e);return this.x=n*s-r*o,this.y=n*o+r*s,this}};w(qt,"zero",new qt),w(qt,"left",new qt(-1,0)),w(qt,"right",new qt(1,0)),w(qt,"up",new qt(0,-1)),w(qt,"down",new qt(0,1));var Q=qt,ve=class Ns extends Q{constructor(e=0,n=0,r=0,s=0,o=0,a=0,l=te.move){super(e,n),w(this,"controls",{left:new Q,right:new Q}),w(this,"_command",te.move),w(this,"_relative",!0),w(this,"_rx",0),w(this,"_ry",0),w(this,"_xAxisRotation",0),w(this,"_largeArcFlag",0),w(this,"_sweepFlag",1);for(let d in al)Object.defineProperty(this,d,al[d]);this.command=l,this.relative=!0;const c=Ns.makeBroadcast(this);this.controls.left.set(r,s).addEventListener(X.Types.change,c),this.controls.right.set(o,a).addEventListener(X.Types.change,c)}static makeBroadcast(e){return n;function n(){e._bound&&e.dispatchEvent(X.Types.change)}}static fromObject(e){return new Ns().copy(e)}copy(e){return this.x=e.x,this.y=e.y,typeof e.command=="string"&&(this.command=e.command),e.controls&&(e.controls.left&&this.controls.left.copy(e.controls.left),e.controls.right&&this.controls.right.copy(e.controls.right)),typeof e.relative=="boolean"&&(this.relative=e.relative),typeof e.rx=="number"&&(this.rx=e.rx),typeof e.ry=="number"&&(this.ry=e.ry),typeof e.xAxisRotation=="number"&&(this.xAxisRotation=e.xAxisRotation),typeof e.largeArcFlag=="number"&&(this.largeArcFlag=e.largeArcFlag),typeof e.sweepFlag=="number"&&(this.sweepFlag=e.sweepFlag),this}clone(){return new Ns().copy(this)}toObject(){return{x:Ne(this.x),y:Ne(this.y),command:this.command,relative:this.relative,controls:{left:this.controls.left.toObject(),right:this.controls.right.toObject()},rx:Ne(this.rx),ry:Ne(this.ry),xAxisRotation:Ne(this.xAxisRotation),largeArcFlag:Ne(this.largeArcFlag),sweepFlag:Ne(this.sweepFlag)}}toString(){return JSON.stringify(this.toObject())}},al={command:{enumerable:!0,get:function(){return this._command},set:function(t){this._command!==t&&(this._command=t,this._bound&&this.dispatchEvent(X.Types.change))}},relative:{enumerable:!0,get:function(){return this._relative},set:function(t){this._relative!==!!t&&(this._relative=!!t,this._bound&&this.dispatchEvent(X.Types.change))}},rx:{enumerable:!0,get:function(){return this._rx},set:function(t){this._rx!==t&&(this._rx=t,this._bound&&this.dispatchEvent(X.Types.change))}},ry:{enumerable:!0,get:function(){return this._ry},set:function(t){this._ry!==t&&(this._ry=t,this._bound&&this.dispatchEvent(X.Types.change))}},xAxisRotation:{enumerable:!0,get:function(){return this._xAxisRotation},set:function(t){this._xAxisRotation!==t&&(this._xAxisRotation=t,this._bound&&this.dispatchEvent(X.Types.change))}},largeArcFlag:{enumerable:!0,get:function(){return this._largeArcFlag},set:function(t){this._largeArcFlag!==t&&(this._largeArcFlag=t,this._bound&&this.dispatchEvent(X.Types.change))}},sweepFlag:{get:function(){return this._sweepFlag},set:function(t){this._sweepFlag!==t&&(this._sweepFlag=t,this._bound&&this.dispatchEvent(X.Types.change))}}},qg=0,wt={NextFrameId:null,Types:{webgl:"WebGLRenderer",svg:"SVGRenderer",canvas:"CanvasRenderer"},Version:"v0.8.21",PublishDate:"2025-10-01T00:18:49.277Z",Identifier:"two-",Resolution:12,AutoCalculateImportedMatrices:!0,Instances:[],uniqueId:function(){return qg++}},Ei={CollinearityEpsilon:Math.pow(10,-30),RecursionLimit:16,CuspLimit:0,Tolerance:{distance:.25,angle:0,epsilon:Number.EPSILON},abscissas:[[.5773502691896],[0,.7745966692415],[.3399810435849,.8611363115941],[0,.5384693101057,.9061798459387],[.2386191860832,.6612093864663,.9324695142032],[0,.4058451513774,.7415311855994,.9491079123428],[.1834346424956,.5255324099163,.7966664774136,.9602898564975],[0,.3242534234038,.6133714327006,.8360311073266,.9681602395076],[.1488743389816,.4333953941292,.679409568299,.865063366689,.9739065285172],[0,.2695431559523,.5190961292068,.730152005574,.8870625997681,.9782286581461],[.1252334085115,.3678314989982,.5873179542866,.7699026741943,.9041172563705,.9815606342467],[0,.2304583159551,.4484927510364,.6423493394403,.8015780907333,.917598399223,.9841830547186],[.1080549487073,.3191123689279,.5152486363582,.6872929048117,.8272013150698,.9284348836636,.9862838086968],[0,.2011940939974,.3941513470776,.5709721726085,.7244177313602,.8482065834104,.9372733924007,.9879925180205],[.0950125098376,.2816035507793,.4580167776572,.6178762444026,.755404408355,.8656312023878,.9445750230732,.9894009349916]],weights:[[1],[.8888888888889,.5555555555556],[.6521451548625,.3478548451375],[.5688888888889,.4786286704994,.2369268850562],[.4679139345727,.3607615730481,.1713244923792],[.4179591836735,.3818300505051,.2797053914893,.1294849661689],[.3626837833784,.3137066458779,.2223810344534,.1012285362904],[.3302393550013,.31234707704,.2606106964029,.1806481606949,.0812743883616],[.2955242247148,.26926671931,.219086362516,.1494513491506,.0666713443087],[.2729250867779,.2628045445102,.233193764592,.1862902109277,.1255803694649,.0556685671162],[.2491470458134,.2334925365384,.2031674267231,.1600783285433,.1069393259953,.0471753363865],[.2325515532309,.2262831802629,.2078160475369,.1781459807619,.1388735102198,.0921214998377,.0404840047653],[.2152638534632,.2051984637213,.1855383974779,.1572031671582,.1215185706879,.0801580871598,.0351194603318],[.2025782419256,.1984314853271,.1861610000156,.166269205817,.1395706779262,.1071592204672,.0703660474881,.0307532419961],[.1894506104551,.1826034150449,.169156519395,.1495959888166,.1246289712555,.0951585116825,.0622535239386,.0271524594118]]};function ir(t,e,n,r,s){const o=1-t;return o*o*o*e+3*o*o*t*n+3*o*t*t*r+t*t*t*s}function Ls(t,e,n,r,s,o,a,l,c){c=c||Ei.RecursionLimit;const d=c+1;if(Math.abs(t-a)<.001&&Math.abs(e-l)<.001)return[new ve(a,l)];const h=[];for(let u=0;u<d;u++){const m=u/d,g=ir(m,t,n,s,a),f=ir(m,e,r,o,l);h.push(new ve(g,f))}return h}function ll(t,e,n,r,s,o,a,l,c){if(t===n&&e===r&&s===a&&o===l){const y=a-t,b=l-e;return Math.sqrt(y*y+b*b)}const d=9*(n-s)+3*(a-t),h=6*(t+s)-12*n,u=3*(n-t),m=9*(r-o)+3*(l-e),g=6*(e+o)-12*r,f=3*(r-e);function p(y){const b=(d*y+h)*y+u,_=(m*y+g)*y+f;return Math.sqrt(b*b+_*_)}return dl(p,0,1,c||Ei.RecursionLimit)}function cl(t,e,n,r,s,o,a,l){const c=[],d=[[],[]];let h,u,m,g,f,p,y,b;for(let v=0;v<2;++v){if(v===0?(u=6*t-12*n+6*s,h=-3*t+9*n-9*s+3*a,m=3*n-3*t):(u=6*e-12*r+6*o,h=-3*e+9*r-9*o+3*l,m=3*r-3*e),Math.abs(h)<.001){if(Math.abs(u)<.001)continue;g=-m/u,0<g&&g<1&&c.push(g);continue}y=u*u-4*m*h,b=Math.sqrt(y),!(y<0)&&(f=(-u+b)/(2*h),0<f&&f<1&&c.push(f),p=(-u-b)/(2*h),0<p&&p<1&&c.push(p))}let _=c.length,C=_,S;for(;_--;)g=c[_],S=1-g,d[0][_]=S*S*S*t+3*S*S*g*n+3*S*g*g*s+g*g*g*a,d[1][_]=S*S*S*e+3*S*S*g*r+3*S*g*g*o+g*g*g*l;return d[0][C]=t,d[1][C]=e,d[0][C+1]=a,d[1][C+1]=l,d[0].length=d[1].length=C+2,{min:{x:Math.min.apply(0,d[0]),y:Math.min.apply(0,d[1])},max:{x:Math.max.apply(0,d[0]),y:Math.max.apply(0,d[1])}}}function dl(t,e,n,r){let s=Ei.abscissas[r-2],o=Ei.weights[r-2],a=.5*(n-e),l=a+e,c=0,d=r+1>>1,h=r&1?o[c++]*t(l):0;for(;c<d;){const u=a*s[c];h+=o[c++]*(t(l+u)+t(l-u))}return a*h}function hl(t,e){const n=t.length,r=n-1;for(let s=0;s<n;s++){const o=t[s],a=e?Pt(s-1,n):Math.max(s-1,0),l=e?Pt(s+1,n):Math.min(s+1,r),c=t[a],d=o,h=t[l];ul(c,d,h),d.command=s===0?te.move:te.curve}}function ul(t,e,n){const r=Q.angleBetween(t,e),s=Q.angleBetween(n,e);let o=Q.distanceBetween(t,e),a=Q.distanceBetween(n,e),l=(r+s)/2;return o<.001||a<.001?(typeof e.relative=="boolean"&&!e.relative&&(e.controls.left.copy(e),e.controls.right.copy(e)),e):(o*=.33,a*=.33,s<r?l+=Ze:l-=Ze,e.controls.left.x=Math.cos(l)*o,e.controls.left.y=Math.sin(l)*o,l-=Math.PI,e.controls.right.x=Math.cos(l)*a,e.controls.right.y=Math.sin(l)*a,typeof e.relative=="boolean"&&!e.relative&&(e.controls.left.x+=e.x,e.controls.left.y+=e.y,e.controls.right.x+=e.x,e.controls.right.y+=e.y),e)}function Ds(t,e,n){return new Q(2*t.x-(e.x+t.x)-(n?t.x:0),2*t.y-(e.y+t.y)-(n?t.y:0))}function Xg(t,e,n,r,s,o,a){const l=wt.Resolution;for(let c=0;c<l;c++){let d=(c+1)/l;a&&(d=1-d);const h=d*o+s,u=n*Math.cos(h),m=r*Math.sin(h),g=new ve(u,m);g.command=te.line}}var fl=Array.prototype.slice;function Yg(t){if(t==null)return!1;const e=t.length;return typeof e=="number"&&e>=0&&e<4294967296}var K={isNaN:function(t){return typeof t=="number"&&t!==+t},isElement:function(t){return!!(t&&t.nodeType===1)},isObject:function(t){const e=typeof t;return e==="function"||e==="object"&&!!t},isFunction:function(t){return typeof t=="function"},extend:function(t){const e=fl.call(arguments,1);for(let n=0;n<e.length;n++){const r=e[n];for(let s in r)t[s]=r[s]}return t},defaults:function(t){const e=fl.call(arguments,1);for(let n=0;n<e.length;n++){const r=e[n];for(let s in r)t[s]===void 0&&(t[s]=r[s])}return t},each:function(t,e,n){const r=n||this,s=!Yg(t)&&Object.keys(t),o=(s||t).length;for(let a=0;a<o;a++){const l=s?s[a]:a;e.call(r,t[l],l,t)}return t},performance:He.performance&&He.performance.now?He.performance:Date},Ft={hasEventListeners:typeof He.addEventListener=="function",bind:function(t,e,n,r){return this.hasEventListeners?t.addEventListener(e,n,!!r):t.attachEvent("on"+e,n),Ft},unbind:function(t,e,n,r){return Ft.hasEventListeners?t.removeEventListeners(e,n,!!r):t.detachEvent("on"+e,n),Ft},getRequestAnimationFrame:function(){const t=["ms","moz","webkit","o"];let e=0,n=He.requestAnimationFrame;if(!n){for(let s=0;s<t.length;s++)n=He[t[s]+"RequestAnimationFrame"]||n;n=n||r}function r(s,o){const a=new Date().getTime(),l=Math.max(0,16-(a-e)),c=He.setTimeout(d,l);e=a+l;function d(){s(a+l)}return c}return n}},Ni=He.document?He.document.createElement("div"):{};Ni.id="help-two-load",Object.defineProperty(Ft,"temp",{enumerable:!0,get:function(){return K.isElement(Ni)&&!He.document.head.contains(Ni)&&(Ni.style.display="none",He.document.head.appendChild(Ni)),Ni}});var Rt=class extends Error{constructor(e){super(),w(this,"name","Two.js"),w(this,"message"),this.message=e}},Ug=He.devicePixelRatio||1;function Gg(t){return t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1}function Hs(t){return Ug/Gg(t)}var Fr=class{constructor(){w(this,"map",{})}add(e,n){return this.map[e]=n,this}remove(e){return delete this.map[e],this}get(e){return this.map[e]}contains(e){return e in this.map}},lt,An=class extends Array{constructor(){super(),el(this,lt,new X),arguments[0]&&Array.isArray(arguments[0])?arguments[0].length>0&&this.push.apply(this,arguments[0]):arguments.length>0&&this.push.apply(this,arguments)}get _events(){return Tt(this,lt)}set _events(e){Wg(this,lt,e)}get _bound(){return Tt(this,lt)._bound}set _bound(e){Tt(this,lt)._bound=e}addEventListener(){return Tt(this,lt).addEventListener.apply(this,arguments)}on(){return Tt(this,lt).on.apply(this,arguments)}bind(){return Tt(this,lt).bind.apply(this,arguments)}removeEventListener(){return Tt(this,lt).removeEventListener.apply(this,arguments)}off(){return Tt(this,lt).off.apply(this,arguments)}unbind(){return Tt(this,lt).unbind.apply(this,arguments)}dispatchEvent(){return Tt(this,lt).dispatchEvent.apply(this,arguments)}trigger(){return Tt(this,lt).trigger.apply(this,arguments)}listen(){return Tt(this,lt).listen.apply(this,arguments)}ignore(){return Tt(this,lt).ignore.apply(this,arguments)}pop(){const e=super.pop.apply(this,arguments);return this.trigger(X.Types.remove,[e]),e}shift(){const e=super.shift.apply(this,arguments);return this.trigger(X.Types.remove,[e]),e}push(){const e=super.push.apply(this,arguments);return this.trigger(X.Types.insert,arguments),e}unshift(){const e=super.unshift.apply(this,arguments);return this.trigger(X.Types.insert,arguments),e}splice(){const e=super.splice.apply(this,arguments);if(this.trigger(X.Types.remove,e),arguments.length>2){const n=this.slice(arguments[0],arguments[0]+arguments.length-2);this.trigger(X.Types.insert,n),this.trigger(X.Types.order)}return e}sort(){return super.sort.apply(this,arguments),this.trigger(X.Types.order),this}reverse(){return super.reverse.apply(this,arguments),this.trigger(X.Types.order),this}indexOf(){return super.indexOf.apply(this,arguments)}map(e,n){const r=[];for(let s=0;s<this.length;s++){const o=this[s];let a;n?a=e.call(n,o,s):a=e(o,s),r.push(a)}return r}};lt=new WeakMap;var gl=class Mu extends X{constructor(){super(),w(this,"_flagId",!1),w(this,"_flagClassName",!1),w(this,"_renderer",{}),w(this,"_id",wt.Identifier+wt.uniqueId()),w(this,"_className",""),w(this,"classList",[]);for(let e in ml)Object.defineProperty(this,e,ml[e])}static fromObject(e){const n=new Mu().copy(e);return"id"in e&&(n.id=e.id),n}flagReset(){return this._flagId=this._flagClassName=!1,this}copy(e){return e.renderer&&typeof e.renderer.type=="string"&&(this.renderer.type=e.renderer.type),typeof e.className=="string"&&(this.className=e.className),this}toObject(){return{renderer:{type:this.renderer.type},id:this.id,className:this.className}}dispose(){const e=this._renderer.type;return this._renderer={type:e},typeof this.unbind=="function"&&this.unbind(),this}};w(gl,"Properties",["renderer","id","className"]);var Pi=gl,ml={renderer:{enumerable:!1,get:function(){return this._renderer}},id:{enumerable:!0,get:function(){return this._id},set:function(t){const e=this._id;t!==this._id&&(this._id=t,this._flagId=!0,this.parent&&(delete this.parent.children.ids[e],this.parent.children.ids[this._id]=this))}},className:{enumerable:!0,get:function(){return this._className},set:function(t){this._className!==t&&(this._flagClassName=!0,this.classList=t.split(/\s+?/),this._className=t)}}},Mr,pl={video:/\.(mp4|webm|ogg)$/i,image:/\.(jpe?g|png|gif|tiff|webp)$/i,effect:/texture|gradient/i};He.document&&(Mr=document.createElement("a"));var Xt=class Vt extends Pi{constructor(e,n){super(),w(this,"_flagSrc",!1),w(this,"_flagImage",!1),w(this,"_flagVideo",!1),w(this,"_flagLoaded",!1),w(this,"_flagRepeat",!1),w(this,"_flagOffset",!1),w(this,"_flagScale",!1),w(this,"_src",""),w(this,"_image",null),w(this,"_loaded",!1),w(this,"_repeat","no-repeat"),w(this,"_scale",1),w(this,"_offset",null);for(let r in yl)Object.defineProperty(this,r,yl[r]);if(this._renderer.type="texture",this._renderer.flagOffset=Kg.bind(this),this._renderer.flagScale=Zg.bind(this),this.loaded=!1,this.repeat="no-repeat",this.offset=new Q,typeof n=="function"){const r=(function(){this.unbind(X.Types.load,r),typeof n=="function"&&n()}).bind(this);this.bind(X.Types.load,r)}if(typeof e=="string")this.src=e;else if(typeof e=="object"){const r=Object.prototype.toString.call(e);(r==="[object HTMLImageElement]"||r==="[object HTMLCanvasElement]"||r==="[object HTMLVideoElement]"||r==="[object Image]")&&(this.image=e)}this._update()}fromObject(e){const n=new Vt().copy(e);return"id"in e&&(n.id=e.id),n}static getAbsoluteURL(e){return Mr?(Mr.href=e,Mr.href):e}static loadHeadlessBuffer(e,n){e.image.onload=n,e.image.src=e.src}static getTag(e){return e&&e.nodeName&&e.nodeName.toLowerCase()||"img"}static getImage(e){const n=Vt.getAbsoluteURL(e);if(Vt.ImageRegistry.contains(n))return Vt.ImageRegistry.get(n);let r;return _t.Image?(r=new _t.Image,_t.shim(r,"img")):He.document?pl.video.test(n)?r=document.createElement("video"):r=document.createElement("img"):console.warn("Two.js: no prototypical image defined for Two.Texture"),r.crossOrigin="anonymous",r.referrerPolicy="no-referrer",r}static load(e,n){let r=e.image,s=Vt.getTag(r);e._flagImage&&(/canvas/i.test(s)?Vt.Register.canvas(e,n):(e._src=!_t.isHeadless&&r.getAttribute("two-src")||r.src,Vt.Register[s](e,n))),e._flagSrc&&(r||(r=Vt.getImage(e.src),e.image=r),s=Vt.getTag(r),Vt.Register[s](e,n))}clone(){const e=new Vt(this.src);return e.repeat=this.repeat,e.offset.copy(this.offset),e.scale=this.scale,e}copy(e){return this.src=e.src,this.repeat=e.repeat,this.offset=typeof e.offset=="number"||e.offset instanceof Q?e.offset:new Q().copy(e.offset),this.scale=typeof e.scale=="number"||e.scale instanceof Q?e.scale:new Q().copy(e.scale),this}toObject(){const e=super.toObject.call(this);return e.renderer.type="texture",e.src=this.src,e.repeat=this.repeat,e.offset=this.offset.toObject(),e.scale=typeof this.scale=="number"?this.scale:this.scale.toObject(),e}_update(){return(this._flagSrc||this._flagImage)&&(this.trigger(X.Types.change),(this._flagSrc||this._flagImage)&&(this.loaded=!1,Vt.load(this,(function(){this.loaded=!0,this.trigger(X.Types.change).trigger(X.Types.load)}).bind(this)))),this._image&&this._image.readyState>=4&&(this._flagVideo=!0),this}flagReset(){return this._flagSrc=this._flagImage=this._flagLoaded=this._flagRepeat=this._flagVideo=this._flagScale=this._flagOffset=!1,super.flagReset.call(this),this}dispose(){if(super.dispose(),"elem"in this._renderer){const e=this._renderer.elem;e.parentNode.removeChild(e)}return"effect"in this._renderer&&(this._renderer.effect=null),this}};w(Xt,"Properties",["src","loaded","repeat","scale","offset","image"]),w(Xt,"RegularExpressions",pl),w(Xt,"ImageRegistry",new Fr),w(Xt,"Register",{canvas:function(t,e){t._src="#"+t.id,Xt.ImageRegistry.add(t.src,t.image),typeof e=="function"&&e()},img:function(t,e){const n=t.image,r=function(o){!_t.isHeadless&&n.removeEventListener&&typeof n.removeEventListener=="function"&&(n.removeEventListener("load",r,!1),n.removeEventListener("error",s,!1)),typeof e=="function"&&e()},s=function(o){throw!_t.isHeadless&&typeof n.removeEventListener=="function"&&(n.removeEventListener("load",r,!1),n.removeEventListener("error",s,!1)),new Rt("unable to load "+t.src)};typeof n.width=="number"&&n.width>0&&typeof n.height=="number"&&n.height>0?r():!_t.isHeadless&&typeof n.addEventListener=="function"&&(n.addEventListener("load",r,!1),n.addEventListener("error",s,!1)),t._src=Xt.getAbsoluteURL(t._src),!(!_t.isHeadless&&n&&n.getAttribute("two-src"))&&(_t.isHeadless||n.setAttribute("two-src",t.src),Xt.ImageRegistry.add(t.src,n),_t.isHeadless?Xt.loadHeadlessBuffer(t,r):t.image.src=t.src)},video:function(t,e){if(_t.isHeadless)throw new Rt("video textures are not implemented in headless environments.");const n=function(s){t.image.removeEventListener("canplaythrough",n,!1),t.image.removeEventListener("error",r,!1),t.image.width=t.image.videoWidth,t.image.height=t.image.videoHeight,typeof e=="function"&&e()},r=function(s){throw t.image.removeEventListener("canplaythrough",n,!1),t.image.removeEventListener("error",r,!1),new Rt("unable to load "+t.src)};t._src=Xt.getAbsoluteURL(t._src),t.image.getAttribute("two-src")||(t.image.setAttribute("two-src",t.src),Xt.ImageRegistry.add(t.src,t.image)),t.image.readyState>=4?n():(t.image.addEventListener("canplaythrough",n,!1),t.image.addEventListener("error",r,!1),t.image.src=t.src,t.image.load())}});var Pe=Xt,yl={src:{enumerable:!0,get:function(){return this._src},set:function(t){this._src=t,this._flagSrc=!0}},loaded:{enumerable:!0,get:function(){return this._loaded},set:function(t){this._loaded=t,this._flagLoaded=!0}},repeat:{enumerable:!0,get:function(){return this._repeat},set:function(t){this._repeat=t,this._flagRepeat=!0}},image:{enumerable:!0,get:function(){return this._image},set:function(t){const e=Pe.getTag(t);let n;switch(e){case"canvas":n="#"+t.id;break;default:n=t.src}Pe.ImageRegistry.contains(n)?this._image=Pe.ImageRegistry.get(t.src):this._image=t,this._flagImage=!0}},offset:{enumerable:!0,get:function(){return this._offset},set:function(t){this._offset&&this._offset.unbind(X.Types.change,this._renderer.flagOffset),this._offset=t,this._offset.bind(X.Types.change,this._renderer.flagOffset),this._flagOffset=!0}},scale:{enumerable:!0,get:function(){return this._scale},set:function(t){this._scale instanceof Q&&this._scale.unbind(X.Types.change,this._renderer.flagScale),this._scale=t,this._scale instanceof Q&&this._scale.bind(X.Types.change,this._renderer.flagScale),this._flagScale=!0}}};function Kg(){this._flagOffset=!0}function Zg(){this._flagScale=!0}var Ws=class tn extends Pi{constructor(e,n,r){super(),w(this,"_flagOffset",!0),w(this,"_flagOpacity",!0),w(this,"_flagColor",!0),w(this,"_offset",0),w(this,"_opacity",1),w(this,"_color","#fff");for(let s in bl)Object.defineProperty(this,s,bl[s]);this._renderer.type="stop",this.offset=typeof e=="number"?e:tn.Index<=0?0:1,this.opacity=typeof r=="number"?r:1,this.color=typeof n=="string"?n:tn.Index<=0?"#fff":"#000",tn.Index=(tn.Index+1)%2}static fromObject(e){const n=new tn().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<tn.Properties.length;n++){const r=tn.Properties[n];r in e&&(this[r]=e[r])}return this}clone(e){const n=new tn;return K.each(tn.Properties,function(r){n[r]=this[r]},this),e&&e.stops&&e.stops.push(n),n}toObject(){const e=super.toObject.call(this);return e.renderer.type="stop",K.each(tn.Properties,n=>{e[n]=this[n]},this),e}flagReset(){return this._flagOffset=this._flagColor=this._flagOpacity=!1,super.flagReset.call(this),this}};w(Ws,"Index",0),w(Ws,"Properties",["offset","opacity","color"]);var Vn=Ws,bl={offset:{enumerable:!0,get:function(){return this._offset},set:function(t){this._offset=t,this._flagOffset=!0,this.parent&&(this.parent._flagStops=!0)}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(t){this._opacity=t,this._flagOpacity=!0,this.parent&&(this.parent._flagStops=!0)}},color:{enumerable:!0,get:function(){return this._color},set:function(t){this._color=t,this._flagColor=!0,this.parent&&(this.parent._flagStops=!0)}}},js=class vi extends Pi{constructor(e){super(),w(this,"_flagStops",!1),w(this,"_flagSpread",!1),w(this,"_flagUnits",!1),w(this,"_spread",""),w(this,"_units","");for(let n in _l)Object.defineProperty(this,n,_l[n]);this._renderer.type="gradient",this._renderer.flagStops=Qg.bind(this),this._renderer.bindStops=Jg.bind(this),this._renderer.unbindStops=em.bind(this),this.spread="pad",this.units="objectBoundingBox",e&&(this.stops=e)}static fromObject(e){let n=e.stops;n&&n.length>0&&(n=n.map(s=>s instanceof Vn?s:new Vn().copy(s)));const r=new vi(n).copy(e);return"id"in e&&(r.id=e.id),r}clone(e){const n=this.stops.map(s=>s.clone()),r=new vi(n);return K.each(vi.Properties,s=>{r[s]=this[s]},this),e&&e.add(r),r}copy(e){super.copy.call(this,e);for(let n=0;n<vi.Properties.length;n++){const r=vi.Properties[n];r in e&&(this[r]=e[r])}return this}toObject(){const e={stops:this.stops.map(n=>n.toObject())};return K.each(vi.Properties,n=>{e[n]=this[n]},this),e}_update(){return(this._flagSpread||this._flagStops)&&this.trigger(X.Types.change),this}flagReset(){return this._flagSpread=this._flagUnits=this._flagStops=!1,super.flagReset.call(this),this}dispose(){if("elem"in this._renderer){const e=this._renderer.elem;e.parentNode.removeChild(e)}return"effect"in this._renderer&&(this._renderer.effect=null),this}};w(js,"Stop",Vn),w(js,"Properties",["spread","stops","units"]);var Qe=js,_l={spread:{enumerable:!0,get:function(){return this._spread},set:function(t){this._spread=t,this._flagSpread=!0}},units:{enumerable:!0,get:function(){return this._units},set:function(t){this._units=t,this._flagUnits=!0}},stops:{enumerable:!0,get:function(){return this._stops},set:function(t){const e=this._renderer.bindStops,n=this._renderer.unbindStops;this._stops&&this._stops.unbind(X.Types.insert,e).unbind(X.Types.remove,n),this._stops=new An((t||[]).slice(0)),this._stops.bind(X.Types.insert,e).bind(X.Types.remove,n),e(this._stops)}}};function Qg(){this._flagStops=!0}function Jg(t){let e=t.length;for(;e--;)t[e].bind(X.Types.change,this._renderer.flagStops),t[e].parent=this;this._renderer.flagStops()}function em(t){let e=t.length;for(;e--;)t[e].unbind(X.Types.change,this._renderer.flagStops),delete t[e].parent;this._renderer.flagStops()}var qs=class Sr extends Qe{constructor(e,n,r,s,o){super(o),w(this,"_flagEndPoints",!1),w(this,"_left",null),w(this,"_right",null);for(let a in wl)Object.defineProperty(this,a,wl[a]);this._renderer.type="linear-gradient",this._renderer.flagEndPoints=tm.bind(this),this.left=new Q,this.right=new Q,typeof e=="number"&&(this.left.x=e),typeof n=="number"&&(this.left.y=n),typeof r=="number"&&(this.right.x=r),typeof s=="number"&&(this.right.y=s)}static fromObject(e){const n=new Sr().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<Sr.Properties.length;n++){const r=Sr.Properties[n];r in e&&(this[r]=e[r]instanceof Q?e[r]:new Q().copy(e[r]))}return this}clone(e){const n=this.stops.map(function(s){return s.clone()}),r=new Sr(this.left._x,this.left._y,this.right._x,this.right._y,n);return K.each(Qe.Properties,function(s){r[s]=this[s]},this),e&&e.add(r),r}toObject(){const e=super.toObject.call(this);return e.left=this.left.toObject(),e.right=this.right.toObject(),e}_update(){return(this._flagEndPoints||this._flagSpread||this._flagStops)&&this.trigger(X.Types.change),this}flagReset(){return this._flagEndPoints=!1,super.flagReset.call(this),this}};w(qs,"Stop",Vn),w(qs,"Properties",["left","right"]);var We=qs,wl={left:{enumerable:!0,get:function(){return this._left},set:function(t){this._left instanceof Q&&this._left.unbind(X.Types.change,this._renderer.flagEndPoints),this._left=t,this._left.bind(X.Types.change,this._renderer.flagEndPoints),this._flagEndPoints=!0}},right:{enumerable:!0,get:function(){return this._right},set:function(t){this._right instanceof Q&&this._right.unbind(X.Types.change,this._renderer.flagEndPoints),this._right=t,this._right.bind(X.Types.change,this._renderer.flagEndPoints),this._flagEndPoints=!0}}};function tm(){this._flagEndPoints=!0}var Xs=class ki extends Qe{constructor(e,n,r,s,o,a){super(s),w(this,"_flagRadius",!1),w(this,"_flagCenter",!1),w(this,"_flagFocal",!1),w(this,"_radius",0),w(this,"_center",null),w(this,"_focal",null);for(let l in xl)Object.defineProperty(this,l,xl[l]);this._renderer.type="radial-gradient",this._renderer.flagCenter=nm.bind(this),this._renderer.flagFocal=im.bind(this),this.center=new Q,this.radius=typeof r=="number"?r:1,this.focal=new Q,typeof e=="number"&&(this.center.x=e),typeof n=="number"&&(this.center.y=n),this.focal.copy(this.center),typeof o=="number"&&(this.focal.x=o),typeof a=="number"&&(this.focal.y=a)}static fromObject(e){const n=new ki().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<ki.Properties.length;n++){const r=ki.Properties[n];r in e&&(/(center|focal)i/.test(r)?this[r]=e[r]instanceof Q?e[r]:new Q().copy(e[r]):typeof e[r]=="number"&&(this[r]=e[MediaKeySystemAccess]))}return this}clone(e){const n=this.stops.map(function(s){return s.clone()}),r=new ki(this.center._x,this.center._y,this._radius,n,this.focal._x,this.focal._y);return K.each(Qe.Properties.concat(ki.Properties),function(s){r[s]=this[s]},this),e&&e.add(r),r}toObject(){const e=super.toObject.call(this);return K.each(ki.Properties,function(n){e[n]=this[n]},this),e.center=this.center.toObject(),e.focal=this.focal.toObject(),e}_update(){return(this._flagRadius||this._flatCenter||this._flagFocal||this._flagSpread||this._flagStops)&&this.trigger(X.Types.change),this}flagReset(){return this._flagRadius=this._flagCenter=this._flagFocal=!1,super.flagReset.call(this),this}};w(Xs,"Stop",Vn),w(Xs,"Properties",["center","radius","focal"]);var je=Xs,xl={radius:{enumerable:!0,get:function(){return this._radius},set:function(t){this._radius=t,this._flagRadius=!0}},center:{enumerable:!0,get:function(){return this._center},set:function(t){this._center&&this._center.unbind(X.Types.change,this._renderer.flagCenter),this._center=t,this._center.bind(X.Types.change,this._renderer.flagCenter),this._flagCenter=!0}},focal:{enumerable:!0,get:function(){return this._focal},set:function(t){this._focal&&this._focal.unbind(X.Types.change,this._renderer.flagFocal),this._focal=t,this._focal.bind(X.Types.change,this._renderer.flagFocal),this._flagFocal=!0}}};function nm(){this._flagCenter=!0}function im(){this._flagFocal=!0}function vl(t,e){if(e===0||e===1)return!0;const r=t._length*e;let s=0;for(let o=0;o<t._lengths.length;o++){const a=t._lengths[o];if(s>=r)return r-s>=0;s+=a}return!1}function Ar(t,e){const n=t._length;if(e<=0)return 0;if(e>=n)return t._lengths.length-1;for(let r=0,s=0;r<t._lengths.length;r++){if(s+t._lengths[r]>=e)return e-=s,Math.max(r-1,0)+e/t._lengths[r];s+=t._lengths[r]}return-1}function kl(t,e,n){let r,s,o,a,l,c,d,h;const u=e.controls&&e.controls.right,m=t.controls&&t.controls.left;return r=e.x,l=e.y,s=(u||e).x,c=(u||e).y,o=(m||t).x,d=(m||t).y,a=t.x,h=t.y,u&&e._relative&&(s+=e.x,c+=e.y),m&&t._relative&&(o+=t.x,d+=t.y),ll(r,l,s,c,o,d,a,h,n)}function Cl(t,e,n){let r,s,o,a,l,c,d,h;const u=e.controls&&e.controls.right,m=t.controls&&t.controls.left;return r=e.x,l=e.y,s=(u||e).x,c=(u||e).y,o=(m||t).x,d=(m||t).y,a=t.x,h=t.y,u&&e._relative&&(s+=e.x,c+=e.y),m&&t._relative&&(o+=t.x,d+=t.y),Ls(r,l,s,c,o,d,a,h,n)}function Jn(t){switch(t.renderer.type){case"texture":return Pe.fromObject(t);case"gradient":return Qe.fromObject(t);case"linear-gradient":return We.fromObject(t);case"radial-gradient":return je.fromObject(t)}return t}var rm=Math.cos,sm=Math.sin,Sl=Math.tan,Ys=[],Bl=class Ot extends X{constructor(e,n,r,s,o,a){super(),w(this,"elements",new nn(9)),w(this,"manual",!1);let l=e;Array.isArray(l)||(l=Array.prototype.slice.call(arguments)),this.identity(),l.length>0&&this.set(l)}static Multiply(e,n,r){if(n.length<=3){const B=e;let k,R,$;const P=n[0]||0,I=n[1]||0,V=n[2]||0;return k=B[0]*P+B[1]*I+B[2]*V,R=B[3]*P+B[4]*I+B[5]*V,$=B[6]*P+B[7]*I+B[8]*V,[k,R,$]}const s=e[0],o=e[1],a=e[2],l=e[3],c=e[4],d=e[5],h=e[6],u=e[7],m=e[8],g=n[0],f=n[1],p=n[2],y=n[3],b=n[4],_=n[5],C=n[6],S=n[7],v=n[8];return r=r||new nn(9),r[0]=s*g+o*y+a*C,r[1]=s*f+o*b+a*S,r[2]=s*p+o*_+a*v,r[3]=l*g+c*y+d*C,r[4]=l*f+c*b+d*S,r[5]=l*p+c*_+d*v,r[6]=h*g+u*y+m*C,r[7]=h*f+u*b+m*S,r[8]=h*p+u*_+m*v,r}static fromObject(e){return new Ot().copy(e)}set(e,n,r,s,o,a,l,c,d){if(typeof n>"u"){const h=e;e=h[0],n=h[1],r=h[2],s=h[3],o=h[4],a=h[5],l=h[6],c=h[7],d=h[8]}return this.elements[0]=e,this.elements[1]=n,this.elements[2]=r,this.elements[3]=s,this.elements[4]=o,this.elements[5]=a,this.elements[6]=l,this.elements[7]=c,this.elements[8]=d,this.trigger(X.Types.change)}copy(e){return this.elements[0]=e.elements[0],this.elements[1]=e.elements[1],this.elements[2]=e.elements[2],this.elements[3]=e.elements[3],this.elements[4]=e.elements[4],this.elements[5]=e.elements[5],this.elements[6]=e.elements[6],this.elements[7]=e.elements[7],this.elements[8]=e.elements[8],this.manual=e.manual,this.trigger(X.Types.change)}identity(){return this.elements[0]=Ot.Identity[0],this.elements[1]=Ot.Identity[1],this.elements[2]=Ot.Identity[2],this.elements[3]=Ot.Identity[3],this.elements[4]=Ot.Identity[4],this.elements[5]=Ot.Identity[5],this.elements[6]=Ot.Identity[6],this.elements[7]=Ot.Identity[7],this.elements[8]=Ot.Identity[8],this.trigger(X.Types.change)}multiply(e,n,r,s,o,a,l,c,d){if(typeof n>"u")return this.elements[0]*=e,this.elements[1]*=e,this.elements[2]*=e,this.elements[3]*=e,this.elements[4]*=e,this.elements[5]*=e,this.elements[6]*=e,this.elements[7]*=e,this.elements[8]*=e,this.trigger(X.Types.change);if(typeof r>"u"&&(r=1),typeof s>"u"){e=e||0,n=n||0,r=r||0,o=this.elements;const L=o[0]*e+o[1]*n+o[2]*r,D=o[3]*e+o[4]*n+o[5]*r,ee=o[6]*e+o[7]*n+o[8]*r;return[L,D,ee]}const h=this.elements,u=[e,n,r,s,o,a,l,c,d],m=h[0],g=h[1],f=h[2],p=h[3],y=h[4],b=h[5],_=h[6],C=h[7],S=h[8],v=u[0],B=u[1],k=u[2],R=u[3],$=u[4],P=u[5],I=u[6],V=u[7],A=u[8];return this.elements[0]=m*v+g*R+f*I,this.elements[1]=m*B+g*$+f*V,this.elements[2]=m*k+g*P+f*A,this.elements[3]=p*v+y*R+b*I,this.elements[4]=p*B+y*$+b*V,this.elements[5]=p*k+y*P+b*A,this.elements[6]=_*v+C*R+S*I,this.elements[7]=_*B+C*$+S*V,this.elements[8]=_*k+C*P+S*A,this.trigger(X.Types.change)}inverse(e){const n=this.elements;e=e||new Ot;const r=n[0],s=n[1],o=n[2],a=n[3],l=n[4],c=n[5],d=n[6],h=n[7],u=n[8],m=u*l-c*h,g=-u*a+c*d,f=h*a-l*d;let p=r*m+s*g+o*f;return p?(p=1/p,e.elements[0]=m*p,e.elements[1]=(-u*s+o*h)*p,e.elements[2]=(c*s-o*l)*p,e.elements[3]=g*p,e.elements[4]=(u*r-o*d)*p,e.elements[5]=(-c*r+o*a)*p,e.elements[6]=f*p,e.elements[7]=(-h*r+s*d)*p,e.elements[8]=(l*r-s*a)*p,e):null}scale(e,n){return arguments.length<=1&&(n=e),this.multiply(e,0,0,0,n,0,0,0,1)}rotate(e){const n=rm(e),r=sm(e);return this.multiply(n,-r,0,r,n,0,0,0,1)}translate(e,n){return this.multiply(1,0,e,0,1,n,0,0,1)}skewX(e){const n=Sl(e);return this.multiply(1,n,0,0,1,0,0,0,1)}skewY(e){const n=Sl(e);return this.multiply(1,0,0,n,1,0,0,0,1)}toString(e){return Ys.length=0,this.toTransformArray(e,Ys),Ys.map(Ne).join(" ")}toTransformArray(e,n){const r=this.elements,s=!!n,o=r[0],a=r[1],l=r[2],c=r[3],d=r[4],h=r[5];if(e){const u=r[6],m=r[7],g=r[8];if(s){n[0]=o,n[1]=c,n[2]=u,n[3]=a,n[4]=d,n[5]=m,n[6]=l,n[7]=h,n[8]=g;return}return[o,c,u,a,d,m,l,h,g]}if(s){n[0]=o,n[1]=c,n[2]=a,n[3]=d,n[4]=l,n[5]=h;return}return[o,c,a,d,l,h]}toArray(e,n){const r=this.elements,s=!!n,o=r[0],a=r[1],l=r[2],c=r[3],d=r[4],h=r[5];if(e){const u=r[6],m=r[7],g=r[8];if(s){n[0]=o,n[1]=a,n[2]=l,n[3]=c,n[4]=d,n[5]=h,n[6]=u,n[7]=m,n[8]=g;return}return[o,a,l,c,d,h,u,m,g]}if(s){n[0]=o,n[1]=a,n[2]=l,n[3]=c,n[4]=d,n[5]=h;return}return[o,a,l,c,d,h]}toObject(){return{renderer:{type:"matrix"},elements:this.toArray(!0),manual:!!this.manual}}clone(){return new Ot().copy(this)}};w(Bl,"Identity",[1,0,0,0,1,0,0,0,1]);var Fi=Bl;rl(Fi);var Tl=class Va extends Pi{constructor(){super(),w(this,"_flagMatrix",!0),w(this,"_flagScale",!1),w(this,"_matrix",null),w(this,"_worldMatrix",null),w(this,"_position",null),w(this,"_rotation",0),w(this,"_scale",1),w(this,"_skewX",0),w(this,"_skewY",0);for(let e in Vr)Object.defineProperty(this,e,Vr[e]);this._renderer.flagMatrix=Rl.bind(this),this.isShape=!0,this.matrix=new Fi,this.worldMatrix=new Fi,this.position=new Q,this.rotation=0,this.scale=1,this.skewX=0,this.skewY=0}static fromObject(e){const n=new Va().copy(e);return"id"in e&&(n.id=e.id),n}get renderer(){return this._renderer}set renderer(e){this._renderer=e}get translation(){return Vr.position.get.apply(this,arguments)}set translation(e){Vr.position.set.apply(this,arguments)}addTo(e){return e.add(this),this}remove(){return this.parent?(this.parent.remove(this),this):this}copy(e){return super.copy.call(this,e),"position"in e&&(e.position instanceof Q?this.position=e.position:this.position.copy(e.position)),"rotation"in e&&(this.rotation=e.rotation),"scale"in e&&(this.scale=typeof e.scale=="number"||e.scale instanceof Q?e.scale:new Q(e.scale.x,e.scale.y)),"skewX"in e&&(this.skewX=e.skewX),"skewY"in e&&(this.skewY=e.skewY),"matrix"in e&&e.matrix.manual&&(this.matrix.copy(e.matrix),this.matrix.manual=!0),this}clone(e){const n=new Va;return n.position.copy(this.position),n.rotation=this.rotation,n.scale=this.scale,n.skewX=this.skewX,n.skewY=this.skewY,this.matrix.manual&&n.matrix.copy(this.matrix),e&&e.add(n),n._update()}toObject(){const e=super.toObject.call(this);return e.renderer={type:"shape"},e.isShape=!0,e.translation=this.translation.toObject(),e.rotation=this.translation.rotation,e.scale=this.scale instanceof Q?this.scale.toObject():this.scale,e.skewX=this.skewX,e.skewY=this.skewY,e.matrix=this.matrix.toObject(),e}_update(e){return!this._matrix.manual&&this._flagMatrix&&(this._matrix.identity().translate(this.position.x,this.position.y),this._matrix.rotate(this.rotation),this._scale instanceof Q?this._matrix.scale(this._scale.x,this._scale.y):this._matrix.scale(this._scale),this._matrix.skewX(this.skewX),this._matrix.skewY(this.skewY)),e&&this.parent&&this.parent._update&&this.parent._update(),this}flagReset(){return this._flagMatrix=this._flagScale=!1,super.flagReset.call(this),this}};w(Tl,"Properties",["position","rotation","scale","skewX","skewY","matrix","worldMatrix"]);var On=Tl,Vr={position:{enumerable:!0,get:function(){return this._position},set:function(t){this._position&&this._position.unbind(X.Types.change,this._renderer.flagMatrix),this._position=t,this._position.bind(X.Types.change,this._renderer.flagMatrix),Rl.call(this)}},rotation:{enumerable:!0,get:function(){return this._rotation},set:function(t){this._rotation=t,this._flagMatrix=!0}},scale:{enumerable:!0,get:function(){return this._scale},set:function(t){this._scale instanceof Q&&this._scale.unbind(X.Types.change,this._renderer.flagMatrix),this._scale=t,this._scale instanceof Q&&this._scale.bind(X.Types.change,this._renderer.flagMatrix),this._flagMatrix=!0,this._flagScale=!0}},skewX:{enumerable:!0,get:function(){return this._skewX},set:function(t){this._skewX=t,this._flagMatrix=!0}},skewY:{enumerable:!0,get:function(){return this._skewY},set:function(t){this._skewY=t,this._flagMatrix=!0}},matrix:{enumerable:!0,get:function(){return this._matrix},set:function(t){this._matrix=t,this._flagMatrix=!0}},worldMatrix:{enumerable:!0,get:function(){return Is(this,this._worldMatrix),this._worldMatrix},set:function(t){this._worldMatrix=t}}};function Rl(){this._flagMatrix=!0}var Mi=Math.min,Ai=Math.max,om=Math.ceil,am=Math.floor,lm=new Q,Us=class Yn extends On{constructor(e,n,r,s){super(),w(this,"_flagVertices",!0),w(this,"_flagLength",!0),w(this,"_flagFill",!0),w(this,"_flagStroke",!0),w(this,"_flagLinewidth",!0),w(this,"_flagOpacity",!0),w(this,"_flagVisible",!0),w(this,"_flagCap",!0),w(this,"_flagJoin",!0),w(this,"_flagMiter",!0),w(this,"_flagStrokeAttenuation",!0),w(this,"_flagMask",!1),w(this,"_flagClip",!1),w(this,"_length",0),w(this,"_fill","#fff"),w(this,"_stroke","#000"),w(this,"_linewidth",1),w(this,"_opacity",1),w(this,"_visible",!0),w(this,"_cap","round"),w(this,"_join","round"),w(this,"_miter",4),w(this,"_closed",!0),w(this,"_curved",!1),w(this,"_automatic",!0),w(this,"_beginning",0),w(this,"_ending",1),w(this,"_mask",null),w(this,"_clip",!1),w(this,"_dashes",null),w(this,"_strokeAttenuation",!0);for(let o in $l)Object.defineProperty(this,o,$l[o]);this._renderer.type="path",this._renderer.flagVertices=El.bind(this),this._renderer.bindVertices=Nl.bind(this),this._renderer.unbindVertices=Pl.bind(this),this._renderer.flagFill=Fl.bind(this),this._renderer.flagStroke=Ml.bind(this),this._renderer.vertices=[],this._renderer.collection=[],this.closed=!!n,this.curved=!!r,this.beginning=0,this.ending=1,this.fill="#fff",this.stroke="#000",this.linewidth=1,this.opacity=1,this.className="",this.visible=!0,this.cap="butt",this.join="miter",this.miter=4,this.vertices=e,this.automatic=!s,this.dashes=[],this.dashes.offset=0}static fromObject(e){const n=typeof e.fill=="string"?e.fill:Jn(e.fill),r=typeof e.stroke=="string"?e.stroke:Jn(e.stroke),s=new Yn().copy(Os(Vs({},e),{fill:n,stroke:r}));return"id"in e&&(s.id=e.id),s}copy(e){if(super.copy.call(this,e),e.vertices){this.vertices=[];for(let n=0;n<e.vertices.length;n++){const r=e.vertices[n];r instanceof ve?this.vertices.push(e.vertices[n].clone()):this.vertices.push(new ve().copy(r))}}for(let n=0;n<Yn.Properties.length;n++){const r=Yn.Properties[n];r in e&&(this[r]=e[r])}return this}clone(e){const n=new Yn;for(let r=0;r<this.vertices.length;r++)n.vertices.push(this.vertices[r].clone());for(let r=0;r<Yn.Properties.length;r++){const s=Yn.Properties[r];n[s]=this[s]}return n.className=this.className,n.translation.copy(this.translation),n.rotation=this.rotation,n.scale=this.scale,n.skewX=this.skewX,n.skewY=this.skewY,this.matrix.manual&&n.matrix.copy(this.matrix),e&&e.add(n),n._update()}toObject(){const e=super.toObject.call(this);return e.renderer.type="path",e.vertices=this.vertices.map(n=>n.toObject()),K.each(Yn.Properties,n=>{typeof this[n]<"u"&&(this[n].toObject?e[n]=this[n].toObject():e[n]=this[n])},this),e}dispose(){if(super.dispose(),this.vertices&&typeof this.vertices.unbind=="function")try{this.vertices.unbind()}catch{}if(this.vertices)for(let e=0;e<this.vertices.length;e++){const n=this.vertices[e];typeof n.unbind=="function"&&n.unbind(),n.controls&&(n.controls.left&&typeof n.controls.left.unbind=="function"&&n.controls.left.unbind(),n.controls.right&&typeof n.controls.right.unbind=="function"&&n.controls.right.unbind())}return typeof this.fill=="object"&&this.fill&&"dispose"in this.fill?this.fill.dispose():typeof this.fill=="object"&&this.fill&&"unbind"in this.fill&&this.fill.unbind(),typeof this.stroke=="object"&&this.stroke&&"dispose"in this.stroke?this.stroke.dispose():typeof this.stroke=="object"&&this.stroke&&"unbind"in this.stroke&&this.stroke.unbind(),this}noFill(){return this.fill="none",this}noStroke(){return this.stroke="none",this.linewidth=0,this}corner(){const e=this.getBoundingClientRect(!0),n=e.width/2,r=e.height/2,s=e.left+e.width/2,o=e.top+e.height/2;for(let a=0;a<this.vertices.length;a++){const l=this.vertices[a];l.x-=s,l.y-=o,l.x+=n,l.y+=r}return this.mask&&(this.mask.translation.x-=s,this.mask.translation.x+=n,this.mask.translation.y-=o,this.mask.translation.y+=r),this}center(){const e=this.getBoundingClientRect(!0),n=e.left+e.width/2-this.translation.x,r=e.top+e.height/2-this.translation.y;for(let s=0;s<this.vertices.length;s++){const o=this.vertices[s];o.x-=n,o.y-=r}return this.mask&&(this.mask.translation.x-=n,this.mask.translation.y-=r),this}getBoundingClientRect(e){let n,r,s,o,a,l,c=1/0,d=-1/0,h=1/0,u=-1/0;if(this._update(!0),n=e?this.matrix:this.worldMatrix,r=(this.linewidth||0)/2,s=this._renderer.vertices.length,this.linewidth>0||this.stroke&&!/(transparent|none)/i.test(this.stroke))if(this.matrix.manual){const{scaleX:m,scaleY:g}=Qn(n.elements[0],n.elements[3],n.elements[1],n.elements[4],n.elements[2],n.elements[5]);typeof m=="number"&&typeof g=="number"&&(r=Math.max(m,g)*(this.linewidth||0)/2)}else r*=typeof this.scale=="number"?this.scale:Math.max(this.scale.x,this.scale.y);if(s<=0)return{width:0,height:0};for(o=0;o<s;o++){l=this._renderer.vertices[o],a=this._renderer.vertices[(o+s-1)%s];const[m,g]=n.multiply(a.x,a.y),[f,p]=n.multiply(l.x,l.y);if(a.controls&&l.controls){let y=a.controls.right.x,b=a.controls.right.y;a.relative&&(y+=a.x,b+=a.y);let[_,C]=n.multiply(y,b),S=l.controls.left.x,v=l.controls.left.y;l.relative&&(S+=l.x,v+=l.y);let[B,k]=n.multiply(S,v);const R=cl(m,g,_,C,B,k,f,p);h=Mi(R.min.y-r,h),c=Mi(R.min.x-r,c),d=Ai(R.max.x+r,d),u=Ai(R.max.y+r,u)}else o<=1&&(h=Mi(g-r,h),c=Mi(m-r,c),d=Ai(m+r,d),u=Ai(g+r,u)),h=Mi(p-r,h),c=Mi(f-r,c),d=Ai(f+r,d),u=Ai(p+r,u)}return{top:h,left:c,right:d,bottom:u,width:d-c,height:u-h}}getPointAt(e,n){let r,s,o,a,l,c,d,h,u,m,g,f,p,y,b,_=this.length*Math.min(Math.max(e,0),1);const C=this.vertices.length,S=C-1;let v=null,B=null;for(let E=0,N=this._lengths.length,H=0;E<N;E++){if(H+this._lengths[E]>=_){this._closed?(r=Pt(E,C),s=Pt(E-1,C),E===0&&(r=s,s=E)):(r=E,s=Math.min(Math.max(E-1,0),S)),v=this.vertices[r],B=this.vertices[s],_-=H,this._lengths[E]!==0?e=_/this._lengths[E]:e=0;break}H+=this._lengths[E]}if(v===null||B===null)return null;if(v){if(!B)return v}else return B;b=B.controls&&B.controls.right,y=v.controls&&v.controls.left,l=B.x,m=B.y,c=(b||B).x,g=(b||B).y,d=(y||v).x,f=(y||v).y,h=v.x,p=v.y,b&&B.relative&&(c+=B.x,g+=B.y),y&&v.relative&&(d+=v.x,f+=v.y),a=ir(e,l,c,d,h),u=ir(e,m,g,f,p);const k=Nt(l,c,e),R=Nt(m,g,e),$=Nt(c,d,e),P=Nt(g,f,e),I=Nt(d,h,e),V=Nt(f,p,e),A=Nt(k,$,e),L=Nt(R,P,e),D=Nt($,I,e),ee=Nt(P,V,e);return K.isObject(n)?(n.x=a,n.y=u,n instanceof ve&&(n.controls.left.x=A,n.controls.left.y=L,n.controls.right.x=D,n.controls.right.y=ee,(typeof n.relative!="boolean"||n.relative)&&(n.controls.left.x-=a,n.controls.left.y-=u,n.controls.right.x-=a,n.controls.right.y-=u)),n.t=e,n):(o=new ve(a,u,A-a,L-u,D-a,ee-u,this._curved?te.curve:te.line),o.t=e,o)}plot(){if(this.curved)return hl(this._collection,this.closed),this;for(let e=0;e<this._collection.length;e++)this._collection[e].command=e===0?te.move:te.line;return this}subdivide(e){this._update();const n=this.vertices.length-1,r=this._closed||this.vertices[n]._command===te.close;let s=this.vertices[n],o=[],a;return K.each(this.vertices,function(l,c){if(c<=0&&!r){s=l;return}if(l.command===te.move){o.push(new ve(s.x,s.y)),c>0&&(o[o.length-1].command=te.line),s=l;return}a=Cl(l,s,e),o=o.concat(a),K.each(a,function(d,h){h<=0&&s.command===te.move?d.command=te.move:d.command=te.line}),c>=n&&(this._closed&&this._automatic&&(s=l,a=Cl(l,s,e),o=o.concat(a),K.each(a,function(d,h){h<=0&&s.command===te.move?d.command=te.move:d.command=te.line})),o.push(new ve(l.x,l.y)),o[o.length-1].command=r?te.close:te.line),s=l},this),this._automatic=!1,this._curved=!1,this.vertices=o,this}_updateLength(e,n){n||this._update();const s=this.vertices.length-1;let o=this.vertices[s],a=0;return typeof this._lengths>"u"&&(this._lengths=[]),K.each(this.vertices,function(l,c){if(c<=0||l.command===te.move){o=l,this._lengths[c]=0;return}this._lengths[c]=kl(l,o,e),a+=this._lengths[c],o=l},this),this._length=a,this._flagLength=!1,this}_update(){if(this._flagVertices){this._automatic&&this.plot(),this._flagLength&&this._updateLength(void 0,!0);const e=this._collection.length,n=this._closed,r=Math.min(this._beginning,this._ending),s=Math.max(this._beginning,this._ending),o=Ar(this,r*this._length),a=Ar(this,s*this._length),l=om(o),c=am(a);let d,h,u,m,g,f;for(this._renderer.vertices.length=0,f=0;f<e;f++)this._renderer.collection.length<=f&&this._renderer.collection.push(new ve),f>c&&!h?(g=this._renderer.collection[f].copy(this._collection[f]),this.getPointAt(s,g),g.command=this._renderer.collection[f].command,this._renderer.vertices.push(g),h=g,u=this._collection[f-1],u&&u.controls&&(g.relative?g.controls.right.clear():g.controls.right.copy(g),u.relative?this._renderer.collection[f-1].controls.right.copy(u.controls.right).lerp(Q.zero,1-g.t):this._renderer.collection[f-1].controls.right.copy(u.controls.right).lerp(u,1-g.t))):f>=l&&f<=c&&(g=this._renderer.collection[f].copy(this._collection[f]),this._renderer.vertices.push(g),f===c&&vl(this,s)?(h=g,!n&&h.controls&&(h.relative?h.controls.right.clear():h.controls.right.copy(h))):f===l&&vl(this,r)&&(d=g,d.command=te.move,!n&&d.controls&&(d.relative?d.controls.left.clear():d.controls.left.copy(d))));l>0&&!d&&(f=l-1,g=this._renderer.collection[f].copy(this._collection[f]),this.getPointAt(r,g),g.command=te.move,this._renderer.vertices.unshift(g),m=this._collection[f+1],m&&m.controls&&(g.controls.left.clear(),m.relative?this._renderer.collection[f+1].controls.left.copy(m.controls.left).lerp(Q.zero,g.t):(lm.copy(m),this._renderer.collection[f+1].controls.left.copy(m.controls.left).lerp(m,g.t))))}return On.prototype._update.apply(this,arguments),this}flagReset(){return this._flagVertices=this._flagLength=this._flagFill=this._flagStroke=this._flagLinewidth=this._flagOpacity=this._flagVisible=this._flagCap=this._flagJoin=this._flagMiter=this._flagClip=this._flagStrokeAttenuation=!1,On.prototype.flagReset.call(this),this}};w(Us,"Properties",["fill","stroke","linewidth","opacity","visible","cap","join","miter","closed","curved","automatic","beginning","ending","dashes","strokeAttenuation"]),w(Us,"Utils",{getCurveLength:kl});var Se=Us,$l={linewidth:{enumerable:!0,get:function(){return this._linewidth},set:function(t){this._linewidth=t,this._flagLinewidth=!0}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(t){this._opacity=t,this._flagOpacity=!0}},visible:{enumerable:!0,get:function(){return this._visible},set:function(t){this._visible=t,this._flagVisible=!0}},cap:{enumerable:!0,get:function(){return this._cap},set:function(t){this._cap=t,this._flagCap=!0}},join:{enumerable:!0,get:function(){return this._join},set:function(t){this._join=t,this._flagJoin=!0}},miter:{enumerable:!0,get:function(){return this._miter},set:function(t){this._miter=t,this._flagMiter=!0}},fill:{enumerable:!0,get:function(){return this._fill},set:function(t){(this._fill instanceof Qe||this._fill instanceof We||this._fill instanceof je||this._fill instanceof Pe)&&this._fill.unbind(X.Types.change,this._renderer.flagFill),this._fill=t,this._flagFill=!0,(this._fill instanceof Qe||this._fill instanceof We||this._fill instanceof je||this._fill instanceof Pe)&&this._fill.bind(X.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(t){(this._stroke instanceof Qe||this._stroke instanceof We||this._stroke instanceof je||this._stroke instanceof Pe)&&this._stroke.unbind(X.Types.change,this._renderer.flagStroke),this._stroke=t,this._flagStroke=!0,(this._stroke instanceof Qe||this._stroke instanceof We||this._stroke instanceof je||this._stroke instanceof Pe)&&this._stroke.bind(X.Types.change,this._renderer.flagStroke)}},length:{get:function(){return this._flagLength&&this._updateLength(),this._length}},closed:{enumerable:!0,get:function(){return this._closed},set:function(t){this._closed=!!t,this._flagVertices=!0}},curved:{enumerable:!0,get:function(){return this._curved},set:function(t){this._curved=!!t,this._flagVertices=!0}},automatic:{enumerable:!0,get:function(){return this._automatic},set:function(t){if(t===this._automatic)return;this._automatic=!!t;const e=this._automatic?"ignore":"listen";K.each(this.vertices,function(n){n[e]()})}},beginning:{enumerable:!0,get:function(){return this._beginning},set:function(t){this._beginning=t,this._flagVertices=!0}},ending:{enumerable:!0,get:function(){return this._ending},set:function(t){this._ending=t,this._flagVertices=!0}},vertices:{enumerable:!0,get:function(){return this._collection},set:function(t){const e=this._renderer.bindVertices,n=this._renderer.unbindVertices;this._collection&&this._collection.unbind(X.Types.insert,e).unbind(X.Types.remove,n),t instanceof An?this._collection=t:this._collection=new An(t||[]),this._collection.bind(X.Types.insert,e).bind(X.Types.remove,n),e(this._collection)}},mask:{enumerable:!0,get:function(){return this._mask},set:function(t){this._mask=t,this._flagMask=!0,K.isObject(t)&&!t.clip&&(t.clip=!0)}},clip:{enumerable:!0,get:function(){return this._clip},set:function(t){this._clip=t,this._flagClip=!0}},dashes:{enumerable:!0,get:function(){return this._dashes},set:function(t){typeof t.offset!="number"&&(t.offset=this.dashes&&this._dashes.offset||0),this._dashes=t}},strokeAttenuation:{enumerable:!0,get:function(){return this._strokeAttenuation},set:function(t){this._strokeAttenuation=!!t,this._flagStrokeAttenuation=!0,this._flagLinewidth=!0}}};function El(){this._flagVertices=!0,this._flagLength=!0,this.parent&&(this.parent._flagLength=!0)}function Nl(t){let e=t.length;for(;e--;)t[e].bind(X.Types.change,this._renderer.flagVertices);this._renderer.flagVertices()}function Pl(t){let e=t.length;for(;e--;)t[e].unbind(X.Types.change,this._renderer.flagVertices);this._renderer.flagVertices()}function Fl(){this._flagFill=!0}function Ml(){this._flagStroke=!0}var Al=class Br extends Se{constructor(e,n,r,s){const o=[new ve,new ve,new ve,new ve];super(o,!0,!1,!0),w(this,"_flagWidth",!1),w(this,"_flagHeight",!1),w(this,"_width",0),w(this,"_height",0),w(this,"_origin",null),this._renderer.type="rectangle";for(let a in Vl)Object.defineProperty(this,a,Vl[a]);this.width=typeof r=="number"?r:1,this.height=typeof s=="number"?s:1,this.origin=new Q,typeof e=="number"&&(this.translation.x=e),typeof n=="number"&&(this.translation.y=n),this._update()}static fromObject(e){const n=new Br().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<Br.Properties.length;n++){const r=Br.Properties[n];r in e&&(typeof e[r]=="number"?this[r]=e[r]:this[r]instanceof Q&&this[r].copy(e[r]))}return this}_update(){if(this._flagVertices||this._flagWidth||this._flagHeight){const e=this._width/2,n=this._height/2;!this._closed&&this.vertices.length===4&&this.vertices.push(new ve),this.vertices[0].set(-e,-n).sub(this._origin).command=te.move,this.vertices[1].set(e,-n).sub(this._origin).command=te.line,this.vertices[2].set(e,n).sub(this._origin).command=te.line,this.vertices[3].set(-e,n).sub(this._origin).command=te.line,this.vertices[4]&&(this.vertices[4].set(-e,-n).sub(this._origin).command=te.line)}return super._update.call(this),this}flagReset(){return this._flagWidth=this._flagHeight=!1,super.flagReset.call(this),this}clone(e){const n=new Br(0,0,this.width,this.height);n.translation.copy(this.translation),n.rotation=this.rotation,n.scale=this.scale,n.skewX=this.skewX,n.skewY=this.skewY,this.matrix.manual&&n.matrix.copy(this.matrix);for(let r=0;r<Se.Properties.length;r++){const s=Se.Properties[r];n[s]instanceof Q?n[s].copy(this[s]):n[s]=this[s]}return e&&e.add(n),n}toObject(){const e=super.toObject.call(this);return e.renderer.type="rectangle",e.width=this.width,e.height=this.height,e.origin=this.origin.toObject(),e}};w(Al,"Properties",["width","height","origin"]);var In=Al,Vl={width:{enumerable:!0,get:function(){return this._width},set:function(t){this._width=t,this._flagWidth=!0}},height:{enumerable:!0,get:function(){return this._height},set:function(t){this._height=t,this._flagHeight=!0}},origin:{enumerable:!0,get:function(){return this._origin},set:function(t){this._origin&&this._origin.unbind(X.Types.change,this._renderer.flagVertices),this._origin=t,this._origin.bind(X.Types.change,this._renderer.flagVertices),this._renderer.flagVertices()}}},Ol=class Tr extends In{constructor(e,n,r,s,o,a){super(n,r,0,0),w(this,"_flagTexture",!1),w(this,"_flagColumns",!1),w(this,"_flagRows",!1),w(this,"_flagFrameRate",!1),w(this,"_flagIndex",!1),w(this,"_amount",1),w(this,"_duration",0),w(this,"_startTime",0),w(this,"_playing",!1),w(this,"_firstFrame",0),w(this,"_lastFrame",0),w(this,"_loop",!0),w(this,"_texture",null),w(this,"_columns",1),w(this,"_rows",1),w(this,"_frameRate",0),w(this,"_index",0),w(this,"_origin",null),this._renderer.type="sprite";for(let l in Il)Object.defineProperty(this,l,Il[l]);this.noStroke(),this.noFill(),e instanceof Pe?this.texture=e:typeof e=="string"&&(this.texture=new Pe(e)),this.origin=new Q,this._update(),typeof s=="number"&&(this.columns=s),typeof o=="number"&&(this.rows=o),typeof a=="number"&&(this.frameRate=a),this.index=0}static fromObject(e){const n=new Tr().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<Tr.Properties.length;n++){const r=Tr.Properties[n];r in e&&(this[r]=e[r])}return this}play(e,n,r){return this._playing=!0,this._firstFrame=0,this._lastFrame=this.amount-1,this._startTime=K.performance.now(),typeof e=="number"&&(this._firstFrame=e),typeof n=="number"&&(this._lastFrame=n),typeof r=="function"?this._onLastFrame=r:delete this._onLastFrame,this._index!==this._firstFrame&&(this._startTime-=1e3*Math.abs(this._index-this._firstFrame)/this._frameRate),this}pause(){return this._playing=!1,this}stop(){return this._playing=!1,this._index=0,this}clone(e){const n=new Tr(this.texture,this.translation.x,this.translation.y,this.columns,this.rows,this.frameRate);return this.playing&&n.play(this._firstFrame,this._lastFrame),n.loop=this.loop,n.firstFrame=this.firstFrame,n.lastFrame=this.lastFrame,e&&e.add(n),n}toObject(){const e=super.toObject.call(this);return e.renderer.type="sprite",e.texture=this.texture.toObject(),e.columns=this.columns,e.rows=this.rows,e.frameRate=this.frameRate,e.index=this.index,e.firstFrame=this.firstFrame,e.lastFrame=this.lastFrame,e.loop=this.loop,e}dispose(){return super.dispose(),this._playing&&(this._playing=!1),this._onLastFrame=null,this._startTime=0,this._texture&&typeof this._texture.dispose=="function"?this._texture.dispose():this._texture&&typeof this._texture.unbind=="function"&&this._texture.unbind(),this}_update(){const e=this._texture,n=this._columns,r=this._rows;let s,o,a,l,c,d,h,u,m;if(e&&((this._flagColumns||this._flagRows)&&(this._amount=this._columns*this._rows),this._flagFrameRate&&(this._duration=1e3*this._amount/this._frameRate),this._flagTexture&&(this.fill=e),e.loaded)){h=e.image.width,u=e.image.height,s=h/n,o=u/r,l=this._amount,this.width!==s&&(this.width=s),this.height!==o&&(this.height=o),this._playing&&this._frameRate>0&&(K.isNaN(this._lastFrame)&&(this._lastFrame=l-1),a=K.performance.now()-this._startTime,m=this._lastFrame+1,c=1e3*(m-this._firstFrame)/this._frameRate,this._loop?a=a%c:a=Math.min(a,c),d=Nt(this._firstFrame,m,a/c),d=Math.floor(d),d!==this._index&&(this._index=d,d>=this._lastFrame-1&&this._onLastFrame&&this._onLastFrame()));const g=this._index%n,f=Math.floor(this._index/n),p=-s*g+(h-s)/2,y=-o*f+(u-o)/2;p!==e.offset.x&&(e.offset.x=p),y!==e.offset.y&&(e.offset.y=y)}return super._update.call(this),this}flagReset(){return this._flagTexture=this._flagColumns=this._flagRows=this._flagFrameRate=!1,super.flagReset.call(this),this}};w(Ol,"Properties",["texture","columns","rows","frameRate","index","firstFrame","lastFrame","loop"]);var Or=Ol,Il={texture:{enumerable:!0,get:function(){return this._texture},set:function(t){this._texture=t,this._flagTexture=!0}},columns:{enumerable:!0,get:function(){return this._columns},set:function(t){this._columns=t,this._flagColumns=!0}},rows:{enumerable:!0,get:function(){return this._rows},set:function(t){this._rows=t,this._flagRows=!0}},frameRate:{enumerable:!0,get:function(){return this._frameRate},set:function(t){this._frameRate=t,this._flagFrameRate=!0}},index:{enumerable:!0,get:function(){return this._index},set:function(t){this._index=t,this._flagIndex=!0}},firstFrame:{enumerable:!0,get:function(){return this._firstFrame},set:function(t){this._firstFrame=t}},lastFrame:{enumerable:!0,get:function(){return this._lastFrame},set:function(t){this._lastFrame=t}},loop:{enumerable:!0,get:function(){return this._loop},set:function(t){this._loop=!!t}}},Gs,zl=class extends An{constructor(e){e=Array.isArray(e)?e:Array.prototype.slice.call(arguments),super(e),el(this,Gs,{}),this.attach(e),this.on(X.Types.insert,this.attach),this.on(X.Types.remove,this.detach)}get ids(){return Tt(this,Gs)}attach(e){for(let n=0;n<e.length;n++){const r=e[n];r&&r.id&&(this.ids[r.id]=r)}return this}detach(e){for(let n=0;n<e.length;n++)delete this.ids[e[n].id];return this}};Gs=new WeakMap;var Ll=class Ci extends Se{constructor(e,n,r,s,o,a,l){const c=l||wt.Resolution*3,d=[];for(let h=0;h<c;h++)d.push(new ve);super(d,!0,!1,!0),w(this,"_flagStartAngle",!1),w(this,"_flagEndAngle",!1),w(this,"_flagInnerRadius",!1),w(this,"_flagOuterRadius",!1),w(this,"_startAngle",0),w(this,"_endAngle",at),w(this,"_innerRadius",0),w(this,"_outerRadius",0),this._renderer.type="arc-segment";for(let h in Dl)Object.defineProperty(this,h,Dl[h]);typeof r=="number"&&(this.innerRadius=r),typeof s=="number"&&(this.outerRadius=s),typeof o=="number"&&(this.startAngle=o),typeof a=="number"&&(this.endAngle=a),this._update(),typeof e=="number"&&(this.translation.x=e),typeof n=="number"&&(this.translation.y=n)}static fromObject(e){const n=new Ci().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<Ci.Properties.length;n++){const r=Ci.Properties[n];r in e&&typeof e[r]=="number"&&(this[r]=e[r])}return this}_update(){if(this._flagVertices||this._flagStartAngle||this._flagEndAngle||this._flagInnerRadius||this._flagOuterRadius){const e=this._startAngle,n=this._endAngle,r=this._innerRadius,s=this._outerRadius,o=Pt(e,at)===Pt(n,at),a=r>0,l=this.vertices;let c=a?l.length/2:l.length,d,h=0,u,m,g,f,p,y,b,_,C;for(o?c--:a||(c-=2),u=0,m=c-1;u<c;u++){switch(g=u/m,f=l[h],p=g*(n-e)+e,y=(n-e)/c,b=s*Math.cos(p),_=s*Math.sin(p),u){case 0:d=te.move;break;default:d=te.curve}f.command=d,f.x=b,f.y=_,f.controls.left.clear(),f.controls.right.clear(),f.command===te.curve&&(C=s*y/Math.PI,f.controls.left.x=C*Math.cos(p-Ze),f.controls.left.y=C*Math.sin(p-Ze),f.controls.right.x=C*Math.cos(p+Ze),f.controls.right.y=C*Math.sin(p+Ze),u===1&&f.controls.left.multiplyScalar(2),u===m&&f.controls.right.multiplyScalar(2)),h++}if(a){for(o?(l[h].command=te.close,h++):(c--,m=c-1),u=0;u<c;u++)g=u/m,f=l[h],p=(1-g)*(n-e)+e,y=(n-e)/c,b=r*Math.cos(p),_=r*Math.sin(p),d=te.curve,u<=0&&(d=o?te.move:te.line),f.command=d,f.x=b,f.y=_,f.controls.left.clear(),f.controls.right.clear(),f.command===te.curve&&(C=r*y/Math.PI,f.controls.left.x=C*Math.cos(p+Ze),f.controls.left.y=C*Math.sin(p+Ze),f.controls.right.x=C*Math.cos(p-Ze),f.controls.right.y=C*Math.sin(p-Ze),u===1&&f.controls.left.multiplyScalar(2),u===m&&f.controls.right.multiplyScalar(2)),h++;l[h].copy(l[0]),l[h].command=te.line}else o||(l[h].command=te.line,l[h].x=0,l[h].y=0,h++,l[h].copy(l[0]),l[h].command=te.line)}return super._update.call(this),this}flagReset(){return super.flagReset.call(this),this._flagStartAngle=this._flagEndAngle=this._flagInnerRadius=this._flagOuterRadius=!1,this}clone(e){const n=this.innerRadius,r=this.outerRadius,s=this.startAngle,o=this.endAngle,a=this.vertices.length,l=new Ci(0,0,n,r,s,o,a);l.translation.copy(this.translation),l.rotation=this.rotation,l.scale=this.scale,l.skewX=this.skewX,l.skewY=this.skewY,this.matrix.manual&&l.matrix.copy(this.matrix);for(let c=0;c<Se.Properties.length;c++){const d=Se.Properties[c];l[d]=this[d]}return e&&e.add(l),l}toObject(){const e=super.toObject.call(this);e.renderer.type="arc-segment";for(let n=0;n<Ci.Properties.length;n++){const r=Ci.Properties[n];e[r]=this[r]}return e}};w(Ll,"Properties",["startAngle","endAngle","innerRadius","outerRadius"]);var Ks=Ll,Dl={startAngle:{enumerable:!0,get:function(){return this._startAngle},set:function(t){this._startAngle=t,this._flagStartAngle=!0}},endAngle:{enumerable:!0,get:function(){return this._endAngle},set:function(t){this._endAngle=t,this._flagEndAngle=!0}},innerRadius:{enumerable:!0,get:function(){return this._innerRadius},set:function(t){this._innerRadius=t,this._flagInnerRadius=!0}},outerRadius:{enumerable:!0,get:function(){return this._outerRadius},set:function(t){this._outerRadius=t,this._flagOuterRadius=!0}}},Zs=Math.cos,Qs=Math.sin,Hl=class Si extends Se{constructor(e,n,r,s){const o=s?Math.max(s,2):4,a=[];for(let l=0;l<o;l++)a.push(new ve(0,0,0,0,0,0));super(a,!0,!0,!0),w(this,"_flagRadius",!1),w(this,"_radius",0),this._renderer.type="circle";for(let l in Wl)Object.defineProperty(this,l,Wl[l]);typeof r=="number"&&(this.radius=r),this._update(),typeof e=="number"&&(this.translation.x=e),typeof n=="number"&&(this.translation.y=n)}static fromObject(e){const n=new Si().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<Si.Properties.length;n++){const r=Si.Properties[n];r in e&&typeof e[r]=="number"&&(this[r]=e[r])}return this}_update(){if(this._flagVertices||this._flagRadius){let e=this.vertices.length;!this._closed&&e>2&&(e-=1);const n=4/3*Math.tan(Math.PI/(e*2)),r=this._radius,s=r*n;for(let o=0;o<this.vertices.length;o++){const l=o/e*at,c=r*Zs(l),d=r*Qs(l),h=s*Zs(l-Ze),u=s*Qs(l-Ze),m=s*Zs(l+Ze),g=s*Qs(l+Ze),f=this.vertices[o];f.command=o===0?te.move:te.curve,f.set(c,d),f.controls.left.set(h,u),f.controls.right.set(m,g)}}return super._update.call(this),this}flagReset(){return this._flagRadius=!1,super.flagReset.call(this),this}clone(e){const n=new Si(0,0,this.radius,this.vertices.length);n.translation.copy(this.translation),n.rotation=this.rotation,n.scale=this.scale,n.skewX=this.skewX,n.skewY=this.skewY,this.matrix.manual&&n.matrix.copy(this.matrix);for(let r=0;r<Se.Properties.length;r++){const s=Se.Properties[r];n[s]=this[s]}return e&&e.add(n),n}toObject(){const e=super.toObject.call(this);e.renderer.type="circle";for(let n=0;n<Si.Properties.length;n++){const r=Si.Properties[n];e[r]=this[r]}return e}};w(Hl,"Properties",["radius"]);var Ir=Hl,Wl={radius:{enumerable:!0,get:function(){return this._radius},set:function(t){this._radius=t,this._flagRadius=!0}}},Js=Math.cos,eo=Math.sin,jl=class Bi extends Se{constructor(e,n,r,s,o){typeof s!="number"&&typeof r=="number"&&(s=r);const a=o?Math.max(o,2):4,l=[];for(let c=0;c<a;c++)l.push(new ve);super(l,!0,!0,!0),w(this,"_flagWidth",!1),w(this,"_flagHeight",!1),w(this,"_width",0),w(this,"_height",0),this._renderer.type="ellipse";for(let c in ql)Object.defineProperty(this,c,ql[c]);typeof r=="number"&&(this.width=r*2),typeof s=="number"&&(this.height=s*2),this._update(),typeof e=="number"&&(this.translation.x=e),typeof n=="number"&&(this.translation.y=n)}static fromObject(e){const n=new Bi().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<Bi.Properties.length;n++){const r=Bi.Properties[n];r in e&&typeof e[r]=="number"&&(this[r]=e[r])}return this}_update(){if(this._flagVertices||this._flagWidth||this._flagHeight){let e=this.vertices.length;!this._closed&&e>2&&(e-=1);const n=4/3*Math.tan(Math.PI/(this.vertices.length*2)),r=this._width/2,s=this._height/2;for(let o=0;o<this.vertices.length;o++){const l=o/e*at,c=r*Js(l),d=s*eo(l),h=r*n*Js(l-Ze),u=s*n*eo(l-Ze),m=r*n*Js(l+Ze),g=s*n*eo(l+Ze),f=this.vertices[o];f.command=o===0?te.move:te.curve,f.set(c,d),f.controls.left.set(h,u),f.controls.right.set(m,g)}}return super._update.call(this),this}flagReset(){return this._flagWidth=this._flagHeight=!1,super.flagReset.call(this),this}clone(e){const n=this.width/2,r=this.height/2,s=this.vertices.length,o=new Bi(0,0,n,r,s);o.translation.copy(this.translation),o.rotation=this.rotation,o.scale=this.scale,o.skewX=this.skewX,o.skewY=this.skewY,this.matrix.manual&&o.matrix.copy(this.matrix);for(let a=0;a<Se.Properties.length;a++){const l=Se.Properties[a];o[l]=this[l]}return e&&e.add(o),o}toObject(){const e=super.toObject.call(this);e.renderer.type="ellipse";for(let n=0;n<Bi.Properties.length;n++){const r=Bi.Properties[n];e[r]=this[r]}return e}};w(jl,"Properties",["width","height"]);var zr=jl,ql={width:{enumerable:!0,get:function(){return this._width},set:function(t){this._width=t,this._flagWidth=!0}},height:{enumerable:!0,get:function(){return this._height},set:function(t){this._height=t,this._flagHeight=!0}}},cm=Math.ceil,dm=Math.floor,Xl=class Un extends On{constructor(e){super(),w(this,"_flagVertices",!0),w(this,"_flagLength",!0),w(this,"_flagFill",!0),w(this,"_flagStroke",!0),w(this,"_flagLinewidth",!0),w(this,"_flagOpacity",!0),w(this,"_flagVisible",!0),w(this,"_flagSize",!0),w(this,"_flagSizeAttenuation",!0),w(this,"_flagStrokeAttenuation",!0),w(this,"_length",0),w(this,"_fill","#fff"),w(this,"_stroke","#000"),w(this,"_linewidth",1),w(this,"_opacity",1),w(this,"_visible",!0),w(this,"_size",1),w(this,"_sizeAttenuation",!1),w(this,"_beginning",0),w(this,"_ending",1),w(this,"_dashes",null),w(this,"_strokeAttenuation",!0),w(this,"noFill",Se.prototype.noFill),w(this,"noStroke",Se.prototype.noStroke),w(this,"corner",Se.prototype.corner),w(this,"center",Se.prototype.center),w(this,"getBoundingClientRect",Se.prototype.getBoundingClientRect),w(this,"_updateLength",Se.prototype._updateLength);for(let n in Yl)Object.defineProperty(this,n,Yl[n]);this._renderer.type="points",this._renderer.flagVertices=El.bind(this),this._renderer.bindVertices=Nl.bind(this),this._renderer.unbindVertices=Pl.bind(this),this._renderer.flagFill=Fl.bind(this),this._renderer.flagStroke=Ml.bind(this),this._renderer.vertices=null,this._renderer.collection=null,this.size=1,this.sizeAttenuation=!1,this.beginning=0,this.ending=1,this.fill="#fff",this.stroke="#000",this.linewidth=1,this.opacity=1,this.className="",this.visible=!0,this.vertices=e,this.dashes=[],this.dashes.offset=0}static fromObject(e){const n=typeof e.fill=="string"?e.fill:Jn(e.fill),r=typeof e.stroke=="string"?e.stroke:Jn(e.stroke),s=new Un().copy(Os(Vs({},e),{fill:n,stroke:r}));return"id"in e&&(s.id=e.id),s}copy(e){super.copy.call(this,e);for(let n=0;n<e.vertices.length;n++){const r=e.vertices[n];r instanceof ve?this.vertices.push(e.vertices[n].clone()):this.vertices.push(new ve().copy(r))}for(let n=0;n<Un.Properties.length;n++){const r=Un.Properties[n];r in e&&(this[r]=e[r])}return this}clone(e){const n=new Un;for(let r=0;r<this.vertices.length;r++)n.vertices.push(this.vertices[r].clone());for(let r=0;r<Un.Properties.length;r++){const s=Un.Properties[r];n[s]=this[s]}return n.className=this.className,n.translation.copy(this.translation),n.rotation=this.rotation,n.scale=this.scale,n.skewX=this.skewX,n.skewY=this.skewY,this.matrix.manual&&n.matrix.copy(this.matrix),e&&e.add(n),n._update()}toObject(){const e=super.toObject.call(this);return e.renderer.type="points",e.vertices=this.vertices.map(n=>n.toObject()),K.each(Un.Properties,function(n){typeof this[n]<"u"&&(this[n].toObject?e[n]=this[n].toObject():e[n]=this[n])},this),e}dispose(){if(super.dispose(),this.vertices&&typeof this.vertices.unbind=="function")try{this.vertices.unbind()}catch{}if(this.vertices)for(let e=0;e<this.vertices.length;e++){const n=this.vertices[e];typeof n.unbind=="function"&&n.unbind()}return typeof this.fill=="object"&&this.fill&&"dispose"in this.fill?this.fill.dispose():typeof this.fill=="object"&&this.fill&&"unbind"in this.fill&&this.fill.unbind(),typeof this.stroke=="object"&&this.stroke&&"dispose"in this.stroke?this.stroke.dispose():typeof this.stroke=="object"&&this.stroke&&"unbind"in this.stroke&&this.stroke.unbind(),this}subdivide(e){this._update();let n=[];for(let r=0;r<this.vertices.length;r++){const s=this.vertices[r],o=this.vertices[r-1];if(!o)continue;const a=s.x,l=s.y,c=o.x,d=o.y,h=Ls(a,l,a,l,c,d,c,d,e);n=n.concat(h)}return this.vertices=n,this}_update(){if(this._flagVertices){this._flagLength&&this._updateLength(void 0,!0);const e=Math.min(this._beginning,this._ending),n=Math.max(this._beginning,this._ending),r=Ar(this,e*this._length),s=Ar(this,n*this._length),o=cm(r),a=dm(s);let l=0,c;this._renderer.vertices=[],this._renderer.collection=[];for(let d=0;d<this._collection.length;d++)d>=o&&d<=a&&(c=this._collection[d],this._renderer.collection.push(c),this._renderer.vertices[l*2+0]=c.x,this._renderer.vertices[l*2+1]=c.y,l++)}return super._update.apply(this,arguments),this}flagReset(){return this._flagVertices=this._flagLength=this._flagFill=this._flagStroke=this._flagLinewidth=this._flagOpacity=this._flagVisible=this._flagSize=this._flagSizeAttenuation=!1,super.flagReset.call(this),this}};w(Xl,"Properties",["fill","stroke","linewidth","opacity","visible","size","sizeAttenuation","beginning","ending","dashes","strokeAttenuation"]);var to=Xl,Yl={linewidth:{enumerable:!0,get:function(){return this._linewidth},set:function(t){this._linewidth=t,this._flagLinewidth=!0}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(t){this._opacity=t,this._flagOpacity=!0}},visible:{enumerable:!0,get:function(){return this._visible},set:function(t){this._visible=t,this._flagVisible=!0}},size:{enumerable:!0,get:function(){return this._size},set:function(t){this._size=t,this._flagSize=!0}},sizeAttenuation:{enumerable:!0,get:function(){return this._sizeAttenuation},set:function(t){this._sizeAttenuation=t,this._flagSizeAttenuation=!0}},fill:{enumerable:!0,get:function(){return this._fill},set:function(t){(this._fill instanceof Qe||this._fill instanceof We||this._fill instanceof je||this._fill instanceof Pe)&&this._fill.unbind(X.Types.change,this._renderer.flagFill),this._fill=t,this._flagFill=!0,(this._fill instanceof Qe||this._fill instanceof We||this._fill instanceof je||this._fill instanceof Pe)&&this._fill.bind(X.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(t){(this._stroke instanceof Qe||this._stroke instanceof We||this._stroke instanceof je||this._stroke instanceof Pe)&&this._stroke.unbind(X.Types.change,this._renderer.flagStroke),this._stroke=t,this._flagStroke=!0,(this._stroke instanceof Qe||this._stroke instanceof We||this._stroke instanceof je||this._stroke instanceof Pe)&&this._stroke.bind(X.Types.change,this._renderer.flagStroke)}},length:{get:function(){return this._flagLength&&this._updateLength(),this._length}},beginning:{enumerable:!0,get:function(){return this._beginning},set:function(t){this._beginning=t,this._flagVertices=!0}},ending:{enumerable:!0,get:function(){return this._ending},set:function(t){this._ending=t,this._flagVertices=!0}},vertices:{enumerable:!0,get:function(){return this._collection},set:function(t){const e=this._renderer.bindVertices,n=this._renderer.unbindVertices;this._collection&&this._collection.unbind(X.Types.insert,e).unbind(X.Types.remove,n),t instanceof An?this._collection=t:this._collection=new An(t||[]),this._collection.bind(X.Types.insert,e).bind(X.Types.remove,n),e(this._collection)}},dashes:{enumerable:!0,get:function(){return this._dashes},set:function(t){typeof t.offset!="number"&&(t.offset=this.dashes&&this._dashes.offset||0),this._dashes=t}},strokeAttenuation:{enumerable:!0,get:function(){return this._strokeAttenuation},set:function(t){this._strokeAttenuation=!!t,this._flagStrokeAttenuation=!0,this._flagLinewidth=!0}}},hm=Math.cos,um=Math.sin,Ul=class Ti extends Se{constructor(e,n,r,s){s=Math.max(s||0,3),super(),w(this,"_flagWidth",!1),w(this,"_flagHeight",!1),w(this,"_flagSides",!1),w(this,"_radius",0),w(this,"_width",0),w(this,"_height",0),w(this,"_sides",0),this._renderer.type="polygon";for(let o in Gl)Object.defineProperty(this,o,Gl[o]);this.closed=!0,this.automatic=!1,typeof r=="number"&&(this.radius=r),typeof s=="number"&&(this.sides=s),this._update(),typeof e=="number"&&(this.translation.x=e),typeof n=="number"&&(this.translation.y=n)}static fromObject(e){const n=new Ti().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<Ti.Properties.length;n++){const r=Ti.Properties[n];r in e&&typeof e[r]=="number"&&(this[r]=e[r])}return this}_update(){if(this._flagVertices||this._flagWidth||this._flagHeight||this._flagSides){const e=this._sides,n=e+1;let r=this.vertices.length;r>e&&(this.vertices.splice(e-1,r-e),r=e);for(let s=0;s<n;s++){const o=(s+.5)/e,a=at*o+Math.PI/2,l=this._width*hm(a)/2,c=this._height*um(a)/2;s>=r?this.vertices.push(new ve(l,c)):this.vertices[s].set(l,c),this.vertices[s].command=s===0?te.move:te.line}}return super._update.call(this),this}flagReset(){return this._flagWidth=this._flagHeight=this._flagSides=!1,super.flagReset.call(this),this}clone(e){const n=new Ti(0,0,0,this.sides);n.translation.copy(this.translation),n.rotation=this.rotation,n.scale=this.scale,n.skewX=this.skewX,n.skewY=this.skewY,n.width=this.width,n.height=this.height,this.matrix.manual&&n.matrix.copy(this.matrix);for(let r=0;r<Se.Properties.length;r++){const s=Se.Properties[r];n[s]=this[s]}return e&&e.add(n),n}toObject(){const e=super.toObject.call(this);e.renderer.type="polygon";for(let n=0;n<Ti.Properties.length;n++){const r=Ti.Properties[n];e[r]=this[r]}return e}};w(Ul,"Properties",["width","height","sides"]);var no=Ul,Gl={radius:{enumerable:!0,get:function(){return this._radius},set:function(t){this._radius=t,this.width=t*2,this.height=t*2}},width:{enumerable:!0,get:function(){return this._width},set:function(t){this._width=t,this._flagWidth=!0,this._radius=Math.max(this.width,this.height)/2}},height:{enumerable:!0,get:function(){return this._height},set:function(t){this._height=t,this._flagHeight=!0,this._radius=Math.max(this.width,this.height)/2}},sides:{enumerable:!0,get:function(){return this._sides},set:function(t){this._sides=t,this._flagSides=!0}}},Kl=class Ri extends Se{constructor(e,n,r,s,o){typeof o>"u"&&typeof r=="number"&&typeof s=="number"&&(o=Math.floor(Math.min(r,s)/12));const a=[];for(let l=0;l<10;l++)a.push(new ve(0,0,0,0,0,0,l===0?te.move:te.curve));super(a),w(this,"_flagWidth",!1),w(this,"_flagHeight",!1),w(this,"_flagRadius",!1),w(this,"_width",0),w(this,"_height",0),w(this,"_radius",12),this._renderer.type="rounded-rectangle";for(let l in Zl)Object.defineProperty(this,l,Zl[l]);this.closed=!0,this.automatic=!1,this._renderer.flagRadius=fm.bind(this),typeof r=="number"&&(this.width=r),typeof s=="number"&&(this.height=s),(typeof o=="number"||o instanceof Q)&&(this.radius=o),this._update(),typeof e=="number"&&(this.translation.x=e),typeof n=="number"&&(this.translation.y=n)}static fromObject(e){const n=new Ri().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<Ri.Properties.length;n++){const r=Ri.Properties[n];if(r in e){const s=e[r];/radius/i.test(r)?this[r]=typeof s=="number"||s instanceof Q?s:new Q().copy(s):typeof s=="number"&&(this[r]=s)}}return this}_update(){if(this._flagVertices||this._flagWidth||this._flagHeight||this._flagRadius){const e=this._width,n=this._height;let r,s;this._radius instanceof Q?(r=this._radius.x,s=this._radius.y):(r=this._radius,s=this._radius);let o,a=e/2,l=n/2;o=this.vertices[0],o.x=-(a-r),o.y=-l,o=this.vertices[1],o.x=a-r,o.y=-l,o.controls.left.clear(),o.controls.right.x=r,o.controls.right.y=0,o=this.vertices[2],o.x=a,o.y=-(l-s),o.controls.right.clear(),o.controls.left.clear(),o=this.vertices[3],o.x=a,o.y=l-s,o.controls.left.clear(),o.controls.right.x=0,o.controls.right.y=s,o=this.vertices[4],o.x=a-r,o.y=l,o.controls.right.clear(),o.controls.left.clear(),o=this.vertices[5],o.x=-(a-r),o.y=l,o.controls.left.clear(),o.controls.right.x=-r,o.controls.right.y=0,o=this.vertices[6],o.x=-a,o.y=l-s,o.controls.left.clear(),o.controls.right.clear(),o=this.vertices[7],o.x=-a,o.y=-(l-s),o.controls.left.clear(),o.controls.right.x=0,o.controls.right.y=-s,o=this.vertices[8],o.x=-(a-r),o.y=-l,o.controls.left.clear(),o.controls.right.clear(),o=this.vertices[9],o.copy(this.vertices[8])}return super._update.call(this),this}flagReset(){return this._flagWidth=this._flagHeight=this._flagRadius=!1,super.flagReset.call(this),this}clone(e){const n=this.width,r=this.height,s=this.radius,o=new Ri(0,0,n,r,s);o.translation.copy(this.translation),o.rotation=this.rotation,o.scale=this.scale,o.skewX=this.skewX,o.skewY=this.skewY,this.matrix.manual&&o.matrix.copy(this.matrix);for(let a=0;a<Se.Properties.length;a++){const l=Se.Properties[a];o[l]=this[l]}return e&&e.add(o),o}toObject(){const e=super.toObject.call(this);e.renderer.type="rounded-rectangle";for(let n=0;n<Ri.Properties.length;n++){const r=Ri.Properties[n];e[r]=this[r]}return e.radius=typeof this.radius=="number"?this.radius:this.radius.toObject(),e}};w(Kl,"Properties",["width","height","radius"]);var Lr=Kl,Zl={width:{enumerable:!0,get:function(){return this._width},set:function(t){this._width=t,this._flagWidth=!0}},height:{enumerable:!0,get:function(){return this._height},set:function(t){this._height=t,this._flagHeight=!0}},radius:{enumerable:!0,get:function(){return this._radius},set:function(t){this._radius instanceof Q&&this._radius.unbind(X.Types.change,this._renderer.flagRadius),this._radius=t,this._radius instanceof Q&&this._radius.bind(X.Types.change,this._renderer.flagRadius),this._flagRadius=!0}}};function fm(){this._flagRadius=!0}var gm=Math.cos,mm=Math.sin,Ql=class $i extends Se{constructor(e,n,r,s,o){arguments.length<=3&&(s=r,r=s/2),(typeof o!="number"||o<=0)&&(o=5),super(),w(this,"_flagInnerRadius",!1),w(this,"_flagOuterRadius",!1),w(this,"_flagSides",!1),w(this,"_innerRadius",0),w(this,"_outerRadius",0),w(this,"_sides",0),this._renderer.type="star";for(let a in Jl)Object.defineProperty(this,a,Jl[a]);this.closed=!0,this.automatic=!1,typeof r=="number"&&(this.innerRadius=r),typeof s=="number"&&(this.outerRadius=s),typeof o=="number"&&(this.sides=o),this._update(),typeof e=="number"&&(this.translation.x=e),typeof n=="number"&&(this.translation.y=n)}static fromObject(e){const n=new $i().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<$i.Properties.length;n++){const r=$i.Properties[n];r in e&&typeof e[r]=="number"&&(this[r]=e[r])}return this}_update(){if(this._flagVertices||this._flagInnerRadius||this._flagOuterRadius||this._flagSides){const e=this._sides*2,n=e+1;let r=this.vertices.length;r>e&&(this.vertices.splice(e-1,r-e),r=e);for(let s=0;s<n;s++){const o=(s+.5)/e,a=at*o,l=(s%2?this._outerRadius:this._innerRadius)/2,c=l*gm(a),d=l*mm(a);s>=r?this.vertices.push(new ve(c,d)):this.vertices[s].set(c,d),this.vertices[s].command=s===0?te.move:te.line}}return super._update.call(this),this}flagReset(){return this._flagInnerRadius=this._flagOuterRadius=this._flagSides=!1,super.flagReset.call(this),this}clone(e){const n=this.innerRadius,r=this.outerRadius,s=this.sides,o=new $i(0,0,n,r,s);o.translation.copy(this.translation),o.rotation=this.rotation,o.scale=this.scale,o.skewX=this.skewX,o.skewY=this.skewY,this.matrix.manual&&o.matrix.copy(this.matrix);for(let a=0;a<Se.Properties.length;a++){const l=Se.Properties[a];o[l]=this[l]}return e&&e.add(o),o}toObject(){const e=super.toObject.call(this);e.renderer.type="star";for(let n=0;n<$i.Properties.length;n++){const r=$i.Properties[n];e[r]=this[r]}return e}};w(Ql,"Properties",["innerRadius","outerRadius","sides"]);var io=Ql,Jl={innerRadius:{enumerable:!0,get:function(){return this._innerRadius},set:function(t){this._innerRadius=t,this._flagInnerRadius=!0}},outerRadius:{enumerable:!0,get:function(){return this._outerRadius},set:function(t){this._outerRadius=t,this._flagOuterRadius=!0}},sides:{enumerable:!0,get:function(){return this._sides},set:function(t){this._sides=t,this._flagSides=!0}}},ro,ec=Math.min,tc=Math.max;He.document&&(ro=document.createElement("canvas"));var so=class It extends On{constructor(e,n,r,s){super(),w(this,"_flagValue",!0),w(this,"_flagFamily",!0),w(this,"_flagSize",!0),w(this,"_flagLeading",!0),w(this,"_flagAlignment",!0),w(this,"_flagBaseline",!0),w(this,"_flagStyle",!0),w(this,"_flagWeight",!0),w(this,"_flagDecoration",!0),w(this,"_flagFill",!0),w(this,"_flagStroke",!0),w(this,"_flagLinewidth",!0),w(this,"_flagOpacity",!0),w(this,"_flagVisible",!0),w(this,"_flagMask",!1),w(this,"_flagClip",!1),w(this,"_flagDirection",!0),w(this,"_flagStrokeAttenuation",!0),w(this,"_value",""),w(this,"_family","sans-serif"),w(this,"_size",13),w(this,"_leading",17),w(this,"_alignment","center"),w(this,"_baseline","middle"),w(this,"_style","normal"),w(this,"_weight",500),w(this,"_decoration","none"),w(this,"_direction","ltr"),w(this,"_fill","#000"),w(this,"_stroke","none"),w(this,"_linewidth",1),w(this,"_opacity",1),w(this,"_visible",!0),w(this,"_mask",null),w(this,"_clip",!1),w(this,"_dashes",null),w(this,"_strokeAttenuation",!0);for(let o in nc)Object.defineProperty(this,o,nc[o]);if(this._renderer.type="text",this._renderer.flagFill=pm.bind(this),this._renderer.flagStroke=ym.bind(this),this.value=e,typeof n=="number"&&(this.translation.x=n),typeof r=="number"&&(this.translation.y=r),this.dashes=[],this.dashes.offset=0,!K.isObject(s))return this;for(let o=0;o<It.Properties.length;o++){const a=It.Properties[o];a in s&&(this[a]=s[a])}}static Measure(e){if(ro){const n=ro.getContext("2d");n.font=[e._style,e._weight,`${e._size}px/${e._leading}px`,e._family].join(" ");const r=n.measureText(e.value,0,0),s=r.actualBoundingBoxDescent+r.actualBoundingBoxAscent;return{width:r.width,height:s}}else{const n=this.value.length*this.size*It.Ratio,r=this.leading;return console.warn("Two.Text: unable to accurately measure text, so using an approximation."),{width:n,height:r}}}static fromObject(e){const n=typeof e.fill=="string"?e.fill:Jn(e.fill),r=typeof e.stroke=="string"?e.stroke:Jn(e.stroke),s=new It().copy(Os(Vs({},e),{fill:n,stroke:r}));return"id"in e&&(s.id=e.id),s}copy(e){super.copy.call(this,e);for(let n=0;n<It.Properties.length;n++){const r=It.Properties[n];r in e&&(this[r]=e[r])}return this}clone(e){const n=new It(this.value);n.translation.copy(this.translation),n.rotation=this.rotation,n.scale=this.scale;for(let r=0;r<It.Properties.length;r++){const s=It.Properties[r];n[s]=this[s]}return this.matrix.manual&&n.matrix.copy(this.matrix),e&&e.add(n),n._update()}toObject(){const e=super.toObject.call(this);e.renderer.type="text";for(let n=0;n<It.Properties.length;n++){const r=It.Properties[n];e[r]=this[r]}return e}dispose(){return super.dispose(),typeof this.fill=="object"&&this.fill&&"dispose"in this.fill?this.fill.dispose():typeof this.fill=="object"&&this.fill&&"unbind"in this.fill&&this.fill.unbind(),typeof this.stroke=="object"&&this.stroke&&"dispose"in this.stroke?this.stroke.dispose():typeof this.stroke=="object"&&this.stroke&&"unbind"in this.stroke&&this.stroke.unbind(),this}noFill(){return this.fill="none",this}noStroke(){return this.stroke="none",this.linewidth=0,this}getBoundingClientRect(e){let n,r,s,o,a;this._update(!0),n=e?this.matrix:this.worldMatrix;const{width:l,height:c}=It.Measure(this),d=(this._linewidth||0)/2;switch(this.alignment){case"left":r=-d,s=l+d;break;case"right":r=-(l+d),s=d;break;default:r=-(l/2+d),s=l/2+d}switch(this.baseline){case"middle":o=-(c/2+d),a=c/2+d;break;default:o=-(c+d),a=d}const[h,u]=n.multiply(r,o),[m,g]=n.multiply(r,a),[f,p]=n.multiply(s,o),[y,b]=n.multiply(s,a);return o=ec(u,g,p,b),r=ec(h,m,f,y),s=tc(h,m,f,y),a=tc(u,g,p,b),{top:o,left:r,right:s,bottom:a,width:s-r,height:a-o}}flagReset(){return super.flagReset.call(this),this._flagValue=this._flagFamily=this._flagSize=this._flagLeading=this._flagAlignment=this._flagFill=this._flagStroke=this._flagLinewidth=this._flagOpacity=this._flagVisible=this._flagClip=this._flagDecoration=this._flagClassName=this._flagBaseline=this._flagWeight=this._flagStyle=this._flagDirection=!1,this}};w(so,"Ratio",.6),w(so,"Properties",["value","family","size","leading","alignment","linewidth","style","weight","decoration","direction","baseline","opacity","visible","fill","stroke","dashes","strokeAttenuation"]);var sn=so,nc={value:{enumerable:!0,get:function(){return this._value},set:function(t){this._value=t,this._flagValue=!0}},family:{enumerable:!0,get:function(){return this._family},set:function(t){this._family=t,this._flagFamily=!0}},size:{enumerable:!0,get:function(){return this._size},set:function(t){this._size=t,this._flagSize=!0}},leading:{enumerable:!0,get:function(){return this._leading},set:function(t){this._leading=t,this._flagLeading=!0}},alignment:{enumerable:!0,get:function(){return this._alignment},set:function(t){this._alignment=t,this._flagAlignment=!0}},linewidth:{enumerable:!0,get:function(){return this._linewidth},set:function(t){this._linewidth=t,this._flagLinewidth=!0}},style:{enumerable:!0,get:function(){return this._style},set:function(t){this._style=t,this._flagStyle=!0}},weight:{enumerable:!0,get:function(){return this._weight},set:function(t){this._weight=t,this._flagWeight=!0}},decoration:{enumerable:!0,get:function(){return this._decoration},set:function(t){this._decoration=t,this._flagDecoration=!0}},direction:{enumerable:!0,get:function(){return this._direction},set:function(t){this._direction=t,this._flagDirection=!0}},baseline:{enumerable:!0,get:function(){return this._baseline},set:function(t){this._baseline=t,this._flagBaseline=!0}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(t){this._opacity=t,this._flagOpacity=!0}},visible:{enumerable:!0,get:function(){return this._visible},set:function(t){this._visible=t,this._flagVisible=!0}},fill:{enumerable:!0,get:function(){return this._fill},set:function(t){(this._fill instanceof Qe||this._fill instanceof We||this._fill instanceof je||this._fill instanceof Pe)&&this._fill.unbind(X.Types.change,this._renderer.flagFill),this._fill=t,this._flagFill=!0,(this._fill instanceof Qe||this._fill instanceof We||this._fill instanceof je||this._fill instanceof Pe)&&this._fill.bind(X.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(t){(this._stroke instanceof Qe||this._stroke instanceof We||this._stroke instanceof je||this._stroke instanceof Pe)&&this._stroke.unbind(X.Types.change,this._renderer.flagStroke),this._stroke=t,this._flagStroke=!0,(this._stroke instanceof Qe||this._stroke instanceof We||this._stroke instanceof je||this._stroke instanceof Pe)&&this._stroke.bind(X.Types.change,this._renderer.flagStroke)}},mask:{enumerable:!0,get:function(){return this._mask},set:function(t){this._mask=t,this._flagMask=!0,K.isObject(t)&&!t.clip&&(t.clip=!0)}},clip:{enumerable:!0,get:function(){return this._clip},set:function(t){this._clip=t,this._flagClip=!0}},dashes:{enumerable:!0,get:function(){return this._dashes},set:function(t){typeof t.offset!="number"&&(t.offset=this.dashes&&this._dashes.offset||0),this._dashes=t}},strokeAttenuation:{enumerable:!0,get:function(){return this._strokeAttenuation},set:function(t){this._strokeAttenuation=!!t,this._flagStrokeAttenuation=!0,this._flagLinewidth=!0}}};function pm(){this._flagFill=!0}function ym(){this._flagStroke=!0}var oo=class Qi extends In{constructor(e,n,r,s){super(n,r,0,0),w(this,"_flagTextures",!1),w(this,"_flagFrameRate",!1),w(this,"_flagIndex",!1),w(this,"_amount",1),w(this,"_duration",0),w(this,"_index",0),w(this,"_startTime",0),w(this,"_playing",!1),w(this,"_firstFrame",0),w(this,"_lastFrame",0),w(this,"_loop",!0),w(this,"_textures",null),w(this,"_frameRate",0),w(this,"_origin",null),this._renderer.type="image-sequence";for(let o in ic)Object.defineProperty(this,o,ic[o]);this._renderer.flagTextures=bm.bind(this),this._renderer.bindTextures=_m.bind(this),this._renderer.unbindTextures=wm.bind(this),this.noStroke(),this.noFill(),Array.isArray(e)?this.textures=e.map(rc.bind(this)):typeof e=="string"&&(this.textures=[rc(e)]),this.origin=new Q,this._update(),typeof s=="number"?this.frameRate=s:this.frameRate=Qi.DefaultFrameRate,this.index=0}static fromObject(e){const n=new Qi().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<Qi.Properties.length;n++){const r=Qi.Properties[n];r in e&&(this[r]=e[r])}return this}play(e,n,r){return this._playing=!0,this._firstFrame=0,this._lastFrame=this.amount-1,this._startTime=K.performance.now(),typeof e=="number"&&(this._firstFrame=e),typeof n=="number"&&(this._lastFrame=n),typeof r=="function"?this._onLastFrame=r:delete this._onLastFrame,this._index!==this._firstFrame&&(this._startTime-=1e3*Math.abs(this._index-this._firstFrame)/this._frameRate),this}pause(){return this._playing=!1,this}stop(){return this._playing=!1,this._index=this._firstFrame,this}clone(e){const n=new Qi(this.textures,this.translation.x,this.translation.y,this.frameRate);return n._loop=this._loop,this._playing&&n.play(),e&&e.add(n),n}toObject(){const e=super.toObject.call(this);return e.renderer.type="image-sequence",e.textures=this.textures.map(function(n){return n.toObject()}),e.frameRate=this.frameRate,e.index=this.index,e.firstFrame=this.firstFrame,e.lastFrame=this.lastFrame,e.loop=this.loop,e}dispose(){if(super.dispose(),this._playing&&(this._playing=!1),this._onLastFrame=null,this.textures&&typeof this.textures.unbind=="function")try{this.textures.unbind()}catch{}if(this.textures)for(let e=0;e<this.textures.length;e++){const n=this.textures[e];typeof n.dispose=="function"?n.dispose():typeof n.unbind=="function"&&n.unbind()}return this}_update(){const e=this._textures;let n,r,s,o,a,l,c,d;return e&&(this._flagTextures&&(this._amount=e.length),this._flagFrameRate&&(this._duration=1e3*this._amount/this._frameRate),this._playing&&this._frameRate>0?(o=this._amount,K.isNaN(this._lastFrame)&&(this._lastFrame=o-1),s=K.performance.now()-this._startTime,d=this._lastFrame+1,a=1e3*(d-this._firstFrame)/this._frameRate,this._loop?s=s%a:s=Math.min(s,a),c=Nt(this._firstFrame,d,s/a),c=Math.floor(c),c!==this._index&&(this._index=c,l=e[this._index],l.loaded&&(n=l.image.width,r=l.image.height,this.width!==n&&(this.width=n),this.height!==r&&(this.height=r),this.fill=l,c>=this._lastFrame-1&&this._onLastFrame&&this._onLastFrame()))):(this._flagIndex||!(this.fill instanceof Pe))&&(l=e[this._index],l.loaded&&(n=l.image.width,r=l.image.height,this.width!==n&&(this.width=n),this.height!==r&&(this.height=r)),this.fill=l)),super._update.call(this),this}flagReset(){return this._flagTextures=this._flagFrameRate=!1,super.flagReset.call(this),this}};w(oo,"Properties",["textures","frameRate","index","firstFrame","lastFrame","loop"]),w(oo,"DefaultFrameRate",30);var ao=oo,ic={frameRate:{enumerable:!0,get:function(){return this._frameRate},set:function(t){this._frameRate=t,this._flagFrameRate=!0}},index:{enumerable:!0,get:function(){return this._index},set:function(t){this._index=t,this._flagIndex=!0}},textures:{enumerable:!0,get:function(){return this._textures},set:function(t){const e=this._renderer.bindTextures,n=this._renderer.unbindTextures;this._textures&&this._textures.unbind(X.Types.insert,e).unbind(X.Types.remove,n),this._textures=new An((t||[]).slice(0)),this._textures.bind(X.Types.insert,e).bind(X.Types.remove,n),e(this._textures)}},firstFrame:{enumerable:!0,get:function(){return this._firstFrame},set:function(t){this._firstFrame=t}},lastFrame:{enumerable:!0,get:function(){return this._lastFrame},set:function(t){this._lastFrame=t}},loop:{enumerable:!0,get:function(){return this._loop},set:function(t){this._loop=!!t}}};function bm(){this._flagTextures=!0}function _m(t){let e=t.length;for(;e--;)t[e].bind(X.Types.change,this._renderer.flagTextures);this._renderer.flagTextures()}function wm(t){let e=t.length;for(;e--;)t[e].unbind(X.Types.change,this._renderer.flagTextures);this._renderer.flagTextures()}function rc(t){if(t instanceof Pe)return t;if(typeof t=="string")return new Pe(t)}var Dr=Math.min,Hr=Math.max,lo=class Gn extends On{constructor(e){super(),w(this,"_flagAdditions",!1),w(this,"_flagSubtractions",!1),w(this,"_flagOrder",!1),w(this,"_flagOpacity",!0),w(this,"_flagBeginning",!1),w(this,"_flagEnding",!1),w(this,"_flagLength",!1),w(this,"_flagMask",!1),w(this,"_fill","#fff"),w(this,"_stroke","#000"),w(this,"_linewidth",1),w(this,"_opacity",1),w(this,"_visible",!0),w(this,"_cap","round"),w(this,"_join","round"),w(this,"_miter",4),w(this,"_closed",!0),w(this,"_curved",!1),w(this,"_automatic",!0),w(this,"_beginning",0),w(this,"_ending",1),w(this,"_length",0),w(this,"_mask",null),w(this,"_strokeAttenuation",!0);for(let n in sc)Object.defineProperty(this,n,sc[n]);this._renderer.type="group",this.additions=[],this.subtractions=[],this.children=Array.isArray(e)?e:Array.prototype.slice.call(arguments)}static InsertChildren(e){for(let n=0;n<e.length;n++)oc.call(this,e[n],this)}static RemoveChildren(e){for(let n=0;n<e.length;n++)oc.call(this,e[n])}static OrderChildren(e){this._flagOrder=!0}static fromObject(e){const n=new Gn;for(let s=0;s<Gn.Properties.length;s++){const o=Gn.Properties[s];o in e&&(/(fill|stroke)/i.test(o)?n[o]=typeof e[o]=="string"?e[o]:Jn(e[o]):n[o]=e[o])}return"mask"in e&&(n.mask=r(e.mask)),"id"in e&&(n.id=e.id),n.children=e.children.map(r),n;function r(s){if(s&&s.renderer)switch(s.renderer.type){case"arc-segment":return Ks.fromObject(s);case"circle":return Ir.fromObject(s);case"element":return Pi.fromObject(s);case"ellipse":return zr.fromObject(s);case"group":return Gn.fromObject(s);case"image":return Image.fromObject(s);case"image-sequence":return ao.fromObject(s);case"path":return Se.fromObject(s);case"points":return to.fromObject(s);case"polygon":return no.fromObject(s);case"rectangle":return In.fromObject(s);case"rounded-rectangle":return Lr.fromObject(s);case"shape":return On.fromObject(s);case"sprite":return Or.fromObject(s);case"star":return io.fromObject(s);case"text":return sn.fromObject(s)}return s}}copy(e){super.copy.call(this,e),console.warn("Two.js: attempting to copy group. Two.Group.children copying not supported.");for(let n=0;n<Gn.Properties.length;n++){const r=Gn.Properties[n];r in e&&(this[r]=e[r])}return this}clone(e){const n=new Gn,r=this.children.map(function(s){return s.clone()});return n.add(r),n.opacity=this.opacity,this.mask&&(n.mask=this.mask),n.translation.copy(this.translation),n.rotation=this.rotation,n.scale=this.scale,n.className=this.className,this.matrix.manual&&n.matrix.copy(this.matrix),e&&e.add(n),n._update()}toObject(){const e=super.toObject.call(this);return e.renderer.type="group",e.children=[],e.opacity=this.opacity,e.className=this.className,e.mask=this.mask?this.mask.toObject():null,K.each(this.children,(n,r)=>{e.children[r]=n.toObject()},this),e}dispose(){if(super.dispose(),this.children)for(let e=0;e<this.children.length;e++){const n=this.children[e];typeof n.dispose=="function"&&n.dispose()}if(this.children&&typeof this.children.unbind=="function")try{this.children.unbind()}catch{}return this}corner(){const e=this.getBoundingClientRect(!0);for(let n=0;n<this.children.length;n++){const r=this.children[n];r.translation.x-=e.left,r.translation.y-=e.top}return this.mask&&(this.mask.translation.x-=e.left,this.mask.translation.y-=e.top),this}center(){const e=this.getBoundingClientRect(!0),n=e.left+e.width/2-this.translation.x,r=e.top+e.height/2-this.translation.y;for(let s=0;s<this.children.length;s++){const o=this.children[s];o.isShape&&(o.translation.x-=n,o.translation.y-=r)}return this.mask&&(this.mask.translation.x-=n,this.mask.translation.y-=r),this}getById(e){let n=null;function r(s){if(s.id===e)return s;if(s.children){if(s.children.ids[e])return s.children.ids[e];for(let o=0;o<s.children.length;o++)if(n=r(s.children[o]),n)return n}return null}return r(this)}getByClassName(e){const n=[];function r(s){if(Array.prototype.indexOf.call(s.classList,e)>=0&&n.push(s),s.children)for(let o=0;o<s.children.length;o++){const a=s.children[o];r(a)}return n}return r(this)}getByType(e){const n=[];function r(s){if(s instanceof e&&n.push(s),s.children)for(let o=0;o<s.children.length;o++){const a=s.children[o];r(a)}return n}return r(this)}add(e){e instanceof Array?e=e.slice():e=Array.prototype.slice.call(arguments);for(let n=0;n<e.length;n++){const r=e[n];if(!(r&&r.id))continue;const s=Array.prototype.indexOf.call(this.children,r);s>=0&&this.children.splice(s,1),this.children.push(r)}return this}remove(e){const n=arguments.length,r=this.parent;if(n<=0&&r)return r.remove(this),this;e instanceof Array?e=e.slice():e=Array.prototype.slice.call(arguments);for(let s=0;s<e.length;s++){const o=e[s];if(!o||!this.children.ids[o.id])continue;const a=this.children.indexOf(o);a>=0&&this.children.splice(a,1)}return this}getBoundingClientRect(e){let n,r,s,o,a,l;this._update(!0);let c=1/0,d=-1/0,h=1/0,u=-1/0;const m=/texture|gradient/i;r=e?this.matrix:this.worldMatrix;for(let g=0;g<this.children.length;g++){const f=this.children[g];if(!(!f.visible||m.test(f._renderer.type))&&(n=f.getBoundingClientRect(e),s=typeof n.top!="number"||K.isNaN(n.top)||!isFinite(n.top),o=typeof n.left!="number"||K.isNaN(n.left)||!isFinite(n.left),a=typeof n.right!="number"||K.isNaN(n.right)||!isFinite(n.right),l=typeof n.bottom!="number"||K.isNaN(n.bottom)||!isFinite(n.bottom),!(s||o||a||l)))if(e){const[p,y]=r.multiply(n.left,n.top),[b,_]=r.multiply(n.right,n.top),[C,S]=r.multiply(n.left,n.bottom),[v,B]=r.multiply(n.right,n.bottom);h=Dr(y,_,S,B,h),c=Dr(p,b,C,v,c),d=Hr(p,b,C,v,d),u=Hr(y,_,S,B,u)}else h=Dr(n.top,h),c=Dr(n.left,c),d=Hr(n.right,d),u=Hr(n.bottom,u)}return{top:h,left:c,right:d,bottom:u,width:d-c,height:u-h}}noFill(){return this.children.forEach(function(e){e.noFill()}),this}noStroke(){return this.children.forEach(function(e){e.noStroke()}),this}subdivide(){const e=arguments;return this.children.forEach(function(n){n.subdivide.apply(n,e)}),this}_update(){let e,n,r;if(this._flagBeginning||this._flagEnding){const s=Math.min(this._beginning,this._ending),o=Math.max(this._beginning,this._ending),a=this.length;let l=0;const c=s*a,d=o*a;for(e=0;e<this.children.length;e++)r=this.children[e],n=r.length,c>l+n?(r.beginning=1,r.ending=1):d<l?(r.beginning=0,r.ending=0):c>l&&c<l+n?(r.beginning=(c-l)/n,r.ending=1):d>l&&d<l+n?(r.beginning=0,r.ending=(d-l)/n):(r.beginning=0,r.ending=1),l+=n}return super._update.apply(this,arguments)}flagReset(){return this._flagAdditions&&(this.additions.length=0,this._flagAdditions=!1),this._flagSubtractions&&(this.subtractions.length=0,this._flagSubtractions=!1),this._flagOrder=this._flagMask=this._flagOpacity=this._flagBeginning=this._flagEnding=!1,super.flagReset.call(this),this}};w(lo,"Children",zl),w(lo,"Properties",["fill","stroke","linewidth","cap","join","miter","closed","curved","automatic"]);var nt=lo,sc={visible:{enumerable:!0,get:function(){return this._visible},set:function(t){this._flagVisible=this._visible!==t||this._flagVisible,this._visible=t}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(t){this._flagOpacity=this._opacity!==t||this._flagOpacity,this._opacity=t}},beginning:{enumerable:!0,get:function(){return this._beginning},set:function(t){this._flagBeginning=this._beginning!==t||this._flagBeginning,this._beginning=t}},ending:{enumerable:!0,get:function(){return this._ending},set:function(t){this._flagEnding=this._ending!==t||this._flagEnding,this._ending=t}},length:{enumerable:!0,get:function(){if(this._flagLength||this._length<=0){if(this._length=0,!this.children)return this._length;for(let t=0;t<this.children.length;t++){const e=this.children[t];this._length+=e.length}}return this._length}},fill:{enumerable:!0,get:function(){return this._fill},set:function(t){this._fill=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.fill=t}}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(t){this._stroke=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.stroke=t}}},linewidth:{enumerable:!0,get:function(){return this._linewidth},set:function(t){this._linewidth=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.linewidth=t}}},join:{enumerable:!0,get:function(){return this._join},set:function(t){this._join=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.join=t}}},miter:{enumerable:!0,get:function(){return this._miter},set:function(t){this._miter=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.miter=t}}},cap:{enumerable:!0,get:function(){return this._cap},set:function(t){this._cap=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.cap=t}}},closed:{enumerable:!0,get:function(){return this._closed},set:function(t){this._closed=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.closed=t}}},curved:{enumerable:!0,get:function(){return this._curved},set:function(t){this._curved=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.curved=t}}},automatic:{enumerable:!0,get:function(){return this._automatic},set:function(t){this._automatic=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.automatic=t}}},children:{enumerable:!0,get:function(){return this._children},set:function(t){const e=nt.InsertChildren.bind(this),n=nt.RemoveChildren.bind(this),r=nt.OrderChildren.bind(this);this._children&&(this._children.unbind(),this._children.length>0&&n(this._children)),this._children=new zl(t),this._children.bind(X.Types.insert,e),this._children.bind(X.Types.remove,n),this._children.bind(X.Types.order,r),t.length>0&&e(t)}},mask:{enumerable:!0,get:function(){return this._mask},set:function(t){this._mask=t,this._flagMask=!0,K.isObject(t)&&!t.clip&&(t.clip=!0)}},strokeAttenuation:{enumerable:!0,get:function(){return this._strokeAttenuation},set:function(t){this._strokeAttenuation=!!t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.strokeAttenuation!==void 0&&(n.strokeAttenuation=t)}}}};function oc(t,e){const n=t.parent;let r;if(n===e){s();return}if(n&&n.children.ids[t.id]&&(r=Array.prototype.indexOf.call(n.children,t),n.children.splice(r,1),o()),e){s();return}o(),n._flagAdditions&&n.additions.length===0&&(n._flagAdditions=!1),n._flagSubtractions&&n.subtractions.length===0&&(n._flagSubtractions=!1),delete t.parent;function s(){e.subtractions.length>0&&(r=Array.prototype.indexOf.call(e.subtractions,t),r>=0&&e.subtractions.splice(r,1)),e.additions.length>0&&(r=Array.prototype.indexOf.call(e.additions,t),r>=0&&e.additions.splice(r,1)),t.parent=e,e.additions.push(t),e._flagAdditions=!0}function o(){r=Array.prototype.indexOf.call(n.additions,t),r>=0&&n.additions.splice(r,1),r=Array.prototype.indexOf.call(n.subtractions,t),r<0&&(n.subtractions.push(t),n._flagSubtractions=!0)}}var Wr=class extends Se{constructor(e,n,r,s){const o=[new ve(e,n),new ve(r,s)];super(o);for(let a in ac)Object.defineProperty(this,a,ac[a]);this.vertices[0].command=te.move,this.vertices[1].command=te.line,this.automatic=!1}};w(Wr,"Properties",["left","right"]);var ac={left:{enumerable:!0,get:function(){return this.vertices[0]},set:function(t){if(K.isObject(t))this.vertices.splice(0,1,t),this.vertices[0].command=te.move;else{const e=new Rt("Two.Line.left argument is not an object.");console.warn(e.name,e.message)}}},right:{enumerable:!0,get:function(){return this.vertices[1]},set:function(t){if(K.isObject(t))this.vertices.splice(1,1,t),this.vertices[1].command=te.line;else{const e=new Rt("Two.Line.right argument is not an object.");console.warn(e.name,e.message)}}}},on={path:/[+-]?(?:\d*\.\d+|\d+)(?:[eE][+-]\d+)?/g,cssBackgroundImage:/url\(['"]?#([\w\d-_]*)['"]?\)/i,unitSuffix:/[a-zA-Z%]*/i},xm={start:"left",middle:"center",end:"right"},lc=["id","class","transform","xmlns","viewBox"],vm=["x","y","width","height","href","xlink:href"];function km(t){return xm[t]}function Cm(t){const e=t.getAttribute("dominant-baseline"),n=t.getAttribute("alignment-baseline");return e||n}function rr(t){return t.replace(/svg:/gi,"").toLowerCase()}function cc(t,e){if(e.x+=t.translateX,e.y+=t.translateY,e.x*=t.scaleX,e.y*=t.scaleY,t.rotation!==0){const n=e.length();e.x=n*Math.cos(t.rotation),e.y=n*Math.sin(t.rotation)}}function Sm(t,e){e||(e={});const n=t.split(";");for(let r=0;r<n.length;r++){const s=n[r].split(":"),o=s[0],a=s[1];if(typeof o>"u"||typeof a>"u")continue;const l=o.replace(/\s/g,""),c=a.replace(/\s/g,"");e[l]=c}return e}function Bm(t){const e={},n=Tm(t),r=Math.max(n.length,t.style.length);for(let s=0;s<r;s++){const o=t.style[s],a=n[s];o&&(e[o]=t.style[o]),a&&(e[a]=t.getAttribute(a))}return e}function Tm(t){const e=t.getAttributeNames();for(let n=0;n<lc.length;n++){const r=lc[n],s=Array.prototype.indexOf.call(e,r);s>=0&&e.splice(s,1)}return e}function Rm(t,e){const n=e.split(/[\s,]/),r=-parseFloat(n[0]),s=-parseFloat(n[1]),o=parseFloat(n[2]),a=parseFloat(n[3]);if(r&&s)for(let u=0;u<t.children.length;u++){const m=t.children[u];"translation"in m?m.translation.add(r,s):"x"in m?m.x=r:"y"in m&&(m.y=s)}const l=typeof t.x=="number",c=typeof t.y=="number",d=typeof t.width=="number",h=typeof t.height=="number";return l&&(t.translation.x+=t.x),c&&(t.translation.y+=t.y),(d||h)&&(t.scale=new Q(1,1)),d&&(t.scale.x=t.width/o),h&&(t.scale.y=t.height/a),t.mask=new In(0,0,o,a),t.mask.origin.set(-o/2,-a/2),t}function Lt(t,e,n){const r={},s={},o={};let a,l,c,d,h,u,m,g,f,p,y,b,_,C,S,v,B;if(t===null)return r;if(He.getComputedStyle){const k=He.getComputedStyle(t);for(a=k.length;a--;)c=k[a],d=k[c],typeof d<"u"&&(r[c]=d)}for(a=0;a<t.attributes.length;a++)u=t.attributes[a],/style/i.test(u.nodeName)?Sm(u.value,o):s[u.nodeName]=u.value;typeof r.opacity<"u"&&(r["stroke-opacity"]=r.opacity,r["fill-opacity"]=r.opacity,delete r.opacity),n&&K.defaults(r,n),K.extend(r,o,s),r.visible=!(typeof r.display>"u"&&/none/i.test(r.display))||typeof r.visibility>"u"&&/hidden/i.test(r.visibility);for(c in r)switch(d=r[c],c){case"gradientTransform":if(/none/i.test(d)||(l=t.gradientTransform&&t.gradientTransform.baseVal&&t.gradientTransform.baseVal.length>0?t.gradientTransform.baseVal[0].matrix:t.getCTM?t.getCTM():null,l===null))break;switch(m=Qn(l),e._renderer.type){case"linear-gradient":cc(m,e.left),cc(m,e.right);break;case"radial-gradient":e.center.x+=m.translateX,e.center.y+=m.translateY,e.focal.x+=m.translateX,e.focal.y+=m.translateY,e.radius*=Math.max(m.scaleX,m.scaleY);break}break;case"transform":if(/none/i.test(d)||(l=t.transform&&t.transform.baseVal&&t.transform.baseVal.length>0?t.transform.baseVal[0].matrix:t.getCTM?t.getCTM():null,l===null))break;m=Qn(l),e.translation.set(m.translateX,m.translateY),e.rotation=Math.PI*(m.rotation/180),e.scale=new Q(m.scaleX,m.scaleY),g=parseFloat((r.x+"").replace("px")),f=parseFloat((r.y+"").replace("px")),g&&(e.translation.x=g),f&&(e.translation.y=f);break;case"visible":if(e instanceof nt){e._visible=d;break}e.visible=d;break;case"stroke-linecap":if(e instanceof nt){e._cap=d;break}e.cap=d;break;case"stroke-linejoin":if(e instanceof nt){e._join=d;break}e.join=d;break;case"stroke-miterlimit":if(e instanceof nt){e._miter=d;break}e.miter=d;break;case"stroke-width":if(e instanceof nt){e._linewidth=parseFloat(d);break}e.linewidth=parseFloat(d);break;case"opacity":case"stroke-opacity":case"fill-opacity":if(e instanceof nt){e._opacity=parseFloat(d);break}e.opacity=parseFloat(d);break;case"clip-path":if(on.cssBackgroundImage.test(d)&&(p=d.replace(on.cssBackgroundImage,"$1"),ze.defs.current&&ze.defs.current.contains(p)&&(b=ze.defs.current.get(p),b&&b.childNodes.length>0)))switch(b=b.childNodes[0],_=rr(b.nodeName),e.mask=ze[_].call(this,b,{}),e._renderer.type){case"text":case"path":e.position.add(e.mask.position),e.mask.position.clear();break}break;case"fill":case"stroke":h=(e instanceof nt?"_":"")+c,on.cssBackgroundImage.test(d)?(p=d.replace(on.cssBackgroundImage,"$1"),ze.defs.current&&ze.defs.current.contains(p)?(b=ze.defs.current.get(p),b.object||(_=rr(b.nodeName),b.object=ze[_].call(this,b,{})),b=b.object):(y=Em(this),b=y.getById(p)),e[h]=b):e[h]=d;break;case"id":e.id=d;break;case"class":case"className":e.classList=d.split(" "),e._flagClassName=!0;break;case"x":case"y":if(C=e instanceof Qe,S=e instanceof We,v=e instanceof je,C||S||v)break;d.match("[a-z%]$")&&!d.endsWith("px")&&(B=new Rt("only pixel values are supported with the "+c+" attribute."),console.warn(B.name,B.message)),e.translation[c]=parseFloat(d);break;case"font-family":e instanceof sn&&(e.family=d);break;case"font-size":e instanceof sn&&(d.match("[a-z%]$")&&!d.endsWith("px")&&(B=new Rt("only pixel values are supported with the "+c+" attribute."),console.warn(B.name,B.message)),e.size=parseFloat(d));break;case"font-weight":e instanceof sn&&(e.weight=d);break;case"font-style":e instanceof sn&&(e.style=d);break;case"text-decoration":e instanceof sn&&(e.decoration=d);break;case"line-height":e instanceof sn&&(e.leading=d);break}return Object.keys(t.dataset).length&&(e.dataset=t.dataset),r}function $m(t,e){for(let n=0,r=t.childNodes.length;n<r;n++){const s=t.childNodes[n];!s.id||rr(t.nodeName)==="#text"||e.add(s.id,s)}}function Em(t){for(;t.parent;)t=t.parent;return t.scene}var ze={svg:function(t){const e=ze.defs.current=new Fr,n=t.getElementsByTagName("defs");for(let f=0;f<n.length;f++)$m(n[f],e);const r=ze.g.call(this,t),s=t.getAttribute("viewBox"),o=t.getAttribute("x"),a=t.getAttribute("y"),l=t.getAttribute("width"),c=t.getAttribute("height");r.defs=e;const d=s!==null,h=o!==null,u=a!==null,m=l!==null,g=c!==null;return h&&(r.x=parseFloat(o.replace(on.unitSuffix,""))),u&&(r.y=parseFloat(a.replace(on.unitSuffix,""))),m&&(r.width=parseFloat(l.replace(on.unitSuffix,""))),g&&(r.height=parseFloat(c.replace(on.unitSuffix,""))),d&&Rm(r,s),delete ze.defs.current,r},defs:function(t){return null},use:function(t,e){let n;const r=t.getAttribute("href")||t.getAttribute("xlink:href");if(!r)return n=new Rt("encountered <use /> with no href."),console.warn(n.name,n.message),null;const s=r.slice(1);if(!ze.defs.current.contains(s))return n=new Rt("unable to find element for reference "+r+"."),console.warn(n.name,n.message),null;const a=ze.defs.current.get(s).cloneNode(!0);for(let c=0;c<t.attributes.length;c++){const d=t.attributes[c],h=vm.includes(d.nodeName),u=!a.hasAttribute(d.nodeName);(h||u)&&a.setAttribute(d.nodeName,d.value)}const l=rr(a.nodeName);return ze[l].call(this,a,e)},g:function(t,e){const n=new nt;Lt.call(this,t,n,e),this.add(n);const r=Bm.call(this,t);for(let s=0,o=t.childNodes.length;s<o;s++){const a=t.childNodes[s],l=a.nodeName;if(!l)return;const c=rr(l);if(c in ze){const d=ze[c].call(n,a,r);d&&!d.parent&&n.add(d)}}return n},polygon:function(t,e){let n;typeof t=="string"?n=t:n=t.getAttribute("points");const r=[];n.replace(/(-?[\d.eE-]+)[,|\s](-?[\d.eE-]+)/g,function(o,a,l){r.push(new ve(parseFloat(a),parseFloat(l)))});const s=new Se(r,!0);return s.stroke="none",s.fill="black",Lt.call(this,t,s,e),s},polyline:function(t,e){const n=ze.polygon.call(this,t,e);return n.closed=!1,n},path:function(t,e){let n;typeof t=="string"?(n=t,t=null):n=t.getAttribute("d");let r=[],s=!1,o=!1;if(n){let l=new ve,c,d,h=n.match(/[a-df-z][^a-df-z]*/gi);const u=h.length-1;K.each(h.slice(0),function(m,g){const f=m.slice(1).trim().match(on.path),p=m[0],y=p.toLowerCase();let b,_,C,S,v;const B=[];switch(g===0&&(h=[]),y){case"h":case"v":f.length>1&&(b=1);break;case"m":case"l":case"t":f.length>2&&(b=2);break;case"s":case"q":f.length>4&&(b=4);break;case"c":f.length>6&&(b=6);break;case"a":f.length>7&&(b=7);break}if(b){for(_=0,C=f.length,v=0;_<C;_+=b){if(S=p,v>0)switch(p){case"m":S="l";break;case"M":S="L";break}B.push(S+f.slice(_,_+b).join(" ")),v++}h=Array.prototype.concat.apply(h,B)}else h.push(m)}),K.each(h,function(m,g){let f,p,y;const b=m[0],_=b.toLowerCase();d=m.slice(1).trim().match(on.path),o=b===_;let C,S,v,B,k,R,$,P,I,V,A,L,D,ee,E,N,H;switch(_){case"z":if(g>=u)s=!0;else{p=l.x,y=l.y,f=new ve(p,y,void 0,void 0,void 0,void 0,te.close);for(let q=r.length-1;q>=0;q--){const Y=r[q];if(/m/i.test(Y.command)){l=Y;break}}}break;case"m":case"l":c=void 0,p=parseFloat(d[0]),y=parseFloat(d[1]),f=new ve(p,y,void 0,void 0,void 0,void 0,/m/i.test(_)?te.move:te.line),o&&f.addSelf(l),l=f;break;case"h":case"v":V=/h/i.test(_)?"x":"y",A=/x/i.test(V)?"y":"x",f=new ve(void 0,void 0,void 0,void 0,void 0,void 0,te.line),f[V]=parseFloat(d[0]),f[A]=l[A],o&&(f[V]+=l[V]),l=f;break;case"c":case"s":C=l.x,S=l.y,c||(c=new Q),/c/i.test(_)?(v=parseFloat(d[0]),B=parseFloat(d[1]),k=parseFloat(d[2]),R=parseFloat(d[3]),$=parseFloat(d[4]),P=parseFloat(d[5])):(I=Ds(l,c,o),v=I.x,B=I.y,k=parseFloat(d[0]),R=parseFloat(d[1]),$=parseFloat(d[2]),P=parseFloat(d[3])),o&&(v+=C,B+=S,k+=C,R+=S,$+=C,P+=S),l.controls.right.set(v-l.x,B-l.y),f=new ve($,P,k-$,R-P,void 0,void 0,te.curve),l=f,c=f.controls.left;break;case"t":case"q":C=l.x,S=l.y,c||(c=new Q),/q/i.test(_)?(v=parseFloat(d[0]),B=parseFloat(d[1]),k=parseFloat(d[0]),R=parseFloat(d[1]),$=parseFloat(d[2]),P=parseFloat(d[3])):(I=Ds(l,c,o),v=I.x,B=I.y,k=I.x,R=I.y,$=parseFloat(d[0]),P=parseFloat(d[1])),o&&(v+=C,B+=S,k+=C,R+=S,$+=C,P+=S),l.controls.right.set((v-l.x)*.33,(B-l.y)*.33),f=new ve($,P,k-$,R-P,void 0,void 0,te.curve),l=f,c=f.controls.left;break;case"a":C=l.x,S=l.y,D=parseFloat(d[0]),ee=parseFloat(d[1]),E=parseFloat(d[2]),N=parseFloat(d[3]),H=parseFloat(d[4]),$=parseFloat(d[5]),P=parseFloat(d[6]),o&&($+=C,P+=S),L=new ve($,P),L.command=te.arc,L.rx=D,L.ry=ee,L.xAxisRotation=E,L.largeArcFlag=N,L.sweepFlag=H,f=L,l=L,c=void 0;break}f&&(Array.isArray(f)?r=r.concat(f):r.push(f))})}n=new Se(r,s,void 0,!0),n.stroke="none",n.fill="black";const a=n.getBoundingClientRect(!0);return a.centroid={x:a.left+a.width/2,y:a.top+a.height/2},K.each(n.vertices,function(l){l.subSelf(a.centroid)}),Lt.call(this,t,n,e),n.translation.addSelf(a.centroid),n},circle:function(t,e){const n=parseFloat(t.getAttribute("cx")),r=parseFloat(t.getAttribute("cy")),s=parseFloat(t.getAttribute("r")),o=new Ir(0,0,s);return o.stroke="none",o.fill="black",Lt.call(this,t,o,e),o.translation.x=n,o.translation.y=r,o},ellipse:function(t,e){const n=parseFloat(t.getAttribute("cx")),r=parseFloat(t.getAttribute("cy")),s=parseFloat(t.getAttribute("rx")),o=parseFloat(t.getAttribute("ry")),a=new zr(0,0,s,o);return a.stroke="none",a.fill="black",Lt.call(this,t,a,e),a.translation.x=n,a.translation.y=r,a},rect:function(t,e){const n=parseFloat(t.getAttribute("rx")),r=parseFloat(t.getAttribute("ry"));if(!K.isNaN(n)||!K.isNaN(r))return ze["rounded-rect"](t);const s=parseFloat(t.getAttribute("width")),o=parseFloat(t.getAttribute("height")),a=s/2,l=o/2,c=new In(0,0,s,o);return c.stroke="none",c.fill="black",Lt.call(this,t,c,e),c.translation.x+=a,c.translation.y+=l,c},"rounded-rect":function(t,e){const n=parseFloat(t.getAttribute("rx"))||0,r=parseFloat(t.getAttribute("ry"))||0,s=parseFloat(t.getAttribute("width")),o=parseFloat(t.getAttribute("height")),a=s/2,l=o/2,c=new Q(n,r),d=new Lr(0,0,s,o,c);return d.stroke="none",d.fill="black",Lt.call(this,t,d,e),d.translation.x+=a,d.translation.y+=l,d},line:function(t,e){const n=parseFloat(t.getAttribute("x1")),r=parseFloat(t.getAttribute("y1")),s=parseFloat(t.getAttribute("x2")),o=parseFloat(t.getAttribute("y2")),a=new Wr(n,r,s,o).noFill();return Lt.call(this,t,a,e),a},lineargradient:function(t,e){let n=t.getAttribute("gradientUnits"),r=t.getAttribute("spreadMethod");n||(n="objectBoundingBox"),r||(r="pad");let s=parseFloat(t.getAttribute("x1")||0),o=parseFloat(t.getAttribute("y1")||0),a=parseFloat(t.getAttribute("x2")||0),l=parseFloat(t.getAttribute("y2")||0);const c=(a+s)/2,d=(l+o)/2;/userSpaceOnUse/i.test(n)&&(s-=c,o-=d,a-=c,l-=d);const h=[];for(let m=0;m<t.children.length;m++){const g=t.children[m];let f=g.getAttribute("offset");/%/gi.test(f)&&(f=parseFloat(f.replace(/%/gi,""))/100),f=parseFloat(f);let p=g.getAttribute("stop-color"),y=g.getAttribute("stop-opacity"),b=g.getAttribute("style"),_;p===null&&(_=b?b.match(/stop-color:\s?([#a-fA-F0-9]*)/):!1,p=_&&_.length>1?_[1]:void 0),y===null?(_=b?b.match(/stop-opacity:\s?([0-9.-]*)/):!1,y=_&&_.length>1?parseFloat(_[1]):1):y=parseFloat(y),h.push(new Vn(f,p,y))}const u=new We(s,o,a,l,h);return u.spread=r,u.units=n,Lt.call(this,t,u,e),u},radialgradient:function(t,e){let n=t.getAttribute("gradientUnits"),r=t.getAttribute("spreadMethod");n||(n="objectBoundingBox"),r||(r="pad");let s=parseFloat(t.getAttribute("cx"))||0,o=parseFloat(t.getAttribute("cy"))||0,a=parseFloat(t.getAttribute("r")),l=parseFloat(t.getAttribute("fx")),c=parseFloat(t.getAttribute("fy"));K.isNaN(l)&&(l=s),K.isNaN(c)&&(c=o);const d=Math.abs(s+l)/2,h=Math.abs(o+c)/2;/userSpaceOnUse/i.test(n)&&(s-=d,o-=h,l-=d,c-=h);const u=[];for(let g=0;g<t.children.length;g++){const f=t.children[g];let p=f.getAttribute("offset");/%/gi.test(p)&&(p=parseFloat(p.replace(/%/gi,""))/100),p=parseFloat(p);let y=f.getAttribute("stop-color"),b=f.getAttribute("stop-opacity"),_=f.getAttribute("style"),C;y===null&&(C=_?_.match(/stop-color:\s?([#a-fA-F0-9]*)/):!1,y=C&&C.length>1?C[1]:void 0),b===null?(C=_?_.match(/stop-opacity:\s?([0-9.-]*)/):!1,b=C&&C.length>1?parseFloat(C[1]):1):b=parseFloat(b),u.push(new Vn(p,y,b))}const m=new je(s,o,a,u,l,c);return m.spread=r,m.units=n,Lt.call(this,t,m,e),m},text:function(t,e){const n=km(t.getAttribute("text-anchor"))||"left",r=Cm(t)||"baseline";let s="";t.childNodes.length>0&&t.childNodes[0].tagName==="TSPAN"?s=t.childNodes[0].textContent:s=t.textContent;const o=new sn(s);return Lt.call(this,t,o,e),o.alignment=n,o.baseline=r,o},clippath:function(t,e){return ze.defs.current&&!ze.defs.current.contains(t.id)&&ze.defs.current.add(t.id,t),null},image:function(t,e){let n;const r=t.getAttribute("href")||t.getAttribute("xlink:href");if(!r)return n=new Rt("encountered <image /> with no href."),console.warn(n.name,n.message),null;const s=parseFloat(t.getAttribute("x"))||0,o=parseFloat(t.getAttribute("y"))||0,a=parseFloat(t.getAttribute("width")),l=parseFloat(t.getAttribute("height")),c=new Or(r,s,o);return K.isNaN(a)||(c.width=a),K.isNaN(l)||(c.height=l),Lt.call(this,t,c,e),c}};function dc(t,e){const n=new XMLHttpRequest;return n.open("GET",t),n.onreadystatechange=function(){n.readyState===4&&n.status===200&&e(n.responseText)},n.send(),n}var co=class bn extends In{constructor(e,n,r,s,o,a){super(n,r,s||1,o||1),w(this,"_flagTexture",!1),w(this,"_flagMode",!1),w(this,"_texture",null),w(this,"_mode","fill"),this._renderer.type="image";for(let l in uc)Object.defineProperty(this,l,uc[l]);this.noStroke(),this.noFill(),e instanceof Pe?this.texture=e:typeof e=="string"&&(this.texture=new Pe(e)),typeof a=="string"&&(this.mode=a),this._update()}static fromObject(e){const n=new bn().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<bn.Properties.length;n++){const r=bn.Properties[n];r in e&&(this[r]=e[r])}return this}clone(e){const n=new bn(this.texture,this.translation.x,this.translation.y,this.width,this.height);return e&&e.add(n),n}toObject(){const e=super.toObject.call(this);return e.renderer.type="image",e.texture=this.texture.toObject(),e.mode=this.mode,e}dispose(){return super.dispose(),this._texture&&typeof this._texture.dispose=="function"?this._texture.dispose():this._texture&&typeof this._texture.unbind=="function"&&this._texture.unbind(),this}_update(){const e=this._texture;if(e&&(this._flagTexture&&(this.fill=e),e.loaded)){const n=e.image.width,r=e.image.height,s=this.width,o=this.height,a=s/n,l=o/r;switch(this._mode){case bn.Modes.fill:{const c=Math.max(a,l);e.scale=c,e.offset.x=0,e.offset.y=0,e.repeat="repeat";break}case bn.Modes.fit:{const c=Math.min(a,l);e.scale=c,e.offset.x=0,e.offset.y=0,e.repeat="no-repeat";break}case bn.Modes.crop:break;case bn.Modes.tile:{e.offset.x=(n-s)/2,e.offset.y=(r-o)/2,e.repeat="repeat";break}case bn.Modes.stretch:default:e.scale=new Q(a,l),e.offset.x=0,e.offset.y=0,e.repeat="repeat"}}return super._update.call(this),this}flagReset(){return super.flagReset.call(this),this._flagTexture=this._flagMode=!1,this}};w(co,"Modes",{fill:"fill",fit:"fit",crop:"crop",tile:"tile",stretch:"stretch"}),w(co,"Properties",["texture","mode"]);var hc=co,uc={texture:{enumerable:!0,get:function(){return this._texture},set:function(t){this._texture=t,this._flagTexture=!0}},mode:{enumerable:!0,get:function(){return this._mode},set:function(t){this._mode=t,this._flagMode=!0}}},ho=[],uo=Math.max,Nm=Math.min,fc=Math.abs,jr=Math.sin,qr=Math.cos,Pm=Math.acos,Xr=Math.sqrt,Te={isHidden:/(undefined|none|transparent)/i,alignments:{left:"start",middle:"center",right:"end"},baselines:{top:"top",middle:"middle",bottom:"bottom",baseline:"alphabetic"},getRendererType:function(t){return t in Te?t:"path"},group:{renderChild:function(t){const e=Te.getRendererType(t._renderer.type);Te[e].render.call(t,this.ctx,!0,this.clip)},render:function(t){if(!this._visible)return this;K.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();const e=this._matrix.elements,n=this.parent;this._renderer.opacity=this._opacity*(n&&n._renderer?n._renderer.opacity:1);const r=this._mask,s=Yr(e),o=!s||!!r;if(this._renderer.context||(this._renderer.context={}),this._renderer.context.ctx=t,o&&(t.save(),s||t.transform(e[0],e[3],e[1],e[4],e[2],e[5])),r){const a=Te.getRendererType(r._renderer.type);Te[a].render.call(r,t,!0)}if(this._opacity>0&&this._scale!==0)for(let a=0;a<this.children.length;a++){const l=this.children[a],c=Te.getRendererType(l._renderer.type);Te[c].render.call(l,t)}return o&&t.restore(),K.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},path:{render:function(t,e,n){let r,s,o,a,l,c,d,h,u,m,g,f,p,y,b,_,C,S,v,B,k,R,$,P,I,V,A,L,D,ee,E,N,H,q;if(q=this.parent&&this.parent._renderer?this.parent._renderer.opacity:1,D=this._mask,ee=this._clip,l=this._opacity*(q||1),c=this._visible,!e&&(!c||ee||l===0))return this;if(K.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update(),r=this._matrix.elements,s=this._stroke,o=this._linewidth,a=this._fill,d=this._cap,h=this._join,u=this._miter,m=this._closed,g=this._renderer.vertices,f=g.length,p=f-1,E=Yr(r),H=this.dashes,E||(t.save(),t.transform(r[0],r[3],r[1],r[4],r[2],r[5])),D){const re=Te.getRendererType(D._renderer.type);Te[re].render.call(D,t,!0)}if(a)if(typeof a=="string")t.fillStyle=a;else{const re=Te.getRendererType(a._renderer.type);Te[re].render.call(a,t,this),t.fillStyle=a._renderer.effect}if(s){if(typeof s=="string")t.strokeStyle=s;else{const re=Te.getRendererType(s._renderer.type);Te[re].render.call(s,t,this),t.strokeStyle=s._renderer.effect}o&&(t.lineWidth=rn(this)),u&&(t.miterLimit=u),h&&(t.lineJoin=h),!m&&d&&(t.lineCap=d)}typeof l=="number"&&(t.globalAlpha=l),H&&H.length>0&&(t.lineDashOffset=H.offset||0,t.setLineDash(H)),t.beginPath();let Y,F,M,Z,fe,ie,me;for(let re=0;re<f;re++)switch(_=g[re],A=_.x,L=_.y,_.command){case te.close:t.closePath();break;case te.arc:Y=_.rx,F=_.ry,M=_.xAxisRotation,Z=_.largeArcFlag,fe=_.sweepFlag,y=m?Pt(re-1,f):uo(re-1,0),b=g[y],ie=b.x,me=b.y,Te.renderSvgArcCommand(t,ie,me,Y,F,Z,fe,M,A,L);break;case te.curve:y=m?Pt(re-1,f):Math.max(re-1,0),b=g[y],$=b.controls&&b.controls.right||Q.zero,P=_.controls&&_.controls.left||Q.zero,b._relative?(k=$.x+b.x,R=$.y+b.y):(k=$.x,R=$.y),_._relative?(v=P.x+_.x,B=P.y+_.y):(v=P.x,B=P.y),t.bezierCurveTo(k,R,v,B,A,L),re>=p&&m&&(C=S,I=_.controls&&_.controls.right||Q.zero,V=C.controls&&C.controls.left||Q.zero,_._relative?(k=I.x+_.x,R=I.y+_.y):(k=I.x,R=I.y),C._relative?(v=V.x+C.x,B=V.y+C.y):(v=V.x,B=V.y),A=C.x,L=C.y,t.bezierCurveTo(k,R,v,B,A,L));break;case te.line:t.lineTo(A,L);break;case te.move:S=_,t.moveTo(A,L);break}return m&&t.closePath(),!ee&&!n&&(Te.isHidden.test(a)||(N=a._renderer&&a._renderer.offset,N&&(t.save(),t.translate(-a._renderer.offset.x,-a._renderer.offset.y),t.scale(a._renderer.scale.x,a._renderer.scale.y)),t.fill(),N&&t.restore()),Te.isHidden.test(s)||(N=s._renderer&&s._renderer.offset,N&&(t.save(),t.translate(-s._renderer.offset.x,-s._renderer.offset.y),t.scale(s._renderer.scale.x,s._renderer.scale.y),t.lineWidth=o/s._renderer.scale.x),t.stroke(),N&&t.restore())),E||t.restore(),ee&&!n&&t.clip(),H&&H.length>0&&t.setLineDash(ho),K.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},points:{render:function(t,e,n){let r,s,o,a,l,c,d,h,u,m,g,f,p,y,b,_;if(_=this.parent&&this.parent._renderer?this.parent._renderer.opacity:1,l=this._opacity*(_||1),c=this._visible,!e&&(!c||l===0))return this;if(K.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update(),r=this._matrix.elements,s=this._stroke,o=this._linewidth,a=this._fill,h=this._renderer.collection,u=h.length,p=Yr(r),b=this.dashes,d=this._size,p||(t.save(),t.transform(r[0],r[3],r[1],r[4],r[2],r[5])),a)if(typeof a=="string")t.fillStyle=a;else{const v=Te.getRendererType(a._renderer.type);Te[v].render.call(a,t,this),t.fillStyle=a._renderer.effect}if(s){if(typeof s=="string")t.strokeStyle=s;else{const v=Te.getRendererType(s._renderer.type);Te[v].render.call(s,t,this),t.strokeStyle=s._renderer.effect}o&&(t.lineWidth=rn(this))}typeof l=="number"&&(t.globalAlpha=l),b&&b.length>0&&(t.lineDashOffset=b.offset||0,t.setLineDash(b)),t.beginPath();let C=d*.5,S;this._sizeAttenuation||(S=this.worldMatrix.elements,S=Qn(S[0],S[3],S[1],S[4],S[2],S[5]),C/=Math.max(S.scaleX,S.scaleY));for(let v=0;v<u;v++)m=h[v],g=m.x,f=m.y,t.moveTo(g+C,f),t.arc(g,f,C,0,at);return n||(Te.isHidden.test(a)||(y=a._renderer&&a._renderer.offset,y&&(t.save(),t.translate(-a._renderer.offset.x,-a._renderer.offset.y),t.scale(a._renderer.scale.x,a._renderer.scale.y)),t.fill(),y&&t.restore()),Te.isHidden.test(s)||(y=s._renderer&&s._renderer.offset,y&&(t.save(),t.translate(-s._renderer.offset.x,-s._renderer.offset.y),t.scale(s._renderer.scale.x,s._renderer.scale.y),t.lineWidth=o/s._renderer.scale.x),t.stroke(),y&&t.restore())),p||t.restore(),b&&b.length>0&&t.setLineDash(ho),K.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},text:{render:function(t,e,n){const r=this.parent&&this.parent._renderer?this.parent._renderer.opacity:1,s=this._opacity*r,o=this._visible,a=this._mask,l=this._clip;if(!e&&(!o||l||s===0))return this;K.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();const c=this._matrix.elements,d=this._stroke,h=this._linewidth,u=this._fill,m=this._decoration,g=this._direction,f=Yr(c),p=u._renderer&&u._renderer.offset&&d._renderer&&d._renderer.offset,y=this.dashes,b=Te.alignments[this._alignment]||this._alignment,_=Te.baselines[this._baseline]||this._baseline;let C,S,v,B,k,R,$,P,I,V,A;if(f||(t.save(),t.transform(c[0],c[3],c[1],c[4],c[2],c[5])),a){const L=Te.getRendererType(a._renderer.type);Te[L].render.call(a,t,!0)}if(p||(t.font=[this._style,this._weight,this._size+"px/"+this._leading+"px",this._family].join(" ")),t.textAlign=b,t.textBaseline=_,t.direction=g,u)if(typeof u=="string")t.fillStyle=u;else{const L=Te.getRendererType(u._renderer.type);Te[L].render.call(u,t,this),t.fillStyle=u._renderer.effect}if(d){if(typeof d=="string")t.strokeStyle=d;else{const L=Te.getRendererType(d._renderer.type);Te[L].render.call(d,t,this),t.strokeStyle=d._renderer.effect}h&&(t.lineWidth=rn(this))}if(typeof s=="number"&&(t.globalAlpha=s),y&&y.length>0&&(t.lineDashOffset=y.offset||0,t.setLineDash(y)),!l&&!n&&(Te.isHidden.test(u)||(u._renderer&&u._renderer.offset?(R=u._renderer.scale.x,$=u._renderer.scale.y,t.save(),t.translate(-u._renderer.offset.x,-u._renderer.offset.y),t.scale(R,$),C=this._size/u._renderer.scale.y,S=this._leading/u._renderer.scale.y,t.font=[this._style,this._weight,C+"px/",S+"px",this._family].join(" "),v=u._renderer.offset.x/u._renderer.scale.x,B=u._renderer.offset.y/u._renderer.scale.y,t.fillText(this.value,v,B),t.restore()):t.fillText(this.value,0,0)),Te.isHidden.test(d)||(d._renderer&&d._renderer.offset?(R=d._renderer.scale.x,$=d._renderer.scale.y,t.save(),t.translate(-d._renderer.offset.x,-d._renderer.offset.y),t.scale(R,$),C=this._size/d._renderer.scale.y,S=this._leading/d._renderer.scale.y,t.font=[this._style,this._weight,C+"px/",S+"px",this._family].join(" "),v=d._renderer.offset.x/d._renderer.scale.x,B=d._renderer.offset.y/d._renderer.scale.y,k=h/d._renderer.scale.x,t.lineWidth=k,t.strokeText(this.value,v,B),t.restore()):t.strokeText(this.value,0,0))),/(underline|strikethrough)/i.test(m)){const L=t.measureText(this.value);let D=1;switch(m){case"underline":I=L.actualBoundingBoxDescent,A=L.actualBoundingBoxDescent;break;case"strikethrough":I=0,A=0,D=.5;break}switch(_){case"top":I+=this._size*D,A+=this._size*D;break;case"baseline":case"bottom":I-=this._size*D,A-=this._size*D;break}switch(b){case"left":case"start":P=0,V=L.width;break;case"right":case"end":P=-L.width,V=0;break;default:P=-L.width/2,V=L.width/2}t.lineWidth=Math.max(Math.floor(this._size/15),1),t.strokeStyle=t.fillStyle,t.beginPath(),t.moveTo(P,I),t.lineTo(V,A),t.stroke()}return f||t.restore(),l&&!n&&t.clip(),y&&y.length>0&&t.setLineDash(ho),K.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},"linear-gradient":{render:function(t,e){if(e){if(K.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update(),!this._renderer.effect||this._flagEndPoints||this._flagStops||this._flagUnits){let n,r=this.left._x,s=this.left._y,o=this.right._x,a=this.right._y;/objectBoundingBox/i.test(this._units)&&(n=e.getBoundingClientRect(!0),r=(r-.5)*n.width,s=(s-.5)*n.height,o=(o-.5)*n.width,a=(a-.5)*n.height),this._renderer.effect=t.createLinearGradient(r,s,o,a);for(let l=0;l<this.stops.length;l++){const c=this.stops[l];this._renderer.effect.addColorStop(c._offset,c._color)}}return K.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}}},"radial-gradient":{render:function(t,e){if(e){if(K.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update(),!this._renderer.effect||this._flagCenter||this._flagFocal||this._flagRadius||this._flagStops||this._flagUnits){let n,r=this.center._x,s=this.center._y,o=this.focal._x,a=this.focal._y,l=this._radius;/objectBoundingBox/i.test(this._units)&&(n=e.getBoundingClientRect(!0),r=(r-.5)*n.width*.5,s=(s-.5)*n.height*.5,o=(o-.5)*n.width*.5,a=(a-.5)*n.height*.5,l*=Math.min(n.width,n.height)),this._renderer.effect=t.createRadialGradient(r,s,0,o,a,l);for(let c=0;c<this.stops.length;c++){const d=this.stops[c];this._renderer.effect.addColorStop(d._offset,d._color)}}return K.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}}},texture:{render:function(t){K.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();const e=this.image;return(!this._renderer.effect||(this._flagLoaded||this._flagImage||this._flagVideo||this._flagRepeat)&&this.loaded)&&(this._renderer.effect=t.createPattern(this.image,this._repeat)),(this._flagOffset||this._flagLoaded||this._flagScale)&&(this._renderer.offset instanceof Q||(this._renderer.offset=new Q),this._renderer.offset.x=-this._offset.x,this._renderer.offset.y=-this._offset.y,e&&(this._renderer.offset.x+=e.width/2,this._renderer.offset.y+=e.height/2,this._scale instanceof Q?(this._renderer.offset.x*=this._scale.x,this._renderer.offset.y*=this._scale.y):(this._renderer.offset.x*=this._scale,this._renderer.offset.y*=this._scale))),(this._flagScale||this._flagLoaded)&&(this._renderer.scale instanceof Q||(this._renderer.scale=new Q),this._scale instanceof Q?this._renderer.scale.copy(this._scale):this._renderer.scale.set(this._scale,this._scale)),K.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},renderSvgArcCommand:function(t,e,n,r,s,o,a,l,c,d){l=l*Math.PI/180,r=fc(r),s=fc(s);const h=(e-c)/2,u=(n-d)/2,m=qr(l)*h+jr(l)*u,g=-jr(l)*h+qr(l)*u,f=m*m,p=g*g;let y=r*r,b=s*s;const _=f/y+p/b;if(_>1){const L=Xr(_);r=L*r,s=L*s,y=r*r,b=s*s}const C=y*p+b*f,S=(y*b-C)/C;let v=Xr(uo(0,S));o===a&&(v=-v);const B=v*r*g/s,k=-v*s*m/r,R=qr(l)*B-jr(l)*k+(e+c)/2,$=jr(l)*B+qr(l)*k+(n+d)/2,P=gc(1,0,(m-B)/r,(g-k)/s),I=gc((m-B)/r,(g-k)/s,(-m-B)/r,(-g-k)/s)%at,V=P+I;Fm(t,R,$,r,s,P,V,a===0,l)}},ct=class extends X{constructor(t){super();const e=t.smoothing!==!1;this.domElement=t.domElement||document.createElement("canvas"),this.ctx=this.domElement.getContext("2d"),this.overdraw=t.overdraw||!1,typeof this.ctx.imageSmoothingEnabled<"u"&&(this.ctx.imageSmoothingEnabled=e),this.scene=new nt,this.scene.parent=this}setSize(t,e,n){return this.width=t,this.height=e,this.ratio=typeof n>"u"?Hs(this.ctx):n,this.domElement.width=t*this.ratio,this.domElement.height=e*this.ratio,this.domElement.style&&K.extend(this.domElement.style,{width:t+"px",height:e+"px"}),this.trigger(X.Types.resize,t,e,n)}render(){const t=this.ratio===1;return t||(this.ctx.save(),this.ctx.scale(this.ratio,this.ratio)),this.overdraw||this.ctx.clearRect(0,0,this.width,this.height),Te.group.render.call(this.scene,this.ctx),t||this.ctx.restore(),this}};w(ct,"Utils",Te);function Fm(t,e,n,r,s,o,a,l,c){const d=a-o,h=Ei.Tolerance.epsilon,u=Math.abs(d)<h;let m=Pt(d,at);m<h&&(u?m=0:m=at),l===!0&&!u&&(m===at?m=-at:m=m-at);for(let g=0;g<wt.Resolution;g++){const f=g/(wt.Resolution-1),p=o+f*m;let y=e+r*Math.cos(p),b=n+s*Math.sin(p);if(c!==0){const _=Math.cos(c),C=Math.sin(c),S=y-e,v=b-n;y=S*_-v*C+e,b=S*C+v*_+n}t.lineTo(y,b)}}function gc(t,e,n,r){const s=t*n+e*r,o=Xr(t*t+e*e)*Xr(n*n+r*r);let a=Pm(uo(-1,Nm(1,s/o)));return t*r-e*n<0&&(a=-a),a}function Yr(t){return t[0]===1&&t[3]===0&&t[1]===0&&t[4]===1&&t[2]===0&&t[5]===0}var oe={version:1.1,ns:"http://www.w3.org/2000/svg",xlink:"http://www.w3.org/1999/xlink",alignments:{left:"start",center:"middle",right:"end"},baselines:{top:"hanging",middle:"middle",bottom:"ideographic",baseline:"alphabetic"},createElement:function(t,e){const n=t,r=document.createElementNS(oe.ns,n);return n==="svg"&&(e=K.defaults(e||{},{version:oe.version})),e&&Object.keys(e).length>0&&oe.setAttributes(r,e),r},setAttributes:function(t,e){const n=Object.keys(e);for(let r=0;r<n.length;r++)/href/.test(n[r])?t.setAttributeNS(oe.xlink,n[r],e[n[r]]):t.setAttribute(n[r],e[n[r]]);return this},removeAttributes:function(t,e){for(let n in e)t.removeAttribute(n);return this},toString:function(t,e){let n=t.length,r=n-1,s,o="";for(let a=0;a<n;a++){const l=t[a],c=e?Pt(a-1,n):Math.max(a-1,0),d=t[c];let h,u,m,g,f,p,y,b,_,C,S,v,B,k,R,$=Ne(l.x),P=Ne(l.y);switch(l.command){case te.close:h=te.close;break;case te.arc:S=l.rx,v=l.ry,B=l.xAxisRotation,k=l.largeArcFlag,R=l.sweepFlag,h=te.arc+" "+S+" "+v+" "+B+" "+k+" "+R+" "+$+" "+P;break;case te.curve:y=d.controls&&d.controls.right||Q.zero,b=l.controls&&l.controls.left||Q.zero,d.relative?(m=Ne(y.x+d.x),g=Ne(y.y+d.y)):(m=Ne(y.x),g=Ne(y.y)),l.relative?(f=Ne(b.x+l.x),p=Ne(b.y+l.y)):(f=Ne(b.x),p=Ne(b.y)),h=(a===0?te.move:te.curve)+" "+m+" "+g+" "+f+" "+p+" "+$+" "+P;break;case te.move:s=l,h=te.move+" "+$+" "+P;break;default:h=l.command+" "+$+" "+P}a>=r&&e&&(l.command===te.curve&&(u=s,_=l.controls&&l.controls.right||l,C=u.controls&&u.controls.left||u,l.relative?(m=Ne(_.x+l.x),g=Ne(_.y+l.y)):(m=Ne(_.x),g=Ne(_.y)),u.relative?(f=Ne(C.x+u.x),p=Ne(C.y+u.y)):(f=Ne(C.x),p=Ne(C.y)),$=Ne(u.x),P=Ne(u.y),h+=" C "+m+" "+g+" "+f+" "+p+" "+$+" "+P),l.command!==te.close&&(h+=" Z")),o+=h+" "}return o},pointsToString:function(t,e){let n="";const r=e*.5;for(let s=0;s<t.length;s++){const o=t[s].x,a=t[s].y-r;n+=te.move+" "+o+" "+a+" ",n+="a "+r+" "+r+" 0 1 0 0.001 0 Z"}return n},getClip:function(t,e){let n=t._renderer.clip;return n||(n=t._renderer.clip=oe.createElement("clipPath",{"clip-rule":"nonzero"})),n.parentNode===null&&e.defs.appendChild(n),n},getRendererType:function(t){return t in oe?t:"path"},defs:{update:function(t){const{defs:e}=t;if(e._flagUpdate){const n=Array.prototype.slice.call(e.children,0);for(let r=0;r<n.length;r++){const s=n[r],o=s.id,a=`[fill="url(#${o})"],[stroke="url(#${o})"],[clip-path="url(#${o})"]`;t.querySelector(a)||e.removeChild(s)}e._flagUpdate=!1}}},group:{appendChild:function(t){const e=t._renderer.elem;if(!e)return;const n=e.nodeName;!n||/(radial|linear)gradient/i.test(n)||t._clip||this.elem.appendChild(e)},removeChild:function(t){const e=t._renderer.elem;!e||e.parentNode!=this.elem||!e.nodeName||t._clip||this.elem.removeChild(e)},orderChild:function(t){this.elem.appendChild(t._renderer.elem)},renderChild:function(t){const e=oe.getRendererType(t._renderer.type);oe[e].render.call(t,this)},render:function(t){if(!this._visible&&!this._flagVisible||this._opacity===0&&!this._flagOpacity)return this;K.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update(),this._renderer.elem||(this._renderer.elem=oe.createElement("g",{id:this.id}),t.appendChild(this._renderer.elem));const e=this._matrix.manual||this._flagMatrix,n={domElement:t,elem:this._renderer.elem};e&&this._renderer.elem.setAttribute("transform","matrix("+this._matrix.toString()+")");for(let r=0;r<this.children.length;r++){const s=this.children[r],o=oe.getRendererType(s._renderer.type);oe[o].render.call(s,t)}if(this._flagId&&this._renderer.elem.setAttribute("id",this._id),this._flagOpacity&&this._renderer.elem.setAttribute("opacity",this._opacity),this._flagVisible&&this._renderer.elem.setAttribute("display",this._visible?"inline":"none"),this._flagClassName&&this._renderer.elem.setAttribute("class",this.classList.join(" ")),this._flagAdditions&&this.additions.forEach(oe.group.appendChild,n),this._flagSubtractions&&this.subtractions.forEach(oe.group.removeChild,n),this._flagOrder&&this.children.forEach(oe.group.orderChild,n),this._flagMask)if(this._mask){const r=oe.getRendererType(this._mask._renderer.type);oe[r].render.call(this._mask,t),this._renderer.elem.setAttribute("clip-path","url(#"+this._mask.id+")")}else this._renderer.elem.removeAttribute("clip-path");return this.dataset&&Object.assign(this._renderer.elem.dataset,this.dataset),K.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},path:{render:function(t){if(this._opacity===0&&!this._flagOpacity)return this;K.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();const e={};if((this._matrix.manual||this._flagMatrix)&&(e.transform="matrix("+this._matrix.toString()+")"),this._flagId&&(e.id=this._id),this._flagVertices){const r=oe.toString(this._renderer.vertices,this._closed);e.d=r}if(this._fill&&this._fill._renderer){this._renderer.hasFillEffect=!0,this._fill._update();const r=oe.getRendererType(this._fill._renderer.type);oe[r].render.call(this._fill,t,!0)}if(this._flagFill&&(e.fill=this._fill&&this._fill.id?"url(#"+this._fill.id+")":this._fill,this._renderer.hasFillEffect&&typeof this._fill.id>"u"&&(t.defs._flagUpdate=!0,delete this._renderer.hasFillEffect)),this._stroke&&this._stroke._renderer){this._renderer.hasStrokeEffect=!0,this._stroke._update();const r=oe.getRendererType(this._stroke._renderer.type);oe[r].render.call(this._stroke,t,!0)}if(this._flagStroke&&(e.stroke=this._stroke&&this._stroke.id?"url(#"+this._stroke.id+")":this._stroke,this._renderer.hasStrokeEffect&&typeof this._stroke.id>"u"&&(t.defs._flagUpdate=!0,delete this._renderer.hasStrokeEffect)),this._flagLinewidth&&(e["stroke-width"]=rn(this)),this._flagOpacity&&(e["stroke-opacity"]=this._opacity,e["fill-opacity"]=this._opacity),this._flagClassName&&(e.class=this.classList.join(" ")),this._flagVisible&&(e.visibility=this._visible?"visible":"hidden"),this._flagCap&&(e["stroke-linecap"]=this._cap),this._flagJoin&&(e["stroke-linejoin"]=this._join),this._flagMiter&&(e["stroke-miterlimit"]=this._miter),this.dashes&&this.dashes.length>0&&(e["stroke-dasharray"]=this.dashes.join(" "),e["stroke-dashoffset"]=this.dashes.offset||0),this._renderer.elem?oe.setAttributes(this._renderer.elem,e):(e.id=this._id,this._renderer.elem=oe.createElement("path",e),t.appendChild(this._renderer.elem)),this._flagClip){const r=oe.getClip(this,t),s=this._renderer.elem;this._clip?(s.removeAttribute("id"),r.setAttribute("id",this.id),r.appendChild(s)):(r.removeAttribute("id"),s.setAttribute("id",this.id),this.parent._renderer.elem.appendChild(s))}if(this._flagMask)if(this._mask){const r=oe.getRendererType(this._mask._renderer.type);oe[r].render.call(this._mask,t),this._renderer.elem.setAttribute("clip-path","url(#"+this._mask.id+")")}else this._renderer.elem.removeAttribute("clip-path");return K.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},points:{render:function(t){if(this._opacity===0&&!this._flagOpacity)return this;K.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();const e={};if((this._matrix.manual||this._flagMatrix)&&(e.transform="matrix("+this._matrix.toString()+")"),this._flagId&&(e.id=this._id),this._flagVertices||this._flagSize||this._flagSizeAttenuation){let r=this._size;if(!this._sizeAttenuation){const o=this.worldMatrix.elements,a=Qn(o[0],o[3],o[1],o[4],o[2],o[5]);r/=Math.max(a.scaleX,a.scaleY)}const s=oe.pointsToString(this._renderer.collection,r);e.d=s}if(this._fill&&this._fill._renderer){this._renderer.hasFillEffect=!0,this._fill._update();const r=oe.getRendererType(this._fill._renderer.type);oe[r].render.call(this._fill,t,!0)}if(this._flagFill&&(e.fill=this._fill&&this._fill.id?"url(#"+this._fill.id+")":this._fill,this._renderer.hasFillEffect&&typeof this._fill.id>"u"&&(t.defs._flagUpdate=!0,delete this._renderer.hasFillEffect)),this._stroke&&this._stroke._renderer){this._renderer.hasStrokeEffect=!0,this._stroke._update();const r=oe.getRendererType(this._stroke._renderer.type);oe[r].render.call(this._stroke,t,!0)}return this._flagStroke&&(e.stroke=this._stroke&&this._stroke.id?"url(#"+this._stroke.id+")":this._stroke,this._renderer.hasStrokeEffect&&typeof this._stroke.id>"u"&&(t.defs._flagUpdate=!0,delete this._renderer.hasStrokeEffect)),this._flagLinewidth&&(e["stroke-width"]=rn(this)),this._flagOpacity&&(e["stroke-opacity"]=this._opacity,e["fill-opacity"]=this._opacity),this._flagClassName&&(e.class=this.classList.join(" ")),this._flagVisible&&(e.visibility=this._visible?"visible":"hidden"),this.dashes&&this.dashes.length>0&&(e["stroke-dasharray"]=this.dashes.join(" "),e["stroke-dashoffset"]=this.dashes.offset||0),this._renderer.elem?oe.setAttributes(this._renderer.elem,e):(e.id=this._id,this._renderer.elem=oe.createElement("path",e),t.appendChild(this._renderer.elem)),K.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},text:{render:function(t){this._update();const e={};if((this._matrix.manual||this._flagMatrix)&&(e.transform="matrix("+this._matrix.toString()+")"),this._flagId&&(e.id=this._id),this._flagFamily&&(e["font-family"]=this._family),this._flagSize&&(e["font-size"]=this._size),this._flagLeading&&(e["line-height"]=this._leading),this._flagAlignment&&(e["text-anchor"]=oe.alignments[this._alignment]||this._alignment),this._flagBaseline&&(e["dominant-baseline"]=oe.baselines[this._baseline]||this._baseline),this._flagStyle&&(e["font-style"]=this._style),this._flagWeight&&(e["font-weight"]=this._weight),this._flagDecoration&&(e["text-decoration"]=this._decoration),this._flagDirection&&(e.direction=this._direction),this._fill&&this._fill._renderer){this._renderer.hasFillEffect=!0,this._fill._update();const r=oe.getRendererType(this._fill._renderer.type);oe[r].render.call(this._fill,t,!0)}if(this._flagFill&&(e.fill=this._fill&&this._fill.id?"url(#"+this._fill.id+")":this._fill,this._renderer.hasFillEffect&&typeof this._fill.id>"u"&&(t.defs._flagUpdate=!0,delete this._renderer.hasFillEffect)),this._stroke&&this._stroke._renderer){this._renderer.hasStrokeEffect=!0,this._stroke._update();const r=oe.getRendererType(this._stroke._renderer.type);oe[r].render.call(this._stroke,t,!0)}if(this._flagStroke&&(e.stroke=this._stroke&&this._stroke.id?"url(#"+this._stroke.id+")":this._stroke,this._renderer.hasStrokeEffect&&typeof this._stroke.id>"u"&&(t.defs._flagUpdate=!0,delete this._renderer.hasStrokeEffect)),this._flagLinewidth&&(e["stroke-width"]=rn(this)),this._flagOpacity&&(e.opacity=this._opacity),this._flagClassName&&(e.class=this.classList.join(" ")),this._flagVisible&&(e.visibility=this._visible?"visible":"hidden"),this.dashes&&this.dashes.length>0&&(e["stroke-dasharray"]=this.dashes.join(" "),e["stroke-dashoffset"]=this.dashes.offset||0),this._renderer.elem?oe.setAttributes(this._renderer.elem,e):(e.id=this._id,this._renderer.elem=oe.createElement("text",e),t.appendChild(this._renderer.elem)),this._flagClip){const r=oe.getClip(this,t),s=this._renderer.elem;this._clip?(s.removeAttribute("id"),r.setAttribute("id",this.id),r.appendChild(s)):(r.removeAttribute("id"),s.setAttribute("id",this.id),this.parent._renderer.elem.appendChild(s))}if(this._flagMask)if(this._mask){const r=oe.getRendererType(this._mask._renderer.type);oe[r].render.call(this._mask,t),this._renderer.elem.setAttribute("clip-path","url(#"+this._mask.id+")")}else this._renderer.elem.removeAttribute("clip-path");return this._flagValue&&(this._renderer.elem.textContent=this._value),this.flagReset()}},"linear-gradient":{render:function(t,e){K.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),e||this._update();const n={};if(this._flagId&&(n.id=this._id),this._flagEndPoints&&(n.x1=this.left._x,n.y1=this.left._y,n.x2=this.right._x,n.y2=this.right._y),this._flagSpread&&(n.spreadMethod=this._spread),this._flagUnits&&(n.gradientUnits=this._units),this._renderer.elem?oe.setAttributes(this._renderer.elem,n):(n.id=this._id,this._renderer.elem=oe.createElement("linearGradient",n)),this._renderer.elem.parentNode===null&&t.defs.appendChild(this._renderer.elem),this._flagStops){const r=this._renderer.elem.childNodes.length!==this.stops.length;if(r)for(;this._renderer.elem.lastChild;)this._renderer.elem.removeChild(this._renderer.elem.lastChild);for(let s=0;s<this.stops.length;s++){const o=this.stops[s],a={};o._flagOffset&&(a.offset=100*o._offset+"%"),o._flagColor&&(a["stop-color"]=o._color),o._flagOpacity&&(a["stop-opacity"]=o._opacity),o._renderer.elem?oe.setAttributes(o._renderer.elem,a):o._renderer.elem=oe.createElement("stop",a),r&&this._renderer.elem.appendChild(o._renderer.elem),o.flagReset()}}return K.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},"radial-gradient":{render:function(t,e){K.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),e||this._update();const n={};if(this._flagId&&(n.id=this._id),this._flagCenter&&(n.cx=this.center._x,n.cy=this.center._y),this._flagFocal&&(n.fx=this.focal._x,n.fy=this.focal._y),this._flagRadius&&(n.r=this._radius),this._flagSpread&&(n.spreadMethod=this._spread),this._flagUnits&&(n.gradientUnits=this._units),this._renderer.elem?oe.setAttributes(this._renderer.elem,n):(n.id=this._id,this._renderer.elem=oe.createElement("radialGradient",n)),this._renderer.elem.parentNode===null&&t.defs.appendChild(this._renderer.elem),this._flagStops){const r=this._renderer.elem.childNodes.length!==this.stops.length;if(r)for(;this._renderer.elem.lastChild;)this._renderer.elem.removeChild(this._renderer.elem.lastChild);for(let s=0;s<this.stops.length;s++){const o=this.stops[s],a={};o._flagOffset&&(a.offset=100*o._offset+"%"),o._flagColor&&(a["stop-color"]=o._color),o._flagOpacity&&(a["stop-opacity"]=o._opacity),o._renderer.elem?oe.setAttributes(o._renderer.elem,a):o._renderer.elem=oe.createElement("stop",a),r&&this._renderer.elem.appendChild(o._renderer.elem),o.flagReset()}}return K.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},texture:{render:function(t,e){K.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),e||this._update();const n={},r={x:0,y:0},s=this.image;if(this._flagId&&(n.id=this._id),this._flagLoaded&&this.loaded)switch(s.nodeName.toLowerCase()){case"canvas":r.href=r["xlink:href"]=s.toDataURL("image/png");break;case"img":case"image":r.href=r["xlink:href"]=this.src;break}if((this._flagOffset||this._flagLoaded||this._flagScale)&&(n.x=this._offset.x,n.y=this._offset.y,s&&(n.x-=s.width/2,n.y-=s.height/2,this._scale instanceof Q?(n.x*=this._scale.x,n.y*=this._scale.y):(n.x*=this._scale,n.y*=this._scale)),n.x>0&&(n.x*=-1),n.y>0&&(n.y*=-1)),(this._flagScale||this._flagLoaded||this._flagRepeat)&&(n.width=0,n.height=0,s)){switch(n.width=s.width,n.height=s.height,this._repeat){case"no-repeat":n.width+=1,n.height+=1;break}this._scale instanceof Q?(n.width*=this._scale.x,n.height*=this._scale.y):(n.width*=this._scale,n.height*=this._scale),/no-repeat/i.test(this._repeat)?r.preserveAspectRatio="xMidYMid":r.preserveAspectRatio="none",r.width=n.width,r.height=n.height}return(this._flagScale||this._flagLoaded)&&(this._renderer.image?oe.setAttributes(this._renderer.image,r):this._renderer.image=oe.createElement("image",r)),this._renderer.elem?Object.keys(n).length!==0&&oe.setAttributes(this._renderer.elem,n):(n.id=this._id,n.patternUnits="userSpaceOnUse",this._renderer.elem=oe.createElement("pattern",n)),this._renderer.elem.parentNode===null&&t.defs.appendChild(this._renderer.elem),this._renderer.elem&&this._renderer.image&&!this._renderer.appended&&(this._renderer.elem.appendChild(this._renderer.image),this._renderer.appended=!0),K.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}}},mc=class extends X{constructor(t){super(),this.domElement=t.domElement||oe.createElement("svg"),this.scene=new nt,this.scene.parent=this,this.defs=oe.createElement("defs"),this.defs._flagUpdate=!1,this.domElement.appendChild(this.defs),this.domElement.defs=this.defs,this.domElement.style.overflow="hidden"}setSize(t,e){return this.width=t,this.height=e,oe.setAttributes(this.domElement,{width:t,height:e}),this.trigger(X.Types.resize,t,e)}render(){return oe.group.render.call(this.scene,this.domElement),oe.defs.update(this.domElement),this}};w(mc,"Utils",oe);var Dt={create:function(t,e,n){const r=t.createShader(t[n]);if(t.shaderSource(r,e),t.compileShader(r),!t.getShaderParameter(r,t.COMPILE_STATUS)){const o=t.getShaderInfoLog(r);throw t.deleteShader(r),new Rt("unable to compile shader "+r+": "+o)}return r},types:{vertex:"VERTEX_SHADER",fragment:"FRAGMENT_SHADER"},path:{vertex:`
41
41
  precision mediump float;
42
42
  attribute vec2 a_position;
43
43
 
@@ -100,30 +100,30 @@
100
100
  }
101
101
  gl_FragColor = texel;
102
102
  }
103
- `}},Ur=Pi.Multiply,Rm=[1,0,0,0,1,0,0,0,1],In=new nn(9),$m=ht.Utils,pc=new Z,fo=new nn([0,0,1,0,0,1,0,1,1,0,1,1]),be={precision:.9,isHidden:/(undefined|none|transparent)/i,canvas:ze.document?ze.document.createElement("canvas"):{getContext:function(){}},alignments:{left:"start",middle:"center",right:"end"},matrix:new Pi,group:{removeChild:function(t,e){if(t.children)for(let n=0;n<t.children.length;n++)be.group.removeChild(t.children[n],e);t._renderer.texture&&(e.deleteTexture(t._renderer.texture),delete t._renderer.texture),t._renderer.positionBuffer&&(e.deleteBuffer(t._renderer.positionBuffer),delete t._renderer.positionBuffer)},render:function(t,e){if(!this._visible)return;K.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();const n=this.parent,r=n._matrix&&n._matrix.manual||n._flagMatrix,s=this._matrix.manual||this._flagMatrix;if((r||s)&&(this._renderer.matrix||(this._renderer.matrix=new nn(9)),this._matrix.toTransformArray(!0,In),Ur(In,n._renderer.matrix,this._renderer.matrix),this._renderer.scale instanceof Z||(this._renderer.scale=new Z),this._scale instanceof Z?(this._renderer.scale.x=this._scale.x,this._renderer.scale.y=this._scale.y):(this._renderer.scale.x=this._scale,this._renderer.scale.y=this._scale),/renderer/i.test(n._renderer.type)||(this._renderer.scale.x*=n._renderer.scale.x,this._renderer.scale.y*=n._renderer.scale.y),r&&(this._flagMatrix=!0)),this._mask){t.clear(t.STENCIL_BUFFER_BIT),t.enable(t.STENCIL_TEST),t.stencilFunc(t.ALWAYS,1,0),t.stencilOp(t.KEEP,t.KEEP,t.REPLACE),t.colorMask(!1,!1,!1,!1);const a=ht.Utils.getRendererType(this._mask._renderer.type);be[a].render.call(this._mask,t,e,this),t.stencilFunc(t.EQUAL,1,255),t.stencilOp(t.KEEP,t.KEEP,t.KEEP),t.colorMask(!0,!0,!0,!0)}this._flagOpacity=n._flagOpacity||this._flagOpacity,this._renderer.opacity=this._opacity*(n&&n._renderer?n._renderer.opacity:1);let o;if(this._flagSubtractions)for(o=0;o<this.subtractions.length;o++)be.group.removeChild(this.subtractions[o],t);for(o=0;o<this.children.length;o++){const a=this.children[o],l=ht.Utils.getRendererType(a._renderer.type);be[l].render.call(a,t,e)}return this._mask&&t.disable(t.STENCIL_TEST),K.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},path:{updateCanvas:function(t,e){let n,r,s,o,a,l,c,d,h,u,m,f,g,p;const b=e._renderer.vertices,y=this.canvas,_=this.ctx,S=t.renderer.ratio,C=pc.copy(e._renderer.scale).multiply(S),v=e._stroke,B=e._linewidth,k=e._fill,R=e._renderer.opacity||e._opacity,$=e._cap,F=e._join,D=e._miter,L=e._closed,M=e.dashes,z=b.length,O=z-1;y.width=Math.max(Math.ceil(e._renderer.rect.width*C.x),1),y.height=Math.max(Math.ceil(e._renderer.rect.height*C.y),1);const ne=e._renderer.rect.centroid,P=ne.x,E=ne.y;if(_.clearRect(0,0,y.width,y.height),k)if(typeof k=="string")_.fillStyle=k;else{const de=ht.Utils.getRendererType(k._renderer.type);be[de].render.call(k,_,e),_.fillStyle=k._renderer.effect}if(v){if(typeof v=="string")_.strokeStyle=v;else{const de=ht.Utils.getRendererType(v._renderer.type);be[de].render.call(v,_,e),_.strokeStyle=v._renderer.effect}B&&(_.lineWidth=rn(e)),D&&(_.miterLimit=D),F&&(_.lineJoin=F),!L&&$&&(_.lineCap=$)}typeof R=="number"&&(_.globalAlpha=R),M&&M.length>0&&(_.lineDashOffset=M.offset||0,_.setLineDash(M));let X,j,H,N,I,J,ce,re;_.save(),_.scale(C.x,C.y),_.translate(P,E),_.beginPath();for(let de=0;de<b.length;de++){const se=b[de];switch(f=se.x,g=se.y,se.command){case Q.close:_.closePath();break;case Q.arc:j=se.rx,H=se.ry,N=se.xAxisRotation,I=se.largeArcFlag,J=se.sweepFlag,n=L?Ft(de-1,z):Math.max(de-1,0),r=b[n],ce=r.x,re=r.y,$m.renderSvgArcCommand(_,ce,re,j,H,I,J,N,f,g);break;case Q.curve:n=L?Ft(de-1,z):Math.max(de-1,0),r=b[n],d=r.controls&&r.controls.right||Z.zero,h=se.controls&&se.controls.left||Z.zero,r._relative?(l=d.x+r.x,c=d.y+r.y):(l=d.x,c=d.y),se._relative?(o=h.x+se.x,a=h.y+se.y):(o=h.x,a=h.y),_.bezierCurveTo(l,c,o,a,f,g),de>=O&&L&&(s=X,u=se.controls&&se.controls.right||Z.zero,m=s.controls&&s.controls.left||Z.zero,se._relative?(l=u.x+se.x,c=u.y+se.y):(l=u.x,c=u.y),s._relative?(o=m.x+s.x,a=m.y+s.y):(o=m.x,a=m.y),f=s.x,g=s.y,_.bezierCurveTo(l,c,o,a,f,g));break;case Q.line:_.lineTo(f,g);break;case Q.move:X=se,_.moveTo(f,g);break}}L&&_.closePath(),be.isHidden.test(k)||(p=k._renderer&&k._renderer.offset,p&&(_.save(),_.translate(-k._renderer.offset.x,-k._renderer.offset.y),_.scale(k._renderer.scale.x,k._renderer.scale.y)),_.fill(),p&&_.restore()),be.isHidden.test(v)||(p=v._renderer&&v._renderer.offset,p&&(_.save(),_.translate(-v._renderer.offset.x,-v._renderer.offset.y),_.scale(v._renderer.scale.x,v._renderer.scale.y),_.lineWidth=B/v._renderer.scale.x),_.stroke(),p&&_.restore()),_.restore()},getBoundingClientRect:function(t,e,n){let r=1/0,s=-1/0,o=1/0,a=-1/0,l,c;t.forEach(function(d){const h=d.x,u=d.y,m=d.controls;let f,g,p,b,y,_;o=Math.min(u,o),r=Math.min(h,r),s=Math.max(h,s),a=Math.max(u,a),d.controls&&(y=m.left,_=m.right,!(!y||!_)&&(f=d._relative?y.x+h:y.x,g=d._relative?y.y+u:y.y,p=d._relative?_.x+h:_.x,b=d._relative?_.y+u:_.y,!(!f||!g||!p||!b)&&(o=Math.min(g,b,o),r=Math.min(f,p,r),s=Math.max(f,p,s),a=Math.max(g,b,a))))}),typeof e=="number"&&(o-=e,r-=e,s+=e,a+=e),l=s-r,c=a-o,n.top=o,n.left=r,n.right=s,n.bottom=a,n.width=l,n.height=c,n.centroid||(n.centroid={}),n.centroid.x=-r,n.centroid.y=-o},render:function(t,e,n){if(!this._visible||!this._opacity)return this;K.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();const r=n||this.parent,s=ht.Utils.getRendererType(this._renderer.type),o=e[s],a=r._matrix.manual||r._flagMatrix,l=this._matrix.manual||this._flagMatrix,c=this._renderer.parent!==r,d=this._flagVertices||this._flagFill||this._fill instanceof Le&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagEndPoints)||this._fill instanceof De&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagRadius||this._fill._flagCenter||this._fill._flagFocal)||this._fill instanceof Ne&&(this._fill._flagLoaded&&this._fill.loaded||this._fill._flagImage||this._fill._flagVideo||this._fill._flagRepeat||this._fill._flagOffset||this._fill._flagScale)||this._stroke instanceof Le&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagEndPoints)||this._stroke instanceof De&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagRadius||this._stroke._flagCenter||this._stroke._flagFocal)||this._stroke instanceof Ne&&(this._stroke._flagLoaded&&this._stroke.loaded||this._stroke._flagImage||this._stroke._flagVideo||this._stroke._flagRepeat||this._stroke._flagOffset||this._fill._flagScale)||this._flagStroke||this._flagLinewidth||this._flagOpacity||r._flagOpacity||this._flagVisible||this._flagCap||this._flagJoin||this._flagMiter||this._flagScale||this.dashes&&this.dashes.length>0||!this._renderer.texture;if(a||l||c){this._renderer.matrix||(this._renderer.matrix=new nn(9)),this._matrix.toTransformArray(!0,In),Ur(In,r._renderer.matrix,this._renderer.matrix),this._renderer.scale instanceof Z||(this._renderer.scale=new Z);let u,m;this._scale instanceof Z?(u=this._scale.x*r._renderer.scale.x,m=this._scale.y*r._renderer.scale.y):(u=this._scale*r._renderer.scale.x,m=this._scale*r._renderer.scale.y),this._renderer.scale.x=u<0?-u:u,this._renderer.scale.y=m<0?-m:m,c&&(this._renderer.parent=r)}if(this._mask){t.clear(t.STENCIL_BUFFER_BIT),t.enable(t.STENCIL_TEST),t.stencilFunc(t.ALWAYS,1,0),t.stencilOp(t.KEEP,t.KEEP,t.REPLACE),t.colorMask(!1,!1,!1,!1);const u=ht.Utils.getRendererType(this._mask._renderer.type);be[u].render.call(this._mask,t,e,this),t.stencilFunc(t.EQUAL,1,255),t.stencilOp(t.KEEP,t.KEEP,t.KEEP),t.colorMask(!0,!0,!0,!0)}if(d?(this._renderer.rect||(this._renderer.rect={}),this._renderer.opacity=this._opacity*r._renderer.opacity,be.path.getBoundingClientRect(this._renderer.vertices,this._linewidth,this._renderer.rect),be.updateTexture.call(be,t,this)):(this._fill&&this._fill._update&&this._fill._update(),this._stroke&&this._stroke._update&&this._stroke._update()),this._clip&&!n||!this._renderer.texture)return this;e.current!==o&&(t.useProgram(o),t.bindBuffer(t.ARRAY_BUFFER,e.buffers.position),t.vertexAttribPointer(o.position,2,t.FLOAT,!1,0,0),t.enableVertexAttribArray(o.position),t.bufferData(t.ARRAY_BUFFER,fo,t.STATIC_DRAW),e.resolution.flagged||t.uniform2f(t.getUniformLocation(o,"u_resolution"),e.resolution.width,e.resolution.height),e.current=o),e.resolution.flagged&&t.uniform2f(t.getUniformLocation(o,"u_resolution"),e.resolution.width,e.resolution.height),t.bindTexture(t.TEXTURE_2D,this._renderer.texture);const h=this._renderer.rect;return t.uniformMatrix3fv(o.matrix,!1,this._renderer.matrix),t.uniform4f(o.rect,h.left,h.top,h.right,h.bottom),t.drawArrays(t.TRIANGLES,0,6),this._mask&&t.disable(t.STENCIL_TEST),K.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},points:{updateCanvas:function(t,e){let n;const r=this.canvas,s=this.ctx,o=t.renderer.ratio,a=e._stroke,l=e._linewidth,c=e._fill,d=e._renderer.opacity||e._opacity,h=e.dashes,u=e._size*o;let m=u;be.isHidden.test(a)||(m+=l),r.width=sl(m),r.height=r.width;const f=m/r.width,g=r.width/2,p=r.height/2;if(s.clearRect(0,0,r.width,r.height),c)if(typeof c=="string")s.fillStyle=c;else{const b=ht.Utils.getRendererType(c._renderer.type);be[b].render.call(c,s,e),s.fillStyle=c._renderer.effect}if(a){if(typeof a=="string")s.strokeStyle=a;else{const b=ht.Utils.getRendererType(a._renderer.type);be[b].render.call(a,s,e),s.strokeStyle=a._renderer.effect}l&&(s.lineWidth=rn(e)/f)}typeof d=="number"&&(s.globalAlpha=d),h&&h.length>0&&(s.lineDashOffset=h.offset||0,s.setLineDash(h)),s.save(),s.translate(g,p),s.scale(be.precision,be.precision),s.beginPath(),s.arc(0,0,u/f*.5,0,ct),s.restore(),closed&&s.closePath(),be.isHidden.test(c)||(n=c._renderer&&c._renderer.offset,n&&(s.save(),s.translate(-c._renderer.offset.x,-c._renderer.offset.y),s.scale(c._renderer.scale.x,c._renderer.scale.y)),s.fill(),n&&s.restore()),be.isHidden.test(a)||(n=a._renderer&&a._renderer.offset,n&&(s.save(),s.translate(-a._renderer.offset.x,-a._renderer.offset.y),s.scale(a._renderer.scale.x,a._renderer.scale.y),s.lineWidth=l/a._renderer.scale.x),s.stroke(),n&&s.restore())},render:function(t,e,n){if(!this._visible||!this._opacity)return this;K.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();let r=this._size;const s=n||this.parent,o=e[this._renderer.type],a=this._sizeAttenuation,l=this._stroke,c=this._linewidth,d=s._matrix.manual||s._flagMatrix,h=this._matrix.manual||this._flagMatrix,u=this._renderer.parent!==s,m=this._renderer.vertices,f=this._renderer.collection.length,g=this._flagVertices,p=this._flagFill||this._fill instanceof Le&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagEndPoints)||this._fill instanceof De&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagRadius||this._fill._flagCenter||this._fill._flagFocal)||this._fill instanceof Ne&&(this._fill._flagLoaded&&this._fill.loaded||this._fill._flagImage||this._fill._flagVideo||this._fill._flagRepeat||this._fill._flagOffset||this._fill._flagScale)||this._stroke instanceof Le&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagEndPoints)||this._stroke instanceof De&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagRadius||this._stroke._flagCenter||this._stroke._flagFocal)||this._stroke instanceof Ne&&(this._stroke._flagLoaded&&this._stroke.loaded||this._stroke._flagImage||this._stroke._flagVideo||this._stroke._flagRepeat||this._stroke._flagOffset||this._fill._flagScale)||this._flagStroke||this._flagLinewidth||this._flagOpacity||s._flagOpacity||this._flagVisible||this._flagScale||this.dashes&&this.dashes.length>0||!this._renderer.texture;if(d||h||u){this._renderer.matrix||(this._renderer.matrix=new nn(9)),this._matrix.toTransformArray(!0,In),Ur(In,s._renderer.matrix,this._renderer.matrix),this._renderer.scale instanceof Z||(this._renderer.scale=new Z);let b,y;this._scale instanceof Z?(b=this._scale.x*s._renderer.scale.x,y=this._scale.y*s._renderer.scale.y):(b=this._scale*s._renderer.scale.x,y=this._scale*s._renderer.scale.y),this._renderer.scale.x=b<0?-b:b,this._renderer.scale.y=y<0?-y:y,u&&(this._renderer.parent=s)}if(g){const b=this._renderer.positionBuffer;b&&t.deleteBuffer(b),this._renderer.positionBuffer=t.createBuffer(),t.bindBuffer(t.ARRAY_BUFFER,this._renderer.positionBuffer),t.vertexAttribPointer(o.position,2,t.FLOAT,!1,0,0),t.enableVertexAttribArray(o.position),t.bufferData(t.ARRAY_BUFFER,m,t.STATIC_DRAW)}return p?(this._renderer.opacity=this._opacity*s._renderer.opacity,be.updateTexture.call(be,t,this)):(this._fill&&this._fill._update&&this._fill._update(),this._stroke&&this._stroke._update&&this._stroke._update()),this._clip&&!n||!this._renderer.texture?this:(be.isHidden.test(l)||(r+=c),r/=be.precision,a&&(r*=Math.max(this._renderer.scale.x,this._renderer.scale.y)),e.current!==o&&(t.useProgram(o),e.resolution.flagged||t.uniform2f(t.getUniformLocation(o,"u_resolution"),e.resolution.width,e.resolution.height),e.current=o),e.resolution.flagged&&t.uniform2f(t.getUniformLocation(o,"u_resolution"),e.resolution.width,e.resolution.height),t.bindTexture(t.TEXTURE_2D,this._renderer.texture),t.uniformMatrix3fv(o.matrix,!1,this._renderer.matrix),t.uniform1f(o.size,r*e.resolution.ratio),t.drawArrays(t.POINTS,0,f),K.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset())}},text:{updateCanvas:function(t,e){const n=this.canvas,r=this.ctx,s=t.renderer.ratio,o=pc.copy(e._renderer.scale).multiply(s),a=e._stroke,l=e._linewidth,c=e._fill,d=e._renderer.opacity||e._opacity,h=e.dashes,u=e._decoration,m=e._direction;n.width=Math.max(Math.ceil(e._renderer.rect.width*o.x),1),n.height=Math.max(Math.ceil(e._renderer.rect.height*o.y),1);const f=e._renderer.rect.centroid,g=f.x,p=f.y;let b,y,_,S,C,v,B,k,R,$,F;const D=c._renderer&&c._renderer.offset&&a._renderer&&a._renderer.offset;if(r.clearRect(0,0,n.width,n.height),D||(r.font=[e._style,e._weight,e._size+"px/"+e._leading+"px",e._family].join(" ")),r.textAlign="center",r.textBaseline="middle",r.textDirection=m,c)if(typeof c=="string")r.fillStyle=c;else{const L=ht.Utils.getRendererType(c._renderer.type);be[L].render.call(c,r,e),r.fillStyle=c._renderer.effect}if(a){if(typeof a=="string")r.strokeStyle=a;else{const L=ht.Utils.getRendererType(a._renderer.type);be[L].render.call(a,r,e),r.strokeStyle=a._renderer.effect}l&&(r.lineWidth=rn(e))}if(typeof d=="number"&&(r.globalAlpha=d),h&&h.length>0&&(r.lineDashOffset=h.offset||0,r.setLineDash(h)),r.save(),r.scale(o.x,o.y),r.translate(g,p),be.isHidden.test(c)||(c._renderer&&c._renderer.offset?(v=c._renderer.scale.x,B=c._renderer.scale.y,r.save(),r.translate(-c._renderer.offset.x,-c._renderer.offset.y),r.scale(v,B),b=e._size/c._renderer.scale.y,y=e._leading/c._renderer.scale.y,r.font=[e._style,e._weight,b+"px/",y+"px",e._family].join(" "),_=c._renderer.offset.x/c._renderer.scale.x,S=c._renderer.offset.y/c._renderer.scale.y,r.fillText(e.value,_,S),r.restore()):r.fillText(e.value,0,0)),be.isHidden.test(a)||(a._renderer&&a._renderer.offset?(v=a._renderer.scale.x,B=a._renderer.scale.y,r.save(),r.translate(-a._renderer.offset.x,-a._renderer.offset.y),r.scale(v,B),b=e._size/a._renderer.scale.y,y=e._leading/a._renderer.scale.y,r.font=[e._style,e._weight,b+"px/",y+"px",e._family].join(" "),_=a._renderer.offset.x/a._renderer.scale.x,S=a._renderer.offset.y/a._renderer.scale.y,C=l/a._renderer.scale.x,r.lineWidth=C,r.strokeText(e.value,_,S),r.restore()):r.strokeText(e.value,0,0)),/(underline|strikethrough)/i.test(u)){const L=r.measureText(e.value);switch(u){case"underline":R=L.actualBoundingBoxDescent,F=L.actualBoundingBoxDescent;break;case"strikethrough":R=0,F=0;break}k=-L.width/2,$=L.width/2,r.lineWidth=Math.max(Math.floor(e._size/15),1),r.strokeStyle=r.fillStyle,r.beginPath(),r.moveTo(k,R),r.lineTo($,F),r.stroke()}r.restore()},getBoundingClientRect:function(t,e){const n=be.ctx;n.font=[t._style,t._weight,t._size+"px/"+t._leading+"px",t._family].join(" "),n.textAlign="center",n.textBaseline=ht.Utils.baselines[t._baseline]||t._baseline;const r=n.measureText(t._value);let s=r.width,o=1.15*(r.actualBoundingBoxAscent+r.actualBoundingBoxDescent);this._linewidth&&!be.isHidden.test(this._stroke)&&(s+=this._linewidth*2,o+=this._linewidth*2);const a=s/2,l=o/2;switch(be.alignments[t._alignment]||t._alignment){case be.alignments.left:t.direction==="ltr"?(e.left=0,e.right=s):(e.left=-s,e.right=0);break;case be.alignments.right:t.direction==="ltr"?(e.left=-s,e.right=0):(e.left=0,e.right=s);break;default:e.left=-a,e.right=a}switch(t._baseline){case"bottom":e.top=-o,e.bottom=0;break;case"top":e.top=0,e.bottom=o;break;case"baseline":e.top=-l*1.5,e.bottom=l*.5;break;default:e.top=-l,e.bottom=l}e.width=s,e.height=o,e.centroid||(e.centroid={}),e.centroid.x=a,e.centroid.y=l},render:function(t,e,n){if(!this._visible||!this._opacity)return this;K.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();const r=n||this.parent,s=e[this._renderer.type],o=r._matrix.manual||r._flagMatrix,a=this._matrix.manual||this._flagMatrix,l=this._renderer.parent!==r,c=this._flagVertices||this._flagFill||this._fill instanceof Le&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagEndPoints)||this._fill instanceof De&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagRadius||this._fill._flagCenter||this._fill._flagFocal)||this._fill instanceof Ne&&(this._fill._flagLoaded&&this._fill.loaded||this._fill._flagImage||this._fill._flagVideo||this._fill._flagRepeat||this._fill._flagOffset||this._fill._flagScale)||this._stroke instanceof Le&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagEndPoints)||this._stroke instanceof De&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagRadius||this._stroke._flagCenter||this._stroke._flagFocal)||this._stroke instanceof Ne&&(this._stroke._flagLoaded&&this._stroke.loaded||this._stroke._flagImage||this._stroke._flagVideo||this._stroke._flagRepeat||this._stroke._flagOffset||this._fill._flagScale)||this._flagStroke||this._flagLinewidth||this._flagOpacity||r._flagOpacity||this._flagVisible||this._flagScale||this._flagValue||this._flagFamily||this._flagSize||this._flagLeading||this._flagAlignment||this._flagBaseline||this._flagStyle||this._flagWeight||this._flagDecoration||this.dashes&&this.dashes.length>0||!this._renderer.texture;if(o||a||l){this._renderer.matrix||(this._renderer.matrix=new nn(9)),this._matrix.toTransformArray(!0,In),Ur(In,r._renderer.matrix,this._renderer.matrix),this._renderer.scale instanceof Z||(this._renderer.scale=new Z);let h,u;this._scale instanceof Z?(h=this._scale.x*r._renderer.scale.x,u=this._scale.y*r._renderer.scale.y):(h=this._scale*r._renderer.scale.x,u=this._scale*r._renderer.scale.y),this._renderer.scale.x=h<0?-h:h,this._renderer.scale.y=u<0?-u:u,l&&(this._renderer.parent=r)}if(this._mask){t.clear(t.STENCIL_BUFFER_BIT),t.enable(t.STENCIL_TEST),t.stencilFunc(t.ALWAYS,1,0),t.stencilOp(t.KEEP,t.KEEP,t.REPLACE),t.colorMask(!1,!1,!1,!1);const h=ht.Utils.getRendererType(this._mask._renderer.type);be[h].render.call(this._mask,t,e,this),t.stencilFunc(t.EQUAL,1,255),t.stencilOp(t.KEEP,t.KEEP,t.KEEP),t.colorMask(!0,!0,!0,!0)}if(c?(this._renderer.rect||(this._renderer.rect={}),this._renderer.opacity=this._opacity*r._renderer.opacity,be.text.getBoundingClientRect(this,this._renderer.rect),be.updateTexture.call(be,t,this)):(this._fill&&this._fill._update&&this._fill._update(),this._stroke&&this._stroke._update&&this._stroke._update()),this._clip&&!n||!this._renderer.texture)return this;e.current!==s&&(t.useProgram(s),t.bindBuffer(t.ARRAY_BUFFER,e.buffers.position),t.vertexAttribPointer(s.position,2,t.FLOAT,!1,0,0),t.enableVertexAttribArray(s.position),t.bufferData(t.ARRAY_BUFFER,fo,t.STATIC_DRAW),e.resolution.flagged||t.uniform2f(t.getUniformLocation(s,"u_resolution"),e.resolution.width,e.resolution.height),e.current=s),e.resolution.flagged&&t.uniform2f(t.getUniformLocation(s,"u_resolution"),e.resolution.width,e.resolution.height),t.bindTexture(t.TEXTURE_2D,this._renderer.texture);const d=this._renderer.rect;return t.uniformMatrix3fv(s.matrix,!1,this._renderer.matrix),t.uniform4f(s.rect,d.left,d.top,d.right,d.bottom),t.drawArrays(t.TRIANGLES,0,6),this._mask&&t.disable(t.STENCIL_TEST),K.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},"linear-gradient":{render:function(t,e){if(!(!t.canvas.getContext("2d")||!e)){if(K.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update(),!this._renderer.effect||this._flagEndPoints||this._flagStops||this._flagUnits){let n,r=this.left._x,s=this.left._y,o=this.right._x,a=this.right._y;/objectBoundingBox/i.test(this._units)&&(n=e.getBoundingClientRect(!0),r=(r-.5)*n.width,s=(s-.5)*n.height,o=(o-.5)*n.width,a=(a-.5)*n.height),this._renderer.effect=t.createLinearGradient(r,s,o,a);for(let l=0;l<this.stops.length;l++){const c=this.stops[l];this._renderer.effect.addColorStop(c._offset,c._color)}}return K.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}}},"radial-gradient":{render:function(t,e){if(!(!t.canvas.getContext("2d")||!e)){if(K.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update(),!this._renderer.effect||this._flagCenter||this._flagFocal||this._flagRadius||this._flagStops||this._flagUnits){let n,r=this.center._x,s=this.center._y,o=this.focal._x,a=this.focal._y,l=this._radius;/objectBoundingBox/i.test(this._units)&&(n=e.getBoundingClientRect(!0),r=(r-.5)*n.width*.5,s=(s-.5)*n.height*.5,o=(o-.5)*n.width*.5,a=(a-.5)*n.height*.5,l*=Math.min(n.width,n.height)),this._renderer.effect=t.createRadialGradient(r,s,0,o,a,l);for(let c=0;c<this.stops.length;c++){const d=this.stops[c];this._renderer.effect.addColorStop(d._offset,d._color)}}return K.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}}},texture:{render:function(t,e){if(!t.canvas.getContext("2d"))return;K.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();const n=this.image;if((this._flagLoaded||this._flagImage||this._flagVideo||this._flagRepeat)&&this.loaded)this._renderer.effect=t.createPattern(n,this._repeat);else if(!this._renderer.effect)return this.flagReset();if((this._flagOffset||this._flagLoaded||this._flagScale)&&(this._renderer.offset instanceof Z||(this._renderer.offset=new Z),this._renderer.offset.x=-this._offset.x,this._renderer.offset.y=-this._offset.y,n&&(this._renderer.offset.x+=n.width/2,this._renderer.offset.y+=n.height/2,this._scale instanceof Z?(this._renderer.offset.x*=this._scale.x,this._renderer.offset.y*=this._scale.y):(this._renderer.offset.x*=this._scale,this._renderer.offset.y*=this._scale))),this._flagScale||this._flagLoaded){this._renderer.scale instanceof Z||(this._renderer.scale=new Z);let r,s;this._scale instanceof Z?(r=this._scale.x,s=this._scale.y):(r=this._scale,s=this._scale),this._renderer.scale.x=r<0?-r:r,this._renderer.scale.y=s<0?-s:s}return K.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},updateTexture:function(t,e){const n=ht.Utils.getRendererType(e._renderer.type);if(this[n].updateCanvas.call(be,t,e),this.canvas.width<=0||this.canvas.height<=0){e._renderer.texture&&t.deleteTexture(e._renderer.texture),delete e._renderer.texture;return}e._renderer.texture||(e._renderer.texture=t.createTexture()),t.bindTexture(t.TEXTURE_2D,e._renderer.texture),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,this.canvas),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR)},program:{create:function(t,e){let n,r,s;if(n=t.createProgram(),K.each(e,function(o){t.attachShader(n,o)}),t.linkProgram(n),r=t.getProgramParameter(n,t.LINK_STATUS),!r)throw s=t.getProgramInfoLog(n),t.deleteProgram(n),new $t("unable to link program: "+s);return n}},extensions:{init:function(t){const e={},n=["EXT_texture_filter_anisotropic","WEBGL_compressed_texture_s3tc","OES_texture_float_linear","WEBGL_multisampled_render_to_texture"];for(let r=0;r<n.length;r++){const s=n[r];e[s]=be.extensions.get(t,s)}return e},get:function(t,e){return t.getExtension(e)||t.getExtension(`MOZ_${e}`)||t.getExtension(`WEBKIT_${e}`)}},TextureRegistry:new Fr};be.ctx=be.canvas.getContext("2d");var yc=class extends Y{constructor(t){super();let e,n,r,s;if(this.domElement=t.domElement||document.createElement("canvas"),typeof t.offscreenElement<"u"&&(be.canvas=t.offscreenElement,be.ctx=be.canvas.getContext("2d")),this.scene=new nt,this.scene.parent=this,this._renderer={type:"renderer",matrix:new nn(Rm),scale:1,opacity:1},this._flagMatrix=!0,t=K.defaults(t||{},{antialias:!1,alpha:!0,premultipliedAlpha:!0,stencil:!0,preserveDrawingBuffer:!0,overdraw:!1}),this.overdraw=t.overdraw,e=this.ctx=this.domElement.getContext("webgl",t)||this.domElement.getContext("experimental-webgl",t),!this.ctx)throw new $t("unable to create a webgl context. Try using another renderer.");r=Ht.create(e,Ht.path.vertex,Ht.types.vertex),s=Ht.create(e,Ht.path.fragment,Ht.types.fragment),this.programs={current:null,buffers:{position:e.createBuffer()},resolution:{width:0,height:0,ratio:1,flagged:!1}},n=this.programs.path=be.program.create(e,[r,s]),this.programs.text=this.programs.path,e.extensions=be.extensions.init(e),e.renderer=this,n.position=e.getAttribLocation(n,"a_position"),n.matrix=e.getUniformLocation(n,"u_matrix"),n.rect=e.getUniformLocation(n,"u_rect");const o=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,o),e.vertexAttribPointer(n.position,2,e.FLOAT,!1,0,0),e.enableVertexAttribArray(n.position),e.bufferData(e.ARRAY_BUFFER,fo,e.STATIC_DRAW),r=Ht.create(e,Ht.points.vertex,Ht.types.vertex),s=Ht.create(e,Ht.points.fragment,Ht.types.fragment),n=this.programs.points=be.program.create(e,[r,s]),n.position=e.getAttribLocation(n,"a_position"),n.matrix=e.getUniformLocation(n,"u_matrix"),n.size=e.getUniformLocation(n,"u_size"),e.enable(e.BLEND),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0),e.blendEquation(e.FUNC_ADD),e.blendFunc(e.ONE,e.ONE_MINUS_SRC_ALPHA)}setSize(t,e,n){let r,s;const o=this.ctx;return this.width=t,this.height=e,this.ratio=typeof n>"u"?Hs(o):n,this.domElement.width=t*this.ratio,this.domElement.height=e*this.ratio,K.isObject(this.domElement.style)&&K.extend(this.domElement.style,{width:t+"px",height:e+"px"}),this._renderer.matrix[0]=this._renderer.matrix[4]=this._renderer.scale=this.ratio,this._flagMatrix=!0,r=t*this.ratio,s=e*this.ratio,o.viewport(0,0,r,s),this.programs.resolution.width=r,this.programs.resolution.height=s,this.programs.resolution.ratio=this.ratio,this.programs.resolution.flagged=!0,this.trigger(Y.Types.resize,t,e,n)}render(){const t=this.ctx;return this.overdraw||t.clear(t.COLOR_BUFFER_BIT),be.group.render.call(this.scene,t,this.programs),this._flagMatrix=!1,this.programs.resolution.flagged=!0,this}};w(yc,"Utils",be);var Em=K.extend({Error:$t,getRatio:Hs,read:Ve,xhr:dc},K,wt,tl,nl),we=class Rr{constructor(e){w(this,"_events",new Y),w(this,"type",""),w(this,"renderer",null),w(this,"scene",null),w(this,"width",0),w(this,"height",0),w(this,"frameCount",0),w(this,"timeDelta",0),w(this,"playing",!1);const n=K.defaults(e||{},{fullscreen:!1,fitted:!1,width:640,height:480,type:Rr.Types.svg,autostart:!1});if(K.each(n,function(r,s){/fullscreen/i.test(s)||/autostart/i.test(s)||(this[s]=r)},this),K.isElement(n.domElement)){const r=n.domElement.tagName.toLowerCase();/^(CanvasRenderer-canvas|WebGLRenderer-canvas|SVGRenderer-svg)$/.test(this.type+"-"+r)||(this.type=Rr.Types[r])}this.renderer=new Rr[this.type](this),this.setPlaying(n.autostart),this.frameCount=0,n.fullscreen?(this.fit=Nm.bind(this),this.fit.domElement=window,this.fit.attached=!0,K.extend(document.body.style,{overflow:"hidden",margin:0,padding:0,top:0,left:0,right:0,bottom:0,position:"fixed"}),K.extend(this.renderer.domElement.style,{display:"block",top:0,left:0,right:0,bottom:0,position:"fixed"}),Mt.bind(this.fit.domElement,"resize",this.fit),this.fit()):n.fitted?(this.fit=Pm.bind(this),K.extend(this.renderer.domElement.style,{display:"block"})):typeof n.width=="number"&&typeof n.height=="number"&&(this.renderer.setSize(n.width,n.height,this.ratio),this.width=n.width,this.height=n.height),this.renderer.bind(Y.Types.resize,Fm.bind(this)),this.scene=this.renderer.scene,Rr.Instances.push(this),n.autostart&&rr.init()}get _bound(){return this._events._bound}set _bound(e){this._events._bound=e}addEventListener(){return this._events.addEventListener.apply(this,arguments)}on(){return this._events.addEventListener.apply(this,arguments)}bind(){return this._events.addEventListener.apply(this,arguments)}removeEventListener(){return this._events.removeEventListener.apply(this,arguments)}off(){return this._events.removeEventListener.apply(this,arguments)}unbind(){return this._events.removeEventListener.apply(this,arguments)}dispatchEvent(){return this._events.dispatchEvent.apply(this,arguments)}trigger(){return this._events.dispatchEvent.apply(this,arguments)}listen(){return this._events.listen.apply(this,arguments)}ignore(){return this._events.ignore.apply(this,arguments)}appendTo(e){return e.appendChild(this.renderer.domElement),this.fit&&(this.fit.domElement!==window&&(this.fit.domElement=e,this.fit.attached=!1),this.update()),this}play(){return this.playing=!0,rr.init(),this.trigger(Y.Types.play)}pause(){return this.playing=!1,this.trigger(Y.Types.pause)}setPlaying(e){this.playing=e}release(e){let n,r,s;if(typeof e>"u")return this.release(this.scene);if(typeof e.unbind=="function"&&e.unbind(),typeof e.fill=="object"&&"unbind"in e.fill&&e.fill.unbind(),typeof e.stroke=="object"&&"unbind"in e.stroke&&e.stroke.unbind(),e.vertices){if(typeof e.vertices.unbind=="function")try{e.vertices.unbind()}catch{}for(n=0;n<e.vertices.length;n++)r=e.vertices[n],typeof r.unbind=="function"&&r.unbind(),r.controls&&(r.controls.left&&typeof r.controls.left.unbind=="function"&&r.controls.left.unbind(),r.controls.right&&typeof r.controls.right.unbind=="function"&&r.controls.right.unbind())}if(e.children){for(n=0;n<e.children.length;n++)s=e.children[n],this.release(s);if(typeof e.children.unbind=="function")try{e.children.unbind()}catch{}}if(e._renderer){if(e._renderer.elem&&e._renderer.elem.parentNode&&(e._renderer.elem.parentNode.removeChild(e._renderer.elem),delete e._renderer.elem),this.type==="WebGLRenderer"&&this.renderer.ctx){const o=this.renderer.ctx;e._renderer.texture&&(o.deleteTexture(e._renderer.texture),delete e._renderer.texture),e._renderer.positionBuffer&&(o.deleteBuffer(e._renderer.positionBuffer),delete e._renderer.positionBuffer),e._renderer.effect&&(e._renderer.effect=null)}this.type==="CanvasRenderer"&&e._renderer.context&&delete e._renderer.context}return e}update(){const e=!!this._lastFrame,n=K.performance.now();e&&(this.timeDelta=parseFloat((n-this._lastFrame).toFixed(3))),this._lastFrame=n,this.fit&&this.fit.domElement&&!this.fit.attached&&(Mt.bind(this.fit.domElement,"resize",this.fit),this.fit.attached=!0,this.fit());const r=this.width,s=this.height,o=this.renderer;return(r!==o.width||s!==o.height)&&o.setSize(r,s,this.ratio),this.trigger(Y.Types.update,this.frameCount,this.timeDelta),this.render()}render(){return this.renderer.render(),this.trigger(Y.Types.render,this.frameCount++)}add(e){return e instanceof Array||(e=Array.prototype.slice.call(arguments)),this.scene.add(e),this}remove(e){return e instanceof Array||(e=Array.prototype.slice.call(arguments)),this.scene.remove(e),this}clear(){return this.scene.remove(this.scene.children),this}makeLine(e,n,r,s){const o=new Wr(e,n,r,s);return this.scene.add(o),o}makeArrow(e,n,r,s,o){const a=typeof o=="number"?o:10,l=Math.atan2(s-n,r-e),c=[new ve(e,n,void 0,void 0,void 0,void 0,Q.move),new ve(r,s,void 0,void 0,void 0,void 0,Q.line),new ve(r-a*Math.cos(l-Math.PI/4),s-a*Math.sin(l-Math.PI/4),void 0,void 0,void 0,void 0,Q.line),new ve(r,s,void 0,void 0,void 0,void 0,Q.move),new ve(r-a*Math.cos(l+Math.PI/4),s-a*Math.sin(l+Math.PI/4),void 0,void 0,void 0,void 0,Q.line)],d=new ke(c,!1,!1,!0);return d.noFill(),d.cap="round",d.join="round",this.scene.add(d),d}makeRectangle(e,n,r,s){const o=new Vn(e,n,r,s);return this.scene.add(o),o}makeRoundedRectangle(e,n,r,s,o){const a=new Lr(e,n,r,s,o);return this.scene.add(a),a}makeCircle(e,n,r,s){const o=new Ir(e,n,r,s);return this.scene.add(o),o}makeEllipse(e,n,r,s,o){const a=new zr(e,n,r,s,o);return this.scene.add(a),a}makeStar(e,n,r,s,o){const a=new io(e,n,r,s,o);return this.scene.add(a),a}makeCurve(e){const n=arguments.length;if(!Array.isArray(e)){e=[];for(let a=0;a<n;a+=2){const l=arguments[a];if(typeof l!="number")break;const c=arguments[a+1];e.push(new ve(l,c))}}const r=arguments[n-1],s=new ke(e,!(typeof r=="boolean"&&r),!0),o=s.getBoundingClientRect();return s.center().translation.set(o.left+o.width/2,o.top+o.height/2),this.scene.add(s),s}makePolygon(e,n,r,s){const o=new no(e,n,r,s);return this.scene.add(o),o}makeArcSegment(e,n,r,s,o,a,l){const c=new Ks(e,n,r,s,o,a,l);return this.scene.add(c),c}makePoints(e){const n=arguments.length;let r=e;if(!Array.isArray(e)){r=[];for(let o=0;o<n;o+=2){const a=arguments[o];if(typeof a!="number")break;const l=arguments[o+1];r.push(new Z(a,l))}}const s=new to(r);return this.scene.add(s),s}makePath(e){const n=arguments.length;let r=e;if(!Array.isArray(e)){r=[];for(let l=0;l<n;l+=2){const c=arguments[l];if(typeof c!="number")break;const d=arguments[l+1];r.push(new ve(c,d))}}const s=arguments[n-1],o=new ke(r,!(typeof s=="boolean"&&s)),a=o.getBoundingClientRect();return typeof a.top=="number"&&typeof a.left=="number"&&typeof a.right=="number"&&typeof a.bottom=="number"&&o.center().translation.set(a.left+a.width/2,a.top+a.height/2),this.scene.add(o),o}makeText(e,n,r,s){const o=new sn(e,n,r,s);return this.add(o),o}makeLinearGradient(e,n,r,s){const o=Array.prototype.slice.call(arguments,4),a=new Le(e,n,r,s,o);return this.add(a),a}makeRadialGradient(e,n,r){const s=Array.prototype.slice.call(arguments,3),o=new De(e,n,r,s);return this.add(o),o}makeSprite(e,n,r,s,o,a,l){const c=new Vr(e,n,r,s,o,a);return l&&c.play(),this.add(c),c}makeImage(e,n,r,s,o,a){const l=new hc(e,n,r,s,o,a);return this.add(l),l}makeImageSequence(e,n,r,s,o){const a=new ao(e,n,r,s);return o&&a.play(),this.add(a),a}makeTexture(e,n){return new Ne(e,n)}makeGroup(e){e instanceof Array||(e=Array.prototype.slice.call(arguments));const n=new nt;return this.scene.add(n),n.add(e),n}interpret(e,n,r){const s=e.tagName.toLowerCase();if(r=typeof r<"u"?r:!0,!(s in Ve))return null;const o=Ve[s].call(this,e);return r?this.add(n&&o instanceof nt?o.children:o):o.parent&&o.remove(),o}load(e,n){const r=new nt;let s,o,a;const l=(function(c){for(Mt.temp.innerHTML=c,o=0;o<Mt.temp.children.length;o++)s=Mt.temp.children[o],a=this.interpret(s,!1,!1),a!==null&&r.add(a);if(typeof n=="function"){const d=Mt.temp.children.length<=1?Mt.temp.children[0]:Mt.temp.children;n(r,d)}}).bind(this);return/\.svg$/i.test(e)?(dc(e,l),r):(l(e),r)}};w(we,"NextFrameId",xt.NextFrameId),w(we,"Types",xt.Types),w(we,"Version",xt.Version),w(we,"PublishDate",xt.PublishDate),w(we,"Identifier",xt.Identifier),w(we,"Resolution",xt.Resolution),w(we,"AutoCalculateImportedMatrices",xt.AutoCalculateImportedMatrices),w(we,"Instances",xt.Instances),w(we,"uniqueId",xt.uniqueId),w(we,"Anchor",ve),w(we,"Collection",Mn),w(we,"Events",Y),w(we,"Group",nt),w(we,"Matrix",Pi),w(we,"Path",ke),w(we,"Registry",Fr),w(we,"Element",Ni),w(we,"Shape",On),w(we,"Text",sn),w(we,"Vector",Z),w(we,"Gradient",Je),w(we,"Image",hc),w(we,"ImageSequence",ao),w(we,"LinearGradient",Le),w(we,"RadialGradient",De),w(we,"Sprite",Vr),w(we,"Stop",An),w(we,"Texture",Ne),w(we,"ArcSegment",Ks),w(we,"Circle",Ir),w(we,"Ellipse",zr),w(we,"Line",Wr),w(we,"Points",to),w(we,"Polygon",no),w(we,"Rectangle",Vn),w(we,"RoundedRectangle",Lr),w(we,"Star",io),w(we,"CanvasRenderer",ht),w(we,"SVGRenderer",mc),w(we,"WebGLRenderer",yc),w(we,"Commands",Q),w(we,"Utils",Em);var an=we;function Nm(){const t=document.body.getBoundingClientRect(),e=this.width=t.width,n=this.height=t.height;this.renderer.setSize(e,n,this.ratio)}function Pm(){const t=this.renderer.domElement.parentElement;if(!t){console.warn("Two.js: Attempting to fit to parent, but no parent found.");return}const e=t.getBoundingClientRect(),n=this.width=e.width,r=this.height=e.height;this.renderer.setSize(n,r,this.ratio)}function Fm(t,e){this.width=t,this.height=e,this.trigger(Y.Types.resize,t,e)}var rr=Mt.getRequestAnimationFrame();function bc(){for(let t=0;t<an.Instances.length;t++){const e=an.Instances[t];e.playing&&e.update()}an.NextFrameId=rr(bc)}rr.init=function(){bc(),rr.init=function(){}};let ln;typeof window<"u"?ln=window:typeof global<"u"?ln=global:typeof self<"u"&&(ln=self);let _c;const Qn=Math.PI*2,it=Math.PI*.5;function Mm(t,e,n,r,s,o){let a;return arguments.length<=1?(a=t.a,e=t.b,n=t.c,r=t.d,s=t.e,o=t.f):a=t,{translateX:s,translateY:o,scaleX:Math.sqrt(a*a+e*e),scaleY:Math.sqrt(n*n+r*r),rotation:180*Math.atan2(e,a)/Math.PI}}function Am(t){_c=t}function Om(t,e){e=e&&e.identity()||new _c;let n=t;const r=[];for(;n&&n._matrix;)r.push(n._matrix),n=n.parent;r.reverse();for(let s=0;s<r.length;s++){const a=r[s].elements;e.multiply(a[0],a[1],a[2],a[3],a[4],a[5],a[6],a[7],a[8])}return e}function Wt(t,e,n){return n*(e-t)+t}function Ai(t,e){for(;t<0;)t+=e;return t%e}const wc=ln.Float32Array||Array,Vm=Math.floor;function cn(t){return Vm(t*1e6)/1e6}const fe={move:"M",line:"L",curve:"C",close:"Z"};class U{constructor(){x(this,"_events",{});x(this,"_bound",!1)}addEventListener(e,n){return(this._events[e]||(this._events[e]=[])).push(n),this._bound=!0,this}on(){return this.addEventListener.apply(this,arguments)}bind(){return this.addEventListener.apply(this,arguments)}removeEventListener(e,n){if(!this._events)return this;if(!e&&!n)return this._events={},this._bound=!1,this;const r=e?[e]:Object.keys(this._events);for(let s=0,o=r.length;s<o;s++){e=r[s];let a=this._events[e];if(a){let l=[];if(n)for(let c=0,d=a.length;c<d;c++){let h=a[c];h=h.handler?h.handler:h,n!==h&&l.push(h)}this._events[e]=l}}return this}off(){return this.removeEventListener.apply(this,arguments)}unbind(){return this.removeEventListener.apply(this,arguments)}dispatchEvent(e){if(!this._events)return this;const n=Array.prototype.slice.call(arguments,1),r=this._events[e];if(r)for(let s=0;s<r.length;s++)r[s].call(this,...n);return this}trigger(){return this.dispatchEvent.apply(this,arguments)}listen(e,n,r){const s=this;e&&(o.obj=e,o.name=n,o.handler=r,e.on(n,o));function o(){r.apply(s,arguments)}return s}ignore(e,n,r){return e.off(n,r),this}}x(U,"Types",{play:"play",pause:"pause",update:"update",render:"render",resize:"resize",change:"change",remove:"remove",insert:"insert",order:"order",load:"load"}),x(U,"Methods",["addEventListener","on","removeEventListener","off","unbind","dispatchEvent","trigger","listen","ignore"]);const xc={x:{enumerable:!0,get:function(){return this._x},set:function(t){this._x!==t&&(this._x=t,this._bound&&this.dispatchEvent(U.Types.change))}},y:{enumerable:!0,get:function(){return this._y},set:function(t){this._y!==t&&(this._y=t,this._bound&&this.dispatchEvent(U.Types.change))}}},ot=class ot extends U{constructor(n=0,r=0){super();x(this,"_x",0);x(this,"_y",0);for(let s in xc)Object.defineProperty(this,s,xc[s]);this.x=n,this.y=r}static add(n,r){return new ot(n.x+r.x,n.y+r.y)}static sub(n,r){return new ot(n.x-r.x,n.y-r.y)}static subtract(n,r){return ot.sub(n,r)}static ratioBetween(n,r){return(n.x*r.x+n.y*r.y)/(n.length()*r.length())}static angleBetween(n,r){if(arguments.length>=4){const a=arguments[0]-arguments[2],l=arguments[1]-arguments[3];return Math.atan2(l,a)}const s=n.x-r.x,o=n.y-r.y;return Math.atan2(o,s)}static distanceBetween(n,r){return Math.sqrt(ot.distanceBetweenSquared(n,r))}static distanceBetweenSquared(n,r){const s=n.x-r.x,o=n.y-r.y;return s*s+o*o}set(n,r){return this.x=n,this.y=r,this}copy(n){return this.x=n.x,this.y=n.y,this}clear(){return this.x=0,this.y=0,this}clone(){return new ot(this.x,this.y)}add(n,r){return arguments.length<=0?this:(arguments.length<=1?typeof n=="number"?(this.x+=n,this.y+=n):n&&typeof n.x=="number"&&typeof n.y=="number"&&(this.x+=n.x,this.y+=n.y):(this.x+=n,this.y+=r),this)}addSelf(n){return this.add.apply(this,arguments)}sub(n,r){return arguments.length<=0?this:(arguments.length<=1?typeof n=="number"?(this.x-=n,this.y-=n):n&&typeof n.x=="number"&&typeof n.y=="number"&&(this.x-=n.x,this.y-=n.y):(this.x-=n,this.y-=r),this)}subtract(){return this.sub.apply(this,arguments)}subSelf(n){return this.sub.apply(this,arguments)}subtractSelf(n){return this.sub.apply(this,arguments)}multiply(n,r){return arguments.length<=0?this:(arguments.length<=1?typeof n=="number"?(this.x*=n,this.y*=n):n&&typeof n.x=="number"&&typeof n.y=="number"&&(this.x*=n.x,this.y*=n.y):(this.x*=n,this.y*=r),this)}multiplySelf(n){return this.multiply.apply(this,arguments)}multiplyScalar(n){return this.multiply(n)}divide(n,r){return arguments.length<=0?this:(arguments.length<=1?typeof n=="number"?(this.x/=n,this.y/=n):n&&typeof n.x=="number"&&typeof n.y=="number"&&(this.x/=n.x,this.y/=n.y):(this.x/=n,this.y/=r),isNaN(this.x)&&(this.x=0),isNaN(this.y)&&(this.y=0),this)}divideSelf(n){return this.divide.apply(this,arguments)}divideScalar(n){return this.divide(n)}negate(){return this.multiply(-1)}dot(n){return this.x*n.x+this.y*n.y}length(){return Math.sqrt(this.lengthSquared())}lengthSquared(){return this.x*this.x+this.y*this.y}normalize(){return this.divideScalar(this.length())}distanceTo(n){return Math.sqrt(this.distanceToSquared(n))}distanceToSquared(n){const r=this.x-n.x,s=this.y-n.y;return r*r+s*s}setLength(n){return this.normalize().multiplyScalar(n)}equals(n,r){return r=typeof r>"u"?1e-4:r,this.distanceTo(n)<r}lerp(n,r){const s=(n.x-this.x)*r+this.x,o=(n.y-this.y)*r+this.y;return this.set(s,o)}isZero(n){return n=typeof n>"u"?1e-4:n,this.length()<n}toString(){return this.x+", "+this.y}toObject(){return{x:cn(this.x),y:cn(this.y)}}rotate(n){const r=this.x,s=this.y,o=Math.cos(n),a=Math.sin(n);return this.x=r*o-s*a,this.y=r*a+s*o,this}};x(ot,"zero",new ot),x(ot,"left",new ot(-1,0)),x(ot,"right",new ot(1,0)),x(ot,"up",new ot(0,-1)),x(ot,"down",new ot(0,1));let me=ot;class Te extends me{constructor(n=0,r=0,s=0,o=0,a=0,l=0,c=fe.move){super(n,r);x(this,"controls",{left:new me,right:new me});x(this,"_command",fe.move);x(this,"_relative",!0);x(this,"_rx",0);x(this,"_ry",0);x(this,"_xAxisRotation",0);x(this,"_largeArcFlag",0);x(this,"_sweepFlag",1);for(let h in vc)Object.defineProperty(this,h,vc[h]);this.command=c,this.relative=!0;const d=Te.makeBroadcast(this);this.controls.left.set(s,o).addEventListener(U.Types.change,d),this.controls.right.set(a,l).addEventListener(U.Types.change,d)}static makeBroadcast(n){return r;function r(){n._bound&&n.dispatchEvent(U.Types.change)}}static fromObject(n){return new Te().copy(n)}copy(n){return this.x=n.x,this.y=n.y,typeof n.command=="string"&&(this.command=n.command),n.controls&&(n.controls.left&&this.controls.left.copy(n.controls.left),n.controls.right&&this.controls.right.copy(n.controls.right)),typeof n.relative=="boolean"&&(this.relative=n.relative),typeof n.rx=="number"&&(this.rx=n.rx),typeof n.ry=="number"&&(this.ry=n.ry),typeof n.xAxisRotation=="number"&&(this.xAxisRotation=n.xAxisRotation),typeof n.largeArcFlag=="number"&&(this.largeArcFlag=n.largeArcFlag),typeof n.sweepFlag=="number"&&(this.sweepFlag=n.sweepFlag),this}clone(){return new Te().copy(this)}toObject(){return{x:cn(this.x),y:cn(this.y),command:this.command,relative:this.relative,controls:{left:this.controls.left.toObject(),right:this.controls.right.toObject()},rx:cn(this.rx),ry:cn(this.ry),xAxisRotation:cn(this.xAxisRotation),largeArcFlag:cn(this.largeArcFlag),sweepFlag:cn(this.sweepFlag)}}toString(){return JSON.stringify(this.toObject())}}const vc={command:{enumerable:!0,get:function(){return this._command},set:function(t){this._command!==t&&(this._command=t,this._bound&&this.dispatchEvent(U.Types.change))}},relative:{enumerable:!0,get:function(){return this._relative},set:function(t){this._relative!==!!t&&(this._relative=!!t,this._bound&&this.dispatchEvent(U.Types.change))}},rx:{enumerable:!0,get:function(){return this._rx},set:function(t){this._rx!==t&&(this._rx=t,this._bound&&this.dispatchEvent(U.Types.change))}},ry:{enumerable:!0,get:function(){return this._ry},set:function(t){this._ry!==t&&(this._ry=t,this._bound&&this.dispatchEvent(U.Types.change))}},xAxisRotation:{enumerable:!0,get:function(){return this._xAxisRotation},set:function(t){this._xAxisRotation!==t&&(this._xAxisRotation=t,this._bound&&this.dispatchEvent(U.Types.change))}},largeArcFlag:{enumerable:!0,get:function(){return this._largeArcFlag},set:function(t){this._largeArcFlag!==t&&(this._largeArcFlag=t,this._bound&&this.dispatchEvent(U.Types.change))}},sweepFlag:{get:function(){return this._sweepFlag},set:function(t){this._sweepFlag!==t&&(this._sweepFlag=t,this._bound&&this.dispatchEvent(U.Types.change))}}};let Im=0;const go={NextFrameId:null,Types:{webgl:"WebGLRenderer",svg:"SVGRenderer",canvas:"CanvasRenderer"},Version:"<%= version %>",PublishDate:"<%= publishDate %>",Identifier:"two-",Resolution:12,AutoCalculateImportedMatrices:!0,Instances:[],uniqueId:function(){return Im++}},Gr={RecursionLimit:16,abscissas:[[.5773502691896],[0,.7745966692415],[.3399810435849,.8611363115941],[0,.5384693101057,.9061798459387],[.2386191860832,.6612093864663,.9324695142032],[0,.4058451513774,.7415311855994,.9491079123428],[.1834346424956,.5255324099163,.7966664774136,.9602898564975],[0,.3242534234038,.6133714327006,.8360311073266,.9681602395076],[.1488743389816,.4333953941292,.679409568299,.865063366689,.9739065285172],[0,.2695431559523,.5190961292068,.730152005574,.8870625997681,.9782286581461],[.1252334085115,.3678314989982,.5873179542866,.7699026741943,.9041172563705,.9815606342467],[0,.2304583159551,.4484927510364,.6423493394403,.8015780907333,.917598399223,.9841830547186],[.1080549487073,.3191123689279,.5152486363582,.6872929048117,.8272013150698,.9284348836636,.9862838086968],[0,.2011940939974,.3941513470776,.5709721726085,.7244177313602,.8482065834104,.9372733924007,.9879925180205],[.0950125098376,.2816035507793,.4580167776572,.6178762444026,.755404408355,.8656312023878,.9445750230732,.9894009349916]],weights:[[1],[.8888888888889,.5555555555556],[.6521451548625,.3478548451375],[.5688888888889,.4786286704994,.2369268850562],[.4679139345727,.3607615730481,.1713244923792],[.4179591836735,.3818300505051,.2797053914893,.1294849661689],[.3626837833784,.3137066458779,.2223810344534,.1012285362904],[.3302393550013,.31234707704,.2606106964029,.1806481606949,.0812743883616],[.2955242247148,.26926671931,.219086362516,.1494513491506,.0666713443087],[.2729250867779,.2628045445102,.233193764592,.1862902109277,.1255803694649,.0556685671162],[.2491470458134,.2334925365384,.2031674267231,.1600783285433,.1069393259953,.0471753363865],[.2325515532309,.2262831802629,.2078160475369,.1781459807619,.1388735102198,.0921214998377,.0404840047653],[.2152638534632,.2051984637213,.1855383974779,.1572031671582,.1215185706879,.0801580871598,.0351194603318],[.2025782419256,.1984314853271,.1861610000156,.166269205817,.1395706779262,.1071592204672,.0703660474881,.0307532419961],[.1894506104551,.1826034150449,.169156519395,.1495959888166,.1246289712555,.0951585116825,.0622535239386,.0271524594118]]};function Kr(t,e,n,r,s){const o=1-t;return o*o*o*e+3*o*o*t*n+3*o*t*t*r+t*t*t*s}function kc(t,e,n,r,s,o,a,l,c){c=c||Gr.RecursionLimit;const d=c+1;if(Math.abs(t-a)<.001&&Math.abs(e-l)<.001)return[new Te(a,l)];const h=[];for(let u=0;u<d;u++){const m=u/d,f=Kr(m,t,n,s,a),g=Kr(m,e,r,o,l);h.push(new Te(f,g))}return h}function zm(t,e,n,r,s,o,a,l,c){if(t===n&&e===r&&s===a&&o===l){const b=a-t,y=l-e;return Math.sqrt(b*b+y*y)}const d=9*(n-s)+3*(a-t),h=6*(t+s)-12*n,u=3*(n-t),m=9*(r-o)+3*(l-e),f=6*(e+o)-12*r,g=3*(r-e);function p(b){const y=(d*b+h)*b+u,_=(m*b+f)*b+g;return Math.sqrt(y*y+_*_)}return Dm(p,0,1,c||Gr.RecursionLimit)}function Lm(t,e,n,r,s,o,a,l){const c=[],d=[[],[]];let h,u,m,f,g,p,b,y;for(let v=0;v<2;++v){if(v===0?(u=6*t-12*n+6*s,h=-3*t+9*n-9*s+3*a,m=3*n-3*t):(u=6*e-12*r+6*o,h=-3*e+9*r-9*o+3*l,m=3*r-3*e),Math.abs(h)<.001){if(Math.abs(u)<.001)continue;f=-m/u,0<f&&f<1&&c.push(f);continue}b=u*u-4*m*h,y=Math.sqrt(b),!(b<0)&&(g=(-u+y)/(2*h),0<g&&g<1&&c.push(g),p=(-u-y)/(2*h),0<p&&p<1&&c.push(p))}let _=c.length,S=_,C;for(;_--;)f=c[_],C=1-f,d[0][_]=C*C*C*t+3*C*C*f*n+3*C*f*f*s+f*f*f*a,d[1][_]=C*C*C*e+3*C*C*f*r+3*C*f*f*o+f*f*f*l;return d[0][S]=t,d[1][S]=e,d[0][S+1]=a,d[1][S+1]=l,d[0].length=d[1].length=S+2,{min:{x:Math.min.apply(0,d[0]),y:Math.min.apply(0,d[1])},max:{x:Math.max.apply(0,d[0]),y:Math.max.apply(0,d[1])}}}function Dm(t,e,n,r){let s=Gr.abscissas[r-2],o=Gr.weights[r-2],a=.5*(n-e),l=a+e,c=0,d=r+1>>1,h=r&1?o[c++]*t(l):0;for(;c<d;){const u=a*s[c];h+=o[c++]*(t(l+u)+t(l-u))}return a*h}function Hm(t,e){const n=t.length,r=n-1;for(let s=0;s<n;s++){const o=t[s],a=e?Ai(s-1,n):Math.max(s-1,0),l=e?Ai(s+1,n):Math.min(s+1,r),c=t[a],d=o,h=t[l];Wm(c,d,h),d.command=s===0?fe.move:fe.curve}}function Wm(t,e,n){const r=me.angleBetween(t,e),s=me.angleBetween(n,e);let o=me.distanceBetween(t,e),a=me.distanceBetween(n,e),l=(r+s)/2;return o<.001||a<.001?(typeof e.relative=="boolean"&&!e.relative&&(e.controls.left.copy(e),e.controls.right.copy(e)),e):(o*=.33,a*=.33,s<r?l+=it:l-=it,e.controls.left.x=Math.cos(l)*o,e.controls.left.y=Math.sin(l)*o,l-=Math.PI,e.controls.right.x=Math.cos(l)*a,e.controls.right.y=Math.sin(l)*a,typeof e.relative=="boolean"&&!e.relative&&(e.controls.left.x+=e.x,e.controls.left.y+=e.y,e.controls.right.x+=e.x,e.controls.right.y+=e.y),e)}let sr=(pi=class extends U{constructor(){super();x(this,"_flagId",!1);x(this,"_flagClassName",!1);x(this,"_renderer",{});x(this,"_id",go.Identifier+go.uniqueId());x(this,"_className","");x(this,"classList",[]);for(let n in Cc)Object.defineProperty(this,n,Cc[n])}static fromObject(n){const r=new pi().copy(n);return"id"in n&&(r.id=n.id),r}flagReset(){return this._flagId=this._flagClassName=!1,this}copy(n){return n.renderer&&typeof n.renderer.type=="string"&&(this.renderer.type=n.renderer.type),typeof n.className=="string"&&(this.className=n.className),this}toObject(){return{renderer:{type:this.renderer.type},id:this.id,className:this.className}}dispose(){const n=this._renderer.type;return this._renderer={type:n},typeof this.unbind=="function"&&this.unbind(),this}},x(pi,"Properties",["renderer","id","className"]),pi);const Cc={renderer:{enumerable:!1,get:function(){return this._renderer}},id:{enumerable:!0,get:function(){return this._id},set:function(t){const e=this._id;t!==this._id&&(this._id=t,this._flagId=!0,this.parent&&(delete this.parent.children.ids[e],this.parent.children.ids[this._id]=this))}},className:{enumerable:!0,get:function(){return this._className},set:function(t){this._className!==t&&(this._flagClassName=!0,this.classList=t.split(/\s+?/),this._className=t)}}};class Zr extends Error{constructor(n){super();x(this,"name","Two.js");x(this,"message");this.message=n}}class jm{constructor(){x(this,"map",{})}add(e,n){return this.map[e]=n,this}remove(e){return delete this.map[e],this}get(e){return this.map[e]}contains(e){return e in this.map}}let Jr;const Sc={video:/\.(mp4|webm|ogg)$/i,image:/\.(jpe?g|png|gif|tiff|webp)$/i,effect:/texture|gradient/i};ln.document&&(Jr=document.createElement("a"));const We=class We extends sr{constructor(n,r){super();x(this,"_flagSrc",!1);x(this,"_flagImage",!1);x(this,"_flagVideo",!1);x(this,"_flagLoaded",!1);x(this,"_flagRepeat",!1);x(this,"_flagOffset",!1);x(this,"_flagScale",!1);x(this,"_src","");x(this,"_image",null);x(this,"_loaded",!1);x(this,"_repeat","no-repeat");x(this,"_scale",1);x(this,"_offset",null);for(let s in Bc)Object.defineProperty(this,s,Bc[s]);if(this._renderer.type="texture",this._renderer.flagOffset=qm.bind(this),this._renderer.flagScale=Xm.bind(this),this.loaded=!1,this.repeat="no-repeat",this.offset=new me,typeof r=="function"){const s=(function(){this.unbind(U.Types.load,s),typeof r=="function"&&r()}).bind(this);this.bind(U.Types.load,s)}if(typeof n=="string")this.src=n;else if(typeof n=="object"){const s=Object.prototype.toString.call(n);(s==="[object HTMLImageElement]"||s==="[object HTMLCanvasElement]"||s==="[object HTMLVideoElement]"||s==="[object Image]")&&(this.image=n)}this._update()}fromObject(n){const r=new We().copy(n);return"id"in n&&(r.id=n.id),r}static getAbsoluteURL(n){return Jr?(Jr.href=n,Jr.href):n}static loadHeadlessBuffer(n,r){n.image.onload=r,n.image.src=n.src}static getTag(n){return n&&n.nodeName&&n.nodeName.toLowerCase()||"img"}static getImage(n){const r=We.getAbsoluteURL(n);if(We.ImageRegistry.contains(r))return We.ImageRegistry.get(r);let s;return ln.document?Sc.video.test(r)?s=document.createElement("video"):s=document.createElement("img"):console.warn("Two.js: no prototypical image defined for Two.Texture"),s.crossOrigin="anonymous",s.referrerPolicy="no-referrer",s}static load(n,r){let s=n.image,o=We.getTag(s);n._flagImage&&(/canvas/i.test(o)?We.Register.canvas(n,r):(n._src=s.getAttribute("two-src")||s.src,We.Register[o](n,r))),n._flagSrc&&(s||(s=We.getImage(n.src),n.image=s),o=We.getTag(s),We.Register[o](n,r))}clone(){const n=new We(this.src);return n.repeat=this.repeat,n.offset.copy(this.offset),n.scale=this.scale,n}copy(n){return this.src=n.src,this.repeat=n.repeat,this.offset=typeof n.offset=="number"||n.offset instanceof me?n.offset:new me().copy(n.offset),this.scale=typeof n.scale=="number"||n.scale instanceof me?n.scale:new me().copy(n.scale),this}toObject(){const n=super.toObject.call(this);return n.renderer.type="texture",n.src=this.src,n.repeat=this.repeat,n.offset=this.offset.toObject(),n.scale=typeof this.scale=="number"?this.scale:this.scale.toObject(),n}_update(){return(this._flagSrc||this._flagImage)&&(this.trigger(U.Types.change),(this._flagSrc||this._flagImage)&&(this.loaded=!1,We.load(this,(function(){this.loaded=!0,this.trigger(U.Types.change).trigger(U.Types.load)}).bind(this)))),this._image&&this._image.readyState>=4&&(this._flagVideo=!0),this}flagReset(){return this._flagSrc=this._flagImage=this._flagLoaded=this._flagRepeat=this._flagVideo=this._flagScale=this._flagOffset=!1,super.flagReset.call(this),this}dispose(){if(super.dispose(),"elem"in this._renderer){const n=this._renderer.elem;n.parentNode.removeChild(n)}return"effect"in this._renderer&&(this._renderer.effect=null),this}};x(We,"Properties",["src","loaded","repeat","scale","offset","image"]),x(We,"RegularExpressions",Sc),x(We,"ImageRegistry",new jm),x(We,"Register",{canvas:function(n,r){n._src="#"+n.id,We.ImageRegistry.add(n.src,n.image),typeof r=="function"&&r()},img:function(n,r){const s=n.image,o=function(l){s.removeEventListener&&typeof s.removeEventListener=="function"&&(s.removeEventListener("load",o,!1),s.removeEventListener("error",a,!1)),typeof r=="function"&&r()},a=function(l){throw typeof s.removeEventListener=="function"&&(s.removeEventListener("load",o,!1),s.removeEventListener("error",a,!1)),new Zr("unable to load "+n.src)};typeof s.width=="number"&&s.width>0&&typeof s.height=="number"&&s.height>0?o():typeof s.addEventListener=="function"&&(s.addEventListener("load",o,!1),s.addEventListener("error",a,!1)),n._src=We.getAbsoluteURL(n._src),!(s&&s.getAttribute("two-src"))&&(s.setAttribute("two-src",n.src),We.ImageRegistry.add(n.src,s),n.image.src=n.src)},video:function(n,r){const s=function(a){n.image.removeEventListener("canplaythrough",s,!1),n.image.removeEventListener("error",o,!1),n.image.width=n.image.videoWidth,n.image.height=n.image.videoHeight,typeof r=="function"&&r()},o=function(a){throw n.image.removeEventListener("canplaythrough",s,!1),n.image.removeEventListener("error",o,!1),new Zr("unable to load "+n.src)};n._src=We.getAbsoluteURL(n._src),n.image.getAttribute("two-src")||(n.image.setAttribute("two-src",n.src),We.ImageRegistry.add(n.src,n.image)),n.image.readyState>=4?s():(n.image.addEventListener("canplaythrough",s,!1),n.image.addEventListener("error",o,!1),n.image.src=n.src,n.image.load())}});let He=We;const Bc={src:{enumerable:!0,get:function(){return this._src},set:function(t){this._src=t,this._flagSrc=!0}},loaded:{enumerable:!0,get:function(){return this._loaded},set:function(t){this._loaded=t,this._flagLoaded=!0}},repeat:{enumerable:!0,get:function(){return this._repeat},set:function(t){this._repeat=t,this._flagRepeat=!0}},image:{enumerable:!0,get:function(){return this._image},set:function(t){const e=He.getTag(t);let n;switch(e){case"canvas":n="#"+t.id;break;default:n=t.src}He.ImageRegistry.contains(n)?this._image=He.ImageRegistry.get(t.src):this._image=t,this._flagImage=!0}},offset:{enumerable:!0,get:function(){return this._offset},set:function(t){this._offset&&this._offset.unbind(U.Types.change,this._renderer.flagOffset),this._offset=t,this._offset.bind(U.Types.change,this._renderer.flagOffset),this._flagOffset=!0}},scale:{enumerable:!0,get:function(){return this._scale},set:function(t){this._scale instanceof me&&this._scale.unbind(U.Types.change,this._renderer.flagScale),this._scale=t,this._scale instanceof me&&this._scale.bind(U.Types.change,this._renderer.flagScale),this._flagScale=!0}}};function qm(){this._flagOffset=!0}function Xm(){this._flagScale=!0}class ei extends Array{constructor(){super();Aa(this,at,new U);arguments[0]&&Array.isArray(arguments[0])?arguments[0].length>0&&this.push.apply(this,arguments[0]):arguments.length>0&&this.push.apply(this,arguments)}get _events(){return Tt(this,at)}set _events(n){Fu(this,at,n)}get _bound(){return Tt(this,at)._bound}set _bound(n){Tt(this,at)._bound=n}addEventListener(){return Tt(this,at).addEventListener.apply(this,arguments)}on(){return Tt(this,at).on.apply(this,arguments)}bind(){return Tt(this,at).bind.apply(this,arguments)}removeEventListener(){return Tt(this,at).removeEventListener.apply(this,arguments)}off(){return Tt(this,at).off.apply(this,arguments)}unbind(){return Tt(this,at).unbind.apply(this,arguments)}dispatchEvent(){return Tt(this,at).dispatchEvent.apply(this,arguments)}trigger(){return Tt(this,at).trigger.apply(this,arguments)}listen(){return Tt(this,at).listen.apply(this,arguments)}ignore(){return Tt(this,at).ignore.apply(this,arguments)}pop(){const n=super.pop.apply(this,arguments);return this.trigger(U.Types.remove,[n]),n}shift(){const n=super.shift.apply(this,arguments);return this.trigger(U.Types.remove,[n]),n}push(){const n=super.push.apply(this,arguments);return this.trigger(U.Types.insert,arguments),n}unshift(){const n=super.unshift.apply(this,arguments);return this.trigger(U.Types.insert,arguments),n}splice(){const n=super.splice.apply(this,arguments);if(this.trigger(U.Types.remove,n),arguments.length>2){const r=this.slice(arguments[0],arguments[0]+arguments.length-2);this.trigger(U.Types.insert,r),this.trigger(U.Types.order)}return n}sort(){return super.sort.apply(this,arguments),this.trigger(U.Types.order),this}reverse(){return super.reverse.apply(this,arguments),this.trigger(U.Types.order),this}indexOf(){return super.indexOf.apply(this,arguments)}map(n,r){const s=[];for(let o=0;o<this.length;o++){const a=this[o];let l;r?l=n.call(r,a,o):l=n(a,o),s.push(l)}return s}}at=new WeakMap;const Tc=Array.prototype.slice;function Ym(t){if(t==null)return!1;const e=t.length;return typeof e=="number"&&e>=0&&e<4294967296}const Re={isNaN:function(t){return typeof t=="number"&&t!==+t},isElement:function(t){return!!(t&&t.nodeType===1)},isObject:function(t){const e=typeof t;return e==="function"||e==="object"&&!!t},isFunction:function(t){return typeof t=="function"},extend:function(t){const e=Tc.call(arguments,1);for(let n=0;n<e.length;n++){const r=e[n];for(let s in r)t[s]=r[s]}return t},defaults:function(t){const e=Tc.call(arguments,1);for(let n=0;n<e.length;n++){const r=e[n];for(let s in r)t[s]===void 0&&(t[s]=r[s])}return t},each:function(t,e,n){const r=n||this,s=!Ym(t)&&Object.keys(t),o=(s||t).length;for(let a=0;a<o;a++){const l=s?s[a]:a;e.call(r,t[l],l,t)}return t},performance:ln.performance&&ln.performance.now?ln.performance:Date},Nt=class Nt extends sr{constructor(n,r,s){super();x(this,"_flagOffset",!0);x(this,"_flagOpacity",!0);x(this,"_flagColor",!0);x(this,"_offset",0);x(this,"_opacity",1);x(this,"_color","#fff");for(let o in Rc)Object.defineProperty(this,o,Rc[o]);this._renderer.type="stop",this.offset=typeof n=="number"?n:Nt.Index<=0?0:1,this.opacity=typeof s=="number"?s:1,this.color=typeof r=="string"?r:Nt.Index<=0?"#fff":"#000",Nt.Index=(Nt.Index+1)%2}static fromObject(n){const r=new Nt().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<Nt.Properties.length;r++){const s=Nt.Properties[r];s in n&&(this[s]=n[s])}return this}clone(n){const r=new Nt;return Re.each(Nt.Properties,function(s){r[s]=this[s]},this),n&&n.stops&&n.stops.push(r),r}toObject(){const n=super.toObject.call(this);return n.renderer.type="stop",Re.each(Nt.Properties,r=>{n[r]=this[r]},this),n}flagReset(){return this._flagOffset=this._flagColor=this._flagOpacity=!1,super.flagReset.call(this),this}};x(Nt,"Index",0),x(Nt,"Properties",["offset","opacity","color"]);let ti=Nt;const Rc={offset:{enumerable:!0,get:function(){return this._offset},set:function(t){this._offset=t,this._flagOffset=!0,this.parent&&(this.parent._flagStops=!0)}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(t){this._opacity=t,this._flagOpacity=!0,this.parent&&(this.parent._flagStops=!0)}},color:{enumerable:!0,get:function(){return this._color},set:function(t){this._color=t,this._flagColor=!0,this.parent&&(this.parent._flagStops=!0)}}},fn=class fn extends sr{constructor(n){super();x(this,"_flagStops",!1);x(this,"_flagSpread",!1);x(this,"_flagUnits",!1);x(this,"_spread","");x(this,"_units","");for(let r in $c)Object.defineProperty(this,r,$c[r]);this._renderer.type="gradient",this._renderer.flagStops=Um.bind(this),this._renderer.bindStops=Gm.bind(this),this._renderer.unbindStops=Km.bind(this),this.spread="pad",this.units="objectBoundingBox",n&&(this.stops=n)}static fromObject(n){let r=n.stops;r&&r.length>0&&(r=r.map(o=>o instanceof ti?o:new ti().copy(o)));const s=new fn(r).copy(n);return"id"in n&&(s.id=n.id),s}clone(n){const r=this.stops.map(o=>o.clone()),s=new fn(r);return Re.each(fn.Properties,o=>{s[o]=this[o]},this),n&&n.add(s),s}copy(n){super.copy.call(this,n);for(let r=0;r<fn.Properties.length;r++){const s=fn.Properties[r];s in n&&(this[s]=n[s])}return this}toObject(){const n={stops:this.stops.map(r=>r.toObject())};return Re.each(fn.Properties,r=>{n[r]=this[r]},this),n}_update(){return(this._flagSpread||this._flagStops)&&this.trigger(U.Types.change),this}flagReset(){return this._flagSpread=this._flagUnits=this._flagStops=!1,super.flagReset.call(this),this}dispose(){if("elem"in this._renderer){const n=this._renderer.elem;n.parentNode.removeChild(n)}return"effect"in this._renderer&&(this._renderer.effect=null),this}};x(fn,"Stop",ti),x(fn,"Properties",["spread","stops","units"]);let Qe=fn;const $c={spread:{enumerable:!0,get:function(){return this._spread},set:function(t){this._spread=t,this._flagSpread=!0}},units:{enumerable:!0,get:function(){return this._units},set:function(t){this._units=t,this._flagUnits=!0}},stops:{enumerable:!0,get:function(){return this._stops},set:function(t){const e=this._renderer.bindStops,n=this._renderer.unbindStops;this._stops&&this._stops.unbind(U.Types.insert,e).unbind(U.Types.remove,n),this._stops=new ei((t||[]).slice(0)),this._stops.bind(U.Types.insert,e).bind(U.Types.remove,n),e(this._stops)}}};function Um(){this._flagStops=!0}function Gm(t){let e=t.length;for(;e--;)t[e].bind(U.Types.change,this._renderer.flagStops),t[e].parent=this;this._renderer.flagStops()}function Km(t){let e=t.length;for(;e--;)t[e].unbind(U.Types.change,this._renderer.flagStops),delete t[e].parent;this._renderer.flagStops()}const jn=class jn extends Qe{constructor(n,r,s,o,a){super(a);x(this,"_flagEndPoints",!1);x(this,"_left",null);x(this,"_right",null);for(let l in Ec)Object.defineProperty(this,l,Ec[l]);this._renderer.type="linear-gradient",this._renderer.flagEndPoints=Zm.bind(this),this.left=new me,this.right=new me,typeof n=="number"&&(this.left.x=n),typeof r=="number"&&(this.left.y=r),typeof s=="number"&&(this.right.x=s),typeof o=="number"&&(this.right.y=o)}static fromObject(n){const r=new jn().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<jn.Properties.length;r++){const s=jn.Properties[r];s in n&&(this[s]=n[s]instanceof me?n[s]:new me().copy(n[s]))}return this}clone(n){const r=this.stops.map(function(o){return o.clone()}),s=new jn(this.left._x,this.left._y,this.right._x,this.right._y,r);return Re.each(Qe.Properties,function(o){s[o]=this[o]},this),n&&n.add(s),s}toObject(){const n=super.toObject.call(this);return n.left=this.left.toObject(),n.right=this.right.toObject(),n}_update(){return(this._flagEndPoints||this._flagSpread||this._flagStops)&&this.trigger(U.Types.change),this}flagReset(){return this._flagEndPoints=!1,super.flagReset.call(this),this}};x(jn,"Stop",ti),x(jn,"Properties",["left","right"]);let vt=jn;const Ec={left:{enumerable:!0,get:function(){return this._left},set:function(t){this._left instanceof me&&this._left.unbind(U.Types.change,this._renderer.flagEndPoints),this._left=t,this._left.bind(U.Types.change,this._renderer.flagEndPoints),this._flagEndPoints=!0}},right:{enumerable:!0,get:function(){return this._right},set:function(t){this._right instanceof me&&this._right.unbind(U.Types.change,this._renderer.flagEndPoints),this._right=t,this._right.bind(U.Types.change,this._renderer.flagEndPoints),this._flagEndPoints=!0}}};function Zm(){this._flagEndPoints=!0}const gn=class gn extends Qe{constructor(n,r,s,o,a,l){super(o);x(this,"_flagRadius",!1);x(this,"_flagCenter",!1);x(this,"_flagFocal",!1);x(this,"_radius",0);x(this,"_center",null);x(this,"_focal",null);for(let c in Nc)Object.defineProperty(this,c,Nc[c]);this._renderer.type="radial-gradient",this._renderer.flagCenter=Jm.bind(this),this._renderer.flagFocal=Qm.bind(this),this.center=new me,this.radius=typeof s=="number"?s:1,this.focal=new me,typeof n=="number"&&(this.center.x=n),typeof r=="number"&&(this.center.y=r),this.focal.copy(this.center),typeof a=="number"&&(this.focal.x=a),typeof l=="number"&&(this.focal.y=l)}static fromObject(n){const r=new gn().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<gn.Properties.length;r++){const s=gn.Properties[r];s in n&&(/(center|focal)i/.test(s)?this[s]=n[s]instanceof me?n[s]:new me().copy(n[s]):typeof n[s]=="number"&&(this[s]=n[MediaKeySystemAccess]))}return this}clone(n){const r=this.stops.map(function(o){return o.clone()}),s=new gn(this.center._x,this.center._y,this._radius,r,this.focal._x,this.focal._y);return Re.each(Qe.Properties.concat(gn.Properties),function(o){s[o]=this[o]},this),n&&n.add(s),s}toObject(){const n=super.toObject.call(this);return Re.each(gn.Properties,function(r){n[r]=this[r]},this),n.center=this.center.toObject(),n.focal=this.focal.toObject(),n}_update(){return(this._flagRadius||this._flatCenter||this._flagFocal||this._flagSpread||this._flagStops)&&this.trigger(U.Types.change),this}flagReset(){return this._flagRadius=this._flagCenter=this._flagFocal=!1,super.flagReset.call(this),this}};x(gn,"Stop",ti),x(gn,"Properties",["center","radius","focal"]);let kt=gn;const Nc={radius:{enumerable:!0,get:function(){return this._radius},set:function(t){this._radius=t,this._flagRadius=!0}},center:{enumerable:!0,get:function(){return this._center},set:function(t){this._center&&this._center.unbind(U.Types.change,this._renderer.flagCenter),this._center=t,this._center.bind(U.Types.change,this._renderer.flagCenter),this._flagCenter=!0}},focal:{enumerable:!0,get:function(){return this._focal},set:function(t){this._focal&&this._focal.unbind(U.Types.change,this._renderer.flagFocal),this._focal=t,this._focal.bind(U.Types.change,this._renderer.flagFocal),this._flagFocal=!0}}};function Jm(){this._flagCenter=!0}function Qm(){this._flagFocal=!0}function Pc(t,e){if(e===0||e===1)return!0;const r=t._length*e;let s=0;for(let o=0;o<t._lengths.length;o++){const a=t._lengths[o];if(s>=r)return r-s>=0;s+=a}return!1}function Qr(t,e){const n=t._length;if(e<=0)return 0;if(e>=n)return t._lengths.length-1;for(let r=0,s=0;r<t._lengths.length;r++){if(s+t._lengths[r]>=e)return e-=s,Math.max(r-1,0)+e/t._lengths[r];s+=t._lengths[r]}return-1}function Fc(t,e,n){let r,s,o,a,l,c,d,h;const u=e.controls&&e.controls.right,m=t.controls&&t.controls.left;return r=e.x,l=e.y,s=(u||e).x,c=(u||e).y,o=(m||t).x,d=(m||t).y,a=t.x,h=t.y,u&&e._relative&&(s+=e.x,c+=e.y),m&&t._relative&&(o+=t.x,d+=t.y),zm(r,l,s,c,o,d,a,h,n)}function Mc(t,e,n){let r,s,o,a,l,c,d,h;const u=e.controls&&e.controls.right,m=t.controls&&t.controls.left;return r=e.x,l=e.y,s=(u||e).x,c=(u||e).y,o=(m||t).x,d=(m||t).y,a=t.x,h=t.y,u&&e._relative&&(s+=e.x,c+=e.y),m&&t._relative&&(o+=t.x,d+=t.y),kc(r,l,s,c,o,d,a,h,n)}function ni(t){switch(t.renderer.type){case"texture":return He.fromObject(t);case"gradient":return Qe.fromObject(t);case"linear-gradient":return vt.fromObject(t);case"radial-gradient":return kt.fromObject(t)}return t}const ep=Math.cos,tp=Math.sin,Ac=Math.tan,mo=[],St=class St extends U{constructor(n,r,s,o,a,l){super();x(this,"elements",new wc(9));x(this,"manual",!1);let c=n;Array.isArray(c)||(c=Array.prototype.slice.call(arguments)),this.identity(),c.length>0&&this.set(c)}static Multiply(n,r,s){if(r.length<=3){const k=n;let R,$,F;const D=r[0]||0,L=r[1]||0,M=r[2]||0;return R=k[0]*D+k[1]*L+k[2]*M,$=k[3]*D+k[4]*L+k[5]*M,F=k[6]*D+k[7]*L+k[8]*M,[R,$,F]}const o=n[0],a=n[1],l=n[2],c=n[3],d=n[4],h=n[5],u=n[6],m=n[7],f=n[8],g=r[0],p=r[1],b=r[2],y=r[3],_=r[4],S=r[5],C=r[6],v=r[7],B=r[8];return s=s||new wc(9),s[0]=o*g+a*y+l*C,s[1]=o*p+a*_+l*v,s[2]=o*b+a*S+l*B,s[3]=c*g+d*y+h*C,s[4]=c*p+d*_+h*v,s[5]=c*b+d*S+h*B,s[6]=u*g+m*y+f*C,s[7]=u*p+m*_+f*v,s[8]=u*b+m*S+f*B,s}static fromObject(n){return new St().copy(n)}set(n,r,s,o,a,l,c,d,h){if(typeof r>"u"){const u=n;n=u[0],r=u[1],s=u[2],o=u[3],a=u[4],l=u[5],c=u[6],d=u[7],h=u[8]}return this.elements[0]=n,this.elements[1]=r,this.elements[2]=s,this.elements[3]=o,this.elements[4]=a,this.elements[5]=l,this.elements[6]=c,this.elements[7]=d,this.elements[8]=h,this.trigger(U.Types.change)}copy(n){return this.elements[0]=n.elements[0],this.elements[1]=n.elements[1],this.elements[2]=n.elements[2],this.elements[3]=n.elements[3],this.elements[4]=n.elements[4],this.elements[5]=n.elements[5],this.elements[6]=n.elements[6],this.elements[7]=n.elements[7],this.elements[8]=n.elements[8],this.manual=n.manual,this.trigger(U.Types.change)}identity(){return this.elements[0]=St.Identity[0],this.elements[1]=St.Identity[1],this.elements[2]=St.Identity[2],this.elements[3]=St.Identity[3],this.elements[4]=St.Identity[4],this.elements[5]=St.Identity[5],this.elements[6]=St.Identity[6],this.elements[7]=St.Identity[7],this.elements[8]=St.Identity[8],this.trigger(U.Types.change)}multiply(n,r,s,o,a,l,c,d,h){if(typeof r>"u")return this.elements[0]*=n,this.elements[1]*=n,this.elements[2]*=n,this.elements[3]*=n,this.elements[4]*=n,this.elements[5]*=n,this.elements[6]*=n,this.elements[7]*=n,this.elements[8]*=n,this.trigger(U.Types.change);if(typeof s>"u"&&(s=1),typeof o>"u"){n=n||0,r=r||0,s=s||0,a=this.elements;const O=a[0]*n+a[1]*r+a[2]*s,ne=a[3]*n+a[4]*r+a[5]*s,P=a[6]*n+a[7]*r+a[8]*s;return[O,ne,P]}const u=this.elements,m=[n,r,s,o,a,l,c,d,h],f=u[0],g=u[1],p=u[2],b=u[3],y=u[4],_=u[5],S=u[6],C=u[7],v=u[8],B=m[0],k=m[1],R=m[2],$=m[3],F=m[4],D=m[5],L=m[6],M=m[7],z=m[8];return this.elements[0]=f*B+g*$+p*L,this.elements[1]=f*k+g*F+p*M,this.elements[2]=f*R+g*D+p*z,this.elements[3]=b*B+y*$+_*L,this.elements[4]=b*k+y*F+_*M,this.elements[5]=b*R+y*D+_*z,this.elements[6]=S*B+C*$+v*L,this.elements[7]=S*k+C*F+v*M,this.elements[8]=S*R+C*D+v*z,this.trigger(U.Types.change)}inverse(n){const r=this.elements;n=n||new St;const s=r[0],o=r[1],a=r[2],l=r[3],c=r[4],d=r[5],h=r[6],u=r[7],m=r[8],f=m*c-d*u,g=-m*l+d*h,p=u*l-c*h;let b=s*f+o*g+a*p;return b?(b=1/b,n.elements[0]=f*b,n.elements[1]=(-m*o+a*u)*b,n.elements[2]=(d*o-a*c)*b,n.elements[3]=g*b,n.elements[4]=(m*s-a*h)*b,n.elements[5]=(-d*s+a*l)*b,n.elements[6]=p*b,n.elements[7]=(-u*s+o*h)*b,n.elements[8]=(c*s-o*l)*b,n):null}scale(n,r){return arguments.length<=1&&(r=n),this.multiply(n,0,0,0,r,0,0,0,1)}rotate(n){const r=ep(n),s=tp(n);return this.multiply(r,-s,0,s,r,0,0,0,1)}translate(n,r){return this.multiply(1,0,n,0,1,r,0,0,1)}skewX(n){const r=Ac(n);return this.multiply(1,r,0,0,1,0,0,0,1)}skewY(n){const r=Ac(n);return this.multiply(1,0,0,r,1,0,0,0,1)}toString(n){return mo.length=0,this.toTransformArray(n,mo),mo.map(cn).join(" ")}toTransformArray(n,r){const s=this.elements,o=!!r,a=s[0],l=s[1],c=s[2],d=s[3],h=s[4],u=s[5];if(n){const m=s[6],f=s[7],g=s[8];if(o){r[0]=a,r[1]=d,r[2]=m,r[3]=l,r[4]=h,r[5]=f,r[6]=c,r[7]=u,r[8]=g;return}return[a,d,m,l,h,f,c,u,g]}if(o){r[0]=a,r[1]=d,r[2]=l,r[3]=h,r[4]=c,r[5]=u;return}return[a,d,l,h,c,u]}toArray(n,r){const s=this.elements,o=!!r,a=s[0],l=s[1],c=s[2],d=s[3],h=s[4],u=s[5];if(n){const m=s[6],f=s[7],g=s[8];if(o){r[0]=a,r[1]=l,r[2]=c,r[3]=d,r[4]=h,r[5]=u,r[6]=m,r[7]=f,r[8]=g;return}return[a,l,c,d,h,u,m,f,g]}if(o){r[0]=a,r[1]=l,r[2]=c,r[3]=d,r[4]=h,r[5]=u;return}return[a,l,c,d,h,u]}toObject(){return{renderer:{type:"matrix"},elements:this.toArray(!0),manual:!!this.manual}}clone(){return new St().copy(this)}};x(St,"Identity",[1,0,0,0,1,0,0,0,1]);let or=St;Am(or);const kr=class kr extends sr{constructor(){super();x(this,"_flagMatrix",!0);x(this,"_flagScale",!1);x(this,"_matrix",null);x(this,"_worldMatrix",null);x(this,"_position",null);x(this,"_rotation",0);x(this,"_scale",1);x(this,"_skewX",0);x(this,"_skewY",0);for(let n in es)Object.defineProperty(this,n,es[n]);this._renderer.flagMatrix=Oc.bind(this),this.isShape=!0,this.matrix=new or,this.worldMatrix=new or,this.position=new me,this.rotation=0,this.scale=1,this.skewX=0,this.skewY=0}static fromObject(n){const r=new kr().copy(n);return"id"in n&&(r.id=n.id),r}get renderer(){return this._renderer}set renderer(n){this._renderer=n}get translation(){return es.position.get.apply(this,arguments)}set translation(n){es.position.set.apply(this,arguments)}addTo(n){return n.add(this),this}remove(){return this.parent?(this.parent.remove(this),this):this}copy(n){return super.copy.call(this,n),"position"in n&&(n.position instanceof me?this.position=n.position:this.position.copy(n.position)),"rotation"in n&&(this.rotation=n.rotation),"scale"in n&&(this.scale=typeof n.scale=="number"||n.scale instanceof me?n.scale:new me(n.scale.x,n.scale.y)),"skewX"in n&&(this.skewX=n.skewX),"skewY"in n&&(this.skewY=n.skewY),"matrix"in n&&n.matrix.manual&&(this.matrix.copy(n.matrix),this.matrix.manual=!0),this}clone(n){const r=new kr;return r.position.copy(this.position),r.rotation=this.rotation,r.scale=this.scale,r.skewX=this.skewX,r.skewY=this.skewY,this.matrix.manual&&r.matrix.copy(this.matrix),n&&n.add(r),r._update()}toObject(){const n=super.toObject.call(this);return n.renderer={type:"shape"},n.isShape=!0,n.translation=this.translation.toObject(),n.rotation=this.translation.rotation,n.scale=this.scale instanceof me?this.scale.toObject():this.scale,n.skewX=this.skewX,n.skewY=this.skewY,n.matrix=this.matrix.toObject(),n}_update(n){return!this._matrix.manual&&this._flagMatrix&&(this._matrix.identity().translate(this.position.x,this.position.y),this._matrix.rotate(this.rotation),this._scale instanceof me?this._matrix.scale(this._scale.x,this._scale.y):this._matrix.scale(this._scale),this._matrix.skewX(this.skewX),this._matrix.skewY(this.skewY)),n&&this.parent&&this.parent._update&&this.parent._update(),this}flagReset(){return this._flagMatrix=this._flagScale=!1,super.flagReset.call(this),this}};x(kr,"Properties",["position","rotation","scale","skewX","skewY","matrix","worldMatrix"]);let _n=kr;const es={position:{enumerable:!0,get:function(){return this._position},set:function(t){this._position&&this._position.unbind(U.Types.change,this._renderer.flagMatrix),this._position=t,this._position.bind(U.Types.change,this._renderer.flagMatrix),Oc.call(this)}},rotation:{enumerable:!0,get:function(){return this._rotation},set:function(t){this._rotation=t,this._flagMatrix=!0}},scale:{enumerable:!0,get:function(){return this._scale},set:function(t){this._scale instanceof me&&this._scale.unbind(U.Types.change,this._renderer.flagMatrix),this._scale=t,this._scale instanceof me&&this._scale.bind(U.Types.change,this._renderer.flagMatrix),this._flagMatrix=!0,this._flagScale=!0}},skewX:{enumerable:!0,get:function(){return this._skewX},set:function(t){this._skewX=t,this._flagMatrix=!0}},skewY:{enumerable:!0,get:function(){return this._skewY},set:function(t){this._skewY=t,this._flagMatrix=!0}},matrix:{enumerable:!0,get:function(){return this._matrix},set:function(t){this._matrix=t,this._flagMatrix=!0}},worldMatrix:{enumerable:!0,get:function(){return Om(this,this._worldMatrix),this._worldMatrix},set:function(t){this._worldMatrix=t}}};function Oc(){this._flagMatrix=!0}const Oi=Math.min,Vi=Math.max,np=Math.ceil,ip=Math.floor,rp=new me,Kt=class Kt extends _n{constructor(n,r,s,o){super();x(this,"_flagVertices",!0);x(this,"_flagLength",!0);x(this,"_flagFill",!0);x(this,"_flagStroke",!0);x(this,"_flagLinewidth",!0);x(this,"_flagOpacity",!0);x(this,"_flagVisible",!0);x(this,"_flagCap",!0);x(this,"_flagJoin",!0);x(this,"_flagMiter",!0);x(this,"_flagStrokeAttenuation",!0);x(this,"_flagMask",!1);x(this,"_flagClip",!1);x(this,"_length",0);x(this,"_fill","#fff");x(this,"_stroke","#000");x(this,"_linewidth",1);x(this,"_opacity",1);x(this,"_visible",!0);x(this,"_cap","round");x(this,"_join","round");x(this,"_miter",4);x(this,"_closed",!0);x(this,"_curved",!1);x(this,"_automatic",!0);x(this,"_beginning",0);x(this,"_ending",1);x(this,"_mask",null);x(this,"_clip",!1);x(this,"_dashes",null);x(this,"_strokeAttenuation",!0);for(let a in Vc)Object.defineProperty(this,a,Vc[a]);this._renderer.type="path",this._renderer.flagVertices=Ic.bind(this),this._renderer.bindVertices=zc.bind(this),this._renderer.unbindVertices=Lc.bind(this),this._renderer.flagFill=Dc.bind(this),this._renderer.flagStroke=Hc.bind(this),this._renderer.vertices=[],this._renderer.collection=[],this.closed=!!r,this.curved=!!s,this.beginning=0,this.ending=1,this.fill="#fff",this.stroke="#000",this.linewidth=1,this.opacity=1,this.className="",this.visible=!0,this.cap="butt",this.join="miter",this.miter=4,this.vertices=n,this.automatic=!o,this.dashes=[],this.dashes.offset=0}static fromObject(n){const r=typeof n.fill=="string"?n.fill:ni(n.fill),s=typeof n.stroke=="string"?n.stroke:ni(n.stroke),o=new Kt().copy({...n,fill:r,stroke:s});return"id"in n&&(o.id=n.id),o}copy(n){if(super.copy.call(this,n),n.vertices){this.vertices=[];for(let r=0;r<n.vertices.length;r++){const s=n.vertices[r];s instanceof Te?this.vertices.push(n.vertices[r].clone()):this.vertices.push(new Te().copy(s))}}for(let r=0;r<Kt.Properties.length;r++){const s=Kt.Properties[r];s in n&&(this[s]=n[s])}return this}clone(n){const r=new Kt;for(let s=0;s<this.vertices.length;s++)r.vertices.push(this.vertices[s].clone());for(let s=0;s<Kt.Properties.length;s++){const o=Kt.Properties[s];r[o]=this[o]}return r.className=this.className,r.translation.copy(this.translation),r.rotation=this.rotation,r.scale=this.scale,r.skewX=this.skewX,r.skewY=this.skewY,this.matrix.manual&&r.matrix.copy(this.matrix),n&&n.add(r),r._update()}toObject(){const n=super.toObject.call(this);return n.renderer.type="path",n.vertices=this.vertices.map(r=>r.toObject()),Re.each(Kt.Properties,r=>{typeof this[r]<"u"&&(this[r].toObject?n[r]=this[r].toObject():n[r]=this[r])},this),n}dispose(){if(super.dispose(),this.vertices&&typeof this.vertices.unbind=="function")try{this.vertices.unbind()}catch{}if(this.vertices)for(let n=0;n<this.vertices.length;n++){const r=this.vertices[n];typeof r.unbind=="function"&&r.unbind(),r.controls&&(r.controls.left&&typeof r.controls.left.unbind=="function"&&r.controls.left.unbind(),r.controls.right&&typeof r.controls.right.unbind=="function"&&r.controls.right.unbind())}return typeof this.fill=="object"&&this.fill&&"dispose"in this.fill?this.fill.dispose():typeof this.fill=="object"&&this.fill&&"unbind"in this.fill&&this.fill.unbind(),typeof this.stroke=="object"&&this.stroke&&"dispose"in this.stroke?this.stroke.dispose():typeof this.stroke=="object"&&this.stroke&&"unbind"in this.stroke&&this.stroke.unbind(),this}noFill(){return this.fill="none",this}noStroke(){return this.stroke="none",this.linewidth=0,this}corner(){const n=this.getBoundingClientRect(!0),r=n.width/2,s=n.height/2,o=n.left+n.width/2,a=n.top+n.height/2;for(let l=0;l<this.vertices.length;l++){const c=this.vertices[l];c.x-=o,c.y-=a,c.x+=r,c.y+=s}return this.mask&&(this.mask.translation.x-=o,this.mask.translation.x+=r,this.mask.translation.y-=a,this.mask.translation.y+=s),this}center(){const n=this.getBoundingClientRect(!0),r=n.left+n.width/2-this.translation.x,s=n.top+n.height/2-this.translation.y;for(let o=0;o<this.vertices.length;o++){const a=this.vertices[o];a.x-=r,a.y-=s}return this.mask&&(this.mask.translation.x-=r,this.mask.translation.y-=s),this}getBoundingClientRect(n){let r,s,o,a,l,c,d=1/0,h=-1/0,u=1/0,m=-1/0;if(this._update(!0),r=n?this.matrix:this.worldMatrix,s=(this.linewidth||0)/2,o=this._renderer.vertices.length,this.linewidth>0||this.stroke&&!/(transparent|none)/i.test(this.stroke))if(this.matrix.manual){const{scaleX:f,scaleY:g}=Mm(r.elements[0],r.elements[3],r.elements[1],r.elements[4],r.elements[2],r.elements[5]);typeof f=="number"&&typeof g=="number"&&(s=Math.max(f,g)*(this.linewidth||0)/2)}else s*=typeof this.scale=="number"?this.scale:Math.max(this.scale.x,this.scale.y);if(o<=0)return{width:0,height:0};for(a=0;a<o;a++){c=this._renderer.vertices[a],l=this._renderer.vertices[(a+o-1)%o];const[f,g]=r.multiply(l.x,l.y),[p,b]=r.multiply(c.x,c.y);if(l.controls&&c.controls){let y=l.controls.right.x,_=l.controls.right.y;l.relative&&(y+=l.x,_+=l.y);let[S,C]=r.multiply(y,_),v=c.controls.left.x,B=c.controls.left.y;c.relative&&(v+=c.x,B+=c.y);let[k,R]=r.multiply(v,B);const $=Lm(f,g,S,C,k,R,p,b);u=Oi($.min.y-s,u),d=Oi($.min.x-s,d),h=Vi($.max.x+s,h),m=Vi($.max.y+s,m)}else a<=1&&(u=Oi(g-s,u),d=Oi(f-s,d),h=Vi(f+s,h),m=Vi(g+s,m)),u=Oi(b-s,u),d=Oi(p-s,d),h=Vi(p+s,h),m=Vi(b+s,m)}return{top:u,left:d,right:h,bottom:m,width:h-d,height:m-u}}getPointAt(n,r){let s,o,a,l,c,d,h,u,m,f,g,p,b,y,_,S=this.length*Math.min(Math.max(n,0),1);const C=this.vertices.length,v=C-1;let B=null,k=null;for(let E=0,X=this._lengths.length,j=0;E<X;E++){if(j+this._lengths[E]>=S){this._closed?(s=Ai(E,C),o=Ai(E-1,C),E===0&&(s=o,o=E)):(s=E,o=Math.min(Math.max(E-1,0),v)),B=this.vertices[s],k=this.vertices[o],S-=j,this._lengths[E]!==0?n=S/this._lengths[E]:n=0;break}j+=this._lengths[E]}if(B===null||k===null)return null;if(B){if(!k)return B}else return k;_=k.controls&&k.controls.right,y=B.controls&&B.controls.left,c=k.x,f=k.y,d=(_||k).x,g=(_||k).y,h=(y||B).x,p=(y||B).y,u=B.x,b=B.y,_&&k.relative&&(d+=k.x,g+=k.y),y&&B.relative&&(h+=B.x,p+=B.y),l=Kr(n,c,d,h,u),m=Kr(n,f,g,p,b);const R=Wt(c,d,n),$=Wt(f,g,n),F=Wt(d,h,n),D=Wt(g,p,n),L=Wt(h,u,n),M=Wt(p,b,n),z=Wt(R,F,n),O=Wt($,D,n),ne=Wt(F,L,n),P=Wt(D,M,n);return Re.isObject(r)?(r.x=l,r.y=m,r instanceof Te&&(r.controls.left.x=z,r.controls.left.y=O,r.controls.right.x=ne,r.controls.right.y=P,(typeof r.relative!="boolean"||r.relative)&&(r.controls.left.x-=l,r.controls.left.y-=m,r.controls.right.x-=l,r.controls.right.y-=m)),r.t=n,r):(a=new Te(l,m,z-l,O-m,ne-l,P-m,this._curved?fe.curve:fe.line),a.t=n,a)}plot(){if(this.curved)return Hm(this._collection,this.closed),this;for(let n=0;n<this._collection.length;n++)this._collection[n].command=n===0?fe.move:fe.line;return this}subdivide(n){this._update();const r=this.vertices.length-1,s=this._closed||this.vertices[r]._command===fe.close;let o=this.vertices[r],a=[],l;return Re.each(this.vertices,function(c,d){if(d<=0&&!s){o=c;return}if(c.command===fe.move){a.push(new Te(o.x,o.y)),d>0&&(a[a.length-1].command=fe.line),o=c;return}l=Mc(c,o,n),a=a.concat(l),Re.each(l,function(h,u){u<=0&&o.command===fe.move?h.command=fe.move:h.command=fe.line}),d>=r&&(this._closed&&this._automatic&&(o=c,l=Mc(c,o,n),a=a.concat(l),Re.each(l,function(h,u){u<=0&&o.command===fe.move?h.command=fe.move:h.command=fe.line})),a.push(new Te(c.x,c.y)),a[a.length-1].command=s?fe.close:fe.line),o=c},this),this._automatic=!1,this._curved=!1,this.vertices=a,this}_updateLength(n,r){r||this._update();const o=this.vertices.length-1;let a=this.vertices[o],l=0;return typeof this._lengths>"u"&&(this._lengths=[]),Re.each(this.vertices,function(c,d){if(d<=0||c.command===fe.move){a=c,this._lengths[d]=0;return}this._lengths[d]=Fc(c,a,n),l+=this._lengths[d],a=c},this),this._length=l,this._flagLength=!1,this}_update(){if(this._flagVertices){this._automatic&&this.plot(),this._flagLength&&this._updateLength(void 0,!0);const n=this._collection.length,r=this._closed,s=Math.min(this._beginning,this._ending),o=Math.max(this._beginning,this._ending),a=Qr(this,s*this._length),l=Qr(this,o*this._length),c=np(a),d=ip(l);let h,u,m,f,g,p;for(this._renderer.vertices.length=0,p=0;p<n;p++)this._renderer.collection.length<=p&&this._renderer.collection.push(new Te),p>d&&!u?(g=this._renderer.collection[p].copy(this._collection[p]),this.getPointAt(o,g),g.command=this._renderer.collection[p].command,this._renderer.vertices.push(g),u=g,m=this._collection[p-1],m&&m.controls&&(g.relative?g.controls.right.clear():g.controls.right.copy(g),m.relative?this._renderer.collection[p-1].controls.right.copy(m.controls.right).lerp(me.zero,1-g.t):this._renderer.collection[p-1].controls.right.copy(m.controls.right).lerp(m,1-g.t))):p>=c&&p<=d&&(g=this._renderer.collection[p].copy(this._collection[p]),this._renderer.vertices.push(g),p===d&&Pc(this,o)?(u=g,!r&&u.controls&&(u.relative?u.controls.right.clear():u.controls.right.copy(u))):p===c&&Pc(this,s)&&(h=g,h.command=fe.move,!r&&h.controls&&(h.relative?h.controls.left.clear():h.controls.left.copy(h))));c>0&&!h&&(p=c-1,g=this._renderer.collection[p].copy(this._collection[p]),this.getPointAt(s,g),g.command=fe.move,this._renderer.vertices.unshift(g),f=this._collection[p+1],f&&f.controls&&(g.controls.left.clear(),f.relative?this._renderer.collection[p+1].controls.left.copy(f.controls.left).lerp(me.zero,g.t):(rp.copy(f),this._renderer.collection[p+1].controls.left.copy(f.controls.left).lerp(f,g.t))))}return _n.prototype._update.apply(this,arguments),this}flagReset(){return this._flagVertices=this._flagLength=this._flagFill=this._flagStroke=this._flagLinewidth=this._flagOpacity=this._flagVisible=this._flagCap=this._flagJoin=this._flagMiter=this._flagClip=this._flagStrokeAttenuation=!1,_n.prototype.flagReset.call(this),this}};x(Kt,"Properties",["fill","stroke","linewidth","opacity","visible","cap","join","miter","closed","curved","automatic","beginning","ending","dashes","strokeAttenuation"]),x(Kt,"Utils",{getCurveLength:Fc});let $e=Kt;const Vc={linewidth:{enumerable:!0,get:function(){return this._linewidth},set:function(t){this._linewidth=t,this._flagLinewidth=!0}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(t){this._opacity=t,this._flagOpacity=!0}},visible:{enumerable:!0,get:function(){return this._visible},set:function(t){this._visible=t,this._flagVisible=!0}},cap:{enumerable:!0,get:function(){return this._cap},set:function(t){this._cap=t,this._flagCap=!0}},join:{enumerable:!0,get:function(){return this._join},set:function(t){this._join=t,this._flagJoin=!0}},miter:{enumerable:!0,get:function(){return this._miter},set:function(t){this._miter=t,this._flagMiter=!0}},fill:{enumerable:!0,get:function(){return this._fill},set:function(t){(this._fill instanceof Qe||this._fill instanceof vt||this._fill instanceof kt||this._fill instanceof He)&&this._fill.unbind(U.Types.change,this._renderer.flagFill),this._fill=t,this._flagFill=!0,(this._fill instanceof Qe||this._fill instanceof vt||this._fill instanceof kt||this._fill instanceof He)&&this._fill.bind(U.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(t){(this._stroke instanceof Qe||this._stroke instanceof vt||this._stroke instanceof kt||this._stroke instanceof He)&&this._stroke.unbind(U.Types.change,this._renderer.flagStroke),this._stroke=t,this._flagStroke=!0,(this._stroke instanceof Qe||this._stroke instanceof vt||this._stroke instanceof kt||this._stroke instanceof He)&&this._stroke.bind(U.Types.change,this._renderer.flagStroke)}},length:{get:function(){return this._flagLength&&this._updateLength(),this._length}},closed:{enumerable:!0,get:function(){return this._closed},set:function(t){this._closed=!!t,this._flagVertices=!0}},curved:{enumerable:!0,get:function(){return this._curved},set:function(t){this._curved=!!t,this._flagVertices=!0}},automatic:{enumerable:!0,get:function(){return this._automatic},set:function(t){if(t===this._automatic)return;this._automatic=!!t;const e=this._automatic?"ignore":"listen";Re.each(this.vertices,function(n){n[e]()})}},beginning:{enumerable:!0,get:function(){return this._beginning},set:function(t){this._beginning=t,this._flagVertices=!0}},ending:{enumerable:!0,get:function(){return this._ending},set:function(t){this._ending=t,this._flagVertices=!0}},vertices:{enumerable:!0,get:function(){return this._collection},set:function(t){const e=this._renderer.bindVertices,n=this._renderer.unbindVertices;this._collection&&this._collection.unbind(U.Types.insert,e).unbind(U.Types.remove,n),t instanceof ei?this._collection=t:this._collection=new ei(t||[]),this._collection.bind(U.Types.insert,e).bind(U.Types.remove,n),e(this._collection)}},mask:{enumerable:!0,get:function(){return this._mask},set:function(t){this._mask=t,this._flagMask=!0,Re.isObject(t)&&!t.clip&&(t.clip=!0)}},clip:{enumerable:!0,get:function(){return this._clip},set:function(t){this._clip=t,this._flagClip=!0}},dashes:{enumerable:!0,get:function(){return this._dashes},set:function(t){typeof t.offset!="number"&&(t.offset=this.dashes&&this._dashes.offset||0),this._dashes=t}},strokeAttenuation:{enumerable:!0,get:function(){return this._strokeAttenuation},set:function(t){this._strokeAttenuation=!!t,this._flagStrokeAttenuation=!0,this._flagLinewidth=!0}}};function Ic(){this._flagVertices=!0,this._flagLength=!0,this.parent&&(this.parent._flagLength=!0)}function zc(t){let e=t.length;for(;e--;)t[e].bind(U.Types.change,this._renderer.flagVertices);this._renderer.flagVertices()}function Lc(t){let e=t.length;for(;e--;)t[e].unbind(U.Types.change,this._renderer.flagVertices);this._renderer.flagVertices()}function Dc(){this._flagFill=!0}function Hc(){this._flagStroke=!0}const sp=Math.ceil,op=Math.floor,mn=class mn extends _n{constructor(n){super();x(this,"_flagVertices",!0);x(this,"_flagLength",!0);x(this,"_flagFill",!0);x(this,"_flagStroke",!0);x(this,"_flagLinewidth",!0);x(this,"_flagOpacity",!0);x(this,"_flagVisible",!0);x(this,"_flagSize",!0);x(this,"_flagSizeAttenuation",!0);x(this,"_flagStrokeAttenuation",!0);x(this,"_length",0);x(this,"_fill","#fff");x(this,"_stroke","#000");x(this,"_linewidth",1);x(this,"_opacity",1);x(this,"_visible",!0);x(this,"_size",1);x(this,"_sizeAttenuation",!1);x(this,"_beginning",0);x(this,"_ending",1);x(this,"_dashes",null);x(this,"_strokeAttenuation",!0);x(this,"noFill",$e.prototype.noFill);x(this,"noStroke",$e.prototype.noStroke);x(this,"corner",$e.prototype.corner);x(this,"center",$e.prototype.center);x(this,"getBoundingClientRect",$e.prototype.getBoundingClientRect);x(this,"_updateLength",$e.prototype._updateLength);for(let r in Wc)Object.defineProperty(this,r,Wc[r]);this._renderer.type="points",this._renderer.flagVertices=Ic.bind(this),this._renderer.bindVertices=zc.bind(this),this._renderer.unbindVertices=Lc.bind(this),this._renderer.flagFill=Dc.bind(this),this._renderer.flagStroke=Hc.bind(this),this._renderer.vertices=null,this._renderer.collection=null,this.size=1,this.sizeAttenuation=!1,this.beginning=0,this.ending=1,this.fill="#fff",this.stroke="#000",this.linewidth=1,this.opacity=1,this.className="",this.visible=!0,this.vertices=n,this.dashes=[],this.dashes.offset=0}static fromObject(n){const r=typeof n.fill=="string"?n.fill:ni(n.fill),s=typeof n.stroke=="string"?n.stroke:ni(n.stroke),o=new mn().copy({...n,fill:r,stroke:s});return"id"in n&&(o.id=n.id),o}copy(n){super.copy.call(this,n);for(let r=0;r<n.vertices.length;r++){const s=n.vertices[r];s instanceof Te?this.vertices.push(n.vertices[r].clone()):this.vertices.push(new Te().copy(s))}for(let r=0;r<mn.Properties.length;r++){const s=mn.Properties[r];s in n&&(this[s]=n[s])}return this}clone(n){const r=new mn;for(let s=0;s<this.vertices.length;s++)r.vertices.push(this.vertices[s].clone());for(let s=0;s<mn.Properties.length;s++){const o=mn.Properties[s];r[o]=this[o]}return r.className=this.className,r.translation.copy(this.translation),r.rotation=this.rotation,r.scale=this.scale,r.skewX=this.skewX,r.skewY=this.skewY,this.matrix.manual&&r.matrix.copy(this.matrix),n&&n.add(r),r._update()}toObject(){const n=super.toObject.call(this);return n.renderer.type="points",n.vertices=this.vertices.map(r=>r.toObject()),Re.each(mn.Properties,function(r){typeof this[r]<"u"&&(this[r].toObject?n[r]=this[r].toObject():n[r]=this[r])},this),n}dispose(){if(super.dispose(),this.vertices&&typeof this.vertices.unbind=="function")try{this.vertices.unbind()}catch{}if(this.vertices)for(let n=0;n<this.vertices.length;n++){const r=this.vertices[n];typeof r.unbind=="function"&&r.unbind()}return typeof this.fill=="object"&&this.fill&&"dispose"in this.fill?this.fill.dispose():typeof this.fill=="object"&&this.fill&&"unbind"in this.fill&&this.fill.unbind(),typeof this.stroke=="object"&&this.stroke&&"dispose"in this.stroke?this.stroke.dispose():typeof this.stroke=="object"&&this.stroke&&"unbind"in this.stroke&&this.stroke.unbind(),this}subdivide(n){this._update();let r=[];for(let s=0;s<this.vertices.length;s++){const o=this.vertices[s],a=this.vertices[s-1];if(!a)continue;const l=o.x,c=o.y,d=a.x,h=a.y,u=kc(l,c,l,c,d,h,d,h,n);r=r.concat(u)}return this.vertices=r,this}_update(){if(this._flagVertices){this._flagLength&&this._updateLength(void 0,!0);const n=Math.min(this._beginning,this._ending),r=Math.max(this._beginning,this._ending),s=Qr(this,n*this._length),o=Qr(this,r*this._length),a=sp(s),l=op(o);let c=0,d;this._renderer.vertices=[],this._renderer.collection=[];for(let h=0;h<this._collection.length;h++)h>=a&&h<=l&&(d=this._collection[h],this._renderer.collection.push(d),this._renderer.vertices[c*2+0]=d.x,this._renderer.vertices[c*2+1]=d.y,c++)}return super._update.apply(this,arguments),this}flagReset(){return this._flagVertices=this._flagLength=this._flagFill=this._flagStroke=this._flagLinewidth=this._flagOpacity=this._flagVisible=this._flagSize=this._flagSizeAttenuation=!1,super.flagReset.call(this),this}};x(mn,"Properties",["fill","stroke","linewidth","opacity","visible","size","sizeAttenuation","beginning","ending","dashes","strokeAttenuation"]);let ts=mn;const Wc={linewidth:{enumerable:!0,get:function(){return this._linewidth},set:function(t){this._linewidth=t,this._flagLinewidth=!0}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(t){this._opacity=t,this._flagOpacity=!0}},visible:{enumerable:!0,get:function(){return this._visible},set:function(t){this._visible=t,this._flagVisible=!0}},size:{enumerable:!0,get:function(){return this._size},set:function(t){this._size=t,this._flagSize=!0}},sizeAttenuation:{enumerable:!0,get:function(){return this._sizeAttenuation},set:function(t){this._sizeAttenuation=t,this._flagSizeAttenuation=!0}},fill:{enumerable:!0,get:function(){return this._fill},set:function(t){(this._fill instanceof Qe||this._fill instanceof vt||this._fill instanceof kt||this._fill instanceof He)&&this._fill.unbind(U.Types.change,this._renderer.flagFill),this._fill=t,this._flagFill=!0,(this._fill instanceof Qe||this._fill instanceof vt||this._fill instanceof kt||this._fill instanceof He)&&this._fill.bind(U.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(t){(this._stroke instanceof Qe||this._stroke instanceof vt||this._stroke instanceof kt||this._stroke instanceof He)&&this._stroke.unbind(U.Types.change,this._renderer.flagStroke),this._stroke=t,this._flagStroke=!0,(this._stroke instanceof Qe||this._stroke instanceof vt||this._stroke instanceof kt||this._stroke instanceof He)&&this._stroke.bind(U.Types.change,this._renderer.flagStroke)}},length:{get:function(){return this._flagLength&&this._updateLength(),this._length}},beginning:{enumerable:!0,get:function(){return this._beginning},set:function(t){this._beginning=t,this._flagVertices=!0}},ending:{enumerable:!0,get:function(){return this._ending},set:function(t){this._ending=t,this._flagVertices=!0}},vertices:{enumerable:!0,get:function(){return this._collection},set:function(t){const e=this._renderer.bindVertices,n=this._renderer.unbindVertices;this._collection&&this._collection.unbind(U.Types.insert,e).unbind(U.Types.remove,n),t instanceof ei?this._collection=t:this._collection=new ei(t||[]),this._collection.bind(U.Types.insert,e).bind(U.Types.remove,n),e(this._collection)}},dashes:{enumerable:!0,get:function(){return this._dashes},set:function(t){typeof t.offset!="number"&&(t.offset=this.dashes&&this._dashes.offset||0),this._dashes=t}},strokeAttenuation:{enumerable:!0,get:function(){return this._strokeAttenuation},set:function(t){this._strokeAttenuation=!!t,this._flagStrokeAttenuation=!0,this._flagLinewidth=!0}}};class jc extends ei{constructor(n){n=Array.isArray(n)?n:Array.prototype.slice.call(arguments);super(n);Aa(this,Rs,{});this.attach(n),this.on(U.Types.insert,this.attach),this.on(U.Types.remove,this.detach)}get ids(){return Tt(this,Rs)}attach(n){for(let r=0;r<n.length;r++){const s=n[r];s&&s.id&&(this.ids[s.id]=s)}return this}detach(n){for(let r=0;r<n.length;r++)delete this.ids[n[r].id];return this}}Rs=new WeakMap;const Cn=class Cn extends $e{constructor(n,r,s,o,a,l,c){const d=c||go.Resolution*3,h=[];for(let u=0;u<d;u++)h.push(new Te);super(h,!0,!1,!0);x(this,"_flagStartAngle",!1);x(this,"_flagEndAngle",!1);x(this,"_flagInnerRadius",!1);x(this,"_flagOuterRadius",!1);x(this,"_startAngle",0);x(this,"_endAngle",Qn);x(this,"_innerRadius",0);x(this,"_outerRadius",0);this._renderer.type="arc-segment";for(let u in qc)Object.defineProperty(this,u,qc[u]);typeof s=="number"&&(this.innerRadius=s),typeof o=="number"&&(this.outerRadius=o),typeof a=="number"&&(this.startAngle=a),typeof l=="number"&&(this.endAngle=l),this._update(),typeof n=="number"&&(this.translation.x=n),typeof r=="number"&&(this.translation.y=r)}static fromObject(n){const r=new Cn().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<Cn.Properties.length;r++){const s=Cn.Properties[r];s in n&&typeof n[s]=="number"&&(this[s]=n[s])}return this}_update(){if(this._flagVertices||this._flagStartAngle||this._flagEndAngle||this._flagInnerRadius||this._flagOuterRadius){const n=this._startAngle,r=this._endAngle,s=this._innerRadius,o=this._outerRadius,a=Ai(n,Qn)===Ai(r,Qn),l=s>0,c=this.vertices;let d=l?c.length/2:c.length,h,u=0,m,f,g,p,b,y,_,S,C;for(a?d--:l||(d-=2),m=0,f=d-1;m<d;m++){switch(g=m/f,p=c[u],b=g*(r-n)+n,y=(r-n)/d,_=o*Math.cos(b),S=o*Math.sin(b),m){case 0:h=fe.move;break;default:h=fe.curve}p.command=h,p.x=_,p.y=S,p.controls.left.clear(),p.controls.right.clear(),p.command===fe.curve&&(C=o*y/Math.PI,p.controls.left.x=C*Math.cos(b-it),p.controls.left.y=C*Math.sin(b-it),p.controls.right.x=C*Math.cos(b+it),p.controls.right.y=C*Math.sin(b+it),m===1&&p.controls.left.multiplyScalar(2),m===f&&p.controls.right.multiplyScalar(2)),u++}if(l){for(a?(c[u].command=fe.close,u++):(d--,f=d-1),m=0;m<d;m++)g=m/f,p=c[u],b=(1-g)*(r-n)+n,y=(r-n)/d,_=s*Math.cos(b),S=s*Math.sin(b),h=fe.curve,m<=0&&(h=a?fe.move:fe.line),p.command=h,p.x=_,p.y=S,p.controls.left.clear(),p.controls.right.clear(),p.command===fe.curve&&(C=s*y/Math.PI,p.controls.left.x=C*Math.cos(b+it),p.controls.left.y=C*Math.sin(b+it),p.controls.right.x=C*Math.cos(b-it),p.controls.right.y=C*Math.sin(b-it),m===1&&p.controls.left.multiplyScalar(2),m===f&&p.controls.right.multiplyScalar(2)),u++;c[u].copy(c[0]),c[u].command=fe.line}else a||(c[u].command=fe.line,c[u].x=0,c[u].y=0,u++,c[u].copy(c[0]),c[u].command=fe.line)}return super._update.call(this),this}flagReset(){return super.flagReset.call(this),this._flagStartAngle=this._flagEndAngle=this._flagInnerRadius=this._flagOuterRadius=!1,this}clone(n){const r=this.innerRadius,s=this.outerRadius,o=this.startAngle,a=this.endAngle,l=this.vertices.length,c=new Cn(0,0,r,s,o,a,l);c.translation.copy(this.translation),c.rotation=this.rotation,c.scale=this.scale,c.skewX=this.skewX,c.skewY=this.skewY,this.matrix.manual&&c.matrix.copy(this.matrix);for(let d=0;d<$e.Properties.length;d++){const h=$e.Properties[d];c[h]=this[h]}return n&&n.add(c),c}toObject(){const n=super.toObject.call(this);n.renderer.type="arc-segment";for(let r=0;r<Cn.Properties.length;r++){const s=Cn.Properties[r];n[s]=this[s]}return n}};x(Cn,"Properties",["startAngle","endAngle","innerRadius","outerRadius"]);let po=Cn;const qc={startAngle:{enumerable:!0,get:function(){return this._startAngle},set:function(t){this._startAngle=t,this._flagStartAngle=!0}},endAngle:{enumerable:!0,get:function(){return this._endAngle},set:function(t){this._endAngle=t,this._flagEndAngle=!0}},innerRadius:{enumerable:!0,get:function(){return this._innerRadius},set:function(t){this._innerRadius=t,this._flagInnerRadius=!0}},outerRadius:{enumerable:!0,get:function(){return this._outerRadius},set:function(t){this._outerRadius=t,this._flagOuterRadius=!0}}},yo=Math.cos,bo=Math.sin,Sn=class Sn extends $e{constructor(n,r,s,o){const a=o?Math.max(o,2):4,l=[];for(let c=0;c<a;c++)l.push(new Te(0,0,0,0,0,0));super(l,!0,!0,!0);x(this,"_flagRadius",!1);x(this,"_radius",0);this._renderer.type="circle";for(let c in Xc)Object.defineProperty(this,c,Xc[c]);typeof s=="number"&&(this.radius=s),this._update(),typeof n=="number"&&(this.translation.x=n),typeof r=="number"&&(this.translation.y=r)}static fromObject(n){const r=new Sn().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<Sn.Properties.length;r++){const s=Sn.Properties[r];s in n&&typeof n[s]=="number"&&(this[s]=n[s])}return this}_update(){if(this._flagVertices||this._flagRadius){let n=this.vertices.length;!this._closed&&n>2&&(n-=1);const r=4/3*Math.tan(Math.PI/(n*2)),s=this._radius,o=s*r;for(let a=0;a<this.vertices.length;a++){const c=a/n*Qn,d=s*yo(c),h=s*bo(c),u=o*yo(c-it),m=o*bo(c-it),f=o*yo(c+it),g=o*bo(c+it),p=this.vertices[a];p.command=a===0?fe.move:fe.curve,p.set(d,h),p.controls.left.set(u,m),p.controls.right.set(f,g)}}return super._update.call(this),this}flagReset(){return this._flagRadius=!1,super.flagReset.call(this),this}clone(n){const r=new Sn(0,0,this.radius,this.vertices.length);r.translation.copy(this.translation),r.rotation=this.rotation,r.scale=this.scale,r.skewX=this.skewX,r.skewY=this.skewY,this.matrix.manual&&r.matrix.copy(this.matrix);for(let s=0;s<$e.Properties.length;s++){const o=$e.Properties[s];r[o]=this[o]}return n&&n.add(r),r}toObject(){const n=super.toObject.call(this);n.renderer.type="circle";for(let r=0;r<Sn.Properties.length;r++){const s=Sn.Properties[r];n[s]=this[s]}return n}};x(Sn,"Properties",["radius"]);let _o=Sn;const Xc={radius:{enumerable:!0,get:function(){return this._radius},set:function(t){this._radius=t,this._flagRadius=!0}}},wo=Math.cos,xo=Math.sin,Bn=class Bn extends $e{constructor(n,r,s,o,a){typeof o!="number"&&typeof s=="number"&&(o=s);const l=a?Math.max(a,2):4,c=[];for(let d=0;d<l;d++)c.push(new Te);super(c,!0,!0,!0);x(this,"_flagWidth",!1);x(this,"_flagHeight",!1);x(this,"_width",0);x(this,"_height",0);this._renderer.type="ellipse";for(let d in Yc)Object.defineProperty(this,d,Yc[d]);typeof s=="number"&&(this.width=s*2),typeof o=="number"&&(this.height=o*2),this._update(),typeof n=="number"&&(this.translation.x=n),typeof r=="number"&&(this.translation.y=r)}static fromObject(n){const r=new Bn().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<Bn.Properties.length;r++){const s=Bn.Properties[r];s in n&&typeof n[s]=="number"&&(this[s]=n[s])}return this}_update(){if(this._flagVertices||this._flagWidth||this._flagHeight){let n=this.vertices.length;!this._closed&&n>2&&(n-=1);const r=4/3*Math.tan(Math.PI/(this.vertices.length*2)),s=this._width/2,o=this._height/2;for(let a=0;a<this.vertices.length;a++){const c=a/n*Qn,d=s*wo(c),h=o*xo(c),u=s*r*wo(c-it),m=o*r*xo(c-it),f=s*r*wo(c+it),g=o*r*xo(c+it),p=this.vertices[a];p.command=a===0?fe.move:fe.curve,p.set(d,h),p.controls.left.set(u,m),p.controls.right.set(f,g)}}return super._update.call(this),this}flagReset(){return this._flagWidth=this._flagHeight=!1,super.flagReset.call(this),this}clone(n){const r=this.width/2,s=this.height/2,o=this.vertices.length,a=new Bn(0,0,r,s,o);a.translation.copy(this.translation),a.rotation=this.rotation,a.scale=this.scale,a.skewX=this.skewX,a.skewY=this.skewY,this.matrix.manual&&a.matrix.copy(this.matrix);for(let l=0;l<$e.Properties.length;l++){const c=$e.Properties[l];a[c]=this[c]}return n&&n.add(a),a}toObject(){const n=super.toObject.call(this);n.renderer.type="ellipse";for(let r=0;r<Bn.Properties.length;r++){const s=Bn.Properties[r];n[s]=this[s]}return n}};x(Bn,"Properties",["width","height"]);let vo=Bn;const Yc={width:{enumerable:!0,get:function(){return this._width},set:function(t){this._width=t,this._flagWidth=!0}},height:{enumerable:!0,get:function(){return this._height},set:function(t){this._height=t,this._flagHeight=!0}}},ap=Math.cos,lp=Math.sin,Tn=class Tn extends $e{constructor(n,r,s,o){o=Math.max(o||0,3);super();x(this,"_flagWidth",!1);x(this,"_flagHeight",!1);x(this,"_flagSides",!1);x(this,"_radius",0);x(this,"_width",0);x(this,"_height",0);x(this,"_sides",0);this._renderer.type="polygon";for(let a in Uc)Object.defineProperty(this,a,Uc[a]);this.closed=!0,this.automatic=!1,typeof s=="number"&&(this.radius=s),typeof o=="number"&&(this.sides=o),this._update(),typeof n=="number"&&(this.translation.x=n),typeof r=="number"&&(this.translation.y=r)}static fromObject(n){const r=new Tn().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<Tn.Properties.length;r++){const s=Tn.Properties[r];s in n&&typeof n[s]=="number"&&(this[s]=n[s])}return this}_update(){if(this._flagVertices||this._flagWidth||this._flagHeight||this._flagSides){const n=this._sides,r=n+1;let s=this.vertices.length;s>n&&(this.vertices.splice(n-1,s-n),s=n);for(let o=0;o<r;o++){const a=(o+.5)/n,l=Qn*a+Math.PI/2,c=this._width*ap(l)/2,d=this._height*lp(l)/2;o>=s?this.vertices.push(new Te(c,d)):this.vertices[o].set(c,d),this.vertices[o].command=o===0?fe.move:fe.line}}return super._update.call(this),this}flagReset(){return this._flagWidth=this._flagHeight=this._flagSides=!1,super.flagReset.call(this),this}clone(n){const r=new Tn(0,0,0,this.sides);r.translation.copy(this.translation),r.rotation=this.rotation,r.scale=this.scale,r.skewX=this.skewX,r.skewY=this.skewY,r.width=this.width,r.height=this.height,this.matrix.manual&&r.matrix.copy(this.matrix);for(let s=0;s<$e.Properties.length;s++){const o=$e.Properties[s];r[o]=this[o]}return n&&n.add(r),r}toObject(){const n=super.toObject.call(this);n.renderer.type="polygon";for(let r=0;r<Tn.Properties.length;r++){const s=Tn.Properties[r];n[s]=this[s]}return n}};x(Tn,"Properties",["width","height","sides"]);let ko=Tn;const Uc={radius:{enumerable:!0,get:function(){return this._radius},set:function(t){this._radius=t,this.width=t*2,this.height=t*2}},width:{enumerable:!0,get:function(){return this._width},set:function(t){this._width=t,this._flagWidth=!0,this._radius=Math.max(this.width,this.height)/2}},height:{enumerable:!0,get:function(){return this._height},set:function(t){this._height=t,this._flagHeight=!0,this._radius=Math.max(this.width,this.height)/2}},sides:{enumerable:!0,get:function(){return this._sides},set:function(t){this._sides=t,this._flagSides=!0}}},yi=class yi extends $e{constructor(n,r,s,o){const a=[new Te,new Te,new Te,new Te];super(a,!0,!1,!0);x(this,"_flagWidth",!1);x(this,"_flagHeight",!1);x(this,"_width",0);x(this,"_height",0);x(this,"_origin",null);this._renderer.type="rectangle";for(let l in Gc)Object.defineProperty(this,l,Gc[l]);this.width=typeof s=="number"?s:1,this.height=typeof o=="number"?o:1,this.origin=new me,typeof n=="number"&&(this.translation.x=n),typeof r=="number"&&(this.translation.y=r),this._update()}static fromObject(n){const r=new yi().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<yi.Properties.length;r++){const s=yi.Properties[r];s in n&&(typeof n[s]=="number"?this[s]=n[s]:this[s]instanceof me&&this[s].copy(n[s]))}return this}_update(){if(this._flagVertices||this._flagWidth||this._flagHeight){const n=this._width/2,r=this._height/2;!this._closed&&this.vertices.length===4&&this.vertices.push(new Te),this.vertices[0].set(-n,-r).sub(this._origin).command=fe.move,this.vertices[1].set(n,-r).sub(this._origin).command=fe.line,this.vertices[2].set(n,r).sub(this._origin).command=fe.line,this.vertices[3].set(-n,r).sub(this._origin).command=fe.line,this.vertices[4]&&(this.vertices[4].set(-n,-r).sub(this._origin).command=fe.line)}return super._update.call(this),this}flagReset(){return this._flagWidth=this._flagHeight=!1,super.flagReset.call(this),this}clone(n){const r=new yi(0,0,this.width,this.height);r.translation.copy(this.translation),r.rotation=this.rotation,r.scale=this.scale,r.skewX=this.skewX,r.skewY=this.skewY,this.matrix.manual&&r.matrix.copy(this.matrix);for(let s=0;s<$e.Properties.length;s++){const o=$e.Properties[s];r[o]instanceof me?r[o].copy(this[o]):r[o]=this[o]}return n&&n.add(r),r}toObject(){const n=super.toObject.call(this);return n.renderer.type="rectangle",n.width=this.width,n.height=this.height,n.origin=this.origin.toObject(),n}};x(yi,"Properties",["width","height","origin"]);let ar=yi;const Gc={width:{enumerable:!0,get:function(){return this._width},set:function(t){this._width=t,this._flagWidth=!0}},height:{enumerable:!0,get:function(){return this._height},set:function(t){this._height=t,this._flagHeight=!0}},origin:{enumerable:!0,get:function(){return this._origin},set:function(t){this._origin&&this._origin.unbind(U.Types.change,this._renderer.flagVertices),this._origin=t,this._origin.bind(U.Types.change,this._renderer.flagVertices),this._renderer.flagVertices()}}},Rn=class Rn extends $e{constructor(n,r,s,o,a){typeof a>"u"&&typeof s=="number"&&typeof o=="number"&&(a=Math.floor(Math.min(s,o)/12));const l=[];for(let c=0;c<10;c++)l.push(new Te(0,0,0,0,0,0,c===0?fe.move:fe.curve));super(l);x(this,"_flagWidth",!1);x(this,"_flagHeight",!1);x(this,"_flagRadius",!1);x(this,"_width",0);x(this,"_height",0);x(this,"_radius",12);this._renderer.type="rounded-rectangle";for(let c in Kc)Object.defineProperty(this,c,Kc[c]);this.closed=!0,this.automatic=!1,this._renderer.flagRadius=cp.bind(this),typeof s=="number"&&(this.width=s),typeof o=="number"&&(this.height=o),(typeof a=="number"||a instanceof me)&&(this.radius=a),this._update(),typeof n=="number"&&(this.translation.x=n),typeof r=="number"&&(this.translation.y=r)}static fromObject(n){const r=new Rn().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<Rn.Properties.length;r++){const s=Rn.Properties[r];if(s in n){const o=n[s];/radius/i.test(s)?this[s]=typeof o=="number"||o instanceof me?o:new me().copy(o):typeof o=="number"&&(this[s]=o)}}return this}_update(){if(this._flagVertices||this._flagWidth||this._flagHeight||this._flagRadius){const n=this._width,r=this._height;let s,o;this._radius instanceof me?(s=this._radius.x,o=this._radius.y):(s=this._radius,o=this._radius);let a,l=n/2,c=r/2;a=this.vertices[0],a.x=-(l-s),a.y=-c,a=this.vertices[1],a.x=l-s,a.y=-c,a.controls.left.clear(),a.controls.right.x=s,a.controls.right.y=0,a=this.vertices[2],a.x=l,a.y=-(c-o),a.controls.right.clear(),a.controls.left.clear(),a=this.vertices[3],a.x=l,a.y=c-o,a.controls.left.clear(),a.controls.right.x=0,a.controls.right.y=o,a=this.vertices[4],a.x=l-s,a.y=c,a.controls.right.clear(),a.controls.left.clear(),a=this.vertices[5],a.x=-(l-s),a.y=c,a.controls.left.clear(),a.controls.right.x=-s,a.controls.right.y=0,a=this.vertices[6],a.x=-l,a.y=c-o,a.controls.left.clear(),a.controls.right.clear(),a=this.vertices[7],a.x=-l,a.y=-(c-o),a.controls.left.clear(),a.controls.right.x=0,a.controls.right.y=-o,a=this.vertices[8],a.x=-(l-s),a.y=-c,a.controls.left.clear(),a.controls.right.clear(),a=this.vertices[9],a.copy(this.vertices[8])}return super._update.call(this),this}flagReset(){return this._flagWidth=this._flagHeight=this._flagRadius=!1,super.flagReset.call(this),this}clone(n){const r=this.width,s=this.height,o=this.radius,a=new Rn(0,0,r,s,o);a.translation.copy(this.translation),a.rotation=this.rotation,a.scale=this.scale,a.skewX=this.skewX,a.skewY=this.skewY,this.matrix.manual&&a.matrix.copy(this.matrix);for(let l=0;l<$e.Properties.length;l++){const c=$e.Properties[l];a[c]=this[c]}return n&&n.add(a),a}toObject(){const n=super.toObject.call(this);n.renderer.type="rounded-rectangle";for(let r=0;r<Rn.Properties.length;r++){const s=Rn.Properties[r];n[s]=this[s]}return n.radius=typeof this.radius=="number"?this.radius:this.radius.toObject(),n}};x(Rn,"Properties",["width","height","radius"]);let Co=Rn;const Kc={width:{enumerable:!0,get:function(){return this._width},set:function(t){this._width=t,this._flagWidth=!0}},height:{enumerable:!0,get:function(){return this._height},set:function(t){this._height=t,this._flagHeight=!0}},radius:{enumerable:!0,get:function(){return this._radius},set:function(t){this._radius instanceof me&&this._radius.unbind(U.Types.change,this._renderer.flagRadius),this._radius=t,this._radius instanceof me&&this._radius.bind(U.Types.change,this._renderer.flagRadius),this._flagRadius=!0}}};function cp(){this._flagRadius=!0}const dp=Math.cos,hp=Math.sin,$n=class $n extends $e{constructor(n,r,s,o,a){arguments.length<=3&&(o=s,s=o/2),(typeof a!="number"||a<=0)&&(a=5);super();x(this,"_flagInnerRadius",!1);x(this,"_flagOuterRadius",!1);x(this,"_flagSides",!1);x(this,"_innerRadius",0);x(this,"_outerRadius",0);x(this,"_sides",0);this._renderer.type="star";for(let l in Zc)Object.defineProperty(this,l,Zc[l]);this.closed=!0,this.automatic=!1,typeof s=="number"&&(this.innerRadius=s),typeof o=="number"&&(this.outerRadius=o),typeof a=="number"&&(this.sides=a),this._update(),typeof n=="number"&&(this.translation.x=n),typeof r=="number"&&(this.translation.y=r)}static fromObject(n){const r=new $n().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<$n.Properties.length;r++){const s=$n.Properties[r];s in n&&typeof n[s]=="number"&&(this[s]=n[s])}return this}_update(){if(this._flagVertices||this._flagInnerRadius||this._flagOuterRadius||this._flagSides){const n=this._sides*2,r=n+1;let s=this.vertices.length;s>n&&(this.vertices.splice(n-1,s-n),s=n);for(let o=0;o<r;o++){const a=(o+.5)/n,l=Qn*a,c=(o%2?this._outerRadius:this._innerRadius)/2,d=c*dp(l),h=c*hp(l);o>=s?this.vertices.push(new Te(d,h)):this.vertices[o].set(d,h),this.vertices[o].command=o===0?fe.move:fe.line}}return super._update.call(this),this}flagReset(){return this._flagInnerRadius=this._flagOuterRadius=this._flagSides=!1,super.flagReset.call(this),this}clone(n){const r=this.innerRadius,s=this.outerRadius,o=this.sides,a=new $n(0,0,r,s,o);a.translation.copy(this.translation),a.rotation=this.rotation,a.scale=this.scale,a.skewX=this.skewX,a.skewY=this.skewY,this.matrix.manual&&a.matrix.copy(this.matrix);for(let l=0;l<$e.Properties.length;l++){const c=$e.Properties[l];a[c]=this[c]}return n&&n.add(a),a}toObject(){const n=super.toObject.call(this);n.renderer.type="star";for(let r=0;r<$n.Properties.length;r++){const s=$n.Properties[r];n[s]=this[s]}return n}};x($n,"Properties",["innerRadius","outerRadius","sides"]);let So=$n;const Zc={innerRadius:{enumerable:!0,get:function(){return this._innerRadius},set:function(t){this._innerRadius=t,this._flagInnerRadius=!0}},outerRadius:{enumerable:!0,get:function(){return this._outerRadius},set:function(t){this._outerRadius=t,this._flagOuterRadius=!0}},sides:{enumerable:!0,get:function(){return this._sides},set:function(t){this._sides=t,this._flagSides=!0}}};let Bo;const Jc=Math.min,Qc=Math.max;ln.document&&(Bo=document.createElement("canvas"));const pt=class pt extends _n{constructor(n,r,s,o){super();x(this,"_flagValue",!0);x(this,"_flagFamily",!0);x(this,"_flagSize",!0);x(this,"_flagLeading",!0);x(this,"_flagAlignment",!0);x(this,"_flagBaseline",!0);x(this,"_flagStyle",!0);x(this,"_flagWeight",!0);x(this,"_flagDecoration",!0);x(this,"_flagFill",!0);x(this,"_flagStroke",!0);x(this,"_flagLinewidth",!0);x(this,"_flagOpacity",!0);x(this,"_flagVisible",!0);x(this,"_flagMask",!1);x(this,"_flagClip",!1);x(this,"_flagDirection",!0);x(this,"_flagStrokeAttenuation",!0);x(this,"_value","");x(this,"_family","sans-serif");x(this,"_size",13);x(this,"_leading",17);x(this,"_alignment","center");x(this,"_baseline","middle");x(this,"_style","normal");x(this,"_weight",500);x(this,"_decoration","none");x(this,"_direction","ltr");x(this,"_fill","#000");x(this,"_stroke","none");x(this,"_linewidth",1);x(this,"_opacity",1);x(this,"_visible",!0);x(this,"_mask",null);x(this,"_clip",!1);x(this,"_dashes",null);x(this,"_strokeAttenuation",!0);for(let a in ed)Object.defineProperty(this,a,ed[a]);if(this._renderer.type="text",this._renderer.flagFill=up.bind(this),this._renderer.flagStroke=fp.bind(this),this.value=n,typeof r=="number"&&(this.translation.x=r),typeof s=="number"&&(this.translation.y=s),this.dashes=[],this.dashes.offset=0,!Re.isObject(o))return this;for(let a=0;a<pt.Properties.length;a++){const l=pt.Properties[a];l in o&&(this[l]=o[l])}}static Measure(n){if(Bo){const r=Bo.getContext("2d");r.font=[n._style,n._weight,`${n._size}px/${n._leading}px`,n._family].join(" ");const s=r.measureText(n.value,0,0),o=s.actualBoundingBoxDescent+s.actualBoundingBoxAscent;return{width:s.width,height:o}}else{const r=this.value.length*this.size*pt.Ratio,s=this.leading;return console.warn("Two.Text: unable to accurately measure text, so using an approximation."),{width:r,height:s}}}static fromObject(n){const r=typeof n.fill=="string"?n.fill:ni(n.fill),s=typeof n.stroke=="string"?n.stroke:ni(n.stroke),o=new pt().copy({...n,fill:r,stroke:s});return"id"in n&&(o.id=n.id),o}copy(n){super.copy.call(this,n);for(let r=0;r<pt.Properties.length;r++){const s=pt.Properties[r];s in n&&(this[s]=n[s])}return this}clone(n){const r=new pt(this.value);r.translation.copy(this.translation),r.rotation=this.rotation,r.scale=this.scale;for(let s=0;s<pt.Properties.length;s++){const o=pt.Properties[s];r[o]=this[o]}return this.matrix.manual&&r.matrix.copy(this.matrix),n&&n.add(r),r._update()}toObject(){const n=super.toObject.call(this);n.renderer.type="text";for(let r=0;r<pt.Properties.length;r++){const s=pt.Properties[r];n[s]=this[s]}return n}dispose(){return super.dispose(),typeof this.fill=="object"&&this.fill&&"dispose"in this.fill?this.fill.dispose():typeof this.fill=="object"&&this.fill&&"unbind"in this.fill&&this.fill.unbind(),typeof this.stroke=="object"&&this.stroke&&"dispose"in this.stroke?this.stroke.dispose():typeof this.stroke=="object"&&this.stroke&&"unbind"in this.stroke&&this.stroke.unbind(),this}noFill(){return this.fill="none",this}noStroke(){return this.stroke="none",this.linewidth=0,this}getBoundingClientRect(n){let r,s,o,a,l;this._update(!0),r=n?this.matrix:this.worldMatrix;const{width:c,height:d}=pt.Measure(this),h=(this._linewidth||0)/2;switch(this.alignment){case"left":s=-h,o=c+h;break;case"right":s=-(c+h),o=h;break;default:s=-(c/2+h),o=c/2+h}switch(this.baseline){case"middle":a=-(d/2+h),l=d/2+h;break;default:a=-(d+h),l=h}const[u,m]=r.multiply(s,a),[f,g]=r.multiply(s,l),[p,b]=r.multiply(o,a),[y,_]=r.multiply(o,l);return a=Jc(m,g,b,_),s=Jc(u,f,p,y),o=Qc(u,f,p,y),l=Qc(m,g,b,_),{top:a,left:s,right:o,bottom:l,width:o-s,height:l-a}}flagReset(){return super.flagReset.call(this),this._flagValue=this._flagFamily=this._flagSize=this._flagLeading=this._flagAlignment=this._flagFill=this._flagStroke=this._flagLinewidth=this._flagOpacity=this._flagVisible=this._flagClip=this._flagDecoration=this._flagClassName=this._flagBaseline=this._flagWeight=this._flagStyle=this._flagDirection=!1,this}};x(pt,"Ratio",.6),x(pt,"Properties",["value","family","size","leading","alignment","linewidth","style","weight","decoration","direction","baseline","opacity","visible","fill","stroke","dashes","strokeAttenuation"]);let Ii=pt;const ed={value:{enumerable:!0,get:function(){return this._value},set:function(t){this._value=t,this._flagValue=!0}},family:{enumerable:!0,get:function(){return this._family},set:function(t){this._family=t,this._flagFamily=!0}},size:{enumerable:!0,get:function(){return this._size},set:function(t){this._size=t,this._flagSize=!0}},leading:{enumerable:!0,get:function(){return this._leading},set:function(t){this._leading=t,this._flagLeading=!0}},alignment:{enumerable:!0,get:function(){return this._alignment},set:function(t){this._alignment=t,this._flagAlignment=!0}},linewidth:{enumerable:!0,get:function(){return this._linewidth},set:function(t){this._linewidth=t,this._flagLinewidth=!0}},style:{enumerable:!0,get:function(){return this._style},set:function(t){this._style=t,this._flagStyle=!0}},weight:{enumerable:!0,get:function(){return this._weight},set:function(t){this._weight=t,this._flagWeight=!0}},decoration:{enumerable:!0,get:function(){return this._decoration},set:function(t){this._decoration=t,this._flagDecoration=!0}},direction:{enumerable:!0,get:function(){return this._direction},set:function(t){this._direction=t,this._flagDirection=!0}},baseline:{enumerable:!0,get:function(){return this._baseline},set:function(t){this._baseline=t,this._flagBaseline=!0}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(t){this._opacity=t,this._flagOpacity=!0}},visible:{enumerable:!0,get:function(){return this._visible},set:function(t){this._visible=t,this._flagVisible=!0}},fill:{enumerable:!0,get:function(){return this._fill},set:function(t){(this._fill instanceof Qe||this._fill instanceof vt||this._fill instanceof kt||this._fill instanceof He)&&this._fill.unbind(U.Types.change,this._renderer.flagFill),this._fill=t,this._flagFill=!0,(this._fill instanceof Qe||this._fill instanceof vt||this._fill instanceof kt||this._fill instanceof He)&&this._fill.bind(U.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(t){(this._stroke instanceof Qe||this._stroke instanceof vt||this._stroke instanceof kt||this._stroke instanceof He)&&this._stroke.unbind(U.Types.change,this._renderer.flagStroke),this._stroke=t,this._flagStroke=!0,(this._stroke instanceof Qe||this._stroke instanceof vt||this._stroke instanceof kt||this._stroke instanceof He)&&this._stroke.bind(U.Types.change,this._renderer.flagStroke)}},mask:{enumerable:!0,get:function(){return this._mask},set:function(t){this._mask=t,this._flagMask=!0,Re.isObject(t)&&!t.clip&&(t.clip=!0)}},clip:{enumerable:!0,get:function(){return this._clip},set:function(t){this._clip=t,this._flagClip=!0}},dashes:{enumerable:!0,get:function(){return this._dashes},set:function(t){typeof t.offset!="number"&&(t.offset=this.dashes&&this._dashes.offset||0),this._dashes=t}},strokeAttenuation:{enumerable:!0,get:function(){return this._strokeAttenuation},set:function(t){this._strokeAttenuation=!!t,this._flagStrokeAttenuation=!0,this._flagLinewidth=!0}}};function up(){this._flagFill=!0}function fp(){this._flagStroke=!0}const En=class En extends ar{constructor(n,r,s,o){super(r,s,0,0);x(this,"_flagTextures",!1);x(this,"_flagFrameRate",!1);x(this,"_flagIndex",!1);x(this,"_amount",1);x(this,"_duration",0);x(this,"_index",0);x(this,"_startTime",0);x(this,"_playing",!1);x(this,"_firstFrame",0);x(this,"_lastFrame",0);x(this,"_loop",!0);x(this,"_textures",null);x(this,"_frameRate",0);x(this,"_origin",null);this._renderer.type="image-sequence";for(let a in td)Object.defineProperty(this,a,td[a]);this._renderer.flagTextures=gp.bind(this),this._renderer.bindTextures=mp.bind(this),this._renderer.unbindTextures=pp.bind(this),this.noStroke(),this.noFill(),Array.isArray(n)?this.textures=n.map(nd.bind(this)):typeof n=="string"&&(this.textures=[nd(n)]),this.origin=new me,this._update(),typeof o=="number"?this.frameRate=o:this.frameRate=En.DefaultFrameRate,this.index=0}static fromObject(n){const r=new En().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<En.Properties.length;r++){const s=En.Properties[r];s in n&&(this[s]=n[s])}return this}play(n,r,s){return this._playing=!0,this._firstFrame=0,this._lastFrame=this.amount-1,this._startTime=Re.performance.now(),typeof n=="number"&&(this._firstFrame=n),typeof r=="number"&&(this._lastFrame=r),typeof s=="function"?this._onLastFrame=s:delete this._onLastFrame,this._index!==this._firstFrame&&(this._startTime-=1e3*Math.abs(this._index-this._firstFrame)/this._frameRate),this}pause(){return this._playing=!1,this}stop(){return this._playing=!1,this._index=this._firstFrame,this}clone(n){const r=new En(this.textures,this.translation.x,this.translation.y,this.frameRate);return r._loop=this._loop,this._playing&&r.play(),n&&n.add(r),r}toObject(){const n=super.toObject.call(this);return n.renderer.type="image-sequence",n.textures=this.textures.map(function(r){return r.toObject()}),n.frameRate=this.frameRate,n.index=this.index,n.firstFrame=this.firstFrame,n.lastFrame=this.lastFrame,n.loop=this.loop,n}dispose(){if(super.dispose(),this._playing&&(this._playing=!1),this._onLastFrame=null,this.textures&&typeof this.textures.unbind=="function")try{this.textures.unbind()}catch{}if(this.textures)for(let n=0;n<this.textures.length;n++){const r=this.textures[n];typeof r.dispose=="function"?r.dispose():typeof r.unbind=="function"&&r.unbind()}return this}_update(){const n=this._textures;let r,s,o,a,l,c,d,h;return n&&(this._flagTextures&&(this._amount=n.length),this._flagFrameRate&&(this._duration=1e3*this._amount/this._frameRate),this._playing&&this._frameRate>0?(a=this._amount,Re.isNaN(this._lastFrame)&&(this._lastFrame=a-1),o=Re.performance.now()-this._startTime,h=this._lastFrame+1,l=1e3*(h-this._firstFrame)/this._frameRate,this._loop?o=o%l:o=Math.min(o,l),d=Wt(this._firstFrame,h,o/l),d=Math.floor(d),d!==this._index&&(this._index=d,c=n[this._index],c.loaded&&(r=c.image.width,s=c.image.height,this.width!==r&&(this.width=r),this.height!==s&&(this.height=s),this.fill=c,d>=this._lastFrame-1&&this._onLastFrame&&this._onLastFrame()))):(this._flagIndex||!(this.fill instanceof He))&&(c=n[this._index],c.loaded&&(r=c.image.width,s=c.image.height,this.width!==r&&(this.width=r),this.height!==s&&(this.height=s)),this.fill=c)),super._update.call(this),this}flagReset(){return this._flagTextures=this._flagFrameRate=!1,super.flagReset.call(this),this}};x(En,"Properties",["textures","frameRate","index","firstFrame","lastFrame","loop"]),x(En,"DefaultFrameRate",30);let To=En;const td={frameRate:{enumerable:!0,get:function(){return this._frameRate},set:function(t){this._frameRate=t,this._flagFrameRate=!0}},index:{enumerable:!0,get:function(){return this._index},set:function(t){this._index=t,this._flagIndex=!0}},textures:{enumerable:!0,get:function(){return this._textures},set:function(t){const e=this._renderer.bindTextures,n=this._renderer.unbindTextures;this._textures&&this._textures.unbind(U.Types.insert,e).unbind(U.Types.remove,n),this._textures=new ei((t||[]).slice(0)),this._textures.bind(U.Types.insert,e).bind(U.Types.remove,n),e(this._textures)}},firstFrame:{enumerable:!0,get:function(){return this._firstFrame},set:function(t){this._firstFrame=t}},lastFrame:{enumerable:!0,get:function(){return this._lastFrame},set:function(t){this._lastFrame=t}},loop:{enumerable:!0,get:function(){return this._loop},set:function(t){this._loop=!!t}}};function gp(){this._flagTextures=!0}function mp(t){let e=t.length;for(;e--;)t[e].bind(U.Types.change,this._renderer.flagTextures);this._renderer.flagTextures()}function pp(t){let e=t.length;for(;e--;)t[e].unbind(U.Types.change,this._renderer.flagTextures);this._renderer.flagTextures()}function nd(t){if(t instanceof He)return t;if(typeof t=="string")return new He(t)}const bi=class bi extends ar{constructor(n,r,s,o,a,l){super(r,s,0,0);x(this,"_flagTexture",!1);x(this,"_flagColumns",!1);x(this,"_flagRows",!1);x(this,"_flagFrameRate",!1);x(this,"_flagIndex",!1);x(this,"_amount",1);x(this,"_duration",0);x(this,"_startTime",0);x(this,"_playing",!1);x(this,"_firstFrame",0);x(this,"_lastFrame",0);x(this,"_loop",!0);x(this,"_texture",null);x(this,"_columns",1);x(this,"_rows",1);x(this,"_frameRate",0);x(this,"_index",0);x(this,"_origin",null);this._renderer.type="sprite";for(let c in id)Object.defineProperty(this,c,id[c]);this.noStroke(),this.noFill(),n instanceof He?this.texture=n:typeof n=="string"&&(this.texture=new He(n)),this.origin=new me,this._update(),typeof o=="number"&&(this.columns=o),typeof a=="number"&&(this.rows=a),typeof l=="number"&&(this.frameRate=l),this.index=0}static fromObject(n){const r=new bi().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<bi.Properties.length;r++){const s=bi.Properties[r];s in n&&(this[s]=n[s])}return this}play(n,r,s){return this._playing=!0,this._firstFrame=0,this._lastFrame=this.amount-1,this._startTime=Re.performance.now(),typeof n=="number"&&(this._firstFrame=n),typeof r=="number"&&(this._lastFrame=r),typeof s=="function"?this._onLastFrame=s:delete this._onLastFrame,this._index!==this._firstFrame&&(this._startTime-=1e3*Math.abs(this._index-this._firstFrame)/this._frameRate),this}pause(){return this._playing=!1,this}stop(){return this._playing=!1,this._index=0,this}clone(n){const r=new bi(this.texture,this.translation.x,this.translation.y,this.columns,this.rows,this.frameRate);return this.playing&&r.play(this._firstFrame,this._lastFrame),r.loop=this.loop,r.firstFrame=this.firstFrame,r.lastFrame=this.lastFrame,n&&n.add(r),r}toObject(){const n=super.toObject.call(this);return n.renderer.type="sprite",n.texture=this.texture.toObject(),n.columns=this.columns,n.rows=this.rows,n.frameRate=this.frameRate,n.index=this.index,n.firstFrame=this.firstFrame,n.lastFrame=this.lastFrame,n.loop=this.loop,n}dispose(){return super.dispose(),this._playing&&(this._playing=!1),this._onLastFrame=null,this._startTime=0,this._texture&&typeof this._texture.dispose=="function"?this._texture.dispose():this._texture&&typeof this._texture.unbind=="function"&&this._texture.unbind(),this}_update(){const n=this._texture,r=this._columns,s=this._rows;let o,a,l,c,d,h,u,m,f;if(n&&((this._flagColumns||this._flagRows)&&(this._amount=this._columns*this._rows),this._flagFrameRate&&(this._duration=1e3*this._amount/this._frameRate),this._flagTexture&&(this.fill=n),n.loaded)){u=n.image.width,m=n.image.height,o=u/r,a=m/s,c=this._amount,this.width!==o&&(this.width=o),this.height!==a&&(this.height=a),this._playing&&this._frameRate>0&&(Re.isNaN(this._lastFrame)&&(this._lastFrame=c-1),l=Re.performance.now()-this._startTime,f=this._lastFrame+1,d=1e3*(f-this._firstFrame)/this._frameRate,this._loop?l=l%d:l=Math.min(l,d),h=Wt(this._firstFrame,f,l/d),h=Math.floor(h),h!==this._index&&(this._index=h,h>=this._lastFrame-1&&this._onLastFrame&&this._onLastFrame()));const g=this._index%r,p=Math.floor(this._index/r),b=-o*g+(u-o)/2,y=-a*p+(m-a)/2;b!==n.offset.x&&(n.offset.x=b),y!==n.offset.y&&(n.offset.y=y)}return super._update.call(this),this}flagReset(){return this._flagTexture=this._flagColumns=this._flagRows=this._flagFrameRate=!1,super.flagReset.call(this),this}};x(bi,"Properties",["texture","columns","rows","frameRate","index","firstFrame","lastFrame","loop"]);let Ro=bi;const id={texture:{enumerable:!0,get:function(){return this._texture},set:function(t){this._texture=t,this._flagTexture=!0}},columns:{enumerable:!0,get:function(){return this._columns},set:function(t){this._columns=t,this._flagColumns=!0}},rows:{enumerable:!0,get:function(){return this._rows},set:function(t){this._rows=t,this._flagRows=!0}},frameRate:{enumerable:!0,get:function(){return this._frameRate},set:function(t){this._frameRate=t,this._flagFrameRate=!0}},index:{enumerable:!0,get:function(){return this._index},set:function(t){this._index=t,this._flagIndex=!0}},firstFrame:{enumerable:!0,get:function(){return this._firstFrame},set:function(t){this._firstFrame=t}},lastFrame:{enumerable:!0,get:function(){return this._lastFrame},set:function(t){this._lastFrame=t}},loop:{enumerable:!0,get:function(){return this._loop},set:function(t){this._loop=!!t}}},ns=Math.min,is=Math.max,Zt=class Zt extends _n{constructor(n){super();x(this,"_flagAdditions",!1);x(this,"_flagSubtractions",!1);x(this,"_flagOrder",!1);x(this,"_flagOpacity",!0);x(this,"_flagBeginning",!1);x(this,"_flagEnding",!1);x(this,"_flagLength",!1);x(this,"_flagMask",!1);x(this,"_fill","#fff");x(this,"_stroke","#000");x(this,"_linewidth",1);x(this,"_opacity",1);x(this,"_visible",!0);x(this,"_cap","round");x(this,"_join","round");x(this,"_miter",4);x(this,"_closed",!0);x(this,"_curved",!1);x(this,"_automatic",!0);x(this,"_beginning",0);x(this,"_ending",1);x(this,"_length",0);x(this,"_mask",null);x(this,"_strokeAttenuation",!0);for(let r in rd)Object.defineProperty(this,r,rd[r]);this._renderer.type="group",this.additions=[],this.subtractions=[],this.children=Array.isArray(n)?n:Array.prototype.slice.call(arguments)}static InsertChildren(n){for(let r=0;r<n.length;r++)sd.call(this,n[r],this)}static RemoveChildren(n){for(let r=0;r<n.length;r++)sd.call(this,n[r])}static OrderChildren(n){this._flagOrder=!0}static fromObject(n){const r=new Zt;for(let o=0;o<Zt.Properties.length;o++){const a=Zt.Properties[o];a in n&&(/(fill|stroke)/i.test(a)?r[a]=typeof n[a]=="string"?n[a]:ni(n[a]):r[a]=n[a])}return"mask"in n&&(r.mask=s(n.mask)),"id"in n&&(r.id=n.id),r.children=n.children.map(s),r;function s(o){if(o&&o.renderer)switch(o.renderer.type){case"arc-segment":return po.fromObject(o);case"circle":return _o.fromObject(o);case"element":return sr.fromObject(o);case"ellipse":return vo.fromObject(o);case"group":return Zt.fromObject(o);case"image":return Image.fromObject(o);case"image-sequence":return To.fromObject(o);case"path":return $e.fromObject(o);case"points":return ts.fromObject(o);case"polygon":return ko.fromObject(o);case"rectangle":return ar.fromObject(o);case"rounded-rectangle":return Co.fromObject(o);case"shape":return _n.fromObject(o);case"sprite":return Ro.fromObject(o);case"star":return So.fromObject(o);case"text":return Ii.fromObject(o)}return o}}copy(n){super.copy.call(this,n),console.warn("Two.js: attempting to copy group. Two.Group.children copying not supported.");for(let r=0;r<Zt.Properties.length;r++){const s=Zt.Properties[r];s in n&&(this[s]=n[s])}return this}clone(n){const r=new Zt,s=this.children.map(function(o){return o.clone()});return r.add(s),r.opacity=this.opacity,this.mask&&(r.mask=this.mask),r.translation.copy(this.translation),r.rotation=this.rotation,r.scale=this.scale,r.className=this.className,this.matrix.manual&&r.matrix.copy(this.matrix),n&&n.add(r),r._update()}toObject(){const n=super.toObject.call(this);return n.renderer.type="group",n.children=[],n.opacity=this.opacity,n.className=this.className,n.mask=this.mask?this.mask.toObject():null,Re.each(this.children,(r,s)=>{n.children[s]=r.toObject()},this),n}dispose(){if(super.dispose(),this.children)for(let n=0;n<this.children.length;n++){const r=this.children[n];typeof r.dispose=="function"&&r.dispose()}if(this.children&&typeof this.children.unbind=="function")try{this.children.unbind()}catch{}return this}corner(){const n=this.getBoundingClientRect(!0);for(let r=0;r<this.children.length;r++){const s=this.children[r];s.translation.x-=n.left,s.translation.y-=n.top}return this.mask&&(this.mask.translation.x-=n.left,this.mask.translation.y-=n.top),this}center(){const n=this.getBoundingClientRect(!0),r=n.left+n.width/2-this.translation.x,s=n.top+n.height/2-this.translation.y;for(let o=0;o<this.children.length;o++){const a=this.children[o];a.isShape&&(a.translation.x-=r,a.translation.y-=s)}return this.mask&&(this.mask.translation.x-=r,this.mask.translation.y-=s),this}getById(n){let r=null;function s(o){if(o.id===n)return o;if(o.children){if(o.children.ids[n])return o.children.ids[n];for(let a=0;a<o.children.length;a++)if(r=s(o.children[a]),r)return r}return null}return s(this)}getByClassName(n){const r=[];function s(o){if(Array.prototype.indexOf.call(o.classList,n)>=0&&r.push(o),o.children)for(let a=0;a<o.children.length;a++){const l=o.children[a];s(l)}return r}return s(this)}getByType(n){const r=[];function s(o){if(o instanceof n&&r.push(o),o.children)for(let a=0;a<o.children.length;a++){const l=o.children[a];s(l)}return r}return s(this)}add(n){n instanceof Array?n=n.slice():n=Array.prototype.slice.call(arguments);for(let r=0;r<n.length;r++){const s=n[r];if(!(s&&s.id))continue;const o=Array.prototype.indexOf.call(this.children,s);o>=0&&this.children.splice(o,1),this.children.push(s)}return this}remove(n){const r=arguments.length,s=this.parent;if(r<=0&&s)return s.remove(this),this;n instanceof Array?n=n.slice():n=Array.prototype.slice.call(arguments);for(let o=0;o<n.length;o++){const a=n[o];if(!a||!this.children.ids[a.id])continue;const l=this.children.indexOf(a);l>=0&&this.children.splice(l,1)}return this}getBoundingClientRect(n){let r,s,o,a,l,c;this._update(!0);let d=1/0,h=-1/0,u=1/0,m=-1/0;const f=/texture|gradient/i;s=n?this.matrix:this.worldMatrix;for(let g=0;g<this.children.length;g++){const p=this.children[g];if(!(!p.visible||f.test(p._renderer.type))&&(r=p.getBoundingClientRect(n),o=typeof r.top!="number"||Re.isNaN(r.top)||!isFinite(r.top),a=typeof r.left!="number"||Re.isNaN(r.left)||!isFinite(r.left),l=typeof r.right!="number"||Re.isNaN(r.right)||!isFinite(r.right),c=typeof r.bottom!="number"||Re.isNaN(r.bottom)||!isFinite(r.bottom),!(o||a||l||c)))if(n){const[b,y]=s.multiply(r.left,r.top),[_,S]=s.multiply(r.right,r.top),[C,v]=s.multiply(r.left,r.bottom),[B,k]=s.multiply(r.right,r.bottom);u=ns(y,S,v,k,u),d=ns(b,_,C,B,d),h=is(b,_,C,B,h),m=is(y,S,v,k,m)}else u=ns(r.top,u),d=ns(r.left,d),h=is(r.right,h),m=is(r.bottom,m)}return{top:u,left:d,right:h,bottom:m,width:h-d,height:m-u}}noFill(){return this.children.forEach(function(n){n.noFill()}),this}noStroke(){return this.children.forEach(function(n){n.noStroke()}),this}subdivide(){const n=arguments;return this.children.forEach(function(r){r.subdivide.apply(r,n)}),this}_update(){let n,r,s;if(this._flagBeginning||this._flagEnding){const o=Math.min(this._beginning,this._ending),a=Math.max(this._beginning,this._ending),l=this.length;let c=0;const d=o*l,h=a*l;for(n=0;n<this.children.length;n++)s=this.children[n],r=s.length,d>c+r?(s.beginning=1,s.ending=1):h<c?(s.beginning=0,s.ending=0):d>c&&d<c+r?(s.beginning=(d-c)/r,s.ending=1):h>c&&h<c+r?(s.beginning=0,s.ending=(h-c)/r):(s.beginning=0,s.ending=1),c+=r}return super._update.apply(this,arguments)}flagReset(){return this._flagAdditions&&(this.additions.length=0,this._flagAdditions=!1),this._flagSubtractions&&(this.subtractions.length=0,this._flagSubtractions=!1),this._flagOrder=this._flagMask=this._flagOpacity=this._flagBeginning=this._flagEnding=!1,super.flagReset.call(this),this}};x(Zt,"Children",jc),x(Zt,"Properties",["fill","stroke","linewidth","cap","join","miter","closed","curved","automatic"]);let wn=Zt;const rd={visible:{enumerable:!0,get:function(){return this._visible},set:function(t){this._flagVisible=this._visible!==t||this._flagVisible,this._visible=t}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(t){this._flagOpacity=this._opacity!==t||this._flagOpacity,this._opacity=t}},beginning:{enumerable:!0,get:function(){return this._beginning},set:function(t){this._flagBeginning=this._beginning!==t||this._flagBeginning,this._beginning=t}},ending:{enumerable:!0,get:function(){return this._ending},set:function(t){this._flagEnding=this._ending!==t||this._flagEnding,this._ending=t}},length:{enumerable:!0,get:function(){if(this._flagLength||this._length<=0){if(this._length=0,!this.children)return this._length;for(let t=0;t<this.children.length;t++){const e=this.children[t];this._length+=e.length}}return this._length}},fill:{enumerable:!0,get:function(){return this._fill},set:function(t){this._fill=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.fill=t}}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(t){this._stroke=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.stroke=t}}},linewidth:{enumerable:!0,get:function(){return this._linewidth},set:function(t){this._linewidth=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.linewidth=t}}},join:{enumerable:!0,get:function(){return this._join},set:function(t){this._join=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.join=t}}},miter:{enumerable:!0,get:function(){return this._miter},set:function(t){this._miter=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.miter=t}}},cap:{enumerable:!0,get:function(){return this._cap},set:function(t){this._cap=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.cap=t}}},closed:{enumerable:!0,get:function(){return this._closed},set:function(t){this._closed=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.closed=t}}},curved:{enumerable:!0,get:function(){return this._curved},set:function(t){this._curved=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.curved=t}}},automatic:{enumerable:!0,get:function(){return this._automatic},set:function(t){this._automatic=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.automatic=t}}},children:{enumerable:!0,get:function(){return this._children},set:function(t){const e=wn.InsertChildren.bind(this),n=wn.RemoveChildren.bind(this),r=wn.OrderChildren.bind(this);this._children&&(this._children.unbind(),this._children.length>0&&n(this._children)),this._children=new jc(t),this._children.bind(U.Types.insert,e),this._children.bind(U.Types.remove,n),this._children.bind(U.Types.order,r),t.length>0&&e(t)}},mask:{enumerable:!0,get:function(){return this._mask},set:function(t){this._mask=t,this._flagMask=!0,Re.isObject(t)&&!t.clip&&(t.clip=!0)}},strokeAttenuation:{enumerable:!0,get:function(){return this._strokeAttenuation},set:function(t){this._strokeAttenuation=!!t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.strokeAttenuation!==void 0&&(n.strokeAttenuation=t)}}}};function sd(t,e){const n=t.parent;let r;if(n===e){s();return}if(n&&n.children.ids[t.id]&&(r=Array.prototype.indexOf.call(n.children,t),n.children.splice(r,1),o()),e){s();return}o(),n._flagAdditions&&n.additions.length===0&&(n._flagAdditions=!1),n._flagSubtractions&&n.subtractions.length===0&&(n._flagSubtractions=!1),delete t.parent;function s(){e.subtractions.length>0&&(r=Array.prototype.indexOf.call(e.subtractions,t),r>=0&&e.subtractions.splice(r,1)),e.additions.length>0&&(r=Array.prototype.indexOf.call(e.additions,t),r>=0&&e.additions.splice(r,1)),t.parent=e,e.additions.push(t),e._flagAdditions=!0}function o(){r=Array.prototype.indexOf.call(n.additions,t),r>=0&&n.additions.splice(r,1),r=Array.prototype.indexOf.call(n.subtractions,t),r<0&&(n.subtractions.push(t),n._flagSubtractions=!0)}}class rs extends $e{constructor(e,n,r,s){const o=[new Te(e,n),new Te(r,s)];super(o);for(let a in od)Object.defineProperty(this,a,od[a]);this.vertices[0].command=fe.move,this.vertices[1].command=fe.line,this.automatic=!1}}x(rs,"Properties",["left","right"]);const od={left:{enumerable:!0,get:function(){return this.vertices[0]},set:function(t){if(Re.isObject(t))this.vertices.splice(0,1,t),this.vertices[0].command=fe.move;else{const e=new Zr("Two.Line.left argument is not an object.");console.warn(e.name,e.message)}}},right:{enumerable:!0,get:function(){return this.vertices[1]},set:function(t){if(Re.isObject(t))this.vertices.splice(1,1,t),this.vertices[1].command=fe.line;else{const e=new Zr("Two.Line.right argument is not an object.");console.warn(e.name,e.message)}}}};class $o{constructor(e=0,n=0){this.x=e,this.y=n}}class ii{constructor(e=10,n=0,r="A"){x(this,"start",new $o);x(this,"end",new $o);this.width=e,this.angle=n,this.label=r}}const Oe={line:{color:"#000",size:5},previewLine:{color:"#000",size:2},anchorPoint:{color:"#FF8000",size:12,strokeSize:20},lineLabel:{color:"#FF8000",size:22,rotation:-.5},angleLabel:{size:22,color:"#088c00",rotation:-.5},colorSideLabel:{size:20,color:"#439227"}},yp={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function bp(t,e){return i.openBlock(),i.createElementBlock("svg",yp,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"currentColor",d:"m289.94 256l95-95A24 24 0 0 0 351 127l-95 95l-95-95a24 24 0 0 0-34 34l95 95l-95 95a24 24 0 1 0 34 34l95-95l95 95a24 24 0 0 0 34-34Z"},null,-1)])])}const ss=i.markRaw({name:"ion-close",render:bp}),_p={class:"mr-3 flex flex-col gap-2"},wp=["onClick"],xp={class:"h-full p-2"},vp={},kp=i.defineComponent({...vp,__name:"kozyrek-configurator-templates",props:{settings:{},selectTemplateIndex:{}},emits:["template:select","init-draw-template","remove-custom-template"],setup(t,{emit:e}){const n=t,r=i.useTemplateRef("drawing-template-containers"),s=e;return i.onMounted(()=>{var o;(o=n.settings.allTemplates)==null||o.forEach((a,l)=>{var d;const c=(d=r.value)==null?void 0:d.at(l);c&&s("init-draw-template",c,a)})}),i.watch(()=>n.settings.allTemplates,(o,a)=>{i.nextTick(()=>{o.forEach((l,c)=>{var d;if(!a.includes(l)){const h=(d=r.value)==null?void 0:d.at(c);h&&s("init-draw-template",h,l)}})})},{deep:!0}),(o,a)=>{const l=ss;return i.openBlock(),i.createBlock(i.unref(V.NScrollbar),{style:{"max-height":"12.5rem",width:"auto"},trigger:"none"},{default:i.withCtx(()=>[i.createElementVNode("div",_p,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(t.settings.allTemplates,(c,d)=>(i.openBlock(),i.createElementBlock("div",{key:d,class:"group relative"},[i.createVNode(i.unref(V.NPopover),{trigger:"hover",placement:"right"},{trigger:i.withCtx(()=>[i.createElementVNode("div",{class:i.normalizeClass(["relative h-10 w-24 shrink-0 rounded-md border-2 border-solid border-slate-200",{"!border-green-700":d===t.selectTemplateIndex}]),onClick:h=>s("template:select",d)},[i.createElementVNode("div",xp,[i.createElementVNode("div",{ref_for:!0,ref:"drawing-template-containers",class:"kozyrek-preview h-full"},null,512)])],10,wp)]),default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(c.label),1)]),_:2},1024),c.isCustom&&!c.isNewRec()?(i.openBlock(),i.createBlock(i.unref(V.NButton),{key:0,size:"tiny",quaternary:"",circle:"",class:"!absolute right-0.5 top-0.5 !hidden group-hover:!flex",onClick:h=>s("remove-custom-template",d)},{default:i.withCtx(()=>[i.createVNode(l)]),_:1},8,["onClick"])):i.createCommentVNode("",!0)]))),128))])]),_:1})}}}),ad=Kn(kp,[["__scopeId","data-v-cf2c29de"]]),Cp={class:"flex gap-3"},Sp={class:"kozyrek-preview w-fill h-[12.5rem] grow touch-none overflow-hidden rounded-lg bg-gray-200 p-2"},Bp={ref:"drawing-container",class:"size-full"},Tp={},ld=i.defineComponent({...Tp,__name:"kozyrek-configurator-preview",props:{settings:{},value:{},selectTemplateIndex:{}},emits:["pointer:move","pointer:up","template:select"],setup(t,{emit:e}){const n=t,r=e,s=i.useTemplateRef("drawing-container");let o=[],a=[],l=[],c=null;const d=.75,h=i.computed(()=>n.value.configuratorParams.linesAngles.map((P,E)=>new ii(n.value.configuratorParams.linesWidths[E],P,`A-${E+1}`))),u=i.computed(()=>n.value.configuratorParams.colorSide==="bottom"),m=i.computed(()=>{var P,E;return n.value.configuratorParams.startTailType&&((P=n.settings.startTailConfigs)!=null&&P[n.value.configuratorParams.startTailType])?(E=n.settings.startTailConfigs)==null?void 0:E[n.value.configuratorParams.startTailType].points:[]}),f=i.computed(()=>{var P,E;return n.value.configuratorParams.endTailType&&((P=n.settings.endTailConfigs)!=null&&P[n.value.configuratorParams.endTailType])?(E=n.settings.endTailConfigs)==null?void 0:E[n.value.configuratorParams.endTailType].points:[]}),g=(P,E=!1)=>{P[0].start.x=0,P[0].start.y=0;let X=0;for(let j=0;j<P.length;j++){const H=P[j],N=P[j-1]??new ii(0,X);X+=!E||j>1?N.angle:0;const I=(!E||j>0?H.angle:0)+X;if(P[j].end.x=H.width*Math.cos(I*Math.PI/180)+P[j].start.x,P[j].end.y=H.width*Math.sin(I*Math.PI/180)+P[j].start.y,j<P.length-1){const J=j+1;P[J].start.x=P[j].end.x,P[J].start.y=P[j].end.y}}return P},p=(P,E,X,j,H=!1)=>{let N=g([...X,...j]);E.length>0&&(N=[...g(E),...N]);let I=0,J=0,ce=0,re=0;N.forEach(Fe=>{I=Math.min(I,Fe.start.x,Fe.end.x),J=Math.min(J,Fe.start.y,Fe.end.y),ce=Math.max(ce,Fe.start.x,Fe.end.x),re=Math.max(re,Fe.start.y,Fe.end.y)});let de,se;I===0&&J===0&&ce===0&&re===0?(de=1,se=1):(de=P.width/Math.abs(ce-I),se=(H?P.height:P.height-Oe.colorSideLabel.size)/Math.abs(re-J));const Ae=Math.min(de,se);return I=I<0?-I*Ae:0,J=J<0?-J*Ae:0,[Ae,I,J]},b=P=>{const E=new ts([P]);return E._size=Oe.anchorPoint.size,E.fill=Oe.anchorPoint.color,E.stroke="transparent",E._linewidth=Oe.anchorPoint.strokeSize,l.push(E),E},y=(P,E)=>{if(l=[],n.settings.allowChangeFirstPoint){const X=P[0],j=new me(X.vertices[0].x,X.vertices[0].y);j.bind(U.Types.change,()=>{X.vertices[0].copy(j)});const H=b(j);E.add(H)}P.forEach((X,j)=>{const H=P[j+1],N=new me(X.vertices[1].x,X.vertices[1].y);N.bind(U.Types.change,()=>{X.vertices[1].copy(N),H!==void 0&&H.vertices[0].copy(N)});const I=b(N);E.add(I)})},_=P=>P*(Math.PI/180),S=(P,E,X)=>{const j=E.vertices.length-1;P.position.x=E.vertices[j].x,P.position.y=E.vertices[j].y;const H=Math.atan2(E.vertices[j].y-E.vertices[0].y,E.vertices[j].x-E.vertices[0].x);P.rotation=_(X)+H},C=(P,E,X)=>{if(E.vertices[0]===void 0)return;P.position.x=E.vertices[0].x,P.position.y=E.vertices[0].y;const j=E.vertices.length-1,H=Math.atan2(E.vertices[j].y-E.vertices[0].y,E.vertices[j].x-E.vertices[0].x);P.rotation=_(X)+H},v=(P,E,X)=>{const j=new wn;if(P.length===0)return j;const H=[];return[...P].reverse().forEach((N,I)=>{I!==0&&N.angle>0&&(N.angle*=-1),H.push(N)}),P=g(H,!0),C(j,E,P[0].angle),[E.vertices[0],E.vertices[1]].forEach(N=>{N.bind(U.Types.change,()=>{C(j,E,P[0].angle)})}),P.forEach(N=>{const I=N.start.x*X,J=N.end.x*X,ce=N.start.y*X,re=N.end.y*X,de=new rs(I,ce,J,re);de.linewidth=Oe.line.size,de.stroke=Oe.line.color,j.add(de)}),j},B=(P,E,X)=>{const j=new wn;return P.length===0||(P=g(P,!0),S(j,E,P[0].angle),[E.vertices[0],E.vertices[1]].forEach(H=>{H.bind(U.Types.change,()=>{S(j,E,P[0].angle)})}),P.forEach(H=>{const N=H.start.x*X,I=H.end.x*X,J=H.start.y*X,ce=H.end.y*X,re=new rs(N,J,I,ce);re.linewidth=Oe.line.size,re.stroke=Oe.line.color,j.add(re)})),j},k=(P,E,X,j)=>{const H=E.vertices[0].x+(E.vertices[1].x-E.vertices[0].x)/2-8*Math.sin(P.angle*Math.PI/180),N=E.vertices[0].y+(E.vertices[1].y-E.vertices[0].y)/2-8*Math.cos(P.angle*Math.PI/180),I=new Ii(P.label,H+10,N-10);let J;I.size=Oe.lineLabel.size,I.weight=600,I.fill=Oe.lineLabel.color,I.id+=1,I.rotation=Oe.lineLabel.rotation,j>0&&(J=new Ii(`${P.angle}°`,E.vertices[0].x+25,E.vertices[0].y-25),J.size=Oe.angleLabel.size,J.weight=600,J.fill=Oe.angleLabel.color,J.rotation=Oe.angleLabel.rotation,J.id+=j,o.push(J),X.add(J)),X.add(I),$(I,E,0,J),$(I,E,1)},R=()=>{const{size:P}=Oe.colorSideLabel,E=0,X=0,j=u.value?P/2:P/2-P,H=u.value?P/2-P:P/2,N=new wn;if(!c)return N;const I=5,J=Math.atan2(H-j,X-E),ce=[new Te(E,j,0,0,0,0,an.Commands.move),new Te(X,H,0,0,0,0,an.Commands.line),new Te(X-I*Math.cos(J-Math.PI/4),H-I*Math.sin(J-Math.PI/4),0,0,0,0,an.Commands.line),new Te(X,H,0,0,0,0,an.Commands.move),new Te(X-I*Math.cos(J+Math.PI/4),H-I*Math.sin(J+Math.PI/4),0,0,0,0,an.Commands.line)],re=new $e(ce,!1,!1,!0);re.noFill(),re.cap="round",re.join="round",re.linewidth=P/7,re.stroke=Oe.colorSideLabel.color,N.add(re);const de=new Ii(u.value?"Цвет снизу":"Цвет сверху",10,0);de.size=P,de.weight=600,de.fill=Oe.colorSideLabel.color,de.alignment="left",N.add(de);const se=N.getBoundingClientRect();return N.position.x=(c.width-se.width)*d+10,N.position.y=u.value?c.height+se.height*2:se.height/2,N},$=(P,E,X,j)=>{E.vertices[X].bind(U.Types.change,()=>{const H=E.vertices.length-1,N=Math.atan2(E.vertices[0].y-E.vertices[H].y,E.vertices[0].x-E.vertices[H].x)*180/Math.PI,I=E.vertices[0].x+(E.vertices[H].x-E.vertices[0].x)/2-8*Math.sin(N*Math.PI/180),J=E.vertices[0].y+(E.vertices[H].y-E.vertices[0].y)/2-8*Math.cos(N*Math.PI/180);P.position.x=I+10,P.position.y=J-10,P.rotation=-.5,j&&(j.position.x=E.vertices[0].x+25,j.position.y=E.vertices[0].y-25)})},F=(P,E,X,j,H=!1)=>{var Ke;if(P.clear(),X.length===0){P.update();return}const N=g(X),[I,J,ce]=p(P,E,N,j,H),re=new wn,de=new Array,se=new Array;H||(o=[],a=[]),N.forEach((Ie,bt)=>{const Jt=Ie.start.x*I+J,Qt=Ie.end.x*I+J,Bt=Ie.start.y*I+ce,Ot=Ie.end.y*I+ce,lt=new rs(Jt,Bt,Qt,Ot);lt.linewidth=H?Oe.previewLine.size:Oe.line.size,lt.stroke=H?Oe.previewLine.color:Oe.line.color,a.push(lt),de.push(lt),re.add(lt),!H&&Ie.label!==""&&k(Ie,lt,re,bt)});const Ae=de.at(-1);let Fe=re.getBoundingClientRect();if(!H){const Ie=R();se.push(Ie)}if(E.length>0){const Ie=v(E,de[0],I);re.add(Ie)}if(j.length>0&&Ae){const Ie=B(j,Ae,I);re.add(Ie)}if(se.push(re),P.makeGroup(se),Fe=re.getBoundingClientRect(),re.position.x=0-Fe.left+(P.width-Fe.width)/(2*(H?1:d)),re.position.y=0-Fe.top+(P.height-Fe.height)/(2*(H?1:d)),P.update(),!H){const Ie=((Ke=n.value.configuratorParams)==null?void 0:Ke.colorSide)==="top";re.position.y=re.position.y+Oe.colorSideLabel.size*Number(Ie),y(de,re),P.update()}},D=(P,E)=>{if(P&&!E.isNewRec()){const X=new an({width:P.scrollWidth,height:P.scrollHeight});X.appendTo(P),F(X,[],E.points,[],!0)}},L=()=>{c&&F(c,m.value,h.value,f.value,!1)},M=P=>P*(180/Math.PI),z=(P,E)=>{const X=P[1].x-P[0].x,j=P[1].y-P[0].y,H=E[1].x-E[0].x,N=E[1].y-E[0].y;let I=Math.atan2(X*N-j*H,X*H+j*N);return I=M(I),Math.round(I)*-1},O=P=>{const E=a.map((X,j,H)=>{const N=H[j-1]??{vertices:[{x:-10,y:0},{x:0,y:0}]};let I=Math.ceil(X._length/P/n.settings.lineWidthStep)*n.settings.lineWidthStep;const J=o[j-1];I<(H.length>1?n.settings.minLineWidth:n.settings.stripMinWidth)&&(I=H.length>1?n.settings.minLineWidth:n.settings.stripMinWidth),I>n.settings.maxLineWidth&&(I=n.settings.maxLineWidth);const ce=z(X.vertices,N.vertices);return J&&(J.value=`${ce}°`),new ii(I,ce,`A-${j+1}`)});r("pointer:move",E)},ne=P=>{let E=null,X;const j=J=>{E=l.find(ce=>{const re=ce.renderer;return(re==null?void 0:re.elem)===J.target}),[X]=p(P,m.value,h.value.map(ce=>ce),f.value)},H=J=>{if(E){const ce=E.renderer,re=ce==null?void 0:ce.elem;if(!re)return;const de=re.getBoundingClientRect();E.vertices[0].x-=de.x-(J instanceof MouseEvent?J.clientX:J.targetTouches[0].clientX)+Oe.anchorPoint.size/2,E.vertices[0].y-=de.y-(J instanceof MouseEvent?J.clientY:J.targetTouches[0].clientY)+Oe.anchorPoint.size/2,O(X),P.update()}},N=()=>{E&&r("pointer:up",h.value),E=null},I=s.value;I&&(I.addEventListener("touchstart",j),I.addEventListener("touchend",N),I.addEventListener("mousedown",j),I.addEventListener("mouseup",N),I.addEventListener("mousemove",H),I.addEventListener("touchmove",H))};return i.onMounted(()=>{s.value&&(c=new an({width:s.value.scrollWidth,height:s.value.scrollHeight,fullscreen:!1}).appendTo(s.value),c.scene.scale=d,c.update(),i.watch(()=>n.value,()=>{L()},{deep:!0,immediate:!0}),ne(c))}),i.onBeforeUnmount(()=>{c&&(c.clear(),c=null)}),(P,E)=>(i.openBlock(),i.createElementBlock("div",Cp,[i.createVNode(ad,{"select-template-index":t.selectTemplateIndex,settings:t.settings,"onTemplate:select":E[0]||(E[0]=X=>r("template:select",X)),onInitDrawTemplate:D},null,8,["select-template-index","settings"]),i.createElementVNode("div",Sp,[i.createElementVNode("div",Bp,null,512)])]))}}),Rp={class:"flex max-w-[50rem] flex-col gap-3"},$p={},cd=i.defineComponent({...$p,__name:"kozyrek-configurator",props:{settings:{},cartItem:{}},emits:["submit"],setup(t,{emit:e}){const n=t,r=e,s=i.ref(!1),o=i.ref(!1),a=i.ref(!1),l=i.ref(n.cartItem),c=i.ref(n.settings),d=i.ref({linesWidths:[...n.cartItem.configuratorParams.linesWidths],linesAngles:[...n.cartItem.configuratorParams.linesAngles]}),h=i.ref({quantity:{},marker:{},length:{}}),u=i.ref(0),m=(v=0)=>{var k;const B=(k=c.value.allTemplates)==null?void 0:k.at(v);B!==void 0&&(u.value=v,l.value.configuratorParams.linesWidths=B.points.map(R=>A.isArray(R)?R[0]:R.width),l.value.configuratorParams.linesAngles=B.points.map(R=>A.isArray(R)?R[1]:R.angle),y()),p(l.value.configuratorParams)},f=async()=>{const v=prompt("Введите название шаблона:");if(!v)return;a.value=!0;const B={label:v,points:l.value.configuratorParams.linesWidths.map((k,R)=>[k,l.value.configuratorParams.linesAngles[R]])};await G.HttpRequester.getInstance(G.ConfiguratorProvider).createTemplate(n.cartItem.category,B,h.value).then(()=>{c.value.addCustomTemplate(B),u.value=c.value.allTemplates.length-1}).catch(()=>{a.value=!1}),a.value=!1},g=()=>{c.value.showOnlyTemplates||c.value.allowSaveTemplates&&(u.value=c.value.allTemplates.length-1)},p=async v=>{y(),s.value=!0,await G.HttpRequester.getInstance(G.ConfiguratorProvider).searchProduct(n.cartItem.category,v,h.value).then(B=>{l.value.product=B}).catch(()=>{s.value=!1}),s.value=!1},b=()=>{o.value=!0,r("submit",l.value,h.value,()=>{o.value=!1})},y=()=>{const v={quantity:h.value.quantity,marker:h.value.marker};l.value.configuratorParams.linesWidths.forEach((B,k)=>{v[`lines_widths[${k+1}]`]={},v[`lines_angles[${k+1}]`]={}}),h.value=v},_=v=>{d.value.linesWidths=v.map(B=>B.width),d.value.linesAngles=v.map(B=>B.angle)},S=v=>{l.value.configuratorParams.linesWidths=d.value.linesWidths,l.value.configuratorParams.linesAngles=d.value.linesAngles,y(),g(),p(l.value.configuratorParams)},C=(v,B)=>{d.value.linesWidths=v,d.value.linesAngles=B};return i.onBeforeMount(()=>{m()}),(v,B)=>(i.openBlock(),i.createElementBlock("div",Rp,[i.createVNode(ld,{value:l.value,"select-template-index":u.value,settings:c.value,"onPointer:up":S,"onPointer:move":_,"onTemplate:select":m},null,8,["value","select-template-index","settings"]),i.createVNode(Ua,{value:l.value,"onUpdate:value":B[0]||(B[0]=k=>l.value=k),"preview-params":d.value,validation:h.value,settings:c.value,"is-submit-processing":o.value,"is-product-searching":s.value,"select-template-index":u.value,"onUpdate:params":B[1]||(B[1]=k=>p(k)),"onUpdate:preview":C,onSubmit:b,"onClick:saveTemplate":f},null,8,["value","preview-params","validation","settings","is-submit-processing","is-product-searching","select-template-index"])]))}}),Ep={},zi=i.defineComponent({...Ep,__name:"debounced-input-number",props:{value:{default:void 0},clearable:{type:Boolean,default:!1},debounceTime:{default:500},placeholder:{default:""},min:{default:void 0},max:{default:void 0},step:{default:1},validator:{type:Function,default:void 0}},emits:["update:value"],setup(t,{expose:e,emit:n}){const r=t,s=n,o=i.ref(r.value),a=i.computed(()=>i.inject("debounce-input-time",r.debounceTime)),l=A.debounce(()=>s("update:value",o.value),a.value),c=f=>{o.value=f,l()};i.watch(()=>r.value,f=>{o.value=f});const d=i.ref(null);return e({focus:()=>{var f;return(f=d.value)==null?void 0:f.focus()},blur:()=>{var f;return(f=d.value)==null?void 0:f.blur()},select:()=>{var f;return(f=d.value)==null?void 0:f.select()}}),(f,g)=>(i.openBlock(),i.createBlock(i.unref(V.NInputNumber),{ref_key:"inputReference",ref:d,value:o.value,"onUpdate:value":[g[0]||(g[0]=p=>o.value=p),c],clearable:t.clearable,placeholder:t.placeholder,min:t.min,max:t.max,step:t.step,validator:t.validator},{prefix:i.withCtx(()=>[i.renderSlot(f.$slots,"prefix")]),_:3},8,["value","clearable","placeholder","min","max","step","validator"]))}}),Np={key:0,class:"flex items-baseline gap-1"},Pp={key:0,class:"flex items-baseline gap-1"},Fp={class:"flex gap-3"},Mp={},dd=i.defineComponent({...Mp,__name:"mosquito-configurator-form",props:{value:{},settings:{},isProductSearching:{type:Boolean,default:!1},isSubmitProcessing:{type:Boolean,default:!1},validation:{default:void 0}},emits:["update:value","update:params","submit","click:instructions-toggle","click:show-preview-drawer"],setup(t,{emit:e}){const n=t,r=e,s=i.computed(()=>_t.isPhoneDevice()),o=i.ref(A.cloneDeep(i.toRaw(n.value.configuratorParams))),a=i.computed(()=>n.settings.widthOverlaps[o.value.mountType]??0),l=i.computed(()=>n.settings.heightOverlaps[o.value.mountType]??0),c=i.computed(()=>n.settings.maxWidths[o.value.netType]),d=i.computed(()=>n.settings.maxHeights[o.value.netType]-l.value),h=(m,f)=>{m&&m in o.value&&(o.value[m]=f??0),r("update:params",o.value),u("configuratorParams",o.value)},u=(m,f)=>{const g=new G.CartItemBase(n.value);g[m]=f,r("update:value",g)};return(m,f)=>{const g=V.NInput;return i.openBlock(),i.createBlock(i.unref(V.NForm),{class:"flex flex-col gap-2 px-4 md:max-w-96"},{default:i.withCtx(()=>[i.createVNode(i.unref(V.NFormItem),{required:!0,"show-feedback":!1,label:"Тип сетки"},{default:i.withCtx(()=>[i.createVNode(i.unref(V.NSelect),{value:o.value.netType,"onUpdate:value":[f[0]||(f[0]=p=>o.value.netType=p),h],options:t.settings.netType.map(p=>({label:t.settings.descriptions.net_type[p],value:p}))},null,8,["value","options"])]),_:1}),i.createVNode(i.unref(V.NFormItem),{required:!0,"show-feedback":!1,label:"Цвет профиля"},{default:i.withCtx(()=>[i.createVNode(i.unref(V.NSelect),{value:o.value.color,"onUpdate:value":f[1]||(f[1]=p=>o.value.color=p),options:t.settings.color.map(p=>({label:t.settings.descriptions.color[p],value:p}))},null,8,["value","options"])]),_:1}),i.createVNode(i.unref(V.NFormItem),{required:!0,"show-feedback":!1,label:"Вид крепления"},{default:i.withCtx(()=>[i.createVNode(i.unref(V.NSelect),{value:o.value.mountType,"onUpdate:value":[f[2]||(f[2]=p=>o.value.mountType=p),h],options:t.settings.mountType.map(p=>({label:t.settings.descriptions.mount_type[p],value:p}))},null,8,["value","options"])]),_:1}),i.createVNode(i.unref(V.NFormItem),{required:!0,feedback:t.validation.width.feedback||"","show-feedback":t.validation.width.showFeedback||o.value.width>=t.settings.minWidth&&o.value.width<=t.settings.maxWidths[o.value.netType],"validation-status":t.validation.width.validationStatus||void 0,label:`Ширина светового проёма от ${t.settings.minWidth-a.value} ${c.value?" до "+c.value:""} мм.`},{feedback:i.withCtx(()=>[!t.validation.width.showFeedback&&o.value.width>=t.settings.minWidth&&o.value.width<=t.settings.maxWidths[o.value.netType]?(i.openBlock(),i.createElementBlock("div",Np,[i.createVNode(i.unref(V.NText),{type:"success"},{default:i.withCtx(()=>[i.createTextVNode("Ширина готового изделия "+i.toDisplayString(o.value.width+a.value),1)]),_:1}),i.createVNode(i.unref(V.NButton),{quaternary:"",type:"info",size:"tiny",onClick:f[4]||(f[4]=p=>r("click:instructions-toggle"))},{default:i.withCtx(()=>[...f[11]||(f[11]=[i.createElementVNode("span",{class:"text-sm"},"Руководство",-1)])]),_:1})])):i.createCommentVNode("",!0)]),default:i.withCtx(()=>[i.createVNode(zi,{value:o.value.width&&o.value.width-a.value,max:c.value,min:t.settings.minWidth-a.value,placeholder:"Введите ширину светового проёма",class:"w-full","onUpdate:value":f[3]||(f[3]=p=>h("width",(p&&p+a.value)??void 0))},null,8,["value","max","min"])]),_:1},8,["feedback","show-feedback","validation-status","label"]),i.createVNode(i.unref(V.NFormItem),{required:!0,feedback:t.validation.height.feedback||"","show-feedback":t.validation.height.showFeedback||o.value.height>=t.settings.minHeight&&o.value.height<=t.settings.maxHeights[o.value.netType],"validation-status":t.validation.height.validationStatus||void 0,label:`Высота светового проёма от ${t.settings.minHeight-l.value} ${d.value?" до "+d.value:""} мм.`},{feedback:i.withCtx(()=>[!t.validation.height.showFeedback&&o.value.height>=t.settings.minHeight&&o.value.height<=t.settings.maxHeights[o.value.netType]?(i.openBlock(),i.createElementBlock("div",Pp,[i.createVNode(i.unref(V.NText),{type:"success"},{default:i.withCtx(()=>[i.createTextVNode("Высота готового изделия "+i.toDisplayString(o.value.height+l.value),1)]),_:1}),i.createVNode(i.unref(V.NButton),{quaternary:"",type:"info",size:"tiny",onClick:f[6]||(f[6]=p=>r("click:instructions-toggle"))},{default:i.withCtx(()=>[...f[12]||(f[12]=[i.createElementVNode("span",{class:"text-sm"},"Руководство",-1)])]),_:1})])):i.createCommentVNode("",!0)]),default:i.withCtx(()=>[i.createVNode(zi,{value:o.value.height&&o.value.height-l.value,max:d.value,min:t.settings.minHeight-l.value,placeholder:"Введите высоту светового проёма",class:"w-full","onUpdate:value":f[5]||(f[5]=p=>h("height",(p&&p+l.value)??void 0))},null,8,["value","max","min"])]),_:1},8,["feedback","show-feedback","validation-status","label"]),i.createVNode(i.unref(V.NFormItem),{required:!0,feedback:t.validation.quantity.feedback||"","show-feedback":t.validation.quantity.showFeedback||!1,"validation-status":t.validation.quantity.validationStatus||void 0,label:"Количество"},{default:i.withCtx(()=>[i.createVNode(i.unref(V.NInputNumber),{value:t.value.quantity,"onUpdate:value":f[7]||(f[7]=p=>t.value.quantity=p),min:1,validator:p=>Number.isInteger(p),placeholder:"Введите количество",class:"w-full"},null,8,["value","validator"])]),_:1},8,["feedback","show-feedback","validation-status"]),i.createVNode(i.unref(V.NFormItem),{feedback:t.validation.marker.feedback||"","show-feedback":t.validation.marker.showFeedback||!1,"validation-status":t.validation.marker.validationStatus||void 0,label:"Маркировка"},{default:i.withCtx(()=>[i.createVNode(g,{value:t.value.marker,"onUpdate:value":f[8]||(f[8]=p=>t.value.marker=p),placeholder:"Введите маркировку"},null,8,["value"])]),_:1},8,["feedback","show-feedback","validation-status"]),i.createVNode(tr,{"is-product-searching":t.isProductSearching,product:t.value.product},null,8,["is-product-searching","product"]),i.createElementVNode("div",Fp,[i.createVNode(i.unref(V.NButton),{loading:t.isSubmitProcessing,disabled:t.isProductSearching||!t.value.product||t.value.product.isNewRec()||o.value.width<t.settings.minHeight-l.value||o.value.height<t.settings.minHeight-l.value,type:"primary",class:"self-start",onClick:f[9]||(f[9]=p=>r("submit",t.value))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(t.value.isNewRec()?"В корзину":"Изменить"),1)]),_:1},8,["loading","disabled"]),s.value?(i.openBlock(),i.createBlock(i.unref(V.NButton),{key:0,type:"default",onClick:f[10]||(f[10]=p=>r("click:show-preview-drawer"))},{default:i.withCtx(()=>[...f[13]||(f[13]=[i.createTextVNode(" Предварительный просмотр ",-1)])]),_:1})):i.createCommentVNode("",!0)])]),_:1})}}}),Ap="/img/configurators/mosquitto/measurement-instructions/measurement-height.png",Op="/img/configurators/mosquitto/measurement-instructions/measurement-width.png",Vp="/img/configurators/mosquitto/measurement-instructions/mount.png",Ip="/img/configurators/mosquitto/measurement-instructions/mount-z-plastic.png",zp="/img/configurators/mosquitto/measurement-instructions/mount-z-metal.png",Lp={class:"flex flex-col gap-6"},Dp={class:"flex gap-4"},Hp={class:"flex flex-col gap-2"},Wp={class:"flex gap-4"},jp={class:"flex flex-col gap-2"},qp={class:"flex gap-4"},Xp={class:"flex flex-col gap-2"},Yp={},hd=i.defineComponent({...Yp,__name:"mosquito-configurator-measurement-instructions",props:{heightOverlaps:{},widthOverlaps:{},show:{type:Boolean}},emits:["update:show"],setup(t,{emit:e}){const n=_t.initRefDependingOnDeviceResolution("small","small","medium"),r=_t.initRefDependingOnDeviceResolution(.98,.95,.8),s=i.computed(()=>window.innerWidth*r.value),o=e;return(a,l)=>{const c=V.NText;return i.openBlock(),i.createBlock(i.unref(V.NModal),{show:t.show,"show-icon":!1,size:i.unref(n),style:i.normalizeStyle(`width: ${s.value}px`),title:"Руководство по замеру","action-class":"grid grid-cols-2 !justify-between",preset:"dialog",onClose:l[0]||(l[0]=d=>o("update:show",!1)),onEsc:l[1]||(l[1]=d=>o("update:show",!1)),onMaskClick:l[2]||(l[2]=d=>o("update:show",!1))},{default:i.withCtx(()=>[i.createElementVNode("div",Lp,[i.createVNode(c,{type:"error",class:"text-base font-medium"},{default:i.withCtx(()=>[...l[3]||(l[3]=[i.createTextVNode(" Важно! Для того,что бы произвести замер, необходимо открыть оконную створку. ",-1)])]),_:1}),l[22]||(l[22]=i.createElementVNode("div",{class:"grid gap-6 md:grid-cols-2"},[i.createElementVNode("div",{class:"flex items-start gap-4"},[i.createElementVNode("img",{src:Ap,alt:"measurement-height",class:"w-[7.5rem]"}),i.createElementVNode("div",{class:"flex flex-col gap-2"},[i.createElementVNode("span",{class:"text-lg font-bold"},"Замер ширины"),i.createElementVNode("span",null,"Замерить по ширине световой проем оконной рамы. Размер учитывать c точностью до 1 мм")])]),i.createElementVNode("div",{class:"flex items-start gap-4"},[i.createElementVNode("img",{src:Op,alt:"measurement-height",class:"w-[7.5rem]"}),i.createElementVNode("div",{class:"flex flex-col gap-2"},[i.createElementVNode("span",{class:"text-lg font-bold"},"Замер высоты"),i.createElementVNode("span",null,"Замерить по высоте световой проем оконной рамы. Размер учитывать с точностью до 1 мм")])])],-1)),i.createElementVNode("div",Dp,[l[9]||(l[9]=i.createElementVNode("img",{src:Vp,alt:"measurement-height",class:"w-[7.5rem]"},null,-1)),i.createElementVNode("div",Hp,[l[8]||(l[8]=i.createElementVNode("span",{class:"text-lg font-bold"},"Крепление на раме сетки",-1)),i.createElementVNode("span",null,[l[4]||(l[4]=i.createTextVNode(" Расчетные размеры москитной сетки: ",-1)),l[5]||(l[5]=i.createElementVNode("br",null,null,-1)),i.createTextVNode(" Ширина светового проема +"+i.toDisplayString(t.widthOverlaps.frame)+" мм. Высота светового проема +"+i.toDisplayString(t.heightOverlaps.frame)+" мм. ",1),l[6]||(l[6]=i.createElementVNode("br",null,null,-1)),l[7]||(l[7]=i.createTextVNode(" Крепления находятся на раме сетки. ",-1))])])]),i.createElementVNode("div",Wp,[l[15]||(l[15]=i.createElementVNode("img",{src:Ip,alt:"measurement-height",class:"w-[7.5rem]"},null,-1)),i.createElementVNode("div",jp,[l[14]||(l[14]=i.createElementVNode("span",{class:"text-lg font-bold"},"Z-Образное крепление пластик (верх+низ)",-1)),i.createElementVNode("span",null,[l[10]||(l[10]=i.createTextVNode(" Расчетные размеры москитной сетки:",-1)),l[11]||(l[11]=i.createElementVNode("br",null,null,-1)),i.createTextVNode(" Ширина светового проема +"+i.toDisplayString(t.widthOverlaps.external_plastic)+" мм. Высота светового проема +"+i.toDisplayString(t.heightOverlaps.external_plastic)+" мм. ",1),l[12]||(l[12]=i.createElementVNode("br",null,null,-1)),l[13]||(l[13]=i.createTextVNode(" Крепления прикручиваются к раме окна c помощью шурупов. ",-1))])])]),i.createElementVNode("div",qp,[l[21]||(l[21]=i.createElementVNode("img",{src:zp,alt:"measurement-height",class:"w-[7.5rem]"},null,-1)),i.createElementVNode("div",Xp,[l[20]||(l[20]=i.createElementVNode("span",{class:"text-lg font-bold"},"Z-Образное крепление металл (верх+низ)",-1)),i.createElementVNode("span",null,[l[16]||(l[16]=i.createTextVNode(" Расчетные размеры москитной сетки: ",-1)),l[17]||(l[17]=i.createElementVNode("br",null,null,-1)),i.createTextVNode(" Ширина светового проема +"+i.toDisplayString(t.widthOverlaps.external_metal)+" мм. Высота светового проема +"+i.toDisplayString(t.heightOverlaps.external_metal)+" мм. ",1),l[18]||(l[18]=i.createElementVNode("br",null,null,-1)),l[19]||(l[19]=i.createTextVNode(" Крепления прикручиваются к раме окна c помощью шурупов. ",-1))])])])])]),_:1},8,["show","size","style"])}}}),Up={class:"flex flex-col items-center justify-between rounded-xl"},Gp={class:"img-preview relative flex justify-center"},Kp={},Zp=i.defineComponent({...Kp,__name:"mosquito-configurator-preview",props:{configuratorParams:{},settings:{}},emits:["open-instructions"],setup(t,{emit:e}){const n=t,r=i.computed(()=>A.keys(n.settings.crossbarCount).find(o=>n.settings.crossbarCount[Number(o)]&&(!n.settings.crossbarCount[Number(o)+1]||n.configuratorParams.height<n.settings.crossbarCount[Number(o)+1]-n.settings.heightOverlaps[n.configuratorParams.mountType]))),s=e;return(o,a)=>{const l=V.NButton;return i.openBlock(),i.createElementBlock("div",Up,[i.createElementVNode("div",Gp,[a[1]||(a[1]=i.createElementVNode("div",{class:"window"},null,-1)),i.createElementVNode("div",{class:i.normalizeClass(["net",`net-${t.configuratorParams.netType}`])},null,2),i.createElementVNode("div",{class:i.normalizeClass(["frame",`frame-${t.configuratorParams.color}`])},null,2),r.value?(i.openBlock(),i.createElementBlock("div",{key:0,class:i.normalizeClass(["frame-crossbar",`frame-crossbar-${r.value}-${t.configuratorParams.color}`])},null,2)):i.createCommentVNode("",!0),i.createElementVNode("div",{class:i.normalizeClass(["mount",`mount-${t.configuratorParams.mountType}-${t.configuratorParams.color}`])},null,2),i.createElementVNode("div",{class:i.normalizeClass(["cut-preview",`cut-preview-${t.configuratorParams.mountType}-${t.configuratorParams.color}`])},null,2)]),i.createVNode(l,{type:"primary",class:"block justify-self-center",onClick:a[0]||(a[0]=c=>s("open-instructions"))},{default:i.withCtx(()=>[...a[2]||(a[2]=[i.createTextVNode(" Руководство по замеру ",-1)])]),_:1})])}}}),Eo=Kn(Zp,[["__scopeId","data-v-8b43aa68"]]),Jp={class:"grid md:grid-cols-2"},Qp={},ud=i.defineComponent({...Qp,__name:"mosquito-configurator",props:{settings:{},cartItem:{}},emits:["submit"],setup(t,{emit:e}){const n=t,r=e,s=i.computed(()=>_t.isPhoneDevice()),o=i.ref(!1),a=i.ref(!1),l=i.ref(n.cartItem),c=i.ref({width:{},height:{},quantity:{},marker:{}}),d=i.ref(!1),h=i.ref(!1),u=async f=>{f.height>0&&f.width>0&&(d.value=!0,await G.HttpRequester.getInstance(G.ConfiguratorProvider).searchProduct(n.cartItem.category,f,c.value).then(g=>{l.value.product=g}).catch(()=>{d.value=!1}),d.value=!1)},m=()=>{h.value=!0,r("submit",l.value,c.value,()=>{h.value=!1})};return(f,g)=>{const p=ss;return i.openBlock(),i.createElementBlock(i.Fragment,null,[i.createVNode(hd,{show:a.value,"onUpdate:show":g[0]||(g[0]=b=>a.value=b),"height-overlaps":t.settings.heightOverlaps,"width-overlaps":t.settings.widthOverlaps},null,8,["show","height-overlaps","width-overlaps"]),i.createElementVNode("div",Jp,[s.value?(i.openBlock(),i.createBlock(i.unref(V.NDrawer),{key:1,show:o.value,"onUpdate:show":g[4]||(g[4]=b=>o.value=b),"default-width":375,resizable:""},{default:i.withCtx(()=>[i.createVNode(i.unref(V.NDrawerContent),null,{header:i.withCtx(()=>[i.createVNode(i.unref(V.NButton),{size:"small",type:"primary",class:"block justify-self-end",onClick:g[2]||(g[2]=b=>o.value=!1)},{default:i.withCtx(()=>[i.createVNode(p)]),_:1})]),default:i.withCtx(()=>[i.createVNode(Eo,{"configurator-params":l.value.configuratorParams,settings:t.settings,onOpenInstructions:g[3]||(g[3]=b=>a.value=!0)},null,8,["configurator-params","settings"])]),_:1})]),_:1},8,["show"])):(i.openBlock(),i.createBlock(Eo,{key:0,"configurator-params":l.value.configuratorParams,settings:t.settings,onOpenInstructions:g[1]||(g[1]=b=>a.value=!0)},null,8,["configurator-params","settings"])),i.createVNode(dd,{value:l.value,"onUpdate:value":g[5]||(g[5]=b=>l.value=b),validation:c.value,settings:t.settings,"is-product-searching":d.value,"is-submit-processing":h.value,"onUpdate:params":g[6]||(g[6]=b=>u(b)),onSubmit:g[7]||(g[7]=b=>m()),"onClick:instructionsToggle":g[8]||(g[8]=b=>a.value=!a.value),"onClick:showPreviewDrawer":g[9]||(g[9]=b=>o.value=!0)},null,8,["value","validation","settings","is-product-searching","is-submit-processing"])])],64)}}}),e0={},fd=i.defineComponent({...e0,__name:"strip-configurator-line-item",props:{value:{},index:{},settings:{},product:{default:void 0},addLineButtonDisabled:{type:Boolean,default:!1},removeLineButtonDisabled:{type:Boolean,default:!1},suggestionOption:{default:void 0},autoFocus:{type:Boolean,default:!1},validation:{default:()=>({})}},emits:["update:value","click:add-line","click:remove-line"],setup(t,{expose:e,emit:n}){const r=t,s=n,o=i.useTemplateRef("width-input-element"),a=i.ref(!1),l=d=>{s("update:value",d??0,r.index,a)};i.onMounted(()=>{r.autoFocus&&i.nextTick(()=>{c()})});const c=()=>{var d;(d=o.value)==null||d.select()};return e({focusWidthInput:c}),(d,h)=>{const u=Ya,m=Xa;return i.openBlock(),i.createBlock(i.unref(V.NFormItem),{label:`Полоса №${t.index+1}, мм`,required:!0},{feedback:i.withCtx(()=>[i.createVNode(tr,{"is-product-searching":a.value,product:t.product},null,8,["is-product-searching","product"])]),default:i.withCtx(()=>[i.createVNode(i.unref(V.NDropdown),{trigger:"click",options:t.suggestionOption,placement:"bottom-start",size:"large",onSelect:l},{default:i.withCtx(()=>[i.createVNode(zi,{ref:"width-input-element",value:t.value,class:"w-full",step:t.value<t.settings.minLineWidth?t.settings.minLineWidth-t.value:t.settings.lineWidthStep,validator:f=>!!f&&f>=t.settings.minLineWidth&&f%t.settings.lineWidthStep===0,placeholder:"Введите ширину","onUpdate:value":l},null,8,["value","step","validator"])]),_:1},8,["options"]),i.createVNode(i.unref(V.NButton),{disabled:t.addLineButtonDisabled,size:"medium",class:"ml-2",onClick:h[0]||(h[0]=f=>s("click:add-line",t.index))},{default:i.withCtx(()=>[i.createVNode(u)]),_:1},8,["disabled"]),i.createVNode(i.unref(V.NButton),{disabled:t.removeLineButtonDisabled,size:"medium",class:"ml-2",onClick:h[1]||(h[1]=f=>s("click:remove-line",t.index))},{default:i.withCtx(()=>[i.createVNode(m)]),_:1},8,["disabled"])]),_:1},8,["label"])}}}),t0={class:"my-2 flex w-full flex-col"},n0={class:"flex gap-3"},i0={},gd=i.defineComponent({...i0,__name:"strip-configurator-form",props:{value:{},settings:{},isSubmitProcessing:{type:Boolean,default:!1},validation:{default:void 0}},emits:["update:value","update:params","click:view-switch","submit","click:add-line","click:remove-line"],setup(t,{emit:e}){const n=t,r=e,s=i.computed(()=>n.value[0].configuratorParams.linesWidths.map(h=>h).reduce((h,u)=>h+u,0)),o=i.computed(()=>n.settings.width-s.value),a=i.computed(()=>!n.value.some(({product:h})=>!h)),l=i.computed(()=>o.value===0?void 0:[{label:`${(o.value>0?"Остаток +":"Излишек ")+o.value} мм.`,key:o.value}]),c=(h,u,m)=>{const f=n.value.at(u);if(f)if(h&&h>=n.settings.minLineWidth&&h%n.settings.lineWidthStep===0){const g={linesWidths:f.configuratorParams.linesWidths.toSpliced(u,1,h)};r("update:params",g,u,m),d("configuratorParams",g)}else f.product.id=-1},d=(h,u)=>{const m=n.value.map(f=>new G.CartItemBase(f));m.forEach(f=>{f[h]=u}),r("update:value",m)};return(h,u)=>{const m=V.NText,f=V.NInput;return i.openBlock(),i.createBlock(i.unref(V.NForm),{class:"flex flex-col gap-2"},{default:i.withCtx(()=>{var g;return[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(t.value,(p,b)=>(i.openBlock(),i.createBlock(fd,{key:b,"auto-focus":!0,index:b,value:p.configuratorParams.linesWidths.at(b)??0,product:p.product,settings:t.settings,"suggestion-option":l.value,"add-line-button-disabled":o.value<=0||t.value.length>=t.settings.maxLinesCount,"remove-line-button-disabled":t.value.length===1,"onUpdate:value":c,"onClick:addLine":u[0]||(u[0]=y=>r("click:add-line",y)),"onClick:removeLine":u[1]||(u[1]=y=>r("click:remove-line",y))},null,8,["index","value","product","settings","suggestion-option","add-line-button-disabled","remove-line-button-disabled"]))),128)),i.createElementVNode("div",t0,[o.value<0?(i.openBlock(),i.createBlock(m,{key:0,type:"error"},{default:i.withCtx(()=>[i.createTextVNode(" Сумма ширин всех полос должна быть равна "+i.toDisplayString(t.settings.width),1)]),_:1})):i.createCommentVNode("",!0),a.value&&t.value.length===t.settings.maxLinesCount&&o.value>0?(i.openBlock(),i.createBlock(m,{key:1,type:"error"},{default:i.withCtx(()=>[...u[8]||(u[8]=[i.createTextVNode(" Остаток резки должен быть равен 0 ",-1)])]),_:1})):i.createCommentVNode("",!0),i.createElementVNode("div",null,[u[9]||(u[9]=i.createTextVNode(" Остаток для резки: ",-1)),i.createVNode(m,{type:o.value>=0?"Success":"error"},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(o.value),1)]),_:1},8,["type"]),i.createTextVNode(" из "+i.toDisplayString(t.settings.width)+" мм ",1)])]),i.createVNode(i.unref(V.NButton),{loading:t.isSubmitProcessing,disabled:!a.value||o.value<=0||t.value.length>=t.settings.maxLinesCount,type:"primary",class:"self-center",onClick:u[2]||(u[2]=p=>r("click:add-line",t.value.length))},{default:i.withCtx(()=>[...u[10]||(u[10]=[i.createTextVNode(" Добавить полосу ",-1)])]),_:1},8,["loading","disabled"]),i.createVNode(i.unref(V.NFormItem),{required:!0,label:`Метраж ${t.settings.minLength?" от "+t.settings.minLength:""} ${t.settings.maxLength?" до "+t.settings.maxLength:""} м.`},{default:i.withCtx(()=>[i.createVNode(i.unref(V.NInputNumber),{value:n.value[0].length,max:t.settings.maxLength||void 0,min:t.settings.minLength,step:t.settings.lengthStep,validator:p=>p%t.settings.lengthStep===0,placeholder:"Введите метраж",class:"w-full","onUpdate:value":u[3]||(u[3]=p=>d("length",p??0))},null,8,["value","max","min","step","validator"])]),_:1},8,["label"]),i.createVNode(i.unref(V.NFormItem),{required:!0,label:"Количество"},{default:i.withCtx(()=>[i.createVNode(i.unref(V.NInputNumber),{value:n.value[0].quantity,min:1,validator:p=>Number.isInteger(p),placeholder:"Введите количество",class:"w-full","onUpdate:value":u[4]||(u[4]=p=>d("quantity",p??0))},null,8,["value","validator"])]),_:1}),i.createVNode(i.unref(V.NFormItem),{label:"Маркировка"},{default:i.withCtx(()=>[i.createVNode(f,{value:n.value[0].marker,placeholder:"Введите маркировку","onUpdate:value":u[5]||(u[5]=p=>d("marker",p))},null,8,["value"])]),_:1}),i.createElementVNode("div",n0,[i.createVNode(i.unref(V.NButton),{loading:t.isSubmitProcessing,disabled:!a.value||o.value!=0||!((g=t.value[0])!=null&&g.length)||t.value[0].length>t.settings.maxLength||t.value[0].length<t.settings.minLength||t.value[0].quantity===0,type:"primary",class:"self-start",onClick:u[6]||(u[6]=p=>r("submit",t.value))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(t.value[0].isNewRec()?"В корзину":"Изменить"),1)]),_:1},8,["loading","disabled"]),t.settings.allowShowTable?(i.openBlock(),i.createBlock(i.unref(V.NButton),{key:0,type:"tertiary",class:"self-start",onClick:u[7]||(u[7]=p=>r("click:view-switch"))},{default:i.withCtx(()=>[...u[11]||(u[11]=[i.createTextVNode(" Показать в виде списка ",-1)])]),_:1})):i.createCommentVNode("",!0)])]}),_:1})}}}),r0={class:"flex grow flex-col"},s0=["src"],o0={class:"w-full"},a0={},md=i.defineComponent({...a0,__name:"strip-configurator-preview",props:{value:{},settings:{}},setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock("div",r0,[i.createElementVNode("img",{src:"/img/configurators/strip/strip-"+t.value.length+".png",class:"w-full max-w-96 self-center",alt:"Штрипс"},null,8,s0),i.createElementVNode("div",o0,[i.createTextVNode(" Число полос можно указать от "+i.toDisplayString(t.settings.minLinesCount)+" до "+i.toDisplayString(t.settings.maxLinesCount)+". ",1),n[0]||(n[0]=i.createElementVNode("br",null,null,-1)),i.createTextVNode(" Минимальная ширина полосы "+i.toDisplayString(t.settings.minLineWidth)+" мм. ",1),n[1]||(n[1]=i.createElementVNode("br",null,null,-1)),i.createTextVNode(" Ширина всех полос "+i.toDisplayString(t.settings.width)+" мм. ",1),n[2]||(n[2]=i.createElementVNode("br",null,null,-1)),i.createTextVNode(" Шаг ширины полосы - "+i.toDisplayString(t.settings.lineWidthStep)+" мм. ",1)])]))}}),l0={class:"w-104 flex grow flex-col px-5"},c0={},pd=i.defineComponent({...c0,__name:"strip-configurator",props:{settings:{},cartItems:{}},emits:["submit"],setup(t,{emit:e}){const n=t,r=e,s=i.ref(n.cartItems),o=i.ref({width:{},length:{},quantity:{},marker:{}}),a=i.ref(!1),l=i.computed(()=>s.value[0].configuratorParams.linesWidths.map(m=>m).reduce((m,f)=>m+f,0)),c=m=>{m===void 0&&(m=s.value.length-1);const f=s.value.at(0);if(!f)return;f.configuratorParams.linesWidths=f.configuratorParams.linesWidths.toSpliced(m+1,0,0),s.value.forEach(p=>{p.configuratorParams.linesWidths=f.configuratorParams.linesWidths});const g=new G.CartItemBase({quantity:(f==null?void 0:f.quantity)??1,category:f==null?void 0:f.category,length:(f==null?void 0:f.length)??n.settings.minLength,marker:f==null?void 0:f.marker,configuratorParams:{linesWidths:f==null?void 0:f.configuratorParams.linesWidths}});s.value=s.value.toSpliced(m+1,0,g)},d=m=>{const f=s.value.at(0);f&&(f.configuratorParams.linesWidths=f.configuratorParams.linesWidths.toSpliced(m,1),s.value.forEach(g=>{g.configuratorParams.linesWidths=f.configuratorParams.linesWidths}),s.value=s.value.toSpliced(m,1),delete o[`linesWidths.${m}`],delete o[`linesWidths.${m}`])},h=async(m,f,g)=>{g.value=!0,await G.HttpRequester.getInstance(G.ConfiguratorProvider).searchProduct(s.value[f].category,{linesWidths:m.linesWidths.at(f)},o.value).then(p=>{s.value[f].product=p,s.value.length<n.settings.maxLinesCount&&l.value<n.settings.width&&c()}).catch(()=>{s.value[f].product=new G.Product,g.value=!1}),g.value=!1},u=()=>{a.value=!0,r("submit",s.value,o.value,()=>{a.value=!1})};return(m,f)=>(i.openBlock(),i.createElementBlock("div",l0,[i.createVNode(md,{value:s.value,"onUpdate:value":f[0]||(f[0]=g=>s.value=g),settings:t.settings},null,8,["value","settings"]),i.createVNode(gd,{value:s.value,"onUpdate:value":f[1]||(f[1]=g=>s.value=g),validation:o.value,settings:t.settings,"is-submit-processing":a.value,"onUpdate:params":h,onSubmit:u,"onClick:addLine":c,"onClick:removeLine":d},null,8,["value","validation","settings","is-submit-processing"])]))}}),d0={class:"flex flex-col gap-3"},h0={},yd=i.defineComponent({...h0,__name:"metal-for-doors-configurator-form",props:{value:{},settings:{},isProductSearching:{type:Boolean,default:!1},isSubmitProcessing:{type:Boolean,default:!1},validation:{default:void 0}},emits:["update:value","update:params","click:view-switch","submit"],setup(t,{emit:e}){const n=t,r=e,s=i.useTemplateRef("first-input-element"),o=i.ref(A.cloneDeep(i.toRaw(n.value.configuratorParams))),a=()=>{o.value.length>0&&o.value.width>0&&(r("update:params",o.value),l("configuratorParams",o.value))},l=(c,d)=>{const h=new G.CartItemBase(n.value);h[c]=d,r("update:value",h)};return i.onMounted(()=>{n.value.isNewRec()&&i.nextTick(()=>{var c;(c=s.value)==null||c.focus()})}),(c,d)=>{const h=V.NInput;return i.openBlock(),i.createBlock(i.unref(V.NForm),{disabled:t.isSubmitProcessing,class:"flex flex-col gap-2"},{default:i.withCtx(()=>[i.createVNode(i.unref(V.NFormItem),{required:!0,feedback:t.validation.width.feedback||"","show-feedback":t.validation.width.showFeedback||!1,"validation-status":t.validation.width.validationStatus||void 0,label:`Ширина, ${t.settings.minWidth?" от "+t.settings.minWidth:""}${t.settings.maxWidth?" до "+t.settings.maxWidth:""} мм`},{default:i.withCtx(()=>[i.createVNode(zi,{ref:"first-input-element",value:o.value.width,"onUpdate:value":[d[0]||(d[0]=u=>o.value.width=u),a],class:"w-full",max:t.settings.maxWidth??void 0,min:t.settings.minWidth,validator:u=>!!u&&u>=t.settings.minWidth&&(!t.settings.maxWidth||u<=t.settings.maxWidth),placeholder:"Введите ширину"},null,8,["value","max","min","validator"])]),_:1},8,["feedback","show-feedback","validation-status","label"]),i.createVNode(i.unref(V.NFormItem),{required:!0,feedback:t.validation.length.feedback||"","show-feedback":t.validation.length.showFeedback||!1,"validation-status":t.validation.length.validationStatus||void 0,label:`Длина, ${t.settings.minLength?" от "+t.settings.minLength:""}${t.settings.maxLength?" до "+t.settings.maxLength:""} мм`},{default:i.withCtx(()=>[i.createVNode(zi,{value:o.value.length,"onUpdate:value":[d[1]||(d[1]=u=>o.value.length=u),a],placeholder:"Введите длину",max:t.settings.maxLength,min:t.settings.minLength,validator:u=>u>=t.settings.minLength&&u<=t.settings.maxLength,class:"w-full"},null,8,["value","max","min","validator"])]),_:1},8,["feedback","show-feedback","validation-status","label"]),i.createVNode(i.unref(V.NFormItem),{required:!0,feedback:t.validation.quantity.feedback||"","show-feedback":t.validation.quantity.showFeedback||!1,"validation-status":t.validation.quantity.validationStatus||void 0,label:"Количество"},{default:i.withCtx(()=>[i.createVNode(i.unref(V.NInputNumber),{value:t.value.quantity,placeholder:"Введите количество",min:1,validator:u=>u>0,class:"w-full","onUpdate:value":d[2]||(d[2]=u=>l("quantity",u??0))},null,8,["value","validator"])]),_:1},8,["feedback","show-feedback","validation-status"]),i.createVNode(i.unref(V.NFormItem),{feedback:t.validation.marker.feedback||"","show-feedback":t.validation.marker.showFeedback||!1,"validation-status":t.validation.marker.validationStatus||void 0,label:"Маркировка"},{default:i.withCtx(()=>[i.createVNode(h,{value:t.value.marker,placeholder:"Введите маркировку","onUpdate:value":d[3]||(d[3]=u=>l("marker",u))},null,8,["value"])]),_:1},8,["feedback","show-feedback","validation-status"]),i.createVNode(tr,{"is-product-searching":t.isProductSearching,product:t.value.product},null,8,["is-product-searching","product"]),i.createElementVNode("div",d0,[i.createVNode(i.unref(V.NButton),{disabled:t.value.product.isNewRec()||t.isProductSearching||t.isSubmitProcessing||t.value.length===0||t.value.width===0||t.value.quantity===0,type:"primary",class:"self-start",onClick:d[4]||(d[4]=u=>r("submit",t.value))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(t.value.isNewRec()?"В корзину":"Изменить"),1)]),_:1},8,["disabled"]),t.settings.allowShowTable?(i.openBlock(),i.createBlock(i.unref(V.NButton),{key:0,type:"tertiary",class:"self-start",onClick:d[5]||(d[5]=u=>r("click:view-switch"))},{default:i.withCtx(()=>[...d[6]||(d[6]=[i.createTextVNode(" Показать в виде списка ",-1)])]),_:1})):i.createCommentVNode("",!0)])]),_:1},8,["disabled"])}}}),u0={class:"w-104 px-5"},f0={},bd=i.defineComponent({...f0,__name:"metal-for-doors-configurator",props:{settings:{},cartItem:{}},emits:["submit"],setup(t,{emit:e}){const n=t,r=e,s=i.ref(n.cartItem),o=i.ref({width:{},length:{},quantity:{},marker:{}}),a=i.ref(!1),l=i.ref(!1),c=async h=>{a.value=!0,await G.HttpRequester.getInstance(G.ConfiguratorProvider).searchProduct(n.cartItem.category,h,o.value).then(u=>{s.value.product=u}).catch(()=>{a.value=!1}),a.value=!1},d=()=>{l.value=!0,r("submit",s.value,o.value,()=>{l.value=!1})};return(h,u)=>(i.openBlock(),i.createElementBlock("div",u0,[i.createVNode(yd,{value:s.value,"onUpdate:value":u[0]||(u[0]=m=>s.value=m),validation:o.value,settings:t.settings,"is-submit-processing":l.value,"onUpdate:params":u[1]||(u[1]=m=>c(m)),onSubmit:u[2]||(u[2]=m=>d())},null,8,["value","validation","settings","is-submit-processing"])]))}});class Li extends G.Identity{constructor(n,r){super();x(this,"label","");x(this,"points",[]);x(this,"isCustom",!1);x(this,"id",-1);x(this,"guid","");n?(this.label=n.label,this.points=n.points.map((s,o)=>A.isArray(s)?new ii(s[0],s[1],`A-${o+1}`):new ii(s.width,s.angle,`A-${o+1}`))):(this.label="-- Новая конфигурация --",this.points=[new ii(0,0,"A-1")],this.isCustom=!0,this.id=r??this.id)}}class No extends Li{constructor(n){super(n);x(this,"isDefault");this.isDefault=n.isDefault??!1}}class _d{constructor(e){x(this,"minLineWidth");x(this,"maxLineWidth");x(this,"lineWidthStep");x(this,"minLineAngle");x(this,"maxLineAngle");x(this,"lineAngleStep");x(this,"stripMinWidth");x(this,"stripMaxWidth");x(this,"stripMinLength");x(this,"stripMaxLength");x(this,"allowShowTable");x(this,"showOnlyTemplates");x(this,"templates");x(this,"customTemplates",[]);x(this,"startTailConfigs");x(this,"endTailConfigs");x(this,"bendCountForExtended");x(this,"extendedProductCatalog");x(this,"allowChangeFirstPoint");x(this,"allowSaveTemplates");x(this,"userTemplatesPrefix");x(this,"lengthStep");var n,r;this.minLineWidth=e.minLineWidth,this.maxLineWidth=e.maxLineWidth,this.lineWidthStep=e.lineWidthStep,this.minLineAngle=e.minLineAngle,this.maxLineAngle=e.maxLineAngle,this.lineAngleStep=e.lineAngleStep,this.stripMinWidth=e.stripMinWidth,this.stripMaxWidth=e.stripMaxWidth,this.stripMinLength=e.stripMinLength,this.stripMaxLength=e.stripMaxLength,this.allowShowTable=e.allowShowTable,this.showOnlyTemplates=e.showOnlyTemplates,this.templates=e.templates.map(s=>new Li(s)),this.templates.forEach((s,o)=>{s.id=o}),this.startTailConfigs=((n=e.startTailConfigs)==null?void 0:n.map(s=>new No(s)))??[],this.endTailConfigs=((r=e.endTailConfigs)==null?void 0:r.map(s=>new No(s)))??[],this.bendCountForExtended=e.bendCountForExtended,this.extendedProductCatalog=e.extendedProductCatalog,this.allowChangeFirstPoint=e.allowChangeFirstPoint,this.allowSaveTemplates=e.allowSaveTemplates,this.userTemplatesPrefix=e.userTemplatesPrefix,this.lengthStep=e.lengthStep,this.showOnlyTemplates||(this.customTemplates=e.customTemplates?Object.entries(e.customTemplates).map(([s,o])=>{const a=new Li(o);return a.isCustom=!0,a.id=+s,a}):[],this.customTemplates.push(new Li))}get allTemplates(){return[...this.templates,...this.customTemplates]}addCustomTemplate(e){var r,s;if(!this.allowSaveTemplates)return;const n=new Li(e);n.isCustom=!0,n.id=(((r=this.customTemplates.at(-1))==null?void 0:r.id)??((s=this.templates.at(-1))==null?void 0:s.id)??0)+1,this.customTemplates.splice(-1,0,n)}removeCustomTemplate(e){if(this.allowSaveTemplates)return;const n=this.customTemplates.findIndex(r=>r.id===e);n&&n!==-1&&this.customTemplates.splice(n,1)}}class g0{constructor(e){x(this,"minHeight");x(this,"maxHeights");x(this,"minWidth");x(this,"maxWidths");x(this,"netType");x(this,"color");x(this,"mountType");x(this,"descriptions");x(this,"crossbarCount");x(this,"heightOverlaps");x(this,"widthOverlaps");this.color=e.color,this.crossbarCount=e.crossbarCount,this.descriptions=Ps.objectToSnake(e.descriptions),this.maxHeights=e.maxHeights,this.maxWidths=e.maxWidths,this.minHeight=e.minHeight,this.minWidth=e.minWidth,this.mountType=e.mountType,this.netType=e.netType,this.heightOverlaps=Ps.objectToSnake(e.heightOverlaps),this.widthOverlaps=Ps.objectToSnake(e.widthOverlaps)}}const m0={key:0,class:"flex justify-center p-4"},p0={key:1,class:"p-4 text-center text-red-500"},y0={key:2,class:"!bg-white p-4 m-2 rounded-md justify-self-center"},b0={key:3,class:"p-4 text-center text-gray-500"},wd=i.defineComponent({__name:"dynamic-configurator",props:{eventEmitter:{},category:{}},emits:["submit"],setup(t,{emit:e}){const n=t,r=e,s=i.ref(!1),o=i.ref(null),a=i.ref(null),l=i.computed(()=>{var f;return(f=n.category.properties)==null?void 0:f.configurator}),c=i.ref(null),d=i.ref(null),h=f=>{var p,b;const g={category:n.category,configurator:l.value,quantity:1};switch(l.value){case"kozyrek":{const y=f;c.value=new G.CartItemBase({...g,configuratorParams:{length:y.stripMinLength,linesAngles:[],linesWidths:[],startTailType:A.some(y.startTailConfigs,_=>_.isDefault)?(p=y.startTailConfigs)==null?void 0:p.findIndex(_=>_.isDefault):void 0,endTailType:A.some(y.endTailConfigs,_=>_.isDefault)?(b=y.endTailConfigs)==null?void 0:b.findIndex(_=>_.isDefault):void 0,colorSide:"top"}});break}case"mosquitto":{const y=f;c.value=new G.CartItemBase({...g,configuratorParams:{width:0,height:0,netType:y.netType[0]||"",color:y.color[0]||"",mountType:y.mountType[0]||""}});break}case"strip":{d.value=[new G.CartItemBase({...g,configuratorParams:{linesWidths:[0]}})];break}case"metal_for_doors":{const y=f;c.value=new G.CartItemBase({...g,configuratorParams:{width:y.minWidth,length:y.minLength}});break}default:o.value=`Неподдерживаемый тип конфигуратора: ${l.value}.`}},u=async()=>{var f;if(!l.value){o.value="Тип конфигуратора не указан в свойствах категории.";return}s.value=!0,o.value=null;try{const p=await G.HttpRequester.getInstance(G.ConfiguratorProvider).getConfiguratorSettings(n.category);switch((f=n.category.properties)==null?void 0:f.configurator){case"kozyrek":a.value=new _d(p);break;case"mosquitto":a.value=new g0(p);break;default:a.value=p;break}h(a.value)}catch(g){"message"in g&&(g.value=`Ошибка при загрузке настроек конфигуратора: ${A.isError(g)?g.message:"Неизвестная ошибка"}.`)}finally{s.value=!1}},m=(f,g,p)=>{r("submit",A.isArray(f)?f[0]:f,g,p)};return i.onMounted(()=>{u()}),(f,g)=>{const p=V.NSpin;return i.openBlock(),i.createElementBlock(i.Fragment,null,[s.value?(i.openBlock(),i.createElementBlock("div",m0,[i.createVNode(p,{size:"large"})])):o.value?(i.openBlock(),i.createElementBlock("div",p0,i.toDisplayString(o.value),1)):i.createCommentVNode("",!0),a.value!==null&&(c.value!==null||d.value!==null)?(i.openBlock(),i.createElementBlock("div",y0,[l.value==="kozyrek"?(i.openBlock(),i.createBlock(cd,{key:0,settings:a.value,"cart-item":c.value,onSubmit:m},null,8,["settings","cart-item"])):l.value==="mosquitto"?(i.openBlock(),i.createBlock(ud,{key:1,settings:a.value,"cart-item":c.value,onSubmit:m},null,8,["settings","cart-item"])):l.value==="strip"?(i.openBlock(),i.createBlock(pd,{key:2,settings:a.value,"cart-items":d.value,onSubmit:m},null,8,["settings","cart-items"])):l.value==="metal_for_doors"?(i.openBlock(),i.createBlock(bd,{key:3,settings:a.value,"cart-item":c.value,onSubmit:m},null,8,["settings","cart-item"])):i.createCommentVNode("",!0)])):(i.openBlock(),i.createElementBlock("div",b0,' Конфигуратор "'+i.toDisplayString(l.value)+'" не поддерживается. ',1))],64)}}}),_0={key:0,class:"pt-0.5"},w0={key:0},x0={class:"line-through"},v0={key:0},k0={key:1},C0={class:"flex flex-row gap-1"},S0={key:0},B0={class:"m-0 list-inside list-disc p-0 pl-1.5 text-xs text-gray-500"},T0={class:"flex flex-col-reverse gap-2.5 sm:flex-row"},R0={},$0=i.defineComponent({...R0,__name:"category-collapse-item",props:{categoryItem:{},filteredItems:{},isCategoryItemSelected:{type:Function,default:void 0},showCategoryHideForClientButton:{type:[Boolean,String,Function],default:!1},showCategoryRequiredButton:{type:[Boolean,String,Function],default:!1},showCategoryPinButton:{type:[Boolean,String,Function],default:!1},showCategoryEditButton:{type:[Boolean,String,Function],default:!1},categoryContextButtonsConfig:{type:Function,default:void 0},showConfigurator:{type:[Boolean,Function],default:!1},eventEmitter:{},showSlugs:{type:Boolean,default:!1},showProperties:{type:Boolean,default:!1},showProductCosts:{type:[Boolean,Function],default:!1},allowNameClick:{type:[Boolean,Function],default:!1},allowPriceClick:{type:[Boolean,Function],default:!1},showPriceHistory:{type:[Boolean,Function],default:!1},showCostDate:{type:[Boolean,Function],default:!1},isProductItemSelected:{type:Function,default:void 0},showProductAddToCartButton:{type:[Boolean,String,Function],default:!1},showProductRequiredButton:{type:[Boolean,String,Function]},showProductEditButton:{type:[Boolean,String,Function],default:!1},currencyRates:{},productContextButtonsConfig:{type:Function,default:void 0}},setup(t){const e=t,n=i.inject($r,"medium"),r=i.computed(()=>{var H;return(H=e==null?void 0:e.filteredItems)==null?void 0:H[e.categoryItem.id]}),s=i.computed(()=>{var H,N;return A.isArray((H=e.categoryItem)==null?void 0:H.categories)&&((N=e.categoryItem.categories)==null?void 0:N.length)>0}),o=i.computed(()=>{var H;return A.isArray((H=e.categoryItem)==null?void 0:H.products)?e.categoryItem.products:[]}),a=i.computed(()=>Object.entries(e.categoryItem.currencyRates??{}).map(([H,N])=>`${N} руб./${R(H)}`).join(", ")),l=i.computed(()=>A.isUndefined(e.filteredItems)||r.value==="*"?o.value:o.value.filter(H=>{var I;const N=(I=r.value)==null?void 0:I.products;return A.isArray(N)&&N.includes(H.id)})),c=i.computed(()=>l.value.length>0),d=i.computed(()=>A.isFunction(e.showCategoryHideForClientButton)?e.showCategoryHideForClientButton(e.categoryItem):e.showCategoryHideForClientButton),h=i.computed(()=>A.isFunction(e.showCategoryPinButton)?e.showCategoryPinButton(e.categoryItem):e.showCategoryPinButton),u=i.computed(()=>A.isFunction(e.showCategoryRequiredButton)?e.showCategoryRequiredButton(e.categoryItem):e.showCategoryRequiredButton),m=i.computed(()=>A.isFunction(e.showCategoryEditButton)?e.showCategoryEditButton(e.categoryItem):e.showCategoryEditButton),f=i.computed(()=>A.isFunction(e.showConfigurator)?e.showConfigurator(e.categoryItem):e.showConfigurator),g=i.computed(()=>A.isNil(e.categoryContextButtonsConfig)?[]:A.isFunction(e.categoryContextButtonsConfig)?e.categoryContextButtonsConfig(e.categoryItem):e.categoryContextButtonsConfig),p=i.computed(()=>new G.ClientCategory(e.categoryItem)),b=i.ref(!1),y=i.ref(!1),_=i.computed(()=>!A.isUndefined(e.isCategoryItemSelected)),S=i.computed(()=>A.isFunction(e.isCategoryItemSelected)?e.isCategoryItemSelected(e.categoryItem):e.isCategoryItemSelected),C=i.computed(()=>E.value&&_t.getDeviceTypeByResolution()===Ye.laptop?"auto":"fixed"),v=i.useTemplateRef("collapse-item-reference"),B=i.computed(()=>{var H,N;return(N=(H=e.categoryItem.properties)==null?void 0:H.templateCost)==null?void 0:N.priceCoefficient}),k=i.computed(()=>{var H,N;return(N=(H=e.categoryItem.properties)==null?void 0:H.templateCost)==null?void 0:N.increasePercent}),R=(H,N="ru-RU")=>0 .toLocaleString(N,{style:"currency",currency:H,minimumFractionDigits:0,maximumFractionDigits:0}).replaceAll(/\d/g,"").trim(),$=H=>{e.eventEmitter.emit("category:checked",{category:e.categoryItem,checked:H,target:v.value})},F=(H,N)=>{e.eventEmitter.emit("category:header-click",{categoryItem:e.categoryItem,expanded:N,isLoadingState:b,target:v.value})},D=()=>{e.eventEmitter.emit("category:hide",{category:e.categoryItem,target:v.value})},L=()=>{e.eventEmitter.emit("category:required",{category:e.categoryItem,target:v.value})},M=()=>{e.eventEmitter.emit("category:attach",{category:e.categoryItem,target:v.value})},z=()=>{e.eventEmitter.emit("category:detach",{category:e.categoryItem,target:v.value})},O=()=>{e.eventEmitter.emit("category:edit",{category:e.categoryItem,target:v.value})},ne=H=>{e.eventEmitter.emit("category:context-select",{category:e.categoryItem,key:H,target:v.value})},P=(H,N,I)=>{e.eventEmitter.emit("configurator:submit",{cartItem:H,target:v.value,callback:I,validation:N})},E=i.ref(0),X=i.computed(()=>E.value&&o.value.length>0?yg(o.value,{eventEmitter:e.eventEmitter,showSlugs:e.showSlugs,showProperties:e.showProperties,showProductCosts:e.showProductCosts,allowNameClick:e.allowNameClick,allowPriceClick:e.allowPriceClick,showPriceHistory:e.showPriceHistory,showCostDate:e.showCostDate,showProductAddToCartButton:e.showProductAddToCartButton,isProductItemSelected:e.isProductItemSelected,showProductEditButton:e.showProductEditButton,showProductRequiredButton:e.showProductRequiredButton,currencyRates:e.categoryItem.currencyRates,productContextButtonsConfig:e.productContextButtonsConfig}):[]),j=A.debounce(()=>{E.value=window.innerWidth},20);return i.onUnmounted(()=>{window.removeEventListener("resize",j)}),window.addEventListener("resize",j),j(),(H,N)=>{const I=V.NCheckbox,J=sf,ce=V.NTooltip,re=tf,de=V.NTag,se=Ju,Ae=Gu,Fe=V.NButton,Ke=Xu,Ie=La,bt=za,Jt=Ia,Qt=Va,Bt=V.NDropdown,Ot=V.NDataTable,lt=V.NAlert,Nn=V.NSpin;return i.openBlock(),i.createBlock(Da,{ref:"collapse-item-reference",name:t.categoryItem.id,"data-id":t.categoryItem.id,"onHeader:click":F},{"pre-arrow":i.withCtx(()=>{var je,Se;return[_.value?(i.openBlock(),i.createElementBlock("div",_0,[i.createVNode(I,{checked:S.value,disabled:S.value==="disabled","onUpdate:checked":$},null,8,["checked","disabled"])])):i.createCommentVNode("",!0),!d.value&&((je=p.value)!=null&&je.isDisabled)?(i.openBlock(),i.createBlock(ce,{key:1,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(J,{class:"pt-1.5"})]),default:i.withCtx(()=>[N[1]||(N[1]=i.createTextVNode(" Категория скрыта для клиента ",-1))]),_:1})):i.createCommentVNode("",!0),((Se=p.value)==null?void 0:Se.isFavorite)??!1?(i.openBlock(),i.createBlock(ce,{key:2,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(re,{class:"pt-1.5"})]),default:i.withCtx(()=>[N[2]||(N[2]=i.createTextVNode(" Избранная категория ",-1))]),_:1})):i.createCommentVNode("",!0)]}),header:i.withCtx(()=>{var je,Se,st,qe,ee;return[i.createElementVNode("div",{class:i.normalizeClass({"text-base font-semibold uppercase":!0,"text-gray-400 line-through":t.categoryItem.isHidden,"text-gray-400":(je=p.value)==null?void 0:je.isDisabled})},[i.createVNode(ce,{disabled:!t.categoryItem.isHidden,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createElementVNode("span",null,i.toDisplayString(t.categoryItem.name),1)]),default:i.withCtx(()=>[N[3]||(N[3]=i.createTextVNode(" Категория скрыта ",-1))]),_:1},8,["disabled"])],2),i.createElementVNode("div",{class:"w-fit",onClick:N[0]||(N[0]=i.withModifiers((...ie)=>i.unref(A.noop)&&i.unref(A.noop)(...ie),["prevent","stop"]))},[(Se=t.categoryItem.properties)!=null&&Se.m2Price?(i.openBlock(),i.createBlock(de,{key:0,size:i.unref(n),class:i.normalizeClass({"!pr-0":((st=t.categoryItem.properties)==null?void 0:st.templateCost)&&t.categoryItem.properties.m2PriceRetail&&k.value}),round:""},{default:i.withCtx(()=>{var ie;return[i.createTextVNode(" Установленная стоимость: "+i.toDisplayString(t.categoryItem.properties.m2Price)+" руб./м2 ",1),(ie=t.categoryItem.properties)!=null&&ie.templateCost&&t.categoryItem.properties.m2PriceRetail&&k.value?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[k.value?(i.openBlock(),i.createBlock(de,{key:0,type:"success",bordered:!1,size:i.unref(n),class:"ml-2 !pr-0",round:""},{default:i.withCtx(()=>[k.value?(i.openBlock(),i.createElementBlock("span",w0,i.toDisplayString(k.value.toFixed(2))+"%",1)):i.createCommentVNode("",!0),i.createVNode(de,{size:i.unref(n),round:""},{default:i.withCtx(()=>[i.createElementVNode("span",x0,i.toDisplayString(t.categoryItem.properties.m2PriceRetail)+" руб./м2",1)]),_:1},8,["size"])]),_:1},8,["size"])):i.createCommentVNode("",!0)],64)):i.createCommentVNode("",!0)]}),_:1},8,["size","class"])):(qe=t.categoryItem.properties)!=null&&qe.templateCost?(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[B.value||k.value?(i.openBlock(),i.createBlock(de,{key:0,size:i.unref(n),round:""},{default:i.withCtx(()=>{var ie;return[B.value?(i.openBlock(),i.createElementBlock("span",v0,i.toDisplayString((ie=B.value)==null?void 0:ie.name),1)):i.createCommentVNode("",!0),k.value?(i.openBlock(),i.createElementBlock("span",k0,i.toDisplayString(k.value>0?"+":"")+i.toDisplayString(k.value.toFixed(2))+"%",1)):i.createCommentVNode("",!0)]}),_:1},8,["size"])):i.createCommentVNode("",!0)],64)):i.createCommentVNode("",!0),a.value?(i.openBlock(),i.createBlock(de,{key:2,size:i.unref(n),round:""},{default:i.withCtx(()=>[i.createTextVNode(" Фиксированный курс: "+i.toDisplayString(a.value),1)]),_:1},8,["size"])):i.createCommentVNode("",!0),h.value&&((ee=p.value)!=null&&ee.manager)?(i.openBlock(),i.createBlock(de,{key:3,size:i.unref(n),closable:!0,round:"",class:"align-bottom",onClose:z},{default:i.withCtx(()=>[i.createVNode(ce,{placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>{var ie,Me;return[i.createElementVNode("span",C0,[i.createVNode(se),i.createTextVNode(" "+i.toDisplayString((Me=(ie=p.value)==null?void 0:ie.manager)==null?void 0:Me.name),1)])]}),default:i.withCtx(()=>{var ie,Me;return[i.createTextVNode(' Категория закреплена за "'+i.toDisplayString((Me=(ie=p.value)==null?void 0:ie.manager)==null?void 0:Me.name)+'" ',1)]}),_:1})]),_:1},8,["size"])):i.createCommentVNode("",!0)])]}),"sub-header":i.withCtx(()=>[t.showSlugs||t.showProperties?(i.openBlock(),i.createElementBlock("div",S0,[i.createElementVNode("ul",B0,[t.showSlugs?(i.openBlock(!0),i.createElementBlock(i.Fragment,{key:0},i.renderList({id:t.categoryItem.id,slug:t.categoryItem.slug},(je,Se)=>(i.openBlock(),i.createElementBlock("li",{key:Se}," ("+i.toDisplayString(Se)+"): "+i.toDisplayString(je),1))),128)):i.createCommentVNode("",!0),t.showProperties?(i.openBlock(!0),i.createElementBlock(i.Fragment,{key:1},i.renderList(t.categoryItem.properties,(je,Se)=>(i.openBlock(),i.createElementBlock("li",{key:Se}," ("+i.toDisplayString(Se)+"): "+i.toDisplayString(je),1))),128)):i.createCommentVNode("",!0)])])):i.createCommentVNode("",!0)]),"header-extra":i.withCtx(()=>{var je;return[i.createElementVNode("div",T0,[d.value?(i.openBlock(),i.createBlock(ce,{key:0,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(Fe,{ghost:!0,size:i.unref(n),onClick:D},{default:i.withCtx(()=>{var Se;return[(Se=p.value)!=null&&Se.isDisabled?(i.openBlock(),i.createBlock(J,{key:1})):(i.openBlock(),i.createBlock(Ae,{key:0}))]}),_:1},8,["size"])]),default:i.withCtx(()=>{var Se;return[(Se=p.value)!=null&&Se.isDisabled?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[i.createTextVNode(" Скрыто для клиента"+i.toDisplayString(p.value.hidingComment?`. Причина: '${p.value.hidingComment}'`:""),1)],64)):(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[i.createTextVNode("Видимо клиенту")],64))]}),_:1})):i.createCommentVNode("",!0),h.value&&!((je=p.value)!=null&&je.manager)?(i.openBlock(),i.createBlock(ce,{key:1,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(Fe,{ghost:!0,size:i.unref(n),onClick:M},{default:i.withCtx(()=>[i.createVNode(Ke)]),_:1},8,["size"])]),default:i.withCtx(()=>{var Se,st,qe;return[(Se=p.value)!=null&&Se.manager?(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[i.createTextVNode('Категория закреплена за "'+i.toDisplayString(((qe=(st=p.value)==null?void 0:st.manager)==null?void 0:qe.name)??"-")+'"',1)],64)):(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[i.createTextVNode("Закрепить")],64))]}),_:1})):i.createCommentVNode("",!0),u.value?(i.openBlock(),i.createBlock(ce,{key:2,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(Fe,{ghost:!0,disabled:u.value==="disabled",size:i.unref(n),onClick:L},{default:i.withCtx(()=>{var Se;return[(Se=p.value)!=null&&Se.isRequired?(i.openBlock(),i.createBlock(bt,{key:1})):(i.openBlock(),i.createBlock(Ie,{key:0}))]}),_:1},8,["disabled","size"])]),default:i.withCtx(()=>[N[4]||(N[4]=i.createTextVNode(" Категория, которую нужно предлагать клиенту ",-1))]),_:1})):i.createCommentVNode("",!0),m.value?(i.openBlock(),i.createBlock(ce,{key:3,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(Fe,{ghost:!0,size:i.unref(n),type:"primary",onClick:O},{default:i.withCtx(()=>[i.createVNode(Jt)]),_:1},8,["size"])]),default:i.withCtx(()=>[N[5]||(N[5]=i.createTextVNode(" Редактировать ",-1))]),_:1})):i.createCommentVNode("",!0),g.value.length>0?(i.openBlock(),i.createBlock(Bt,{key:4,options:g.value,size:i.unref(n),trigger:"click",onSelect:ne},{default:i.withCtx(()=>[i.createVNode(Fe,{ghost:!0,size:i.unref(n),type:"primary"},{default:i.withCtx(()=>[i.createVNode(Qt)]),_:1},8,["size"])]),_:1},8,["options","size"])):i.createCommentVNode("",!0)])]}),default:i.withCtx(()=>[i.renderSlot(H.$slots,"default",{},()=>{var je,Se;return[s.value?(i.openBlock(),i.createBlock(vd,{key:0,"categories-items":t.categoryItem.categories??[],"has-products":c.value||b.value,"event-emitter":t.eventEmitter,"filtered-items":r.value?((je=r.value)==null?void 0:je.categories)??{}:void 0,"is-category-item-selected":t.isCategoryItemSelected,"show-slugs":t.showSlugs,"show-properties":t.showProperties,"allow-name-click":t.allowNameClick,"allow-price-click":t.allowPriceClick,"show-price-history":t.showPriceHistory,"show-cost-date":t.showCostDate,"show-category-required-button":t.showCategoryRequiredButton,"show-category-hide-for-client-button":t.showCategoryHideForClientButton,"show-category-pin-button":t.showCategoryPinButton,"show-category-edit-button":t.showCategoryEditButton,"category-context-buttons-config":t.categoryContextButtonsConfig,"is-product-item-selected":t.isProductItemSelected,"show-product-add-to-cart-button":t.showProductAddToCartButton,"show-product-costs":t.showProductCosts,"show-product-required-button":t.showProductRequiredButton,"show-product-edit-button":t.showProductEditButton,"product-context-buttons-config":t.productContextButtonsConfig,"show-configurator":f.value},null,8,["categories-items","has-products","event-emitter","filtered-items","is-category-item-selected","show-slugs","show-properties","allow-name-click","allow-price-click","show-price-history","show-cost-date","show-category-required-button","show-category-hide-for-client-button","show-category-pin-button","show-category-edit-button","category-context-buttons-config","is-product-item-selected","show-product-add-to-cart-button","show-product-costs","show-product-required-button","show-product-edit-button","product-context-buttons-config","show-configurator"])):i.createCommentVNode("",!0),(Se=t.categoryItem.properties)!=null&&Se.configurator&&f.value?(i.openBlock(),i.createBlock(wd,{key:1,"event-emitter":t.eventEmitter,category:t.categoryItem,onSubmit:P},null,8,["event-emitter","category"])):c.value?(i.openBlock(),i.createBlock(Ot,{key:2,columns:X.value,data:l.value,bordered:!0,loading:b.value,remote:!0,"row-key":st=>st.id,"table-layout":C.value,class:"mt-1"},null,8,["columns","data","loading","row-key","table-layout"])):i.createCommentVNode("",!0),!b.value&&!y.value&&!s.value&&!c.value?(i.openBlock(),i.createBlock(lt,{key:3,"show-icon":!0,type:"warning",title:"Категория пуста",class:"mx-10"})):i.createCommentVNode("",!0),y.value?(i.openBlock(),i.createBlock(lt,{key:4,"show-icon":!0,type:"error",title:"При получении данных произошла ошибка",class:"mx-10"})):i.createCommentVNode("",!0),b.value?(i.openBlock(),i.createBlock(Nn,{key:5,size:i.unref(n),class:"w-full"},{description:i.withCtx(()=>[...N[6]||(N[6]=[i.createElementVNode("div",null,"Выполняется загрузка данных ...",-1)])]),_:1},8,["size"])):i.createCommentVNode("",!0)]},!0)]),_:3},8,["name","data-id"])}}}),E0=Kn($0,[["__scopeId","data-v-49a51304"]]),N0={class:"sc-collapse flex w-full flex-col"},P0={},xd=i.defineComponent({...P0,__name:"collapse",props:{defaultExpandedNames:{default:()=>[]},expandedNames:{default:()=>[]}},emits:["on-item-header-click"],setup(t,{emit:e}){const n=t,r=e,s=(o,a)=>{r("on-item-header-click",o,a)};return i.provide("itemHeaderClickHandler",s),i.provide("defaultExpandedNames",n.defaultExpandedNames),i.provide("expandedNames",n.expandedNames),(o,a)=>(i.openBlock(),i.createElementBlock("div",N0,[i.renderSlot(o.$slots,"default")]))}}),F0={},vd=i.defineComponent({...F0,__name:"category-collapse",props:{categoriesItems:{},hasProducts:{type:Boolean},loading:{type:Boolean,default:!1},client:{default:void 0},filteredItems:{default:void 0},isCategoryItemSelected:{},showCategoryHideForClientButton:{type:[Boolean,String,Function]},showCategoryRequiredButton:{type:[Boolean,String,Function]},showCategoryPinButton:{type:[Boolean,String,Function]},showCategoryEditButton:{type:[Boolean,String,Function],default:!1},categoryContextButtonsConfig:{type:Function,default:void 0},showConfigurator:{type:[Boolean,Function]},eventEmitter:{},showSlugs:{type:Boolean,default:!1},showProperties:{type:Boolean,default:!1},showProductCosts:{type:[Boolean,Function],default:!1},allowNameClick:{type:[Boolean,Function],default:!1},allowPriceClick:{type:[Boolean,Function],default:!1},showPriceHistory:{type:[Boolean,Function],default:!1},showCostDate:{type:[Boolean,Function],default:!1},isProductItemSelected:{},showProductAddToCartButton:{type:[Boolean,String,Function],default:!1},showProductRequiredButton:{type:[Boolean,String,Function]},showProductEditButton:{type:[Boolean,String,Function],default:!1},currencyRates:{},productContextButtonsConfig:{type:Function,default:void 0}},setup(t){const e=t,n=i.inject($r,"medium"),r=i.computed(()=>A.isUndefined(e.filteredItems)?e.categoriesItems:e.categoriesItems.filter(o=>{var a;return!!((a=e.filteredItems)!=null&&a[o.id])})),s=(o,a)=>{if(A.isUndefined(a))return;const l=a[o.id];if(l==="*")return;const c={};return c[o.id]=structuredClone(i.toRaw(l)),c};return(o,a)=>{const l=V.NSpin,c=V.NAlert;return i.openBlock(),i.createElementBlock(i.Fragment,null,[r.value.length>0?(i.openBlock(),i.createBlock(xd,{key:0},{default:i.withCtx(()=>[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(r.value,d=>(i.openBlock(),i.createBlock(E0,{key:d.id,"category-item":d,"event-emitter":t.eventEmitter,"filtered-items":s(d,t.filteredItems),"is-category-item-selected":t.isCategoryItemSelected,"show-slugs":t.showSlugs,"show-properties":t.showProperties,"allow-name-click":t.allowNameClick,"allow-price-click":t.allowPriceClick,"show-price-history":t.showPriceHistory,"show-cost-date":t.showCostDate,"show-category-required-button":t.showCategoryRequiredButton,"show-category-hide-for-client-button":t.showCategoryHideForClientButton,"show-category-pin-button":t.showCategoryPinButton,"show-category-edit-button":t.showCategoryEditButton,"category-context-buttons-config":t.categoryContextButtonsConfig,"is-product-item-selected":t.isProductItemSelected,"show-product-add-to-cart-button":t.showProductAddToCartButton,"show-product-costs":t.showProductCosts,"show-product-required-button":t.showProductRequiredButton,"show-product-edit-button":t.showProductEditButton,"product-context-buttons-config":t.productContextButtonsConfig,"show-configurator":t.showConfigurator},null,8,["category-item","event-emitter","filtered-items","is-category-item-selected","show-slugs","show-properties","allow-name-click","allow-price-click","show-price-history","show-cost-date","show-category-required-button","show-category-hide-for-client-button","show-category-pin-button","show-category-edit-button","category-context-buttons-config","is-product-item-selected","show-product-add-to-cart-button","show-product-costs","show-product-required-button","show-product-edit-button","product-context-buttons-config","show-configurator"]))),128))]),_:1})):t.loading?(i.openBlock(),i.createBlock(l,{key:1,size:i.unref(n),class:"w-full"},{description:i.withCtx(()=>[...a[0]||(a[0]=[i.createElementVNode("div",null,"Выполняется загрузка данных ...",-1)])]),_:1},8,["size"])):i.createCommentVNode("",!0),!t.hasProducts&&!t.loading&&t.categoriesItems.length>0&&r.value.length===0?(i.openBlock(),i.createBlock(c,{key:2,"show-icon":!0,type:"warning",title:"Товары не найдены",class:"mx-10"})):i.createCommentVNode("",!0)],64)}}}),M0={},kd=i.defineComponent({...M0,__name:"reference-select",props:{value:{default:void 0},clearable:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},consistentMenuWidth:{type:Boolean,default:!0},wrapContent:{type:Boolean},referenceList:{default:()=>[]},showEmptyValue:{type:Boolean,default:!1},sortOptionsByLabel:{type:Boolean,default:!1},filterable:{type:Boolean,default:!1},maxTagCount:{default:void 0}},emits:["update:value"],setup(t,{expose:e,emit:n}){const r=t,s=n,o=i.computed(()=>A.isArray(r.value)),a=new G.Reference,l=i.computed(()=>{const f=o.value?[]:a,g=A.isUndefined(r.value)?f:r.value;return A.isArray(g)?g.map(p=>p.id):g==null?void 0:g.id}),c=i.computed(()=>Lt.convertReferencesToSelectOptionsList(r.referenceList,r.sortOptionsByLabel,!1,r.showEmptyValue)),d=f=>{var g;if(A.isArray(f)){const p=f.length>0?f.map(b=>{var y;return(y=c.value.find(_=>_.value===b))==null?void 0:y.item}):[];s("update:value",p)}else{const p=f===a.id||(g=c.value.find(b=>b.value===f))==null?void 0:g.item;s("update:value",p)}},h=i.useTemplateRef("select-component");return e({focus:()=>{var f;return(f=h.value)==null?void 0:f.focus()},blur:()=>{var f;return(f=h.value)==null?void 0:f.blur()}}),(f,g)=>(i.openBlock(),i.createBlock(i.unref(V.NSelect),{ref:"select-component",value:l.value,clearable:r.clearable,"consistent-menu-width":t.consistentMenuWidth,disabled:t.disabled||c.value.length===0,filterable:t.filterable,"max-tag-count":t.maxTagCount,multiple:o.value,options:c.value,placeholder:"",class:"w-full","onUpdate:value":d},null,8,["value","clearable","consistent-menu-width","disabled","filterable","max-tag-count","multiple","options"]))}}),A0={},O0=i.defineComponent({...A0,__name:"set-client-price-form-item",props:{value:{},clearable:{type:Boolean},feedback:{},validationStatus:{},disabled:{type:Boolean},catalogItem:{},calculationType:{},label:{}},emits:["update:value"],setup(t,{emit:e}){var S,C;const n=t,r=e,s=()=>{const v=G.PriceCoefficient.getRetailPriceCoefficient();return A.unset(v,"isNewRec"),v},o=v=>!v||v.id===s().id,a=i.computed(()=>{var v;return((v=n.catalogItem)==null?void 0:v.type)==="product"}),l=i.computed(()=>a.value?n.catalogItem:void 0),c=v=>{var B,k,R,$;return v.id===s().id?(B=l.value)==null?void 0:B.getRetailCost():($=(R=(k=l.value)==null?void 0:k.priceCoefficients)==null?void 0:R.find(F=>F.coefficient.id===v.id))==null?void 0:$.cost},d=i.computed(()=>{var B;const v=[...((B=G.useReferencesStore().priceCoefficientsReference)==null?void 0:B.map(k=>structuredClone(i.toRaw(k))))??[],s()];return a.value&&v.forEach(k=>{var $;const R=c(k);R?k.name+=` (${R} ${($=l.value)==null?void 0:$.currency})`:k.name=""}),v.filter(k=>k.name!=="")}),h=i.ref(n.value.coefficient),u=i.ref(((C=(S=n.value)==null?void 0:S.value)==null?void 0:C.toString())??null),m=i.ref(null),f=i.computed(()=>{var v,B;return(B=(v=l.value)==null?void 0:v.priceCoefficients)==null?void 0:B.find(k=>k.coefficient.slug===G.PriceCoefficientEnum.K0)}),g=i.ref(void 0),p=()=>{var B,k,R;g.value=void 0;let v=Number.parseFloat(((B=u.value)==null?void 0:B.replace(",","."))??"");if(v=Number.isNaN(v)?void 0:v,a.value)if(h.value||u.value){const $=s(),F=c(h.value??$)??0,D=F+F*((v??0)/100);m.value=new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:2}).format(D),D>(((k=l.value)==null?void 0:k.getRetailCost())??D)&&(g.value={validationStatus:"warning",feedback:"Устанавливается цена выше розничной цены"}),f.value&&D<(((R=f.value)==null?void 0:R.cost)??0)&&(g.value={validationStatus:"warning",feedback:"Устанавливается цена ниже минимальной цены"})}else m.value=null;r("update:value",{value:Number.isNaN(v)?void 0:v,coefficient:o(h.value)?void 0:structuredClone(i.toRaw(h.value))})},b=v=>{A.isArray(v)||(h.value=v,!h.value&&u.value&&(h.value=s()),p())},y=()=>{h.value||(h.value=s()),p()},_=v=>{var k,R,$,F,D,L;const B=Number.parseFloat((v==null?void 0:v.replace(",","."))??"");if(a.value){let M=0;if(B<=0)h.value=void 0,u.value=null;else if(f.value&&B<(((k=f.value)==null?void 0:k.cost)??0))h.value=(R=f.value)==null?void 0:R.coefficient,M=(B-f.value.cost)*100/f.value.cost,g.value={validationStatus:"warning",feedback:"Устанавливается цена ниже минимальной цены"};else if(B>((($=l.value)==null?void 0:$.getRetailCost())??B)){h.value=s();const z=((F=l.value)==null?void 0:F.getRetailCost())??0;M=(B-z)*100/z,g.value={validationStatus:"warning",feedback:"Устанавливается цена выше розничной цены"}}else{const z=(L=(D=l.value)==null?void 0:D.priceCoefficients)==null?void 0:L.filter(O=>O.cost<B);if(z&&z.length>0){const O=z.at(-1);h.value=O==null?void 0:O.coefficient,M=(B-((O==null?void 0:O.cost)??0))*100/((O==null?void 0:O.cost)??1)}g.value={validationStatus:void 0,feedback:void 0}}u.value=new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:5}).format(M),r("update:value",{value:Number.isNaN(M)?void 0:M,coefficient:o(h.value)?void 0:structuredClone(i.toRaw(h.value))})}else r("update:value",{value:Number.isNaN(B)?void 0:B,coefficient:void 0})};return i.onMounted(()=>{var v,B,k,R;n.calculationType===G.CalculationTypeEnum.m2Cost?m.value=((B=(v=n.value)==null?void 0:v.value)==null?void 0:B.toString())??null:!((k=n.value)!=null&&k.coefficient)&&((R=n.value)!=null&&R.value)&&(h.value=s()),p()}),(v,B)=>{var $,F,D;const k=V.NInput,R=V.NInputGroup;return i.openBlock(),i.createBlock(i.unref(V.NFormItem),{"show-label":!i.unref(A.isNil)(t.label),label:t.label,"show-feedback":!i.unref(A.isNil)((($=g.value)==null?void 0:$.feedback)??t.feedback),feedback:((F=g.value)==null?void 0:F.feedback)??t.feedback,"validation-status":((D=g.value)==null?void 0:D.validationStatus)??t.validationStatus},{default:i.withCtx(()=>[i.createElementVNode("div",{class:i.normalizeClass([{"sm:grid-cols-3":a.value&&t.calculationType!==i.unref(G.CalculationTypeEnum).m2Cost},"grid w-full grid-cols-1 gap-2"])},[t.calculationType!==i.unref(G.CalculationTypeEnum).m2Cost?(i.openBlock(),i.createBlock(R,{key:0,class:i.normalizeClass(["w-full flex-row",{"sm:col-span-2":a.value}])},{default:i.withCtx(()=>[i.createVNode(kd,{class:"w-full min-w-0 flex-1",value:h.value,"reference-list":d.value,clearable:t.clearable,disabled:t.disabled,"consistent-menu-width":!1,"show-empty-value":!0,"onUpdate:value":b},null,8,["value","reference-list","clearable","disabled"]),i.createVNode(k,{value:u.value,"onUpdate:value":[B[0]||(B[0]=L=>u.value=L),y],clearable:t.clearable,disabled:t.disabled,placeholder:"",class:"w-full min-w-0 flex-1"},i.createSlots({suffix:i.withCtx(()=>[B[3]||(B[3]=i.createTextVNode("%",-1))]),_:2},[u.value&&!u.value.startsWith("-")?{name:"prefix",fn:i.withCtx(()=>[B[2]||(B[2]=i.createTextVNode(" + ",-1))]),key:"0"}:void 0]),1032,["value","clearable","disabled"])]),_:1},8,["class"])):i.createCommentVNode("",!0),a.value||t.calculationType===i.unref(G.CalculationTypeEnum).m2Cost?(i.openBlock(),i.createBlock(k,{key:1,value:m.value,"onUpdate:value":[B[1]||(B[1]=L=>m.value=L),_],clearable:t.clearable,disabled:t.disabled,placeholder:"Стоимость",class:"w-full"},i.createSlots({_:2},[a.value?{name:"suffix",fn:i.withCtx(()=>{var L;return[i.createTextVNode(i.toDisplayString((L=l.value)==null?void 0:L.currency),1)]}),key:"0"}:void 0]),1032,["value","clearable","disabled"])):i.createCommentVNode("",!0)],2)]),_:1},8,["show-label","label","show-feedback","feedback","validation-status"])}}}),V0={key:0,class:"flex flex-row gap-2.5"},I0={key:1,class:"flex flex-row flex-wrap justify-end gap-2.5"},z0={},Cd=i.defineComponent({...z0,__name:"base-dialog",props:{show:{type:Boolean},title:{},sizes:{default:()=>({phone:{size:"small",scale:.98},tablet:{size:"small",scale:.9},default:{size:"medium",scale:.7}})},processing:{type:Boolean,default:!1},valid:{type:Boolean,default:!0},acceptButton:{default:()=>({show:!0,text:"ОК"})},cancelButton:{default:()=>({show:!0,text:"Отмена"})}},emits:["update:show","opening","closing","accept","processing:cancel"],setup(t,{expose:e,emit:n}){const r=t,s=n,o=i.ref(r.show),a=i.ref(r.processing),l=_t.initRefDependingOnDeviceResolution(r.sizes.phone.size,r.sizes.tablet.size,r.sizes.default.size),c=_t.initRefDependingOnDeviceResolution(r.sizes.phone.scale,r.sizes.tablet.scale,r.sizes.default.scale),d=i.computed(()=>window.innerWidth*c.value),h=()=>{s("opening"),o.value=!0,s("update:show",o.value)},u=(f="other")=>{if(a.value){s("processing:cancel",y=>{a.value=y});return}let g=!1;s("closing",f,()=>{g=!0}),g||(o.value=!1,s("update:show",o.value))},m=()=>{s("accept",g=>{a.value=g})};return i.watch(()=>r.show,f=>{f?h():u("other")}),i.watch(()=>r.processing,f=>{a.value=f}),e({open:h,close:u}),(f,g)=>{const p=V.NButton,b=V.NModal;return i.openBlock(),i.createBlock(b,{loading:a.value,show:o.value,"show-icon":!1,size:i.unref(l),style:i.normalizeStyle(`width: ${d.value}px`),title:t.title,"action-class":f.$slots["extra-action"]?"grid grid-cols-2 !justify-between":void 0,preset:"dialog",onClose:g[1]||(g[1]=y=>u("header")),onEsc:g[2]||(g[2]=y=>u("esc")),onMaskClick:g[3]||(g[3]=y=>u("mask"))},i.createSlots({default:i.withCtx(()=>[i.renderSlot(f.$slots,"default")]),_:2},[f.$slots.header?{name:"header",fn:i.withCtx(()=>[i.renderSlot(f.$slots,"header")]),key:"0"}:void 0,f.$slots.action||f.$slots["extra-action"]||t.acceptButton.show||t.cancelButton.show?{name:"action",fn:i.withCtx(()=>[f.$slots["extra-action"]?(i.openBlock(),i.createElementBlock("div",V0,[i.renderSlot(f.$slots,"extra-action")])):i.createCommentVNode("",!0),f.$slots.action||t.acceptButton.show||t.cancelButton.show?(i.openBlock(),i.createElementBlock("div",I0,[i.renderSlot(f.$slots,"action",{disabled:a.value}),t.acceptButton.show??!0?(i.openBlock(),i.createBlock(p,{key:0,disabled:a.value||!t.valid,size:i.unref(l),type:"primary",onClick:m},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(t.acceptButton.text??"ОК"),1)]),_:1},8,["disabled","size"])):i.createCommentVNode("",!0),t.cancelButton.show??!0?(i.openBlock(),i.createBlock(p,{key:1,size:i.unref(l),type:"default",onClick:g[0]||(g[0]=y=>u("footer"))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(t.cancelButton.text??"Отмена"),1)]),_:1},8,["size"])):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)]),key:"1"}:void 0]),1032,["loading","show","size","style","title","action-class"])}}}),L0={class:"text-sm"},D0={class:"text-sm"},H0={},W0=i.defineComponent({...H0,__name:"add-product-to-cart-dialog",emits:["submit"],setup(t,{expose:e,emit:n}){const r=i.ref(null),s=i.ref(void 0),o=i.ref(null),a=n,l={length:{},quantity:{},marker:{}},c=i.ref(!1),d=i.computed(()=>{var p,b,y,_,S,C,v,B,k;if(!r.value)return"";const f=((b=(p=r.value)==null?void 0:p.properties)==null?void 0:b.minLength)??((_=(y=r.value)==null?void 0:y.properties)!=null&&_.ignoreMinCountCheck?0:(C=(S=r.value)==null?void 0:S.properties)==null?void 0:C.minCount),g=(B=(v=r.value)==null?void 0:v.properties)==null?void 0:B.maxLength;return f||g?`(${f?`от ${f}`:""}${f&&g?" ":""}${g?`до ${g}`:""} ${(k=r.value)==null?void 0:k.unit})`:""}),h=f=>{!r.value||!o.value||(G.UnitsHelper.productIsMeasurable(r.value)||delete o.value.length,c.value=!0,a("submit",o.value,l,()=>{c.value=!1,f(!1)}))},u=()=>{r.value=null,s.value=void 0,o.value=null};return e({show:(f,g)=>{var p,b,y,_;r.value=f,s.value=g,o.value=new G.CartItemBase(g??new G.CartItemBase({product:f,quantity:((p=f==null?void 0:f.properties)==null?void 0:p.minCount)??1,length:((b=f==null?void 0:f.properties)==null?void 0:b.minLength)||((y=f==null?void 0:f.properties)!=null&&y.ignoreMinCountCheck?0:(_=f==null?void 0:f.properties)==null?void 0:_.minCount)||0}))},closeDialog:u}),(f,g)=>(i.openBlock(),i.createBlock(Cd,{show:!i.unref(A.isNil)(r.value)&&!i.unref(A.isNil)(o.value),title:`${s.value?"Изменение":"Добавление"} товара в корзину`,"accept-button":{show:!0,text:s.value?"Изменить":"В корзину"},processing:c.value,onAccept:h,onClosing:u},{default:i.withCtx(()=>[r.value&&o.value?(i.openBlock(),i.createBlock(i.unref(V.NForm),{key:0,class:"flex flex-col gap-2"},{default:i.withCtx(()=>[i.unref(G.UnitsHelper).productIsMeasurable(r.value)?(i.openBlock(),i.createBlock(i.unref(V.NFormItem),{key:0,required:!0,feedback:l.length.feedback||"","show-feedback":l.length.showFeedback||i.unref(G.UnitsHelper).getProductLengthMultiplicity(r.value)!==.01||!1,"validation-status":l.length.validationStatus||void 0,label:"Метраж, "+r.value.unit+d.value+"м."},i.createSlots({default:i.withCtx(()=>{var p,b;return[i.createVNode(i.unref(V.NInputNumber),{value:o.value.length,"onUpdate:value":g[0]||(g[0]=y=>o.value.length=y),max:((p=r.value.properties)==null?void 0:p.maxLength)||void 0,min:((b=r.value.properties)==null?void 0:b.minLength)||i.unref(G.UnitsHelper).getProductLengthMultiplicity(r.value),step:i.unref(G.UnitsHelper).getProductMultiplicity(r.value),validator:y=>y%i.unref(G.UnitsHelper).getProductLengthMultiplicity(r.value)===0,placeholder:"Введите метраж",class:"w-full"},null,8,["value","max","min","step","validator"])]}),_:2},[!l.length.feedback&&i.unref(G.UnitsHelper).getProductLengthMultiplicity(r.value)!==.01?{name:"feedback",fn:i.withCtx(()=>[i.createElementVNode("span",L0,"Метраж должен быть кратен "+i.toDisplayString(i.unref(G.UnitsHelper).getProductLengthMultiplicity(r.value)),1)]),key:"0"}:void 0]),1032,["feedback","show-feedback","validation-status","label"])):i.createCommentVNode("",!0),i.createVNode(i.unref(V.NFormItem),{required:!0,feedback:l.quantity.feedback||"","show-feedback":l.quantity.showFeedback||i.unref(G.UnitsHelper).getProductMultiplicity(r.value)!==1||!1,"validation-status":l.quantity.validationStatus||void 0,label:"Количество"},i.createSlots({default:i.withCtx(()=>[i.createVNode(i.unref(V.NInputNumber),{value:o.value.quantity,"onUpdate:value":g[1]||(g[1]=p=>o.value.quantity=p),min:i.unref(G.UnitsHelper).getProductMultiplicity(r.value),step:i.unref(G.UnitsHelper).getProductMultiplicity(r.value),validator:p=>p%i.unref(G.UnitsHelper).getProductMultiplicity(r.value)===0,placeholder:"Введите количество",class:"w-full"},null,8,["value","min","step","validator"])]),_:2},[!l.quantity.feedback&&i.unref(G.UnitsHelper).getProductMultiplicity(r.value)!==1?{name:"feedback",fn:i.withCtx(()=>[i.createElementVNode("span",D0,"Количество должно быть кратно "+i.toDisplayString(i.unref(G.UnitsHelper).getProductMultiplicity(r.value)),1)]),key:"0"}:void 0]),1032,["feedback","show-feedback","validation-status"]),i.createVNode(i.unref(V.NFormItem),{feedback:l.marker.feedback||"","show-feedback":l.marker.showFeedback||!1,"validation-status":l.marker.validationStatus||void 0,label:"Маркировка"},{default:i.withCtx(()=>[i.createVNode(i.unref(V.NInput),{value:o.value.marker,"onUpdate:value":g[2]||(g[2]=p=>o.value.marker=p),placeholder:"Введите маркировку"},null,8,["value"])]),_:1},8,["feedback","show-feedback","validation-status"])]),_:1})):i.createCommentVNode("",!0)]),_:1},8,["show","title","accept-button","processing"]))}}),j0={class:"flex flex-row gap-1"},q0={class:"sc-client-name flex flex-col gap-1 text-base"},X0=["href"],Y0={key:1,class:"text-sc-grey"},U0={key:0,class:"text-sc-dark-grey sc-client-city text-sm"},G0={key:0},K0={key:1,class:"text-sm"},Z0={},os=i.defineComponent({...Z0,__name:"client-name-with-short-info",props:{client:{},nameLink:{default:void 0},popoverPosition:{default:void 0},showCityAndRegion:{type:Boolean,default:!0},showSalesDirection:{type:Boolean,default:!1},showClientInfoIcon:{type:Boolean,default:!1}},emits:["click:client-name","click:client-info"],setup(t,{emit:e}){const n=t,r=e,s=i.computed(()=>n.client.lastLoginAt?Fn.format(n.client.lastLoginAt,G.AppConfigProvider.getConfig().dateFormats.uiDateWithTime):""),o=a=>{A.isNil(n.nameLink)&&(a.preventDefault(),a.stopPropagation()),r("click:client-name",n.client,a)};return(a,l)=>{const c=Fs,d=V.NButton,h=V.NPopover;return i.openBlock(),i.createElementBlock("div",j0,[t.showClientInfoIcon?(i.openBlock(),i.createBlock(d,{key:0,quaternary:"",size:"small",onClick:l[0]||(l[0]=u=>a.$emit("click:client-info",t.client))},{default:i.withCtx(()=>[i.createVNode(c)]),_:1})):i.createCommentVNode("",!0),i.createVNode(h,{disabled:i.unref(A.isNil)(t.popoverPosition),placement:t.popoverPosition},{trigger:i.withCtx(()=>[i.createElementVNode("div",q0,[i.createElementVNode("a",{href:t.nameLink??"#",class:"text-base no-underline",onClick:l[1]||(l[1]=u=>o(u))},[i.createElementVNode("span",{class:i.normalizeClass({"line-through":!t.client.isActive})},i.toDisplayString(t.client.name),3),t.showSalesDirection&&t.client.salesDirection?(i.openBlock(),i.createElementBlock("span",{key:0,class:i.normalizeClass({"line-through":!t.client.isActive})}," ("+i.toDisplayString(t.client.salesDirection.name)+") ",3)):i.createCommentVNode("",!0),t.client.isActive?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("span",Y0," [ Деактивирован ] "))],8,X0),t.showCityAndRegion&&t.client.city?(i.openBlock(),i.createElementBlock("span",U0," г. "+i.toDisplayString(t.client.city.name)+", "+i.toDisplayString(t.client.city.region.name),1)):i.createCommentVNode("",!0)])]),default:i.withCtx(()=>[t.client.alternativeName?(i.openBlock(),i.createElementBlock("div",G0,i.toDisplayString(t.client.alternativeName),1)):i.createCommentVNode("",!0),s.value?(i.openBlock(),i.createElementBlock("span",K0," Последний вход: "+i.toDisplayString(s.value),1)):i.createCommentVNode("",!0),i.renderSlot(a.$slots,"popover-content")]),_:3},8,["disabled","placement"])])}}}),J0={class:"text-base"},Q0={},Sd=i.defineComponent({...Q0,__name:"contragent-with-short-info",props:{contragent:{}},setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock("span",J0,i.toDisplayString(t.contragent.name),1))}}),ey={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function ty(t,e){return i.openBlock(),i.createElementBlock("svg",ey,[...e[0]||(e[0]=[i.createElementVNode("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[i.createElementVNode("path",{d:"M3 7a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"}),i.createElementVNode("path",{d:"m3 7l9 6l9-6"})],-1)])])}const ny=i.markRaw({name:"tabler-mail",render:ty}),iy=["href"],ry={},sy=i.defineComponent({...ry,__name:"email",props:{email:{default:""},showEmailIcon:{type:Boolean,default:!1}},setup(t){return(e,n)=>{const r=ny;return i.openBlock(),i.createElementBlock("span",{class:i.normalizeClass({"flex flex-row items-center gap-1":t.showEmailIcon})},[t.showEmailIcon?(i.openBlock(),i.createBlock(r,{key:0})):i.createCommentVNode("",!0),i.createElementVNode("a",{href:`mailto:${t.email}`,class:"no-underline"},i.toDisplayString(t.email),9,iy)],2)}}}),oy={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function ay(t,e){return i.openBlock(),i.createElementBlock("svg",oy,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"currentColor",d:"M444 49.9C431.3 38.2 379.9.9 265.3.4c0 0-135.1-8.1-200.9 52.3C27.8 89.3 14.9 143 13.5 209.5s-3.1 191.1 117 224.9h.1l-.1 51.6s-.8 20.9 13 25.1c16.6 5.2 26.4-10.7 42.3-27.8c8.7-9.4 20.7-23.2 29.8-33.7c82.2 6.9 145.3-8.9 152.5-11.2c16.6-5.4 110.5-17.4 125.7-142c15.8-128.6-7.6-209.8-49.8-246.5M457.9 287c-12.9 104-89 110.6-103 115.1c-6 1.9-61.5 15.7-131.2 11.2c0 0-52 62.7-68.2 79c-5.3 5.3-11.1 4.8-11-5.7c0-6.9.4-85.7.4-85.7q-.15 0 0 0C43.1 372.7 49.1 266.6 50.2 211.1s11.6-101 42.6-131.6c55.7-50.5 170.4-43 170.4-43c96.9.4 143.3 29.6 154.1 39.4c35.7 30.6 53.9 103.8 40.6 211.1m-139-80.8c.4 8.6-12.5 9.2-12.9.6c-1.1-22-11.4-32.7-32.6-33.9c-8.6-.5-7.8-13.4.7-12.9c27.9 1.5 43.4 17.5 44.8 46.2m20.3 11.3c1-42.4-25.5-75.6-75.8-79.3c-8.5-.6-7.6-13.5.9-12.9c58 4.2 88.9 44.1 87.8 92.5c-.1 8.6-13.1 8.2-12.9-.3m47 13.4c.1 8.6-12.9 8.7-12.9.1c-.6-81.5-54.9-125.9-120.8-126.4c-8.5-.1-8.5-12.9 0-12.9c73.7.5 133 51.4 133.7 139.2M374.9 329v.2c-10.8 19-31 40-51.8 33.3l-.2-.3c-21.1-5.9-70.8-31.5-102.2-56.5c-16.2-12.8-31-27.9-42.4-42.4c-10.3-12.9-20.7-28.2-30.8-46.6c-21.3-38.5-26-55.7-26-55.7c-6.7-20.8 14.2-41 33.3-51.8h.2c9.2-4.8 18-3.2 23.9 3.9c0 0 12.4 14.8 17.7 22.1c5 6.8 11.7 17.7 15.2 23.8c6.1 10.9 2.3 22-3.7 26.6l-12 9.6c-6.1 4.9-5.3 14-5.3 14s17.8 67.3 84.3 84.3c0 0 9.1.8 14-5.3l9.6-12c4.6-6 15.7-9.8 26.6-3.7c14.7 8.3 33.4 21.2 45.8 32.9c7 5.7 8.6 14.4 3.8 23.6"},null,-1)])])}const Bd=i.markRaw({name:"fa6-brands-viber",render:ay}),ly={viewBox:"0 0 256 258",width:"1.2em",height:"1.2em"},cy=["id"],dy=["id"],hy=["fill"],uy=["fill"];function fy(t,e){return i.openBlock(),i.createElementBlock("svg",ly,[i.createElementVNode("defs",null,[i.createElementVNode("linearGradient",{id:t.idMap.SVGBRLHCcSy,x1:"50%",x2:"50%",y1:"100%",y2:"0%"},[...e[0]||(e[0]=[i.createElementVNode("stop",{offset:"0%","stop-color":"#1FAF38"},null,-1),i.createElementVNode("stop",{offset:"100%","stop-color":"#60D669"},null,-1)])],8,cy),i.createElementVNode("linearGradient",{id:t.idMap.SVGHW6lecxh,x1:"50%",x2:"50%",y1:"100%",y2:"0%"},[...e[1]||(e[1]=[i.createElementVNode("stop",{offset:"0%","stop-color":"#F9F9F9"},null,-1),i.createElementVNode("stop",{offset:"100%","stop-color":"#FFF"},null,-1)])],8,dy)]),i.createElementVNode("path",{fill:"url(#"+t.idMap.SVGBRLHCcSy+")",d:"M5.463 127.456c-.006 21.677 5.658 42.843 16.428 61.499L4.433 252.697l65.232-17.104a123 123 0 0 0 58.8 14.97h.054c67.815 0 123.018-55.183 123.047-123.01c.013-32.867-12.775-63.773-36.009-87.025c-23.23-23.25-54.125-36.061-87.043-36.076c-67.823 0-123.022 55.18-123.05 123.004"},null,8,hy),i.createElementVNode("path",{fill:"url(#"+t.idMap.SVGHW6lecxh+")",d:"M1.07 127.416c-.007 22.457 5.86 44.38 17.014 63.704L0 257.147l67.571-17.717c18.618 10.151 39.58 15.503 60.91 15.511h.055c70.248 0 127.434-57.168 127.464-127.423c.012-34.048-13.236-66.065-37.3-90.15C194.633 13.286 162.633.014 128.536 0C58.276 0 1.099 57.16 1.071 127.416m40.24 60.376l-2.523-4.005c-10.606-16.864-16.204-36.352-16.196-56.363C22.614 69.029 70.138 21.52 128.576 21.52c28.3.012 54.896 11.044 74.9 31.06c20.003 20.018 31.01 46.628 31.003 74.93c-.026 58.395-47.551 105.91-105.943 105.91h-.042c-19.013-.01-37.66-5.116-53.922-14.765l-3.87-2.295l-40.098 10.513z"},null,8,uy),e[2]||(e[2]=i.createElementVNode("path",{fill:"#FFF",d:"M96.678 74.148c-2.386-5.303-4.897-5.41-7.166-5.503c-1.858-.08-3.982-.074-6.104-.074c-2.124 0-5.575.799-8.492 3.984c-2.92 3.188-11.148 10.892-11.148 26.561s11.413 30.813 13.004 32.94c1.593 2.123 22.033 35.307 54.405 48.073c26.904 10.609 32.379 8.499 38.218 7.967c5.84-.53 18.844-7.702 21.497-15.139c2.655-7.436 2.655-13.81 1.859-15.142c-.796-1.327-2.92-2.124-6.105-3.716s-18.844-9.298-21.763-10.361c-2.92-1.062-5.043-1.592-7.167 1.597c-2.124 3.184-8.223 10.356-10.082 12.48c-1.857 2.129-3.716 2.394-6.9.801c-3.187-1.598-13.444-4.957-25.613-15.806c-9.468-8.442-15.86-18.867-17.718-22.056c-1.858-3.184-.199-4.91 1.398-6.497c1.431-1.427 3.186-3.719 4.78-5.578c1.588-1.86 2.118-3.187 3.18-5.311c1.063-2.126.531-3.986-.264-5.579c-.798-1.593-6.987-17.343-9.819-23.64"},null,-1))])}const Td=i.markRaw({name:"logos-whatsapp-icon",render:fy,setup(){const t=()=>Math.random().toString(36).substr(2,10);return{idMap:{SVGBRLHCcSy:"uicons-"+t(),SVGHW6lecxh:"uicons-"+t()}}}}),gy={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"},my=["id"],py=["fill"];function yy(t,e){return i.openBlock(),i.createElementBlock("svg",gy,[i.createElementVNode("defs",null,[i.createElementVNode("linearGradient",{id:t.idMap.SVGuySfwdaH,x1:"50%",x2:"50%",y1:"0%",y2:"100%"},[...e[0]||(e[0]=[i.createElementVNode("stop",{offset:"0%","stop-color":"#2AABEE"},null,-1),i.createElementVNode("stop",{offset:"100%","stop-color":"#229ED9"},null,-1)])],8,my)]),i.createElementVNode("path",{fill:"url(#"+t.idMap.SVGuySfwdaH+")",d:"M128 0C94.06 0 61.48 13.494 37.5 37.49A128.04 128.04 0 0 0 0 128c0 33.934 13.5 66.514 37.5 90.51C61.48 242.506 94.06 256 128 256s66.52-13.494 90.5-37.49c24-23.996 37.5-56.576 37.5-90.51s-13.5-66.514-37.5-90.51C194.52 13.494 161.94 0 128 0"},null,8,py),e[1]||(e[1]=i.createElementVNode("path",{fill:"#FFF",d:"M57.94 126.648q55.98-24.384 74.64-32.152c35.56-14.786 42.94-17.354 47.76-17.441c1.06-.017 3.42.245 4.96 1.49c1.28 1.05 1.64 2.47 1.82 3.467c.16.996.38 3.266.2 5.038c-1.92 20.24-10.26 69.356-14.5 92.026c-1.78 9.592-5.32 12.808-8.74 13.122c-7.44.684-13.08-4.912-20.28-9.63c-11.26-7.386-17.62-11.982-28.56-19.188c-12.64-8.328-4.44-12.906 2.76-20.386c1.88-1.958 34.64-31.748 35.26-34.45c.08-.338.16-1.598-.6-2.262c-.74-.666-1.84-.438-2.64-.258c-1.14.256-19.12 12.152-54 35.686c-5.1 3.508-9.72 5.218-13.88 5.128c-4.56-.098-13.36-2.584-19.9-4.708c-8-2.606-14.38-3.984-13.82-8.41c.28-2.304 3.46-4.662 9.52-7.072"},null,-1))])}const Rd=i.markRaw({name:"logos-telegram",render:yy,setup(){return{idMap:{SVGuySfwdaH:"uicons-"+Math.random().toString(36).substr(2,10)}}}}),by={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function _y(t,e){return i.openBlock(),i.createElementBlock("svg",by,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"currentColor",d:"M391 480c-19.52 0-46.94-7.06-88-30c-49.93-28-88.55-53.85-138.21-103.38C116.91 298.77 93.61 267.79 61 208.45c-36.84-67-30.56-102.12-23.54-117.13C45.82 73.38 58.16 62.65 74.11 52a176.3 176.3 0 0 1 28.64-15.2c1-.43 1.93-.84 2.76-1.21c4.95-2.23 12.45-5.6 21.95-2c6.34 2.38 12 7.25 20.86 16c18.17 17.92 43 57.83 52.16 77.43c6.15 13.21 10.22 21.93 10.23 31.71c0 11.45-5.76 20.28-12.75 29.81c-1.31 1.79-2.61 3.5-3.87 5.16c-7.61 10-9.28 12.89-8.18 18.05c2.23 10.37 18.86 41.24 46.19 68.51s57.31 42.85 67.72 45.07c5.38 1.15 8.33-.59 18.65-8.47c1.48-1.13 3-2.3 4.59-3.47c10.66-7.93 19.08-13.54 30.26-13.54h.06c9.73 0 18.06 4.22 31.86 11.18c18 9.08 59.11 33.59 77.14 51.78c8.77 8.84 13.66 14.48 16.05 20.81c3.6 9.53.21 17-2 22c-.37.83-.78 1.74-1.21 2.75a176.5 176.5 0 0 1-15.29 28.58c-10.63 15.9-21.4 28.21-39.38 36.58A67.4 67.4 0 0 1 391 480"},null,-1)])])}const $d=i.markRaw({name:"ion-call",render:_y}),wy={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function xy(t,e){return i.openBlock(),i.createElementBlock("svg",wy,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 4h4l2 5l-2.5 1.5a11 11 0 0 0 5 5L15 13l5 2v4a2 2 0 0 1-2 2A16 16 0 0 1 3 6a2 2 0 0 1 2-2m10 3a2 2 0 0 1 2 2m-2-6a6 6 0 0 1 6 6"},null,-1)])])}const vy=i.markRaw({name:"tabler-phone-call",render:xy}),ky={key:0,class:"absolute left-0 top-0 flex w-full flex-row items-center justify-around text-center backdrop-blur-sm"},Cy=["href"],Sy=["href"],By=["href"],Ty=["href"],Ry={},$y=i.defineComponent({...Ry,__name:"phone",props:{defaultCountry:{},phone:{default:""},showPhoneIcon:{type:Boolean,default:!1}},setup(t){const e=t,n=i.computed(()=>{try{return e.phone?Ji.parsePhoneNumberWithError(e.phone,e.defaultCountry):void 0}catch{}return e.phone}),r=i.computed(()=>{var l;return A.isString(n.value)?!1:((l=n.value)==null?void 0:l.isValid())??!1}),s=i.computed(()=>{var l;return A.isString(n.value)?n.value:((l=n.value)==null?void 0:l.format("INTERNATIONAL"))??""}),o=i.computed(()=>{var l;return A.isString(n.value)?n.value:((l=n.value)==null?void 0:l.format("E.164"))??""}),a=i.ref(!1);return(l,c)=>{const d=vy,h=$d,u=Rd,m=Td,f=Bd;return i.openBlock(),i.createElementBlock("div",null,[i.createElementVNode("div",{class:i.normalizeClass({"border-xl relative inline-flex items-center rounded px-2":r.value&&a.value,"min-w-10":!0}),onClick:c[0]||(c[0]=g=>a.value=!a.value),onFocusout:c[1]||(c[1]=g=>a.value=!1),onMouseleave:c[2]||(c[2]=g=>a.value=!1)},[i.createElementVNode("div",{class:i.normalizeClass({"flex flex-row items-center gap-1":t.showPhoneIcon})},[t.showPhoneIcon?(i.openBlock(),i.createBlock(d,{key:0})):i.createCommentVNode("",!0),i.createTextVNode(" "+i.toDisplayString(s.value),1)],2),r.value&&a.value?(i.openBlock(),i.createElementBlock("div",ky,[r.value?(i.openBlock(),i.createElementBlock("a",{key:0,href:`tel:${o.value}`,class:"text-blue-600 hover:animate-pulse hover:text-blue-600"},[i.createVNode(h)],8,Cy)):i.createCommentVNode("",!0),r.value?(i.openBlock(),i.createElementBlock("a",{key:1,href:`https://t.me/${o.value}`,target:"_blank",rel:"noopener noreferrer",class:"hover:animate-pulse"},[i.createVNode(u)],8,Sy)):i.createCommentVNode("",!0),r.value?(i.openBlock(),i.createElementBlock("a",{key:2,href:`https://wa.me/${o.value.substring(1)}`,target:"_blank",rel:"noopener noreferrer",class:"hover:animate-pulse"},[i.createVNode(m)],8,By)):i.createCommentVNode("",!0),r.value?(i.openBlock(),i.createElementBlock("a",{key:3,href:`viber://chat?number=${o.value}`,class:"text-purple-600 hover:animate-pulse hover:text-purple-600"},[i.createVNode(f)],8,Ty)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)],34)])}}}),Ey={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Ny(t,e){return i.openBlock(),i.createElementBlock("svg",Ey,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"currentColor",d:"m20 8l-8 5l-8-5V6l8 5l8-5m0-2H4c-1.11 0-2 .89-2 2v12a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2"},null,-1)])])}const Py=i.markRaw({name:"mdi-envelope",render:Ny}),Fy={class:"flex flex-col gap-1"},My={key:0,class:"mb-2 flex flex-col text-base"},Ay={key:0,class:"text-sc-dark-grey text-sm"},Oy={key:1,class:"whitespace-nowrap text-sm"},Vy={key:2,class:"whitespace-nowrap text-sm"},Iy={key:3,class:"absolute left-0 top-0 flex size-full items-center justify-around rounded-md text-center text-2xl backdrop-blur-sm"},zy=["href"],Ly=["href"],Dy=["href"],Hy=["href"],Wy=["href"],jy={key:0,class:"flex flex-col text-base"},qy={key:0,class:"text-sc-dark-grey text-sm"},Xy={key:1,class:"mt-2 text-sm"},Yy={key:0,class:"-mt-1"},Uy={},Gy=i.defineComponent({...Uy,__name:"person-contacts-block",props:{defaultCountry:{},contact:{},fullView:{type:Boolean,default:!0},classes:{default:""},styles:{default:void 0}},setup(t){const e=t,n=i.computed(()=>{try{return e.contact.phone?Ji.parsePhoneNumberWithError(e.contact.phone,e.defaultCountry):void 0}catch{}return e.contact.phone}),r=i.computed(()=>{var c;return A.isString(n.value)?!1:((c=n.value)==null?void 0:c.isValid())??!1}),s=i.computed(()=>{var c;return A.isString(n.value)?n.value:((c=n.value)==null?void 0:c.format("INTERNATIONAL"))??""}),o=i.computed(()=>{var c;return A.isString(n.value)?n.value:((c=n.value)==null?void 0:c.format("E.164"))??""}),a=i.computed(()=>r.value||e.contact.email),l=i.ref(!1);return(c,d)=>{var b,y;const h=$d,u=Rd,m=Td,f=Bd,g=Py,p=V.NPopover;return i.openBlock(),i.createElementBlock("div",Fy,[i.createVNode(p,{disabled:t.fullView,placement:"bottom"},{trigger:i.withCtx(()=>{var _,S,C,v;return[i.createElementVNode("div",{class:i.normalizeClass(`relative contact-btn px-3 py-2 rounded-md items-center inline-flex bg-gray-50 ${(_=t.contact)!=null&&_.isPrimary?"ring-1 ring-inset ring-green-600 hover:ring-gray-200":""} ${t.classes}`),style:i.normalizeStyle(t.styles),onMouseenter:d[0]||(d[0]=B=>l.value=!0),onFocusin:d[1]||(d[1]=B=>l.value=!0),onMouseleave:d[2]||(d[2]=B=>l.value=!1),onFocusout:d[3]||(d[3]=B=>l.value=!1)},[i.createElementVNode("div",null,[t.fullView&&(t.contact.name||(S=t.contact)!=null&&S.position)?(i.openBlock(),i.createElementBlock("div",My,[i.createTextVNode(i.toDisplayString(t.contact.name)+" ",1),(C=t.contact)!=null&&C.position?(i.openBlock(),i.createElementBlock("span",Ay,i.toDisplayString((v=t.contact)==null?void 0:v.position),1)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0),t.contact.phone?(i.openBlock(),i.createElementBlock("div",Oy,i.toDisplayString(s.value),1)):i.createCommentVNode("",!0),t.contact.email?(i.openBlock(),i.createElementBlock("div",Vy,i.toDisplayString(t.contact.email),1)):i.createCommentVNode("",!0),a.value&&l.value?(i.openBlock(),i.createElementBlock("div",Iy,[r.value?(i.openBlock(),i.createElementBlock("a",{key:0,href:`tel:${o.value}`,class:"text-blue-600 hover:text-3xl hover:text-blue-600"},[i.createVNode(h)],8,zy)):i.createCommentVNode("",!0),r.value?(i.openBlock(),i.createElementBlock("a",{key:1,href:`https://t.me/${o.value}`,target:"_blank",rel:"noopener noreferrer",class:"hover:text-3xl"},[i.createVNode(u)],8,Ly)):i.createCommentVNode("",!0),r.value?(i.openBlock(),i.createElementBlock("a",{key:2,href:`https://wa.me/${o.value.substring(1)}`,target:"_blank",rel:"noopener noreferrer",class:"hover:text-3xl"},[i.createVNode(m)],8,Dy)):i.createCommentVNode("",!0),r.value?(i.openBlock(),i.createElementBlock("a",{key:3,href:`viber://chat?number=${o.value}`,class:"text-purple-600 hover:text-3xl hover:text-purple-600"},[i.createVNode(f)],8,Hy)):i.createCommentVNode("",!0),t.contact.email?(i.openBlock(),i.createElementBlock("a",{key:4,href:`mailto:${t.contact.email}`,class:"hover:text-3xl"},[i.createVNode(g)],8,Wy)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)])],38)]}),default:i.withCtx(()=>{var _,S,C,v;return[t.contact.name?(i.openBlock(),i.createElementBlock("div",jy,[i.createTextVNode(i.toDisplayString(t.contact.name)+" ",1),(_=t.contact)!=null&&_.position?(i.openBlock(),i.createElementBlock("span",qy,i.toDisplayString((S=t.contact)==null?void 0:S.position),1)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0),(C=t.contact)!=null&&C.comment?(i.openBlock(),i.createElementBlock("div",Xy,[d[4]||(d[4]=i.createElementVNode("sup",null,"**",-1)),i.createTextVNode(" "+i.toDisplayString((v=t.contact)==null?void 0:v.comment),1)])):i.createCommentVNode("",!0)]}),_:1},8,["disabled"]),t.fullView&&((b=t.contact)!=null&&b.comment)?(i.openBlock(),i.createElementBlock("div",Yy,[d[5]||(d[5]=i.createElementVNode("sup",null,"**",-1)),i.createTextVNode(" "+i.toDisplayString((y=t.contact)==null?void 0:y.comment),1)])):i.createCommentVNode("",!0)])}}}),Ky={class:"flex flex-wrap gap-2"},Zy={class:"flex flex-col"},Jy={class:"flex flex-col"},Qy={},eb=i.defineComponent({...Qy,__name:"date-range",props:{clearable:{type:Boolean,default:!0},dateRange:{default:void 0},dateFormat:{default:()=>G.AppConfigProvider.getConfig().dateFormats.uiDate},disabled:{default:()=>({from:!1,to:!1})},predefinedDateRanges:{default:void 0},useDefaultPredefinedDateRanges:{type:Boolean,default:!1}},emits:["update:date-range"],setup(t,{emit:e}){const n=t,r=e,s=i.computed(()=>{if(n.predefinedDateRanges)return n.predefinedDateRanges;if(n.useDefaultPredefinedDateRanges){const a={};return A.forOwn(G.DateTimeProvider.defaultDateRanges(),(l,c)=>{a[c]={label:l.label,from:l.from??void 0,to:l.to??void 0}}),a}}),o=(a,l)=>{r("update:date-range",{from:a?Fn.startOfDay(new Date(a)):void 0,to:l?Fn.endOfDay(new Date(l)):void 0})};return(a,l)=>{var h,u,m,f,g,p;const c=V.NButton,d=V.NDatePicker;return i.openBlock(),i.createElementBlock("div",Ky,[i.createVNode(d,{value:((u=(h=t.dateRange)==null?void 0:h.from)==null?void 0:u.getTime())??null,clearable:t.clearable,"is-date-disabled":b=>{var y,_;return((y=t.dateRange)==null?void 0:y.to)&&b>((_=t.dateRange)==null?void 0:_.to)},disabled:(m=t.disabled)==null?void 0:m.from,format:t.dateFormat,type:"date",class:"min-w-28 grow basis-[calc(50%-0.5rem)]",onUpdateValue:l[0]||(l[0]=b=>{var y,_;return o(b,(_=(y=t.dateRange)==null?void 0:y.to)==null?void 0:_.getTime())})},i.createSlots({_:2},[s.value?{name:"footer",fn:i.withCtx(()=>[i.createElementVNode("div",Zy,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(s.value,(b,y)=>(i.openBlock(),i.createBlock(c,{key:y,class:"my-1 mr-2",size:"small",type:"info",ghost:"",onClick:_=>{var S,C;return o((S=b==null?void 0:b.from)==null?void 0:S.getTime(),(C=b==null?void 0:b.to)==null?void 0:C.getTime())}},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(b.label),1)]),_:2},1032,["onClick"]))),128))])]),key:"0"}:void 0]),1032,["value","clearable","is-date-disabled","disabled","format"]),i.createVNode(d,{value:((g=(f=t.dateRange)==null?void 0:f.to)==null?void 0:g.getTime())??null,clearable:t.clearable,"is-date-disabled":b=>{var y,_;return((y=t.dateRange)==null?void 0:y.from)&&b<((_=t.dateRange)==null?void 0:_.from)},disabled:(p=t.disabled)==null?void 0:p.to,format:t.dateFormat,type:"date",class:"min-w-28 grow basis-[calc(50%-0.5rem)]",onUpdateValue:l[1]||(l[1]=b=>{var y,_;return o((_=(y=t.dateRange)==null?void 0:y.from)==null?void 0:_.getTime(),b)})},i.createSlots({_:2},[s.value?{name:"footer",fn:i.withCtx(()=>[i.createElementVNode("div",Jy,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(s.value,(b,y)=>(i.openBlock(),i.createBlock(c,{key:y,class:"my-1 mr-2",size:"small",type:"info",ghost:"",onClick:_=>{var S,C;return o((S=b==null?void 0:b.from)==null?void 0:S.getTime(),(C=b==null?void 0:b.to)==null?void 0:C.getTime())}},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(b.label),1)]),_:2},1032,["onClick"]))),128))])]),key:"0"}:void 0]),1032,["value","clearable","is-date-disabled","disabled","format"])])}}}),tb={class:"sc-lbl-date text-nowrap"},nb={},Po=i.defineComponent({...nb,__name:"date-time-label",props:{date:{},isTimeSecondary:{type:Boolean},isTimeOnSecondLine:{type:Boolean}},setup(t){const e=t,n=i.computed(()=>Fn.format(e.date,G.AppConfigProvider.getConfig().dateFormats.uiDate)),r=i.computed(()=>Fn.format(e.date,"HH:mm"));return(s,o)=>(i.openBlock(),i.createElementBlock("span",{class:i.normalizeClass({"flex flex-col":t.isTimeOnSecondLine})},[i.createElementVNode("span",tb,i.toDisplayString(n.value),1),i.createElementVNode("span",{class:i.normalizeClass([{"text-sc-grey":t.isTimeSecondary,"ml-1":!t.isTimeOnSecondLine},"sc-lbl-time"])},i.toDisplayString(r.value),3)],2))}}),ib={class:"flex flex-row gap-2.5"},rb={class:"flex grow basis-0 flex-row flex-wrap justify-start justify-items-start gap-y-1 md:flex-nowrap"},sb={class:"flex min-w-0 flex-col-reverse flex-wrap-reverse justify-end gap-1 sm:flex-row"},ob={class:"mb-0.5 sm:mb-0 sm:ml-3"},ab={},lb=i.defineComponent({...ab,__name:"dialog-header",props:{showCloseButton:{type:Boolean,default:!0}},emits:["close"],setup(t){return(e,n)=>{const r=ss,s=V.NButton,o=V.NPopover;return i.openBlock(),i.createElementBlock("div",ib,[i.createElementVNode("div",rb,[i.renderSlot(e.$slots,"main")]),i.createElementVNode("div",null,[i.createElementVNode("div",sb,[i.renderSlot(e.$slots,"extra-buttons"),i.createElementVNode("div",ob,[t.showCloseButton?(i.openBlock(),i.createBlock(o,{key:0,placement:"bottom"},{trigger:i.withCtx(()=>[i.createVNode(s,{size:"small",type:"error",onClick:n[0]||(n[0]=a=>e.$emit("close"))},{default:i.withCtx(()=>[i.createVNode(r)]),_:1})]),default:i.withCtx(()=>[n[1]||(n[1]=i.createTextVNode(" Закрыть ",-1))]),_:1})):i.createCommentVNode("",!0)])])])])}}}),cb={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function db(t,e){return i.openBlock(),i.createElementBlock("svg",cb,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M336 176h40a40 40 0 0 1 40 40v208a40 40 0 0 1-40 40H136a40 40 0 0 1-40-40V216a40 40 0 0 1 40-40h40"},null,-1),i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"m176 272l80 80l80-80M256 48v288"},null,-1)])])}const hb=i.markRaw({name:"ion-download-outline",render:db}),ub={},fb=i.defineComponent({...ub,__name:"single-file-upload-selector",props:{draggedAreaText:{},accept:{},isError:{type:Boolean}},emits:["update:file"],setup(t,{emit:e}){const n=t,r=e,s=i.ref([]),o=i.computed(()=>s.value.map(l=>(l.status=n.isError?"error":"finished",l))),a=l=>{s.value=l;const c={name:"",content:""};if(l.length===0){r("update:file",null);return}const d=l[0];c.name=d.name;const h=new FileReader;h.addEventListener("load",()=>{c.content=h.result??"",r("update:file",c)}),h.readAsDataURL(d.file)};return(l,c)=>{const d=hb;return i.openBlock(),i.createBlock(i.unref(V.NUpload),{"file-list":o.value,"default-upload":!1,max:1,"show-retry-button":!1,action:"",accept:t.accept,"directory-dnd":"",class:"content-center","onUpdate:fileList":a},{default:i.withCtx(()=>[i.createVNode(i.unref(V.NUploadDragger),null,{default:i.withCtx(()=>[i.renderSlot(l.$slots,"dragged-area",{},()=>[i.createElementVNode("div",null,[i.createVNode(d,{class:"text-2xl"}),i.createElementVNode("div",null,i.toDisplayString(t.draggedAreaText??"Перетащите в эту область файл, который необходимо загрузить."),1)])])]),_:3})]),_:3},8,["file-list","accept"])}}}),gb={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function mb(t,e){return i.openBlock(),i.createElementBlock("svg",gb,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"square","stroke-miterlimit":"10","stroke-width":"44",d:"M465 127L241 384l-92-92m-9 93l-93-93m316-165L236 273"},null,-1)])])}const pb=i.markRaw({name:"ion-checkmark-done-sharp",render:mb}),yb={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function bb(t,e){return i.openBlock(),i.createElementBlock("svg",yb,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M368 128h80m-384 0h240m64 256h80m-384 0h240m-96-128h240m-384 0h80"},null,-1),i.createElementVNode("circle",{cx:"336",cy:"128",r:"32",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),i.createElementVNode("circle",{cx:"176",cy:"256",r:"32",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),i.createElementVNode("circle",{cx:"336",cy:"384",r:"32",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1)])])}const _b=i.markRaw({name:"ion-options-outline",render:bb}),wb={class:"flex flex-row gap-x-2.5 p-0 sm:p-1"},xb={class:"flex-auto"},vb={class:"sticky top-0 flex flex-none flex-col justify-start gap-y-1 sm:flex-row sm:justify-start sm:gap-x-1 sm:gap-y-0"},kb={class:"flex flex-none flex-col-reverse justify-end gap-y-1 sm:flex-row sm:justify-start sm:gap-x-1 sm:gap-y-0"},Cb={},Fo=i.defineComponent({...Cb,__name:"inline-view",props:{disabled:{type:Boolean,default:!1},showEditButton:{type:Boolean,default:!1},showApplyButton:{type:Boolean,default:!1},showCancelButton:{type:Boolean,default:!1}},emits:["edit","apply","cancel"],setup(t,{emit:e}){const n=e,r=i.ref(!1),s=()=>{n("edit")},o=()=>{r.value=!1},a=()=>{r.value=!0,n("apply",o)},l=()=>{n("cancel",o)};return(c,d)=>{const h=_b,u=V.NButton,m=V.NPopover,f=pb,g=ss;return i.openBlock(),i.createElementBlock("div",wb,[i.createElementVNode("div",xb,[i.renderSlot(c.$slots,"default")]),i.createElementVNode("div",null,[i.createElementVNode("div",vb,[i.createElementVNode("div",kb,[t.showEditButton?(i.openBlock(),i.createBlock(m,{key:0,placement:"bottom"},{trigger:i.withCtx(()=>[i.createVNode(u,{disabled:t.disabled||r.value,type:"info",ghost:"",size:"small",onClick:s},{default:i.withCtx(()=>[i.createVNode(h)]),_:1},8,["disabled"])]),default:i.withCtx(()=>[d[0]||(d[0]=i.createTextVNode(" Редактировать данные ",-1))]),_:1})):i.createCommentVNode("",!0),t.showApplyButton?(i.openBlock(),i.createBlock(m,{key:1,disabled:r.value,placement:"bottom"},{trigger:i.withCtx(()=>[i.createVNode(u,{disabled:t.disabled||r.value,type:"primary",size:"small",onClick:a},{default:i.withCtx(()=>[i.createVNode(f)]),_:1},8,["disabled"])]),default:i.withCtx(()=>[d[1]||(d[1]=i.createTextVNode(" Сохранить изменения ",-1))]),_:1},8,["disabled"])):i.createCommentVNode("",!0),t.showCancelButton?(i.openBlock(),i.createBlock(m,{key:2,placement:"bottom"},{trigger:i.withCtx(()=>[i.createVNode(u,{disabled:t.disabled||r.value,type:"error",size:"small",onClick:l},{default:i.withCtx(()=>[i.createVNode(g)]),_:1},8,["disabled"])]),default:i.withCtx(()=>[d[2]||(d[2]=i.createTextVNode(" Отменить изменения ",-1))]),_:1})):i.createCommentVNode("",!0)]),i.renderSlot(c.$slots,"extra-buttons")])])])}}}),Sb={},Ed=i.defineComponent({...Sb,__name:"inline-editable-item",props:{disabled:{type:Boolean,default:!1},showEditor:{type:Boolean,default:!1},showEditButton:{type:Boolean,default:!0}},emits:["editor:apply","editor:cancel"],setup(t,{emit:e}){const n=t,r=e,s=i.ref(n.showEditor),o=l=>{r("editor:apply",d=>{s.value=!d,l()})},a=l=>{s.value=!1,l(),r("editor:cancel")};return i.onMounted(()=>{i.watch(()=>n.showEditor,l=>{s.value=l})}),(l,c)=>(i.openBlock(),i.createElementBlock("div",null,[s.value?(i.openBlock(),i.createBlock(Fo,{key:1,disabled:t.disabled,"show-apply-button":!0,"show-cancel-button":!0,onApply:o,onCancel:a},{"extra-buttons":i.withCtx(()=>[i.renderSlot(l.$slots,"extra-editor-buttons")]),default:i.withCtx(()=>[i.renderSlot(l.$slots,"editor")]),_:3},8,["disabled"])):(i.openBlock(),i.createBlock(Fo,{key:0,disabled:t.disabled,"show-edit-button":t.showEditButton,onEdit:c[0]||(c[0]=d=>s.value=!0)},{"extra-buttons":i.withCtx(()=>[i.renderSlot(l.$slots,"extra-viewer-buttons")]),default:i.withCtx(()=>[i.renderSlot(l.$slots,"viewer")]),_:3},8,["disabled","show-edit-button"]))]))}}),Bb={},Tb=i.defineComponent({...Bb,__name:"debounced-input",props:{value:{default:void 0},clearable:{type:Boolean,default:!1},debounceTime:{default:800},placeholder:{default:""}},emits:["update:value"],setup(t,{emit:e}){const n=t,r=e,s=i.ref(n.value),o=i.computed(()=>i.inject("debounce-input-time",n.debounceTime)),a=A.debounce(()=>r("update:value",s.value),o.value),l=c=>{s.value=c,a()};return i.watch(()=>n.value,c=>{s.value=c}),(c,d)=>(i.openBlock(),i.createBlock(i.unref(V.NInput),{value:s.value,"onUpdate:value":[d[0]||(d[0]=h=>s.value=h),l],clearable:t.clearable,placeholder:t.placeholder},{prefix:i.withCtx(()=>[i.renderSlot(c.$slots,"prefix")]),_:3},8,["value","clearable","placeholder"]))}}),Rb={},$b=i.defineComponent({...Rb,__name:"phone-input",props:{value:{},debounceTime:{},disabled:{type:Boolean},placeholder:{},defaultCountry:{},preferredCountries:{},onlyCountries:{}},emits:["update:value"],setup(t,{emit:e}){const n=t,r=e,s=i.ref((n.value??"").replaceAll(/\D*/g,"")),o=A.debounce(c=>r("update:value",c),n.debounceTime??0),a=c=>{let d="";if(A.isString(c))s.value=c,d=c.replaceAll(/(\s|\(|\)|-|_)*/g,"");else if(A.isObject(c)){if(s.value=c.formatted,!c.valid)return;d=c instanceof Ji.PhoneNumber?c.format("E.164"):`+${c.countryCallingCode}${c.nationalNumber}`}n.debounceTime?o(d):r("update:value",d)},l=c=>{const d=c.replaceAll(/\D*/g,"");try{const h=Ji.parsePhoneNumberWithError(`+${d}`);h.isValid()?s.value=h.format("E.164"):h.getPossibleCountries().length>0&&(s.value=`+${d}`)}catch(h){if(h instanceof Ji.ParseError)s.value=d;else throw h}};return i.watch(()=>n.value,c=>{var d;(c==null?void 0:c.replaceAll(/\D*/g,""))!==((d=s.value)==null?void 0:d.replaceAll(/\D*/g,""))&&l(c)},{immediate:!0}),i.onBeforeMount(()=>l(s.value??"")),(c,d)=>(i.openBlock(),i.createBlock(i.unref(Au.VueTelInput),{modelValue:s.value,"onUpdate:modelValue":[d[0]||(d[0]=h=>s.value=h),a],"auto-default-country":!1,"auto-format":!0,"default-country":t.defaultCountry,disabled:t.disabled,"input-options":{placeholder:t.placeholder},"preferred-countries":t.preferredCountries,"only-countries":t.onlyCountries,mode:"international",class:"tel-input"},null,8,["modelValue","default-country","disabled","input-options","preferred-countries","only-countries"]))}}),Eb=Kn($b,[["__scopeId","data-v-751dbb0e"]]),Nb={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Pb(t,e){return i.openBlock(),i.createElementBlock("svg",Nb,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 6H6a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2v-6m-7 1l9-9m-5 0h5v5"},null,-1)])])}const Fb=i.markRaw({name:"tabler-external-link",render:Pb}),Mb={class:"flex flex-row gap-1 hover:underline hover:decoration-dashed"},Ab=["href"],Ob={},Vb=i.defineComponent({...Ob,__name:"external-link",props:{text:{},url:{},description:{}},setup(t){return(e,n)=>{const r=Fb,s=V.NTooltip;return i.openBlock(),i.createBlock(s,{disabled:i.unref(A.isUndefined)(t.description),placement:"top-start"},{trigger:i.withCtx(()=>[i.createElementVNode("span",Mb,[i.createElementVNode("a",{href:t.url,target:"_blank",class:"no-underline"},i.toDisplayString(t.text),9,Ab),i.createVNode(r,{class:"mt-0.5 flex-none"})])]),default:i.withCtx(()=>[i.createTextVNode(" "+i.toDisplayString(t.description),1)]),_:1},8,["disabled"])}}}),Ib={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function zb(t,e){return i.openBlock(),i.createElementBlock("svg",Ib,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-miterlimit":"10","stroke-width":"32",d:"M448 256c0-106-86-192-192-192S64 150 64 256s86 192 192 192s192-86 192-192Z"},null,-1),i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M336 256H176"},null,-1)])])}const Lb=i.markRaw({name:"ion-remove-circle-outline",render:zb});let as=[];const Nd=new WeakMap;function Db(){as.forEach(t=>t(...Nd.get(t))),as=[]}function Pd(t,...e){Nd.set(t,e),!as.includes(t)&&as.push(t)===1&&requestAnimationFrame(Db)}function lr(t,e){let{target:n}=t;for(;n;){if(n.dataset&&n.dataset[e]!==void 0)return!0;n=n.parentElement}return!1}function cr(t){return t.composedPath()[0]||null}function dr(t){return typeof t=="string"?t.endsWith("px")?Number(t.slice(0,t.length-2)):Number(t):t}function hr(t){if(t!=null)return typeof t=="number"?`${t}px`:t.endsWith("px")?t:`${t}px`}function Ut(t,e){const n=t.trim().split(/\s+/g),r={top:n[0]};switch(n.length){case 1:r.right=n[0],r.bottom=n[0],r.left=n[0];break;case 2:r.right=n[1],r.left=n[1],r.bottom=n[0];break;case 3:r.right=n[1],r.bottom=n[2],r.left=n[1];break;case 4:r.right=n[1],r.bottom=n[2],r.left=n[3];break;default:throw new Error("[seemly/getMargin]:"+t+" is not a valid value.")}return e===void 0?r:r[e]}const Fd={aliceblue:"#F0F8FF",antiquewhite:"#FAEBD7",aqua:"#0FF",aquamarine:"#7FFFD4",azure:"#F0FFFF",beige:"#F5F5DC",bisque:"#FFE4C4",black:"#000",blanchedalmond:"#FFEBCD",blue:"#00F",blueviolet:"#8A2BE2",brown:"#A52A2A",burlywood:"#DEB887",cadetblue:"#5F9EA0",chartreuse:"#7FFF00",chocolate:"#D2691E",coral:"#FF7F50",cornflowerblue:"#6495ED",cornsilk:"#FFF8DC",crimson:"#DC143C",cyan:"#0FF",darkblue:"#00008B",darkcyan:"#008B8B",darkgoldenrod:"#B8860B",darkgray:"#A9A9A9",darkgrey:"#A9A9A9",darkgreen:"#006400",darkkhaki:"#BDB76B",darkmagenta:"#8B008B",darkolivegreen:"#556B2F",darkorange:"#FF8C00",darkorchid:"#9932CC",darkred:"#8B0000",darksalmon:"#E9967A",darkseagreen:"#8FBC8F",darkslateblue:"#483D8B",darkslategray:"#2F4F4F",darkslategrey:"#2F4F4F",darkturquoise:"#00CED1",darkviolet:"#9400D3",deeppink:"#FF1493",deepskyblue:"#00BFFF",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1E90FF",firebrick:"#B22222",floralwhite:"#FFFAF0",forestgreen:"#228B22",fuchsia:"#F0F",gainsboro:"#DCDCDC",ghostwhite:"#F8F8FF",gold:"#FFD700",goldenrod:"#DAA520",gray:"#808080",grey:"#808080",green:"#008000",greenyellow:"#ADFF2F",honeydew:"#F0FFF0",hotpink:"#FF69B4",indianred:"#CD5C5C",indigo:"#4B0082",ivory:"#FFFFF0",khaki:"#F0E68C",lavender:"#E6E6FA",lavenderblush:"#FFF0F5",lawngreen:"#7CFC00",lemonchiffon:"#FFFACD",lightblue:"#ADD8E6",lightcoral:"#F08080",lightcyan:"#E0FFFF",lightgoldenrodyellow:"#FAFAD2",lightgray:"#D3D3D3",lightgrey:"#D3D3D3",lightgreen:"#90EE90",lightpink:"#FFB6C1",lightsalmon:"#FFA07A",lightseagreen:"#20B2AA",lightskyblue:"#87CEFA",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#B0C4DE",lightyellow:"#FFFFE0",lime:"#0F0",limegreen:"#32CD32",linen:"#FAF0E6",magenta:"#F0F",maroon:"#800000",mediumaquamarine:"#66CDAA",mediumblue:"#0000CD",mediumorchid:"#BA55D3",mediumpurple:"#9370DB",mediumseagreen:"#3CB371",mediumslateblue:"#7B68EE",mediumspringgreen:"#00FA9A",mediumturquoise:"#48D1CC",mediumvioletred:"#C71585",midnightblue:"#191970",mintcream:"#F5FFFA",mistyrose:"#FFE4E1",moccasin:"#FFE4B5",navajowhite:"#FFDEAD",navy:"#000080",oldlace:"#FDF5E6",olive:"#808000",olivedrab:"#6B8E23",orange:"#FFA500",orangered:"#FF4500",orchid:"#DA70D6",palegoldenrod:"#EEE8AA",palegreen:"#98FB98",paleturquoise:"#AFEEEE",palevioletred:"#DB7093",papayawhip:"#FFEFD5",peachpuff:"#FFDAB9",peru:"#CD853F",pink:"#FFC0CB",plum:"#DDA0DD",powderblue:"#B0E0E6",purple:"#800080",rebeccapurple:"#663399",red:"#F00",rosybrown:"#BC8F8F",royalblue:"#4169E1",saddlebrown:"#8B4513",salmon:"#FA8072",sandybrown:"#F4A460",seagreen:"#2E8B57",seashell:"#FFF5EE",sienna:"#A0522D",silver:"#C0C0C0",skyblue:"#87CEEB",slateblue:"#6A5ACD",slategray:"#708090",slategrey:"#708090",snow:"#FFFAFA",springgreen:"#00FF7F",steelblue:"#4682B4",tan:"#D2B48C",teal:"#008080",thistle:"#D8BFD8",tomato:"#FF6347",turquoise:"#40E0D0",violet:"#EE82EE",wheat:"#F5DEB3",white:"#FFF",whitesmoke:"#F5F5F5",yellow:"#FF0",yellowgreen:"#9ACD32",transparent:"#0000"};function Hb(t,e,n){e/=100,n/=100;let r=(s,o=(s+t/60)%6)=>n-n*e*Math.max(Math.min(o,4-o,1),0);return[r(5)*255,r(3)*255,r(1)*255]}function Wb(t,e,n){e/=100,n/=100;let r=e*Math.min(n,1-n),s=(o,a=(o+t/30)%12)=>n-r*Math.max(Math.min(a-3,9-a,1),-1);return[s(0)*255,s(8)*255,s(4)*255]}const dn="^\\s*",hn="\\s*$",zn="\\s*((\\.\\d+)|(\\d+(\\.\\d*)?))%\\s*",At="\\s*((\\.\\d+)|(\\d+(\\.\\d*)?))\\s*",ri="([0-9A-Fa-f])",si="([0-9A-Fa-f]{2})",Md=new RegExp(`${dn}hsl\\s*\\(${At},${zn},${zn}\\)${hn}`),Ad=new RegExp(`${dn}hsv\\s*\\(${At},${zn},${zn}\\)${hn}`),Od=new RegExp(`${dn}hsla\\s*\\(${At},${zn},${zn},${At}\\)${hn}`),Vd=new RegExp(`${dn}hsva\\s*\\(${At},${zn},${zn},${At}\\)${hn}`),jb=new RegExp(`${dn}rgb\\s*\\(${At},${At},${At}\\)${hn}`),qb=new RegExp(`${dn}rgba\\s*\\(${At},${At},${At},${At}\\)${hn}`),Xb=new RegExp(`${dn}#${ri}${ri}${ri}${hn}`),Yb=new RegExp(`${dn}#${si}${si}${si}${hn}`),Ub=new RegExp(`${dn}#${ri}${ri}${ri}${ri}${hn}`),Gb=new RegExp(`${dn}#${si}${si}${si}${si}${hn}`);function Et(t){return parseInt(t,16)}function Kb(t){try{let e;if(e=Od.exec(t))return[cs(e[1]),Ln(e[5]),Ln(e[9]),ai(e[13])];if(e=Md.exec(t))return[cs(e[1]),Ln(e[5]),Ln(e[9]),1];throw new Error(`[seemly/hsla]: Invalid color value ${t}.`)}catch(e){throw e}}function Zb(t){try{let e;if(e=Vd.exec(t))return[cs(e[1]),Ln(e[5]),Ln(e[9]),ai(e[13])];if(e=Ad.exec(t))return[cs(e[1]),Ln(e[5]),Ln(e[9]),1];throw new Error(`[seemly/hsva]: Invalid color value ${t}.`)}catch(e){throw e}}function oi(t){try{let e;if(e=Yb.exec(t))return[Et(e[1]),Et(e[2]),Et(e[3]),1];if(e=jb.exec(t))return[ut(e[1]),ut(e[5]),ut(e[9]),1];if(e=qb.exec(t))return[ut(e[1]),ut(e[5]),ut(e[9]),ai(e[13])];if(e=Xb.exec(t))return[Et(e[1]+e[1]),Et(e[2]+e[2]),Et(e[3]+e[3]),1];if(e=Gb.exec(t))return[Et(e[1]),Et(e[2]),Et(e[3]),ai(Et(e[4])/255)];if(e=Ub.exec(t))return[Et(e[1]+e[1]),Et(e[2]+e[2]),Et(e[3]+e[3]),ai(Et(e[4]+e[4])/255)];if(t in Fd)return oi(Fd[t]);if(Md.test(t)||Od.test(t)){const[n,r,s,o]=Kb(t);return[...Wb(n,r,s),o]}else if(Ad.test(t)||Vd.test(t)){const[n,r,s,o]=Zb(t);return[...Hb(n,r,s),o]}throw new Error(`[seemly/rgba]: Invalid color value ${t}.`)}catch(e){throw e}}function Jb(t){return t>1?1:t<0?0:t}function Mo(t,e,n,r){return`rgba(${ut(t)}, ${ut(e)}, ${ut(n)}, ${Jb(r)})`}function Ao(t,e,n,r,s){return ut((t*e*(1-r)+n*r)/s)}function Qb(t,e){Array.isArray(t)||(t=oi(t)),Array.isArray(e)||(e=oi(e));const n=t[3],r=e[3],s=ai(n+r-n*r);return Mo(Ao(t[0],n,e[0],r,s),Ao(t[1],n,e[1],r,s),Ao(t[2],n,e[2],r,s),s)}function Pe(t,e){const[n,r,s,o=1]=Array.isArray(t)?t:oi(t);return typeof e.alpha=="number"?Mo(n,r,s,e.alpha):Mo(n,r,s,o)}function ls(t,e){const[n,r,s,o=1]=Array.isArray(t)?t:oi(t),{lightness:a=1,alpha:l=1}=e;return e_([n*a,r*a,s*a,o*l])}function ai(t){const e=Math.round(Number(t)*100)/100;return e>1?1:e<0?0:e}function cs(t){const e=Math.round(Number(t));return e>=360||e<0?0:e}function ut(t){const e=Math.round(Number(t));return e>255?255:e<0?0:e}function Ln(t){const e=Math.round(Number(t));return e>100?100:e<0?0:e}function e_(t){const[e,n,r]=t;return 3 in t?`rgba(${ut(e)}, ${ut(n)}, ${ut(r)}, ${ai(t[3])})`:`rgba(${ut(e)}, ${ut(n)}, ${ut(r)}, 1)`}function t_(t=8){return Math.random().toString(16).slice(2,2+t)}function Id(t){return Array.isArray(t)?t:[t]}const Oo={STOP:"STOP"};function zd(t,e){const n=e(t);t.children!==void 0&&n!==Oo.STOP&&t.children.forEach(r=>zd(r,e))}function n_(t,e={}){const{preserveGroup:n=!1}=e,r=[],s=n?a=>{a.isLeaf||(r.push(a.key),o(a.children))}:a=>{a.isLeaf||(a.isGroup||r.push(a.key),o(a.children))};function o(a){a.forEach(s)}return o(t),r}function i_(t,e){const{isLeaf:n}=t;return n!==void 0?n:!e(t)}function r_(t){return t.children}function s_(t){return t.key}function o_(){return!1}function a_(t,e){const{isLeaf:n}=t;return!(n===!1&&!Array.isArray(e(t)))}function l_(t){return t.disabled===!0}function c_(t,e){return t.isLeaf===!1&&!Array.isArray(e(t))}function d_(t,e){if(t.isLeaf===!0){const n=e(t);if(Array.isArray(n)&&n.length>0)return!0}return!1}function Vo(t){var e;return t==null?[]:Array.isArray(t)?t:(e=t.checkedKeys)!==null&&e!==void 0?e:[]}function Io(t){var e;return t==null||Array.isArray(t)?[]:(e=t.indeterminateKeys)!==null&&e!==void 0?e:[]}function h_(t,e){const n=new Set(t);return e.forEach(r=>{n.has(r)||n.add(r)}),Array.from(n)}function u_(t,e){const n=new Set(t);return e.forEach(r=>{n.has(r)&&n.delete(r)}),Array.from(n)}function f_(t){return(t==null?void 0:t.type)==="group"}function g_(t){const e=new Map;return t.forEach((n,r)=>{e.set(n.key,r)}),n=>{var r;return(r=e.get(n))!==null&&r!==void 0?r:null}}class m_ extends Error{constructor(){super(),this.message="SubtreeNotLoadedError: checking a subtree whose required nodes are not fully loaded."}}function p_(t,e,n,r){return ds(e.concat(t),n,r,!1)}function y_(t,e){const n=new Set;return t.forEach(r=>{const s=e.treeNodeMap.get(r);if(s!==void 0){let o=s.parent;for(;o!==null&&!(o.disabled||n.has(o.key));)n.add(o.key),o=o.parent}}),n}function b_(t,e,n,r){const s=ds(e,n,r,!1),o=ds(t,n,r,!0),a=y_(t,n),l=[];return s.forEach(c=>{(o.has(c)||a.has(c))&&l.push(c)}),l.forEach(c=>s.delete(c)),s}function zo(t,e){const{checkedKeys:n,keysToCheck:r,keysToUncheck:s,indeterminateKeys:o,cascade:a,leafOnly:l,checkStrategy:c,allowNotLoaded:d}=t;if(!a)return r!==void 0?{checkedKeys:h_(n,r),indeterminateKeys:Array.from(o)}:s!==void 0?{checkedKeys:u_(n,s),indeterminateKeys:Array.from(o)}:{checkedKeys:Array.from(n),indeterminateKeys:Array.from(o)};const{levelTreeNodeMap:h}=e;let u;s!==void 0?u=b_(s,n,e,d):r!==void 0?u=p_(r,n,e,d):u=ds(n,e,d,!1);const m=c==="parent",f=c==="child"||l,g=u,p=new Set,b=Math.max.apply(null,Array.from(h.keys()));for(let y=b;y>=0;y-=1){const _=y===0,S=h.get(y);for(const C of S){if(C.isLeaf)continue;const{key:v,shallowLoaded:B}=C;if(f&&B&&C.children.forEach(F=>{!F.disabled&&!F.isLeaf&&F.shallowLoaded&&g.has(F.key)&&g.delete(F.key)}),C.disabled||!B)continue;let k=!0,R=!1,$=!0;for(const F of C.children){const D=F.key;if(!F.disabled){if($&&($=!1),g.has(D))R=!0;else if(p.has(D)){R=!0,k=!1;break}else if(k=!1,R)break}}k&&!$?(m&&C.children.forEach(F=>{!F.disabled&&g.has(F.key)&&g.delete(F.key)}),g.add(v)):R&&p.add(v),_&&f&&g.has(v)&&g.delete(v)}}return{checkedKeys:Array.from(g),indeterminateKeys:Array.from(p)}}function ds(t,e,n,r){const{treeNodeMap:s,getChildren:o}=e,a=new Set,l=new Set(t);return t.forEach(c=>{const d=s.get(c);d!==void 0&&zd(d,h=>{if(h.disabled)return Oo.STOP;const{key:u}=h;if(!a.has(u)&&(a.add(u),l.add(u),c_(h.rawNode,o))){if(r)return Oo.STOP;if(!n)throw new m_}})}),l}function __(t,{includeGroup:e=!1,includeSelf:n=!0},r){var s;const o=r.treeNodeMap;let a=t==null?null:(s=o.get(t))!==null&&s!==void 0?s:null;const l={keyPath:[],treeNodePath:[],treeNode:a};if(a!=null&&a.ignored)return l.treeNode=null,l;for(;a;)!a.ignored&&(e||!a.isGroup)&&l.treeNodePath.push(a),a=a.parent;return l.treeNodePath.reverse(),n||l.treeNodePath.pop(),l.keyPath=l.treeNodePath.map(c=>c.key),l}function w_(t){if(t.length===0)return null;const e=t[0];return e.isGroup||e.ignored||e.disabled?e.getNext():e}function x_(t,e){const n=t.siblings,r=n.length,{index:s}=t;return e?n[(s+1)%r]:s===n.length-1?null:n[s+1]}function Ld(t,e,{loop:n=!1,includeDisabled:r=!1}={}){const s=e==="prev"?v_:x_,o={reverse:e==="prev"};let a=!1,l=null;function c(d){if(d!==null){if(d===t){if(!a)a=!0;else if(!t.disabled&&!t.isGroup){l=t;return}}else if((!d.disabled||r)&&!d.ignored&&!d.isGroup){l=d;return}if(d.isGroup){const h=Lo(d,o);h!==null?l=h:c(s(d,n))}else{const h=s(d,!1);if(h!==null)c(h);else{const u=k_(d);u!=null&&u.isGroup?c(s(u,n)):n&&c(s(d,!0))}}}}return c(t),l}function v_(t,e){const n=t.siblings,r=n.length,{index:s}=t;return e?n[(s-1+r)%r]:s===0?null:n[s-1]}function k_(t){return t.parent}function Lo(t,e={}){const{reverse:n=!1}=e,{children:r}=t;if(r){const{length:s}=r,o=n?s-1:0,a=n?-1:s,l=n?-1:1;for(let c=o;c!==a;c+=l){const d=r[c];if(!d.disabled&&!d.ignored)if(d.isGroup){const h=Lo(d,e);if(h!==null)return h}else return d}}return null}const C_={getChild(){return this.ignored?null:Lo(this)},getParent(){const{parent:t}=this;return t!=null&&t.isGroup?t.getParent():t},getNext(t={}){return Ld(this,"next",t)},getPrev(t={}){return Ld(this,"prev",t)}};function S_(t,e){const n=e?new Set(e):void 0,r=[];function s(o){o.forEach(a=>{r.push(a),!(a.isLeaf||!a.children||a.ignored)&&(a.isGroup||n===void 0||n.has(a.key))&&s(a.children)})}return s(t),r}function B_(t,e){const n=t.key;for(;e;){if(e.key===n)return!0;e=e.parent}return!1}var T_={};function Dd(t,e,n,r,s,o=null,a=0){const l=[];return t.forEach((c,d)=>{var h;T_.NODE_ENV!=="production"&&d_(c,s)&&console.error("[treemate]: node",c,"is invalid");const u=Object.create(r);if(u.rawNode=c,u.siblings=l,u.level=a,u.index=d,u.isFirstChild=d===0,u.isLastChild=d+1===t.length,u.parent=o,!u.ignored){const m=s(c);Array.isArray(m)&&(u.children=Dd(m,e,n,r,s,u,a+1))}l.push(u),e.set(u.key,u),n.has(a)||n.set(a,[]),(h=n.get(a))===null||h===void 0||h.push(u)}),l}function R_(t,e={}){var n;const r=new Map,s=new Map,{getDisabled:o=l_,getIgnored:a=o_,getIsGroup:l=f_,getKey:c=s_}=e,d=(n=e.getChildren)!==null&&n!==void 0?n:r_,h=e.ignoreEmptyChildren?C=>{const v=d(C);return Array.isArray(v)?v.length?v:null:v}:d,u=Object.assign({get key(){return c(this.rawNode)},get disabled(){return o(this.rawNode)},get isGroup(){return l(this.rawNode)},get isLeaf(){return i_(this.rawNode,h)},get shallowLoaded(){return a_(this.rawNode,h)},get ignored(){return a(this.rawNode)},contains(C){return B_(this,C)}},C_),m=Dd(t,r,s,u,h);function f(C){if(C==null)return null;const v=r.get(C);return v&&!v.isGroup&&!v.ignored?v:null}function g(C){if(C==null)return null;const v=r.get(C);return v&&!v.ignored?v:null}function p(C,v){const B=g(C);return B?B.getPrev(v):null}function b(C,v){const B=g(C);return B?B.getNext(v):null}function y(C){const v=g(C);return v?v.getParent():null}function _(C){const v=g(C);return v?v.getChild():null}const S={treeNodes:m,treeNodeMap:r,levelTreeNodeMap:s,maxLevel:Math.max(...s.keys()),getChildren:h,getFlattenedNodes(C){return S_(m,C)},getNode:f,getPrev:p,getNext:b,getParent:y,getChild:_,getFirstAvailableNode(){return w_(m)},getPath(C,v={}){return __(C,v,S)},getCheckedKeys(C,v={}){const{cascade:B=!0,leafOnly:k=!1,checkStrategy:R="all",allowNotLoaded:$=!1}=v;return zo({checkedKeys:Vo(C),indeterminateKeys:Io(C),cascade:B,leafOnly:k,checkStrategy:R,allowNotLoaded:$},S)},check(C,v,B={}){const{cascade:k=!0,leafOnly:R=!1,checkStrategy:$="all",allowNotLoaded:F=!1}=B;return zo({checkedKeys:Vo(v),indeterminateKeys:Io(v),keysToCheck:C==null?[]:Id(C),cascade:k,leafOnly:R,checkStrategy:$,allowNotLoaded:F},S)},uncheck(C,v,B={}){const{cascade:k=!0,leafOnly:R=!1,checkStrategy:$="all",allowNotLoaded:F=!1}=B;return zo({checkedKeys:Vo(v),indeterminateKeys:Io(v),keysToUncheck:C==null?[]:Id(C),cascade:k,leafOnly:R,checkStrategy:$,allowNotLoaded:F},S)},getNonLeafKeys(C={}){return n_(m,C)}};return S}function hs(t){return t.composedPath()[0]}const $_={mousemoveoutside:new WeakMap,clickoutside:new WeakMap};function E_(t,e,n){if(t==="mousemoveoutside"){const r=s=>{e.contains(hs(s))||n(s)};return{mousemove:r,touchstart:r}}else if(t==="clickoutside"){let r=!1;const s=a=>{r=!e.contains(hs(a))},o=a=>{r&&(e.contains(hs(a))||n(a))};return{mousedown:s,mouseup:o,touchstart:s,touchend:o}}return console.error(`[evtd/create-trap-handler]: name \`${t}\` is invalid. This could be a bug of evtd.`),{}}function Hd(t,e,n){const r=$_[t];let s=r.get(e);s===void 0&&r.set(e,s=new WeakMap);let o=s.get(n);return o===void 0&&s.set(n,o=E_(t,e,n)),o}function N_(t,e,n,r){if(t==="mousemoveoutside"||t==="clickoutside"){const s=Hd(t,e,n);return Object.keys(s).forEach(o=>{Ct(o,document,s[o],r)}),!0}return!1}function P_(t,e,n,r){if(t==="mousemoveoutside"||t==="clickoutside"){const s=Hd(t,e,n);return Object.keys(s).forEach(o=>{et(o,document,s[o],r)}),!0}return!1}function F_(){if(typeof window>"u")return{on:()=>{},off:()=>{}};const t=new WeakMap,e=new WeakMap;function n(){t.set(this,!0)}function r(){t.set(this,!0),e.set(this,!0)}function s(k,R,$){const F=k[R];return k[R]=function(){return $.apply(k,arguments),F.apply(k,arguments)},k}function o(k,R){k[R]=Event.prototype[R]}const a=new WeakMap,l=Object.getOwnPropertyDescriptor(Event.prototype,"currentTarget");function c(){var k;return(k=a.get(this))!==null&&k!==void 0?k:null}function d(k,R){l!==void 0&&Object.defineProperty(k,"currentTarget",{configurable:!0,enumerable:!0,get:R??l.get})}const h={bubble:{},capture:{}},u={};function m(){const k=function(R){const{type:$,eventPhase:F,bubbles:D}=R,L=hs(R);if(F===2)return;const M=F===1?"capture":"bubble";let z=L;const O=[];for(;z===null&&(z=window),O.push(z),z!==window;)z=z.parentNode||null;const ne=h.capture[$],P=h.bubble[$];if(s(R,"stopPropagation",n),s(R,"stopImmediatePropagation",r),d(R,c),M==="capture"){if(ne===void 0)return;for(let E=O.length-1;E>=0&&!t.has(R);--E){const X=O[E],j=ne.get(X);if(j!==void 0){a.set(R,X);for(const H of j){if(e.has(R))break;H(R)}}if(E===0&&!D&&P!==void 0){const H=P.get(X);if(H!==void 0)for(const N of H){if(e.has(R))break;N(R)}}}}else if(M==="bubble"){if(P===void 0)return;for(let E=0;E<O.length&&!t.has(R);++E){const X=O[E],j=P.get(X);if(j!==void 0){a.set(R,X);for(const H of j){if(e.has(R))break;H(R)}}}}o(R,"stopPropagation"),o(R,"stopImmediatePropagation"),d(R)};return k.displayName="evtdUnifiedHandler",k}function f(){const k=function(R){const{type:$,eventPhase:F}=R;if(F!==2)return;const D=u[$];D!==void 0&&D.forEach(L=>L(R))};return k.displayName="evtdUnifiedWindowEventHandler",k}const g=m(),p=f();function b(k,R){const $=h[k];return $[R]===void 0&&($[R]=new Map,window.addEventListener(R,g,k==="capture")),$[R]}function y(k){return u[k]===void 0&&(u[k]=new Set,window.addEventListener(k,p)),u[k]}function _(k,R){let $=k.get(R);return $===void 0&&k.set(R,$=new Set),$}function S(k,R,$,F){const D=h[R][$];if(D!==void 0){const L=D.get(k);if(L!==void 0&&L.has(F))return!0}return!1}function C(k,R){const $=u[k];return!!($!==void 0&&$.has(R))}function v(k,R,$,F){let D;if(typeof F=="object"&&F.once===!0?D=ne=>{B(k,R,D,F),$(ne)}:D=$,N_(k,R,D,F))return;const M=F===!0||typeof F=="object"&&F.capture===!0?"capture":"bubble",z=b(M,k),O=_(z,R);if(O.has(D)||O.add(D),R===window){const ne=y(k);ne.has(D)||ne.add(D)}}function B(k,R,$,F){if(P_(k,R,$,F))return;const L=F===!0||typeof F=="object"&&F.capture===!0,M=L?"capture":"bubble",z=b(M,k),O=_(z,R);if(R===window&&!S(R,L?"bubble":"capture",k,$)&&C(k,$)){const P=u[k];P.delete($),P.size===0&&(window.removeEventListener(k,p),u[k]=void 0)}O.has($)&&O.delete($),O.size===0&&z.delete(R),z.size===0&&(window.removeEventListener(k,g,M==="capture"),h[M][k]=void 0)}return{on:v,off:B}}const{on:Ct,off:et}=F_(),Di="@@mmoContext",M_={mounted(t,{value:e}){t[Di]={handler:void 0},typeof e=="function"&&(t[Di].handler=e,Ct("mousemoveoutside",t,e))},updated(t,{value:e}){const n=t[Di];typeof e=="function"?n.handler?n.handler!==e&&(et("mousemoveoutside",t,n.handler),n.handler=e,Ct("mousemoveoutside",t,e)):(t[Di].handler=e,Ct("mousemoveoutside",t,e)):n.handler&&(et("mousemoveoutside",t,n.handler),n.handler=void 0)},unmounted(t){const{handler:e}=t[Di];e&&et("mousemoveoutside",t,e),t[Di].handler=void 0}},Hi="@@coContext",us={mounted(t,{value:e,modifiers:n}){t[Hi]={handler:void 0},typeof e=="function"&&(t[Hi].handler=e,Ct("clickoutside",t,e,{capture:n.capture}))},updated(t,{value:e,modifiers:n}){const r=t[Hi];typeof e=="function"?r.handler?r.handler!==e&&(et("clickoutside",t,r.handler,{capture:n.capture}),r.handler=e,Ct("clickoutside",t,e,{capture:n.capture})):(t[Hi].handler=e,Ct("clickoutside",t,e,{capture:n.capture})):r.handler&&(et("clickoutside",t,r.handler,{capture:n.capture}),r.handler=void 0)},unmounted(t,{modifiers:e}){const{handler:n}=t[Hi];n&&et("clickoutside",t,n,{capture:e.capture}),t[Hi].handler=void 0}};function A_(t,e){console.error(`[vdirs/${t}]: ${e}`)}class O_{constructor(){this.elementZIndex=new Map,this.nextZIndex=2e3}get elementCount(){return this.elementZIndex.size}ensureZIndex(e,n){const{elementZIndex:r}=this;if(n!==void 0){e.style.zIndex=`${n}`,r.delete(e);return}const{nextZIndex:s}=this;r.has(e)&&r.get(e)+1===this.nextZIndex||(e.style.zIndex=`${s}`,r.set(e,s),this.nextZIndex=s+1,this.squashState())}unregister(e,n){const{elementZIndex:r}=this;r.has(e)?r.delete(e):n===void 0&&A_("z-index-manager/unregister-element","Element not found when unregistering."),this.squashState()}squashState(){const{elementCount:e}=this;e||(this.nextZIndex=2e3),this.nextZIndex-e>2500&&this.rearrange()}rearrange(){const e=Array.from(this.elementZIndex.entries());e.sort((n,r)=>n[1]-r[1]),this.nextZIndex=2e3,e.forEach(n=>{const r=n[0],s=this.nextZIndex++;`${s}`!==r.style.zIndex&&(r.style.zIndex=`${s}`)})}}const Do=new O_,Wi="@@ziContext",Wd={mounted(t,e){const{value:n={}}=e,{zIndex:r,enabled:s}=n;t[Wi]={enabled:!!s,initialized:!1},s&&(Do.ensureZIndex(t,r),t[Wi].initialized=!0)},updated(t,e){const{value:n={}}=e,{zIndex:r,enabled:s}=n,o=t[Wi].enabled;s&&!o&&(Do.ensureZIndex(t,r),t[Wi].initialized=!0),t[Wi].enabled=!!s},unmounted(t,e){if(!t[Wi].initialized)return;const{value:n={}}=e,{zIndex:r}=n;Do.unregister(t,r)}};function V_(t){const e=i.ref(!!t.value);if(e.value)return i.readonly(e);const n=i.watch(t,r=>{r&&(e.value=!0,n())});return i.readonly(e)}function jt(t){const e=i.computed(t),n=i.ref(e.value);return i.watch(e,r=>{n.value=r}),typeof t=="function"?n:{__v_isRef:!0,get value(){return n.value},set value(r){t.set(r)}}}const I_=typeof window<"u";let ji,ur;(()=>{var t,e;ji=I_?(e=(t=document)===null||t===void 0?void 0:t.fonts)===null||e===void 0?void 0:e.ready:void 0,ur=!1,ji!==void 0?ji.then(()=>{ur=!0}):ur=!0})();function z_(t){if(ur)return;let e=!1;i.onMounted(()=>{ur||ji==null||ji.then(()=>{e||t()})}),i.onBeforeUnmount(()=>{e=!0})}function Ho(t,e){return i.watch(t,n=>{n!==void 0&&(e.value=n)}),i.computed(()=>t.value===void 0?e.value:t.value)}function fs(){const t=i.ref(!1);return i.onMounted(()=>{t.value=!0}),i.readonly(t)}function jd(t,e){return i.computed(()=>{for(const n of e)if(t[n]!==void 0)return t[n];return t[e[e.length-1]]})}const L_=(typeof window>"u"?!1:/iPad|iPhone|iPod/.test(navigator.platform)||navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1)&&!window.MSStream;function D_(){return L_}function Wo(t,e,n="default"){const r=e[n];if(r===void 0)throw new Error(`[vueuc/${t}]: slot[${n}] is empty.`);return r()}function jo(t,e=!0,n=[]){return t.forEach(r=>{if(r!==null){if(typeof r!="object"){(typeof r=="string"||typeof r=="number")&&n.push(i.createTextVNode(String(r)));return}if(Array.isArray(r)){jo(r,e,n);return}if(r.type===i.Fragment){if(r.children===null)return;Array.isArray(r.children)&&jo(r.children,e,n)}else r.type!==i.Comment&&n.push(r)}}),n}function qd(t,e,n="default"){const r=e[n];if(r===void 0)throw new Error(`[vueuc/${t}]: slot[${n}] is empty.`);const s=jo(r());if(s.length===1)return s[0];throw new Error(`[vueuc/${t}]: slot[${n}] should have exactly one child.`)}let Dn=null;function Xd(){if(Dn===null&&(Dn=document.getElementById("v-binder-view-measurer"),Dn===null)){Dn=document.createElement("div"),Dn.id="v-binder-view-measurer";const{style:t}=Dn;t.position="fixed",t.left="0",t.right="0",t.top="0",t.bottom="0",t.pointerEvents="none",t.visibility="hidden",document.body.appendChild(Dn)}return Dn.getBoundingClientRect()}function H_(t,e){const n=Xd();return{top:e,left:t,height:0,width:0,right:n.width-t,bottom:n.height-e}}function qo(t){const e=t.getBoundingClientRect(),n=Xd();return{left:e.left-n.left,top:e.top-n.top,bottom:n.height+n.top-e.bottom,right:n.width+n.left-e.right,width:e.width,height:e.height}}function W_(t){return t.nodeType===9?null:t.parentNode}function Yd(t){if(t===null)return null;const e=W_(t);if(e===null)return null;if(e.nodeType===9)return document;if(e.nodeType===1){const{overflow:n,overflowX:r,overflowY:s}=getComputedStyle(e);if(/(auto|scroll|overlay)/.test(n+s+r))return e}return Yd(e)}const Ud=i.defineComponent({name:"Binder",props:{syncTargetWithParent:Boolean,syncTarget:{type:Boolean,default:!0}},setup(t){var e;i.provide("VBinder",(e=i.getCurrentInstance())===null||e===void 0?void 0:e.proxy);const n=i.inject("VBinder",null),r=i.ref(null),s=y=>{r.value=y,n&&t.syncTargetWithParent&&n.setTargetRef(y)};let o=[];const a=()=>{let y=r.value;for(;y=Yd(y),y!==null;)o.push(y);for(const _ of o)Ct("scroll",_,u,!0)},l=()=>{for(const y of o)et("scroll",y,u,!0);o=[]},c=new Set,d=y=>{c.size===0&&a(),c.has(y)||c.add(y)},h=y=>{c.has(y)&&c.delete(y),c.size===0&&l()},u=()=>{Pd(m)},m=()=>{c.forEach(y=>y())},f=new Set,g=y=>{f.size===0&&Ct("resize",window,b),f.has(y)||f.add(y)},p=y=>{f.has(y)&&f.delete(y),f.size===0&&et("resize",window,b)},b=()=>{f.forEach(y=>y())};return i.onBeforeUnmount(()=>{et("resize",window,b),l()}),{targetRef:r,setTargetRef:s,addScrollListener:d,removeScrollListener:h,addResizeListener:g,removeResizeListener:p}},render(){return Wo("binder",this.$slots)}}),Gd=i.defineComponent({name:"Target",setup(){const{setTargetRef:t,syncTarget:e}=i.inject("VBinder");return{syncTarget:e,setTargetDirective:{mounted:t,updated:t}}},render(){const{syncTarget:t,setTargetDirective:e}=this;return t?i.withDirectives(qd("follower",this.$slots),[[e]]):qd("follower",this.$slots)}}),j_="@css-render/vue3-ssr";function q_(t,e){return`<style cssr-id="${t}">
103
+ `}},Ur=Fi.Multiply,Mm=[1,0,0,0,1,0,0,0,1],zn=new nn(9),Am=ct.Utils,pc=new Q,fo=new nn([0,0,1,0,0,1,0,1,1,0,1,1]),be={precision:.9,isHidden:/(undefined|none|transparent)/i,canvas:He.document?He.document.createElement("canvas"):{getContext:function(){}},alignments:{left:"start",middle:"center",right:"end"},matrix:new Fi,group:{removeChild:function(t,e){if(t.children)for(let n=0;n<t.children.length;n++)be.group.removeChild(t.children[n],e);t._renderer.texture&&(e.deleteTexture(t._renderer.texture),delete t._renderer.texture),t._renderer.positionBuffer&&(e.deleteBuffer(t._renderer.positionBuffer),delete t._renderer.positionBuffer)},render:function(t,e){if(!this._visible)return;K.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();const n=this.parent,r=n._matrix&&n._matrix.manual||n._flagMatrix,s=this._matrix.manual||this._flagMatrix;if((r||s)&&(this._renderer.matrix||(this._renderer.matrix=new nn(9)),this._matrix.toTransformArray(!0,zn),Ur(zn,n._renderer.matrix,this._renderer.matrix),this._renderer.scale instanceof Q||(this._renderer.scale=new Q),this._scale instanceof Q?(this._renderer.scale.x=this._scale.x,this._renderer.scale.y=this._scale.y):(this._renderer.scale.x=this._scale,this._renderer.scale.y=this._scale),/renderer/i.test(n._renderer.type)||(this._renderer.scale.x*=n._renderer.scale.x,this._renderer.scale.y*=n._renderer.scale.y),r&&(this._flagMatrix=!0)),this._mask){t.clear(t.STENCIL_BUFFER_BIT),t.enable(t.STENCIL_TEST),t.stencilFunc(t.ALWAYS,1,0),t.stencilOp(t.KEEP,t.KEEP,t.REPLACE),t.colorMask(!1,!1,!1,!1);const a=ct.Utils.getRendererType(this._mask._renderer.type);be[a].render.call(this._mask,t,e,this),t.stencilFunc(t.EQUAL,1,255),t.stencilOp(t.KEEP,t.KEEP,t.KEEP),t.colorMask(!0,!0,!0,!0)}this._flagOpacity=n._flagOpacity||this._flagOpacity,this._renderer.opacity=this._opacity*(n&&n._renderer?n._renderer.opacity:1);let o;if(this._flagSubtractions)for(o=0;o<this.subtractions.length;o++)be.group.removeChild(this.subtractions[o],t);for(o=0;o<this.children.length;o++){const a=this.children[o],l=ct.Utils.getRendererType(a._renderer.type);be[l].render.call(a,t,e)}return this._mask&&t.disable(t.STENCIL_TEST),K.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},path:{updateCanvas:function(t,e){let n,r,s,o,a,l,c,d,h,u,m,g,f,p;const y=e._renderer.vertices,b=this.canvas,_=this.ctx,C=t.renderer.ratio,S=pc.copy(e._renderer.scale).multiply(C),v=e._stroke,B=e._linewidth,k=e._fill,R=e._renderer.opacity||e._opacity,$=e._cap,P=e._join,I=e._miter,V=e._closed,A=e.dashes,L=y.length,D=L-1;b.width=Math.max(Math.ceil(e._renderer.rect.width*S.x),1),b.height=Math.max(Math.ceil(e._renderer.rect.height*S.y),1);const ee=e._renderer.rect.centroid,E=ee.x,N=ee.y;if(_.clearRect(0,0,b.width,b.height),k)if(typeof k=="string")_.fillStyle=k;else{const me=ct.Utils.getRendererType(k._renderer.type);be[me].render.call(k,_,e),_.fillStyle=k._renderer.effect}if(v){if(typeof v=="string")_.strokeStyle=v;else{const me=ct.Utils.getRendererType(v._renderer.type);be[me].render.call(v,_,e),_.strokeStyle=v._renderer.effect}B&&(_.lineWidth=rn(e)),I&&(_.miterLimit=I),P&&(_.lineJoin=P),!V&&$&&(_.lineCap=$)}typeof R=="number"&&(_.globalAlpha=R),A&&A.length>0&&(_.lineDashOffset=A.offset||0,_.setLineDash(A));let H,q,Y,F,M,Z,fe,ie;_.save(),_.scale(S.x,S.y),_.translate(E,N),_.beginPath();for(let me=0;me<y.length;me++){const re=y[me];switch(g=re.x,f=re.y,re.command){case te.close:_.closePath();break;case te.arc:q=re.rx,Y=re.ry,F=re.xAxisRotation,M=re.largeArcFlag,Z=re.sweepFlag,n=V?Pt(me-1,L):Math.max(me-1,0),r=y[n],fe=r.x,ie=r.y,Am.renderSvgArcCommand(_,fe,ie,q,Y,M,Z,F,g,f);break;case te.curve:n=V?Pt(me-1,L):Math.max(me-1,0),r=y[n],d=r.controls&&r.controls.right||Q.zero,h=re.controls&&re.controls.left||Q.zero,r._relative?(l=d.x+r.x,c=d.y+r.y):(l=d.x,c=d.y),re._relative?(o=h.x+re.x,a=h.y+re.y):(o=h.x,a=h.y),_.bezierCurveTo(l,c,o,a,g,f),me>=D&&V&&(s=H,u=re.controls&&re.controls.right||Q.zero,m=s.controls&&s.controls.left||Q.zero,re._relative?(l=u.x+re.x,c=u.y+re.y):(l=u.x,c=u.y),s._relative?(o=m.x+s.x,a=m.y+s.y):(o=m.x,a=m.y),g=s.x,f=s.y,_.bezierCurveTo(l,c,o,a,g,f));break;case te.line:_.lineTo(g,f);break;case te.move:H=re,_.moveTo(g,f);break}}V&&_.closePath(),be.isHidden.test(k)||(p=k._renderer&&k._renderer.offset,p&&(_.save(),_.translate(-k._renderer.offset.x,-k._renderer.offset.y),_.scale(k._renderer.scale.x,k._renderer.scale.y)),_.fill(),p&&_.restore()),be.isHidden.test(v)||(p=v._renderer&&v._renderer.offset,p&&(_.save(),_.translate(-v._renderer.offset.x,-v._renderer.offset.y),_.scale(v._renderer.scale.x,v._renderer.scale.y),_.lineWidth=B/v._renderer.scale.x),_.stroke(),p&&_.restore()),_.restore()},getBoundingClientRect:function(t,e,n){let r=1/0,s=-1/0,o=1/0,a=-1/0,l,c;t.forEach(function(d){const h=d.x,u=d.y,m=d.controls;let g,f,p,y,b,_;o=Math.min(u,o),r=Math.min(h,r),s=Math.max(h,s),a=Math.max(u,a),d.controls&&(b=m.left,_=m.right,!(!b||!_)&&(g=d._relative?b.x+h:b.x,f=d._relative?b.y+u:b.y,p=d._relative?_.x+h:_.x,y=d._relative?_.y+u:_.y,!(!g||!f||!p||!y)&&(o=Math.min(f,y,o),r=Math.min(g,p,r),s=Math.max(g,p,s),a=Math.max(f,y,a))))}),typeof e=="number"&&(o-=e,r-=e,s+=e,a+=e),l=s-r,c=a-o,n.top=o,n.left=r,n.right=s,n.bottom=a,n.width=l,n.height=c,n.centroid||(n.centroid={}),n.centroid.x=-r,n.centroid.y=-o},render:function(t,e,n){if(!this._visible||!this._opacity)return this;K.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();const r=n||this.parent,s=ct.Utils.getRendererType(this._renderer.type),o=e[s],a=r._matrix.manual||r._flagMatrix,l=this._matrix.manual||this._flagMatrix,c=this._renderer.parent!==r,d=this._flagVertices||this._flagFill||this._fill instanceof We&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagEndPoints)||this._fill instanceof je&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagRadius||this._fill._flagCenter||this._fill._flagFocal)||this._fill instanceof Pe&&(this._fill._flagLoaded&&this._fill.loaded||this._fill._flagImage||this._fill._flagVideo||this._fill._flagRepeat||this._fill._flagOffset||this._fill._flagScale)||this._stroke instanceof We&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagEndPoints)||this._stroke instanceof je&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagRadius||this._stroke._flagCenter||this._stroke._flagFocal)||this._stroke instanceof Pe&&(this._stroke._flagLoaded&&this._stroke.loaded||this._stroke._flagImage||this._stroke._flagVideo||this._stroke._flagRepeat||this._stroke._flagOffset||this._fill._flagScale)||this._flagStroke||this._flagLinewidth||this._flagOpacity||r._flagOpacity||this._flagVisible||this._flagCap||this._flagJoin||this._flagMiter||this._flagScale||this.dashes&&this.dashes.length>0||!this._renderer.texture;if(a||l||c){this._renderer.matrix||(this._renderer.matrix=new nn(9)),this._matrix.toTransformArray(!0,zn),Ur(zn,r._renderer.matrix,this._renderer.matrix),this._renderer.scale instanceof Q||(this._renderer.scale=new Q);let u,m;this._scale instanceof Q?(u=this._scale.x*r._renderer.scale.x,m=this._scale.y*r._renderer.scale.y):(u=this._scale*r._renderer.scale.x,m=this._scale*r._renderer.scale.y),this._renderer.scale.x=u<0?-u:u,this._renderer.scale.y=m<0?-m:m,c&&(this._renderer.parent=r)}if(this._mask){t.clear(t.STENCIL_BUFFER_BIT),t.enable(t.STENCIL_TEST),t.stencilFunc(t.ALWAYS,1,0),t.stencilOp(t.KEEP,t.KEEP,t.REPLACE),t.colorMask(!1,!1,!1,!1);const u=ct.Utils.getRendererType(this._mask._renderer.type);be[u].render.call(this._mask,t,e,this),t.stencilFunc(t.EQUAL,1,255),t.stencilOp(t.KEEP,t.KEEP,t.KEEP),t.colorMask(!0,!0,!0,!0)}if(d?(this._renderer.rect||(this._renderer.rect={}),this._renderer.opacity=this._opacity*r._renderer.opacity,be.path.getBoundingClientRect(this._renderer.vertices,this._linewidth,this._renderer.rect),be.updateTexture.call(be,t,this)):(this._fill&&this._fill._update&&this._fill._update(),this._stroke&&this._stroke._update&&this._stroke._update()),this._clip&&!n||!this._renderer.texture)return this;e.current!==o&&(t.useProgram(o),t.bindBuffer(t.ARRAY_BUFFER,e.buffers.position),t.vertexAttribPointer(o.position,2,t.FLOAT,!1,0,0),t.enableVertexAttribArray(o.position),t.bufferData(t.ARRAY_BUFFER,fo,t.STATIC_DRAW),e.resolution.flagged||t.uniform2f(t.getUniformLocation(o,"u_resolution"),e.resolution.width,e.resolution.height),e.current=o),e.resolution.flagged&&t.uniform2f(t.getUniformLocation(o,"u_resolution"),e.resolution.width,e.resolution.height),t.bindTexture(t.TEXTURE_2D,this._renderer.texture);const h=this._renderer.rect;return t.uniformMatrix3fv(o.matrix,!1,this._renderer.matrix),t.uniform4f(o.rect,h.left,h.top,h.right,h.bottom),t.drawArrays(t.TRIANGLES,0,6),this._mask&&t.disable(t.STENCIL_TEST),K.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},points:{updateCanvas:function(t,e){let n;const r=this.canvas,s=this.ctx,o=t.renderer.ratio,a=e._stroke,l=e._linewidth,c=e._fill,d=e._renderer.opacity||e._opacity,h=e.dashes,u=e._size*o;let m=u;be.isHidden.test(a)||(m+=l),r.width=sl(m),r.height=r.width;const g=m/r.width,f=r.width/2,p=r.height/2;if(s.clearRect(0,0,r.width,r.height),c)if(typeof c=="string")s.fillStyle=c;else{const y=ct.Utils.getRendererType(c._renderer.type);be[y].render.call(c,s,e),s.fillStyle=c._renderer.effect}if(a){if(typeof a=="string")s.strokeStyle=a;else{const y=ct.Utils.getRendererType(a._renderer.type);be[y].render.call(a,s,e),s.strokeStyle=a._renderer.effect}l&&(s.lineWidth=rn(e)/g)}typeof d=="number"&&(s.globalAlpha=d),h&&h.length>0&&(s.lineDashOffset=h.offset||0,s.setLineDash(h)),s.save(),s.translate(f,p),s.scale(be.precision,be.precision),s.beginPath(),s.arc(0,0,u/g*.5,0,at),s.restore(),closed&&s.closePath(),be.isHidden.test(c)||(n=c._renderer&&c._renderer.offset,n&&(s.save(),s.translate(-c._renderer.offset.x,-c._renderer.offset.y),s.scale(c._renderer.scale.x,c._renderer.scale.y)),s.fill(),n&&s.restore()),be.isHidden.test(a)||(n=a._renderer&&a._renderer.offset,n&&(s.save(),s.translate(-a._renderer.offset.x,-a._renderer.offset.y),s.scale(a._renderer.scale.x,a._renderer.scale.y),s.lineWidth=l/a._renderer.scale.x),s.stroke(),n&&s.restore())},render:function(t,e,n){if(!this._visible||!this._opacity)return this;K.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();let r=this._size;const s=n||this.parent,o=e[this._renderer.type],a=this._sizeAttenuation,l=this._stroke,c=this._linewidth,d=s._matrix.manual||s._flagMatrix,h=this._matrix.manual||this._flagMatrix,u=this._renderer.parent!==s,m=this._renderer.vertices,g=this._renderer.collection.length,f=this._flagVertices,p=this._flagFill||this._fill instanceof We&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagEndPoints)||this._fill instanceof je&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagRadius||this._fill._flagCenter||this._fill._flagFocal)||this._fill instanceof Pe&&(this._fill._flagLoaded&&this._fill.loaded||this._fill._flagImage||this._fill._flagVideo||this._fill._flagRepeat||this._fill._flagOffset||this._fill._flagScale)||this._stroke instanceof We&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagEndPoints)||this._stroke instanceof je&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagRadius||this._stroke._flagCenter||this._stroke._flagFocal)||this._stroke instanceof Pe&&(this._stroke._flagLoaded&&this._stroke.loaded||this._stroke._flagImage||this._stroke._flagVideo||this._stroke._flagRepeat||this._stroke._flagOffset||this._fill._flagScale)||this._flagStroke||this._flagLinewidth||this._flagOpacity||s._flagOpacity||this._flagVisible||this._flagScale||this.dashes&&this.dashes.length>0||!this._renderer.texture;if(d||h||u){this._renderer.matrix||(this._renderer.matrix=new nn(9)),this._matrix.toTransformArray(!0,zn),Ur(zn,s._renderer.matrix,this._renderer.matrix),this._renderer.scale instanceof Q||(this._renderer.scale=new Q);let y,b;this._scale instanceof Q?(y=this._scale.x*s._renderer.scale.x,b=this._scale.y*s._renderer.scale.y):(y=this._scale*s._renderer.scale.x,b=this._scale*s._renderer.scale.y),this._renderer.scale.x=y<0?-y:y,this._renderer.scale.y=b<0?-b:b,u&&(this._renderer.parent=s)}if(f){const y=this._renderer.positionBuffer;y&&t.deleteBuffer(y),this._renderer.positionBuffer=t.createBuffer(),t.bindBuffer(t.ARRAY_BUFFER,this._renderer.positionBuffer),t.vertexAttribPointer(o.position,2,t.FLOAT,!1,0,0),t.enableVertexAttribArray(o.position),t.bufferData(t.ARRAY_BUFFER,m,t.STATIC_DRAW)}return p?(this._renderer.opacity=this._opacity*s._renderer.opacity,be.updateTexture.call(be,t,this)):(this._fill&&this._fill._update&&this._fill._update(),this._stroke&&this._stroke._update&&this._stroke._update()),this._clip&&!n||!this._renderer.texture?this:(be.isHidden.test(l)||(r+=c),r/=be.precision,a&&(r*=Math.max(this._renderer.scale.x,this._renderer.scale.y)),e.current!==o&&(t.useProgram(o),e.resolution.flagged||t.uniform2f(t.getUniformLocation(o,"u_resolution"),e.resolution.width,e.resolution.height),e.current=o),e.resolution.flagged&&t.uniform2f(t.getUniformLocation(o,"u_resolution"),e.resolution.width,e.resolution.height),t.bindTexture(t.TEXTURE_2D,this._renderer.texture),t.uniformMatrix3fv(o.matrix,!1,this._renderer.matrix),t.uniform1f(o.size,r*e.resolution.ratio),t.drawArrays(t.POINTS,0,g),K.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset())}},text:{updateCanvas:function(t,e){const n=this.canvas,r=this.ctx,s=t.renderer.ratio,o=pc.copy(e._renderer.scale).multiply(s),a=e._stroke,l=e._linewidth,c=e._fill,d=e._renderer.opacity||e._opacity,h=e.dashes,u=e._decoration,m=e._direction;n.width=Math.max(Math.ceil(e._renderer.rect.width*o.x),1),n.height=Math.max(Math.ceil(e._renderer.rect.height*o.y),1);const g=e._renderer.rect.centroid,f=g.x,p=g.y;let y,b,_,C,S,v,B,k,R,$,P;const I=c._renderer&&c._renderer.offset&&a._renderer&&a._renderer.offset;if(r.clearRect(0,0,n.width,n.height),I||(r.font=[e._style,e._weight,e._size+"px/"+e._leading+"px",e._family].join(" ")),r.textAlign="center",r.textBaseline="middle",r.textDirection=m,c)if(typeof c=="string")r.fillStyle=c;else{const V=ct.Utils.getRendererType(c._renderer.type);be[V].render.call(c,r,e),r.fillStyle=c._renderer.effect}if(a){if(typeof a=="string")r.strokeStyle=a;else{const V=ct.Utils.getRendererType(a._renderer.type);be[V].render.call(a,r,e),r.strokeStyle=a._renderer.effect}l&&(r.lineWidth=rn(e))}if(typeof d=="number"&&(r.globalAlpha=d),h&&h.length>0&&(r.lineDashOffset=h.offset||0,r.setLineDash(h)),r.save(),r.scale(o.x,o.y),r.translate(f,p),be.isHidden.test(c)||(c._renderer&&c._renderer.offset?(v=c._renderer.scale.x,B=c._renderer.scale.y,r.save(),r.translate(-c._renderer.offset.x,-c._renderer.offset.y),r.scale(v,B),y=e._size/c._renderer.scale.y,b=e._leading/c._renderer.scale.y,r.font=[e._style,e._weight,y+"px/",b+"px",e._family].join(" "),_=c._renderer.offset.x/c._renderer.scale.x,C=c._renderer.offset.y/c._renderer.scale.y,r.fillText(e.value,_,C),r.restore()):r.fillText(e.value,0,0)),be.isHidden.test(a)||(a._renderer&&a._renderer.offset?(v=a._renderer.scale.x,B=a._renderer.scale.y,r.save(),r.translate(-a._renderer.offset.x,-a._renderer.offset.y),r.scale(v,B),y=e._size/a._renderer.scale.y,b=e._leading/a._renderer.scale.y,r.font=[e._style,e._weight,y+"px/",b+"px",e._family].join(" "),_=a._renderer.offset.x/a._renderer.scale.x,C=a._renderer.offset.y/a._renderer.scale.y,S=l/a._renderer.scale.x,r.lineWidth=S,r.strokeText(e.value,_,C),r.restore()):r.strokeText(e.value,0,0)),/(underline|strikethrough)/i.test(u)){const V=r.measureText(e.value);switch(u){case"underline":R=V.actualBoundingBoxDescent,P=V.actualBoundingBoxDescent;break;case"strikethrough":R=0,P=0;break}k=-V.width/2,$=V.width/2,r.lineWidth=Math.max(Math.floor(e._size/15),1),r.strokeStyle=r.fillStyle,r.beginPath(),r.moveTo(k,R),r.lineTo($,P),r.stroke()}r.restore()},getBoundingClientRect:function(t,e){const n=be.ctx;n.font=[t._style,t._weight,t._size+"px/"+t._leading+"px",t._family].join(" "),n.textAlign="center",n.textBaseline=ct.Utils.baselines[t._baseline]||t._baseline;const r=n.measureText(t._value);let s=r.width,o=1.15*(r.actualBoundingBoxAscent+r.actualBoundingBoxDescent);this._linewidth&&!be.isHidden.test(this._stroke)&&(s+=this._linewidth*2,o+=this._linewidth*2);const a=s/2,l=o/2;switch(be.alignments[t._alignment]||t._alignment){case be.alignments.left:t.direction==="ltr"?(e.left=0,e.right=s):(e.left=-s,e.right=0);break;case be.alignments.right:t.direction==="ltr"?(e.left=-s,e.right=0):(e.left=0,e.right=s);break;default:e.left=-a,e.right=a}switch(t._baseline){case"bottom":e.top=-o,e.bottom=0;break;case"top":e.top=0,e.bottom=o;break;case"baseline":e.top=-l*1.5,e.bottom=l*.5;break;default:e.top=-l,e.bottom=l}e.width=s,e.height=o,e.centroid||(e.centroid={}),e.centroid.x=a,e.centroid.y=l},render:function(t,e,n){if(!this._visible||!this._opacity)return this;K.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();const r=n||this.parent,s=e[this._renderer.type],o=r._matrix.manual||r._flagMatrix,a=this._matrix.manual||this._flagMatrix,l=this._renderer.parent!==r,c=this._flagVertices||this._flagFill||this._fill instanceof We&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagEndPoints)||this._fill instanceof je&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagRadius||this._fill._flagCenter||this._fill._flagFocal)||this._fill instanceof Pe&&(this._fill._flagLoaded&&this._fill.loaded||this._fill._flagImage||this._fill._flagVideo||this._fill._flagRepeat||this._fill._flagOffset||this._fill._flagScale)||this._stroke instanceof We&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagEndPoints)||this._stroke instanceof je&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagRadius||this._stroke._flagCenter||this._stroke._flagFocal)||this._stroke instanceof Pe&&(this._stroke._flagLoaded&&this._stroke.loaded||this._stroke._flagImage||this._stroke._flagVideo||this._stroke._flagRepeat||this._stroke._flagOffset||this._fill._flagScale)||this._flagStroke||this._flagLinewidth||this._flagOpacity||r._flagOpacity||this._flagVisible||this._flagScale||this._flagValue||this._flagFamily||this._flagSize||this._flagLeading||this._flagAlignment||this._flagBaseline||this._flagStyle||this._flagWeight||this._flagDecoration||this.dashes&&this.dashes.length>0||!this._renderer.texture;if(o||a||l){this._renderer.matrix||(this._renderer.matrix=new nn(9)),this._matrix.toTransformArray(!0,zn),Ur(zn,r._renderer.matrix,this._renderer.matrix),this._renderer.scale instanceof Q||(this._renderer.scale=new Q);let h,u;this._scale instanceof Q?(h=this._scale.x*r._renderer.scale.x,u=this._scale.y*r._renderer.scale.y):(h=this._scale*r._renderer.scale.x,u=this._scale*r._renderer.scale.y),this._renderer.scale.x=h<0?-h:h,this._renderer.scale.y=u<0?-u:u,l&&(this._renderer.parent=r)}if(this._mask){t.clear(t.STENCIL_BUFFER_BIT),t.enable(t.STENCIL_TEST),t.stencilFunc(t.ALWAYS,1,0),t.stencilOp(t.KEEP,t.KEEP,t.REPLACE),t.colorMask(!1,!1,!1,!1);const h=ct.Utils.getRendererType(this._mask._renderer.type);be[h].render.call(this._mask,t,e,this),t.stencilFunc(t.EQUAL,1,255),t.stencilOp(t.KEEP,t.KEEP,t.KEEP),t.colorMask(!0,!0,!0,!0)}if(c?(this._renderer.rect||(this._renderer.rect={}),this._renderer.opacity=this._opacity*r._renderer.opacity,be.text.getBoundingClientRect(this,this._renderer.rect),be.updateTexture.call(be,t,this)):(this._fill&&this._fill._update&&this._fill._update(),this._stroke&&this._stroke._update&&this._stroke._update()),this._clip&&!n||!this._renderer.texture)return this;e.current!==s&&(t.useProgram(s),t.bindBuffer(t.ARRAY_BUFFER,e.buffers.position),t.vertexAttribPointer(s.position,2,t.FLOAT,!1,0,0),t.enableVertexAttribArray(s.position),t.bufferData(t.ARRAY_BUFFER,fo,t.STATIC_DRAW),e.resolution.flagged||t.uniform2f(t.getUniformLocation(s,"u_resolution"),e.resolution.width,e.resolution.height),e.current=s),e.resolution.flagged&&t.uniform2f(t.getUniformLocation(s,"u_resolution"),e.resolution.width,e.resolution.height),t.bindTexture(t.TEXTURE_2D,this._renderer.texture);const d=this._renderer.rect;return t.uniformMatrix3fv(s.matrix,!1,this._renderer.matrix),t.uniform4f(s.rect,d.left,d.top,d.right,d.bottom),t.drawArrays(t.TRIANGLES,0,6),this._mask&&t.disable(t.STENCIL_TEST),K.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},"linear-gradient":{render:function(t,e){if(!(!t.canvas.getContext("2d")||!e)){if(K.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update(),!this._renderer.effect||this._flagEndPoints||this._flagStops||this._flagUnits){let n,r=this.left._x,s=this.left._y,o=this.right._x,a=this.right._y;/objectBoundingBox/i.test(this._units)&&(n=e.getBoundingClientRect(!0),r=(r-.5)*n.width,s=(s-.5)*n.height,o=(o-.5)*n.width,a=(a-.5)*n.height),this._renderer.effect=t.createLinearGradient(r,s,o,a);for(let l=0;l<this.stops.length;l++){const c=this.stops[l];this._renderer.effect.addColorStop(c._offset,c._color)}}return K.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}}},"radial-gradient":{render:function(t,e){if(!(!t.canvas.getContext("2d")||!e)){if(K.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update(),!this._renderer.effect||this._flagCenter||this._flagFocal||this._flagRadius||this._flagStops||this._flagUnits){let n,r=this.center._x,s=this.center._y,o=this.focal._x,a=this.focal._y,l=this._radius;/objectBoundingBox/i.test(this._units)&&(n=e.getBoundingClientRect(!0),r=(r-.5)*n.width*.5,s=(s-.5)*n.height*.5,o=(o-.5)*n.width*.5,a=(a-.5)*n.height*.5,l*=Math.min(n.width,n.height)),this._renderer.effect=t.createRadialGradient(r,s,0,o,a,l);for(let c=0;c<this.stops.length;c++){const d=this.stops[c];this._renderer.effect.addColorStop(d._offset,d._color)}}return K.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}}},texture:{render:function(t,e){if(!t.canvas.getContext("2d"))return;K.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();const n=this.image;if((this._flagLoaded||this._flagImage||this._flagVideo||this._flagRepeat)&&this.loaded)this._renderer.effect=t.createPattern(n,this._repeat);else if(!this._renderer.effect)return this.flagReset();if((this._flagOffset||this._flagLoaded||this._flagScale)&&(this._renderer.offset instanceof Q||(this._renderer.offset=new Q),this._renderer.offset.x=-this._offset.x,this._renderer.offset.y=-this._offset.y,n&&(this._renderer.offset.x+=n.width/2,this._renderer.offset.y+=n.height/2,this._scale instanceof Q?(this._renderer.offset.x*=this._scale.x,this._renderer.offset.y*=this._scale.y):(this._renderer.offset.x*=this._scale,this._renderer.offset.y*=this._scale))),this._flagScale||this._flagLoaded){this._renderer.scale instanceof Q||(this._renderer.scale=new Q);let r,s;this._scale instanceof Q?(r=this._scale.x,s=this._scale.y):(r=this._scale,s=this._scale),this._renderer.scale.x=r<0?-r:r,this._renderer.scale.y=s<0?-s:s}return K.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},updateTexture:function(t,e){const n=ct.Utils.getRendererType(e._renderer.type);if(this[n].updateCanvas.call(be,t,e),this.canvas.width<=0||this.canvas.height<=0){e._renderer.texture&&t.deleteTexture(e._renderer.texture),delete e._renderer.texture;return}e._renderer.texture||(e._renderer.texture=t.createTexture()),t.bindTexture(t.TEXTURE_2D,e._renderer.texture),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,this.canvas),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR)},program:{create:function(t,e){let n,r,s;if(n=t.createProgram(),K.each(e,function(o){t.attachShader(n,o)}),t.linkProgram(n),r=t.getProgramParameter(n,t.LINK_STATUS),!r)throw s=t.getProgramInfoLog(n),t.deleteProgram(n),new Rt("unable to link program: "+s);return n}},extensions:{init:function(t){const e={},n=["EXT_texture_filter_anisotropic","WEBGL_compressed_texture_s3tc","OES_texture_float_linear","WEBGL_multisampled_render_to_texture"];for(let r=0;r<n.length;r++){const s=n[r];e[s]=be.extensions.get(t,s)}return e},get:function(t,e){return t.getExtension(e)||t.getExtension(`MOZ_${e}`)||t.getExtension(`WEBKIT_${e}`)}},TextureRegistry:new Fr};be.ctx=be.canvas.getContext("2d");var yc=class extends X{constructor(t){super();let e,n,r,s;if(this.domElement=t.domElement||document.createElement("canvas"),typeof t.offscreenElement<"u"&&(be.canvas=t.offscreenElement,be.ctx=be.canvas.getContext("2d")),this.scene=new nt,this.scene.parent=this,this._renderer={type:"renderer",matrix:new nn(Mm),scale:1,opacity:1},this._flagMatrix=!0,t=K.defaults(t||{},{antialias:!1,alpha:!0,premultipliedAlpha:!0,stencil:!0,preserveDrawingBuffer:!0,overdraw:!1}),this.overdraw=t.overdraw,e=this.ctx=this.domElement.getContext("webgl",t)||this.domElement.getContext("experimental-webgl",t),!this.ctx)throw new Rt("unable to create a webgl context. Try using another renderer.");r=Dt.create(e,Dt.path.vertex,Dt.types.vertex),s=Dt.create(e,Dt.path.fragment,Dt.types.fragment),this.programs={current:null,buffers:{position:e.createBuffer()},resolution:{width:0,height:0,ratio:1,flagged:!1}},n=this.programs.path=be.program.create(e,[r,s]),this.programs.text=this.programs.path,e.extensions=be.extensions.init(e),e.renderer=this,n.position=e.getAttribLocation(n,"a_position"),n.matrix=e.getUniformLocation(n,"u_matrix"),n.rect=e.getUniformLocation(n,"u_rect");const o=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,o),e.vertexAttribPointer(n.position,2,e.FLOAT,!1,0,0),e.enableVertexAttribArray(n.position),e.bufferData(e.ARRAY_BUFFER,fo,e.STATIC_DRAW),r=Dt.create(e,Dt.points.vertex,Dt.types.vertex),s=Dt.create(e,Dt.points.fragment,Dt.types.fragment),n=this.programs.points=be.program.create(e,[r,s]),n.position=e.getAttribLocation(n,"a_position"),n.matrix=e.getUniformLocation(n,"u_matrix"),n.size=e.getUniformLocation(n,"u_size"),e.enable(e.BLEND),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0),e.blendEquation(e.FUNC_ADD),e.blendFunc(e.ONE,e.ONE_MINUS_SRC_ALPHA)}setSize(t,e,n){let r,s;const o=this.ctx;return this.width=t,this.height=e,this.ratio=typeof n>"u"?Hs(o):n,this.domElement.width=t*this.ratio,this.domElement.height=e*this.ratio,K.isObject(this.domElement.style)&&K.extend(this.domElement.style,{width:t+"px",height:e+"px"}),this._renderer.matrix[0]=this._renderer.matrix[4]=this._renderer.scale=this.ratio,this._flagMatrix=!0,r=t*this.ratio,s=e*this.ratio,o.viewport(0,0,r,s),this.programs.resolution.width=r,this.programs.resolution.height=s,this.programs.resolution.ratio=this.ratio,this.programs.resolution.flagged=!0,this.trigger(X.Types.resize,t,e,n)}render(){const t=this.ctx;return this.overdraw||t.clear(t.COLOR_BUFFER_BIT),be.group.render.call(this.scene,t,this.programs),this._flagMatrix=!1,this.programs.resolution.flagged=!0,this}};w(yc,"Utils",be);var Vm=K.extend({Error:Rt,getRatio:Hs,read:ze,xhr:dc},K,_t,tl,nl),we=class Rr{constructor(e){w(this,"_events",new X),w(this,"type",""),w(this,"renderer",null),w(this,"scene",null),w(this,"width",0),w(this,"height",0),w(this,"frameCount",0),w(this,"timeDelta",0),w(this,"playing",!1);const n=K.defaults(e||{},{fullscreen:!1,fitted:!1,width:640,height:480,type:Rr.Types.svg,autostart:!1});if(K.each(n,function(r,s){/fullscreen/i.test(s)||/autostart/i.test(s)||(this[s]=r)},this),K.isElement(n.domElement)){const r=n.domElement.tagName.toLowerCase();/^(CanvasRenderer-canvas|WebGLRenderer-canvas|SVGRenderer-svg)$/.test(this.type+"-"+r)||(this.type=Rr.Types[r])}this.renderer=new Rr[this.type](this),this.setPlaying(n.autostart),this.frameCount=0,n.fullscreen?(this.fit=Om.bind(this),this.fit.domElement=window,this.fit.attached=!0,K.extend(document.body.style,{overflow:"hidden",margin:0,padding:0,top:0,left:0,right:0,bottom:0,position:"fixed"}),K.extend(this.renderer.domElement.style,{display:"block",top:0,left:0,right:0,bottom:0,position:"fixed"}),Ft.bind(this.fit.domElement,"resize",this.fit),this.fit()):n.fitted?(this.fit=Im.bind(this),K.extend(this.renderer.domElement.style,{display:"block"})):typeof n.width=="number"&&typeof n.height=="number"&&(this.renderer.setSize(n.width,n.height,this.ratio),this.width=n.width,this.height=n.height),this.renderer.bind(X.Types.resize,zm.bind(this)),this.scene=this.renderer.scene,Rr.Instances.push(this),n.autostart&&sr.init()}get _bound(){return this._events._bound}set _bound(e){this._events._bound=e}addEventListener(){return this._events.addEventListener.apply(this,arguments)}on(){return this._events.addEventListener.apply(this,arguments)}bind(){return this._events.addEventListener.apply(this,arguments)}removeEventListener(){return this._events.removeEventListener.apply(this,arguments)}off(){return this._events.removeEventListener.apply(this,arguments)}unbind(){return this._events.removeEventListener.apply(this,arguments)}dispatchEvent(){return this._events.dispatchEvent.apply(this,arguments)}trigger(){return this._events.dispatchEvent.apply(this,arguments)}listen(){return this._events.listen.apply(this,arguments)}ignore(){return this._events.ignore.apply(this,arguments)}appendTo(e){return e.appendChild(this.renderer.domElement),this.fit&&(this.fit.domElement!==window&&(this.fit.domElement=e,this.fit.attached=!1),this.update()),this}play(){return this.playing=!0,sr.init(),this.trigger(X.Types.play)}pause(){return this.playing=!1,this.trigger(X.Types.pause)}setPlaying(e){this.playing=e}release(e){let n,r,s;if(typeof e>"u")return this.release(this.scene);if(typeof e.unbind=="function"&&e.unbind(),typeof e.fill=="object"&&"unbind"in e.fill&&e.fill.unbind(),typeof e.stroke=="object"&&"unbind"in e.stroke&&e.stroke.unbind(),e.vertices){if(typeof e.vertices.unbind=="function")try{e.vertices.unbind()}catch{}for(n=0;n<e.vertices.length;n++)r=e.vertices[n],typeof r.unbind=="function"&&r.unbind(),r.controls&&(r.controls.left&&typeof r.controls.left.unbind=="function"&&r.controls.left.unbind(),r.controls.right&&typeof r.controls.right.unbind=="function"&&r.controls.right.unbind())}if(e.children){for(n=0;n<e.children.length;n++)s=e.children[n],this.release(s);if(typeof e.children.unbind=="function")try{e.children.unbind()}catch{}}if(e._renderer){if(e._renderer.elem&&e._renderer.elem.parentNode&&(e._renderer.elem.parentNode.removeChild(e._renderer.elem),delete e._renderer.elem),this.type==="WebGLRenderer"&&this.renderer.ctx){const o=this.renderer.ctx;e._renderer.texture&&(o.deleteTexture(e._renderer.texture),delete e._renderer.texture),e._renderer.positionBuffer&&(o.deleteBuffer(e._renderer.positionBuffer),delete e._renderer.positionBuffer),e._renderer.effect&&(e._renderer.effect=null)}this.type==="CanvasRenderer"&&e._renderer.context&&delete e._renderer.context}return e}update(){const e=!!this._lastFrame,n=K.performance.now();e&&(this.timeDelta=parseFloat((n-this._lastFrame).toFixed(3))),this._lastFrame=n,this.fit&&this.fit.domElement&&!this.fit.attached&&(Ft.bind(this.fit.domElement,"resize",this.fit),this.fit.attached=!0,this.fit());const r=this.width,s=this.height,o=this.renderer;return(r!==o.width||s!==o.height)&&o.setSize(r,s,this.ratio),this.trigger(X.Types.update,this.frameCount,this.timeDelta),this.render()}render(){return this.renderer.render(),this.trigger(X.Types.render,this.frameCount++)}add(e){return e instanceof Array||(e=Array.prototype.slice.call(arguments)),this.scene.add(e),this}remove(e){return e instanceof Array||(e=Array.prototype.slice.call(arguments)),this.scene.remove(e),this}clear(){return this.scene.remove(this.scene.children),this}makeLine(e,n,r,s){const o=new Wr(e,n,r,s);return this.scene.add(o),o}makeArrow(e,n,r,s,o){const a=typeof o=="number"?o:10,l=Math.atan2(s-n,r-e),c=[new ve(e,n,void 0,void 0,void 0,void 0,te.move),new ve(r,s,void 0,void 0,void 0,void 0,te.line),new ve(r-a*Math.cos(l-Math.PI/4),s-a*Math.sin(l-Math.PI/4),void 0,void 0,void 0,void 0,te.line),new ve(r,s,void 0,void 0,void 0,void 0,te.move),new ve(r-a*Math.cos(l+Math.PI/4),s-a*Math.sin(l+Math.PI/4),void 0,void 0,void 0,void 0,te.line)],d=new Se(c,!1,!1,!0);return d.noFill(),d.cap="round",d.join="round",this.scene.add(d),d}makeRectangle(e,n,r,s){const o=new In(e,n,r,s);return this.scene.add(o),o}makeRoundedRectangle(e,n,r,s,o){const a=new Lr(e,n,r,s,o);return this.scene.add(a),a}makeCircle(e,n,r,s){const o=new Ir(e,n,r,s);return this.scene.add(o),o}makeEllipse(e,n,r,s,o){const a=new zr(e,n,r,s,o);return this.scene.add(a),a}makeStar(e,n,r,s,o){const a=new io(e,n,r,s,o);return this.scene.add(a),a}makeCurve(e){const n=arguments.length;if(!Array.isArray(e)){e=[];for(let a=0;a<n;a+=2){const l=arguments[a];if(typeof l!="number")break;const c=arguments[a+1];e.push(new ve(l,c))}}const r=arguments[n-1],s=new Se(e,!(typeof r=="boolean"&&r),!0),o=s.getBoundingClientRect();return s.center().translation.set(o.left+o.width/2,o.top+o.height/2),this.scene.add(s),s}makePolygon(e,n,r,s){const o=new no(e,n,r,s);return this.scene.add(o),o}makeArcSegment(e,n,r,s,o,a,l){const c=new Ks(e,n,r,s,o,a,l);return this.scene.add(c),c}makePoints(e){const n=arguments.length;let r=e;if(!Array.isArray(e)){r=[];for(let o=0;o<n;o+=2){const a=arguments[o];if(typeof a!="number")break;const l=arguments[o+1];r.push(new Q(a,l))}}const s=new to(r);return this.scene.add(s),s}makePath(e){const n=arguments.length;let r=e;if(!Array.isArray(e)){r=[];for(let l=0;l<n;l+=2){const c=arguments[l];if(typeof c!="number")break;const d=arguments[l+1];r.push(new ve(c,d))}}const s=arguments[n-1],o=new Se(r,!(typeof s=="boolean"&&s)),a=o.getBoundingClientRect();return typeof a.top=="number"&&typeof a.left=="number"&&typeof a.right=="number"&&typeof a.bottom=="number"&&o.center().translation.set(a.left+a.width/2,a.top+a.height/2),this.scene.add(o),o}makeText(e,n,r,s){const o=new sn(e,n,r,s);return this.add(o),o}makeLinearGradient(e,n,r,s){const o=Array.prototype.slice.call(arguments,4),a=new We(e,n,r,s,o);return this.add(a),a}makeRadialGradient(e,n,r){const s=Array.prototype.slice.call(arguments,3),o=new je(e,n,r,s);return this.add(o),o}makeSprite(e,n,r,s,o,a,l){const c=new Or(e,n,r,s,o,a);return l&&c.play(),this.add(c),c}makeImage(e,n,r,s,o,a){const l=new hc(e,n,r,s,o,a);return this.add(l),l}makeImageSequence(e,n,r,s,o){const a=new ao(e,n,r,s);return o&&a.play(),this.add(a),a}makeTexture(e,n){return new Pe(e,n)}makeGroup(e){e instanceof Array||(e=Array.prototype.slice.call(arguments));const n=new nt;return this.scene.add(n),n.add(e),n}interpret(e,n,r){const s=e.tagName.toLowerCase();if(r=typeof r<"u"?r:!0,!(s in ze))return null;const o=ze[s].call(this,e);return r?this.add(n&&o instanceof nt?o.children:o):o.parent&&o.remove(),o}load(e,n){const r=new nt;let s,o,a;const l=(function(c){for(Ft.temp.innerHTML=c,o=0;o<Ft.temp.children.length;o++)s=Ft.temp.children[o],a=this.interpret(s,!1,!1),a!==null&&r.add(a);if(typeof n=="function"){const d=Ft.temp.children.length<=1?Ft.temp.children[0]:Ft.temp.children;n(r,d)}}).bind(this);return/\.svg$/i.test(e)?(dc(e,l),r):(l(e),r)}};w(we,"NextFrameId",wt.NextFrameId),w(we,"Types",wt.Types),w(we,"Version",wt.Version),w(we,"PublishDate",wt.PublishDate),w(we,"Identifier",wt.Identifier),w(we,"Resolution",wt.Resolution),w(we,"AutoCalculateImportedMatrices",wt.AutoCalculateImportedMatrices),w(we,"Instances",wt.Instances),w(we,"uniqueId",wt.uniqueId),w(we,"Anchor",ve),w(we,"Collection",An),w(we,"Events",X),w(we,"Group",nt),w(we,"Matrix",Fi),w(we,"Path",Se),w(we,"Registry",Fr),w(we,"Element",Pi),w(we,"Shape",On),w(we,"Text",sn),w(we,"Vector",Q),w(we,"Gradient",Qe),w(we,"Image",hc),w(we,"ImageSequence",ao),w(we,"LinearGradient",We),w(we,"RadialGradient",je),w(we,"Sprite",Or),w(we,"Stop",Vn),w(we,"Texture",Pe),w(we,"ArcSegment",Ks),w(we,"Circle",Ir),w(we,"Ellipse",zr),w(we,"Line",Wr),w(we,"Points",to),w(we,"Polygon",no),w(we,"Rectangle",In),w(we,"RoundedRectangle",Lr),w(we,"Star",io),w(we,"CanvasRenderer",ct),w(we,"SVGRenderer",mc),w(we,"WebGLRenderer",yc),w(we,"Commands",te),w(we,"Utils",Vm);var an=we;function Om(){const t=document.body.getBoundingClientRect(),e=this.width=t.width,n=this.height=t.height;this.renderer.setSize(e,n,this.ratio)}function Im(){const t=this.renderer.domElement.parentElement;if(!t){console.warn("Two.js: Attempting to fit to parent, but no parent found.");return}const e=t.getBoundingClientRect(),n=this.width=e.width,r=this.height=e.height;this.renderer.setSize(n,r,this.ratio)}function zm(t,e){this.width=t,this.height=e,this.trigger(X.Types.resize,t,e)}var sr=Ft.getRequestAnimationFrame();function bc(){for(let t=0;t<an.Instances.length;t++){const e=an.Instances[t];e.playing&&e.update()}an.NextFrameId=sr(bc)}sr.init=function(){bc(),sr.init=function(){}};let ln;typeof window<"u"?ln=window:typeof global<"u"?ln=global:typeof self<"u"&&(ln=self);let _c;const ei=Math.PI*2,it=Math.PI*.5;function Lm(t,e,n,r,s,o){let a;return arguments.length<=1?(a=t.a,e=t.b,n=t.c,r=t.d,s=t.e,o=t.f):a=t,{translateX:s,translateY:o,scaleX:Math.sqrt(a*a+e*e),scaleY:Math.sqrt(n*n+r*r),rotation:180*Math.atan2(e,a)/Math.PI}}function Dm(t){_c=t}function Hm(t,e){e=e&&e.identity()||new _c;let n=t;const r=[];for(;n&&n._matrix;)r.push(n._matrix),n=n.parent;r.reverse();for(let s=0;s<r.length;s++){const a=r[s].elements;e.multiply(a[0],a[1],a[2],a[3],a[4],a[5],a[6],a[7],a[8])}return e}function Ht(t,e,n){return n*(e-t)+t}function Vi(t,e){for(;t<0;)t+=e;return t%e}const wc=ln.Float32Array||Array,Wm=Math.floor;function cn(t){return Wm(t*1e6)/1e6}const he={move:"M",line:"L",curve:"C",close:"Z"};class U{constructor(){x(this,"_events",{});x(this,"_bound",!1)}addEventListener(e,n){return(this._events[e]||(this._events[e]=[])).push(n),this._bound=!0,this}on(){return this.addEventListener.apply(this,arguments)}bind(){return this.addEventListener.apply(this,arguments)}removeEventListener(e,n){if(!this._events)return this;if(!e&&!n)return this._events={},this._bound=!1,this;const r=e?[e]:Object.keys(this._events);for(let s=0,o=r.length;s<o;s++){e=r[s];let a=this._events[e];if(a){let l=[];if(n)for(let c=0,d=a.length;c<d;c++){let h=a[c];h=h.handler?h.handler:h,n!==h&&l.push(h)}this._events[e]=l}}return this}off(){return this.removeEventListener.apply(this,arguments)}unbind(){return this.removeEventListener.apply(this,arguments)}dispatchEvent(e){if(!this._events)return this;const n=Array.prototype.slice.call(arguments,1),r=this._events[e];if(r)for(let s=0;s<r.length;s++)r[s].call(this,...n);return this}trigger(){return this.dispatchEvent.apply(this,arguments)}listen(e,n,r){const s=this;e&&(o.obj=e,o.name=n,o.handler=r,e.on(n,o));function o(){r.apply(s,arguments)}return s}ignore(e,n,r){return e.off(n,r),this}}x(U,"Types",{play:"play",pause:"pause",update:"update",render:"render",resize:"resize",change:"change",remove:"remove",insert:"insert",order:"order",load:"load"}),x(U,"Methods",["addEventListener","on","removeEventListener","off","unbind","dispatchEvent","trigger","listen","ignore"]);const xc={x:{enumerable:!0,get:function(){return this._x},set:function(t){this._x!==t&&(this._x=t,this._bound&&this.dispatchEvent(U.Types.change))}},y:{enumerable:!0,get:function(){return this._y},set:function(t){this._y!==t&&(this._y=t,this._bound&&this.dispatchEvent(U.Types.change))}}},st=class st extends U{constructor(n=0,r=0){super();x(this,"_x",0);x(this,"_y",0);for(let s in xc)Object.defineProperty(this,s,xc[s]);this.x=n,this.y=r}static add(n,r){return new st(n.x+r.x,n.y+r.y)}static sub(n,r){return new st(n.x-r.x,n.y-r.y)}static subtract(n,r){return st.sub(n,r)}static ratioBetween(n,r){return(n.x*r.x+n.y*r.y)/(n.length()*r.length())}static angleBetween(n,r){if(arguments.length>=4){const a=arguments[0]-arguments[2],l=arguments[1]-arguments[3];return Math.atan2(l,a)}const s=n.x-r.x,o=n.y-r.y;return Math.atan2(o,s)}static distanceBetween(n,r){return Math.sqrt(st.distanceBetweenSquared(n,r))}static distanceBetweenSquared(n,r){const s=n.x-r.x,o=n.y-r.y;return s*s+o*o}set(n,r){return this.x=n,this.y=r,this}copy(n){return this.x=n.x,this.y=n.y,this}clear(){return this.x=0,this.y=0,this}clone(){return new st(this.x,this.y)}add(n,r){return arguments.length<=0?this:(arguments.length<=1?typeof n=="number"?(this.x+=n,this.y+=n):n&&typeof n.x=="number"&&typeof n.y=="number"&&(this.x+=n.x,this.y+=n.y):(this.x+=n,this.y+=r),this)}addSelf(n){return this.add.apply(this,arguments)}sub(n,r){return arguments.length<=0?this:(arguments.length<=1?typeof n=="number"?(this.x-=n,this.y-=n):n&&typeof n.x=="number"&&typeof n.y=="number"&&(this.x-=n.x,this.y-=n.y):(this.x-=n,this.y-=r),this)}subtract(){return this.sub.apply(this,arguments)}subSelf(n){return this.sub.apply(this,arguments)}subtractSelf(n){return this.sub.apply(this,arguments)}multiply(n,r){return arguments.length<=0?this:(arguments.length<=1?typeof n=="number"?(this.x*=n,this.y*=n):n&&typeof n.x=="number"&&typeof n.y=="number"&&(this.x*=n.x,this.y*=n.y):(this.x*=n,this.y*=r),this)}multiplySelf(n){return this.multiply.apply(this,arguments)}multiplyScalar(n){return this.multiply(n)}divide(n,r){return arguments.length<=0?this:(arguments.length<=1?typeof n=="number"?(this.x/=n,this.y/=n):n&&typeof n.x=="number"&&typeof n.y=="number"&&(this.x/=n.x,this.y/=n.y):(this.x/=n,this.y/=r),isNaN(this.x)&&(this.x=0),isNaN(this.y)&&(this.y=0),this)}divideSelf(n){return this.divide.apply(this,arguments)}divideScalar(n){return this.divide(n)}negate(){return this.multiply(-1)}dot(n){return this.x*n.x+this.y*n.y}length(){return Math.sqrt(this.lengthSquared())}lengthSquared(){return this.x*this.x+this.y*this.y}normalize(){return this.divideScalar(this.length())}distanceTo(n){return Math.sqrt(this.distanceToSquared(n))}distanceToSquared(n){const r=this.x-n.x,s=this.y-n.y;return r*r+s*s}setLength(n){return this.normalize().multiplyScalar(n)}equals(n,r){return r=typeof r>"u"?1e-4:r,this.distanceTo(n)<r}lerp(n,r){const s=(n.x-this.x)*r+this.x,o=(n.y-this.y)*r+this.y;return this.set(s,o)}isZero(n){return n=typeof n>"u"?1e-4:n,this.length()<n}toString(){return this.x+", "+this.y}toObject(){return{x:cn(this.x),y:cn(this.y)}}rotate(n){const r=this.x,s=this.y,o=Math.cos(n),a=Math.sin(n);return this.x=r*o-s*a,this.y=r*a+s*o,this}};x(st,"zero",new st),x(st,"left",new st(-1,0)),x(st,"right",new st(1,0)),x(st,"up",new st(0,-1)),x(st,"down",new st(0,1));let ge=st;class Re extends ge{constructor(n=0,r=0,s=0,o=0,a=0,l=0,c=he.move){super(n,r);x(this,"controls",{left:new ge,right:new ge});x(this,"_command",he.move);x(this,"_relative",!0);x(this,"_rx",0);x(this,"_ry",0);x(this,"_xAxisRotation",0);x(this,"_largeArcFlag",0);x(this,"_sweepFlag",1);for(let h in vc)Object.defineProperty(this,h,vc[h]);this.command=c,this.relative=!0;const d=Re.makeBroadcast(this);this.controls.left.set(s,o).addEventListener(U.Types.change,d),this.controls.right.set(a,l).addEventListener(U.Types.change,d)}static makeBroadcast(n){return r;function r(){n._bound&&n.dispatchEvent(U.Types.change)}}static fromObject(n){return new Re().copy(n)}copy(n){return this.x=n.x,this.y=n.y,typeof n.command=="string"&&(this.command=n.command),n.controls&&(n.controls.left&&this.controls.left.copy(n.controls.left),n.controls.right&&this.controls.right.copy(n.controls.right)),typeof n.relative=="boolean"&&(this.relative=n.relative),typeof n.rx=="number"&&(this.rx=n.rx),typeof n.ry=="number"&&(this.ry=n.ry),typeof n.xAxisRotation=="number"&&(this.xAxisRotation=n.xAxisRotation),typeof n.largeArcFlag=="number"&&(this.largeArcFlag=n.largeArcFlag),typeof n.sweepFlag=="number"&&(this.sweepFlag=n.sweepFlag),this}clone(){return new Re().copy(this)}toObject(){return{x:cn(this.x),y:cn(this.y),command:this.command,relative:this.relative,controls:{left:this.controls.left.toObject(),right:this.controls.right.toObject()},rx:cn(this.rx),ry:cn(this.ry),xAxisRotation:cn(this.xAxisRotation),largeArcFlag:cn(this.largeArcFlag),sweepFlag:cn(this.sweepFlag)}}toString(){return JSON.stringify(this.toObject())}}const vc={command:{enumerable:!0,get:function(){return this._command},set:function(t){this._command!==t&&(this._command=t,this._bound&&this.dispatchEvent(U.Types.change))}},relative:{enumerable:!0,get:function(){return this._relative},set:function(t){this._relative!==!!t&&(this._relative=!!t,this._bound&&this.dispatchEvent(U.Types.change))}},rx:{enumerable:!0,get:function(){return this._rx},set:function(t){this._rx!==t&&(this._rx=t,this._bound&&this.dispatchEvent(U.Types.change))}},ry:{enumerable:!0,get:function(){return this._ry},set:function(t){this._ry!==t&&(this._ry=t,this._bound&&this.dispatchEvent(U.Types.change))}},xAxisRotation:{enumerable:!0,get:function(){return this._xAxisRotation},set:function(t){this._xAxisRotation!==t&&(this._xAxisRotation=t,this._bound&&this.dispatchEvent(U.Types.change))}},largeArcFlag:{enumerable:!0,get:function(){return this._largeArcFlag},set:function(t){this._largeArcFlag!==t&&(this._largeArcFlag=t,this._bound&&this.dispatchEvent(U.Types.change))}},sweepFlag:{get:function(){return this._sweepFlag},set:function(t){this._sweepFlag!==t&&(this._sweepFlag=t,this._bound&&this.dispatchEvent(U.Types.change))}}};let jm=0;const go={NextFrameId:null,Types:{webgl:"WebGLRenderer",svg:"SVGRenderer",canvas:"CanvasRenderer"},Version:"<%= version %>",PublishDate:"<%= publishDate %>",Identifier:"two-",Resolution:12,AutoCalculateImportedMatrices:!0,Instances:[],uniqueId:function(){return jm++}},Gr={RecursionLimit:16,abscissas:[[.5773502691896],[0,.7745966692415],[.3399810435849,.8611363115941],[0,.5384693101057,.9061798459387],[.2386191860832,.6612093864663,.9324695142032],[0,.4058451513774,.7415311855994,.9491079123428],[.1834346424956,.5255324099163,.7966664774136,.9602898564975],[0,.3242534234038,.6133714327006,.8360311073266,.9681602395076],[.1488743389816,.4333953941292,.679409568299,.865063366689,.9739065285172],[0,.2695431559523,.5190961292068,.730152005574,.8870625997681,.9782286581461],[.1252334085115,.3678314989982,.5873179542866,.7699026741943,.9041172563705,.9815606342467],[0,.2304583159551,.4484927510364,.6423493394403,.8015780907333,.917598399223,.9841830547186],[.1080549487073,.3191123689279,.5152486363582,.6872929048117,.8272013150698,.9284348836636,.9862838086968],[0,.2011940939974,.3941513470776,.5709721726085,.7244177313602,.8482065834104,.9372733924007,.9879925180205],[.0950125098376,.2816035507793,.4580167776572,.6178762444026,.755404408355,.8656312023878,.9445750230732,.9894009349916]],weights:[[1],[.8888888888889,.5555555555556],[.6521451548625,.3478548451375],[.5688888888889,.4786286704994,.2369268850562],[.4679139345727,.3607615730481,.1713244923792],[.4179591836735,.3818300505051,.2797053914893,.1294849661689],[.3626837833784,.3137066458779,.2223810344534,.1012285362904],[.3302393550013,.31234707704,.2606106964029,.1806481606949,.0812743883616],[.2955242247148,.26926671931,.219086362516,.1494513491506,.0666713443087],[.2729250867779,.2628045445102,.233193764592,.1862902109277,.1255803694649,.0556685671162],[.2491470458134,.2334925365384,.2031674267231,.1600783285433,.1069393259953,.0471753363865],[.2325515532309,.2262831802629,.2078160475369,.1781459807619,.1388735102198,.0921214998377,.0404840047653],[.2152638534632,.2051984637213,.1855383974779,.1572031671582,.1215185706879,.0801580871598,.0351194603318],[.2025782419256,.1984314853271,.1861610000156,.166269205817,.1395706779262,.1071592204672,.0703660474881,.0307532419961],[.1894506104551,.1826034150449,.169156519395,.1495959888166,.1246289712555,.0951585116825,.0622535239386,.0271524594118]]};function Kr(t,e,n,r,s){const o=1-t;return o*o*o*e+3*o*o*t*n+3*o*t*t*r+t*t*t*s}function kc(t,e,n,r,s,o,a,l,c){c=c||Gr.RecursionLimit;const d=c+1;if(Math.abs(t-a)<.001&&Math.abs(e-l)<.001)return[new Re(a,l)];const h=[];for(let u=0;u<d;u++){const m=u/d,g=Kr(m,t,n,s,a),f=Kr(m,e,r,o,l);h.push(new Re(g,f))}return h}function qm(t,e,n,r,s,o,a,l,c){if(t===n&&e===r&&s===a&&o===l){const y=a-t,b=l-e;return Math.sqrt(y*y+b*b)}const d=9*(n-s)+3*(a-t),h=6*(t+s)-12*n,u=3*(n-t),m=9*(r-o)+3*(l-e),g=6*(e+o)-12*r,f=3*(r-e);function p(y){const b=(d*y+h)*y+u,_=(m*y+g)*y+f;return Math.sqrt(b*b+_*_)}return Ym(p,0,1,c||Gr.RecursionLimit)}function Xm(t,e,n,r,s,o,a,l){const c=[],d=[[],[]];let h,u,m,g,f,p,y,b;for(let v=0;v<2;++v){if(v===0?(u=6*t-12*n+6*s,h=-3*t+9*n-9*s+3*a,m=3*n-3*t):(u=6*e-12*r+6*o,h=-3*e+9*r-9*o+3*l,m=3*r-3*e),Math.abs(h)<.001){if(Math.abs(u)<.001)continue;g=-m/u,0<g&&g<1&&c.push(g);continue}y=u*u-4*m*h,b=Math.sqrt(y),!(y<0)&&(f=(-u+b)/(2*h),0<f&&f<1&&c.push(f),p=(-u-b)/(2*h),0<p&&p<1&&c.push(p))}let _=c.length,C=_,S;for(;_--;)g=c[_],S=1-g,d[0][_]=S*S*S*t+3*S*S*g*n+3*S*g*g*s+g*g*g*a,d[1][_]=S*S*S*e+3*S*S*g*r+3*S*g*g*o+g*g*g*l;return d[0][C]=t,d[1][C]=e,d[0][C+1]=a,d[1][C+1]=l,d[0].length=d[1].length=C+2,{min:{x:Math.min.apply(0,d[0]),y:Math.min.apply(0,d[1])},max:{x:Math.max.apply(0,d[0]),y:Math.max.apply(0,d[1])}}}function Ym(t,e,n,r){let s=Gr.abscissas[r-2],o=Gr.weights[r-2],a=.5*(n-e),l=a+e,c=0,d=r+1>>1,h=r&1?o[c++]*t(l):0;for(;c<d;){const u=a*s[c];h+=o[c++]*(t(l+u)+t(l-u))}return a*h}function Um(t,e){const n=t.length,r=n-1;for(let s=0;s<n;s++){const o=t[s],a=e?Vi(s-1,n):Math.max(s-1,0),l=e?Vi(s+1,n):Math.min(s+1,r),c=t[a],d=o,h=t[l];Gm(c,d,h),d.command=s===0?he.move:he.curve}}function Gm(t,e,n){const r=ge.angleBetween(t,e),s=ge.angleBetween(n,e);let o=ge.distanceBetween(t,e),a=ge.distanceBetween(n,e),l=(r+s)/2;return o<.001||a<.001?(typeof e.relative=="boolean"&&!e.relative&&(e.controls.left.copy(e),e.controls.right.copy(e)),e):(o*=.33,a*=.33,s<r?l+=it:l-=it,e.controls.left.x=Math.cos(l)*o,e.controls.left.y=Math.sin(l)*o,l-=Math.PI,e.controls.right.x=Math.cos(l)*a,e.controls.right.y=Math.sin(l)*a,typeof e.relative=="boolean"&&!e.relative&&(e.controls.left.x+=e.x,e.controls.left.y+=e.y,e.controls.right.x+=e.x,e.controls.right.y+=e.y),e)}let or=(yi=class extends U{constructor(){super();x(this,"_flagId",!1);x(this,"_flagClassName",!1);x(this,"_renderer",{});x(this,"_id",go.Identifier+go.uniqueId());x(this,"_className","");x(this,"classList",[]);for(let n in Cc)Object.defineProperty(this,n,Cc[n])}static fromObject(n){const r=new yi().copy(n);return"id"in n&&(r.id=n.id),r}flagReset(){return this._flagId=this._flagClassName=!1,this}copy(n){return n.renderer&&typeof n.renderer.type=="string"&&(this.renderer.type=n.renderer.type),typeof n.className=="string"&&(this.className=n.className),this}toObject(){return{renderer:{type:this.renderer.type},id:this.id,className:this.className}}dispose(){const n=this._renderer.type;return this._renderer={type:n},typeof this.unbind=="function"&&this.unbind(),this}},x(yi,"Properties",["renderer","id","className"]),yi);const Cc={renderer:{enumerable:!1,get:function(){return this._renderer}},id:{enumerable:!0,get:function(){return this._id},set:function(t){const e=this._id;t!==this._id&&(this._id=t,this._flagId=!0,this.parent&&(delete this.parent.children.ids[e],this.parent.children.ids[this._id]=this))}},className:{enumerable:!0,get:function(){return this._className},set:function(t){this._className!==t&&(this._flagClassName=!0,this.classList=t.split(/\s+?/),this._className=t)}}};class Zr extends Error{constructor(n){super();x(this,"name","Two.js");x(this,"message");this.message=n}}class Km{constructor(){x(this,"map",{})}add(e,n){return this.map[e]=n,this}remove(e){return delete this.map[e],this}get(e){return this.map[e]}contains(e){return e in this.map}}let Qr;const Sc={video:/\.(mp4|webm|ogg)$/i,image:/\.(jpe?g|png|gif|tiff|webp)$/i,effect:/texture|gradient/i};ln.document&&(Qr=document.createElement("a"));const Xe=class Xe extends or{constructor(n,r){super();x(this,"_flagSrc",!1);x(this,"_flagImage",!1);x(this,"_flagVideo",!1);x(this,"_flagLoaded",!1);x(this,"_flagRepeat",!1);x(this,"_flagOffset",!1);x(this,"_flagScale",!1);x(this,"_src","");x(this,"_image",null);x(this,"_loaded",!1);x(this,"_repeat","no-repeat");x(this,"_scale",1);x(this,"_offset",null);for(let s in Bc)Object.defineProperty(this,s,Bc[s]);if(this._renderer.type="texture",this._renderer.flagOffset=Zm.bind(this),this._renderer.flagScale=Qm.bind(this),this.loaded=!1,this.repeat="no-repeat",this.offset=new ge,typeof r=="function"){const s=(function(){this.unbind(U.Types.load,s),typeof r=="function"&&r()}).bind(this);this.bind(U.Types.load,s)}if(typeof n=="string")this.src=n;else if(typeof n=="object"){const s=Object.prototype.toString.call(n);(s==="[object HTMLImageElement]"||s==="[object HTMLCanvasElement]"||s==="[object HTMLVideoElement]"||s==="[object Image]")&&(this.image=n)}this._update()}fromObject(n){const r=new Xe().copy(n);return"id"in n&&(r.id=n.id),r}static getAbsoluteURL(n){return Qr?(Qr.href=n,Qr.href):n}static loadHeadlessBuffer(n,r){n.image.onload=r,n.image.src=n.src}static getTag(n){return n&&n.nodeName&&n.nodeName.toLowerCase()||"img"}static getImage(n){const r=Xe.getAbsoluteURL(n);if(Xe.ImageRegistry.contains(r))return Xe.ImageRegistry.get(r);let s;return ln.document?Sc.video.test(r)?s=document.createElement("video"):s=document.createElement("img"):console.warn("Two.js: no prototypical image defined for Two.Texture"),s.crossOrigin="anonymous",s.referrerPolicy="no-referrer",s}static load(n,r){let s=n.image,o=Xe.getTag(s);n._flagImage&&(/canvas/i.test(o)?Xe.Register.canvas(n,r):(n._src=s.getAttribute("two-src")||s.src,Xe.Register[o](n,r))),n._flagSrc&&(s||(s=Xe.getImage(n.src),n.image=s),o=Xe.getTag(s),Xe.Register[o](n,r))}clone(){const n=new Xe(this.src);return n.repeat=this.repeat,n.offset.copy(this.offset),n.scale=this.scale,n}copy(n){return this.src=n.src,this.repeat=n.repeat,this.offset=typeof n.offset=="number"||n.offset instanceof ge?n.offset:new ge().copy(n.offset),this.scale=typeof n.scale=="number"||n.scale instanceof ge?n.scale:new ge().copy(n.scale),this}toObject(){const n=super.toObject.call(this);return n.renderer.type="texture",n.src=this.src,n.repeat=this.repeat,n.offset=this.offset.toObject(),n.scale=typeof this.scale=="number"?this.scale:this.scale.toObject(),n}_update(){return(this._flagSrc||this._flagImage)&&(this.trigger(U.Types.change),(this._flagSrc||this._flagImage)&&(this.loaded=!1,Xe.load(this,(function(){this.loaded=!0,this.trigger(U.Types.change).trigger(U.Types.load)}).bind(this)))),this._image&&this._image.readyState>=4&&(this._flagVideo=!0),this}flagReset(){return this._flagSrc=this._flagImage=this._flagLoaded=this._flagRepeat=this._flagVideo=this._flagScale=this._flagOffset=!1,super.flagReset.call(this),this}dispose(){if(super.dispose(),"elem"in this._renderer){const n=this._renderer.elem;n.parentNode.removeChild(n)}return"effect"in this._renderer&&(this._renderer.effect=null),this}};x(Xe,"Properties",["src","loaded","repeat","scale","offset","image"]),x(Xe,"RegularExpressions",Sc),x(Xe,"ImageRegistry",new Km),x(Xe,"Register",{canvas:function(n,r){n._src="#"+n.id,Xe.ImageRegistry.add(n.src,n.image),typeof r=="function"&&r()},img:function(n,r){const s=n.image,o=function(l){s.removeEventListener&&typeof s.removeEventListener=="function"&&(s.removeEventListener("load",o,!1),s.removeEventListener("error",a,!1)),typeof r=="function"&&r()},a=function(l){throw typeof s.removeEventListener=="function"&&(s.removeEventListener("load",o,!1),s.removeEventListener("error",a,!1)),new Zr("unable to load "+n.src)};typeof s.width=="number"&&s.width>0&&typeof s.height=="number"&&s.height>0?o():typeof s.addEventListener=="function"&&(s.addEventListener("load",o,!1),s.addEventListener("error",a,!1)),n._src=Xe.getAbsoluteURL(n._src),!(s&&s.getAttribute("two-src"))&&(s.setAttribute("two-src",n.src),Xe.ImageRegistry.add(n.src,s),n.image.src=n.src)},video:function(n,r){const s=function(a){n.image.removeEventListener("canplaythrough",s,!1),n.image.removeEventListener("error",o,!1),n.image.width=n.image.videoWidth,n.image.height=n.image.videoHeight,typeof r=="function"&&r()},o=function(a){throw n.image.removeEventListener("canplaythrough",s,!1),n.image.removeEventListener("error",o,!1),new Zr("unable to load "+n.src)};n._src=Xe.getAbsoluteURL(n._src),n.image.getAttribute("two-src")||(n.image.setAttribute("two-src",n.src),Xe.ImageRegistry.add(n.src,n.image)),n.image.readyState>=4?s():(n.image.addEventListener("canplaythrough",s,!1),n.image.addEventListener("error",o,!1),n.image.src=n.src,n.image.load())}});let qe=Xe;const Bc={src:{enumerable:!0,get:function(){return this._src},set:function(t){this._src=t,this._flagSrc=!0}},loaded:{enumerable:!0,get:function(){return this._loaded},set:function(t){this._loaded=t,this._flagLoaded=!0}},repeat:{enumerable:!0,get:function(){return this._repeat},set:function(t){this._repeat=t,this._flagRepeat=!0}},image:{enumerable:!0,get:function(){return this._image},set:function(t){const e=qe.getTag(t);let n;switch(e){case"canvas":n="#"+t.id;break;default:n=t.src}qe.ImageRegistry.contains(n)?this._image=qe.ImageRegistry.get(t.src):this._image=t,this._flagImage=!0}},offset:{enumerable:!0,get:function(){return this._offset},set:function(t){this._offset&&this._offset.unbind(U.Types.change,this._renderer.flagOffset),this._offset=t,this._offset.bind(U.Types.change,this._renderer.flagOffset),this._flagOffset=!0}},scale:{enumerable:!0,get:function(){return this._scale},set:function(t){this._scale instanceof ge&&this._scale.unbind(U.Types.change,this._renderer.flagScale),this._scale=t,this._scale instanceof ge&&this._scale.bind(U.Types.change,this._renderer.flagScale),this._flagScale=!0}}};function Zm(){this._flagOffset=!0}function Qm(){this._flagScale=!0}class ti extends Array{constructor(){super();Aa(this,ot,new U);arguments[0]&&Array.isArray(arguments[0])?arguments[0].length>0&&this.push.apply(this,arguments[0]):arguments.length>0&&this.push.apply(this,arguments)}get _events(){return Bt(this,ot)}set _events(n){Fu(this,ot,n)}get _bound(){return Bt(this,ot)._bound}set _bound(n){Bt(this,ot)._bound=n}addEventListener(){return Bt(this,ot).addEventListener.apply(this,arguments)}on(){return Bt(this,ot).on.apply(this,arguments)}bind(){return Bt(this,ot).bind.apply(this,arguments)}removeEventListener(){return Bt(this,ot).removeEventListener.apply(this,arguments)}off(){return Bt(this,ot).off.apply(this,arguments)}unbind(){return Bt(this,ot).unbind.apply(this,arguments)}dispatchEvent(){return Bt(this,ot).dispatchEvent.apply(this,arguments)}trigger(){return Bt(this,ot).trigger.apply(this,arguments)}listen(){return Bt(this,ot).listen.apply(this,arguments)}ignore(){return Bt(this,ot).ignore.apply(this,arguments)}pop(){const n=super.pop.apply(this,arguments);return this.trigger(U.Types.remove,[n]),n}shift(){const n=super.shift.apply(this,arguments);return this.trigger(U.Types.remove,[n]),n}push(){const n=super.push.apply(this,arguments);return this.trigger(U.Types.insert,arguments),n}unshift(){const n=super.unshift.apply(this,arguments);return this.trigger(U.Types.insert,arguments),n}splice(){const n=super.splice.apply(this,arguments);if(this.trigger(U.Types.remove,n),arguments.length>2){const r=this.slice(arguments[0],arguments[0]+arguments.length-2);this.trigger(U.Types.insert,r),this.trigger(U.Types.order)}return n}sort(){return super.sort.apply(this,arguments),this.trigger(U.Types.order),this}reverse(){return super.reverse.apply(this,arguments),this.trigger(U.Types.order),this}indexOf(){return super.indexOf.apply(this,arguments)}map(n,r){const s=[];for(let o=0;o<this.length;o++){const a=this[o];let l;r?l=n.call(r,a,o):l=n(a,o),s.push(l)}return s}}ot=new WeakMap;const Tc=Array.prototype.slice;function Jm(t){if(t==null)return!1;const e=t.length;return typeof e=="number"&&e>=0&&e<4294967296}const $e={isNaN:function(t){return typeof t=="number"&&t!==+t},isElement:function(t){return!!(t&&t.nodeType===1)},isObject:function(t){const e=typeof t;return e==="function"||e==="object"&&!!t},isFunction:function(t){return typeof t=="function"},extend:function(t){const e=Tc.call(arguments,1);for(let n=0;n<e.length;n++){const r=e[n];for(let s in r)t[s]=r[s]}return t},defaults:function(t){const e=Tc.call(arguments,1);for(let n=0;n<e.length;n++){const r=e[n];for(let s in r)t[s]===void 0&&(t[s]=r[s])}return t},each:function(t,e,n){const r=n||this,s=!Jm(t)&&Object.keys(t),o=(s||t).length;for(let a=0;a<o;a++){const l=s?s[a]:a;e.call(r,t[l],l,t)}return t},performance:ln.performance&&ln.performance.now?ln.performance:Date},Et=class Et extends or{constructor(n,r,s){super();x(this,"_flagOffset",!0);x(this,"_flagOpacity",!0);x(this,"_flagColor",!0);x(this,"_offset",0);x(this,"_opacity",1);x(this,"_color","#fff");for(let o in Rc)Object.defineProperty(this,o,Rc[o]);this._renderer.type="stop",this.offset=typeof n=="number"?n:Et.Index<=0?0:1,this.opacity=typeof s=="number"?s:1,this.color=typeof r=="string"?r:Et.Index<=0?"#fff":"#000",Et.Index=(Et.Index+1)%2}static fromObject(n){const r=new Et().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<Et.Properties.length;r++){const s=Et.Properties[r];s in n&&(this[s]=n[s])}return this}clone(n){const r=new Et;return $e.each(Et.Properties,function(s){r[s]=this[s]},this),n&&n.stops&&n.stops.push(r),r}toObject(){const n=super.toObject.call(this);return n.renderer.type="stop",$e.each(Et.Properties,r=>{n[r]=this[r]},this),n}flagReset(){return this._flagOffset=this._flagColor=this._flagOpacity=!1,super.flagReset.call(this),this}};x(Et,"Index",0),x(Et,"Properties",["offset","opacity","color"]);let ni=Et;const Rc={offset:{enumerable:!0,get:function(){return this._offset},set:function(t){this._offset=t,this._flagOffset=!0,this.parent&&(this.parent._flagStops=!0)}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(t){this._opacity=t,this._flagOpacity=!0,this.parent&&(this.parent._flagStops=!0)}},color:{enumerable:!0,get:function(){return this._color},set:function(t){this._color=t,this._flagColor=!0,this.parent&&(this.parent._flagStops=!0)}}},fn=class fn extends or{constructor(n){super();x(this,"_flagStops",!1);x(this,"_flagSpread",!1);x(this,"_flagUnits",!1);x(this,"_spread","");x(this,"_units","");for(let r in $c)Object.defineProperty(this,r,$c[r]);this._renderer.type="gradient",this._renderer.flagStops=ep.bind(this),this._renderer.bindStops=tp.bind(this),this._renderer.unbindStops=np.bind(this),this.spread="pad",this.units="objectBoundingBox",n&&(this.stops=n)}static fromObject(n){let r=n.stops;r&&r.length>0&&(r=r.map(o=>o instanceof ni?o:new ni().copy(o)));const s=new fn(r).copy(n);return"id"in n&&(s.id=n.id),s}clone(n){const r=this.stops.map(o=>o.clone()),s=new fn(r);return $e.each(fn.Properties,o=>{s[o]=this[o]},this),n&&n.add(s),s}copy(n){super.copy.call(this,n);for(let r=0;r<fn.Properties.length;r++){const s=fn.Properties[r];s in n&&(this[s]=n[s])}return this}toObject(){const n={stops:this.stops.map(r=>r.toObject())};return $e.each(fn.Properties,r=>{n[r]=this[r]},this),n}_update(){return(this._flagSpread||this._flagStops)&&this.trigger(U.Types.change),this}flagReset(){return this._flagSpread=this._flagUnits=this._flagStops=!1,super.flagReset.call(this),this}dispose(){if("elem"in this._renderer){const n=this._renderer.elem;n.parentNode.removeChild(n)}return"effect"in this._renderer&&(this._renderer.effect=null),this}};x(fn,"Stop",ni),x(fn,"Properties",["spread","stops","units"]);let Je=fn;const $c={spread:{enumerable:!0,get:function(){return this._spread},set:function(t){this._spread=t,this._flagSpread=!0}},units:{enumerable:!0,get:function(){return this._units},set:function(t){this._units=t,this._flagUnits=!0}},stops:{enumerable:!0,get:function(){return this._stops},set:function(t){const e=this._renderer.bindStops,n=this._renderer.unbindStops;this._stops&&this._stops.unbind(U.Types.insert,e).unbind(U.Types.remove,n),this._stops=new ti((t||[]).slice(0)),this._stops.bind(U.Types.insert,e).bind(U.Types.remove,n),e(this._stops)}}};function ep(){this._flagStops=!0}function tp(t){let e=t.length;for(;e--;)t[e].bind(U.Types.change,this._renderer.flagStops),t[e].parent=this;this._renderer.flagStops()}function np(t){let e=t.length;for(;e--;)t[e].unbind(U.Types.change,this._renderer.flagStops),delete t[e].parent;this._renderer.flagStops()}const qn=class qn extends Je{constructor(n,r,s,o,a){super(a);x(this,"_flagEndPoints",!1);x(this,"_left",null);x(this,"_right",null);for(let l in Ec)Object.defineProperty(this,l,Ec[l]);this._renderer.type="linear-gradient",this._renderer.flagEndPoints=ip.bind(this),this.left=new ge,this.right=new ge,typeof n=="number"&&(this.left.x=n),typeof r=="number"&&(this.left.y=r),typeof s=="number"&&(this.right.x=s),typeof o=="number"&&(this.right.y=o)}static fromObject(n){const r=new qn().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<qn.Properties.length;r++){const s=qn.Properties[r];s in n&&(this[s]=n[s]instanceof ge?n[s]:new ge().copy(n[s]))}return this}clone(n){const r=this.stops.map(function(o){return o.clone()}),s=new qn(this.left._x,this.left._y,this.right._x,this.right._y,r);return $e.each(Je.Properties,function(o){s[o]=this[o]},this),n&&n.add(s),s}toObject(){const n=super.toObject.call(this);return n.left=this.left.toObject(),n.right=this.right.toObject(),n}_update(){return(this._flagEndPoints||this._flagSpread||this._flagStops)&&this.trigger(U.Types.change),this}flagReset(){return this._flagEndPoints=!1,super.flagReset.call(this),this}};x(qn,"Stop",ni),x(qn,"Properties",["left","right"]);let xt=qn;const Ec={left:{enumerable:!0,get:function(){return this._left},set:function(t){this._left instanceof ge&&this._left.unbind(U.Types.change,this._renderer.flagEndPoints),this._left=t,this._left.bind(U.Types.change,this._renderer.flagEndPoints),this._flagEndPoints=!0}},right:{enumerable:!0,get:function(){return this._right},set:function(t){this._right instanceof ge&&this._right.unbind(U.Types.change,this._renderer.flagEndPoints),this._right=t,this._right.bind(U.Types.change,this._renderer.flagEndPoints),this._flagEndPoints=!0}}};function ip(){this._flagEndPoints=!0}const gn=class gn extends Je{constructor(n,r,s,o,a,l){super(o);x(this,"_flagRadius",!1);x(this,"_flagCenter",!1);x(this,"_flagFocal",!1);x(this,"_radius",0);x(this,"_center",null);x(this,"_focal",null);for(let c in Nc)Object.defineProperty(this,c,Nc[c]);this._renderer.type="radial-gradient",this._renderer.flagCenter=rp.bind(this),this._renderer.flagFocal=sp.bind(this),this.center=new ge,this.radius=typeof s=="number"?s:1,this.focal=new ge,typeof n=="number"&&(this.center.x=n),typeof r=="number"&&(this.center.y=r),this.focal.copy(this.center),typeof a=="number"&&(this.focal.x=a),typeof l=="number"&&(this.focal.y=l)}static fromObject(n){const r=new gn().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<gn.Properties.length;r++){const s=gn.Properties[r];s in n&&(/(center|focal)i/.test(s)?this[s]=n[s]instanceof ge?n[s]:new ge().copy(n[s]):typeof n[s]=="number"&&(this[s]=n[MediaKeySystemAccess]))}return this}clone(n){const r=this.stops.map(function(o){return o.clone()}),s=new gn(this.center._x,this.center._y,this._radius,r,this.focal._x,this.focal._y);return $e.each(Je.Properties.concat(gn.Properties),function(o){s[o]=this[o]},this),n&&n.add(s),s}toObject(){const n=super.toObject.call(this);return $e.each(gn.Properties,function(r){n[r]=this[r]},this),n.center=this.center.toObject(),n.focal=this.focal.toObject(),n}_update(){return(this._flagRadius||this._flatCenter||this._flagFocal||this._flagSpread||this._flagStops)&&this.trigger(U.Types.change),this}flagReset(){return this._flagRadius=this._flagCenter=this._flagFocal=!1,super.flagReset.call(this),this}};x(gn,"Stop",ni),x(gn,"Properties",["center","radius","focal"]);let vt=gn;const Nc={radius:{enumerable:!0,get:function(){return this._radius},set:function(t){this._radius=t,this._flagRadius=!0}},center:{enumerable:!0,get:function(){return this._center},set:function(t){this._center&&this._center.unbind(U.Types.change,this._renderer.flagCenter),this._center=t,this._center.bind(U.Types.change,this._renderer.flagCenter),this._flagCenter=!0}},focal:{enumerable:!0,get:function(){return this._focal},set:function(t){this._focal&&this._focal.unbind(U.Types.change,this._renderer.flagFocal),this._focal=t,this._focal.bind(U.Types.change,this._renderer.flagFocal),this._flagFocal=!0}}};function rp(){this._flagCenter=!0}function sp(){this._flagFocal=!0}function Pc(t,e){if(e===0||e===1)return!0;const r=t._length*e;let s=0;for(let o=0;o<t._lengths.length;o++){const a=t._lengths[o];if(s>=r)return r-s>=0;s+=a}return!1}function Jr(t,e){const n=t._length;if(e<=0)return 0;if(e>=n)return t._lengths.length-1;for(let r=0,s=0;r<t._lengths.length;r++){if(s+t._lengths[r]>=e)return e-=s,Math.max(r-1,0)+e/t._lengths[r];s+=t._lengths[r]}return-1}function Fc(t,e,n){let r,s,o,a,l,c,d,h;const u=e.controls&&e.controls.right,m=t.controls&&t.controls.left;return r=e.x,l=e.y,s=(u||e).x,c=(u||e).y,o=(m||t).x,d=(m||t).y,a=t.x,h=t.y,u&&e._relative&&(s+=e.x,c+=e.y),m&&t._relative&&(o+=t.x,d+=t.y),qm(r,l,s,c,o,d,a,h,n)}function Mc(t,e,n){let r,s,o,a,l,c,d,h;const u=e.controls&&e.controls.right,m=t.controls&&t.controls.left;return r=e.x,l=e.y,s=(u||e).x,c=(u||e).y,o=(m||t).x,d=(m||t).y,a=t.x,h=t.y,u&&e._relative&&(s+=e.x,c+=e.y),m&&t._relative&&(o+=t.x,d+=t.y),kc(r,l,s,c,o,d,a,h,n)}function ii(t){switch(t.renderer.type){case"texture":return qe.fromObject(t);case"gradient":return Je.fromObject(t);case"linear-gradient":return xt.fromObject(t);case"radial-gradient":return vt.fromObject(t)}return t}const op=Math.cos,ap=Math.sin,Ac=Math.tan,mo=[],Ct=class Ct extends U{constructor(n,r,s,o,a,l){super();x(this,"elements",new wc(9));x(this,"manual",!1);let c=n;Array.isArray(c)||(c=Array.prototype.slice.call(arguments)),this.identity(),c.length>0&&this.set(c)}static Multiply(n,r,s){if(r.length<=3){const k=n;let R,$,P;const I=r[0]||0,V=r[1]||0,A=r[2]||0;return R=k[0]*I+k[1]*V+k[2]*A,$=k[3]*I+k[4]*V+k[5]*A,P=k[6]*I+k[7]*V+k[8]*A,[R,$,P]}const o=n[0],a=n[1],l=n[2],c=n[3],d=n[4],h=n[5],u=n[6],m=n[7],g=n[8],f=r[0],p=r[1],y=r[2],b=r[3],_=r[4],C=r[5],S=r[6],v=r[7],B=r[8];return s=s||new wc(9),s[0]=o*f+a*b+l*S,s[1]=o*p+a*_+l*v,s[2]=o*y+a*C+l*B,s[3]=c*f+d*b+h*S,s[4]=c*p+d*_+h*v,s[5]=c*y+d*C+h*B,s[6]=u*f+m*b+g*S,s[7]=u*p+m*_+g*v,s[8]=u*y+m*C+g*B,s}static fromObject(n){return new Ct().copy(n)}set(n,r,s,o,a,l,c,d,h){if(typeof r>"u"){const u=n;n=u[0],r=u[1],s=u[2],o=u[3],a=u[4],l=u[5],c=u[6],d=u[7],h=u[8]}return this.elements[0]=n,this.elements[1]=r,this.elements[2]=s,this.elements[3]=o,this.elements[4]=a,this.elements[5]=l,this.elements[6]=c,this.elements[7]=d,this.elements[8]=h,this.trigger(U.Types.change)}copy(n){return this.elements[0]=n.elements[0],this.elements[1]=n.elements[1],this.elements[2]=n.elements[2],this.elements[3]=n.elements[3],this.elements[4]=n.elements[4],this.elements[5]=n.elements[5],this.elements[6]=n.elements[6],this.elements[7]=n.elements[7],this.elements[8]=n.elements[8],this.manual=n.manual,this.trigger(U.Types.change)}identity(){return this.elements[0]=Ct.Identity[0],this.elements[1]=Ct.Identity[1],this.elements[2]=Ct.Identity[2],this.elements[3]=Ct.Identity[3],this.elements[4]=Ct.Identity[4],this.elements[5]=Ct.Identity[5],this.elements[6]=Ct.Identity[6],this.elements[7]=Ct.Identity[7],this.elements[8]=Ct.Identity[8],this.trigger(U.Types.change)}multiply(n,r,s,o,a,l,c,d,h){if(typeof r>"u")return this.elements[0]*=n,this.elements[1]*=n,this.elements[2]*=n,this.elements[3]*=n,this.elements[4]*=n,this.elements[5]*=n,this.elements[6]*=n,this.elements[7]*=n,this.elements[8]*=n,this.trigger(U.Types.change);if(typeof s>"u"&&(s=1),typeof o>"u"){n=n||0,r=r||0,s=s||0,a=this.elements;const D=a[0]*n+a[1]*r+a[2]*s,ee=a[3]*n+a[4]*r+a[5]*s,E=a[6]*n+a[7]*r+a[8]*s;return[D,ee,E]}const u=this.elements,m=[n,r,s,o,a,l,c,d,h],g=u[0],f=u[1],p=u[2],y=u[3],b=u[4],_=u[5],C=u[6],S=u[7],v=u[8],B=m[0],k=m[1],R=m[2],$=m[3],P=m[4],I=m[5],V=m[6],A=m[7],L=m[8];return this.elements[0]=g*B+f*$+p*V,this.elements[1]=g*k+f*P+p*A,this.elements[2]=g*R+f*I+p*L,this.elements[3]=y*B+b*$+_*V,this.elements[4]=y*k+b*P+_*A,this.elements[5]=y*R+b*I+_*L,this.elements[6]=C*B+S*$+v*V,this.elements[7]=C*k+S*P+v*A,this.elements[8]=C*R+S*I+v*L,this.trigger(U.Types.change)}inverse(n){const r=this.elements;n=n||new Ct;const s=r[0],o=r[1],a=r[2],l=r[3],c=r[4],d=r[5],h=r[6],u=r[7],m=r[8],g=m*c-d*u,f=-m*l+d*h,p=u*l-c*h;let y=s*g+o*f+a*p;return y?(y=1/y,n.elements[0]=g*y,n.elements[1]=(-m*o+a*u)*y,n.elements[2]=(d*o-a*c)*y,n.elements[3]=f*y,n.elements[4]=(m*s-a*h)*y,n.elements[5]=(-d*s+a*l)*y,n.elements[6]=p*y,n.elements[7]=(-u*s+o*h)*y,n.elements[8]=(c*s-o*l)*y,n):null}scale(n,r){return arguments.length<=1&&(r=n),this.multiply(n,0,0,0,r,0,0,0,1)}rotate(n){const r=op(n),s=ap(n);return this.multiply(r,-s,0,s,r,0,0,0,1)}translate(n,r){return this.multiply(1,0,n,0,1,r,0,0,1)}skewX(n){const r=Ac(n);return this.multiply(1,r,0,0,1,0,0,0,1)}skewY(n){const r=Ac(n);return this.multiply(1,0,0,r,1,0,0,0,1)}toString(n){return mo.length=0,this.toTransformArray(n,mo),mo.map(cn).join(" ")}toTransformArray(n,r){const s=this.elements,o=!!r,a=s[0],l=s[1],c=s[2],d=s[3],h=s[4],u=s[5];if(n){const m=s[6],g=s[7],f=s[8];if(o){r[0]=a,r[1]=d,r[2]=m,r[3]=l,r[4]=h,r[5]=g,r[6]=c,r[7]=u,r[8]=f;return}return[a,d,m,l,h,g,c,u,f]}if(o){r[0]=a,r[1]=d,r[2]=l,r[3]=h,r[4]=c,r[5]=u;return}return[a,d,l,h,c,u]}toArray(n,r){const s=this.elements,o=!!r,a=s[0],l=s[1],c=s[2],d=s[3],h=s[4],u=s[5];if(n){const m=s[6],g=s[7],f=s[8];if(o){r[0]=a,r[1]=l,r[2]=c,r[3]=d,r[4]=h,r[5]=u,r[6]=m,r[7]=g,r[8]=f;return}return[a,l,c,d,h,u,m,g,f]}if(o){r[0]=a,r[1]=l,r[2]=c,r[3]=d,r[4]=h,r[5]=u;return}return[a,l,c,d,h,u]}toObject(){return{renderer:{type:"matrix"},elements:this.toArray(!0),manual:!!this.manual}}clone(){return new Ct().copy(this)}};x(Ct,"Identity",[1,0,0,0,1,0,0,0,1]);let ar=Ct;Dm(ar);const Cr=class Cr extends or{constructor(){super();x(this,"_flagMatrix",!0);x(this,"_flagScale",!1);x(this,"_matrix",null);x(this,"_worldMatrix",null);x(this,"_position",null);x(this,"_rotation",0);x(this,"_scale",1);x(this,"_skewX",0);x(this,"_skewY",0);for(let n in es)Object.defineProperty(this,n,es[n]);this._renderer.flagMatrix=Vc.bind(this),this.isShape=!0,this.matrix=new ar,this.worldMatrix=new ar,this.position=new ge,this.rotation=0,this.scale=1,this.skewX=0,this.skewY=0}static fromObject(n){const r=new Cr().copy(n);return"id"in n&&(r.id=n.id),r}get renderer(){return this._renderer}set renderer(n){this._renderer=n}get translation(){return es.position.get.apply(this,arguments)}set translation(n){es.position.set.apply(this,arguments)}addTo(n){return n.add(this),this}remove(){return this.parent?(this.parent.remove(this),this):this}copy(n){return super.copy.call(this,n),"position"in n&&(n.position instanceof ge?this.position=n.position:this.position.copy(n.position)),"rotation"in n&&(this.rotation=n.rotation),"scale"in n&&(this.scale=typeof n.scale=="number"||n.scale instanceof ge?n.scale:new ge(n.scale.x,n.scale.y)),"skewX"in n&&(this.skewX=n.skewX),"skewY"in n&&(this.skewY=n.skewY),"matrix"in n&&n.matrix.manual&&(this.matrix.copy(n.matrix),this.matrix.manual=!0),this}clone(n){const r=new Cr;return r.position.copy(this.position),r.rotation=this.rotation,r.scale=this.scale,r.skewX=this.skewX,r.skewY=this.skewY,this.matrix.manual&&r.matrix.copy(this.matrix),n&&n.add(r),r._update()}toObject(){const n=super.toObject.call(this);return n.renderer={type:"shape"},n.isShape=!0,n.translation=this.translation.toObject(),n.rotation=this.translation.rotation,n.scale=this.scale instanceof ge?this.scale.toObject():this.scale,n.skewX=this.skewX,n.skewY=this.skewY,n.matrix=this.matrix.toObject(),n}_update(n){return!this._matrix.manual&&this._flagMatrix&&(this._matrix.identity().translate(this.position.x,this.position.y),this._matrix.rotate(this.rotation),this._scale instanceof ge?this._matrix.scale(this._scale.x,this._scale.y):this._matrix.scale(this._scale),this._matrix.skewX(this.skewX),this._matrix.skewY(this.skewY)),n&&this.parent&&this.parent._update&&this.parent._update(),this}flagReset(){return this._flagMatrix=this._flagScale=!1,super.flagReset.call(this),this}};x(Cr,"Properties",["position","rotation","scale","skewX","skewY","matrix","worldMatrix"]);let wn=Cr;const es={position:{enumerable:!0,get:function(){return this._position},set:function(t){this._position&&this._position.unbind(U.Types.change,this._renderer.flagMatrix),this._position=t,this._position.bind(U.Types.change,this._renderer.flagMatrix),Vc.call(this)}},rotation:{enumerable:!0,get:function(){return this._rotation},set:function(t){this._rotation=t,this._flagMatrix=!0}},scale:{enumerable:!0,get:function(){return this._scale},set:function(t){this._scale instanceof ge&&this._scale.unbind(U.Types.change,this._renderer.flagMatrix),this._scale=t,this._scale instanceof ge&&this._scale.bind(U.Types.change,this._renderer.flagMatrix),this._flagMatrix=!0,this._flagScale=!0}},skewX:{enumerable:!0,get:function(){return this._skewX},set:function(t){this._skewX=t,this._flagMatrix=!0}},skewY:{enumerable:!0,get:function(){return this._skewY},set:function(t){this._skewY=t,this._flagMatrix=!0}},matrix:{enumerable:!0,get:function(){return this._matrix},set:function(t){this._matrix=t,this._flagMatrix=!0}},worldMatrix:{enumerable:!0,get:function(){return Hm(this,this._worldMatrix),this._worldMatrix},set:function(t){this._worldMatrix=t}}};function Vc(){this._flagMatrix=!0}const Oi=Math.min,Ii=Math.max,lp=Math.ceil,cp=Math.floor,dp=new ge,Gt=class Gt extends wn{constructor(n,r,s,o){super();x(this,"_flagVertices",!0);x(this,"_flagLength",!0);x(this,"_flagFill",!0);x(this,"_flagStroke",!0);x(this,"_flagLinewidth",!0);x(this,"_flagOpacity",!0);x(this,"_flagVisible",!0);x(this,"_flagCap",!0);x(this,"_flagJoin",!0);x(this,"_flagMiter",!0);x(this,"_flagStrokeAttenuation",!0);x(this,"_flagMask",!1);x(this,"_flagClip",!1);x(this,"_length",0);x(this,"_fill","#fff");x(this,"_stroke","#000");x(this,"_linewidth",1);x(this,"_opacity",1);x(this,"_visible",!0);x(this,"_cap","round");x(this,"_join","round");x(this,"_miter",4);x(this,"_closed",!0);x(this,"_curved",!1);x(this,"_automatic",!0);x(this,"_beginning",0);x(this,"_ending",1);x(this,"_mask",null);x(this,"_clip",!1);x(this,"_dashes",null);x(this,"_strokeAttenuation",!0);for(let a in Oc)Object.defineProperty(this,a,Oc[a]);this._renderer.type="path",this._renderer.flagVertices=Ic.bind(this),this._renderer.bindVertices=zc.bind(this),this._renderer.unbindVertices=Lc.bind(this),this._renderer.flagFill=Dc.bind(this),this._renderer.flagStroke=Hc.bind(this),this._renderer.vertices=[],this._renderer.collection=[],this.closed=!!r,this.curved=!!s,this.beginning=0,this.ending=1,this.fill="#fff",this.stroke="#000",this.linewidth=1,this.opacity=1,this.className="",this.visible=!0,this.cap="butt",this.join="miter",this.miter=4,this.vertices=n,this.automatic=!o,this.dashes=[],this.dashes.offset=0}static fromObject(n){const r=typeof n.fill=="string"?n.fill:ii(n.fill),s=typeof n.stroke=="string"?n.stroke:ii(n.stroke),o=new Gt().copy({...n,fill:r,stroke:s});return"id"in n&&(o.id=n.id),o}copy(n){if(super.copy.call(this,n),n.vertices){this.vertices=[];for(let r=0;r<n.vertices.length;r++){const s=n.vertices[r];s instanceof Re?this.vertices.push(n.vertices[r].clone()):this.vertices.push(new Re().copy(s))}}for(let r=0;r<Gt.Properties.length;r++){const s=Gt.Properties[r];s in n&&(this[s]=n[s])}return this}clone(n){const r=new Gt;for(let s=0;s<this.vertices.length;s++)r.vertices.push(this.vertices[s].clone());for(let s=0;s<Gt.Properties.length;s++){const o=Gt.Properties[s];r[o]=this[o]}return r.className=this.className,r.translation.copy(this.translation),r.rotation=this.rotation,r.scale=this.scale,r.skewX=this.skewX,r.skewY=this.skewY,this.matrix.manual&&r.matrix.copy(this.matrix),n&&n.add(r),r._update()}toObject(){const n=super.toObject.call(this);return n.renderer.type="path",n.vertices=this.vertices.map(r=>r.toObject()),$e.each(Gt.Properties,r=>{typeof this[r]<"u"&&(this[r].toObject?n[r]=this[r].toObject():n[r]=this[r])},this),n}dispose(){if(super.dispose(),this.vertices&&typeof this.vertices.unbind=="function")try{this.vertices.unbind()}catch{}if(this.vertices)for(let n=0;n<this.vertices.length;n++){const r=this.vertices[n];typeof r.unbind=="function"&&r.unbind(),r.controls&&(r.controls.left&&typeof r.controls.left.unbind=="function"&&r.controls.left.unbind(),r.controls.right&&typeof r.controls.right.unbind=="function"&&r.controls.right.unbind())}return typeof this.fill=="object"&&this.fill&&"dispose"in this.fill?this.fill.dispose():typeof this.fill=="object"&&this.fill&&"unbind"in this.fill&&this.fill.unbind(),typeof this.stroke=="object"&&this.stroke&&"dispose"in this.stroke?this.stroke.dispose():typeof this.stroke=="object"&&this.stroke&&"unbind"in this.stroke&&this.stroke.unbind(),this}noFill(){return this.fill="none",this}noStroke(){return this.stroke="none",this.linewidth=0,this}corner(){const n=this.getBoundingClientRect(!0),r=n.width/2,s=n.height/2,o=n.left+n.width/2,a=n.top+n.height/2;for(let l=0;l<this.vertices.length;l++){const c=this.vertices[l];c.x-=o,c.y-=a,c.x+=r,c.y+=s}return this.mask&&(this.mask.translation.x-=o,this.mask.translation.x+=r,this.mask.translation.y-=a,this.mask.translation.y+=s),this}center(){const n=this.getBoundingClientRect(!0),r=n.left+n.width/2-this.translation.x,s=n.top+n.height/2-this.translation.y;for(let o=0;o<this.vertices.length;o++){const a=this.vertices[o];a.x-=r,a.y-=s}return this.mask&&(this.mask.translation.x-=r,this.mask.translation.y-=s),this}getBoundingClientRect(n){let r,s,o,a,l,c,d=1/0,h=-1/0,u=1/0,m=-1/0;if(this._update(!0),r=n?this.matrix:this.worldMatrix,s=(this.linewidth||0)/2,o=this._renderer.vertices.length,this.linewidth>0||this.stroke&&!/(transparent|none)/i.test(this.stroke))if(this.matrix.manual){const{scaleX:g,scaleY:f}=Lm(r.elements[0],r.elements[3],r.elements[1],r.elements[4],r.elements[2],r.elements[5]);typeof g=="number"&&typeof f=="number"&&(s=Math.max(g,f)*(this.linewidth||0)/2)}else s*=typeof this.scale=="number"?this.scale:Math.max(this.scale.x,this.scale.y);if(o<=0)return{width:0,height:0};for(a=0;a<o;a++){c=this._renderer.vertices[a],l=this._renderer.vertices[(a+o-1)%o];const[g,f]=r.multiply(l.x,l.y),[p,y]=r.multiply(c.x,c.y);if(l.controls&&c.controls){let b=l.controls.right.x,_=l.controls.right.y;l.relative&&(b+=l.x,_+=l.y);let[C,S]=r.multiply(b,_),v=c.controls.left.x,B=c.controls.left.y;c.relative&&(v+=c.x,B+=c.y);let[k,R]=r.multiply(v,B);const $=Xm(g,f,C,S,k,R,p,y);u=Oi($.min.y-s,u),d=Oi($.min.x-s,d),h=Ii($.max.x+s,h),m=Ii($.max.y+s,m)}else a<=1&&(u=Oi(f-s,u),d=Oi(g-s,d),h=Ii(g+s,h),m=Ii(f+s,m)),u=Oi(y-s,u),d=Oi(p-s,d),h=Ii(p+s,h),m=Ii(y+s,m)}return{top:u,left:d,right:h,bottom:m,width:h-d,height:m-u}}getPointAt(n,r){let s,o,a,l,c,d,h,u,m,g,f,p,y,b,_,C=this.length*Math.min(Math.max(n,0),1);const S=this.vertices.length,v=S-1;let B=null,k=null;for(let N=0,H=this._lengths.length,q=0;N<H;N++){if(q+this._lengths[N]>=C){this._closed?(s=Vi(N,S),o=Vi(N-1,S),N===0&&(s=o,o=N)):(s=N,o=Math.min(Math.max(N-1,0),v)),B=this.vertices[s],k=this.vertices[o],C-=q,this._lengths[N]!==0?n=C/this._lengths[N]:n=0;break}q+=this._lengths[N]}if(B===null||k===null)return null;if(B){if(!k)return B}else return k;_=k.controls&&k.controls.right,b=B.controls&&B.controls.left,c=k.x,g=k.y,d=(_||k).x,f=(_||k).y,h=(b||B).x,p=(b||B).y,u=B.x,y=B.y,_&&k.relative&&(d+=k.x,f+=k.y),b&&B.relative&&(h+=B.x,p+=B.y),l=Kr(n,c,d,h,u),m=Kr(n,g,f,p,y);const R=Ht(c,d,n),$=Ht(g,f,n),P=Ht(d,h,n),I=Ht(f,p,n),V=Ht(h,u,n),A=Ht(p,y,n),L=Ht(R,P,n),D=Ht($,I,n),ee=Ht(P,V,n),E=Ht(I,A,n);return $e.isObject(r)?(r.x=l,r.y=m,r instanceof Re&&(r.controls.left.x=L,r.controls.left.y=D,r.controls.right.x=ee,r.controls.right.y=E,(typeof r.relative!="boolean"||r.relative)&&(r.controls.left.x-=l,r.controls.left.y-=m,r.controls.right.x-=l,r.controls.right.y-=m)),r.t=n,r):(a=new Re(l,m,L-l,D-m,ee-l,E-m,this._curved?he.curve:he.line),a.t=n,a)}plot(){if(this.curved)return Um(this._collection,this.closed),this;for(let n=0;n<this._collection.length;n++)this._collection[n].command=n===0?he.move:he.line;return this}subdivide(n){this._update();const r=this.vertices.length-1,s=this._closed||this.vertices[r]._command===he.close;let o=this.vertices[r],a=[],l;return $e.each(this.vertices,function(c,d){if(d<=0&&!s){o=c;return}if(c.command===he.move){a.push(new Re(o.x,o.y)),d>0&&(a[a.length-1].command=he.line),o=c;return}l=Mc(c,o,n),a=a.concat(l),$e.each(l,function(h,u){u<=0&&o.command===he.move?h.command=he.move:h.command=he.line}),d>=r&&(this._closed&&this._automatic&&(o=c,l=Mc(c,o,n),a=a.concat(l),$e.each(l,function(h,u){u<=0&&o.command===he.move?h.command=he.move:h.command=he.line})),a.push(new Re(c.x,c.y)),a[a.length-1].command=s?he.close:he.line),o=c},this),this._automatic=!1,this._curved=!1,this.vertices=a,this}_updateLength(n,r){r||this._update();const o=this.vertices.length-1;let a=this.vertices[o],l=0;return typeof this._lengths>"u"&&(this._lengths=[]),$e.each(this.vertices,function(c,d){if(d<=0||c.command===he.move){a=c,this._lengths[d]=0;return}this._lengths[d]=Fc(c,a,n),l+=this._lengths[d],a=c},this),this._length=l,this._flagLength=!1,this}_update(){if(this._flagVertices){this._automatic&&this.plot(),this._flagLength&&this._updateLength(void 0,!0);const n=this._collection.length,r=this._closed,s=Math.min(this._beginning,this._ending),o=Math.max(this._beginning,this._ending),a=Jr(this,s*this._length),l=Jr(this,o*this._length),c=lp(a),d=cp(l);let h,u,m,g,f,p;for(this._renderer.vertices.length=0,p=0;p<n;p++)this._renderer.collection.length<=p&&this._renderer.collection.push(new Re),p>d&&!u?(f=this._renderer.collection[p].copy(this._collection[p]),this.getPointAt(o,f),f.command=this._renderer.collection[p].command,this._renderer.vertices.push(f),u=f,m=this._collection[p-1],m&&m.controls&&(f.relative?f.controls.right.clear():f.controls.right.copy(f),m.relative?this._renderer.collection[p-1].controls.right.copy(m.controls.right).lerp(ge.zero,1-f.t):this._renderer.collection[p-1].controls.right.copy(m.controls.right).lerp(m,1-f.t))):p>=c&&p<=d&&(f=this._renderer.collection[p].copy(this._collection[p]),this._renderer.vertices.push(f),p===d&&Pc(this,o)?(u=f,!r&&u.controls&&(u.relative?u.controls.right.clear():u.controls.right.copy(u))):p===c&&Pc(this,s)&&(h=f,h.command=he.move,!r&&h.controls&&(h.relative?h.controls.left.clear():h.controls.left.copy(h))));c>0&&!h&&(p=c-1,f=this._renderer.collection[p].copy(this._collection[p]),this.getPointAt(s,f),f.command=he.move,this._renderer.vertices.unshift(f),g=this._collection[p+1],g&&g.controls&&(f.controls.left.clear(),g.relative?this._renderer.collection[p+1].controls.left.copy(g.controls.left).lerp(ge.zero,f.t):(dp.copy(g),this._renderer.collection[p+1].controls.left.copy(g.controls.left).lerp(g,f.t))))}return wn.prototype._update.apply(this,arguments),this}flagReset(){return this._flagVertices=this._flagLength=this._flagFill=this._flagStroke=this._flagLinewidth=this._flagOpacity=this._flagVisible=this._flagCap=this._flagJoin=this._flagMiter=this._flagClip=this._flagStrokeAttenuation=!1,wn.prototype.flagReset.call(this),this}};x(Gt,"Properties",["fill","stroke","linewidth","opacity","visible","cap","join","miter","closed","curved","automatic","beginning","ending","dashes","strokeAttenuation"]),x(Gt,"Utils",{getCurveLength:Fc});let Ee=Gt;const Oc={linewidth:{enumerable:!0,get:function(){return this._linewidth},set:function(t){this._linewidth=t,this._flagLinewidth=!0}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(t){this._opacity=t,this._flagOpacity=!0}},visible:{enumerable:!0,get:function(){return this._visible},set:function(t){this._visible=t,this._flagVisible=!0}},cap:{enumerable:!0,get:function(){return this._cap},set:function(t){this._cap=t,this._flagCap=!0}},join:{enumerable:!0,get:function(){return this._join},set:function(t){this._join=t,this._flagJoin=!0}},miter:{enumerable:!0,get:function(){return this._miter},set:function(t){this._miter=t,this._flagMiter=!0}},fill:{enumerable:!0,get:function(){return this._fill},set:function(t){(this._fill instanceof Je||this._fill instanceof xt||this._fill instanceof vt||this._fill instanceof qe)&&this._fill.unbind(U.Types.change,this._renderer.flagFill),this._fill=t,this._flagFill=!0,(this._fill instanceof Je||this._fill instanceof xt||this._fill instanceof vt||this._fill instanceof qe)&&this._fill.bind(U.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(t){(this._stroke instanceof Je||this._stroke instanceof xt||this._stroke instanceof vt||this._stroke instanceof qe)&&this._stroke.unbind(U.Types.change,this._renderer.flagStroke),this._stroke=t,this._flagStroke=!0,(this._stroke instanceof Je||this._stroke instanceof xt||this._stroke instanceof vt||this._stroke instanceof qe)&&this._stroke.bind(U.Types.change,this._renderer.flagStroke)}},length:{get:function(){return this._flagLength&&this._updateLength(),this._length}},closed:{enumerable:!0,get:function(){return this._closed},set:function(t){this._closed=!!t,this._flagVertices=!0}},curved:{enumerable:!0,get:function(){return this._curved},set:function(t){this._curved=!!t,this._flagVertices=!0}},automatic:{enumerable:!0,get:function(){return this._automatic},set:function(t){if(t===this._automatic)return;this._automatic=!!t;const e=this._automatic?"ignore":"listen";$e.each(this.vertices,function(n){n[e]()})}},beginning:{enumerable:!0,get:function(){return this._beginning},set:function(t){this._beginning=t,this._flagVertices=!0}},ending:{enumerable:!0,get:function(){return this._ending},set:function(t){this._ending=t,this._flagVertices=!0}},vertices:{enumerable:!0,get:function(){return this._collection},set:function(t){const e=this._renderer.bindVertices,n=this._renderer.unbindVertices;this._collection&&this._collection.unbind(U.Types.insert,e).unbind(U.Types.remove,n),t instanceof ti?this._collection=t:this._collection=new ti(t||[]),this._collection.bind(U.Types.insert,e).bind(U.Types.remove,n),e(this._collection)}},mask:{enumerable:!0,get:function(){return this._mask},set:function(t){this._mask=t,this._flagMask=!0,$e.isObject(t)&&!t.clip&&(t.clip=!0)}},clip:{enumerable:!0,get:function(){return this._clip},set:function(t){this._clip=t,this._flagClip=!0}},dashes:{enumerable:!0,get:function(){return this._dashes},set:function(t){typeof t.offset!="number"&&(t.offset=this.dashes&&this._dashes.offset||0),this._dashes=t}},strokeAttenuation:{enumerable:!0,get:function(){return this._strokeAttenuation},set:function(t){this._strokeAttenuation=!!t,this._flagStrokeAttenuation=!0,this._flagLinewidth=!0}}};function Ic(){this._flagVertices=!0,this._flagLength=!0,this.parent&&(this.parent._flagLength=!0)}function zc(t){let e=t.length;for(;e--;)t[e].bind(U.Types.change,this._renderer.flagVertices);this._renderer.flagVertices()}function Lc(t){let e=t.length;for(;e--;)t[e].unbind(U.Types.change,this._renderer.flagVertices);this._renderer.flagVertices()}function Dc(){this._flagFill=!0}function Hc(){this._flagStroke=!0}const hp=Math.ceil,up=Math.floor,mn=class mn extends wn{constructor(n){super();x(this,"_flagVertices",!0);x(this,"_flagLength",!0);x(this,"_flagFill",!0);x(this,"_flagStroke",!0);x(this,"_flagLinewidth",!0);x(this,"_flagOpacity",!0);x(this,"_flagVisible",!0);x(this,"_flagSize",!0);x(this,"_flagSizeAttenuation",!0);x(this,"_flagStrokeAttenuation",!0);x(this,"_length",0);x(this,"_fill","#fff");x(this,"_stroke","#000");x(this,"_linewidth",1);x(this,"_opacity",1);x(this,"_visible",!0);x(this,"_size",1);x(this,"_sizeAttenuation",!1);x(this,"_beginning",0);x(this,"_ending",1);x(this,"_dashes",null);x(this,"_strokeAttenuation",!0);x(this,"noFill",Ee.prototype.noFill);x(this,"noStroke",Ee.prototype.noStroke);x(this,"corner",Ee.prototype.corner);x(this,"center",Ee.prototype.center);x(this,"getBoundingClientRect",Ee.prototype.getBoundingClientRect);x(this,"_updateLength",Ee.prototype._updateLength);for(let r in Wc)Object.defineProperty(this,r,Wc[r]);this._renderer.type="points",this._renderer.flagVertices=Ic.bind(this),this._renderer.bindVertices=zc.bind(this),this._renderer.unbindVertices=Lc.bind(this),this._renderer.flagFill=Dc.bind(this),this._renderer.flagStroke=Hc.bind(this),this._renderer.vertices=null,this._renderer.collection=null,this.size=1,this.sizeAttenuation=!1,this.beginning=0,this.ending=1,this.fill="#fff",this.stroke="#000",this.linewidth=1,this.opacity=1,this.className="",this.visible=!0,this.vertices=n,this.dashes=[],this.dashes.offset=0}static fromObject(n){const r=typeof n.fill=="string"?n.fill:ii(n.fill),s=typeof n.stroke=="string"?n.stroke:ii(n.stroke),o=new mn().copy({...n,fill:r,stroke:s});return"id"in n&&(o.id=n.id),o}copy(n){super.copy.call(this,n);for(let r=0;r<n.vertices.length;r++){const s=n.vertices[r];s instanceof Re?this.vertices.push(n.vertices[r].clone()):this.vertices.push(new Re().copy(s))}for(let r=0;r<mn.Properties.length;r++){const s=mn.Properties[r];s in n&&(this[s]=n[s])}return this}clone(n){const r=new mn;for(let s=0;s<this.vertices.length;s++)r.vertices.push(this.vertices[s].clone());for(let s=0;s<mn.Properties.length;s++){const o=mn.Properties[s];r[o]=this[o]}return r.className=this.className,r.translation.copy(this.translation),r.rotation=this.rotation,r.scale=this.scale,r.skewX=this.skewX,r.skewY=this.skewY,this.matrix.manual&&r.matrix.copy(this.matrix),n&&n.add(r),r._update()}toObject(){const n=super.toObject.call(this);return n.renderer.type="points",n.vertices=this.vertices.map(r=>r.toObject()),$e.each(mn.Properties,function(r){typeof this[r]<"u"&&(this[r].toObject?n[r]=this[r].toObject():n[r]=this[r])},this),n}dispose(){if(super.dispose(),this.vertices&&typeof this.vertices.unbind=="function")try{this.vertices.unbind()}catch{}if(this.vertices)for(let n=0;n<this.vertices.length;n++){const r=this.vertices[n];typeof r.unbind=="function"&&r.unbind()}return typeof this.fill=="object"&&this.fill&&"dispose"in this.fill?this.fill.dispose():typeof this.fill=="object"&&this.fill&&"unbind"in this.fill&&this.fill.unbind(),typeof this.stroke=="object"&&this.stroke&&"dispose"in this.stroke?this.stroke.dispose():typeof this.stroke=="object"&&this.stroke&&"unbind"in this.stroke&&this.stroke.unbind(),this}subdivide(n){this._update();let r=[];for(let s=0;s<this.vertices.length;s++){const o=this.vertices[s],a=this.vertices[s-1];if(!a)continue;const l=o.x,c=o.y,d=a.x,h=a.y,u=kc(l,c,l,c,d,h,d,h,n);r=r.concat(u)}return this.vertices=r,this}_update(){if(this._flagVertices){this._flagLength&&this._updateLength(void 0,!0);const n=Math.min(this._beginning,this._ending),r=Math.max(this._beginning,this._ending),s=Jr(this,n*this._length),o=Jr(this,r*this._length),a=hp(s),l=up(o);let c=0,d;this._renderer.vertices=[],this._renderer.collection=[];for(let h=0;h<this._collection.length;h++)h>=a&&h<=l&&(d=this._collection[h],this._renderer.collection.push(d),this._renderer.vertices[c*2+0]=d.x,this._renderer.vertices[c*2+1]=d.y,c++)}return super._update.apply(this,arguments),this}flagReset(){return this._flagVertices=this._flagLength=this._flagFill=this._flagStroke=this._flagLinewidth=this._flagOpacity=this._flagVisible=this._flagSize=this._flagSizeAttenuation=!1,super.flagReset.call(this),this}};x(mn,"Properties",["fill","stroke","linewidth","opacity","visible","size","sizeAttenuation","beginning","ending","dashes","strokeAttenuation"]);let ts=mn;const Wc={linewidth:{enumerable:!0,get:function(){return this._linewidth},set:function(t){this._linewidth=t,this._flagLinewidth=!0}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(t){this._opacity=t,this._flagOpacity=!0}},visible:{enumerable:!0,get:function(){return this._visible},set:function(t){this._visible=t,this._flagVisible=!0}},size:{enumerable:!0,get:function(){return this._size},set:function(t){this._size=t,this._flagSize=!0}},sizeAttenuation:{enumerable:!0,get:function(){return this._sizeAttenuation},set:function(t){this._sizeAttenuation=t,this._flagSizeAttenuation=!0}},fill:{enumerable:!0,get:function(){return this._fill},set:function(t){(this._fill instanceof Je||this._fill instanceof xt||this._fill instanceof vt||this._fill instanceof qe)&&this._fill.unbind(U.Types.change,this._renderer.flagFill),this._fill=t,this._flagFill=!0,(this._fill instanceof Je||this._fill instanceof xt||this._fill instanceof vt||this._fill instanceof qe)&&this._fill.bind(U.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(t){(this._stroke instanceof Je||this._stroke instanceof xt||this._stroke instanceof vt||this._stroke instanceof qe)&&this._stroke.unbind(U.Types.change,this._renderer.flagStroke),this._stroke=t,this._flagStroke=!0,(this._stroke instanceof Je||this._stroke instanceof xt||this._stroke instanceof vt||this._stroke instanceof qe)&&this._stroke.bind(U.Types.change,this._renderer.flagStroke)}},length:{get:function(){return this._flagLength&&this._updateLength(),this._length}},beginning:{enumerable:!0,get:function(){return this._beginning},set:function(t){this._beginning=t,this._flagVertices=!0}},ending:{enumerable:!0,get:function(){return this._ending},set:function(t){this._ending=t,this._flagVertices=!0}},vertices:{enumerable:!0,get:function(){return this._collection},set:function(t){const e=this._renderer.bindVertices,n=this._renderer.unbindVertices;this._collection&&this._collection.unbind(U.Types.insert,e).unbind(U.Types.remove,n),t instanceof ti?this._collection=t:this._collection=new ti(t||[]),this._collection.bind(U.Types.insert,e).bind(U.Types.remove,n),e(this._collection)}},dashes:{enumerable:!0,get:function(){return this._dashes},set:function(t){typeof t.offset!="number"&&(t.offset=this.dashes&&this._dashes.offset||0),this._dashes=t}},strokeAttenuation:{enumerable:!0,get:function(){return this._strokeAttenuation},set:function(t){this._strokeAttenuation=!!t,this._flagStrokeAttenuation=!0,this._flagLinewidth=!0}}};class jc extends ti{constructor(n){n=Array.isArray(n)?n:Array.prototype.slice.call(arguments);super(n);Aa(this,Rs,{});this.attach(n),this.on(U.Types.insert,this.attach),this.on(U.Types.remove,this.detach)}get ids(){return Bt(this,Rs)}attach(n){for(let r=0;r<n.length;r++){const s=n[r];s&&s.id&&(this.ids[s.id]=s)}return this}detach(n){for(let r=0;r<n.length;r++)delete this.ids[n[r].id];return this}}Rs=new WeakMap;const Sn=class Sn extends Ee{constructor(n,r,s,o,a,l,c){const d=c||go.Resolution*3,h=[];for(let u=0;u<d;u++)h.push(new Re);super(h,!0,!1,!0);x(this,"_flagStartAngle",!1);x(this,"_flagEndAngle",!1);x(this,"_flagInnerRadius",!1);x(this,"_flagOuterRadius",!1);x(this,"_startAngle",0);x(this,"_endAngle",ei);x(this,"_innerRadius",0);x(this,"_outerRadius",0);this._renderer.type="arc-segment";for(let u in qc)Object.defineProperty(this,u,qc[u]);typeof s=="number"&&(this.innerRadius=s),typeof o=="number"&&(this.outerRadius=o),typeof a=="number"&&(this.startAngle=a),typeof l=="number"&&(this.endAngle=l),this._update(),typeof n=="number"&&(this.translation.x=n),typeof r=="number"&&(this.translation.y=r)}static fromObject(n){const r=new Sn().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<Sn.Properties.length;r++){const s=Sn.Properties[r];s in n&&typeof n[s]=="number"&&(this[s]=n[s])}return this}_update(){if(this._flagVertices||this._flagStartAngle||this._flagEndAngle||this._flagInnerRadius||this._flagOuterRadius){const n=this._startAngle,r=this._endAngle,s=this._innerRadius,o=this._outerRadius,a=Vi(n,ei)===Vi(r,ei),l=s>0,c=this.vertices;let d=l?c.length/2:c.length,h,u=0,m,g,f,p,y,b,_,C,S;for(a?d--:l||(d-=2),m=0,g=d-1;m<d;m++){switch(f=m/g,p=c[u],y=f*(r-n)+n,b=(r-n)/d,_=o*Math.cos(y),C=o*Math.sin(y),m){case 0:h=he.move;break;default:h=he.curve}p.command=h,p.x=_,p.y=C,p.controls.left.clear(),p.controls.right.clear(),p.command===he.curve&&(S=o*b/Math.PI,p.controls.left.x=S*Math.cos(y-it),p.controls.left.y=S*Math.sin(y-it),p.controls.right.x=S*Math.cos(y+it),p.controls.right.y=S*Math.sin(y+it),m===1&&p.controls.left.multiplyScalar(2),m===g&&p.controls.right.multiplyScalar(2)),u++}if(l){for(a?(c[u].command=he.close,u++):(d--,g=d-1),m=0;m<d;m++)f=m/g,p=c[u],y=(1-f)*(r-n)+n,b=(r-n)/d,_=s*Math.cos(y),C=s*Math.sin(y),h=he.curve,m<=0&&(h=a?he.move:he.line),p.command=h,p.x=_,p.y=C,p.controls.left.clear(),p.controls.right.clear(),p.command===he.curve&&(S=s*b/Math.PI,p.controls.left.x=S*Math.cos(y+it),p.controls.left.y=S*Math.sin(y+it),p.controls.right.x=S*Math.cos(y-it),p.controls.right.y=S*Math.sin(y-it),m===1&&p.controls.left.multiplyScalar(2),m===g&&p.controls.right.multiplyScalar(2)),u++;c[u].copy(c[0]),c[u].command=he.line}else a||(c[u].command=he.line,c[u].x=0,c[u].y=0,u++,c[u].copy(c[0]),c[u].command=he.line)}return super._update.call(this),this}flagReset(){return super.flagReset.call(this),this._flagStartAngle=this._flagEndAngle=this._flagInnerRadius=this._flagOuterRadius=!1,this}clone(n){const r=this.innerRadius,s=this.outerRadius,o=this.startAngle,a=this.endAngle,l=this.vertices.length,c=new Sn(0,0,r,s,o,a,l);c.translation.copy(this.translation),c.rotation=this.rotation,c.scale=this.scale,c.skewX=this.skewX,c.skewY=this.skewY,this.matrix.manual&&c.matrix.copy(this.matrix);for(let d=0;d<Ee.Properties.length;d++){const h=Ee.Properties[d];c[h]=this[h]}return n&&n.add(c),c}toObject(){const n=super.toObject.call(this);n.renderer.type="arc-segment";for(let r=0;r<Sn.Properties.length;r++){const s=Sn.Properties[r];n[s]=this[s]}return n}};x(Sn,"Properties",["startAngle","endAngle","innerRadius","outerRadius"]);let po=Sn;const qc={startAngle:{enumerable:!0,get:function(){return this._startAngle},set:function(t){this._startAngle=t,this._flagStartAngle=!0}},endAngle:{enumerable:!0,get:function(){return this._endAngle},set:function(t){this._endAngle=t,this._flagEndAngle=!0}},innerRadius:{enumerable:!0,get:function(){return this._innerRadius},set:function(t){this._innerRadius=t,this._flagInnerRadius=!0}},outerRadius:{enumerable:!0,get:function(){return this._outerRadius},set:function(t){this._outerRadius=t,this._flagOuterRadius=!0}}},yo=Math.cos,bo=Math.sin,Bn=class Bn extends Ee{constructor(n,r,s,o){const a=o?Math.max(o,2):4,l=[];for(let c=0;c<a;c++)l.push(new Re(0,0,0,0,0,0));super(l,!0,!0,!0);x(this,"_flagRadius",!1);x(this,"_radius",0);this._renderer.type="circle";for(let c in Xc)Object.defineProperty(this,c,Xc[c]);typeof s=="number"&&(this.radius=s),this._update(),typeof n=="number"&&(this.translation.x=n),typeof r=="number"&&(this.translation.y=r)}static fromObject(n){const r=new Bn().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<Bn.Properties.length;r++){const s=Bn.Properties[r];s in n&&typeof n[s]=="number"&&(this[s]=n[s])}return this}_update(){if(this._flagVertices||this._flagRadius){let n=this.vertices.length;!this._closed&&n>2&&(n-=1);const r=4/3*Math.tan(Math.PI/(n*2)),s=this._radius,o=s*r;for(let a=0;a<this.vertices.length;a++){const c=a/n*ei,d=s*yo(c),h=s*bo(c),u=o*yo(c-it),m=o*bo(c-it),g=o*yo(c+it),f=o*bo(c+it),p=this.vertices[a];p.command=a===0?he.move:he.curve,p.set(d,h),p.controls.left.set(u,m),p.controls.right.set(g,f)}}return super._update.call(this),this}flagReset(){return this._flagRadius=!1,super.flagReset.call(this),this}clone(n){const r=new Bn(0,0,this.radius,this.vertices.length);r.translation.copy(this.translation),r.rotation=this.rotation,r.scale=this.scale,r.skewX=this.skewX,r.skewY=this.skewY,this.matrix.manual&&r.matrix.copy(this.matrix);for(let s=0;s<Ee.Properties.length;s++){const o=Ee.Properties[s];r[o]=this[o]}return n&&n.add(r),r}toObject(){const n=super.toObject.call(this);n.renderer.type="circle";for(let r=0;r<Bn.Properties.length;r++){const s=Bn.Properties[r];n[s]=this[s]}return n}};x(Bn,"Properties",["radius"]);let _o=Bn;const Xc={radius:{enumerable:!0,get:function(){return this._radius},set:function(t){this._radius=t,this._flagRadius=!0}}},wo=Math.cos,xo=Math.sin,Tn=class Tn extends Ee{constructor(n,r,s,o,a){typeof o!="number"&&typeof s=="number"&&(o=s);const l=a?Math.max(a,2):4,c=[];for(let d=0;d<l;d++)c.push(new Re);super(c,!0,!0,!0);x(this,"_flagWidth",!1);x(this,"_flagHeight",!1);x(this,"_width",0);x(this,"_height",0);this._renderer.type="ellipse";for(let d in Yc)Object.defineProperty(this,d,Yc[d]);typeof s=="number"&&(this.width=s*2),typeof o=="number"&&(this.height=o*2),this._update(),typeof n=="number"&&(this.translation.x=n),typeof r=="number"&&(this.translation.y=r)}static fromObject(n){const r=new Tn().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<Tn.Properties.length;r++){const s=Tn.Properties[r];s in n&&typeof n[s]=="number"&&(this[s]=n[s])}return this}_update(){if(this._flagVertices||this._flagWidth||this._flagHeight){let n=this.vertices.length;!this._closed&&n>2&&(n-=1);const r=4/3*Math.tan(Math.PI/(this.vertices.length*2)),s=this._width/2,o=this._height/2;for(let a=0;a<this.vertices.length;a++){const c=a/n*ei,d=s*wo(c),h=o*xo(c),u=s*r*wo(c-it),m=o*r*xo(c-it),g=s*r*wo(c+it),f=o*r*xo(c+it),p=this.vertices[a];p.command=a===0?he.move:he.curve,p.set(d,h),p.controls.left.set(u,m),p.controls.right.set(g,f)}}return super._update.call(this),this}flagReset(){return this._flagWidth=this._flagHeight=!1,super.flagReset.call(this),this}clone(n){const r=this.width/2,s=this.height/2,o=this.vertices.length,a=new Tn(0,0,r,s,o);a.translation.copy(this.translation),a.rotation=this.rotation,a.scale=this.scale,a.skewX=this.skewX,a.skewY=this.skewY,this.matrix.manual&&a.matrix.copy(this.matrix);for(let l=0;l<Ee.Properties.length;l++){const c=Ee.Properties[l];a[c]=this[c]}return n&&n.add(a),a}toObject(){const n=super.toObject.call(this);n.renderer.type="ellipse";for(let r=0;r<Tn.Properties.length;r++){const s=Tn.Properties[r];n[s]=this[s]}return n}};x(Tn,"Properties",["width","height"]);let vo=Tn;const Yc={width:{enumerable:!0,get:function(){return this._width},set:function(t){this._width=t,this._flagWidth=!0}},height:{enumerable:!0,get:function(){return this._height},set:function(t){this._height=t,this._flagHeight=!0}}},fp=Math.cos,gp=Math.sin,Rn=class Rn extends Ee{constructor(n,r,s,o){o=Math.max(o||0,3);super();x(this,"_flagWidth",!1);x(this,"_flagHeight",!1);x(this,"_flagSides",!1);x(this,"_radius",0);x(this,"_width",0);x(this,"_height",0);x(this,"_sides",0);this._renderer.type="polygon";for(let a in Uc)Object.defineProperty(this,a,Uc[a]);this.closed=!0,this.automatic=!1,typeof s=="number"&&(this.radius=s),typeof o=="number"&&(this.sides=o),this._update(),typeof n=="number"&&(this.translation.x=n),typeof r=="number"&&(this.translation.y=r)}static fromObject(n){const r=new Rn().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<Rn.Properties.length;r++){const s=Rn.Properties[r];s in n&&typeof n[s]=="number"&&(this[s]=n[s])}return this}_update(){if(this._flagVertices||this._flagWidth||this._flagHeight||this._flagSides){const n=this._sides,r=n+1;let s=this.vertices.length;s>n&&(this.vertices.splice(n-1,s-n),s=n);for(let o=0;o<r;o++){const a=(o+.5)/n,l=ei*a+Math.PI/2,c=this._width*fp(l)/2,d=this._height*gp(l)/2;o>=s?this.vertices.push(new Re(c,d)):this.vertices[o].set(c,d),this.vertices[o].command=o===0?he.move:he.line}}return super._update.call(this),this}flagReset(){return this._flagWidth=this._flagHeight=this._flagSides=!1,super.flagReset.call(this),this}clone(n){const r=new Rn(0,0,0,this.sides);r.translation.copy(this.translation),r.rotation=this.rotation,r.scale=this.scale,r.skewX=this.skewX,r.skewY=this.skewY,r.width=this.width,r.height=this.height,this.matrix.manual&&r.matrix.copy(this.matrix);for(let s=0;s<Ee.Properties.length;s++){const o=Ee.Properties[s];r[o]=this[o]}return n&&n.add(r),r}toObject(){const n=super.toObject.call(this);n.renderer.type="polygon";for(let r=0;r<Rn.Properties.length;r++){const s=Rn.Properties[r];n[s]=this[s]}return n}};x(Rn,"Properties",["width","height","sides"]);let ko=Rn;const Uc={radius:{enumerable:!0,get:function(){return this._radius},set:function(t){this._radius=t,this.width=t*2,this.height=t*2}},width:{enumerable:!0,get:function(){return this._width},set:function(t){this._width=t,this._flagWidth=!0,this._radius=Math.max(this.width,this.height)/2}},height:{enumerable:!0,get:function(){return this._height},set:function(t){this._height=t,this._flagHeight=!0,this._radius=Math.max(this.width,this.height)/2}},sides:{enumerable:!0,get:function(){return this._sides},set:function(t){this._sides=t,this._flagSides=!0}}},bi=class bi extends Ee{constructor(n,r,s,o){const a=[new Re,new Re,new Re,new Re];super(a,!0,!1,!0);x(this,"_flagWidth",!1);x(this,"_flagHeight",!1);x(this,"_width",0);x(this,"_height",0);x(this,"_origin",null);this._renderer.type="rectangle";for(let l in Gc)Object.defineProperty(this,l,Gc[l]);this.width=typeof s=="number"?s:1,this.height=typeof o=="number"?o:1,this.origin=new ge,typeof n=="number"&&(this.translation.x=n),typeof r=="number"&&(this.translation.y=r),this._update()}static fromObject(n){const r=new bi().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<bi.Properties.length;r++){const s=bi.Properties[r];s in n&&(typeof n[s]=="number"?this[s]=n[s]:this[s]instanceof ge&&this[s].copy(n[s]))}return this}_update(){if(this._flagVertices||this._flagWidth||this._flagHeight){const n=this._width/2,r=this._height/2;!this._closed&&this.vertices.length===4&&this.vertices.push(new Re),this.vertices[0].set(-n,-r).sub(this._origin).command=he.move,this.vertices[1].set(n,-r).sub(this._origin).command=he.line,this.vertices[2].set(n,r).sub(this._origin).command=he.line,this.vertices[3].set(-n,r).sub(this._origin).command=he.line,this.vertices[4]&&(this.vertices[4].set(-n,-r).sub(this._origin).command=he.line)}return super._update.call(this),this}flagReset(){return this._flagWidth=this._flagHeight=!1,super.flagReset.call(this),this}clone(n){const r=new bi(0,0,this.width,this.height);r.translation.copy(this.translation),r.rotation=this.rotation,r.scale=this.scale,r.skewX=this.skewX,r.skewY=this.skewY,this.matrix.manual&&r.matrix.copy(this.matrix);for(let s=0;s<Ee.Properties.length;s++){const o=Ee.Properties[s];r[o]instanceof ge?r[o].copy(this[o]):r[o]=this[o]}return n&&n.add(r),r}toObject(){const n=super.toObject.call(this);return n.renderer.type="rectangle",n.width=this.width,n.height=this.height,n.origin=this.origin.toObject(),n}};x(bi,"Properties",["width","height","origin"]);let lr=bi;const Gc={width:{enumerable:!0,get:function(){return this._width},set:function(t){this._width=t,this._flagWidth=!0}},height:{enumerable:!0,get:function(){return this._height},set:function(t){this._height=t,this._flagHeight=!0}},origin:{enumerable:!0,get:function(){return this._origin},set:function(t){this._origin&&this._origin.unbind(U.Types.change,this._renderer.flagVertices),this._origin=t,this._origin.bind(U.Types.change,this._renderer.flagVertices),this._renderer.flagVertices()}}},$n=class $n extends Ee{constructor(n,r,s,o,a){typeof a>"u"&&typeof s=="number"&&typeof o=="number"&&(a=Math.floor(Math.min(s,o)/12));const l=[];for(let c=0;c<10;c++)l.push(new Re(0,0,0,0,0,0,c===0?he.move:he.curve));super(l);x(this,"_flagWidth",!1);x(this,"_flagHeight",!1);x(this,"_flagRadius",!1);x(this,"_width",0);x(this,"_height",0);x(this,"_radius",12);this._renderer.type="rounded-rectangle";for(let c in Kc)Object.defineProperty(this,c,Kc[c]);this.closed=!0,this.automatic=!1,this._renderer.flagRadius=mp.bind(this),typeof s=="number"&&(this.width=s),typeof o=="number"&&(this.height=o),(typeof a=="number"||a instanceof ge)&&(this.radius=a),this._update(),typeof n=="number"&&(this.translation.x=n),typeof r=="number"&&(this.translation.y=r)}static fromObject(n){const r=new $n().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<$n.Properties.length;r++){const s=$n.Properties[r];if(s in n){const o=n[s];/radius/i.test(s)?this[s]=typeof o=="number"||o instanceof ge?o:new ge().copy(o):typeof o=="number"&&(this[s]=o)}}return this}_update(){if(this._flagVertices||this._flagWidth||this._flagHeight||this._flagRadius){const n=this._width,r=this._height;let s,o;this._radius instanceof ge?(s=this._radius.x,o=this._radius.y):(s=this._radius,o=this._radius);let a,l=n/2,c=r/2;a=this.vertices[0],a.x=-(l-s),a.y=-c,a=this.vertices[1],a.x=l-s,a.y=-c,a.controls.left.clear(),a.controls.right.x=s,a.controls.right.y=0,a=this.vertices[2],a.x=l,a.y=-(c-o),a.controls.right.clear(),a.controls.left.clear(),a=this.vertices[3],a.x=l,a.y=c-o,a.controls.left.clear(),a.controls.right.x=0,a.controls.right.y=o,a=this.vertices[4],a.x=l-s,a.y=c,a.controls.right.clear(),a.controls.left.clear(),a=this.vertices[5],a.x=-(l-s),a.y=c,a.controls.left.clear(),a.controls.right.x=-s,a.controls.right.y=0,a=this.vertices[6],a.x=-l,a.y=c-o,a.controls.left.clear(),a.controls.right.clear(),a=this.vertices[7],a.x=-l,a.y=-(c-o),a.controls.left.clear(),a.controls.right.x=0,a.controls.right.y=-o,a=this.vertices[8],a.x=-(l-s),a.y=-c,a.controls.left.clear(),a.controls.right.clear(),a=this.vertices[9],a.copy(this.vertices[8])}return super._update.call(this),this}flagReset(){return this._flagWidth=this._flagHeight=this._flagRadius=!1,super.flagReset.call(this),this}clone(n){const r=this.width,s=this.height,o=this.radius,a=new $n(0,0,r,s,o);a.translation.copy(this.translation),a.rotation=this.rotation,a.scale=this.scale,a.skewX=this.skewX,a.skewY=this.skewY,this.matrix.manual&&a.matrix.copy(this.matrix);for(let l=0;l<Ee.Properties.length;l++){const c=Ee.Properties[l];a[c]=this[c]}return n&&n.add(a),a}toObject(){const n=super.toObject.call(this);n.renderer.type="rounded-rectangle";for(let r=0;r<$n.Properties.length;r++){const s=$n.Properties[r];n[s]=this[s]}return n.radius=typeof this.radius=="number"?this.radius:this.radius.toObject(),n}};x($n,"Properties",["width","height","radius"]);let Co=$n;const Kc={width:{enumerable:!0,get:function(){return this._width},set:function(t){this._width=t,this._flagWidth=!0}},height:{enumerable:!0,get:function(){return this._height},set:function(t){this._height=t,this._flagHeight=!0}},radius:{enumerable:!0,get:function(){return this._radius},set:function(t){this._radius instanceof ge&&this._radius.unbind(U.Types.change,this._renderer.flagRadius),this._radius=t,this._radius instanceof ge&&this._radius.bind(U.Types.change,this._renderer.flagRadius),this._flagRadius=!0}}};function mp(){this._flagRadius=!0}const pp=Math.cos,yp=Math.sin,En=class En extends Ee{constructor(n,r,s,o,a){arguments.length<=3&&(o=s,s=o/2),(typeof a!="number"||a<=0)&&(a=5);super();x(this,"_flagInnerRadius",!1);x(this,"_flagOuterRadius",!1);x(this,"_flagSides",!1);x(this,"_innerRadius",0);x(this,"_outerRadius",0);x(this,"_sides",0);this._renderer.type="star";for(let l in Zc)Object.defineProperty(this,l,Zc[l]);this.closed=!0,this.automatic=!1,typeof s=="number"&&(this.innerRadius=s),typeof o=="number"&&(this.outerRadius=o),typeof a=="number"&&(this.sides=a),this._update(),typeof n=="number"&&(this.translation.x=n),typeof r=="number"&&(this.translation.y=r)}static fromObject(n){const r=new En().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<En.Properties.length;r++){const s=En.Properties[r];s in n&&typeof n[s]=="number"&&(this[s]=n[s])}return this}_update(){if(this._flagVertices||this._flagInnerRadius||this._flagOuterRadius||this._flagSides){const n=this._sides*2,r=n+1;let s=this.vertices.length;s>n&&(this.vertices.splice(n-1,s-n),s=n);for(let o=0;o<r;o++){const a=(o+.5)/n,l=ei*a,c=(o%2?this._outerRadius:this._innerRadius)/2,d=c*pp(l),h=c*yp(l);o>=s?this.vertices.push(new Re(d,h)):this.vertices[o].set(d,h),this.vertices[o].command=o===0?he.move:he.line}}return super._update.call(this),this}flagReset(){return this._flagInnerRadius=this._flagOuterRadius=this._flagSides=!1,super.flagReset.call(this),this}clone(n){const r=this.innerRadius,s=this.outerRadius,o=this.sides,a=new En(0,0,r,s,o);a.translation.copy(this.translation),a.rotation=this.rotation,a.scale=this.scale,a.skewX=this.skewX,a.skewY=this.skewY,this.matrix.manual&&a.matrix.copy(this.matrix);for(let l=0;l<Ee.Properties.length;l++){const c=Ee.Properties[l];a[c]=this[c]}return n&&n.add(a),a}toObject(){const n=super.toObject.call(this);n.renderer.type="star";for(let r=0;r<En.Properties.length;r++){const s=En.Properties[r];n[s]=this[s]}return n}};x(En,"Properties",["innerRadius","outerRadius","sides"]);let So=En;const Zc={innerRadius:{enumerable:!0,get:function(){return this._innerRadius},set:function(t){this._innerRadius=t,this._flagInnerRadius=!0}},outerRadius:{enumerable:!0,get:function(){return this._outerRadius},set:function(t){this._outerRadius=t,this._flagOuterRadius=!0}},sides:{enumerable:!0,get:function(){return this._sides},set:function(t){this._sides=t,this._flagSides=!0}}};let Bo;const Qc=Math.min,Jc=Math.max;ln.document&&(Bo=document.createElement("canvas"));const gt=class gt extends wn{constructor(n,r,s,o){super();x(this,"_flagValue",!0);x(this,"_flagFamily",!0);x(this,"_flagSize",!0);x(this,"_flagLeading",!0);x(this,"_flagAlignment",!0);x(this,"_flagBaseline",!0);x(this,"_flagStyle",!0);x(this,"_flagWeight",!0);x(this,"_flagDecoration",!0);x(this,"_flagFill",!0);x(this,"_flagStroke",!0);x(this,"_flagLinewidth",!0);x(this,"_flagOpacity",!0);x(this,"_flagVisible",!0);x(this,"_flagMask",!1);x(this,"_flagClip",!1);x(this,"_flagDirection",!0);x(this,"_flagStrokeAttenuation",!0);x(this,"_value","");x(this,"_family","sans-serif");x(this,"_size",13);x(this,"_leading",17);x(this,"_alignment","center");x(this,"_baseline","middle");x(this,"_style","normal");x(this,"_weight",500);x(this,"_decoration","none");x(this,"_direction","ltr");x(this,"_fill","#000");x(this,"_stroke","none");x(this,"_linewidth",1);x(this,"_opacity",1);x(this,"_visible",!0);x(this,"_mask",null);x(this,"_clip",!1);x(this,"_dashes",null);x(this,"_strokeAttenuation",!0);for(let a in ed)Object.defineProperty(this,a,ed[a]);if(this._renderer.type="text",this._renderer.flagFill=bp.bind(this),this._renderer.flagStroke=_p.bind(this),this.value=n,typeof r=="number"&&(this.translation.x=r),typeof s=="number"&&(this.translation.y=s),this.dashes=[],this.dashes.offset=0,!$e.isObject(o))return this;for(let a=0;a<gt.Properties.length;a++){const l=gt.Properties[a];l in o&&(this[l]=o[l])}}static Measure(n){if(Bo){const r=Bo.getContext("2d");r.font=[n._style,n._weight,`${n._size}px/${n._leading}px`,n._family].join(" ");const s=r.measureText(n.value,0,0),o=s.actualBoundingBoxDescent+s.actualBoundingBoxAscent;return{width:s.width,height:o}}else{const r=this.value.length*this.size*gt.Ratio,s=this.leading;return console.warn("Two.Text: unable to accurately measure text, so using an approximation."),{width:r,height:s}}}static fromObject(n){const r=typeof n.fill=="string"?n.fill:ii(n.fill),s=typeof n.stroke=="string"?n.stroke:ii(n.stroke),o=new gt().copy({...n,fill:r,stroke:s});return"id"in n&&(o.id=n.id),o}copy(n){super.copy.call(this,n);for(let r=0;r<gt.Properties.length;r++){const s=gt.Properties[r];s in n&&(this[s]=n[s])}return this}clone(n){const r=new gt(this.value);r.translation.copy(this.translation),r.rotation=this.rotation,r.scale=this.scale;for(let s=0;s<gt.Properties.length;s++){const o=gt.Properties[s];r[o]=this[o]}return this.matrix.manual&&r.matrix.copy(this.matrix),n&&n.add(r),r._update()}toObject(){const n=super.toObject.call(this);n.renderer.type="text";for(let r=0;r<gt.Properties.length;r++){const s=gt.Properties[r];n[s]=this[s]}return n}dispose(){return super.dispose(),typeof this.fill=="object"&&this.fill&&"dispose"in this.fill?this.fill.dispose():typeof this.fill=="object"&&this.fill&&"unbind"in this.fill&&this.fill.unbind(),typeof this.stroke=="object"&&this.stroke&&"dispose"in this.stroke?this.stroke.dispose():typeof this.stroke=="object"&&this.stroke&&"unbind"in this.stroke&&this.stroke.unbind(),this}noFill(){return this.fill="none",this}noStroke(){return this.stroke="none",this.linewidth=0,this}getBoundingClientRect(n){let r,s,o,a,l;this._update(!0),r=n?this.matrix:this.worldMatrix;const{width:c,height:d}=gt.Measure(this),h=(this._linewidth||0)/2;switch(this.alignment){case"left":s=-h,o=c+h;break;case"right":s=-(c+h),o=h;break;default:s=-(c/2+h),o=c/2+h}switch(this.baseline){case"middle":a=-(d/2+h),l=d/2+h;break;default:a=-(d+h),l=h}const[u,m]=r.multiply(s,a),[g,f]=r.multiply(s,l),[p,y]=r.multiply(o,a),[b,_]=r.multiply(o,l);return a=Qc(m,f,y,_),s=Qc(u,g,p,b),o=Jc(u,g,p,b),l=Jc(m,f,y,_),{top:a,left:s,right:o,bottom:l,width:o-s,height:l-a}}flagReset(){return super.flagReset.call(this),this._flagValue=this._flagFamily=this._flagSize=this._flagLeading=this._flagAlignment=this._flagFill=this._flagStroke=this._flagLinewidth=this._flagOpacity=this._flagVisible=this._flagClip=this._flagDecoration=this._flagClassName=this._flagBaseline=this._flagWeight=this._flagStyle=this._flagDirection=!1,this}};x(gt,"Ratio",.6),x(gt,"Properties",["value","family","size","leading","alignment","linewidth","style","weight","decoration","direction","baseline","opacity","visible","fill","stroke","dashes","strokeAttenuation"]);let zi=gt;const ed={value:{enumerable:!0,get:function(){return this._value},set:function(t){this._value=t,this._flagValue=!0}},family:{enumerable:!0,get:function(){return this._family},set:function(t){this._family=t,this._flagFamily=!0}},size:{enumerable:!0,get:function(){return this._size},set:function(t){this._size=t,this._flagSize=!0}},leading:{enumerable:!0,get:function(){return this._leading},set:function(t){this._leading=t,this._flagLeading=!0}},alignment:{enumerable:!0,get:function(){return this._alignment},set:function(t){this._alignment=t,this._flagAlignment=!0}},linewidth:{enumerable:!0,get:function(){return this._linewidth},set:function(t){this._linewidth=t,this._flagLinewidth=!0}},style:{enumerable:!0,get:function(){return this._style},set:function(t){this._style=t,this._flagStyle=!0}},weight:{enumerable:!0,get:function(){return this._weight},set:function(t){this._weight=t,this._flagWeight=!0}},decoration:{enumerable:!0,get:function(){return this._decoration},set:function(t){this._decoration=t,this._flagDecoration=!0}},direction:{enumerable:!0,get:function(){return this._direction},set:function(t){this._direction=t,this._flagDirection=!0}},baseline:{enumerable:!0,get:function(){return this._baseline},set:function(t){this._baseline=t,this._flagBaseline=!0}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(t){this._opacity=t,this._flagOpacity=!0}},visible:{enumerable:!0,get:function(){return this._visible},set:function(t){this._visible=t,this._flagVisible=!0}},fill:{enumerable:!0,get:function(){return this._fill},set:function(t){(this._fill instanceof Je||this._fill instanceof xt||this._fill instanceof vt||this._fill instanceof qe)&&this._fill.unbind(U.Types.change,this._renderer.flagFill),this._fill=t,this._flagFill=!0,(this._fill instanceof Je||this._fill instanceof xt||this._fill instanceof vt||this._fill instanceof qe)&&this._fill.bind(U.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(t){(this._stroke instanceof Je||this._stroke instanceof xt||this._stroke instanceof vt||this._stroke instanceof qe)&&this._stroke.unbind(U.Types.change,this._renderer.flagStroke),this._stroke=t,this._flagStroke=!0,(this._stroke instanceof Je||this._stroke instanceof xt||this._stroke instanceof vt||this._stroke instanceof qe)&&this._stroke.bind(U.Types.change,this._renderer.flagStroke)}},mask:{enumerable:!0,get:function(){return this._mask},set:function(t){this._mask=t,this._flagMask=!0,$e.isObject(t)&&!t.clip&&(t.clip=!0)}},clip:{enumerable:!0,get:function(){return this._clip},set:function(t){this._clip=t,this._flagClip=!0}},dashes:{enumerable:!0,get:function(){return this._dashes},set:function(t){typeof t.offset!="number"&&(t.offset=this.dashes&&this._dashes.offset||0),this._dashes=t}},strokeAttenuation:{enumerable:!0,get:function(){return this._strokeAttenuation},set:function(t){this._strokeAttenuation=!!t,this._flagStrokeAttenuation=!0,this._flagLinewidth=!0}}};function bp(){this._flagFill=!0}function _p(){this._flagStroke=!0}const Nn=class Nn extends lr{constructor(n,r,s,o){super(r,s,0,0);x(this,"_flagTextures",!1);x(this,"_flagFrameRate",!1);x(this,"_flagIndex",!1);x(this,"_amount",1);x(this,"_duration",0);x(this,"_index",0);x(this,"_startTime",0);x(this,"_playing",!1);x(this,"_firstFrame",0);x(this,"_lastFrame",0);x(this,"_loop",!0);x(this,"_textures",null);x(this,"_frameRate",0);x(this,"_origin",null);this._renderer.type="image-sequence";for(let a in td)Object.defineProperty(this,a,td[a]);this._renderer.flagTextures=wp.bind(this),this._renderer.bindTextures=xp.bind(this),this._renderer.unbindTextures=vp.bind(this),this.noStroke(),this.noFill(),Array.isArray(n)?this.textures=n.map(nd.bind(this)):typeof n=="string"&&(this.textures=[nd(n)]),this.origin=new ge,this._update(),typeof o=="number"?this.frameRate=o:this.frameRate=Nn.DefaultFrameRate,this.index=0}static fromObject(n){const r=new Nn().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<Nn.Properties.length;r++){const s=Nn.Properties[r];s in n&&(this[s]=n[s])}return this}play(n,r,s){return this._playing=!0,this._firstFrame=0,this._lastFrame=this.amount-1,this._startTime=$e.performance.now(),typeof n=="number"&&(this._firstFrame=n),typeof r=="number"&&(this._lastFrame=r),typeof s=="function"?this._onLastFrame=s:delete this._onLastFrame,this._index!==this._firstFrame&&(this._startTime-=1e3*Math.abs(this._index-this._firstFrame)/this._frameRate),this}pause(){return this._playing=!1,this}stop(){return this._playing=!1,this._index=this._firstFrame,this}clone(n){const r=new Nn(this.textures,this.translation.x,this.translation.y,this.frameRate);return r._loop=this._loop,this._playing&&r.play(),n&&n.add(r),r}toObject(){const n=super.toObject.call(this);return n.renderer.type="image-sequence",n.textures=this.textures.map(function(r){return r.toObject()}),n.frameRate=this.frameRate,n.index=this.index,n.firstFrame=this.firstFrame,n.lastFrame=this.lastFrame,n.loop=this.loop,n}dispose(){if(super.dispose(),this._playing&&(this._playing=!1),this._onLastFrame=null,this.textures&&typeof this.textures.unbind=="function")try{this.textures.unbind()}catch{}if(this.textures)for(let n=0;n<this.textures.length;n++){const r=this.textures[n];typeof r.dispose=="function"?r.dispose():typeof r.unbind=="function"&&r.unbind()}return this}_update(){const n=this._textures;let r,s,o,a,l,c,d,h;return n&&(this._flagTextures&&(this._amount=n.length),this._flagFrameRate&&(this._duration=1e3*this._amount/this._frameRate),this._playing&&this._frameRate>0?(a=this._amount,$e.isNaN(this._lastFrame)&&(this._lastFrame=a-1),o=$e.performance.now()-this._startTime,h=this._lastFrame+1,l=1e3*(h-this._firstFrame)/this._frameRate,this._loop?o=o%l:o=Math.min(o,l),d=Ht(this._firstFrame,h,o/l),d=Math.floor(d),d!==this._index&&(this._index=d,c=n[this._index],c.loaded&&(r=c.image.width,s=c.image.height,this.width!==r&&(this.width=r),this.height!==s&&(this.height=s),this.fill=c,d>=this._lastFrame-1&&this._onLastFrame&&this._onLastFrame()))):(this._flagIndex||!(this.fill instanceof qe))&&(c=n[this._index],c.loaded&&(r=c.image.width,s=c.image.height,this.width!==r&&(this.width=r),this.height!==s&&(this.height=s)),this.fill=c)),super._update.call(this),this}flagReset(){return this._flagTextures=this._flagFrameRate=!1,super.flagReset.call(this),this}};x(Nn,"Properties",["textures","frameRate","index","firstFrame","lastFrame","loop"]),x(Nn,"DefaultFrameRate",30);let To=Nn;const td={frameRate:{enumerable:!0,get:function(){return this._frameRate},set:function(t){this._frameRate=t,this._flagFrameRate=!0}},index:{enumerable:!0,get:function(){return this._index},set:function(t){this._index=t,this._flagIndex=!0}},textures:{enumerable:!0,get:function(){return this._textures},set:function(t){const e=this._renderer.bindTextures,n=this._renderer.unbindTextures;this._textures&&this._textures.unbind(U.Types.insert,e).unbind(U.Types.remove,n),this._textures=new ti((t||[]).slice(0)),this._textures.bind(U.Types.insert,e).bind(U.Types.remove,n),e(this._textures)}},firstFrame:{enumerable:!0,get:function(){return this._firstFrame},set:function(t){this._firstFrame=t}},lastFrame:{enumerable:!0,get:function(){return this._lastFrame},set:function(t){this._lastFrame=t}},loop:{enumerable:!0,get:function(){return this._loop},set:function(t){this._loop=!!t}}};function wp(){this._flagTextures=!0}function xp(t){let e=t.length;for(;e--;)t[e].bind(U.Types.change,this._renderer.flagTextures);this._renderer.flagTextures()}function vp(t){let e=t.length;for(;e--;)t[e].unbind(U.Types.change,this._renderer.flagTextures);this._renderer.flagTextures()}function nd(t){if(t instanceof qe)return t;if(typeof t=="string")return new qe(t)}const _i=class _i extends lr{constructor(n,r,s,o,a,l){super(r,s,0,0);x(this,"_flagTexture",!1);x(this,"_flagColumns",!1);x(this,"_flagRows",!1);x(this,"_flagFrameRate",!1);x(this,"_flagIndex",!1);x(this,"_amount",1);x(this,"_duration",0);x(this,"_startTime",0);x(this,"_playing",!1);x(this,"_firstFrame",0);x(this,"_lastFrame",0);x(this,"_loop",!0);x(this,"_texture",null);x(this,"_columns",1);x(this,"_rows",1);x(this,"_frameRate",0);x(this,"_index",0);x(this,"_origin",null);this._renderer.type="sprite";for(let c in id)Object.defineProperty(this,c,id[c]);this.noStroke(),this.noFill(),n instanceof qe?this.texture=n:typeof n=="string"&&(this.texture=new qe(n)),this.origin=new ge,this._update(),typeof o=="number"&&(this.columns=o),typeof a=="number"&&(this.rows=a),typeof l=="number"&&(this.frameRate=l),this.index=0}static fromObject(n){const r=new _i().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<_i.Properties.length;r++){const s=_i.Properties[r];s in n&&(this[s]=n[s])}return this}play(n,r,s){return this._playing=!0,this._firstFrame=0,this._lastFrame=this.amount-1,this._startTime=$e.performance.now(),typeof n=="number"&&(this._firstFrame=n),typeof r=="number"&&(this._lastFrame=r),typeof s=="function"?this._onLastFrame=s:delete this._onLastFrame,this._index!==this._firstFrame&&(this._startTime-=1e3*Math.abs(this._index-this._firstFrame)/this._frameRate),this}pause(){return this._playing=!1,this}stop(){return this._playing=!1,this._index=0,this}clone(n){const r=new _i(this.texture,this.translation.x,this.translation.y,this.columns,this.rows,this.frameRate);return this.playing&&r.play(this._firstFrame,this._lastFrame),r.loop=this.loop,r.firstFrame=this.firstFrame,r.lastFrame=this.lastFrame,n&&n.add(r),r}toObject(){const n=super.toObject.call(this);return n.renderer.type="sprite",n.texture=this.texture.toObject(),n.columns=this.columns,n.rows=this.rows,n.frameRate=this.frameRate,n.index=this.index,n.firstFrame=this.firstFrame,n.lastFrame=this.lastFrame,n.loop=this.loop,n}dispose(){return super.dispose(),this._playing&&(this._playing=!1),this._onLastFrame=null,this._startTime=0,this._texture&&typeof this._texture.dispose=="function"?this._texture.dispose():this._texture&&typeof this._texture.unbind=="function"&&this._texture.unbind(),this}_update(){const n=this._texture,r=this._columns,s=this._rows;let o,a,l,c,d,h,u,m,g;if(n&&((this._flagColumns||this._flagRows)&&(this._amount=this._columns*this._rows),this._flagFrameRate&&(this._duration=1e3*this._amount/this._frameRate),this._flagTexture&&(this.fill=n),n.loaded)){u=n.image.width,m=n.image.height,o=u/r,a=m/s,c=this._amount,this.width!==o&&(this.width=o),this.height!==a&&(this.height=a),this._playing&&this._frameRate>0&&($e.isNaN(this._lastFrame)&&(this._lastFrame=c-1),l=$e.performance.now()-this._startTime,g=this._lastFrame+1,d=1e3*(g-this._firstFrame)/this._frameRate,this._loop?l=l%d:l=Math.min(l,d),h=Ht(this._firstFrame,g,l/d),h=Math.floor(h),h!==this._index&&(this._index=h,h>=this._lastFrame-1&&this._onLastFrame&&this._onLastFrame()));const f=this._index%r,p=Math.floor(this._index/r),y=-o*f+(u-o)/2,b=-a*p+(m-a)/2;y!==n.offset.x&&(n.offset.x=y),b!==n.offset.y&&(n.offset.y=b)}return super._update.call(this),this}flagReset(){return this._flagTexture=this._flagColumns=this._flagRows=this._flagFrameRate=!1,super.flagReset.call(this),this}};x(_i,"Properties",["texture","columns","rows","frameRate","index","firstFrame","lastFrame","loop"]);let Ro=_i;const id={texture:{enumerable:!0,get:function(){return this._texture},set:function(t){this._texture=t,this._flagTexture=!0}},columns:{enumerable:!0,get:function(){return this._columns},set:function(t){this._columns=t,this._flagColumns=!0}},rows:{enumerable:!0,get:function(){return this._rows},set:function(t){this._rows=t,this._flagRows=!0}},frameRate:{enumerable:!0,get:function(){return this._frameRate},set:function(t){this._frameRate=t,this._flagFrameRate=!0}},index:{enumerable:!0,get:function(){return this._index},set:function(t){this._index=t,this._flagIndex=!0}},firstFrame:{enumerable:!0,get:function(){return this._firstFrame},set:function(t){this._firstFrame=t}},lastFrame:{enumerable:!0,get:function(){return this._lastFrame},set:function(t){this._lastFrame=t}},loop:{enumerable:!0,get:function(){return this._loop},set:function(t){this._loop=!!t}}},ns=Math.min,is=Math.max,Kt=class Kt extends wn{constructor(n){super();x(this,"_flagAdditions",!1);x(this,"_flagSubtractions",!1);x(this,"_flagOrder",!1);x(this,"_flagOpacity",!0);x(this,"_flagBeginning",!1);x(this,"_flagEnding",!1);x(this,"_flagLength",!1);x(this,"_flagMask",!1);x(this,"_fill","#fff");x(this,"_stroke","#000");x(this,"_linewidth",1);x(this,"_opacity",1);x(this,"_visible",!0);x(this,"_cap","round");x(this,"_join","round");x(this,"_miter",4);x(this,"_closed",!0);x(this,"_curved",!1);x(this,"_automatic",!0);x(this,"_beginning",0);x(this,"_ending",1);x(this,"_length",0);x(this,"_mask",null);x(this,"_strokeAttenuation",!0);for(let r in rd)Object.defineProperty(this,r,rd[r]);this._renderer.type="group",this.additions=[],this.subtractions=[],this.children=Array.isArray(n)?n:Array.prototype.slice.call(arguments)}static InsertChildren(n){for(let r=0;r<n.length;r++)sd.call(this,n[r],this)}static RemoveChildren(n){for(let r=0;r<n.length;r++)sd.call(this,n[r])}static OrderChildren(n){this._flagOrder=!0}static fromObject(n){const r=new Kt;for(let o=0;o<Kt.Properties.length;o++){const a=Kt.Properties[o];a in n&&(/(fill|stroke)/i.test(a)?r[a]=typeof n[a]=="string"?n[a]:ii(n[a]):r[a]=n[a])}return"mask"in n&&(r.mask=s(n.mask)),"id"in n&&(r.id=n.id),r.children=n.children.map(s),r;function s(o){if(o&&o.renderer)switch(o.renderer.type){case"arc-segment":return po.fromObject(o);case"circle":return _o.fromObject(o);case"element":return or.fromObject(o);case"ellipse":return vo.fromObject(o);case"group":return Kt.fromObject(o);case"image":return Image.fromObject(o);case"image-sequence":return To.fromObject(o);case"path":return Ee.fromObject(o);case"points":return ts.fromObject(o);case"polygon":return ko.fromObject(o);case"rectangle":return lr.fromObject(o);case"rounded-rectangle":return Co.fromObject(o);case"shape":return wn.fromObject(o);case"sprite":return Ro.fromObject(o);case"star":return So.fromObject(o);case"text":return zi.fromObject(o)}return o}}copy(n){super.copy.call(this,n),console.warn("Two.js: attempting to copy group. Two.Group.children copying not supported.");for(let r=0;r<Kt.Properties.length;r++){const s=Kt.Properties[r];s in n&&(this[s]=n[s])}return this}clone(n){const r=new Kt,s=this.children.map(function(o){return o.clone()});return r.add(s),r.opacity=this.opacity,this.mask&&(r.mask=this.mask),r.translation.copy(this.translation),r.rotation=this.rotation,r.scale=this.scale,r.className=this.className,this.matrix.manual&&r.matrix.copy(this.matrix),n&&n.add(r),r._update()}toObject(){const n=super.toObject.call(this);return n.renderer.type="group",n.children=[],n.opacity=this.opacity,n.className=this.className,n.mask=this.mask?this.mask.toObject():null,$e.each(this.children,(r,s)=>{n.children[s]=r.toObject()},this),n}dispose(){if(super.dispose(),this.children)for(let n=0;n<this.children.length;n++){const r=this.children[n];typeof r.dispose=="function"&&r.dispose()}if(this.children&&typeof this.children.unbind=="function")try{this.children.unbind()}catch{}return this}corner(){const n=this.getBoundingClientRect(!0);for(let r=0;r<this.children.length;r++){const s=this.children[r];s.translation.x-=n.left,s.translation.y-=n.top}return this.mask&&(this.mask.translation.x-=n.left,this.mask.translation.y-=n.top),this}center(){const n=this.getBoundingClientRect(!0),r=n.left+n.width/2-this.translation.x,s=n.top+n.height/2-this.translation.y;for(let o=0;o<this.children.length;o++){const a=this.children[o];a.isShape&&(a.translation.x-=r,a.translation.y-=s)}return this.mask&&(this.mask.translation.x-=r,this.mask.translation.y-=s),this}getById(n){let r=null;function s(o){if(o.id===n)return o;if(o.children){if(o.children.ids[n])return o.children.ids[n];for(let a=0;a<o.children.length;a++)if(r=s(o.children[a]),r)return r}return null}return s(this)}getByClassName(n){const r=[];function s(o){if(Array.prototype.indexOf.call(o.classList,n)>=0&&r.push(o),o.children)for(let a=0;a<o.children.length;a++){const l=o.children[a];s(l)}return r}return s(this)}getByType(n){const r=[];function s(o){if(o instanceof n&&r.push(o),o.children)for(let a=0;a<o.children.length;a++){const l=o.children[a];s(l)}return r}return s(this)}add(n){n instanceof Array?n=n.slice():n=Array.prototype.slice.call(arguments);for(let r=0;r<n.length;r++){const s=n[r];if(!(s&&s.id))continue;const o=Array.prototype.indexOf.call(this.children,s);o>=0&&this.children.splice(o,1),this.children.push(s)}return this}remove(n){const r=arguments.length,s=this.parent;if(r<=0&&s)return s.remove(this),this;n instanceof Array?n=n.slice():n=Array.prototype.slice.call(arguments);for(let o=0;o<n.length;o++){const a=n[o];if(!a||!this.children.ids[a.id])continue;const l=this.children.indexOf(a);l>=0&&this.children.splice(l,1)}return this}getBoundingClientRect(n){let r,s,o,a,l,c;this._update(!0);let d=1/0,h=-1/0,u=1/0,m=-1/0;const g=/texture|gradient/i;s=n?this.matrix:this.worldMatrix;for(let f=0;f<this.children.length;f++){const p=this.children[f];if(!(!p.visible||g.test(p._renderer.type))&&(r=p.getBoundingClientRect(n),o=typeof r.top!="number"||$e.isNaN(r.top)||!isFinite(r.top),a=typeof r.left!="number"||$e.isNaN(r.left)||!isFinite(r.left),l=typeof r.right!="number"||$e.isNaN(r.right)||!isFinite(r.right),c=typeof r.bottom!="number"||$e.isNaN(r.bottom)||!isFinite(r.bottom),!(o||a||l||c)))if(n){const[y,b]=s.multiply(r.left,r.top),[_,C]=s.multiply(r.right,r.top),[S,v]=s.multiply(r.left,r.bottom),[B,k]=s.multiply(r.right,r.bottom);u=ns(b,C,v,k,u),d=ns(y,_,S,B,d),h=is(y,_,S,B,h),m=is(b,C,v,k,m)}else u=ns(r.top,u),d=ns(r.left,d),h=is(r.right,h),m=is(r.bottom,m)}return{top:u,left:d,right:h,bottom:m,width:h-d,height:m-u}}noFill(){return this.children.forEach(function(n){n.noFill()}),this}noStroke(){return this.children.forEach(function(n){n.noStroke()}),this}subdivide(){const n=arguments;return this.children.forEach(function(r){r.subdivide.apply(r,n)}),this}_update(){let n,r,s;if(this._flagBeginning||this._flagEnding){const o=Math.min(this._beginning,this._ending),a=Math.max(this._beginning,this._ending),l=this.length;let c=0;const d=o*l,h=a*l;for(n=0;n<this.children.length;n++)s=this.children[n],r=s.length,d>c+r?(s.beginning=1,s.ending=1):h<c?(s.beginning=0,s.ending=0):d>c&&d<c+r?(s.beginning=(d-c)/r,s.ending=1):h>c&&h<c+r?(s.beginning=0,s.ending=(h-c)/r):(s.beginning=0,s.ending=1),c+=r}return super._update.apply(this,arguments)}flagReset(){return this._flagAdditions&&(this.additions.length=0,this._flagAdditions=!1),this._flagSubtractions&&(this.subtractions.length=0,this._flagSubtractions=!1),this._flagOrder=this._flagMask=this._flagOpacity=this._flagBeginning=this._flagEnding=!1,super.flagReset.call(this),this}};x(Kt,"Children",jc),x(Kt,"Properties",["fill","stroke","linewidth","cap","join","miter","closed","curved","automatic"]);let xn=Kt;const rd={visible:{enumerable:!0,get:function(){return this._visible},set:function(t){this._flagVisible=this._visible!==t||this._flagVisible,this._visible=t}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(t){this._flagOpacity=this._opacity!==t||this._flagOpacity,this._opacity=t}},beginning:{enumerable:!0,get:function(){return this._beginning},set:function(t){this._flagBeginning=this._beginning!==t||this._flagBeginning,this._beginning=t}},ending:{enumerable:!0,get:function(){return this._ending},set:function(t){this._flagEnding=this._ending!==t||this._flagEnding,this._ending=t}},length:{enumerable:!0,get:function(){if(this._flagLength||this._length<=0){if(this._length=0,!this.children)return this._length;for(let t=0;t<this.children.length;t++){const e=this.children[t];this._length+=e.length}}return this._length}},fill:{enumerable:!0,get:function(){return this._fill},set:function(t){this._fill=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.fill=t}}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(t){this._stroke=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.stroke=t}}},linewidth:{enumerable:!0,get:function(){return this._linewidth},set:function(t){this._linewidth=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.linewidth=t}}},join:{enumerable:!0,get:function(){return this._join},set:function(t){this._join=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.join=t}}},miter:{enumerable:!0,get:function(){return this._miter},set:function(t){this._miter=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.miter=t}}},cap:{enumerable:!0,get:function(){return this._cap},set:function(t){this._cap=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.cap=t}}},closed:{enumerable:!0,get:function(){return this._closed},set:function(t){this._closed=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.closed=t}}},curved:{enumerable:!0,get:function(){return this._curved},set:function(t){this._curved=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.curved=t}}},automatic:{enumerable:!0,get:function(){return this._automatic},set:function(t){this._automatic=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.automatic=t}}},children:{enumerable:!0,get:function(){return this._children},set:function(t){const e=xn.InsertChildren.bind(this),n=xn.RemoveChildren.bind(this),r=xn.OrderChildren.bind(this);this._children&&(this._children.unbind(),this._children.length>0&&n(this._children)),this._children=new jc(t),this._children.bind(U.Types.insert,e),this._children.bind(U.Types.remove,n),this._children.bind(U.Types.order,r),t.length>0&&e(t)}},mask:{enumerable:!0,get:function(){return this._mask},set:function(t){this._mask=t,this._flagMask=!0,$e.isObject(t)&&!t.clip&&(t.clip=!0)}},strokeAttenuation:{enumerable:!0,get:function(){return this._strokeAttenuation},set:function(t){this._strokeAttenuation=!!t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.strokeAttenuation!==void 0&&(n.strokeAttenuation=t)}}}};function sd(t,e){const n=t.parent;let r;if(n===e){s();return}if(n&&n.children.ids[t.id]&&(r=Array.prototype.indexOf.call(n.children,t),n.children.splice(r,1),o()),e){s();return}o(),n._flagAdditions&&n.additions.length===0&&(n._flagAdditions=!1),n._flagSubtractions&&n.subtractions.length===0&&(n._flagSubtractions=!1),delete t.parent;function s(){e.subtractions.length>0&&(r=Array.prototype.indexOf.call(e.subtractions,t),r>=0&&e.subtractions.splice(r,1)),e.additions.length>0&&(r=Array.prototype.indexOf.call(e.additions,t),r>=0&&e.additions.splice(r,1)),t.parent=e,e.additions.push(t),e._flagAdditions=!0}function o(){r=Array.prototype.indexOf.call(n.additions,t),r>=0&&n.additions.splice(r,1),r=Array.prototype.indexOf.call(n.subtractions,t),r<0&&(n.subtractions.push(t),n._flagSubtractions=!0)}}class rs extends Ee{constructor(e,n,r,s){const o=[new Re(e,n),new Re(r,s)];super(o);for(let a in od)Object.defineProperty(this,a,od[a]);this.vertices[0].command=he.move,this.vertices[1].command=he.line,this.automatic=!1}}x(rs,"Properties",["left","right"]);const od={left:{enumerable:!0,get:function(){return this.vertices[0]},set:function(t){if($e.isObject(t))this.vertices.splice(0,1,t),this.vertices[0].command=he.move;else{const e=new Zr("Two.Line.left argument is not an object.");console.warn(e.name,e.message)}}},right:{enumerable:!0,get:function(){return this.vertices[1]},set:function(t){if($e.isObject(t))this.vertices.splice(1,1,t),this.vertices[1].command=he.line;else{const e=new Zr("Two.Line.right argument is not an object.");console.warn(e.name,e.message)}}}};class $o{constructor(e=0,n=0){this.x=e,this.y=n}}class ri{constructor(e=10,n=0,r="A"){x(this,"start",new $o);x(this,"end",new $o);this.width=e,this.angle=n,this.label=r}}const Ve={line:{color:"#000",size:5},previewLine:{color:"#000",size:2},anchorPoint:{color:"#FF8000",size:12,strokeSize:20},lineLabel:{color:"#FF8000",size:22,rotation:-.5},angleLabel:{size:22,color:"#088c00",rotation:-.5},colorSideLabel:{size:20,color:"#439227"}},kp={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Cp(t,e){return i.openBlock(),i.createElementBlock("svg",kp,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"currentColor",d:"m289.94 256l95-95A24 24 0 0 0 351 127l-95 95l-95-95a24 24 0 0 0-34 34l95 95l-95 95a24 24 0 1 0 34 34l95-95l95 95a24 24 0 0 0 34-34Z"},null,-1)])])}const ss=i.markRaw({name:"ion-close",render:Cp}),Sp={class:"mr-3 flex flex-col gap-2"},Bp=["onClick"],Tp={class:"h-full p-2"},Rp={},$p=i.defineComponent({...Rp,__name:"kozyrek-configurator-templates",props:{settings:{},selectTemplateIndex:{}},emits:["template:select","init-draw-template","remove-custom-template"],setup(t,{emit:e}){const n=t,r=i.useTemplateRef("drawing-template-containers"),s=e;return i.onMounted(()=>{var o;(o=n.settings.allTemplates)==null||o.forEach((a,l)=>{var d;const c=(d=r.value)==null?void 0:d.at(l);c&&s("init-draw-template",c,a)})}),i.watch(()=>n.settings.allTemplates,(o,a)=>{i.nextTick(()=>{o.forEach((l,c)=>{var d;if(!a.includes(l)){const h=(d=r.value)==null?void 0:d.at(c);h&&s("init-draw-template",h,l)}})})},{deep:!0}),(o,a)=>{const l=ss;return i.openBlock(),i.createBlock(i.unref(z.NScrollbar),{style:{"max-height":"12.5rem",width:"auto"},trigger:"none"},{default:i.withCtx(()=>[i.createElementVNode("div",Sp,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(t.settings.allTemplates,(c,d)=>(i.openBlock(),i.createElementBlock("div",{key:d,class:"group relative"},[i.createVNode(i.unref(z.NPopover),{trigger:"hover",placement:"right"},{trigger:i.withCtx(()=>[i.createElementVNode("div",{class:i.normalizeClass(["relative h-10 w-24 shrink-0 rounded-md border-2 border-solid border-slate-200",{"!border-green-700":d===t.selectTemplateIndex}]),onClick:h=>s("template:select",d)},[i.createElementVNode("div",Tp,[i.createElementVNode("div",{ref_for:!0,ref:"drawing-template-containers",class:"kozyrek-preview h-full"},null,512)])],10,Bp)]),default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(c.label),1)]),_:2},1024),c.isCustom&&!c.isNewRec()?(i.openBlock(),i.createBlock(i.unref(z.NButton),{key:0,size:"tiny",quaternary:"",circle:"",class:"!absolute right-0.5 top-0.5 !hidden group-hover:!flex",onClick:h=>s("remove-custom-template",d)},{default:i.withCtx(()=>[i.createVNode(l)]),_:1},8,["onClick"])):i.createCommentVNode("",!0)]))),128))])]),_:1})}}}),ad=Zn($p,[["__scopeId","data-v-cf2c29de"]]),Ep={class:"flex gap-3"},Np={class:"kozyrek-preview w-fill h-[12.5rem] grow touch-none overflow-hidden rounded-lg bg-gray-200 p-2"},Pp={ref:"drawing-container",class:"size-full"},Fp={},ld=i.defineComponent({...Fp,__name:"kozyrek-configurator-preview",props:{settings:{},value:{},selectTemplateIndex:{}},emits:["pointer:move","pointer:up","template:select"],setup(t,{emit:e}){const n=t,r=e,s=i.useTemplateRef("drawing-container");let o=[],a=[],l=[],c=null;const d=.75,h=i.computed(()=>n.value.configuratorParams.linesAngles.map((E,N)=>new ri(n.value.configuratorParams.linesWidths[N],E,`A-${N+1}`))),u=i.computed(()=>n.value.configuratorParams.colorSide==="bottom"),m=i.computed(()=>{var E,N;return n.value.configuratorParams.startTailType&&((E=n.settings.startTailConfigs)!=null&&E[n.value.configuratorParams.startTailType])?(N=n.settings.startTailConfigs)==null?void 0:N[n.value.configuratorParams.startTailType].points:[]}),g=i.computed(()=>{var E,N;return n.value.configuratorParams.endTailType&&((E=n.settings.endTailConfigs)!=null&&E[n.value.configuratorParams.endTailType])?(N=n.settings.endTailConfigs)==null?void 0:N[n.value.configuratorParams.endTailType].points:[]}),f=(E,N=!1)=>{E[0].start.x=0,E[0].start.y=0;let H=0;for(let q=0;q<E.length;q++){const Y=E[q],F=E[q-1]??new ri(0,H);H+=!N||q>1?F.angle:0;const M=(!N||q>0?Y.angle:0)+H;if(E[q].end.x=Y.width*Math.cos(M*Math.PI/180)+E[q].start.x,E[q].end.y=Y.width*Math.sin(M*Math.PI/180)+E[q].start.y,q<E.length-1){const Z=q+1;E[Z].start.x=E[q].end.x,E[Z].start.y=E[q].end.y}}return E},p=(E,N,H,q,Y=!1)=>{let F=f([...H,...q]);N.length>0&&(F=[...f(N),...F]);let M=0,Z=0,fe=0,ie=0;F.forEach(Ae=>{M=Math.min(M,Ae.start.x,Ae.end.x),Z=Math.min(Z,Ae.start.y,Ae.end.y),fe=Math.max(fe,Ae.start.x,Ae.end.x),ie=Math.max(ie,Ae.start.y,Ae.end.y)});let me,re;M===0&&Z===0&&fe===0&&ie===0?(me=1,re=1):(me=E.width/Math.abs(fe-M),re=(Y?E.height:E.height-Ve.colorSideLabel.size)/Math.abs(ie-Z));const Me=Math.min(me,re);return M=M<0?-M*Me:0,Z=Z<0?-Z*Me:0,[Me,M,Z]},y=E=>{const N=new ts([E]);return N._size=Ve.anchorPoint.size,N.fill=Ve.anchorPoint.color,N.stroke="transparent",N._linewidth=Ve.anchorPoint.strokeSize,l.push(N),N},b=(E,N)=>{if(l=[],n.settings.allowChangeFirstPoint){const H=E[0],q=new ge(H.vertices[0].x,H.vertices[0].y);q.bind(U.Types.change,()=>{H.vertices[0].copy(q)});const Y=y(q);N.add(Y)}E.forEach((H,q)=>{const Y=E[q+1],F=new ge(H.vertices[1].x,H.vertices[1].y);F.bind(U.Types.change,()=>{H.vertices[1].copy(F),Y!==void 0&&Y.vertices[0].copy(F)});const M=y(F);N.add(M)})},_=E=>E*(Math.PI/180),C=(E,N,H)=>{const q=N.vertices.length-1;E.position.x=N.vertices[q].x,E.position.y=N.vertices[q].y;const Y=Math.atan2(N.vertices[q].y-N.vertices[0].y,N.vertices[q].x-N.vertices[0].x);E.rotation=_(H)+Y},S=(E,N,H)=>{if(N.vertices[0]===void 0)return;E.position.x=N.vertices[0].x,E.position.y=N.vertices[0].y;const q=N.vertices.length-1,Y=Math.atan2(N.vertices[q].y-N.vertices[0].y,N.vertices[q].x-N.vertices[0].x);E.rotation=_(H)+Y},v=(E,N,H)=>{const q=new xn;if(E.length===0)return q;const Y=[];return[...E].reverse().forEach((F,M)=>{M!==0&&F.angle>0&&(F.angle*=-1),Y.push(F)}),E=f(Y,!0),S(q,N,E[0].angle),[N.vertices[0],N.vertices[1]].forEach(F=>{F.bind(U.Types.change,()=>{S(q,N,E[0].angle)})}),E.forEach(F=>{const M=F.start.x*H,Z=F.end.x*H,fe=F.start.y*H,ie=F.end.y*H,me=new rs(M,fe,Z,ie);me.linewidth=Ve.line.size,me.stroke=Ve.line.color,q.add(me)}),q},B=(E,N,H)=>{const q=new xn;return E.length===0||(E=f(E,!0),C(q,N,E[0].angle),[N.vertices[0],N.vertices[1]].forEach(Y=>{Y.bind(U.Types.change,()=>{C(q,N,E[0].angle)})}),E.forEach(Y=>{const F=Y.start.x*H,M=Y.end.x*H,Z=Y.start.y*H,fe=Y.end.y*H,ie=new rs(F,Z,M,fe);ie.linewidth=Ve.line.size,ie.stroke=Ve.line.color,q.add(ie)})),q},k=(E,N,H,q)=>{const Y=N.vertices[0].x+(N.vertices[1].x-N.vertices[0].x)/2-8*Math.sin(E.angle*Math.PI/180),F=N.vertices[0].y+(N.vertices[1].y-N.vertices[0].y)/2-8*Math.cos(E.angle*Math.PI/180),M=new zi(E.label,Y+10,F-10);let Z;M.size=Ve.lineLabel.size,M.weight=600,M.fill=Ve.lineLabel.color,M.id+=1,M.rotation=Ve.lineLabel.rotation,q>0&&(Z=new zi(`${E.angle}°`,N.vertices[0].x+25,N.vertices[0].y-25),Z.size=Ve.angleLabel.size,Z.weight=600,Z.fill=Ve.angleLabel.color,Z.rotation=Ve.angleLabel.rotation,Z.id+=q,o.push(Z),H.add(Z)),H.add(M),$(M,N,0,Z),$(M,N,1)},R=()=>{const{size:E}=Ve.colorSideLabel,N=0,H=0,q=u.value?E/2:E/2-E,Y=u.value?E/2-E:E/2,F=new xn;if(!c)return F;const M=5,Z=Math.atan2(Y-q,H-N),fe=[new Re(N,q,0,0,0,0,an.Commands.move),new Re(H,Y,0,0,0,0,an.Commands.line),new Re(H-M*Math.cos(Z-Math.PI/4),Y-M*Math.sin(Z-Math.PI/4),0,0,0,0,an.Commands.line),new Re(H,Y,0,0,0,0,an.Commands.move),new Re(H-M*Math.cos(Z+Math.PI/4),Y-M*Math.sin(Z+Math.PI/4),0,0,0,0,an.Commands.line)],ie=new Ee(fe,!1,!1,!0);ie.noFill(),ie.cap="round",ie.join="round",ie.linewidth=E/7,ie.stroke=Ve.colorSideLabel.color,F.add(ie);const me=new zi(u.value?"Цвет снизу":"Цвет сверху",10,0);me.size=E,me.weight=600,me.fill=Ve.colorSideLabel.color,me.alignment="left",F.add(me);const re=F.getBoundingClientRect();return F.position.x=(c.width-re.width)*d+10,F.position.y=u.value?c.height+re.height*2:re.height/2,F},$=(E,N,H,q)=>{N.vertices[H].bind(U.Types.change,()=>{const Y=N.vertices.length-1,F=Math.atan2(N.vertices[0].y-N.vertices[Y].y,N.vertices[0].x-N.vertices[Y].x)*180/Math.PI,M=N.vertices[0].x+(N.vertices[Y].x-N.vertices[0].x)/2-8*Math.sin(F*Math.PI/180),Z=N.vertices[0].y+(N.vertices[Y].y-N.vertices[0].y)/2-8*Math.cos(F*Math.PI/180);E.position.x=M+10,E.position.y=Z-10,E.rotation=-.5,q&&(q.position.x=N.vertices[0].x+25,q.position.y=N.vertices[0].y-25)})},P=(E,N,H,q,Y=!1)=>{var Oe;if(E.clear(),H.length===0){E.update();return}const F=f(H),[M,Z,fe]=p(E,N,F,q,Y),ie=new xn,me=new Array,re=new Array;Y||(o=[],a=[]),F.forEach((Le,pt)=>{const Zt=Le.start.x*M+Z,Qt=Le.end.x*M+Z,St=Le.start.y*M+fe,At=Le.end.y*M+fe,yt=new rs(Zt,St,Qt,At);yt.linewidth=Y?Ve.previewLine.size:Ve.line.size,yt.stroke=Y?Ve.previewLine.color:Ve.line.color,a.push(yt),me.push(yt),ie.add(yt),!Y&&Le.label!==""&&k(Le,yt,ie,pt)});const Me=me.at(-1);let Ae=ie.getBoundingClientRect();if(!Y){const Le=R();re.push(Le)}if(N.length>0){const Le=v(N,me[0],M);ie.add(Le)}if(q.length>0&&Me){const Le=B(q,Me,M);ie.add(Le)}if(re.push(ie),E.makeGroup(re),Ae=ie.getBoundingClientRect(),ie.position.x=0-Ae.left+(E.width-Ae.width)/(2*(Y?1:d)),ie.position.y=0-Ae.top+(E.height-Ae.height)/(2*(Y?1:d)),E.update(),!Y){const Le=((Oe=n.value.configuratorParams)==null?void 0:Oe.colorSide)==="top";ie.position.y=ie.position.y+Ve.colorSideLabel.size*Number(Le),b(me,ie),E.update()}},I=(E,N)=>{if(E&&!N.isNewRec()){const H=new an({width:E.scrollWidth,height:E.scrollHeight});H.appendTo(E),P(H,[],N.points,[],!0)}},V=()=>{c&&P(c,m.value,h.value,g.value,!1)},A=E=>E*(180/Math.PI),L=(E,N)=>{const H=E[1].x-E[0].x,q=E[1].y-E[0].y,Y=N[1].x-N[0].x,F=N[1].y-N[0].y;let M=Math.atan2(H*F-q*Y,H*Y+q*F);return M=A(M),Math.round(M)*-1},D=E=>{const N=a.map((H,q,Y)=>{const F=Y[q-1]??{vertices:[{x:-10,y:0},{x:0,y:0}]};let M=Math.ceil(H._length/E/n.settings.lineWidthStep)*n.settings.lineWidthStep;const Z=o[q-1];M<(Y.length>1?n.settings.minLineWidth:n.settings.stripMinWidth)&&(M=Y.length>1?n.settings.minLineWidth:n.settings.stripMinWidth),M>n.settings.maxLineWidth&&(M=n.settings.maxLineWidth);const fe=L(H.vertices,F.vertices);return Z&&(Z.value=`${fe}°`),new ri(M,fe,`A-${q+1}`)});r("pointer:move",N)},ee=E=>{let N=null,H;const q=Z=>{N=l.find(fe=>{const ie=fe.renderer;return(ie==null?void 0:ie.elem)===Z.target}),[H]=p(E,m.value,h.value.map(fe=>fe),g.value)},Y=Z=>{if(N){const fe=N.renderer,ie=fe==null?void 0:fe.elem;if(!ie)return;const me=ie.getBoundingClientRect();N.vertices[0].x-=me.x-(Z instanceof MouseEvent?Z.clientX:Z.targetTouches[0].clientX)+Ve.anchorPoint.size/2,N.vertices[0].y-=me.y-(Z instanceof MouseEvent?Z.clientY:Z.targetTouches[0].clientY)+Ve.anchorPoint.size/2,D(H),E.update()}},F=()=>{N&&r("pointer:up",h.value),N=null},M=s.value;M&&(M.addEventListener("touchstart",q),M.addEventListener("touchend",F),M.addEventListener("mousedown",q),M.addEventListener("mouseup",F),M.addEventListener("mousemove",Y),M.addEventListener("touchmove",Y))};return i.onMounted(()=>{s.value&&(c=new an({width:s.value.scrollWidth,height:s.value.scrollHeight,fullscreen:!1}).appendTo(s.value),c.scene.scale=d,c.update(),i.watch(()=>n.value,()=>{V()},{deep:!0,immediate:!0}),ee(c))}),i.onBeforeUnmount(()=>{c&&(c.clear(),c=null)}),(E,N)=>(i.openBlock(),i.createElementBlock("div",Ep,[i.createVNode(ad,{"select-template-index":t.selectTemplateIndex,settings:t.settings,"onTemplate:select":N[0]||(N[0]=H=>r("template:select",H)),onInitDrawTemplate:I},null,8,["select-template-index","settings"]),i.createElementVNode("div",Np,[i.createElementVNode("div",Pp,null,512)])]))}}),Mp={class:"flex max-w-[50rem] flex-col gap-3"},Ap={},cd=i.defineComponent({...Ap,__name:"kozyrek-configurator",props:{settings:{},cartItem:{}},emits:["submit","click:view-switch"],setup(t,{emit:e}){const n=t,r=e,s=i.ref(!1),o=i.ref(!1),a=i.ref(!1),l=i.ref(n.cartItem),c=i.ref(n.settings),d=i.ref({linesWidths:[...n.cartItem.configuratorParams.linesWidths],linesAngles:[...n.cartItem.configuratorParams.linesAngles]}),h=i.ref({quantity:{},marker:{},length:{}}),u=i.ref(0),m=(k=0)=>{var $;const R=($=c.value.allTemplates)==null?void 0:$.at(k);R!==void 0&&(u.value=k,l.value.configuratorParams.linesWidths=R.points.map(P=>O.isArray(P)?P[0]:P.width),l.value.configuratorParams.linesAngles=R.points.map(P=>O.isArray(P)?P[1]:P.angle),b()),p(l.value.configuratorParams)},g=async()=>{const k=prompt("Введите название шаблона:");if(!k)return;a.value=!0;const R={label:k,points:l.value.configuratorParams.linesWidths.map(($,P)=>[$,l.value.configuratorParams.linesAngles[P]])};await G.HttpRequester.getInstance(G.ConfiguratorProvider).createTemplate(n.cartItem.category,R,h.value).then(()=>{c.value.addCustomTemplate(R),u.value=c.value.allTemplates.length-1}).catch(()=>{a.value=!1}),a.value=!1},f=()=>{c.value.showOnlyTemplates||c.value.allowSaveTemplates&&(u.value=c.value.allTemplates.length-1)},p=async k=>{b(),s.value=!0,await G.HttpRequester.getInstance(G.ConfiguratorProvider).searchProduct(n.cartItem.category,k,h.value).then(R=>{l.value.product=R}).catch(()=>{s.value=!1}),s.value=!1},y=()=>{o.value=!0,r("submit",l.value,h.value,()=>{o.value=!1})},b=()=>{const k={quantity:h.value.quantity,marker:h.value.marker};l.value.configuratorParams.linesWidths.forEach((R,$)=>{k[`lines_widths[${$+1}]`]={},k[`lines_angles[${$+1}]`]={}}),h.value=k},_=k=>{d.value.linesWidths=k.map(R=>R.width),d.value.linesAngles=k.map(R=>R.angle)},C=k=>{l.value.configuratorParams.linesWidths=d.value.linesWidths,l.value.configuratorParams.linesAngles=d.value.linesAngles,b(),f(),p(l.value.configuratorParams)},S=(k,R)=>{d.value.linesWidths=k,d.value.linesAngles=R},v=k=>{const R=l.value.configuratorParams.linesWidths.length>1?c.value.minLineWidth:c.value.stripMinWidth,$=0;l.value.configuratorParams.linesWidths.splice(k+1,0,R),l.value.configuratorParams.linesAngles.splice(k+1,0,$),d.value.linesWidths=[...l.value.configuratorParams.linesWidths],d.value.linesAngles=[...l.value.configuratorParams.linesAngles],b(),f(),p(l.value.configuratorParams)},B=k=>{l.value.configuratorParams.linesWidths.length<=1||(l.value.configuratorParams.linesWidths.splice(k,1),l.value.configuratorParams.linesAngles.splice(k,1),d.value.linesWidths=[...l.value.configuratorParams.linesWidths],d.value.linesAngles=[...l.value.configuratorParams.linesAngles],b(),f(),p(l.value.configuratorParams))};return i.onBeforeMount(()=>{m()}),(k,R)=>{const $=z.NButton;return i.openBlock(),i.createElementBlock("div",Mp,[t.settings.allowShowTable?(i.openBlock(),i.createBlock($,{key:0,type:"tertiary",class:"self-end",onClick:R[0]||(R[0]=P=>r("click:view-switch"))},{default:i.withCtx(()=>[...R[3]||(R[3]=[i.createTextVNode(" Показать в виде списка ",-1)])]),_:1})):i.createCommentVNode("",!0),i.createVNode(ld,{value:l.value,"select-template-index":u.value,settings:c.value,"onPointer:up":C,"onPointer:move":_,"onTemplate:select":m},null,8,["value","select-template-index","settings"]),i.createVNode(Ua,{value:l.value,"onUpdate:value":R[1]||(R[1]=P=>l.value=P),"preview-params":d.value,validation:h.value,settings:c.value,"is-submit-processing":o.value,"is-product-searching":s.value,"select-template-index":u.value,"onUpdate:params":R[2]||(R[2]=P=>p(P)),"onUpdate:preview":S,onSubmit:y,"onClick:saveTemplate":g,"onClick:addLine":v,"onClick:removeLine":B},null,8,["value","preview-params","validation","settings","is-submit-processing","is-product-searching","select-template-index"])])}}}),Vp={},Li=i.defineComponent({...Vp,__name:"debounced-input-number",props:{value:{default:void 0},clearable:{type:Boolean,default:!1},debounceTime:{default:500},placeholder:{default:""},min:{default:void 0},max:{default:void 0},step:{default:1},validator:{type:Function,default:void 0}},emits:["update:value"],setup(t,{expose:e,emit:n}){const r=t,s=n,o=i.ref(r.value),a=i.computed(()=>i.inject("debounce-input-time",r.debounceTime)),l=O.debounce(()=>s("update:value",o.value),a.value),c=g=>{o.value=g,l()};i.watch(()=>r.value,g=>{o.value=g});const d=i.ref(null);return e({focus:()=>{var g;return(g=d.value)==null?void 0:g.focus()},blur:()=>{var g;return(g=d.value)==null?void 0:g.blur()},select:()=>{var g;return(g=d.value)==null?void 0:g.select()}}),(g,f)=>(i.openBlock(),i.createBlock(i.unref(z.NInputNumber),{ref_key:"inputReference",ref:d,value:o.value,"onUpdate:value":[f[0]||(f[0]=p=>o.value=p),c],clearable:t.clearable,placeholder:t.placeholder,min:t.min,max:t.max,step:t.step,validator:t.validator},{prefix:i.withCtx(()=>[i.renderSlot(g.$slots,"prefix")]),_:3},8,["value","clearable","placeholder","min","max","step","validator"]))}}),Op={key:0,class:"flex items-baseline gap-1"},Ip={key:0,class:"flex items-baseline gap-1"},zp={key:0},Lp={class:"text-lg font-semibold"},Dp={key:1,class:"text-red-500 text-sm mb-2"},Hp={class:"flex gap-3"},Wp={},dd=i.defineComponent({...Wp,__name:"mosquito-configurator-form",props:{value:{},settings:{},isProductSearching:{type:Boolean,default:!1},isSubmitProcessing:{type:Boolean,default:!1},validation:{default:void 0}},emits:["update:value","update:params","submit","click:instructions-toggle","click:show-preview-drawer"],setup(t,{emit:e}){const n=t,r=e,s=i.computed(()=>bt.isPhoneDevice()),o=i.ref(O.cloneDeep(i.toRaw(n.value.configuratorParams))),a=i.computed(()=>n.settings.widthOverlaps[o.value.mountType]??0),l=i.computed(()=>n.settings.heightOverlaps[o.value.mountType]??0),c=i.computed(()=>n.settings.maxWidths[o.value.netType]),d=i.computed(()=>n.settings.maxHeights[o.value.netType]),h=i.computed(()=>{var S;const{width:p,height:y}=o.value,{quantity:b}=n.value,_=((S=n.value.product)==null?void 0:S.costRub)||0;if(!p||!y||!b||_===0)return null;const C=p*y/1e6;return(_*b*C).toLocaleString("ru-ru",{minimumFractionDigits:2})}),u=i.computed(()=>{const p=!!(o.value.width&&o.value.width>=n.settings.minWidth&&o.value.width<=n.settings.maxWidths[o.value.netType]),y=!!(o.value.height&&o.value.height>=n.settings.minHeight&&o.value.height<=n.settings.maxHeights[o.value.netType]),b=!!(n.value.quantity&&n.value.quantity>0);return p&&y&&b}),m=p=>{o.value.mountType=p,u.value&&(r("update:params",o.value),f("configuratorParams",o.value))},g=(p,y)=>{p&&p in o.value&&(o.value[p]=y??0),u.value&&(r("update:params",o.value),f("configuratorParams",o.value))},f=(p,y)=>{const b=new G.CartItemBase(n.value);b[p]=y,r("update:value",b)};return(p,y)=>{const b=z.NInput;return i.openBlock(),i.createBlock(i.unref(z.NForm),{class:"flex flex-col gap-2 px-4 md:max-w-96"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NFormItem),{required:!0,"show-feedback":!1,label:"Тип сетки"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NSelect),{value:o.value.netType,"onUpdate:value":[y[0]||(y[0]=_=>o.value.netType=_),g],options:t.settings.netType.map(_=>({label:t.settings.descriptions.net_type[_],value:_}))},null,8,["value","options"])]),_:1}),i.createVNode(i.unref(z.NFormItem),{required:!0,"show-feedback":!1,label:"Цвет профиля"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NSelect),{value:o.value.color,"onUpdate:value":y[1]||(y[1]=_=>o.value.color=_),options:t.settings.color.map(_=>({label:t.settings.descriptions.color[_],value:_}))},null,8,["value","options"])]),_:1}),i.createVNode(i.unref(z.NFormItem),{required:!0,"show-feedback":!1,label:"Вид крепления"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NSelect),{value:o.value.mountType,"onUpdate:value":[y[2]||(y[2]=_=>o.value.mountType=_),m],options:t.settings.mountType.map(_=>({label:t.settings.descriptions.mount_type[_],value:_}))},null,8,["value","options"])]),_:1}),i.createVNode(i.unref(z.NFormItem),{required:!0,feedback:t.validation.width.feedback||"","show-feedback":t.validation.width.showFeedback||o.value.width>=t.settings.minWidth&&o.value.width<=t.settings.maxWidths[o.value.netType],"validation-status":t.validation.width.validationStatus||void 0,label:`Ширина светового проёма от ${t.settings.minWidth-a.value} ${c.value?" до "+(c.value-a.value):""} мм.`},{feedback:i.withCtx(()=>[!t.validation.width.showFeedback&&o.value.width>=t.settings.minWidth&&o.value.width<=t.settings.maxWidths[o.value.netType]?(i.openBlock(),i.createElementBlock("div",Op,[i.createVNode(i.unref(z.NText),{type:"success"},{default:i.withCtx(()=>[i.createTextVNode("Ширина готового изделия "+i.toDisplayString(o.value.width),1)]),_:1}),i.createVNode(i.unref(z.NButton),{quaternary:"",type:"info",size:"tiny",onClick:y[4]||(y[4]=_=>r("click:instructions-toggle"))},{default:i.withCtx(()=>[...y[11]||(y[11]=[i.createElementVNode("span",{class:"text-sm"},"Руководство",-1)])]),_:1})])):i.createCommentVNode("",!0)]),default:i.withCtx(()=>[i.createVNode(Li,{value:o.value.width&&o.value.width-a.value||void 0,max:c.value-a.value,min:t.settings.minWidth-a.value,placeholder:"Введите ширину светового проёма",class:"w-full","onUpdate:value":y[3]||(y[3]=_=>g("width",(_&&_+a.value)??void 0))},null,8,["value","max","min"])]),_:1},8,["feedback","show-feedback","validation-status","label"]),i.createVNode(i.unref(z.NFormItem),{required:!0,feedback:t.validation.height.feedback||"","show-feedback":t.validation.height.showFeedback||o.value.height>=t.settings.minHeight&&o.value.height<=t.settings.maxHeights[o.value.netType],"validation-status":t.validation.height.validationStatus||void 0,label:`Высота светового проёма от ${t.settings.minHeight-l.value} ${d.value?" до "+(d.value-l.value):""} мм.`},{feedback:i.withCtx(()=>[!t.validation.height.showFeedback&&o.value.height>=t.settings.minHeight&&o.value.height<=t.settings.maxHeights[o.value.netType]?(i.openBlock(),i.createElementBlock("div",Ip,[i.createVNode(i.unref(z.NText),{type:"success"},{default:i.withCtx(()=>[i.createTextVNode("Высота готового изделия "+i.toDisplayString(o.value.height),1)]),_:1}),i.createVNode(i.unref(z.NButton),{quaternary:"",type:"info",size:"tiny",onClick:y[6]||(y[6]=_=>r("click:instructions-toggle"))},{default:i.withCtx(()=>[...y[12]||(y[12]=[i.createElementVNode("span",{class:"text-sm"},"Руководство",-1)])]),_:1})])):i.createCommentVNode("",!0)]),default:i.withCtx(()=>[i.createVNode(Li,{value:o.value.height&&o.value.height-l.value||void 0,max:d.value-l.value,min:t.settings.minHeight-l.value,placeholder:"Введите высоту светового проёма",class:"w-full","onUpdate:value":y[5]||(y[5]=_=>g("height",(_&&_+l.value)??void 0))},null,8,["value","max","min"])]),_:1},8,["feedback","show-feedback","validation-status","label"]),i.createVNode(i.unref(z.NFormItem),{required:!0,feedback:t.validation.quantity.feedback||"","show-feedback":t.validation.quantity.showFeedback||!1,"validation-status":t.validation.quantity.validationStatus||void 0,label:"Количество"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInputNumber),{value:t.value.quantity,"onUpdate:value":y[7]||(y[7]=_=>t.value.quantity=_),min:1,validator:_=>Number.isInteger(_),placeholder:"Введите количество",class:"w-full"},null,8,["value","validator"])]),_:1},8,["feedback","show-feedback","validation-status"]),i.createVNode(i.unref(z.NFormItem),{feedback:t.validation.marker.feedback||"","show-feedback":t.validation.marker.showFeedback||!1,"validation-status":t.validation.marker.validationStatus||void 0,label:"Маркировка"},{default:i.withCtx(()=>[i.createVNode(b,{value:t.value.marker,"onUpdate:value":y[8]||(y[8]=_=>t.value.marker=_),placeholder:"Введите маркировку"},null,8,["value"])]),_:1},8,["feedback","show-feedback","validation-status"]),i.createVNode(nr,{"is-product-searching":t.isProductSearching,product:t.value.product},null,8,["is-product-searching","product"]),h.value?(i.openBlock(),i.createElementBlock("div",zp,[y[13]||(y[13]=i.createTextVNode(" ИТОГО: ",-1)),i.createElementVNode("span",Lp,i.toDisplayString(h.value)+" ₽",1)])):i.createCommentVNode("",!0),u.value?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("div",Dp," Пожалуйста, заполните все обязательные поля корректно. ")),i.createElementVNode("div",Hp,[i.createVNode(i.unref(z.NButton),{loading:t.isSubmitProcessing,disabled:!u.value,type:"primary",class:"self-start",onClick:y[9]||(y[9]=_=>r("submit",t.value))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(t.value.isNewRec()?"В корзину":"Изменить"),1)]),_:1},8,["loading","disabled"]),s.value?(i.openBlock(),i.createBlock(i.unref(z.NButton),{key:0,type:"default",onClick:y[10]||(y[10]=_=>r("click:show-preview-drawer"))},{default:i.withCtx(()=>[...y[14]||(y[14]=[i.createTextVNode(" Предварительный просмотр ",-1)])]),_:1})):i.createCommentVNode("",!0)])]),_:1})}}}),jp="/img/configurators/mosquitto/measurement-instructions/measurement-height.png",qp="/img/configurators/mosquitto/measurement-instructions/measurement-width.png",Xp="/img/configurators/mosquitto/measurement-instructions/mount.png",Yp="/img/configurators/mosquitto/measurement-instructions/mount-z-plastic.png",Up="/img/configurators/mosquitto/measurement-instructions/mount-z-metal.png",Gp={class:"flex flex-col gap-6"},Kp={class:"flex gap-4"},Zp={class:"flex flex-col gap-2"},Qp={class:"flex gap-4"},Jp={class:"flex flex-col gap-2"},e0={class:"flex gap-4"},t0={class:"flex flex-col gap-2"},n0={},hd=i.defineComponent({...n0,__name:"mosquito-configurator-measurement-instructions",props:{heightOverlaps:{},widthOverlaps:{},show:{type:Boolean}},emits:["update:show"],setup(t,{emit:e}){const n=bt.initRefDependingOnDeviceResolution("small","small","medium"),r=bt.initRefDependingOnDeviceResolution(.98,.95,.8),s=i.computed(()=>window.innerWidth*r.value),o=e;return(a,l)=>{const c=z.NText;return i.openBlock(),i.createBlock(i.unref(z.NModal),{show:t.show,"show-icon":!1,size:i.unref(n),style:i.normalizeStyle(`width: ${s.value}px`),title:"Руководство по замеру","action-class":"grid grid-cols-2 !justify-between",preset:"dialog",onClose:l[0]||(l[0]=d=>o("update:show",!1)),onEsc:l[1]||(l[1]=d=>o("update:show",!1)),onMaskClick:l[2]||(l[2]=d=>o("update:show",!1))},{default:i.withCtx(()=>[i.createElementVNode("div",Gp,[i.createVNode(c,{type:"error",class:"text-base font-medium"},{default:i.withCtx(()=>[...l[3]||(l[3]=[i.createTextVNode(" Важно! Для того,что бы произвести замер, необходимо открыть оконную створку. ",-1)])]),_:1}),l[22]||(l[22]=i.createElementVNode("div",{class:"grid gap-6 md:grid-cols-2"},[i.createElementVNode("div",{class:"flex items-start gap-4"},[i.createElementVNode("img",{src:jp,alt:"measurement-height",class:"w-[7.5rem]"}),i.createElementVNode("div",{class:"flex flex-col gap-2"},[i.createElementVNode("span",{class:"text-lg font-bold"},"Замер ширины"),i.createElementVNode("span",null,"Замерить по ширине световой проем оконной рамы. Размер учитывать c точностью до 1 мм")])]),i.createElementVNode("div",{class:"flex items-start gap-4"},[i.createElementVNode("img",{src:qp,alt:"measurement-height",class:"w-[7.5rem]"}),i.createElementVNode("div",{class:"flex flex-col gap-2"},[i.createElementVNode("span",{class:"text-lg font-bold"},"Замер высоты"),i.createElementVNode("span",null,"Замерить по высоте световой проем оконной рамы. Размер учитывать с точностью до 1 мм")])])],-1)),i.createElementVNode("div",Kp,[l[9]||(l[9]=i.createElementVNode("img",{src:Xp,alt:"measurement-height",class:"w-[7.5rem]"},null,-1)),i.createElementVNode("div",Zp,[l[8]||(l[8]=i.createElementVNode("span",{class:"text-lg font-bold"},"Крепление на раме сетки",-1)),i.createElementVNode("span",null,[l[4]||(l[4]=i.createTextVNode(" Расчетные размеры москитной сетки: ",-1)),l[5]||(l[5]=i.createElementVNode("br",null,null,-1)),i.createTextVNode(" Ширина светового проема +"+i.toDisplayString(t.widthOverlaps.frame)+" мм. Высота светового проема +"+i.toDisplayString(t.heightOverlaps.frame)+" мм. ",1),l[6]||(l[6]=i.createElementVNode("br",null,null,-1)),l[7]||(l[7]=i.createTextVNode(" Крепления находятся на раме сетки. ",-1))])])]),i.createElementVNode("div",Qp,[l[15]||(l[15]=i.createElementVNode("img",{src:Yp,alt:"measurement-height",class:"w-[7.5rem]"},null,-1)),i.createElementVNode("div",Jp,[l[14]||(l[14]=i.createElementVNode("span",{class:"text-lg font-bold"},"Z-Образное крепление пластик (верх+низ)",-1)),i.createElementVNode("span",null,[l[10]||(l[10]=i.createTextVNode(" Расчетные размеры москитной сетки:",-1)),l[11]||(l[11]=i.createElementVNode("br",null,null,-1)),i.createTextVNode(" Ширина светового проема +"+i.toDisplayString(t.widthOverlaps.external_plastic)+" мм. Высота светового проема +"+i.toDisplayString(t.heightOverlaps.external_plastic)+" мм. ",1),l[12]||(l[12]=i.createElementVNode("br",null,null,-1)),l[13]||(l[13]=i.createTextVNode(" Крепления прикручиваются к раме окна c помощью шурупов. ",-1))])])]),i.createElementVNode("div",e0,[l[21]||(l[21]=i.createElementVNode("img",{src:Up,alt:"measurement-height",class:"w-[7.5rem]"},null,-1)),i.createElementVNode("div",t0,[l[20]||(l[20]=i.createElementVNode("span",{class:"text-lg font-bold"},"Z-Образное крепление металл (верх+низ)",-1)),i.createElementVNode("span",null,[l[16]||(l[16]=i.createTextVNode(" Расчетные размеры москитной сетки: ",-1)),l[17]||(l[17]=i.createElementVNode("br",null,null,-1)),i.createTextVNode(" Ширина светового проема +"+i.toDisplayString(t.widthOverlaps.external_metal)+" мм. Высота светового проема +"+i.toDisplayString(t.heightOverlaps.external_metal)+" мм. ",1),l[18]||(l[18]=i.createElementVNode("br",null,null,-1)),l[19]||(l[19]=i.createTextVNode(" Крепления прикручиваются к раме окна c помощью шурупов. ",-1))])])])])]),_:1},8,["show","size","style"])}}}),i0={class:"flex flex-col items-center justify-between rounded-xl"},r0={class:"img-preview relative flex justify-center"},s0={},o0=i.defineComponent({...s0,__name:"mosquito-configurator-preview",props:{configuratorParams:{},settings:{}},emits:["open-instructions"],setup(t,{emit:e}){const n=t,r=i.computed(()=>O.keys(n.settings.crossbarCount).find(o=>n.settings.crossbarCount[Number(o)]&&(!n.settings.crossbarCount[Number(o)+1]||n.configuratorParams.height<n.settings.crossbarCount[Number(o)+1]-n.settings.heightOverlaps[n.configuratorParams.mountType]))),s=e;return(o,a)=>{const l=z.NButton;return i.openBlock(),i.createElementBlock("div",i0,[i.createElementVNode("div",r0,[a[1]||(a[1]=i.createElementVNode("div",{class:"window"},null,-1)),i.createElementVNode("div",{class:i.normalizeClass(["net",`net-${t.configuratorParams.netType}`])},null,2),i.createElementVNode("div",{class:i.normalizeClass(["frame",`frame-${t.configuratorParams.color}`])},null,2),r.value?(i.openBlock(),i.createElementBlock("div",{key:0,class:i.normalizeClass(["frame-crossbar",`frame-crossbar-${r.value}-${t.configuratorParams.color}`])},null,2)):i.createCommentVNode("",!0),i.createElementVNode("div",{class:i.normalizeClass(["mount",`mount-${t.configuratorParams.mountType}-${t.configuratorParams.color}`])},null,2),i.createElementVNode("div",{class:i.normalizeClass(["cut-preview",`cut-preview-${t.configuratorParams.mountType}-${t.configuratorParams.color}`])},null,2)]),i.createVNode(l,{type:"primary",class:"block justify-self-center",onClick:a[0]||(a[0]=c=>s("open-instructions"))},{default:i.withCtx(()=>[...a[2]||(a[2]=[i.createTextVNode(" Руководство по замеру ",-1)])]),_:1})])}}}),Eo=Zn(o0,[["__scopeId","data-v-8b43aa68"]]),a0={class:"grid md:grid-cols-2"},l0={},ud=i.defineComponent({...l0,__name:"mosquito-configurator",props:{settings:{},cartItem:{}},emits:["submit"],setup(t,{emit:e}){const n=t,r=e,s=i.computed(()=>bt.isPhoneDevice()),o=i.ref(!1),a=i.ref(!1),l=i.ref(n.cartItem),c=i.ref({width:{},height:{},quantity:{},marker:{}}),d=i.ref(!1),h=i.ref(!1),u=async g=>{g.height>0&&g.width>0&&(d.value=!0,await G.HttpRequester.getInstance(G.ConfiguratorProvider).searchProduct(n.cartItem.category,g,c.value).then(f=>{l.value.product=f}).catch(()=>{d.value=!1}),d.value=!1)},m=()=>{h.value=!0,r("submit",l.value,c.value,()=>{h.value=!1})};return(g,f)=>{const p=ss;return i.openBlock(),i.createElementBlock(i.Fragment,null,[i.createVNode(hd,{show:a.value,"onUpdate:show":f[0]||(f[0]=y=>a.value=y),"height-overlaps":t.settings.heightOverlaps,"width-overlaps":t.settings.widthOverlaps},null,8,["show","height-overlaps","width-overlaps"]),i.createElementVNode("div",a0,[s.value?(i.openBlock(),i.createBlock(i.unref(z.NDrawer),{key:1,show:o.value,"onUpdate:show":f[4]||(f[4]=y=>o.value=y),"default-width":375,resizable:""},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NDrawerContent),null,{header:i.withCtx(()=>[i.createVNode(i.unref(z.NButton),{size:"small",type:"primary",class:"block justify-self-end",onClick:f[2]||(f[2]=y=>o.value=!1)},{default:i.withCtx(()=>[i.createVNode(p)]),_:1})]),default:i.withCtx(()=>[i.createVNode(Eo,{"configurator-params":l.value.configuratorParams,settings:t.settings,onOpenInstructions:f[3]||(f[3]=y=>a.value=!0)},null,8,["configurator-params","settings"])]),_:1})]),_:1},8,["show"])):(i.openBlock(),i.createBlock(Eo,{key:0,"configurator-params":l.value.configuratorParams,settings:t.settings,onOpenInstructions:f[1]||(f[1]=y=>a.value=!0)},null,8,["configurator-params","settings"])),i.createVNode(dd,{value:l.value,"onUpdate:value":f[5]||(f[5]=y=>l.value=y),validation:c.value,settings:t.settings,"is-product-searching":d.value,"is-submit-processing":h.value,"onUpdate:params":f[6]||(f[6]=y=>u(y)),onSubmit:f[7]||(f[7]=y=>m()),"onClick:instructionsToggle":f[8]||(f[8]=y=>a.value=!a.value),"onClick:showPreviewDrawer":f[9]||(f[9]=y=>o.value=!0)},null,8,["value","validation","settings","is-product-searching","is-submit-processing"])])],64)}}}),c0={key:0},d0={},fd=i.defineComponent({...d0,__name:"strip-configurator-line-item",props:{value:{},index:{},settings:{},product:{default:void 0},addLineButtonDisabled:{type:Boolean,default:!1},removeLineButtonDisabled:{type:Boolean,default:!1},suggestionOption:{default:void 0},autoFocus:{type:Boolean,default:!1},validation:{default:()=>({})}},emits:["update:value","click:add-line","click:remove-line"],setup(t,{expose:e,emit:n}){const r=t,s=n,o=i.useTemplateRef("width-input-element"),a=i.ref(!1),l=d=>{s("update:value",d??0,r.index,a)};i.onMounted(()=>{r.autoFocus&&i.nextTick(()=>{c()})});const c=()=>{var d;(d=o.value)==null||d.select()};return e({focusWidthInput:c}),(d,h)=>{var g;const u=Ya,m=Xa;return i.openBlock(),i.createBlock(i.unref(z.NFormItem),{label:`Полоса №${t.index+1}, мм`,required:!0,"validation-status":a.value||(g=t.validation)==null?void 0:g.validationStatus},{feedback:i.withCtx(()=>{var f,p;return[(f=t.validation)!=null&&f.showFeedback?(i.openBlock(),i.createElementBlock("span",c0,i.toDisplayString((p=t.validation)==null?void 0:p.feedback),1)):i.createCommentVNode("",!0),i.createVNode(nr,{"is-product-searching":a.value,product:t.product},null,8,["is-product-searching","product"])]}),default:i.withCtx(()=>[i.createVNode(i.unref(z.NDropdown),{trigger:"click",options:t.suggestionOption,placement:"bottom-start",size:"large",onSelect:l},{default:i.withCtx(()=>[i.createVNode(Li,{ref:"width-input-element",value:t.value,class:"w-full",min:t.settings.minLineWidth,step:t.settings.lineWidthStep,validator:f=>!!f&&f>=t.settings.minLineWidth&&f%t.settings.lineWidthStep===0,placeholder:"Введите ширину","onUpdate:value":l},null,8,["value","min","step","validator"])]),_:1},8,["options"]),i.createVNode(i.unref(z.NButton),{disabled:t.addLineButtonDisabled,size:"medium",class:"ml-2",onClick:h[0]||(h[0]=f=>s("click:add-line",t.index))},{default:i.withCtx(()=>[i.createVNode(u)]),_:1},8,["disabled"]),i.createVNode(i.unref(z.NButton),{disabled:t.removeLineButtonDisabled,size:"medium",class:"ml-2",onClick:h[1]||(h[1]=f=>s("click:remove-line",t.index))},{default:i.withCtx(()=>[i.createVNode(m)]),_:1},8,["disabled"])]),_:1},8,["label","validation-status"])}}}),h0={class:"my-2 flex w-full flex-col"},u0={key:0},f0={class:"text-lg font-semibold"},g0={class:"flex gap-3"},m0={},gd=i.defineComponent({...m0,__name:"strip-configurator-form",props:{value:{},settings:{},isSubmitProcessing:{type:Boolean,default:!1},validation:{default:void 0}},emits:["update:value","update:params","submit","click:add-line","click:remove-line"],setup(t,{emit:e}){const n=t,r=e,s=i.computed(()=>n.value[0].configuratorParams.linesWidths.reduce((u,m)=>(u??0)+(m??0),0)),o=i.computed(()=>n.settings.width-s.value),a=i.computed(()=>!n.value.some(({product:u})=>!u)),l=i.computed(()=>o.value===0?void 0:[{label:`${(o.value>0?"Остаток +":"Излишек ")+o.value} мм.`,key:o.value}]),c=i.computed(()=>{const{length:u}=n.value[0];return!u||s.value!==n.settings.width?null:(O.reduce(n.value,(g,f)=>{var y;const p=((y=f.product)==null?void 0:y.costRub)||0;return g+p},0)*n.value[0].quantity*u).toLocaleString("ru-ru",{minimumFractionDigits:2})}),d=(u,m,g)=>{const f=n.value.at(m);if(f)if(u&&u>=n.settings.minLineWidth&&u%n.settings.lineWidthStep===0){const p={linesWidths:f.configuratorParams.linesWidths.toSpliced(m,1,u)};r("update:params",p,m,g),h("configuratorParams",p)}else f.product.id=-1},h=(u,m)=>{const g=n.value.map(f=>new G.CartItemBase(f));g.forEach(f=>{f[u]=m}),r("update:value",g)};return(u,m)=>{const g=z.NInput;return i.openBlock(),i.createBlock(i.unref(z.NForm),{class:"flex flex-col gap-2"},{default:i.withCtx(()=>{var f;return[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(t.value,(p,y)=>(i.openBlock(),i.createBlock(fd,{key:y,"auto-focus":!0,index:y,value:p.configuratorParams.linesWidths.at(y)??null,product:p.product,settings:t.settings,validation:t.validation[`linesWidths.${y}`],"suggestion-option":l.value,"add-line-button-disabled":o.value<=0||t.value.length>=t.settings.maxLinesCount,"remove-line-button-disabled":t.value.length===1,"onUpdate:value":d,"onClick:addLine":m[0]||(m[0]=b=>r("click:add-line",b)),"onClick:removeLine":m[1]||(m[1]=b=>r("click:remove-line",b))},null,8,["index","value","product","settings","validation","suggestion-option","add-line-button-disabled","remove-line-button-disabled"]))),128)),i.createElementVNode("div",h0,[o.value<0?(i.openBlock(),i.createBlock(i.unref(z.NText),{key:0,type:"error"},{default:i.withCtx(()=>[i.createTextVNode(" Сумма ширин всех полос должна быть равна "+i.toDisplayString(t.settings.width),1)]),_:1})):i.createCommentVNode("",!0),a.value&&t.value.length===t.settings.maxLinesCount&&o.value>0?(i.openBlock(),i.createBlock(i.unref(z.NText),{key:1,type:"error"},{default:i.withCtx(()=>[...m[7]||(m[7]=[i.createTextVNode(" Остаток резки должен быть равен 0 ",-1)])]),_:1})):i.createCommentVNode("",!0),i.createElementVNode("div",null,[m[8]||(m[8]=i.createTextVNode(" Остаток для резки: ",-1)),i.createVNode(i.unref(z.NText),{type:o.value>=0?"Success":"error"},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(o.value),1)]),_:1},8,["type"]),i.createTextVNode(" из "+i.toDisplayString(t.settings.width)+" мм ",1)])]),i.createVNode(i.unref(z.NButton),{loading:t.isSubmitProcessing,disabled:!a.value||o.value<=0||t.value.length>=t.settings.maxLinesCount,type:"primary",class:"self-center",onClick:m[2]||(m[2]=p=>r("click:add-line",t.value.length))},{default:i.withCtx(()=>[...m[9]||(m[9]=[i.createTextVNode(" Добавить полосу ",-1)])]),_:1},8,["loading","disabled"]),i.createVNode(i.unref(z.NFormItem),{required:!0,feedback:t.validation.length.feedback||"","show-feedback":t.validation.length.showFeedback||!1,"validation-status":t.validation.length.validationStatus||void 0,label:`Метраж ${t.settings.minLength?" от "+t.settings.minLength:""} ${t.settings.maxLength?" до "+t.settings.maxLength:""} м.`},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInputNumber),{value:n.value[0].length,max:t.settings.maxLength||void 0,min:t.settings.minLength,step:t.settings.lengthStep,validator:p=>p%t.settings.lengthStep===0,placeholder:"Введите метраж",class:"w-full","onUpdate:value":m[3]||(m[3]=p=>h("length",p??0))},null,8,["value","max","min","step","validator"])]),_:1},8,["feedback","show-feedback","validation-status","label"]),i.createVNode(i.unref(z.NFormItem),{required:!0,feedback:t.validation.quantity.feedback||"","show-feedback":t.validation.quantity.showFeedback||!1,"validation-status":t.validation.quantity.validationStatus||void 0,label:"Количество"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInputNumber),{value:n.value[0].quantity,min:1,validator:p=>Number.isInteger(p),placeholder:"Введите количество",class:"w-full","onUpdate:value":m[4]||(m[4]=p=>h("quantity",p??0))},null,8,["value","validator"])]),_:1},8,["feedback","show-feedback","validation-status"]),i.createVNode(i.unref(z.NFormItem),{"show-feedback":!1,label:"Маркировка"},{default:i.withCtx(()=>[i.createVNode(g,{value:n.value[0].marker,placeholder:"Введите маркировку","onUpdate:value":m[5]||(m[5]=p=>h("marker",p))},null,8,["value"])]),_:1}),c.value?(i.openBlock(),i.createElementBlock("div",u0,[m[10]||(m[10]=i.createTextVNode(" ИТОГО: ",-1)),i.createElementVNode("span",f0,i.toDisplayString(c.value)+" ₽",1)])):i.createCommentVNode("",!0),i.createElementVNode("div",g0,[i.createVNode(i.unref(z.NButton),{loading:t.isSubmitProcessing,disabled:!a.value||o.value!=0||!((f=t.value[0])!=null&&f.length)||t.value[0].length>t.settings.maxLength||t.value[0].length<t.settings.minLength||t.value[0].quantity===0,type:"primary",class:"self-start",onClick:m[6]||(m[6]=p=>r("submit",t.value))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(t.value[0].isNewRec()?"В корзину":"Изменить"),1)]),_:1},8,["loading","disabled"])])]}),_:1})}}}),p0={class:"flex grow flex-col"},y0=["src"],b0={class:"w-full"},_0={},md=i.defineComponent({..._0,__name:"strip-configurator-preview",props:{value:{},settings:{}},setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock("div",p0,[i.createElementVNode("img",{src:"/img/configurators/strip/strip-"+t.value.length+".png",class:"w-full max-w-96 self-center",alt:"Штрипс"},null,8,y0),i.createElementVNode("div",b0,[i.createTextVNode(" Число полос можно указать от "+i.toDisplayString(t.settings.minLinesCount)+" до "+i.toDisplayString(t.settings.maxLinesCount)+". ",1),n[0]||(n[0]=i.createElementVNode("br",null,null,-1)),i.createTextVNode(" Минимальная ширина полосы "+i.toDisplayString(t.settings.minLineWidth)+" мм. ",1),n[1]||(n[1]=i.createElementVNode("br",null,null,-1)),i.createTextVNode(" Ширина всех полос "+i.toDisplayString(t.settings.width)+" мм. ",1),n[2]||(n[2]=i.createElementVNode("br",null,null,-1)),i.createTextVNode(" Шаг ширины полосы - "+i.toDisplayString(t.settings.lineWidthStep)+" мм. ",1)])]))}}),w0={class:"flex flex-col gap-2"},x0={class:"w-104 flex grow flex-col px-5"},v0={},pd=i.defineComponent({...v0,__name:"strip-configurator",props:{settings:{},cartItems:{}},emits:["submit","click:view-switch"],setup(t,{emit:e}){const n=t,r=e,s=i.ref(n.cartItems),o=i.ref({width:{},length:{},quantity:{},marker:{}}),a=i.ref(!1),l=i.computed(()=>s.value[0].configuratorParams.linesWidths.reduce((m,g)=>(m??0)+(g??0),0)),c=m=>{m===void 0&&(m=s.value.length-1);const g=s.value.at(0);if(!g)return;g.configuratorParams.linesWidths=g.configuratorParams.linesWidths.toSpliced(m+1,0,null),s.value.forEach(p=>{p.configuratorParams.linesWidths=g.configuratorParams.linesWidths});const f=new G.CartItemBase({quantity:(g==null?void 0:g.quantity)??1,category:g==null?void 0:g.category,length:(g==null?void 0:g.length)??n.settings.minLength,marker:g==null?void 0:g.marker,configuratorParams:{linesWidths:g==null?void 0:g.configuratorParams.linesWidths}});s.value=s.value.toSpliced(m+1,0,f)},d=m=>{const g=s.value.at(0);g&&(g.configuratorParams.linesWidths=g.configuratorParams.linesWidths.toSpliced(m,1),s.value.forEach(f=>{f.configuratorParams.linesWidths=g.configuratorParams.linesWidths}),s.value=s.value.toSpliced(m,1),delete o[`linesWidths.${m}`],delete o[`linesWidths.${m}`])},h=async(m,g,f)=>{f.value=!0,o.value[`linesWidths.${g}`]={},await G.HttpRequester.getInstance(G.ConfiguratorProvider).searchProduct(s.value[g].category,{linesWidths:m.linesWidths.at(g)},o.value).then(p=>{s.value[g].product=p,g===s.value.length-1&&s.value.length<n.settings.maxLinesCount&&l.value&&l.value<n.settings.width&&c()}).catch(()=>{s.value[g].product=new G.Product,o.value[`linesWidths.${g}`]={showFeedback:!0,feedback:"Не удалось найти товар",validationStatus:"error"},f.value=!1}),f.value=!1},u=()=>{a.value=!0,r("submit",s.value,o.value,()=>{a.value=!1})};return(m,g)=>{const f=z.NButton;return i.openBlock(),i.createElementBlock("div",w0,[t.settings.allowShowTable?(i.openBlock(),i.createBlock(f,{key:0,type:"tertiary",class:"self-center",onClick:g[0]||(g[0]=p=>r("click:view-switch"))},{default:i.withCtx(()=>[...g[3]||(g[3]=[i.createTextVNode(" Показать в виде списка ",-1)])]),_:1})):i.createCommentVNode("",!0),i.createElementVNode("div",x0,[i.createVNode(md,{value:s.value,"onUpdate:value":g[1]||(g[1]=p=>s.value=p),settings:t.settings},null,8,["value","settings"]),i.createVNode(gd,{value:s.value,"onUpdate:value":g[2]||(g[2]=p=>s.value=p),validation:o.value,settings:t.settings,"is-submit-processing":a.value,"onUpdate:params":h,onSubmit:u,"onClick:addLine":c,"onClick:removeLine":d},null,8,["value","validation","settings","is-submit-processing"])])])}}}),k0={class:"flex flex-col gap-3"},C0={},yd=i.defineComponent({...C0,__name:"metal-for-doors-configurator-form",props:{value:{},settings:{},isProductSearching:{type:Boolean,default:!1},isSubmitProcessing:{type:Boolean,default:!1},validation:{default:void 0}},emits:["update:value","update:params","submit"],setup(t,{emit:e}){const n=t,r=e,s=i.useTemplateRef("first-input-element"),o=i.ref(O.cloneDeep(i.toRaw(n.value.configuratorParams))),a=()=>{o.value.length>0&&o.value.width>0&&(r("update:params",o.value),l("configuratorParams",o.value))},l=(c,d)=>{const h=new G.CartItemBase(n.value);h[c]=d,r("update:value",h)};return i.onMounted(()=>{n.value.isNewRec()&&i.nextTick(()=>{var c;(c=s.value)==null||c.focus()})}),(c,d)=>{const h=z.NInput;return i.openBlock(),i.createBlock(i.unref(z.NForm),{disabled:t.isSubmitProcessing,class:"flex flex-col gap-2"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NFormItem),{required:!0,feedback:t.validation.width.feedback||"","show-feedback":t.validation.width.showFeedback||!1,"validation-status":t.validation.width.validationStatus||void 0,label:`Ширина, ${t.settings.minWidth?" от "+t.settings.minWidth:""}${t.settings.maxWidth?" до "+t.settings.maxWidth:""} мм`},{default:i.withCtx(()=>[i.createVNode(Li,{ref:"first-input-element",value:o.value.width,"onUpdate:value":[d[0]||(d[0]=u=>o.value.width=u),a],class:"w-full",max:t.settings.maxWidth??void 0,min:t.settings.minWidth,validator:u=>!!u&&u>=t.settings.minWidth&&(!t.settings.maxWidth||u<=t.settings.maxWidth),placeholder:"Введите ширину"},null,8,["value","max","min","validator"])]),_:1},8,["feedback","show-feedback","validation-status","label"]),i.createVNode(i.unref(z.NFormItem),{required:!0,feedback:t.validation.length.feedback||"","show-feedback":t.validation.length.showFeedback||!1,"validation-status":t.validation.length.validationStatus||void 0,label:`Длина, ${t.settings.minLength?" от "+t.settings.minLength:""}${t.settings.maxLength?" до "+t.settings.maxLength:""} мм`},{default:i.withCtx(()=>[i.createVNode(Li,{value:o.value.length,"onUpdate:value":[d[1]||(d[1]=u=>o.value.length=u),a],placeholder:"Введите длину",max:t.settings.maxLength,min:t.settings.minLength,validator:u=>u>=t.settings.minLength&&u<=t.settings.maxLength,class:"w-full"},null,8,["value","max","min","validator"])]),_:1},8,["feedback","show-feedback","validation-status","label"]),i.createVNode(i.unref(z.NFormItem),{required:!0,feedback:t.validation.quantity.feedback||"","show-feedback":t.validation.quantity.showFeedback||!1,"validation-status":t.validation.quantity.validationStatus||void 0,label:"Количество"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInputNumber),{value:t.value.quantity,placeholder:"Введите количество",min:1,validator:u=>u>0,class:"w-full","onUpdate:value":d[2]||(d[2]=u=>l("quantity",u??0))},null,8,["value","validator"])]),_:1},8,["feedback","show-feedback","validation-status"]),i.createVNode(i.unref(z.NFormItem),{feedback:t.validation.marker.feedback||"","show-feedback":t.validation.marker.showFeedback||!1,"validation-status":t.validation.marker.validationStatus||void 0,label:"Маркировка"},{default:i.withCtx(()=>[i.createVNode(h,{value:t.value.marker,placeholder:"Введите маркировку","onUpdate:value":d[3]||(d[3]=u=>l("marker",u))},null,8,["value"])]),_:1},8,["feedback","show-feedback","validation-status"]),i.createVNode(nr,{"is-product-searching":t.isProductSearching,product:t.value.product},null,8,["is-product-searching","product"]),i.createElementVNode("div",k0,[i.createVNode(i.unref(z.NButton),{disabled:t.value.product.isNewRec()||t.isProductSearching||t.isSubmitProcessing||t.value.length===0||t.value.width===0||t.value.quantity===0,type:"primary",class:"self-start",onClick:d[4]||(d[4]=u=>r("submit",t.value))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(t.value.isNewRec()?"В корзину":"Изменить"),1)]),_:1},8,["disabled"])])]),_:1},8,["disabled"])}}}),S0={class:"flex flex-col gap-2"},B0={},bd=i.defineComponent({...B0,__name:"metal-for-doors-configurator",props:{settings:{},cartItem:{}},emits:["submit","click:view-switch"],setup(t,{emit:e}){const n=t,r=e,s=i.ref(n.cartItem),o=i.ref({width:{},length:{},quantity:{},marker:{}}),a=i.ref(!1),l=i.ref(!1),c=async h=>{a.value=!0,await G.HttpRequester.getInstance(G.ConfiguratorProvider).searchProduct(n.cartItem.category,h,o.value).then(u=>{s.value.product=u}).catch(()=>{a.value=!1}),a.value=!1},d=()=>{l.value=!0,r("submit",s.value,o.value,()=>{l.value=!1})};return(h,u)=>{const m=z.NButton;return i.openBlock(),i.createElementBlock("div",S0,[t.settings.allowShowTable?(i.openBlock(),i.createBlock(m,{key:0,type:"tertiary",class:"self-center",onClick:u[0]||(u[0]=g=>r("click:view-switch"))},{default:i.withCtx(()=>[...u[4]||(u[4]=[i.createTextVNode(" Показать в виде списка ",-1)])]),_:1})):i.createCommentVNode("",!0),i.createVNode(yd,{value:s.value,"onUpdate:value":u[1]||(u[1]=g=>s.value=g),validation:o.value,settings:t.settings,"is-submit-processing":l.value,"onUpdate:params":u[2]||(u[2]=g=>c(g)),onSubmit:u[3]||(u[3]=g=>d())},null,8,["value","validation","settings","is-submit-processing"])])}}});class Di extends G.Identity{constructor(n,r){super();x(this,"label","");x(this,"points",[]);x(this,"isCustom",!1);x(this,"id",-1);x(this,"guid","");n?(this.label=n.label,this.points=n.points.map((s,o)=>O.isArray(s)?new ri(s[0],s[1],`A-${o+1}`):new ri(s.width,s.angle,`A-${o+1}`))):(this.label="-- Новая конфигурация --",this.points=[new ri(0,0,"A-1")],this.isCustom=!0,this.id=r??this.id)}}class No extends Di{constructor(n){super(n);x(this,"isDefault");this.isDefault=n.isDefault??!1}}class _d{constructor(e){x(this,"minLineWidth");x(this,"maxLineWidth");x(this,"lineWidthStep");x(this,"minLineAngle");x(this,"maxLineAngle");x(this,"lineAngleStep");x(this,"stripMinWidth");x(this,"stripMaxWidth");x(this,"stripMinLength");x(this,"stripMaxLength");x(this,"allowShowTable");x(this,"showOnlyTemplates");x(this,"templates");x(this,"customTemplates",[]);x(this,"startTailConfigs");x(this,"endTailConfigs");x(this,"bendCountForExtended");x(this,"extendedProductCatalog");x(this,"allowChangeFirstPoint");x(this,"allowSaveTemplates");x(this,"userTemplatesPrefix");x(this,"lengthStep");var n,r;this.minLineWidth=e.minLineWidth,this.maxLineWidth=e.maxLineWidth,this.lineWidthStep=e.lineWidthStep,this.minLineAngle=e.minLineAngle,this.maxLineAngle=e.maxLineAngle,this.lineAngleStep=e.lineAngleStep,this.stripMinWidth=e.stripMinWidth,this.stripMaxWidth=e.stripMaxWidth,this.stripMinLength=e.stripMinLength,this.stripMaxLength=e.stripMaxLength,this.allowShowTable=e.allowShowTable,this.showOnlyTemplates=e.showOnlyTemplates,this.templates=e.templates.map(s=>new Di(s)),this.templates.forEach((s,o)=>{s.id=o}),this.startTailConfigs=((n=e.startTailConfigs)==null?void 0:n.map(s=>new No(s)))??[],this.endTailConfigs=((r=e.endTailConfigs)==null?void 0:r.map(s=>new No(s)))??[],this.bendCountForExtended=e.bendCountForExtended,this.extendedProductCatalog=e.extendedProductCatalog,this.allowChangeFirstPoint=e.allowChangeFirstPoint,this.allowSaveTemplates=e.allowSaveTemplates,this.userTemplatesPrefix=e.userTemplatesPrefix,this.lengthStep=e.lengthStep,this.showOnlyTemplates||(this.customTemplates=e.customTemplates?Object.entries(e.customTemplates).map(([s,o])=>{const a=new Di(o);return a.isCustom=!0,a.id=+s,a}):[],this.customTemplates.push(new Di))}get allTemplates(){return[...this.templates,...this.customTemplates]}addCustomTemplate(e){var r,s;if(!this.allowSaveTemplates)return;const n=new Di(e);n.isCustom=!0,n.id=(((r=this.customTemplates.at(-1))==null?void 0:r.id)??((s=this.templates.at(-1))==null?void 0:s.id)??0)+1,this.customTemplates.splice(-1,0,n)}removeCustomTemplate(e){if(this.allowSaveTemplates)return;const n=this.customTemplates.findIndex(r=>r.id===e);n&&n!==-1&&this.customTemplates.splice(n,1)}}class T0{constructor(e){x(this,"minHeight");x(this,"maxHeights");x(this,"minWidth");x(this,"maxWidths");x(this,"netType");x(this,"color");x(this,"mountType");x(this,"descriptions");x(this,"crossbarCount");x(this,"heightOverlaps");x(this,"widthOverlaps");this.color=e.color,this.crossbarCount=e.crossbarCount,this.descriptions=Ps.objectToSnake(e.descriptions),this.maxHeights=e.maxHeights,this.maxWidths=e.maxWidths,this.minHeight=e.minHeight,this.minWidth=e.minWidth,this.mountType=e.mountType,this.netType=e.netType,this.heightOverlaps=Ps.objectToSnake(e.heightOverlaps),this.widthOverlaps=Ps.objectToSnake(e.widthOverlaps)}}const R0={key:0,class:"flex justify-center p-4"},$0={key:1,class:"p-4 text-center text-red-500"},E0={key:2,class:"!bg-white p-4 m-2 rounded-md justify-self-center"},N0={key:3,class:"p-4 text-center text-gray-500"},wd=i.defineComponent({__name:"dynamic-configurator",props:{eventEmitter:{},category:{}},emits:["submit","click:view-switch"],setup(t,{emit:e}){const n=t,r=e,s=i.ref(!1),o=i.ref(null),a=i.ref(null),l=i.computed(()=>{var g;return(g=n.category.properties)==null?void 0:g.configurator}),c=i.ref(null),d=i.ref(null),h=g=>{var p,y;const f={category:n.category,configurator:l.value,quantity:1};switch(l.value){case"kozyrek":{const b=g;c.value=new G.CartItemBase({...f,configuratorParams:{length:b.stripMinLength,linesAngles:[],linesWidths:[],startTailType:O.some(b.startTailConfigs,_=>_.isDefault)?(p=b.startTailConfigs)==null?void 0:p.findIndex(_=>_.isDefault):void 0,endTailType:O.some(b.endTailConfigs,_=>_.isDefault)?(y=b.endTailConfigs)==null?void 0:y.findIndex(_=>_.isDefault):void 0,colorSide:"top"}});break}case"mosquitto":{const b=g;c.value=new G.CartItemBase({...f,configuratorParams:{width:0,height:0,netType:b.netType[0]||"",color:b.color[0]||"",mountType:b.mountType[0]||""}});break}case"strip":{d.value=[new G.CartItemBase({...f,configuratorParams:{linesWidths:[0]}})];break}case"metal_for_doors":{const b=g;c.value=new G.CartItemBase({...f,configuratorParams:{width:b.minWidth,length:b.minLength}});break}default:o.value=`Неподдерживаемый тип конфигуратора: ${l.value}.`}},u=async()=>{var g;if(!l.value){o.value="Тип конфигуратора не указан в свойствах категории.";return}s.value=!0,o.value=null;try{const p=await G.HttpRequester.getInstance(G.ConfiguratorProvider).getConfiguratorSettings(n.category);switch((g=n.category.properties)==null?void 0:g.configurator){case"kozyrek":a.value=new _d(p);break;case"mosquitto":a.value=new T0(p);break;default:a.value=p;break}h(a.value)}catch(f){"message"in f&&(f.value=`Ошибка при загрузке настроек конфигуратора: ${O.isError(f)?f.message:"Неизвестная ошибка"}.`)}finally{s.value=!1}},m=(g,f,p)=>{const y=b=>{p==null||p(),b&&h(a.value)};r("submit",O.isArray(g)?g[0]:g,f,y)};return i.onMounted(()=>{u()}),(g,f)=>{const p=z.NSpin;return i.openBlock(),i.createElementBlock(i.Fragment,null,[s.value?(i.openBlock(),i.createElementBlock("div",R0,[i.createVNode(p,{size:"large"})])):o.value?(i.openBlock(),i.createElementBlock("div",$0,i.toDisplayString(o.value),1)):i.createCommentVNode("",!0),a.value!==null&&(c.value!==null||d.value!==null)?(i.openBlock(),i.createElementBlock("div",E0,[l.value==="kozyrek"?(i.openBlock(),i.createBlock(cd,{key:0,settings:a.value,"cart-item":c.value,"onClick:viewSwitch":f[0]||(f[0]=y=>r("click:view-switch")),onSubmit:m},null,8,["settings","cart-item"])):l.value==="mosquitto"?(i.openBlock(),i.createBlock(ud,{key:1,settings:a.value,"cart-item":c.value,"onClick:viewSwitch":f[1]||(f[1]=y=>r("click:view-switch")),onSubmit:m},null,8,["settings","cart-item"])):l.value==="strip"?(i.openBlock(),i.createBlock(pd,{key:2,settings:a.value,"cart-items":d.value,"onClick:viewSwitch":f[2]||(f[2]=y=>r("click:view-switch")),onSubmit:m},null,8,["settings","cart-items"])):l.value==="metal_for_doors"?(i.openBlock(),i.createBlock(bd,{key:3,settings:a.value,"cart-item":c.value,"onClick:viewSwitch":f[3]||(f[3]=y=>r("click:view-switch")),onSubmit:m},null,8,["settings","cart-item"])):i.createCommentVNode("",!0)])):(i.openBlock(),i.createElementBlock("div",N0,' Конфигуратор "'+i.toDisplayString(l.value)+'" не поддерживается. ',1))],64)}}}),P0={key:0,class:"pt-0.5"},F0={key:0},M0={class:"line-through"},A0={key:0},V0={key:1},O0={class:"flex flex-row gap-1"},I0={key:0},z0={class:"m-0 list-inside list-disc p-0 pl-1.5 text-xs text-gray-500"},L0={class:"flex flex-col-reverse gap-2.5 sm:flex-row"},D0={key:2,class:"flex flex-col"},H0={},W0=i.defineComponent({...H0,__name:"category-collapse-item",props:{categoryItem:{},filteredItems:{},isCategoryItemSelected:{type:Function,default:void 0},showCategoryHideForClientButton:{type:[Boolean,String,Function],default:!1},showCategoryRequiredButton:{type:[Boolean,String,Function],default:!1},showCategoryPinButton:{type:[Boolean,String,Function],default:!1},showCategoryEditButton:{type:[Boolean,String,Function],default:!1},categoryContextButtonsConfig:{type:Function,default:void 0},showConfigurator:{type:[Boolean,Function],default:!1},eventEmitter:{},showSlugs:{type:Boolean,default:!1},showProperties:{type:Boolean,default:!1},showProductCosts:{type:[Boolean,Function],default:!1},allowNameClick:{type:[Boolean,Function],default:!1},allowPriceClick:{type:[Boolean,Function],default:!1},showPriceHistory:{type:[Boolean,Function],default:!1},showCostDate:{type:[Boolean,Function],default:!1},isProductItemSelected:{type:Function,default:void 0},showProductAddToCartButton:{type:[Boolean,String,Function],default:!1},showProductRequiredButton:{type:[Boolean,String,Function]},showProductEditButton:{type:[Boolean,String,Function],default:!1},currencyRates:{},productContextButtonsConfig:{type:Function,default:void 0}},setup(t){const e=t,n=i.inject($r,"medium"),r=i.computed(()=>{var F;return(F=e==null?void 0:e.filteredItems)==null?void 0:F[e.categoryItem.id]}),s=i.computed(()=>{var F,M;return O.isArray((F=e.categoryItem)==null?void 0:F.categories)&&((M=e.categoryItem.categories)==null?void 0:M.length)>0}),o=i.computed(()=>{var F;return O.isArray((F=e.categoryItem)==null?void 0:F.products)?e.categoryItem.products:[]}),a=i.computed(()=>Object.entries(e.categoryItem.currencyRates??{}).map(([F,M])=>`${M} руб./${R(F)}`).join(", ")),l=i.computed(()=>O.isUndefined(e.filteredItems)||r.value==="*"?o.value:o.value.filter(F=>{var Z;const M=(Z=r.value)==null?void 0:Z.products;return O.isArray(M)&&M.includes(F.id)})),c=i.computed(()=>l.value.length>0),d=i.computed(()=>O.isFunction(e.showCategoryHideForClientButton)?e.showCategoryHideForClientButton(e.categoryItem):e.showCategoryHideForClientButton),h=i.computed(()=>O.isFunction(e.showCategoryPinButton)?e.showCategoryPinButton(e.categoryItem):e.showCategoryPinButton),u=i.computed(()=>O.isFunction(e.showCategoryRequiredButton)?e.showCategoryRequiredButton(e.categoryItem):e.showCategoryRequiredButton),m=i.computed(()=>O.isFunction(e.showCategoryEditButton)?e.showCategoryEditButton(e.categoryItem):e.showCategoryEditButton),g=i.computed(()=>{var F;return((F=e.categoryItem.properties)==null?void 0:F.configurator)!==void 0&&(O.isFunction(e.showConfigurator)?e.showConfigurator(e.categoryItem):e.showConfigurator)}),f=i.computed(()=>O.isNil(e.categoryContextButtonsConfig)?[]:O.isFunction(e.categoryContextButtonsConfig)?e.categoryContextButtonsConfig(e.categoryItem):e.categoryContextButtonsConfig),p=i.computed(()=>new G.ClientCategory(e.categoryItem)),y=i.ref(!1),b=i.ref(!1),_=i.computed(()=>!O.isUndefined(e.isCategoryItemSelected)),C=i.computed(()=>O.isFunction(e.isCategoryItemSelected)?e.isCategoryItemSelected(e.categoryItem):e.isCategoryItemSelected),S=i.computed(()=>H.value&&bt.getDeviceTypeByResolution()===Ue.laptop?"auto":"fixed"),v=i.useTemplateRef("collapse-item-reference"),B=i.computed(()=>{var F,M;return(M=(F=e.categoryItem.properties)==null?void 0:F.templateCost)==null?void 0:M.priceCoefficient}),k=i.computed(()=>{var F,M;return(M=(F=e.categoryItem.properties)==null?void 0:F.templateCost)==null?void 0:M.increasePercent}),R=(F,M="ru-RU")=>0 .toLocaleString(M,{style:"currency",currency:F,minimumFractionDigits:0,maximumFractionDigits:0}).replaceAll(/\d/g,"").trim(),$=F=>{e.eventEmitter.emit("category:checked",{category:e.categoryItem,checked:F,target:v.value})},P=(F,M)=>{e.eventEmitter.emit("category:header-click",{categoryItem:e.categoryItem,expanded:M,isLoadingState:y,target:v.value})},I=()=>{e.eventEmitter.emit("category:hide",{category:e.categoryItem,target:v.value})},V=()=>{e.eventEmitter.emit("category:required",{category:e.categoryItem,target:v.value})},A=()=>{e.eventEmitter.emit("category:attach",{category:e.categoryItem,target:v.value})},L=()=>{e.eventEmitter.emit("category:detach",{category:e.categoryItem,target:v.value})},D=()=>{e.eventEmitter.emit("category:edit",{category:e.categoryItem,target:v.value})},ee=F=>{e.eventEmitter.emit("category:context-select",{category:e.categoryItem,key:F,target:v.value})},E=(F,M,Z)=>{e.eventEmitter.emit("configurator:submit",{cartItem:F,target:v.value,callback:Z,validation:M})},N=()=>{e.eventEmitter.emit("configurator:click-view-switch",{category:e.categoryItem,target:v.value})},H=i.ref(0),q=i.computed(()=>H.value&&o.value.length>0?yg(o.value,{eventEmitter:e.eventEmitter,showSlugs:e.showSlugs,showProperties:e.showProperties,showProductCosts:e.showProductCosts,allowNameClick:e.allowNameClick,allowPriceClick:e.allowPriceClick,showPriceHistory:e.showPriceHistory,showCostDate:e.showCostDate,showProductAddToCartButton:e.showProductAddToCartButton,isProductItemSelected:e.isProductItemSelected,showProductEditButton:e.showProductEditButton,showProductRequiredButton:e.showProductRequiredButton,currencyRates:e.categoryItem.currencyRates,productContextButtonsConfig:e.productContextButtonsConfig}):[]),Y=O.debounce(()=>{H.value=window.innerWidth},20);return i.onUnmounted(()=>{window.removeEventListener("resize",Y)}),window.addEventListener("resize",Y),Y(),(F,M)=>{const Z=z.NCheckbox,fe=sf,ie=z.NTooltip,me=tf,re=z.NTag,Me=Qu,Ae=Gu,Oe=z.NButton,Le=Xu,pt=La,Zt=za,Qt=Ia,St=Oa,At=z.NDropdown,yt=z.NDataTable,pn=z.NAlert,Pn=z.NSpin;return i.openBlock(),i.createBlock(Da,{ref:"collapse-item-reference",name:t.categoryItem.id,"data-id":t.categoryItem.id,"onHeader:click":P},{"pre-arrow":i.withCtx(()=>{var De,ke;return[_.value?(i.openBlock(),i.createElementBlock("div",P0,[i.createVNode(Z,{checked:C.value,disabled:C.value==="disabled","onUpdate:checked":$},null,8,["checked","disabled"])])):i.createCommentVNode("",!0),!d.value&&((De=p.value)!=null&&De.isDisabled)?(i.openBlock(),i.createBlock(ie,{key:1,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(fe,{class:"pt-1.5"})]),default:i.withCtx(()=>[M[1]||(M[1]=i.createTextVNode(" Категория скрыта для клиента ",-1))]),_:1})):i.createCommentVNode("",!0),((ke=p.value)==null?void 0:ke.isFavorite)??!1?(i.openBlock(),i.createBlock(ie,{key:2,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(me,{class:"pt-1.5"})]),default:i.withCtx(()=>[M[2]||(M[2]=i.createTextVNode(" Избранная категория ",-1))]),_:1})):i.createCommentVNode("",!0)]}),header:i.withCtx(()=>{var De,ke,Ie,J,se;return[i.createElementVNode("div",{class:i.normalizeClass({"text-base font-semibold uppercase":!0,"text-gray-400 line-through":t.categoryItem.isHidden,"text-gray-400":(De=p.value)==null?void 0:De.isDisabled})},[i.createVNode(ie,{disabled:!t.categoryItem.isHidden,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createElementVNode("span",null,i.toDisplayString(t.categoryItem.name),1)]),default:i.withCtx(()=>[M[3]||(M[3]=i.createTextVNode(" Категория скрыта ",-1))]),_:1},8,["disabled"])],2),i.createElementVNode("div",{class:"w-fit",onClick:M[0]||(M[0]=i.withModifiers((...Ce)=>i.unref(O.noop)&&i.unref(O.noop)(...Ce),["prevent","stop"]))},[(ke=t.categoryItem.properties)!=null&&ke.m2Price?(i.openBlock(),i.createBlock(re,{key:0,size:i.unref(n),class:i.normalizeClass({"!pr-0":((Ie=t.categoryItem.properties)==null?void 0:Ie.templateCost)&&t.categoryItem.properties.m2PriceRetail&&k.value}),round:""},{default:i.withCtx(()=>{var Ce;return[i.createTextVNode(" Установленная стоимость: "+i.toDisplayString(t.categoryItem.properties.m2Price)+" руб./м2 ",1),(Ce=t.categoryItem.properties)!=null&&Ce.templateCost&&t.categoryItem.properties.m2PriceRetail&&k.value?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[k.value?(i.openBlock(),i.createBlock(re,{key:0,type:"success",bordered:!1,size:i.unref(n),class:"ml-2 !pr-0",round:""},{default:i.withCtx(()=>[k.value?(i.openBlock(),i.createElementBlock("span",F0,i.toDisplayString(k.value.toFixed(2))+"%",1)):i.createCommentVNode("",!0),i.createVNode(re,{size:i.unref(n),round:""},{default:i.withCtx(()=>[i.createElementVNode("span",M0,i.toDisplayString(t.categoryItem.properties.m2PriceRetail)+" руб./м2",1)]),_:1},8,["size"])]),_:1},8,["size"])):i.createCommentVNode("",!0)],64)):i.createCommentVNode("",!0)]}),_:1},8,["size","class"])):(J=t.categoryItem.properties)!=null&&J.templateCost?(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[B.value||k.value?(i.openBlock(),i.createBlock(re,{key:0,size:i.unref(n),round:""},{default:i.withCtx(()=>{var Ce;return[B.value?(i.openBlock(),i.createElementBlock("span",A0,i.toDisplayString((Ce=B.value)==null?void 0:Ce.name),1)):i.createCommentVNode("",!0),k.value?(i.openBlock(),i.createElementBlock("span",V0,i.toDisplayString(k.value>0?"+":"")+i.toDisplayString(k.value.toFixed(2))+"%",1)):i.createCommentVNode("",!0)]}),_:1},8,["size"])):i.createCommentVNode("",!0)],64)):i.createCommentVNode("",!0),a.value?(i.openBlock(),i.createBlock(re,{key:2,size:i.unref(n),round:""},{default:i.withCtx(()=>[i.createTextVNode(" Фиксированный курс: "+i.toDisplayString(a.value),1)]),_:1},8,["size"])):i.createCommentVNode("",!0),h.value&&((se=p.value)!=null&&se.manager)?(i.openBlock(),i.createBlock(re,{key:3,size:i.unref(n),closable:!0,round:"",class:"align-bottom",onClose:L},{default:i.withCtx(()=>[i.createVNode(ie,{placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>{var Ce,Jt;return[i.createElementVNode("span",O0,[i.createVNode(Me),i.createTextVNode(" "+i.toDisplayString((Jt=(Ce=p.value)==null?void 0:Ce.manager)==null?void 0:Jt.name),1)])]}),default:i.withCtx(()=>{var Ce,Jt;return[i.createTextVNode(' Категория закреплена за "'+i.toDisplayString((Jt=(Ce=p.value)==null?void 0:Ce.manager)==null?void 0:Jt.name)+'" ',1)]}),_:1})]),_:1},8,["size"])):i.createCommentVNode("",!0)])]}),"sub-header":i.withCtx(()=>[t.showSlugs||t.showProperties?(i.openBlock(),i.createElementBlock("div",I0,[i.createElementVNode("ul",z0,[t.showSlugs?(i.openBlock(!0),i.createElementBlock(i.Fragment,{key:0},i.renderList({id:t.categoryItem.id,slug:t.categoryItem.slug},(De,ke)=>(i.openBlock(),i.createElementBlock("li",{key:ke}," ("+i.toDisplayString(ke)+"): "+i.toDisplayString(De),1))),128)):i.createCommentVNode("",!0),t.showProperties?(i.openBlock(!0),i.createElementBlock(i.Fragment,{key:1},i.renderList(t.categoryItem.properties,(De,ke)=>(i.openBlock(),i.createElementBlock("li",{key:ke}," ("+i.toDisplayString(ke)+"): "+i.toDisplayString(De),1))),128)):i.createCommentVNode("",!0)])])):i.createCommentVNode("",!0)]),"header-extra":i.withCtx(()=>{var De;return[i.createElementVNode("div",L0,[d.value?(i.openBlock(),i.createBlock(ie,{key:0,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(Oe,{ghost:!0,size:i.unref(n),onClick:I},{default:i.withCtx(()=>{var ke;return[(ke=p.value)!=null&&ke.isDisabled?(i.openBlock(),i.createBlock(fe,{key:1})):(i.openBlock(),i.createBlock(Ae,{key:0}))]}),_:1},8,["size"])]),default:i.withCtx(()=>{var ke;return[(ke=p.value)!=null&&ke.isDisabled?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[i.createTextVNode(" Скрыто для клиента"+i.toDisplayString(p.value.hidingComment?`. Причина: '${p.value.hidingComment}'`:""),1)],64)):(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[i.createTextVNode("Видимо клиенту")],64))]}),_:1})):i.createCommentVNode("",!0),h.value&&!((De=p.value)!=null&&De.manager)?(i.openBlock(),i.createBlock(ie,{key:1,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(Oe,{ghost:!0,size:i.unref(n),onClick:A},{default:i.withCtx(()=>[i.createVNode(Le)]),_:1},8,["size"])]),default:i.withCtx(()=>{var ke,Ie,J;return[(ke=p.value)!=null&&ke.manager?(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[i.createTextVNode('Категория закреплена за "'+i.toDisplayString(((J=(Ie=p.value)==null?void 0:Ie.manager)==null?void 0:J.name)??"-")+'"',1)],64)):(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[i.createTextVNode("Закрепить")],64))]}),_:1})):i.createCommentVNode("",!0),u.value?(i.openBlock(),i.createBlock(ie,{key:2,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(Oe,{ghost:!0,disabled:u.value==="disabled",size:i.unref(n),onClick:V},{default:i.withCtx(()=>{var ke;return[(ke=p.value)!=null&&ke.isRequired?(i.openBlock(),i.createBlock(Zt,{key:1})):(i.openBlock(),i.createBlock(pt,{key:0}))]}),_:1},8,["disabled","size"])]),default:i.withCtx(()=>[M[4]||(M[4]=i.createTextVNode(" Категория, которую нужно предлагать клиенту ",-1))]),_:1})):i.createCommentVNode("",!0),m.value?(i.openBlock(),i.createBlock(ie,{key:3,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(Oe,{ghost:!0,size:i.unref(n),type:"primary",onClick:D},{default:i.withCtx(()=>[i.createVNode(Qt)]),_:1},8,["size"])]),default:i.withCtx(()=>[M[5]||(M[5]=i.createTextVNode(" Редактировать ",-1))]),_:1})):i.createCommentVNode("",!0),f.value.length>0?(i.openBlock(),i.createBlock(At,{key:4,options:f.value,size:i.unref(n),trigger:"click",onSelect:ee},{default:i.withCtx(()=>[i.createVNode(Oe,{ghost:!0,size:i.unref(n),type:"primary"},{default:i.withCtx(()=>[i.createVNode(St)]),_:1},8,["size"])]),_:1},8,["options","size"])):i.createCommentVNode("",!0)])]}),default:i.withCtx(()=>[i.renderSlot(F.$slots,"default",{},()=>{var De,ke;return[s.value?(i.openBlock(),i.createBlock(vd,{key:0,"categories-items":t.categoryItem.categories??[],"has-products":c.value||y.value,"event-emitter":t.eventEmitter,"filtered-items":r.value?((De=r.value)==null?void 0:De.categories)??{}:void 0,"is-category-item-selected":t.isCategoryItemSelected,"show-slugs":t.showSlugs,"show-properties":t.showProperties,"allow-name-click":t.allowNameClick,"allow-price-click":t.allowPriceClick,"show-price-history":t.showPriceHistory,"show-cost-date":t.showCostDate,"show-category-required-button":t.showCategoryRequiredButton,"show-category-hide-for-client-button":t.showCategoryHideForClientButton,"show-category-pin-button":t.showCategoryPinButton,"show-category-edit-button":t.showCategoryEditButton,"category-context-buttons-config":t.categoryContextButtonsConfig,"is-product-item-selected":t.isProductItemSelected,"show-product-add-to-cart-button":t.showProductAddToCartButton,"show-product-costs":t.showProductCosts,"show-product-required-button":t.showProductRequiredButton,"show-product-edit-button":t.showProductEditButton,"product-context-buttons-config":t.productContextButtonsConfig,"show-configurator":t.showConfigurator},null,8,["categories-items","has-products","event-emitter","filtered-items","is-category-item-selected","show-slugs","show-properties","allow-name-click","allow-price-click","show-price-history","show-cost-date","show-category-required-button","show-category-hide-for-client-button","show-category-pin-button","show-category-edit-button","category-context-buttons-config","is-product-item-selected","show-product-add-to-cart-button","show-product-costs","show-product-required-button","show-product-edit-button","product-context-buttons-config","show-configurator"])):i.createCommentVNode("",!0),g.value?(i.openBlock(),i.createBlock(wd,{key:1,"event-emitter":t.eventEmitter,category:t.categoryItem,onSubmit:E,"onClick:viewSwitch":N},null,8,["event-emitter","category"])):c.value?(i.openBlock(),i.createElementBlock("div",D0,[((ke=t.categoryItem.properties)==null?void 0:ke.configurator)!==void 0?(i.openBlock(),i.createBlock(Oe,{key:0,color:"#bdbdbd",strong:"",class:"self-end p-2",onClick:N},{default:i.withCtx(()=>[...M[6]||(M[6]=[i.createTextVNode(" Назад в Конфигуратор ",-1)])]),_:1})):i.createCommentVNode("",!0),i.createVNode(yt,{columns:q.value,data:l.value,bordered:!0,loading:y.value,remote:!0,"row-key":Ie=>Ie.id,"table-layout":S.value,class:"mt-1"},null,8,["columns","data","loading","row-key","table-layout"])])):i.createCommentVNode("",!0),!y.value&&!b.value&&!s.value&&!c.value?(i.openBlock(),i.createBlock(pn,{key:3,"show-icon":!0,type:"warning",title:"Категория пуста",class:"mx-10"})):i.createCommentVNode("",!0),b.value?(i.openBlock(),i.createBlock(pn,{key:4,"show-icon":!0,type:"error",title:"При получении данных произошла ошибка",class:"mx-10"})):i.createCommentVNode("",!0),y.value?(i.openBlock(),i.createBlock(Pn,{key:5,size:i.unref(n),class:"w-full"},{description:i.withCtx(()=>[...M[7]||(M[7]=[i.createElementVNode("div",null,"Выполняется загрузка данных ...",-1)])]),_:1},8,["size"])):i.createCommentVNode("",!0)]},!0)]),_:3},8,["name","data-id"])}}}),j0=Zn(W0,[["__scopeId","data-v-8ef5b448"]]),q0={class:"sc-collapse flex w-full flex-col"},X0={},xd=i.defineComponent({...X0,__name:"collapse",props:{defaultExpandedNames:{default:()=>[]},expandedNames:{default:()=>[]}},emits:["on-item-header-click"],setup(t,{emit:e}){const n=t,r=e,s=(o,a)=>{r("on-item-header-click",o,a)};return i.provide("itemHeaderClickHandler",s),i.provide("defaultExpandedNames",n.defaultExpandedNames),i.provide("expandedNames",n.expandedNames),(o,a)=>(i.openBlock(),i.createElementBlock("div",q0,[i.renderSlot(o.$slots,"default")]))}}),Y0={},vd=i.defineComponent({...Y0,__name:"category-collapse",props:{categoriesItems:{},hasProducts:{type:Boolean},loading:{type:Boolean,default:!1},client:{default:void 0},filteredItems:{default:void 0},isCategoryItemSelected:{},showCategoryHideForClientButton:{type:[Boolean,String,Function]},showCategoryRequiredButton:{type:[Boolean,String,Function]},showCategoryPinButton:{type:[Boolean,String,Function]},showCategoryEditButton:{type:[Boolean,String,Function],default:!1},categoryContextButtonsConfig:{type:Function,default:void 0},showConfigurator:{type:[Boolean,Function]},eventEmitter:{},showSlugs:{type:Boolean,default:!1},showProperties:{type:Boolean,default:!1},showProductCosts:{type:[Boolean,Function],default:!1},allowNameClick:{type:[Boolean,Function],default:!1},allowPriceClick:{type:[Boolean,Function],default:!1},showPriceHistory:{type:[Boolean,Function],default:!1},showCostDate:{type:[Boolean,Function],default:!1},isProductItemSelected:{},showProductAddToCartButton:{type:[Boolean,String,Function],default:!1},showProductRequiredButton:{type:[Boolean,String,Function]},showProductEditButton:{type:[Boolean,String,Function],default:!1},currencyRates:{},productContextButtonsConfig:{type:Function,default:void 0}},setup(t){const e=t,n=i.inject($r,"medium"),r=i.computed(()=>O.isUndefined(e.filteredItems)?e.categoriesItems:e.categoriesItems.filter(o=>{var a;return!!((a=e.filteredItems)!=null&&a[o.id])})),s=(o,a)=>{if(O.isUndefined(a))return;const l=a[o.id];if(l==="*")return;const c={};return c[o.id]=structuredClone(i.toRaw(l)),c};return(o,a)=>{const l=z.NSpin,c=z.NAlert;return i.openBlock(),i.createElementBlock(i.Fragment,null,[r.value.length>0?(i.openBlock(),i.createBlock(xd,{key:0},{default:i.withCtx(()=>[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(r.value,d=>(i.openBlock(),i.createBlock(j0,{key:d.id,"category-item":d,"event-emitter":t.eventEmitter,"filtered-items":s(d,t.filteredItems),"is-category-item-selected":t.isCategoryItemSelected,"show-slugs":t.showSlugs,"show-properties":t.showProperties,"allow-name-click":t.allowNameClick,"allow-price-click":t.allowPriceClick,"show-price-history":t.showPriceHistory,"show-cost-date":t.showCostDate,"show-category-required-button":t.showCategoryRequiredButton,"show-category-hide-for-client-button":t.showCategoryHideForClientButton,"show-category-pin-button":t.showCategoryPinButton,"show-category-edit-button":t.showCategoryEditButton,"category-context-buttons-config":t.categoryContextButtonsConfig,"is-product-item-selected":t.isProductItemSelected,"show-product-add-to-cart-button":t.showProductAddToCartButton,"show-product-costs":t.showProductCosts,"show-product-required-button":t.showProductRequiredButton,"show-product-edit-button":t.showProductEditButton,"product-context-buttons-config":t.productContextButtonsConfig,"show-configurator":t.showConfigurator},null,8,["category-item","event-emitter","filtered-items","is-category-item-selected","show-slugs","show-properties","allow-name-click","allow-price-click","show-price-history","show-cost-date","show-category-required-button","show-category-hide-for-client-button","show-category-pin-button","show-category-edit-button","category-context-buttons-config","is-product-item-selected","show-product-add-to-cart-button","show-product-costs","show-product-required-button","show-product-edit-button","product-context-buttons-config","show-configurator"]))),128))]),_:1})):t.loading?(i.openBlock(),i.createBlock(l,{key:1,size:i.unref(n),class:"w-full"},{description:i.withCtx(()=>[...a[0]||(a[0]=[i.createElementVNode("div",null,"Выполняется загрузка данных ...",-1)])]),_:1},8,["size"])):i.createCommentVNode("",!0),!t.hasProducts&&!t.loading&&t.categoriesItems.length>0&&r.value.length===0?(i.openBlock(),i.createBlock(c,{key:2,"show-icon":!0,type:"warning",title:"Товары не найдены",class:"mx-10"})):i.createCommentVNode("",!0)],64)}}}),U0={},kd=i.defineComponent({...U0,__name:"reference-select",props:{value:{default:void 0},clearable:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},consistentMenuWidth:{type:Boolean,default:!0},wrapContent:{type:Boolean},referenceList:{default:()=>[]},showEmptyValue:{type:Boolean,default:!1},sortOptionsByLabel:{type:Boolean,default:!1},filterable:{type:Boolean,default:!1},maxTagCount:{default:void 0}},emits:["update:value"],setup(t,{expose:e,emit:n}){const r=t,s=n,o=i.computed(()=>O.isArray(r.value)),a=new G.Reference,l=i.computed(()=>{const g=o.value?[]:a,f=O.isUndefined(r.value)?g:r.value;return O.isArray(f)?f.map(p=>p.id):f==null?void 0:f.id}),c=i.computed(()=>zt.convertReferencesToSelectOptionsList(r.referenceList,r.sortOptionsByLabel,!1,r.showEmptyValue)),d=g=>{var f;if(O.isArray(g)){const p=g.length>0?g.map(y=>{var b;return(b=c.value.find(_=>_.value===y))==null?void 0:b.item}):[];s("update:value",p)}else{const p=g===a.id||(f=c.value.find(y=>y.value===g))==null?void 0:f.item;s("update:value",p)}},h=i.useTemplateRef("select-component");return e({focus:()=>{var g;return(g=h.value)==null?void 0:g.focus()},blur:()=>{var g;return(g=h.value)==null?void 0:g.blur()}}),(g,f)=>(i.openBlock(),i.createBlock(i.unref(z.NSelect),{ref:"select-component",value:l.value,clearable:r.clearable,"consistent-menu-width":t.consistentMenuWidth,disabled:t.disabled||c.value.length===0,filterable:t.filterable,"max-tag-count":t.maxTagCount,multiple:o.value,options:c.value,placeholder:"",class:"w-full","onUpdate:value":d},null,8,["value","clearable","consistent-menu-width","disabled","filterable","max-tag-count","multiple","options"]))}}),G0={},K0=i.defineComponent({...G0,__name:"set-client-price-form-item",props:{value:{},clearable:{type:Boolean},feedback:{},validationStatus:{},disabled:{type:Boolean},catalogItem:{},calculationType:{},label:{}},emits:["update:value"],setup(t,{emit:e}){var C,S;const n=t,r=e,s=()=>{const v=G.PriceCoefficient.getRetailPriceCoefficient();return O.unset(v,"isNewRec"),v},o=v=>!v||v.id===s().id,a=i.computed(()=>{var v;return((v=n.catalogItem)==null?void 0:v.type)==="product"}),l=i.computed(()=>a.value?n.catalogItem:void 0),c=v=>{var B,k,R,$;return v.id===s().id?(B=l.value)==null?void 0:B.getRetailCost():($=(R=(k=l.value)==null?void 0:k.priceCoefficients)==null?void 0:R.find(P=>P.coefficient.id===v.id))==null?void 0:$.cost},d=i.computed(()=>{var B;const v=[...((B=G.useReferencesStore().priceCoefficientsReference)==null?void 0:B.map(k=>structuredClone(i.toRaw(k))))??[],s()];return a.value&&v.forEach(k=>{var $;const R=c(k);R?k.name+=` (${R} ${($=l.value)==null?void 0:$.currency})`:k.name=""}),v.filter(k=>k.name!=="")}),h=i.ref(n.value.coefficient),u=i.ref(((S=(C=n.value)==null?void 0:C.value)==null?void 0:S.toString())??null),m=i.ref(null),g=i.computed(()=>{var v,B;return(B=(v=l.value)==null?void 0:v.priceCoefficients)==null?void 0:B.find(k=>k.coefficient.slug===G.PriceCoefficientEnum.K0)}),f=i.ref(void 0),p=()=>{var B,k,R;f.value=void 0;let v=Number.parseFloat(((B=u.value)==null?void 0:B.replace(",","."))??"");if(v=Number.isNaN(v)?void 0:v,a.value)if(h.value||u.value){const $=s(),P=c(h.value??$)??0,I=P+P*((v??0)/100);m.value=new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:2}).format(I),I>(((k=l.value)==null?void 0:k.getRetailCost())??I)&&(f.value={validationStatus:"warning",feedback:"Устанавливается цена выше розничной цены"}),g.value&&I<(((R=g.value)==null?void 0:R.cost)??0)&&(f.value={validationStatus:"warning",feedback:"Устанавливается цена ниже минимальной цены"})}else m.value=null;r("update:value",{value:Number.isNaN(v)?void 0:v,coefficient:o(h.value)?void 0:structuredClone(i.toRaw(h.value))})},y=v=>{O.isArray(v)||(h.value=v,!h.value&&u.value&&(h.value=s()),p())},b=()=>{h.value||(h.value=s()),p()},_=v=>{var k,R,$,P,I,V;const B=Number.parseFloat((v==null?void 0:v.replace(",","."))??"");if(a.value){let A=0;if(B<=0)h.value=void 0,u.value=null;else if(g.value&&B<(((k=g.value)==null?void 0:k.cost)??0))h.value=(R=g.value)==null?void 0:R.coefficient,A=(B-g.value.cost)*100/g.value.cost,f.value={validationStatus:"warning",feedback:"Устанавливается цена ниже минимальной цены"};else if(B>((($=l.value)==null?void 0:$.getRetailCost())??B)){h.value=s();const L=((P=l.value)==null?void 0:P.getRetailCost())??0;A=(B-L)*100/L,f.value={validationStatus:"warning",feedback:"Устанавливается цена выше розничной цены"}}else{const L=(V=(I=l.value)==null?void 0:I.priceCoefficients)==null?void 0:V.filter(D=>D.cost<B);if(L&&L.length>0){const D=L.at(-1);h.value=D==null?void 0:D.coefficient,A=(B-((D==null?void 0:D.cost)??0))*100/((D==null?void 0:D.cost)??1)}f.value={validationStatus:void 0,feedback:void 0}}u.value=new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:5}).format(A),r("update:value",{value:Number.isNaN(A)?void 0:A,coefficient:o(h.value)?void 0:structuredClone(i.toRaw(h.value))})}else r("update:value",{value:Number.isNaN(B)?void 0:B,coefficient:void 0})};return i.onMounted(()=>{var v,B,k,R;n.calculationType===G.CalculationTypeEnum.m2Cost?m.value=((B=(v=n.value)==null?void 0:v.value)==null?void 0:B.toString())??null:!((k=n.value)!=null&&k.coefficient)&&((R=n.value)!=null&&R.value)&&(h.value=s()),p()}),(v,B)=>{var $,P,I;const k=z.NInput,R=z.NInputGroup;return i.openBlock(),i.createBlock(i.unref(z.NFormItem),{"show-label":!i.unref(O.isNil)(t.label),label:t.label,"show-feedback":!i.unref(O.isNil)((($=f.value)==null?void 0:$.feedback)??t.feedback),feedback:((P=f.value)==null?void 0:P.feedback)??t.feedback,"validation-status":((I=f.value)==null?void 0:I.validationStatus)??t.validationStatus},{default:i.withCtx(()=>[i.createElementVNode("div",{class:i.normalizeClass([{"sm:grid-cols-3":a.value&&t.calculationType!==i.unref(G.CalculationTypeEnum).m2Cost},"grid w-full grid-cols-1 gap-2"])},[t.calculationType!==i.unref(G.CalculationTypeEnum).m2Cost?(i.openBlock(),i.createBlock(R,{key:0,class:i.normalizeClass(["w-full flex-row",{"sm:col-span-2":a.value}])},{default:i.withCtx(()=>[i.createVNode(kd,{class:"w-full min-w-0 flex-1",value:h.value,"reference-list":d.value,clearable:t.clearable,disabled:t.disabled,"consistent-menu-width":!1,"show-empty-value":!0,"onUpdate:value":y},null,8,["value","reference-list","clearable","disabled"]),i.createVNode(k,{value:u.value,"onUpdate:value":[B[0]||(B[0]=V=>u.value=V),b],clearable:t.clearable,disabled:t.disabled,placeholder:"",class:"w-full min-w-0 flex-1"},i.createSlots({suffix:i.withCtx(()=>[B[3]||(B[3]=i.createTextVNode("%",-1))]),_:2},[u.value&&!u.value.startsWith("-")?{name:"prefix",fn:i.withCtx(()=>[B[2]||(B[2]=i.createTextVNode(" + ",-1))]),key:"0"}:void 0]),1032,["value","clearable","disabled"])]),_:1},8,["class"])):i.createCommentVNode("",!0),a.value||t.calculationType===i.unref(G.CalculationTypeEnum).m2Cost?(i.openBlock(),i.createBlock(k,{key:1,value:m.value,"onUpdate:value":[B[1]||(B[1]=V=>m.value=V),_],clearable:t.clearable,disabled:t.disabled,placeholder:"Стоимость",class:"w-full"},i.createSlots({_:2},[a.value?{name:"suffix",fn:i.withCtx(()=>{var V;return[i.createTextVNode(i.toDisplayString((V=l.value)==null?void 0:V.currency),1)]}),key:"0"}:void 0]),1032,["value","clearable","disabled"])):i.createCommentVNode("",!0)],2)]),_:1},8,["show-label","label","show-feedback","feedback","validation-status"])}}}),Z0={key:0,class:"flex flex-row gap-2.5"},Q0={key:1,class:"flex flex-row flex-wrap justify-end gap-2.5"},J0={},Cd=i.defineComponent({...J0,__name:"base-dialog",props:{show:{type:Boolean},title:{},sizes:{default:()=>({phone:{size:"small",scale:.98},tablet:{size:"small",scale:.9},default:{size:"medium",scale:.7}})},processing:{type:Boolean,default:!1},valid:{type:Boolean,default:!0},acceptButton:{default:()=>({show:!0,text:"ОК"})},cancelButton:{default:()=>({show:!0,text:"Отмена"})}},emits:["update:show","opening","closing","accept","processing:cancel"],setup(t,{expose:e,emit:n}){const r=t,s=n,o=i.ref(r.show),a=i.ref(r.processing),l=bt.initRefDependingOnDeviceResolution(r.sizes.phone.size,r.sizes.tablet.size,r.sizes.default.size),c=bt.initRefDependingOnDeviceResolution(r.sizes.phone.scale,r.sizes.tablet.scale,r.sizes.default.scale),d=i.computed(()=>window.innerWidth*c.value),h=()=>{s("opening"),o.value=!0,s("update:show",o.value)},u=(g="other")=>{if(a.value){s("processing:cancel",b=>{a.value=b});return}let f=!1;s("closing",g,()=>{f=!0}),f||(o.value=!1,s("update:show",o.value))},m=()=>{s("accept",f=>{a.value=f})};return i.watch(()=>r.show,g=>{g?h():u("other")}),i.watch(()=>r.processing,g=>{a.value=g}),e({open:h,close:u}),(g,f)=>{const p=z.NButton,y=z.NModal;return i.openBlock(),i.createBlock(y,{loading:a.value,show:o.value,"show-icon":!1,size:i.unref(l),style:i.normalizeStyle(`width: ${d.value}px`),title:t.title,"action-class":g.$slots["extra-action"]?"grid grid-cols-2 !justify-between":void 0,preset:"dialog",onClose:f[1]||(f[1]=b=>u("header")),onEsc:f[2]||(f[2]=b=>u("esc")),onMaskClick:f[3]||(f[3]=b=>u("mask"))},i.createSlots({default:i.withCtx(()=>[i.renderSlot(g.$slots,"default")]),_:2},[g.$slots.header?{name:"header",fn:i.withCtx(()=>[i.renderSlot(g.$slots,"header")]),key:"0"}:void 0,g.$slots.action||g.$slots["extra-action"]||t.acceptButton.show||t.cancelButton.show?{name:"action",fn:i.withCtx(()=>[g.$slots["extra-action"]?(i.openBlock(),i.createElementBlock("div",Z0,[i.renderSlot(g.$slots,"extra-action")])):i.createCommentVNode("",!0),g.$slots.action||t.acceptButton.show||t.cancelButton.show?(i.openBlock(),i.createElementBlock("div",Q0,[i.renderSlot(g.$slots,"action",{disabled:a.value}),t.acceptButton.show??!0?(i.openBlock(),i.createBlock(p,{key:0,disabled:a.value||!t.valid,size:i.unref(l),type:"primary",onClick:m},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(t.acceptButton.text??"ОК"),1)]),_:1},8,["disabled","size"])):i.createCommentVNode("",!0),t.cancelButton.show??!0?(i.openBlock(),i.createBlock(p,{key:1,size:i.unref(l),type:"default",onClick:f[0]||(f[0]=b=>u("footer"))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(t.cancelButton.text??"Отмена"),1)]),_:1},8,["size"])):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)]),key:"1"}:void 0]),1032,["loading","show","size","style","title","action-class"])}}}),ey={class:"text-sm"},ty={class:"text-sm"},ny={},iy=i.defineComponent({...ny,__name:"add-product-to-cart-dialog",emits:["submit"],setup(t,{expose:e,emit:n}){const r=i.ref(null),s=i.ref(void 0),o=i.ref(null),a=n,l=i.ref({length:{},quantity:{},marker:{}}),c=i.ref(!1),d=i.computed(()=>{var y,b,_,C,S,v,B,k,R;if(!r.value)return"";const f=((b=(y=r.value)==null?void 0:y.properties)==null?void 0:b.minLength)??((C=(_=r.value)==null?void 0:_.properties)!=null&&C.ignoreMinCountCheck?0:(v=(S=r.value)==null?void 0:S.properties)==null?void 0:v.minCount),p=(k=(B=r.value)==null?void 0:B.properties)==null?void 0:k.maxLength;return f||p?`(${f?`от ${f}`:""}${f&&p?" ":""}${p?`до ${p}`:""} ${(R=r.value)==null?void 0:R.unit})`:""}),h=f=>{!r.value||!o.value||(G.UnitsHelper.productIsMeasurable(r.value)||delete o.value.length,c.value=!0,a("submit",o.value,l.value,()=>{c.value=!1,f(!1)}))},u=()=>{r.value=null,s.value=void 0,o.value=null,l.value=g()},m=(f,p)=>{var y,b,_,C;r.value=f,s.value=p,o.value=new G.CartItemBase(p??new G.CartItemBase({product:f,quantity:((y=f==null?void 0:f.properties)==null?void 0:y.minCount)??1,length:((b=f==null?void 0:f.properties)==null?void 0:b.minLength)||((_=f==null?void 0:f.properties)!=null&&_.ignoreMinCountCheck?0:(C=f==null?void 0:f.properties)==null?void 0:C.minCount)||0}))},g=()=>({length:{},quantity:{},marker:{}});return e({show:m,closeDialog:u}),(f,p)=>(i.openBlock(),i.createBlock(Cd,{show:!i.unref(O.isNil)(r.value)&&!i.unref(O.isNil)(o.value),title:`${s.value?"Изменение":"Добавление"} товара в корзину`,"accept-button":{show:!0,text:s.value?"Изменить":"В корзину"},processing:c.value,onAccept:h,onClosing:u},{default:i.withCtx(()=>[r.value&&o.value?(i.openBlock(),i.createBlock(i.unref(z.NForm),{key:0,class:"flex flex-col gap-2"},{default:i.withCtx(()=>[i.unref(G.UnitsHelper).productIsMeasurable(r.value)?(i.openBlock(),i.createBlock(i.unref(z.NFormItem),{key:0,required:!0,feedback:l.value.length.feedback||"","show-feedback":l.value.length.showFeedback||i.unref(G.UnitsHelper).getProductLengthMultiplicity(r.value)!==.01||!1,"validation-status":l.value.length.validationStatus||void 0,label:"Метраж, "+r.value.unit+d.value+"м."},i.createSlots({default:i.withCtx(()=>{var y,b;return[i.createVNode(i.unref(z.NInputNumber),{value:o.value.length,"onUpdate:value":p[0]||(p[0]=_=>o.value.length=_),max:((y=r.value.properties)==null?void 0:y.maxLength)||void 0,min:((b=r.value.properties)==null?void 0:b.minLength)||i.unref(G.UnitsHelper).getProductLengthMultiplicity(r.value),step:i.unref(G.UnitsHelper).getProductMultiplicity(r.value),validator:_=>{const C=i.unref(G.UnitsHelper).getProductLengthMultiplicity(r.value);return Math.round(_/C)*C===_},placeholder:"Введите метраж",class:"w-full"},null,8,["value","max","min","step","validator"])]}),_:2},[!l.value.length.feedback&&i.unref(G.UnitsHelper).getProductLengthMultiplicity(r.value)!==.01?{name:"feedback",fn:i.withCtx(()=>[i.createElementVNode("span",ey,"Метраж должен быть кратен "+i.toDisplayString(i.unref(G.UnitsHelper).getProductLengthMultiplicity(r.value)),1)]),key:"0"}:void 0]),1032,["feedback","show-feedback","validation-status","label"])):i.createCommentVNode("",!0),i.createVNode(i.unref(z.NFormItem),{required:!0,feedback:l.value.quantity.feedback||"","show-feedback":l.value.quantity.showFeedback||i.unref(G.UnitsHelper).getProductMultiplicity(r.value)!==1||!1,"validation-status":l.value.quantity.validationStatus||void 0,label:"Количество"},i.createSlots({default:i.withCtx(()=>[i.createVNode(i.unref(z.NInputNumber),{value:o.value.quantity,"onUpdate:value":p[1]||(p[1]=y=>o.value.quantity=y),min:i.unref(G.UnitsHelper).getProductMultiplicity(r.value),step:i.unref(G.UnitsHelper).getProductMultiplicity(r.value),validator:y=>y%i.unref(G.UnitsHelper).getProductMultiplicity(r.value)===0,placeholder:"Введите количество",class:"w-full"},null,8,["value","min","step","validator"])]),_:2},[!l.value.quantity.feedback&&i.unref(G.UnitsHelper).getProductMultiplicity(r.value)!==1?{name:"feedback",fn:i.withCtx(()=>[i.createElementVNode("span",ty,"Количество должно быть кратно "+i.toDisplayString(i.unref(G.UnitsHelper).getProductMultiplicity(r.value)),1)]),key:"0"}:void 0]),1032,["feedback","show-feedback","validation-status"]),i.createVNode(i.unref(z.NFormItem),{feedback:l.value.marker.feedback||"","show-feedback":l.value.marker.showFeedback||!1,"validation-status":l.value.marker.validationStatus||void 0,label:"Маркировка"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInput),{value:o.value.marker,"onUpdate:value":p[2]||(p[2]=y=>o.value.marker=y),placeholder:"Введите маркировку"},null,8,["value"])]),_:1},8,["feedback","show-feedback","validation-status"])]),_:1})):i.createCommentVNode("",!0)]),_:1},8,["show","title","accept-button","processing"]))}}),ry={class:"flex flex-row gap-1"},sy={class:"sc-client-name flex flex-col gap-1 text-base"},oy=["href"],ay={key:1,class:"text-sc-grey"},ly={key:0,class:"text-sc-dark-grey sc-client-city text-sm"},cy={key:0},dy={key:1,class:"text-sm"},hy={},os=i.defineComponent({...hy,__name:"client-name-with-short-info",props:{client:{},nameLink:{default:void 0},popoverPosition:{default:void 0},showCityAndRegion:{type:Boolean,default:!0},showSalesDirection:{type:Boolean,default:!1},showClientInfoIcon:{type:Boolean,default:!1}},emits:["click:client-name","click:client-info"],setup(t,{emit:e}){const n=t,r=e,s=i.computed(()=>n.client.lastLoginAt?Mn.format(n.client.lastLoginAt,G.AppConfigProvider.getConfig().dateFormats.uiDateWithTime):""),o=a=>{O.isNil(n.nameLink)&&(a.preventDefault(),a.stopPropagation()),r("click:client-name",n.client,a)};return(a,l)=>{const c=Fs,d=z.NButton,h=z.NPopover;return i.openBlock(),i.createElementBlock("div",ry,[t.showClientInfoIcon?(i.openBlock(),i.createBlock(d,{key:0,quaternary:"",size:"small",onClick:l[0]||(l[0]=u=>a.$emit("click:client-info",t.client))},{default:i.withCtx(()=>[i.createVNode(c)]),_:1})):i.createCommentVNode("",!0),i.createVNode(h,{disabled:i.unref(O.isNil)(t.popoverPosition),placement:t.popoverPosition},{trigger:i.withCtx(()=>[i.createElementVNode("div",sy,[i.createElementVNode("a",{href:t.nameLink??"#",class:"text-base no-underline",onClick:l[1]||(l[1]=u=>o(u))},[i.createElementVNode("span",{class:i.normalizeClass({"line-through":!t.client.isActive})},i.toDisplayString(t.client.name),3),t.showSalesDirection&&t.client.salesDirection?(i.openBlock(),i.createElementBlock("span",{key:0,class:i.normalizeClass({"line-through":!t.client.isActive})}," ("+i.toDisplayString(t.client.salesDirection.name)+") ",3)):i.createCommentVNode("",!0),t.client.isActive?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("span",ay," [ Деактивирован ] "))],8,oy),t.showCityAndRegion&&t.client.city?(i.openBlock(),i.createElementBlock("span",ly," г. "+i.toDisplayString(t.client.city.name)+", "+i.toDisplayString(t.client.city.region.name),1)):i.createCommentVNode("",!0)])]),default:i.withCtx(()=>[t.client.alternativeName?(i.openBlock(),i.createElementBlock("div",cy,i.toDisplayString(t.client.alternativeName),1)):i.createCommentVNode("",!0),s.value?(i.openBlock(),i.createElementBlock("span",dy," Последний вход: "+i.toDisplayString(s.value),1)):i.createCommentVNode("",!0),i.renderSlot(a.$slots,"popover-content")]),_:3},8,["disabled","placement"])])}}}),uy={class:"text-base"},fy={},Sd=i.defineComponent({...fy,__name:"contragent-with-short-info",props:{contragent:{}},setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock("span",uy,i.toDisplayString(t.contragent.name),1))}}),gy={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function my(t,e){return i.openBlock(),i.createElementBlock("svg",gy,[...e[0]||(e[0]=[i.createElementVNode("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[i.createElementVNode("path",{d:"M3 7a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"}),i.createElementVNode("path",{d:"m3 7l9 6l9-6"})],-1)])])}const py=i.markRaw({name:"tabler-mail",render:my}),yy=["href"],by={},_y=i.defineComponent({...by,__name:"email",props:{email:{default:""},showEmailIcon:{type:Boolean,default:!1}},setup(t){return(e,n)=>{const r=py;return i.openBlock(),i.createElementBlock("span",{class:i.normalizeClass({"flex flex-row items-center gap-1":t.showEmailIcon})},[t.showEmailIcon?(i.openBlock(),i.createBlock(r,{key:0})):i.createCommentVNode("",!0),i.createElementVNode("a",{href:`mailto:${t.email}`,class:"no-underline"},i.toDisplayString(t.email),9,yy)],2)}}}),wy={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function xy(t,e){return i.openBlock(),i.createElementBlock("svg",wy,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"currentColor",d:"M444 49.9C431.3 38.2 379.9.9 265.3.4c0 0-135.1-8.1-200.9 52.3C27.8 89.3 14.9 143 13.5 209.5s-3.1 191.1 117 224.9h.1l-.1 51.6s-.8 20.9 13 25.1c16.6 5.2 26.4-10.7 42.3-27.8c8.7-9.4 20.7-23.2 29.8-33.7c82.2 6.9 145.3-8.9 152.5-11.2c16.6-5.4 110.5-17.4 125.7-142c15.8-128.6-7.6-209.8-49.8-246.5M457.9 287c-12.9 104-89 110.6-103 115.1c-6 1.9-61.5 15.7-131.2 11.2c0 0-52 62.7-68.2 79c-5.3 5.3-11.1 4.8-11-5.7c0-6.9.4-85.7.4-85.7q-.15 0 0 0C43.1 372.7 49.1 266.6 50.2 211.1s11.6-101 42.6-131.6c55.7-50.5 170.4-43 170.4-43c96.9.4 143.3 29.6 154.1 39.4c35.7 30.6 53.9 103.8 40.6 211.1m-139-80.8c.4 8.6-12.5 9.2-12.9.6c-1.1-22-11.4-32.7-32.6-33.9c-8.6-.5-7.8-13.4.7-12.9c27.9 1.5 43.4 17.5 44.8 46.2m20.3 11.3c1-42.4-25.5-75.6-75.8-79.3c-8.5-.6-7.6-13.5.9-12.9c58 4.2 88.9 44.1 87.8 92.5c-.1 8.6-13.1 8.2-12.9-.3m47 13.4c.1 8.6-12.9 8.7-12.9.1c-.6-81.5-54.9-125.9-120.8-126.4c-8.5-.1-8.5-12.9 0-12.9c73.7.5 133 51.4 133.7 139.2M374.9 329v.2c-10.8 19-31 40-51.8 33.3l-.2-.3c-21.1-5.9-70.8-31.5-102.2-56.5c-16.2-12.8-31-27.9-42.4-42.4c-10.3-12.9-20.7-28.2-30.8-46.6c-21.3-38.5-26-55.7-26-55.7c-6.7-20.8 14.2-41 33.3-51.8h.2c9.2-4.8 18-3.2 23.9 3.9c0 0 12.4 14.8 17.7 22.1c5 6.8 11.7 17.7 15.2 23.8c6.1 10.9 2.3 22-3.7 26.6l-12 9.6c-6.1 4.9-5.3 14-5.3 14s17.8 67.3 84.3 84.3c0 0 9.1.8 14-5.3l9.6-12c4.6-6 15.7-9.8 26.6-3.7c14.7 8.3 33.4 21.2 45.8 32.9c7 5.7 8.6 14.4 3.8 23.6"},null,-1)])])}const Bd=i.markRaw({name:"fa6-brands-viber",render:xy}),vy={viewBox:"0 0 256 258",width:"1.2em",height:"1.2em"},ky=["id"],Cy=["id"],Sy=["fill"],By=["fill"];function Ty(t,e){return i.openBlock(),i.createElementBlock("svg",vy,[i.createElementVNode("defs",null,[i.createElementVNode("linearGradient",{id:t.idMap.SVGBRLHCcSy,x1:"50%",x2:"50%",y1:"100%",y2:"0%"},[...e[0]||(e[0]=[i.createElementVNode("stop",{offset:"0%","stop-color":"#1FAF38"},null,-1),i.createElementVNode("stop",{offset:"100%","stop-color":"#60D669"},null,-1)])],8,ky),i.createElementVNode("linearGradient",{id:t.idMap.SVGHW6lecxh,x1:"50%",x2:"50%",y1:"100%",y2:"0%"},[...e[1]||(e[1]=[i.createElementVNode("stop",{offset:"0%","stop-color":"#F9F9F9"},null,-1),i.createElementVNode("stop",{offset:"100%","stop-color":"#FFF"},null,-1)])],8,Cy)]),i.createElementVNode("path",{fill:"url(#"+t.idMap.SVGBRLHCcSy+")",d:"M5.463 127.456c-.006 21.677 5.658 42.843 16.428 61.499L4.433 252.697l65.232-17.104a123 123 0 0 0 58.8 14.97h.054c67.815 0 123.018-55.183 123.047-123.01c.013-32.867-12.775-63.773-36.009-87.025c-23.23-23.25-54.125-36.061-87.043-36.076c-67.823 0-123.022 55.18-123.05 123.004"},null,8,Sy),i.createElementVNode("path",{fill:"url(#"+t.idMap.SVGHW6lecxh+")",d:"M1.07 127.416c-.007 22.457 5.86 44.38 17.014 63.704L0 257.147l67.571-17.717c18.618 10.151 39.58 15.503 60.91 15.511h.055c70.248 0 127.434-57.168 127.464-127.423c.012-34.048-13.236-66.065-37.3-90.15C194.633 13.286 162.633.014 128.536 0C58.276 0 1.099 57.16 1.071 127.416m40.24 60.376l-2.523-4.005c-10.606-16.864-16.204-36.352-16.196-56.363C22.614 69.029 70.138 21.52 128.576 21.52c28.3.012 54.896 11.044 74.9 31.06c20.003 20.018 31.01 46.628 31.003 74.93c-.026 58.395-47.551 105.91-105.943 105.91h-.042c-19.013-.01-37.66-5.116-53.922-14.765l-3.87-2.295l-40.098 10.513z"},null,8,By),e[2]||(e[2]=i.createElementVNode("path",{fill:"#FFF",d:"M96.678 74.148c-2.386-5.303-4.897-5.41-7.166-5.503c-1.858-.08-3.982-.074-6.104-.074c-2.124 0-5.575.799-8.492 3.984c-2.92 3.188-11.148 10.892-11.148 26.561s11.413 30.813 13.004 32.94c1.593 2.123 22.033 35.307 54.405 48.073c26.904 10.609 32.379 8.499 38.218 7.967c5.84-.53 18.844-7.702 21.497-15.139c2.655-7.436 2.655-13.81 1.859-15.142c-.796-1.327-2.92-2.124-6.105-3.716s-18.844-9.298-21.763-10.361c-2.92-1.062-5.043-1.592-7.167 1.597c-2.124 3.184-8.223 10.356-10.082 12.48c-1.857 2.129-3.716 2.394-6.9.801c-3.187-1.598-13.444-4.957-25.613-15.806c-9.468-8.442-15.86-18.867-17.718-22.056c-1.858-3.184-.199-4.91 1.398-6.497c1.431-1.427 3.186-3.719 4.78-5.578c1.588-1.86 2.118-3.187 3.18-5.311c1.063-2.126.531-3.986-.264-5.579c-.798-1.593-6.987-17.343-9.819-23.64"},null,-1))])}const Td=i.markRaw({name:"logos-whatsapp-icon",render:Ty,setup(){const t=()=>Math.random().toString(36).substr(2,10);return{idMap:{SVGBRLHCcSy:"uicons-"+t(),SVGHW6lecxh:"uicons-"+t()}}}}),Ry={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"},$y=["id"],Ey=["fill"];function Ny(t,e){return i.openBlock(),i.createElementBlock("svg",Ry,[i.createElementVNode("defs",null,[i.createElementVNode("linearGradient",{id:t.idMap.SVGuySfwdaH,x1:"50%",x2:"50%",y1:"0%",y2:"100%"},[...e[0]||(e[0]=[i.createElementVNode("stop",{offset:"0%","stop-color":"#2AABEE"},null,-1),i.createElementVNode("stop",{offset:"100%","stop-color":"#229ED9"},null,-1)])],8,$y)]),i.createElementVNode("path",{fill:"url(#"+t.idMap.SVGuySfwdaH+")",d:"M128 0C94.06 0 61.48 13.494 37.5 37.49A128.04 128.04 0 0 0 0 128c0 33.934 13.5 66.514 37.5 90.51C61.48 242.506 94.06 256 128 256s66.52-13.494 90.5-37.49c24-23.996 37.5-56.576 37.5-90.51s-13.5-66.514-37.5-90.51C194.52 13.494 161.94 0 128 0"},null,8,Ey),e[1]||(e[1]=i.createElementVNode("path",{fill:"#FFF",d:"M57.94 126.648q55.98-24.384 74.64-32.152c35.56-14.786 42.94-17.354 47.76-17.441c1.06-.017 3.42.245 4.96 1.49c1.28 1.05 1.64 2.47 1.82 3.467c.16.996.38 3.266.2 5.038c-1.92 20.24-10.26 69.356-14.5 92.026c-1.78 9.592-5.32 12.808-8.74 13.122c-7.44.684-13.08-4.912-20.28-9.63c-11.26-7.386-17.62-11.982-28.56-19.188c-12.64-8.328-4.44-12.906 2.76-20.386c1.88-1.958 34.64-31.748 35.26-34.45c.08-.338.16-1.598-.6-2.262c-.74-.666-1.84-.438-2.64-.258c-1.14.256-19.12 12.152-54 35.686c-5.1 3.508-9.72 5.218-13.88 5.128c-4.56-.098-13.36-2.584-19.9-4.708c-8-2.606-14.38-3.984-13.82-8.41c.28-2.304 3.46-4.662 9.52-7.072"},null,-1))])}const Rd=i.markRaw({name:"logos-telegram",render:Ny,setup(){return{idMap:{SVGuySfwdaH:"uicons-"+Math.random().toString(36).substr(2,10)}}}}),Py={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Fy(t,e){return i.openBlock(),i.createElementBlock("svg",Py,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"currentColor",d:"M391 480c-19.52 0-46.94-7.06-88-30c-49.93-28-88.55-53.85-138.21-103.38C116.91 298.77 93.61 267.79 61 208.45c-36.84-67-30.56-102.12-23.54-117.13C45.82 73.38 58.16 62.65 74.11 52a176.3 176.3 0 0 1 28.64-15.2c1-.43 1.93-.84 2.76-1.21c4.95-2.23 12.45-5.6 21.95-2c6.34 2.38 12 7.25 20.86 16c18.17 17.92 43 57.83 52.16 77.43c6.15 13.21 10.22 21.93 10.23 31.71c0 11.45-5.76 20.28-12.75 29.81c-1.31 1.79-2.61 3.5-3.87 5.16c-7.61 10-9.28 12.89-8.18 18.05c2.23 10.37 18.86 41.24 46.19 68.51s57.31 42.85 67.72 45.07c5.38 1.15 8.33-.59 18.65-8.47c1.48-1.13 3-2.3 4.59-3.47c10.66-7.93 19.08-13.54 30.26-13.54h.06c9.73 0 18.06 4.22 31.86 11.18c18 9.08 59.11 33.59 77.14 51.78c8.77 8.84 13.66 14.48 16.05 20.81c3.6 9.53.21 17-2 22c-.37.83-.78 1.74-1.21 2.75a176.5 176.5 0 0 1-15.29 28.58c-10.63 15.9-21.4 28.21-39.38 36.58A67.4 67.4 0 0 1 391 480"},null,-1)])])}const $d=i.markRaw({name:"ion-call",render:Fy}),My={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Ay(t,e){return i.openBlock(),i.createElementBlock("svg",My,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 4h4l2 5l-2.5 1.5a11 11 0 0 0 5 5L15 13l5 2v4a2 2 0 0 1-2 2A16 16 0 0 1 3 6a2 2 0 0 1 2-2m10 3a2 2 0 0 1 2 2m-2-6a6 6 0 0 1 6 6"},null,-1)])])}const Vy=i.markRaw({name:"tabler-phone-call",render:Ay}),Oy={key:0,class:"absolute left-0 top-0 flex w-full flex-row items-center justify-around text-center backdrop-blur-sm"},Iy=["href"],zy=["href"],Ly=["href"],Dy=["href"],Hy={},Wy=i.defineComponent({...Hy,__name:"phone",props:{defaultCountry:{},phone:{default:""},showPhoneIcon:{type:Boolean,default:!1}},setup(t){const e=t,n=i.computed(()=>{try{return e.phone?Ji.parsePhoneNumberWithError(e.phone,e.defaultCountry):void 0}catch{}return e.phone}),r=i.computed(()=>{var l;return O.isString(n.value)?!1:((l=n.value)==null?void 0:l.isValid())??!1}),s=i.computed(()=>{var l;return O.isString(n.value)?n.value:((l=n.value)==null?void 0:l.format("INTERNATIONAL"))??""}),o=i.computed(()=>{var l;return O.isString(n.value)?n.value:((l=n.value)==null?void 0:l.format("E.164"))??""}),a=i.ref(!1);return(l,c)=>{const d=Vy,h=$d,u=Rd,m=Td,g=Bd;return i.openBlock(),i.createElementBlock("div",null,[i.createElementVNode("div",{class:i.normalizeClass({"border-xl relative inline-flex items-center rounded px-2":r.value&&a.value,"min-w-10":!0}),onClick:c[0]||(c[0]=f=>a.value=!a.value),onFocusout:c[1]||(c[1]=f=>a.value=!1),onMouseleave:c[2]||(c[2]=f=>a.value=!1)},[i.createElementVNode("div",{class:i.normalizeClass({"flex flex-row items-center gap-1":t.showPhoneIcon})},[t.showPhoneIcon?(i.openBlock(),i.createBlock(d,{key:0})):i.createCommentVNode("",!0),i.createTextVNode(" "+i.toDisplayString(s.value),1)],2),r.value&&a.value?(i.openBlock(),i.createElementBlock("div",Oy,[r.value?(i.openBlock(),i.createElementBlock("a",{key:0,href:`tel:${o.value}`,class:"text-blue-600 hover:animate-pulse hover:text-blue-600"},[i.createVNode(h)],8,Iy)):i.createCommentVNode("",!0),r.value?(i.openBlock(),i.createElementBlock("a",{key:1,href:`https://t.me/${o.value}`,target:"_blank",rel:"noopener noreferrer",class:"hover:animate-pulse"},[i.createVNode(u)],8,zy)):i.createCommentVNode("",!0),r.value?(i.openBlock(),i.createElementBlock("a",{key:2,href:`https://wa.me/${o.value.substring(1)}`,target:"_blank",rel:"noopener noreferrer",class:"hover:animate-pulse"},[i.createVNode(m)],8,Ly)):i.createCommentVNode("",!0),r.value?(i.openBlock(),i.createElementBlock("a",{key:3,href:`viber://chat?number=${o.value}`,class:"text-purple-600 hover:animate-pulse hover:text-purple-600"},[i.createVNode(g)],8,Dy)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)],34)])}}}),jy={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function qy(t,e){return i.openBlock(),i.createElementBlock("svg",jy,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"currentColor",d:"m20 8l-8 5l-8-5V6l8 5l8-5m0-2H4c-1.11 0-2 .89-2 2v12a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2"},null,-1)])])}const Xy=i.markRaw({name:"mdi-envelope",render:qy}),Yy={class:"flex flex-col gap-1"},Uy={key:0,class:"mb-2 flex flex-col text-base"},Gy={key:0,class:"text-sc-dark-grey text-sm"},Ky={key:1,class:"whitespace-nowrap text-sm"},Zy={key:2,class:"whitespace-nowrap text-sm"},Qy={key:3,class:"absolute left-0 top-0 flex size-full items-center justify-around rounded-md text-center text-2xl backdrop-blur-sm"},Jy=["href"],eb=["href"],tb=["href"],nb=["href"],ib=["href"],rb={key:0,class:"flex flex-col text-base"},sb={key:0,class:"text-sc-dark-grey text-sm"},ob={key:1,class:"mt-2 text-sm"},ab={key:0,class:"-mt-1"},lb={},cb=i.defineComponent({...lb,__name:"person-contacts-block",props:{defaultCountry:{},contact:{},fullView:{type:Boolean,default:!0},classes:{default:""},styles:{default:void 0}},setup(t){const e=t,n=i.computed(()=>{try{return e.contact.phone?Ji.parsePhoneNumberWithError(e.contact.phone,e.defaultCountry):void 0}catch{}return e.contact.phone}),r=i.computed(()=>{var c;return O.isString(n.value)?!1:((c=n.value)==null?void 0:c.isValid())??!1}),s=i.computed(()=>{var c;return O.isString(n.value)?n.value:((c=n.value)==null?void 0:c.format("INTERNATIONAL"))??""}),o=i.computed(()=>{var c;return O.isString(n.value)?n.value:((c=n.value)==null?void 0:c.format("E.164"))??""}),a=i.computed(()=>r.value||e.contact.email),l=i.ref(!1);return(c,d)=>{var y,b;const h=$d,u=Rd,m=Td,g=Bd,f=Xy,p=z.NPopover;return i.openBlock(),i.createElementBlock("div",Yy,[i.createVNode(p,{disabled:t.fullView,placement:"bottom"},{trigger:i.withCtx(()=>{var _,C,S,v;return[i.createElementVNode("div",{class:i.normalizeClass(`relative contact-btn px-3 py-2 rounded-md items-center inline-flex bg-gray-50 ${(_=t.contact)!=null&&_.isPrimary?"ring-1 ring-inset ring-green-600 hover:ring-gray-200":""} ${t.classes}`),style:i.normalizeStyle(t.styles),onMouseenter:d[0]||(d[0]=B=>l.value=!0),onFocusin:d[1]||(d[1]=B=>l.value=!0),onMouseleave:d[2]||(d[2]=B=>l.value=!1),onFocusout:d[3]||(d[3]=B=>l.value=!1)},[i.createElementVNode("div",null,[t.fullView&&(t.contact.name||(C=t.contact)!=null&&C.position)?(i.openBlock(),i.createElementBlock("div",Uy,[i.createTextVNode(i.toDisplayString(t.contact.name)+" ",1),(S=t.contact)!=null&&S.position?(i.openBlock(),i.createElementBlock("span",Gy,i.toDisplayString((v=t.contact)==null?void 0:v.position),1)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0),t.contact.phone?(i.openBlock(),i.createElementBlock("div",Ky,i.toDisplayString(s.value),1)):i.createCommentVNode("",!0),t.contact.email?(i.openBlock(),i.createElementBlock("div",Zy,i.toDisplayString(t.contact.email),1)):i.createCommentVNode("",!0),a.value&&l.value?(i.openBlock(),i.createElementBlock("div",Qy,[r.value?(i.openBlock(),i.createElementBlock("a",{key:0,href:`tel:${o.value}`,class:"text-blue-600 hover:text-3xl hover:text-blue-600"},[i.createVNode(h)],8,Jy)):i.createCommentVNode("",!0),r.value?(i.openBlock(),i.createElementBlock("a",{key:1,href:`https://t.me/${o.value}`,target:"_blank",rel:"noopener noreferrer",class:"hover:text-3xl"},[i.createVNode(u)],8,eb)):i.createCommentVNode("",!0),r.value?(i.openBlock(),i.createElementBlock("a",{key:2,href:`https://wa.me/${o.value.substring(1)}`,target:"_blank",rel:"noopener noreferrer",class:"hover:text-3xl"},[i.createVNode(m)],8,tb)):i.createCommentVNode("",!0),r.value?(i.openBlock(),i.createElementBlock("a",{key:3,href:`viber://chat?number=${o.value}`,class:"text-purple-600 hover:text-3xl hover:text-purple-600"},[i.createVNode(g)],8,nb)):i.createCommentVNode("",!0),t.contact.email?(i.openBlock(),i.createElementBlock("a",{key:4,href:`mailto:${t.contact.email}`,class:"hover:text-3xl"},[i.createVNode(f)],8,ib)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)])],38)]}),default:i.withCtx(()=>{var _,C,S,v;return[t.contact.name?(i.openBlock(),i.createElementBlock("div",rb,[i.createTextVNode(i.toDisplayString(t.contact.name)+" ",1),(_=t.contact)!=null&&_.position?(i.openBlock(),i.createElementBlock("span",sb,i.toDisplayString((C=t.contact)==null?void 0:C.position),1)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0),(S=t.contact)!=null&&S.comment?(i.openBlock(),i.createElementBlock("div",ob,[d[4]||(d[4]=i.createElementVNode("sup",null,"**",-1)),i.createTextVNode(" "+i.toDisplayString((v=t.contact)==null?void 0:v.comment),1)])):i.createCommentVNode("",!0)]}),_:1},8,["disabled"]),t.fullView&&((y=t.contact)!=null&&y.comment)?(i.openBlock(),i.createElementBlock("div",ab,[d[5]||(d[5]=i.createElementVNode("sup",null,"**",-1)),i.createTextVNode(" "+i.toDisplayString((b=t.contact)==null?void 0:b.comment),1)])):i.createCommentVNode("",!0)])}}}),db={class:"flex flex-wrap gap-2"},hb={class:"flex flex-col"},ub={class:"flex flex-col"},fb={},gb=i.defineComponent({...fb,__name:"date-range",props:{clearable:{type:Boolean,default:!0},dateRange:{default:void 0},dateFormat:{default:()=>G.AppConfigProvider.getConfig().dateFormats.uiDate},disabled:{default:()=>({from:!1,to:!1})},predefinedDateRanges:{default:void 0},useDefaultPredefinedDateRanges:{type:Boolean,default:!1}},emits:["update:date-range"],setup(t,{emit:e}){const n=t,r=e,s=i.computed(()=>{if(n.predefinedDateRanges)return n.predefinedDateRanges;if(n.useDefaultPredefinedDateRanges){const a={};return O.forOwn(G.DateTimeProvider.defaultDateRanges(),(l,c)=>{a[c]={label:l.label,from:l.from??void 0,to:l.to??void 0}}),a}}),o=(a,l)=>{r("update:date-range",{from:a?Mn.startOfDay(new Date(a)):void 0,to:l?Mn.endOfDay(new Date(l)):void 0})};return(a,l)=>{var h,u,m,g,f,p;const c=z.NButton,d=z.NDatePicker;return i.openBlock(),i.createElementBlock("div",db,[i.createVNode(d,{value:((u=(h=t.dateRange)==null?void 0:h.from)==null?void 0:u.getTime())??null,clearable:t.clearable,"is-date-disabled":y=>{var b,_;return((b=t.dateRange)==null?void 0:b.to)&&y>((_=t.dateRange)==null?void 0:_.to)},disabled:(m=t.disabled)==null?void 0:m.from,format:t.dateFormat,type:"date",class:"min-w-28 grow basis-[calc(50%-0.5rem)]",onUpdateValue:l[0]||(l[0]=y=>{var b,_;return o(y,(_=(b=t.dateRange)==null?void 0:b.to)==null?void 0:_.getTime())})},i.createSlots({_:2},[s.value?{name:"footer",fn:i.withCtx(()=>[i.createElementVNode("div",hb,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(s.value,(y,b)=>(i.openBlock(),i.createBlock(c,{key:b,class:"my-1 mr-2",size:"small",type:"info",ghost:"",onClick:_=>{var C,S;return o((C=y==null?void 0:y.from)==null?void 0:C.getTime(),(S=y==null?void 0:y.to)==null?void 0:S.getTime())}},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(y.label),1)]),_:2},1032,["onClick"]))),128))])]),key:"0"}:void 0]),1032,["value","clearable","is-date-disabled","disabled","format"]),i.createVNode(d,{value:((f=(g=t.dateRange)==null?void 0:g.to)==null?void 0:f.getTime())??null,clearable:t.clearable,"is-date-disabled":y=>{var b,_;return((b=t.dateRange)==null?void 0:b.from)&&y<((_=t.dateRange)==null?void 0:_.from)},disabled:(p=t.disabled)==null?void 0:p.to,format:t.dateFormat,type:"date",class:"min-w-28 grow basis-[calc(50%-0.5rem)]",onUpdateValue:l[1]||(l[1]=y=>{var b,_;return o((_=(b=t.dateRange)==null?void 0:b.from)==null?void 0:_.getTime(),y)})},i.createSlots({_:2},[s.value?{name:"footer",fn:i.withCtx(()=>[i.createElementVNode("div",ub,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(s.value,(y,b)=>(i.openBlock(),i.createBlock(c,{key:b,class:"my-1 mr-2",size:"small",type:"info",ghost:"",onClick:_=>{var C,S;return o((C=y==null?void 0:y.from)==null?void 0:C.getTime(),(S=y==null?void 0:y.to)==null?void 0:S.getTime())}},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(y.label),1)]),_:2},1032,["onClick"]))),128))])]),key:"0"}:void 0]),1032,["value","clearable","is-date-disabled","disabled","format"])])}}}),mb={class:"sc-lbl-date text-nowrap"},pb={},Po=i.defineComponent({...pb,__name:"date-time-label",props:{date:{},isTimeSecondary:{type:Boolean},isTimeOnSecondLine:{type:Boolean}},setup(t){const e=t,n=i.computed(()=>Mn.format(e.date,G.AppConfigProvider.getConfig().dateFormats.uiDate)),r=i.computed(()=>Mn.format(e.date,"HH:mm"));return(s,o)=>(i.openBlock(),i.createElementBlock("span",{class:i.normalizeClass({"flex flex-col":t.isTimeOnSecondLine})},[i.createElementVNode("span",mb,i.toDisplayString(n.value),1),i.createElementVNode("span",{class:i.normalizeClass([{"text-sc-grey":t.isTimeSecondary,"ml-1":!t.isTimeOnSecondLine},"sc-lbl-time"])},i.toDisplayString(r.value),3)],2))}}),yb={class:"flex flex-row gap-2.5"},bb={class:"flex grow basis-0 flex-row flex-wrap justify-start justify-items-start gap-y-1 md:flex-nowrap"},_b={class:"flex min-w-0 flex-col-reverse flex-wrap-reverse justify-end gap-1 sm:flex-row"},wb={class:"mb-0.5 sm:mb-0 sm:ml-3"},xb={},vb=i.defineComponent({...xb,__name:"dialog-header",props:{showCloseButton:{type:Boolean,default:!0}},emits:["close"],setup(t){return(e,n)=>{const r=ss,s=z.NButton,o=z.NPopover;return i.openBlock(),i.createElementBlock("div",yb,[i.createElementVNode("div",bb,[i.renderSlot(e.$slots,"main")]),i.createElementVNode("div",null,[i.createElementVNode("div",_b,[i.renderSlot(e.$slots,"extra-buttons"),i.createElementVNode("div",wb,[t.showCloseButton?(i.openBlock(),i.createBlock(o,{key:0,placement:"bottom"},{trigger:i.withCtx(()=>[i.createVNode(s,{size:"small",type:"error",onClick:n[0]||(n[0]=a=>e.$emit("close"))},{default:i.withCtx(()=>[i.createVNode(r)]),_:1})]),default:i.withCtx(()=>[n[1]||(n[1]=i.createTextVNode(" Закрыть ",-1))]),_:1})):i.createCommentVNode("",!0)])])])])}}}),kb={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Cb(t,e){return i.openBlock(),i.createElementBlock("svg",kb,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M336 176h40a40 40 0 0 1 40 40v208a40 40 0 0 1-40 40H136a40 40 0 0 1-40-40V216a40 40 0 0 1 40-40h40"},null,-1),i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"m176 272l80 80l80-80M256 48v288"},null,-1)])])}const Sb=i.markRaw({name:"ion-download-outline",render:Cb}),Bb={},Tb=i.defineComponent({...Bb,__name:"single-file-upload-selector",props:{draggedAreaText:{},accept:{},isError:{type:Boolean}},emits:["update:file"],setup(t,{emit:e}){const n=t,r=e,s=i.ref([]),o=i.computed(()=>s.value.map(l=>(l.status=n.isError?"error":"finished",l))),a=l=>{s.value=l;const c={name:"",content:""};if(l.length===0){r("update:file",null);return}const d=l[0];c.name=d.name;const h=new FileReader;h.addEventListener("load",()=>{c.content=h.result??"",r("update:file",c)}),h.readAsDataURL(d.file)};return(l,c)=>{const d=Sb;return i.openBlock(),i.createBlock(i.unref(z.NUpload),{"file-list":o.value,"default-upload":!1,max:1,"show-retry-button":!1,action:"",accept:t.accept,"directory-dnd":"",class:"content-center","onUpdate:fileList":a},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NUploadDragger),null,{default:i.withCtx(()=>[i.renderSlot(l.$slots,"dragged-area",{},()=>[i.createElementVNode("div",null,[i.createVNode(d,{class:"text-2xl"}),i.createElementVNode("div",null,i.toDisplayString(t.draggedAreaText??"Перетащите в эту область файл, который необходимо загрузить."),1)])])]),_:3})]),_:3},8,["file-list","accept"])}}}),Rb={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function $b(t,e){return i.openBlock(),i.createElementBlock("svg",Rb,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"square","stroke-miterlimit":"10","stroke-width":"44",d:"M465 127L241 384l-92-92m-9 93l-93-93m316-165L236 273"},null,-1)])])}const Eb=i.markRaw({name:"ion-checkmark-done-sharp",render:$b}),Nb={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Pb(t,e){return i.openBlock(),i.createElementBlock("svg",Nb,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M368 128h80m-384 0h240m64 256h80m-384 0h240m-96-128h240m-384 0h80"},null,-1),i.createElementVNode("circle",{cx:"336",cy:"128",r:"32",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),i.createElementVNode("circle",{cx:"176",cy:"256",r:"32",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),i.createElementVNode("circle",{cx:"336",cy:"384",r:"32",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1)])])}const Fb=i.markRaw({name:"ion-options-outline",render:Pb}),Mb={class:"flex flex-row gap-x-2.5 p-0 sm:p-1"},Ab={class:"flex-auto"},Vb={class:"sticky top-0 flex flex-none flex-col justify-start gap-y-1 sm:flex-row sm:justify-start sm:gap-x-1 sm:gap-y-0"},Ob={class:"flex flex-none flex-col-reverse justify-end gap-y-1 sm:flex-row sm:justify-start sm:gap-x-1 sm:gap-y-0"},Ib={},Fo=i.defineComponent({...Ib,__name:"inline-view",props:{disabled:{type:Boolean,default:!1},showEditButton:{type:Boolean,default:!1},showApplyButton:{type:Boolean,default:!1},showCancelButton:{type:Boolean,default:!1}},emits:["edit","apply","cancel"],setup(t,{emit:e}){const n=e,r=i.ref(!1),s=()=>{n("edit")},o=()=>{r.value=!1},a=()=>{r.value=!0,n("apply",o)},l=()=>{n("cancel",o)};return(c,d)=>{const h=Fb,u=z.NButton,m=z.NPopover,g=Eb,f=ss;return i.openBlock(),i.createElementBlock("div",Mb,[i.createElementVNode("div",Ab,[i.renderSlot(c.$slots,"default")]),i.createElementVNode("div",null,[i.createElementVNode("div",Vb,[i.createElementVNode("div",Ob,[t.showEditButton?(i.openBlock(),i.createBlock(m,{key:0,placement:"bottom"},{trigger:i.withCtx(()=>[i.createVNode(u,{disabled:t.disabled||r.value,type:"info",ghost:"",size:"small",onClick:s},{default:i.withCtx(()=>[i.createVNode(h)]),_:1},8,["disabled"])]),default:i.withCtx(()=>[d[0]||(d[0]=i.createTextVNode(" Редактировать данные ",-1))]),_:1})):i.createCommentVNode("",!0),t.showApplyButton?(i.openBlock(),i.createBlock(m,{key:1,disabled:r.value,placement:"bottom"},{trigger:i.withCtx(()=>[i.createVNode(u,{disabled:t.disabled||r.value,type:"primary",size:"small",onClick:a},{default:i.withCtx(()=>[i.createVNode(g)]),_:1},8,["disabled"])]),default:i.withCtx(()=>[d[1]||(d[1]=i.createTextVNode(" Сохранить изменения ",-1))]),_:1},8,["disabled"])):i.createCommentVNode("",!0),t.showCancelButton?(i.openBlock(),i.createBlock(m,{key:2,placement:"bottom"},{trigger:i.withCtx(()=>[i.createVNode(u,{disabled:t.disabled||r.value,type:"error",size:"small",onClick:l},{default:i.withCtx(()=>[i.createVNode(f)]),_:1},8,["disabled"])]),default:i.withCtx(()=>[d[2]||(d[2]=i.createTextVNode(" Отменить изменения ",-1))]),_:1})):i.createCommentVNode("",!0)]),i.renderSlot(c.$slots,"extra-buttons")])])])}}}),zb={},Ed=i.defineComponent({...zb,__name:"inline-editable-item",props:{disabled:{type:Boolean,default:!1},showEditor:{type:Boolean,default:!1},showEditButton:{type:Boolean,default:!0}},emits:["editor:apply","editor:cancel"],setup(t,{emit:e}){const n=t,r=e,s=i.ref(n.showEditor),o=l=>{r("editor:apply",d=>{s.value=!d,l()})},a=l=>{s.value=!1,l(),r("editor:cancel")};return i.onMounted(()=>{i.watch(()=>n.showEditor,l=>{s.value=l})}),(l,c)=>(i.openBlock(),i.createElementBlock("div",null,[s.value?(i.openBlock(),i.createBlock(Fo,{key:1,disabled:t.disabled,"show-apply-button":!0,"show-cancel-button":!0,onApply:o,onCancel:a},{"extra-buttons":i.withCtx(()=>[i.renderSlot(l.$slots,"extra-editor-buttons")]),default:i.withCtx(()=>[i.renderSlot(l.$slots,"editor")]),_:3},8,["disabled"])):(i.openBlock(),i.createBlock(Fo,{key:0,disabled:t.disabled,"show-edit-button":t.showEditButton,onEdit:c[0]||(c[0]=d=>s.value=!0)},{"extra-buttons":i.withCtx(()=>[i.renderSlot(l.$slots,"extra-viewer-buttons")]),default:i.withCtx(()=>[i.renderSlot(l.$slots,"viewer")]),_:3},8,["disabled","show-edit-button"]))]))}}),Lb={},Db=i.defineComponent({...Lb,__name:"debounced-input",props:{value:{default:void 0},clearable:{type:Boolean,default:!1},debounceTime:{default:800},placeholder:{default:""}},emits:["update:value"],setup(t,{emit:e}){const n=t,r=e,s=i.ref(n.value),o=i.computed(()=>i.inject("debounce-input-time",n.debounceTime)),a=O.debounce(()=>r("update:value",s.value),o.value),l=c=>{s.value=c,a()};return i.watch(()=>n.value,c=>{s.value=c}),(c,d)=>(i.openBlock(),i.createBlock(i.unref(z.NInput),{value:s.value,"onUpdate:value":[d[0]||(d[0]=h=>s.value=h),l],clearable:t.clearable,placeholder:t.placeholder},{prefix:i.withCtx(()=>[i.renderSlot(c.$slots,"prefix")]),_:3},8,["value","clearable","placeholder"]))}}),Hb={},Wb=i.defineComponent({...Hb,__name:"phone-input",props:{value:{},debounceTime:{},disabled:{type:Boolean},placeholder:{},defaultCountry:{},preferredCountries:{},onlyCountries:{}},emits:["update:value"],setup(t,{emit:e}){const n=t,r=e,s=i.ref((n.value??"").replaceAll(/\D*/g,"")),o=O.debounce(c=>r("update:value",c),n.debounceTime??0),a=c=>{let d="";if(O.isString(c))s.value=c,d=c.replaceAll(/(\s|\(|\)|-|_)*/g,"");else if(O.isObject(c)){if(s.value=c.formatted,!c.valid)return;d=c instanceof Ji.PhoneNumber?c.format("E.164"):`+${c.countryCallingCode}${c.nationalNumber}`}n.debounceTime?o(d):r("update:value",d)},l=c=>{const d=c.replaceAll(/\D*/g,"");try{const h=Ji.parsePhoneNumberWithError(`+${d}`);h.isValid()?s.value=h.format("E.164"):h.getPossibleCountries().length>0&&(s.value=`+${d}`)}catch(h){if(h instanceof Ji.ParseError)s.value=d;else throw h}};return i.watch(()=>n.value,c=>{var d;(c==null?void 0:c.replaceAll(/\D*/g,""))!==((d=s.value)==null?void 0:d.replaceAll(/\D*/g,""))&&l(c)},{immediate:!0}),i.onBeforeMount(()=>l(s.value??"")),(c,d)=>(i.openBlock(),i.createBlock(i.unref(Au.VueTelInput),{modelValue:s.value,"onUpdate:modelValue":[d[0]||(d[0]=h=>s.value=h),a],"auto-default-country":!1,"auto-format":!0,"default-country":t.defaultCountry,disabled:t.disabled,"input-options":{placeholder:t.placeholder},"preferred-countries":t.preferredCountries,"only-countries":t.onlyCountries,mode:"international",class:"tel-input"},null,8,["modelValue","default-country","disabled","input-options","preferred-countries","only-countries"]))}}),jb=Zn(Wb,[["__scopeId","data-v-751dbb0e"]]),qb={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Xb(t,e){return i.openBlock(),i.createElementBlock("svg",qb,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 6H6a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2v-6m-7 1l9-9m-5 0h5v5"},null,-1)])])}const Yb=i.markRaw({name:"tabler-external-link",render:Xb}),Ub={class:"flex flex-row gap-1 hover:underline hover:decoration-dashed"},Gb=["href"],Kb={},Zb=i.defineComponent({...Kb,__name:"external-link",props:{text:{},url:{},description:{}},setup(t){return(e,n)=>{const r=Yb,s=z.NTooltip;return i.openBlock(),i.createBlock(s,{disabled:i.unref(O.isUndefined)(t.description),placement:"top-start"},{trigger:i.withCtx(()=>[i.createElementVNode("span",Ub,[i.createElementVNode("a",{href:t.url,target:"_blank",class:"no-underline"},i.toDisplayString(t.text),9,Gb),i.createVNode(r,{class:"mt-0.5 flex-none"})])]),default:i.withCtx(()=>[i.createTextVNode(" "+i.toDisplayString(t.description),1)]),_:1},8,["disabled"])}}}),Qb={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Jb(t,e){return i.openBlock(),i.createElementBlock("svg",Qb,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-miterlimit":"10","stroke-width":"32",d:"M448 256c0-106-86-192-192-192S64 150 64 256s86 192 192 192s192-86 192-192Z"},null,-1),i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M336 256H176"},null,-1)])])}const e_=i.markRaw({name:"ion-remove-circle-outline",render:Jb});let as=[];const Nd=new WeakMap;function t_(){as.forEach(t=>t(...Nd.get(t))),as=[]}function Pd(t,...e){Nd.set(t,e),!as.includes(t)&&as.push(t)===1&&requestAnimationFrame(t_)}function cr(t,e){let{target:n}=t;for(;n;){if(n.dataset&&n.dataset[e]!==void 0)return!0;n=n.parentElement}return!1}function dr(t){return t.composedPath()[0]||null}function hr(t){return typeof t=="string"?t.endsWith("px")?Number(t.slice(0,t.length-2)):Number(t):t}function ur(t){if(t!=null)return typeof t=="number"?`${t}px`:t.endsWith("px")?t:`${t}px`}function Yt(t,e){const n=t.trim().split(/\s+/g),r={top:n[0]};switch(n.length){case 1:r.right=n[0],r.bottom=n[0],r.left=n[0];break;case 2:r.right=n[1],r.left=n[1],r.bottom=n[0];break;case 3:r.right=n[1],r.bottom=n[2],r.left=n[1];break;case 4:r.right=n[1],r.bottom=n[2],r.left=n[3];break;default:throw new Error("[seemly/getMargin]:"+t+" is not a valid value.")}return e===void 0?r:r[e]}const Fd={aliceblue:"#F0F8FF",antiquewhite:"#FAEBD7",aqua:"#0FF",aquamarine:"#7FFFD4",azure:"#F0FFFF",beige:"#F5F5DC",bisque:"#FFE4C4",black:"#000",blanchedalmond:"#FFEBCD",blue:"#00F",blueviolet:"#8A2BE2",brown:"#A52A2A",burlywood:"#DEB887",cadetblue:"#5F9EA0",chartreuse:"#7FFF00",chocolate:"#D2691E",coral:"#FF7F50",cornflowerblue:"#6495ED",cornsilk:"#FFF8DC",crimson:"#DC143C",cyan:"#0FF",darkblue:"#00008B",darkcyan:"#008B8B",darkgoldenrod:"#B8860B",darkgray:"#A9A9A9",darkgrey:"#A9A9A9",darkgreen:"#006400",darkkhaki:"#BDB76B",darkmagenta:"#8B008B",darkolivegreen:"#556B2F",darkorange:"#FF8C00",darkorchid:"#9932CC",darkred:"#8B0000",darksalmon:"#E9967A",darkseagreen:"#8FBC8F",darkslateblue:"#483D8B",darkslategray:"#2F4F4F",darkslategrey:"#2F4F4F",darkturquoise:"#00CED1",darkviolet:"#9400D3",deeppink:"#FF1493",deepskyblue:"#00BFFF",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1E90FF",firebrick:"#B22222",floralwhite:"#FFFAF0",forestgreen:"#228B22",fuchsia:"#F0F",gainsboro:"#DCDCDC",ghostwhite:"#F8F8FF",gold:"#FFD700",goldenrod:"#DAA520",gray:"#808080",grey:"#808080",green:"#008000",greenyellow:"#ADFF2F",honeydew:"#F0FFF0",hotpink:"#FF69B4",indianred:"#CD5C5C",indigo:"#4B0082",ivory:"#FFFFF0",khaki:"#F0E68C",lavender:"#E6E6FA",lavenderblush:"#FFF0F5",lawngreen:"#7CFC00",lemonchiffon:"#FFFACD",lightblue:"#ADD8E6",lightcoral:"#F08080",lightcyan:"#E0FFFF",lightgoldenrodyellow:"#FAFAD2",lightgray:"#D3D3D3",lightgrey:"#D3D3D3",lightgreen:"#90EE90",lightpink:"#FFB6C1",lightsalmon:"#FFA07A",lightseagreen:"#20B2AA",lightskyblue:"#87CEFA",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#B0C4DE",lightyellow:"#FFFFE0",lime:"#0F0",limegreen:"#32CD32",linen:"#FAF0E6",magenta:"#F0F",maroon:"#800000",mediumaquamarine:"#66CDAA",mediumblue:"#0000CD",mediumorchid:"#BA55D3",mediumpurple:"#9370DB",mediumseagreen:"#3CB371",mediumslateblue:"#7B68EE",mediumspringgreen:"#00FA9A",mediumturquoise:"#48D1CC",mediumvioletred:"#C71585",midnightblue:"#191970",mintcream:"#F5FFFA",mistyrose:"#FFE4E1",moccasin:"#FFE4B5",navajowhite:"#FFDEAD",navy:"#000080",oldlace:"#FDF5E6",olive:"#808000",olivedrab:"#6B8E23",orange:"#FFA500",orangered:"#FF4500",orchid:"#DA70D6",palegoldenrod:"#EEE8AA",palegreen:"#98FB98",paleturquoise:"#AFEEEE",palevioletred:"#DB7093",papayawhip:"#FFEFD5",peachpuff:"#FFDAB9",peru:"#CD853F",pink:"#FFC0CB",plum:"#DDA0DD",powderblue:"#B0E0E6",purple:"#800080",rebeccapurple:"#663399",red:"#F00",rosybrown:"#BC8F8F",royalblue:"#4169E1",saddlebrown:"#8B4513",salmon:"#FA8072",sandybrown:"#F4A460",seagreen:"#2E8B57",seashell:"#FFF5EE",sienna:"#A0522D",silver:"#C0C0C0",skyblue:"#87CEEB",slateblue:"#6A5ACD",slategray:"#708090",slategrey:"#708090",snow:"#FFFAFA",springgreen:"#00FF7F",steelblue:"#4682B4",tan:"#D2B48C",teal:"#008080",thistle:"#D8BFD8",tomato:"#FF6347",turquoise:"#40E0D0",violet:"#EE82EE",wheat:"#F5DEB3",white:"#FFF",whitesmoke:"#F5F5F5",yellow:"#FF0",yellowgreen:"#9ACD32",transparent:"#0000"};function n_(t,e,n){e/=100,n/=100;let r=(s,o=(s+t/60)%6)=>n-n*e*Math.max(Math.min(o,4-o,1),0);return[r(5)*255,r(3)*255,r(1)*255]}function i_(t,e,n){e/=100,n/=100;let r=e*Math.min(n,1-n),s=(o,a=(o+t/30)%12)=>n-r*Math.max(Math.min(a-3,9-a,1),-1);return[s(0)*255,s(8)*255,s(4)*255]}const dn="^\\s*",hn="\\s*$",Ln="\\s*((\\.\\d+)|(\\d+(\\.\\d*)?))%\\s*",Mt="\\s*((\\.\\d+)|(\\d+(\\.\\d*)?))\\s*",si="([0-9A-Fa-f])",oi="([0-9A-Fa-f]{2})",Md=new RegExp(`${dn}hsl\\s*\\(${Mt},${Ln},${Ln}\\)${hn}`),Ad=new RegExp(`${dn}hsv\\s*\\(${Mt},${Ln},${Ln}\\)${hn}`),Vd=new RegExp(`${dn}hsla\\s*\\(${Mt},${Ln},${Ln},${Mt}\\)${hn}`),Od=new RegExp(`${dn}hsva\\s*\\(${Mt},${Ln},${Ln},${Mt}\\)${hn}`),r_=new RegExp(`${dn}rgb\\s*\\(${Mt},${Mt},${Mt}\\)${hn}`),s_=new RegExp(`${dn}rgba\\s*\\(${Mt},${Mt},${Mt},${Mt}\\)${hn}`),o_=new RegExp(`${dn}#${si}${si}${si}${hn}`),a_=new RegExp(`${dn}#${oi}${oi}${oi}${hn}`),l_=new RegExp(`${dn}#${si}${si}${si}${si}${hn}`),c_=new RegExp(`${dn}#${oi}${oi}${oi}${oi}${hn}`);function $t(t){return parseInt(t,16)}function d_(t){try{let e;if(e=Vd.exec(t))return[cs(e[1]),Dn(e[5]),Dn(e[9]),li(e[13])];if(e=Md.exec(t))return[cs(e[1]),Dn(e[5]),Dn(e[9]),1];throw new Error(`[seemly/hsla]: Invalid color value ${t}.`)}catch(e){throw e}}function h_(t){try{let e;if(e=Od.exec(t))return[cs(e[1]),Dn(e[5]),Dn(e[9]),li(e[13])];if(e=Ad.exec(t))return[cs(e[1]),Dn(e[5]),Dn(e[9]),1];throw new Error(`[seemly/hsva]: Invalid color value ${t}.`)}catch(e){throw e}}function ai(t){try{let e;if(e=a_.exec(t))return[$t(e[1]),$t(e[2]),$t(e[3]),1];if(e=r_.exec(t))return[dt(e[1]),dt(e[5]),dt(e[9]),1];if(e=s_.exec(t))return[dt(e[1]),dt(e[5]),dt(e[9]),li(e[13])];if(e=o_.exec(t))return[$t(e[1]+e[1]),$t(e[2]+e[2]),$t(e[3]+e[3]),1];if(e=c_.exec(t))return[$t(e[1]),$t(e[2]),$t(e[3]),li($t(e[4])/255)];if(e=l_.exec(t))return[$t(e[1]+e[1]),$t(e[2]+e[2]),$t(e[3]+e[3]),li($t(e[4]+e[4])/255)];if(t in Fd)return ai(Fd[t]);if(Md.test(t)||Vd.test(t)){const[n,r,s,o]=d_(t);return[...i_(n,r,s),o]}else if(Ad.test(t)||Od.test(t)){const[n,r,s,o]=h_(t);return[...n_(n,r,s),o]}throw new Error(`[seemly/rgba]: Invalid color value ${t}.`)}catch(e){throw e}}function u_(t){return t>1?1:t<0?0:t}function Mo(t,e,n,r){return`rgba(${dt(t)}, ${dt(e)}, ${dt(n)}, ${u_(r)})`}function Ao(t,e,n,r,s){return dt((t*e*(1-r)+n*r)/s)}function f_(t,e){Array.isArray(t)||(t=ai(t)),Array.isArray(e)||(e=ai(e));const n=t[3],r=e[3],s=li(n+r-n*r);return Mo(Ao(t[0],n,e[0],r,s),Ao(t[1],n,e[1],r,s),Ao(t[2],n,e[2],r,s),s)}function Fe(t,e){const[n,r,s,o=1]=Array.isArray(t)?t:ai(t);return typeof e.alpha=="number"?Mo(n,r,s,e.alpha):Mo(n,r,s,o)}function ls(t,e){const[n,r,s,o=1]=Array.isArray(t)?t:ai(t),{lightness:a=1,alpha:l=1}=e;return g_([n*a,r*a,s*a,o*l])}function li(t){const e=Math.round(Number(t)*100)/100;return e>1?1:e<0?0:e}function cs(t){const e=Math.round(Number(t));return e>=360||e<0?0:e}function dt(t){const e=Math.round(Number(t));return e>255?255:e<0?0:e}function Dn(t){const e=Math.round(Number(t));return e>100?100:e<0?0:e}function g_(t){const[e,n,r]=t;return 3 in t?`rgba(${dt(e)}, ${dt(n)}, ${dt(r)}, ${li(t[3])})`:`rgba(${dt(e)}, ${dt(n)}, ${dt(r)}, 1)`}function m_(t=8){return Math.random().toString(16).slice(2,2+t)}function Id(t){return Array.isArray(t)?t:[t]}const Vo={STOP:"STOP"};function zd(t,e){const n=e(t);t.children!==void 0&&n!==Vo.STOP&&t.children.forEach(r=>zd(r,e))}function p_(t,e={}){const{preserveGroup:n=!1}=e,r=[],s=n?a=>{a.isLeaf||(r.push(a.key),o(a.children))}:a=>{a.isLeaf||(a.isGroup||r.push(a.key),o(a.children))};function o(a){a.forEach(s)}return o(t),r}function y_(t,e){const{isLeaf:n}=t;return n!==void 0?n:!e(t)}function b_(t){return t.children}function __(t){return t.key}function w_(){return!1}function x_(t,e){const{isLeaf:n}=t;return!(n===!1&&!Array.isArray(e(t)))}function v_(t){return t.disabled===!0}function k_(t,e){return t.isLeaf===!1&&!Array.isArray(e(t))}function C_(t,e){if(t.isLeaf===!0){const n=e(t);if(Array.isArray(n)&&n.length>0)return!0}return!1}function Oo(t){var e;return t==null?[]:Array.isArray(t)?t:(e=t.checkedKeys)!==null&&e!==void 0?e:[]}function Io(t){var e;return t==null||Array.isArray(t)?[]:(e=t.indeterminateKeys)!==null&&e!==void 0?e:[]}function S_(t,e){const n=new Set(t);return e.forEach(r=>{n.has(r)||n.add(r)}),Array.from(n)}function B_(t,e){const n=new Set(t);return e.forEach(r=>{n.has(r)&&n.delete(r)}),Array.from(n)}function T_(t){return(t==null?void 0:t.type)==="group"}function R_(t){const e=new Map;return t.forEach((n,r)=>{e.set(n.key,r)}),n=>{var r;return(r=e.get(n))!==null&&r!==void 0?r:null}}class $_ extends Error{constructor(){super(),this.message="SubtreeNotLoadedError: checking a subtree whose required nodes are not fully loaded."}}function E_(t,e,n,r){return ds(e.concat(t),n,r,!1)}function N_(t,e){const n=new Set;return t.forEach(r=>{const s=e.treeNodeMap.get(r);if(s!==void 0){let o=s.parent;for(;o!==null&&!(o.disabled||n.has(o.key));)n.add(o.key),o=o.parent}}),n}function P_(t,e,n,r){const s=ds(e,n,r,!1),o=ds(t,n,r,!0),a=N_(t,n),l=[];return s.forEach(c=>{(o.has(c)||a.has(c))&&l.push(c)}),l.forEach(c=>s.delete(c)),s}function zo(t,e){const{checkedKeys:n,keysToCheck:r,keysToUncheck:s,indeterminateKeys:o,cascade:a,leafOnly:l,checkStrategy:c,allowNotLoaded:d}=t;if(!a)return r!==void 0?{checkedKeys:S_(n,r),indeterminateKeys:Array.from(o)}:s!==void 0?{checkedKeys:B_(n,s),indeterminateKeys:Array.from(o)}:{checkedKeys:Array.from(n),indeterminateKeys:Array.from(o)};const{levelTreeNodeMap:h}=e;let u;s!==void 0?u=P_(s,n,e,d):r!==void 0?u=E_(r,n,e,d):u=ds(n,e,d,!1);const m=c==="parent",g=c==="child"||l,f=u,p=new Set,y=Math.max.apply(null,Array.from(h.keys()));for(let b=y;b>=0;b-=1){const _=b===0,C=h.get(b);for(const S of C){if(S.isLeaf)continue;const{key:v,shallowLoaded:B}=S;if(g&&B&&S.children.forEach(P=>{!P.disabled&&!P.isLeaf&&P.shallowLoaded&&f.has(P.key)&&f.delete(P.key)}),S.disabled||!B)continue;let k=!0,R=!1,$=!0;for(const P of S.children){const I=P.key;if(!P.disabled){if($&&($=!1),f.has(I))R=!0;else if(p.has(I)){R=!0,k=!1;break}else if(k=!1,R)break}}k&&!$?(m&&S.children.forEach(P=>{!P.disabled&&f.has(P.key)&&f.delete(P.key)}),f.add(v)):R&&p.add(v),_&&g&&f.has(v)&&f.delete(v)}}return{checkedKeys:Array.from(f),indeterminateKeys:Array.from(p)}}function ds(t,e,n,r){const{treeNodeMap:s,getChildren:o}=e,a=new Set,l=new Set(t);return t.forEach(c=>{const d=s.get(c);d!==void 0&&zd(d,h=>{if(h.disabled)return Vo.STOP;const{key:u}=h;if(!a.has(u)&&(a.add(u),l.add(u),k_(h.rawNode,o))){if(r)return Vo.STOP;if(!n)throw new $_}})}),l}function F_(t,{includeGroup:e=!1,includeSelf:n=!0},r){var s;const o=r.treeNodeMap;let a=t==null?null:(s=o.get(t))!==null&&s!==void 0?s:null;const l={keyPath:[],treeNodePath:[],treeNode:a};if(a!=null&&a.ignored)return l.treeNode=null,l;for(;a;)!a.ignored&&(e||!a.isGroup)&&l.treeNodePath.push(a),a=a.parent;return l.treeNodePath.reverse(),n||l.treeNodePath.pop(),l.keyPath=l.treeNodePath.map(c=>c.key),l}function M_(t){if(t.length===0)return null;const e=t[0];return e.isGroup||e.ignored||e.disabled?e.getNext():e}function A_(t,e){const n=t.siblings,r=n.length,{index:s}=t;return e?n[(s+1)%r]:s===n.length-1?null:n[s+1]}function Ld(t,e,{loop:n=!1,includeDisabled:r=!1}={}){const s=e==="prev"?V_:A_,o={reverse:e==="prev"};let a=!1,l=null;function c(d){if(d!==null){if(d===t){if(!a)a=!0;else if(!t.disabled&&!t.isGroup){l=t;return}}else if((!d.disabled||r)&&!d.ignored&&!d.isGroup){l=d;return}if(d.isGroup){const h=Lo(d,o);h!==null?l=h:c(s(d,n))}else{const h=s(d,!1);if(h!==null)c(h);else{const u=O_(d);u!=null&&u.isGroup?c(s(u,n)):n&&c(s(d,!0))}}}}return c(t),l}function V_(t,e){const n=t.siblings,r=n.length,{index:s}=t;return e?n[(s-1+r)%r]:s===0?null:n[s-1]}function O_(t){return t.parent}function Lo(t,e={}){const{reverse:n=!1}=e,{children:r}=t;if(r){const{length:s}=r,o=n?s-1:0,a=n?-1:s,l=n?-1:1;for(let c=o;c!==a;c+=l){const d=r[c];if(!d.disabled&&!d.ignored)if(d.isGroup){const h=Lo(d,e);if(h!==null)return h}else return d}}return null}const I_={getChild(){return this.ignored?null:Lo(this)},getParent(){const{parent:t}=this;return t!=null&&t.isGroup?t.getParent():t},getNext(t={}){return Ld(this,"next",t)},getPrev(t={}){return Ld(this,"prev",t)}};function z_(t,e){const n=e?new Set(e):void 0,r=[];function s(o){o.forEach(a=>{r.push(a),!(a.isLeaf||!a.children||a.ignored)&&(a.isGroup||n===void 0||n.has(a.key))&&s(a.children)})}return s(t),r}function L_(t,e){const n=t.key;for(;e;){if(e.key===n)return!0;e=e.parent}return!1}var D_={};function Dd(t,e,n,r,s,o=null,a=0){const l=[];return t.forEach((c,d)=>{var h;D_.NODE_ENV!=="production"&&C_(c,s)&&console.error("[treemate]: node",c,"is invalid");const u=Object.create(r);if(u.rawNode=c,u.siblings=l,u.level=a,u.index=d,u.isFirstChild=d===0,u.isLastChild=d+1===t.length,u.parent=o,!u.ignored){const m=s(c);Array.isArray(m)&&(u.children=Dd(m,e,n,r,s,u,a+1))}l.push(u),e.set(u.key,u),n.has(a)||n.set(a,[]),(h=n.get(a))===null||h===void 0||h.push(u)}),l}function H_(t,e={}){var n;const r=new Map,s=new Map,{getDisabled:o=v_,getIgnored:a=w_,getIsGroup:l=T_,getKey:c=__}=e,d=(n=e.getChildren)!==null&&n!==void 0?n:b_,h=e.ignoreEmptyChildren?S=>{const v=d(S);return Array.isArray(v)?v.length?v:null:v}:d,u=Object.assign({get key(){return c(this.rawNode)},get disabled(){return o(this.rawNode)},get isGroup(){return l(this.rawNode)},get isLeaf(){return y_(this.rawNode,h)},get shallowLoaded(){return x_(this.rawNode,h)},get ignored(){return a(this.rawNode)},contains(S){return L_(this,S)}},I_),m=Dd(t,r,s,u,h);function g(S){if(S==null)return null;const v=r.get(S);return v&&!v.isGroup&&!v.ignored?v:null}function f(S){if(S==null)return null;const v=r.get(S);return v&&!v.ignored?v:null}function p(S,v){const B=f(S);return B?B.getPrev(v):null}function y(S,v){const B=f(S);return B?B.getNext(v):null}function b(S){const v=f(S);return v?v.getParent():null}function _(S){const v=f(S);return v?v.getChild():null}const C={treeNodes:m,treeNodeMap:r,levelTreeNodeMap:s,maxLevel:Math.max(...s.keys()),getChildren:h,getFlattenedNodes(S){return z_(m,S)},getNode:g,getPrev:p,getNext:y,getParent:b,getChild:_,getFirstAvailableNode(){return M_(m)},getPath(S,v={}){return F_(S,v,C)},getCheckedKeys(S,v={}){const{cascade:B=!0,leafOnly:k=!1,checkStrategy:R="all",allowNotLoaded:$=!1}=v;return zo({checkedKeys:Oo(S),indeterminateKeys:Io(S),cascade:B,leafOnly:k,checkStrategy:R,allowNotLoaded:$},C)},check(S,v,B={}){const{cascade:k=!0,leafOnly:R=!1,checkStrategy:$="all",allowNotLoaded:P=!1}=B;return zo({checkedKeys:Oo(v),indeterminateKeys:Io(v),keysToCheck:S==null?[]:Id(S),cascade:k,leafOnly:R,checkStrategy:$,allowNotLoaded:P},C)},uncheck(S,v,B={}){const{cascade:k=!0,leafOnly:R=!1,checkStrategy:$="all",allowNotLoaded:P=!1}=B;return zo({checkedKeys:Oo(v),indeterminateKeys:Io(v),keysToUncheck:S==null?[]:Id(S),cascade:k,leafOnly:R,checkStrategy:$,allowNotLoaded:P},C)},getNonLeafKeys(S={}){return p_(m,S)}};return C}function hs(t){return t.composedPath()[0]}const W_={mousemoveoutside:new WeakMap,clickoutside:new WeakMap};function j_(t,e,n){if(t==="mousemoveoutside"){const r=s=>{e.contains(hs(s))||n(s)};return{mousemove:r,touchstart:r}}else if(t==="clickoutside"){let r=!1;const s=a=>{r=!e.contains(hs(a))},o=a=>{r&&(e.contains(hs(a))||n(a))};return{mousedown:s,mouseup:o,touchstart:s,touchend:o}}return console.error(`[evtd/create-trap-handler]: name \`${t}\` is invalid. This could be a bug of evtd.`),{}}function Hd(t,e,n){const r=W_[t];let s=r.get(e);s===void 0&&r.set(e,s=new WeakMap);let o=s.get(n);return o===void 0&&s.set(n,o=j_(t,e,n)),o}function q_(t,e,n,r){if(t==="mousemoveoutside"||t==="clickoutside"){const s=Hd(t,e,n);return Object.keys(s).forEach(o=>{kt(o,document,s[o],r)}),!0}return!1}function X_(t,e,n,r){if(t==="mousemoveoutside"||t==="clickoutside"){const s=Hd(t,e,n);return Object.keys(s).forEach(o=>{et(o,document,s[o],r)}),!0}return!1}function Y_(){if(typeof window>"u")return{on:()=>{},off:()=>{}};const t=new WeakMap,e=new WeakMap;function n(){t.set(this,!0)}function r(){t.set(this,!0),e.set(this,!0)}function s(k,R,$){const P=k[R];return k[R]=function(){return $.apply(k,arguments),P.apply(k,arguments)},k}function o(k,R){k[R]=Event.prototype[R]}const a=new WeakMap,l=Object.getOwnPropertyDescriptor(Event.prototype,"currentTarget");function c(){var k;return(k=a.get(this))!==null&&k!==void 0?k:null}function d(k,R){l!==void 0&&Object.defineProperty(k,"currentTarget",{configurable:!0,enumerable:!0,get:R??l.get})}const h={bubble:{},capture:{}},u={};function m(){const k=function(R){const{type:$,eventPhase:P,bubbles:I}=R,V=hs(R);if(P===2)return;const A=P===1?"capture":"bubble";let L=V;const D=[];for(;L===null&&(L=window),D.push(L),L!==window;)L=L.parentNode||null;const ee=h.capture[$],E=h.bubble[$];if(s(R,"stopPropagation",n),s(R,"stopImmediatePropagation",r),d(R,c),A==="capture"){if(ee===void 0)return;for(let N=D.length-1;N>=0&&!t.has(R);--N){const H=D[N],q=ee.get(H);if(q!==void 0){a.set(R,H);for(const Y of q){if(e.has(R))break;Y(R)}}if(N===0&&!I&&E!==void 0){const Y=E.get(H);if(Y!==void 0)for(const F of Y){if(e.has(R))break;F(R)}}}}else if(A==="bubble"){if(E===void 0)return;for(let N=0;N<D.length&&!t.has(R);++N){const H=D[N],q=E.get(H);if(q!==void 0){a.set(R,H);for(const Y of q){if(e.has(R))break;Y(R)}}}}o(R,"stopPropagation"),o(R,"stopImmediatePropagation"),d(R)};return k.displayName="evtdUnifiedHandler",k}function g(){const k=function(R){const{type:$,eventPhase:P}=R;if(P!==2)return;const I=u[$];I!==void 0&&I.forEach(V=>V(R))};return k.displayName="evtdUnifiedWindowEventHandler",k}const f=m(),p=g();function y(k,R){const $=h[k];return $[R]===void 0&&($[R]=new Map,window.addEventListener(R,f,k==="capture")),$[R]}function b(k){return u[k]===void 0&&(u[k]=new Set,window.addEventListener(k,p)),u[k]}function _(k,R){let $=k.get(R);return $===void 0&&k.set(R,$=new Set),$}function C(k,R,$,P){const I=h[R][$];if(I!==void 0){const V=I.get(k);if(V!==void 0&&V.has(P))return!0}return!1}function S(k,R){const $=u[k];return!!($!==void 0&&$.has(R))}function v(k,R,$,P){let I;if(typeof P=="object"&&P.once===!0?I=ee=>{B(k,R,I,P),$(ee)}:I=$,q_(k,R,I,P))return;const A=P===!0||typeof P=="object"&&P.capture===!0?"capture":"bubble",L=y(A,k),D=_(L,R);if(D.has(I)||D.add(I),R===window){const ee=b(k);ee.has(I)||ee.add(I)}}function B(k,R,$,P){if(X_(k,R,$,P))return;const V=P===!0||typeof P=="object"&&P.capture===!0,A=V?"capture":"bubble",L=y(A,k),D=_(L,R);if(R===window&&!C(R,V?"bubble":"capture",k,$)&&S(k,$)){const E=u[k];E.delete($),E.size===0&&(window.removeEventListener(k,p),u[k]=void 0)}D.has($)&&D.delete($),D.size===0&&L.delete(R),L.size===0&&(window.removeEventListener(k,f,A==="capture"),h[A][k]=void 0)}return{on:v,off:B}}const{on:kt,off:et}=Y_(),Hi="@@mmoContext",U_={mounted(t,{value:e}){t[Hi]={handler:void 0},typeof e=="function"&&(t[Hi].handler=e,kt("mousemoveoutside",t,e))},updated(t,{value:e}){const n=t[Hi];typeof e=="function"?n.handler?n.handler!==e&&(et("mousemoveoutside",t,n.handler),n.handler=e,kt("mousemoveoutside",t,e)):(t[Hi].handler=e,kt("mousemoveoutside",t,e)):n.handler&&(et("mousemoveoutside",t,n.handler),n.handler=void 0)},unmounted(t){const{handler:e}=t[Hi];e&&et("mousemoveoutside",t,e),t[Hi].handler=void 0}},Wi="@@coContext",us={mounted(t,{value:e,modifiers:n}){t[Wi]={handler:void 0},typeof e=="function"&&(t[Wi].handler=e,kt("clickoutside",t,e,{capture:n.capture}))},updated(t,{value:e,modifiers:n}){const r=t[Wi];typeof e=="function"?r.handler?r.handler!==e&&(et("clickoutside",t,r.handler,{capture:n.capture}),r.handler=e,kt("clickoutside",t,e,{capture:n.capture})):(t[Wi].handler=e,kt("clickoutside",t,e,{capture:n.capture})):r.handler&&(et("clickoutside",t,r.handler,{capture:n.capture}),r.handler=void 0)},unmounted(t,{modifiers:e}){const{handler:n}=t[Wi];n&&et("clickoutside",t,n,{capture:e.capture}),t[Wi].handler=void 0}};function G_(t,e){console.error(`[vdirs/${t}]: ${e}`)}class K_{constructor(){this.elementZIndex=new Map,this.nextZIndex=2e3}get elementCount(){return this.elementZIndex.size}ensureZIndex(e,n){const{elementZIndex:r}=this;if(n!==void 0){e.style.zIndex=`${n}`,r.delete(e);return}const{nextZIndex:s}=this;r.has(e)&&r.get(e)+1===this.nextZIndex||(e.style.zIndex=`${s}`,r.set(e,s),this.nextZIndex=s+1,this.squashState())}unregister(e,n){const{elementZIndex:r}=this;r.has(e)?r.delete(e):n===void 0&&G_("z-index-manager/unregister-element","Element not found when unregistering."),this.squashState()}squashState(){const{elementCount:e}=this;e||(this.nextZIndex=2e3),this.nextZIndex-e>2500&&this.rearrange()}rearrange(){const e=Array.from(this.elementZIndex.entries());e.sort((n,r)=>n[1]-r[1]),this.nextZIndex=2e3,e.forEach(n=>{const r=n[0],s=this.nextZIndex++;`${s}`!==r.style.zIndex&&(r.style.zIndex=`${s}`)})}}const Do=new K_,ji="@@ziContext",Wd={mounted(t,e){const{value:n={}}=e,{zIndex:r,enabled:s}=n;t[ji]={enabled:!!s,initialized:!1},s&&(Do.ensureZIndex(t,r),t[ji].initialized=!0)},updated(t,e){const{value:n={}}=e,{zIndex:r,enabled:s}=n,o=t[ji].enabled;s&&!o&&(Do.ensureZIndex(t,r),t[ji].initialized=!0),t[ji].enabled=!!s},unmounted(t,e){if(!t[ji].initialized)return;const{value:n={}}=e,{zIndex:r}=n;Do.unregister(t,r)}};function Z_(t){const e=i.ref(!!t.value);if(e.value)return i.readonly(e);const n=i.watch(t,r=>{r&&(e.value=!0,n())});return i.readonly(e)}function Wt(t){const e=i.computed(t),n=i.ref(e.value);return i.watch(e,r=>{n.value=r}),typeof t=="function"?n:{__v_isRef:!0,get value(){return n.value},set value(r){t.set(r)}}}const Q_=typeof window<"u";let qi,fr;(()=>{var t,e;qi=Q_?(e=(t=document)===null||t===void 0?void 0:t.fonts)===null||e===void 0?void 0:e.ready:void 0,fr=!1,qi!==void 0?qi.then(()=>{fr=!0}):fr=!0})();function J_(t){if(fr)return;let e=!1;i.onMounted(()=>{fr||qi==null||qi.then(()=>{e||t()})}),i.onBeforeUnmount(()=>{e=!0})}function Ho(t,e){return i.watch(t,n=>{n!==void 0&&(e.value=n)}),i.computed(()=>t.value===void 0?e.value:t.value)}function fs(){const t=i.ref(!1);return i.onMounted(()=>{t.value=!0}),i.readonly(t)}function jd(t,e){return i.computed(()=>{for(const n of e)if(t[n]!==void 0)return t[n];return t[e[e.length-1]]})}const e1=(typeof window>"u"?!1:/iPad|iPhone|iPod/.test(navigator.platform)||navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1)&&!window.MSStream;function t1(){return e1}function Wo(t,e,n="default"){const r=e[n];if(r===void 0)throw new Error(`[vueuc/${t}]: slot[${n}] is empty.`);return r()}function jo(t,e=!0,n=[]){return t.forEach(r=>{if(r!==null){if(typeof r!="object"){(typeof r=="string"||typeof r=="number")&&n.push(i.createTextVNode(String(r)));return}if(Array.isArray(r)){jo(r,e,n);return}if(r.type===i.Fragment){if(r.children===null)return;Array.isArray(r.children)&&jo(r.children,e,n)}else r.type!==i.Comment&&n.push(r)}}),n}function qd(t,e,n="default"){const r=e[n];if(r===void 0)throw new Error(`[vueuc/${t}]: slot[${n}] is empty.`);const s=jo(r());if(s.length===1)return s[0];throw new Error(`[vueuc/${t}]: slot[${n}] should have exactly one child.`)}let Hn=null;function Xd(){if(Hn===null&&(Hn=document.getElementById("v-binder-view-measurer"),Hn===null)){Hn=document.createElement("div"),Hn.id="v-binder-view-measurer";const{style:t}=Hn;t.position="fixed",t.left="0",t.right="0",t.top="0",t.bottom="0",t.pointerEvents="none",t.visibility="hidden",document.body.appendChild(Hn)}return Hn.getBoundingClientRect()}function n1(t,e){const n=Xd();return{top:e,left:t,height:0,width:0,right:n.width-t,bottom:n.height-e}}function qo(t){const e=t.getBoundingClientRect(),n=Xd();return{left:e.left-n.left,top:e.top-n.top,bottom:n.height+n.top-e.bottom,right:n.width+n.left-e.right,width:e.width,height:e.height}}function i1(t){return t.nodeType===9?null:t.parentNode}function Yd(t){if(t===null)return null;const e=i1(t);if(e===null)return null;if(e.nodeType===9)return document;if(e.nodeType===1){const{overflow:n,overflowX:r,overflowY:s}=getComputedStyle(e);if(/(auto|scroll|overlay)/.test(n+s+r))return e}return Yd(e)}const Ud=i.defineComponent({name:"Binder",props:{syncTargetWithParent:Boolean,syncTarget:{type:Boolean,default:!0}},setup(t){var e;i.provide("VBinder",(e=i.getCurrentInstance())===null||e===void 0?void 0:e.proxy);const n=i.inject("VBinder",null),r=i.ref(null),s=b=>{r.value=b,n&&t.syncTargetWithParent&&n.setTargetRef(b)};let o=[];const a=()=>{let b=r.value;for(;b=Yd(b),b!==null;)o.push(b);for(const _ of o)kt("scroll",_,u,!0)},l=()=>{for(const b of o)et("scroll",b,u,!0);o=[]},c=new Set,d=b=>{c.size===0&&a(),c.has(b)||c.add(b)},h=b=>{c.has(b)&&c.delete(b),c.size===0&&l()},u=()=>{Pd(m)},m=()=>{c.forEach(b=>b())},g=new Set,f=b=>{g.size===0&&kt("resize",window,y),g.has(b)||g.add(b)},p=b=>{g.has(b)&&g.delete(b),g.size===0&&et("resize",window,y)},y=()=>{g.forEach(b=>b())};return i.onBeforeUnmount(()=>{et("resize",window,y),l()}),{targetRef:r,setTargetRef:s,addScrollListener:d,removeScrollListener:h,addResizeListener:f,removeResizeListener:p}},render(){return Wo("binder",this.$slots)}}),Gd=i.defineComponent({name:"Target",setup(){const{setTargetRef:t,syncTarget:e}=i.inject("VBinder");return{syncTarget:e,setTargetDirective:{mounted:t,updated:t}}},render(){const{syncTarget:t,setTargetDirective:e}=this;return t?i.withDirectives(qd("follower",this.$slots),[[e]]):qd("follower",this.$slots)}}),r1="@css-render/vue3-ssr";function s1(t,e){return`<style cssr-id="${t}">
104
104
  ${e}
105
- </style>`}function X_(t,e,n){const{styles:r,ids:s}=n;s.has(t)||r!==null&&(s.add(t),r.push(q_(t,e)))}const Y_=typeof document<"u";function li(){if(Y_)return;const t=i.inject(j_,null);if(t!==null)return{adapter:(e,n)=>X_(e,n,t),context:t}}function Kd(t,e){console.error(`[vueuc/${t}]: ${e}`)}function U_(t){let e=0;for(let n=0;n<t.length;++n)t[n]==="&"&&++e;return e}const Zd=/\s*,(?![^(]*\))\s*/g,G_=/\s+/g;function K_(t,e){const n=[];return e.split(Zd).forEach(r=>{let s=U_(r);if(s){if(s===1){t.forEach(a=>{n.push(r.replace("&",a))});return}}else{t.forEach(a=>{n.push((a&&a+" ")+r)});return}let o=[r];for(;s--;){const a=[];o.forEach(l=>{t.forEach(c=>{a.push(l.replace("&",c))})}),o=a}o.forEach(a=>n.push(a))}),n}function Z_(t,e){const n=[];return e.split(Zd).forEach(r=>{t.forEach(s=>{n.push((s&&s+" ")+r)})}),n}function J_(t){let e=[""];return t.forEach(n=>{n=n&&n.trim(),n&&(n.includes("&")?e=K_(e,n):e=Z_(e,n))}),e.join(", ").replace(G_," ")}function Jd(t){if(!t)return;const e=t.parentElement;e&&e.removeChild(t)}function gs(t,e){return(e??document.head).querySelector(`style[cssr-id="${t}"]`)}function Q_(t){const e=document.createElement("style");return e.setAttribute("cssr-id",t),e}function ms(t){return t?/^\s*@(s|m)/.test(t):!1}const e1=/[A-Z]/g;function Qd(t){return t.replace(e1,e=>"-"+e.toLowerCase())}function t1(t,e=" "){return typeof t=="object"&&t!==null?` {
106
- `+Object.entries(t).map(n=>e+` ${Qd(n[0])}: ${n[1]};`).join(`
105
+ </style>`}function o1(t,e,n){const{styles:r,ids:s}=n;s.has(t)||r!==null&&(s.add(t),r.push(s1(t,e)))}const a1=typeof document<"u";function ci(){if(a1)return;const t=i.inject(r1,null);if(t!==null)return{adapter:(e,n)=>o1(e,n,t),context:t}}function Kd(t,e){console.error(`[vueuc/${t}]: ${e}`)}function l1(t){let e=0;for(let n=0;n<t.length;++n)t[n]==="&"&&++e;return e}const Zd=/\s*,(?![^(]*\))\s*/g,c1=/\s+/g;function d1(t,e){const n=[];return e.split(Zd).forEach(r=>{let s=l1(r);if(s){if(s===1){t.forEach(a=>{n.push(r.replace("&",a))});return}}else{t.forEach(a=>{n.push((a&&a+" ")+r)});return}let o=[r];for(;s--;){const a=[];o.forEach(l=>{t.forEach(c=>{a.push(l.replace("&",c))})}),o=a}o.forEach(a=>n.push(a))}),n}function h1(t,e){const n=[];return e.split(Zd).forEach(r=>{t.forEach(s=>{n.push((s&&s+" ")+r)})}),n}function u1(t){let e=[""];return t.forEach(n=>{n=n&&n.trim(),n&&(n.includes("&")?e=d1(e,n):e=h1(e,n))}),e.join(", ").replace(c1," ")}function Qd(t){if(!t)return;const e=t.parentElement;e&&e.removeChild(t)}function gs(t,e){return(e??document.head).querySelector(`style[cssr-id="${t}"]`)}function f1(t){const e=document.createElement("style");return e.setAttribute("cssr-id",t),e}function ms(t){return t?/^\s*@(s|m)/.test(t):!1}const g1=/[A-Z]/g;function Jd(t){return t.replace(g1,e=>"-"+e.toLowerCase())}function m1(t,e=" "){return typeof t=="object"&&t!==null?` {
106
+ `+Object.entries(t).map(n=>e+` ${Jd(n[0])}: ${n[1]};`).join(`
107
107
  `)+`
108
- `+e+"}":`: ${t};`}function n1(t,e,n){return typeof t=="function"?t({context:e.context,props:n}):t}function eh(t,e,n,r){if(!e)return"";const s=n1(e,n,r);if(!s)return"";if(typeof s=="string")return`${t} {
108
+ `+e+"}":`: ${t};`}function p1(t,e,n){return typeof t=="function"?t({context:e.context,props:n}):t}function eh(t,e,n,r){if(!e)return"";const s=p1(e,n,r);if(!s)return"";if(typeof s=="string")return`${t} {
109
109
  ${s}
110
110
  }`;const o=Object.keys(s);if(o.length===0)return n.config.keepEmptyBlock?t+` {
111
111
  }`:"";const a=t?[t+" {"]:[];return o.forEach(l=>{const c=s[l];if(l==="raw"){a.push(`
112
112
  `+c+`
113
- `);return}l=Qd(l),c!=null&&a.push(` ${l}${t1(c)}`)}),t&&a.push("}"),a.join(`
114
- `)}function Xo(t,e,n){t&&t.forEach(r=>{if(Array.isArray(r))Xo(r,e,n);else if(typeof r=="function"){const s=r(e);Array.isArray(s)?Xo(s,e,n):s&&n(s)}else r&&n(r)})}function th(t,e,n,r,s){const o=t.$;let a="";if(!o||typeof o=="string")ms(o)?a=o:e.push(o);else if(typeof o=="function"){const d=o({context:r.context,props:s});ms(d)?a=d:e.push(d)}else if(o.before&&o.before(r.context),!o.$||typeof o.$=="string")ms(o.$)?a=o.$:e.push(o.$);else if(o.$){const d=o.$({context:r.context,props:s});ms(d)?a=d:e.push(d)}const l=J_(e),c=eh(l,t.props,r,s);a?n.push(`${a} {`):c.length&&n.push(c),t.children&&Xo(t.children,{context:r.context,props:s},d=>{if(typeof d=="string"){const h=eh(l,{raw:d},r,s);n.push(h)}else th(d,e,n,r,s)}),e.pop(),a&&n.push("}"),o&&o.after&&o.after(r.context)}function i1(t,e,n){const r=[];return th(t,[],r,e,n),r.join(`
113
+ `);return}l=Jd(l),c!=null&&a.push(` ${l}${m1(c)}`)}),t&&a.push("}"),a.join(`
114
+ `)}function Xo(t,e,n){t&&t.forEach(r=>{if(Array.isArray(r))Xo(r,e,n);else if(typeof r=="function"){const s=r(e);Array.isArray(s)?Xo(s,e,n):s&&n(s)}else r&&n(r)})}function th(t,e,n,r,s){const o=t.$;let a="";if(!o||typeof o=="string")ms(o)?a=o:e.push(o);else if(typeof o=="function"){const d=o({context:r.context,props:s});ms(d)?a=d:e.push(d)}else if(o.before&&o.before(r.context),!o.$||typeof o.$=="string")ms(o.$)?a=o.$:e.push(o.$);else if(o.$){const d=o.$({context:r.context,props:s});ms(d)?a=d:e.push(d)}const l=u1(e),c=eh(l,t.props,r,s);a?n.push(`${a} {`):c.length&&n.push(c),t.children&&Xo(t.children,{context:r.context,props:s},d=>{if(typeof d=="string"){const h=eh(l,{raw:d},r,s);n.push(h)}else th(d,e,n,r,s)}),e.pop(),a&&n.push("}"),o&&o.after&&o.after(r.context)}function y1(t,e,n){const r=[];return th(t,[],r,e,n),r.join(`
115
115
 
116
- `)}function Yo(t){for(var e=0,n,r=0,s=t.length;s>=4;++r,s-=4)n=t.charCodeAt(r)&255|(t.charCodeAt(++r)&255)<<8|(t.charCodeAt(++r)&255)<<16|(t.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,e=(n&65535)*1540483477+((n>>>16)*59797<<16)^(e&65535)*1540483477+((e>>>16)*59797<<16);switch(s){case 3:e^=(t.charCodeAt(r+2)&255)<<16;case 2:e^=(t.charCodeAt(r+1)&255)<<8;case 1:e^=t.charCodeAt(r)&255,e=(e&65535)*1540483477+((e>>>16)*59797<<16)}return e^=e>>>13,e=(e&65535)*1540483477+((e>>>16)*59797<<16),((e^e>>>15)>>>0).toString(36)}typeof window<"u"&&(window.__cssrContext={});function r1(t,e,n,r){const{els:s}=e;if(n===void 0)s.forEach(Jd),e.els=[];else{const o=gs(n,r);o&&s.includes(o)&&(Jd(o),e.els=s.filter(a=>a!==o))}}function nh(t,e){t.push(e)}function s1(t,e,n,r,s,o,a,l,c){let d;if(n===void 0&&(d=e.render(r),n=Yo(d)),c){c.adapter(n,d??e.render(r));return}l===void 0&&(l=document.head);const h=gs(n,l);if(h!==null&&!o)return h;const u=h??Q_(n);if(d===void 0&&(d=e.render(r)),u.textContent=d,h!==null)return h;if(a){const m=l.querySelector(`meta[name="${a}"]`);if(m)return l.insertBefore(u,m),nh(e.els,u),u}return s?l.insertBefore(u,l.querySelector("style, link")):l.appendChild(u),nh(e.els,u),u}function o1(t){return i1(this,this.instance,t)}function a1(t={}){const{id:e,ssr:n,props:r,head:s=!1,force:o=!1,anchorMetaName:a,parent:l}=t;return s1(this.instance,this,e,r,s,o,a,l,n)}function l1(t={}){const{id:e,parent:n}=t;r1(this.instance,this,e,n)}const ps=function(t,e,n,r){return{instance:t,$:e,props:n,children:r,els:[],render:o1,mount:a1,unmount:l1}},c1=function(t,e,n,r){return Array.isArray(e)?ps(t,{$:null},null,e):Array.isArray(n)?ps(t,e,null,n):Array.isArray(r)?ps(t,e,n,r):ps(t,e,n,null)};function ih(t={}){const e={c:(...n)=>c1(e,...n),use:(n,...r)=>n.install(e,...r),find:gs,context:{},config:t};return e}function d1(t,e){if(t===void 0)return!1;if(e){const{context:{ids:n}}=e;return n.has(t)}return gs(t)!==null}const{c:Hn}=ih(),Uo="vueuc-style";function rh(t){return t&-t}class sh{constructor(e,n){this.l=e,this.min=n;const r=new Array(e+1);for(let s=0;s<e+1;++s)r[s]=0;this.ft=r}add(e,n){if(n===0)return;const{l:r,ft:s}=this;for(e+=1;e<=r;)s[e]+=n,e+=rh(e)}get(e){return this.sum(e+1)-this.sum(e)}sum(e){if(e===void 0&&(e=this.l),e<=0)return 0;const{ft:n,min:r,l:s}=this;if(e>s)throw new Error("[FinweckTree.sum]: `i` is larger than length.");let o=e*r;for(;e>0;)o+=n[e],e-=rh(e);return o}getBound(e){let n=0,r=this.l;for(;r>n;){const s=Math.floor((n+r)/2),o=this.sum(s);if(o>e){r=s;continue}else if(o<e){if(n===s)return this.sum(n+1)<=e?n+1:s;n=s}else return s}return n}}function oh(t){return typeof t=="string"?document.querySelector(t):t()||null}const h1=i.defineComponent({name:"LazyTeleport",props:{to:{type:[String,Object],default:void 0},disabled:Boolean,show:{type:Boolean,required:!0}},setup(t){return{showTeleport:V_(i.toRef(t,"show")),mergedTo:i.computed(()=>{const{to:e}=t;return e??"body"})}},render(){return this.showTeleport?this.disabled?Wo("lazy-teleport",this.$slots):i.h(i.Teleport,{disabled:this.disabled,to:this.mergedTo},Wo("lazy-teleport",this.$slots)):null}}),ys={top:"bottom",bottom:"top",left:"right",right:"left"},ah={start:"end",center:"center",end:"start"},Go={top:"height",bottom:"height",left:"width",right:"width"},u1={"bottom-start":"top left",bottom:"top center","bottom-end":"top right","top-start":"bottom left",top:"bottom center","top-end":"bottom right","right-start":"top left",right:"center left","right-end":"bottom left","left-start":"top right",left:"center right","left-end":"bottom right"},f1={"bottom-start":"bottom left",bottom:"bottom center","bottom-end":"bottom right","top-start":"top left",top:"top center","top-end":"top right","right-start":"top right",right:"center right","right-end":"bottom right","left-start":"top left",left:"center left","left-end":"bottom left"},g1={"bottom-start":"right","bottom-end":"left","top-start":"right","top-end":"left","right-start":"bottom","right-end":"top","left-start":"bottom","left-end":"top"},lh={top:!0,bottom:!1,left:!0,right:!1},ch={top:"end",bottom:"start",left:"end",right:"start"};function m1(t,e,n,r,s,o){if(!s||o)return{placement:t,top:0,left:0};const[a,l]=t.split("-");let c=l??"center",d={top:0,left:0};const h=(f,g,p)=>{let b=0,y=0;const _=n[f]-e[g]-e[f];return _>0&&r&&(p?y=lh[g]?_:-_:b=lh[g]?_:-_),{left:b,top:y}},u=a==="left"||a==="right";if(c!=="center"){const f=g1[t],g=ys[f],p=Go[f];if(n[p]>e[p]){if(e[f]+e[p]<n[p]){const b=(n[p]-e[p])/2;e[f]<b||e[g]<b?e[f]<e[g]?(c=ah[l],d=h(p,g,u)):d=h(p,f,u):c="center"}}else n[p]<e[p]&&e[g]<0&&e[f]>e[g]&&(c=ah[l])}else{const f=a==="bottom"||a==="top"?"left":"top",g=ys[f],p=Go[f],b=(n[p]-e[p])/2;(e[f]<b||e[g]<b)&&(e[f]>e[g]?(c=ch[f],d=h(p,f,u)):(c=ch[g],d=h(p,g,u)))}let m=a;return e[a]<n[Go[a]]&&e[a]<e[ys[a]]&&(m=ys[a]),{placement:c!=="center"?`${m}-${c}`:m,left:d.left,top:d.top}}function p1(t,e){return e?f1[t]:u1[t]}function y1(t,e,n,r,s,o){if(o)switch(t){case"bottom-start":return{top:`${Math.round(n.top-e.top+n.height)}px`,left:`${Math.round(n.left-e.left)}px`,transform:"translateY(-100%)"};case"bottom-end":return{top:`${Math.round(n.top-e.top+n.height)}px`,left:`${Math.round(n.left-e.left+n.width)}px`,transform:"translateX(-100%) translateY(-100%)"};case"top-start":return{top:`${Math.round(n.top-e.top)}px`,left:`${Math.round(n.left-e.left)}px`,transform:""};case"top-end":return{top:`${Math.round(n.top-e.top)}px`,left:`${Math.round(n.left-e.left+n.width)}px`,transform:"translateX(-100%)"};case"right-start":return{top:`${Math.round(n.top-e.top)}px`,left:`${Math.round(n.left-e.left+n.width)}px`,transform:"translateX(-100%)"};case"right-end":return{top:`${Math.round(n.top-e.top+n.height)}px`,left:`${Math.round(n.left-e.left+n.width)}px`,transform:"translateX(-100%) translateY(-100%)"};case"left-start":return{top:`${Math.round(n.top-e.top)}px`,left:`${Math.round(n.left-e.left)}px`,transform:""};case"left-end":return{top:`${Math.round(n.top-e.top+n.height)}px`,left:`${Math.round(n.left-e.left)}px`,transform:"translateY(-100%)"};case"top":return{top:`${Math.round(n.top-e.top)}px`,left:`${Math.round(n.left-e.left+n.width/2)}px`,transform:"translateX(-50%)"};case"right":return{top:`${Math.round(n.top-e.top+n.height/2)}px`,left:`${Math.round(n.left-e.left+n.width)}px`,transform:"translateX(-100%) translateY(-50%)"};case"left":return{top:`${Math.round(n.top-e.top+n.height/2)}px`,left:`${Math.round(n.left-e.left)}px`,transform:"translateY(-50%)"};case"bottom":default:return{top:`${Math.round(n.top-e.top+n.height)}px`,left:`${Math.round(n.left-e.left+n.width/2)}px`,transform:"translateX(-50%) translateY(-100%)"}}switch(t){case"bottom-start":return{top:`${Math.round(n.top-e.top+n.height+r)}px`,left:`${Math.round(n.left-e.left+s)}px`,transform:""};case"bottom-end":return{top:`${Math.round(n.top-e.top+n.height+r)}px`,left:`${Math.round(n.left-e.left+n.width+s)}px`,transform:"translateX(-100%)"};case"top-start":return{top:`${Math.round(n.top-e.top+r)}px`,left:`${Math.round(n.left-e.left+s)}px`,transform:"translateY(-100%)"};case"top-end":return{top:`${Math.round(n.top-e.top+r)}px`,left:`${Math.round(n.left-e.left+n.width+s)}px`,transform:"translateX(-100%) translateY(-100%)"};case"right-start":return{top:`${Math.round(n.top-e.top+r)}px`,left:`${Math.round(n.left-e.left+n.width+s)}px`,transform:""};case"right-end":return{top:`${Math.round(n.top-e.top+n.height+r)}px`,left:`${Math.round(n.left-e.left+n.width+s)}px`,transform:"translateY(-100%)"};case"left-start":return{top:`${Math.round(n.top-e.top+r)}px`,left:`${Math.round(n.left-e.left+s)}px`,transform:"translateX(-100%)"};case"left-end":return{top:`${Math.round(n.top-e.top+n.height+r)}px`,left:`${Math.round(n.left-e.left+s)}px`,transform:"translateX(-100%) translateY(-100%)"};case"top":return{top:`${Math.round(n.top-e.top+r)}px`,left:`${Math.round(n.left-e.left+n.width/2+s)}px`,transform:"translateY(-100%) translateX(-50%)"};case"right":return{top:`${Math.round(n.top-e.top+n.height/2+r)}px`,left:`${Math.round(n.left-e.left+n.width+s)}px`,transform:"translateY(-50%)"};case"left":return{top:`${Math.round(n.top-e.top+n.height/2+r)}px`,left:`${Math.round(n.left-e.left+s)}px`,transform:"translateY(-50%) translateX(-100%)"};case"bottom":default:return{top:`${Math.round(n.top-e.top+n.height+r)}px`,left:`${Math.round(n.left-e.left+n.width/2+s)}px`,transform:"translateX(-50%)"}}}const b1=Hn([Hn(".v-binder-follower-container",{position:"absolute",left:"0",right:"0",top:"0",height:"0",pointerEvents:"none",zIndex:"auto"}),Hn(".v-binder-follower-content",{position:"absolute",zIndex:"auto"},[Hn("> *",{pointerEvents:"all"})])]),dh=i.defineComponent({name:"Follower",inheritAttrs:!1,props:{show:Boolean,enabled:{type:Boolean,default:void 0},placement:{type:String,default:"bottom"},syncTrigger:{type:Array,default:["resize","scroll"]},to:[String,Object],flip:{type:Boolean,default:!0},internalShift:Boolean,x:Number,y:Number,width:String,minWidth:String,containerClass:String,teleportDisabled:Boolean,zindexable:{type:Boolean,default:!0},zIndex:Number,overlap:Boolean},setup(t){const e=i.inject("VBinder"),n=jt(()=>t.enabled!==void 0?t.enabled:t.show),r=i.ref(null),s=i.ref(null),o=()=>{const{syncTrigger:m}=t;m.includes("scroll")&&e.addScrollListener(c),m.includes("resize")&&e.addResizeListener(c)},a=()=>{e.removeScrollListener(c),e.removeResizeListener(c)};i.onMounted(()=>{n.value&&(c(),o())});const l=li();b1.mount({id:"vueuc/binder",head:!0,anchorMetaName:Uo,ssr:l}),i.onBeforeUnmount(()=>{a()}),z_(()=>{n.value&&c()});const c=()=>{if(!n.value)return;const m=r.value;if(m===null)return;const f=e.targetRef,{x:g,y:p,overlap:b}=t,y=g!==void 0&&p!==void 0?H_(g,p):qo(f);m.style.setProperty("--v-target-width",`${Math.round(y.width)}px`),m.style.setProperty("--v-target-height",`${Math.round(y.height)}px`);const{width:_,minWidth:S,placement:C,internalShift:v,flip:B}=t;m.setAttribute("v-placement",C),b?m.setAttribute("v-overlap",""):m.removeAttribute("v-overlap");const{style:k}=m;_==="target"?k.width=`${y.width}px`:_!==void 0?k.width=_:k.width="",S==="target"?k.minWidth=`${y.width}px`:S!==void 0?k.minWidth=S:k.minWidth="";const R=qo(m),$=qo(s.value),{left:F,top:D,placement:L}=m1(C,y,R,v,B,b),M=p1(L,b),{left:z,top:O,transform:ne}=y1(L,$,y,D,F,b);m.setAttribute("v-placement",L),m.style.setProperty("--v-offset-left",`${Math.round(F)}px`),m.style.setProperty("--v-offset-top",`${Math.round(D)}px`),m.style.transform=`translateX(${z}) translateY(${O}) ${ne}`,m.style.setProperty("--v-transform-origin",M),m.style.transformOrigin=M};i.watch(n,m=>{m?(o(),d()):a()});const d=()=>{i.nextTick().then(c).catch(m=>console.error(m))};["placement","x","y","internalShift","flip","width","overlap","minWidth"].forEach(m=>{i.watch(i.toRef(t,m),c)}),["teleportDisabled"].forEach(m=>{i.watch(i.toRef(t,m),d)}),i.watch(i.toRef(t,"syncTrigger"),m=>{m.includes("resize")?e.addResizeListener(c):e.removeResizeListener(c),m.includes("scroll")?e.addScrollListener(c):e.removeScrollListener(c)});const h=fs(),u=jt(()=>{const{to:m}=t;if(m!==void 0)return m;h.value});return{VBinder:e,mergedEnabled:n,offsetContainerRef:s,followerRef:r,mergedTo:u,syncPosition:c}},render(){return i.h(h1,{show:this.show,to:this.mergedTo,disabled:this.teleportDisabled},{default:()=>{var t,e;const n=i.h("div",{class:["v-binder-follower-container",this.containerClass],ref:"offsetContainerRef"},[i.h("div",{class:"v-binder-follower-content",ref:"followerRef"},(e=(t=this.$slots).default)===null||e===void 0?void 0:e.call(t))]);return this.zindexable?i.withDirectives(n,[[Wd,{enabled:this.mergedEnabled,zIndex:this.zIndex}]]):n}})}});var ci=[],_1=function(){return ci.some(function(t){return t.activeTargets.length>0})},w1=function(){return ci.some(function(t){return t.skippedTargets.length>0})},hh="ResizeObserver loop completed with undelivered notifications.",x1=function(){var t;typeof ErrorEvent=="function"?t=new ErrorEvent("error",{message:hh}):(t=document.createEvent("Event"),t.initEvent("error",!1,!1),t.message=hh),window.dispatchEvent(t)},fr;(function(t){t.BORDER_BOX="border-box",t.CONTENT_BOX="content-box",t.DEVICE_PIXEL_CONTENT_BOX="device-pixel-content-box"})(fr||(fr={}));var di=function(t){return Object.freeze(t)},v1=function(){function t(e,n){this.inlineSize=e,this.blockSize=n,di(this)}return t}(),uh=function(){function t(e,n,r,s){return this.x=e,this.y=n,this.width=r,this.height=s,this.top=this.y,this.left=this.x,this.bottom=this.top+this.height,this.right=this.left+this.width,di(this)}return t.prototype.toJSON=function(){var e=this,n=e.x,r=e.y,s=e.top,o=e.right,a=e.bottom,l=e.left,c=e.width,d=e.height;return{x:n,y:r,top:s,right:o,bottom:a,left:l,width:c,height:d}},t.fromRect=function(e){return new t(e.x,e.y,e.width,e.height)},t}(),Ko=function(t){return t instanceof SVGElement&&"getBBox"in t},fh=function(t){if(Ko(t)){var e=t.getBBox(),n=e.width,r=e.height;return!n&&!r}var s=t,o=s.offsetWidth,a=s.offsetHeight;return!(o||a||t.getClientRects().length)},gh=function(t){var e;if(t instanceof Element)return!0;var n=(e=t==null?void 0:t.ownerDocument)===null||e===void 0?void 0:e.defaultView;return!!(n&&t instanceof n.Element)},k1=function(t){switch(t.tagName){case"INPUT":if(t.type!=="image")break;case"VIDEO":case"AUDIO":case"EMBED":case"OBJECT":case"CANVAS":case"IFRAME":case"IMG":return!0}return!1},gr=typeof window<"u"?window:{},bs=new WeakMap,mh=/auto|scroll/,C1=/^tb|vertical/,S1=/msie|trident/i.test(gr.navigator&&gr.navigator.userAgent),un=function(t){return parseFloat(t||"0")},qi=function(t,e,n){return t===void 0&&(t=0),e===void 0&&(e=0),n===void 0&&(n=!1),new v1((n?e:t)||0,(n?t:e)||0)},ph=di({devicePixelContentBoxSize:qi(),borderBoxSize:qi(),contentBoxSize:qi(),contentRect:new uh(0,0,0,0)}),yh=function(t,e){if(e===void 0&&(e=!1),bs.has(t)&&!e)return bs.get(t);if(fh(t))return bs.set(t,ph),ph;var n=getComputedStyle(t),r=Ko(t)&&t.ownerSVGElement&&t.getBBox(),s=!S1&&n.boxSizing==="border-box",o=C1.test(n.writingMode||""),a=!r&&mh.test(n.overflowY||""),l=!r&&mh.test(n.overflowX||""),c=r?0:un(n.paddingTop),d=r?0:un(n.paddingRight),h=r?0:un(n.paddingBottom),u=r?0:un(n.paddingLeft),m=r?0:un(n.borderTopWidth),f=r?0:un(n.borderRightWidth),g=r?0:un(n.borderBottomWidth),p=r?0:un(n.borderLeftWidth),b=u+d,y=c+h,_=p+f,S=m+g,C=l?t.offsetHeight-S-t.clientHeight:0,v=a?t.offsetWidth-_-t.clientWidth:0,B=s?b+_:0,k=s?y+S:0,R=r?r.width:un(n.width)-B-v,$=r?r.height:un(n.height)-k-C,F=R+b+v+_,D=$+y+C+S,L=di({devicePixelContentBoxSize:qi(Math.round(R*devicePixelRatio),Math.round($*devicePixelRatio),o),borderBoxSize:qi(F,D,o),contentBoxSize:qi(R,$,o),contentRect:new uh(u,c,R,$)});return bs.set(t,L),L},bh=function(t,e,n){var r=yh(t,n),s=r.borderBoxSize,o=r.contentBoxSize,a=r.devicePixelContentBoxSize;switch(e){case fr.DEVICE_PIXEL_CONTENT_BOX:return a;case fr.BORDER_BOX:return s;default:return o}},B1=function(){function t(e){var n=yh(e);this.target=e,this.contentRect=n.contentRect,this.borderBoxSize=di([n.borderBoxSize]),this.contentBoxSize=di([n.contentBoxSize]),this.devicePixelContentBoxSize=di([n.devicePixelContentBoxSize])}return t}(),_h=function(t){if(fh(t))return 1/0;for(var e=0,n=t.parentNode;n;)e+=1,n=n.parentNode;return e},T1=function(){var t=1/0,e=[];ci.forEach(function(a){if(a.activeTargets.length!==0){var l=[];a.activeTargets.forEach(function(d){var h=new B1(d.target),u=_h(d.target);l.push(h),d.lastReportedSize=bh(d.target,d.observedBox),u<t&&(t=u)}),e.push(function(){a.callback.call(a.observer,l,a.observer)}),a.activeTargets.splice(0,a.activeTargets.length)}});for(var n=0,r=e;n<r.length;n++){var s=r[n];s()}return t},wh=function(t){ci.forEach(function(n){n.activeTargets.splice(0,n.activeTargets.length),n.skippedTargets.splice(0,n.skippedTargets.length),n.observationTargets.forEach(function(s){s.isActive()&&(_h(s.target)>t?n.activeTargets.push(s):n.skippedTargets.push(s))})})},R1=function(){var t=0;for(wh(t);_1();)t=T1(),wh(t);return w1()&&x1(),t>0},Zo,xh=[],$1=function(){return xh.splice(0).forEach(function(t){return t()})},E1=function(t){if(!Zo){var e=0,n=document.createTextNode(""),r={characterData:!0};new MutationObserver(function(){return $1()}).observe(n,r),Zo=function(){n.textContent="".concat(e?e--:e++)}}xh.push(t),Zo()},N1=function(t){E1(function(){requestAnimationFrame(t)})},_s=0,P1=function(){return!!_s},F1=250,M1={attributes:!0,characterData:!0,childList:!0,subtree:!0},vh=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],kh=function(t){return t===void 0&&(t=0),Date.now()+t},Jo=!1,A1=function(){function t(){var e=this;this.stopped=!0,this.listener=function(){return e.schedule()}}return t.prototype.run=function(e){var n=this;if(e===void 0&&(e=F1),!Jo){Jo=!0;var r=kh(e);N1(function(){var s=!1;try{s=R1()}finally{if(Jo=!1,e=r-kh(),!P1())return;s?n.run(1e3):e>0?n.run(e):n.start()}})}},t.prototype.schedule=function(){this.stop(),this.run()},t.prototype.observe=function(){var e=this,n=function(){return e.observer&&e.observer.observe(document.body,M1)};document.body?n():gr.addEventListener("DOMContentLoaded",n)},t.prototype.start=function(){var e=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),vh.forEach(function(n){return gr.addEventListener(n,e.listener,!0)}))},t.prototype.stop=function(){var e=this;this.stopped||(this.observer&&this.observer.disconnect(),vh.forEach(function(n){return gr.removeEventListener(n,e.listener,!0)}),this.stopped=!0)},t}(),Qo=new A1,Ch=function(t){!_s&&t>0&&Qo.start(),_s+=t,!_s&&Qo.stop()},O1=function(t){return!Ko(t)&&!k1(t)&&getComputedStyle(t).display==="inline"},V1=function(){function t(e,n){this.target=e,this.observedBox=n||fr.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return t.prototype.isActive=function(){var e=bh(this.target,this.observedBox,!0);return O1(this.target)&&(this.lastReportedSize=e),this.lastReportedSize.inlineSize!==e.inlineSize||this.lastReportedSize.blockSize!==e.blockSize},t}(),I1=function(){function t(e,n){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=e,this.callback=n}return t}(),ws=new WeakMap,Sh=function(t,e){for(var n=0;n<t.length;n+=1)if(t[n].target===e)return n;return-1},xs=function(){function t(){}return t.connect=function(e,n){var r=new I1(e,n);ws.set(e,r)},t.observe=function(e,n,r){var s=ws.get(e),o=s.observationTargets.length===0;Sh(s.observationTargets,n)<0&&(o&&ci.push(s),s.observationTargets.push(new V1(n,r&&r.box)),Ch(1),Qo.schedule())},t.unobserve=function(e,n){var r=ws.get(e),s=Sh(r.observationTargets,n),o=r.observationTargets.length===1;s>=0&&(o&&ci.splice(ci.indexOf(r),1),r.observationTargets.splice(s,1),Ch(-1))},t.disconnect=function(e){var n=this,r=ws.get(e);r.observationTargets.slice().forEach(function(s){return n.unobserve(e,s.target)}),r.activeTargets.splice(0,r.activeTargets.length)},t}(),z1=function(){function t(e){if(arguments.length===0)throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");if(typeof e!="function")throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.");xs.connect(this,e)}return t.prototype.observe=function(e,n){if(arguments.length===0)throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!gh(e))throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");xs.observe(this,e,n)},t.prototype.unobserve=function(e){if(arguments.length===0)throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!gh(e))throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");xs.unobserve(this,e)},t.prototype.disconnect=function(){xs.disconnect(this)},t.toString=function(){return"function ResizeObserver () { [polyfill code] }"},t}();class L1{constructor(){this.handleResize=this.handleResize.bind(this),this.observer=new(typeof window<"u"&&window.ResizeObserver||z1)(this.handleResize),this.elHandlersMap=new Map}handleResize(e){for(const n of e){const r=this.elHandlersMap.get(n.target);r!==void 0&&r(n)}}registerHandler(e,n){this.elHandlersMap.set(e,n),this.observer.observe(e)}unregisterHandler(e){this.elHandlersMap.has(e)&&(this.elHandlersMap.delete(e),this.observer.unobserve(e))}}const mr=new L1,vs=i.defineComponent({name:"ResizeObserver",props:{onResize:Function},setup(t){let e=!1;const n=i.getCurrentInstance().proxy;function r(s){const{onResize:o}=t;o!==void 0&&o(s)}i.onMounted(()=>{const s=n.$el;if(s===void 0){Kd("resize-observer","$el does not exist.");return}if(s.nextElementSibling!==s.nextSibling&&s.nodeType===3&&s.nodeValue!==""){Kd("resize-observer","$el can not be observed (it may be a text node).");return}s.nextElementSibling!==null&&(mr.registerHandler(s.nextElementSibling,r),e=!0)}),i.onBeforeUnmount(()=>{e&&mr.unregisterHandler(n.$el.nextElementSibling)})},render(){return i.renderSlot(this.$slots,"default")}});let ks;function D1(){return typeof document>"u"?!1:(ks===void 0&&("matchMedia"in window?ks=window.matchMedia("(pointer:coarse)").matches:ks=!1),ks)}let ea;function Bh(){return typeof document>"u"?1:(ea===void 0&&(ea="chrome"in window?window.devicePixelRatio:1),ea)}const Th="VVirtualListXScroll";function H1({columnsRef:t,renderColRef:e,renderItemWithColsRef:n}){const r=i.ref(0),s=i.ref(0),o=i.computed(()=>{const d=t.value;if(d.length===0)return null;const h=new sh(d.length,0);return d.forEach((u,m)=>{h.add(m,u.width)}),h}),a=jt(()=>{const d=o.value;return d!==null?Math.max(d.getBound(s.value)-1,0):0}),l=d=>{const h=o.value;return h!==null?h.sum(d):0},c=jt(()=>{const d=o.value;return d!==null?Math.min(d.getBound(s.value+r.value)+1,t.value.length-1):0});return i.provide(Th,{startIndexRef:a,endIndexRef:c,columnsRef:t,renderColRef:e,renderItemWithColsRef:n,getLeft:l}),{listWidthRef:r,scrollLeftRef:s}}const Rh=i.defineComponent({name:"VirtualListRow",props:{index:{type:Number,required:!0},item:{type:Object,required:!0}},setup(){const{startIndexRef:t,endIndexRef:e,columnsRef:n,getLeft:r,renderColRef:s,renderItemWithColsRef:o}=i.inject(Th);return{startIndex:t,endIndex:e,columns:n,renderCol:s,renderItemWithCols:o,getLeft:r}},render(){const{startIndex:t,endIndex:e,columns:n,renderCol:r,renderItemWithCols:s,getLeft:o,item:a}=this;if(s!=null)return s({itemIndex:this.index,startColIndex:t,endColIndex:e,allColumns:n,item:a,getLeft:o});if(r!=null){const l=[];for(let c=t;c<=e;++c){const d=n[c];l.push(r({column:d,left:o(c),item:a}))}return l}return null}}),W1=Hn(".v-vl",{maxHeight:"inherit",height:"100%",overflow:"auto",minWidth:"1px"},[Hn("&:not(.v-vl--show-scrollbar)",{scrollbarWidth:"none"},[Hn("&::-webkit-scrollbar, &::-webkit-scrollbar-track-piece, &::-webkit-scrollbar-thumb",{width:0,height:0,display:"none"})])]),j1=i.defineComponent({name:"VirtualList",inheritAttrs:!1,props:{showScrollbar:{type:Boolean,default:!0},columns:{type:Array,default:()=>[]},renderCol:Function,renderItemWithCols:Function,items:{type:Array,default:()=>[]},itemSize:{type:Number,required:!0},itemResizable:Boolean,itemsStyle:[String,Object],visibleItemsTag:{type:[String,Object],default:"div"},visibleItemsProps:Object,ignoreItemResize:Boolean,onScroll:Function,onWheel:Function,onResize:Function,defaultScrollKey:[Number,String],defaultScrollIndex:Number,keyField:{type:String,default:"key"},paddingTop:{type:[Number,String],default:0},paddingBottom:{type:[Number,String],default:0}},setup(t){const e=li();W1.mount({id:"vueuc/virtual-list",head:!0,anchorMetaName:Uo,ssr:e}),i.onMounted(()=>{const{defaultScrollIndex:M,defaultScrollKey:z}=t;M!=null?b({index:M}):z!=null&&b({key:z})});let n=!1,r=!1;i.onActivated(()=>{if(n=!1,!r){r=!0;return}b({top:f.value,left:a.value})}),i.onDeactivated(()=>{n=!0,r||(r=!0)});const s=jt(()=>{if(t.renderCol==null&&t.renderItemWithCols==null||t.columns.length===0)return;let M=0;return t.columns.forEach(z=>{M+=z.width}),M}),o=i.computed(()=>{const M=new Map,{keyField:z}=t;return t.items.forEach((O,ne)=>{M.set(O[z],ne)}),M}),{scrollLeftRef:a,listWidthRef:l}=H1({columnsRef:i.toRef(t,"columns"),renderColRef:i.toRef(t,"renderCol"),renderItemWithColsRef:i.toRef(t,"renderItemWithCols")}),c=i.ref(null),d=i.ref(void 0),h=new Map,u=i.computed(()=>{const{items:M,itemSize:z,keyField:O}=t,ne=new sh(M.length,z);return M.forEach((P,E)=>{const X=P[O],j=h.get(X);j!==void 0&&ne.add(E,j)}),ne}),m=i.ref(0),f=i.ref(0),g=jt(()=>Math.max(u.value.getBound(f.value-dr(t.paddingTop))-1,0)),p=i.computed(()=>{const{value:M}=d;if(M===void 0)return[];const{items:z,itemSize:O}=t,ne=g.value,P=Math.min(ne+Math.ceil(M/O+1),z.length-1),E=[];for(let X=ne;X<=P;++X)E.push(z[X]);return E}),b=(M,z)=>{if(typeof M=="number"){C(M,z,"auto");return}const{left:O,top:ne,index:P,key:E,position:X,behavior:j,debounce:H=!0}=M;if(O!==void 0||ne!==void 0)C(O,ne,j);else if(P!==void 0)S(P,j,H);else if(E!==void 0){const N=o.value.get(E);N!==void 0&&S(N,j,H)}else X==="bottom"?C(0,Number.MAX_SAFE_INTEGER,j):X==="top"&&C(0,0,j)};let y,_=null;function S(M,z,O){const{value:ne}=u,P=ne.sum(M)+dr(t.paddingTop);if(!O)c.value.scrollTo({left:0,top:P,behavior:z});else{y=M,_!==null&&window.clearTimeout(_),_=window.setTimeout(()=>{y=void 0,_=null},16);const{scrollTop:E,offsetHeight:X}=c.value;if(P>E){const j=ne.get(M);P+j<=E+X||c.value.scrollTo({left:0,top:P+j-X,behavior:z})}else c.value.scrollTo({left:0,top:P,behavior:z})}}function C(M,z,O){c.value.scrollTo({left:M,top:z,behavior:O})}function v(M,z){var O,ne,P;if(n||t.ignoreItemResize||L(z.target))return;const{value:E}=u,X=o.value.get(M),j=E.get(X),H=(P=(ne=(O=z.borderBoxSize)===null||O===void 0?void 0:O[0])===null||ne===void 0?void 0:ne.blockSize)!==null&&P!==void 0?P:z.contentRect.height;if(H===j)return;H-t.itemSize===0?h.delete(M):h.set(M,H-t.itemSize);const I=H-j;if(I===0)return;E.add(X,I);const J=c.value;if(J!=null){if(y===void 0){const ce=E.sum(X);J.scrollTop>ce&&J.scrollBy(0,I)}else if(X<y)J.scrollBy(0,I);else if(X===y){const ce=E.sum(X);H+ce>J.scrollTop+J.offsetHeight&&J.scrollBy(0,I)}D()}m.value++}const B=!D1();let k=!1;function R(M){var z;(z=t.onScroll)===null||z===void 0||z.call(t,M),(!B||!k)&&D()}function $(M){var z;if((z=t.onWheel)===null||z===void 0||z.call(t,M),B){const O=c.value;if(O!=null){if(M.deltaX===0&&(O.scrollTop===0&&M.deltaY<=0||O.scrollTop+O.offsetHeight>=O.scrollHeight&&M.deltaY>=0))return;M.preventDefault(),O.scrollTop+=M.deltaY/Bh(),O.scrollLeft+=M.deltaX/Bh(),D(),k=!0,Pd(()=>{k=!1})}}}function F(M){if(n||L(M.target))return;if(t.renderCol==null&&t.renderItemWithCols==null){if(M.contentRect.height===d.value)return}else if(M.contentRect.height===d.value&&M.contentRect.width===l.value)return;d.value=M.contentRect.height,l.value=M.contentRect.width;const{onResize:z}=t;z!==void 0&&z(M)}function D(){const{value:M}=c;M!=null&&(f.value=M.scrollTop,a.value=M.scrollLeft)}function L(M){let z=M;for(;z!==null;){if(z.style.display==="none")return!0;z=z.parentElement}return!1}return{listHeight:d,listStyle:{overflow:"auto"},keyToIndex:o,itemsStyle:i.computed(()=>{const{itemResizable:M}=t,z=hr(u.value.sum());return m.value,[t.itemsStyle,{boxSizing:"content-box",width:hr(s.value),height:M?"":z,minHeight:M?z:"",paddingTop:hr(t.paddingTop),paddingBottom:hr(t.paddingBottom)}]}),visibleItemsStyle:i.computed(()=>(m.value,{transform:`translateY(${hr(u.value.sum(g.value))})`})),viewportItems:p,listElRef:c,itemsElRef:i.ref(null),scrollTo:b,handleListResize:F,handleListScroll:R,handleListWheel:$,handleItemResize:v}},render(){const{itemResizable:t,keyField:e,keyToIndex:n,visibleItemsTag:r}=this;return i.h(vs,{onResize:this.handleListResize},{default:()=>{var s,o;return i.h("div",i.mergeProps(this.$attrs,{class:["v-vl",this.showScrollbar&&"v-vl--show-scrollbar"],onScroll:this.handleListScroll,onWheel:this.handleListWheel,ref:"listElRef"}),[this.items.length!==0?i.h("div",{ref:"itemsElRef",class:"v-vl-items",style:this.itemsStyle},[i.h(r,Object.assign({class:"v-vl-visible-items",style:this.visibleItemsStyle},this.visibleItemsProps),{default:()=>{const{renderCol:a,renderItemWithCols:l}=this;return this.viewportItems.map(c=>{const d=c[e],h=n.get(d),u=a!=null?i.h(Rh,{index:h,item:c}):void 0,m=l!=null?i.h(Rh,{index:h,item:c}):void 0,f=this.$slots.default({item:c,renderedCols:u,renderedItemWithCols:m,index:h})[0];return t?i.h(vs,{key:d,onResize:g=>this.handleItemResize(d,g)},{default:()=>f}):(f.key=d,f)})}})]):(o=(s=this.$slots).empty)===null||o===void 0?void 0:o.call(s)])}})}}),xn="v-hidden",q1=Hn("[v-hidden]",{display:"none!important"}),$h=i.defineComponent({name:"Overflow",props:{getCounter:Function,getTail:Function,updateCounter:Function,onUpdateCount:Function,onUpdateOverflow:Function},setup(t,{slots:e}){const n=i.ref(null),r=i.ref(null);function s(a){const{value:l}=n,{getCounter:c,getTail:d}=t;let h;if(c!==void 0?h=c():h=r.value,!l||!h)return;h.hasAttribute(xn)&&h.removeAttribute(xn);const{children:u}=l;if(a.showAllItemsBeforeCalculate)for(const S of u)S.hasAttribute(xn)&&S.removeAttribute(xn);const m=l.offsetWidth,f=[],g=e.tail?d==null?void 0:d():null;let p=g?g.offsetWidth:0,b=!1;const y=l.children.length-(e.tail?1:0);for(let S=0;S<y-1;++S){if(S<0)continue;const C=u[S];if(b){C.hasAttribute(xn)||C.setAttribute(xn,"");continue}else C.hasAttribute(xn)&&C.removeAttribute(xn);const v=C.offsetWidth;if(p+=v,f[S]=v,p>m){const{updateCounter:B}=t;for(let k=S;k>=0;--k){const R=y-1-k;B!==void 0?B(R):h.textContent=`${R}`;const $=h.offsetWidth;if(p-=f[k],p+$<=m||k===0){b=!0,S=k-1,g&&(S===-1?(g.style.maxWidth=`${m-$}px`,g.style.boxSizing="border-box"):g.style.maxWidth="");const{onUpdateCount:F}=t;F&&F(R);break}}}}const{onUpdateOverflow:_}=t;b?_!==void 0&&_(!0):(_!==void 0&&_(!1),h.setAttribute(xn,""))}const o=li();return q1.mount({id:"vueuc/overflow",head:!0,anchorMetaName:Uo,ssr:o}),i.onMounted(()=>s({showAllItemsBeforeCalculate:!1})),{selfRef:n,counterRef:r,sync:s}},render(){const{$slots:t}=this;return i.nextTick(()=>this.sync({showAllItemsBeforeCalculate:!1})),i.h("div",{class:"v-overflow",ref:"selfRef"},[i.renderSlot(t,"default"),t.counter?t.counter():i.h("span",{style:{display:"inline-block"},ref:"counterRef"}),t.tail?t.tail():null])}});function Eh(t){return t instanceof HTMLElement}function Nh(t){for(let e=0;e<t.childNodes.length;e++){const n=t.childNodes[e];if(Eh(n)&&(Fh(n)||Nh(n)))return!0}return!1}function Ph(t){for(let e=t.childNodes.length-1;e>=0;e--){const n=t.childNodes[e];if(Eh(n)&&(Fh(n)||Ph(n)))return!0}return!1}function Fh(t){if(!X1(t))return!1;try{t.focus({preventScroll:!0})}catch{}return document.activeElement===t}function X1(t){if(t.tabIndex>0||t.tabIndex===0&&t.getAttribute("tabIndex")!==null)return!0;if(t.getAttribute("disabled"))return!1;switch(t.nodeName){case"A":return!!t.href&&t.rel!=="ignore";case"INPUT":return t.type!=="hidden"&&t.type!=="file";case"SELECT":case"TEXTAREA":return!0;default:return!1}}let pr=[];const Y1=i.defineComponent({name:"FocusTrap",props:{disabled:Boolean,active:Boolean,autoFocus:{type:Boolean,default:!0},onEsc:Function,initialFocusTo:[String,Function],finalFocusTo:[String,Function],returnFocusOnDeactivated:{type:Boolean,default:!0}},setup(t){const e=t_(),n=i.ref(null),r=i.ref(null);let s=!1,o=!1;const a=typeof document>"u"?null:document.activeElement;function l(){return pr[pr.length-1]===e}function c(b){var y;b.code==="Escape"&&l()&&((y=t.onEsc)===null||y===void 0||y.call(t,b))}i.onMounted(()=>{i.watch(()=>t.active,b=>{b?(u(),Ct("keydown",document,c)):(et("keydown",document,c),s&&m())},{immediate:!0})}),i.onBeforeUnmount(()=>{et("keydown",document,c),s&&m()});function d(b){if(!o&&l()){const y=h();if(y===null||y.contains(cr(b)))return;f("first")}}function h(){const b=n.value;if(b===null)return null;let y=b;for(;y=y.nextSibling,!(y===null||y instanceof Element&&y.tagName==="DIV"););return y}function u(){var b;if(!t.disabled){if(pr.push(e),t.autoFocus){const{initialFocusTo:y}=t;y===void 0?f("first"):(b=oh(y))===null||b===void 0||b.focus({preventScroll:!0})}s=!0,document.addEventListener("focus",d,!0)}}function m(){var b;if(t.disabled||(document.removeEventListener("focus",d,!0),pr=pr.filter(_=>_!==e),l()))return;const{finalFocusTo:y}=t;y!==void 0?(b=oh(y))===null||b===void 0||b.focus({preventScroll:!0}):t.returnFocusOnDeactivated&&a instanceof HTMLElement&&(o=!0,a.focus({preventScroll:!0}),o=!1)}function f(b){if(l()&&t.active){const y=n.value,_=r.value;if(y!==null&&_!==null){const S=h();if(S==null||S===_){o=!0,y.focus({preventScroll:!0}),o=!1;return}o=!0;const C=b==="first"?Nh(S):Ph(S);o=!1,C||(o=!0,y.focus({preventScroll:!0}),o=!1)}}}function g(b){if(o)return;const y=h();y!==null&&(b.relatedTarget!==null&&y.contains(b.relatedTarget)?f("last"):f("first"))}function p(b){o||(b.relatedTarget!==null&&b.relatedTarget===n.value?f("last"):f("first"))}return{focusableStartRef:n,focusableEndRef:r,focusableStyle:"position: absolute; height: 0; width: 0;",handleStartFocus:g,handleEndFocus:p}},render(){const{default:t}=this.$slots;if(t===void 0)return null;if(this.disabled)return t();const{active:e,focusableStyle:n}=this;return i.h(i.Fragment,null,[i.h("div",{"aria-hidden":"true",tabindex:e?"0":"-1",ref:"focusableStartRef",style:n,onFocus:this.handleStartFocus}),t(),i.h("div",{"aria-hidden":"true",style:n,ref:"focusableEndRef",tabindex:e?"0":"-1",onFocus:this.handleEndFocus})])}});function W2(t){return t}const ta="n-internal-select-menu",Mh="n-internal-select-menu-body",Ah="n-drawer-body",Oh="n-modal-body",Vh="n-popover-body",Ih="__disabled__";function vn(t){const e=i.inject(Oh,null),n=i.inject(Ah,null),r=i.inject(Vh,null),s=i.inject(Mh,null),o=i.ref();if(typeof document<"u"){o.value=document.fullscreenElement;const a=()=>{o.value=document.fullscreenElement};i.onMounted(()=>{Ct("fullscreenchange",document,a)}),i.onBeforeUnmount(()=>{et("fullscreenchange",document,a)})}return jt(()=>{var a;const{to:l}=t;return l!==void 0?l===!1?Ih:l===!0?o.value||"body":l:e!=null&&e.value?(a=e.value.$el)!==null&&a!==void 0?a:e.value:n!=null&&n.value?n.value:r!=null&&r.value?r.value:s!=null&&s.value?s.value:l??(o.value||"body")})}vn.tdkey=Ih,vn.propTo={type:[String,Object,Boolean],default:void 0};function U1(t){const e={isDeactivated:!1};let n=!1;return i.onActivated(()=>{if(e.isDeactivated=!1,!n){n=!0;return}t()}),i.onDeactivated(()=>{e.isDeactivated=!0,n||(n=!0)}),e}function zh(t,e){e&&(i.onMounted(()=>{const{value:n}=t;n&&mr.registerHandler(n,e)}),i.watch(t,(n,r)=>{r&&mr.unregisterHandler(r)},{deep:!1}),i.onBeforeUnmount(()=>{const{value:n}=t;n&&mr.unregisterHandler(n)}))}function Lh(t){return t.replace(/#|\(|\)|,|\s|\./g,"_")}const G1=/^(\d|\.)+$/,Dh=/(\d|\.)+/;function na(t,{c:e=1,offset:n=0,attachPx:r=!0}={}){if(typeof t=="number"){const s=(t+n)*e;return s===0?"0":`${s}px`}else if(typeof t=="string")if(G1.test(t)){const s=(Number(t)+n)*e;return r?s===0?"0":`${s}px`:`${s}`}else{const s=Dh.exec(t);return s?t.replace(Dh,String((Number(s[0])+n)*e)):t}return t}function Hh(t){const{left:e,right:n,top:r,bottom:s}=Ut(t);return`${r} ${e} ${s} ${n}`}var Wh={};function K1(t){let e=".",n="__",r="--",s;if(t){let g=t.blockPrefix;g&&(e=g),g=t.elementPrefix,g&&(n=g),g=t.modifierPrefix,g&&(r=g)}const o={install(g){s=g.c;const p=g.context;p.bem={},p.bem.b=null,p.bem.els=null}};function a(g){let p,b;return{before(y){p=y.bem.b,b=y.bem.els,y.bem.els=null},after(y){y.bem.b=p,y.bem.els=b},$({context:y,props:_}){return g=typeof g=="string"?g:g({context:y,props:_}),y.bem.b=g,`${(_==null?void 0:_.bPrefix)||e}${y.bem.b}`}}}function l(g){let p;return{before(b){p=b.bem.els},after(b){b.bem.els=p},$({context:b,props:y}){return g=typeof g=="string"?g:g({context:b,props:y}),b.bem.els=g.split(",").map(_=>_.trim()),b.bem.els.map(_=>`${(y==null?void 0:y.bPrefix)||e}${b.bem.b}${n}${_}`).join(", ")}}}function c(g){return{$({context:p,props:b}){g=typeof g=="string"?g:g({context:p,props:b});const y=g.split(",").map(C=>C.trim());function _(C){return y.map(v=>`&${(b==null?void 0:b.bPrefix)||e}${p.bem.b}${C!==void 0?`${n}${C}`:""}${r}${v}`).join(", ")}const S=p.bem.els;if(S!==null){if(Wh.NODE_ENV!=="production"&&S.length>=2)throw Error(`[css-render/plugin-bem]: m(${g}) is invalid, using modifier inside multiple elements is not allowed`);return _(S[0])}else return _()}}}function d(g){return{$({context:p,props:b}){g=typeof g=="string"?g:g({context:p,props:b});const y=p.bem.els;if(Wh.NODE_ENV!=="production"&&y!==null&&y.length>=2)throw Error(`[css-render/plugin-bem]: notM(${g}) is invalid, using modifier inside multiple elements is not allowed`);return`&:not(${(b==null?void 0:b.bPrefix)||e}${p.bem.b}${y!==null&&y.length>0?`${n}${y[0]}`:""}${r}${g})`}}}return Object.assign(o,{cB:(...g)=>s(a(g[0]),g[1],g[2]),cE:(...g)=>s(l(g[0]),g[1],g[2]),cM:(...g)=>s(c(g[0]),g[1],g[2]),cNotM:(...g)=>s(d(g[0]),g[1],g[2])}),o}const Z1=".n-",J1="__",Q1="--",jh=ih(),qh=K1({blockPrefix:Z1,elementPrefix:J1,modifierPrefix:Q1});jh.use(qh);const{c:ae,find:q2}=jh,{cB:ge,cE:ye,cM:Ce,cNotM:Gt}=qh,ew=(...t)=>ae(">",[ge(...t)]);function Ue(t,e){return t+(e==="default"?"":e.replace(/^[a-z]/,n=>n.toUpperCase()))}let ia;function tw(){return ia===void 0&&(ia=navigator.userAgent.includes("Node.js")||navigator.userAgent.includes("jsdom")),ia}const nw=new WeakSet;function iw(t){nw.add(t)}function Xh(t){switch(typeof t){case"string":return t||void 0;case"number":return String(t);default:return}}const Yh=new Set;function Wn(t,e){const n=`[naive/${t}]: ${e}`;Yh.has(n)||(Yh.add(n),console.error(n))}function Uh(t,e){console.error(`[naive/${t}]: ${e}`)}function Gh(t,e){throw new Error(`[naive/${t}]: ${e}`)}function ft(t,...e){if(Array.isArray(t))t.forEach(n=>ft(n,...e));else return t(...e)}function ra(t,e=!0,n=[]){return t.forEach(r=>{if(r!==null){if(typeof r!="object"){(typeof r=="string"||typeof r=="number")&&n.push(i.createTextVNode(String(r)));return}if(Array.isArray(r)){ra(r,e,n);return}if(r.type===i.Fragment){if(r.children===null)return;Array.isArray(r.children)&&ra(r.children,e,n)}else{if(r.type===i.Comment&&e)return;n.push(r)}}}),n}function rw(t,e="default",n=void 0){const r=t[e];if(!r)return Uh("getFirstSlotVNode",`slot[${e}] is empty`),null;const s=ra(r(n));return s.length===1?s[0]:(Uh("getFirstSlotVNode",`slot[${e}] should have exactly one child`),null)}function sw(t,e=[],n){const r={};return e.forEach(s=>{r[s]=t[s]}),Object.assign(r,n)}function sa(t){const e=t.filter(n=>n!==void 0);if(e.length!==0)return e.length===1?e[0]:n=>{t.forEach(r=>{r&&r(n)})}}function Xi(t,...e){return typeof t=="function"?t(...e):typeof t=="string"?i.createTextVNode(t):typeof t=="number"?i.createTextVNode(String(t)):null}function Cs(t){return t.some(e=>i.isVNode(e)?!(e.type===i.Comment||e.type===i.Fragment&&!Cs(e.children)):!0)?t:null}function oa(t,e){return t&&Cs(t())||e()}function hi(t,e){const n=t&&Cs(t());return e(n||null)}function Kh(t){return!(t&&Cs(t()))}const aa=i.defineComponent({render(){var t,e;return(e=(t=this.$slots).default)===null||e===void 0?void 0:e.call(t)}}),ui="n-config-provider",ow="n";function fi(t={},e={defaultBordered:!0}){const n=i.inject(ui,null);return{inlineThemeDisabled:n==null?void 0:n.inlineThemeDisabled,mergedRtlRef:n==null?void 0:n.mergedRtlRef,mergedComponentPropsRef:n==null?void 0:n.mergedComponentPropsRef,mergedBreakpointsRef:n==null?void 0:n.mergedBreakpointsRef,mergedBorderedRef:i.computed(()=>{var r,s;const{bordered:o}=t;return o!==void 0?o:(s=(r=n==null?void 0:n.mergedBorderedRef.value)!==null&&r!==void 0?r:e.defaultBordered)!==null&&s!==void 0?s:!0}),mergedClsPrefixRef:n?n.mergedClsPrefixRef:i.shallowRef(ow),namespaceRef:i.computed(()=>n==null?void 0:n.mergedNamespaceRef.value)}}function gi(t,e,n,r){n||Gh("useThemeClass","cssVarsRef is not passed");const s=i.inject(ui,null),o=s==null?void 0:s.mergedThemeHashRef,a=s==null?void 0:s.styleMountTarget,l=i.ref(""),c=li();let d;const h=`__${t}`,u=()=>{let m=h;const f=e?e.value:void 0,g=o==null?void 0:o.value;g&&(m+=`-${g}`),f&&(m+=`-${f}`);const{themeOverrides:p,builtinThemeOverrides:b}=r;p&&(m+=`-${Yo(JSON.stringify(p))}`),b&&(m+=`-${Yo(JSON.stringify(b))}`),l.value=m,d=()=>{const y=n.value;let _="";for(const S in y)_+=`${S}: ${y[S]};`;ae(`.${m}`,_).mount({id:m,ssr:c,parent:a}),d=void 0}};return i.watchEffect(()=>{u()}),{themeClass:l,onRender:()=>{d==null||d()}}}const Zh="n-form-item";function aw(t,{defaultSize:e="medium",mergedSize:n,mergedDisabled:r}={}){const s=i.inject(Zh,null);i.provide(Zh,null);const o=i.computed(n?()=>n(s):()=>{const{size:c}=t;if(c)return c;if(s){const{mergedSize:d}=s;if(d.value!==void 0)return d.value}return e}),a=i.computed(r?()=>r(s):()=>{const{disabled:c}=t;return c!==void 0?c:s?s.disabled.value:!1}),l=i.computed(()=>{const{status:c}=t;return c||(s==null?void 0:s.mergedValidationStatus.value)});return i.onBeforeUnmount(()=>{s&&s.restoreValidation()}),{mergedSizeRef:o,mergedDisabledRef:a,mergedStatusRef:l,nTriggerFormBlur(){s&&s.handleContentBlur()},nTriggerFormChange(){s&&s.handleContentChange()},nTriggerFormFocus(){s&&s.handleContentFocus()},nTriggerFormInput(){s&&s.handleContentInput()}}}const lw={name:"en-US",global:{undo:"Undo",redo:"Redo",confirm:"Confirm",clear:"Clear"},Popconfirm:{positiveText:"Confirm",negativeText:"Cancel"},Cascader:{placeholder:"Please Select",loading:"Loading",loadingRequiredMessage:t=>`Please load all ${t}'s descendants before checking it.`},Time:{dateFormat:"yyyy-MM-dd",dateTimeFormat:"yyyy-MM-dd HH:mm:ss"},DatePicker:{yearFormat:"yyyy",monthFormat:"MMM",dayFormat:"eeeeee",yearTypeFormat:"yyyy",monthTypeFormat:"yyyy-MM",dateFormat:"yyyy-MM-dd",dateTimeFormat:"yyyy-MM-dd HH:mm:ss",quarterFormat:"yyyy-qqq",weekFormat:"YYYY-w",clear:"Clear",now:"Now",confirm:"Confirm",selectTime:"Select Time",selectDate:"Select Date",datePlaceholder:"Select Date",datetimePlaceholder:"Select Date and Time",monthPlaceholder:"Select Month",yearPlaceholder:"Select Year",quarterPlaceholder:"Select Quarter",weekPlaceholder:"Select Week",startDatePlaceholder:"Start Date",endDatePlaceholder:"End Date",startDatetimePlaceholder:"Start Date and Time",endDatetimePlaceholder:"End Date and Time",startMonthPlaceholder:"Start Month",endMonthPlaceholder:"End Month",monthBeforeYear:!0,firstDayOfWeek:6,today:"Today"},DataTable:{checkTableAll:"Select all in the table",uncheckTableAll:"Unselect all in the table",confirm:"Confirm",clear:"Clear"},LegacyTransfer:{sourceTitle:"Source",targetTitle:"Target"},Transfer:{selectAll:"Select all",unselectAll:"Unselect all",clearAll:"Clear",total:t=>`Total ${t} items`,selected:t=>`${t} items selected`},Empty:{description:"No Data"},Select:{placeholder:"Please Select"},TimePicker:{placeholder:"Select Time",positiveText:"OK",negativeText:"Cancel",now:"Now",clear:"Clear"},Pagination:{goto:"Goto",selectionSuffix:"page"},DynamicTags:{add:"Add"},Log:{loading:"Loading"},Input:{placeholder:"Please Input"},InputNumber:{placeholder:"Please Input"},DynamicInput:{create:"Create"},ThemeEditor:{title:"Theme Editor",clearAllVars:"Clear All Variables",clearSearch:"Clear Search",filterCompName:"Filter Component Name",filterVarName:"Filter Variable Name",import:"Import",export:"Export",restore:"Reset to Default"},Image:{tipPrevious:"Previous picture (←)",tipNext:"Next picture (→)",tipCounterclockwise:"Counterclockwise",tipClockwise:"Clockwise",tipZoomOut:"Zoom out",tipZoomIn:"Zoom in",tipDownload:"Download",tipClose:"Close (Esc)",tipOriginalSize:"Zoom to original size"},Heatmap:{less:"less",more:"more",monthFormat:"MMM",weekdayFormat:"eee"}};function la(t){return(e={})=>{const n=e.width?String(e.width):t.defaultWidth;return t.formats[n]||t.formats[t.defaultWidth]}}function yr(t){return(e,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let s;if(r==="formatting"&&t.formattingValues){const a=t.defaultFormattingWidth||t.defaultWidth,l=n!=null&&n.width?String(n.width):a;s=t.formattingValues[l]||t.formattingValues[a]}else{const a=t.defaultWidth,l=n!=null&&n.width?String(n.width):t.defaultWidth;s=t.values[l]||t.values[a]}const o=t.argumentCallback?t.argumentCallback(e):e;return s[o]}}function br(t){return(e,n={})=>{const r=n.width,s=r&&t.matchPatterns[r]||t.matchPatterns[t.defaultMatchWidth],o=e.match(s);if(!o)return null;const a=o[0],l=r&&t.parsePatterns[r]||t.parsePatterns[t.defaultParseWidth],c=Array.isArray(l)?dw(l,u=>u.test(a)):cw(l,u=>u.test(a));let d;d=t.valueCallback?t.valueCallback(c):c,d=n.valueCallback?n.valueCallback(d):d;const h=e.slice(a.length);return{value:d,rest:h}}}function cw(t,e){for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&e(t[n]))return n}function dw(t,e){for(let n=0;n<t.length;n++)if(e(t[n]))return n}function hw(t){return(e,n={})=>{const r=e.match(t.matchPattern);if(!r)return null;const s=r[0],o=e.match(t.parsePattern);if(!o)return null;let a=t.valueCallback?t.valueCallback(o[0]):o[0];a=n.valueCallback?n.valueCallback(a):a;const l=e.slice(s.length);return{value:a,rest:l}}}const uw={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},fw=(t,e,n)=>{let r;const s=uw[t];return typeof s=="string"?r=s:e===1?r=s.one:r=s.other.replace("{{count}}",e.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r},gw={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},mw=(t,e,n,r)=>gw[t],pw={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},yw={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},bw={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},_w={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},ww={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},xw={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},vw={ordinalNumber:(t,e)=>{const n=Number(t),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:yr({values:pw,defaultWidth:"wide"}),quarter:yr({values:yw,defaultWidth:"wide",argumentCallback:t=>t-1}),month:yr({values:bw,defaultWidth:"wide"}),day:yr({values:_w,defaultWidth:"wide"}),dayPeriod:yr({values:ww,defaultWidth:"wide",formattingValues:xw,defaultFormattingWidth:"wide"})},kw=/^(\d+)(th|st|nd|rd)?/i,Cw=/\d+/i,Sw={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},Bw={any:[/^b/i,/^(a|c)/i]},Tw={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Rw={any:[/1/i,/2/i,/3/i,/4/i]},$w={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},Ew={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},Nw={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},Pw={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},Fw={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},Mw={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},Aw={ordinalNumber:hw({matchPattern:kw,parsePattern:Cw,valueCallback:t=>parseInt(t,10)}),era:br({matchPatterns:Sw,defaultMatchWidth:"wide",parsePatterns:Bw,defaultParseWidth:"any"}),quarter:br({matchPatterns:Tw,defaultMatchWidth:"wide",parsePatterns:Rw,defaultParseWidth:"any",valueCallback:t=>t+1}),month:br({matchPatterns:$w,defaultMatchWidth:"wide",parsePatterns:Ew,defaultParseWidth:"any"}),day:br({matchPatterns:Nw,defaultMatchWidth:"wide",parsePatterns:Pw,defaultParseWidth:"any"}),dayPeriod:br({matchPatterns:Fw,defaultMatchWidth:"any",parsePatterns:Mw,defaultParseWidth:"any"})},Ow={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Vw={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Iw={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},zw={date:la({formats:Ow,defaultWidth:"full"}),time:la({formats:Vw,defaultWidth:"full"}),dateTime:la({formats:Iw,defaultWidth:"full"})},Lw={name:"en-US",locale:{code:"en-US",formatDistance:fw,formatLong:zw,formatRelative:mw,localize:vw,match:Aw,options:{weekStartsOn:0,firstWeekContainsDate:1}}};function Jh(t){const{mergedLocaleRef:e,mergedDateLocaleRef:n}=i.inject(ui,null)||{},r=i.computed(()=>{var o,a;return(a=(o=e==null?void 0:e.value)===null||o===void 0?void 0:o[t])!==null&&a!==void 0?a:lw[t]});return{dateLocaleRef:i.computed(()=>{var o;return(o=n==null?void 0:n.value)!==null&&o!==void 0?o:Lw}),localeRef:r}}const _r="naive-ui-style";function wr(t,e,n){if(!e)return;const r=li(),s=i.computed(()=>{const{value:l}=e;if(!l)return;const c=l[t];if(c)return c}),o=i.inject(ui,null),a=()=>{i.watchEffect(()=>{const{value:l}=n,c=`${l}${t}Rtl`;if(d1(c,r))return;const{value:d}=s;d&&d.style.mount({id:c,head:!0,anchorMetaName:_r,props:{bPrefix:l?`.${l}-`:void 0},ssr:r,parent:o==null?void 0:o.styleMountTarget})})};return r?a():i.onBeforeMount(a),s}const xr={fontFamily:'v-sans, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',fontFamilyMono:"v-mono, SFMono-Regular, Menlo, Consolas, Courier, monospace",fontWeight:"400",fontWeightStrong:"500",cubicBezierEaseInOut:"cubic-bezier(.4, 0, .2, 1)",cubicBezierEaseOut:"cubic-bezier(0, 0, .2, 1)",cubicBezierEaseIn:"cubic-bezier(.4, 0, 1, 1)",borderRadius:"3px",borderRadiusSmall:"2px",fontSize:"14px",fontSizeMini:"12px",fontSizeTiny:"12px",fontSizeSmall:"14px",fontSizeMedium:"14px",fontSizeLarge:"15px",fontSizeHuge:"16px",lineHeight:"1.6",heightMini:"16px",heightTiny:"22px",heightSmall:"28px",heightMedium:"34px",heightLarge:"40px",heightHuge:"46px"},{fontSize:Dw,fontFamily:Hw,lineHeight:Ww}=xr,Qh=ae("body",`
116
+ `)}function Yo(t){for(var e=0,n,r=0,s=t.length;s>=4;++r,s-=4)n=t.charCodeAt(r)&255|(t.charCodeAt(++r)&255)<<8|(t.charCodeAt(++r)&255)<<16|(t.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,e=(n&65535)*1540483477+((n>>>16)*59797<<16)^(e&65535)*1540483477+((e>>>16)*59797<<16);switch(s){case 3:e^=(t.charCodeAt(r+2)&255)<<16;case 2:e^=(t.charCodeAt(r+1)&255)<<8;case 1:e^=t.charCodeAt(r)&255,e=(e&65535)*1540483477+((e>>>16)*59797<<16)}return e^=e>>>13,e=(e&65535)*1540483477+((e>>>16)*59797<<16),((e^e>>>15)>>>0).toString(36)}typeof window<"u"&&(window.__cssrContext={});function b1(t,e,n,r){const{els:s}=e;if(n===void 0)s.forEach(Qd),e.els=[];else{const o=gs(n,r);o&&s.includes(o)&&(Qd(o),e.els=s.filter(a=>a!==o))}}function nh(t,e){t.push(e)}function _1(t,e,n,r,s,o,a,l,c){let d;if(n===void 0&&(d=e.render(r),n=Yo(d)),c){c.adapter(n,d??e.render(r));return}l===void 0&&(l=document.head);const h=gs(n,l);if(h!==null&&!o)return h;const u=h??f1(n);if(d===void 0&&(d=e.render(r)),u.textContent=d,h!==null)return h;if(a){const m=l.querySelector(`meta[name="${a}"]`);if(m)return l.insertBefore(u,m),nh(e.els,u),u}return s?l.insertBefore(u,l.querySelector("style, link")):l.appendChild(u),nh(e.els,u),u}function w1(t){return y1(this,this.instance,t)}function x1(t={}){const{id:e,ssr:n,props:r,head:s=!1,force:o=!1,anchorMetaName:a,parent:l}=t;return _1(this.instance,this,e,r,s,o,a,l,n)}function v1(t={}){const{id:e,parent:n}=t;b1(this.instance,this,e,n)}const ps=function(t,e,n,r){return{instance:t,$:e,props:n,children:r,els:[],render:w1,mount:x1,unmount:v1}},k1=function(t,e,n,r){return Array.isArray(e)?ps(t,{$:null},null,e):Array.isArray(n)?ps(t,e,null,n):Array.isArray(r)?ps(t,e,n,r):ps(t,e,n,null)};function ih(t={}){const e={c:((...n)=>k1(e,...n)),use:(n,...r)=>n.install(e,...r),find:gs,context:{},config:t};return e}function C1(t,e){if(t===void 0)return!1;if(e){const{context:{ids:n}}=e;return n.has(t)}return gs(t)!==null}const{c:Wn}=ih(),Uo="vueuc-style";function rh(t){return t&-t}class sh{constructor(e,n){this.l=e,this.min=n;const r=new Array(e+1);for(let s=0;s<e+1;++s)r[s]=0;this.ft=r}add(e,n){if(n===0)return;const{l:r,ft:s}=this;for(e+=1;e<=r;)s[e]+=n,e+=rh(e)}get(e){return this.sum(e+1)-this.sum(e)}sum(e){if(e===void 0&&(e=this.l),e<=0)return 0;const{ft:n,min:r,l:s}=this;if(e>s)throw new Error("[FinweckTree.sum]: `i` is larger than length.");let o=e*r;for(;e>0;)o+=n[e],e-=rh(e);return o}getBound(e){let n=0,r=this.l;for(;r>n;){const s=Math.floor((n+r)/2),o=this.sum(s);if(o>e){r=s;continue}else if(o<e){if(n===s)return this.sum(n+1)<=e?n+1:s;n=s}else return s}return n}}function oh(t){return typeof t=="string"?document.querySelector(t):t()||null}const S1=i.defineComponent({name:"LazyTeleport",props:{to:{type:[String,Object],default:void 0},disabled:Boolean,show:{type:Boolean,required:!0}},setup(t){return{showTeleport:Z_(i.toRef(t,"show")),mergedTo:i.computed(()=>{const{to:e}=t;return e??"body"})}},render(){return this.showTeleport?this.disabled?Wo("lazy-teleport",this.$slots):i.h(i.Teleport,{disabled:this.disabled,to:this.mergedTo},Wo("lazy-teleport",this.$slots)):null}}),ys={top:"bottom",bottom:"top",left:"right",right:"left"},ah={start:"end",center:"center",end:"start"},Go={top:"height",bottom:"height",left:"width",right:"width"},B1={"bottom-start":"top left",bottom:"top center","bottom-end":"top right","top-start":"bottom left",top:"bottom center","top-end":"bottom right","right-start":"top left",right:"center left","right-end":"bottom left","left-start":"top right",left:"center right","left-end":"bottom right"},T1={"bottom-start":"bottom left",bottom:"bottom center","bottom-end":"bottom right","top-start":"top left",top:"top center","top-end":"top right","right-start":"top right",right:"center right","right-end":"bottom right","left-start":"top left",left:"center left","left-end":"bottom left"},R1={"bottom-start":"right","bottom-end":"left","top-start":"right","top-end":"left","right-start":"bottom","right-end":"top","left-start":"bottom","left-end":"top"},lh={top:!0,bottom:!1,left:!0,right:!1},ch={top:"end",bottom:"start",left:"end",right:"start"};function $1(t,e,n,r,s,o){if(!s||o)return{placement:t,top:0,left:0};const[a,l]=t.split("-");let c=l??"center",d={top:0,left:0};const h=(g,f,p)=>{let y=0,b=0;const _=n[g]-e[f]-e[g];return _>0&&r&&(p?b=lh[f]?_:-_:y=lh[f]?_:-_),{left:y,top:b}},u=a==="left"||a==="right";if(c!=="center"){const g=R1[t],f=ys[g],p=Go[g];if(n[p]>e[p]){if(e[g]+e[p]<n[p]){const y=(n[p]-e[p])/2;e[g]<y||e[f]<y?e[g]<e[f]?(c=ah[l],d=h(p,f,u)):d=h(p,g,u):c="center"}}else n[p]<e[p]&&e[f]<0&&e[g]>e[f]&&(c=ah[l])}else{const g=a==="bottom"||a==="top"?"left":"top",f=ys[g],p=Go[g],y=(n[p]-e[p])/2;(e[g]<y||e[f]<y)&&(e[g]>e[f]?(c=ch[g],d=h(p,g,u)):(c=ch[f],d=h(p,f,u)))}let m=a;return e[a]<n[Go[a]]&&e[a]<e[ys[a]]&&(m=ys[a]),{placement:c!=="center"?`${m}-${c}`:m,left:d.left,top:d.top}}function E1(t,e){return e?T1[t]:B1[t]}function N1(t,e,n,r,s,o){if(o)switch(t){case"bottom-start":return{top:`${Math.round(n.top-e.top+n.height)}px`,left:`${Math.round(n.left-e.left)}px`,transform:"translateY(-100%)"};case"bottom-end":return{top:`${Math.round(n.top-e.top+n.height)}px`,left:`${Math.round(n.left-e.left+n.width)}px`,transform:"translateX(-100%) translateY(-100%)"};case"top-start":return{top:`${Math.round(n.top-e.top)}px`,left:`${Math.round(n.left-e.left)}px`,transform:""};case"top-end":return{top:`${Math.round(n.top-e.top)}px`,left:`${Math.round(n.left-e.left+n.width)}px`,transform:"translateX(-100%)"};case"right-start":return{top:`${Math.round(n.top-e.top)}px`,left:`${Math.round(n.left-e.left+n.width)}px`,transform:"translateX(-100%)"};case"right-end":return{top:`${Math.round(n.top-e.top+n.height)}px`,left:`${Math.round(n.left-e.left+n.width)}px`,transform:"translateX(-100%) translateY(-100%)"};case"left-start":return{top:`${Math.round(n.top-e.top)}px`,left:`${Math.round(n.left-e.left)}px`,transform:""};case"left-end":return{top:`${Math.round(n.top-e.top+n.height)}px`,left:`${Math.round(n.left-e.left)}px`,transform:"translateY(-100%)"};case"top":return{top:`${Math.round(n.top-e.top)}px`,left:`${Math.round(n.left-e.left+n.width/2)}px`,transform:"translateX(-50%)"};case"right":return{top:`${Math.round(n.top-e.top+n.height/2)}px`,left:`${Math.round(n.left-e.left+n.width)}px`,transform:"translateX(-100%) translateY(-50%)"};case"left":return{top:`${Math.round(n.top-e.top+n.height/2)}px`,left:`${Math.round(n.left-e.left)}px`,transform:"translateY(-50%)"};case"bottom":default:return{top:`${Math.round(n.top-e.top+n.height)}px`,left:`${Math.round(n.left-e.left+n.width/2)}px`,transform:"translateX(-50%) translateY(-100%)"}}switch(t){case"bottom-start":return{top:`${Math.round(n.top-e.top+n.height+r)}px`,left:`${Math.round(n.left-e.left+s)}px`,transform:""};case"bottom-end":return{top:`${Math.round(n.top-e.top+n.height+r)}px`,left:`${Math.round(n.left-e.left+n.width+s)}px`,transform:"translateX(-100%)"};case"top-start":return{top:`${Math.round(n.top-e.top+r)}px`,left:`${Math.round(n.left-e.left+s)}px`,transform:"translateY(-100%)"};case"top-end":return{top:`${Math.round(n.top-e.top+r)}px`,left:`${Math.round(n.left-e.left+n.width+s)}px`,transform:"translateX(-100%) translateY(-100%)"};case"right-start":return{top:`${Math.round(n.top-e.top+r)}px`,left:`${Math.round(n.left-e.left+n.width+s)}px`,transform:""};case"right-end":return{top:`${Math.round(n.top-e.top+n.height+r)}px`,left:`${Math.round(n.left-e.left+n.width+s)}px`,transform:"translateY(-100%)"};case"left-start":return{top:`${Math.round(n.top-e.top+r)}px`,left:`${Math.round(n.left-e.left+s)}px`,transform:"translateX(-100%)"};case"left-end":return{top:`${Math.round(n.top-e.top+n.height+r)}px`,left:`${Math.round(n.left-e.left+s)}px`,transform:"translateX(-100%) translateY(-100%)"};case"top":return{top:`${Math.round(n.top-e.top+r)}px`,left:`${Math.round(n.left-e.left+n.width/2+s)}px`,transform:"translateY(-100%) translateX(-50%)"};case"right":return{top:`${Math.round(n.top-e.top+n.height/2+r)}px`,left:`${Math.round(n.left-e.left+n.width+s)}px`,transform:"translateY(-50%)"};case"left":return{top:`${Math.round(n.top-e.top+n.height/2+r)}px`,left:`${Math.round(n.left-e.left+s)}px`,transform:"translateY(-50%) translateX(-100%)"};case"bottom":default:return{top:`${Math.round(n.top-e.top+n.height+r)}px`,left:`${Math.round(n.left-e.left+n.width/2+s)}px`,transform:"translateX(-50%)"}}}const P1=Wn([Wn(".v-binder-follower-container",{position:"absolute",left:"0",right:"0",top:"0",height:"0",pointerEvents:"none",zIndex:"auto"}),Wn(".v-binder-follower-content",{position:"absolute",zIndex:"auto"},[Wn("> *",{pointerEvents:"all"})])]),dh=i.defineComponent({name:"Follower",inheritAttrs:!1,props:{show:Boolean,enabled:{type:Boolean,default:void 0},placement:{type:String,default:"bottom"},syncTrigger:{type:Array,default:["resize","scroll"]},to:[String,Object],flip:{type:Boolean,default:!0},internalShift:Boolean,x:Number,y:Number,width:String,minWidth:String,containerClass:String,teleportDisabled:Boolean,zindexable:{type:Boolean,default:!0},zIndex:Number,overlap:Boolean},setup(t){const e=i.inject("VBinder"),n=Wt(()=>t.enabled!==void 0?t.enabled:t.show),r=i.ref(null),s=i.ref(null),o=()=>{const{syncTrigger:m}=t;m.includes("scroll")&&e.addScrollListener(c),m.includes("resize")&&e.addResizeListener(c)},a=()=>{e.removeScrollListener(c),e.removeResizeListener(c)};i.onMounted(()=>{n.value&&(c(),o())});const l=ci();P1.mount({id:"vueuc/binder",head:!0,anchorMetaName:Uo,ssr:l}),i.onBeforeUnmount(()=>{a()}),J_(()=>{n.value&&c()});const c=()=>{if(!n.value)return;const m=r.value;if(m===null)return;const g=e.targetRef,{x:f,y:p,overlap:y}=t,b=f!==void 0&&p!==void 0?n1(f,p):qo(g);m.style.setProperty("--v-target-width",`${Math.round(b.width)}px`),m.style.setProperty("--v-target-height",`${Math.round(b.height)}px`);const{width:_,minWidth:C,placement:S,internalShift:v,flip:B}=t;m.setAttribute("v-placement",S),y?m.setAttribute("v-overlap",""):m.removeAttribute("v-overlap");const{style:k}=m;_==="target"?k.width=`${b.width}px`:_!==void 0?k.width=_:k.width="",C==="target"?k.minWidth=`${b.width}px`:C!==void 0?k.minWidth=C:k.minWidth="";const R=qo(m),$=qo(s.value),{left:P,top:I,placement:V}=$1(S,b,R,v,B,y),A=E1(V,y),{left:L,top:D,transform:ee}=N1(V,$,b,I,P,y);m.setAttribute("v-placement",V),m.style.setProperty("--v-offset-left",`${Math.round(P)}px`),m.style.setProperty("--v-offset-top",`${Math.round(I)}px`),m.style.transform=`translateX(${L}) translateY(${D}) ${ee}`,m.style.setProperty("--v-transform-origin",A),m.style.transformOrigin=A};i.watch(n,m=>{m?(o(),d()):a()});const d=()=>{i.nextTick().then(c).catch(m=>console.error(m))};["placement","x","y","internalShift","flip","width","overlap","minWidth"].forEach(m=>{i.watch(i.toRef(t,m),c)}),["teleportDisabled"].forEach(m=>{i.watch(i.toRef(t,m),d)}),i.watch(i.toRef(t,"syncTrigger"),m=>{m.includes("resize")?e.addResizeListener(c):e.removeResizeListener(c),m.includes("scroll")?e.addScrollListener(c):e.removeScrollListener(c)});const h=fs(),u=Wt(()=>{const{to:m}=t;if(m!==void 0)return m;h.value});return{VBinder:e,mergedEnabled:n,offsetContainerRef:s,followerRef:r,mergedTo:u,syncPosition:c}},render(){return i.h(S1,{show:this.show,to:this.mergedTo,disabled:this.teleportDisabled},{default:()=>{var t,e;const n=i.h("div",{class:["v-binder-follower-container",this.containerClass],ref:"offsetContainerRef"},[i.h("div",{class:"v-binder-follower-content",ref:"followerRef"},(e=(t=this.$slots).default)===null||e===void 0?void 0:e.call(t))]);return this.zindexable?i.withDirectives(n,[[Wd,{enabled:this.mergedEnabled,zIndex:this.zIndex}]]):n}})}});var di=[],F1=function(){return di.some(function(t){return t.activeTargets.length>0})},M1=function(){return di.some(function(t){return t.skippedTargets.length>0})},hh="ResizeObserver loop completed with undelivered notifications.",A1=function(){var t;typeof ErrorEvent=="function"?t=new ErrorEvent("error",{message:hh}):(t=document.createEvent("Event"),t.initEvent("error",!1,!1),t.message=hh),window.dispatchEvent(t)},gr;(function(t){t.BORDER_BOX="border-box",t.CONTENT_BOX="content-box",t.DEVICE_PIXEL_CONTENT_BOX="device-pixel-content-box"})(gr||(gr={}));var hi=function(t){return Object.freeze(t)},V1=(function(){function t(e,n){this.inlineSize=e,this.blockSize=n,hi(this)}return t})(),uh=(function(){function t(e,n,r,s){return this.x=e,this.y=n,this.width=r,this.height=s,this.top=this.y,this.left=this.x,this.bottom=this.top+this.height,this.right=this.left+this.width,hi(this)}return t.prototype.toJSON=function(){var e=this,n=e.x,r=e.y,s=e.top,o=e.right,a=e.bottom,l=e.left,c=e.width,d=e.height;return{x:n,y:r,top:s,right:o,bottom:a,left:l,width:c,height:d}},t.fromRect=function(e){return new t(e.x,e.y,e.width,e.height)},t})(),Ko=function(t){return t instanceof SVGElement&&"getBBox"in t},fh=function(t){if(Ko(t)){var e=t.getBBox(),n=e.width,r=e.height;return!n&&!r}var s=t,o=s.offsetWidth,a=s.offsetHeight;return!(o||a||t.getClientRects().length)},gh=function(t){var e;if(t instanceof Element)return!0;var n=(e=t==null?void 0:t.ownerDocument)===null||e===void 0?void 0:e.defaultView;return!!(n&&t instanceof n.Element)},O1=function(t){switch(t.tagName){case"INPUT":if(t.type!=="image")break;case"VIDEO":case"AUDIO":case"EMBED":case"OBJECT":case"CANVAS":case"IFRAME":case"IMG":return!0}return!1},mr=typeof window<"u"?window:{},bs=new WeakMap,mh=/auto|scroll/,I1=/^tb|vertical/,z1=/msie|trident/i.test(mr.navigator&&mr.navigator.userAgent),un=function(t){return parseFloat(t||"0")},Xi=function(t,e,n){return t===void 0&&(t=0),e===void 0&&(e=0),n===void 0&&(n=!1),new V1((n?e:t)||0,(n?t:e)||0)},ph=hi({devicePixelContentBoxSize:Xi(),borderBoxSize:Xi(),contentBoxSize:Xi(),contentRect:new uh(0,0,0,0)}),yh=function(t,e){if(e===void 0&&(e=!1),bs.has(t)&&!e)return bs.get(t);if(fh(t))return bs.set(t,ph),ph;var n=getComputedStyle(t),r=Ko(t)&&t.ownerSVGElement&&t.getBBox(),s=!z1&&n.boxSizing==="border-box",o=I1.test(n.writingMode||""),a=!r&&mh.test(n.overflowY||""),l=!r&&mh.test(n.overflowX||""),c=r?0:un(n.paddingTop),d=r?0:un(n.paddingRight),h=r?0:un(n.paddingBottom),u=r?0:un(n.paddingLeft),m=r?0:un(n.borderTopWidth),g=r?0:un(n.borderRightWidth),f=r?0:un(n.borderBottomWidth),p=r?0:un(n.borderLeftWidth),y=u+d,b=c+h,_=p+g,C=m+f,S=l?t.offsetHeight-C-t.clientHeight:0,v=a?t.offsetWidth-_-t.clientWidth:0,B=s?y+_:0,k=s?b+C:0,R=r?r.width:un(n.width)-B-v,$=r?r.height:un(n.height)-k-S,P=R+y+v+_,I=$+b+S+C,V=hi({devicePixelContentBoxSize:Xi(Math.round(R*devicePixelRatio),Math.round($*devicePixelRatio),o),borderBoxSize:Xi(P,I,o),contentBoxSize:Xi(R,$,o),contentRect:new uh(u,c,R,$)});return bs.set(t,V),V},bh=function(t,e,n){var r=yh(t,n),s=r.borderBoxSize,o=r.contentBoxSize,a=r.devicePixelContentBoxSize;switch(e){case gr.DEVICE_PIXEL_CONTENT_BOX:return a;case gr.BORDER_BOX:return s;default:return o}},L1=(function(){function t(e){var n=yh(e);this.target=e,this.contentRect=n.contentRect,this.borderBoxSize=hi([n.borderBoxSize]),this.contentBoxSize=hi([n.contentBoxSize]),this.devicePixelContentBoxSize=hi([n.devicePixelContentBoxSize])}return t})(),_h=function(t){if(fh(t))return 1/0;for(var e=0,n=t.parentNode;n;)e+=1,n=n.parentNode;return e},D1=function(){var t=1/0,e=[];di.forEach(function(a){if(a.activeTargets.length!==0){var l=[];a.activeTargets.forEach(function(d){var h=new L1(d.target),u=_h(d.target);l.push(h),d.lastReportedSize=bh(d.target,d.observedBox),u<t&&(t=u)}),e.push(function(){a.callback.call(a.observer,l,a.observer)}),a.activeTargets.splice(0,a.activeTargets.length)}});for(var n=0,r=e;n<r.length;n++){var s=r[n];s()}return t},wh=function(t){di.forEach(function(n){n.activeTargets.splice(0,n.activeTargets.length),n.skippedTargets.splice(0,n.skippedTargets.length),n.observationTargets.forEach(function(s){s.isActive()&&(_h(s.target)>t?n.activeTargets.push(s):n.skippedTargets.push(s))})})},H1=function(){var t=0;for(wh(t);F1();)t=D1(),wh(t);return M1()&&A1(),t>0},Zo,xh=[],W1=function(){return xh.splice(0).forEach(function(t){return t()})},j1=function(t){if(!Zo){var e=0,n=document.createTextNode(""),r={characterData:!0};new MutationObserver(function(){return W1()}).observe(n,r),Zo=function(){n.textContent="".concat(e?e--:e++)}}xh.push(t),Zo()},q1=function(t){j1(function(){requestAnimationFrame(t)})},_s=0,X1=function(){return!!_s},Y1=250,U1={attributes:!0,characterData:!0,childList:!0,subtree:!0},vh=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],kh=function(t){return t===void 0&&(t=0),Date.now()+t},Qo=!1,G1=(function(){function t(){var e=this;this.stopped=!0,this.listener=function(){return e.schedule()}}return t.prototype.run=function(e){var n=this;if(e===void 0&&(e=Y1),!Qo){Qo=!0;var r=kh(e);q1(function(){var s=!1;try{s=H1()}finally{if(Qo=!1,e=r-kh(),!X1())return;s?n.run(1e3):e>0?n.run(e):n.start()}})}},t.prototype.schedule=function(){this.stop(),this.run()},t.prototype.observe=function(){var e=this,n=function(){return e.observer&&e.observer.observe(document.body,U1)};document.body?n():mr.addEventListener("DOMContentLoaded",n)},t.prototype.start=function(){var e=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),vh.forEach(function(n){return mr.addEventListener(n,e.listener,!0)}))},t.prototype.stop=function(){var e=this;this.stopped||(this.observer&&this.observer.disconnect(),vh.forEach(function(n){return mr.removeEventListener(n,e.listener,!0)}),this.stopped=!0)},t})(),Jo=new G1,Ch=function(t){!_s&&t>0&&Jo.start(),_s+=t,!_s&&Jo.stop()},K1=function(t){return!Ko(t)&&!O1(t)&&getComputedStyle(t).display==="inline"},Z1=(function(){function t(e,n){this.target=e,this.observedBox=n||gr.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return t.prototype.isActive=function(){var e=bh(this.target,this.observedBox,!0);return K1(this.target)&&(this.lastReportedSize=e),this.lastReportedSize.inlineSize!==e.inlineSize||this.lastReportedSize.blockSize!==e.blockSize},t})(),Q1=(function(){function t(e,n){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=e,this.callback=n}return t})(),ws=new WeakMap,Sh=function(t,e){for(var n=0;n<t.length;n+=1)if(t[n].target===e)return n;return-1},xs=(function(){function t(){}return t.connect=function(e,n){var r=new Q1(e,n);ws.set(e,r)},t.observe=function(e,n,r){var s=ws.get(e),o=s.observationTargets.length===0;Sh(s.observationTargets,n)<0&&(o&&di.push(s),s.observationTargets.push(new Z1(n,r&&r.box)),Ch(1),Jo.schedule())},t.unobserve=function(e,n){var r=ws.get(e),s=Sh(r.observationTargets,n),o=r.observationTargets.length===1;s>=0&&(o&&di.splice(di.indexOf(r),1),r.observationTargets.splice(s,1),Ch(-1))},t.disconnect=function(e){var n=this,r=ws.get(e);r.observationTargets.slice().forEach(function(s){return n.unobserve(e,s.target)}),r.activeTargets.splice(0,r.activeTargets.length)},t})(),J1=(function(){function t(e){if(arguments.length===0)throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");if(typeof e!="function")throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.");xs.connect(this,e)}return t.prototype.observe=function(e,n){if(arguments.length===0)throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!gh(e))throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");xs.observe(this,e,n)},t.prototype.unobserve=function(e){if(arguments.length===0)throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!gh(e))throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");xs.unobserve(this,e)},t.prototype.disconnect=function(){xs.disconnect(this)},t.toString=function(){return"function ResizeObserver () { [polyfill code] }"},t})();class ew{constructor(){this.handleResize=this.handleResize.bind(this),this.observer=new(typeof window<"u"&&window.ResizeObserver||J1)(this.handleResize),this.elHandlersMap=new Map}handleResize(e){for(const n of e){const r=this.elHandlersMap.get(n.target);r!==void 0&&r(n)}}registerHandler(e,n){this.elHandlersMap.set(e,n),this.observer.observe(e)}unregisterHandler(e){this.elHandlersMap.has(e)&&(this.elHandlersMap.delete(e),this.observer.unobserve(e))}}const pr=new ew,vs=i.defineComponent({name:"ResizeObserver",props:{onResize:Function},setup(t){let e=!1;const n=i.getCurrentInstance().proxy;function r(s){const{onResize:o}=t;o!==void 0&&o(s)}i.onMounted(()=>{const s=n.$el;if(s===void 0){Kd("resize-observer","$el does not exist.");return}if(s.nextElementSibling!==s.nextSibling&&s.nodeType===3&&s.nodeValue!==""){Kd("resize-observer","$el can not be observed (it may be a text node).");return}s.nextElementSibling!==null&&(pr.registerHandler(s.nextElementSibling,r),e=!0)}),i.onBeforeUnmount(()=>{e&&pr.unregisterHandler(n.$el.nextElementSibling)})},render(){return i.renderSlot(this.$slots,"default")}});let ks;function tw(){return typeof document>"u"?!1:(ks===void 0&&("matchMedia"in window?ks=window.matchMedia("(pointer:coarse)").matches:ks=!1),ks)}let ea;function Bh(){return typeof document>"u"?1:(ea===void 0&&(ea="chrome"in window?window.devicePixelRatio:1),ea)}const Th="VVirtualListXScroll";function nw({columnsRef:t,renderColRef:e,renderItemWithColsRef:n}){const r=i.ref(0),s=i.ref(0),o=i.computed(()=>{const d=t.value;if(d.length===0)return null;const h=new sh(d.length,0);return d.forEach((u,m)=>{h.add(m,u.width)}),h}),a=Wt(()=>{const d=o.value;return d!==null?Math.max(d.getBound(s.value)-1,0):0}),l=d=>{const h=o.value;return h!==null?h.sum(d):0},c=Wt(()=>{const d=o.value;return d!==null?Math.min(d.getBound(s.value+r.value)+1,t.value.length-1):0});return i.provide(Th,{startIndexRef:a,endIndexRef:c,columnsRef:t,renderColRef:e,renderItemWithColsRef:n,getLeft:l}),{listWidthRef:r,scrollLeftRef:s}}const Rh=i.defineComponent({name:"VirtualListRow",props:{index:{type:Number,required:!0},item:{type:Object,required:!0}},setup(){const{startIndexRef:t,endIndexRef:e,columnsRef:n,getLeft:r,renderColRef:s,renderItemWithColsRef:o}=i.inject(Th);return{startIndex:t,endIndex:e,columns:n,renderCol:s,renderItemWithCols:o,getLeft:r}},render(){const{startIndex:t,endIndex:e,columns:n,renderCol:r,renderItemWithCols:s,getLeft:o,item:a}=this;if(s!=null)return s({itemIndex:this.index,startColIndex:t,endColIndex:e,allColumns:n,item:a,getLeft:o});if(r!=null){const l=[];for(let c=t;c<=e;++c){const d=n[c];l.push(r({column:d,left:o(c),item:a}))}return l}return null}}),iw=Wn(".v-vl",{maxHeight:"inherit",height:"100%",overflow:"auto",minWidth:"1px"},[Wn("&:not(.v-vl--show-scrollbar)",{scrollbarWidth:"none"},[Wn("&::-webkit-scrollbar, &::-webkit-scrollbar-track-piece, &::-webkit-scrollbar-thumb",{width:0,height:0,display:"none"})])]),rw=i.defineComponent({name:"VirtualList",inheritAttrs:!1,props:{showScrollbar:{type:Boolean,default:!0},columns:{type:Array,default:()=>[]},renderCol:Function,renderItemWithCols:Function,items:{type:Array,default:()=>[]},itemSize:{type:Number,required:!0},itemResizable:Boolean,itemsStyle:[String,Object],visibleItemsTag:{type:[String,Object],default:"div"},visibleItemsProps:Object,ignoreItemResize:Boolean,onScroll:Function,onWheel:Function,onResize:Function,defaultScrollKey:[Number,String],defaultScrollIndex:Number,keyField:{type:String,default:"key"},paddingTop:{type:[Number,String],default:0},paddingBottom:{type:[Number,String],default:0}},setup(t){const e=ci();iw.mount({id:"vueuc/virtual-list",head:!0,anchorMetaName:Uo,ssr:e}),i.onMounted(()=>{const{defaultScrollIndex:A,defaultScrollKey:L}=t;A!=null?y({index:A}):L!=null&&y({key:L})});let n=!1,r=!1;i.onActivated(()=>{if(n=!1,!r){r=!0;return}y({top:g.value,left:a.value})}),i.onDeactivated(()=>{n=!0,r||(r=!0)});const s=Wt(()=>{if(t.renderCol==null&&t.renderItemWithCols==null||t.columns.length===0)return;let A=0;return t.columns.forEach(L=>{A+=L.width}),A}),o=i.computed(()=>{const A=new Map,{keyField:L}=t;return t.items.forEach((D,ee)=>{A.set(D[L],ee)}),A}),{scrollLeftRef:a,listWidthRef:l}=nw({columnsRef:i.toRef(t,"columns"),renderColRef:i.toRef(t,"renderCol"),renderItemWithColsRef:i.toRef(t,"renderItemWithCols")}),c=i.ref(null),d=i.ref(void 0),h=new Map,u=i.computed(()=>{const{items:A,itemSize:L,keyField:D}=t,ee=new sh(A.length,L);return A.forEach((E,N)=>{const H=E[D],q=h.get(H);q!==void 0&&ee.add(N,q)}),ee}),m=i.ref(0),g=i.ref(0),f=Wt(()=>Math.max(u.value.getBound(g.value-hr(t.paddingTop))-1,0)),p=i.computed(()=>{const{value:A}=d;if(A===void 0)return[];const{items:L,itemSize:D}=t,ee=f.value,E=Math.min(ee+Math.ceil(A/D+1),L.length-1),N=[];for(let H=ee;H<=E;++H)N.push(L[H]);return N}),y=(A,L)=>{if(typeof A=="number"){S(A,L,"auto");return}const{left:D,top:ee,index:E,key:N,position:H,behavior:q,debounce:Y=!0}=A;if(D!==void 0||ee!==void 0)S(D,ee,q);else if(E!==void 0)C(E,q,Y);else if(N!==void 0){const F=o.value.get(N);F!==void 0&&C(F,q,Y)}else H==="bottom"?S(0,Number.MAX_SAFE_INTEGER,q):H==="top"&&S(0,0,q)};let b,_=null;function C(A,L,D){const{value:ee}=u,E=ee.sum(A)+hr(t.paddingTop);if(!D)c.value.scrollTo({left:0,top:E,behavior:L});else{b=A,_!==null&&window.clearTimeout(_),_=window.setTimeout(()=>{b=void 0,_=null},16);const{scrollTop:N,offsetHeight:H}=c.value;if(E>N){const q=ee.get(A);E+q<=N+H||c.value.scrollTo({left:0,top:E+q-H,behavior:L})}else c.value.scrollTo({left:0,top:E,behavior:L})}}function S(A,L,D){c.value.scrollTo({left:A,top:L,behavior:D})}function v(A,L){var D,ee,E;if(n||t.ignoreItemResize||V(L.target))return;const{value:N}=u,H=o.value.get(A),q=N.get(H),Y=(E=(ee=(D=L.borderBoxSize)===null||D===void 0?void 0:D[0])===null||ee===void 0?void 0:ee.blockSize)!==null&&E!==void 0?E:L.contentRect.height;if(Y===q)return;Y-t.itemSize===0?h.delete(A):h.set(A,Y-t.itemSize);const M=Y-q;if(M===0)return;N.add(H,M);const Z=c.value;if(Z!=null){if(b===void 0){const fe=N.sum(H);Z.scrollTop>fe&&Z.scrollBy(0,M)}else if(H<b)Z.scrollBy(0,M);else if(H===b){const fe=N.sum(H);Y+fe>Z.scrollTop+Z.offsetHeight&&Z.scrollBy(0,M)}I()}m.value++}const B=!tw();let k=!1;function R(A){var L;(L=t.onScroll)===null||L===void 0||L.call(t,A),(!B||!k)&&I()}function $(A){var L;if((L=t.onWheel)===null||L===void 0||L.call(t,A),B){const D=c.value;if(D!=null){if(A.deltaX===0&&(D.scrollTop===0&&A.deltaY<=0||D.scrollTop+D.offsetHeight>=D.scrollHeight&&A.deltaY>=0))return;A.preventDefault(),D.scrollTop+=A.deltaY/Bh(),D.scrollLeft+=A.deltaX/Bh(),I(),k=!0,Pd(()=>{k=!1})}}}function P(A){if(n||V(A.target))return;if(t.renderCol==null&&t.renderItemWithCols==null){if(A.contentRect.height===d.value)return}else if(A.contentRect.height===d.value&&A.contentRect.width===l.value)return;d.value=A.contentRect.height,l.value=A.contentRect.width;const{onResize:L}=t;L!==void 0&&L(A)}function I(){const{value:A}=c;A!=null&&(g.value=A.scrollTop,a.value=A.scrollLeft)}function V(A){let L=A;for(;L!==null;){if(L.style.display==="none")return!0;L=L.parentElement}return!1}return{listHeight:d,listStyle:{overflow:"auto"},keyToIndex:o,itemsStyle:i.computed(()=>{const{itemResizable:A}=t,L=ur(u.value.sum());return m.value,[t.itemsStyle,{boxSizing:"content-box",width:ur(s.value),height:A?"":L,minHeight:A?L:"",paddingTop:ur(t.paddingTop),paddingBottom:ur(t.paddingBottom)}]}),visibleItemsStyle:i.computed(()=>(m.value,{transform:`translateY(${ur(u.value.sum(f.value))})`})),viewportItems:p,listElRef:c,itemsElRef:i.ref(null),scrollTo:y,handleListResize:P,handleListScroll:R,handleListWheel:$,handleItemResize:v}},render(){const{itemResizable:t,keyField:e,keyToIndex:n,visibleItemsTag:r}=this;return i.h(vs,{onResize:this.handleListResize},{default:()=>{var s,o;return i.h("div",i.mergeProps(this.$attrs,{class:["v-vl",this.showScrollbar&&"v-vl--show-scrollbar"],onScroll:this.handleListScroll,onWheel:this.handleListWheel,ref:"listElRef"}),[this.items.length!==0?i.h("div",{ref:"itemsElRef",class:"v-vl-items",style:this.itemsStyle},[i.h(r,Object.assign({class:"v-vl-visible-items",style:this.visibleItemsStyle},this.visibleItemsProps),{default:()=>{const{renderCol:a,renderItemWithCols:l}=this;return this.viewportItems.map(c=>{const d=c[e],h=n.get(d),u=a!=null?i.h(Rh,{index:h,item:c}):void 0,m=l!=null?i.h(Rh,{index:h,item:c}):void 0,g=this.$slots.default({item:c,renderedCols:u,renderedItemWithCols:m,index:h})[0];return t?i.h(vs,{key:d,onResize:f=>this.handleItemResize(d,f)},{default:()=>g}):(g.key=d,g)})}})]):(o=(s=this.$slots).empty)===null||o===void 0?void 0:o.call(s)])}})}}),vn="v-hidden",sw=Wn("[v-hidden]",{display:"none!important"}),$h=i.defineComponent({name:"Overflow",props:{getCounter:Function,getTail:Function,updateCounter:Function,onUpdateCount:Function,onUpdateOverflow:Function},setup(t,{slots:e}){const n=i.ref(null),r=i.ref(null);function s(a){const{value:l}=n,{getCounter:c,getTail:d}=t;let h;if(c!==void 0?h=c():h=r.value,!l||!h)return;h.hasAttribute(vn)&&h.removeAttribute(vn);const{children:u}=l;if(a.showAllItemsBeforeCalculate)for(const C of u)C.hasAttribute(vn)&&C.removeAttribute(vn);const m=l.offsetWidth,g=[],f=e.tail?d==null?void 0:d():null;let p=f?f.offsetWidth:0,y=!1;const b=l.children.length-(e.tail?1:0);for(let C=0;C<b-1;++C){if(C<0)continue;const S=u[C];if(y){S.hasAttribute(vn)||S.setAttribute(vn,"");continue}else S.hasAttribute(vn)&&S.removeAttribute(vn);const v=S.offsetWidth;if(p+=v,g[C]=v,p>m){const{updateCounter:B}=t;for(let k=C;k>=0;--k){const R=b-1-k;B!==void 0?B(R):h.textContent=`${R}`;const $=h.offsetWidth;if(p-=g[k],p+$<=m||k===0){y=!0,C=k-1,f&&(C===-1?(f.style.maxWidth=`${m-$}px`,f.style.boxSizing="border-box"):f.style.maxWidth="");const{onUpdateCount:P}=t;P&&P(R);break}}}}const{onUpdateOverflow:_}=t;y?_!==void 0&&_(!0):(_!==void 0&&_(!1),h.setAttribute(vn,""))}const o=ci();return sw.mount({id:"vueuc/overflow",head:!0,anchorMetaName:Uo,ssr:o}),i.onMounted(()=>s({showAllItemsBeforeCalculate:!1})),{selfRef:n,counterRef:r,sync:s}},render(){const{$slots:t}=this;return i.nextTick(()=>this.sync({showAllItemsBeforeCalculate:!1})),i.h("div",{class:"v-overflow",ref:"selfRef"},[i.renderSlot(t,"default"),t.counter?t.counter():i.h("span",{style:{display:"inline-block"},ref:"counterRef"}),t.tail?t.tail():null])}});function Eh(t){return t instanceof HTMLElement}function Nh(t){for(let e=0;e<t.childNodes.length;e++){const n=t.childNodes[e];if(Eh(n)&&(Fh(n)||Nh(n)))return!0}return!1}function Ph(t){for(let e=t.childNodes.length-1;e>=0;e--){const n=t.childNodes[e];if(Eh(n)&&(Fh(n)||Ph(n)))return!0}return!1}function Fh(t){if(!ow(t))return!1;try{t.focus({preventScroll:!0})}catch{}return document.activeElement===t}function ow(t){if(t.tabIndex>0||t.tabIndex===0&&t.getAttribute("tabIndex")!==null)return!0;if(t.getAttribute("disabled"))return!1;switch(t.nodeName){case"A":return!!t.href&&t.rel!=="ignore";case"INPUT":return t.type!=="hidden"&&t.type!=="file";case"SELECT":case"TEXTAREA":return!0;default:return!1}}let yr=[];const aw=i.defineComponent({name:"FocusTrap",props:{disabled:Boolean,active:Boolean,autoFocus:{type:Boolean,default:!0},onEsc:Function,initialFocusTo:[String,Function],finalFocusTo:[String,Function],returnFocusOnDeactivated:{type:Boolean,default:!0}},setup(t){const e=m_(),n=i.ref(null),r=i.ref(null);let s=!1,o=!1;const a=typeof document>"u"?null:document.activeElement;function l(){return yr[yr.length-1]===e}function c(y){var b;y.code==="Escape"&&l()&&((b=t.onEsc)===null||b===void 0||b.call(t,y))}i.onMounted(()=>{i.watch(()=>t.active,y=>{y?(u(),kt("keydown",document,c)):(et("keydown",document,c),s&&m())},{immediate:!0})}),i.onBeforeUnmount(()=>{et("keydown",document,c),s&&m()});function d(y){if(!o&&l()){const b=h();if(b===null||b.contains(dr(y)))return;g("first")}}function h(){const y=n.value;if(y===null)return null;let b=y;for(;b=b.nextSibling,!(b===null||b instanceof Element&&b.tagName==="DIV"););return b}function u(){var y;if(!t.disabled){if(yr.push(e),t.autoFocus){const{initialFocusTo:b}=t;b===void 0?g("first"):(y=oh(b))===null||y===void 0||y.focus({preventScroll:!0})}s=!0,document.addEventListener("focus",d,!0)}}function m(){var y;if(t.disabled||(document.removeEventListener("focus",d,!0),yr=yr.filter(_=>_!==e),l()))return;const{finalFocusTo:b}=t;b!==void 0?(y=oh(b))===null||y===void 0||y.focus({preventScroll:!0}):t.returnFocusOnDeactivated&&a instanceof HTMLElement&&(o=!0,a.focus({preventScroll:!0}),o=!1)}function g(y){if(l()&&t.active){const b=n.value,_=r.value;if(b!==null&&_!==null){const C=h();if(C==null||C===_){o=!0,b.focus({preventScroll:!0}),o=!1;return}o=!0;const S=y==="first"?Nh(C):Ph(C);o=!1,S||(o=!0,b.focus({preventScroll:!0}),o=!1)}}}function f(y){if(o)return;const b=h();b!==null&&(y.relatedTarget!==null&&b.contains(y.relatedTarget)?g("last"):g("first"))}function p(y){o||(y.relatedTarget!==null&&y.relatedTarget===n.value?g("last"):g("first"))}return{focusableStartRef:n,focusableEndRef:r,focusableStyle:"position: absolute; height: 0; width: 0;",handleStartFocus:f,handleEndFocus:p}},render(){const{default:t}=this.$slots;if(t===void 0)return null;if(this.disabled)return t();const{active:e,focusableStyle:n}=this;return i.h(i.Fragment,null,[i.h("div",{"aria-hidden":"true",tabindex:e?"0":"-1",ref:"focusableStartRef",style:n,onFocus:this.handleStartFocus}),t(),i.h("div",{"aria-hidden":"true",style:n,ref:"focusableEndRef",tabindex:e?"0":"-1",onFocus:this.handleEndFocus})])}});function iC(t){return t}const ta="n-internal-select-menu",Mh="n-internal-select-menu-body",Ah="n-drawer-body",Vh="n-modal-body",Oh="n-popover-body",Ih="__disabled__";function kn(t){const e=i.inject(Vh,null),n=i.inject(Ah,null),r=i.inject(Oh,null),s=i.inject(Mh,null),o=i.ref();if(typeof document<"u"){o.value=document.fullscreenElement;const a=()=>{o.value=document.fullscreenElement};i.onMounted(()=>{kt("fullscreenchange",document,a)}),i.onBeforeUnmount(()=>{et("fullscreenchange",document,a)})}return Wt(()=>{var a;const{to:l}=t;return l!==void 0?l===!1?Ih:l===!0?o.value||"body":l:e!=null&&e.value?(a=e.value.$el)!==null&&a!==void 0?a:e.value:n!=null&&n.value?n.value:r!=null&&r.value?r.value:s!=null&&s.value?s.value:l??(o.value||"body")})}kn.tdkey=Ih,kn.propTo={type:[String,Object,Boolean],default:void 0};function lw(t){const e={isDeactivated:!1};let n=!1;return i.onActivated(()=>{if(e.isDeactivated=!1,!n){n=!0;return}t()}),i.onDeactivated(()=>{e.isDeactivated=!0,n||(n=!0)}),e}function zh(t,e){e&&(i.onMounted(()=>{const{value:n}=t;n&&pr.registerHandler(n,e)}),i.watch(t,(n,r)=>{r&&pr.unregisterHandler(r)},{deep:!1}),i.onBeforeUnmount(()=>{const{value:n}=t;n&&pr.unregisterHandler(n)}))}function Lh(t){return t.replace(/#|\(|\)|,|\s|\./g,"_")}const cw=/^(\d|\.)+$/,Dh=/(\d|\.)+/;function na(t,{c:e=1,offset:n=0,attachPx:r=!0}={}){if(typeof t=="number"){const s=(t+n)*e;return s===0?"0":`${s}px`}else if(typeof t=="string")if(cw.test(t)){const s=(Number(t)+n)*e;return r?s===0?"0":`${s}px`:`${s}`}else{const s=Dh.exec(t);return s?t.replace(Dh,String((Number(s[0])+n)*e)):t}return t}function Hh(t){const{left:e,right:n,top:r,bottom:s}=Yt(t);return`${r} ${e} ${s} ${n}`}var Wh={};function dw(t){let e=".",n="__",r="--",s;if(t){let f=t.blockPrefix;f&&(e=f),f=t.elementPrefix,f&&(n=f),f=t.modifierPrefix,f&&(r=f)}const o={install(f){s=f.c;const p=f.context;p.bem={},p.bem.b=null,p.bem.els=null}};function a(f){let p,y;return{before(b){p=b.bem.b,y=b.bem.els,b.bem.els=null},after(b){b.bem.b=p,b.bem.els=y},$({context:b,props:_}){return f=typeof f=="string"?f:f({context:b,props:_}),b.bem.b=f,`${(_==null?void 0:_.bPrefix)||e}${b.bem.b}`}}}function l(f){let p;return{before(y){p=y.bem.els},after(y){y.bem.els=p},$({context:y,props:b}){return f=typeof f=="string"?f:f({context:y,props:b}),y.bem.els=f.split(",").map(_=>_.trim()),y.bem.els.map(_=>`${(b==null?void 0:b.bPrefix)||e}${y.bem.b}${n}${_}`).join(", ")}}}function c(f){return{$({context:p,props:y}){f=typeof f=="string"?f:f({context:p,props:y});const b=f.split(",").map(S=>S.trim());function _(S){return b.map(v=>`&${(y==null?void 0:y.bPrefix)||e}${p.bem.b}${S!==void 0?`${n}${S}`:""}${r}${v}`).join(", ")}const C=p.bem.els;if(C!==null){if(Wh.NODE_ENV!=="production"&&C.length>=2)throw Error(`[css-render/plugin-bem]: m(${f}) is invalid, using modifier inside multiple elements is not allowed`);return _(C[0])}else return _()}}}function d(f){return{$({context:p,props:y}){f=typeof f=="string"?f:f({context:p,props:y});const b=p.bem.els;if(Wh.NODE_ENV!=="production"&&b!==null&&b.length>=2)throw Error(`[css-render/plugin-bem]: notM(${f}) is invalid, using modifier inside multiple elements is not allowed`);return`&:not(${(y==null?void 0:y.bPrefix)||e}${p.bem.b}${b!==null&&b.length>0?`${n}${b[0]}`:""}${r}${f})`}}}return Object.assign(o,{cB:((...f)=>s(a(f[0]),f[1],f[2])),cE:((...f)=>s(l(f[0]),f[1],f[2])),cM:((...f)=>s(c(f[0]),f[1],f[2])),cNotM:((...f)=>s(d(f[0]),f[1],f[2]))}),o}const hw=".n-",uw="__",fw="--",jh=ih(),qh=dw({blockPrefix:hw,elementPrefix:uw,modifierPrefix:fw});jh.use(qh);const{c:ae,find:sC}=jh,{cB:ue,cE:ye,cM:Be,cNotM:Ut}=qh,gw=(...t)=>ae(">",[ue(...t)]);function Ge(t,e){return t+(e==="default"?"":e.replace(/^[a-z]/,n=>n.toUpperCase()))}let ia;function mw(){return ia===void 0&&(ia=navigator.userAgent.includes("Node.js")||navigator.userAgent.includes("jsdom")),ia}const pw=new WeakSet;function yw(t){pw.add(t)}function Xh(t){switch(typeof t){case"string":return t||void 0;case"number":return String(t);default:return}}const Yh=new Set;function jn(t,e){const n=`[naive/${t}]: ${e}`;Yh.has(n)||(Yh.add(n),console.error(n))}function Uh(t,e){console.error(`[naive/${t}]: ${e}`)}function Gh(t,e){throw new Error(`[naive/${t}]: ${e}`)}function ht(t,...e){if(Array.isArray(t))t.forEach(n=>ht(n,...e));else return t(...e)}function ra(t,e=!0,n=[]){return t.forEach(r=>{if(r!==null){if(typeof r!="object"){(typeof r=="string"||typeof r=="number")&&n.push(i.createTextVNode(String(r)));return}if(Array.isArray(r)){ra(r,e,n);return}if(r.type===i.Fragment){if(r.children===null)return;Array.isArray(r.children)&&ra(r.children,e,n)}else{if(r.type===i.Comment&&e)return;n.push(r)}}}),n}function bw(t,e="default",n=void 0){const r=t[e];if(!r)return Uh("getFirstSlotVNode",`slot[${e}] is empty`),null;const s=ra(r(n));return s.length===1?s[0]:(Uh("getFirstSlotVNode",`slot[${e}] should have exactly one child`),null)}function _w(t,e=[],n){const r={};return e.forEach(s=>{r[s]=t[s]}),Object.assign(r,n)}function sa(t){const e=t.filter(n=>n!==void 0);if(e.length!==0)return e.length===1?e[0]:n=>{t.forEach(r=>{r&&r(n)})}}function Yi(t,...e){return typeof t=="function"?t(...e):typeof t=="string"?i.createTextVNode(t):typeof t=="number"?i.createTextVNode(String(t)):null}function Cs(t){return t.some(e=>i.isVNode(e)?!(e.type===i.Comment||e.type===i.Fragment&&!Cs(e.children)):!0)?t:null}function oa(t,e){return t&&Cs(t())||e()}function ui(t,e){const n=t&&Cs(t());return e(n||null)}function Kh(t){return!(t&&Cs(t()))}const aa=i.defineComponent({render(){var t,e;return(e=(t=this.$slots).default)===null||e===void 0?void 0:e.call(t)}}),fi="n-config-provider",ww="n";function gi(t={},e={defaultBordered:!0}){const n=i.inject(fi,null);return{inlineThemeDisabled:n==null?void 0:n.inlineThemeDisabled,mergedRtlRef:n==null?void 0:n.mergedRtlRef,mergedComponentPropsRef:n==null?void 0:n.mergedComponentPropsRef,mergedBreakpointsRef:n==null?void 0:n.mergedBreakpointsRef,mergedBorderedRef:i.computed(()=>{var r,s;const{bordered:o}=t;return o!==void 0?o:(s=(r=n==null?void 0:n.mergedBorderedRef.value)!==null&&r!==void 0?r:e.defaultBordered)!==null&&s!==void 0?s:!0}),mergedClsPrefixRef:n?n.mergedClsPrefixRef:i.shallowRef(ww),namespaceRef:i.computed(()=>n==null?void 0:n.mergedNamespaceRef.value)}}function mi(t,e,n,r){n||Gh("useThemeClass","cssVarsRef is not passed");const s=i.inject(fi,null),o=s==null?void 0:s.mergedThemeHashRef,a=s==null?void 0:s.styleMountTarget,l=i.ref(""),c=ci();let d;const h=`__${t}`,u=()=>{let m=h;const g=e?e.value:void 0,f=o==null?void 0:o.value;f&&(m+=`-${f}`),g&&(m+=`-${g}`);const{themeOverrides:p,builtinThemeOverrides:y}=r;p&&(m+=`-${Yo(JSON.stringify(p))}`),y&&(m+=`-${Yo(JSON.stringify(y))}`),l.value=m,d=()=>{const b=n.value;let _="";for(const C in b)_+=`${C}: ${b[C]};`;ae(`.${m}`,_).mount({id:m,ssr:c,parent:a}),d=void 0}};return i.watchEffect(()=>{u()}),{themeClass:l,onRender:()=>{d==null||d()}}}const Zh="n-form-item";function xw(t,{defaultSize:e="medium",mergedSize:n,mergedDisabled:r}={}){const s=i.inject(Zh,null);i.provide(Zh,null);const o=i.computed(n?()=>n(s):()=>{const{size:c}=t;if(c)return c;if(s){const{mergedSize:d}=s;if(d.value!==void 0)return d.value}return e}),a=i.computed(r?()=>r(s):()=>{const{disabled:c}=t;return c!==void 0?c:s?s.disabled.value:!1}),l=i.computed(()=>{const{status:c}=t;return c||(s==null?void 0:s.mergedValidationStatus.value)});return i.onBeforeUnmount(()=>{s&&s.restoreValidation()}),{mergedSizeRef:o,mergedDisabledRef:a,mergedStatusRef:l,nTriggerFormBlur(){s&&s.handleContentBlur()},nTriggerFormChange(){s&&s.handleContentChange()},nTriggerFormFocus(){s&&s.handleContentFocus()},nTriggerFormInput(){s&&s.handleContentInput()}}}const vw={name:"en-US",global:{undo:"Undo",redo:"Redo",confirm:"Confirm",clear:"Clear"},Popconfirm:{positiveText:"Confirm",negativeText:"Cancel"},Cascader:{placeholder:"Please Select",loading:"Loading",loadingRequiredMessage:t=>`Please load all ${t}'s descendants before checking it.`},Time:{dateFormat:"yyyy-MM-dd",dateTimeFormat:"yyyy-MM-dd HH:mm:ss"},DatePicker:{yearFormat:"yyyy",monthFormat:"MMM",dayFormat:"eeeeee",yearTypeFormat:"yyyy",monthTypeFormat:"yyyy-MM",dateFormat:"yyyy-MM-dd",dateTimeFormat:"yyyy-MM-dd HH:mm:ss",quarterFormat:"yyyy-qqq",weekFormat:"YYYY-w",clear:"Clear",now:"Now",confirm:"Confirm",selectTime:"Select Time",selectDate:"Select Date",datePlaceholder:"Select Date",datetimePlaceholder:"Select Date and Time",monthPlaceholder:"Select Month",yearPlaceholder:"Select Year",quarterPlaceholder:"Select Quarter",weekPlaceholder:"Select Week",startDatePlaceholder:"Start Date",endDatePlaceholder:"End Date",startDatetimePlaceholder:"Start Date and Time",endDatetimePlaceholder:"End Date and Time",startMonthPlaceholder:"Start Month",endMonthPlaceholder:"End Month",monthBeforeYear:!0,firstDayOfWeek:6,today:"Today"},DataTable:{checkTableAll:"Select all in the table",uncheckTableAll:"Unselect all in the table",confirm:"Confirm",clear:"Clear"},LegacyTransfer:{sourceTitle:"Source",targetTitle:"Target"},Transfer:{selectAll:"Select all",unselectAll:"Unselect all",clearAll:"Clear",total:t=>`Total ${t} items`,selected:t=>`${t} items selected`},Empty:{description:"No Data"},Select:{placeholder:"Please Select"},TimePicker:{placeholder:"Select Time",positiveText:"OK",negativeText:"Cancel",now:"Now",clear:"Clear"},Pagination:{goto:"Goto",selectionSuffix:"page"},DynamicTags:{add:"Add"},Log:{loading:"Loading"},Input:{placeholder:"Please Input"},InputNumber:{placeholder:"Please Input"},DynamicInput:{create:"Create"},ThemeEditor:{title:"Theme Editor",clearAllVars:"Clear All Variables",clearSearch:"Clear Search",filterCompName:"Filter Component Name",filterVarName:"Filter Variable Name",import:"Import",export:"Export",restore:"Reset to Default"},Image:{tipPrevious:"Previous picture (←)",tipNext:"Next picture (→)",tipCounterclockwise:"Counterclockwise",tipClockwise:"Clockwise",tipZoomOut:"Zoom out",tipZoomIn:"Zoom in",tipDownload:"Download",tipClose:"Close (Esc)",tipOriginalSize:"Zoom to original size"},Heatmap:{less:"less",more:"more",monthFormat:"MMM",weekdayFormat:"eee"}};function la(t){return(e={})=>{const n=e.width?String(e.width):t.defaultWidth;return t.formats[n]||t.formats[t.defaultWidth]}}function br(t){return(e,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let s;if(r==="formatting"&&t.formattingValues){const a=t.defaultFormattingWidth||t.defaultWidth,l=n!=null&&n.width?String(n.width):a;s=t.formattingValues[l]||t.formattingValues[a]}else{const a=t.defaultWidth,l=n!=null&&n.width?String(n.width):t.defaultWidth;s=t.values[l]||t.values[a]}const o=t.argumentCallback?t.argumentCallback(e):e;return s[o]}}function _r(t){return(e,n={})=>{const r=n.width,s=r&&t.matchPatterns[r]||t.matchPatterns[t.defaultMatchWidth],o=e.match(s);if(!o)return null;const a=o[0],l=r&&t.parsePatterns[r]||t.parsePatterns[t.defaultParseWidth],c=Array.isArray(l)?Cw(l,u=>u.test(a)):kw(l,u=>u.test(a));let d;d=t.valueCallback?t.valueCallback(c):c,d=n.valueCallback?n.valueCallback(d):d;const h=e.slice(a.length);return{value:d,rest:h}}}function kw(t,e){for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&e(t[n]))return n}function Cw(t,e){for(let n=0;n<t.length;n++)if(e(t[n]))return n}function Sw(t){return(e,n={})=>{const r=e.match(t.matchPattern);if(!r)return null;const s=r[0],o=e.match(t.parsePattern);if(!o)return null;let a=t.valueCallback?t.valueCallback(o[0]):o[0];a=n.valueCallback?n.valueCallback(a):a;const l=e.slice(s.length);return{value:a,rest:l}}}const Bw={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},Tw=(t,e,n)=>{let r;const s=Bw[t];return typeof s=="string"?r=s:e===1?r=s.one:r=s.other.replace("{{count}}",e.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r},Rw={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},$w=(t,e,n,r)=>Rw[t],Ew={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Nw={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Pw={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},Fw={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},Mw={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},Aw={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},Vw={ordinalNumber:(t,e)=>{const n=Number(t),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:br({values:Ew,defaultWidth:"wide"}),quarter:br({values:Nw,defaultWidth:"wide",argumentCallback:t=>t-1}),month:br({values:Pw,defaultWidth:"wide"}),day:br({values:Fw,defaultWidth:"wide"}),dayPeriod:br({values:Mw,defaultWidth:"wide",formattingValues:Aw,defaultFormattingWidth:"wide"})},Ow=/^(\d+)(th|st|nd|rd)?/i,Iw=/\d+/i,zw={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},Lw={any:[/^b/i,/^(a|c)/i]},Dw={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Hw={any:[/1/i,/2/i,/3/i,/4/i]},Ww={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},jw={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},qw={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},Xw={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},Yw={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},Uw={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},Gw={ordinalNumber:Sw({matchPattern:Ow,parsePattern:Iw,valueCallback:t=>parseInt(t,10)}),era:_r({matchPatterns:zw,defaultMatchWidth:"wide",parsePatterns:Lw,defaultParseWidth:"any"}),quarter:_r({matchPatterns:Dw,defaultMatchWidth:"wide",parsePatterns:Hw,defaultParseWidth:"any",valueCallback:t=>t+1}),month:_r({matchPatterns:Ww,defaultMatchWidth:"wide",parsePatterns:jw,defaultParseWidth:"any"}),day:_r({matchPatterns:qw,defaultMatchWidth:"wide",parsePatterns:Xw,defaultParseWidth:"any"}),dayPeriod:_r({matchPatterns:Yw,defaultMatchWidth:"any",parsePatterns:Uw,defaultParseWidth:"any"})},Kw={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Zw={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Qw={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Jw={date:la({formats:Kw,defaultWidth:"full"}),time:la({formats:Zw,defaultWidth:"full"}),dateTime:la({formats:Qw,defaultWidth:"full"})},ex={name:"en-US",locale:{code:"en-US",formatDistance:Tw,formatLong:Jw,formatRelative:$w,localize:Vw,match:Gw,options:{weekStartsOn:0,firstWeekContainsDate:1}}};function Qh(t){const{mergedLocaleRef:e,mergedDateLocaleRef:n}=i.inject(fi,null)||{},r=i.computed(()=>{var o,a;return(a=(o=e==null?void 0:e.value)===null||o===void 0?void 0:o[t])!==null&&a!==void 0?a:vw[t]});return{dateLocaleRef:i.computed(()=>{var o;return(o=n==null?void 0:n.value)!==null&&o!==void 0?o:ex}),localeRef:r}}const wr="naive-ui-style";function xr(t,e,n){if(!e)return;const r=ci(),s=i.computed(()=>{const{value:l}=e;if(!l)return;const c=l[t];if(c)return c}),o=i.inject(fi,null),a=()=>{i.watchEffect(()=>{const{value:l}=n,c=`${l}${t}Rtl`;if(C1(c,r))return;const{value:d}=s;d&&d.style.mount({id:c,head:!0,anchorMetaName:wr,props:{bPrefix:l?`.${l}-`:void 0},ssr:r,parent:o==null?void 0:o.styleMountTarget})})};return r?a():i.onBeforeMount(a),s}const vr={fontFamily:'v-sans, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',fontFamilyMono:"v-mono, SFMono-Regular, Menlo, Consolas, Courier, monospace",fontWeight:"400",fontWeightStrong:"500",cubicBezierEaseInOut:"cubic-bezier(.4, 0, .2, 1)",cubicBezierEaseOut:"cubic-bezier(0, 0, .2, 1)",cubicBezierEaseIn:"cubic-bezier(.4, 0, 1, 1)",borderRadius:"3px",borderRadiusSmall:"2px",fontSize:"14px",fontSizeMini:"12px",fontSizeTiny:"12px",fontSizeSmall:"14px",fontSizeMedium:"14px",fontSizeLarge:"15px",fontSizeHuge:"16px",lineHeight:"1.6",heightMini:"16px",heightTiny:"22px",heightSmall:"28px",heightMedium:"34px",heightLarge:"40px",heightHuge:"46px"},{fontSize:tx,fontFamily:nx,lineHeight:ix}=vr,Jh=ae("body",`
117
117
  margin: 0;
118
- font-size: ${Dw};
119
- font-family: ${Hw};
120
- line-height: ${Ww};
118
+ font-size: ${tx};
119
+ font-family: ${nx};
120
+ line-height: ${ix};
121
121
  -webkit-text-size-adjust: 100%;
122
122
  -webkit-tap-highlight-color: transparent;
123
123
  `,[ae("input",`
124
124
  font-family: inherit;
125
125
  font-size: inherit;
126
- `)]);var jw={};function Ss(t,e,n){if(!e){jw.NODE_ENV!=="production"&&Gh("use-style","No style is specified.");return}const r=li(),s=i.inject(ui,null),o=()=>{const a=n.value;e.mount({id:a===void 0?t:a+t,head:!0,anchorMetaName:_r,props:{bPrefix:a?`.${a}-`:void 0},ssr:r,parent:s==null?void 0:s.styleMountTarget}),s!=null&&s.preflightStyleDisabled||Qh.mount({id:"n-global",head:!0,anchorMetaName:_r,ssr:r,parent:s==null?void 0:s.styleMountTarget})};r?o():i.onBeforeMount(o)}function U2(t){return t}function gt(t,e,n,r,s,o){const a=li(),l=i.inject(ui,null);if(n){const d=()=>{const h=o==null?void 0:o.value;n.mount({id:h===void 0?e:h+e,head:!0,props:{bPrefix:h?`.${h}-`:void 0},anchorMetaName:_r,ssr:a,parent:l==null?void 0:l.styleMountTarget}),l!=null&&l.preflightStyleDisabled||Qh.mount({id:"n-global",head:!0,anchorMetaName:_r,ssr:a,parent:l==null?void 0:l.styleMountTarget})};a?d():i.onBeforeMount(d)}return i.computed(()=>{var d;const{theme:{common:h,self:u,peers:m={}}={},themeOverrides:f={},builtinThemeOverrides:g={}}=s,{common:p,peers:b}=f,{common:y=void 0,[t]:{common:_=void 0,self:S=void 0,peers:C={}}={}}=(l==null?void 0:l.mergedThemeRef.value)||{},{common:v=void 0,[t]:B={}}=(l==null?void 0:l.mergedThemeOverridesRef.value)||{},{common:k,peers:R={}}=B,$=A.merge({},h||_||y||r.common,v,k,p),F=A.merge((d=u||S||r.self)===null||d===void 0?void 0:d($),g,B,f);return{common:$,self:F,peers:A.merge({},r.peers,C,m),peerOverrides:A.merge({},g.peers,R,b)}})}gt.props={theme:Object,themeOverrides:Object,builtinThemeOverrides:Object};const qw=ge("base-icon",`
126
+ `)]);var rx={};function Ss(t,e,n){if(!e){rx.NODE_ENV!=="production"&&Gh("use-style","No style is specified.");return}const r=ci(),s=i.inject(fi,null),o=()=>{const a=n.value;e.mount({id:a===void 0?t:a+t,head:!0,anchorMetaName:wr,props:{bPrefix:a?`.${a}-`:void 0},ssr:r,parent:s==null?void 0:s.styleMountTarget}),s!=null&&s.preflightStyleDisabled||Jh.mount({id:"n-global",head:!0,anchorMetaName:wr,ssr:r,parent:s==null?void 0:s.styleMountTarget})};r?o():i.onBeforeMount(o)}function lC(t){return t}function ut(t,e,n,r,s,o){const a=ci(),l=i.inject(fi,null);if(n){const d=()=>{const h=o==null?void 0:o.value;n.mount({id:h===void 0?e:h+e,head:!0,props:{bPrefix:h?`.${h}-`:void 0},anchorMetaName:wr,ssr:a,parent:l==null?void 0:l.styleMountTarget}),l!=null&&l.preflightStyleDisabled||Jh.mount({id:"n-global",head:!0,anchorMetaName:wr,ssr:a,parent:l==null?void 0:l.styleMountTarget})};a?d():i.onBeforeMount(d)}return i.computed(()=>{var d;const{theme:{common:h,self:u,peers:m={}}={},themeOverrides:g={},builtinThemeOverrides:f={}}=s,{common:p,peers:y}=g,{common:b=void 0,[t]:{common:_=void 0,self:C=void 0,peers:S={}}={}}=(l==null?void 0:l.mergedThemeRef.value)||{},{common:v=void 0,[t]:B={}}=(l==null?void 0:l.mergedThemeOverridesRef.value)||{},{common:k,peers:R={}}=B,$=O.merge({},h||_||b||r.common,v,k,p),P=O.merge((d=u||C||r.self)===null||d===void 0?void 0:d($),f,B,g);return{common:$,self:P,peers:O.merge({},r.peers,S,m),peerOverrides:O.merge({},f.peers,R,y)}})}ut.props={theme:Object,themeOverrides:Object,builtinThemeOverrides:Object};const sx=ue("base-icon",`
127
127
  height: 1em;
128
128
  width: 1em;
129
129
  line-height: 1em;
@@ -134,7 +134,7 @@ ${s}
134
134
  `,[ae("svg",`
135
135
  height: 1em;
136
136
  width: 1em;
137
- `)]),vr=i.defineComponent({name:"BaseIcon",props:{role:String,ariaLabel:String,ariaDisabled:{type:Boolean,default:void 0},ariaHidden:{type:Boolean,default:void 0},clsPrefix:{type:String,required:!0},onClick:Function,onMousedown:Function,onMouseup:Function},setup(t){Ss("-base-icon",qw,i.toRef(t,"clsPrefix"))},render(){return i.h("i",{class:`${this.clsPrefix}-base-icon`,onClick:this.onClick,onMousedown:this.onMousedown,onMouseup:this.onMouseup,role:this.role,"aria-label":this.ariaLabel,"aria-hidden":this.ariaHidden,"aria-disabled":this.ariaDisabled},this.$slots)}}),eu=i.defineComponent({name:"BaseIconSwitchTransition",setup(t,{slots:e}){const n=fs();return()=>i.h(i.Transition,{name:"icon-switch-transition",appear:n.value},e)}});function tu(t,e){const n=i.defineComponent({render(){return e()}});return i.defineComponent({name:A.upperFirst(t),setup(){var r;const s=(r=i.inject(ui,null))===null||r===void 0?void 0:r.mergedIconsRef;return()=>{var o;const a=(o=s==null?void 0:s.value)===null||o===void 0?void 0:o[t];return a?a():i.h(n,null)}}})}const Xw=i.defineComponent({name:"Checkmark",render(){return i.h("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16"},i.h("g",{fill:"none"},i.h("path",{d:"M14.046 3.486a.75.75 0 0 1-.032 1.06l-7.93 7.474a.85.85 0 0 1-1.188-.022l-2.68-2.72a.75.75 0 1 1 1.068-1.053l2.234 2.267l7.468-7.038a.75.75 0 0 1 1.06.032z",fill:"currentColor"})))}}),Yw=i.defineComponent({name:"ChevronDown",render(){return i.h("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i.h("path",{d:"M3.14645 5.64645C3.34171 5.45118 3.65829 5.45118 3.85355 5.64645L8 9.79289L12.1464 5.64645C12.3417 5.45118 12.6583 5.45118 12.8536 5.64645C13.0488 5.84171 13.0488 6.15829 12.8536 6.35355L8.35355 10.8536C8.15829 11.0488 7.84171 11.0488 7.64645 10.8536L3.14645 6.35355C2.95118 6.15829 2.95118 5.84171 3.14645 5.64645Z",fill:"currentColor"}))}}),Uw=tu("clear",()=>i.h("svg",{viewBox:"0 0 16 16",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},i.h("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},i.h("g",{fill:"currentColor","fill-rule":"nonzero"},i.h("path",{d:"M8,2 C11.3137085,2 14,4.6862915 14,8 C14,11.3137085 11.3137085,14 8,14 C4.6862915,14 2,11.3137085 2,8 C2,4.6862915 4.6862915,2 8,2 Z M6.5343055,5.83859116 C6.33943736,5.70359511 6.07001296,5.72288026 5.89644661,5.89644661 L5.89644661,5.89644661 L5.83859116,5.9656945 C5.70359511,6.16056264 5.72288026,6.42998704 5.89644661,6.60355339 L5.89644661,6.60355339 L7.293,8 L5.89644661,9.39644661 L5.83859116,9.4656945 C5.70359511,9.66056264 5.72288026,9.92998704 5.89644661,10.1035534 L5.89644661,10.1035534 L5.9656945,10.1614088 C6.16056264,10.2964049 6.42998704,10.2771197 6.60355339,10.1035534 L6.60355339,10.1035534 L8,8.707 L9.39644661,10.1035534 L9.4656945,10.1614088 C9.66056264,10.2964049 9.92998704,10.2771197 10.1035534,10.1035534 L10.1035534,10.1035534 L10.1614088,10.0343055 C10.2964049,9.83943736 10.2771197,9.57001296 10.1035534,9.39644661 L10.1035534,9.39644661 L8.707,8 L10.1035534,6.60355339 L10.1614088,6.5343055 C10.2964049,6.33943736 10.2771197,6.07001296 10.1035534,5.89644661 L10.1035534,5.89644661 L10.0343055,5.83859116 C9.83943736,5.70359511 9.57001296,5.72288026 9.39644661,5.89644661 L9.39644661,5.89644661 L8,7.293 L6.60355339,5.89644661 Z"}))))),Gw=tu("close",()=>i.h("svg",{viewBox:"0 0 12 12",version:"1.1",xmlns:"http://www.w3.org/2000/svg","aria-hidden":!0},i.h("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},i.h("g",{fill:"currentColor","fill-rule":"nonzero"},i.h("path",{d:"M2.08859116,2.2156945 L2.14644661,2.14644661 C2.32001296,1.97288026 2.58943736,1.95359511 2.7843055,2.08859116 L2.85355339,2.14644661 L6,5.293 L9.14644661,2.14644661 C9.34170876,1.95118446 9.65829124,1.95118446 9.85355339,2.14644661 C10.0488155,2.34170876 10.0488155,2.65829124 9.85355339,2.85355339 L6.707,6 L9.85355339,9.14644661 C10.0271197,9.32001296 10.0464049,9.58943736 9.91140884,9.7843055 L9.85355339,9.85355339 C9.67998704,10.0271197 9.41056264,10.0464049 9.2156945,9.91140884 L9.14644661,9.85355339 L6,6.707 L2.85355339,9.85355339 C2.65829124,10.0488155 2.34170876,10.0488155 2.14644661,9.85355339 C1.95118446,9.65829124 1.95118446,9.34170876 2.14644661,9.14644661 L5.293,6 L2.14644661,2.85355339 C1.97288026,2.67998704 1.95359511,2.41056264 2.08859116,2.2156945 L2.14644661,2.14644661 L2.08859116,2.2156945 Z"}))))),Kw=i.defineComponent({name:"Empty",render(){return i.h("svg",{viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i.h("path",{d:"M26 7.5C26 11.0899 23.0899 14 19.5 14C15.9101 14 13 11.0899 13 7.5C13 3.91015 15.9101 1 19.5 1C23.0899 1 26 3.91015 26 7.5ZM16.8536 4.14645C16.6583 3.95118 16.3417 3.95118 16.1464 4.14645C15.9512 4.34171 15.9512 4.65829 16.1464 4.85355L18.7929 7.5L16.1464 10.1464C15.9512 10.3417 15.9512 10.6583 16.1464 10.8536C16.3417 11.0488 16.6583 11.0488 16.8536 10.8536L19.5 8.20711L22.1464 10.8536C22.3417 11.0488 22.6583 11.0488 22.8536 10.8536C23.0488 10.6583 23.0488 10.3417 22.8536 10.1464L20.2071 7.5L22.8536 4.85355C23.0488 4.65829 23.0488 4.34171 22.8536 4.14645C22.6583 3.95118 22.3417 3.95118 22.1464 4.14645L19.5 6.79289L16.8536 4.14645Z",fill:"currentColor"}),i.h("path",{d:"M25 22.75V12.5991C24.5572 13.0765 24.053 13.4961 23.5 13.8454V16H17.5L17.3982 16.0068C17.0322 16.0565 16.75 16.3703 16.75 16.75C16.75 18.2688 15.5188 19.5 14 19.5C12.4812 19.5 11.25 18.2688 11.25 16.75L11.2432 16.6482C11.1935 16.2822 10.8797 16 10.5 16H4.5V7.25C4.5 6.2835 5.2835 5.5 6.25 5.5H12.2696C12.4146 4.97463 12.6153 4.47237 12.865 4H6.25C4.45507 4 3 5.45507 3 7.25V22.75C3 24.5449 4.45507 26 6.25 26H21.75C23.5449 26 25 24.5449 25 22.75ZM4.5 22.75V17.5H9.81597L9.85751 17.7041C10.2905 19.5919 11.9808 21 14 21L14.215 20.9947C16.2095 20.8953 17.842 19.4209 18.184 17.5H23.5V22.75C23.5 23.7165 22.7165 24.5 21.75 24.5H6.25C5.2835 24.5 4.5 23.7165 4.5 22.75Z",fill:"currentColor"}))}}),{cubicBezierEaseInOut:Zw}=xr;function ca({originalTransform:t="",left:e=0,top:n=0,transition:r=`all .3s ${Zw} !important`}={}){return[ae("&.icon-switch-transition-enter-from, &.icon-switch-transition-leave-to",{transform:`${t} scale(0.75)`,left:e,top:n,opacity:0}),ae("&.icon-switch-transition-enter-to, &.icon-switch-transition-leave-from",{transform:`scale(1) ${t}`,left:e,top:n,opacity:1}),ae("&.icon-switch-transition-enter-active, &.icon-switch-transition-leave-active",{transformOrigin:"center",position:"absolute",left:e,top:n,transition:r})]}const Jw=ge("base-clear",`
137
+ `)]),kr=i.defineComponent({name:"BaseIcon",props:{role:String,ariaLabel:String,ariaDisabled:{type:Boolean,default:void 0},ariaHidden:{type:Boolean,default:void 0},clsPrefix:{type:String,required:!0},onClick:Function,onMousedown:Function,onMouseup:Function},setup(t){Ss("-base-icon",sx,i.toRef(t,"clsPrefix"))},render(){return i.h("i",{class:`${this.clsPrefix}-base-icon`,onClick:this.onClick,onMousedown:this.onMousedown,onMouseup:this.onMouseup,role:this.role,"aria-label":this.ariaLabel,"aria-hidden":this.ariaHidden,"aria-disabled":this.ariaDisabled},this.$slots)}}),eu=i.defineComponent({name:"BaseIconSwitchTransition",setup(t,{slots:e}){const n=fs();return()=>i.h(i.Transition,{name:"icon-switch-transition",appear:n.value},e)}});function tu(t,e){const n=i.defineComponent({render(){return e()}});return i.defineComponent({name:O.upperFirst(t),setup(){var r;const s=(r=i.inject(fi,null))===null||r===void 0?void 0:r.mergedIconsRef;return()=>{var o;const a=(o=s==null?void 0:s.value)===null||o===void 0?void 0:o[t];return a?a():i.h(n,null)}}})}const ox=i.defineComponent({name:"Checkmark",render(){return i.h("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16"},i.h("g",{fill:"none"},i.h("path",{d:"M14.046 3.486a.75.75 0 0 1-.032 1.06l-7.93 7.474a.85.85 0 0 1-1.188-.022l-2.68-2.72a.75.75 0 1 1 1.068-1.053l2.234 2.267l7.468-7.038a.75.75 0 0 1 1.06.032z",fill:"currentColor"})))}}),ax=i.defineComponent({name:"ChevronDown",render(){return i.h("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i.h("path",{d:"M3.14645 5.64645C3.34171 5.45118 3.65829 5.45118 3.85355 5.64645L8 9.79289L12.1464 5.64645C12.3417 5.45118 12.6583 5.45118 12.8536 5.64645C13.0488 5.84171 13.0488 6.15829 12.8536 6.35355L8.35355 10.8536C8.15829 11.0488 7.84171 11.0488 7.64645 10.8536L3.14645 6.35355C2.95118 6.15829 2.95118 5.84171 3.14645 5.64645Z",fill:"currentColor"}))}}),lx=tu("clear",()=>i.h("svg",{viewBox:"0 0 16 16",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},i.h("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},i.h("g",{fill:"currentColor","fill-rule":"nonzero"},i.h("path",{d:"M8,2 C11.3137085,2 14,4.6862915 14,8 C14,11.3137085 11.3137085,14 8,14 C4.6862915,14 2,11.3137085 2,8 C2,4.6862915 4.6862915,2 8,2 Z M6.5343055,5.83859116 C6.33943736,5.70359511 6.07001296,5.72288026 5.89644661,5.89644661 L5.89644661,5.89644661 L5.83859116,5.9656945 C5.70359511,6.16056264 5.72288026,6.42998704 5.89644661,6.60355339 L5.89644661,6.60355339 L7.293,8 L5.89644661,9.39644661 L5.83859116,9.4656945 C5.70359511,9.66056264 5.72288026,9.92998704 5.89644661,10.1035534 L5.89644661,10.1035534 L5.9656945,10.1614088 C6.16056264,10.2964049 6.42998704,10.2771197 6.60355339,10.1035534 L6.60355339,10.1035534 L8,8.707 L9.39644661,10.1035534 L9.4656945,10.1614088 C9.66056264,10.2964049 9.92998704,10.2771197 10.1035534,10.1035534 L10.1035534,10.1035534 L10.1614088,10.0343055 C10.2964049,9.83943736 10.2771197,9.57001296 10.1035534,9.39644661 L10.1035534,9.39644661 L8.707,8 L10.1035534,6.60355339 L10.1614088,6.5343055 C10.2964049,6.33943736 10.2771197,6.07001296 10.1035534,5.89644661 L10.1035534,5.89644661 L10.0343055,5.83859116 C9.83943736,5.70359511 9.57001296,5.72288026 9.39644661,5.89644661 L9.39644661,5.89644661 L8,7.293 L6.60355339,5.89644661 Z"}))))),cx=tu("close",()=>i.h("svg",{viewBox:"0 0 12 12",version:"1.1",xmlns:"http://www.w3.org/2000/svg","aria-hidden":!0},i.h("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},i.h("g",{fill:"currentColor","fill-rule":"nonzero"},i.h("path",{d:"M2.08859116,2.2156945 L2.14644661,2.14644661 C2.32001296,1.97288026 2.58943736,1.95359511 2.7843055,2.08859116 L2.85355339,2.14644661 L6,5.293 L9.14644661,2.14644661 C9.34170876,1.95118446 9.65829124,1.95118446 9.85355339,2.14644661 C10.0488155,2.34170876 10.0488155,2.65829124 9.85355339,2.85355339 L6.707,6 L9.85355339,9.14644661 C10.0271197,9.32001296 10.0464049,9.58943736 9.91140884,9.7843055 L9.85355339,9.85355339 C9.67998704,10.0271197 9.41056264,10.0464049 9.2156945,9.91140884 L9.14644661,9.85355339 L6,6.707 L2.85355339,9.85355339 C2.65829124,10.0488155 2.34170876,10.0488155 2.14644661,9.85355339 C1.95118446,9.65829124 1.95118446,9.34170876 2.14644661,9.14644661 L5.293,6 L2.14644661,2.85355339 C1.97288026,2.67998704 1.95359511,2.41056264 2.08859116,2.2156945 L2.14644661,2.14644661 L2.08859116,2.2156945 Z"}))))),dx=i.defineComponent({name:"Empty",render(){return i.h("svg",{viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i.h("path",{d:"M26 7.5C26 11.0899 23.0899 14 19.5 14C15.9101 14 13 11.0899 13 7.5C13 3.91015 15.9101 1 19.5 1C23.0899 1 26 3.91015 26 7.5ZM16.8536 4.14645C16.6583 3.95118 16.3417 3.95118 16.1464 4.14645C15.9512 4.34171 15.9512 4.65829 16.1464 4.85355L18.7929 7.5L16.1464 10.1464C15.9512 10.3417 15.9512 10.6583 16.1464 10.8536C16.3417 11.0488 16.6583 11.0488 16.8536 10.8536L19.5 8.20711L22.1464 10.8536C22.3417 11.0488 22.6583 11.0488 22.8536 10.8536C23.0488 10.6583 23.0488 10.3417 22.8536 10.1464L20.2071 7.5L22.8536 4.85355C23.0488 4.65829 23.0488 4.34171 22.8536 4.14645C22.6583 3.95118 22.3417 3.95118 22.1464 4.14645L19.5 6.79289L16.8536 4.14645Z",fill:"currentColor"}),i.h("path",{d:"M25 22.75V12.5991C24.5572 13.0765 24.053 13.4961 23.5 13.8454V16H17.5L17.3982 16.0068C17.0322 16.0565 16.75 16.3703 16.75 16.75C16.75 18.2688 15.5188 19.5 14 19.5C12.4812 19.5 11.25 18.2688 11.25 16.75L11.2432 16.6482C11.1935 16.2822 10.8797 16 10.5 16H4.5V7.25C4.5 6.2835 5.2835 5.5 6.25 5.5H12.2696C12.4146 4.97463 12.6153 4.47237 12.865 4H6.25C4.45507 4 3 5.45507 3 7.25V22.75C3 24.5449 4.45507 26 6.25 26H21.75C23.5449 26 25 24.5449 25 22.75ZM4.5 22.75V17.5H9.81597L9.85751 17.7041C10.2905 19.5919 11.9808 21 14 21L14.215 20.9947C16.2095 20.8953 17.842 19.4209 18.184 17.5H23.5V22.75C23.5 23.7165 22.7165 24.5 21.75 24.5H6.25C5.2835 24.5 4.5 23.7165 4.5 22.75Z",fill:"currentColor"}))}}),{cubicBezierEaseInOut:hx}=vr;function ca({originalTransform:t="",left:e=0,top:n=0,transition:r=`all .3s ${hx} !important`}={}){return[ae("&.icon-switch-transition-enter-from, &.icon-switch-transition-leave-to",{transform:`${t} scale(0.75)`,left:e,top:n,opacity:0}),ae("&.icon-switch-transition-enter-to, &.icon-switch-transition-leave-from",{transform:`scale(1) ${t}`,left:e,top:n,opacity:1}),ae("&.icon-switch-transition-enter-active, &.icon-switch-transition-leave-active",{transformOrigin:"center",position:"absolute",left:e,top:n,transition:r})]}const ux=ue("base-clear",`
138
138
  flex-shrink: 0;
139
139
  height: 1em;
140
140
  width: 1em;
@@ -158,7 +158,7 @@ ${s}
158
158
  left: 50%;
159
159
  top: 50%;
160
160
  transform: translateX(-50%) translateY(-50%);
161
- `,[ca({originalTransform:"translateX(-50%) translateY(-50%)",left:"50%",top:"50%"})])])]),Qw=i.defineComponent({name:"BaseClear",props:{clsPrefix:{type:String,required:!0},show:Boolean,onClear:Function},setup(t){return Ss("-base-clear",Jw,i.toRef(t,"clsPrefix")),{handleMouseDown(e){e.preventDefault()}}},render(){const{clsPrefix:t}=this;return i.h("div",{class:`${t}-base-clear`},i.h(eu,null,{default:()=>{var e,n;return this.show?i.h("div",{key:"dismiss",class:`${t}-base-clear__clear`,onClick:this.onClear,onMousedown:this.handleMouseDown,"data-clear":!0},oa(this.$slots.icon,()=>[i.h(vr,{clsPrefix:t},{default:()=>i.h(Uw,null)})])):i.h("div",{key:"icon",class:`${t}-base-clear__placeholder`},(n=(e=this.$slots).placeholder)===null||n===void 0?void 0:n.call(e))}}))}}),ex=ge("base-close",`
161
+ `,[ca({originalTransform:"translateX(-50%) translateY(-50%)",left:"50%",top:"50%"})])])]),fx=i.defineComponent({name:"BaseClear",props:{clsPrefix:{type:String,required:!0},show:Boolean,onClear:Function},setup(t){return Ss("-base-clear",ux,i.toRef(t,"clsPrefix")),{handleMouseDown(e){e.preventDefault()}}},render(){const{clsPrefix:t}=this;return i.h("div",{class:`${t}-base-clear`},i.h(eu,null,{default:()=>{var e,n;return this.show?i.h("div",{key:"dismiss",class:`${t}-base-clear__clear`,onClick:this.onClear,onMousedown:this.handleMouseDown,"data-clear":!0},oa(this.$slots.icon,()=>[i.h(kr,{clsPrefix:t},{default:()=>i.h(lx,null)})])):i.h("div",{key:"icon",class:`${t}-base-clear__placeholder`},(n=(e=this.$slots).placeholder)===null||n===void 0?void 0:n.call(e))}}))}}),gx=ue("base-close",`
162
162
  display: flex;
163
163
  align-items: center;
164
164
  justify-content: center;
@@ -173,7 +173,7 @@ ${s}
173
173
  border: none;
174
174
  position: relative;
175
175
  padding: 0;
176
- `,[Ce("absolute",`
176
+ `,[Be("absolute",`
177
177
  height: var(--n-close-icon-size);
178
178
  width: var(--n-close-icon-size);
179
179
  `),ae("&::before",`
@@ -186,7 +186,7 @@ ${s}
186
186
  transform: translateY(-50%) translateX(-50%);
187
187
  transition: inherit;
188
188
  border-radius: inherit;
189
- `),Gt("disabled",[ae("&:hover",`
189
+ `),Ut("disabled",[ae("&:hover",`
190
190
  color: var(--n-close-icon-color-hover);
191
191
  `),ae("&:hover::before",`
192
192
  background-color: var(--n-close-color-hover);
@@ -196,13 +196,13 @@ ${s}
196
196
  color: var(--n-close-icon-color-pressed);
197
197
  `),ae("&:active::before",`
198
198
  background-color: var(--n-close-color-pressed);
199
- `)]),Ce("disabled",`
199
+ `)]),Be("disabled",`
200
200
  cursor: not-allowed;
201
201
  color: var(--n-close-icon-color-disabled);
202
202
  background-color: transparent;
203
- `),Ce("round",[ae("&::before",`
203
+ `),Be("round",[ae("&::before",`
204
204
  border-radius: 50%;
205
- `)])]),tx=i.defineComponent({name:"BaseClose",props:{isButtonTag:{type:Boolean,default:!0},clsPrefix:{type:String,required:!0},disabled:{type:Boolean,default:void 0},focusable:{type:Boolean,default:!0},round:Boolean,onClick:Function,absolute:Boolean},setup(t){return Ss("-base-close",ex,i.toRef(t,"clsPrefix")),()=>{const{clsPrefix:e,disabled:n,absolute:r,round:s,isButtonTag:o}=t,a=o?"button":"div";return i.h(a,{type:o?"button":void 0,tabindex:n||!t.focusable?-1:0,"aria-disabled":n,"aria-label":"close",role:o?void 0:"button",disabled:n,class:[`${e}-base-close`,r&&`${e}-base-close--absolute`,n&&`${e}-base-close--disabled`,s&&`${e}-base-close--round`],onMousedown:l=>{t.focusable||l.preventDefault()},onClick:t.onClick},i.h(vr,{clsPrefix:e},{default:()=>i.h(Gw,null)}))}}}),nx=i.defineComponent({props:{onFocus:Function,onBlur:Function},setup(t){return()=>i.h("div",{style:"width: 0; height: 0",tabindex:0,onFocus:t.onFocus,onBlur:t.onBlur})}}),ix=ae([ae("@keyframes rotator",`
205
+ `)])]),mx=i.defineComponent({name:"BaseClose",props:{isButtonTag:{type:Boolean,default:!0},clsPrefix:{type:String,required:!0},disabled:{type:Boolean,default:void 0},focusable:{type:Boolean,default:!0},round:Boolean,onClick:Function,absolute:Boolean},setup(t){return Ss("-base-close",gx,i.toRef(t,"clsPrefix")),()=>{const{clsPrefix:e,disabled:n,absolute:r,round:s,isButtonTag:o}=t,a=o?"button":"div";return i.h(a,{type:o?"button":void 0,tabindex:n||!t.focusable?-1:0,"aria-disabled":n,"aria-label":"close",role:o?void 0:"button",disabled:n,class:[`${e}-base-close`,r&&`${e}-base-close--absolute`,n&&`${e}-base-close--disabled`,s&&`${e}-base-close--round`],onMousedown:l=>{t.focusable||l.preventDefault()},onClick:t.onClick},i.h(kr,{clsPrefix:e},{default:()=>i.h(cx,null)}))}}}),px=i.defineComponent({props:{onFocus:Function,onBlur:Function},setup(t){return()=>i.h("div",{style:"width: 0; height: 0",tabindex:0,onFocus:t.onFocus,onBlur:t.onBlur})}}),yx=ae([ae("@keyframes rotator",`
206
206
  0% {
207
207
  -webkit-transform: rotate(0deg);
208
208
  transform: rotate(0deg);
@@ -210,7 +210,7 @@ ${s}
210
210
  100% {
211
211
  -webkit-transform: rotate(360deg);
212
212
  transform: rotate(360deg);
213
- }`),ge("base-loading",`
213
+ }`),ue("base-loading",`
214
214
  position: relative;
215
215
  line-height: 0;
216
216
  width: 1em;
@@ -229,13 +229,13 @@ ${s}
229
229
  `,[ye("icon",`
230
230
  height: 1em;
231
231
  width: 1em;
232
- `)])])]),da="1.6s",rx={strokeWidth:{type:Number,default:28},stroke:{type:String,default:void 0}},nu=i.defineComponent({name:"BaseLoading",props:Object.assign({clsPrefix:{type:String,required:!0},show:{type:Boolean,default:!0},scale:{type:Number,default:1},radius:{type:Number,default:100}},rx),setup(t){Ss("-base-loading",ix,i.toRef(t,"clsPrefix"))},render(){const{clsPrefix:t,radius:e,strokeWidth:n,stroke:r,scale:s}=this,o=e/s;return i.h("div",{class:`${t}-base-loading`,role:"img","aria-label":"loading"},i.h(eu,null,{default:()=>this.show?i.h("div",{key:"icon",class:`${t}-base-loading__transition-wrapper`},i.h("div",{class:`${t}-base-loading__container`},i.h("svg",{class:`${t}-base-loading__icon`,viewBox:`0 0 ${2*o} ${2*o}`,xmlns:"http://www.w3.org/2000/svg",style:{color:r}},i.h("g",null,i.h("animateTransform",{attributeName:"transform",type:"rotate",values:`0 ${o} ${o};270 ${o} ${o}`,begin:"0s",dur:da,fill:"freeze",repeatCount:"indefinite"}),i.h("circle",{class:`${t}-base-loading__icon`,fill:"none",stroke:"currentColor","stroke-width":n,"stroke-linecap":"round",cx:o,cy:o,r:e-n/2,"stroke-dasharray":5.67*e,"stroke-dashoffset":18.48*e},i.h("animateTransform",{attributeName:"transform",type:"rotate",values:`0 ${o} ${o};135 ${o} ${o};450 ${o} ${o}`,begin:"0s",dur:da,fill:"freeze",repeatCount:"indefinite"}),i.h("animate",{attributeName:"stroke-dashoffset",values:`${5.67*e};${1.42*e};${5.67*e}`,begin:"0s",dur:da,fill:"freeze",repeatCount:"indefinite"})))))):i.h("div",{key:"placeholder",class:`${t}-base-loading__placeholder`},this.$slots)}))}}),{cubicBezierEaseInOut:iu}=xr;function sx({name:t="fade-in",enterDuration:e="0.2s",leaveDuration:n="0.2s",enterCubicBezier:r=iu,leaveCubicBezier:s=iu}={}){return[ae(`&.${t}-transition-enter-active`,{transition:`all ${e} ${r}!important`}),ae(`&.${t}-transition-leave-active`,{transition:`all ${n} ${s}!important`}),ae(`&.${t}-transition-enter-from, &.${t}-transition-leave-to`,{opacity:0}),ae(`&.${t}-transition-leave-from, &.${t}-transition-enter-to`,{opacity:1})]}const ue={neutralBase:"#FFF",neutralInvertBase:"#000",neutralTextBase:"#000",neutralPopover:"#fff",neutralCard:"#fff",neutralModal:"#fff",neutralBody:"#fff",alpha1:"0.82",alpha2:"0.72",alpha3:"0.38",alpha4:"0.24",alpha5:"0.18",alphaClose:"0.6",alphaDisabled:"0.5",alphaAvatar:"0.2",alphaProgressRail:".08",alphaInput:"0",alphaScrollbar:"0.25",alphaScrollbarHover:"0.4",primaryHover:"#36ad6a",primaryDefault:"#18a058",primaryActive:"#0c7a43",primarySuppl:"#36ad6a",infoHover:"#4098fc",infoDefault:"#2080f0",infoActive:"#1060c9",infoSuppl:"#4098fc",errorHover:"#de576d",errorDefault:"#d03050",errorActive:"#ab1f3f",errorSuppl:"#de576d",warningHover:"#fcb040",warningDefault:"#f0a020",warningActive:"#c97c10",warningSuppl:"#fcb040",successHover:"#36ad6a",successDefault:"#18a058",successActive:"#0c7a43",successSuppl:"#36ad6a"},ox=oi(ue.neutralBase),ru=oi(ue.neutralInvertBase),ax=`rgba(${ru.slice(0,3).join(", ")}, `;function su(t){return`${ax+String(t)})`}function mt(t){const e=Array.from(ru);return e[3]=Number(t),Qb(ox,e)}const mi=Object.assign(Object.assign({name:"common"},xr),{baseColor:ue.neutralBase,primaryColor:ue.primaryDefault,primaryColorHover:ue.primaryHover,primaryColorPressed:ue.primaryActive,primaryColorSuppl:ue.primarySuppl,infoColor:ue.infoDefault,infoColorHover:ue.infoHover,infoColorPressed:ue.infoActive,infoColorSuppl:ue.infoSuppl,successColor:ue.successDefault,successColorHover:ue.successHover,successColorPressed:ue.successActive,successColorSuppl:ue.successSuppl,warningColor:ue.warningDefault,warningColorHover:ue.warningHover,warningColorPressed:ue.warningActive,warningColorSuppl:ue.warningSuppl,errorColor:ue.errorDefault,errorColorHover:ue.errorHover,errorColorPressed:ue.errorActive,errorColorSuppl:ue.errorSuppl,textColorBase:ue.neutralTextBase,textColor1:"rgb(31, 34, 37)",textColor2:"rgb(51, 54, 57)",textColor3:"rgb(118, 124, 130)",textColorDisabled:mt(ue.alpha4),placeholderColor:mt(ue.alpha4),placeholderColorDisabled:mt(ue.alpha5),iconColor:mt(ue.alpha4),iconColorHover:ls(mt(ue.alpha4),{lightness:.75}),iconColorPressed:ls(mt(ue.alpha4),{lightness:.9}),iconColorDisabled:mt(ue.alpha5),opacity1:ue.alpha1,opacity2:ue.alpha2,opacity3:ue.alpha3,opacity4:ue.alpha4,opacity5:ue.alpha5,dividerColor:"rgb(239, 239, 245)",borderColor:"rgb(224, 224, 230)",closeIconColor:mt(Number(ue.alphaClose)),closeIconColorHover:mt(Number(ue.alphaClose)),closeIconColorPressed:mt(Number(ue.alphaClose)),closeColorHover:"rgba(0, 0, 0, .09)",closeColorPressed:"rgba(0, 0, 0, .13)",clearColor:mt(ue.alpha4),clearColorHover:ls(mt(ue.alpha4),{lightness:.75}),clearColorPressed:ls(mt(ue.alpha4),{lightness:.9}),scrollbarColor:su(ue.alphaScrollbar),scrollbarColorHover:su(ue.alphaScrollbarHover),scrollbarWidth:"5px",scrollbarHeight:"5px",scrollbarBorderRadius:"5px",progressRailColor:mt(ue.alphaProgressRail),railColor:"rgb(219, 219, 223)",popoverColor:ue.neutralPopover,tableColor:ue.neutralCard,cardColor:ue.neutralCard,modalColor:ue.neutralModal,bodyColor:ue.neutralBody,tagColor:"#eee",avatarColor:mt(ue.alphaAvatar),invertedColor:"rgb(0, 20, 40)",inputColor:mt(ue.alphaInput),codeColor:"rgb(244, 244, 248)",tabColor:"rgb(247, 247, 250)",actionColor:"rgb(250, 250, 252)",tableHeaderColor:"rgb(250, 250, 252)",hoverColor:"rgb(243, 243, 245)",tableColorHover:"rgba(0, 0, 100, 0.03)",tableColorStriped:"rgba(0, 0, 100, 0.02)",pressedColor:"rgb(237, 237, 239)",opacityDisabled:ue.alphaDisabled,inputColorDisabled:"rgb(250, 250, 252)",buttonColor2:"rgba(46, 51, 56, .05)",buttonColor2Hover:"rgba(46, 51, 56, .09)",buttonColor2Pressed:"rgba(46, 51, 56, .13)",boxShadow1:"0 1px 2px -2px rgba(0, 0, 0, .08), 0 3px 6px 0 rgba(0, 0, 0, .06), 0 5px 12px 4px rgba(0, 0, 0, .04)",boxShadow2:"0 3px 6px -4px rgba(0, 0, 0, .12), 0 6px 16px 0 rgba(0, 0, 0, .08), 0 9px 28px 8px rgba(0, 0, 0, .05)",boxShadow3:"0 6px 16px -9px rgba(0, 0, 0, .08), 0 9px 28px 0 rgba(0, 0, 0, .05), 0 12px 48px 16px rgba(0, 0, 0, .03)"}),lx={railInsetHorizontalBottom:"auto 2px 4px 2px",railInsetHorizontalTop:"4px 2px auto 2px",railInsetVerticalRight:"2px 4px 2px auto",railInsetVerticalLeft:"2px auto 2px 4px",railColor:"transparent"};function cx(t){const{scrollbarColor:e,scrollbarColorHover:n,scrollbarHeight:r,scrollbarWidth:s,scrollbarBorderRadius:o}=t;return Object.assign(Object.assign({},lx),{height:r,width:s,borderRadius:o,color:e,colorHover:n})}const ha={name:"Scrollbar",common:mi,self:cx},dx=ge("scrollbar",`
232
+ `)])])]),da="1.6s",bx={strokeWidth:{type:Number,default:28},stroke:{type:String,default:void 0}},nu=i.defineComponent({name:"BaseLoading",props:Object.assign({clsPrefix:{type:String,required:!0},show:{type:Boolean,default:!0},scale:{type:Number,default:1},radius:{type:Number,default:100}},bx),setup(t){Ss("-base-loading",yx,i.toRef(t,"clsPrefix"))},render(){const{clsPrefix:t,radius:e,strokeWidth:n,stroke:r,scale:s}=this,o=e/s;return i.h("div",{class:`${t}-base-loading`,role:"img","aria-label":"loading"},i.h(eu,null,{default:()=>this.show?i.h("div",{key:"icon",class:`${t}-base-loading__transition-wrapper`},i.h("div",{class:`${t}-base-loading__container`},i.h("svg",{class:`${t}-base-loading__icon`,viewBox:`0 0 ${2*o} ${2*o}`,xmlns:"http://www.w3.org/2000/svg",style:{color:r}},i.h("g",null,i.h("animateTransform",{attributeName:"transform",type:"rotate",values:`0 ${o} ${o};270 ${o} ${o}`,begin:"0s",dur:da,fill:"freeze",repeatCount:"indefinite"}),i.h("circle",{class:`${t}-base-loading__icon`,fill:"none",stroke:"currentColor","stroke-width":n,"stroke-linecap":"round",cx:o,cy:o,r:e-n/2,"stroke-dasharray":5.67*e,"stroke-dashoffset":18.48*e},i.h("animateTransform",{attributeName:"transform",type:"rotate",values:`0 ${o} ${o};135 ${o} ${o};450 ${o} ${o}`,begin:"0s",dur:da,fill:"freeze",repeatCount:"indefinite"}),i.h("animate",{attributeName:"stroke-dashoffset",values:`${5.67*e};${1.42*e};${5.67*e}`,begin:"0s",dur:da,fill:"freeze",repeatCount:"indefinite"})))))):i.h("div",{key:"placeholder",class:`${t}-base-loading__placeholder`},this.$slots)}))}}),{cubicBezierEaseInOut:iu}=vr;function _x({name:t="fade-in",enterDuration:e="0.2s",leaveDuration:n="0.2s",enterCubicBezier:r=iu,leaveCubicBezier:s=iu}={}){return[ae(`&.${t}-transition-enter-active`,{transition:`all ${e} ${r}!important`}),ae(`&.${t}-transition-leave-active`,{transition:`all ${n} ${s}!important`}),ae(`&.${t}-transition-enter-from, &.${t}-transition-leave-to`,{opacity:0}),ae(`&.${t}-transition-leave-from, &.${t}-transition-enter-to`,{opacity:1})]}const de={neutralBase:"#FFF",neutralInvertBase:"#000",neutralTextBase:"#000",neutralPopover:"#fff",neutralCard:"#fff",neutralModal:"#fff",neutralBody:"#fff",alpha1:"0.82",alpha2:"0.72",alpha3:"0.38",alpha4:"0.24",alpha5:"0.18",alphaClose:"0.6",alphaDisabled:"0.5",alphaAvatar:"0.2",alphaProgressRail:".08",alphaInput:"0",alphaScrollbar:"0.25",alphaScrollbarHover:"0.4",primaryHover:"#36ad6a",primaryDefault:"#18a058",primaryActive:"#0c7a43",primarySuppl:"#36ad6a",infoHover:"#4098fc",infoDefault:"#2080f0",infoActive:"#1060c9",infoSuppl:"#4098fc",errorHover:"#de576d",errorDefault:"#d03050",errorActive:"#ab1f3f",errorSuppl:"#de576d",warningHover:"#fcb040",warningDefault:"#f0a020",warningActive:"#c97c10",warningSuppl:"#fcb040",successHover:"#36ad6a",successDefault:"#18a058",successActive:"#0c7a43",successSuppl:"#36ad6a"},wx=ai(de.neutralBase),ru=ai(de.neutralInvertBase),xx=`rgba(${ru.slice(0,3).join(", ")}, `;function su(t){return`${xx+String(t)})`}function ft(t){const e=Array.from(ru);return e[3]=Number(t),f_(wx,e)}const pi=Object.assign(Object.assign({name:"common"},vr),{baseColor:de.neutralBase,primaryColor:de.primaryDefault,primaryColorHover:de.primaryHover,primaryColorPressed:de.primaryActive,primaryColorSuppl:de.primarySuppl,infoColor:de.infoDefault,infoColorHover:de.infoHover,infoColorPressed:de.infoActive,infoColorSuppl:de.infoSuppl,successColor:de.successDefault,successColorHover:de.successHover,successColorPressed:de.successActive,successColorSuppl:de.successSuppl,warningColor:de.warningDefault,warningColorHover:de.warningHover,warningColorPressed:de.warningActive,warningColorSuppl:de.warningSuppl,errorColor:de.errorDefault,errorColorHover:de.errorHover,errorColorPressed:de.errorActive,errorColorSuppl:de.errorSuppl,textColorBase:de.neutralTextBase,textColor1:"rgb(31, 34, 37)",textColor2:"rgb(51, 54, 57)",textColor3:"rgb(118, 124, 130)",textColorDisabled:ft(de.alpha4),placeholderColor:ft(de.alpha4),placeholderColorDisabled:ft(de.alpha5),iconColor:ft(de.alpha4),iconColorHover:ls(ft(de.alpha4),{lightness:.75}),iconColorPressed:ls(ft(de.alpha4),{lightness:.9}),iconColorDisabled:ft(de.alpha5),opacity1:de.alpha1,opacity2:de.alpha2,opacity3:de.alpha3,opacity4:de.alpha4,opacity5:de.alpha5,dividerColor:"rgb(239, 239, 245)",borderColor:"rgb(224, 224, 230)",closeIconColor:ft(Number(de.alphaClose)),closeIconColorHover:ft(Number(de.alphaClose)),closeIconColorPressed:ft(Number(de.alphaClose)),closeColorHover:"rgba(0, 0, 0, .09)",closeColorPressed:"rgba(0, 0, 0, .13)",clearColor:ft(de.alpha4),clearColorHover:ls(ft(de.alpha4),{lightness:.75}),clearColorPressed:ls(ft(de.alpha4),{lightness:.9}),scrollbarColor:su(de.alphaScrollbar),scrollbarColorHover:su(de.alphaScrollbarHover),scrollbarWidth:"5px",scrollbarHeight:"5px",scrollbarBorderRadius:"5px",progressRailColor:ft(de.alphaProgressRail),railColor:"rgb(219, 219, 223)",popoverColor:de.neutralPopover,tableColor:de.neutralCard,cardColor:de.neutralCard,modalColor:de.neutralModal,bodyColor:de.neutralBody,tagColor:"#eee",avatarColor:ft(de.alphaAvatar),invertedColor:"rgb(0, 20, 40)",inputColor:ft(de.alphaInput),codeColor:"rgb(244, 244, 248)",tabColor:"rgb(247, 247, 250)",actionColor:"rgb(250, 250, 252)",tableHeaderColor:"rgb(250, 250, 252)",hoverColor:"rgb(243, 243, 245)",tableColorHover:"rgba(0, 0, 100, 0.03)",tableColorStriped:"rgba(0, 0, 100, 0.02)",pressedColor:"rgb(237, 237, 239)",opacityDisabled:de.alphaDisabled,inputColorDisabled:"rgb(250, 250, 252)",buttonColor2:"rgba(46, 51, 56, .05)",buttonColor2Hover:"rgba(46, 51, 56, .09)",buttonColor2Pressed:"rgba(46, 51, 56, .13)",boxShadow1:"0 1px 2px -2px rgba(0, 0, 0, .08), 0 3px 6px 0 rgba(0, 0, 0, .06), 0 5px 12px 4px rgba(0, 0, 0, .04)",boxShadow2:"0 3px 6px -4px rgba(0, 0, 0, .12), 0 6px 16px 0 rgba(0, 0, 0, .08), 0 9px 28px 8px rgba(0, 0, 0, .05)",boxShadow3:"0 6px 16px -9px rgba(0, 0, 0, .08), 0 9px 28px 0 rgba(0, 0, 0, .05), 0 12px 48px 16px rgba(0, 0, 0, .03)"}),vx={railInsetHorizontalBottom:"auto 2px 4px 2px",railInsetHorizontalTop:"4px 2px auto 2px",railInsetVerticalRight:"2px 4px 2px auto",railInsetVerticalLeft:"2px auto 2px 4px",railColor:"transparent"};function kx(t){const{scrollbarColor:e,scrollbarColorHover:n,scrollbarHeight:r,scrollbarWidth:s,scrollbarBorderRadius:o}=t;return Object.assign(Object.assign({},vx),{height:r,width:s,borderRadius:o,color:e,colorHover:n})}const ha={name:"Scrollbar",common:pi,self:kx},Cx=ue("scrollbar",`
233
233
  overflow: hidden;
234
234
  position: relative;
235
235
  z-index: auto;
236
236
  height: 100%;
237
237
  width: 100%;
238
- `,[ae(">",[ge("scrollbar-container",`
238
+ `,[ae(">",[ue("scrollbar-container",`
239
239
  width: 100%;
240
240
  overflow: scroll;
241
241
  height: 100%;
@@ -246,55 +246,55 @@ ${s}
246
246
  width: 0;
247
247
  height: 0;
248
248
  display: none;
249
- `),ae(">",[ge("scrollbar-content",`
249
+ `),ae(">",[ue("scrollbar-content",`
250
250
  box-sizing: border-box;
251
251
  min-width: 100%;
252
- `)])])]),ae(">, +",[ge("scrollbar-rail",`
252
+ `)])])]),ae(">, +",[ue("scrollbar-rail",`
253
253
  position: absolute;
254
254
  pointer-events: none;
255
255
  user-select: none;
256
256
  background: var(--n-scrollbar-rail-color);
257
257
  -webkit-user-select: none;
258
- `,[Ce("horizontal",`
258
+ `,[Be("horizontal",`
259
259
  height: var(--n-scrollbar-height);
260
260
  `,[ae(">",[ye("scrollbar",`
261
261
  height: var(--n-scrollbar-height);
262
262
  border-radius: var(--n-scrollbar-border-radius);
263
263
  right: 0;
264
- `)])]),Ce("horizontal--top",`
264
+ `)])]),Be("horizontal--top",`
265
265
  top: var(--n-scrollbar-rail-top-horizontal-top);
266
266
  right: var(--n-scrollbar-rail-right-horizontal-top);
267
267
  bottom: var(--n-scrollbar-rail-bottom-horizontal-top);
268
268
  left: var(--n-scrollbar-rail-left-horizontal-top);
269
- `),Ce("horizontal--bottom",`
269
+ `),Be("horizontal--bottom",`
270
270
  top: var(--n-scrollbar-rail-top-horizontal-bottom);
271
271
  right: var(--n-scrollbar-rail-right-horizontal-bottom);
272
272
  bottom: var(--n-scrollbar-rail-bottom-horizontal-bottom);
273
273
  left: var(--n-scrollbar-rail-left-horizontal-bottom);
274
- `),Ce("vertical",`
274
+ `),Be("vertical",`
275
275
  width: var(--n-scrollbar-width);
276
276
  `,[ae(">",[ye("scrollbar",`
277
277
  width: var(--n-scrollbar-width);
278
278
  border-radius: var(--n-scrollbar-border-radius);
279
279
  bottom: 0;
280
- `)])]),Ce("vertical--left",`
280
+ `)])]),Be("vertical--left",`
281
281
  top: var(--n-scrollbar-rail-top-vertical-left);
282
282
  right: var(--n-scrollbar-rail-right-vertical-left);
283
283
  bottom: var(--n-scrollbar-rail-bottom-vertical-left);
284
284
  left: var(--n-scrollbar-rail-left-vertical-left);
285
- `),Ce("vertical--right",`
285
+ `),Be("vertical--right",`
286
286
  top: var(--n-scrollbar-rail-top-vertical-right);
287
287
  right: var(--n-scrollbar-rail-right-vertical-right);
288
288
  bottom: var(--n-scrollbar-rail-bottom-vertical-right);
289
289
  left: var(--n-scrollbar-rail-left-vertical-right);
290
- `),Ce("disabled",[ae(">",[ye("scrollbar","pointer-events: none;")])]),ae(">",[ye("scrollbar",`
290
+ `),Be("disabled",[ae(">",[ye("scrollbar","pointer-events: none;")])]),ae(">",[ye("scrollbar",`
291
291
  z-index: 1;
292
292
  position: absolute;
293
293
  cursor: pointer;
294
294
  pointer-events: all;
295
295
  background-color: var(--n-scrollbar-color);
296
296
  transition: background-color .2s var(--n-scrollbar-bezier);
297
- `,[sx(),ae("&:hover","background-color: var(--n-scrollbar-color-hover);")])])])])]),hx=Object.assign(Object.assign({},gt.props),{duration:{type:Number,default:0},scrollable:{type:Boolean,default:!0},xScrollable:Boolean,trigger:{type:String,default:"hover"},useUnifiedContainer:Boolean,triggerDisplayManually:Boolean,container:Function,content:Function,containerClass:String,containerStyle:[String,Object],contentClass:[String,Array],contentStyle:[String,Object],horizontalRailStyle:[String,Object],verticalRailStyle:[String,Object],onScroll:Function,onWheel:Function,onResize:Function,internalOnUpdateScrollLeft:Function,internalHoistYRail:Boolean,yPlacement:{type:String,default:"right"},xPlacement:{type:String,default:"bottom"}}),ou=i.defineComponent({name:"Scrollbar",props:hx,inheritAttrs:!1,setup(t){const{mergedClsPrefixRef:e,inlineThemeDisabled:n,mergedRtlRef:r}=fi(t),s=wr("Scrollbar",r,e),o=i.ref(null),a=i.ref(null),l=i.ref(null),c=i.ref(null),d=i.ref(null),h=i.ref(null),u=i.ref(null),m=i.ref(null),f=i.ref(null),g=i.ref(null),p=i.ref(null),b=i.ref(0),y=i.ref(0),_=i.ref(!1),S=i.ref(!1);let C=!1,v=!1,B,k,R=0,$=0,F=0,D=0;const L=D_(),M=gt("Scrollbar","-scrollbar",dx,ha,t,e),z=i.computed(()=>{const{value:T}=m,{value:q}=h,{value:te}=g;return T===null||q===null||te===null?0:Math.min(T,te*T/q+dr(M.value.self.width)*1.5)}),O=i.computed(()=>`${z.value}px`),ne=i.computed(()=>{const{value:T}=f,{value:q}=u,{value:te}=p;return T===null||q===null||te===null?0:te*T/q+dr(M.value.self.height)*1.5}),P=i.computed(()=>`${ne.value}px`),E=i.computed(()=>{const{value:T}=m,{value:q}=b,{value:te}=h,{value:le}=g;if(T===null||te===null||le===null)return 0;{const he=te-T;return he?q/he*(le-z.value):0}}),X=i.computed(()=>`${E.value}px`),j=i.computed(()=>{const{value:T}=f,{value:q}=y,{value:te}=u,{value:le}=p;if(T===null||te===null||le===null)return 0;{const he=te-T;return he?q/he*(le-ne.value):0}}),H=i.computed(()=>`${j.value}px`),N=i.computed(()=>{const{value:T}=m,{value:q}=h;return T!==null&&q!==null&&q>T}),I=i.computed(()=>{const{value:T}=f,{value:q}=u;return T!==null&&q!==null&&q>T}),J=i.computed(()=>{const{trigger:T}=t;return T==="none"||_.value}),ce=i.computed(()=>{const{trigger:T}=t;return T==="none"||S.value}),re=i.computed(()=>{const{container:T}=t;return T?T():a.value}),de=i.computed(()=>{const{content:T}=t;return T?T():l.value}),se=(T,q)=>{if(!t.scrollable)return;if(typeof T=="number"){bt(T,q??0,0,!1,"auto");return}const{left:te,top:le,index:he,elSize:pe,position:_e,behavior:xe,el:Xe,debounce:pn=!0}=T;(te!==void 0||le!==void 0)&&bt(te??0,le??0,0,!1,xe),Xe!==void 0?bt(0,Xe.offsetTop,Xe.offsetHeight,pn,xe):he!==void 0&&pe!==void 0?bt(0,he*pe,pe,pn,xe):_e==="bottom"?bt(0,Number.MAX_SAFE_INTEGER,0,!1,xe):_e==="top"&&bt(0,0,0,!1,xe)},Ae=U1(()=>{t.container||se({top:b.value,left:y.value})}),Fe=()=>{Ae.isDeactivated||ie()},Ke=T=>{if(Ae.isDeactivated)return;const{onResize:q}=t;q&&q(T),ie()},Ie=(T,q)=>{if(!t.scrollable)return;const{value:te}=re;te&&(typeof T=="object"?te.scrollBy(T):te.scrollBy(T,q||0))};function bt(T,q,te,le,he){const{value:pe}=re;if(pe){if(le){const{scrollTop:_e,offsetHeight:xe}=pe;if(q>_e){q+te<=_e+xe||pe.scrollTo({left:T,top:q+te-xe,behavior:he});return}}pe.scrollTo({left:T,top:q,behavior:he})}}function Jt(){Nn(),je(),ie()}function Qt(){Bt()}function Bt(){Ot(),lt()}function Ot(){k!==void 0&&window.clearTimeout(k),k=window.setTimeout(()=>{S.value=!1},t.duration)}function lt(){B!==void 0&&window.clearTimeout(B),B=window.setTimeout(()=>{_.value=!1},t.duration)}function Nn(){B!==void 0&&window.clearTimeout(B),_.value=!0}function je(){k!==void 0&&window.clearTimeout(k),S.value=!0}function Se(T){const{onScroll:q}=t;q&&q(T),st()}function st(){const{value:T}=re;T&&(b.value=T.scrollTop,y.value=T.scrollLeft*(s!=null&&s.value?-1:1))}function qe(){const{value:T}=de;T&&(h.value=T.offsetHeight,u.value=T.offsetWidth);const{value:q}=re;q&&(m.value=q.offsetHeight,f.value=q.offsetWidth);const{value:te}=d,{value:le}=c;te&&(p.value=te.offsetWidth),le&&(g.value=le.offsetHeight)}function ee(){const{value:T}=re;T&&(b.value=T.scrollTop,y.value=T.scrollLeft*(s!=null&&s.value?-1:1),m.value=T.offsetHeight,f.value=T.offsetWidth,h.value=T.scrollHeight,u.value=T.scrollWidth);const{value:q}=d,{value:te}=c;q&&(p.value=q.offsetWidth),te&&(g.value=te.offsetHeight)}function ie(){t.scrollable&&(t.useUnifiedContainer?ee():(qe(),st()))}function Me(T){var q;return!(!((q=o.value)===null||q===void 0)&&q.contains(cr(T)))}function Cr(T){T.preventDefault(),T.stopPropagation(),v=!0,Ct("mousemove",window,Yi,!0),Ct("mouseup",window,_i,!0),$=y.value,F=s!=null&&s.value?window.innerWidth-T.clientX:T.clientX}function Yi(T){if(!v)return;B!==void 0&&window.clearTimeout(B),k!==void 0&&window.clearTimeout(k);const{value:q}=f,{value:te}=u,{value:le}=ne;if(q===null||te===null)return;const pe=(s!=null&&s.value?window.innerWidth-T.clientX-F:T.clientX-F)*(te-q)/(q-le),_e=te-q;let xe=$+pe;xe=Math.min(_e,xe),xe=Math.max(xe,0);const{value:Xe}=re;if(Xe){Xe.scrollLeft=xe*(s!=null&&s.value?-1:1);const{internalOnUpdateScrollLeft:pn}=t;pn&&pn(xe)}}function _i(T){T.preventDefault(),T.stopPropagation(),et("mousemove",window,Yi,!0),et("mouseup",window,_i,!0),v=!1,ie(),Me(T)&&Bt()}function Ui(T){T.preventDefault(),T.stopPropagation(),C=!0,Ct("mousemove",window,qn,!0),Ct("mouseup",window,wi,!0),R=b.value,D=T.clientY}function qn(T){if(!C)return;B!==void 0&&window.clearTimeout(B),k!==void 0&&window.clearTimeout(k);const{value:q}=m,{value:te}=h,{value:le}=z;if(q===null||te===null)return;const pe=(T.clientY-D)*(te-q)/(q-le),_e=te-q;let xe=R+pe;xe=Math.min(_e,xe),xe=Math.max(xe,0);const{value:Xe}=re;Xe&&(Xe.scrollTop=xe)}function wi(T){T.preventDefault(),T.stopPropagation(),et("mousemove",window,qn,!0),et("mouseup",window,wi,!0),C=!1,ie(),Me(T)&&Bt()}i.watchEffect(()=>{const{value:T}=I,{value:q}=N,{value:te}=e,{value:le}=d,{value:he}=c;le&&(T?le.classList.remove(`${te}-scrollbar-rail--disabled`):le.classList.add(`${te}-scrollbar-rail--disabled`)),he&&(q?he.classList.remove(`${te}-scrollbar-rail--disabled`):he.classList.add(`${te}-scrollbar-rail--disabled`))}),i.onMounted(()=>{t.container||ie()}),i.onBeforeUnmount(()=>{B!==void 0&&window.clearTimeout(B),k!==void 0&&window.clearTimeout(k),et("mousemove",window,qn,!0),et("mouseup",window,wi,!0)});const Gi=i.computed(()=>{const{common:{cubicBezierEaseInOut:T},self:{color:q,colorHover:te,height:le,width:he,borderRadius:pe,railInsetHorizontalTop:_e,railInsetHorizontalBottom:xe,railInsetVerticalRight:Xe,railInsetVerticalLeft:pn,railColor:ba}}=M.value,{top:_a,right:wa,bottom:xa,left:va}=Ut(_e),{top:ka,right:Ca,bottom:Sa,left:Ba}=Ut(xe),{top:Ta,right:Ra,bottom:$a,left:Ea}=Ut(s!=null&&s.value?Hh(Xe):Xe),{top:Na,right:Pa,bottom:Fa,left:Ma}=Ut(s!=null&&s.value?Hh(pn):pn);return{"--n-scrollbar-bezier":T,"--n-scrollbar-color":q,"--n-scrollbar-color-hover":te,"--n-scrollbar-border-radius":pe,"--n-scrollbar-width":he,"--n-scrollbar-height":le,"--n-scrollbar-rail-top-horizontal-top":_a,"--n-scrollbar-rail-right-horizontal-top":wa,"--n-scrollbar-rail-bottom-horizontal-top":xa,"--n-scrollbar-rail-left-horizontal-top":va,"--n-scrollbar-rail-top-horizontal-bottom":ka,"--n-scrollbar-rail-right-horizontal-bottom":Ca,"--n-scrollbar-rail-bottom-horizontal-bottom":Sa,"--n-scrollbar-rail-left-horizontal-bottom":Ba,"--n-scrollbar-rail-top-vertical-right":Ta,"--n-scrollbar-rail-right-vertical-right":Ra,"--n-scrollbar-rail-bottom-vertical-right":$a,"--n-scrollbar-rail-left-vertical-right":Ea,"--n-scrollbar-rail-top-vertical-left":Na,"--n-scrollbar-rail-right-vertical-left":Pa,"--n-scrollbar-rail-bottom-vertical-left":Fa,"--n-scrollbar-rail-left-vertical-left":Ma,"--n-scrollbar-rail-color":ba}}),en=n?gi("scrollbar",void 0,Gi,t):void 0;return Object.assign(Object.assign({},{scrollTo:se,scrollBy:Ie,sync:ie,syncUnifiedContainer:ee,handleMouseEnterWrapper:Jt,handleMouseLeaveWrapper:Qt}),{mergedClsPrefix:e,rtlEnabled:s,containerScrollTop:b,wrapperRef:o,containerRef:a,contentRef:l,yRailRef:c,xRailRef:d,needYBar:N,needXBar:I,yBarSizePx:O,xBarSizePx:P,yBarTopPx:X,xBarLeftPx:H,isShowXBar:J,isShowYBar:ce,isIos:L,handleScroll:Se,handleContentResize:Fe,handleContainerResize:Ke,handleYScrollMouseDown:Ui,handleXScrollMouseDown:Cr,cssVars:n?void 0:Gi,themeClass:en==null?void 0:en.themeClass,onRender:en==null?void 0:en.onRender})},render(){var t;const{$slots:e,mergedClsPrefix:n,triggerDisplayManually:r,rtlEnabled:s,internalHoistYRail:o,yPlacement:a,xPlacement:l,xScrollable:c}=this;if(!this.scrollable)return(t=e.default)===null||t===void 0?void 0:t.call(e);const d=this.trigger==="none",h=(f,g)=>i.h("div",{ref:"yRailRef",class:[`${n}-scrollbar-rail`,`${n}-scrollbar-rail--vertical`,`${n}-scrollbar-rail--vertical--${a}`,f],"data-scrollbar-rail":!0,style:[g||"",this.verticalRailStyle],"aria-hidden":!0},i.h(d?aa:i.Transition,d?null:{name:"fade-in-transition"},{default:()=>this.needYBar&&this.isShowYBar&&!this.isIos?i.h("div",{class:`${n}-scrollbar-rail__scrollbar`,style:{height:this.yBarSizePx,top:this.yBarTopPx},onMousedown:this.handleYScrollMouseDown}):null})),u=()=>{var f,g;return(f=this.onRender)===null||f===void 0||f.call(this),i.h("div",i.mergeProps(this.$attrs,{role:"none",ref:"wrapperRef",class:[`${n}-scrollbar`,this.themeClass,s&&`${n}-scrollbar--rtl`],style:this.cssVars,onMouseenter:r?void 0:this.handleMouseEnterWrapper,onMouseleave:r?void 0:this.handleMouseLeaveWrapper}),[this.container?(g=e.default)===null||g===void 0?void 0:g.call(e):i.h("div",{role:"none",ref:"containerRef",class:[`${n}-scrollbar-container`,this.containerClass],style:this.containerStyle,onScroll:this.handleScroll,onWheel:this.onWheel},i.h(vs,{onResize:this.handleContentResize},{default:()=>i.h("div",{ref:"contentRef",role:"none",style:[{width:this.xScrollable?"fit-content":null},this.contentStyle],class:[`${n}-scrollbar-content`,this.contentClass]},e)})),o?null:h(void 0,void 0),c&&i.h("div",{ref:"xRailRef",class:[`${n}-scrollbar-rail`,`${n}-scrollbar-rail--horizontal`,`${n}-scrollbar-rail--horizontal--${l}`],style:this.horizontalRailStyle,"data-scrollbar-rail":!0,"aria-hidden":!0},i.h(d?aa:i.Transition,d?null:{name:"fade-in-transition"},{default:()=>this.needXBar&&this.isShowXBar&&!this.isIos?i.h("div",{class:`${n}-scrollbar-rail__scrollbar`,style:{width:this.xBarSizePx,right:s?this.xBarLeftPx:void 0,left:s?void 0:this.xBarLeftPx},onMousedown:this.handleXScrollMouseDown}):null}))])},m=this.container?u():i.h(vs,{onResize:this.handleContainerResize},{default:u});return o?i.h(i.Fragment,null,m,h(this.themeClass,this.cssVars)):m}}),ux=ou,fx={iconSizeTiny:"28px",iconSizeSmall:"34px",iconSizeMedium:"40px",iconSizeLarge:"46px",iconSizeHuge:"52px"};function gx(t){const{textColorDisabled:e,iconColor:n,textColor2:r,fontSizeTiny:s,fontSizeSmall:o,fontSizeMedium:a,fontSizeLarge:l,fontSizeHuge:c}=t;return Object.assign(Object.assign({},fx),{fontSizeTiny:s,fontSizeSmall:o,fontSizeMedium:a,fontSizeLarge:l,fontSizeHuge:c,textColor:e,iconColor:n,extraTextColor:r})}const au={name:"Empty",common:mi,self:gx},mx=ge("empty",`
297
+ `,[_x(),ae("&:hover","background-color: var(--n-scrollbar-color-hover);")])])])])]),Sx=Object.assign(Object.assign({},ut.props),{duration:{type:Number,default:0},scrollable:{type:Boolean,default:!0},xScrollable:Boolean,trigger:{type:String,default:"hover"},useUnifiedContainer:Boolean,triggerDisplayManually:Boolean,container:Function,content:Function,containerClass:String,containerStyle:[String,Object],contentClass:[String,Array],contentStyle:[String,Object],horizontalRailStyle:[String,Object],verticalRailStyle:[String,Object],onScroll:Function,onWheel:Function,onResize:Function,internalOnUpdateScrollLeft:Function,internalHoistYRail:Boolean,yPlacement:{type:String,default:"right"},xPlacement:{type:String,default:"bottom"}}),ou=i.defineComponent({name:"Scrollbar",props:Sx,inheritAttrs:!1,setup(t){const{mergedClsPrefixRef:e,inlineThemeDisabled:n,mergedRtlRef:r}=gi(t),s=xr("Scrollbar",r,e),o=i.ref(null),a=i.ref(null),l=i.ref(null),c=i.ref(null),d=i.ref(null),h=i.ref(null),u=i.ref(null),m=i.ref(null),g=i.ref(null),f=i.ref(null),p=i.ref(null),y=i.ref(0),b=i.ref(0),_=i.ref(!1),C=i.ref(!1);let S=!1,v=!1,B,k,R=0,$=0,P=0,I=0;const V=t1(),A=ut("Scrollbar","-scrollbar",Cx,ha,t,e),L=i.computed(()=>{const{value:T}=m,{value:j}=h,{value:ne}=f;return T===null||j===null||ne===null?0:Math.min(T,ne*T/j+hr(A.value.self.width)*1.5)}),D=i.computed(()=>`${L.value}px`),ee=i.computed(()=>{const{value:T}=g,{value:j}=u,{value:ne}=p;return T===null||j===null||ne===null?0:ne*T/j+hr(A.value.self.height)*1.5}),E=i.computed(()=>`${ee.value}px`),N=i.computed(()=>{const{value:T}=m,{value:j}=y,{value:ne}=h,{value:le}=f;if(T===null||ne===null||le===null)return 0;{const ce=ne-T;return ce?j/ce*(le-L.value):0}}),H=i.computed(()=>`${N.value}px`),q=i.computed(()=>{const{value:T}=g,{value:j}=b,{value:ne}=u,{value:le}=p;if(T===null||ne===null||le===null)return 0;{const ce=ne-T;return ce?j/ce*(le-ee.value):0}}),Y=i.computed(()=>`${q.value}px`),F=i.computed(()=>{const{value:T}=m,{value:j}=h;return T!==null&&j!==null&&j>T}),M=i.computed(()=>{const{value:T}=g,{value:j}=u;return T!==null&&j!==null&&j>T}),Z=i.computed(()=>{const{trigger:T}=t;return T==="none"||_.value}),fe=i.computed(()=>{const{trigger:T}=t;return T==="none"||C.value}),ie=i.computed(()=>{const{container:T}=t;return T?T():a.value}),me=i.computed(()=>{const{content:T}=t;return T?T():l.value}),re=(T,j)=>{if(!t.scrollable)return;if(typeof T=="number"){pt(T,j??0,0,!1,"auto");return}const{left:ne,top:le,index:ce,elSize:pe,position:_e,behavior:xe,el:Ye,debounce:yn=!0}=T;(ne!==void 0||le!==void 0)&&pt(ne??0,le??0,0,!1,xe),Ye!==void 0?pt(0,Ye.offsetTop,Ye.offsetHeight,yn,xe):ce!==void 0&&pe!==void 0?pt(0,ce*pe,pe,yn,xe):_e==="bottom"?pt(0,Number.MAX_SAFE_INTEGER,0,!1,xe):_e==="top"&&pt(0,0,0,!1,xe)},Me=lw(()=>{t.container||re({top:y.value,left:b.value})}),Ae=()=>{Me.isDeactivated||se()},Oe=T=>{if(Me.isDeactivated)return;const{onResize:j}=t;j&&j(T),se()},Le=(T,j)=>{if(!t.scrollable)return;const{value:ne}=ie;ne&&(typeof T=="object"?ne.scrollBy(T):ne.scrollBy(T,j||0))};function pt(T,j,ne,le,ce){const{value:pe}=ie;if(pe){if(le){const{scrollTop:_e,offsetHeight:xe}=pe;if(j>_e){j+ne<=_e+xe||pe.scrollTo({left:T,top:j+ne-xe,behavior:ce});return}}pe.scrollTo({left:T,top:j,behavior:ce})}}function Zt(){pn(),Pn(),se()}function Qt(){St()}function St(){At(),yt()}function At(){k!==void 0&&window.clearTimeout(k),k=window.setTimeout(()=>{C.value=!1},t.duration)}function yt(){B!==void 0&&window.clearTimeout(B),B=window.setTimeout(()=>{_.value=!1},t.duration)}function pn(){B!==void 0&&window.clearTimeout(B),_.value=!0}function Pn(){k!==void 0&&window.clearTimeout(k),C.value=!0}function De(T){const{onScroll:j}=t;j&&j(T),ke()}function ke(){const{value:T}=ie;T&&(y.value=T.scrollTop,b.value=T.scrollLeft*(s!=null&&s.value?-1:1))}function Ie(){const{value:T}=me;T&&(h.value=T.offsetHeight,u.value=T.offsetWidth);const{value:j}=ie;j&&(m.value=j.offsetHeight,g.value=j.offsetWidth);const{value:ne}=d,{value:le}=c;ne&&(p.value=ne.offsetWidth),le&&(f.value=le.offsetHeight)}function J(){const{value:T}=ie;T&&(y.value=T.scrollTop,b.value=T.scrollLeft*(s!=null&&s.value?-1:1),m.value=T.offsetHeight,g.value=T.offsetWidth,h.value=T.scrollHeight,u.value=T.scrollWidth);const{value:j}=d,{value:ne}=c;j&&(p.value=j.offsetWidth),ne&&(f.value=ne.offsetHeight)}function se(){t.scrollable&&(t.useUnifiedContainer?J():(Ie(),ke()))}function Ce(T){var j;return!(!((j=o.value)===null||j===void 0)&&j.contains(dr(T)))}function Jt(T){T.preventDefault(),T.stopPropagation(),v=!0,kt("mousemove",window,Ui,!0),kt("mouseup",window,wi,!0),$=b.value,P=s!=null&&s.value?window.innerWidth-T.clientX:T.clientX}function Ui(T){if(!v)return;B!==void 0&&window.clearTimeout(B),k!==void 0&&window.clearTimeout(k);const{value:j}=g,{value:ne}=u,{value:le}=ee;if(j===null||ne===null)return;const pe=(s!=null&&s.value?window.innerWidth-T.clientX-P:T.clientX-P)*(ne-j)/(j-le),_e=ne-j;let xe=$+pe;xe=Math.min(_e,xe),xe=Math.max(xe,0);const{value:Ye}=ie;if(Ye){Ye.scrollLeft=xe*(s!=null&&s.value?-1:1);const{internalOnUpdateScrollLeft:yn}=t;yn&&yn(xe)}}function wi(T){T.preventDefault(),T.stopPropagation(),et("mousemove",window,Ui,!0),et("mouseup",window,wi,!0),v=!1,se(),Ce(T)&&St()}function Gi(T){T.preventDefault(),T.stopPropagation(),S=!0,kt("mousemove",window,Xn,!0),kt("mouseup",window,xi,!0),R=y.value,I=T.clientY}function Xn(T){if(!S)return;B!==void 0&&window.clearTimeout(B),k!==void 0&&window.clearTimeout(k);const{value:j}=m,{value:ne}=h,{value:le}=L;if(j===null||ne===null)return;const pe=(T.clientY-I)*(ne-j)/(j-le),_e=ne-j;let xe=R+pe;xe=Math.min(_e,xe),xe=Math.max(xe,0);const{value:Ye}=ie;Ye&&(Ye.scrollTop=xe)}function xi(T){T.preventDefault(),T.stopPropagation(),et("mousemove",window,Xn,!0),et("mouseup",window,xi,!0),S=!1,se(),Ce(T)&&St()}i.watchEffect(()=>{const{value:T}=M,{value:j}=F,{value:ne}=e,{value:le}=d,{value:ce}=c;le&&(T?le.classList.remove(`${ne}-scrollbar-rail--disabled`):le.classList.add(`${ne}-scrollbar-rail--disabled`)),ce&&(j?ce.classList.remove(`${ne}-scrollbar-rail--disabled`):ce.classList.add(`${ne}-scrollbar-rail--disabled`))}),i.onMounted(()=>{t.container||se()}),i.onBeforeUnmount(()=>{B!==void 0&&window.clearTimeout(B),k!==void 0&&window.clearTimeout(k),et("mousemove",window,Xn,!0),et("mouseup",window,xi,!0)});const Ki=i.computed(()=>{const{common:{cubicBezierEaseInOut:T},self:{color:j,colorHover:ne,height:le,width:ce,borderRadius:pe,railInsetHorizontalTop:_e,railInsetHorizontalBottom:xe,railInsetVerticalRight:Ye,railInsetVerticalLeft:yn,railColor:ba}}=A.value,{top:_a,right:wa,bottom:xa,left:va}=Yt(_e),{top:ka,right:Ca,bottom:Sa,left:Ba}=Yt(xe),{top:Ta,right:Ra,bottom:$a,left:Ea}=Yt(s!=null&&s.value?Hh(Ye):Ye),{top:Na,right:Pa,bottom:Fa,left:Ma}=Yt(s!=null&&s.value?Hh(yn):yn);return{"--n-scrollbar-bezier":T,"--n-scrollbar-color":j,"--n-scrollbar-color-hover":ne,"--n-scrollbar-border-radius":pe,"--n-scrollbar-width":ce,"--n-scrollbar-height":le,"--n-scrollbar-rail-top-horizontal-top":_a,"--n-scrollbar-rail-right-horizontal-top":wa,"--n-scrollbar-rail-bottom-horizontal-top":xa,"--n-scrollbar-rail-left-horizontal-top":va,"--n-scrollbar-rail-top-horizontal-bottom":ka,"--n-scrollbar-rail-right-horizontal-bottom":Ca,"--n-scrollbar-rail-bottom-horizontal-bottom":Sa,"--n-scrollbar-rail-left-horizontal-bottom":Ba,"--n-scrollbar-rail-top-vertical-right":Ta,"--n-scrollbar-rail-right-vertical-right":Ra,"--n-scrollbar-rail-bottom-vertical-right":$a,"--n-scrollbar-rail-left-vertical-right":Ea,"--n-scrollbar-rail-top-vertical-left":Na,"--n-scrollbar-rail-right-vertical-left":Pa,"--n-scrollbar-rail-bottom-vertical-left":Fa,"--n-scrollbar-rail-left-vertical-left":Ma,"--n-scrollbar-rail-color":ba}}),en=n?mi("scrollbar",void 0,Ki,t):void 0;return Object.assign(Object.assign({},{scrollTo:re,scrollBy:Le,sync:se,syncUnifiedContainer:J,handleMouseEnterWrapper:Zt,handleMouseLeaveWrapper:Qt}),{mergedClsPrefix:e,rtlEnabled:s,containerScrollTop:y,wrapperRef:o,containerRef:a,contentRef:l,yRailRef:c,xRailRef:d,needYBar:F,needXBar:M,yBarSizePx:D,xBarSizePx:E,yBarTopPx:H,xBarLeftPx:Y,isShowXBar:Z,isShowYBar:fe,isIos:V,handleScroll:De,handleContentResize:Ae,handleContainerResize:Oe,handleYScrollMouseDown:Gi,handleXScrollMouseDown:Jt,cssVars:n?void 0:Ki,themeClass:en==null?void 0:en.themeClass,onRender:en==null?void 0:en.onRender})},render(){var t;const{$slots:e,mergedClsPrefix:n,triggerDisplayManually:r,rtlEnabled:s,internalHoistYRail:o,yPlacement:a,xPlacement:l,xScrollable:c}=this;if(!this.scrollable)return(t=e.default)===null||t===void 0?void 0:t.call(e);const d=this.trigger==="none",h=(g,f)=>i.h("div",{ref:"yRailRef",class:[`${n}-scrollbar-rail`,`${n}-scrollbar-rail--vertical`,`${n}-scrollbar-rail--vertical--${a}`,g],"data-scrollbar-rail":!0,style:[f||"",this.verticalRailStyle],"aria-hidden":!0},i.h(d?aa:i.Transition,d?null:{name:"fade-in-transition"},{default:()=>this.needYBar&&this.isShowYBar&&!this.isIos?i.h("div",{class:`${n}-scrollbar-rail__scrollbar`,style:{height:this.yBarSizePx,top:this.yBarTopPx},onMousedown:this.handleYScrollMouseDown}):null})),u=()=>{var g,f;return(g=this.onRender)===null||g===void 0||g.call(this),i.h("div",i.mergeProps(this.$attrs,{role:"none",ref:"wrapperRef",class:[`${n}-scrollbar`,this.themeClass,s&&`${n}-scrollbar--rtl`],style:this.cssVars,onMouseenter:r?void 0:this.handleMouseEnterWrapper,onMouseleave:r?void 0:this.handleMouseLeaveWrapper}),[this.container?(f=e.default)===null||f===void 0?void 0:f.call(e):i.h("div",{role:"none",ref:"containerRef",class:[`${n}-scrollbar-container`,this.containerClass],style:this.containerStyle,onScroll:this.handleScroll,onWheel:this.onWheel},i.h(vs,{onResize:this.handleContentResize},{default:()=>i.h("div",{ref:"contentRef",role:"none",style:[{width:this.xScrollable?"fit-content":null},this.contentStyle],class:[`${n}-scrollbar-content`,this.contentClass]},e)})),o?null:h(void 0,void 0),c&&i.h("div",{ref:"xRailRef",class:[`${n}-scrollbar-rail`,`${n}-scrollbar-rail--horizontal`,`${n}-scrollbar-rail--horizontal--${l}`],style:this.horizontalRailStyle,"data-scrollbar-rail":!0,"aria-hidden":!0},i.h(d?aa:i.Transition,d?null:{name:"fade-in-transition"},{default:()=>this.needXBar&&this.isShowXBar&&!this.isIos?i.h("div",{class:`${n}-scrollbar-rail__scrollbar`,style:{width:this.xBarSizePx,right:s?this.xBarLeftPx:void 0,left:s?void 0:this.xBarLeftPx},onMousedown:this.handleXScrollMouseDown}):null}))])},m=this.container?u():i.h(vs,{onResize:this.handleContainerResize},{default:u});return o?i.h(i.Fragment,null,m,h(this.themeClass,this.cssVars)):m}}),Bx=ou,Tx={iconSizeTiny:"28px",iconSizeSmall:"34px",iconSizeMedium:"40px",iconSizeLarge:"46px",iconSizeHuge:"52px"};function Rx(t){const{textColorDisabled:e,iconColor:n,textColor2:r,fontSizeTiny:s,fontSizeSmall:o,fontSizeMedium:a,fontSizeLarge:l,fontSizeHuge:c}=t;return Object.assign(Object.assign({},Tx),{fontSizeTiny:s,fontSizeSmall:o,fontSizeMedium:a,fontSizeLarge:l,fontSizeHuge:c,textColor:e,iconColor:n,extraTextColor:r})}const au={name:"Empty",common:pi,self:Rx},$x=ue("empty",`
298
298
  display: flex;
299
299
  flex-direction: column;
300
300
  align-items: center;
@@ -317,7 +317,7 @@ ${s}
317
317
  transition: color .3s var(--n-bezier);
318
318
  margin-top: 12px;
319
319
  color: var(--n-extra-text-color);
320
- `)]),px=Object.assign(Object.assign({},gt.props),{description:String,showDescription:{type:Boolean,default:!0},showIcon:{type:Boolean,default:!0},size:{type:String,default:"medium"},renderIcon:Function}),yx=i.defineComponent({name:"Empty",props:px,slots:Object,setup(t){const{mergedClsPrefixRef:e,inlineThemeDisabled:n,mergedComponentPropsRef:r}=fi(t),s=gt("Empty","-empty",mx,au,t,e),{localeRef:o}=Jh("Empty"),a=i.computed(()=>{var h,u,m;return(h=t.description)!==null&&h!==void 0?h:(m=(u=r==null?void 0:r.value)===null||u===void 0?void 0:u.Empty)===null||m===void 0?void 0:m.description}),l=i.computed(()=>{var h,u;return((u=(h=r==null?void 0:r.value)===null||h===void 0?void 0:h.Empty)===null||u===void 0?void 0:u.renderIcon)||(()=>i.h(Kw,null))}),c=i.computed(()=>{const{size:h}=t,{common:{cubicBezierEaseInOut:u},self:{[Ue("iconSize",h)]:m,[Ue("fontSize",h)]:f,textColor:g,iconColor:p,extraTextColor:b}}=s.value;return{"--n-icon-size":m,"--n-font-size":f,"--n-bezier":u,"--n-text-color":g,"--n-icon-color":p,"--n-extra-text-color":b}}),d=n?gi("empty",i.computed(()=>{let h="";const{size:u}=t;return h+=u[0],h}),c,t):void 0;return{mergedClsPrefix:e,mergedRenderIcon:l,localizedDescription:i.computed(()=>a.value||o.value.description),cssVars:n?void 0:c,themeClass:d==null?void 0:d.themeClass,onRender:d==null?void 0:d.onRender}},render(){const{$slots:t,mergedClsPrefix:e,onRender:n}=this;return n==null||n(),i.h("div",{class:[`${e}-empty`,this.themeClass],style:this.cssVars},this.showIcon?i.h("div",{class:`${e}-empty__icon`},t.icon?t.icon():i.h(vr,{clsPrefix:e},{default:this.mergedRenderIcon})):null,this.showDescription?i.h("div",{class:`${e}-empty__description`},t.default?t.default():this.localizedDescription):null,t.extra?i.h("div",{class:`${e}-empty__extra`},t.extra()):null)}}),bx={height:"calc(var(--n-option-height) * 7.6)",paddingTiny:"4px 0",paddingSmall:"4px 0",paddingMedium:"4px 0",paddingLarge:"4px 0",paddingHuge:"4px 0",optionPaddingTiny:"0 12px",optionPaddingSmall:"0 12px",optionPaddingMedium:"0 12px",optionPaddingLarge:"0 12px",optionPaddingHuge:"0 12px",loadingSize:"18px"};function _x(t){const{borderRadius:e,popoverColor:n,textColor3:r,dividerColor:s,textColor2:o,primaryColorPressed:a,textColorDisabled:l,primaryColor:c,opacityDisabled:d,hoverColor:h,fontSizeTiny:u,fontSizeSmall:m,fontSizeMedium:f,fontSizeLarge:g,fontSizeHuge:p,heightTiny:b,heightSmall:y,heightMedium:_,heightLarge:S,heightHuge:C}=t;return Object.assign(Object.assign({},bx),{optionFontSizeTiny:u,optionFontSizeSmall:m,optionFontSizeMedium:f,optionFontSizeLarge:g,optionFontSizeHuge:p,optionHeightTiny:b,optionHeightSmall:y,optionHeightMedium:_,optionHeightLarge:S,optionHeightHuge:C,borderRadius:e,color:n,groupHeaderTextColor:r,actionDividerColor:s,optionTextColor:o,optionTextColorPressed:a,optionTextColorDisabled:l,optionTextColorActive:c,optionOpacityDisabled:d,optionCheckColor:c,optionColorPending:h,optionColorActive:"rgba(0, 0, 0, 0)",optionColorActivePending:h,actionTextColor:o,loadingColor:c})}const lu={name:"InternalSelectMenu",common:mi,peers:{Scrollbar:ha,Empty:au},self:_x},cu=i.defineComponent({name:"NBaseSelectGroupHeader",props:{clsPrefix:{type:String,required:!0},tmNode:{type:Object,required:!0}},setup(){const{renderLabelRef:t,renderOptionRef:e,labelFieldRef:n,nodePropsRef:r}=i.inject(ta);return{labelField:n,nodeProps:r,renderLabel:t,renderOption:e}},render(){const{clsPrefix:t,renderLabel:e,renderOption:n,nodeProps:r,tmNode:{rawNode:s}}=this,o=r==null?void 0:r(s),a=e?e(s,!1):Xi(s[this.labelField],s,!1),l=i.h("div",Object.assign({},o,{class:[`${t}-base-select-group-header`,o==null?void 0:o.class]}),a);return s.render?s.render({node:l,option:s}):n?n({node:l,option:s,selected:!1}):l}});function wx(t,e){return i.h(i.Transition,{name:"fade-in-scale-up-transition"},{default:()=>t?i.h(vr,{clsPrefix:e,class:`${e}-base-select-option__check`},{default:()=>i.h(Xw)}):null})}const du=i.defineComponent({name:"NBaseSelectOption",props:{clsPrefix:{type:String,required:!0},tmNode:{type:Object,required:!0}},setup(t){const{valueRef:e,pendingTmNodeRef:n,multipleRef:r,valueSetRef:s,renderLabelRef:o,renderOptionRef:a,labelFieldRef:l,valueFieldRef:c,showCheckmarkRef:d,nodePropsRef:h,handleOptionClick:u,handleOptionMouseEnter:m}=i.inject(ta),f=jt(()=>{const{value:y}=n;return y?t.tmNode.key===y.key:!1});function g(y){const{tmNode:_}=t;_.disabled||u(y,_)}function p(y){const{tmNode:_}=t;_.disabled||m(y,_)}function b(y){const{tmNode:_}=t,{value:S}=f;_.disabled||S||m(y,_)}return{multiple:r,isGrouped:jt(()=>{const{tmNode:y}=t,{parent:_}=y;return _&&_.rawNode.type==="group"}),showCheckmark:d,nodeProps:h,isPending:f,isSelected:jt(()=>{const{value:y}=e,{value:_}=r;if(y===null)return!1;const S=t.tmNode.rawNode[c.value];if(_){const{value:C}=s;return C.has(S)}else return y===S}),labelField:l,renderLabel:o,renderOption:a,handleMouseMove:b,handleMouseEnter:p,handleClick:g}},render(){const{clsPrefix:t,tmNode:{rawNode:e},isSelected:n,isPending:r,isGrouped:s,showCheckmark:o,nodeProps:a,renderOption:l,renderLabel:c,handleClick:d,handleMouseEnter:h,handleMouseMove:u}=this,m=wx(n,t),f=c?[c(e,n),o&&m]:[Xi(e[this.labelField],e,n),o&&m],g=a==null?void 0:a(e),p=i.h("div",Object.assign({},g,{class:[`${t}-base-select-option`,e.class,g==null?void 0:g.class,{[`${t}-base-select-option--disabled`]:e.disabled,[`${t}-base-select-option--selected`]:n,[`${t}-base-select-option--grouped`]:s,[`${t}-base-select-option--pending`]:r,[`${t}-base-select-option--show-checkmark`]:o}],style:[(g==null?void 0:g.style)||"",e.style||""],onClick:sa([d,g==null?void 0:g.onClick]),onMouseenter:sa([h,g==null?void 0:g.onMouseenter]),onMousemove:sa([u,g==null?void 0:g.onMousemove])}),i.h("div",{class:`${t}-base-select-option__content`},f));return e.render?e.render({node:p,option:e,selected:n}):l?l({node:p,option:e,selected:n}):p}}),{cubicBezierEaseIn:hu,cubicBezierEaseOut:uu}=xr;function fu({transformOrigin:t="inherit",duration:e=".2s",enterScale:n=".9",originalTransform:r="",originalTransition:s=""}={}){return[ae("&.fade-in-scale-up-transition-leave-active",{transformOrigin:t,transition:`opacity ${e} ${hu}, transform ${e} ${hu} ${s&&`,${s}`}`}),ae("&.fade-in-scale-up-transition-enter-active",{transformOrigin:t,transition:`opacity ${e} ${uu}, transform ${e} ${uu} ${s&&`,${s}`}`}),ae("&.fade-in-scale-up-transition-enter-from, &.fade-in-scale-up-transition-leave-to",{opacity:0,transform:`${r} scale(${n})`}),ae("&.fade-in-scale-up-transition-leave-from, &.fade-in-scale-up-transition-enter-to",{opacity:1,transform:`${r} scale(1)`})]}const xx=ge("base-select-menu",`
320
+ `)]),Ex=Object.assign(Object.assign({},ut.props),{description:String,showDescription:{type:Boolean,default:!0},showIcon:{type:Boolean,default:!0},size:{type:String,default:"medium"},renderIcon:Function}),Nx=i.defineComponent({name:"Empty",props:Ex,slots:Object,setup(t){const{mergedClsPrefixRef:e,inlineThemeDisabled:n,mergedComponentPropsRef:r}=gi(t),s=ut("Empty","-empty",$x,au,t,e),{localeRef:o}=Qh("Empty"),a=i.computed(()=>{var h,u,m;return(h=t.description)!==null&&h!==void 0?h:(m=(u=r==null?void 0:r.value)===null||u===void 0?void 0:u.Empty)===null||m===void 0?void 0:m.description}),l=i.computed(()=>{var h,u;return((u=(h=r==null?void 0:r.value)===null||h===void 0?void 0:h.Empty)===null||u===void 0?void 0:u.renderIcon)||(()=>i.h(dx,null))}),c=i.computed(()=>{const{size:h}=t,{common:{cubicBezierEaseInOut:u},self:{[Ge("iconSize",h)]:m,[Ge("fontSize",h)]:g,textColor:f,iconColor:p,extraTextColor:y}}=s.value;return{"--n-icon-size":m,"--n-font-size":g,"--n-bezier":u,"--n-text-color":f,"--n-icon-color":p,"--n-extra-text-color":y}}),d=n?mi("empty",i.computed(()=>{let h="";const{size:u}=t;return h+=u[0],h}),c,t):void 0;return{mergedClsPrefix:e,mergedRenderIcon:l,localizedDescription:i.computed(()=>a.value||o.value.description),cssVars:n?void 0:c,themeClass:d==null?void 0:d.themeClass,onRender:d==null?void 0:d.onRender}},render(){const{$slots:t,mergedClsPrefix:e,onRender:n}=this;return n==null||n(),i.h("div",{class:[`${e}-empty`,this.themeClass],style:this.cssVars},this.showIcon?i.h("div",{class:`${e}-empty__icon`},t.icon?t.icon():i.h(kr,{clsPrefix:e},{default:this.mergedRenderIcon})):null,this.showDescription?i.h("div",{class:`${e}-empty__description`},t.default?t.default():this.localizedDescription):null,t.extra?i.h("div",{class:`${e}-empty__extra`},t.extra()):null)}}),Px={height:"calc(var(--n-option-height) * 7.6)",paddingTiny:"4px 0",paddingSmall:"4px 0",paddingMedium:"4px 0",paddingLarge:"4px 0",paddingHuge:"4px 0",optionPaddingTiny:"0 12px",optionPaddingSmall:"0 12px",optionPaddingMedium:"0 12px",optionPaddingLarge:"0 12px",optionPaddingHuge:"0 12px",loadingSize:"18px"};function Fx(t){const{borderRadius:e,popoverColor:n,textColor3:r,dividerColor:s,textColor2:o,primaryColorPressed:a,textColorDisabled:l,primaryColor:c,opacityDisabled:d,hoverColor:h,fontSizeTiny:u,fontSizeSmall:m,fontSizeMedium:g,fontSizeLarge:f,fontSizeHuge:p,heightTiny:y,heightSmall:b,heightMedium:_,heightLarge:C,heightHuge:S}=t;return Object.assign(Object.assign({},Px),{optionFontSizeTiny:u,optionFontSizeSmall:m,optionFontSizeMedium:g,optionFontSizeLarge:f,optionFontSizeHuge:p,optionHeightTiny:y,optionHeightSmall:b,optionHeightMedium:_,optionHeightLarge:C,optionHeightHuge:S,borderRadius:e,color:n,groupHeaderTextColor:r,actionDividerColor:s,optionTextColor:o,optionTextColorPressed:a,optionTextColorDisabled:l,optionTextColorActive:c,optionOpacityDisabled:d,optionCheckColor:c,optionColorPending:h,optionColorActive:"rgba(0, 0, 0, 0)",optionColorActivePending:h,actionTextColor:o,loadingColor:c})}const lu={name:"InternalSelectMenu",common:pi,peers:{Scrollbar:ha,Empty:au},self:Fx},cu=i.defineComponent({name:"NBaseSelectGroupHeader",props:{clsPrefix:{type:String,required:!0},tmNode:{type:Object,required:!0}},setup(){const{renderLabelRef:t,renderOptionRef:e,labelFieldRef:n,nodePropsRef:r}=i.inject(ta);return{labelField:n,nodeProps:r,renderLabel:t,renderOption:e}},render(){const{clsPrefix:t,renderLabel:e,renderOption:n,nodeProps:r,tmNode:{rawNode:s}}=this,o=r==null?void 0:r(s),a=e?e(s,!1):Yi(s[this.labelField],s,!1),l=i.h("div",Object.assign({},o,{class:[`${t}-base-select-group-header`,o==null?void 0:o.class]}),a);return s.render?s.render({node:l,option:s}):n?n({node:l,option:s,selected:!1}):l}});function Mx(t,e){return i.h(i.Transition,{name:"fade-in-scale-up-transition"},{default:()=>t?i.h(kr,{clsPrefix:e,class:`${e}-base-select-option__check`},{default:()=>i.h(ox)}):null})}const du=i.defineComponent({name:"NBaseSelectOption",props:{clsPrefix:{type:String,required:!0},tmNode:{type:Object,required:!0}},setup(t){const{valueRef:e,pendingTmNodeRef:n,multipleRef:r,valueSetRef:s,renderLabelRef:o,renderOptionRef:a,labelFieldRef:l,valueFieldRef:c,showCheckmarkRef:d,nodePropsRef:h,handleOptionClick:u,handleOptionMouseEnter:m}=i.inject(ta),g=Wt(()=>{const{value:b}=n;return b?t.tmNode.key===b.key:!1});function f(b){const{tmNode:_}=t;_.disabled||u(b,_)}function p(b){const{tmNode:_}=t;_.disabled||m(b,_)}function y(b){const{tmNode:_}=t,{value:C}=g;_.disabled||C||m(b,_)}return{multiple:r,isGrouped:Wt(()=>{const{tmNode:b}=t,{parent:_}=b;return _&&_.rawNode.type==="group"}),showCheckmark:d,nodeProps:h,isPending:g,isSelected:Wt(()=>{const{value:b}=e,{value:_}=r;if(b===null)return!1;const C=t.tmNode.rawNode[c.value];if(_){const{value:S}=s;return S.has(C)}else return b===C}),labelField:l,renderLabel:o,renderOption:a,handleMouseMove:y,handleMouseEnter:p,handleClick:f}},render(){const{clsPrefix:t,tmNode:{rawNode:e},isSelected:n,isPending:r,isGrouped:s,showCheckmark:o,nodeProps:a,renderOption:l,renderLabel:c,handleClick:d,handleMouseEnter:h,handleMouseMove:u}=this,m=Mx(n,t),g=c?[c(e,n),o&&m]:[Yi(e[this.labelField],e,n),o&&m],f=a==null?void 0:a(e),p=i.h("div",Object.assign({},f,{class:[`${t}-base-select-option`,e.class,f==null?void 0:f.class,{[`${t}-base-select-option--disabled`]:e.disabled,[`${t}-base-select-option--selected`]:n,[`${t}-base-select-option--grouped`]:s,[`${t}-base-select-option--pending`]:r,[`${t}-base-select-option--show-checkmark`]:o}],style:[(f==null?void 0:f.style)||"",e.style||""],onClick:sa([d,f==null?void 0:f.onClick]),onMouseenter:sa([h,f==null?void 0:f.onMouseenter]),onMousemove:sa([u,f==null?void 0:f.onMousemove])}),i.h("div",{class:`${t}-base-select-option__content`},g));return e.render?e.render({node:p,option:e,selected:n}):l?l({node:p,option:e,selected:n}):p}}),{cubicBezierEaseIn:hu,cubicBezierEaseOut:uu}=vr;function fu({transformOrigin:t="inherit",duration:e=".2s",enterScale:n=".9",originalTransform:r="",originalTransition:s=""}={}){return[ae("&.fade-in-scale-up-transition-leave-active",{transformOrigin:t,transition:`opacity ${e} ${hu}, transform ${e} ${hu} ${s&&`,${s}`}`}),ae("&.fade-in-scale-up-transition-enter-active",{transformOrigin:t,transition:`opacity ${e} ${uu}, transform ${e} ${uu} ${s&&`,${s}`}`}),ae("&.fade-in-scale-up-transition-enter-from, &.fade-in-scale-up-transition-leave-to",{opacity:0,transform:`${r} scale(${n})`}),ae("&.fade-in-scale-up-transition-leave-from, &.fade-in-scale-up-transition-enter-to",{opacity:1,transform:`${r} scale(1)`})]}const Ax=ue("base-select-menu",`
321
321
  line-height: 1.5;
322
322
  outline: none;
323
323
  z-index: 0;
@@ -327,11 +327,11 @@ ${s}
327
327
  background-color .3s var(--n-bezier),
328
328
  box-shadow .3s var(--n-bezier);
329
329
  background-color: var(--n-color);
330
- `,[ge("scrollbar",`
330
+ `,[ue("scrollbar",`
331
331
  max-height: var(--n-height);
332
- `),ge("virtual-list",`
332
+ `),ue("virtual-list",`
333
333
  max-height: var(--n-height);
334
- `),ge("base-select-option",`
334
+ `),ue("base-select-option",`
335
335
  min-height: var(--n-option-height);
336
336
  font-size: var(--n-option-font-size);
337
337
  display: flex;
@@ -341,12 +341,12 @@ ${s}
341
341
  white-space: nowrap;
342
342
  text-overflow: ellipsis;
343
343
  overflow: hidden;
344
- `)]),ge("base-select-group-header",`
344
+ `)]),ue("base-select-group-header",`
345
345
  min-height: var(--n-option-height);
346
346
  font-size: .93em;
347
347
  display: flex;
348
348
  align-items: center;
349
- `),ge("base-select-menu-option-wrapper",`
349
+ `),ue("base-select-menu-option-wrapper",`
350
350
  position: relative;
351
351
  width: 100%;
352
352
  `),ye("loading, empty",`
@@ -373,12 +373,12 @@ ${s}
373
373
  border-color .3s var(--n-bezier);
374
374
  border-top: 1px solid var(--n-action-divider-color);
375
375
  color: var(--n-action-text-color);
376
- `),ge("base-select-group-header",`
376
+ `),ue("base-select-group-header",`
377
377
  position: relative;
378
378
  cursor: default;
379
379
  padding: var(--n-option-padding);
380
380
  color: var(--n-group-header-text-color);
381
- `),ge("base-select-option",`
381
+ `),ue("base-select-option",`
382
382
  cursor: pointer;
383
383
  position: relative;
384
384
  padding: var(--n-option-padding);
@@ -388,7 +388,7 @@ ${s}
388
388
  box-sizing: border-box;
389
389
  color: var(--n-option-text-color);
390
390
  opacity: 1;
391
- `,[Ce("show-checkmark",`
391
+ `,[Be("show-checkmark",`
392
392
  padding-right: calc(var(--n-option-padding-right) + 20px);
393
393
  `),ae("&::before",`
394
394
  content: "";
@@ -401,21 +401,21 @@ ${s}
401
401
  transition: background-color .3s var(--n-bezier);
402
402
  `),ae("&:active",`
403
403
  color: var(--n-option-text-color-pressed);
404
- `),Ce("grouped",`
404
+ `),Be("grouped",`
405
405
  padding-left: calc(var(--n-option-padding-left) * 1.5);
406
- `),Ce("pending",[ae("&::before",`
406
+ `),Be("pending",[ae("&::before",`
407
407
  background-color: var(--n-option-color-pending);
408
- `)]),Ce("selected",`
408
+ `)]),Be("selected",`
409
409
  color: var(--n-option-text-color-active);
410
410
  `,[ae("&::before",`
411
411
  background-color: var(--n-option-color-active);
412
- `),Ce("pending",[ae("&::before",`
412
+ `),Be("pending",[ae("&::before",`
413
413
  background-color: var(--n-option-color-active-pending);
414
- `)])]),Ce("disabled",`
414
+ `)])]),Be("disabled",`
415
415
  cursor: not-allowed;
416
- `,[Gt("selected",`
416
+ `,[Ut("selected",`
417
417
  color: var(--n-option-text-color-disabled);
418
- `),Ce("selected",`
418
+ `),Be("selected",`
419
419
  opacity: var(--n-option-opacity-disabled);
420
420
  `)]),ye("check",`
421
421
  font-size: 16px;
@@ -424,7 +424,7 @@ ${s}
424
424
  top: calc(50% - 7px);
425
425
  color: var(--n-option-check-color);
426
426
  transition: color .3s var(--n-bezier);
427
- `,[fu({enterScale:"0.5"})])])]),vx=i.defineComponent({name:"InternalSelectMenu",props:Object.assign(Object.assign({},gt.props),{clsPrefix:{type:String,required:!0},scrollable:{type:Boolean,default:!0},treeMate:{type:Object,required:!0},multiple:Boolean,size:{type:String,default:"medium"},value:{type:[String,Number,Array],default:null},autoPending:Boolean,virtualScroll:{type:Boolean,default:!0},show:{type:Boolean,default:!0},labelField:{type:String,default:"label"},valueField:{type:String,default:"value"},loading:Boolean,focusable:Boolean,renderLabel:Function,renderOption:Function,nodeProps:Function,showCheckmark:{type:Boolean,default:!0},onMousedown:Function,onScroll:Function,onFocus:Function,onBlur:Function,onKeyup:Function,onKeydown:Function,onTabOut:Function,onMouseenter:Function,onMouseleave:Function,onResize:Function,resetMenuOnOptionsChange:{type:Boolean,default:!0},inlineThemeDisabled:Boolean,onToggle:Function}),setup(t){const{mergedClsPrefixRef:e,mergedRtlRef:n}=fi(t),r=wr("InternalSelectMenu",n,e),s=gt("InternalSelectMenu","-internal-select-menu",xx,lu,t,i.toRef(t,"clsPrefix")),o=i.ref(null),a=i.ref(null),l=i.ref(null),c=i.computed(()=>t.treeMate.getFlattenedNodes()),d=i.computed(()=>g_(c.value)),h=i.ref(null);function u(){const{treeMate:N}=t;let I=null;const{value:J}=t;J===null?I=N.getFirstAvailableNode():(t.multiple?I=N.getNode((J||[])[(J||[]).length-1]):I=N.getNode(J),(!I||I.disabled)&&(I=N.getFirstAvailableNode())),z(I||null)}function m(){const{value:N}=h;N&&!t.treeMate.getNode(N.key)&&(h.value=null)}let f;i.watch(()=>t.show,N=>{N?f=i.watch(()=>t.treeMate,()=>{t.resetMenuOnOptionsChange?(t.autoPending?u():m(),i.nextTick(O)):m()},{immediate:!0}):f==null||f()},{immediate:!0}),i.onBeforeUnmount(()=>{f==null||f()});const g=i.computed(()=>dr(s.value.self[Ue("optionHeight",t.size)])),p=i.computed(()=>Ut(s.value.self[Ue("padding",t.size)])),b=i.computed(()=>t.multiple&&Array.isArray(t.value)?new Set(t.value):new Set),y=i.computed(()=>{const N=c.value;return N&&N.length===0});function _(N){const{onToggle:I}=t;I&&I(N)}function S(N){const{onScroll:I}=t;I&&I(N)}function C(N){var I;(I=l.value)===null||I===void 0||I.sync(),S(N)}function v(){var N;(N=l.value)===null||N===void 0||N.sync()}function B(){const{value:N}=h;return N||null}function k(N,I){I.disabled||z(I,!1)}function R(N,I){I.disabled||_(I)}function $(N){var I;lr(N,"action")||(I=t.onKeyup)===null||I===void 0||I.call(t,N)}function F(N){var I;lr(N,"action")||(I=t.onKeydown)===null||I===void 0||I.call(t,N)}function D(N){var I;(I=t.onMousedown)===null||I===void 0||I.call(t,N),!t.focusable&&N.preventDefault()}function L(){const{value:N}=h;N&&z(N.getNext({loop:!0}),!0)}function M(){const{value:N}=h;N&&z(N.getPrev({loop:!0}),!0)}function z(N,I=!1){h.value=N,I&&O()}function O(){var N,I;const J=h.value;if(!J)return;const ce=d.value(J.key);ce!==null&&(t.virtualScroll?(N=a.value)===null||N===void 0||N.scrollTo({index:ce}):(I=l.value)===null||I===void 0||I.scrollTo({index:ce,elSize:g.value}))}function ne(N){var I,J;!((I=o.value)===null||I===void 0)&&I.contains(N.target)&&((J=t.onFocus)===null||J===void 0||J.call(t,N))}function P(N){var I,J;!((I=o.value)===null||I===void 0)&&I.contains(N.relatedTarget)||(J=t.onBlur)===null||J===void 0||J.call(t,N)}i.provide(ta,{handleOptionMouseEnter:k,handleOptionClick:R,valueSetRef:b,pendingTmNodeRef:h,nodePropsRef:i.toRef(t,"nodeProps"),showCheckmarkRef:i.toRef(t,"showCheckmark"),multipleRef:i.toRef(t,"multiple"),valueRef:i.toRef(t,"value"),renderLabelRef:i.toRef(t,"renderLabel"),renderOptionRef:i.toRef(t,"renderOption"),labelFieldRef:i.toRef(t,"labelField"),valueFieldRef:i.toRef(t,"valueField")}),i.provide(Mh,o),i.onMounted(()=>{const{value:N}=l;N&&N.sync()});const E=i.computed(()=>{const{size:N}=t,{common:{cubicBezierEaseInOut:I},self:{height:J,borderRadius:ce,color:re,groupHeaderTextColor:de,actionDividerColor:se,optionTextColorPressed:Ae,optionTextColor:Fe,optionTextColorDisabled:Ke,optionTextColorActive:Ie,optionOpacityDisabled:bt,optionCheckColor:Jt,actionTextColor:Qt,optionColorPending:Bt,optionColorActive:Ot,loadingColor:lt,loadingSize:Nn,optionColorActivePending:je,[Ue("optionFontSize",N)]:Se,[Ue("optionHeight",N)]:st,[Ue("optionPadding",N)]:qe}}=s.value;return{"--n-height":J,"--n-action-divider-color":se,"--n-action-text-color":Qt,"--n-bezier":I,"--n-border-radius":ce,"--n-color":re,"--n-option-font-size":Se,"--n-group-header-text-color":de,"--n-option-check-color":Jt,"--n-option-color-pending":Bt,"--n-option-color-active":Ot,"--n-option-color-active-pending":je,"--n-option-height":st,"--n-option-opacity-disabled":bt,"--n-option-text-color":Fe,"--n-option-text-color-active":Ie,"--n-option-text-color-disabled":Ke,"--n-option-text-color-pressed":Ae,"--n-option-padding":qe,"--n-option-padding-left":Ut(qe,"left"),"--n-option-padding-right":Ut(qe,"right"),"--n-loading-color":lt,"--n-loading-size":Nn}}),{inlineThemeDisabled:X}=t,j=X?gi("internal-select-menu",i.computed(()=>t.size[0]),E,t):void 0,H={selfRef:o,next:L,prev:M,getPendingTmNode:B};return zh(o,t.onResize),Object.assign({mergedTheme:s,mergedClsPrefix:e,rtlEnabled:r,virtualListRef:a,scrollbarRef:l,itemSize:g,padding:p,flattenedNodes:c,empty:y,virtualListContainer(){const{value:N}=a;return N==null?void 0:N.listElRef},virtualListContent(){const{value:N}=a;return N==null?void 0:N.itemsElRef},doScroll:S,handleFocusin:ne,handleFocusout:P,handleKeyUp:$,handleKeyDown:F,handleMouseDown:D,handleVirtualListResize:v,handleVirtualListScroll:C,cssVars:X?void 0:E,themeClass:j==null?void 0:j.themeClass,onRender:j==null?void 0:j.onRender},H)},render(){const{$slots:t,virtualScroll:e,clsPrefix:n,mergedTheme:r,themeClass:s,onRender:o}=this;return o==null||o(),i.h("div",{ref:"selfRef",tabindex:this.focusable?0:-1,class:[`${n}-base-select-menu`,this.rtlEnabled&&`${n}-base-select-menu--rtl`,s,this.multiple&&`${n}-base-select-menu--multiple`],style:this.cssVars,onFocusin:this.handleFocusin,onFocusout:this.handleFocusout,onKeyup:this.handleKeyUp,onKeydown:this.handleKeyDown,onMousedown:this.handleMouseDown,onMouseenter:this.onMouseenter,onMouseleave:this.onMouseleave},hi(t.header,a=>a&&i.h("div",{class:`${n}-base-select-menu__header`,"data-header":!0,key:"header"},a)),this.loading?i.h("div",{class:`${n}-base-select-menu__loading`},i.h(nu,{clsPrefix:n,strokeWidth:20})):this.empty?i.h("div",{class:`${n}-base-select-menu__empty`,"data-empty":!0},oa(t.empty,()=>[i.h(yx,{theme:r.peers.Empty,themeOverrides:r.peerOverrides.Empty,size:this.size})])):i.h(ou,{ref:"scrollbarRef",theme:r.peers.Scrollbar,themeOverrides:r.peerOverrides.Scrollbar,scrollable:this.scrollable,container:e?this.virtualListContainer:void 0,content:e?this.virtualListContent:void 0,onScroll:e?void 0:this.doScroll},{default:()=>e?i.h(j1,{ref:"virtualListRef",class:`${n}-virtual-list`,items:this.flattenedNodes,itemSize:this.itemSize,showScrollbar:!1,paddingTop:this.padding.top,paddingBottom:this.padding.bottom,onResize:this.handleVirtualListResize,onScroll:this.handleVirtualListScroll,itemResizable:!0},{default:({item:a})=>a.isGroup?i.h(cu,{key:a.key,clsPrefix:n,tmNode:a}):a.ignored?null:i.h(du,{clsPrefix:n,key:a.key,tmNode:a})}):i.h("div",{class:`${n}-base-select-menu-option-wrapper`,style:{paddingTop:this.padding.top,paddingBottom:this.padding.bottom}},this.flattenedNodes.map(a=>a.isGroup?i.h(cu,{key:a.key,clsPrefix:n,tmNode:a}):i.h(du,{clsPrefix:n,key:a.key,tmNode:a})))}),hi(t.action,a=>a&&[i.h("div",{class:`${n}-base-select-menu__action`,"data-action":!0,key:"action"},a),i.h(nx,{onFocus:this.onTabOut,key:"focus-detector"})]))}}),kx={space:"6px",spaceArrow:"10px",arrowOffset:"10px",arrowOffsetVertical:"10px",arrowHeight:"6px",padding:"8px 14px"};function Cx(t){const{boxShadow2:e,popoverColor:n,textColor2:r,borderRadius:s,fontSize:o,dividerColor:a}=t;return Object.assign(Object.assign({},kx),{fontSize:o,borderRadius:s,color:n,dividerColor:a,textColor:r,boxShadow:e})}const gu={name:"Popover",common:mi,peers:{Scrollbar:ha},self:Cx},ua={top:"bottom",bottom:"top",left:"right",right:"left"},tt="var(--n-arrow-height) * 1.414",Sx=ae([ge("popover",`
427
+ `,[fu({enterScale:"0.5"})])])]),Vx=i.defineComponent({name:"InternalSelectMenu",props:Object.assign(Object.assign({},ut.props),{clsPrefix:{type:String,required:!0},scrollable:{type:Boolean,default:!0},treeMate:{type:Object,required:!0},multiple:Boolean,size:{type:String,default:"medium"},value:{type:[String,Number,Array],default:null},autoPending:Boolean,virtualScroll:{type:Boolean,default:!0},show:{type:Boolean,default:!0},labelField:{type:String,default:"label"},valueField:{type:String,default:"value"},loading:Boolean,focusable:Boolean,renderLabel:Function,renderOption:Function,nodeProps:Function,showCheckmark:{type:Boolean,default:!0},onMousedown:Function,onScroll:Function,onFocus:Function,onBlur:Function,onKeyup:Function,onKeydown:Function,onTabOut:Function,onMouseenter:Function,onMouseleave:Function,onResize:Function,resetMenuOnOptionsChange:{type:Boolean,default:!0},inlineThemeDisabled:Boolean,onToggle:Function}),setup(t){const{mergedClsPrefixRef:e,mergedRtlRef:n}=gi(t),r=xr("InternalSelectMenu",n,e),s=ut("InternalSelectMenu","-internal-select-menu",Ax,lu,t,i.toRef(t,"clsPrefix")),o=i.ref(null),a=i.ref(null),l=i.ref(null),c=i.computed(()=>t.treeMate.getFlattenedNodes()),d=i.computed(()=>R_(c.value)),h=i.ref(null);function u(){const{treeMate:F}=t;let M=null;const{value:Z}=t;Z===null?M=F.getFirstAvailableNode():(t.multiple?M=F.getNode((Z||[])[(Z||[]).length-1]):M=F.getNode(Z),(!M||M.disabled)&&(M=F.getFirstAvailableNode())),L(M||null)}function m(){const{value:F}=h;F&&!t.treeMate.getNode(F.key)&&(h.value=null)}let g;i.watch(()=>t.show,F=>{F?g=i.watch(()=>t.treeMate,()=>{t.resetMenuOnOptionsChange?(t.autoPending?u():m(),i.nextTick(D)):m()},{immediate:!0}):g==null||g()},{immediate:!0}),i.onBeforeUnmount(()=>{g==null||g()});const f=i.computed(()=>hr(s.value.self[Ge("optionHeight",t.size)])),p=i.computed(()=>Yt(s.value.self[Ge("padding",t.size)])),y=i.computed(()=>t.multiple&&Array.isArray(t.value)?new Set(t.value):new Set),b=i.computed(()=>{const F=c.value;return F&&F.length===0});function _(F){const{onToggle:M}=t;M&&M(F)}function C(F){const{onScroll:M}=t;M&&M(F)}function S(F){var M;(M=l.value)===null||M===void 0||M.sync(),C(F)}function v(){var F;(F=l.value)===null||F===void 0||F.sync()}function B(){const{value:F}=h;return F||null}function k(F,M){M.disabled||L(M,!1)}function R(F,M){M.disabled||_(M)}function $(F){var M;cr(F,"action")||(M=t.onKeyup)===null||M===void 0||M.call(t,F)}function P(F){var M;cr(F,"action")||(M=t.onKeydown)===null||M===void 0||M.call(t,F)}function I(F){var M;(M=t.onMousedown)===null||M===void 0||M.call(t,F),!t.focusable&&F.preventDefault()}function V(){const{value:F}=h;F&&L(F.getNext({loop:!0}),!0)}function A(){const{value:F}=h;F&&L(F.getPrev({loop:!0}),!0)}function L(F,M=!1){h.value=F,M&&D()}function D(){var F,M;const Z=h.value;if(!Z)return;const fe=d.value(Z.key);fe!==null&&(t.virtualScroll?(F=a.value)===null||F===void 0||F.scrollTo({index:fe}):(M=l.value)===null||M===void 0||M.scrollTo({index:fe,elSize:f.value}))}function ee(F){var M,Z;!((M=o.value)===null||M===void 0)&&M.contains(F.target)&&((Z=t.onFocus)===null||Z===void 0||Z.call(t,F))}function E(F){var M,Z;!((M=o.value)===null||M===void 0)&&M.contains(F.relatedTarget)||(Z=t.onBlur)===null||Z===void 0||Z.call(t,F)}i.provide(ta,{handleOptionMouseEnter:k,handleOptionClick:R,valueSetRef:y,pendingTmNodeRef:h,nodePropsRef:i.toRef(t,"nodeProps"),showCheckmarkRef:i.toRef(t,"showCheckmark"),multipleRef:i.toRef(t,"multiple"),valueRef:i.toRef(t,"value"),renderLabelRef:i.toRef(t,"renderLabel"),renderOptionRef:i.toRef(t,"renderOption"),labelFieldRef:i.toRef(t,"labelField"),valueFieldRef:i.toRef(t,"valueField")}),i.provide(Mh,o),i.onMounted(()=>{const{value:F}=l;F&&F.sync()});const N=i.computed(()=>{const{size:F}=t,{common:{cubicBezierEaseInOut:M},self:{height:Z,borderRadius:fe,color:ie,groupHeaderTextColor:me,actionDividerColor:re,optionTextColorPressed:Me,optionTextColor:Ae,optionTextColorDisabled:Oe,optionTextColorActive:Le,optionOpacityDisabled:pt,optionCheckColor:Zt,actionTextColor:Qt,optionColorPending:St,optionColorActive:At,loadingColor:yt,loadingSize:pn,optionColorActivePending:Pn,[Ge("optionFontSize",F)]:De,[Ge("optionHeight",F)]:ke,[Ge("optionPadding",F)]:Ie}}=s.value;return{"--n-height":Z,"--n-action-divider-color":re,"--n-action-text-color":Qt,"--n-bezier":M,"--n-border-radius":fe,"--n-color":ie,"--n-option-font-size":De,"--n-group-header-text-color":me,"--n-option-check-color":Zt,"--n-option-color-pending":St,"--n-option-color-active":At,"--n-option-color-active-pending":Pn,"--n-option-height":ke,"--n-option-opacity-disabled":pt,"--n-option-text-color":Ae,"--n-option-text-color-active":Le,"--n-option-text-color-disabled":Oe,"--n-option-text-color-pressed":Me,"--n-option-padding":Ie,"--n-option-padding-left":Yt(Ie,"left"),"--n-option-padding-right":Yt(Ie,"right"),"--n-loading-color":yt,"--n-loading-size":pn}}),{inlineThemeDisabled:H}=t,q=H?mi("internal-select-menu",i.computed(()=>t.size[0]),N,t):void 0,Y={selfRef:o,next:V,prev:A,getPendingTmNode:B};return zh(o,t.onResize),Object.assign({mergedTheme:s,mergedClsPrefix:e,rtlEnabled:r,virtualListRef:a,scrollbarRef:l,itemSize:f,padding:p,flattenedNodes:c,empty:b,virtualListContainer(){const{value:F}=a;return F==null?void 0:F.listElRef},virtualListContent(){const{value:F}=a;return F==null?void 0:F.itemsElRef},doScroll:C,handleFocusin:ee,handleFocusout:E,handleKeyUp:$,handleKeyDown:P,handleMouseDown:I,handleVirtualListResize:v,handleVirtualListScroll:S,cssVars:H?void 0:N,themeClass:q==null?void 0:q.themeClass,onRender:q==null?void 0:q.onRender},Y)},render(){const{$slots:t,virtualScroll:e,clsPrefix:n,mergedTheme:r,themeClass:s,onRender:o}=this;return o==null||o(),i.h("div",{ref:"selfRef",tabindex:this.focusable?0:-1,class:[`${n}-base-select-menu`,this.rtlEnabled&&`${n}-base-select-menu--rtl`,s,this.multiple&&`${n}-base-select-menu--multiple`],style:this.cssVars,onFocusin:this.handleFocusin,onFocusout:this.handleFocusout,onKeyup:this.handleKeyUp,onKeydown:this.handleKeyDown,onMousedown:this.handleMouseDown,onMouseenter:this.onMouseenter,onMouseleave:this.onMouseleave},ui(t.header,a=>a&&i.h("div",{class:`${n}-base-select-menu__header`,"data-header":!0,key:"header"},a)),this.loading?i.h("div",{class:`${n}-base-select-menu__loading`},i.h(nu,{clsPrefix:n,strokeWidth:20})):this.empty?i.h("div",{class:`${n}-base-select-menu__empty`,"data-empty":!0},oa(t.empty,()=>[i.h(Nx,{theme:r.peers.Empty,themeOverrides:r.peerOverrides.Empty,size:this.size})])):i.h(ou,{ref:"scrollbarRef",theme:r.peers.Scrollbar,themeOverrides:r.peerOverrides.Scrollbar,scrollable:this.scrollable,container:e?this.virtualListContainer:void 0,content:e?this.virtualListContent:void 0,onScroll:e?void 0:this.doScroll},{default:()=>e?i.h(rw,{ref:"virtualListRef",class:`${n}-virtual-list`,items:this.flattenedNodes,itemSize:this.itemSize,showScrollbar:!1,paddingTop:this.padding.top,paddingBottom:this.padding.bottom,onResize:this.handleVirtualListResize,onScroll:this.handleVirtualListScroll,itemResizable:!0},{default:({item:a})=>a.isGroup?i.h(cu,{key:a.key,clsPrefix:n,tmNode:a}):a.ignored?null:i.h(du,{clsPrefix:n,key:a.key,tmNode:a})}):i.h("div",{class:`${n}-base-select-menu-option-wrapper`,style:{paddingTop:this.padding.top,paddingBottom:this.padding.bottom}},this.flattenedNodes.map(a=>a.isGroup?i.h(cu,{key:a.key,clsPrefix:n,tmNode:a}):i.h(du,{clsPrefix:n,key:a.key,tmNode:a})))}),ui(t.action,a=>a&&[i.h("div",{class:`${n}-base-select-menu__action`,"data-action":!0,key:"action"},a),i.h(px,{onFocus:this.onTabOut,key:"focus-detector"})]))}}),Ox={space:"6px",spaceArrow:"10px",arrowOffset:"10px",arrowOffsetVertical:"10px",arrowHeight:"6px",padding:"8px 14px"};function Ix(t){const{boxShadow2:e,popoverColor:n,textColor2:r,borderRadius:s,fontSize:o,dividerColor:a}=t;return Object.assign(Object.assign({},Ox),{fontSize:o,borderRadius:s,color:n,dividerColor:a,textColor:r,boxShadow:e})}const gu={name:"Popover",common:pi,peers:{Scrollbar:ha},self:Ix},ua={top:"bottom",bottom:"top",left:"right",right:"left"},tt="var(--n-arrow-height) * 1.414",zx=ae([ue("popover",`
428
428
  transition:
429
429
  box-shadow .3s var(--n-bezier),
430
430
  background-color .3s var(--n-bezier),
@@ -434,13 +434,13 @@ ${s}
434
434
  color: var(--n-text-color);
435
435
  box-shadow: var(--n-box-shadow);
436
436
  word-break: break-word;
437
- `,[ae(">",[ge("scrollbar",`
437
+ `,[ae(">",[ue("scrollbar",`
438
438
  height: inherit;
439
439
  max-height: inherit;
440
- `)]),Gt("raw",`
440
+ `)]),Ut("raw",`
441
441
  background-color: var(--n-color);
442
442
  border-radius: var(--n-border-radius);
443
- `,[Gt("scrollable",[Gt("show-header-or-footer","padding: var(--n-padding);")])]),ye("header",`
443
+ `,[Ut("scrollable",[Ut("show-header-or-footer","padding: var(--n-padding);")])]),ye("header",`
444
444
  padding: var(--n-padding);
445
445
  border-bottom: 1px solid var(--n-divider-color);
446
446
  transition: border-color .3s var(--n-bezier);
@@ -448,15 +448,15 @@ ${s}
448
448
  padding: var(--n-padding);
449
449
  border-top: 1px solid var(--n-divider-color);
450
450
  transition: border-color .3s var(--n-bezier);
451
- `),Ce("scrollable, show-header-or-footer",[ye("content",`
451
+ `),Be("scrollable, show-header-or-footer",[ye("content",`
452
452
  padding: var(--n-padding);
453
- `)])]),ge("popover-shared",`
453
+ `)])]),ue("popover-shared",`
454
454
  transform-origin: inherit;
455
- `,[ge("popover-arrow-wrapper",`
455
+ `,[ue("popover-arrow-wrapper",`
456
456
  position: absolute;
457
457
  overflow: hidden;
458
458
  pointer-events: none;
459
- `,[ge("popover-arrow",`
459
+ `,[ue("popover-arrow",`
460
460
  transition: background-color .3s var(--n-bezier);
461
461
  position: absolute;
462
462
  display: block;
@@ -486,53 +486,53 @@ ${s}
486
486
  color .3s var(--n-bezier),
487
487
  opacity .15s var(--n-bezier-ease-in),
488
488
  transform .15s var(--n-bezier-ease-in);
489
- `)]),qt("top-start",`
489
+ `)]),jt("top-start",`
490
490
  top: calc(${tt} / -2);
491
- left: calc(${kn("top-start")} - var(--v-offset-left));
492
- `),qt("top",`
491
+ left: calc(${Cn("top-start")} - var(--v-offset-left));
492
+ `),jt("top",`
493
493
  top: calc(${tt} / -2);
494
494
  transform: translateX(calc(${tt} / -2)) rotate(45deg);
495
495
  left: 50%;
496
- `),qt("top-end",`
496
+ `),jt("top-end",`
497
497
  top: calc(${tt} / -2);
498
- right: calc(${kn("top-end")} + var(--v-offset-left));
499
- `),qt("bottom-start",`
498
+ right: calc(${Cn("top-end")} + var(--v-offset-left));
499
+ `),jt("bottom-start",`
500
500
  bottom: calc(${tt} / -2);
501
- left: calc(${kn("bottom-start")} - var(--v-offset-left));
502
- `),qt("bottom",`
501
+ left: calc(${Cn("bottom-start")} - var(--v-offset-left));
502
+ `),jt("bottom",`
503
503
  bottom: calc(${tt} / -2);
504
504
  transform: translateX(calc(${tt} / -2)) rotate(45deg);
505
505
  left: 50%;
506
- `),qt("bottom-end",`
506
+ `),jt("bottom-end",`
507
507
  bottom: calc(${tt} / -2);
508
- right: calc(${kn("bottom-end")} + var(--v-offset-left));
509
- `),qt("left-start",`
508
+ right: calc(${Cn("bottom-end")} + var(--v-offset-left));
509
+ `),jt("left-start",`
510
510
  left: calc(${tt} / -2);
511
- top: calc(${kn("left-start")} - var(--v-offset-top));
512
- `),qt("left",`
511
+ top: calc(${Cn("left-start")} - var(--v-offset-top));
512
+ `),jt("left",`
513
513
  left: calc(${tt} / -2);
514
514
  transform: translateY(calc(${tt} / -2)) rotate(45deg);
515
515
  top: 50%;
516
- `),qt("left-end",`
516
+ `),jt("left-end",`
517
517
  left: calc(${tt} / -2);
518
- bottom: calc(${kn("left-end")} + var(--v-offset-top));
519
- `),qt("right-start",`
518
+ bottom: calc(${Cn("left-end")} + var(--v-offset-top));
519
+ `),jt("right-start",`
520
520
  right: calc(${tt} / -2);
521
- top: calc(${kn("right-start")} - var(--v-offset-top));
522
- `),qt("right",`
521
+ top: calc(${Cn("right-start")} - var(--v-offset-top));
522
+ `),jt("right",`
523
523
  right: calc(${tt} / -2);
524
524
  transform: translateY(calc(${tt} / -2)) rotate(45deg);
525
525
  top: 50%;
526
- `),qt("right-end",`
526
+ `),jt("right-end",`
527
527
  right: calc(${tt} / -2);
528
- bottom: calc(${kn("right-end")} + var(--v-offset-top));
529
- `),...A.map({top:["right-start","left-start"],right:["top-end","bottom-end"],bottom:["right-end","left-end"],left:["top-start","bottom-start"]},(t,e)=>{const n=["right","left"].includes(e),r=n?"width":"height";return t.map(s=>{const o=s.split("-")[1]==="end",l=`calc((${`var(--v-target-${r}, 0px)`} - ${tt}) / 2)`,c=kn(s);return ae(`[v-placement="${s}"] >`,[ge("popover-shared",[Ce("center-arrow",[ge("popover-arrow",`${e}: calc(max(${l}, ${c}) ${o?"+":"-"} var(--v-offset-${n?"left":"top"}));`)])])])})})]);function kn(t){return["top","bottom"].includes(t.split("-")[0])?"var(--n-arrow-offset)":"var(--n-arrow-offset-vertical)"}function qt(t,e){const n=t.split("-")[0],r=["top","bottom"].includes(n)?"height: var(--n-space-arrow);":"width: var(--n-space-arrow);";return ae(`[v-placement="${t}"] >`,[ge("popover-shared",`
528
+ bottom: calc(${Cn("right-end")} + var(--v-offset-top));
529
+ `),...O.map({top:["right-start","left-start"],right:["top-end","bottom-end"],bottom:["right-end","left-end"],left:["top-start","bottom-start"]},(t,e)=>{const n=["right","left"].includes(e),r=n?"width":"height";return t.map(s=>{const o=s.split("-")[1]==="end",l=`calc((${`var(--v-target-${r}, 0px)`} - ${tt}) / 2)`,c=Cn(s);return ae(`[v-placement="${s}"] >`,[ue("popover-shared",[Be("center-arrow",[ue("popover-arrow",`${e}: calc(max(${l}, ${c}) ${o?"+":"-"} var(--v-offset-${n?"left":"top"}));`)])])])})})]);function Cn(t){return["top","bottom"].includes(t.split("-")[0])?"var(--n-arrow-offset)":"var(--n-arrow-offset-vertical)"}function jt(t,e){const n=t.split("-")[0],r=["top","bottom"].includes(n)?"height: var(--n-space-arrow);":"width: var(--n-space-arrow);";return ae(`[v-placement="${t}"] >`,[ue("popover-shared",`
530
530
  margin-${ua[n]}: var(--n-space);
531
- `,[Ce("show-arrow",`
531
+ `,[Be("show-arrow",`
532
532
  margin-${ua[n]}: var(--n-space-arrow);
533
- `),Ce("overlap",`
533
+ `),Be("overlap",`
534
534
  margin: 0;
535
- `),ew("popover-arrow-wrapper",`
535
+ `),gw("popover-arrow-wrapper",`
536
536
  right: 0;
537
537
  left: 0;
538
538
  top: 0;
@@ -540,7 +540,7 @@ ${s}
540
540
  ${n}: 100%;
541
541
  ${ua[n]}: auto;
542
542
  ${r}
543
- `,[ge("popover-arrow",e)])])])}const mu=Object.assign(Object.assign({},gt.props),{to:vn.propTo,show:Boolean,trigger:String,showArrow:Boolean,delay:Number,duration:Number,raw:Boolean,arrowPointToCenter:Boolean,arrowClass:String,arrowStyle:[String,Object],arrowWrapperClass:String,arrowWrapperStyle:[String,Object],displayDirective:String,x:Number,y:Number,flip:Boolean,overlap:Boolean,placement:String,width:[Number,String],keepAliveOnHover:Boolean,scrollable:Boolean,contentClass:String,contentStyle:[Object,String],headerClass:String,headerStyle:[Object,String],footerClass:String,footerStyle:[Object,String],internalDeactivateImmediately:Boolean,animated:Boolean,onClickoutside:Function,internalTrapFocus:Boolean,internalOnAfterLeave:Function,minWidth:Number,maxWidth:Number});function Bx({arrowClass:t,arrowStyle:e,arrowWrapperClass:n,arrowWrapperStyle:r,clsPrefix:s}){return i.h("div",{key:"__popover-arrow__",style:r,class:[`${s}-popover-arrow-wrapper`,n]},i.h("div",{class:[`${s}-popover-arrow`,t],style:e}))}const Tx=i.defineComponent({name:"PopoverBody",inheritAttrs:!1,props:mu,setup(t,{slots:e,attrs:n}){const{namespaceRef:r,mergedClsPrefixRef:s,inlineThemeDisabled:o,mergedRtlRef:a}=fi(t),l=gt("Popover","-popover",Sx,gu,t,s),c=wr("Popover",a,s),d=i.ref(null),h=i.inject("NPopover"),u=i.ref(null),m=i.ref(t.show),f=i.ref(!1);i.watchEffect(()=>{const{show:$}=t;$&&!tw()&&!t.internalDeactivateImmediately&&(f.value=!0)});const g=i.computed(()=>{const{trigger:$,onClickoutside:F}=t,D=[],{positionManuallyRef:{value:L}}=h;return L||($==="click"&&!F&&D.push([us,B,void 0,{capture:!0}]),$==="hover"&&D.push([M_,v])),F&&D.push([us,B,void 0,{capture:!0}]),(t.displayDirective==="show"||t.animated&&f.value)&&D.push([i.vShow,t.show]),D}),p=i.computed(()=>{const{common:{cubicBezierEaseInOut:$,cubicBezierEaseIn:F,cubicBezierEaseOut:D},self:{space:L,spaceArrow:M,padding:z,fontSize:O,textColor:ne,dividerColor:P,color:E,boxShadow:X,borderRadius:j,arrowHeight:H,arrowOffset:N,arrowOffsetVertical:I}}=l.value;return{"--n-box-shadow":X,"--n-bezier":$,"--n-bezier-ease-in":F,"--n-bezier-ease-out":D,"--n-font-size":O,"--n-text-color":ne,"--n-color":E,"--n-divider-color":P,"--n-border-radius":j,"--n-arrow-height":H,"--n-arrow-offset":N,"--n-arrow-offset-vertical":I,"--n-padding":z,"--n-space":L,"--n-space-arrow":M}}),b=i.computed(()=>{const $=t.width==="trigger"?void 0:na(t.width),F=[];$&&F.push({width:$});const{maxWidth:D,minWidth:L}=t;return D&&F.push({maxWidth:na(D)}),L&&F.push({maxWidth:na(L)}),o||F.push(p.value),F}),y=o?gi("popover",void 0,p,t):void 0;h.setBodyInstance({syncPosition:_}),i.onBeforeUnmount(()=>{h.setBodyInstance(null)}),i.watch(i.toRef(t,"show"),$=>{t.animated||($?m.value=!0:m.value=!1)});function _(){var $;($=d.value)===null||$===void 0||$.syncPosition()}function S($){t.trigger==="hover"&&t.keepAliveOnHover&&t.show&&h.handleMouseEnter($)}function C($){t.trigger==="hover"&&t.keepAliveOnHover&&h.handleMouseLeave($)}function v($){t.trigger==="hover"&&!k().contains(cr($))&&h.handleMouseMoveOutside($)}function B($){(t.trigger==="click"&&!k().contains(cr($))||t.onClickoutside)&&h.handleClickOutside($)}function k(){return h.getTriggerElement()}i.provide(Vh,u),i.provide(Ah,null),i.provide(Oh,null);function R(){if(y==null||y.onRender(),!(t.displayDirective==="show"||t.show||t.animated&&f.value))return null;let F;const D=h.internalRenderBodyRef.value,{value:L}=s;if(D)F=D([`${L}-popover-shared`,(c==null?void 0:c.value)&&`${L}-popover--rtl`,y==null?void 0:y.themeClass.value,t.overlap&&`${L}-popover-shared--overlap`,t.showArrow&&`${L}-popover-shared--show-arrow`,t.arrowPointToCenter&&`${L}-popover-shared--center-arrow`],u,b.value,S,C);else{const{value:M}=h.extraClassRef,{internalTrapFocus:z}=t,O=!Kh(e.header)||!Kh(e.footer),ne=()=>{var P,E;const X=O?i.h(i.Fragment,null,hi(e.header,N=>N?i.h("div",{class:[`${L}-popover__header`,t.headerClass],style:t.headerStyle},N):null),hi(e.default,N=>N?i.h("div",{class:[`${L}-popover__content`,t.contentClass],style:t.contentStyle},e):null),hi(e.footer,N=>N?i.h("div",{class:[`${L}-popover__footer`,t.footerClass],style:t.footerStyle},N):null)):t.scrollable?(P=e.default)===null||P===void 0?void 0:P.call(e):i.h("div",{class:[`${L}-popover__content`,t.contentClass],style:t.contentStyle},e),j=t.scrollable?i.h(ux,{themeOverrides:l.value.peerOverrides.Scrollbar,theme:l.value.peers.Scrollbar,contentClass:O?void 0:`${L}-popover__content ${(E=t.contentClass)!==null&&E!==void 0?E:""}`,contentStyle:O?void 0:t.contentStyle},{default:()=>X}):X,H=t.showArrow?Bx({arrowClass:t.arrowClass,arrowStyle:t.arrowStyle,arrowWrapperClass:t.arrowWrapperClass,arrowWrapperStyle:t.arrowWrapperStyle,clsPrefix:L}):null;return[j,H]};F=i.h("div",i.mergeProps({class:[`${L}-popover`,`${L}-popover-shared`,(c==null?void 0:c.value)&&`${L}-popover--rtl`,y==null?void 0:y.themeClass.value,M.map(P=>`${L}-${P}`),{[`${L}-popover--scrollable`]:t.scrollable,[`${L}-popover--show-header-or-footer`]:O,[`${L}-popover--raw`]:t.raw,[`${L}-popover-shared--overlap`]:t.overlap,[`${L}-popover-shared--show-arrow`]:t.showArrow,[`${L}-popover-shared--center-arrow`]:t.arrowPointToCenter}],ref:u,style:b.value,onKeydown:h.handleKeydown,onMouseenter:S,onMouseleave:C},n),z?i.h(Y1,{active:t.show,autoFocus:!0},{default:ne}):ne())}return i.withDirectives(F,g.value)}return{displayed:f,namespace:r,isMounted:h.isMountedRef,zIndex:h.zIndexRef,followerRef:d,adjustedTo:vn(t),followerEnabled:m,renderContentNode:R}},render(){return i.h(dh,{ref:"followerRef",zIndex:this.zIndex,show:this.show,enabled:this.followerEnabled,to:this.adjustedTo,x:this.x,y:this.y,flip:this.flip,placement:this.placement,containerClass:this.namespace,overlap:this.overlap,width:this.width==="trigger"?"target":void 0,teleportDisabled:this.adjustedTo===vn.tdkey},{default:()=>this.animated?i.h(i.Transition,{name:"popover-transition",appear:this.isMounted,onEnter:()=>{this.followerEnabled=!0},onAfterLeave:()=>{var t;(t=this.internalOnAfterLeave)===null||t===void 0||t.call(this),this.followerEnabled=!1,this.displayed=!1}},{default:this.renderContentNode}):this.renderContentNode()})}});var Rx={};const $x=Object.keys(mu),Ex={focus:["onFocus","onBlur"],click:["onClick"],hover:["onMouseenter","onMouseleave"],manual:[],nested:["onFocus","onBlur","onMouseenter","onMouseleave","onClick"]};function Nx(t,e,n){Ex[e].forEach(r=>{t.props?t.props=Object.assign({},t.props):t.props={};const s=t.props[r],o=n[r];s?t.props[r]=(...a)=>{s(...a),o(...a)}:t.props[r]=o})}const Px={show:{type:Boolean,default:void 0},defaultShow:Boolean,showArrow:{type:Boolean,default:!0},trigger:{type:String,default:"hover"},delay:{type:Number,default:100},duration:{type:Number,default:100},raw:Boolean,placement:{type:String,default:"top"},x:Number,y:Number,arrowPointToCenter:Boolean,disabled:Boolean,getDisabled:Function,displayDirective:{type:String,default:"if"},arrowClass:String,arrowStyle:[String,Object],arrowWrapperClass:String,arrowWrapperStyle:[String,Object],flip:{type:Boolean,default:!0},animated:{type:Boolean,default:!0},width:{type:[Number,String],default:void 0},overlap:Boolean,keepAliveOnHover:{type:Boolean,default:!0},zIndex:Number,to:vn.propTo,scrollable:Boolean,contentClass:String,contentStyle:[Object,String],headerClass:String,headerStyle:[Object,String],footerClass:String,footerStyle:[Object,String],onClickoutside:Function,"onUpdate:show":[Function,Array],onUpdateShow:[Function,Array],internalDeactivateImmediately:Boolean,internalSyncTargetWithParent:Boolean,internalInheritedEventHandlers:{type:Array,default:()=>[]},internalTrapFocus:Boolean,internalExtraClass:{type:Array,default:()=>[]},onShow:[Function,Array],onHide:[Function,Array],arrow:{type:Boolean,default:void 0},minWidth:Number,maxWidth:Number},Fx=Object.assign(Object.assign(Object.assign({},gt.props),Px),{internalOnAfterLeave:Function,internalRenderBody:Function}),Mx=i.defineComponent({name:"Popover",inheritAttrs:!1,props:Fx,slots:Object,__popover__:!0,setup(t){Rx.NODE_ENV!=="production"&&i.watchEffect(()=>{t.maxWidth!==void 0&&Wn("popover","`max-width` is deprecated, please use `style` instead."),t.minWidth!==void 0&&Wn("popover","`min-width` is deprecated, please use `style` instead."),t.arrow!==void 0&&Wn("popover","`arrow` is deprecated, please use `showArrow` instead."),t.onHide!==void 0&&Wn("popover","`on-hide` is deprecated, please use `on-update:show` instead."),t.onShow!==void 0&&Wn("popover","`on-show` is deprecated, please use `on-update:show` instead.")});const e=fs(),n=i.ref(null),r=i.computed(()=>t.show),s=i.ref(t.defaultShow),o=Ho(r,s),a=jt(()=>t.disabled?!1:o.value),l=()=>{if(t.disabled)return!0;const{getDisabled:O}=t;return!!(O!=null&&O())},c=()=>l()?!1:o.value,d=jd(t,["arrow","showArrow"]),h=i.computed(()=>t.overlap?!1:d.value);let u=null;const m=i.ref(null),f=i.ref(null),g=jt(()=>t.x!==void 0&&t.y!==void 0);function p(O){const{"onUpdate:show":ne,onUpdateShow:P,onShow:E,onHide:X}=t;s.value=O,ne&&ft(ne,O),P&&ft(P,O),O&&E&&ft(E,!0),O&&X&&ft(X,!1)}function b(){u&&u.syncPosition()}function y(){const{value:O}=m;O&&(window.clearTimeout(O),m.value=null)}function _(){const{value:O}=f;O&&(window.clearTimeout(O),f.value=null)}function S(){const O=l();if(t.trigger==="focus"&&!O){if(c())return;p(!0)}}function C(){const O=l();if(t.trigger==="focus"&&!O){if(!c())return;p(!1)}}function v(){const O=l();if(t.trigger==="hover"&&!O){if(_(),m.value!==null||c())return;const ne=()=>{p(!0),m.value=null},{delay:P}=t;P===0?ne():m.value=window.setTimeout(ne,P)}}function B(){const O=l();if(t.trigger==="hover"&&!O){if(y(),f.value!==null||!c())return;const ne=()=>{p(!1),f.value=null},{duration:P}=t;P===0?ne():f.value=window.setTimeout(ne,P)}}function k(){B()}function R(O){var ne;c()&&(t.trigger==="click"&&(y(),_(),p(!1)),(ne=t.onClickoutside)===null||ne===void 0||ne.call(t,O))}function $(){if(t.trigger==="click"&&!l()){y(),_();const O=!c();p(O)}}function F(O){t.internalTrapFocus&&O.key==="Escape"&&(y(),_(),p(!1))}function D(O){s.value=O}function L(){var O;return(O=n.value)===null||O===void 0?void 0:O.targetRef}function M(O){u=O}return i.provide("NPopover",{getTriggerElement:L,handleKeydown:F,handleMouseEnter:v,handleMouseLeave:B,handleClickOutside:R,handleMouseMoveOutside:k,setBodyInstance:M,positionManuallyRef:g,isMountedRef:e,zIndexRef:i.toRef(t,"zIndex"),extraClassRef:i.toRef(t,"internalExtraClass"),internalRenderBodyRef:i.toRef(t,"internalRenderBody")}),i.watchEffect(()=>{o.value&&l()&&p(!1)}),{binderInstRef:n,positionManually:g,mergedShowConsideringDisabledProp:a,uncontrolledShow:s,mergedShowArrow:h,getMergedShow:c,setShow:D,handleClick:$,handleMouseEnter:v,handleMouseLeave:B,handleFocus:S,handleBlur:C,syncPosition:b}},render(){var t;const{positionManually:e,$slots:n}=this;let r,s=!1;if(!e&&(r=rw(n,"trigger"),r)){r=i.cloneVNode(r),r=r.type===i.Text?i.h("span",[r]):r;const o={onClick:this.handleClick,onMouseenter:this.handleMouseEnter,onMouseleave:this.handleMouseLeave,onFocus:this.handleFocus,onBlur:this.handleBlur};if(!((t=r.type)===null||t===void 0)&&t.__popover__)s=!0,r.props||(r.props={internalSyncTargetWithParent:!0,internalInheritedEventHandlers:[]}),r.props.internalSyncTargetWithParent=!0,r.props.internalInheritedEventHandlers?r.props.internalInheritedEventHandlers=[o,...r.props.internalInheritedEventHandlers]:r.props.internalInheritedEventHandlers=[o];else{const{internalInheritedEventHandlers:a}=this,l=[o,...a],c={onBlur:d=>{l.forEach(h=>{h.onBlur(d)})},onFocus:d=>{l.forEach(h=>{h.onFocus(d)})},onClick:d=>{l.forEach(h=>{h.onClick(d)})},onMouseenter:d=>{l.forEach(h=>{h.onMouseenter(d)})},onMouseleave:d=>{l.forEach(h=>{h.onMouseleave(d)})}};Nx(r,a?"nested":e?"manual":this.trigger,c)}}return i.h(Ud,{ref:"binderInstRef",syncTarget:!s,syncTargetWithParent:this.internalSyncTargetWithParent},{default:()=>{this.mergedShowConsideringDisabledProp;const o=this.getMergedShow();return[this.internalTrapFocus&&o?i.withDirectives(i.h("div",{style:{position:"fixed",top:0,right:0,bottom:0,left:0}}),[[Wd,{enabled:o,zIndex:this.zIndex}]]):null,e?null:i.h(Gd,null,{default:()=>r}),i.h(Tx,sw(this.$props,$x,Object.assign(Object.assign({},this.$attrs),{showArrow:this.mergedShowArrow,show:o})),{default:()=>{var a,l;return(l=(a=this.$slots).default)===null||l===void 0?void 0:l.call(a)},header:()=>{var a,l;return(l=(a=this.$slots).header)===null||l===void 0?void 0:l.call(a)},footer:()=>{var a,l;return(l=(a=this.$slots).footer)===null||l===void 0?void 0:l.call(a)}})]}})}}),Ax={closeIconSizeTiny:"12px",closeIconSizeSmall:"12px",closeIconSizeMedium:"14px",closeIconSizeLarge:"14px",closeSizeTiny:"16px",closeSizeSmall:"16px",closeSizeMedium:"18px",closeSizeLarge:"18px",padding:"0 7px",closeMargin:"0 0 0 4px"};function Ox(t){const{textColor2:e,primaryColorHover:n,primaryColorPressed:r,primaryColor:s,infoColor:o,successColor:a,warningColor:l,errorColor:c,baseColor:d,borderColor:h,opacityDisabled:u,tagColor:m,closeIconColor:f,closeIconColorHover:g,closeIconColorPressed:p,borderRadiusSmall:b,fontSizeMini:y,fontSizeTiny:_,fontSizeSmall:S,fontSizeMedium:C,heightMini:v,heightTiny:B,heightSmall:k,heightMedium:R,closeColorHover:$,closeColorPressed:F,buttonColor2Hover:D,buttonColor2Pressed:L,fontWeightStrong:M}=t;return Object.assign(Object.assign({},Ax),{closeBorderRadius:b,heightTiny:v,heightSmall:B,heightMedium:k,heightLarge:R,borderRadius:b,opacityDisabled:u,fontSizeTiny:y,fontSizeSmall:_,fontSizeMedium:S,fontSizeLarge:C,fontWeightStrong:M,textColorCheckable:e,textColorHoverCheckable:e,textColorPressedCheckable:e,textColorChecked:d,colorCheckable:"#0000",colorHoverCheckable:D,colorPressedCheckable:L,colorChecked:s,colorCheckedHover:n,colorCheckedPressed:r,border:`1px solid ${h}`,textColor:e,color:m,colorBordered:"rgb(250, 250, 252)",closeIconColor:f,closeIconColorHover:g,closeIconColorPressed:p,closeColorHover:$,closeColorPressed:F,borderPrimary:`1px solid ${Pe(s,{alpha:.3})}`,textColorPrimary:s,colorPrimary:Pe(s,{alpha:.12}),colorBorderedPrimary:Pe(s,{alpha:.1}),closeIconColorPrimary:s,closeIconColorHoverPrimary:s,closeIconColorPressedPrimary:s,closeColorHoverPrimary:Pe(s,{alpha:.12}),closeColorPressedPrimary:Pe(s,{alpha:.18}),borderInfo:`1px solid ${Pe(o,{alpha:.3})}`,textColorInfo:o,colorInfo:Pe(o,{alpha:.12}),colorBorderedInfo:Pe(o,{alpha:.1}),closeIconColorInfo:o,closeIconColorHoverInfo:o,closeIconColorPressedInfo:o,closeColorHoverInfo:Pe(o,{alpha:.12}),closeColorPressedInfo:Pe(o,{alpha:.18}),borderSuccess:`1px solid ${Pe(a,{alpha:.3})}`,textColorSuccess:a,colorSuccess:Pe(a,{alpha:.12}),colorBorderedSuccess:Pe(a,{alpha:.1}),closeIconColorSuccess:a,closeIconColorHoverSuccess:a,closeIconColorPressedSuccess:a,closeColorHoverSuccess:Pe(a,{alpha:.12}),closeColorPressedSuccess:Pe(a,{alpha:.18}),borderWarning:`1px solid ${Pe(l,{alpha:.35})}`,textColorWarning:l,colorWarning:Pe(l,{alpha:.15}),colorBorderedWarning:Pe(l,{alpha:.12}),closeIconColorWarning:l,closeIconColorHoverWarning:l,closeIconColorPressedWarning:l,closeColorHoverWarning:Pe(l,{alpha:.12}),closeColorPressedWarning:Pe(l,{alpha:.18}),borderError:`1px solid ${Pe(c,{alpha:.23})}`,textColorError:c,colorError:Pe(c,{alpha:.1}),colorBorderedError:Pe(c,{alpha:.08}),closeIconColorError:c,closeIconColorHoverError:c,closeIconColorPressedError:c,closeColorHoverError:Pe(c,{alpha:.12}),closeColorPressedError:Pe(c,{alpha:.18})})}const Vx={common:mi,self:Ox},Ix={color:Object,type:{type:String,default:"default"},round:Boolean,size:{type:String,default:"medium"},closable:Boolean,disabled:{type:Boolean,default:void 0}},zx=ge("tag",`
543
+ `,[ue("popover-arrow",e)])])])}const mu=Object.assign(Object.assign({},ut.props),{to:kn.propTo,show:Boolean,trigger:String,showArrow:Boolean,delay:Number,duration:Number,raw:Boolean,arrowPointToCenter:Boolean,arrowClass:String,arrowStyle:[String,Object],arrowWrapperClass:String,arrowWrapperStyle:[String,Object],displayDirective:String,x:Number,y:Number,flip:Boolean,overlap:Boolean,placement:String,width:[Number,String],keepAliveOnHover:Boolean,scrollable:Boolean,contentClass:String,contentStyle:[Object,String],headerClass:String,headerStyle:[Object,String],footerClass:String,footerStyle:[Object,String],internalDeactivateImmediately:Boolean,animated:Boolean,onClickoutside:Function,internalTrapFocus:Boolean,internalOnAfterLeave:Function,minWidth:Number,maxWidth:Number});function Lx({arrowClass:t,arrowStyle:e,arrowWrapperClass:n,arrowWrapperStyle:r,clsPrefix:s}){return i.h("div",{key:"__popover-arrow__",style:r,class:[`${s}-popover-arrow-wrapper`,n]},i.h("div",{class:[`${s}-popover-arrow`,t],style:e}))}const Dx=i.defineComponent({name:"PopoverBody",inheritAttrs:!1,props:mu,setup(t,{slots:e,attrs:n}){const{namespaceRef:r,mergedClsPrefixRef:s,inlineThemeDisabled:o,mergedRtlRef:a}=gi(t),l=ut("Popover","-popover",zx,gu,t,s),c=xr("Popover",a,s),d=i.ref(null),h=i.inject("NPopover"),u=i.ref(null),m=i.ref(t.show),g=i.ref(!1);i.watchEffect(()=>{const{show:$}=t;$&&!mw()&&!t.internalDeactivateImmediately&&(g.value=!0)});const f=i.computed(()=>{const{trigger:$,onClickoutside:P}=t,I=[],{positionManuallyRef:{value:V}}=h;return V||($==="click"&&!P&&I.push([us,B,void 0,{capture:!0}]),$==="hover"&&I.push([U_,v])),P&&I.push([us,B,void 0,{capture:!0}]),(t.displayDirective==="show"||t.animated&&g.value)&&I.push([i.vShow,t.show]),I}),p=i.computed(()=>{const{common:{cubicBezierEaseInOut:$,cubicBezierEaseIn:P,cubicBezierEaseOut:I},self:{space:V,spaceArrow:A,padding:L,fontSize:D,textColor:ee,dividerColor:E,color:N,boxShadow:H,borderRadius:q,arrowHeight:Y,arrowOffset:F,arrowOffsetVertical:M}}=l.value;return{"--n-box-shadow":H,"--n-bezier":$,"--n-bezier-ease-in":P,"--n-bezier-ease-out":I,"--n-font-size":D,"--n-text-color":ee,"--n-color":N,"--n-divider-color":E,"--n-border-radius":q,"--n-arrow-height":Y,"--n-arrow-offset":F,"--n-arrow-offset-vertical":M,"--n-padding":L,"--n-space":V,"--n-space-arrow":A}}),y=i.computed(()=>{const $=t.width==="trigger"?void 0:na(t.width),P=[];$&&P.push({width:$});const{maxWidth:I,minWidth:V}=t;return I&&P.push({maxWidth:na(I)}),V&&P.push({maxWidth:na(V)}),o||P.push(p.value),P}),b=o?mi("popover",void 0,p,t):void 0;h.setBodyInstance({syncPosition:_}),i.onBeforeUnmount(()=>{h.setBodyInstance(null)}),i.watch(i.toRef(t,"show"),$=>{t.animated||($?m.value=!0:m.value=!1)});function _(){var $;($=d.value)===null||$===void 0||$.syncPosition()}function C($){t.trigger==="hover"&&t.keepAliveOnHover&&t.show&&h.handleMouseEnter($)}function S($){t.trigger==="hover"&&t.keepAliveOnHover&&h.handleMouseLeave($)}function v($){t.trigger==="hover"&&!k().contains(dr($))&&h.handleMouseMoveOutside($)}function B($){(t.trigger==="click"&&!k().contains(dr($))||t.onClickoutside)&&h.handleClickOutside($)}function k(){return h.getTriggerElement()}i.provide(Oh,u),i.provide(Ah,null),i.provide(Vh,null);function R(){if(b==null||b.onRender(),!(t.displayDirective==="show"||t.show||t.animated&&g.value))return null;let P;const I=h.internalRenderBodyRef.value,{value:V}=s;if(I)P=I([`${V}-popover-shared`,(c==null?void 0:c.value)&&`${V}-popover--rtl`,b==null?void 0:b.themeClass.value,t.overlap&&`${V}-popover-shared--overlap`,t.showArrow&&`${V}-popover-shared--show-arrow`,t.arrowPointToCenter&&`${V}-popover-shared--center-arrow`],u,y.value,C,S);else{const{value:A}=h.extraClassRef,{internalTrapFocus:L}=t,D=!Kh(e.header)||!Kh(e.footer),ee=()=>{var E,N;const H=D?i.h(i.Fragment,null,ui(e.header,F=>F?i.h("div",{class:[`${V}-popover__header`,t.headerClass],style:t.headerStyle},F):null),ui(e.default,F=>F?i.h("div",{class:[`${V}-popover__content`,t.contentClass],style:t.contentStyle},e):null),ui(e.footer,F=>F?i.h("div",{class:[`${V}-popover__footer`,t.footerClass],style:t.footerStyle},F):null)):t.scrollable?(E=e.default)===null||E===void 0?void 0:E.call(e):i.h("div",{class:[`${V}-popover__content`,t.contentClass],style:t.contentStyle},e),q=t.scrollable?i.h(Bx,{themeOverrides:l.value.peerOverrides.Scrollbar,theme:l.value.peers.Scrollbar,contentClass:D?void 0:`${V}-popover__content ${(N=t.contentClass)!==null&&N!==void 0?N:""}`,contentStyle:D?void 0:t.contentStyle},{default:()=>H}):H,Y=t.showArrow?Lx({arrowClass:t.arrowClass,arrowStyle:t.arrowStyle,arrowWrapperClass:t.arrowWrapperClass,arrowWrapperStyle:t.arrowWrapperStyle,clsPrefix:V}):null;return[q,Y]};P=i.h("div",i.mergeProps({class:[`${V}-popover`,`${V}-popover-shared`,(c==null?void 0:c.value)&&`${V}-popover--rtl`,b==null?void 0:b.themeClass.value,A.map(E=>`${V}-${E}`),{[`${V}-popover--scrollable`]:t.scrollable,[`${V}-popover--show-header-or-footer`]:D,[`${V}-popover--raw`]:t.raw,[`${V}-popover-shared--overlap`]:t.overlap,[`${V}-popover-shared--show-arrow`]:t.showArrow,[`${V}-popover-shared--center-arrow`]:t.arrowPointToCenter}],ref:u,style:y.value,onKeydown:h.handleKeydown,onMouseenter:C,onMouseleave:S},n),L?i.h(aw,{active:t.show,autoFocus:!0},{default:ee}):ee())}return i.withDirectives(P,f.value)}return{displayed:g,namespace:r,isMounted:h.isMountedRef,zIndex:h.zIndexRef,followerRef:d,adjustedTo:kn(t),followerEnabled:m,renderContentNode:R}},render(){return i.h(dh,{ref:"followerRef",zIndex:this.zIndex,show:this.show,enabled:this.followerEnabled,to:this.adjustedTo,x:this.x,y:this.y,flip:this.flip,placement:this.placement,containerClass:this.namespace,overlap:this.overlap,width:this.width==="trigger"?"target":void 0,teleportDisabled:this.adjustedTo===kn.tdkey},{default:()=>this.animated?i.h(i.Transition,{name:"popover-transition",appear:this.isMounted,onEnter:()=>{this.followerEnabled=!0},onAfterLeave:()=>{var t;(t=this.internalOnAfterLeave)===null||t===void 0||t.call(this),this.followerEnabled=!1,this.displayed=!1}},{default:this.renderContentNode}):this.renderContentNode()})}});var Hx={};const Wx=Object.keys(mu),jx={focus:["onFocus","onBlur"],click:["onClick"],hover:["onMouseenter","onMouseleave"],manual:[],nested:["onFocus","onBlur","onMouseenter","onMouseleave","onClick"]};function qx(t,e,n){jx[e].forEach(r=>{t.props?t.props=Object.assign({},t.props):t.props={};const s=t.props[r],o=n[r];s?t.props[r]=(...a)=>{s(...a),o(...a)}:t.props[r]=o})}const Xx={show:{type:Boolean,default:void 0},defaultShow:Boolean,showArrow:{type:Boolean,default:!0},trigger:{type:String,default:"hover"},delay:{type:Number,default:100},duration:{type:Number,default:100},raw:Boolean,placement:{type:String,default:"top"},x:Number,y:Number,arrowPointToCenter:Boolean,disabled:Boolean,getDisabled:Function,displayDirective:{type:String,default:"if"},arrowClass:String,arrowStyle:[String,Object],arrowWrapperClass:String,arrowWrapperStyle:[String,Object],flip:{type:Boolean,default:!0},animated:{type:Boolean,default:!0},width:{type:[Number,String],default:void 0},overlap:Boolean,keepAliveOnHover:{type:Boolean,default:!0},zIndex:Number,to:kn.propTo,scrollable:Boolean,contentClass:String,contentStyle:[Object,String],headerClass:String,headerStyle:[Object,String],footerClass:String,footerStyle:[Object,String],onClickoutside:Function,"onUpdate:show":[Function,Array],onUpdateShow:[Function,Array],internalDeactivateImmediately:Boolean,internalSyncTargetWithParent:Boolean,internalInheritedEventHandlers:{type:Array,default:()=>[]},internalTrapFocus:Boolean,internalExtraClass:{type:Array,default:()=>[]},onShow:[Function,Array],onHide:[Function,Array],arrow:{type:Boolean,default:void 0},minWidth:Number,maxWidth:Number},Yx=Object.assign(Object.assign(Object.assign({},ut.props),Xx),{internalOnAfterLeave:Function,internalRenderBody:Function}),Ux=i.defineComponent({name:"Popover",inheritAttrs:!1,props:Yx,slots:Object,__popover__:!0,setup(t){Hx.NODE_ENV!=="production"&&i.watchEffect(()=>{t.maxWidth!==void 0&&jn("popover","`max-width` is deprecated, please use `style` instead."),t.minWidth!==void 0&&jn("popover","`min-width` is deprecated, please use `style` instead."),t.arrow!==void 0&&jn("popover","`arrow` is deprecated, please use `showArrow` instead."),t.onHide!==void 0&&jn("popover","`on-hide` is deprecated, please use `on-update:show` instead."),t.onShow!==void 0&&jn("popover","`on-show` is deprecated, please use `on-update:show` instead.")});const e=fs(),n=i.ref(null),r=i.computed(()=>t.show),s=i.ref(t.defaultShow),o=Ho(r,s),a=Wt(()=>t.disabled?!1:o.value),l=()=>{if(t.disabled)return!0;const{getDisabled:D}=t;return!!(D!=null&&D())},c=()=>l()?!1:o.value,d=jd(t,["arrow","showArrow"]),h=i.computed(()=>t.overlap?!1:d.value);let u=null;const m=i.ref(null),g=i.ref(null),f=Wt(()=>t.x!==void 0&&t.y!==void 0);function p(D){const{"onUpdate:show":ee,onUpdateShow:E,onShow:N,onHide:H}=t;s.value=D,ee&&ht(ee,D),E&&ht(E,D),D&&N&&ht(N,!0),D&&H&&ht(H,!1)}function y(){u&&u.syncPosition()}function b(){const{value:D}=m;D&&(window.clearTimeout(D),m.value=null)}function _(){const{value:D}=g;D&&(window.clearTimeout(D),g.value=null)}function C(){const D=l();if(t.trigger==="focus"&&!D){if(c())return;p(!0)}}function S(){const D=l();if(t.trigger==="focus"&&!D){if(!c())return;p(!1)}}function v(){const D=l();if(t.trigger==="hover"&&!D){if(_(),m.value!==null||c())return;const ee=()=>{p(!0),m.value=null},{delay:E}=t;E===0?ee():m.value=window.setTimeout(ee,E)}}function B(){const D=l();if(t.trigger==="hover"&&!D){if(b(),g.value!==null||!c())return;const ee=()=>{p(!1),g.value=null},{duration:E}=t;E===0?ee():g.value=window.setTimeout(ee,E)}}function k(){B()}function R(D){var ee;c()&&(t.trigger==="click"&&(b(),_(),p(!1)),(ee=t.onClickoutside)===null||ee===void 0||ee.call(t,D))}function $(){if(t.trigger==="click"&&!l()){b(),_();const D=!c();p(D)}}function P(D){t.internalTrapFocus&&D.key==="Escape"&&(b(),_(),p(!1))}function I(D){s.value=D}function V(){var D;return(D=n.value)===null||D===void 0?void 0:D.targetRef}function A(D){u=D}return i.provide("NPopover",{getTriggerElement:V,handleKeydown:P,handleMouseEnter:v,handleMouseLeave:B,handleClickOutside:R,handleMouseMoveOutside:k,setBodyInstance:A,positionManuallyRef:f,isMountedRef:e,zIndexRef:i.toRef(t,"zIndex"),extraClassRef:i.toRef(t,"internalExtraClass"),internalRenderBodyRef:i.toRef(t,"internalRenderBody")}),i.watchEffect(()=>{o.value&&l()&&p(!1)}),{binderInstRef:n,positionManually:f,mergedShowConsideringDisabledProp:a,uncontrolledShow:s,mergedShowArrow:h,getMergedShow:c,setShow:I,handleClick:$,handleMouseEnter:v,handleMouseLeave:B,handleFocus:C,handleBlur:S,syncPosition:y}},render(){var t;const{positionManually:e,$slots:n}=this;let r,s=!1;if(!e&&(r=bw(n,"trigger"),r)){r=i.cloneVNode(r),r=r.type===i.Text?i.h("span",[r]):r;const o={onClick:this.handleClick,onMouseenter:this.handleMouseEnter,onMouseleave:this.handleMouseLeave,onFocus:this.handleFocus,onBlur:this.handleBlur};if(!((t=r.type)===null||t===void 0)&&t.__popover__)s=!0,r.props||(r.props={internalSyncTargetWithParent:!0,internalInheritedEventHandlers:[]}),r.props.internalSyncTargetWithParent=!0,r.props.internalInheritedEventHandlers?r.props.internalInheritedEventHandlers=[o,...r.props.internalInheritedEventHandlers]:r.props.internalInheritedEventHandlers=[o];else{const{internalInheritedEventHandlers:a}=this,l=[o,...a],c={onBlur:d=>{l.forEach(h=>{h.onBlur(d)})},onFocus:d=>{l.forEach(h=>{h.onFocus(d)})},onClick:d=>{l.forEach(h=>{h.onClick(d)})},onMouseenter:d=>{l.forEach(h=>{h.onMouseenter(d)})},onMouseleave:d=>{l.forEach(h=>{h.onMouseleave(d)})}};qx(r,a?"nested":e?"manual":this.trigger,c)}}return i.h(Ud,{ref:"binderInstRef",syncTarget:!s,syncTargetWithParent:this.internalSyncTargetWithParent},{default:()=>{this.mergedShowConsideringDisabledProp;const o=this.getMergedShow();return[this.internalTrapFocus&&o?i.withDirectives(i.h("div",{style:{position:"fixed",top:0,right:0,bottom:0,left:0}}),[[Wd,{enabled:o,zIndex:this.zIndex}]]):null,e?null:i.h(Gd,null,{default:()=>r}),i.h(Dx,_w(this.$props,Wx,Object.assign(Object.assign({},this.$attrs),{showArrow:this.mergedShowArrow,show:o})),{default:()=>{var a,l;return(l=(a=this.$slots).default)===null||l===void 0?void 0:l.call(a)},header:()=>{var a,l;return(l=(a=this.$slots).header)===null||l===void 0?void 0:l.call(a)},footer:()=>{var a,l;return(l=(a=this.$slots).footer)===null||l===void 0?void 0:l.call(a)}})]}})}}),Gx={closeIconSizeTiny:"12px",closeIconSizeSmall:"12px",closeIconSizeMedium:"14px",closeIconSizeLarge:"14px",closeSizeTiny:"16px",closeSizeSmall:"16px",closeSizeMedium:"18px",closeSizeLarge:"18px",padding:"0 7px",closeMargin:"0 0 0 4px"};function Kx(t){const{textColor2:e,primaryColorHover:n,primaryColorPressed:r,primaryColor:s,infoColor:o,successColor:a,warningColor:l,errorColor:c,baseColor:d,borderColor:h,opacityDisabled:u,tagColor:m,closeIconColor:g,closeIconColorHover:f,closeIconColorPressed:p,borderRadiusSmall:y,fontSizeMini:b,fontSizeTiny:_,fontSizeSmall:C,fontSizeMedium:S,heightMini:v,heightTiny:B,heightSmall:k,heightMedium:R,closeColorHover:$,closeColorPressed:P,buttonColor2Hover:I,buttonColor2Pressed:V,fontWeightStrong:A}=t;return Object.assign(Object.assign({},Gx),{closeBorderRadius:y,heightTiny:v,heightSmall:B,heightMedium:k,heightLarge:R,borderRadius:y,opacityDisabled:u,fontSizeTiny:b,fontSizeSmall:_,fontSizeMedium:C,fontSizeLarge:S,fontWeightStrong:A,textColorCheckable:e,textColorHoverCheckable:e,textColorPressedCheckable:e,textColorChecked:d,colorCheckable:"#0000",colorHoverCheckable:I,colorPressedCheckable:V,colorChecked:s,colorCheckedHover:n,colorCheckedPressed:r,border:`1px solid ${h}`,textColor:e,color:m,colorBordered:"rgb(250, 250, 252)",closeIconColor:g,closeIconColorHover:f,closeIconColorPressed:p,closeColorHover:$,closeColorPressed:P,borderPrimary:`1px solid ${Fe(s,{alpha:.3})}`,textColorPrimary:s,colorPrimary:Fe(s,{alpha:.12}),colorBorderedPrimary:Fe(s,{alpha:.1}),closeIconColorPrimary:s,closeIconColorHoverPrimary:s,closeIconColorPressedPrimary:s,closeColorHoverPrimary:Fe(s,{alpha:.12}),closeColorPressedPrimary:Fe(s,{alpha:.18}),borderInfo:`1px solid ${Fe(o,{alpha:.3})}`,textColorInfo:o,colorInfo:Fe(o,{alpha:.12}),colorBorderedInfo:Fe(o,{alpha:.1}),closeIconColorInfo:o,closeIconColorHoverInfo:o,closeIconColorPressedInfo:o,closeColorHoverInfo:Fe(o,{alpha:.12}),closeColorPressedInfo:Fe(o,{alpha:.18}),borderSuccess:`1px solid ${Fe(a,{alpha:.3})}`,textColorSuccess:a,colorSuccess:Fe(a,{alpha:.12}),colorBorderedSuccess:Fe(a,{alpha:.1}),closeIconColorSuccess:a,closeIconColorHoverSuccess:a,closeIconColorPressedSuccess:a,closeColorHoverSuccess:Fe(a,{alpha:.12}),closeColorPressedSuccess:Fe(a,{alpha:.18}),borderWarning:`1px solid ${Fe(l,{alpha:.35})}`,textColorWarning:l,colorWarning:Fe(l,{alpha:.15}),colorBorderedWarning:Fe(l,{alpha:.12}),closeIconColorWarning:l,closeIconColorHoverWarning:l,closeIconColorPressedWarning:l,closeColorHoverWarning:Fe(l,{alpha:.12}),closeColorPressedWarning:Fe(l,{alpha:.18}),borderError:`1px solid ${Fe(c,{alpha:.23})}`,textColorError:c,colorError:Fe(c,{alpha:.1}),colorBorderedError:Fe(c,{alpha:.08}),closeIconColorError:c,closeIconColorHoverError:c,closeIconColorPressedError:c,closeColorHoverError:Fe(c,{alpha:.12}),closeColorPressedError:Fe(c,{alpha:.18})})}const Zx={common:pi,self:Kx},Qx={color:Object,type:{type:String,default:"default"},round:Boolean,size:{type:String,default:"medium"},closable:Boolean,disabled:{type:Boolean,default:void 0}},Jx=ue("tag",`
544
544
  --n-close-margin: var(--n-close-margin-top) var(--n-close-margin-right) var(--n-close-margin-bottom) var(--n-close-margin-left);
545
545
  white-space: nowrap;
546
546
  position: relative;
@@ -562,7 +562,7 @@ ${s}
562
562
  line-height: 1;
563
563
  height: var(--n-height);
564
564
  font-size: var(--n-font-size);
565
- `,[Ce("strong",`
565
+ `,[Be("strong",`
566
566
  font-weight: var(--n-font-weight-strong);
567
567
  `),ye("border",`
568
568
  pointer-events: none;
@@ -588,29 +588,29 @@ ${s}
588
588
  transition:
589
589
  background-color .3s var(--n-bezier),
590
590
  color .3s var(--n-bezier);
591
- `),Ce("round",`
591
+ `),Be("round",`
592
592
  padding: 0 calc(var(--n-height) / 3);
593
593
  border-radius: calc(var(--n-height) / 2);
594
594
  `,[ye("icon",`
595
595
  margin: 0 4px 0 calc((var(--n-height) - 8px) / -2);
596
596
  `),ye("avatar",`
597
597
  margin: 0 6px 0 calc((var(--n-height) - 8px) / -2);
598
- `),Ce("closable",`
598
+ `),Be("closable",`
599
599
  padding: 0 calc(var(--n-height) / 4) 0 calc(var(--n-height) / 3);
600
- `)]),Ce("icon, avatar",[Ce("round",`
600
+ `)]),Be("icon, avatar",[Be("round",`
601
601
  padding: 0 calc(var(--n-height) / 3) 0 calc(var(--n-height) / 2);
602
- `)]),Ce("disabled",`
602
+ `)]),Be("disabled",`
603
603
  cursor: not-allowed !important;
604
604
  opacity: var(--n-opacity-disabled);
605
- `),Ce("checkable",`
605
+ `),Be("checkable",`
606
606
  cursor: pointer;
607
607
  box-shadow: none;
608
608
  color: var(--n-text-color-checkable);
609
609
  background-color: var(--n-color-checkable);
610
- `,[Gt("disabled",[ae("&:hover","background-color: var(--n-color-hover-checkable);",[Gt("checked","color: var(--n-text-color-hover-checkable);")]),ae("&:active","background-color: var(--n-color-pressed-checkable);",[Gt("checked","color: var(--n-text-color-pressed-checkable);")])]),Ce("checked",`
610
+ `,[Ut("disabled",[ae("&:hover","background-color: var(--n-color-hover-checkable);",[Ut("checked","color: var(--n-text-color-hover-checkable);")]),ae("&:active","background-color: var(--n-color-pressed-checkable);",[Ut("checked","color: var(--n-text-color-pressed-checkable);")])]),Be("checked",`
611
611
  color: var(--n-text-color-checked);
612
612
  background-color: var(--n-color-checked);
613
- `,[Gt("disabled",[ae("&:hover","background-color: var(--n-color-checked-hover);"),ae("&:active","background-color: var(--n-color-checked-pressed);")])])])]);var Lx={};const Dx=Object.assign(Object.assign(Object.assign({},gt.props),Ix),{bordered:{type:Boolean,default:void 0},checked:Boolean,checkable:Boolean,strong:Boolean,triggerClickOnClose:Boolean,onClose:[Array,Function],onMouseenter:Function,onMouseleave:Function,"onUpdate:checked":Function,onUpdateChecked:Function,internalCloseFocusable:{type:Boolean,default:!0},internalCloseIsButtonTag:{type:Boolean,default:!0},onCheckedChange:Function}),Hx="n-tag",fa=i.defineComponent({name:"Tag",props:Dx,slots:Object,setup(t){Lx.NODE_ENV!=="production"&&i.watchEffect(()=>{t.onCheckedChange!==void 0&&Wn("tag","`on-checked-change` is deprecated, please use `on-update:checked` instead")});const e=i.ref(null),{mergedBorderedRef:n,mergedClsPrefixRef:r,inlineThemeDisabled:s,mergedRtlRef:o}=fi(t),a=gt("Tag","-tag",zx,Vx,t,r);i.provide(Hx,{roundRef:i.toRef(t,"round")});function l(){if(!t.disabled&&t.checkable){const{checked:f,onCheckedChange:g,onUpdateChecked:p,"onUpdate:checked":b}=t;p&&p(!f),b&&b(!f),g&&g(!f)}}function c(f){if(t.triggerClickOnClose||f.stopPropagation(),!t.disabled){const{onClose:g}=t;g&&ft(g,f)}}const d={setTextContent(f){const{value:g}=e;g&&(g.textContent=f)}},h=wr("Tag",o,r),u=i.computed(()=>{const{type:f,size:g,color:{color:p,textColor:b}={}}=t,{common:{cubicBezierEaseInOut:y},self:{padding:_,closeMargin:S,borderRadius:C,opacityDisabled:v,textColorCheckable:B,textColorHoverCheckable:k,textColorPressedCheckable:R,textColorChecked:$,colorCheckable:F,colorHoverCheckable:D,colorPressedCheckable:L,colorChecked:M,colorCheckedHover:z,colorCheckedPressed:O,closeBorderRadius:ne,fontWeightStrong:P,[Ue("colorBordered",f)]:E,[Ue("closeSize",g)]:X,[Ue("closeIconSize",g)]:j,[Ue("fontSize",g)]:H,[Ue("height",g)]:N,[Ue("color",f)]:I,[Ue("textColor",f)]:J,[Ue("border",f)]:ce,[Ue("closeIconColor",f)]:re,[Ue("closeIconColorHover",f)]:de,[Ue("closeIconColorPressed",f)]:se,[Ue("closeColorHover",f)]:Ae,[Ue("closeColorPressed",f)]:Fe}}=a.value,Ke=Ut(S);return{"--n-font-weight-strong":P,"--n-avatar-size-override":`calc(${N} - 8px)`,"--n-bezier":y,"--n-border-radius":C,"--n-border":ce,"--n-close-icon-size":j,"--n-close-color-pressed":Fe,"--n-close-color-hover":Ae,"--n-close-border-radius":ne,"--n-close-icon-color":re,"--n-close-icon-color-hover":de,"--n-close-icon-color-pressed":se,"--n-close-icon-color-disabled":re,"--n-close-margin-top":Ke.top,"--n-close-margin-right":Ke.right,"--n-close-margin-bottom":Ke.bottom,"--n-close-margin-left":Ke.left,"--n-close-size":X,"--n-color":p||(n.value?E:I),"--n-color-checkable":F,"--n-color-checked":M,"--n-color-checked-hover":z,"--n-color-checked-pressed":O,"--n-color-hover-checkable":D,"--n-color-pressed-checkable":L,"--n-font-size":H,"--n-height":N,"--n-opacity-disabled":v,"--n-padding":_,"--n-text-color":b||J,"--n-text-color-checkable":B,"--n-text-color-checked":$,"--n-text-color-hover-checkable":k,"--n-text-color-pressed-checkable":R}}),m=s?gi("tag",i.computed(()=>{let f="";const{type:g,size:p,color:{color:b,textColor:y}={}}=t;return f+=g[0],f+=p[0],b&&(f+=`a${Lh(b)}`),y&&(f+=`b${Lh(y)}`),n.value&&(f+="c"),f}),u,t):void 0;return Object.assign(Object.assign({},d),{rtlEnabled:h,mergedClsPrefix:r,contentRef:e,mergedBordered:n,handleClick:l,handleCloseClick:c,cssVars:s?void 0:u,themeClass:m==null?void 0:m.themeClass,onRender:m==null?void 0:m.onRender})},render(){var t,e;const{mergedClsPrefix:n,rtlEnabled:r,closable:s,color:{borderColor:o}={},round:a,onRender:l,$slots:c}=this;l==null||l();const d=hi(c.avatar,u=>u&&i.h("div",{class:`${n}-tag__avatar`},u)),h=hi(c.icon,u=>u&&i.h("div",{class:`${n}-tag__icon`},u));return i.h("div",{class:[`${n}-tag`,this.themeClass,{[`${n}-tag--rtl`]:r,[`${n}-tag--strong`]:this.strong,[`${n}-tag--disabled`]:this.disabled,[`${n}-tag--checkable`]:this.checkable,[`${n}-tag--checked`]:this.checkable&&this.checked,[`${n}-tag--round`]:a,[`${n}-tag--avatar`]:d,[`${n}-tag--icon`]:h,[`${n}-tag--closable`]:s}],style:this.cssVars,onClick:this.handleClick,onMouseenter:this.onMouseenter,onMouseleave:this.onMouseleave},h||d,i.h("span",{class:`${n}-tag__content`,ref:"contentRef"},(e=(t=this.$slots).default)===null||e===void 0?void 0:e.call(t)),!this.checkable&&s?i.h(tx,{clsPrefix:n,class:`${n}-tag__close`,disabled:this.disabled,onClick:this.handleCloseClick,focusable:this.internalCloseFocusable,round:a,isButtonTag:this.internalCloseIsButtonTag,absolute:!0}):null,!this.checkable&&this.mergedBordered?i.h("div",{class:`${n}-tag__border`,style:{borderColor:o}}):null)}}),Wx=i.defineComponent({name:"InternalSelectionSuffix",props:{clsPrefix:{type:String,required:!0},showArrow:{type:Boolean,default:void 0},showClear:{type:Boolean,default:void 0},loading:{type:Boolean,default:!1},onClear:Function},setup(t,{slots:e}){return()=>{const{clsPrefix:n}=t;return i.h(nu,{clsPrefix:n,class:`${n}-base-suffix`,strokeWidth:24,scale:.85,show:t.loading},{default:()=>t.showArrow?i.h(Qw,{clsPrefix:n,show:t.showClear,onClear:t.onClear},{placeholder:()=>i.h(vr,{clsPrefix:n,class:`${n}-base-suffix__arrow`},{default:()=>oa(e.default,()=>[i.h(Yw,null)])})}):null})}}}),jx={paddingSingle:"0 26px 0 12px",paddingMultiple:"3px 26px 0 12px",clearSize:"16px",arrowSize:"16px"};function qx(t){const{borderRadius:e,textColor2:n,textColorDisabled:r,inputColor:s,inputColorDisabled:o,primaryColor:a,primaryColorHover:l,warningColor:c,warningColorHover:d,errorColor:h,errorColorHover:u,borderColor:m,iconColor:f,iconColorDisabled:g,clearColor:p,clearColorHover:b,clearColorPressed:y,placeholderColor:_,placeholderColorDisabled:S,fontSizeTiny:C,fontSizeSmall:v,fontSizeMedium:B,fontSizeLarge:k,heightTiny:R,heightSmall:$,heightMedium:F,heightLarge:D,fontWeight:L}=t;return Object.assign(Object.assign({},jx),{fontSizeTiny:C,fontSizeSmall:v,fontSizeMedium:B,fontSizeLarge:k,heightTiny:R,heightSmall:$,heightMedium:F,heightLarge:D,borderRadius:e,fontWeight:L,textColor:n,textColorDisabled:r,placeholderColor:_,placeholderColorDisabled:S,color:s,colorDisabled:o,colorActive:s,border:`1px solid ${m}`,borderHover:`1px solid ${l}`,borderActive:`1px solid ${a}`,borderFocus:`1px solid ${l}`,boxShadowHover:"none",boxShadowActive:`0 0 0 2px ${Pe(a,{alpha:.2})}`,boxShadowFocus:`0 0 0 2px ${Pe(a,{alpha:.2})}`,caretColor:a,arrowColor:f,arrowColorDisabled:g,loadingColor:a,borderWarning:`1px solid ${c}`,borderHoverWarning:`1px solid ${d}`,borderActiveWarning:`1px solid ${c}`,borderFocusWarning:`1px solid ${d}`,boxShadowHoverWarning:"none",boxShadowActiveWarning:`0 0 0 2px ${Pe(c,{alpha:.2})}`,boxShadowFocusWarning:`0 0 0 2px ${Pe(c,{alpha:.2})}`,colorActiveWarning:s,caretColorWarning:c,borderError:`1px solid ${h}`,borderHoverError:`1px solid ${u}`,borderActiveError:`1px solid ${h}`,borderFocusError:`1px solid ${u}`,boxShadowHoverError:"none",boxShadowActiveError:`0 0 0 2px ${Pe(h,{alpha:.2})}`,boxShadowFocusError:`0 0 0 2px ${Pe(h,{alpha:.2})}`,colorActiveError:s,caretColorError:h,clearColor:p,clearColorHover:b,clearColorPressed:y})}const pu={name:"InternalSelection",common:mi,peers:{Popover:gu},self:qx},Xx=ae([ge("base-selection",`
613
+ `,[Ut("disabled",[ae("&:hover","background-color: var(--n-color-checked-hover);"),ae("&:active","background-color: var(--n-color-checked-pressed);")])])])]);var ev={};const tv=Object.assign(Object.assign(Object.assign({},ut.props),Qx),{bordered:{type:Boolean,default:void 0},checked:Boolean,checkable:Boolean,strong:Boolean,triggerClickOnClose:Boolean,onClose:[Array,Function],onMouseenter:Function,onMouseleave:Function,"onUpdate:checked":Function,onUpdateChecked:Function,internalCloseFocusable:{type:Boolean,default:!0},internalCloseIsButtonTag:{type:Boolean,default:!0},onCheckedChange:Function}),nv="n-tag",fa=i.defineComponent({name:"Tag",props:tv,slots:Object,setup(t){ev.NODE_ENV!=="production"&&i.watchEffect(()=>{t.onCheckedChange!==void 0&&jn("tag","`on-checked-change` is deprecated, please use `on-update:checked` instead")});const e=i.ref(null),{mergedBorderedRef:n,mergedClsPrefixRef:r,inlineThemeDisabled:s,mergedRtlRef:o}=gi(t),a=ut("Tag","-tag",Jx,Zx,t,r);i.provide(nv,{roundRef:i.toRef(t,"round")});function l(){if(!t.disabled&&t.checkable){const{checked:g,onCheckedChange:f,onUpdateChecked:p,"onUpdate:checked":y}=t;p&&p(!g),y&&y(!g),f&&f(!g)}}function c(g){if(t.triggerClickOnClose||g.stopPropagation(),!t.disabled){const{onClose:f}=t;f&&ht(f,g)}}const d={setTextContent(g){const{value:f}=e;f&&(f.textContent=g)}},h=xr("Tag",o,r),u=i.computed(()=>{const{type:g,size:f,color:{color:p,textColor:y}={}}=t,{common:{cubicBezierEaseInOut:b},self:{padding:_,closeMargin:C,borderRadius:S,opacityDisabled:v,textColorCheckable:B,textColorHoverCheckable:k,textColorPressedCheckable:R,textColorChecked:$,colorCheckable:P,colorHoverCheckable:I,colorPressedCheckable:V,colorChecked:A,colorCheckedHover:L,colorCheckedPressed:D,closeBorderRadius:ee,fontWeightStrong:E,[Ge("colorBordered",g)]:N,[Ge("closeSize",f)]:H,[Ge("closeIconSize",f)]:q,[Ge("fontSize",f)]:Y,[Ge("height",f)]:F,[Ge("color",g)]:M,[Ge("textColor",g)]:Z,[Ge("border",g)]:fe,[Ge("closeIconColor",g)]:ie,[Ge("closeIconColorHover",g)]:me,[Ge("closeIconColorPressed",g)]:re,[Ge("closeColorHover",g)]:Me,[Ge("closeColorPressed",g)]:Ae}}=a.value,Oe=Yt(C);return{"--n-font-weight-strong":E,"--n-avatar-size-override":`calc(${F} - 8px)`,"--n-bezier":b,"--n-border-radius":S,"--n-border":fe,"--n-close-icon-size":q,"--n-close-color-pressed":Ae,"--n-close-color-hover":Me,"--n-close-border-radius":ee,"--n-close-icon-color":ie,"--n-close-icon-color-hover":me,"--n-close-icon-color-pressed":re,"--n-close-icon-color-disabled":ie,"--n-close-margin-top":Oe.top,"--n-close-margin-right":Oe.right,"--n-close-margin-bottom":Oe.bottom,"--n-close-margin-left":Oe.left,"--n-close-size":H,"--n-color":p||(n.value?N:M),"--n-color-checkable":P,"--n-color-checked":A,"--n-color-checked-hover":L,"--n-color-checked-pressed":D,"--n-color-hover-checkable":I,"--n-color-pressed-checkable":V,"--n-font-size":Y,"--n-height":F,"--n-opacity-disabled":v,"--n-padding":_,"--n-text-color":y||Z,"--n-text-color-checkable":B,"--n-text-color-checked":$,"--n-text-color-hover-checkable":k,"--n-text-color-pressed-checkable":R}}),m=s?mi("tag",i.computed(()=>{let g="";const{type:f,size:p,color:{color:y,textColor:b}={}}=t;return g+=f[0],g+=p[0],y&&(g+=`a${Lh(y)}`),b&&(g+=`b${Lh(b)}`),n.value&&(g+="c"),g}),u,t):void 0;return Object.assign(Object.assign({},d),{rtlEnabled:h,mergedClsPrefix:r,contentRef:e,mergedBordered:n,handleClick:l,handleCloseClick:c,cssVars:s?void 0:u,themeClass:m==null?void 0:m.themeClass,onRender:m==null?void 0:m.onRender})},render(){var t,e;const{mergedClsPrefix:n,rtlEnabled:r,closable:s,color:{borderColor:o}={},round:a,onRender:l,$slots:c}=this;l==null||l();const d=ui(c.avatar,u=>u&&i.h("div",{class:`${n}-tag__avatar`},u)),h=ui(c.icon,u=>u&&i.h("div",{class:`${n}-tag__icon`},u));return i.h("div",{class:[`${n}-tag`,this.themeClass,{[`${n}-tag--rtl`]:r,[`${n}-tag--strong`]:this.strong,[`${n}-tag--disabled`]:this.disabled,[`${n}-tag--checkable`]:this.checkable,[`${n}-tag--checked`]:this.checkable&&this.checked,[`${n}-tag--round`]:a,[`${n}-tag--avatar`]:d,[`${n}-tag--icon`]:h,[`${n}-tag--closable`]:s}],style:this.cssVars,onClick:this.handleClick,onMouseenter:this.onMouseenter,onMouseleave:this.onMouseleave},h||d,i.h("span",{class:`${n}-tag__content`,ref:"contentRef"},(e=(t=this.$slots).default)===null||e===void 0?void 0:e.call(t)),!this.checkable&&s?i.h(mx,{clsPrefix:n,class:`${n}-tag__close`,disabled:this.disabled,onClick:this.handleCloseClick,focusable:this.internalCloseFocusable,round:a,isButtonTag:this.internalCloseIsButtonTag,absolute:!0}):null,!this.checkable&&this.mergedBordered?i.h("div",{class:`${n}-tag__border`,style:{borderColor:o}}):null)}}),iv=i.defineComponent({name:"InternalSelectionSuffix",props:{clsPrefix:{type:String,required:!0},showArrow:{type:Boolean,default:void 0},showClear:{type:Boolean,default:void 0},loading:{type:Boolean,default:!1},onClear:Function},setup(t,{slots:e}){return()=>{const{clsPrefix:n}=t;return i.h(nu,{clsPrefix:n,class:`${n}-base-suffix`,strokeWidth:24,scale:.85,show:t.loading},{default:()=>t.showArrow?i.h(fx,{clsPrefix:n,show:t.showClear,onClear:t.onClear},{placeholder:()=>i.h(kr,{clsPrefix:n,class:`${n}-base-suffix__arrow`},{default:()=>oa(e.default,()=>[i.h(ax,null)])})}):null})}}}),rv={paddingSingle:"0 26px 0 12px",paddingMultiple:"3px 26px 0 12px",clearSize:"16px",arrowSize:"16px"};function sv(t){const{borderRadius:e,textColor2:n,textColorDisabled:r,inputColor:s,inputColorDisabled:o,primaryColor:a,primaryColorHover:l,warningColor:c,warningColorHover:d,errorColor:h,errorColorHover:u,borderColor:m,iconColor:g,iconColorDisabled:f,clearColor:p,clearColorHover:y,clearColorPressed:b,placeholderColor:_,placeholderColorDisabled:C,fontSizeTiny:S,fontSizeSmall:v,fontSizeMedium:B,fontSizeLarge:k,heightTiny:R,heightSmall:$,heightMedium:P,heightLarge:I,fontWeight:V}=t;return Object.assign(Object.assign({},rv),{fontSizeTiny:S,fontSizeSmall:v,fontSizeMedium:B,fontSizeLarge:k,heightTiny:R,heightSmall:$,heightMedium:P,heightLarge:I,borderRadius:e,fontWeight:V,textColor:n,textColorDisabled:r,placeholderColor:_,placeholderColorDisabled:C,color:s,colorDisabled:o,colorActive:s,border:`1px solid ${m}`,borderHover:`1px solid ${l}`,borderActive:`1px solid ${a}`,borderFocus:`1px solid ${l}`,boxShadowHover:"none",boxShadowActive:`0 0 0 2px ${Fe(a,{alpha:.2})}`,boxShadowFocus:`0 0 0 2px ${Fe(a,{alpha:.2})}`,caretColor:a,arrowColor:g,arrowColorDisabled:f,loadingColor:a,borderWarning:`1px solid ${c}`,borderHoverWarning:`1px solid ${d}`,borderActiveWarning:`1px solid ${c}`,borderFocusWarning:`1px solid ${d}`,boxShadowHoverWarning:"none",boxShadowActiveWarning:`0 0 0 2px ${Fe(c,{alpha:.2})}`,boxShadowFocusWarning:`0 0 0 2px ${Fe(c,{alpha:.2})}`,colorActiveWarning:s,caretColorWarning:c,borderError:`1px solid ${h}`,borderHoverError:`1px solid ${u}`,borderActiveError:`1px solid ${h}`,borderFocusError:`1px solid ${u}`,boxShadowHoverError:"none",boxShadowActiveError:`0 0 0 2px ${Fe(h,{alpha:.2})}`,boxShadowFocusError:`0 0 0 2px ${Fe(h,{alpha:.2})}`,colorActiveError:s,caretColorError:h,clearColor:p,clearColorHover:y,clearColorPressed:b})}const pu={name:"InternalSelection",common:pi,peers:{Popover:gu},self:sv},ov=ae([ue("base-selection",`
614
614
  --n-padding-single: var(--n-padding-single-top) var(--n-padding-single-right) var(--n-padding-single-bottom) var(--n-padding-single-left);
615
615
  --n-padding-multiple: var(--n-padding-multiple-top) var(--n-padding-multiple-right) var(--n-padding-multiple-bottom) var(--n-padding-multiple-left);
616
616
  position: relative;
@@ -624,9 +624,9 @@ ${s}
624
624
  min-height: var(--n-height);
625
625
  line-height: 1.5;
626
626
  font-size: var(--n-font-size);
627
- `,[ge("base-loading",`
627
+ `,[ue("base-loading",`
628
628
  color: var(--n-loading-color);
629
- `),ge("base-selection-tags","min-height: var(--n-height);"),ye("border, state-border",`
629
+ `),ue("base-selection-tags","min-height: var(--n-height);"),ye("border, state-border",`
630
630
  position: absolute;
631
631
  left: 0;
632
632
  right: 0;
@@ -641,7 +641,7 @@ ${s}
641
641
  `),ye("state-border",`
642
642
  z-index: 1;
643
643
  border-color: #0000;
644
- `),ge("base-suffix",`
644
+ `),ue("base-suffix",`
645
645
  cursor: pointer;
646
646
  position: absolute;
647
647
  top: 50%;
@@ -651,7 +651,7 @@ ${s}
651
651
  font-size: var(--n-arrow-size);
652
652
  color: var(--n-arrow-color);
653
653
  transition: color .3s var(--n-bezier);
654
- `)]),ge("base-selection-overlay",`
654
+ `)]),ue("base-selection-overlay",`
655
655
  display: flex;
656
656
  align-items: center;
657
657
  white-space: nowrap;
@@ -668,12 +668,12 @@ ${s}
668
668
  flex-grow: 1;
669
669
  overflow: hidden;
670
670
  text-overflow: ellipsis;
671
- `)]),ge("base-selection-placeholder",`
671
+ `)]),ue("base-selection-placeholder",`
672
672
  color: var(--n-placeholder-color);
673
673
  `,[ye("inner",`
674
674
  max-width: 100%;
675
675
  overflow: hidden;
676
- `)]),ge("base-selection-tags",`
676
+ `)]),ue("base-selection-tags",`
677
677
  cursor: pointer;
678
678
  outline: none;
679
679
  box-sizing: border-box;
@@ -691,7 +691,7 @@ ${s}
691
691
  color .3s var(--n-bezier),
692
692
  box-shadow .3s var(--n-bezier),
693
693
  background-color .3s var(--n-bezier);
694
- `),ge("base-selection-label",`
694
+ `),ue("base-selection-label",`
695
695
  height: var(--n-height);
696
696
  display: inline-flex;
697
697
  width: 100%;
@@ -708,7 +708,7 @@ ${s}
708
708
  border-radius: inherit;
709
709
  background-color: var(--n-color);
710
710
  align-items: center;
711
- `,[ge("base-selection-input",`
711
+ `,[ue("base-selection-input",`
712
712
  font-size: inherit;
713
713
  line-height: inherit;
714
714
  outline: none;
@@ -727,32 +727,32 @@ ${s}
727
727
  white-space: nowrap;
728
728
  `)]),ye("render-label",`
729
729
  color: var(--n-text-color);
730
- `)]),Gt("disabled",[ae("&:hover",[ye("state-border",`
730
+ `)]),Ut("disabled",[ae("&:hover",[ye("state-border",`
731
731
  box-shadow: var(--n-box-shadow-hover);
732
732
  border: var(--n-border-hover);
733
- `)]),Ce("focus",[ye("state-border",`
733
+ `)]),Be("focus",[ye("state-border",`
734
734
  box-shadow: var(--n-box-shadow-focus);
735
735
  border: var(--n-border-focus);
736
- `)]),Ce("active",[ye("state-border",`
736
+ `)]),Be("active",[ye("state-border",`
737
737
  box-shadow: var(--n-box-shadow-active);
738
738
  border: var(--n-border-active);
739
- `),ge("base-selection-label","background-color: var(--n-color-active);"),ge("base-selection-tags","background-color: var(--n-color-active);")])]),Ce("disabled","cursor: not-allowed;",[ye("arrow",`
739
+ `),ue("base-selection-label","background-color: var(--n-color-active);"),ue("base-selection-tags","background-color: var(--n-color-active);")])]),Be("disabled","cursor: not-allowed;",[ye("arrow",`
740
740
  color: var(--n-arrow-color-disabled);
741
- `),ge("base-selection-label",`
741
+ `),ue("base-selection-label",`
742
742
  cursor: not-allowed;
743
743
  background-color: var(--n-color-disabled);
744
- `,[ge("base-selection-input",`
744
+ `,[ue("base-selection-input",`
745
745
  cursor: not-allowed;
746
746
  color: var(--n-text-color-disabled);
747
747
  `),ye("render-label",`
748
748
  color: var(--n-text-color-disabled);
749
- `)]),ge("base-selection-tags",`
749
+ `)]),ue("base-selection-tags",`
750
750
  cursor: not-allowed;
751
751
  background-color: var(--n-color-disabled);
752
- `),ge("base-selection-placeholder",`
752
+ `),ue("base-selection-placeholder",`
753
753
  cursor: not-allowed;
754
754
  color: var(--n-placeholder-color-disabled);
755
- `)]),ge("base-selection-input-tag",`
755
+ `)]),ue("base-selection-input-tag",`
756
756
  height: calc(var(--n-height) - 6px);
757
757
  line-height: calc(var(--n-height) - 6px);
758
758
  outline: none;
@@ -785,39 +785,39 @@ ${s}
785
785
  user-select: none;
786
786
  -webkit-user-select: none;
787
787
  opacity: 0;
788
- `)]),["warning","error"].map(t=>Ce(`${t}-status`,[ye("state-border",`border: var(--n-border-${t});`),Gt("disabled",[ae("&:hover",[ye("state-border",`
788
+ `)]),["warning","error"].map(t=>Be(`${t}-status`,[ye("state-border",`border: var(--n-border-${t});`),Ut("disabled",[ae("&:hover",[ye("state-border",`
789
789
  box-shadow: var(--n-box-shadow-hover-${t});
790
790
  border: var(--n-border-hover-${t});
791
- `)]),Ce("active",[ye("state-border",`
791
+ `)]),Be("active",[ye("state-border",`
792
792
  box-shadow: var(--n-box-shadow-active-${t});
793
793
  border: var(--n-border-active-${t});
794
- `),ge("base-selection-label",`background-color: var(--n-color-active-${t});`),ge("base-selection-tags",`background-color: var(--n-color-active-${t});`)]),Ce("focus",[ye("state-border",`
794
+ `),ue("base-selection-label",`background-color: var(--n-color-active-${t});`),ue("base-selection-tags",`background-color: var(--n-color-active-${t});`)]),Be("focus",[ye("state-border",`
795
795
  box-shadow: var(--n-box-shadow-focus-${t});
796
796
  border: var(--n-border-focus-${t});
797
- `)])])]))]),ge("base-selection-popover",`
797
+ `)])])]))]),ue("base-selection-popover",`
798
798
  margin-bottom: -3px;
799
799
  display: flex;
800
800
  flex-wrap: wrap;
801
801
  margin-right: -8px;
802
- `),ge("base-selection-tag-wrapper",`
802
+ `),ue("base-selection-tag-wrapper",`
803
803
  max-width: 100%;
804
804
  display: inline-flex;
805
805
  padding: 0 7px 3px 0;
806
- `,[ae("&:last-child","padding-right: 0;"),ge("tag",`
806
+ `,[ae("&:last-child","padding-right: 0;"),ue("tag",`
807
807
  font-size: 14px;
808
808
  max-width: 100%;
809
809
  `,[ye("content",`
810
810
  line-height: 1.25;
811
811
  text-overflow: ellipsis;
812
812
  overflow: hidden;
813
- `)])])]),Yx=i.defineComponent({name:"InternalSelection",props:Object.assign(Object.assign({},gt.props),{clsPrefix:{type:String,required:!0},bordered:{type:Boolean,default:void 0},active:Boolean,pattern:{type:String,default:""},placeholder:String,selectedOption:{type:Object,default:null},selectedOptions:{type:Array,default:null},labelField:{type:String,default:"label"},valueField:{type:String,default:"value"},multiple:Boolean,filterable:Boolean,clearable:Boolean,disabled:Boolean,size:{type:String,default:"medium"},loading:Boolean,autofocus:Boolean,showArrow:{type:Boolean,default:!0},inputProps:Object,focused:Boolean,renderTag:Function,onKeydown:Function,onClick:Function,onBlur:Function,onFocus:Function,onDeleteOption:Function,maxTagCount:[String,Number],ellipsisTagPopoverProps:Object,onClear:Function,onPatternInput:Function,onPatternFocus:Function,onPatternBlur:Function,renderLabel:Function,status:String,inlineThemeDisabled:Boolean,ignoreComposition:{type:Boolean,default:!0},onResize:Function}),setup(t){const{mergedClsPrefixRef:e,mergedRtlRef:n}=fi(t),r=wr("InternalSelection",n,e),s=i.ref(null),o=i.ref(null),a=i.ref(null),l=i.ref(null),c=i.ref(null),d=i.ref(null),h=i.ref(null),u=i.ref(null),m=i.ref(null),f=i.ref(null),g=i.ref(!1),p=i.ref(!1),b=i.ref(!1),y=gt("InternalSelection","-internal-selection",Xx,pu,t,i.toRef(t,"clsPrefix")),_=i.computed(()=>t.clearable&&!t.disabled&&(b.value||t.active)),S=i.computed(()=>t.selectedOption?t.renderTag?t.renderTag({option:t.selectedOption,handleClose:()=>{}}):t.renderLabel?t.renderLabel(t.selectedOption,!0):Xi(t.selectedOption[t.labelField],t.selectedOption,!0):t.placeholder),C=i.computed(()=>{const ee=t.selectedOption;if(ee)return ee[t.labelField]}),v=i.computed(()=>t.multiple?!!(Array.isArray(t.selectedOptions)&&t.selectedOptions.length):t.selectedOption!==null);function B(){var ee;const{value:ie}=s;if(ie){const{value:Me}=o;Me&&(Me.style.width=`${ie.offsetWidth}px`,t.maxTagCount!=="responsive"&&((ee=m.value)===null||ee===void 0||ee.sync({showAllItemsBeforeCalculate:!1})))}}function k(){const{value:ee}=f;ee&&(ee.style.display="none")}function R(){const{value:ee}=f;ee&&(ee.style.display="inline-block")}i.watch(i.toRef(t,"active"),ee=>{ee||k()}),i.watch(i.toRef(t,"pattern"),()=>{t.multiple&&i.nextTick(B)});function $(ee){const{onFocus:ie}=t;ie&&ie(ee)}function F(ee){const{onBlur:ie}=t;ie&&ie(ee)}function D(ee){const{onDeleteOption:ie}=t;ie&&ie(ee)}function L(ee){const{onClear:ie}=t;ie&&ie(ee)}function M(ee){const{onPatternInput:ie}=t;ie&&ie(ee)}function z(ee){var ie;(!ee.relatedTarget||!(!((ie=a.value)===null||ie===void 0)&&ie.contains(ee.relatedTarget)))&&$(ee)}function O(ee){var ie;!((ie=a.value)===null||ie===void 0)&&ie.contains(ee.relatedTarget)||F(ee)}function ne(ee){L(ee)}function P(){b.value=!0}function E(){b.value=!1}function X(ee){!t.active||!t.filterable||ee.target!==o.value&&ee.preventDefault()}function j(ee){D(ee)}const H=i.ref(!1);function N(ee){if(ee.key==="Backspace"&&!H.value&&!t.pattern.length){const{selectedOptions:ie}=t;ie!=null&&ie.length&&j(ie[ie.length-1])}}let I=null;function J(ee){const{value:ie}=s;if(ie){const Me=ee.target.value;ie.textContent=Me,B()}t.ignoreComposition&&H.value?I=ee:M(ee)}function ce(){H.value=!0}function re(){H.value=!1,t.ignoreComposition&&M(I),I=null}function de(ee){var ie;p.value=!0,(ie=t.onPatternFocus)===null||ie===void 0||ie.call(t,ee)}function se(ee){var ie;p.value=!1,(ie=t.onPatternBlur)===null||ie===void 0||ie.call(t,ee)}function Ae(){var ee,ie;if(t.filterable)p.value=!1,(ee=d.value)===null||ee===void 0||ee.blur(),(ie=o.value)===null||ie===void 0||ie.blur();else if(t.multiple){const{value:Me}=l;Me==null||Me.blur()}else{const{value:Me}=c;Me==null||Me.blur()}}function Fe(){var ee,ie,Me;t.filterable?(p.value=!1,(ee=d.value)===null||ee===void 0||ee.focus()):t.multiple?(ie=l.value)===null||ie===void 0||ie.focus():(Me=c.value)===null||Me===void 0||Me.focus()}function Ke(){const{value:ee}=o;ee&&(R(),ee.focus())}function Ie(){const{value:ee}=o;ee&&ee.blur()}function bt(ee){const{value:ie}=h;ie&&ie.setTextContent(`+${ee}`)}function Jt(){const{value:ee}=u;return ee}function Qt(){return o.value}let Bt=null;function Ot(){Bt!==null&&window.clearTimeout(Bt)}function lt(){t.active||(Ot(),Bt=window.setTimeout(()=>{v.value&&(g.value=!0)},100))}function Nn(){Ot()}function je(ee){ee||(Ot(),g.value=!1)}i.watch(v,ee=>{ee||(g.value=!1)}),i.onMounted(()=>{i.watchEffect(()=>{const ee=d.value;ee&&(t.disabled?ee.removeAttribute("tabindex"):ee.tabIndex=p.value?-1:0)})}),zh(a,t.onResize);const{inlineThemeDisabled:Se}=t,st=i.computed(()=>{const{size:ee}=t,{common:{cubicBezierEaseInOut:ie},self:{fontWeight:Me,borderRadius:Cr,color:Yi,placeholderColor:_i,textColor:Ui,paddingSingle:qn,paddingMultiple:wi,caretColor:Gi,colorDisabled:en,textColorDisabled:Pn,placeholderColorDisabled:T,colorActive:q,boxShadowFocus:te,boxShadowActive:le,boxShadowHover:he,border:pe,borderFocus:_e,borderHover:xe,borderActive:Xe,arrowColor:pn,arrowColorDisabled:ba,loadingColor:_a,colorActiveWarning:wa,boxShadowFocusWarning:xa,boxShadowActiveWarning:va,boxShadowHoverWarning:ka,borderWarning:Ca,borderFocusWarning:Sa,borderHoverWarning:Ba,borderActiveWarning:Ta,colorActiveError:Ra,boxShadowFocusError:$a,boxShadowActiveError:Ea,boxShadowHoverError:Na,borderError:Pa,borderFocusError:Fa,borderHoverError:Ma,borderActiveError:P2,clearColor:F2,clearColorHover:M2,clearColorPressed:A2,clearSize:O2,arrowSize:V2,[Ue("height",ee)]:I2,[Ue("fontSize",ee)]:z2}}=y.value,$s=Ut(qn),Es=Ut(wi);return{"--n-bezier":ie,"--n-border":pe,"--n-border-active":Xe,"--n-border-focus":_e,"--n-border-hover":xe,"--n-border-radius":Cr,"--n-box-shadow-active":le,"--n-box-shadow-focus":te,"--n-box-shadow-hover":he,"--n-caret-color":Gi,"--n-color":Yi,"--n-color-active":q,"--n-color-disabled":en,"--n-font-size":z2,"--n-height":I2,"--n-padding-single-top":$s.top,"--n-padding-multiple-top":Es.top,"--n-padding-single-right":$s.right,"--n-padding-multiple-right":Es.right,"--n-padding-single-left":$s.left,"--n-padding-multiple-left":Es.left,"--n-padding-single-bottom":$s.bottom,"--n-padding-multiple-bottom":Es.bottom,"--n-placeholder-color":_i,"--n-placeholder-color-disabled":T,"--n-text-color":Ui,"--n-text-color-disabled":Pn,"--n-arrow-color":pn,"--n-arrow-color-disabled":ba,"--n-loading-color":_a,"--n-color-active-warning":wa,"--n-box-shadow-focus-warning":xa,"--n-box-shadow-active-warning":va,"--n-box-shadow-hover-warning":ka,"--n-border-warning":Ca,"--n-border-focus-warning":Sa,"--n-border-hover-warning":Ba,"--n-border-active-warning":Ta,"--n-color-active-error":Ra,"--n-box-shadow-focus-error":$a,"--n-box-shadow-active-error":Ea,"--n-box-shadow-hover-error":Na,"--n-border-error":Pa,"--n-border-focus-error":Fa,"--n-border-hover-error":Ma,"--n-border-active-error":P2,"--n-clear-size":O2,"--n-clear-color":F2,"--n-clear-color-hover":M2,"--n-clear-color-pressed":A2,"--n-arrow-size":V2,"--n-font-weight":Me}}),qe=Se?gi("internal-selection",i.computed(()=>t.size[0]),st,t):void 0;return{mergedTheme:y,mergedClearable:_,mergedClsPrefix:e,rtlEnabled:r,patternInputFocused:p,filterablePlaceholder:S,label:C,selected:v,showTagsPanel:g,isComposing:H,counterRef:h,counterWrapperRef:u,patternInputMirrorRef:s,patternInputRef:o,selfRef:a,multipleElRef:l,singleElRef:c,patternInputWrapperRef:d,overflowRef:m,inputTagElRef:f,handleMouseDown:X,handleFocusin:z,handleClear:ne,handleMouseEnter:P,handleMouseLeave:E,handleDeleteOption:j,handlePatternKeyDown:N,handlePatternInputInput:J,handlePatternInputBlur:se,handlePatternInputFocus:de,handleMouseEnterCounter:lt,handleMouseLeaveCounter:Nn,handleFocusout:O,handleCompositionEnd:re,handleCompositionStart:ce,onPopoverUpdateShow:je,focus:Fe,focusInput:Ke,blur:Ae,blurInput:Ie,updateCounter:bt,getCounter:Jt,getTail:Qt,renderLabel:t.renderLabel,cssVars:Se?void 0:st,themeClass:qe==null?void 0:qe.themeClass,onRender:qe==null?void 0:qe.onRender}},render(){const{status:t,multiple:e,size:n,disabled:r,filterable:s,maxTagCount:o,bordered:a,clsPrefix:l,ellipsisTagPopoverProps:c,onRender:d,renderTag:h,renderLabel:u}=this;d==null||d();const m=o==="responsive",f=typeof o=="number",g=m||f,p=i.h(aa,null,{default:()=>i.h(Wx,{clsPrefix:l,loading:this.loading,showArrow:this.showArrow,showClear:this.mergedClearable&&this.selected,onClear:this.handleClear},{default:()=>{var y,_;return(_=(y=this.$slots).arrow)===null||_===void 0?void 0:_.call(y)}})});let b;if(e){const{labelField:y}=this,_=M=>i.h("div",{class:`${l}-base-selection-tag-wrapper`,key:M.value},h?h({option:M,handleClose:()=>{this.handleDeleteOption(M)}}):i.h(fa,{size:n,closable:!M.disabled,disabled:r,onClose:()=>{this.handleDeleteOption(M)},internalCloseIsButtonTag:!1,internalCloseFocusable:!1},{default:()=>u?u(M,!0):Xi(M[y],M,!0)})),S=()=>(f?this.selectedOptions.slice(0,o):this.selectedOptions).map(_),C=s?i.h("div",{class:`${l}-base-selection-input-tag`,ref:"inputTagElRef",key:"__input-tag__"},i.h("input",Object.assign({},this.inputProps,{ref:"patternInputRef",tabindex:-1,disabled:r,value:this.pattern,autofocus:this.autofocus,class:`${l}-base-selection-input-tag__input`,onBlur:this.handlePatternInputBlur,onFocus:this.handlePatternInputFocus,onKeydown:this.handlePatternKeyDown,onInput:this.handlePatternInputInput,onCompositionstart:this.handleCompositionStart,onCompositionend:this.handleCompositionEnd})),i.h("span",{ref:"patternInputMirrorRef",class:`${l}-base-selection-input-tag__mirror`},this.pattern)):null,v=m?()=>i.h("div",{class:`${l}-base-selection-tag-wrapper`,ref:"counterWrapperRef"},i.h(fa,{size:n,ref:"counterRef",onMouseenter:this.handleMouseEnterCounter,onMouseleave:this.handleMouseLeaveCounter,disabled:r})):void 0;let B;if(f){const M=this.selectedOptions.length-o;M>0&&(B=i.h("div",{class:`${l}-base-selection-tag-wrapper`,key:"__counter__"},i.h(fa,{size:n,ref:"counterRef",onMouseenter:this.handleMouseEnterCounter,disabled:r},{default:()=>`+${M}`})))}const k=m?s?i.h($h,{ref:"overflowRef",updateCounter:this.updateCounter,getCounter:this.getCounter,getTail:this.getTail,style:{width:"100%",display:"flex",overflow:"hidden"}},{default:S,counter:v,tail:()=>C}):i.h($h,{ref:"overflowRef",updateCounter:this.updateCounter,getCounter:this.getCounter,style:{width:"100%",display:"flex",overflow:"hidden"}},{default:S,counter:v}):f&&B?S().concat(B):S(),R=g?()=>i.h("div",{class:`${l}-base-selection-popover`},m?S():this.selectedOptions.map(_)):void 0,$=g?Object.assign({show:this.showTagsPanel,trigger:"hover",overlap:!0,placement:"top",width:"trigger",onUpdateShow:this.onPopoverUpdateShow,theme:this.mergedTheme.peers.Popover,themeOverrides:this.mergedTheme.peerOverrides.Popover},c):null,D=(this.selected?!1:this.active?!this.pattern&&!this.isComposing:!0)?i.h("div",{class:`${l}-base-selection-placeholder ${l}-base-selection-overlay`},i.h("div",{class:`${l}-base-selection-placeholder__inner`},this.placeholder)):null,L=s?i.h("div",{ref:"patternInputWrapperRef",class:`${l}-base-selection-tags`},k,m?null:C,p):i.h("div",{ref:"multipleElRef",class:`${l}-base-selection-tags`,tabindex:r?void 0:0},k,p);b=i.h(i.Fragment,null,g?i.h(Mx,Object.assign({},$,{scrollable:!0,style:"max-height: calc(var(--v-target-height) * 6.6);"}),{trigger:()=>L,default:R}):L,D)}else if(s){const y=this.pattern||this.isComposing,_=this.active?!y:!this.selected,S=this.active?!1:this.selected;b=i.h("div",{ref:"patternInputWrapperRef",class:`${l}-base-selection-label`,title:this.patternInputFocused?void 0:Xh(this.label)},i.h("input",Object.assign({},this.inputProps,{ref:"patternInputRef",class:`${l}-base-selection-input`,value:this.active?this.pattern:"",placeholder:"",readonly:r,disabled:r,tabindex:-1,autofocus:this.autofocus,onFocus:this.handlePatternInputFocus,onBlur:this.handlePatternInputBlur,onInput:this.handlePatternInputInput,onCompositionstart:this.handleCompositionStart,onCompositionend:this.handleCompositionEnd})),S?i.h("div",{class:`${l}-base-selection-label__render-label ${l}-base-selection-overlay`,key:"input"},i.h("div",{class:`${l}-base-selection-overlay__wrapper`},h?h({option:this.selectedOption,handleClose:()=>{}}):u?u(this.selectedOption,!0):Xi(this.label,this.selectedOption,!0))):null,_?i.h("div",{class:`${l}-base-selection-placeholder ${l}-base-selection-overlay`,key:"placeholder"},i.h("div",{class:`${l}-base-selection-overlay__wrapper`},this.filterablePlaceholder)):null,p)}else b=i.h("div",{ref:"singleElRef",class:`${l}-base-selection-label`,tabindex:this.disabled?void 0:0},this.label!==void 0?i.h("div",{class:`${l}-base-selection-input`,title:Xh(this.label),key:"input"},i.h("div",{class:`${l}-base-selection-input__content`},h?h({option:this.selectedOption,handleClose:()=>{}}):u?u(this.selectedOption,!0):Xi(this.label,this.selectedOption,!0))):i.h("div",{class:`${l}-base-selection-placeholder ${l}-base-selection-overlay`,key:"placeholder"},i.h("div",{class:`${l}-base-selection-placeholder__inner`},this.placeholder)),p);return i.h("div",{ref:"selfRef",class:[`${l}-base-selection`,this.rtlEnabled&&`${l}-base-selection--rtl`,this.themeClass,t&&`${l}-base-selection--${t}-status`,{[`${l}-base-selection--active`]:this.active,[`${l}-base-selection--selected`]:this.selected||this.active&&this.pattern,[`${l}-base-selection--disabled`]:this.disabled,[`${l}-base-selection--multiple`]:this.multiple,[`${l}-base-selection--focus`]:this.focused}],style:this.cssVars,onClick:this.onClick,onMouseenter:this.handleMouseEnter,onMouseleave:this.handleMouseLeave,onKeydown:this.onKeydown,onFocusin:this.handleFocusin,onFocusout:this.handleFocusout,onMousedown:this.handleMouseDown},b,a?i.h("div",{class:`${l}-base-selection__border`}):null,a?i.h("div",{class:`${l}-base-selection__state-border`}):null)}});function Ux(t){const{boxShadow2:e}=t;return{menuBoxShadow:e}}const Gx={name:"Select",common:mi,peers:{InternalSelection:pu,InternalSelectMenu:lu},self:Ux},Kx=ae([ge("select",`
813
+ `)])])]),av=i.defineComponent({name:"InternalSelection",props:Object.assign(Object.assign({},ut.props),{clsPrefix:{type:String,required:!0},bordered:{type:Boolean,default:void 0},active:Boolean,pattern:{type:String,default:""},placeholder:String,selectedOption:{type:Object,default:null},selectedOptions:{type:Array,default:null},labelField:{type:String,default:"label"},valueField:{type:String,default:"value"},multiple:Boolean,filterable:Boolean,clearable:Boolean,disabled:Boolean,size:{type:String,default:"medium"},loading:Boolean,autofocus:Boolean,showArrow:{type:Boolean,default:!0},inputProps:Object,focused:Boolean,renderTag:Function,onKeydown:Function,onClick:Function,onBlur:Function,onFocus:Function,onDeleteOption:Function,maxTagCount:[String,Number],ellipsisTagPopoverProps:Object,onClear:Function,onPatternInput:Function,onPatternFocus:Function,onPatternBlur:Function,renderLabel:Function,status:String,inlineThemeDisabled:Boolean,ignoreComposition:{type:Boolean,default:!0},onResize:Function}),setup(t){const{mergedClsPrefixRef:e,mergedRtlRef:n}=gi(t),r=xr("InternalSelection",n,e),s=i.ref(null),o=i.ref(null),a=i.ref(null),l=i.ref(null),c=i.ref(null),d=i.ref(null),h=i.ref(null),u=i.ref(null),m=i.ref(null),g=i.ref(null),f=i.ref(!1),p=i.ref(!1),y=i.ref(!1),b=ut("InternalSelection","-internal-selection",ov,pu,t,i.toRef(t,"clsPrefix")),_=i.computed(()=>t.clearable&&!t.disabled&&(y.value||t.active)),C=i.computed(()=>t.selectedOption?t.renderTag?t.renderTag({option:t.selectedOption,handleClose:()=>{}}):t.renderLabel?t.renderLabel(t.selectedOption,!0):Yi(t.selectedOption[t.labelField],t.selectedOption,!0):t.placeholder),S=i.computed(()=>{const J=t.selectedOption;if(J)return J[t.labelField]}),v=i.computed(()=>t.multiple?!!(Array.isArray(t.selectedOptions)&&t.selectedOptions.length):t.selectedOption!==null);function B(){var J;const{value:se}=s;if(se){const{value:Ce}=o;Ce&&(Ce.style.width=`${se.offsetWidth}px`,t.maxTagCount!=="responsive"&&((J=m.value)===null||J===void 0||J.sync({showAllItemsBeforeCalculate:!1})))}}function k(){const{value:J}=g;J&&(J.style.display="none")}function R(){const{value:J}=g;J&&(J.style.display="inline-block")}i.watch(i.toRef(t,"active"),J=>{J||k()}),i.watch(i.toRef(t,"pattern"),()=>{t.multiple&&i.nextTick(B)});function $(J){const{onFocus:se}=t;se&&se(J)}function P(J){const{onBlur:se}=t;se&&se(J)}function I(J){const{onDeleteOption:se}=t;se&&se(J)}function V(J){const{onClear:se}=t;se&&se(J)}function A(J){const{onPatternInput:se}=t;se&&se(J)}function L(J){var se;(!J.relatedTarget||!(!((se=a.value)===null||se===void 0)&&se.contains(J.relatedTarget)))&&$(J)}function D(J){var se;!((se=a.value)===null||se===void 0)&&se.contains(J.relatedTarget)||P(J)}function ee(J){V(J)}function E(){y.value=!0}function N(){y.value=!1}function H(J){!t.active||!t.filterable||J.target!==o.value&&J.preventDefault()}function q(J){I(J)}const Y=i.ref(!1);function F(J){if(J.key==="Backspace"&&!Y.value&&!t.pattern.length){const{selectedOptions:se}=t;se!=null&&se.length&&q(se[se.length-1])}}let M=null;function Z(J){const{value:se}=s;if(se){const Ce=J.target.value;se.textContent=Ce,B()}t.ignoreComposition&&Y.value?M=J:A(J)}function fe(){Y.value=!0}function ie(){Y.value=!1,t.ignoreComposition&&A(M),M=null}function me(J){var se;p.value=!0,(se=t.onPatternFocus)===null||se===void 0||se.call(t,J)}function re(J){var se;p.value=!1,(se=t.onPatternBlur)===null||se===void 0||se.call(t,J)}function Me(){var J,se;if(t.filterable)p.value=!1,(J=d.value)===null||J===void 0||J.blur(),(se=o.value)===null||se===void 0||se.blur();else if(t.multiple){const{value:Ce}=l;Ce==null||Ce.blur()}else{const{value:Ce}=c;Ce==null||Ce.blur()}}function Ae(){var J,se,Ce;t.filterable?(p.value=!1,(J=d.value)===null||J===void 0||J.focus()):t.multiple?(se=l.value)===null||se===void 0||se.focus():(Ce=c.value)===null||Ce===void 0||Ce.focus()}function Oe(){const{value:J}=o;J&&(R(),J.focus())}function Le(){const{value:J}=o;J&&J.blur()}function pt(J){const{value:se}=h;se&&se.setTextContent(`+${J}`)}function Zt(){const{value:J}=u;return J}function Qt(){return o.value}let St=null;function At(){St!==null&&window.clearTimeout(St)}function yt(){t.active||(At(),St=window.setTimeout(()=>{v.value&&(f.value=!0)},100))}function pn(){At()}function Pn(J){J||(At(),f.value=!1)}i.watch(v,J=>{J||(f.value=!1)}),i.onMounted(()=>{i.watchEffect(()=>{const J=d.value;J&&(t.disabled?J.removeAttribute("tabindex"):J.tabIndex=p.value?-1:0)})}),zh(a,t.onResize);const{inlineThemeDisabled:De}=t,ke=i.computed(()=>{const{size:J}=t,{common:{cubicBezierEaseInOut:se},self:{fontWeight:Ce,borderRadius:Jt,color:Ui,placeholderColor:wi,textColor:Gi,paddingSingle:Xn,paddingMultiple:xi,caretColor:Ki,colorDisabled:en,textColorDisabled:Fn,placeholderColorDisabled:T,colorActive:j,boxShadowFocus:ne,boxShadowActive:le,boxShadowHover:ce,border:pe,borderFocus:_e,borderHover:xe,borderActive:Ye,arrowColor:yn,arrowColorDisabled:ba,loadingColor:_a,colorActiveWarning:wa,boxShadowFocusWarning:xa,boxShadowActiveWarning:va,boxShadowHoverWarning:ka,borderWarning:Ca,borderFocusWarning:Sa,borderHoverWarning:Ba,borderActiveWarning:Ta,colorActiveError:Ra,boxShadowFocusError:$a,boxShadowActiveError:Ea,boxShadowHoverError:Na,borderError:Pa,borderFocusError:Fa,borderHoverError:Ma,borderActiveError:X2,clearColor:Y2,clearColorHover:U2,clearColorPressed:G2,clearSize:K2,arrowSize:Z2,[Ge("height",J)]:Q2,[Ge("fontSize",J)]:J2}}=b.value,$s=Yt(Xn),Es=Yt(xi);return{"--n-bezier":se,"--n-border":pe,"--n-border-active":Ye,"--n-border-focus":_e,"--n-border-hover":xe,"--n-border-radius":Jt,"--n-box-shadow-active":le,"--n-box-shadow-focus":ne,"--n-box-shadow-hover":ce,"--n-caret-color":Ki,"--n-color":Ui,"--n-color-active":j,"--n-color-disabled":en,"--n-font-size":J2,"--n-height":Q2,"--n-padding-single-top":$s.top,"--n-padding-multiple-top":Es.top,"--n-padding-single-right":$s.right,"--n-padding-multiple-right":Es.right,"--n-padding-single-left":$s.left,"--n-padding-multiple-left":Es.left,"--n-padding-single-bottom":$s.bottom,"--n-padding-multiple-bottom":Es.bottom,"--n-placeholder-color":wi,"--n-placeholder-color-disabled":T,"--n-text-color":Gi,"--n-text-color-disabled":Fn,"--n-arrow-color":yn,"--n-arrow-color-disabled":ba,"--n-loading-color":_a,"--n-color-active-warning":wa,"--n-box-shadow-focus-warning":xa,"--n-box-shadow-active-warning":va,"--n-box-shadow-hover-warning":ka,"--n-border-warning":Ca,"--n-border-focus-warning":Sa,"--n-border-hover-warning":Ba,"--n-border-active-warning":Ta,"--n-color-active-error":Ra,"--n-box-shadow-focus-error":$a,"--n-box-shadow-active-error":Ea,"--n-box-shadow-hover-error":Na,"--n-border-error":Pa,"--n-border-focus-error":Fa,"--n-border-hover-error":Ma,"--n-border-active-error":X2,"--n-clear-size":K2,"--n-clear-color":Y2,"--n-clear-color-hover":U2,"--n-clear-color-pressed":G2,"--n-arrow-size":Z2,"--n-font-weight":Ce}}),Ie=De?mi("internal-selection",i.computed(()=>t.size[0]),ke,t):void 0;return{mergedTheme:b,mergedClearable:_,mergedClsPrefix:e,rtlEnabled:r,patternInputFocused:p,filterablePlaceholder:C,label:S,selected:v,showTagsPanel:f,isComposing:Y,counterRef:h,counterWrapperRef:u,patternInputMirrorRef:s,patternInputRef:o,selfRef:a,multipleElRef:l,singleElRef:c,patternInputWrapperRef:d,overflowRef:m,inputTagElRef:g,handleMouseDown:H,handleFocusin:L,handleClear:ee,handleMouseEnter:E,handleMouseLeave:N,handleDeleteOption:q,handlePatternKeyDown:F,handlePatternInputInput:Z,handlePatternInputBlur:re,handlePatternInputFocus:me,handleMouseEnterCounter:yt,handleMouseLeaveCounter:pn,handleFocusout:D,handleCompositionEnd:ie,handleCompositionStart:fe,onPopoverUpdateShow:Pn,focus:Ae,focusInput:Oe,blur:Me,blurInput:Le,updateCounter:pt,getCounter:Zt,getTail:Qt,renderLabel:t.renderLabel,cssVars:De?void 0:ke,themeClass:Ie==null?void 0:Ie.themeClass,onRender:Ie==null?void 0:Ie.onRender}},render(){const{status:t,multiple:e,size:n,disabled:r,filterable:s,maxTagCount:o,bordered:a,clsPrefix:l,ellipsisTagPopoverProps:c,onRender:d,renderTag:h,renderLabel:u}=this;d==null||d();const m=o==="responsive",g=typeof o=="number",f=m||g,p=i.h(aa,null,{default:()=>i.h(iv,{clsPrefix:l,loading:this.loading,showArrow:this.showArrow,showClear:this.mergedClearable&&this.selected,onClear:this.handleClear},{default:()=>{var b,_;return(_=(b=this.$slots).arrow)===null||_===void 0?void 0:_.call(b)}})});let y;if(e){const{labelField:b}=this,_=A=>i.h("div",{class:`${l}-base-selection-tag-wrapper`,key:A.value},h?h({option:A,handleClose:()=>{this.handleDeleteOption(A)}}):i.h(fa,{size:n,closable:!A.disabled,disabled:r,onClose:()=>{this.handleDeleteOption(A)},internalCloseIsButtonTag:!1,internalCloseFocusable:!1},{default:()=>u?u(A,!0):Yi(A[b],A,!0)})),C=()=>(g?this.selectedOptions.slice(0,o):this.selectedOptions).map(_),S=s?i.h("div",{class:`${l}-base-selection-input-tag`,ref:"inputTagElRef",key:"__input-tag__"},i.h("input",Object.assign({},this.inputProps,{ref:"patternInputRef",tabindex:-1,disabled:r,value:this.pattern,autofocus:this.autofocus,class:`${l}-base-selection-input-tag__input`,onBlur:this.handlePatternInputBlur,onFocus:this.handlePatternInputFocus,onKeydown:this.handlePatternKeyDown,onInput:this.handlePatternInputInput,onCompositionstart:this.handleCompositionStart,onCompositionend:this.handleCompositionEnd})),i.h("span",{ref:"patternInputMirrorRef",class:`${l}-base-selection-input-tag__mirror`},this.pattern)):null,v=m?()=>i.h("div",{class:`${l}-base-selection-tag-wrapper`,ref:"counterWrapperRef"},i.h(fa,{size:n,ref:"counterRef",onMouseenter:this.handleMouseEnterCounter,onMouseleave:this.handleMouseLeaveCounter,disabled:r})):void 0;let B;if(g){const A=this.selectedOptions.length-o;A>0&&(B=i.h("div",{class:`${l}-base-selection-tag-wrapper`,key:"__counter__"},i.h(fa,{size:n,ref:"counterRef",onMouseenter:this.handleMouseEnterCounter,disabled:r},{default:()=>`+${A}`})))}const k=m?s?i.h($h,{ref:"overflowRef",updateCounter:this.updateCounter,getCounter:this.getCounter,getTail:this.getTail,style:{width:"100%",display:"flex",overflow:"hidden"}},{default:C,counter:v,tail:()=>S}):i.h($h,{ref:"overflowRef",updateCounter:this.updateCounter,getCounter:this.getCounter,style:{width:"100%",display:"flex",overflow:"hidden"}},{default:C,counter:v}):g&&B?C().concat(B):C(),R=f?()=>i.h("div",{class:`${l}-base-selection-popover`},m?C():this.selectedOptions.map(_)):void 0,$=f?Object.assign({show:this.showTagsPanel,trigger:"hover",overlap:!0,placement:"top",width:"trigger",onUpdateShow:this.onPopoverUpdateShow,theme:this.mergedTheme.peers.Popover,themeOverrides:this.mergedTheme.peerOverrides.Popover},c):null,I=(this.selected?!1:this.active?!this.pattern&&!this.isComposing:!0)?i.h("div",{class:`${l}-base-selection-placeholder ${l}-base-selection-overlay`},i.h("div",{class:`${l}-base-selection-placeholder__inner`},this.placeholder)):null,V=s?i.h("div",{ref:"patternInputWrapperRef",class:`${l}-base-selection-tags`},k,m?null:S,p):i.h("div",{ref:"multipleElRef",class:`${l}-base-selection-tags`,tabindex:r?void 0:0},k,p);y=i.h(i.Fragment,null,f?i.h(Ux,Object.assign({},$,{scrollable:!0,style:"max-height: calc(var(--v-target-height) * 6.6);"}),{trigger:()=>V,default:R}):V,I)}else if(s){const b=this.pattern||this.isComposing,_=this.active?!b:!this.selected,C=this.active?!1:this.selected;y=i.h("div",{ref:"patternInputWrapperRef",class:`${l}-base-selection-label`,title:this.patternInputFocused?void 0:Xh(this.label)},i.h("input",Object.assign({},this.inputProps,{ref:"patternInputRef",class:`${l}-base-selection-input`,value:this.active?this.pattern:"",placeholder:"",readonly:r,disabled:r,tabindex:-1,autofocus:this.autofocus,onFocus:this.handlePatternInputFocus,onBlur:this.handlePatternInputBlur,onInput:this.handlePatternInputInput,onCompositionstart:this.handleCompositionStart,onCompositionend:this.handleCompositionEnd})),C?i.h("div",{class:`${l}-base-selection-label__render-label ${l}-base-selection-overlay`,key:"input"},i.h("div",{class:`${l}-base-selection-overlay__wrapper`},h?h({option:this.selectedOption,handleClose:()=>{}}):u?u(this.selectedOption,!0):Yi(this.label,this.selectedOption,!0))):null,_?i.h("div",{class:`${l}-base-selection-placeholder ${l}-base-selection-overlay`,key:"placeholder"},i.h("div",{class:`${l}-base-selection-overlay__wrapper`},this.filterablePlaceholder)):null,p)}else y=i.h("div",{ref:"singleElRef",class:`${l}-base-selection-label`,tabindex:this.disabled?void 0:0},this.label!==void 0?i.h("div",{class:`${l}-base-selection-input`,title:Xh(this.label),key:"input"},i.h("div",{class:`${l}-base-selection-input__content`},h?h({option:this.selectedOption,handleClose:()=>{}}):u?u(this.selectedOption,!0):Yi(this.label,this.selectedOption,!0))):i.h("div",{class:`${l}-base-selection-placeholder ${l}-base-selection-overlay`,key:"placeholder"},i.h("div",{class:`${l}-base-selection-placeholder__inner`},this.placeholder)),p);return i.h("div",{ref:"selfRef",class:[`${l}-base-selection`,this.rtlEnabled&&`${l}-base-selection--rtl`,this.themeClass,t&&`${l}-base-selection--${t}-status`,{[`${l}-base-selection--active`]:this.active,[`${l}-base-selection--selected`]:this.selected||this.active&&this.pattern,[`${l}-base-selection--disabled`]:this.disabled,[`${l}-base-selection--multiple`]:this.multiple,[`${l}-base-selection--focus`]:this.focused}],style:this.cssVars,onClick:this.onClick,onMouseenter:this.handleMouseEnter,onMouseleave:this.handleMouseLeave,onKeydown:this.onKeydown,onFocusin:this.handleFocusin,onFocusout:this.handleFocusout,onMousedown:this.handleMouseDown},y,a?i.h("div",{class:`${l}-base-selection__border`}):null,a?i.h("div",{class:`${l}-base-selection__state-border`}):null)}});function lv(t){const{boxShadow2:e}=t;return{menuBoxShadow:e}}const cv={name:"Select",common:pi,peers:{InternalSelection:pu,InternalSelectMenu:lu},self:lv},dv=ae([ue("select",`
814
814
  z-index: auto;
815
815
  outline: none;
816
816
  width: 100%;
817
817
  position: relative;
818
818
  font-weight: var(--n-font-weight);
819
- `),ge("select-menu",`
819
+ `),ue("select-menu",`
820
820
  margin: 4px 0;
821
821
  box-shadow: var(--n-menu-box-shadow);
822
- `,[fu({originalTransition:"background-color .3s var(--n-bezier), box-shadow .3s var(--n-bezier)"})])]);function Bs(t){return t.type==="group"}function yu(t){return t.type==="ignored"}function ga(t,e){try{return!!(1+e.toString().toLowerCase().indexOf(t.trim().toLowerCase()))}catch{return!1}}function Zx(t,e){return{getIsGroup:Bs,getIgnored:yu,getKey(r){return Bs(r)?r.name||r.key||"key-required":r[t]},getChildren(r){return r[e]}}}function Jx(t,e,n,r){if(!e)return t;function s(o){if(!Array.isArray(o))return[];const a=[];for(const l of o)if(Bs(l)){const c=s(l[r]);c.length&&a.push(Object.assign({},l,{[r]:c}))}else{if(yu(l))continue;e(n,l)&&a.push(l)}return a}return s(t)}function Qx(t,e,n){const r=new Map;return t.forEach(s=>{Bs(s)?s[n].forEach(o=>{r.set(o[e],o)}):r.set(s[e],s)}),r}var ev={};const tv=Object.assign(Object.assign({},gt.props),{to:vn.propTo,bordered:{type:Boolean,default:void 0},clearable:Boolean,clearFilterAfterSelect:{type:Boolean,default:!0},options:{type:Array,default:()=>[]},defaultValue:{type:[String,Number,Array],default:null},keyboard:{type:Boolean,default:!0},value:[String,Number,Array],placeholder:String,menuProps:Object,multiple:Boolean,size:String,menuSize:{type:String},filterable:Boolean,disabled:{type:Boolean,default:void 0},remote:Boolean,loading:Boolean,filter:Function,placement:{type:String,default:"bottom-start"},widthMode:{type:String,default:"trigger"},tag:Boolean,onCreate:Function,fallbackOption:{type:[Function,Boolean],default:void 0},show:{type:Boolean,default:void 0},showArrow:{type:Boolean,default:!0},maxTagCount:[Number,String],ellipsisTagPopoverProps:Object,consistentMenuWidth:{type:Boolean,default:!0},virtualScroll:{type:Boolean,default:!0},labelField:{type:String,default:"label"},valueField:{type:String,default:"value"},childrenField:{type:String,default:"children"},renderLabel:Function,renderOption:Function,renderTag:Function,"onUpdate:value":[Function,Array],inputProps:Object,nodeProps:Function,ignoreComposition:{type:Boolean,default:!0},showOnFocus:Boolean,onUpdateValue:[Function,Array],onBlur:[Function,Array],onClear:[Function,Array],onFocus:[Function,Array],onScroll:[Function,Array],onSearch:[Function,Array],onUpdateShow:[Function,Array],"onUpdate:show":[Function,Array],displayDirective:{type:String,default:"show"},resetMenuOnOptionsChange:{type:Boolean,default:!0},status:String,showCheckmark:{type:Boolean,default:!0},onChange:[Function,Array],items:Array}),nv=i.defineComponent({name:"Select",props:tv,slots:Object,setup(t){ev.NODE_ENV!=="production"&&i.watchEffect(()=>{t.items!==void 0&&Wn("select","`items` is deprecated, please use `options` instead."),t.onChange!==void 0&&Wn("select","`on-change` is deprecated, please use `on-update:value` instead.")});const{mergedClsPrefixRef:e,mergedBorderedRef:n,namespaceRef:r,inlineThemeDisabled:s}=fi(t),o=gt("Select","-select",Kx,Gx,t,e),a=i.ref(t.defaultValue),l=i.toRef(t,"value"),c=Ho(l,a),d=i.ref(!1),h=i.ref(""),u=jd(t,["items","options"]),m=i.ref([]),f=i.ref([]),g=i.computed(()=>f.value.concat(m.value).concat(u.value)),p=i.computed(()=>{const{filter:T}=t;if(T)return T;const{labelField:q,valueField:te}=t;return(le,he)=>{if(!he)return!1;const pe=he[q];if(typeof pe=="string")return ga(le,pe);const _e=he[te];return typeof _e=="string"?ga(le,_e):typeof _e=="number"?ga(le,String(_e)):!1}}),b=i.computed(()=>{if(t.remote)return u.value;{const{value:T}=g,{value:q}=h;return!q.length||!t.filterable?T:Jx(T,p.value,q,t.childrenField)}}),y=i.computed(()=>{const{valueField:T,childrenField:q}=t,te=Zx(T,q);return R_(b.value,te)}),_=i.computed(()=>Qx(g.value,t.valueField,t.childrenField)),S=i.ref(!1),C=Ho(i.toRef(t,"show"),S),v=i.ref(null),B=i.ref(null),k=i.ref(null),{localeRef:R}=Jh("Select"),$=i.computed(()=>{var T;return(T=t.placeholder)!==null&&T!==void 0?T:R.value.placeholder}),F=[],D=i.ref(new Map),L=i.computed(()=>{const{fallbackOption:T}=t;if(T===void 0){const{labelField:q,valueField:te}=t;return le=>({[q]:String(le),[te]:le})}return T===!1?!1:q=>Object.assign(T(q),{value:q})});function M(T){const q=t.remote,{value:te}=D,{value:le}=_,{value:he}=L,pe=[];return T.forEach(_e=>{if(le.has(_e))pe.push(le.get(_e));else if(q&&te.has(_e))pe.push(te.get(_e));else if(he){const xe=he(_e);xe&&pe.push(xe)}}),pe}const z=i.computed(()=>{if(t.multiple){const{value:T}=c;return Array.isArray(T)?M(T):[]}return null}),O=i.computed(()=>{const{value:T}=c;return!t.multiple&&!Array.isArray(T)?T===null?null:M([T])[0]||null:null}),ne=aw(t),{mergedSizeRef:P,mergedDisabledRef:E,mergedStatusRef:X}=ne;function j(T,q){const{onChange:te,"onUpdate:value":le,onUpdateValue:he}=t,{nTriggerFormChange:pe,nTriggerFormInput:_e}=ne;te&&ft(te,T,q),he&&ft(he,T,q),le&&ft(le,T,q),a.value=T,pe(),_e()}function H(T){const{onBlur:q}=t,{nTriggerFormBlur:te}=ne;q&&ft(q,T),te()}function N(){const{onClear:T}=t;T&&ft(T)}function I(T){const{onFocus:q,showOnFocus:te}=t,{nTriggerFormFocus:le}=ne;q&&ft(q,T),le(),te&&se()}function J(T){const{onSearch:q}=t;q&&ft(q,T)}function ce(T){const{onScroll:q}=t;q&&ft(q,T)}function re(){var T;const{remote:q,multiple:te}=t;if(q){const{value:le}=D;if(te){const{valueField:he}=t;(T=z.value)===null||T===void 0||T.forEach(pe=>{le.set(pe[he],pe)})}else{const he=O.value;he&&le.set(he[t.valueField],he)}}}function de(T){const{onUpdateShow:q,"onUpdate:show":te}=t;q&&ft(q,T),te&&ft(te,T),S.value=T}function se(){E.value||(de(!0),S.value=!0,t.filterable&&qn())}function Ae(){de(!1)}function Fe(){h.value="",f.value=F}const Ke=i.ref(!1);function Ie(){t.filterable&&(Ke.value=!0)}function bt(){t.filterable&&(Ke.value=!1,C.value||Fe())}function Jt(){E.value||(C.value?t.filterable?qn():Ae():se())}function Qt(T){var q,te;!((te=(q=k.value)===null||q===void 0?void 0:q.selfRef)===null||te===void 0)&&te.contains(T.relatedTarget)||(d.value=!1,H(T),Ae())}function Bt(T){I(T),d.value=!0}function Ot(){d.value=!0}function lt(T){var q;!((q=v.value)===null||q===void 0)&&q.$el.contains(T.relatedTarget)||(d.value=!1,H(T),Ae())}function Nn(){var T;(T=v.value)===null||T===void 0||T.focus(),Ae()}function je(T){var q;C.value&&(!((q=v.value)===null||q===void 0)&&q.$el.contains(cr(T))||Ae())}function Se(T){if(!Array.isArray(T))return[];if(L.value)return Array.from(T);{const{remote:q}=t,{value:te}=_;if(q){const{value:le}=D;return T.filter(he=>te.has(he)||le.has(he))}else return T.filter(le=>te.has(le))}}function st(T){qe(T.rawNode)}function qe(T){if(E.value)return;const{tag:q,remote:te,clearFilterAfterSelect:le,valueField:he}=t;if(q&&!te){const{value:pe}=f,_e=pe[0]||null;if(_e){const xe=m.value;xe.length?xe.push(_e):m.value=[_e],f.value=F}}if(te&&D.value.set(T[he],T),t.multiple){const pe=Se(c.value),_e=pe.findIndex(xe=>xe===T[he]);if(~_e){if(pe.splice(_e,1),q&&!te){const xe=ee(T[he]);~xe&&(m.value.splice(xe,1),le&&(h.value=""))}}else pe.push(T[he]),le&&(h.value="");j(pe,M(pe))}else{if(q&&!te){const pe=ee(T[he]);~pe?m.value=[m.value[pe]]:m.value=F}Ui(),Ae(),j(T[he],T)}}function ee(T){return m.value.findIndex(te=>te[t.valueField]===T)}function ie(T){C.value||se();const{value:q}=T.target;h.value=q;const{tag:te,remote:le}=t;if(J(q),te&&!le){if(!q){f.value=F;return}const{onCreate:he}=t,pe=he?he(q):{[t.labelField]:q,[t.valueField]:q},{valueField:_e,labelField:xe}=t;u.value.some(Xe=>Xe[_e]===pe[_e]||Xe[xe]===pe[xe])||m.value.some(Xe=>Xe[_e]===pe[_e]||Xe[xe]===pe[xe])?f.value=F:f.value=[pe]}}function Me(T){T.stopPropagation();const{multiple:q}=t;!q&&t.filterable&&Ae(),N(),q?j([],[]):j(null,null)}function Cr(T){!lr(T,"action")&&!lr(T,"empty")&&!lr(T,"header")&&T.preventDefault()}function Yi(T){ce(T)}function _i(T){var q,te,le,he,pe;if(!t.keyboard){T.preventDefault();return}switch(T.key){case" ":if(t.filterable)break;T.preventDefault();case"Enter":if(!(!((q=v.value)===null||q===void 0)&&q.isComposing)){if(C.value){const _e=(te=k.value)===null||te===void 0?void 0:te.getPendingTmNode();_e?st(_e):t.filterable||(Ae(),Ui())}else if(se(),t.tag&&Ke.value){const _e=f.value[0];if(_e){const xe=_e[t.valueField],{value:Xe}=c;t.multiple&&Array.isArray(Xe)&&Xe.includes(xe)||qe(_e)}}}T.preventDefault();break;case"ArrowUp":if(T.preventDefault(),t.loading)return;C.value&&((le=k.value)===null||le===void 0||le.prev());break;case"ArrowDown":if(T.preventDefault(),t.loading)return;C.value?(he=k.value)===null||he===void 0||he.next():se();break;case"Escape":C.value&&(iw(T),Ae()),(pe=v.value)===null||pe===void 0||pe.focus();break}}function Ui(){var T;(T=v.value)===null||T===void 0||T.focus()}function qn(){var T;(T=v.value)===null||T===void 0||T.focusInput()}function wi(){var T;C.value&&((T=B.value)===null||T===void 0||T.syncPosition())}re(),i.watch(i.toRef(t,"options"),re);const Gi={focus:()=>{var T;(T=v.value)===null||T===void 0||T.focus()},focusInput:()=>{var T;(T=v.value)===null||T===void 0||T.focusInput()},blur:()=>{var T;(T=v.value)===null||T===void 0||T.blur()},blurInput:()=>{var T;(T=v.value)===null||T===void 0||T.blurInput()}},en=i.computed(()=>{const{self:{menuBoxShadow:T}}=o.value;return{"--n-menu-box-shadow":T}}),Pn=s?gi("select",void 0,en,t):void 0;return Object.assign(Object.assign({},Gi),{mergedStatus:X,mergedClsPrefix:e,mergedBordered:n,namespace:r,treeMate:y,isMounted:fs(),triggerRef:v,menuRef:k,pattern:h,uncontrolledShow:S,mergedShow:C,adjustedTo:vn(t),uncontrolledValue:a,mergedValue:c,followerRef:B,localizedPlaceholder:$,selectedOption:O,selectedOptions:z,mergedSize:P,mergedDisabled:E,focused:d,activeWithoutMenuOpen:Ke,inlineThemeDisabled:s,onTriggerInputFocus:Ie,onTriggerInputBlur:bt,handleTriggerOrMenuResize:wi,handleMenuFocus:Ot,handleMenuBlur:lt,handleMenuTabOut:Nn,handleTriggerClick:Jt,handleToggle:st,handleDeleteOption:qe,handlePatternInput:ie,handleClear:Me,handleTriggerBlur:Qt,handleTriggerFocus:Bt,handleKeydown:_i,handleMenuAfterLeave:Fe,handleMenuClickOutside:je,handleMenuScroll:Yi,handleMenuKeydown:_i,handleMenuMousedown:Cr,mergedTheme:o,cssVars:s?void 0:en,themeClass:Pn==null?void 0:Pn.themeClass,onRender:Pn==null?void 0:Pn.onRender})},render(){return i.h("div",{class:`${this.mergedClsPrefix}-select`},i.h(Ud,null,{default:()=>[i.h(Gd,null,{default:()=>i.h(Yx,{ref:"triggerRef",inlineThemeDisabled:this.inlineThemeDisabled,status:this.mergedStatus,inputProps:this.inputProps,clsPrefix:this.mergedClsPrefix,showArrow:this.showArrow,maxTagCount:this.maxTagCount,ellipsisTagPopoverProps:this.ellipsisTagPopoverProps,bordered:this.mergedBordered,active:this.activeWithoutMenuOpen||this.mergedShow,pattern:this.pattern,placeholder:this.localizedPlaceholder,selectedOption:this.selectedOption,selectedOptions:this.selectedOptions,multiple:this.multiple,renderTag:this.renderTag,renderLabel:this.renderLabel,filterable:this.filterable,clearable:this.clearable,disabled:this.mergedDisabled,size:this.mergedSize,theme:this.mergedTheme.peers.InternalSelection,labelField:this.labelField,valueField:this.valueField,themeOverrides:this.mergedTheme.peerOverrides.InternalSelection,loading:this.loading,focused:this.focused,onClick:this.handleTriggerClick,onDeleteOption:this.handleDeleteOption,onPatternInput:this.handlePatternInput,onClear:this.handleClear,onBlur:this.handleTriggerBlur,onFocus:this.handleTriggerFocus,onKeydown:this.handleKeydown,onPatternBlur:this.onTriggerInputBlur,onPatternFocus:this.onTriggerInputFocus,onResize:this.handleTriggerOrMenuResize,ignoreComposition:this.ignoreComposition},{arrow:()=>{var t,e;return[(e=(t=this.$slots).arrow)===null||e===void 0?void 0:e.call(t)]}})}),i.h(dh,{ref:"followerRef",show:this.mergedShow,to:this.adjustedTo,teleportDisabled:this.adjustedTo===vn.tdkey,containerClass:this.namespace,width:this.consistentMenuWidth?"target":void 0,minWidth:"target",placement:this.placement},{default:()=>i.h(i.Transition,{name:"fade-in-scale-up-transition",appear:this.isMounted,onAfterLeave:this.handleMenuAfterLeave},{default:()=>{var t,e,n;return this.mergedShow||this.displayDirective==="show"?((t=this.onRender)===null||t===void 0||t.call(this),i.withDirectives(i.h(vx,Object.assign({},this.menuProps,{ref:"menuRef",onResize:this.handleTriggerOrMenuResize,inlineThemeDisabled:this.inlineThemeDisabled,virtualScroll:this.consistentMenuWidth&&this.virtualScroll,class:[`${this.mergedClsPrefix}-select-menu`,this.themeClass,(e=this.menuProps)===null||e===void 0?void 0:e.class],clsPrefix:this.mergedClsPrefix,focusable:!0,labelField:this.labelField,valueField:this.valueField,autoPending:!0,nodeProps:this.nodeProps,theme:this.mergedTheme.peers.InternalSelectMenu,themeOverrides:this.mergedTheme.peerOverrides.InternalSelectMenu,treeMate:this.treeMate,multiple:this.multiple,size:this.menuSize,renderOption:this.renderOption,renderLabel:this.renderLabel,value:this.mergedValue,style:[(n=this.menuProps)===null||n===void 0?void 0:n.style,this.cssVars],onToggle:this.handleToggle,onScroll:this.handleMenuScroll,onFocus:this.handleMenuFocus,onBlur:this.handleMenuBlur,onKeydown:this.handleMenuKeydown,onTabOut:this.handleMenuTabOut,onMousedown:this.handleMenuMousedown,show:this.mergedShow,showCheckmark:this.showCheckmark,resetMenuOnOptionsChange:this.resetMenuOnOptionsChange}),{empty:()=>{var r,s;return[(s=(r=this.$slots).empty)===null||s===void 0?void 0:s.call(r)]},header:()=>{var r,s;return[(s=(r=this.$slots).header)===null||s===void 0?void 0:s.call(r)]},action:()=>{var r,s;return[(s=(r=this.$slots).action)===null||s===void 0?void 0:s.call(r)]}}),this.displayDirective==="show"?[[i.vShow,this.mergedShow],[us,this.handleMenuClickOutside,void 0,{capture:!0}]]:[[us,this.handleMenuClickOutside,void 0,{capture:!0}]])):null}})})]}))}}),iv={},bu=i.defineComponent({...iv,__name:"searchable-reference-select",props:{searchDataHandler:{},optionsListConverter:{},renderLabel:{},renderTag:{},value:{},clearable:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},minTermLength:{default:()=>{var t;return((t=G.AppConfigProvider.getConfig())==null?void 0:t.minSearchTermLength)??3}},consistentMenuWidth:{type:Boolean,default:!1},wrapContent:{type:Boolean,default:!1},placeholder:{default:""}},emits:["update:value"],setup(t,{expose:e,emit:n}){const r=t,s=n,o=i.computed(()=>A.isArray(r.value)),a=i.computed(()=>o.value?r.value.map(_=>_.id):r.value?r.value.id:null),l=i.ref(o.value?r.optionsListConverter(r.value):r.value?r.optionsListConverter([r.value]):[]),c=i.computed(()=>l.value.map(_=>({..._,class:r.wrapContent?`${_.class} consistent-menu-width`:_.class}))),d=i.ref(!1),h=i.useTemplateRef("select-component"),u=_=>{_.length<r.minTermLength||(d.value=!0,r.searchDataHandler(_,d).then(S=>{if(A.isEmpty(S))return;const C=o.value?r.value:r.value?[r.value]:[],v=S.filter(B=>!C.some(k=>k.id===B.id));l.value=r.optionsListConverter([...C,...v])}).finally(()=>{d.value=!1}))};let m="";const f=A.debounce(()=>u(m),800),g=_=>{m=_,f()},p=_=>{var S;if(A.isArray(_)){const C=_.length>0?_.map(v=>{var B;return i.toRaw((B=l.value.find(k=>k.value===v))==null?void 0:B.item)}):[];s("update:value",C)}else if(_>0){const C=i.toRaw((S=l.value.find(v=>v.value===_))==null?void 0:S.item);s("update:value",C)}else s("update:value",null)};return e({focus:()=>{var _;return(_=h.value)==null?void 0:_.focusInput()},blur:()=>{var _;return(_=h.value)==null?void 0:_.blurInput()}}),(_,S)=>(i.openBlock(),i.createBlock(i.unref(nv),{ref:"select-component","clear-filter-after-select":!0,clearable:t.clearable,"consistent-menu-width":t.consistentMenuWidth,disabled:t.disabled,filterable:!0,loading:d.value,multiple:o.value,options:c.value,placeholder:t.placeholder,remote:!0,value:a.value,"render-label":t.renderLabel,"render-tag":t.renderTag,onSearch:g,"onUpdate:value":p},null,8,["clearable","consistent-menu-width","disabled","loading","multiple","options","placeholder","value","render-label","render-tag"]))}}),rv={},_u=i.defineComponent({...rv,__name:"searchable-product-select",props:{renderLabel:{},renderTag:{},value:{},clearable:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},minTermLength:{default:()=>{var t;return((t=G.AppConfigProvider.getConfig())==null?void 0:t.minSearchTermLength)??3}},consistentMenuWidth:{type:Boolean,default:!1},wrapContent:{type:Boolean,default:!1},placeholder:{default:""},searchType:{}},emits:["update:value"],setup(t,{expose:e,emit:n}){const r=t,s=n,o=i.useTemplateRef("select-component"),a=async u=>r.searchType==="categories"?G.HttpRequester.getInstance(G.ProductCategoryDataProvider).publicSimpleSearch(u):r.searchType==="products"?G.HttpRequester.getInstance(G.ProductDataProvider).publicSimpleSearch(u):new Promise(m=>{m([])}),l=u=>r.searchType==="categories"?Lt.convertReferencesToSelectOptionsList(u,!0,!1,!1,m=>m!=null&&m.isNewRec()?"-":m.name):r.searchType==="products"?Lt.convertReferencesToSelectOptionsList(u,!0,!1,!1,m=>m!=null&&m.isNewRec()?"-":`[${m.code}] ${m.name}`):[],c=(u,m)=>{if(r.renderLabel)return r.renderLabel(u,m);if(r.searchType==="products"){const f=u.item;return i.h("div",{},[i.h("span",{class:"text-sc-grey mr-2.5"},f.code),i.h("span",{},[f.name])])}if(r.searchType==="categories"){const f=u.item;return i.h("div",{},[f.name])}};return e({focus:()=>{var u;return(u=o.value)==null?void 0:u.focus()},blur:()=>{var u;return(u=o.value)==null?void 0:u.blur()}}),(u,m)=>(i.openBlock(),i.createBlock(bu,{ref:"select-component",value:t.value,clearable:t.clearable,disabled:t.disabled,placeholder:t.placeholder,"search-data-handler":a,"options-list-converter":l,"consistent-menu-width":t.consistentMenuWidth,"wrap-content":t.wrapContent,"min-term-length":t.minTermLength,"render-label":c,"render-tag":t.renderTag,"onUpdate:value":m[0]||(m[0]=f=>s("update:value",f))},null,8,["value","clearable","disabled","placeholder","consistent-menu-width","wrap-content","min-term-length","render-tag"]))}}),sv={class:"col-span-2 flex flex-row gap-2.5"},ov={class:"flex-1"},av={class:"text-sc-grey"},lv={class:"ml-2.5"},cv={key:0,class:"flex-none"},dv={},hv=i.defineComponent({...dv,__name:"products-list",props:{value:{},searchType:{},minTermLength:{default:()=>{var t;return((t=G.AppConfigProvider.getConfig())==null?void 0:t.minSearchTermLength)??3}},disabled:{type:Boolean}},emits:["update:value"],setup(t,{emit:e}){const n=t,r=e,s=i.ref(null),o=()=>structuredClone(i.toRaw(n.value)),a=i.ref(o()),l=()=>{r("update:value",a.value.map(u=>i.toRaw(u)))},c=u=>{u&&(a.value=[...a.value.map(m=>i.toRaw(m)),...(A.isArray(u)?u:[u]).filter(m=>!a.value.some(f=>f.id===m.id))],i.nextTick(()=>{s.value=null}),l())},d=u=>{u&&(a.value=a.value.map(m=>m.id===u.id?u:i.toRaw(m)),l())},h=u=>{a.value=a.value.filter(m=>m.id!==u.id),l()};return i.watch(()=>n.value,()=>{a.value=o()}),(u,m)=>{const f=V.NListItem,g=Lb,p=V.NButton,b=V.NList;return i.openBlock(),i.createBlock(b,{"show-divider":!1,hoverable:!0},{header:i.withCtx(()=>[i.renderSlot(u.$slots,"header")]),footer:i.withCtx(()=>[i.createVNode(_u,{value:s.value,"onUpdate:value":[m[0]||(m[0]=y=>s.value=y),c],clearable:!0,disabled:t.disabled,"min-term-length":t.minTermLength,"search-type":t.searchType,placeholder:"Введите название"},null,8,["value","disabled","min-term-length","search-type"])]),default:i.withCtx(()=>[a.value.length===0?(i.openBlock(),i.createBlock(f,{key:0,class:"text-center text-sm text-gray-600"},{default:i.withCtx(()=>[...m[1]||(m[1]=[i.createTextVNode(" --- Список пуст --- ",-1)])]),_:1})):i.createCommentVNode("",!0),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(a.value,y=>(i.openBlock(),i.createBlock(f,{key:y.id},{suffix:i.withCtx(()=>[i.createVNode(p,{disabled:t.disabled,quaternary:"",type:"error",onClick:_=>h(y)},{default:i.withCtx(()=>[i.createVNode(g)]),_:1},8,["disabled","onClick"])]),default:i.withCtx(()=>[i.createElementVNode("div",sv,[i.createElementVNode("span",ov,[i.createElementVNode("span",av,i.toDisplayString(y.code),1),i.createElementVNode("span",lv,i.toDisplayString(y.name),1)]),u.$slots["item-extra"]?(i.openBlock(),i.createElementBlock("div",cv,[i.renderSlot(u.$slots,"item-extra",{item:y,updateItemCallback:d})])):i.createCommentVNode("",!0)])]),_:2},1024))),128))]),_:3})}}}),uv={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function fv(t,e){return i.openBlock(),i.createElementBlock("svg",uv,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"currentColor",d:"M13 4a1 1 0 0 1 1 1h4a1 1 0 0 1 .783.378l.074.108l3 5l.055.103l.04.107l.029.109l.016.11L22 11v6a1 1 0 0 1-1 1h-1.171a3.001 3.001 0 0 1-5.658 0H9.829a3.001 3.001 0 0 1-5.658 0H3a1 1 0 0 1-1-1V6a2 2 0 0 1 2-2zM7 16a1 1 0 1 0 0 2a1 1 0 0 0 0-2m10 0a1 1 0 1 0 0 2a1 1 0 0 0 0-2m.434-9H14v3h5.234z"},null,-1)])])}const gv=i.markRaw({name:"tabler-truck-filled",render:fv}),mv={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function pv(t,e){return i.openBlock(),i.createElementBlock("svg",mv,[...e[0]||(e[0]=[i.createElementVNode("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[i.createElementVNode("path",{d:"M5 17a2 2 0 1 0 4 0a2 2 0 1 0-4 0m10 0a2 2 0 1 0 4 0a2 2 0 1 0-4 0"}),i.createElementVNode("path",{d:"M5 17H3v-4M2 5h11v12m-4 0h6m4 0h2v-6h-8m0-5h5l3 5M3 9h4"})],-1)])])}const yv=i.markRaw({name:"tabler-truck-delivery",render:pv}),bv={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function _v(t,e){return i.openBlock(),i.createElementBlock("svg",bv,[...e[0]||(e[0]=[i.createElementVNode("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[i.createElementVNode("path",{d:"M2 3h1a2 2 0 0 1 2 2v10a2 2 0 0 0 2 2h15"}),i.createElementVNode("path",{d:"M9 9a3 3 0 0 1 3-3h4a3 3 0 0 1 3 3v2a3 3 0 0 1-3 3h-4a3 3 0 0 1-3-3zM7 19a2 2 0 1 0 4 0a2 2 0 1 0-4 0m9 0a2 2 0 1 0 4 0a2 2 0 1 0-4 0"})],-1)])])}const wv=i.markRaw({name:"tabler-truck-loading",render:_v}),xv={class:"flex flex-col gap-1"},vv={key:0,class:"flex flex-row gap-1 text-base"},kv={key:1,class:"text-sc-dark-grey text-sm"},Cv={class:"text-sc-grey mr-1.5"},Sv={key:0},Bv={key:1},Tv={key:2},Rv={},Ts=i.defineComponent({...Rv,__name:"order-delivery-label",props:{delivery:{},showType:{type:Boolean,default:!0},showDetails:{type:Boolean,default:!0}},setup(t){const e=i.computed(()=>{var s;return(s=G.useReferencesStore().deliveryTypeReference)==null?void 0:s.find(o=>o.id===r.delivery.type)}),n=i.computed(()=>Fn.format(r.delivery.date,"dd.MM.yyyy")),r=t;return(s,o)=>{var d,h,u,m,f,g,p,b;const a=wv,l=yv,c=gv;return i.openBlock(),i.createElementBlock("div",xv,[t.showType?(i.openBlock(),i.createElementBlock("span",vv,[((d=e.value)==null?void 0:d.slug)==="self_delivery"?(i.openBlock(),i.createBlock(a,{key:0})):i.createCommentVNode("",!0),((h=e.value)==null?void 0:h.slug)==="delivery"?(i.openBlock(),i.createBlock(l,{key:1})):i.createCommentVNode("",!0),((u=e.value)==null?void 0:u.slug)==="transport_company_delivery"?(i.openBlock(),i.createBlock(c,{key:2})):i.createCommentVNode("",!0),i.createElementVNode("span",null,i.toDisplayString((m=e.value)==null?void 0:m.name),1)])):i.createCommentVNode("",!0),t.showDetails?(i.openBlock(),i.createElementBlock("span",kv,[i.createElementVNode("span",Cv,i.toDisplayString(n.value),1),(g=(f=t.delivery)==null?void 0:f.address)!=null&&g.address?(i.openBlock(),i.createElementBlock("span",Sv,i.toDisplayString(t.delivery.address.address),1)):i.createCommentVNode("",!0),(b=(p=t.delivery)==null?void 0:p.warehouse)!=null&&b.address?(i.openBlock(),i.createElementBlock("span",Bv,"со склада "+i.toDisplayString(t.delivery.warehouse.address),1)):(i.openBlock(),i.createElementBlock("span",Tv,"(не указано)"))])):i.createCommentVNode("",!0)])}}}),$v={class:"flex flex-col gap-2.5"},Ev={class:"text-base"},Nv=["href"],Pv={class:"text-sc-grey"},Fv={},wu=i.defineComponent({...Fv,__name:"order-common-info",props:{order:{},fields:{},orderUrl:{}},setup(t){const e=t,n=i.computed(()=>e.fields.includes(Ge.Id)?e.order.id:void 0),r=i.computed(()=>{var l,c;return e.fields.includes(Ge.Status)?(c=(l=G.useReferencesStore().orderStatusReference)==null?void 0:l.find(d=>d.id===(e.order.status??-1)))==null?void 0:c.name:void 0}),s=i.computed(()=>e.fields.includes(Ge.CreatedAt)),o=i.computed(()=>e.fields.includes(Ge.ClientInfo)?e.order.client:void 0),a=i.computed(()=>e.fields.includes(Ge.DeliveryInfo)?e.order.delivery:void 0);return(l,c)=>(i.openBlock(),i.createElementBlock("div",$v,[i.createElementVNode("span",Ev,[n.value?(i.openBlock(),i.createElementBlock("a",{key:0,href:t.orderUrl.replace(":id",t.order.id.toString()),target:"_blank",class:"text-sc-dark-grey"}," #"+i.toDisplayString(n.value),9,Nv)):i.createCommentVNode("",!0),s.value?(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[c[0]||(c[0]=i.createTextVNode(" от ",-1)),i.createVNode(Po,{date:t.order.createdAt,"is-time-secondary":!0},null,8,["date"])],64)):i.createCommentVNode("",!0),r.value?(i.openBlock(),i.createElementBlock(i.Fragment,{key:2},[c[1]||(c[1]=i.createTextVNode(" - ",-1)),i.createElementVNode("span",Pv,i.toDisplayString(r.value),1)],64)):i.createCommentVNode("",!0)]),o.value?(i.openBlock(),i.createBlock(os,{key:0,client:o.value,class:"ml-3"},null,8,["client"])):i.createCommentVNode("",!0),a.value?(i.openBlock(),i.createBlock(Ts,{key:1,delivery:a.value,class:"ml-3"},null,8,["delivery"])):i.createCommentVNode("",!0)]))}}),Mv={},xu=i.defineComponent({...Mv,__name:"order-payment",props:{payment:{}},setup(t){const e=t,n=i.computed(()=>{var r;return(r=G.useReferencesStore().paymentTypeReference)==null?void 0:r.find(s=>s.id===e.payment.type)});return(r,s)=>{var o;return i.openBlock(),i.createElementBlock("span",null,i.toDisplayString(((o=n.value)==null?void 0:o.name)??"-"),1)}}}),Av={class:"flex flex-row gap-1.5"},Ov={class:"flex-none text-nowrap"},Vv={class:"flex flex-1 flex-col"},Iv={class:"mt-2.5 grid grid-flow-col grid-rows-2 gap-1 text-base"},zv={key:0},Lv={key:1},Dv={},vu=i.defineComponent({...Dv,__name:"order-product-info",props:{product:{},index:{}},setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock("div",Av,[i.createElementVNode("span",Ov,i.toDisplayString(t.index+1)+".",1),i.createElementVNode("div",Vv,[i.createVNode(er,{product:t.product.product,"show-planning-dates":!1},null,8,["product"]),i.createElementVNode("div",Iv,[n[0]||(n[0]=i.createElementVNode("span",null,"Кол-во",-1)),t.product.product.getIsMeasurable()?(i.openBlock(),i.createElementBlock("span",zv,i.toDisplayString(`${t.product.length} ${t.product.product.unit} x ${t.product.quantity} шт.`),1)):(i.openBlock(),i.createElementBlock("span",Lv,i.toDisplayString(`${t.product.quantity} ${t.product.product.unit}`),1)),n[1]||(n[1]=i.createElementVNode("span",null,"Цена за ед.",-1)),i.createElementVNode("span",null,i.toDisplayString(`${t.product.costOneRub.toLocaleString("ru-ru",{minimumFractionDigits:2})} ${t.product.currency}`),1),n[2]||(n[2]=i.createElementVNode("span",null,"Сумма",-1)),i.createElementVNode("span",null,i.toDisplayString(`${t.product.cost.toLocaleString("ru-ru",{minimumFractionDigits:2})} ${t.product.currency}`),1)])])]))}}),Hv={},Wv=i.defineComponent({...Hv,__name:"order-items-list",props:{order:{}},setup(t){const e=()=>{const s=[{title:"№ п.п.",key:"id",resizable:!0,width:50,render:(o,a)=>i.h("span",{class:"text-base"},[a+1,"."])},{title:"Артикул",key:"codeNumber",resizable:!0,minWidth:120,render:o=>i.h("span",{class:"text-base"},[o.product.code])},{title:"Наименование",key:"name",resizable:!0,render:o=>i.h(er,{product:o.product,showCode:!1,showPlanningDates:!1})},{title:"Кол-во",key:"quantity",resizable:!0,minWidth:100,render:o=>i.h("span",{class:"text-nowrap text-base"},o.product.getIsMeasurable()?[`${o.length} ${o.product.unit} x ${o.quantity} шт.`]:[`${o.quantity} ${o.product.unit}`])},{title:"Цена за ед.",key:"costOneRub",resizable:!0,minWidth:100,render:o=>i.h("span",{class:"text-base"},[`${o.costOneRub.toLocaleString("ru-ru",{minimumFractionDigits:2})} ${o.currency}`])},{title:"Сумма",key:"cost",resizable:!0,minWidth:100,render:o=>i.h("span",{class:"text-base"},[`${o.cost.toLocaleString("ru-ru",{minimumFractionDigits:2})} ${o.currency}`])}];switch(_t.getDeviceTypeByResolution()){case Ye.phone:case Ye.tablet:return[{title:"",key:"items",resizable:!0,render:(o,a)=>i.h(vu,{product:o,index:a})}];case Ye.laptop:return s;default:return s}},n=i.ref(e()),r=()=>{n.value=e()};return i.onMounted(()=>{r(),window.addEventListener("resize",r)}),i.onUnmounted(()=>{window.removeEventListener("resize",r)}),(s,o)=>{const a=V.NDataTable;return i.openBlock(),i.createElementBlock(i.Fragment,null,[o[0]||(o[0]=i.createElementVNode("h3",null,"Список позиций",-1)),i.createVNode(a,{columns:n.value,data:t.order.products,"row-key":l=>l.id,"bottom-bordered":!1,bordered:!1},null,8,["columns","data","row-key"])],64)}}}),ku=Kn(Wv,[["__scopeId","data-v-b15b9b70"]]),jv={class:"text-base"},qv={},ma=i.defineComponent({...qv,__name:"user-short-info",props:{user:{},showUserType:{type:Boolean,default:!0},extraInfoOnSecondLine:{type:Boolean,default:!0}},setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass({"flex flex-col":t.showUserType&&t.extraInfoOnSecondLine})},[i.createElementVNode("span",jv,i.toDisplayString(t.user.name),1),t.showUserType?(i.openBlock(),i.createElementBlock("span",{key:0,class:i.normalizeClass([{"ml-1":!t.extraInfoOnSecondLine},"text-sc-grey"])}," ["+i.toDisplayString(t.user.type)+"] ",3)):i.createCommentVNode("",!0)],2))}}),Xv={class:"ml-4 grid grid-cols-3 gap-1.5 text-base"},Yv={class:"col-span-2"},Uv={class:"col-span-2"},Gv={class:"btn btn-primary",href:"{{ invoice }}"},Kv={},Cu=i.defineComponent({...Kv,__name:"order-details",props:{order:{}},setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock("div",null,[n[11]||(n[11]=i.createElementVNode("h3",null,"Детали заказа",-1)),i.createElementVNode("div",Xv,[t.order.creator.id!==t.order.client.id?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[n[0]||(n[0]=i.createElementVNode("span",null,"Создал",-1)),i.createVNode(ma,{user:t.order.creator,class:"col-span-2"},null,8,["user"])],64)):i.createCommentVNode("",!0),n[10]||(n[10]=i.createElementVNode("span",null,"Клиент",-1)),i.createVNode(os,{client:t.order.client,class:"col-span-2"},null,8,["client"]),t.order.contragent?(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[n[1]||(n[1]=i.createElementVNode("span",null,"Контрагент",-1)),i.createVNode(Sd,{contragent:t.order.contragent,class:"col-span-2"},null,8,["contragent"])],64)):i.createCommentVNode("",!0),t.order.image?(i.openBlock(),i.createElementBlock(i.Fragment,{key:2},[n[2]||(n[2]=i.createElementVNode("span",null,"Графический файл клиента",-1)),n[3]||(n[3]=i.createElementVNode("a",{class:"fancybox col-span-2",href:"{{ order.image }}"}," Посмотреть ",-1))],64)):i.createCommentVNode("",!0),t.order.barcode?(i.openBlock(),i.createElementBlock(i.Fragment,{key:3},[n[4]||(n[4]=i.createElementVNode("span",null,"Штрих-код",-1)),i.createElementVNode("span",Yv,i.toDisplayString(t.order.barcode),1)],64)):i.createCommentVNode("",!0),t.order.payment?(i.openBlock(),i.createElementBlock(i.Fragment,{key:4},[n[5]||(n[5]=i.createElementVNode("span",null,"Оплата",-1)),i.createVNode(xu,{payment:t.order.payment,class:"col-span-2"},null,8,["payment"])],64)):i.createCommentVNode("",!0),t.order.delivery?(i.openBlock(),i.createElementBlock(i.Fragment,{key:5},[n[6]||(n[6]=i.createElementVNode("span",null,"Доставка",-1)),i.createVNode(Ts,{delivery:t.order.delivery,class:"col-span-2"},null,8,["delivery"])],64)):i.createCommentVNode("",!0),t.order.comment?(i.openBlock(),i.createElementBlock(i.Fragment,{key:6},[n[7]||(n[7]=i.createElementVNode("span",null,"Комментарий",-1)),i.createElementVNode("span",Uv,i.toDisplayString(t.order.comment),1)],64)):i.createCommentVNode("",!0),t.order.attachedUser?(i.openBlock(),i.createElementBlock(i.Fragment,{key:7},[n[8]||(n[8]=i.createElementVNode("span",null,"Закреплен за",-1)),i.createVNode(ma,{user:t.order.attachedUser,class:"col-span-2"},null,8,["user"])],64)):i.createCommentVNode("",!0),t.order.invoices&&t.order.invoices.length>0?(i.openBlock(),i.createElementBlock(i.Fragment,{key:8},[n[9]||(n[9]=i.createElementVNode("span",null,"Прикрепленные счета",-1)),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(t.order.invoices,(r,s)=>(i.openBlock(),i.createElementBlock("div",{key:s,class:"col-span-2"},[i.createElementVNode("a",Gv," Скачать счет №"+i.toDisplayString(s+1),1)]))),128))],64)):i.createCommentVNode("",!0)])]))}}),Zv={key:0},Jv={class:"text-sc-dark-grey my-2 text-center"},Qv={key:1,class:"text-sc-dark-grey my-2 text-center"},ek={key:2},tk={class:"text-sc-dark-grey mt-4 text-right font-bold"},nk={class:"text-sc-primary"},ik={},Su=i.defineComponent({...ik,__name:"order-info",props:{order:{}},setup(t){const e=t,n=i.ref(!1),r=i.ref(new G.Order(e.order)),s=()=>{n.value=!0,G.HttpRequester.getInstance(G.OrdersDataProvider).getOrder(e.order.id).then(a=>{r.value=a}).finally(()=>{n.value=!1})},o=i.computed(()=>(r.value.products??[]).reduce((a,l)=>a+l.costRub,0).toLocaleString("ru-ru",{minimumFractionDigits:2}));return i.onMounted(()=>{s()}),(a,l)=>{const c=V.NSpin;return n.value?(i.openBlock(),i.createElementBlock("div",Zv,[i.createElementVNode("div",Jv,[i.createVNode(c,{size:"small",class:"mb-2.5 align-middle"}),l[0]||(l[0]=i.createElementVNode("div",null,[i.createElementVNode("span",null,"Загрузка данных ...")],-1))])])):r.value.products.length===0?(i.openBlock(),i.createElementBlock("div",Qv," --- Не удалось загрузить данные о заказе --- ")):(i.openBlock(),i.createElementBlock("div",ek,[i.createVNode(ku,{order:r.value},null,8,["order"]),i.createElementVNode("div",tk,[l[1]||(l[1]=i.createTextVNode(" ИТОГО: ",-1)),i.createElementVNode("span",nk,i.toDisplayString(o.value)+" ₽",1)]),i.createVNode(Cu,{order:r.value},null,8,["order"])]))}}}),rk={},sk=i.defineComponent({...rk,__name:"orders-list",props:{fields:{},orderUrl:{},filters:{},sort:{},pagination:{}},setup(t){const e=t,n=()=>structuredClone(i.toRaw(e.sort??{field:"id",direction:"desc"})),r=i.ref(n()),s=i.ref([]),o=i.ref(!1),a=i.computed(()=>G.useReferencesStore().orderStatusReference),l=()=>{const p=e.fields.length>0?e.fields:[Ge.CreatedAt,Ge.Id,Ge.DeliveryInfo,Ge.Status,Ge.SalesDirections,Ge.AttachedUser],b={title:"???",key:"undefined",render:()=>i.h("span",{},["--- unknown ---"])},y={type:"expand",expandable:A.constant(!0),renderExpand:S=>i.h(Su,{order:S,class:"pl-10 pt-3 pb-10"}),width:"30"},_=[{title:"Дата заказа",key:Ge.CreatedAt,resizable:!0,minWidth:100,render:S=>i.h(Po,{date:S.createdAt,isTimeSecondary:!0,isTimeOnSecondLine:!0,class:"text-base"})},{title:"Номер заказа",key:Ge.Id,resizable:!0,minWidth:70,render:S=>i.h("a",{href:e.orderUrl.replace(":id",S.id.toString()),target:"_blank",class:"text-base"},S.id)},{title:"Клиент",key:Ge.ClientInfo,resizable:!0,render:S=>i.h(os,{client:S.client})},{title:"Тип доставки",key:Ge.DeliveryInfo,resizable:!0,render:S=>i.h(Ts,{delivery:S.delivery})},{title:"Статус",key:Ge.Status,resizable:!0,minWidth:90,render:S=>{var C,v;return i.h("span",{class:"text-base"},[((v=(C=a.value)==null?void 0:C.find(B=>B.id===(S.status??-1)))==null?void 0:v.name)??""])}},{title:"Напр. продаж",key:Ge.SalesDirections,resizable:!0,minWidth:70,render:S=>i.h("span",{class:"text-base"},[S.salesDirection.name])},{title:"Закреплено за",key:Ge.AttachedUser,resizable:!0,render:S=>{var C;return i.h("span",{class:"text-base"},[(C=S==null?void 0:S.attachedUser)==null?void 0:C.name])}}];switch(_t.getDeviceTypeByResolution()){case Ye.phone:case Ye.tablet:return[y,{key:"order",title:"Заказ",resizable:!0,render:S=>i.h(wu,{order:S,fields:p,orderUrl:e.orderUrl})}];case Ye.laptop:return[y,...p.map(S=>_.find(C=>C.key===S)??b)];default:return[b]}},c=i.ref(l()),d=i.ref(new G.DataTablePagination(e.pagination??{page:1,pageSize:10,itemCount:0,pageCount:1,pageSlot:5,pageSizes:[10,15,25],showSizePicker:!1})),h=()=>{e.filters&&(o.value=!0,G.HttpRequester.getInstance(G.OrdersDataProvider).getOrders(e.filters,r.value,{page:d.value.page,pageSize:d.value.pageSize}).then(p=>{d.value.itemCount!==p.meta.total&&(d.value.itemCount=p.meta.total),d.value.page!==p.meta.currentPage&&(d.value.page=p.meta.currentPage),d.value.pageCount!==p.meta.lastPage&&(d.value.pageCount=p.meta.lastPage),d.value.pageSize!==p.meta.perPage&&(d.value.pageSize=p.meta.perPage),s.value=p.data}).finally(()=>{o.value=!1}))},u=p=>{d.value.page=p,h()},m=p=>{d.value.pageSize=p,h()},f=p=>{A.isNull(p)?r.value=n():(r.value.field=p.columnKey.toString(),r.value.direction=p.order==="ascend"?"asc":"desc"),c.value.forEach(b=>{if(Object.hasOwn(b,"sortOrder")){const y=b;y.sortOrder=y.key===(p==null?void 0:p.columnKey)&&(p!=null&&p.sorter)&&p.order!==!1?p.order:!1}}),h()},g=()=>{c.value=l()};return i.watch(()=>e.filters,()=>{h()}),i.watch(()=>e.sort,()=>{r.value=n(),h()}),i.onMounted(()=>{g(),window.addEventListener("resize",g),i.nextTick(()=>{h()})}),i.onUnmounted(()=>{window.removeEventListener("resize",g)}),(p,b)=>{const y=V.NDataTable;return i.openBlock(),i.createBlock(y,{columns:c.value,data:s.value,"row-key":_=>_.id,pagination:d.value,loading:o.value,remote:!0,bordered:!1,"bottom-bordered":!1,"sticky-expanded-rows":!0,"pagination-behavior-on-filter":"first","onUpdate:page":u,"onUpdate:pageSize":m,"onUpdate:sorter":f},null,8,["columns","data","row-key","pagination","loading"])}}}),ok=Kn(sk,[["__scopeId","data-v-7c4554f4"]]),ak=["href"],lk={class:"text-sc-dark-grey"},ck={},dk=i.defineComponent({...ck,__name:"short-text-order-info",props:{order:{},orderLink:{}},emits:["click:order-id"],setup(t,{emit:e}){const n=t,r=e,s=i.computed(()=>Fn.format(n.order.createdAt,G.AppConfigProvider.getConfig().dateFormats.uiDateWithTime)),o=a=>{A.isNil(n.orderLink)&&(a.preventDefault(),a.stopPropagation()),r("click:order-id",n.order,a)};return(a,l)=>(i.openBlock(),i.createElementBlock(i.Fragment,null,[i.createElementVNode("span",null,[l[1]||(l[1]=i.createTextVNode(" #",-1)),i.createElementVNode("a",{href:t.orderLink??"#",onClick:l[0]||(l[0]=c=>o(c))},i.toDisplayString(t.order.id),9,ak),i.createTextVNode(" от "+i.toDisplayString(s.value),1),t.order.isApproved1c?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[i.createTextVNode(" (подтверждён)")],64)):i.createCommentVNode("",!0)]),l[2]||(l[2]=i.createTextVNode(", ",-1)),i.createElementVNode("span",lk,"автор: "+i.toDisplayString(t.order.creator.name)+" ["+i.toDisplayString(t.order.creator.type)+"]",1)],64))}}),hk={class:"sc-page flex flex-col"},uk={class:"my-2 flex flex-row items-end"},fk={class:"sc-title grow"},gk={key:0,class:"sc-title-buttons flex-1 grow-0"},mk={class:"flex flex-col justify-end gap-1 sm:mt-0 sm:flex-row"},pk={key:0,class:"sc-title-extra mt-2 sm:mt-4"},yk={},Bu=i.defineComponent({...yk,__name:"page",props:{title:{}},setup(t){return(e,n)=>{const r=V.NH1;return i.openBlock(),i.createElementBlock("div",hk,[i.createElementVNode("div",uk,[i.createElementVNode("div",fk,[i.renderSlot(e.$slots,"title",{},()=>[i.createVNode(r,{class:"m-0 leading-none lg:mb-3 lg:leading-normal"},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(t.title??""),1)]),_:1})])]),e.$slots["title-buttons"]?(i.openBlock(),i.createElementBlock("div",gk,[i.createElementVNode("div",mk,[i.renderSlot(e.$slots,"title-buttons")])])):i.createCommentVNode("",!0)]),e.$slots["title-extra"]?(i.openBlock(),i.createElementBlock("div",pk,[i.renderSlot(e.$slots,"title-extra")])):i.createCommentVNode("",!0),i.renderSlot(e.$slots,"default")])}}}),bk={class:"overflow-hidden transition-all duration-300"},_k={class:"text-lg font-medium leading-none"},wk={},Tu=i.defineComponent({...wk,__name:"sliding-content-with-drawer",props:{drawerWidth:{type:[Number,Function],default:void 0},showDrawer:{type:Boolean,default:!1},title:{default:""}},emits:["update:show-drawer"],setup(t,{emit:e}){const n=t,r=e,s=i.ref(0),o=i.ref(n.showDrawer),a=()=>{switch(_t.getDeviceTypeByResolution()){case Ye.phone:return window.innerWidth*.66;case Ye.tablet:return window.innerWidth*.5;default:return window.innerWidth*.33}},l=()=>{o.value?A.isUndefined(n.drawerWidth)?s.value=a():s.value=A.isFunction(n.drawerWidth)?n.drawerWidth():n.drawerWidth:s.value=0};return i.watch(()=>n.drawerWidth,()=>{l()}),i.watch(()=>o.value,()=>{l(),r("update:show-drawer",o.value)}),i.watch(()=>n.showDrawer,c=>{o.value=c}),i.onUnmounted(()=>{window.removeEventListener("resize",l)}),l(),window.addEventListener("resize",l),(c,d)=>{const h=V.NDrawerContent,u=V.NDrawer;return i.openBlock(),i.createElementBlock(i.Fragment,null,[i.createElementVNode("div",bk,[i.createElementVNode("div",{style:i.normalizeStyle(`margin-left: ${s.value}px;`),class:"w-full"},[i.renderSlot(c.$slots,"default")],4)]),i.createVNode(u,{show:o.value,"onUpdate:show":d[0]||(d[0]=m=>o.value=m),resizable:!0,width:s.value,placement:"left"},{default:i.withCtx(()=>[i.createVNode(h,{closable:""},{header:i.withCtx(()=>[i.renderSlot(c.$slots,"drawer-header",{},()=>[i.createElementVNode("div",_k,i.toDisplayString(t.title),1)])]),default:i.withCtx(()=>[i.renderSlot(c.$slots,"drawer-content")]),footer:i.withCtx(()=>[i.renderSlot(c.$slots,"drawer-footer")]),_:3})]),_:3},8,["show","width"])],64)}}}),xk={key:0,ref:"panel-component-ref",class:"sc-page-panel flex flex-row gap-2.5 sm:gap-8"},vk={key:0},kk={class:"sc-page-preview-panel grow"},Ck={key:1,class:"sc-page-preview-panel-extra flex-none"},Sk={},Bk=i.defineComponent({...Sk,__name:"page-with-sliding-panel",props:{title:{},isShowPanelButtonVisible:{type:Boolean,default:!0},showPanelButtonText:{default:""},panelTitle:{default:""}},setup(t,{expose:e}){const n=i.ref(!1),r=()=>{n.value=!0},s=()=>{n.value=!1},o=i.useTemplateRef("panel-component-ref");return e({scrollToTopOfPanel:l=>{var c;(c=o.value)==null||c.scrollIntoView({behavior:"smooth"}),l&&i.nextTick(()=>{var d,h;window.scrollTo({top:(((h=(d=o.value)==null?void 0:d.getBoundingClientRect())==null?void 0:h.top)??0)+window.pageYOffset+l,behavior:"smooth"})})},showPanel:r,closePanel:s}),(l,c)=>{const d=V.NButton;return i.openBlock(),i.createBlock(Bu,{title:t.title},i.createSlots({default:i.withCtx(()=>[l.$slots["preview-panel"]||l.$slots["preview-panel-extra"]||t.isShowPanelButtonVisible?(i.openBlock(),i.createElementBlock("div",xk,[t.isShowPanelButtonVisible?(i.openBlock(),i.createElementBlock("div",vk,[i.renderSlot(l.$slots,"show-panel-button",{onClickHandler:()=>{n.value=!0}},()=>[i.createVNode(d,{class:"flex-none sm:px-10 sm:py-4",onClick:c[0]||(c[0]=h=>n.value=!0)},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(t.showPanelButtonText),1)]),_:1})])])):i.createCommentVNode("",!0),i.createElementVNode("div",kk,[i.renderSlot(l.$slots,"preview-panel")]),l.$slots["preview-panel-extra"]?(i.openBlock(),i.createElementBlock("div",Ck,[i.renderSlot(l.$slots,"preview-panel-extra")])):i.createCommentVNode("",!0)],512)):i.createCommentVNode("",!0),i.createVNode(Tu,{"show-drawer":n.value,"onUpdate:showDrawer":c[1]||(c[1]=h=>n.value=h),title:t.panelTitle},i.createSlots({"drawer-content":i.withCtx(()=>[i.renderSlot(l.$slots,"panel-content")]),default:i.withCtx(()=>[i.renderSlot(l.$slots,"default")]),_:2},[l.$slots["panel-header"]?{name:"drawer-header",fn:i.withCtx(()=>[i.renderSlot(l.$slots,"panel-header")]),key:"0"}:void 0,l.$slots["panel-bottom"]?{name:"drawer-footer",fn:i.withCtx(()=>[i.renderSlot(l.$slots,"panel-bottom")]),key:"1"}:void 0]),1032,["show-drawer","title"])]),_:2},[l.$slots.title?{name:"title",fn:i.withCtx(()=>[i.renderSlot(l.$slots,"title")]),key:"0"}:void 0,l.$slots["title-buttons"]?{name:"title-buttons",fn:i.withCtx(()=>[i.renderSlot(l.$slots,"title-buttons")]),key:"1"}:void 0,l.$slots["title-extra"]?{name:"title-extra",fn:i.withCtx(()=>[i.renderSlot(l.$slots,"title-extra")]),key:"2"}:void 0]),1032,["title"])}}}),Tk={},Rk=i.defineComponent({...Tk,__name:"manager-select",props:{value:{default:null},clearable:{type:Boolean,default:!1},consistentMenuWidth:{type:Boolean,default:!0},wrapContent:{type:Boolean,default:!0},managerReferenceList:{default:()=>[]},disabledManagerReferenceList:{default:()=>[]},showActualOnly:{type:Boolean,default:!1},showEmptyValue:{type:Boolean,default:!1},groupBySalesDirection:{type:Boolean,default:!1}},emits:["update:value"],setup(t,{expose:e,emit:n}){const r=t,s=n,o=i.computed(()=>A.isArray(r.value)),a=i.computed(()=>{var f;return A.isArray(r.value)?r.value.map(g=>g.id):((f=r.value)==null?void 0:f.id)??null}),l=i.computed(()=>{var p;let f=r.showEmptyValue?[G.ManagerDataFactory.generateUndefinedManagerInstance(),...r.managerReferenceList]:r.managerReferenceList,g=r.disabledManagerReferenceList.map(b=>b.id);if(r.showActualOnly){const b=A.isArray(r.value)?r.value.map(y=>y.id):[(p=r.value)==null?void 0:p.id];g=A.union(g,r.managerReferenceList.filter(y=>!y.isActive).map(y=>y.id)),f=r.managerReferenceList.filter(y=>y.isActive||b.includes(y.id))}return Lt.convertReferencesToSelectOptionsList(f,!0,r.groupBySalesDirection?{key:"item.salesDirection.id",label:"item.salesDirection.name"}:!1,!1,b=>{const y=!r.groupBySalesDirection||r.groupBySalesDirection&&A.some(o.value?r.value:[r.value],["id",b.id])?` (${b.salesDirection.name}) `:"";return b.salesDirection.isNewRec()?b.name:`${b.name}${y}${b.isActive?"":" [Не активен]"}`},b=>g.includes(b.id)&&b.isActive)}),c=i.computed(()=>l.value.map(f=>({...f,class:r.wrapContent?`${f.class} consistent-menu-width`:f.class}))),d=i.useTemplateRef("select-component"),h=f=>{if(A.isArray(f)){const g=f.length>0?f.filter(p=>!A.some(r.disabledManagerReferenceList,["id",p])).map(p=>r.managerReferenceList.find(b=>b.id===p)).filter(p=>!A.isNil(p)):[];s("update:value",g)}else{const g=f>0&&!A.some(r.disabledManagerReferenceList,["id",f])?r.managerReferenceList.find(p=>p.id===f):new G.Manager;s("update:value",g??new G.Manager)}};return i.watch(()=>r.value,()=>{var f,g;(g=(f=d.value)==null?void 0:f.$forceUpdate)==null||g.call(f)},{deep:!0}),i.watch(()=>r.disabledManagerReferenceList,f=>{if(f.length>0&&r.value)if(o.value){const g=r.value;A.some(g,p=>A.some(f,["id",p.id]))&&s("update:value",g.filter(p=>!A.some(f,["id",p.id])))}else{const g=r.value;A.some(f,["id",g.id])&&s("update:value",new G.Manager)}}),e({focus:()=>{var f;return(f=d.value)==null?void 0:f.focusInput()},blur:()=>{var f;return(f=d.value)==null?void 0:f.blurInput()}}),(f,g)=>(i.openBlock(),i.createBlock(i.unref(V.NSelect),{ref:"select-component",value:a.value,clearable:t.clearable,disabled:l.value.length===0,"consistent-menu-width":t.consistentMenuWidth,multiple:o.value,options:c.value,placeholder:"","onUpdate:value":h},null,8,["value","clearable","disabled","consistent-menu-width","multiple","options"]))}}),$k={class:"m-0.5 flex flex-col p-0.5"},Ek={class:"flex flex-row gap-1"},Nk={key:0},Pk={key:1},Fk={key:2},Mk={key:3},Ak={class:"flex flex-row gap-1"},Ok={key:0},Vk={key:1},Ik={key:2},zk={key:3},Lk={},Ru=i.defineComponent({...Lk,__name:"address-suggestion-label",props:{addr:{},selected:{type:Boolean}},setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock("div",$k,[i.createElementVNode("span",Ek,[t.addr.postIndex?(i.openBlock(),i.createElementBlock("span",Nk,i.toDisplayString(t.addr.postIndex)+", ",1)):i.createCommentVNode("",!0),t.addr.city?(i.openBlock(),i.createElementBlock("span",Pk,i.toDisplayString(t.addr.city)+", ",1)):i.createCommentVNode("",!0),t.addr.locality?(i.openBlock(),i.createElementBlock("span",Fk,i.toDisplayString(t.addr.locality)+", ",1)):i.createCommentVNode("",!0),t.addr.region?(i.openBlock(),i.createElementBlock("span",Mk,i.toDisplayString(t.addr.region)+", ",1)):i.createCommentVNode("",!0)]),i.createElementVNode("span",Ak,[t.addr.street?(i.openBlock(),i.createElementBlock("span",Ok,i.toDisplayString(t.addr.street)+", ",1)):i.createCommentVNode("",!0),t.addr.building?(i.openBlock(),i.createElementBlock("span",Vk,i.toDisplayString(t.addr.building)+", ",1)):i.createCommentVNode("",!0),t.addr.buildingPart?(i.openBlock(),i.createElementBlock("span",Ik,i.toDisplayString(t.addr.buildingPart)+", ",1)):i.createCommentVNode("",!0),t.addr.apartments?(i.openBlock(),i.createElementBlock("span",zk,i.toDisplayString(t.addr.apartments)+", ",1)):i.createCommentVNode("",!0)])]))}}),pa={clearable:!1,value:"",field:void 0,disabled:!1},Dk={},Hk=i.defineComponent({...Dk,__name:"address-suggestion",props:i.mergeDefaults({disabled:{type:Boolean},value:{},clearable:{type:Boolean},field:{},minTermLength:{},searchDataHandler:{type:Function}},{...pa,minTermLength:()=>{var t;return((t=G.AppConfigProvider.getConfig())==null?void 0:t.minSearchTermLength)??3},searchDataHandler:void 0}),emits:["select","update:value"],setup(t,{expose:e,emit:n}){const r=t,s=n,o=i.ref(r.value),a=i.ref(!1),l=i.ref([]),c=i.computed(()=>l.value.map(p=>({label:p[r.field??"addressString"]??"-",value:p.id})));i.watch(()=>r.value,p=>{o.value=p}),i.watch(o,()=>{s("update:value",o.value)});const d=A.debounce(()=>h(),800),h=async()=>{!o.value||o.value.length<r.minTermLength||(a.value=!0,l.value=await(r.searchDataHandler?r.searchDataHandler(o.value,a):G.HttpRequester.getInstance(G.DataSuggestionProvider).searchAddresses(o.value)).finally(()=>{a.value=!1}))},u=(p,b)=>{const y=l.value.find(_=>_.id===p.value)||{};return i.h(Ru,{addr:y,selected:b},{default:A.constant("-")})},m=p=>{d.cancel();const b=l.value.find(y=>y.id===p)||{};s("select",b)},f=i.ref(null);function g(){f.value.focus()}return e({focus:g}),(p,b)=>{const y=V.NAutoComplete;return i.openBlock(),i.createBlock(y,{ref_key:"autoCompleteElement",ref:f,value:o.value,"onUpdate:value":[b[0]||(b[0]=_=>o.value=_),i.unref(d)],clearable:t.clearable,disabled:t.disabled,loading:a.value,options:c.value,"render-label":u,placeholder:"",onSelect:m},null,8,["value","clearable","disabled","loading","options","onUpdate:value"])}}}),Wk={class:"m-0.5 flex flex-col p-0.5"},jk={class:"font-medium"},qk={class:"flex flex-row gap-1 text-xs font-light text-blue-800"},Xk={key:0},Yk={key:1},Uk={},$u=i.defineComponent({...Uk,__name:"bank-suggestion-label",props:{bank:{},selected:{type:Boolean}},setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock("div",Wk,[i.createElementVNode("span",jk,i.toDisplayString(t.bank.name),1),i.createElementVNode("span",qk,[t.bank.bic?(i.openBlock(),i.createElementBlock("span",Xk," БИК: "+i.toDisplayString(t.bank.bic),1)):i.createCommentVNode("",!0),t.bank.inn?(i.openBlock(),i.createElementBlock("span",Yk," ИНН: "+i.toDisplayString(t.bank.inn),1)):i.createCommentVNode("",!0)])]))}}),Gk={},Kk=i.defineComponent({...Gk,__name:"bank-suggestion",props:i.mergeDefaults({disabled:{type:Boolean},value:{},clearable:{type:Boolean},field:{},minTermLength:{}},{...pa,minTermLength:()=>{var t;return((t=G.AppConfigProvider.getConfig())==null?void 0:t.minSearchTermLength)??3}}),emits:["select","update:value"],setup(t,{expose:e,emit:n}){const r=t,s=n,o=i.ref(r.value),a=i.ref(!1),l=i.ref([]),c=i.computed(()=>l.value.map(p=>({label:p[r.field??"_"]??"-",value:p.id})));i.watch(()=>r.value,p=>{o.value=p}),i.watch(o,()=>{s("update:value",o.value)});const d=A.debounce(()=>h(),800),h=async()=>{if(!(!o.value||o.value.length<r.minTermLength)){a.value=!0;try{l.value=await G.HttpRequester.getInstance(G.DataSuggestionProvider).searchBank(o.value)}finally{a.value=!1}}},u=(p,b)=>{const y=l.value.find(_=>_.id===p.value)||{};return i.h($u,{bank:y,selected:b},{default:A.constant("-")})},m=p=>{d.cancel();const b=l.value.find(y=>y.id===p)||{};s("select",b)},f=i.ref(null);function g(){f.value.focus()}return e({focus:g}),(p,b)=>{const y=V.NAutoComplete;return i.openBlock(),i.createBlock(y,{ref_key:"autoCompleteElement",ref:f,value:o.value,"onUpdate:value":[b[0]||(b[0]=_=>o.value=_),i.unref(d)],clearable:t.clearable,disabled:t.disabled,loading:a.value,options:c.value,"render-label":u,placeholder:"",onSelect:m},null,8,["value","clearable","disabled","loading","options","onUpdate:value"])}}}),Zk={class:"font-medium"},Jk={key:0,class:"flex flex-row gap-2"},Qk={key:0,class:"text-xs font-light text-blue-800"},e2={key:1,class:"text-sc-dark-grey text-xs font-light"},t2={},Eu=i.defineComponent({...t2,__name:"org-suggestion-label",props:{org:{},selected:{type:Boolean}},setup(t){const e=t,n=i.computed(()=>{var s,o;return((o=(s=e.org.rawData)==null?void 0:s.state)==null?void 0:o.liquidationDate)??!1}),r=i.computed(()=>{var s,o;return((o=(s=e.org.rawData)==null?void 0:s.address)==null?void 0:o.value)??""});return(s,o)=>(i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(`m-0.5 flex flex-col p-0.5 ${n.value?"line-through":""}`)},[i.createElementVNode("span",Zk,i.toDisplayString(t.org.name),1),t.org.inn||r.value?(i.openBlock(),i.createElementBlock("div",Jk,[t.org.inn?(i.openBlock(),i.createElementBlock("span",Qk,i.toDisplayString(t.org.inn),1)):i.createCommentVNode("",!0),r.value?(i.openBlock(),i.createElementBlock("span",e2,i.toDisplayString(r.value),1)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)],2))}}),n2={},i2=i.defineComponent({...n2,__name:"org-suggestion",props:i.mergeDefaults({disabled:{type:Boolean},value:{},clearable:{type:Boolean},field:{},minTermLength:{},allowSelectTerminated:{type:Boolean}},{...pa,minTermLength:()=>{var t;return((t=G.AppConfigProvider.getConfig())==null?void 0:t.minSearchTermLength)??3}}),emits:["select","update:value"],setup(t,{expose:e,emit:n}){const r=t,s=n,o=i.ref(r.value),a=i.ref(!1),l=i.ref([]),c=b=>{var y,_;return!!(((_=(y=b.rawData)==null?void 0:y.state)==null?void 0:_.liquidationDate)??!1)},d=i.computed(()=>Lt.convertReferencesToSelectOptionsList(l.value,!1,!1,!1,b=>b[r.field??"_"]??"-",b=>!r.allowSelectTerminated&&c(b)));i.watch(()=>r.value,b=>{o.value=b}),i.watch(o,()=>{s("update:value",o.value)});const h=A.debounce(()=>u(),800),u=async()=>{if(!(!o.value||o.value.length<r.minTermLength)){a.value=!0;try{l.value=await G.HttpRequester.getInstance(G.DataSuggestionProvider).searchOrganization(o.value)}finally{a.value=!1}}},m=(b,y)=>{const _=l.value.find(S=>S.id===b.value)||{};return i.h(Eu,{org:_,selected:y},{default:A.constant("-")})},f=b=>{h.cancel();const y=l.value.find(_=>_.id===b)||{};(r.allowSelectTerminated||!c(y))&&s("select",y)},g=i.ref(null);function p(){g.value.focus()}return e({focus:p}),(b,y)=>{const _=V.NAutoComplete;return i.openBlock(),i.createBlock(_,{ref_key:"autoCompleteElement",ref:g,value:o.value,"onUpdate:value":[y[0]||(y[0]=S=>o.value=S),i.unref(h)],clearable:t.clearable,disabled:t.disabled,loading:a.value,options:d.value,"render-label":m,placeholder:"",onSelect:f},null,8,["value","clearable","disabled","loading","options","onUpdate:value"])}}}),r2={},s2=i.defineComponent({...r2,__name:"button-with-confirm-action",props:{disabled:{type:Boolean,default:!1},dialogTitle:{default:""},dialogContent:{default:""},disableConfirm:{type:Boolean,default:!1},popoverText:{default:""},type:{default:"default"},size:{default:"small"},quaternary:{type:Boolean,default:!1},circle:{type:Boolean,default:!1},ghost:{type:Boolean,default:!1},loading:{type:Boolean,default:!1}},emits:["accept"],setup(t,{emit:e}){const n=t,r=e,s=i.ref(!1),o=()=>{r("accept",()=>{s.value=!1})},a=()=>{n.disableConfirm?o():s.value=!0};return(l,c)=>{const d=V.NButton,h=V.NPopover,u=V.NModal;return i.openBlock(),i.createElementBlock("div",null,[i.createVNode(h,{disabled:t.popoverText.length===0,placement:"bottom"},{trigger:i.withCtx(()=>[i.createVNode(d,{disabled:t.disabled,ghost:t.ghost,loading:t.loading,size:t.size,type:t.type,quaternary:t.quaternary,circle:t.circle,onClick:a},{default:i.withCtx(()=>[i.renderSlot(l.$slots,"default")]),_:3},8,["disabled","ghost","loading","size","type","quaternary","circle"])]),default:i.withCtx(()=>[i.createTextVNode(" "+i.toDisplayString(t.popoverText),1)]),_:3},8,["disabled"]),i.createVNode(u,{show:s.value,"onUpdate:show":c[1]||(c[1]=m=>s.value=m),content:t.dialogContent,closable:!1,"mask-closable":!1,"show-icon":!1,title:t.dialogTitle,"action-class":"",preset:"dialog"},{action:i.withCtx(()=>[i.createVNode(d,{type:"primary",class:"px-8",onClick:o},{default:i.withCtx(()=>[...c[2]||(c[2]=[i.createTextVNode(" Да ",-1)])]),_:1}),i.createVNode(d,{type:"default",onClick:c[0]||(c[0]=m=>s.value=!1)},{default:i.withCtx(()=>[...c[3]||(c[3]=[i.createTextVNode(" Отмена ",-1)])]),_:1})]),_:1},8,["show","content","title"])])}}}),o2={key:0,class:"whitespace-pre-line"},a2={key:1,class:"text-sc-dark-grey"},l2={},c2=i.defineComponent({...l2,__name:"comment-editor",props:{disabled:{type:Boolean,default:!1},comment:{default:""}},emits:["update:comment"],setup(t,{emit:e}){const n=t,r=e,s=i.ref(n.comment);i.watch(()=>s.value,l=>{s.value=l});const o=l=>{r("update:comment",s.value,l)},a=()=>{s.value=n.comment};return(l,c)=>{const d=V.NInput;return i.openBlock(),i.createBlock(Ed,{disabled:t.disabled,"onEditor:apply":o,"onEditor:cancel":a},{viewer:i.withCtx(()=>[i.createElementVNode("div",null,[t.comment?(i.openBlock(),i.createElementBlock("span",o2,i.toDisplayString(t.comment),1)):(i.openBlock(),i.createElementBlock("span",a2," - Комментарий отсутствует - "))])]),editor:i.withCtx(()=>[i.createVNode(d,{value:s.value,"onUpdate:value":c[0]||(c[0]=h=>s.value=h),clearable:!0,type:"textarea"},null,8,["value"])]),_:1},8,["disabled"])}}}),d2={key:0,class:"text-sm"},h2={key:1},u2={},f2=i.defineComponent({...u2,__name:"debt",props:{debt:{default:0},showLabel:{type:Boolean,default:!1},wrapAsSmall:{type:Boolean,default:!1}},setup(t){const e=t,n=i.computed(()=>{let r="";return(e.showLabel??!1)&&(e.debt>0?r="Переплата: ":e.debt<0&&(r="Задолженность: ")),r});return(r,s)=>(i.openBlock(),i.createElementBlock("span",null,[t.wrapAsSmall&&t.debt!==0?(i.openBlock(),i.createElementBlock("span",d2,[i.createTextVNode(i.toDisplayString(n.value)+" ",1),i.createElementVNode("span",{class:i.normalizeClass({"text-green-700":t.debt>0,"text-red-700":t.debt<0})},i.toDisplayString(t.debt)+" ₽ ",3)])):i.createCommentVNode("",!0),!t.wrapAsSmall&&t.debt!==0?(i.openBlock(),i.createElementBlock("span",h2,[i.createTextVNode(i.toDisplayString(n.value)+" ",1),i.createElementVNode("span",{class:i.normalizeClass({"text-green-700":t.debt>0,"text-red-700":t.debt<0})},i.toDisplayString(t.debt)+" ₽ ",3)])):i.createCommentVNode("",!0)]))}}),g2={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function m2(t,e){return i.openBlock(),i.createElementBlock("svg",g2,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"currentColor",d:"M449.07 399.08L278.64 82.58c-12.08-22.44-44.26-22.44-56.35 0L51.87 399.08A32 32 0 0 0 80 446.25h340.89a32 32 0 0 0 28.18-47.17m-198.6-1.83a20 20 0 1 1 20-20a20 20 0 0 1-20 20m21.72-201.15l-5.74 122a16 16 0 0 1-32 0l-5.74-121.95a21.73 21.73 0 0 1 21.5-22.69h.21a21.74 21.74 0 0 1 21.73 22.7Z"},null,-1)])])}const p2=i.markRaw({name:"ion-warning",render:m2}),y2={},b2=i.defineComponent({...y2,__name:"warning-icon",props:{popoverText:{default:""},iconClass:{default:"text-sc-warning"}},setup(t){return(e,n)=>{const r=p2,s=V.NPopover;return i.openBlock(),i.createBlock(s,{disabled:t.popoverText.length===0,placement:"bottom"},{trigger:i.withCtx(()=>[i.createVNode(r,{class:i.normalizeClass(`ml-0.5 ${t.iconClass}`)},null,8,["class"])]),default:i.withCtx(()=>[i.createTextVNode(" "+i.toDisplayString(t.popoverText),1)]),_:1},8,["disabled"])}}}),yt=class yt{static init(e,n){yt.messagesService&&yt.notificationsService||(yt.messagesService=e,yt.notificationsService=n)}static getMessagesService(){if(!yt.messagesService)throw new Error("UI provider is not initialized.");return yt.messagesService}static getNotificationsService(){if(!yt.notificationsService)throw new Error("UI provider is not initialized.");return yt.notificationsService}static showNotificationsForErrorResponseData(e,n={}){var r,s;if(A.isEmpty(e.errors)){const o=(s=(r=e.rawError)==null?void 0:r.config)==null?void 0:s.url,a=o?` [ ${o} ]`:"";yt.notificationsService?yt.notificationsService.error({title:"Ошибка выполнения/обработки запроса",content:e.message,meta:`#${e.status}${a}: ${e.statusText}`,duration:3e3}):console.log("Show notification error response data: UI provider is not initialized.",e)}else for(const o in e.errors)Object.prototype.hasOwnProperty.call(n,o)?n[o]=new G.FieldValidationResultData(e.errors[o].toString(),"error"):yt.messagesService?yt.messagesService.error(e.errors[o].toString()):console.log("Show notification error response data: UI provider is not initialized.",e.errors[o])}};x(yt,"messagesService"),x(yt,"notificationsService");let ya=yt;const _2=i.computed(()=>G.useReferencesStore().deliveryTypeReference??[]),w2=i.computed(()=>G.useReferencesStore().managersList??[]),x2=i.computed(()=>G.useReferencesStore().opfReference??[]),v2=i.computed(()=>G.useReferencesStore().partnerGroupsReference??[]),k2=i.computed(()=>G.useReferencesStore().priceCoefficientsReference??[]),C2=i.computed(()=>G.useReferencesStore().productFilesTypesReference??[]),S2=i.computed(()=>G.useReferencesStore().resourceTypesReference),B2=i.computed(()=>G.useReferencesStore().salesDirectionsReference??[]),T2=i.computed(()=>G.useReferencesStore().warehousesReference??[]),R2=i.computed(()=>Lt.convertReferencesToSelectOptionsList(G.useReferencesStore().channelPrimaryInterestsReference??[],!0,!1,!0)),$2=i.computed(()=>Lt.convertReferencesToSelectOptionsList(G.useReferencesStore().sourcePrimaryInterestsReference??[],!0,!1,!0)),E2=t=>G.HttpRequester.getInstance(G.ReferenceDataProvider).searchCity(t),N2=t=>Lt.convertReferencesToSelectOptionsList(t,!0,!1,!1,e=>{var n,r,s;return e!=null&&e.isNewRec()?"-":`${e.name}, ${(n=e==null?void 0:e.region)==null?void 0:n.name}, ${(s=(r=e==null?void 0:e.region)==null?void 0:r.country)==null?void 0:s.name}`},e=>e==null?void 0:e.isNewRec());W.AddProductToCartDialog=W0,W.ConfiguratorSettingsKozyrek=_d,W.ContentHelper=Gn,W.KozyrekLine=ii,W.KozyrekTailTemplate=No,W.KozyrekTemplate=Li,W.OrdersTableFields=Ge,W.Point=$o,W.ScAddressSuggestion=Hk,W.ScAddressSuggestionLabel=Ru,W.ScBankSuggestion=Kk,W.ScBankSuggestionLabel=$u,W.ScBaseDialog=Cd,W.ScButtonWithConfirmAction=s2,W.ScCategoryCollapse=vd,W.ScClientNameWithShortInfo=os,W.ScCollapse=xd,W.ScCollapseItem=Da,W.ScCommentEditor=c2,W.ScConfiguratorsProductInfo=tr,W.ScContragentWithShortInfo=Sd,W.ScDateRange=eb,W.ScDateTimeLabel=Po,W.ScDebouncedInput=Tb,W.ScDebouncedInputNumber=zi,W.ScDebt=f2,W.ScDialogHeader=lb,W.ScDynamicConfigurator=wd,W.ScEmail=sy,W.ScExternalLink=Vb,W.ScImageGallery=qa,W.ScInlineEditableItem=Ed,W.ScInlineView=Fo,W.ScKozyrekConfigurator=cd,W.ScKozyrekConfiguratorParamsForm=Ua,W.ScKozyrekConfiguratorPreview=ld,W.ScKozyrekConfiguratorTemplates=ad,W.ScLightGallery=ja,W.ScManagerSelect=Rk,W.ScMetalForDoorsConfigurator=bd,W.ScMetalForDoorsConfiguratorForm=yd,W.ScMosquitoConfigurator=ud,W.ScMosquitoConfiguratorForm=dd,W.ScMosquitoConfiguratorMeasurementInstructions=hd,W.ScMosquitoConfiguratorPreview=Eo,W.ScOrderCommonInfo=wu,W.ScOrderDeliveryLabel=Ts,W.ScOrderDetails=Cu,W.ScOrderInfo=Su,W.ScOrderItemsList=ku,W.ScOrderPayment=xu,W.ScOrderProductInfo=vu,W.ScOrdersList=ok,W.ScOrgSuggestion=i2,W.ScOrgSuggestionLabel=Eu,W.ScPage=Bu,W.ScPageWithSlidingPanel=Bk,W.ScPersonContactsBlock=Gy,W.ScPhone=$y,W.ScPhoneInput=Eb,W.ScProductName=er,W.ScProductsList=hv,W.ScReferenceSelect=kd,W.ScSearchableProductSelect=_u,W.ScSearchableReferenceSelect=bu,W.ScSetClientPriceFormItem=O0,W.ScShortTextOrderInfo=dk,W.ScSingleFileUploadSelector=fb,W.ScSlidingContentWithDrawer=Tu,W.ScStripConfigurator=pd,W.ScStripConfiguratorForm=gd,W.ScStripConfiguratorLineItem=fd,W.ScStripConfiguratorPreview=md,W.ScUserShortInfo=ma,W.ScWarningIcon=b2,W.SelectOptionHelper=Lt,W.UiNotificationProvider=ya,W.WindowResolutionEnum=Ye,W.WindowResolutionProvider=_t,W.channelPrimaryInterestOptionsList=R2,W.componentSizeInjectionKey=$r,W.deliveryTypeReferenceList=_2,W.managersReferenceList=w2,W.naiveUiTheme=kf,W.opfReferenceList=x2,W.partnerGroupReferenceList=v2,W.priceCoefficientsReferenceList=k2,W.productFilesTypesReferenceList=C2,W.renderConfig=Oe,W.resourceReferencesList=S2,W.salesDirectionsReferenceList=B2,W.searchCityReferenceDataHandler=E2,W.searchCityReferenceLabelRenderer=N2,W.sourcePrimaryInterestOptionsList=$2,W.warehousesReferenceList=T2,Object.defineProperty(W,Symbol.toStringTag,{value:"Module"})});
822
+ `,[fu({originalTransition:"background-color .3s var(--n-bezier), box-shadow .3s var(--n-bezier)"})])]);function Bs(t){return t.type==="group"}function yu(t){return t.type==="ignored"}function ga(t,e){try{return!!(1+e.toString().toLowerCase().indexOf(t.trim().toLowerCase()))}catch{return!1}}function hv(t,e){return{getIsGroup:Bs,getIgnored:yu,getKey(r){return Bs(r)?r.name||r.key||"key-required":r[t]},getChildren(r){return r[e]}}}function uv(t,e,n,r){if(!e)return t;function s(o){if(!Array.isArray(o))return[];const a=[];for(const l of o)if(Bs(l)){const c=s(l[r]);c.length&&a.push(Object.assign({},l,{[r]:c}))}else{if(yu(l))continue;e(n,l)&&a.push(l)}return a}return s(t)}function fv(t,e,n){const r=new Map;return t.forEach(s=>{Bs(s)?s[n].forEach(o=>{r.set(o[e],o)}):r.set(s[e],s)}),r}var gv={};const mv=Object.assign(Object.assign({},ut.props),{to:kn.propTo,bordered:{type:Boolean,default:void 0},clearable:Boolean,clearFilterAfterSelect:{type:Boolean,default:!0},options:{type:Array,default:()=>[]},defaultValue:{type:[String,Number,Array],default:null},keyboard:{type:Boolean,default:!0},value:[String,Number,Array],placeholder:String,menuProps:Object,multiple:Boolean,size:String,menuSize:{type:String},filterable:Boolean,disabled:{type:Boolean,default:void 0},remote:Boolean,loading:Boolean,filter:Function,placement:{type:String,default:"bottom-start"},widthMode:{type:String,default:"trigger"},tag:Boolean,onCreate:Function,fallbackOption:{type:[Function,Boolean],default:void 0},show:{type:Boolean,default:void 0},showArrow:{type:Boolean,default:!0},maxTagCount:[Number,String],ellipsisTagPopoverProps:Object,consistentMenuWidth:{type:Boolean,default:!0},virtualScroll:{type:Boolean,default:!0},labelField:{type:String,default:"label"},valueField:{type:String,default:"value"},childrenField:{type:String,default:"children"},renderLabel:Function,renderOption:Function,renderTag:Function,"onUpdate:value":[Function,Array],inputProps:Object,nodeProps:Function,ignoreComposition:{type:Boolean,default:!0},showOnFocus:Boolean,onUpdateValue:[Function,Array],onBlur:[Function,Array],onClear:[Function,Array],onFocus:[Function,Array],onScroll:[Function,Array],onSearch:[Function,Array],onUpdateShow:[Function,Array],"onUpdate:show":[Function,Array],displayDirective:{type:String,default:"show"},resetMenuOnOptionsChange:{type:Boolean,default:!0},status:String,showCheckmark:{type:Boolean,default:!0},onChange:[Function,Array],items:Array}),pv=i.defineComponent({name:"Select",props:mv,slots:Object,setup(t){gv.NODE_ENV!=="production"&&i.watchEffect(()=>{t.items!==void 0&&jn("select","`items` is deprecated, please use `options` instead."),t.onChange!==void 0&&jn("select","`on-change` is deprecated, please use `on-update:value` instead.")});const{mergedClsPrefixRef:e,mergedBorderedRef:n,namespaceRef:r,inlineThemeDisabled:s}=gi(t),o=ut("Select","-select",dv,cv,t,e),a=i.ref(t.defaultValue),l=i.toRef(t,"value"),c=Ho(l,a),d=i.ref(!1),h=i.ref(""),u=jd(t,["items","options"]),m=i.ref([]),g=i.ref([]),f=i.computed(()=>g.value.concat(m.value).concat(u.value)),p=i.computed(()=>{const{filter:T}=t;if(T)return T;const{labelField:j,valueField:ne}=t;return(le,ce)=>{if(!ce)return!1;const pe=ce[j];if(typeof pe=="string")return ga(le,pe);const _e=ce[ne];return typeof _e=="string"?ga(le,_e):typeof _e=="number"?ga(le,String(_e)):!1}}),y=i.computed(()=>{if(t.remote)return u.value;{const{value:T}=f,{value:j}=h;return!j.length||!t.filterable?T:uv(T,p.value,j,t.childrenField)}}),b=i.computed(()=>{const{valueField:T,childrenField:j}=t,ne=hv(T,j);return H_(y.value,ne)}),_=i.computed(()=>fv(f.value,t.valueField,t.childrenField)),C=i.ref(!1),S=Ho(i.toRef(t,"show"),C),v=i.ref(null),B=i.ref(null),k=i.ref(null),{localeRef:R}=Qh("Select"),$=i.computed(()=>{var T;return(T=t.placeholder)!==null&&T!==void 0?T:R.value.placeholder}),P=[],I=i.ref(new Map),V=i.computed(()=>{const{fallbackOption:T}=t;if(T===void 0){const{labelField:j,valueField:ne}=t;return le=>({[j]:String(le),[ne]:le})}return T===!1?!1:j=>Object.assign(T(j),{value:j})});function A(T){const j=t.remote,{value:ne}=I,{value:le}=_,{value:ce}=V,pe=[];return T.forEach(_e=>{if(le.has(_e))pe.push(le.get(_e));else if(j&&ne.has(_e))pe.push(ne.get(_e));else if(ce){const xe=ce(_e);xe&&pe.push(xe)}}),pe}const L=i.computed(()=>{if(t.multiple){const{value:T}=c;return Array.isArray(T)?A(T):[]}return null}),D=i.computed(()=>{const{value:T}=c;return!t.multiple&&!Array.isArray(T)?T===null?null:A([T])[0]||null:null}),ee=xw(t),{mergedSizeRef:E,mergedDisabledRef:N,mergedStatusRef:H}=ee;function q(T,j){const{onChange:ne,"onUpdate:value":le,onUpdateValue:ce}=t,{nTriggerFormChange:pe,nTriggerFormInput:_e}=ee;ne&&ht(ne,T,j),ce&&ht(ce,T,j),le&&ht(le,T,j),a.value=T,pe(),_e()}function Y(T){const{onBlur:j}=t,{nTriggerFormBlur:ne}=ee;j&&ht(j,T),ne()}function F(){const{onClear:T}=t;T&&ht(T)}function M(T){const{onFocus:j,showOnFocus:ne}=t,{nTriggerFormFocus:le}=ee;j&&ht(j,T),le(),ne&&re()}function Z(T){const{onSearch:j}=t;j&&ht(j,T)}function fe(T){const{onScroll:j}=t;j&&ht(j,T)}function ie(){var T;const{remote:j,multiple:ne}=t;if(j){const{value:le}=I;if(ne){const{valueField:ce}=t;(T=L.value)===null||T===void 0||T.forEach(pe=>{le.set(pe[ce],pe)})}else{const ce=D.value;ce&&le.set(ce[t.valueField],ce)}}}function me(T){const{onUpdateShow:j,"onUpdate:show":ne}=t;j&&ht(j,T),ne&&ht(ne,T),C.value=T}function re(){N.value||(me(!0),C.value=!0,t.filterable&&Xn())}function Me(){me(!1)}function Ae(){h.value="",g.value=P}const Oe=i.ref(!1);function Le(){t.filterable&&(Oe.value=!0)}function pt(){t.filterable&&(Oe.value=!1,S.value||Ae())}function Zt(){N.value||(S.value?t.filterable?Xn():Me():re())}function Qt(T){var j,ne;!((ne=(j=k.value)===null||j===void 0?void 0:j.selfRef)===null||ne===void 0)&&ne.contains(T.relatedTarget)||(d.value=!1,Y(T),Me())}function St(T){M(T),d.value=!0}function At(){d.value=!0}function yt(T){var j;!((j=v.value)===null||j===void 0)&&j.$el.contains(T.relatedTarget)||(d.value=!1,Y(T),Me())}function pn(){var T;(T=v.value)===null||T===void 0||T.focus(),Me()}function Pn(T){var j;S.value&&(!((j=v.value)===null||j===void 0)&&j.$el.contains(dr(T))||Me())}function De(T){if(!Array.isArray(T))return[];if(V.value)return Array.from(T);{const{remote:j}=t,{value:ne}=_;if(j){const{value:le}=I;return T.filter(ce=>ne.has(ce)||le.has(ce))}else return T.filter(le=>ne.has(le))}}function ke(T){Ie(T.rawNode)}function Ie(T){if(N.value)return;const{tag:j,remote:ne,clearFilterAfterSelect:le,valueField:ce}=t;if(j&&!ne){const{value:pe}=g,_e=pe[0]||null;if(_e){const xe=m.value;xe.length?xe.push(_e):m.value=[_e],g.value=P}}if(ne&&I.value.set(T[ce],T),t.multiple){const pe=De(c.value),_e=pe.findIndex(xe=>xe===T[ce]);if(~_e){if(pe.splice(_e,1),j&&!ne){const xe=J(T[ce]);~xe&&(m.value.splice(xe,1),le&&(h.value=""))}}else pe.push(T[ce]),le&&(h.value="");q(pe,A(pe))}else{if(j&&!ne){const pe=J(T[ce]);~pe?m.value=[m.value[pe]]:m.value=P}Gi(),Me(),q(T[ce],T)}}function J(T){return m.value.findIndex(ne=>ne[t.valueField]===T)}function se(T){S.value||re();const{value:j}=T.target;h.value=j;const{tag:ne,remote:le}=t;if(Z(j),ne&&!le){if(!j){g.value=P;return}const{onCreate:ce}=t,pe=ce?ce(j):{[t.labelField]:j,[t.valueField]:j},{valueField:_e,labelField:xe}=t;u.value.some(Ye=>Ye[_e]===pe[_e]||Ye[xe]===pe[xe])||m.value.some(Ye=>Ye[_e]===pe[_e]||Ye[xe]===pe[xe])?g.value=P:g.value=[pe]}}function Ce(T){T.stopPropagation();const{multiple:j}=t;!j&&t.filterable&&Me(),F(),j?q([],[]):q(null,null)}function Jt(T){!cr(T,"action")&&!cr(T,"empty")&&!cr(T,"header")&&T.preventDefault()}function Ui(T){fe(T)}function wi(T){var j,ne,le,ce,pe;if(!t.keyboard){T.preventDefault();return}switch(T.key){case" ":if(t.filterable)break;T.preventDefault();case"Enter":if(!(!((j=v.value)===null||j===void 0)&&j.isComposing)){if(S.value){const _e=(ne=k.value)===null||ne===void 0?void 0:ne.getPendingTmNode();_e?ke(_e):t.filterable||(Me(),Gi())}else if(re(),t.tag&&Oe.value){const _e=g.value[0];if(_e){const xe=_e[t.valueField],{value:Ye}=c;t.multiple&&Array.isArray(Ye)&&Ye.includes(xe)||Ie(_e)}}}T.preventDefault();break;case"ArrowUp":if(T.preventDefault(),t.loading)return;S.value&&((le=k.value)===null||le===void 0||le.prev());break;case"ArrowDown":if(T.preventDefault(),t.loading)return;S.value?(ce=k.value)===null||ce===void 0||ce.next():re();break;case"Escape":S.value&&(yw(T),Me()),(pe=v.value)===null||pe===void 0||pe.focus();break}}function Gi(){var T;(T=v.value)===null||T===void 0||T.focus()}function Xn(){var T;(T=v.value)===null||T===void 0||T.focusInput()}function xi(){var T;S.value&&((T=B.value)===null||T===void 0||T.syncPosition())}ie(),i.watch(i.toRef(t,"options"),ie);const Ki={focus:()=>{var T;(T=v.value)===null||T===void 0||T.focus()},focusInput:()=>{var T;(T=v.value)===null||T===void 0||T.focusInput()},blur:()=>{var T;(T=v.value)===null||T===void 0||T.blur()},blurInput:()=>{var T;(T=v.value)===null||T===void 0||T.blurInput()}},en=i.computed(()=>{const{self:{menuBoxShadow:T}}=o.value;return{"--n-menu-box-shadow":T}}),Fn=s?mi("select",void 0,en,t):void 0;return Object.assign(Object.assign({},Ki),{mergedStatus:H,mergedClsPrefix:e,mergedBordered:n,namespace:r,treeMate:b,isMounted:fs(),triggerRef:v,menuRef:k,pattern:h,uncontrolledShow:C,mergedShow:S,adjustedTo:kn(t),uncontrolledValue:a,mergedValue:c,followerRef:B,localizedPlaceholder:$,selectedOption:D,selectedOptions:L,mergedSize:E,mergedDisabled:N,focused:d,activeWithoutMenuOpen:Oe,inlineThemeDisabled:s,onTriggerInputFocus:Le,onTriggerInputBlur:pt,handleTriggerOrMenuResize:xi,handleMenuFocus:At,handleMenuBlur:yt,handleMenuTabOut:pn,handleTriggerClick:Zt,handleToggle:ke,handleDeleteOption:Ie,handlePatternInput:se,handleClear:Ce,handleTriggerBlur:Qt,handleTriggerFocus:St,handleKeydown:wi,handleMenuAfterLeave:Ae,handleMenuClickOutside:Pn,handleMenuScroll:Ui,handleMenuKeydown:wi,handleMenuMousedown:Jt,mergedTheme:o,cssVars:s?void 0:en,themeClass:Fn==null?void 0:Fn.themeClass,onRender:Fn==null?void 0:Fn.onRender})},render(){return i.h("div",{class:`${this.mergedClsPrefix}-select`},i.h(Ud,null,{default:()=>[i.h(Gd,null,{default:()=>i.h(av,{ref:"triggerRef",inlineThemeDisabled:this.inlineThemeDisabled,status:this.mergedStatus,inputProps:this.inputProps,clsPrefix:this.mergedClsPrefix,showArrow:this.showArrow,maxTagCount:this.maxTagCount,ellipsisTagPopoverProps:this.ellipsisTagPopoverProps,bordered:this.mergedBordered,active:this.activeWithoutMenuOpen||this.mergedShow,pattern:this.pattern,placeholder:this.localizedPlaceholder,selectedOption:this.selectedOption,selectedOptions:this.selectedOptions,multiple:this.multiple,renderTag:this.renderTag,renderLabel:this.renderLabel,filterable:this.filterable,clearable:this.clearable,disabled:this.mergedDisabled,size:this.mergedSize,theme:this.mergedTheme.peers.InternalSelection,labelField:this.labelField,valueField:this.valueField,themeOverrides:this.mergedTheme.peerOverrides.InternalSelection,loading:this.loading,focused:this.focused,onClick:this.handleTriggerClick,onDeleteOption:this.handleDeleteOption,onPatternInput:this.handlePatternInput,onClear:this.handleClear,onBlur:this.handleTriggerBlur,onFocus:this.handleTriggerFocus,onKeydown:this.handleKeydown,onPatternBlur:this.onTriggerInputBlur,onPatternFocus:this.onTriggerInputFocus,onResize:this.handleTriggerOrMenuResize,ignoreComposition:this.ignoreComposition},{arrow:()=>{var t,e;return[(e=(t=this.$slots).arrow)===null||e===void 0?void 0:e.call(t)]}})}),i.h(dh,{ref:"followerRef",show:this.mergedShow,to:this.adjustedTo,teleportDisabled:this.adjustedTo===kn.tdkey,containerClass:this.namespace,width:this.consistentMenuWidth?"target":void 0,minWidth:"target",placement:this.placement},{default:()=>i.h(i.Transition,{name:"fade-in-scale-up-transition",appear:this.isMounted,onAfterLeave:this.handleMenuAfterLeave},{default:()=>{var t,e,n;return this.mergedShow||this.displayDirective==="show"?((t=this.onRender)===null||t===void 0||t.call(this),i.withDirectives(i.h(Vx,Object.assign({},this.menuProps,{ref:"menuRef",onResize:this.handleTriggerOrMenuResize,inlineThemeDisabled:this.inlineThemeDisabled,virtualScroll:this.consistentMenuWidth&&this.virtualScroll,class:[`${this.mergedClsPrefix}-select-menu`,this.themeClass,(e=this.menuProps)===null||e===void 0?void 0:e.class],clsPrefix:this.mergedClsPrefix,focusable:!0,labelField:this.labelField,valueField:this.valueField,autoPending:!0,nodeProps:this.nodeProps,theme:this.mergedTheme.peers.InternalSelectMenu,themeOverrides:this.mergedTheme.peerOverrides.InternalSelectMenu,treeMate:this.treeMate,multiple:this.multiple,size:this.menuSize,renderOption:this.renderOption,renderLabel:this.renderLabel,value:this.mergedValue,style:[(n=this.menuProps)===null||n===void 0?void 0:n.style,this.cssVars],onToggle:this.handleToggle,onScroll:this.handleMenuScroll,onFocus:this.handleMenuFocus,onBlur:this.handleMenuBlur,onKeydown:this.handleMenuKeydown,onTabOut:this.handleMenuTabOut,onMousedown:this.handleMenuMousedown,show:this.mergedShow,showCheckmark:this.showCheckmark,resetMenuOnOptionsChange:this.resetMenuOnOptionsChange}),{empty:()=>{var r,s;return[(s=(r=this.$slots).empty)===null||s===void 0?void 0:s.call(r)]},header:()=>{var r,s;return[(s=(r=this.$slots).header)===null||s===void 0?void 0:s.call(r)]},action:()=>{var r,s;return[(s=(r=this.$slots).action)===null||s===void 0?void 0:s.call(r)]}}),this.displayDirective==="show"?[[i.vShow,this.mergedShow],[us,this.handleMenuClickOutside,void 0,{capture:!0}]]:[[us,this.handleMenuClickOutside,void 0,{capture:!0}]])):null}})})]}))}}),yv={},bu=i.defineComponent({...yv,__name:"searchable-reference-select",props:{searchDataHandler:{},optionsListConverter:{},renderLabel:{},renderTag:{},value:{},clearable:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},minTermLength:{default:()=>{var t;return((t=G.AppConfigProvider.getConfig())==null?void 0:t.minLength.searchTerm)??3}},consistentMenuWidth:{type:Boolean,default:!1},wrapContent:{type:Boolean,default:!1},placeholder:{default:""}},emits:["update:value"],setup(t,{expose:e,emit:n}){const r=t,s=n,o=i.computed(()=>O.isArray(r.value)),a=i.computed(()=>o.value?r.value.map(_=>_.id):r.value?r.value.id:null),l=i.ref(o.value?r.optionsListConverter(r.value):r.value?r.optionsListConverter([r.value]):[]),c=i.computed(()=>l.value.map(_=>({..._,class:r.wrapContent?`${_.class} consistent-menu-width`:_.class}))),d=i.ref(!1),h=i.useTemplateRef("select-component"),u=_=>{_.length<r.minTermLength||(d.value=!0,r.searchDataHandler(_,d).then(C=>{if(O.isEmpty(C))return;const S=o.value?r.value:r.value?[r.value]:[],v=C.filter(B=>!S.some(k=>k.id===B.id));l.value=r.optionsListConverter([...S,...v])}).finally(()=>{d.value=!1}))};let m="";const g=O.debounce(()=>u(m),800),f=_=>{m=_,g()},p=_=>{var C;if(O.isArray(_)){const S=_.length>0?_.map(v=>{var B;return i.toRaw((B=l.value.find(k=>k.value===v))==null?void 0:B.item)}):[];s("update:value",S)}else if(_>0){const S=i.toRaw((C=l.value.find(v=>v.value===_))==null?void 0:C.item);s("update:value",S)}else s("update:value",null)};return e({focus:()=>{var _;return(_=h.value)==null?void 0:_.focusInput()},blur:()=>{var _;return(_=h.value)==null?void 0:_.blurInput()}}),(_,C)=>(i.openBlock(),i.createBlock(i.unref(pv),{ref:"select-component","clear-filter-after-select":!0,clearable:t.clearable,"consistent-menu-width":t.consistentMenuWidth,disabled:t.disabled,filterable:!0,loading:d.value,multiple:o.value,options:c.value,placeholder:t.placeholder,remote:!0,value:a.value,"render-label":t.renderLabel,"render-tag":t.renderTag,onSearch:f,"onUpdate:value":p},null,8,["clearable","consistent-menu-width","disabled","loading","multiple","options","placeholder","value","render-label","render-tag"]))}}),bv={},_u=i.defineComponent({...bv,__name:"searchable-product-select",props:{renderLabel:{},renderTag:{},value:{},clearable:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},minTermLength:{default:()=>{var t;return((t=G.AppConfigProvider.getConfig())==null?void 0:t.minLength.searchTerm)??3}},consistentMenuWidth:{type:Boolean,default:!1},wrapContent:{type:Boolean,default:!1},placeholder:{default:""},searchType:{}},emits:["update:value"],setup(t,{expose:e,emit:n}){const r=t,s=n,o=i.useTemplateRef("select-component"),a=async u=>r.searchType==="categories"?G.HttpRequester.getInstance(G.ProductCategoryDataProvider).publicSimpleSearch(u):r.searchType==="products"?G.HttpRequester.getInstance(G.ProductDataProvider).publicSimpleSearch(u):new Promise(m=>{m([])}),l=u=>r.searchType==="categories"?zt.convertReferencesToSelectOptionsList(u,!0,!1,!1,m=>m!=null&&m.isNewRec()?"-":m.name):r.searchType==="products"?zt.convertReferencesToSelectOptionsList(u,!0,!1,!1,m=>m!=null&&m.isNewRec()?"-":`[${m.code}] ${m.name}`):[],c=(u,m)=>{if(r.renderLabel)return r.renderLabel(u,m);if(r.searchType==="products"){const g=u.item;return i.h("div",{},[i.h("span",{class:"text-sc-grey mr-2.5"},g.code),i.h("span",{},[g.name])])}if(r.searchType==="categories"){const g=u.item;return i.h("div",{},[g.name])}};return e({focus:()=>{var u;return(u=o.value)==null?void 0:u.focus()},blur:()=>{var u;return(u=o.value)==null?void 0:u.blur()}}),(u,m)=>(i.openBlock(),i.createBlock(bu,{ref:"select-component",value:t.value,clearable:t.clearable,disabled:t.disabled,placeholder:t.placeholder,"search-data-handler":a,"options-list-converter":l,"consistent-menu-width":t.consistentMenuWidth,"wrap-content":t.wrapContent,"min-term-length":t.minTermLength,"render-label":c,"render-tag":t.renderTag,"onUpdate:value":m[0]||(m[0]=g=>s("update:value",g))},null,8,["value","clearable","disabled","placeholder","consistent-menu-width","wrap-content","min-term-length","render-tag"]))}}),_v={class:"col-span-2 flex flex-row gap-2.5"},wv={class:"flex-1"},xv={class:"text-sc-grey"},vv={class:"ml-2.5"},kv={key:0,class:"flex-none"},Cv={},Sv=i.defineComponent({...Cv,__name:"products-list",props:{value:{},searchType:{},minTermLength:{default:()=>{var t;return((t=G.AppConfigProvider.getConfig())==null?void 0:t.minLength.searchTerm)??3}},disabled:{type:Boolean}},emits:["update:value"],setup(t,{emit:e}){const n=t,r=e,s=i.ref(null),o=()=>structuredClone(i.toRaw(n.value)),a=i.ref(o()),l=()=>{r("update:value",a.value.map(u=>i.toRaw(u)))},c=u=>{u&&(a.value=[...a.value.map(m=>i.toRaw(m)),...(O.isArray(u)?u:[u]).filter(m=>!a.value.some(g=>g.id===m.id))],i.nextTick(()=>{s.value=null}),l())},d=u=>{u&&(a.value=a.value.map(m=>m.id===u.id?u:i.toRaw(m)),l())},h=u=>{a.value=a.value.filter(m=>m.id!==u.id),l()};return i.watch(()=>n.value,()=>{a.value=o()}),(u,m)=>{const g=z.NListItem,f=e_,p=z.NButton,y=z.NList;return i.openBlock(),i.createBlock(y,{"show-divider":!1,hoverable:!0},{header:i.withCtx(()=>[i.renderSlot(u.$slots,"header")]),footer:i.withCtx(()=>[i.createVNode(_u,{value:s.value,"onUpdate:value":[m[0]||(m[0]=b=>s.value=b),c],clearable:!0,disabled:t.disabled,"min-term-length":t.minTermLength,"search-type":t.searchType,placeholder:"Введите название"},null,8,["value","disabled","min-term-length","search-type"])]),default:i.withCtx(()=>[a.value.length===0?(i.openBlock(),i.createBlock(g,{key:0,class:"text-center text-sm text-gray-600"},{default:i.withCtx(()=>[...m[1]||(m[1]=[i.createTextVNode(" --- Список пуст --- ",-1)])]),_:1})):i.createCommentVNode("",!0),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(a.value,b=>(i.openBlock(),i.createBlock(g,{key:b.id},{suffix:i.withCtx(()=>[i.createVNode(p,{disabled:t.disabled,quaternary:"",type:"error",onClick:_=>h(b)},{default:i.withCtx(()=>[i.createVNode(f)]),_:1},8,["disabled","onClick"])]),default:i.withCtx(()=>[i.createElementVNode("div",_v,[i.createElementVNode("span",wv,[i.createElementVNode("span",xv,i.toDisplayString(b.code),1),i.createElementVNode("span",vv,i.toDisplayString(b.name),1)]),u.$slots["item-extra"]?(i.openBlock(),i.createElementBlock("div",kv,[i.renderSlot(u.$slots,"item-extra",{item:b,updateItemCallback:d})])):i.createCommentVNode("",!0)])]),_:2},1024))),128))]),_:3})}}}),Bv={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Tv(t,e){return i.openBlock(),i.createElementBlock("svg",Bv,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"currentColor",d:"M13 4a1 1 0 0 1 1 1h4a1 1 0 0 1 .783.378l.074.108l3 5l.055.103l.04.107l.029.109l.016.11L22 11v6a1 1 0 0 1-1 1h-1.171a3.001 3.001 0 0 1-5.658 0H9.829a3.001 3.001 0 0 1-5.658 0H3a1 1 0 0 1-1-1V6a2 2 0 0 1 2-2zM7 16a1 1 0 1 0 0 2a1 1 0 0 0 0-2m10 0a1 1 0 1 0 0 2a1 1 0 0 0 0-2m.434-9H14v3h5.234z"},null,-1)])])}const Rv=i.markRaw({name:"tabler-truck-filled",render:Tv}),$v={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Ev(t,e){return i.openBlock(),i.createElementBlock("svg",$v,[...e[0]||(e[0]=[i.createElementVNode("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[i.createElementVNode("path",{d:"M5 17a2 2 0 1 0 4 0a2 2 0 1 0-4 0m10 0a2 2 0 1 0 4 0a2 2 0 1 0-4 0"}),i.createElementVNode("path",{d:"M5 17H3v-4M2 5h11v12m-4 0h6m4 0h2v-6h-8m0-5h5l3 5M3 9h4"})],-1)])])}const Nv=i.markRaw({name:"tabler-truck-delivery",render:Ev}),Pv={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Fv(t,e){return i.openBlock(),i.createElementBlock("svg",Pv,[...e[0]||(e[0]=[i.createElementVNode("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[i.createElementVNode("path",{d:"M2 3h1a2 2 0 0 1 2 2v10a2 2 0 0 0 2 2h15"}),i.createElementVNode("path",{d:"M9 9a3 3 0 0 1 3-3h4a3 3 0 0 1 3 3v2a3 3 0 0 1-3 3h-4a3 3 0 0 1-3-3zM7 19a2 2 0 1 0 4 0a2 2 0 1 0-4 0m9 0a2 2 0 1 0 4 0a2 2 0 1 0-4 0"})],-1)])])}const Mv=i.markRaw({name:"tabler-truck-loading",render:Fv}),Av={class:"flex flex-col gap-1"},Vv={key:0,class:"flex flex-row gap-1 text-base"},Ov={key:1,class:"text-sc-dark-grey text-sm"},Iv={class:"text-sc-grey mr-1.5"},zv={key:0},Lv={key:1},Dv={key:2},Hv={},Ts=i.defineComponent({...Hv,__name:"order-delivery-label",props:{delivery:{},showType:{type:Boolean,default:!0},showDetails:{type:Boolean,default:!0}},setup(t){const e=i.computed(()=>{var s;return(s=G.useReferencesStore().deliveryTypeReference)==null?void 0:s.find(o=>o.id===r.delivery.type)}),n=i.computed(()=>Mn.format(r.delivery.date,"dd.MM.yyyy")),r=t;return(s,o)=>{var d,h,u,m,g,f,p,y;const a=Mv,l=Nv,c=Rv;return i.openBlock(),i.createElementBlock("div",Av,[t.showType?(i.openBlock(),i.createElementBlock("span",Vv,[((d=e.value)==null?void 0:d.slug)==="self_delivery"?(i.openBlock(),i.createBlock(a,{key:0})):i.createCommentVNode("",!0),((h=e.value)==null?void 0:h.slug)==="delivery"?(i.openBlock(),i.createBlock(l,{key:1})):i.createCommentVNode("",!0),((u=e.value)==null?void 0:u.slug)==="transport_company_delivery"?(i.openBlock(),i.createBlock(c,{key:2})):i.createCommentVNode("",!0),i.createElementVNode("span",null,i.toDisplayString((m=e.value)==null?void 0:m.name),1)])):i.createCommentVNode("",!0),t.showDetails?(i.openBlock(),i.createElementBlock("span",Ov,[i.createElementVNode("span",Iv,i.toDisplayString(n.value),1),(f=(g=t.delivery)==null?void 0:g.address)!=null&&f.address?(i.openBlock(),i.createElementBlock("span",zv,i.toDisplayString(t.delivery.address.address),1)):i.createCommentVNode("",!0),(y=(p=t.delivery)==null?void 0:p.warehouse)!=null&&y.address?(i.openBlock(),i.createElementBlock("span",Lv,"со склада "+i.toDisplayString(t.delivery.warehouse.address),1)):(i.openBlock(),i.createElementBlock("span",Dv,"(не указано)"))])):i.createCommentVNode("",!0)])}}}),Wv={class:"flex flex-col gap-2.5"},jv={class:"text-base"},qv=["href"],Xv={class:"text-sc-grey"},Yv={},wu=i.defineComponent({...Yv,__name:"order-common-info",props:{order:{},fields:{},orderUrl:{}},setup(t){const e=t,n=i.computed(()=>e.fields.includes(Ke.Id)?e.order.id:void 0),r=i.computed(()=>{var l,c;return e.fields.includes(Ke.Status)?(c=(l=G.useReferencesStore().orderStatusReference)==null?void 0:l.find(d=>d.id===(e.order.status??-1)))==null?void 0:c.name:void 0}),s=i.computed(()=>e.fields.includes(Ke.CreatedAt)),o=i.computed(()=>e.fields.includes(Ke.ClientInfo)?e.order.client:void 0),a=i.computed(()=>e.fields.includes(Ke.DeliveryInfo)?e.order.delivery:void 0);return(l,c)=>(i.openBlock(),i.createElementBlock("div",Wv,[i.createElementVNode("span",jv,[n.value?(i.openBlock(),i.createElementBlock("a",{key:0,href:t.orderUrl.replace(":id",t.order.id.toString()),target:"_blank",class:"text-sc-dark-grey"}," #"+i.toDisplayString(n.value),9,qv)):i.createCommentVNode("",!0),s.value?(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[c[0]||(c[0]=i.createTextVNode(" от ",-1)),i.createVNode(Po,{date:t.order.createdAt,"is-time-secondary":!0},null,8,["date"])],64)):i.createCommentVNode("",!0),r.value?(i.openBlock(),i.createElementBlock(i.Fragment,{key:2},[c[1]||(c[1]=i.createTextVNode(" - ",-1)),i.createElementVNode("span",Xv,i.toDisplayString(r.value),1)],64)):i.createCommentVNode("",!0)]),o.value?(i.openBlock(),i.createBlock(os,{key:0,client:o.value,class:"ml-3"},null,8,["client"])):i.createCommentVNode("",!0),a.value?(i.openBlock(),i.createBlock(Ts,{key:1,delivery:a.value,class:"ml-3"},null,8,["delivery"])):i.createCommentVNode("",!0)]))}}),Uv={},xu=i.defineComponent({...Uv,__name:"order-payment",props:{payment:{}},setup(t){const e=t,n=i.computed(()=>{var r;return(r=G.useReferencesStore().paymentTypeReference)==null?void 0:r.find(s=>s.id===e.payment.type)});return(r,s)=>{var o;return i.openBlock(),i.createElementBlock("span",null,i.toDisplayString(((o=n.value)==null?void 0:o.name)??"-"),1)}}}),Gv={class:"flex flex-row gap-1.5"},Kv={class:"flex-none text-nowrap"},Zv={class:"flex flex-1 flex-col"},Qv={class:"mt-2.5 grid grid-flow-col grid-rows-2 gap-1 text-base"},Jv={key:0},ek={key:1},tk={},vu=i.defineComponent({...tk,__name:"order-product-info",props:{product:{},index:{}},setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock("div",Gv,[i.createElementVNode("span",Kv,i.toDisplayString(t.index+1)+".",1),i.createElementVNode("div",Zv,[i.createVNode(tr,{product:t.product.product,"show-planning-dates":!1},null,8,["product"]),i.createElementVNode("div",Qv,[n[0]||(n[0]=i.createElementVNode("span",null,"Кол-во",-1)),t.product.product.getIsMeasurable()?(i.openBlock(),i.createElementBlock("span",Jv,i.toDisplayString(`${t.product.length} ${t.product.product.unit} x ${t.product.quantity} шт.`),1)):(i.openBlock(),i.createElementBlock("span",ek,i.toDisplayString(`${t.product.quantity} ${t.product.product.unit}`),1)),n[1]||(n[1]=i.createElementVNode("span",null,"Цена за ед.",-1)),i.createElementVNode("span",null,i.toDisplayString(`${t.product.costOneRub.toLocaleString("ru-ru",{minimumFractionDigits:2})} ${t.product.currency}`),1),n[2]||(n[2]=i.createElementVNode("span",null,"Сумма",-1)),i.createElementVNode("span",null,i.toDisplayString(`${t.product.cost.toLocaleString("ru-ru",{minimumFractionDigits:2})} ${t.product.currency}`),1)])])]))}}),nk={},ik=i.defineComponent({...nk,__name:"order-items-list",props:{order:{}},setup(t){const e=()=>{const s=[{title:"№ п.п.",key:"id",resizable:!0,width:50,render:(o,a)=>i.h("span",{class:"text-base"},[a+1,"."])},{title:"Артикул",key:"codeNumber",resizable:!0,minWidth:120,render:o=>i.h("span",{class:"text-base"},[o.product.code])},{title:"Наименование",key:"name",resizable:!0,render:o=>i.h(tr,{product:o.product,showCode:!1,showPlanningDates:!1})},{title:"Кол-во",key:"quantity",resizable:!0,minWidth:100,render:o=>i.h("span",{class:"text-nowrap text-base"},o.product.getIsMeasurable()?[`${o.length} ${o.product.unit} x ${o.quantity} шт.`]:[`${o.quantity} ${o.product.unit}`])},{title:"Цена за ед.",key:"costOneRub",resizable:!0,minWidth:100,render:o=>i.h("span",{class:"text-base"},[`${o.costOneRub.toLocaleString("ru-ru",{minimumFractionDigits:2})} ${o.currency}`])},{title:"Сумма",key:"cost",resizable:!0,minWidth:100,render:o=>i.h("span",{class:"text-base"},[`${o.cost.toLocaleString("ru-ru",{minimumFractionDigits:2})} ${o.currency}`])}];switch(bt.getDeviceTypeByResolution()){case Ue.phone:case Ue.tablet:return[{title:"",key:"items",resizable:!0,render:(o,a)=>i.h(vu,{product:o,index:a})}];case Ue.laptop:return s;default:return s}},n=i.ref(e()),r=()=>{n.value=e()};return i.onMounted(()=>{r(),window.addEventListener("resize",r)}),i.onUnmounted(()=>{window.removeEventListener("resize",r)}),(s,o)=>{const a=z.NDataTable;return i.openBlock(),i.createElementBlock(i.Fragment,null,[o[0]||(o[0]=i.createElementVNode("h3",null,"Список позиций",-1)),i.createVNode(a,{columns:n.value,data:t.order.products,"row-key":l=>l.id,"bottom-bordered":!1,bordered:!1},null,8,["columns","data","row-key"])],64)}}}),ku=Zn(ik,[["__scopeId","data-v-b15b9b70"]]),rk={class:"text-base"},sk={},ma=i.defineComponent({...sk,__name:"user-short-info",props:{user:{},showUserType:{type:Boolean,default:!0},extraInfoOnSecondLine:{type:Boolean,default:!0}},setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass({"flex flex-col":t.showUserType&&t.extraInfoOnSecondLine})},[i.createElementVNode("span",rk,i.toDisplayString(t.user.name),1),t.showUserType?(i.openBlock(),i.createElementBlock("span",{key:0,class:i.normalizeClass([{"ml-1":!t.extraInfoOnSecondLine},"text-sc-grey"])}," ["+i.toDisplayString(t.user.type)+"] ",3)):i.createCommentVNode("",!0)],2))}}),ok={class:"ml-4 grid grid-cols-3 gap-1.5 text-base"},ak={class:"col-span-2"},lk={class:"col-span-2"},ck={class:"btn btn-primary",href:"{{ invoice }}"},dk={},Cu=i.defineComponent({...dk,__name:"order-details",props:{order:{}},setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock("div",null,[n[11]||(n[11]=i.createElementVNode("h3",null,"Детали заказа",-1)),i.createElementVNode("div",ok,[t.order.creator.id!==t.order.client.id?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[n[0]||(n[0]=i.createElementVNode("span",null,"Создал",-1)),i.createVNode(ma,{user:t.order.creator,class:"col-span-2"},null,8,["user"])],64)):i.createCommentVNode("",!0),n[10]||(n[10]=i.createElementVNode("span",null,"Клиент",-1)),i.createVNode(os,{client:t.order.client,class:"col-span-2"},null,8,["client"]),t.order.contragent?(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[n[1]||(n[1]=i.createElementVNode("span",null,"Контрагент",-1)),i.createVNode(Sd,{contragent:t.order.contragent,class:"col-span-2"},null,8,["contragent"])],64)):i.createCommentVNode("",!0),t.order.image?(i.openBlock(),i.createElementBlock(i.Fragment,{key:2},[n[2]||(n[2]=i.createElementVNode("span",null,"Графический файл клиента",-1)),n[3]||(n[3]=i.createElementVNode("a",{class:"fancybox col-span-2",href:"{{ order.image }}"}," Посмотреть ",-1))],64)):i.createCommentVNode("",!0),t.order.barcode?(i.openBlock(),i.createElementBlock(i.Fragment,{key:3},[n[4]||(n[4]=i.createElementVNode("span",null,"Штрих-код",-1)),i.createElementVNode("span",ak,i.toDisplayString(t.order.barcode),1)],64)):i.createCommentVNode("",!0),t.order.payment?(i.openBlock(),i.createElementBlock(i.Fragment,{key:4},[n[5]||(n[5]=i.createElementVNode("span",null,"Оплата",-1)),i.createVNode(xu,{payment:t.order.payment,class:"col-span-2"},null,8,["payment"])],64)):i.createCommentVNode("",!0),t.order.delivery?(i.openBlock(),i.createElementBlock(i.Fragment,{key:5},[n[6]||(n[6]=i.createElementVNode("span",null,"Доставка",-1)),i.createVNode(Ts,{delivery:t.order.delivery,class:"col-span-2"},null,8,["delivery"])],64)):i.createCommentVNode("",!0),t.order.comment?(i.openBlock(),i.createElementBlock(i.Fragment,{key:6},[n[7]||(n[7]=i.createElementVNode("span",null,"Комментарий",-1)),i.createElementVNode("span",lk,i.toDisplayString(t.order.comment),1)],64)):i.createCommentVNode("",!0),t.order.attachedUser?(i.openBlock(),i.createElementBlock(i.Fragment,{key:7},[n[8]||(n[8]=i.createElementVNode("span",null,"Закреплен за",-1)),i.createVNode(ma,{user:t.order.attachedUser,class:"col-span-2"},null,8,["user"])],64)):i.createCommentVNode("",!0),t.order.invoices&&t.order.invoices.length>0?(i.openBlock(),i.createElementBlock(i.Fragment,{key:8},[n[9]||(n[9]=i.createElementVNode("span",null,"Прикрепленные счета",-1)),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(t.order.invoices,(r,s)=>(i.openBlock(),i.createElementBlock("div",{key:s,class:"col-span-2"},[i.createElementVNode("a",ck," Скачать счет №"+i.toDisplayString(s+1),1)]))),128))],64)):i.createCommentVNode("",!0)])]))}}),hk={key:0},uk={class:"text-sc-dark-grey my-2 text-center"},fk={key:1,class:"text-sc-dark-grey my-2 text-center"},gk={key:2},mk={class:"text-sc-dark-grey mt-4 text-right font-bold"},pk={class:"text-sc-primary"},yk={},Su=i.defineComponent({...yk,__name:"order-info",props:{order:{}},setup(t){const e=t,n=i.ref(!1),r=i.ref(new G.Order(e.order)),s=()=>{n.value=!0,G.HttpRequester.getInstance(G.OrdersDataProvider).getOrder(e.order.id).then(a=>{r.value=a}).finally(()=>{n.value=!1})},o=i.computed(()=>(r.value.products??[]).reduce((a,l)=>a+l.costRub,0).toLocaleString("ru-ru",{minimumFractionDigits:2}));return i.onMounted(()=>{s()}),(a,l)=>{const c=z.NSpin;return n.value?(i.openBlock(),i.createElementBlock("div",hk,[i.createElementVNode("div",uk,[i.createVNode(c,{size:"small",class:"mb-2.5 align-middle"}),l[0]||(l[0]=i.createElementVNode("div",null,[i.createElementVNode("span",null,"Загрузка данных ...")],-1))])])):r.value.products.length===0?(i.openBlock(),i.createElementBlock("div",fk," --- Не удалось загрузить данные о заказе --- ")):(i.openBlock(),i.createElementBlock("div",gk,[i.createVNode(ku,{order:r.value},null,8,["order"]),i.createElementVNode("div",mk,[l[1]||(l[1]=i.createTextVNode(" ИТОГО: ",-1)),i.createElementVNode("span",pk,i.toDisplayString(o.value)+" ₽",1)]),i.createVNode(Cu,{order:r.value},null,8,["order"])]))}}}),bk={},_k=i.defineComponent({...bk,__name:"orders-list",props:{fields:{},orderUrl:{},filters:{},sort:{},pagination:{}},setup(t){const e=t,n=()=>structuredClone(i.toRaw(e.sort??{field:"id",direction:"desc"})),r=i.ref(n()),s=i.ref([]),o=i.ref(!1),a=i.computed(()=>G.useReferencesStore().orderStatusReference),l=()=>{const p=e.fields.length>0?e.fields:[Ke.CreatedAt,Ke.Id,Ke.DeliveryInfo,Ke.Status,Ke.SalesDirections,Ke.AttachedUser],y={title:"???",key:"undefined",render:()=>i.h("span",{},["--- unknown ---"])},b={type:"expand",expandable:O.constant(!0),renderExpand:C=>i.h(Su,{order:C,class:"pl-10 pt-3 pb-10"}),width:"30"},_=[{title:"Дата заказа",key:Ke.CreatedAt,resizable:!0,minWidth:100,render:C=>i.h(Po,{date:C.createdAt,isTimeSecondary:!0,isTimeOnSecondLine:!0,class:"text-base"})},{title:"Номер заказа",key:Ke.Id,resizable:!0,minWidth:70,render:C=>i.h("a",{href:e.orderUrl.replace(":id",C.id.toString()),target:"_blank",class:"text-base"},C.id)},{title:"Клиент",key:Ke.ClientInfo,resizable:!0,render:C=>i.h(os,{client:C.client})},{title:"Тип доставки",key:Ke.DeliveryInfo,resizable:!0,render:C=>i.h(Ts,{delivery:C.delivery})},{title:"Статус",key:Ke.Status,resizable:!0,minWidth:90,render:C=>{var S,v;return i.h("span",{class:"text-base"},[((v=(S=a.value)==null?void 0:S.find(B=>B.id===(C.status??-1)))==null?void 0:v.name)??""])}},{title:"Напр. продаж",key:Ke.SalesDirections,resizable:!0,minWidth:70,render:C=>i.h("span",{class:"text-base"},[C.salesDirection.name])},{title:"Закреплено за",key:Ke.AttachedUser,resizable:!0,render:C=>{var S;return i.h("span",{class:"text-base"},[(S=C==null?void 0:C.attachedUser)==null?void 0:S.name])}}];switch(bt.getDeviceTypeByResolution()){case Ue.phone:case Ue.tablet:return[b,{key:"order",title:"Заказ",resizable:!0,render:C=>i.h(wu,{order:C,fields:p,orderUrl:e.orderUrl})}];case Ue.laptop:return[b,...p.map(C=>_.find(S=>S.key===C)??y)];default:return[y]}},c=i.ref(l()),d=i.ref(new G.DataTablePagination(e.pagination??{page:1,pageSize:10,itemCount:0,pageCount:1,pageSlot:5,pageSizes:[10,15,25],showSizePicker:!1})),h=()=>{e.filters&&(o.value=!0,G.HttpRequester.getInstance(G.OrdersDataProvider).getOrders(e.filters,r.value,{page:d.value.page,pageSize:d.value.pageSize}).then(p=>{d.value.itemCount!==p.meta.total&&(d.value.itemCount=p.meta.total),d.value.page!==p.meta.currentPage&&(d.value.page=p.meta.currentPage),d.value.pageCount!==p.meta.lastPage&&(d.value.pageCount=p.meta.lastPage),d.value.pageSize!==p.meta.perPage&&(d.value.pageSize=p.meta.perPage),s.value=p.data}).finally(()=>{o.value=!1}))},u=p=>{d.value.page=p,h()},m=p=>{d.value.pageSize=p,h()},g=p=>{O.isNull(p)?r.value=n():(r.value.field=p.columnKey.toString(),r.value.direction=p.order==="ascend"?"asc":"desc"),c.value.forEach(y=>{if(Object.hasOwn(y,"sortOrder")){const b=y;b.sortOrder=b.key===(p==null?void 0:p.columnKey)&&(p!=null&&p.sorter)&&p.order!==!1?p.order:!1}}),h()},f=()=>{c.value=l()};return i.watch(()=>e.filters,()=>{h()}),i.watch(()=>e.sort,()=>{r.value=n(),h()}),i.onMounted(()=>{f(),window.addEventListener("resize",f),i.nextTick(()=>{h()})}),i.onUnmounted(()=>{window.removeEventListener("resize",f)}),(p,y)=>{const b=z.NDataTable;return i.openBlock(),i.createBlock(b,{columns:c.value,data:s.value,"row-key":_=>_.id,pagination:d.value,loading:o.value,remote:!0,bordered:!1,"bottom-bordered":!1,"sticky-expanded-rows":!0,"pagination-behavior-on-filter":"first","onUpdate:page":u,"onUpdate:pageSize":m,"onUpdate:sorter":g},null,8,["columns","data","row-key","pagination","loading"])}}}),wk=Zn(_k,[["__scopeId","data-v-7c4554f4"]]),xk=["href"],vk={class:"text-sc-dark-grey"},kk={},Ck=i.defineComponent({...kk,__name:"short-text-order-info",props:{order:{},orderLink:{}},emits:["click:order-id"],setup(t,{emit:e}){const n=t,r=e,s=i.computed(()=>Mn.format(n.order.createdAt,G.AppConfigProvider.getConfig().dateFormats.uiDateWithTime)),o=a=>{O.isNil(n.orderLink)&&(a.preventDefault(),a.stopPropagation()),r("click:order-id",n.order,a)};return(a,l)=>(i.openBlock(),i.createElementBlock(i.Fragment,null,[i.createElementVNode("span",null,[l[1]||(l[1]=i.createTextVNode(" #",-1)),i.createElementVNode("a",{href:t.orderLink??"#",onClick:l[0]||(l[0]=c=>o(c))},i.toDisplayString(t.order.id),9,xk),i.createTextVNode(" от "+i.toDisplayString(s.value),1),t.order.isApproved1c?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[i.createTextVNode(" (подтверждён)")],64)):i.createCommentVNode("",!0)]),l[2]||(l[2]=i.createTextVNode(", ",-1)),i.createElementVNode("span",vk,"автор: "+i.toDisplayString(t.order.creator.name)+" ["+i.toDisplayString(t.order.creator.type)+"]",1)],64))}}),Sk={class:"sc-page flex flex-col"},Bk={class:"my-2 flex flex-row items-end"},Tk={class:"sc-title grow"},Rk={key:0,class:"sc-title-buttons flex-1 grow-0"},$k={class:"flex flex-col justify-end gap-1 sm:mt-0 sm:flex-row"},Ek={key:0,class:"sc-title-extra mt-2 sm:mt-4"},Nk={},Bu=i.defineComponent({...Nk,__name:"page",props:{title:{}},setup(t){return(e,n)=>{const r=z.NH1;return i.openBlock(),i.createElementBlock("div",Sk,[i.createElementVNode("div",Bk,[i.createElementVNode("div",Tk,[i.renderSlot(e.$slots,"title",{},()=>[i.createVNode(r,{class:"m-0 leading-none lg:mb-3 lg:leading-normal"},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(t.title??""),1)]),_:1})])]),e.$slots["title-buttons"]?(i.openBlock(),i.createElementBlock("div",Rk,[i.createElementVNode("div",$k,[i.renderSlot(e.$slots,"title-buttons")])])):i.createCommentVNode("",!0)]),e.$slots["title-extra"]?(i.openBlock(),i.createElementBlock("div",Ek,[i.renderSlot(e.$slots,"title-extra")])):i.createCommentVNode("",!0),i.renderSlot(e.$slots,"default")])}}}),Pk={class:"overflow-hidden transition-all duration-300"},Fk={class:"text-lg font-medium leading-none"},Mk={},Tu=i.defineComponent({...Mk,__name:"sliding-content-with-drawer",props:{drawerWidth:{type:[Number,Function],default:void 0},showDrawer:{type:Boolean,default:!1},title:{default:""}},emits:["update:show-drawer"],setup(t,{emit:e}){const n=t,r=e,s=i.ref(0),o=i.ref(n.showDrawer),a=()=>{switch(bt.getDeviceTypeByResolution()){case Ue.phone:return window.innerWidth*.66;case Ue.tablet:return window.innerWidth*.5;default:return window.innerWidth*.33}},l=()=>{o.value?O.isUndefined(n.drawerWidth)?s.value=a():s.value=O.isFunction(n.drawerWidth)?n.drawerWidth():n.drawerWidth:s.value=0};return i.watch(()=>n.drawerWidth,()=>{l()}),i.watch(()=>o.value,()=>{l(),r("update:show-drawer",o.value)}),i.watch(()=>n.showDrawer,c=>{o.value=c}),i.onUnmounted(()=>{window.removeEventListener("resize",l)}),l(),window.addEventListener("resize",l),(c,d)=>{const h=z.NDrawerContent,u=z.NDrawer;return i.openBlock(),i.createElementBlock(i.Fragment,null,[i.createElementVNode("div",Pk,[i.createElementVNode("div",{style:i.normalizeStyle(`margin-left: ${s.value}px;`),class:"w-full"},[i.renderSlot(c.$slots,"default")],4)]),i.createVNode(u,{show:o.value,"onUpdate:show":d[0]||(d[0]=m=>o.value=m),resizable:!0,width:s.value,placement:"left"},{default:i.withCtx(()=>[i.createVNode(h,{closable:""},{header:i.withCtx(()=>[i.renderSlot(c.$slots,"drawer-header",{},()=>[i.createElementVNode("div",Fk,i.toDisplayString(t.title),1)])]),default:i.withCtx(()=>[i.renderSlot(c.$slots,"drawer-content")]),footer:i.withCtx(()=>[i.renderSlot(c.$slots,"drawer-footer")]),_:3})]),_:3},8,["show","width"])],64)}}}),Ak={key:0,ref:"panel-component-ref",class:"sc-page-panel flex flex-row gap-2.5 sm:gap-8"},Vk={key:0},Ok={class:"sc-page-preview-panel grow"},Ik={key:1,class:"sc-page-preview-panel-extra flex-none"},zk={},Lk=i.defineComponent({...zk,__name:"page-with-sliding-panel",props:{title:{},isShowPanelButtonVisible:{type:Boolean,default:!0},showPanelButtonText:{default:""},panelTitle:{default:""}},setup(t,{expose:e}){const n=i.ref(!1),r=()=>{n.value=!0},s=()=>{n.value=!1},o=i.useTemplateRef("panel-component-ref");return e({scrollToTopOfPanel:l=>{var c;(c=o.value)==null||c.scrollIntoView({behavior:"smooth"}),l&&i.nextTick(()=>{var d,h;window.scrollTo({top:(((h=(d=o.value)==null?void 0:d.getBoundingClientRect())==null?void 0:h.top)??0)+window.pageYOffset+l,behavior:"smooth"})})},showPanel:r,closePanel:s}),(l,c)=>{const d=z.NButton;return i.openBlock(),i.createBlock(Bu,{title:t.title},i.createSlots({default:i.withCtx(()=>[l.$slots["preview-panel"]||l.$slots["preview-panel-extra"]||t.isShowPanelButtonVisible?(i.openBlock(),i.createElementBlock("div",Ak,[t.isShowPanelButtonVisible?(i.openBlock(),i.createElementBlock("div",Vk,[i.renderSlot(l.$slots,"show-panel-button",{onClickHandler:()=>{n.value=!0}},()=>[i.createVNode(d,{class:"flex-none sm:px-10 sm:py-4",onClick:c[0]||(c[0]=h=>n.value=!0)},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(t.showPanelButtonText),1)]),_:1})])])):i.createCommentVNode("",!0),i.createElementVNode("div",Ok,[i.renderSlot(l.$slots,"preview-panel")]),l.$slots["preview-panel-extra"]?(i.openBlock(),i.createElementBlock("div",Ik,[i.renderSlot(l.$slots,"preview-panel-extra")])):i.createCommentVNode("",!0)],512)):i.createCommentVNode("",!0),i.createVNode(Tu,{"show-drawer":n.value,"onUpdate:showDrawer":c[1]||(c[1]=h=>n.value=h),title:t.panelTitle},i.createSlots({"drawer-content":i.withCtx(()=>[i.renderSlot(l.$slots,"panel-content")]),default:i.withCtx(()=>[i.renderSlot(l.$slots,"default")]),_:2},[l.$slots["panel-header"]?{name:"drawer-header",fn:i.withCtx(()=>[i.renderSlot(l.$slots,"panel-header")]),key:"0"}:void 0,l.$slots["panel-bottom"]?{name:"drawer-footer",fn:i.withCtx(()=>[i.renderSlot(l.$slots,"panel-bottom")]),key:"1"}:void 0]),1032,["show-drawer","title"])]),_:2},[l.$slots.title?{name:"title",fn:i.withCtx(()=>[i.renderSlot(l.$slots,"title")]),key:"0"}:void 0,l.$slots["title-buttons"]?{name:"title-buttons",fn:i.withCtx(()=>[i.renderSlot(l.$slots,"title-buttons")]),key:"1"}:void 0,l.$slots["title-extra"]?{name:"title-extra",fn:i.withCtx(()=>[i.renderSlot(l.$slots,"title-extra")]),key:"2"}:void 0]),1032,["title"])}}}),Dk={},Hk=i.defineComponent({...Dk,__name:"manager-select",props:{value:{default:null},clearable:{type:Boolean,default:!1},consistentMenuWidth:{type:Boolean,default:!0},wrapContent:{type:Boolean,default:!0},managerReferenceList:{default:()=>[]},disabledManagerReferenceList:{default:()=>[]},showActualOnly:{type:Boolean,default:!1},showEmptyValue:{type:Boolean,default:!1},groupBySalesDirection:{type:Boolean,default:!1}},emits:["update:value"],setup(t,{expose:e,emit:n}){const r=t,s=n,o=i.computed(()=>O.isArray(r.value)),a=i.computed(()=>{var g;return O.isArray(r.value)?r.value.map(f=>f.id):((g=r.value)==null?void 0:g.id)??null}),l=i.computed(()=>{var p;let g=r.showEmptyValue?[G.ManagerDataFactory.generateUndefinedManagerInstance(),...r.managerReferenceList]:r.managerReferenceList,f=r.disabledManagerReferenceList.map(y=>y.id);if(r.showActualOnly){const y=O.isArray(r.value)?r.value.map(b=>b.id):[(p=r.value)==null?void 0:p.id];f=O.union(f,r.managerReferenceList.filter(b=>!b.isActive).map(b=>b.id)),g=r.managerReferenceList.filter(b=>b.isActive||y.includes(b.id))}return zt.convertReferencesToSelectOptionsList(g,!0,r.groupBySalesDirection?{key:"item.salesDirection.id",label:"item.salesDirection.name"}:!1,!1,y=>{const b=!r.groupBySalesDirection||r.groupBySalesDirection&&O.some(o.value?r.value:[r.value],["id",y.id])?` (${y.salesDirection.name}) `:"";return y.salesDirection.isNewRec()?y.name:`${y.name}${b}${y.isActive?"":" [Не активен]"}`},y=>f.includes(y.id)&&y.isActive)}),c=i.computed(()=>l.value.map(g=>({...g,class:r.wrapContent?`${g.class} consistent-menu-width`:g.class}))),d=i.useTemplateRef("select-component"),h=g=>{if(O.isArray(g)){const f=g.length>0?g.filter(p=>!O.some(r.disabledManagerReferenceList,["id",p])).map(p=>r.managerReferenceList.find(y=>y.id===p)).filter(p=>!O.isNil(p)):[];s("update:value",f)}else{const f=g>0&&!O.some(r.disabledManagerReferenceList,["id",g])?r.managerReferenceList.find(p=>p.id===g):new G.Manager;s("update:value",f??new G.Manager)}};return i.watch(()=>r.value,()=>{var g,f;(f=(g=d.value)==null?void 0:g.$forceUpdate)==null||f.call(g)},{deep:!0}),i.watch(()=>r.disabledManagerReferenceList,g=>{if(g.length>0&&r.value)if(o.value){const f=r.value;O.some(f,p=>O.some(g,["id",p.id]))&&s("update:value",f.filter(p=>!O.some(g,["id",p.id])))}else{const f=r.value;O.some(g,["id",f.id])&&s("update:value",new G.Manager)}}),e({focus:()=>{var g;return(g=d.value)==null?void 0:g.focusInput()},blur:()=>{var g;return(g=d.value)==null?void 0:g.blurInput()}}),(g,f)=>(i.openBlock(),i.createBlock(i.unref(z.NSelect),{ref:"select-component",value:a.value,clearable:t.clearable,disabled:l.value.length===0,"consistent-menu-width":t.consistentMenuWidth,multiple:o.value,options:c.value,placeholder:"","onUpdate:value":h},null,8,["value","clearable","disabled","consistent-menu-width","multiple","options"]))}}),Wk={class:"m-0.5 flex flex-col p-0.5"},jk={class:"flex flex-row gap-1"},qk={key:0},Xk={key:1},Yk={key:2},Uk={key:3},Gk={class:"flex flex-row gap-1"},Kk={key:0},Zk={key:1},Qk={key:2},Jk={key:3},e2={},Ru=i.defineComponent({...e2,__name:"address-suggestion-label",props:{addr:{},selected:{type:Boolean}},setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock("div",Wk,[i.createElementVNode("span",jk,[t.addr.postIndex?(i.openBlock(),i.createElementBlock("span",qk,i.toDisplayString(t.addr.postIndex)+", ",1)):i.createCommentVNode("",!0),t.addr.city?(i.openBlock(),i.createElementBlock("span",Xk,i.toDisplayString(t.addr.city)+", ",1)):i.createCommentVNode("",!0),t.addr.locality?(i.openBlock(),i.createElementBlock("span",Yk,i.toDisplayString(t.addr.locality)+", ",1)):i.createCommentVNode("",!0),t.addr.region?(i.openBlock(),i.createElementBlock("span",Uk,i.toDisplayString(t.addr.region)+", ",1)):i.createCommentVNode("",!0)]),i.createElementVNode("span",Gk,[t.addr.street?(i.openBlock(),i.createElementBlock("span",Kk,i.toDisplayString(t.addr.street)+", ",1)):i.createCommentVNode("",!0),t.addr.building?(i.openBlock(),i.createElementBlock("span",Zk,i.toDisplayString(t.addr.building)+", ",1)):i.createCommentVNode("",!0),t.addr.buildingPart?(i.openBlock(),i.createElementBlock("span",Qk,i.toDisplayString(t.addr.buildingPart)+", ",1)):i.createCommentVNode("",!0),t.addr.apartments?(i.openBlock(),i.createElementBlock("span",Jk,i.toDisplayString(t.addr.apartments)+", ",1)):i.createCommentVNode("",!0)])]))}}),pa={clearable:!1,value:"",field:void 0,disabled:!1},t2={},n2=i.defineComponent({...t2,__name:"address-suggestion",props:i.mergeDefaults({disabled:{type:Boolean},value:{},clearable:{type:Boolean},field:{},minTermLength:{},searchDataHandler:{type:Function}},{...pa,minTermLength:()=>{var t;return((t=G.AppConfigProvider.getConfig())==null?void 0:t.minLength.searchTerm)??3},searchDataHandler:void 0}),emits:["select","update:value"],setup(t,{expose:e,emit:n}){const r=t,s=n,o=i.ref(r.value),a=i.ref(!1),l=i.ref([]),c=i.computed(()=>l.value.map(p=>({label:p[r.field??"addressString"]??"-",value:p.id})));i.watch(()=>r.value,p=>{o.value=p}),i.watch(o,()=>{s("update:value",o.value)});const d=O.debounce(()=>h(),800),h=async()=>{!o.value||o.value.length<r.minTermLength||(a.value=!0,l.value=await(r.searchDataHandler?r.searchDataHandler(o.value,a):G.HttpRequester.getInstance(G.DataSuggestionProvider).searchAddresses(o.value)).finally(()=>{a.value=!1}))},u=(p,y)=>{const b=l.value.find(_=>_.id===p.value)||{};return i.h(Ru,{addr:b,selected:y},{default:O.constant("-")})},m=p=>{d.cancel();const y=l.value.find(b=>b.id===p)||{};s("select",y)},g=i.ref(null);function f(){g.value.focus()}return e({focus:f}),(p,y)=>{const b=z.NAutoComplete;return i.openBlock(),i.createBlock(b,{ref_key:"autoCompleteElement",ref:g,value:o.value,"onUpdate:value":[y[0]||(y[0]=_=>o.value=_),i.unref(d)],clearable:t.clearable,disabled:t.disabled,loading:a.value,options:c.value,"render-label":u,placeholder:"",onSelect:m},null,8,["value","clearable","disabled","loading","options","onUpdate:value"])}}}),i2={class:"m-0.5 flex flex-col p-0.5"},r2={class:"font-medium"},s2={class:"flex flex-row gap-1 text-xs font-light text-blue-800"},o2={key:0},a2={key:1},l2={},$u=i.defineComponent({...l2,__name:"bank-suggestion-label",props:{bank:{},selected:{type:Boolean}},setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock("div",i2,[i.createElementVNode("span",r2,i.toDisplayString(t.bank.name),1),i.createElementVNode("span",s2,[t.bank.bic?(i.openBlock(),i.createElementBlock("span",o2," БИК: "+i.toDisplayString(t.bank.bic),1)):i.createCommentVNode("",!0),t.bank.inn?(i.openBlock(),i.createElementBlock("span",a2," ИНН: "+i.toDisplayString(t.bank.inn),1)):i.createCommentVNode("",!0)])]))}}),c2={},d2=i.defineComponent({...c2,__name:"bank-suggestion",props:i.mergeDefaults({disabled:{type:Boolean},value:{},clearable:{type:Boolean},field:{},minTermLength:{}},{...pa,minTermLength:()=>{var t;return((t=G.AppConfigProvider.getConfig())==null?void 0:t.minLength.searchTerm)??3}}),emits:["select","update:value"],setup(t,{expose:e,emit:n}){const r=t,s=n,o=i.ref(r.value),a=i.ref(!1),l=i.ref([]),c=i.computed(()=>l.value.map(p=>({label:p[r.field??"_"]??"-",value:p.id})));i.watch(()=>r.value,p=>{o.value=p}),i.watch(o,()=>{s("update:value",o.value)});const d=O.debounce(()=>h(),800),h=async()=>{if(!(!o.value||o.value.length<r.minTermLength)){a.value=!0;try{l.value=await G.HttpRequester.getInstance(G.DataSuggestionProvider).searchBank(o.value)}finally{a.value=!1}}},u=(p,y)=>{const b=l.value.find(_=>_.id===p.value)||{};return i.h($u,{bank:b,selected:y},{default:O.constant("-")})},m=p=>{d.cancel();const y=l.value.find(b=>b.id===p)||{};s("select",y)},g=i.ref(null);function f(){g.value.focus()}return e({focus:f}),(p,y)=>{const b=z.NAutoComplete;return i.openBlock(),i.createBlock(b,{ref_key:"autoCompleteElement",ref:g,value:o.value,"onUpdate:value":[y[0]||(y[0]=_=>o.value=_),i.unref(d)],clearable:t.clearable,disabled:t.disabled,loading:a.value,options:c.value,"render-label":u,placeholder:"",onSelect:m},null,8,["value","clearable","disabled","loading","options","onUpdate:value"])}}}),h2={class:"font-medium"},u2={key:0,class:"flex flex-row gap-2"},f2={key:0,class:"text-xs font-light text-blue-800"},g2={key:1,class:"text-sc-dark-grey text-xs font-light"},m2={},Eu=i.defineComponent({...m2,__name:"org-suggestion-label",props:{org:{},selected:{type:Boolean}},setup(t){const e=t,n=i.computed(()=>{var s,o;return((o=(s=e.org.rawData)==null?void 0:s.state)==null?void 0:o.liquidationDate)??!1}),r=i.computed(()=>{var s,o;return((o=(s=e.org.rawData)==null?void 0:s.address)==null?void 0:o.value)??""});return(s,o)=>(i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(`m-0.5 flex flex-col p-0.5 ${n.value?"line-through":""}`)},[i.createElementVNode("span",h2,i.toDisplayString(t.org.name),1),t.org.inn||r.value?(i.openBlock(),i.createElementBlock("div",u2,[t.org.inn?(i.openBlock(),i.createElementBlock("span",f2,i.toDisplayString(t.org.inn),1)):i.createCommentVNode("",!0),r.value?(i.openBlock(),i.createElementBlock("span",g2,i.toDisplayString(r.value),1)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)],2))}}),p2={},y2=i.defineComponent({...p2,__name:"org-suggestion",props:i.mergeDefaults({disabled:{type:Boolean},value:{},clearable:{type:Boolean},field:{},minTermLength:{},allowSelectTerminated:{type:Boolean}},{...pa,minTermLength:()=>{var t;return((t=G.AppConfigProvider.getConfig())==null?void 0:t.minLength.searchTerm)??3}}),emits:["select","update:value"],setup(t,{expose:e,emit:n}){const r=t,s=n,o=i.ref(r.value),a=i.ref(!1),l=i.ref([]),c=y=>{var b,_;return!!(((_=(b=y.rawData)==null?void 0:b.state)==null?void 0:_.liquidationDate)??!1)},d=i.computed(()=>zt.convertReferencesToSelectOptionsList(l.value,!1,!1,!1,y=>y[r.field??"_"]??"-",y=>!r.allowSelectTerminated&&c(y)));i.watch(()=>r.value,y=>{o.value=y}),i.watch(o,()=>{s("update:value",o.value)});const h=O.debounce(()=>u(),800),u=async()=>{if(!(!o.value||o.value.length<r.minTermLength)){a.value=!0;try{l.value=await G.HttpRequester.getInstance(G.DataSuggestionProvider).searchOrganization(o.value)}finally{a.value=!1}}},m=(y,b)=>{const _=l.value.find(C=>C.id===y.value)||{};return i.h(Eu,{org:_,selected:b},{default:O.constant("-")})},g=y=>{h.cancel();const b=l.value.find(_=>_.id===y)||{};(r.allowSelectTerminated||!c(b))&&s("select",b)},f=i.ref(null);function p(){f.value.focus()}return e({focus:p}),(y,b)=>{const _=z.NAutoComplete;return i.openBlock(),i.createBlock(_,{ref_key:"autoCompleteElement",ref:f,value:o.value,"onUpdate:value":[b[0]||(b[0]=C=>o.value=C),i.unref(h)],clearable:t.clearable,disabled:t.disabled,loading:a.value,options:d.value,"render-label":m,placeholder:"",onSelect:g},null,8,["value","clearable","disabled","loading","options","onUpdate:value"])}}}),b2={},_2=i.defineComponent({...b2,__name:"button-with-confirm-action",props:{disabled:{type:Boolean,default:!1},dialogTitle:{default:""},dialogContent:{default:""},disableConfirm:{type:Boolean,default:!1},popoverText:{default:""},type:{default:"default"},size:{default:"small"},quaternary:{type:Boolean,default:!1},circle:{type:Boolean,default:!1},ghost:{type:Boolean,default:!1},loading:{type:Boolean,default:!1}},emits:["accept"],setup(t,{emit:e}){const n=t,r=e,s=i.ref(!1),o=()=>{r("accept",()=>{s.value=!1})},a=()=>{n.disableConfirm?o():s.value=!0};return(l,c)=>{const d=z.NButton,h=z.NPopover,u=z.NModal;return i.openBlock(),i.createElementBlock("div",null,[i.createVNode(h,{disabled:t.popoverText.length===0,placement:"bottom"},{trigger:i.withCtx(()=>[i.createVNode(d,{disabled:t.disabled,ghost:t.ghost,loading:t.loading,size:t.size,type:t.type,quaternary:t.quaternary,circle:t.circle,onClick:a},{default:i.withCtx(()=>[i.renderSlot(l.$slots,"default")]),_:3},8,["disabled","ghost","loading","size","type","quaternary","circle"])]),default:i.withCtx(()=>[i.createTextVNode(" "+i.toDisplayString(t.popoverText),1)]),_:3},8,["disabled"]),i.createVNode(u,{show:s.value,"onUpdate:show":c[1]||(c[1]=m=>s.value=m),content:t.dialogContent,closable:!1,"mask-closable":!1,"show-icon":!1,title:t.dialogTitle,"action-class":"",preset:"dialog"},{action:i.withCtx(()=>[i.createVNode(d,{type:"primary",class:"px-8",onClick:o},{default:i.withCtx(()=>[...c[2]||(c[2]=[i.createTextVNode(" Да ",-1)])]),_:1}),i.createVNode(d,{type:"default",onClick:c[0]||(c[0]=m=>s.value=!1)},{default:i.withCtx(()=>[...c[3]||(c[3]=[i.createTextVNode(" Отмена ",-1)])]),_:1})]),_:1},8,["show","content","title"])])}}}),w2={key:0,class:"whitespace-pre-line"},x2={key:1,class:"text-sc-dark-grey"},v2={},k2=i.defineComponent({...v2,__name:"comment-editor",props:{disabled:{type:Boolean,default:!1},comment:{default:""}},emits:["update:comment"],setup(t,{emit:e}){const n=t,r=e,s=i.ref(n.comment);i.watch(()=>s.value,l=>{s.value=l});const o=l=>{r("update:comment",s.value,l)},a=()=>{s.value=n.comment};return(l,c)=>{const d=z.NInput;return i.openBlock(),i.createBlock(Ed,{disabled:t.disabled,"onEditor:apply":o,"onEditor:cancel":a},{viewer:i.withCtx(()=>[i.createElementVNode("div",null,[t.comment?(i.openBlock(),i.createElementBlock("span",w2,i.toDisplayString(t.comment),1)):(i.openBlock(),i.createElementBlock("span",x2," - Комментарий отсутствует - "))])]),editor:i.withCtx(()=>[i.createVNode(d,{value:s.value,"onUpdate:value":c[0]||(c[0]=h=>s.value=h),clearable:!0,type:"textarea"},null,8,["value"])]),_:1},8,["disabled"])}}}),C2={key:0,class:"text-sm"},S2={key:1},B2={},T2=i.defineComponent({...B2,__name:"debt",props:{debt:{default:0},showLabel:{type:Boolean,default:!1},wrapAsSmall:{type:Boolean,default:!1}},setup(t){const e=t,n=i.computed(()=>{let r="";return(e.showLabel??!1)&&(e.debt>0?r="Переплата: ":e.debt<0&&(r="Задолженность: ")),r});return(r,s)=>(i.openBlock(),i.createElementBlock("span",null,[t.wrapAsSmall&&t.debt!==0?(i.openBlock(),i.createElementBlock("span",C2,[i.createTextVNode(i.toDisplayString(n.value)+" ",1),i.createElementVNode("span",{class:i.normalizeClass({"text-green-700":t.debt>0,"text-red-700":t.debt<0})},i.toDisplayString(t.debt)+" ₽ ",3)])):i.createCommentVNode("",!0),!t.wrapAsSmall&&t.debt!==0?(i.openBlock(),i.createElementBlock("span",S2,[i.createTextVNode(i.toDisplayString(n.value)+" ",1),i.createElementVNode("span",{class:i.normalizeClass({"text-green-700":t.debt>0,"text-red-700":t.debt<0})},i.toDisplayString(t.debt)+" ₽ ",3)])):i.createCommentVNode("",!0)]))}}),R2={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function $2(t,e){return i.openBlock(),i.createElementBlock("svg",R2,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"currentColor",d:"M449.07 399.08L278.64 82.58c-12.08-22.44-44.26-22.44-56.35 0L51.87 399.08A32 32 0 0 0 80 446.25h340.89a32 32 0 0 0 28.18-47.17m-198.6-1.83a20 20 0 1 1 20-20a20 20 0 0 1-20 20m21.72-201.15l-5.74 122a16 16 0 0 1-32 0l-5.74-121.95a21.73 21.73 0 0 1 21.5-22.69h.21a21.74 21.74 0 0 1 21.73 22.7Z"},null,-1)])])}const E2=i.markRaw({name:"ion-warning",render:$2}),N2={},P2=i.defineComponent({...N2,__name:"warning-icon",props:{popoverText:{default:""},iconClass:{default:"text-sc-warning"}},setup(t){return(e,n)=>{const r=E2,s=z.NPopover;return i.openBlock(),i.createBlock(s,{disabled:t.popoverText.length===0,placement:"bottom"},{trigger:i.withCtx(()=>[i.createVNode(r,{class:i.normalizeClass(`ml-0.5 ${t.iconClass}`)},null,8,["class"])]),default:i.withCtx(()=>[i.createTextVNode(" "+i.toDisplayString(t.popoverText),1)]),_:1},8,["disabled"])}}}),mt=class mt{static init(e,n){mt.messagesService&&mt.notificationsService||(mt.messagesService=e,mt.notificationsService=n)}static getMessagesService(){if(!mt.messagesService)throw new Error("UI provider is not initialized.");return mt.messagesService}static getNotificationsService(){if(!mt.notificationsService)throw new Error("UI provider is not initialized.");return mt.notificationsService}static showNotificationsForErrorResponseData(e,n={}){var r,s;if(O.isEmpty(e.errors)){const o=(s=(r=e.rawError)==null?void 0:r.config)==null?void 0:s.url,a=o?` [ ${o} ]`:"";mt.notificationsService?mt.notificationsService.error({title:"Ошибка выполнения/обработки запроса",content:e.message,meta:`#${e.status}${a}: ${e.statusText}`,duration:3e3}):console.log("Show notification error response data: UI provider is not initialized.",e)}else for(const o in e.errors)Object.prototype.hasOwnProperty.call(n,o)?n[o]=new G.FieldValidationResultData(e.errors[o].toString(),"error"):mt.messagesService?mt.messagesService.error(e.errors[o].toString()):console.log("Show notification error response data: UI provider is not initialized.",e.errors[o])}};x(mt,"messagesService"),x(mt,"notificationsService");let ya=mt;const F2=i.computed(()=>G.useReferencesStore().deliveryTypeReference??[]),M2=i.computed(()=>G.useReferencesStore().managersList??[]),A2=i.computed(()=>G.useReferencesStore().opfReference??[]),V2=i.computed(()=>G.useReferencesStore().partnerGroupsReference??[]),O2=i.computed(()=>G.useReferencesStore().priceCoefficientsReference??[]),I2=i.computed(()=>G.useReferencesStore().productFilesTypesReference??[]),z2=i.computed(()=>G.useReferencesStore().resourceTypesReference),L2=i.computed(()=>G.useReferencesStore().salesDirectionsReference??[]),D2=i.computed(()=>G.useReferencesStore().warehousesReference??[]),H2=i.computed(()=>zt.convertReferencesToSelectOptionsList(G.useReferencesStore().channelPrimaryInterestsReference??[],!0,!1,!0)),W2=i.computed(()=>zt.convertReferencesToSelectOptionsList(G.useReferencesStore().sourcePrimaryInterestsReference??[],!0,!1,!0)),j2=t=>G.HttpRequester.getInstance(G.ReferenceDataProvider).searchCity(t),q2=t=>zt.convertReferencesToSelectOptionsList(t,!0,!1,!1,e=>{var n,r,s;return e!=null&&e.isNewRec()?"-":`${e.name}, ${(n=e==null?void 0:e.region)==null?void 0:n.name}, ${(s=(r=e==null?void 0:e.region)==null?void 0:r.country)==null?void 0:s.name}`},e=>e==null?void 0:e.isNewRec());W.AddProductToCartDialog=iy,W.ConfiguratorSettingsKozyrek=_d,W.ContentHelper=Kn,W.KozyrekLine=ri,W.KozyrekTailTemplate=No,W.KozyrekTemplate=Di,W.OrdersTableFields=Ke,W.Point=$o,W.ScAddressSuggestion=n2,W.ScAddressSuggestionLabel=Ru,W.ScBankSuggestion=d2,W.ScBankSuggestionLabel=$u,W.ScBaseDialog=Cd,W.ScButtonWithConfirmAction=_2,W.ScCategoryCollapse=vd,W.ScClientNameWithShortInfo=os,W.ScCollapse=xd,W.ScCollapseItem=Da,W.ScCommentEditor=k2,W.ScConfiguratorsProductInfo=nr,W.ScContragentWithShortInfo=Sd,W.ScDateRange=gb,W.ScDateTimeLabel=Po,W.ScDebouncedInput=Db,W.ScDebouncedInputNumber=Li,W.ScDebt=T2,W.ScDialogHeader=vb,W.ScDynamicConfigurator=wd,W.ScEmail=_y,W.ScExternalLink=Zb,W.ScImageGallery=qa,W.ScInlineEditableItem=Ed,W.ScInlineView=Fo,W.ScKozyrekConfigurator=cd,W.ScKozyrekConfiguratorParamsForm=Ua,W.ScKozyrekConfiguratorPreview=ld,W.ScKozyrekConfiguratorTemplates=ad,W.ScLightGallery=ja,W.ScManagerSelect=Hk,W.ScMetalForDoorsConfigurator=bd,W.ScMetalForDoorsConfiguratorForm=yd,W.ScMosquitoConfigurator=ud,W.ScMosquitoConfiguratorForm=dd,W.ScMosquitoConfiguratorMeasurementInstructions=hd,W.ScMosquitoConfiguratorPreview=Eo,W.ScOrderCommonInfo=wu,W.ScOrderDeliveryLabel=Ts,W.ScOrderDetails=Cu,W.ScOrderInfo=Su,W.ScOrderItemsList=ku,W.ScOrderPayment=xu,W.ScOrderProductInfo=vu,W.ScOrdersList=wk,W.ScOrgSuggestion=y2,W.ScOrgSuggestionLabel=Eu,W.ScPage=Bu,W.ScPageWithSlidingPanel=Lk,W.ScPersonContactsBlock=cb,W.ScPhone=Wy,W.ScPhoneInput=jb,W.ScProductName=tr,W.ScProductsList=Sv,W.ScReferenceSelect=kd,W.ScSearchableProductSelect=_u,W.ScSearchableReferenceSelect=bu,W.ScSetClientPriceFormItem=K0,W.ScShortTextOrderInfo=Ck,W.ScSingleFileUploadSelector=Tb,W.ScSlidingContentWithDrawer=Tu,W.ScStripConfigurator=pd,W.ScStripConfiguratorForm=gd,W.ScStripConfiguratorLineItem=fd,W.ScStripConfiguratorPreview=md,W.ScUserShortInfo=ma,W.ScWarningIcon=P2,W.SelectOptionHelper=zt,W.UiNotificationProvider=ya,W.WindowResolutionEnum=Ue,W.WindowResolutionProvider=bt,W.channelPrimaryInterestOptionsList=H2,W.componentSizeInjectionKey=$r,W.deliveryTypeReferenceList=F2,W.managersReferenceList=M2,W.naiveUiTheme=kf,W.opfReferenceList=A2,W.partnerGroupReferenceList=V2,W.priceCoefficientsReferenceList=O2,W.productFilesTypesReferenceList=I2,W.renderConfig=Ve,W.resourceReferencesList=z2,W.salesDirectionsReferenceList=L2,W.searchCityReferenceDataHandler=j2,W.searchCityReferenceLabelRenderer=q2,W.sourcePrimaryInterestOptionsList=W2,W.warehousesReferenceList=D2,Object.defineProperty(W,Symbol.toStringTag,{value:"Module"})}));
823
823
  //# sourceMappingURL=sc-vue-ui-lib.umd.cjs.map