@snabcentr/vue-ui-lib 3.60.2 → 3.60.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/manifest.json +1 -1
- package/dist/release_notes.tmp +4 -3
- package/dist/sc-vue-ui-lib.js +3272 -3262
- package/dist/sc-vue-ui-lib.js.map +1 -1
- package/dist/sc-vue-ui-lib.umd.cjs +50 -50
- package/dist/sc-vue-ui-lib.umd.cjs.map +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(q,M){typeof exports=="object"&&typeof module<"u"?M(exports,require("lodash-es"),require("vue"),require("naive-ui"),require("@snabcentr/common-lib"),require("date-fns"),require("libphonenumber-js"),require("ts-case-convert"),require("vue-tel-input")):typeof define=="function"&&define.amd?define(["exports","lodash-es","vue","naive-ui","@snabcentr/common-lib","date-fns","libphonenumber-js","ts-case-convert","vue-tel-input"],M):(q=typeof globalThis<"u"?globalThis:q||self,M(q.SC_VueUiLib={},q["lodash-es"],q.Vue,q["naive-ui"],q["@snabcentr/common-lib"],q["date-fns"],q["libphonenumber-js"],q["ts-case-convert"],q["vue-tel-input"]))})(this,(function(q,M,i,z,K,Tn,sr,zs,Qh){"use strict";var AS=Object.defineProperty;var Uh=q=>{throw TypeError(q)};var MS=(q,M,i)=>M in q?AS(q,M,{enumerable:!0,configurable:!0,writable:!0,value:i}):q[M]=i;var S=(q,M,i)=>MS(q,typeof M!="symbol"?M+"":M,i),Kh=(q,M,i)=>M.has(q)||Uh("Cannot "+i);var Ft=(q,M,i)=>(Kh(q,M,"read from private field"),i?i.call(q):M.get(q)),qa=(q,M,i)=>M.has(q)?Uh("Cannot add the same private member more than once"):M instanceof WeakSet?M.add(q):M.set(q,i),Gh=(q,M,i,z)=>(Kh(q,M,"write to private field"),z?z.call(q,i):M.set(q,i),i);var Bi,ft,Is;const Ya=t=>{if(t.key!=="Enter"&&t.code!=="Enter")return;const{target:e}=t;if(!(e instanceof HTMLInputElement)||e.type==="range")return;t.preventDefault();const r=[...t.currentTarget.querySelectorAll("input")].filter(a=>a.type!=="range"&&!a.readOnly&&!a.disabled),s=r.indexOf(e);if(s===-1)return;const o=r.at(s+1);o&&(o.focus(),o.select())},Ua={mounted(t){t.addEventListener("keydown",Ya)},unmounted(t){t.removeEventListener("keydown",Ya)}};var Ee=(t=>(t.AttachedUser="attached_user",t.ClientInfo="client_info",t.ClientInfoShort="client_info_short",t.CreatedAt="created_at",t.ClientCity="client_city",t.DeliveryInfo="delivery_info",t.DeliveryDate="delivery_date",t.Id="id",t.PaymentType="payment_type",t.SalesDirections="sales_directions",t.Status="status",t.actions="actions",t))(Ee||{}),Qe=(t=>(t.phone="phone",t.tablet="tablet",t.laptop="laptop",t))(Qe||{});class ai{static isVnodeEmpty(e){return e.every(n=>n.type===i.Comment||n.type===i.Text&&M.isString(n.children)&&!n.children.trim()?!0:n.type===i.Fragment&&ai.isVnodeEmpty(n.children))}static hasSlotContent(e){return e?!ai.isVnodeEmpty(e()):!1}}const tt=(t,e=!1)=>{const{key:n}=t;if(!["Backspace","Delete","Tab","Escape","Enter","ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End"].includes(n)&&!((t.ctrlKey||t.metaKey)&&["a","c","v","x","z","ф","с","м","ч","я"].includes(n.toLowerCase()))){if(e&&n==="-"){const r=t.target;if((r.selectionStart??0)===0&&!r.value.includes("-"))return}/^\d$/.test(n)||t.preventDefault()}},Ds=(t,e=".",n=!1)=>{const{key:r}=t,s=t.target;["Backspace","Delete","Tab","Escape","Enter","ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End"].includes(r)||(t.ctrlKey||t.metaKey)&&["a","c","v","x","z","ф","с","м","ч","я"].includes(r.toLowerCase())||n&&r==="-"&&!s.value.includes("-")&&((s.selectionStart??0)===0||s.value.length===0)||(r===e||r===(e==="."?",":"."))&&!s.value.includes(e)&&!s.value.includes(e==="."?",":".")||/^\d$/.test(r)||t.preventDefault()},lt=t=>t?Number.parseFloat(t.replace(",",".")):null,et=(t,e)=>{t[e]={}},Le=t=>{const e=t.target;setTimeout(()=>{e.select()},100)};class Vt{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(M.groupBy(l,r.key)).filter(c=>c.length>0).map(c=>{const d=c[0],u=M.isString(r.key)?M.get(d,r.key):r.key(c),h=M.isString(r.label)?M.get(d,r.label):r.label(c);return{type:"group",label:M.isEmpty(h)?"- Не определено -":h,key:`group_${u}`,children:c}})]}static convertReferencesToSelectOptionsList(e,n=!1,r=!1,s=!1,o=void 0,a=void 0){return Vt.convertReferencesToOptionsList(e,n,r,s,o,a)}static convertReferencesToAutocompleteOptionsList(e,n=!1,r=!1,s=!1,o=void 0,a=void 0){return Vt.convertReferencesToOptionsList(e,n,r,s,o,a)}}const Jh={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function ef(t,e){return i.openBlock(),i.createElementBlock("svg",Jh,[...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 Ls=i.markRaw({name:"ion-ellipsis-vertical-sharp",render:ef}),tf={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function nf(t,e){return i.openBlock(),i.createElementBlock("svg",tf,[...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 Ka=i.markRaw({name:"tabler-edit",render:nf}),rf={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function sf(t,e){return i.openBlock(),i.createElementBlock("svg",rf,[...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 Ga=i.markRaw({name:"ion-checkmark-done-circle",render:sf}),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-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 Za=i.markRaw({name:"ion-checkmark-done-circle-outline",render:af}),lf={viewBox:"0 0 32 32",width:"1.2em",height:"1.2em"};function cf(t,e){return i.openBlock(),i.createElementBlock("svg",lf,[...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 df=i.markRaw({name:"fluent-pin32-regular",render:cf}),uf={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function hf(t,e){return i.openBlock(),i.createElementBlock("svg",uf,[...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 ff=i.markRaw({name:"ion-eye-outline",render:hf}),mf={viewBox:"0 0 32 32",width:"1.2em",height:"1.2em"};function gf(t,e){return i.openBlock(),i.createElementBlock("svg",mf,[...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 pf=i.markRaw({name:"fluent-pin32-filled",render:gf}),yf={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function bf(t,e){return i.openBlock(),i.createElementBlock("svg",yf,[...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 _f=i.markRaw({name:"ion-bookmark-outline",render:bf}),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("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 kf=i.markRaw({name:"ion-eye-off-sharp",render:xf}),vf={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Cf(t,e){return i.openBlock(),i.createElementBlock("svg",vf,[...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 Sf=i.markRaw({name:"ion-chevron-forward-outline",render:Cf}),Bf=["data-name"],Tf={class:"sc-collapse-item-header flex flex-row gap-2.5"},$f={class:"sc-collapse-item-arrow flex-none cursor-pointer pt-1.5"},Nf={key:0},Rf={class:"sc-collapse-item-pre-arrow flex flex-none flex-row gap-1"},Pf={class:"flex flex-1 flex-col"},Ef={key:0,class:"sc-collapse-item-sub-title flex-1"},Ff={key:1,class:"sc-collapse-item-title-extra flex-none"},Vf={key:0,class:"sc-collapse-item-content"},If={},Af=i.defineComponent({...If,__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",M.noop),a=i.inject("defaultExpandedNames",[]),l=i.inject("expandedNames",[]),c=M.some(a,p=>p===r.name),d=i.computed(()=>M.some(l,p=>p===r.name)),u=i.ref(c),h=()=>{r.disabled||(u.value=d.value||!u.value,s("header:click",r.name,u.value),o(r.name,u.value))};return e({expand:()=>{!r.disabled&&!u.value&&(u.value=!0,s("header:click",r.name,u.value),o(r.name,u.value))},toggle:()=>{r.disabled||h()},collapse:()=>{!r.disabled&&u.value&&!d.value&&(u.value=!1,s("header:click",r.name,u.value),o(r.name,u.value))},expanded:i.readonly(u)}),(p,y)=>{const b=Sf;return i.openBlock(),i.createElementBlock("div",{"data-name":t.name,class:i.normalizeClass([{"cursor-not-allowed text-gray-400":t.disabled},"sc-collapse-item flex flex-col p-2"])},[i.createElementVNode("div",Tf,[i.createElementVNode("div",$f,[i.createElementVNode("div",{class:i.normalizeClass({"rotate-90":u.value}),onClick:h},[i.renderSlot(p.$slots,"arrow",{},()=>[i.createVNode(b)],!0)],2)]),i.unref(ai).hasSlotContent(p.$slots["pre-arrow"])?(i.openBlock(),i.createElementBlock("div",Nf,[i.createElementVNode("div",Rf,[i.renderSlot(p.$slots,"pre-arrow",{},void 0,!0)])])):i.createCommentVNode("",!0),i.createElementVNode("div",Pf,[i.createElementVNode("div",{class:"sc-collapse-item-title flex flex-1 cursor-pointer flex-col text-lg font-semibold",onClick:h},[i.renderSlot(p.$slots,"header",{},()=>[i.createTextVNode(i.toDisplayString(t.title),1)],!0)]),i.unref(ai).hasSlotContent(p.$slots["sub-header"])?(i.openBlock(),i.createElementBlock("div",Ef,[i.renderSlot(p.$slots,"sub-header",{},void 0,!0)])):i.createCommentVNode("",!0)]),i.unref(ai).hasSlotContent(p.$slots["header-extra"])?(i.openBlock(),i.createElementBlock("div",Ff,[i.renderSlot(p.$slots,"header-extra",{},void 0,!0)])):i.createCommentVNode("",!0)]),i.createVNode(i.Transition,{name:"fade"},{default:i.withCtx(()=>[d.value||u.value?(i.openBlock(),i.createElementBlock("div",Vf,[i.renderSlot(p.$slots,"default",{},void 0,!0)])):i.createCommentVNode("",!0)]),_:3})],10,Bf)}}}),Wn=(t,e)=>{const n=t.__vccOpts||t;for(const[r,s]of e)n[r]=s;return n},Qa=Wn(Af,[["__scopeId","data-v-f1311d1c"]]),Mf={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Of(t,e){return i.openBlock(),i.createElementBlock("svg",Mf,[...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 Ja=i.markRaw({name:"ion-cart-outline",render:Of}),or=Symbol(),zf={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"}},Df={class:"flex flex-col-reverse gap-2.5 sm:flex-row"},Lf={},el=i.defineComponent({...Lf,__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(or,"medium"),r=i.computed(()=>M.isFunction(e.showProductAddToCartButton)?e.showProductAddToCartButton(e.product):e.showProductAddToCartButton),s=i.computed(()=>M.isFunction(e.showProductEditButton)?e.showProductEditButton(e.product):e.showProductEditButton),o=i.computed(()=>M.isFunction(e.showProductRequiredButton)?e.showProductRequiredButton(e.product):e.showProductRequiredButton),a=i.computed(()=>M.isNil(e.productContextButtonsConfig)?[]:M.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})},u=h=>{e.eventEmitter.emit("product:context-select",{product:e.product,key:h})};return(h,f)=>{var N;const g=Za,m=Ga,p=z.NButton,y=z.NTooltip,b=Ka,_=Ja,B=Ls,k=z.NDropdown;return i.openBlock(),i.createElementBlock("div",Df,[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(m,{key:1})):(i.openBlock(),i.createBlock(g,{key:0}))]),_:1},8,["size","disabled","type"])]),default:i.withCtx(()=>[f[0]||(f[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(()=>[f[1]||(f[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(()=>[f[2]||(f[2]=i.createTextVNode(" Добавить в корзину ",-1))]),_:1})):i.createCommentVNode("",!0),((N=a.value)==null?void 0:N.length)>0?(i.openBlock(),i.createBlock(k,{key:3,options:a.value,size:i.unref(n),trigger:"click",onSelect:u},{default:i.withCtx(()=>[i.createVNode(p,{ghost:!0,size:i.unref(n),type:"primary"},{default:i.withCtx(()=>[i.createVNode(B)]),_:1},8,["size"])]),_:1},8,["options","size"])):i.createCommentVNode("",!0)])}}}),Hf={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Wf(t,e){return i.openBlock(),i.createElementBlock("svg",Hf,[...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 jf=i.markRaw({name:"tabler-history",render:Wf}),qf={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Xf(t,e){return i.openBlock(),i.createElementBlock("svg",qf,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"currentColor",d:"m18.5 3.5l2 2l-15 15l-2-2zM7 4c1.66 0 3 1.34 3 3s-1.34 3-3 3s-3-1.34-3-3s1.34-3 3-3m10 10c1.66 0 3 1.34 3 3s-1.34 3-3 3s-3-1.34-3-3s1.34-3 3-3M7 6c-.55 0-1 .45-1 1s.45 1 1 1s1-.45 1-1s-.45-1-1-1m10 10c-.55 0-1 .45-1 1s.45 1 1 1s1-.45 1-1s-.45-1-1-1"},null,-1)])])}const Yf=i.markRaw({name:"mdi-percent-outline",render:Xf}),Uf={class:"flex flex-row gap-1"},Kf={key:0,class:"flex gap-1"},Gf={key:0,class:"flex text-nowrap text-sm line-through"},Zf={key:1,class:"flex flex-row text-nowrap text-sm"},Qf={key:2,class:"flex flex-row gap-1 text-nowrap text-sm text-gray-600"},Jf={},jn=i.defineComponent({...Jf,__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){var y;const e=t,n=i.computed(()=>"product"in e.product),r=i.computed(()=>"product"in e.product?e.product.product:e.product),s=i.computed(()=>M.find(r.value.priceCoefficients,["coefficient.slug",e.costFieldName])),o=i.computed(()=>{const b=M.find(r.value.priceCoefficients,["coefficient.slug","k0"]);return s.value||!b||M.isNil(l.value)||M.isNil(b.cost)?!1:l.value<b.cost}),a=((y=K.useBaseConfigStateStore().getConfig())==null?void 0:y.defaultCurrency)??"RUB",l=i.computed(()=>s.value?s.value.cost:M.get(e.product,e.costFieldName)),c=i.computed(()=>e.additionalThroughFieldName?M.get(e.product,e.additionalThroughFieldName):void 0),d=i.computed(()=>r.value.costDate?Tn.format(r.value.costDate,K.useBaseConfigStateStore().config.dateFormats.uiDate):void 0),u=i.computed(()=>e.currencyRates||r.value.currency.signature===a?e.currencyRates:{[r.value.currency.signature]:r.value.costRub/r.value.cost}),h=i.computed(()=>(M.isFunction(e.allowPriceClick)?e.allowPriceClick(r.value):e.allowPriceClick)&&!M.isNil(l.value)),f=i.computed(()=>M.isNil(l.value)?"-":new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:2}).format(Number.parseFloat(l.value))),g=i.computed(()=>{if(r.value.currency.signature===a||!u.value||!u.value[r.value.currency.signature])return null;const b=u.value[r.value.currency.signature];return new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:2}).format(Number.parseFloat(l.value)*b)}),m=i.computed(()=>M.isNil(c.value)?null:new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:2}).format(c.value)),p=i.computed(()=>{if(!c.value||!l.value||c.value===l.value||l.value===0)return null;const b=(l.value-c.value)/c.value*100;return new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:2,maximumFractionDigits:2}).format(b)});return(b,_)=>{var w;const B=z.NTag,k=z.NTooltip,N=Yf,R=jf;return i.openBlock(),i.createElementBlock("div",Uf,[t.showTag?(i.openBlock(),i.createBlock(k,{key:0},{trigger:i.withCtx(()=>[i.createVNode(B,{round:"",bordered:!1,size:"small",class:i.normalizeClass(["text-slate-600",{"font-bold":!s.value}])},{default:i.withCtx(()=>{var C;return[i.createTextVNode(i.toDisplayString(((C=s.value)==null?void 0:C.coefficient.slug)??"Ц"),1)]}),_:1},8,["class"])]),default:i.withCtx(()=>{var C;return[i.createTextVNode(" "+i.toDisplayString(((C=s.value)==null?void 0:C.coefficient.name)??"Розничная цена"),1)]}),_:1})):i.createCommentVNode("",!0),i.createElementVNode("div",{class:i.normalizeClass({"!text-red-600":o.value})},[c.value&&c.value!==l.value||p.value?(i.openBlock(),i.createElementBlock("div",Kf,[c.value&&c.value!==l.value?(i.openBlock(),i.createElementBlock("span",Gf,i.toDisplayString(m.value)+" "+i.toDisplayString(t.showQuantityUnit?` ${r.value.currency.symbol}/${r.value.unit.name}`:""),1)):i.createCommentVNode("",!0),p.value?(i.openBlock(),i.createElementBlock("span",{key:1,class:i.normalizeClass(["flex text-nowrap text-sm text-gray-600",{"!text-red-600":o.value}])}," ("+i.toDisplayString(p.value)+"%) ",3)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0),i.createElementVNode("span",{class:i.normalizeClass(["whitespace-nowrap text-base flex items-center gap-1",{"text-gray-600":(w=s.value)==null?void 0:w.readOnly,"font-bold":!s.value&&!n.value}])},[i.createElementVNode("span",{class:i.normalizeClass({"text-nowrap":!0,"cursor-pointer underline decoration-dashed":h.value&&t.eventEmitter}),onClick:_[0]||(_[0]=()=>{var C;h.value&&((C=t.eventEmitter)==null||C.emit("cost:click",{product:r.value,cost:l.value}))})},i.toDisplayString(f.value),3),i.createTextVNode(" "+i.toDisplayString(t.showQuantityUnit?` ${r.value.currency.symbol}/${r.value.unit.name}`:"")+" ",1),l.value&&!s.value&&"discount"in t.product&&t.product.discount?(i.openBlock(),i.createBlock(k,{key:0},{trigger:i.withCtx(()=>[i.createVNode(N,{class:"text-sm text-black bg-amber-400 rounded p-px"})]),default:i.withCtx(()=>[i.createElementVNode("span",null,' На продукт действует скидка "'+i.toDisplayString(t.product.discount.name)+'"; ',1)]),_:1})):i.createCommentVNode("",!0)],2),g.value?(i.openBlock(),i.createElementBlock("span",Zf," ~ "+i.toDisplayString(g.value)+" "+i.toDisplayString(t.showQuantityUnit?`₽/${r.value.unit.name}`:""),1)):i.createCommentVNode("",!0),t.showCostDate&&!i.unref(M.isNil)(d.value)?(i.openBlock(),i.createElementBlock("span",Qf,[i.createTextVNode(i.toDisplayString(d.value)+" ",1),t.showPriceHistory&&t.eventEmitter?(i.openBlock(),i.createBlock(k,{key:0,placement:"top-end"},{trigger:i.withCtx(()=>[i.createVNode(R,{class:"cursor-pointer",onClick:_[1]||(_[1]=C=>{var x;return(x=t.eventEmitter)==null?void 0:x.emit("cost:show-price-history",{product:r.value})})})]),default:i.withCtx(()=>[_[2]||(_[2]=i.createTextVNode(" История цен ",-1))]),_:1})):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)],2)])}}}),em={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function tm(t,e){return i.openBlock(),i.createElementBlock("svg",em,[...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 Hs=i.markRaw({name:"ion-information-circle-outline",render:tm}),nm={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function im(t,e){return i.openBlock(),i.createElementBlock("svg",nm,[...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 tl=i.markRaw({name:"ion-images",render:im}),rm={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function sm(t,e){return i.openBlock(),i.createElementBlock("svg",rm,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"currentColor",d:"M400 480a16 16 0 0 1-10.63-4L256 357.41L122.63 476A16 16 0 0 1 96 464V96a64.07 64.07 0 0 1 64-64h192a64.07 64.07 0 0 1 64 64v368a16 16 0 0 1-16 16"},null,-1)])])}const om=i.markRaw({name:"ion-bookmark",render:sm});/*!
|
|
1
|
+
(function(X,I){typeof exports=="object"&&typeof module<"u"?I(exports,require("lodash-es"),require("vue"),require("naive-ui"),require("@snabcentr/common-lib"),require("date-fns"),require("libphonenumber-js"),require("ts-case-convert"),require("vue-tel-input")):typeof define=="function"&&define.amd?define(["exports","lodash-es","vue","naive-ui","@snabcentr/common-lib","date-fns","libphonenumber-js","ts-case-convert","vue-tel-input"],I):(X=typeof globalThis<"u"?globalThis:X||self,I(X.SC_VueUiLib={},X["lodash-es"],X.Vue,X["naive-ui"],X["@snabcentr/common-lib"],X["date-fns"],X["libphonenumber-js"],X["ts-case-convert"],X["vue-tel-input"]))})(this,(function(X,I,i,z,K,Tn,sr,zs,Qh){"use strict";var AS=Object.defineProperty;var Uh=X=>{throw TypeError(X)};var MS=(X,I,i)=>I in X?AS(X,I,{enumerable:!0,configurable:!0,writable:!0,value:i}):X[I]=i;var S=(X,I,i)=>MS(X,typeof I!="symbol"?I+"":I,i),Kh=(X,I,i)=>I.has(X)||Uh("Cannot "+i);var Ft=(X,I,i)=>(Kh(X,I,"read from private field"),i?i.call(X):I.get(X)),qa=(X,I,i)=>I.has(X)?Uh("Cannot add the same private member more than once"):I instanceof WeakSet?I.add(X):I.set(X,i),Gh=(X,I,i,z)=>(Kh(X,I,"write to private field"),z?z.call(X,i):I.set(X,i),i);var Bi,ft,Is;const Ya=t=>{if(t.key!=="Enter"&&t.code!=="Enter")return;const{target:e}=t;if(!(e instanceof HTMLInputElement)||e.type==="range")return;t.preventDefault();const r=[...t.currentTarget.querySelectorAll("input")].filter(a=>a.type!=="range"&&!a.readOnly&&!a.disabled),s=r.indexOf(e);if(s===-1)return;const o=r.at(s+1);o&&(o.focus(),o.select())},Ua={mounted(t){t.addEventListener("keydown",Ya)},unmounted(t){t.removeEventListener("keydown",Ya)}};var Ee=(t=>(t.AttachedUser="attached_user",t.ClientInfo="client_info",t.ClientInfoShort="client_info_short",t.CreatedAt="created_at",t.ClientCity="client_city",t.DeliveryInfo="delivery_info",t.DeliveryDate="delivery_date",t.Id="id",t.PaymentType="payment_type",t.SalesDirections="sales_directions",t.Status="status",t.actions="actions",t))(Ee||{}),Qe=(t=>(t.phone="phone",t.tablet="tablet",t.laptop="laptop",t))(Qe||{});class ai{static isVnodeEmpty(e){return e.every(n=>n.type===i.Comment||n.type===i.Text&&I.isString(n.children)&&!n.children.trim()?!0:n.type===i.Fragment&&ai.isVnodeEmpty(n.children))}static hasSlotContent(e){return e?!ai.isVnodeEmpty(e()):!1}}const tt=(t,e=!1)=>{const{key:n}=t;if(!["Backspace","Delete","Tab","Escape","Enter","ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End"].includes(n)&&!((t.ctrlKey||t.metaKey)&&["a","c","v","x","z","ф","с","м","ч","я"].includes(n.toLowerCase()))){if(e&&n==="-"){const r=t.target;if((r.selectionStart??0)===0&&!r.value.includes("-"))return}/^\d$/.test(n)||t.preventDefault()}},Ds=(t,e=".",n=!1)=>{const{key:r}=t,s=t.target;["Backspace","Delete","Tab","Escape","Enter","ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End"].includes(r)||(t.ctrlKey||t.metaKey)&&["a","c","v","x","z","ф","с","м","ч","я"].includes(r.toLowerCase())||n&&r==="-"&&!s.value.includes("-")&&((s.selectionStart??0)===0||s.value.length===0)||(r===e||r===(e==="."?",":"."))&&!s.value.includes(e)&&!s.value.includes(e==="."?",":".")||/^\d$/.test(r)||t.preventDefault()},lt=t=>t?Number.parseFloat(t.replace(",",".")):null,et=(t,e)=>{t[e]={}},Le=t=>{const e=t.target;setTimeout(()=>{e.select()},100)};class Vt{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(I.groupBy(l,r.key)).filter(c=>c.length>0).map(c=>{const d=c[0],u=I.isString(r.key)?I.get(d,r.key):r.key(c),h=I.isString(r.label)?I.get(d,r.label):r.label(c);return{type:"group",label:I.isEmpty(h)?"- Не определено -":h,key:`group_${u}`,children:c}})]}static convertReferencesToSelectOptionsList(e,n=!1,r=!1,s=!1,o=void 0,a=void 0){return Vt.convertReferencesToOptionsList(e,n,r,s,o,a)}static convertReferencesToAutocompleteOptionsList(e,n=!1,r=!1,s=!1,o=void 0,a=void 0){return Vt.convertReferencesToOptionsList(e,n,r,s,o,a)}}const Jh={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function ef(t,e){return i.openBlock(),i.createElementBlock("svg",Jh,[...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 Ls=i.markRaw({name:"ion-ellipsis-vertical-sharp",render:ef}),tf={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function nf(t,e){return i.openBlock(),i.createElementBlock("svg",tf,[...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 Ka=i.markRaw({name:"tabler-edit",render:nf}),rf={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function sf(t,e){return i.openBlock(),i.createElementBlock("svg",rf,[...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 Ga=i.markRaw({name:"ion-checkmark-done-circle",render:sf}),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-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 Za=i.markRaw({name:"ion-checkmark-done-circle-outline",render:af}),lf={viewBox:"0 0 32 32",width:"1.2em",height:"1.2em"};function cf(t,e){return i.openBlock(),i.createElementBlock("svg",lf,[...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 df=i.markRaw({name:"fluent-pin32-regular",render:cf}),uf={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function hf(t,e){return i.openBlock(),i.createElementBlock("svg",uf,[...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 ff=i.markRaw({name:"ion-eye-outline",render:hf}),mf={viewBox:"0 0 32 32",width:"1.2em",height:"1.2em"};function gf(t,e){return i.openBlock(),i.createElementBlock("svg",mf,[...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 pf=i.markRaw({name:"fluent-pin32-filled",render:gf}),yf={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function bf(t,e){return i.openBlock(),i.createElementBlock("svg",yf,[...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 _f=i.markRaw({name:"ion-bookmark-outline",render:bf}),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("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 kf=i.markRaw({name:"ion-eye-off-sharp",render:xf}),vf={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Cf(t,e){return i.openBlock(),i.createElementBlock("svg",vf,[...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 Sf=i.markRaw({name:"ion-chevron-forward-outline",render:Cf}),Bf=["data-name"],Tf={class:"sc-collapse-item-header flex flex-row gap-2.5"},$f={class:"sc-collapse-item-arrow flex-none cursor-pointer pt-1.5"},Nf={key:0},Rf={class:"sc-collapse-item-pre-arrow flex flex-none flex-row gap-1"},Pf={class:"flex flex-1 flex-col"},Ef={key:0,class:"sc-collapse-item-sub-title flex-1"},Ff={key:1,class:"sc-collapse-item-title-extra flex-none"},Vf={key:0,class:"sc-collapse-item-content"},If={},Af=i.defineComponent({...If,__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",I.noop),a=i.inject("defaultExpandedNames",[]),l=i.inject("expandedNames",[]),c=I.some(a,p=>p===r.name),d=i.computed(()=>I.some(l,p=>p===r.name)),u=i.ref(c),h=()=>{r.disabled||(u.value=d.value||!u.value,s("header:click",r.name,u.value),o(r.name,u.value))};return e({expand:()=>{!r.disabled&&!u.value&&(u.value=!0,s("header:click",r.name,u.value),o(r.name,u.value))},toggle:()=>{r.disabled||h()},collapse:()=>{!r.disabled&&u.value&&!d.value&&(u.value=!1,s("header:click",r.name,u.value),o(r.name,u.value))},expanded:i.readonly(u)}),(p,y)=>{const b=Sf;return i.openBlock(),i.createElementBlock("div",{"data-name":t.name,class:i.normalizeClass([{"cursor-not-allowed text-gray-400":t.disabled},"sc-collapse-item flex flex-col p-2"])},[i.createElementVNode("div",Tf,[i.createElementVNode("div",$f,[i.createElementVNode("div",{class:i.normalizeClass({"rotate-90":u.value}),onClick:h},[i.renderSlot(p.$slots,"arrow",{},()=>[i.createVNode(b)],!0)],2)]),i.unref(ai).hasSlotContent(p.$slots["pre-arrow"])?(i.openBlock(),i.createElementBlock("div",Nf,[i.createElementVNode("div",Rf,[i.renderSlot(p.$slots,"pre-arrow",{},void 0,!0)])])):i.createCommentVNode("",!0),i.createElementVNode("div",Pf,[i.createElementVNode("div",{class:"sc-collapse-item-title flex flex-1 cursor-pointer flex-col text-lg font-semibold",onClick:h},[i.renderSlot(p.$slots,"header",{},()=>[i.createTextVNode(i.toDisplayString(t.title),1)],!0)]),i.unref(ai).hasSlotContent(p.$slots["sub-header"])?(i.openBlock(),i.createElementBlock("div",Ef,[i.renderSlot(p.$slots,"sub-header",{},void 0,!0)])):i.createCommentVNode("",!0)]),i.unref(ai).hasSlotContent(p.$slots["header-extra"])?(i.openBlock(),i.createElementBlock("div",Ff,[i.renderSlot(p.$slots,"header-extra",{},void 0,!0)])):i.createCommentVNode("",!0)]),i.createVNode(i.Transition,{name:"fade"},{default:i.withCtx(()=>[d.value||u.value?(i.openBlock(),i.createElementBlock("div",Vf,[i.renderSlot(p.$slots,"default",{},void 0,!0)])):i.createCommentVNode("",!0)]),_:3})],10,Bf)}}}),Wn=(t,e)=>{const n=t.__vccOpts||t;for(const[r,s]of e)n[r]=s;return n},Qa=Wn(Af,[["__scopeId","data-v-f1311d1c"]]),Mf={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Of(t,e){return i.openBlock(),i.createElementBlock("svg",Mf,[...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 Ja=i.markRaw({name:"ion-cart-outline",render:Of}),or=Symbol(),zf={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"}},Df={class:"flex flex-col-reverse gap-2.5 sm:flex-row"},Lf={},el=i.defineComponent({...Lf,__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(or,"medium"),r=i.computed(()=>I.isFunction(e.showProductAddToCartButton)?e.showProductAddToCartButton(e.product):e.showProductAddToCartButton),s=i.computed(()=>I.isFunction(e.showProductEditButton)?e.showProductEditButton(e.product):e.showProductEditButton),o=i.computed(()=>I.isFunction(e.showProductRequiredButton)?e.showProductRequiredButton(e.product):e.showProductRequiredButton),a=i.computed(()=>I.isNil(e.productContextButtonsConfig)?[]:I.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})},u=h=>{e.eventEmitter.emit("product:context-select",{product:e.product,key:h})};return(h,f)=>{var N;const g=Za,m=Ga,p=z.NButton,y=z.NTooltip,b=Ka,_=Ja,B=Ls,x=z.NDropdown;return i.openBlock(),i.createElementBlock("div",Df,[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(m,{key:1})):(i.openBlock(),i.createBlock(g,{key:0}))]),_:1},8,["size","disabled","type"])]),default:i.withCtx(()=>[f[0]||(f[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(()=>[f[1]||(f[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(()=>[f[2]||(f[2]=i.createTextVNode(" Добавить в корзину ",-1))]),_:1})):i.createCommentVNode("",!0),((N=a.value)==null?void 0:N.length)>0?(i.openBlock(),i.createBlock(x,{key:3,options:a.value,size:i.unref(n),trigger:"click",onSelect:u},{default:i.withCtx(()=>[i.createVNode(p,{ghost:!0,size:i.unref(n),type:"primary"},{default:i.withCtx(()=>[i.createVNode(B)]),_:1},8,["size"])]),_:1},8,["options","size"])):i.createCommentVNode("",!0)])}}}),Hf={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Wf(t,e){return i.openBlock(),i.createElementBlock("svg",Hf,[...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 jf=i.markRaw({name:"tabler-history",render:Wf}),qf={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Xf(t,e){return i.openBlock(),i.createElementBlock("svg",qf,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"currentColor",d:"m18.5 3.5l2 2l-15 15l-2-2zM7 4c1.66 0 3 1.34 3 3s-1.34 3-3 3s-3-1.34-3-3s1.34-3 3-3m10 10c1.66 0 3 1.34 3 3s-1.34 3-3 3s-3-1.34-3-3s1.34-3 3-3M7 6c-.55 0-1 .45-1 1s.45 1 1 1s1-.45 1-1s-.45-1-1-1m10 10c-.55 0-1 .45-1 1s.45 1 1 1s1-.45 1-1s-.45-1-1-1"},null,-1)])])}const Yf=i.markRaw({name:"mdi-percent-outline",render:Xf}),Uf={class:"flex flex-row gap-1"},Kf={key:0,class:"flex gap-1"},Gf={key:0,class:"flex text-nowrap text-sm line-through"},Zf={key:1,class:"flex flex-row text-nowrap text-sm"},Qf={key:2,class:"flex flex-row gap-1 text-nowrap text-sm text-gray-600"},Jf={},jn=i.defineComponent({...Jf,__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){var y;const e=t,n=i.computed(()=>"product"in e.product),r=i.computed(()=>"product"in e.product?e.product.product:e.product),s=i.computed(()=>I.find(r.value.priceCoefficients,["coefficient.slug",e.costFieldName])),o=i.computed(()=>{const b=I.find(r.value.priceCoefficients,["coefficient.slug","k0"]);return s.value||!b||I.isNil(l.value)||I.isNil(b.cost)?!1:l.value<b.cost}),a=((y=K.useBaseConfigStateStore().getConfig())==null?void 0:y.defaultCurrency)??"RUB",l=i.computed(()=>s.value?s.value.cost:I.get(e.product,e.costFieldName)),c=i.computed(()=>e.additionalThroughFieldName?I.get(e.product,e.additionalThroughFieldName):void 0),d=i.computed(()=>r.value.costDate?Tn.format(r.value.costDate,K.useBaseConfigStateStore().config.dateFormats.uiDate):void 0),u=i.computed(()=>e.currencyRates||r.value.currency.signature===a?e.currencyRates:{[r.value.currency.signature]:r.value.costRub/r.value.cost}),h=i.computed(()=>(I.isFunction(e.allowPriceClick)?e.allowPriceClick(r.value):e.allowPriceClick)&&!I.isNil(l.value)),f=i.computed(()=>I.isNil(l.value)?"-":new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:2}).format(Number.parseFloat(l.value))),g=i.computed(()=>{if(r.value.currency.signature===a||!u.value||!u.value[r.value.currency.signature])return null;const b=u.value[r.value.currency.signature];return new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:2}).format(Number.parseFloat(l.value)*b)}),m=i.computed(()=>I.isNil(c.value)?null:new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:2}).format(c.value)),p=i.computed(()=>{if(!c.value||!l.value||c.value===l.value||l.value===0)return null;const b=(l.value-c.value)/c.value*100;return new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:2,maximumFractionDigits:2}).format(b)});return(b,_)=>{var w;const B=z.NTag,x=z.NTooltip,N=Yf,R=jf;return i.openBlock(),i.createElementBlock("div",Uf,[t.showTag?(i.openBlock(),i.createBlock(x,{key:0},{trigger:i.withCtx(()=>[i.createVNode(B,{round:"",bordered:!1,size:"small",class:i.normalizeClass(["text-slate-600",{"font-bold":!s.value}])},{default:i.withCtx(()=>{var C;return[i.createTextVNode(i.toDisplayString(((C=s.value)==null?void 0:C.coefficient.slug)??"Ц"),1)]}),_:1},8,["class"])]),default:i.withCtx(()=>{var C;return[i.createTextVNode(" "+i.toDisplayString(((C=s.value)==null?void 0:C.coefficient.name)??"Розничная цена"),1)]}),_:1})):i.createCommentVNode("",!0),i.createElementVNode("div",{class:i.normalizeClass({"!text-red-600":o.value})},[c.value&&c.value!==l.value||p.value?(i.openBlock(),i.createElementBlock("div",Kf,[c.value&&c.value!==l.value?(i.openBlock(),i.createElementBlock("span",Gf,i.toDisplayString(m.value)+" "+i.toDisplayString(t.showQuantityUnit?` ${r.value.currency.symbol}/${r.value.unit.name}`:""),1)):i.createCommentVNode("",!0),p.value?(i.openBlock(),i.createElementBlock("span",{key:1,class:i.normalizeClass(["flex text-nowrap text-sm text-gray-600",{"!text-red-600":o.value}])}," ("+i.toDisplayString(p.value)+"%) ",3)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0),i.createElementVNode("span",{class:i.normalizeClass(["whitespace-nowrap text-base flex items-center gap-1",{"text-gray-600":(w=s.value)==null?void 0:w.readOnly,"font-bold":!s.value&&!n.value}])},[i.createElementVNode("span",{class:i.normalizeClass({"text-nowrap":!0,"cursor-pointer underline decoration-dashed":h.value&&t.eventEmitter}),onClick:_[0]||(_[0]=()=>{var C;h.value&&((C=t.eventEmitter)==null||C.emit("cost:click",{product:r.value,cost:l.value}))})},i.toDisplayString(f.value),3),i.createTextVNode(" "+i.toDisplayString(t.showQuantityUnit?` ${r.value.currency.symbol}/${r.value.unit.name}`:"")+" ",1),l.value&&!s.value&&"discount"in t.product&&t.product.discount?(i.openBlock(),i.createBlock(x,{key:0},{trigger:i.withCtx(()=>[i.createVNode(N,{class:"text-sm text-black bg-amber-400 rounded p-px"})]),default:i.withCtx(()=>[i.createElementVNode("span",null,' На продукт действует скидка "'+i.toDisplayString(t.product.discount.name)+'"; ',1)]),_:1})):i.createCommentVNode("",!0)],2),g.value?(i.openBlock(),i.createElementBlock("span",Zf," ~ "+i.toDisplayString(g.value)+" "+i.toDisplayString(t.showQuantityUnit?`₽/${r.value.unit.name}`:""),1)):i.createCommentVNode("",!0),t.showCostDate&&!i.unref(I.isNil)(d.value)?(i.openBlock(),i.createElementBlock("span",Qf,[i.createTextVNode(i.toDisplayString(d.value)+" ",1),t.showPriceHistory&&t.eventEmitter?(i.openBlock(),i.createBlock(x,{key:0,placement:"top-end"},{trigger:i.withCtx(()=>[i.createVNode(R,{class:"cursor-pointer",onClick:_[1]||(_[1]=C=>{var k;return(k=t.eventEmitter)==null?void 0:k.emit("cost:show-price-history",{product:r.value})})})]),default:i.withCtx(()=>[_[2]||(_[2]=i.createTextVNode(" История цен ",-1))]),_:1})):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)],2)])}}}),em={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function tm(t,e){return i.openBlock(),i.createElementBlock("svg",em,[...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 Hs=i.markRaw({name:"ion-information-circle-outline",render:tm}),nm={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function im(t,e){return i.openBlock(),i.createElementBlock("svg",nm,[...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 tl=i.markRaw({name:"ion-images",render:im}),rm={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function sm(t,e){return i.openBlock(),i.createElementBlock("svg",rm,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"currentColor",d:"M400 480a16 16 0 0 1-10.63-4L256 357.41L122.63 476A16 16 0 0 1 96 464V96a64.07 64.07 0 0 1 64-64h192a64.07 64.07 0 0 1 64 64v368a16 16 0 0 1-16 16"},null,-1)])])}const om=i.markRaw({name:"ion-bookmark",render:sm});/*!
|
|
2
2
|
* lightgallery | 2.9.0 | October 1st 2025
|
|
3
3
|
* http://www.lightgalleryjs.com/
|
|
4
4
|
* 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 Or=function(){return Or=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},Or.apply(this,arguments)},cm={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"},Ws=500,dm=(function(){function t(e,n){return this.core=e,this.$LG=n,this.settings=Or(Or({},cm),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),u=d.allowY,h=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 f=this.getPossibleSwipeDragCords(n),g,m,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,m=y/b}else{var b=(e-n)*n;g=p*b,m=y*b}r&&(h?this.isBeyondPossibleLeft(g,f.minX)?g=f.minX:this.isBeyondPossibleRight(g,f.maxX)&&(g=f.maxX):e>1&&(g<f.minX?g=f.minX:g>f.maxX&&(g=f.maxX)),u?this.isBeyondPossibleTop(m,f.minY)?m=f.minY:this.isBeyondPossibleBottom(m,f.maxY)&&(m=f.maxY):e>1&&(m<f.minY?m=f.minY:m>f.maxY&&(m=f.maxY))),this.setZoomStyles({x:g,y:m,scale:e}),this.left=g,this.top=m,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)},Ws),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")}},Ws+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},Ws+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 u=Math.max(1,s+-d*.02);e.scale=Math.round((u+Number.EPSILON)*100)/100;var h=e.scale-o;e.zoomImage(e.scale,Math.round((h+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 u=this.core.getSlideItem(this.core.index).find(".lg-img-wrap").first(),h={};h.x=this.left+a,h.y=this.top+l;var f=this.getPossibleSwipeDragCords();(Math.abs(a)>15||Math.abs(l)>15)&&(s&&(this.isBeyondPossibleTop(h.y,f.minY)?h.y=f.minY:this.isBeyondPossibleBottom(h.y,f.maxY)&&(h.y=f.maxY)),r&&(this.isBeyondPossibleLeft(h.x,f.minX)?h.x=f.minX:this.isBeyondPossibleRight(h.x,f.maxX)&&(h.x=f.maxX)),s?this.top=h.y:h.y=this.top,r?this.left=h.x:h.x=this.left,this.setZoomSwipeStyles(u,h),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 u=a.x-o.maxX;a.x=o.maxX+u/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,u=(this.containerRect.width-a)/2,h={minY:l,maxY:c,minX:d,maxX:u};return h},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,u,h=this.core.getSlideItem(this.core.index);this.core.$inner.on("touchstart.lg",function(f){if(e.isImageSlide(e.core.index)&&(h=e.core.getSlideItem(e.core.index),(e.$LG(f.target).hasClass("lg-item")||h.get().contains(f.target))&&f.touches.length===1&&e.core.outer.hasClass("lg-zoomed"))){f.preventDefault(),l=new Date,e.core.touchAction="zoomSwipe",u=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(f)),d=e.getPossibleSwipeDragCords(),e.core.outer.addClass("lg-zoom-dragging lg-zoom-drag-transition")}}),this.core.$inner.on("touchmove.lg",function(f){if(f.touches.length===1&&e.core.touchAction==="zoomSwipe"&&(e.$LG(f.target).hasClass("lg-item")||h.get().contains(f.target))){f.preventDefault(),e.core.touchAction="zoomSwipe",r=e.getSwipeCords(f);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(u,g))}}),this.core.$inner.on("touchend.lg",function(f){if(e.core.touchAction==="zoomSwipe"&&(e.$LG(f.target).hasClass("lg-item")||h.get().contains(f.target))){if(f.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,u,h;this.core.outer.on("mousedown.lg.zoom",function(f){if(e.isImageSlide(e.core.index)){var g=e.core.getSlideItem(e.core.index);if(e.$LG(f.target).hasClass("lg-item")||g.get().contains(f.target)){c=new Date,h=e.core.getSlideItem(e.core.index).find(".lg-img-wrap").first();var m=e.getDragAllowedAxises(0);l=m.allowY,a=m.allowX,e.core.outer.hasClass("lg-zoomed")&&e.$LG(f.target).hasClass("lg-object")&&(a||l)&&(f.preventDefault(),n=e.getDragCords(f),u=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(f){if(s){o=!0,r=e.getDragCords(f);var g=e.getZoomSwipeCords(n,r,a,l,u);e.setZoomSwipeStyles(h,g)}}),this.$LG(window).on("mouseup.lg.zoom.global"+this.core.lgId,function(f){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(f);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 um={ref:"gallery-container",class:"lightgallery-wrapper"},hm={},nl=i.defineComponent({...hm,__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}),M.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",um,[i.renderSlot(o.$slots,"default")],512))}}),ut=class ut{static init(){ut.isInitialized||(ut.isInitialized=!0,ut.windowResizeHandler(),window.addEventListener("resize",ut.windowResizeHandler))}static destroy(){window.removeEventListener("resize",ut.windowResizeHandler),ut.isInitialized=!1}static getDeviceTypeByResolution(){const e=K.useBaseConfigStateStore().config.deviceTypeByResolution;return window.innerWidth<e.tablet?Qe.phone:window.innerWidth<e.laptop?Qe.tablet:Qe.laptop}static initRefDependingOnDeviceResolution(e,n,r){const s=i.ref(r);return ut.setRefValueDependingOnDeviceResolution(s,e,n,r),ut.refsDependingOnDeviceResolution.push({r:s,phoneValue:e,tabletValue:n,defaultValue:r}),s}static isPhoneDevice(){return ut.getDeviceTypeByResolution()===Qe.phone}static isTabletDevice(){return ut.getDeviceTypeByResolution()===Qe.tablet}static isLaptopDevice(){return ut.getDeviceTypeByResolution()===Qe.laptop}static setRefValueDependingOnDeviceResolution(e,n,r,s){switch(ut.getDeviceTypeByResolution()){case Qe.phone:e.value=n;break;case Qe.tablet:e.value=r;break;default:e.value=s;break}}static windowResizeHandler(){M.forEach(ut.refsDependingOnDeviceResolution,e=>{ut.setRefValueDependingOnDeviceResolution(e.r,e.phoneValue,e.tabletValue,e.defaultValue)})}};S(ut,"isInitialized",!1),S(ut,"refsDependingOnDeviceResolution",[]);let St=ut;const fm=["href"],mm=["src","alt"],gm={},il=i.defineComponent({...gm,__name:"image-gallery",props:{images:{}},setup(t,{expose:e}){const n=i.ref(!1),r=i.ref(!1),s=i.ref({plugins:[lm,dm],addClass:"sc-lg-container",licenseKey:"0000-0000-000-0000",strings:{closeGallery:"Закрыть",download:"Скачать",mediaLoadingFailed:"Ошибка загрузки контента...",nextSlide:"Следующее изображение",playVideo:"Воспроизвести видео",previousSlide:"Предыдущее изображение",toggleMaximize:"Расширить"}}),o=()=>window.innerWidth*(St.getDeviceTypeByResolution()===Qe.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,u)=>{const h=tl,f=z.NPopover;return i.openBlock(),i.createBlock(f,{trigger:"manual",show:n.value,class:"sc-image",placement:"top-start",onClickoutside:u[3]||(u[3]=()=>{r.value||(n.value=!1)})},{trigger:i.withCtx(()=>[i.createElementVNode("div",{class:"inline-flex",onClick:u[0]||(u[0]=g=>n.value=!n.value)},[i.renderSlot(d.$slots,"default",{},()=>[i.createVNode(h)])])]),default:i.withCtx(()=>[i.createVNode(nl,{settings:s.value,style:i.normalizeStyle(`max-width: ${a.value}px`),class:"flex flex-row overflow-x-scroll",onAfterOpen:u[1]||(u[1]=()=>{r.value=!0}),onAfterClose:u[2]||(u[2]=()=>{r.value=!1,n.value=!1})},{default:i.withCtx(()=>[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(t.images,(g,m)=>(i.openBlock(),i.createElementBlock("a",{key:m,href:g.image},[i.createElementVNode("img",{src:g.preview,alt:`Изображение #${m+1}`},null,8,mm)],8,fm))),128))]),_:1},8,["settings","style"])]),_:3},8,["show"])}}}),pm={class:"text-sm grid grid-cols-[auto_auto] gap-x-3 gap-y-1 items-baseline"},ym={class:"pr-3"},bm={class:"text-right"},_m={},wm=i.defineComponent({..._m,__name:"product-stock-count",props:{product:{}},setup(t){return(e,n)=>{const r=Hs,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",pm,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(t.product.stockCount,(o,a)=>(i.openBlock(),i.createElementBlock(i.Fragment,{key:a},[i.createElementVNode("span",ym,i.toDisplayString(o.warehouse.name),1),i.createElementVNode("span",bm,[i.createTextVNode(i.toDisplayString(o.count??"В наличии")+" ",1),o.count?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[i.createTextVNode(i.toDisplayString(t.product.unit.name),1)],64)):i.createCommentVNode("",!0)])],64))),128))])]),_:3})}}}),xm={class:"flex flex-row justify-between"},km={class:"inline-flex flex-row gap-0.5 mr-2 align-sub"},vm={key:0},Cm={class:"ml-2 align-sub"},Sm={class:"flex cursor-pointer flex-row gap-2 whitespace-nowrap"},Bm={class:"@container"},Tm={class:"text-sc-dark-grey @sm:grid-cols-2 @2xl:grid-cols-3 grid grid-cols-1 gap-1 text-sm"},$m={key:0,class:"sc-supplier-sku col-span-2 whitespace-nowrap text-wrap sm:col-span-3"},Nm={class:"text-sc-dark-grey"},Rm={key:1,class:"sc-product-code col-start-1 whitespace-nowrap"},Pm={class:"text-gray-600"},Em={class:"flex cursor-pointer flex-row gap-1 whitespace-nowrap"},Fm={key:3,class:"underline decoration-dashed"},Vm={key:4,class:"sc-product-pack whitespace-nowrap"},Im={class:"text-gray-600"},Am={key:5,class:"sc-product-planning-incoming-date col-span-2 col-start-1 mt-1.5 text-wrap"},Mm={class:"text-gray-600"},Om={key:0,class:"mt-3 flex flex-row gap-3 pb-2 text-base xl:text-lg"},zm={key:0},Dm={class:"sc-product-properties m-0 mt-3 list-inside list-disc p-0 pl-1.5 text-xs text-gray-500"},Lm={},lr=i.defineComponent({...Lm,__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(()=>M.isFunction(n.showProductCosts)?n.showProductCosts(n.product):n.showProductCosts),s=i.computed(()=>M.sortBy(n.product.priceCoefficients,["coefficient.slug"])),o=i.computed(()=>{var h,f;return(f=(h=n.product)==null?void 0:h.properties)==null?void 0:f.planingIncomingDate}),a=i.useTemplateRef("image-gallery"),l=()=>{var h;(h=a.value)==null||h.show()},c=i.computed(()=>M.isFunction(n.allowNameClick)?n.allowNameClick(n.product):n.allowNameClick),d=i.computed(()=>{var h;return n.showProductAddToCartButton||n.showProductEditButton||n.showProductRequiredButton||(((h=n.productContextButtonsConfig)==null?void 0:h.length)??0)>0}),u=()=>{var h;c.value&&((h=n.eventEmitter)==null||h.emit("product:name-click",{product:n.product,exposedMethods:{showProductImagesPreview:l}}))};return e({showProductImagesPreview:l}),(h,f)=>{var N,R,w,C;const g=om,m=z.NTooltip,p=Ja,y=tl,b=z.NText,_=el,B=Hs,k=z.NScrollbar;return i.openBlock(),i.createElementBlock("div",null,[i.createElementVNode("div",xm,[i.createVNode(b,{type:"info",class:"sc-product-name text-balance text-base font-medium"},{default:i.withCtx(()=>{var x,T;return[i.createElementVNode("div",km,[((x=t.product)==null?void 0:x.isFavorite)??!1?(i.openBlock(),i.createBlock(m,{key:0,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(g,{class:"!text-yellow-300"})]),default:i.withCtx(()=>[f[0]||(f[0]=i.createTextVNode(" Избранный товар ",-1))]),_:1})):i.createCommentVNode("",!0),((T=t.product)==null?void 0:T.isPreviouslyOrdered)??!1?(i.openBlock(),i.createBlock(m,{key:1,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(p,{class:"!text-green-700"})]),default:i.withCtx(()=>[f[1]||(f[1]=i.createTextVNode(" Ранее заказанный товар ",-1))]),_:1})):i.createCommentVNode("",!0)]),i.createElementVNode("span",{class:i.normalizeClass({"cursor-pointer":c.value&&t.eventEmitter}),onClick:u},i.toDisplayString(t.product.name),3),t.product.onOrder?(i.openBlock(),i.createElementBlock("span",vm," [Под заказ] ")):i.createCommentVNode("",!0),i.createElementVNode("span",Cm,[t.product.images&&t.product.images.length>0?(i.openBlock(),i.createBlock(il,{key:0,ref:"image-gallery",images:t.product.images},{default:i.withCtx(()=>[i.createElementVNode("div",Sm,[i.createVNode(y)])]),_:1},8,["images"])):i.createCommentVNode("",!0)])]}),_:1}),d.value?(i.openBlock(),i.createBlock(_,{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",Bm,[i.createElementVNode("div",Tm,[t.product.supplierSku?(i.openBlock(),i.createElementBlock("div",$m,[f[2]||(f[2]=i.createTextVNode(" Артикул производителя/поставщика: ",-1)),i.createElementVNode("span",Nm,i.toDisplayString(t.product.supplierSku),1)])):i.createCommentVNode("",!0),t.showCode?(i.openBlock(),i.createElementBlock("span",Rm,[f[3]||(f[3]=i.createTextVNode(" Артикул: ",-1)),i.createElementVNode("span",Pm,i.toDisplayString(t.product.code),1)])):i.createCommentVNode("",!0),t.product.stockCount&&t.product.stockCount.length>0?(i.openBlock(),i.createBlock(wm,{key:2,product:t.product},{default:i.withCtx(()=>[i.createElementVNode("span",Em,[f[4]||(f[4]=i.createElementVNode("span",{class:"underline decoration-dashed"},"В наличии",-1)),i.createVNode(B,{class:"mt-0.5"})])]),_:1},8,["product"])):(i.openBlock(),i.createElementBlock("span",Fm," Нет в наличии ")),t.product.pack??((R=(N=t.product)==null?void 0:N.properties)==null?void 0:R.pack)?(i.openBlock(),i.createElementBlock("span",Vm,[f[5]||(f[5]=i.createTextVNode(" Норма упаковки: ",-1)),i.createElementVNode("span",Im,i.toDisplayString(t.product.pack??((C=(w=t.product)==null?void 0:w.properties)==null?void 0:C.pack)),1)])):i.createCommentVNode("",!0),t.showPlanningDates&&o.value?(i.openBlock(),i.createElementBlock("span",Am,[f[6]||(f[6]=i.createTextVNode(" Планируемая дата поступления на основной склад: ",-1)),i.createElementVNode("span",Mm,i.toDisplayString(o.value),1)])):i.createCommentVNode("",!0)])]),i.createVNode(k,{"x-scrollable":""},{default:i.withCtx(()=>[r.value?(i.openBlock(),i.createElementBlock("div",Om,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(s.value,x=>(i.openBlock(),i.createBlock(jn,{key:x.coefficient.slug,product:t.product,"cost-field-name":x.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(jn,{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",zm,[i.createElementVNode("ul",Dm,[t.showSlugs?(i.openBlock(!0),i.createElementBlock(i.Fragment,{key:0},i.renderList({id:t.product.id,slug:t.product.slug},(x,T)=>(i.openBlock(),i.createElementBlock("li",{key:T}," ("+i.toDisplayString(T)+"): "+i.toDisplayString(x),1))),128)):i.createCommentVNode("",!0),t.showProperties?(i.openBlock(!0),i.createElementBlock(i.Fragment,{key:1},i.renderList(t.product.properties,(x,T)=>(i.openBlock(),i.createElementBlock("li",{key:T}," ("+i.toDisplayString(T)+"): "+i.toDisplayString(x),1))),128)):i.createCommentVNode("",!0)])])):i.createCommentVNode("",!0)])}}}),Hm=(t,e,n)=>({key:t,title:e,className:"align-top",resizable:!0,render:r=>i.h(jn,{product:r,costFieldName:t,eventEmitter:n.eventEmitter,allowPriceClick:n.allowPriceClick,currencyRates:n.currencyRates})}),Wm=(t,e)=>{if(t.length===0)return[];const n=[],r={};switch(M.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})}})}}),St.getDeviceTypeByResolution()){case Qe.phone:case Qe.tablet:n.push({key:"name",title:"Наименование",className:"align-top",render:s=>i.h(lr,{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(lr,{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&&(M.forEach(t,s=>{M.forEach(s.priceCoefficients,o=>{r[o.coefficient.slug??""]||(r[o.coefficient.slug??""]=o.coefficient)})}),M.forEach(M.sortBy(r,["slug"]),s=>{n.push(Hm(s.slug??"",s.name,e))}),n.push({key:"cost",title:"Цена",className:"align-top",resizable:!0,render:s=>i.h(jn,{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||!M.isNil(e.productContextButtonsConfig))&&n.push({key:"actions",title:"",className:"align-top",width:"50",render:s=>i.h(el,{product:s,eventEmitter:e.eventEmitter,showProductAddToCartButton:e.showProductAddToCartButton,showProductEditButton:e.showProductEditButton,showProductRequiredButton:e.showProductRequiredButton,productContextButtonsConfig:e.productContextButtonsConfig})});break}return n},jm={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function qm(t,e){return i.openBlock(),i.createElementBlock("svg",jm,[...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 zr=i.markRaw({name:"ion-trash",render:qm}),Xm={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Ym(t,e){return i.openBlock(),i.createElementBlock("svg",Xm,[...e[0]||(e[0]=[i.createElementVNode("path",{d:"M448 224H288V64h-64v160H64v64h160v160h64V288h160z",fill:"currentColor"},null,-1)])])}const rl=i.markRaw({name:"ion-plus",render:Ym}),Um={key:0,class:"flex w-fit items-center gap-2"},Km={key:1,class:"flex flex-wrap gap-1"},Gm={key:0},Zm={key:2},Qm={},cr=i.defineComponent({...Qm,__name:"configurators-product-info",props:{isProductSearching:{type:Boolean,default:!1},product:{default:void 0},validation:{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,a=z.NText;return t.isProductSearching?(i.openBlock(),i.createElementBlock("div",Um,[i.createVNode(o,{size:17,class:"w-fit"}),s[0]||(s[0]=i.createElementVNode("div",null,"Выполняется поиск товара ...",-1))])):t.product&&!t.product.isNewRec()?(i.openBlock(),i.createElementBlock("div",Km,[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.name),1),n.value?(i.openBlock(),i.createElementBlock("div",Gm,"(Планируемая дата производства: "+i.toDisplayString(n.value)+")",1)):i.createCommentVNode("",!0)])):t.validation?(i.openBlock(),i.createElementBlock("div",Zm,[i.createVNode(a,{type:t.validation.validationStatus},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(t.validation.feedback),1)]),_:1},8,["type"])])):i.createCommentVNode("",!0)}}}),ae={required:{type:"number",required:!0,trigger:["blur","input"],message:"Это поле обязательно для заполнения"},min(t){return{type:"number",min:t,trigger:["blur","input"],message:`Минимальное значение: ${t}`}},max(t){return{type:"number",max:t,trigger:["blur","input"],message:`Максимальное значение: ${t}`}},step(t){return{type:"number",trigger:["blur","input"],validator:(e,n)=>n===null||Math.abs(n/t-Math.round(n/t))<1e-10?!0:new Error(`Значение должно быть кратно ${t}`)}}},We={serverValidation(t){return{validator:(e,n)=>n===null?!0:t?new Error(t):!0}}},Jm={class:"flex flex-col gap-4"},eg={class:"flex flex-col gap-2"},tg={class:"mt-8 font-bold"},ng={class:"grid grow grid-cols-2 items-start gap-2"},ig={key:2,class:"text-red-500 text-sm"},rg={key:3,class:"text-red-500 text-sm mb-2"},sg={class:"flex flex-col gap-4"},og={key:1},ag={class:"text-lg font-semibold"},lg={class:"flex gap-3"},cg={},dg=i.defineComponent({...cg,__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,{expose:e,emit:n}){var y;const r=t,s=n,o=i.useTemplateRef("form-reference"),a=i.ref(!1),l=i.ref(M.cloneDeep(r.value)),c=i.computed(()=>{var _,B,k;const b={"configuratorParams.length":[ae.required,ae.min(r.settings.stripMinLength),ae.max(r.settings.stripMaxLength||Number.MAX_VALUE),ae.step(r.settings.lengthStep),We.serverValidation((_=r.validation.length)==null?void 0:_.feedback)],quantity:[ae.required,ae.min(1),ae.step(1),We.serverValidation((B=r.validation.quantity)==null?void 0:B.feedback)],marker:[We.serverValidation((k=r.validation.marker)==null?void 0:k.feedback)]};return M.forEach(l.value.configuratorParams.linesWidths,(N,R)=>{var x;const C=l.value.configuratorParams.linesWidths.length>1?r.settings.minLineWidth:r.settings.stripMinWidth;b[`configuratorParams.linesWidths.${R}`]=[ae.required,ae.min(C),ae.max(r.settings.maxLineWidth),ae.step(r.settings.lineWidthStep),We.serverValidation((x=r.validation[`lines_widths[${R+1}]`])==null?void 0:x.feedback)]}),M.forEach(l.value.configuratorParams.linesAngles,(N,R)=>{var w;b[`configuratorParams.linesAngles.${R}`]=[ae.required,ae.min(r.settings.minLineAngle),ae.max(r.settings.maxLineAngle),ae.step(r.settings.lineAngleStep),We.serverValidation((w=r.validation[`lines_angles[${R+1}]`])==null?void 0:w.feedback)]}),b}),d=i.ref(r.settings.canSetDopProdaga??!1),u=i.computed(()=>{var N;const{length:b}=l.value.configuratorParams,{quantity:_}=l.value,B=((N=l.value.product)==null?void 0:N.costRub)||0;if(!b||!_||B===0)return null;const k=b/1e3;return(B*_*k).toLocaleString("ru-ru",{maximumFractionDigits:2,minimumFractionDigits:2})}),h=i.computed(()=>M.reduce(l.value.configuratorParams.linesWidths,(b,_)=>b+(_||0),0)),f=i.computed(()=>{const b=h.value;return b>=r.settings.stripMinWidth&&b<=r.settings.stripMaxWidth}),g=i.computed(()=>{const{configuratorParams:b}=l.value,_=M.every(b.linesWidths,R=>!!(R&&R>0)),B=M.every(b.linesAngles,R=>!M.isNil(R)),k=!!(l.value.quantity&&l.value.quantity>0),N=b.length>0&&b.length>0;return _&&B&&k&&N&&f.value}),m=()=>{i.nextTick(()=>{var b;(b=o.value)==null||b.validate(_=>{_||(s("update:params",l.value.configuratorParams),p("configuratorParams",l.value.configuratorParams))}).catch(M.noop)})},p=(b,_)=>{const B=new K.OrderItemBase(l.value);B[b]=_,b==="configuratorParams"&&(B.product=new K.ClientProduct),s("update:value",B)};return i.watch(()=>r.previewParams,b=>{l.value.configuratorParams.linesWidths=b.linesWidths,l.value.configuratorParams.linesAngles=b.linesAngles},{deep:!0}),i.watch(()=>r.value,b=>{l.value=M.cloneDeep(b)},{deep:!0}),e({validate:(y=o.value)==null?void 0:y.validate,formReference:o}),(b,_)=>{const B=rl,k=zr,N=z.NCheckbox;return i.openBlock(),i.createBlock(i.unref(z.NForm),{ref:"form-reference",model:l.value,rules:c.value,class:"flex flex-col gap-4 sc-hide-empty-feedback-message",onKeydown:_[20]||(_[20]=i.withKeys(i.withModifiers(R=>s("submit",l.value),["prevent"]),["enter"]))},{default:i.withCtx(()=>{var R;return[i.createElementVNode("div",Jm,[_[22]||(_[22]=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:l.value.configuratorParams.startTailType,"onUpdate:value":[_[0]||(_[0]=w=>l.value.configuratorParams.startTailType=w),m],options:t.settings.startTailConfigs.map(({label:w},C)=>({label:w,value:C})),placeholder:"Тип стартового капельника"},null,8,["value","options"])]),_:1})):i.createCommentVNode("",!0),i.createElementVNode("div",eg,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(l.value.configuratorParams.linesAngles,(w,C)=>(i.openBlock(),i.createElementBlock("div",{key:C,class:"flex items-start gap-2"},[i.createElementVNode("div",tg,i.toDisplayString(C+1),1),i.createElementVNode("div",ng,[i.createVNode(i.unref(z.NFormItem),{path:`configuratorParams.linesWidths.${C}`,label:"Ширина, мм"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInputNumber),{value:l.value.configuratorParams.linesWidths[C],"onUpdate:value":[x=>l.value.configuratorParams.linesWidths[C]=x,_[2]||(_[2]=x=>m())],parse:i.unref(lt),"show-button":!1,class:"w-full",onKeydown:_[1]||(_[1]=x=>i.unref(tt)(x)),onInput:x=>i.unref(et)(t.validation,`lines_widths[${C+1}]`),onFocus:i.unref(Le)},null,8,["value","onUpdate:value","parse","onInput","onFocus"])]),_:2},1032,["path"]),i.createVNode(i.unref(z.NFormItem),{path:`configuratorParams.linesAngles.${C}`,label:"Угол сгиба, °"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInputNumber),{value:l.value.configuratorParams.linesAngles[C],"onUpdate:value":[x=>l.value.configuratorParams.linesAngles[C]=x,_[4]||(_[4]=x=>m())],parse:i.unref(lt),"show-button":!1,class:"w-full",onKeydown:_[3]||(_[3]=x=>i.unref(tt)(x,!0)),onInput:x=>i.unref(et)(t.validation,`lines_angles[${C+1}]`),onFocus:i.unref(Le)},null,8,["value","onUpdate:value","parse","onInput","onFocus"])]),_:2},1032,["path"])]),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:x=>s("click:add-line",C)},{default:i.withCtx(()=>[i.createVNode(B)]),_:1},8,["onClick"])),t.settings.showOnlyTemplates?i.createCommentVNode("",!0):(i.openBlock(),i.createBlock(i.unref(z.NButton),{key:1,disabled:l.value.configuratorParams.linesWidths.length===1,size:"medium",class:"ml-2",onClick:x=>s("click:remove-line",C)},{default:i.withCtx(()=>[i.createVNode(k)]),_: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:l.value.configuratorParams.endTailType,"onUpdate:value":[_[5]||(_[5]=w=>l.value.configuratorParams.endTailType=w),m],options:t.settings.endTailConfigs.map(({label:w},C)=>({label:w,value:C})),placeholder:"Тип конечного капельника"},null,8,["value","options"])]),_:1})):i.createCommentVNode("",!0),i.createVNode(cr,{"is-product-searching":t.isProductSearching,product:l.value.product,validation:t.validation.product},null,8,["is-product-searching","product","validation"]),f.value?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("div",ig," Суммарная ширина участков гиба должна быть от "+i.toDisplayString(t.settings.stripMinWidth)+" до "+i.toDisplayString(t.settings.stripMaxWidth)+" мм., текущая ширина: "+i.toDisplayString(h.value)+" мм. ",1)),g.value?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("div",rg," Пожалуйста, заполните все обязательные поля корректно. ")),t.settings.allowSaveTemplates&&t.selectTemplateIndex===((R=t.settings.allTemplates)==null?void 0:R.length)-1?(i.openBlock(),i.createBlock(i.unref(z.NButton),{key:4,type:"tertiary",class:"self-start",loading:a.value,onClick:_[6]||(_[6]=w=>s("click:save-template"))},{default:i.withCtx(()=>[..._[21]||(_[21]=[i.createTextVNode(" Сохранить шаблон ",-1)])]),_:1},8,["loading"])):i.createCommentVNode("",!0)]),i.createElementVNode("div",sg,[i.createVNode(i.unref(z.NFormItem),{label:"С какой стороны изделие будет иметь цвет","show-feedback":!1},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NSelect),{value:l.value.configuratorParams.colorSide,"onUpdate:value":[_[7]||(_[7]=w=>l.value.configuratorParams.colorSide=w),m],options:[{label:"Цвет сверху",value:"top"},{label:" Цвет снизу",value:"bottom"}],placeholder:"С какой стороны изделие будет иметь цвет"},null,8,["value"])]),_:1}),i.createVNode(i.unref(z.NFormItem),{path:"configuratorParams.length",label:`Метраж${t.settings.stripMinLength?" от "+t.settings.stripMinLength:""}${t.settings.stripMaxLength?" до "+t.settings.stripMaxLength:""} мм`},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInputNumber),{value:l.value.configuratorParams.length,"onUpdate:value":[_[8]||(_[8]=w=>l.value.configuratorParams.length=w),_[11]||(_[11]=w=>m())],parse:i.unref(lt),"show-button":!1,placeholder:"Введите метраж",class:"w-full",onKeydown:_[9]||(_[9]=w=>i.unref(tt)(w)),onInput:_[10]||(_[10]=w=>i.unref(et)(t.validation,"length")),onFocus:i.unref(Le)},null,8,["value","parse","onFocus"])]),_:1},8,["label"]),i.createVNode(i.unref(z.NFormItem),{path:"quantity",label:"Количество"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInputNumber),{value:l.value.quantity,"onUpdate:value":[_[12]||(_[12]=w=>l.value.quantity=w),_[15]||(_[15]=w=>p("quantity",w??0))],"show-button":!1,placeholder:"Введите количество",class:"w-full",onKeydown:_[13]||(_[13]=w=>i.unref(tt)(w,!1)),onInput:_[14]||(_[14]=w=>i.unref(et)(t.validation,"quantity")),onFocus:i.unref(Le)},null,8,["value","onFocus"])]),_:1}),i.createVNode(i.unref(z.NFormItem),{path:"marker",label:"Маркировка"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInput),{value:l.value.marker??null,placeholder:"Введите маркировку",onInput:_[16]||(_[16]=w=>i.unref(et)(t.validation,"marker")),"onUpdate:value":_[17]||(_[17]=w=>{l.value.marker=w??null,p("marker",w??null)}),onFocus:i.unref(Le)},null,8,["value","onFocus"])]),_:1}),d.value?(i.openBlock(),i.createBlock(N,{key:0,checked:l.value.isAdditionalSale??!1,"true-value":!0,"false-value":!1,"onUpdate:checked":_[18]||(_[18]=w=>{l.value.isAdditionalSale=w??!1,p("isAdditionalSale",w??!1)})},{default:i.withCtx(()=>[..._[23]||(_[23]=[i.createTextVNode(" ДопПродажа ",-1)])]),_:1},8,["checked"])):i.createCommentVNode("",!0),u.value?(i.openBlock(),i.createElementBlock("div",og,[_[24]||(_[24]=i.createTextVNode(" ИТОГО: ",-1)),i.createElementVNode("span",ag,i.toDisplayString(u.value)+" ₽",1)])):i.createCommentVNode("",!0),i.createElementVNode("div",lg,[i.createVNode(i.unref(z.NButton),{loading:t.isSubmitProcessing,disabled:!g.value||l.value.product.isNewRec(),type:"primary",class:"self-start",onClick:_[19]||(_[19]=w=>s("submit",l.value))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(l.value.isNewRec()?"В корзину":"Изменить"),1)]),_:1},8,["loading","disabled"])])])]}),_:1},8,["model","rules"])}}}),sl=Wn(dg,[["__scopeId","data-v-47ba4507"]]);var ol=Object.defineProperty,ug=Object.defineProperties,hg=Object.getOwnPropertyDescriptors,al=Object.getOwnPropertySymbols,fg=Object.prototype.hasOwnProperty,mg=Object.prototype.propertyIsEnumerable,ll=t=>{throw TypeError(t)},js=(t,e,n)=>e in t?ol(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,qs=(t,e)=>{for(var n in e||(e={}))fg.call(e,n)&&js(t,n,e[n]);if(al)for(var n of al(e))mg.call(e,n)&&js(t,n,e[n]);return t},Xs=(t,e)=>ug(t,hg(e)),cl=(t,e)=>{for(var n in e)ol(t,n,{get:e[n],enumerable:!0})},v=(t,e,n)=>js(t,typeof e!="symbol"?e+"":e,n),dl=(t,e,n)=>e.has(t)||ll("Cannot "+n),It=(t,e,n)=>(dl(t,e,"read from private field"),n?n.call(t):e.get(t)),ul=(t,e,n)=>e.has(t)?ll("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),gg=(t,e,n,r)=>(dl(t,e,"write to private field"),e.set(t,n),n),Bt={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 Bt.shim(t),typeof e<"u"&&(Bt.Image=e),Bt.isHeadless=!0,t}},hl={};cl(hl,{Curve:()=>Oi,getAnchorsFromArcData:()=>bg,getComponentOnCubicBezier:()=>dr,getControlPoints:()=>vl,getCurveBoundingBox:()=>wl,getCurveFromPoints:()=>kl,getCurveLength:()=>_l,getReflection:()=>Gs,integrate:()=>xl,subdivide:()=>Ks});var fl={};cl(fl,{HALF_PI:()=>it,NumArray:()=>un,TWO_PI:()=>gt,decomposeMatrix:()=>li,getComputedMatrix:()=>Ys,getEffectiveStrokeWidth:()=>hn,getPoT:()=>pl,lerp:()=>zt,mod:()=>Dt,setMatrix:()=>gl,toFixed:()=>Me});var Xe;typeof window<"u"?Xe=window:typeof global<"u"?Xe=global:typeof self<"u"&&(Xe=self);var ml,gt=Math.PI*2,it=Math.PI*.5;function li(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 gl(t){ml=t}function Ys(t,e){e=e&&e.identity()||new ml;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 zt(t,e,n){return n*(e-t)+t}var Us=[2,4,8,16,32,64,128,256,512,1024,2048,4096];function pl(t){let e=0;for(;Us[e]&&Us[e]<t;)e++;return Us[e]}function Dt(t,e){for(;t<0;)t+=e;return t%e}var un=Xe.Float32Array||Array,pg=Math.floor;function Me(t){return pg(t*1e6)/1e6}function hn(t,e){const n=t._linewidth;if(t.strokeAttenuation)return n;e||(e=t.worldMatrix||Ys(t));const r=li(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 se={move:"M",line:"L",curve:"C",arc:"A",close:"Z"},Q=class{constructor(){v(this,"_events",{}),v(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 u=a[c];u=u.handler?u.handler:u,n!==u&&l.push(u)}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}};v(Q,"Types",{play:"play",pause:"pause",update:"update",render:"render",resize:"resize",change:"change",remove:"remove",insert:"insert",order:"order",load:"load"}),v(Q,"Methods",["addEventListener","on","removeEventListener","off","unbind","dispatchEvent","trigger","listen","ignore"]);var yl={x:{enumerable:!0,get:function(){return this._x},set:function(t){this._x!==t&&(this._x=t,this._bound&&this.dispatchEvent(Q.Types.change))}},y:{enumerable:!0,get:function(){return this._y},set:function(t){this._y!==t&&(this._y=t,this._bound&&this.dispatchEvent(Q.Types.change))}}},en=class ir extends Q{constructor(e=0,n=0){super(),v(this,"_x",0),v(this,"_y",0);for(let r in yl)Object.defineProperty(this,r,yl[r]);this.x=e,this.y=n}static add(e,n){return new ir(e.x+n.x,e.y+n.y)}static sub(e,n){return new ir(e.x-n.x,e.y-n.y)}static subtract(e,n){return ir.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(ir.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 ir(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:Me(this.x),y:Me(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}};v(en,"zero",new en),v(en,"left",new en(-1,0)),v(en,"right",new en(1,0)),v(en,"up",new en(0,-1)),v(en,"down",new en(0,1));var re=en,Se=class Os extends re{constructor(e=0,n=0,r=0,s=0,o=0,a=0,l=se.move){super(e,n),v(this,"controls",{left:new re,right:new re}),v(this,"_command",se.move),v(this,"_relative",!0),v(this,"_rx",0),v(this,"_ry",0),v(this,"_xAxisRotation",0),v(this,"_largeArcFlag",0),v(this,"_sweepFlag",1);for(let d in bl)Object.defineProperty(this,d,bl[d]);this.command=l,this.relative=!0;const c=Os.makeBroadcast(this);this.controls.left.set(r,s).addEventListener(Q.Types.change,c),this.controls.right.set(o,a).addEventListener(Q.Types.change,c)}static makeBroadcast(e){return n;function n(){e._bound&&e.dispatchEvent(Q.Types.change)}}static fromObject(e){return new Os().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 Os().copy(this)}toObject(){return{x:Me(this.x),y:Me(this.y),command:this.command,relative:this.relative,controls:{left:this.controls.left.toObject(),right:this.controls.right.toObject()},rx:Me(this.rx),ry:Me(this.ry),xAxisRotation:Me(this.xAxisRotation),largeArcFlag:Me(this.largeArcFlag),sweepFlag:Me(this.sweepFlag)}}toString(){return JSON.stringify(this.toObject())}},bl={command:{enumerable:!0,get:function(){return this._command},set:function(t){this._command!==t&&(this._command=t,this._bound&&this.dispatchEvent(Q.Types.change))}},relative:{enumerable:!0,get:function(){return this._relative},set:function(t){this._relative!==!!t&&(this._relative=!!t,this._bound&&this.dispatchEvent(Q.Types.change))}},rx:{enumerable:!0,get:function(){return this._rx},set:function(t){this._rx!==t&&(this._rx=t,this._bound&&this.dispatchEvent(Q.Types.change))}},ry:{enumerable:!0,get:function(){return this._ry},set:function(t){this._ry!==t&&(this._ry=t,this._bound&&this.dispatchEvent(Q.Types.change))}},xAxisRotation:{enumerable:!0,get:function(){return this._xAxisRotation},set:function(t){this._xAxisRotation!==t&&(this._xAxisRotation=t,this._bound&&this.dispatchEvent(Q.Types.change))}},largeArcFlag:{enumerable:!0,get:function(){return this._largeArcFlag},set:function(t){this._largeArcFlag!==t&&(this._largeArcFlag=t,this._bound&&this.dispatchEvent(Q.Types.change))}},sweepFlag:{get:function(){return this._sweepFlag},set:function(t){this._sweepFlag!==t&&(this._sweepFlag=t,this._bound&&this.dispatchEvent(Q.Types.change))}}},yg=0,Tt={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 yg++}},Oi={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 dr(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 Ks(t,e,n,r,s,o,a,l,c){c=c||Oi.RecursionLimit;const d=c+1;if(Math.abs(t-a)<.001&&Math.abs(e-l)<.001)return[new Se(a,l)];const u=[];for(let h=0;h<d;h++){const f=h/d,g=dr(f,t,n,s,a),m=dr(f,e,r,o,l);u.push(new Se(g,m))}return u}function _l(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),u=6*(t+s)-12*n,h=3*(n-t),f=9*(r-o)+3*(l-e),g=6*(e+o)-12*r,m=3*(r-e);function p(y){const b=(d*y+u)*y+h,_=(f*y+g)*y+m;return Math.sqrt(b*b+_*_)}return xl(p,0,1,c||Oi.RecursionLimit)}function wl(t,e,n,r,s,o,a,l){const c=[],d=[[],[]];let u,h,f,g,m,p,y,b;for(let N=0;N<2;++N){if(N===0?(h=6*t-12*n+6*s,u=-3*t+9*n-9*s+3*a,f=3*n-3*t):(h=6*e-12*r+6*o,u=-3*e+9*r-9*o+3*l,f=3*r-3*e),Math.abs(u)<.001){if(Math.abs(h)<.001)continue;g=-f/h,0<g&&g<1&&c.push(g);continue}y=h*h-4*f*u,b=Math.sqrt(y),!(y<0)&&(m=(-h+b)/(2*u),0<m&&m<1&&c.push(m),p=(-h-b)/(2*u),0<p&&p<1&&c.push(p))}let _=c.length,B=_,k;for(;_--;)g=c[_],k=1-g,d[0][_]=k*k*k*t+3*k*k*g*n+3*k*g*g*s+g*g*g*a,d[1][_]=k*k*k*e+3*k*k*g*r+3*k*g*g*o+g*g*g*l;return d[0][B]=t,d[1][B]=e,d[0][B+1]=a,d[1][B+1]=l,d[0].length=d[1].length=B+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 xl(t,e,n,r){let s=Oi.abscissas[r-2],o=Oi.weights[r-2],a=.5*(n-e),l=a+e,c=0,d=r+1>>1,u=r&1?o[c++]*t(l):0;for(;c<d;){const h=a*s[c];u+=o[c++]*(t(l+h)+t(l-h))}return a*u}function kl(t,e){const n=t.length,r=n-1;for(let s=0;s<n;s++){const o=t[s],a=e?Dt(s-1,n):Math.max(s-1,0),l=e?Dt(s+1,n):Math.min(s+1,r),c=t[a],d=o,u=t[l];vl(c,d,u),d.command=s===0?se.move:se.curve}}function vl(t,e,n){const r=re.angleBetween(t,e),s=re.angleBetween(n,e);let o=re.distanceBetween(t,e),a=re.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)}function Gs(t,e,n){return new re(2*t.x-(e.x+t.x)-(n?t.x:0),2*t.y-(e.y+t.y)-(n?t.y:0))}function bg(t,e,n,r,s,o,a){const l=Tt.Resolution;for(let c=0;c<l;c++){let d=(c+1)/l;a&&(d=1-d);const u=d*o+s,h=n*Math.cos(u),f=r*Math.sin(u),g=new Se(h,f);g.command=se.line}}var Cl=Array.prototype.slice;function _g(t){if(t==null)return!1;const e=t.length;return typeof e=="number"&&e>=0&&e<4294967296}var ie={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=Cl.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=Cl.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=!_g(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:Xe.performance&&Xe.performance.now?Xe.performance:Date},Lt={hasEventListeners:typeof Xe.addEventListener=="function",bind:function(t,e,n,r){return this.hasEventListeners?t.addEventListener(e,n,!!r):t.attachEvent("on"+e,n),Lt},unbind:function(t,e,n,r){return Lt.hasEventListeners?t.removeEventListeners(e,n,!!r):t.detachEvent("on"+e,n),Lt},getRequestAnimationFrame:function(){const t=["ms","moz","webkit","o"];let e=0,n=Xe.requestAnimationFrame;if(!n){for(let s=0;s<t.length;s++)n=Xe[t[s]+"RequestAnimationFrame"]||n;n=n||r}function r(s,o){const a=new Date().getTime(),l=Math.max(0,16-(a-e)),c=Xe.setTimeout(d,l);e=a+l;function d(){s(a+l)}return c}return n}},zi=Xe.document?Xe.document.createElement("div"):{};zi.id="help-two-load",Object.defineProperty(Lt,"temp",{enumerable:!0,get:function(){return ie.isElement(zi)&&!Xe.document.head.contains(zi)&&(zi.style.display="none",Xe.document.head.appendChild(zi)),zi}});var At=class extends Error{constructor(e){super(),v(this,"name","Two.js"),v(this,"message"),this.message=e}},wg=Xe.devicePixelRatio||1;function xg(t){return t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1}function Zs(t){return wg/xg(t)}var Dr=class{constructor(){v(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}},pt,qn=class extends Array{constructor(){super(),ul(this,pt,new Q),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 It(this,pt)}set _events(e){gg(this,pt,e)}get _bound(){return It(this,pt)._bound}set _bound(e){It(this,pt)._bound=e}addEventListener(){return It(this,pt).addEventListener.apply(this,arguments)}on(){return It(this,pt).on.apply(this,arguments)}bind(){return It(this,pt).bind.apply(this,arguments)}removeEventListener(){return It(this,pt).removeEventListener.apply(this,arguments)}off(){return It(this,pt).off.apply(this,arguments)}unbind(){return It(this,pt).unbind.apply(this,arguments)}dispatchEvent(){return It(this,pt).dispatchEvent.apply(this,arguments)}trigger(){return It(this,pt).trigger.apply(this,arguments)}listen(){return It(this,pt).listen.apply(this,arguments)}ignore(){return It(this,pt).ignore.apply(this,arguments)}pop(){const e=super.pop.apply(this,arguments);return this.trigger(Q.Types.remove,[e]),e}shift(){const e=super.shift.apply(this,arguments);return this.trigger(Q.Types.remove,[e]),e}push(){const e=super.push.apply(this,arguments);return this.trigger(Q.Types.insert,arguments),e}unshift(){const e=super.unshift.apply(this,arguments);return this.trigger(Q.Types.insert,arguments),e}splice(){const e=super.splice.apply(this,arguments);if(this.trigger(Q.Types.remove,e),arguments.length>2){const n=this.slice(arguments[0],arguments[0]+arguments.length-2);this.trigger(Q.Types.insert,n),this.trigger(Q.Types.order)}return e}sort(){return super.sort.apply(this,arguments),this.trigger(Q.Types.order),this}reverse(){return super.reverse.apply(this,arguments),this.trigger(Q.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}};pt=new WeakMap;var Sl=class Zh extends Q{constructor(){super(),v(this,"_flagId",!1),v(this,"_flagClassName",!1),v(this,"_renderer",{}),v(this,"_id",Tt.Identifier+Tt.uniqueId()),v(this,"_className",""),v(this,"classList",[]);for(let e in Bl)Object.defineProperty(this,e,Bl[e])}static fromObject(e){const n=new Zh().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}};v(Sl,"Properties",["renderer","id","className"]);var Di=Sl,Bl={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)}}},Lr,Tl={video:/\.(mp4|webm|ogg)$/i,image:/\.(jpe?g|png|gif|tiff|webp)$/i,effect:/texture|gradient/i};Xe.document&&(Lr=document.createElement("a"));var tn=class qt extends Di{constructor(e,n){super(),v(this,"_flagSrc",!1),v(this,"_flagImage",!1),v(this,"_flagVideo",!1),v(this,"_flagLoaded",!1),v(this,"_flagRepeat",!1),v(this,"_flagOffset",!1),v(this,"_flagScale",!1),v(this,"_src",""),v(this,"_image",null),v(this,"_loaded",!1),v(this,"_repeat","no-repeat"),v(this,"_scale",1),v(this,"_offset",null);for(let r in $l)Object.defineProperty(this,r,$l[r]);if(this._renderer.type="texture",this._renderer.flagOffset=kg.bind(this),this._renderer.flagScale=vg.bind(this),this.loaded=!1,this.repeat="no-repeat",this.offset=new re,typeof n=="function"){const r=(function(){this.unbind(Q.Types.load,r),typeof n=="function"&&n()}).bind(this);this.bind(Q.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 qt().copy(e);return"id"in e&&(n.id=e.id),n}static getAbsoluteURL(e){return Lr?(Lr.href=e,Lr.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=qt.getAbsoluteURL(e);if(qt.ImageRegistry.contains(n))return qt.ImageRegistry.get(n);let r;return Bt.Image?(r=new Bt.Image,Bt.shim(r,"img")):Xe.document?Tl.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=qt.getTag(r);e._flagImage&&(/canvas/i.test(s)?qt.Register.canvas(e,n):(e._src=!Bt.isHeadless&&r.getAttribute("two-src")||r.src,qt.Register[s](e,n))),e._flagSrc&&(r||(r=qt.getImage(e.src),e.image=r),s=qt.getTag(r),qt.Register[s](e,n))}clone(){const e=new qt(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 re?e.offset:new re().copy(e.offset),this.scale=typeof e.scale=="number"||e.scale instanceof re?e.scale:new re().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(Q.Types.change),(this._flagSrc||this._flagImage)&&(this.loaded=!1,qt.load(this,(function(){this.loaded=!0,this.trigger(Q.Types.change).trigger(Q.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}};v(tn,"Properties",["src","loaded","repeat","scale","offset","image"]),v(tn,"RegularExpressions",Tl),v(tn,"ImageRegistry",new Dr),v(tn,"Register",{canvas:function(t,e){t._src="#"+t.id,tn.ImageRegistry.add(t.src,t.image),typeof e=="function"&&e()},img:function(t,e){const n=t.image,r=function(o){!Bt.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!Bt.isHeadless&&typeof n.removeEventListener=="function"&&(n.removeEventListener("load",r,!1),n.removeEventListener("error",s,!1)),new At("unable to load "+t.src)};typeof n.width=="number"&&n.width>0&&typeof n.height=="number"&&n.height>0?r():!Bt.isHeadless&&typeof n.addEventListener=="function"&&(n.addEventListener("load",r,!1),n.addEventListener("error",s,!1)),t._src=tn.getAbsoluteURL(t._src),!(!Bt.isHeadless&&n&&n.getAttribute("two-src"))&&(Bt.isHeadless||n.setAttribute("two-src",t.src),tn.ImageRegistry.add(t.src,n),Bt.isHeadless?tn.loadHeadlessBuffer(t,r):t.image.src=t.src)},video:function(t,e){if(Bt.isHeadless)throw new At("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 At("unable to load "+t.src)};t._src=tn.getAbsoluteURL(t._src),t.image.getAttribute("two-src")||(t.image.setAttribute("two-src",t.src),tn.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 Oe=tn,$l={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=Oe.getTag(t);let n;switch(e){case"canvas":n="#"+t.id;break;default:n=t.src}Oe.ImageRegistry.contains(n)?this._image=Oe.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(Q.Types.change,this._renderer.flagOffset),this._offset=t,this._offset.bind(Q.Types.change,this._renderer.flagOffset),this._flagOffset=!0}},scale:{enumerable:!0,get:function(){return this._scale},set:function(t){this._scale instanceof re&&this._scale.unbind(Q.Types.change,this._renderer.flagScale),this._scale=t,this._scale instanceof re&&this._scale.bind(Q.Types.change,this._renderer.flagScale),this._flagScale=!0}}};function kg(){this._flagOffset=!0}function vg(){this._flagScale=!0}var Qs=class dn extends Di{constructor(e,n,r){super(),v(this,"_flagOffset",!0),v(this,"_flagOpacity",!0),v(this,"_flagColor",!0),v(this,"_offset",0),v(this,"_opacity",1),v(this,"_color","#fff");for(let s in Nl)Object.defineProperty(this,s,Nl[s]);this._renderer.type="stop",this.offset=typeof e=="number"?e:dn.Index<=0?0:1,this.opacity=typeof r=="number"?r:1,this.color=typeof n=="string"?n:dn.Index<=0?"#fff":"#000",dn.Index=(dn.Index+1)%2}static fromObject(e){const n=new dn().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<dn.Properties.length;n++){const r=dn.Properties[n];r in e&&(this[r]=e[r])}return this}clone(e){const n=new dn;return ie.each(dn.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",ie.each(dn.Properties,n=>{e[n]=this[n]},this),e}flagReset(){return this._flagOffset=this._flagColor=this._flagOpacity=!1,super.flagReset.call(this),this}};v(Qs,"Index",0),v(Qs,"Properties",["offset","opacity","color"]);var Xn=Qs,Nl={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 Ri extends Di{constructor(e){super(),v(this,"_flagStops",!1),v(this,"_flagSpread",!1),v(this,"_flagUnits",!1),v(this,"_spread",""),v(this,"_units","");for(let n in Rl)Object.defineProperty(this,n,Rl[n]);this._renderer.type="gradient",this._renderer.flagStops=Cg.bind(this),this._renderer.bindStops=Sg.bind(this),this._renderer.unbindStops=Bg.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 Xn?s:new Xn().copy(s)));const r=new Ri(n).copy(e);return"id"in e&&(r.id=e.id),r}clone(e){const n=this.stops.map(s=>s.clone()),r=new Ri(n);return ie.each(Ri.Properties,s=>{r[s]=this[s]},this),e&&e.add(r),r}copy(e){super.copy.call(this,e);for(let n=0;n<Ri.Properties.length;n++){const r=Ri.Properties[n];r in e&&(this[r]=e[r])}return this}toObject(){const e={stops:this.stops.map(n=>n.toObject())};return ie.each(Ri.Properties,n=>{e[n]=this[n]},this),e}_update(){return(this._flagSpread||this._flagStops)&&this.trigger(Q.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}};v(Js,"Stop",Xn),v(Js,"Properties",["spread","stops","units"]);var rt=Js,Rl={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(Q.Types.insert,e).unbind(Q.Types.remove,n),this._stops=new qn((t||[]).slice(0)),this._stops.bind(Q.Types.insert,e).bind(Q.Types.remove,n),e(this._stops)}}};function Cg(){this._flagStops=!0}function Sg(t){let e=t.length;for(;e--;)t[e].bind(Q.Types.change,this._renderer.flagStops),t[e].parent=this;this._renderer.flagStops()}function Bg(t){let e=t.length;for(;e--;)t[e].unbind(Q.Types.change,this._renderer.flagStops),delete t[e].parent;this._renderer.flagStops()}var eo=class Fr extends rt{constructor(e,n,r,s,o){super(o),v(this,"_flagEndPoints",!1),v(this,"_left",null),v(this,"_right",null);for(let a in Pl)Object.defineProperty(this,a,Pl[a]);this._renderer.type="linear-gradient",this._renderer.flagEndPoints=Tg.bind(this),this.left=new re,this.right=new re,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 Fr().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<Fr.Properties.length;n++){const r=Fr.Properties[n];r in e&&(this[r]=e[r]instanceof re?e[r]:new re().copy(e[r]))}return this}clone(e){const n=this.stops.map(function(s){return s.clone()}),r=new Fr(this.left._x,this.left._y,this.right._x,this.right._y,n);return ie.each(rt.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(Q.Types.change),this}flagReset(){return this._flagEndPoints=!1,super.flagReset.call(this),this}};v(eo,"Stop",Xn),v(eo,"Properties",["left","right"]);var Ye=eo,Pl={left:{enumerable:!0,get:function(){return this._left},set:function(t){this._left instanceof re&&this._left.unbind(Q.Types.change,this._renderer.flagEndPoints),this._left=t,this._left.bind(Q.Types.change,this._renderer.flagEndPoints),this._flagEndPoints=!0}},right:{enumerable:!0,get:function(){return this._right},set:function(t){this._right instanceof re&&this._right.unbind(Q.Types.change,this._renderer.flagEndPoints),this._right=t,this._right.bind(Q.Types.change,this._renderer.flagEndPoints),this._flagEndPoints=!0}}};function Tg(){this._flagEndPoints=!0}var to=class Pi extends rt{constructor(e,n,r,s,o,a){super(s),v(this,"_flagRadius",!1),v(this,"_flagCenter",!1),v(this,"_flagFocal",!1),v(this,"_radius",0),v(this,"_center",null),v(this,"_focal",null);for(let l in El)Object.defineProperty(this,l,El[l]);this._renderer.type="radial-gradient",this._renderer.flagCenter=$g.bind(this),this._renderer.flagFocal=Ng.bind(this),this.center=new re,this.radius=typeof r=="number"?r:1,this.focal=new re,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 Pi().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<Pi.Properties.length;n++){const r=Pi.Properties[n];r in e&&(/(center|focal)i/.test(r)?this[r]=e[r]instanceof re?e[r]:new re().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 Pi(this.center._x,this.center._y,this._radius,n,this.focal._x,this.focal._y);return ie.each(rt.Properties.concat(Pi.Properties),function(s){r[s]=this[s]},this),e&&e.add(r),r}toObject(){const e=super.toObject.call(this);return ie.each(Pi.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(Q.Types.change),this}flagReset(){return this._flagRadius=this._flagCenter=this._flagFocal=!1,super.flagReset.call(this),this}};v(to,"Stop",Xn),v(to,"Properties",["center","radius","focal"]);var Ue=to,El={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(Q.Types.change,this._renderer.flagCenter),this._center=t,this._center.bind(Q.Types.change,this._renderer.flagCenter),this._flagCenter=!0}},focal:{enumerable:!0,get:function(){return this._focal},set:function(t){this._focal&&this._focal.unbind(Q.Types.change,this._renderer.flagFocal),this._focal=t,this._focal.bind(Q.Types.change,this._renderer.flagFocal),this._flagFocal=!0}}};function $g(){this._flagCenter=!0}function Ng(){this._flagFocal=!0}function Fl(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 Hr(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 Vl(t,e,n){let r,s,o,a,l,c,d,u;const h=e.controls&&e.controls.right,f=t.controls&&t.controls.left;return r=e.x,l=e.y,s=(h||e).x,c=(h||e).y,o=(f||t).x,d=(f||t).y,a=t.x,u=t.y,h&&e._relative&&(s+=e.x,c+=e.y),f&&t._relative&&(o+=t.x,d+=t.y),_l(r,l,s,c,o,d,a,u,n)}function Il(t,e,n){let r,s,o,a,l,c,d,u;const h=e.controls&&e.controls.right,f=t.controls&&t.controls.left;return r=e.x,l=e.y,s=(h||e).x,c=(h||e).y,o=(f||t).x,d=(f||t).y,a=t.x,u=t.y,h&&e._relative&&(s+=e.x,c+=e.y),f&&t._relative&&(o+=t.x,d+=t.y),Ks(r,l,s,c,o,d,a,u,n)}function ci(t){switch(t.renderer.type){case"texture":return Oe.fromObject(t);case"gradient":return rt.fromObject(t);case"linear-gradient":return Ye.fromObject(t);case"radial-gradient":return Ue.fromObject(t)}return t}var Rg=Math.cos,Pg=Math.sin,Al=Math.tan,no=[],Ml=class Xt extends Q{constructor(e,n,r,s,o,a){super(),v(this,"elements",new un(9)),v(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 R=e;let w,C,x;const T=n[0]||0,$=n[1]||0,F=n[2]||0;return w=R[0]*T+R[1]*$+R[2]*F,C=R[3]*T+R[4]*$+R[5]*F,x=R[6]*T+R[7]*$+R[8]*F,[w,C,x]}const s=e[0],o=e[1],a=e[2],l=e[3],c=e[4],d=e[5],u=e[6],h=e[7],f=e[8],g=n[0],m=n[1],p=n[2],y=n[3],b=n[4],_=n[5],B=n[6],k=n[7],N=n[8];return r=r||new un(9),r[0]=s*g+o*y+a*B,r[1]=s*m+o*b+a*k,r[2]=s*p+o*_+a*N,r[3]=l*g+c*y+d*B,r[4]=l*m+c*b+d*k,r[5]=l*p+c*_+d*N,r[6]=u*g+h*y+f*B,r[7]=u*m+h*b+f*k,r[8]=u*p+h*_+f*N,r}static fromObject(e){return new Xt().copy(e)}set(e,n,r,s,o,a,l,c,d){if(typeof n>"u"){const u=e;e=u[0],n=u[1],r=u[2],s=u[3],o=u[4],a=u[5],l=u[6],c=u[7],d=u[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(Q.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(Q.Types.change)}identity(){return this.elements[0]=Xt.Identity[0],this.elements[1]=Xt.Identity[1],this.elements[2]=Xt.Identity[2],this.elements[3]=Xt.Identity[3],this.elements[4]=Xt.Identity[4],this.elements[5]=Xt.Identity[5],this.elements[6]=Xt.Identity[6],this.elements[7]=Xt.Identity[7],this.elements[8]=Xt.Identity[8],this.trigger(Q.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(Q.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,O=o[3]*e+o[4]*n+o[5]*r,Z=o[6]*e+o[7]*n+o[8]*r;return[L,O,Z]}const u=this.elements,h=[e,n,r,s,o,a,l,c,d],f=u[0],g=u[1],m=u[2],p=u[3],y=u[4],b=u[5],_=u[6],B=u[7],k=u[8],N=h[0],R=h[1],w=h[2],C=h[3],x=h[4],T=h[5],$=h[6],F=h[7],I=h[8];return this.elements[0]=f*N+g*C+m*$,this.elements[1]=f*R+g*x+m*F,this.elements[2]=f*w+g*T+m*I,this.elements[3]=p*N+y*C+b*$,this.elements[4]=p*R+y*x+b*F,this.elements[5]=p*w+y*T+b*I,this.elements[6]=_*N+B*C+k*$,this.elements[7]=_*R+B*x+k*F,this.elements[8]=_*w+B*T+k*I,this.trigger(Q.Types.change)}inverse(e){const n=this.elements;e=e||new Xt;const r=n[0],s=n[1],o=n[2],a=n[3],l=n[4],c=n[5],d=n[6],u=n[7],h=n[8],f=h*l-c*u,g=-h*a+c*d,m=u*a-l*d;let p=r*f+s*g+o*m;return p?(p=1/p,e.elements[0]=f*p,e.elements[1]=(-h*s+o*u)*p,e.elements[2]=(c*s-o*l)*p,e.elements[3]=g*p,e.elements[4]=(h*r-o*d)*p,e.elements[5]=(-c*r+o*a)*p,e.elements[6]=m*p,e.elements[7]=(-u*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=Rg(e),r=Pg(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=Al(e);return this.multiply(1,n,0,0,1,0,0,0,1)}skewY(e){const n=Al(e);return this.multiply(1,0,0,n,1,0,0,0,1)}toString(e){return no.length=0,this.toTransformArray(e,no),no.map(Me).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],u=r[5];if(e){const h=r[6],f=r[7],g=r[8];if(s){n[0]=o,n[1]=c,n[2]=h,n[3]=a,n[4]=d,n[5]=f,n[6]=l,n[7]=u,n[8]=g;return}return[o,c,h,a,d,f,l,u,g]}if(s){n[0]=o,n[1]=c,n[2]=a,n[3]=d,n[4]=l,n[5]=u;return}return[o,c,a,d,l,u]}toArray(e,n){const r=this.elements,s=!!n,o=r[0],a=r[1],l=r[2],c=r[3],d=r[4],u=r[5];if(e){const h=r[6],f=r[7],g=r[8];if(s){n[0]=o,n[1]=a,n[2]=l,n[3]=c,n[4]=d,n[5]=u,n[6]=h,n[7]=f,n[8]=g;return}return[o,a,l,c,d,u,h,f,g]}if(s){n[0]=o,n[1]=a,n[2]=l,n[3]=c,n[4]=d,n[5]=u;return}return[o,a,l,c,d,u]}toObject(){return{renderer:{type:"matrix"},elements:this.toArray(!0),manual:!!this.manual}}clone(){return new Xt().copy(this)}};v(Ml,"Identity",[1,0,0,0,1,0,0,0,1]);var Li=Ml;gl(Li);var Ol=class Xa extends Di{constructor(){super(),v(this,"_flagMatrix",!0),v(this,"_flagScale",!1),v(this,"_matrix",null),v(this,"_worldMatrix",null),v(this,"_position",null),v(this,"_rotation",0),v(this,"_scale",1),v(this,"_skewX",0),v(this,"_skewY",0);for(let e in Wr)Object.defineProperty(this,e,Wr[e]);this._renderer.flagMatrix=zl.bind(this),this.isShape=!0,this.matrix=new Li,this.worldMatrix=new Li,this.position=new re,this.rotation=0,this.scale=1,this.skewX=0,this.skewY=0}static fromObject(e){const n=new Xa().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 Wr.position.get.apply(this,arguments)}set translation(e){Wr.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 re?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 re?e.scale:new re(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 Xa;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 re?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 re?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}};v(Ol,"Properties",["position","rotation","scale","skewX","skewY","matrix","worldMatrix"]);var Yn=Ol,Wr={position:{enumerable:!0,get:function(){return this._position},set:function(t){this._position&&this._position.unbind(Q.Types.change,this._renderer.flagMatrix),this._position=t,this._position.bind(Q.Types.change,this._renderer.flagMatrix),zl.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 re&&this._scale.unbind(Q.Types.change,this._renderer.flagMatrix),this._scale=t,this._scale instanceof re&&this._scale.bind(Q.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 Ys(this,this._worldMatrix),this._worldMatrix},set:function(t){this._worldMatrix=t}}};function zl(){this._flagMatrix=!0}var Hi=Math.min,Wi=Math.max,Eg=Math.ceil,Fg=Math.floor,Vg=new re,io=class ri extends Yn{constructor(e,n,r,s){super(),v(this,"_flagVertices",!0),v(this,"_flagLength",!0),v(this,"_flagFill",!0),v(this,"_flagStroke",!0),v(this,"_flagLinewidth",!0),v(this,"_flagOpacity",!0),v(this,"_flagVisible",!0),v(this,"_flagCap",!0),v(this,"_flagJoin",!0),v(this,"_flagMiter",!0),v(this,"_flagStrokeAttenuation",!0),v(this,"_flagMask",!1),v(this,"_flagClip",!1),v(this,"_length",0),v(this,"_fill","#fff"),v(this,"_stroke","#000"),v(this,"_linewidth",1),v(this,"_opacity",1),v(this,"_visible",!0),v(this,"_cap","round"),v(this,"_join","round"),v(this,"_miter",4),v(this,"_closed",!0),v(this,"_curved",!1),v(this,"_automatic",!0),v(this,"_beginning",0),v(this,"_ending",1),v(this,"_mask",null),v(this,"_clip",!1),v(this,"_dashes",null),v(this,"_strokeAttenuation",!0);for(let o in Dl)Object.defineProperty(this,o,Dl[o]);this._renderer.type="path",this._renderer.flagVertices=Ll.bind(this),this._renderer.bindVertices=Hl.bind(this),this._renderer.unbindVertices=Wl.bind(this),this._renderer.flagFill=jl.bind(this),this._renderer.flagStroke=ql.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:ci(e.fill),r=typeof e.stroke=="string"?e.stroke:ci(e.stroke),s=new ri().copy(Xs(qs({},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 Se?this.vertices.push(e.vertices[n].clone()):this.vertices.push(new Se().copy(r))}}for(let n=0;n<ri.Properties.length;n++){const r=ri.Properties[n];r in e&&(this[r]=e[r])}return this}clone(e){const n=new ri;for(let r=0;r<this.vertices.length;r++)n.vertices.push(this.vertices[r].clone());for(let r=0;r<ri.Properties.length;r++){const s=ri.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()),ie.each(ri.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,u=1/0,h=-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:f,scaleY:g}=li(n.elements[0],n.elements[3],n.elements[1],n.elements[4],n.elements[2],n.elements[5]);typeof f=="number"&&typeof g=="number"&&(r=Math.max(f,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[f,g]=n.multiply(a.x,a.y),[m,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[_,B]=n.multiply(y,b),k=l.controls.left.x,N=l.controls.left.y;l.relative&&(k+=l.x,N+=l.y);let[R,w]=n.multiply(k,N);const C=wl(f,g,_,B,R,w,m,p);u=Hi(C.min.y-r,u),c=Hi(C.min.x-r,c),d=Wi(C.max.x+r,d),h=Wi(C.max.y+r,h)}else o<=1&&(u=Hi(g-r,u),c=Hi(f-r,c),d=Wi(f+r,d),h=Wi(g+r,h)),u=Hi(p-r,u),c=Hi(m-r,c),d=Wi(m+r,d),h=Wi(p+r,h)}return{top:u,left:c,right:d,bottom:h,width:d-c,height:h-u}}getPointAt(e,n){let r,s,o,a,l,c,d,u,h,f,g,m,p,y,b,_=this.length*Math.min(Math.max(e,0),1);const B=this.vertices.length,k=B-1;let N=null,R=null;for(let ne=0,E=this._lengths.length,P=0;ne<E;ne++){if(P+this._lengths[ne]>=_){this._closed?(r=Dt(ne,B),s=Dt(ne-1,B),ne===0&&(r=s,s=ne)):(r=ne,s=Math.min(Math.max(ne-1,0),k)),N=this.vertices[r],R=this.vertices[s],_-=P,this._lengths[ne]!==0?e=_/this._lengths[ne]:e=0;break}P+=this._lengths[ne]}if(N===null||R===null)return null;if(N){if(!R)return N}else return R;b=R.controls&&R.controls.right,y=N.controls&&N.controls.left,l=R.x,f=R.y,c=(b||R).x,g=(b||R).y,d=(y||N).x,m=(y||N).y,u=N.x,p=N.y,b&&R.relative&&(c+=R.x,g+=R.y),y&&N.relative&&(d+=N.x,m+=N.y),a=dr(e,l,c,d,u),h=dr(e,f,g,m,p);const w=zt(l,c,e),C=zt(f,g,e),x=zt(c,d,e),T=zt(g,m,e),$=zt(d,u,e),F=zt(m,p,e),I=zt(w,x,e),L=zt(C,T,e),O=zt(x,$,e),Z=zt(T,F,e);return ie.isObject(n)?(n.x=a,n.y=h,n instanceof Se&&(n.controls.left.x=I,n.controls.left.y=L,n.controls.right.x=O,n.controls.right.y=Z,(typeof n.relative!="boolean"||n.relative)&&(n.controls.left.x-=a,n.controls.left.y-=h,n.controls.right.x-=a,n.controls.right.y-=h)),n.t=e,n):(o=new Se(a,h,I-a,L-h,O-a,Z-h,this._curved?se.curve:se.line),o.t=e,o)}plot(){if(this.curved)return kl(this._collection,this.closed),this;for(let e=0;e<this._collection.length;e++)this._collection[e].command=e===0?se.move:se.line;return this}subdivide(e){this._update();const n=this.vertices.length-1,r=this._closed||this.vertices[n]._command===se.close;let s=this.vertices[n],o=[],a;return ie.each(this.vertices,function(l,c){if(c<=0&&!r){s=l;return}if(l.command===se.move){o.push(new Se(s.x,s.y)),c>0&&(o[o.length-1].command=se.line),s=l;return}a=Il(l,s,e),o=o.concat(a),ie.each(a,function(d,u){u<=0&&s.command===se.move?d.command=se.move:d.command=se.line}),c>=n&&(this._closed&&this._automatic&&(s=l,a=Il(l,s,e),o=o.concat(a),ie.each(a,function(d,u){u<=0&&s.command===se.move?d.command=se.move:d.command=se.line})),o.push(new Se(l.x,l.y)),o[o.length-1].command=r?se.close:se.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=[]),ie.each(this.vertices,function(l,c){if(c<=0||l.command===se.move){o=l,this._lengths[c]=0;return}this._lengths[c]=Vl(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=Hr(this,r*this._length),a=Hr(this,s*this._length),l=Eg(o),c=Fg(a);let d,u,h,f,g,m;for(this._renderer.vertices.length=0,m=0;m<e;m++)this._renderer.collection.length<=m&&this._renderer.collection.push(new Se),m>c&&!u?(g=this._renderer.collection[m].copy(this._collection[m]),this.getPointAt(s,g),g.command=this._renderer.collection[m].command,this._renderer.vertices.push(g),u=g,h=this._collection[m-1],h&&h.controls&&(g.relative?g.controls.right.clear():g.controls.right.copy(g),h.relative?this._renderer.collection[m-1].controls.right.copy(h.controls.right).lerp(re.zero,1-g.t):this._renderer.collection[m-1].controls.right.copy(h.controls.right).lerp(h,1-g.t))):m>=l&&m<=c&&(g=this._renderer.collection[m].copy(this._collection[m]),this._renderer.vertices.push(g),m===c&&Fl(this,s)?(u=g,!n&&u.controls&&(u.relative?u.controls.right.clear():u.controls.right.copy(u))):m===l&&Fl(this,r)&&(d=g,d.command=se.move,!n&&d.controls&&(d.relative?d.controls.left.clear():d.controls.left.copy(d))));l>0&&!d&&(m=l-1,g=this._renderer.collection[m].copy(this._collection[m]),this.getPointAt(r,g),g.command=se.move,this._renderer.vertices.unshift(g),f=this._collection[m+1],f&&f.controls&&(g.controls.left.clear(),f.relative?this._renderer.collection[m+1].controls.left.copy(f.controls.left).lerp(re.zero,g.t):(Vg.copy(f),this._renderer.collection[m+1].controls.left.copy(f.controls.left).lerp(f,g.t))))}return Yn.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,Yn.prototype.flagReset.call(this),this}};v(io,"Properties",["fill","stroke","linewidth","opacity","visible","cap","join","miter","closed","curved","automatic","beginning","ending","dashes","strokeAttenuation"]),v(io,"Utils",{getCurveLength:Vl});var Ne=io,Dl={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 rt||this._fill instanceof Ye||this._fill instanceof Ue||this._fill instanceof Oe)&&this._fill.unbind(Q.Types.change,this._renderer.flagFill),this._fill=t,this._flagFill=!0,(this._fill instanceof rt||this._fill instanceof Ye||this._fill instanceof Ue||this._fill instanceof Oe)&&this._fill.bind(Q.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(t){(this._stroke instanceof rt||this._stroke instanceof Ye||this._stroke instanceof Ue||this._stroke instanceof Oe)&&this._stroke.unbind(Q.Types.change,this._renderer.flagStroke),this._stroke=t,this._flagStroke=!0,(this._stroke instanceof rt||this._stroke instanceof Ye||this._stroke instanceof Ue||this._stroke instanceof Oe)&&this._stroke.bind(Q.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";ie.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(Q.Types.insert,e).unbind(Q.Types.remove,n),t instanceof qn?this._collection=t:this._collection=new qn(t||[]),this._collection.bind(Q.Types.insert,e).bind(Q.Types.remove,n),e(this._collection)}},mask:{enumerable:!0,get:function(){return this._mask},set:function(t){this._mask=t,this._flagMask=!0,ie.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 Ll(){this._flagVertices=!0,this._flagLength=!0,this.parent&&(this.parent._flagLength=!0)}function Hl(t){let e=t.length;for(;e--;)t[e].bind(Q.Types.change,this._renderer.flagVertices);this._renderer.flagVertices()}function Wl(t){let e=t.length;for(;e--;)t[e].unbind(Q.Types.change,this._renderer.flagVertices);this._renderer.flagVertices()}function jl(){this._flagFill=!0}function ql(){this._flagStroke=!0}var Xl=class Vr extends Ne{constructor(e,n,r,s){const o=[new Se,new Se,new Se,new Se];super(o,!0,!1,!0),v(this,"_flagWidth",!1),v(this,"_flagHeight",!1),v(this,"_width",0),v(this,"_height",0),v(this,"_origin",null),this._renderer.type="rectangle";for(let a in Yl)Object.defineProperty(this,a,Yl[a]);this.width=typeof r=="number"?r:1,this.height=typeof s=="number"?s:1,this.origin=new re,typeof e=="number"&&(this.translation.x=e),typeof n=="number"&&(this.translation.y=n),this._update()}static fromObject(e){const n=new Vr().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<Vr.Properties.length;n++){const r=Vr.Properties[n];r in e&&(typeof e[r]=="number"?this[r]=e[r]:this[r]instanceof re&&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 Se),this.vertices[0].set(-e,-n).sub(this._origin).command=se.move,this.vertices[1].set(e,-n).sub(this._origin).command=se.line,this.vertices[2].set(e,n).sub(this._origin).command=se.line,this.vertices[3].set(-e,n).sub(this._origin).command=se.line,this.vertices[4]&&(this.vertices[4].set(-e,-n).sub(this._origin).command=se.line)}return super._update.call(this),this}flagReset(){return this._flagWidth=this._flagHeight=!1,super.flagReset.call(this),this}clone(e){const n=new Vr(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<Ne.Properties.length;r++){const s=Ne.Properties[r];n[s]instanceof re?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}};v(Xl,"Properties",["width","height","origin"]);var Un=Xl,Yl={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(Q.Types.change,this._renderer.flagVertices),this._origin=t,this._origin.bind(Q.Types.change,this._renderer.flagVertices),this._renderer.flagVertices()}}},Ul=class Ir extends Un{constructor(e,n,r,s,o,a){super(n,r,0,0),v(this,"_flagTexture",!1),v(this,"_flagColumns",!1),v(this,"_flagRows",!1),v(this,"_flagFrameRate",!1),v(this,"_flagIndex",!1),v(this,"_amount",1),v(this,"_duration",0),v(this,"_startTime",0),v(this,"_playing",!1),v(this,"_firstFrame",0),v(this,"_lastFrame",0),v(this,"_loop",!0),v(this,"_texture",null),v(this,"_columns",1),v(this,"_rows",1),v(this,"_frameRate",0),v(this,"_index",0),v(this,"_origin",null),this._renderer.type="sprite";for(let l in Kl)Object.defineProperty(this,l,Kl[l]);this.noStroke(),this.noFill(),e instanceof Oe?this.texture=e:typeof e=="string"&&(this.texture=new Oe(e)),this.origin=new re,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 Ir().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<Ir.Properties.length;n++){const r=Ir.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=ie.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 Ir(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,u,h,f;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)){u=e.image.width,h=e.image.height,s=u/n,o=h/r,l=this._amount,this.width!==s&&(this.width=s),this.height!==o&&(this.height=o),this._playing&&this._frameRate>0&&(ie.isNaN(this._lastFrame)&&(this._lastFrame=l-1),a=ie.performance.now()-this._startTime,f=this._lastFrame+1,c=1e3*(f-this._firstFrame)/this._frameRate,this._loop?a=a%c:a=Math.min(a,c),d=zt(this._firstFrame,f,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,m=Math.floor(this._index/n),p=-s*g+(u-s)/2,y=-o*m+(h-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}};v(Ul,"Properties",["texture","columns","rows","frameRate","index","firstFrame","lastFrame","loop"]);var jr=Ul,Kl={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}}},ro,Gl=class extends qn{constructor(e){e=Array.isArray(e)?e:Array.prototype.slice.call(arguments),super(e),ul(this,ro,{}),this.attach(e),this.on(Q.Types.insert,this.attach),this.on(Q.Types.remove,this.detach)}get ids(){return It(this,ro)}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}};ro=new WeakMap;var Zl=class Ei extends Ne{constructor(e,n,r,s,o,a,l){const c=l||Tt.Resolution*3,d=[];for(let u=0;u<c;u++)d.push(new Se);super(d,!0,!1,!0),v(this,"_flagStartAngle",!1),v(this,"_flagEndAngle",!1),v(this,"_flagInnerRadius",!1),v(this,"_flagOuterRadius",!1),v(this,"_startAngle",0),v(this,"_endAngle",gt),v(this,"_innerRadius",0),v(this,"_outerRadius",0),this._renderer.type="arc-segment";for(let u in Ql)Object.defineProperty(this,u,Ql[u]);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 Ei().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<Ei.Properties.length;n++){const r=Ei.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=Dt(e,gt)===Dt(n,gt),a=r>0,l=this.vertices;let c=a?l.length/2:l.length,d,u=0,h,f,g,m,p,y,b,_,B;for(o?c--:a||(c-=2),h=0,f=c-1;h<c;h++){switch(g=h/f,m=l[u],p=g*(n-e)+e,y=(n-e)/c,b=s*Math.cos(p),_=s*Math.sin(p),h){case 0:d=se.move;break;default:d=se.curve}m.command=d,m.x=b,m.y=_,m.controls.left.clear(),m.controls.right.clear(),m.command===se.curve&&(B=s*y/Math.PI,m.controls.left.x=B*Math.cos(p-it),m.controls.left.y=B*Math.sin(p-it),m.controls.right.x=B*Math.cos(p+it),m.controls.right.y=B*Math.sin(p+it),h===1&&m.controls.left.multiplyScalar(2),h===f&&m.controls.right.multiplyScalar(2)),u++}if(a){for(o?(l[u].command=se.close,u++):(c--,f=c-1),h=0;h<c;h++)g=h/f,m=l[u],p=(1-g)*(n-e)+e,y=(n-e)/c,b=r*Math.cos(p),_=r*Math.sin(p),d=se.curve,h<=0&&(d=o?se.move:se.line),m.command=d,m.x=b,m.y=_,m.controls.left.clear(),m.controls.right.clear(),m.command===se.curve&&(B=r*y/Math.PI,m.controls.left.x=B*Math.cos(p+it),m.controls.left.y=B*Math.sin(p+it),m.controls.right.x=B*Math.cos(p-it),m.controls.right.y=B*Math.sin(p-it),h===1&&m.controls.left.multiplyScalar(2),h===f&&m.controls.right.multiplyScalar(2)),u++;l[u].copy(l[0]),l[u].command=se.line}else o||(l[u].command=se.line,l[u].x=0,l[u].y=0,u++,l[u].copy(l[0]),l[u].command=se.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 Ei(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<Ne.Properties.length;c++){const d=Ne.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<Ei.Properties.length;n++){const r=Ei.Properties[n];e[r]=this[r]}return e}};v(Zl,"Properties",["startAngle","endAngle","innerRadius","outerRadius"]);var so=Zl,Ql={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}}},oo=Math.cos,ao=Math.sin,Jl=class Fi extends Ne{constructor(e,n,r,s){const o=s?Math.max(s,2):4,a=[];for(let l=0;l<o;l++)a.push(new Se(0,0,0,0,0,0));super(a,!0,!0,!0),v(this,"_flagRadius",!1),v(this,"_radius",0),this._renderer.type="circle";for(let l in ec)Object.defineProperty(this,l,ec[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 Fi().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<Fi.Properties.length;n++){const r=Fi.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*gt,c=r*oo(l),d=r*ao(l),u=s*oo(l-it),h=s*ao(l-it),f=s*oo(l+it),g=s*ao(l+it),m=this.vertices[o];m.command=o===0?se.move:se.curve,m.set(c,d),m.controls.left.set(u,h),m.controls.right.set(f,g)}}return super._update.call(this),this}flagReset(){return this._flagRadius=!1,super.flagReset.call(this),this}clone(e){const n=new Fi(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<Ne.Properties.length;r++){const s=Ne.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<Fi.Properties.length;n++){const r=Fi.Properties[n];e[r]=this[r]}return e}};v(Jl,"Properties",["radius"]);var qr=Jl,ec={radius:{enumerable:!0,get:function(){return this._radius},set:function(t){this._radius=t,this._flagRadius=!0}}},lo=Math.cos,co=Math.sin,tc=class Vi extends Ne{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 Se);super(l,!0,!0,!0),v(this,"_flagWidth",!1),v(this,"_flagHeight",!1),v(this,"_width",0),v(this,"_height",0),this._renderer.type="ellipse";for(let c in nc)Object.defineProperty(this,c,nc[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 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&&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*gt,c=r*lo(l),d=s*co(l),u=r*n*lo(l-it),h=s*n*co(l-it),f=r*n*lo(l+it),g=s*n*co(l+it),m=this.vertices[o];m.command=o===0?se.move:se.curve,m.set(c,d),m.controls.left.set(u,h),m.controls.right.set(f,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 Vi(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<Ne.Properties.length;a++){const l=Ne.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<Vi.Properties.length;n++){const r=Vi.Properties[n];e[r]=this[r]}return e}};v(tc,"Properties",["width","height"]);var Xr=tc,nc={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}}},Ig=Math.ceil,Ag=Math.floor,ic=class si extends Yn{constructor(e){super(),v(this,"_flagVertices",!0),v(this,"_flagLength",!0),v(this,"_flagFill",!0),v(this,"_flagStroke",!0),v(this,"_flagLinewidth",!0),v(this,"_flagOpacity",!0),v(this,"_flagVisible",!0),v(this,"_flagSize",!0),v(this,"_flagSizeAttenuation",!0),v(this,"_flagStrokeAttenuation",!0),v(this,"_length",0),v(this,"_fill","#fff"),v(this,"_stroke","#000"),v(this,"_linewidth",1),v(this,"_opacity",1),v(this,"_visible",!0),v(this,"_size",1),v(this,"_sizeAttenuation",!1),v(this,"_beginning",0),v(this,"_ending",1),v(this,"_dashes",null),v(this,"_strokeAttenuation",!0),v(this,"noFill",Ne.prototype.noFill),v(this,"noStroke",Ne.prototype.noStroke),v(this,"corner",Ne.prototype.corner),v(this,"center",Ne.prototype.center),v(this,"getBoundingClientRect",Ne.prototype.getBoundingClientRect),v(this,"_updateLength",Ne.prototype._updateLength);for(let n in rc)Object.defineProperty(this,n,rc[n]);this._renderer.type="points",this._renderer.flagVertices=Ll.bind(this),this._renderer.bindVertices=Hl.bind(this),this._renderer.unbindVertices=Wl.bind(this),this._renderer.flagFill=jl.bind(this),this._renderer.flagStroke=ql.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:ci(e.fill),r=typeof e.stroke=="string"?e.stroke:ci(e.stroke),s=new si().copy(Xs(qs({},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 Se?this.vertices.push(e.vertices[n].clone()):this.vertices.push(new Se().copy(r))}for(let n=0;n<si.Properties.length;n++){const r=si.Properties[n];r in e&&(this[r]=e[r])}return this}clone(e){const n=new si;for(let r=0;r<this.vertices.length;r++)n.vertices.push(this.vertices[r].clone());for(let r=0;r<si.Properties.length;r++){const s=si.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()),ie.each(si.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,u=Ks(a,l,a,l,c,d,c,d,e);n=n.concat(u)}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=Hr(this,e*this._length),s=Hr(this,n*this._length),o=Ig(r),a=Ag(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}};v(ic,"Properties",["fill","stroke","linewidth","opacity","visible","size","sizeAttenuation","beginning","ending","dashes","strokeAttenuation"]);var uo=ic,rc={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 rt||this._fill instanceof Ye||this._fill instanceof Ue||this._fill instanceof Oe)&&this._fill.unbind(Q.Types.change,this._renderer.flagFill),this._fill=t,this._flagFill=!0,(this._fill instanceof rt||this._fill instanceof Ye||this._fill instanceof Ue||this._fill instanceof Oe)&&this._fill.bind(Q.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(t){(this._stroke instanceof rt||this._stroke instanceof Ye||this._stroke instanceof Ue||this._stroke instanceof Oe)&&this._stroke.unbind(Q.Types.change,this._renderer.flagStroke),this._stroke=t,this._flagStroke=!0,(this._stroke instanceof rt||this._stroke instanceof Ye||this._stroke instanceof Ue||this._stroke instanceof Oe)&&this._stroke.bind(Q.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(Q.Types.insert,e).unbind(Q.Types.remove,n),t instanceof qn?this._collection=t:this._collection=new qn(t||[]),this._collection.bind(Q.Types.insert,e).bind(Q.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}}},Mg=Math.cos,Og=Math.sin,sc=class Ii extends Ne{constructor(e,n,r,s){s=Math.max(s||0,3),super(),v(this,"_flagWidth",!1),v(this,"_flagHeight",!1),v(this,"_flagSides",!1),v(this,"_radius",0),v(this,"_width",0),v(this,"_height",0),v(this,"_sides",0),this._renderer.type="polygon";for(let o in oc)Object.defineProperty(this,o,oc[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 Ii().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<Ii.Properties.length;n++){const r=Ii.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=gt*o+Math.PI/2,l=this._width*Mg(a)/2,c=this._height*Og(a)/2;s>=r?this.vertices.push(new Se(l,c)):this.vertices[s].set(l,c),this.vertices[s].command=s===0?se.move:se.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 Ii(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<Ne.Properties.length;r++){const s=Ne.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<Ii.Properties.length;n++){const r=Ii.Properties[n];e[r]=this[r]}return e}};v(sc,"Properties",["width","height","sides"]);var ho=sc,oc={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}}},ac=class Ai extends Ne{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 Se(0,0,0,0,0,0,l===0?se.move:se.curve));super(a),v(this,"_flagWidth",!1),v(this,"_flagHeight",!1),v(this,"_flagRadius",!1),v(this,"_width",0),v(this,"_height",0),v(this,"_radius",12),this._renderer.type="rounded-rectangle";for(let l in lc)Object.defineProperty(this,l,lc[l]);this.closed=!0,this.automatic=!1,this._renderer.flagRadius=zg.bind(this),typeof r=="number"&&(this.width=r),typeof s=="number"&&(this.height=s),(typeof o=="number"||o instanceof re)&&(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 Ai().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<Ai.Properties.length;n++){const r=Ai.Properties[n];if(r in e){const s=e[r];/radius/i.test(r)?this[r]=typeof s=="number"||s instanceof re?s:new re().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 re?(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 Ai(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<Ne.Properties.length;a++){const l=Ne.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<Ai.Properties.length;n++){const r=Ai.Properties[n];e[r]=this[r]}return e.radius=typeof this.radius=="number"?this.radius:this.radius.toObject(),e}};v(ac,"Properties",["width","height","radius"]);var Yr=ac,lc={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 re&&this._radius.unbind(Q.Types.change,this._renderer.flagRadius),this._radius=t,this._radius instanceof re&&this._radius.bind(Q.Types.change,this._renderer.flagRadius),this._flagRadius=!0}}};function zg(){this._flagRadius=!0}var Dg=Math.cos,Lg=Math.sin,cc=class Mi extends Ne{constructor(e,n,r,s,o){arguments.length<=3&&(s=r,r=s/2),(typeof o!="number"||o<=0)&&(o=5),super(),v(this,"_flagInnerRadius",!1),v(this,"_flagOuterRadius",!1),v(this,"_flagSides",!1),v(this,"_innerRadius",0),v(this,"_outerRadius",0),v(this,"_sides",0),this._renderer.type="star";for(let a in dc)Object.defineProperty(this,a,dc[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 Mi().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<Mi.Properties.length;n++){const r=Mi.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=gt*o,l=(s%2?this._outerRadius:this._innerRadius)/2,c=l*Dg(a),d=l*Lg(a);s>=r?this.vertices.push(new Se(c,d)):this.vertices[s].set(c,d),this.vertices[s].command=s===0?se.move:se.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 Mi(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<Ne.Properties.length;a++){const l=Ne.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<Mi.Properties.length;n++){const r=Mi.Properties[n];e[r]=this[r]}return e}};v(cc,"Properties",["innerRadius","outerRadius","sides"]);var fo=cc,dc={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}}},mo,uc=Math.min,hc=Math.max;Xe.document&&(mo=document.createElement("canvas"));var go=class Yt extends Yn{constructor(e,n,r,s){super(),v(this,"_flagValue",!0),v(this,"_flagFamily",!0),v(this,"_flagSize",!0),v(this,"_flagLeading",!0),v(this,"_flagAlignment",!0),v(this,"_flagBaseline",!0),v(this,"_flagStyle",!0),v(this,"_flagWeight",!0),v(this,"_flagDecoration",!0),v(this,"_flagFill",!0),v(this,"_flagStroke",!0),v(this,"_flagLinewidth",!0),v(this,"_flagOpacity",!0),v(this,"_flagVisible",!0),v(this,"_flagMask",!1),v(this,"_flagClip",!1),v(this,"_flagDirection",!0),v(this,"_flagStrokeAttenuation",!0),v(this,"_value",""),v(this,"_family","sans-serif"),v(this,"_size",13),v(this,"_leading",17),v(this,"_alignment","center"),v(this,"_baseline","middle"),v(this,"_style","normal"),v(this,"_weight",500),v(this,"_decoration","none"),v(this,"_direction","ltr"),v(this,"_fill","#000"),v(this,"_stroke","none"),v(this,"_linewidth",1),v(this,"_opacity",1),v(this,"_visible",!0),v(this,"_mask",null),v(this,"_clip",!1),v(this,"_dashes",null),v(this,"_strokeAttenuation",!0);for(let o in fc)Object.defineProperty(this,o,fc[o]);if(this._renderer.type="text",this._renderer.flagFill=Hg.bind(this),this._renderer.flagStroke=Wg.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,!ie.isObject(s))return this;for(let o=0;o<Yt.Properties.length;o++){const a=Yt.Properties[o];a in s&&(this[a]=s[a])}}static Measure(e){if(mo){const n=mo.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*Yt.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:ci(e.fill),r=typeof e.stroke=="string"?e.stroke:ci(e.stroke),s=new Yt().copy(Xs(qs({},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<Yt.Properties.length;n++){const r=Yt.Properties[n];r in e&&(this[r]=e[r])}return this}clone(e){const n=new Yt(this.value);n.translation.copy(this.translation),n.rotation=this.rotation,n.scale=this.scale;for(let r=0;r<Yt.Properties.length;r++){const s=Yt.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<Yt.Properties.length;n++){const r=Yt.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}=Yt.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[u,h]=n.multiply(r,o),[f,g]=n.multiply(r,a),[m,p]=n.multiply(s,o),[y,b]=n.multiply(s,a);return o=uc(h,g,p,b),r=uc(u,f,m,y),s=hc(u,f,m,y),a=hc(h,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}};v(go,"Ratio",.6),v(go,"Properties",["value","family","size","leading","alignment","linewidth","style","weight","decoration","direction","baseline","opacity","visible","fill","stroke","dashes","strokeAttenuation"]);var fn=go,fc={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 rt||this._fill instanceof Ye||this._fill instanceof Ue||this._fill instanceof Oe)&&this._fill.unbind(Q.Types.change,this._renderer.flagFill),this._fill=t,this._flagFill=!0,(this._fill instanceof rt||this._fill instanceof Ye||this._fill instanceof Ue||this._fill instanceof Oe)&&this._fill.bind(Q.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(t){(this._stroke instanceof rt||this._stroke instanceof Ye||this._stroke instanceof Ue||this._stroke instanceof Oe)&&this._stroke.unbind(Q.Types.change,this._renderer.flagStroke),this._stroke=t,this._flagStroke=!0,(this._stroke instanceof rt||this._stroke instanceof Ye||this._stroke instanceof Ue||this._stroke instanceof Oe)&&this._stroke.bind(Q.Types.change,this._renderer.flagStroke)}},mask:{enumerable:!0,get:function(){return this._mask},set:function(t){this._mask=t,this._flagMask=!0,ie.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 Hg(){this._flagFill=!0}function Wg(){this._flagStroke=!0}var po=class rr extends Un{constructor(e,n,r,s){super(n,r,0,0),v(this,"_flagTextures",!1),v(this,"_flagFrameRate",!1),v(this,"_flagIndex",!1),v(this,"_amount",1),v(this,"_duration",0),v(this,"_index",0),v(this,"_startTime",0),v(this,"_playing",!1),v(this,"_firstFrame",0),v(this,"_lastFrame",0),v(this,"_loop",!0),v(this,"_textures",null),v(this,"_frameRate",0),v(this,"_origin",null),this._renderer.type="image-sequence";for(let o in mc)Object.defineProperty(this,o,mc[o]);this._renderer.flagTextures=jg.bind(this),this._renderer.bindTextures=qg.bind(this),this._renderer.unbindTextures=Xg.bind(this),this.noStroke(),this.noFill(),Array.isArray(e)?this.textures=e.map(gc.bind(this)):typeof e=="string"&&(this.textures=[gc(e)]),this.origin=new re,this._update(),typeof s=="number"?this.frameRate=s:this.frameRate=rr.DefaultFrameRate,this.index=0}static fromObject(e){const n=new rr().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<rr.Properties.length;n++){const r=rr.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=ie.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 rr(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,ie.isNaN(this._lastFrame)&&(this._lastFrame=o-1),s=ie.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=zt(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 Oe))&&(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}};v(po,"Properties",["textures","frameRate","index","firstFrame","lastFrame","loop"]),v(po,"DefaultFrameRate",30);var yo=po,mc={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(Q.Types.insert,e).unbind(Q.Types.remove,n),this._textures=new qn((t||[]).slice(0)),this._textures.bind(Q.Types.insert,e).bind(Q.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 jg(){this._flagTextures=!0}function qg(t){let e=t.length;for(;e--;)t[e].bind(Q.Types.change,this._renderer.flagTextures);this._renderer.flagTextures()}function Xg(t){let e=t.length;for(;e--;)t[e].unbind(Q.Types.change,this._renderer.flagTextures);this._renderer.flagTextures()}function gc(t){if(t instanceof Oe)return t;if(typeof t=="string")return new Oe(t)}var Ur=Math.min,Kr=Math.max,bo=class oi extends Yn{constructor(e){super(),v(this,"_flagAdditions",!1),v(this,"_flagSubtractions",!1),v(this,"_flagOrder",!1),v(this,"_flagOpacity",!0),v(this,"_flagBeginning",!1),v(this,"_flagEnding",!1),v(this,"_flagLength",!1),v(this,"_flagMask",!1),v(this,"_fill","#fff"),v(this,"_stroke","#000"),v(this,"_linewidth",1),v(this,"_opacity",1),v(this,"_visible",!0),v(this,"_cap","round"),v(this,"_join","round"),v(this,"_miter",4),v(this,"_closed",!0),v(this,"_curved",!1),v(this,"_automatic",!0),v(this,"_beginning",0),v(this,"_ending",1),v(this,"_length",0),v(this,"_mask",null),v(this,"_strokeAttenuation",!0);for(let n in pc)Object.defineProperty(this,n,pc[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++)yc.call(this,e[n],this)}static RemoveChildren(e){for(let n=0;n<e.length;n++)yc.call(this,e[n])}static OrderChildren(e){this._flagOrder=!0}static fromObject(e){const n=new oi;for(let s=0;s<oi.Properties.length;s++){const o=oi.Properties[s];o in e&&(/(fill|stroke)/i.test(o)?n[o]=typeof e[o]=="string"?e[o]:ci(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 so.fromObject(s);case"circle":return qr.fromObject(s);case"element":return Di.fromObject(s);case"ellipse":return Xr.fromObject(s);case"group":return oi.fromObject(s);case"image":return Image.fromObject(s);case"image-sequence":return yo.fromObject(s);case"path":return Ne.fromObject(s);case"points":return uo.fromObject(s);case"polygon":return ho.fromObject(s);case"rectangle":return Un.fromObject(s);case"rounded-rectangle":return Yr.fromObject(s);case"shape":return Yn.fromObject(s);case"sprite":return jr.fromObject(s);case"star":return fo.fromObject(s);case"text":return fn.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<oi.Properties.length;n++){const r=oi.Properties[n];r in e&&(this[r]=e[r])}return this}clone(e){const n=new oi,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,ie.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,u=1/0,h=-1/0;const f=/texture|gradient/i;r=e?this.matrix:this.worldMatrix;for(let g=0;g<this.children.length;g++){const m=this.children[g];if(!(!m.visible||f.test(m._renderer.type))&&(n=m.getBoundingClientRect(e),s=typeof n.top!="number"||ie.isNaN(n.top)||!isFinite(n.top),o=typeof n.left!="number"||ie.isNaN(n.left)||!isFinite(n.left),a=typeof n.right!="number"||ie.isNaN(n.right)||!isFinite(n.right),l=typeof n.bottom!="number"||ie.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),[B,k]=r.multiply(n.left,n.bottom),[N,R]=r.multiply(n.right,n.bottom);u=Ur(y,_,k,R,u),c=Ur(p,b,B,N,c),d=Kr(p,b,B,N,d),h=Kr(y,_,k,R,h)}else u=Ur(n.top,u),c=Ur(n.left,c),d=Kr(n.right,d),h=Kr(n.bottom,h)}return{top:u,left:c,right:d,bottom:h,width:d-c,height:h-u}}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}};v(bo,"Children",Gl),v(bo,"Properties",["fill","stroke","linewidth","cap","join","miter","closed","curved","automatic"]);var ct=bo,pc={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=ct.InsertChildren.bind(this),n=ct.RemoveChildren.bind(this),r=ct.OrderChildren.bind(this);this._children&&(this._children.unbind(),this._children.length>0&&n(this._children)),this._children=new Gl(t),this._children.bind(Q.Types.insert,e),this._children.bind(Q.Types.remove,n),this._children.bind(Q.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,ie.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 yc(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 Gr=class extends Ne{constructor(e,n,r,s){const o=[new Se(e,n),new Se(r,s)];super(o);for(let a in bc)Object.defineProperty(this,a,bc[a]);this.vertices[0].command=se.move,this.vertices[1].command=se.line,this.automatic=!1}};v(Gr,"Properties",["left","right"]);var bc={left:{enumerable:!0,get:function(){return this.vertices[0]},set:function(t){if(ie.isObject(t))this.vertices.splice(0,1,t),this.vertices[0].command=se.move;else{const e=new At("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(ie.isObject(t))this.vertices.splice(1,1,t),this.vertices[1].command=se.line;else{const e=new At("Two.Line.right argument is not an object.");console.warn(e.name,e.message)}}}},mn={path:/[+-]?(?:\d*\.\d+|\d+)(?:[eE][+-]\d+)?/g,cssBackgroundImage:/url\(['"]?#([\w\d-_]*)['"]?\)/i,unitSuffix:/[a-zA-Z%]*/i},Yg={start:"left",middle:"center",end:"right"},_c=["id","class","transform","xmlns","viewBox"],Ug=["x","y","width","height","href","xlink:href"];function Kg(t){return Yg[t]}function Gg(t){const e=t.getAttribute("dominant-baseline"),n=t.getAttribute("alignment-baseline");return e||n}function ur(t){return t.replace(/svg:/gi,"").toLowerCase()}function wc(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 Zg(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 Qg(t){const e={},n=Jg(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 Jg(t){const e=t.getAttributeNames();for(let n=0;n<_c.length;n++){const r=_c[n],s=Array.prototype.indexOf.call(e,r);s>=0&&e.splice(s,1)}return e}function ep(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 h=0;h<t.children.length;h++){const f=t.children[h];"translation"in f?f.translation.add(r,s):"x"in f?f.x=r:"y"in f&&(f.y=s)}const l=typeof t.x=="number",c=typeof t.y=="number",d=typeof t.width=="number",u=typeof t.height=="number";return l&&(t.translation.x+=t.x),c&&(t.translation.y+=t.y),(d||u)&&(t.scale=new re(1,1)),d&&(t.scale.x=t.width/o),u&&(t.scale.y=t.height/a),t.mask=new Un(0,0,o,a),t.mask.origin.set(-o/2,-a/2),t}function Ut(t,e,n){const r={},s={},o={};let a,l,c,d,u,h,f,g,m,p,y,b,_,B,k,N,R;if(t===null)return r;if(Xe.getComputedStyle){const w=Xe.getComputedStyle(t);for(a=w.length;a--;)c=w[a],d=w[c],typeof d<"u"&&(r[c]=d)}for(a=0;a<t.attributes.length;a++)h=t.attributes[a],/style/i.test(h.nodeName)?Zg(h.value,o):s[h.nodeName]=h.value;typeof r.opacity<"u"&&(r["stroke-opacity"]=r.opacity,r["fill-opacity"]=r.opacity,delete r.opacity),n&&ie.defaults(r,n),ie.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(f=li(l),e._renderer.type){case"linear-gradient":wc(f,e.left),wc(f,e.right);break;case"radial-gradient":e.center.x+=f.translateX,e.center.y+=f.translateY,e.focal.x+=f.translateX,e.focal.y+=f.translateY,e.radius*=Math.max(f.scaleX,f.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;f=li(l),e.translation.set(f.translateX,f.translateY),e.rotation=Math.PI*(f.rotation/180),e.scale=new re(f.scaleX,f.scaleY),g=parseFloat((r.x+"").replace("px")),m=parseFloat((r.y+"").replace("px")),g&&(e.translation.x=g),m&&(e.translation.y=m);break;case"visible":if(e instanceof ct){e._visible=d;break}e.visible=d;break;case"stroke-linecap":if(e instanceof ct){e._cap=d;break}e.cap=d;break;case"stroke-linejoin":if(e instanceof ct){e._join=d;break}e.join=d;break;case"stroke-miterlimit":if(e instanceof ct){e._miter=d;break}e.miter=d;break;case"stroke-width":if(e instanceof ct){e._linewidth=parseFloat(d);break}e.linewidth=parseFloat(d);break;case"opacity":case"stroke-opacity":case"fill-opacity":if(e instanceof ct){e._opacity=parseFloat(d);break}e.opacity=parseFloat(d);break;case"clip-path":if(mn.cssBackgroundImage.test(d)&&(p=d.replace(mn.cssBackgroundImage,"$1"),qe.defs.current&&qe.defs.current.contains(p)&&(b=qe.defs.current.get(p),b&&b.childNodes.length>0)))switch(b=b.childNodes[0],_=ur(b.nodeName),e.mask=qe[_].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":u=(e instanceof ct?"_":"")+c,mn.cssBackgroundImage.test(d)?(p=d.replace(mn.cssBackgroundImage,"$1"),qe.defs.current&&qe.defs.current.contains(p)?(b=qe.defs.current.get(p),b.object||(_=ur(b.nodeName),b.object=qe[_].call(this,b,{})),b=b.object):(y=np(this),b=y.getById(p)),e[u]=b):e[u]=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(B=e instanceof rt,k=e instanceof Ye,N=e instanceof Ue,B||k||N)break;d.match("[a-z%]$")&&!d.endsWith("px")&&(R=new At("only pixel values are supported with the "+c+" attribute."),console.warn(R.name,R.message)),e.translation[c]=parseFloat(d);break;case"font-family":e instanceof fn&&(e.family=d);break;case"font-size":e instanceof fn&&(d.match("[a-z%]$")&&!d.endsWith("px")&&(R=new At("only pixel values are supported with the "+c+" attribute."),console.warn(R.name,R.message)),e.size=parseFloat(d));break;case"font-weight":e instanceof fn&&(e.weight=d);break;case"font-style":e instanceof fn&&(e.style=d);break;case"text-decoration":e instanceof fn&&(e.decoration=d);break;case"line-height":e instanceof fn&&(e.leading=d);break}return Object.keys(t.dataset).length&&(e.dataset=t.dataset),r}function tp(t,e){for(let n=0,r=t.childNodes.length;n<r;n++){const s=t.childNodes[n];!s.id||ur(t.nodeName)==="#text"||e.add(s.id,s)}}function np(t){for(;t.parent;)t=t.parent;return t.scene}var qe={svg:function(t){const e=qe.defs.current=new Dr,n=t.getElementsByTagName("defs");for(let m=0;m<n.length;m++)tp(n[m],e);const r=qe.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,u=o!==null,h=a!==null,f=l!==null,g=c!==null;return u&&(r.x=parseFloat(o.replace(mn.unitSuffix,""))),h&&(r.y=parseFloat(a.replace(mn.unitSuffix,""))),f&&(r.width=parseFloat(l.replace(mn.unitSuffix,""))),g&&(r.height=parseFloat(c.replace(mn.unitSuffix,""))),d&&ep(r,s),delete qe.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 At("encountered <use /> with no href."),console.warn(n.name,n.message),null;const s=r.slice(1);if(!qe.defs.current.contains(s))return n=new At("unable to find element for reference "+r+"."),console.warn(n.name,n.message),null;const a=qe.defs.current.get(s).cloneNode(!0);for(let c=0;c<t.attributes.length;c++){const d=t.attributes[c],u=Ug.includes(d.nodeName),h=!a.hasAttribute(d.nodeName);(u||h)&&a.setAttribute(d.nodeName,d.value)}const l=ur(a.nodeName);return qe[l].call(this,a,e)},g:function(t,e){const n=new ct;Ut.call(this,t,n,e),this.add(n);const r=Qg.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=ur(l);if(c in qe){const d=qe[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 Se(parseFloat(a),parseFloat(l)))});const s=new Ne(r,!0);return s.stroke="none",s.fill="black",Ut.call(this,t,s,e),s},polyline:function(t,e){const n=qe.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 Se,c,d,u=n.match(/[a-df-z][^a-df-z]*/gi);const h=u.length-1;ie.each(u.slice(0),function(f,g){const m=f.slice(1).trim().match(mn.path),p=f[0],y=p.toLowerCase();let b,_,B,k,N;const R=[];switch(g===0&&(u=[]),y){case"h":case"v":m.length>1&&(b=1);break;case"m":case"l":case"t":m.length>2&&(b=2);break;case"s":case"q":m.length>4&&(b=4);break;case"c":m.length>6&&(b=6);break;case"a":m.length>7&&(b=7);break}if(b){for(_=0,B=m.length,N=0;_<B;_+=b){if(k=p,N>0)switch(p){case"m":k="l";break;case"M":k="L";break}R.push(k+m.slice(_,_+b).join(" ")),N++}u=Array.prototype.concat.apply(u,R)}else u.push(f)}),ie.each(u,function(f,g){let m,p,y;const b=f[0],_=b.toLowerCase();d=f.slice(1).trim().match(mn.path),o=b===_;let B,k,N,R,w,C,x,T,$,F,I,L,O,Z,ne,E,P;switch(_){case"z":if(g>=h)s=!0;else{p=l.x,y=l.y,m=new Se(p,y,void 0,void 0,void 0,void 0,se.close);for(let H=r.length-1;H>=0;H--){const Y=r[H];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]),m=new Se(p,y,void 0,void 0,void 0,void 0,/m/i.test(_)?se.move:se.line),o&&m.addSelf(l),l=m;break;case"h":case"v":F=/h/i.test(_)?"x":"y",I=/x/i.test(F)?"y":"x",m=new Se(void 0,void 0,void 0,void 0,void 0,void 0,se.line),m[F]=parseFloat(d[0]),m[I]=l[I],o&&(m[F]+=l[F]),l=m;break;case"c":case"s":B=l.x,k=l.y,c||(c=new re),/c/i.test(_)?(N=parseFloat(d[0]),R=parseFloat(d[1]),w=parseFloat(d[2]),C=parseFloat(d[3]),x=parseFloat(d[4]),T=parseFloat(d[5])):($=Gs(l,c,o),N=$.x,R=$.y,w=parseFloat(d[0]),C=parseFloat(d[1]),x=parseFloat(d[2]),T=parseFloat(d[3])),o&&(N+=B,R+=k,w+=B,C+=k,x+=B,T+=k),l.controls.right.set(N-l.x,R-l.y),m=new Se(x,T,w-x,C-T,void 0,void 0,se.curve),l=m,c=m.controls.left;break;case"t":case"q":B=l.x,k=l.y,c||(c=new re),/q/i.test(_)?(N=parseFloat(d[0]),R=parseFloat(d[1]),w=parseFloat(d[0]),C=parseFloat(d[1]),x=parseFloat(d[2]),T=parseFloat(d[3])):($=Gs(l,c,o),N=$.x,R=$.y,w=$.x,C=$.y,x=parseFloat(d[0]),T=parseFloat(d[1])),o&&(N+=B,R+=k,w+=B,C+=k,x+=B,T+=k),l.controls.right.set((N-l.x)*.33,(R-l.y)*.33),m=new Se(x,T,w-x,C-T,void 0,void 0,se.curve),l=m,c=m.controls.left;break;case"a":B=l.x,k=l.y,O=parseFloat(d[0]),Z=parseFloat(d[1]),ne=parseFloat(d[2]),E=parseFloat(d[3]),P=parseFloat(d[4]),x=parseFloat(d[5]),T=parseFloat(d[6]),o&&(x+=B,T+=k),L=new Se(x,T),L.command=se.arc,L.rx=O,L.ry=Z,L.xAxisRotation=ne,L.largeArcFlag=E,L.sweepFlag=P,m=L,l=L,c=void 0;break}m&&(Array.isArray(m)?r=r.concat(m):r.push(m))})}n=new Ne(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},ie.each(n.vertices,function(l){l.subSelf(a.centroid)}),Ut.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 qr(0,0,s);return o.stroke="none",o.fill="black",Ut.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 Xr(0,0,s,o);return a.stroke="none",a.fill="black",Ut.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(!ie.isNaN(n)||!ie.isNaN(r))return qe["rounded-rect"](t);const s=parseFloat(t.getAttribute("width")),o=parseFloat(t.getAttribute("height")),a=s/2,l=o/2,c=new Un(0,0,s,o);return c.stroke="none",c.fill="black",Ut.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 re(n,r),d=new Yr(0,0,s,o,c);return d.stroke="none",d.fill="black",Ut.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 Gr(n,r,s,o).noFill();return Ut.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 u=[];for(let f=0;f<t.children.length;f++){const g=t.children[f];let m=g.getAttribute("offset");/%/gi.test(m)&&(m=parseFloat(m.replace(/%/gi,""))/100),m=parseFloat(m);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),u.push(new Xn(m,p,y))}const h=new Ye(s,o,a,l,u);return h.spread=r,h.units=n,Ut.call(this,t,h,e),h},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"));ie.isNaN(l)&&(l=s),ie.isNaN(c)&&(c=o);const d=Math.abs(s+l)/2,u=Math.abs(o+c)/2;/userSpaceOnUse/i.test(n)&&(s-=d,o-=u,l-=d,c-=u);const h=[];for(let g=0;g<t.children.length;g++){const m=t.children[g];let p=m.getAttribute("offset");/%/gi.test(p)&&(p=parseFloat(p.replace(/%/gi,""))/100),p=parseFloat(p);let y=m.getAttribute("stop-color"),b=m.getAttribute("stop-opacity"),_=m.getAttribute("style"),B;y===null&&(B=_?_.match(/stop-color:\s?([#a-fA-F0-9]*)/):!1,y=B&&B.length>1?B[1]:void 0),b===null?(B=_?_.match(/stop-opacity:\s?([0-9.-]*)/):!1,b=B&&B.length>1?parseFloat(B[1]):1):b=parseFloat(b),h.push(new Xn(p,y,b))}const f=new Ue(s,o,a,h,l,c);return f.spread=r,f.units=n,Ut.call(this,t,f,e),f},text:function(t,e){const n=Kg(t.getAttribute("text-anchor"))||"left",r=Gg(t)||"baseline";let s="";t.childNodes.length>0&&t.childNodes[0].tagName==="TSPAN"?s=t.childNodes[0].textContent:s=t.textContent;const o=new fn(s);return Ut.call(this,t,o,e),o.alignment=n,o.baseline=r,o},clippath:function(t,e){return qe.defs.current&&!qe.defs.current.contains(t.id)&&qe.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 At("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 jr(r,s,o);return ie.isNaN(a)||(c.width=a),ie.isNaN(l)||(c.height=l),Ut.call(this,t,c,e),c}};function xc(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 _o=class Bn extends Un{constructor(e,n,r,s,o,a){super(n,r,s||1,o||1),v(this,"_flagTexture",!1),v(this,"_flagMode",!1),v(this,"_texture",null),v(this,"_mode","fill"),this._renderer.type="image";for(let l in vc)Object.defineProperty(this,l,vc[l]);this.noStroke(),this.noFill(),e instanceof Oe?this.texture=e:typeof e=="string"&&(this.texture=new Oe(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 re(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}};v(_o,"Modes",{fill:"fill",fit:"fit",crop:"crop",tile:"tile",stretch:"stretch"}),v(_o,"Properties",["texture","mode"]);var kc=_o,vc={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}}},wo=[],xo=Math.max,ip=Math.min,Cc=Math.abs,Zr=Math.sin,Qr=Math.cos,rp=Math.acos,Jr=Math.sqrt,Pe={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 Pe?t:"path"},group:{renderChild:function(t){const e=Pe.getRendererType(t._renderer.type);Pe[e].render.call(t,this.ctx,!0,this.clip)},render:function(t){if(!this._visible)return this;ie.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=es(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=Pe.getRendererType(r._renderer.type);Pe[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=Pe.getRendererType(l._renderer.type);Pe[c].render.call(l,t)}return o&&t.restore(),ie.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},path:{render:function(t,e,n){let r,s,o,a,l,c,d,u,h,f,g,m,p,y,b,_,B,k,N,R,w,C,x,T,$,F,I,L,O,Z,ne,E,P,H;if(H=this.parent&&this.parent._renderer?this.parent._renderer.opacity:1,O=this._mask,Z=this._clip,l=this._opacity*(H||1),c=this._visible,!e&&(!c||Z||l===0))return this;if(ie.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,u=this._join,h=this._miter,f=this._closed,g=this._renderer.vertices,m=g.length,p=m-1,ne=es(r),P=this.dashes,ne||(t.save(),t.transform(r[0],r[3],r[1],r[4],r[2],r[5])),O){const ee=Pe.getRendererType(O._renderer.type);Pe[ee].render.call(O,t,!0)}if(a)if(typeof a=="string")t.fillStyle=a;else{const ee=Pe.getRendererType(a._renderer.type);Pe[ee].render.call(a,t,this),t.fillStyle=a._renderer.effect}if(s){if(typeof s=="string")t.strokeStyle=s;else{const ee=Pe.getRendererType(s._renderer.type);Pe[ee].render.call(s,t,this),t.strokeStyle=s._renderer.effect}o&&(t.lineWidth=hn(this)),h&&(t.miterLimit=h),u&&(t.lineJoin=u),!f&&d&&(t.lineCap=d)}typeof l=="number"&&(t.globalAlpha=l),P&&P.length>0&&(t.lineDashOffset=P.offset||0,t.setLineDash(P)),t.beginPath();let Y,D,X,W,V,j,U;for(let ee=0;ee<m;ee++)switch(_=g[ee],I=_.x,L=_.y,_.command){case se.close:t.closePath();break;case se.arc:Y=_.rx,D=_.ry,X=_.xAxisRotation,W=_.largeArcFlag,V=_.sweepFlag,y=f?Dt(ee-1,m):xo(ee-1,0),b=g[y],j=b.x,U=b.y,Pe.renderSvgArcCommand(t,j,U,Y,D,W,V,X,I,L);break;case se.curve:y=f?Dt(ee-1,m):Math.max(ee-1,0),b=g[y],x=b.controls&&b.controls.right||re.zero,T=_.controls&&_.controls.left||re.zero,b._relative?(w=x.x+b.x,C=x.y+b.y):(w=x.x,C=x.y),_._relative?(N=T.x+_.x,R=T.y+_.y):(N=T.x,R=T.y),t.bezierCurveTo(w,C,N,R,I,L),ee>=p&&f&&(B=k,$=_.controls&&_.controls.right||re.zero,F=B.controls&&B.controls.left||re.zero,_._relative?(w=$.x+_.x,C=$.y+_.y):(w=$.x,C=$.y),B._relative?(N=F.x+B.x,R=F.y+B.y):(N=F.x,R=F.y),I=B.x,L=B.y,t.bezierCurveTo(w,C,N,R,I,L));break;case se.line:t.lineTo(I,L);break;case se.move:k=_,t.moveTo(I,L);break}return f&&t.closePath(),!Z&&!n&&(Pe.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()),Pe.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())),ne||t.restore(),Z&&!n&&t.clip(),P&&P.length>0&&t.setLineDash(wo),ie.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},points:{render:function(t,e,n){let r,s,o,a,l,c,d,u,h,f,g,m,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(ie.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update(),r=this._matrix.elements,s=this._stroke,o=this._linewidth,a=this._fill,u=this._renderer.collection,h=u.length,p=es(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 N=Pe.getRendererType(a._renderer.type);Pe[N].render.call(a,t,this),t.fillStyle=a._renderer.effect}if(s){if(typeof s=="string")t.strokeStyle=s;else{const N=Pe.getRendererType(s._renderer.type);Pe[N].render.call(s,t,this),t.strokeStyle=s._renderer.effect}o&&(t.lineWidth=hn(this))}typeof l=="number"&&(t.globalAlpha=l),b&&b.length>0&&(t.lineDashOffset=b.offset||0,t.setLineDash(b)),t.beginPath();let B=d*.5,k;this._sizeAttenuation||(k=this.worldMatrix.elements,k=li(k[0],k[3],k[1],k[4],k[2],k[5]),B/=Math.max(k.scaleX,k.scaleY));for(let N=0;N<h;N++)f=u[N],g=f.x,m=f.y,t.moveTo(g+B,m),t.arc(g,m,B,0,gt);return n||(Pe.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()),Pe.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(wo),ie.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;ie.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();const c=this._matrix.elements,d=this._stroke,u=this._linewidth,h=this._fill,f=this._decoration,g=this._direction,m=es(c),p=h._renderer&&h._renderer.offset&&d._renderer&&d._renderer.offset,y=this.dashes,b=Pe.alignments[this._alignment]||this._alignment,_=Pe.baselines[this._baseline]||this._baseline;let B,k,N,R,w,C,x,T,$,F,I;if(m||(t.save(),t.transform(c[0],c[3],c[1],c[4],c[2],c[5])),a){const L=Pe.getRendererType(a._renderer.type);Pe[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,h)if(typeof h=="string")t.fillStyle=h;else{const L=Pe.getRendererType(h._renderer.type);Pe[L].render.call(h,t,this),t.fillStyle=h._renderer.effect}if(d){if(typeof d=="string")t.strokeStyle=d;else{const L=Pe.getRendererType(d._renderer.type);Pe[L].render.call(d,t,this),t.strokeStyle=d._renderer.effect}u&&(t.lineWidth=hn(this))}if(typeof s=="number"&&(t.globalAlpha=s),y&&y.length>0&&(t.lineDashOffset=y.offset||0,t.setLineDash(y)),!l&&!n&&(Pe.isHidden.test(h)||(h._renderer&&h._renderer.offset?(C=h._renderer.scale.x,x=h._renderer.scale.y,t.save(),t.translate(-h._renderer.offset.x,-h._renderer.offset.y),t.scale(C,x),B=this._size/h._renderer.scale.y,k=this._leading/h._renderer.scale.y,t.font=[this._style,this._weight,B+"px/",k+"px",this._family].join(" "),N=h._renderer.offset.x/h._renderer.scale.x,R=h._renderer.offset.y/h._renderer.scale.y,t.fillText(this.value,N,R),t.restore()):t.fillText(this.value,0,0)),Pe.isHidden.test(d)||(d._renderer&&d._renderer.offset?(C=d._renderer.scale.x,x=d._renderer.scale.y,t.save(),t.translate(-d._renderer.offset.x,-d._renderer.offset.y),t.scale(C,x),B=this._size/d._renderer.scale.y,k=this._leading/d._renderer.scale.y,t.font=[this._style,this._weight,B+"px/",k+"px",this._family].join(" "),N=d._renderer.offset.x/d._renderer.scale.x,R=d._renderer.offset.y/d._renderer.scale.y,w=u/d._renderer.scale.x,t.lineWidth=w,t.strokeText(this.value,N,R),t.restore()):t.strokeText(this.value,0,0))),/(underline|strikethrough)/i.test(f)){const L=t.measureText(this.value);let O=1;switch(f){case"underline":$=L.actualBoundingBoxDescent,I=L.actualBoundingBoxDescent;break;case"strikethrough":$=0,I=0,O=.5;break}switch(_){case"top":$+=this._size*O,I+=this._size*O;break;case"baseline":case"bottom":$-=this._size*O,I-=this._size*O;break}switch(b){case"left":case"start":T=0,F=L.width;break;case"right":case"end":T=-L.width,F=0;break;default:T=-L.width/2,F=L.width/2}t.lineWidth=Math.max(Math.floor(this._size/15),1),t.strokeStyle=t.fillStyle,t.beginPath(),t.moveTo(T,$),t.lineTo(F,I),t.stroke()}return m||t.restore(),l&&!n&&t.clip(),y&&y.length>0&&t.setLineDash(wo),ie.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},"linear-gradient":{render:function(t,e){if(e){if(ie.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 ie.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}}},"radial-gradient":{render:function(t,e){if(e){if(ie.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 ie.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}}},texture:{render:function(t){ie.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 re||(this._renderer.offset=new re),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 re?(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 re||(this._renderer.scale=new re),this._scale instanceof re?this._renderer.scale.copy(this._scale):this._renderer.scale.set(this._scale,this._scale)),ie.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=Cc(r),s=Cc(s);const u=(e-c)/2,h=(n-d)/2,f=Qr(l)*u+Zr(l)*h,g=-Zr(l)*u+Qr(l)*h,m=f*f,p=g*g;let y=r*r,b=s*s;const _=m/y+p/b;if(_>1){const L=Jr(_);r=L*r,s=L*s,y=r*r,b=s*s}const B=y*p+b*m,k=(y*b-B)/B;let N=Jr(xo(0,k));o===a&&(N=-N);const R=N*r*g/s,w=-N*s*f/r,C=Qr(l)*R-Zr(l)*w+(e+c)/2,x=Zr(l)*R+Qr(l)*w+(n+d)/2,T=Sc(1,0,(f-R)/r,(g-w)/s),$=Sc((f-R)/r,(g-w)/s,(-f-R)/r,(-g-w)/s)%gt,F=T+$;sp(t,C,x,r,s,T,F,a===0,l)}},yt=class extends Q{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 ct,this.scene.parent=this}setSize(t,e,n){return this.width=t,this.height=e,this.ratio=typeof n>"u"?Zs(this.ctx):n,this.domElement.width=t*this.ratio,this.domElement.height=e*this.ratio,this.domElement.style&&ie.extend(this.domElement.style,{width:t+"px",height:e+"px"}),this.trigger(Q.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),Pe.group.render.call(this.scene,this.ctx),t||this.ctx.restore(),this}};v(yt,"Utils",Pe);function sp(t,e,n,r,s,o,a,l,c){const d=a-o,u=Oi.Tolerance.epsilon,h=Math.abs(d)<u;let f=Dt(d,gt);f<u&&(h?f=0:f=gt),l===!0&&!h&&(f===gt?f=-gt:f=f-gt);for(let g=0;g<Tt.Resolution;g++){const m=g/(Tt.Resolution-1),p=o+m*f;let y=e+r*Math.cos(p),b=n+s*Math.sin(p);if(c!==0){const _=Math.cos(c),B=Math.sin(c),k=y-e,N=b-n;y=k*_-N*B+e,b=k*B+N*_+n}t.lineTo(y,b)}}function Sc(t,e,n,r){const s=t*n+e*r,o=Jr(t*t+e*e)*Jr(n*n+r*r);let a=rp(xo(-1,ip(1,s/o)));return t*r-e*n<0&&(a=-a),a}function es(t){return t[0]===1&&t[3]===0&&t[1]===0&&t[4]===1&&t[2]===0&&t[5]===0}var de={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(de.ns,n);return n==="svg"&&(e=ie.defaults(e||{},{version:de.version})),e&&Object.keys(e).length>0&&de.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(de.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?Dt(a-1,n):Math.max(a-1,0),d=t[c];let u,h,f,g,m,p,y,b,_,B,k,N,R,w,C,x=Me(l.x),T=Me(l.y);switch(l.command){case se.close:u=se.close;break;case se.arc:k=l.rx,N=l.ry,R=l.xAxisRotation,w=l.largeArcFlag,C=l.sweepFlag,u=se.arc+" "+k+" "+N+" "+R+" "+w+" "+C+" "+x+" "+T;break;case se.curve:y=d.controls&&d.controls.right||re.zero,b=l.controls&&l.controls.left||re.zero,d.relative?(f=Me(y.x+d.x),g=Me(y.y+d.y)):(f=Me(y.x),g=Me(y.y)),l.relative?(m=Me(b.x+l.x),p=Me(b.y+l.y)):(m=Me(b.x),p=Me(b.y)),u=(a===0?se.move:se.curve)+" "+f+" "+g+" "+m+" "+p+" "+x+" "+T;break;case se.move:s=l,u=se.move+" "+x+" "+T;break;default:u=l.command+" "+x+" "+T}a>=r&&e&&(l.command===se.curve&&(h=s,_=l.controls&&l.controls.right||l,B=h.controls&&h.controls.left||h,l.relative?(f=Me(_.x+l.x),g=Me(_.y+l.y)):(f=Me(_.x),g=Me(_.y)),h.relative?(m=Me(B.x+h.x),p=Me(B.y+h.y)):(m=Me(B.x),p=Me(B.y)),x=Me(h.x),T=Me(h.y),u+=" C "+f+" "+g+" "+m+" "+p+" "+x+" "+T),l.command!==se.close&&(u+=" Z")),o+=u+" "}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+=se.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=de.createElement("clipPath",{"clip-rule":"nonzero"})),n.parentNode===null&&e.defs.appendChild(n),n},getRendererType:function(t){return t in de?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=de.getRendererType(t._renderer.type);de[e].render.call(t,this)},render:function(t){if(!this._visible&&!this._flagVisible||this._opacity===0&&!this._flagOpacity)return this;ie.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update(),this._renderer.elem||(this._renderer.elem=de.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=de.getRendererType(s._renderer.type);de[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(de.group.appendChild,n),this._flagSubtractions&&this.subtractions.forEach(de.group.removeChild,n),this._flagOrder&&this.children.forEach(de.group.orderChild,n),this._flagMask)if(this._mask){const r=de.getRendererType(this._mask._renderer.type);de[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),ie.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},path:{render:function(t){if(this._opacity===0&&!this._flagOpacity)return this;ie.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=de.toString(this._renderer.vertices,this._closed);e.d=r}if(this._fill&&this._fill._renderer){this._renderer.hasFillEffect=!0,this._fill._update();const r=de.getRendererType(this._fill._renderer.type);de[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=de.getRendererType(this._stroke._renderer.type);de[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"]=hn(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?de.setAttributes(this._renderer.elem,e):(e.id=this._id,this._renderer.elem=de.createElement("path",e),t.appendChild(this._renderer.elem)),this._flagClip){const r=de.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=de.getRendererType(this._mask._renderer.type);de[r].render.call(this._mask,t),this._renderer.elem.setAttribute("clip-path","url(#"+this._mask.id+")")}else this._renderer.elem.removeAttribute("clip-path");return ie.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},points:{render:function(t){if(this._opacity===0&&!this._flagOpacity)return this;ie.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=li(o[0],o[3],o[1],o[4],o[2],o[5]);r/=Math.max(a.scaleX,a.scaleY)}const s=de.pointsToString(this._renderer.collection,r);e.d=s}if(this._fill&&this._fill._renderer){this._renderer.hasFillEffect=!0,this._fill._update();const r=de.getRendererType(this._fill._renderer.type);de[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=de.getRendererType(this._stroke._renderer.type);de[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"]=hn(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?de.setAttributes(this._renderer.elem,e):(e.id=this._id,this._renderer.elem=de.createElement("path",e),t.appendChild(this._renderer.elem)),ie.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"]=de.alignments[this._alignment]||this._alignment),this._flagBaseline&&(e["dominant-baseline"]=de.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=de.getRendererType(this._fill._renderer.type);de[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=de.getRendererType(this._stroke._renderer.type);de[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"]=hn(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?de.setAttributes(this._renderer.elem,e):(e.id=this._id,this._renderer.elem=de.createElement("text",e),t.appendChild(this._renderer.elem)),this._flagClip){const r=de.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=de.getRendererType(this._mask._renderer.type);de[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){ie.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?de.setAttributes(this._renderer.elem,n):(n.id=this._id,this._renderer.elem=de.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?de.setAttributes(o._renderer.elem,a):o._renderer.elem=de.createElement("stop",a),r&&this._renderer.elem.appendChild(o._renderer.elem),o.flagReset()}}return ie.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},"radial-gradient":{render:function(t,e){ie.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?de.setAttributes(this._renderer.elem,n):(n.id=this._id,this._renderer.elem=de.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?de.setAttributes(o._renderer.elem,a):o._renderer.elem=de.createElement("stop",a),r&&this._renderer.elem.appendChild(o._renderer.elem),o.flagReset()}}return ie.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},texture:{render:function(t,e){ie.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 re?(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 re?(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?de.setAttributes(this._renderer.image,r):this._renderer.image=de.createElement("image",r)),this._renderer.elem?Object.keys(n).length!==0&&de.setAttributes(this._renderer.elem,n):(n.id=this._id,n.patternUnits="userSpaceOnUse",this._renderer.elem=de.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),ie.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}}},Bc=class extends Q{constructor(t){super(),this.domElement=t.domElement||de.createElement("svg"),this.scene=new ct,this.scene.parent=this,this.defs=de.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,de.setAttributes(this.domElement,{width:t,height:e}),this.trigger(Q.Types.resize,t,e)}render(){return de.group.render.call(this.scene,this.domElement),de.defs.update(this.domElement),this}};v(Bc,"Utils",de);var Kt={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 At("unable to compile shader "+r+": "+o)}return r},types:{vertex:"VERTEX_SHADER",fragment:"FRAGMENT_SHADER"},path:{vertex:`
|
|
40
|
+
***************************************************************************** */var Or=function(){return Or=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},Or.apply(this,arguments)},cm={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"},Ws=500,dm=(function(){function t(e,n){return this.core=e,this.$LG=n,this.settings=Or(Or({},cm),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),u=d.allowY,h=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 f=this.getPossibleSwipeDragCords(n),g,m,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,m=y/b}else{var b=(e-n)*n;g=p*b,m=y*b}r&&(h?this.isBeyondPossibleLeft(g,f.minX)?g=f.minX:this.isBeyondPossibleRight(g,f.maxX)&&(g=f.maxX):e>1&&(g<f.minX?g=f.minX:g>f.maxX&&(g=f.maxX)),u?this.isBeyondPossibleTop(m,f.minY)?m=f.minY:this.isBeyondPossibleBottom(m,f.maxY)&&(m=f.maxY):e>1&&(m<f.minY?m=f.minY:m>f.maxY&&(m=f.maxY))),this.setZoomStyles({x:g,y:m,scale:e}),this.left=g,this.top=m,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)},Ws),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")}},Ws+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},Ws+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 u=Math.max(1,s+-d*.02);e.scale=Math.round((u+Number.EPSILON)*100)/100;var h=e.scale-o;e.zoomImage(e.scale,Math.round((h+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 u=this.core.getSlideItem(this.core.index).find(".lg-img-wrap").first(),h={};h.x=this.left+a,h.y=this.top+l;var f=this.getPossibleSwipeDragCords();(Math.abs(a)>15||Math.abs(l)>15)&&(s&&(this.isBeyondPossibleTop(h.y,f.minY)?h.y=f.minY:this.isBeyondPossibleBottom(h.y,f.maxY)&&(h.y=f.maxY)),r&&(this.isBeyondPossibleLeft(h.x,f.minX)?h.x=f.minX:this.isBeyondPossibleRight(h.x,f.maxX)&&(h.x=f.maxX)),s?this.top=h.y:h.y=this.top,r?this.left=h.x:h.x=this.left,this.setZoomSwipeStyles(u,h),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 u=a.x-o.maxX;a.x=o.maxX+u/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,u=(this.containerRect.width-a)/2,h={minY:l,maxY:c,minX:d,maxX:u};return h},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,u,h=this.core.getSlideItem(this.core.index);this.core.$inner.on("touchstart.lg",function(f){if(e.isImageSlide(e.core.index)&&(h=e.core.getSlideItem(e.core.index),(e.$LG(f.target).hasClass("lg-item")||h.get().contains(f.target))&&f.touches.length===1&&e.core.outer.hasClass("lg-zoomed"))){f.preventDefault(),l=new Date,e.core.touchAction="zoomSwipe",u=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(f)),d=e.getPossibleSwipeDragCords(),e.core.outer.addClass("lg-zoom-dragging lg-zoom-drag-transition")}}),this.core.$inner.on("touchmove.lg",function(f){if(f.touches.length===1&&e.core.touchAction==="zoomSwipe"&&(e.$LG(f.target).hasClass("lg-item")||h.get().contains(f.target))){f.preventDefault(),e.core.touchAction="zoomSwipe",r=e.getSwipeCords(f);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(u,g))}}),this.core.$inner.on("touchend.lg",function(f){if(e.core.touchAction==="zoomSwipe"&&(e.$LG(f.target).hasClass("lg-item")||h.get().contains(f.target))){if(f.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,u,h;this.core.outer.on("mousedown.lg.zoom",function(f){if(e.isImageSlide(e.core.index)){var g=e.core.getSlideItem(e.core.index);if(e.$LG(f.target).hasClass("lg-item")||g.get().contains(f.target)){c=new Date,h=e.core.getSlideItem(e.core.index).find(".lg-img-wrap").first();var m=e.getDragAllowedAxises(0);l=m.allowY,a=m.allowX,e.core.outer.hasClass("lg-zoomed")&&e.$LG(f.target).hasClass("lg-object")&&(a||l)&&(f.preventDefault(),n=e.getDragCords(f),u=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(f){if(s){o=!0,r=e.getDragCords(f);var g=e.getZoomSwipeCords(n,r,a,l,u);e.setZoomSwipeStyles(h,g)}}),this.$LG(window).on("mouseup.lg.zoom.global"+this.core.lgId,function(f){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(f);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 um={ref:"gallery-container",class:"lightgallery-wrapper"},hm={},nl=i.defineComponent({...hm,__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}),I.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",um,[i.renderSlot(o.$slots,"default")],512))}}),ut=class ut{static init(){ut.isInitialized||(ut.isInitialized=!0,ut.windowResizeHandler(),window.addEventListener("resize",ut.windowResizeHandler))}static destroy(){window.removeEventListener("resize",ut.windowResizeHandler),ut.isInitialized=!1}static getDeviceTypeByResolution(){const e=K.useBaseConfigStateStore().config.deviceTypeByResolution;return window.innerWidth<e.tablet?Qe.phone:window.innerWidth<e.laptop?Qe.tablet:Qe.laptop}static initRefDependingOnDeviceResolution(e,n,r){const s=i.ref(r);return ut.setRefValueDependingOnDeviceResolution(s,e,n,r),ut.refsDependingOnDeviceResolution.push({r:s,phoneValue:e,tabletValue:n,defaultValue:r}),s}static isPhoneDevice(){return ut.getDeviceTypeByResolution()===Qe.phone}static isTabletDevice(){return ut.getDeviceTypeByResolution()===Qe.tablet}static isLaptopDevice(){return ut.getDeviceTypeByResolution()===Qe.laptop}static setRefValueDependingOnDeviceResolution(e,n,r,s){switch(ut.getDeviceTypeByResolution()){case Qe.phone:e.value=n;break;case Qe.tablet:e.value=r;break;default:e.value=s;break}}static windowResizeHandler(){I.forEach(ut.refsDependingOnDeviceResolution,e=>{ut.setRefValueDependingOnDeviceResolution(e.r,e.phoneValue,e.tabletValue,e.defaultValue)})}};S(ut,"isInitialized",!1),S(ut,"refsDependingOnDeviceResolution",[]);let St=ut;const fm=["href"],mm=["src","alt"],gm={},il=i.defineComponent({...gm,__name:"image-gallery",props:{images:{}},setup(t,{expose:e}){const n=i.ref(!1),r=i.ref(!1),s=i.ref({plugins:[lm,dm],addClass:"sc-lg-container",licenseKey:"0000-0000-000-0000",strings:{closeGallery:"Закрыть",download:"Скачать",mediaLoadingFailed:"Ошибка загрузки контента...",nextSlide:"Следующее изображение",playVideo:"Воспроизвести видео",previousSlide:"Предыдущее изображение",toggleMaximize:"Расширить"}}),o=()=>window.innerWidth*(St.getDeviceTypeByResolution()===Qe.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,u)=>{const h=tl,f=z.NPopover;return i.openBlock(),i.createBlock(f,{trigger:"manual",show:n.value,class:"sc-image",placement:"top-start",onClickoutside:u[3]||(u[3]=()=>{r.value||(n.value=!1)})},{trigger:i.withCtx(()=>[i.createElementVNode("div",{class:"inline-flex",onClick:u[0]||(u[0]=g=>n.value=!n.value)},[i.renderSlot(d.$slots,"default",{},()=>[i.createVNode(h)])])]),default:i.withCtx(()=>[i.createVNode(nl,{settings:s.value,style:i.normalizeStyle(`max-width: ${a.value}px`),class:"flex flex-row overflow-x-scroll",onAfterOpen:u[1]||(u[1]=()=>{r.value=!0}),onAfterClose:u[2]||(u[2]=()=>{r.value=!1,n.value=!1})},{default:i.withCtx(()=>[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(t.images,(g,m)=>(i.openBlock(),i.createElementBlock("a",{key:m,href:g.image},[i.createElementVNode("img",{src:g.preview,alt:`Изображение #${m+1}`},null,8,mm)],8,fm))),128))]),_:1},8,["settings","style"])]),_:3},8,["show"])}}}),pm={class:"text-sm grid grid-cols-[auto_auto] gap-x-3 gap-y-1 items-baseline"},ym={class:"pr-3"},bm={class:"text-right"},_m={},wm=i.defineComponent({..._m,__name:"product-stock-count",props:{product:{}},setup(t){return(e,n)=>{const r=Hs,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",pm,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(t.product.stockCount,(o,a)=>(i.openBlock(),i.createElementBlock(i.Fragment,{key:a},[i.createElementVNode("span",ym,i.toDisplayString(o.warehouse.name),1),i.createElementVNode("span",bm,[i.createTextVNode(i.toDisplayString(o.count??"В наличии")+" ",1),o.count?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[i.createTextVNode(i.toDisplayString(t.product.unit.name),1)],64)):i.createCommentVNode("",!0)])],64))),128))])]),_:3})}}}),xm={class:"flex flex-row justify-between"},km={class:"inline-flex flex-row gap-0.5 mr-2 align-sub"},vm={key:0},Cm={class:"ml-2 align-sub"},Sm={class:"flex cursor-pointer flex-row gap-2 whitespace-nowrap"},Bm={class:"@container"},Tm={class:"text-sc-dark-grey @sm:grid-cols-2 @2xl:grid-cols-3 grid grid-cols-1 gap-1 text-sm"},$m={key:0,class:"sc-supplier-sku col-span-2 whitespace-nowrap text-wrap sm:col-span-3"},Nm={class:"text-sc-dark-grey"},Rm={key:1,class:"sc-product-code col-start-1 whitespace-nowrap"},Pm={class:"text-gray-600"},Em={class:"flex cursor-pointer flex-row gap-1 whitespace-nowrap"},Fm={key:3,class:"underline decoration-dashed"},Vm={key:4,class:"sc-product-pack whitespace-nowrap"},Im={class:"text-gray-600"},Am={key:5,class:"sc-product-planning-incoming-date col-span-2 col-start-1 mt-1.5 text-wrap"},Mm={class:"text-gray-600"},Om={key:0,class:"mt-3 flex flex-row gap-3 pb-2 text-base xl:text-lg"},zm={key:0},Dm={class:"sc-product-properties m-0 mt-3 list-inside list-disc p-0 pl-1.5 text-xs text-gray-500"},Lm={},lr=i.defineComponent({...Lm,__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(()=>I.isFunction(n.showProductCosts)?n.showProductCosts(n.product):n.showProductCosts),s=i.computed(()=>I.sortBy(n.product.priceCoefficients,["coefficient.slug"])),o=i.computed(()=>{var h,f;return(f=(h=n.product)==null?void 0:h.properties)==null?void 0:f.planingIncomingDate}),a=i.useTemplateRef("image-gallery"),l=()=>{var h;(h=a.value)==null||h.show()},c=i.computed(()=>I.isFunction(n.allowNameClick)?n.allowNameClick(n.product):n.allowNameClick),d=i.computed(()=>{var h;return n.showProductAddToCartButton||n.showProductEditButton||n.showProductRequiredButton||(((h=n.productContextButtonsConfig)==null?void 0:h.length)??0)>0}),u=()=>{var h;c.value&&((h=n.eventEmitter)==null||h.emit("product:name-click",{product:n.product,exposedMethods:{showProductImagesPreview:l}}))};return e({showProductImagesPreview:l}),(h,f)=>{var N,R,w,C;const g=om,m=z.NTooltip,p=Ja,y=tl,b=z.NText,_=el,B=Hs,x=z.NScrollbar;return i.openBlock(),i.createElementBlock("div",null,[i.createElementVNode("div",xm,[i.createVNode(b,{type:"info",class:"sc-product-name text-balance text-base font-medium"},{default:i.withCtx(()=>{var k,T;return[i.createElementVNode("div",km,[((k=t.product)==null?void 0:k.isFavorite)??!1?(i.openBlock(),i.createBlock(m,{key:0,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(g,{class:"!text-yellow-300"})]),default:i.withCtx(()=>[f[0]||(f[0]=i.createTextVNode(" Избранный товар ",-1))]),_:1})):i.createCommentVNode("",!0),((T=t.product)==null?void 0:T.isPreviouslyOrdered)??!1?(i.openBlock(),i.createBlock(m,{key:1,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(p,{class:"!text-green-700"})]),default:i.withCtx(()=>[f[1]||(f[1]=i.createTextVNode(" Ранее заказанный товар ",-1))]),_:1})):i.createCommentVNode("",!0)]),i.createElementVNode("span",{class:i.normalizeClass({"cursor-pointer":c.value&&t.eventEmitter}),onClick:u},i.toDisplayString(t.product.name),3),t.product.onOrder?(i.openBlock(),i.createElementBlock("span",vm," [Под заказ] ")):i.createCommentVNode("",!0),i.createElementVNode("span",Cm,[t.product.images&&t.product.images.length>0?(i.openBlock(),i.createBlock(il,{key:0,ref:"image-gallery",images:t.product.images},{default:i.withCtx(()=>[i.createElementVNode("div",Sm,[i.createVNode(y)])]),_:1},8,["images"])):i.createCommentVNode("",!0)])]}),_:1}),d.value?(i.openBlock(),i.createBlock(_,{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",Bm,[i.createElementVNode("div",Tm,[t.product.supplierSku?(i.openBlock(),i.createElementBlock("div",$m,[f[2]||(f[2]=i.createTextVNode(" Артикул производителя/поставщика: ",-1)),i.createElementVNode("span",Nm,i.toDisplayString(t.product.supplierSku),1)])):i.createCommentVNode("",!0),t.showCode?(i.openBlock(),i.createElementBlock("span",Rm,[f[3]||(f[3]=i.createTextVNode(" Артикул: ",-1)),i.createElementVNode("span",Pm,i.toDisplayString(t.product.code),1)])):i.createCommentVNode("",!0),t.product.stockCount&&t.product.stockCount.length>0?(i.openBlock(),i.createBlock(wm,{key:2,product:t.product},{default:i.withCtx(()=>[i.createElementVNode("span",Em,[f[4]||(f[4]=i.createElementVNode("span",{class:"underline decoration-dashed"},"В наличии",-1)),i.createVNode(B,{class:"mt-0.5"})])]),_:1},8,["product"])):(i.openBlock(),i.createElementBlock("span",Fm," Нет в наличии ")),t.product.pack??((R=(N=t.product)==null?void 0:N.properties)==null?void 0:R.pack)?(i.openBlock(),i.createElementBlock("span",Vm,[f[5]||(f[5]=i.createTextVNode(" Норма упаковки: ",-1)),i.createElementVNode("span",Im,i.toDisplayString(t.product.pack??((C=(w=t.product)==null?void 0:w.properties)==null?void 0:C.pack)),1)])):i.createCommentVNode("",!0),t.showPlanningDates&&o.value?(i.openBlock(),i.createElementBlock("span",Am,[f[6]||(f[6]=i.createTextVNode(" Планируемая дата поступления на основной склад: ",-1)),i.createElementVNode("span",Mm,i.toDisplayString(o.value),1)])):i.createCommentVNode("",!0)])]),i.createVNode(x,{"x-scrollable":""},{default:i.withCtx(()=>[r.value?(i.openBlock(),i.createElementBlock("div",Om,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(s.value,k=>(i.openBlock(),i.createBlock(jn,{key:k.coefficient.slug,product:t.product,"cost-field-name":k.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(jn,{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",zm,[i.createElementVNode("ul",Dm,[t.showSlugs?(i.openBlock(!0),i.createElementBlock(i.Fragment,{key:0},i.renderList({id:t.product.id,slug:t.product.slug},(k,T)=>(i.openBlock(),i.createElementBlock("li",{key:T}," ("+i.toDisplayString(T)+"): "+i.toDisplayString(k),1))),128)):i.createCommentVNode("",!0),t.showProperties?(i.openBlock(!0),i.createElementBlock(i.Fragment,{key:1},i.renderList(t.product.properties,(k,T)=>(i.openBlock(),i.createElementBlock("li",{key:T}," ("+i.toDisplayString(T)+"): "+i.toDisplayString(k),1))),128)):i.createCommentVNode("",!0)])])):i.createCommentVNode("",!0)])}}}),Hm=(t,e,n)=>({key:t,title:e,className:"align-top",resizable:!0,render:r=>i.h(jn,{product:r,costFieldName:t,eventEmitter:n.eventEmitter,allowPriceClick:n.allowPriceClick,currencyRates:n.currencyRates})}),Wm=(t,e)=>{if(t.length===0)return[];const n=[],r={};switch(I.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})}})}}),St.getDeviceTypeByResolution()){case Qe.phone:case Qe.tablet:n.push({key:"name",title:"Наименование",className:"align-top",render:s=>i.h(lr,{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(lr,{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&&(I.forEach(t,s=>{I.forEach(s.priceCoefficients,o=>{r[o.coefficient.slug??""]||(r[o.coefficient.slug??""]=o.coefficient)})}),I.forEach(I.sortBy(r,["slug"]),s=>{n.push(Hm(s.slug??"",s.name,e))}),n.push({key:"cost",title:"Цена",className:"align-top",resizable:!0,render:s=>i.h(jn,{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||!I.isNil(e.productContextButtonsConfig))&&n.push({key:"actions",title:"",className:"align-top",width:"50",render:s=>i.h(el,{product:s,eventEmitter:e.eventEmitter,showProductAddToCartButton:e.showProductAddToCartButton,showProductEditButton:e.showProductEditButton,showProductRequiredButton:e.showProductRequiredButton,productContextButtonsConfig:e.productContextButtonsConfig})});break}return n},jm={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function qm(t,e){return i.openBlock(),i.createElementBlock("svg",jm,[...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 zr=i.markRaw({name:"ion-trash",render:qm}),Xm={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Ym(t,e){return i.openBlock(),i.createElementBlock("svg",Xm,[...e[0]||(e[0]=[i.createElementVNode("path",{d:"M448 224H288V64h-64v160H64v64h160v160h64V288h160z",fill:"currentColor"},null,-1)])])}const rl=i.markRaw({name:"ion-plus",render:Ym}),Um={key:0,class:"flex w-fit items-center gap-2"},Km={key:1,class:"flex flex-wrap gap-1"},Gm={key:0},Zm={key:2},Qm={},cr=i.defineComponent({...Qm,__name:"configurators-product-info",props:{isProductSearching:{type:Boolean,default:!1},product:{default:void 0},validation:{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,a=z.NText;return t.isProductSearching?(i.openBlock(),i.createElementBlock("div",Um,[i.createVNode(o,{size:17,class:"w-fit"}),s[0]||(s[0]=i.createElementVNode("div",null,"Выполняется поиск товара ...",-1))])):t.product&&!t.product.isNewRec()?(i.openBlock(),i.createElementBlock("div",Km,[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.name),1),n.value?(i.openBlock(),i.createElementBlock("div",Gm,"(Планируемая дата производства: "+i.toDisplayString(n.value)+")",1)):i.createCommentVNode("",!0)])):t.validation?(i.openBlock(),i.createElementBlock("div",Zm,[i.createVNode(a,{type:t.validation.validationStatus},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(t.validation.feedback),1)]),_:1},8,["type"])])):i.createCommentVNode("",!0)}}}),ae={required:{type:"number",required:!0,trigger:["blur","input"],message:"Это поле обязательно для заполнения"},min(t){return{type:"number",min:t,trigger:["blur","input"],message:`Минимальное значение: ${t}`}},max(t){return{type:"number",max:t,trigger:["blur","input"],message:`Максимальное значение: ${t}`}},step(t){return{type:"number",trigger:["blur","input"],validator:(e,n)=>n===null||Math.abs(n/t-Math.round(n/t))<1e-10?!0:new Error(`Значение должно быть кратно ${t}`)}}},We={serverValidation(t){return{validator:(e,n)=>n===null?!0:t?new Error(t):!0}}},Jm={class:"flex flex-col gap-4"},eg={class:"flex flex-col gap-2"},tg={class:"mt-8 font-bold"},ng={class:"grid grow grid-cols-2 items-start gap-2"},ig={key:2,class:"text-red-500 text-sm"},rg={key:3,class:"text-red-500 text-sm mb-2"},sg={class:"flex flex-col gap-4"},og={key:1},ag={class:"text-lg font-semibold"},lg={class:"flex gap-3"},cg={},dg=i.defineComponent({...cg,__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,{expose:e,emit:n}){var y;const r=t,s=n,o=i.useTemplateRef("form-reference"),a=i.ref(!1),l=i.ref(I.cloneDeep(r.value)),c=i.computed(()=>{var _,B,x;const b={"configuratorParams.length":[ae.required,ae.min(r.settings.stripMinLength),ae.max(r.settings.stripMaxLength||Number.MAX_VALUE),ae.step(r.settings.lengthStep),We.serverValidation((_=r.validation.length)==null?void 0:_.feedback)],quantity:[ae.required,ae.min(1),ae.step(1),We.serverValidation((B=r.validation.quantity)==null?void 0:B.feedback)],marker:[We.serverValidation((x=r.validation.marker)==null?void 0:x.feedback)]};return I.forEach(l.value.configuratorParams.linesWidths,(N,R)=>{var k;const C=l.value.configuratorParams.linesWidths.length>1?r.settings.minLineWidth:r.settings.stripMinWidth;b[`configuratorParams.linesWidths.${R}`]=[ae.required,ae.min(C),ae.max(r.settings.maxLineWidth),ae.step(r.settings.lineWidthStep),We.serverValidation((k=r.validation[`lines_widths[${R+1}]`])==null?void 0:k.feedback)]}),I.forEach(l.value.configuratorParams.linesAngles,(N,R)=>{var w;b[`configuratorParams.linesAngles.${R}`]=[ae.required,ae.min(r.settings.minLineAngle),ae.max(r.settings.maxLineAngle),ae.step(r.settings.lineAngleStep),We.serverValidation((w=r.validation[`lines_angles[${R+1}]`])==null?void 0:w.feedback)]}),b}),d=i.ref(r.settings.canSetDopProdaga??!1),u=i.computed(()=>{var N;const{length:b}=l.value.configuratorParams,{quantity:_}=l.value,B=((N=l.value.product)==null?void 0:N.costRub)||0;if(!b||!_||B===0)return null;const x=b/1e3;return(B*_*x).toLocaleString("ru-ru",{maximumFractionDigits:2,minimumFractionDigits:2})}),h=i.computed(()=>I.reduce(l.value.configuratorParams.linesWidths,(b,_)=>b+(_||0),0)),f=i.computed(()=>{const b=h.value;return b>=r.settings.stripMinWidth&&b<=r.settings.stripMaxWidth}),g=i.computed(()=>{const{configuratorParams:b}=l.value,_=I.every(b.linesWidths,R=>!!(R&&R>0)),B=I.every(b.linesAngles,R=>!I.isNil(R)),x=!!(l.value.quantity&&l.value.quantity>0),N=b.length>0&&b.length>0;return _&&B&&x&&N&&f.value}),m=()=>{i.nextTick(()=>{var b;(b=o.value)==null||b.validate(_=>{_||(s("update:params",l.value.configuratorParams),p("configuratorParams",l.value.configuratorParams))}).catch(I.noop)})},p=(b,_)=>{const B=new K.OrderItemBase(l.value);B[b]=_,b==="configuratorParams"&&(B.product=new K.ClientProduct),s("update:value",B)};return i.watch(()=>r.previewParams,b=>{l.value.configuratorParams.linesWidths=b.linesWidths,l.value.configuratorParams.linesAngles=b.linesAngles},{deep:!0}),i.watch(()=>r.value,b=>{l.value=I.cloneDeep(b)},{deep:!0}),e({validate:(y=o.value)==null?void 0:y.validate,formReference:o}),(b,_)=>{const B=rl,x=zr,N=z.NCheckbox;return i.openBlock(),i.createBlock(i.unref(z.NForm),{ref:"form-reference",model:l.value,rules:c.value,class:"flex flex-col gap-4 sc-hide-empty-feedback-message",onKeydown:_[20]||(_[20]=i.withKeys(i.withModifiers(R=>s("submit",l.value),["prevent"]),["enter"]))},{default:i.withCtx(()=>{var R;return[i.createElementVNode("div",Jm,[_[22]||(_[22]=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:l.value.configuratorParams.startTailType,"onUpdate:value":[_[0]||(_[0]=w=>l.value.configuratorParams.startTailType=w),m],options:t.settings.startTailConfigs.map(({label:w},C)=>({label:w,value:C})),placeholder:"Тип стартового капельника"},null,8,["value","options"])]),_:1})):i.createCommentVNode("",!0),i.createElementVNode("div",eg,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(l.value.configuratorParams.linesAngles,(w,C)=>(i.openBlock(),i.createElementBlock("div",{key:C,class:"flex items-start gap-2"},[i.createElementVNode("div",tg,i.toDisplayString(C+1),1),i.createElementVNode("div",ng,[i.createVNode(i.unref(z.NFormItem),{path:`configuratorParams.linesWidths.${C}`,label:"Ширина, мм"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInputNumber),{value:l.value.configuratorParams.linesWidths[C],"onUpdate:value":[k=>l.value.configuratorParams.linesWidths[C]=k,_[2]||(_[2]=k=>m())],parse:i.unref(lt),"show-button":!1,class:"w-full",onKeydown:_[1]||(_[1]=k=>i.unref(tt)(k)),onInput:k=>i.unref(et)(t.validation,`lines_widths[${C+1}]`),onFocus:i.unref(Le)},null,8,["value","onUpdate:value","parse","onInput","onFocus"])]),_:2},1032,["path"]),i.createVNode(i.unref(z.NFormItem),{path:`configuratorParams.linesAngles.${C}`,label:"Угол сгиба, °"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInputNumber),{value:l.value.configuratorParams.linesAngles[C],"onUpdate:value":[k=>l.value.configuratorParams.linesAngles[C]=k,_[4]||(_[4]=k=>m())],parse:i.unref(lt),"show-button":!1,class:"w-full",onKeydown:_[3]||(_[3]=k=>i.unref(tt)(k,!0)),onInput:k=>i.unref(et)(t.validation,`lines_angles[${C+1}]`),onFocus:i.unref(Le)},null,8,["value","onUpdate:value","parse","onInput","onFocus"])]),_:2},1032,["path"])]),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:k=>s("click:add-line",C)},{default:i.withCtx(()=>[i.createVNode(B)]),_:1},8,["onClick"])),t.settings.showOnlyTemplates?i.createCommentVNode("",!0):(i.openBlock(),i.createBlock(i.unref(z.NButton),{key:1,disabled:l.value.configuratorParams.linesWidths.length===1,size:"medium",class:"ml-2",onClick:k=>s("click:remove-line",C)},{default:i.withCtx(()=>[i.createVNode(x)]),_: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:l.value.configuratorParams.endTailType,"onUpdate:value":[_[5]||(_[5]=w=>l.value.configuratorParams.endTailType=w),m],options:t.settings.endTailConfigs.map(({label:w},C)=>({label:w,value:C})),placeholder:"Тип конечного капельника"},null,8,["value","options"])]),_:1})):i.createCommentVNode("",!0),i.createVNode(cr,{"is-product-searching":t.isProductSearching,product:l.value.product,validation:t.validation.product},null,8,["is-product-searching","product","validation"]),f.value?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("div",ig," Суммарная ширина участков гиба должна быть от "+i.toDisplayString(t.settings.stripMinWidth)+" до "+i.toDisplayString(t.settings.stripMaxWidth)+" мм., текущая ширина: "+i.toDisplayString(h.value)+" мм. ",1)),g.value?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("div",rg," Пожалуйста, заполните все обязательные поля корректно. ")),t.settings.allowSaveTemplates&&t.selectTemplateIndex===((R=t.settings.allTemplates)==null?void 0:R.length)-1?(i.openBlock(),i.createBlock(i.unref(z.NButton),{key:4,type:"tertiary",class:"self-start",loading:a.value,onClick:_[6]||(_[6]=w=>s("click:save-template"))},{default:i.withCtx(()=>[..._[21]||(_[21]=[i.createTextVNode(" Сохранить шаблон ",-1)])]),_:1},8,["loading"])):i.createCommentVNode("",!0)]),i.createElementVNode("div",sg,[i.createVNode(i.unref(z.NFormItem),{label:"С какой стороны изделие будет иметь цвет","show-feedback":!1},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NSelect),{value:l.value.configuratorParams.colorSide,"onUpdate:value":[_[7]||(_[7]=w=>l.value.configuratorParams.colorSide=w),m],options:[{label:"Цвет сверху",value:"top"},{label:" Цвет снизу",value:"bottom"}],placeholder:"С какой стороны изделие будет иметь цвет"},null,8,["value"])]),_:1}),i.createVNode(i.unref(z.NFormItem),{path:"configuratorParams.length",label:`Метраж${t.settings.stripMinLength?" от "+t.settings.stripMinLength:""}${t.settings.stripMaxLength?" до "+t.settings.stripMaxLength:""} мм`},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInputNumber),{value:l.value.configuratorParams.length,"onUpdate:value":[_[8]||(_[8]=w=>l.value.configuratorParams.length=w),_[11]||(_[11]=w=>m())],parse:i.unref(lt),"show-button":!1,placeholder:"Введите метраж",class:"w-full",onKeydown:_[9]||(_[9]=w=>i.unref(tt)(w)),onInput:_[10]||(_[10]=w=>i.unref(et)(t.validation,"length")),onFocus:i.unref(Le)},null,8,["value","parse","onFocus"])]),_:1},8,["label"]),i.createVNode(i.unref(z.NFormItem),{path:"quantity",label:"Количество"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInputNumber),{value:l.value.quantity,"onUpdate:value":[_[12]||(_[12]=w=>l.value.quantity=w),_[15]||(_[15]=w=>p("quantity",w??0))],"show-button":!1,placeholder:"Введите количество",class:"w-full",onKeydown:_[13]||(_[13]=w=>i.unref(tt)(w,!1)),onInput:_[14]||(_[14]=w=>i.unref(et)(t.validation,"quantity")),onFocus:i.unref(Le)},null,8,["value","onFocus"])]),_:1}),i.createVNode(i.unref(z.NFormItem),{path:"marker",label:"Маркировка"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInput),{value:l.value.marker??null,placeholder:"Введите маркировку",onInput:_[16]||(_[16]=w=>i.unref(et)(t.validation,"marker")),"onUpdate:value":_[17]||(_[17]=w=>{l.value.marker=w??null,p("marker",w??null)}),onFocus:i.unref(Le)},null,8,["value","onFocus"])]),_:1}),d.value?(i.openBlock(),i.createBlock(N,{key:0,checked:l.value.isAdditionalSale??!1,"true-value":!0,"false-value":!1,"onUpdate:checked":_[18]||(_[18]=w=>{l.value.isAdditionalSale=w??!1,p("isAdditionalSale",w??!1)})},{default:i.withCtx(()=>[..._[23]||(_[23]=[i.createTextVNode(" ДопПродажа ",-1)])]),_:1},8,["checked"])):i.createCommentVNode("",!0),u.value?(i.openBlock(),i.createElementBlock("div",og,[_[24]||(_[24]=i.createTextVNode(" ИТОГО: ",-1)),i.createElementVNode("span",ag,i.toDisplayString(u.value)+" ₽",1)])):i.createCommentVNode("",!0),i.createElementVNode("div",lg,[i.createVNode(i.unref(z.NButton),{loading:t.isSubmitProcessing,disabled:!g.value||l.value.product.isNewRec(),type:"primary",class:"self-start",onClick:_[19]||(_[19]=w=>s("submit",l.value))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(l.value.isNewRec()?"В корзину":"Изменить"),1)]),_:1},8,["loading","disabled"])])])]}),_:1},8,["model","rules"])}}}),sl=Wn(dg,[["__scopeId","data-v-47ba4507"]]);var ol=Object.defineProperty,ug=Object.defineProperties,hg=Object.getOwnPropertyDescriptors,al=Object.getOwnPropertySymbols,fg=Object.prototype.hasOwnProperty,mg=Object.prototype.propertyIsEnumerable,ll=t=>{throw TypeError(t)},js=(t,e,n)=>e in t?ol(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,qs=(t,e)=>{for(var n in e||(e={}))fg.call(e,n)&&js(t,n,e[n]);if(al)for(var n of al(e))mg.call(e,n)&&js(t,n,e[n]);return t},Xs=(t,e)=>ug(t,hg(e)),cl=(t,e)=>{for(var n in e)ol(t,n,{get:e[n],enumerable:!0})},v=(t,e,n)=>js(t,typeof e!="symbol"?e+"":e,n),dl=(t,e,n)=>e.has(t)||ll("Cannot "+n),It=(t,e,n)=>(dl(t,e,"read from private field"),n?n.call(t):e.get(t)),ul=(t,e,n)=>e.has(t)?ll("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),gg=(t,e,n,r)=>(dl(t,e,"write to private field"),e.set(t,n),n),Bt={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 Bt.shim(t),typeof e<"u"&&(Bt.Image=e),Bt.isHeadless=!0,t}},hl={};cl(hl,{Curve:()=>Oi,getAnchorsFromArcData:()=>bg,getComponentOnCubicBezier:()=>dr,getControlPoints:()=>vl,getCurveBoundingBox:()=>wl,getCurveFromPoints:()=>kl,getCurveLength:()=>_l,getReflection:()=>Gs,integrate:()=>xl,subdivide:()=>Ks});var fl={};cl(fl,{HALF_PI:()=>it,NumArray:()=>un,TWO_PI:()=>gt,decomposeMatrix:()=>li,getComputedMatrix:()=>Ys,getEffectiveStrokeWidth:()=>hn,getPoT:()=>pl,lerp:()=>zt,mod:()=>Dt,setMatrix:()=>gl,toFixed:()=>Me});var Xe;typeof window<"u"?Xe=window:typeof global<"u"?Xe=global:typeof self<"u"&&(Xe=self);var ml,gt=Math.PI*2,it=Math.PI*.5;function li(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 gl(t){ml=t}function Ys(t,e){e=e&&e.identity()||new ml;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 zt(t,e,n){return n*(e-t)+t}var Us=[2,4,8,16,32,64,128,256,512,1024,2048,4096];function pl(t){let e=0;for(;Us[e]&&Us[e]<t;)e++;return Us[e]}function Dt(t,e){for(;t<0;)t+=e;return t%e}var un=Xe.Float32Array||Array,pg=Math.floor;function Me(t){return pg(t*1e6)/1e6}function hn(t,e){const n=t._linewidth;if(t.strokeAttenuation)return n;e||(e=t.worldMatrix||Ys(t));const r=li(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 se={move:"M",line:"L",curve:"C",arc:"A",close:"Z"},Q=class{constructor(){v(this,"_events",{}),v(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 u=a[c];u=u.handler?u.handler:u,n!==u&&l.push(u)}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}};v(Q,"Types",{play:"play",pause:"pause",update:"update",render:"render",resize:"resize",change:"change",remove:"remove",insert:"insert",order:"order",load:"load"}),v(Q,"Methods",["addEventListener","on","removeEventListener","off","unbind","dispatchEvent","trigger","listen","ignore"]);var yl={x:{enumerable:!0,get:function(){return this._x},set:function(t){this._x!==t&&(this._x=t,this._bound&&this.dispatchEvent(Q.Types.change))}},y:{enumerable:!0,get:function(){return this._y},set:function(t){this._y!==t&&(this._y=t,this._bound&&this.dispatchEvent(Q.Types.change))}}},en=class ir extends Q{constructor(e=0,n=0){super(),v(this,"_x",0),v(this,"_y",0);for(let r in yl)Object.defineProperty(this,r,yl[r]);this.x=e,this.y=n}static add(e,n){return new ir(e.x+n.x,e.y+n.y)}static sub(e,n){return new ir(e.x-n.x,e.y-n.y)}static subtract(e,n){return ir.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(ir.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 ir(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:Me(this.x),y:Me(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}};v(en,"zero",new en),v(en,"left",new en(-1,0)),v(en,"right",new en(1,0)),v(en,"up",new en(0,-1)),v(en,"down",new en(0,1));var re=en,Be=class Os extends re{constructor(e=0,n=0,r=0,s=0,o=0,a=0,l=se.move){super(e,n),v(this,"controls",{left:new re,right:new re}),v(this,"_command",se.move),v(this,"_relative",!0),v(this,"_rx",0),v(this,"_ry",0),v(this,"_xAxisRotation",0),v(this,"_largeArcFlag",0),v(this,"_sweepFlag",1);for(let d in bl)Object.defineProperty(this,d,bl[d]);this.command=l,this.relative=!0;const c=Os.makeBroadcast(this);this.controls.left.set(r,s).addEventListener(Q.Types.change,c),this.controls.right.set(o,a).addEventListener(Q.Types.change,c)}static makeBroadcast(e){return n;function n(){e._bound&&e.dispatchEvent(Q.Types.change)}}static fromObject(e){return new Os().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 Os().copy(this)}toObject(){return{x:Me(this.x),y:Me(this.y),command:this.command,relative:this.relative,controls:{left:this.controls.left.toObject(),right:this.controls.right.toObject()},rx:Me(this.rx),ry:Me(this.ry),xAxisRotation:Me(this.xAxisRotation),largeArcFlag:Me(this.largeArcFlag),sweepFlag:Me(this.sweepFlag)}}toString(){return JSON.stringify(this.toObject())}},bl={command:{enumerable:!0,get:function(){return this._command},set:function(t){this._command!==t&&(this._command=t,this._bound&&this.dispatchEvent(Q.Types.change))}},relative:{enumerable:!0,get:function(){return this._relative},set:function(t){this._relative!==!!t&&(this._relative=!!t,this._bound&&this.dispatchEvent(Q.Types.change))}},rx:{enumerable:!0,get:function(){return this._rx},set:function(t){this._rx!==t&&(this._rx=t,this._bound&&this.dispatchEvent(Q.Types.change))}},ry:{enumerable:!0,get:function(){return this._ry},set:function(t){this._ry!==t&&(this._ry=t,this._bound&&this.dispatchEvent(Q.Types.change))}},xAxisRotation:{enumerable:!0,get:function(){return this._xAxisRotation},set:function(t){this._xAxisRotation!==t&&(this._xAxisRotation=t,this._bound&&this.dispatchEvent(Q.Types.change))}},largeArcFlag:{enumerable:!0,get:function(){return this._largeArcFlag},set:function(t){this._largeArcFlag!==t&&(this._largeArcFlag=t,this._bound&&this.dispatchEvent(Q.Types.change))}},sweepFlag:{get:function(){return this._sweepFlag},set:function(t){this._sweepFlag!==t&&(this._sweepFlag=t,this._bound&&this.dispatchEvent(Q.Types.change))}}},yg=0,Tt={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 yg++}},Oi={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 dr(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 Ks(t,e,n,r,s,o,a,l,c){c=c||Oi.RecursionLimit;const d=c+1;if(Math.abs(t-a)<.001&&Math.abs(e-l)<.001)return[new Be(a,l)];const u=[];for(let h=0;h<d;h++){const f=h/d,g=dr(f,t,n,s,a),m=dr(f,e,r,o,l);u.push(new Be(g,m))}return u}function _l(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),u=6*(t+s)-12*n,h=3*(n-t),f=9*(r-o)+3*(l-e),g=6*(e+o)-12*r,m=3*(r-e);function p(y){const b=(d*y+u)*y+h,_=(f*y+g)*y+m;return Math.sqrt(b*b+_*_)}return xl(p,0,1,c||Oi.RecursionLimit)}function wl(t,e,n,r,s,o,a,l){const c=[],d=[[],[]];let u,h,f,g,m,p,y,b;for(let N=0;N<2;++N){if(N===0?(h=6*t-12*n+6*s,u=-3*t+9*n-9*s+3*a,f=3*n-3*t):(h=6*e-12*r+6*o,u=-3*e+9*r-9*o+3*l,f=3*r-3*e),Math.abs(u)<.001){if(Math.abs(h)<.001)continue;g=-f/h,0<g&&g<1&&c.push(g);continue}y=h*h-4*f*u,b=Math.sqrt(y),!(y<0)&&(m=(-h+b)/(2*u),0<m&&m<1&&c.push(m),p=(-h-b)/(2*u),0<p&&p<1&&c.push(p))}let _=c.length,B=_,x;for(;_--;)g=c[_],x=1-g,d[0][_]=x*x*x*t+3*x*x*g*n+3*x*g*g*s+g*g*g*a,d[1][_]=x*x*x*e+3*x*x*g*r+3*x*g*g*o+g*g*g*l;return d[0][B]=t,d[1][B]=e,d[0][B+1]=a,d[1][B+1]=l,d[0].length=d[1].length=B+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 xl(t,e,n,r){let s=Oi.abscissas[r-2],o=Oi.weights[r-2],a=.5*(n-e),l=a+e,c=0,d=r+1>>1,u=r&1?o[c++]*t(l):0;for(;c<d;){const h=a*s[c];u+=o[c++]*(t(l+h)+t(l-h))}return a*u}function kl(t,e){const n=t.length,r=n-1;for(let s=0;s<n;s++){const o=t[s],a=e?Dt(s-1,n):Math.max(s-1,0),l=e?Dt(s+1,n):Math.min(s+1,r),c=t[a],d=o,u=t[l];vl(c,d,u),d.command=s===0?se.move:se.curve}}function vl(t,e,n){const r=re.angleBetween(t,e),s=re.angleBetween(n,e);let o=re.distanceBetween(t,e),a=re.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)}function Gs(t,e,n){return new re(2*t.x-(e.x+t.x)-(n?t.x:0),2*t.y-(e.y+t.y)-(n?t.y:0))}function bg(t,e,n,r,s,o,a){const l=Tt.Resolution;for(let c=0;c<l;c++){let d=(c+1)/l;a&&(d=1-d);const u=d*o+s,h=n*Math.cos(u),f=r*Math.sin(u),g=new Be(h,f);g.command=se.line}}var Cl=Array.prototype.slice;function _g(t){if(t==null)return!1;const e=t.length;return typeof e=="number"&&e>=0&&e<4294967296}var ie={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=Cl.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=Cl.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=!_g(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:Xe.performance&&Xe.performance.now?Xe.performance:Date},Lt={hasEventListeners:typeof Xe.addEventListener=="function",bind:function(t,e,n,r){return this.hasEventListeners?t.addEventListener(e,n,!!r):t.attachEvent("on"+e,n),Lt},unbind:function(t,e,n,r){return Lt.hasEventListeners?t.removeEventListeners(e,n,!!r):t.detachEvent("on"+e,n),Lt},getRequestAnimationFrame:function(){const t=["ms","moz","webkit","o"];let e=0,n=Xe.requestAnimationFrame;if(!n){for(let s=0;s<t.length;s++)n=Xe[t[s]+"RequestAnimationFrame"]||n;n=n||r}function r(s,o){const a=new Date().getTime(),l=Math.max(0,16-(a-e)),c=Xe.setTimeout(d,l);e=a+l;function d(){s(a+l)}return c}return n}},zi=Xe.document?Xe.document.createElement("div"):{};zi.id="help-two-load",Object.defineProperty(Lt,"temp",{enumerable:!0,get:function(){return ie.isElement(zi)&&!Xe.document.head.contains(zi)&&(zi.style.display="none",Xe.document.head.appendChild(zi)),zi}});var At=class extends Error{constructor(e){super(),v(this,"name","Two.js"),v(this,"message"),this.message=e}},wg=Xe.devicePixelRatio||1;function xg(t){return t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1}function Zs(t){return wg/xg(t)}var Dr=class{constructor(){v(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}},pt,qn=class extends Array{constructor(){super(),ul(this,pt,new Q),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 It(this,pt)}set _events(e){gg(this,pt,e)}get _bound(){return It(this,pt)._bound}set _bound(e){It(this,pt)._bound=e}addEventListener(){return It(this,pt).addEventListener.apply(this,arguments)}on(){return It(this,pt).on.apply(this,arguments)}bind(){return It(this,pt).bind.apply(this,arguments)}removeEventListener(){return It(this,pt).removeEventListener.apply(this,arguments)}off(){return It(this,pt).off.apply(this,arguments)}unbind(){return It(this,pt).unbind.apply(this,arguments)}dispatchEvent(){return It(this,pt).dispatchEvent.apply(this,arguments)}trigger(){return It(this,pt).trigger.apply(this,arguments)}listen(){return It(this,pt).listen.apply(this,arguments)}ignore(){return It(this,pt).ignore.apply(this,arguments)}pop(){const e=super.pop.apply(this,arguments);return this.trigger(Q.Types.remove,[e]),e}shift(){const e=super.shift.apply(this,arguments);return this.trigger(Q.Types.remove,[e]),e}push(){const e=super.push.apply(this,arguments);return this.trigger(Q.Types.insert,arguments),e}unshift(){const e=super.unshift.apply(this,arguments);return this.trigger(Q.Types.insert,arguments),e}splice(){const e=super.splice.apply(this,arguments);if(this.trigger(Q.Types.remove,e),arguments.length>2){const n=this.slice(arguments[0],arguments[0]+arguments.length-2);this.trigger(Q.Types.insert,n),this.trigger(Q.Types.order)}return e}sort(){return super.sort.apply(this,arguments),this.trigger(Q.Types.order),this}reverse(){return super.reverse.apply(this,arguments),this.trigger(Q.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}};pt=new WeakMap;var Sl=class Zh extends Q{constructor(){super(),v(this,"_flagId",!1),v(this,"_flagClassName",!1),v(this,"_renderer",{}),v(this,"_id",Tt.Identifier+Tt.uniqueId()),v(this,"_className",""),v(this,"classList",[]);for(let e in Bl)Object.defineProperty(this,e,Bl[e])}static fromObject(e){const n=new Zh().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}};v(Sl,"Properties",["renderer","id","className"]);var Di=Sl,Bl={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)}}},Lr,Tl={video:/\.(mp4|webm|ogg)$/i,image:/\.(jpe?g|png|gif|tiff|webp)$/i,effect:/texture|gradient/i};Xe.document&&(Lr=document.createElement("a"));var tn=class qt extends Di{constructor(e,n){super(),v(this,"_flagSrc",!1),v(this,"_flagImage",!1),v(this,"_flagVideo",!1),v(this,"_flagLoaded",!1),v(this,"_flagRepeat",!1),v(this,"_flagOffset",!1),v(this,"_flagScale",!1),v(this,"_src",""),v(this,"_image",null),v(this,"_loaded",!1),v(this,"_repeat","no-repeat"),v(this,"_scale",1),v(this,"_offset",null);for(let r in $l)Object.defineProperty(this,r,$l[r]);if(this._renderer.type="texture",this._renderer.flagOffset=kg.bind(this),this._renderer.flagScale=vg.bind(this),this.loaded=!1,this.repeat="no-repeat",this.offset=new re,typeof n=="function"){const r=(function(){this.unbind(Q.Types.load,r),typeof n=="function"&&n()}).bind(this);this.bind(Q.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 qt().copy(e);return"id"in e&&(n.id=e.id),n}static getAbsoluteURL(e){return Lr?(Lr.href=e,Lr.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=qt.getAbsoluteURL(e);if(qt.ImageRegistry.contains(n))return qt.ImageRegistry.get(n);let r;return Bt.Image?(r=new Bt.Image,Bt.shim(r,"img")):Xe.document?Tl.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=qt.getTag(r);e._flagImage&&(/canvas/i.test(s)?qt.Register.canvas(e,n):(e._src=!Bt.isHeadless&&r.getAttribute("two-src")||r.src,qt.Register[s](e,n))),e._flagSrc&&(r||(r=qt.getImage(e.src),e.image=r),s=qt.getTag(r),qt.Register[s](e,n))}clone(){const e=new qt(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 re?e.offset:new re().copy(e.offset),this.scale=typeof e.scale=="number"||e.scale instanceof re?e.scale:new re().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(Q.Types.change),(this._flagSrc||this._flagImage)&&(this.loaded=!1,qt.load(this,(function(){this.loaded=!0,this.trigger(Q.Types.change).trigger(Q.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}};v(tn,"Properties",["src","loaded","repeat","scale","offset","image"]),v(tn,"RegularExpressions",Tl),v(tn,"ImageRegistry",new Dr),v(tn,"Register",{canvas:function(t,e){t._src="#"+t.id,tn.ImageRegistry.add(t.src,t.image),typeof e=="function"&&e()},img:function(t,e){const n=t.image,r=function(o){!Bt.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!Bt.isHeadless&&typeof n.removeEventListener=="function"&&(n.removeEventListener("load",r,!1),n.removeEventListener("error",s,!1)),new At("unable to load "+t.src)};typeof n.width=="number"&&n.width>0&&typeof n.height=="number"&&n.height>0?r():!Bt.isHeadless&&typeof n.addEventListener=="function"&&(n.addEventListener("load",r,!1),n.addEventListener("error",s,!1)),t._src=tn.getAbsoluteURL(t._src),!(!Bt.isHeadless&&n&&n.getAttribute("two-src"))&&(Bt.isHeadless||n.setAttribute("two-src",t.src),tn.ImageRegistry.add(t.src,n),Bt.isHeadless?tn.loadHeadlessBuffer(t,r):t.image.src=t.src)},video:function(t,e){if(Bt.isHeadless)throw new At("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 At("unable to load "+t.src)};t._src=tn.getAbsoluteURL(t._src),t.image.getAttribute("two-src")||(t.image.setAttribute("two-src",t.src),tn.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 Oe=tn,$l={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=Oe.getTag(t);let n;switch(e){case"canvas":n="#"+t.id;break;default:n=t.src}Oe.ImageRegistry.contains(n)?this._image=Oe.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(Q.Types.change,this._renderer.flagOffset),this._offset=t,this._offset.bind(Q.Types.change,this._renderer.flagOffset),this._flagOffset=!0}},scale:{enumerable:!0,get:function(){return this._scale},set:function(t){this._scale instanceof re&&this._scale.unbind(Q.Types.change,this._renderer.flagScale),this._scale=t,this._scale instanceof re&&this._scale.bind(Q.Types.change,this._renderer.flagScale),this._flagScale=!0}}};function kg(){this._flagOffset=!0}function vg(){this._flagScale=!0}var Qs=class dn extends Di{constructor(e,n,r){super(),v(this,"_flagOffset",!0),v(this,"_flagOpacity",!0),v(this,"_flagColor",!0),v(this,"_offset",0),v(this,"_opacity",1),v(this,"_color","#fff");for(let s in Nl)Object.defineProperty(this,s,Nl[s]);this._renderer.type="stop",this.offset=typeof e=="number"?e:dn.Index<=0?0:1,this.opacity=typeof r=="number"?r:1,this.color=typeof n=="string"?n:dn.Index<=0?"#fff":"#000",dn.Index=(dn.Index+1)%2}static fromObject(e){const n=new dn().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<dn.Properties.length;n++){const r=dn.Properties[n];r in e&&(this[r]=e[r])}return this}clone(e){const n=new dn;return ie.each(dn.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",ie.each(dn.Properties,n=>{e[n]=this[n]},this),e}flagReset(){return this._flagOffset=this._flagColor=this._flagOpacity=!1,super.flagReset.call(this),this}};v(Qs,"Index",0),v(Qs,"Properties",["offset","opacity","color"]);var Xn=Qs,Nl={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 Ri extends Di{constructor(e){super(),v(this,"_flagStops",!1),v(this,"_flagSpread",!1),v(this,"_flagUnits",!1),v(this,"_spread",""),v(this,"_units","");for(let n in Rl)Object.defineProperty(this,n,Rl[n]);this._renderer.type="gradient",this._renderer.flagStops=Cg.bind(this),this._renderer.bindStops=Sg.bind(this),this._renderer.unbindStops=Bg.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 Xn?s:new Xn().copy(s)));const r=new Ri(n).copy(e);return"id"in e&&(r.id=e.id),r}clone(e){const n=this.stops.map(s=>s.clone()),r=new Ri(n);return ie.each(Ri.Properties,s=>{r[s]=this[s]},this),e&&e.add(r),r}copy(e){super.copy.call(this,e);for(let n=0;n<Ri.Properties.length;n++){const r=Ri.Properties[n];r in e&&(this[r]=e[r])}return this}toObject(){const e={stops:this.stops.map(n=>n.toObject())};return ie.each(Ri.Properties,n=>{e[n]=this[n]},this),e}_update(){return(this._flagSpread||this._flagStops)&&this.trigger(Q.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}};v(Js,"Stop",Xn),v(Js,"Properties",["spread","stops","units"]);var rt=Js,Rl={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(Q.Types.insert,e).unbind(Q.Types.remove,n),this._stops=new qn((t||[]).slice(0)),this._stops.bind(Q.Types.insert,e).bind(Q.Types.remove,n),e(this._stops)}}};function Cg(){this._flagStops=!0}function Sg(t){let e=t.length;for(;e--;)t[e].bind(Q.Types.change,this._renderer.flagStops),t[e].parent=this;this._renderer.flagStops()}function Bg(t){let e=t.length;for(;e--;)t[e].unbind(Q.Types.change,this._renderer.flagStops),delete t[e].parent;this._renderer.flagStops()}var eo=class Fr extends rt{constructor(e,n,r,s,o){super(o),v(this,"_flagEndPoints",!1),v(this,"_left",null),v(this,"_right",null);for(let a in Pl)Object.defineProperty(this,a,Pl[a]);this._renderer.type="linear-gradient",this._renderer.flagEndPoints=Tg.bind(this),this.left=new re,this.right=new re,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 Fr().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<Fr.Properties.length;n++){const r=Fr.Properties[n];r in e&&(this[r]=e[r]instanceof re?e[r]:new re().copy(e[r]))}return this}clone(e){const n=this.stops.map(function(s){return s.clone()}),r=new Fr(this.left._x,this.left._y,this.right._x,this.right._y,n);return ie.each(rt.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(Q.Types.change),this}flagReset(){return this._flagEndPoints=!1,super.flagReset.call(this),this}};v(eo,"Stop",Xn),v(eo,"Properties",["left","right"]);var Ye=eo,Pl={left:{enumerable:!0,get:function(){return this._left},set:function(t){this._left instanceof re&&this._left.unbind(Q.Types.change,this._renderer.flagEndPoints),this._left=t,this._left.bind(Q.Types.change,this._renderer.flagEndPoints),this._flagEndPoints=!0}},right:{enumerable:!0,get:function(){return this._right},set:function(t){this._right instanceof re&&this._right.unbind(Q.Types.change,this._renderer.flagEndPoints),this._right=t,this._right.bind(Q.Types.change,this._renderer.flagEndPoints),this._flagEndPoints=!0}}};function Tg(){this._flagEndPoints=!0}var to=class Pi extends rt{constructor(e,n,r,s,o,a){super(s),v(this,"_flagRadius",!1),v(this,"_flagCenter",!1),v(this,"_flagFocal",!1),v(this,"_radius",0),v(this,"_center",null),v(this,"_focal",null);for(let l in El)Object.defineProperty(this,l,El[l]);this._renderer.type="radial-gradient",this._renderer.flagCenter=$g.bind(this),this._renderer.flagFocal=Ng.bind(this),this.center=new re,this.radius=typeof r=="number"?r:1,this.focal=new re,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 Pi().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<Pi.Properties.length;n++){const r=Pi.Properties[n];r in e&&(/(center|focal)i/.test(r)?this[r]=e[r]instanceof re?e[r]:new re().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 Pi(this.center._x,this.center._y,this._radius,n,this.focal._x,this.focal._y);return ie.each(rt.Properties.concat(Pi.Properties),function(s){r[s]=this[s]},this),e&&e.add(r),r}toObject(){const e=super.toObject.call(this);return ie.each(Pi.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(Q.Types.change),this}flagReset(){return this._flagRadius=this._flagCenter=this._flagFocal=!1,super.flagReset.call(this),this}};v(to,"Stop",Xn),v(to,"Properties",["center","radius","focal"]);var Ue=to,El={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(Q.Types.change,this._renderer.flagCenter),this._center=t,this._center.bind(Q.Types.change,this._renderer.flagCenter),this._flagCenter=!0}},focal:{enumerable:!0,get:function(){return this._focal},set:function(t){this._focal&&this._focal.unbind(Q.Types.change,this._renderer.flagFocal),this._focal=t,this._focal.bind(Q.Types.change,this._renderer.flagFocal),this._flagFocal=!0}}};function $g(){this._flagCenter=!0}function Ng(){this._flagFocal=!0}function Fl(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 Hr(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 Vl(t,e,n){let r,s,o,a,l,c,d,u;const h=e.controls&&e.controls.right,f=t.controls&&t.controls.left;return r=e.x,l=e.y,s=(h||e).x,c=(h||e).y,o=(f||t).x,d=(f||t).y,a=t.x,u=t.y,h&&e._relative&&(s+=e.x,c+=e.y),f&&t._relative&&(o+=t.x,d+=t.y),_l(r,l,s,c,o,d,a,u,n)}function Il(t,e,n){let r,s,o,a,l,c,d,u;const h=e.controls&&e.controls.right,f=t.controls&&t.controls.left;return r=e.x,l=e.y,s=(h||e).x,c=(h||e).y,o=(f||t).x,d=(f||t).y,a=t.x,u=t.y,h&&e._relative&&(s+=e.x,c+=e.y),f&&t._relative&&(o+=t.x,d+=t.y),Ks(r,l,s,c,o,d,a,u,n)}function ci(t){switch(t.renderer.type){case"texture":return Oe.fromObject(t);case"gradient":return rt.fromObject(t);case"linear-gradient":return Ye.fromObject(t);case"radial-gradient":return Ue.fromObject(t)}return t}var Rg=Math.cos,Pg=Math.sin,Al=Math.tan,no=[],Ml=class Xt extends Q{constructor(e,n,r,s,o,a){super(),v(this,"elements",new un(9)),v(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 R=e;let w,C,k;const T=n[0]||0,$=n[1]||0,P=n[2]||0;return w=R[0]*T+R[1]*$+R[2]*P,C=R[3]*T+R[4]*$+R[5]*P,k=R[6]*T+R[7]*$+R[8]*P,[w,C,k]}const s=e[0],o=e[1],a=e[2],l=e[3],c=e[4],d=e[5],u=e[6],h=e[7],f=e[8],g=n[0],m=n[1],p=n[2],y=n[3],b=n[4],_=n[5],B=n[6],x=n[7],N=n[8];return r=r||new un(9),r[0]=s*g+o*y+a*B,r[1]=s*m+o*b+a*x,r[2]=s*p+o*_+a*N,r[3]=l*g+c*y+d*B,r[4]=l*m+c*b+d*x,r[5]=l*p+c*_+d*N,r[6]=u*g+h*y+f*B,r[7]=u*m+h*b+f*x,r[8]=u*p+h*_+f*N,r}static fromObject(e){return new Xt().copy(e)}set(e,n,r,s,o,a,l,c,d){if(typeof n>"u"){const u=e;e=u[0],n=u[1],r=u[2],s=u[3],o=u[4],a=u[5],l=u[6],c=u[7],d=u[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(Q.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(Q.Types.change)}identity(){return this.elements[0]=Xt.Identity[0],this.elements[1]=Xt.Identity[1],this.elements[2]=Xt.Identity[2],this.elements[3]=Xt.Identity[3],this.elements[4]=Xt.Identity[4],this.elements[5]=Xt.Identity[5],this.elements[6]=Xt.Identity[6],this.elements[7]=Xt.Identity[7],this.elements[8]=Xt.Identity[8],this.trigger(Q.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(Q.Types.change);if(typeof r>"u"&&(r=1),typeof s>"u"){e=e||0,n=n||0,r=r||0,o=this.elements;const W=o[0]*e+o[1]*n+o[2]*r,A=o[3]*e+o[4]*n+o[5]*r,Z=o[6]*e+o[7]*n+o[8]*r;return[W,A,Z]}const u=this.elements,h=[e,n,r,s,o,a,l,c,d],f=u[0],g=u[1],m=u[2],p=u[3],y=u[4],b=u[5],_=u[6],B=u[7],x=u[8],N=h[0],R=h[1],w=h[2],C=h[3],k=h[4],T=h[5],$=h[6],P=h[7],E=h[8];return this.elements[0]=f*N+g*C+m*$,this.elements[1]=f*R+g*k+m*P,this.elements[2]=f*w+g*T+m*E,this.elements[3]=p*N+y*C+b*$,this.elements[4]=p*R+y*k+b*P,this.elements[5]=p*w+y*T+b*E,this.elements[6]=_*N+B*C+x*$,this.elements[7]=_*R+B*k+x*P,this.elements[8]=_*w+B*T+x*E,this.trigger(Q.Types.change)}inverse(e){const n=this.elements;e=e||new Xt;const r=n[0],s=n[1],o=n[2],a=n[3],l=n[4],c=n[5],d=n[6],u=n[7],h=n[8],f=h*l-c*u,g=-h*a+c*d,m=u*a-l*d;let p=r*f+s*g+o*m;return p?(p=1/p,e.elements[0]=f*p,e.elements[1]=(-h*s+o*u)*p,e.elements[2]=(c*s-o*l)*p,e.elements[3]=g*p,e.elements[4]=(h*r-o*d)*p,e.elements[5]=(-c*r+o*a)*p,e.elements[6]=m*p,e.elements[7]=(-u*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=Rg(e),r=Pg(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=Al(e);return this.multiply(1,n,0,0,1,0,0,0,1)}skewY(e){const n=Al(e);return this.multiply(1,0,0,n,1,0,0,0,1)}toString(e){return no.length=0,this.toTransformArray(e,no),no.map(Me).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],u=r[5];if(e){const h=r[6],f=r[7],g=r[8];if(s){n[0]=o,n[1]=c,n[2]=h,n[3]=a,n[4]=d,n[5]=f,n[6]=l,n[7]=u,n[8]=g;return}return[o,c,h,a,d,f,l,u,g]}if(s){n[0]=o,n[1]=c,n[2]=a,n[3]=d,n[4]=l,n[5]=u;return}return[o,c,a,d,l,u]}toArray(e,n){const r=this.elements,s=!!n,o=r[0],a=r[1],l=r[2],c=r[3],d=r[4],u=r[5];if(e){const h=r[6],f=r[7],g=r[8];if(s){n[0]=o,n[1]=a,n[2]=l,n[3]=c,n[4]=d,n[5]=u,n[6]=h,n[7]=f,n[8]=g;return}return[o,a,l,c,d,u,h,f,g]}if(s){n[0]=o,n[1]=a,n[2]=l,n[3]=c,n[4]=d,n[5]=u;return}return[o,a,l,c,d,u]}toObject(){return{renderer:{type:"matrix"},elements:this.toArray(!0),manual:!!this.manual}}clone(){return new Xt().copy(this)}};v(Ml,"Identity",[1,0,0,0,1,0,0,0,1]);var Li=Ml;gl(Li);var Ol=class Xa extends Di{constructor(){super(),v(this,"_flagMatrix",!0),v(this,"_flagScale",!1),v(this,"_matrix",null),v(this,"_worldMatrix",null),v(this,"_position",null),v(this,"_rotation",0),v(this,"_scale",1),v(this,"_skewX",0),v(this,"_skewY",0);for(let e in Wr)Object.defineProperty(this,e,Wr[e]);this._renderer.flagMatrix=zl.bind(this),this.isShape=!0,this.matrix=new Li,this.worldMatrix=new Li,this.position=new re,this.rotation=0,this.scale=1,this.skewX=0,this.skewY=0}static fromObject(e){const n=new Xa().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 Wr.position.get.apply(this,arguments)}set translation(e){Wr.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 re?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 re?e.scale:new re(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 Xa;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 re?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 re?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}};v(Ol,"Properties",["position","rotation","scale","skewX","skewY","matrix","worldMatrix"]);var Yn=Ol,Wr={position:{enumerable:!0,get:function(){return this._position},set:function(t){this._position&&this._position.unbind(Q.Types.change,this._renderer.flagMatrix),this._position=t,this._position.bind(Q.Types.change,this._renderer.flagMatrix),zl.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 re&&this._scale.unbind(Q.Types.change,this._renderer.flagMatrix),this._scale=t,this._scale instanceof re&&this._scale.bind(Q.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 Ys(this,this._worldMatrix),this._worldMatrix},set:function(t){this._worldMatrix=t}}};function zl(){this._flagMatrix=!0}var Hi=Math.min,Wi=Math.max,Eg=Math.ceil,Fg=Math.floor,Vg=new re,io=class ri extends Yn{constructor(e,n,r,s){super(),v(this,"_flagVertices",!0),v(this,"_flagLength",!0),v(this,"_flagFill",!0),v(this,"_flagStroke",!0),v(this,"_flagLinewidth",!0),v(this,"_flagOpacity",!0),v(this,"_flagVisible",!0),v(this,"_flagCap",!0),v(this,"_flagJoin",!0),v(this,"_flagMiter",!0),v(this,"_flagStrokeAttenuation",!0),v(this,"_flagMask",!1),v(this,"_flagClip",!1),v(this,"_length",0),v(this,"_fill","#fff"),v(this,"_stroke","#000"),v(this,"_linewidth",1),v(this,"_opacity",1),v(this,"_visible",!0),v(this,"_cap","round"),v(this,"_join","round"),v(this,"_miter",4),v(this,"_closed",!0),v(this,"_curved",!1),v(this,"_automatic",!0),v(this,"_beginning",0),v(this,"_ending",1),v(this,"_mask",null),v(this,"_clip",!1),v(this,"_dashes",null),v(this,"_strokeAttenuation",!0);for(let o in Dl)Object.defineProperty(this,o,Dl[o]);this._renderer.type="path",this._renderer.flagVertices=Ll.bind(this),this._renderer.bindVertices=Hl.bind(this),this._renderer.unbindVertices=Wl.bind(this),this._renderer.flagFill=jl.bind(this),this._renderer.flagStroke=ql.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:ci(e.fill),r=typeof e.stroke=="string"?e.stroke:ci(e.stroke),s=new ri().copy(Xs(qs({},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 Be?this.vertices.push(e.vertices[n].clone()):this.vertices.push(new Be().copy(r))}}for(let n=0;n<ri.Properties.length;n++){const r=ri.Properties[n];r in e&&(this[r]=e[r])}return this}clone(e){const n=new ri;for(let r=0;r<this.vertices.length;r++)n.vertices.push(this.vertices[r].clone());for(let r=0;r<ri.Properties.length;r++){const s=ri.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()),ie.each(ri.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,u=1/0,h=-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:f,scaleY:g}=li(n.elements[0],n.elements[3],n.elements[1],n.elements[4],n.elements[2],n.elements[5]);typeof f=="number"&&typeof g=="number"&&(r=Math.max(f,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[f,g]=n.multiply(a.x,a.y),[m,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[_,B]=n.multiply(y,b),x=l.controls.left.x,N=l.controls.left.y;l.relative&&(x+=l.x,N+=l.y);let[R,w]=n.multiply(x,N);const C=wl(f,g,_,B,R,w,m,p);u=Hi(C.min.y-r,u),c=Hi(C.min.x-r,c),d=Wi(C.max.x+r,d),h=Wi(C.max.y+r,h)}else o<=1&&(u=Hi(g-r,u),c=Hi(f-r,c),d=Wi(f+r,d),h=Wi(g+r,h)),u=Hi(p-r,u),c=Hi(m-r,c),d=Wi(m+r,d),h=Wi(p+r,h)}return{top:u,left:c,right:d,bottom:h,width:d-c,height:h-u}}getPointAt(e,n){let r,s,o,a,l,c,d,u,h,f,g,m,p,y,b,_=this.length*Math.min(Math.max(e,0),1);const B=this.vertices.length,x=B-1;let N=null,R=null;for(let te=0,D=this._lengths.length,H=0;te<D;te++){if(H+this._lengths[te]>=_){this._closed?(r=Dt(te,B),s=Dt(te-1,B),te===0&&(r=s,s=te)):(r=te,s=Math.min(Math.max(te-1,0),x)),N=this.vertices[r],R=this.vertices[s],_-=H,this._lengths[te]!==0?e=_/this._lengths[te]:e=0;break}H+=this._lengths[te]}if(N===null||R===null)return null;if(N){if(!R)return N}else return R;b=R.controls&&R.controls.right,y=N.controls&&N.controls.left,l=R.x,f=R.y,c=(b||R).x,g=(b||R).y,d=(y||N).x,m=(y||N).y,u=N.x,p=N.y,b&&R.relative&&(c+=R.x,g+=R.y),y&&N.relative&&(d+=N.x,m+=N.y),a=dr(e,l,c,d,u),h=dr(e,f,g,m,p);const w=zt(l,c,e),C=zt(f,g,e),k=zt(c,d,e),T=zt(g,m,e),$=zt(d,u,e),P=zt(m,p,e),E=zt(w,k,e),W=zt(C,T,e),A=zt(k,$,e),Z=zt(T,P,e);return ie.isObject(n)?(n.x=a,n.y=h,n instanceof Be&&(n.controls.left.x=E,n.controls.left.y=W,n.controls.right.x=A,n.controls.right.y=Z,(typeof n.relative!="boolean"||n.relative)&&(n.controls.left.x-=a,n.controls.left.y-=h,n.controls.right.x-=a,n.controls.right.y-=h)),n.t=e,n):(o=new Be(a,h,E-a,W-h,A-a,Z-h,this._curved?se.curve:se.line),o.t=e,o)}plot(){if(this.curved)return kl(this._collection,this.closed),this;for(let e=0;e<this._collection.length;e++)this._collection[e].command=e===0?se.move:se.line;return this}subdivide(e){this._update();const n=this.vertices.length-1,r=this._closed||this.vertices[n]._command===se.close;let s=this.vertices[n],o=[],a;return ie.each(this.vertices,function(l,c){if(c<=0&&!r){s=l;return}if(l.command===se.move){o.push(new Be(s.x,s.y)),c>0&&(o[o.length-1].command=se.line),s=l;return}a=Il(l,s,e),o=o.concat(a),ie.each(a,function(d,u){u<=0&&s.command===se.move?d.command=se.move:d.command=se.line}),c>=n&&(this._closed&&this._automatic&&(s=l,a=Il(l,s,e),o=o.concat(a),ie.each(a,function(d,u){u<=0&&s.command===se.move?d.command=se.move:d.command=se.line})),o.push(new Be(l.x,l.y)),o[o.length-1].command=r?se.close:se.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=[]),ie.each(this.vertices,function(l,c){if(c<=0||l.command===se.move){o=l,this._lengths[c]=0;return}this._lengths[c]=Vl(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=Hr(this,r*this._length),a=Hr(this,s*this._length),l=Eg(o),c=Fg(a);let d,u,h,f,g,m;for(this._renderer.vertices.length=0,m=0;m<e;m++)this._renderer.collection.length<=m&&this._renderer.collection.push(new Be),m>c&&!u?(g=this._renderer.collection[m].copy(this._collection[m]),this.getPointAt(s,g),g.command=this._renderer.collection[m].command,this._renderer.vertices.push(g),u=g,h=this._collection[m-1],h&&h.controls&&(g.relative?g.controls.right.clear():g.controls.right.copy(g),h.relative?this._renderer.collection[m-1].controls.right.copy(h.controls.right).lerp(re.zero,1-g.t):this._renderer.collection[m-1].controls.right.copy(h.controls.right).lerp(h,1-g.t))):m>=l&&m<=c&&(g=this._renderer.collection[m].copy(this._collection[m]),this._renderer.vertices.push(g),m===c&&Fl(this,s)?(u=g,!n&&u.controls&&(u.relative?u.controls.right.clear():u.controls.right.copy(u))):m===l&&Fl(this,r)&&(d=g,d.command=se.move,!n&&d.controls&&(d.relative?d.controls.left.clear():d.controls.left.copy(d))));l>0&&!d&&(m=l-1,g=this._renderer.collection[m].copy(this._collection[m]),this.getPointAt(r,g),g.command=se.move,this._renderer.vertices.unshift(g),f=this._collection[m+1],f&&f.controls&&(g.controls.left.clear(),f.relative?this._renderer.collection[m+1].controls.left.copy(f.controls.left).lerp(re.zero,g.t):(Vg.copy(f),this._renderer.collection[m+1].controls.left.copy(f.controls.left).lerp(f,g.t))))}return Yn.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,Yn.prototype.flagReset.call(this),this}};v(io,"Properties",["fill","stroke","linewidth","opacity","visible","cap","join","miter","closed","curved","automatic","beginning","ending","dashes","strokeAttenuation"]),v(io,"Utils",{getCurveLength:Vl});var Ne=io,Dl={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 rt||this._fill instanceof Ye||this._fill instanceof Ue||this._fill instanceof Oe)&&this._fill.unbind(Q.Types.change,this._renderer.flagFill),this._fill=t,this._flagFill=!0,(this._fill instanceof rt||this._fill instanceof Ye||this._fill instanceof Ue||this._fill instanceof Oe)&&this._fill.bind(Q.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(t){(this._stroke instanceof rt||this._stroke instanceof Ye||this._stroke instanceof Ue||this._stroke instanceof Oe)&&this._stroke.unbind(Q.Types.change,this._renderer.flagStroke),this._stroke=t,this._flagStroke=!0,(this._stroke instanceof rt||this._stroke instanceof Ye||this._stroke instanceof Ue||this._stroke instanceof Oe)&&this._stroke.bind(Q.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";ie.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(Q.Types.insert,e).unbind(Q.Types.remove,n),t instanceof qn?this._collection=t:this._collection=new qn(t||[]),this._collection.bind(Q.Types.insert,e).bind(Q.Types.remove,n),e(this._collection)}},mask:{enumerable:!0,get:function(){return this._mask},set:function(t){this._mask=t,this._flagMask=!0,ie.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 Ll(){this._flagVertices=!0,this._flagLength=!0,this.parent&&(this.parent._flagLength=!0)}function Hl(t){let e=t.length;for(;e--;)t[e].bind(Q.Types.change,this._renderer.flagVertices);this._renderer.flagVertices()}function Wl(t){let e=t.length;for(;e--;)t[e].unbind(Q.Types.change,this._renderer.flagVertices);this._renderer.flagVertices()}function jl(){this._flagFill=!0}function ql(){this._flagStroke=!0}var Xl=class Vr extends Ne{constructor(e,n,r,s){const o=[new Be,new Be,new Be,new Be];super(o,!0,!1,!0),v(this,"_flagWidth",!1),v(this,"_flagHeight",!1),v(this,"_width",0),v(this,"_height",0),v(this,"_origin",null),this._renderer.type="rectangle";for(let a in Yl)Object.defineProperty(this,a,Yl[a]);this.width=typeof r=="number"?r:1,this.height=typeof s=="number"?s:1,this.origin=new re,typeof e=="number"&&(this.translation.x=e),typeof n=="number"&&(this.translation.y=n),this._update()}static fromObject(e){const n=new Vr().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<Vr.Properties.length;n++){const r=Vr.Properties[n];r in e&&(typeof e[r]=="number"?this[r]=e[r]:this[r]instanceof re&&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 Be),this.vertices[0].set(-e,-n).sub(this._origin).command=se.move,this.vertices[1].set(e,-n).sub(this._origin).command=se.line,this.vertices[2].set(e,n).sub(this._origin).command=se.line,this.vertices[3].set(-e,n).sub(this._origin).command=se.line,this.vertices[4]&&(this.vertices[4].set(-e,-n).sub(this._origin).command=se.line)}return super._update.call(this),this}flagReset(){return this._flagWidth=this._flagHeight=!1,super.flagReset.call(this),this}clone(e){const n=new Vr(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<Ne.Properties.length;r++){const s=Ne.Properties[r];n[s]instanceof re?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}};v(Xl,"Properties",["width","height","origin"]);var Un=Xl,Yl={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(Q.Types.change,this._renderer.flagVertices),this._origin=t,this._origin.bind(Q.Types.change,this._renderer.flagVertices),this._renderer.flagVertices()}}},Ul=class Ir extends Un{constructor(e,n,r,s,o,a){super(n,r,0,0),v(this,"_flagTexture",!1),v(this,"_flagColumns",!1),v(this,"_flagRows",!1),v(this,"_flagFrameRate",!1),v(this,"_flagIndex",!1),v(this,"_amount",1),v(this,"_duration",0),v(this,"_startTime",0),v(this,"_playing",!1),v(this,"_firstFrame",0),v(this,"_lastFrame",0),v(this,"_loop",!0),v(this,"_texture",null),v(this,"_columns",1),v(this,"_rows",1),v(this,"_frameRate",0),v(this,"_index",0),v(this,"_origin",null),this._renderer.type="sprite";for(let l in Kl)Object.defineProperty(this,l,Kl[l]);this.noStroke(),this.noFill(),e instanceof Oe?this.texture=e:typeof e=="string"&&(this.texture=new Oe(e)),this.origin=new re,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 Ir().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<Ir.Properties.length;n++){const r=Ir.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=ie.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 Ir(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,u,h,f;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)){u=e.image.width,h=e.image.height,s=u/n,o=h/r,l=this._amount,this.width!==s&&(this.width=s),this.height!==o&&(this.height=o),this._playing&&this._frameRate>0&&(ie.isNaN(this._lastFrame)&&(this._lastFrame=l-1),a=ie.performance.now()-this._startTime,f=this._lastFrame+1,c=1e3*(f-this._firstFrame)/this._frameRate,this._loop?a=a%c:a=Math.min(a,c),d=zt(this._firstFrame,f,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,m=Math.floor(this._index/n),p=-s*g+(u-s)/2,y=-o*m+(h-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}};v(Ul,"Properties",["texture","columns","rows","frameRate","index","firstFrame","lastFrame","loop"]);var jr=Ul,Kl={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}}},ro,Gl=class extends qn{constructor(e){e=Array.isArray(e)?e:Array.prototype.slice.call(arguments),super(e),ul(this,ro,{}),this.attach(e),this.on(Q.Types.insert,this.attach),this.on(Q.Types.remove,this.detach)}get ids(){return It(this,ro)}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}};ro=new WeakMap;var Zl=class Ei extends Ne{constructor(e,n,r,s,o,a,l){const c=l||Tt.Resolution*3,d=[];for(let u=0;u<c;u++)d.push(new Be);super(d,!0,!1,!0),v(this,"_flagStartAngle",!1),v(this,"_flagEndAngle",!1),v(this,"_flagInnerRadius",!1),v(this,"_flagOuterRadius",!1),v(this,"_startAngle",0),v(this,"_endAngle",gt),v(this,"_innerRadius",0),v(this,"_outerRadius",0),this._renderer.type="arc-segment";for(let u in Ql)Object.defineProperty(this,u,Ql[u]);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 Ei().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<Ei.Properties.length;n++){const r=Ei.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=Dt(e,gt)===Dt(n,gt),a=r>0,l=this.vertices;let c=a?l.length/2:l.length,d,u=0,h,f,g,m,p,y,b,_,B;for(o?c--:a||(c-=2),h=0,f=c-1;h<c;h++){switch(g=h/f,m=l[u],p=g*(n-e)+e,y=(n-e)/c,b=s*Math.cos(p),_=s*Math.sin(p),h){case 0:d=se.move;break;default:d=se.curve}m.command=d,m.x=b,m.y=_,m.controls.left.clear(),m.controls.right.clear(),m.command===se.curve&&(B=s*y/Math.PI,m.controls.left.x=B*Math.cos(p-it),m.controls.left.y=B*Math.sin(p-it),m.controls.right.x=B*Math.cos(p+it),m.controls.right.y=B*Math.sin(p+it),h===1&&m.controls.left.multiplyScalar(2),h===f&&m.controls.right.multiplyScalar(2)),u++}if(a){for(o?(l[u].command=se.close,u++):(c--,f=c-1),h=0;h<c;h++)g=h/f,m=l[u],p=(1-g)*(n-e)+e,y=(n-e)/c,b=r*Math.cos(p),_=r*Math.sin(p),d=se.curve,h<=0&&(d=o?se.move:se.line),m.command=d,m.x=b,m.y=_,m.controls.left.clear(),m.controls.right.clear(),m.command===se.curve&&(B=r*y/Math.PI,m.controls.left.x=B*Math.cos(p+it),m.controls.left.y=B*Math.sin(p+it),m.controls.right.x=B*Math.cos(p-it),m.controls.right.y=B*Math.sin(p-it),h===1&&m.controls.left.multiplyScalar(2),h===f&&m.controls.right.multiplyScalar(2)),u++;l[u].copy(l[0]),l[u].command=se.line}else o||(l[u].command=se.line,l[u].x=0,l[u].y=0,u++,l[u].copy(l[0]),l[u].command=se.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 Ei(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<Ne.Properties.length;c++){const d=Ne.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<Ei.Properties.length;n++){const r=Ei.Properties[n];e[r]=this[r]}return e}};v(Zl,"Properties",["startAngle","endAngle","innerRadius","outerRadius"]);var so=Zl,Ql={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}}},oo=Math.cos,ao=Math.sin,Jl=class Fi extends Ne{constructor(e,n,r,s){const o=s?Math.max(s,2):4,a=[];for(let l=0;l<o;l++)a.push(new Be(0,0,0,0,0,0));super(a,!0,!0,!0),v(this,"_flagRadius",!1),v(this,"_radius",0),this._renderer.type="circle";for(let l in ec)Object.defineProperty(this,l,ec[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 Fi().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<Fi.Properties.length;n++){const r=Fi.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*gt,c=r*oo(l),d=r*ao(l),u=s*oo(l-it),h=s*ao(l-it),f=s*oo(l+it),g=s*ao(l+it),m=this.vertices[o];m.command=o===0?se.move:se.curve,m.set(c,d),m.controls.left.set(u,h),m.controls.right.set(f,g)}}return super._update.call(this),this}flagReset(){return this._flagRadius=!1,super.flagReset.call(this),this}clone(e){const n=new Fi(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<Ne.Properties.length;r++){const s=Ne.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<Fi.Properties.length;n++){const r=Fi.Properties[n];e[r]=this[r]}return e}};v(Jl,"Properties",["radius"]);var qr=Jl,ec={radius:{enumerable:!0,get:function(){return this._radius},set:function(t){this._radius=t,this._flagRadius=!0}}},lo=Math.cos,co=Math.sin,tc=class Vi extends Ne{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 Be);super(l,!0,!0,!0),v(this,"_flagWidth",!1),v(this,"_flagHeight",!1),v(this,"_width",0),v(this,"_height",0),this._renderer.type="ellipse";for(let c in nc)Object.defineProperty(this,c,nc[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 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&&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*gt,c=r*lo(l),d=s*co(l),u=r*n*lo(l-it),h=s*n*co(l-it),f=r*n*lo(l+it),g=s*n*co(l+it),m=this.vertices[o];m.command=o===0?se.move:se.curve,m.set(c,d),m.controls.left.set(u,h),m.controls.right.set(f,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 Vi(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<Ne.Properties.length;a++){const l=Ne.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<Vi.Properties.length;n++){const r=Vi.Properties[n];e[r]=this[r]}return e}};v(tc,"Properties",["width","height"]);var Xr=tc,nc={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}}},Ig=Math.ceil,Ag=Math.floor,ic=class si extends Yn{constructor(e){super(),v(this,"_flagVertices",!0),v(this,"_flagLength",!0),v(this,"_flagFill",!0),v(this,"_flagStroke",!0),v(this,"_flagLinewidth",!0),v(this,"_flagOpacity",!0),v(this,"_flagVisible",!0),v(this,"_flagSize",!0),v(this,"_flagSizeAttenuation",!0),v(this,"_flagStrokeAttenuation",!0),v(this,"_length",0),v(this,"_fill","#fff"),v(this,"_stroke","#000"),v(this,"_linewidth",1),v(this,"_opacity",1),v(this,"_visible",!0),v(this,"_size",1),v(this,"_sizeAttenuation",!1),v(this,"_beginning",0),v(this,"_ending",1),v(this,"_dashes",null),v(this,"_strokeAttenuation",!0),v(this,"noFill",Ne.prototype.noFill),v(this,"noStroke",Ne.prototype.noStroke),v(this,"corner",Ne.prototype.corner),v(this,"center",Ne.prototype.center),v(this,"getBoundingClientRect",Ne.prototype.getBoundingClientRect),v(this,"_updateLength",Ne.prototype._updateLength);for(let n in rc)Object.defineProperty(this,n,rc[n]);this._renderer.type="points",this._renderer.flagVertices=Ll.bind(this),this._renderer.bindVertices=Hl.bind(this),this._renderer.unbindVertices=Wl.bind(this),this._renderer.flagFill=jl.bind(this),this._renderer.flagStroke=ql.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:ci(e.fill),r=typeof e.stroke=="string"?e.stroke:ci(e.stroke),s=new si().copy(Xs(qs({},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 Be?this.vertices.push(e.vertices[n].clone()):this.vertices.push(new Be().copy(r))}for(let n=0;n<si.Properties.length;n++){const r=si.Properties[n];r in e&&(this[r]=e[r])}return this}clone(e){const n=new si;for(let r=0;r<this.vertices.length;r++)n.vertices.push(this.vertices[r].clone());for(let r=0;r<si.Properties.length;r++){const s=si.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()),ie.each(si.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,u=Ks(a,l,a,l,c,d,c,d,e);n=n.concat(u)}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=Hr(this,e*this._length),s=Hr(this,n*this._length),o=Ig(r),a=Ag(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}};v(ic,"Properties",["fill","stroke","linewidth","opacity","visible","size","sizeAttenuation","beginning","ending","dashes","strokeAttenuation"]);var uo=ic,rc={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 rt||this._fill instanceof Ye||this._fill instanceof Ue||this._fill instanceof Oe)&&this._fill.unbind(Q.Types.change,this._renderer.flagFill),this._fill=t,this._flagFill=!0,(this._fill instanceof rt||this._fill instanceof Ye||this._fill instanceof Ue||this._fill instanceof Oe)&&this._fill.bind(Q.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(t){(this._stroke instanceof rt||this._stroke instanceof Ye||this._stroke instanceof Ue||this._stroke instanceof Oe)&&this._stroke.unbind(Q.Types.change,this._renderer.flagStroke),this._stroke=t,this._flagStroke=!0,(this._stroke instanceof rt||this._stroke instanceof Ye||this._stroke instanceof Ue||this._stroke instanceof Oe)&&this._stroke.bind(Q.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(Q.Types.insert,e).unbind(Q.Types.remove,n),t instanceof qn?this._collection=t:this._collection=new qn(t||[]),this._collection.bind(Q.Types.insert,e).bind(Q.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}}},Mg=Math.cos,Og=Math.sin,sc=class Ii extends Ne{constructor(e,n,r,s){s=Math.max(s||0,3),super(),v(this,"_flagWidth",!1),v(this,"_flagHeight",!1),v(this,"_flagSides",!1),v(this,"_radius",0),v(this,"_width",0),v(this,"_height",0),v(this,"_sides",0),this._renderer.type="polygon";for(let o in oc)Object.defineProperty(this,o,oc[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 Ii().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<Ii.Properties.length;n++){const r=Ii.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=gt*o+Math.PI/2,l=this._width*Mg(a)/2,c=this._height*Og(a)/2;s>=r?this.vertices.push(new Be(l,c)):this.vertices[s].set(l,c),this.vertices[s].command=s===0?se.move:se.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 Ii(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<Ne.Properties.length;r++){const s=Ne.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<Ii.Properties.length;n++){const r=Ii.Properties[n];e[r]=this[r]}return e}};v(sc,"Properties",["width","height","sides"]);var ho=sc,oc={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}}},ac=class Ai extends Ne{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 Be(0,0,0,0,0,0,l===0?se.move:se.curve));super(a),v(this,"_flagWidth",!1),v(this,"_flagHeight",!1),v(this,"_flagRadius",!1),v(this,"_width",0),v(this,"_height",0),v(this,"_radius",12),this._renderer.type="rounded-rectangle";for(let l in lc)Object.defineProperty(this,l,lc[l]);this.closed=!0,this.automatic=!1,this._renderer.flagRadius=zg.bind(this),typeof r=="number"&&(this.width=r),typeof s=="number"&&(this.height=s),(typeof o=="number"||o instanceof re)&&(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 Ai().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<Ai.Properties.length;n++){const r=Ai.Properties[n];if(r in e){const s=e[r];/radius/i.test(r)?this[r]=typeof s=="number"||s instanceof re?s:new re().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 re?(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 Ai(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<Ne.Properties.length;a++){const l=Ne.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<Ai.Properties.length;n++){const r=Ai.Properties[n];e[r]=this[r]}return e.radius=typeof this.radius=="number"?this.radius:this.radius.toObject(),e}};v(ac,"Properties",["width","height","radius"]);var Yr=ac,lc={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 re&&this._radius.unbind(Q.Types.change,this._renderer.flagRadius),this._radius=t,this._radius instanceof re&&this._radius.bind(Q.Types.change,this._renderer.flagRadius),this._flagRadius=!0}}};function zg(){this._flagRadius=!0}var Dg=Math.cos,Lg=Math.sin,cc=class Mi extends Ne{constructor(e,n,r,s,o){arguments.length<=3&&(s=r,r=s/2),(typeof o!="number"||o<=0)&&(o=5),super(),v(this,"_flagInnerRadius",!1),v(this,"_flagOuterRadius",!1),v(this,"_flagSides",!1),v(this,"_innerRadius",0),v(this,"_outerRadius",0),v(this,"_sides",0),this._renderer.type="star";for(let a in dc)Object.defineProperty(this,a,dc[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 Mi().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<Mi.Properties.length;n++){const r=Mi.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=gt*o,l=(s%2?this._outerRadius:this._innerRadius)/2,c=l*Dg(a),d=l*Lg(a);s>=r?this.vertices.push(new Be(c,d)):this.vertices[s].set(c,d),this.vertices[s].command=s===0?se.move:se.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 Mi(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<Ne.Properties.length;a++){const l=Ne.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<Mi.Properties.length;n++){const r=Mi.Properties[n];e[r]=this[r]}return e}};v(cc,"Properties",["innerRadius","outerRadius","sides"]);var fo=cc,dc={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}}},mo,uc=Math.min,hc=Math.max;Xe.document&&(mo=document.createElement("canvas"));var go=class Yt extends Yn{constructor(e,n,r,s){super(),v(this,"_flagValue",!0),v(this,"_flagFamily",!0),v(this,"_flagSize",!0),v(this,"_flagLeading",!0),v(this,"_flagAlignment",!0),v(this,"_flagBaseline",!0),v(this,"_flagStyle",!0),v(this,"_flagWeight",!0),v(this,"_flagDecoration",!0),v(this,"_flagFill",!0),v(this,"_flagStroke",!0),v(this,"_flagLinewidth",!0),v(this,"_flagOpacity",!0),v(this,"_flagVisible",!0),v(this,"_flagMask",!1),v(this,"_flagClip",!1),v(this,"_flagDirection",!0),v(this,"_flagStrokeAttenuation",!0),v(this,"_value",""),v(this,"_family","sans-serif"),v(this,"_size",13),v(this,"_leading",17),v(this,"_alignment","center"),v(this,"_baseline","middle"),v(this,"_style","normal"),v(this,"_weight",500),v(this,"_decoration","none"),v(this,"_direction","ltr"),v(this,"_fill","#000"),v(this,"_stroke","none"),v(this,"_linewidth",1),v(this,"_opacity",1),v(this,"_visible",!0),v(this,"_mask",null),v(this,"_clip",!1),v(this,"_dashes",null),v(this,"_strokeAttenuation",!0);for(let o in fc)Object.defineProperty(this,o,fc[o]);if(this._renderer.type="text",this._renderer.flagFill=Hg.bind(this),this._renderer.flagStroke=Wg.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,!ie.isObject(s))return this;for(let o=0;o<Yt.Properties.length;o++){const a=Yt.Properties[o];a in s&&(this[a]=s[a])}}static Measure(e){if(mo){const n=mo.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*Yt.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:ci(e.fill),r=typeof e.stroke=="string"?e.stroke:ci(e.stroke),s=new Yt().copy(Xs(qs({},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<Yt.Properties.length;n++){const r=Yt.Properties[n];r in e&&(this[r]=e[r])}return this}clone(e){const n=new Yt(this.value);n.translation.copy(this.translation),n.rotation=this.rotation,n.scale=this.scale;for(let r=0;r<Yt.Properties.length;r++){const s=Yt.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<Yt.Properties.length;n++){const r=Yt.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}=Yt.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[u,h]=n.multiply(r,o),[f,g]=n.multiply(r,a),[m,p]=n.multiply(s,o),[y,b]=n.multiply(s,a);return o=uc(h,g,p,b),r=uc(u,f,m,y),s=hc(u,f,m,y),a=hc(h,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}};v(go,"Ratio",.6),v(go,"Properties",["value","family","size","leading","alignment","linewidth","style","weight","decoration","direction","baseline","opacity","visible","fill","stroke","dashes","strokeAttenuation"]);var fn=go,fc={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 rt||this._fill instanceof Ye||this._fill instanceof Ue||this._fill instanceof Oe)&&this._fill.unbind(Q.Types.change,this._renderer.flagFill),this._fill=t,this._flagFill=!0,(this._fill instanceof rt||this._fill instanceof Ye||this._fill instanceof Ue||this._fill instanceof Oe)&&this._fill.bind(Q.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(t){(this._stroke instanceof rt||this._stroke instanceof Ye||this._stroke instanceof Ue||this._stroke instanceof Oe)&&this._stroke.unbind(Q.Types.change,this._renderer.flagStroke),this._stroke=t,this._flagStroke=!0,(this._stroke instanceof rt||this._stroke instanceof Ye||this._stroke instanceof Ue||this._stroke instanceof Oe)&&this._stroke.bind(Q.Types.change,this._renderer.flagStroke)}},mask:{enumerable:!0,get:function(){return this._mask},set:function(t){this._mask=t,this._flagMask=!0,ie.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 Hg(){this._flagFill=!0}function Wg(){this._flagStroke=!0}var po=class rr extends Un{constructor(e,n,r,s){super(n,r,0,0),v(this,"_flagTextures",!1),v(this,"_flagFrameRate",!1),v(this,"_flagIndex",!1),v(this,"_amount",1),v(this,"_duration",0),v(this,"_index",0),v(this,"_startTime",0),v(this,"_playing",!1),v(this,"_firstFrame",0),v(this,"_lastFrame",0),v(this,"_loop",!0),v(this,"_textures",null),v(this,"_frameRate",0),v(this,"_origin",null),this._renderer.type="image-sequence";for(let o in mc)Object.defineProperty(this,o,mc[o]);this._renderer.flagTextures=jg.bind(this),this._renderer.bindTextures=qg.bind(this),this._renderer.unbindTextures=Xg.bind(this),this.noStroke(),this.noFill(),Array.isArray(e)?this.textures=e.map(gc.bind(this)):typeof e=="string"&&(this.textures=[gc(e)]),this.origin=new re,this._update(),typeof s=="number"?this.frameRate=s:this.frameRate=rr.DefaultFrameRate,this.index=0}static fromObject(e){const n=new rr().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<rr.Properties.length;n++){const r=rr.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=ie.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 rr(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,ie.isNaN(this._lastFrame)&&(this._lastFrame=o-1),s=ie.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=zt(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 Oe))&&(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}};v(po,"Properties",["textures","frameRate","index","firstFrame","lastFrame","loop"]),v(po,"DefaultFrameRate",30);var yo=po,mc={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(Q.Types.insert,e).unbind(Q.Types.remove,n),this._textures=new qn((t||[]).slice(0)),this._textures.bind(Q.Types.insert,e).bind(Q.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 jg(){this._flagTextures=!0}function qg(t){let e=t.length;for(;e--;)t[e].bind(Q.Types.change,this._renderer.flagTextures);this._renderer.flagTextures()}function Xg(t){let e=t.length;for(;e--;)t[e].unbind(Q.Types.change,this._renderer.flagTextures);this._renderer.flagTextures()}function gc(t){if(t instanceof Oe)return t;if(typeof t=="string")return new Oe(t)}var Ur=Math.min,Kr=Math.max,bo=class oi extends Yn{constructor(e){super(),v(this,"_flagAdditions",!1),v(this,"_flagSubtractions",!1),v(this,"_flagOrder",!1),v(this,"_flagOpacity",!0),v(this,"_flagBeginning",!1),v(this,"_flagEnding",!1),v(this,"_flagLength",!1),v(this,"_flagMask",!1),v(this,"_fill","#fff"),v(this,"_stroke","#000"),v(this,"_linewidth",1),v(this,"_opacity",1),v(this,"_visible",!0),v(this,"_cap","round"),v(this,"_join","round"),v(this,"_miter",4),v(this,"_closed",!0),v(this,"_curved",!1),v(this,"_automatic",!0),v(this,"_beginning",0),v(this,"_ending",1),v(this,"_length",0),v(this,"_mask",null),v(this,"_strokeAttenuation",!0);for(let n in pc)Object.defineProperty(this,n,pc[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++)yc.call(this,e[n],this)}static RemoveChildren(e){for(let n=0;n<e.length;n++)yc.call(this,e[n])}static OrderChildren(e){this._flagOrder=!0}static fromObject(e){const n=new oi;for(let s=0;s<oi.Properties.length;s++){const o=oi.Properties[s];o in e&&(/(fill|stroke)/i.test(o)?n[o]=typeof e[o]=="string"?e[o]:ci(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 so.fromObject(s);case"circle":return qr.fromObject(s);case"element":return Di.fromObject(s);case"ellipse":return Xr.fromObject(s);case"group":return oi.fromObject(s);case"image":return Image.fromObject(s);case"image-sequence":return yo.fromObject(s);case"path":return Ne.fromObject(s);case"points":return uo.fromObject(s);case"polygon":return ho.fromObject(s);case"rectangle":return Un.fromObject(s);case"rounded-rectangle":return Yr.fromObject(s);case"shape":return Yn.fromObject(s);case"sprite":return jr.fromObject(s);case"star":return fo.fromObject(s);case"text":return fn.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<oi.Properties.length;n++){const r=oi.Properties[n];r in e&&(this[r]=e[r])}return this}clone(e){const n=new oi,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,ie.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,u=1/0,h=-1/0;const f=/texture|gradient/i;r=e?this.matrix:this.worldMatrix;for(let g=0;g<this.children.length;g++){const m=this.children[g];if(!(!m.visible||f.test(m._renderer.type))&&(n=m.getBoundingClientRect(e),s=typeof n.top!="number"||ie.isNaN(n.top)||!isFinite(n.top),o=typeof n.left!="number"||ie.isNaN(n.left)||!isFinite(n.left),a=typeof n.right!="number"||ie.isNaN(n.right)||!isFinite(n.right),l=typeof n.bottom!="number"||ie.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),[B,x]=r.multiply(n.left,n.bottom),[N,R]=r.multiply(n.right,n.bottom);u=Ur(y,_,x,R,u),c=Ur(p,b,B,N,c),d=Kr(p,b,B,N,d),h=Kr(y,_,x,R,h)}else u=Ur(n.top,u),c=Ur(n.left,c),d=Kr(n.right,d),h=Kr(n.bottom,h)}return{top:u,left:c,right:d,bottom:h,width:d-c,height:h-u}}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}};v(bo,"Children",Gl),v(bo,"Properties",["fill","stroke","linewidth","cap","join","miter","closed","curved","automatic"]);var ct=bo,pc={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=ct.InsertChildren.bind(this),n=ct.RemoveChildren.bind(this),r=ct.OrderChildren.bind(this);this._children&&(this._children.unbind(),this._children.length>0&&n(this._children)),this._children=new Gl(t),this._children.bind(Q.Types.insert,e),this._children.bind(Q.Types.remove,n),this._children.bind(Q.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,ie.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 yc(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 Gr=class extends Ne{constructor(e,n,r,s){const o=[new Be(e,n),new Be(r,s)];super(o);for(let a in bc)Object.defineProperty(this,a,bc[a]);this.vertices[0].command=se.move,this.vertices[1].command=se.line,this.automatic=!1}};v(Gr,"Properties",["left","right"]);var bc={left:{enumerable:!0,get:function(){return this.vertices[0]},set:function(t){if(ie.isObject(t))this.vertices.splice(0,1,t),this.vertices[0].command=se.move;else{const e=new At("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(ie.isObject(t))this.vertices.splice(1,1,t),this.vertices[1].command=se.line;else{const e=new At("Two.Line.right argument is not an object.");console.warn(e.name,e.message)}}}},mn={path:/[+-]?(?:\d*\.\d+|\d+)(?:[eE][+-]\d+)?/g,cssBackgroundImage:/url\(['"]?#([\w\d-_]*)['"]?\)/i,unitSuffix:/[a-zA-Z%]*/i},Yg={start:"left",middle:"center",end:"right"},_c=["id","class","transform","xmlns","viewBox"],Ug=["x","y","width","height","href","xlink:href"];function Kg(t){return Yg[t]}function Gg(t){const e=t.getAttribute("dominant-baseline"),n=t.getAttribute("alignment-baseline");return e||n}function ur(t){return t.replace(/svg:/gi,"").toLowerCase()}function wc(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 Zg(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 Qg(t){const e={},n=Jg(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 Jg(t){const e=t.getAttributeNames();for(let n=0;n<_c.length;n++){const r=_c[n],s=Array.prototype.indexOf.call(e,r);s>=0&&e.splice(s,1)}return e}function ep(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 h=0;h<t.children.length;h++){const f=t.children[h];"translation"in f?f.translation.add(r,s):"x"in f?f.x=r:"y"in f&&(f.y=s)}const l=typeof t.x=="number",c=typeof t.y=="number",d=typeof t.width=="number",u=typeof t.height=="number";return l&&(t.translation.x+=t.x),c&&(t.translation.y+=t.y),(d||u)&&(t.scale=new re(1,1)),d&&(t.scale.x=t.width/o),u&&(t.scale.y=t.height/a),t.mask=new Un(0,0,o,a),t.mask.origin.set(-o/2,-a/2),t}function Ut(t,e,n){const r={},s={},o={};let a,l,c,d,u,h,f,g,m,p,y,b,_,B,x,N,R;if(t===null)return r;if(Xe.getComputedStyle){const w=Xe.getComputedStyle(t);for(a=w.length;a--;)c=w[a],d=w[c],typeof d<"u"&&(r[c]=d)}for(a=0;a<t.attributes.length;a++)h=t.attributes[a],/style/i.test(h.nodeName)?Zg(h.value,o):s[h.nodeName]=h.value;typeof r.opacity<"u"&&(r["stroke-opacity"]=r.opacity,r["fill-opacity"]=r.opacity,delete r.opacity),n&&ie.defaults(r,n),ie.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(f=li(l),e._renderer.type){case"linear-gradient":wc(f,e.left),wc(f,e.right);break;case"radial-gradient":e.center.x+=f.translateX,e.center.y+=f.translateY,e.focal.x+=f.translateX,e.focal.y+=f.translateY,e.radius*=Math.max(f.scaleX,f.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;f=li(l),e.translation.set(f.translateX,f.translateY),e.rotation=Math.PI*(f.rotation/180),e.scale=new re(f.scaleX,f.scaleY),g=parseFloat((r.x+"").replace("px")),m=parseFloat((r.y+"").replace("px")),g&&(e.translation.x=g),m&&(e.translation.y=m);break;case"visible":if(e instanceof ct){e._visible=d;break}e.visible=d;break;case"stroke-linecap":if(e instanceof ct){e._cap=d;break}e.cap=d;break;case"stroke-linejoin":if(e instanceof ct){e._join=d;break}e.join=d;break;case"stroke-miterlimit":if(e instanceof ct){e._miter=d;break}e.miter=d;break;case"stroke-width":if(e instanceof ct){e._linewidth=parseFloat(d);break}e.linewidth=parseFloat(d);break;case"opacity":case"stroke-opacity":case"fill-opacity":if(e instanceof ct){e._opacity=parseFloat(d);break}e.opacity=parseFloat(d);break;case"clip-path":if(mn.cssBackgroundImage.test(d)&&(p=d.replace(mn.cssBackgroundImage,"$1"),qe.defs.current&&qe.defs.current.contains(p)&&(b=qe.defs.current.get(p),b&&b.childNodes.length>0)))switch(b=b.childNodes[0],_=ur(b.nodeName),e.mask=qe[_].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":u=(e instanceof ct?"_":"")+c,mn.cssBackgroundImage.test(d)?(p=d.replace(mn.cssBackgroundImage,"$1"),qe.defs.current&&qe.defs.current.contains(p)?(b=qe.defs.current.get(p),b.object||(_=ur(b.nodeName),b.object=qe[_].call(this,b,{})),b=b.object):(y=np(this),b=y.getById(p)),e[u]=b):e[u]=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(B=e instanceof rt,x=e instanceof Ye,N=e instanceof Ue,B||x||N)break;d.match("[a-z%]$")&&!d.endsWith("px")&&(R=new At("only pixel values are supported with the "+c+" attribute."),console.warn(R.name,R.message)),e.translation[c]=parseFloat(d);break;case"font-family":e instanceof fn&&(e.family=d);break;case"font-size":e instanceof fn&&(d.match("[a-z%]$")&&!d.endsWith("px")&&(R=new At("only pixel values are supported with the "+c+" attribute."),console.warn(R.name,R.message)),e.size=parseFloat(d));break;case"font-weight":e instanceof fn&&(e.weight=d);break;case"font-style":e instanceof fn&&(e.style=d);break;case"text-decoration":e instanceof fn&&(e.decoration=d);break;case"line-height":e instanceof fn&&(e.leading=d);break}return Object.keys(t.dataset).length&&(e.dataset=t.dataset),r}function tp(t,e){for(let n=0,r=t.childNodes.length;n<r;n++){const s=t.childNodes[n];!s.id||ur(t.nodeName)==="#text"||e.add(s.id,s)}}function np(t){for(;t.parent;)t=t.parent;return t.scene}var qe={svg:function(t){const e=qe.defs.current=new Dr,n=t.getElementsByTagName("defs");for(let m=0;m<n.length;m++)tp(n[m],e);const r=qe.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,u=o!==null,h=a!==null,f=l!==null,g=c!==null;return u&&(r.x=parseFloat(o.replace(mn.unitSuffix,""))),h&&(r.y=parseFloat(a.replace(mn.unitSuffix,""))),f&&(r.width=parseFloat(l.replace(mn.unitSuffix,""))),g&&(r.height=parseFloat(c.replace(mn.unitSuffix,""))),d&&ep(r,s),delete qe.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 At("encountered <use /> with no href."),console.warn(n.name,n.message),null;const s=r.slice(1);if(!qe.defs.current.contains(s))return n=new At("unable to find element for reference "+r+"."),console.warn(n.name,n.message),null;const a=qe.defs.current.get(s).cloneNode(!0);for(let c=0;c<t.attributes.length;c++){const d=t.attributes[c],u=Ug.includes(d.nodeName),h=!a.hasAttribute(d.nodeName);(u||h)&&a.setAttribute(d.nodeName,d.value)}const l=ur(a.nodeName);return qe[l].call(this,a,e)},g:function(t,e){const n=new ct;Ut.call(this,t,n,e),this.add(n);const r=Qg.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=ur(l);if(c in qe){const d=qe[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 Be(parseFloat(a),parseFloat(l)))});const s=new Ne(r,!0);return s.stroke="none",s.fill="black",Ut.call(this,t,s,e),s},polyline:function(t,e){const n=qe.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 Be,c,d,u=n.match(/[a-df-z][^a-df-z]*/gi);const h=u.length-1;ie.each(u.slice(0),function(f,g){const m=f.slice(1).trim().match(mn.path),p=f[0],y=p.toLowerCase();let b,_,B,x,N;const R=[];switch(g===0&&(u=[]),y){case"h":case"v":m.length>1&&(b=1);break;case"m":case"l":case"t":m.length>2&&(b=2);break;case"s":case"q":m.length>4&&(b=4);break;case"c":m.length>6&&(b=6);break;case"a":m.length>7&&(b=7);break}if(b){for(_=0,B=m.length,N=0;_<B;_+=b){if(x=p,N>0)switch(p){case"m":x="l";break;case"M":x="L";break}R.push(x+m.slice(_,_+b).join(" ")),N++}u=Array.prototype.concat.apply(u,R)}else u.push(f)}),ie.each(u,function(f,g){let m,p,y;const b=f[0],_=b.toLowerCase();d=f.slice(1).trim().match(mn.path),o=b===_;let B,x,N,R,w,C,k,T,$,P,E,W,A,Z,te,D,H;switch(_){case"z":if(g>=h)s=!0;else{p=l.x,y=l.y,m=new Be(p,y,void 0,void 0,void 0,void 0,se.close);for(let L=r.length-1;L>=0;L--){const M=r[L];if(/m/i.test(M.command)){l=M;break}}}break;case"m":case"l":c=void 0,p=parseFloat(d[0]),y=parseFloat(d[1]),m=new Be(p,y,void 0,void 0,void 0,void 0,/m/i.test(_)?se.move:se.line),o&&m.addSelf(l),l=m;break;case"h":case"v":P=/h/i.test(_)?"x":"y",E=/x/i.test(P)?"y":"x",m=new Be(void 0,void 0,void 0,void 0,void 0,void 0,se.line),m[P]=parseFloat(d[0]),m[E]=l[E],o&&(m[P]+=l[P]),l=m;break;case"c":case"s":B=l.x,x=l.y,c||(c=new re),/c/i.test(_)?(N=parseFloat(d[0]),R=parseFloat(d[1]),w=parseFloat(d[2]),C=parseFloat(d[3]),k=parseFloat(d[4]),T=parseFloat(d[5])):($=Gs(l,c,o),N=$.x,R=$.y,w=parseFloat(d[0]),C=parseFloat(d[1]),k=parseFloat(d[2]),T=parseFloat(d[3])),o&&(N+=B,R+=x,w+=B,C+=x,k+=B,T+=x),l.controls.right.set(N-l.x,R-l.y),m=new Be(k,T,w-k,C-T,void 0,void 0,se.curve),l=m,c=m.controls.left;break;case"t":case"q":B=l.x,x=l.y,c||(c=new re),/q/i.test(_)?(N=parseFloat(d[0]),R=parseFloat(d[1]),w=parseFloat(d[0]),C=parseFloat(d[1]),k=parseFloat(d[2]),T=parseFloat(d[3])):($=Gs(l,c,o),N=$.x,R=$.y,w=$.x,C=$.y,k=parseFloat(d[0]),T=parseFloat(d[1])),o&&(N+=B,R+=x,w+=B,C+=x,k+=B,T+=x),l.controls.right.set((N-l.x)*.33,(R-l.y)*.33),m=new Be(k,T,w-k,C-T,void 0,void 0,se.curve),l=m,c=m.controls.left;break;case"a":B=l.x,x=l.y,A=parseFloat(d[0]),Z=parseFloat(d[1]),te=parseFloat(d[2]),D=parseFloat(d[3]),H=parseFloat(d[4]),k=parseFloat(d[5]),T=parseFloat(d[6]),o&&(k+=B,T+=x),W=new Be(k,T),W.command=se.arc,W.rx=A,W.ry=Z,W.xAxisRotation=te,W.largeArcFlag=D,W.sweepFlag=H,m=W,l=W,c=void 0;break}m&&(Array.isArray(m)?r=r.concat(m):r.push(m))})}n=new Ne(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},ie.each(n.vertices,function(l){l.subSelf(a.centroid)}),Ut.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 qr(0,0,s);return o.stroke="none",o.fill="black",Ut.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 Xr(0,0,s,o);return a.stroke="none",a.fill="black",Ut.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(!ie.isNaN(n)||!ie.isNaN(r))return qe["rounded-rect"](t);const s=parseFloat(t.getAttribute("width")),o=parseFloat(t.getAttribute("height")),a=s/2,l=o/2,c=new Un(0,0,s,o);return c.stroke="none",c.fill="black",Ut.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 re(n,r),d=new Yr(0,0,s,o,c);return d.stroke="none",d.fill="black",Ut.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 Gr(n,r,s,o).noFill();return Ut.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 u=[];for(let f=0;f<t.children.length;f++){const g=t.children[f];let m=g.getAttribute("offset");/%/gi.test(m)&&(m=parseFloat(m.replace(/%/gi,""))/100),m=parseFloat(m);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),u.push(new Xn(m,p,y))}const h=new Ye(s,o,a,l,u);return h.spread=r,h.units=n,Ut.call(this,t,h,e),h},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"));ie.isNaN(l)&&(l=s),ie.isNaN(c)&&(c=o);const d=Math.abs(s+l)/2,u=Math.abs(o+c)/2;/userSpaceOnUse/i.test(n)&&(s-=d,o-=u,l-=d,c-=u);const h=[];for(let g=0;g<t.children.length;g++){const m=t.children[g];let p=m.getAttribute("offset");/%/gi.test(p)&&(p=parseFloat(p.replace(/%/gi,""))/100),p=parseFloat(p);let y=m.getAttribute("stop-color"),b=m.getAttribute("stop-opacity"),_=m.getAttribute("style"),B;y===null&&(B=_?_.match(/stop-color:\s?([#a-fA-F0-9]*)/):!1,y=B&&B.length>1?B[1]:void 0),b===null?(B=_?_.match(/stop-opacity:\s?([0-9.-]*)/):!1,b=B&&B.length>1?parseFloat(B[1]):1):b=parseFloat(b),h.push(new Xn(p,y,b))}const f=new Ue(s,o,a,h,l,c);return f.spread=r,f.units=n,Ut.call(this,t,f,e),f},text:function(t,e){const n=Kg(t.getAttribute("text-anchor"))||"left",r=Gg(t)||"baseline";let s="";t.childNodes.length>0&&t.childNodes[0].tagName==="TSPAN"?s=t.childNodes[0].textContent:s=t.textContent;const o=new fn(s);return Ut.call(this,t,o,e),o.alignment=n,o.baseline=r,o},clippath:function(t,e){return qe.defs.current&&!qe.defs.current.contains(t.id)&&qe.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 At("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 jr(r,s,o);return ie.isNaN(a)||(c.width=a),ie.isNaN(l)||(c.height=l),Ut.call(this,t,c,e),c}};function xc(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 _o=class Bn extends Un{constructor(e,n,r,s,o,a){super(n,r,s||1,o||1),v(this,"_flagTexture",!1),v(this,"_flagMode",!1),v(this,"_texture",null),v(this,"_mode","fill"),this._renderer.type="image";for(let l in vc)Object.defineProperty(this,l,vc[l]);this.noStroke(),this.noFill(),e instanceof Oe?this.texture=e:typeof e=="string"&&(this.texture=new Oe(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 re(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}};v(_o,"Modes",{fill:"fill",fit:"fit",crop:"crop",tile:"tile",stretch:"stretch"}),v(_o,"Properties",["texture","mode"]);var kc=_o,vc={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}}},wo=[],xo=Math.max,ip=Math.min,Cc=Math.abs,Zr=Math.sin,Qr=Math.cos,rp=Math.acos,Jr=Math.sqrt,Pe={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 Pe?t:"path"},group:{renderChild:function(t){const e=Pe.getRendererType(t._renderer.type);Pe[e].render.call(t,this.ctx,!0,this.clip)},render:function(t){if(!this._visible)return this;ie.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=es(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=Pe.getRendererType(r._renderer.type);Pe[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=Pe.getRendererType(l._renderer.type);Pe[c].render.call(l,t)}return o&&t.restore(),ie.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},path:{render:function(t,e,n){let r,s,o,a,l,c,d,u,h,f,g,m,p,y,b,_,B,x,N,R,w,C,k,T,$,P,E,W,A,Z,te,D,H,L;if(L=this.parent&&this.parent._renderer?this.parent._renderer.opacity:1,A=this._mask,Z=this._clip,l=this._opacity*(L||1),c=this._visible,!e&&(!c||Z||l===0))return this;if(ie.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,u=this._join,h=this._miter,f=this._closed,g=this._renderer.vertices,m=g.length,p=m-1,te=es(r),H=this.dashes,te||(t.save(),t.transform(r[0],r[3],r[1],r[4],r[2],r[5])),A){const ee=Pe.getRendererType(A._renderer.type);Pe[ee].render.call(A,t,!0)}if(a)if(typeof a=="string")t.fillStyle=a;else{const ee=Pe.getRendererType(a._renderer.type);Pe[ee].render.call(a,t,this),t.fillStyle=a._renderer.effect}if(s){if(typeof s=="string")t.strokeStyle=s;else{const ee=Pe.getRendererType(s._renderer.type);Pe[ee].render.call(s,t,this),t.strokeStyle=s._renderer.effect}o&&(t.lineWidth=hn(this)),h&&(t.miterLimit=h),u&&(t.lineJoin=u),!f&&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 M,O,Y,U,V,j,q;for(let ee=0;ee<m;ee++)switch(_=g[ee],E=_.x,W=_.y,_.command){case se.close:t.closePath();break;case se.arc:M=_.rx,O=_.ry,Y=_.xAxisRotation,U=_.largeArcFlag,V=_.sweepFlag,y=f?Dt(ee-1,m):xo(ee-1,0),b=g[y],j=b.x,q=b.y,Pe.renderSvgArcCommand(t,j,q,M,O,U,V,Y,E,W);break;case se.curve:y=f?Dt(ee-1,m):Math.max(ee-1,0),b=g[y],k=b.controls&&b.controls.right||re.zero,T=_.controls&&_.controls.left||re.zero,b._relative?(w=k.x+b.x,C=k.y+b.y):(w=k.x,C=k.y),_._relative?(N=T.x+_.x,R=T.y+_.y):(N=T.x,R=T.y),t.bezierCurveTo(w,C,N,R,E,W),ee>=p&&f&&(B=x,$=_.controls&&_.controls.right||re.zero,P=B.controls&&B.controls.left||re.zero,_._relative?(w=$.x+_.x,C=$.y+_.y):(w=$.x,C=$.y),B._relative?(N=P.x+B.x,R=P.y+B.y):(N=P.x,R=P.y),E=B.x,W=B.y,t.bezierCurveTo(w,C,N,R,E,W));break;case se.line:t.lineTo(E,W);break;case se.move:x=_,t.moveTo(E,W);break}return f&&t.closePath(),!Z&&!n&&(Pe.isHidden.test(a)||(D=a._renderer&&a._renderer.offset,D&&(t.save(),t.translate(-a._renderer.offset.x,-a._renderer.offset.y),t.scale(a._renderer.scale.x,a._renderer.scale.y)),t.fill(),D&&t.restore()),Pe.isHidden.test(s)||(D=s._renderer&&s._renderer.offset,D&&(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(),D&&t.restore())),te||t.restore(),Z&&!n&&t.clip(),H&&H.length>0&&t.setLineDash(wo),ie.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},points:{render:function(t,e,n){let r,s,o,a,l,c,d,u,h,f,g,m,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(ie.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update(),r=this._matrix.elements,s=this._stroke,o=this._linewidth,a=this._fill,u=this._renderer.collection,h=u.length,p=es(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 N=Pe.getRendererType(a._renderer.type);Pe[N].render.call(a,t,this),t.fillStyle=a._renderer.effect}if(s){if(typeof s=="string")t.strokeStyle=s;else{const N=Pe.getRendererType(s._renderer.type);Pe[N].render.call(s,t,this),t.strokeStyle=s._renderer.effect}o&&(t.lineWidth=hn(this))}typeof l=="number"&&(t.globalAlpha=l),b&&b.length>0&&(t.lineDashOffset=b.offset||0,t.setLineDash(b)),t.beginPath();let B=d*.5,x;this._sizeAttenuation||(x=this.worldMatrix.elements,x=li(x[0],x[3],x[1],x[4],x[2],x[5]),B/=Math.max(x.scaleX,x.scaleY));for(let N=0;N<h;N++)f=u[N],g=f.x,m=f.y,t.moveTo(g+B,m),t.arc(g,m,B,0,gt);return n||(Pe.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()),Pe.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(wo),ie.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;ie.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();const c=this._matrix.elements,d=this._stroke,u=this._linewidth,h=this._fill,f=this._decoration,g=this._direction,m=es(c),p=h._renderer&&h._renderer.offset&&d._renderer&&d._renderer.offset,y=this.dashes,b=Pe.alignments[this._alignment]||this._alignment,_=Pe.baselines[this._baseline]||this._baseline;let B,x,N,R,w,C,k,T,$,P,E;if(m||(t.save(),t.transform(c[0],c[3],c[1],c[4],c[2],c[5])),a){const W=Pe.getRendererType(a._renderer.type);Pe[W].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,h)if(typeof h=="string")t.fillStyle=h;else{const W=Pe.getRendererType(h._renderer.type);Pe[W].render.call(h,t,this),t.fillStyle=h._renderer.effect}if(d){if(typeof d=="string")t.strokeStyle=d;else{const W=Pe.getRendererType(d._renderer.type);Pe[W].render.call(d,t,this),t.strokeStyle=d._renderer.effect}u&&(t.lineWidth=hn(this))}if(typeof s=="number"&&(t.globalAlpha=s),y&&y.length>0&&(t.lineDashOffset=y.offset||0,t.setLineDash(y)),!l&&!n&&(Pe.isHidden.test(h)||(h._renderer&&h._renderer.offset?(C=h._renderer.scale.x,k=h._renderer.scale.y,t.save(),t.translate(-h._renderer.offset.x,-h._renderer.offset.y),t.scale(C,k),B=this._size/h._renderer.scale.y,x=this._leading/h._renderer.scale.y,t.font=[this._style,this._weight,B+"px/",x+"px",this._family].join(" "),N=h._renderer.offset.x/h._renderer.scale.x,R=h._renderer.offset.y/h._renderer.scale.y,t.fillText(this.value,N,R),t.restore()):t.fillText(this.value,0,0)),Pe.isHidden.test(d)||(d._renderer&&d._renderer.offset?(C=d._renderer.scale.x,k=d._renderer.scale.y,t.save(),t.translate(-d._renderer.offset.x,-d._renderer.offset.y),t.scale(C,k),B=this._size/d._renderer.scale.y,x=this._leading/d._renderer.scale.y,t.font=[this._style,this._weight,B+"px/",x+"px",this._family].join(" "),N=d._renderer.offset.x/d._renderer.scale.x,R=d._renderer.offset.y/d._renderer.scale.y,w=u/d._renderer.scale.x,t.lineWidth=w,t.strokeText(this.value,N,R),t.restore()):t.strokeText(this.value,0,0))),/(underline|strikethrough)/i.test(f)){const W=t.measureText(this.value);let A=1;switch(f){case"underline":$=W.actualBoundingBoxDescent,E=W.actualBoundingBoxDescent;break;case"strikethrough":$=0,E=0,A=.5;break}switch(_){case"top":$+=this._size*A,E+=this._size*A;break;case"baseline":case"bottom":$-=this._size*A,E-=this._size*A;break}switch(b){case"left":case"start":T=0,P=W.width;break;case"right":case"end":T=-W.width,P=0;break;default:T=-W.width/2,P=W.width/2}t.lineWidth=Math.max(Math.floor(this._size/15),1),t.strokeStyle=t.fillStyle,t.beginPath(),t.moveTo(T,$),t.lineTo(P,E),t.stroke()}return m||t.restore(),l&&!n&&t.clip(),y&&y.length>0&&t.setLineDash(wo),ie.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},"linear-gradient":{render:function(t,e){if(e){if(ie.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 ie.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}}},"radial-gradient":{render:function(t,e){if(e){if(ie.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 ie.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}}},texture:{render:function(t){ie.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 re||(this._renderer.offset=new re),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 re?(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 re||(this._renderer.scale=new re),this._scale instanceof re?this._renderer.scale.copy(this._scale):this._renderer.scale.set(this._scale,this._scale)),ie.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=Cc(r),s=Cc(s);const u=(e-c)/2,h=(n-d)/2,f=Qr(l)*u+Zr(l)*h,g=-Zr(l)*u+Qr(l)*h,m=f*f,p=g*g;let y=r*r,b=s*s;const _=m/y+p/b;if(_>1){const W=Jr(_);r=W*r,s=W*s,y=r*r,b=s*s}const B=y*p+b*m,x=(y*b-B)/B;let N=Jr(xo(0,x));o===a&&(N=-N);const R=N*r*g/s,w=-N*s*f/r,C=Qr(l)*R-Zr(l)*w+(e+c)/2,k=Zr(l)*R+Qr(l)*w+(n+d)/2,T=Sc(1,0,(f-R)/r,(g-w)/s),$=Sc((f-R)/r,(g-w)/s,(-f-R)/r,(-g-w)/s)%gt,P=T+$;sp(t,C,k,r,s,T,P,a===0,l)}},yt=class extends Q{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 ct,this.scene.parent=this}setSize(t,e,n){return this.width=t,this.height=e,this.ratio=typeof n>"u"?Zs(this.ctx):n,this.domElement.width=t*this.ratio,this.domElement.height=e*this.ratio,this.domElement.style&&ie.extend(this.domElement.style,{width:t+"px",height:e+"px"}),this.trigger(Q.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),Pe.group.render.call(this.scene,this.ctx),t||this.ctx.restore(),this}};v(yt,"Utils",Pe);function sp(t,e,n,r,s,o,a,l,c){const d=a-o,u=Oi.Tolerance.epsilon,h=Math.abs(d)<u;let f=Dt(d,gt);f<u&&(h?f=0:f=gt),l===!0&&!h&&(f===gt?f=-gt:f=f-gt);for(let g=0;g<Tt.Resolution;g++){const m=g/(Tt.Resolution-1),p=o+m*f;let y=e+r*Math.cos(p),b=n+s*Math.sin(p);if(c!==0){const _=Math.cos(c),B=Math.sin(c),x=y-e,N=b-n;y=x*_-N*B+e,b=x*B+N*_+n}t.lineTo(y,b)}}function Sc(t,e,n,r){const s=t*n+e*r,o=Jr(t*t+e*e)*Jr(n*n+r*r);let a=rp(xo(-1,ip(1,s/o)));return t*r-e*n<0&&(a=-a),a}function es(t){return t[0]===1&&t[3]===0&&t[1]===0&&t[4]===1&&t[2]===0&&t[5]===0}var de={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(de.ns,n);return n==="svg"&&(e=ie.defaults(e||{},{version:de.version})),e&&Object.keys(e).length>0&&de.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(de.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?Dt(a-1,n):Math.max(a-1,0),d=t[c];let u,h,f,g,m,p,y,b,_,B,x,N,R,w,C,k=Me(l.x),T=Me(l.y);switch(l.command){case se.close:u=se.close;break;case se.arc:x=l.rx,N=l.ry,R=l.xAxisRotation,w=l.largeArcFlag,C=l.sweepFlag,u=se.arc+" "+x+" "+N+" "+R+" "+w+" "+C+" "+k+" "+T;break;case se.curve:y=d.controls&&d.controls.right||re.zero,b=l.controls&&l.controls.left||re.zero,d.relative?(f=Me(y.x+d.x),g=Me(y.y+d.y)):(f=Me(y.x),g=Me(y.y)),l.relative?(m=Me(b.x+l.x),p=Me(b.y+l.y)):(m=Me(b.x),p=Me(b.y)),u=(a===0?se.move:se.curve)+" "+f+" "+g+" "+m+" "+p+" "+k+" "+T;break;case se.move:s=l,u=se.move+" "+k+" "+T;break;default:u=l.command+" "+k+" "+T}a>=r&&e&&(l.command===se.curve&&(h=s,_=l.controls&&l.controls.right||l,B=h.controls&&h.controls.left||h,l.relative?(f=Me(_.x+l.x),g=Me(_.y+l.y)):(f=Me(_.x),g=Me(_.y)),h.relative?(m=Me(B.x+h.x),p=Me(B.y+h.y)):(m=Me(B.x),p=Me(B.y)),k=Me(h.x),T=Me(h.y),u+=" C "+f+" "+g+" "+m+" "+p+" "+k+" "+T),l.command!==se.close&&(u+=" Z")),o+=u+" "}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+=se.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=de.createElement("clipPath",{"clip-rule":"nonzero"})),n.parentNode===null&&e.defs.appendChild(n),n},getRendererType:function(t){return t in de?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=de.getRendererType(t._renderer.type);de[e].render.call(t,this)},render:function(t){if(!this._visible&&!this._flagVisible||this._opacity===0&&!this._flagOpacity)return this;ie.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update(),this._renderer.elem||(this._renderer.elem=de.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=de.getRendererType(s._renderer.type);de[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(de.group.appendChild,n),this._flagSubtractions&&this.subtractions.forEach(de.group.removeChild,n),this._flagOrder&&this.children.forEach(de.group.orderChild,n),this._flagMask)if(this._mask){const r=de.getRendererType(this._mask._renderer.type);de[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),ie.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},path:{render:function(t){if(this._opacity===0&&!this._flagOpacity)return this;ie.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=de.toString(this._renderer.vertices,this._closed);e.d=r}if(this._fill&&this._fill._renderer){this._renderer.hasFillEffect=!0,this._fill._update();const r=de.getRendererType(this._fill._renderer.type);de[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=de.getRendererType(this._stroke._renderer.type);de[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"]=hn(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?de.setAttributes(this._renderer.elem,e):(e.id=this._id,this._renderer.elem=de.createElement("path",e),t.appendChild(this._renderer.elem)),this._flagClip){const r=de.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=de.getRendererType(this._mask._renderer.type);de[r].render.call(this._mask,t),this._renderer.elem.setAttribute("clip-path","url(#"+this._mask.id+")")}else this._renderer.elem.removeAttribute("clip-path");return ie.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},points:{render:function(t){if(this._opacity===0&&!this._flagOpacity)return this;ie.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=li(o[0],o[3],o[1],o[4],o[2],o[5]);r/=Math.max(a.scaleX,a.scaleY)}const s=de.pointsToString(this._renderer.collection,r);e.d=s}if(this._fill&&this._fill._renderer){this._renderer.hasFillEffect=!0,this._fill._update();const r=de.getRendererType(this._fill._renderer.type);de[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=de.getRendererType(this._stroke._renderer.type);de[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"]=hn(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?de.setAttributes(this._renderer.elem,e):(e.id=this._id,this._renderer.elem=de.createElement("path",e),t.appendChild(this._renderer.elem)),ie.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"]=de.alignments[this._alignment]||this._alignment),this._flagBaseline&&(e["dominant-baseline"]=de.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=de.getRendererType(this._fill._renderer.type);de[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=de.getRendererType(this._stroke._renderer.type);de[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"]=hn(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?de.setAttributes(this._renderer.elem,e):(e.id=this._id,this._renderer.elem=de.createElement("text",e),t.appendChild(this._renderer.elem)),this._flagClip){const r=de.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=de.getRendererType(this._mask._renderer.type);de[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){ie.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?de.setAttributes(this._renderer.elem,n):(n.id=this._id,this._renderer.elem=de.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?de.setAttributes(o._renderer.elem,a):o._renderer.elem=de.createElement("stop",a),r&&this._renderer.elem.appendChild(o._renderer.elem),o.flagReset()}}return ie.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},"radial-gradient":{render:function(t,e){ie.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?de.setAttributes(this._renderer.elem,n):(n.id=this._id,this._renderer.elem=de.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?de.setAttributes(o._renderer.elem,a):o._renderer.elem=de.createElement("stop",a),r&&this._renderer.elem.appendChild(o._renderer.elem),o.flagReset()}}return ie.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},texture:{render:function(t,e){ie.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 re?(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 re?(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?de.setAttributes(this._renderer.image,r):this._renderer.image=de.createElement("image",r)),this._renderer.elem?Object.keys(n).length!==0&&de.setAttributes(this._renderer.elem,n):(n.id=this._id,n.patternUnits="userSpaceOnUse",this._renderer.elem=de.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),ie.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}}},Bc=class extends Q{constructor(t){super(),this.domElement=t.domElement||de.createElement("svg"),this.scene=new ct,this.scene.parent=this,this.defs=de.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,de.setAttributes(this.domElement,{width:t,height:e}),this.trigger(Q.Types.resize,t,e)}render(){return de.group.render.call(this.scene,this.domElement),de.defs.update(this.domElement),this}};v(Bc,"Utils",de);var Kt={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 At("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,7 +100,7 @@
|
|
|
100
100
|
}
|
|
101
101
|
gl_FragColor = texel;
|
|
102
102
|
}
|
|
103
|
-
`}},ts=Li.Multiply,op=[1,0,0,0,1,0,0,0,1],Kn=new un(9),ap=yt.Utils,Tc=new re,ko=new un([0,0,1,0,0,1,0,1,1,0,1,1]),xe={precision:.9,isHidden:/(undefined|none|transparent)/i,canvas:Xe.document?Xe.document.createElement("canvas"):{getContext:function(){}},alignments:{left:"start",middle:"center",right:"end"},matrix:new Li,group:{removeChild:function(t,e){if(t.children)for(let n=0;n<t.children.length;n++)xe.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;ie.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 un(9)),this._matrix.toTransformArray(!0,Kn),ts(Kn,n._renderer.matrix,this._renderer.matrix),this._renderer.scale instanceof re||(this._renderer.scale=new re),this._scale instanceof re?(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=yt.Utils.getRendererType(this._mask._renderer.type);xe[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++)xe.group.removeChild(this.subtractions[o],t);for(o=0;o<this.children.length;o++){const a=this.children[o],l=yt.Utils.getRendererType(a._renderer.type);xe[l].render.call(a,t,e)}return this._mask&&t.disable(t.STENCIL_TEST),ie.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},path:{updateCanvas:function(t,e){let n,r,s,o,a,l,c,d,u,h,f,g,m,p;const y=e._renderer.vertices,b=this.canvas,_=this.ctx,B=t.renderer.ratio,k=Tc.copy(e._renderer.scale).multiply(B),N=e._stroke,R=e._linewidth,w=e._fill,C=e._renderer.opacity||e._opacity,x=e._cap,T=e._join,$=e._miter,F=e._closed,I=e.dashes,L=y.length,O=L-1;b.width=Math.max(Math.ceil(e._renderer.rect.width*k.x),1),b.height=Math.max(Math.ceil(e._renderer.rect.height*k.y),1);const Z=e._renderer.rect.centroid,ne=Z.x,E=Z.y;if(_.clearRect(0,0,b.width,b.height),w)if(typeof w=="string")_.fillStyle=w;else{const U=yt.Utils.getRendererType(w._renderer.type);xe[U].render.call(w,_,e),_.fillStyle=w._renderer.effect}if(N){if(typeof N=="string")_.strokeStyle=N;else{const U=yt.Utils.getRendererType(N._renderer.type);xe[U].render.call(N,_,e),_.strokeStyle=N._renderer.effect}R&&(_.lineWidth=hn(e)),$&&(_.miterLimit=$),T&&(_.lineJoin=T),!F&&x&&(_.lineCap=x)}typeof C=="number"&&(_.globalAlpha=C),I&&I.length>0&&(_.lineDashOffset=I.offset||0,_.setLineDash(I));let P,H,Y,D,X,W,V,j;_.save(),_.scale(k.x,k.y),_.translate(ne,E),_.beginPath();for(let U=0;U<y.length;U++){const ee=y[U];switch(g=ee.x,m=ee.y,ee.command){case se.close:_.closePath();break;case se.arc:H=ee.rx,Y=ee.ry,D=ee.xAxisRotation,X=ee.largeArcFlag,W=ee.sweepFlag,n=F?Dt(U-1,L):Math.max(U-1,0),r=y[n],V=r.x,j=r.y,ap.renderSvgArcCommand(_,V,j,H,Y,X,W,D,g,m);break;case se.curve:n=F?Dt(U-1,L):Math.max(U-1,0),r=y[n],d=r.controls&&r.controls.right||re.zero,u=ee.controls&&ee.controls.left||re.zero,r._relative?(l=d.x+r.x,c=d.y+r.y):(l=d.x,c=d.y),ee._relative?(o=u.x+ee.x,a=u.y+ee.y):(o=u.x,a=u.y),_.bezierCurveTo(l,c,o,a,g,m),U>=O&&F&&(s=P,h=ee.controls&&ee.controls.right||re.zero,f=s.controls&&s.controls.left||re.zero,ee._relative?(l=h.x+ee.x,c=h.y+ee.y):(l=h.x,c=h.y),s._relative?(o=f.x+s.x,a=f.y+s.y):(o=f.x,a=f.y),g=s.x,m=s.y,_.bezierCurveTo(l,c,o,a,g,m));break;case se.line:_.lineTo(g,m);break;case se.move:P=ee,_.moveTo(g,m);break}}F&&_.closePath(),xe.isHidden.test(w)||(p=w._renderer&&w._renderer.offset,p&&(_.save(),_.translate(-w._renderer.offset.x,-w._renderer.offset.y),_.scale(w._renderer.scale.x,w._renderer.scale.y)),_.fill(),p&&_.restore()),xe.isHidden.test(N)||(p=N._renderer&&N._renderer.offset,p&&(_.save(),_.translate(-N._renderer.offset.x,-N._renderer.offset.y),_.scale(N._renderer.scale.x,N._renderer.scale.y),_.lineWidth=R/N._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 u=d.x,h=d.y,f=d.controls;let g,m,p,y,b,_;o=Math.min(h,o),r=Math.min(u,r),s=Math.max(u,s),a=Math.max(h,a),d.controls&&(b=f.left,_=f.right,!(!b||!_)&&(g=d._relative?b.x+u:b.x,m=d._relative?b.y+h:b.y,p=d._relative?_.x+u:_.x,y=d._relative?_.y+h:_.y,!(!g||!m||!p||!y)&&(o=Math.min(m,y,o),r=Math.min(g,p,r),s=Math.max(g,p,s),a=Math.max(m,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;ie.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();const r=n||this.parent,s=yt.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 Ye&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagEndPoints)||this._fill instanceof Ue&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagRadius||this._fill._flagCenter||this._fill._flagFocal)||this._fill instanceof Oe&&(this._fill._flagLoaded&&this._fill.loaded||this._fill._flagImage||this._fill._flagVideo||this._fill._flagRepeat||this._fill._flagOffset||this._fill._flagScale)||this._stroke instanceof Ye&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagEndPoints)||this._stroke instanceof Ue&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagRadius||this._stroke._flagCenter||this._stroke._flagFocal)||this._stroke instanceof Oe&&(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 un(9)),this._matrix.toTransformArray(!0,Kn),ts(Kn,r._renderer.matrix,this._renderer.matrix),this._renderer.scale instanceof re||(this._renderer.scale=new re);let h,f;this._scale instanceof re?(h=this._scale.x*r._renderer.scale.x,f=this._scale.y*r._renderer.scale.y):(h=this._scale*r._renderer.scale.x,f=this._scale*r._renderer.scale.y),this._renderer.scale.x=h<0?-h:h,this._renderer.scale.y=f<0?-f:f,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 h=yt.Utils.getRendererType(this._mask._renderer.type);xe[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(d?(this._renderer.rect||(this._renderer.rect={}),this._renderer.opacity=this._opacity*r._renderer.opacity,xe.path.getBoundingClientRect(this._renderer.vertices,this._linewidth,this._renderer.rect),xe.updateTexture.call(xe,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,ko,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 u=this._renderer.rect;return t.uniformMatrix3fv(o.matrix,!1,this._renderer.matrix),t.uniform4f(o.rect,u.left,u.top,u.right,u.bottom),t.drawArrays(t.TRIANGLES,0,6),this._mask&&t.disable(t.STENCIL_TEST),ie.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,u=e.dashes,h=e._size*o;let f=h;xe.isHidden.test(a)||(f+=l),r.width=pl(f),r.height=r.width;const g=f/r.width,m=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=yt.Utils.getRendererType(c._renderer.type);xe[y].render.call(c,s,e),s.fillStyle=c._renderer.effect}if(a){if(typeof a=="string")s.strokeStyle=a;else{const y=yt.Utils.getRendererType(a._renderer.type);xe[y].render.call(a,s,e),s.strokeStyle=a._renderer.effect}l&&(s.lineWidth=hn(e)/g)}typeof d=="number"&&(s.globalAlpha=d),u&&u.length>0&&(s.lineDashOffset=u.offset||0,s.setLineDash(u)),s.save(),s.translate(m,p),s.scale(xe.precision,xe.precision),s.beginPath(),s.arc(0,0,h/g*.5,0,gt),s.restore(),closed&&s.closePath(),xe.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()),xe.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;ie.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,u=this._matrix.manual||this._flagMatrix,h=this._renderer.parent!==s,f=this._renderer.vertices,g=this._renderer.collection.length,m=this._flagVertices,p=this._flagFill||this._fill instanceof Ye&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagEndPoints)||this._fill instanceof Ue&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagRadius||this._fill._flagCenter||this._fill._flagFocal)||this._fill instanceof Oe&&(this._fill._flagLoaded&&this._fill.loaded||this._fill._flagImage||this._fill._flagVideo||this._fill._flagRepeat||this._fill._flagOffset||this._fill._flagScale)||this._stroke instanceof Ye&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagEndPoints)||this._stroke instanceof Ue&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagRadius||this._stroke._flagCenter||this._stroke._flagFocal)||this._stroke instanceof Oe&&(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||u||h){this._renderer.matrix||(this._renderer.matrix=new un(9)),this._matrix.toTransformArray(!0,Kn),ts(Kn,s._renderer.matrix,this._renderer.matrix),this._renderer.scale instanceof re||(this._renderer.scale=new re);let y,b;this._scale instanceof re?(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,h&&(this._renderer.parent=s)}if(m){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,f,t.STATIC_DRAW)}return p?(this._renderer.opacity=this._opacity*s._renderer.opacity,xe.updateTexture.call(xe,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:(xe.isHidden.test(l)||(r+=c),r/=xe.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),ie.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=Tc.copy(e._renderer.scale).multiply(s),a=e._stroke,l=e._linewidth,c=e._fill,d=e._renderer.opacity||e._opacity,u=e.dashes,h=e._decoration,f=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,m=g.x,p=g.y;let y,b,_,B,k,N,R,w,C,x,T;const $=c._renderer&&c._renderer.offset&&a._renderer&&a._renderer.offset;if(r.clearRect(0,0,n.width,n.height),$||(r.font=[e._style,e._weight,e._size+"px/"+e._leading+"px",e._family].join(" ")),r.textAlign="center",r.textBaseline="middle",r.textDirection=f,c)if(typeof c=="string")r.fillStyle=c;else{const F=yt.Utils.getRendererType(c._renderer.type);xe[F].render.call(c,r,e),r.fillStyle=c._renderer.effect}if(a){if(typeof a=="string")r.strokeStyle=a;else{const F=yt.Utils.getRendererType(a._renderer.type);xe[F].render.call(a,r,e),r.strokeStyle=a._renderer.effect}l&&(r.lineWidth=hn(e))}if(typeof d=="number"&&(r.globalAlpha=d),u&&u.length>0&&(r.lineDashOffset=u.offset||0,r.setLineDash(u)),r.save(),r.scale(o.x,o.y),r.translate(m,p),xe.isHidden.test(c)||(c._renderer&&c._renderer.offset?(N=c._renderer.scale.x,R=c._renderer.scale.y,r.save(),r.translate(-c._renderer.offset.x,-c._renderer.offset.y),r.scale(N,R),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,B=c._renderer.offset.y/c._renderer.scale.y,r.fillText(e.value,_,B),r.restore()):r.fillText(e.value,0,0)),xe.isHidden.test(a)||(a._renderer&&a._renderer.offset?(N=a._renderer.scale.x,R=a._renderer.scale.y,r.save(),r.translate(-a._renderer.offset.x,-a._renderer.offset.y),r.scale(N,R),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,B=a._renderer.offset.y/a._renderer.scale.y,k=l/a._renderer.scale.x,r.lineWidth=k,r.strokeText(e.value,_,B),r.restore()):r.strokeText(e.value,0,0)),/(underline|strikethrough)/i.test(h)){const F=r.measureText(e.value);switch(h){case"underline":C=F.actualBoundingBoxDescent,T=F.actualBoundingBoxDescent;break;case"strikethrough":C=0,T=0;break}w=-F.width/2,x=F.width/2,r.lineWidth=Math.max(Math.floor(e._size/15),1),r.strokeStyle=r.fillStyle,r.beginPath(),r.moveTo(w,C),r.lineTo(x,T),r.stroke()}r.restore()},getBoundingClientRect:function(t,e){const n=xe.ctx;n.font=[t._style,t._weight,t._size+"px/"+t._leading+"px",t._family].join(" "),n.textAlign="center",n.textBaseline=yt.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&&!xe.isHidden.test(this._stroke)&&(s+=this._linewidth*2,o+=this._linewidth*2);const a=s/2,l=o/2;switch(xe.alignments[t._alignment]||t._alignment){case xe.alignments.left:t.direction==="ltr"?(e.left=0,e.right=s):(e.left=-s,e.right=0);break;case xe.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;ie.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 Ye&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagEndPoints)||this._fill instanceof Ue&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagRadius||this._fill._flagCenter||this._fill._flagFocal)||this._fill instanceof Oe&&(this._fill._flagLoaded&&this._fill.loaded||this._fill._flagImage||this._fill._flagVideo||this._fill._flagRepeat||this._fill._flagOffset||this._fill._flagScale)||this._stroke instanceof Ye&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagEndPoints)||this._stroke instanceof Ue&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagRadius||this._stroke._flagCenter||this._stroke._flagFocal)||this._stroke instanceof Oe&&(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 un(9)),this._matrix.toTransformArray(!0,Kn),ts(Kn,r._renderer.matrix,this._renderer.matrix),this._renderer.scale instanceof re||(this._renderer.scale=new re);let u,h;this._scale instanceof re?(u=this._scale.x*r._renderer.scale.x,h=this._scale.y*r._renderer.scale.y):(u=this._scale*r._renderer.scale.x,h=this._scale*r._renderer.scale.y),this._renderer.scale.x=u<0?-u:u,this._renderer.scale.y=h<0?-h:h,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 u=yt.Utils.getRendererType(this._mask._renderer.type);xe[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(c?(this._renderer.rect||(this._renderer.rect={}),this._renderer.opacity=this._opacity*r._renderer.opacity,xe.text.getBoundingClientRect(this,this._renderer.rect),xe.updateTexture.call(xe,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,ko,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),ie.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},"linear-gradient":{render:function(t,e){if(!(!t.canvas.getContext("2d")||!e)){if(ie.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 ie.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}}},"radial-gradient":{render:function(t,e){if(!(!t.canvas.getContext("2d")||!e)){if(ie.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 ie.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}}},texture:{render:function(t,e){if(!t.canvas.getContext("2d"))return;ie.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 re||(this._renderer.offset=new re),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 re?(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 re||(this._renderer.scale=new re);let r,s;this._scale instanceof re?(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 ie.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},updateTexture:function(t,e){const n=yt.Utils.getRendererType(e._renderer.type);if(this[n].updateCanvas.call(xe,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(),ie.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 At("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]=xe.extensions.get(t,s)}return e},get:function(t,e){return t.getExtension(e)||t.getExtension(`MOZ_${e}`)||t.getExtension(`WEBKIT_${e}`)}},TextureRegistry:new Dr};xe.ctx=xe.canvas.getContext("2d");var $c=class extends Q{constructor(t){super();let e,n,r,s;if(this.domElement=t.domElement||document.createElement("canvas"),typeof t.offscreenElement<"u"&&(xe.canvas=t.offscreenElement,xe.ctx=xe.canvas.getContext("2d")),this.scene=new ct,this.scene.parent=this,this._renderer={type:"renderer",matrix:new un(op),scale:1,opacity:1},this._flagMatrix=!0,t=ie.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 At("unable to create a webgl context. Try using another renderer.");r=Kt.create(e,Kt.path.vertex,Kt.types.vertex),s=Kt.create(e,Kt.path.fragment,Kt.types.fragment),this.programs={current:null,buffers:{position:e.createBuffer()},resolution:{width:0,height:0,ratio:1,flagged:!1}},n=this.programs.path=xe.program.create(e,[r,s]),this.programs.text=this.programs.path,e.extensions=xe.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,ko,e.STATIC_DRAW),r=Kt.create(e,Kt.points.vertex,Kt.types.vertex),s=Kt.create(e,Kt.points.fragment,Kt.types.fragment),n=this.programs.points=xe.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"?Zs(o):n,this.domElement.width=t*this.ratio,this.domElement.height=e*this.ratio,ie.isObject(this.domElement.style)&&ie.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(Q.Types.resize,t,e,n)}render(){const t=this.ctx;return this.overdraw||t.clear(t.COLOR_BUFFER_BIT),xe.group.render.call(this.scene,t,this.programs),this._flagMatrix=!1,this.programs.resolution.flagged=!0,this}};v($c,"Utils",xe);var lp=ie.extend({Error:At,getRatio:Zs,read:qe,xhr:xc},ie,Bt,hl,fl),ve=class Ar{constructor(e){v(this,"_events",new Q),v(this,"type",""),v(this,"renderer",null),v(this,"scene",null),v(this,"width",0),v(this,"height",0),v(this,"frameCount",0),v(this,"timeDelta",0),v(this,"playing",!1);const n=ie.defaults(e||{},{fullscreen:!1,fitted:!1,width:640,height:480,type:Ar.Types.svg,autostart:!1});if(ie.each(n,function(r,s){/fullscreen/i.test(s)||/autostart/i.test(s)||(this[s]=r)},this),ie.isElement(n.domElement)){const r=n.domElement.tagName.toLowerCase();/^(CanvasRenderer-canvas|WebGLRenderer-canvas|SVGRenderer-svg)$/.test(this.type+"-"+r)||(this.type=Ar.Types[r])}this.renderer=new Ar[this.type](this),this.setPlaying(n.autostart),this.frameCount=0,n.fullscreen?(this.fit=cp.bind(this),this.fit.domElement=window,this.fit.attached=!0,ie.extend(document.body.style,{overflow:"hidden",margin:0,padding:0,top:0,left:0,right:0,bottom:0,position:"fixed"}),ie.extend(this.renderer.domElement.style,{display:"block",top:0,left:0,right:0,bottom:0,position:"fixed"}),Lt.bind(this.fit.domElement,"resize",this.fit),this.fit()):n.fitted?(this.fit=dp.bind(this),ie.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(Q.Types.resize,up.bind(this)),this.scene=this.renderer.scene,Ar.Instances.push(this),n.autostart&&hr.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,hr.init(),this.trigger(Q.Types.play)}pause(){return this.playing=!1,this.trigger(Q.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=ie.performance.now();e&&(this.timeDelta=parseFloat((n-this._lastFrame).toFixed(3))),this._lastFrame=n,this.fit&&this.fit.domElement&&!this.fit.attached&&(Lt.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(Q.Types.update,this.frameCount,this.timeDelta),this.render()}render(){return this.renderer.render(),this.trigger(Q.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 Gr(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 Se(e,n,void 0,void 0,void 0,void 0,se.move),new Se(r,s,void 0,void 0,void 0,void 0,se.line),new Se(r-a*Math.cos(l-Math.PI/4),s-a*Math.sin(l-Math.PI/4),void 0,void 0,void 0,void 0,se.line),new Se(r,s,void 0,void 0,void 0,void 0,se.move),new Se(r-a*Math.cos(l+Math.PI/4),s-a*Math.sin(l+Math.PI/4),void 0,void 0,void 0,void 0,se.line)],d=new Ne(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 Un(e,n,r,s);return this.scene.add(o),o}makeRoundedRectangle(e,n,r,s,o){const a=new Yr(e,n,r,s,o);return this.scene.add(a),a}makeCircle(e,n,r,s){const o=new qr(e,n,r,s);return this.scene.add(o),o}makeEllipse(e,n,r,s,o){const a=new Xr(e,n,r,s,o);return this.scene.add(a),a}makeStar(e,n,r,s,o){const a=new fo(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 Se(l,c))}}const r=arguments[n-1],s=new Ne(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 ho(e,n,r,s);return this.scene.add(o),o}makeArcSegment(e,n,r,s,o,a,l){const c=new so(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 re(a,l))}}const s=new uo(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 Se(c,d))}}const s=arguments[n-1],o=new Ne(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 fn(e,n,r,s);return this.add(o),o}makeLinearGradient(e,n,r,s){const o=Array.prototype.slice.call(arguments,4),a=new Ye(e,n,r,s,o);return this.add(a),a}makeRadialGradient(e,n,r){const s=Array.prototype.slice.call(arguments,3),o=new Ue(e,n,r,s);return this.add(o),o}makeSprite(e,n,r,s,o,a,l){const c=new jr(e,n,r,s,o,a);return l&&c.play(),this.add(c),c}makeImage(e,n,r,s,o,a){const l=new kc(e,n,r,s,o,a);return this.add(l),l}makeImageSequence(e,n,r,s,o){const a=new yo(e,n,r,s);return o&&a.play(),this.add(a),a}makeTexture(e,n){return new Oe(e,n)}makeGroup(e){e instanceof Array||(e=Array.prototype.slice.call(arguments));const n=new ct;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 qe))return null;const o=qe[s].call(this,e);return r?this.add(n&&o instanceof ct?o.children:o):o.parent&&o.remove(),o}load(e,n){const r=new ct;let s,o,a;const l=(function(c){for(Lt.temp.innerHTML=c,o=0;o<Lt.temp.children.length;o++)s=Lt.temp.children[o],a=this.interpret(s,!1,!1),a!==null&&r.add(a);if(typeof n=="function"){const d=Lt.temp.children.length<=1?Lt.temp.children[0]:Lt.temp.children;n(r,d)}}).bind(this);return/\.svg$/i.test(e)?(xc(e,l),r):(l(e),r)}};v(ve,"NextFrameId",Tt.NextFrameId),v(ve,"Types",Tt.Types),v(ve,"Version",Tt.Version),v(ve,"PublishDate",Tt.PublishDate),v(ve,"Identifier",Tt.Identifier),v(ve,"Resolution",Tt.Resolution),v(ve,"AutoCalculateImportedMatrices",Tt.AutoCalculateImportedMatrices),v(ve,"Instances",Tt.Instances),v(ve,"uniqueId",Tt.uniqueId),v(ve,"Anchor",Se),v(ve,"Collection",qn),v(ve,"Events",Q),v(ve,"Group",ct),v(ve,"Matrix",Li),v(ve,"Path",Ne),v(ve,"Registry",Dr),v(ve,"Element",Di),v(ve,"Shape",Yn),v(ve,"Text",fn),v(ve,"Vector",re),v(ve,"Gradient",rt),v(ve,"Image",kc),v(ve,"ImageSequence",yo),v(ve,"LinearGradient",Ye),v(ve,"RadialGradient",Ue),v(ve,"Sprite",jr),v(ve,"Stop",Xn),v(ve,"Texture",Oe),v(ve,"ArcSegment",so),v(ve,"Circle",qr),v(ve,"Ellipse",Xr),v(ve,"Line",Gr),v(ve,"Points",uo),v(ve,"Polygon",ho),v(ve,"Rectangle",Un),v(ve,"RoundedRectangle",Yr),v(ve,"Star",fo),v(ve,"CanvasRenderer",yt),v(ve,"SVGRenderer",Bc),v(ve,"WebGLRenderer",$c),v(ve,"Commands",se),v(ve,"Utils",lp);var gn=ve;function cp(){const t=document.body.getBoundingClientRect(),e=this.width=t.width,n=this.height=t.height;this.renderer.setSize(e,n,this.ratio)}function dp(){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 up(t,e){this.width=t,this.height=e,this.trigger(Q.Types.resize,t,e)}var hr=Lt.getRequestAnimationFrame();function Nc(){for(let t=0;t<gn.Instances.length;t++){const e=gn.Instances[t];e.playing&&e.update()}gn.NextFrameId=hr(Nc)}hr.init=function(){Nc(),hr.init=function(){}};let pn;typeof window<"u"?pn=window:typeof global<"u"?pn=global:typeof self<"u"&&(pn=self);let Rc;const di=Math.PI*2,dt=Math.PI*.5;function hp(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 fp(t){Rc=t}function mp(t,e){e=e&&e.identity()||new Rc;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 Gt(t,e,n){return n*(e-t)+t}function ji(t,e){for(;t<0;)t+=e;return t%e}const Pc=pn.Float32Array||Array,gp=Math.floor;function yn(t){return gp(t*1e6)/1e6}const pe={move:"M",line:"L",curve:"C",close:"Z"};class te{constructor(){S(this,"_events",{});S(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 u=a[c];u=u.handler?u.handler:u,n!==u&&l.push(u)}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}}S(te,"Types",{play:"play",pause:"pause",update:"update",render:"render",resize:"resize",change:"change",remove:"remove",insert:"insert",order:"order",load:"load"}),S(te,"Methods",["addEventListener","on","removeEventListener","off","unbind","dispatchEvent","trigger","listen","ignore"]);const Ec={x:{enumerable:!0,get:function(){return this._x},set:function(t){this._x!==t&&(this._x=t,this._bound&&this.dispatchEvent(te.Types.change))}},y:{enumerable:!0,get:function(){return this._y},set:function(t){this._y!==t&&(this._y=t,this._bound&&this.dispatchEvent(te.Types.change))}}},ht=class ht extends te{constructor(n=0,r=0){super();S(this,"_x",0);S(this,"_y",0);for(let s in Ec)Object.defineProperty(this,s,Ec[s]);this.x=n,this.y=r}static add(n,r){return new ht(n.x+r.x,n.y+r.y)}static sub(n,r){return new ht(n.x-r.x,n.y-r.y)}static subtract(n,r){return ht.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(ht.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 ht(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:yn(this.x),y:yn(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}};S(ht,"zero",new ht),S(ht,"left",new ht(-1,0)),S(ht,"right",new ht(1,0)),S(ht,"up",new ht(0,-1)),S(ht,"down",new ht(0,1));let be=ht;class Fe extends be{constructor(n=0,r=0,s=0,o=0,a=0,l=0,c=pe.move){super(n,r);S(this,"controls",{left:new be,right:new be});S(this,"_command",pe.move);S(this,"_relative",!0);S(this,"_rx",0);S(this,"_ry",0);S(this,"_xAxisRotation",0);S(this,"_largeArcFlag",0);S(this,"_sweepFlag",1);for(let u in Fc)Object.defineProperty(this,u,Fc[u]);this.command=c,this.relative=!0;const d=Fe.makeBroadcast(this);this.controls.left.set(s,o).addEventListener(te.Types.change,d),this.controls.right.set(a,l).addEventListener(te.Types.change,d)}static makeBroadcast(n){return r;function r(){n._bound&&n.dispatchEvent(te.Types.change)}}static fromObject(n){return new Fe().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 Fe().copy(this)}toObject(){return{x:yn(this.x),y:yn(this.y),command:this.command,relative:this.relative,controls:{left:this.controls.left.toObject(),right:this.controls.right.toObject()},rx:yn(this.rx),ry:yn(this.ry),xAxisRotation:yn(this.xAxisRotation),largeArcFlag:yn(this.largeArcFlag),sweepFlag:yn(this.sweepFlag)}}toString(){return JSON.stringify(this.toObject())}}const Fc={command:{enumerable:!0,get:function(){return this._command},set:function(t){this._command!==t&&(this._command=t,this._bound&&this.dispatchEvent(te.Types.change))}},relative:{enumerable:!0,get:function(){return this._relative},set:function(t){this._relative!==!!t&&(this._relative=!!t,this._bound&&this.dispatchEvent(te.Types.change))}},rx:{enumerable:!0,get:function(){return this._rx},set:function(t){this._rx!==t&&(this._rx=t,this._bound&&this.dispatchEvent(te.Types.change))}},ry:{enumerable:!0,get:function(){return this._ry},set:function(t){this._ry!==t&&(this._ry=t,this._bound&&this.dispatchEvent(te.Types.change))}},xAxisRotation:{enumerable:!0,get:function(){return this._xAxisRotation},set:function(t){this._xAxisRotation!==t&&(this._xAxisRotation=t,this._bound&&this.dispatchEvent(te.Types.change))}},largeArcFlag:{enumerable:!0,get:function(){return this._largeArcFlag},set:function(t){this._largeArcFlag!==t&&(this._largeArcFlag=t,this._bound&&this.dispatchEvent(te.Types.change))}},sweepFlag:{get:function(){return this._sweepFlag},set:function(t){this._sweepFlag!==t&&(this._sweepFlag=t,this._bound&&this.dispatchEvent(te.Types.change))}}};let pp=0;const vo={NextFrameId:null,Types:{webgl:"WebGLRenderer",svg:"SVGRenderer",canvas:"CanvasRenderer"},Version:"<%= version %>",PublishDate:"<%= publishDate %>",Identifier:"two-",Resolution:12,AutoCalculateImportedMatrices:!0,Instances:[],uniqueId:function(){return pp++}},ns={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 is(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 Vc(t,e,n,r,s,o,a,l,c){c=c||ns.RecursionLimit;const d=c+1;if(Math.abs(t-a)<.001&&Math.abs(e-l)<.001)return[new Fe(a,l)];const u=[];for(let h=0;h<d;h++){const f=h/d,g=is(f,t,n,s,a),m=is(f,e,r,o,l);u.push(new Fe(g,m))}return u}function yp(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),u=6*(t+s)-12*n,h=3*(n-t),f=9*(r-o)+3*(l-e),g=6*(e+o)-12*r,m=3*(r-e);function p(y){const b=(d*y+u)*y+h,_=(f*y+g)*y+m;return Math.sqrt(b*b+_*_)}return _p(p,0,1,c||ns.RecursionLimit)}function bp(t,e,n,r,s,o,a,l){const c=[],d=[[],[]];let u,h,f,g,m,p,y,b;for(let N=0;N<2;++N){if(N===0?(h=6*t-12*n+6*s,u=-3*t+9*n-9*s+3*a,f=3*n-3*t):(h=6*e-12*r+6*o,u=-3*e+9*r-9*o+3*l,f=3*r-3*e),Math.abs(u)<.001){if(Math.abs(h)<.001)continue;g=-f/h,0<g&&g<1&&c.push(g);continue}y=h*h-4*f*u,b=Math.sqrt(y),!(y<0)&&(m=(-h+b)/(2*u),0<m&&m<1&&c.push(m),p=(-h-b)/(2*u),0<p&&p<1&&c.push(p))}let _=c.length,B=_,k;for(;_--;)g=c[_],k=1-g,d[0][_]=k*k*k*t+3*k*k*g*n+3*k*g*g*s+g*g*g*a,d[1][_]=k*k*k*e+3*k*k*g*r+3*k*g*g*o+g*g*g*l;return d[0][B]=t,d[1][B]=e,d[0][B+1]=a,d[1][B+1]=l,d[0].length=d[1].length=B+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 _p(t,e,n,r){let s=ns.abscissas[r-2],o=ns.weights[r-2],a=.5*(n-e),l=a+e,c=0,d=r+1>>1,u=r&1?o[c++]*t(l):0;for(;c<d;){const h=a*s[c];u+=o[c++]*(t(l+h)+t(l-h))}return a*u}function wp(t,e){const n=t.length,r=n-1;for(let s=0;s<n;s++){const o=t[s],a=e?ji(s-1,n):Math.max(s-1,0),l=e?ji(s+1,n):Math.min(s+1,r),c=t[a],d=o,u=t[l];xp(c,d,u),d.command=s===0?pe.move:pe.curve}}function xp(t,e,n){const r=be.angleBetween(t,e),s=be.angleBetween(n,e);let o=be.distanceBetween(t,e),a=be.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+=dt:l-=dt,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 fr=(Bi=class extends te{constructor(){super();S(this,"_flagId",!1);S(this,"_flagClassName",!1);S(this,"_renderer",{});S(this,"_id",vo.Identifier+vo.uniqueId());S(this,"_className","");S(this,"classList",[]);for(let n in Ic)Object.defineProperty(this,n,Ic[n])}static fromObject(n){const r=new Bi().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}},S(Bi,"Properties",["renderer","id","className"]),Bi);const Ic={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 rs extends Error{constructor(n){super();S(this,"name","Two.js");S(this,"message");this.message=n}}class kp{constructor(){S(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 ss;const Ac={video:/\.(mp4|webm|ogg)$/i,image:/\.(jpe?g|png|gif|tiff|webp)$/i,effect:/texture|gradient/i};pn.document&&(ss=document.createElement("a"));const Ge=class Ge extends fr{constructor(n,r){super();S(this,"_flagSrc",!1);S(this,"_flagImage",!1);S(this,"_flagVideo",!1);S(this,"_flagLoaded",!1);S(this,"_flagRepeat",!1);S(this,"_flagOffset",!1);S(this,"_flagScale",!1);S(this,"_src","");S(this,"_image",null);S(this,"_loaded",!1);S(this,"_repeat","no-repeat");S(this,"_scale",1);S(this,"_offset",null);for(let s in Mc)Object.defineProperty(this,s,Mc[s]);if(this._renderer.type="texture",this._renderer.flagOffset=vp.bind(this),this._renderer.flagScale=Cp.bind(this),this.loaded=!1,this.repeat="no-repeat",this.offset=new be,typeof r=="function"){const s=(function(){this.unbind(te.Types.load,s),typeof r=="function"&&r()}).bind(this);this.bind(te.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 Ge().copy(n);return"id"in n&&(r.id=n.id),r}static getAbsoluteURL(n){return ss?(ss.href=n,ss.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=Ge.getAbsoluteURL(n);if(Ge.ImageRegistry.contains(r))return Ge.ImageRegistry.get(r);let s;return pn.document?Ac.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=Ge.getTag(s);n._flagImage&&(/canvas/i.test(o)?Ge.Register.canvas(n,r):(n._src=s.getAttribute("two-src")||s.src,Ge.Register[o](n,r))),n._flagSrc&&(s||(s=Ge.getImage(n.src),n.image=s),o=Ge.getTag(s),Ge.Register[o](n,r))}clone(){const n=new Ge(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 be?n.offset:new be().copy(n.offset),this.scale=typeof n.scale=="number"||n.scale instanceof be?n.scale:new be().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(te.Types.change),(this._flagSrc||this._flagImage)&&(this.loaded=!1,Ge.load(this,(function(){this.loaded=!0,this.trigger(te.Types.change).trigger(te.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}};S(Ge,"Properties",["src","loaded","repeat","scale","offset","image"]),S(Ge,"RegularExpressions",Ac),S(Ge,"ImageRegistry",new kp),S(Ge,"Register",{canvas:function(n,r){n._src="#"+n.id,Ge.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 rs("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=Ge.getAbsoluteURL(n._src),!(s&&s.getAttribute("two-src"))&&(s.setAttribute("two-src",n.src),Ge.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 rs("unable to load "+n.src)};n._src=Ge.getAbsoluteURL(n._src),n.image.getAttribute("two-src")||(n.image.setAttribute("two-src",n.src),Ge.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 Ke=Ge;const Mc={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=Ke.getTag(t);let n;switch(e){case"canvas":n="#"+t.id;break;default:n=t.src}Ke.ImageRegistry.contains(n)?this._image=Ke.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(te.Types.change,this._renderer.flagOffset),this._offset=t,this._offset.bind(te.Types.change,this._renderer.flagOffset),this._flagOffset=!0}},scale:{enumerable:!0,get:function(){return this._scale},set:function(t){this._scale instanceof be&&this._scale.unbind(te.Types.change,this._renderer.flagScale),this._scale=t,this._scale instanceof be&&this._scale.bind(te.Types.change,this._renderer.flagScale),this._flagScale=!0}}};function vp(){this._flagOffset=!0}function Cp(){this._flagScale=!0}class ui extends Array{constructor(){super();qa(this,ft,new te);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 Ft(this,ft)}set _events(n){Gh(this,ft,n)}get _bound(){return Ft(this,ft)._bound}set _bound(n){Ft(this,ft)._bound=n}addEventListener(){return Ft(this,ft).addEventListener.apply(this,arguments)}on(){return Ft(this,ft).on.apply(this,arguments)}bind(){return Ft(this,ft).bind.apply(this,arguments)}removeEventListener(){return Ft(this,ft).removeEventListener.apply(this,arguments)}off(){return Ft(this,ft).off.apply(this,arguments)}unbind(){return Ft(this,ft).unbind.apply(this,arguments)}dispatchEvent(){return Ft(this,ft).dispatchEvent.apply(this,arguments)}trigger(){return Ft(this,ft).trigger.apply(this,arguments)}listen(){return Ft(this,ft).listen.apply(this,arguments)}ignore(){return Ft(this,ft).ignore.apply(this,arguments)}pop(){const n=super.pop.apply(this,arguments);return this.trigger(te.Types.remove,[n]),n}shift(){const n=super.shift.apply(this,arguments);return this.trigger(te.Types.remove,[n]),n}push(){const n=super.push.apply(this,arguments);return this.trigger(te.Types.insert,arguments),n}unshift(){const n=super.unshift.apply(this,arguments);return this.trigger(te.Types.insert,arguments),n}splice(){const n=super.splice.apply(this,arguments);if(this.trigger(te.Types.remove,n),arguments.length>2){const r=this.slice(arguments[0],arguments[0]+arguments.length-2);this.trigger(te.Types.insert,r),this.trigger(te.Types.order)}return n}sort(){return super.sort.apply(this,arguments),this.trigger(te.Types.order),this}reverse(){return super.reverse.apply(this,arguments),this.trigger(te.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}}ft=new WeakMap;const Oc=Array.prototype.slice;function Sp(t){if(t==null)return!1;const e=t.length;return typeof e=="number"&&e>=0&&e<4294967296}const Ie={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=Oc.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=Oc.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=!Sp(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:pn.performance&&pn.performance.now?pn.performance:Date},Ot=class Ot extends fr{constructor(n,r,s){super();S(this,"_flagOffset",!0);S(this,"_flagOpacity",!0);S(this,"_flagColor",!0);S(this,"_offset",0);S(this,"_opacity",1);S(this,"_color","#fff");for(let o in zc)Object.defineProperty(this,o,zc[o]);this._renderer.type="stop",this.offset=typeof n=="number"?n:Ot.Index<=0?0:1,this.opacity=typeof s=="number"?s:1,this.color=typeof r=="string"?r:Ot.Index<=0?"#fff":"#000",Ot.Index=(Ot.Index+1)%2}static fromObject(n){const r=new Ot().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<Ot.Properties.length;r++){const s=Ot.Properties[r];s in n&&(this[s]=n[s])}return this}clone(n){const r=new Ot;return Ie.each(Ot.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",Ie.each(Ot.Properties,r=>{n[r]=this[r]},this),n}flagReset(){return this._flagOffset=this._flagColor=this._flagOpacity=!1,super.flagReset.call(this),this}};S(Ot,"Index",0),S(Ot,"Properties",["offset","opacity","color"]);let hi=Ot;const zc={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)}}},kn=class kn extends fr{constructor(n){super();S(this,"_flagStops",!1);S(this,"_flagSpread",!1);S(this,"_flagUnits",!1);S(this,"_spread","");S(this,"_units","");for(let r in Dc)Object.defineProperty(this,r,Dc[r]);this._renderer.type="gradient",this._renderer.flagStops=Bp.bind(this),this._renderer.bindStops=Tp.bind(this),this._renderer.unbindStops=$p.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 hi?o:new hi().copy(o)));const s=new kn(r).copy(n);return"id"in n&&(s.id=n.id),s}clone(n){const r=this.stops.map(o=>o.clone()),s=new kn(r);return Ie.each(kn.Properties,o=>{s[o]=this[o]},this),n&&n.add(s),s}copy(n){super.copy.call(this,n);for(let r=0;r<kn.Properties.length;r++){const s=kn.Properties[r];s in n&&(this[s]=n[s])}return this}toObject(){const n={stops:this.stops.map(r=>r.toObject())};return Ie.each(kn.Properties,r=>{n[r]=this[r]},this),n}_update(){return(this._flagSpread||this._flagStops)&&this.trigger(te.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}};S(kn,"Stop",hi),S(kn,"Properties",["spread","stops","units"]);let st=kn;const Dc={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(te.Types.insert,e).unbind(te.Types.remove,n),this._stops=new ui((t||[]).slice(0)),this._stops.bind(te.Types.insert,e).bind(te.Types.remove,n),e(this._stops)}}};function Bp(){this._flagStops=!0}function Tp(t){let e=t.length;for(;e--;)t[e].bind(te.Types.change,this._renderer.flagStops),t[e].parent=this;this._renderer.flagStops()}function $p(t){let e=t.length;for(;e--;)t[e].unbind(te.Types.change,this._renderer.flagStops),delete t[e].parent;this._renderer.flagStops()}const ti=class ti extends st{constructor(n,r,s,o,a){super(a);S(this,"_flagEndPoints",!1);S(this,"_left",null);S(this,"_right",null);for(let l in Lc)Object.defineProperty(this,l,Lc[l]);this._renderer.type="linear-gradient",this._renderer.flagEndPoints=Np.bind(this),this.left=new be,this.right=new be,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 ti().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<ti.Properties.length;r++){const s=ti.Properties[r];s in n&&(this[s]=n[s]instanceof be?n[s]:new be().copy(n[s]))}return this}clone(n){const r=this.stops.map(function(o){return o.clone()}),s=new ti(this.left._x,this.left._y,this.right._x,this.right._y,r);return Ie.each(st.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(te.Types.change),this}flagReset(){return this._flagEndPoints=!1,super.flagReset.call(this),this}};S(ti,"Stop",hi),S(ti,"Properties",["left","right"]);let $t=ti;const Lc={left:{enumerable:!0,get:function(){return this._left},set:function(t){this._left instanceof be&&this._left.unbind(te.Types.change,this._renderer.flagEndPoints),this._left=t,this._left.bind(te.Types.change,this._renderer.flagEndPoints),this._flagEndPoints=!0}},right:{enumerable:!0,get:function(){return this._right},set:function(t){this._right instanceof be&&this._right.unbind(te.Types.change,this._renderer.flagEndPoints),this._right=t,this._right.bind(te.Types.change,this._renderer.flagEndPoints),this._flagEndPoints=!0}}};function Np(){this._flagEndPoints=!0}const vn=class vn extends st{constructor(n,r,s,o,a,l){super(o);S(this,"_flagRadius",!1);S(this,"_flagCenter",!1);S(this,"_flagFocal",!1);S(this,"_radius",0);S(this,"_center",null);S(this,"_focal",null);for(let c in Hc)Object.defineProperty(this,c,Hc[c]);this._renderer.type="radial-gradient",this._renderer.flagCenter=Rp.bind(this),this._renderer.flagFocal=Pp.bind(this),this.center=new be,this.radius=typeof s=="number"?s:1,this.focal=new be,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 vn().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<vn.Properties.length;r++){const s=vn.Properties[r];s in n&&(/(center|focal)i/.test(s)?this[s]=n[s]instanceof be?n[s]:new be().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 vn(this.center._x,this.center._y,this._radius,r,this.focal._x,this.focal._y);return Ie.each(st.Properties.concat(vn.Properties),function(o){s[o]=this[o]},this),n&&n.add(s),s}toObject(){const n=super.toObject.call(this);return Ie.each(vn.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(te.Types.change),this}flagReset(){return this._flagRadius=this._flagCenter=this._flagFocal=!1,super.flagReset.call(this),this}};S(vn,"Stop",hi),S(vn,"Properties",["center","radius","focal"]);let Nt=vn;const Hc={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(te.Types.change,this._renderer.flagCenter),this._center=t,this._center.bind(te.Types.change,this._renderer.flagCenter),this._flagCenter=!0}},focal:{enumerable:!0,get:function(){return this._focal},set:function(t){this._focal&&this._focal.unbind(te.Types.change,this._renderer.flagFocal),this._focal=t,this._focal.bind(te.Types.change,this._renderer.flagFocal),this._flagFocal=!0}}};function Rp(){this._flagCenter=!0}function Pp(){this._flagFocal=!0}function Wc(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 os(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 jc(t,e,n){let r,s,o,a,l,c,d,u;const h=e.controls&&e.controls.right,f=t.controls&&t.controls.left;return r=e.x,l=e.y,s=(h||e).x,c=(h||e).y,o=(f||t).x,d=(f||t).y,a=t.x,u=t.y,h&&e._relative&&(s+=e.x,c+=e.y),f&&t._relative&&(o+=t.x,d+=t.y),yp(r,l,s,c,o,d,a,u,n)}function qc(t,e,n){let r,s,o,a,l,c,d,u;const h=e.controls&&e.controls.right,f=t.controls&&t.controls.left;return r=e.x,l=e.y,s=(h||e).x,c=(h||e).y,o=(f||t).x,d=(f||t).y,a=t.x,u=t.y,h&&e._relative&&(s+=e.x,c+=e.y),f&&t._relative&&(o+=t.x,d+=t.y),Vc(r,l,s,c,o,d,a,u,n)}function fi(t){switch(t.renderer.type){case"texture":return Ke.fromObject(t);case"gradient":return st.fromObject(t);case"linear-gradient":return $t.fromObject(t);case"radial-gradient":return Nt.fromObject(t)}return t}const Ep=Math.cos,Fp=Math.sin,Xc=Math.tan,Co=[],Pt=class Pt extends te{constructor(n,r,s,o,a,l){super();S(this,"elements",new Pc(9));S(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 w=n;let C,x,T;const $=r[0]||0,F=r[1]||0,I=r[2]||0;return C=w[0]*$+w[1]*F+w[2]*I,x=w[3]*$+w[4]*F+w[5]*I,T=w[6]*$+w[7]*F+w[8]*I,[C,x,T]}const o=n[0],a=n[1],l=n[2],c=n[3],d=n[4],u=n[5],h=n[6],f=n[7],g=n[8],m=r[0],p=r[1],y=r[2],b=r[3],_=r[4],B=r[5],k=r[6],N=r[7],R=r[8];return s=s||new Pc(9),s[0]=o*m+a*b+l*k,s[1]=o*p+a*_+l*N,s[2]=o*y+a*B+l*R,s[3]=c*m+d*b+u*k,s[4]=c*p+d*_+u*N,s[5]=c*y+d*B+u*R,s[6]=h*m+f*b+g*k,s[7]=h*p+f*_+g*N,s[8]=h*y+f*B+g*R,s}static fromObject(n){return new Pt().copy(n)}set(n,r,s,o,a,l,c,d,u){if(typeof r>"u"){const h=n;n=h[0],r=h[1],s=h[2],o=h[3],a=h[4],l=h[5],c=h[6],d=h[7],u=h[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]=u,this.trigger(te.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(te.Types.change)}identity(){return this.elements[0]=Pt.Identity[0],this.elements[1]=Pt.Identity[1],this.elements[2]=Pt.Identity[2],this.elements[3]=Pt.Identity[3],this.elements[4]=Pt.Identity[4],this.elements[5]=Pt.Identity[5],this.elements[6]=Pt.Identity[6],this.elements[7]=Pt.Identity[7],this.elements[8]=Pt.Identity[8],this.trigger(te.Types.change)}multiply(n,r,s,o,a,l,c,d,u){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(te.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,Z=a[3]*n+a[4]*r+a[5]*s,ne=a[6]*n+a[7]*r+a[8]*s;return[O,Z,ne]}const h=this.elements,f=[n,r,s,o,a,l,c,d,u],g=h[0],m=h[1],p=h[2],y=h[3],b=h[4],_=h[5],B=h[6],k=h[7],N=h[8],R=f[0],w=f[1],C=f[2],x=f[3],T=f[4],$=f[5],F=f[6],I=f[7],L=f[8];return this.elements[0]=g*R+m*x+p*F,this.elements[1]=g*w+m*T+p*I,this.elements[2]=g*C+m*$+p*L,this.elements[3]=y*R+b*x+_*F,this.elements[4]=y*w+b*T+_*I,this.elements[5]=y*C+b*$+_*L,this.elements[6]=B*R+k*x+N*F,this.elements[7]=B*w+k*T+N*I,this.elements[8]=B*C+k*$+N*L,this.trigger(te.Types.change)}inverse(n){const r=this.elements;n=n||new Pt;const s=r[0],o=r[1],a=r[2],l=r[3],c=r[4],d=r[5],u=r[6],h=r[7],f=r[8],g=f*c-d*h,m=-f*l+d*u,p=h*l-c*u;let y=s*g+o*m+a*p;return y?(y=1/y,n.elements[0]=g*y,n.elements[1]=(-f*o+a*h)*y,n.elements[2]=(d*o-a*c)*y,n.elements[3]=m*y,n.elements[4]=(f*s-a*u)*y,n.elements[5]=(-d*s+a*l)*y,n.elements[6]=p*y,n.elements[7]=(-h*s+o*u)*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=Ep(n),s=Fp(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=Xc(n);return this.multiply(1,r,0,0,1,0,0,0,1)}skewY(n){const r=Xc(n);return this.multiply(1,0,0,r,1,0,0,0,1)}toString(n){return Co.length=0,this.toTransformArray(n,Co),Co.map(yn).join(" ")}toTransformArray(n,r){const s=this.elements,o=!!r,a=s[0],l=s[1],c=s[2],d=s[3],u=s[4],h=s[5];if(n){const f=s[6],g=s[7],m=s[8];if(o){r[0]=a,r[1]=d,r[2]=f,r[3]=l,r[4]=u,r[5]=g,r[6]=c,r[7]=h,r[8]=m;return}return[a,d,f,l,u,g,c,h,m]}if(o){r[0]=a,r[1]=d,r[2]=l,r[3]=u,r[4]=c,r[5]=h;return}return[a,d,l,u,c,h]}toArray(n,r){const s=this.elements,o=!!r,a=s[0],l=s[1],c=s[2],d=s[3],u=s[4],h=s[5];if(n){const f=s[6],g=s[7],m=s[8];if(o){r[0]=a,r[1]=l,r[2]=c,r[3]=d,r[4]=u,r[5]=h,r[6]=f,r[7]=g,r[8]=m;return}return[a,l,c,d,u,h,f,g,m]}if(o){r[0]=a,r[1]=l,r[2]=c,r[3]=d,r[4]=u,r[5]=h;return}return[a,l,c,d,u,h]}toObject(){return{renderer:{type:"matrix"},elements:this.toArray(!0),manual:!!this.manual}}clone(){return new Pt().copy(this)}};S(Pt,"Identity",[1,0,0,0,1,0,0,0,1]);let mr=Pt;fp(mr);const Er=class Er extends fr{constructor(){super();S(this,"_flagMatrix",!0);S(this,"_flagScale",!1);S(this,"_matrix",null);S(this,"_worldMatrix",null);S(this,"_position",null);S(this,"_rotation",0);S(this,"_scale",1);S(this,"_skewX",0);S(this,"_skewY",0);for(let n in as)Object.defineProperty(this,n,as[n]);this._renderer.flagMatrix=Yc.bind(this),this.isShape=!0,this.matrix=new mr,this.worldMatrix=new mr,this.position=new be,this.rotation=0,this.scale=1,this.skewX=0,this.skewY=0}static fromObject(n){const r=new Er().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 as.position.get.apply(this,arguments)}set translation(n){as.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 be?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 be?n.scale:new be(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 Er;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 be?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 be?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}};S(Er,"Properties",["position","rotation","scale","skewX","skewY","matrix","worldMatrix"]);let Nn=Er;const as={position:{enumerable:!0,get:function(){return this._position},set:function(t){this._position&&this._position.unbind(te.Types.change,this._renderer.flagMatrix),this._position=t,this._position.bind(te.Types.change,this._renderer.flagMatrix),Yc.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 be&&this._scale.unbind(te.Types.change,this._renderer.flagMatrix),this._scale=t,this._scale instanceof be&&this._scale.bind(te.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 mp(this,this._worldMatrix),this._worldMatrix},set:function(t){this._worldMatrix=t}}};function Yc(){this._flagMatrix=!0}const qi=Math.min,Xi=Math.max,Vp=Math.ceil,Ip=Math.floor,Ap=new be,sn=class sn extends Nn{constructor(n,r,s,o){super();S(this,"_flagVertices",!0);S(this,"_flagLength",!0);S(this,"_flagFill",!0);S(this,"_flagStroke",!0);S(this,"_flagLinewidth",!0);S(this,"_flagOpacity",!0);S(this,"_flagVisible",!0);S(this,"_flagCap",!0);S(this,"_flagJoin",!0);S(this,"_flagMiter",!0);S(this,"_flagStrokeAttenuation",!0);S(this,"_flagMask",!1);S(this,"_flagClip",!1);S(this,"_length",0);S(this,"_fill","#fff");S(this,"_stroke","#000");S(this,"_linewidth",1);S(this,"_opacity",1);S(this,"_visible",!0);S(this,"_cap","round");S(this,"_join","round");S(this,"_miter",4);S(this,"_closed",!0);S(this,"_curved",!1);S(this,"_automatic",!0);S(this,"_beginning",0);S(this,"_ending",1);S(this,"_mask",null);S(this,"_clip",!1);S(this,"_dashes",null);S(this,"_strokeAttenuation",!0);for(let a in Uc)Object.defineProperty(this,a,Uc[a]);this._renderer.type="path",this._renderer.flagVertices=Kc.bind(this),this._renderer.bindVertices=Gc.bind(this),this._renderer.unbindVertices=Zc.bind(this),this._renderer.flagFill=Qc.bind(this),this._renderer.flagStroke=Jc.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:fi(n.fill),s=typeof n.stroke=="string"?n.stroke:fi(n.stroke),o=new sn().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 Fe?this.vertices.push(n.vertices[r].clone()):this.vertices.push(new Fe().copy(s))}}for(let r=0;r<sn.Properties.length;r++){const s=sn.Properties[r];s in n&&(this[s]=n[s])}return this}clone(n){const r=new sn;for(let s=0;s<this.vertices.length;s++)r.vertices.push(this.vertices[s].clone());for(let s=0;s<sn.Properties.length;s++){const o=sn.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()),Ie.each(sn.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,u=-1/0,h=1/0,f=-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:m}=hp(r.elements[0],r.elements[3],r.elements[1],r.elements[4],r.elements[2],r.elements[5]);typeof g=="number"&&typeof m=="number"&&(s=Math.max(g,m)*(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,m]=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[B,k]=r.multiply(b,_),N=c.controls.left.x,R=c.controls.left.y;c.relative&&(N+=c.x,R+=c.y);let[w,C]=r.multiply(N,R);const x=bp(g,m,B,k,w,C,p,y);h=qi(x.min.y-s,h),d=qi(x.min.x-s,d),u=Xi(x.max.x+s,u),f=Xi(x.max.y+s,f)}else a<=1&&(h=qi(m-s,h),d=qi(g-s,d),u=Xi(g+s,u),f=Xi(m+s,f)),h=qi(y-s,h),d=qi(p-s,d),u=Xi(p+s,u),f=Xi(y+s,f)}return{top:h,left:d,right:u,bottom:f,width:u-d,height:f-h}}getPointAt(n,r){let s,o,a,l,c,d,u,h,f,g,m,p,y,b,_,B=this.length*Math.min(Math.max(n,0),1);const k=this.vertices.length,N=k-1;let R=null,w=null;for(let E=0,P=this._lengths.length,H=0;E<P;E++){if(H+this._lengths[E]>=B){this._closed?(s=ji(E,k),o=ji(E-1,k),E===0&&(s=o,o=E)):(s=E,o=Math.min(Math.max(E-1,0),N)),R=this.vertices[s],w=this.vertices[o],B-=H,this._lengths[E]!==0?n=B/this._lengths[E]:n=0;break}H+=this._lengths[E]}if(R===null||w===null)return null;if(R){if(!w)return R}else return w;_=w.controls&&w.controls.right,b=R.controls&&R.controls.left,c=w.x,g=w.y,d=(_||w).x,m=(_||w).y,u=(b||R).x,p=(b||R).y,h=R.x,y=R.y,_&&w.relative&&(d+=w.x,m+=w.y),b&&R.relative&&(u+=R.x,p+=R.y),l=is(n,c,d,u,h),f=is(n,g,m,p,y);const C=Gt(c,d,n),x=Gt(g,m,n),T=Gt(d,u,n),$=Gt(m,p,n),F=Gt(u,h,n),I=Gt(p,y,n),L=Gt(C,T,n),O=Gt(x,$,n),Z=Gt(T,F,n),ne=Gt($,I,n);return Ie.isObject(r)?(r.x=l,r.y=f,r instanceof Fe&&(r.controls.left.x=L,r.controls.left.y=O,r.controls.right.x=Z,r.controls.right.y=ne,(typeof r.relative!="boolean"||r.relative)&&(r.controls.left.x-=l,r.controls.left.y-=f,r.controls.right.x-=l,r.controls.right.y-=f)),r.t=n,r):(a=new Fe(l,f,L-l,O-f,Z-l,ne-f,this._curved?pe.curve:pe.line),a.t=n,a)}plot(){if(this.curved)return wp(this._collection,this.closed),this;for(let n=0;n<this._collection.length;n++)this._collection[n].command=n===0?pe.move:pe.line;return this}subdivide(n){this._update();const r=this.vertices.length-1,s=this._closed||this.vertices[r]._command===pe.close;let o=this.vertices[r],a=[],l;return Ie.each(this.vertices,function(c,d){if(d<=0&&!s){o=c;return}if(c.command===pe.move){a.push(new Fe(o.x,o.y)),d>0&&(a[a.length-1].command=pe.line),o=c;return}l=qc(c,o,n),a=a.concat(l),Ie.each(l,function(u,h){h<=0&&o.command===pe.move?u.command=pe.move:u.command=pe.line}),d>=r&&(this._closed&&this._automatic&&(o=c,l=qc(c,o,n),a=a.concat(l),Ie.each(l,function(u,h){h<=0&&o.command===pe.move?u.command=pe.move:u.command=pe.line})),a.push(new Fe(c.x,c.y)),a[a.length-1].command=s?pe.close:pe.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=[]),Ie.each(this.vertices,function(c,d){if(d<=0||c.command===pe.move){a=c,this._lengths[d]=0;return}this._lengths[d]=jc(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=os(this,s*this._length),l=os(this,o*this._length),c=Vp(a),d=Ip(l);let u,h,f,g,m,p;for(this._renderer.vertices.length=0,p=0;p<n;p++)this._renderer.collection.length<=p&&this._renderer.collection.push(new Fe),p>d&&!h?(m=this._renderer.collection[p].copy(this._collection[p]),this.getPointAt(o,m),m.command=this._renderer.collection[p].command,this._renderer.vertices.push(m),h=m,f=this._collection[p-1],f&&f.controls&&(m.relative?m.controls.right.clear():m.controls.right.copy(m),f.relative?this._renderer.collection[p-1].controls.right.copy(f.controls.right).lerp(be.zero,1-m.t):this._renderer.collection[p-1].controls.right.copy(f.controls.right).lerp(f,1-m.t))):p>=c&&p<=d&&(m=this._renderer.collection[p].copy(this._collection[p]),this._renderer.vertices.push(m),p===d&&Wc(this,o)?(h=m,!r&&h.controls&&(h.relative?h.controls.right.clear():h.controls.right.copy(h))):p===c&&Wc(this,s)&&(u=m,u.command=pe.move,!r&&u.controls&&(u.relative?u.controls.left.clear():u.controls.left.copy(u))));c>0&&!u&&(p=c-1,m=this._renderer.collection[p].copy(this._collection[p]),this.getPointAt(s,m),m.command=pe.move,this._renderer.vertices.unshift(m),g=this._collection[p+1],g&&g.controls&&(m.controls.left.clear(),g.relative?this._renderer.collection[p+1].controls.left.copy(g.controls.left).lerp(be.zero,m.t):(Ap.copy(g),this._renderer.collection[p+1].controls.left.copy(g.controls.left).lerp(g,m.t))))}return Nn.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,Nn.prototype.flagReset.call(this),this}};S(sn,"Properties",["fill","stroke","linewidth","opacity","visible","cap","join","miter","closed","curved","automatic","beginning","ending","dashes","strokeAttenuation"]),S(sn,"Utils",{getCurveLength:jc});let Ae=sn;const Uc={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 st||this._fill instanceof $t||this._fill instanceof Nt||this._fill instanceof Ke)&&this._fill.unbind(te.Types.change,this._renderer.flagFill),this._fill=t,this._flagFill=!0,(this._fill instanceof st||this._fill instanceof $t||this._fill instanceof Nt||this._fill instanceof Ke)&&this._fill.bind(te.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(t){(this._stroke instanceof st||this._stroke instanceof $t||this._stroke instanceof Nt||this._stroke instanceof Ke)&&this._stroke.unbind(te.Types.change,this._renderer.flagStroke),this._stroke=t,this._flagStroke=!0,(this._stroke instanceof st||this._stroke instanceof $t||this._stroke instanceof Nt||this._stroke instanceof Ke)&&this._stroke.bind(te.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";Ie.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(te.Types.insert,e).unbind(te.Types.remove,n),t instanceof ui?this._collection=t:this._collection=new ui(t||[]),this._collection.bind(te.Types.insert,e).bind(te.Types.remove,n),e(this._collection)}},mask:{enumerable:!0,get:function(){return this._mask},set:function(t){this._mask=t,this._flagMask=!0,Ie.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 Kc(){this._flagVertices=!0,this._flagLength=!0,this.parent&&(this.parent._flagLength=!0)}function Gc(t){let e=t.length;for(;e--;)t[e].bind(te.Types.change,this._renderer.flagVertices);this._renderer.flagVertices()}function Zc(t){let e=t.length;for(;e--;)t[e].unbind(te.Types.change,this._renderer.flagVertices);this._renderer.flagVertices()}function Qc(){this._flagFill=!0}function Jc(){this._flagStroke=!0}const Mp=Math.ceil,Op=Math.floor,Cn=class Cn extends Nn{constructor(n){super();S(this,"_flagVertices",!0);S(this,"_flagLength",!0);S(this,"_flagFill",!0);S(this,"_flagStroke",!0);S(this,"_flagLinewidth",!0);S(this,"_flagOpacity",!0);S(this,"_flagVisible",!0);S(this,"_flagSize",!0);S(this,"_flagSizeAttenuation",!0);S(this,"_flagStrokeAttenuation",!0);S(this,"_length",0);S(this,"_fill","#fff");S(this,"_stroke","#000");S(this,"_linewidth",1);S(this,"_opacity",1);S(this,"_visible",!0);S(this,"_size",1);S(this,"_sizeAttenuation",!1);S(this,"_beginning",0);S(this,"_ending",1);S(this,"_dashes",null);S(this,"_strokeAttenuation",!0);S(this,"noFill",Ae.prototype.noFill);S(this,"noStroke",Ae.prototype.noStroke);S(this,"corner",Ae.prototype.corner);S(this,"center",Ae.prototype.center);S(this,"getBoundingClientRect",Ae.prototype.getBoundingClientRect);S(this,"_updateLength",Ae.prototype._updateLength);for(let r in ed)Object.defineProperty(this,r,ed[r]);this._renderer.type="points",this._renderer.flagVertices=Kc.bind(this),this._renderer.bindVertices=Gc.bind(this),this._renderer.unbindVertices=Zc.bind(this),this._renderer.flagFill=Qc.bind(this),this._renderer.flagStroke=Jc.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:fi(n.fill),s=typeof n.stroke=="string"?n.stroke:fi(n.stroke),o=new Cn().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 Fe?this.vertices.push(n.vertices[r].clone()):this.vertices.push(new Fe().copy(s))}for(let r=0;r<Cn.Properties.length;r++){const s=Cn.Properties[r];s in n&&(this[s]=n[s])}return this}clone(n){const r=new Cn;for(let s=0;s<this.vertices.length;s++)r.vertices.push(this.vertices[s].clone());for(let s=0;s<Cn.Properties.length;s++){const o=Cn.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()),Ie.each(Cn.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,u=a.y,h=Vc(l,c,l,c,d,u,d,u,n);r=r.concat(h)}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=os(this,n*this._length),o=os(this,r*this._length),a=Mp(s),l=Op(o);let c=0,d;this._renderer.vertices=[],this._renderer.collection=[];for(let u=0;u<this._collection.length;u++)u>=a&&u<=l&&(d=this._collection[u],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}};S(Cn,"Properties",["fill","stroke","linewidth","opacity","visible","size","sizeAttenuation","beginning","ending","dashes","strokeAttenuation"]);let ls=Cn;const ed={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 st||this._fill instanceof $t||this._fill instanceof Nt||this._fill instanceof Ke)&&this._fill.unbind(te.Types.change,this._renderer.flagFill),this._fill=t,this._flagFill=!0,(this._fill instanceof st||this._fill instanceof $t||this._fill instanceof Nt||this._fill instanceof Ke)&&this._fill.bind(te.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(t){(this._stroke instanceof st||this._stroke instanceof $t||this._stroke instanceof Nt||this._stroke instanceof Ke)&&this._stroke.unbind(te.Types.change,this._renderer.flagStroke),this._stroke=t,this._flagStroke=!0,(this._stroke instanceof st||this._stroke instanceof $t||this._stroke instanceof Nt||this._stroke instanceof Ke)&&this._stroke.bind(te.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(te.Types.insert,e).unbind(te.Types.remove,n),t instanceof ui?this._collection=t:this._collection=new ui(t||[]),this._collection.bind(te.Types.insert,e).bind(te.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 td extends ui{constructor(n){n=Array.isArray(n)?n:Array.prototype.slice.call(arguments);super(n);qa(this,Is,{});this.attach(n),this.on(te.Types.insert,this.attach),this.on(te.Types.remove,this.detach)}get ids(){return Ft(this,Is)}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}}Is=new WeakMap;const Vn=class Vn extends Ae{constructor(n,r,s,o,a,l,c){const d=c||vo.Resolution*3,u=[];for(let h=0;h<d;h++)u.push(new Fe);super(u,!0,!1,!0);S(this,"_flagStartAngle",!1);S(this,"_flagEndAngle",!1);S(this,"_flagInnerRadius",!1);S(this,"_flagOuterRadius",!1);S(this,"_startAngle",0);S(this,"_endAngle",di);S(this,"_innerRadius",0);S(this,"_outerRadius",0);this._renderer.type="arc-segment";for(let h in nd)Object.defineProperty(this,h,nd[h]);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 Vn().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<Vn.Properties.length;r++){const s=Vn.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=ji(n,di)===ji(r,di),l=s>0,c=this.vertices;let d=l?c.length/2:c.length,u,h=0,f,g,m,p,y,b,_,B,k;for(a?d--:l||(d-=2),f=0,g=d-1;f<d;f++){switch(m=f/g,p=c[h],y=m*(r-n)+n,b=(r-n)/d,_=o*Math.cos(y),B=o*Math.sin(y),f){case 0:u=pe.move;break;default:u=pe.curve}p.command=u,p.x=_,p.y=B,p.controls.left.clear(),p.controls.right.clear(),p.command===pe.curve&&(k=o*b/Math.PI,p.controls.left.x=k*Math.cos(y-dt),p.controls.left.y=k*Math.sin(y-dt),p.controls.right.x=k*Math.cos(y+dt),p.controls.right.y=k*Math.sin(y+dt),f===1&&p.controls.left.multiplyScalar(2),f===g&&p.controls.right.multiplyScalar(2)),h++}if(l){for(a?(c[h].command=pe.close,h++):(d--,g=d-1),f=0;f<d;f++)m=f/g,p=c[h],y=(1-m)*(r-n)+n,b=(r-n)/d,_=s*Math.cos(y),B=s*Math.sin(y),u=pe.curve,f<=0&&(u=a?pe.move:pe.line),p.command=u,p.x=_,p.y=B,p.controls.left.clear(),p.controls.right.clear(),p.command===pe.curve&&(k=s*b/Math.PI,p.controls.left.x=k*Math.cos(y+dt),p.controls.left.y=k*Math.sin(y+dt),p.controls.right.x=k*Math.cos(y-dt),p.controls.right.y=k*Math.sin(y-dt),f===1&&p.controls.left.multiplyScalar(2),f===g&&p.controls.right.multiplyScalar(2)),h++;c[h].copy(c[0]),c[h].command=pe.line}else a||(c[h].command=pe.line,c[h].x=0,c[h].y=0,h++,c[h].copy(c[0]),c[h].command=pe.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 Vn(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<Ae.Properties.length;d++){const u=Ae.Properties[d];c[u]=this[u]}return n&&n.add(c),c}toObject(){const n=super.toObject.call(this);n.renderer.type="arc-segment";for(let r=0;r<Vn.Properties.length;r++){const s=Vn.Properties[r];n[s]=this[s]}return n}};S(Vn,"Properties",["startAngle","endAngle","innerRadius","outerRadius"]);let So=Vn;const nd={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}}},Bo=Math.cos,To=Math.sin,In=class In extends Ae{constructor(n,r,s,o){const a=o?Math.max(o,2):4,l=[];for(let c=0;c<a;c++)l.push(new Fe(0,0,0,0,0,0));super(l,!0,!0,!0);S(this,"_flagRadius",!1);S(this,"_radius",0);this._renderer.type="circle";for(let c in id)Object.defineProperty(this,c,id[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 In().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<In.Properties.length;r++){const s=In.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*di,d=s*Bo(c),u=s*To(c),h=o*Bo(c-dt),f=o*To(c-dt),g=o*Bo(c+dt),m=o*To(c+dt),p=this.vertices[a];p.command=a===0?pe.move:pe.curve,p.set(d,u),p.controls.left.set(h,f),p.controls.right.set(g,m)}}return super._update.call(this),this}flagReset(){return this._flagRadius=!1,super.flagReset.call(this),this}clone(n){const r=new In(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<Ae.Properties.length;s++){const o=Ae.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<In.Properties.length;r++){const s=In.Properties[r];n[s]=this[s]}return n}};S(In,"Properties",["radius"]);let $o=In;const id={radius:{enumerable:!0,get:function(){return this._radius},set:function(t){this._radius=t,this._flagRadius=!0}}},No=Math.cos,Ro=Math.sin,An=class An extends Ae{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 Fe);super(c,!0,!0,!0);S(this,"_flagWidth",!1);S(this,"_flagHeight",!1);S(this,"_width",0);S(this,"_height",0);this._renderer.type="ellipse";for(let d in rd)Object.defineProperty(this,d,rd[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 An().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<An.Properties.length;r++){const s=An.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*di,d=s*No(c),u=o*Ro(c),h=s*r*No(c-dt),f=o*r*Ro(c-dt),g=s*r*No(c+dt),m=o*r*Ro(c+dt),p=this.vertices[a];p.command=a===0?pe.move:pe.curve,p.set(d,u),p.controls.left.set(h,f),p.controls.right.set(g,m)}}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 An(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<Ae.Properties.length;l++){const c=Ae.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<An.Properties.length;r++){const s=An.Properties[r];n[s]=this[s]}return n}};S(An,"Properties",["width","height"]);let Po=An;const rd={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}}},zp=Math.cos,Dp=Math.sin,Mn=class Mn extends Ae{constructor(n,r,s,o){o=Math.max(o||0,3);super();S(this,"_flagWidth",!1);S(this,"_flagHeight",!1);S(this,"_flagSides",!1);S(this,"_radius",0);S(this,"_width",0);S(this,"_height",0);S(this,"_sides",0);this._renderer.type="polygon";for(let a in sd)Object.defineProperty(this,a,sd[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 Mn().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<Mn.Properties.length;r++){const s=Mn.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=di*a+Math.PI/2,c=this._width*zp(l)/2,d=this._height*Dp(l)/2;o>=s?this.vertices.push(new Fe(c,d)):this.vertices[o].set(c,d),this.vertices[o].command=o===0?pe.move:pe.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 Mn(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<Ae.Properties.length;s++){const o=Ae.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<Mn.Properties.length;r++){const s=Mn.Properties[r];n[s]=this[s]}return n}};S(Mn,"Properties",["width","height","sides"]);let Eo=Mn;const sd={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}}},Ti=class Ti extends Ae{constructor(n,r,s,o){const a=[new Fe,new Fe,new Fe,new Fe];super(a,!0,!1,!0);S(this,"_flagWidth",!1);S(this,"_flagHeight",!1);S(this,"_width",0);S(this,"_height",0);S(this,"_origin",null);this._renderer.type="rectangle";for(let l in od)Object.defineProperty(this,l,od[l]);this.width=typeof s=="number"?s:1,this.height=typeof o=="number"?o:1,this.origin=new be,typeof n=="number"&&(this.translation.x=n),typeof r=="number"&&(this.translation.y=r),this._update()}static fromObject(n){const r=new Ti().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<Ti.Properties.length;r++){const s=Ti.Properties[r];s in n&&(typeof n[s]=="number"?this[s]=n[s]:this[s]instanceof be&&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 Fe),this.vertices[0].set(-n,-r).sub(this._origin).command=pe.move,this.vertices[1].set(n,-r).sub(this._origin).command=pe.line,this.vertices[2].set(n,r).sub(this._origin).command=pe.line,this.vertices[3].set(-n,r).sub(this._origin).command=pe.line,this.vertices[4]&&(this.vertices[4].set(-n,-r).sub(this._origin).command=pe.line)}return super._update.call(this),this}flagReset(){return this._flagWidth=this._flagHeight=!1,super.flagReset.call(this),this}clone(n){const r=new Ti(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<Ae.Properties.length;s++){const o=Ae.Properties[s];r[o]instanceof be?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}};S(Ti,"Properties",["width","height","origin"]);let gr=Ti;const od={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(te.Types.change,this._renderer.flagVertices),this._origin=t,this._origin.bind(te.Types.change,this._renderer.flagVertices),this._renderer.flagVertices()}}},On=class On extends Ae{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 Fe(0,0,0,0,0,0,c===0?pe.move:pe.curve));super(l);S(this,"_flagWidth",!1);S(this,"_flagHeight",!1);S(this,"_flagRadius",!1);S(this,"_width",0);S(this,"_height",0);S(this,"_radius",12);this._renderer.type="rounded-rectangle";for(let c in ad)Object.defineProperty(this,c,ad[c]);this.closed=!0,this.automatic=!1,this._renderer.flagRadius=Lp.bind(this),typeof s=="number"&&(this.width=s),typeof o=="number"&&(this.height=o),(typeof a=="number"||a instanceof be)&&(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 On().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<On.Properties.length;r++){const s=On.Properties[r];if(s in n){const o=n[s];/radius/i.test(s)?this[s]=typeof o=="number"||o instanceof be?o:new be().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 be?(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 On(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<Ae.Properties.length;l++){const c=Ae.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<On.Properties.length;r++){const s=On.Properties[r];n[s]=this[s]}return n.radius=typeof this.radius=="number"?this.radius:this.radius.toObject(),n}};S(On,"Properties",["width","height","radius"]);let Fo=On;const ad={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 be&&this._radius.unbind(te.Types.change,this._renderer.flagRadius),this._radius=t,this._radius instanceof be&&this._radius.bind(te.Types.change,this._renderer.flagRadius),this._flagRadius=!0}}};function Lp(){this._flagRadius=!0}const Hp=Math.cos,Wp=Math.sin,zn=class zn extends Ae{constructor(n,r,s,o,a){arguments.length<=3&&(o=s,s=o/2),(typeof a!="number"||a<=0)&&(a=5);super();S(this,"_flagInnerRadius",!1);S(this,"_flagOuterRadius",!1);S(this,"_flagSides",!1);S(this,"_innerRadius",0);S(this,"_outerRadius",0);S(this,"_sides",0);this._renderer.type="star";for(let l in ld)Object.defineProperty(this,l,ld[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 zn().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<zn.Properties.length;r++){const s=zn.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=di*a,c=(o%2?this._outerRadius:this._innerRadius)/2,d=c*Hp(l),u=c*Wp(l);o>=s?this.vertices.push(new Fe(d,u)):this.vertices[o].set(d,u),this.vertices[o].command=o===0?pe.move:pe.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 zn(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<Ae.Properties.length;l++){const c=Ae.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<zn.Properties.length;r++){const s=zn.Properties[r];n[s]=this[s]}return n}};S(zn,"Properties",["innerRadius","outerRadius","sides"]);let Vo=zn;const ld={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 Io;const cd=Math.min,dd=Math.max;pn.document&&(Io=document.createElement("canvas"));const kt=class kt extends Nn{constructor(n,r,s,o){super();S(this,"_flagValue",!0);S(this,"_flagFamily",!0);S(this,"_flagSize",!0);S(this,"_flagLeading",!0);S(this,"_flagAlignment",!0);S(this,"_flagBaseline",!0);S(this,"_flagStyle",!0);S(this,"_flagWeight",!0);S(this,"_flagDecoration",!0);S(this,"_flagFill",!0);S(this,"_flagStroke",!0);S(this,"_flagLinewidth",!0);S(this,"_flagOpacity",!0);S(this,"_flagVisible",!0);S(this,"_flagMask",!1);S(this,"_flagClip",!1);S(this,"_flagDirection",!0);S(this,"_flagStrokeAttenuation",!0);S(this,"_value","");S(this,"_family","sans-serif");S(this,"_size",13);S(this,"_leading",17);S(this,"_alignment","center");S(this,"_baseline","middle");S(this,"_style","normal");S(this,"_weight",500);S(this,"_decoration","none");S(this,"_direction","ltr");S(this,"_fill","#000");S(this,"_stroke","none");S(this,"_linewidth",1);S(this,"_opacity",1);S(this,"_visible",!0);S(this,"_mask",null);S(this,"_clip",!1);S(this,"_dashes",null);S(this,"_strokeAttenuation",!0);for(let a in ud)Object.defineProperty(this,a,ud[a]);if(this._renderer.type="text",this._renderer.flagFill=jp.bind(this),this._renderer.flagStroke=qp.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,!Ie.isObject(o))return this;for(let a=0;a<kt.Properties.length;a++){const l=kt.Properties[a];l in o&&(this[l]=o[l])}}static Measure(n){if(Io){const r=Io.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*kt.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:fi(n.fill),s=typeof n.stroke=="string"?n.stroke:fi(n.stroke),o=new kt().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<kt.Properties.length;r++){const s=kt.Properties[r];s in n&&(this[s]=n[s])}return this}clone(n){const r=new kt(this.value);r.translation.copy(this.translation),r.rotation=this.rotation,r.scale=this.scale;for(let s=0;s<kt.Properties.length;s++){const o=kt.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<kt.Properties.length;r++){const s=kt.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}=kt.Measure(this),u=(this._linewidth||0)/2;switch(this.alignment){case"left":s=-u,o=c+u;break;case"right":s=-(c+u),o=u;break;default:s=-(c/2+u),o=c/2+u}switch(this.baseline){case"middle":a=-(d/2+u),l=d/2+u;break;default:a=-(d+u),l=u}const[h,f]=r.multiply(s,a),[g,m]=r.multiply(s,l),[p,y]=r.multiply(o,a),[b,_]=r.multiply(o,l);return a=cd(f,m,y,_),s=cd(h,g,p,b),o=dd(h,g,p,b),l=dd(f,m,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}};S(kt,"Ratio",.6),S(kt,"Properties",["value","family","size","leading","alignment","linewidth","style","weight","decoration","direction","baseline","opacity","visible","fill","stroke","dashes","strokeAttenuation"]);let Yi=kt;const ud={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 st||this._fill instanceof $t||this._fill instanceof Nt||this._fill instanceof Ke)&&this._fill.unbind(te.Types.change,this._renderer.flagFill),this._fill=t,this._flagFill=!0,(this._fill instanceof st||this._fill instanceof $t||this._fill instanceof Nt||this._fill instanceof Ke)&&this._fill.bind(te.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(t){(this._stroke instanceof st||this._stroke instanceof $t||this._stroke instanceof Nt||this._stroke instanceof Ke)&&this._stroke.unbind(te.Types.change,this._renderer.flagStroke),this._stroke=t,this._flagStroke=!0,(this._stroke instanceof st||this._stroke instanceof $t||this._stroke instanceof Nt||this._stroke instanceof Ke)&&this._stroke.bind(te.Types.change,this._renderer.flagStroke)}},mask:{enumerable:!0,get:function(){return this._mask},set:function(t){this._mask=t,this._flagMask=!0,Ie.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 jp(){this._flagFill=!0}function qp(){this._flagStroke=!0}const Dn=class Dn extends gr{constructor(n,r,s,o){super(r,s,0,0);S(this,"_flagTextures",!1);S(this,"_flagFrameRate",!1);S(this,"_flagIndex",!1);S(this,"_amount",1);S(this,"_duration",0);S(this,"_index",0);S(this,"_startTime",0);S(this,"_playing",!1);S(this,"_firstFrame",0);S(this,"_lastFrame",0);S(this,"_loop",!0);S(this,"_textures",null);S(this,"_frameRate",0);S(this,"_origin",null);this._renderer.type="image-sequence";for(let a in hd)Object.defineProperty(this,a,hd[a]);this._renderer.flagTextures=Xp.bind(this),this._renderer.bindTextures=Yp.bind(this),this._renderer.unbindTextures=Up.bind(this),this.noStroke(),this.noFill(),Array.isArray(n)?this.textures=n.map(fd.bind(this)):typeof n=="string"&&(this.textures=[fd(n)]),this.origin=new be,this._update(),typeof o=="number"?this.frameRate=o:this.frameRate=Dn.DefaultFrameRate,this.index=0}static fromObject(n){const r=new Dn().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<Dn.Properties.length;r++){const s=Dn.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=Ie.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 Dn(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,u;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,Ie.isNaN(this._lastFrame)&&(this._lastFrame=a-1),o=Ie.performance.now()-this._startTime,u=this._lastFrame+1,l=1e3*(u-this._firstFrame)/this._frameRate,this._loop?o=o%l:o=Math.min(o,l),d=Gt(this._firstFrame,u,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 Ke))&&(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}};S(Dn,"Properties",["textures","frameRate","index","firstFrame","lastFrame","loop"]),S(Dn,"DefaultFrameRate",30);let Ao=Dn;const hd={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(te.Types.insert,e).unbind(te.Types.remove,n),this._textures=new ui((t||[]).slice(0)),this._textures.bind(te.Types.insert,e).bind(te.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 Xp(){this._flagTextures=!0}function Yp(t){let e=t.length;for(;e--;)t[e].bind(te.Types.change,this._renderer.flagTextures);this._renderer.flagTextures()}function Up(t){let e=t.length;for(;e--;)t[e].unbind(te.Types.change,this._renderer.flagTextures);this._renderer.flagTextures()}function fd(t){if(t instanceof Ke)return t;if(typeof t=="string")return new Ke(t)}const $i=class $i extends gr{constructor(n,r,s,o,a,l){super(r,s,0,0);S(this,"_flagTexture",!1);S(this,"_flagColumns",!1);S(this,"_flagRows",!1);S(this,"_flagFrameRate",!1);S(this,"_flagIndex",!1);S(this,"_amount",1);S(this,"_duration",0);S(this,"_startTime",0);S(this,"_playing",!1);S(this,"_firstFrame",0);S(this,"_lastFrame",0);S(this,"_loop",!0);S(this,"_texture",null);S(this,"_columns",1);S(this,"_rows",1);S(this,"_frameRate",0);S(this,"_index",0);S(this,"_origin",null);this._renderer.type="sprite";for(let c in md)Object.defineProperty(this,c,md[c]);this.noStroke(),this.noFill(),n instanceof Ke?this.texture=n:typeof n=="string"&&(this.texture=new Ke(n)),this.origin=new be,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=Ie.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,u,h,f,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)){h=n.image.width,f=n.image.height,o=h/r,a=f/s,c=this._amount,this.width!==o&&(this.width=o),this.height!==a&&(this.height=a),this._playing&&this._frameRate>0&&(Ie.isNaN(this._lastFrame)&&(this._lastFrame=c-1),l=Ie.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),u=Gt(this._firstFrame,g,l/d),u=Math.floor(u),u!==this._index&&(this._index=u,u>=this._lastFrame-1&&this._onLastFrame&&this._onLastFrame()));const m=this._index%r,p=Math.floor(this._index/r),y=-o*m+(h-o)/2,b=-a*p+(f-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}};S($i,"Properties",["texture","columns","rows","frameRate","index","firstFrame","lastFrame","loop"]);let Mo=$i;const md={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}}},cs=Math.min,ds=Math.max,on=class on extends Nn{constructor(n){super();S(this,"_flagAdditions",!1);S(this,"_flagSubtractions",!1);S(this,"_flagOrder",!1);S(this,"_flagOpacity",!0);S(this,"_flagBeginning",!1);S(this,"_flagEnding",!1);S(this,"_flagLength",!1);S(this,"_flagMask",!1);S(this,"_fill","#fff");S(this,"_stroke","#000");S(this,"_linewidth",1);S(this,"_opacity",1);S(this,"_visible",!0);S(this,"_cap","round");S(this,"_join","round");S(this,"_miter",4);S(this,"_closed",!0);S(this,"_curved",!1);S(this,"_automatic",!0);S(this,"_beginning",0);S(this,"_ending",1);S(this,"_length",0);S(this,"_mask",null);S(this,"_strokeAttenuation",!0);for(let r in gd)Object.defineProperty(this,r,gd[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++)pd.call(this,n[r],this)}static RemoveChildren(n){for(let r=0;r<n.length;r++)pd.call(this,n[r])}static OrderChildren(n){this._flagOrder=!0}static fromObject(n){const r=new on;for(let o=0;o<on.Properties.length;o++){const a=on.Properties[o];a in n&&(/(fill|stroke)/i.test(a)?r[a]=typeof n[a]=="string"?n[a]:fi(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 So.fromObject(o);case"circle":return $o.fromObject(o);case"element":return fr.fromObject(o);case"ellipse":return Po.fromObject(o);case"group":return on.fromObject(o);case"image":return Image.fromObject(o);case"image-sequence":return Ao.fromObject(o);case"path":return Ae.fromObject(o);case"points":return ls.fromObject(o);case"polygon":return Eo.fromObject(o);case"rectangle":return gr.fromObject(o);case"rounded-rectangle":return Fo.fromObject(o);case"shape":return Nn.fromObject(o);case"sprite":return Mo.fromObject(o);case"star":return Vo.fromObject(o);case"text":return Yi.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<on.Properties.length;r++){const s=on.Properties[r];s in n&&(this[s]=n[s])}return this}clone(n){const r=new on,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,Ie.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,u=-1/0,h=1/0,f=-1/0;const g=/texture|gradient/i;s=n?this.matrix:this.worldMatrix;for(let m=0;m<this.children.length;m++){const p=this.children[m];if(!(!p.visible||g.test(p._renderer.type))&&(r=p.getBoundingClientRect(n),o=typeof r.top!="number"||Ie.isNaN(r.top)||!isFinite(r.top),a=typeof r.left!="number"||Ie.isNaN(r.left)||!isFinite(r.left),l=typeof r.right!="number"||Ie.isNaN(r.right)||!isFinite(r.right),c=typeof r.bottom!="number"||Ie.isNaN(r.bottom)||!isFinite(r.bottom),!(o||a||l||c)))if(n){const[y,b]=s.multiply(r.left,r.top),[_,B]=s.multiply(r.right,r.top),[k,N]=s.multiply(r.left,r.bottom),[R,w]=s.multiply(r.right,r.bottom);h=cs(b,B,N,w,h),d=cs(y,_,k,R,d),u=ds(y,_,k,R,u),f=ds(b,B,N,w,f)}else h=cs(r.top,h),d=cs(r.left,d),u=ds(r.right,u),f=ds(r.bottom,f)}return{top:h,left:d,right:u,bottom:f,width:u-d,height:f-h}}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,u=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):u<c?(s.beginning=0,s.ending=0):d>c&&d<c+r?(s.beginning=(d-c)/r,s.ending=1):u>c&&u<c+r?(s.beginning=0,s.ending=(u-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}};S(on,"Children",td),S(on,"Properties",["fill","stroke","linewidth","cap","join","miter","closed","curved","automatic"]);let Rn=on;const gd={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=Rn.InsertChildren.bind(this),n=Rn.RemoveChildren.bind(this),r=Rn.OrderChildren.bind(this);this._children&&(this._children.unbind(),this._children.length>0&&n(this._children)),this._children=new td(t),this._children.bind(te.Types.insert,e),this._children.bind(te.Types.remove,n),this._children.bind(te.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,Ie.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 pd(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 us extends Ae{constructor(e,n,r,s){const o=[new Fe(e,n),new Fe(r,s)];super(o);for(let a in yd)Object.defineProperty(this,a,yd[a]);this.vertices[0].command=pe.move,this.vertices[1].command=pe.line,this.automatic=!1}}S(us,"Properties",["left","right"]);const yd={left:{enumerable:!0,get:function(){return this.vertices[0]},set:function(t){if(Ie.isObject(t))this.vertices.splice(0,1,t),this.vertices[0].command=pe.move;else{const e=new rs("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(Ie.isObject(t))this.vertices.splice(1,1,t),this.vertices[1].command=pe.line;else{const e=new rs("Two.Line.right argument is not an object.");console.warn(e.name,e.message)}}}};class Oo{constructor(e=0,n=0){this.x=e,this.y=n}}class bn{constructor(e=10,n=0,r="A"){S(this,"start",new Oo);S(this,"end",new Oo);this.width=e,this.angle=n,this.label=r}}const je={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 Gp(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 hs=i.markRaw({name:"ion-close",render:Gp}),Zp={class:"mr-3 flex flex-col gap-2"},Qp=["onClick"],Jp={class:"h-full p-2"},ey={},ty=i.defineComponent({...ey,__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.ref(!1),s=i.useTemplateRef("drawing-template-containers"),o=i.useTemplateRef("drawing-custom-template-containers"),a=e,l=c=>{r.value=!0,a("remove-custom-template",c,()=>{r.value=!1})};return i.onMounted(()=>{var c,d;(c=n.settings.templates)==null||c.forEach((u,h)=>{var g;const f=(g=s.value)==null?void 0:g.at(h);f&&a("init-draw-template",f,u)}),(d=n.settings.customTemplates)==null||d.forEach((u,h)=>{var g;const f=(g=o.value)==null?void 0:g.at(h);f&&a("init-draw-template",f,u)})}),i.watch(()=>[...n.settings.customTemplates],(c,d)=>{i.nextTick(()=>{c.forEach((u,h)=>{var f;if(!(d!=null&&d.includes(u))){const g=(f=o.value)==null?void 0:f.at(h);g&&a("init-draw-template",g,u)}}),d.length>c.length&&d.forEach((u,h)=>{var g;const f=(g=o.value)==null?void 0:g.at(h);f&&(f.innerHTML="",a("init-draw-template",f,u))})})},{deep:!0}),(c,d)=>{const u=hs;return i.openBlock(),i.createBlock(i.unref(z.NScrollbar),{style:{width:"auto"},trigger:"none",class:"max-h-[19rem] md:max-h-[40rem] w-auto"},{default:i.withCtx(()=>[i.createElementVNode("div",Zp,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(t.settings.allTemplates,(h,f)=>(i.openBlock(),i.createElementBlock("div",{key:`${h.id}-${f}`,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":f===t.selectTemplateIndex}]),onClick:g=>a("template:select",f)},[i.createElementVNode("div",Jp,[i.createElementVNode("div",{ref_for:!0,ref:h.isCustom&&h.id!==-1?"drawing-custom-template-containers":"drawing-template-containers",class:"kozyrek-preview h-full"},null,512)])],10,Qp)]),default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(h.label),1)]),_:2},1024),h.isCustom&&!h.isNewRec()?(i.openBlock(),i.createBlock(i.unref(z.NButton),{key:0,size:"tiny",quaternary:"",loading:r.value,disabled:r.value,circle:"",class:"!absolute right-0.5 top-0.5 !hidden group-hover:!flex",onClick:g=>l(f)},{default:i.withCtx(()=>[i.createVNode(u)]),_:1},8,["loading","disabled","onClick"])):i.createCommentVNode("",!0)]))),128))])]),_:1})}}}),bd=Wn(ty,[["__scopeId","data-v-afccb364"]]),ny={class:"flex gap-3 min-w-[20rem] relative"},iy={class:"kozyrek-preview w-fill h-[18rem] grow touch-none overflow-hidden rounded-lg bg-gray-200 p-2"},ry={ref:"drawing-container",class:"size-full"},sy={},_d=i.defineComponent({...sy,__name:"kozyrek-configurator-preview",props:{settings:{},value:{},selectTemplateIndex:{}},emits:["pointer:move","pointer:up","template:select","remove-custom-template"],setup(t,{emit:e}){const n=t,r=e,s=i.useTemplateRef("drawing-container");let o=[],a=[],l=[],c=null;const d=.75,u=i.computed(()=>n.value.configuratorParams.linesAngles.map((E,P)=>new bn(n.value.configuratorParams.linesWidths[P],E,`A-${P+1}`))),h=i.computed(()=>n.value.configuratorParams.colorSide==="bottom"),f=i.computed(()=>{var E,P;return n.value.configuratorParams.startTailType&&((E=n.settings.startTailConfigs)!=null&&E[n.value.configuratorParams.startTailType])?(P=n.settings.startTailConfigs)==null?void 0:P[n.value.configuratorParams.startTailType].points:[]}),g=i.computed(()=>{var P;const E=n.value.configuratorParams.endTailType!==void 0&&((P=n.settings.endTailConfigs)==null?void 0:P[n.value.configuratorParams.endTailType]);return!E||!E.points?[]:E.points.map((H,Y)=>Array.isArray(H)?new bn(H[0],H[1],`A-${Y+1}`):new bn(H.width,H.angle,`A-${Y+1}`))}),m=(E,P=!1)=>{E[0].start.x=0,E[0].start.y=0;let H=0;for(let Y=0;Y<E.length;Y++){const D=E[Y],X=E[Y-1]??new bn(0,H);H+=!P||Y>1?X.angle:0;const W=(!P||Y>0?D.angle:0)+H;if(E[Y].end.x=D.width*Math.cos(W*Math.PI/180)+E[Y].start.x,E[Y].end.y=D.width*Math.sin(W*Math.PI/180)+E[Y].start.y,Y<E.length-1){const V=Y+1;E[V].start.x=E[Y].end.x,E[V].start.y=E[Y].end.y}}return E},p=(E,P,H,Y,D=!1)=>{let X=m([...H,...Y]);P.length>0&&(X=[...m(P),...X]);let W=0,V=0,j=0,U=0;X.forEach(Te=>{W=Math.min(W,Te.start.x,Te.end.x),V=Math.min(V,Te.start.y,Te.end.y),j=Math.max(j,Te.start.x,Te.end.x),U=Math.max(U,Te.start.y,Te.end.y)});let ee,he;W===0&&V===0&&j===0&&U===0?(ee=1,he=1):(ee=E.width/Math.abs(j-W),he=(D?E.height:E.height-je.colorSideLabel.size)/Math.abs(U-V));const Be=Math.min(ee,he);return W=W<0?-W*Be:0,V=V<0?-V*Be:0,[Be,W,V]},y=E=>{const P=new ls([E]);return P._size=je.anchorPoint.size,P.fill=je.anchorPoint.color,P.stroke="transparent",P._linewidth=je.anchorPoint.strokeSize,l.push(P),P},b=(E,P)=>{if(l=[],n.settings.allowChangeFirstPoint){const H=E[0],Y=new be(H.vertices[0].x,H.vertices[0].y);Y.bind(te.Types.change,()=>{H.vertices[0].copy(Y)});const D=y(Y);P.add(D)}E.forEach((H,Y)=>{const D=E[Y+1],X=new be(H.vertices[1].x,H.vertices[1].y);X.bind(te.Types.change,()=>{H.vertices[1].copy(X),D!==void 0&&D.vertices[0].copy(X)});const W=y(X);P.add(W)})},_=E=>E*(Math.PI/180),B=(E,P,H)=>{const Y=P.vertices.length-1;E.position.x=P.vertices[Y].x,E.position.y=P.vertices[Y].y;const D=Math.atan2(P.vertices[Y].y-P.vertices[0].y,P.vertices[Y].x-P.vertices[0].x);E.rotation=_(H)+D},k=(E,P,H)=>{if(P.vertices[0]===void 0)return;E.position.x=P.vertices[0].x,E.position.y=P.vertices[0].y;const Y=P.vertices.length-1,D=Math.atan2(P.vertices[Y].y-P.vertices[0].y,P.vertices[Y].x-P.vertices[0].x);E.rotation=_(H)+D},N=(E,P,H)=>{const Y=new Rn;if(E.length===0)return Y;const D=[];return[...E].reverse().forEach((X,W)=>{W!==0&&X.angle>0&&(X.angle*=-1),D.push(X)}),E=m(D,!0),k(Y,P,E[0].angle),[P.vertices[0],P.vertices[1]].forEach(X=>{X.bind(te.Types.change,()=>{k(Y,P,E[0].angle)})}),E.forEach(X=>{const W=X.start.x*H,V=X.end.x*H,j=X.start.y*H,U=X.end.y*H,ee=new us(W,j,V,U);ee.linewidth=je.line.size,ee.stroke=je.line.color,Y.add(ee)}),Y},R=(E,P,H)=>{const Y=new Rn;return E.length===0||(E=m(E,!0),B(Y,P,E[0].angle),[P.vertices[0],P.vertices[1]].forEach(D=>{D.bind(te.Types.change,()=>{B(Y,P,E[0].angle)})}),E.forEach(D=>{const X=D.start.x*H,W=D.end.x*H,V=D.start.y*H,j=D.end.y*H,U=new us(X,V,W,j);U.linewidth=je.line.size,U.stroke=je.line.color,Y.add(U)})),Y},w=(E,P,H,Y)=>{const D=P.vertices[0].x+(P.vertices[1].x-P.vertices[0].x)/2-8*Math.sin(E.angle*Math.PI/180),X=P.vertices[0].y+(P.vertices[1].y-P.vertices[0].y)/2-8*Math.cos(E.angle*Math.PI/180),W=new Yi(E.label,D+10,X-10);let V;W.size=je.lineLabel.size,W.weight=600,W.fill=je.lineLabel.color,W.id+=1,W.rotation=je.lineLabel.rotation,Y>0&&(V=new Yi(`${E.angle}°`,P.vertices[0].x+25,P.vertices[0].y-25),V.size=je.angleLabel.size,V.weight=600,V.fill=je.angleLabel.color,V.rotation=je.angleLabel.rotation,V.id+=Y,o.push(V),H.add(V)),H.add(W),x(W,P,0,V),x(W,P,1)},C=()=>{const{size:E}=je.colorSideLabel,P=0,H=0,Y=h.value?E/2:E/2-E,D=h.value?E/2-E:E/2,X=new Rn;if(!c)return X;const W=5,V=Math.atan2(D-Y,H-P),j=[new Fe(P,Y,0,0,0,0,gn.Commands.move),new Fe(H,D,0,0,0,0,gn.Commands.line),new Fe(H-W*Math.cos(V-Math.PI/4),D-W*Math.sin(V-Math.PI/4),0,0,0,0,gn.Commands.line),new Fe(H,D,0,0,0,0,gn.Commands.move),new Fe(H-W*Math.cos(V+Math.PI/4),D-W*Math.sin(V+Math.PI/4),0,0,0,0,gn.Commands.line)],U=new Ae(j,!1,!1,!0);U.noFill(),U.cap="round",U.join="round",U.linewidth=E/7,U.stroke=je.colorSideLabel.color,X.add(U);const ee=new Yi(h.value?"Цвет снизу":"Цвет сверху",10,0);ee.size=E,ee.weight=600,ee.fill=je.colorSideLabel.color,ee.alignment="left",X.add(ee);const he=X.getBoundingClientRect();return X.position.x=(c.width-he.width)*d+10,X.position.y=h.value?c.height+he.height*2:he.height/2,X},x=(E,P,H,Y)=>{P.vertices[H].bind(te.Types.change,()=>{const D=P.vertices.length-1,X=Math.atan2(P.vertices[0].y-P.vertices[D].y,P.vertices[0].x-P.vertices[D].x)*180/Math.PI,W=P.vertices[0].x+(P.vertices[D].x-P.vertices[0].x)/2-8*Math.sin(X*Math.PI/180),V=P.vertices[0].y+(P.vertices[D].y-P.vertices[0].y)/2-8*Math.cos(X*Math.PI/180);E.position.x=W+10,E.position.y=V-10,E.rotation=-.5,Y&&(Y.position.x=P.vertices[0].x+25,Y.position.y=P.vertices[0].y-25)})},T=(E,P,H,Y,D=!1)=>{var He;if(E.clear(),H.length===0){E.update();return}const X=m(H),[W,V,j]=p(E,P,X,Y,D),U=new Rn,ee=new Array,he=new Array;D||(o=[],a=[]),X.forEach((ce,mt)=>{const $e=ce.start.x*W+V,Et=ce.end.x*W+V,Wt=ce.start.y*W+j,an=ce.end.y*W+j,Ct=new us($e,Wt,Et,an);Ct.linewidth=D?je.previewLine.size:je.line.size,Ct.stroke=D?je.previewLine.color:je.line.color,a.push(Ct),ee.push(Ct),U.add(Ct),!D&&ce.label!==""&&w(ce,Ct,U,mt)});const Be=ee.at(-1);let Te=U.getBoundingClientRect();if(!D){const ce=C();he.push(ce)}if(P.length>0){const ce=N(P,ee[0],W);U.add(ce)}if(Y.length>0&&Be){const ce=R(Y,Be,W);U.add(ce)}if(he.push(U),E.makeGroup(he),Te=U.getBoundingClientRect(),U.position.x=0-Te.left+(E.width-Te.width)/(2*(D?1:d)),U.position.y=0-Te.top+(E.height-Te.height)/(2*(D?1:d)),E.update(),!D){const ce=((He=n.value.configuratorParams)==null?void 0:He.colorSide)==="top";U.position.y=U.position.y+je.colorSideLabel.size*Number(ce),b(ee,U),E.update()}},$=(E,P)=>{if(E&&!P.isNewRec()){const H=new gn({width:E.scrollWidth,height:E.scrollHeight});H.appendTo(E),T(H,[],P.points,[],!0)}},F=()=>{c&&T(c,f.value,u.value,g.value,!1)},I=E=>E*(180/Math.PI),L=(E,P)=>{const H=E[1].x-E[0].x,Y=E[1].y-E[0].y,D=P[1].x-P[0].x,X=P[1].y-P[0].y;let W=Math.atan2(H*X-Y*D,H*D+Y*X);return W=I(W),Math.round(W)*-1},O=E=>{const P=a.map((H,Y,D)=>{const X=D[Y-1]??{vertices:[{x:-10,y:0},{x:0,y:0}]};let W=Math.ceil(H._length/E/n.settings.lineWidthStep)*n.settings.lineWidthStep;const V=o[Y-1];W<(D.length>1?n.settings.minLineWidth:n.settings.stripMinWidth)&&(W=D.length>1?n.settings.minLineWidth:n.settings.stripMinWidth),W>n.settings.maxLineWidth&&(W=n.settings.maxLineWidth);const j=L(H.vertices,X.vertices);return V&&(V.value=`${j}°`),new bn(W,j,`A-${Y+1}`)});r("pointer:move",P)},Z=E=>{let P=null,H;const Y=V=>{P=l.find(j=>{const U=j.renderer;return(U==null?void 0:U.elem)===V.target}),[H]=p(E,f.value,u.value.map(j=>j),g.value)},D=V=>{if(P){const j=P.renderer,U=j==null?void 0:j.elem;if(!U)return;const ee=U.getBoundingClientRect();P.vertices[0].x-=ee.x-(V instanceof MouseEvent?V.clientX:V.targetTouches[0].clientX)+je.anchorPoint.size/2,P.vertices[0].y-=ee.y-(V instanceof MouseEvent?V.clientY:V.targetTouches[0].clientY)+je.anchorPoint.size/2,O(H),E.update()}},X=()=>{P&&r("pointer:up",u.value),P=null},W=s.value;W&&(W.addEventListener("touchstart",Y,{passive:!0}),W.addEventListener("touchend",X,{passive:!0}),W.addEventListener("mousedown",Y),W.addEventListener("mouseup",X),W.addEventListener("mousemove",D),W.addEventListener("touchmove",D,{passive:!0}))},ne=(E,P)=>{r("remove-custom-template",E,P)};return i.onMounted(()=>{s.value&&(c=new gn({width:s.value.scrollWidth,height:s.value.scrollHeight,fullscreen:!1}).appendTo(s.value),c.scene.scale=d,c.update(),i.watch(()=>n.value,()=>{F()},{deep:!0,immediate:!0}),Z(c))}),i.onBeforeUnmount(()=>{c&&(c.clear(),c=null)}),(E,P)=>(i.openBlock(),i.createElementBlock("div",ny,[i.createVNode(bd,{"select-template-index":t.selectTemplateIndex,settings:t.settings,"onTemplate:select":P[0]||(P[0]=H=>r("template:select",H)),onInitDrawTemplate:$,onRemoveCustomTemplate:ne},null,8,["select-template-index","settings"]),i.createElementVNode("div",iy,[i.createElementVNode("div",ry,null,512)])]))}});class Ui extends K.Identity{constructor(n,r){super();S(this,"label","");S(this,"points",[]);S(this,"isCustom",!1);S(this,"id",-1);S(this,"guid","");n?(this.label=n.label,this.points=n.points.map((s,o)=>M.isArray(s)?new bn(s[0],s[1],`A-${o+1}`):new bn(s.width,s.angle,`A-${o+1}`)),this.isCustom=n.isCustom):(this.label="-- Новая конфигурация --",this.points=[new bn(0,0,"A-1")],this.isCustom=!0,this.id=r??this.id)}}class zo extends Ui{constructor(n){super(n);S(this,"isDefault");this.isDefault=n.isDefault??!1}}class wd{constructor(e){S(this,"minLineWidth");S(this,"maxLineWidth");S(this,"lineWidthStep");S(this,"minLineAngle");S(this,"maxLineAngle");S(this,"lineAngleStep");S(this,"stripMinWidth");S(this,"stripMaxWidth");S(this,"stripMinLength");S(this,"stripMaxLength");S(this,"allowShowTable");S(this,"showOnlyTemplates");S(this,"templates");S(this,"customTemplates",[]);S(this,"startTailConfigs");S(this,"endTailConfigs");S(this,"bendCountForExtended");S(this,"extendedProductCatalog");S(this,"allowChangeFirstPoint");S(this,"allowSaveTemplates");S(this,"userTemplatesPrefix");S(this,"lengthStep");S(this,"canSetDopProdaga");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 Ui(s)),this.templates.forEach((s,o)=>{s.id=o}),this.startTailConfigs=((n=e.startTailConfigs)==null?void 0:n.map(s=>new zo(s)))??[],this.endTailConfigs=((r=e.endTailConfigs)==null?void 0:r.map(s=>new zo(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.canSetDopProdaga=e.canSetDopProdaga,this.showOnlyTemplates||(this.customTemplates=e.customTemplates?Object.entries(e.customTemplates).filter(([,s])=>s.id!==-1).map(([s,o])=>{const a=new Ui(o);return a.isCustom=!0,a.id=+s,a}):[],this.customTemplates.some(s=>s.isCustom&&s.isNewRec())||this.customTemplates.push(new Ui({label:"-- Новая конфигурация --",points:[new bn(this.stripMinWidth,0,"A-1")],isCustom:!0,id:-1,guid:""})))}get allTemplates(){return[...this.templates,...this.customTemplates]}addCustomTemplate(e){if(!this.allowSaveTemplates)return;const n=this.customTemplates.findLast(s=>!s.isNewRec()),r=new Ui(e);r.isCustom=!0,r.id=n?n.id+1:0,this.customTemplates.splice(-1,0,r)}removeCustomTemplate(e){if(!this.allowSaveTemplates)return;const n=this.customTemplates.findIndex(r=>r.id===e);n!==-1&&this.customTemplates.splice(n,1)}}const oy={class:"flex flex-col gap-3"},ay={class:"grid gap-5 md:grid-cols-5"},ly={},xd=i.defineComponent({...ly,__name:"kozyrek-configurator",props:{eventEmitter:{},showSlugs:{type:Boolean},showProperties:{type:Boolean},showProductCosts:{type:[Boolean,Function]},allowNameClick:{type:[Boolean,Function]},allowPriceClick:{type:[Boolean,Function]},showPriceHistory:{type:[Boolean,Function]},showCostDate:{type:[Boolean,Function]},isProductItemSelected:{type:Function},showProductAddToCartButton:{type:[Boolean,String,Function]},showProductRequiredButton:{type:[Boolean,String,Function]},showProductEditButton:{type:[Boolean,String,Function]},currencyRates:{},productContextButtonsConfig:{type:Function},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(new wd(n.settings)),d=i.ref({linesWidths:[...n.cartItem.configuratorParams.linesWidths],linesAngles:[...n.cartItem.configuratorParams.linesAngles]}),u=i.ref({quantity:{},marker:{},length:{}}),h=i.ref(0),f=i.useTemplateRef("kozyrek-configurator-params-form"),g=(x=0)=>{var $;const T=($=c.value.allTemplates)==null?void 0:$.at(x);T!==void 0&&(h.value=x,l.value.configuratorParams.linesWidths=T.points.map(F=>M.isArray(F)?F[0]:F.width),l.value.configuratorParams.linesAngles=T.points.map(F=>M.isArray(F)?F[1]:F.angle),B()),b(l.value.configuratorParams)},m=async()=>{const x=prompt("Введите название шаблона:");if(!x)return;a.value=!0;const T={label:x,points:l.value.configuratorParams.linesWidths.map((F,I)=>[F,l.value.configuratorParams.linesAngles[I]])},$=F=>{F&&(c.value.addCustomTemplate(T),h.value=c.value.allTemplates.length-2),a.value=!1};n.eventEmitter.emit("configurator:create-template",{category:n.cartItem.category,template:T,callback:$})},p=async(x,T)=>{var I;const $=(I=c.value.allTemplates)==null?void 0:I.at(x);if(!$||!$.isCustom)return;const F=L=>{L&&(c.value.removeCustomTemplate($.id),g()),T==null||T()};n.eventEmitter.emit("configurator:remove-template",{category:n.cartItem.category,templateId:$.id,callback:F})},y=()=>{c.value.showOnlyTemplates||c.value.allowSaveTemplates&&(h.value=c.value.allTemplates.length-1)},b=async x=>{var T,$;l.value.product=new K.ClientProduct,($=(T=f.value)==null?void 0:T.formReference)==null||$.validate(F=>{F||(B(),s.value=!0,n.eventEmitter.emit("configurator:search-product",{category:n.cartItem.category,params:x,validationFieldResultData:u.value,callback:I=>{I?l.value.product=I:u.value.product={showFeedback:!0,feedback:"Не удалось найти товар по указанным параметрам.",validationStatus:"error"},s.value=!1}}))}).catch(M.noop)},_=async()=>{var x,T;(T=(x=f.value)==null?void 0:x.formReference)==null||T.validate($=>{$||(o.value=!0,r("submit",l.value,u.value,()=>{o.value=!1,i.nextTick(()=>{var F,I;(I=(F=f.value)==null?void 0:F.formReference)==null||I.restoreValidation()})}))}).catch(M.noop)},B=()=>{const x={quantity:u.value.quantity,marker:u.value.marker};l.value.configuratorParams.linesWidths.forEach((T,$)=>{x[`lines_widths[${$+1}]`]={},x[`lines_angles[${$+1}]`]={}}),u.value=x},k=x=>{d.value.linesWidths=x.map(T=>T.width),d.value.linesAngles=x.map(T=>T.angle)},N=x=>{l.value.configuratorParams.linesWidths=d.value.linesWidths,l.value.configuratorParams.linesAngles=d.value.linesAngles,B(),y(),b(l.value.configuratorParams)},R=(x,T)=>{d.value.linesWidths=x,d.value.linesAngles=T},w=x=>{const T=l.value.configuratorParams.linesWidths.length>1?c.value.minLineWidth:c.value.stripMinWidth,$=0;l.value.configuratorParams.linesWidths.splice(x+1,0,T),l.value.configuratorParams.linesAngles.splice(x+1,0,$),d.value.linesWidths=[...l.value.configuratorParams.linesWidths],d.value.linesAngles=[...l.value.configuratorParams.linesAngles],B(),y(),b(l.value.configuratorParams)},C=x=>{l.value.configuratorParams.linesWidths.length<=1||(l.value.configuratorParams.linesWidths.splice(x,1),l.value.configuratorParams.linesAngles.splice(x,1),d.value.linesWidths=[...l.value.configuratorParams.linesWidths],d.value.linesAngles=[...l.value.configuratorParams.linesAngles],B(),y(),b(l.value.configuratorParams))};return i.onBeforeMount(()=>{g()}),i.watch(()=>n.cartItem,x=>{l.value=new K.OrderItemBase(x),g()}),(x,T)=>{const $=z.NButton;return i.openBlock(),i.createElementBlock("div",oy,[t.settings.allowShowTable?(i.openBlock(),i.createBlock($,{key:0,type:"tertiary",class:"self-end",onClick:T[0]||(T[0]=F=>r("click:view-switch"))},{default:i.withCtx(()=>[...T[3]||(T[3]=[i.createTextVNode(" Показать в виде списка ",-1)])]),_:1})):i.createCommentVNode("",!0),i.createElementVNode("div",ay,[i.createVNode(_d,{value:l.value,"select-template-index":h.value,settings:c.value,class:"h-fit col-span-3","onPointer:up":N,"onPointer:move":k,"onTemplate:select":g,onRemoveCustomTemplate:p},null,8,["value","select-template-index","settings"]),i.createVNode(sl,{ref:"kozyrek-configurator-params-form",value:l.value,"onUpdate:value":T[1]||(T[1]=F=>l.value=F),"preview-params":d.value,validation:u.value,settings:c.value,"is-submit-processing":o.value,"is-product-searching":s.value,"select-template-index":h.value,class:"col-span-2","onUpdate:params":T[2]||(T[2]=F=>b(F)),"onUpdate:preview":R,onSubmit:_,"onClick:saveTemplate":m,"onClick:addLine":w,"onClick:removeLine":C},null,8,["value","preview-params","validation","settings","is-submit-processing","is-product-searching","select-template-index"])])])}}}),cy={class:"flex flex-col items-center justify-between rounded-xl"},dy={class:"img-preview relative flex justify-center"},uy={},hy=i.defineComponent({...uy,__name:"mosquito-configurator-preview",props:{configuratorParams:{},settings:{}},emits:["open-instructions"],setup(t,{emit:e}){const n=t,r=i.computed(()=>{const{height:o}=n.configuratorParams,a=M.keys(n.settings.crossbarCount).reverse().find(l=>{const c=n.settings.crossbarCount[Number(l)];return o>=c});if(a!==void 0)return String(Number(a)+1)}),s=e;return(o,a)=>{const l=z.NButton;return i.openBlock(),i.createElementBlock("div",cy,[i.createElementVNode("div",dy,[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})])}}}),Do=Wn(hy,[["__scopeId","data-v-a67fd61e"]]),fy={key:0,class:"flex items-baseline gap-1"},my={key:0,class:"flex items-baseline gap-1"},gy={key:1},py={class:"text-lg font-semibold"},yy={key:2,class:"text-red-500 text-sm mb-2"},by={class:"flex gap-3"},_y={},kd=i.defineComponent({..._y,__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,{expose:e,emit:n}){var w;const r=t,s=n,o=i.computed(()=>St.isPhoneDevice()),a=i.useTemplateRef("form-reference"),l=i.useTemplateRef("width-form-item-reference"),c=i.useTemplateRef("height-form-item-reference"),d=i.useTemplateRef("width-input-reference"),u=i.ref(M.cloneDeep(r.value)),h=i.computed(()=>r.settings.widthOverlaps[u.value.configuratorParams.mountType]??0),f=i.computed(()=>r.settings.heightOverlaps[u.value.configuratorParams.mountType]??0),g=i.computed(()=>r.settings.maxWidths[u.value.configuratorParams.netType]),m=i.computed(()=>r.settings.maxHeights[u.value.configuratorParams.netType]),p=i.computed(()=>u.value.configuratorParams.width?u.value.configuratorParams.width+h.value:0),y=i.computed(()=>u.value.configuratorParams.height?u.value.configuratorParams.height+f.value:0),b=i.ref(r.settings.canSetDopProdaga??!1),_=i.computed(()=>({"configuratorParams.width":[ae.required,ae.min(r.settings.minWidth-h.value),ae.max(g.value-h.value),ae.step(1),We.serverValidation(r.validation.width.feedback)],"configuratorParams.height":[ae.required,ae.min(r.settings.minHeight-f.value),ae.max(m.value-f.value),ae.step(1),We.serverValidation(r.validation.height.feedback)],quantity:[ae.required,ae.min(1),ae.step(1),We.serverValidation(r.validation.quantity.feedback)],marker:[We.serverValidation(r.validation.marker.feedback)]})),B=i.computed(()=>{var I;const C=p.value,x=y.value,{quantity:T}=r.value,$=((I=r.value.product)==null?void 0:I.costRub)||0;if(!C||!x||!T||$===0)return null;const F=C*x/1e6;return($*T*F).toLocaleString("ru-ru",{minimumFractionDigits:2})}),k=i.computed(()=>{const C=p.value,x=y.value,T=!!(C&&C>=r.settings.minWidth&&C<=r.settings.maxWidths[u.value.configuratorParams.netType]),$=!!(x&&x>=r.settings.minHeight&&x<=r.settings.maxHeights[u.value.configuratorParams.netType]),F=!!(r.value.quantity&&r.value.quantity>0);return T&&$&&F}),N=(C,x)=>{var F,I;const T=u.value.configuratorParams;C&&C in T&&(T[C]=x);const $={...T,width:p.value??0,height:y.value??0};C==="width"&&((F=l.value)==null||F.validate().catch(M.noop)),C==="height"&&((I=c.value)==null||I.validate().catch(M.noop)),i.nextTick(()=>{var O,Z;!((O=l.value)!=null&&O.validationErrored)&&!((Z=c.value)!=null&&Z.validationErrored)&&$.height&&$.width&&s("update:params",$),R("configuratorParams",$)})},R=(C,x)=>{const T=new K.OrderItemBase(r.value);T[C]=x,C==="configuratorParams"&&(T.product=new K.ClientProduct),s("update:value",T)};return i.watch(()=>r.value,C=>{const x=M.cloneDeep(i.toRaw(C)),T=x.configuratorParams.mountType,$=r.settings.widthOverlaps[T]??0,F=r.settings.heightOverlaps[T]??0;x.configuratorParams.width&&x.configuratorParams.width>0&&(x.configuratorParams.width-=$),x.configuratorParams.height&&x.configuratorParams.height>0&&(x.configuratorParams.height-=F),u.value=x},{deep:!0}),i.onMounted(()=>{var C;(C=d.value)==null||C.select()}),e({validate:(w=a.value)==null?void 0:w.validate,formReference:a}),(C,x)=>{const T=z.NCheckbox;return i.openBlock(),i.createBlock(i.unref(z.NForm),{ref:"form-reference",model:u.value,rules:_.value,class:"flex flex-col gap-2 px-4 md:max-w-96 sc-hide-empty-feedback-message",onKeydown:x[25]||(x[25]=i.withKeys(i.withModifiers($=>s("submit",u.value),["prevent"]),["enter"]))},{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:u.value.configuratorParams.netType,"onUpdate:value":[x[0]||(x[0]=$=>u.value.configuratorParams.netType=$),x[1]||(x[1]=$=>N("netType",$))],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:u.value.configuratorParams.color,"onUpdate:value":[x[2]||(x[2]=$=>u.value.configuratorParams.color=$),x[3]||(x[3]=$=>N("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:u.value.configuratorParams.mountType,"onUpdate:value":[x[4]||(x[4]=$=>u.value.configuratorParams.mountType=$),x[5]||(x[5]=$=>N("mountType",$))],options:t.settings.mountType.map($=>({label:t.settings.descriptions.mount_type[$],value:$}))},null,8,["value","options"])]),_:1}),i.createVNode(i.unref(z.NFormItem),{ref:"width-form-item-reference",path:"configuratorParams.width",label:`Ширина светового проёма от ${t.settings.minWidth-h.value} ${g.value?" до "+(g.value-h.value):""} мм.`},{feedback:i.withCtx(()=>[!t.validation.width.showFeedback&&p.value>=t.settings.minWidth&&p.value<=t.settings.maxWidths[u.value.configuratorParams.netType]?(i.openBlock(),i.createElementBlock("div",fy,[i.createVNode(i.unref(z.NText),{type:"success"},{default:i.withCtx(()=>[i.createTextVNode("Ширина готового изделия "+i.toDisplayString(p.value),1)]),_:1}),i.createVNode(i.unref(z.NButton),{quaternary:"",type:"info",size:"tiny",onClick:x[10]||(x[10]=$=>s("click:instructions-toggle"))},{default:i.withCtx(()=>[...x[26]||(x[26]=[i.createElementVNode("span",{class:"text-sm"},"Руководство",-1)])]),_:1})])):i.createCommentVNode("",!0)]),default:i.withCtx(()=>[i.createVNode(i.unref(z.NInputNumber),{ref:"width-input-reference",value:u.value.configuratorParams.width,"onUpdate:value":[x[6]||(x[6]=$=>u.value.configuratorParams.width=$),x[9]||(x[9]=$=>N("width",$))],parse:i.unref(lt),"show-button":!1,placeholder:"Введите высоту светового проёма",class:"w-full",onKeydown:x[7]||(x[7]=$=>i.unref(tt)($)),onInput:x[8]||(x[8]=$=>i.unref(et)(t.validation,"width")),onFocus:i.unref(Le)},null,8,["value","parse","onFocus"])]),_:1},8,["label"]),i.createVNode(i.unref(z.NFormItem),{ref:"height-form-item-reference",path:"configuratorParams.height",label:`Высота светового проёма от ${t.settings.minHeight-f.value} ${m.value?" до "+(m.value-f.value):""} мм.`},{feedback:i.withCtx(()=>[!t.validation.height.showFeedback&&y.value>=t.settings.minHeight&&y.value<=t.settings.maxHeights[u.value.configuratorParams.netType]?(i.openBlock(),i.createElementBlock("div",my,[i.createVNode(i.unref(z.NText),{type:"success"},{default:i.withCtx(()=>[i.createTextVNode("Высота готового изделия "+i.toDisplayString(y.value),1)]),_:1}),i.createVNode(i.unref(z.NButton),{quaternary:"",type:"info",size:"tiny",onClick:x[15]||(x[15]=$=>s("click:instructions-toggle"))},{default:i.withCtx(()=>[...x[27]||(x[27]=[i.createElementVNode("span",{class:"text-sm"},"Руководство",-1)])]),_:1})])):i.createCommentVNode("",!0)]),default:i.withCtx(()=>[i.createVNode(i.unref(z.NInputNumber),{value:u.value.configuratorParams.height,"onUpdate:value":[x[11]||(x[11]=$=>u.value.configuratorParams.height=$),x[14]||(x[14]=$=>N("height",$))],parse:i.unref(lt),"show-button":!1,placeholder:"Введите высоту светового проёма",class:"w-full",onKeydown:x[12]||(x[12]=$=>i.unref(tt)($)),onInput:x[13]||(x[13]=$=>i.unref(et)(t.validation,"height")),onFocus:i.unref(Le)},null,8,["value","parse","onFocus"])]),_:1},8,["label"]),i.createVNode(i.unref(z.NFormItem),{path:"quantity",label:"Количество"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInputNumber),{value:u.value.quantity,"onUpdate:value":[x[16]||(x[16]=$=>u.value.quantity=$),x[19]||(x[19]=$=>R("quantity",$??0))],"show-button":!1,placeholder:"Введите количество",class:"w-full",onKeydown:x[17]||(x[17]=$=>i.unref(tt)($,!1)),onInput:x[18]||(x[18]=$=>i.unref(et)(t.validation,"quantity")),onFocus:i.unref(Le)},null,8,["value","onFocus"])]),_:1}),i.createVNode(i.unref(z.NFormItem),{path:"marker",label:"Маркировка"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInput),{value:u.value.marker??null,placeholder:"Введите маркировку",onInput:x[20]||(x[20]=$=>i.unref(et)(t.validation,"marker")),"onUpdate:value":x[21]||(x[21]=$=>{u.value.marker=$??null,R("marker",$??null)}),onFocus:i.unref(Le)},null,8,["value","onFocus"])]),_:1}),b.value?(i.openBlock(),i.createBlock(T,{key:0,checked:u.value.isAdditionalSale??!1,"true-value":!0,"false-value":!1,"onUpdate:checked":x[22]||(x[22]=$=>{u.value.isAdditionalSale=$??!1,R("isAdditionalSale",$??!1)})},{default:i.withCtx(()=>[...x[28]||(x[28]=[i.createTextVNode(" ДопПродажа ",-1)])]),_:1},8,["checked"])):i.createCommentVNode("",!0),i.createVNode(cr,{"is-product-searching":t.isProductSearching,product:u.value.product,validation:t.validation.product},null,8,["is-product-searching","product","validation"]),B.value?(i.openBlock(),i.createElementBlock("div",gy,[x[29]||(x[29]=i.createTextVNode(" ИТОГО: ",-1)),i.createElementVNode("span",py,i.toDisplayString(B.value)+" ₽",1)])):i.createCommentVNode("",!0),k.value?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("div",yy," Пожалуйста, заполните все обязательные поля корректно. ")),i.createElementVNode("div",by,[i.createVNode(i.unref(z.NButton),{loading:t.isSubmitProcessing,disabled:!k.value||u.value.product.isNewRec(),type:"primary",class:"self-start",onClick:x[23]||(x[23]=$=>s("submit",t.value))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(t.value.isNewRec()?"В корзину":"Изменить"),1)]),_:1},8,["loading","disabled"]),o.value?(i.openBlock(),i.createBlock(i.unref(z.NButton),{key:0,type:"default",onClick:x[24]||(x[24]=$=>s("click:show-preview-drawer"))},{default:i.withCtx(()=>[...x[30]||(x[30]=[i.createTextVNode(" Предварительный просмотр ",-1)])]),_:1})):i.createCommentVNode("",!0)])]),_:1},8,["model","rules"])}}}),wy="/img/configurators/mosquitto/measurement-instructions/measurement-height.png",xy="/img/configurators/mosquitto/measurement-instructions/measurement-width.png",ky="/img/configurators/mosquitto/measurement-instructions/mount.png",vy="/img/configurators/mosquitto/measurement-instructions/mount-z-plastic.png",Cy="/img/configurators/mosquitto/measurement-instructions/mount-z-metal.png",Sy={class:"flex flex-col gap-6"},By={class:"flex gap-4"},Ty={class:"flex flex-col gap-2"},$y={class:"flex gap-4"},Ny={class:"flex flex-col gap-2"},Ry={class:"flex gap-4"},Py={class:"flex flex-col gap-2"},Ey={},vd=i.defineComponent({...Ey,__name:"mosquito-configurator-measurement-instructions",props:{heightOverlaps:{},widthOverlaps:{},show:{type:Boolean}},emits:["update:show"],setup(t,{emit:e}){const n=St.initRefDependingOnDeviceResolution("small","small","medium"),r=St.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",Sy,[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:wy,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:xy,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",By,[l[9]||(l[9]=i.createElementVNode("img",{src:ky,alt:"measurement-height",class:"w-[7.5rem]"},null,-1)),i.createElementVNode("div",Ty,[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",$y,[l[15]||(l[15]=i.createElementVNode("img",{src:vy,alt:"measurement-height",class:"w-[7.5rem]"},null,-1)),i.createElementVNode("div",Ny,[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",Ry,[l[21]||(l[21]=i.createElementVNode("img",{src:Cy,alt:"measurement-height",class:"w-[7.5rem]"},null,-1)),i.createElementVNode("div",Py,[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"])}}}),Fy={class:"grid md:grid-cols-2"},Vy={},Cd=i.defineComponent({...Vy,__name:"mosquito-configurator",props:{eventEmitter:{},showSlugs:{type:Boolean},showProperties:{type:Boolean},showProductCosts:{type:[Boolean,Function]},allowNameClick:{type:[Boolean,Function]},allowPriceClick:{type:[Boolean,Function]},showPriceHistory:{type:[Boolean,Function]},showCostDate:{type:[Boolean,Function]},isProductItemSelected:{type:Function},showProductAddToCartButton:{type:[Boolean,String,Function]},showProductRequiredButton:{type:[Boolean,String,Function]},showProductEditButton:{type:[Boolean,String,Function]},currencyRates:{},productContextButtonsConfig:{type:Function},settings:{},cartItem:{}},emits:["submit","click:view-switch"],setup(t,{emit:e}){const n=t,r=e,s=i.computed(()=>St.isPhoneDevice()),o=i.ref(!1),a=i.ref(!1),l=i.ref(n.cartItem),c=i.useTemplateRef("mosquito-configurator-form"),d=i.ref({width:{},height:{},quantity:{},marker:{}}),u=i.ref(!1),h=i.ref(!1),f=i.computed(()=>i.inject("debounce-input-time",300)),g=M.debounce(async p=>{var y,b;l.value.product=new K.ClientProduct,(b=(y=c.value)==null?void 0:y.formReference)==null||b.validate(_=>{_||(u.value=!0,n.eventEmitter.emit("configurator:search-product",{category:n.cartItem.category,params:p,validationFieldResultData:d.value,callback:B=>{B?l.value.product=B:d.value.product={showFeedback:!0,feedback:"Не удалось найти товар по указанным параметрам.",validationStatus:"error"},u.value=!1}}))}).catch(M.noop)},f.value),m=()=>{h.value=!0,r("submit",l.value,d.value,()=>{h.value=!1})};return i.watch(()=>n.cartItem,p=>{l.value=p},{deep:!0}),(p,y)=>{const b=hs;return i.openBlock(),i.createElementBlock(i.Fragment,null,[i.createVNode(vd,{show:a.value,"onUpdate:show":y[0]||(y[0]=_=>a.value=_),"height-overlaps":t.settings.heightOverlaps,"width-overlaps":t.settings.widthOverlaps},null,8,["show","height-overlaps","width-overlaps"]),i.createElementVNode("div",Fy,[s.value?(i.openBlock(),i.createBlock(i.unref(z.NDrawer),{key:1,show:o.value,"onUpdate:show":y[4]||(y[4]=_=>o.value=_),"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:y[2]||(y[2]=_=>o.value=!1)},{default:i.withCtx(()=>[i.createVNode(b)]),_:1})]),default:i.withCtx(()=>[i.createVNode(Do,{"configurator-params":l.value.configuratorParams,settings:t.settings,onOpenInstructions:y[3]||(y[3]=_=>a.value=!0)},null,8,["configurator-params","settings"])]),_:1})]),_:1},8,["show"])):(i.openBlock(),i.createBlock(Do,{key:0,"configurator-params":l.value.configuratorParams,settings:t.settings,onOpenInstructions:y[1]||(y[1]=_=>a.value=!0)},null,8,["configurator-params","settings"])),i.createVNode(kd,{ref:"mosquito-configurator-form",value:l.value,"onUpdate:value":y[5]||(y[5]=_=>l.value=_),validation:d.value,settings:t.settings,"is-product-searching":u.value,"is-submit-processing":h.value,"onUpdate:params":y[6]||(y[6]=_=>i.unref(g)(_)),onSubmit:y[7]||(y[7]=_=>m()),"onClick:instructionsToggle":y[8]||(y[8]=_=>a.value=!a.value),"onClick:showPreviewDrawer":y[9]||(y[9]=_=>o.value=!0)},null,8,["value","validation","settings","is-product-searching","is-submit-processing"])])],64)}}}),Iy={},Sd=i.defineComponent({...Iy,__name:"strip-configurator-line-item",props:{value:{},index:{},path:{},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:{}},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=i.ref(r.value),c=i.useTemplateRef("form-item-reference"),d=i.computed(()=>{var f;return!((f=c.value)!=null&&f.validationErrored)}),u=f=>{l.value=f,s("update:value",f,r.index,a)},h=()=>{var f;(f=o.value)==null||f.select()};return i.watch(()=>r.value,f=>{l.value=f}),i.onMounted(()=>{r.autoFocus&&i.nextTick(()=>{h()})}),e({isValid:d,formItemReference:c}),(f,g)=>{const m=rl,p=zr;return i.openBlock(),i.createBlock(i.unref(z.NFormItem),{ref:"form-item-reference",path:t.path,label:`Полоса №${t.index+1}, мм`,class:"sc-hide-empty-feedback-message"},{feedback:i.withCtx(()=>[d.value?(i.openBlock(),i.createBlock(cr,{key:0,"is-product-searching":a.value,product:t.product,validation:t.validation.product},null,8,["is-product-searching","product","validation"])):i.createCommentVNode("",!0)]),default:i.withCtx(()=>[i.createVNode(i.unref(z.NDropdown),{trigger:"click",options:t.suggestionOption,placement:"bottom-start",size:"large",onSelect:u},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInputNumber),{ref:"width-input-element",value:l.value??null,class:"w-full","show-button":!1,parse:i.unref(lt),placeholder:"Введите ширину",onKeydown:g[0]||(g[0]=y=>i.unref(tt)(y)),onInput:g[1]||(g[1]=y=>i.unref(et)(t.validation,`linesWidths.${t.index}`)),onFocus:i.unref(Le),"onUpdate:value":u},null,8,["value","parse","onFocus"])]),_:1},8,["options"]),i.createVNode(i.unref(z.NButton),{disabled:t.addLineButtonDisabled,size:"medium",class:"ml-2",onClick:g[2]||(g[2]=y=>s("click:add-line",t.index))},{default:i.withCtx(()=>[i.createVNode(m)]),_:1},8,["disabled"]),i.createVNode(i.unref(z.NButton),{disabled:t.removeLineButtonDisabled,size:"medium",class:"ml-2",onClick:g[3]||(g[3]=y=>s("click:remove-line",t.index))},{default:i.withCtx(()=>[i.createVNode(p)]),_:1},8,["disabled"])]),_:1},8,["path","label"])}}}),Ay={class:"my-2 flex w-full flex-col"},My={key:1},Oy={class:"text-lg font-semibold"},zy={class:"flex gap-3"},Dy={},Bd=i.defineComponent({...Dy,__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,{expose:e,emit:n}){var _;const r=t,s=n,o=i.useTemplateRef("form-reference"),a=i.useTemplateRef("line-items-reference"),l=i.ref(M.cloneDeep(r.value)),c=i.computed(()=>{const B={length:[ae.required,ae.min(r.settings.minLength),ae.max(r.settings.maxLength),ae.step(r.settings.lengthStep),We.serverValidation(r.validation.length.feedback)],quantity:[ae.required,ae.min(1),We.serverValidation(r.validation.quantity.feedback)],marker:[We.serverValidation(r.validation.marker.feedback)]};return M.forEach(l.value,(k,N)=>{var R;B[`configuratorParams.linesWidths.${N}`]=[ae.required,ae.min(r.settings.minLineWidth),ae.step(r.settings.lineWidthStep),We.serverValidation((R=r.validation[`linesWidths.${N}`])==null?void 0:R.feedback)]}),B}),d=i.ref(r.settings.canSetDopProdaga??!1),u=i.computed(()=>r.value[0].configuratorParams.linesWidths.reduce((B,k)=>(B??0)+(k??0),0)),h=i.computed(()=>r.settings.width-u.value),f=i.computed(()=>!r.value.some(({product:B})=>!B||B.isNewRec())),g=i.computed(()=>r.isSubmitProcessing||!f.value||h.value<=0||l.value.length>=r.settings.maxLinesCount||r.value.some(B=>B.product.isNewRec())),m=i.computed(()=>B=>h.value===0?void 0:[{label:`${(h.value>0?"Остаток +":"Излишек ")+h.value} мм.`,key:h.value+B}]),p=i.computed(()=>{const{length:B}=r.value[0];return!B||u.value!==r.settings.width?null:(M.reduce(r.value,(N,R)=>{var C;const w=((C=R.product)==null?void 0:C.costRub)||0;return N+w},0)*r.value[0].quantity*B).toLocaleString("ru-ru",{minimumFractionDigits:2})}),y=(B,k,N)=>{var w,C,x;l.value[k].product.id=-1;const{configuratorParams:R}=l.value[k];R.linesWidths[k]=B,b("configuratorParams",R),(x=(C=(w=a.value)==null?void 0:w.at(k))==null?void 0:C.formItemReference)==null||x.validate().catch(M.noop),i.nextTick(()=>{var T,$;($=(T=a.value)==null?void 0:T.at(k))!=null&&$.isValid&&s("update:params",R,k,N)})},b=(B,k)=>{l.value.forEach(N=>{N[B]=k}),s("update:value",l.value)};return i.watch(()=>r.value,B=>{l.value=M.cloneDeep(B)},{deep:!0}),e({validate:(_=o.value)==null?void 0:_.validate,formReference:o}),(B,k)=>{const N=z.NCheckbox;return i.openBlock(),i.createBlock(i.unref(z.NForm),{ref:"form-reference",model:l.value[0],rules:c.value,class:"flex flex-col gap-2 sc-hide-empty-feedback-message",onKeydown:k[15]||(k[15]=i.withKeys(i.withModifiers(R=>s("submit",l.value),["prevent"]),["enter"]))},{default:i.withCtx(()=>{var R;return[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(l.value,(w,C)=>{var x,T;return i.openBlock(),i.createBlock(Sd,{key:C,ref_for:!0,ref:"line-items-reference",value:((x=w.configuratorParams)==null?void 0:x.linesWidths.at(C))??null,"auto-focus":!0,index:C,path:`configuratorParams.linesWidths.${C}`,product:w.product,settings:t.settings,validation:t.validation,"suggestion-option":m.value(((T=w.configuratorParams)==null?void 0:T.linesWidths.at(C))??0),"add-line-button-disabled":h.value<=0||t.value.length>=t.settings.maxLinesCount||t.value.some($=>$.product.isNewRec()),"remove-line-button-disabled":l.value.length===1,"onUpdate:value":y,"onClick:addLine":k[0]||(k[0]=$=>s("click:add-line",$)),"onClick:removeLine":k[1]||(k[1]=$=>s("click:remove-line",$))},null,8,["value","index","path","product","settings","validation","suggestion-option","add-line-button-disabled","remove-line-button-disabled"])}),128)),i.createElementVNode("div",Ay,[h.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),f.value&&l.value.length===t.settings.maxLinesCount&&h.value>0?(i.openBlock(),i.createBlock(i.unref(z.NText),{key:1,type:"error"},{default:i.withCtx(()=>[...k[16]||(k[16]=[i.createTextVNode(" Остаток резки должен быть равен 0 ",-1)])]),_:1})):i.createCommentVNode("",!0),i.createElementVNode("div",null,[k[17]||(k[17]=i.createTextVNode(" Остаток для резки: ",-1)),i.createVNode(i.unref(z.NText),{type:h.value>=0?"Success":"error"},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(h.value),1)]),_:1},8,["type"]),i.createTextVNode(" из "+i.toDisplayString(t.settings.width)+" мм ",1)])]),i.createVNode(i.unref(z.NButton),{disabled:g.value,type:"primary",class:"self-center",onClick:k[2]||(k[2]=w=>s("click:add-line",l.value.length))},{default:i.withCtx(()=>[...k[18]||(k[18]=[i.createTextVNode(" Добавить полосу ",-1)])]),_:1},8,["disabled"]),i.createVNode(i.unref(z.NFormItem),{path:"length",label:`Метраж ${t.settings.minLength?" от "+t.settings.minLength:""} ${t.settings.maxLength?" до "+t.settings.maxLength:""} м.`},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInputNumber),{value:l.value[0].length,"onUpdate:value":[k[3]||(k[3]=w=>l.value[0].length=w),k[6]||(k[6]=w=>b("length",w))],parse:i.unref(lt),"show-button":!1,placeholder:"Введите метраж",class:"w-full",onKeydown:k[4]||(k[4]=w=>i.unref(tt)(w,!1)),onInput:k[5]||(k[5]=w=>i.unref(et)(t.validation,"length")),onFocus:i.unref(Le)},null,8,["value","parse","onFocus"])]),_:1},8,["label"]),i.createVNode(i.unref(z.NFormItem),{path:"quantity",label:"Количество"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInputNumber),{value:l.value[0].quantity,"onUpdate:value":[k[7]||(k[7]=w=>l.value[0].quantity=w),k[10]||(k[10]=w=>b("quantity",w))],"show-button":!1,placeholder:"Введите количество",class:"w-full",onKeydown:k[8]||(k[8]=w=>i.unref(tt)(w,!1)),onInput:k[9]||(k[9]=w=>i.unref(et)(t.validation,"quantity")),onFocus:i.unref(Le)},null,8,["value","onFocus"])]),_:1}),i.createVNode(i.unref(z.NFormItem),{path:"marker",label:"Маркировка"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInput),{value:l.value[0].marker??null,placeholder:"Введите маркировку",onInput:k[11]||(k[11]=w=>i.unref(et)(t.validation,"marker")),"onUpdate:value":k[12]||(k[12]=w=>{l.value[0].marker=w??null,b("marker",w??null)}),onFocus:i.unref(Le)},null,8,["value","onFocus"])]),_:1}),d.value?(i.openBlock(),i.createBlock(N,{key:0,checked:l.value[0].isAdditionalSale??!1,"true-value":!0,"false-value":!1,"onUpdate:checked":k[13]||(k[13]=w=>{l.value[0].isAdditionalSale=w??!1,b("isAdditionalSale",w??!1)})},{default:i.withCtx(()=>[...k[19]||(k[19]=[i.createTextVNode(" ДопПродажа ",-1)])]),_:1},8,["checked"])):i.createCommentVNode("",!0),p.value?(i.openBlock(),i.createElementBlock("div",My,[k[20]||(k[20]=i.createTextVNode(" ИТОГО: ",-1)),i.createElementVNode("span",Oy,i.toDisplayString(p.value)+" ₽",1)])):i.createCommentVNode("",!0),i.createElementVNode("div",zy,[i.createVNode(i.unref(z.NButton),{loading:t.isSubmitProcessing,disabled:!f.value||h.value!=0||!((R=l.value[0])!=null&&R.length)||l.value[0].length>t.settings.maxLength||l.value[0].length<t.settings.minLength||l.value[0].quantity===0,type:"primary",class:"self-start",onClick:k[14]||(k[14]=w=>s("submit",l.value))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(l.value[0].isNewRec()?"В корзину":"Изменить"),1)]),_:1},8,["loading","disabled"])])]}),_:1},8,["model","rules"])}}}),Ly={class:"flex grow flex-col"},Hy=["src"],Wy={class:"w-full"},jy={},Td=i.defineComponent({...jy,__name:"strip-configurator-preview",props:{value:{},settings:{}},setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock("div",Ly,[i.createElementVNode("img",{src:"/img/configurators/strip/strip-"+t.value.length+".png",class:"w-full max-w-96 self-center py-5",alt:"Штрипс"},null,8,Hy),i.createElementVNode("div",Wy,[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)])]))}}),qy={class:"flex flex-col gap-2"},Xy={class:"w-104 flex grow flex-col px-5"},Yy={},$d=i.defineComponent({...Yy,__name:"strip-configurator",props:{eventEmitter:{},showSlugs:{type:Boolean},showProperties:{type:Boolean},showProductCosts:{type:[Boolean,Function]},allowNameClick:{type:[Boolean,Function]},allowPriceClick:{type:[Boolean,Function]},showPriceHistory:{type:[Boolean,Function]},showCostDate:{type:[Boolean,Function]},isProductItemSelected:{type:Function},showProductAddToCartButton:{type:[Boolean,String,Function]},showProductRequiredButton:{type:[Boolean,String,Function]},showProductEditButton:{type:[Boolean,String,Function]},currencyRates:{},productContextButtonsConfig:{type:Function},settings:{},cartItems:{}},emits:["submit","click:view-switch"],setup(t,{emit:e}){const n=t,r=e,s=i.useTemplateRef("strip-configurator-form"),o=i.ref(n.cartItems),a=i.ref({width:{},length:{},quantity:{},marker:{}}),l=i.ref(!1),c=i.computed(()=>i.inject("debounce-input-time",300)),d=i.computed(()=>{var m;return(m=o.value[0].configuratorParams)==null?void 0:m.linesWidths.reduce((p,y)=>(p??0)+(y??0),0)}),u=m=>{m===void 0&&(m=o.value.length-1);const p=o.value.at(0);if(!p)return;p.configuratorParams.linesWidths=p.configuratorParams.linesWidths.toSpliced(m+1,0,null),o.value.forEach(b=>{b.configuratorParams.linesWidths=p.configuratorParams.linesWidths});const y=new K.OrderItemBase({quantity:(p==null?void 0:p.quantity)??1,category:p==null?void 0:p.category,length:(p==null?void 0:p.length)??n.settings.minLength,marker:p==null?void 0:p.marker,configuratorParams:{linesWidths:p==null?void 0:p.configuratorParams.linesWidths}});o.value=o.value.toSpliced(m+1,0,y)},h=m=>{const p=o.value.at(0);p&&(p.configuratorParams.linesWidths=p.configuratorParams.linesWidths.toSpliced(m,1),o.value.forEach(y=>{y.configuratorParams.linesWidths=p.configuratorParams.linesWidths}),o.value=o.value.toSpliced(m,1),delete a[`linesWidths.${m}`],delete a[`linesWidths.${m}`])},f=M.debounce(async(m,p,y)=>{const b={linesWidths:m.linesWidths.at(p)};y.value=!0,a.value[`linesWidths.${p}`]={},o.value[p].product=new K.ClientProduct,n.eventEmitter.emit("configurator:search-product",{category:o.value[p].category,params:b,validationFieldResultData:a.value,callback:_=>{_?(o.value[p].product=_,p===o.value.length-1&&o.value.length<n.settings.maxLinesCount&&d.value&&d.value<n.settings.width&&u()):(o.value[p].product=new K.ClientProduct,a.value[`linesWidths.${p}`]={showFeedback:!0,feedback:"Не удалось найти товар",validationStatus:"error"},y.value=!1),y.value=!1}})},c.value),g=async()=>{var m,p;(p=(m=s.value)==null?void 0:m.formReference)==null||p.validate(y=>{if(!y){l.value=!0;const b=o.value.at(0);if(!b)return;r("submit",b,a.value,()=>{l.value=!1,i.nextTick(()=>{var _,B;(B=(_=s.value)==null?void 0:_.formReference)==null||B.restoreValidation()})})}}).catch(M.noop)};return i.watch(()=>n.cartItems,m=>{o.value=m.map(p=>new K.OrderItemBase(p))}),(m,p)=>{const y=z.NButton;return i.openBlock(),i.createElementBlock("div",qy,[t.settings.allowShowTable?(i.openBlock(),i.createBlock(y,{key:0,type:"tertiary",class:"self-center",onClick:p[0]||(p[0]=b=>r("click:view-switch"))},{default:i.withCtx(()=>[...p[3]||(p[3]=[i.createTextVNode(" Показать в виде списка ",-1)])]),_:1})):i.createCommentVNode("",!0),i.createElementVNode("div",Xy,[i.createVNode(Td,{value:o.value,"onUpdate:value":p[1]||(p[1]=b=>o.value=b),settings:t.settings},null,8,["value","settings"]),i.createVNode(Bd,{ref:"strip-configurator-form",value:o.value,"onUpdate:value":p[2]||(p[2]=b=>o.value=b),validation:a.value,settings:t.settings,"is-submit-processing":l.value,"onUpdate:params":i.unref(f),onSubmit:g,"onClick:addLine":u,"onClick:removeLine":h},null,8,["value","validation","settings","is-submit-processing","onUpdate:params"])])])}}}),Uy={class:"flex flex-col gap-3"},Ky={},Nd=i.defineComponent({...Ky,__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,{expose:e,emit:n}){var g;const r=t,s=n,o=i.useTemplateRef("form-reference"),a=i.useTemplateRef("first-input-element"),l=i.ref(M.cloneDeep(r.value)),c=i.computed(()=>({"configuratorParams.width":[ae.required,ae.min(r.settings.minWidth),...r.settings.maxWidth?[ae.max(r.settings.maxWidth)]:[],ae.step(1),We.serverValidation(r.validation.width.feedback)],"configuratorParams.length":[ae.required,ae.min(r.settings.minLength),ae.max(r.settings.maxLength),ae.step(1),We.serverValidation(r.validation.length.feedback)],quantity:[ae.required,ae.min(1),ae.step(1),We.serverValidation(r.validation.quantity.feedback)],marker:[We.serverValidation(r.validation.marker.feedback)]})),d=i.ref(r.settings.canSetDopProdaga??!1),u=()=>{s("update:params",l.value.configuratorParams),h("configuratorParams",l.value.configuratorParams)},h=(m,p)=>{const y=new K.OrderItemBase(r.value);y[m]=p,m==="configuratorParams"&&(y.product=new K.ClientProduct),s("update:value",y)},f=()=>{var m;(m=a.value)==null||m.select()};return i.watch(()=>r.value,m=>{l.value=M.cloneDeep(m)},{deep:!0}),i.onMounted(()=>{r.value.isNewRec()&&i.nextTick(()=>{f()})}),e({validate:(g=o.value)==null?void 0:g.validate,formReference:o}),(m,p)=>{const y=z.NCheckbox;return i.openBlock(),i.createBlock(i.unref(z.NForm),{ref:"form-reference",model:l.value,rules:c.value,disabled:t.isSubmitProcessing,class:"flex flex-col gap-2 sc-hide-empty-feedback-message",onKeydown:p[13]||(p[13]=i.withKeys(i.withModifiers(b=>s("submit",l.value),["prevent"]),["enter"]))},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NFormItem),{path:"configuratorParams.width",label:`Ширина, ${t.settings.minWidth?" от "+t.settings.minWidth:""}${t.settings.maxWidth?" до "+t.settings.maxWidth:""} мм`},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInputNumber),{ref:"first-input-element",value:l.value.configuratorParams.width,"onUpdate:value":[p[0]||(p[0]=b=>l.value.configuratorParams.width=b),u],class:"w-full",parse:i.unref(lt),"show-button":!1,placeholder:"Введите ширину",onKeydown:p[1]||(p[1]=b=>i.unref(tt)(b)),onInput:p[2]||(p[2]=b=>i.unref(et)(t.validation,"width")),onFocus:i.unref(Le)},null,8,["value","parse","onFocus"])]),_:1},8,["label"]),i.createVNode(i.unref(z.NFormItem),{path:"configuratorParams.length",label:`Длина, ${t.settings.minLength?" от "+t.settings.minLength:""}${t.settings.maxLength?" до "+t.settings.maxLength:""} мм`},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInputNumber),{value:l.value.configuratorParams.length,"onUpdate:value":[p[3]||(p[3]=b=>l.value.configuratorParams.length=b),u],placeholder:"Введите длину",parse:i.unref(lt),"show-button":!1,class:"w-full",onKeydown:p[4]||(p[4]=b=>i.unref(tt)(b)),onInput:p[5]||(p[5]=b=>i.unref(et)(t.validation,"length")),onFocus:i.unref(Le)},null,8,["value","parse","onFocus"])]),_:1},8,["label"]),i.createVNode(i.unref(z.NFormItem),{path:"quantity",label:"Количество"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInputNumber),{value:t.value.quantity,placeholder:"Введите количество",min:1,"show-button":!1,class:"w-full",onKeydown:p[6]||(p[6]=b=>i.unref(tt)(b,!1)),onInput:p[7]||(p[7]=b=>i.unref(et)(t.validation,"quantity")),"onUpdate:value":p[8]||(p[8]=b=>h("quantity",b??0)),onFocus:i.unref(Le)},null,8,["value","onFocus"])]),_:1}),i.createVNode(i.unref(z.NFormItem),{path:"marker",label:"Маркировка"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInput),{value:t.value.marker??null,placeholder:"Введите маркировку",onInput:p[9]||(p[9]=b=>i.unref(et)(t.validation,"marker")),"onUpdate:value":p[10]||(p[10]=b=>h("marker",b??null)),onFocus:i.unref(Le)},null,8,["value","onFocus"])]),_:1}),d.value?(i.openBlock(),i.createBlock(y,{key:0,checked:l.value.isAdditionalSale??!1,"true-value":!0,"false-value":!1,"onUpdate:checked":p[11]||(p[11]=b=>{l.value.isAdditionalSale=b??!1,h("isAdditionalSale",b??!1)})},{default:i.withCtx(()=>[...p[14]||(p[14]=[i.createTextVNode(" ДопПродажа ",-1)])]),_:1},8,["checked"])):i.createCommentVNode("",!0),i.createVNode(cr,{"is-product-searching":t.isProductSearching,product:t.value.product,validation:t.validation.product},null,8,["is-product-searching","product","validation"]),i.createElementVNode("div",Uy,[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:p[12]||(p[12]=b=>s("submit",t.value))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(t.value.isNewRec()?"В корзину":"Изменить"),1)]),_:1},8,["disabled"])])]),_:1},8,["model","rules","disabled"])}}}),Gy={class:"flex flex-col gap-2 w-72"},Zy={},Rd=i.defineComponent({...Zy,__name:"metal-for-doors-configurator",props:{eventEmitter:{},showSlugs:{type:Boolean},showProperties:{type:Boolean},showProductCosts:{type:[Boolean,Function]},allowNameClick:{type:[Boolean,Function]},allowPriceClick:{type:[Boolean,Function]},showPriceHistory:{type:[Boolean,Function]},showCostDate:{type:[Boolean,Function]},isProductItemSelected:{type:Function},showProductAddToCartButton:{type:[Boolean,String,Function]},showProductRequiredButton:{type:[Boolean,String,Function]},showProductEditButton:{type:[Boolean,String,Function]},currencyRates:{},productContextButtonsConfig:{type:Function},settings:{},cartItem:{}},emits:["submit","click:view-switch"],setup(t,{emit:e}){const n=t,r=e,s=i.useTemplateRef("metal-for-doors-configurator-form"),o=i.ref(n.cartItem),a=i.ref({width:{},length:{},quantity:{},marker:{}}),l=i.ref(!1),c=i.ref(!1),d=i.computed(()=>i.inject("debounce-input-time",300)),u=M.debounce(async f=>{var g,m;o.value.product=new K.ClientProduct,(m=(g=s.value)==null?void 0:g.formReference)==null||m.validate(p=>{p||(l.value=!0,n.eventEmitter.emit("configurator:search-product",{category:n.cartItem.category,params:f,validationFieldResultData:a.value,callback:y=>{y?o.value.product=y:a.value.product={showFeedback:!0,feedback:"Не удалось найти товар по указанным параметрам.",validationStatus:"error"},l.value=!1}}))}).catch(M.noop)},d.value),h=async()=>{var f,g;(g=(f=s.value)==null?void 0:f.formReference)==null||g.validate(m=>{m||(c.value=!0,r("submit",o.value,a.value,()=>{c.value=!1,i.nextTick(()=>{var p,y;(y=(p=s.value)==null?void 0:p.formReference)==null||y.restoreValidation()})}))}).catch(M.noop)};return i.watch(()=>n.cartItem,f=>{o.value=new K.OrderItemBase(f)},{deep:!0}),(f,g)=>{const m=z.NButton;return i.openBlock(),i.createElementBlock("div",Gy,[t.settings.allowShowTable?(i.openBlock(),i.createBlock(m,{key:0,type:"tertiary",class:"self-center",onClick:g[0]||(g[0]=p=>r("click:view-switch"))},{default:i.withCtx(()=>[...g[4]||(g[4]=[i.createTextVNode(" Показать в виде списка ",-1)])]),_:1})):i.createCommentVNode("",!0),i.createVNode(Nd,{ref:"metal-for-doors-configurator-form",value:o.value,"onUpdate:value":g[1]||(g[1]=p=>o.value=p),validation:a.value,settings:t.settings,"is-submit-processing":c.value,"is-product-searching":l.value,"onUpdate:params":g[2]||(g[2]=p=>i.unref(u)(p)),onSubmit:g[3]||(g[3]=p=>h())},null,8,["value","validation","settings","is-submit-processing","is-product-searching"])])}}}),Qy={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Jy(t,e){return i.openBlock(),i.createElementBlock("svg",Qy,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M256 112v288m144-144H112"},null,-1)])])}const Pd=i.markRaw({name:"ion-add",render:Jy}),e0={key:0,class:"-mt-1 text-sm text-gray-500"},t0={class:"font-bold"},n0={class:"flex flex-col gap-3"},i0={key:0,class:"mt-4 flex flex-col gap-1.5"},r0={class:"flex flex-col gap-1 text-sm text-gray-700"},s0={key:0},o0={key:1},a0={"form-array-name":"items",class:"flex flex-col gap-3"},l0={class:"grid grow grid-cols-1 items-start gap-2 sm:grid-cols-3"},c0={key:0,class:"flex flex-wrap items-end gap-2"},d0={class:"whitespace-nowrap text-xl font-bold"},u0={key:0,class:"whitespace-nowrap text-lg text-gray-500"},h0={class:"font-bold"},f0={class:"font-bold"},m0={class:"flex gap-3"},g0={},Ed=i.defineComponent({...g0,__name:"sandwich-configurator-form",props:{value:{},eventEmitter:{},showSlugs:{type:Boolean},showProperties:{type:Boolean},showProductCosts:{type:[Boolean,Function]},allowNameClick:{type:[Boolean,Function]},allowPriceClick:{type:[Boolean,Function]},showPriceHistory:{type:[Boolean,Function]},showCostDate:{type:[Boolean,Function]},isProductItemSelected:{},showProductAddToCartButton:{type:[Boolean,String,Function]},showProductRequiredButton:{type:[Boolean,String,Function]},showProductEditButton:{type:[Boolean,String,Function]},currencyRates:{},productContextButtonsConfig:{},settings:{},isProductSearching:{type:Boolean,default:!1},isSubmitProcessing:{type:Boolean,default:!1},validation:{default:void 0}},emits:["update:value","update:params","submit","add-item","remove-item"],setup(t,{expose:e,emit:n}){var ne;const r=t,s=n,o=i.useTemplateRef("form-reference"),a=i.ref(M.cloneDeep(r.value)),l=i.ref({...r.validation}),c=E=>{var P;delete l.value[E],(P=o.value)==null||P.restoreValidation()};i.watch(()=>r.validation,E=>{l.value={...E},Object.values(E).some(H=>H==null?void 0:H.feedback)&&i.nextTick(()=>{var H;return(H=o.value)==null?void 0:H.validate(M.noop).catch(M.noop)})},{deep:!0});const d=i.computed(()=>r.value.category),u=i.ref(null),h=i.ref(null),f=i.computed(()=>d.value.products??[]),g=i.computed(()=>f.value.map(E=>({label:E.name,value:E.id}))),m=(E,P,H)=>{const Y=E!=null&&E>0,D=P!=null&&P>0;return!Y&&!D?null:Y&&D?`от ${E} ${H} до ${P} ${H}`:Y?`от ${E} ${H}`:`до ${P} ${H}`},p=i.computed(()=>{var E,P;return m(r.settings.minWidth,(P=(E=u.value)==null?void 0:E.properties)==null?void 0:P.width,"мм")}),y=i.computed(()=>{var E,P;return m(r.settings.minLength,(P=(E=u.value)==null?void 0:E.properties)==null?void 0:P.length,"мм")}),b=i.ref(null),_=i.ref(!1);i.computed(()=>{var E,P;return(P=(E=u.value)==null?void 0:E.properties)!=null&&P.width?ae.max(u.value.properties.width):null}),i.computed(()=>{var E,P;return(P=(E=u.value)==null?void 0:E.properties)!=null&&P.length?ae.max(u.value.properties.length):null});const B=i.computed(()=>{var P;const E={marker:[We.serverValidation((P=l.value.marker)==null?void 0:P.feedback)]};return a.value.configuratorParams.items.forEach((H,Y)=>{var D,X,W,V,j,U,ee;E[`configuratorParams.items.${Y}.width`]=[ae.required,ae.min(r.settings.minWidth),...(X=(D=u.value)==null?void 0:D.properties)!=null&&X.width?[ae.max(u.value.properties.width)]:[],ae.step(1),We.serverValidation((W=l.value[`items.${Y}.width`])==null?void 0:W.feedback)],E[`configuratorParams.items.${Y}.length`]=[ae.required,ae.min(r.settings.minLength),...(j=(V=u.value)==null?void 0:V.properties)!=null&&j.length?[ae.max(u.value.properties.length)]:[],ae.step(1),We.serverValidation((U=l.value[`items.${Y}.length`])==null?void 0:U.feedback)],E[`configuratorParams.items.${Y}.count`]=[ae.required,ae.min(1),ae.step(1),We.serverValidation((ee=l.value[`items.${Y}.count`])==null?void 0:ee.feedback)]}),E}),k=i.ref(r.settings.canSetDopProdaga??!1),N=i.computed(()=>a.value.configuratorParams.items.some(E=>{var P,H;return!u.value||!E.width||E.width<r.settings.minWidth||E.width>(((P=u.value.properties)==null?void 0:P.width)??0)||E.length===0||E.length<r.settings.minLength||E.length>(((H=u.value.properties)==null?void 0:H.length)??0)||!E.count||E.count<1})),R=i.computed(()=>!u.value||N.value||a.value.configuratorParams.items.length===0),w=i.ref(null),C=E=>{if(!E){u.value=null,h.value=null,a.value.product=new K.ClientProduct,b.value=null;return}const P=f.value.find(H=>H.id===E);P&&(u.value=P,h.value=E,a.value.product=P,O("product",a.value.product),a.value.configuratorParams.items.forEach(H=>{var Y,D;(Y=P.properties)!=null&&Y.width&&H.width>P.properties.width&&(H.width=P.properties.width),(D=P.properties)!=null&&D.length&&H.length>P.properties.length&&(H.length=P.properties.length)}),x())},x=()=>{b.value=null,w.value=null},T=async()=>{var E;if(!u.value||a.value.configuratorParams.items.length===0||N.value){x();return}(E=o.value)==null||E.validate(P=>{if(P){x();return}if(_.value=!0,!u.value||!d.value){x(),_.value=!1;return}r.eventEmitter.emit("configurator:calculate",{category:d.value,params:{productId:u.value.id,items:a.value.configuratorParams.items},callback:H=>{H?(b.value=H,a.value.configuratorParams.calculationId=H.id,a.value.quantity=H.quantity,i.nextTick(()=>{O("quantity",H.quantity)})):(a.value.configuratorParams.calculationId="",a.value.quantity=0,x()),O("configuratorParams",a.value.configuratorParams),$(),_.value=!1}})}).catch(()=>{x(),_.value=!1})},$=()=>{var P;if(!((P=u.value)!=null&&P.costRub)||!b.value){w.value=null;return}const E=b.value.quantity*u.value.costRub;w.value=Math.round(E*100)/100},F=E=>{var H,Y;const P=a.value.configuratorParams.items[E];u.value&&((H=u.value.properties)!=null&&H.width&&P.width>u.value.properties.width&&(P.width=u.value.properties.width),(Y=u.value.properties)!=null&&Y.length&&P.length>u.value.properties.length&&(P.length=u.value.properties.length)),O("configuratorParams",a.value.configuratorParams),x()},I=()=>{a.value.configuratorParams.calculationId="",a.value.configuratorParams.items.push({width:0,length:0,count:1}),O("configuratorParams",a.value.configuratorParams),x(),s("add-item",a.value.configuratorParams.items.length)},L=E=>{a.value.configuratorParams.items.splice(E,1),O("configuratorParams",a.value.configuratorParams),x(),s("remove-item",E)},O=(E,P)=>{const H=new K.OrderItemBase(r.value);H[E]=P,s("update:value",H)};i.watch(()=>r.value,E=>{const P=M.cloneDeep(i.toRaw(E));(!P.configuratorParams.items||P.configuratorParams.items.length===0)&&(P.configuratorParams.items=[{width:0,length:0,count:1}]),a.value=P,r.value.product&&!r.value.product.isNewRec()&&(u.value=r.value.product,h.value=r.value.product.id),r.value.product.isNewRec()&&(u.value=null,h.value=null),Z()},{deep:!0});const Z=()=>{const{calculationId:E}=a.value.configuratorParams,P=a.value.quantity??0;E&&P>0&&a.value.product&&!a.value.product.isNewRec()&&(b.value={id:E,quantity:P,sheets:[]},$())};return i.onMounted(()=>{r.value.product&&!r.value.product.isNewRec()&&(u.value=r.value.product,h.value=r.value.product.id),Z()}),e({validate:(ne=o.value)==null?void 0:ne.validate,formReference:o}),(E,P)=>{const H=zr,Y=Pd;return i.openBlock(),i.createBlock(i.unref(z.NForm),{ref:"form-reference",model:a.value,rules:B.value,class:"flex flex-col gap-2 sc-hide-empty-feedback-message",onKeydown:P[8]||(P[8]=i.withKeys(i.withModifiers(D=>s("submit",a.value),["prevent"]),["enter"]))},{default:i.withCtx(()=>{var D;return[i.createVNode(i.unref(z.NFormItem),{required:!0,"show-feedback":!1,label:"Товар"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NSelect),{value:h.value,"onUpdate:value":[P[0]||(P[0]=X=>h.value=X),C],options:g.value,placeholder:"Выберите материал",filterable:""},null,8,["value","options"])]),_:1}),((D=u.value)==null?void 0:D.costRub)!=null?(i.openBlock(),i.createElementBlock("div",e0,[i.createElementVNode("span",t0,i.toDisplayString(u.value.code),1),i.createTextVNode(" — "+i.toDisplayString(u.value.costRub.toLocaleString())+" "+i.toDisplayString(u.value.currency.symbol)+"/шт. ",1)])):i.createCommentVNode("",!0),i.createElementVNode("div",n0,[u.value?(i.openBlock(),i.createElementBlock("div",i0,[P[9]||(P[9]=i.createElementVNode("div",{class:"w-full font-bold"},"Размеры изделий",-1)),i.createElementVNode("div",r0,[p.value?(i.openBlock(),i.createElementBlock("div",s0,"Ширина "+i.toDisplayString(p.value)+".",1)):i.createCommentVNode("",!0),y.value?(i.openBlock(),i.createElementBlock("div",o0,"Длина "+i.toDisplayString(y.value)+".",1)):i.createCommentVNode("",!0)])])):i.createCommentVNode("",!0),i.createElementVNode("div",a0,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(a.value.configuratorParams.items,(X,W)=>(i.openBlock(),i.createElementBlock("div",{key:W,class:"flex grow gap-2"},[i.createElementVNode("div",l0,[i.createVNode(i.unref(z.NFormItem),{path:`configuratorParams.items.${W}.width`,label:"Ширина, мм"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInputNumber),{value:a.value.configuratorParams.items[W].width,"onUpdate:value":[V=>a.value.configuratorParams.items[W].width=V,V=>F(W)],parse:i.unref(lt),"show-button":!1,disabled:!u.value,placeholder:"Ширина",class:"w-full",onKeydown:P[1]||(P[1]=V=>i.unref(tt)(V)),onInput:V=>c(`items.${W}.width`),onFocus:i.unref(Le)},null,8,["value","onUpdate:value","parse","disabled","onInput","onFocus"])]),_:2},1032,["path"]),i.createVNode(i.unref(z.NFormItem),{path:`configuratorParams.items.${W}.length`,label:"Длина, мм"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInputNumber),{value:a.value.configuratorParams.items[W].length,"onUpdate:value":[V=>a.value.configuratorParams.items[W].length=V,V=>F(W)],parse:i.unref(lt),"show-button":!1,disabled:!u.value,placeholder:"Длина",class:"w-full",onKeydown:P[2]||(P[2]=V=>i.unref(tt)(V)),onInput:V=>c(`items.${W}.length`),onFocus:i.unref(Le)},null,8,["value","onUpdate:value","parse","disabled","onInput","onFocus"])]),_:2},1032,["path"]),i.createVNode(i.unref(z.NFormItem),{path:`configuratorParams.items.${W}.count`,label:"Количество, шт"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInputNumber),{value:a.value.configuratorParams.items[W].count,"onUpdate:value":[V=>a.value.configuratorParams.items[W].count=V,V=>F(W)],parse:i.unref(lt),"show-button":!1,disabled:!u.value,placeholder:"Количество",class:"w-full",onKeydown:P[3]||(P[3]=V=>i.unref(tt)(V,!1)),onInput:V=>c(`items.${W}.count`),onFocus:i.unref(Le)},null,8,["value","onUpdate:value","parse","disabled","onInput","onFocus"])]),_:2},1032,["path"])]),i.createVNode(i.unref(z.NButton),{disabled:!u.value||a.value.configuratorParams.items.length<=1,type:"error",size:"medium",class:"mt-5",onClick:V=>L(W)},{default:i.withCtx(()=>[i.createVNode(H)]),_:1},8,["disabled","onClick"])]))),128))]),u.value?(i.openBlock(),i.createBlock(i.unref(z.NButton),{key:1,disabled:N.value,type:"default",class:"self-center",onClick:I},{default:i.withCtx(()=>[i.createVNode(Y),P[10]||(P[10]=i.createTextVNode(" Добавить изделие ",-1))]),_:1},8,["disabled"])):i.createCommentVNode("",!0)]),i.createVNode(i.unref(z.NFormItem),{path:"marker",label:"Маркировка распила"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInput),{value:a.value.marker??null,disabled:!u.value,placeholder:"Введите маркировку распила",onInput:P[4]||(P[4]=X=>c("marker")),"onUpdate:value":P[5]||(P[5]=X=>O("marker",X??null)),onFocus:i.unref(Le)},null,8,["value","disabled","onFocus"])]),_:1}),k.value?(i.openBlock(),i.createBlock(i.unref(z.NCheckbox),{key:1,checked:a.value.isAdditionalSale??!1,"true-value":!0,"false-value":!1,"onUpdate:checked":P[6]||(P[6]=X=>{a.value.isAdditionalSale=X??!1,O("isAdditionalSale",X??!1)})},{default:i.withCtx(()=>[...P[11]||(P[11]=[i.createTextVNode(" ДопПродажа ",-1)])]),_:1},8,["checked"])):i.createCommentVNode("",!0),i.createVNode(i.unref(z.NSpin),{show:_.value,size:"small",class:"grow"},{default:i.withCtx(()=>{var X;return[b.value&&u.value&&w.value?(i.openBlock(),i.createElementBlock("div",c0,[i.createElementVNode("div",null,[P[12]||(P[12]=i.createTextVNode(" Итого: ",-1)),i.createElementVNode("span",d0,i.toDisplayString(w.value.toLocaleString())+" "+i.toDisplayString(u.value.currency.symbol),1)]),b.value.quantity&&u.value?(i.openBlock(),i.createElementBlock("div",u0,[i.createElementVNode("span",h0,"("+i.toDisplayString(b.value.quantity)+" шт.",1),P[13]||(P[13]=i.createTextVNode(" x ",-1)),i.createElementVNode("span",f0,i.toDisplayString((X=u.value.costRub)==null?void 0:X.toLocaleString())+" "+i.toDisplayString(u.value.currency.symbol)+"/шт.)",1)])):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)]}),_:1},8,["show"]),i.createElementVNode("div",m0,[b.value&&!_.value?(i.openBlock(),i.createBlock(i.unref(z.NButton),{key:0,loading:t.isSubmitProcessing,disabled:R.value,type:"primary",class:"self-start",onClick:P[7]||(P[7]=X=>s("submit",a.value))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(a.value.isNewRec()?"В корзину":"Изменить"),1)]),_:1},8,["loading","disabled"])):(i.openBlock(),i.createBlock(i.unref(z.NButton),{key:1,loading:_.value,disabled:R.value,type:"info",class:"self-start",onClick:T},{default:i.withCtx(()=>[...P[14]||(P[14]=[i.createTextVNode(" Рассчитать ",-1)])]),_:1},8,["loading","disabled"]))])]}),_:1},8,["model","rules"])}}}),p0={class:"flex flex-col gap-2"},y0={class:"w-104 flex grow flex-col px-5"},b0={},Fd=i.defineComponent({...b0,__name:"sandwich-configurator",props:{eventEmitter:{},showSlugs:{type:Boolean},showProperties:{type:Boolean},showProductCosts:{type:[Boolean,Function]},allowNameClick:{type:[Boolean,Function]},allowPriceClick:{type:[Boolean,Function]},showPriceHistory:{type:[Boolean,Function]},showCostDate:{type:[Boolean,Function]},isProductItemSelected:{type:Function},showProductAddToCartButton:{type:[Boolean,String,Function]},showProductRequiredButton:{type:[Boolean,String,Function]},showProductEditButton:{type:[Boolean,String,Function]},currencyRates:{},productContextButtonsConfig:{type:Function},settings:{},cartItem:{}},emits:["submit","click:view-switch"],setup(t,{emit:e}){const n=t,r=e,s=i.useTemplateRef("sandwich-configurator-form"),o=i.ref(n.cartItem),a=i.ref({width:{},length:{},quantity:{},marker:{},product:{}}),l=i.ref(!1),c=async()=>{var h,f;(f=(h=s.value)==null?void 0:h.formReference)==null||f.validate(g=>{if(!g){l.value=!0;const m=M.cloneDeep(o.value);"items"in m.configuratorParams&&delete m.configuratorParams.items,r("submit",m,a.value,()=>{l.value=!1,i.nextTick(()=>{var p,y;(y=(p=s.value)==null?void 0:p.formReference)==null||y.restoreValidation()})})}}).catch(M.noop)},d=h=>{a.value[`items.${h}.width`]={},a.value[`items.${h}.length`]={},a.value[`items.${h}.count`]={}},u=h=>{delete a.value[`items.${h}.width`],delete a.value[`items.${h}.length`],delete a.value[`items.${h}.count`]};return i.onMounted(()=>{n.cartItem.configuratorParams.items.forEach((h,f)=>{a.value[`items.${f}.width`]={},a.value[`items.${f}.length`]={},a.value[`items.${f}.count`]={}})}),i.watch(()=>n.cartItem,h=>{o.value=new K.OrderItemBase(h)},{deep:!0}),(h,f)=>{const g=z.NButton;return i.openBlock(),i.createElementBlock("div",p0,[t.settings.allowShowTable&&o.value.isNewRec()?(i.openBlock(),i.createBlock(g,{key:0,type:"tertiary",class:"self-center",onClick:f[0]||(f[0]=m=>r("click:view-switch"))},{default:i.withCtx(()=>[...f[2]||(f[2]=[i.createTextVNode(" Показать в виде списка ",-1)])]),_:1})):i.createCommentVNode("",!0),i.createElementVNode("div",y0,[i.createVNode(Ed,{ref:"sandwich-configurator-form",value:o.value,"onUpdate:value":f[1]||(f[1]=m=>o.value=m),validation:a.value,settings:t.settings,"event-emitter":t.eventEmitter,"is-submit-processing":l.value,onSubmit:c,onAddItem:d,onRemoveItem:u},null,8,["value","validation","settings","event-emitter","is-submit-processing"])])])}}}),_0={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function w0(t,e){return i.openBlock(),i.createElementBlock("svg",_0,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M416 128L192 384l-96-96"},null,-1)])])}const x0=i.markRaw({name:"ion-checkmark",render:w0}),k0={key:0,class:"-mt-1 text-sm text-gray-500"},v0={class:"font-bold"},C0={class:"flex flex-col gap-3"},S0={key:0,class:"mt-4 mb-3 flex flex-col gap-1.5"},B0={class:"flex flex-col gap-1 text-sm text-gray-700"},T0={key:0},$0={key:1},N0={"form-array-name":"items",class:"flex flex-col gap-3"},R0={class:"min-w-0 flex-1"},P0={class:"relative flex flex-col gap-3 lg:!flex-row lg:!items-start lg:!gap-6"},E0={class:"grid grid-cols-1 gap-2 sm:grid-cols-2 lg:!flex-[2]"},F0={class:"grid grid-cols-1 gap-2 sm:grid-cols-2 lg:!grid-cols-[1fr_2fr] lg:!flex-[3]"},V0={key:0,class:"pointer-events-none absolute bottom-2 right-3 flex h-8 w-8 items-center justify-center"},I0={class:"mt-1 flex flex-col gap-y-1 text-sm text-gray-500 lg:!flex-row lg:!gap-6"},A0={key:0,class:"lg:!flex-[2]"},M0={class:"font-bold"},O0={key:1,class:"lg:!flex-[3]"},z0={class:"font-bold"},D0={key:1,class:"min-w-0 flex flex-col items-end gap-1 text-right text-sm text-gray-700 border-t border-gray-200 pt-2"},L0={key:0},H0={class:"font-bold"},W0={key:1},j0={class:"font-bold"},q0={class:"flex flex-wrap items-center gap-3"},X0={},Vd=i.defineComponent({...X0,__name:"sandwich-m2-configurator-form",props:{value:{},eventEmitter:{},showSlugs:{type:Boolean},showProperties:{type:Boolean},showProductCosts:{type:[Boolean,Function]},allowNameClick:{type:[Boolean,Function]},allowPriceClick:{type:[Boolean,Function]},showPriceHistory:{type:[Boolean,Function]},showCostDate:{type:[Boolean,Function]},isProductItemSelected:{},showProductAddToCartButton:{type:[Boolean,String,Function]},showProductRequiredButton:{type:[Boolean,String,Function]},showProductEditButton:{type:[Boolean,String,Function]},currencyRates:{},productContextButtonsConfig:{},settings:{},isProductSearching:{type:Boolean,default:!1},isSubmitProcessing:{type:Boolean,default:!1},validation:{default:void 0},itemStates:{default:()=>[]}},emits:["submit","update:value","add-item","remove-item","item-reset"],setup(t,{expose:e,emit:n}){var W;const r=t,s=n,o=i.useTemplateRef("form-reference"),a=i.useTemplateRef("widthInputs"),l=r.value==null?[]:M.cloneDeep(i.toRaw(r.value)),c=i.ref(l.map(V=>new K.OrderItemBase(V))),d=i.computed(()=>({items:c.value})),u=i.ref({...r.validation}),h=V=>{var j;delete u.value[V],(j=o.value)==null||j.restoreValidation()},f=i.ref(null),g=i.ref(null),m=i.computed(()=>{var V,j;return((j=(V=c.value[0])==null?void 0:V.category)==null?void 0:j.products)??[]}),p=i.computed(()=>m.value.map(V=>({label:V.name,value:V.id}))),y=(V,j,U)=>{const ee=V!=null&&V>0,he=j!=null&&j>0;return!ee&&!he?null:ee&&he?`от ${V} ${U} до ${j} ${U}`:ee?`от ${V} ${U}`:`до ${j} ${U}`},b=i.computed(()=>{var V,j;return y(r.settings.minWidth,(j=(V=f.value)==null?void 0:V.properties)==null?void 0:j.width,"мм")}),_=i.computed(()=>{var V,j;return y(r.settings.minLength,(j=(V=f.value)==null?void 0:V.properties)==null?void 0:j.length,"мм")}),B=i.computed(()=>{const V={};return c.value.forEach((j,U)=>{var ee,he,Be,Te,He,ce,mt,$e;V[`items.${U}.configuratorParams.width`]=[ae.required,ae.min(r.settings.minWidth),...(he=(ee=f.value)==null?void 0:ee.properties)!=null&&he.width?[ae.max(f.value.properties.width)]:[],ae.step(1),We.serverValidation((Be=u.value[`items.${U}.width`])==null?void 0:Be.feedback)],V[`items.${U}.configuratorParams.length`]=[ae.required,ae.min(r.settings.minLength),...(He=(Te=f.value)==null?void 0:Te.properties)!=null&&He.length?[ae.max(f.value.properties.length)]:[],ae.step(1),We.serverValidation((ce=u.value[`items.${U}.length`])==null?void 0:ce.feedback)],V[`items.${U}.quantity`]=[ae.required,ae.min(1),ae.step(1),We.serverValidation((mt=u.value[`items.${U}.quantity`])==null?void 0:mt.feedback)],V[`items.${U}.marker`]=[We.serverValidation(($e=u.value[`items.${U}.marker`])==null?void 0:$e.feedback)]}),V});i.watch(()=>r.validation,V=>{u.value={...V},Object.values(V).some(U=>U==null?void 0:U.feedback)&&i.nextTick(()=>{var U;return(U=o.value)==null?void 0:U.validate(M.noop).catch(M.noop)})},{deep:!0});const k=i.ref(r.settings.canSetDopProdaga??!1),N=i.computed(()=>{const V=f.value;return V?c.value.some(j=>{var Be,Te;const U=j.configuratorParams,ee=(Be=V.properties)==null?void 0:Be.width,he=(Te=V.properties)==null?void 0:Te.length;return U.width===0||U.width<r.settings.minWidth||ee!=null&&U.width>ee||U.length===0||U.length<r.settings.minLength||he!=null&&U.length>he||j.quantity===0||j.quantity<1}):!0}),R=i.computed(()=>!f.value||N.value||c.value.length===0),w=i.computed(()=>{const V=c.value[0];return V!=null&&!V.isNewRec()}),C=V=>r.itemStates[V]??"idle",x=V=>C(V)==="success",T=V=>C(V)==="loading",$=i.computed(()=>c.value.length===0?!0:c.value.every((V,j)=>{const U=C(j);return U==="success"||U==="loading"})),F=V=>V.width===0||V.length===0?0:V.width*V.length/1e6,I=V=>{var Be;const j=V.configuratorParams,U=F(j),ee=((Be=f.value)==null?void 0:Be.costRub)??0,he=V.quantity??0;return!U||!he?0:Math.round(U*ee*he*100)/100},L=i.computed(()=>M.sum(c.value.map(V=>{const j=V.configuratorParams;return!j.width||j.length===0||!V.quantity?0:j.width*j.length*V.quantity/1e6}))),O=i.computed(()=>Math.round(M.sum(c.value.map(V=>I(V)))*100)/100),Z=()=>{var V,j,U;return new K.OrderItemBase({category:(V=c.value[0])==null?void 0:V.category,configurator:(j=c.value[0])==null?void 0:j.configurator,product:f.value??new K.ClientProduct,quantity:1,isAdditionalSale:(U=c.value[0])==null?void 0:U.isAdditionalSale,configuratorParams:{width:0,length:0}})},ne=V=>{if(!V){f.value=null,g.value=null,c.value.forEach(U=>{U.product=new K.ClientProduct}),s("update:value",c.value);return}const j=m.value.find(U=>U.id===V);j&&(f.value=j,g.value=V,c.value.forEach((U,ee)=>{var he,Be;U.product=j,(he=j.properties)!=null&&he.width&&U.configuratorParams.width>j.properties.width&&(U.configuratorParams.width=j.properties.width),(Be=j.properties)!=null&&Be.length&&U.configuratorParams.length>j.properties.length&&(U.configuratorParams.length=j.properties.length),s("item-reset",ee)}),s("update:value",c.value))},E=V=>{var ee,he;const j=c.value[V],U=f.value;U&&((ee=U.properties)!=null&&ee.width&&j.configuratorParams.width>U.properties.width&&(j.configuratorParams.width=U.properties.width),(he=U.properties)!=null&&he.length&&j.configuratorParams.length>U.properties.length&&(j.configuratorParams.length=U.properties.length)),s("item-reset",V),s("update:value",c.value)},P=(V,j)=>{c.value[V].marker=j===null||j===""?void 0:j,s("item-reset",V),s("update:value",c.value)},H=V=>{c.value.forEach(j=>{j.isAdditionalSale=V}),s("update:value",c.value)},Y=()=>{c.value.push(Z()),s("update:value",c.value),s("add-item",c.value.length),i.nextTick(()=>{var j,U,ee,he;const V=c.value.length-1;(U=(j=a.value)==null?void 0:j[V])==null||U.focus(),(he=(ee=a.value)==null?void 0:ee[V])==null||he.select()})},D=V=>{c.value.splice(V,1),s("update:value",c.value),s("remove-item",V)};i.watch(()=>r.value,V=>{var he;const U=(V==null?[]:M.cloneDeep(i.toRaw(V))).map(Be=>new K.OrderItemBase(Be));c.value=U.length>0?U:[Z()];const ee=(he=c.value[0])==null?void 0:he.product;ee&&!ee.isNewRec()?(f.value=ee,g.value=ee.id):(f.value=null,g.value=null)},{deep:!0});const X=()=>{var j;if(f.value!==null)return;const V=(j=m.value[0])==null?void 0:j.id;V!=null&&ne(V)};return i.watch(m,()=>{X()}),i.onMounted(()=>{var j;c.value.length===0&&(c.value=[Z()]);const V=(j=c.value[0])==null?void 0:j.product;V&&!V.isNewRec()&&(f.value=V,g.value=V.id),X()}),e({validate:(W=o.value)==null?void 0:W.validate,formReference:o}),(V,j)=>{const U=x0,ee=zr,he=Pd;return i.withDirectives((i.openBlock(),i.createBlock(i.unref(z.NForm),{ref:"form-reference",model:d.value,rules:B.value,class:"flex flex-col gap-2 sc-hide-empty-feedback-message"},{default:i.withCtx(()=>{var Be,Te;return[i.createVNode(i.unref(z.NFormItem),{required:!0,"show-feedback":!1,label:"Товар"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NSelect),{value:g.value,"onUpdate:value":[j[0]||(j[0]=He=>g.value=He),ne],options:p.value,placeholder:"Выберите материал",filterable:""},null,8,["value","options"])]),_:1}),((Be=f.value)==null?void 0:Be.costRub)!=null?(i.openBlock(),i.createElementBlock("div",k0,[i.createElementVNode("span",v0,i.toDisplayString(f.value.code),1),i.createTextVNode(" — "+i.toDisplayString(f.value.costRub.toLocaleString())+" "+i.toDisplayString(f.value.currency.symbol)+"/м² ",1)])):i.createCommentVNode("",!0),i.createElementVNode("div",C0,[f.value?(i.openBlock(),i.createElementBlock("div",S0,[j[6]||(j[6]=i.createElementVNode("div",{class:"w-full font-bold"},"Размеры изделий",-1)),i.createElementVNode("div",B0,[b.value?(i.openBlock(),i.createElementBlock("div",T0,"Ширина "+i.toDisplayString(b.value)+".",1)):i.createCommentVNode("",!0),_.value?(i.openBlock(),i.createElementBlock("div",$0,"Длина "+i.toDisplayString(_.value)+".",1)):i.createCommentVNode("",!0)])])):i.createCommentVNode("",!0),i.createElementVNode("div",N0,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(d.value.items,(He,ce)=>{var mt;return i.openBlock(),i.createElementBlock("div",{key:ce,class:i.normalizeClass(["flex min-w-0 items-start gap-2 border-b border-gray-100 last:border-0",x(ce)?"opacity-70":""])},[i.createElementVNode("div",R0,[i.createElementVNode("div",P0,[i.createElementVNode("div",E0,[i.createVNode(i.unref(z.NFormItem),{path:`items.${ce}.configuratorParams.width`,label:"Ширина, мм",class:"min-w-0"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInputNumber),{ref_for:!0,ref:"widthInputs",value:d.value.items[ce].configuratorParams.width,"onUpdate:value":[$e=>d.value.items[ce].configuratorParams.width=$e,$e=>E(ce)],parse:i.unref(lt),"show-button":!1,disabled:!f.value||x(ce)||T(ce),placeholder:"Ширина",class:"w-full",onKeydown:j[1]||(j[1]=$e=>i.unref(tt)($e)),onInput:$e=>h(`items.${ce}.width`),onFocus:i.unref(Le)},null,8,["value","onUpdate:value","parse","disabled","onInput","onFocus"])]),_:2},1032,["path"]),i.createVNode(i.unref(z.NFormItem),{path:`items.${ce}.configuratorParams.length`,label:"Длина, мм",class:"min-w-0"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInputNumber),{value:d.value.items[ce].configuratorParams.length,"onUpdate:value":[$e=>d.value.items[ce].configuratorParams.length=$e,$e=>E(ce)],parse:i.unref(lt),"show-button":!1,disabled:!f.value||x(ce)||T(ce),placeholder:"Длина",class:"w-full",onKeydown:j[2]||(j[2]=$e=>i.unref(tt)($e)),onInput:$e=>h(`items.${ce}.length`),onFocus:i.unref(Le)},null,8,["value","onUpdate:value","parse","disabled","onInput","onFocus"])]),_:2},1032,["path"])]),i.createElementVNode("div",F0,[i.createVNode(i.unref(z.NFormItem),{path:`items.${ce}.quantity`,label:"Количество, шт",class:"min-w-0"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInputNumber),{value:d.value.items[ce].quantity,"onUpdate:value":[$e=>d.value.items[ce].quantity=$e,$e=>E(ce)],parse:i.unref(lt),"show-button":!1,disabled:!f.value||x(ce)||T(ce),placeholder:"Кол-во",class:"w-full",onKeydown:j[3]||(j[3]=$e=>i.unref(tt)($e,!1)),onInput:$e=>h(`items.${ce}.quantity`),onFocus:i.unref(Le)},null,8,["value","onUpdate:value","parse","disabled","onInput","onFocus"])]),_:2},1032,["path"]),i.createVNode(i.unref(z.NFormItem),{path:`items.${ce}.marker`,label:"Маркировка",class:"min-w-0"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInput),{value:d.value.items[ce].marker??null,disabled:!f.value||x(ce)||T(ce),placeholder:"Маркировка",class:"w-full",onInput:$e=>h(`items.${ce}.marker`),"onUpdate:value":$e=>P(ce,$e??null),onFocus:i.unref(Le)},null,8,["value","disabled","onInput","onUpdate:value","onFocus"])]),_:2},1032,["path"])]),T(ce)||x(ce)?(i.openBlock(),i.createElementBlock("div",V0,[T(ce)?(i.openBlock(),i.createBlock(i.unref(z.NSpin),{key:0,size:14})):x(ce)?(i.openBlock(),i.createBlock(U,{key:1,class:"text-green-600 text-xl"})):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)]),i.createElementVNode("div",I0,[He.configuratorParams.width>0&&He.configuratorParams.length>0?(i.openBlock(),i.createElementBlock("div",A0,[j[7]||(j[7]=i.createTextVNode(" Площадь (S) = ",-1)),i.createElementVNode("span",M0,i.toDisplayString(F(He.configuratorParams).toLocaleString(void 0,{maximumFractionDigits:4}))+" м²",1)])):i.createCommentVNode("",!0),I(He)>0?(i.openBlock(),i.createElementBlock("div",O0,[j[8]||(j[8]=i.createTextVNode(" Итого: ",-1)),i.createElementVNode("span",z0,i.toDisplayString(I(He).toLocaleString())+" "+i.toDisplayString((mt=f.value)==null?void 0:mt.currency.symbol),1)])):i.createCommentVNode("",!0)])]),w.value?i.createCommentVNode("",!0):(i.openBlock(),i.createBlock(i.unref(z.NButton),{key:0,disabled:T(ce)||d.value.items.length<=1,type:"error",size:"medium",class:"mt-5 shrink-0 lg:!ml-4",onClick:$e=>D(ce)},{default:i.withCtx(()=>[i.createVNode(ee)]),_:1},8,["disabled","onClick"]))],2)}),128))]),f.value?(i.openBlock(),i.createElementBlock("div",D0,[L.value>0?(i.openBlock(),i.createElementBlock("div",L0,[j[9]||(j[9]=i.createTextVNode(" Общая площадь: ",-1)),i.createElementVNode("span",H0,i.toDisplayString(L.value.toLocaleString(void 0,{maximumFractionDigits:4}))+" м²",1)])):i.createCommentVNode("",!0),O.value>0?(i.openBlock(),i.createElementBlock("div",W0,[j[10]||(j[10]=i.createTextVNode(" Итого: ",-1)),i.createElementVNode("span",j0,i.toDisplayString(O.value.toLocaleString())+" "+i.toDisplayString(f.value.currency.symbol),1)])):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)]),k.value?(i.openBlock(),i.createBlock(i.unref(z.NCheckbox),{key:1,checked:((Te=c.value[0])==null?void 0:Te.isAdditionalSale)??!1,"true-value":!0,"false-value":!1,"onUpdate:checked":j[4]||(j[4]=He=>H(He??!1))},{default:i.withCtx(()=>[...j[11]||(j[11]=[i.createTextVNode(" ДопПродажа ",-1)])]),_:1},8,["checked"])):i.createCommentVNode("",!0),i.createElementVNode("div",q0,[f.value&&!w.value?(i.openBlock(),i.createBlock(i.unref(z.NButton),{key:0,disabled:N.value,type:"default",onClick:Y},{default:i.withCtx(()=>[i.createVNode(he),j[12]||(j[12]=i.createTextVNode(" Добавить изделие ",-1))]),_:1},8,["disabled"])):i.createCommentVNode("",!0),i.createVNode(i.unref(z.NButton),{loading:t.isSubmitProcessing,disabled:R.value||$.value,type:"primary",class:"ml-auto",onClick:j[5]||(j[5]=He=>s("submit",c.value))},{default:i.withCtx(()=>{var He;return[i.createTextVNode(i.toDisplayString((He=c.value[0])!=null&&He.isNewRec()?"В корзину":"Изменить"),1)]}),_:1},8,["loading","disabled"])])]}),_:1},8,["model","rules"])),[[i.unref(Ua)]])}}}),Y0={class:"flex flex-col gap-2"},U0={class:"min-w-56 max-w-3xl flex grow flex-col px-5"},K0={},Id=i.defineComponent({...K0,__name:"sandwich-m2-configurator",props:{eventEmitter:{},showSlugs:{type:Boolean},showProperties:{type:Boolean},showProductCosts:{type:[Boolean,Function]},allowNameClick:{type:[Boolean,Function]},allowPriceClick:{type:[Boolean,Function]},showPriceHistory:{type:[Boolean,Function]},showCostDate:{type:[Boolean,Function]},isProductItemSelected:{type:Function},showProductAddToCartButton:{type:[Boolean,String,Function]},showProductRequiredButton:{type:[Boolean,String,Function]},showProductEditButton:{type:[Boolean,String,Function]},currencyRates:{},productContextButtonsConfig:{type:Function},settings:{},cartItems:{}},emits:["click:view-switch","submit"],setup(t,{emit:e}){const n=t,r=e,s=i.useTemplateRef("sandwich-m2-configurator-form"),o=i.ref((n.cartItems??[]).map(B=>new K.OrderItemBase(B))),a=i.ref([]),l=i.ref({width:{},length:{},quantity:{},marker:{}}),c=["width","length","quantity","marker"],d=B=>{c.forEach(k=>{l.value[`items.${B}.${k}`]={}})},u=B=>{c.forEach(k=>{delete l.value[`items.${B}.${k}`]})},h=i.computed(()=>a.value.includes("loading")),f=()=>({width:{},length:{},quantity:{},marker:{}}),g=(B,k)=>{let N=!1;return c.forEach(R=>{var F,I;const w=`items.0.${R}`,C=(F=B[R])==null?void 0:F.feedback,T=((I=B[w])==null?void 0:I.feedback)??C,$=`items.${k}.${R}`;T?(l.value[$]=B[w]??B[R],N=!0):l.value[$]={}}),N},m=(B,k,N)=>new Promise(R=>{const w=f();let C=!1;const x=T=>{if(C)return;C=!0;const $=g(w,k),F=(T===void 0?!$:T)&&!$;a.value[k]=F?"success":"error",i.nextTick(()=>{var I,L;(L=(I=s.value)==null?void 0:I.formReference)==null||L.restoreValidation()}),R(F)};a.value[k]="loading",r("submit",[M.cloneDeep(B)],w,x,{isFinalSuccessfulCompletion:N})}),p=async()=>{var N,R;try{await((R=(N=s.value)==null?void 0:N.formReference)==null?void 0:R.validate())}catch{return}const B=o.value.map((w,C)=>C).filter(w=>{const C=a.value[w]??"idle";return C!=="success"&&C!=="loading"});let k=!0;for(let w=0;w<B.length;w+=1){const C=B[w],x=o.value[C];if(!x)break;const $=w===B.length-1&&k;await m(x,C,$)||(k=!1)}},y=B=>{const k=B-1;a.value[k]="idle",d(k)},b=B=>{a.value.splice(B,1),u(B);for(let k=B;k<o.value.length;k+=1)d(k)},_=B=>{const k=a.value[B];(k==="success"||k==="error")&&(a.value[B]="idle")};return i.onMounted(()=>{(n.cartItems??[]).forEach((B,k)=>{a.value[k]="idle",d(k)})}),i.watch(()=>n.cartItems,B=>{const k=(B??[]).map(N=>new K.OrderItemBase(N));o.value=k,a.value=k.map(()=>"idle"),k.forEach((N,R)=>{d(R)})},{deep:!0}),(B,k)=>{var R;const N=z.NButton;return i.openBlock(),i.createElementBlock("div",Y0,[t.settings.allowShowTable&&((R=o.value[0])!=null&&R.isNewRec())?(i.openBlock(),i.createBlock(N,{key:0,type:"tertiary",class:"self-center",onClick:k[0]||(k[0]=w=>r("click:view-switch"))},{default:i.withCtx(()=>[...k[2]||(k[2]=[i.createTextVNode(" Показать в виде списка ",-1)])]),_:1})):i.createCommentVNode("",!0),i.createElementVNode("div",U0,[i.createVNode(Vd,{ref:"sandwich-m2-configurator-form",value:o.value,"onUpdate:value":k[1]||(k[1]=w=>o.value=w),validation:l.value,settings:t.settings,"event-emitter":t.eventEmitter,"is-submit-processing":h.value,"item-states":a.value,onSubmit:p,onAddItem:y,onRemoveItem:b,onItemReset:_},null,8,["value","validation","settings","event-emitter","is-submit-processing","item-states"])])])}}}),G0={key:0,class:"flex justify-center p-4"},Z0={key:1,class:"p-4 text-center text-red-500"},Q0={key:2,class:"flex justify-center"},J0={class:"!bg-white p-4 m-2 rounded-md w-max"},eb={key:3,class:"p-4 text-center text-gray-500"},tb={},Ad=i.defineComponent({...tb,__name:"dynamic-configurator",props:{eventEmitter:{},settings:{},editor:{},cartItem:{},category:{}},setup(t){const e=t,n=i.ref(!1),r=i.ref(null),s=i.ref(e.cartItem??null),o=i.ref(null),a=f=>{const g=f.configuratorParams;return[new K.OrderItemBase({...f,quantity:f.quantity??1,marker:f.marker,configuratorParams:{width:(g==null?void 0:g.width)??f.width??0,length:(g==null?void 0:g.length)??f.length??0}})]},l=i.ref(e.editor===K.ConfiguratorsEnum.SandwichM2&&e.cartItem!=null?a(e.cartItem):null),c=()=>{var g,m,p;if(!e.settings){r.value="Настройки конфигуратора не указаны в свойствах категории.";return}const f={category:((g=e.cartItem)==null?void 0:g.category)??e.category,configurator:e.editor,quantity:1};switch(e.editor){case"kozyrek":{const y=e.settings;s.value=new K.OrderItemBase({...f,configuratorParams:{length:y.stripMinLength,linesAngles:[],linesWidths:[],startTailType:M.some(y.startTailConfigs,b=>b.isDefault)?(m=y.startTailConfigs)==null?void 0:m.findIndex(b=>b.isDefault):void 0,endTailType:M.some(y.endTailConfigs,b=>b.isDefault)?(p=y.endTailConfigs)==null?void 0:p.findIndex(b=>b.isDefault):void 0,colorSide:"top"}});break}case"mosquitto":{const y=e.settings;s.value=new K.OrderItemBase({...f,configuratorParams:{width:0,height:0,netType:y.netType[0]||"",color:y.color[0]||"",mountType:y.mountType[0]||""}});break}case"strip":{const y=e.settings;o.value=[new K.OrderItemBase({...f,length:y.minLength,configuratorParams:{linesWidths:[0]}})];break}case"metal_for_doors":{const y=e.settings;s.value=new K.OrderItemBase({...f,configuratorParams:{width:y.minWidth,length:y.minLength}});break}case"sandwich":{s.value=new K.OrderItemBase({...f,configuratorParams:{calculationId:"",items:[{width:0,length:0,count:1}]}});break}case"sandwich_m2":{l.value=[new K.OrderItemBase({...f,configuratorParams:{width:0,length:0}})];break}default:r.value=`Неподдерживаемый тип конфигуратора: ${e.editor}.`}s.value&&(s.value.marker=void 0)},d=(f,g,m)=>{const p=y=>{m==null||m(),y&&c()};e.eventEmitter.emit("configurator:submit",{cartItem:f,callback:p,validation:g})},u=(f,g,m,p)=>{const y=f[0];if(!y){m==null||m();return}const b=(p==null?void 0:p.isFinalSuccessfulCompletion)===!0,_=B=>{m==null||m(B),b&&B&&c()};e.eventEmitter.emit("configurator:submit",{cartItem:y,callback:_,validation:g,additionalParams:p})},h=()=>{e.category&&e.eventEmitter.emit("configurator:click-view-switch",{category:e.category})};return i.onMounted(()=>{e.cartItem||c()}),(f,g)=>{const m=z.NSpin;return i.openBlock(),i.createElementBlock(i.Fragment,null,[n.value?(i.openBlock(),i.createElementBlock("div",G0,[i.createVNode(m,{size:"large"})])):r.value?(i.openBlock(),i.createElementBlock("div",Z0,i.toDisplayString(r.value),1)):i.createCommentVNode("",!0),t.settings!==null&&(s.value!==null||o.value!==null||l.value!==null)?(i.openBlock(),i.createElementBlock("div",Q0,[i.createElementVNode("div",J0,[t.editor==="kozyrek"?(i.openBlock(),i.createBlock(xd,{key:0,"event-emitter":t.eventEmitter,settings:t.settings,"cart-item":s.value,"onClick:viewSwitch":h,onSubmit:d},null,8,["event-emitter","settings","cart-item"])):t.editor==="mosquitto"?(i.openBlock(),i.createBlock(Cd,{key:1,"event-emitter":t.eventEmitter,settings:t.settings,"cart-item":s.value,onSubmit:d},null,8,["event-emitter","settings","cart-item"])):t.editor==="strip"?(i.openBlock(),i.createBlock($d,{key:2,"event-emitter":t.eventEmitter,settings:t.settings,"cart-items":o.value,"onClick:viewSwitch":h,onSubmit:d},null,8,["event-emitter","settings","cart-items"])):t.editor==="metal_for_doors"?(i.openBlock(),i.createBlock(Rd,{key:3,"event-emitter":t.eventEmitter,settings:t.settings,"cart-item":s.value,"onClick:viewSwitch":h,onSubmit:d},null,8,["event-emitter","settings","cart-item"])):t.editor==="sandwich"?(i.openBlock(),i.createBlock(Fd,{key:4,"event-emitter":t.eventEmitter,settings:t.settings,"cart-item":s.value,"onClick:viewSwitch":h,onSubmit:d},null,8,["event-emitter","settings","cart-item"])):t.editor==="sandwich_m2"?(i.openBlock(),i.createBlock(Id,{key:5,"event-emitter":t.eventEmitter,settings:t.settings,"cart-items":l.value,"onClick:viewSwitch":h,onSubmit:u},null,8,["event-emitter","settings","cart-items"])):i.createCommentVNode("",!0)])])):(i.openBlock(),i.createElementBlock("div",eb,' Конфигуратор "'+i.toDisplayString(t.editor)+'" не поддерживается. ',1))],64)}}});function Md(t){return Object.values(K.ConfiguratorsEnum).includes(t)}function Od(t){var e;return((e=t.properties)==null?void 0:e.configurator)!==K.ConfiguratorsEnum.Sandwich?!0:t.properties.configuratorSettings!==void 0&&M.isArray(t.products)&&t.products.length>0}const nb={key:0,class:"pt-0.5"},ib={key:0},rb={class:"line-through"},sb={key:0},ob={key:1},ab={class:"flex flex-row gap-1"},lb={key:0},cb={class:"m-0 list-inside list-disc p-0 pl-1.5 text-xs text-gray-500"},db={class:"flex flex-col gap-2.5 sm:flex-row"},ub={class:"mt-2"},hb={key:1,class:"flex flex-col"},fb={},mb=i.defineComponent({...fb,__name:"category-collapse-item",props:{categoryItem:{},filteredItems:{},isCategoryItemSelected:{type:[Boolean,String,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},canShowConfigurator:{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(or,"medium"),r=i.computed(()=>{var W;return(W=e==null?void 0:e.filteredItems)==null?void 0:W[e.categoryItem.id]}),s=i.computed(()=>{var W,V;return M.isArray((W=e.categoryItem)==null?void 0:W.categories)&&((V=e.categoryItem.categories)==null?void 0:V.length)>0}),o=i.computed(()=>{var W;return M.isArray((W=e.categoryItem)==null?void 0:W.products)?e.categoryItem.products:[]}),a=i.computed(()=>Object.entries(e.categoryItem.currencyRates??{}).map(([W,V])=>`${V} руб./${$(W)}`).join(", ")),l=i.computed(()=>M.isUndefined(e.filteredItems)||r.value==="*"?o.value:o.value.filter(W=>{var j;const V=(j=r.value)==null?void 0:j.products;return M.isArray(V)&&V.includes(W.id)})),c=i.computed(()=>l.value.length>0),d=i.computed(()=>M.isFunction(e.showCategoryHideForClientButton)?e.showCategoryHideForClientButton(e.categoryItem):e.showCategoryHideForClientButton),u=i.computed(()=>M.isFunction(e.showCategoryPinButton)?e.showCategoryPinButton(e.categoryItem):e.showCategoryPinButton),h=i.computed(()=>M.isFunction(e.showCategoryRequiredButton)?e.showCategoryRequiredButton(e.categoryItem):e.showCategoryRequiredButton),f=i.computed(()=>M.isFunction(e.showCategoryEditButton)?e.showCategoryEditButton(e.categoryItem):e.showCategoryEditButton),g=i.computed(()=>{var W,V,j;return((W=e.categoryItem.properties)==null?void 0:W.configurator)!==void 0&&Md((V=e.categoryItem.properties)==null?void 0:V.configurator)&&Od(e.categoryItem)&&((j=e.categoryItem.properties)==null?void 0:j.configuratorSettings)!==void 0&&(M.isFunction(e.canShowConfigurator)?e.canShowConfigurator():e.canShowConfigurator)}),m=i.computed(()=>g.value&&(M.isFunction(e.showConfigurator)?e.showConfigurator(e.categoryItem):e.showConfigurator)),p=i.computed(()=>M.isNil(e.categoryContextButtonsConfig)?[]:M.isFunction(e.categoryContextButtonsConfig)?e.categoryContextButtonsConfig(e.categoryItem):e.categoryContextButtonsConfig),y=i.computed(()=>new K.ClientCategory(e.categoryItem)),b=i.ref(!1),_=i.ref(!1),B=i.computed(()=>!M.isUndefined(e.isCategoryItemSelected)),k=i.computed(()=>M.isFunction(e.isCategoryItemSelected)?e.isCategoryItemSelected(e.categoryItem):e.isCategoryItemSelected===!0),N=i.computed(()=>M.isFunction(e.isCategoryItemSelected)?e.isCategoryItemSelected(e.categoryItem)==="disabled":e.isCategoryItemSelected==="disabled"),R=i.computed(()=>M.isFunction(e.isCategoryItemSelected)?e.isCategoryItemSelected(e.categoryItem)==="indeterminate":e.isCategoryItemSelected==="indeterminate"),w=i.computed(()=>Y.value&&St.getDeviceTypeByResolution()===Qe.laptop?"auto":"fixed"),C=i.useTemplateRef("collapse-item-reference"),x=i.computed(()=>{var W,V;return(V=(W=e.categoryItem.properties)==null?void 0:W.templateCost)==null?void 0:V.priceCoefficient}),T=i.computed(()=>{var W,V;return(V=(W=e.categoryItem.properties)==null?void 0:W.templateCost)==null?void 0:V.increasePercent}),$=(W,V="ru-RU")=>0 .toLocaleString(V,{style:"currency",currency:W,minimumFractionDigits:0,maximumFractionDigits:0}).replaceAll(/\d/g,"").trim(),F=W=>{e.eventEmitter.emit("category:checked",{category:e.categoryItem,checked:W,target:C.value})},I=(W,V)=>{e.eventEmitter.emit("category:header-click",{categoryItem:e.categoryItem,expanded:V,isLoadingState:b,target:C.value})},L=()=>{e.eventEmitter.emit("category:hide",{category:e.categoryItem,target:C.value})},O=()=>{e.eventEmitter.emit("category:required",{category:e.categoryItem,target:C.value})},Z=()=>{e.eventEmitter.emit("category:attach",{category:e.categoryItem,target:C.value})},ne=()=>{e.eventEmitter.emit("category:detach",{category:e.categoryItem,target:C.value})},E=()=>{e.eventEmitter.emit("category:edit",{category:e.categoryItem,target:C.value})},P=W=>{e.eventEmitter.emit("category:context-select",{category:e.categoryItem,key:W,target:C.value})},H=()=>{e.eventEmitter.emit("configurator:click-view-switch",{category:e.categoryItem})},Y=i.ref(0),D=i.computed(()=>Y.value&&o.value.length>0?Wm(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}):[]),X=M.debounce(()=>{Y.value=window.innerWidth},20);return i.onUnmounted(()=>{window.removeEventListener("resize",X)}),window.addEventListener("resize",X),X(),(W,V)=>{const j=z.NCheckbox,U=kf,ee=z.NTooltip,he=_f,Be=z.NTag,Te=pf,He=ff,ce=z.NButton,mt=df,$e=Za,Et=Ga,Wt=Ka,an=Ls,Ct=z.NDropdown,Ln=z.NDataTable,ln=z.NAlert,Jt=z.NSpin;return i.openBlock(),i.createBlock(Qa,{ref:"collapse-item-reference",name:t.categoryItem.id,"data-id":t.categoryItem.id,"onHeader:click":I},{"pre-arrow":i.withCtx(()=>{var Ve,J;return[B.value?(i.openBlock(),i.createElementBlock("div",nb,[i.createVNode(j,{checked:k.value,indeterminate:R.value,disabled:N.value,"onUpdate:checked":F},null,8,["checked","indeterminate","disabled"])])):i.createCommentVNode("",!0),!d.value&&((Ve=y.value)!=null&&Ve.isDisabled)?(i.openBlock(),i.createBlock(ee,{key:1,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(U,{class:"pt-1.5"})]),default:i.withCtx(()=>[V[1]||(V[1]=i.createTextVNode(" Категория скрыта для клиента ",-1))]),_:1})):i.createCommentVNode("",!0),((J=y.value)==null?void 0:J.isFavorite)??!1?(i.openBlock(),i.createBlock(ee,{key:2,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(he,{class:"pt-1.5"})]),default:i.withCtx(()=>[V[2]||(V[2]=i.createTextVNode(" Избранная категория ",-1))]),_:1})):i.createCommentVNode("",!0)]}),header:i.withCtx(()=>{var Ve,J,le,De,ni;return[i.createElementVNode("div",{class:i.normalizeClass({"text-base font-semibold uppercase":!0,"text-gray-400 line-through":t.categoryItem.isHidden,"text-gray-400":(Ve=y.value)==null?void 0:Ve.isDisabled})},[i.createVNode(ee,{disabled:!t.categoryItem.isHidden,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createElementVNode("span",null,i.toDisplayString(t.categoryItem.name),1)]),default:i.withCtx(()=>[V[3]||(V[3]=i.createTextVNode(" Категория скрыта ",-1))]),_:1},8,["disabled"])],2),i.createElementVNode("div",{class:"w-fit",onClick:V[0]||(V[0]=i.withModifiers((...nt)=>i.unref(M.noop)&&i.unref(M.noop)(...nt),["prevent","stop"]))},[(J=t.categoryItem.properties)!=null&&J.m2Price?(i.openBlock(),i.createBlock(Be,{key:0,size:i.unref(n),class:i.normalizeClass({"!pr-0":((le=t.categoryItem.properties)==null?void 0:le.templateCost)&&t.categoryItem.properties.m2PriceRetail&&T.value}),round:""},{default:i.withCtx(()=>{var nt;return[i.createTextVNode(" Установленная стоимость: "+i.toDisplayString(t.categoryItem.properties.m2Price)+" руб./м2 ",1),(nt=t.categoryItem.properties)!=null&&nt.templateCost&&t.categoryItem.properties.m2PriceRetail&&T.value?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[T.value?(i.openBlock(),i.createBlock(Be,{key:0,type:"success",bordered:!1,size:i.unref(n),class:"ml-2 !pr-0",round:""},{default:i.withCtx(()=>[T.value?(i.openBlock(),i.createElementBlock("span",ib,i.toDisplayString(T.value.toFixed(2))+"%",1)):i.createCommentVNode("",!0),i.createVNode(Be,{size:i.unref(n),round:""},{default:i.withCtx(()=>[i.createElementVNode("span",rb,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"])):(De=t.categoryItem.properties)!=null&&De.templateCost?(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[x.value||T.value?(i.openBlock(),i.createBlock(Be,{key:0,size:i.unref(n),round:""},{default:i.withCtx(()=>{var nt;return[x.value?(i.openBlock(),i.createElementBlock("span",sb,i.toDisplayString((nt=x.value)==null?void 0:nt.name),1)):i.createCommentVNode("",!0),T.value?(i.openBlock(),i.createElementBlock("span",ob,i.toDisplayString(T.value>0?"+":"")+i.toDisplayString(T.value.toFixed(2))+"%",1)):i.createCommentVNode("",!0)]}),_:1},8,["size"])):i.createCommentVNode("",!0)],64)):i.createCommentVNode("",!0),a.value?(i.openBlock(),i.createBlock(Be,{key:2,size:i.unref(n),round:""},{default:i.withCtx(()=>[i.createTextVNode(" Фиксированный курс: "+i.toDisplayString(a.value),1)]),_:1},8,["size"])):i.createCommentVNode("",!0),u.value&&((ni=y.value)!=null&&ni.manager)?(i.openBlock(),i.createBlock(Be,{key:3,size:i.unref(n),closable:!0,round:"",class:"align-bottom",onClose:ne},{default:i.withCtx(()=>[i.createVNode(ee,{placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>{var nt,jt;return[i.createElementVNode("span",ab,[i.createVNode(Te),i.createTextVNode(" "+i.toDisplayString((jt=(nt=y.value)==null?void 0:nt.manager)==null?void 0:jt.name),1)])]}),default:i.withCtx(()=>{var nt,jt;return[i.createTextVNode(' Категория закреплена за "'+i.toDisplayString((jt=(nt=y.value)==null?void 0:nt.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",lb,[i.createElementVNode("ul",cb,[t.showSlugs?(i.openBlock(!0),i.createElementBlock(i.Fragment,{key:0},i.renderList({id:t.categoryItem.id,slug:t.categoryItem.slug},(Ve,J)=>(i.openBlock(),i.createElementBlock("li",{key:J}," ("+i.toDisplayString(J)+"): "+i.toDisplayString(Ve),1))),128)):i.createCommentVNode("",!0),t.showProperties?(i.openBlock(!0),i.createElementBlock(i.Fragment,{key:1},i.renderList(t.categoryItem.properties,(Ve,J)=>(i.openBlock(),i.createElementBlock("li",{key:J}," ("+i.toDisplayString(J)+"): "+i.toDisplayString(Ve),1))),128)):i.createCommentVNode("",!0)])])):i.createCommentVNode("",!0)]),"header-extra":i.withCtx(()=>{var Ve;return[i.createElementVNode("div",db,[d.value?(i.openBlock(),i.createBlock(ee,{key:0,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(ce,{ghost:!0,size:i.unref(n),onClick:L},{default:i.withCtx(()=>{var J;return[(J=y.value)!=null&&J.isDisabled?(i.openBlock(),i.createBlock(U,{key:1})):(i.openBlock(),i.createBlock(He,{key:0}))]}),_:1},8,["size"])]),default:i.withCtx(()=>{var J;return[(J=y.value)!=null&&J.isDisabled?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[i.createTextVNode(" Скрыто для клиента"+i.toDisplayString(y.value.hidingComment?`. Причина: '${y.value.hidingComment}'`:""),1)],64)):(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[i.createTextVNode("Видимо клиенту")],64))]}),_:1})):i.createCommentVNode("",!0),u.value&&!((Ve=y.value)!=null&&Ve.manager)?(i.openBlock(),i.createBlock(ee,{key:1,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(ce,{ghost:!0,size:i.unref(n),onClick:Z},{default:i.withCtx(()=>[i.createVNode(mt)]),_:1},8,["size"])]),default:i.withCtx(()=>{var J,le,De;return[(J=y.value)!=null&&J.manager?(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[i.createTextVNode('Категория закреплена за "'+i.toDisplayString(((De=(le=y.value)==null?void 0:le.manager)==null?void 0:De.name)??"-")+'"',1)],64)):(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[i.createTextVNode("Закрепить")],64))]}),_:1})):i.createCommentVNode("",!0),h.value?(i.openBlock(),i.createBlock(ee,{key:2,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(ce,{ghost:!0,disabled:h.value==="disabled",size:i.unref(n),onClick:O},{default:i.withCtx(()=>{var J;return[(J=y.value)!=null&&J.isRequired?(i.openBlock(),i.createBlock(Et,{key:1})):(i.openBlock(),i.createBlock($e,{key:0}))]}),_:1},8,["disabled","size"])]),default:i.withCtx(()=>[V[4]||(V[4]=i.createTextVNode(" Категория, которую нужно предлагать клиенту ",-1))]),_:1})):i.createCommentVNode("",!0),f.value?(i.openBlock(),i.createBlock(ee,{key:3,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(ce,{ghost:!0,size:i.unref(n),type:"primary",onClick:E},{default:i.withCtx(()=>[i.createVNode(Wt)]),_:1},8,["size"])]),default:i.withCtx(()=>[V[5]||(V[5]=i.createTextVNode(" Редактировать ",-1))]),_:1})):i.createCommentVNode("",!0),p.value.length>0?(i.openBlock(),i.createBlock(Ct,{key:4,options:p.value,size:i.unref(n),trigger:"click",onSelect:P},{default:i.withCtx(()=>[i.createVNode(ce,{ghost:!0,size:i.unref(n),type:"primary"},{default:i.withCtx(()=>[i.createVNode(an)]),_:1},8,["size"])]),_:1},8,["options","size"])):i.createCommentVNode("",!0)])]}),default:i.withCtx(()=>[i.renderSlot(W.$slots,"default",{},()=>{var Ve,J,le;return[i.createElementVNode("div",ub,[s.value?(i.openBlock(),i.createBlock(Dd,{key:0,"categories-items":t.categoryItem.categories??[],"has-products":c.value||b.value,"event-emitter":t.eventEmitter,"filtered-items":r.value?((Ve=r.value)==null?void 0:Ve.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,"can-show-configurator":t.canShowConfigurator},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","can-show-configurator"])):i.createCommentVNode("",!0)]),g.value&&m.value?(i.openBlock(),i.createBlock(Ad,{key:0,"event-emitter":t.eventEmitter,settings:(J=t.categoryItem.properties)==null?void 0:J.configuratorSettings,editor:(le=t.categoryItem.properties)==null?void 0:le.configurator,category:t.categoryItem},null,8,["event-emitter","settings","editor","category"])):c.value?(i.openBlock(),i.createElementBlock("div",hb,[g.value?(i.openBlock(),i.createBlock(ce,{key:0,color:"#bdbdbd",strong:"",class:"self-end p-2",onClick:H},{default:i.withCtx(()=>[...V[6]||(V[6]=[i.createTextVNode(" Назад в Конфигуратор ",-1)])]),_:1})):i.createCommentVNode("",!0),i.createVNode(Ln,{columns:D.value,data:l.value,bordered:!0,loading:b.value,remote:!0,"row-key":De=>De.id,"table-layout":w.value,class:"mt-2"},null,8,["columns","data","loading","row-key","table-layout"])])):i.createCommentVNode("",!0),!b.value&&!_.value&&!s.value&&!c.value?(i.openBlock(),i.createBlock(ln,{key:2,"show-icon":!0,type:"warning",title:"Категория пуста",class:"mx-10"})):i.createCommentVNode("",!0),_.value?(i.openBlock(),i.createBlock(ln,{key:3,"show-icon":!0,type:"error",title:"При получении данных произошла ошибка",class:"mx-10"})):i.createCommentVNode("",!0),b.value?(i.openBlock(),i.createBlock(Jt,{key:4,size:i.unref(n),class:"w-full"},{description:i.withCtx(()=>[...V[7]||(V[7]=[i.createElementVNode("div",null,"Выполняется загрузка данных ...",-1)])]),_:1},8,["size"])):i.createCommentVNode("",!0)]},!0)]),_:3},8,["name","data-id"])}}}),gb=Wn(mb,[["__scopeId","data-v-607a5aad"]]),pb={class:"sc-collapse flex w-full flex-col"},yb={},zd=i.defineComponent({...yb,__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",pb,[i.renderSlot(o.$slots,"default")]))}}),bb={},Dd=i.defineComponent({...bb,__name:"category-collapse",props:{categoriesItems:{},hasProducts:{type:Boolean},loading:{type:Boolean,default:!1},client:{default:void 0},filteredItems:{default:void 0},isCategoryItemSelected:{type:[Boolean,String,Function],default:void 0},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]},canShowConfigurator:{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:{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(or,"medium"),r=i.computed(()=>M.isUndefined(e.filteredItems)?e.categoriesItems:e.categoriesItems.filter(o=>{var a;return!!((a=e.filteredItems)!=null&&a[o.id])})),s=(o,a)=>{if(M.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(zd,{key:0},{default:i.withCtx(()=>[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(r.value,d=>(i.openBlock(),i.createBlock(gb,{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,"can-show-configurator":t.canShowConfigurator},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","can-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)}}}),_b={},Ld=i.defineComponent({..._b,__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(()=>M.isArray(r.value)),a=new K.Reference,l=i.computed(()=>M.isNil(r.value)?o.value?[]:null:M.isArray(r.value)?r.value.map(g=>g.id):r.value.id),c=i.computed(()=>Vt.convertReferencesToSelectOptionsList(r.referenceList,r.sortOptionsByLabel,!1,r.showEmptyValue)),d=g=>{var m;if(M.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||M.isNil(g)||(m=c.value.find(y=>y.value===g))==null?void 0:m.item;s("update:value",p)}},u=i.useTemplateRef("select-component");return e({focus:()=>{var g;return(g=u.value)==null?void 0:g.focus()},blur:()=>{var g;return(g=u.value)==null?void 0:g.blur()}}),(g,m)=>(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"]))}}),wb={},xb=i.defineComponent({...wb,__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 k,N;const n=t,r=e,s=()=>{const R=K.PriceCoefficient.getRetailPriceCoefficient();return M.unset(R,"isNewRec"),R},o=R=>!R||R.id===s().id,a=i.computed(()=>{var R;return((R=n.catalogItem)==null?void 0:R.type)==="product"}),l=i.computed(()=>a.value?n.catalogItem:void 0),c=R=>{var w,C,x,T;return R.id===s().id?(w=l.value)==null?void 0:w.getRetailCost():(T=(x=(C=l.value)==null?void 0:C.priceCoefficients)==null?void 0:x.find($=>$.coefficient.id===R.id))==null?void 0:T.cost},d=i.computed(()=>{var w;const R=[...((w=K.useReferencesStore().priceCoefficientsReference)==null?void 0:w.map(C=>structuredClone(i.toRaw(C))))??[],s()];return a.value&&R.forEach(C=>{var T;const x=c(C);x?C.name+=` (${x} ${(T=l.value)==null?void 0:T.currency.symbol})`:C.name=""}),R.filter(C=>C.name!=="")}),u=i.ref(n.value.coefficient),h=i.ref(((N=(k=n.value)==null?void 0:k.value)==null?void 0:N.toString())??null),f=i.ref(null),g=i.computed(()=>{var R,w;return(w=(R=l.value)==null?void 0:R.priceCoefficients)==null?void 0:w.find(C=>C.coefficient.slug===K.PriceCoefficientEnum.K0)}),m=i.ref(void 0),p=R=>Number.parseFloat((R??"").replaceAll(/[\s\u00A0\u202F]/g,"").replace(",",".")),y=()=>{var w,C;m.value=void 0;let R=p(h.value);if(R=Number.isNaN(R)?void 0:R,a.value)if(u.value||h.value){const x=s(),T=c(u.value??x)??0,$=T+T*((R??0)/100);f.value=new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:2}).format($),$>(((w=l.value)==null?void 0:w.getRetailCost())??$)&&(m.value={validationStatus:"warning",feedback:"Устанавливается цена выше розничной цены"}),g.value&&$<(((C=g.value)==null?void 0:C.cost)??0)&&(m.value={validationStatus:"warning",feedback:"Устанавливается цена ниже минимальной цены"})}else f.value=null;r("update:value",{value:Number.isNaN(R)?void 0:R,coefficient:o(u.value)?void 0:structuredClone(i.toRaw(u.value))})},b=R=>{M.isArray(R)||M.isNull(R)||(u.value=R,h.value=null,!u.value&&h.value&&(u.value=s()),y())},_=()=>{u.value||(u.value=s()),y()},B=R=>{var C,x,T,$,F;const w=p(R);if(a.value){let I=0;if(w<=0)u.value=void 0,h.value=null;else if(g.value&&w<(((C=g.value)==null?void 0:C.cost)??0))u.value=(x=g.value)==null?void 0:x.coefficient,I=(w-g.value.cost)*100/g.value.cost,m.value={validationStatus:"warning",feedback:"Устанавливается цена ниже минимальной цены"};else if(w>(((T=l.value)==null?void 0:T.getRetailCost())??w)){u.value=s();const L=(($=l.value)==null?void 0:$.getRetailCost())??0;I=(w-L)*100/L,m.value={validationStatus:"warning",feedback:"Устанавливается цена выше розничной цены"}}else{const L=((F=l.value)==null?void 0:F.priceCoefficients)??[],O=M.sortBy(L,[E=>E.cost]),ne=O.filter(E=>E.cost<=w).at(-1)??O.at(0);ne&&(u.value=ne.coefficient,I=(w-ne.cost)*100/ne.cost),m.value={validationStatus:void 0,feedback:void 0}}h.value=new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:5}).format(I),r("update:value",{value:Number.isNaN(I)?void 0:I,coefficient:o(u.value)?void 0:structuredClone(i.toRaw(u.value))})}else r("update:value",{value:Number.isNaN(w)?void 0:w,coefficient:void 0})};return i.onMounted(()=>{var R,w,C,x;n.calculationType===K.CalculationTypeEnum.m2Cost?f.value=((w=(R=n.value)==null?void 0:R.value)==null?void 0:w.toString())??null:!((C=n.value)!=null&&C.coefficient)&&((x=n.value)!=null&&x.value)&&(u.value=s()),y()}),(R,w)=>{var T,$,F;const C=z.NInput,x=z.NInputGroup;return i.openBlock(),i.createBlock(i.unref(z.NFormItem),{"show-label":!i.unref(M.isNil)(t.label),label:t.label,"show-feedback":!i.unref(M.isNil)(((T=m.value)==null?void 0:T.feedback)??t.feedback),feedback:(($=m.value)==null?void 0:$.feedback)??t.feedback,"validation-status":((F=m.value)==null?void 0:F.validationStatus)??t.validationStatus},{default:i.withCtx(()=>[i.createElementVNode("div",{class:i.normalizeClass([{"sm:grid-cols-3":a.value&&t.calculationType!==i.unref(K.CalculationTypeEnum).m2Cost},"grid w-full grid-cols-1 gap-2"])},[t.calculationType!==i.unref(K.CalculationTypeEnum).m2Cost?(i.openBlock(),i.createBlock(x,{key:0,class:i.normalizeClass(["w-full flex-row",{"sm:col-span-2":a.value}])},{default:i.withCtx(()=>[i.createVNode(Ld,{class:"w-full min-w-0 flex-1",value:u.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(C,{value:h.value,"onUpdate:value":[w[0]||(w[0]=I=>h.value=I),_],clearable:t.clearable,disabled:t.disabled,placeholder:"",class:"w-full min-w-0 flex-1"},i.createSlots({suffix:i.withCtx(()=>[w[3]||(w[3]=i.createTextVNode("%",-1))]),_:2},[h.value&&!h.value.startsWith("-")?{name:"prefix",fn:i.withCtx(()=>[w[2]||(w[2]=i.createTextVNode(" + ",-1))]),key:"0"}:void 0]),1032,["value","clearable","disabled"])]),_:1},8,["class"])):i.createCommentVNode("",!0),a.value||t.calculationType===i.unref(K.CalculationTypeEnum).m2Cost?(i.openBlock(),i.createBlock(C,{key:1,value:f.value,"onUpdate:value":[w[1]||(w[1]=I=>f.value=I),B],clearable:t.clearable,disabled:t.disabled,placeholder:"Стоимость",class:"w-full"},i.createSlots({_:2},[a.value?{name:"suffix",fn:i.withCtx(()=>{var I;return[i.createTextVNode(i.toDisplayString((I=l.value)==null?void 0:I.currency.symbol),1)]}),key:"0"}:void 0]),1032,["value","clearable","disabled"])):i.createCommentVNode("",!0)],2)]),_:1},8,["show-label","label","show-feedback","feedback","validation-status"])}}}),kb={key:0,class:"flex flex-row gap-2.5"},vb={key:1,class:"flex flex-row flex-wrap justify-end gap-2.5"},Cb={},Hd=i.defineComponent({...Cb,__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}})},modalWidth:{default:void 0},processing:{type:Boolean,default:!1},valid:{type:Boolean,default:!0},acceptButton:{default:()=>({show:!0,text:"ОК"})},cancelButton:{default:()=>({show:!0,text:"Отмена"})},trapFocus:{type:Boolean,default:!0}},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=St.initRefDependingOnDeviceResolution(r.sizes.phone.size,r.sizes.tablet.size,r.sizes.default.size),c=St.initRefDependingOnDeviceResolution(r.sizes.phone.scale,r.sizes.tablet.scale,r.sizes.default.scale),d=i.computed(()=>r.modalWidth??window.innerWidth*c.value),u=()=>{s("opening"),o.value=!0,s("update:show",o.value)},h=(g="other")=>{if(a.value){s("processing:cancel",b=>{a.value=b});return}let m=!1;s("closing",g,()=>{m=!0}),m||(o.value=!1,s("update:show",o.value))},f=()=>{s("accept",m=>{a.value=m})};return i.watch(()=>r.show,g=>{g?u():h("other")}),i.watch(()=>r.processing,g=>{a.value=g}),e({open:u,close:h,acceptHandler:f}),(g,m)=>{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,"trap-focus":t.trapFocus??!0,"action-class":g.$slots["extra-action"]?"grid grid-cols-2 !justify-between":void 0,preset:"dialog",onClose:m[1]||(m[1]=b=>h("header")),onEsc:m[2]||(m[2]=b=>h("esc")),onMaskClick:m[3]||(m[3]=b=>h("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",kb,[i.renderSlot(g.$slots,"extra-action")])):i.createCommentVNode("",!0),g.$slots.action||t.acceptButton.show||t.cancelButton.show?(i.openBlock(),i.createElementBlock("div",vb,[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:f},{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:m[0]||(m[0]=b=>h("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","trap-focus","action-class"])}}}),Sb={class:"text-sm"},Bb={},Tb=i.defineComponent({...Bb,__name:"add-product-to-cart-dialog",emits:["submit"],setup(t,{expose:e,emit:n}){const r=i.useTemplateRef("form-reference"),s=i.useTemplateRef("base-dialog-reference"),o=i.ref(null),a=i.computed(()=>{var w,C,x;return((w=o.value)==null?void 0:w.unit.isLinear)&&((x=(C=o.value)==null?void 0:C.properties)==null?void 0:x.isLengthConfigurator)}),l=i.ref(void 0),c=i.ref(void 0),d=i.ref(!0),u=i.ref(null),h=n,f=()=>({length:{},quantity:{},marker:{}}),g=i.ref(f()),m=i.ref(!1),p=i.computed(()=>{var $,F,I,L;if(!o.value)return{};const w=K.UnitsHelper.getProductLengthMultiplicity(o.value),C=K.UnitsHelper.getProductMultiplicity(o.value),x=((F=($=o.value)==null?void 0:$.properties)==null?void 0:F.minLength)||w,T=(L=(I=o.value)==null?void 0:I.properties)==null?void 0:L.maxLength;return{length:[ae.required,ae.min(x??.1),ae.max(T),ae.step(w),We.serverValidation(g.value.length.feedback)],quantity:[ae.required,ae.min(C),ae.step(C),We.serverValidation(g.value.quantity.feedback)],marker:[We.serverValidation(g.value.marker.feedback)]}}),y=i.computed(()=>{var w,C,x;return o.value?((w=o.value.properties)==null?void 0:w.lengthStep)??((C=o.value.properties)!=null&&C.ignoreMinCountCheck?0:((x=o.value.properties)==null?void 0:x.minCount)??0):0}),b=i.computed(()=>{var x,T,$,F,I,L,O,Z,ne;if(!o.value)return"";const w=((T=(x=o.value)==null?void 0:x.properties)==null?void 0:T.minLength)??((F=($=o.value)==null?void 0:$.properties)!=null&&F.ignoreMinCountCheck?0:(L=(I=o.value)==null?void 0:I.properties)==null?void 0:L.minCount),C=(Z=(O=o.value)==null?void 0:O.properties)==null?void 0:Z.maxLength;return w||C?`(${w?`от ${w}`:""}${w&&C?" ":""}${C?`до ${C}`:""} ${(ne=o.value)==null?void 0:ne.unit.name})`:""}),_=w=>{var F,I;if(!((I=(F=o.value)==null?void 0:F.properties)!=null&&I.isLengthConfigurator)||!u.value||M.isNil(w)||y.value===0)return;const C=w/y.value,x=Math.round(C),T=K.UnitsHelper.getProductMultiplicity(o.value),$=Math.max(x,T);u.value.quantity=$},B=w=>{var $,F,I,L;if(!((F=($=o.value)==null?void 0:$.properties)!=null&&F.isLengthConfigurator)||!u.value||M.isNil(w)||y.value===0)return;const C=w*y.value,x=((I=o.value.properties)==null?void 0:I.minLength)||K.UnitsHelper.getProductLengthMultiplicity(o.value),T=(L=o.value.properties)==null?void 0:L.maxLength;x!==void 0&&C<x?u.value.length=x:T!==void 0&&C>T?u.value.length=T:u.value.length=C},k=async w=>{var x;const C=M.cloneDeep(u.value);try{await((x=r.value)==null?void 0:x.validate(T=>{if(!T){if(!o.value||!C)return;K.UnitsHelper.productIsMeasurable(o.value)||delete C.length,a.value&&y.value&&(C.length=y.value),m.value=!0,h("submit",C,g.value,()=>{m.value=!1,w(!1),i.nextTick(()=>{var $;($=r.value)==null||$.validate(M.noop).catch(M.noop)})})}}))}catch{}},N=()=>{o.value=null,l.value=void 0,u.value=null,g.value=f()};return e({show:(w,C)=>{var x,T,$,F,I;if(o.value=w,l.value=C==null?void 0:C.cartItemData,c.value=C==null?void 0:C.orderId,d.value=(C==null?void 0:C.canSetDopProdaga)??!1,u.value=new K.OrderItemBase((C==null?void 0:C.cartItemData)??new K.OrderItemBase({product:w,quantity:K.UnitsHelper.productIsMeasurable(o.value)?1:((x=w==null?void 0:w.properties)==null?void 0:x.minCount)??1,length:((T=w==null?void 0:w.properties)==null?void 0:T.minLength)||(($=w==null?void 0:w.properties)!=null&&$.ignoreMinCountCheck?0:(F=w==null?void 0:w.properties)==null?void 0:F.minCount)||0})),(I=w==null?void 0:w.properties)!=null&&I.isLengthConfigurator&&u.value&&y.value>0){const L=y.value,O=u.value.quantity||1;u.value.length=O*L}},closeDialog:N}),(w,C)=>{var I;const x=z.NFormItem,T=z.NInputGroupLabel,$=z.NInputGroup,F=z.NCheckbox;return i.openBlock(),i.createBlock(Hd,{ref:"base-dialog-reference",show:!i.unref(M.isNil)(o.value)&&!i.unref(M.isNil)(u.value),title:`${l.value?"Изменение":"Добавление"} товара ${(I=o.value)==null?void 0:I.name} в ${c.value?` заказ №${c.value}`:"корзину"}`,"accept-button":{show:!0,text:l.value?"Изменить":"Добавить"},processing:m.value,"modal-width":500,onAccept:k,onClosing:N},{default:i.withCtx(()=>{var L;return[o.value&&u.value?(i.openBlock(),i.createBlock(i.unref(z.NForm),{key:0,ref:"form-reference",model:u.value,rules:p.value,class:"flex flex-col gap-2 sc-hide-empty-feedback-message",onKeydown:i.withKeys(i.withModifiers((L=s.value)==null?void 0:L.acceptHandler,["prevent"]),["enter"])},{default:i.withCtx(()=>[i.unref(K.UnitsHelper).productIsMeasurable(o.value)?(i.openBlock(),i.createBlock(x,{key:0,path:"length",label:`Метраж, ${b.value+o.value.unit.name}`},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInputNumber),{value:u.value.length,"onUpdate:value":[C[0]||(C[0]=O=>u.value.length=O),_],parse:i.unref(lt),"show-button":!1,placeholder:"Введите метраж",class:"w-full",onKeydown:C[1]||(C[1]=O=>i.unref(Ds)(O,".",!1)),onInput:C[2]||(C[2]=O=>i.unref(et)(g.value,"length")),onFocus:i.unref(Le)},null,8,["value","parse","onFocus"])]),_:1},8,["label"])):i.createCommentVNode("",!0),i.createVNode(x,{path:"quantity",label:"Количество, шт."},{default:i.withCtx(()=>[i.createVNode($,null,i.createSlots({default:i.withCtx(()=>[i.createVNode(i.unref(z.NInputNumber),{value:u.value.quantity,"onUpdate:value":[C[3]||(C[3]=O=>u.value.quantity=O),B],parse:i.unref(lt),step:i.unref(K.UnitsHelper).getProductMultiplicity(o.value),"show-button":!1,placeholder:"Введите количество",class:"w-full",onKeydown:C[4]||(C[4]=O=>i.unref(Ds)(O,".",!1)),onInput:C[5]||(C[5]=O=>i.unref(et)(g.value,"quantity")),onFocus:i.unref(Le)},null,8,["value","parse","step","onFocus"]),a.value?(i.openBlock(),i.createBlock(T,{key:0,class:"bg-orange-100 font-bold"},{default:i.withCtx(()=>[i.createTextVNode(" x "+i.toDisplayString(y.value)+" "+i.toDisplayString(o.value.unit.name),1)]),_:1})):i.createCommentVNode("",!0)]),_:2},[!g.value.quantity.feedback&&i.unref(K.UnitsHelper).getProductMultiplicity(o.value)!==1?{name:"feedback",fn:i.withCtx(()=>[i.createElementVNode("span",Sb,"Количество должно быть кратно "+i.toDisplayString(i.unref(K.UnitsHelper).getProductMultiplicity(o.value)),1)]),key:"0"}:void 0]),1024)]),_:1}),i.unref(K.UnitsHelper).productIsMeasurable(o.value)?(i.openBlock(),i.createBlock(x,{key:1,path:"marker",label:"Маркировка"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInput),{value:u.value.marker??null,placeholder:"Введите маркировку",onInput:C[6]||(C[6]=O=>i.unref(et)(g.value,"marker")),"onUpdate:value":C[7]||(C[7]=O=>u.value.marker=O??null),onFocus:i.unref(Le)},null,8,["value","onFocus"])]),_:1})):i.createCommentVNode("",!0),d.value?(i.openBlock(),i.createBlock(F,{key:2,checked:u.value.isAdditionalSale,"onUpdate:checked":C[8]||(C[8]=O=>u.value.isAdditionalSale=O),"true-value":!0,"false-value":!1},{default:i.withCtx(()=>[...C[9]||(C[9]=[i.createTextVNode(" ДопПродажа ",-1)])]),_:1},8,["checked"])):i.createCommentVNode("",!0)]),_:1},8,["model","rules","onKeydown"])):i.createCommentVNode("",!0)]}),_:1},8,["show","title","accept-button","processing"])}}}),$b={class:"flex flex-row gap-1"},Nb={class:"sc-client-name flex flex-col gap-1 text-base"},Rb=["href"],Pb={key:1,class:"text-sc-grey"},Eb={key:0,class:"text-sc-dark-grey sc-client-city text-sm"},Fb={key:0},Vb={key:1,class:"text-sm"},Ib={},pr=i.defineComponent({...Ib,__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?Tn.format(n.client.lastLoginAt,K.useBaseConfigStateStore().config.dateFormats.uiDateWithTime):""),o=a=>{M.isNil(n.nameLink)&&(a.preventDefault(),a.stopPropagation()),r("click:client-name",n.client,a)};return(a,l)=>{const c=Hs,d=z.NButton,u=z.NPopover;return i.openBlock(),i.createElementBlock("div",$b,[t.showClientInfoIcon?(i.openBlock(),i.createBlock(d,{key:0,quaternary:"",size:"small",onClick:l[0]||(l[0]=h=>a.$emit("click:client-info",t.client))},{default:i.withCtx(()=>[i.createVNode(c)]),_:1})):i.createCommentVNode("",!0),i.createVNode(u,{disabled:i.unref(M.isNil)(t.popoverPosition),placement:t.popoverPosition},{trigger:i.withCtx(()=>[i.createElementVNode("div",Nb,[i.createElementVNode("a",{href:t.nameLink??"#",class:"text-base no-underline",onClick:l[1]||(l[1]=h=>o(h))},[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",Pb," [ Деактивирован ] "))],8,Rb),t.showCityAndRegion&&t.client.city?(i.openBlock(),i.createElementBlock("span",Eb," г. "+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",Fb,i.toDisplayString(t.client.alternativeName),1)):i.createCommentVNode("",!0),s.value?(i.openBlock(),i.createElementBlock("span",Vb," Последний вход: "+i.toDisplayString(s.value),1)):i.createCommentVNode("",!0),i.renderSlot(a.$slots,"popover-content")]),_:3},8,["disabled","placement"])])}}}),Ab={class:"text-base"},Mb={},Wd=i.defineComponent({...Mb,__name:"contragent-with-short-info",props:{contragent:{}},setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock("span",Ab,i.toDisplayString(t.contragent.name),1))}}),Ob={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function zb(t,e){return i.openBlock(),i.createElementBlock("svg",Ob,[...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 Db=i.markRaw({name:"tabler-mail",render:zb}),Lb=["href"],Hb={},Wb=i.defineComponent({...Hb,__name:"email",props:{email:{default:""},showEmailIcon:{type:Boolean,default:!1}},setup(t){return(e,n)=>{const r=Db;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,Lb)],2)}}}),jb={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function qb(t,e){return i.openBlock(),i.createElementBlock("svg",jb,[...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 jd=i.markRaw({name:"fa6-brands-viber",render:qb}),Xb={viewBox:"0 0 256 258",width:"1.2em",height:"1.2em"},Yb=["id"],Ub=["id"],Kb=["fill"],Gb=["fill"];function Zb(t,e){return i.openBlock(),i.createElementBlock("svg",Xb,[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,Yb),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,Ub)]),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,Kb),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,Gb),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 qd=i.markRaw({name:"logos-whatsapp-icon",render:Zb,setup(){const t=()=>Math.random().toString(36).substr(2,10);return{idMap:{SVGBRLHCcSy:"uicons-"+t(),SVGHW6lecxh:"uicons-"+t()}}}}),Qb={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"},Jb=["id"],e_=["fill"];function t_(t,e){return i.openBlock(),i.createElementBlock("svg",Qb,[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,Jb)]),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,e_),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 Xd=i.markRaw({name:"logos-telegram",render:t_,setup(){return{idMap:{SVGuySfwdaH:"uicons-"+Math.random().toString(36).substr(2,10)}}}}),n_={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function i_(t,e){return i.openBlock(),i.createElementBlock("svg",n_,[...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 Yd=i.markRaw({name:"ion-call",render:i_}),r_={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function s_(t,e){return i.openBlock(),i.createElementBlock("svg",r_,[...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 o_=i.markRaw({name:"tabler-phone-call",render:s_}),a_={key:0,class:"absolute left-0 top-0 flex w-full flex-row items-center justify-around text-center backdrop-blur-sm"},l_=["href"],c_=["href"],d_=["href"],u_=["href"],h_={},f_=i.defineComponent({...h_,__name:"phone",props:{defaultCountry:{},phone:{default:""},showPhoneIcon:{type:Boolean,default:!1}},setup(t){const e=t,n=i.computed(()=>{try{return e.phone?sr.parsePhoneNumberWithError(e.phone,e.defaultCountry):void 0}catch{}return e.phone}),r=i.computed(()=>{var l;return M.isString(n.value)?!1:((l=n.value)==null?void 0:l.isValid())??!1}),s=i.computed(()=>{var l;return M.isString(n.value)?n.value:((l=n.value)==null?void 0:l.format("INTERNATIONAL"))??""}),o=i.computed(()=>{var l;return M.isString(n.value)?n.value:((l=n.value)==null?void 0:l.format("E.164"))??""}),a=i.ref(!1);return(l,c)=>{const d=o_,u=Yd,h=Xd,f=qd,g=jd;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]=m=>a.value=!a.value),onFocusout:c[1]||(c[1]=m=>a.value=!1),onMouseleave:c[2]||(c[2]=m=>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",a_,[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(u)],8,l_)):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(h)],8,c_)):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(f)],8,d_)):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,u_)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)],34)])}}}),m_={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function g_(t,e){return i.openBlock(),i.createElementBlock("svg",m_,[...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 p_=i.markRaw({name:"mdi-envelope",render:g_}),y_={class:"flex flex-col gap-1"},b_={key:0,class:"mb-2 flex flex-col text-base"},__={key:0,class:"text-sc-dark-grey text-sm"},w_={key:1,class:"whitespace-nowrap text-sm"},x_={key:2,class:"whitespace-nowrap text-sm"},k_={key:3,class:"absolute left-0 top-0 flex size-full items-center justify-around rounded-md text-center text-2xl backdrop-blur-sm"},v_=["href"],C_=["href"],S_=["href"],B_=["href"],T_=["href"],$_={key:0,class:"flex flex-col text-base"},N_={key:0,class:"text-sc-dark-grey text-sm"},R_={key:1,class:"mt-2 text-sm"},P_={key:0,class:"-mt-1"},E_={},F_=i.defineComponent({...E_,__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?sr.parsePhoneNumberWithError(e.contact.phone,e.defaultCountry):void 0}catch{}return e.contact.phone}),r=i.computed(()=>{var c;return M.isString(n.value)?!1:((c=n.value)==null?void 0:c.isValid())??!1}),s=i.computed(()=>{var c;return M.isString(n.value)?n.value:((c=n.value)==null?void 0:c.format("INTERNATIONAL"))??""}),o=i.computed(()=>{var c;return M.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 u=Yd,h=Xd,f=qd,g=jd,m=p_,p=z.NPopover;return i.openBlock(),i.createElementBlock("div",y_,[i.createVNode(p,{disabled:t.fullView,placement:"bottom"},{trigger:i.withCtx(()=>{var _,B,k,N;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]=R=>l.value=!0),onFocusin:d[1]||(d[1]=R=>l.value=!0),onMouseleave:d[2]||(d[2]=R=>l.value=!1),onFocusout:d[3]||(d[3]=R=>l.value=!1)},[i.createElementVNode("div",null,[t.fullView&&(t.contact.name||(B=t.contact)!=null&&B.position)?(i.openBlock(),i.createElementBlock("div",b_,[i.createTextVNode(i.toDisplayString(t.contact.name)+" ",1),(k=t.contact)!=null&&k.position?(i.openBlock(),i.createElementBlock("span",__,i.toDisplayString((N=t.contact)==null?void 0:N.position),1)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0),t.contact.phone?(i.openBlock(),i.createElementBlock("div",w_,i.toDisplayString(s.value),1)):i.createCommentVNode("",!0),t.contact.email?(i.openBlock(),i.createElementBlock("div",x_,i.toDisplayString(t.contact.email),1)):i.createCommentVNode("",!0),a.value&&l.value?(i.openBlock(),i.createElementBlock("div",k_,[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(u)],8,v_)):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(h)],8,C_)):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(f)],8,S_)):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,B_)):i.createCommentVNode("",!0),t.contact.email?(i.openBlock(),i.createElementBlock("a",{key:4,href:`mailto:${t.contact.email}`,class:"hover:text-3xl"},[i.createVNode(m)],8,T_)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)])],38)]}),default:i.withCtx(()=>{var _,B,k,N;return[t.contact.name?(i.openBlock(),i.createElementBlock("div",$_,[i.createTextVNode(i.toDisplayString(t.contact.name)+" ",1),(_=t.contact)!=null&&_.position?(i.openBlock(),i.createElementBlock("span",N_,i.toDisplayString((B=t.contact)==null?void 0:B.position),1)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0),(k=t.contact)!=null&&k.comment?(i.openBlock(),i.createElementBlock("div",R_,[d[4]||(d[4]=i.createElementVNode("sup",null,"**",-1)),i.createTextVNode(" "+i.toDisplayString((N=t.contact)==null?void 0:N.comment),1)])):i.createCommentVNode("",!0)]}),_:1},8,["disabled"]),t.fullView&&((y=t.contact)!=null&&y.comment)?(i.openBlock(),i.createElementBlock("div",P_,[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)])}}});class V_{constructor(e){S(this,"minHeight");S(this,"maxHeights");S(this,"minWidth");S(this,"maxWidths");S(this,"netType");S(this,"color");S(this,"mountType");S(this,"descriptions");S(this,"crossbarCount");S(this,"heightOverlaps");S(this,"widthOverlaps");S(this,"canSetDopProdaga");this.color=e.color,this.crossbarCount=e.crossbarCount,this.descriptions=zs.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=zs.objectToSnake(e.heightOverlaps),this.widthOverlaps=zs.objectToSnake(e.widthOverlaps),this.canSetDopProdaga=e.canSetDopProdaga}}function I_(t){var e;return((e=t.properties)==null?void 0:e.configurator)!==K.ConfiguratorsEnum.SandwichM2?!0:t.properties.configuratorSettings!==void 0&&M.isArray(t.products)&&t.products.length>0}const A_={class:"flex flex-wrap gap-2"},M_={class:"flex flex-col"},O_={class:"flex flex-col"},z_={},D_=i.defineComponent({...z_,__name:"date-range",props:{clearable:{type:Boolean,default:!0},dateRange:{default:void 0},dateFormat:{default:()=>K.useBaseConfigStateStore().config.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 M.forOwn(K.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?Tn.startOfDay(new Date(a)):void 0,to:l?Tn.endOfDay(new Date(l)):void 0})};return(a,l)=>{var u,h,f,g,m,p;const c=z.NButton,d=z.NDatePicker;return i.openBlock(),i.createElementBlock("div",A_,[i.createVNode(d,{value:((h=(u=t.dateRange)==null?void 0:u.from)==null?void 0:h.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:(f=t.disabled)==null?void 0:f.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",M_,[(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 B,k;return o((B=y==null?void 0:y.from)==null?void 0:B.getTime(),(k=y==null?void 0:y.to)==null?void 0:k.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:((m=(g=t.dateRange)==null?void 0:g.to)==null?void 0:m.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",O_,[(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 B,k;return o((B=y==null?void 0:y.from)==null?void 0:B.getTime(),(k=y==null?void 0:y.to)==null?void 0:k.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"])])}}}),L_={class:"sc-lbl-date text-nowrap"},H_={},fs=i.defineComponent({...H_,__name:"date-time-label",props:{date:{},isTimeSecondary:{type:Boolean},isTimeOnSecondLine:{type:Boolean},isShowTime:{type:Boolean,default:!0}},setup(t){const e=t,n=i.computed(()=>Tn.format(e.date,K.useBaseConfigStateStore().config.dateFormats.uiDate)),r=i.computed(()=>Tn.format(e.date,"HH:mm"));return(s,o)=>(i.openBlock(),i.createElementBlock("span",{class:i.normalizeClass({"flex flex-col":t.isTimeOnSecondLine})},[i.createElementVNode("span",L_,i.toDisplayString(n.value),1),t.isShowTime?(i.openBlock(),i.createElementBlock("span",{key:0,class:i.normalizeClass([{"text-sc-grey":t.isTimeSecondary,"ml-1":!t.isTimeOnSecondLine},"sc-lbl-time"])},i.toDisplayString(r.value),3)):i.createCommentVNode("",!0)],2))}}),W_={class:"flex flex-row gap-2.5"},j_={class:"flex grow basis-0 flex-row flex-wrap justify-start justify-items-start gap-y-1 md:flex-nowrap"},q_={class:"flex min-w-0 flex-col-reverse flex-wrap-reverse justify-end gap-1 sm:flex-row"},X_={class:"mb-0.5 sm:mb-0 sm:ml-3"},Y_={},U_=i.defineComponent({...Y_,__name:"dialog-header",props:{showCloseButton:{type:Boolean,default:!0}},emits:["close"],setup(t){return(e,n)=>{const r=hs,s=z.NButton,o=z.NPopover;return i.openBlock(),i.createElementBlock("div",W_,[i.createElementVNode("div",j_,[i.renderSlot(e.$slots,"main")]),i.createElementVNode("div",null,[i.createElementVNode("div",q_,[i.renderSlot(e.$slots,"extra-buttons"),i.createElementVNode("div",X_,[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)])])])])}}}),K_={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function G_(t,e){return i.openBlock(),i.createElementBlock("svg",K_,[...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 Z_=i.markRaw({name:"ion-download-outline",render:G_}),Q_={},J_=i.defineComponent({...Q_,__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 u=new FileReader;u.addEventListener("load",()=>{c.content=u.result??"",r("update:file",c)}),u.readAsDataURL(d.file)};return(l,c)=>{const d=Z_;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"])}}}),e1={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function t1(t,e){return i.openBlock(),i.createElementBlock("svg",e1,[...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 n1=i.markRaw({name:"ion-checkmark-done-sharp",render:t1}),i1={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function r1(t,e){return i.openBlock(),i.createElementBlock("svg",i1,[...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 s1=i.markRaw({name:"ion-options-outline",render:r1}),o1={class:"flex flex-row gap-x-2.5 p-0 sm:p-1"},a1={class:"flex-auto"},l1={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"},c1={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"},d1={},Lo=i.defineComponent({...d1,__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 u=s1,h=z.NButton,f=z.NPopover,g=n1,m=hs;return i.openBlock(),i.createElementBlock("div",o1,[i.createElementVNode("div",a1,[i.renderSlot(c.$slots,"default")]),i.createElementVNode("div",null,[i.createElementVNode("div",l1,[i.createElementVNode("div",c1,[t.showEditButton?(i.openBlock(),i.createBlock(f,{key:0,placement:"bottom"},{trigger:i.withCtx(()=>[i.createVNode(h,{disabled:t.disabled||r.value,type:"info",ghost:"",size:"small",onClick:s},{default:i.withCtx(()=>[i.createVNode(u)]),_:1},8,["disabled"])]),default:i.withCtx(()=>[d[0]||(d[0]=i.createTextVNode(" Редактировать данные ",-1))]),_:1})):i.createCommentVNode("",!0),t.showApplyButton?(i.openBlock(),i.createBlock(f,{key:1,disabled:r.value,placement:"bottom"},{trigger:i.withCtx(()=>[i.createVNode(h,{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(f,{key:2,placement:"bottom"},{trigger:i.withCtx(()=>[i.createVNode(h,{disabled:t.disabled||r.value,type:"error",size:"small",onClick:l},{default:i.withCtx(()=>[i.createVNode(m)]),_:1},8,["disabled"])]),default:i.withCtx(()=>[d[2]||(d[2]=i.createTextVNode(" Отменить изменения ",-1))]),_:1})):i.createCommentVNode("",!0)]),i.renderSlot(c.$slots,"extra-buttons")])])])}}}),u1={},Ud=i.defineComponent({...u1,__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(Lo,{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(Lo,{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"]))]))}}),h1={},f1=i.defineComponent({...h1,__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=M.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]=u=>s.value=u),l],clearable:t.clearable,placeholder:t.placeholder},{prefix:i.withCtx(()=>[i.renderSlot(c.$slots,"prefix")]),_:3},8,["value","clearable","placeholder"]))}}),m1={},g1=i.defineComponent({...m1,__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},parse:{type:Function,default:void 0},showButton:{type:Boolean,default:!0}},emits:["update:value","keydown","input","focus"],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=M.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,m)=>(i.openBlock(),i.createBlock(i.unref(z.NInputNumber),{ref_key:"inputReference",ref:d,value:o.value??null,clearable:t.clearable,parse:t.parse,"show-button":t.showButton,placeholder:t.placeholder,min:t.min,max:t.max,step:t.step,validator:t.validator,"onUpdate:value":c,onKeydown:m[0]||(m[0]=p=>s("keydown",p)),onInput:m[1]||(m[1]=p=>s("input",p)),onFocus:m[2]||(m[2]=p=>s("focus",p))},{prefix:i.withCtx(()=>[i.renderSlot(g.$slots,"prefix")]),_:3},8,["value","clearable","parse","show-button","placeholder","min","max","step","validator"]))}}),p1={},y1=i.defineComponent({...p1,__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=M.debounce(c=>r("update:value",c),n.debounceTime??0),a=c=>{let d="";if(M.isString(c))s.value=c,d=c.replaceAll(/(\s|\(|\)|-|_)*/g,"");else if(M.isObject(c)){if(s.value=c.formatted,!c.valid)return;d=c instanceof sr.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 u=sr.parsePhoneNumberWithError(`+${d}`);u.isValid()?s.value=u.format("E.164"):u.getPossibleCountries().length>0&&(s.value=`+${d}`)}catch(u){if(u instanceof sr.ParseError)s.value=d;else throw u}};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(Qh.VueTelInput),{modelValue:s.value,"onUpdate:modelValue":[d[0]||(d[0]=u=>s.value=u),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"]))}}),b1=Wn(y1,[["__scopeId","data-v-751dbb0e"]]),_1={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function w1(t,e){return i.openBlock(),i.createElementBlock("svg",_1,[...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 x1=i.markRaw({name:"tabler-external-link",render:w1}),k1={class:"flex flex-row gap-1 hover:underline hover:decoration-dashed"},v1=["href"],C1={},S1=i.defineComponent({...C1,__name:"external-link",props:{text:{},url:{},description:{}},setup(t){return(e,n)=>{const r=x1,s=z.NTooltip;return i.openBlock(),i.createBlock(s,{disabled:i.unref(M.isUndefined)(t.description),placement:"top-start"},{trigger:i.withCtx(()=>[i.createElementVNode("span",k1,[i.createElementVNode("a",{href:t.url,target:"_blank",class:"no-underline"},i.toDisplayString(t.text),9,v1),i.createVNode(r,{class:"mt-0.5 flex-none"})])]),default:i.withCtx(()=>[i.createTextVNode(" "+i.toDisplayString(t.description),1)]),_:1},8,["disabled"])}}}),B1={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function T1(t,e){return i.openBlock(),i.createElementBlock("svg",B1,[...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 $1=i.markRaw({name:"ion-remove-circle-outline",render:T1});let ms=[];const Kd=new WeakMap;function N1(){ms.forEach(t=>t(...Kd.get(t))),ms=[]}function Gd(t,...e){Kd.set(t,e),!ms.includes(t)&&ms.push(t)===1&&requestAnimationFrame(N1)}function yr(t,e){let{target:n}=t;for(;n;){if(n.dataset&&n.dataset[e]!==void 0)return!0;n=n.parentElement}return!1}function br(t){return t.composedPath()[0]||null}function _r(t){return typeof t=="string"?t.endsWith("px")?Number(t.slice(0,t.length-2)):Number(t):t}function wr(t){if(t!=null)return typeof t=="number"?`${t}px`:t.endsWith("px")?t:`${t}px`}function nn(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 Zd={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 R1(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 P1(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 _n="^\\s*",wn="\\s*$",Gn="\\s*((\\.\\d+)|(\\d+(\\.\\d*)?))%\\s*",Ht="\\s*((\\.\\d+)|(\\d+(\\.\\d*)?))\\s*",mi="([0-9A-Fa-f])",gi="([0-9A-Fa-f]{2})",Qd=new RegExp(`${_n}hsl\\s*\\(${Ht},${Gn},${Gn}\\)${wn}`),Jd=new RegExp(`${_n}hsv\\s*\\(${Ht},${Gn},${Gn}\\)${wn}`),eu=new RegExp(`${_n}hsla\\s*\\(${Ht},${Gn},${Gn},${Ht}\\)${wn}`),tu=new RegExp(`${_n}hsva\\s*\\(${Ht},${Gn},${Gn},${Ht}\\)${wn}`),E1=new RegExp(`${_n}rgb\\s*\\(${Ht},${Ht},${Ht}\\)${wn}`),F1=new RegExp(`${_n}rgba\\s*\\(${Ht},${Ht},${Ht},${Ht}\\)${wn}`),V1=new RegExp(`${_n}#${mi}${mi}${mi}${wn}`),I1=new RegExp(`${_n}#${gi}${gi}${gi}${wn}`),A1=new RegExp(`${_n}#${mi}${mi}${mi}${mi}${wn}`),M1=new RegExp(`${_n}#${gi}${gi}${gi}${gi}${wn}`);function Mt(t){return parseInt(t,16)}function O1(t){try{let e;if(e=eu.exec(t))return[ps(e[1]),Zn(e[5]),Zn(e[9]),yi(e[13])];if(e=Qd.exec(t))return[ps(e[1]),Zn(e[5]),Zn(e[9]),1];throw new Error(`[seemly/hsla]: Invalid color value ${t}.`)}catch(e){throw e}}function z1(t){try{let e;if(e=tu.exec(t))return[ps(e[1]),Zn(e[5]),Zn(e[9]),yi(e[13])];if(e=Jd.exec(t))return[ps(e[1]),Zn(e[5]),Zn(e[9]),1];throw new Error(`[seemly/hsva]: Invalid color value ${t}.`)}catch(e){throw e}}function pi(t){try{let e;if(e=I1.exec(t))return[Mt(e[1]),Mt(e[2]),Mt(e[3]),1];if(e=E1.exec(t))return[bt(e[1]),bt(e[5]),bt(e[9]),1];if(e=F1.exec(t))return[bt(e[1]),bt(e[5]),bt(e[9]),yi(e[13])];if(e=V1.exec(t))return[Mt(e[1]+e[1]),Mt(e[2]+e[2]),Mt(e[3]+e[3]),1];if(e=M1.exec(t))return[Mt(e[1]),Mt(e[2]),Mt(e[3]),yi(Mt(e[4])/255)];if(e=A1.exec(t))return[Mt(e[1]+e[1]),Mt(e[2]+e[2]),Mt(e[3]+e[3]),yi(Mt(e[4]+e[4])/255)];if(t in Zd)return pi(Zd[t]);if(Qd.test(t)||eu.test(t)){const[n,r,s,o]=O1(t);return[...P1(n,r,s),o]}else if(Jd.test(t)||tu.test(t)){const[n,r,s,o]=z1(t);return[...R1(n,r,s),o]}throw new Error(`[seemly/rgba]: Invalid color value ${t}.`)}catch(e){throw e}}function D1(t){return t>1?1:t<0?0:t}function Ho(t,e,n,r){return`rgba(${bt(t)}, ${bt(e)}, ${bt(n)}, ${D1(r)})`}function Wo(t,e,n,r,s){return bt((t*e*(1-r)+n*r)/s)}function L1(t,e){Array.isArray(t)||(t=pi(t)),Array.isArray(e)||(e=pi(e));const n=t[3],r=e[3],s=yi(n+r-n*r);return Ho(Wo(t[0],n,e[0],r,s),Wo(t[1],n,e[1],r,s),Wo(t[2],n,e[2],r,s),s)}function ze(t,e){const[n,r,s,o=1]=Array.isArray(t)?t:pi(t);return typeof e.alpha=="number"?Ho(n,r,s,e.alpha):Ho(n,r,s,o)}function gs(t,e){const[n,r,s,o=1]=Array.isArray(t)?t:pi(t),{lightness:a=1,alpha:l=1}=e;return H1([n*a,r*a,s*a,o*l])}function yi(t){const e=Math.round(Number(t)*100)/100;return e>1?1:e<0?0:e}function ps(t){const e=Math.round(Number(t));return e>=360||e<0?0:e}function bt(t){const e=Math.round(Number(t));return e>255?255:e<0?0:e}function Zn(t){const e=Math.round(Number(t));return e>100?100:e<0?0:e}function H1(t){const[e,n,r]=t;return 3 in t?`rgba(${bt(e)}, ${bt(n)}, ${bt(r)}, ${yi(t[3])})`:`rgba(${bt(e)}, ${bt(n)}, ${bt(r)}, 1)`}function W1(t=8){return Math.random().toString(16).slice(2,2+t)}function nu(t){return Array.isArray(t)?t:[t]}const jo={STOP:"STOP"};function iu(t,e){const n=e(t);t.children!==void 0&&n!==jo.STOP&&t.children.forEach(r=>iu(r,e))}function j1(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 q1(t,e){const{isLeaf:n}=t;return n!==void 0?n:!e(t)}function X1(t){return t.children}function Y1(t){return t.key}function U1(){return!1}function K1(t,e){const{isLeaf:n}=t;return!(n===!1&&!Array.isArray(e(t)))}function G1(t){return t.disabled===!0}function Z1(t,e){return t.isLeaf===!1&&!Array.isArray(e(t))}function Q1(t,e){if(t.isLeaf===!0){const n=e(t);if(Array.isArray(n)&&n.length>0)return!0}return!1}function qo(t){var e;return t==null?[]:Array.isArray(t)?t:(e=t.checkedKeys)!==null&&e!==void 0?e:[]}function Xo(t){var e;return t==null||Array.isArray(t)?[]:(e=t.indeterminateKeys)!==null&&e!==void 0?e:[]}function J1(t,e){const n=new Set(t);return e.forEach(r=>{n.has(r)||n.add(r)}),Array.from(n)}function ew(t,e){const n=new Set(t);return e.forEach(r=>{n.has(r)&&n.delete(r)}),Array.from(n)}function tw(t){return(t==null?void 0:t.type)==="group"}function nw(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 iw extends Error{constructor(){super(),this.message="SubtreeNotLoadedError: checking a subtree whose required nodes are not fully loaded."}}function rw(t,e,n,r){return ys(e.concat(t),n,r,!1)}function sw(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 ow(t,e,n,r){const s=ys(e,n,r,!1),o=ys(t,n,r,!0),a=sw(t,n),l=[];return s.forEach(c=>{(o.has(c)||a.has(c))&&l.push(c)}),l.forEach(c=>s.delete(c)),s}function Yo(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:J1(n,r),indeterminateKeys:Array.from(o)}:s!==void 0?{checkedKeys:ew(n,s),indeterminateKeys:Array.from(o)}:{checkedKeys:Array.from(n),indeterminateKeys:Array.from(o)};const{levelTreeNodeMap:u}=e;let h;s!==void 0?h=ow(s,n,e,d):r!==void 0?h=rw(r,n,e,d):h=ys(n,e,d,!1);const f=c==="parent",g=c==="child"||l,m=h,p=new Set,y=Math.max.apply(null,Array.from(u.keys()));for(let b=y;b>=0;b-=1){const _=b===0,B=u.get(b);for(const k of B){if(k.isLeaf)continue;const{key:N,shallowLoaded:R}=k;if(g&&R&&k.children.forEach(T=>{!T.disabled&&!T.isLeaf&&T.shallowLoaded&&m.has(T.key)&&m.delete(T.key)}),k.disabled||!R)continue;let w=!0,C=!1,x=!0;for(const T of k.children){const $=T.key;if(!T.disabled){if(x&&(x=!1),m.has($))C=!0;else if(p.has($)){C=!0,w=!1;break}else if(w=!1,C)break}}w&&!x?(f&&k.children.forEach(T=>{!T.disabled&&m.has(T.key)&&m.delete(T.key)}),m.add(N)):C&&p.add(N),_&&g&&m.has(N)&&m.delete(N)}}return{checkedKeys:Array.from(m),indeterminateKeys:Array.from(p)}}function ys(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&&iu(d,u=>{if(u.disabled)return jo.STOP;const{key:h}=u;if(!a.has(h)&&(a.add(h),l.add(h),Z1(u.rawNode,o))){if(r)return jo.STOP;if(!n)throw new iw}})}),l}function aw(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 lw(t){if(t.length===0)return null;const e=t[0];return e.isGroup||e.ignored||e.disabled?e.getNext():e}function cw(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 ru(t,e,{loop:n=!1,includeDisabled:r=!1}={}){const s=e==="prev"?dw:cw,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 u=Uo(d,o);u!==null?l=u:c(s(d,n))}else{const u=s(d,!1);if(u!==null)c(u);else{const h=uw(d);h!=null&&h.isGroup?c(s(h,n)):n&&c(s(d,!0))}}}}return c(t),l}function dw(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 uw(t){return t.parent}function Uo(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 u=Uo(d,e);if(u!==null)return u}else return d}}return null}const hw={getChild(){return this.ignored?null:Uo(this)},getParent(){const{parent:t}=this;return t!=null&&t.isGroup?t.getParent():t},getNext(t={}){return ru(this,"next",t)},getPrev(t={}){return ru(this,"prev",t)}};function fw(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 mw(t,e){const n=t.key;for(;e;){if(e.key===n)return!0;e=e.parent}return!1}var gw={};function su(t,e,n,r,s,o=null,a=0){const l=[];return t.forEach((c,d)=>{var u;gw.NODE_ENV!=="production"&&Q1(c,s)&&console.error("[treemate]: node",c,"is invalid");const h=Object.create(r);if(h.rawNode=c,h.siblings=l,h.level=a,h.index=d,h.isFirstChild=d===0,h.isLastChild=d+1===t.length,h.parent=o,!h.ignored){const f=s(c);Array.isArray(f)&&(h.children=su(f,e,n,r,s,h,a+1))}l.push(h),e.set(h.key,h),n.has(a)||n.set(a,[]),(u=n.get(a))===null||u===void 0||u.push(h)}),l}function pw(t,e={}){var n;const r=new Map,s=new Map,{getDisabled:o=G1,getIgnored:a=U1,getIsGroup:l=tw,getKey:c=Y1}=e,d=(n=e.getChildren)!==null&&n!==void 0?n:X1,u=e.ignoreEmptyChildren?k=>{const N=d(k);return Array.isArray(N)?N.length?N:null:N}:d,h=Object.assign({get key(){return c(this.rawNode)},get disabled(){return o(this.rawNode)},get isGroup(){return l(this.rawNode)},get isLeaf(){return q1(this.rawNode,u)},get shallowLoaded(){return K1(this.rawNode,u)},get ignored(){return a(this.rawNode)},contains(k){return mw(this,k)}},hw),f=su(t,r,s,h,u);function g(k){if(k==null)return null;const N=r.get(k);return N&&!N.isGroup&&!N.ignored?N:null}function m(k){if(k==null)return null;const N=r.get(k);return N&&!N.ignored?N:null}function p(k,N){const R=m(k);return R?R.getPrev(N):null}function y(k,N){const R=m(k);return R?R.getNext(N):null}function b(k){const N=m(k);return N?N.getParent():null}function _(k){const N=m(k);return N?N.getChild():null}const B={treeNodes:f,treeNodeMap:r,levelTreeNodeMap:s,maxLevel:Math.max(...s.keys()),getChildren:u,getFlattenedNodes(k){return fw(f,k)},getNode:g,getPrev:p,getNext:y,getParent:b,getChild:_,getFirstAvailableNode(){return lw(f)},getPath(k,N={}){return aw(k,N,B)},getCheckedKeys(k,N={}){const{cascade:R=!0,leafOnly:w=!1,checkStrategy:C="all",allowNotLoaded:x=!1}=N;return Yo({checkedKeys:qo(k),indeterminateKeys:Xo(k),cascade:R,leafOnly:w,checkStrategy:C,allowNotLoaded:x},B)},check(k,N,R={}){const{cascade:w=!0,leafOnly:C=!1,checkStrategy:x="all",allowNotLoaded:T=!1}=R;return Yo({checkedKeys:qo(N),indeterminateKeys:Xo(N),keysToCheck:k==null?[]:nu(k),cascade:w,leafOnly:C,checkStrategy:x,allowNotLoaded:T},B)},uncheck(k,N,R={}){const{cascade:w=!0,leafOnly:C=!1,checkStrategy:x="all",allowNotLoaded:T=!1}=R;return Yo({checkedKeys:qo(N),indeterminateKeys:Xo(N),keysToUncheck:k==null?[]:nu(k),cascade:w,leafOnly:C,checkStrategy:x,allowNotLoaded:T},B)},getNonLeafKeys(k={}){return j1(f,k)}};return B}function bs(t){return t.composedPath()[0]}const yw={mousemoveoutside:new WeakMap,clickoutside:new WeakMap};function bw(t,e,n){if(t==="mousemoveoutside"){const r=s=>{e.contains(bs(s))||n(s)};return{mousemove:r,touchstart:r}}else if(t==="clickoutside"){let r=!1;const s=a=>{r=!e.contains(bs(a))},o=a=>{r&&(e.contains(bs(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 ou(t,e,n){const r=yw[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=bw(t,e,n)),o}function _w(t,e,n,r){if(t==="mousemoveoutside"||t==="clickoutside"){const s=ou(t,e,n);return Object.keys(s).forEach(o=>{Rt(o,document,s[o],r)}),!0}return!1}function ww(t,e,n,r){if(t==="mousemoveoutside"||t==="clickoutside"){const s=ou(t,e,n);return Object.keys(s).forEach(o=>{ot(o,document,s[o],r)}),!0}return!1}function xw(){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(w,C,x){const T=w[C];return w[C]=function(){return x.apply(w,arguments),T.apply(w,arguments)},w}function o(w,C){w[C]=Event.prototype[C]}const a=new WeakMap,l=Object.getOwnPropertyDescriptor(Event.prototype,"currentTarget");function c(){var w;return(w=a.get(this))!==null&&w!==void 0?w:null}function d(w,C){l!==void 0&&Object.defineProperty(w,"currentTarget",{configurable:!0,enumerable:!0,get:C??l.get})}const u={bubble:{},capture:{}},h={};function f(){const w=function(C){const{type:x,eventPhase:T,bubbles:$}=C,F=bs(C);if(T===2)return;const I=T===1?"capture":"bubble";let L=F;const O=[];for(;L===null&&(L=window),O.push(L),L!==window;)L=L.parentNode||null;const Z=u.capture[x],ne=u.bubble[x];if(s(C,"stopPropagation",n),s(C,"stopImmediatePropagation",r),d(C,c),I==="capture"){if(Z===void 0)return;for(let E=O.length-1;E>=0&&!t.has(C);--E){const P=O[E],H=Z.get(P);if(H!==void 0){a.set(C,P);for(const Y of H){if(e.has(C))break;Y(C)}}if(E===0&&!$&&ne!==void 0){const Y=ne.get(P);if(Y!==void 0)for(const D of Y){if(e.has(C))break;D(C)}}}}else if(I==="bubble"){if(ne===void 0)return;for(let E=0;E<O.length&&!t.has(C);++E){const P=O[E],H=ne.get(P);if(H!==void 0){a.set(C,P);for(const Y of H){if(e.has(C))break;Y(C)}}}}o(C,"stopPropagation"),o(C,"stopImmediatePropagation"),d(C)};return w.displayName="evtdUnifiedHandler",w}function g(){const w=function(C){const{type:x,eventPhase:T}=C;if(T!==2)return;const $=h[x];$!==void 0&&$.forEach(F=>F(C))};return w.displayName="evtdUnifiedWindowEventHandler",w}const m=f(),p=g();function y(w,C){const x=u[w];return x[C]===void 0&&(x[C]=new Map,window.addEventListener(C,m,w==="capture")),x[C]}function b(w){return h[w]===void 0&&(h[w]=new Set,window.addEventListener(w,p)),h[w]}function _(w,C){let x=w.get(C);return x===void 0&&w.set(C,x=new Set),x}function B(w,C,x,T){const $=u[C][x];if($!==void 0){const F=$.get(w);if(F!==void 0&&F.has(T))return!0}return!1}function k(w,C){const x=h[w];return!!(x!==void 0&&x.has(C))}function N(w,C,x,T){let $;if(typeof T=="object"&&T.once===!0?$=Z=>{R(w,C,$,T),x(Z)}:$=x,_w(w,C,$,T))return;const I=T===!0||typeof T=="object"&&T.capture===!0?"capture":"bubble",L=y(I,w),O=_(L,C);if(O.has($)||O.add($),C===window){const Z=b(w);Z.has($)||Z.add($)}}function R(w,C,x,T){if(ww(w,C,x,T))return;const F=T===!0||typeof T=="object"&&T.capture===!0,I=F?"capture":"bubble",L=y(I,w),O=_(L,C);if(C===window&&!B(C,F?"bubble":"capture",w,x)&&k(w,x)){const ne=h[w];ne.delete(x),ne.size===0&&(window.removeEventListener(w,p),h[w]=void 0)}O.has(x)&&O.delete(x),O.size===0&&L.delete(C),L.size===0&&(window.removeEventListener(w,m,I==="capture"),u[I][w]=void 0)}return{on:N,off:R}}const{on:Rt,off:ot}=xw(),Ki="@@mmoContext",kw={mounted(t,{value:e}){t[Ki]={handler:void 0},typeof e=="function"&&(t[Ki].handler=e,Rt("mousemoveoutside",t,e))},updated(t,{value:e}){const n=t[Ki];typeof e=="function"?n.handler?n.handler!==e&&(ot("mousemoveoutside",t,n.handler),n.handler=e,Rt("mousemoveoutside",t,e)):(t[Ki].handler=e,Rt("mousemoveoutside",t,e)):n.handler&&(ot("mousemoveoutside",t,n.handler),n.handler=void 0)},unmounted(t){const{handler:e}=t[Ki];e&&ot("mousemoveoutside",t,e),t[Ki].handler=void 0}},Gi="@@coContext",_s={mounted(t,{value:e,modifiers:n}){t[Gi]={handler:void 0},typeof e=="function"&&(t[Gi].handler=e,Rt("clickoutside",t,e,{capture:n.capture}))},updated(t,{value:e,modifiers:n}){const r=t[Gi];typeof e=="function"?r.handler?r.handler!==e&&(ot("clickoutside",t,r.handler,{capture:n.capture}),r.handler=e,Rt("clickoutside",t,e,{capture:n.capture})):(t[Gi].handler=e,Rt("clickoutside",t,e,{capture:n.capture})):r.handler&&(ot("clickoutside",t,r.handler,{capture:n.capture}),r.handler=void 0)},unmounted(t,{modifiers:e}){const{handler:n}=t[Gi];n&&ot("clickoutside",t,n,{capture:e.capture}),t[Gi].handler=void 0}};function vw(t,e){console.error(`[vdirs/${t}]: ${e}`)}class Cw{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&&vw("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 Ko=new Cw,Zi="@@ziContext",au={mounted(t,e){const{value:n={}}=e,{zIndex:r,enabled:s}=n;t[Zi]={enabled:!!s,initialized:!1},s&&(Ko.ensureZIndex(t,r),t[Zi].initialized=!0)},updated(t,e){const{value:n={}}=e,{zIndex:r,enabled:s}=n,o=t[Zi].enabled;s&&!o&&(Ko.ensureZIndex(t,r),t[Zi].initialized=!0),t[Zi].enabled=!!s},unmounted(t,e){if(!t[Zi].initialized)return;const{value:n={}}=e,{zIndex:r}=n;Ko.unregister(t,r)}};function Sw(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 Zt(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 Bw=typeof window<"u";let Qi,xr;(()=>{var t,e;Qi=Bw?(e=(t=document)===null||t===void 0?void 0:t.fonts)===null||e===void 0?void 0:e.ready:void 0,xr=!1,Qi!==void 0?Qi.then(()=>{xr=!0}):xr=!0})();function Tw(t){if(xr)return;let e=!1;i.onMounted(()=>{xr||Qi==null||Qi.then(()=>{e||t()})}),i.onBeforeUnmount(()=>{e=!0})}function Go(t,e){return i.watch(t,n=>{n!==void 0&&(e.value=n)}),i.computed(()=>t.value===void 0?e.value:t.value)}function ws(){const t=i.ref(!1);return i.onMounted(()=>{t.value=!0}),i.readonly(t)}function lu(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 $w=(typeof window>"u"?!1:/iPad|iPhone|iPod/.test(navigator.platform)||navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1)&&!window.MSStream;function Nw(){return $w}function Zo(t,e,n="default"){const r=e[n];if(r===void 0)throw new Error(`[vueuc/${t}]: slot[${n}] is empty.`);return r()}function Qo(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)){Qo(r,e,n);return}if(r.type===i.Fragment){if(r.children===null)return;Array.isArray(r.children)&&Qo(r.children,e,n)}else r.type!==i.Comment&&n.push(r)}}),n}function cu(t,e,n="default"){const r=e[n];if(r===void 0)throw new Error(`[vueuc/${t}]: slot[${n}] is empty.`);const s=Qo(r());if(s.length===1)return s[0];throw new Error(`[vueuc/${t}]: slot[${n}] should have exactly one child.`)}let Qn=null;function du(){if(Qn===null&&(Qn=document.getElementById("v-binder-view-measurer"),Qn===null)){Qn=document.createElement("div"),Qn.id="v-binder-view-measurer";const{style:t}=Qn;t.position="fixed",t.left="0",t.right="0",t.top="0",t.bottom="0",t.pointerEvents="none",t.visibility="hidden",document.body.appendChild(Qn)}return Qn.getBoundingClientRect()}function Rw(t,e){const n=du();return{top:e,left:t,height:0,width:0,right:n.width-t,bottom:n.height-e}}function Jo(t){const e=t.getBoundingClientRect(),n=du();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 Pw(t){return t.nodeType===9?null:t.parentNode}function uu(t){if(t===null)return null;const e=Pw(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 uu(e)}const hu=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=uu(b),b!==null;)o.push(b);for(const _ of o)Rt("scroll",_,h,!0)},l=()=>{for(const b of o)ot("scroll",b,h,!0);o=[]},c=new Set,d=b=>{c.size===0&&a(),c.has(b)||c.add(b)},u=b=>{c.has(b)&&c.delete(b),c.size===0&&l()},h=()=>{Gd(f)},f=()=>{c.forEach(b=>b())},g=new Set,m=b=>{g.size===0&&Rt("resize",window,y),g.has(b)||g.add(b)},p=b=>{g.has(b)&&g.delete(b),g.size===0&&ot("resize",window,y)},y=()=>{g.forEach(b=>b())};return i.onBeforeUnmount(()=>{ot("resize",window,y),l()}),{targetRef:r,setTargetRef:s,addScrollListener:d,removeScrollListener:u,addResizeListener:m,removeResizeListener:p}},render(){return Zo("binder",this.$slots)}}),fu=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(cu("follower",this.$slots),[[e]]):cu("follower",this.$slots)}}),Ew="@css-render/vue3-ssr";function Fw(t,e){return`<style cssr-id="${t}">
|
|
103
|
+
`}},ts=Li.Multiply,op=[1,0,0,0,1,0,0,0,1],Kn=new un(9),ap=yt.Utils,Tc=new re,ko=new un([0,0,1,0,0,1,0,1,1,0,1,1]),xe={precision:.9,isHidden:/(undefined|none|transparent)/i,canvas:Xe.document?Xe.document.createElement("canvas"):{getContext:function(){}},alignments:{left:"start",middle:"center",right:"end"},matrix:new Li,group:{removeChild:function(t,e){if(t.children)for(let n=0;n<t.children.length;n++)xe.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;ie.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 un(9)),this._matrix.toTransformArray(!0,Kn),ts(Kn,n._renderer.matrix,this._renderer.matrix),this._renderer.scale instanceof re||(this._renderer.scale=new re),this._scale instanceof re?(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=yt.Utils.getRendererType(this._mask._renderer.type);xe[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++)xe.group.removeChild(this.subtractions[o],t);for(o=0;o<this.children.length;o++){const a=this.children[o],l=yt.Utils.getRendererType(a._renderer.type);xe[l].render.call(a,t,e)}return this._mask&&t.disable(t.STENCIL_TEST),ie.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},path:{updateCanvas:function(t,e){let n,r,s,o,a,l,c,d,u,h,f,g,m,p;const y=e._renderer.vertices,b=this.canvas,_=this.ctx,B=t.renderer.ratio,x=Tc.copy(e._renderer.scale).multiply(B),N=e._stroke,R=e._linewidth,w=e._fill,C=e._renderer.opacity||e._opacity,k=e._cap,T=e._join,$=e._miter,P=e._closed,E=e.dashes,W=y.length,A=W-1;b.width=Math.max(Math.ceil(e._renderer.rect.width*x.x),1),b.height=Math.max(Math.ceil(e._renderer.rect.height*x.y),1);const Z=e._renderer.rect.centroid,te=Z.x,D=Z.y;if(_.clearRect(0,0,b.width,b.height),w)if(typeof w=="string")_.fillStyle=w;else{const q=yt.Utils.getRendererType(w._renderer.type);xe[q].render.call(w,_,e),_.fillStyle=w._renderer.effect}if(N){if(typeof N=="string")_.strokeStyle=N;else{const q=yt.Utils.getRendererType(N._renderer.type);xe[q].render.call(N,_,e),_.strokeStyle=N._renderer.effect}R&&(_.lineWidth=hn(e)),$&&(_.miterLimit=$),T&&(_.lineJoin=T),!P&&k&&(_.lineCap=k)}typeof C=="number"&&(_.globalAlpha=C),E&&E.length>0&&(_.lineDashOffset=E.offset||0,_.setLineDash(E));let H,L,M,O,Y,U,V,j;_.save(),_.scale(x.x,x.y),_.translate(te,D),_.beginPath();for(let q=0;q<y.length;q++){const ee=y[q];switch(g=ee.x,m=ee.y,ee.command){case se.close:_.closePath();break;case se.arc:L=ee.rx,M=ee.ry,O=ee.xAxisRotation,Y=ee.largeArcFlag,U=ee.sweepFlag,n=P?Dt(q-1,W):Math.max(q-1,0),r=y[n],V=r.x,j=r.y,ap.renderSvgArcCommand(_,V,j,L,M,Y,U,O,g,m);break;case se.curve:n=P?Dt(q-1,W):Math.max(q-1,0),r=y[n],d=r.controls&&r.controls.right||re.zero,u=ee.controls&&ee.controls.left||re.zero,r._relative?(l=d.x+r.x,c=d.y+r.y):(l=d.x,c=d.y),ee._relative?(o=u.x+ee.x,a=u.y+ee.y):(o=u.x,a=u.y),_.bezierCurveTo(l,c,o,a,g,m),q>=A&&P&&(s=H,h=ee.controls&&ee.controls.right||re.zero,f=s.controls&&s.controls.left||re.zero,ee._relative?(l=h.x+ee.x,c=h.y+ee.y):(l=h.x,c=h.y),s._relative?(o=f.x+s.x,a=f.y+s.y):(o=f.x,a=f.y),g=s.x,m=s.y,_.bezierCurveTo(l,c,o,a,g,m));break;case se.line:_.lineTo(g,m);break;case se.move:H=ee,_.moveTo(g,m);break}}P&&_.closePath(),xe.isHidden.test(w)||(p=w._renderer&&w._renderer.offset,p&&(_.save(),_.translate(-w._renderer.offset.x,-w._renderer.offset.y),_.scale(w._renderer.scale.x,w._renderer.scale.y)),_.fill(),p&&_.restore()),xe.isHidden.test(N)||(p=N._renderer&&N._renderer.offset,p&&(_.save(),_.translate(-N._renderer.offset.x,-N._renderer.offset.y),_.scale(N._renderer.scale.x,N._renderer.scale.y),_.lineWidth=R/N._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 u=d.x,h=d.y,f=d.controls;let g,m,p,y,b,_;o=Math.min(h,o),r=Math.min(u,r),s=Math.max(u,s),a=Math.max(h,a),d.controls&&(b=f.left,_=f.right,!(!b||!_)&&(g=d._relative?b.x+u:b.x,m=d._relative?b.y+h:b.y,p=d._relative?_.x+u:_.x,y=d._relative?_.y+h:_.y,!(!g||!m||!p||!y)&&(o=Math.min(m,y,o),r=Math.min(g,p,r),s=Math.max(g,p,s),a=Math.max(m,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;ie.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();const r=n||this.parent,s=yt.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 Ye&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagEndPoints)||this._fill instanceof Ue&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagRadius||this._fill._flagCenter||this._fill._flagFocal)||this._fill instanceof Oe&&(this._fill._flagLoaded&&this._fill.loaded||this._fill._flagImage||this._fill._flagVideo||this._fill._flagRepeat||this._fill._flagOffset||this._fill._flagScale)||this._stroke instanceof Ye&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagEndPoints)||this._stroke instanceof Ue&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagRadius||this._stroke._flagCenter||this._stroke._flagFocal)||this._stroke instanceof Oe&&(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 un(9)),this._matrix.toTransformArray(!0,Kn),ts(Kn,r._renderer.matrix,this._renderer.matrix),this._renderer.scale instanceof re||(this._renderer.scale=new re);let h,f;this._scale instanceof re?(h=this._scale.x*r._renderer.scale.x,f=this._scale.y*r._renderer.scale.y):(h=this._scale*r._renderer.scale.x,f=this._scale*r._renderer.scale.y),this._renderer.scale.x=h<0?-h:h,this._renderer.scale.y=f<0?-f:f,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 h=yt.Utils.getRendererType(this._mask._renderer.type);xe[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(d?(this._renderer.rect||(this._renderer.rect={}),this._renderer.opacity=this._opacity*r._renderer.opacity,xe.path.getBoundingClientRect(this._renderer.vertices,this._linewidth,this._renderer.rect),xe.updateTexture.call(xe,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,ko,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 u=this._renderer.rect;return t.uniformMatrix3fv(o.matrix,!1,this._renderer.matrix),t.uniform4f(o.rect,u.left,u.top,u.right,u.bottom),t.drawArrays(t.TRIANGLES,0,6),this._mask&&t.disable(t.STENCIL_TEST),ie.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,u=e.dashes,h=e._size*o;let f=h;xe.isHidden.test(a)||(f+=l),r.width=pl(f),r.height=r.width;const g=f/r.width,m=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=yt.Utils.getRendererType(c._renderer.type);xe[y].render.call(c,s,e),s.fillStyle=c._renderer.effect}if(a){if(typeof a=="string")s.strokeStyle=a;else{const y=yt.Utils.getRendererType(a._renderer.type);xe[y].render.call(a,s,e),s.strokeStyle=a._renderer.effect}l&&(s.lineWidth=hn(e)/g)}typeof d=="number"&&(s.globalAlpha=d),u&&u.length>0&&(s.lineDashOffset=u.offset||0,s.setLineDash(u)),s.save(),s.translate(m,p),s.scale(xe.precision,xe.precision),s.beginPath(),s.arc(0,0,h/g*.5,0,gt),s.restore(),closed&&s.closePath(),xe.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()),xe.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;ie.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,u=this._matrix.manual||this._flagMatrix,h=this._renderer.parent!==s,f=this._renderer.vertices,g=this._renderer.collection.length,m=this._flagVertices,p=this._flagFill||this._fill instanceof Ye&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagEndPoints)||this._fill instanceof Ue&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagRadius||this._fill._flagCenter||this._fill._flagFocal)||this._fill instanceof Oe&&(this._fill._flagLoaded&&this._fill.loaded||this._fill._flagImage||this._fill._flagVideo||this._fill._flagRepeat||this._fill._flagOffset||this._fill._flagScale)||this._stroke instanceof Ye&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagEndPoints)||this._stroke instanceof Ue&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagRadius||this._stroke._flagCenter||this._stroke._flagFocal)||this._stroke instanceof Oe&&(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||u||h){this._renderer.matrix||(this._renderer.matrix=new un(9)),this._matrix.toTransformArray(!0,Kn),ts(Kn,s._renderer.matrix,this._renderer.matrix),this._renderer.scale instanceof re||(this._renderer.scale=new re);let y,b;this._scale instanceof re?(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,h&&(this._renderer.parent=s)}if(m){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,f,t.STATIC_DRAW)}return p?(this._renderer.opacity=this._opacity*s._renderer.opacity,xe.updateTexture.call(xe,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:(xe.isHidden.test(l)||(r+=c),r/=xe.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),ie.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=Tc.copy(e._renderer.scale).multiply(s),a=e._stroke,l=e._linewidth,c=e._fill,d=e._renderer.opacity||e._opacity,u=e.dashes,h=e._decoration,f=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,m=g.x,p=g.y;let y,b,_,B,x,N,R,w,C,k,T;const $=c._renderer&&c._renderer.offset&&a._renderer&&a._renderer.offset;if(r.clearRect(0,0,n.width,n.height),$||(r.font=[e._style,e._weight,e._size+"px/"+e._leading+"px",e._family].join(" ")),r.textAlign="center",r.textBaseline="middle",r.textDirection=f,c)if(typeof c=="string")r.fillStyle=c;else{const P=yt.Utils.getRendererType(c._renderer.type);xe[P].render.call(c,r,e),r.fillStyle=c._renderer.effect}if(a){if(typeof a=="string")r.strokeStyle=a;else{const P=yt.Utils.getRendererType(a._renderer.type);xe[P].render.call(a,r,e),r.strokeStyle=a._renderer.effect}l&&(r.lineWidth=hn(e))}if(typeof d=="number"&&(r.globalAlpha=d),u&&u.length>0&&(r.lineDashOffset=u.offset||0,r.setLineDash(u)),r.save(),r.scale(o.x,o.y),r.translate(m,p),xe.isHidden.test(c)||(c._renderer&&c._renderer.offset?(N=c._renderer.scale.x,R=c._renderer.scale.y,r.save(),r.translate(-c._renderer.offset.x,-c._renderer.offset.y),r.scale(N,R),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,B=c._renderer.offset.y/c._renderer.scale.y,r.fillText(e.value,_,B),r.restore()):r.fillText(e.value,0,0)),xe.isHidden.test(a)||(a._renderer&&a._renderer.offset?(N=a._renderer.scale.x,R=a._renderer.scale.y,r.save(),r.translate(-a._renderer.offset.x,-a._renderer.offset.y),r.scale(N,R),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,B=a._renderer.offset.y/a._renderer.scale.y,x=l/a._renderer.scale.x,r.lineWidth=x,r.strokeText(e.value,_,B),r.restore()):r.strokeText(e.value,0,0)),/(underline|strikethrough)/i.test(h)){const P=r.measureText(e.value);switch(h){case"underline":C=P.actualBoundingBoxDescent,T=P.actualBoundingBoxDescent;break;case"strikethrough":C=0,T=0;break}w=-P.width/2,k=P.width/2,r.lineWidth=Math.max(Math.floor(e._size/15),1),r.strokeStyle=r.fillStyle,r.beginPath(),r.moveTo(w,C),r.lineTo(k,T),r.stroke()}r.restore()},getBoundingClientRect:function(t,e){const n=xe.ctx;n.font=[t._style,t._weight,t._size+"px/"+t._leading+"px",t._family].join(" "),n.textAlign="center",n.textBaseline=yt.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&&!xe.isHidden.test(this._stroke)&&(s+=this._linewidth*2,o+=this._linewidth*2);const a=s/2,l=o/2;switch(xe.alignments[t._alignment]||t._alignment){case xe.alignments.left:t.direction==="ltr"?(e.left=0,e.right=s):(e.left=-s,e.right=0);break;case xe.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;ie.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 Ye&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagEndPoints)||this._fill instanceof Ue&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagRadius||this._fill._flagCenter||this._fill._flagFocal)||this._fill instanceof Oe&&(this._fill._flagLoaded&&this._fill.loaded||this._fill._flagImage||this._fill._flagVideo||this._fill._flagRepeat||this._fill._flagOffset||this._fill._flagScale)||this._stroke instanceof Ye&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagEndPoints)||this._stroke instanceof Ue&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagRadius||this._stroke._flagCenter||this._stroke._flagFocal)||this._stroke instanceof Oe&&(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 un(9)),this._matrix.toTransformArray(!0,Kn),ts(Kn,r._renderer.matrix,this._renderer.matrix),this._renderer.scale instanceof re||(this._renderer.scale=new re);let u,h;this._scale instanceof re?(u=this._scale.x*r._renderer.scale.x,h=this._scale.y*r._renderer.scale.y):(u=this._scale*r._renderer.scale.x,h=this._scale*r._renderer.scale.y),this._renderer.scale.x=u<0?-u:u,this._renderer.scale.y=h<0?-h:h,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 u=yt.Utils.getRendererType(this._mask._renderer.type);xe[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(c?(this._renderer.rect||(this._renderer.rect={}),this._renderer.opacity=this._opacity*r._renderer.opacity,xe.text.getBoundingClientRect(this,this._renderer.rect),xe.updateTexture.call(xe,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,ko,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),ie.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},"linear-gradient":{render:function(t,e){if(!(!t.canvas.getContext("2d")||!e)){if(ie.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 ie.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}}},"radial-gradient":{render:function(t,e){if(!(!t.canvas.getContext("2d")||!e)){if(ie.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 ie.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}}},texture:{render:function(t,e){if(!t.canvas.getContext("2d"))return;ie.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 re||(this._renderer.offset=new re),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 re?(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 re||(this._renderer.scale=new re);let r,s;this._scale instanceof re?(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 ie.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},updateTexture:function(t,e){const n=yt.Utils.getRendererType(e._renderer.type);if(this[n].updateCanvas.call(xe,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(),ie.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 At("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]=xe.extensions.get(t,s)}return e},get:function(t,e){return t.getExtension(e)||t.getExtension(`MOZ_${e}`)||t.getExtension(`WEBKIT_${e}`)}},TextureRegistry:new Dr};xe.ctx=xe.canvas.getContext("2d");var $c=class extends Q{constructor(t){super();let e,n,r,s;if(this.domElement=t.domElement||document.createElement("canvas"),typeof t.offscreenElement<"u"&&(xe.canvas=t.offscreenElement,xe.ctx=xe.canvas.getContext("2d")),this.scene=new ct,this.scene.parent=this,this._renderer={type:"renderer",matrix:new un(op),scale:1,opacity:1},this._flagMatrix=!0,t=ie.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 At("unable to create a webgl context. Try using another renderer.");r=Kt.create(e,Kt.path.vertex,Kt.types.vertex),s=Kt.create(e,Kt.path.fragment,Kt.types.fragment),this.programs={current:null,buffers:{position:e.createBuffer()},resolution:{width:0,height:0,ratio:1,flagged:!1}},n=this.programs.path=xe.program.create(e,[r,s]),this.programs.text=this.programs.path,e.extensions=xe.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,ko,e.STATIC_DRAW),r=Kt.create(e,Kt.points.vertex,Kt.types.vertex),s=Kt.create(e,Kt.points.fragment,Kt.types.fragment),n=this.programs.points=xe.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"?Zs(o):n,this.domElement.width=t*this.ratio,this.domElement.height=e*this.ratio,ie.isObject(this.domElement.style)&&ie.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(Q.Types.resize,t,e,n)}render(){const t=this.ctx;return this.overdraw||t.clear(t.COLOR_BUFFER_BIT),xe.group.render.call(this.scene,t,this.programs),this._flagMatrix=!1,this.programs.resolution.flagged=!0,this}};v($c,"Utils",xe);var lp=ie.extend({Error:At,getRatio:Zs,read:qe,xhr:xc},ie,Bt,hl,fl),Ce=class Ar{constructor(e){v(this,"_events",new Q),v(this,"type",""),v(this,"renderer",null),v(this,"scene",null),v(this,"width",0),v(this,"height",0),v(this,"frameCount",0),v(this,"timeDelta",0),v(this,"playing",!1);const n=ie.defaults(e||{},{fullscreen:!1,fitted:!1,width:640,height:480,type:Ar.Types.svg,autostart:!1});if(ie.each(n,function(r,s){/fullscreen/i.test(s)||/autostart/i.test(s)||(this[s]=r)},this),ie.isElement(n.domElement)){const r=n.domElement.tagName.toLowerCase();/^(CanvasRenderer-canvas|WebGLRenderer-canvas|SVGRenderer-svg)$/.test(this.type+"-"+r)||(this.type=Ar.Types[r])}this.renderer=new Ar[this.type](this),this.setPlaying(n.autostart),this.frameCount=0,n.fullscreen?(this.fit=cp.bind(this),this.fit.domElement=window,this.fit.attached=!0,ie.extend(document.body.style,{overflow:"hidden",margin:0,padding:0,top:0,left:0,right:0,bottom:0,position:"fixed"}),ie.extend(this.renderer.domElement.style,{display:"block",top:0,left:0,right:0,bottom:0,position:"fixed"}),Lt.bind(this.fit.domElement,"resize",this.fit),this.fit()):n.fitted?(this.fit=dp.bind(this),ie.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(Q.Types.resize,up.bind(this)),this.scene=this.renderer.scene,Ar.Instances.push(this),n.autostart&&hr.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,hr.init(),this.trigger(Q.Types.play)}pause(){return this.playing=!1,this.trigger(Q.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=ie.performance.now();e&&(this.timeDelta=parseFloat((n-this._lastFrame).toFixed(3))),this._lastFrame=n,this.fit&&this.fit.domElement&&!this.fit.attached&&(Lt.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(Q.Types.update,this.frameCount,this.timeDelta),this.render()}render(){return this.renderer.render(),this.trigger(Q.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 Gr(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 Be(e,n,void 0,void 0,void 0,void 0,se.move),new Be(r,s,void 0,void 0,void 0,void 0,se.line),new Be(r-a*Math.cos(l-Math.PI/4),s-a*Math.sin(l-Math.PI/4),void 0,void 0,void 0,void 0,se.line),new Be(r,s,void 0,void 0,void 0,void 0,se.move),new Be(r-a*Math.cos(l+Math.PI/4),s-a*Math.sin(l+Math.PI/4),void 0,void 0,void 0,void 0,se.line)],d=new Ne(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 Un(e,n,r,s);return this.scene.add(o),o}makeRoundedRectangle(e,n,r,s,o){const a=new Yr(e,n,r,s,o);return this.scene.add(a),a}makeCircle(e,n,r,s){const o=new qr(e,n,r,s);return this.scene.add(o),o}makeEllipse(e,n,r,s,o){const a=new Xr(e,n,r,s,o);return this.scene.add(a),a}makeStar(e,n,r,s,o){const a=new fo(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 Be(l,c))}}const r=arguments[n-1],s=new Ne(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 ho(e,n,r,s);return this.scene.add(o),o}makeArcSegment(e,n,r,s,o,a,l){const c=new so(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 re(a,l))}}const s=new uo(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 Be(c,d))}}const s=arguments[n-1],o=new Ne(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 fn(e,n,r,s);return this.add(o),o}makeLinearGradient(e,n,r,s){const o=Array.prototype.slice.call(arguments,4),a=new Ye(e,n,r,s,o);return this.add(a),a}makeRadialGradient(e,n,r){const s=Array.prototype.slice.call(arguments,3),o=new Ue(e,n,r,s);return this.add(o),o}makeSprite(e,n,r,s,o,a,l){const c=new jr(e,n,r,s,o,a);return l&&c.play(),this.add(c),c}makeImage(e,n,r,s,o,a){const l=new kc(e,n,r,s,o,a);return this.add(l),l}makeImageSequence(e,n,r,s,o){const a=new yo(e,n,r,s);return o&&a.play(),this.add(a),a}makeTexture(e,n){return new Oe(e,n)}makeGroup(e){e instanceof Array||(e=Array.prototype.slice.call(arguments));const n=new ct;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 qe))return null;const o=qe[s].call(this,e);return r?this.add(n&&o instanceof ct?o.children:o):o.parent&&o.remove(),o}load(e,n){const r=new ct;let s,o,a;const l=(function(c){for(Lt.temp.innerHTML=c,o=0;o<Lt.temp.children.length;o++)s=Lt.temp.children[o],a=this.interpret(s,!1,!1),a!==null&&r.add(a);if(typeof n=="function"){const d=Lt.temp.children.length<=1?Lt.temp.children[0]:Lt.temp.children;n(r,d)}}).bind(this);return/\.svg$/i.test(e)?(xc(e,l),r):(l(e),r)}};v(Ce,"NextFrameId",Tt.NextFrameId),v(Ce,"Types",Tt.Types),v(Ce,"Version",Tt.Version),v(Ce,"PublishDate",Tt.PublishDate),v(Ce,"Identifier",Tt.Identifier),v(Ce,"Resolution",Tt.Resolution),v(Ce,"AutoCalculateImportedMatrices",Tt.AutoCalculateImportedMatrices),v(Ce,"Instances",Tt.Instances),v(Ce,"uniqueId",Tt.uniqueId),v(Ce,"Anchor",Be),v(Ce,"Collection",qn),v(Ce,"Events",Q),v(Ce,"Group",ct),v(Ce,"Matrix",Li),v(Ce,"Path",Ne),v(Ce,"Registry",Dr),v(Ce,"Element",Di),v(Ce,"Shape",Yn),v(Ce,"Text",fn),v(Ce,"Vector",re),v(Ce,"Gradient",rt),v(Ce,"Image",kc),v(Ce,"ImageSequence",yo),v(Ce,"LinearGradient",Ye),v(Ce,"RadialGradient",Ue),v(Ce,"Sprite",jr),v(Ce,"Stop",Xn),v(Ce,"Texture",Oe),v(Ce,"ArcSegment",so),v(Ce,"Circle",qr),v(Ce,"Ellipse",Xr),v(Ce,"Line",Gr),v(Ce,"Points",uo),v(Ce,"Polygon",ho),v(Ce,"Rectangle",Un),v(Ce,"RoundedRectangle",Yr),v(Ce,"Star",fo),v(Ce,"CanvasRenderer",yt),v(Ce,"SVGRenderer",Bc),v(Ce,"WebGLRenderer",$c),v(Ce,"Commands",se),v(Ce,"Utils",lp);var gn=Ce;function cp(){const t=document.body.getBoundingClientRect(),e=this.width=t.width,n=this.height=t.height;this.renderer.setSize(e,n,this.ratio)}function dp(){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 up(t,e){this.width=t,this.height=e,this.trigger(Q.Types.resize,t,e)}var hr=Lt.getRequestAnimationFrame();function Nc(){for(let t=0;t<gn.Instances.length;t++){const e=gn.Instances[t];e.playing&&e.update()}gn.NextFrameId=hr(Nc)}hr.init=function(){Nc(),hr.init=function(){}};let pn;typeof window<"u"?pn=window:typeof global<"u"?pn=global:typeof self<"u"&&(pn=self);let Rc;const di=Math.PI*2,dt=Math.PI*.5;function hp(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 fp(t){Rc=t}function mp(t,e){e=e&&e.identity()||new Rc;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 Gt(t,e,n){return n*(e-t)+t}function ji(t,e){for(;t<0;)t+=e;return t%e}const Pc=pn.Float32Array||Array,gp=Math.floor;function yn(t){return gp(t*1e6)/1e6}const pe={move:"M",line:"L",curve:"C",close:"Z"};class ne{constructor(){S(this,"_events",{});S(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 u=a[c];u=u.handler?u.handler:u,n!==u&&l.push(u)}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}}S(ne,"Types",{play:"play",pause:"pause",update:"update",render:"render",resize:"resize",change:"change",remove:"remove",insert:"insert",order:"order",load:"load"}),S(ne,"Methods",["addEventListener","on","removeEventListener","off","unbind","dispatchEvent","trigger","listen","ignore"]);const Ec={x:{enumerable:!0,get:function(){return this._x},set:function(t){this._x!==t&&(this._x=t,this._bound&&this.dispatchEvent(ne.Types.change))}},y:{enumerable:!0,get:function(){return this._y},set:function(t){this._y!==t&&(this._y=t,this._bound&&this.dispatchEvent(ne.Types.change))}}},ht=class ht extends ne{constructor(n=0,r=0){super();S(this,"_x",0);S(this,"_y",0);for(let s in Ec)Object.defineProperty(this,s,Ec[s]);this.x=n,this.y=r}static add(n,r){return new ht(n.x+r.x,n.y+r.y)}static sub(n,r){return new ht(n.x-r.x,n.y-r.y)}static subtract(n,r){return ht.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(ht.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 ht(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:yn(this.x),y:yn(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}};S(ht,"zero",new ht),S(ht,"left",new ht(-1,0)),S(ht,"right",new ht(1,0)),S(ht,"up",new ht(0,-1)),S(ht,"down",new ht(0,1));let be=ht;class Fe extends be{constructor(n=0,r=0,s=0,o=0,a=0,l=0,c=pe.move){super(n,r);S(this,"controls",{left:new be,right:new be});S(this,"_command",pe.move);S(this,"_relative",!0);S(this,"_rx",0);S(this,"_ry",0);S(this,"_xAxisRotation",0);S(this,"_largeArcFlag",0);S(this,"_sweepFlag",1);for(let u in Fc)Object.defineProperty(this,u,Fc[u]);this.command=c,this.relative=!0;const d=Fe.makeBroadcast(this);this.controls.left.set(s,o).addEventListener(ne.Types.change,d),this.controls.right.set(a,l).addEventListener(ne.Types.change,d)}static makeBroadcast(n){return r;function r(){n._bound&&n.dispatchEvent(ne.Types.change)}}static fromObject(n){return new Fe().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 Fe().copy(this)}toObject(){return{x:yn(this.x),y:yn(this.y),command:this.command,relative:this.relative,controls:{left:this.controls.left.toObject(),right:this.controls.right.toObject()},rx:yn(this.rx),ry:yn(this.ry),xAxisRotation:yn(this.xAxisRotation),largeArcFlag:yn(this.largeArcFlag),sweepFlag:yn(this.sweepFlag)}}toString(){return JSON.stringify(this.toObject())}}const Fc={command:{enumerable:!0,get:function(){return this._command},set:function(t){this._command!==t&&(this._command=t,this._bound&&this.dispatchEvent(ne.Types.change))}},relative:{enumerable:!0,get:function(){return this._relative},set:function(t){this._relative!==!!t&&(this._relative=!!t,this._bound&&this.dispatchEvent(ne.Types.change))}},rx:{enumerable:!0,get:function(){return this._rx},set:function(t){this._rx!==t&&(this._rx=t,this._bound&&this.dispatchEvent(ne.Types.change))}},ry:{enumerable:!0,get:function(){return this._ry},set:function(t){this._ry!==t&&(this._ry=t,this._bound&&this.dispatchEvent(ne.Types.change))}},xAxisRotation:{enumerable:!0,get:function(){return this._xAxisRotation},set:function(t){this._xAxisRotation!==t&&(this._xAxisRotation=t,this._bound&&this.dispatchEvent(ne.Types.change))}},largeArcFlag:{enumerable:!0,get:function(){return this._largeArcFlag},set:function(t){this._largeArcFlag!==t&&(this._largeArcFlag=t,this._bound&&this.dispatchEvent(ne.Types.change))}},sweepFlag:{get:function(){return this._sweepFlag},set:function(t){this._sweepFlag!==t&&(this._sweepFlag=t,this._bound&&this.dispatchEvent(ne.Types.change))}}};let pp=0;const vo={NextFrameId:null,Types:{webgl:"WebGLRenderer",svg:"SVGRenderer",canvas:"CanvasRenderer"},Version:"<%= version %>",PublishDate:"<%= publishDate %>",Identifier:"two-",Resolution:12,AutoCalculateImportedMatrices:!0,Instances:[],uniqueId:function(){return pp++}},ns={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 is(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 Vc(t,e,n,r,s,o,a,l,c){c=c||ns.RecursionLimit;const d=c+1;if(Math.abs(t-a)<.001&&Math.abs(e-l)<.001)return[new Fe(a,l)];const u=[];for(let h=0;h<d;h++){const f=h/d,g=is(f,t,n,s,a),m=is(f,e,r,o,l);u.push(new Fe(g,m))}return u}function yp(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),u=6*(t+s)-12*n,h=3*(n-t),f=9*(r-o)+3*(l-e),g=6*(e+o)-12*r,m=3*(r-e);function p(y){const b=(d*y+u)*y+h,_=(f*y+g)*y+m;return Math.sqrt(b*b+_*_)}return _p(p,0,1,c||ns.RecursionLimit)}function bp(t,e,n,r,s,o,a,l){const c=[],d=[[],[]];let u,h,f,g,m,p,y,b;for(let N=0;N<2;++N){if(N===0?(h=6*t-12*n+6*s,u=-3*t+9*n-9*s+3*a,f=3*n-3*t):(h=6*e-12*r+6*o,u=-3*e+9*r-9*o+3*l,f=3*r-3*e),Math.abs(u)<.001){if(Math.abs(h)<.001)continue;g=-f/h,0<g&&g<1&&c.push(g);continue}y=h*h-4*f*u,b=Math.sqrt(y),!(y<0)&&(m=(-h+b)/(2*u),0<m&&m<1&&c.push(m),p=(-h-b)/(2*u),0<p&&p<1&&c.push(p))}let _=c.length,B=_,x;for(;_--;)g=c[_],x=1-g,d[0][_]=x*x*x*t+3*x*x*g*n+3*x*g*g*s+g*g*g*a,d[1][_]=x*x*x*e+3*x*x*g*r+3*x*g*g*o+g*g*g*l;return d[0][B]=t,d[1][B]=e,d[0][B+1]=a,d[1][B+1]=l,d[0].length=d[1].length=B+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 _p(t,e,n,r){let s=ns.abscissas[r-2],o=ns.weights[r-2],a=.5*(n-e),l=a+e,c=0,d=r+1>>1,u=r&1?o[c++]*t(l):0;for(;c<d;){const h=a*s[c];u+=o[c++]*(t(l+h)+t(l-h))}return a*u}function wp(t,e){const n=t.length,r=n-1;for(let s=0;s<n;s++){const o=t[s],a=e?ji(s-1,n):Math.max(s-1,0),l=e?ji(s+1,n):Math.min(s+1,r),c=t[a],d=o,u=t[l];xp(c,d,u),d.command=s===0?pe.move:pe.curve}}function xp(t,e,n){const r=be.angleBetween(t,e),s=be.angleBetween(n,e);let o=be.distanceBetween(t,e),a=be.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+=dt:l-=dt,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 fr=(Bi=class extends ne{constructor(){super();S(this,"_flagId",!1);S(this,"_flagClassName",!1);S(this,"_renderer",{});S(this,"_id",vo.Identifier+vo.uniqueId());S(this,"_className","");S(this,"classList",[]);for(let n in Ic)Object.defineProperty(this,n,Ic[n])}static fromObject(n){const r=new Bi().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}},S(Bi,"Properties",["renderer","id","className"]),Bi);const Ic={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 rs extends Error{constructor(n){super();S(this,"name","Two.js");S(this,"message");this.message=n}}class kp{constructor(){S(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 ss;const Ac={video:/\.(mp4|webm|ogg)$/i,image:/\.(jpe?g|png|gif|tiff|webp)$/i,effect:/texture|gradient/i};pn.document&&(ss=document.createElement("a"));const Ge=class Ge extends fr{constructor(n,r){super();S(this,"_flagSrc",!1);S(this,"_flagImage",!1);S(this,"_flagVideo",!1);S(this,"_flagLoaded",!1);S(this,"_flagRepeat",!1);S(this,"_flagOffset",!1);S(this,"_flagScale",!1);S(this,"_src","");S(this,"_image",null);S(this,"_loaded",!1);S(this,"_repeat","no-repeat");S(this,"_scale",1);S(this,"_offset",null);for(let s in Mc)Object.defineProperty(this,s,Mc[s]);if(this._renderer.type="texture",this._renderer.flagOffset=vp.bind(this),this._renderer.flagScale=Cp.bind(this),this.loaded=!1,this.repeat="no-repeat",this.offset=new be,typeof r=="function"){const s=(function(){this.unbind(ne.Types.load,s),typeof r=="function"&&r()}).bind(this);this.bind(ne.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 Ge().copy(n);return"id"in n&&(r.id=n.id),r}static getAbsoluteURL(n){return ss?(ss.href=n,ss.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=Ge.getAbsoluteURL(n);if(Ge.ImageRegistry.contains(r))return Ge.ImageRegistry.get(r);let s;return pn.document?Ac.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=Ge.getTag(s);n._flagImage&&(/canvas/i.test(o)?Ge.Register.canvas(n,r):(n._src=s.getAttribute("two-src")||s.src,Ge.Register[o](n,r))),n._flagSrc&&(s||(s=Ge.getImage(n.src),n.image=s),o=Ge.getTag(s),Ge.Register[o](n,r))}clone(){const n=new Ge(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 be?n.offset:new be().copy(n.offset),this.scale=typeof n.scale=="number"||n.scale instanceof be?n.scale:new be().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(ne.Types.change),(this._flagSrc||this._flagImage)&&(this.loaded=!1,Ge.load(this,(function(){this.loaded=!0,this.trigger(ne.Types.change).trigger(ne.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}};S(Ge,"Properties",["src","loaded","repeat","scale","offset","image"]),S(Ge,"RegularExpressions",Ac),S(Ge,"ImageRegistry",new kp),S(Ge,"Register",{canvas:function(n,r){n._src="#"+n.id,Ge.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 rs("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=Ge.getAbsoluteURL(n._src),!(s&&s.getAttribute("two-src"))&&(s.setAttribute("two-src",n.src),Ge.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 rs("unable to load "+n.src)};n._src=Ge.getAbsoluteURL(n._src),n.image.getAttribute("two-src")||(n.image.setAttribute("two-src",n.src),Ge.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 Ke=Ge;const Mc={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=Ke.getTag(t);let n;switch(e){case"canvas":n="#"+t.id;break;default:n=t.src}Ke.ImageRegistry.contains(n)?this._image=Ke.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(ne.Types.change,this._renderer.flagOffset),this._offset=t,this._offset.bind(ne.Types.change,this._renderer.flagOffset),this._flagOffset=!0}},scale:{enumerable:!0,get:function(){return this._scale},set:function(t){this._scale instanceof be&&this._scale.unbind(ne.Types.change,this._renderer.flagScale),this._scale=t,this._scale instanceof be&&this._scale.bind(ne.Types.change,this._renderer.flagScale),this._flagScale=!0}}};function vp(){this._flagOffset=!0}function Cp(){this._flagScale=!0}class ui extends Array{constructor(){super();qa(this,ft,new ne);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 Ft(this,ft)}set _events(n){Gh(this,ft,n)}get _bound(){return Ft(this,ft)._bound}set _bound(n){Ft(this,ft)._bound=n}addEventListener(){return Ft(this,ft).addEventListener.apply(this,arguments)}on(){return Ft(this,ft).on.apply(this,arguments)}bind(){return Ft(this,ft).bind.apply(this,arguments)}removeEventListener(){return Ft(this,ft).removeEventListener.apply(this,arguments)}off(){return Ft(this,ft).off.apply(this,arguments)}unbind(){return Ft(this,ft).unbind.apply(this,arguments)}dispatchEvent(){return Ft(this,ft).dispatchEvent.apply(this,arguments)}trigger(){return Ft(this,ft).trigger.apply(this,arguments)}listen(){return Ft(this,ft).listen.apply(this,arguments)}ignore(){return Ft(this,ft).ignore.apply(this,arguments)}pop(){const n=super.pop.apply(this,arguments);return this.trigger(ne.Types.remove,[n]),n}shift(){const n=super.shift.apply(this,arguments);return this.trigger(ne.Types.remove,[n]),n}push(){const n=super.push.apply(this,arguments);return this.trigger(ne.Types.insert,arguments),n}unshift(){const n=super.unshift.apply(this,arguments);return this.trigger(ne.Types.insert,arguments),n}splice(){const n=super.splice.apply(this,arguments);if(this.trigger(ne.Types.remove,n),arguments.length>2){const r=this.slice(arguments[0],arguments[0]+arguments.length-2);this.trigger(ne.Types.insert,r),this.trigger(ne.Types.order)}return n}sort(){return super.sort.apply(this,arguments),this.trigger(ne.Types.order),this}reverse(){return super.reverse.apply(this,arguments),this.trigger(ne.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}}ft=new WeakMap;const Oc=Array.prototype.slice;function Sp(t){if(t==null)return!1;const e=t.length;return typeof e=="number"&&e>=0&&e<4294967296}const Ie={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=Oc.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=Oc.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=!Sp(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:pn.performance&&pn.performance.now?pn.performance:Date},Ot=class Ot extends fr{constructor(n,r,s){super();S(this,"_flagOffset",!0);S(this,"_flagOpacity",!0);S(this,"_flagColor",!0);S(this,"_offset",0);S(this,"_opacity",1);S(this,"_color","#fff");for(let o in zc)Object.defineProperty(this,o,zc[o]);this._renderer.type="stop",this.offset=typeof n=="number"?n:Ot.Index<=0?0:1,this.opacity=typeof s=="number"?s:1,this.color=typeof r=="string"?r:Ot.Index<=0?"#fff":"#000",Ot.Index=(Ot.Index+1)%2}static fromObject(n){const r=new Ot().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<Ot.Properties.length;r++){const s=Ot.Properties[r];s in n&&(this[s]=n[s])}return this}clone(n){const r=new Ot;return Ie.each(Ot.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",Ie.each(Ot.Properties,r=>{n[r]=this[r]},this),n}flagReset(){return this._flagOffset=this._flagColor=this._flagOpacity=!1,super.flagReset.call(this),this}};S(Ot,"Index",0),S(Ot,"Properties",["offset","opacity","color"]);let hi=Ot;const zc={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)}}},kn=class kn extends fr{constructor(n){super();S(this,"_flagStops",!1);S(this,"_flagSpread",!1);S(this,"_flagUnits",!1);S(this,"_spread","");S(this,"_units","");for(let r in Dc)Object.defineProperty(this,r,Dc[r]);this._renderer.type="gradient",this._renderer.flagStops=Bp.bind(this),this._renderer.bindStops=Tp.bind(this),this._renderer.unbindStops=$p.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 hi?o:new hi().copy(o)));const s=new kn(r).copy(n);return"id"in n&&(s.id=n.id),s}clone(n){const r=this.stops.map(o=>o.clone()),s=new kn(r);return Ie.each(kn.Properties,o=>{s[o]=this[o]},this),n&&n.add(s),s}copy(n){super.copy.call(this,n);for(let r=0;r<kn.Properties.length;r++){const s=kn.Properties[r];s in n&&(this[s]=n[s])}return this}toObject(){const n={stops:this.stops.map(r=>r.toObject())};return Ie.each(kn.Properties,r=>{n[r]=this[r]},this),n}_update(){return(this._flagSpread||this._flagStops)&&this.trigger(ne.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}};S(kn,"Stop",hi),S(kn,"Properties",["spread","stops","units"]);let st=kn;const Dc={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(ne.Types.insert,e).unbind(ne.Types.remove,n),this._stops=new ui((t||[]).slice(0)),this._stops.bind(ne.Types.insert,e).bind(ne.Types.remove,n),e(this._stops)}}};function Bp(){this._flagStops=!0}function Tp(t){let e=t.length;for(;e--;)t[e].bind(ne.Types.change,this._renderer.flagStops),t[e].parent=this;this._renderer.flagStops()}function $p(t){let e=t.length;for(;e--;)t[e].unbind(ne.Types.change,this._renderer.flagStops),delete t[e].parent;this._renderer.flagStops()}const ti=class ti extends st{constructor(n,r,s,o,a){super(a);S(this,"_flagEndPoints",!1);S(this,"_left",null);S(this,"_right",null);for(let l in Lc)Object.defineProperty(this,l,Lc[l]);this._renderer.type="linear-gradient",this._renderer.flagEndPoints=Np.bind(this),this.left=new be,this.right=new be,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 ti().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<ti.Properties.length;r++){const s=ti.Properties[r];s in n&&(this[s]=n[s]instanceof be?n[s]:new be().copy(n[s]))}return this}clone(n){const r=this.stops.map(function(o){return o.clone()}),s=new ti(this.left._x,this.left._y,this.right._x,this.right._y,r);return Ie.each(st.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(ne.Types.change),this}flagReset(){return this._flagEndPoints=!1,super.flagReset.call(this),this}};S(ti,"Stop",hi),S(ti,"Properties",["left","right"]);let $t=ti;const Lc={left:{enumerable:!0,get:function(){return this._left},set:function(t){this._left instanceof be&&this._left.unbind(ne.Types.change,this._renderer.flagEndPoints),this._left=t,this._left.bind(ne.Types.change,this._renderer.flagEndPoints),this._flagEndPoints=!0}},right:{enumerable:!0,get:function(){return this._right},set:function(t){this._right instanceof be&&this._right.unbind(ne.Types.change,this._renderer.flagEndPoints),this._right=t,this._right.bind(ne.Types.change,this._renderer.flagEndPoints),this._flagEndPoints=!0}}};function Np(){this._flagEndPoints=!0}const vn=class vn extends st{constructor(n,r,s,o,a,l){super(o);S(this,"_flagRadius",!1);S(this,"_flagCenter",!1);S(this,"_flagFocal",!1);S(this,"_radius",0);S(this,"_center",null);S(this,"_focal",null);for(let c in Hc)Object.defineProperty(this,c,Hc[c]);this._renderer.type="radial-gradient",this._renderer.flagCenter=Rp.bind(this),this._renderer.flagFocal=Pp.bind(this),this.center=new be,this.radius=typeof s=="number"?s:1,this.focal=new be,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 vn().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<vn.Properties.length;r++){const s=vn.Properties[r];s in n&&(/(center|focal)i/.test(s)?this[s]=n[s]instanceof be?n[s]:new be().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 vn(this.center._x,this.center._y,this._radius,r,this.focal._x,this.focal._y);return Ie.each(st.Properties.concat(vn.Properties),function(o){s[o]=this[o]},this),n&&n.add(s),s}toObject(){const n=super.toObject.call(this);return Ie.each(vn.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(ne.Types.change),this}flagReset(){return this._flagRadius=this._flagCenter=this._flagFocal=!1,super.flagReset.call(this),this}};S(vn,"Stop",hi),S(vn,"Properties",["center","radius","focal"]);let Nt=vn;const Hc={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(ne.Types.change,this._renderer.flagCenter),this._center=t,this._center.bind(ne.Types.change,this._renderer.flagCenter),this._flagCenter=!0}},focal:{enumerable:!0,get:function(){return this._focal},set:function(t){this._focal&&this._focal.unbind(ne.Types.change,this._renderer.flagFocal),this._focal=t,this._focal.bind(ne.Types.change,this._renderer.flagFocal),this._flagFocal=!0}}};function Rp(){this._flagCenter=!0}function Pp(){this._flagFocal=!0}function Wc(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 os(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 jc(t,e,n){let r,s,o,a,l,c,d,u;const h=e.controls&&e.controls.right,f=t.controls&&t.controls.left;return r=e.x,l=e.y,s=(h||e).x,c=(h||e).y,o=(f||t).x,d=(f||t).y,a=t.x,u=t.y,h&&e._relative&&(s+=e.x,c+=e.y),f&&t._relative&&(o+=t.x,d+=t.y),yp(r,l,s,c,o,d,a,u,n)}function qc(t,e,n){let r,s,o,a,l,c,d,u;const h=e.controls&&e.controls.right,f=t.controls&&t.controls.left;return r=e.x,l=e.y,s=(h||e).x,c=(h||e).y,o=(f||t).x,d=(f||t).y,a=t.x,u=t.y,h&&e._relative&&(s+=e.x,c+=e.y),f&&t._relative&&(o+=t.x,d+=t.y),Vc(r,l,s,c,o,d,a,u,n)}function fi(t){switch(t.renderer.type){case"texture":return Ke.fromObject(t);case"gradient":return st.fromObject(t);case"linear-gradient":return $t.fromObject(t);case"radial-gradient":return Nt.fromObject(t)}return t}const Ep=Math.cos,Fp=Math.sin,Xc=Math.tan,Co=[],Pt=class Pt extends ne{constructor(n,r,s,o,a,l){super();S(this,"elements",new Pc(9));S(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 w=n;let C,k,T;const $=r[0]||0,P=r[1]||0,E=r[2]||0;return C=w[0]*$+w[1]*P+w[2]*E,k=w[3]*$+w[4]*P+w[5]*E,T=w[6]*$+w[7]*P+w[8]*E,[C,k,T]}const o=n[0],a=n[1],l=n[2],c=n[3],d=n[4],u=n[5],h=n[6],f=n[7],g=n[8],m=r[0],p=r[1],y=r[2],b=r[3],_=r[4],B=r[5],x=r[6],N=r[7],R=r[8];return s=s||new Pc(9),s[0]=o*m+a*b+l*x,s[1]=o*p+a*_+l*N,s[2]=o*y+a*B+l*R,s[3]=c*m+d*b+u*x,s[4]=c*p+d*_+u*N,s[5]=c*y+d*B+u*R,s[6]=h*m+f*b+g*x,s[7]=h*p+f*_+g*N,s[8]=h*y+f*B+g*R,s}static fromObject(n){return new Pt().copy(n)}set(n,r,s,o,a,l,c,d,u){if(typeof r>"u"){const h=n;n=h[0],r=h[1],s=h[2],o=h[3],a=h[4],l=h[5],c=h[6],d=h[7],u=h[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]=u,this.trigger(ne.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(ne.Types.change)}identity(){return this.elements[0]=Pt.Identity[0],this.elements[1]=Pt.Identity[1],this.elements[2]=Pt.Identity[2],this.elements[3]=Pt.Identity[3],this.elements[4]=Pt.Identity[4],this.elements[5]=Pt.Identity[5],this.elements[6]=Pt.Identity[6],this.elements[7]=Pt.Identity[7],this.elements[8]=Pt.Identity[8],this.trigger(ne.Types.change)}multiply(n,r,s,o,a,l,c,d,u){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(ne.Types.change);if(typeof s>"u"&&(s=1),typeof o>"u"){n=n||0,r=r||0,s=s||0,a=this.elements;const A=a[0]*n+a[1]*r+a[2]*s,Z=a[3]*n+a[4]*r+a[5]*s,te=a[6]*n+a[7]*r+a[8]*s;return[A,Z,te]}const h=this.elements,f=[n,r,s,o,a,l,c,d,u],g=h[0],m=h[1],p=h[2],y=h[3],b=h[4],_=h[5],B=h[6],x=h[7],N=h[8],R=f[0],w=f[1],C=f[2],k=f[3],T=f[4],$=f[5],P=f[6],E=f[7],W=f[8];return this.elements[0]=g*R+m*k+p*P,this.elements[1]=g*w+m*T+p*E,this.elements[2]=g*C+m*$+p*W,this.elements[3]=y*R+b*k+_*P,this.elements[4]=y*w+b*T+_*E,this.elements[5]=y*C+b*$+_*W,this.elements[6]=B*R+x*k+N*P,this.elements[7]=B*w+x*T+N*E,this.elements[8]=B*C+x*$+N*W,this.trigger(ne.Types.change)}inverse(n){const r=this.elements;n=n||new Pt;const s=r[0],o=r[1],a=r[2],l=r[3],c=r[4],d=r[5],u=r[6],h=r[7],f=r[8],g=f*c-d*h,m=-f*l+d*u,p=h*l-c*u;let y=s*g+o*m+a*p;return y?(y=1/y,n.elements[0]=g*y,n.elements[1]=(-f*o+a*h)*y,n.elements[2]=(d*o-a*c)*y,n.elements[3]=m*y,n.elements[4]=(f*s-a*u)*y,n.elements[5]=(-d*s+a*l)*y,n.elements[6]=p*y,n.elements[7]=(-h*s+o*u)*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=Ep(n),s=Fp(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=Xc(n);return this.multiply(1,r,0,0,1,0,0,0,1)}skewY(n){const r=Xc(n);return this.multiply(1,0,0,r,1,0,0,0,1)}toString(n){return Co.length=0,this.toTransformArray(n,Co),Co.map(yn).join(" ")}toTransformArray(n,r){const s=this.elements,o=!!r,a=s[0],l=s[1],c=s[2],d=s[3],u=s[4],h=s[5];if(n){const f=s[6],g=s[7],m=s[8];if(o){r[0]=a,r[1]=d,r[2]=f,r[3]=l,r[4]=u,r[5]=g,r[6]=c,r[7]=h,r[8]=m;return}return[a,d,f,l,u,g,c,h,m]}if(o){r[0]=a,r[1]=d,r[2]=l,r[3]=u,r[4]=c,r[5]=h;return}return[a,d,l,u,c,h]}toArray(n,r){const s=this.elements,o=!!r,a=s[0],l=s[1],c=s[2],d=s[3],u=s[4],h=s[5];if(n){const f=s[6],g=s[7],m=s[8];if(o){r[0]=a,r[1]=l,r[2]=c,r[3]=d,r[4]=u,r[5]=h,r[6]=f,r[7]=g,r[8]=m;return}return[a,l,c,d,u,h,f,g,m]}if(o){r[0]=a,r[1]=l,r[2]=c,r[3]=d,r[4]=u,r[5]=h;return}return[a,l,c,d,u,h]}toObject(){return{renderer:{type:"matrix"},elements:this.toArray(!0),manual:!!this.manual}}clone(){return new Pt().copy(this)}};S(Pt,"Identity",[1,0,0,0,1,0,0,0,1]);let mr=Pt;fp(mr);const Er=class Er extends fr{constructor(){super();S(this,"_flagMatrix",!0);S(this,"_flagScale",!1);S(this,"_matrix",null);S(this,"_worldMatrix",null);S(this,"_position",null);S(this,"_rotation",0);S(this,"_scale",1);S(this,"_skewX",0);S(this,"_skewY",0);for(let n in as)Object.defineProperty(this,n,as[n]);this._renderer.flagMatrix=Yc.bind(this),this.isShape=!0,this.matrix=new mr,this.worldMatrix=new mr,this.position=new be,this.rotation=0,this.scale=1,this.skewX=0,this.skewY=0}static fromObject(n){const r=new Er().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 as.position.get.apply(this,arguments)}set translation(n){as.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 be?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 be?n.scale:new be(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 Er;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 be?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 be?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}};S(Er,"Properties",["position","rotation","scale","skewX","skewY","matrix","worldMatrix"]);let Nn=Er;const as={position:{enumerable:!0,get:function(){return this._position},set:function(t){this._position&&this._position.unbind(ne.Types.change,this._renderer.flagMatrix),this._position=t,this._position.bind(ne.Types.change,this._renderer.flagMatrix),Yc.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 be&&this._scale.unbind(ne.Types.change,this._renderer.flagMatrix),this._scale=t,this._scale instanceof be&&this._scale.bind(ne.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 mp(this,this._worldMatrix),this._worldMatrix},set:function(t){this._worldMatrix=t}}};function Yc(){this._flagMatrix=!0}const qi=Math.min,Xi=Math.max,Vp=Math.ceil,Ip=Math.floor,Ap=new be,sn=class sn extends Nn{constructor(n,r,s,o){super();S(this,"_flagVertices",!0);S(this,"_flagLength",!0);S(this,"_flagFill",!0);S(this,"_flagStroke",!0);S(this,"_flagLinewidth",!0);S(this,"_flagOpacity",!0);S(this,"_flagVisible",!0);S(this,"_flagCap",!0);S(this,"_flagJoin",!0);S(this,"_flagMiter",!0);S(this,"_flagStrokeAttenuation",!0);S(this,"_flagMask",!1);S(this,"_flagClip",!1);S(this,"_length",0);S(this,"_fill","#fff");S(this,"_stroke","#000");S(this,"_linewidth",1);S(this,"_opacity",1);S(this,"_visible",!0);S(this,"_cap","round");S(this,"_join","round");S(this,"_miter",4);S(this,"_closed",!0);S(this,"_curved",!1);S(this,"_automatic",!0);S(this,"_beginning",0);S(this,"_ending",1);S(this,"_mask",null);S(this,"_clip",!1);S(this,"_dashes",null);S(this,"_strokeAttenuation",!0);for(let a in Uc)Object.defineProperty(this,a,Uc[a]);this._renderer.type="path",this._renderer.flagVertices=Kc.bind(this),this._renderer.bindVertices=Gc.bind(this),this._renderer.unbindVertices=Zc.bind(this),this._renderer.flagFill=Qc.bind(this),this._renderer.flagStroke=Jc.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:fi(n.fill),s=typeof n.stroke=="string"?n.stroke:fi(n.stroke),o=new sn().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 Fe?this.vertices.push(n.vertices[r].clone()):this.vertices.push(new Fe().copy(s))}}for(let r=0;r<sn.Properties.length;r++){const s=sn.Properties[r];s in n&&(this[s]=n[s])}return this}clone(n){const r=new sn;for(let s=0;s<this.vertices.length;s++)r.vertices.push(this.vertices[s].clone());for(let s=0;s<sn.Properties.length;s++){const o=sn.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()),Ie.each(sn.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,u=-1/0,h=1/0,f=-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:m}=hp(r.elements[0],r.elements[3],r.elements[1],r.elements[4],r.elements[2],r.elements[5]);typeof g=="number"&&typeof m=="number"&&(s=Math.max(g,m)*(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,m]=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[B,x]=r.multiply(b,_),N=c.controls.left.x,R=c.controls.left.y;c.relative&&(N+=c.x,R+=c.y);let[w,C]=r.multiply(N,R);const k=bp(g,m,B,x,w,C,p,y);h=qi(k.min.y-s,h),d=qi(k.min.x-s,d),u=Xi(k.max.x+s,u),f=Xi(k.max.y+s,f)}else a<=1&&(h=qi(m-s,h),d=qi(g-s,d),u=Xi(g+s,u),f=Xi(m+s,f)),h=qi(y-s,h),d=qi(p-s,d),u=Xi(p+s,u),f=Xi(y+s,f)}return{top:h,left:d,right:u,bottom:f,width:u-d,height:f-h}}getPointAt(n,r){let s,o,a,l,c,d,u,h,f,g,m,p,y,b,_,B=this.length*Math.min(Math.max(n,0),1);const x=this.vertices.length,N=x-1;let R=null,w=null;for(let D=0,H=this._lengths.length,L=0;D<H;D++){if(L+this._lengths[D]>=B){this._closed?(s=ji(D,x),o=ji(D-1,x),D===0&&(s=o,o=D)):(s=D,o=Math.min(Math.max(D-1,0),N)),R=this.vertices[s],w=this.vertices[o],B-=L,this._lengths[D]!==0?n=B/this._lengths[D]:n=0;break}L+=this._lengths[D]}if(R===null||w===null)return null;if(R){if(!w)return R}else return w;_=w.controls&&w.controls.right,b=R.controls&&R.controls.left,c=w.x,g=w.y,d=(_||w).x,m=(_||w).y,u=(b||R).x,p=(b||R).y,h=R.x,y=R.y,_&&w.relative&&(d+=w.x,m+=w.y),b&&R.relative&&(u+=R.x,p+=R.y),l=is(n,c,d,u,h),f=is(n,g,m,p,y);const C=Gt(c,d,n),k=Gt(g,m,n),T=Gt(d,u,n),$=Gt(m,p,n),P=Gt(u,h,n),E=Gt(p,y,n),W=Gt(C,T,n),A=Gt(k,$,n),Z=Gt(T,P,n),te=Gt($,E,n);return Ie.isObject(r)?(r.x=l,r.y=f,r instanceof Fe&&(r.controls.left.x=W,r.controls.left.y=A,r.controls.right.x=Z,r.controls.right.y=te,(typeof r.relative!="boolean"||r.relative)&&(r.controls.left.x-=l,r.controls.left.y-=f,r.controls.right.x-=l,r.controls.right.y-=f)),r.t=n,r):(a=new Fe(l,f,W-l,A-f,Z-l,te-f,this._curved?pe.curve:pe.line),a.t=n,a)}plot(){if(this.curved)return wp(this._collection,this.closed),this;for(let n=0;n<this._collection.length;n++)this._collection[n].command=n===0?pe.move:pe.line;return this}subdivide(n){this._update();const r=this.vertices.length-1,s=this._closed||this.vertices[r]._command===pe.close;let o=this.vertices[r],a=[],l;return Ie.each(this.vertices,function(c,d){if(d<=0&&!s){o=c;return}if(c.command===pe.move){a.push(new Fe(o.x,o.y)),d>0&&(a[a.length-1].command=pe.line),o=c;return}l=qc(c,o,n),a=a.concat(l),Ie.each(l,function(u,h){h<=0&&o.command===pe.move?u.command=pe.move:u.command=pe.line}),d>=r&&(this._closed&&this._automatic&&(o=c,l=qc(c,o,n),a=a.concat(l),Ie.each(l,function(u,h){h<=0&&o.command===pe.move?u.command=pe.move:u.command=pe.line})),a.push(new Fe(c.x,c.y)),a[a.length-1].command=s?pe.close:pe.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=[]),Ie.each(this.vertices,function(c,d){if(d<=0||c.command===pe.move){a=c,this._lengths[d]=0;return}this._lengths[d]=jc(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=os(this,s*this._length),l=os(this,o*this._length),c=Vp(a),d=Ip(l);let u,h,f,g,m,p;for(this._renderer.vertices.length=0,p=0;p<n;p++)this._renderer.collection.length<=p&&this._renderer.collection.push(new Fe),p>d&&!h?(m=this._renderer.collection[p].copy(this._collection[p]),this.getPointAt(o,m),m.command=this._renderer.collection[p].command,this._renderer.vertices.push(m),h=m,f=this._collection[p-1],f&&f.controls&&(m.relative?m.controls.right.clear():m.controls.right.copy(m),f.relative?this._renderer.collection[p-1].controls.right.copy(f.controls.right).lerp(be.zero,1-m.t):this._renderer.collection[p-1].controls.right.copy(f.controls.right).lerp(f,1-m.t))):p>=c&&p<=d&&(m=this._renderer.collection[p].copy(this._collection[p]),this._renderer.vertices.push(m),p===d&&Wc(this,o)?(h=m,!r&&h.controls&&(h.relative?h.controls.right.clear():h.controls.right.copy(h))):p===c&&Wc(this,s)&&(u=m,u.command=pe.move,!r&&u.controls&&(u.relative?u.controls.left.clear():u.controls.left.copy(u))));c>0&&!u&&(p=c-1,m=this._renderer.collection[p].copy(this._collection[p]),this.getPointAt(s,m),m.command=pe.move,this._renderer.vertices.unshift(m),g=this._collection[p+1],g&&g.controls&&(m.controls.left.clear(),g.relative?this._renderer.collection[p+1].controls.left.copy(g.controls.left).lerp(be.zero,m.t):(Ap.copy(g),this._renderer.collection[p+1].controls.left.copy(g.controls.left).lerp(g,m.t))))}return Nn.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,Nn.prototype.flagReset.call(this),this}};S(sn,"Properties",["fill","stroke","linewidth","opacity","visible","cap","join","miter","closed","curved","automatic","beginning","ending","dashes","strokeAttenuation"]),S(sn,"Utils",{getCurveLength:jc});let Ae=sn;const Uc={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 st||this._fill instanceof $t||this._fill instanceof Nt||this._fill instanceof Ke)&&this._fill.unbind(ne.Types.change,this._renderer.flagFill),this._fill=t,this._flagFill=!0,(this._fill instanceof st||this._fill instanceof $t||this._fill instanceof Nt||this._fill instanceof Ke)&&this._fill.bind(ne.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(t){(this._stroke instanceof st||this._stroke instanceof $t||this._stroke instanceof Nt||this._stroke instanceof Ke)&&this._stroke.unbind(ne.Types.change,this._renderer.flagStroke),this._stroke=t,this._flagStroke=!0,(this._stroke instanceof st||this._stroke instanceof $t||this._stroke instanceof Nt||this._stroke instanceof Ke)&&this._stroke.bind(ne.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";Ie.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(ne.Types.insert,e).unbind(ne.Types.remove,n),t instanceof ui?this._collection=t:this._collection=new ui(t||[]),this._collection.bind(ne.Types.insert,e).bind(ne.Types.remove,n),e(this._collection)}},mask:{enumerable:!0,get:function(){return this._mask},set:function(t){this._mask=t,this._flagMask=!0,Ie.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 Kc(){this._flagVertices=!0,this._flagLength=!0,this.parent&&(this.parent._flagLength=!0)}function Gc(t){let e=t.length;for(;e--;)t[e].bind(ne.Types.change,this._renderer.flagVertices);this._renderer.flagVertices()}function Zc(t){let e=t.length;for(;e--;)t[e].unbind(ne.Types.change,this._renderer.flagVertices);this._renderer.flagVertices()}function Qc(){this._flagFill=!0}function Jc(){this._flagStroke=!0}const Mp=Math.ceil,Op=Math.floor,Cn=class Cn extends Nn{constructor(n){super();S(this,"_flagVertices",!0);S(this,"_flagLength",!0);S(this,"_flagFill",!0);S(this,"_flagStroke",!0);S(this,"_flagLinewidth",!0);S(this,"_flagOpacity",!0);S(this,"_flagVisible",!0);S(this,"_flagSize",!0);S(this,"_flagSizeAttenuation",!0);S(this,"_flagStrokeAttenuation",!0);S(this,"_length",0);S(this,"_fill","#fff");S(this,"_stroke","#000");S(this,"_linewidth",1);S(this,"_opacity",1);S(this,"_visible",!0);S(this,"_size",1);S(this,"_sizeAttenuation",!1);S(this,"_beginning",0);S(this,"_ending",1);S(this,"_dashes",null);S(this,"_strokeAttenuation",!0);S(this,"noFill",Ae.prototype.noFill);S(this,"noStroke",Ae.prototype.noStroke);S(this,"corner",Ae.prototype.corner);S(this,"center",Ae.prototype.center);S(this,"getBoundingClientRect",Ae.prototype.getBoundingClientRect);S(this,"_updateLength",Ae.prototype._updateLength);for(let r in ed)Object.defineProperty(this,r,ed[r]);this._renderer.type="points",this._renderer.flagVertices=Kc.bind(this),this._renderer.bindVertices=Gc.bind(this),this._renderer.unbindVertices=Zc.bind(this),this._renderer.flagFill=Qc.bind(this),this._renderer.flagStroke=Jc.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:fi(n.fill),s=typeof n.stroke=="string"?n.stroke:fi(n.stroke),o=new Cn().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 Fe?this.vertices.push(n.vertices[r].clone()):this.vertices.push(new Fe().copy(s))}for(let r=0;r<Cn.Properties.length;r++){const s=Cn.Properties[r];s in n&&(this[s]=n[s])}return this}clone(n){const r=new Cn;for(let s=0;s<this.vertices.length;s++)r.vertices.push(this.vertices[s].clone());for(let s=0;s<Cn.Properties.length;s++){const o=Cn.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()),Ie.each(Cn.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,u=a.y,h=Vc(l,c,l,c,d,u,d,u,n);r=r.concat(h)}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=os(this,n*this._length),o=os(this,r*this._length),a=Mp(s),l=Op(o);let c=0,d;this._renderer.vertices=[],this._renderer.collection=[];for(let u=0;u<this._collection.length;u++)u>=a&&u<=l&&(d=this._collection[u],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}};S(Cn,"Properties",["fill","stroke","linewidth","opacity","visible","size","sizeAttenuation","beginning","ending","dashes","strokeAttenuation"]);let ls=Cn;const ed={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 st||this._fill instanceof $t||this._fill instanceof Nt||this._fill instanceof Ke)&&this._fill.unbind(ne.Types.change,this._renderer.flagFill),this._fill=t,this._flagFill=!0,(this._fill instanceof st||this._fill instanceof $t||this._fill instanceof Nt||this._fill instanceof Ke)&&this._fill.bind(ne.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(t){(this._stroke instanceof st||this._stroke instanceof $t||this._stroke instanceof Nt||this._stroke instanceof Ke)&&this._stroke.unbind(ne.Types.change,this._renderer.flagStroke),this._stroke=t,this._flagStroke=!0,(this._stroke instanceof st||this._stroke instanceof $t||this._stroke instanceof Nt||this._stroke instanceof Ke)&&this._stroke.bind(ne.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(ne.Types.insert,e).unbind(ne.Types.remove,n),t instanceof ui?this._collection=t:this._collection=new ui(t||[]),this._collection.bind(ne.Types.insert,e).bind(ne.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 td extends ui{constructor(n){n=Array.isArray(n)?n:Array.prototype.slice.call(arguments);super(n);qa(this,Is,{});this.attach(n),this.on(ne.Types.insert,this.attach),this.on(ne.Types.remove,this.detach)}get ids(){return Ft(this,Is)}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}}Is=new WeakMap;const Vn=class Vn extends Ae{constructor(n,r,s,o,a,l,c){const d=c||vo.Resolution*3,u=[];for(let h=0;h<d;h++)u.push(new Fe);super(u,!0,!1,!0);S(this,"_flagStartAngle",!1);S(this,"_flagEndAngle",!1);S(this,"_flagInnerRadius",!1);S(this,"_flagOuterRadius",!1);S(this,"_startAngle",0);S(this,"_endAngle",di);S(this,"_innerRadius",0);S(this,"_outerRadius",0);this._renderer.type="arc-segment";for(let h in nd)Object.defineProperty(this,h,nd[h]);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 Vn().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<Vn.Properties.length;r++){const s=Vn.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=ji(n,di)===ji(r,di),l=s>0,c=this.vertices;let d=l?c.length/2:c.length,u,h=0,f,g,m,p,y,b,_,B,x;for(a?d--:l||(d-=2),f=0,g=d-1;f<d;f++){switch(m=f/g,p=c[h],y=m*(r-n)+n,b=(r-n)/d,_=o*Math.cos(y),B=o*Math.sin(y),f){case 0:u=pe.move;break;default:u=pe.curve}p.command=u,p.x=_,p.y=B,p.controls.left.clear(),p.controls.right.clear(),p.command===pe.curve&&(x=o*b/Math.PI,p.controls.left.x=x*Math.cos(y-dt),p.controls.left.y=x*Math.sin(y-dt),p.controls.right.x=x*Math.cos(y+dt),p.controls.right.y=x*Math.sin(y+dt),f===1&&p.controls.left.multiplyScalar(2),f===g&&p.controls.right.multiplyScalar(2)),h++}if(l){for(a?(c[h].command=pe.close,h++):(d--,g=d-1),f=0;f<d;f++)m=f/g,p=c[h],y=(1-m)*(r-n)+n,b=(r-n)/d,_=s*Math.cos(y),B=s*Math.sin(y),u=pe.curve,f<=0&&(u=a?pe.move:pe.line),p.command=u,p.x=_,p.y=B,p.controls.left.clear(),p.controls.right.clear(),p.command===pe.curve&&(x=s*b/Math.PI,p.controls.left.x=x*Math.cos(y+dt),p.controls.left.y=x*Math.sin(y+dt),p.controls.right.x=x*Math.cos(y-dt),p.controls.right.y=x*Math.sin(y-dt),f===1&&p.controls.left.multiplyScalar(2),f===g&&p.controls.right.multiplyScalar(2)),h++;c[h].copy(c[0]),c[h].command=pe.line}else a||(c[h].command=pe.line,c[h].x=0,c[h].y=0,h++,c[h].copy(c[0]),c[h].command=pe.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 Vn(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<Ae.Properties.length;d++){const u=Ae.Properties[d];c[u]=this[u]}return n&&n.add(c),c}toObject(){const n=super.toObject.call(this);n.renderer.type="arc-segment";for(let r=0;r<Vn.Properties.length;r++){const s=Vn.Properties[r];n[s]=this[s]}return n}};S(Vn,"Properties",["startAngle","endAngle","innerRadius","outerRadius"]);let So=Vn;const nd={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}}},Bo=Math.cos,To=Math.sin,In=class In extends Ae{constructor(n,r,s,o){const a=o?Math.max(o,2):4,l=[];for(let c=0;c<a;c++)l.push(new Fe(0,0,0,0,0,0));super(l,!0,!0,!0);S(this,"_flagRadius",!1);S(this,"_radius",0);this._renderer.type="circle";for(let c in id)Object.defineProperty(this,c,id[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 In().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<In.Properties.length;r++){const s=In.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*di,d=s*Bo(c),u=s*To(c),h=o*Bo(c-dt),f=o*To(c-dt),g=o*Bo(c+dt),m=o*To(c+dt),p=this.vertices[a];p.command=a===0?pe.move:pe.curve,p.set(d,u),p.controls.left.set(h,f),p.controls.right.set(g,m)}}return super._update.call(this),this}flagReset(){return this._flagRadius=!1,super.flagReset.call(this),this}clone(n){const r=new In(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<Ae.Properties.length;s++){const o=Ae.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<In.Properties.length;r++){const s=In.Properties[r];n[s]=this[s]}return n}};S(In,"Properties",["radius"]);let $o=In;const id={radius:{enumerable:!0,get:function(){return this._radius},set:function(t){this._radius=t,this._flagRadius=!0}}},No=Math.cos,Ro=Math.sin,An=class An extends Ae{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 Fe);super(c,!0,!0,!0);S(this,"_flagWidth",!1);S(this,"_flagHeight",!1);S(this,"_width",0);S(this,"_height",0);this._renderer.type="ellipse";for(let d in rd)Object.defineProperty(this,d,rd[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 An().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<An.Properties.length;r++){const s=An.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*di,d=s*No(c),u=o*Ro(c),h=s*r*No(c-dt),f=o*r*Ro(c-dt),g=s*r*No(c+dt),m=o*r*Ro(c+dt),p=this.vertices[a];p.command=a===0?pe.move:pe.curve,p.set(d,u),p.controls.left.set(h,f),p.controls.right.set(g,m)}}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 An(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<Ae.Properties.length;l++){const c=Ae.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<An.Properties.length;r++){const s=An.Properties[r];n[s]=this[s]}return n}};S(An,"Properties",["width","height"]);let Po=An;const rd={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}}},zp=Math.cos,Dp=Math.sin,Mn=class Mn extends Ae{constructor(n,r,s,o){o=Math.max(o||0,3);super();S(this,"_flagWidth",!1);S(this,"_flagHeight",!1);S(this,"_flagSides",!1);S(this,"_radius",0);S(this,"_width",0);S(this,"_height",0);S(this,"_sides",0);this._renderer.type="polygon";for(let a in sd)Object.defineProperty(this,a,sd[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 Mn().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<Mn.Properties.length;r++){const s=Mn.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=di*a+Math.PI/2,c=this._width*zp(l)/2,d=this._height*Dp(l)/2;o>=s?this.vertices.push(new Fe(c,d)):this.vertices[o].set(c,d),this.vertices[o].command=o===0?pe.move:pe.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 Mn(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<Ae.Properties.length;s++){const o=Ae.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<Mn.Properties.length;r++){const s=Mn.Properties[r];n[s]=this[s]}return n}};S(Mn,"Properties",["width","height","sides"]);let Eo=Mn;const sd={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}}},Ti=class Ti extends Ae{constructor(n,r,s,o){const a=[new Fe,new Fe,new Fe,new Fe];super(a,!0,!1,!0);S(this,"_flagWidth",!1);S(this,"_flagHeight",!1);S(this,"_width",0);S(this,"_height",0);S(this,"_origin",null);this._renderer.type="rectangle";for(let l in od)Object.defineProperty(this,l,od[l]);this.width=typeof s=="number"?s:1,this.height=typeof o=="number"?o:1,this.origin=new be,typeof n=="number"&&(this.translation.x=n),typeof r=="number"&&(this.translation.y=r),this._update()}static fromObject(n){const r=new Ti().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<Ti.Properties.length;r++){const s=Ti.Properties[r];s in n&&(typeof n[s]=="number"?this[s]=n[s]:this[s]instanceof be&&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 Fe),this.vertices[0].set(-n,-r).sub(this._origin).command=pe.move,this.vertices[1].set(n,-r).sub(this._origin).command=pe.line,this.vertices[2].set(n,r).sub(this._origin).command=pe.line,this.vertices[3].set(-n,r).sub(this._origin).command=pe.line,this.vertices[4]&&(this.vertices[4].set(-n,-r).sub(this._origin).command=pe.line)}return super._update.call(this),this}flagReset(){return this._flagWidth=this._flagHeight=!1,super.flagReset.call(this),this}clone(n){const r=new Ti(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<Ae.Properties.length;s++){const o=Ae.Properties[s];r[o]instanceof be?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}};S(Ti,"Properties",["width","height","origin"]);let gr=Ti;const od={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(ne.Types.change,this._renderer.flagVertices),this._origin=t,this._origin.bind(ne.Types.change,this._renderer.flagVertices),this._renderer.flagVertices()}}},On=class On extends Ae{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 Fe(0,0,0,0,0,0,c===0?pe.move:pe.curve));super(l);S(this,"_flagWidth",!1);S(this,"_flagHeight",!1);S(this,"_flagRadius",!1);S(this,"_width",0);S(this,"_height",0);S(this,"_radius",12);this._renderer.type="rounded-rectangle";for(let c in ad)Object.defineProperty(this,c,ad[c]);this.closed=!0,this.automatic=!1,this._renderer.flagRadius=Lp.bind(this),typeof s=="number"&&(this.width=s),typeof o=="number"&&(this.height=o),(typeof a=="number"||a instanceof be)&&(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 On().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<On.Properties.length;r++){const s=On.Properties[r];if(s in n){const o=n[s];/radius/i.test(s)?this[s]=typeof o=="number"||o instanceof be?o:new be().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 be?(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 On(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<Ae.Properties.length;l++){const c=Ae.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<On.Properties.length;r++){const s=On.Properties[r];n[s]=this[s]}return n.radius=typeof this.radius=="number"?this.radius:this.radius.toObject(),n}};S(On,"Properties",["width","height","radius"]);let Fo=On;const ad={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 be&&this._radius.unbind(ne.Types.change,this._renderer.flagRadius),this._radius=t,this._radius instanceof be&&this._radius.bind(ne.Types.change,this._renderer.flagRadius),this._flagRadius=!0}}};function Lp(){this._flagRadius=!0}const Hp=Math.cos,Wp=Math.sin,zn=class zn extends Ae{constructor(n,r,s,o,a){arguments.length<=3&&(o=s,s=o/2),(typeof a!="number"||a<=0)&&(a=5);super();S(this,"_flagInnerRadius",!1);S(this,"_flagOuterRadius",!1);S(this,"_flagSides",!1);S(this,"_innerRadius",0);S(this,"_outerRadius",0);S(this,"_sides",0);this._renderer.type="star";for(let l in ld)Object.defineProperty(this,l,ld[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 zn().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<zn.Properties.length;r++){const s=zn.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=di*a,c=(o%2?this._outerRadius:this._innerRadius)/2,d=c*Hp(l),u=c*Wp(l);o>=s?this.vertices.push(new Fe(d,u)):this.vertices[o].set(d,u),this.vertices[o].command=o===0?pe.move:pe.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 zn(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<Ae.Properties.length;l++){const c=Ae.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<zn.Properties.length;r++){const s=zn.Properties[r];n[s]=this[s]}return n}};S(zn,"Properties",["innerRadius","outerRadius","sides"]);let Vo=zn;const ld={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 Io;const cd=Math.min,dd=Math.max;pn.document&&(Io=document.createElement("canvas"));const kt=class kt extends Nn{constructor(n,r,s,o){super();S(this,"_flagValue",!0);S(this,"_flagFamily",!0);S(this,"_flagSize",!0);S(this,"_flagLeading",!0);S(this,"_flagAlignment",!0);S(this,"_flagBaseline",!0);S(this,"_flagStyle",!0);S(this,"_flagWeight",!0);S(this,"_flagDecoration",!0);S(this,"_flagFill",!0);S(this,"_flagStroke",!0);S(this,"_flagLinewidth",!0);S(this,"_flagOpacity",!0);S(this,"_flagVisible",!0);S(this,"_flagMask",!1);S(this,"_flagClip",!1);S(this,"_flagDirection",!0);S(this,"_flagStrokeAttenuation",!0);S(this,"_value","");S(this,"_family","sans-serif");S(this,"_size",13);S(this,"_leading",17);S(this,"_alignment","center");S(this,"_baseline","middle");S(this,"_style","normal");S(this,"_weight",500);S(this,"_decoration","none");S(this,"_direction","ltr");S(this,"_fill","#000");S(this,"_stroke","none");S(this,"_linewidth",1);S(this,"_opacity",1);S(this,"_visible",!0);S(this,"_mask",null);S(this,"_clip",!1);S(this,"_dashes",null);S(this,"_strokeAttenuation",!0);for(let a in ud)Object.defineProperty(this,a,ud[a]);if(this._renderer.type="text",this._renderer.flagFill=jp.bind(this),this._renderer.flagStroke=qp.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,!Ie.isObject(o))return this;for(let a=0;a<kt.Properties.length;a++){const l=kt.Properties[a];l in o&&(this[l]=o[l])}}static Measure(n){if(Io){const r=Io.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*kt.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:fi(n.fill),s=typeof n.stroke=="string"?n.stroke:fi(n.stroke),o=new kt().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<kt.Properties.length;r++){const s=kt.Properties[r];s in n&&(this[s]=n[s])}return this}clone(n){const r=new kt(this.value);r.translation.copy(this.translation),r.rotation=this.rotation,r.scale=this.scale;for(let s=0;s<kt.Properties.length;s++){const o=kt.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<kt.Properties.length;r++){const s=kt.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}=kt.Measure(this),u=(this._linewidth||0)/2;switch(this.alignment){case"left":s=-u,o=c+u;break;case"right":s=-(c+u),o=u;break;default:s=-(c/2+u),o=c/2+u}switch(this.baseline){case"middle":a=-(d/2+u),l=d/2+u;break;default:a=-(d+u),l=u}const[h,f]=r.multiply(s,a),[g,m]=r.multiply(s,l),[p,y]=r.multiply(o,a),[b,_]=r.multiply(o,l);return a=cd(f,m,y,_),s=cd(h,g,p,b),o=dd(h,g,p,b),l=dd(f,m,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}};S(kt,"Ratio",.6),S(kt,"Properties",["value","family","size","leading","alignment","linewidth","style","weight","decoration","direction","baseline","opacity","visible","fill","stroke","dashes","strokeAttenuation"]);let Yi=kt;const ud={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 st||this._fill instanceof $t||this._fill instanceof Nt||this._fill instanceof Ke)&&this._fill.unbind(ne.Types.change,this._renderer.flagFill),this._fill=t,this._flagFill=!0,(this._fill instanceof st||this._fill instanceof $t||this._fill instanceof Nt||this._fill instanceof Ke)&&this._fill.bind(ne.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(t){(this._stroke instanceof st||this._stroke instanceof $t||this._stroke instanceof Nt||this._stroke instanceof Ke)&&this._stroke.unbind(ne.Types.change,this._renderer.flagStroke),this._stroke=t,this._flagStroke=!0,(this._stroke instanceof st||this._stroke instanceof $t||this._stroke instanceof Nt||this._stroke instanceof Ke)&&this._stroke.bind(ne.Types.change,this._renderer.flagStroke)}},mask:{enumerable:!0,get:function(){return this._mask},set:function(t){this._mask=t,this._flagMask=!0,Ie.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 jp(){this._flagFill=!0}function qp(){this._flagStroke=!0}const Dn=class Dn extends gr{constructor(n,r,s,o){super(r,s,0,0);S(this,"_flagTextures",!1);S(this,"_flagFrameRate",!1);S(this,"_flagIndex",!1);S(this,"_amount",1);S(this,"_duration",0);S(this,"_index",0);S(this,"_startTime",0);S(this,"_playing",!1);S(this,"_firstFrame",0);S(this,"_lastFrame",0);S(this,"_loop",!0);S(this,"_textures",null);S(this,"_frameRate",0);S(this,"_origin",null);this._renderer.type="image-sequence";for(let a in hd)Object.defineProperty(this,a,hd[a]);this._renderer.flagTextures=Xp.bind(this),this._renderer.bindTextures=Yp.bind(this),this._renderer.unbindTextures=Up.bind(this),this.noStroke(),this.noFill(),Array.isArray(n)?this.textures=n.map(fd.bind(this)):typeof n=="string"&&(this.textures=[fd(n)]),this.origin=new be,this._update(),typeof o=="number"?this.frameRate=o:this.frameRate=Dn.DefaultFrameRate,this.index=0}static fromObject(n){const r=new Dn().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<Dn.Properties.length;r++){const s=Dn.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=Ie.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 Dn(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,u;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,Ie.isNaN(this._lastFrame)&&(this._lastFrame=a-1),o=Ie.performance.now()-this._startTime,u=this._lastFrame+1,l=1e3*(u-this._firstFrame)/this._frameRate,this._loop?o=o%l:o=Math.min(o,l),d=Gt(this._firstFrame,u,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 Ke))&&(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}};S(Dn,"Properties",["textures","frameRate","index","firstFrame","lastFrame","loop"]),S(Dn,"DefaultFrameRate",30);let Ao=Dn;const hd={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(ne.Types.insert,e).unbind(ne.Types.remove,n),this._textures=new ui((t||[]).slice(0)),this._textures.bind(ne.Types.insert,e).bind(ne.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 Xp(){this._flagTextures=!0}function Yp(t){let e=t.length;for(;e--;)t[e].bind(ne.Types.change,this._renderer.flagTextures);this._renderer.flagTextures()}function Up(t){let e=t.length;for(;e--;)t[e].unbind(ne.Types.change,this._renderer.flagTextures);this._renderer.flagTextures()}function fd(t){if(t instanceof Ke)return t;if(typeof t=="string")return new Ke(t)}const $i=class $i extends gr{constructor(n,r,s,o,a,l){super(r,s,0,0);S(this,"_flagTexture",!1);S(this,"_flagColumns",!1);S(this,"_flagRows",!1);S(this,"_flagFrameRate",!1);S(this,"_flagIndex",!1);S(this,"_amount",1);S(this,"_duration",0);S(this,"_startTime",0);S(this,"_playing",!1);S(this,"_firstFrame",0);S(this,"_lastFrame",0);S(this,"_loop",!0);S(this,"_texture",null);S(this,"_columns",1);S(this,"_rows",1);S(this,"_frameRate",0);S(this,"_index",0);S(this,"_origin",null);this._renderer.type="sprite";for(let c in md)Object.defineProperty(this,c,md[c]);this.noStroke(),this.noFill(),n instanceof Ke?this.texture=n:typeof n=="string"&&(this.texture=new Ke(n)),this.origin=new be,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=Ie.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,u,h,f,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)){h=n.image.width,f=n.image.height,o=h/r,a=f/s,c=this._amount,this.width!==o&&(this.width=o),this.height!==a&&(this.height=a),this._playing&&this._frameRate>0&&(Ie.isNaN(this._lastFrame)&&(this._lastFrame=c-1),l=Ie.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),u=Gt(this._firstFrame,g,l/d),u=Math.floor(u),u!==this._index&&(this._index=u,u>=this._lastFrame-1&&this._onLastFrame&&this._onLastFrame()));const m=this._index%r,p=Math.floor(this._index/r),y=-o*m+(h-o)/2,b=-a*p+(f-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}};S($i,"Properties",["texture","columns","rows","frameRate","index","firstFrame","lastFrame","loop"]);let Mo=$i;const md={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}}},cs=Math.min,ds=Math.max,on=class on extends Nn{constructor(n){super();S(this,"_flagAdditions",!1);S(this,"_flagSubtractions",!1);S(this,"_flagOrder",!1);S(this,"_flagOpacity",!0);S(this,"_flagBeginning",!1);S(this,"_flagEnding",!1);S(this,"_flagLength",!1);S(this,"_flagMask",!1);S(this,"_fill","#fff");S(this,"_stroke","#000");S(this,"_linewidth",1);S(this,"_opacity",1);S(this,"_visible",!0);S(this,"_cap","round");S(this,"_join","round");S(this,"_miter",4);S(this,"_closed",!0);S(this,"_curved",!1);S(this,"_automatic",!0);S(this,"_beginning",0);S(this,"_ending",1);S(this,"_length",0);S(this,"_mask",null);S(this,"_strokeAttenuation",!0);for(let r in gd)Object.defineProperty(this,r,gd[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++)pd.call(this,n[r],this)}static RemoveChildren(n){for(let r=0;r<n.length;r++)pd.call(this,n[r])}static OrderChildren(n){this._flagOrder=!0}static fromObject(n){const r=new on;for(let o=0;o<on.Properties.length;o++){const a=on.Properties[o];a in n&&(/(fill|stroke)/i.test(a)?r[a]=typeof n[a]=="string"?n[a]:fi(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 So.fromObject(o);case"circle":return $o.fromObject(o);case"element":return fr.fromObject(o);case"ellipse":return Po.fromObject(o);case"group":return on.fromObject(o);case"image":return Image.fromObject(o);case"image-sequence":return Ao.fromObject(o);case"path":return Ae.fromObject(o);case"points":return ls.fromObject(o);case"polygon":return Eo.fromObject(o);case"rectangle":return gr.fromObject(o);case"rounded-rectangle":return Fo.fromObject(o);case"shape":return Nn.fromObject(o);case"sprite":return Mo.fromObject(o);case"star":return Vo.fromObject(o);case"text":return Yi.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<on.Properties.length;r++){const s=on.Properties[r];s in n&&(this[s]=n[s])}return this}clone(n){const r=new on,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,Ie.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,u=-1/0,h=1/0,f=-1/0;const g=/texture|gradient/i;s=n?this.matrix:this.worldMatrix;for(let m=0;m<this.children.length;m++){const p=this.children[m];if(!(!p.visible||g.test(p._renderer.type))&&(r=p.getBoundingClientRect(n),o=typeof r.top!="number"||Ie.isNaN(r.top)||!isFinite(r.top),a=typeof r.left!="number"||Ie.isNaN(r.left)||!isFinite(r.left),l=typeof r.right!="number"||Ie.isNaN(r.right)||!isFinite(r.right),c=typeof r.bottom!="number"||Ie.isNaN(r.bottom)||!isFinite(r.bottom),!(o||a||l||c)))if(n){const[y,b]=s.multiply(r.left,r.top),[_,B]=s.multiply(r.right,r.top),[x,N]=s.multiply(r.left,r.bottom),[R,w]=s.multiply(r.right,r.bottom);h=cs(b,B,N,w,h),d=cs(y,_,x,R,d),u=ds(y,_,x,R,u),f=ds(b,B,N,w,f)}else h=cs(r.top,h),d=cs(r.left,d),u=ds(r.right,u),f=ds(r.bottom,f)}return{top:h,left:d,right:u,bottom:f,width:u-d,height:f-h}}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,u=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):u<c?(s.beginning=0,s.ending=0):d>c&&d<c+r?(s.beginning=(d-c)/r,s.ending=1):u>c&&u<c+r?(s.beginning=0,s.ending=(u-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}};S(on,"Children",td),S(on,"Properties",["fill","stroke","linewidth","cap","join","miter","closed","curved","automatic"]);let Rn=on;const gd={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=Rn.InsertChildren.bind(this),n=Rn.RemoveChildren.bind(this),r=Rn.OrderChildren.bind(this);this._children&&(this._children.unbind(),this._children.length>0&&n(this._children)),this._children=new td(t),this._children.bind(ne.Types.insert,e),this._children.bind(ne.Types.remove,n),this._children.bind(ne.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,Ie.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 pd(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 us extends Ae{constructor(e,n,r,s){const o=[new Fe(e,n),new Fe(r,s)];super(o);for(let a in yd)Object.defineProperty(this,a,yd[a]);this.vertices[0].command=pe.move,this.vertices[1].command=pe.line,this.automatic=!1}}S(us,"Properties",["left","right"]);const yd={left:{enumerable:!0,get:function(){return this.vertices[0]},set:function(t){if(Ie.isObject(t))this.vertices.splice(0,1,t),this.vertices[0].command=pe.move;else{const e=new rs("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(Ie.isObject(t))this.vertices.splice(1,1,t),this.vertices[1].command=pe.line;else{const e=new rs("Two.Line.right argument is not an object.");console.warn(e.name,e.message)}}}};class Oo{constructor(e=0,n=0){this.x=e,this.y=n}}class bn{constructor(e=10,n=0,r="A"){S(this,"start",new Oo);S(this,"end",new Oo);this.width=e,this.angle=n,this.label=r}}const je={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 Gp(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 hs=i.markRaw({name:"ion-close",render:Gp}),Zp={class:"mr-3 flex flex-col gap-2"},Qp=["onClick"],Jp={class:"h-full p-2"},ey={},ty=i.defineComponent({...ey,__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.ref(!1),s=i.useTemplateRef("drawing-template-containers"),o=i.useTemplateRef("drawing-custom-template-containers"),a=e,l=c=>{r.value=!0,a("remove-custom-template",c,()=>{r.value=!1})};return i.onMounted(()=>{var c,d;(c=n.settings.templates)==null||c.forEach((u,h)=>{var g;const f=(g=s.value)==null?void 0:g.at(h);f&&a("init-draw-template",f,u)}),(d=n.settings.customTemplates)==null||d.forEach((u,h)=>{var g;const f=(g=o.value)==null?void 0:g.at(h);f&&a("init-draw-template",f,u)})}),i.watch(()=>[...n.settings.customTemplates],(c,d)=>{i.nextTick(()=>{c.forEach((u,h)=>{var f;if(!(d!=null&&d.includes(u))){const g=(f=o.value)==null?void 0:f.at(h);g&&a("init-draw-template",g,u)}}),d.length>c.length&&d.forEach((u,h)=>{var g;const f=(g=o.value)==null?void 0:g.at(h);f&&(f.innerHTML="",a("init-draw-template",f,u))})})},{deep:!0}),(c,d)=>{const u=hs;return i.openBlock(),i.createBlock(i.unref(z.NScrollbar),{style:{width:"auto"},trigger:"none",class:"max-h-[19rem] md:max-h-[40rem] w-auto"},{default:i.withCtx(()=>[i.createElementVNode("div",Zp,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(t.settings.allTemplates,(h,f)=>(i.openBlock(),i.createElementBlock("div",{key:`${h.id}-${f}`,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":f===t.selectTemplateIndex}]),onClick:g=>a("template:select",f)},[i.createElementVNode("div",Jp,[i.createElementVNode("div",{ref_for:!0,ref:h.isCustom&&h.id!==-1?"drawing-custom-template-containers":"drawing-template-containers",class:"kozyrek-preview h-full"},null,512)])],10,Qp)]),default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(h.label),1)]),_:2},1024),h.isCustom&&!h.isNewRec()?(i.openBlock(),i.createBlock(i.unref(z.NButton),{key:0,size:"tiny",quaternary:"",loading:r.value,disabled:r.value,circle:"",class:"!absolute right-0.5 top-0.5 !hidden group-hover:!flex",onClick:g=>l(f)},{default:i.withCtx(()=>[i.createVNode(u)]),_:1},8,["loading","disabled","onClick"])):i.createCommentVNode("",!0)]))),128))])]),_:1})}}}),bd=Wn(ty,[["__scopeId","data-v-afccb364"]]),ny={class:"flex gap-3 min-w-[20rem] relative"},iy={class:"kozyrek-preview w-fill h-[18rem] grow touch-none overflow-hidden rounded-lg bg-gray-200 p-2"},ry={ref:"drawing-container",class:"size-full"},sy={},_d=i.defineComponent({...sy,__name:"kozyrek-configurator-preview",props:{settings:{},value:{},selectTemplateIndex:{}},emits:["pointer:move","pointer:up","template:select","remove-custom-template"],setup(t,{emit:e}){const n=t,r=e,s=i.useTemplateRef("drawing-container");let o=[],a=[],l=[],c=null;const d=.75,u=i.computed(()=>n.value.configuratorParams.linesAngles.map((D,H)=>new bn(n.value.configuratorParams.linesWidths[H],D,`A-${H+1}`))),h=i.computed(()=>n.value.configuratorParams.colorSide==="bottom"),f=i.computed(()=>{var D,H;return n.value.configuratorParams.startTailType&&((D=n.settings.startTailConfigs)!=null&&D[n.value.configuratorParams.startTailType])?(H=n.settings.startTailConfigs)==null?void 0:H[n.value.configuratorParams.startTailType].points:[]}),g=i.computed(()=>{var H;const D=n.value.configuratorParams.endTailType!==void 0&&((H=n.settings.endTailConfigs)==null?void 0:H[n.value.configuratorParams.endTailType]);return!D||!D.points?[]:D.points.map((L,M)=>Array.isArray(L)?new bn(L[0],L[1],`A-${M+1}`):new bn(L.width,L.angle,`A-${M+1}`))}),m=(D,H=!1)=>{D[0].start.x=0,D[0].start.y=0;let L=0;for(let M=0;M<D.length;M++){const O=D[M],Y=D[M-1]??new bn(0,L);L+=!H||M>1?Y.angle:0;const U=(!H||M>0?O.angle:0)+L;if(D[M].end.x=O.width*Math.cos(U*Math.PI/180)+D[M].start.x,D[M].end.y=O.width*Math.sin(U*Math.PI/180)+D[M].start.y,M<D.length-1){const V=M+1;D[V].start.x=D[M].end.x,D[V].start.y=D[M].end.y}}return D},p=(D,H,L,M,O=!1)=>{let Y=m([...L,...M]);H.length>0&&(Y=[...m(H),...Y]);let U=0,V=0,j=0,q=0;Y.forEach(Te=>{U=Math.min(U,Te.start.x,Te.end.x),V=Math.min(V,Te.start.y,Te.end.y),j=Math.max(j,Te.start.x,Te.end.x),q=Math.max(q,Te.start.y,Te.end.y)});let ee,ue;U===0&&V===0&&j===0&&q===0?(ee=1,ue=1):(ee=D.width/Math.abs(j-U),ue=(O?D.height:D.height-je.colorSideLabel.size)/Math.abs(q-V));const ve=Math.min(ee,ue);return U=U<0?-U*ve:0,V=V<0?-V*ve:0,[ve,U,V]},y=D=>{const H=new ls([D]);return H._size=je.anchorPoint.size,H.fill=je.anchorPoint.color,H.stroke="transparent",H._linewidth=je.anchorPoint.strokeSize,l.push(H),H},b=(D,H)=>{if(l=[],n.settings.allowChangeFirstPoint){const L=D[0],M=new be(L.vertices[0].x,L.vertices[0].y);M.bind(ne.Types.change,()=>{L.vertices[0].copy(M)});const O=y(M);H.add(O)}D.forEach((L,M)=>{const O=D[M+1],Y=new be(L.vertices[1].x,L.vertices[1].y);Y.bind(ne.Types.change,()=>{L.vertices[1].copy(Y),O!==void 0&&O.vertices[0].copy(Y)});const U=y(Y);H.add(U)})},_=D=>D*(Math.PI/180),B=(D,H,L)=>{const M=H.vertices.length-1;D.position.x=H.vertices[M].x,D.position.y=H.vertices[M].y;const O=Math.atan2(H.vertices[M].y-H.vertices[0].y,H.vertices[M].x-H.vertices[0].x);D.rotation=_(L)+O},x=(D,H,L)=>{if(H.vertices[0]===void 0)return;D.position.x=H.vertices[0].x,D.position.y=H.vertices[0].y;const M=H.vertices.length-1,O=Math.atan2(H.vertices[M].y-H.vertices[0].y,H.vertices[M].x-H.vertices[0].x);D.rotation=_(L)+O},N=(D,H,L)=>{const M=new Rn;if(D.length===0)return M;const O=[];return[...D].reverse().forEach((Y,U)=>{U!==0&&Y.angle>0&&(Y.angle*=-1),O.push(Y)}),D=m(O,!0),x(M,H,D[0].angle),[H.vertices[0],H.vertices[1]].forEach(Y=>{Y.bind(ne.Types.change,()=>{x(M,H,D[0].angle)})}),D.forEach(Y=>{const U=Y.start.x*L,V=Y.end.x*L,j=Y.start.y*L,q=Y.end.y*L,ee=new us(U,j,V,q);ee.linewidth=je.line.size,ee.stroke=je.line.color,M.add(ee)}),M},R=(D,H,L)=>{const M=new Rn;return D.length===0||(D=m(D,!0),B(M,H,D[0].angle),[H.vertices[0],H.vertices[1]].forEach(O=>{O.bind(ne.Types.change,()=>{B(M,H,D[0].angle)})}),D.forEach(O=>{const Y=O.start.x*L,U=O.end.x*L,V=O.start.y*L,j=O.end.y*L,q=new us(Y,V,U,j);q.linewidth=je.line.size,q.stroke=je.line.color,M.add(q)})),M},w=(D,H,L,M)=>{const O=H.vertices[0].x+(H.vertices[1].x-H.vertices[0].x)/2-8*Math.sin(D.angle*Math.PI/180),Y=H.vertices[0].y+(H.vertices[1].y-H.vertices[0].y)/2-8*Math.cos(D.angle*Math.PI/180),U=new Yi(D.label,O+10,Y-10);let V;U.size=je.lineLabel.size,U.weight=600,U.fill=je.lineLabel.color,U.id+=1,U.rotation=je.lineLabel.rotation,M>0&&(V=new Yi(`${D.angle}°`,H.vertices[0].x+25,H.vertices[0].y-25),V.size=je.angleLabel.size,V.weight=600,V.fill=je.angleLabel.color,V.rotation=je.angleLabel.rotation,V.id+=M,o.push(V),L.add(V)),L.add(U),k(U,H,0,V),k(U,H,1)},C=()=>{const{size:D}=je.colorSideLabel,H=0,L=0,M=h.value?D/2:D/2-D,O=h.value?D/2-D:D/2,Y=new Rn;if(!c)return Y;const U=5,V=Math.atan2(O-M,L-H),j=[new Fe(H,M,0,0,0,0,gn.Commands.move),new Fe(L,O,0,0,0,0,gn.Commands.line),new Fe(L-U*Math.cos(V-Math.PI/4),O-U*Math.sin(V-Math.PI/4),0,0,0,0,gn.Commands.line),new Fe(L,O,0,0,0,0,gn.Commands.move),new Fe(L-U*Math.cos(V+Math.PI/4),O-U*Math.sin(V+Math.PI/4),0,0,0,0,gn.Commands.line)],q=new Ae(j,!1,!1,!0);q.noFill(),q.cap="round",q.join="round",q.linewidth=D/7,q.stroke=je.colorSideLabel.color,Y.add(q);const ee=new Yi(h.value?"Цвет снизу":"Цвет сверху",10,0);ee.size=D,ee.weight=600,ee.fill=je.colorSideLabel.color,ee.alignment="left",Y.add(ee);const ue=Y.getBoundingClientRect();return Y.position.x=(c.width-ue.width)*d+10,Y.position.y=h.value?c.height+ue.height*2:ue.height/2,Y},k=(D,H,L,M)=>{H.vertices[L].bind(ne.Types.change,()=>{const O=H.vertices.length-1,Y=Math.atan2(H.vertices[0].y-H.vertices[O].y,H.vertices[0].x-H.vertices[O].x)*180/Math.PI,U=H.vertices[0].x+(H.vertices[O].x-H.vertices[0].x)/2-8*Math.sin(Y*Math.PI/180),V=H.vertices[0].y+(H.vertices[O].y-H.vertices[0].y)/2-8*Math.cos(Y*Math.PI/180);D.position.x=U+10,D.position.y=V-10,D.rotation=-.5,M&&(M.position.x=H.vertices[0].x+25,M.position.y=H.vertices[0].y-25)})},T=(D,H,L,M,O=!1)=>{var He;if(D.clear(),L.length===0){D.update();return}const Y=m(L),[U,V,j]=p(D,H,Y,M,O),q=new Rn,ee=new Array,ue=new Array;O||(o=[],a=[]),Y.forEach((ce,mt)=>{const $e=ce.start.x*U+V,Et=ce.end.x*U+V,Wt=ce.start.y*U+j,an=ce.end.y*U+j,Ct=new us($e,Wt,Et,an);Ct.linewidth=O?je.previewLine.size:je.line.size,Ct.stroke=O?je.previewLine.color:je.line.color,a.push(Ct),ee.push(Ct),q.add(Ct),!O&&ce.label!==""&&w(ce,Ct,q,mt)});const ve=ee.at(-1);let Te=q.getBoundingClientRect();if(!O){const ce=C();ue.push(ce)}if(H.length>0){const ce=N(H,ee[0],U);q.add(ce)}if(M.length>0&&ve){const ce=R(M,ve,U);q.add(ce)}if(ue.push(q),D.makeGroup(ue),Te=q.getBoundingClientRect(),q.position.x=0-Te.left+(D.width-Te.width)/(2*(O?1:d)),q.position.y=0-Te.top+(D.height-Te.height)/(2*(O?1:d)),D.update(),!O){const ce=((He=n.value.configuratorParams)==null?void 0:He.colorSide)==="top";q.position.y=q.position.y+je.colorSideLabel.size*Number(ce),b(ee,q),D.update()}},$=(D,H)=>{if(D&&!H.isNewRec()){const L=new gn({width:D.scrollWidth,height:D.scrollHeight});L.appendTo(D),T(L,[],H.points,[],!0)}},P=()=>{c&&T(c,f.value,u.value,g.value,!1)},E=D=>D*(180/Math.PI),W=(D,H)=>{const L=D[1].x-D[0].x,M=D[1].y-D[0].y,O=H[1].x-H[0].x,Y=H[1].y-H[0].y;let U=Math.atan2(L*Y-M*O,L*O+M*Y);return U=E(U),Math.round(U)*-1},A=D=>{const H=a.map((L,M,O)=>{const Y=O[M-1]??{vertices:[{x:-10,y:0},{x:0,y:0}]};let U=Math.ceil(L._length/D/n.settings.lineWidthStep)*n.settings.lineWidthStep;const V=o[M-1];U<(O.length>1?n.settings.minLineWidth:n.settings.stripMinWidth)&&(U=O.length>1?n.settings.minLineWidth:n.settings.stripMinWidth),U>n.settings.maxLineWidth&&(U=n.settings.maxLineWidth);const j=W(L.vertices,Y.vertices);return V&&(V.value=`${j}°`),new bn(U,j,`A-${M+1}`)});r("pointer:move",H)},Z=D=>{let H=null,L;const M=V=>{H=l.find(j=>{const q=j.renderer;return(q==null?void 0:q.elem)===V.target}),[L]=p(D,f.value,u.value.map(j=>j),g.value)},O=V=>{if(H){const j=H.renderer,q=j==null?void 0:j.elem;if(!q)return;const ee=q.getBoundingClientRect();H.vertices[0].x-=ee.x-(V instanceof MouseEvent?V.clientX:V.targetTouches[0].clientX)+je.anchorPoint.size/2,H.vertices[0].y-=ee.y-(V instanceof MouseEvent?V.clientY:V.targetTouches[0].clientY)+je.anchorPoint.size/2,A(L),D.update()}},Y=()=>{H&&r("pointer:up",u.value),H=null},U=s.value;U&&(U.addEventListener("touchstart",M,{passive:!0}),U.addEventListener("touchend",Y,{passive:!0}),U.addEventListener("mousedown",M),U.addEventListener("mouseup",Y),U.addEventListener("mousemove",O),U.addEventListener("touchmove",O,{passive:!0}))},te=(D,H)=>{r("remove-custom-template",D,H)};return i.onMounted(()=>{s.value&&(c=new gn({width:s.value.scrollWidth,height:s.value.scrollHeight,fullscreen:!1}).appendTo(s.value),c.scene.scale=d,c.update(),i.watch(()=>n.value,()=>{P()},{deep:!0,immediate:!0}),Z(c))}),i.onBeforeUnmount(()=>{c&&(c.clear(),c=null)}),(D,H)=>(i.openBlock(),i.createElementBlock("div",ny,[i.createVNode(bd,{"select-template-index":t.selectTemplateIndex,settings:t.settings,"onTemplate:select":H[0]||(H[0]=L=>r("template:select",L)),onInitDrawTemplate:$,onRemoveCustomTemplate:te},null,8,["select-template-index","settings"]),i.createElementVNode("div",iy,[i.createElementVNode("div",ry,null,512)])]))}});class Ui extends K.Identity{constructor(n,r){super();S(this,"label","");S(this,"points",[]);S(this,"isCustom",!1);S(this,"id",-1);S(this,"guid","");n?(this.label=n.label,this.points=n.points.map((s,o)=>I.isArray(s)?new bn(s[0],s[1],`A-${o+1}`):new bn(s.width,s.angle,`A-${o+1}`)),this.isCustom=n.isCustom):(this.label="-- Новая конфигурация --",this.points=[new bn(0,0,"A-1")],this.isCustom=!0,this.id=r??this.id)}}class zo extends Ui{constructor(n){super(n);S(this,"isDefault");this.isDefault=n.isDefault??!1}}class wd{constructor(e){S(this,"minLineWidth");S(this,"maxLineWidth");S(this,"lineWidthStep");S(this,"minLineAngle");S(this,"maxLineAngle");S(this,"lineAngleStep");S(this,"stripMinWidth");S(this,"stripMaxWidth");S(this,"stripMinLength");S(this,"stripMaxLength");S(this,"allowShowTable");S(this,"showOnlyTemplates");S(this,"templates");S(this,"customTemplates",[]);S(this,"startTailConfigs");S(this,"endTailConfigs");S(this,"bendCountForExtended");S(this,"extendedProductCatalog");S(this,"allowChangeFirstPoint");S(this,"allowSaveTemplates");S(this,"userTemplatesPrefix");S(this,"lengthStep");S(this,"canSetDopProdaga");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 Ui(s)),this.templates.forEach((s,o)=>{s.id=o}),this.startTailConfigs=((n=e.startTailConfigs)==null?void 0:n.map(s=>new zo(s)))??[],this.endTailConfigs=((r=e.endTailConfigs)==null?void 0:r.map(s=>new zo(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.canSetDopProdaga=e.canSetDopProdaga,this.showOnlyTemplates||(this.customTemplates=e.customTemplates?Object.entries(e.customTemplates).filter(([,s])=>s.id!==-1).map(([s,o])=>{const a=new Ui(o);return a.isCustom=!0,a.id=+s,a}):[],this.customTemplates.some(s=>s.isCustom&&s.isNewRec())||this.customTemplates.push(new Ui({label:"-- Новая конфигурация --",points:[new bn(this.stripMinWidth,0,"A-1")],isCustom:!0,id:-1,guid:""})))}get allTemplates(){return[...this.templates,...this.customTemplates]}addCustomTemplate(e){if(!this.allowSaveTemplates)return;const n=this.customTemplates.findLast(s=>!s.isNewRec()),r=new Ui(e);r.isCustom=!0,r.id=n?n.id+1:0,this.customTemplates.splice(-1,0,r)}removeCustomTemplate(e){if(!this.allowSaveTemplates)return;const n=this.customTemplates.findIndex(r=>r.id===e);n!==-1&&this.customTemplates.splice(n,1)}}const oy={class:"flex flex-col gap-3"},ay={class:"grid gap-5 md:grid-cols-5"},ly={},xd=i.defineComponent({...ly,__name:"kozyrek-configurator",props:{eventEmitter:{},showSlugs:{type:Boolean},showProperties:{type:Boolean},showProductCosts:{type:[Boolean,Function]},allowNameClick:{type:[Boolean,Function]},allowPriceClick:{type:[Boolean,Function]},showPriceHistory:{type:[Boolean,Function]},showCostDate:{type:[Boolean,Function]},isProductItemSelected:{type:Function},showProductAddToCartButton:{type:[Boolean,String,Function]},showProductRequiredButton:{type:[Boolean,String,Function]},showProductEditButton:{type:[Boolean,String,Function]},currencyRates:{},productContextButtonsConfig:{type:Function},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(new wd(n.settings)),d=i.ref({linesWidths:[...n.cartItem.configuratorParams.linesWidths],linesAngles:[...n.cartItem.configuratorParams.linesAngles]}),u=i.ref({quantity:{},marker:{},length:{}}),h=i.ref(0),f=i.useTemplateRef("kozyrek-configurator-params-form"),g=(k=0)=>{var $;const T=($=c.value.allTemplates)==null?void 0:$.at(k);T!==void 0&&(h.value=k,l.value.configuratorParams.linesWidths=T.points.map(P=>I.isArray(P)?P[0]:P.width),l.value.configuratorParams.linesAngles=T.points.map(P=>I.isArray(P)?P[1]:P.angle),B()),b(l.value.configuratorParams)},m=async()=>{const k=prompt("Введите название шаблона:");if(!k)return;a.value=!0;const T={label:k,points:l.value.configuratorParams.linesWidths.map((P,E)=>[P,l.value.configuratorParams.linesAngles[E]])},$=P=>{P&&(c.value.addCustomTemplate(T),h.value=c.value.allTemplates.length-2),a.value=!1};n.eventEmitter.emit("configurator:create-template",{category:n.cartItem.category,template:T,callback:$})},p=async(k,T)=>{var E;const $=(E=c.value.allTemplates)==null?void 0:E.at(k);if(!$||!$.isCustom)return;const P=W=>{W&&(c.value.removeCustomTemplate($.id),g()),T==null||T()};n.eventEmitter.emit("configurator:remove-template",{category:n.cartItem.category,templateId:$.id,callback:P})},y=()=>{c.value.showOnlyTemplates||c.value.allowSaveTemplates&&(h.value=c.value.allTemplates.length-1)},b=async k=>{var T,$;l.value.product=new K.ClientProduct,($=(T=f.value)==null?void 0:T.formReference)==null||$.validate(P=>{P||(B(),s.value=!0,n.eventEmitter.emit("configurator:search-product",{category:n.cartItem.category,params:k,validationFieldResultData:u.value,callback:E=>{E?l.value.product=E:u.value.product={showFeedback:!0,feedback:"Не удалось найти товар по указанным параметрам.",validationStatus:"error"},s.value=!1}}))}).catch(I.noop)},_=async()=>{var k,T;(T=(k=f.value)==null?void 0:k.formReference)==null||T.validate($=>{$||(o.value=!0,r("submit",l.value,u.value,()=>{o.value=!1,i.nextTick(()=>{var P,E;(E=(P=f.value)==null?void 0:P.formReference)==null||E.restoreValidation()})}))}).catch(I.noop)},B=()=>{const k={quantity:u.value.quantity,marker:u.value.marker};l.value.configuratorParams.linesWidths.forEach((T,$)=>{k[`lines_widths[${$+1}]`]={},k[`lines_angles[${$+1}]`]={}}),u.value=k},x=k=>{d.value.linesWidths=k.map(T=>T.width),d.value.linesAngles=k.map(T=>T.angle)},N=k=>{l.value.configuratorParams.linesWidths=d.value.linesWidths,l.value.configuratorParams.linesAngles=d.value.linesAngles,B(),y(),b(l.value.configuratorParams)},R=(k,T)=>{d.value.linesWidths=k,d.value.linesAngles=T},w=k=>{const T=l.value.configuratorParams.linesWidths.length>1?c.value.minLineWidth:c.value.stripMinWidth,$=0;l.value.configuratorParams.linesWidths.splice(k+1,0,T),l.value.configuratorParams.linesAngles.splice(k+1,0,$),d.value.linesWidths=[...l.value.configuratorParams.linesWidths],d.value.linesAngles=[...l.value.configuratorParams.linesAngles],B(),y(),b(l.value.configuratorParams)},C=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(),y(),b(l.value.configuratorParams))};return i.onBeforeMount(()=>{g()}),i.watch(()=>n.cartItem,k=>{l.value=new K.OrderItemBase(k),g()}),(k,T)=>{const $=z.NButton;return i.openBlock(),i.createElementBlock("div",oy,[t.settings.allowShowTable?(i.openBlock(),i.createBlock($,{key:0,type:"tertiary",class:"self-end",onClick:T[0]||(T[0]=P=>r("click:view-switch"))},{default:i.withCtx(()=>[...T[3]||(T[3]=[i.createTextVNode(" Показать в виде списка ",-1)])]),_:1})):i.createCommentVNode("",!0),i.createElementVNode("div",ay,[i.createVNode(_d,{value:l.value,"select-template-index":h.value,settings:c.value,class:"h-fit col-span-3","onPointer:up":N,"onPointer:move":x,"onTemplate:select":g,onRemoveCustomTemplate:p},null,8,["value","select-template-index","settings"]),i.createVNode(sl,{ref:"kozyrek-configurator-params-form",value:l.value,"onUpdate:value":T[1]||(T[1]=P=>l.value=P),"preview-params":d.value,validation:u.value,settings:c.value,"is-submit-processing":o.value,"is-product-searching":s.value,"select-template-index":h.value,class:"col-span-2","onUpdate:params":T[2]||(T[2]=P=>b(P)),"onUpdate:preview":R,onSubmit:_,"onClick:saveTemplate":m,"onClick:addLine":w,"onClick:removeLine":C},null,8,["value","preview-params","validation","settings","is-submit-processing","is-product-searching","select-template-index"])])])}}}),cy={class:"flex flex-col items-center justify-between rounded-xl"},dy={class:"img-preview relative flex justify-center"},uy={},hy=i.defineComponent({...uy,__name:"mosquito-configurator-preview",props:{configuratorParams:{},settings:{}},emits:["open-instructions"],setup(t,{emit:e}){const n=t,r=i.computed(()=>{const{height:o}=n.configuratorParams,a=I.keys(n.settings.crossbarCount).reverse().find(l=>{const c=n.settings.crossbarCount[Number(l)];return o>=c});if(a!==void 0)return String(Number(a)+1)}),s=e;return(o,a)=>{const l=z.NButton;return i.openBlock(),i.createElementBlock("div",cy,[i.createElementVNode("div",dy,[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})])}}}),Do=Wn(hy,[["__scopeId","data-v-a67fd61e"]]),fy={key:0,class:"flex items-baseline gap-1"},my={key:0,class:"flex items-baseline gap-1"},gy={key:1},py={class:"text-lg font-semibold"},yy={key:2,class:"text-red-500 text-sm mb-2"},by={class:"flex gap-3"},_y={},kd=i.defineComponent({..._y,__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,{expose:e,emit:n}){var w;const r=t,s=n,o=i.computed(()=>St.isPhoneDevice()),a=i.useTemplateRef("form-reference"),l=i.useTemplateRef("width-form-item-reference"),c=i.useTemplateRef("height-form-item-reference"),d=i.useTemplateRef("width-input-reference"),u=i.ref(I.cloneDeep(r.value)),h=i.computed(()=>r.settings.widthOverlaps[u.value.configuratorParams.mountType]??0),f=i.computed(()=>r.settings.heightOverlaps[u.value.configuratorParams.mountType]??0),g=i.computed(()=>r.settings.maxWidths[u.value.configuratorParams.netType]),m=i.computed(()=>r.settings.maxHeights[u.value.configuratorParams.netType]),p=i.computed(()=>u.value.configuratorParams.width?u.value.configuratorParams.width+h.value:0),y=i.computed(()=>u.value.configuratorParams.height?u.value.configuratorParams.height+f.value:0),b=i.ref(r.settings.canSetDopProdaga??!1),_=i.computed(()=>({"configuratorParams.width":[ae.required,ae.min(r.settings.minWidth-h.value),ae.max(g.value-h.value),ae.step(1),We.serverValidation(r.validation.width.feedback)],"configuratorParams.height":[ae.required,ae.min(r.settings.minHeight-f.value),ae.max(m.value-f.value),ae.step(1),We.serverValidation(r.validation.height.feedback)],quantity:[ae.required,ae.min(1),ae.step(1),We.serverValidation(r.validation.quantity.feedback)],marker:[We.serverValidation(r.validation.marker.feedback)]})),B=i.computed(()=>{var E;const C=p.value,k=y.value,{quantity:T}=r.value,$=((E=r.value.product)==null?void 0:E.costRub)||0;if(!C||!k||!T||$===0)return null;const P=C*k/1e6;return($*T*P).toLocaleString("ru-ru",{minimumFractionDigits:2})}),x=i.computed(()=>{const C=p.value,k=y.value,T=!!(C&&C>=r.settings.minWidth&&C<=r.settings.maxWidths[u.value.configuratorParams.netType]),$=!!(k&&k>=r.settings.minHeight&&k<=r.settings.maxHeights[u.value.configuratorParams.netType]),P=!!(r.value.quantity&&r.value.quantity>0);return T&&$&&P}),N=(C,k)=>{var P,E;const T=u.value.configuratorParams;C&&C in T&&(T[C]=k);const $={...T,width:p.value??0,height:y.value??0};C==="width"&&((P=l.value)==null||P.validate().catch(I.noop)),C==="height"&&((E=c.value)==null||E.validate().catch(I.noop)),i.nextTick(()=>{var A,Z;!((A=l.value)!=null&&A.validationErrored)&&!((Z=c.value)!=null&&Z.validationErrored)&&$.height&&$.width&&s("update:params",$),R("configuratorParams",$)})},R=(C,k)=>{const T=new K.OrderItemBase(r.value);T[C]=k,C==="configuratorParams"&&(T.product=new K.ClientProduct),s("update:value",T)};return i.watch(()=>r.value,C=>{const k=I.cloneDeep(i.toRaw(C)),T=k.configuratorParams.mountType,$=r.settings.widthOverlaps[T]??0,P=r.settings.heightOverlaps[T]??0;k.configuratorParams.width&&k.configuratorParams.width>0&&(k.configuratorParams.width-=$),k.configuratorParams.height&&k.configuratorParams.height>0&&(k.configuratorParams.height-=P),u.value=k},{deep:!0}),i.onMounted(()=>{var C;(C=d.value)==null||C.select()}),e({validate:(w=a.value)==null?void 0:w.validate,formReference:a}),(C,k)=>{const T=z.NCheckbox;return i.openBlock(),i.createBlock(i.unref(z.NForm),{ref:"form-reference",model:u.value,rules:_.value,class:"flex flex-col gap-2 px-4 md:max-w-96 sc-hide-empty-feedback-message",onKeydown:k[25]||(k[25]=i.withKeys(i.withModifiers($=>s("submit",u.value),["prevent"]),["enter"]))},{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:u.value.configuratorParams.netType,"onUpdate:value":[k[0]||(k[0]=$=>u.value.configuratorParams.netType=$),k[1]||(k[1]=$=>N("netType",$))],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:u.value.configuratorParams.color,"onUpdate:value":[k[2]||(k[2]=$=>u.value.configuratorParams.color=$),k[3]||(k[3]=$=>N("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:u.value.configuratorParams.mountType,"onUpdate:value":[k[4]||(k[4]=$=>u.value.configuratorParams.mountType=$),k[5]||(k[5]=$=>N("mountType",$))],options:t.settings.mountType.map($=>({label:t.settings.descriptions.mount_type[$],value:$}))},null,8,["value","options"])]),_:1}),i.createVNode(i.unref(z.NFormItem),{ref:"width-form-item-reference",path:"configuratorParams.width",label:`Ширина светового проёма от ${t.settings.minWidth-h.value} ${g.value?" до "+(g.value-h.value):""} мм.`},{feedback:i.withCtx(()=>[!t.validation.width.showFeedback&&p.value>=t.settings.minWidth&&p.value<=t.settings.maxWidths[u.value.configuratorParams.netType]?(i.openBlock(),i.createElementBlock("div",fy,[i.createVNode(i.unref(z.NText),{type:"success"},{default:i.withCtx(()=>[i.createTextVNode("Ширина готового изделия "+i.toDisplayString(p.value),1)]),_:1}),i.createVNode(i.unref(z.NButton),{quaternary:"",type:"info",size:"tiny",onClick:k[10]||(k[10]=$=>s("click:instructions-toggle"))},{default:i.withCtx(()=>[...k[26]||(k[26]=[i.createElementVNode("span",{class:"text-sm"},"Руководство",-1)])]),_:1})])):i.createCommentVNode("",!0)]),default:i.withCtx(()=>[i.createVNode(i.unref(z.NInputNumber),{ref:"width-input-reference",value:u.value.configuratorParams.width,"onUpdate:value":[k[6]||(k[6]=$=>u.value.configuratorParams.width=$),k[9]||(k[9]=$=>N("width",$))],parse:i.unref(lt),"show-button":!1,placeholder:"Введите высоту светового проёма",class:"w-full",onKeydown:k[7]||(k[7]=$=>i.unref(tt)($)),onInput:k[8]||(k[8]=$=>i.unref(et)(t.validation,"width")),onFocus:i.unref(Le)},null,8,["value","parse","onFocus"])]),_:1},8,["label"]),i.createVNode(i.unref(z.NFormItem),{ref:"height-form-item-reference",path:"configuratorParams.height",label:`Высота светового проёма от ${t.settings.minHeight-f.value} ${m.value?" до "+(m.value-f.value):""} мм.`},{feedback:i.withCtx(()=>[!t.validation.height.showFeedback&&y.value>=t.settings.minHeight&&y.value<=t.settings.maxHeights[u.value.configuratorParams.netType]?(i.openBlock(),i.createElementBlock("div",my,[i.createVNode(i.unref(z.NText),{type:"success"},{default:i.withCtx(()=>[i.createTextVNode("Высота готового изделия "+i.toDisplayString(y.value),1)]),_:1}),i.createVNode(i.unref(z.NButton),{quaternary:"",type:"info",size:"tiny",onClick:k[15]||(k[15]=$=>s("click:instructions-toggle"))},{default:i.withCtx(()=>[...k[27]||(k[27]=[i.createElementVNode("span",{class:"text-sm"},"Руководство",-1)])]),_:1})])):i.createCommentVNode("",!0)]),default:i.withCtx(()=>[i.createVNode(i.unref(z.NInputNumber),{value:u.value.configuratorParams.height,"onUpdate:value":[k[11]||(k[11]=$=>u.value.configuratorParams.height=$),k[14]||(k[14]=$=>N("height",$))],parse:i.unref(lt),"show-button":!1,placeholder:"Введите высоту светового проёма",class:"w-full",onKeydown:k[12]||(k[12]=$=>i.unref(tt)($)),onInput:k[13]||(k[13]=$=>i.unref(et)(t.validation,"height")),onFocus:i.unref(Le)},null,8,["value","parse","onFocus"])]),_:1},8,["label"]),i.createVNode(i.unref(z.NFormItem),{path:"quantity",label:"Количество"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInputNumber),{value:u.value.quantity,"onUpdate:value":[k[16]||(k[16]=$=>u.value.quantity=$),k[19]||(k[19]=$=>R("quantity",$??0))],"show-button":!1,placeholder:"Введите количество",class:"w-full",onKeydown:k[17]||(k[17]=$=>i.unref(tt)($,!1)),onInput:k[18]||(k[18]=$=>i.unref(et)(t.validation,"quantity")),onFocus:i.unref(Le)},null,8,["value","onFocus"])]),_:1}),i.createVNode(i.unref(z.NFormItem),{path:"marker",label:"Маркировка"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInput),{value:u.value.marker??null,placeholder:"Введите маркировку",onInput:k[20]||(k[20]=$=>i.unref(et)(t.validation,"marker")),"onUpdate:value":k[21]||(k[21]=$=>{u.value.marker=$??null,R("marker",$??null)}),onFocus:i.unref(Le)},null,8,["value","onFocus"])]),_:1}),b.value?(i.openBlock(),i.createBlock(T,{key:0,checked:u.value.isAdditionalSale??!1,"true-value":!0,"false-value":!1,"onUpdate:checked":k[22]||(k[22]=$=>{u.value.isAdditionalSale=$??!1,R("isAdditionalSale",$??!1)})},{default:i.withCtx(()=>[...k[28]||(k[28]=[i.createTextVNode(" ДопПродажа ",-1)])]),_:1},8,["checked"])):i.createCommentVNode("",!0),i.createVNode(cr,{"is-product-searching":t.isProductSearching,product:u.value.product,validation:t.validation.product},null,8,["is-product-searching","product","validation"]),B.value?(i.openBlock(),i.createElementBlock("div",gy,[k[29]||(k[29]=i.createTextVNode(" ИТОГО: ",-1)),i.createElementVNode("span",py,i.toDisplayString(B.value)+" ₽",1)])):i.createCommentVNode("",!0),x.value?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("div",yy," Пожалуйста, заполните все обязательные поля корректно. ")),i.createElementVNode("div",by,[i.createVNode(i.unref(z.NButton),{loading:t.isSubmitProcessing,disabled:!x.value||u.value.product.isNewRec(),type:"primary",class:"self-start",onClick:k[23]||(k[23]=$=>s("submit",t.value))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(t.value.isNewRec()?"В корзину":"Изменить"),1)]),_:1},8,["loading","disabled"]),o.value?(i.openBlock(),i.createBlock(i.unref(z.NButton),{key:0,type:"default",onClick:k[24]||(k[24]=$=>s("click:show-preview-drawer"))},{default:i.withCtx(()=>[...k[30]||(k[30]=[i.createTextVNode(" Предварительный просмотр ",-1)])]),_:1})):i.createCommentVNode("",!0)])]),_:1},8,["model","rules"])}}}),wy="/img/configurators/mosquitto/measurement-instructions/measurement-height.png",xy="/img/configurators/mosquitto/measurement-instructions/measurement-width.png",ky="/img/configurators/mosquitto/measurement-instructions/mount.png",vy="/img/configurators/mosquitto/measurement-instructions/mount-z-plastic.png",Cy="/img/configurators/mosquitto/measurement-instructions/mount-z-metal.png",Sy={class:"flex flex-col gap-6"},By={class:"flex gap-4"},Ty={class:"flex flex-col gap-2"},$y={class:"flex gap-4"},Ny={class:"flex flex-col gap-2"},Ry={class:"flex gap-4"},Py={class:"flex flex-col gap-2"},Ey={},vd=i.defineComponent({...Ey,__name:"mosquito-configurator-measurement-instructions",props:{heightOverlaps:{},widthOverlaps:{},show:{type:Boolean}},emits:["update:show"],setup(t,{emit:e}){const n=St.initRefDependingOnDeviceResolution("small","small","medium"),r=St.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",Sy,[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:wy,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:xy,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",By,[l[9]||(l[9]=i.createElementVNode("img",{src:ky,alt:"measurement-height",class:"w-[7.5rem]"},null,-1)),i.createElementVNode("div",Ty,[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",$y,[l[15]||(l[15]=i.createElementVNode("img",{src:vy,alt:"measurement-height",class:"w-[7.5rem]"},null,-1)),i.createElementVNode("div",Ny,[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",Ry,[l[21]||(l[21]=i.createElementVNode("img",{src:Cy,alt:"measurement-height",class:"w-[7.5rem]"},null,-1)),i.createElementVNode("div",Py,[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"])}}}),Fy={class:"grid md:grid-cols-2"},Vy={},Cd=i.defineComponent({...Vy,__name:"mosquito-configurator",props:{eventEmitter:{},showSlugs:{type:Boolean},showProperties:{type:Boolean},showProductCosts:{type:[Boolean,Function]},allowNameClick:{type:[Boolean,Function]},allowPriceClick:{type:[Boolean,Function]},showPriceHistory:{type:[Boolean,Function]},showCostDate:{type:[Boolean,Function]},isProductItemSelected:{type:Function},showProductAddToCartButton:{type:[Boolean,String,Function]},showProductRequiredButton:{type:[Boolean,String,Function]},showProductEditButton:{type:[Boolean,String,Function]},currencyRates:{},productContextButtonsConfig:{type:Function},settings:{},cartItem:{}},emits:["submit","click:view-switch"],setup(t,{emit:e}){const n=t,r=e,s=i.computed(()=>St.isPhoneDevice()),o=i.ref(!1),a=i.ref(!1),l=i.ref(n.cartItem),c=i.useTemplateRef("mosquito-configurator-form"),d=i.ref({width:{},height:{},quantity:{},marker:{}}),u=i.ref(!1),h=i.ref(!1),f=i.computed(()=>i.inject("debounce-input-time",300)),g=I.debounce(async p=>{var y,b;l.value.product=new K.ClientProduct,(b=(y=c.value)==null?void 0:y.formReference)==null||b.validate(_=>{_||(u.value=!0,n.eventEmitter.emit("configurator:search-product",{category:n.cartItem.category,params:p,validationFieldResultData:d.value,callback:B=>{B?l.value.product=B:d.value.product={showFeedback:!0,feedback:"Не удалось найти товар по указанным параметрам.",validationStatus:"error"},u.value=!1}}))}).catch(I.noop)},f.value),m=()=>{h.value=!0,r("submit",l.value,d.value,()=>{h.value=!1})};return i.watch(()=>n.cartItem,p=>{l.value=p},{deep:!0}),(p,y)=>{const b=hs;return i.openBlock(),i.createElementBlock(i.Fragment,null,[i.createVNode(vd,{show:a.value,"onUpdate:show":y[0]||(y[0]=_=>a.value=_),"height-overlaps":t.settings.heightOverlaps,"width-overlaps":t.settings.widthOverlaps},null,8,["show","height-overlaps","width-overlaps"]),i.createElementVNode("div",Fy,[s.value?(i.openBlock(),i.createBlock(i.unref(z.NDrawer),{key:1,show:o.value,"onUpdate:show":y[4]||(y[4]=_=>o.value=_),"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:y[2]||(y[2]=_=>o.value=!1)},{default:i.withCtx(()=>[i.createVNode(b)]),_:1})]),default:i.withCtx(()=>[i.createVNode(Do,{"configurator-params":l.value.configuratorParams,settings:t.settings,onOpenInstructions:y[3]||(y[3]=_=>a.value=!0)},null,8,["configurator-params","settings"])]),_:1})]),_:1},8,["show"])):(i.openBlock(),i.createBlock(Do,{key:0,"configurator-params":l.value.configuratorParams,settings:t.settings,onOpenInstructions:y[1]||(y[1]=_=>a.value=!0)},null,8,["configurator-params","settings"])),i.createVNode(kd,{ref:"mosquito-configurator-form",value:l.value,"onUpdate:value":y[5]||(y[5]=_=>l.value=_),validation:d.value,settings:t.settings,"is-product-searching":u.value,"is-submit-processing":h.value,"onUpdate:params":y[6]||(y[6]=_=>i.unref(g)(_)),onSubmit:y[7]||(y[7]=_=>m()),"onClick:instructionsToggle":y[8]||(y[8]=_=>a.value=!a.value),"onClick:showPreviewDrawer":y[9]||(y[9]=_=>o.value=!0)},null,8,["value","validation","settings","is-product-searching","is-submit-processing"])])],64)}}}),Iy={},Sd=i.defineComponent({...Iy,__name:"strip-configurator-line-item",props:{value:{},index:{},path:{},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:{}},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=i.ref(r.value),c=i.useTemplateRef("form-item-reference"),d=i.computed(()=>{var f;return!((f=c.value)!=null&&f.validationErrored)}),u=f=>{l.value=f,s("update:value",f,r.index,a)},h=()=>{var f;(f=o.value)==null||f.select()};return i.watch(()=>r.value,f=>{l.value=f}),i.onMounted(()=>{r.autoFocus&&i.nextTick(()=>{h()})}),e({isValid:d,formItemReference:c}),(f,g)=>{const m=rl,p=zr;return i.openBlock(),i.createBlock(i.unref(z.NFormItem),{ref:"form-item-reference",path:t.path,label:`Полоса №${t.index+1}, мм`,class:"sc-hide-empty-feedback-message"},{feedback:i.withCtx(()=>[d.value?(i.openBlock(),i.createBlock(cr,{key:0,"is-product-searching":a.value,product:t.product,validation:t.validation.product},null,8,["is-product-searching","product","validation"])):i.createCommentVNode("",!0)]),default:i.withCtx(()=>[i.createVNode(i.unref(z.NDropdown),{trigger:"click",options:t.suggestionOption,placement:"bottom-start",size:"large",onSelect:u},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInputNumber),{ref:"width-input-element",value:l.value??null,class:"w-full","show-button":!1,parse:i.unref(lt),placeholder:"Введите ширину",onKeydown:g[0]||(g[0]=y=>i.unref(tt)(y)),onInput:g[1]||(g[1]=y=>i.unref(et)(t.validation,`linesWidths.${t.index}`)),onFocus:i.unref(Le),"onUpdate:value":u},null,8,["value","parse","onFocus"])]),_:1},8,["options"]),i.createVNode(i.unref(z.NButton),{disabled:t.addLineButtonDisabled,size:"medium",class:"ml-2",onClick:g[2]||(g[2]=y=>s("click:add-line",t.index))},{default:i.withCtx(()=>[i.createVNode(m)]),_:1},8,["disabled"]),i.createVNode(i.unref(z.NButton),{disabled:t.removeLineButtonDisabled,size:"medium",class:"ml-2",onClick:g[3]||(g[3]=y=>s("click:remove-line",t.index))},{default:i.withCtx(()=>[i.createVNode(p)]),_:1},8,["disabled"])]),_:1},8,["path","label"])}}}),Ay={class:"my-2 flex w-full flex-col"},My={key:1},Oy={class:"text-lg font-semibold"},zy={class:"flex gap-3"},Dy={},Bd=i.defineComponent({...Dy,__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,{expose:e,emit:n}){var _;const r=t,s=n,o=i.useTemplateRef("form-reference"),a=i.useTemplateRef("line-items-reference"),l=i.ref(I.cloneDeep(r.value)),c=i.computed(()=>{const B={length:[ae.required,ae.min(r.settings.minLength),ae.max(r.settings.maxLength),ae.step(r.settings.lengthStep),We.serverValidation(r.validation.length.feedback)],quantity:[ae.required,ae.min(1),We.serverValidation(r.validation.quantity.feedback)],marker:[We.serverValidation(r.validation.marker.feedback)]};return I.forEach(l.value,(x,N)=>{var R;B[`configuratorParams.linesWidths.${N}`]=[ae.required,ae.min(r.settings.minLineWidth),ae.step(r.settings.lineWidthStep),We.serverValidation((R=r.validation[`linesWidths.${N}`])==null?void 0:R.feedback)]}),B}),d=i.ref(r.settings.canSetDopProdaga??!1),u=i.computed(()=>r.value[0].configuratorParams.linesWidths.reduce((B,x)=>(B??0)+(x??0),0)),h=i.computed(()=>r.settings.width-u.value),f=i.computed(()=>!r.value.some(({product:B})=>!B||B.isNewRec())),g=i.computed(()=>r.isSubmitProcessing||!f.value||h.value<=0||l.value.length>=r.settings.maxLinesCount||r.value.some(B=>B.product.isNewRec())),m=i.computed(()=>B=>h.value===0?void 0:[{label:`${(h.value>0?"Остаток +":"Излишек ")+h.value} мм.`,key:h.value+B}]),p=i.computed(()=>{const{length:B}=r.value[0];return!B||u.value!==r.settings.width?null:(I.reduce(r.value,(N,R)=>{var C;const w=((C=R.product)==null?void 0:C.costRub)||0;return N+w},0)*r.value[0].quantity*B).toLocaleString("ru-ru",{minimumFractionDigits:2})}),y=(B,x,N)=>{var w,C,k;l.value[x].product.id=-1;const{configuratorParams:R}=l.value[x];R.linesWidths[x]=B,b("configuratorParams",R),(k=(C=(w=a.value)==null?void 0:w.at(x))==null?void 0:C.formItemReference)==null||k.validate().catch(I.noop),i.nextTick(()=>{var T,$;($=(T=a.value)==null?void 0:T.at(x))!=null&&$.isValid&&s("update:params",R,x,N)})},b=(B,x)=>{l.value.forEach(N=>{N[B]=x}),s("update:value",l.value)};return i.watch(()=>r.value,B=>{l.value=I.cloneDeep(B)},{deep:!0}),e({validate:(_=o.value)==null?void 0:_.validate,formReference:o}),(B,x)=>{const N=z.NCheckbox;return i.openBlock(),i.createBlock(i.unref(z.NForm),{ref:"form-reference",model:l.value[0],rules:c.value,class:"flex flex-col gap-2 sc-hide-empty-feedback-message",onKeydown:x[15]||(x[15]=i.withKeys(i.withModifiers(R=>s("submit",l.value),["prevent"]),["enter"]))},{default:i.withCtx(()=>{var R;return[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(l.value,(w,C)=>{var k,T;return i.openBlock(),i.createBlock(Sd,{key:C,ref_for:!0,ref:"line-items-reference",value:((k=w.configuratorParams)==null?void 0:k.linesWidths.at(C))??null,"auto-focus":!0,index:C,path:`configuratorParams.linesWidths.${C}`,product:w.product,settings:t.settings,validation:t.validation,"suggestion-option":m.value(((T=w.configuratorParams)==null?void 0:T.linesWidths.at(C))??0),"add-line-button-disabled":h.value<=0||t.value.length>=t.settings.maxLinesCount||t.value.some($=>$.product.isNewRec()),"remove-line-button-disabled":l.value.length===1,"onUpdate:value":y,"onClick:addLine":x[0]||(x[0]=$=>s("click:add-line",$)),"onClick:removeLine":x[1]||(x[1]=$=>s("click:remove-line",$))},null,8,["value","index","path","product","settings","validation","suggestion-option","add-line-button-disabled","remove-line-button-disabled"])}),128)),i.createElementVNode("div",Ay,[h.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),f.value&&l.value.length===t.settings.maxLinesCount&&h.value>0?(i.openBlock(),i.createBlock(i.unref(z.NText),{key:1,type:"error"},{default:i.withCtx(()=>[...x[16]||(x[16]=[i.createTextVNode(" Остаток резки должен быть равен 0 ",-1)])]),_:1})):i.createCommentVNode("",!0),i.createElementVNode("div",null,[x[17]||(x[17]=i.createTextVNode(" Остаток для резки: ",-1)),i.createVNode(i.unref(z.NText),{type:h.value>=0?"Success":"error"},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(h.value),1)]),_:1},8,["type"]),i.createTextVNode(" из "+i.toDisplayString(t.settings.width)+" мм ",1)])]),i.createVNode(i.unref(z.NButton),{disabled:g.value,type:"primary",class:"self-center",onClick:x[2]||(x[2]=w=>s("click:add-line",l.value.length))},{default:i.withCtx(()=>[...x[18]||(x[18]=[i.createTextVNode(" Добавить полосу ",-1)])]),_:1},8,["disabled"]),i.createVNode(i.unref(z.NFormItem),{path:"length",label:`Метраж ${t.settings.minLength?" от "+t.settings.minLength:""} ${t.settings.maxLength?" до "+t.settings.maxLength:""} м.`},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInputNumber),{value:l.value[0].length,"onUpdate:value":[x[3]||(x[3]=w=>l.value[0].length=w),x[6]||(x[6]=w=>b("length",w))],parse:i.unref(lt),"show-button":!1,placeholder:"Введите метраж",class:"w-full",onKeydown:x[4]||(x[4]=w=>i.unref(tt)(w,!1)),onInput:x[5]||(x[5]=w=>i.unref(et)(t.validation,"length")),onFocus:i.unref(Le)},null,8,["value","parse","onFocus"])]),_:1},8,["label"]),i.createVNode(i.unref(z.NFormItem),{path:"quantity",label:"Количество"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInputNumber),{value:l.value[0].quantity,"onUpdate:value":[x[7]||(x[7]=w=>l.value[0].quantity=w),x[10]||(x[10]=w=>b("quantity",w))],"show-button":!1,placeholder:"Введите количество",class:"w-full",onKeydown:x[8]||(x[8]=w=>i.unref(tt)(w,!1)),onInput:x[9]||(x[9]=w=>i.unref(et)(t.validation,"quantity")),onFocus:i.unref(Le)},null,8,["value","onFocus"])]),_:1}),i.createVNode(i.unref(z.NFormItem),{path:"marker",label:"Маркировка"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInput),{value:l.value[0].marker??null,placeholder:"Введите маркировку",onInput:x[11]||(x[11]=w=>i.unref(et)(t.validation,"marker")),"onUpdate:value":x[12]||(x[12]=w=>{l.value[0].marker=w??null,b("marker",w??null)}),onFocus:i.unref(Le)},null,8,["value","onFocus"])]),_:1}),d.value?(i.openBlock(),i.createBlock(N,{key:0,checked:l.value[0].isAdditionalSale??!1,"true-value":!0,"false-value":!1,"onUpdate:checked":x[13]||(x[13]=w=>{l.value[0].isAdditionalSale=w??!1,b("isAdditionalSale",w??!1)})},{default:i.withCtx(()=>[...x[19]||(x[19]=[i.createTextVNode(" ДопПродажа ",-1)])]),_:1},8,["checked"])):i.createCommentVNode("",!0),p.value?(i.openBlock(),i.createElementBlock("div",My,[x[20]||(x[20]=i.createTextVNode(" ИТОГО: ",-1)),i.createElementVNode("span",Oy,i.toDisplayString(p.value)+" ₽",1)])):i.createCommentVNode("",!0),i.createElementVNode("div",zy,[i.createVNode(i.unref(z.NButton),{loading:t.isSubmitProcessing,disabled:!f.value||h.value!=0||!((R=l.value[0])!=null&&R.length)||l.value[0].length>t.settings.maxLength||l.value[0].length<t.settings.minLength||l.value[0].quantity===0,type:"primary",class:"self-start",onClick:x[14]||(x[14]=w=>s("submit",l.value))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(l.value[0].isNewRec()?"В корзину":"Изменить"),1)]),_:1},8,["loading","disabled"])])]}),_:1},8,["model","rules"])}}}),Ly={class:"flex grow flex-col"},Hy=["src"],Wy={class:"w-full"},jy={},Td=i.defineComponent({...jy,__name:"strip-configurator-preview",props:{value:{},settings:{}},setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock("div",Ly,[i.createElementVNode("img",{src:"/img/configurators/strip/strip-"+t.value.length+".png",class:"w-full max-w-96 self-center py-5",alt:"Штрипс"},null,8,Hy),i.createElementVNode("div",Wy,[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)])]))}}),qy={class:"flex flex-col gap-2"},Xy={class:"w-104 flex grow flex-col px-5"},Yy={},$d=i.defineComponent({...Yy,__name:"strip-configurator",props:{eventEmitter:{},showSlugs:{type:Boolean},showProperties:{type:Boolean},showProductCosts:{type:[Boolean,Function]},allowNameClick:{type:[Boolean,Function]},allowPriceClick:{type:[Boolean,Function]},showPriceHistory:{type:[Boolean,Function]},showCostDate:{type:[Boolean,Function]},isProductItemSelected:{type:Function},showProductAddToCartButton:{type:[Boolean,String,Function]},showProductRequiredButton:{type:[Boolean,String,Function]},showProductEditButton:{type:[Boolean,String,Function]},currencyRates:{},productContextButtonsConfig:{type:Function},settings:{},cartItems:{}},emits:["submit","click:view-switch"],setup(t,{emit:e}){const n=t,r=e,s=i.useTemplateRef("strip-configurator-form"),o=i.ref(n.cartItems),a=i.ref({width:{},length:{},quantity:{},marker:{}}),l=i.ref(!1),c=i.computed(()=>i.inject("debounce-input-time",300)),d=i.computed(()=>{var m;return(m=o.value[0].configuratorParams)==null?void 0:m.linesWidths.reduce((p,y)=>(p??0)+(y??0),0)}),u=m=>{m===void 0&&(m=o.value.length-1);const p=o.value.at(0);if(!p)return;p.configuratorParams.linesWidths=p.configuratorParams.linesWidths.toSpliced(m+1,0,null),o.value.forEach(b=>{b.configuratorParams.linesWidths=p.configuratorParams.linesWidths});const y=new K.OrderItemBase({quantity:(p==null?void 0:p.quantity)??1,category:p==null?void 0:p.category,length:(p==null?void 0:p.length)??n.settings.minLength,marker:p==null?void 0:p.marker,configuratorParams:{linesWidths:p==null?void 0:p.configuratorParams.linesWidths}});o.value=o.value.toSpliced(m+1,0,y)},h=m=>{const p=o.value.at(0);p&&(p.configuratorParams.linesWidths=p.configuratorParams.linesWidths.toSpliced(m,1),o.value.forEach(y=>{y.configuratorParams.linesWidths=p.configuratorParams.linesWidths}),o.value=o.value.toSpliced(m,1),delete a[`linesWidths.${m}`],delete a[`linesWidths.${m}`])},f=I.debounce(async(m,p,y)=>{const b={linesWidths:m.linesWidths.at(p)};y.value=!0,a.value[`linesWidths.${p}`]={},o.value[p].product=new K.ClientProduct,n.eventEmitter.emit("configurator:search-product",{category:o.value[p].category,params:b,validationFieldResultData:a.value,callback:_=>{_?(o.value[p].product=_,p===o.value.length-1&&o.value.length<n.settings.maxLinesCount&&d.value&&d.value<n.settings.width&&u()):(o.value[p].product=new K.ClientProduct,a.value[`linesWidths.${p}`]={showFeedback:!0,feedback:"Не удалось найти товар",validationStatus:"error"},y.value=!1),y.value=!1}})},c.value),g=async()=>{var m,p;(p=(m=s.value)==null?void 0:m.formReference)==null||p.validate(y=>{if(!y){l.value=!0;const b=o.value.at(0);if(!b)return;r("submit",b,a.value,()=>{l.value=!1,i.nextTick(()=>{var _,B;(B=(_=s.value)==null?void 0:_.formReference)==null||B.restoreValidation()})})}}).catch(I.noop)};return i.watch(()=>n.cartItems,m=>{o.value=m.map(p=>new K.OrderItemBase(p))}),(m,p)=>{const y=z.NButton;return i.openBlock(),i.createElementBlock("div",qy,[t.settings.allowShowTable?(i.openBlock(),i.createBlock(y,{key:0,type:"tertiary",class:"self-center",onClick:p[0]||(p[0]=b=>r("click:view-switch"))},{default:i.withCtx(()=>[...p[3]||(p[3]=[i.createTextVNode(" Показать в виде списка ",-1)])]),_:1})):i.createCommentVNode("",!0),i.createElementVNode("div",Xy,[i.createVNode(Td,{value:o.value,"onUpdate:value":p[1]||(p[1]=b=>o.value=b),settings:t.settings},null,8,["value","settings"]),i.createVNode(Bd,{ref:"strip-configurator-form",value:o.value,"onUpdate:value":p[2]||(p[2]=b=>o.value=b),validation:a.value,settings:t.settings,"is-submit-processing":l.value,"onUpdate:params":i.unref(f),onSubmit:g,"onClick:addLine":u,"onClick:removeLine":h},null,8,["value","validation","settings","is-submit-processing","onUpdate:params"])])])}}}),Uy={class:"flex flex-col gap-3"},Ky={},Nd=i.defineComponent({...Ky,__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,{expose:e,emit:n}){var g;const r=t,s=n,o=i.useTemplateRef("form-reference"),a=i.useTemplateRef("first-input-element"),l=i.ref(I.cloneDeep(r.value)),c=i.computed(()=>({"configuratorParams.width":[ae.required,ae.min(r.settings.minWidth),...r.settings.maxWidth?[ae.max(r.settings.maxWidth)]:[],ae.step(1),We.serverValidation(r.validation.width.feedback)],"configuratorParams.length":[ae.required,ae.min(r.settings.minLength),ae.max(r.settings.maxLength),ae.step(1),We.serverValidation(r.validation.length.feedback)],quantity:[ae.required,ae.min(1),ae.step(1),We.serverValidation(r.validation.quantity.feedback)],marker:[We.serverValidation(r.validation.marker.feedback)]})),d=i.ref(r.settings.canSetDopProdaga??!1),u=()=>{s("update:params",l.value.configuratorParams),h("configuratorParams",l.value.configuratorParams)},h=(m,p)=>{const y=new K.OrderItemBase(r.value);y[m]=p,m==="configuratorParams"&&(y.product=new K.ClientProduct),s("update:value",y)},f=()=>{var m;(m=a.value)==null||m.select()};return i.watch(()=>r.value,m=>{l.value=I.cloneDeep(m)},{deep:!0}),i.onMounted(()=>{r.value.isNewRec()&&i.nextTick(()=>{f()})}),e({validate:(g=o.value)==null?void 0:g.validate,formReference:o}),(m,p)=>{const y=z.NCheckbox;return i.openBlock(),i.createBlock(i.unref(z.NForm),{ref:"form-reference",model:l.value,rules:c.value,disabled:t.isSubmitProcessing,class:"flex flex-col gap-2 sc-hide-empty-feedback-message",onKeydown:p[13]||(p[13]=i.withKeys(i.withModifiers(b=>s("submit",l.value),["prevent"]),["enter"]))},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NFormItem),{path:"configuratorParams.width",label:`Ширина, ${t.settings.minWidth?" от "+t.settings.minWidth:""}${t.settings.maxWidth?" до "+t.settings.maxWidth:""} мм`},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInputNumber),{ref:"first-input-element",value:l.value.configuratorParams.width,"onUpdate:value":[p[0]||(p[0]=b=>l.value.configuratorParams.width=b),u],class:"w-full",parse:i.unref(lt),"show-button":!1,placeholder:"Введите ширину",onKeydown:p[1]||(p[1]=b=>i.unref(tt)(b)),onInput:p[2]||(p[2]=b=>i.unref(et)(t.validation,"width")),onFocus:i.unref(Le)},null,8,["value","parse","onFocus"])]),_:1},8,["label"]),i.createVNode(i.unref(z.NFormItem),{path:"configuratorParams.length",label:`Длина, ${t.settings.minLength?" от "+t.settings.minLength:""}${t.settings.maxLength?" до "+t.settings.maxLength:""} мм`},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInputNumber),{value:l.value.configuratorParams.length,"onUpdate:value":[p[3]||(p[3]=b=>l.value.configuratorParams.length=b),u],placeholder:"Введите длину",parse:i.unref(lt),"show-button":!1,class:"w-full",onKeydown:p[4]||(p[4]=b=>i.unref(tt)(b)),onInput:p[5]||(p[5]=b=>i.unref(et)(t.validation,"length")),onFocus:i.unref(Le)},null,8,["value","parse","onFocus"])]),_:1},8,["label"]),i.createVNode(i.unref(z.NFormItem),{path:"quantity",label:"Количество"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInputNumber),{value:t.value.quantity,placeholder:"Введите количество",min:1,"show-button":!1,class:"w-full",onKeydown:p[6]||(p[6]=b=>i.unref(tt)(b,!1)),onInput:p[7]||(p[7]=b=>i.unref(et)(t.validation,"quantity")),"onUpdate:value":p[8]||(p[8]=b=>h("quantity",b??0)),onFocus:i.unref(Le)},null,8,["value","onFocus"])]),_:1}),i.createVNode(i.unref(z.NFormItem),{path:"marker",label:"Маркировка"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInput),{value:t.value.marker??null,placeholder:"Введите маркировку",onInput:p[9]||(p[9]=b=>i.unref(et)(t.validation,"marker")),"onUpdate:value":p[10]||(p[10]=b=>h("marker",b??null)),onFocus:i.unref(Le)},null,8,["value","onFocus"])]),_:1}),d.value?(i.openBlock(),i.createBlock(y,{key:0,checked:l.value.isAdditionalSale??!1,"true-value":!0,"false-value":!1,"onUpdate:checked":p[11]||(p[11]=b=>{l.value.isAdditionalSale=b??!1,h("isAdditionalSale",b??!1)})},{default:i.withCtx(()=>[...p[14]||(p[14]=[i.createTextVNode(" ДопПродажа ",-1)])]),_:1},8,["checked"])):i.createCommentVNode("",!0),i.createVNode(cr,{"is-product-searching":t.isProductSearching,product:t.value.product,validation:t.validation.product},null,8,["is-product-searching","product","validation"]),i.createElementVNode("div",Uy,[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:p[12]||(p[12]=b=>s("submit",t.value))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(t.value.isNewRec()?"В корзину":"Изменить"),1)]),_:1},8,["disabled"])])]),_:1},8,["model","rules","disabled"])}}}),Gy={class:"flex flex-col gap-2 w-72"},Zy={},Rd=i.defineComponent({...Zy,__name:"metal-for-doors-configurator",props:{eventEmitter:{},showSlugs:{type:Boolean},showProperties:{type:Boolean},showProductCosts:{type:[Boolean,Function]},allowNameClick:{type:[Boolean,Function]},allowPriceClick:{type:[Boolean,Function]},showPriceHistory:{type:[Boolean,Function]},showCostDate:{type:[Boolean,Function]},isProductItemSelected:{type:Function},showProductAddToCartButton:{type:[Boolean,String,Function]},showProductRequiredButton:{type:[Boolean,String,Function]},showProductEditButton:{type:[Boolean,String,Function]},currencyRates:{},productContextButtonsConfig:{type:Function},settings:{},cartItem:{}},emits:["submit","click:view-switch"],setup(t,{emit:e}){const n=t,r=e,s=i.useTemplateRef("metal-for-doors-configurator-form"),o=i.ref(n.cartItem),a=i.ref({width:{},length:{},quantity:{},marker:{}}),l=i.ref(!1),c=i.ref(!1),d=i.computed(()=>i.inject("debounce-input-time",300)),u=I.debounce(async f=>{var g,m;o.value.product=new K.ClientProduct,(m=(g=s.value)==null?void 0:g.formReference)==null||m.validate(p=>{p||(l.value=!0,n.eventEmitter.emit("configurator:search-product",{category:n.cartItem.category,params:f,validationFieldResultData:a.value,callback:y=>{y?o.value.product=y:a.value.product={showFeedback:!0,feedback:"Не удалось найти товар по указанным параметрам.",validationStatus:"error"},l.value=!1}}))}).catch(I.noop)},d.value),h=async()=>{var f,g;(g=(f=s.value)==null?void 0:f.formReference)==null||g.validate(m=>{m||(c.value=!0,r("submit",o.value,a.value,()=>{c.value=!1,i.nextTick(()=>{var p,y;(y=(p=s.value)==null?void 0:p.formReference)==null||y.restoreValidation()})}))}).catch(I.noop)};return i.watch(()=>n.cartItem,f=>{o.value=new K.OrderItemBase(f)},{deep:!0}),(f,g)=>{const m=z.NButton;return i.openBlock(),i.createElementBlock("div",Gy,[t.settings.allowShowTable?(i.openBlock(),i.createBlock(m,{key:0,type:"tertiary",class:"self-center",onClick:g[0]||(g[0]=p=>r("click:view-switch"))},{default:i.withCtx(()=>[...g[4]||(g[4]=[i.createTextVNode(" Показать в виде списка ",-1)])]),_:1})):i.createCommentVNode("",!0),i.createVNode(Nd,{ref:"metal-for-doors-configurator-form",value:o.value,"onUpdate:value":g[1]||(g[1]=p=>o.value=p),validation:a.value,settings:t.settings,"is-submit-processing":c.value,"is-product-searching":l.value,"onUpdate:params":g[2]||(g[2]=p=>i.unref(u)(p)),onSubmit:g[3]||(g[3]=p=>h())},null,8,["value","validation","settings","is-submit-processing","is-product-searching"])])}}}),Qy={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Jy(t,e){return i.openBlock(),i.createElementBlock("svg",Qy,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M256 112v288m144-144H112"},null,-1)])])}const Pd=i.markRaw({name:"ion-add",render:Jy}),e0={key:0,class:"-mt-1 text-sm text-gray-500"},t0={class:"font-bold"},n0={class:"flex flex-col gap-3"},i0={key:0,class:"mt-4 flex flex-col gap-1.5"},r0={class:"flex flex-col gap-1 text-sm text-gray-700"},s0={key:0},o0={key:1},a0={"form-array-name":"items",class:"flex flex-col gap-3"},l0={class:"grid grow grid-cols-1 items-start gap-2 sm:grid-cols-3"},c0={key:0,class:"flex flex-wrap items-end gap-2"},d0={class:"whitespace-nowrap text-xl font-bold"},u0={key:0,class:"whitespace-nowrap text-lg text-gray-500"},h0={class:"font-bold"},f0={class:"font-bold"},m0={class:"flex gap-3"},g0={},Ed=i.defineComponent({...g0,__name:"sandwich-configurator-form",props:{value:{},eventEmitter:{},showSlugs:{type:Boolean},showProperties:{type:Boolean},showProductCosts:{type:[Boolean,Function]},allowNameClick:{type:[Boolean,Function]},allowPriceClick:{type:[Boolean,Function]},showPriceHistory:{type:[Boolean,Function]},showCostDate:{type:[Boolean,Function]},isProductItemSelected:{},showProductAddToCartButton:{type:[Boolean,String,Function]},showProductRequiredButton:{type:[Boolean,String,Function]},showProductEditButton:{type:[Boolean,String,Function]},currencyRates:{},productContextButtonsConfig:{},settings:{},isProductSearching:{type:Boolean,default:!1},isSubmitProcessing:{type:Boolean,default:!1},validation:{default:void 0}},emits:["update:value","update:params","submit","add-item","remove-item"],setup(t,{expose:e,emit:n}){var H;const r=t,s=n,o=i.useTemplateRef("form-reference"),a=i.ref(I.cloneDeep(r.value)),l=i.ref({...r.validation}),c=L=>{var M;delete l.value[L],(M=o.value)==null||M.restoreValidation()};i.watch(()=>r.validation,L=>{l.value={...L},Object.values(L).some(O=>O==null?void 0:O.feedback)&&i.nextTick(()=>{var O;return(O=o.value)==null?void 0:O.validate(I.noop).catch(I.noop)})},{deep:!0});const d=i.computed(()=>r.value.category),u=i.ref(null),h=i.ref(null),f=i.computed(()=>d.value.products??[]),g=i.computed(()=>f.value.map(L=>({label:L.name,value:L.id}))),m=(L,M,O)=>{const Y=L!=null&&L>0,U=M!=null&&M>0;return!Y&&!U?null:Y&&U?`от ${L} ${O} до ${M} ${O}`:Y?`от ${L} ${O}`:`до ${M} ${O}`},p=i.computed(()=>{var L,M;return m(r.settings.minWidth,(M=(L=u.value)==null?void 0:L.properties)==null?void 0:M.width,"мм")}),y=i.computed(()=>{var L,M;return m(r.settings.minLength,(M=(L=u.value)==null?void 0:L.properties)==null?void 0:M.length,"мм")}),b=i.ref(null),_=i.ref(!1);i.computed(()=>{var L,M;return(M=(L=u.value)==null?void 0:L.properties)!=null&&M.width?ae.max(u.value.properties.width):null}),i.computed(()=>{var L,M;return(M=(L=u.value)==null?void 0:L.properties)!=null&&M.length?ae.max(u.value.properties.length):null});const B=i.computed(()=>{var M;const L={marker:[We.serverValidation((M=l.value.marker)==null?void 0:M.feedback)]};return a.value.configuratorParams.items.forEach((O,Y)=>{var U,V,j,q,ee,ue,ve;L[`configuratorParams.items.${Y}.width`]=[ae.required,ae.min(r.settings.minWidth),...(V=(U=u.value)==null?void 0:U.properties)!=null&&V.width?[ae.max(u.value.properties.width)]:[],ae.step(1),We.serverValidation((j=l.value[`items.${Y}.width`])==null?void 0:j.feedback)],L[`configuratorParams.items.${Y}.length`]=[ae.required,ae.min(r.settings.minLength),...(ee=(q=u.value)==null?void 0:q.properties)!=null&&ee.length?[ae.max(u.value.properties.length)]:[],ae.step(1),We.serverValidation((ue=l.value[`items.${Y}.length`])==null?void 0:ue.feedback)],L[`configuratorParams.items.${Y}.count`]=[ae.required,ae.min(1),ae.step(1),We.serverValidation((ve=l.value[`items.${Y}.count`])==null?void 0:ve.feedback)]}),L}),x=i.ref(r.settings.canSetDopProdaga??!1),N=i.computed(()=>a.value.configuratorParams.items.some(L=>{var M,O;return!u.value||!L.width||L.width<r.settings.minWidth||L.width>(((M=u.value.properties)==null?void 0:M.width)??0)||L.length===0||L.length<r.settings.minLength||L.length>(((O=u.value.properties)==null?void 0:O.length)??0)||!L.count||L.count<1})),R=i.computed(()=>!u.value||N.value||a.value.configuratorParams.items.length===0),w=i.ref(null),C=L=>{if(!L){u.value=null,h.value=null,a.value.product=new K.ClientProduct,b.value=null;return}const M=f.value.find(O=>O.id===L);M&&(u.value=M,h.value=L,a.value.product=M,te("product",a.value.product),a.value.configuratorParams.items.forEach(O=>{var Y,U;(Y=M.properties)!=null&&Y.width&&O.width>M.properties.width&&(O.width=M.properties.width),(U=M.properties)!=null&&U.length&&O.length>M.properties.length&&(O.length=M.properties.length)}),T())};let k=!1;const T=()=>{k=!0,b.value=null,w.value=null,a.value.configuratorParams.calculationId="",a.value.quantity=0},$=async()=>{var L;if(!u.value||a.value.configuratorParams.items.length===0||N.value){T();return}(L=o.value)==null||L.validate(M=>{if(M){T();return}if(_.value=!0,!u.value||!d.value){T(),_.value=!1;return}r.eventEmitter.emit("configurator:calculate",{category:d.value,params:{productId:u.value.id,items:a.value.configuratorParams.items},callback:O=>{O?(b.value=O,a.value.configuratorParams.calculationId=O.id,a.value.quantity=O.quantity,i.nextTick(()=>{te("quantity",O.quantity)})):(a.value.configuratorParams.calculationId="",a.value.quantity=0,T()),te("configuratorParams",a.value.configuratorParams),P(),_.value=!1}})}).catch(()=>{T(),_.value=!1})},P=()=>{var M;if(!((M=u.value)!=null&&M.costRub)||!b.value){w.value=null;return}const L=b.value.quantity*u.value.costRub;w.value=Math.round(L*100)/100},E=L=>{var O,Y;const M=a.value.configuratorParams.items[L];u.value&&((O=u.value.properties)!=null&&O.width&&M.width>u.value.properties.width&&(M.width=u.value.properties.width),(Y=u.value.properties)!=null&&Y.length&&M.length>u.value.properties.length&&(M.length=u.value.properties.length)),te("configuratorParams",a.value.configuratorParams),T()},W=()=>{a.value.configuratorParams.calculationId="",a.value.configuratorParams.items.push({width:0,length:0,count:1}),te("configuratorParams",a.value.configuratorParams),T(),s("add-item",a.value.configuratorParams.items.length)},A=L=>{a.value.configuratorParams.items.splice(L,1),te("configuratorParams",a.value.configuratorParams),T(),s("remove-item",L)},Z=()=>{if(!(R.value||_.value||r.isSubmitProcessing)){if(!b.value){$();return}s("submit",a.value)}},te=(L,M)=>{const O=new K.OrderItemBase(r.value);O[L]=M,s("update:value",O)};i.watch(()=>r.value,L=>{const M=I.cloneDeep(i.toRaw(L));(!M.configuratorParams.items||M.configuratorParams.items.length===0)&&(M.configuratorParams.items=[{width:0,length:0,count:1}]),a.value=M,r.value.product&&!r.value.product.isNewRec()&&(u.value=r.value.product,h.value=r.value.product.id),r.value.product.isNewRec()&&(u.value=null,h.value=null),k?k=!1:D()},{deep:!0});const D=()=>{const{calculationId:L}=a.value.configuratorParams,M=a.value.quantity??0;L&&M>0&&a.value.product&&!a.value.product.isNewRec()&&(b.value={id:L,quantity:M,sheets:[]},P())};return i.onMounted(()=>{r.value.product&&!r.value.product.isNewRec()&&(u.value=r.value.product,h.value=r.value.product.id),D()}),e({validate:(H=o.value)==null?void 0:H.validate,formReference:o}),(L,M)=>{const O=zr,Y=Pd;return i.openBlock(),i.createBlock(i.unref(z.NForm),{ref:"form-reference",model:a.value,rules:B.value,class:"flex flex-col gap-2 sc-hide-empty-feedback-message",onKeydown:i.withKeys(i.withModifiers(Z,["prevent"]),["enter"])},{default:i.withCtx(()=>{var U;return[i.createVNode(i.unref(z.NFormItem),{required:!0,"show-feedback":!1,label:"Товар"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NSelect),{value:h.value,"onUpdate:value":[M[0]||(M[0]=V=>h.value=V),C],options:g.value,placeholder:"Выберите материал",filterable:""},null,8,["value","options"])]),_:1}),((U=u.value)==null?void 0:U.costRub)!=null?(i.openBlock(),i.createElementBlock("div",e0,[i.createElementVNode("span",t0,i.toDisplayString(u.value.code),1),i.createTextVNode(" — "+i.toDisplayString(u.value.costRub.toLocaleString())+" "+i.toDisplayString(u.value.currency.symbol)+"/шт. ",1)])):i.createCommentVNode("",!0),i.createElementVNode("div",n0,[u.value?(i.openBlock(),i.createElementBlock("div",i0,[M[7]||(M[7]=i.createElementVNode("div",{class:"w-full font-bold"},"Размеры изделий",-1)),i.createElementVNode("div",r0,[p.value?(i.openBlock(),i.createElementBlock("div",s0,"Ширина "+i.toDisplayString(p.value)+".",1)):i.createCommentVNode("",!0),y.value?(i.openBlock(),i.createElementBlock("div",o0,"Длина "+i.toDisplayString(y.value)+".",1)):i.createCommentVNode("",!0)])])):i.createCommentVNode("",!0),i.createElementVNode("div",a0,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(a.value.configuratorParams.items,(V,j)=>(i.openBlock(),i.createElementBlock("div",{key:j,class:"flex grow gap-2"},[i.createElementVNode("div",l0,[i.createVNode(i.unref(z.NFormItem),{path:`configuratorParams.items.${j}.width`,label:"Ширина, мм"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInputNumber),{value:a.value.configuratorParams.items[j].width,"onUpdate:value":[q=>a.value.configuratorParams.items[j].width=q,q=>E(j)],parse:i.unref(lt),"show-button":!1,disabled:!u.value,placeholder:"Ширина",class:"w-full",onKeydown:M[1]||(M[1]=q=>i.unref(tt)(q)),onInput:q=>c(`items.${j}.width`),onFocus:i.unref(Le)},null,8,["value","onUpdate:value","parse","disabled","onInput","onFocus"])]),_:2},1032,["path"]),i.createVNode(i.unref(z.NFormItem),{path:`configuratorParams.items.${j}.length`,label:"Длина, мм"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInputNumber),{value:a.value.configuratorParams.items[j].length,"onUpdate:value":[q=>a.value.configuratorParams.items[j].length=q,q=>E(j)],parse:i.unref(lt),"show-button":!1,disabled:!u.value,placeholder:"Длина",class:"w-full",onKeydown:M[2]||(M[2]=q=>i.unref(tt)(q)),onInput:q=>c(`items.${j}.length`),onFocus:i.unref(Le)},null,8,["value","onUpdate:value","parse","disabled","onInput","onFocus"])]),_:2},1032,["path"]),i.createVNode(i.unref(z.NFormItem),{path:`configuratorParams.items.${j}.count`,label:"Количество, шт"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInputNumber),{value:a.value.configuratorParams.items[j].count,"onUpdate:value":[q=>a.value.configuratorParams.items[j].count=q,q=>E(j)],parse:i.unref(lt),"show-button":!1,disabled:!u.value,placeholder:"Количество",class:"w-full",onKeydown:M[3]||(M[3]=q=>i.unref(tt)(q,!1)),onInput:q=>c(`items.${j}.count`),onFocus:i.unref(Le)},null,8,["value","onUpdate:value","parse","disabled","onInput","onFocus"])]),_:2},1032,["path"])]),i.createVNode(i.unref(z.NButton),{disabled:!u.value||a.value.configuratorParams.items.length<=1,type:"error",size:"medium",class:"mt-5",onClick:q=>A(j)},{default:i.withCtx(()=>[i.createVNode(O)]),_:1},8,["disabled","onClick"])]))),128))]),u.value?(i.openBlock(),i.createBlock(i.unref(z.NButton),{key:1,disabled:N.value,type:"default",class:"self-center",onClick:W},{default:i.withCtx(()=>[i.createVNode(Y),M[8]||(M[8]=i.createTextVNode(" Добавить изделие ",-1))]),_:1},8,["disabled"])):i.createCommentVNode("",!0)]),i.createVNode(i.unref(z.NFormItem),{path:"marker",label:"Маркировка распила"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInput),{value:a.value.marker??null,disabled:!u.value,placeholder:"Введите маркировку распила",onInput:M[4]||(M[4]=V=>c("marker")),"onUpdate:value":M[5]||(M[5]=V=>te("marker",V??null)),onFocus:i.unref(Le)},null,8,["value","disabled","onFocus"])]),_:1}),x.value?(i.openBlock(),i.createBlock(i.unref(z.NCheckbox),{key:1,checked:a.value.isAdditionalSale??!1,"true-value":!0,"false-value":!1,"onUpdate:checked":M[6]||(M[6]=V=>{a.value.isAdditionalSale=V??!1,te("isAdditionalSale",V??!1)})},{default:i.withCtx(()=>[...M[9]||(M[9]=[i.createTextVNode(" ДопПродажа ",-1)])]),_:1},8,["checked"])):i.createCommentVNode("",!0),i.createVNode(i.unref(z.NSpin),{show:_.value,size:"small",class:"grow"},{default:i.withCtx(()=>{var V;return[b.value&&u.value&&w.value?(i.openBlock(),i.createElementBlock("div",c0,[i.createElementVNode("div",null,[M[10]||(M[10]=i.createTextVNode(" Итого: ",-1)),i.createElementVNode("span",d0,i.toDisplayString(w.value.toLocaleString())+" "+i.toDisplayString(u.value.currency.symbol),1)]),b.value.quantity&&u.value?(i.openBlock(),i.createElementBlock("div",u0,[i.createElementVNode("span",h0,"("+i.toDisplayString(b.value.quantity)+" шт.",1),M[11]||(M[11]=i.createTextVNode(" x ",-1)),i.createElementVNode("span",f0,i.toDisplayString((V=u.value.costRub)==null?void 0:V.toLocaleString())+" "+i.toDisplayString(u.value.currency.symbol)+"/шт.)",1)])):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)]}),_:1},8,["show"]),i.createElementVNode("div",m0,[b.value&&!_.value?(i.openBlock(),i.createBlock(i.unref(z.NButton),{key:0,loading:t.isSubmitProcessing,disabled:R.value||_.value,type:"primary",class:"self-start",onClick:Z},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(a.value.isNewRec()?"В корзину":"Изменить"),1)]),_:1},8,["loading","disabled"])):(i.openBlock(),i.createBlock(i.unref(z.NButton),{key:1,loading:_.value,disabled:R.value||_.value,type:"info",class:"self-start",onClick:$},{default:i.withCtx(()=>[...M[12]||(M[12]=[i.createTextVNode(" Рассчитать ",-1)])]),_:1},8,["loading","disabled"]))])]}),_:1},8,["model","rules","onKeydown"])}}}),p0={class:"flex flex-col gap-2"},y0={class:"w-104 flex grow flex-col px-5"},b0={},Fd=i.defineComponent({...b0,__name:"sandwich-configurator",props:{eventEmitter:{},showSlugs:{type:Boolean},showProperties:{type:Boolean},showProductCosts:{type:[Boolean,Function]},allowNameClick:{type:[Boolean,Function]},allowPriceClick:{type:[Boolean,Function]},showPriceHistory:{type:[Boolean,Function]},showCostDate:{type:[Boolean,Function]},isProductItemSelected:{type:Function},showProductAddToCartButton:{type:[Boolean,String,Function]},showProductRequiredButton:{type:[Boolean,String,Function]},showProductEditButton:{type:[Boolean,String,Function]},currencyRates:{},productContextButtonsConfig:{type:Function},settings:{},cartItem:{}},emits:["submit","click:view-switch"],setup(t,{emit:e}){const n=t,r=e,s=i.useTemplateRef("sandwich-configurator-form"),o=i.ref(n.cartItem),a=i.ref({width:{},length:{},quantity:{},marker:{},product:{}}),l=i.ref(!1),c=async()=>{var h,f;(f=(h=s.value)==null?void 0:h.formReference)==null||f.validate(g=>{if(!g){l.value=!0;const m=I.cloneDeep(o.value);"items"in m.configuratorParams&&delete m.configuratorParams.items,r("submit",m,a.value,()=>{l.value=!1,i.nextTick(()=>{var p,y;(y=(p=s.value)==null?void 0:p.formReference)==null||y.restoreValidation()})})}}).catch(I.noop)},d=h=>{a.value[`items.${h}.width`]={},a.value[`items.${h}.length`]={},a.value[`items.${h}.count`]={}},u=h=>{delete a.value[`items.${h}.width`],delete a.value[`items.${h}.length`],delete a.value[`items.${h}.count`]};return i.onMounted(()=>{n.cartItem.configuratorParams.items.forEach((h,f)=>{a.value[`items.${f}.width`]={},a.value[`items.${f}.length`]={},a.value[`items.${f}.count`]={}})}),i.watch(()=>n.cartItem,h=>{o.value=new K.OrderItemBase(h)},{deep:!0}),(h,f)=>{const g=z.NButton;return i.openBlock(),i.createElementBlock("div",p0,[t.settings.allowShowTable&&o.value.isNewRec()?(i.openBlock(),i.createBlock(g,{key:0,type:"tertiary",class:"self-center",onClick:f[0]||(f[0]=m=>r("click:view-switch"))},{default:i.withCtx(()=>[...f[2]||(f[2]=[i.createTextVNode(" Показать в виде списка ",-1)])]),_:1})):i.createCommentVNode("",!0),i.createElementVNode("div",y0,[i.createVNode(Ed,{ref:"sandwich-configurator-form",value:o.value,"onUpdate:value":f[1]||(f[1]=m=>o.value=m),validation:a.value,settings:t.settings,"event-emitter":t.eventEmitter,"is-submit-processing":l.value,onSubmit:c,onAddItem:d,onRemoveItem:u},null,8,["value","validation","settings","event-emitter","is-submit-processing"])])])}}}),_0={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function w0(t,e){return i.openBlock(),i.createElementBlock("svg",_0,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M416 128L192 384l-96-96"},null,-1)])])}const x0=i.markRaw({name:"ion-checkmark",render:w0}),k0={key:0,class:"-mt-1 text-sm text-gray-500"},v0={class:"font-bold"},C0={class:"flex flex-col gap-3"},S0={key:0,class:"mt-4 mb-3 flex flex-col gap-1.5"},B0={class:"flex flex-col gap-1 text-sm text-gray-700"},T0={key:0},$0={key:1},N0={"form-array-name":"items",class:"flex flex-col gap-3"},R0={class:"min-w-0 flex-1"},P0={class:"relative flex flex-col gap-3 lg:!flex-row lg:!items-start lg:!gap-6"},E0={class:"grid grid-cols-1 gap-2 sm:grid-cols-2 lg:!flex-[2]"},F0={class:"grid grid-cols-1 gap-2 sm:grid-cols-2 lg:!grid-cols-[1fr_2fr] lg:!flex-[3]"},V0={key:0,class:"pointer-events-none absolute bottom-2 right-3 flex h-8 w-8 items-center justify-center"},I0={class:"mt-1 flex flex-col gap-y-1 text-sm text-gray-500 lg:!flex-row lg:!gap-6"},A0={key:0,class:"lg:!flex-[2]"},M0={class:"font-bold"},O0={key:1,class:"lg:!flex-[3]"},z0={class:"font-bold"},D0={key:1,class:"min-w-0 flex flex-col items-end gap-1 text-right text-sm text-gray-700 border-t border-gray-200 pt-2"},L0={key:0},H0={class:"font-bold"},W0={key:1},j0={class:"font-bold"},q0={class:"flex flex-wrap items-center gap-3"},X0={},Vd=i.defineComponent({...X0,__name:"sandwich-m2-configurator-form",props:{value:{},eventEmitter:{},showSlugs:{type:Boolean},showProperties:{type:Boolean},showProductCosts:{type:[Boolean,Function]},allowNameClick:{type:[Boolean,Function]},allowPriceClick:{type:[Boolean,Function]},showPriceHistory:{type:[Boolean,Function]},showCostDate:{type:[Boolean,Function]},isProductItemSelected:{},showProductAddToCartButton:{type:[Boolean,String,Function]},showProductRequiredButton:{type:[Boolean,String,Function]},showProductEditButton:{type:[Boolean,String,Function]},currencyRates:{},productContextButtonsConfig:{},settings:{},isProductSearching:{type:Boolean,default:!1},isSubmitProcessing:{type:Boolean,default:!1},validation:{default:void 0},itemStates:{default:()=>[]}},emits:["submit","update:value","add-item","remove-item","item-reset"],setup(t,{expose:e,emit:n}){var U;const r=t,s=n,o=i.useTemplateRef("form-reference"),a=i.useTemplateRef("widthInputs"),l=r.value==null?[]:I.cloneDeep(i.toRaw(r.value)),c=i.ref(l.map(V=>new K.OrderItemBase(V))),d=i.computed(()=>({items:c.value})),u=i.ref({...r.validation}),h=V=>{var j;delete u.value[V],(j=o.value)==null||j.restoreValidation()},f=i.ref(null),g=i.ref(null),m=i.computed(()=>{var V,j;return((j=(V=c.value[0])==null?void 0:V.category)==null?void 0:j.products)??[]}),p=i.computed(()=>m.value.map(V=>({label:V.name,value:V.id}))),y=(V,j,q)=>{const ee=V!=null&&V>0,ue=j!=null&&j>0;return!ee&&!ue?null:ee&&ue?`от ${V} ${q} до ${j} ${q}`:ee?`от ${V} ${q}`:`до ${j} ${q}`},b=i.computed(()=>{var V,j;return y(r.settings.minWidth,(j=(V=f.value)==null?void 0:V.properties)==null?void 0:j.width,"мм")}),_=i.computed(()=>{var V,j;return y(r.settings.minLength,(j=(V=f.value)==null?void 0:V.properties)==null?void 0:j.length,"мм")}),B=i.computed(()=>{const V={};return c.value.forEach((j,q)=>{var ee,ue,ve,Te,He,ce,mt,$e;V[`items.${q}.configuratorParams.width`]=[ae.required,ae.min(r.settings.minWidth),...(ue=(ee=f.value)==null?void 0:ee.properties)!=null&&ue.width?[ae.max(f.value.properties.width)]:[],ae.step(1),We.serverValidation((ve=u.value[`items.${q}.width`])==null?void 0:ve.feedback)],V[`items.${q}.configuratorParams.length`]=[ae.required,ae.min(r.settings.minLength),...(He=(Te=f.value)==null?void 0:Te.properties)!=null&&He.length?[ae.max(f.value.properties.length)]:[],ae.step(1),We.serverValidation((ce=u.value[`items.${q}.length`])==null?void 0:ce.feedback)],V[`items.${q}.quantity`]=[ae.required,ae.min(1),ae.step(1),We.serverValidation((mt=u.value[`items.${q}.quantity`])==null?void 0:mt.feedback)],V[`items.${q}.marker`]=[We.serverValidation(($e=u.value[`items.${q}.marker`])==null?void 0:$e.feedback)]}),V});i.watch(()=>r.validation,V=>{u.value={...V},Object.values(V).some(q=>q==null?void 0:q.feedback)&&i.nextTick(()=>{var q;return(q=o.value)==null?void 0:q.validate(I.noop).catch(I.noop)})},{deep:!0});const x=i.ref(r.settings.canSetDopProdaga??!1),N=i.computed(()=>{const V=f.value;return V?c.value.some(j=>{var ve,Te;const q=j.configuratorParams,ee=(ve=V.properties)==null?void 0:ve.width,ue=(Te=V.properties)==null?void 0:Te.length;return q.width===0||q.width<r.settings.minWidth||ee!=null&&q.width>ee||q.length===0||q.length<r.settings.minLength||ue!=null&&q.length>ue||j.quantity===0||j.quantity<1}):!0}),R=i.computed(()=>!f.value||N.value||c.value.length===0),w=i.computed(()=>{const V=c.value[0];return V!=null&&!V.isNewRec()}),C=V=>r.itemStates[V]??"idle",k=V=>C(V)==="success",T=V=>C(V)==="loading",$=i.computed(()=>c.value.length===0?!0:c.value.every((V,j)=>{const q=C(j);return q==="success"||q==="loading"})),P=V=>V.width===0||V.length===0?0:V.width*V.length/1e6,E=V=>{var ve;const j=V.configuratorParams,q=P(j),ee=((ve=f.value)==null?void 0:ve.costRub)??0,ue=V.quantity??0;return!q||!ue?0:Math.round(q*ee*ue*100)/100},W=i.computed(()=>I.sum(c.value.map(V=>{const j=V.configuratorParams;return!j.width||j.length===0||!V.quantity?0:j.width*j.length*V.quantity/1e6}))),A=i.computed(()=>Math.round(I.sum(c.value.map(V=>E(V)))*100)/100),Z=()=>{var V,j,q;return new K.OrderItemBase({category:(V=c.value[0])==null?void 0:V.category,configurator:(j=c.value[0])==null?void 0:j.configurator,product:f.value??new K.ClientProduct,quantity:1,isAdditionalSale:(q=c.value[0])==null?void 0:q.isAdditionalSale,configuratorParams:{width:0,length:0}})},te=V=>{if(!V){f.value=null,g.value=null,c.value.forEach(q=>{q.product=new K.ClientProduct}),s("update:value",c.value);return}const j=m.value.find(q=>q.id===V);j&&(f.value=j,g.value=V,c.value.forEach((q,ee)=>{var ue,ve;q.product=j,(ue=j.properties)!=null&&ue.width&&q.configuratorParams.width>j.properties.width&&(q.configuratorParams.width=j.properties.width),(ve=j.properties)!=null&&ve.length&&q.configuratorParams.length>j.properties.length&&(q.configuratorParams.length=j.properties.length),s("item-reset",ee)}),s("update:value",c.value))},D=V=>{var ee,ue;const j=c.value[V],q=f.value;q&&((ee=q.properties)!=null&&ee.width&&j.configuratorParams.width>q.properties.width&&(j.configuratorParams.width=q.properties.width),(ue=q.properties)!=null&&ue.length&&j.configuratorParams.length>q.properties.length&&(j.configuratorParams.length=q.properties.length)),s("item-reset",V),s("update:value",c.value)},H=(V,j)=>{c.value[V].marker=j===null||j===""?void 0:j,s("item-reset",V),s("update:value",c.value)},L=V=>{c.value.forEach(j=>{j.isAdditionalSale=V}),s("update:value",c.value)},M=()=>{c.value.push(Z()),s("update:value",c.value),s("add-item",c.value.length),i.nextTick(()=>{var j,q,ee,ue;const V=c.value.length-1;(q=(j=a.value)==null?void 0:j[V])==null||q.focus(),(ue=(ee=a.value)==null?void 0:ee[V])==null||ue.select()})},O=V=>{c.value.splice(V,1),s("update:value",c.value),s("remove-item",V)};i.watch(()=>r.value,V=>{var ue;const q=(V==null?[]:I.cloneDeep(i.toRaw(V))).map(ve=>new K.OrderItemBase(ve));c.value=q.length>0?q:[Z()];const ee=(ue=c.value[0])==null?void 0:ue.product;ee&&!ee.isNewRec()?(f.value=ee,g.value=ee.id):(f.value=null,g.value=null)},{deep:!0});const Y=()=>{var j;if(f.value!==null)return;const V=(j=m.value[0])==null?void 0:j.id;V!=null&&te(V)};return i.watch(m,()=>{Y()}),i.onMounted(()=>{var j;c.value.length===0&&(c.value=[Z()]);const V=(j=c.value[0])==null?void 0:j.product;V&&!V.isNewRec()&&(f.value=V,g.value=V.id),Y()}),e({validate:(U=o.value)==null?void 0:U.validate,formReference:o}),(V,j)=>{const q=x0,ee=zr,ue=Pd;return i.withDirectives((i.openBlock(),i.createBlock(i.unref(z.NForm),{ref:"form-reference",model:d.value,rules:B.value,class:"flex flex-col gap-2 sc-hide-empty-feedback-message"},{default:i.withCtx(()=>{var ve,Te;return[i.createVNode(i.unref(z.NFormItem),{required:!0,"show-feedback":!1,label:"Товар"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NSelect),{value:g.value,"onUpdate:value":[j[0]||(j[0]=He=>g.value=He),te],options:p.value,placeholder:"Выберите материал",filterable:""},null,8,["value","options"])]),_:1}),((ve=f.value)==null?void 0:ve.costRub)!=null?(i.openBlock(),i.createElementBlock("div",k0,[i.createElementVNode("span",v0,i.toDisplayString(f.value.code),1),i.createTextVNode(" — "+i.toDisplayString(f.value.costRub.toLocaleString())+" "+i.toDisplayString(f.value.currency.symbol)+"/м² ",1)])):i.createCommentVNode("",!0),i.createElementVNode("div",C0,[f.value?(i.openBlock(),i.createElementBlock("div",S0,[j[6]||(j[6]=i.createElementVNode("div",{class:"w-full font-bold"},"Размеры изделий",-1)),i.createElementVNode("div",B0,[b.value?(i.openBlock(),i.createElementBlock("div",T0,"Ширина "+i.toDisplayString(b.value)+".",1)):i.createCommentVNode("",!0),_.value?(i.openBlock(),i.createElementBlock("div",$0,"Длина "+i.toDisplayString(_.value)+".",1)):i.createCommentVNode("",!0)])])):i.createCommentVNode("",!0),i.createElementVNode("div",N0,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(d.value.items,(He,ce)=>{var mt;return i.openBlock(),i.createElementBlock("div",{key:ce,class:i.normalizeClass(["flex min-w-0 items-start gap-2 border-b border-gray-100 last:border-0",k(ce)?"opacity-70":""])},[i.createElementVNode("div",R0,[i.createElementVNode("div",P0,[i.createElementVNode("div",E0,[i.createVNode(i.unref(z.NFormItem),{path:`items.${ce}.configuratorParams.width`,label:"Ширина, мм",class:"min-w-0"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInputNumber),{ref_for:!0,ref:"widthInputs",value:d.value.items[ce].configuratorParams.width,"onUpdate:value":[$e=>d.value.items[ce].configuratorParams.width=$e,$e=>D(ce)],parse:i.unref(lt),"show-button":!1,disabled:!f.value||k(ce)||T(ce),placeholder:"Ширина",class:"w-full",onKeydown:j[1]||(j[1]=$e=>i.unref(tt)($e)),onInput:$e=>h(`items.${ce}.width`),onFocus:i.unref(Le)},null,8,["value","onUpdate:value","parse","disabled","onInput","onFocus"])]),_:2},1032,["path"]),i.createVNode(i.unref(z.NFormItem),{path:`items.${ce}.configuratorParams.length`,label:"Длина, мм",class:"min-w-0"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInputNumber),{value:d.value.items[ce].configuratorParams.length,"onUpdate:value":[$e=>d.value.items[ce].configuratorParams.length=$e,$e=>D(ce)],parse:i.unref(lt),"show-button":!1,disabled:!f.value||k(ce)||T(ce),placeholder:"Длина",class:"w-full",onKeydown:j[2]||(j[2]=$e=>i.unref(tt)($e)),onInput:$e=>h(`items.${ce}.length`),onFocus:i.unref(Le)},null,8,["value","onUpdate:value","parse","disabled","onInput","onFocus"])]),_:2},1032,["path"])]),i.createElementVNode("div",F0,[i.createVNode(i.unref(z.NFormItem),{path:`items.${ce}.quantity`,label:"Количество, шт",class:"min-w-0"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInputNumber),{value:d.value.items[ce].quantity,"onUpdate:value":[$e=>d.value.items[ce].quantity=$e,$e=>D(ce)],parse:i.unref(lt),"show-button":!1,disabled:!f.value||k(ce)||T(ce),placeholder:"Кол-во",class:"w-full",onKeydown:j[3]||(j[3]=$e=>i.unref(tt)($e,!1)),onInput:$e=>h(`items.${ce}.quantity`),onFocus:i.unref(Le)},null,8,["value","onUpdate:value","parse","disabled","onInput","onFocus"])]),_:2},1032,["path"]),i.createVNode(i.unref(z.NFormItem),{path:`items.${ce}.marker`,label:"Маркировка",class:"min-w-0"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInput),{value:d.value.items[ce].marker??null,disabled:!f.value||k(ce)||T(ce),placeholder:"Маркировка",class:"w-full",onInput:$e=>h(`items.${ce}.marker`),"onUpdate:value":$e=>H(ce,$e??null),onFocus:i.unref(Le)},null,8,["value","disabled","onInput","onUpdate:value","onFocus"])]),_:2},1032,["path"])]),T(ce)||k(ce)?(i.openBlock(),i.createElementBlock("div",V0,[T(ce)?(i.openBlock(),i.createBlock(i.unref(z.NSpin),{key:0,size:14})):k(ce)?(i.openBlock(),i.createBlock(q,{key:1,class:"text-green-600 text-xl"})):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)]),i.createElementVNode("div",I0,[He.configuratorParams.width>0&&He.configuratorParams.length>0?(i.openBlock(),i.createElementBlock("div",A0,[j[7]||(j[7]=i.createTextVNode(" Площадь (S) = ",-1)),i.createElementVNode("span",M0,i.toDisplayString(P(He.configuratorParams).toLocaleString(void 0,{maximumFractionDigits:4}))+" м²",1)])):i.createCommentVNode("",!0),E(He)>0?(i.openBlock(),i.createElementBlock("div",O0,[j[8]||(j[8]=i.createTextVNode(" Итого: ",-1)),i.createElementVNode("span",z0,i.toDisplayString(E(He).toLocaleString())+" "+i.toDisplayString((mt=f.value)==null?void 0:mt.currency.symbol),1)])):i.createCommentVNode("",!0)])]),w.value?i.createCommentVNode("",!0):(i.openBlock(),i.createBlock(i.unref(z.NButton),{key:0,disabled:T(ce)||d.value.items.length<=1,type:"error",size:"medium",class:"mt-5 shrink-0 lg:!ml-4",onClick:$e=>O(ce)},{default:i.withCtx(()=>[i.createVNode(ee)]),_:1},8,["disabled","onClick"]))],2)}),128))]),f.value?(i.openBlock(),i.createElementBlock("div",D0,[W.value>0?(i.openBlock(),i.createElementBlock("div",L0,[j[9]||(j[9]=i.createTextVNode(" Общая площадь: ",-1)),i.createElementVNode("span",H0,i.toDisplayString(W.value.toLocaleString(void 0,{maximumFractionDigits:4}))+" м²",1)])):i.createCommentVNode("",!0),A.value>0?(i.openBlock(),i.createElementBlock("div",W0,[j[10]||(j[10]=i.createTextVNode(" Итого: ",-1)),i.createElementVNode("span",j0,i.toDisplayString(A.value.toLocaleString())+" "+i.toDisplayString(f.value.currency.symbol),1)])):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)]),x.value?(i.openBlock(),i.createBlock(i.unref(z.NCheckbox),{key:1,checked:((Te=c.value[0])==null?void 0:Te.isAdditionalSale)??!1,"true-value":!0,"false-value":!1,"onUpdate:checked":j[4]||(j[4]=He=>L(He??!1))},{default:i.withCtx(()=>[...j[11]||(j[11]=[i.createTextVNode(" ДопПродажа ",-1)])]),_:1},8,["checked"])):i.createCommentVNode("",!0),i.createElementVNode("div",q0,[f.value&&!w.value?(i.openBlock(),i.createBlock(i.unref(z.NButton),{key:0,disabled:N.value,type:"default",onClick:M},{default:i.withCtx(()=>[i.createVNode(ue),j[12]||(j[12]=i.createTextVNode(" Добавить изделие ",-1))]),_:1},8,["disabled"])):i.createCommentVNode("",!0),i.createVNode(i.unref(z.NButton),{loading:t.isSubmitProcessing,disabled:R.value||$.value,type:"primary",class:"ml-auto",onClick:j[5]||(j[5]=He=>s("submit",c.value))},{default:i.withCtx(()=>{var He;return[i.createTextVNode(i.toDisplayString((He=c.value[0])!=null&&He.isNewRec()?"В корзину":"Изменить"),1)]}),_:1},8,["loading","disabled"])])]}),_:1},8,["model","rules"])),[[i.unref(Ua)]])}}}),Y0={class:"flex flex-col gap-2"},U0={class:"min-w-56 max-w-3xl flex grow flex-col px-5"},K0={},Id=i.defineComponent({...K0,__name:"sandwich-m2-configurator",props:{eventEmitter:{},showSlugs:{type:Boolean},showProperties:{type:Boolean},showProductCosts:{type:[Boolean,Function]},allowNameClick:{type:[Boolean,Function]},allowPriceClick:{type:[Boolean,Function]},showPriceHistory:{type:[Boolean,Function]},showCostDate:{type:[Boolean,Function]},isProductItemSelected:{type:Function},showProductAddToCartButton:{type:[Boolean,String,Function]},showProductRequiredButton:{type:[Boolean,String,Function]},showProductEditButton:{type:[Boolean,String,Function]},currencyRates:{},productContextButtonsConfig:{type:Function},settings:{},cartItems:{}},emits:["click:view-switch","submit"],setup(t,{emit:e}){const n=t,r=e,s=i.useTemplateRef("sandwich-m2-configurator-form"),o=i.ref((n.cartItems??[]).map(B=>new K.OrderItemBase(B))),a=i.ref([]),l=i.ref({width:{},length:{},quantity:{},marker:{}}),c=["width","length","quantity","marker"],d=B=>{c.forEach(x=>{l.value[`items.${B}.${x}`]={}})},u=B=>{c.forEach(x=>{delete l.value[`items.${B}.${x}`]})},h=i.computed(()=>a.value.includes("loading")),f=()=>({width:{},length:{},quantity:{},marker:{}}),g=(B,x)=>{let N=!1;return c.forEach(R=>{var P,E;const w=`items.0.${R}`,C=(P=B[R])==null?void 0:P.feedback,T=((E=B[w])==null?void 0:E.feedback)??C,$=`items.${x}.${R}`;T?(l.value[$]=B[w]??B[R],N=!0):l.value[$]={}}),N},m=(B,x,N)=>new Promise(R=>{const w=f();let C=!1;const k=T=>{if(C)return;C=!0;const $=g(w,x),P=(T===void 0?!$:T)&&!$;a.value[x]=P?"success":"error",i.nextTick(()=>{var E,W;(W=(E=s.value)==null?void 0:E.formReference)==null||W.restoreValidation()}),R(P)};a.value[x]="loading",r("submit",[I.cloneDeep(B)],w,k,{isFinalSuccessfulCompletion:N})}),p=async()=>{var N,R;try{await((R=(N=s.value)==null?void 0:N.formReference)==null?void 0:R.validate())}catch{return}const B=o.value.map((w,C)=>C).filter(w=>{const C=a.value[w]??"idle";return C!=="success"&&C!=="loading"});let x=!0;for(let w=0;w<B.length;w+=1){const C=B[w],k=o.value[C];if(!k)break;const $=w===B.length-1&&x;await m(k,C,$)||(x=!1)}},y=B=>{const x=B-1;a.value[x]="idle",d(x)},b=B=>{a.value.splice(B,1),u(B);for(let x=B;x<o.value.length;x+=1)d(x)},_=B=>{const x=a.value[B];(x==="success"||x==="error")&&(a.value[B]="idle")};return i.onMounted(()=>{(n.cartItems??[]).forEach((B,x)=>{a.value[x]="idle",d(x)})}),i.watch(()=>n.cartItems,B=>{const x=(B??[]).map(N=>new K.OrderItemBase(N));o.value=x,a.value=x.map(()=>"idle"),x.forEach((N,R)=>{d(R)})},{deep:!0}),(B,x)=>{var R;const N=z.NButton;return i.openBlock(),i.createElementBlock("div",Y0,[t.settings.allowShowTable&&((R=o.value[0])!=null&&R.isNewRec())?(i.openBlock(),i.createBlock(N,{key:0,type:"tertiary",class:"self-center",onClick:x[0]||(x[0]=w=>r("click:view-switch"))},{default:i.withCtx(()=>[...x[2]||(x[2]=[i.createTextVNode(" Показать в виде списка ",-1)])]),_:1})):i.createCommentVNode("",!0),i.createElementVNode("div",U0,[i.createVNode(Vd,{ref:"sandwich-m2-configurator-form",value:o.value,"onUpdate:value":x[1]||(x[1]=w=>o.value=w),validation:l.value,settings:t.settings,"event-emitter":t.eventEmitter,"is-submit-processing":h.value,"item-states":a.value,onSubmit:p,onAddItem:y,onRemoveItem:b,onItemReset:_},null,8,["value","validation","settings","event-emitter","is-submit-processing","item-states"])])])}}}),G0={key:0,class:"flex justify-center p-4"},Z0={key:1,class:"p-4 text-center text-red-500"},Q0={key:2,class:"flex justify-center"},J0={class:"!bg-white p-4 m-2 rounded-md w-max"},eb={key:3,class:"p-4 text-center text-gray-500"},tb={},Ad=i.defineComponent({...tb,__name:"dynamic-configurator",props:{eventEmitter:{},settings:{},editor:{},cartItem:{},category:{}},setup(t){const e=t,n=i.ref(!1),r=i.ref(null),s=i.ref(e.cartItem??null),o=i.ref(null),a=f=>{const g=f.configuratorParams;return[new K.OrderItemBase({...f,quantity:f.quantity??1,marker:f.marker,configuratorParams:{width:(g==null?void 0:g.width)??f.width??0,length:(g==null?void 0:g.length)??f.length??0}})]},l=i.ref(e.editor===K.ConfiguratorsEnum.SandwichM2&&e.cartItem!=null?a(e.cartItem):null),c=()=>{var g,m,p;if(!e.settings){r.value="Настройки конфигуратора не указаны в свойствах категории.";return}const f={category:((g=e.cartItem)==null?void 0:g.category)??e.category,configurator:e.editor,quantity:1};switch(e.editor){case"kozyrek":{const y=e.settings;s.value=new K.OrderItemBase({...f,configuratorParams:{length:y.stripMinLength,linesAngles:[],linesWidths:[],startTailType:I.some(y.startTailConfigs,b=>b.isDefault)?(m=y.startTailConfigs)==null?void 0:m.findIndex(b=>b.isDefault):void 0,endTailType:I.some(y.endTailConfigs,b=>b.isDefault)?(p=y.endTailConfigs)==null?void 0:p.findIndex(b=>b.isDefault):void 0,colorSide:"top"}});break}case"mosquitto":{const y=e.settings;s.value=new K.OrderItemBase({...f,configuratorParams:{width:0,height:0,netType:y.netType[0]||"",color:y.color[0]||"",mountType:y.mountType[0]||""}});break}case"strip":{const y=e.settings;o.value=[new K.OrderItemBase({...f,length:y.minLength,configuratorParams:{linesWidths:[0]}})];break}case"metal_for_doors":{const y=e.settings;s.value=new K.OrderItemBase({...f,configuratorParams:{width:y.minWidth,length:y.minLength}});break}case"sandwich":{s.value=new K.OrderItemBase({...f,configuratorParams:{calculationId:"",items:[{width:0,length:0,count:1}]}});break}case"sandwich_m2":{l.value=[new K.OrderItemBase({...f,configuratorParams:{width:0,length:0}})];break}default:r.value=`Неподдерживаемый тип конфигуратора: ${e.editor}.`}s.value&&(s.value.marker=void 0)},d=(f,g,m)=>{const p=y=>{m==null||m(),y&&c()};e.eventEmitter.emit("configurator:submit",{cartItem:f,callback:p,validation:g})},u=(f,g,m,p)=>{const y=f[0];if(!y){m==null||m();return}const b=(p==null?void 0:p.isFinalSuccessfulCompletion)===!0,_=B=>{m==null||m(B),b&&B&&c()};e.eventEmitter.emit("configurator:submit",{cartItem:y,callback:_,validation:g,additionalParams:p})},h=()=>{e.category&&e.eventEmitter.emit("configurator:click-view-switch",{category:e.category})};return i.onMounted(()=>{e.cartItem||c()}),(f,g)=>{const m=z.NSpin;return i.openBlock(),i.createElementBlock(i.Fragment,null,[n.value?(i.openBlock(),i.createElementBlock("div",G0,[i.createVNode(m,{size:"large"})])):r.value?(i.openBlock(),i.createElementBlock("div",Z0,i.toDisplayString(r.value),1)):i.createCommentVNode("",!0),t.settings!==null&&(s.value!==null||o.value!==null||l.value!==null)?(i.openBlock(),i.createElementBlock("div",Q0,[i.createElementVNode("div",J0,[t.editor==="kozyrek"?(i.openBlock(),i.createBlock(xd,{key:0,"event-emitter":t.eventEmitter,settings:t.settings,"cart-item":s.value,"onClick:viewSwitch":h,onSubmit:d},null,8,["event-emitter","settings","cart-item"])):t.editor==="mosquitto"?(i.openBlock(),i.createBlock(Cd,{key:1,"event-emitter":t.eventEmitter,settings:t.settings,"cart-item":s.value,onSubmit:d},null,8,["event-emitter","settings","cart-item"])):t.editor==="strip"?(i.openBlock(),i.createBlock($d,{key:2,"event-emitter":t.eventEmitter,settings:t.settings,"cart-items":o.value,"onClick:viewSwitch":h,onSubmit:d},null,8,["event-emitter","settings","cart-items"])):t.editor==="metal_for_doors"?(i.openBlock(),i.createBlock(Rd,{key:3,"event-emitter":t.eventEmitter,settings:t.settings,"cart-item":s.value,"onClick:viewSwitch":h,onSubmit:d},null,8,["event-emitter","settings","cart-item"])):t.editor==="sandwich"?(i.openBlock(),i.createBlock(Fd,{key:4,"event-emitter":t.eventEmitter,settings:t.settings,"cart-item":s.value,"onClick:viewSwitch":h,onSubmit:d},null,8,["event-emitter","settings","cart-item"])):t.editor==="sandwich_m2"?(i.openBlock(),i.createBlock(Id,{key:5,"event-emitter":t.eventEmitter,settings:t.settings,"cart-items":l.value,"onClick:viewSwitch":h,onSubmit:u},null,8,["event-emitter","settings","cart-items"])):i.createCommentVNode("",!0)])])):(i.openBlock(),i.createElementBlock("div",eb,' Конфигуратор "'+i.toDisplayString(t.editor)+'" не поддерживается. ',1))],64)}}});function Md(t){return Object.values(K.ConfiguratorsEnum).includes(t)}function Od(t){var e;return((e=t.properties)==null?void 0:e.configurator)!==K.ConfiguratorsEnum.Sandwich?!0:t.properties.configuratorSettings!==void 0&&I.isArray(t.products)&&t.products.length>0}const nb={key:0,class:"pt-0.5"},ib={key:0},rb={class:"line-through"},sb={key:0},ob={key:1},ab={class:"flex flex-row gap-1"},lb={key:0},cb={class:"m-0 list-inside list-disc p-0 pl-1.5 text-xs text-gray-500"},db={class:"flex flex-col gap-2.5 sm:flex-row"},ub={class:"mt-2"},hb={key:1,class:"flex flex-col"},fb={},mb=i.defineComponent({...fb,__name:"category-collapse-item",props:{categoryItem:{},filteredItems:{},isCategoryItemSelected:{type:[Boolean,String,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},canShowConfigurator:{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(or,"medium"),r=i.computed(()=>{var U;return(U=e==null?void 0:e.filteredItems)==null?void 0:U[e.categoryItem.id]}),s=i.computed(()=>{var U,V;return I.isArray((U=e.categoryItem)==null?void 0:U.categories)&&((V=e.categoryItem.categories)==null?void 0:V.length)>0}),o=i.computed(()=>{var U;return I.isArray((U=e.categoryItem)==null?void 0:U.products)?e.categoryItem.products:[]}),a=i.computed(()=>Object.entries(e.categoryItem.currencyRates??{}).map(([U,V])=>`${V} руб./${$(U)}`).join(", ")),l=i.computed(()=>I.isUndefined(e.filteredItems)||r.value==="*"?o.value:o.value.filter(U=>{var j;const V=(j=r.value)==null?void 0:j.products;return I.isArray(V)&&V.includes(U.id)})),c=i.computed(()=>l.value.length>0),d=i.computed(()=>I.isFunction(e.showCategoryHideForClientButton)?e.showCategoryHideForClientButton(e.categoryItem):e.showCategoryHideForClientButton),u=i.computed(()=>I.isFunction(e.showCategoryPinButton)?e.showCategoryPinButton(e.categoryItem):e.showCategoryPinButton),h=i.computed(()=>I.isFunction(e.showCategoryRequiredButton)?e.showCategoryRequiredButton(e.categoryItem):e.showCategoryRequiredButton),f=i.computed(()=>I.isFunction(e.showCategoryEditButton)?e.showCategoryEditButton(e.categoryItem):e.showCategoryEditButton),g=i.computed(()=>{var U,V,j;return((U=e.categoryItem.properties)==null?void 0:U.configurator)!==void 0&&Md((V=e.categoryItem.properties)==null?void 0:V.configurator)&&Od(e.categoryItem)&&((j=e.categoryItem.properties)==null?void 0:j.configuratorSettings)!==void 0&&(I.isFunction(e.canShowConfigurator)?e.canShowConfigurator():e.canShowConfigurator)}),m=i.computed(()=>g.value&&(I.isFunction(e.showConfigurator)?e.showConfigurator(e.categoryItem):e.showConfigurator)),p=i.computed(()=>I.isNil(e.categoryContextButtonsConfig)?[]:I.isFunction(e.categoryContextButtonsConfig)?e.categoryContextButtonsConfig(e.categoryItem):e.categoryContextButtonsConfig),y=i.computed(()=>new K.ClientCategory(e.categoryItem)),b=i.ref(!1),_=i.ref(!1),B=i.computed(()=>!I.isUndefined(e.isCategoryItemSelected)),x=i.computed(()=>I.isFunction(e.isCategoryItemSelected)?e.isCategoryItemSelected(e.categoryItem):e.isCategoryItemSelected===!0),N=i.computed(()=>I.isFunction(e.isCategoryItemSelected)?e.isCategoryItemSelected(e.categoryItem)==="disabled":e.isCategoryItemSelected==="disabled"),R=i.computed(()=>I.isFunction(e.isCategoryItemSelected)?e.isCategoryItemSelected(e.categoryItem)==="indeterminate":e.isCategoryItemSelected==="indeterminate"),w=i.computed(()=>M.value&&St.getDeviceTypeByResolution()===Qe.laptop?"auto":"fixed"),C=i.useTemplateRef("collapse-item-reference"),k=i.computed(()=>{var U,V;return(V=(U=e.categoryItem.properties)==null?void 0:U.templateCost)==null?void 0:V.priceCoefficient}),T=i.computed(()=>{var U,V;return(V=(U=e.categoryItem.properties)==null?void 0:U.templateCost)==null?void 0:V.increasePercent}),$=(U,V="ru-RU")=>0 .toLocaleString(V,{style:"currency",currency:U,minimumFractionDigits:0,maximumFractionDigits:0}).replaceAll(/\d/g,"").trim(),P=U=>{e.eventEmitter.emit("category:checked",{category:e.categoryItem,checked:U,target:C.value})},E=(U,V)=>{e.eventEmitter.emit("category:header-click",{categoryItem:e.categoryItem,expanded:V,isLoadingState:b,target:C.value})},W=()=>{e.eventEmitter.emit("category:hide",{category:e.categoryItem,target:C.value})},A=()=>{e.eventEmitter.emit("category:required",{category:e.categoryItem,target:C.value})},Z=()=>{e.eventEmitter.emit("category:attach",{category:e.categoryItem,target:C.value})},te=()=>{e.eventEmitter.emit("category:detach",{category:e.categoryItem,target:C.value})},D=()=>{e.eventEmitter.emit("category:edit",{category:e.categoryItem,target:C.value})},H=U=>{e.eventEmitter.emit("category:context-select",{category:e.categoryItem,key:U,target:C.value})},L=()=>{e.eventEmitter.emit("configurator:click-view-switch",{category:e.categoryItem})},M=i.ref(0),O=i.computed(()=>M.value&&o.value.length>0?Wm(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=I.debounce(()=>{M.value=window.innerWidth},20);return i.onUnmounted(()=>{window.removeEventListener("resize",Y)}),window.addEventListener("resize",Y),Y(),(U,V)=>{const j=z.NCheckbox,q=kf,ee=z.NTooltip,ue=_f,ve=z.NTag,Te=pf,He=ff,ce=z.NButton,mt=df,$e=Za,Et=Ga,Wt=Ka,an=Ls,Ct=z.NDropdown,Ln=z.NDataTable,ln=z.NAlert,Jt=z.NSpin;return i.openBlock(),i.createBlock(Qa,{ref:"collapse-item-reference",name:t.categoryItem.id,"data-id":t.categoryItem.id,"onHeader:click":E},{"pre-arrow":i.withCtx(()=>{var Ve,J;return[B.value?(i.openBlock(),i.createElementBlock("div",nb,[i.createVNode(j,{checked:x.value,indeterminate:R.value,disabled:N.value,"onUpdate:checked":P},null,8,["checked","indeterminate","disabled"])])):i.createCommentVNode("",!0),!d.value&&((Ve=y.value)!=null&&Ve.isDisabled)?(i.openBlock(),i.createBlock(ee,{key:1,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(q,{class:"pt-1.5"})]),default:i.withCtx(()=>[V[1]||(V[1]=i.createTextVNode(" Категория скрыта для клиента ",-1))]),_:1})):i.createCommentVNode("",!0),((J=y.value)==null?void 0:J.isFavorite)??!1?(i.openBlock(),i.createBlock(ee,{key:2,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(ue,{class:"pt-1.5"})]),default:i.withCtx(()=>[V[2]||(V[2]=i.createTextVNode(" Избранная категория ",-1))]),_:1})):i.createCommentVNode("",!0)]}),header:i.withCtx(()=>{var Ve,J,le,De,ni;return[i.createElementVNode("div",{class:i.normalizeClass({"text-base font-semibold uppercase":!0,"text-gray-400 line-through":t.categoryItem.isHidden,"text-gray-400":(Ve=y.value)==null?void 0:Ve.isDisabled})},[i.createVNode(ee,{disabled:!t.categoryItem.isHidden,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createElementVNode("span",null,i.toDisplayString(t.categoryItem.name),1)]),default:i.withCtx(()=>[V[3]||(V[3]=i.createTextVNode(" Категория скрыта ",-1))]),_:1},8,["disabled"])],2),i.createElementVNode("div",{class:"w-fit",onClick:V[0]||(V[0]=i.withModifiers((...nt)=>i.unref(I.noop)&&i.unref(I.noop)(...nt),["prevent","stop"]))},[(J=t.categoryItem.properties)!=null&&J.m2Price?(i.openBlock(),i.createBlock(ve,{key:0,size:i.unref(n),class:i.normalizeClass({"!pr-0":((le=t.categoryItem.properties)==null?void 0:le.templateCost)&&t.categoryItem.properties.m2PriceRetail&&T.value}),round:""},{default:i.withCtx(()=>{var nt;return[i.createTextVNode(" Установленная стоимость: "+i.toDisplayString(t.categoryItem.properties.m2Price)+" руб./м2 ",1),(nt=t.categoryItem.properties)!=null&&nt.templateCost&&t.categoryItem.properties.m2PriceRetail&&T.value?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[T.value?(i.openBlock(),i.createBlock(ve,{key:0,type:"success",bordered:!1,size:i.unref(n),class:"ml-2 !pr-0",round:""},{default:i.withCtx(()=>[T.value?(i.openBlock(),i.createElementBlock("span",ib,i.toDisplayString(T.value.toFixed(2))+"%",1)):i.createCommentVNode("",!0),i.createVNode(ve,{size:i.unref(n),round:""},{default:i.withCtx(()=>[i.createElementVNode("span",rb,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"])):(De=t.categoryItem.properties)!=null&&De.templateCost?(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[k.value||T.value?(i.openBlock(),i.createBlock(ve,{key:0,size:i.unref(n),round:""},{default:i.withCtx(()=>{var nt;return[k.value?(i.openBlock(),i.createElementBlock("span",sb,i.toDisplayString((nt=k.value)==null?void 0:nt.name),1)):i.createCommentVNode("",!0),T.value?(i.openBlock(),i.createElementBlock("span",ob,i.toDisplayString(T.value>0?"+":"")+i.toDisplayString(T.value.toFixed(2))+"%",1)):i.createCommentVNode("",!0)]}),_:1},8,["size"])):i.createCommentVNode("",!0)],64)):i.createCommentVNode("",!0),a.value?(i.openBlock(),i.createBlock(ve,{key:2,size:i.unref(n),round:""},{default:i.withCtx(()=>[i.createTextVNode(" Фиксированный курс: "+i.toDisplayString(a.value),1)]),_:1},8,["size"])):i.createCommentVNode("",!0),u.value&&((ni=y.value)!=null&&ni.manager)?(i.openBlock(),i.createBlock(ve,{key:3,size:i.unref(n),closable:!0,round:"",class:"align-bottom",onClose:te},{default:i.withCtx(()=>[i.createVNode(ee,{placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>{var nt,jt;return[i.createElementVNode("span",ab,[i.createVNode(Te),i.createTextVNode(" "+i.toDisplayString((jt=(nt=y.value)==null?void 0:nt.manager)==null?void 0:jt.name),1)])]}),default:i.withCtx(()=>{var nt,jt;return[i.createTextVNode(' Категория закреплена за "'+i.toDisplayString((jt=(nt=y.value)==null?void 0:nt.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",lb,[i.createElementVNode("ul",cb,[t.showSlugs?(i.openBlock(!0),i.createElementBlock(i.Fragment,{key:0},i.renderList({id:t.categoryItem.id,slug:t.categoryItem.slug},(Ve,J)=>(i.openBlock(),i.createElementBlock("li",{key:J}," ("+i.toDisplayString(J)+"): "+i.toDisplayString(Ve),1))),128)):i.createCommentVNode("",!0),t.showProperties?(i.openBlock(!0),i.createElementBlock(i.Fragment,{key:1},i.renderList(t.categoryItem.properties,(Ve,J)=>(i.openBlock(),i.createElementBlock("li",{key:J}," ("+i.toDisplayString(J)+"): "+i.toDisplayString(Ve),1))),128)):i.createCommentVNode("",!0)])])):i.createCommentVNode("",!0)]),"header-extra":i.withCtx(()=>{var Ve;return[i.createElementVNode("div",db,[d.value?(i.openBlock(),i.createBlock(ee,{key:0,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(ce,{ghost:!0,size:i.unref(n),onClick:W},{default:i.withCtx(()=>{var J;return[(J=y.value)!=null&&J.isDisabled?(i.openBlock(),i.createBlock(q,{key:1})):(i.openBlock(),i.createBlock(He,{key:0}))]}),_:1},8,["size"])]),default:i.withCtx(()=>{var J;return[(J=y.value)!=null&&J.isDisabled?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[i.createTextVNode(" Скрыто для клиента"+i.toDisplayString(y.value.hidingComment?`. Причина: '${y.value.hidingComment}'`:""),1)],64)):(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[i.createTextVNode("Видимо клиенту")],64))]}),_:1})):i.createCommentVNode("",!0),u.value&&!((Ve=y.value)!=null&&Ve.manager)?(i.openBlock(),i.createBlock(ee,{key:1,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(ce,{ghost:!0,size:i.unref(n),onClick:Z},{default:i.withCtx(()=>[i.createVNode(mt)]),_:1},8,["size"])]),default:i.withCtx(()=>{var J,le,De;return[(J=y.value)!=null&&J.manager?(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[i.createTextVNode('Категория закреплена за "'+i.toDisplayString(((De=(le=y.value)==null?void 0:le.manager)==null?void 0:De.name)??"-")+'"',1)],64)):(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[i.createTextVNode("Закрепить")],64))]}),_:1})):i.createCommentVNode("",!0),h.value?(i.openBlock(),i.createBlock(ee,{key:2,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(ce,{ghost:!0,disabled:h.value==="disabled",size:i.unref(n),onClick:A},{default:i.withCtx(()=>{var J;return[(J=y.value)!=null&&J.isRequired?(i.openBlock(),i.createBlock(Et,{key:1})):(i.openBlock(),i.createBlock($e,{key:0}))]}),_:1},8,["disabled","size"])]),default:i.withCtx(()=>[V[4]||(V[4]=i.createTextVNode(" Категория, которую нужно предлагать клиенту ",-1))]),_:1})):i.createCommentVNode("",!0),f.value?(i.openBlock(),i.createBlock(ee,{key:3,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(ce,{ghost:!0,size:i.unref(n),type:"primary",onClick:D},{default:i.withCtx(()=>[i.createVNode(Wt)]),_:1},8,["size"])]),default:i.withCtx(()=>[V[5]||(V[5]=i.createTextVNode(" Редактировать ",-1))]),_:1})):i.createCommentVNode("",!0),p.value.length>0?(i.openBlock(),i.createBlock(Ct,{key:4,options:p.value,size:i.unref(n),trigger:"click",onSelect:H},{default:i.withCtx(()=>[i.createVNode(ce,{ghost:!0,size:i.unref(n),type:"primary"},{default:i.withCtx(()=>[i.createVNode(an)]),_:1},8,["size"])]),_:1},8,["options","size"])):i.createCommentVNode("",!0)])]}),default:i.withCtx(()=>[i.renderSlot(U.$slots,"default",{},()=>{var Ve,J,le;return[i.createElementVNode("div",ub,[s.value?(i.openBlock(),i.createBlock(Dd,{key:0,"categories-items":t.categoryItem.categories??[],"has-products":c.value||b.value,"event-emitter":t.eventEmitter,"filtered-items":r.value?((Ve=r.value)==null?void 0:Ve.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,"can-show-configurator":t.canShowConfigurator},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","can-show-configurator"])):i.createCommentVNode("",!0)]),g.value&&m.value?(i.openBlock(),i.createBlock(Ad,{key:0,"event-emitter":t.eventEmitter,settings:(J=t.categoryItem.properties)==null?void 0:J.configuratorSettings,editor:(le=t.categoryItem.properties)==null?void 0:le.configurator,category:t.categoryItem},null,8,["event-emitter","settings","editor","category"])):c.value?(i.openBlock(),i.createElementBlock("div",hb,[g.value?(i.openBlock(),i.createBlock(ce,{key:0,color:"#bdbdbd",strong:"",class:"self-end p-2",onClick:L},{default:i.withCtx(()=>[...V[6]||(V[6]=[i.createTextVNode(" Назад в Конфигуратор ",-1)])]),_:1})):i.createCommentVNode("",!0),i.createVNode(Ln,{columns:O.value,data:l.value,bordered:!0,loading:b.value,remote:!0,"row-key":De=>De.id,"table-layout":w.value,class:"mt-2"},null,8,["columns","data","loading","row-key","table-layout"])])):i.createCommentVNode("",!0),!b.value&&!_.value&&!s.value&&!c.value?(i.openBlock(),i.createBlock(ln,{key:2,"show-icon":!0,type:"warning",title:"Категория пуста",class:"mx-10"})):i.createCommentVNode("",!0),_.value?(i.openBlock(),i.createBlock(ln,{key:3,"show-icon":!0,type:"error",title:"При получении данных произошла ошибка",class:"mx-10"})):i.createCommentVNode("",!0),b.value?(i.openBlock(),i.createBlock(Jt,{key:4,size:i.unref(n),class:"w-full"},{description:i.withCtx(()=>[...V[7]||(V[7]=[i.createElementVNode("div",null,"Выполняется загрузка данных ...",-1)])]),_:1},8,["size"])):i.createCommentVNode("",!0)]},!0)]),_:3},8,["name","data-id"])}}}),gb=Wn(mb,[["__scopeId","data-v-607a5aad"]]),pb={class:"sc-collapse flex w-full flex-col"},yb={},zd=i.defineComponent({...yb,__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",pb,[i.renderSlot(o.$slots,"default")]))}}),bb={},Dd=i.defineComponent({...bb,__name:"category-collapse",props:{categoriesItems:{},hasProducts:{type:Boolean},loading:{type:Boolean,default:!1},client:{default:void 0},filteredItems:{default:void 0},isCategoryItemSelected:{type:[Boolean,String,Function],default:void 0},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]},canShowConfigurator:{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:{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(or,"medium"),r=i.computed(()=>I.isUndefined(e.filteredItems)?e.categoriesItems:e.categoriesItems.filter(o=>{var a;return!!((a=e.filteredItems)!=null&&a[o.id])})),s=(o,a)=>{if(I.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(zd,{key:0},{default:i.withCtx(()=>[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(r.value,d=>(i.openBlock(),i.createBlock(gb,{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,"can-show-configurator":t.canShowConfigurator},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","can-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)}}}),_b={},Ld=i.defineComponent({..._b,__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(()=>I.isArray(r.value)),a=new K.Reference,l=i.computed(()=>I.isNil(r.value)?o.value?[]:null:I.isArray(r.value)?r.value.map(g=>g.id):r.value.id),c=i.computed(()=>Vt.convertReferencesToSelectOptionsList(r.referenceList,r.sortOptionsByLabel,!1,r.showEmptyValue)),d=g=>{var m;if(I.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||I.isNil(g)||(m=c.value.find(y=>y.value===g))==null?void 0:m.item;s("update:value",p)}},u=i.useTemplateRef("select-component");return e({focus:()=>{var g;return(g=u.value)==null?void 0:g.focus()},blur:()=>{var g;return(g=u.value)==null?void 0:g.blur()}}),(g,m)=>(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"]))}}),wb={},xb=i.defineComponent({...wb,__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 x,N;const n=t,r=e,s=()=>{const R=K.PriceCoefficient.getRetailPriceCoefficient();return I.unset(R,"isNewRec"),R},o=R=>!R||R.id===s().id,a=i.computed(()=>{var R;return((R=n.catalogItem)==null?void 0:R.type)==="product"}),l=i.computed(()=>a.value?n.catalogItem:void 0),c=R=>{var w,C,k,T;return R.id===s().id?(w=l.value)==null?void 0:w.getRetailCost():(T=(k=(C=l.value)==null?void 0:C.priceCoefficients)==null?void 0:k.find($=>$.coefficient.id===R.id))==null?void 0:T.cost},d=i.computed(()=>{var w;const R=[...((w=K.useReferencesStore().priceCoefficientsReference)==null?void 0:w.map(C=>structuredClone(i.toRaw(C))))??[],s()];return a.value&&R.forEach(C=>{var T;const k=c(C);k?C.name+=` (${k} ${(T=l.value)==null?void 0:T.currency.symbol})`:C.name=""}),R.filter(C=>C.name!=="")}),u=i.ref(n.value.coefficient),h=i.ref(((N=(x=n.value)==null?void 0:x.value)==null?void 0:N.toString())??null),f=i.ref(null),g=i.computed(()=>{var R,w;return(w=(R=l.value)==null?void 0:R.priceCoefficients)==null?void 0:w.find(C=>C.coefficient.slug===K.PriceCoefficientEnum.K0)}),m=i.ref(void 0),p=R=>Number.parseFloat((R??"").replaceAll(/[\s\u00A0\u202F]/g,"").replace(",",".")),y=()=>{var w,C;m.value=void 0;let R=p(h.value);if(R=Number.isNaN(R)?void 0:R,a.value)if(u.value||h.value){const k=s(),T=c(u.value??k)??0,$=T+T*((R??0)/100);f.value=new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:2}).format($),$>(((w=l.value)==null?void 0:w.getRetailCost())??$)&&(m.value={validationStatus:"warning",feedback:"Устанавливается цена выше розничной цены"}),g.value&&$<(((C=g.value)==null?void 0:C.cost)??0)&&(m.value={validationStatus:"warning",feedback:"Устанавливается цена ниже минимальной цены"})}else f.value=null;r("update:value",{value:Number.isNaN(R)?void 0:R,coefficient:o(u.value)?void 0:structuredClone(i.toRaw(u.value))})},b=R=>{I.isArray(R)||I.isNull(R)||(u.value=R,h.value=null,!u.value&&h.value&&(u.value=s()),y())},_=()=>{u.value||(u.value=s()),y()},B=R=>{var C,k,T,$,P;const w=p(R);if(a.value){let E=0;if(w<=0)u.value=void 0,h.value=null;else if(g.value&&w<(((C=g.value)==null?void 0:C.cost)??0))u.value=(k=g.value)==null?void 0:k.coefficient,E=(w-g.value.cost)*100/g.value.cost,m.value={validationStatus:"warning",feedback:"Устанавливается цена ниже минимальной цены"};else if(w>(((T=l.value)==null?void 0:T.getRetailCost())??w)){u.value=s();const W=(($=l.value)==null?void 0:$.getRetailCost())??0;E=(w-W)*100/W,m.value={validationStatus:"warning",feedback:"Устанавливается цена выше розничной цены"}}else{const W=((P=l.value)==null?void 0:P.priceCoefficients)??[],A=I.sortBy(W,[D=>D.cost]),te=A.filter(D=>D.cost<=w).at(-1)??A.at(0);te&&(u.value=te.coefficient,E=(w-te.cost)*100/te.cost),m.value={validationStatus:void 0,feedback:void 0}}h.value=new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:5}).format(E),r("update:value",{value:Number.isNaN(E)?void 0:E,coefficient:o(u.value)?void 0:structuredClone(i.toRaw(u.value))})}else r("update:value",{value:Number.isNaN(w)?void 0:w,coefficient:void 0})};return i.onMounted(()=>{var R,w,C,k;n.calculationType===K.CalculationTypeEnum.m2Cost?f.value=((w=(R=n.value)==null?void 0:R.value)==null?void 0:w.toString())??null:!((C=n.value)!=null&&C.coefficient)&&((k=n.value)!=null&&k.value)&&(u.value=s()),y()}),(R,w)=>{var T,$,P;const C=z.NInput,k=z.NInputGroup;return i.openBlock(),i.createBlock(i.unref(z.NFormItem),{"show-label":!i.unref(I.isNil)(t.label),label:t.label,"show-feedback":!i.unref(I.isNil)(((T=m.value)==null?void 0:T.feedback)??t.feedback),feedback:(($=m.value)==null?void 0:$.feedback)??t.feedback,"validation-status":((P=m.value)==null?void 0:P.validationStatus)??t.validationStatus},{default:i.withCtx(()=>[i.createElementVNode("div",{class:i.normalizeClass([{"sm:grid-cols-3":a.value&&t.calculationType!==i.unref(K.CalculationTypeEnum).m2Cost},"grid w-full grid-cols-1 gap-2"])},[t.calculationType!==i.unref(K.CalculationTypeEnum).m2Cost?(i.openBlock(),i.createBlock(k,{key:0,class:i.normalizeClass(["w-full flex-row",{"sm:col-span-2":a.value}])},{default:i.withCtx(()=>[i.createVNode(Ld,{class:"w-full min-w-0 flex-1",value:u.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(C,{value:h.value,"onUpdate:value":[w[0]||(w[0]=E=>h.value=E),_],clearable:t.clearable,disabled:t.disabled,placeholder:"",class:"w-full min-w-0 flex-1"},i.createSlots({suffix:i.withCtx(()=>[w[3]||(w[3]=i.createTextVNode("%",-1))]),_:2},[h.value&&!h.value.startsWith("-")?{name:"prefix",fn:i.withCtx(()=>[w[2]||(w[2]=i.createTextVNode(" + ",-1))]),key:"0"}:void 0]),1032,["value","clearable","disabled"])]),_:1},8,["class"])):i.createCommentVNode("",!0),a.value||t.calculationType===i.unref(K.CalculationTypeEnum).m2Cost?(i.openBlock(),i.createBlock(C,{key:1,value:f.value,"onUpdate:value":[w[1]||(w[1]=E=>f.value=E),B],clearable:t.clearable,disabled:t.disabled,placeholder:"Стоимость",class:"w-full"},i.createSlots({_:2},[a.value?{name:"suffix",fn:i.withCtx(()=>{var E;return[i.createTextVNode(i.toDisplayString((E=l.value)==null?void 0:E.currency.symbol),1)]}),key:"0"}:void 0]),1032,["value","clearable","disabled"])):i.createCommentVNode("",!0)],2)]),_:1},8,["show-label","label","show-feedback","feedback","validation-status"])}}}),kb={key:0,class:"flex flex-row gap-2.5"},vb={key:1,class:"flex flex-row flex-wrap justify-end gap-2.5"},Cb={},Hd=i.defineComponent({...Cb,__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}})},modalWidth:{default:void 0},processing:{type:Boolean,default:!1},valid:{type:Boolean,default:!0},acceptButton:{default:()=>({show:!0,text:"ОК"})},cancelButton:{default:()=>({show:!0,text:"Отмена"})},trapFocus:{type:Boolean,default:!0}},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=St.initRefDependingOnDeviceResolution(r.sizes.phone.size,r.sizes.tablet.size,r.sizes.default.size),c=St.initRefDependingOnDeviceResolution(r.sizes.phone.scale,r.sizes.tablet.scale,r.sizes.default.scale),d=i.computed(()=>r.modalWidth??window.innerWidth*c.value),u=()=>{s("opening"),o.value=!0,s("update:show",o.value)},h=(g="other")=>{if(a.value){s("processing:cancel",b=>{a.value=b});return}let m=!1;s("closing",g,()=>{m=!0}),m||(o.value=!1,s("update:show",o.value))},f=()=>{s("accept",m=>{a.value=m})};return i.watch(()=>r.show,g=>{g?u():h("other")}),i.watch(()=>r.processing,g=>{a.value=g}),e({open:u,close:h,acceptHandler:f}),(g,m)=>{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,"trap-focus":t.trapFocus??!0,"action-class":g.$slots["extra-action"]?"grid grid-cols-2 !justify-between":void 0,preset:"dialog",onClose:m[1]||(m[1]=b=>h("header")),onEsc:m[2]||(m[2]=b=>h("esc")),onMaskClick:m[3]||(m[3]=b=>h("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",kb,[i.renderSlot(g.$slots,"extra-action")])):i.createCommentVNode("",!0),g.$slots.action||t.acceptButton.show||t.cancelButton.show?(i.openBlock(),i.createElementBlock("div",vb,[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:f},{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:m[0]||(m[0]=b=>h("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","trap-focus","action-class"])}}}),Sb={class:"text-sm"},Bb={},Tb=i.defineComponent({...Bb,__name:"add-product-to-cart-dialog",emits:["submit"],setup(t,{expose:e,emit:n}){const r=i.useTemplateRef("form-reference"),s=i.useTemplateRef("base-dialog-reference"),o=i.ref(null),a=i.computed(()=>{var w,C,k;return((w=o.value)==null?void 0:w.unit.isLinear)&&((k=(C=o.value)==null?void 0:C.properties)==null?void 0:k.isLengthConfigurator)}),l=i.ref(void 0),c=i.ref(void 0),d=i.ref(!0),u=i.ref(null),h=n,f=()=>({length:{},quantity:{},marker:{}}),g=i.ref(f()),m=i.ref(!1),p=i.computed(()=>{var $,P,E,W;if(!o.value)return{};const w=K.UnitsHelper.getProductLengthMultiplicity(o.value),C=K.UnitsHelper.getProductMultiplicity(o.value),k=((P=($=o.value)==null?void 0:$.properties)==null?void 0:P.minLength)||w,T=(W=(E=o.value)==null?void 0:E.properties)==null?void 0:W.maxLength;return{length:[ae.required,ae.min(k??.1),ae.max(T),ae.step(w),We.serverValidation(g.value.length.feedback)],quantity:[ae.required,ae.min(C),ae.step(C),We.serverValidation(g.value.quantity.feedback)],marker:[We.serverValidation(g.value.marker.feedback)]}}),y=i.computed(()=>{var w,C,k;return o.value?((w=o.value.properties)==null?void 0:w.lengthStep)??((C=o.value.properties)!=null&&C.ignoreMinCountCheck?0:((k=o.value.properties)==null?void 0:k.minCount)??0):0}),b=i.computed(()=>{var k,T,$,P,E,W,A,Z,te;if(!o.value)return"";const w=((T=(k=o.value)==null?void 0:k.properties)==null?void 0:T.minLength)??((P=($=o.value)==null?void 0:$.properties)!=null&&P.ignoreMinCountCheck?0:(W=(E=o.value)==null?void 0:E.properties)==null?void 0:W.minCount),C=(Z=(A=o.value)==null?void 0:A.properties)==null?void 0:Z.maxLength;return w||C?`(${w?`от ${w}`:""}${w&&C?" ":""}${C?`до ${C}`:""} ${(te=o.value)==null?void 0:te.unit.name})`:""}),_=w=>{var P,E;if(!((E=(P=o.value)==null?void 0:P.properties)!=null&&E.isLengthConfigurator)||!u.value||I.isNil(w)||y.value===0)return;const C=w/y.value,k=Math.round(C),T=K.UnitsHelper.getProductMultiplicity(o.value),$=Math.max(k,T);u.value.quantity=$},B=w=>{var $,P,E,W;if(!((P=($=o.value)==null?void 0:$.properties)!=null&&P.isLengthConfigurator)||!u.value||I.isNil(w)||y.value===0)return;const C=w*y.value,k=((E=o.value.properties)==null?void 0:E.minLength)||K.UnitsHelper.getProductLengthMultiplicity(o.value),T=(W=o.value.properties)==null?void 0:W.maxLength;k!==void 0&&C<k?u.value.length=k:T!==void 0&&C>T?u.value.length=T:u.value.length=C},x=async w=>{var k;const C=I.cloneDeep(u.value);try{await((k=r.value)==null?void 0:k.validate(T=>{if(!T){if(!o.value||!C)return;K.UnitsHelper.productIsMeasurable(o.value)||delete C.length,a.value&&y.value&&(C.length=y.value),m.value=!0,h("submit",C,g.value,()=>{m.value=!1,w(!1),i.nextTick(()=>{var $;($=r.value)==null||$.validate(I.noop).catch(I.noop)})})}}))}catch{}},N=()=>{o.value=null,l.value=void 0,u.value=null,g.value=f()};return e({show:(w,C)=>{var k,T,$,P,E;if(o.value=w,l.value=C==null?void 0:C.cartItemData,c.value=C==null?void 0:C.orderId,d.value=(C==null?void 0:C.canSetDopProdaga)??!1,u.value=new K.OrderItemBase((C==null?void 0:C.cartItemData)??new K.OrderItemBase({product:w,quantity:K.UnitsHelper.productIsMeasurable(o.value)?1:((k=w==null?void 0:w.properties)==null?void 0:k.minCount)??1,length:((T=w==null?void 0:w.properties)==null?void 0:T.minLength)||(($=w==null?void 0:w.properties)!=null&&$.ignoreMinCountCheck?0:(P=w==null?void 0:w.properties)==null?void 0:P.minCount)||0})),(E=w==null?void 0:w.properties)!=null&&E.isLengthConfigurator&&u.value&&y.value>0){const W=y.value,A=u.value.quantity||1;u.value.length=A*W}},closeDialog:N}),(w,C)=>{var E;const k=z.NFormItem,T=z.NInputGroupLabel,$=z.NInputGroup,P=z.NCheckbox;return i.openBlock(),i.createBlock(Hd,{ref:"base-dialog-reference",show:!i.unref(I.isNil)(o.value)&&!i.unref(I.isNil)(u.value),title:`${l.value?"Изменение":"Добавление"} товара ${(E=o.value)==null?void 0:E.name} в ${c.value?` заказ №${c.value}`:"корзину"}`,"accept-button":{show:!0,text:l.value?"Изменить":"Добавить"},processing:m.value,"modal-width":500,onAccept:x,onClosing:N},{default:i.withCtx(()=>{var W;return[o.value&&u.value?(i.openBlock(),i.createBlock(i.unref(z.NForm),{key:0,ref:"form-reference",model:u.value,rules:p.value,class:"flex flex-col gap-2 sc-hide-empty-feedback-message",onKeydown:i.withKeys(i.withModifiers((W=s.value)==null?void 0:W.acceptHandler,["prevent"]),["enter"])},{default:i.withCtx(()=>[i.unref(K.UnitsHelper).productIsMeasurable(o.value)?(i.openBlock(),i.createBlock(k,{key:0,path:"length",label:`Метраж, ${b.value+o.value.unit.name}`},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInputNumber),{value:u.value.length,"onUpdate:value":[C[0]||(C[0]=A=>u.value.length=A),_],parse:i.unref(lt),"show-button":!1,placeholder:"Введите метраж",class:"w-full",onKeydown:C[1]||(C[1]=A=>i.unref(Ds)(A,".",!1)),onInput:C[2]||(C[2]=A=>i.unref(et)(g.value,"length")),onFocus:i.unref(Le)},null,8,["value","parse","onFocus"])]),_:1},8,["label"])):i.createCommentVNode("",!0),i.createVNode(k,{path:"quantity",label:"Количество, шт."},{default:i.withCtx(()=>[i.createVNode($,null,i.createSlots({default:i.withCtx(()=>[i.createVNode(i.unref(z.NInputNumber),{value:u.value.quantity,"onUpdate:value":[C[3]||(C[3]=A=>u.value.quantity=A),B],parse:i.unref(lt),step:i.unref(K.UnitsHelper).getProductMultiplicity(o.value),"show-button":!1,placeholder:"Введите количество",class:"w-full",onKeydown:C[4]||(C[4]=A=>i.unref(Ds)(A,".",!1)),onInput:C[5]||(C[5]=A=>i.unref(et)(g.value,"quantity")),onFocus:i.unref(Le)},null,8,["value","parse","step","onFocus"]),a.value?(i.openBlock(),i.createBlock(T,{key:0,class:"bg-orange-100 font-bold"},{default:i.withCtx(()=>[i.createTextVNode(" x "+i.toDisplayString(y.value)+" "+i.toDisplayString(o.value.unit.name),1)]),_:1})):i.createCommentVNode("",!0)]),_:2},[!g.value.quantity.feedback&&i.unref(K.UnitsHelper).getProductMultiplicity(o.value)!==1?{name:"feedback",fn:i.withCtx(()=>[i.createElementVNode("span",Sb,"Количество должно быть кратно "+i.toDisplayString(i.unref(K.UnitsHelper).getProductMultiplicity(o.value)),1)]),key:"0"}:void 0]),1024)]),_:1}),i.unref(K.UnitsHelper).productIsMeasurable(o.value)?(i.openBlock(),i.createBlock(k,{key:1,path:"marker",label:"Маркировка"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInput),{value:u.value.marker??null,placeholder:"Введите маркировку",onInput:C[6]||(C[6]=A=>i.unref(et)(g.value,"marker")),"onUpdate:value":C[7]||(C[7]=A=>u.value.marker=A??null),onFocus:i.unref(Le)},null,8,["value","onFocus"])]),_:1})):i.createCommentVNode("",!0),d.value?(i.openBlock(),i.createBlock(P,{key:2,checked:u.value.isAdditionalSale,"onUpdate:checked":C[8]||(C[8]=A=>u.value.isAdditionalSale=A),"true-value":!0,"false-value":!1},{default:i.withCtx(()=>[...C[9]||(C[9]=[i.createTextVNode(" ДопПродажа ",-1)])]),_:1},8,["checked"])):i.createCommentVNode("",!0)]),_:1},8,["model","rules","onKeydown"])):i.createCommentVNode("",!0)]}),_:1},8,["show","title","accept-button","processing"])}}}),$b={class:"flex flex-row gap-1"},Nb={class:"sc-client-name flex flex-col gap-1 text-base"},Rb=["href"],Pb={key:1,class:"text-sc-grey"},Eb={key:0,class:"text-sc-dark-grey sc-client-city text-sm"},Fb={key:0},Vb={key:1,class:"text-sm"},Ib={},pr=i.defineComponent({...Ib,__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?Tn.format(n.client.lastLoginAt,K.useBaseConfigStateStore().config.dateFormats.uiDateWithTime):""),o=a=>{I.isNil(n.nameLink)&&(a.preventDefault(),a.stopPropagation()),r("click:client-name",n.client,a)};return(a,l)=>{const c=Hs,d=z.NButton,u=z.NPopover;return i.openBlock(),i.createElementBlock("div",$b,[t.showClientInfoIcon?(i.openBlock(),i.createBlock(d,{key:0,quaternary:"",size:"small",onClick:l[0]||(l[0]=h=>a.$emit("click:client-info",t.client))},{default:i.withCtx(()=>[i.createVNode(c)]),_:1})):i.createCommentVNode("",!0),i.createVNode(u,{disabled:i.unref(I.isNil)(t.popoverPosition),placement:t.popoverPosition},{trigger:i.withCtx(()=>[i.createElementVNode("div",Nb,[i.createElementVNode("a",{href:t.nameLink??"#",class:"text-base no-underline",onClick:l[1]||(l[1]=h=>o(h))},[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",Pb," [ Деактивирован ] "))],8,Rb),t.showCityAndRegion&&t.client.city?(i.openBlock(),i.createElementBlock("span",Eb," г. "+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",Fb,i.toDisplayString(t.client.alternativeName),1)):i.createCommentVNode("",!0),s.value?(i.openBlock(),i.createElementBlock("span",Vb," Последний вход: "+i.toDisplayString(s.value),1)):i.createCommentVNode("",!0),i.renderSlot(a.$slots,"popover-content")]),_:3},8,["disabled","placement"])])}}}),Ab={class:"text-base"},Mb={},Wd=i.defineComponent({...Mb,__name:"contragent-with-short-info",props:{contragent:{}},setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock("span",Ab,i.toDisplayString(t.contragent.name),1))}}),Ob={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function zb(t,e){return i.openBlock(),i.createElementBlock("svg",Ob,[...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 Db=i.markRaw({name:"tabler-mail",render:zb}),Lb=["href"],Hb={},Wb=i.defineComponent({...Hb,__name:"email",props:{email:{default:""},showEmailIcon:{type:Boolean,default:!1}},setup(t){return(e,n)=>{const r=Db;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,Lb)],2)}}}),jb={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function qb(t,e){return i.openBlock(),i.createElementBlock("svg",jb,[...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 jd=i.markRaw({name:"fa6-brands-viber",render:qb}),Xb={viewBox:"0 0 256 258",width:"1.2em",height:"1.2em"},Yb=["id"],Ub=["id"],Kb=["fill"],Gb=["fill"];function Zb(t,e){return i.openBlock(),i.createElementBlock("svg",Xb,[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,Yb),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,Ub)]),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,Kb),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,Gb),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 qd=i.markRaw({name:"logos-whatsapp-icon",render:Zb,setup(){const t=()=>Math.random().toString(36).substr(2,10);return{idMap:{SVGBRLHCcSy:"uicons-"+t(),SVGHW6lecxh:"uicons-"+t()}}}}),Qb={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"},Jb=["id"],e_=["fill"];function t_(t,e){return i.openBlock(),i.createElementBlock("svg",Qb,[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,Jb)]),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,e_),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 Xd=i.markRaw({name:"logos-telegram",render:t_,setup(){return{idMap:{SVGuySfwdaH:"uicons-"+Math.random().toString(36).substr(2,10)}}}}),n_={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function i_(t,e){return i.openBlock(),i.createElementBlock("svg",n_,[...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 Yd=i.markRaw({name:"ion-call",render:i_}),r_={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function s_(t,e){return i.openBlock(),i.createElementBlock("svg",r_,[...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 o_=i.markRaw({name:"tabler-phone-call",render:s_}),a_={key:0,class:"absolute left-0 top-0 flex w-full flex-row items-center justify-around text-center backdrop-blur-sm"},l_=["href"],c_=["href"],d_=["href"],u_=["href"],h_={},f_=i.defineComponent({...h_,__name:"phone",props:{defaultCountry:{},phone:{default:""},showPhoneIcon:{type:Boolean,default:!1}},setup(t){const e=t,n=i.computed(()=>{try{return e.phone?sr.parsePhoneNumberWithError(e.phone,e.defaultCountry):void 0}catch{}return e.phone}),r=i.computed(()=>{var l;return I.isString(n.value)?!1:((l=n.value)==null?void 0:l.isValid())??!1}),s=i.computed(()=>{var l;return I.isString(n.value)?n.value:((l=n.value)==null?void 0:l.format("INTERNATIONAL"))??""}),o=i.computed(()=>{var l;return I.isString(n.value)?n.value:((l=n.value)==null?void 0:l.format("E.164"))??""}),a=i.ref(!1);return(l,c)=>{const d=o_,u=Yd,h=Xd,f=qd,g=jd;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]=m=>a.value=!a.value),onFocusout:c[1]||(c[1]=m=>a.value=!1),onMouseleave:c[2]||(c[2]=m=>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",a_,[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(u)],8,l_)):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(h)],8,c_)):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(f)],8,d_)):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,u_)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)],34)])}}}),m_={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function g_(t,e){return i.openBlock(),i.createElementBlock("svg",m_,[...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 p_=i.markRaw({name:"mdi-envelope",render:g_}),y_={class:"flex flex-col gap-1"},b_={key:0,class:"mb-2 flex flex-col text-base"},__={key:0,class:"text-sc-dark-grey text-sm"},w_={key:1,class:"whitespace-nowrap text-sm"},x_={key:2,class:"whitespace-nowrap text-sm"},k_={key:3,class:"absolute left-0 top-0 flex size-full items-center justify-around rounded-md text-center text-2xl backdrop-blur-sm"},v_=["href"],C_=["href"],S_=["href"],B_=["href"],T_=["href"],$_={key:0,class:"flex flex-col text-base"},N_={key:0,class:"text-sc-dark-grey text-sm"},R_={key:1,class:"mt-2 text-sm"},P_={key:0,class:"-mt-1"},E_={},F_=i.defineComponent({...E_,__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?sr.parsePhoneNumberWithError(e.contact.phone,e.defaultCountry):void 0}catch{}return e.contact.phone}),r=i.computed(()=>{var c;return I.isString(n.value)?!1:((c=n.value)==null?void 0:c.isValid())??!1}),s=i.computed(()=>{var c;return I.isString(n.value)?n.value:((c=n.value)==null?void 0:c.format("INTERNATIONAL"))??""}),o=i.computed(()=>{var c;return I.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 u=Yd,h=Xd,f=qd,g=jd,m=p_,p=z.NPopover;return i.openBlock(),i.createElementBlock("div",y_,[i.createVNode(p,{disabled:t.fullView,placement:"bottom"},{trigger:i.withCtx(()=>{var _,B,x,N;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]=R=>l.value=!0),onFocusin:d[1]||(d[1]=R=>l.value=!0),onMouseleave:d[2]||(d[2]=R=>l.value=!1),onFocusout:d[3]||(d[3]=R=>l.value=!1)},[i.createElementVNode("div",null,[t.fullView&&(t.contact.name||(B=t.contact)!=null&&B.position)?(i.openBlock(),i.createElementBlock("div",b_,[i.createTextVNode(i.toDisplayString(t.contact.name)+" ",1),(x=t.contact)!=null&&x.position?(i.openBlock(),i.createElementBlock("span",__,i.toDisplayString((N=t.contact)==null?void 0:N.position),1)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0),t.contact.phone?(i.openBlock(),i.createElementBlock("div",w_,i.toDisplayString(s.value),1)):i.createCommentVNode("",!0),t.contact.email?(i.openBlock(),i.createElementBlock("div",x_,i.toDisplayString(t.contact.email),1)):i.createCommentVNode("",!0),a.value&&l.value?(i.openBlock(),i.createElementBlock("div",k_,[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(u)],8,v_)):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(h)],8,C_)):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(f)],8,S_)):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,B_)):i.createCommentVNode("",!0),t.contact.email?(i.openBlock(),i.createElementBlock("a",{key:4,href:`mailto:${t.contact.email}`,class:"hover:text-3xl"},[i.createVNode(m)],8,T_)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)])],38)]}),default:i.withCtx(()=>{var _,B,x,N;return[t.contact.name?(i.openBlock(),i.createElementBlock("div",$_,[i.createTextVNode(i.toDisplayString(t.contact.name)+" ",1),(_=t.contact)!=null&&_.position?(i.openBlock(),i.createElementBlock("span",N_,i.toDisplayString((B=t.contact)==null?void 0:B.position),1)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0),(x=t.contact)!=null&&x.comment?(i.openBlock(),i.createElementBlock("div",R_,[d[4]||(d[4]=i.createElementVNode("sup",null,"**",-1)),i.createTextVNode(" "+i.toDisplayString((N=t.contact)==null?void 0:N.comment),1)])):i.createCommentVNode("",!0)]}),_:1},8,["disabled"]),t.fullView&&((y=t.contact)!=null&&y.comment)?(i.openBlock(),i.createElementBlock("div",P_,[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)])}}});class V_{constructor(e){S(this,"minHeight");S(this,"maxHeights");S(this,"minWidth");S(this,"maxWidths");S(this,"netType");S(this,"color");S(this,"mountType");S(this,"descriptions");S(this,"crossbarCount");S(this,"heightOverlaps");S(this,"widthOverlaps");S(this,"canSetDopProdaga");this.color=e.color,this.crossbarCount=e.crossbarCount,this.descriptions=zs.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=zs.objectToSnake(e.heightOverlaps),this.widthOverlaps=zs.objectToSnake(e.widthOverlaps),this.canSetDopProdaga=e.canSetDopProdaga}}function I_(t){var e;return((e=t.properties)==null?void 0:e.configurator)!==K.ConfiguratorsEnum.SandwichM2?!0:t.properties.configuratorSettings!==void 0&&I.isArray(t.products)&&t.products.length>0}const A_={class:"flex flex-wrap gap-2"},M_={class:"flex flex-col"},O_={class:"flex flex-col"},z_={},D_=i.defineComponent({...z_,__name:"date-range",props:{clearable:{type:Boolean,default:!0},dateRange:{default:void 0},dateFormat:{default:()=>K.useBaseConfigStateStore().config.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 I.forOwn(K.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?Tn.startOfDay(new Date(a)):void 0,to:l?Tn.endOfDay(new Date(l)):void 0})};return(a,l)=>{var u,h,f,g,m,p;const c=z.NButton,d=z.NDatePicker;return i.openBlock(),i.createElementBlock("div",A_,[i.createVNode(d,{value:((h=(u=t.dateRange)==null?void 0:u.from)==null?void 0:h.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:(f=t.disabled)==null?void 0:f.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",M_,[(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 B,x;return o((B=y==null?void 0:y.from)==null?void 0:B.getTime(),(x=y==null?void 0:y.to)==null?void 0:x.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:((m=(g=t.dateRange)==null?void 0:g.to)==null?void 0:m.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",O_,[(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 B,x;return o((B=y==null?void 0:y.from)==null?void 0:B.getTime(),(x=y==null?void 0:y.to)==null?void 0:x.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"])])}}}),L_={class:"sc-lbl-date text-nowrap"},H_={},fs=i.defineComponent({...H_,__name:"date-time-label",props:{date:{},isTimeSecondary:{type:Boolean},isTimeOnSecondLine:{type:Boolean},isShowTime:{type:Boolean,default:!0}},setup(t){const e=t,n=i.computed(()=>Tn.format(e.date,K.useBaseConfigStateStore().config.dateFormats.uiDate)),r=i.computed(()=>Tn.format(e.date,"HH:mm"));return(s,o)=>(i.openBlock(),i.createElementBlock("span",{class:i.normalizeClass({"flex flex-col":t.isTimeOnSecondLine})},[i.createElementVNode("span",L_,i.toDisplayString(n.value),1),t.isShowTime?(i.openBlock(),i.createElementBlock("span",{key:0,class:i.normalizeClass([{"text-sc-grey":t.isTimeSecondary,"ml-1":!t.isTimeOnSecondLine},"sc-lbl-time"])},i.toDisplayString(r.value),3)):i.createCommentVNode("",!0)],2))}}),W_={class:"flex flex-row gap-2.5"},j_={class:"flex grow basis-0 flex-row flex-wrap justify-start justify-items-start gap-y-1 md:flex-nowrap"},q_={class:"flex min-w-0 flex-col-reverse flex-wrap-reverse justify-end gap-1 sm:flex-row"},X_={class:"mb-0.5 sm:mb-0 sm:ml-3"},Y_={},U_=i.defineComponent({...Y_,__name:"dialog-header",props:{showCloseButton:{type:Boolean,default:!0}},emits:["close"],setup(t){return(e,n)=>{const r=hs,s=z.NButton,o=z.NPopover;return i.openBlock(),i.createElementBlock("div",W_,[i.createElementVNode("div",j_,[i.renderSlot(e.$slots,"main")]),i.createElementVNode("div",null,[i.createElementVNode("div",q_,[i.renderSlot(e.$slots,"extra-buttons"),i.createElementVNode("div",X_,[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)])])])])}}}),K_={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function G_(t,e){return i.openBlock(),i.createElementBlock("svg",K_,[...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 Z_=i.markRaw({name:"ion-download-outline",render:G_}),Q_={},J_=i.defineComponent({...Q_,__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 u=new FileReader;u.addEventListener("load",()=>{c.content=u.result??"",r("update:file",c)}),u.readAsDataURL(d.file)};return(l,c)=>{const d=Z_;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"])}}}),e1={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function t1(t,e){return i.openBlock(),i.createElementBlock("svg",e1,[...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 n1=i.markRaw({name:"ion-checkmark-done-sharp",render:t1}),i1={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function r1(t,e){return i.openBlock(),i.createElementBlock("svg",i1,[...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 s1=i.markRaw({name:"ion-options-outline",render:r1}),o1={class:"flex flex-row gap-x-2.5 p-0 sm:p-1"},a1={class:"flex-auto"},l1={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"},c1={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"},d1={},Lo=i.defineComponent({...d1,__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 u=s1,h=z.NButton,f=z.NPopover,g=n1,m=hs;return i.openBlock(),i.createElementBlock("div",o1,[i.createElementVNode("div",a1,[i.renderSlot(c.$slots,"default")]),i.createElementVNode("div",null,[i.createElementVNode("div",l1,[i.createElementVNode("div",c1,[t.showEditButton?(i.openBlock(),i.createBlock(f,{key:0,placement:"bottom"},{trigger:i.withCtx(()=>[i.createVNode(h,{disabled:t.disabled||r.value,type:"info",ghost:"",size:"small",onClick:s},{default:i.withCtx(()=>[i.createVNode(u)]),_:1},8,["disabled"])]),default:i.withCtx(()=>[d[0]||(d[0]=i.createTextVNode(" Редактировать данные ",-1))]),_:1})):i.createCommentVNode("",!0),t.showApplyButton?(i.openBlock(),i.createBlock(f,{key:1,disabled:r.value,placement:"bottom"},{trigger:i.withCtx(()=>[i.createVNode(h,{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(f,{key:2,placement:"bottom"},{trigger:i.withCtx(()=>[i.createVNode(h,{disabled:t.disabled||r.value,type:"error",size:"small",onClick:l},{default:i.withCtx(()=>[i.createVNode(m)]),_:1},8,["disabled"])]),default:i.withCtx(()=>[d[2]||(d[2]=i.createTextVNode(" Отменить изменения ",-1))]),_:1})):i.createCommentVNode("",!0)]),i.renderSlot(c.$slots,"extra-buttons")])])])}}}),u1={},Ud=i.defineComponent({...u1,__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(Lo,{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(Lo,{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"]))]))}}),h1={},f1=i.defineComponent({...h1,__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=I.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]=u=>s.value=u),l],clearable:t.clearable,placeholder:t.placeholder},{prefix:i.withCtx(()=>[i.renderSlot(c.$slots,"prefix")]),_:3},8,["value","clearable","placeholder"]))}}),m1={},g1=i.defineComponent({...m1,__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},parse:{type:Function,default:void 0},showButton:{type:Boolean,default:!0}},emits:["update:value","keydown","input","focus"],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=I.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,m)=>(i.openBlock(),i.createBlock(i.unref(z.NInputNumber),{ref_key:"inputReference",ref:d,value:o.value??null,clearable:t.clearable,parse:t.parse,"show-button":t.showButton,placeholder:t.placeholder,min:t.min,max:t.max,step:t.step,validator:t.validator,"onUpdate:value":c,onKeydown:m[0]||(m[0]=p=>s("keydown",p)),onInput:m[1]||(m[1]=p=>s("input",p)),onFocus:m[2]||(m[2]=p=>s("focus",p))},{prefix:i.withCtx(()=>[i.renderSlot(g.$slots,"prefix")]),_:3},8,["value","clearable","parse","show-button","placeholder","min","max","step","validator"]))}}),p1={},y1=i.defineComponent({...p1,__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=I.debounce(c=>r("update:value",c),n.debounceTime??0),a=c=>{let d="";if(I.isString(c))s.value=c,d=c.replaceAll(/(\s|\(|\)|-|_)*/g,"");else if(I.isObject(c)){if(s.value=c.formatted,!c.valid)return;d=c instanceof sr.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 u=sr.parsePhoneNumberWithError(`+${d}`);u.isValid()?s.value=u.format("E.164"):u.getPossibleCountries().length>0&&(s.value=`+${d}`)}catch(u){if(u instanceof sr.ParseError)s.value=d;else throw u}};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(Qh.VueTelInput),{modelValue:s.value,"onUpdate:modelValue":[d[0]||(d[0]=u=>s.value=u),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"]))}}),b1=Wn(y1,[["__scopeId","data-v-751dbb0e"]]),_1={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function w1(t,e){return i.openBlock(),i.createElementBlock("svg",_1,[...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 x1=i.markRaw({name:"tabler-external-link",render:w1}),k1={class:"flex flex-row gap-1 hover:underline hover:decoration-dashed"},v1=["href"],C1={},S1=i.defineComponent({...C1,__name:"external-link",props:{text:{},url:{},description:{}},setup(t){return(e,n)=>{const r=x1,s=z.NTooltip;return i.openBlock(),i.createBlock(s,{disabled:i.unref(I.isUndefined)(t.description),placement:"top-start"},{trigger:i.withCtx(()=>[i.createElementVNode("span",k1,[i.createElementVNode("a",{href:t.url,target:"_blank",class:"no-underline"},i.toDisplayString(t.text),9,v1),i.createVNode(r,{class:"mt-0.5 flex-none"})])]),default:i.withCtx(()=>[i.createTextVNode(" "+i.toDisplayString(t.description),1)]),_:1},8,["disabled"])}}}),B1={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function T1(t,e){return i.openBlock(),i.createElementBlock("svg",B1,[...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 $1=i.markRaw({name:"ion-remove-circle-outline",render:T1});let ms=[];const Kd=new WeakMap;function N1(){ms.forEach(t=>t(...Kd.get(t))),ms=[]}function Gd(t,...e){Kd.set(t,e),!ms.includes(t)&&ms.push(t)===1&&requestAnimationFrame(N1)}function yr(t,e){let{target:n}=t;for(;n;){if(n.dataset&&n.dataset[e]!==void 0)return!0;n=n.parentElement}return!1}function br(t){return t.composedPath()[0]||null}function _r(t){return typeof t=="string"?t.endsWith("px")?Number(t.slice(0,t.length-2)):Number(t):t}function wr(t){if(t!=null)return typeof t=="number"?`${t}px`:t.endsWith("px")?t:`${t}px`}function nn(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 Zd={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 R1(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 P1(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 _n="^\\s*",wn="\\s*$",Gn="\\s*((\\.\\d+)|(\\d+(\\.\\d*)?))%\\s*",Ht="\\s*((\\.\\d+)|(\\d+(\\.\\d*)?))\\s*",mi="([0-9A-Fa-f])",gi="([0-9A-Fa-f]{2})",Qd=new RegExp(`${_n}hsl\\s*\\(${Ht},${Gn},${Gn}\\)${wn}`),Jd=new RegExp(`${_n}hsv\\s*\\(${Ht},${Gn},${Gn}\\)${wn}`),eu=new RegExp(`${_n}hsla\\s*\\(${Ht},${Gn},${Gn},${Ht}\\)${wn}`),tu=new RegExp(`${_n}hsva\\s*\\(${Ht},${Gn},${Gn},${Ht}\\)${wn}`),E1=new RegExp(`${_n}rgb\\s*\\(${Ht},${Ht},${Ht}\\)${wn}`),F1=new RegExp(`${_n}rgba\\s*\\(${Ht},${Ht},${Ht},${Ht}\\)${wn}`),V1=new RegExp(`${_n}#${mi}${mi}${mi}${wn}`),I1=new RegExp(`${_n}#${gi}${gi}${gi}${wn}`),A1=new RegExp(`${_n}#${mi}${mi}${mi}${mi}${wn}`),M1=new RegExp(`${_n}#${gi}${gi}${gi}${gi}${wn}`);function Mt(t){return parseInt(t,16)}function O1(t){try{let e;if(e=eu.exec(t))return[ps(e[1]),Zn(e[5]),Zn(e[9]),yi(e[13])];if(e=Qd.exec(t))return[ps(e[1]),Zn(e[5]),Zn(e[9]),1];throw new Error(`[seemly/hsla]: Invalid color value ${t}.`)}catch(e){throw e}}function z1(t){try{let e;if(e=tu.exec(t))return[ps(e[1]),Zn(e[5]),Zn(e[9]),yi(e[13])];if(e=Jd.exec(t))return[ps(e[1]),Zn(e[5]),Zn(e[9]),1];throw new Error(`[seemly/hsva]: Invalid color value ${t}.`)}catch(e){throw e}}function pi(t){try{let e;if(e=I1.exec(t))return[Mt(e[1]),Mt(e[2]),Mt(e[3]),1];if(e=E1.exec(t))return[bt(e[1]),bt(e[5]),bt(e[9]),1];if(e=F1.exec(t))return[bt(e[1]),bt(e[5]),bt(e[9]),yi(e[13])];if(e=V1.exec(t))return[Mt(e[1]+e[1]),Mt(e[2]+e[2]),Mt(e[3]+e[3]),1];if(e=M1.exec(t))return[Mt(e[1]),Mt(e[2]),Mt(e[3]),yi(Mt(e[4])/255)];if(e=A1.exec(t))return[Mt(e[1]+e[1]),Mt(e[2]+e[2]),Mt(e[3]+e[3]),yi(Mt(e[4]+e[4])/255)];if(t in Zd)return pi(Zd[t]);if(Qd.test(t)||eu.test(t)){const[n,r,s,o]=O1(t);return[...P1(n,r,s),o]}else if(Jd.test(t)||tu.test(t)){const[n,r,s,o]=z1(t);return[...R1(n,r,s),o]}throw new Error(`[seemly/rgba]: Invalid color value ${t}.`)}catch(e){throw e}}function D1(t){return t>1?1:t<0?0:t}function Ho(t,e,n,r){return`rgba(${bt(t)}, ${bt(e)}, ${bt(n)}, ${D1(r)})`}function Wo(t,e,n,r,s){return bt((t*e*(1-r)+n*r)/s)}function L1(t,e){Array.isArray(t)||(t=pi(t)),Array.isArray(e)||(e=pi(e));const n=t[3],r=e[3],s=yi(n+r-n*r);return Ho(Wo(t[0],n,e[0],r,s),Wo(t[1],n,e[1],r,s),Wo(t[2],n,e[2],r,s),s)}function ze(t,e){const[n,r,s,o=1]=Array.isArray(t)?t:pi(t);return typeof e.alpha=="number"?Ho(n,r,s,e.alpha):Ho(n,r,s,o)}function gs(t,e){const[n,r,s,o=1]=Array.isArray(t)?t:pi(t),{lightness:a=1,alpha:l=1}=e;return H1([n*a,r*a,s*a,o*l])}function yi(t){const e=Math.round(Number(t)*100)/100;return e>1?1:e<0?0:e}function ps(t){const e=Math.round(Number(t));return e>=360||e<0?0:e}function bt(t){const e=Math.round(Number(t));return e>255?255:e<0?0:e}function Zn(t){const e=Math.round(Number(t));return e>100?100:e<0?0:e}function H1(t){const[e,n,r]=t;return 3 in t?`rgba(${bt(e)}, ${bt(n)}, ${bt(r)}, ${yi(t[3])})`:`rgba(${bt(e)}, ${bt(n)}, ${bt(r)}, 1)`}function W1(t=8){return Math.random().toString(16).slice(2,2+t)}function nu(t){return Array.isArray(t)?t:[t]}const jo={STOP:"STOP"};function iu(t,e){const n=e(t);t.children!==void 0&&n!==jo.STOP&&t.children.forEach(r=>iu(r,e))}function j1(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 q1(t,e){const{isLeaf:n}=t;return n!==void 0?n:!e(t)}function X1(t){return t.children}function Y1(t){return t.key}function U1(){return!1}function K1(t,e){const{isLeaf:n}=t;return!(n===!1&&!Array.isArray(e(t)))}function G1(t){return t.disabled===!0}function Z1(t,e){return t.isLeaf===!1&&!Array.isArray(e(t))}function Q1(t,e){if(t.isLeaf===!0){const n=e(t);if(Array.isArray(n)&&n.length>0)return!0}return!1}function qo(t){var e;return t==null?[]:Array.isArray(t)?t:(e=t.checkedKeys)!==null&&e!==void 0?e:[]}function Xo(t){var e;return t==null||Array.isArray(t)?[]:(e=t.indeterminateKeys)!==null&&e!==void 0?e:[]}function J1(t,e){const n=new Set(t);return e.forEach(r=>{n.has(r)||n.add(r)}),Array.from(n)}function ew(t,e){const n=new Set(t);return e.forEach(r=>{n.has(r)&&n.delete(r)}),Array.from(n)}function tw(t){return(t==null?void 0:t.type)==="group"}function nw(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 iw extends Error{constructor(){super(),this.message="SubtreeNotLoadedError: checking a subtree whose required nodes are not fully loaded."}}function rw(t,e,n,r){return ys(e.concat(t),n,r,!1)}function sw(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 ow(t,e,n,r){const s=ys(e,n,r,!1),o=ys(t,n,r,!0),a=sw(t,n),l=[];return s.forEach(c=>{(o.has(c)||a.has(c))&&l.push(c)}),l.forEach(c=>s.delete(c)),s}function Yo(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:J1(n,r),indeterminateKeys:Array.from(o)}:s!==void 0?{checkedKeys:ew(n,s),indeterminateKeys:Array.from(o)}:{checkedKeys:Array.from(n),indeterminateKeys:Array.from(o)};const{levelTreeNodeMap:u}=e;let h;s!==void 0?h=ow(s,n,e,d):r!==void 0?h=rw(r,n,e,d):h=ys(n,e,d,!1);const f=c==="parent",g=c==="child"||l,m=h,p=new Set,y=Math.max.apply(null,Array.from(u.keys()));for(let b=y;b>=0;b-=1){const _=b===0,B=u.get(b);for(const x of B){if(x.isLeaf)continue;const{key:N,shallowLoaded:R}=x;if(g&&R&&x.children.forEach(T=>{!T.disabled&&!T.isLeaf&&T.shallowLoaded&&m.has(T.key)&&m.delete(T.key)}),x.disabled||!R)continue;let w=!0,C=!1,k=!0;for(const T of x.children){const $=T.key;if(!T.disabled){if(k&&(k=!1),m.has($))C=!0;else if(p.has($)){C=!0,w=!1;break}else if(w=!1,C)break}}w&&!k?(f&&x.children.forEach(T=>{!T.disabled&&m.has(T.key)&&m.delete(T.key)}),m.add(N)):C&&p.add(N),_&&g&&m.has(N)&&m.delete(N)}}return{checkedKeys:Array.from(m),indeterminateKeys:Array.from(p)}}function ys(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&&iu(d,u=>{if(u.disabled)return jo.STOP;const{key:h}=u;if(!a.has(h)&&(a.add(h),l.add(h),Z1(u.rawNode,o))){if(r)return jo.STOP;if(!n)throw new iw}})}),l}function aw(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 lw(t){if(t.length===0)return null;const e=t[0];return e.isGroup||e.ignored||e.disabled?e.getNext():e}function cw(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 ru(t,e,{loop:n=!1,includeDisabled:r=!1}={}){const s=e==="prev"?dw:cw,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 u=Uo(d,o);u!==null?l=u:c(s(d,n))}else{const u=s(d,!1);if(u!==null)c(u);else{const h=uw(d);h!=null&&h.isGroup?c(s(h,n)):n&&c(s(d,!0))}}}}return c(t),l}function dw(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 uw(t){return t.parent}function Uo(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 u=Uo(d,e);if(u!==null)return u}else return d}}return null}const hw={getChild(){return this.ignored?null:Uo(this)},getParent(){const{parent:t}=this;return t!=null&&t.isGroup?t.getParent():t},getNext(t={}){return ru(this,"next",t)},getPrev(t={}){return ru(this,"prev",t)}};function fw(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 mw(t,e){const n=t.key;for(;e;){if(e.key===n)return!0;e=e.parent}return!1}var gw={};function su(t,e,n,r,s,o=null,a=0){const l=[];return t.forEach((c,d)=>{var u;gw.NODE_ENV!=="production"&&Q1(c,s)&&console.error("[treemate]: node",c,"is invalid");const h=Object.create(r);if(h.rawNode=c,h.siblings=l,h.level=a,h.index=d,h.isFirstChild=d===0,h.isLastChild=d+1===t.length,h.parent=o,!h.ignored){const f=s(c);Array.isArray(f)&&(h.children=su(f,e,n,r,s,h,a+1))}l.push(h),e.set(h.key,h),n.has(a)||n.set(a,[]),(u=n.get(a))===null||u===void 0||u.push(h)}),l}function pw(t,e={}){var n;const r=new Map,s=new Map,{getDisabled:o=G1,getIgnored:a=U1,getIsGroup:l=tw,getKey:c=Y1}=e,d=(n=e.getChildren)!==null&&n!==void 0?n:X1,u=e.ignoreEmptyChildren?x=>{const N=d(x);return Array.isArray(N)?N.length?N:null:N}:d,h=Object.assign({get key(){return c(this.rawNode)},get disabled(){return o(this.rawNode)},get isGroup(){return l(this.rawNode)},get isLeaf(){return q1(this.rawNode,u)},get shallowLoaded(){return K1(this.rawNode,u)},get ignored(){return a(this.rawNode)},contains(x){return mw(this,x)}},hw),f=su(t,r,s,h,u);function g(x){if(x==null)return null;const N=r.get(x);return N&&!N.isGroup&&!N.ignored?N:null}function m(x){if(x==null)return null;const N=r.get(x);return N&&!N.ignored?N:null}function p(x,N){const R=m(x);return R?R.getPrev(N):null}function y(x,N){const R=m(x);return R?R.getNext(N):null}function b(x){const N=m(x);return N?N.getParent():null}function _(x){const N=m(x);return N?N.getChild():null}const B={treeNodes:f,treeNodeMap:r,levelTreeNodeMap:s,maxLevel:Math.max(...s.keys()),getChildren:u,getFlattenedNodes(x){return fw(f,x)},getNode:g,getPrev:p,getNext:y,getParent:b,getChild:_,getFirstAvailableNode(){return lw(f)},getPath(x,N={}){return aw(x,N,B)},getCheckedKeys(x,N={}){const{cascade:R=!0,leafOnly:w=!1,checkStrategy:C="all",allowNotLoaded:k=!1}=N;return Yo({checkedKeys:qo(x),indeterminateKeys:Xo(x),cascade:R,leafOnly:w,checkStrategy:C,allowNotLoaded:k},B)},check(x,N,R={}){const{cascade:w=!0,leafOnly:C=!1,checkStrategy:k="all",allowNotLoaded:T=!1}=R;return Yo({checkedKeys:qo(N),indeterminateKeys:Xo(N),keysToCheck:x==null?[]:nu(x),cascade:w,leafOnly:C,checkStrategy:k,allowNotLoaded:T},B)},uncheck(x,N,R={}){const{cascade:w=!0,leafOnly:C=!1,checkStrategy:k="all",allowNotLoaded:T=!1}=R;return Yo({checkedKeys:qo(N),indeterminateKeys:Xo(N),keysToUncheck:x==null?[]:nu(x),cascade:w,leafOnly:C,checkStrategy:k,allowNotLoaded:T},B)},getNonLeafKeys(x={}){return j1(f,x)}};return B}function bs(t){return t.composedPath()[0]}const yw={mousemoveoutside:new WeakMap,clickoutside:new WeakMap};function bw(t,e,n){if(t==="mousemoveoutside"){const r=s=>{e.contains(bs(s))||n(s)};return{mousemove:r,touchstart:r}}else if(t==="clickoutside"){let r=!1;const s=a=>{r=!e.contains(bs(a))},o=a=>{r&&(e.contains(bs(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 ou(t,e,n){const r=yw[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=bw(t,e,n)),o}function _w(t,e,n,r){if(t==="mousemoveoutside"||t==="clickoutside"){const s=ou(t,e,n);return Object.keys(s).forEach(o=>{Rt(o,document,s[o],r)}),!0}return!1}function ww(t,e,n,r){if(t==="mousemoveoutside"||t==="clickoutside"){const s=ou(t,e,n);return Object.keys(s).forEach(o=>{ot(o,document,s[o],r)}),!0}return!1}function xw(){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(w,C,k){const T=w[C];return w[C]=function(){return k.apply(w,arguments),T.apply(w,arguments)},w}function o(w,C){w[C]=Event.prototype[C]}const a=new WeakMap,l=Object.getOwnPropertyDescriptor(Event.prototype,"currentTarget");function c(){var w;return(w=a.get(this))!==null&&w!==void 0?w:null}function d(w,C){l!==void 0&&Object.defineProperty(w,"currentTarget",{configurable:!0,enumerable:!0,get:C??l.get})}const u={bubble:{},capture:{}},h={};function f(){const w=function(C){const{type:k,eventPhase:T,bubbles:$}=C,P=bs(C);if(T===2)return;const E=T===1?"capture":"bubble";let W=P;const A=[];for(;W===null&&(W=window),A.push(W),W!==window;)W=W.parentNode||null;const Z=u.capture[k],te=u.bubble[k];if(s(C,"stopPropagation",n),s(C,"stopImmediatePropagation",r),d(C,c),E==="capture"){if(Z===void 0)return;for(let D=A.length-1;D>=0&&!t.has(C);--D){const H=A[D],L=Z.get(H);if(L!==void 0){a.set(C,H);for(const M of L){if(e.has(C))break;M(C)}}if(D===0&&!$&&te!==void 0){const M=te.get(H);if(M!==void 0)for(const O of M){if(e.has(C))break;O(C)}}}}else if(E==="bubble"){if(te===void 0)return;for(let D=0;D<A.length&&!t.has(C);++D){const H=A[D],L=te.get(H);if(L!==void 0){a.set(C,H);for(const M of L){if(e.has(C))break;M(C)}}}}o(C,"stopPropagation"),o(C,"stopImmediatePropagation"),d(C)};return w.displayName="evtdUnifiedHandler",w}function g(){const w=function(C){const{type:k,eventPhase:T}=C;if(T!==2)return;const $=h[k];$!==void 0&&$.forEach(P=>P(C))};return w.displayName="evtdUnifiedWindowEventHandler",w}const m=f(),p=g();function y(w,C){const k=u[w];return k[C]===void 0&&(k[C]=new Map,window.addEventListener(C,m,w==="capture")),k[C]}function b(w){return h[w]===void 0&&(h[w]=new Set,window.addEventListener(w,p)),h[w]}function _(w,C){let k=w.get(C);return k===void 0&&w.set(C,k=new Set),k}function B(w,C,k,T){const $=u[C][k];if($!==void 0){const P=$.get(w);if(P!==void 0&&P.has(T))return!0}return!1}function x(w,C){const k=h[w];return!!(k!==void 0&&k.has(C))}function N(w,C,k,T){let $;if(typeof T=="object"&&T.once===!0?$=Z=>{R(w,C,$,T),k(Z)}:$=k,_w(w,C,$,T))return;const E=T===!0||typeof T=="object"&&T.capture===!0?"capture":"bubble",W=y(E,w),A=_(W,C);if(A.has($)||A.add($),C===window){const Z=b(w);Z.has($)||Z.add($)}}function R(w,C,k,T){if(ww(w,C,k,T))return;const P=T===!0||typeof T=="object"&&T.capture===!0,E=P?"capture":"bubble",W=y(E,w),A=_(W,C);if(C===window&&!B(C,P?"bubble":"capture",w,k)&&x(w,k)){const te=h[w];te.delete(k),te.size===0&&(window.removeEventListener(w,p),h[w]=void 0)}A.has(k)&&A.delete(k),A.size===0&&W.delete(C),W.size===0&&(window.removeEventListener(w,m,E==="capture"),u[E][w]=void 0)}return{on:N,off:R}}const{on:Rt,off:ot}=xw(),Ki="@@mmoContext",kw={mounted(t,{value:e}){t[Ki]={handler:void 0},typeof e=="function"&&(t[Ki].handler=e,Rt("mousemoveoutside",t,e))},updated(t,{value:e}){const n=t[Ki];typeof e=="function"?n.handler?n.handler!==e&&(ot("mousemoveoutside",t,n.handler),n.handler=e,Rt("mousemoveoutside",t,e)):(t[Ki].handler=e,Rt("mousemoveoutside",t,e)):n.handler&&(ot("mousemoveoutside",t,n.handler),n.handler=void 0)},unmounted(t){const{handler:e}=t[Ki];e&&ot("mousemoveoutside",t,e),t[Ki].handler=void 0}},Gi="@@coContext",_s={mounted(t,{value:e,modifiers:n}){t[Gi]={handler:void 0},typeof e=="function"&&(t[Gi].handler=e,Rt("clickoutside",t,e,{capture:n.capture}))},updated(t,{value:e,modifiers:n}){const r=t[Gi];typeof e=="function"?r.handler?r.handler!==e&&(ot("clickoutside",t,r.handler,{capture:n.capture}),r.handler=e,Rt("clickoutside",t,e,{capture:n.capture})):(t[Gi].handler=e,Rt("clickoutside",t,e,{capture:n.capture})):r.handler&&(ot("clickoutside",t,r.handler,{capture:n.capture}),r.handler=void 0)},unmounted(t,{modifiers:e}){const{handler:n}=t[Gi];n&&ot("clickoutside",t,n,{capture:e.capture}),t[Gi].handler=void 0}};function vw(t,e){console.error(`[vdirs/${t}]: ${e}`)}class Cw{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&&vw("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 Ko=new Cw,Zi="@@ziContext",au={mounted(t,e){const{value:n={}}=e,{zIndex:r,enabled:s}=n;t[Zi]={enabled:!!s,initialized:!1},s&&(Ko.ensureZIndex(t,r),t[Zi].initialized=!0)},updated(t,e){const{value:n={}}=e,{zIndex:r,enabled:s}=n,o=t[Zi].enabled;s&&!o&&(Ko.ensureZIndex(t,r),t[Zi].initialized=!0),t[Zi].enabled=!!s},unmounted(t,e){if(!t[Zi].initialized)return;const{value:n={}}=e,{zIndex:r}=n;Ko.unregister(t,r)}};function Sw(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 Zt(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 Bw=typeof window<"u";let Qi,xr;(()=>{var t,e;Qi=Bw?(e=(t=document)===null||t===void 0?void 0:t.fonts)===null||e===void 0?void 0:e.ready:void 0,xr=!1,Qi!==void 0?Qi.then(()=>{xr=!0}):xr=!0})();function Tw(t){if(xr)return;let e=!1;i.onMounted(()=>{xr||Qi==null||Qi.then(()=>{e||t()})}),i.onBeforeUnmount(()=>{e=!0})}function Go(t,e){return i.watch(t,n=>{n!==void 0&&(e.value=n)}),i.computed(()=>t.value===void 0?e.value:t.value)}function ws(){const t=i.ref(!1);return i.onMounted(()=>{t.value=!0}),i.readonly(t)}function lu(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 $w=(typeof window>"u"?!1:/iPad|iPhone|iPod/.test(navigator.platform)||navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1)&&!window.MSStream;function Nw(){return $w}function Zo(t,e,n="default"){const r=e[n];if(r===void 0)throw new Error(`[vueuc/${t}]: slot[${n}] is empty.`);return r()}function Qo(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)){Qo(r,e,n);return}if(r.type===i.Fragment){if(r.children===null)return;Array.isArray(r.children)&&Qo(r.children,e,n)}else r.type!==i.Comment&&n.push(r)}}),n}function cu(t,e,n="default"){const r=e[n];if(r===void 0)throw new Error(`[vueuc/${t}]: slot[${n}] is empty.`);const s=Qo(r());if(s.length===1)return s[0];throw new Error(`[vueuc/${t}]: slot[${n}] should have exactly one child.`)}let Qn=null;function du(){if(Qn===null&&(Qn=document.getElementById("v-binder-view-measurer"),Qn===null)){Qn=document.createElement("div"),Qn.id="v-binder-view-measurer";const{style:t}=Qn;t.position="fixed",t.left="0",t.right="0",t.top="0",t.bottom="0",t.pointerEvents="none",t.visibility="hidden",document.body.appendChild(Qn)}return Qn.getBoundingClientRect()}function Rw(t,e){const n=du();return{top:e,left:t,height:0,width:0,right:n.width-t,bottom:n.height-e}}function Jo(t){const e=t.getBoundingClientRect(),n=du();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 Pw(t){return t.nodeType===9?null:t.parentNode}function uu(t){if(t===null)return null;const e=Pw(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 uu(e)}const hu=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=uu(b),b!==null;)o.push(b);for(const _ of o)Rt("scroll",_,h,!0)},l=()=>{for(const b of o)ot("scroll",b,h,!0);o=[]},c=new Set,d=b=>{c.size===0&&a(),c.has(b)||c.add(b)},u=b=>{c.has(b)&&c.delete(b),c.size===0&&l()},h=()=>{Gd(f)},f=()=>{c.forEach(b=>b())},g=new Set,m=b=>{g.size===0&&Rt("resize",window,y),g.has(b)||g.add(b)},p=b=>{g.has(b)&&g.delete(b),g.size===0&&ot("resize",window,y)},y=()=>{g.forEach(b=>b())};return i.onBeforeUnmount(()=>{ot("resize",window,y),l()}),{targetRef:r,setTargetRef:s,addScrollListener:d,removeScrollListener:u,addResizeListener:m,removeResizeListener:p}},render(){return Zo("binder",this.$slots)}}),fu=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(cu("follower",this.$slots),[[e]]):cu("follower",this.$slots)}}),Ew="@css-render/vue3-ssr";function Fw(t,e){return`<style cssr-id="${t}">
|
|
104
104
|
${e}
|
|
105
105
|
</style>`}function Vw(t,e,n){const{styles:r,ids:s}=n;s.has(t)||r!==null&&(s.add(t),r.push(Fw(t,e)))}const Iw=typeof document<"u";function bi(){if(Iw)return;const t=i.inject(Ew,null);if(t!==null)return{adapter:(e,n)=>Vw(e,n,t),context:t}}function mu(t,e){console.error(`[vueuc/${t}]: ${e}`)}function Aw(t){let e=0;for(let n=0;n<t.length;++n)t[n]==="&"&&++e;return e}const gu=/\s*,(?![^(]*\))\s*/g,Mw=/\s+/g;function Ow(t,e){const n=[];return e.split(gu).forEach(r=>{let s=Aw(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 zw(t,e){const n=[];return e.split(gu).forEach(r=>{t.forEach(s=>{n.push((s&&s+" ")+r)})}),n}function Dw(t){let e=[""];return t.forEach(n=>{n=n&&n.trim(),n&&(n.includes("&")?e=Ow(e,n):e=zw(e,n))}),e.join(", ").replace(Mw," ")}function pu(t){if(!t)return;const e=t.parentElement;e&&e.removeChild(t)}function xs(t,e){return(e??document.head).querySelector(`style[cssr-id="${t}"]`)}function Lw(t){const e=document.createElement("style");return e.setAttribute("cssr-id",t),e}function ks(t){return t?/^\s*@(s|m)/.test(t):!1}const Hw=/[A-Z]/g;function yu(t){return t.replace(Hw,e=>"-"+e.toLowerCase())}function Ww(t,e=" "){return typeof t=="object"&&t!==null?` {
|
|
106
106
|
`+Object.entries(t).map(n=>e+` ${yu(n[0])}: ${n[1]};`).join(`
|
|
@@ -113,17 +113,17 @@ ${s}
|
|
|
113
113
|
`);return}l=yu(l),c!=null&&a.push(` ${l}${Ww(c)}`)}),t&&a.push("}"),a.join(`
|
|
114
114
|
`)}function ea(t,e,n){t&&t.forEach(r=>{if(Array.isArray(r))ea(r,e,n);else if(typeof r=="function"){const s=r(e);Array.isArray(s)?ea(s,e,n):s&&n(s)}else r&&n(r)})}function _u(t,e,n,r,s){const o=t.$;let a="";if(!o||typeof o=="string")ks(o)?a=o:e.push(o);else if(typeof o=="function"){const d=o({context:r.context,props:s});ks(d)?a=d:e.push(d)}else if(o.before&&o.before(r.context),!o.$||typeof o.$=="string")ks(o.$)?a=o.$:e.push(o.$);else if(o.$){const d=o.$({context:r.context,props:s});ks(d)?a=d:e.push(d)}const l=Dw(e),c=bu(l,t.props,r,s);a?n.push(`${a} {`):c.length&&n.push(c),t.children&&ea(t.children,{context:r.context,props:s},d=>{if(typeof d=="string"){const u=bu(l,{raw:d},r,s);n.push(u)}else _u(d,e,n,r,s)}),e.pop(),a&&n.push("}"),o&&o.after&&o.after(r.context)}function qw(t,e,n){const r=[];return _u(t,[],r,e,n),r.join(`
|
|
115
115
|
|
|
116
|
-
`)}function ta(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 Xw(t,e,n,r){const{els:s}=e;if(n===void 0)s.forEach(pu),e.els=[];else{const o=xs(n,r);o&&s.includes(o)&&(pu(o),e.els=s.filter(a=>a!==o))}}function wu(t,e){t.push(e)}function Yw(t,e,n,r,s,o,a,l,c){let d;if(n===void 0&&(d=e.render(r),n=ta(d)),c){c.adapter(n,d??e.render(r));return}l===void 0&&(l=document.head);const u=xs(n,l);if(u!==null&&!o)return u;const h=u??Lw(n);if(d===void 0&&(d=e.render(r)),h.textContent=d,u!==null)return u;if(a){const f=l.querySelector(`meta[name="${a}"]`);if(f)return l.insertBefore(h,f),wu(e.els,h),h}return s?l.insertBefore(h,l.querySelector("style, link")):l.appendChild(h),wu(e.els,h),h}function Uw(t){return qw(this,this.instance,t)}function Kw(t={}){const{id:e,ssr:n,props:r,head:s=!1,force:o=!1,anchorMetaName:a,parent:l}=t;return Yw(this.instance,this,e,r,s,o,a,l,n)}function Gw(t={}){const{id:e,parent:n}=t;Xw(this.instance,this,e,n)}const vs=function(t,e,n,r){return{instance:t,$:e,props:n,children:r,els:[],render:Uw,mount:Kw,unmount:Gw}},Zw=function(t,e,n,r){return Array.isArray(e)?vs(t,{$:null},null,e):Array.isArray(n)?vs(t,e,null,n):Array.isArray(r)?vs(t,e,n,r):vs(t,e,n,null)};function xu(t={}){const e={c:((...n)=>Zw(e,...n)),use:(n,...r)=>n.install(e,...r),find:xs,context:{},config:t};return e}function Qw(t,e){if(t===void 0)return!1;if(e){const{context:{ids:n}}=e;return n.has(t)}return xs(t)!==null}const{c:Jn}=xu(),na="vueuc-style";function ku(t){return t&-t}class vu{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+=ku(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-=ku(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 Cu(t){return typeof t=="string"?document.querySelector(t):t()||null}const Jw=i.defineComponent({name:"LazyTeleport",props:{to:{type:[String,Object],default:void 0},disabled:Boolean,show:{type:Boolean,required:!0}},setup(t){return{showTeleport:Sw(i.toRef(t,"show")),mergedTo:i.computed(()=>{const{to:e}=t;return e??"body"})}},render(){return this.showTeleport?this.disabled?Zo("lazy-teleport",this.$slots):i.h(i.Teleport,{disabled:this.disabled,to:this.mergedTo},Zo("lazy-teleport",this.$slots)):null}}),Cs={top:"bottom",bottom:"top",left:"right",right:"left"},Su={start:"end",center:"center",end:"start"},ia={top:"height",bottom:"height",left:"width",right:"width"},ex={"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"},tx={"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"},nx={"bottom-start":"right","bottom-end":"left","top-start":"right","top-end":"left","right-start":"bottom","right-end":"top","left-start":"bottom","left-end":"top"},Bu={top:!0,bottom:!1,left:!0,right:!1},Tu={top:"end",bottom:"start",left:"end",right:"start"};function ix(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 u=(g,m,p)=>{let y=0,b=0;const _=n[g]-e[m]-e[g];return _>0&&r&&(p?b=Bu[m]?_:-_:y=Bu[m]?_:-_),{left:y,top:b}},h=a==="left"||a==="right";if(c!=="center"){const g=nx[t],m=Cs[g],p=ia[g];if(n[p]>e[p]){if(e[g]+e[p]<n[p]){const y=(n[p]-e[p])/2;e[g]<y||e[m]<y?e[g]<e[m]?(c=Su[l],d=u(p,m,h)):d=u(p,g,h):c="center"}}else n[p]<e[p]&&e[m]<0&&e[g]>e[m]&&(c=Su[l])}else{const g=a==="bottom"||a==="top"?"left":"top",m=Cs[g],p=ia[g],y=(n[p]-e[p])/2;(e[g]<y||e[m]<y)&&(e[g]>e[m]?(c=Tu[g],d=u(p,g,h)):(c=Tu[m],d=u(p,m,h)))}let f=a;return e[a]<n[ia[a]]&&e[a]<e[Cs[a]]&&(f=Cs[a]),{placement:c!=="center"?`${f}-${c}`:f,left:d.left,top:d.top}}function rx(t,e){return e?tx[t]:ex[t]}function sx(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 ox=Jn([Jn(".v-binder-follower-container",{position:"absolute",left:"0",right:"0",top:"0",height:"0",pointerEvents:"none",zIndex:"auto"}),Jn(".v-binder-follower-content",{position:"absolute",zIndex:"auto"},[Jn("> *",{pointerEvents:"all"})])]),$u=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=Zt(()=>t.enabled!==void 0?t.enabled:t.show),r=i.ref(null),s=i.ref(null),o=()=>{const{syncTrigger:f}=t;f.includes("scroll")&&e.addScrollListener(c),f.includes("resize")&&e.addResizeListener(c)},a=()=>{e.removeScrollListener(c),e.removeResizeListener(c)};i.onMounted(()=>{n.value&&(c(),o())});const l=bi();ox.mount({id:"vueuc/binder",head:!0,anchorMetaName:na,ssr:l}),i.onBeforeUnmount(()=>{a()}),Tw(()=>{n.value&&c()});const c=()=>{if(!n.value)return;const f=r.value;if(f===null)return;const g=e.targetRef,{x:m,y:p,overlap:y}=t,b=m!==void 0&&p!==void 0?Rw(m,p):Jo(g);f.style.setProperty("--v-target-width",`${Math.round(b.width)}px`),f.style.setProperty("--v-target-height",`${Math.round(b.height)}px`);const{width:_,minWidth:B,placement:k,internalShift:N,flip:R}=t;f.setAttribute("v-placement",k),y?f.setAttribute("v-overlap",""):f.removeAttribute("v-overlap");const{style:w}=f;_==="target"?w.width=`${b.width}px`:_!==void 0?w.width=_:w.width="",B==="target"?w.minWidth=`${b.width}px`:B!==void 0?w.minWidth=B:w.minWidth="";const C=Jo(f),x=Jo(s.value),{left:T,top:$,placement:F}=ix(k,b,C,N,R,y),I=rx(F,y),{left:L,top:O,transform:Z}=sx(F,x,b,$,T,y);f.setAttribute("v-placement",F),f.style.setProperty("--v-offset-left",`${Math.round(T)}px`),f.style.setProperty("--v-offset-top",`${Math.round($)}px`),f.style.transform=`translateX(${L}) translateY(${O}) ${Z}`,f.style.setProperty("--v-transform-origin",I),f.style.transformOrigin=I};i.watch(n,f=>{f?(o(),d()):a()});const d=()=>{i.nextTick().then(c).catch(f=>console.error(f))};["placement","x","y","internalShift","flip","width","overlap","minWidth"].forEach(f=>{i.watch(i.toRef(t,f),c)}),["teleportDisabled"].forEach(f=>{i.watch(i.toRef(t,f),d)}),i.watch(i.toRef(t,"syncTrigger"),f=>{f.includes("resize")?e.addResizeListener(c):e.removeResizeListener(c),f.includes("scroll")?e.addScrollListener(c):e.removeScrollListener(c)});const u=ws(),h=Zt(()=>{const{to:f}=t;if(f!==void 0)return f;u.value});return{VBinder:e,mergedEnabled:n,offsetContainerRef:s,followerRef:r,mergedTo:h,syncPosition:c}},render(){return i.h(Jw,{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,[[au,{enabled:this.mergedEnabled,zIndex:this.zIndex}]]):n}})}});var _i=[],ax=function(){return _i.some(function(t){return t.activeTargets.length>0})},lx=function(){return _i.some(function(t){return t.skippedTargets.length>0})},Nu="ResizeObserver loop completed with undelivered notifications.",cx=function(){var t;typeof ErrorEvent=="function"?t=new ErrorEvent("error",{message:Nu}):(t=document.createEvent("Event"),t.initEvent("error",!1,!1),t.message=Nu),window.dispatchEvent(t)},kr;(function(t){t.BORDER_BOX="border-box",t.CONTENT_BOX="content-box",t.DEVICE_PIXEL_CONTENT_BOX="device-pixel-content-box"})(kr||(kr={}));var wi=function(t){return Object.freeze(t)},dx=(function(){function t(e,n){this.inlineSize=e,this.blockSize=n,wi(this)}return t})(),Ru=(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,wi(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})(),ra=function(t){return t instanceof SVGElement&&"getBBox"in t},Pu=function(t){if(ra(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)},Eu=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)},ux=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},vr=typeof window<"u"?window:{},Ss=new WeakMap,Fu=/auto|scroll/,hx=/^tb|vertical/,fx=/msie|trident/i.test(vr.navigator&&vr.navigator.userAgent),xn=function(t){return parseFloat(t||"0")},Ji=function(t,e,n){return t===void 0&&(t=0),e===void 0&&(e=0),n===void 0&&(n=!1),new dx((n?e:t)||0,(n?t:e)||0)},Vu=wi({devicePixelContentBoxSize:Ji(),borderBoxSize:Ji(),contentBoxSize:Ji(),contentRect:new Ru(0,0,0,0)}),Iu=function(t,e){if(e===void 0&&(e=!1),Ss.has(t)&&!e)return Ss.get(t);if(Pu(t))return Ss.set(t,Vu),Vu;var n=getComputedStyle(t),r=ra(t)&&t.ownerSVGElement&&t.getBBox(),s=!fx&&n.boxSizing==="border-box",o=hx.test(n.writingMode||""),a=!r&&Fu.test(n.overflowY||""),l=!r&&Fu.test(n.overflowX||""),c=r?0:xn(n.paddingTop),d=r?0:xn(n.paddingRight),u=r?0:xn(n.paddingBottom),h=r?0:xn(n.paddingLeft),f=r?0:xn(n.borderTopWidth),g=r?0:xn(n.borderRightWidth),m=r?0:xn(n.borderBottomWidth),p=r?0:xn(n.borderLeftWidth),y=h+d,b=c+u,_=p+g,B=f+m,k=l?t.offsetHeight-B-t.clientHeight:0,N=a?t.offsetWidth-_-t.clientWidth:0,R=s?y+_:0,w=s?b+B:0,C=r?r.width:xn(n.width)-R-N,x=r?r.height:xn(n.height)-w-k,T=C+y+N+_,$=x+b+k+B,F=wi({devicePixelContentBoxSize:Ji(Math.round(C*devicePixelRatio),Math.round(x*devicePixelRatio),o),borderBoxSize:Ji(T,$,o),contentBoxSize:Ji(C,x,o),contentRect:new Ru(h,c,C,x)});return Ss.set(t,F),F},Au=function(t,e,n){var r=Iu(t,n),s=r.borderBoxSize,o=r.contentBoxSize,a=r.devicePixelContentBoxSize;switch(e){case kr.DEVICE_PIXEL_CONTENT_BOX:return a;case kr.BORDER_BOX:return s;default:return o}},mx=(function(){function t(e){var n=Iu(e);this.target=e,this.contentRect=n.contentRect,this.borderBoxSize=wi([n.borderBoxSize]),this.contentBoxSize=wi([n.contentBoxSize]),this.devicePixelContentBoxSize=wi([n.devicePixelContentBoxSize])}return t})(),Mu=function(t){if(Pu(t))return 1/0;for(var e=0,n=t.parentNode;n;)e+=1,n=n.parentNode;return e},gx=function(){var t=1/0,e=[];_i.forEach(function(a){if(a.activeTargets.length!==0){var l=[];a.activeTargets.forEach(function(d){var u=new mx(d.target),h=Mu(d.target);l.push(u),d.lastReportedSize=Au(d.target,d.observedBox),h<t&&(t=h)}),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},Ou=function(t){_i.forEach(function(n){n.activeTargets.splice(0,n.activeTargets.length),n.skippedTargets.splice(0,n.skippedTargets.length),n.observationTargets.forEach(function(s){s.isActive()&&(Mu(s.target)>t?n.activeTargets.push(s):n.skippedTargets.push(s))})})},px=function(){var t=0;for(Ou(t);ax();)t=gx(),Ou(t);return lx()&&cx(),t>0},sa,zu=[],yx=function(){return zu.splice(0).forEach(function(t){return t()})},bx=function(t){if(!sa){var e=0,n=document.createTextNode(""),r={characterData:!0};new MutationObserver(function(){return yx()}).observe(n,r),sa=function(){n.textContent="".concat(e?e--:e++)}}zu.push(t),sa()},_x=function(t){bx(function(){requestAnimationFrame(t)})},Bs=0,wx=function(){return!!Bs},xx=250,kx={attributes:!0,characterData:!0,childList:!0,subtree:!0},Du=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],Lu=function(t){return t===void 0&&(t=0),Date.now()+t},oa=!1,vx=(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=xx),!oa){oa=!0;var r=Lu(e);_x(function(){var s=!1;try{s=px()}finally{if(oa=!1,e=r-Lu(),!wx())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,kx)};document.body?n():vr.addEventListener("DOMContentLoaded",n)},t.prototype.start=function(){var e=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),Du.forEach(function(n){return vr.addEventListener(n,e.listener,!0)}))},t.prototype.stop=function(){var e=this;this.stopped||(this.observer&&this.observer.disconnect(),Du.forEach(function(n){return vr.removeEventListener(n,e.listener,!0)}),this.stopped=!0)},t})(),aa=new vx,Hu=function(t){!Bs&&t>0&&aa.start(),Bs+=t,!Bs&&aa.stop()},Cx=function(t){return!ra(t)&&!ux(t)&&getComputedStyle(t).display==="inline"},Sx=(function(){function t(e,n){this.target=e,this.observedBox=n||kr.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return t.prototype.isActive=function(){var e=Au(this.target,this.observedBox,!0);return Cx(this.target)&&(this.lastReportedSize=e),this.lastReportedSize.inlineSize!==e.inlineSize||this.lastReportedSize.blockSize!==e.blockSize},t})(),Bx=(function(){function t(e,n){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=e,this.callback=n}return t})(),Ts=new WeakMap,Wu=function(t,e){for(var n=0;n<t.length;n+=1)if(t[n].target===e)return n;return-1},$s=(function(){function t(){}return t.connect=function(e,n){var r=new Bx(e,n);Ts.set(e,r)},t.observe=function(e,n,r){var s=Ts.get(e),o=s.observationTargets.length===0;Wu(s.observationTargets,n)<0&&(o&&_i.push(s),s.observationTargets.push(new Sx(n,r&&r.box)),Hu(1),aa.schedule())},t.unobserve=function(e,n){var r=Ts.get(e),s=Wu(r.observationTargets,n),o=r.observationTargets.length===1;s>=0&&(o&&_i.splice(_i.indexOf(r),1),r.observationTargets.splice(s,1),Hu(-1))},t.disconnect=function(e){var n=this,r=Ts.get(e);r.observationTargets.slice().forEach(function(s){return n.unobserve(e,s.target)}),r.activeTargets.splice(0,r.activeTargets.length)},t})(),Tx=(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.");$s.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(!Eu(e))throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");$s.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(!Eu(e))throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");$s.unobserve(this,e)},t.prototype.disconnect=function(){$s.disconnect(this)},t.toString=function(){return"function ResizeObserver () { [polyfill code] }"},t})();class $x{constructor(){this.handleResize=this.handleResize.bind(this),this.observer=new(typeof window<"u"&&window.ResizeObserver||Tx)(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 Cr=new $x,Ns=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){mu("resize-observer","$el does not exist.");return}if(s.nextElementSibling!==s.nextSibling&&s.nodeType===3&&s.nodeValue!==""){mu("resize-observer","$el can not be observed (it may be a text node).");return}s.nextElementSibling!==null&&(Cr.registerHandler(s.nextElementSibling,r),e=!0)}),i.onBeforeUnmount(()=>{e&&Cr.unregisterHandler(n.$el.nextElementSibling)})},render(){return i.renderSlot(this.$slots,"default")}});let Rs;function Nx(){return typeof document>"u"?!1:(Rs===void 0&&("matchMedia"in window?Rs=window.matchMedia("(pointer:coarse)").matches:Rs=!1),Rs)}let la;function ju(){return typeof document>"u"?1:(la===void 0&&(la="chrome"in window?window.devicePixelRatio:1),la)}const qu="VVirtualListXScroll";function Rx({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 u=new vu(d.length,0);return d.forEach((h,f)=>{u.add(f,h.width)}),u}),a=Zt(()=>{const d=o.value;return d!==null?Math.max(d.getBound(s.value)-1,0):0}),l=d=>{const u=o.value;return u!==null?u.sum(d):0},c=Zt(()=>{const d=o.value;return d!==null?Math.min(d.getBound(s.value+r.value)+1,t.value.length-1):0});return i.provide(qu,{startIndexRef:a,endIndexRef:c,columnsRef:t,renderColRef:e,renderItemWithColsRef:n,getLeft:l}),{listWidthRef:r,scrollLeftRef:s}}const Xu=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(qu);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}}),Px=Jn(".v-vl",{maxHeight:"inherit",height:"100%",overflow:"auto",minWidth:"1px"},[Jn("&:not(.v-vl--show-scrollbar)",{scrollbarWidth:"none"},[Jn("&::-webkit-scrollbar, &::-webkit-scrollbar-track-piece, &::-webkit-scrollbar-thumb",{width:0,height:0,display:"none"})])]),Ex=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=bi();Px.mount({id:"vueuc/virtual-list",head:!0,anchorMetaName:na,ssr:e}),i.onMounted(()=>{const{defaultScrollIndex:I,defaultScrollKey:L}=t;I!=null?y({index:I}):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=Zt(()=>{if(t.renderCol==null&&t.renderItemWithCols==null||t.columns.length===0)return;let I=0;return t.columns.forEach(L=>{I+=L.width}),I}),o=i.computed(()=>{const I=new Map,{keyField:L}=t;return t.items.forEach((O,Z)=>{I.set(O[L],Z)}),I}),{scrollLeftRef:a,listWidthRef:l}=Rx({columnsRef:i.toRef(t,"columns"),renderColRef:i.toRef(t,"renderCol"),renderItemWithColsRef:i.toRef(t,"renderItemWithCols")}),c=i.ref(null),d=i.ref(void 0),u=new Map,h=i.computed(()=>{const{items:I,itemSize:L,keyField:O}=t,Z=new vu(I.length,L);return I.forEach((ne,E)=>{const P=ne[O],H=u.get(P);H!==void 0&&Z.add(E,H)}),Z}),f=i.ref(0),g=i.ref(0),m=Zt(()=>Math.max(h.value.getBound(g.value-_r(t.paddingTop))-1,0)),p=i.computed(()=>{const{value:I}=d;if(I===void 0)return[];const{items:L,itemSize:O}=t,Z=m.value,ne=Math.min(Z+Math.ceil(I/O+1),L.length-1),E=[];for(let P=Z;P<=ne;++P)E.push(L[P]);return E}),y=(I,L)=>{if(typeof I=="number"){k(I,L,"auto");return}const{left:O,top:Z,index:ne,key:E,position:P,behavior:H,debounce:Y=!0}=I;if(O!==void 0||Z!==void 0)k(O,Z,H);else if(ne!==void 0)B(ne,H,Y);else if(E!==void 0){const D=o.value.get(E);D!==void 0&&B(D,H,Y)}else P==="bottom"?k(0,Number.MAX_SAFE_INTEGER,H):P==="top"&&k(0,0,H)};let b,_=null;function B(I,L,O){const{value:Z}=h,ne=Z.sum(I)+_r(t.paddingTop);if(!O)c.value.scrollTo({left:0,top:ne,behavior:L});else{b=I,_!==null&&window.clearTimeout(_),_=window.setTimeout(()=>{b=void 0,_=null},16);const{scrollTop:E,offsetHeight:P}=c.value;if(ne>E){const H=Z.get(I);ne+H<=E+P||c.value.scrollTo({left:0,top:ne+H-P,behavior:L})}else c.value.scrollTo({left:0,top:ne,behavior:L})}}function k(I,L,O){c.value.scrollTo({left:I,top:L,behavior:O})}function N(I,L){var O,Z,ne;if(n||t.ignoreItemResize||F(L.target))return;const{value:E}=h,P=o.value.get(I),H=E.get(P),Y=(ne=(Z=(O=L.borderBoxSize)===null||O===void 0?void 0:O[0])===null||Z===void 0?void 0:Z.blockSize)!==null&&ne!==void 0?ne:L.contentRect.height;if(Y===H)return;Y-t.itemSize===0?u.delete(I):u.set(I,Y-t.itemSize);const X=Y-H;if(X===0)return;E.add(P,X);const W=c.value;if(W!=null){if(b===void 0){const V=E.sum(P);W.scrollTop>V&&W.scrollBy(0,X)}else if(P<b)W.scrollBy(0,X);else if(P===b){const V=E.sum(P);Y+V>W.scrollTop+W.offsetHeight&&W.scrollBy(0,X)}$()}f.value++}const R=!Nx();let w=!1;function C(I){var L;(L=t.onScroll)===null||L===void 0||L.call(t,I),(!R||!w)&&$()}function x(I){var L;if((L=t.onWheel)===null||L===void 0||L.call(t,I),R){const O=c.value;if(O!=null){if(I.deltaX===0&&(O.scrollTop===0&&I.deltaY<=0||O.scrollTop+O.offsetHeight>=O.scrollHeight&&I.deltaY>=0))return;I.preventDefault(),O.scrollTop+=I.deltaY/ju(),O.scrollLeft+=I.deltaX/ju(),$(),w=!0,Gd(()=>{w=!1})}}}function T(I){if(n||F(I.target))return;if(t.renderCol==null&&t.renderItemWithCols==null){if(I.contentRect.height===d.value)return}else if(I.contentRect.height===d.value&&I.contentRect.width===l.value)return;d.value=I.contentRect.height,l.value=I.contentRect.width;const{onResize:L}=t;L!==void 0&&L(I)}function $(){const{value:I}=c;I!=null&&(g.value=I.scrollTop,a.value=I.scrollLeft)}function F(I){let L=I;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:I}=t,L=wr(h.value.sum());return f.value,[t.itemsStyle,{boxSizing:"content-box",width:wr(s.value),height:I?"":L,minHeight:I?L:"",paddingTop:wr(t.paddingTop),paddingBottom:wr(t.paddingBottom)}]}),visibleItemsStyle:i.computed(()=>(f.value,{transform:`translateY(${wr(h.value.sum(m.value))})`})),viewportItems:p,listElRef:c,itemsElRef:i.ref(null),scrollTo:y,handleListResize:T,handleListScroll:C,handleListWheel:x,handleItemResize:N}},render(){const{itemResizable:t,keyField:e,keyToIndex:n,visibleItemsTag:r}=this;return i.h(Ns,{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],u=n.get(d),h=a!=null?i.h(Xu,{index:u,item:c}):void 0,f=l!=null?i.h(Xu,{index:u,item:c}):void 0,g=this.$slots.default({item:c,renderedCols:h,renderedItemWithCols:f,index:u})[0];return t?i.h(Ns,{key:d,onResize:m=>this.handleItemResize(d,m)},{default:()=>g}):(g.key=d,g)})}})]):(o=(s=this.$slots).empty)===null||o===void 0?void 0:o.call(s)])}})}}),Pn="v-hidden",Fx=Jn("[v-hidden]",{display:"none!important"}),Yu=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 u;if(c!==void 0?u=c():u=r.value,!l||!u)return;u.hasAttribute(Pn)&&u.removeAttribute(Pn);const{children:h}=l;if(a.showAllItemsBeforeCalculate)for(const B of h)B.hasAttribute(Pn)&&B.removeAttribute(Pn);const f=l.offsetWidth,g=[],m=e.tail?d==null?void 0:d():null;let p=m?m.offsetWidth:0,y=!1;const b=l.children.length-(e.tail?1:0);for(let B=0;B<b-1;++B){if(B<0)continue;const k=h[B];if(y){k.hasAttribute(Pn)||k.setAttribute(Pn,"");continue}else k.hasAttribute(Pn)&&k.removeAttribute(Pn);const N=k.offsetWidth;if(p+=N,g[B]=N,p>f){const{updateCounter:R}=t;for(let w=B;w>=0;--w){const C=b-1-w;R!==void 0?R(C):u.textContent=`${C}`;const x=u.offsetWidth;if(p-=g[w],p+x<=f||w===0){y=!0,B=w-1,m&&(B===-1?(m.style.maxWidth=`${f-x}px`,m.style.boxSizing="border-box"):m.style.maxWidth="");const{onUpdateCount:T}=t;T&&T(C);break}}}}const{onUpdateOverflow:_}=t;y?_!==void 0&&_(!0):(_!==void 0&&_(!1),u.setAttribute(Pn,""))}const o=bi();return Fx.mount({id:"vueuc/overflow",head:!0,anchorMetaName:na,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 Uu(t){return t instanceof HTMLElement}function Ku(t){for(let e=0;e<t.childNodes.length;e++){const n=t.childNodes[e];if(Uu(n)&&(Zu(n)||Ku(n)))return!0}return!1}function Gu(t){for(let e=t.childNodes.length-1;e>=0;e--){const n=t.childNodes[e];if(Uu(n)&&(Zu(n)||Gu(n)))return!0}return!1}function Zu(t){if(!Vx(t))return!1;try{t.focus({preventScroll:!0})}catch{}return document.activeElement===t}function Vx(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 Sr=[];const Ix=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=W1(),n=i.ref(null),r=i.ref(null);let s=!1,o=!1;const a=typeof document>"u"?null:document.activeElement;function l(){return Sr[Sr.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?(h(),Rt("keydown",document,c)):(ot("keydown",document,c),s&&f())},{immediate:!0})}),i.onBeforeUnmount(()=>{ot("keydown",document,c),s&&f()});function d(y){if(!o&&l()){const b=u();if(b===null||b.contains(br(y)))return;g("first")}}function u(){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 h(){var y;if(!t.disabled){if(Sr.push(e),t.autoFocus){const{initialFocusTo:b}=t;b===void 0?g("first"):(y=Cu(b))===null||y===void 0||y.focus({preventScroll:!0})}s=!0,document.addEventListener("focus",d,!0)}}function f(){var y;if(t.disabled||(document.removeEventListener("focus",d,!0),Sr=Sr.filter(_=>_!==e),l()))return;const{finalFocusTo:b}=t;b!==void 0?(y=Cu(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 B=u();if(B==null||B===_){o=!0,b.focus({preventScroll:!0}),o=!1;return}o=!0;const k=y==="first"?Ku(B):Gu(B);o=!1,k||(o=!0,b.focus({preventScroll:!0}),o=!1)}}}function m(y){if(o)return;const b=u();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:m,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 zS(t){return t}const ca="n-internal-select-menu",Qu="n-internal-select-menu-body",Ju="n-drawer-body",eh="n-modal-body",th="n-popover-body",nh="__disabled__";function En(t){const e=i.inject(eh,null),n=i.inject(Ju,null),r=i.inject(th,null),s=i.inject(Qu,null),o=i.ref();if(typeof document<"u"){o.value=document.fullscreenElement;const a=()=>{o.value=document.fullscreenElement};i.onMounted(()=>{Rt("fullscreenchange",document,a)}),i.onBeforeUnmount(()=>{ot("fullscreenchange",document,a)})}return Zt(()=>{var a;const{to:l}=t;return l!==void 0?l===!1?nh: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")})}En.tdkey=nh,En.propTo={type:[String,Object,Boolean],default:void 0};function Ax(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 ih(t,e){e&&(i.onMounted(()=>{const{value:n}=t;n&&Cr.registerHandler(n,e)}),i.watch(t,(n,r)=>{r&&Cr.unregisterHandler(r)},{deep:!1}),i.onBeforeUnmount(()=>{const{value:n}=t;n&&Cr.unregisterHandler(n)}))}function rh(t){return t.replace(/#|\(|\)|,|\s|\./g,"_")}const Mx=/^(\d|\.)+$/,sh=/(\d|\.)+/;function da(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(Mx.test(t)){const s=(Number(t)+n)*e;return r?s===0?"0":`${s}px`:`${s}`}else{const s=sh.exec(t);return s?t.replace(sh,String((Number(s[0])+n)*e)):t}return t}function oh(t){const{left:e,right:n,top:r,bottom:s}=nn(t);return`${r} ${e} ${s} ${n}`}var ah={};function Ox(t){let e=".",n="__",r="--",s;if(t){let m=t.blockPrefix;m&&(e=m),m=t.elementPrefix,m&&(n=m),m=t.modifierPrefix,m&&(r=m)}const o={install(m){s=m.c;const p=m.context;p.bem={},p.bem.b=null,p.bem.els=null}};function a(m){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 m=typeof m=="string"?m:m({context:b,props:_}),b.bem.b=m,`${(_==null?void 0:_.bPrefix)||e}${b.bem.b}`}}}function l(m){let p;return{before(y){p=y.bem.els},after(y){y.bem.els=p},$({context:y,props:b}){return m=typeof m=="string"?m:m({context:y,props:b}),y.bem.els=m.split(",").map(_=>_.trim()),y.bem.els.map(_=>`${(b==null?void 0:b.bPrefix)||e}${y.bem.b}${n}${_}`).join(", ")}}}function c(m){return{$({context:p,props:y}){m=typeof m=="string"?m:m({context:p,props:y});const b=m.split(",").map(k=>k.trim());function _(k){return b.map(N=>`&${(y==null?void 0:y.bPrefix)||e}${p.bem.b}${k!==void 0?`${n}${k}`:""}${r}${N}`).join(", ")}const B=p.bem.els;if(B!==null){if(ah.NODE_ENV!=="production"&&B.length>=2)throw Error(`[css-render/plugin-bem]: m(${m}) is invalid, using modifier inside multiple elements is not allowed`);return _(B[0])}else return _()}}}function d(m){return{$({context:p,props:y}){m=typeof m=="string"?m:m({context:p,props:y});const b=p.bem.els;if(ah.NODE_ENV!=="production"&&b!==null&&b.length>=2)throw Error(`[css-render/plugin-bem]: notM(${m}) 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}${m})`}}}return Object.assign(o,{cB:((...m)=>s(a(m[0]),m[1],m[2])),cE:((...m)=>s(l(m[0]),m[1],m[2])),cM:((...m)=>s(c(m[0]),m[1],m[2])),cNotM:((...m)=>s(d(m[0]),m[1],m[2]))}),o}const zx=".n-",Dx="__",Lx="--",lh=xu(),ch=Ox({blockPrefix:zx,elementPrefix:Dx,modifierPrefix:Lx});lh.use(ch);const{c:ue,find:LS}=lh,{cB:ye,cE:we,cM:Re,cNotM:rn}=ch,Hx=(...t)=>ue(">",[ye(...t)]);function Je(t,e){return t+(e==="default"?"":e.replace(/^[a-z]/,n=>n.toUpperCase()))}let ua;function Wx(){return ua===void 0&&(ua=navigator.userAgent.includes("Node.js")||navigator.userAgent.includes("jsdom")),ua}const jx=new WeakSet;function qx(t){jx.add(t)}function dh(t){switch(typeof t){case"string":return t||void 0;case"number":return String(t);default:return}}const uh=new Set;function ei(t,e){const n=`[naive/${t}]: ${e}`;uh.has(n)||(uh.add(n),console.error(n))}function hh(t,e){console.error(`[naive/${t}]: ${e}`)}function fh(t,e){throw new Error(`[naive/${t}]: ${e}`)}function _t(t,...e){if(Array.isArray(t))t.forEach(n=>_t(n,...e));else return t(...e)}function ha(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)){ha(r,e,n);return}if(r.type===i.Fragment){if(r.children===null)return;Array.isArray(r.children)&&ha(r.children,e,n)}else{if(r.type===i.Comment&&e)return;n.push(r)}}}),n}function Xx(t,e="default",n=void 0){const r=t[e];if(!r)return hh("getFirstSlotVNode",`slot[${e}] is empty`),null;const s=ha(r(n));return s.length===1?s[0]:(hh("getFirstSlotVNode",`slot[${e}] should have exactly one child`),null)}function Yx(t,e=[],n){const r={};return e.forEach(s=>{r[s]=t[s]}),Object.assign(r,n)}function fa(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 er(t,...e){return typeof t=="function"?t(...e):typeof t=="string"?i.createTextVNode(t):typeof t=="number"?i.createTextVNode(String(t)):null}function Ps(t){return t.some(e=>i.isVNode(e)?!(e.type===i.Comment||e.type===i.Fragment&&!Ps(e.children)):!0)?t:null}function ma(t,e){return t&&Ps(t())||e()}function xi(t,e){const n=t&&Ps(t());return e(n||null)}function mh(t){return!(t&&Ps(t()))}const ga=i.defineComponent({render(){var t,e;return(e=(t=this.$slots).default)===null||e===void 0?void 0:e.call(t)}}),ki="n-config-provider",Ux="n";function vi(t={},e={defaultBordered:!0}){const n=i.inject(ki,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(Ux),namespaceRef:i.computed(()=>n==null?void 0:n.mergedNamespaceRef.value)}}function Ci(t,e,n,r){n||fh("useThemeClass","cssVarsRef is not passed");const s=i.inject(ki,null),o=s==null?void 0:s.mergedThemeHashRef,a=s==null?void 0:s.styleMountTarget,l=i.ref(""),c=bi();let d;const u=`__${t}`,h=()=>{let f=u;const g=e?e.value:void 0,m=o==null?void 0:o.value;m&&(f+=`-${m}`),g&&(f+=`-${g}`);const{themeOverrides:p,builtinThemeOverrides:y}=r;p&&(f+=`-${ta(JSON.stringify(p))}`),y&&(f+=`-${ta(JSON.stringify(y))}`),l.value=f,d=()=>{const b=n.value;let _="";for(const B in b)_+=`${B}: ${b[B]};`;ue(`.${f}`,_).mount({id:f,ssr:c,parent:a}),d=void 0}};return i.watchEffect(()=>{h()}),{themeClass:l,onRender:()=>{d==null||d()}}}const gh="n-form-item";function Kx(t,{defaultSize:e="medium",mergedSize:n,mergedDisabled:r}={}){const s=i.inject(gh,null);i.provide(gh,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 Gx={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 pa(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 Tr(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)?Qx(l,h=>h.test(a)):Zx(l,h=>h.test(a));let d;d=t.valueCallback?t.valueCallback(c):c,d=n.valueCallback?n.valueCallback(d):d;const u=e.slice(a.length);return{value:d,rest:u}}}function Zx(t,e){for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&e(t[n]))return n}function Qx(t,e){for(let n=0;n<t.length;n++)if(e(t[n]))return n}function Jx(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 ek={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"}},tk=(t,e,n)=>{let r;const s=ek[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},nk={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},ik=(t,e,n,r)=>nk[t],rk={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},sk={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},ok={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"]},ak={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"]},lk={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"}},ck={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"}},dk={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:rk,defaultWidth:"wide"}),quarter:Br({values:sk,defaultWidth:"wide",argumentCallback:t=>t-1}),month:Br({values:ok,defaultWidth:"wide"}),day:Br({values:ak,defaultWidth:"wide"}),dayPeriod:Br({values:lk,defaultWidth:"wide",formattingValues:ck,defaultFormattingWidth:"wide"})},uk=/^(\d+)(th|st|nd|rd)?/i,hk=/\d+/i,fk={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},mk={any:[/^b/i,/^(a|c)/i]},gk={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},pk={any:[/1/i,/2/i,/3/i,/4/i]},yk={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},bk={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]},_k={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},wk={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]},xk={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},kk={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}},vk={ordinalNumber:Jx({matchPattern:uk,parsePattern:hk,valueCallback:t=>parseInt(t,10)}),era:Tr({matchPatterns:fk,defaultMatchWidth:"wide",parsePatterns:mk,defaultParseWidth:"any"}),quarter:Tr({matchPatterns:gk,defaultMatchWidth:"wide",parsePatterns:pk,defaultParseWidth:"any",valueCallback:t=>t+1}),month:Tr({matchPatterns:yk,defaultMatchWidth:"wide",parsePatterns:bk,defaultParseWidth:"any"}),day:Tr({matchPatterns:_k,defaultMatchWidth:"wide",parsePatterns:wk,defaultParseWidth:"any"}),dayPeriod:Tr({matchPatterns:xk,defaultMatchWidth:"any",parsePatterns:kk,defaultParseWidth:"any"})},Ck={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Sk={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Bk={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Tk={date:pa({formats:Ck,defaultWidth:"full"}),time:pa({formats:Sk,defaultWidth:"full"}),dateTime:pa({formats:Bk,defaultWidth:"full"})},$k={name:"en-US",locale:{code:"en-US",formatDistance:tk,formatLong:Tk,formatRelative:ik,localize:dk,match:vk,options:{weekStartsOn:0,firstWeekContainsDate:1}}};function ph(t){const{mergedLocaleRef:e,mergedDateLocaleRef:n}=i.inject(ki,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:Gx[t]});return{dateLocaleRef:i.computed(()=>{var o;return(o=n==null?void 0:n.value)!==null&&o!==void 0?o:$k}),localeRef:r}}const $r="naive-ui-style";function Nr(t,e,n){if(!e)return;const r=bi(),s=i.computed(()=>{const{value:l}=e;if(!l)return;const c=l[t];if(c)return c}),o=i.inject(ki,null),a=()=>{i.watchEffect(()=>{const{value:l}=n,c=`${l}${t}Rtl`;if(Qw(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 Rr={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:Nk,fontFamily:Rk,lineHeight:Pk}=Rr,yh=ue("body",`
|
|
116
|
+
`)}function ta(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 Xw(t,e,n,r){const{els:s}=e;if(n===void 0)s.forEach(pu),e.els=[];else{const o=xs(n,r);o&&s.includes(o)&&(pu(o),e.els=s.filter(a=>a!==o))}}function wu(t,e){t.push(e)}function Yw(t,e,n,r,s,o,a,l,c){let d;if(n===void 0&&(d=e.render(r),n=ta(d)),c){c.adapter(n,d??e.render(r));return}l===void 0&&(l=document.head);const u=xs(n,l);if(u!==null&&!o)return u;const h=u??Lw(n);if(d===void 0&&(d=e.render(r)),h.textContent=d,u!==null)return u;if(a){const f=l.querySelector(`meta[name="${a}"]`);if(f)return l.insertBefore(h,f),wu(e.els,h),h}return s?l.insertBefore(h,l.querySelector("style, link")):l.appendChild(h),wu(e.els,h),h}function Uw(t){return qw(this,this.instance,t)}function Kw(t={}){const{id:e,ssr:n,props:r,head:s=!1,force:o=!1,anchorMetaName:a,parent:l}=t;return Yw(this.instance,this,e,r,s,o,a,l,n)}function Gw(t={}){const{id:e,parent:n}=t;Xw(this.instance,this,e,n)}const vs=function(t,e,n,r){return{instance:t,$:e,props:n,children:r,els:[],render:Uw,mount:Kw,unmount:Gw}},Zw=function(t,e,n,r){return Array.isArray(e)?vs(t,{$:null},null,e):Array.isArray(n)?vs(t,e,null,n):Array.isArray(r)?vs(t,e,n,r):vs(t,e,n,null)};function xu(t={}){const e={c:((...n)=>Zw(e,...n)),use:(n,...r)=>n.install(e,...r),find:xs,context:{},config:t};return e}function Qw(t,e){if(t===void 0)return!1;if(e){const{context:{ids:n}}=e;return n.has(t)}return xs(t)!==null}const{c:Jn}=xu(),na="vueuc-style";function ku(t){return t&-t}class vu{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+=ku(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-=ku(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 Cu(t){return typeof t=="string"?document.querySelector(t):t()||null}const Jw=i.defineComponent({name:"LazyTeleport",props:{to:{type:[String,Object],default:void 0},disabled:Boolean,show:{type:Boolean,required:!0}},setup(t){return{showTeleport:Sw(i.toRef(t,"show")),mergedTo:i.computed(()=>{const{to:e}=t;return e??"body"})}},render(){return this.showTeleport?this.disabled?Zo("lazy-teleport",this.$slots):i.h(i.Teleport,{disabled:this.disabled,to:this.mergedTo},Zo("lazy-teleport",this.$slots)):null}}),Cs={top:"bottom",bottom:"top",left:"right",right:"left"},Su={start:"end",center:"center",end:"start"},ia={top:"height",bottom:"height",left:"width",right:"width"},ex={"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"},tx={"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"},nx={"bottom-start":"right","bottom-end":"left","top-start":"right","top-end":"left","right-start":"bottom","right-end":"top","left-start":"bottom","left-end":"top"},Bu={top:!0,bottom:!1,left:!0,right:!1},Tu={top:"end",bottom:"start",left:"end",right:"start"};function ix(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 u=(g,m,p)=>{let y=0,b=0;const _=n[g]-e[m]-e[g];return _>0&&r&&(p?b=Bu[m]?_:-_:y=Bu[m]?_:-_),{left:y,top:b}},h=a==="left"||a==="right";if(c!=="center"){const g=nx[t],m=Cs[g],p=ia[g];if(n[p]>e[p]){if(e[g]+e[p]<n[p]){const y=(n[p]-e[p])/2;e[g]<y||e[m]<y?e[g]<e[m]?(c=Su[l],d=u(p,m,h)):d=u(p,g,h):c="center"}}else n[p]<e[p]&&e[m]<0&&e[g]>e[m]&&(c=Su[l])}else{const g=a==="bottom"||a==="top"?"left":"top",m=Cs[g],p=ia[g],y=(n[p]-e[p])/2;(e[g]<y||e[m]<y)&&(e[g]>e[m]?(c=Tu[g],d=u(p,g,h)):(c=Tu[m],d=u(p,m,h)))}let f=a;return e[a]<n[ia[a]]&&e[a]<e[Cs[a]]&&(f=Cs[a]),{placement:c!=="center"?`${f}-${c}`:f,left:d.left,top:d.top}}function rx(t,e){return e?tx[t]:ex[t]}function sx(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 ox=Jn([Jn(".v-binder-follower-container",{position:"absolute",left:"0",right:"0",top:"0",height:"0",pointerEvents:"none",zIndex:"auto"}),Jn(".v-binder-follower-content",{position:"absolute",zIndex:"auto"},[Jn("> *",{pointerEvents:"all"})])]),$u=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=Zt(()=>t.enabled!==void 0?t.enabled:t.show),r=i.ref(null),s=i.ref(null),o=()=>{const{syncTrigger:f}=t;f.includes("scroll")&&e.addScrollListener(c),f.includes("resize")&&e.addResizeListener(c)},a=()=>{e.removeScrollListener(c),e.removeResizeListener(c)};i.onMounted(()=>{n.value&&(c(),o())});const l=bi();ox.mount({id:"vueuc/binder",head:!0,anchorMetaName:na,ssr:l}),i.onBeforeUnmount(()=>{a()}),Tw(()=>{n.value&&c()});const c=()=>{if(!n.value)return;const f=r.value;if(f===null)return;const g=e.targetRef,{x:m,y:p,overlap:y}=t,b=m!==void 0&&p!==void 0?Rw(m,p):Jo(g);f.style.setProperty("--v-target-width",`${Math.round(b.width)}px`),f.style.setProperty("--v-target-height",`${Math.round(b.height)}px`);const{width:_,minWidth:B,placement:x,internalShift:N,flip:R}=t;f.setAttribute("v-placement",x),y?f.setAttribute("v-overlap",""):f.removeAttribute("v-overlap");const{style:w}=f;_==="target"?w.width=`${b.width}px`:_!==void 0?w.width=_:w.width="",B==="target"?w.minWidth=`${b.width}px`:B!==void 0?w.minWidth=B:w.minWidth="";const C=Jo(f),k=Jo(s.value),{left:T,top:$,placement:P}=ix(x,b,C,N,R,y),E=rx(P,y),{left:W,top:A,transform:Z}=sx(P,k,b,$,T,y);f.setAttribute("v-placement",P),f.style.setProperty("--v-offset-left",`${Math.round(T)}px`),f.style.setProperty("--v-offset-top",`${Math.round($)}px`),f.style.transform=`translateX(${W}) translateY(${A}) ${Z}`,f.style.setProperty("--v-transform-origin",E),f.style.transformOrigin=E};i.watch(n,f=>{f?(o(),d()):a()});const d=()=>{i.nextTick().then(c).catch(f=>console.error(f))};["placement","x","y","internalShift","flip","width","overlap","minWidth"].forEach(f=>{i.watch(i.toRef(t,f),c)}),["teleportDisabled"].forEach(f=>{i.watch(i.toRef(t,f),d)}),i.watch(i.toRef(t,"syncTrigger"),f=>{f.includes("resize")?e.addResizeListener(c):e.removeResizeListener(c),f.includes("scroll")?e.addScrollListener(c):e.removeScrollListener(c)});const u=ws(),h=Zt(()=>{const{to:f}=t;if(f!==void 0)return f;u.value});return{VBinder:e,mergedEnabled:n,offsetContainerRef:s,followerRef:r,mergedTo:h,syncPosition:c}},render(){return i.h(Jw,{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,[[au,{enabled:this.mergedEnabled,zIndex:this.zIndex}]]):n}})}});var _i=[],ax=function(){return _i.some(function(t){return t.activeTargets.length>0})},lx=function(){return _i.some(function(t){return t.skippedTargets.length>0})},Nu="ResizeObserver loop completed with undelivered notifications.",cx=function(){var t;typeof ErrorEvent=="function"?t=new ErrorEvent("error",{message:Nu}):(t=document.createEvent("Event"),t.initEvent("error",!1,!1),t.message=Nu),window.dispatchEvent(t)},kr;(function(t){t.BORDER_BOX="border-box",t.CONTENT_BOX="content-box",t.DEVICE_PIXEL_CONTENT_BOX="device-pixel-content-box"})(kr||(kr={}));var wi=function(t){return Object.freeze(t)},dx=(function(){function t(e,n){this.inlineSize=e,this.blockSize=n,wi(this)}return t})(),Ru=(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,wi(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})(),ra=function(t){return t instanceof SVGElement&&"getBBox"in t},Pu=function(t){if(ra(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)},Eu=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)},ux=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},vr=typeof window<"u"?window:{},Ss=new WeakMap,Fu=/auto|scroll/,hx=/^tb|vertical/,fx=/msie|trident/i.test(vr.navigator&&vr.navigator.userAgent),xn=function(t){return parseFloat(t||"0")},Ji=function(t,e,n){return t===void 0&&(t=0),e===void 0&&(e=0),n===void 0&&(n=!1),new dx((n?e:t)||0,(n?t:e)||0)},Vu=wi({devicePixelContentBoxSize:Ji(),borderBoxSize:Ji(),contentBoxSize:Ji(),contentRect:new Ru(0,0,0,0)}),Iu=function(t,e){if(e===void 0&&(e=!1),Ss.has(t)&&!e)return Ss.get(t);if(Pu(t))return Ss.set(t,Vu),Vu;var n=getComputedStyle(t),r=ra(t)&&t.ownerSVGElement&&t.getBBox(),s=!fx&&n.boxSizing==="border-box",o=hx.test(n.writingMode||""),a=!r&&Fu.test(n.overflowY||""),l=!r&&Fu.test(n.overflowX||""),c=r?0:xn(n.paddingTop),d=r?0:xn(n.paddingRight),u=r?0:xn(n.paddingBottom),h=r?0:xn(n.paddingLeft),f=r?0:xn(n.borderTopWidth),g=r?0:xn(n.borderRightWidth),m=r?0:xn(n.borderBottomWidth),p=r?0:xn(n.borderLeftWidth),y=h+d,b=c+u,_=p+g,B=f+m,x=l?t.offsetHeight-B-t.clientHeight:0,N=a?t.offsetWidth-_-t.clientWidth:0,R=s?y+_:0,w=s?b+B:0,C=r?r.width:xn(n.width)-R-N,k=r?r.height:xn(n.height)-w-x,T=C+y+N+_,$=k+b+x+B,P=wi({devicePixelContentBoxSize:Ji(Math.round(C*devicePixelRatio),Math.round(k*devicePixelRatio),o),borderBoxSize:Ji(T,$,o),contentBoxSize:Ji(C,k,o),contentRect:new Ru(h,c,C,k)});return Ss.set(t,P),P},Au=function(t,e,n){var r=Iu(t,n),s=r.borderBoxSize,o=r.contentBoxSize,a=r.devicePixelContentBoxSize;switch(e){case kr.DEVICE_PIXEL_CONTENT_BOX:return a;case kr.BORDER_BOX:return s;default:return o}},mx=(function(){function t(e){var n=Iu(e);this.target=e,this.contentRect=n.contentRect,this.borderBoxSize=wi([n.borderBoxSize]),this.contentBoxSize=wi([n.contentBoxSize]),this.devicePixelContentBoxSize=wi([n.devicePixelContentBoxSize])}return t})(),Mu=function(t){if(Pu(t))return 1/0;for(var e=0,n=t.parentNode;n;)e+=1,n=n.parentNode;return e},gx=function(){var t=1/0,e=[];_i.forEach(function(a){if(a.activeTargets.length!==0){var l=[];a.activeTargets.forEach(function(d){var u=new mx(d.target),h=Mu(d.target);l.push(u),d.lastReportedSize=Au(d.target,d.observedBox),h<t&&(t=h)}),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},Ou=function(t){_i.forEach(function(n){n.activeTargets.splice(0,n.activeTargets.length),n.skippedTargets.splice(0,n.skippedTargets.length),n.observationTargets.forEach(function(s){s.isActive()&&(Mu(s.target)>t?n.activeTargets.push(s):n.skippedTargets.push(s))})})},px=function(){var t=0;for(Ou(t);ax();)t=gx(),Ou(t);return lx()&&cx(),t>0},sa,zu=[],yx=function(){return zu.splice(0).forEach(function(t){return t()})},bx=function(t){if(!sa){var e=0,n=document.createTextNode(""),r={characterData:!0};new MutationObserver(function(){return yx()}).observe(n,r),sa=function(){n.textContent="".concat(e?e--:e++)}}zu.push(t),sa()},_x=function(t){bx(function(){requestAnimationFrame(t)})},Bs=0,wx=function(){return!!Bs},xx=250,kx={attributes:!0,characterData:!0,childList:!0,subtree:!0},Du=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],Lu=function(t){return t===void 0&&(t=0),Date.now()+t},oa=!1,vx=(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=xx),!oa){oa=!0;var r=Lu(e);_x(function(){var s=!1;try{s=px()}finally{if(oa=!1,e=r-Lu(),!wx())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,kx)};document.body?n():vr.addEventListener("DOMContentLoaded",n)},t.prototype.start=function(){var e=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),Du.forEach(function(n){return vr.addEventListener(n,e.listener,!0)}))},t.prototype.stop=function(){var e=this;this.stopped||(this.observer&&this.observer.disconnect(),Du.forEach(function(n){return vr.removeEventListener(n,e.listener,!0)}),this.stopped=!0)},t})(),aa=new vx,Hu=function(t){!Bs&&t>0&&aa.start(),Bs+=t,!Bs&&aa.stop()},Cx=function(t){return!ra(t)&&!ux(t)&&getComputedStyle(t).display==="inline"},Sx=(function(){function t(e,n){this.target=e,this.observedBox=n||kr.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return t.prototype.isActive=function(){var e=Au(this.target,this.observedBox,!0);return Cx(this.target)&&(this.lastReportedSize=e),this.lastReportedSize.inlineSize!==e.inlineSize||this.lastReportedSize.blockSize!==e.blockSize},t})(),Bx=(function(){function t(e,n){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=e,this.callback=n}return t})(),Ts=new WeakMap,Wu=function(t,e){for(var n=0;n<t.length;n+=1)if(t[n].target===e)return n;return-1},$s=(function(){function t(){}return t.connect=function(e,n){var r=new Bx(e,n);Ts.set(e,r)},t.observe=function(e,n,r){var s=Ts.get(e),o=s.observationTargets.length===0;Wu(s.observationTargets,n)<0&&(o&&_i.push(s),s.observationTargets.push(new Sx(n,r&&r.box)),Hu(1),aa.schedule())},t.unobserve=function(e,n){var r=Ts.get(e),s=Wu(r.observationTargets,n),o=r.observationTargets.length===1;s>=0&&(o&&_i.splice(_i.indexOf(r),1),r.observationTargets.splice(s,1),Hu(-1))},t.disconnect=function(e){var n=this,r=Ts.get(e);r.observationTargets.slice().forEach(function(s){return n.unobserve(e,s.target)}),r.activeTargets.splice(0,r.activeTargets.length)},t})(),Tx=(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.");$s.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(!Eu(e))throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");$s.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(!Eu(e))throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");$s.unobserve(this,e)},t.prototype.disconnect=function(){$s.disconnect(this)},t.toString=function(){return"function ResizeObserver () { [polyfill code] }"},t})();class $x{constructor(){this.handleResize=this.handleResize.bind(this),this.observer=new(typeof window<"u"&&window.ResizeObserver||Tx)(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 Cr=new $x,Ns=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){mu("resize-observer","$el does not exist.");return}if(s.nextElementSibling!==s.nextSibling&&s.nodeType===3&&s.nodeValue!==""){mu("resize-observer","$el can not be observed (it may be a text node).");return}s.nextElementSibling!==null&&(Cr.registerHandler(s.nextElementSibling,r),e=!0)}),i.onBeforeUnmount(()=>{e&&Cr.unregisterHandler(n.$el.nextElementSibling)})},render(){return i.renderSlot(this.$slots,"default")}});let Rs;function Nx(){return typeof document>"u"?!1:(Rs===void 0&&("matchMedia"in window?Rs=window.matchMedia("(pointer:coarse)").matches:Rs=!1),Rs)}let la;function ju(){return typeof document>"u"?1:(la===void 0&&(la="chrome"in window?window.devicePixelRatio:1),la)}const qu="VVirtualListXScroll";function Rx({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 u=new vu(d.length,0);return d.forEach((h,f)=>{u.add(f,h.width)}),u}),a=Zt(()=>{const d=o.value;return d!==null?Math.max(d.getBound(s.value)-1,0):0}),l=d=>{const u=o.value;return u!==null?u.sum(d):0},c=Zt(()=>{const d=o.value;return d!==null?Math.min(d.getBound(s.value+r.value)+1,t.value.length-1):0});return i.provide(qu,{startIndexRef:a,endIndexRef:c,columnsRef:t,renderColRef:e,renderItemWithColsRef:n,getLeft:l}),{listWidthRef:r,scrollLeftRef:s}}const Xu=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(qu);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}}),Px=Jn(".v-vl",{maxHeight:"inherit",height:"100%",overflow:"auto",minWidth:"1px"},[Jn("&:not(.v-vl--show-scrollbar)",{scrollbarWidth:"none"},[Jn("&::-webkit-scrollbar, &::-webkit-scrollbar-track-piece, &::-webkit-scrollbar-thumb",{width:0,height:0,display:"none"})])]),Ex=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=bi();Px.mount({id:"vueuc/virtual-list",head:!0,anchorMetaName:na,ssr:e}),i.onMounted(()=>{const{defaultScrollIndex:E,defaultScrollKey:W}=t;E!=null?y({index:E}):W!=null&&y({key:W})});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=Zt(()=>{if(t.renderCol==null&&t.renderItemWithCols==null||t.columns.length===0)return;let E=0;return t.columns.forEach(W=>{E+=W.width}),E}),o=i.computed(()=>{const E=new Map,{keyField:W}=t;return t.items.forEach((A,Z)=>{E.set(A[W],Z)}),E}),{scrollLeftRef:a,listWidthRef:l}=Rx({columnsRef:i.toRef(t,"columns"),renderColRef:i.toRef(t,"renderCol"),renderItemWithColsRef:i.toRef(t,"renderItemWithCols")}),c=i.ref(null),d=i.ref(void 0),u=new Map,h=i.computed(()=>{const{items:E,itemSize:W,keyField:A}=t,Z=new vu(E.length,W);return E.forEach((te,D)=>{const H=te[A],L=u.get(H);L!==void 0&&Z.add(D,L)}),Z}),f=i.ref(0),g=i.ref(0),m=Zt(()=>Math.max(h.value.getBound(g.value-_r(t.paddingTop))-1,0)),p=i.computed(()=>{const{value:E}=d;if(E===void 0)return[];const{items:W,itemSize:A}=t,Z=m.value,te=Math.min(Z+Math.ceil(E/A+1),W.length-1),D=[];for(let H=Z;H<=te;++H)D.push(W[H]);return D}),y=(E,W)=>{if(typeof E=="number"){x(E,W,"auto");return}const{left:A,top:Z,index:te,key:D,position:H,behavior:L,debounce:M=!0}=E;if(A!==void 0||Z!==void 0)x(A,Z,L);else if(te!==void 0)B(te,L,M);else if(D!==void 0){const O=o.value.get(D);O!==void 0&&B(O,L,M)}else H==="bottom"?x(0,Number.MAX_SAFE_INTEGER,L):H==="top"&&x(0,0,L)};let b,_=null;function B(E,W,A){const{value:Z}=h,te=Z.sum(E)+_r(t.paddingTop);if(!A)c.value.scrollTo({left:0,top:te,behavior:W});else{b=E,_!==null&&window.clearTimeout(_),_=window.setTimeout(()=>{b=void 0,_=null},16);const{scrollTop:D,offsetHeight:H}=c.value;if(te>D){const L=Z.get(E);te+L<=D+H||c.value.scrollTo({left:0,top:te+L-H,behavior:W})}else c.value.scrollTo({left:0,top:te,behavior:W})}}function x(E,W,A){c.value.scrollTo({left:E,top:W,behavior:A})}function N(E,W){var A,Z,te;if(n||t.ignoreItemResize||P(W.target))return;const{value:D}=h,H=o.value.get(E),L=D.get(H),M=(te=(Z=(A=W.borderBoxSize)===null||A===void 0?void 0:A[0])===null||Z===void 0?void 0:Z.blockSize)!==null&&te!==void 0?te:W.contentRect.height;if(M===L)return;M-t.itemSize===0?u.delete(E):u.set(E,M-t.itemSize);const Y=M-L;if(Y===0)return;D.add(H,Y);const U=c.value;if(U!=null){if(b===void 0){const V=D.sum(H);U.scrollTop>V&&U.scrollBy(0,Y)}else if(H<b)U.scrollBy(0,Y);else if(H===b){const V=D.sum(H);M+V>U.scrollTop+U.offsetHeight&&U.scrollBy(0,Y)}$()}f.value++}const R=!Nx();let w=!1;function C(E){var W;(W=t.onScroll)===null||W===void 0||W.call(t,E),(!R||!w)&&$()}function k(E){var W;if((W=t.onWheel)===null||W===void 0||W.call(t,E),R){const A=c.value;if(A!=null){if(E.deltaX===0&&(A.scrollTop===0&&E.deltaY<=0||A.scrollTop+A.offsetHeight>=A.scrollHeight&&E.deltaY>=0))return;E.preventDefault(),A.scrollTop+=E.deltaY/ju(),A.scrollLeft+=E.deltaX/ju(),$(),w=!0,Gd(()=>{w=!1})}}}function T(E){if(n||P(E.target))return;if(t.renderCol==null&&t.renderItemWithCols==null){if(E.contentRect.height===d.value)return}else if(E.contentRect.height===d.value&&E.contentRect.width===l.value)return;d.value=E.contentRect.height,l.value=E.contentRect.width;const{onResize:W}=t;W!==void 0&&W(E)}function $(){const{value:E}=c;E!=null&&(g.value=E.scrollTop,a.value=E.scrollLeft)}function P(E){let W=E;for(;W!==null;){if(W.style.display==="none")return!0;W=W.parentElement}return!1}return{listHeight:d,listStyle:{overflow:"auto"},keyToIndex:o,itemsStyle:i.computed(()=>{const{itemResizable:E}=t,W=wr(h.value.sum());return f.value,[t.itemsStyle,{boxSizing:"content-box",width:wr(s.value),height:E?"":W,minHeight:E?W:"",paddingTop:wr(t.paddingTop),paddingBottom:wr(t.paddingBottom)}]}),visibleItemsStyle:i.computed(()=>(f.value,{transform:`translateY(${wr(h.value.sum(m.value))})`})),viewportItems:p,listElRef:c,itemsElRef:i.ref(null),scrollTo:y,handleListResize:T,handleListScroll:C,handleListWheel:k,handleItemResize:N}},render(){const{itemResizable:t,keyField:e,keyToIndex:n,visibleItemsTag:r}=this;return i.h(Ns,{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],u=n.get(d),h=a!=null?i.h(Xu,{index:u,item:c}):void 0,f=l!=null?i.h(Xu,{index:u,item:c}):void 0,g=this.$slots.default({item:c,renderedCols:h,renderedItemWithCols:f,index:u})[0];return t?i.h(Ns,{key:d,onResize:m=>this.handleItemResize(d,m)},{default:()=>g}):(g.key=d,g)})}})]):(o=(s=this.$slots).empty)===null||o===void 0?void 0:o.call(s)])}})}}),Pn="v-hidden",Fx=Jn("[v-hidden]",{display:"none!important"}),Yu=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 u;if(c!==void 0?u=c():u=r.value,!l||!u)return;u.hasAttribute(Pn)&&u.removeAttribute(Pn);const{children:h}=l;if(a.showAllItemsBeforeCalculate)for(const B of h)B.hasAttribute(Pn)&&B.removeAttribute(Pn);const f=l.offsetWidth,g=[],m=e.tail?d==null?void 0:d():null;let p=m?m.offsetWidth:0,y=!1;const b=l.children.length-(e.tail?1:0);for(let B=0;B<b-1;++B){if(B<0)continue;const x=h[B];if(y){x.hasAttribute(Pn)||x.setAttribute(Pn,"");continue}else x.hasAttribute(Pn)&&x.removeAttribute(Pn);const N=x.offsetWidth;if(p+=N,g[B]=N,p>f){const{updateCounter:R}=t;for(let w=B;w>=0;--w){const C=b-1-w;R!==void 0?R(C):u.textContent=`${C}`;const k=u.offsetWidth;if(p-=g[w],p+k<=f||w===0){y=!0,B=w-1,m&&(B===-1?(m.style.maxWidth=`${f-k}px`,m.style.boxSizing="border-box"):m.style.maxWidth="");const{onUpdateCount:T}=t;T&&T(C);break}}}}const{onUpdateOverflow:_}=t;y?_!==void 0&&_(!0):(_!==void 0&&_(!1),u.setAttribute(Pn,""))}const o=bi();return Fx.mount({id:"vueuc/overflow",head:!0,anchorMetaName:na,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 Uu(t){return t instanceof HTMLElement}function Ku(t){for(let e=0;e<t.childNodes.length;e++){const n=t.childNodes[e];if(Uu(n)&&(Zu(n)||Ku(n)))return!0}return!1}function Gu(t){for(let e=t.childNodes.length-1;e>=0;e--){const n=t.childNodes[e];if(Uu(n)&&(Zu(n)||Gu(n)))return!0}return!1}function Zu(t){if(!Vx(t))return!1;try{t.focus({preventScroll:!0})}catch{}return document.activeElement===t}function Vx(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 Sr=[];const Ix=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=W1(),n=i.ref(null),r=i.ref(null);let s=!1,o=!1;const a=typeof document>"u"?null:document.activeElement;function l(){return Sr[Sr.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?(h(),Rt("keydown",document,c)):(ot("keydown",document,c),s&&f())},{immediate:!0})}),i.onBeforeUnmount(()=>{ot("keydown",document,c),s&&f()});function d(y){if(!o&&l()){const b=u();if(b===null||b.contains(br(y)))return;g("first")}}function u(){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 h(){var y;if(!t.disabled){if(Sr.push(e),t.autoFocus){const{initialFocusTo:b}=t;b===void 0?g("first"):(y=Cu(b))===null||y===void 0||y.focus({preventScroll:!0})}s=!0,document.addEventListener("focus",d,!0)}}function f(){var y;if(t.disabled||(document.removeEventListener("focus",d,!0),Sr=Sr.filter(_=>_!==e),l()))return;const{finalFocusTo:b}=t;b!==void 0?(y=Cu(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 B=u();if(B==null||B===_){o=!0,b.focus({preventScroll:!0}),o=!1;return}o=!0;const x=y==="first"?Ku(B):Gu(B);o=!1,x||(o=!0,b.focus({preventScroll:!0}),o=!1)}}}function m(y){if(o)return;const b=u();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:m,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 zS(t){return t}const ca="n-internal-select-menu",Qu="n-internal-select-menu-body",Ju="n-drawer-body",eh="n-modal-body",th="n-popover-body",nh="__disabled__";function En(t){const e=i.inject(eh,null),n=i.inject(Ju,null),r=i.inject(th,null),s=i.inject(Qu,null),o=i.ref();if(typeof document<"u"){o.value=document.fullscreenElement;const a=()=>{o.value=document.fullscreenElement};i.onMounted(()=>{Rt("fullscreenchange",document,a)}),i.onBeforeUnmount(()=>{ot("fullscreenchange",document,a)})}return Zt(()=>{var a;const{to:l}=t;return l!==void 0?l===!1?nh: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")})}En.tdkey=nh,En.propTo={type:[String,Object,Boolean],default:void 0};function Ax(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 ih(t,e){e&&(i.onMounted(()=>{const{value:n}=t;n&&Cr.registerHandler(n,e)}),i.watch(t,(n,r)=>{r&&Cr.unregisterHandler(r)},{deep:!1}),i.onBeforeUnmount(()=>{const{value:n}=t;n&&Cr.unregisterHandler(n)}))}function rh(t){return t.replace(/#|\(|\)|,|\s|\./g,"_")}const Mx=/^(\d|\.)+$/,sh=/(\d|\.)+/;function da(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(Mx.test(t)){const s=(Number(t)+n)*e;return r?s===0?"0":`${s}px`:`${s}`}else{const s=sh.exec(t);return s?t.replace(sh,String((Number(s[0])+n)*e)):t}return t}function oh(t){const{left:e,right:n,top:r,bottom:s}=nn(t);return`${r} ${e} ${s} ${n}`}var ah={};function Ox(t){let e=".",n="__",r="--",s;if(t){let m=t.blockPrefix;m&&(e=m),m=t.elementPrefix,m&&(n=m),m=t.modifierPrefix,m&&(r=m)}const o={install(m){s=m.c;const p=m.context;p.bem={},p.bem.b=null,p.bem.els=null}};function a(m){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 m=typeof m=="string"?m:m({context:b,props:_}),b.bem.b=m,`${(_==null?void 0:_.bPrefix)||e}${b.bem.b}`}}}function l(m){let p;return{before(y){p=y.bem.els},after(y){y.bem.els=p},$({context:y,props:b}){return m=typeof m=="string"?m:m({context:y,props:b}),y.bem.els=m.split(",").map(_=>_.trim()),y.bem.els.map(_=>`${(b==null?void 0:b.bPrefix)||e}${y.bem.b}${n}${_}`).join(", ")}}}function c(m){return{$({context:p,props:y}){m=typeof m=="string"?m:m({context:p,props:y});const b=m.split(",").map(x=>x.trim());function _(x){return b.map(N=>`&${(y==null?void 0:y.bPrefix)||e}${p.bem.b}${x!==void 0?`${n}${x}`:""}${r}${N}`).join(", ")}const B=p.bem.els;if(B!==null){if(ah.NODE_ENV!=="production"&&B.length>=2)throw Error(`[css-render/plugin-bem]: m(${m}) is invalid, using modifier inside multiple elements is not allowed`);return _(B[0])}else return _()}}}function d(m){return{$({context:p,props:y}){m=typeof m=="string"?m:m({context:p,props:y});const b=p.bem.els;if(ah.NODE_ENV!=="production"&&b!==null&&b.length>=2)throw Error(`[css-render/plugin-bem]: notM(${m}) 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}${m})`}}}return Object.assign(o,{cB:((...m)=>s(a(m[0]),m[1],m[2])),cE:((...m)=>s(l(m[0]),m[1],m[2])),cM:((...m)=>s(c(m[0]),m[1],m[2])),cNotM:((...m)=>s(d(m[0]),m[1],m[2]))}),o}const zx=".n-",Dx="__",Lx="--",lh=xu(),ch=Ox({blockPrefix:zx,elementPrefix:Dx,modifierPrefix:Lx});lh.use(ch);const{c:he,find:LS}=lh,{cB:ye,cE:we,cM:Re,cNotM:rn}=ch,Hx=(...t)=>he(">",[ye(...t)]);function Je(t,e){return t+(e==="default"?"":e.replace(/^[a-z]/,n=>n.toUpperCase()))}let ua;function Wx(){return ua===void 0&&(ua=navigator.userAgent.includes("Node.js")||navigator.userAgent.includes("jsdom")),ua}const jx=new WeakSet;function qx(t){jx.add(t)}function dh(t){switch(typeof t){case"string":return t||void 0;case"number":return String(t);default:return}}const uh=new Set;function ei(t,e){const n=`[naive/${t}]: ${e}`;uh.has(n)||(uh.add(n),console.error(n))}function hh(t,e){console.error(`[naive/${t}]: ${e}`)}function fh(t,e){throw new Error(`[naive/${t}]: ${e}`)}function _t(t,...e){if(Array.isArray(t))t.forEach(n=>_t(n,...e));else return t(...e)}function ha(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)){ha(r,e,n);return}if(r.type===i.Fragment){if(r.children===null)return;Array.isArray(r.children)&&ha(r.children,e,n)}else{if(r.type===i.Comment&&e)return;n.push(r)}}}),n}function Xx(t,e="default",n=void 0){const r=t[e];if(!r)return hh("getFirstSlotVNode",`slot[${e}] is empty`),null;const s=ha(r(n));return s.length===1?s[0]:(hh("getFirstSlotVNode",`slot[${e}] should have exactly one child`),null)}function Yx(t,e=[],n){const r={};return e.forEach(s=>{r[s]=t[s]}),Object.assign(r,n)}function fa(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 er(t,...e){return typeof t=="function"?t(...e):typeof t=="string"?i.createTextVNode(t):typeof t=="number"?i.createTextVNode(String(t)):null}function Ps(t){return t.some(e=>i.isVNode(e)?!(e.type===i.Comment||e.type===i.Fragment&&!Ps(e.children)):!0)?t:null}function ma(t,e){return t&&Ps(t())||e()}function xi(t,e){const n=t&&Ps(t());return e(n||null)}function mh(t){return!(t&&Ps(t()))}const ga=i.defineComponent({render(){var t,e;return(e=(t=this.$slots).default)===null||e===void 0?void 0:e.call(t)}}),ki="n-config-provider",Ux="n";function vi(t={},e={defaultBordered:!0}){const n=i.inject(ki,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(Ux),namespaceRef:i.computed(()=>n==null?void 0:n.mergedNamespaceRef.value)}}function Ci(t,e,n,r){n||fh("useThemeClass","cssVarsRef is not passed");const s=i.inject(ki,null),o=s==null?void 0:s.mergedThemeHashRef,a=s==null?void 0:s.styleMountTarget,l=i.ref(""),c=bi();let d;const u=`__${t}`,h=()=>{let f=u;const g=e?e.value:void 0,m=o==null?void 0:o.value;m&&(f+=`-${m}`),g&&(f+=`-${g}`);const{themeOverrides:p,builtinThemeOverrides:y}=r;p&&(f+=`-${ta(JSON.stringify(p))}`),y&&(f+=`-${ta(JSON.stringify(y))}`),l.value=f,d=()=>{const b=n.value;let _="";for(const B in b)_+=`${B}: ${b[B]};`;he(`.${f}`,_).mount({id:f,ssr:c,parent:a}),d=void 0}};return i.watchEffect(()=>{h()}),{themeClass:l,onRender:()=>{d==null||d()}}}const gh="n-form-item";function Kx(t,{defaultSize:e="medium",mergedSize:n,mergedDisabled:r}={}){const s=i.inject(gh,null);i.provide(gh,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 Gx={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 pa(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 Tr(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)?Qx(l,h=>h.test(a)):Zx(l,h=>h.test(a));let d;d=t.valueCallback?t.valueCallback(c):c,d=n.valueCallback?n.valueCallback(d):d;const u=e.slice(a.length);return{value:d,rest:u}}}function Zx(t,e){for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&e(t[n]))return n}function Qx(t,e){for(let n=0;n<t.length;n++)if(e(t[n]))return n}function Jx(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 ek={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"}},tk=(t,e,n)=>{let r;const s=ek[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},nk={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},ik=(t,e,n,r)=>nk[t],rk={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},sk={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},ok={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"]},ak={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"]},lk={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"}},ck={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"}},dk={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:rk,defaultWidth:"wide"}),quarter:Br({values:sk,defaultWidth:"wide",argumentCallback:t=>t-1}),month:Br({values:ok,defaultWidth:"wide"}),day:Br({values:ak,defaultWidth:"wide"}),dayPeriod:Br({values:lk,defaultWidth:"wide",formattingValues:ck,defaultFormattingWidth:"wide"})},uk=/^(\d+)(th|st|nd|rd)?/i,hk=/\d+/i,fk={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},mk={any:[/^b/i,/^(a|c)/i]},gk={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},pk={any:[/1/i,/2/i,/3/i,/4/i]},yk={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},bk={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]},_k={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},wk={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]},xk={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},kk={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}},vk={ordinalNumber:Jx({matchPattern:uk,parsePattern:hk,valueCallback:t=>parseInt(t,10)}),era:Tr({matchPatterns:fk,defaultMatchWidth:"wide",parsePatterns:mk,defaultParseWidth:"any"}),quarter:Tr({matchPatterns:gk,defaultMatchWidth:"wide",parsePatterns:pk,defaultParseWidth:"any",valueCallback:t=>t+1}),month:Tr({matchPatterns:yk,defaultMatchWidth:"wide",parsePatterns:bk,defaultParseWidth:"any"}),day:Tr({matchPatterns:_k,defaultMatchWidth:"wide",parsePatterns:wk,defaultParseWidth:"any"}),dayPeriod:Tr({matchPatterns:xk,defaultMatchWidth:"any",parsePatterns:kk,defaultParseWidth:"any"})},Ck={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Sk={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Bk={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Tk={date:pa({formats:Ck,defaultWidth:"full"}),time:pa({formats:Sk,defaultWidth:"full"}),dateTime:pa({formats:Bk,defaultWidth:"full"})},$k={name:"en-US",locale:{code:"en-US",formatDistance:tk,formatLong:Tk,formatRelative:ik,localize:dk,match:vk,options:{weekStartsOn:0,firstWeekContainsDate:1}}};function ph(t){const{mergedLocaleRef:e,mergedDateLocaleRef:n}=i.inject(ki,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:Gx[t]});return{dateLocaleRef:i.computed(()=>{var o;return(o=n==null?void 0:n.value)!==null&&o!==void 0?o:$k}),localeRef:r}}const $r="naive-ui-style";function Nr(t,e,n){if(!e)return;const r=bi(),s=i.computed(()=>{const{value:l}=e;if(!l)return;const c=l[t];if(c)return c}),o=i.inject(ki,null),a=()=>{i.watchEffect(()=>{const{value:l}=n,c=`${l}${t}Rtl`;if(Qw(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 Rr={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:Nk,fontFamily:Rk,lineHeight:Pk}=Rr,yh=he("body",`
|
|
117
117
|
margin: 0;
|
|
118
118
|
font-size: ${Nk};
|
|
119
119
|
font-family: ${Rk};
|
|
120
120
|
line-height: ${Pk};
|
|
121
121
|
-webkit-text-size-adjust: 100%;
|
|
122
122
|
-webkit-tap-highlight-color: transparent;
|
|
123
|
-
`,[
|
|
123
|
+
`,[he("input",`
|
|
124
124
|
font-family: inherit;
|
|
125
125
|
font-size: inherit;
|
|
126
|
-
`)]);var Ek={};function Es(t,e,n){if(!e){Ek.NODE_ENV!=="production"&&fh("use-style","No style is specified.");return}const r=bi(),s=i.inject(ki,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||yh.mount({id:"n-global",head:!0,anchorMetaName:$r,ssr:r,parent:s==null?void 0:s.styleMountTarget})};r?o():i.onBeforeMount(o)}function jS(t){return t}function wt(t,e,n,r,s,o){const a=bi(),l=i.inject(ki,null);if(n){const d=()=>{const u=o==null?void 0:o.value;n.mount({id:u===void 0?e:u+e,head:!0,props:{bPrefix:u?`.${u}-`:void 0},anchorMetaName:$r,ssr:a,parent:l==null?void 0:l.styleMountTarget}),l!=null&&l.preflightStyleDisabled||yh.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:u,self:h,peers:f={}}={},themeOverrides:g={},builtinThemeOverrides:m={}}=s,{common:p,peers:y}=g,{common:b=void 0,[t]:{common:_=void 0,self:B=void 0,peers:
|
|
126
|
+
`)]);var Ek={};function Es(t,e,n){if(!e){Ek.NODE_ENV!=="production"&&fh("use-style","No style is specified.");return}const r=bi(),s=i.inject(ki,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||yh.mount({id:"n-global",head:!0,anchorMetaName:$r,ssr:r,parent:s==null?void 0:s.styleMountTarget})};r?o():i.onBeforeMount(o)}function jS(t){return t}function wt(t,e,n,r,s,o){const a=bi(),l=i.inject(ki,null);if(n){const d=()=>{const u=o==null?void 0:o.value;n.mount({id:u===void 0?e:u+e,head:!0,props:{bPrefix:u?`.${u}-`:void 0},anchorMetaName:$r,ssr:a,parent:l==null?void 0:l.styleMountTarget}),l!=null&&l.preflightStyleDisabled||yh.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:u,self:h,peers:f={}}={},themeOverrides:g={},builtinThemeOverrides:m={}}=s,{common:p,peers:y}=g,{common:b=void 0,[t]:{common:_=void 0,self:B=void 0,peers:x={}}={}}=(l==null?void 0:l.mergedThemeRef.value)||{},{common:N=void 0,[t]:R={}}=(l==null?void 0:l.mergedThemeOverridesRef.value)||{},{common:w,peers:C={}}=R,k=I.merge({},u||_||b||r.common,N,w,p),T=I.merge((d=h||B||r.self)===null||d===void 0?void 0:d(k),m,R,g);return{common:k,self:T,peers:I.merge({},r.peers,x,f),peerOverrides:I.merge({},m.peers,C,y)}})}wt.props={theme:Object,themeOverrides:Object,builtinThemeOverrides:Object};const Fk=ye("base-icon",`
|
|
127
127
|
height: 1em;
|
|
128
128
|
width: 1em;
|
|
129
129
|
line-height: 1em;
|
|
@@ -131,15 +131,15 @@ ${s}
|
|
|
131
131
|
display: inline-block;
|
|
132
132
|
position: relative;
|
|
133
133
|
fill: currentColor;
|
|
134
|
-
`,[
|
|
134
|
+
`,[he("svg",`
|
|
135
135
|
height: 1em;
|
|
136
136
|
width: 1em;
|
|
137
|
-
`)]),Pr=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){Es("-base-icon",Fk,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)}}),bh=i.defineComponent({name:"BaseIconSwitchTransition",setup(t,{slots:e}){const n=ws();return()=>i.h(i.Transition,{name:"icon-switch-transition",appear:n.value},e)}});function _h(t,e){const n=i.defineComponent({render(){return e()}});return i.defineComponent({name:
|
|
137
|
+
`)]),Pr=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){Es("-base-icon",Fk,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)}}),bh=i.defineComponent({name:"BaseIconSwitchTransition",setup(t,{slots:e}){const n=ws();return()=>i.h(i.Transition,{name:"icon-switch-transition",appear:n.value},e)}});function _h(t,e){const n=i.defineComponent({render(){return e()}});return i.defineComponent({name:I.upperFirst(t),setup(){var r;const s=(r=i.inject(ki,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 Vk=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"})))}}),Ik=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"}))}}),Ak=_h("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"}))))),Mk=_h("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"}))))),Ok=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:zk}=Rr;function ya({originalTransform:t="",left:e=0,top:n=0,transition:r=`all .3s ${zk} !important`}={}){return[he("&.icon-switch-transition-enter-from, &.icon-switch-transition-leave-to",{transform:`${t} scale(0.75)`,left:e,top:n,opacity:0}),he("&.icon-switch-transition-enter-to, &.icon-switch-transition-leave-from",{transform:`scale(1) ${t}`,left:e,top:n,opacity:1}),he("&.icon-switch-transition-enter-active, &.icon-switch-transition-leave-active",{transformOrigin:"center",position:"absolute",left:e,top:n,transition:r})]}const Dk=ye("base-clear",`
|
|
138
138
|
flex-shrink: 0;
|
|
139
139
|
height: 1em;
|
|
140
140
|
width: 1em;
|
|
141
141
|
position: relative;
|
|
142
|
-
`,[
|
|
142
|
+
`,[he(">",[we("clear",`
|
|
143
143
|
font-size: var(--n-clear-size);
|
|
144
144
|
height: 1em;
|
|
145
145
|
width: 1em;
|
|
@@ -147,9 +147,9 @@ ${s}
|
|
|
147
147
|
color: var(--n-clear-color);
|
|
148
148
|
transition: color .3s var(--n-bezier);
|
|
149
149
|
display: flex;
|
|
150
|
-
`,[
|
|
150
|
+
`,[he("&:hover",`
|
|
151
151
|
color: var(--n-clear-color-hover)!important;
|
|
152
|
-
`),
|
|
152
|
+
`),he("&:active",`
|
|
153
153
|
color: var(--n-clear-color-pressed)!important;
|
|
154
154
|
`)]),we("placeholder",`
|
|
155
155
|
display: flex;
|
|
@@ -176,7 +176,7 @@ ${s}
|
|
|
176
176
|
`,[Re("absolute",`
|
|
177
177
|
height: var(--n-close-icon-size);
|
|
178
178
|
width: var(--n-close-icon-size);
|
|
179
|
-
`),
|
|
179
|
+
`),he("&::before",`
|
|
180
180
|
content: "";
|
|
181
181
|
position: absolute;
|
|
182
182
|
width: var(--n-close-size);
|
|
@@ -186,23 +186,23 @@ ${s}
|
|
|
186
186
|
transform: translateY(-50%) translateX(-50%);
|
|
187
187
|
transition: inherit;
|
|
188
188
|
border-radius: inherit;
|
|
189
|
-
`),rn("disabled",[
|
|
189
|
+
`),rn("disabled",[he("&:hover",`
|
|
190
190
|
color: var(--n-close-icon-color-hover);
|
|
191
|
-
`),
|
|
191
|
+
`),he("&:hover::before",`
|
|
192
192
|
background-color: var(--n-close-color-hover);
|
|
193
|
-
`),
|
|
193
|
+
`),he("&:focus::before",`
|
|
194
194
|
background-color: var(--n-close-color-hover);
|
|
195
|
-
`),
|
|
195
|
+
`),he("&:active",`
|
|
196
196
|
color: var(--n-close-icon-color-pressed);
|
|
197
|
-
`),
|
|
197
|
+
`),he("&:active::before",`
|
|
198
198
|
background-color: var(--n-close-color-pressed);
|
|
199
199
|
`)]),Re("disabled",`
|
|
200
200
|
cursor: not-allowed;
|
|
201
201
|
color: var(--n-close-icon-color-disabled);
|
|
202
202
|
background-color: transparent;
|
|
203
|
-
`),Re("round",[
|
|
203
|
+
`),Re("round",[he("&::before",`
|
|
204
204
|
border-radius: 50%;
|
|
205
|
-
`)])]),Wk=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 Es("-base-close",Hk,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(Pr,{clsPrefix:e},{default:()=>i.h(Mk,null)}))}}}),jk=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})}}),qk=
|
|
205
|
+
`)])]),Wk=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 Es("-base-close",Hk,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(Pr,{clsPrefix:e},{default:()=>i.h(Mk,null)}))}}}),jk=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})}}),qk=he([he("@keyframes rotator",`
|
|
206
206
|
0% {
|
|
207
207
|
-webkit-transform: rotate(0deg);
|
|
208
208
|
transform: rotate(0deg);
|
|
@@ -229,27 +229,27 @@ ${s}
|
|
|
229
229
|
`,[we("icon",`
|
|
230
230
|
height: 1em;
|
|
231
231
|
width: 1em;
|
|
232
|
-
`)])])]),ba="1.6s",Xk={strokeWidth:{type:Number,default:28},stroke:{type:String,default:void 0}},wh=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}},Xk),setup(t){Es("-base-loading",qk,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(bh,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:ba,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:ba,fill:"freeze",repeatCount:"indefinite"}),i.h("animate",{attributeName:"stroke-dashoffset",values:`${5.67*e};${1.42*e};${5.67*e}`,begin:"0s",dur:ba,fill:"freeze",repeatCount:"indefinite"})))))):i.h("div",{key:"placeholder",class:`${t}-base-loading__placeholder`},this.$slots)}))}}),{cubicBezierEaseInOut:xh}=Rr;function Yk({name:t="fade-in",enterDuration:e="0.2s",leaveDuration:n="0.2s",enterCubicBezier:r=xh,leaveCubicBezier:s=xh}={}){return[
|
|
232
|
+
`)])])]),ba="1.6s",Xk={strokeWidth:{type:Number,default:28},stroke:{type:String,default:void 0}},wh=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}},Xk),setup(t){Es("-base-loading",qk,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(bh,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:ba,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:ba,fill:"freeze",repeatCount:"indefinite"}),i.h("animate",{attributeName:"stroke-dashoffset",values:`${5.67*e};${1.42*e};${5.67*e}`,begin:"0s",dur:ba,fill:"freeze",repeatCount:"indefinite"})))))):i.h("div",{key:"placeholder",class:`${t}-base-loading__placeholder`},this.$slots)}))}}),{cubicBezierEaseInOut:xh}=Rr;function Yk({name:t="fade-in",enterDuration:e="0.2s",leaveDuration:n="0.2s",enterCubicBezier:r=xh,leaveCubicBezier:s=xh}={}){return[he(`&.${t}-transition-enter-active`,{transition:`all ${e} ${r}!important`}),he(`&.${t}-transition-leave-active`,{transition:`all ${n} ${s}!important`}),he(`&.${t}-transition-enter-from, &.${t}-transition-leave-to`,{opacity:0}),he(`&.${t}-transition-leave-from, &.${t}-transition-enter-to`,{opacity:1})]}const ge={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"},Uk=pi(ge.neutralBase),kh=pi(ge.neutralInvertBase),Kk=`rgba(${kh.slice(0,3).join(", ")}, `;function vh(t){return`${Kk+String(t)})`}function xt(t){const e=Array.from(kh);return e[3]=Number(t),L1(Uk,e)}const Si=Object.assign(Object.assign({name:"common"},Rr),{baseColor:ge.neutralBase,primaryColor:ge.primaryDefault,primaryColorHover:ge.primaryHover,primaryColorPressed:ge.primaryActive,primaryColorSuppl:ge.primarySuppl,infoColor:ge.infoDefault,infoColorHover:ge.infoHover,infoColorPressed:ge.infoActive,infoColorSuppl:ge.infoSuppl,successColor:ge.successDefault,successColorHover:ge.successHover,successColorPressed:ge.successActive,successColorSuppl:ge.successSuppl,warningColor:ge.warningDefault,warningColorHover:ge.warningHover,warningColorPressed:ge.warningActive,warningColorSuppl:ge.warningSuppl,errorColor:ge.errorDefault,errorColorHover:ge.errorHover,errorColorPressed:ge.errorActive,errorColorSuppl:ge.errorSuppl,textColorBase:ge.neutralTextBase,textColor1:"rgb(31, 34, 37)",textColor2:"rgb(51, 54, 57)",textColor3:"rgb(118, 124, 130)",textColorDisabled:xt(ge.alpha4),placeholderColor:xt(ge.alpha4),placeholderColorDisabled:xt(ge.alpha5),iconColor:xt(ge.alpha4),iconColorHover:gs(xt(ge.alpha4),{lightness:.75}),iconColorPressed:gs(xt(ge.alpha4),{lightness:.9}),iconColorDisabled:xt(ge.alpha5),opacity1:ge.alpha1,opacity2:ge.alpha2,opacity3:ge.alpha3,opacity4:ge.alpha4,opacity5:ge.alpha5,dividerColor:"rgb(239, 239, 245)",borderColor:"rgb(224, 224, 230)",closeIconColor:xt(Number(ge.alphaClose)),closeIconColorHover:xt(Number(ge.alphaClose)),closeIconColorPressed:xt(Number(ge.alphaClose)),closeColorHover:"rgba(0, 0, 0, .09)",closeColorPressed:"rgba(0, 0, 0, .13)",clearColor:xt(ge.alpha4),clearColorHover:gs(xt(ge.alpha4),{lightness:.75}),clearColorPressed:gs(xt(ge.alpha4),{lightness:.9}),scrollbarColor:vh(ge.alphaScrollbar),scrollbarColorHover:vh(ge.alphaScrollbarHover),scrollbarWidth:"5px",scrollbarHeight:"5px",scrollbarBorderRadius:"5px",progressRailColor:xt(ge.alphaProgressRail),railColor:"rgb(219, 219, 223)",popoverColor:ge.neutralPopover,tableColor:ge.neutralCard,cardColor:ge.neutralCard,modalColor:ge.neutralModal,bodyColor:ge.neutralBody,tagColor:"#eee",avatarColor:xt(ge.alphaAvatar),invertedColor:"rgb(0, 20, 40)",inputColor:xt(ge.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:ge.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)"}),Gk={railInsetHorizontalBottom:"auto 2px 4px 2px",railInsetHorizontalTop:"4px 2px auto 2px",railInsetVerticalRight:"2px 4px 2px auto",railInsetVerticalLeft:"2px auto 2px 4px",railColor:"transparent"};function Zk(t){const{scrollbarColor:e,scrollbarColorHover:n,scrollbarHeight:r,scrollbarWidth:s,scrollbarBorderRadius:o}=t;return Object.assign(Object.assign({},Gk),{height:r,width:s,borderRadius:o,color:e,colorHover:n})}const _a={name:"Scrollbar",common:Si,self:Zk},Qk=ye("scrollbar",`
|
|
233
233
|
overflow: hidden;
|
|
234
234
|
position: relative;
|
|
235
235
|
z-index: auto;
|
|
236
236
|
height: 100%;
|
|
237
237
|
width: 100%;
|
|
238
|
-
`,[
|
|
238
|
+
`,[he(">",[ye("scrollbar-container",`
|
|
239
239
|
width: 100%;
|
|
240
240
|
overflow: scroll;
|
|
241
241
|
height: 100%;
|
|
242
242
|
min-height: inherit;
|
|
243
243
|
max-height: inherit;
|
|
244
244
|
scrollbar-width: none;
|
|
245
|
-
`,[
|
|
245
|
+
`,[he("&::-webkit-scrollbar, &::-webkit-scrollbar-track-piece, &::-webkit-scrollbar-thumb",`
|
|
246
246
|
width: 0;
|
|
247
247
|
height: 0;
|
|
248
248
|
display: none;
|
|
249
|
-
`),
|
|
249
|
+
`),he(">",[ye("scrollbar-content",`
|
|
250
250
|
box-sizing: border-box;
|
|
251
251
|
min-width: 100%;
|
|
252
|
-
`)])])]),
|
|
252
|
+
`)])])]),he(">, +",[ye("scrollbar-rail",`
|
|
253
253
|
position: absolute;
|
|
254
254
|
pointer-events: none;
|
|
255
255
|
user-select: none;
|
|
@@ -257,7 +257,7 @@ ${s}
|
|
|
257
257
|
-webkit-user-select: none;
|
|
258
258
|
`,[Re("horizontal",`
|
|
259
259
|
height: var(--n-scrollbar-height);
|
|
260
|
-
`,[
|
|
260
|
+
`,[he(">",[we("scrollbar",`
|
|
261
261
|
height: var(--n-scrollbar-height);
|
|
262
262
|
border-radius: var(--n-scrollbar-border-radius);
|
|
263
263
|
right: 0;
|
|
@@ -273,7 +273,7 @@ ${s}
|
|
|
273
273
|
left: var(--n-scrollbar-rail-left-horizontal-bottom);
|
|
274
274
|
`),Re("vertical",`
|
|
275
275
|
width: var(--n-scrollbar-width);
|
|
276
|
-
`,[
|
|
276
|
+
`,[he(">",[we("scrollbar",`
|
|
277
277
|
width: var(--n-scrollbar-width);
|
|
278
278
|
border-radius: var(--n-scrollbar-border-radius);
|
|
279
279
|
bottom: 0;
|
|
@@ -287,14 +287,14 @@ ${s}
|
|
|
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
|
-
`),Re("disabled",[
|
|
290
|
+
`),Re("disabled",[he(">",[we("scrollbar","pointer-events: none;")])]),he(">",[we("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
|
-
`,[Yk(),ue("&:hover","background-color: var(--n-scrollbar-color-hover);")])])])])]),Jk=Object.assign(Object.assign({},wt.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"}}),Ch=i.defineComponent({name:"Scrollbar",props:Jk,inheritAttrs:!1,setup(t){const{mergedClsPrefixRef:e,inlineThemeDisabled:n,mergedRtlRef:r}=vi(t),s=Nr("Scrollbar",r,e),o=i.ref(null),a=i.ref(null),l=i.ref(null),c=i.ref(null),d=i.ref(null),u=i.ref(null),h=i.ref(null),f=i.ref(null),g=i.ref(null),m=i.ref(null),p=i.ref(null),y=i.ref(0),b=i.ref(0),_=i.ref(!1),B=i.ref(!1);let k=!1,N=!1,R,w,C=0,x=0,T=0,$=0;const F=Nw(),I=wt("Scrollbar","-scrollbar",Qk,_a,t,e),L=i.computed(()=>{const{value:A}=f,{value:G}=u,{value:oe}=m;return A===null||G===null||oe===null?0:Math.min(A,oe*A/G+_r(I.value.self.width)*1.5)}),O=i.computed(()=>`${L.value}px`),Z=i.computed(()=>{const{value:A}=g,{value:G}=h,{value:oe}=p;return A===null||G===null||oe===null?0:oe*A/G+_r(I.value.self.height)*1.5}),ne=i.computed(()=>`${Z.value}px`),E=i.computed(()=>{const{value:A}=f,{value:G}=y,{value:oe}=u,{value:fe}=m;if(A===null||oe===null||fe===null)return 0;{const me=oe-A;return me?G/me*(fe-L.value):0}}),P=i.computed(()=>`${E.value}px`),H=i.computed(()=>{const{value:A}=g,{value:G}=b,{value:oe}=h,{value:fe}=p;if(A===null||oe===null||fe===null)return 0;{const me=oe-A;return me?G/me*(fe-Z.value):0}}),Y=i.computed(()=>`${H.value}px`),D=i.computed(()=>{const{value:A}=f,{value:G}=u;return A!==null&&G!==null&&G>A}),X=i.computed(()=>{const{value:A}=g,{value:G}=h;return A!==null&&G!==null&&G>A}),W=i.computed(()=>{const{trigger:A}=t;return A==="none"||_.value}),V=i.computed(()=>{const{trigger:A}=t;return A==="none"||B.value}),j=i.computed(()=>{const{container:A}=t;return A?A():a.value}),U=i.computed(()=>{const{content:A}=t;return A?A():l.value}),ee=(A,G)=>{if(!t.scrollable)return;if(typeof A=="number"){ce(A,G??0,0,!1,"auto");return}const{left:oe,top:fe,index:me,elSize:_e,position:ke,behavior:Ce,el:Ze,debounce:Sn=!0}=A;(oe!==void 0||fe!==void 0)&&ce(oe??0,fe??0,0,!1,Ce),Ze!==void 0?ce(0,Ze.offsetTop,Ze.offsetHeight,Sn,Ce):me!==void 0&&_e!==void 0?ce(0,me*_e,_e,Sn,Ce):ke==="bottom"?ce(0,Number.MAX_SAFE_INTEGER,0,!1,Ce):ke==="top"&&ce(0,0,0,!1,Ce)},he=Ax(()=>{t.container||ee({top:y.value,left:b.value})}),Be=()=>{he.isDeactivated||le()},Te=A=>{if(he.isDeactivated)return;const{onResize:G}=t;G&&G(A),le()},He=(A,G)=>{if(!t.scrollable)return;const{value:oe}=j;oe&&(typeof A=="object"?oe.scrollBy(A):oe.scrollBy(A,G||0))};function ce(A,G,oe,fe,me){const{value:_e}=j;if(_e){if(fe){const{scrollTop:ke,offsetHeight:Ce}=_e;if(G>ke){G+oe<=ke+Ce||_e.scrollTo({left:A,top:G+oe-Ce,behavior:me});return}}_e.scrollTo({left:A,top:G,behavior:me})}}function mt(){Ct(),Ln(),le()}function $e(){Et()}function Et(){Wt(),an()}function Wt(){w!==void 0&&window.clearTimeout(w),w=window.setTimeout(()=>{B.value=!1},t.duration)}function an(){R!==void 0&&window.clearTimeout(R),R=window.setTimeout(()=>{_.value=!1},t.duration)}function Ct(){R!==void 0&&window.clearTimeout(R),_.value=!0}function Ln(){w!==void 0&&window.clearTimeout(w),B.value=!0}function ln(A){const{onScroll:G}=t;G&&G(A),Jt()}function Jt(){const{value:A}=j;A&&(y.value=A.scrollTop,b.value=A.scrollLeft*(s!=null&&s.value?-1:1))}function Ve(){const{value:A}=U;A&&(u.value=A.offsetHeight,h.value=A.offsetWidth);const{value:G}=j;G&&(f.value=G.offsetHeight,g.value=G.offsetWidth);const{value:oe}=d,{value:fe}=c;oe&&(p.value=oe.offsetWidth),fe&&(m.value=fe.offsetHeight)}function J(){const{value:A}=j;A&&(y.value=A.scrollTop,b.value=A.scrollLeft*(s!=null&&s.value?-1:1),f.value=A.offsetHeight,g.value=A.offsetWidth,u.value=A.scrollHeight,h.value=A.scrollWidth);const{value:G}=d,{value:oe}=c;G&&(p.value=G.offsetWidth),oe&&(m.value=oe.offsetHeight)}function le(){t.scrollable&&(t.useUnifiedContainer?J():(Ve(),Jt()))}function De(A){var G;return!(!((G=o.value)===null||G===void 0)&&G.contains(br(A)))}function ni(A){A.preventDefault(),A.stopPropagation(),N=!0,Rt("mousemove",window,nt,!0),Rt("mouseup",window,jt,!0),x=b.value,T=s!=null&&s.value?window.innerWidth-A.clientX:A.clientX}function nt(A){if(!N)return;R!==void 0&&window.clearTimeout(R),w!==void 0&&window.clearTimeout(w);const{value:G}=g,{value:oe}=h,{value:fe}=Z;if(G===null||oe===null)return;const _e=(s!=null&&s.value?window.innerWidth-A.clientX-T:A.clientX-T)*(oe-G)/(G-fe),ke=oe-G;let Ce=x+_e;Ce=Math.min(ke,Ce),Ce=Math.max(Ce,0);const{value:Ze}=j;if(Ze){Ze.scrollLeft=Ce*(s!=null&&s.value?-1:1);const{internalOnUpdateScrollLeft:Sn}=t;Sn&&Sn(Ce)}}function jt(A){A.preventDefault(),A.stopPropagation(),ot("mousemove",window,nt,!0),ot("mouseup",window,jt,!0),N=!1,le(),De(A)&&Et()}function tr(A){A.preventDefault(),A.stopPropagation(),k=!0,Rt("mousemove",window,ii,!0),Rt("mouseup",window,Ni,!0),C=y.value,$=A.clientY}function ii(A){if(!k)return;R!==void 0&&window.clearTimeout(R),w!==void 0&&window.clearTimeout(w);const{value:G}=f,{value:oe}=u,{value:fe}=L;if(G===null||oe===null)return;const _e=(A.clientY-$)*(oe-G)/(G-fe),ke=oe-G;let Ce=C+_e;Ce=Math.min(ke,Ce),Ce=Math.max(Ce,0);const{value:Ze}=j;Ze&&(Ze.scrollTop=Ce)}function Ni(A){A.preventDefault(),A.stopPropagation(),ot("mousemove",window,ii,!0),ot("mouseup",window,Ni,!0),k=!1,le(),De(A)&&Et()}i.watchEffect(()=>{const{value:A}=X,{value:G}=D,{value:oe}=e,{value:fe}=d,{value:me}=c;fe&&(A?fe.classList.remove(`${oe}-scrollbar-rail--disabled`):fe.classList.add(`${oe}-scrollbar-rail--disabled`)),me&&(G?me.classList.remove(`${oe}-scrollbar-rail--disabled`):me.classList.add(`${oe}-scrollbar-rail--disabled`))}),i.onMounted(()=>{t.container||le()}),i.onBeforeUnmount(()=>{R!==void 0&&window.clearTimeout(R),w!==void 0&&window.clearTimeout(w),ot("mousemove",window,ii,!0),ot("mouseup",window,Ni,!0)});const nr=i.computed(()=>{const{common:{cubicBezierEaseInOut:A},self:{color:G,colorHover:oe,height:fe,width:me,borderRadius:_e,railInsetHorizontalTop:ke,railInsetHorizontalBottom:Ce,railInsetVerticalRight:Ze,railInsetVerticalLeft:Sn,railColor:$a}}=I.value,{top:Na,right:Ra,bottom:Pa,left:Ea}=nn(ke),{top:Fa,right:Va,bottom:Ia,left:Aa}=nn(Ce),{top:Ma,right:Oa,bottom:za,left:Da}=nn(s!=null&&s.value?oh(Ze):Ze),{top:La,right:Ha,bottom:Wa,left:ja}=nn(s!=null&&s.value?oh(Sn):Sn);return{"--n-scrollbar-bezier":A,"--n-scrollbar-color":G,"--n-scrollbar-color-hover":oe,"--n-scrollbar-border-radius":_e,"--n-scrollbar-width":me,"--n-scrollbar-height":fe,"--n-scrollbar-rail-top-horizontal-top":Na,"--n-scrollbar-rail-right-horizontal-top":Ra,"--n-scrollbar-rail-bottom-horizontal-top":Pa,"--n-scrollbar-rail-left-horizontal-top":Ea,"--n-scrollbar-rail-top-horizontal-bottom":Fa,"--n-scrollbar-rail-right-horizontal-bottom":Va,"--n-scrollbar-rail-bottom-horizontal-bottom":Ia,"--n-scrollbar-rail-left-horizontal-bottom":Aa,"--n-scrollbar-rail-top-vertical-right":Ma,"--n-scrollbar-rail-right-vertical-right":Oa,"--n-scrollbar-rail-bottom-vertical-right":za,"--n-scrollbar-rail-left-vertical-right":Da,"--n-scrollbar-rail-top-vertical-left":La,"--n-scrollbar-rail-right-vertical-left":Ha,"--n-scrollbar-rail-bottom-vertical-left":Wa,"--n-scrollbar-rail-left-vertical-left":ja,"--n-scrollbar-rail-color":$a}}),cn=n?Ci("scrollbar",void 0,nr,t):void 0;return Object.assign(Object.assign({},{scrollTo:ee,scrollBy:He,sync:le,syncUnifiedContainer:J,handleMouseEnterWrapper:mt,handleMouseLeaveWrapper:$e}),{mergedClsPrefix:e,rtlEnabled:s,containerScrollTop:y,wrapperRef:o,containerRef:a,contentRef:l,yRailRef:c,xRailRef:d,needYBar:D,needXBar:X,yBarSizePx:O,xBarSizePx:ne,yBarTopPx:P,xBarLeftPx:Y,isShowXBar:W,isShowYBar:V,isIos:F,handleScroll:ln,handleContentResize:Be,handleContainerResize:Te,handleYScrollMouseDown:tr,handleXScrollMouseDown:ni,cssVars:n?void 0:nr,themeClass:cn==null?void 0:cn.themeClass,onRender:cn==null?void 0:cn.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",u=(g,m)=>i.h("div",{ref:"yRailRef",class:[`${n}-scrollbar-rail`,`${n}-scrollbar-rail--vertical`,`${n}-scrollbar-rail--vertical--${a}`,g],"data-scrollbar-rail":!0,style:[m||"",this.verticalRailStyle],"aria-hidden":!0},i.h(d?ga: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})),h=()=>{var g,m;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?(m=e.default)===null||m===void 0?void 0:m.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(Ns,{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:u(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?ga: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}))])},f=this.container?h():i.h(Ns,{onResize:this.handleContainerResize},{default:h});return o?i.h(i.Fragment,null,f,u(this.themeClass,this.cssVars)):f}}),ev=Ch,tv={iconSizeTiny:"28px",iconSizeSmall:"34px",iconSizeMedium:"40px",iconSizeLarge:"46px",iconSizeHuge:"52px"};function nv(t){const{textColorDisabled:e,iconColor:n,textColor2:r,fontSizeTiny:s,fontSizeSmall:o,fontSizeMedium:a,fontSizeLarge:l,fontSizeHuge:c}=t;return Object.assign(Object.assign({},tv),{fontSizeTiny:s,fontSizeSmall:o,fontSizeMedium:a,fontSizeLarge:l,fontSizeHuge:c,textColor:e,iconColor:n,extraTextColor:r})}const Sh={name:"Empty",common:Si,self:nv},iv=ye("empty",`
|
|
297
|
+
`,[Yk(),he("&:hover","background-color: var(--n-scrollbar-color-hover);")])])])])]),Jk=Object.assign(Object.assign({},wt.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"}}),Ch=i.defineComponent({name:"Scrollbar",props:Jk,inheritAttrs:!1,setup(t){const{mergedClsPrefixRef:e,inlineThemeDisabled:n,mergedRtlRef:r}=vi(t),s=Nr("Scrollbar",r,e),o=i.ref(null),a=i.ref(null),l=i.ref(null),c=i.ref(null),d=i.ref(null),u=i.ref(null),h=i.ref(null),f=i.ref(null),g=i.ref(null),m=i.ref(null),p=i.ref(null),y=i.ref(0),b=i.ref(0),_=i.ref(!1),B=i.ref(!1);let x=!1,N=!1,R,w,C=0,k=0,T=0,$=0;const P=Nw(),E=wt("Scrollbar","-scrollbar",Qk,_a,t,e),W=i.computed(()=>{const{value:F}=f,{value:G}=u,{value:oe}=m;return F===null||G===null||oe===null?0:Math.min(F,oe*F/G+_r(E.value.self.width)*1.5)}),A=i.computed(()=>`${W.value}px`),Z=i.computed(()=>{const{value:F}=g,{value:G}=h,{value:oe}=p;return F===null||G===null||oe===null?0:oe*F/G+_r(E.value.self.height)*1.5}),te=i.computed(()=>`${Z.value}px`),D=i.computed(()=>{const{value:F}=f,{value:G}=y,{value:oe}=u,{value:fe}=m;if(F===null||oe===null||fe===null)return 0;{const me=oe-F;return me?G/me*(fe-W.value):0}}),H=i.computed(()=>`${D.value}px`),L=i.computed(()=>{const{value:F}=g,{value:G}=b,{value:oe}=h,{value:fe}=p;if(F===null||oe===null||fe===null)return 0;{const me=oe-F;return me?G/me*(fe-Z.value):0}}),M=i.computed(()=>`${L.value}px`),O=i.computed(()=>{const{value:F}=f,{value:G}=u;return F!==null&&G!==null&&G>F}),Y=i.computed(()=>{const{value:F}=g,{value:G}=h;return F!==null&&G!==null&&G>F}),U=i.computed(()=>{const{trigger:F}=t;return F==="none"||_.value}),V=i.computed(()=>{const{trigger:F}=t;return F==="none"||B.value}),j=i.computed(()=>{const{container:F}=t;return F?F():a.value}),q=i.computed(()=>{const{content:F}=t;return F?F():l.value}),ee=(F,G)=>{if(!t.scrollable)return;if(typeof F=="number"){ce(F,G??0,0,!1,"auto");return}const{left:oe,top:fe,index:me,elSize:_e,position:ke,behavior:Se,el:Ze,debounce:Sn=!0}=F;(oe!==void 0||fe!==void 0)&&ce(oe??0,fe??0,0,!1,Se),Ze!==void 0?ce(0,Ze.offsetTop,Ze.offsetHeight,Sn,Se):me!==void 0&&_e!==void 0?ce(0,me*_e,_e,Sn,Se):ke==="bottom"?ce(0,Number.MAX_SAFE_INTEGER,0,!1,Se):ke==="top"&&ce(0,0,0,!1,Se)},ue=Ax(()=>{t.container||ee({top:y.value,left:b.value})}),ve=()=>{ue.isDeactivated||le()},Te=F=>{if(ue.isDeactivated)return;const{onResize:G}=t;G&&G(F),le()},He=(F,G)=>{if(!t.scrollable)return;const{value:oe}=j;oe&&(typeof F=="object"?oe.scrollBy(F):oe.scrollBy(F,G||0))};function ce(F,G,oe,fe,me){const{value:_e}=j;if(_e){if(fe){const{scrollTop:ke,offsetHeight:Se}=_e;if(G>ke){G+oe<=ke+Se||_e.scrollTo({left:F,top:G+oe-Se,behavior:me});return}}_e.scrollTo({left:F,top:G,behavior:me})}}function mt(){Ct(),Ln(),le()}function $e(){Et()}function Et(){Wt(),an()}function Wt(){w!==void 0&&window.clearTimeout(w),w=window.setTimeout(()=>{B.value=!1},t.duration)}function an(){R!==void 0&&window.clearTimeout(R),R=window.setTimeout(()=>{_.value=!1},t.duration)}function Ct(){R!==void 0&&window.clearTimeout(R),_.value=!0}function Ln(){w!==void 0&&window.clearTimeout(w),B.value=!0}function ln(F){const{onScroll:G}=t;G&&G(F),Jt()}function Jt(){const{value:F}=j;F&&(y.value=F.scrollTop,b.value=F.scrollLeft*(s!=null&&s.value?-1:1))}function Ve(){const{value:F}=q;F&&(u.value=F.offsetHeight,h.value=F.offsetWidth);const{value:G}=j;G&&(f.value=G.offsetHeight,g.value=G.offsetWidth);const{value:oe}=d,{value:fe}=c;oe&&(p.value=oe.offsetWidth),fe&&(m.value=fe.offsetHeight)}function J(){const{value:F}=j;F&&(y.value=F.scrollTop,b.value=F.scrollLeft*(s!=null&&s.value?-1:1),f.value=F.offsetHeight,g.value=F.offsetWidth,u.value=F.scrollHeight,h.value=F.scrollWidth);const{value:G}=d,{value:oe}=c;G&&(p.value=G.offsetWidth),oe&&(m.value=oe.offsetHeight)}function le(){t.scrollable&&(t.useUnifiedContainer?J():(Ve(),Jt()))}function De(F){var G;return!(!((G=o.value)===null||G===void 0)&&G.contains(br(F)))}function ni(F){F.preventDefault(),F.stopPropagation(),N=!0,Rt("mousemove",window,nt,!0),Rt("mouseup",window,jt,!0),k=b.value,T=s!=null&&s.value?window.innerWidth-F.clientX:F.clientX}function nt(F){if(!N)return;R!==void 0&&window.clearTimeout(R),w!==void 0&&window.clearTimeout(w);const{value:G}=g,{value:oe}=h,{value:fe}=Z;if(G===null||oe===null)return;const _e=(s!=null&&s.value?window.innerWidth-F.clientX-T:F.clientX-T)*(oe-G)/(G-fe),ke=oe-G;let Se=k+_e;Se=Math.min(ke,Se),Se=Math.max(Se,0);const{value:Ze}=j;if(Ze){Ze.scrollLeft=Se*(s!=null&&s.value?-1:1);const{internalOnUpdateScrollLeft:Sn}=t;Sn&&Sn(Se)}}function jt(F){F.preventDefault(),F.stopPropagation(),ot("mousemove",window,nt,!0),ot("mouseup",window,jt,!0),N=!1,le(),De(F)&&Et()}function tr(F){F.preventDefault(),F.stopPropagation(),x=!0,Rt("mousemove",window,ii,!0),Rt("mouseup",window,Ni,!0),C=y.value,$=F.clientY}function ii(F){if(!x)return;R!==void 0&&window.clearTimeout(R),w!==void 0&&window.clearTimeout(w);const{value:G}=f,{value:oe}=u,{value:fe}=W;if(G===null||oe===null)return;const _e=(F.clientY-$)*(oe-G)/(G-fe),ke=oe-G;let Se=C+_e;Se=Math.min(ke,Se),Se=Math.max(Se,0);const{value:Ze}=j;Ze&&(Ze.scrollTop=Se)}function Ni(F){F.preventDefault(),F.stopPropagation(),ot("mousemove",window,ii,!0),ot("mouseup",window,Ni,!0),x=!1,le(),De(F)&&Et()}i.watchEffect(()=>{const{value:F}=Y,{value:G}=O,{value:oe}=e,{value:fe}=d,{value:me}=c;fe&&(F?fe.classList.remove(`${oe}-scrollbar-rail--disabled`):fe.classList.add(`${oe}-scrollbar-rail--disabled`)),me&&(G?me.classList.remove(`${oe}-scrollbar-rail--disabled`):me.classList.add(`${oe}-scrollbar-rail--disabled`))}),i.onMounted(()=>{t.container||le()}),i.onBeforeUnmount(()=>{R!==void 0&&window.clearTimeout(R),w!==void 0&&window.clearTimeout(w),ot("mousemove",window,ii,!0),ot("mouseup",window,Ni,!0)});const nr=i.computed(()=>{const{common:{cubicBezierEaseInOut:F},self:{color:G,colorHover:oe,height:fe,width:me,borderRadius:_e,railInsetHorizontalTop:ke,railInsetHorizontalBottom:Se,railInsetVerticalRight:Ze,railInsetVerticalLeft:Sn,railColor:$a}}=E.value,{top:Na,right:Ra,bottom:Pa,left:Ea}=nn(ke),{top:Fa,right:Va,bottom:Ia,left:Aa}=nn(Se),{top:Ma,right:Oa,bottom:za,left:Da}=nn(s!=null&&s.value?oh(Ze):Ze),{top:La,right:Ha,bottom:Wa,left:ja}=nn(s!=null&&s.value?oh(Sn):Sn);return{"--n-scrollbar-bezier":F,"--n-scrollbar-color":G,"--n-scrollbar-color-hover":oe,"--n-scrollbar-border-radius":_e,"--n-scrollbar-width":me,"--n-scrollbar-height":fe,"--n-scrollbar-rail-top-horizontal-top":Na,"--n-scrollbar-rail-right-horizontal-top":Ra,"--n-scrollbar-rail-bottom-horizontal-top":Pa,"--n-scrollbar-rail-left-horizontal-top":Ea,"--n-scrollbar-rail-top-horizontal-bottom":Fa,"--n-scrollbar-rail-right-horizontal-bottom":Va,"--n-scrollbar-rail-bottom-horizontal-bottom":Ia,"--n-scrollbar-rail-left-horizontal-bottom":Aa,"--n-scrollbar-rail-top-vertical-right":Ma,"--n-scrollbar-rail-right-vertical-right":Oa,"--n-scrollbar-rail-bottom-vertical-right":za,"--n-scrollbar-rail-left-vertical-right":Da,"--n-scrollbar-rail-top-vertical-left":La,"--n-scrollbar-rail-right-vertical-left":Ha,"--n-scrollbar-rail-bottom-vertical-left":Wa,"--n-scrollbar-rail-left-vertical-left":ja,"--n-scrollbar-rail-color":$a}}),cn=n?Ci("scrollbar",void 0,nr,t):void 0;return Object.assign(Object.assign({},{scrollTo:ee,scrollBy:He,sync:le,syncUnifiedContainer:J,handleMouseEnterWrapper:mt,handleMouseLeaveWrapper:$e}),{mergedClsPrefix:e,rtlEnabled:s,containerScrollTop:y,wrapperRef:o,containerRef:a,contentRef:l,yRailRef:c,xRailRef:d,needYBar:O,needXBar:Y,yBarSizePx:A,xBarSizePx:te,yBarTopPx:H,xBarLeftPx:M,isShowXBar:U,isShowYBar:V,isIos:P,handleScroll:ln,handleContentResize:ve,handleContainerResize:Te,handleYScrollMouseDown:tr,handleXScrollMouseDown:ni,cssVars:n?void 0:nr,themeClass:cn==null?void 0:cn.themeClass,onRender:cn==null?void 0:cn.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",u=(g,m)=>i.h("div",{ref:"yRailRef",class:[`${n}-scrollbar-rail`,`${n}-scrollbar-rail--vertical`,`${n}-scrollbar-rail--vertical--${a}`,g],"data-scrollbar-rail":!0,style:[m||"",this.verticalRailStyle],"aria-hidden":!0},i.h(d?ga: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})),h=()=>{var g,m;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?(m=e.default)===null||m===void 0?void 0:m.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(Ns,{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:u(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?ga: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}))])},f=this.container?h():i.h(Ns,{onResize:this.handleContainerResize},{default:h});return o?i.h(i.Fragment,null,f,u(this.themeClass,this.cssVars)):f}}),ev=Ch,tv={iconSizeTiny:"28px",iconSizeSmall:"34px",iconSizeMedium:"40px",iconSizeLarge:"46px",iconSizeHuge:"52px"};function nv(t){const{textColorDisabled:e,iconColor:n,textColor2:r,fontSizeTiny:s,fontSizeSmall:o,fontSizeMedium:a,fontSizeLarge:l,fontSizeHuge:c}=t;return Object.assign(Object.assign({},tv),{fontSizeTiny:s,fontSizeSmall:o,fontSizeMedium:a,fontSizeLarge:l,fontSizeHuge:c,textColor:e,iconColor:n,extraTextColor:r})}const Sh={name:"Empty",common:Si,self:nv},iv=ye("empty",`
|
|
298
298
|
display: flex;
|
|
299
299
|
flex-direction: column;
|
|
300
300
|
align-items: center;
|
|
@@ -307,7 +307,7 @@ ${s}
|
|
|
307
307
|
color: var(--n-icon-color);
|
|
308
308
|
transition:
|
|
309
309
|
color .3s var(--n-bezier);
|
|
310
|
-
`,[
|
|
310
|
+
`,[he("+",[we("description",`
|
|
311
311
|
margin-top: 8px;
|
|
312
312
|
`)])]),we("description",`
|
|
313
313
|
transition: color .3s var(--n-bezier);
|
|
@@ -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
|
-
`)]),rv=Object.assign(Object.assign({},wt.props),{description:String,showDescription:{type:Boolean,default:!0},showIcon:{type:Boolean,default:!0},size:{type:String,default:"medium"},renderIcon:Function}),sv=i.defineComponent({name:"Empty",props:rv,slots:Object,setup(t){const{mergedClsPrefixRef:e,inlineThemeDisabled:n,mergedComponentPropsRef:r}=vi(t),s=wt("Empty","-empty",iv,Sh,t,e),{localeRef:o}=ph("Empty"),a=i.computed(()=>{var u,h,f;return(u=t.description)!==null&&u!==void 0?u:(f=(h=r==null?void 0:r.value)===null||h===void 0?void 0:h.Empty)===null||f===void 0?void 0:f.description}),l=i.computed(()=>{var u,h;return((h=(u=r==null?void 0:r.value)===null||u===void 0?void 0:u.Empty)===null||h===void 0?void 0:h.renderIcon)||(()=>i.h(Ok,null))}),c=i.computed(()=>{const{size:u}=t,{common:{cubicBezierEaseInOut:h},self:{[Je("iconSize",u)]:f,[Je("fontSize",u)]:g,textColor:m,iconColor:p,extraTextColor:y}}=s.value;return{"--n-icon-size":f,"--n-font-size":g,"--n-bezier":h,"--n-text-color":m,"--n-icon-color":p,"--n-extra-text-color":y}}),d=n?Ci("empty",i.computed(()=>{let u="";const{size:h}=t;return u+=h[0],u}),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(Pr,{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)}}),ov={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 av(t){const{borderRadius:e,popoverColor:n,textColor3:r,dividerColor:s,textColor2:o,primaryColorPressed:a,textColorDisabled:l,primaryColor:c,opacityDisabled:d,hoverColor:u,fontSizeTiny:h,fontSizeSmall:f,fontSizeMedium:g,fontSizeLarge:m,fontSizeHuge:p,heightTiny:y,heightSmall:b,heightMedium:_,heightLarge:B,heightHuge:
|
|
320
|
+
`)]),rv=Object.assign(Object.assign({},wt.props),{description:String,showDescription:{type:Boolean,default:!0},showIcon:{type:Boolean,default:!0},size:{type:String,default:"medium"},renderIcon:Function}),sv=i.defineComponent({name:"Empty",props:rv,slots:Object,setup(t){const{mergedClsPrefixRef:e,inlineThemeDisabled:n,mergedComponentPropsRef:r}=vi(t),s=wt("Empty","-empty",iv,Sh,t,e),{localeRef:o}=ph("Empty"),a=i.computed(()=>{var u,h,f;return(u=t.description)!==null&&u!==void 0?u:(f=(h=r==null?void 0:r.value)===null||h===void 0?void 0:h.Empty)===null||f===void 0?void 0:f.description}),l=i.computed(()=>{var u,h;return((h=(u=r==null?void 0:r.value)===null||u===void 0?void 0:u.Empty)===null||h===void 0?void 0:h.renderIcon)||(()=>i.h(Ok,null))}),c=i.computed(()=>{const{size:u}=t,{common:{cubicBezierEaseInOut:h},self:{[Je("iconSize",u)]:f,[Je("fontSize",u)]:g,textColor:m,iconColor:p,extraTextColor:y}}=s.value;return{"--n-icon-size":f,"--n-font-size":g,"--n-bezier":h,"--n-text-color":m,"--n-icon-color":p,"--n-extra-text-color":y}}),d=n?Ci("empty",i.computed(()=>{let u="";const{size:h}=t;return u+=h[0],u}),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(Pr,{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)}}),ov={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 av(t){const{borderRadius:e,popoverColor:n,textColor3:r,dividerColor:s,textColor2:o,primaryColorPressed:a,textColorDisabled:l,primaryColor:c,opacityDisabled:d,hoverColor:u,fontSizeTiny:h,fontSizeSmall:f,fontSizeMedium:g,fontSizeLarge:m,fontSizeHuge:p,heightTiny:y,heightSmall:b,heightMedium:_,heightLarge:B,heightHuge:x}=t;return Object.assign(Object.assign({},ov),{optionFontSizeTiny:h,optionFontSizeSmall:f,optionFontSizeMedium:g,optionFontSizeLarge:m,optionFontSizeHuge:p,optionHeightTiny:y,optionHeightSmall:b,optionHeightMedium:_,optionHeightLarge:B,optionHeightHuge:x,borderRadius:e,color:n,groupHeaderTextColor:r,actionDividerColor:s,optionTextColor:o,optionTextColorPressed:a,optionTextColorDisabled:l,optionTextColorActive:c,optionOpacityDisabled:d,optionCheckColor:c,optionColorPending:u,optionColorActive:"rgba(0, 0, 0, 0)",optionColorActivePending:u,actionTextColor:o,loadingColor:c})}const Bh={name:"InternalSelectMenu",common:Si,peers:{Scrollbar:_a,Empty:Sh},self:av},Th=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(ca);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):er(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 lv(t,e){return i.h(i.Transition,{name:"fade-in-scale-up-transition"},{default:()=>t?i.h(Pr,{clsPrefix:e,class:`${e}-base-select-option__check`},{default:()=>i.h(Vk)}):null})}const $h=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:u,handleOptionClick:h,handleOptionMouseEnter:f}=i.inject(ca),g=Zt(()=>{const{value:b}=n;return b?t.tmNode.key===b.key:!1});function m(b){const{tmNode:_}=t;_.disabled||h(b,_)}function p(b){const{tmNode:_}=t;_.disabled||f(b,_)}function y(b){const{tmNode:_}=t,{value:B}=g;_.disabled||B||f(b,_)}return{multiple:r,isGrouped:Zt(()=>{const{tmNode:b}=t,{parent:_}=b;return _&&_.rawNode.type==="group"}),showCheckmark:d,nodeProps:u,isPending:g,isSelected:Zt(()=>{const{value:b}=e,{value:_}=r;if(b===null)return!1;const B=t.tmNode.rawNode[c.value];if(_){const{value:x}=s;return x.has(B)}else return b===B}),labelField:l,renderLabel:o,renderOption:a,handleMouseMove:y,handleMouseEnter:p,handleClick:m}},render(){const{clsPrefix:t,tmNode:{rawNode:e},isSelected:n,isPending:r,isGrouped:s,showCheckmark:o,nodeProps:a,renderOption:l,renderLabel:c,handleClick:d,handleMouseEnter:u,handleMouseMove:h}=this,f=lv(n,t),g=c?[c(e,n),o&&f]:[er(e[this.labelField],e,n),o&&f],m=a==null?void 0:a(e),p=i.h("div",Object.assign({},m,{class:[`${t}-base-select-option`,e.class,m==null?void 0:m.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:[(m==null?void 0:m.style)||"",e.style||""],onClick:fa([d,m==null?void 0:m.onClick]),onMouseenter:fa([u,m==null?void 0:m.onMouseenter]),onMousemove:fa([h,m==null?void 0:m.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:Nh,cubicBezierEaseOut:Rh}=Rr;function Ph({transformOrigin:t="inherit",duration:e=".2s",enterScale:n=".9",originalTransform:r="",originalTransition:s=""}={}){return[he("&.fade-in-scale-up-transition-leave-active",{transformOrigin:t,transition:`opacity ${e} ${Nh}, transform ${e} ${Nh} ${s&&`,${s}`}`}),he("&.fade-in-scale-up-transition-enter-active",{transformOrigin:t,transition:`opacity ${e} ${Rh}, transform ${e} ${Rh} ${s&&`,${s}`}`}),he("&.fade-in-scale-up-transition-enter-from, &.fade-in-scale-up-transition-leave-to",{opacity:0,transform:`${r} scale(${n})`}),he("&.fade-in-scale-up-transition-leave-from, &.fade-in-scale-up-transition-enter-to",{opacity:1,transform:`${r} scale(1)`})]}const cv=ye("base-select-menu",`
|
|
321
321
|
line-height: 1.5;
|
|
322
322
|
outline: none;
|
|
323
323
|
z-index: 0;
|
|
@@ -390,7 +390,7 @@ ${s}
|
|
|
390
390
|
opacity: 1;
|
|
391
391
|
`,[Re("show-checkmark",`
|
|
392
392
|
padding-right: calc(var(--n-option-padding-right) + 20px);
|
|
393
|
-
`),
|
|
393
|
+
`),he("&::before",`
|
|
394
394
|
content: "";
|
|
395
395
|
position: absolute;
|
|
396
396
|
left: 4px;
|
|
@@ -399,17 +399,17 @@ ${s}
|
|
|
399
399
|
bottom: 0;
|
|
400
400
|
border-radius: var(--n-border-radius);
|
|
401
401
|
transition: background-color .3s var(--n-bezier);
|
|
402
|
-
`),
|
|
402
|
+
`),he("&:active",`
|
|
403
403
|
color: var(--n-option-text-color-pressed);
|
|
404
404
|
`),Re("grouped",`
|
|
405
405
|
padding-left: calc(var(--n-option-padding-left) * 1.5);
|
|
406
|
-
`),Re("pending",[
|
|
406
|
+
`),Re("pending",[he("&::before",`
|
|
407
407
|
background-color: var(--n-option-color-pending);
|
|
408
408
|
`)]),Re("selected",`
|
|
409
409
|
color: var(--n-option-text-color-active);
|
|
410
|
-
`,[
|
|
410
|
+
`,[he("&::before",`
|
|
411
411
|
background-color: var(--n-option-color-active);
|
|
412
|
-
`),Re("pending",[
|
|
412
|
+
`),Re("pending",[he("&::before",`
|
|
413
413
|
background-color: var(--n-option-color-active-pending);
|
|
414
414
|
`)])]),Re("disabled",`
|
|
415
415
|
cursor: not-allowed;
|
|
@@ -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
|
-
`,[Ph({enterScale:"0.5"})])])]),dv=i.defineComponent({name:"InternalSelectMenu",props:Object.assign(Object.assign({},wt.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}=vi(t),r=Nr("InternalSelectMenu",n,e),s=wt("InternalSelectMenu","-internal-select-menu",cv,Bh,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(()=>nw(c.value)),u=i.ref(null);function h(){const{treeMate:
|
|
427
|
+
`,[Ph({enterScale:"0.5"})])])]),dv=i.defineComponent({name:"InternalSelectMenu",props:Object.assign(Object.assign({},wt.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}=vi(t),r=Nr("InternalSelectMenu",n,e),s=wt("InternalSelectMenu","-internal-select-menu",cv,Bh,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(()=>nw(c.value)),u=i.ref(null);function h(){const{treeMate:O}=t;let Y=null;const{value:U}=t;U===null?Y=O.getFirstAvailableNode():(t.multiple?Y=O.getNode((U||[])[(U||[]).length-1]):Y=O.getNode(U),(!Y||Y.disabled)&&(Y=O.getFirstAvailableNode())),W(Y||null)}function f(){const{value:O}=u;O&&!t.treeMate.getNode(O.key)&&(u.value=null)}let g;i.watch(()=>t.show,O=>{O?g=i.watch(()=>t.treeMate,()=>{t.resetMenuOnOptionsChange?(t.autoPending?h():f(),i.nextTick(A)):f()},{immediate:!0}):g==null||g()},{immediate:!0}),i.onBeforeUnmount(()=>{g==null||g()});const m=i.computed(()=>_r(s.value.self[Je("optionHeight",t.size)])),p=i.computed(()=>nn(s.value.self[Je("padding",t.size)])),y=i.computed(()=>t.multiple&&Array.isArray(t.value)?new Set(t.value):new Set),b=i.computed(()=>{const O=c.value;return O&&O.length===0});function _(O){const{onToggle:Y}=t;Y&&Y(O)}function B(O){const{onScroll:Y}=t;Y&&Y(O)}function x(O){var Y;(Y=l.value)===null||Y===void 0||Y.sync(),B(O)}function N(){var O;(O=l.value)===null||O===void 0||O.sync()}function R(){const{value:O}=u;return O||null}function w(O,Y){Y.disabled||W(Y,!1)}function C(O,Y){Y.disabled||_(Y)}function k(O){var Y;yr(O,"action")||(Y=t.onKeyup)===null||Y===void 0||Y.call(t,O)}function T(O){var Y;yr(O,"action")||(Y=t.onKeydown)===null||Y===void 0||Y.call(t,O)}function $(O){var Y;(Y=t.onMousedown)===null||Y===void 0||Y.call(t,O),!t.focusable&&O.preventDefault()}function P(){const{value:O}=u;O&&W(O.getNext({loop:!0}),!0)}function E(){const{value:O}=u;O&&W(O.getPrev({loop:!0}),!0)}function W(O,Y=!1){u.value=O,Y&&A()}function A(){var O,Y;const U=u.value;if(!U)return;const V=d.value(U.key);V!==null&&(t.virtualScroll?(O=a.value)===null||O===void 0||O.scrollTo({index:V}):(Y=l.value)===null||Y===void 0||Y.scrollTo({index:V,elSize:m.value}))}function Z(O){var Y,U;!((Y=o.value)===null||Y===void 0)&&Y.contains(O.target)&&((U=t.onFocus)===null||U===void 0||U.call(t,O))}function te(O){var Y,U;!((Y=o.value)===null||Y===void 0)&&Y.contains(O.relatedTarget)||(U=t.onBlur)===null||U===void 0||U.call(t,O)}i.provide(ca,{handleOptionMouseEnter:w,handleOptionClick:C,valueSetRef:y,pendingTmNodeRef:u,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(Qu,o),i.onMounted(()=>{const{value:O}=l;O&&O.sync()});const D=i.computed(()=>{const{size:O}=t,{common:{cubicBezierEaseInOut:Y},self:{height:U,borderRadius:V,color:j,groupHeaderTextColor:q,actionDividerColor:ee,optionTextColorPressed:ue,optionTextColor:ve,optionTextColorDisabled:Te,optionTextColorActive:He,optionOpacityDisabled:ce,optionCheckColor:mt,actionTextColor:$e,optionColorPending:Et,optionColorActive:Wt,loadingColor:an,loadingSize:Ct,optionColorActivePending:Ln,[Je("optionFontSize",O)]:ln,[Je("optionHeight",O)]:Jt,[Je("optionPadding",O)]:Ve}}=s.value;return{"--n-height":U,"--n-action-divider-color":ee,"--n-action-text-color":$e,"--n-bezier":Y,"--n-border-radius":V,"--n-color":j,"--n-option-font-size":ln,"--n-group-header-text-color":q,"--n-option-check-color":mt,"--n-option-color-pending":Et,"--n-option-color-active":Wt,"--n-option-color-active-pending":Ln,"--n-option-height":Jt,"--n-option-opacity-disabled":ce,"--n-option-text-color":ve,"--n-option-text-color-active":He,"--n-option-text-color-disabled":Te,"--n-option-text-color-pressed":ue,"--n-option-padding":Ve,"--n-option-padding-left":nn(Ve,"left"),"--n-option-padding-right":nn(Ve,"right"),"--n-loading-color":an,"--n-loading-size":Ct}}),{inlineThemeDisabled:H}=t,L=H?Ci("internal-select-menu",i.computed(()=>t.size[0]),D,t):void 0,M={selfRef:o,next:P,prev:E,getPendingTmNode:R};return ih(o,t.onResize),Object.assign({mergedTheme:s,mergedClsPrefix:e,rtlEnabled:r,virtualListRef:a,scrollbarRef:l,itemSize:m,padding:p,flattenedNodes:c,empty:b,virtualListContainer(){const{value:O}=a;return O==null?void 0:O.listElRef},virtualListContent(){const{value:O}=a;return O==null?void 0:O.itemsElRef},doScroll:B,handleFocusin:Z,handleFocusout:te,handleKeyUp:k,handleKeyDown:T,handleMouseDown:$,handleVirtualListResize:N,handleVirtualListScroll:x,cssVars:H?void 0:D,themeClass:L==null?void 0:L.themeClass,onRender:L==null?void 0:L.onRender},M)},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},xi(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(wh,{clsPrefix:n,strokeWidth:20})):this.empty?i.h("div",{class:`${n}-base-select-menu__empty`,"data-empty":!0},ma(t.empty,()=>[i.h(sv,{theme:r.peers.Empty,themeOverrides:r.peerOverrides.Empty,size:this.size})])):i.h(Ch,{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(Ex,{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(Th,{key:a.key,clsPrefix:n,tmNode:a}):a.ignored?null:i.h($h,{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(Th,{key:a.key,clsPrefix:n,tmNode:a}):i.h($h,{clsPrefix:n,key:a.key,tmNode:a})))}),xi(t.action,a=>a&&[i.h("div",{class:`${n}-base-select-menu__action`,"data-action":!0,key:"action"},a),i.h(jk,{onFocus:this.onTabOut,key:"focus-detector"})]))}}),uv={space:"6px",spaceArrow:"10px",arrowOffset:"10px",arrowOffsetVertical:"10px",arrowHeight:"6px",padding:"8px 14px"};function hv(t){const{boxShadow2:e,popoverColor:n,textColor2:r,borderRadius:s,fontSize:o,dividerColor:a}=t;return Object.assign(Object.assign({},uv),{fontSize:o,borderRadius:s,color:n,dividerColor:a,textColor:r,boxShadow:e})}const Eh={name:"Popover",common:Si,peers:{Scrollbar:_a},self:hv},wa={top:"bottom",bottom:"top",left:"right",right:"left"},at="var(--n-arrow-height) * 1.414",fv=he([ye("popover",`
|
|
428
428
|
transition:
|
|
429
429
|
box-shadow .3s var(--n-bezier),
|
|
430
430
|
background-color .3s var(--n-bezier),
|
|
@@ -434,7 +434,7 @@ ${s}
|
|
|
434
434
|
color: var(--n-text-color);
|
|
435
435
|
box-shadow: var(--n-box-shadow);
|
|
436
436
|
word-break: break-word;
|
|
437
|
-
`,[
|
|
437
|
+
`,[he(">",[ye("scrollbar",`
|
|
438
438
|
height: inherit;
|
|
439
439
|
max-height: inherit;
|
|
440
440
|
`)]),rn("raw",`
|
|
@@ -466,20 +466,20 @@ ${s}
|
|
|
466
466
|
transform: rotate(45deg);
|
|
467
467
|
background-color: var(--n-color);
|
|
468
468
|
pointer-events: all;
|
|
469
|
-
`)]),
|
|
469
|
+
`)]),he("&.popover-transition-enter-from, &.popover-transition-leave-to",`
|
|
470
470
|
opacity: 0;
|
|
471
471
|
transform: scale(.85);
|
|
472
|
-
`),
|
|
472
|
+
`),he("&.popover-transition-enter-to, &.popover-transition-leave-from",`
|
|
473
473
|
transform: scale(1);
|
|
474
474
|
opacity: 1;
|
|
475
|
-
`),
|
|
475
|
+
`),he("&.popover-transition-enter-active",`
|
|
476
476
|
transition:
|
|
477
477
|
box-shadow .3s var(--n-bezier),
|
|
478
478
|
background-color .3s var(--n-bezier),
|
|
479
479
|
color .3s var(--n-bezier),
|
|
480
480
|
opacity .15s var(--n-bezier-ease-out),
|
|
481
481
|
transform .15s var(--n-bezier-ease-out);
|
|
482
|
-
`),
|
|
482
|
+
`),he("&.popover-transition-leave-active",`
|
|
483
483
|
transition:
|
|
484
484
|
box-shadow .3s var(--n-bezier),
|
|
485
485
|
background-color .3s var(--n-bezier),
|
|
@@ -526,7 +526,7 @@ ${s}
|
|
|
526
526
|
`),Qt("right-end",`
|
|
527
527
|
right: calc(${at} / -2);
|
|
528
528
|
bottom: calc(${Fn("right-end")} + var(--v-offset-top));
|
|
529
|
-
`),...
|
|
529
|
+
`),...I.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)`} - ${at}) / 2)`,c=Fn(s);return he(`[v-placement="${s}"] >`,[ye("popover-shared",[Re("center-arrow",[ye("popover-arrow",`${e}: calc(max(${l}, ${c}) ${o?"+":"-"} var(--v-offset-${n?"left":"top"}));`)])])])})})]);function Fn(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 he(`[v-placement="${t}"] >`,[ye("popover-shared",`
|
|
530
530
|
margin-${wa[n]}: var(--n-space);
|
|
531
531
|
`,[Re("show-arrow",`
|
|
532
532
|
margin-${wa[n]}: var(--n-space-arrow);
|
|
@@ -540,7 +540,7 @@ ${s}
|
|
|
540
540
|
${n}: 100%;
|
|
541
541
|
${wa[n]}: auto;
|
|
542
542
|
${r}
|
|
543
|
-
`,[ye("popover-arrow",e)])])])}const Fh=Object.assign(Object.assign({},wt.props),{to:En.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 mv({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 gv=i.defineComponent({name:"PopoverBody",inheritAttrs:!1,props:Fh,setup(t,{slots:e,attrs:n}){const{namespaceRef:r,mergedClsPrefixRef:s,inlineThemeDisabled:o,mergedRtlRef:a}=vi(t),l=wt("Popover","-popover",fv,Eh,t,s),c=Nr("Popover",a,s),d=i.ref(null),u=i.inject("NPopover"),h=i.ref(null),f=i.ref(t.show),g=i.ref(!1);i.watchEffect(()=>{const{show:x}=t;x&&!Wx()&&!t.internalDeactivateImmediately&&(g.value=!0)});const m=i.computed(()=>{const{trigger:x,onClickoutside:T}=t,$=[],{positionManuallyRef:{value:F}}=u;return F||(x==="click"&&!T&&$.push([_s,R,void 0,{capture:!0}]),x==="hover"&&$.push([kw,N])),T&&$.push([_s,R,void 0,{capture:!0}]),(t.displayDirective==="show"||t.animated&&g.value)&&$.push([i.vShow,t.show]),$}),p=i.computed(()=>{const{common:{cubicBezierEaseInOut:x,cubicBezierEaseIn:T,cubicBezierEaseOut:$},self:{space:F,spaceArrow:I,padding:L,fontSize:O,textColor:Z,dividerColor:ne,color:E,boxShadow:P,borderRadius:H,arrowHeight:Y,arrowOffset:D,arrowOffsetVertical:X}}=l.value;return{"--n-box-shadow":P,"--n-bezier":x,"--n-bezier-ease-in":T,"--n-bezier-ease-out":$,"--n-font-size":O,"--n-text-color":Z,"--n-color":E,"--n-divider-color":ne,"--n-border-radius":H,"--n-arrow-height":Y,"--n-arrow-offset":D,"--n-arrow-offset-vertical":X,"--n-padding":L,"--n-space":F,"--n-space-arrow":I}}),y=i.computed(()=>{const x=t.width==="trigger"?void 0:da(t.width),T=[];x&&T.push({width:x});const{maxWidth:$,minWidth:F}=t;return $&&T.push({maxWidth:da($)}),F&&T.push({maxWidth:da(F)}),o||T.push(p.value),T}),b=o?Ci("popover",void 0,p,t):void 0;u.setBodyInstance({syncPosition:_}),i.onBeforeUnmount(()=>{u.setBodyInstance(null)}),i.watch(i.toRef(t,"show"),x=>{t.animated||(x?f.value=!0:f.value=!1)});function _(){var x;(x=d.value)===null||x===void 0||x.syncPosition()}function B(x){t.trigger==="hover"&&t.keepAliveOnHover&&t.show&&u.handleMouseEnter(x)}function k(x){t.trigger==="hover"&&t.keepAliveOnHover&&u.handleMouseLeave(x)}function N(x){t.trigger==="hover"&&!w().contains(br(x))&&u.handleMouseMoveOutside(x)}function R(x){(t.trigger==="click"&&!w().contains(br(x))||t.onClickoutside)&&u.handleClickOutside(x)}function w(){return u.getTriggerElement()}i.provide(th,h),i.provide(Ju,null),i.provide(eh,null);function C(){if(b==null||b.onRender(),!(t.displayDirective==="show"||t.show||t.animated&&g.value))return null;let T;const $=u.internalRenderBodyRef.value,{value:F}=s;if($)T=$([`${F}-popover-shared`,(c==null?void 0:c.value)&&`${F}-popover--rtl`,b==null?void 0:b.themeClass.value,t.overlap&&`${F}-popover-shared--overlap`,t.showArrow&&`${F}-popover-shared--show-arrow`,t.arrowPointToCenter&&`${F}-popover-shared--center-arrow`],h,y.value,B,k);else{const{value:I}=u.extraClassRef,{internalTrapFocus:L}=t,O=!mh(e.header)||!mh(e.footer),Z=()=>{var ne,E;const P=O?i.h(i.Fragment,null,xi(e.header,D=>D?i.h("div",{class:[`${F}-popover__header`,t.headerClass],style:t.headerStyle},D):null),xi(e.default,D=>D?i.h("div",{class:[`${F}-popover__content`,t.contentClass],style:t.contentStyle},e):null),xi(e.footer,D=>D?i.h("div",{class:[`${F}-popover__footer`,t.footerClass],style:t.footerStyle},D):null)):t.scrollable?(ne=e.default)===null||ne===void 0?void 0:ne.call(e):i.h("div",{class:[`${F}-popover__content`,t.contentClass],style:t.contentStyle},e),H=t.scrollable?i.h(ev,{themeOverrides:l.value.peerOverrides.Scrollbar,theme:l.value.peers.Scrollbar,contentClass:O?void 0:`${F}-popover__content ${(E=t.contentClass)!==null&&E!==void 0?E:""}`,contentStyle:O?void 0:t.contentStyle},{default:()=>P}):P,Y=t.showArrow?mv({arrowClass:t.arrowClass,arrowStyle:t.arrowStyle,arrowWrapperClass:t.arrowWrapperClass,arrowWrapperStyle:t.arrowWrapperStyle,clsPrefix:F}):null;return[H,Y]};T=i.h("div",i.mergeProps({class:[`${F}-popover`,`${F}-popover-shared`,(c==null?void 0:c.value)&&`${F}-popover--rtl`,b==null?void 0:b.themeClass.value,I.map(ne=>`${F}-${ne}`),{[`${F}-popover--scrollable`]:t.scrollable,[`${F}-popover--show-header-or-footer`]:O,[`${F}-popover--raw`]:t.raw,[`${F}-popover-shared--overlap`]:t.overlap,[`${F}-popover-shared--show-arrow`]:t.showArrow,[`${F}-popover-shared--center-arrow`]:t.arrowPointToCenter}],ref:h,style:y.value,onKeydown:u.handleKeydown,onMouseenter:B,onMouseleave:k},n),L?i.h(Ix,{active:t.show,autoFocus:!0},{default:Z}):Z())}return i.withDirectives(T,m.value)}return{displayed:g,namespace:r,isMounted:u.isMountedRef,zIndex:u.zIndexRef,followerRef:d,adjustedTo:En(t),followerEnabled:f,renderContentNode:C}},render(){return i.h($u,{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===En.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 pv={};const yv=Object.keys(Fh),bv={focus:["onFocus","onBlur"],click:["onClick"],hover:["onMouseenter","onMouseleave"],manual:[],nested:["onFocus","onBlur","onMouseenter","onMouseleave","onClick"]};function _v(t,e,n){bv[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 wv={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:En.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},xv=Object.assign(Object.assign(Object.assign({},wt.props),wv),{internalOnAfterLeave:Function,internalRenderBody:Function}),kv=i.defineComponent({name:"Popover",inheritAttrs:!1,props:xv,slots:Object,__popover__:!0,setup(t){pv.NODE_ENV!=="production"&&i.watchEffect(()=>{t.maxWidth!==void 0&&ei("popover","`max-width` is deprecated, please use `style` instead."),t.minWidth!==void 0&&ei("popover","`min-width` is deprecated, please use `style` instead."),t.arrow!==void 0&&ei("popover","`arrow` is deprecated, please use `showArrow` instead."),t.onHide!==void 0&&ei("popover","`on-hide` is deprecated, please use `on-update:show` instead."),t.onShow!==void 0&&ei("popover","`on-show` is deprecated, please use `on-update:show` instead.")});const e=ws(),n=i.ref(null),r=i.computed(()=>t.show),s=i.ref(t.defaultShow),o=Go(r,s),a=Zt(()=>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=lu(t,["arrow","showArrow"]),u=i.computed(()=>t.overlap?!1:d.value);let h=null;const f=i.ref(null),g=i.ref(null),m=Zt(()=>t.x!==void 0&&t.y!==void 0);function p(O){const{"onUpdate:show":Z,onUpdateShow:ne,onShow:E,onHide:P}=t;s.value=O,Z&&_t(Z,O),ne&&_t(ne,O),O&&E&&_t(E,!0),O&&P&&_t(P,!1)}function y(){h&&h.syncPosition()}function b(){const{value:O}=f;O&&(window.clearTimeout(O),f.value=null)}function _(){const{value:O}=g;O&&(window.clearTimeout(O),g.value=null)}function B(){const O=l();if(t.trigger==="focus"&&!O){if(c())return;p(!0)}}function k(){const O=l();if(t.trigger==="focus"&&!O){if(!c())return;p(!1)}}function N(){const O=l();if(t.trigger==="hover"&&!O){if(_(),f.value!==null||c())return;const Z=()=>{p(!0),f.value=null},{delay:ne}=t;ne===0?Z():f.value=window.setTimeout(Z,ne)}}function R(){const O=l();if(t.trigger==="hover"&&!O){if(b(),g.value!==null||!c())return;const Z=()=>{p(!1),g.value=null},{duration:ne}=t;ne===0?Z():g.value=window.setTimeout(Z,ne)}}function w(){R()}function C(O){var Z;c()&&(t.trigger==="click"&&(b(),_(),p(!1)),(Z=t.onClickoutside)===null||Z===void 0||Z.call(t,O))}function x(){if(t.trigger==="click"&&!l()){b(),_();const O=!c();p(O)}}function T(O){t.internalTrapFocus&&O.key==="Escape"&&(b(),_(),p(!1))}function $(O){s.value=O}function F(){var O;return(O=n.value)===null||O===void 0?void 0:O.targetRef}function I(O){h=O}return i.provide("NPopover",{getTriggerElement:F,handleKeydown:T,handleMouseEnter:N,handleMouseLeave:R,handleClickOutside:C,handleMouseMoveOutside:w,setBodyInstance:I,positionManuallyRef:m,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:m,mergedShowConsideringDisabledProp:a,uncontrolledShow:s,mergedShowArrow:u,getMergedShow:c,setShow:$,handleClick:x,handleMouseEnter:N,handleMouseLeave:R,handleFocus:B,handleBlur:k,syncPosition:y}},render(){var t;const{positionManually:e,$slots:n}=this;let r,s=!1;if(!e&&(r=Xx(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(u=>{u.onBlur(d)})},onFocus:d=>{l.forEach(u=>{u.onFocus(d)})},onClick:d=>{l.forEach(u=>{u.onClick(d)})},onMouseenter:d=>{l.forEach(u=>{u.onMouseenter(d)})},onMouseleave:d=>{l.forEach(u=>{u.onMouseleave(d)})}};_v(r,a?"nested":e?"manual":this.trigger,c)}}return i.h(hu,{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}}),[[au,{enabled:o,zIndex:this.zIndex}]]):null,e?null:i.h(fu,null,{default:()=>r}),i.h(gv,Yx(this.$props,yv,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)}})]}})}}),vv={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 Cv(t){const{textColor2:e,primaryColorHover:n,primaryColorPressed:r,primaryColor:s,infoColor:o,successColor:a,warningColor:l,errorColor:c,baseColor:d,borderColor:u,opacityDisabled:h,tagColor:f,closeIconColor:g,closeIconColorHover:m,closeIconColorPressed:p,borderRadiusSmall:y,fontSizeMini:b,fontSizeTiny:_,fontSizeSmall:B,fontSizeMedium:k,heightMini:N,heightTiny:R,heightSmall:w,heightMedium:C,closeColorHover:x,closeColorPressed:T,buttonColor2Hover:$,buttonColor2Pressed:F,fontWeightStrong:I}=t;return Object.assign(Object.assign({},vv),{closeBorderRadius:y,heightTiny:N,heightSmall:R,heightMedium:w,heightLarge:C,borderRadius:y,opacityDisabled:h,fontSizeTiny:b,fontSizeSmall:_,fontSizeMedium:B,fontSizeLarge:k,fontWeightStrong:I,textColorCheckable:e,textColorHoverCheckable:e,textColorPressedCheckable:e,textColorChecked:d,colorCheckable:"#0000",colorHoverCheckable:$,colorPressedCheckable:F,colorChecked:s,colorCheckedHover:n,colorCheckedPressed:r,border:`1px solid ${u}`,textColor:e,color:f,colorBordered:"rgb(250, 250, 252)",closeIconColor:g,closeIconColorHover:m,closeIconColorPressed:p,closeColorHover:x,closeColorPressed:T,borderPrimary:`1px solid ${ze(s,{alpha:.3})}`,textColorPrimary:s,colorPrimary:ze(s,{alpha:.12}),colorBorderedPrimary:ze(s,{alpha:.1}),closeIconColorPrimary:s,closeIconColorHoverPrimary:s,closeIconColorPressedPrimary:s,closeColorHoverPrimary:ze(s,{alpha:.12}),closeColorPressedPrimary:ze(s,{alpha:.18}),borderInfo:`1px solid ${ze(o,{alpha:.3})}`,textColorInfo:o,colorInfo:ze(o,{alpha:.12}),colorBorderedInfo:ze(o,{alpha:.1}),closeIconColorInfo:o,closeIconColorHoverInfo:o,closeIconColorPressedInfo:o,closeColorHoverInfo:ze(o,{alpha:.12}),closeColorPressedInfo:ze(o,{alpha:.18}),borderSuccess:`1px solid ${ze(a,{alpha:.3})}`,textColorSuccess:a,colorSuccess:ze(a,{alpha:.12}),colorBorderedSuccess:ze(a,{alpha:.1}),closeIconColorSuccess:a,closeIconColorHoverSuccess:a,closeIconColorPressedSuccess:a,closeColorHoverSuccess:ze(a,{alpha:.12}),closeColorPressedSuccess:ze(a,{alpha:.18}),borderWarning:`1px solid ${ze(l,{alpha:.35})}`,textColorWarning:l,colorWarning:ze(l,{alpha:.15}),colorBorderedWarning:ze(l,{alpha:.12}),closeIconColorWarning:l,closeIconColorHoverWarning:l,closeIconColorPressedWarning:l,closeColorHoverWarning:ze(l,{alpha:.12}),closeColorPressedWarning:ze(l,{alpha:.18}),borderError:`1px solid ${ze(c,{alpha:.23})}`,textColorError:c,colorError:ze(c,{alpha:.1}),colorBorderedError:ze(c,{alpha:.08}),closeIconColorError:c,closeIconColorHoverError:c,closeIconColorPressedError:c,closeColorHoverError:ze(c,{alpha:.12}),closeColorPressedError:ze(c,{alpha:.18})})}const Sv={common:Si,self:Cv},Bv={color:Object,type:{type:String,default:"default"},round:Boolean,size:{type:String,default:"medium"},closable:Boolean,disabled:{type:Boolean,default:void 0}},Tv=ye("tag",`
|
|
543
|
+
`,[ye("popover-arrow",e)])])])}const Fh=Object.assign(Object.assign({},wt.props),{to:En.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 mv({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 gv=i.defineComponent({name:"PopoverBody",inheritAttrs:!1,props:Fh,setup(t,{slots:e,attrs:n}){const{namespaceRef:r,mergedClsPrefixRef:s,inlineThemeDisabled:o,mergedRtlRef:a}=vi(t),l=wt("Popover","-popover",fv,Eh,t,s),c=Nr("Popover",a,s),d=i.ref(null),u=i.inject("NPopover"),h=i.ref(null),f=i.ref(t.show),g=i.ref(!1);i.watchEffect(()=>{const{show:k}=t;k&&!Wx()&&!t.internalDeactivateImmediately&&(g.value=!0)});const m=i.computed(()=>{const{trigger:k,onClickoutside:T}=t,$=[],{positionManuallyRef:{value:P}}=u;return P||(k==="click"&&!T&&$.push([_s,R,void 0,{capture:!0}]),k==="hover"&&$.push([kw,N])),T&&$.push([_s,R,void 0,{capture:!0}]),(t.displayDirective==="show"||t.animated&&g.value)&&$.push([i.vShow,t.show]),$}),p=i.computed(()=>{const{common:{cubicBezierEaseInOut:k,cubicBezierEaseIn:T,cubicBezierEaseOut:$},self:{space:P,spaceArrow:E,padding:W,fontSize:A,textColor:Z,dividerColor:te,color:D,boxShadow:H,borderRadius:L,arrowHeight:M,arrowOffset:O,arrowOffsetVertical:Y}}=l.value;return{"--n-box-shadow":H,"--n-bezier":k,"--n-bezier-ease-in":T,"--n-bezier-ease-out":$,"--n-font-size":A,"--n-text-color":Z,"--n-color":D,"--n-divider-color":te,"--n-border-radius":L,"--n-arrow-height":M,"--n-arrow-offset":O,"--n-arrow-offset-vertical":Y,"--n-padding":W,"--n-space":P,"--n-space-arrow":E}}),y=i.computed(()=>{const k=t.width==="trigger"?void 0:da(t.width),T=[];k&&T.push({width:k});const{maxWidth:$,minWidth:P}=t;return $&&T.push({maxWidth:da($)}),P&&T.push({maxWidth:da(P)}),o||T.push(p.value),T}),b=o?Ci("popover",void 0,p,t):void 0;u.setBodyInstance({syncPosition:_}),i.onBeforeUnmount(()=>{u.setBodyInstance(null)}),i.watch(i.toRef(t,"show"),k=>{t.animated||(k?f.value=!0:f.value=!1)});function _(){var k;(k=d.value)===null||k===void 0||k.syncPosition()}function B(k){t.trigger==="hover"&&t.keepAliveOnHover&&t.show&&u.handleMouseEnter(k)}function x(k){t.trigger==="hover"&&t.keepAliveOnHover&&u.handleMouseLeave(k)}function N(k){t.trigger==="hover"&&!w().contains(br(k))&&u.handleMouseMoveOutside(k)}function R(k){(t.trigger==="click"&&!w().contains(br(k))||t.onClickoutside)&&u.handleClickOutside(k)}function w(){return u.getTriggerElement()}i.provide(th,h),i.provide(Ju,null),i.provide(eh,null);function C(){if(b==null||b.onRender(),!(t.displayDirective==="show"||t.show||t.animated&&g.value))return null;let T;const $=u.internalRenderBodyRef.value,{value:P}=s;if($)T=$([`${P}-popover-shared`,(c==null?void 0:c.value)&&`${P}-popover--rtl`,b==null?void 0:b.themeClass.value,t.overlap&&`${P}-popover-shared--overlap`,t.showArrow&&`${P}-popover-shared--show-arrow`,t.arrowPointToCenter&&`${P}-popover-shared--center-arrow`],h,y.value,B,x);else{const{value:E}=u.extraClassRef,{internalTrapFocus:W}=t,A=!mh(e.header)||!mh(e.footer),Z=()=>{var te,D;const H=A?i.h(i.Fragment,null,xi(e.header,O=>O?i.h("div",{class:[`${P}-popover__header`,t.headerClass],style:t.headerStyle},O):null),xi(e.default,O=>O?i.h("div",{class:[`${P}-popover__content`,t.contentClass],style:t.contentStyle},e):null),xi(e.footer,O=>O?i.h("div",{class:[`${P}-popover__footer`,t.footerClass],style:t.footerStyle},O):null)):t.scrollable?(te=e.default)===null||te===void 0?void 0:te.call(e):i.h("div",{class:[`${P}-popover__content`,t.contentClass],style:t.contentStyle},e),L=t.scrollable?i.h(ev,{themeOverrides:l.value.peerOverrides.Scrollbar,theme:l.value.peers.Scrollbar,contentClass:A?void 0:`${P}-popover__content ${(D=t.contentClass)!==null&&D!==void 0?D:""}`,contentStyle:A?void 0:t.contentStyle},{default:()=>H}):H,M=t.showArrow?mv({arrowClass:t.arrowClass,arrowStyle:t.arrowStyle,arrowWrapperClass:t.arrowWrapperClass,arrowWrapperStyle:t.arrowWrapperStyle,clsPrefix:P}):null;return[L,M]};T=i.h("div",i.mergeProps({class:[`${P}-popover`,`${P}-popover-shared`,(c==null?void 0:c.value)&&`${P}-popover--rtl`,b==null?void 0:b.themeClass.value,E.map(te=>`${P}-${te}`),{[`${P}-popover--scrollable`]:t.scrollable,[`${P}-popover--show-header-or-footer`]:A,[`${P}-popover--raw`]:t.raw,[`${P}-popover-shared--overlap`]:t.overlap,[`${P}-popover-shared--show-arrow`]:t.showArrow,[`${P}-popover-shared--center-arrow`]:t.arrowPointToCenter}],ref:h,style:y.value,onKeydown:u.handleKeydown,onMouseenter:B,onMouseleave:x},n),W?i.h(Ix,{active:t.show,autoFocus:!0},{default:Z}):Z())}return i.withDirectives(T,m.value)}return{displayed:g,namespace:r,isMounted:u.isMountedRef,zIndex:u.zIndexRef,followerRef:d,adjustedTo:En(t),followerEnabled:f,renderContentNode:C}},render(){return i.h($u,{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===En.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 pv={};const yv=Object.keys(Fh),bv={focus:["onFocus","onBlur"],click:["onClick"],hover:["onMouseenter","onMouseleave"],manual:[],nested:["onFocus","onBlur","onMouseenter","onMouseleave","onClick"]};function _v(t,e,n){bv[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 wv={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:En.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},xv=Object.assign(Object.assign(Object.assign({},wt.props),wv),{internalOnAfterLeave:Function,internalRenderBody:Function}),kv=i.defineComponent({name:"Popover",inheritAttrs:!1,props:xv,slots:Object,__popover__:!0,setup(t){pv.NODE_ENV!=="production"&&i.watchEffect(()=>{t.maxWidth!==void 0&&ei("popover","`max-width` is deprecated, please use `style` instead."),t.minWidth!==void 0&&ei("popover","`min-width` is deprecated, please use `style` instead."),t.arrow!==void 0&&ei("popover","`arrow` is deprecated, please use `showArrow` instead."),t.onHide!==void 0&&ei("popover","`on-hide` is deprecated, please use `on-update:show` instead."),t.onShow!==void 0&&ei("popover","`on-show` is deprecated, please use `on-update:show` instead.")});const e=ws(),n=i.ref(null),r=i.computed(()=>t.show),s=i.ref(t.defaultShow),o=Go(r,s),a=Zt(()=>t.disabled?!1:o.value),l=()=>{if(t.disabled)return!0;const{getDisabled:A}=t;return!!(A!=null&&A())},c=()=>l()?!1:o.value,d=lu(t,["arrow","showArrow"]),u=i.computed(()=>t.overlap?!1:d.value);let h=null;const f=i.ref(null),g=i.ref(null),m=Zt(()=>t.x!==void 0&&t.y!==void 0);function p(A){const{"onUpdate:show":Z,onUpdateShow:te,onShow:D,onHide:H}=t;s.value=A,Z&&_t(Z,A),te&&_t(te,A),A&&D&&_t(D,!0),A&&H&&_t(H,!1)}function y(){h&&h.syncPosition()}function b(){const{value:A}=f;A&&(window.clearTimeout(A),f.value=null)}function _(){const{value:A}=g;A&&(window.clearTimeout(A),g.value=null)}function B(){const A=l();if(t.trigger==="focus"&&!A){if(c())return;p(!0)}}function x(){const A=l();if(t.trigger==="focus"&&!A){if(!c())return;p(!1)}}function N(){const A=l();if(t.trigger==="hover"&&!A){if(_(),f.value!==null||c())return;const Z=()=>{p(!0),f.value=null},{delay:te}=t;te===0?Z():f.value=window.setTimeout(Z,te)}}function R(){const A=l();if(t.trigger==="hover"&&!A){if(b(),g.value!==null||!c())return;const Z=()=>{p(!1),g.value=null},{duration:te}=t;te===0?Z():g.value=window.setTimeout(Z,te)}}function w(){R()}function C(A){var Z;c()&&(t.trigger==="click"&&(b(),_(),p(!1)),(Z=t.onClickoutside)===null||Z===void 0||Z.call(t,A))}function k(){if(t.trigger==="click"&&!l()){b(),_();const A=!c();p(A)}}function T(A){t.internalTrapFocus&&A.key==="Escape"&&(b(),_(),p(!1))}function $(A){s.value=A}function P(){var A;return(A=n.value)===null||A===void 0?void 0:A.targetRef}function E(A){h=A}return i.provide("NPopover",{getTriggerElement:P,handleKeydown:T,handleMouseEnter:N,handleMouseLeave:R,handleClickOutside:C,handleMouseMoveOutside:w,setBodyInstance:E,positionManuallyRef:m,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:m,mergedShowConsideringDisabledProp:a,uncontrolledShow:s,mergedShowArrow:u,getMergedShow:c,setShow:$,handleClick:k,handleMouseEnter:N,handleMouseLeave:R,handleFocus:B,handleBlur:x,syncPosition:y}},render(){var t;const{positionManually:e,$slots:n}=this;let r,s=!1;if(!e&&(r=Xx(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(u=>{u.onBlur(d)})},onFocus:d=>{l.forEach(u=>{u.onFocus(d)})},onClick:d=>{l.forEach(u=>{u.onClick(d)})},onMouseenter:d=>{l.forEach(u=>{u.onMouseenter(d)})},onMouseleave:d=>{l.forEach(u=>{u.onMouseleave(d)})}};_v(r,a?"nested":e?"manual":this.trigger,c)}}return i.h(hu,{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}}),[[au,{enabled:o,zIndex:this.zIndex}]]):null,e?null:i.h(fu,null,{default:()=>r}),i.h(gv,Yx(this.$props,yv,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)}})]}})}}),vv={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 Cv(t){const{textColor2:e,primaryColorHover:n,primaryColorPressed:r,primaryColor:s,infoColor:o,successColor:a,warningColor:l,errorColor:c,baseColor:d,borderColor:u,opacityDisabled:h,tagColor:f,closeIconColor:g,closeIconColorHover:m,closeIconColorPressed:p,borderRadiusSmall:y,fontSizeMini:b,fontSizeTiny:_,fontSizeSmall:B,fontSizeMedium:x,heightMini:N,heightTiny:R,heightSmall:w,heightMedium:C,closeColorHover:k,closeColorPressed:T,buttonColor2Hover:$,buttonColor2Pressed:P,fontWeightStrong:E}=t;return Object.assign(Object.assign({},vv),{closeBorderRadius:y,heightTiny:N,heightSmall:R,heightMedium:w,heightLarge:C,borderRadius:y,opacityDisabled:h,fontSizeTiny:b,fontSizeSmall:_,fontSizeMedium:B,fontSizeLarge:x,fontWeightStrong:E,textColorCheckable:e,textColorHoverCheckable:e,textColorPressedCheckable:e,textColorChecked:d,colorCheckable:"#0000",colorHoverCheckable:$,colorPressedCheckable:P,colorChecked:s,colorCheckedHover:n,colorCheckedPressed:r,border:`1px solid ${u}`,textColor:e,color:f,colorBordered:"rgb(250, 250, 252)",closeIconColor:g,closeIconColorHover:m,closeIconColorPressed:p,closeColorHover:k,closeColorPressed:T,borderPrimary:`1px solid ${ze(s,{alpha:.3})}`,textColorPrimary:s,colorPrimary:ze(s,{alpha:.12}),colorBorderedPrimary:ze(s,{alpha:.1}),closeIconColorPrimary:s,closeIconColorHoverPrimary:s,closeIconColorPressedPrimary:s,closeColorHoverPrimary:ze(s,{alpha:.12}),closeColorPressedPrimary:ze(s,{alpha:.18}),borderInfo:`1px solid ${ze(o,{alpha:.3})}`,textColorInfo:o,colorInfo:ze(o,{alpha:.12}),colorBorderedInfo:ze(o,{alpha:.1}),closeIconColorInfo:o,closeIconColorHoverInfo:o,closeIconColorPressedInfo:o,closeColorHoverInfo:ze(o,{alpha:.12}),closeColorPressedInfo:ze(o,{alpha:.18}),borderSuccess:`1px solid ${ze(a,{alpha:.3})}`,textColorSuccess:a,colorSuccess:ze(a,{alpha:.12}),colorBorderedSuccess:ze(a,{alpha:.1}),closeIconColorSuccess:a,closeIconColorHoverSuccess:a,closeIconColorPressedSuccess:a,closeColorHoverSuccess:ze(a,{alpha:.12}),closeColorPressedSuccess:ze(a,{alpha:.18}),borderWarning:`1px solid ${ze(l,{alpha:.35})}`,textColorWarning:l,colorWarning:ze(l,{alpha:.15}),colorBorderedWarning:ze(l,{alpha:.12}),closeIconColorWarning:l,closeIconColorHoverWarning:l,closeIconColorPressedWarning:l,closeColorHoverWarning:ze(l,{alpha:.12}),closeColorPressedWarning:ze(l,{alpha:.18}),borderError:`1px solid ${ze(c,{alpha:.23})}`,textColorError:c,colorError:ze(c,{alpha:.1}),colorBorderedError:ze(c,{alpha:.08}),closeIconColorError:c,closeIconColorHoverError:c,closeIconColorPressedError:c,closeColorHoverError:ze(c,{alpha:.12}),closeColorPressedError:ze(c,{alpha:.18})})}const Sv={common:Si,self:Cv},Bv={color:Object,type:{type:String,default:"default"},round:Boolean,size:{type:String,default:"medium"},closable:Boolean,disabled:{type:Boolean,default:void 0}},Tv=ye("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;
|
|
@@ -607,10 +607,10 @@ ${s}
|
|
|
607
607
|
box-shadow: none;
|
|
608
608
|
color: var(--n-text-color-checkable);
|
|
609
609
|
background-color: var(--n-color-checkable);
|
|
610
|
-
`,[rn("disabled",[
|
|
610
|
+
`,[rn("disabled",[he("&:hover","background-color: var(--n-color-hover-checkable);",[rn("checked","color: var(--n-text-color-hover-checkable);")]),he("&:active","background-color: var(--n-color-pressed-checkable);",[rn("checked","color: var(--n-text-color-pressed-checkable);")])]),Re("checked",`
|
|
611
611
|
color: var(--n-text-color-checked);
|
|
612
612
|
background-color: var(--n-color-checked);
|
|
613
|
-
`,[rn("disabled",[
|
|
613
|
+
`,[rn("disabled",[he("&:hover","background-color: var(--n-color-checked-hover);"),he("&:active","background-color: var(--n-color-checked-pressed);")])])])]);var $v={};const Nv=Object.assign(Object.assign(Object.assign({},wt.props),Bv),{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}),Rv="n-tag",xa=i.defineComponent({name:"Tag",props:Nv,slots:Object,setup(t){$v.NODE_ENV!=="production"&&i.watchEffect(()=>{t.onCheckedChange!==void 0&&ei("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}=vi(t),a=wt("Tag","-tag",Tv,Sv,t,r);i.provide(Rv,{roundRef:i.toRef(t,"round")});function l(){if(!t.disabled&&t.checkable){const{checked:g,onCheckedChange:m,onUpdateChecked:p,"onUpdate:checked":y}=t;p&&p(!g),y&&y(!g),m&&m(!g)}}function c(g){if(t.triggerClickOnClose||g.stopPropagation(),!t.disabled){const{onClose:m}=t;m&&_t(m,g)}}const d={setTextContent(g){const{value:m}=e;m&&(m.textContent=g)}},u=Nr("Tag",o,r),h=i.computed(()=>{const{type:g,size:m,color:{color:p,textColor:y}={}}=t,{common:{cubicBezierEaseInOut:b},self:{padding:_,closeMargin:B,borderRadius:x,opacityDisabled:N,textColorCheckable:R,textColorHoverCheckable:w,textColorPressedCheckable:C,textColorChecked:k,colorCheckable:T,colorHoverCheckable:$,colorPressedCheckable:P,colorChecked:E,colorCheckedHover:W,colorCheckedPressed:A,closeBorderRadius:Z,fontWeightStrong:te,[Je("colorBordered",g)]:D,[Je("closeSize",m)]:H,[Je("closeIconSize",m)]:L,[Je("fontSize",m)]:M,[Je("height",m)]:O,[Je("color",g)]:Y,[Je("textColor",g)]:U,[Je("border",g)]:V,[Je("closeIconColor",g)]:j,[Je("closeIconColorHover",g)]:q,[Je("closeIconColorPressed",g)]:ee,[Je("closeColorHover",g)]:ue,[Je("closeColorPressed",g)]:ve}}=a.value,Te=nn(B);return{"--n-font-weight-strong":te,"--n-avatar-size-override":`calc(${O} - 8px)`,"--n-bezier":b,"--n-border-radius":x,"--n-border":V,"--n-close-icon-size":L,"--n-close-color-pressed":ve,"--n-close-color-hover":ue,"--n-close-border-radius":Z,"--n-close-icon-color":j,"--n-close-icon-color-hover":q,"--n-close-icon-color-pressed":ee,"--n-close-icon-color-disabled":j,"--n-close-margin-top":Te.top,"--n-close-margin-right":Te.right,"--n-close-margin-bottom":Te.bottom,"--n-close-margin-left":Te.left,"--n-close-size":H,"--n-color":p||(n.value?D:Y),"--n-color-checkable":T,"--n-color-checked":E,"--n-color-checked-hover":W,"--n-color-checked-pressed":A,"--n-color-hover-checkable":$,"--n-color-pressed-checkable":P,"--n-font-size":M,"--n-height":O,"--n-opacity-disabled":N,"--n-padding":_,"--n-text-color":y||U,"--n-text-color-checkable":R,"--n-text-color-checked":k,"--n-text-color-hover-checkable":w,"--n-text-color-pressed-checkable":C}}),f=s?Ci("tag",i.computed(()=>{let g="";const{type:m,size:p,color:{color:y,textColor:b}={}}=t;return g+=m[0],g+=p[0],y&&(g+=`a${rh(y)}`),b&&(g+=`b${rh(b)}`),n.value&&(g+="c"),g}),h,t):void 0;return Object.assign(Object.assign({},d),{rtlEnabled:u,mergedClsPrefix:r,contentRef:e,mergedBordered:n,handleClick:l,handleCloseClick:c,cssVars:s?void 0:h,themeClass:f==null?void 0:f.themeClass,onRender:f==null?void 0:f.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=xi(c.avatar,h=>h&&i.h("div",{class:`${n}-tag__avatar`},h)),u=xi(c.icon,h=>h&&i.h("div",{class:`${n}-tag__icon`},h));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`]:u,[`${n}-tag--closable`]:s}],style:this.cssVars,onClick:this.handleClick,onMouseenter:this.onMouseenter,onMouseleave:this.onMouseleave},u||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(Wk,{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)}}),Pv=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(wh,{clsPrefix:n,class:`${n}-base-suffix`,strokeWidth:24,scale:.85,show:t.loading},{default:()=>t.showArrow?i.h(Lk,{clsPrefix:n,show:t.showClear,onClear:t.onClear},{placeholder:()=>i.h(Pr,{clsPrefix:n,class:`${n}-base-suffix__arrow`},{default:()=>ma(e.default,()=>[i.h(Ik,null)])})}):null})}}}),Ev={paddingSingle:"0 26px 0 12px",paddingMultiple:"3px 26px 0 12px",clearSize:"16px",arrowSize:"16px"};function Fv(t){const{borderRadius:e,textColor2:n,textColorDisabled:r,inputColor:s,inputColorDisabled:o,primaryColor:a,primaryColorHover:l,warningColor:c,warningColorHover:d,errorColor:u,errorColorHover:h,borderColor:f,iconColor:g,iconColorDisabled:m,clearColor:p,clearColorHover:y,clearColorPressed:b,placeholderColor:_,placeholderColorDisabled:B,fontSizeTiny:x,fontSizeSmall:N,fontSizeMedium:R,fontSizeLarge:w,heightTiny:C,heightSmall:k,heightMedium:T,heightLarge:$,fontWeight:P}=t;return Object.assign(Object.assign({},Ev),{fontSizeTiny:x,fontSizeSmall:N,fontSizeMedium:R,fontSizeLarge:w,heightTiny:C,heightSmall:k,heightMedium:T,heightLarge:$,borderRadius:e,fontWeight:P,textColor:n,textColorDisabled:r,placeholderColor:_,placeholderColorDisabled:B,color:s,colorDisabled:o,colorActive:s,border:`1px solid ${f}`,borderHover:`1px solid ${l}`,borderActive:`1px solid ${a}`,borderFocus:`1px solid ${l}`,boxShadowHover:"none",boxShadowActive:`0 0 0 2px ${ze(a,{alpha:.2})}`,boxShadowFocus:`0 0 0 2px ${ze(a,{alpha:.2})}`,caretColor:a,arrowColor:g,arrowColorDisabled:m,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 ${ze(c,{alpha:.2})}`,boxShadowFocusWarning:`0 0 0 2px ${ze(c,{alpha:.2})}`,colorActiveWarning:s,caretColorWarning:c,borderError:`1px solid ${u}`,borderHoverError:`1px solid ${h}`,borderActiveError:`1px solid ${u}`,borderFocusError:`1px solid ${h}`,boxShadowHoverError:"none",boxShadowActiveError:`0 0 0 2px ${ze(u,{alpha:.2})}`,boxShadowFocusError:`0 0 0 2px ${ze(u,{alpha:.2})}`,colorActiveError:s,caretColorError:u,clearColor:p,clearColorHover:y,clearColorPressed:b})}const Vh={name:"InternalSelection",common:Si,peers:{Popover:Eh},self:Fv},Vv=he([ye("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;
|
|
@@ -727,7 +727,7 @@ ${s}
|
|
|
727
727
|
white-space: nowrap;
|
|
728
728
|
`)]),we("render-label",`
|
|
729
729
|
color: var(--n-text-color);
|
|
730
|
-
`)]),rn("disabled",[
|
|
730
|
+
`)]),rn("disabled",[he("&:hover",[we("state-border",`
|
|
731
731
|
box-shadow: var(--n-box-shadow-hover);
|
|
732
732
|
border: var(--n-border-hover);
|
|
733
733
|
`)]),Re("focus",[we("state-border",`
|
|
@@ -785,7 +785,7 @@ ${s}
|
|
|
785
785
|
user-select: none;
|
|
786
786
|
-webkit-user-select: none;
|
|
787
787
|
opacity: 0;
|
|
788
|
-
`)]),["warning","error"].map(t=>Re(`${t}-status`,[we("state-border",`border: var(--n-border-${t});`),rn("disabled",[
|
|
788
|
+
`)]),["warning","error"].map(t=>Re(`${t}-status`,[we("state-border",`border: var(--n-border-${t});`),rn("disabled",[he("&:hover",[we("state-border",`
|
|
789
789
|
box-shadow: var(--n-box-shadow-hover-${t});
|
|
790
790
|
border: var(--n-border-hover-${t});
|
|
791
791
|
`)]),Re("active",[we("state-border",`
|
|
@@ -803,14 +803,14 @@ ${s}
|
|
|
803
803
|
max-width: 100%;
|
|
804
804
|
display: inline-flex;
|
|
805
805
|
padding: 0 7px 3px 0;
|
|
806
|
-
`,[
|
|
806
|
+
`,[he("&:last-child","padding-right: 0;"),ye("tag",`
|
|
807
807
|
font-size: 14px;
|
|
808
808
|
max-width: 100%;
|
|
809
809
|
`,[we("content",`
|
|
810
810
|
line-height: 1.25;
|
|
811
811
|
text-overflow: ellipsis;
|
|
812
812
|
overflow: hidden;
|
|
813
|
-
`)])])]),Iv=i.defineComponent({name:"InternalSelection",props:Object.assign(Object.assign({},wt.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}=vi(t),r=Nr("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),u=i.ref(null),h=i.ref(null),f=i.ref(null),g=i.ref(null),m=i.ref(!1),p=i.ref(!1),y=i.ref(!1),b=wt("InternalSelection","-internal-selection",Vv,Vh,t,i.toRef(t,"clsPrefix")),_=i.computed(()=>t.clearable&&!t.disabled&&(y.value||t.active)),B=i.computed(()=>t.selectedOption?t.renderTag?t.renderTag({option:t.selectedOption,handleClose:()=>{}}):t.renderLabel?t.renderLabel(t.selectedOption,!0):er(t.selectedOption[t.labelField],t.selectedOption,!0):t.placeholder),k=i.computed(()=>{const J=t.selectedOption;if(J)return J[t.labelField]}),N=i.computed(()=>t.multiple?!!(Array.isArray(t.selectedOptions)&&t.selectedOptions.length):t.selectedOption!==null);function R(){var J;const{value:le}=s;if(le){const{value:De}=o;De&&(De.style.width=`${le.offsetWidth}px`,t.maxTagCount!=="responsive"&&((J=f.value)===null||J===void 0||J.sync({showAllItemsBeforeCalculate:!1})))}}function w(){const{value:J}=g;J&&(J.style.display="none")}function C(){const{value:J}=g;J&&(J.style.display="inline-block")}i.watch(i.toRef(t,"active"),J=>{J||w()}),i.watch(i.toRef(t,"pattern"),()=>{t.multiple&&i.nextTick(R)});function x(J){const{onFocus:le}=t;le&&le(J)}function T(J){const{onBlur:le}=t;le&&le(J)}function $(J){const{onDeleteOption:le}=t;le&&le(J)}function F(J){const{onClear:le}=t;le&&le(J)}function I(J){const{onPatternInput:le}=t;le&&le(J)}function L(J){var le;(!J.relatedTarget||!(!((le=a.value)===null||le===void 0)&&le.contains(J.relatedTarget)))&&x(J)}function O(J){var le;!((le=a.value)===null||le===void 0)&&le.contains(J.relatedTarget)||T(J)}function Z(J){F(J)}function ne(){y.value=!0}function E(){y.value=!1}function P(J){!t.active||!t.filterable||J.target!==o.value&&J.preventDefault()}function H(J){$(J)}const Y=i.ref(!1);function D(J){if(J.key==="Backspace"&&!Y.value&&!t.pattern.length){const{selectedOptions:le}=t;le!=null&&le.length&&H(le[le.length-1])}}let X=null;function W(J){const{value:le}=s;if(le){const De=J.target.value;le.textContent=De,R()}t.ignoreComposition&&Y.value?X=J:I(J)}function V(){Y.value=!0}function j(){Y.value=!1,t.ignoreComposition&&I(X),X=null}function U(J){var le;p.value=!0,(le=t.onPatternFocus)===null||le===void 0||le.call(t,J)}function ee(J){var le;p.value=!1,(le=t.onPatternBlur)===null||le===void 0||le.call(t,J)}function he(){var J,le;if(t.filterable)p.value=!1,(J=d.value)===null||J===void 0||J.blur(),(le=o.value)===null||le===void 0||le.blur();else if(t.multiple){const{value:De}=l;De==null||De.blur()}else{const{value:De}=c;De==null||De.blur()}}function Be(){var J,le,De;t.filterable?(p.value=!1,(J=d.value)===null||J===void 0||J.focus()):t.multiple?(le=l.value)===null||le===void 0||le.focus():(De=c.value)===null||De===void 0||De.focus()}function Te(){const{value:J}=o;J&&(C(),J.focus())}function He(){const{value:J}=o;J&&J.blur()}function ce(J){const{value:le}=u;le&&le.setTextContent(`+${J}`)}function mt(){const{value:J}=h;return J}function $e(){return o.value}let Et=null;function Wt(){Et!==null&&window.clearTimeout(Et)}function an(){t.active||(Wt(),Et=window.setTimeout(()=>{N.value&&(m.value=!0)},100))}function Ct(){Wt()}function Ln(J){J||(Wt(),m.value=!1)}i.watch(N,J=>{J||(m.value=!1)}),i.onMounted(()=>{i.watchEffect(()=>{const J=d.value;J&&(t.disabled?J.removeAttribute("tabindex"):J.tabIndex=p.value?-1:0)})}),ih(a,t.onResize);const{inlineThemeDisabled:ln}=t,Jt=i.computed(()=>{const{size:J}=t,{common:{cubicBezierEaseInOut:le},self:{fontWeight:De,borderRadius:ni,color:nt,placeholderColor:jt,textColor:tr,paddingSingle:ii,paddingMultiple:Ni,caretColor:nr,colorDisabled:cn,textColorDisabled:Hn,placeholderColorDisabled:A,colorActive:G,boxShadowFocus:oe,boxShadowActive:fe,boxShadowHover:me,border:_e,borderFocus:ke,borderHover:Ce,borderActive:Ze,arrowColor:Sn,arrowColorDisabled:$a,loadingColor:Na,colorActiveWarning:Ra,boxShadowFocusWarning:Pa,boxShadowActiveWarning:Ea,boxShadowHoverWarning:Fa,borderWarning:Va,borderFocusWarning:Ia,borderHoverWarning:Aa,borderActiveWarning:Ma,colorActiveError:Oa,boxShadowFocusError:za,boxShadowActiveError:Da,boxShadowHoverError:La,borderError:Ha,borderFocusError:Wa,borderHoverError:ja,borderActiveError:$S,clearColor:NS,clearColorHover:RS,clearColorPressed:PS,clearSize:ES,arrowSize:FS,[Je("height",J)]:VS,[Je("fontSize",J)]:IS}}=b.value,As=nn(ii),Ms=nn(Ni);return{"--n-bezier":le,"--n-border":_e,"--n-border-active":Ze,"--n-border-focus":ke,"--n-border-hover":Ce,"--n-border-radius":ni,"--n-box-shadow-active":fe,"--n-box-shadow-focus":oe,"--n-box-shadow-hover":me,"--n-caret-color":nr,"--n-color":nt,"--n-color-active":G,"--n-color-disabled":cn,"--n-font-size":IS,"--n-height":VS,"--n-padding-single-top":As.top,"--n-padding-multiple-top":Ms.top,"--n-padding-single-right":As.right,"--n-padding-multiple-right":Ms.right,"--n-padding-single-left":As.left,"--n-padding-multiple-left":Ms.left,"--n-padding-single-bottom":As.bottom,"--n-padding-multiple-bottom":Ms.bottom,"--n-placeholder-color":jt,"--n-placeholder-color-disabled":A,"--n-text-color":tr,"--n-text-color-disabled":Hn,"--n-arrow-color":Sn,"--n-arrow-color-disabled":$a,"--n-loading-color":Na,"--n-color-active-warning":Ra,"--n-box-shadow-focus-warning":Pa,"--n-box-shadow-active-warning":Ea,"--n-box-shadow-hover-warning":Fa,"--n-border-warning":Va,"--n-border-focus-warning":Ia,"--n-border-hover-warning":Aa,"--n-border-active-warning":Ma,"--n-color-active-error":Oa,"--n-box-shadow-focus-error":za,"--n-box-shadow-active-error":Da,"--n-box-shadow-hover-error":La,"--n-border-error":Ha,"--n-border-focus-error":Wa,"--n-border-hover-error":ja,"--n-border-active-error":$S,"--n-clear-size":ES,"--n-clear-color":NS,"--n-clear-color-hover":RS,"--n-clear-color-pressed":PS,"--n-arrow-size":FS,"--n-font-weight":De}}),Ve=ln?Ci("internal-selection",i.computed(()=>t.size[0]),Jt,t):void 0;return{mergedTheme:b,mergedClearable:_,mergedClsPrefix:e,rtlEnabled:r,patternInputFocused:p,filterablePlaceholder:B,label:k,selected:N,showTagsPanel:m,isComposing:Y,counterRef:u,counterWrapperRef:h,patternInputMirrorRef:s,patternInputRef:o,selfRef:a,multipleElRef:l,singleElRef:c,patternInputWrapperRef:d,overflowRef:f,inputTagElRef:g,handleMouseDown:P,handleFocusin:L,handleClear:Z,handleMouseEnter:ne,handleMouseLeave:E,handleDeleteOption:H,handlePatternKeyDown:D,handlePatternInputInput:W,handlePatternInputBlur:ee,handlePatternInputFocus:U,handleMouseEnterCounter:an,handleMouseLeaveCounter:Ct,handleFocusout:O,handleCompositionEnd:j,handleCompositionStart:V,onPopoverUpdateShow:Ln,focus:Be,focusInput:Te,blur:he,blurInput:He,updateCounter:ce,getCounter:mt,getTail:$e,renderLabel:t.renderLabel,cssVars:ln?void 0:Jt,themeClass:Ve==null?void 0:Ve.themeClass,onRender:Ve==null?void 0:Ve.onRender}},render(){const{status:t,multiple:e,size:n,disabled:r,filterable:s,maxTagCount:o,bordered:a,clsPrefix:l,ellipsisTagPopoverProps:c,onRender:d,renderTag:u,renderLabel:h}=this;d==null||d();const f=o==="responsive",g=typeof o=="number",m=f||g,p=i.h(ga,null,{default:()=>i.h(Pv,{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,_=I=>i.h("div",{class:`${l}-base-selection-tag-wrapper`,key:I.value},u?u({option:I,handleClose:()=>{this.handleDeleteOption(I)}}):i.h(xa,{size:n,closable:!I.disabled,disabled:r,onClose:()=>{this.handleDeleteOption(I)},internalCloseIsButtonTag:!1,internalCloseFocusable:!1},{default:()=>h?h(I,!0):er(I[b],I,!0)})),B=()=>(g?this.selectedOptions.slice(0,o):this.selectedOptions).map(_),k=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,N=f?()=>i.h("div",{class:`${l}-base-selection-tag-wrapper`,ref:"counterWrapperRef"},i.h(xa,{size:n,ref:"counterRef",onMouseenter:this.handleMouseEnterCounter,onMouseleave:this.handleMouseLeaveCounter,disabled:r})):void 0;let R;if(g){const I=this.selectedOptions.length-o;I>0&&(R=i.h("div",{class:`${l}-base-selection-tag-wrapper`,key:"__counter__"},i.h(xa,{size:n,ref:"counterRef",onMouseenter:this.handleMouseEnterCounter,disabled:r},{default:()=>`+${I}`})))}const w=f?s?i.h(Yu,{ref:"overflowRef",updateCounter:this.updateCounter,getCounter:this.getCounter,getTail:this.getTail,style:{width:"100%",display:"flex",overflow:"hidden"}},{default:B,counter:N,tail:()=>k}):i.h(Yu,{ref:"overflowRef",updateCounter:this.updateCounter,getCounter:this.getCounter,style:{width:"100%",display:"flex",overflow:"hidden"}},{default:B,counter:N}):g&&R?B().concat(R):B(),C=m?()=>i.h("div",{class:`${l}-base-selection-popover`},f?B():this.selectedOptions.map(_)):void 0,x=m?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,$=(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,F=s?i.h("div",{ref:"patternInputWrapperRef",class:`${l}-base-selection-tags`},w,f?null:k,p):i.h("div",{ref:"multipleElRef",class:`${l}-base-selection-tags`,tabindex:r?void 0:0},w,p);y=i.h(i.Fragment,null,m?i.h(kv,Object.assign({},x,{scrollable:!0,style:"max-height: calc(var(--v-target-height) * 6.6);"}),{trigger:()=>F,default:C}):F,$)}else if(s){const b=this.pattern||this.isComposing,_=this.active?!b:!this.selected,B=this.active?!1:this.selected;y=i.h("div",{ref:"patternInputWrapperRef",class:`${l}-base-selection-label`,title:this.patternInputFocused?void 0:dh(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})),B?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`},u?u({option:this.selectedOption,handleClose:()=>{}}):h?h(this.selectedOption,!0):er(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:dh(this.label),key:"input"},i.h("div",{class:`${l}-base-selection-input__content`},u?u({option:this.selectedOption,handleClose:()=>{}}):h?h(this.selectedOption,!0):er(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 Av(t){const{boxShadow2:e}=t;return{menuBoxShadow:e}}const Mv={name:"Select",common:Si,peers:{InternalSelection:Vh,InternalSelectMenu:Bh},self:Av},Ov=ue([ye("select",`
|
|
813
|
+
`)])])]),Iv=i.defineComponent({name:"InternalSelection",props:Object.assign(Object.assign({},wt.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}=vi(t),r=Nr("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),u=i.ref(null),h=i.ref(null),f=i.ref(null),g=i.ref(null),m=i.ref(!1),p=i.ref(!1),y=i.ref(!1),b=wt("InternalSelection","-internal-selection",Vv,Vh,t,i.toRef(t,"clsPrefix")),_=i.computed(()=>t.clearable&&!t.disabled&&(y.value||t.active)),B=i.computed(()=>t.selectedOption?t.renderTag?t.renderTag({option:t.selectedOption,handleClose:()=>{}}):t.renderLabel?t.renderLabel(t.selectedOption,!0):er(t.selectedOption[t.labelField],t.selectedOption,!0):t.placeholder),x=i.computed(()=>{const J=t.selectedOption;if(J)return J[t.labelField]}),N=i.computed(()=>t.multiple?!!(Array.isArray(t.selectedOptions)&&t.selectedOptions.length):t.selectedOption!==null);function R(){var J;const{value:le}=s;if(le){const{value:De}=o;De&&(De.style.width=`${le.offsetWidth}px`,t.maxTagCount!=="responsive"&&((J=f.value)===null||J===void 0||J.sync({showAllItemsBeforeCalculate:!1})))}}function w(){const{value:J}=g;J&&(J.style.display="none")}function C(){const{value:J}=g;J&&(J.style.display="inline-block")}i.watch(i.toRef(t,"active"),J=>{J||w()}),i.watch(i.toRef(t,"pattern"),()=>{t.multiple&&i.nextTick(R)});function k(J){const{onFocus:le}=t;le&&le(J)}function T(J){const{onBlur:le}=t;le&&le(J)}function $(J){const{onDeleteOption:le}=t;le&&le(J)}function P(J){const{onClear:le}=t;le&&le(J)}function E(J){const{onPatternInput:le}=t;le&&le(J)}function W(J){var le;(!J.relatedTarget||!(!((le=a.value)===null||le===void 0)&&le.contains(J.relatedTarget)))&&k(J)}function A(J){var le;!((le=a.value)===null||le===void 0)&&le.contains(J.relatedTarget)||T(J)}function Z(J){P(J)}function te(){y.value=!0}function D(){y.value=!1}function H(J){!t.active||!t.filterable||J.target!==o.value&&J.preventDefault()}function L(J){$(J)}const M=i.ref(!1);function O(J){if(J.key==="Backspace"&&!M.value&&!t.pattern.length){const{selectedOptions:le}=t;le!=null&&le.length&&L(le[le.length-1])}}let Y=null;function U(J){const{value:le}=s;if(le){const De=J.target.value;le.textContent=De,R()}t.ignoreComposition&&M.value?Y=J:E(J)}function V(){M.value=!0}function j(){M.value=!1,t.ignoreComposition&&E(Y),Y=null}function q(J){var le;p.value=!0,(le=t.onPatternFocus)===null||le===void 0||le.call(t,J)}function ee(J){var le;p.value=!1,(le=t.onPatternBlur)===null||le===void 0||le.call(t,J)}function ue(){var J,le;if(t.filterable)p.value=!1,(J=d.value)===null||J===void 0||J.blur(),(le=o.value)===null||le===void 0||le.blur();else if(t.multiple){const{value:De}=l;De==null||De.blur()}else{const{value:De}=c;De==null||De.blur()}}function ve(){var J,le,De;t.filterable?(p.value=!1,(J=d.value)===null||J===void 0||J.focus()):t.multiple?(le=l.value)===null||le===void 0||le.focus():(De=c.value)===null||De===void 0||De.focus()}function Te(){const{value:J}=o;J&&(C(),J.focus())}function He(){const{value:J}=o;J&&J.blur()}function ce(J){const{value:le}=u;le&&le.setTextContent(`+${J}`)}function mt(){const{value:J}=h;return J}function $e(){return o.value}let Et=null;function Wt(){Et!==null&&window.clearTimeout(Et)}function an(){t.active||(Wt(),Et=window.setTimeout(()=>{N.value&&(m.value=!0)},100))}function Ct(){Wt()}function Ln(J){J||(Wt(),m.value=!1)}i.watch(N,J=>{J||(m.value=!1)}),i.onMounted(()=>{i.watchEffect(()=>{const J=d.value;J&&(t.disabled?J.removeAttribute("tabindex"):J.tabIndex=p.value?-1:0)})}),ih(a,t.onResize);const{inlineThemeDisabled:ln}=t,Jt=i.computed(()=>{const{size:J}=t,{common:{cubicBezierEaseInOut:le},self:{fontWeight:De,borderRadius:ni,color:nt,placeholderColor:jt,textColor:tr,paddingSingle:ii,paddingMultiple:Ni,caretColor:nr,colorDisabled:cn,textColorDisabled:Hn,placeholderColorDisabled:F,colorActive:G,boxShadowFocus:oe,boxShadowActive:fe,boxShadowHover:me,border:_e,borderFocus:ke,borderHover:Se,borderActive:Ze,arrowColor:Sn,arrowColorDisabled:$a,loadingColor:Na,colorActiveWarning:Ra,boxShadowFocusWarning:Pa,boxShadowActiveWarning:Ea,boxShadowHoverWarning:Fa,borderWarning:Va,borderFocusWarning:Ia,borderHoverWarning:Aa,borderActiveWarning:Ma,colorActiveError:Oa,boxShadowFocusError:za,boxShadowActiveError:Da,boxShadowHoverError:La,borderError:Ha,borderFocusError:Wa,borderHoverError:ja,borderActiveError:$S,clearColor:NS,clearColorHover:RS,clearColorPressed:PS,clearSize:ES,arrowSize:FS,[Je("height",J)]:VS,[Je("fontSize",J)]:IS}}=b.value,As=nn(ii),Ms=nn(Ni);return{"--n-bezier":le,"--n-border":_e,"--n-border-active":Ze,"--n-border-focus":ke,"--n-border-hover":Se,"--n-border-radius":ni,"--n-box-shadow-active":fe,"--n-box-shadow-focus":oe,"--n-box-shadow-hover":me,"--n-caret-color":nr,"--n-color":nt,"--n-color-active":G,"--n-color-disabled":cn,"--n-font-size":IS,"--n-height":VS,"--n-padding-single-top":As.top,"--n-padding-multiple-top":Ms.top,"--n-padding-single-right":As.right,"--n-padding-multiple-right":Ms.right,"--n-padding-single-left":As.left,"--n-padding-multiple-left":Ms.left,"--n-padding-single-bottom":As.bottom,"--n-padding-multiple-bottom":Ms.bottom,"--n-placeholder-color":jt,"--n-placeholder-color-disabled":F,"--n-text-color":tr,"--n-text-color-disabled":Hn,"--n-arrow-color":Sn,"--n-arrow-color-disabled":$a,"--n-loading-color":Na,"--n-color-active-warning":Ra,"--n-box-shadow-focus-warning":Pa,"--n-box-shadow-active-warning":Ea,"--n-box-shadow-hover-warning":Fa,"--n-border-warning":Va,"--n-border-focus-warning":Ia,"--n-border-hover-warning":Aa,"--n-border-active-warning":Ma,"--n-color-active-error":Oa,"--n-box-shadow-focus-error":za,"--n-box-shadow-active-error":Da,"--n-box-shadow-hover-error":La,"--n-border-error":Ha,"--n-border-focus-error":Wa,"--n-border-hover-error":ja,"--n-border-active-error":$S,"--n-clear-size":ES,"--n-clear-color":NS,"--n-clear-color-hover":RS,"--n-clear-color-pressed":PS,"--n-arrow-size":FS,"--n-font-weight":De}}),Ve=ln?Ci("internal-selection",i.computed(()=>t.size[0]),Jt,t):void 0;return{mergedTheme:b,mergedClearable:_,mergedClsPrefix:e,rtlEnabled:r,patternInputFocused:p,filterablePlaceholder:B,label:x,selected:N,showTagsPanel:m,isComposing:M,counterRef:u,counterWrapperRef:h,patternInputMirrorRef:s,patternInputRef:o,selfRef:a,multipleElRef:l,singleElRef:c,patternInputWrapperRef:d,overflowRef:f,inputTagElRef:g,handleMouseDown:H,handleFocusin:W,handleClear:Z,handleMouseEnter:te,handleMouseLeave:D,handleDeleteOption:L,handlePatternKeyDown:O,handlePatternInputInput:U,handlePatternInputBlur:ee,handlePatternInputFocus:q,handleMouseEnterCounter:an,handleMouseLeaveCounter:Ct,handleFocusout:A,handleCompositionEnd:j,handleCompositionStart:V,onPopoverUpdateShow:Ln,focus:ve,focusInput:Te,blur:ue,blurInput:He,updateCounter:ce,getCounter:mt,getTail:$e,renderLabel:t.renderLabel,cssVars:ln?void 0:Jt,themeClass:Ve==null?void 0:Ve.themeClass,onRender:Ve==null?void 0:Ve.onRender}},render(){const{status:t,multiple:e,size:n,disabled:r,filterable:s,maxTagCount:o,bordered:a,clsPrefix:l,ellipsisTagPopoverProps:c,onRender:d,renderTag:u,renderLabel:h}=this;d==null||d();const f=o==="responsive",g=typeof o=="number",m=f||g,p=i.h(ga,null,{default:()=>i.h(Pv,{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,_=E=>i.h("div",{class:`${l}-base-selection-tag-wrapper`,key:E.value},u?u({option:E,handleClose:()=>{this.handleDeleteOption(E)}}):i.h(xa,{size:n,closable:!E.disabled,disabled:r,onClose:()=>{this.handleDeleteOption(E)},internalCloseIsButtonTag:!1,internalCloseFocusable:!1},{default:()=>h?h(E,!0):er(E[b],E,!0)})),B=()=>(g?this.selectedOptions.slice(0,o):this.selectedOptions).map(_),x=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,N=f?()=>i.h("div",{class:`${l}-base-selection-tag-wrapper`,ref:"counterWrapperRef"},i.h(xa,{size:n,ref:"counterRef",onMouseenter:this.handleMouseEnterCounter,onMouseleave:this.handleMouseLeaveCounter,disabled:r})):void 0;let R;if(g){const E=this.selectedOptions.length-o;E>0&&(R=i.h("div",{class:`${l}-base-selection-tag-wrapper`,key:"__counter__"},i.h(xa,{size:n,ref:"counterRef",onMouseenter:this.handleMouseEnterCounter,disabled:r},{default:()=>`+${E}`})))}const w=f?s?i.h(Yu,{ref:"overflowRef",updateCounter:this.updateCounter,getCounter:this.getCounter,getTail:this.getTail,style:{width:"100%",display:"flex",overflow:"hidden"}},{default:B,counter:N,tail:()=>x}):i.h(Yu,{ref:"overflowRef",updateCounter:this.updateCounter,getCounter:this.getCounter,style:{width:"100%",display:"flex",overflow:"hidden"}},{default:B,counter:N}):g&&R?B().concat(R):B(),C=m?()=>i.h("div",{class:`${l}-base-selection-popover`},f?B():this.selectedOptions.map(_)):void 0,k=m?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,$=(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,P=s?i.h("div",{ref:"patternInputWrapperRef",class:`${l}-base-selection-tags`},w,f?null:x,p):i.h("div",{ref:"multipleElRef",class:`${l}-base-selection-tags`,tabindex:r?void 0:0},w,p);y=i.h(i.Fragment,null,m?i.h(kv,Object.assign({},k,{scrollable:!0,style:"max-height: calc(var(--v-target-height) * 6.6);"}),{trigger:()=>P,default:C}):P,$)}else if(s){const b=this.pattern||this.isComposing,_=this.active?!b:!this.selected,B=this.active?!1:this.selected;y=i.h("div",{ref:"patternInputWrapperRef",class:`${l}-base-selection-label`,title:this.patternInputFocused?void 0:dh(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})),B?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`},u?u({option:this.selectedOption,handleClose:()=>{}}):h?h(this.selectedOption,!0):er(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:dh(this.label),key:"input"},i.h("div",{class:`${l}-base-selection-input__content`},u?u({option:this.selectedOption,handleClose:()=>{}}):h?h(this.selectedOption,!0):er(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 Av(t){const{boxShadow2:e}=t;return{menuBoxShadow:e}}const Mv={name:"Select",common:Si,peers:{InternalSelection:Vh,InternalSelectMenu:Bh},self:Av},Ov=he([ye("select",`
|
|
814
814
|
z-index: auto;
|
|
815
815
|
outline: none;
|
|
816
816
|
width: 100%;
|
|
@@ -819,4 +819,4 @@ ${s}
|
|
|
819
819
|
`),ye("select-menu",`
|
|
820
820
|
margin: 4px 0;
|
|
821
821
|
box-shadow: var(--n-menu-box-shadow);
|
|
822
|
-
`,[Ph({originalTransition:"background-color .3s var(--n-bezier), box-shadow .3s var(--n-bezier)"})])]);function Fs(t){return t.type==="group"}function Ih(t){return t.type==="ignored"}function ka(t,e){try{return!!(1+e.toString().toLowerCase().indexOf(t.trim().toLowerCase()))}catch{return!1}}function zv(t,e){return{getIsGroup:Fs,getIgnored:Ih,getKey(r){return Fs(r)?r.name||r.key||"key-required":r[t]},getChildren(r){return r[e]}}}function Dv(t,e,n,r){if(!e)return t;function s(o){if(!Array.isArray(o))return[];const a=[];for(const l of o)if(Fs(l)){const c=s(l[r]);c.length&&a.push(Object.assign({},l,{[r]:c}))}else{if(Ih(l))continue;e(n,l)&&a.push(l)}return a}return s(t)}function Lv(t,e,n){const r=new Map;return t.forEach(s=>{Fs(s)?s[n].forEach(o=>{r.set(o[e],o)}):r.set(s[e],s)}),r}var Hv={};const Wv=Object.assign(Object.assign({},wt.props),{to:En.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}),jv=i.defineComponent({name:"Select",props:Wv,slots:Object,setup(t){Hv.NODE_ENV!=="production"&&i.watchEffect(()=>{t.items!==void 0&&ei("select","`items` is deprecated, please use `options` instead."),t.onChange!==void 0&&ei("select","`on-change` is deprecated, please use `on-update:value` instead.")});const{mergedClsPrefixRef:e,mergedBorderedRef:n,namespaceRef:r,inlineThemeDisabled:s}=vi(t),o=wt("Select","-select",Ov,Mv,t,e),a=i.ref(t.defaultValue),l=i.toRef(t,"value"),c=Go(l,a),d=i.ref(!1),u=i.ref(""),h=lu(t,["items","options"]),f=i.ref([]),g=i.ref([]),m=i.computed(()=>g.value.concat(f.value).concat(h.value)),p=i.computed(()=>{const{filter:A}=t;if(A)return A;const{labelField:G,valueField:oe}=t;return(fe,me)=>{if(!me)return!1;const _e=me[G];if(typeof _e=="string")return ka(fe,_e);const ke=me[oe];return typeof ke=="string"?ka(fe,ke):typeof ke=="number"?ka(fe,String(ke)):!1}}),y=i.computed(()=>{if(t.remote)return h.value;{const{value:A}=m,{value:G}=u;return!G.length||!t.filterable?A:Dv(A,p.value,G,t.childrenField)}}),b=i.computed(()=>{const{valueField:A,childrenField:G}=t,oe=zv(A,G);return pw(y.value,oe)}),_=i.computed(()=>Lv(m.value,t.valueField,t.childrenField)),B=i.ref(!1),k=Go(i.toRef(t,"show"),B),N=i.ref(null),R=i.ref(null),w=i.ref(null),{localeRef:C}=ph("Select"),x=i.computed(()=>{var A;return(A=t.placeholder)!==null&&A!==void 0?A:C.value.placeholder}),T=[],$=i.ref(new Map),F=i.computed(()=>{const{fallbackOption:A}=t;if(A===void 0){const{labelField:G,valueField:oe}=t;return fe=>({[G]:String(fe),[oe]:fe})}return A===!1?!1:G=>Object.assign(A(G),{value:G})});function I(A){const G=t.remote,{value:oe}=$,{value:fe}=_,{value:me}=F,_e=[];return A.forEach(ke=>{if(fe.has(ke))_e.push(fe.get(ke));else if(G&&oe.has(ke))_e.push(oe.get(ke));else if(me){const Ce=me(ke);Ce&&_e.push(Ce)}}),_e}const L=i.computed(()=>{if(t.multiple){const{value:A}=c;return Array.isArray(A)?I(A):[]}return null}),O=i.computed(()=>{const{value:A}=c;return!t.multiple&&!Array.isArray(A)?A===null?null:I([A])[0]||null:null}),Z=Kx(t),{mergedSizeRef:ne,mergedDisabledRef:E,mergedStatusRef:P}=Z;function H(A,G){const{onChange:oe,"onUpdate:value":fe,onUpdateValue:me}=t,{nTriggerFormChange:_e,nTriggerFormInput:ke}=Z;oe&&_t(oe,A,G),me&&_t(me,A,G),fe&&_t(fe,A,G),a.value=A,_e(),ke()}function Y(A){const{onBlur:G}=t,{nTriggerFormBlur:oe}=Z;G&&_t(G,A),oe()}function D(){const{onClear:A}=t;A&&_t(A)}function X(A){const{onFocus:G,showOnFocus:oe}=t,{nTriggerFormFocus:fe}=Z;G&&_t(G,A),fe(),oe&&ee()}function W(A){const{onSearch:G}=t;G&&_t(G,A)}function V(A){const{onScroll:G}=t;G&&_t(G,A)}function j(){var A;const{remote:G,multiple:oe}=t;if(G){const{value:fe}=$;if(oe){const{valueField:me}=t;(A=L.value)===null||A===void 0||A.forEach(_e=>{fe.set(_e[me],_e)})}else{const me=O.value;me&&fe.set(me[t.valueField],me)}}}function U(A){const{onUpdateShow:G,"onUpdate:show":oe}=t;G&&_t(G,A),oe&&_t(oe,A),B.value=A}function ee(){E.value||(U(!0),B.value=!0,t.filterable&&ii())}function he(){U(!1)}function Be(){u.value="",g.value=T}const Te=i.ref(!1);function He(){t.filterable&&(Te.value=!0)}function ce(){t.filterable&&(Te.value=!1,k.value||Be())}function mt(){E.value||(k.value?t.filterable?ii():he():ee())}function $e(A){var G,oe;!((oe=(G=w.value)===null||G===void 0?void 0:G.selfRef)===null||oe===void 0)&&oe.contains(A.relatedTarget)||(d.value=!1,Y(A),he())}function Et(A){X(A),d.value=!0}function Wt(){d.value=!0}function an(A){var G;!((G=N.value)===null||G===void 0)&&G.$el.contains(A.relatedTarget)||(d.value=!1,Y(A),he())}function Ct(){var A;(A=N.value)===null||A===void 0||A.focus(),he()}function Ln(A){var G;k.value&&(!((G=N.value)===null||G===void 0)&&G.$el.contains(br(A))||he())}function ln(A){if(!Array.isArray(A))return[];if(F.value)return Array.from(A);{const{remote:G}=t,{value:oe}=_;if(G){const{value:fe}=$;return A.filter(me=>oe.has(me)||fe.has(me))}else return A.filter(fe=>oe.has(fe))}}function Jt(A){Ve(A.rawNode)}function Ve(A){if(E.value)return;const{tag:G,remote:oe,clearFilterAfterSelect:fe,valueField:me}=t;if(G&&!oe){const{value:_e}=g,ke=_e[0]||null;if(ke){const Ce=f.value;Ce.length?Ce.push(ke):f.value=[ke],g.value=T}}if(oe&&$.value.set(A[me],A),t.multiple){const _e=ln(c.value),ke=_e.findIndex(Ce=>Ce===A[me]);if(~ke){if(_e.splice(ke,1),G&&!oe){const Ce=J(A[me]);~Ce&&(f.value.splice(Ce,1),fe&&(u.value=""))}}else _e.push(A[me]),fe&&(u.value="");H(_e,I(_e))}else{if(G&&!oe){const _e=J(A[me]);~_e?f.value=[f.value[_e]]:f.value=T}tr(),he(),H(A[me],A)}}function J(A){return f.value.findIndex(oe=>oe[t.valueField]===A)}function le(A){k.value||ee();const{value:G}=A.target;u.value=G;const{tag:oe,remote:fe}=t;if(W(G),oe&&!fe){if(!G){g.value=T;return}const{onCreate:me}=t,_e=me?me(G):{[t.labelField]:G,[t.valueField]:G},{valueField:ke,labelField:Ce}=t;h.value.some(Ze=>Ze[ke]===_e[ke]||Ze[Ce]===_e[Ce])||f.value.some(Ze=>Ze[ke]===_e[ke]||Ze[Ce]===_e[Ce])?g.value=T:g.value=[_e]}}function De(A){A.stopPropagation();const{multiple:G}=t;!G&&t.filterable&&he(),D(),G?H([],[]):H(null,null)}function ni(A){!yr(A,"action")&&!yr(A,"empty")&&!yr(A,"header")&&A.preventDefault()}function nt(A){V(A)}function jt(A){var G,oe,fe,me,_e;if(!t.keyboard){A.preventDefault();return}switch(A.key){case" ":if(t.filterable)break;A.preventDefault();case"Enter":if(!(!((G=N.value)===null||G===void 0)&&G.isComposing)){if(k.value){const ke=(oe=w.value)===null||oe===void 0?void 0:oe.getPendingTmNode();ke?Jt(ke):t.filterable||(he(),tr())}else if(ee(),t.tag&&Te.value){const ke=g.value[0];if(ke){const Ce=ke[t.valueField],{value:Ze}=c;t.multiple&&Array.isArray(Ze)&&Ze.includes(Ce)||Ve(ke)}}}A.preventDefault();break;case"ArrowUp":if(A.preventDefault(),t.loading)return;k.value&&((fe=w.value)===null||fe===void 0||fe.prev());break;case"ArrowDown":if(A.preventDefault(),t.loading)return;k.value?(me=w.value)===null||me===void 0||me.next():ee();break;case"Escape":k.value&&(qx(A),he()),(_e=N.value)===null||_e===void 0||_e.focus();break}}function tr(){var A;(A=N.value)===null||A===void 0||A.focus()}function ii(){var A;(A=N.value)===null||A===void 0||A.focusInput()}function Ni(){var A;k.value&&((A=R.value)===null||A===void 0||A.syncPosition())}j(),i.watch(i.toRef(t,"options"),j);const nr={focus:()=>{var A;(A=N.value)===null||A===void 0||A.focus()},focusInput:()=>{var A;(A=N.value)===null||A===void 0||A.focusInput()},blur:()=>{var A;(A=N.value)===null||A===void 0||A.blur()},blurInput:()=>{var A;(A=N.value)===null||A===void 0||A.blurInput()}},cn=i.computed(()=>{const{self:{menuBoxShadow:A}}=o.value;return{"--n-menu-box-shadow":A}}),Hn=s?Ci("select",void 0,cn,t):void 0;return Object.assign(Object.assign({},nr),{mergedStatus:P,mergedClsPrefix:e,mergedBordered:n,namespace:r,treeMate:b,isMounted:ws(),triggerRef:N,menuRef:w,pattern:u,uncontrolledShow:B,mergedShow:k,adjustedTo:En(t),uncontrolledValue:a,mergedValue:c,followerRef:R,localizedPlaceholder:x,selectedOption:O,selectedOptions:L,mergedSize:ne,mergedDisabled:E,focused:d,activeWithoutMenuOpen:Te,inlineThemeDisabled:s,onTriggerInputFocus:He,onTriggerInputBlur:ce,handleTriggerOrMenuResize:Ni,handleMenuFocus:Wt,handleMenuBlur:an,handleMenuTabOut:Ct,handleTriggerClick:mt,handleToggle:Jt,handleDeleteOption:Ve,handlePatternInput:le,handleClear:De,handleTriggerBlur:$e,handleTriggerFocus:Et,handleKeydown:jt,handleMenuAfterLeave:Be,handleMenuClickOutside:Ln,handleMenuScroll:nt,handleMenuKeydown:jt,handleMenuMousedown:ni,mergedTheme:o,cssVars:s?void 0:cn,themeClass:Hn==null?void 0:Hn.themeClass,onRender:Hn==null?void 0:Hn.onRender})},render(){return i.h("div",{class:`${this.mergedClsPrefix}-select`},i.h(hu,null,{default:()=>[i.h(fu,null,{default:()=>i.h(Iv,{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($u,{ref:"followerRef",show:this.mergedShow,to:this.adjustedTo,teleportDisabled:this.adjustedTo===En.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(dv,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],[_s,this.handleMenuClickOutside,void 0,{capture:!0}]]:[[_s,this.handleMenuClickOutside,void 0,{capture:!0}]])):null}})})]}))}}),qv={},Ah=i.defineComponent({...qv,__name:"searchable-reference-select",props:{searchDataHandler:{},optionsListConverter:{},renderLabel:{},renderTag:{},value:{},clearable:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},minTermLength:{default:()=>{var t,e;return((e=(t=K.useBaseConfigStateStore().getConfig())==null?void 0:t.minLength)==null?void 0:e.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(()=>M.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),u=i.useTemplateRef("select-component"),h=_=>{_.length<r.minTermLength||(d.value=!0,r.searchDataHandler(_,d).then(B=>{if(M.isEmpty(B))return;const k=o.value?r.value:r.value?[r.value]:[],N=B.filter(R=>!k.some(w=>w.id===R.id));l.value=r.optionsListConverter([...k,...N])}).finally(()=>{d.value=!1}))};let f="";const g=M.debounce(()=>h(f),800),m=_=>{f=_,g()},p=_=>{var B;if(M.isArray(_)){const k=_.length>0?_.map(N=>{var R;return i.toRaw((R=l.value.find(w=>w.value===N))==null?void 0:R.item)}):[];s("update:value",k)}else if(_>0){const k=i.toRaw((B=l.value.find(N=>N.value===_))==null?void 0:B.item);s("update:value",k)}else s("update:value",null)};return e({focus:()=>{var _;return(_=u.value)==null?void 0:_.focusInput()},blur:()=>{var _;return(_=u.value)==null?void 0:_.blurInput()}}),(_,B)=>(i.openBlock(),i.createBlock(i.unref(jv),{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:m,"onUpdate:value":p},null,8,["clearable","consistent-menu-width","disabled","loading","multiple","options","placeholder","value","render-label","render-tag"]))}}),Xv={},Mh=i.defineComponent({...Xv,__name:"searchable-product-select",props:{renderLabel:{},renderTag:{},value:{},clearable:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},minTermLength:{default:()=>{var t,e;return((e=(t=K.useBaseConfigStateStore().getConfig())==null?void 0:t.minLength)==null?void 0:e.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 h=>r.searchType==="categories"?K.HttpRequester.getInstance(K.ProductCategoryDataProvider).publicSimpleSearch(h):r.searchType==="products"?K.HttpRequester.getInstance(K.ProductDataProvider).publicSimpleSearch(h):new Promise(f=>{f([])}),l=h=>r.searchType==="categories"?Vt.convertReferencesToSelectOptionsList(h,!0,!1,!1,f=>f!=null&&f.isNewRec()?"-":f.name):r.searchType==="products"?Vt.convertReferencesToSelectOptionsList(h,!0,!1,!1,f=>f!=null&&f.isNewRec()?"-":`[${f.code}] ${f.name}`):[],c=(h,f)=>{if(r.renderLabel)return r.renderLabel(h,f);if(r.searchType==="products"){const g=h.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=h.item;return i.h("div",{},[g.name])}};return e({focus:()=>{var h;return(h=o.value)==null?void 0:h.focus()},blur:()=>{var h;return(h=o.value)==null?void 0:h.blur()}}),(h,f)=>(i.openBlock(),i.createBlock(Ah,{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":f[0]||(f[0]=g=>s("update:value",g))},null,8,["value","clearable","disabled","placeholder","consistent-menu-width","wrap-content","min-term-length","render-tag"]))}}),Yv={class:"col-span-2 flex flex-row gap-2.5"},Uv={class:"flex-1"},Kv={class:"text-sc-grey"},Gv={class:"ml-2.5"},Zv={key:0,class:"flex-none"},Qv={},Jv=i.defineComponent({...Qv,__name:"products-list",props:{value:{},searchType:{},minTermLength:{default:()=>{var t,e;return((e=(t=K.useBaseConfigStateStore().getConfig())==null?void 0:t.minLength)==null?void 0:e.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(h=>i.toRaw(h)))},c=h=>{h&&(a.value=[...a.value.map(f=>i.toRaw(f)),...(M.isArray(h)?h:[h]).filter(f=>!a.value.some(g=>g.id===f.id))],i.nextTick(()=>{s.value=null}),l())},d=h=>{h&&(a.value=a.value.map(f=>f.id===h.id?h:i.toRaw(f)),l())},u=h=>{a.value=a.value.filter(f=>f.id!==h.id),l()};return i.watch(()=>n.value,()=>{a.value=o()}),(h,f)=>{const g=z.NListItem,m=$1,p=z.NButton,y=z.NList;return i.openBlock(),i.createBlock(y,{"show-divider":!1,hoverable:!0},{header:i.withCtx(()=>[i.renderSlot(h.$slots,"header")]),footer:i.withCtx(()=>[i.createVNode(Mh,{value:s.value,"onUpdate:value":[f[0]||(f[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(()=>[...f[1]||(f[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:_=>u(b)},{default:i.withCtx(()=>[i.createVNode(m)]),_:1},8,["disabled","onClick"])]),default:i.withCtx(()=>[i.createElementVNode("div",Yv,[i.createElementVNode("span",Uv,[i.createElementVNode("span",Kv,i.toDisplayString(b.code),1),i.createElementVNode("span",Gv,i.toDisplayString(b.name),1)]),h.$slots["item-extra"]?(i.openBlock(),i.createElementBlock("div",Zv,[i.renderSlot(h.$slots,"item-extra",{item:b,updateItemCallback:d})])):i.createCommentVNode("",!0)])]),_:2},1024))),128))]),_:3})}}}),eC={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function tC(t,e){return i.openBlock(),i.createElementBlock("svg",eC,[...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 nC=i.markRaw({name:"tabler-truck-filled",render:tC}),iC={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function rC(t,e){return i.openBlock(),i.createElementBlock("svg",iC,[...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 sC=i.markRaw({name:"tabler-truck-delivery",render:rC}),oC={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function aC(t,e){return i.openBlock(),i.createElementBlock("svg",oC,[...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 lC=i.markRaw({name:"tabler-truck-loading",render:aC}),cC={class:"flex flex-col gap-1"},dC={key:0,class:"flex flex-row gap-1 text-sm text-sc-grey"},uC={key:1,class:"text-base"},hC={class:"text-sc-dark-grey mr-1.5"},fC={key:0},mC={key:1},gC={},Vs=i.defineComponent({...gC,__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=K.useReferencesStore().deliveryTypeReference)==null?void 0:s.find(o=>o.id===r.delivery.type)}),n=i.computed(()=>Tn.format(r.delivery.date,"dd.MM.yyyy")),r=t;return(s,o)=>{var d,u,h,f,g,m,p,y;const a=lC,l=sC,c=nC;return i.openBlock(),i.createElementBlock("div",cC,[t.showType?(i.openBlock(),i.createElementBlock("span",dC,[((d=e.value)==null?void 0:d.slug)==="self_delivery"?(i.openBlock(),i.createBlock(a,{key:0})):i.createCommentVNode("",!0),((u=e.value)==null?void 0:u.slug)==="delivery"?(i.openBlock(),i.createBlock(l,{key:1})):i.createCommentVNode("",!0),((h=e.value)==null?void 0:h.slug)==="transport_company_delivery"?(i.openBlock(),i.createBlock(c,{key:2})):i.createCommentVNode("",!0),i.createElementVNode("span",null,i.toDisplayString((f=e.value)==null?void 0:f.name),1)])):i.createCommentVNode("",!0),t.showDetails?(i.openBlock(),i.createElementBlock("span",uC,[i.createElementVNode("span",hC,i.toDisplayString(n.value),1),(m=(g=t.delivery)==null?void 0:g.address)!=null&&m.address?(i.openBlock(),i.createElementBlock("span",fC,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",mC," со склада "+i.toDisplayString(t.delivery.warehouse.address),1)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)])}}}),pC={class:"flex flex-col gap-2.5"},yC={class:"text-base"},bC=["href"],_C={class:"text-sc-grey"},wC={},Oh=i.defineComponent({...wC,__name:"order-common-info",props:{order:{},fields:{},showAttachedUserColumn:{type:Boolean},orderContextButtonsConfig:{type:Function},onOrderContextSelect:{type:Function},orderUrl:{}},setup(t){const e=t,n=i.computed(()=>e.fields.includes(Ee.Id)?e.order.id:void 0),r=i.computed(()=>{var l,c;return e.fields.includes(Ee.Status)?(c=(l=K.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(Ee.CreatedAt)),o=i.computed(()=>e.fields.includes(Ee.ClientInfo)||e.fields.includes(Ee.ClientInfoShort)?e.order.client:void 0),a=i.computed(()=>e.fields.includes(Ee.DeliveryInfo)?e.order.delivery:void 0);return(l,c)=>(i.openBlock(),i.createElementBlock("div",pC,[i.createElementVNode("span",yC,[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,bC)):i.createCommentVNode("",!0),s.value?(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[c[0]||(c[0]=i.createTextVNode(" от ",-1)),i.createVNode(fs,{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",_C,i.toDisplayString(r.value),1)],64)):i.createCommentVNode("",!0)]),o.value?(i.openBlock(),i.createBlock(pr,{key:0,client:o.value,class:"ml-3"},null,8,["client"])):i.createCommentVNode("",!0),a.value?(i.openBlock(),i.createBlock(Vs,{key:1,delivery:a.value,class:"ml-3"},null,8,["delivery"])):i.createCommentVNode("",!0)]))}}),xC={},va=i.defineComponent({...xC,__name:"order-payment",props:{payment:{}},setup(t){const e=t,n=i.computed(()=>{var r;return(r=K.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)}}}),kC={class:"inline-block py-[0.0625rem] px-1.5 text-xs font-bold text-center whitespace-nowrap rounded text-white bg-[#17a2b8]"},vC={},Ca=i.defineComponent({...vC,__name:"creator-user-type-tag",props:{userType:{},prefixText:{default:"Добавлено"}},setup(t){const e=(n,r)=>{const s={[K.UserTypeEnum.Manager]:"менеджером",[K.UserTypeEnum.Operator]:"оператором",[K.UserTypeEnum.Client]:"клиентом",[K.UserTypeEnum.Admin]:"администратором"};return`${r} ${s[n]}`};return(n,r)=>(i.openBlock(),i.createElementBlock("small",kC,i.toDisplayString(e(t.userType,t.prefixText)),1))}}),CC={class:"flex flex-row gap-1.5"},SC={class:"flex-none text-nowrap"},BC={class:"flex flex-1 flex-col"},TC={class:"mt-2.5 grid grid-flow-col grid-rows-2 gap-1 text-base"},$C={key:0},NC={key:1},RC={},zh=i.defineComponent({...RC,__name:"order-product-info",props:{product:{},index:{}},setup(t){return(e,n)=>{const r=Ca;return i.openBlock(),i.createElementBlock("div",CC,[i.createElementVNode("span",SC,i.toDisplayString(t.index+1)+".",1),i.createElementVNode("div",BC,[i.createVNode(lr,{product:t.product.product,"show-planning-dates":!1},null,8,["product"]),t.product.creatorUser&&t.product.creatorUser.type?(i.openBlock(),i.createBlock(r,{key:0,"user-type":t.product.creatorUser.type,class:"mt-1 self-start"},null,8,["user-type"])):i.createCommentVNode("",!0),i.createElementVNode("div",TC,[n[0]||(n[0]=i.createElementVNode("span",null,"Кол-во",-1)),t.product.product.getIsMeasurable()?(i.openBlock(),i.createElementBlock("span",$C,i.toDisplayString(`${t.product.length} ${t.product.product.unit.name} x ${t.product.quantity} шт.`),1)):(i.openBlock(),i.createElementBlock("span",NC,i.toDisplayString(`${t.product.quantity} ${t.product.product.unit.name}`),1)),n[1]||(n[1]=i.createElementVNode("span",null,"Цена за ед.",-1)),i.createVNode(jn,{product:t.product,"cost-field-name":"costOneRub"},null,8,["product"]),n[2]||(n[2]=i.createElementVNode("span",null,"Сумма",-1)),i.createVNode(jn,{product:t.product,"cost-field-name":"cost"},null,8,["product"])])])])}}}),PC={},EC=i.defineComponent({...PC,__name:"order-items-list",props:{products:{},maxHeight:{default:void 0}},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,width:"45%",render:o=>i.h("div",{},[i.h(lr,{product:o.product,showCode:!1,showPlanningDates:!1}),..."creatorUser"in o&&o.creatorUser&&o.creatorUser.type?[i.h(Ca,{class:"mt-1",userType:o.creatorUser.type,prefixText:"Добавлено"})]:[]])},{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.name} x ${o.quantity} шт.`]:[`${o.quantity} ${o.product.unit.name}`])},{title:"Цена за ед.",key:"costOneRub",resizable:!0,minWidth:100,render:o=>i.h(jn,{product:o,costFieldName:"costOne",showQuantityUnit:!0})},{title:"Сумма",key:"cost",resizable:!0,minWidth:100,render:o=>i.h(jn,{product:o,costFieldName:"cost",showQuantityUnit:!0})}];switch(St.getDeviceTypeByResolution()){case Qe.phone:case Qe.tablet:return[{title:"",key:"items",resizable:!0,render:(o,a)=>i.h(zh,{product:o,index:a})}];case Qe.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.products,"row-key":l=>l.id,"bottom-bordered":!1,bordered:!1,"max-height":t.maxHeight},null,8,["columns","data","row-key","max-height"])],64)}}}),Dh=Wn(EC,[["__scopeId","data-v-e5948917"]]),FC={class:"text-base"},VC={},Sa=i.defineComponent({...VC,__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",FC,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))}}),IC={class:"ml-4 grid grid-cols-3 gap-1.5 text-base"},AC={class:"col-span-2"},MC={class:"col-span-2"},OC={class:"btn btn-primary",href:"{{ invoice }}"},zC={},Lh=i.defineComponent({...zC,__name:"order-details",props:{order:{}},emits:["click:client-name"],setup(t,{emit:e}){const n=e;return(r,s)=>(i.openBlock(),i.createElementBlock("div",null,[s[12]||(s[12]=i.createElementVNode("h3",null,"Детали заказа",-1)),i.createElementVNode("div",IC,[t.order.creator.id!==t.order.client.id?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[s[1]||(s[1]=i.createElementVNode("span",null,"Создал",-1)),i.createVNode(Sa,{user:t.order.creator,class:"col-span-2"},null,8,["user"])],64)):i.createCommentVNode("",!0),s[11]||(s[11]=i.createElementVNode("span",null,"Клиент",-1)),i.createVNode(pr,{client:t.order.client,class:"col-span-2","onClick:clientName":s[0]||(s[0]=o=>n("click:client-name",t.order.client,o))},null,8,["client"]),t.order.contragent?(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[s[2]||(s[2]=i.createElementVNode("span",null,"Контрагент",-1)),i.createVNode(Wd,{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},[s[3]||(s[3]=i.createElementVNode("span",null,"Графический файл клиента",-1)),s[4]||(s[4]=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},[s[5]||(s[5]=i.createElementVNode("span",null,"Штрих-код",-1)),i.createElementVNode("span",AC,i.toDisplayString(t.order.barcode),1)],64)):i.createCommentVNode("",!0),t.order.payment?(i.openBlock(),i.createElementBlock(i.Fragment,{key:4},[s[6]||(s[6]=i.createElementVNode("span",null,"Оплата",-1)),i.createVNode(va,{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},[s[7]||(s[7]=i.createElementVNode("span",null,"Доставка",-1)),i.createVNode(Vs,{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},[s[8]||(s[8]=i.createElementVNode("span",null,"Комментарий",-1)),i.createElementVNode("span",MC,i.toDisplayString(t.order.comment),1)],64)):i.createCommentVNode("",!0),t.order.attachedUser?(i.openBlock(),i.createElementBlock(i.Fragment,{key:7},[s[9]||(s[9]=i.createElementVNode("span",null,"Закреплен за",-1)),i.createVNode(Sa,{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},[s[10]||(s[10]=i.createElementVNode("span",null,"Прикрепленные счета",-1)),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(t.order.invoices,(o,a)=>(i.openBlock(),i.createElementBlock("div",{key:a,class:"col-span-2"},[i.createElementVNode("a",OC," Скачать счет №"+i.toDisplayString(a+1),1)]))),128))],64)):i.createCommentVNode("",!0)])]))}}),DC={key:0},LC={class:"text-sc-dark-grey my-2 text-center"},HC={key:1,class:"text-sc-dark-grey my-2 text-center"},WC={key:2},jC={class:"text-sc-dark-grey mt-4 text-right font-bold"},qC={class:"text-sc-primary"},XC={},Hh=i.defineComponent({...XC,__name:"order-info",props:{order:{}},emits:["click:client-name"],setup(t,{emit:e}){const n=t,r=e,s=i.ref(!1),o=i.ref(new K.Order(n.order)),a=(c=!0)=>{c&&(s.value=!0),K.HttpRequester.getInstance(K.OrdersDataProvider).getOrder(n.order.id).then(d=>{o.value=d}).finally(()=>{c&&(s.value=!1)})},l=i.computed(()=>(o.value.products??[]).reduce((c,d)=>c+d.costRub,0).toLocaleString("ru-ru",{minimumFractionDigits:2}));return i.watch(()=>n.order,()=>{a(!1)}),i.onMounted(()=>{a()}),(c,d)=>{const u=z.NSpin;return s.value?(i.openBlock(),i.createElementBlock("div",DC,[i.createElementVNode("div",LC,[i.createVNode(u,{size:"small",class:"mb-2.5 align-middle"}),d[1]||(d[1]=i.createElementVNode("div",null,[i.createElementVNode("span",null,"Загрузка данных ...")],-1))])])):o.value.products.length===0?(i.openBlock(),i.createElementBlock("div",HC," --- Не удалось загрузить данные о заказе --- ")):(i.openBlock(),i.createElementBlock("div",WC,[i.createVNode(Dh,{products:o.value.products},null,8,["products"]),i.createElementVNode("div",jC,[d[2]||(d[2]=i.createTextVNode(" ИТОГО: ",-1)),i.createElementVNode("span",qC,i.toDisplayString(l.value)+" ₽",1)]),i.createVNode(Lh,{order:o.value,"onClick:clientName":d[0]||(d[0]=h=>r("click:client-name",o.value.client,h))},null,8,["order"])]))}}}),YC={},UC=i.defineComponent({...YC,__name:"order-actions",props:{orderContextButtonsConfig:{type:Function,default:void 0},onOrderContextSelect:{type:Function,default:void 0},order:{}},setup(t){const e=t,n=i.inject(or,"small"),r=i.computed(()=>M.isNil(e.orderContextButtonsConfig)?[]:M.isFunction(e.orderContextButtonsConfig)?e.orderContextButtonsConfig(e.order):e.orderContextButtonsConfig),s=o=>{var a;(a=e.onOrderContextSelect)==null||a.call(e,e.order,o)};return(o,a)=>{var u;const l=Ls,c=z.NButton,d=z.NDropdown;return((u=r.value)==null?void 0:u.length)>0?(i.openBlock(),i.createBlock(d,{key:0,options:r.value,size:i.unref(n),trigger:"click",onSelect:s},{default:i.withCtx(()=>[i.createVNode(c,{ghost:!0,size:i.unref(n),type:"primary"},{default:i.withCtx(()=>[i.createVNode(l)]),_:1},8,["size"])]),_:1},8,["options","size"])):i.createCommentVNode("",!0)}}}),KC={},GC=i.defineComponent({...KC,__name:"orders-list",props:{fields:{},showAttachedUserColumn:{type:Boolean,default:!1},orderContextButtonsConfig:{},onOrderContextSelect:{},orderUrl:{},tableMinWidth:{default:1/0},filters:{default:void 0},sort:{default:void 0},pagination:{default:void 0},useCellIndication:{type:Boolean,default:!1},enableSorting:{type:Boolean,default:!1},refreshInterval:{default:0}},emits:["click:client-name","dblclick:row","update:pagination","update:sort"],setup(t,{emit:e}){const n=t,r=e,s=()=>M.cloneDeep(n.sort??[{field:"id",direction:"desc"}]),o=i.ref(s()),a=i.ref([]),l=i.ref(!1),c=i.computed(()=>K.useReferencesStore().orderStatusReference),d=i.ref(700),u=T=>{var L,O;const $={onDblclick:()=>r("dblclick:row",T)};if(!n.useCellIndication)return $;const F=[];T.isOnOrder&&F.push("on-order"),T.isLargeOrder&&F.push("large-order"),T.isNotInStock&&F.push("not-in-stock");const I=(O=(L=c.value)==null?void 0:L.find(Z=>Z.id===(T.status??-1)))==null?void 0:O.slug;return I&&F.push("order-status",I),T.delivery.date&&Tn.isTomorrow(new Date(T.delivery.date))&&F.push("next-day-order"),F.length>0&&($.class=F.join(" ")),$},h=()=>{const T=[Ee.CreatedAt,Ee.Id,Ee.ClientInfo,Ee.ClientCity,Ee.DeliveryDate,Ee.PaymentType,Ee.SalesDirections,Ee.Status,...n.showAttachedUserColumn?[Ee.AttachedUser]:[],Ee.actions],$=n.fields.length>0?n.fields:T,F={title:"???",key:"undefined",render:()=>i.h("span",{},["--- unknown ---"])},I={type:"expand",expandable:M.constant(!0),renderExpand:O=>i.h(Hh,{order:O,class:"pl-10 pt-3 pb-10","onClick:client-name":()=>{r("click:client-name",O.client,null)}}),width:"30"};let L=[{title:"Дата заказа",key:Ee.CreatedAt,resizable:!0,width:100,render:O=>i.h(fs,{date:O.createdAt,isTimeSecondary:!0,isTimeOnSecondLine:!0,class:"text-base"})},{title:"№ заказа",key:Ee.Id,resizable:!0,width:75,className:"order-id",render:O=>i.h("a",{href:n.orderUrl.replace(":id",O.id.toString()),class:"text-base"},O.id)},{title:"Дата доставки / самовывоза",key:Ee.DeliveryDate,resizable:!0,width:100,className:"delivery-date",render:O=>i.h(fs,{date:O.delivery.date,isShowTime:!1,class:"text-base"})},{title:"Клиент",key:Ee.ClientInfo,resizable:!0,minWidth:320,render:O=>i.h(pr,{client:O.client,"onClick:client-name":()=>{r("click:client-name",O.client,null)}})},{title:"Тип доставки",key:Ee.DeliveryInfo,resizable:!0,minWidth:320,render:O=>i.h(Vs,{delivery:O.delivery})},{title:"Клиент",key:Ee.ClientInfoShort,resizable:!0,minWidth:320,render:O=>i.h(pr,{client:O.client,showCityAndRegion:!1,"onClick:client-name":()=>{r("click:client-name",O.client,null)}})},{title:"Город клиента",key:Ee.ClientCity,resizable:!0,minWidth:90,width:120,render:O=>{var Z;return i.h("span",{class:"text-base"},((Z=O.client)==null?void 0:Z.city.name)??"—")}},{title:"Статус",key:Ee.Status,resizable:!0,width:150,minWidth:115,className:"order-status",render:O=>{var Z,ne;return i.h("span",{class:"text-base"},[((ne=(Z=c.value)==null?void 0:Z.find(E=>E.id===(O.status??-1)))==null?void 0:ne.name)??""])}},{title:"Тип оплаты",key:Ee.PaymentType,resizable:!0,width:115,minWidth:95,render:O=>O.payment?i.h(va,{payment:O.payment}):i.h("span",{class:"text-base"},"—")},{title:"Напр. продаж",key:Ee.SalesDirections,resizable:!0,width:70,render:O=>{var Z;return i.h("span",{class:"text-base"},[((Z=O.salesDirection)==null?void 0:Z.name)??""])}},...n.showAttachedUserColumn?[{title:"Закреплено за",key:Ee.AttachedUser,resizable:!0,minWidth:120,render:O=>{var Z;return i.h("span",{class:"text-base"},[((Z=O==null?void 0:O.attachedUser)==null?void 0:Z.name)??""])}}]:[]];switch(n.orderContextButtonsConfig&&L.push({key:"actions",title:"",className:"align-top",width:50,render:O=>i.h(UC,{order:O,orderContextButtonsConfig:n.orderContextButtonsConfig,onOrderContextSelect:n.onOrderContextSelect})}),n.enableSorting&&(L=L.map(O=>[Ee.Id,Ee.CreatedAt,Ee.DeliveryDate].includes(O.key)?{...O,sorter:!0,sortOrder:!1,...O.width===void 0?{}:{width:O.width+16}}:O)),St.getDeviceTypeByResolution()){case Qe.phone:case Qe.tablet:return[I,{key:"order",title:"Заказ",resizable:!0,render:O=>i.h(Oh,{order:O,fields:$,orderUrl:n.orderUrl})}];case Qe.laptop:{const O=n.showAttachedUserColumn?$:$.filter(Z=>Z!==Ee.AttachedUser);return[I,...O.map(Z=>L.find(ne=>ne.key===Z)??F)]}default:return[F]}},f=i.ref(h()),g=i.ref(new K.DataTablePagination(n.pagination??{page:1,pageSize:10,itemCount:0,pageCount:1,pageSlot:5,pageSizes:[10,15,25],showSizePicker:!0})),m=i.computed(()=>({...g.value,prefix({itemCount:T}){return`Всего заказов: ${T}`}})),p=i.ref(null),y=i.ref(null),b=i.ref(null),_=()=>{b.value!==null&&(clearInterval(b.value),b.value=null)},B=()=>{_(),n.refreshInterval&&(b.value=setInterval(()=>{N()},n.refreshInterval))},k=()=>{var T,$;n.filters&&((T=y.value)==null||T.abort(),y.value=null,($=p.value)==null||$.abort(),p.value=new AbortController,l.value=!0,K.HttpRequester.getInstance(K.OrdersDataProvider).getOrders(n.filters,o.value,{page:g.value.page,pageSize:g.value.pageSize},p.value.signal).then(F=>{g.value.itemCount!==F.meta.total&&(g.value.itemCount=F.meta.total),g.value.page!==F.meta.currentPage&&(g.value.page=F.meta.currentPage),g.value.pageCount!==F.meta.lastPage&&(g.value.pageCount=F.meta.lastPage),g.value.pageSize!==F.meta.perPage&&(g.value.pageSize=F.meta.perPage),a.value=F.data,l.value=!1}).catch(F=>{if((F==null?void 0:F.name)!=="CanceledError")throw l.value=!1,F}))},N=()=>{var T;!n.filters||l.value||((T=y.value)==null||T.abort(),y.value=new AbortController,K.HttpRequester.getInstance(K.OrdersDataProvider).getOrders(n.filters,o.value,{page:g.value.page,pageSize:g.value.pageSize},y.value.signal).then($=>{a.value=a.value.map(F=>$.data.find(L=>L.id===F.id)??F),g.value.itemCount!==$.meta.total&&(g.value.itemCount=$.meta.total),g.value.pageCount!==$.meta.lastPage&&(g.value.pageCount=$.meta.lastPage)}).catch($=>{if(($==null?void 0:$.name)!=="CanceledError")throw $}))},R=T=>{g.value.page=T,k(),r("update:pagination",g.value)},w=T=>{g.value.pageSize=T,g.value.page=1,k(),r("update:pagination",g.value)},C=T=>{if(M.isNull(T))o.value=s();else{const[$]=o.value;$.field=T.columnKey.toString(),$.direction=T.order==="ascend"?"asc":"desc",o.value=[$]}f.value.forEach($=>{if(Object.hasOwn($,"sortOrder")){const F=$;F.sortOrder=F.key===(T==null?void 0:T.columnKey)&&(T!=null&&T.sorter)&&T.order!==!1?T.order:!1}}),k(),r("update:sort",o.value)},x=()=>{f.value=h(),d.value=window.innerHeight};return i.watch(()=>n.filters,()=>{g.value.page=1,k(),B()}),i.watch(()=>n.sort,()=>{o.value=s(),g.value.page=1,k(),B()}),i.onMounted(()=>{x(),window.addEventListener("resize",x),i.nextTick(()=>{k(),B()})}),i.onUnmounted(()=>{var T,$;window.removeEventListener("resize",x),(T=p.value)==null||T.abort(),($=y.value)==null||$.abort(),_()}),(T,$)=>{const F=z.NDataTable;return i.openBlock(),i.createBlock(F,{columns:f.value,data:a.value,"row-key":I=>I.id,"row-props":u,"scroll-x":t.tableMinWidth,pagination:m.value,loading:l.value,remote:!0,bordered:!1,"bottom-bordered":!1,"sticky-expanded-rows":!0,"max-height":d.value*(i.unref(K.useBaseConfigStateStore)().config.tableDefaultHeightCoefficient??.6),"pagination-behavior-on-filter":"first","onUpdate:page":R,"onUpdate:pageSize":w,"onUpdate:sorter":C},null,8,["columns","data","row-key","scroll-x","pagination","loading","max-height"])}}}),ZC=Wn(GC,[["__scopeId","data-v-aee16951"]]),QC=["href"],JC={class:"text-sc-dark-grey"},e2={},t2=i.defineComponent({...e2,__name:"short-text-order-info",props:{order:{},orderLink:{}},emits:["click:order-id"],setup(t,{emit:e}){const n=t,r=e,s=i.computed(()=>Tn.format(n.order.createdAt,K.useBaseConfigStateStore().config.dateFormats.uiDateWithTime)),o=a=>{M.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,QC),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",JC,"автор: "+i.toDisplayString(t.order.creator.name)+" ["+i.toDisplayString(t.order.creator.type)+"]",1)],64))}}),n2={class:"sc-page flex flex-col bg-inherit"},i2={class:"my-2 flex flex-row items-end"},r2={class:"sc-title grow"},s2={key:0,class:"sc-title-buttons flex-1 grow-0"},o2={class:"flex flex-col justify-end gap-1 sm:mt-0 sm:flex-row"},a2={key:0,class:"sc-title-extra mt-2 sm:mt-4"},l2={},Wh=i.defineComponent({...l2,__name:"page",props:{title:{},stickyHeader:{type:Boolean},stickyTopOffset:{}},setup(t){return(e,n)=>{const r=z.NH1;return i.openBlock(),i.createElementBlock("div",n2,[i.createElementVNode("div",{class:i.normalizeClass(t.stickyHeader?"sticky z-10 bg-inherit":void 0),style:i.normalizeStyle(t.stickyHeader?{top:`${t.stickyTopOffset??0}px`}:void 0)},[i.createElementVNode("div",i2,[i.createElementVNode("div",r2,[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",s2,[i.createElementVNode("div",o2,[i.renderSlot(e.$slots,"title-buttons")])])):i.createCommentVNode("",!0)]),e.$slots["title-extra"]?(i.openBlock(),i.createElementBlock("div",a2,[i.renderSlot(e.$slots,"title-extra")])):i.createCommentVNode("",!0),i.renderSlot(e.$slots,"sticky-extra")],6),i.renderSlot(e.$slots,"default")])}}}),c2={class:"overflow-hidden transition-all duration-300"},d2={class:"text-lg font-medium leading-none"},u2={},jh=i.defineComponent({...u2,__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(St.getDeviceTypeByResolution()){case Qe.phone:return window.innerWidth*.8;case Qe.tablet:return window.innerWidth*.5;default:return window.innerWidth*.33}},l=()=>{o.value?M.isUndefined(n.drawerWidth)?s.value=a():s.value=M.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 u=z.NDrawerContent,h=z.NDrawer;return i.openBlock(),i.createElementBlock(i.Fragment,null,[i.createElementVNode("div",c2,[i.createElementVNode("div",{style:i.normalizeStyle(`margin-left: ${s.value}px;`),class:"w-full"},[i.renderSlot(c.$slots,"default")],4)]),i.createVNode(h,{show:o.value,"onUpdate:show":d[0]||(d[0]=f=>o.value=f),resizable:!0,width:s.value,placement:"left"},{default:i.withCtx(()=>[i.createVNode(u,{closable:""},{header:i.withCtx(()=>[i.renderSlot(c.$slots,"drawer-header",{},()=>[i.createElementVNode("div",d2,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)}}}),h2={ref:"panel-component-ref",class:"sc-page-panel flex flex-row gap-2.5 bg-inherit sm:gap-8"},f2={key:0},m2={class:"sc-page-preview-panel grow"},g2={key:1,class:"sc-page-preview-panel-extra flex-none"},p2={},y2=i.defineComponent({...p2,__name:"page-with-sliding-panel",props:{title:{},isShowPanelButtonVisible:{type:Boolean,default:!0},showPanelButtonText:{default:""},panelTitle:{default:""},stickyHeader:{type:Boolean,default:!1},stickyTopOffset:{default:0}},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,u;window.scrollTo({top:(((u=(d=o.value)==null?void 0:d.getBoundingClientRect())==null?void 0:u.top)??0)+window.pageYOffset+l,behavior:"smooth"})})},showPanel:r,closePanel:s}),(l,c)=>{const d=z.NButton;return i.openBlock(),i.createBlock(Wh,{title:t.title,"sticky-header":t.stickyHeader,"sticky-top-offset":t.stickyTopOffset},i.createSlots({default:i.withCtx(()=>[i.createVNode(jh,{"show-drawer":n.value,"onUpdate:showDrawer":c[1]||(c[1]=u=>n.value=u),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,l.$slots["preview-panel"]||l.$slots["preview-panel-extra"]||t.isShowPanelButtonVisible?{name:"sticky-extra",fn:i.withCtx(()=>[i.createElementVNode("div",h2,[t.isShowPanelButtonVisible?(i.openBlock(),i.createElementBlock("div",f2,[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]=u=>n.value=!0)},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(t.showPanelButtonText),1)]),_:1})])])):i.createCommentVNode("",!0),i.createElementVNode("div",m2,[i.renderSlot(l.$slots,"preview-panel")]),l.$slots["preview-panel-extra"]?(i.openBlock(),i.createElementBlock("div",g2,[i.renderSlot(l.$slots,"preview-panel-extra")])):i.createCommentVNode("",!0)],512)]),key:"3"}:void 0]),1032,["title","sticky-header","sticky-top-offset"])}}}),b2={},_2=i.defineComponent({...b2,__name:"curator-select",props:{value:{default:null},clearable:{type:Boolean,default:!1},consistentMenuWidth:{type:Boolean},wrapContent:{type:Boolean},managerReferenceList:{default:()=>[]},showEmptyValue:{type:Boolean,default:!1}},emits:["update:value"],setup(t,{expose:e,emit:n}){const r=t,s=n,o=i.computed(()=>M.isArray(r.value)),a=i.computed(()=>{var m;return M.isArray(r.value)?r.value.map(p=>p.id):((m=r.value)==null?void 0:m.id)??null}),l=i.computed(()=>{const m=new K.Curator({id:-1,name:"",contacts:{},curatedDirection:new K.CuratedDirection({id:-1,name:"",guid:""}),guid:""}),p=r.showEmptyValue?[m]:[];return r.managerReferenceList.filter(y=>{var b;return(((b=y==null?void 0:y.curatedDirections)==null?void 0:b.length)??0)>0}).forEach(y=>{((y==null?void 0:y.curatedDirections)??[]).forEach(b=>{p.push(new K.Curator({id:y.id,guid:y.guid,name:y.name,photo:y.photo,contacts:y.contacts??{},curatedDirection:b}))})}),p}),c=i.computed(()=>Vt.convertReferencesToSelectOptionsList(l.value,!0,{key:"item.curatedDirection.id",label:"item.curatedDirection.name"},!1,m=>{const p=M.some(o.value?r.value:[r.value],["id",m.id])?` (${m.curatedDirection.name}) `:"";return m.curatedDirection.isNewRec()?m.name:`${m.name}${p}`})),d=i.computed(()=>c.value.map(m=>({...m,class:r.wrapContent?`${m.class} consistent-menu-width`:m.class}))),u=i.useTemplateRef("select-component"),h=m=>{if(M.isArray(m)){const p=m.length>0?m.map(y=>l.value.find(b=>b.id===y)).filter(y=>!M.isNil(y)):[];s("update:value",p)}else{const p=m>0?l.value.find(y=>y.id===m):null;s("update:value",p??null)}};return i.watch(()=>r.value,()=>{var m,p;(p=(m=u.value)==null?void 0:m.$forceUpdate)==null||p.call(m)},{deep:!0}),e({focus:()=>{var m;return(m=u.value)==null?void 0:m.focusInput()},blur:()=>{var m;return(m=u.value)==null?void 0:m.blurInput()}}),(m,p)=>(i.openBlock(),i.createBlock(i.unref(z.NSelect),{ref:"select-component",value:a.value,clearable:t.clearable,disabled:c.value.length===0,"consistent-menu-width":t.consistentMenuWidth,multiple:o.value,options:d.value,placeholder:"","onUpdate:value":h},null,8,["value","clearable","disabled","consistent-menu-width","multiple","options"]))}}),w2={},x2=i.defineComponent({...w2,__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(()=>M.isArray(r.value)),a=i.computed(()=>{var m;return M.isArray(r.value)?r.value.map(p=>p.id):((m=r.value)==null?void 0:m.id)??null}),l=i.computed(()=>r.showEmptyValue?[K.ManagerDataFactory.generateUndefinedManagerInstance(),...r.managerReferenceList]:r.managerReferenceList),c=i.computed(()=>{var y;let m=l.value,p=r.disabledManagerReferenceList.map(b=>b.id);if(r.showActualOnly){const b=M.isArray(r.value)?r.value.map(_=>_.id):[(y=r.value)==null?void 0:y.id];p=M.union(p,l.value.filter(_=>!_.isActive).map(_=>_.id)),m=m.filter(_=>(r.showEmptyValue?K.ManagerDataFactory.isUndefinedManagerInstance(_):!1)||_.isActive||b.includes(_.id))}return Vt.convertReferencesToSelectOptionsList(m,!0,r.groupBySalesDirection?{key:"item.salesDirection.id",label:"item.salesDirection.name"}:!1,!1,b=>{const _=!r.groupBySalesDirection||r.groupBySalesDirection&&M.some(o.value?r.value:[r.value],["id",b.id])?` (${b.salesDirection.name}) `:"";return b.salesDirection.isNewRec()?b.name:`${b.name}${_}${b.isActive?"":" [Не активен]"}`},b=>p.includes(b.id)&&b.isActive)}),d=i.computed(()=>c.value.map(m=>({...m,class:r.wrapContent?`${m.class} consistent-menu-width`:m.class}))),u=i.useTemplateRef("select-component"),h=m=>{if(M.isArray(m)){const p=m.length>0?m.filter(y=>!M.some(r.disabledManagerReferenceList,["id",y])).map(y=>l.value.find(b=>b.id===y)).filter(y=>!M.isNil(y)):[];s("update:value",p)}else{const p=m>0&&!M.some(r.disabledManagerReferenceList,["id",m])?l.value.find(y=>y.id===m):new K.Manager;s("update:value",p??new K.Manager)}};return i.watch(()=>r.value,()=>{var m,p;(p=(m=u.value)==null?void 0:m.$forceUpdate)==null||p.call(m)},{deep:!0}),i.watch(()=>r.disabledManagerReferenceList,m=>{if(m.length>0&&r.value)if(o.value){const p=r.value;M.some(p,y=>M.some(m,["id",y.id]))&&s("update:value",p.filter(y=>!M.some(m,["id",y.id])))}else{const p=r.value;M.some(m,["id",p.id])&&s("update:value",new K.Manager)}}),e({focus:()=>{var m;return(m=u.value)==null?void 0:m.focusInput()},blur:()=>{var m;return(m=u.value)==null?void 0:m.blurInput()}}),(m,p)=>(i.openBlock(),i.createBlock(i.unref(z.NSelect),{ref:"select-component",value:a.value,clearable:t.clearable,disabled:c.value.length===0,"consistent-menu-width":t.consistentMenuWidth,multiple:o.value,options:d.value,placeholder:"","onUpdate:value":h},null,8,["value","clearable","disabled","consistent-menu-width","multiple","options"]))}}),k2={class:"m-0.5 flex flex-col p-0.5"},v2={class:"flex flex-row gap-1"},C2={key:0},S2={key:1},B2={key:2},T2={key:3},$2={class:"flex flex-row gap-1"},N2={key:0},R2={key:1},P2={key:2},E2={key:3},F2={},qh=i.defineComponent({...F2,__name:"address-suggestion-label",props:{addr:{},selected:{type:Boolean}},setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock("div",k2,[i.createElementVNode("span",v2,[t.addr.postIndex?(i.openBlock(),i.createElementBlock("span",C2,i.toDisplayString(t.addr.postIndex)+", ",1)):i.createCommentVNode("",!0),t.addr.city?(i.openBlock(),i.createElementBlock("span",S2,i.toDisplayString(t.addr.city)+", ",1)):i.createCommentVNode("",!0),t.addr.locality?(i.openBlock(),i.createElementBlock("span",B2,i.toDisplayString(t.addr.locality)+", ",1)):i.createCommentVNode("",!0),t.addr.region?(i.openBlock(),i.createElementBlock("span",T2,i.toDisplayString(t.addr.region)+", ",1)):i.createCommentVNode("",!0)]),i.createElementVNode("span",$2,[t.addr.street?(i.openBlock(),i.createElementBlock("span",N2,i.toDisplayString(t.addr.street)+", ",1)):i.createCommentVNode("",!0),t.addr.building?(i.openBlock(),i.createElementBlock("span",R2,i.toDisplayString(t.addr.building)+", ",1)):i.createCommentVNode("",!0),t.addr.buildingPart?(i.openBlock(),i.createElementBlock("span",P2,i.toDisplayString(t.addr.buildingPart)+", ",1)):i.createCommentVNode("",!0),t.addr.apartments?(i.openBlock(),i.createElementBlock("span",E2,i.toDisplayString(t.addr.apartments)+", ",1)):i.createCommentVNode("",!0)])]))}}),Ba={clearable:!1,value:"",field:void 0,disabled:!1},V2={},I2=i.defineComponent({...V2,__name:"address-suggestion",props:i.mergeDefaults({disabled:{type:Boolean},value:{},clearable:{type:Boolean},field:{},minTermLength:{},searchDataHandler:{type:Function}},{...Ba,minTermLength:()=>{var t,e;return((e=(t=K.useBaseConfigStateStore().getConfig())==null?void 0:t.minLength)==null?void 0:e.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=M.debounce(()=>u(),800),u=async()=>{!o.value||o.value.length<r.minTermLength||(a.value=!0,l.value=await(r.searchDataHandler?r.searchDataHandler(o.value,a):K.HttpRequester.getInstance(K.DataSuggestionProvider).searchAddresses(o.value)).finally(()=>{a.value=!1}))},h=(p,y)=>{const b=l.value.find(_=>_.id===p.value)||{};return i.h(qh,{addr:b,selected:y},{default:M.constant("-")})},f=p=>{d.cancel();const y=l.value.find(b=>b.id===p)||{};s("select",y)},g=i.ref(null);function m(){g.value.focus()}return e({focus:m}),(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":h,placeholder:"",onSelect:f},null,8,["value","clearable","disabled","loading","options","onUpdate:value"])}}}),A2={class:"m-0.5 flex flex-col p-0.5"},M2={class:"font-medium"},O2={class:"flex flex-row gap-1 text-xs font-light text-blue-800"},z2={key:0},D2={key:1},L2={},Xh=i.defineComponent({...L2,__name:"bank-suggestion-label",props:{bank:{},selected:{type:Boolean}},setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock("div",A2,[i.createElementVNode("span",M2,i.toDisplayString(t.bank.name),1),i.createElementVNode("span",O2,[t.bank.bic?(i.openBlock(),i.createElementBlock("span",z2," БИК: "+i.toDisplayString(t.bank.bic),1)):i.createCommentVNode("",!0),t.bank.inn?(i.openBlock(),i.createElementBlock("span",D2," ИНН: "+i.toDisplayString(t.bank.inn),1)):i.createCommentVNode("",!0)])]))}}),H2={},W2=i.defineComponent({...H2,__name:"bank-suggestion",props:i.mergeDefaults({disabled:{type:Boolean},value:{},clearable:{type:Boolean},field:{},minTermLength:{}},{...Ba,minTermLength:()=>{var t,e;return((e=(t=K.useBaseConfigStateStore().getConfig())==null?void 0:t.minLength)==null?void 0:e.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=M.debounce(()=>u(),800),u=async()=>{if(!(!o.value||o.value.length<r.minTermLength)){a.value=!0;try{l.value=await K.HttpRequester.getInstance(K.DataSuggestionProvider).searchBank(o.value)}finally{a.value=!1}}},h=(p,y)=>{const b=l.value.find(_=>_.id===p.value)||{};return i.h(Xh,{bank:b,selected:y},{default:M.constant("-")})},f=p=>{d.cancel();const y=l.value.find(b=>b.id===p)||{};s("select",y)},g=i.ref(null);function m(){g.value.focus()}return e({focus:m}),(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":h,placeholder:"",onSelect:f},null,8,["value","clearable","disabled","loading","options","onUpdate:value"])}}}),j2={class:"font-medium"},q2={key:0,class:"flex flex-row gap-2"},X2={key:0,class:"text-xs font-light text-blue-800"},Y2={key:1,class:"text-sc-dark-grey text-xs font-light"},U2={},Yh=i.defineComponent({...U2,__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",j2,i.toDisplayString(t.org.name),1),t.org.inn||r.value?(i.openBlock(),i.createElementBlock("div",q2,[t.org.inn?(i.openBlock(),i.createElementBlock("span",X2,i.toDisplayString(t.org.inn),1)):i.createCommentVNode("",!0),r.value?(i.openBlock(),i.createElementBlock("span",Y2,i.toDisplayString(r.value),1)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)],2))}}),K2={},G2=i.defineComponent({...K2,__name:"org-suggestion",props:i.mergeDefaults({disabled:{type:Boolean},value:{},clearable:{type:Boolean},field:{},minTermLength:{},allowSelectTerminated:{type:Boolean}},{...Ba,minTermLength:()=>{var t,e;return((e=(t=K.useBaseConfigStateStore().getConfig())==null?void 0:t.minLength)==null?void 0:e.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(()=>Vt.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 u=M.debounce(()=>h(),800),h=async()=>{if(!(!o.value||o.value.length<r.minTermLength)){a.value=!0;try{l.value=await K.HttpRequester.getInstance(K.DataSuggestionProvider).searchOrganization(o.value)}finally{a.value=!1}}},f=(y,b)=>{const _=l.value.find(B=>B.id===y.value)||{};return i.h(Yh,{org:_,selected:b},{default:M.constant("-")})},g=y=>{u.cancel();const b=l.value.find(_=>_.id===y)||{};(r.allowSelectTerminated||!c(b))&&s("select",b)},m=i.ref(null);function p(){m.value.focus()}return e({focus:p}),(y,b)=>{const _=z.NAutoComplete;return i.openBlock(),i.createBlock(_,{ref_key:"autoCompleteElement",ref:m,value:o.value,"onUpdate:value":[b[0]||(b[0]=B=>o.value=B),i.unref(u)],clearable:t.clearable,disabled:t.disabled,loading:a.value,options:d.value,"render-label":f,placeholder:"",onSelect:g},null,8,["value","clearable","disabled","loading","options","onUpdate:value"])}}}),Z2={},Q2=i.defineComponent({...Z2,__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,u=z.NPopover,h=z.NModal;return i.openBlock(),i.createElementBlock("div",null,[i.createVNode(u,{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(h,{show:s.value,"onUpdate:show":c[1]||(c[1]=f=>s.value=f),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]=f=>s.value=!1)},{default:i.withCtx(()=>[...c[3]||(c[3]=[i.createTextVNode(" Отмена ",-1)])]),_:1})]),_:1},8,["show","content","title"])])}}}),J2={key:0,class:"whitespace-pre-line"},eS={key:1,class:"text-sc-dark-grey"},tS={},nS=i.defineComponent({...tS,__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(Ud,{disabled:t.disabled,"onEditor:apply":o,"onEditor:cancel":a},{viewer:i.withCtx(()=>[i.createElementVNode("div",null,[t.comment?(i.openBlock(),i.createElementBlock("span",J2,i.toDisplayString(t.comment),1)):(i.openBlock(),i.createElementBlock("span",eS," - Комментарий отсутствует - "))])]),editor:i.withCtx(()=>[i.createVNode(d,{value:s.value,"onUpdate:value":c[0]||(c[0]=u=>s.value=u),clearable:!0,type:"textarea"},null,8,["value"])]),_:1},8,["disabled"])}}}),iS={},rS=i.defineComponent({...iS,__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)=>t.debt!==0?(i.openBlock(),i.createElementBlock("span",{key:0,class:i.normalizeClass({"text-sm":t.wrapAsSmall})},[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)],2)):i.createCommentVNode("",!0)}}),sS={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function oS(t,e){return i.openBlock(),i.createElementBlock("svg",sS,[...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 aS=i.markRaw({name:"ion-warning",render:oS}),lS={},cS=i.defineComponent({...lS,__name:"warning-icon",props:{popoverText:{default:""},iconClass:{default:"text-sc-warning"}},setup(t){return(e,n)=>{const r=aS,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"])}}}),vt=class vt{static init(e,n){vt.messagesService&&vt.notificationsService||(vt.messagesService=e,vt.notificationsService=n)}static getMessagesService(){if(!vt.messagesService)throw new Error("UI provider is not initialized.");return vt.messagesService}static getNotificationsService(){if(!vt.notificationsService)throw new Error("UI provider is not initialized.");return vt.notificationsService}static showNotificationsForErrorResponseData(e,n={}){var r,s;if(M.isEmpty(e.errors)){const o=(s=(r=e.rawError)==null?void 0:r.config)==null?void 0:s.url,a=o?` [ ${o} ]`:"";vt.notificationsService?vt.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 K.FieldValidationResultData(e.errors[o].toString(),"error"):vt.messagesService?vt.messagesService.error(e.errors[o].toString()):console.log("Show notification error response data: UI provider is not initialized.",e.errors[o])}};S(vt,"messagesService"),S(vt,"notificationsService");let Ta=vt;const dS=i.computed(()=>K.useReferencesStore().deliveryTypeReference??[]),uS=i.computed(()=>K.useReferencesStore().managersList??[]),hS=i.computed(()=>K.useReferencesStore().opfReference??[]),fS=i.computed(()=>K.useReferencesStore().partnerGroupsReference??[]),mS=i.computed(()=>K.useReferencesStore().priceCoefficientsReference??[]),gS=i.computed(()=>K.useReferencesStore().productFilesTypesReference??[]),pS=i.computed(()=>K.useReferencesStore().resourceTypesReference),yS=i.computed(()=>K.useReferencesStore().salesDirectionsReference??[]),bS=i.computed(()=>K.useReferencesStore().warehousesReference??[]),_S=i.computed(()=>K.useReferencesStore().paymentTypeReference??[]),wS=i.computed(()=>K.useReferencesStore().orderStatusReference??[]),xS=i.computed(()=>K.useReferencesStore().operatorReference??[]),kS=i.computed(()=>Vt.convertReferencesToSelectOptionsList(K.useReferencesStore().channelPrimaryInterestsReference??[],!0,!1,!0)),vS=i.computed(()=>Vt.convertReferencesToSelectOptionsList(K.useReferencesStore().sourcePrimaryInterestsReference??[],!0,!1,!0)),CS=t=>K.HttpRequester.getInstance(K.ReferenceDataProvider).searchCity(t),SS=t=>Vt.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()),BS=t=>K.HttpRequester.getInstance(K.ClientDataProvider).searchClient(t),TS=t=>Vt.convertReferencesToSelectOptionsList(t,!0,!1,!1,e=>e.isNewRec()?"-":[e.name,e.salesDirection.name?`(${e.salesDirection.name})`:void 0,e.city.name?`г. ${e.city.name}${e.city.region.name?`, ${e.city.region.name}`:""}`:void 0,e.isActive?void 0:"[ Деактивирован ]"].filter(Boolean).join(" "),e=>e==null?void 0:e.isNewRec());q.AddProductToCartDialog=Tb,q.ConfiguratorSettingsKozyrek=wd,q.ConfiguratorSettingsMosquito=V_,q.ContentHelper=ai,q.KozyrekLine=bn,q.KozyrekTailTemplate=zo,q.KozyrekTemplate=Ui,q.OrdersTableFields=Ee,q.Point=Oo,q.ScAddressSuggestion=I2,q.ScAddressSuggestionLabel=qh,q.ScBankSuggestion=W2,q.ScBankSuggestionLabel=Xh,q.ScBaseDialog=Hd,q.ScButtonWithConfirmAction=Q2,q.ScCategoryCollapse=Dd,q.ScClientNameWithShortInfo=pr,q.ScCollapse=zd,q.ScCollapseItem=Qa,q.ScCommentEditor=nS,q.ScConfiguratorsProductInfo=cr,q.ScContragentWithShortInfo=Wd,q.ScCreatorUserTypeTag=Ca,q.ScCuratorSelect=_2,q.ScDateRange=D_,q.ScDateTimeLabel=fs,q.ScDebouncedInput=f1,q.ScDebouncedInputNumber=g1,q.ScDebt=rS,q.ScDialogHeader=U_,q.ScDynamicConfigurator=Ad,q.ScEmail=Wb,q.ScExternalLink=S1,q.ScImageGallery=il,q.ScInlineEditableItem=Ud,q.ScInlineView=Lo,q.ScKozyrekConfigurator=xd,q.ScKozyrekConfiguratorParamsForm=sl,q.ScKozyrekConfiguratorPreview=_d,q.ScKozyrekConfiguratorTemplates=bd,q.ScLightGallery=nl,q.ScManagerSelect=x2,q.ScMetalForDoorsConfigurator=Rd,q.ScMetalForDoorsConfiguratorForm=Nd,q.ScMosquitoConfigurator=Cd,q.ScMosquitoConfiguratorForm=kd,q.ScMosquitoConfiguratorMeasurementInstructions=vd,q.ScMosquitoConfiguratorPreview=Do,q.ScOrderCommonInfo=Oh,q.ScOrderDeliveryLabel=Vs,q.ScOrderDetails=Lh,q.ScOrderInfo=Hh,q.ScOrderItemsList=Dh,q.ScOrderPayment=va,q.ScOrderProductInfo=zh,q.ScOrdersList=ZC,q.ScOrgSuggestion=G2,q.ScOrgSuggestionLabel=Yh,q.ScPage=Wh,q.ScPageWithSlidingPanel=y2,q.ScPersonContactsBlock=F_,q.ScPhone=f_,q.ScPhoneInput=b1,q.ScProductName=lr,q.ScProductsList=Jv,q.ScReferenceSelect=Ld,q.ScSandwichConfigurator=Fd,q.ScSandwichConfiguratorForm=Ed,q.ScSandwichM2Configurator=Id,q.ScSandwichM2ConfiguratorForm=Vd,q.ScSearchableProductSelect=Mh,q.ScSearchableReferenceSelect=Ah,q.ScSetClientPriceFormItem=xb,q.ScShortTextOrderInfo=t2,q.ScSingleFileUploadSelector=J_,q.ScSlidingContentWithDrawer=jh,q.ScStripConfigurator=$d,q.ScStripConfiguratorForm=Bd,q.ScStripConfiguratorLineItem=Sd,q.ScStripConfiguratorPreview=Td,q.ScUserShortInfo=Sa,q.ScWarningIcon=cS,q.SelectOptionHelper=Vt,q.UiNotificationProvider=Ta,q.WindowResolutionEnum=Qe,q.WindowResolutionProvider=St,q.channelPrimaryInterestOptionsList=kS,q.componentSizeInjectionKey=or,q.deliveryTypeReferenceList=dS,q.handleFloatInput=Ds,q.handleIntegerInput=tt,q.isCanSandwichM2Show=I_,q.isCanSandwichShow=Od,q.isConfiguratorType=Md,q.managersReferenceList=uS,q.naiveUiTheme=zf,q.operatorReferenceList=xS,q.opfReferenceList=hS,q.orderStatusReferenceList=wS,q.parse=lt,q.partnerGroupReferenceList=fS,q.paymentTypeReferenceList=_S,q.priceCoefficientsReferenceList=mS,q.productFilesTypesReferenceList=gS,q.renderConfig=je,q.resetInputValidation=et,q.resourceReferencesList=pS,q.salesDirectionsReferenceList=yS,q.searchCityReferenceDataHandler=CS,q.searchCityReferenceLabelRenderer=SS,q.searchClientReferenceDataHandler=BS,q.searchClientReferenceLabelRenderer=TS,q.selectAllTextOnFocus=Le,q.sourcePrimaryInterestOptionsList=vS,q.vFocusNext=Ua,q.warehousesReferenceList=bS,Object.defineProperty(q,Symbol.toStringTag,{value:"Module"})}));
|
|
822
|
+
`,[Ph({originalTransition:"background-color .3s var(--n-bezier), box-shadow .3s var(--n-bezier)"})])]);function Fs(t){return t.type==="group"}function Ih(t){return t.type==="ignored"}function ka(t,e){try{return!!(1+e.toString().toLowerCase().indexOf(t.trim().toLowerCase()))}catch{return!1}}function zv(t,e){return{getIsGroup:Fs,getIgnored:Ih,getKey(r){return Fs(r)?r.name||r.key||"key-required":r[t]},getChildren(r){return r[e]}}}function Dv(t,e,n,r){if(!e)return t;function s(o){if(!Array.isArray(o))return[];const a=[];for(const l of o)if(Fs(l)){const c=s(l[r]);c.length&&a.push(Object.assign({},l,{[r]:c}))}else{if(Ih(l))continue;e(n,l)&&a.push(l)}return a}return s(t)}function Lv(t,e,n){const r=new Map;return t.forEach(s=>{Fs(s)?s[n].forEach(o=>{r.set(o[e],o)}):r.set(s[e],s)}),r}var Hv={};const Wv=Object.assign(Object.assign({},wt.props),{to:En.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}),jv=i.defineComponent({name:"Select",props:Wv,slots:Object,setup(t){Hv.NODE_ENV!=="production"&&i.watchEffect(()=>{t.items!==void 0&&ei("select","`items` is deprecated, please use `options` instead."),t.onChange!==void 0&&ei("select","`on-change` is deprecated, please use `on-update:value` instead.")});const{mergedClsPrefixRef:e,mergedBorderedRef:n,namespaceRef:r,inlineThemeDisabled:s}=vi(t),o=wt("Select","-select",Ov,Mv,t,e),a=i.ref(t.defaultValue),l=i.toRef(t,"value"),c=Go(l,a),d=i.ref(!1),u=i.ref(""),h=lu(t,["items","options"]),f=i.ref([]),g=i.ref([]),m=i.computed(()=>g.value.concat(f.value).concat(h.value)),p=i.computed(()=>{const{filter:F}=t;if(F)return F;const{labelField:G,valueField:oe}=t;return(fe,me)=>{if(!me)return!1;const _e=me[G];if(typeof _e=="string")return ka(fe,_e);const ke=me[oe];return typeof ke=="string"?ka(fe,ke):typeof ke=="number"?ka(fe,String(ke)):!1}}),y=i.computed(()=>{if(t.remote)return h.value;{const{value:F}=m,{value:G}=u;return!G.length||!t.filterable?F:Dv(F,p.value,G,t.childrenField)}}),b=i.computed(()=>{const{valueField:F,childrenField:G}=t,oe=zv(F,G);return pw(y.value,oe)}),_=i.computed(()=>Lv(m.value,t.valueField,t.childrenField)),B=i.ref(!1),x=Go(i.toRef(t,"show"),B),N=i.ref(null),R=i.ref(null),w=i.ref(null),{localeRef:C}=ph("Select"),k=i.computed(()=>{var F;return(F=t.placeholder)!==null&&F!==void 0?F:C.value.placeholder}),T=[],$=i.ref(new Map),P=i.computed(()=>{const{fallbackOption:F}=t;if(F===void 0){const{labelField:G,valueField:oe}=t;return fe=>({[G]:String(fe),[oe]:fe})}return F===!1?!1:G=>Object.assign(F(G),{value:G})});function E(F){const G=t.remote,{value:oe}=$,{value:fe}=_,{value:me}=P,_e=[];return F.forEach(ke=>{if(fe.has(ke))_e.push(fe.get(ke));else if(G&&oe.has(ke))_e.push(oe.get(ke));else if(me){const Se=me(ke);Se&&_e.push(Se)}}),_e}const W=i.computed(()=>{if(t.multiple){const{value:F}=c;return Array.isArray(F)?E(F):[]}return null}),A=i.computed(()=>{const{value:F}=c;return!t.multiple&&!Array.isArray(F)?F===null?null:E([F])[0]||null:null}),Z=Kx(t),{mergedSizeRef:te,mergedDisabledRef:D,mergedStatusRef:H}=Z;function L(F,G){const{onChange:oe,"onUpdate:value":fe,onUpdateValue:me}=t,{nTriggerFormChange:_e,nTriggerFormInput:ke}=Z;oe&&_t(oe,F,G),me&&_t(me,F,G),fe&&_t(fe,F,G),a.value=F,_e(),ke()}function M(F){const{onBlur:G}=t,{nTriggerFormBlur:oe}=Z;G&&_t(G,F),oe()}function O(){const{onClear:F}=t;F&&_t(F)}function Y(F){const{onFocus:G,showOnFocus:oe}=t,{nTriggerFormFocus:fe}=Z;G&&_t(G,F),fe(),oe&&ee()}function U(F){const{onSearch:G}=t;G&&_t(G,F)}function V(F){const{onScroll:G}=t;G&&_t(G,F)}function j(){var F;const{remote:G,multiple:oe}=t;if(G){const{value:fe}=$;if(oe){const{valueField:me}=t;(F=W.value)===null||F===void 0||F.forEach(_e=>{fe.set(_e[me],_e)})}else{const me=A.value;me&&fe.set(me[t.valueField],me)}}}function q(F){const{onUpdateShow:G,"onUpdate:show":oe}=t;G&&_t(G,F),oe&&_t(oe,F),B.value=F}function ee(){D.value||(q(!0),B.value=!0,t.filterable&&ii())}function ue(){q(!1)}function ve(){u.value="",g.value=T}const Te=i.ref(!1);function He(){t.filterable&&(Te.value=!0)}function ce(){t.filterable&&(Te.value=!1,x.value||ve())}function mt(){D.value||(x.value?t.filterable?ii():ue():ee())}function $e(F){var G,oe;!((oe=(G=w.value)===null||G===void 0?void 0:G.selfRef)===null||oe===void 0)&&oe.contains(F.relatedTarget)||(d.value=!1,M(F),ue())}function Et(F){Y(F),d.value=!0}function Wt(){d.value=!0}function an(F){var G;!((G=N.value)===null||G===void 0)&&G.$el.contains(F.relatedTarget)||(d.value=!1,M(F),ue())}function Ct(){var F;(F=N.value)===null||F===void 0||F.focus(),ue()}function Ln(F){var G;x.value&&(!((G=N.value)===null||G===void 0)&&G.$el.contains(br(F))||ue())}function ln(F){if(!Array.isArray(F))return[];if(P.value)return Array.from(F);{const{remote:G}=t,{value:oe}=_;if(G){const{value:fe}=$;return F.filter(me=>oe.has(me)||fe.has(me))}else return F.filter(fe=>oe.has(fe))}}function Jt(F){Ve(F.rawNode)}function Ve(F){if(D.value)return;const{tag:G,remote:oe,clearFilterAfterSelect:fe,valueField:me}=t;if(G&&!oe){const{value:_e}=g,ke=_e[0]||null;if(ke){const Se=f.value;Se.length?Se.push(ke):f.value=[ke],g.value=T}}if(oe&&$.value.set(F[me],F),t.multiple){const _e=ln(c.value),ke=_e.findIndex(Se=>Se===F[me]);if(~ke){if(_e.splice(ke,1),G&&!oe){const Se=J(F[me]);~Se&&(f.value.splice(Se,1),fe&&(u.value=""))}}else _e.push(F[me]),fe&&(u.value="");L(_e,E(_e))}else{if(G&&!oe){const _e=J(F[me]);~_e?f.value=[f.value[_e]]:f.value=T}tr(),ue(),L(F[me],F)}}function J(F){return f.value.findIndex(oe=>oe[t.valueField]===F)}function le(F){x.value||ee();const{value:G}=F.target;u.value=G;const{tag:oe,remote:fe}=t;if(U(G),oe&&!fe){if(!G){g.value=T;return}const{onCreate:me}=t,_e=me?me(G):{[t.labelField]:G,[t.valueField]:G},{valueField:ke,labelField:Se}=t;h.value.some(Ze=>Ze[ke]===_e[ke]||Ze[Se]===_e[Se])||f.value.some(Ze=>Ze[ke]===_e[ke]||Ze[Se]===_e[Se])?g.value=T:g.value=[_e]}}function De(F){F.stopPropagation();const{multiple:G}=t;!G&&t.filterable&&ue(),O(),G?L([],[]):L(null,null)}function ni(F){!yr(F,"action")&&!yr(F,"empty")&&!yr(F,"header")&&F.preventDefault()}function nt(F){V(F)}function jt(F){var G,oe,fe,me,_e;if(!t.keyboard){F.preventDefault();return}switch(F.key){case" ":if(t.filterable)break;F.preventDefault();case"Enter":if(!(!((G=N.value)===null||G===void 0)&&G.isComposing)){if(x.value){const ke=(oe=w.value)===null||oe===void 0?void 0:oe.getPendingTmNode();ke?Jt(ke):t.filterable||(ue(),tr())}else if(ee(),t.tag&&Te.value){const ke=g.value[0];if(ke){const Se=ke[t.valueField],{value:Ze}=c;t.multiple&&Array.isArray(Ze)&&Ze.includes(Se)||Ve(ke)}}}F.preventDefault();break;case"ArrowUp":if(F.preventDefault(),t.loading)return;x.value&&((fe=w.value)===null||fe===void 0||fe.prev());break;case"ArrowDown":if(F.preventDefault(),t.loading)return;x.value?(me=w.value)===null||me===void 0||me.next():ee();break;case"Escape":x.value&&(qx(F),ue()),(_e=N.value)===null||_e===void 0||_e.focus();break}}function tr(){var F;(F=N.value)===null||F===void 0||F.focus()}function ii(){var F;(F=N.value)===null||F===void 0||F.focusInput()}function Ni(){var F;x.value&&((F=R.value)===null||F===void 0||F.syncPosition())}j(),i.watch(i.toRef(t,"options"),j);const nr={focus:()=>{var F;(F=N.value)===null||F===void 0||F.focus()},focusInput:()=>{var F;(F=N.value)===null||F===void 0||F.focusInput()},blur:()=>{var F;(F=N.value)===null||F===void 0||F.blur()},blurInput:()=>{var F;(F=N.value)===null||F===void 0||F.blurInput()}},cn=i.computed(()=>{const{self:{menuBoxShadow:F}}=o.value;return{"--n-menu-box-shadow":F}}),Hn=s?Ci("select",void 0,cn,t):void 0;return Object.assign(Object.assign({},nr),{mergedStatus:H,mergedClsPrefix:e,mergedBordered:n,namespace:r,treeMate:b,isMounted:ws(),triggerRef:N,menuRef:w,pattern:u,uncontrolledShow:B,mergedShow:x,adjustedTo:En(t),uncontrolledValue:a,mergedValue:c,followerRef:R,localizedPlaceholder:k,selectedOption:A,selectedOptions:W,mergedSize:te,mergedDisabled:D,focused:d,activeWithoutMenuOpen:Te,inlineThemeDisabled:s,onTriggerInputFocus:He,onTriggerInputBlur:ce,handleTriggerOrMenuResize:Ni,handleMenuFocus:Wt,handleMenuBlur:an,handleMenuTabOut:Ct,handleTriggerClick:mt,handleToggle:Jt,handleDeleteOption:Ve,handlePatternInput:le,handleClear:De,handleTriggerBlur:$e,handleTriggerFocus:Et,handleKeydown:jt,handleMenuAfterLeave:ve,handleMenuClickOutside:Ln,handleMenuScroll:nt,handleMenuKeydown:jt,handleMenuMousedown:ni,mergedTheme:o,cssVars:s?void 0:cn,themeClass:Hn==null?void 0:Hn.themeClass,onRender:Hn==null?void 0:Hn.onRender})},render(){return i.h("div",{class:`${this.mergedClsPrefix}-select`},i.h(hu,null,{default:()=>[i.h(fu,null,{default:()=>i.h(Iv,{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($u,{ref:"followerRef",show:this.mergedShow,to:this.adjustedTo,teleportDisabled:this.adjustedTo===En.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(dv,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],[_s,this.handleMenuClickOutside,void 0,{capture:!0}]]:[[_s,this.handleMenuClickOutside,void 0,{capture:!0}]])):null}})})]}))}}),qv={},Ah=i.defineComponent({...qv,__name:"searchable-reference-select",props:{searchDataHandler:{},optionsListConverter:{},renderLabel:{},renderTag:{},value:{},clearable:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},minTermLength:{default:()=>{var t,e;return((e=(t=K.useBaseConfigStateStore().getConfig())==null?void 0:t.minLength)==null?void 0:e.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(()=>I.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),u=i.useTemplateRef("select-component"),h=_=>{_.length<r.minTermLength||(d.value=!0,r.searchDataHandler(_,d).then(B=>{if(I.isEmpty(B))return;const x=o.value?r.value:r.value?[r.value]:[],N=B.filter(R=>!x.some(w=>w.id===R.id));l.value=r.optionsListConverter([...x,...N])}).finally(()=>{d.value=!1}))};let f="";const g=I.debounce(()=>h(f),800),m=_=>{f=_,g()},p=_=>{var B;if(I.isArray(_)){const x=_.length>0?_.map(N=>{var R;return i.toRaw((R=l.value.find(w=>w.value===N))==null?void 0:R.item)}):[];s("update:value",x)}else if(_>0){const x=i.toRaw((B=l.value.find(N=>N.value===_))==null?void 0:B.item);s("update:value",x)}else s("update:value",null)};return e({focus:()=>{var _;return(_=u.value)==null?void 0:_.focusInput()},blur:()=>{var _;return(_=u.value)==null?void 0:_.blurInput()}}),(_,B)=>(i.openBlock(),i.createBlock(i.unref(jv),{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:m,"onUpdate:value":p},null,8,["clearable","consistent-menu-width","disabled","loading","multiple","options","placeholder","value","render-label","render-tag"]))}}),Xv={},Mh=i.defineComponent({...Xv,__name:"searchable-product-select",props:{renderLabel:{},renderTag:{},value:{},clearable:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},minTermLength:{default:()=>{var t,e;return((e=(t=K.useBaseConfigStateStore().getConfig())==null?void 0:t.minLength)==null?void 0:e.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 h=>r.searchType==="categories"?K.HttpRequester.getInstance(K.ProductCategoryDataProvider).publicSimpleSearch(h):r.searchType==="products"?K.HttpRequester.getInstance(K.ProductDataProvider).publicSimpleSearch(h):new Promise(f=>{f([])}),l=h=>r.searchType==="categories"?Vt.convertReferencesToSelectOptionsList(h,!0,!1,!1,f=>f!=null&&f.isNewRec()?"-":f.name):r.searchType==="products"?Vt.convertReferencesToSelectOptionsList(h,!0,!1,!1,f=>f!=null&&f.isNewRec()?"-":`[${f.code}] ${f.name}`):[],c=(h,f)=>{if(r.renderLabel)return r.renderLabel(h,f);if(r.searchType==="products"){const g=h.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=h.item;return i.h("div",{},[g.name])}};return e({focus:()=>{var h;return(h=o.value)==null?void 0:h.focus()},blur:()=>{var h;return(h=o.value)==null?void 0:h.blur()}}),(h,f)=>(i.openBlock(),i.createBlock(Ah,{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":f[0]||(f[0]=g=>s("update:value",g))},null,8,["value","clearable","disabled","placeholder","consistent-menu-width","wrap-content","min-term-length","render-tag"]))}}),Yv={class:"col-span-2 flex flex-row gap-2.5"},Uv={class:"flex-1"},Kv={class:"text-sc-grey"},Gv={class:"ml-2.5"},Zv={key:0,class:"flex-none"},Qv={},Jv=i.defineComponent({...Qv,__name:"products-list",props:{value:{},searchType:{},minTermLength:{default:()=>{var t,e;return((e=(t=K.useBaseConfigStateStore().getConfig())==null?void 0:t.minLength)==null?void 0:e.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(h=>i.toRaw(h)))},c=h=>{h&&(a.value=[...a.value.map(f=>i.toRaw(f)),...(I.isArray(h)?h:[h]).filter(f=>!a.value.some(g=>g.id===f.id))],i.nextTick(()=>{s.value=null}),l())},d=h=>{h&&(a.value=a.value.map(f=>f.id===h.id?h:i.toRaw(f)),l())},u=h=>{a.value=a.value.filter(f=>f.id!==h.id),l()};return i.watch(()=>n.value,()=>{a.value=o()}),(h,f)=>{const g=z.NListItem,m=$1,p=z.NButton,y=z.NList;return i.openBlock(),i.createBlock(y,{"show-divider":!1,hoverable:!0},{header:i.withCtx(()=>[i.renderSlot(h.$slots,"header")]),footer:i.withCtx(()=>[i.createVNode(Mh,{value:s.value,"onUpdate:value":[f[0]||(f[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(()=>[...f[1]||(f[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:_=>u(b)},{default:i.withCtx(()=>[i.createVNode(m)]),_:1},8,["disabled","onClick"])]),default:i.withCtx(()=>[i.createElementVNode("div",Yv,[i.createElementVNode("span",Uv,[i.createElementVNode("span",Kv,i.toDisplayString(b.code),1),i.createElementVNode("span",Gv,i.toDisplayString(b.name),1)]),h.$slots["item-extra"]?(i.openBlock(),i.createElementBlock("div",Zv,[i.renderSlot(h.$slots,"item-extra",{item:b,updateItemCallback:d})])):i.createCommentVNode("",!0)])]),_:2},1024))),128))]),_:3})}}}),eC={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function tC(t,e){return i.openBlock(),i.createElementBlock("svg",eC,[...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 nC=i.markRaw({name:"tabler-truck-filled",render:tC}),iC={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function rC(t,e){return i.openBlock(),i.createElementBlock("svg",iC,[...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 sC=i.markRaw({name:"tabler-truck-delivery",render:rC}),oC={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function aC(t,e){return i.openBlock(),i.createElementBlock("svg",oC,[...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 lC=i.markRaw({name:"tabler-truck-loading",render:aC}),cC={class:"flex flex-col gap-1"},dC={key:0,class:"flex flex-row gap-1 text-sm text-sc-grey"},uC={key:1,class:"text-base"},hC={class:"text-sc-dark-grey mr-1.5"},fC={key:0},mC={key:1},gC={},Vs=i.defineComponent({...gC,__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=K.useReferencesStore().deliveryTypeReference)==null?void 0:s.find(o=>o.id===r.delivery.type)}),n=i.computed(()=>Tn.format(r.delivery.date,"dd.MM.yyyy")),r=t;return(s,o)=>{var d,u,h,f,g,m,p,y;const a=lC,l=sC,c=nC;return i.openBlock(),i.createElementBlock("div",cC,[t.showType?(i.openBlock(),i.createElementBlock("span",dC,[((d=e.value)==null?void 0:d.slug)==="self_delivery"?(i.openBlock(),i.createBlock(a,{key:0})):i.createCommentVNode("",!0),((u=e.value)==null?void 0:u.slug)==="delivery"?(i.openBlock(),i.createBlock(l,{key:1})):i.createCommentVNode("",!0),((h=e.value)==null?void 0:h.slug)==="transport_company_delivery"?(i.openBlock(),i.createBlock(c,{key:2})):i.createCommentVNode("",!0),i.createElementVNode("span",null,i.toDisplayString((f=e.value)==null?void 0:f.name),1)])):i.createCommentVNode("",!0),t.showDetails?(i.openBlock(),i.createElementBlock("span",uC,[i.createElementVNode("span",hC,i.toDisplayString(n.value),1),(m=(g=t.delivery)==null?void 0:g.address)!=null&&m.address?(i.openBlock(),i.createElementBlock("span",fC,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",mC," со склада "+i.toDisplayString(t.delivery.warehouse.address),1)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)])}}}),pC={class:"flex flex-col gap-2.5"},yC={class:"text-base"},bC=["href"],_C={class:"text-sc-grey"},wC={},Oh=i.defineComponent({...wC,__name:"order-common-info",props:{order:{},fields:{},showAttachedUserColumn:{type:Boolean},orderContextButtonsConfig:{type:Function},onOrderContextSelect:{type:Function},orderUrl:{}},setup(t){const e=t,n=i.computed(()=>e.fields.includes(Ee.Id)?e.order.id:void 0),r=i.computed(()=>{var l,c;return e.fields.includes(Ee.Status)?(c=(l=K.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(Ee.CreatedAt)),o=i.computed(()=>e.fields.includes(Ee.ClientInfo)||e.fields.includes(Ee.ClientInfoShort)?e.order.client:void 0),a=i.computed(()=>e.fields.includes(Ee.DeliveryInfo)?e.order.delivery:void 0);return(l,c)=>(i.openBlock(),i.createElementBlock("div",pC,[i.createElementVNode("span",yC,[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,bC)):i.createCommentVNode("",!0),s.value?(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[c[0]||(c[0]=i.createTextVNode(" от ",-1)),i.createVNode(fs,{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",_C,i.toDisplayString(r.value),1)],64)):i.createCommentVNode("",!0)]),o.value?(i.openBlock(),i.createBlock(pr,{key:0,client:o.value,class:"ml-3"},null,8,["client"])):i.createCommentVNode("",!0),a.value?(i.openBlock(),i.createBlock(Vs,{key:1,delivery:a.value,class:"ml-3"},null,8,["delivery"])):i.createCommentVNode("",!0)]))}}),xC={},va=i.defineComponent({...xC,__name:"order-payment",props:{payment:{}},setup(t){const e=t,n=i.computed(()=>{var r;return(r=K.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)}}}),kC={class:"inline-block py-[0.0625rem] px-1.5 text-xs font-bold text-center whitespace-nowrap rounded text-white bg-[#17a2b8]"},vC={},Ca=i.defineComponent({...vC,__name:"creator-user-type-tag",props:{userType:{},prefixText:{default:"Добавлено"}},setup(t){const e=(n,r)=>{const s={[K.UserTypeEnum.Manager]:"менеджером",[K.UserTypeEnum.Operator]:"оператором",[K.UserTypeEnum.Client]:"клиентом",[K.UserTypeEnum.Admin]:"администратором"};return`${r} ${s[n]}`};return(n,r)=>(i.openBlock(),i.createElementBlock("small",kC,i.toDisplayString(e(t.userType,t.prefixText)),1))}}),CC={class:"flex flex-row gap-1.5"},SC={class:"flex-none text-nowrap"},BC={class:"flex flex-1 flex-col"},TC={class:"mt-2.5 grid grid-flow-col grid-rows-2 gap-1 text-base"},$C={key:0},NC={key:1},RC={},zh=i.defineComponent({...RC,__name:"order-product-info",props:{product:{},index:{}},setup(t){return(e,n)=>{const r=Ca;return i.openBlock(),i.createElementBlock("div",CC,[i.createElementVNode("span",SC,i.toDisplayString(t.index+1)+".",1),i.createElementVNode("div",BC,[i.createVNode(lr,{product:t.product.product,"show-planning-dates":!1},null,8,["product"]),t.product.creatorUser&&t.product.creatorUser.type?(i.openBlock(),i.createBlock(r,{key:0,"user-type":t.product.creatorUser.type,class:"mt-1 self-start"},null,8,["user-type"])):i.createCommentVNode("",!0),i.createElementVNode("div",TC,[n[0]||(n[0]=i.createElementVNode("span",null,"Кол-во",-1)),t.product.product.getIsMeasurable()?(i.openBlock(),i.createElementBlock("span",$C,i.toDisplayString(`${t.product.length} ${t.product.product.unit.name} x ${t.product.quantity} шт.`),1)):(i.openBlock(),i.createElementBlock("span",NC,i.toDisplayString(`${t.product.quantity} ${t.product.product.unit.name}`),1)),n[1]||(n[1]=i.createElementVNode("span",null,"Цена за ед.",-1)),i.createVNode(jn,{product:t.product,"cost-field-name":"costOneRub"},null,8,["product"]),n[2]||(n[2]=i.createElementVNode("span",null,"Сумма",-1)),i.createVNode(jn,{product:t.product,"cost-field-name":"cost"},null,8,["product"])])])])}}}),PC={},EC=i.defineComponent({...PC,__name:"order-items-list",props:{products:{},maxHeight:{default:void 0}},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,width:"45%",render:o=>i.h("div",{},[i.h(lr,{product:o.product,showCode:!1,showPlanningDates:!1}),..."creatorUser"in o&&o.creatorUser&&o.creatorUser.type?[i.h(Ca,{class:"mt-1",userType:o.creatorUser.type,prefixText:"Добавлено"})]:[]])},{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.name} x ${o.quantity} шт.`]:[`${o.quantity} ${o.product.unit.name}`])},{title:"Цена за ед.",key:"costOneRub",resizable:!0,minWidth:100,render:o=>i.h(jn,{product:o,costFieldName:"costOne",showQuantityUnit:!0})},{title:"Сумма",key:"cost",resizable:!0,minWidth:100,render:o=>i.h(jn,{product:o,costFieldName:"cost",showQuantityUnit:!0})}];switch(St.getDeviceTypeByResolution()){case Qe.phone:case Qe.tablet:return[{title:"",key:"items",resizable:!0,render:(o,a)=>i.h(zh,{product:o,index:a})}];case Qe.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.products,"row-key":l=>l.id,"bottom-bordered":!1,bordered:!1,"max-height":t.maxHeight},null,8,["columns","data","row-key","max-height"])],64)}}}),Dh=Wn(EC,[["__scopeId","data-v-e5948917"]]),FC={class:"text-base"},VC={},Sa=i.defineComponent({...VC,__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",FC,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))}}),IC={class:"ml-4 grid grid-cols-3 gap-1.5 text-base"},AC={class:"col-span-2"},MC={class:"col-span-2"},OC=["href"],zC={},Lh=i.defineComponent({...zC,__name:"order-details",props:{order:{}},emits:["click:client-name"],setup(t,{emit:e}){const n=e;return(r,s)=>(i.openBlock(),i.createElementBlock("div",null,[s[12]||(s[12]=i.createElementVNode("h3",null,"Детали заказа",-1)),i.createElementVNode("div",IC,[t.order.creator.id!==t.order.client.id?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[s[1]||(s[1]=i.createElementVNode("span",null,"Создал",-1)),i.createVNode(Sa,{user:t.order.creator,class:"col-span-2"},null,8,["user"])],64)):i.createCommentVNode("",!0),s[11]||(s[11]=i.createElementVNode("span",null,"Клиент",-1)),i.createVNode(pr,{client:t.order.client,class:"col-span-2","onClick:clientName":s[0]||(s[0]=o=>n("click:client-name",t.order.client,o))},null,8,["client"]),t.order.contragent?(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[s[2]||(s[2]=i.createElementVNode("span",null,"Контрагент",-1)),i.createVNode(Wd,{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},[s[3]||(s[3]=i.createElementVNode("span",null,"Графический файл клиента",-1)),s[4]||(s[4]=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},[s[5]||(s[5]=i.createElementVNode("span",null,"Штрих-код",-1)),i.createElementVNode("span",AC,i.toDisplayString(t.order.barcode),1)],64)):i.createCommentVNode("",!0),t.order.payment?(i.openBlock(),i.createElementBlock(i.Fragment,{key:4},[s[6]||(s[6]=i.createElementVNode("span",null,"Оплата",-1)),i.createVNode(va,{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},[s[7]||(s[7]=i.createElementVNode("span",null,"Доставка",-1)),i.createVNode(Vs,{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},[s[8]||(s[8]=i.createElementVNode("span",null,"Комментарий",-1)),i.createElementVNode("span",MC,i.toDisplayString(t.order.comment),1)],64)):i.createCommentVNode("",!0),t.order.attachedUser?(i.openBlock(),i.createElementBlock(i.Fragment,{key:7},[s[9]||(s[9]=i.createElementVNode("span",null,"Закреплен за",-1)),i.createVNode(Sa,{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},[s[10]||(s[10]=i.createElementVNode("span",null,"Прикрепленные счета",-1)),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(t.order.invoices,(o,a)=>(i.openBlock(),i.createElementBlock("div",{key:a,class:"col-span-2"},[i.createElementVNode("a",{class:"btn btn-primary",href:o}," Скачать счет №"+i.toDisplayString(a+1),9,OC)]))),128))],64)):i.createCommentVNode("",!0)])]))}}),DC={key:0},LC={class:"text-sc-dark-grey my-2 text-center"},HC={key:1,class:"text-sc-dark-grey my-2 text-center"},WC={key:2},jC={class:"text-sc-dark-grey mt-4 text-right font-bold"},qC={class:"text-sc-primary"},XC={},Hh=i.defineComponent({...XC,__name:"order-info",props:{order:{}},emits:["click:client-name"],setup(t,{emit:e}){const n=t,r=e,s=i.ref(!1),o=i.ref(new K.Order(n.order)),a=(c=!0)=>{c&&(s.value=!0),K.HttpRequester.getInstance(K.OrdersDataProvider).getOrder(n.order.id).then(d=>{o.value=d}).finally(()=>{c&&(s.value=!1)})},l=i.computed(()=>(o.value.products??[]).reduce((c,d)=>c+d.costRub,0).toLocaleString("ru-ru",{minimumFractionDigits:2}));return i.watch(()=>n.order,()=>{a(!1)}),i.onMounted(()=>{a()}),(c,d)=>{const u=z.NSpin;return s.value?(i.openBlock(),i.createElementBlock("div",DC,[i.createElementVNode("div",LC,[i.createVNode(u,{size:"small",class:"mb-2.5 align-middle"}),d[1]||(d[1]=i.createElementVNode("div",null,[i.createElementVNode("span",null,"Загрузка данных ...")],-1))])])):o.value.products.length===0?(i.openBlock(),i.createElementBlock("div",HC," --- Не удалось загрузить данные о заказе --- ")):(i.openBlock(),i.createElementBlock("div",WC,[i.createVNode(Dh,{products:o.value.products},null,8,["products"]),i.createElementVNode("div",jC,[d[2]||(d[2]=i.createTextVNode(" ИТОГО: ",-1)),i.createElementVNode("span",qC,i.toDisplayString(l.value)+" ₽",1)]),i.createVNode(Lh,{order:o.value,"onClick:clientName":d[0]||(d[0]=h=>r("click:client-name",o.value.client,h))},null,8,["order"])]))}}}),YC={},UC=i.defineComponent({...YC,__name:"order-actions",props:{orderContextButtonsConfig:{type:Function,default:void 0},onOrderContextSelect:{type:Function,default:void 0},order:{}},setup(t){const e=t,n=i.inject(or,"small"),r=i.computed(()=>I.isNil(e.orderContextButtonsConfig)?[]:I.isFunction(e.orderContextButtonsConfig)?e.orderContextButtonsConfig(e.order):e.orderContextButtonsConfig),s=o=>{var a;(a=e.onOrderContextSelect)==null||a.call(e,e.order,o)};return(o,a)=>{var u;const l=Ls,c=z.NButton,d=z.NDropdown;return((u=r.value)==null?void 0:u.length)>0?(i.openBlock(),i.createBlock(d,{key:0,options:r.value,size:i.unref(n),trigger:"click",onSelect:s},{default:i.withCtx(()=>[i.createVNode(c,{ghost:!0,size:i.unref(n),type:"primary"},{default:i.withCtx(()=>[i.createVNode(l)]),_:1},8,["size"])]),_:1},8,["options","size"])):i.createCommentVNode("",!0)}}}),KC={},GC=i.defineComponent({...KC,__name:"orders-list",props:{fields:{},showAttachedUserColumn:{type:Boolean,default:!1},orderContextButtonsConfig:{},onOrderContextSelect:{},orderUrl:{},tableMinWidth:{default:1/0},filters:{default:void 0},sort:{default:void 0},pagination:{default:void 0},useCellIndication:{type:Boolean,default:!1},enableSorting:{type:Boolean,default:!1},refreshInterval:{default:0}},emits:["click:client-name","dblclick:row","update:pagination","update:sort"],setup(t,{emit:e}){const n=t,r=e,s=()=>I.cloneDeep(n.sort??[{field:"id",direction:"desc"}]),o=i.ref(s()),a=i.ref([]),l=i.ref(!1),c=i.computed(()=>K.useReferencesStore().orderStatusReference),d=i.ref(700),u=T=>{var W,A;const $={onDblclick:()=>r("dblclick:row",T)};if(!n.useCellIndication)return $;const P=[];T.isOnOrder&&P.push("on-order"),T.isLargeOrder&&P.push("large-order"),T.isNotInStock&&P.push("not-in-stock");const E=(A=(W=c.value)==null?void 0:W.find(Z=>Z.id===(T.status??-1)))==null?void 0:A.slug;return E&&P.push("order-status",E),T.delivery.date&&Tn.isTomorrow(new Date(T.delivery.date))&&P.push("next-day-order"),P.length>0&&($.class=P.join(" ")),$},h=()=>{const T=[Ee.CreatedAt,Ee.Id,Ee.ClientInfo,Ee.ClientCity,Ee.DeliveryDate,Ee.PaymentType,Ee.SalesDirections,Ee.Status,...n.showAttachedUserColumn?[Ee.AttachedUser]:[],Ee.actions],$=n.fields.length>0?n.fields:T,P={title:"???",key:"undefined",render:()=>i.h("span",{},["--- unknown ---"])},E={type:"expand",expandable:I.constant(!0),renderExpand:A=>i.h(Hh,{order:A,class:"pl-10 pt-3 pb-10","onClick:client-name":()=>{r("click:client-name",A.client,null)}}),width:"30"};let W=[{title:"Дата заказа",key:Ee.CreatedAt,resizable:!0,width:100,render:A=>i.h(fs,{date:A.createdAt,isTimeSecondary:!0,isTimeOnSecondLine:!0,class:"text-base"})},{title:"№ заказа",key:Ee.Id,resizable:!0,width:75,className:"order-id",render:A=>i.h("a",{href:n.orderUrl.replace(":id",A.id.toString()),class:"text-base"},A.id)},{title:"Дата доставки / самовывоза",key:Ee.DeliveryDate,resizable:!0,width:100,className:"delivery-date",render:A=>i.h(fs,{date:A.delivery.date,isShowTime:!1,class:"text-base"})},{title:"Клиент",key:Ee.ClientInfo,resizable:!0,minWidth:320,render:A=>i.h(pr,{client:A.client,"onClick:client-name":()=>{r("click:client-name",A.client,null)}})},{title:"Тип доставки",key:Ee.DeliveryInfo,resizable:!0,minWidth:320,render:A=>i.h(Vs,{delivery:A.delivery})},{title:"Клиент",key:Ee.ClientInfoShort,resizable:!0,minWidth:320,render:A=>i.h(pr,{client:A.client,showCityAndRegion:!1,"onClick:client-name":()=>{r("click:client-name",A.client,null)}})},{title:"Город клиента",key:Ee.ClientCity,resizable:!0,minWidth:90,width:120,render:A=>{var Z;return i.h("span",{class:"text-base"},((Z=A.client)==null?void 0:Z.city.name)??"—")}},{title:"Статус",key:Ee.Status,resizable:!0,width:150,minWidth:115,className:"order-status",render:A=>{var Z,te;return i.h("span",{class:"text-base"},[((te=(Z=c.value)==null?void 0:Z.find(D=>D.id===(A.status??-1)))==null?void 0:te.name)??""])}},{title:"Тип оплаты",key:Ee.PaymentType,resizable:!0,width:115,minWidth:95,render:A=>A.payment?i.h(va,{payment:A.payment}):i.h("span",{class:"text-base"},"—")},{title:"Напр. продаж",key:Ee.SalesDirections,resizable:!0,width:70,render:A=>{var Z;return i.h("span",{class:"text-base"},[((Z=A.salesDirection)==null?void 0:Z.name)??""])}},...n.showAttachedUserColumn?[{title:"Закреплено за",key:Ee.AttachedUser,resizable:!0,minWidth:120,render:A=>{var Z;return i.h("span",{class:"text-base"},[((Z=A==null?void 0:A.attachedUser)==null?void 0:Z.name)??""])}}]:[]];switch(n.orderContextButtonsConfig&&W.push({key:"actions",title:"",className:"align-top",width:50,render:A=>i.h(UC,{order:A,orderContextButtonsConfig:n.orderContextButtonsConfig,onOrderContextSelect:n.onOrderContextSelect})}),n.enableSorting&&(W=W.map(A=>[Ee.Id,Ee.CreatedAt,Ee.DeliveryDate].includes(A.key)?{...A,sorter:!0,sortOrder:!1,...A.width===void 0?{}:{width:A.width+16}}:A)),St.getDeviceTypeByResolution()){case Qe.phone:case Qe.tablet:return[E,{key:"order",title:"Заказ",resizable:!0,render:A=>i.h(Oh,{order:A,fields:$,orderUrl:n.orderUrl})}];case Qe.laptop:{const A=n.showAttachedUserColumn?$:$.filter(Z=>Z!==Ee.AttachedUser);return[E,...A.map(Z=>W.find(te=>te.key===Z)??P)]}default:return[P]}},f=i.ref(h()),g=i.ref(new K.DataTablePagination(n.pagination??{page:1,pageSize:10,itemCount:0,pageCount:1,pageSlot:5,pageSizes:[10,15,25],showSizePicker:!0})),m=i.computed(()=>({...g.value,prefix({itemCount:T}){return`Всего заказов: ${T}`}})),p=i.ref(null),y=i.ref(null),b=i.ref(null),_=()=>{b.value!==null&&(clearInterval(b.value),b.value=null)},B=()=>{_(),n.refreshInterval&&(b.value=setInterval(()=>{N()},n.refreshInterval))},x=()=>{var T,$;n.filters&&((T=y.value)==null||T.abort(),y.value=null,($=p.value)==null||$.abort(),p.value=new AbortController,l.value=!0,K.HttpRequester.getInstance(K.OrdersDataProvider).getOrders(n.filters,o.value,{page:g.value.page,pageSize:g.value.pageSize},p.value.signal).then(P=>{g.value.itemCount!==P.meta.total&&(g.value.itemCount=P.meta.total),g.value.page!==P.meta.currentPage&&(g.value.page=P.meta.currentPage),g.value.pageCount!==P.meta.lastPage&&(g.value.pageCount=P.meta.lastPage),g.value.pageSize!==P.meta.perPage&&(g.value.pageSize=P.meta.perPage),a.value=P.data,l.value=!1}).catch(P=>{if((P==null?void 0:P.name)!=="CanceledError")throw l.value=!1,P}))},N=()=>{var T;!n.filters||l.value||((T=y.value)==null||T.abort(),y.value=new AbortController,K.HttpRequester.getInstance(K.OrdersDataProvider).getOrders(n.filters,o.value,{page:g.value.page,pageSize:g.value.pageSize},y.value.signal).then($=>{a.value=a.value.map(P=>$.data.find(W=>W.id===P.id)??P),g.value.itemCount!==$.meta.total&&(g.value.itemCount=$.meta.total),g.value.pageCount!==$.meta.lastPage&&(g.value.pageCount=$.meta.lastPage)}).catch($=>{if(($==null?void 0:$.name)!=="CanceledError")throw $}))},R=T=>{g.value.page=T,x(),r("update:pagination",g.value)},w=T=>{g.value.pageSize=T,g.value.page=1,x(),r("update:pagination",g.value)},C=T=>{if(I.isNull(T))o.value=s();else{const[$]=o.value;$.field=T.columnKey.toString(),$.direction=T.order==="ascend"?"asc":"desc",o.value=[$]}f.value.forEach($=>{if(Object.hasOwn($,"sortOrder")){const P=$;P.sortOrder=P.key===(T==null?void 0:T.columnKey)&&(T!=null&&T.sorter)&&T.order!==!1?T.order:!1}}),x(),r("update:sort",o.value)},k=()=>{f.value=h(),d.value=window.innerHeight};return i.watch(()=>n.filters,()=>{g.value.page=1,x(),B()}),i.watch(()=>n.sort,()=>{o.value=s(),g.value.page=1,x(),B()}),i.onMounted(()=>{k(),window.addEventListener("resize",k),i.nextTick(()=>{x(),B()})}),i.onUnmounted(()=>{var T,$;window.removeEventListener("resize",k),(T=p.value)==null||T.abort(),($=y.value)==null||$.abort(),_()}),(T,$)=>{const P=z.NDataTable;return i.openBlock(),i.createBlock(P,{columns:f.value,data:a.value,"row-key":E=>E.id,"row-props":u,"scroll-x":t.tableMinWidth,pagination:m.value,loading:l.value,remote:!0,bordered:!1,"bottom-bordered":!1,"sticky-expanded-rows":!0,"max-height":d.value*(i.unref(K.useBaseConfigStateStore)().config.tableDefaultHeightCoefficient??.6),"pagination-behavior-on-filter":"first","onUpdate:page":R,"onUpdate:pageSize":w,"onUpdate:sorter":C},null,8,["columns","data","row-key","scroll-x","pagination","loading","max-height"])}}}),ZC=Wn(GC,[["__scopeId","data-v-aee16951"]]),QC=["href"],JC={class:"text-sc-dark-grey"},e2={},t2=i.defineComponent({...e2,__name:"short-text-order-info",props:{order:{},orderLink:{}},emits:["click:order-id"],setup(t,{emit:e}){const n=t,r=e,s=i.computed(()=>Tn.format(n.order.createdAt,K.useBaseConfigStateStore().config.dateFormats.uiDateWithTime)),o=a=>{I.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,QC),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",JC,"автор: "+i.toDisplayString(t.order.creator.name)+" ["+i.toDisplayString(t.order.creator.type)+"]",1)],64))}}),n2={class:"sc-page flex flex-col bg-inherit"},i2={class:"my-2 flex flex-row items-end"},r2={class:"sc-title grow"},s2={key:0,class:"sc-title-buttons flex-1 grow-0"},o2={class:"flex flex-col justify-end gap-1 sm:mt-0 sm:flex-row"},a2={key:0,class:"sc-title-extra mt-2 sm:mt-4"},l2={},Wh=i.defineComponent({...l2,__name:"page",props:{title:{},stickyHeader:{type:Boolean},stickyTopOffset:{}},setup(t){return(e,n)=>{const r=z.NH1;return i.openBlock(),i.createElementBlock("div",n2,[i.createElementVNode("div",{class:i.normalizeClass(t.stickyHeader?"sticky z-10 bg-inherit":void 0),style:i.normalizeStyle(t.stickyHeader?{top:`${t.stickyTopOffset??0}px`}:void 0)},[i.createElementVNode("div",i2,[i.createElementVNode("div",r2,[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",s2,[i.createElementVNode("div",o2,[i.renderSlot(e.$slots,"title-buttons")])])):i.createCommentVNode("",!0)]),e.$slots["title-extra"]?(i.openBlock(),i.createElementBlock("div",a2,[i.renderSlot(e.$slots,"title-extra")])):i.createCommentVNode("",!0),i.renderSlot(e.$slots,"sticky-extra")],6),i.renderSlot(e.$slots,"default")])}}}),c2={class:"overflow-hidden transition-all duration-300"},d2={class:"text-lg font-medium leading-none"},u2={},jh=i.defineComponent({...u2,__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(St.getDeviceTypeByResolution()){case Qe.phone:return window.innerWidth*.8;case Qe.tablet:return window.innerWidth*.5;default:return window.innerWidth*.33}},l=()=>{o.value?I.isUndefined(n.drawerWidth)?s.value=a():s.value=I.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 u=z.NDrawerContent,h=z.NDrawer;return i.openBlock(),i.createElementBlock(i.Fragment,null,[i.createElementVNode("div",c2,[i.createElementVNode("div",{style:i.normalizeStyle(`margin-left: ${s.value}px;`),class:"w-full"},[i.renderSlot(c.$slots,"default")],4)]),i.createVNode(h,{show:o.value,"onUpdate:show":d[0]||(d[0]=f=>o.value=f),resizable:!0,width:s.value,placement:"left"},{default:i.withCtx(()=>[i.createVNode(u,{closable:""},{header:i.withCtx(()=>[i.renderSlot(c.$slots,"drawer-header",{},()=>[i.createElementVNode("div",d2,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)}}}),h2={ref:"panel-component-ref",class:"sc-page-panel flex flex-row gap-2.5 bg-inherit sm:gap-8"},f2={key:0},m2={class:"sc-page-preview-panel grow"},g2={key:1,class:"sc-page-preview-panel-extra flex-none"},p2={},y2=i.defineComponent({...p2,__name:"page-with-sliding-panel",props:{title:{},isShowPanelButtonVisible:{type:Boolean,default:!0},showPanelButtonText:{default:""},panelTitle:{default:""},stickyHeader:{type:Boolean,default:!1},stickyTopOffset:{default:0}},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,u;window.scrollTo({top:(((u=(d=o.value)==null?void 0:d.getBoundingClientRect())==null?void 0:u.top)??0)+window.pageYOffset+l,behavior:"smooth"})})},showPanel:r,closePanel:s}),(l,c)=>{const d=z.NButton;return i.openBlock(),i.createBlock(Wh,{title:t.title,"sticky-header":t.stickyHeader,"sticky-top-offset":t.stickyTopOffset},i.createSlots({default:i.withCtx(()=>[i.createVNode(jh,{"show-drawer":n.value,"onUpdate:showDrawer":c[1]||(c[1]=u=>n.value=u),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,l.$slots["preview-panel"]||l.$slots["preview-panel-extra"]||t.isShowPanelButtonVisible?{name:"sticky-extra",fn:i.withCtx(()=>[i.createElementVNode("div",h2,[t.isShowPanelButtonVisible?(i.openBlock(),i.createElementBlock("div",f2,[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]=u=>n.value=!0)},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(t.showPanelButtonText),1)]),_:1})])])):i.createCommentVNode("",!0),i.createElementVNode("div",m2,[i.renderSlot(l.$slots,"preview-panel")]),l.$slots["preview-panel-extra"]?(i.openBlock(),i.createElementBlock("div",g2,[i.renderSlot(l.$slots,"preview-panel-extra")])):i.createCommentVNode("",!0)],512)]),key:"3"}:void 0]),1032,["title","sticky-header","sticky-top-offset"])}}}),b2={},_2=i.defineComponent({...b2,__name:"curator-select",props:{value:{default:null},clearable:{type:Boolean,default:!1},consistentMenuWidth:{type:Boolean},wrapContent:{type:Boolean},managerReferenceList:{default:()=>[]},showEmptyValue:{type:Boolean,default:!1}},emits:["update:value"],setup(t,{expose:e,emit:n}){const r=t,s=n,o=i.computed(()=>I.isArray(r.value)),a=i.computed(()=>{var m;return I.isArray(r.value)?r.value.map(p=>p.id):((m=r.value)==null?void 0:m.id)??null}),l=i.computed(()=>{const m=new K.Curator({id:-1,name:"",contacts:{},curatedDirection:new K.CuratedDirection({id:-1,name:"",guid:""}),guid:""}),p=r.showEmptyValue?[m]:[];return r.managerReferenceList.filter(y=>{var b;return(((b=y==null?void 0:y.curatedDirections)==null?void 0:b.length)??0)>0}).forEach(y=>{((y==null?void 0:y.curatedDirections)??[]).forEach(b=>{p.push(new K.Curator({id:y.id,guid:y.guid,name:y.name,photo:y.photo,contacts:y.contacts??{},curatedDirection:b}))})}),p}),c=i.computed(()=>Vt.convertReferencesToSelectOptionsList(l.value,!0,{key:"item.curatedDirection.id",label:"item.curatedDirection.name"},!1,m=>{const p=I.some(o.value?r.value:[r.value],["id",m.id])?` (${m.curatedDirection.name}) `:"";return m.curatedDirection.isNewRec()?m.name:`${m.name}${p}`})),d=i.computed(()=>c.value.map(m=>({...m,class:r.wrapContent?`${m.class} consistent-menu-width`:m.class}))),u=i.useTemplateRef("select-component"),h=m=>{if(I.isArray(m)){const p=m.length>0?m.map(y=>l.value.find(b=>b.id===y)).filter(y=>!I.isNil(y)):[];s("update:value",p)}else{const p=m>0?l.value.find(y=>y.id===m):null;s("update:value",p??null)}};return i.watch(()=>r.value,()=>{var m,p;(p=(m=u.value)==null?void 0:m.$forceUpdate)==null||p.call(m)},{deep:!0}),e({focus:()=>{var m;return(m=u.value)==null?void 0:m.focusInput()},blur:()=>{var m;return(m=u.value)==null?void 0:m.blurInput()}}),(m,p)=>(i.openBlock(),i.createBlock(i.unref(z.NSelect),{ref:"select-component",value:a.value,clearable:t.clearable,disabled:c.value.length===0,"consistent-menu-width":t.consistentMenuWidth,multiple:o.value,options:d.value,placeholder:"","onUpdate:value":h},null,8,["value","clearable","disabled","consistent-menu-width","multiple","options"]))}}),w2={},x2=i.defineComponent({...w2,__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(()=>I.isArray(r.value)),a=i.computed(()=>{var m;return I.isArray(r.value)?r.value.map(p=>p.id):((m=r.value)==null?void 0:m.id)??null}),l=i.computed(()=>r.showEmptyValue?[K.ManagerDataFactory.generateUndefinedManagerInstance(),...r.managerReferenceList]:r.managerReferenceList),c=i.computed(()=>{var y;let m=l.value,p=r.disabledManagerReferenceList.map(b=>b.id);if(r.showActualOnly){const b=I.isArray(r.value)?r.value.map(_=>_.id):[(y=r.value)==null?void 0:y.id];p=I.union(p,l.value.filter(_=>!_.isActive).map(_=>_.id)),m=m.filter(_=>(r.showEmptyValue?K.ManagerDataFactory.isUndefinedManagerInstance(_):!1)||_.isActive||b.includes(_.id))}return Vt.convertReferencesToSelectOptionsList(m,!0,r.groupBySalesDirection?{key:"item.salesDirection.id",label:"item.salesDirection.name"}:!1,!1,b=>{const _=!r.groupBySalesDirection||r.groupBySalesDirection&&I.some(o.value?r.value:[r.value],["id",b.id])?` (${b.salesDirection.name}) `:"";return b.salesDirection.isNewRec()?b.name:`${b.name}${_}${b.isActive?"":" [Не активен]"}`},b=>p.includes(b.id)&&b.isActive)}),d=i.computed(()=>c.value.map(m=>({...m,class:r.wrapContent?`${m.class} consistent-menu-width`:m.class}))),u=i.useTemplateRef("select-component"),h=m=>{if(I.isArray(m)){const p=m.length>0?m.filter(y=>!I.some(r.disabledManagerReferenceList,["id",y])).map(y=>l.value.find(b=>b.id===y)).filter(y=>!I.isNil(y)):[];s("update:value",p)}else{const p=m>0&&!I.some(r.disabledManagerReferenceList,["id",m])?l.value.find(y=>y.id===m):new K.Manager;s("update:value",p??new K.Manager)}};return i.watch(()=>r.value,()=>{var m,p;(p=(m=u.value)==null?void 0:m.$forceUpdate)==null||p.call(m)},{deep:!0}),i.watch(()=>r.disabledManagerReferenceList,m=>{if(m.length>0&&r.value)if(o.value){const p=r.value;I.some(p,y=>I.some(m,["id",y.id]))&&s("update:value",p.filter(y=>!I.some(m,["id",y.id])))}else{const p=r.value;I.some(m,["id",p.id])&&s("update:value",new K.Manager)}}),e({focus:()=>{var m;return(m=u.value)==null?void 0:m.focusInput()},blur:()=>{var m;return(m=u.value)==null?void 0:m.blurInput()}}),(m,p)=>(i.openBlock(),i.createBlock(i.unref(z.NSelect),{ref:"select-component",value:a.value,clearable:t.clearable,disabled:c.value.length===0,"consistent-menu-width":t.consistentMenuWidth,multiple:o.value,options:d.value,placeholder:"","onUpdate:value":h},null,8,["value","clearable","disabled","consistent-menu-width","multiple","options"]))}}),k2={class:"m-0.5 flex flex-col p-0.5"},v2={class:"flex flex-row gap-1"},C2={key:0},S2={key:1},B2={key:2},T2={key:3},$2={class:"flex flex-row gap-1"},N2={key:0},R2={key:1},P2={key:2},E2={key:3},F2={},qh=i.defineComponent({...F2,__name:"address-suggestion-label",props:{addr:{},selected:{type:Boolean}},setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock("div",k2,[i.createElementVNode("span",v2,[t.addr.postIndex?(i.openBlock(),i.createElementBlock("span",C2,i.toDisplayString(t.addr.postIndex)+", ",1)):i.createCommentVNode("",!0),t.addr.city?(i.openBlock(),i.createElementBlock("span",S2,i.toDisplayString(t.addr.city)+", ",1)):i.createCommentVNode("",!0),t.addr.locality?(i.openBlock(),i.createElementBlock("span",B2,i.toDisplayString(t.addr.locality)+", ",1)):i.createCommentVNode("",!0),t.addr.region?(i.openBlock(),i.createElementBlock("span",T2,i.toDisplayString(t.addr.region)+", ",1)):i.createCommentVNode("",!0)]),i.createElementVNode("span",$2,[t.addr.street?(i.openBlock(),i.createElementBlock("span",N2,i.toDisplayString(t.addr.street)+", ",1)):i.createCommentVNode("",!0),t.addr.building?(i.openBlock(),i.createElementBlock("span",R2,i.toDisplayString(t.addr.building)+", ",1)):i.createCommentVNode("",!0),t.addr.buildingPart?(i.openBlock(),i.createElementBlock("span",P2,i.toDisplayString(t.addr.buildingPart)+", ",1)):i.createCommentVNode("",!0),t.addr.apartments?(i.openBlock(),i.createElementBlock("span",E2,i.toDisplayString(t.addr.apartments)+", ",1)):i.createCommentVNode("",!0)])]))}}),Ba={clearable:!1,value:"",field:void 0,disabled:!1},V2={},I2=i.defineComponent({...V2,__name:"address-suggestion",props:i.mergeDefaults({disabled:{type:Boolean},value:{},clearable:{type:Boolean},field:{},minTermLength:{},searchDataHandler:{type:Function}},{...Ba,minTermLength:()=>{var t,e;return((e=(t=K.useBaseConfigStateStore().getConfig())==null?void 0:t.minLength)==null?void 0:e.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=I.debounce(()=>u(),800),u=async()=>{!o.value||o.value.length<r.minTermLength||(a.value=!0,l.value=await(r.searchDataHandler?r.searchDataHandler(o.value,a):K.HttpRequester.getInstance(K.DataSuggestionProvider).searchAddresses(o.value)).finally(()=>{a.value=!1}))},h=(p,y)=>{const b=l.value.find(_=>_.id===p.value)||{};return i.h(qh,{addr:b,selected:y},{default:I.constant("-")})},f=p=>{d.cancel();const y=l.value.find(b=>b.id===p)||{};s("select",y)},g=i.ref(null);function m(){g.value.focus()}return e({focus:m}),(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":h,placeholder:"",onSelect:f},null,8,["value","clearable","disabled","loading","options","onUpdate:value"])}}}),A2={class:"m-0.5 flex flex-col p-0.5"},M2={class:"font-medium"},O2={class:"flex flex-row gap-1 text-xs font-light text-blue-800"},z2={key:0},D2={key:1},L2={},Xh=i.defineComponent({...L2,__name:"bank-suggestion-label",props:{bank:{},selected:{type:Boolean}},setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock("div",A2,[i.createElementVNode("span",M2,i.toDisplayString(t.bank.name),1),i.createElementVNode("span",O2,[t.bank.bic?(i.openBlock(),i.createElementBlock("span",z2," БИК: "+i.toDisplayString(t.bank.bic),1)):i.createCommentVNode("",!0),t.bank.inn?(i.openBlock(),i.createElementBlock("span",D2," ИНН: "+i.toDisplayString(t.bank.inn),1)):i.createCommentVNode("",!0)])]))}}),H2={},W2=i.defineComponent({...H2,__name:"bank-suggestion",props:i.mergeDefaults({disabled:{type:Boolean},value:{},clearable:{type:Boolean},field:{},minTermLength:{}},{...Ba,minTermLength:()=>{var t,e;return((e=(t=K.useBaseConfigStateStore().getConfig())==null?void 0:t.minLength)==null?void 0:e.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=I.debounce(()=>u(),800),u=async()=>{if(!(!o.value||o.value.length<r.minTermLength)){a.value=!0;try{l.value=await K.HttpRequester.getInstance(K.DataSuggestionProvider).searchBank(o.value)}finally{a.value=!1}}},h=(p,y)=>{const b=l.value.find(_=>_.id===p.value)||{};return i.h(Xh,{bank:b,selected:y},{default:I.constant("-")})},f=p=>{d.cancel();const y=l.value.find(b=>b.id===p)||{};s("select",y)},g=i.ref(null);function m(){g.value.focus()}return e({focus:m}),(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":h,placeholder:"",onSelect:f},null,8,["value","clearable","disabled","loading","options","onUpdate:value"])}}}),j2={class:"font-medium"},q2={key:0,class:"flex flex-row gap-2"},X2={key:0,class:"text-xs font-light text-blue-800"},Y2={key:1,class:"text-sc-dark-grey text-xs font-light"},U2={},Yh=i.defineComponent({...U2,__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",j2,i.toDisplayString(t.org.name),1),t.org.inn||r.value?(i.openBlock(),i.createElementBlock("div",q2,[t.org.inn?(i.openBlock(),i.createElementBlock("span",X2,i.toDisplayString(t.org.inn),1)):i.createCommentVNode("",!0),r.value?(i.openBlock(),i.createElementBlock("span",Y2,i.toDisplayString(r.value),1)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)],2))}}),K2={},G2=i.defineComponent({...K2,__name:"org-suggestion",props:i.mergeDefaults({disabled:{type:Boolean},value:{},clearable:{type:Boolean},field:{},minTermLength:{},allowSelectTerminated:{type:Boolean}},{...Ba,minTermLength:()=>{var t,e;return((e=(t=K.useBaseConfigStateStore().getConfig())==null?void 0:t.minLength)==null?void 0:e.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(()=>Vt.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 u=I.debounce(()=>h(),800),h=async()=>{if(!(!o.value||o.value.length<r.minTermLength)){a.value=!0;try{l.value=await K.HttpRequester.getInstance(K.DataSuggestionProvider).searchOrganization(o.value)}finally{a.value=!1}}},f=(y,b)=>{const _=l.value.find(B=>B.id===y.value)||{};return i.h(Yh,{org:_,selected:b},{default:I.constant("-")})},g=y=>{u.cancel();const b=l.value.find(_=>_.id===y)||{};(r.allowSelectTerminated||!c(b))&&s("select",b)},m=i.ref(null);function p(){m.value.focus()}return e({focus:p}),(y,b)=>{const _=z.NAutoComplete;return i.openBlock(),i.createBlock(_,{ref_key:"autoCompleteElement",ref:m,value:o.value,"onUpdate:value":[b[0]||(b[0]=B=>o.value=B),i.unref(u)],clearable:t.clearable,disabled:t.disabled,loading:a.value,options:d.value,"render-label":f,placeholder:"",onSelect:g},null,8,["value","clearable","disabled","loading","options","onUpdate:value"])}}}),Z2={},Q2=i.defineComponent({...Z2,__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,u=z.NPopover,h=z.NModal;return i.openBlock(),i.createElementBlock("div",null,[i.createVNode(u,{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(h,{show:s.value,"onUpdate:show":c[1]||(c[1]=f=>s.value=f),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]=f=>s.value=!1)},{default:i.withCtx(()=>[...c[3]||(c[3]=[i.createTextVNode(" Отмена ",-1)])]),_:1})]),_:1},8,["show","content","title"])])}}}),J2={key:0,class:"whitespace-pre-line"},eS={key:1,class:"text-sc-dark-grey"},tS={},nS=i.defineComponent({...tS,__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(Ud,{disabled:t.disabled,"onEditor:apply":o,"onEditor:cancel":a},{viewer:i.withCtx(()=>[i.createElementVNode("div",null,[t.comment?(i.openBlock(),i.createElementBlock("span",J2,i.toDisplayString(t.comment),1)):(i.openBlock(),i.createElementBlock("span",eS," - Комментарий отсутствует - "))])]),editor:i.withCtx(()=>[i.createVNode(d,{value:s.value,"onUpdate:value":c[0]||(c[0]=u=>s.value=u),clearable:!0,type:"textarea"},null,8,["value"])]),_:1},8,["disabled"])}}}),iS={},rS=i.defineComponent({...iS,__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)=>t.debt!==0?(i.openBlock(),i.createElementBlock("span",{key:0,class:i.normalizeClass({"text-sm":t.wrapAsSmall})},[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)],2)):i.createCommentVNode("",!0)}}),sS={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function oS(t,e){return i.openBlock(),i.createElementBlock("svg",sS,[...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 aS=i.markRaw({name:"ion-warning",render:oS}),lS={},cS=i.defineComponent({...lS,__name:"warning-icon",props:{popoverText:{default:""},iconClass:{default:"text-sc-warning"}},setup(t){return(e,n)=>{const r=aS,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"])}}}),vt=class vt{static init(e,n){vt.messagesService&&vt.notificationsService||(vt.messagesService=e,vt.notificationsService=n)}static getMessagesService(){if(!vt.messagesService)throw new Error("UI provider is not initialized.");return vt.messagesService}static getNotificationsService(){if(!vt.notificationsService)throw new Error("UI provider is not initialized.");return vt.notificationsService}static showNotificationsForErrorResponseData(e,n={}){var r,s;if(I.isEmpty(e.errors)){const o=(s=(r=e.rawError)==null?void 0:r.config)==null?void 0:s.url,a=o?` [ ${o} ]`:"";vt.notificationsService?vt.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 K.FieldValidationResultData(e.errors[o].toString(),"error"):vt.messagesService?vt.messagesService.error(e.errors[o].toString()):console.log("Show notification error response data: UI provider is not initialized.",e.errors[o])}};S(vt,"messagesService"),S(vt,"notificationsService");let Ta=vt;const dS=i.computed(()=>K.useReferencesStore().deliveryTypeReference??[]),uS=i.computed(()=>K.useReferencesStore().managersList??[]),hS=i.computed(()=>K.useReferencesStore().opfReference??[]),fS=i.computed(()=>K.useReferencesStore().partnerGroupsReference??[]),mS=i.computed(()=>K.useReferencesStore().priceCoefficientsReference??[]),gS=i.computed(()=>K.useReferencesStore().productFilesTypesReference??[]),pS=i.computed(()=>K.useReferencesStore().resourceTypesReference),yS=i.computed(()=>K.useReferencesStore().salesDirectionsReference??[]),bS=i.computed(()=>K.useReferencesStore().warehousesReference??[]),_S=i.computed(()=>K.useReferencesStore().paymentTypeReference??[]),wS=i.computed(()=>K.useReferencesStore().orderStatusReference??[]),xS=i.computed(()=>K.useReferencesStore().operatorReference??[]),kS=i.computed(()=>Vt.convertReferencesToSelectOptionsList(K.useReferencesStore().channelPrimaryInterestsReference??[],!0,!1,!0)),vS=i.computed(()=>Vt.convertReferencesToSelectOptionsList(K.useReferencesStore().sourcePrimaryInterestsReference??[],!0,!1,!0)),CS=t=>K.HttpRequester.getInstance(K.ReferenceDataProvider).searchCity(t),SS=t=>Vt.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()),BS=t=>K.HttpRequester.getInstance(K.ClientDataProvider).searchClient(t),TS=t=>Vt.convertReferencesToSelectOptionsList(t,!0,!1,!1,e=>e.isNewRec()?"-":[e.name,e.salesDirection.name?`(${e.salesDirection.name})`:void 0,e.city.name?`г. ${e.city.name}${e.city.region.name?`, ${e.city.region.name}`:""}`:void 0,e.isActive?void 0:"[ Деактивирован ]"].filter(Boolean).join(" "),e=>e==null?void 0:e.isNewRec());X.AddProductToCartDialog=Tb,X.ConfiguratorSettingsKozyrek=wd,X.ConfiguratorSettingsMosquito=V_,X.ContentHelper=ai,X.KozyrekLine=bn,X.KozyrekTailTemplate=zo,X.KozyrekTemplate=Ui,X.OrdersTableFields=Ee,X.Point=Oo,X.ScAddressSuggestion=I2,X.ScAddressSuggestionLabel=qh,X.ScBankSuggestion=W2,X.ScBankSuggestionLabel=Xh,X.ScBaseDialog=Hd,X.ScButtonWithConfirmAction=Q2,X.ScCategoryCollapse=Dd,X.ScClientNameWithShortInfo=pr,X.ScCollapse=zd,X.ScCollapseItem=Qa,X.ScCommentEditor=nS,X.ScConfiguratorsProductInfo=cr,X.ScContragentWithShortInfo=Wd,X.ScCreatorUserTypeTag=Ca,X.ScCuratorSelect=_2,X.ScDateRange=D_,X.ScDateTimeLabel=fs,X.ScDebouncedInput=f1,X.ScDebouncedInputNumber=g1,X.ScDebt=rS,X.ScDialogHeader=U_,X.ScDynamicConfigurator=Ad,X.ScEmail=Wb,X.ScExternalLink=S1,X.ScImageGallery=il,X.ScInlineEditableItem=Ud,X.ScInlineView=Lo,X.ScKozyrekConfigurator=xd,X.ScKozyrekConfiguratorParamsForm=sl,X.ScKozyrekConfiguratorPreview=_d,X.ScKozyrekConfiguratorTemplates=bd,X.ScLightGallery=nl,X.ScManagerSelect=x2,X.ScMetalForDoorsConfigurator=Rd,X.ScMetalForDoorsConfiguratorForm=Nd,X.ScMosquitoConfigurator=Cd,X.ScMosquitoConfiguratorForm=kd,X.ScMosquitoConfiguratorMeasurementInstructions=vd,X.ScMosquitoConfiguratorPreview=Do,X.ScOrderCommonInfo=Oh,X.ScOrderDeliveryLabel=Vs,X.ScOrderDetails=Lh,X.ScOrderInfo=Hh,X.ScOrderItemsList=Dh,X.ScOrderPayment=va,X.ScOrderProductInfo=zh,X.ScOrdersList=ZC,X.ScOrgSuggestion=G2,X.ScOrgSuggestionLabel=Yh,X.ScPage=Wh,X.ScPageWithSlidingPanel=y2,X.ScPersonContactsBlock=F_,X.ScPhone=f_,X.ScPhoneInput=b1,X.ScProductName=lr,X.ScProductsList=Jv,X.ScReferenceSelect=Ld,X.ScSandwichConfigurator=Fd,X.ScSandwichConfiguratorForm=Ed,X.ScSandwichM2Configurator=Id,X.ScSandwichM2ConfiguratorForm=Vd,X.ScSearchableProductSelect=Mh,X.ScSearchableReferenceSelect=Ah,X.ScSetClientPriceFormItem=xb,X.ScShortTextOrderInfo=t2,X.ScSingleFileUploadSelector=J_,X.ScSlidingContentWithDrawer=jh,X.ScStripConfigurator=$d,X.ScStripConfiguratorForm=Bd,X.ScStripConfiguratorLineItem=Sd,X.ScStripConfiguratorPreview=Td,X.ScUserShortInfo=Sa,X.ScWarningIcon=cS,X.SelectOptionHelper=Vt,X.UiNotificationProvider=Ta,X.WindowResolutionEnum=Qe,X.WindowResolutionProvider=St,X.channelPrimaryInterestOptionsList=kS,X.componentSizeInjectionKey=or,X.deliveryTypeReferenceList=dS,X.handleFloatInput=Ds,X.handleIntegerInput=tt,X.isCanSandwichM2Show=I_,X.isCanSandwichShow=Od,X.isConfiguratorType=Md,X.managersReferenceList=uS,X.naiveUiTheme=zf,X.operatorReferenceList=xS,X.opfReferenceList=hS,X.orderStatusReferenceList=wS,X.parse=lt,X.partnerGroupReferenceList=fS,X.paymentTypeReferenceList=_S,X.priceCoefficientsReferenceList=mS,X.productFilesTypesReferenceList=gS,X.renderConfig=je,X.resetInputValidation=et,X.resourceReferencesList=pS,X.salesDirectionsReferenceList=yS,X.searchCityReferenceDataHandler=CS,X.searchCityReferenceLabelRenderer=SS,X.searchClientReferenceDataHandler=BS,X.searchClientReferenceLabelRenderer=TS,X.selectAllTextOnFocus=Le,X.sourcePrimaryInterestOptionsList=vS,X.vFocusNext=Ua,X.warehousesReferenceList=bS,Object.defineProperty(X,Symbol.toStringTag,{value:"Module"})}));
|