@snabcentr/vue-ui-lib 2.17.1 → 2.17.2
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 +2 -2
- package/dist/release_notes.tmp +4 -2
- package/dist/sc-vue-ui-lib.css +1 -1
- package/dist/sc-vue-ui-lib.js +516 -506
- package/dist/sc-vue-ui-lib.js.map +1 -1
- package/dist/sc-vue-ui-lib.umd.cjs +2 -2
- package/dist/sc-vue-ui-lib.umd.cjs.map +1 -1
- package/dist/src/components/configurators/metal-for-doors/metal-for-doors-configurator-form.vue.d.ts +2077 -2031
- package/dist/src/components/configurators/strip/strip-configurator-line-item.vue.d.ts +2077 -2032
- package/dist/src/components/inputs/debounced-input-number.vue.d.ts +9 -2
- package/dist/src/components/inputs/debounced-input.vue.d.ts +9 -2
- package/package.json +1 -1
@@ -100,7 +100,7 @@
|
|
100
100
|
}
|
101
101
|
gl_FragColor = texel;
|
102
102
|
}
|
103
|
-
`}},Wr=Xn.Multiply,Qg=[1,0,0,0,1,0,0,0,1],Nn=new Yt(9),em=lt.Utils,Il=new Z,js=new Yt([0,0,1,0,0,1,0,1,1,0,1,1]),ye={precision:.9,isHidden:/(undefined|none|transparent)/i,canvas:He.document?He.document.createElement("canvas"):{getContext:function(){}},alignments:{left:"start",middle:"center",right:"end"},matrix:new Xn,group:{removeChild:function(e,t){if(e.children)for(let n=0;n<e.children.length;n++)ye.group.removeChild(e.children[n],t);e._renderer.texture&&(t.deleteTexture(e._renderer.texture),delete e._renderer.texture),e._renderer.positionBuffer&&(t.deleteBuffer(e._renderer.positionBuffer),delete e._renderer.positionBuffer)},render:function(e,t){if(!this._visible)return;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 Yt(9)),this._matrix.toTransformArray(!0,Nn),Wr(Nn,n._renderer.matrix,this._renderer.matrix),this._renderer.scale instanceof Z||(this._renderer.scale=new Z),this._scale instanceof Z?(this._renderer.scale.x=this._scale.x,this._renderer.scale.y=this._scale.y):(this._renderer.scale.x=this._scale,this._renderer.scale.y=this._scale),/renderer/i.test(n._renderer.type)||(this._renderer.scale.x*=n._renderer.scale.x,this._renderer.scale.y*=n._renderer.scale.y),r&&(this._flagMatrix=!0)),this._mask){e.clear(e.STENCIL_BUFFER_BIT),e.enable(e.STENCIL_TEST),e.stencilFunc(e.ALWAYS,1,0),e.stencilOp(e.KEEP,e.KEEP,e.REPLACE),e.colorMask(!1,!1,!1,!1);const a=lt.Utils.getRendererType(this._mask._renderer.type);ye[a].render.call(this._mask,e,t,this),e.stencilFunc(e.EQUAL,1,255),e.stencilOp(e.KEEP,e.KEEP,e.KEEP),e.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++)ye.group.removeChild(this.subtractions[o],e);for(o=0;o<this.children.length;o++){const a=this.children[o],l=lt.Utils.getRendererType(a._renderer.type);ye[l].render.call(a,e,t)}return this._mask&&e.disable(e.STENCIL_TEST),this.flagReset()}},path:{updateCanvas:function(e,t){let n,r,s,o,a,l,c,d,h,u,f,p,g,m;const _=t._renderer.vertices,y=this.canvas,b=this.ctx,S=e.renderer.ratio,x=Il.copy(t._renderer.scale).multiply(S),C=t._stroke,B=t._linewidth,v=t._fill,$=t._renderer.opacity||t._opacity,F=t._cap,R=t._join,X=t._miter,M=t._closed,N=t.dashes,A=_.length,L=A-1;y.width=Math.max(Math.ceil(t._renderer.rect.width*x.x),1),y.height=Math.max(Math.ceil(t._renderer.rect.height*x.y),1);const U=t._renderer.rect.centroid,P=U.x,E=U.y;if(b.clearRect(0,0,y.width,y.height),v)if(typeof v=="string")b.fillStyle=v;else{const ge=lt.Utils.getRendererType(v._renderer.type);ye[ge].render.call(v,b,t),b.fillStyle=v._renderer.effect}if(C){if(typeof C=="string")b.strokeStyle=C;else{const ge=lt.Utils.getRendererType(C._renderer.type);ye[ge].render.call(C,b,t),b.strokeStyle=C._renderer.effect}B&&(b.lineWidth=B),X&&(b.miterLimit=X),R&&(b.lineJoin=R),!M&&F&&(b.lineCap=F)}typeof $=="number"&&(b.globalAlpha=$),N&&N.length>0&&(b.lineDashOffset=N.offset||0,b.setLineDash(N));let H,I,G,O,z,J,pe,re;b.save(),b.scale(x.x,x.y),b.translate(P,E),b.beginPath();for(let ge=0;ge<_.length;ge++){const ie=_[ge];switch(p=ie.x,g=ie.y,ie.command){case ee.close:b.closePath();break;case ee.arc:I=ie.rx,G=ie.ry,O=ie.xAxisRotation,z=ie.largeArcFlag,J=ie.sweepFlag,n=M?$t(ge-1,A):Math.max(ge-1,0),r=_[n],pe=r.x,re=r.y,em.renderSvgArcCommand(b,pe,re,I,G,z,J,O,p,g);break;case ee.curve:n=M?$t(ge-1,A):Math.max(ge-1,0),r=_[n],d=r.controls&&r.controls.right||Z.zero,h=ie.controls&&ie.controls.left||Z.zero,r._relative?(l=d.x+r.x,c=d.y+r.y):(l=d.x,c=d.y),ie._relative?(o=h.x+ie.x,a=h.y+ie.y):(o=h.x,a=h.y),b.bezierCurveTo(l,c,o,a,p,g),ge>=L&&M&&(s=H,u=ie.controls&&ie.controls.right||Z.zero,f=s.controls&&s.controls.left||Z.zero,ie._relative?(l=u.x+ie.x,c=u.y+ie.y):(l=u.x,c=u.y),s._relative?(o=f.x+s.x,a=f.y+s.y):(o=f.x,a=f.y),p=s.x,g=s.y,b.bezierCurveTo(l,c,o,a,p,g));break;case ee.line:b.lineTo(p,g);break;case ee.move:H=ie,b.moveTo(p,g);break}}M&&b.closePath(),ye.isHidden.test(v)||(m=v._renderer&&v._renderer.offset,m&&(b.save(),b.translate(-v._renderer.offset.x,-v._renderer.offset.y),b.scale(v._renderer.scale.x,v._renderer.scale.y)),b.fill(),m&&b.restore()),ye.isHidden.test(C)||(m=C._renderer&&C._renderer.offset,m&&(b.save(),b.translate(-C._renderer.offset.x,-C._renderer.offset.y),b.scale(C._renderer.scale.x,C._renderer.scale.y),b.lineWidth=B/C._renderer.scale.x),b.stroke(),m&&b.restore()),b.restore()},getBoundingClientRect:function(e,t,n){let r=1/0,s=-1/0,o=1/0,a=-1/0,l,c;e.forEach(function(d){const h=d.x,u=d.y,f=d.controls;let p,g,m,_,y,b;o=Math.min(u,o),r=Math.min(h,r),s=Math.max(h,s),a=Math.max(u,a),d.controls&&(y=f.left,b=f.right,!(!y||!b)&&(p=d._relative?y.x+h:y.x,g=d._relative?y.y+u:y.y,m=d._relative?b.x+h:b.x,_=d._relative?b.y+u:b.y,!(!p||!g||!m||!_)&&(o=Math.min(g,_,o),r=Math.min(p,m,r),s=Math.max(p,m,s),a=Math.max(g,_,a))))}),typeof t=="number"&&(o-=t,r-=t,s+=t,a+=t),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(e,t,n){if(!this._visible||!this._opacity)return this;this._update();const r=n||this.parent,s=lt.Utils.getRendererType(this._renderer.type),o=t[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 Oe&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagEndPoints)||this._fill instanceof Ve&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagRadius||this._fill._flagCenter||this._fill._flagFocal)||this._fill instanceof Ee&&(this._fill._flagLoaded&&this._fill.loaded||this._fill._flagImage||this._fill._flagVideo||this._fill._flagRepeat||this._fill._flagOffset||this._fill._flagScale)||this._stroke instanceof Oe&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagEndPoints)||this._stroke instanceof Ve&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagRadius||this._stroke._flagCenter||this._stroke._flagFocal)||this._stroke instanceof Ee&&(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 Yt(9)),this._matrix.toTransformArray(!0,Nn),Wr(Nn,r._renderer.matrix,this._renderer.matrix),this._renderer.scale instanceof Z||(this._renderer.scale=new Z);let u,f;this._scale instanceof Z?(u=this._scale.x*r._renderer.scale.x,f=this._scale.y*r._renderer.scale.y):(u=this._scale*r._renderer.scale.x,f=this._scale*r._renderer.scale.y),this._renderer.scale.x=u<0?-u:u,this._renderer.scale.y=f<0?-f:f,c&&(this._renderer.parent=r)}if(this._mask){e.clear(e.STENCIL_BUFFER_BIT),e.enable(e.STENCIL_TEST),e.stencilFunc(e.ALWAYS,1,0),e.stencilOp(e.KEEP,e.KEEP,e.REPLACE),e.colorMask(!1,!1,!1,!1);const u=lt.Utils.getRendererType(this._mask._renderer.type);ye[u].render.call(this._mask,e,t,this),e.stencilFunc(e.EQUAL,1,255),e.stencilOp(e.KEEP,e.KEEP,e.KEEP),e.colorMask(!0,!0,!0,!0)}if(d?(this._renderer.rect||(this._renderer.rect={}),this._renderer.opacity=this._opacity*r._renderer.opacity,ye.path.getBoundingClientRect(this._renderer.vertices,this._linewidth,this._renderer.rect),ye.updateTexture.call(ye,e,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;t.current!==o&&(e.useProgram(o),e.bindBuffer(e.ARRAY_BUFFER,t.buffers.position),e.vertexAttribPointer(o.position,2,e.FLOAT,!1,0,0),e.enableVertexAttribArray(o.position),e.bufferData(e.ARRAY_BUFFER,js,e.STATIC_DRAW),t.resolution.flagged||e.uniform2f(e.getUniformLocation(o,"u_resolution"),t.resolution.width,t.resolution.height),t.current=o),t.resolution.flagged&&e.uniform2f(e.getUniformLocation(o,"u_resolution"),t.resolution.width,t.resolution.height),e.bindTexture(e.TEXTURE_2D,this._renderer.texture);const h=this._renderer.rect;return e.uniformMatrix3fv(o.matrix,!1,this._renderer.matrix),e.uniform4f(o.rect,h.left,h.top,h.right,h.bottom),e.drawArrays(e.TRIANGLES,0,6),this._mask&&e.disable(e.STENCIL_TEST),this.flagReset()}},points:{updateCanvas:function(e,t){let n;const r=this.canvas,s=this.ctx,o=e.renderer.ratio,a=t._stroke,l=t._linewidth,c=t._fill,d=t._renderer.opacity||t._opacity,h=t.dashes,u=t._size*o;let f=u;ye.isHidden.test(a)||(f+=l),r.width=Da(f),r.height=r.width;const p=f/r.width,g=r.width/2,m=r.height/2;if(s.clearRect(0,0,r.width,r.height),c)if(typeof c=="string")s.fillStyle=c;else{const _=lt.Utils.getRendererType(c._renderer.type);ye[_].render.call(c,s,t),s.fillStyle=c._renderer.effect}if(a){if(typeof a=="string")s.strokeStyle=a;else{const _=lt.Utils.getRendererType(a._renderer.type);ye[_].render.call(a,s,t),s.strokeStyle=a._renderer.effect}l&&(s.lineWidth=l/p)}typeof d=="number"&&(s.globalAlpha=d),h&&h.length>0&&(s.lineDashOffset=h.offset||0,s.setLineDash(h)),s.save(),s.translate(g,m),s.scale(ye.precision,ye.precision),s.beginPath(),s.arc(0,0,u/p*.5,0,ot),s.restore(),closed&&s.closePath(),ye.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()),ye.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(e,t,n){if(!this._visible||!this._opacity)return this;this._update();let r=this._size;const s=n||this.parent,o=t[this._renderer.type],a=this._sizeAttenuation,l=this._stroke,c=this._linewidth,d=s._matrix.manual||s._flagMatrix,h=this._matrix.manual||this._flagMatrix,u=this._renderer.parent!==s,f=this._renderer.vertices,p=this._renderer.collection.length,g=this._flagVertices,m=this._flagFill||this._fill instanceof Oe&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagEndPoints)||this._fill instanceof Ve&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagRadius||this._fill._flagCenter||this._fill._flagFocal)||this._fill instanceof Ee&&(this._fill._flagLoaded&&this._fill.loaded||this._fill._flagImage||this._fill._flagVideo||this._fill._flagRepeat||this._fill._flagOffset||this._fill._flagScale)||this._stroke instanceof Oe&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagEndPoints)||this._stroke instanceof Ve&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagRadius||this._stroke._flagCenter||this._stroke._flagFocal)||this._stroke instanceof Ee&&(this._stroke._flagLoaded&&this._stroke.loaded||this._stroke._flagImage||this._stroke._flagVideo||this._stroke._flagRepeat||this._stroke._flagOffset||this._fill._flagScale)||this._flagStroke||this._flagLinewidth||this._flagOpacity||s._flagOpacity||this._flagVisible||this._flagScale||this.dashes&&this.dashes.length>0||!this._renderer.texture;if(d||h||u){this._renderer.matrix||(this._renderer.matrix=new Yt(9)),this._matrix.toTransformArray(!0,Nn),Wr(Nn,s._renderer.matrix,this._renderer.matrix),this._renderer.scale instanceof Z||(this._renderer.scale=new Z);let _,y;this._scale instanceof Z?(_=this._scale.x*s._renderer.scale.x,y=this._scale.y*s._renderer.scale.y):(_=this._scale*s._renderer.scale.x,y=this._scale*s._renderer.scale.y),this._renderer.scale.x=_<0?-_:_,this._renderer.scale.y=y<0?-y:y,u&&(this._renderer.parent=s)}if(g){const _=this._renderer.positionBuffer;_&&e.deleteBuffer(_),this._renderer.positionBuffer=e.createBuffer(),e.bindBuffer(e.ARRAY_BUFFER,this._renderer.positionBuffer),e.vertexAttribPointer(o.position,2,e.FLOAT,!1,0,0),e.enableVertexAttribArray(o.position),e.bufferData(e.ARRAY_BUFFER,f,e.STATIC_DRAW)}return m?(this._renderer.opacity=this._opacity*s._renderer.opacity,ye.updateTexture.call(ye,e,this)):(this._fill&&this._fill._update&&this._fill._update(),this._stroke&&this._stroke._update&&this._stroke._update()),this._clip&&!n||!this._renderer.texture?this:(ye.isHidden.test(l)||(r+=c),r/=ye.precision,a&&(r*=Math.max(this._renderer.scale.x,this._renderer.scale.y)),t.current!==o&&(e.useProgram(o),t.resolution.flagged||e.uniform2f(e.getUniformLocation(o,"u_resolution"),t.resolution.width,t.resolution.height),t.current=o),t.resolution.flagged&&e.uniform2f(e.getUniformLocation(o,"u_resolution"),t.resolution.width,t.resolution.height),e.bindTexture(e.TEXTURE_2D,this._renderer.texture),e.uniformMatrix3fv(o.matrix,!1,this._renderer.matrix),e.uniform1f(o.size,r*t.resolution.ratio),e.drawArrays(e.POINTS,0,p),this.flagReset())}},text:{updateCanvas:function(e,t){const n=this.canvas,r=this.ctx,s=e.renderer.ratio,o=Il.copy(t._renderer.scale).multiply(s),a=t._stroke,l=t._linewidth,c=t._fill,d=t._renderer.opacity||t._opacity,h=t.dashes,u=t._decoration,f=t._direction;n.width=Math.max(Math.ceil(t._renderer.rect.width*o.x),1),n.height=Math.max(Math.ceil(t._renderer.rect.height*o.y),1);const p=t._renderer.rect.centroid,g=p.x,m=p.y;let _,y,b,S,x,C,B,v,$,F,R;const X=c._renderer&&c._renderer.offset&&a._renderer&&a._renderer.offset;if(r.clearRect(0,0,n.width,n.height),X||(r.font=[t._style,t._weight,t._size+"px/"+t._leading+"px",t._family].join(" ")),r.textAlign="center",r.textBaseline="middle",r.textDirection=f,c)if(typeof c=="string")r.fillStyle=c;else{const M=lt.Utils.getRendererType(c._renderer.type);ye[M].render.call(c,r,t),r.fillStyle=c._renderer.effect}if(a){if(typeof a=="string")r.strokeStyle=a;else{const M=lt.Utils.getRendererType(a._renderer.type);ye[M].render.call(a,r,t),r.strokeStyle=a._renderer.effect}l&&(r.lineWidth=l)}if(typeof d=="number"&&(r.globalAlpha=d),h&&h.length>0&&(r.lineDashOffset=h.offset||0,r.setLineDash(h)),r.save(),r.scale(o.x,o.y),r.translate(g,m),ye.isHidden.test(c)||(c._renderer&&c._renderer.offset?(C=c._renderer.scale.x,B=c._renderer.scale.y,r.save(),r.translate(-c._renderer.offset.x,-c._renderer.offset.y),r.scale(C,B),_=t._size/c._renderer.scale.y,y=t._leading/c._renderer.scale.y,r.font=[t._style,t._weight,_+"px/",y+"px",t._family].join(" "),b=c._renderer.offset.x/c._renderer.scale.x,S=c._renderer.offset.y/c._renderer.scale.y,r.fillText(t.value,b,S),r.restore()):r.fillText(t.value,0,0)),ye.isHidden.test(a)||(a._renderer&&a._renderer.offset?(C=a._renderer.scale.x,B=a._renderer.scale.y,r.save(),r.translate(-a._renderer.offset.x,-a._renderer.offset.y),r.scale(C,B),_=t._size/a._renderer.scale.y,y=t._leading/a._renderer.scale.y,r.font=[t._style,t._weight,_+"px/",y+"px",t._family].join(" "),b=a._renderer.offset.x/a._renderer.scale.x,S=a._renderer.offset.y/a._renderer.scale.y,x=l/a._renderer.scale.x,r.lineWidth=x,r.strokeText(t.value,b,S),r.restore()):r.strokeText(t.value,0,0)),/(underline|strikethrough)/i.test(u)){const M=r.measureText(t.value);switch(u){case"underline":$=M.actualBoundingBoxDescent,R=M.actualBoundingBoxDescent;break;case"strikethrough":$=0,R=0;break}v=-M.width/2,F=M.width/2,r.lineWidth=Math.max(Math.floor(t._size/15),1),r.strokeStyle=r.fillStyle,r.beginPath(),r.moveTo(v,$),r.lineTo(F,R),r.stroke()}r.restore()},getBoundingClientRect:function(e,t){const n=ye.ctx;n.font=[e._style,e._weight,e._size+"px/"+e._leading+"px",e._family].join(" "),n.textAlign="center",n.textBaseline=lt.Utils.baselines[e._baseline]||e._baseline;const r=n.measureText(e._value);let s=r.width,o=1.15*(r.actualBoundingBoxAscent+r.actualBoundingBoxDescent);this._linewidth&&!ye.isHidden.test(this._stroke)&&(s+=this._linewidth*2,o+=this._linewidth*2);const a=s/2,l=o/2;switch(ye.alignments[e._alignment]||e._alignment){case ye.alignments.left:e.direction==="ltr"?(t.left=0,t.right=s):(t.left=-s,t.right=0);break;case ye.alignments.right:e.direction==="ltr"?(t.left=-s,t.right=0):(t.left=0,t.right=s);break;default:t.left=-a,t.right=a}switch(e._baseline){case"bottom":t.top=-o,t.bottom=0;break;case"top":t.top=0,t.bottom=o;break;case"baseline":t.top=-l*1.5,t.bottom=l*.5;break;default:t.top=-l,t.bottom=l}t.width=s,t.height=o,t.centroid||(t.centroid={}),t.centroid.x=a,t.centroid.y=l},render:function(e,t,n){if(!this._visible||!this._opacity)return this;this._update();const r=n||this.parent,s=t[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 Oe&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagEndPoints)||this._fill instanceof Ve&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagRadius||this._fill._flagCenter||this._fill._flagFocal)||this._fill instanceof Ee&&(this._fill._flagLoaded&&this._fill.loaded||this._fill._flagImage||this._fill._flagVideo||this._fill._flagRepeat||this._fill._flagOffset||this._fill._flagScale)||this._stroke instanceof Oe&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagEndPoints)||this._stroke instanceof Ve&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagRadius||this._stroke._flagCenter||this._stroke._flagFocal)||this._stroke instanceof Ee&&(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 Yt(9)),this._matrix.toTransformArray(!0,Nn),Wr(Nn,r._renderer.matrix,this._renderer.matrix),this._renderer.scale instanceof Z||(this._renderer.scale=new Z);let h,u;this._scale instanceof Z?(h=this._scale.x*r._renderer.scale.x,u=this._scale.y*r._renderer.scale.y):(h=this._scale*r._renderer.scale.x,u=this._scale*r._renderer.scale.y),this._renderer.scale.x=h<0?-h:h,this._renderer.scale.y=u<0?-u:u,l&&(this._renderer.parent=r)}if(this._mask){e.clear(e.STENCIL_BUFFER_BIT),e.enable(e.STENCIL_TEST),e.stencilFunc(e.ALWAYS,1,0),e.stencilOp(e.KEEP,e.KEEP,e.REPLACE),e.colorMask(!1,!1,!1,!1);const h=lt.Utils.getRendererType(this._mask._renderer.type);ye[h].render.call(this._mask,e,t,this),e.stencilFunc(e.EQUAL,1,255),e.stencilOp(e.KEEP,e.KEEP,e.KEEP),e.colorMask(!0,!0,!0,!0)}if(c?(this._renderer.rect||(this._renderer.rect={}),this._renderer.opacity=this._opacity*r._renderer.opacity,ye.text.getBoundingClientRect(this,this._renderer.rect),ye.updateTexture.call(ye,e,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;t.current!==s&&(e.useProgram(s),e.bindBuffer(e.ARRAY_BUFFER,t.buffers.position),e.vertexAttribPointer(s.position,2,e.FLOAT,!1,0,0),e.enableVertexAttribArray(s.position),e.bufferData(e.ARRAY_BUFFER,js,e.STATIC_DRAW),t.resolution.flagged||e.uniform2f(e.getUniformLocation(s,"u_resolution"),t.resolution.width,t.resolution.height),t.current=s),t.resolution.flagged&&e.uniform2f(e.getUniformLocation(s,"u_resolution"),t.resolution.width,t.resolution.height),e.bindTexture(e.TEXTURE_2D,this._renderer.texture);const d=this._renderer.rect;return e.uniformMatrix3fv(s.matrix,!1,this._renderer.matrix),e.uniform4f(s.rect,d.left,d.top,d.right,d.bottom),e.drawArrays(e.TRIANGLES,0,6),this._mask&&e.disable(e.STENCIL_TEST),this.flagReset()}},"linear-gradient":{render:function(e,t){if(!(!e.canvas.getContext("2d")||!t)){if(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=t.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=e.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 this.flagReset()}}},"radial-gradient":{render:function(e,t){if(!(!e.canvas.getContext("2d")||!t)){if(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=t.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=e.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 this.flagReset()}}},texture:{render:function(e,t){if(!e.canvas.getContext("2d"))return;this._update();const n=this.image;if((this._flagLoaded||this._flagImage||this._flagVideo||this._flagRepeat)&&this.loaded)this._renderer.effect=e.createPattern(n,this._repeat);else if(!this._renderer.effect)return this.flagReset();if((this._flagOffset||this._flagLoaded||this._flagScale)&&(this._renderer.offset instanceof Z||(this._renderer.offset=new Z),this._renderer.offset.x=-this._offset.x,this._renderer.offset.y=-this._offset.y,n&&(this._renderer.offset.x+=n.width/2,this._renderer.offset.y+=n.height/2,this._scale instanceof Z?(this._renderer.offset.x*=this._scale.x,this._renderer.offset.y*=this._scale.y):(this._renderer.offset.x*=this._scale,this._renderer.offset.y*=this._scale))),this._flagScale||this._flagLoaded){this._renderer.scale instanceof Z||(this._renderer.scale=new Z);let r,s;this._scale instanceof Z?(r=this._scale.x,s=this._scale.y):(r=this._scale,s=this._scale),this._renderer.scale.x=r<0?-r:r,this._renderer.scale.y=s<0?-s:s}return this.flagReset()}},updateTexture:function(e,t){const n=lt.Utils.getRendererType(t._renderer.type);if(this[n].updateCanvas.call(ye,e,t),this.canvas.width<=0||this.canvas.height<=0){t._renderer.texture&&e.deleteTexture(t._renderer.texture),delete t._renderer.texture;return}t._renderer.texture||(t._renderer.texture=e.createTexture()),e.bindTexture(e.TEXTURE_2D,t._renderer.texture),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,this.canvas),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR)},program:{create:function(e,t){let n,r,s;if(n=e.createProgram(),ae.each(t,function(o){e.attachShader(n,o)}),e.linkProgram(n),r=e.getProgramParameter(n,e.LINK_STATUS),!r)throw s=e.getProgramInfoLog(n),e.deleteProgram(n),new Ct("unable to link program: "+s);return n}},extensions:{init:function(e){const t={},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];t[s]=ye.extensions.get(e,s)}return t},get:function(e,t){return e.getExtension(t)||e.getExtension(`MOZ_${t}`)||e.getExtension(`WEBKIT_${t}`)}},TextureRegistry:new Tr};ye.ctx=ye.canvas.getContext("2d");var Ll=class extends j{constructor(e){super();let t,n,r,s;if(this.domElement=e.domElement||document.createElement("canvas"),typeof e.offscreenElement<"u"&&(ye.canvas=e.offscreenElement,ye.ctx=ye.canvas.getContext("2d")),this.scene=new Ge,this.scene.parent=this,this._renderer={type:"renderer",matrix:new Yt(Qg),scale:1,opacity:1},this._flagMatrix=!0,e=ae.defaults(e||{},{antialias:!1,alpha:!0,premultipliedAlpha:!0,stencil:!0,preserveDrawingBuffer:!0,overdraw:!1}),this.overdraw=e.overdraw,t=this.ctx=this.domElement.getContext("webgl",e)||this.domElement.getContext("experimental-webgl",e),!this.ctx)throw new Ct("unable to create a webgl context. Try using another renderer.");r=Vt.create(t,Vt.path.vertex,Vt.types.vertex),s=Vt.create(t,Vt.path.fragment,Vt.types.fragment),this.programs={current:null,buffers:{position:t.createBuffer()},resolution:{width:0,height:0,ratio:1,flagged:!1}},n=this.programs.path=ye.program.create(t,[r,s]),this.programs.text=this.programs.path,t.extensions=ye.extensions.init(t),t.renderer=this,n.position=t.getAttribLocation(n,"a_position"),n.matrix=t.getUniformLocation(n,"u_matrix"),n.rect=t.getUniformLocation(n,"u_rect");const o=t.createBuffer();t.bindBuffer(t.ARRAY_BUFFER,o),t.vertexAttribPointer(n.position,2,t.FLOAT,!1,0,0),t.enableVertexAttribArray(n.position),t.bufferData(t.ARRAY_BUFFER,js,t.STATIC_DRAW),r=Vt.create(t,Vt.points.vertex,Vt.types.vertex),s=Vt.create(t,Vt.points.fragment,Vt.types.fragment),n=this.programs.points=ye.program.create(t,[r,s]),n.position=t.getAttribLocation(n,"a_position"),n.matrix=t.getUniformLocation(n,"u_matrix"),n.size=t.getUniformLocation(n,"u_size"),t.enable(t.BLEND),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0),t.blendEquation(t.FUNC_ADD),t.blendFunc(t.ONE,t.ONE_MINUS_SRC_ALPHA)}setSize(e,t,n){let r,s;const o=this.ctx;return this.width=e,this.height=t,this.ratio=typeof n>"u"?Rs(o):n,this.domElement.width=e*this.ratio,this.domElement.height=t*this.ratio,ae.isObject(this.domElement.style)&&ae.extend(this.domElement.style,{width:e+"px",height:t+"px"}),this._renderer.matrix[0]=this._renderer.matrix[4]=this._renderer.scale=this.ratio,this._flagMatrix=!0,r=e*this.ratio,s=t*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(j.Types.resize,e,t,n)}render(){const e=this.ctx;return this.overdraw||e.clear(e.COLOR_BUFFER_BIT),ye.group.render.call(this.scene,e,this.programs),this._flagMatrix=!1,this.programs.resolution.flagged=!0,this}};w(Ll,"Utils",ye);var tm=ae.extend({Error:Ct,getRatio:Rs,read:Le,xhr:Fl},ae,gt,Oa,Va),tr=class{constructor(e){w(this,"_events",new j),w(this,"type",""),w(this,"renderer",null),w(this,"scene",null),w(this,"width",0),w(this,"height",0),w(this,"frameCount",0),w(this,"timeDelta",0),w(this,"playing",!1);const t=ae.defaults(e||{},{fullscreen:!1,fitted:!1,width:640,height:480,type:tr.Types.svg,autostart:!1});if(ae.each(t,function(n,r){/fullscreen/i.test(r)||/autostart/i.test(r)||(this[r]=n)},this),ae.isElement(t.domElement)){const n=t.domElement.tagName.toLowerCase();/^(CanvasRenderer-canvas|WebGLRenderer-canvas|SVGRenderer-svg)$/.test(this.type+"-"+n)||(this.type=tr.Types[n])}this.renderer=new tr[this.type](this),this.setPlaying(t.autostart),this.frameCount=0,t.fullscreen?(this.fit=nm.bind(this),this.fit.domElement=window,this.fit.attached=!0,ae.extend(document.body.style,{overflow:"hidden",margin:0,padding:0,top:0,left:0,right:0,bottom:0,position:"fixed"}),ae.extend(this.renderer.domElement.style,{display:"block",top:0,left:0,right:0,bottom:0,position:"fixed"}),Nt.bind(this.fit.domElement,"resize",this.fit),this.fit()):t.fitted?(this.fit=im.bind(this),ae.extend(this.renderer.domElement.style,{display:"block"})):typeof t.width=="number"&&typeof t.height=="number"&&(this.renderer.setSize(t.width,t.height,this.ratio),this.width=t.width,this.height=t.height),this.renderer.bind(j.Types.resize,rm.bind(this)),this.scene=this.renderer.scene,tr.Instances.push(this),t.autostart&&nr.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,nr.init(),this.trigger(j.Types.play)}pause(){return this.playing=!1,this.trigger(j.Types.pause)}setPlaying(e){this.playing=e}release(e){let t,n,r;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)for(typeof e.vertices.unbind=="function"&&e.vertices.unbind(),t=0;t<e.vertices.length;t++)n=e.vertices[t],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());if(e.children){for(t=0;t<e.children.length;t++)r=e.children[t],this.release(r);typeof e.children.unbind=="function"&&e.children.unbind()}return e}update(){const e=!!this._lastFrame,t=ae.performance.now();e&&(this.timeDelta=parseFloat((t-this._lastFrame).toFixed(3))),this._lastFrame=t,this.fit&&this.fit.domElement&&!this.fit.attached&&(Nt.bind(this.fit.domElement,"resize",this.fit),this.fit.attached=!0,this.fit());const n=this.width,r=this.height,s=this.renderer;return(n!==s.width||r!==s.height)&&s.setSize(n,r,this.ratio),this.trigger(j.Types.update,this.frameCount,this.timeDelta),this.render()}render(){return this.renderer.render(),this.trigger(j.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,t,n,r){const s=new Ds(e,t,n,r);return this.scene.add(s),s}makeArrow(e,t,n,r,s){const o=typeof s=="number"?s:10,a=Math.atan2(r-t,n-e),l=[new ve(e,t,void 0,void 0,void 0,void 0,ee.move),new ve(n,r,void 0,void 0,void 0,void 0,ee.line),new ve(n-o*Math.cos(a-Math.PI/4),r-o*Math.sin(a-Math.PI/4),void 0,void 0,void 0,void 0,ee.line),new ve(n,r,void 0,void 0,void 0,void 0,ee.move),new ve(n-o*Math.cos(a+Math.PI/4),r-o*Math.sin(a+Math.PI/4),void 0,void 0,void 0,void 0,ee.line)],c=new Se(l,!1,!1,!0);return c.noFill(),c.cap="round",c.join="round",this.scene.add(c),c}makeRectangle(e,t,n,r){const s=new En(e,t,n,r);return this.scene.add(s),s}makeRoundedRectangle(e,t,n,r,s){const o=new Qi(e,t,n,r,s);return this.scene.add(o),o}makeCircle(e,t,n,r){const s=new Zi(e,t,n,r);return this.scene.add(s),s}makeEllipse(e,t,n,r,s){const o=new Ji(e,t,n,r,s);return this.scene.add(o),o}makeStar(e,t,n,r,s){const o=new Ar(e,t,n,r,s);return this.scene.add(o),o}makeCurve(e){const t=arguments.length;if(!Array.isArray(e)){e=[];for(let o=0;o<t;o+=2){const a=arguments[o];if(typeof a!="number")break;const l=arguments[o+1];e.push(new ve(a,l))}}const n=arguments[t-1],r=new Se(e,!(typeof n=="boolean"&&n),!0),s=r.getBoundingClientRect();return r.center().translation.set(s.left+s.width/2,s.top+s.height/2),this.scene.add(r),r}makePolygon(e,t,n,r){const s=new Mr(e,t,n,r);return this.scene.add(s),s}makeArcSegment(e,t,n,r,s,o,a){const l=new Rr(e,t,n,r,s,o,a);return this.scene.add(l),l}makePoints(e){const t=arguments.length;let n=e;if(!Array.isArray(e)){n=[];for(let s=0;s<t;s+=2){const o=arguments[s];if(typeof o!="number")break;const a=arguments[s+1];n.push(new Z(o,a))}}const r=new Fr(n);return this.scene.add(r),r}makePath(e){const t=arguments.length;let n=e;if(!Array.isArray(e)){n=[];for(let a=0;a<t;a+=2){const l=arguments[a];if(typeof l!="number")break;const c=arguments[a+1];n.push(new ve(l,c))}}const r=arguments[t-1],s=new Se(n,!(typeof r=="boolean"&&r)),o=s.getBoundingClientRect();return typeof o.top=="number"&&typeof o.left=="number"&&typeof o.right=="number"&&typeof o.bottom=="number"&&s.center().translation.set(o.left+o.width/2,o.top+o.height/2),this.scene.add(s),s}makeText(e,t,n,r){const s=new At(e,t,n,r);return this.add(s),s}makeLinearGradient(e,t,n,r){const s=Array.prototype.slice.call(arguments,4),o=new Oe(e,t,n,r,s);return this.add(o),o}makeRadialGradient(e,t,n){const r=Array.prototype.slice.call(arguments,3),s=new Ve(e,t,n,r);return this.add(s),s}makeSprite(e,t,n,r,s,o,a){const l=new Pr(e,t,n,r,s,o);return a&&l.play(),this.add(l),l}makeImageSequence(e,t,n,r,s){const o=new zr(e,t,n,r);return s&&o.play(),this.add(o),o}makeTexture(e,t){return new Ee(e,t)}makeGroup(e){e instanceof Array||(e=Array.prototype.slice.call(arguments));const t=new Ge;return this.scene.add(t),t.add(e),t}interpret(e,t,n){const r=e.tagName.toLowerCase();if(n=typeof n<"u"?n:!0,!(r in Le))return null;const s=Le[r].call(this,e);return n?this.add(t&&s instanceof Ge?s.children:s):s.parent&&s.remove(),s}load(e,t){const n=new Ge;let r,s,o;const a=(function(l){for(Nt.temp.innerHTML=l,s=0;s<Nt.temp.children.length;s++)r=Nt.temp.children[s],o=this.interpret(r,!1,!1),o!==null&&n.add(o);if(typeof t=="function"){const c=Nt.temp.children.length<=1?Nt.temp.children[0]:Nt.temp.children;t(n,c)}}).bind(this);return/\.svg$/i.test(e)?(Fl(e,a),n):(a(e),n)}},he=tr;w(he,"NextFrameId",mt.NextFrameId),w(he,"Types",mt.Types),w(he,"Version",mt.Version),w(he,"PublishDate",mt.PublishDate),w(he,"Identifier",mt.Identifier),w(he,"Resolution",mt.Resolution),w(he,"AutoCalculateImportedMatrices",mt.AutoCalculateImportedMatrices),w(he,"Instances",mt.Instances),w(he,"uniqueId",mt.uniqueId),w(he,"Anchor",ve),w(he,"Collection",Bn),w(he,"Events",j),w(he,"Group",Ge),w(he,"Matrix",Xn),w(he,"Path",Se),w(he,"Registry",Tr),w(he,"Element",Dn),w(he,"Shape",dn),w(he,"Text",At),w(he,"Vector",Z),w(he,"Gradient",Ye),w(he,"ImageSequence",zr),w(he,"LinearGradient",Oe),w(he,"RadialGradient",Ve),w(he,"Sprite",Pr),w(he,"Stop",Ut),w(he,"Texture",Ee),w(he,"ArcSegment",Rr),w(he,"Circle",Zi),w(he,"Ellipse",Ji),w(he,"Line",Ds),w(he,"Points",Fr),w(he,"Polygon",Mr),w(he,"Rectangle",En),w(he,"RoundedRectangle",Qi),w(he,"Star",Ar),w(he,"CanvasRenderer",lt),w(he,"SVGRenderer",zl),w(he,"WebGLRenderer",Ll),w(he,"Commands",ee),w(he,"Utils",tm);function nm(){const e=document.body.getBoundingClientRect(),t=this.width=e.width,n=this.height=e.height;this.renderer.setSize(t,n,this.ratio)}function im(){const e=this.renderer.domElement.parentElement;if(!e){console.warn("Two.js: Attempting to fit to parent, but no parent found.");return}const t=e.getBoundingClientRect(),n=this.width=t.width,r=this.height=t.height;this.renderer.setSize(n,r,this.ratio)}function rm(e,t){this.width=e,this.height=t,this.trigger(j.Types.resize,e,t)}var nr=Nt.getRequestAnimationFrame();function Dl(){for(let e=0;e<he.Instances.length;e++){const t=he.Instances[e];t.playing&&t.update()}he.NextFrameId=nr(Dl)}nr.init=function(){Dl(),nr.init=function(){}};let Kt;typeof window<"u"?Kt=window:typeof global<"u"?Kt=global:typeof self<"u"&&(Kt=self);let Hl;const Jn=Math.PI*2,tt=Math.PI*.5;function sm(e,t,n,r,s,o){let a;return arguments.length<=1?(a=e.a,t=e.b,n=e.c,r=e.d,s=e.e,o=e.f):a=e,{translateX:s,translateY:o,scaleX:Math.sqrt(a*a+t*t),scaleY:Math.sqrt(n*n+r*r),rotation:180*Math.atan2(t,a)/Math.PI}}function om(e){Hl=e}function am(e,t){t=t&&t.identity()||new Hl;let n=e;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;t.multiply(a[0],a[1],a[2],a[3],a[4],a[5],a[6],a[7],a[8],a[9])}return t}function Zt(e,t,n){return n*(t-e)+e}function Ti(e,t){for(;e<0;)e+=t;return e%t}const Wl=Kt.Float32Array||Array,lm=Math.floor;function Jt(e){return lm(e*1e6)/1e6}const fe={move:"M",line:"L",curve:"C",close:"Z"};class K{constructor(){k(this,"_events",{});k(this,"_bound",!1)}addEventListener(t,n){return(this._events[t]||(this._events[t]=[])).push(n),this._bound=!0,this}on(){return this.addEventListener.apply(this,arguments)}bind(){return this.addEventListener.apply(this,arguments)}removeEventListener(t,n){if(!this._events)return this;if(!t&&!n)return this._events={},this._bound=!1,this;const r=t?[t]:Object.keys(this._events);for(let s=0,o=r.length;s<o;s++){t=r[s];let a=this._events[t];if(a){let l=[];if(n)for(let c=0,d=a.length;c<d;c++){let h=a[c];h=h.handler?h.handler:h,n!==h&&l.push(h)}this._events[t]=l}}return this}off(){return this.removeEventListener.apply(this,arguments)}unbind(){return this.removeEventListener.apply(this,arguments)}dispatchEvent(t){if(!this._events)return this;const n=Array.prototype.slice.call(arguments,1),r=this._events[t];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(t,n,r){const s=this;t&&(o.obj=t,o.name=n,o.handler=r,t.on(n,o));function o(){r.apply(s,arguments)}return s}ignore(t,n,r){return t.off(n,r),this}}k(K,"Types",{play:"play",pause:"pause",update:"update",render:"render",resize:"resize",change:"change",remove:"remove",insert:"insert",order:"order",load:"load"}),k(K,"Methods",["addEventListener","on","removeEventListener","off","unbind","dispatchEvent","trigger","listen","ignore"]);const jl={x:{enumerable:!0,get:function(){return this._x},set:function(e){this._x!==e&&(this._x=e,this._bound&&this.dispatchEvent(K.Types.change))}},y:{enumerable:!0,get:function(){return this._y},set:function(e){this._y!==e&&(this._y=e,this._bound&&this.dispatchEvent(K.Types.change))}}},it=class it extends K{constructor(n=0,r=0){super();k(this,"_x",0);k(this,"_y",0);for(let s in jl)Object.defineProperty(this,s,jl[s]);this.x=n,this.y=r}static add(n,r){return new it(n.x+r.x,n.y+r.y)}static sub(n,r){return new it(n.x-r.x,n.y-r.y)}static subtract(n,r){return it.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(it.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 it(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:Jt(this.x),y:Jt(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}};k(it,"zero",new it),k(it,"left",new it(-1,0)),k(it,"right",new it(1,0)),k(it,"up",new it(0,-1)),k(it,"down",new it(0,1));let we=it;class $e extends we{constructor(n=0,r=0,s=0,o=0,a=0,l=0,c=fe.move){super(n,r);k(this,"controls",{left:new we,right:new we});k(this,"_command",fe.move);k(this,"_relative",!0);k(this,"_rx",0);k(this,"_ry",0);k(this,"_xAxisRotation",0);k(this,"_largeArcFlag",0);k(this,"_sweepFlag",1);for(let h in Xl)Object.defineProperty(this,h,Xl[h]);this.command=c,this.relative=!0;const d=$e.makeBroadcast(this);this.controls.left.set(s,o).addEventListener(K.Types.change,d),this.controls.right.set(a,l).addEventListener(K.Types.change,d)}static makeBroadcast(n){return r;function r(){n._bound&&n.dispatchEvent(K.Types.change)}}static fromObject(n){return new $e().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 $e().copy(this)}toObject(){return{x:Jt(this.x),y:Jt(this.y),command:this.command,relative:this.relative,controls:{left:this.controls.left.toObject(),right:this.controls.right.toObject()},rx:Jt(this.rx),ry:Jt(this.ry),xAxisRotation:Jt(this.xAxisRotation),largeArcFlag:Jt(this.largeArcFlag),sweepFlag:Jt(this.sweepFlag)}}toString(){return JSON.stringify(this.toObject())}}const Xl={command:{enumerable:!0,get:function(){return this._command},set:function(e){this._command!==e&&(this._command=e,this._bound&&this.dispatchEvent(K.Types.change))}},relative:{enumerable:!0,get:function(){return this._relative},set:function(e){this._relative!==!!e&&(this._relative=!!e,this._bound&&this.dispatchEvent(K.Types.change))}},rx:{enumerable:!0,get:function(){return this._rx},set:function(e){this._rx!==e&&(this._rx=e,this._bound&&this.dispatchEvent(K.Types.change))}},ry:{enumerable:!0,get:function(){return this._ry},set:function(e){this._ry!==e&&(this._ry=e,this._bound&&this.dispatchEvent(K.Types.change))}},xAxisRotation:{enumerable:!0,get:function(){return this._xAxisRotation},set:function(e){this._xAxisRotation!==e&&(this._xAxisRotation=e,this._bound&&this.dispatchEvent(K.Types.change))}},largeArcFlag:{enumerable:!0,get:function(){return this._largeArcFlag},set:function(e){this._largeArcFlag!==e&&(this._largeArcFlag=e,this._bound&&this.dispatchEvent(K.Types.change))}},sweepFlag:{get:function(){return this._sweepFlag},set:function(e){this._sweepFlag!==e&&(this._sweepFlag=e,this._bound&&this.dispatchEvent(K.Types.change))}}};let cm=0;const Xs={NextFrameId:null,Types:{webgl:"WebGLRenderer",svg:"SVGRenderer",canvas:"CanvasRenderer"},Version:"<%= version %>",PublishDate:"<%= publishDate %>",Identifier:"two-",Resolution:12,AutoCalculateImportedMatrices:!0,Instances:[],uniqueId:function(){return cm++}},jr={RecursionLimit:16,abscissas:[[.5773502691896257],[0,.7745966692414834],[.33998104358485626,.8611363115940526],[0,.5384693101056831,.906179845938664],[.2386191860831969,.6612093864662645,.932469514203152],[0,.4058451513773972,.7415311855993945,.9491079123427585],[.1834346424956498,.525532409916329,.7966664774136267,.9602898564975363],[0,.3242534234038089,.6133714327005904,.8360311073266358,.9681602395076261],[.14887433898163122,.4333953941292472,.6794095682990244,.8650633666889845,.9739065285171717],[0,.26954315595234496,.5190961292068118,.7301520055740494,.8870625997680953,.978228658146057],[.1252334085114689,.3678314989981802,.5873179542866175,.7699026741943047,.9041172563704749,.9815606342467192],[0,.2304583159551348,.44849275103644687,.6423493394403402,.8015780907333099,.9175983992229779,.9841830547185881],[.10805494870734367,.31911236892788974,.5152486363581541,.6872929048116855,.827201315069765,.9284348836635735,.9862838086968123],[0,.20119409399743451,.3941513470775634,.5709721726085388,.7244177313601701,.8482065834104272,.937273392400706,.9879925180204854],[.09501250983763744,.2816035507792589,.45801677765722737,.6178762444026438,.755404408355003,.8656312023878318,.9445750230732326,.9894009349916499]],weights:[[1],[.8888888888888888,.5555555555555556],[.6521451548625461,.34785484513745385],[.5688888888888889,.47862867049936647,.23692688505618908],[.46791393457269104,.3607615730481386,.17132449237917036],[.4179591836734694,.3818300505051189,.27970539148927664,.1294849661688697],[.362683783378362,.31370664587788727,.22238103445337448,.10122853629037626],[.3302393550012598,.31234707704000286,.26061069640293544,.1806481606948574,.08127438836157441],[.29552422471475287,.26926671930999635,.21908636251598204,.1494513491505806,.06667134430868814],[.2729250867779006,.26280454451024665,.23319376459199048,.18629021092773426,.1255803694649046,.05566856711617366],[.24914704581340277,.2334925365383548,.20316742672306592,.16007832854334622,.10693932599531843,.04717533638651183],[.2325515532308739,.22628318026289723,.2078160475368885,.17814598076194574,.13887351021978725,.09212149983772845,.04048400476531588],[.2152638534631578,.2051984637212956,.18553839747793782,.15720316715819355,.12151857068790319,.08015808715976021,.03511946033175186],[.2025782419255613,.19843148532711158,.1861610000155622,.16626920581699392,.13957067792615432,.10715922046717194,.07036604748810812,.03075324199611727],[.1894506104550685,.18260341504492358,.16915651939500254,.14959598881657674,.12462897125553388,.09515851168249279,.062253523938647894,.027152459411754096]]};function Xr(e,t,n,r,s){const o=1-e;return o*o*o*t+3*o*o*e*n+3*o*e*e*r+e*e*e*s}function ql(e,t,n,r,s,o,a,l,c){c=c||jr.RecursionLimit;const d=c+1;if(Math.abs(e-a)<.001&&Math.abs(t-l)<.001)return[new $e(a,l)];const h=[];for(let u=0;u<d;u++){const f=u/d,p=Xr(f,e,n,s,a),g=Xr(f,t,r,o,l);h.push(new $e(p,g))}return h}function dm(e,t,n,r,s,o,a,l,c){if(e===n&&t===r&&s===a&&o===l){const _=a-e,y=l-t;return Math.sqrt(_*_+y*y)}const d=9*(n-s)+3*(a-e),h=6*(e+s)-12*n,u=3*(n-e),f=9*(r-o)+3*(l-t),p=6*(t+o)-12*r,g=3*(r-t);function m(_){const y=(d*_+h)*_+u,b=(f*_+p)*_+g;return Math.sqrt(y*y+b*b)}return um(m,0,1,c||jr.RecursionLimit)}function hm(e,t,n,r,s,o,a,l){const c=[],d=[[],[]];let h,u,f,p,g,m,_,y;for(let C=0;C<2;++C){if(C==0?(u=6*e-12*n+6*s,h=-3*e+9*n-9*s+3*a,f=3*n-3*e):(u=6*t-12*r+6*o,h=-3*t+9*r-9*o+3*l,f=3*r-3*t),Math.abs(h)<1e-12){if(Math.abs(u)<1e-12)continue;p=-f/u,0<p&&p<1&&c.push(p);continue}_=u*u-4*f*h,y=Math.sqrt(_),!(_<0)&&(g=(-u+y)/(2*h),0<g&&g<1&&c.push(g),m=(-u-y)/(2*h),0<m&&m<1&&c.push(m))}let b=c.length,S=b,x;for(;b--;)p=c[b],x=1-p,d[0][b]=x*x*x*e+3*x*x*p*n+3*x*p*p*s+p*p*p*a,d[1][b]=x*x*x*t+3*x*x*p*r+3*x*p*p*o+p*p*p*l;return d[0][S]=e,d[1][S]=t,d[0][S+1]=a,d[1][S+1]=l,d[0].length=d[1].length=S+2,{min:{x:Math.min.apply(0,d[0]),y:Math.min.apply(0,d[1])},max:{x:Math.max.apply(0,d[0]),y:Math.max.apply(0,d[1])}}}function um(e,t,n,r){let s=jr.abscissas[r-2],o=jr.weights[r-2],a=.5*(n-t),l=a+t,c=0,d=r+1>>1,h=r&1?o[c++]*e(l):0;for(;c<d;){const u=a*s[c];h+=o[c++]*(e(l+u)+e(l-u))}return a*h}function fm(e,t){const n=e.length,r=n-1;for(let s=0;s<n;s++){const o=e[s],a=t?Ti(s-1,n):Math.max(s-1,0),l=t?Ti(s+1,n):Math.min(s+1,r),c=e[a],d=o,h=e[l];pm(c,d,h),d.command=s===0?fe.move:fe.curve}}function pm(e,t,n){const r=we.angleBetween(e,t),s=we.angleBetween(n,t);let o=we.distanceBetween(e,t),a=we.distanceBetween(n,t),l=(r+s)/2;return o<1e-4||a<1e-4?(typeof t.relative=="boolean"&&!t.relative&&(t.controls.left.copy(t),t.controls.right.copy(t)),t):(o*=.33,a*=.33,s<r?l+=tt:l-=tt,t.controls.left.x=Math.cos(l)*o,t.controls.left.y=Math.sin(l)*o,l-=Math.PI,t.controls.right.x=Math.cos(l)*a,t.controls.right.y=Math.sin(l)*a,typeof t.relative=="boolean"&&!t.relative&&(t.controls.left.x+=t.x,t.controls.left.y+=t.y,t.controls.right.x+=t.x,t.controls.right.y+=t.y),t)}let ir=(pi=class extends K{constructor(){super();k(this,"_flagId",!1);k(this,"_flagClassName",!1);k(this,"_renderer",{});k(this,"_id",Xs.Identifier+Xs.uniqueId());k(this,"_className","");k(this,"classList",[]);for(let n in Yl)Object.defineProperty(this,n,Yl[n])}static fromObject(n){const r=new pi().copy(n);return"id"in n&&(r.id=n.id),r}flagReset(){return this._flagId=this._flagClassName=!1,this}copy(n){return this.renderer.type=n.renderer.type,this.className=n.className,this}toObject(){return{renderer:{type:this.renderer.type},id:this.id,className:this.className}}},k(pi,"Properties",["renderer","id","className"]),pi);const Yl={renderer:{enumerable:!1,get:function(){return this._renderer}},id:{enumerable:!0,get:function(){return this._id},set:function(e){const t=this._id;e!==this._id&&(this._id=e,this._flagId=!0,this.parent&&(delete this.parent.children.ids[t],this.parent.children.ids[this._id]=this))}},className:{enumerable:!0,get:function(){return this._className},set:function(e){this._className!==e&&(this._flagClassName=!0,this.classList=e.split(/\s+?/),this._className=e)}}};class qr extends Error{constructor(n){super();k(this,"name","Two.js");k(this,"message");this.message=n}}class gm{constructor(){k(this,"map",{})}add(t,n){return this.map[t]=n,this}remove(t){return delete this.map[t],this}get(t){return this.map[t]}contains(t){return t in this.map}}let Yr;const Ul={video:/\.(mp4|webm|ogg)$/i,image:/\.(jpe?g|png|gif|tiff|webp)$/i,effect:/texture|gradient/i};Kt.document&&(Yr=document.createElement("a"));const We=class We extends ir{constructor(n,r){super();k(this,"_flagSrc",!1);k(this,"_flagImage",!1);k(this,"_flagVideo",!1);k(this,"_flagLoaded",!1);k(this,"_flagRepeat",!1);k(this,"_flagOffset",!1);k(this,"_flagScale",!1);k(this,"_src","");k(this,"_image",null);k(this,"_loaded",!1);k(this,"_repeat","no-repeat");k(this,"_scale",1);k(this,"_offset",null);for(let s in Gl)Object.defineProperty(this,s,Gl[s]);if(this._renderer.type="texture",this._renderer.flagOffset=mm.bind(this),this._renderer.flagScale=_m.bind(this),this.loaded=!1,this.repeat="no-repeat",this.offset=new we,typeof r=="function"){const s=(function(){this.unbind(K.Types.load,s),typeof r=="function"&&r()}).bind(this);this.bind(K.Types.load,s)}if(typeof n=="string")this.src=n;else if(typeof n=="object"){const s=Object.prototype.toString.call(n);(s==="[object HTMLImageElement]"||s==="[object HTMLCanvasElement]"||s==="[object HTMLVideoElement]"||s==="[object Image]")&&(this.image=n)}this._update()}fromObject(n){const r=new We().copy(n);return"id"in n&&(r.id=n.id),r}static getAbsoluteURL(n){return Yr?(Yr.href=n,Yr.href):n}static loadHeadlessBuffer(n,r){n.image.onload=r,n.image.src=n.src}static getTag(n){return n&&n.nodeName&&n.nodeName.toLowerCase()||"img"}static getImage(n){const r=We.getAbsoluteURL(n);if(We.ImageRegistry.contains(r))return We.ImageRegistry.get(r);let s;return Kt.document?Ul.video.test(r)?s=document.createElement("video"):s=document.createElement("img"):console.warn("Two.js: no prototypical image defined for Two.Texture"),s.crossOrigin="anonymous",s.referrerPolicy="no-referrer",s}static load(n,r){let s=n.image,o=We.getTag(s);n._flagImage&&(/canvas/i.test(o)?We.Register.canvas(n,r):(n._src=s.getAttribute("two-src")||s.src,We.Register[o](n,r))),n._flagSrc&&(s||(s=We.getImage(n.src),n.image=s),o=We.getTag(s),We.Register[o](n,r))}clone(){const n=new We(this.src);return n.repeat=this.repeat,n.offset.copy(this.offset),n.scale=this.scale,n}copy(n){return this.src=n.src,this.repeat=n.repeat,this.offset=typeof n.offset=="number"||n.offset instanceof we?n.offset:new we().copy(n.offset),this.scale=typeof n.scale=="number"||n.scale instanceof we?n.scale:new we().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(K.Types.change),(this._flagSrc||this._flagImage)&&(this.loaded=!1,We.load(this,(function(){this.loaded=!0,this.trigger(K.Types.change).trigger(K.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("elem"in this._renderer){const n=this._renderer.elem;n.parentNode.removeChild(n)}return"effect"in this._renderer&&(this._renderer.effect=null),this}};k(We,"Properties",["src","loaded","repeat","scale","offset","image"]),k(We,"RegularExpressions",Ul),k(We,"ImageRegistry",new gm),k(We,"Register",{canvas:function(n,r){n._src="#"+n.id,We.ImageRegistry.add(n.src,n.image),typeof r=="function"&&r()},img:function(n,r){const s=n.image,o=function(l){s.removeEventListener&&typeof s.removeEventListener=="function"&&(s.removeEventListener("load",o,!1),s.removeEventListener("error",a,!1)),typeof r=="function"&&r()},a=function(l){throw typeof s.removeEventListener=="function"&&(s.removeEventListener("load",o,!1),s.removeEventListener("error",a,!1)),new qr("unable to load "+n.src)};typeof s.width=="number"&&s.width>0&&typeof s.height=="number"&&s.height>0?o():typeof s.addEventListener=="function"&&(s.addEventListener("load",o,!1),s.addEventListener("error",a,!1)),n._src=We.getAbsoluteURL(n._src),!(s&&s.getAttribute("two-src"))&&(s.setAttribute("two-src",n.src),We.ImageRegistry.add(n.src,s),n.image.src=n.src)},video:function(n,r){const s=function(a){n.image.removeEventListener("canplaythrough",s,!1),n.image.removeEventListener("error",o,!1),n.image.width=n.image.videoWidth,n.image.height=n.image.videoHeight,typeof r=="function"&&r()},o=function(a){throw n.image.removeEventListener("canplaythrough",s,!1),n.image.removeEventListener("error",o,!1),new qr("unable to load "+n.src)};n._src=We.getAbsoluteURL(n._src),n.image.getAttribute("two-src")||(n.image.setAttribute("two-src",n.src),We.ImageRegistry.add(n.src,n.image)),n.image.readyState>=4?s():(n.image.addEventListener("canplaythrough",s,!1),n.image.addEventListener("error",o,!1),n.image.src=n.src,n.image.load())}});let nt=We;const Gl={src:{enumerable:!0,get:function(){return this._src},set:function(e){this._src=e,this._flagSrc=!0}},loaded:{enumerable:!0,get:function(){return this._loaded},set:function(e){this._loaded=e,this._flagLoaded=!0}},repeat:{enumerable:!0,get:function(){return this._repeat},set:function(e){this._repeat=e,this._flagRepeat=!0}},image:{enumerable:!0,get:function(){return this._image},set:function(e){const t=nt.getTag(e);let n;switch(t){case"canvas":n="#"+e.id;break;default:n=e.src}nt.ImageRegistry.contains(n)?this._image=nt.ImageRegistry.get(e.src):this._image=e,this._flagImage=!0}},offset:{enumerable:!0,get:function(){return this._offset},set:function(e){this._offset&&this._offset.unbind(K.Types.change,this._renderer.flagOffset),this._offset=e,this._offset.bind(K.Types.change,this._renderer.flagOffset),this._flagOffset=!0}},scale:{enumerable:!0,get:function(){return this._scale},set:function(e){this._scale instanceof we&&this._scale.unbind(K.Types.change,this._renderer.flagScale),this._scale=e,this._scale instanceof we&&this._scale.bind(K.Types.change,this._renderer.flagScale),this._flagScale=!0}}};function mm(){this._flagOffset=!0}function _m(){this._flagScale=!0}class Ei extends Array{constructor(){super();ha(this,rt,new K);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 kt(this,rt)}set _events(n){zh(this,rt,n)}get _bound(){return kt(this,rt)._bound}set _bound(n){kt(this,rt)._bound=n}addEventListener(){return kt(this,rt).addEventListener.apply(this,arguments)}on(){return kt(this,rt).on.apply(this,arguments)}bind(){return kt(this,rt).bind.apply(this,arguments)}removeEventListener(){return kt(this,rt).removeEventListener.apply(this,arguments)}off(){return kt(this,rt).off.apply(this,arguments)}unbind(){return kt(this,rt).unbind.apply(this,arguments)}dispatchEvent(){return kt(this,rt).dispatchEvent.apply(this,arguments)}trigger(){return kt(this,rt).trigger.apply(this,arguments)}listen(){return kt(this,rt).listen.apply(this,arguments)}ignore(){return kt(this,rt).ignore.apply(this,arguments)}pop(){const n=super.pop.apply(this,arguments);return this.trigger(K.Types.remove,[n]),n}shift(){const n=super.shift.apply(this,arguments);return this.trigger(K.Types.remove,[n]),n}push(){const n=super.push.apply(this,arguments);return this.trigger(K.Types.insert,arguments),n}unshift(){const n=super.unshift.apply(this,arguments);return this.trigger(K.Types.insert,arguments),n}splice(){const n=super.splice.apply(this,arguments);if(this.trigger(K.Types.remove,n),arguments.length>2){const r=this.slice(arguments[0],arguments[0]+arguments.length-2);this.trigger(K.Types.insert,r),this.trigger(K.Types.order)}return n}sort(){return super.sort.apply(this,arguments),this.trigger(K.Types.order),this}reverse(){return super.reverse.apply(this,arguments),this.trigger(K.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}}rt=new WeakMap;const Kl=Array.prototype.slice;function ym(e){if(e==null)return!1;const t=e.length;return typeof t=="number"&&t>=0&&t<4294967296}const Ae={isNaN:function(e){return typeof e=="number"&&e!==+e},isElement:function(e){return!!(e&&e.nodeType===1)},isObject:function(e){const t=typeof e;return t==="function"||t==="object"&&!!e},extend:function(e){const t=Kl.call(arguments,1);for(let n=0;n<t.length;n++){const r=t[n];for(let s in r)e[s]=r[s]}return e},defaults:function(e){const t=Kl.call(arguments,1);for(let n=0;n<t.length;n++){const r=t[n];for(let s in r)e[s]===void 0&&(e[s]=r[s])}return e},each:function(e,t,n){const r=n||this,s=!ym(e)&&Object.keys(e),o=(s||e).length;for(let a=0;a<o;a++){const l=s?s[a]:a;t.call(r,e[l],l,e)}return e},performance:Kt.performance&&Kt.performance.now?Kt.performance:Date},Bt=class Bt extends ir{constructor(n,r,s){super();k(this,"_flagOffset",!0);k(this,"_flagOpacity",!0);k(this,"_flagColor",!0);k(this,"_offset",0);k(this,"_opacity",1);k(this,"_color","#fff");for(let o in Zl)Object.defineProperty(this,o,Zl[o]);this._renderer.type="stop",this.offset=typeof n=="number"?n:Bt.Index<=0?0:1,this.opacity=typeof s=="number"?s:1,this.color=typeof r=="string"?r:Bt.Index<=0?"#fff":"#000",Bt.Index=(Bt.Index+1)%2}static fromObject(n){const r=new Bt().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<Bt.Properties.length;r++){const s=Bt.Properties[r];s in n&&(this[s]=n[s])}return this}clone(n){const r=new Bt;return Ae.each(Bt.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",Ae.each(Bt.Properties,r=>{n[r]=this[r]},this),n}flagReset(){return this._flagOffset=this._flagColor=this._flagOpacity=!1,super.flagReset.call(this),this}};k(Bt,"Index",0),k(Bt,"Properties",["offset","opacity","color"]);let Qn=Bt;const Zl={offset:{enumerable:!0,get:function(){return this._offset},set:function(e){this._offset=e,this._flagOffset=!0,this.parent&&(this.parent._flagStops=!0)}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(e){this._opacity=e,this._flagOpacity=!0,this.parent&&(this.parent._flagStops=!0)}},color:{enumerable:!0,get:function(){return this._color},set:function(e){this._color=e,this._flagColor=!0,this.parent&&(this.parent._flagStops=!0)}}},nn=class nn extends ir{constructor(n){super();k(this,"_flagStops",!1);k(this,"_flagSpread",!1);k(this,"_flagUnits",!1);k(this,"_spread","");k(this,"_units","");for(let r in Jl)Object.defineProperty(this,r,Jl[r]);this._renderer.type="gradient",this._renderer.flagStops=bm.bind(this),this._renderer.bindStops=wm.bind(this),this._renderer.unbindStops=vm.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 Qn?o:new Qn().copy(o)));const s=new nn().copy(n);return"id"in n&&(s.id=n.id),s}clone(n){const r=this.stops.map(o=>o.clone()),s=new nn(r);return Ae.each(nn.Properties,o=>{s[o]=this[o]},this),n&&n.add(s),s}copy(n){super.copy.call(this,n);for(let r=0;r<nn.Properties.length;r++){const s=nn.Properties[r];s in n&&(this[s]=n[s])}return this}toObject(){const n={stops:this.stops.map(r=>r.toObject())};return Ae.each(nn.Properties,r=>{n[r]=this[r]},this),n}_update(){return(this._flagSpread||this._flagStops)&&this.trigger(K.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}};k(nn,"Stop",Qn),k(nn,"Properties",["spread","stops","units"]);let Je=nn;const Jl={spread:{enumerable:!0,get:function(){return this._spread},set:function(e){this._spread=e,this._flagSpread=!0}},units:{enumerable:!0,get:function(){return this._units},set:function(e){this._units=e,this._flagUnits=!0}},stops:{enumerable:!0,get:function(){return this._stops},set:function(e){const t=this._renderer.bindStops,n=this._renderer.unbindStops;this._stops&&this._stops.unbind(K.Types.insert,t).unbind(K.Types.remove,n),this._stops=new Ei((e||[]).slice(0)),this._stops.bind(K.Types.insert,t).bind(K.Types.remove,n),t(this._stops)}}};function bm(){this._flagStops=!0}function wm(e){let t=e.length;for(;t--;)e[t].bind(K.Types.change,this._renderer.flagStops),e[t].parent=this;this._renderer.flagStops()}function vm(e){let t=e.length;for(;t--;)e[t].unbind(K.Types.change,this._renderer.flagStops),delete e[t].parent;this._renderer.flagStops()}const On=class On extends Je{constructor(n,r,s,o,a){super(a);k(this,"_flagEndPoints",!1);k(this,"_left",null);k(this,"_right",null);for(let l in Ql)Object.defineProperty(this,l,Ql[l]);this._renderer.type="linear-gradient",this._renderer.flagEndPoints=km.bind(this),this.left=new we,this.right=new we,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 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];s in n&&(this[s]=n[s]instanceof we?n[s]:new we().copy(n[s]))}return this}clone(n){const r=this.stops.map(function(o){return o.clone()}),s=new On(this.left._x,this.left._y,this.right._x,this.right._y,r);return Ae.each(Je.Properties,function(o){s[o]=this[o]},this),n&&n.add(s),s}toObject(){const n=super.toObject.call(this);return n.left=this.left.toObject(),n.right=this.right.toObject(),n}_update(){return(this._flagEndPoints||this._flagSpread||this._flagStops)&&this.trigger(K.Types.change),this}flagReset(){return this._flagEndPoints=!1,super.flagReset.call(this),this}};k(On,"Stop",Qn),k(On,"Properties",["left","right"]);let _t=On;const Ql={left:{enumerable:!0,get:function(){return this._left},set:function(e){this._left instanceof we&&this._left.unbind(K.Types.change,this._renderer.flagEndPoints),this._left=e,this._left.bind(K.Types.change,this._renderer.flagEndPoints),this._flagEndPoints=!0}},right:{enumerable:!0,get:function(){return this._right},set:function(e){this._right instanceof we&&this._right.unbind(K.Types.change,this._renderer.flagEndPoints),this._right=e,this._right.bind(K.Types.change,this._renderer.flagEndPoints),this._flagEndPoints=!0}}};function km(){this._flagEndPoints=!0}const rn=class rn extends Je{constructor(n,r,s,o,a,l){super(o);k(this,"_flagRadius",!1);k(this,"_flagCenter",!1);k(this,"_flagFocal",!1);k(this,"_radius",0);k(this,"_center",null);k(this,"_focal",null);for(let c in ec)Object.defineProperty(this,c,ec[c]);this._renderer.type="radial-gradient",this._renderer.flagCenter=xm.bind(this),this._renderer.flagFocal=Cm.bind(this),this.center=new we,this.radius=typeof s=="number"?s:1,this.focal=new we,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 rn().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<rn.Properties.length;r++){const s=rn.Properties[r];s in n&&(/(center|focal)i/.test(s)?this[s]=n[s]instanceof we?n[s]:new we().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 rn(this.center._x,this.center._y,this._radius,r,this.focal._x,this.focal._y);return Ae.each(Je.Properties.concat(rn.Properties),function(o){s[o]=this[o]},this),n&&n.add(s),s}toObject(){const n=super.toObject.call(this);return Ae.each(rn.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(K.Types.change),this}flagReset(){return this._flagRadius=this._flagCenter=this._flagFocal=!1,super.flagReset.call(this),this}};k(rn,"Stop",Qn),k(rn,"Properties",["center","radius","focal"]);let yt=rn;const ec={radius:{enumerable:!0,get:function(){return this._radius},set:function(e){this._radius=e,this._flagRadius=!0}},center:{enumerable:!0,get:function(){return this._center},set:function(e){this._center&&this._center.unbind(K.Types.change,this._renderer.flagCenter),this._center=e,this._center.bind(K.Types.change,this._renderer.flagCenter),this._flagCenter=!0}},focal:{enumerable:!0,get:function(){return this._focal},set:function(e){this._focal&&this._focal.unbind(K.Types.change,this._renderer.flagFocal),this._focal=e,this._focal.bind(K.Types.change,this._renderer.flagFocal),this._flagFocal=!0}}};function xm(){this._flagCenter=!0}function Cm(){this._flagFocal=!0}function tc(e,t){if(t===0||t===1)return!0;const r=e._length*t;let s=0;for(let o=0;o<e._lengths.length;o++){const a=e._lengths[o];if(s>=r)return r-s>=0;s+=a}return!1}function Ur(e,t){const n=e._length;if(t<=0)return 0;if(t>=n)return e._lengths.length-1;for(let r=0,s=0;r<e._lengths.length;r++){if(s+e._lengths[r]>=t)return t-=s,Math.max(r-1,0)+t/e._lengths[r];s+=e._lengths[r]}return-1}function nc(e,t,n){let r,s,o,a,l,c,d,h;const u=t.controls&&t.controls.right,f=e.controls&&e.controls.left;return r=t.x,l=t.y,s=(u||t).x,c=(u||t).y,o=(f||e).x,d=(f||e).y,a=e.x,h=e.y,u&&t._relative&&(s+=t.x,c+=t.y),f&&e._relative&&(o+=e.x,d+=e.y),dm(r,l,s,c,o,d,a,h,n)}function ic(e,t,n){let r,s,o,a,l,c,d,h;const u=t.controls&&t.controls.right,f=e.controls&&e.controls.left;return r=t.x,l=t.y,s=(u||t).x,c=(u||t).y,o=(f||e).x,d=(f||e).y,a=e.x,h=e.y,u&&t._relative&&(s+=t.x,c+=t.y),f&&e._relative&&(o+=e.x,d+=e.y),ql(r,l,s,c,o,d,a,h,n)}function ei(e){switch(e.renderer.type){case"texture":return nt.fromObject(e);case"gradient":return Je.fromObject(e);case"linear-gradient":return _t.fromObject(e);case"radial-gradient":return yt.fromObject(e)}return e}const Sm=Math.cos,Bm=Math.sin,rc=Math.tan,qs=[],wt=class wt extends K{constructor(n,r,s,o,a,l){super();k(this,"elements",new Wl(9));k(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 v=n;let $,F,R;const X=r[0]||0,M=r[1]||0,N=r[2]||0;return $=v[0]*X+v[1]*M+v[2]*N,F=v[3]*X+v[4]*M+v[5]*N,R=v[6]*X+v[7]*M+v[8]*N,[$,F,R]}const o=n[0],a=n[1],l=n[2],c=n[3],d=n[4],h=n[5],u=n[6],f=n[7],p=n[8],g=r[0],m=r[1],_=r[2],y=r[3],b=r[4],S=r[5],x=r[6],C=r[7],B=r[8];return s=s||new Wl(9),s[0]=o*g+a*y+l*x,s[1]=o*m+a*b+l*C,s[2]=o*_+a*S+l*B,s[3]=c*g+d*y+h*x,s[4]=c*m+d*b+h*C,s[5]=c*_+d*S+h*B,s[6]=u*g+f*y+p*x,s[7]=u*m+f*b+p*C,s[8]=u*_+f*S+p*B,s}static fromObject(n){return new wt().copy(n)}set(n,r,s,o,a,l,c,d,h){if(typeof r>"u"){const u=n;n=u[0],r=u[1],s=u[2],o=u[3],a=u[4],l=u[5],c=u[6],d=u[7],h=u[8]}return this.elements[0]=n,this.elements[1]=r,this.elements[2]=s,this.elements[3]=o,this.elements[4]=a,this.elements[5]=l,this.elements[6]=c,this.elements[7]=d,this.elements[8]=h,this.trigger(K.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(K.Types.change)}identity(){return this.elements[0]=wt.Identity[0],this.elements[1]=wt.Identity[1],this.elements[2]=wt.Identity[2],this.elements[3]=wt.Identity[3],this.elements[4]=wt.Identity[4],this.elements[5]=wt.Identity[5],this.elements[6]=wt.Identity[6],this.elements[7]=wt.Identity[7],this.elements[8]=wt.Identity[8],this.trigger(K.Types.change)}multiply(n,r,s,o,a,l,c,d,h){if(typeof r>"u")return this.elements[0]*=n,this.elements[1]*=n,this.elements[2]*=n,this.elements[3]*=n,this.elements[4]*=n,this.elements[5]*=n,this.elements[6]*=n,this.elements[7]*=n,this.elements[8]*=n,this.trigger(K.Types.change);if(typeof s>"u"&&(s=1),typeof o>"u"){n=n||0,r=r||0,s=s||0,a=this.elements;const L=a[0]*n+a[1]*r+a[2]*s,U=a[3]*n+a[4]*r+a[5]*s,P=a[6]*n+a[7]*r+a[8]*s;return[L,U,P]}const u=this.elements,f=[n,r,s,o,a,l,c,d,h],p=u[0],g=u[1],m=u[2],_=u[3],y=u[4],b=u[5],S=u[6],x=u[7],C=u[8],B=f[0],v=f[1],$=f[2],F=f[3],R=f[4],X=f[5],M=f[6],N=f[7],A=f[8];return this.elements[0]=p*B+g*F+m*M,this.elements[1]=p*v+g*R+m*N,this.elements[2]=p*$+g*X+m*A,this.elements[3]=_*B+y*F+b*M,this.elements[4]=_*v+y*R+b*N,this.elements[5]=_*$+y*X+b*A,this.elements[6]=S*B+x*F+C*M,this.elements[7]=S*v+x*R+C*N,this.elements[8]=S*$+x*X+C*A,this.trigger(K.Types.change)}inverse(n){const r=this.elements;n=n||new wt;const s=r[0],o=r[1],a=r[2],l=r[3],c=r[4],d=r[5],h=r[6],u=r[7],f=r[8],p=f*c-d*u,g=-f*l+d*h,m=u*l-c*h;let _=s*p+o*g+a*m;return _?(_=1/_,n.elements[0]=p*_,n.elements[1]=(-f*o+a*u)*_,n.elements[2]=(d*o-a*c)*_,n.elements[3]=g*_,n.elements[4]=(f*s-a*h)*_,n.elements[5]=(-d*s+a*l)*_,n.elements[6]=m*_,n.elements[7]=(-u*s+o*h)*_,n.elements[8]=(c*s-o*l)*_,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=Sm(n),s=Bm(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=rc(n);return this.multiply(1,r,0,0,1,0,0,0,1)}skewY(n){const r=rc(n);return this.multiply(1,0,0,r,1,0,0,0,1)}toString(n){return qs.length=0,this.toTransformArray(n,qs),qs.map(Jt).join(" ")}toTransformArray(n,r){const s=this.elements,o=!!r,a=s[0],l=s[1],c=s[2],d=s[3],h=s[4],u=s[5];if(n){const f=s[6],p=s[7],g=s[8];if(o){r[0]=a,r[1]=d,r[2]=f,r[3]=l,r[4]=h,r[5]=p,r[6]=c,r[7]=u,r[8]=g;return}return[a,d,f,l,h,p,c,u,g]}if(o){r[0]=a,r[1]=d,r[2]=l,r[3]=h,r[4]=c,r[5]=u;return}return[a,d,l,h,c,u]}toArray(n,r){const s=this.elements,o=!!r,a=s[0],l=s[1],c=s[2],d=s[3],h=s[4],u=s[5];if(n){const f=s[6],p=s[7],g=s[8];if(o){r[0]=a,r[1]=l,r[2]=c,r[3]=d,r[4]=h,r[5]=u,r[6]=f,r[7]=p,r[8]=g;return}return[a,l,c,d,h,u,f,p,g]}if(o){r[0]=a,r[1]=l,r[2]=c,r[3]=d,r[4]=h,r[5]=u;return}return[a,l,c,d,h,u]}toObject(){return{renderer:{type:"matrix"},elements:this.toArray(!0),manual:!!this.manual}}clone(){return new wt().copy(this)}};k(wt,"Identity",[1,0,0,0,1,0,0,0,1]);let rr=wt;om(rr);const br=class br extends ir{constructor(){super();k(this,"_flagMatrix",!0);k(this,"_flagScale",!1);k(this,"_matrix",null);k(this,"_worldMatrix",null);k(this,"_position",null);k(this,"_rotation",0);k(this,"_scale",1);k(this,"_skewX",0);k(this,"_skewY",0);for(let n in Gr)Object.defineProperty(this,n,Gr[n]);this._renderer.flagMatrix=sc.bind(this),this.isShape=!0,this.matrix=new rr,this.worldMatrix=new rr,this.position=new we,this.rotation=0,this.scale=1,this.skewX=0,this.skewY=0}static fromObject(n){const r=new br().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 Gr.position.get.apply(this,arguments)}set translation(n){Gr.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 we?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 we?n.scale:new we(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 br;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 we?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 we?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}};k(br,"Properties",["position","rotation","scale","skewX","skewY","matrix","worldMatrix"]);let hn=br;const Gr={position:{enumerable:!0,get:function(){return this._position},set:function(e){this._position&&this._position.unbind(K.Types.change,this._renderer.flagMatrix),this._position=e,this._position.bind(K.Types.change,this._renderer.flagMatrix),sc.call(this)}},rotation:{enumerable:!0,get:function(){return this._rotation},set:function(e){this._rotation=e,this._flagMatrix=!0}},scale:{enumerable:!0,get:function(){return this._scale},set:function(e){this._scale instanceof we&&this._scale.unbind(K.Types.change,this._renderer.flagMatrix),this._scale=e,this._scale instanceof we&&this._scale.bind(K.Types.change,this._renderer.flagMatrix),this._flagMatrix=!0,this._flagScale=!0}},skewX:{enumerable:!0,get:function(){return this._skewX},set:function(e){this._skewX=e,this._flagMatrix=!0}},skewY:{enumerable:!0,get:function(){return this._skewY},set:function(e){this._skewY=e,this._flagMatrix=!0}},matrix:{enumerable:!0,get:function(){return this._matrix},set:function(e){this._matrix=e,this._flagMatrix=!0}},worldMatrix:{enumerable:!0,get:function(){return am(this,this._worldMatrix),this._worldMatrix},set:function(e){this._worldMatrix=e}}};function sc(){this._flagMatrix=!0}const $i=Math.min,Ni=Math.max,Tm=Math.ceil,Em=Math.floor,$m=new we,jt=class jt extends hn{constructor(n,r,s,o){super();k(this,"_flagVertices",!0);k(this,"_flagLength",!0);k(this,"_flagFill",!0);k(this,"_flagStroke",!0);k(this,"_flagLinewidth",!0);k(this,"_flagOpacity",!0);k(this,"_flagVisible",!0);k(this,"_flagCap",!0);k(this,"_flagJoin",!0);k(this,"_flagMiter",!0);k(this,"_flagMask",!1);k(this,"_flagClip",!1);k(this,"_length",0);k(this,"_fill","#fff");k(this,"_stroke","#000");k(this,"_linewidth",1);k(this,"_opacity",1);k(this,"_visible",!0);k(this,"_cap","round");k(this,"_join","round");k(this,"_miter",4);k(this,"_closed",!0);k(this,"_curved",!1);k(this,"_automatic",!0);k(this,"_beginning",0);k(this,"_ending",1);k(this,"_mask",null);k(this,"_clip",!1);k(this,"_dashes",null);for(let a in oc)Object.defineProperty(this,a,oc[a]);this._renderer.type="path",this._renderer.flagVertices=ac.bind(this),this._renderer.bindVertices=lc.bind(this),this._renderer.unbindVertices=cc.bind(this),this._renderer.flagFill=dc.bind(this),this._renderer.flagStroke=hc.bind(this),this._renderer.vertices=[],this._renderer.collection=[],this.closed=!!r,this.curved=!!s,this.beginning=0,this.ending=1,this.fill="#fff",this.stroke="#000",this.linewidth=1,this.opacity=1,this.className="",this.visible=!0,this.cap="butt",this.join="miter",this.miter=4,this.vertices=n,this.automatic=!o,this.dashes=[],this.dashes.offset=0}static fromObject(n){const r=typeof n.fill=="string"?n.fill:ei(n.fill),s=typeof n.stroke=="string"?n.stroke:ei(n.stroke),o=new jt().copy({...n,fill:r,stroke:s});return"id"in n&&(o.id=n.id),o}copy(n){super.copy.call(this,n),this.vertices=[];for(let r=0;r<n.vertices.length;r++){const s=n.vertices[r];s instanceof $e?this.vertices.push(n.vertices[r].clone()):this.vertices.push(new $e().copy(s))}for(let r=0;r<jt.Properties.length;r++){const s=jt.Properties[r];s in n&&(this[s]=n[s])}return this}clone(n){const r=new jt;for(let s=0;s<this.vertices.length;s++)r.vertices.push(this.vertices[s].clone());for(let s=0;s<jt.Properties.length;s++){const o=jt.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()),Ae.each(jt.Properties,r=>{typeof this[r]<"u"&&(this[r].toObject?n[r]=this[r].toObject():n[r]=this[r])},this),n}noFill(){return this.fill="none",this}noStroke(){return this.stroke="none",this.linewidth=0,this}corner(){const n=this.getBoundingClientRect(!0),r=n.width/2,s=n.height/2,o=n.left+n.width/2,a=n.top+n.height/2;for(let l=0;l<this.vertices.length;l++){const c=this.vertices[l];c.x-=o,c.y-=a,c.x+=r,c.y+=s}return this.mask&&(this.mask.translation.x-=o,this.mask.translation.x+=r,this.mask.translation.y-=a,this.mask.translation.y+=s),this}center(){const n=this.getBoundingClientRect(!0),r=n.left+n.width/2-this.translation.x,s=n.top+n.height/2-this.translation.y;for(let o=0;o<this.vertices.length;o++){const a=this.vertices[o];a.x-=r,a.y-=s}return this.mask&&(this.mask.translation.x-=r,this.mask.translation.y-=s),this}getBoundingClientRect(n){let r,s,o,a,l,c,d=1/0,h=-1/0,u=1/0,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:p,scaleY:g}=sm(r.elements[0],r.elements[3],r.elements[1],r.elements[4],r.elements[2],r.elements[5]);typeof p=="number"&&typeof g=="number"&&(s=Math.max(p,g)*(this.linewidth||0)/2)}else s*=typeof this.scale=="number"?this.scale:Math.max(this.scale.x,this.scale.y);if(o<=0)return{width:0,height:0};for(a=0;a<o;a++){c=this._renderer.vertices[a],l=this._renderer.vertices[(a+o-1)%o];const[p,g]=r.multiply(l.x,l.y),[m,_]=r.multiply(c.x,c.y);if(l.controls&&c.controls){let y=l.controls.right.x,b=l.controls.right.y;l.relative&&(y+=l.x,b+=l.y);let[S,x]=r.multiply(y,b),C=c.controls.left.x,B=c.controls.left.y;c.relative&&(C+=c.x,B+=c.y);let[v,$]=r.multiply(C,B);const F=hm(p,g,S,x,v,$,m,_);u=$i(F.min.y-s,u),d=$i(F.min.x-s,d),h=Ni(F.max.x+s,h),f=Ni(F.max.y+s,f)}else a<=1&&(u=$i(g-s,u),d=$i(p-s,d),h=Ni(p+s,h),f=Ni(g+s,f)),u=$i(_-s,u),d=$i(m-s,d),h=Ni(m+s,h),f=Ni(_+s,f)}return{top:u,left:d,right:h,bottom:f,width:h-d,height:f-u}}getPointAt(n,r){let s,o,a,l,c,d,h,u,f,p,g,m,_,y,b,S=this.length*Math.min(Math.max(n,0),1);const x=this.vertices.length,C=x-1;let B=null,v=null;for(let E=0,H=this._lengths.length,I=0;E<H;E++){if(I+this._lengths[E]>=S){this._closed?(s=Ti(E,x),o=Ti(E-1,x),E===0&&(s=o,o=E)):(s=E,o=Math.min(Math.max(E-1,0),C)),B=this.vertices[s],v=this.vertices[o],S-=I,this._lengths[E]!==0?n=S/this._lengths[E]:n=0;break}I+=this._lengths[E]}if(B===null||v===null)return null;if(B){if(!v)return B}else return v;b=v.controls&&v.controls.right,y=B.controls&&B.controls.left,c=v.x,p=v.y,d=(b||v).x,g=(b||v).y,h=(y||B).x,m=(y||B).y,u=B.x,_=B.y,b&&v.relative&&(d+=v.x,g+=v.y),y&&B.relative&&(h+=B.x,m+=B.y),l=Xr(n,c,d,h,u),f=Xr(n,p,g,m,_);const $=Zt(c,d,n),F=Zt(p,g,n),R=Zt(d,h,n),X=Zt(g,m,n),M=Zt(h,u,n),N=Zt(m,_,n),A=Zt($,R,n),L=Zt(F,X,n),U=Zt(R,M,n),P=Zt(X,N,n);return Ae.isObject(r)?(r.x=l,r.y=f,r instanceof $e&&(r.controls.left.x=A,r.controls.left.y=L,r.controls.right.x=U,r.controls.right.y=P,(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 $e(l,f,A-l,L-f,U-l,P-f,this._curved?fe.curve:fe.line),a.t=n,a)}plot(){if(this.curved)return fm(this._collection,this.closed),this;for(let n=0;n<this._collection.length;n++)this._collection[n].command=n===0?fe.move:fe.line;return this}subdivide(n){this._update();const r=this.vertices.length-1,s=this._closed||this.vertices[r]._command===fe.close;let o=this.vertices[r],a=[],l;return Ae.each(this.vertices,function(c,d){if(d<=0&&!s){o=c;return}if(c.command===fe.move){a.push(new $e(o.x,o.y)),d>0&&(a[a.length-1].command=fe.line),o=c;return}l=ic(c,o,n),a=a.concat(l),Ae.each(l,function(h,u){u<=0&&o.command===fe.move?h.command=fe.move:h.command=fe.line}),d>=r&&(this._closed&&this._automatic&&(o=c,l=ic(c,o,n),a=a.concat(l),Ae.each(l,function(h,u){u<=0&&o.command===fe.move?h.command=fe.move:h.command=fe.line})),a.push(new $e(c.x,c.y)),a[a.length-1].command=s?fe.close:fe.line),o=c},this),this._automatic=!1,this._curved=!1,this.vertices=a,this}_updateLength(n,r){r||this._update();const o=this.vertices.length-1;let a=this.vertices[o],l=0;return typeof this._lengths>"u"&&(this._lengths=[]),Ae.each(this.vertices,function(c,d){if(d<=0||c.command===fe.move){a=c,this._lengths[d]=0;return}this._lengths[d]=nc(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=Ur(this,s*this._length),l=Ur(this,o*this._length),c=Tm(a),d=Em(l);let h,u,f,p,g,m;for(this._renderer.vertices.length=0,m=0;m<n;m++)this._renderer.collection.length<=m&&this._renderer.collection.push(new $e),m>d&&!u?(g=this._renderer.collection[m].copy(this._collection[m]),this.getPointAt(o,g),g.command=this._renderer.collection[m].command,this._renderer.vertices.push(g),u=g,f=this._collection[m-1],f&&f.controls&&(g.relative?g.controls.right.clear():g.controls.right.copy(g),f.relative?this._renderer.collection[m-1].controls.right.copy(f.controls.right).lerp(we.zero,1-g.t):this._renderer.collection[m-1].controls.right.copy(f.controls.right).lerp(f,1-g.t))):m>=c&&m<=d&&(g=this._renderer.collection[m].copy(this._collection[m]),this._renderer.vertices.push(g),m===d&&tc(this,o)?(u=g,!r&&u.controls&&(u.relative?u.controls.right.clear():u.controls.right.copy(u))):m===c&&tc(this,s)&&(h=g,h.command=fe.move,!r&&h.controls&&(h.relative?h.controls.left.clear():h.controls.left.copy(h))));c>0&&!h&&(m=c-1,g=this._renderer.collection[m].copy(this._collection[m]),this.getPointAt(s,g),g.command=fe.move,this._renderer.vertices.unshift(g),p=this._collection[m+1],p&&p.controls&&(g.controls.left.clear(),p.relative?this._renderer.collection[m+1].controls.left.copy(p.controls.left).lerp(we.zero,g.t):($m.copy(p),this._renderer.collection[m+1].controls.left.copy(p.controls.left).lerp(p,g.t))))}return hn.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=!1,hn.prototype.flagReset.call(this),this}};k(jt,"Properties",["fill","stroke","linewidth","opacity","visible","cap","join","miter","closed","curved","automatic","beginning","ending","dashes"]),k(jt,"Utils",{getCurveLength:nc});let Ne=jt;const oc={linewidth:{enumerable:!0,get:function(){return this._linewidth},set:function(e){this._linewidth=e,this._flagLinewidth=!0}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(e){this._opacity=e,this._flagOpacity=!0}},visible:{enumerable:!0,get:function(){return this._visible},set:function(e){this._visible=e,this._flagVisible=!0}},cap:{enumerable:!0,get:function(){return this._cap},set:function(e){this._cap=e,this._flagCap=!0}},join:{enumerable:!0,get:function(){return this._join},set:function(e){this._join=e,this._flagJoin=!0}},miter:{enumerable:!0,get:function(){return this._miter},set:function(e){this._miter=e,this._flagMiter=!0}},fill:{enumerable:!0,get:function(){return this._fill},set:function(e){(this._fill instanceof Je||this._fill instanceof _t||this._fill instanceof yt||this._fill instanceof nt)&&this._fill.unbind(K.Types.change,this._renderer.flagFill),this._fill=e,this._flagFill=!0,(this._fill instanceof Je||this._fill instanceof _t||this._fill instanceof yt||this._fill instanceof nt)&&this._fill.bind(K.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(e){(this._stroke instanceof Je||this._stroke instanceof _t||this._stroke instanceof yt||this._stroke instanceof nt)&&this._stroke.unbind(K.Types.change,this._renderer.flagStroke),this._stroke=e,this._flagStroke=!0,(this._stroke instanceof Je||this._stroke instanceof _t||this._stroke instanceof yt||this._stroke instanceof nt)&&this._stroke.bind(K.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(e){this._closed=!!e,this._flagVertices=!0}},curved:{enumerable:!0,get:function(){return this._curved},set:function(e){this._curved=!!e,this._flagVertices=!0}},automatic:{enumerable:!0,get:function(){return this._automatic},set:function(e){if(e===this._automatic)return;this._automatic=!!e;const t=this._automatic?"ignore":"listen";Ae.each(this.vertices,function(n){n[t]()})}},beginning:{enumerable:!0,get:function(){return this._beginning},set:function(e){this._beginning=e,this._flagVertices=!0}},ending:{enumerable:!0,get:function(){return this._ending},set:function(e){this._ending=e,this._flagVertices=!0}},vertices:{enumerable:!0,get:function(){return this._collection},set:function(e){const t=this._renderer.bindVertices,n=this._renderer.unbindVertices;this._collection&&this._collection.unbind(K.Types.insert,t).unbind(K.Types.remove,n),e instanceof Ei?this._collection=e:this._collection=new Ei(e||[]),this._collection.bind(K.Types.insert,t).bind(K.Types.remove,n),t(this._collection)}},mask:{enumerable:!0,get:function(){return this._mask},set:function(e){this._mask=e,this._flagMask=!0,Ae.isObject(e)&&!e.clip&&(e.clip=!0)}},clip:{enumerable:!0,get:function(){return this._clip},set:function(e){this._clip=e,this._flagClip=!0}},dashes:{enumerable:!0,get:function(){return this._dashes},set:function(e){typeof e.offset!="number"&&(e.offset=this.dashes&&this._dashes.offset||0),this._dashes=e}}};function ac(){this._flagVertices=!0,this._flagLength=!0,this.parent&&(this.parent._flagLength=!0)}function lc(e){let t=e.length;for(;t--;)e[t].bind(K.Types.change,this._renderer.flagVertices);this._renderer.flagVertices()}function cc(e){let t=e.length;for(;t--;)e[t].unbind(K.Types.change,this._renderer.flagVertices);this._renderer.flagVertices()}function dc(){this._flagFill=!0}function hc(){this._flagStroke=!0}const Nm=Math.ceil,Pm=Math.floor,sn=class sn extends hn{constructor(n){super();k(this,"_flagVertices",!0);k(this,"_flagLength",!0);k(this,"_flagFill",!0);k(this,"_flagStroke",!0);k(this,"_flagLinewidth",!0);k(this,"_flagOpacity",!0);k(this,"_flagVisible",!0);k(this,"_flagSize",!0);k(this,"_flagSizeAttenuation",!0);k(this,"_length",0);k(this,"_fill","#fff");k(this,"_stroke","#000");k(this,"_linewidth",1);k(this,"_opacity",1);k(this,"_visible",!0);k(this,"_size",1);k(this,"_sizeAttenuation",!1);k(this,"_beginning",0);k(this,"_ending",1);k(this,"_dashes",null);k(this,"noFill",Ne.prototype.noFill);k(this,"noStroke",Ne.prototype.noStroke);k(this,"corner",Ne.prototype.corner);k(this,"center",Ne.prototype.center);k(this,"getBoundingClientRect",Ne.prototype.getBoundingClientRect);k(this,"_updateLength",Ne.prototype._updateLength);for(let r in uc)Object.defineProperty(this,r,uc[r]);this._renderer.type="points",this._renderer.flagVertices=ac.bind(this),this._renderer.bindVertices=lc.bind(this),this._renderer.unbindVertices=cc.bind(this),this._renderer.flagFill=dc.bind(this),this._renderer.flagStroke=hc.bind(this),this._renderer.vertices=null,this._renderer.collection=null,this.size=1,this.sizeAttenuation=!1,this.beginning=0,this.ending=1,this.fill="#fff",this.stroke="#000",this.linewidth=1,this.opacity=1,this.className="",this.visible=!0,this.vertices=n,this.dashes=[],this.dashes.offset=0}static fromObject(n){const r=typeof n.fill=="string"?n.fill:ei(n.fill),s=typeof n.stroke=="string"?n.stroke:ei(n.stroke),o=new sn().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 $e?this.vertices.push(n.vertices[r].clone()):this.vertices.push(new $e().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="points",n.vertices=this.vertices.map(r=>r.toObject()),Ae.each(sn.Properties,function(r){typeof this[r]<"u"&&(this[r].toObject?n[r]=this[r].toObject():n[r]=this[r])},this),n}subdivide(n){this._update();let r=[];for(let s=0;s<this.vertices.length;s++){const o=this.vertices[s],a=this.vertices[s-1];if(!a)continue;const l=o.x,c=o.y,d=a.x,h=a.y,u=ql(l,c,l,c,d,h,d,h,n);r=r.concat(u)}return this.vertices=r,this}_update(){if(this._flagVertices){this._flagLength&&this._updateLength(void 0,!0);const n=Math.min(this._beginning,this._ending),r=Math.max(this._beginning,this._ending),s=Ur(this,n*this._length),o=Ur(this,r*this._length),a=Nm(s),l=Pm(o);let c=0,d;this._renderer.vertices=[],this._renderer.collection=[];for(let h=0;h<this._collection.length;h++)h>=a&&h<=l&&(d=this._collection[h],this._renderer.collection.push(d),this._renderer.vertices[c*2+0]=d.x,this._renderer.vertices[c*2+1]=d.y,c++)}return super._update.apply(this,arguments),this}flagReset(){return this._flagVertices=this._flagLength=this._flagFill=this._flagStroke=this._flagLinewidth=this._flagOpacity=this._flagVisible=this._flagSize=this._flagSizeAttenuation=!1,super.flagReset.call(this),this}};k(sn,"Properties",["fill","stroke","linewidth","opacity","visible","size","sizeAttenuation","beginning","ending","dashes"]);let Kr=sn;const uc={linewidth:{enumerable:!0,get:function(){return this._linewidth},set:function(e){this._linewidth=e,this._flagLinewidth=!0}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(e){this._opacity=e,this._flagOpacity=!0}},visible:{enumerable:!0,get:function(){return this._visible},set:function(e){this._visible=e,this._flagVisible=!0}},size:{enumerable:!0,get:function(){return this._size},set:function(e){this._size=e,this._flagSize=!0}},sizeAttenuation:{enumerable:!0,get:function(){return this._sizeAttenuation},set:function(e){this._sizeAttenuation=e,this._flagSizeAttenuation=!0}},fill:{enumerable:!0,get:function(){return this._fill},set:function(e){(this._fill instanceof Je||this._fill instanceof _t||this._fill instanceof yt||this._fill instanceof nt)&&this._fill.unbind(K.Types.change,this._renderer.flagFill),this._fill=e,this._flagFill=!0,(this._fill instanceof Je||this._fill instanceof _t||this._fill instanceof yt||this._fill instanceof nt)&&this._fill.bind(K.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(e){(this._stroke instanceof Je||this._stroke instanceof _t||this._stroke instanceof yt||this._stroke instanceof nt)&&this._stroke.unbind(K.Types.change,this._renderer.flagStroke),this._stroke=e,this._flagStroke=!0,(this._stroke instanceof Je||this._stroke instanceof _t||this._stroke instanceof yt||this._stroke instanceof nt)&&this._stroke.bind(K.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(e){this._beginning=e,this._flagVertices=!0}},ending:{enumerable:!0,get:function(){return this._ending},set:function(e){this._ending=e,this._flagVertices=!0}},vertices:{enumerable:!0,get:function(){return this._collection},set:function(e){const t=this._renderer.bindVertices,n=this._renderer.unbindVertices;this._collection&&this._collection.unbind(K.Types.insert,t).unbind(K.Types.remove,n),e instanceof Ei?this._collection=e:this._collection=new Ei(e||[]),this._collection.bind(K.Types.insert,t).bind(K.Types.remove,n),t(this._collection)}},dashes:{enumerable:!0,get:function(){return this._dashes},set:function(e){typeof e.offset!="number"&&(e.offset=this.dashes&&this._dashes.offset||0),this._dashes=e}}};class fc extends Ei{constructor(n){n=Array.isArray(n)?n:Array.prototype.slice.call(arguments);super(n);ha(this,vs,{});this.attach(n),this.on(K.Types.insert,this.attach),this.on(K.Types.remove,this.detach)}get ids(){return kt(this,vs)}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}}vs=new WeakMap;const mn=class mn extends Ne{constructor(n,r,s,o,a,l,c){const d=c||Xs.Resolution*3,h=[];for(let u=0;u<d;u++)h.push(new $e);super(h,!0,!1,!0);k(this,"_flagStartAngle",!1);k(this,"_flagEndAngle",!1);k(this,"_flagInnerRadius",!1);k(this,"_flagOuterRadius",!1);k(this,"_startAngle",0);k(this,"_endAngle",Jn);k(this,"_innerRadius",0);k(this,"_outerRadius",0);this._renderer.type="arc-segment";for(let u in pc)Object.defineProperty(this,u,pc[u]);typeof s=="number"&&(this.innerRadius=s),typeof o=="number"&&(this.outerRadius=o),typeof a=="number"&&(this.startAngle=a),typeof l=="number"&&(this.endAngle=l),this._update(),typeof n=="number"&&(this.translation.x=n),typeof r=="number"&&(this.translation.y=r)}static fromObject(n){const r=new 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._flagStartAngle||this._flagEndAngle||this._flagInnerRadius||this._flagOuterRadius){const n=this._startAngle,r=this._endAngle,s=this._innerRadius,o=this._outerRadius,a=Ti(n,Jn)===Ti(r,Jn),l=s>0,c=this.vertices;let d=l?c.length/2:c.length,h,u=0,f,p,g,m,_,y,b,S,x;for(a?d--:l||(d-=2),f=0,p=d-1;f<d;f++){switch(g=f/p,m=c[u],_=g*(r-n)+n,y=(r-n)/d,b=o*Math.cos(_),S=o*Math.sin(_),f){case 0:h=fe.move;break;default:h=fe.curve}m.command=h,m.x=b,m.y=S,m.controls.left.clear(),m.controls.right.clear(),m.command===fe.curve&&(x=o*y/Math.PI,m.controls.left.x=x*Math.cos(_-tt),m.controls.left.y=x*Math.sin(_-tt),m.controls.right.x=x*Math.cos(_+tt),m.controls.right.y=x*Math.sin(_+tt),f===1&&m.controls.left.multiplyScalar(2),f===p&&m.controls.right.multiplyScalar(2)),u++}if(l){for(a?(c[u].command=fe.close,u++):(d--,p=d-1),f=0;f<d;f++)g=f/p,m=c[u],_=(1-g)*(r-n)+n,y=(r-n)/d,b=s*Math.cos(_),S=s*Math.sin(_),h=fe.curve,f<=0&&(h=a?fe.move:fe.line),m.command=h,m.x=b,m.y=S,m.controls.left.clear(),m.controls.right.clear(),m.command===fe.curve&&(x=s*y/Math.PI,m.controls.left.x=x*Math.cos(_+tt),m.controls.left.y=x*Math.sin(_+tt),m.controls.right.x=x*Math.cos(_-tt),m.controls.right.y=x*Math.sin(_-tt),f===1&&m.controls.left.multiplyScalar(2),f===p&&m.controls.right.multiplyScalar(2)),u++;c[u].copy(c[0]),c[u].command=fe.line}else a||(c[u].command=fe.line,c[u].x=0,c[u].y=0,u++,c[u].copy(c[0]),c[u].command=fe.line)}return super._update.call(this),this}flagReset(){return super.flagReset.call(this),this._flagStartAngle=this._flagEndAngle=this._flagInnerRadius=this._flagOuterRadius=!1,this}clone(n){const r=this.innerRadius,s=this.outerRadius,o=this.startAngle,a=this.endAngle,l=this.vertices.length,c=new mn(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<Ne.Properties.length;d++){const h=Ne.Properties[d];c[h]=this[h]}return n&&n.add(c),c}toObject(){const n=super.toObject.call(this);n.renderer.type="arc-segment";for(let r=0;r<mn.Properties.length;r++){const s=mn.Properties[r];n[s]=this[s]}return n}};k(mn,"Properties",["startAngle","endAngle","innerRadius","outerRadius"]);let Ys=mn;const pc={startAngle:{enumerable:!0,get:function(){return this._startAngle},set:function(e){this._startAngle=e,this._flagStartAngle=!0}},endAngle:{enumerable:!0,get:function(){return this._endAngle},set:function(e){this._endAngle=e,this._flagEndAngle=!0}},innerRadius:{enumerable:!0,get:function(){return this._innerRadius},set:function(e){this._innerRadius=e,this._flagInnerRadius=!0}},outerRadius:{enumerable:!0,get:function(){return this._outerRadius},set:function(e){this._outerRadius=e,this._flagOuterRadius=!0}}},Us=Math.cos,Gs=Math.sin,_n=class _n extends Ne{constructor(n,r,s,o){const a=o?Math.max(o,2):4,l=[];for(let c=0;c<a;c++)l.push(new $e(0,0,0,0,0,0));super(l,!0,!0,!0);k(this,"_flagRadius",!1);k(this,"_radius",0);this._renderer.type="circle";for(let c in gc)Object.defineProperty(this,c,gc[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 _n().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<_n.Properties.length;r++){const s=_n.Properties[r];s in n&&typeof n[s]=="number"&&(this[s]=n[s])}return this}_update(){if(this._flagVertices||this._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*Jn,d=s*Us(c),h=s*Gs(c),u=o*Us(c-tt),f=o*Gs(c-tt),p=o*Us(c+tt),g=o*Gs(c+tt),m=this.vertices[a];m.command=a===0?fe.move:fe.curve,m.set(d,h),m.controls.left.set(u,f),m.controls.right.set(p,g)}}return super._update.call(this),this}flagReset(){return this._flagRadius=!1,super.flagReset.call(this),this}clone(n){const r=new _n(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<Ne.Properties.length;s++){const o=Ne.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<_n.Properties.length;r++){const s=_n.Properties[r];n[s]=this[s]}return n}};k(_n,"Properties",["radius"]);let Ks=_n;const gc={radius:{enumerable:!0,get:function(){return this._radius},set:function(e){this._radius=e,this._flagRadius=!0}}},Zs=Math.cos,Js=Math.sin,yn=class yn extends Ne{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 $e);super(c,!0,!0,!0);k(this,"_flagWidth",!1);k(this,"_flagHeight",!1);k(this,"_width",0);k(this,"_height",0);this._renderer.type="ellipse";for(let d in mc)Object.defineProperty(this,d,mc[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 yn().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<yn.Properties.length;r++){const s=yn.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*Jn,d=s*Zs(c),h=o*Js(c),u=s*r*Zs(c-tt),f=o*r*Js(c-tt),p=s*r*Zs(c+tt),g=o*r*Js(c+tt),m=this.vertices[a];m.command=a===0?fe.move:fe.curve,m.set(d,h),m.controls.left.set(u,f),m.controls.right.set(p,g)}}return super._update.call(this),this}flagReset(){return this._flagWidth=this._flagHeight=!1,super.flagReset.call(this),this}clone(n){const r=this.width/2,s=this.height/2,o=this.vertices.length,a=new yn(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<Ne.Properties.length;l++){const c=Ne.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<yn.Properties.length;r++){const s=yn.Properties[r];n[s]=this[s]}return n}};k(yn,"Properties",["width","height"]);let Qs=yn;const mc={width:{enumerable:!0,get:function(){return this._width},set:function(e){this._width=e,this._flagWidth=!0}},height:{enumerable:!0,get:function(){return this._height},set:function(e){this._height=e,this._flagHeight=!0}}},Rm=Math.cos,Fm=Math.sin,bn=class bn extends Ne{constructor(n,r,s,o){o=Math.max(o||0,3);super();k(this,"_flagWidth",!1);k(this,"_flagHeight",!1);k(this,"_flagSides",!1);k(this,"_radius",0);k(this,"_width",0);k(this,"_height",0);k(this,"_sides",0);this._renderer.type="polygon";for(let a in _c)Object.defineProperty(this,a,_c[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 bn().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<bn.Properties.length;r++){const s=bn.Properties[r];s in n&&typeof n[s]=="number"&&(this[s]=n[s])}return this}_update(){if(this._flagVertices||this._flagWidth||this._flagHeight||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=Jn*a+Math.PI/2,c=this._width*Rm(l)/2,d=this._height*Fm(l)/2;o>=s?this.vertices.push(new $e(c,d)):this.vertices[o].set(c,d),this.vertices[o].command=o===0?fe.move:fe.line}}return super._update.call(this),this}flagReset(){return this._flagWidth=this._flagHeight=this._flagSides=!1,super.flagReset.call(this),this}clone(n){const r=new bn(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<Ne.Properties.length;s++){const o=Ne.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<bn.Properties.length;r++){const s=bn.Properties[r];n[s]=this[s]}return n}};k(bn,"Properties",["width","height","sides"]);let eo=bn;const _c={radius:{enumerable:!0,get:function(){return this._radius},set:function(e){this._radius=e,this.width=e*2,this.height=e*2}},width:{enumerable:!0,get:function(){return this._width},set:function(e){this._width=e,this._flagWidth=!0,this._radius=Math.max(this.width,this.height)/2}},height:{enumerable:!0,get:function(){return this._height},set:function(e){this._height=e,this._flagHeight=!0,this._radius=Math.max(this.width,this.height)/2}},sides:{enumerable:!0,get:function(){return this._sides},set:function(e){this._sides=e,this._flagSides=!0}}},gi=class gi extends Ne{constructor(n,r,s,o){const a=[new $e,new $e,new $e,new $e];super(a,!0,!1,!0);k(this,"_flagWidth",0);k(this,"_flagHeight",0);k(this,"_width",0);k(this,"_height",0);k(this,"_origin",null);this._renderer.type="rectangle";for(let l in yc)Object.defineProperty(this,l,yc[l]);this.width=typeof s=="number"?s:1,this.height=typeof o=="number"?o:1,this.origin=new we,typeof n=="number"&&(this.translation.x=n),typeof r=="number"&&(this.translation.y=r),this._update()}static fromObject(n){const r=new gi().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<gi.Properties.length;r++){const s=gi.Properties[r];s in n&&typeof n[s]=="number"&&(this[s]=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 $e),this.vertices[0].set(-n,-r).sub(this._origin).command=fe.move,this.vertices[1].set(n,-r).sub(this._origin).command=fe.line,this.vertices[2].set(n,r).sub(this._origin).command=fe.line,this.vertices[3].set(-n,r).sub(this._origin).command=fe.line,this.vertices[4]&&(this.vertices[4].set(-n,-r).sub(this._origin).command=fe.line)}return super._update.call(this),this}flagReset(){return this._flagWidth=this._flagHeight=!1,super.flagReset.call(this),this}clone(n){const r=new gi(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<Ne.Properties.length;s++){const o=Ne.Properties[s];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}};k(gi,"Properties",["width","height"]);let to=gi;const yc={width:{enumerable:!0,get:function(){return this._width},set:function(e){this._width=e,this._flagWidth=!0}},height:{enumerable:!0,get:function(){return this._height},set:function(e){this._height=e,this._flagHeight=!0}},origin:{enumerable:!0,get:function(){return this._origin},set:function(e){this._origin&&this._origin.unbind(K.Types.change,this._renderer.flagVertices),this._origin=e,this._origin.bind(K.Types.change,this._renderer.flagVertices),this._renderer.flagVertices()}}},wn=class wn extends Ne{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 $e(0,0,0,0,0,0,c===0?fe.move:fe.curve));super(l);k(this,"_flagWidth",!1);k(this,"_flagHeight",!1);k(this,"_flagRadius",!1);k(this,"_width",0);k(this,"_height",0);k(this,"_radius",12);this._renderer.type="rounded-rectangle";for(let c in bc)Object.defineProperty(this,c,bc[c]);this.closed=!0,this.automatic=!1,this._renderer.flagRadius=Mm.bind(this),typeof s=="number"&&(this.width=s),typeof o=="number"&&(this.height=o),typeof a=="number"&&(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 wn().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<wn.Properties.length;r++){const s=wn.Properties[r];if(s in n){const o=n[s];/radius/i.test(s)?this[s]=typeof o=="number"||o instanceof we?o:new we().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 we?(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 wn(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<Ne.Properties.length;l++){const c=Ne.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<wn.Properties.length;r++){const s=wn.Properties[r];n[s]=this[s]}return n.radius=typeof this.radius=="number"?this.radius:this.radius.toObject(),n}};k(wn,"Properties",["width","height","radius"]);let no=wn;const bc={width:{enumerable:!0,get:function(){return this._width},set:function(e){this._width=e,this._flagWidth=!0}},height:{enumerable:!0,get:function(){return this._height},set:function(e){this._height=e,this._flagHeight=!0}},radius:{enumerable:!0,get:function(){return this._radius},set:function(e){this._radius instanceof we&&this._radius.unbind(K.Types.change,this._renderer.flagRadius),this._radius=e,this._radius instanceof we&&this._radius.bind(K.Types.change,this._renderer.flagRadius),this._flagRadius=!0}}};function Mm(){this._flagRadius=!0}const Am=Math.cos,Om=Math.sin,vn=class vn extends Ne{constructor(n,r,s,o,a){arguments.length<=3&&(o=s,s=o/2),(typeof a!="number"||a<=0)&&(a=5);super();k(this,"_flagInnerRadius",!1);k(this,"_flagOuterRadius",!1);k(this,"_flagSides",!1);k(this,"_innerRadius",0);k(this,"_outerRadius",0);k(this,"_sides",0);this._renderer.type="star";for(let l in wc)Object.defineProperty(this,l,wc[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 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._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=Jn*a,c=(o%2?this._outerRadius:this._innerRadius)/2,d=c*Am(l),h=c*Om(l);o>=s?this.vertices.push(new $e(d,h)):this.vertices[o].set(d,h),this.vertices[o].command=o===0?fe.move:fe.line}}return super._update.call(this),this}flagReset(){return this._flagInnerRadius=this._flagOuterRadius=this._flagSides=!1,super.flagReset.call(this),this}clone(n){const r=this.innerRadius,s=this.outerRadius,o=this.sides,a=new vn(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<Ne.Properties.length;l++){const c=Ne.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<vn.Properties.length;r++){const s=vn.Properties[r];n[s]=this[s]}return n}};k(vn,"Properties",["innerRadius","outerRadius","sides"]);let io=vn;const wc={innerRadius:{enumerable:!0,get:function(){return this._innerRadius},set:function(e){this._innerRadius=e,this._flagInnerRadius=!0}},outerRadius:{enumerable:!0,get:function(){return this._outerRadius},set:function(e){this._outerRadius=e,this._flagOuterRadius=!0}},sides:{enumerable:!0,get:function(){return this._sides},set:function(e){this._sides=e,this._flagSides=!0}}};let ro;const vc=Math.min,kc=Math.max;Kt.document&&(ro=document.createElement("canvas"));const ft=class ft extends hn{constructor(n,r,s,o){super();k(this,"_flagValue",!0);k(this,"_flagFamily",!0);k(this,"_flagSize",!0);k(this,"_flagLeading",!0);k(this,"_flagAlignment",!0);k(this,"_flagBaseline",!0);k(this,"_flagStyle",!0);k(this,"_flagWeight",!0);k(this,"_flagDecoration",!0);k(this,"_flagFill",!0);k(this,"_flagStroke",!0);k(this,"_flagLinewidth",!0);k(this,"_flagOpacity",!0);k(this,"_flagVisible",!0);k(this,"_flagMask",!1);k(this,"_flagClip",!1);k(this,"_flagDirection",!0);k(this,"_value","");k(this,"_family","sans-serif");k(this,"_size",13);k(this,"_leading",17);k(this,"_alignment","center");k(this,"_baseline","middle");k(this,"_style","normal");k(this,"_weight",500);k(this,"_decoration","none");k(this,"_direction","ltr");k(this,"_fill","#000");k(this,"_stroke","none");k(this,"_linewidth",1);k(this,"_opacity",1);k(this,"_visible",!0);k(this,"_mask",null);k(this,"_clip",!1);k(this,"_dashes",null);for(let a in xc)Object.defineProperty(this,a,xc[a]);if(this._renderer.type="text",this._renderer.flagFill=Vm.bind(this),this._renderer.flagStroke=zm.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,!Ae.isObject(o))return this;for(let a=0;a<ft.Properties.length;a++){const l=ft.Properties[a];l in o&&(this[l]=o[l])}}static Measure(n){if(ro){const r=ro.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*ft.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:ei(n.fill),s=typeof n.stroke=="string"?n.stroke:ei(n.stroke),o=new ft().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<ft.Properties.length;r++){const s=ft.Properties[r];s in n&&(this[s]=n[s])}return this}clone(n){const r=new ft(this.value);r.translation.copy(this.translation),r.rotation=this.rotation,r.scale=this.scale;for(let s=0;s<ft.Properties.length;s++){const o=ft.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<ft.Properties.length;r++){const s=ft.Properties[r];n[s]=this[s]}return n}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}=ft.Measure(this),h=(this._linewidth||0)/2;switch(this.alignment){case"left":s=-h,o=c+h;break;case"right":s=-(c+h),o=h;break;default:s=-(c/2+h),o=c/2+h}switch(this.baseline){case"middle":a=-(d/2+h),l=d/2+h;break;default:a=-(d+h),l=h}const[u,f]=r.multiply(s,a),[p,g]=r.multiply(s,l),[m,_]=r.multiply(o,a),[y,b]=r.multiply(o,l);return a=vc(f,g,_,b),s=vc(u,p,m,y),o=kc(u,p,m,y),l=kc(f,g,_,b),{top:a,left:s,right:o,bottom:l,width:o-s,height:l-a}}flagReset(){return super.flagReset.call(this),this._flagValue=this._flagFamily=this._flagSize=this._flagLeading=this._flagAlignment=this._flagFill=this._flagStroke=this._flagLinewidth=this._flagOpacity=this._flagVisible=this._flagClip=this._flagDecoration=this._flagClassName=this._flagBaseline=this._flagWeight=this._flagStyle=this._flagDirection=!1,this}};k(ft,"Ratio",.6),k(ft,"Properties",["value","family","size","leading","alignment","linewidth","style","weight","decoration","direction","baseline","opacity","visible","fill","stroke","dashes"]);let Pi=ft;const xc={value:{enumerable:!0,get:function(){return this._value},set:function(e){this._value=e,this._flagValue=!0}},family:{enumerable:!0,get:function(){return this._family},set:function(e){this._family=e,this._flagFamily=!0}},size:{enumerable:!0,get:function(){return this._size},set:function(e){this._size=e,this._flagSize=!0}},leading:{enumerable:!0,get:function(){return this._leading},set:function(e){this._leading=e,this._flagLeading=!0}},alignment:{enumerable:!0,get:function(){return this._alignment},set:function(e){this._alignment=e,this._flagAlignment=!0}},linewidth:{enumerable:!0,get:function(){return this._linewidth},set:function(e){this._linewidth=e,this._flagLinewidth=!0}},style:{enumerable:!0,get:function(){return this._style},set:function(e){this._style=e,this._flagStyle=!0}},weight:{enumerable:!0,get:function(){return this._weight},set:function(e){this._weight=e,this._flagWeight=!0}},decoration:{enumerable:!0,get:function(){return this._decoration},set:function(e){this._decoration=e,this._flagDecoration=!0}},direction:{enumerable:!0,get:function(){return this._direction},set:function(e){this._direction=e,this._flagDirection=!0}},baseline:{enumerable:!0,get:function(){return this._baseline},set:function(e){this._baseline=e,this._flagBaseline=!0}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(e){this._opacity=e,this._flagOpacity=!0}},visible:{enumerable:!0,get:function(){return this._visible},set:function(e){this._visible=e,this._flagVisible=!0}},fill:{enumerable:!0,get:function(){return this._fill},set:function(e){(this._fill instanceof Je||this._fill instanceof _t||this._fill instanceof yt||this._fill instanceof nt)&&this._fill.unbind(K.Types.change,this._renderer.flagFill),this._fill=e,this._flagFill=!0,(this._fill instanceof Je||this._fill instanceof _t||this._fill instanceof yt||this._fill instanceof nt)&&this._fill.bind(K.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(e){(this._stroke instanceof Je||this._stroke instanceof _t||this._stroke instanceof yt||this._stroke instanceof nt)&&this._stroke.unbind(K.Types.change,this._renderer.flagStroke),this._stroke=e,this._flagStroke=!0,(this._stroke instanceof Je||this._stroke instanceof _t||this._stroke instanceof yt||this._stroke instanceof nt)&&this._stroke.bind(K.Types.change,this._renderer.flagStroke)}},mask:{enumerable:!0,get:function(){return this._mask},set:function(e){this._mask=e,this._flagMask=!0,Ae.isObject(e)&&!e.clip&&(e.clip=!0)}},clip:{enumerable:!0,get:function(){return this._clip},set:function(e){this._clip=e,this._flagClip=!0}},dashes:{enumerable:!0,get:function(){return this._dashes},set:function(e){typeof e.offset!="number"&&(e.offset=this.dashes&&this._dashes.offset||0),this._dashes=e}}};function Vm(){this._flagFill=!0}function zm(){this._flagStroke=!0}const Zr=Math.min,Jr=Math.max,kn=class kn extends hn{constructor(n){super();k(this,"_flagAdditions",!1);k(this,"_flagSubtractions",!1);k(this,"_flagOrder",!1);k(this,"_flagOpacity",!0);k(this,"_flagBeginning",!1);k(this,"_flagEnding",!1);k(this,"_flagLength",!1);k(this,"_flagMask",!1);k(this,"_fill","#fff");k(this,"_stroke","#000");k(this,"_linewidth",1);k(this,"_opacity",1);k(this,"_visible",!0);k(this,"_cap","round");k(this,"_join","round");k(this,"_miter",4);k(this,"_closed",!0);k(this,"_curved",!1);k(this,"_automatic",!0);k(this,"_beginning",0);k(this,"_ending",1);k(this,"_length",0);k(this,"_mask",null);for(let r in Cc)Object.defineProperty(this,r,Cc[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++)Sc.call(this,n[r],this)}static RemoveChildren(n){for(let r=0;r<n.length;r++)Sc.call(this,n[r])}static OrderChildren(n){this._flagOrder=!0}static fromObject(n){const r=new kn;for(let o=0;o<kn.Properties.length;o++){const a=kn.Properties[o];a in n&&(/(fill|stroke)/i.test(a)?r[a]=typeof n[a]=="string"?n[a]:ei(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 Ys.fromObject(o);case"circle":return Ks.fromObject(o);case"ellipse":return Qs.fromObject(o);case"points":return Kr.fromObject(o);case"polygon":return eo.fromObject(o);case"rectangle":return to.fromObject(o);case"rounded-rectangle":return no.fromObject(o);case"star":return io.fromObject(o);case"path":return Ne.fromObject(o);case"text":return Pi.fromObject(o);case"group":return kn.fromObject(o);case"shape":return hn.fromObject(o);case"element":return ir.fromObject(o)}return o}}copy(n){return super.copy.call(this,n),console.warn("Two.Group.copy is not supported yet."),this}clone(n){const r=new kn,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,Ae.each(this.children,(r,s)=>{n.children[s]=r.toObject()},this),n}corner(){const n=this.getBoundingClientRect(!0);for(let r=0;r<this.children.length;r++){const s=this.children[r];s.translation.x-=n.left,s.translation.y-=n.top}return this.mask&&(this.mask.translation.x-=n.left,this.mask.translation.y-=n.top),this}center(){const n=this.getBoundingClientRect(!0),r=n.left+n.width/2-this.translation.x,s=n.top+n.height/2-this.translation.y;for(let o=0;o<this.children.length;o++){const a=this.children[o];a.isShape&&(a.translation.x-=r,a.translation.y-=s)}return this.mask&&(this.mask.translation.x-=r,this.mask.translation.y-=s),this}getById(n){let r=null;function s(o){if(o.id===n)return o;if(o.children){if(o.children.ids[n])return o.children.ids[n];for(let a=0;a<o.children.length;a++)if(r=s(o.children[a]),r)return r}return null}return s(this)}getByClassName(n){const r=[];function s(o){if(Array.prototype.indexOf.call(o.classList,n)>=0&&r.push(o),o.children)for(let a=0;a<o.children.length;a++){const l=o.children[a];s(l)}return r}return s(this)}getByType(n){const r=[];function s(o){if(o instanceof n&&r.push(o),o.children)for(let a=0;a<o.children.length;a++){const l=o.children[a];s(l)}return r}return s(this)}add(n){n instanceof Array?n=n.slice():n=Array.prototype.slice.call(arguments);for(let r=0;r<n.length;r++){const s=n[r];if(!(s&&s.id))continue;const o=Array.prototype.indexOf.call(this.children,s);o>=0&&this.children.splice(o,1),this.children.push(s)}return this}remove(n){const r=arguments.length,s=this.parent;if(r<=0&&s)return s.remove(this),this;n instanceof Array?n=n.slice():n=Array.prototype.slice.call(arguments);for(let o=0;o<n.length;o++){const a=n[o];if(!a||!this.children.ids[a.id])continue;const l=this.children.indexOf(a);l>=0&&this.children.splice(l,1)}return this}getBoundingClientRect(n){let r,s,o,a,l,c;this._update(!0);let d=1/0,h=-1/0,u=1/0,f=-1/0;const p=/texture|gradient/i;s=n?this.matrix:this.worldMatrix;for(let g=0;g<this.children.length;g++){const m=this.children[g];if(!(!m.visible||p.test(m._renderer.type))&&(r=m.getBoundingClientRect(n),o=typeof r.top!="number"||Ae.isNaN(r.top)||!isFinite(r.top),a=typeof r.left!="number"||Ae.isNaN(r.left)||!isFinite(r.left),l=typeof r.right!="number"||Ae.isNaN(r.right)||!isFinite(r.right),c=typeof r.bottom!="number"||Ae.isNaN(r.bottom)||!isFinite(r.bottom),!(o||a||l||c)))if(n){const[_,y]=s.multiply(r.left,r.top),[b,S]=s.multiply(r.right,r.top),[x,C]=s.multiply(r.left,r.bottom),[B,v]=s.multiply(r.right,r.bottom);u=Zr(y,S,C,v,u),d=Zr(_,b,x,B,d),h=Jr(_,b,x,B,h),f=Jr(y,S,C,v,f)}else u=Zr(r.top,u),d=Zr(r.left,d),h=Jr(r.right,h),f=Jr(r.bottom,f)}return{top:u,left:d,right:h,bottom:f,width:h-d,height:f-u}}noFill(){return this.children.forEach(function(n){n.noFill()}),this}noStroke(){return this.children.forEach(function(n){n.noStroke()}),this}subdivide(){const n=arguments;return this.children.forEach(function(r){r.subdivide.apply(r,n)}),this}_update(){let n,r,s;if(this._flagBeginning||this._flagEnding){const o=Math.min(this._beginning,this._ending),a=Math.max(this._beginning,this._ending),l=this.length;let c=0;const d=o*l,h=a*l;for(n=0;n<this.children.length;n++)s=this.children[n],r=s.length,d>c+r?(s.beginning=1,s.ending=1):h<c?(s.beginning=0,s.ending=0):d>c&&d<c+r?(s.beginning=(d-c)/r,s.ending=1):h>c&&h<c+r?(s.beginning=0,s.ending=(h-c)/r):(s.beginning=0,s.ending=1),c+=r}return super._update.apply(this,arguments)}flagReset(){return this._flagAdditions&&(this.additions.length=0,this._flagAdditions=!1),this._flagSubtractions&&(this.subtractions.length=0,this._flagSubtractions=!1),this._flagOrder=this._flagMask=this._flagOpacity=this._flagBeginning=this._flagEnding=!1,super.flagReset.call(this),this}};k(kn,"Children",fc),k(kn,"Properties",["fill","stroke","linewidth","cap","join","miter","closed","curved","automatic"]);let un=kn;const Cc={visible:{enumerable:!0,get:function(){return this._visible},set:function(e){this._flagVisible=this._visible!==e||this._flagVisible,this._visible=e}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(e){this._flagOpacity=this._opacity!==e||this._flagOpacity,this._opacity=e}},beginning:{enumerable:!0,get:function(){return this._beginning},set:function(e){this._flagBeginning=this._beginning!==e||this._flagBeginning,this._beginning=e}},ending:{enumerable:!0,get:function(){return this._ending},set:function(e){this._flagEnding=this._ending!==e||this._flagEnding,this._ending=e}},length:{enumerable:!0,get:function(){if(this._flagLength||this._length<=0){if(this._length=0,!this.children)return this._length;for(let e=0;e<this.children.length;e++){const t=this.children[e];this._length+=t.length}}return this._length}},fill:{enumerable:!0,get:function(){return this._fill},set:function(e){this._fill=e;for(let t=0;t<this.children.length;t++){const n=this.children[t];n.fill=e}}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(e){this._stroke=e;for(let t=0;t<this.children.length;t++){const n=this.children[t];n.stroke=e}}},linewidth:{enumerable:!0,get:function(){return this._linewidth},set:function(e){this._linewidth=e;for(let t=0;t<this.children.length;t++){const n=this.children[t];n.linewidth=e}}},join:{enumerable:!0,get:function(){return this._join},set:function(e){this._join=e;for(let t=0;t<this.children.length;t++){const n=this.children[t];n.join=e}}},miter:{enumerable:!0,get:function(){return this._miter},set:function(e){this._miter=e;for(let t=0;t<this.children.length;t++){const n=this.children[t];n.miter=e}}},cap:{enumerable:!0,get:function(){return this._cap},set:function(e){this._cap=e;for(let t=0;t<this.children.length;t++){const n=this.children[t];n.cap=e}}},closed:{enumerable:!0,get:function(){return this._closed},set:function(e){this._closed=e;for(let t=0;t<this.children.length;t++){const n=this.children[t];n.closed=e}}},curved:{enumerable:!0,get:function(){return this._curved},set:function(e){this._curved=e;for(let t=0;t<this.children.length;t++){const n=this.children[t];n.curved=e}}},automatic:{enumerable:!0,get:function(){return this._automatic},set:function(e){this._automatic=e;for(let t=0;t<this.children.length;t++){const n=this.children[t];n.automatic=e}}},children:{enumerable:!0,get:function(){return this._children},set:function(e){const t=un.InsertChildren.bind(this),n=un.RemoveChildren.bind(this),r=un.OrderChildren.bind(this);this._children&&(this._children.unbind(),this._children.length>0&&n(this._children)),this._children=new fc(e),this._children.bind(K.Types.insert,t),this._children.bind(K.Types.remove,n),this._children.bind(K.Types.order,r),e.length>0&&t(e)}},mask:{enumerable:!0,get:function(){return this._mask},set:function(e){this._mask=e,this._flagMask=!0,Ae.isObject(e)&&!e.clip&&(e.clip=!0)}}};function Sc(e,t){const n=e.parent;let r;if(n===t){s();return}if(n&&n.children.ids[e.id]&&(r=Array.prototype.indexOf.call(n.children,e),n.children.splice(r,1),o()),t){s();return}o(),n._flagAdditions&&n.additions.length===0&&(n._flagAdditions=!1),n._flagSubtractions&&n.subtractions.length===0&&(n._flagSubtractions=!1),delete e.parent;function s(){t.subtractions.length>0&&(r=Array.prototype.indexOf.call(t.subtractions,e),r>=0&&t.subtractions.splice(r,1)),t.additions.length>0&&(r=Array.prototype.indexOf.call(t.additions,e),r>=0&&t.additions.splice(r,1)),e.parent=t,t.additions.push(e),t._flagAdditions=!0}function o(){r=Array.prototype.indexOf.call(n.additions,e),r>=0&&n.additions.splice(r,1),r=Array.prototype.indexOf.call(n.subtractions,e),r<0&&(n.subtractions.push(e),n._flagSubtractions=!0)}}class so extends Ne{constructor(t,n,r,s){const o=[new $e(t,n),new $e(r,s)];super(o);for(let a in Bc)Object.defineProperty(this,a,Bc[a]);this.vertices[0].command=fe.move,this.vertices[1].command=fe.line,this.automatic=!1}}const Bc={left:{enumerable:!0,get:function(){return this.vertices[0]},set:function(e){if(Ae.isObject(e))this.vertices.splice(0,1,e);else{const t=new qr("Two.Line.x argument is not an object.");console.warn(t.name,t.message)}}},right:{enumerable:!0,get:function(){return this.vertices[1]},set:function(e){if(Ae.isObject(e))this.vertices.splice(1,1,e);else{const t=new qr("Two.Line.y argument is not an object.");console.warn(t.name,t.message)}}}};class oo{constructor(t=0,n=0){this.x=t,this.y=n}}class ti{constructor(t=10,n=0,r="A"){k(this,"start",new oo);k(this,"end",new oo);this.width=t,this.angle=n,this.label=r}}const ze={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"}},Im={class:"flex gap-3"},Lm={class:"kozyrek-preview w-fill h-[12.5rem] grow touch-none overflow-hidden rounded-lg bg-gray-200 p-2"},Dm={ref:"drawing-container",class:"size-full"},Hm={},Tc=i.defineComponent({...Hm,__name:"kozyrek-configurator-preview",props:{settings:{},value:{},selectTemplateIndex:{}},emits:["pointer:move","pointer:up","template:select"],setup(e,{emit:t}){const n=e,r=t,s=i.useTemplateRef("drawing-container");let o=[],a=[],l=[],c=null;const d=.75,h=i.computed(()=>n.value.configuratorParams.linesAngles.map((P,E)=>new ti(n.value.configuratorParams.linesWidths[E],P,`A-${E+1}`))),u=i.computed(()=>n.value.configuratorParams.colorSide==="bottom"),f=i.computed(()=>{var P,E;return n.value.configuratorParams.startTailType&&((P=n.settings.startTailConfigs)!=null&&P[n.value.configuratorParams.startTailType])?(E=n.settings.startTailConfigs)==null?void 0:E[n.value.configuratorParams.startTailType].points:[]}),p=i.computed(()=>{var P,E;return n.value.configuratorParams.endTailType&&((P=n.settings.endTailConfigs)!=null&&P[n.value.configuratorParams.endTailType])?(E=n.settings.endTailConfigs)==null?void 0:E[n.value.configuratorParams.endTailType].points:[]}),g=(P,E=!1)=>{P[0].start.x=0,P[0].start.y=0;let H=0;for(let I=0;I<P.length;I++){const G=P[I],O=P[I-1]??new ti(0,H);H+=!E||I>1?O.angle:0;const z=(!E||I>0?G.angle:0)+H;if(P[I].end.x=G.width*Math.cos(z*Math.PI/180)+P[I].start.x,P[I].end.y=G.width*Math.sin(z*Math.PI/180)+P[I].start.y,I<P.length-1){const J=I+1;P[J].start.x=P[I].end.x,P[J].start.y=P[I].end.y}}return P},m=(P,E,H,I,G=!1)=>{let O=g([...H,...I]);E.length>0&&(O=[...g(E),...O]);let z=0,J=0,pe=0,re=0;O.forEach(xe=>{z=Math.min(z,xe.start.x,xe.end.x),J=Math.min(J,xe.start.y,xe.end.y),pe=Math.max(pe,xe.start.x,xe.end.x),re=Math.max(re,xe.start.y,xe.end.y)});let ge,ie;z===0&&J===0&&pe===0&&re===0?(ge=1,ie=1):(ge=P.width/Math.abs(pe-z),ie=(G?P.height:P.height-ze.colorSideLabel.size)/Math.abs(re-J));const Me=Math.min(ge,ie);return z=z<0?-z*Me:0,J=J<0?-J*Me:0,[Me,z,J]},_=P=>{const E=new Kr([P]);return E._size=ze.anchorPoint.size,E.fill=ze.anchorPoint.color,E.stroke="transparent",E._linewidth=ze.anchorPoint.strokeSize,l.push(E),E},y=(P,E)=>{if(l=[],n.settings.allowChangeFirstPoint){const H=P[0],I=new we(H.vertices[0].x,H.vertices[0].y);I.bind(K.Types.change,()=>{H.vertices[0].copy(I)});const G=_(I);E.add(G)}P.forEach((H,I)=>{const G=P[I+1],O=new we(H.vertices[1].x,H.vertices[1].y);O.bind(K.Types.change,()=>{H.vertices[1].copy(O),G!==void 0&&G.vertices[0].copy(O)});const z=_(O);E.add(z)})},b=P=>P*(Math.PI/180),S=(P,E,H)=>{const I=E.vertices.length-1;P.position.x=E.vertices[I].x,P.position.y=E.vertices[I].y;const G=Math.atan2(E.vertices[I].y-E.vertices[0].y,E.vertices[I].x-E.vertices[0].x);P.rotation=b(H)+G},x=(P,E,H)=>{if(E.vertices[0]===void 0)return;P.position.x=E.vertices[0].x,P.position.y=E.vertices[0].y;const I=E.vertices.length-1,G=Math.atan2(E.vertices[I].y-E.vertices[0].y,E.vertices[I].x-E.vertices[0].x);P.rotation=b(H)+G},C=(P,E,H)=>{const I=new un;if(P.length===0)return I;const G=[];return[...P].reverse().forEach((O,z)=>{z!==0&&O.angle>0&&(O.angle*=-1),G.push(O)}),P=g(G,!0),x(I,E,P[0].angle),[E.vertices[0],E.vertices[1]].forEach(O=>{O.bind(K.Types.change,()=>{x(I,E,P[0].angle)})}),P.forEach(O=>{const z=O.start.x*H,J=O.end.x*H,pe=O.start.y*H,re=O.end.y*H,ge=new so(z,pe,J,re);ge.linewidth=ze.line.size,ge.stroke=ze.line.color,I.add(ge)}),I},B=(P,E,H)=>{const I=new un;return P.length===0||(P=g(P,!0),S(I,E,P[0].angle),[E.vertices[0],E.vertices[1]].forEach(G=>{G.bind(K.Types.change,()=>{S(I,E,P[0].angle)})}),P.forEach(G=>{const O=G.start.x*H,z=G.end.x*H,J=G.start.y*H,pe=G.end.y*H,re=new so(O,J,z,pe);re.linewidth=ze.line.size,re.stroke=ze.line.color,I.add(re)})),I},v=(P,E,H,I)=>{const G=E.vertices[0].x+(E.vertices[1].x-E.vertices[0].x)/2-8*Math.sin(P.angle*Math.PI/180),O=E.vertices[0].y+(E.vertices[1].y-E.vertices[0].y)/2-8*Math.cos(P.angle*Math.PI/180),z=new Pi(P.label,G+10,O-10);let J;z.size=ze.lineLabel.size,z.weight=600,z.fill=ze.lineLabel.color,z.id+=1,z.rotation=ze.lineLabel.rotation,I>0&&(J=new Pi(`${P.angle}°`,E.vertices[0].x+25,E.vertices[0].y-25),J.size=ze.angleLabel.size,J.weight=600,J.fill=ze.angleLabel.color,J.rotation=ze.angleLabel.rotation,J.id+=I,o.push(J),H.add(J)),H.add(z),F(z,E,0,J),F(z,E,1)},$=()=>{const{size:P}=ze.colorSideLabel,E=0,H=0,I=u.value?P/2:P/2-P,G=u.value?P/2-P:P/2,O=new un;if(!c)return O;const z=5,J=Math.atan2(G-I,H-E),pe=[new $e(E,I,0,0,0,0,he.Commands.move),new $e(H,G,0,0,0,0,he.Commands.line),new $e(H-z*Math.cos(J-Math.PI/4),G-z*Math.sin(J-Math.PI/4),0,0,0,0,he.Commands.line),new $e(H,G,0,0,0,0,he.Commands.move),new $e(H-z*Math.cos(J+Math.PI/4),G-z*Math.sin(J+Math.PI/4),0,0,0,0,he.Commands.line)],re=new Ne(pe,!1,!1,!0);re.noFill(),re.cap="round",re.join="round",re.linewidth=P/7,re.stroke=ze.colorSideLabel.color,O.add(re);const ge=new Pi(u.value?"Цвет снизу":"Цвет сверху",10,0);ge.size=P,ge.weight=600,ge.fill=ze.colorSideLabel.color,ge.alignment="left",O.add(ge);const ie=O.getBoundingClientRect();return O.position.x=(c.width-ie.width)*d+10,O.position.y=u.value?c.height+ie.height*2:ie.height/2,O},F=(P,E,H,I)=>{E.vertices[H].bind(K.Types.change,()=>{const G=E.vertices.length-1,O=Math.atan2(E.vertices[0].y-E.vertices[G].y,E.vertices[0].x-E.vertices[G].x)*180/Math.PI,z=E.vertices[0].x+(E.vertices[G].x-E.vertices[0].x)/2-8*Math.sin(O*Math.PI/180),J=E.vertices[0].y+(E.vertices[G].y-E.vertices[0].y)/2-8*Math.cos(O*Math.PI/180);P.position.x=z+10,P.position.y=J-10,P.rotation=-.5,I&&(I.position.x=E.vertices[0].x+25,I.position.y=E.vertices[0].y-25)})},R=(P,E,H,I,G=!1)=>{var Ce;if(P.clear(),H.length===0){P.update();return}const O=g(H),[z,J,pe]=m(P,E,O,I,G),re=new un,ge=new Array,ie=new Array;G||(o=[],a=[]),O.forEach((Fe,Ie)=>{const vt=Fe.start.x*z+J,xn=Fe.end.x*z+J,Mt=Fe.start.y*z+pe,Xt=Fe.end.y*z+pe,Tt=new so(vt,Mt,xn,Xt);Tt.linewidth=G?ze.previewLine.size:ze.line.size,Tt.stroke=G?ze.previewLine.color:ze.line.color,a.push(Tt),ge.push(Tt),re.add(Tt),!G&&Fe.label!==""&&v(Fe,Tt,re,Ie)});const Me=ge.at(-1);let xe=re.getBoundingClientRect();if(!G){const Fe=$();ie.push(Fe)}if(E.length>0){const Fe=C(E,ge[0],z);re.add(Fe)}if(I.length>0&&Me){const Fe=B(I,Me,z);re.add(Fe)}if(ie.push(re),P.makeGroup(ie),xe=re.getBoundingClientRect(),re.position.x=0-xe.left+(P.width-xe.width)/(2*(G?1:d)),re.position.y=0-xe.top+(P.height-xe.height)/(2*(G?1:d)),P.update(),!G){const Fe=((Ce=n.value.configuratorParams)==null?void 0:Ce.colorSide)==="top";re.position.y=re.position.y+ze.colorSideLabel.size*Number(Fe),y(ge,re),P.update()}},X=(P,E)=>{if(P&&!E.isNewRec()){const H=new he({width:P.scrollWidth,height:P.scrollHeight});H.appendTo(P),R(H,[],E.points,[],!0)}},M=()=>{c&&R(c,f.value,h.value,p.value,!1)},N=P=>P*(180/Math.PI),A=(P,E)=>{const H=P[1].x-P[0].x,I=P[1].y-P[0].y,G=E[1].x-E[0].x,O=E[1].y-E[0].y;let z=Math.atan2(H*O-I*G,H*G+I*O);return z=N(z),Math.round(z)*-1},L=P=>{const E=a.map((H,I,G)=>{const O=G[I-1]??{vertices:[{x:-10,y:0},{x:0,y:0}]};let z=Math.ceil(H._length/P/n.settings.lineWidthStep)*n.settings.lineWidthStep;const J=o[I-1];z<(G.length>1?n.settings.minLineWidth:n.settings.stripMinWidth)&&(z=G.length>1?n.settings.minLineWidth:n.settings.stripMinWidth),z>n.settings.maxLineWidth&&(z=n.settings.maxLineWidth);const pe=A(H.vertices,O.vertices);return J&&(J.value=`${pe}°`),new ti(z,pe,`A-${I+1}`)});r("pointer:move",E)},U=P=>{let E=null,H;const I=J=>{E=l.find(pe=>{const re=pe.renderer;return(re==null?void 0:re.elem)===J.target}),[H]=m(P,f.value,h.value.map(pe=>pe),p.value)},G=J=>{if(E){const pe=E.renderer,re=pe==null?void 0:pe.elem;if(!re)return;const ge=re.getBoundingClientRect();E.vertices[0].x-=ge.x-(J instanceof MouseEvent?J.clientX:J.targetTouches[0].clientX)+ze.anchorPoint.size/2,E.vertices[0].y-=ge.y-(J instanceof MouseEvent?J.clientY:J.targetTouches[0].clientY)+ze.anchorPoint.size/2,L(H),P.update()}},O=()=>{E&&r("pointer:up",h.value),E=null},z=s.value;z&&(z.addEventListener("touchstart",I),z.addEventListener("touchend",O),z.addEventListener("mousedown",I),z.addEventListener("mouseup",O),z.addEventListener("mousemove",G),z.addEventListener("touchmove",G))};return i.onMounted(()=>{s.value&&(c=new he({width:s.value.scrollWidth,height:s.value.scrollHeight,fullscreen:!1}).appendTo(s.value),c.scene.scale=d,c.update(),i.watch(()=>n.value,()=>{M()},{deep:!0,immediate:!0}),U(c))}),i.onBeforeUnmount(()=>{c&&(c.clear(),c=null)}),(P,E)=>(i.openBlock(),i.createElementBlock("div",Im,[i.createVNode(Ta,{"select-template-index":P.selectTemplateIndex,settings:P.settings,"onTemplate:select":E[0]||(E[0]=H=>r("template:select",H)),onInitDrawTemplate:X},null,8,["select-template-index","settings"]),i.createElementVNode("div",Lm,[i.createElementVNode("div",Dm,null,512)])]))}}),Wm={class:"flex max-w-[50rem] flex-col gap-3"},jm={},Xm=i.defineComponent({...jm,__name:"kozyrek-configurator",props:{settings:{},cartItem:{},client:{}},emits:["submit-success"],setup(e,{emit:t}){const n=e,r=t,s=i.ref(!1),o=i.ref(!1),a=i.ref(!1),l=i.ref(n.cartItem),c=i.ref(n.settings),d=i.ref({linesWidths:[...n.cartItem.configuratorParams.linesWidths],linesAngles:[...n.cartItem.configuratorParams.linesAngles]}),h=i.ref({quantity:{},marker:{},length:{}}),u=i.ref(0),f=(C=0)=>{const B=c.value.allTemplates.at(C);B!==void 0&&(u.value=C,l.value.configuratorParams.linesWidths=B.points.map(v=>W.isArray(v)?v[0]:v.width),l.value.configuratorParams.linesAngles=B.points.map(v=>W.isArray(v)?v[1]:v.angle),y()),m(l.value.configuratorParams)},p=async()=>{const C=prompt("Введите название шаблона:");if(!C)return;a.value=!0;const B={label:C,points:l.value.configuratorParams.linesWidths.map((v,$)=>[v,l.value.configuratorParams.linesAngles[$]])};await Y.HttpRequester.getInstance(Y.ConfiguratorProvider).createTemplate(n.cartItem.category,B,h.value).then(()=>{c.value.addCustomTemplate(B),u.value=c.value.allTemplates.length-1}).catch(()=>{a.value=!1}),a.value=!1},g=()=>{c.value.showOnlyTemplates||c.value.allowSaveTemplates&&(u.value=c.value.allTemplates.length-1)},m=async C=>{y(),s.value=!0,await Y.HttpRequester.getInstance(Y.ConfiguratorProvider).searchProduct(n.cartItem.category,C,h.value).then(B=>{l.value.product=B}).catch(()=>{s.value=!1}),s.value=!1},_=async()=>{o.value=!0,await(l.value.isNewRec()?Y.HttpRequester.getInstance(Y.CartProvider).addCartItem(n.client,l.value).then(C=>{r("submit-success",C)}).catch(()=>{o.value=!1}):Y.HttpRequester.getInstance(Y.CartProvider).patchCartItem(n.client,l.value).then(C=>{r("submit-success",C)}).catch(()=>{o.value=!1})),o.value=!1},y=()=>{const C={quantity:h.value.quantity,marker:h.value.marker};l.value.configuratorParams.linesWidths.forEach((B,v)=>{C[`lines_widths[${v+1}]`]={},C[`lines_angles[${v+1}]`]={}}),h.value=C},b=C=>{d.value.linesWidths=C.map(B=>B.width),d.value.linesAngles=C.map(B=>B.angle)},S=C=>{l.value.configuratorParams.linesWidths=d.value.linesWidths,l.value.configuratorParams.linesAngles=d.value.linesAngles,y(),g(),m(l.value.configuratorParams)},x=(C,B)=>{d.value.linesWidths=C,d.value.linesAngles=B};return i.onBeforeMount(()=>{f()}),(C,B)=>(i.openBlock(),i.createElementBlock("div",Wm,[i.createVNode(Tc,{value:l.value,"select-template-index":u.value,settings:c.value,"onPointer:up":S,"onPointer:move":b,"onTemplate:select":f},null,8,["value","select-template-index","settings"]),i.createVNode(Na,{value:l.value,"onUpdate:value":B[0]||(B[0]=v=>l.value=v),"preview-params":d.value,validation:h.value,settings:c.value,"is-submit-processing":o.value,"is-product-searching":s.value,"select-template-index":u.value,"onUpdate:params":B[1]||(B[1]=v=>m(v)),"onUpdate:preview":x,onSubmit:_,"onClick:saveTemplate":p},null,8,["value","preview-params","validation","settings","is-submit-processing","is-product-searching","select-template-index"])]))}});class Ri extends Y.Identity{constructor(n,r){super();k(this,"label","");k(this,"points",[]);k(this,"isCustom",!1);k(this,"id",-1);k(this,"guid","");n?(this.label=n.label,this.points=n.points.map((s,o)=>W.isArray(s)?new ti(s[0],s[1],`A-${o+1}`):new ti(s.width,s.angle,`A-${o+1}`))):(this.label="-- Новая конфигурация --",this.points=[new ti(0,0,"A-1")],this.isCustom=!0,this.id=r??this.id)}}class ao extends Ri{constructor(n){super(n);k(this,"isDefault");this.isDefault=n.isDefault??!1}}class qm{constructor(t){k(this,"minLineWidth");k(this,"maxLineWidth");k(this,"lineWidthStep");k(this,"minLineAngle");k(this,"maxLineAngle");k(this,"lineAngleStep");k(this,"stripMinWidth");k(this,"stripMaxWidth");k(this,"stripMinLength");k(this,"stripMaxLength");k(this,"allowShowTable");k(this,"showOnlyTemplates");k(this,"templates");k(this,"customTemplates",[]);k(this,"startTailConfigs");k(this,"endTailConfigs");k(this,"bendCountForExtended");k(this,"extendedProductCatalog");k(this,"allowChangeFirstPoint");k(this,"allowSaveTemplates");k(this,"userTemplatesPrefix");k(this,"lengthStep");this.minLineWidth=t.minLineWidth,this.maxLineWidth=t.maxLineWidth,this.lineWidthStep=t.lineWidthStep,this.minLineAngle=t.minLineAngle,this.maxLineAngle=t.maxLineAngle,this.lineAngleStep=t.lineAngleStep,this.stripMinWidth=t.stripMinWidth,this.stripMaxWidth=t.stripMaxWidth,this.stripMinLength=t.stripMinLength,this.stripMaxLength=t.stripMaxLength,this.allowShowTable=t.allowShowTable,this.showOnlyTemplates=t.showOnlyTemplates,this.templates=t.templates.map(n=>new Ri(n)),this.templates.forEach((n,r)=>{n.id=r}),this.startTailConfigs=t.startTailConfigs.map(n=>new ao(n)),this.endTailConfigs=t.endTailConfigs.map(n=>new ao(n)),this.bendCountForExtended=t.bendCountForExtended,this.extendedProductCatalog=t.extendedProductCatalog,this.allowChangeFirstPoint=t.allowChangeFirstPoint,this.allowSaveTemplates=t.allowSaveTemplates,this.userTemplatesPrefix=t.userTemplatesPrefix,this.lengthStep=t.lengthStep,this.showOnlyTemplates||(this.customTemplates=t.customTemplates?Object.entries(t.customTemplates).map(([n,r])=>{const s=new Ri(r);return s.isCustom=!0,s.id=+n,s}):[],this.customTemplates.push(new Ri))}get allTemplates(){return[...this.templates,...this.customTemplates]}addCustomTemplate(t){var r,s;if(!this.allowSaveTemplates)return;const n=new Ri(t);n.isCustom=!0,n.id=(((r=this.customTemplates.at(-1))==null?void 0:r.id)??((s=this.templates.at(-1))==null?void 0:s.id)??0)+1,this.customTemplates.splice(-1,0,n)}removeCustomTemplate(t){if(this.allowSaveTemplates)return;const n=this.customTemplates.findIndex(r=>r.id===t);n&&n!==-1&&this.customTemplates.splice(n,1)}}const Ym={},Fi=i.defineComponent({...Ym,__name:"debounced-input-number",props:{value:{default:void 0},clearable:{type:Boolean,default:!1},debounceTime:{default:500},placeholder:{default:""},min:{default:void 0},max:{default:void 0},step:{default:1},validator:{type:Function,default:void 0}},emits:["update:value"],setup(e,{expose:t,emit:n}){const r=e,s=n,o=i.ref(r.value),a=i.computed(()=>i.inject("debounce-input-time",r.debounceTime)),l=W.debounce(()=>s("update:value",o.value),a.value),c=p=>{o.value=p,l()};i.watch(()=>r.value,p=>{o.value=p});const d=i.ref(null);return t({focus:()=>{var p;return(p=d.value)==null?void 0:p.focus()},blur:()=>{var p;return(p=d.value)==null?void 0:p.blur()},select:()=>{var p;return(p=d.value)==null?void 0:p.select()}}),(p,g)=>(i.openBlock(),i.createBlock(i.unref(V.NInputNumber),{ref_key:"inputReference",ref:d,value:o.value,"onUpdate:value":[g[0]||(g[0]=m=>o.value=m),c],clearable:p.clearable,placeholder:p.placeholder,min:p.min,max:p.max,step:p.step,validator:p.validator},null,8,["value","clearable","placeholder","min","max","step","validator"]))}}),Um={class:"flex flex-col gap-3"},Gm={},Ec=i.defineComponent({...Gm,__name:"metal-for-doors-configurator-form",props:{value:{},settings:{},isProductSearching:{type:Boolean,default:!1},isSubmitProcessing:{type:Boolean,default:!1},validation:{default:void 0}},emits:["update:value","update:params","click:view-switch","submit"],setup(e,{emit:t}){const n=e,r=t,s=i.useTemplateRef("first-input-element"),o=i.ref(W.cloneDeep(i.toRaw(n.value.configuratorParams))),a=()=>{o.value.length>0&&o.value.width>0&&(r("update:params",o.value),l("configuratorParams",o.value))},l=(c,d)=>{const h=new Y.CartItemBase(n.value);h[c]=d,r("update:value",h)};return i.onMounted(()=>{n.value.isNewRec()&&i.nextTick(()=>{var c;(c=s.value)==null||c.focus()})}),(c,d)=>{const h=V.NInput;return i.openBlock(),i.createBlock(i.unref(V.NForm),{disabled:c.isSubmitProcessing,class:"flex flex-col gap-2"},{default:i.withCtx(()=>[i.createVNode(i.unref(V.NFormItem),{required:!0,feedback:c.validation.width.feedback||"","show-feedback":c.validation.width.showFeedback||!1,"validation-status":c.validation.width.validationStatus||void 0,label:`Ширина, ${c.settings.minWidth?" от "+c.settings.minWidth:""}${c.settings.maxWidth?" до "+c.settings.maxWidth:""} мм`},{default:i.withCtx(()=>[i.createVNode(Fi,{ref:"first-input-element",value:o.value.width,"onUpdate:value":[d[0]||(d[0]=u=>o.value.width=u),a],class:"w-full",max:c.settings.maxWidth??void 0,min:c.settings.minWidth,validator:u=>!!u&&u>=c.settings.minWidth&&(!c.settings.maxWidth||u<=c.settings.maxWidth),placeholder:"Введите ширину"},null,8,["value","max","min","validator"])]),_:1},8,["feedback","show-feedback","validation-status","label"]),i.createVNode(i.unref(V.NFormItem),{required:!0,feedback:c.validation.length.feedback||"","show-feedback":c.validation.length.showFeedback||!1,"validation-status":c.validation.length.validationStatus||void 0,label:`Длина, ${c.settings.minLength?" от "+c.settings.minLength:""}${c.settings.maxLength?" до "+c.settings.maxLength:""} мм`},{default:i.withCtx(()=>[i.createVNode(Fi,{value:o.value.length,"onUpdate:value":[d[1]||(d[1]=u=>o.value.length=u),a],placeholder:"Введите длину",max:c.settings.maxLength,min:c.settings.minLength,validator:u=>u>=c.settings.minLength&&u<=c.settings.maxLength,class:"w-full"},null,8,["value","max","min","validator"])]),_:1},8,["feedback","show-feedback","validation-status","label"]),i.createVNode(i.unref(V.NFormItem),{required:!0,feedback:c.validation.quantity.feedback||"","show-feedback":c.validation.quantity.showFeedback||!1,"validation-status":c.validation.quantity.validationStatus||void 0,label:"Количество"},{default:i.withCtx(()=>[i.createVNode(i.unref(V.NInputNumber),{value:c.value.quantity,placeholder:"Введите количество",min:1,validator:u=>u>0,class:"w-full","onUpdate:value":d[2]||(d[2]=u=>l("quantity",u??0))},null,8,["value","validator"])]),_:1},8,["feedback","show-feedback","validation-status"]),i.createVNode(i.unref(V.NFormItem),{feedback:c.validation.marker.feedback||"","show-feedback":c.validation.marker.showFeedback||!1,"validation-status":c.validation.marker.validationStatus||void 0,label:"Маркировка"},{default:i.withCtx(()=>[i.createVNode(h,{value:c.value.marker,placeholder:"Введите маркировку","onUpdate:value":d[3]||(d[3]=u=>l("marker",u))},null,8,["value"])]),_:1},8,["feedback","show-feedback","validation-status"]),i.createVNode(qi,{"is-product-searching":c.isProductSearching,product:c.value.product},null,8,["is-product-searching","product"]),i.createElementVNode("div",Um,[i.createVNode(i.unref(V.NButton),{disabled:c.value.product.isNewRec()||c.isProductSearching||c.isSubmitProcessing||c.value.length===0||c.value.width===0||c.value.quantity===0,type:"primary",class:"self-start",onClick:d[4]||(d[4]=u=>r("submit",c.value))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(c.value.isNewRec()?"В корзину":"Изменить"),1)]),_:1},8,["disabled"]),c.settings.allowShowTable?(i.openBlock(),i.createBlock(i.unref(V.NButton),{key:0,type:"tertiary",class:"self-start",onClick:d[5]||(d[5]=u=>r("click:view-switch"))},{default:i.withCtx(()=>d[6]||(d[6]=[i.createTextVNode(" Показать в виде списка ")])),_:1,__:[6]})):i.createCommentVNode("",!0)])]),_:1},8,["disabled"])}}}),Km={class:"w-104 px-5"},Zm={},Jm=i.defineComponent({...Zm,__name:"metal-for-doors-configurator",props:{settings:{},cartItem:{},client:{}},emits:["submit-success"],setup(e,{emit:t}){const n=e,r=t,s=i.ref(n.cartItem),o=i.ref({width:{},length:{},quantity:{},marker:{}}),a=i.ref(!1),l=i.ref(!1),c=async h=>{a.value=!0,await Y.HttpRequester.getInstance(Y.ConfiguratorProvider).searchProduct(n.cartItem.category,h,o.value).then(u=>{s.value.product=u}).catch(()=>{a.value=!1}),a.value=!1},d=async()=>{l.value=!0,await(s.value.isNewRec()?Y.HttpRequester.getInstance(Y.CartProvider).addCartItem(n.client,s.value).then(h=>{r("submit-success",h)}).catch(()=>{l.value=!1}):Y.HttpRequester.getInstance(Y.CartProvider).patchCartItem(n.client,s.value).then(h=>{r("submit-success",h)}).catch(()=>{l.value=!1})),l.value=!1};return(h,u)=>(i.openBlock(),i.createElementBlock("div",Km,[i.createVNode(Ec,{value:s.value,"onUpdate:value":u[0]||(u[0]=f=>s.value=f),validation:o.value,settings:h.settings,"is-submit-processing":l.value,"onUpdate:params":u[1]||(u[1]=f=>c(f)),onSubmit:u[2]||(u[2]=f=>d())},null,8,["value","validation","settings","is-submit-processing"])]))}}),Qm={key:0,class:"flex items-baseline gap-1"},e0={key:0,class:"flex items-baseline gap-1"},t0={class:"flex gap-3"},n0={},$c=i.defineComponent({...n0,__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(e,{emit:t}){const n=e,r=t,s=i.computed(()=>pt.isPhoneDevice()),o=i.ref(W.cloneDeep(i.toRaw(n.value.configuratorParams))),a=i.computed(()=>n.settings.widthOverlaps[o.value.mountType]??0),l=i.computed(()=>n.settings.heightOverlaps[o.value.mountType]??0),c=i.computed(()=>n.settings.maxWidths[o.value.netType]),d=i.computed(()=>n.settings.maxHeights[o.value.netType]-l.value),h=(f,p)=>{f&&f in o.value&&(o.value[f]=p??0),r("update:params",o.value),u("configuratorParams",o.value)},u=(f,p)=>{const g=new Y.CartItemBase(n.value);g[f]=p,r("update:value",g)};return(f,p)=>{const g=V.NInput;return i.openBlock(),i.createBlock(i.unref(V.NForm),{class:"flex flex-col gap-2 px-4 md:max-w-96"},{default:i.withCtx(()=>[i.createVNode(i.unref(V.NFormItem),{required:!0,"show-feedback":!1,label:"Тип сетки"},{default:i.withCtx(()=>[i.createVNode(i.unref(V.NSelect),{value:o.value.netType,"onUpdate:value":[p[0]||(p[0]=m=>o.value.netType=m),h],options:f.settings.netType.map(m=>({label:f.settings.descriptions.net_type[m],value:m}))},null,8,["value","options"])]),_:1}),i.createVNode(i.unref(V.NFormItem),{required:!0,"show-feedback":!1,label:"Цвет профиля"},{default:i.withCtx(()=>[i.createVNode(i.unref(V.NSelect),{value:o.value.color,"onUpdate:value":p[1]||(p[1]=m=>o.value.color=m),options:f.settings.color.map(m=>({label:f.settings.descriptions.color[m],value:m}))},null,8,["value","options"])]),_:1}),i.createVNode(i.unref(V.NFormItem),{required:!0,"show-feedback":!1,label:"Вид крепления"},{default:i.withCtx(()=>[i.createVNode(i.unref(V.NSelect),{value:o.value.mountType,"onUpdate:value":[p[2]||(p[2]=m=>o.value.mountType=m),h],options:f.settings.mountType.map(m=>({label:f.settings.descriptions.mount_type[m],value:m}))},null,8,["value","options"])]),_:1}),i.createVNode(i.unref(V.NFormItem),{required:!0,feedback:f.validation.width.feedback||"","show-feedback":f.validation.width.showFeedback||o.value.width>=f.settings.minWidth&&o.value.width<=f.settings.maxWidths[o.value.netType],"validation-status":f.validation.width.validationStatus||void 0,label:`Ширина светового проёма от ${f.settings.minWidth-a.value} ${c.value?" до "+c.value:""} мм.`},{feedback:i.withCtx(()=>[!f.validation.width.showFeedback&&o.value.width>=f.settings.minWidth&&o.value.width<=f.settings.maxWidths[o.value.netType]?(i.openBlock(),i.createElementBlock("div",Qm,[i.createVNode(i.unref(V.NText),{type:"success"},{default:i.withCtx(()=>[i.createTextVNode("Ширина готового изделия "+i.toDisplayString(o.value.width+a.value),1)]),_:1}),i.createVNode(i.unref(V.NButton),{quaternary:"",type:"info",size:"tiny",onClick:p[4]||(p[4]=m=>r("click:instructions-toggle"))},{default:i.withCtx(()=>p[11]||(p[11]=[i.createElementVNode("span",{class:"text-sm"},"Руководство",-1)])),_:1,__:[11]})])):i.createCommentVNode("",!0)]),default:i.withCtx(()=>[i.createVNode(Fi,{value:o.value.width&&o.value.width-a.value,max:c.value,min:f.settings.minWidth-a.value,placeholder:"Введите ширину светового проёма",class:"w-full","onUpdate:value":p[3]||(p[3]=m=>h("width",(m&&m+a.value)??void 0))},null,8,["value","max","min"])]),_:1},8,["feedback","show-feedback","validation-status","label"]),i.createVNode(i.unref(V.NFormItem),{required:!0,feedback:f.validation.height.feedback||"","show-feedback":f.validation.height.showFeedback||o.value.height>=f.settings.minHeight&&o.value.height<=f.settings.maxHeights[o.value.netType],"validation-status":f.validation.height.validationStatus||void 0,label:`Высота светового проёма от ${f.settings.minHeight-l.value} ${d.value?" до "+d.value:""} мм.`},{feedback:i.withCtx(()=>[!f.validation.height.showFeedback&&o.value.height>=f.settings.minHeight&&o.value.height<=f.settings.maxHeights[o.value.netType]?(i.openBlock(),i.createElementBlock("div",e0,[i.createVNode(i.unref(V.NText),{type:"success"},{default:i.withCtx(()=>[i.createTextVNode("Высота готового изделия "+i.toDisplayString(o.value.height+l.value),1)]),_:1}),i.createVNode(i.unref(V.NButton),{quaternary:"",type:"info",size:"tiny",onClick:p[6]||(p[6]=m=>r("click:instructions-toggle"))},{default:i.withCtx(()=>p[12]||(p[12]=[i.createElementVNode("span",{class:"text-sm"},"Руководство",-1)])),_:1,__:[12]})])):i.createCommentVNode("",!0)]),default:i.withCtx(()=>[i.createVNode(Fi,{value:o.value.height&&o.value.height-l.value,max:d.value,min:f.settings.minHeight-l.value,placeholder:"Введите высоту светового проёма",class:"w-full","onUpdate:value":p[5]||(p[5]=m=>h("height",(m&&m+l.value)??void 0))},null,8,["value","max","min"])]),_:1},8,["feedback","show-feedback","validation-status","label"]),i.createVNode(i.unref(V.NFormItem),{required:!0,feedback:f.validation.quantity.feedback||"","show-feedback":f.validation.quantity.showFeedback||!1,"validation-status":f.validation.quantity.validationStatus||void 0,label:"Количество"},{default:i.withCtx(()=>[i.createVNode(i.unref(V.NInputNumber),{value:f.value.quantity,"onUpdate:value":p[7]||(p[7]=m=>f.value.quantity=m),min:1,validator:m=>Number.isInteger(m),placeholder:"Введите количество",class:"w-full"},null,8,["value","validator"])]),_:1},8,["feedback","show-feedback","validation-status"]),i.createVNode(i.unref(V.NFormItem),{feedback:f.validation.marker.feedback||"","show-feedback":f.validation.marker.showFeedback||!1,"validation-status":f.validation.marker.validationStatus||void 0,label:"Маркировка"},{default:i.withCtx(()=>[i.createVNode(g,{value:f.value.marker,"onUpdate:value":p[8]||(p[8]=m=>f.value.marker=m),placeholder:"Введите маркировку"},null,8,["value"])]),_:1},8,["feedback","show-feedback","validation-status"]),i.createVNode(qi,{"is-product-searching":f.isProductSearching,product:f.value.product},null,8,["is-product-searching","product"]),i.createElementVNode("div",t0,[i.createVNode(i.unref(V.NButton),{loading:f.isSubmitProcessing,disabled:f.isProductSearching||!f.value.product||f.value.product.isNewRec()||o.value.width<f.settings.minHeight-l.value||o.value.height<f.settings.minHeight-l.value,type:"primary",class:"self-start",onClick:p[9]||(p[9]=m=>r("submit",f.value))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(f.value.isNewRec()?"В корзину":"Изменить"),1)]),_:1},8,["loading","disabled"]),s.value?(i.openBlock(),i.createBlock(i.unref(V.NButton),{key:0,type:"default",onClick:p[10]||(p[10]=m=>r("click:show-preview-drawer"))},{default:i.withCtx(()=>p[13]||(p[13]=[i.createTextVNode(" Предварительный просмотр ")])),_:1,__:[13]})):i.createCommentVNode("",!0)])]),_:1})}}}),i0="/img/configurators/mosquitto/measurement-instructions/measurement-height.png",r0="/img/configurators/mosquitto/measurement-instructions/measurement-width.png",s0="/img/configurators/mosquitto/measurement-instructions/mount.png",o0="/img/configurators/mosquitto/measurement-instructions/mount-z-plastic.png",a0="/img/configurators/mosquitto/measurement-instructions/mount-z-metal.png",l0={class:"flex flex-col gap-6"},c0={class:"flex gap-4"},d0={class:"flex flex-col gap-2"},h0={class:"flex gap-4"},u0={class:"flex flex-col gap-2"},f0={class:"flex gap-4"},p0={class:"flex flex-col gap-2"},g0={},Nc=i.defineComponent({...g0,__name:"mosquito-configurator-measurement-instructions",props:{heightOverlaps:{},widthOverlaps:{},show:{type:Boolean}},emits:["update:show"],setup(e,{emit:t}){const n=pt.initRefDependingOnDeviceResolution("small","small","medium"),r=pt.initRefDependingOnDeviceResolution(.98,.95,.8),s=i.computed(()=>window.innerWidth*r.value),o=t;return(a,l)=>{const c=V.NText;return i.openBlock(),i.createBlock(i.unref(V.NModal),{show:a.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",l0,[i.createVNode(c,{type:"error",class:"text-base font-medium"},{default:i.withCtx(()=>l[3]||(l[3]=[i.createTextVNode(" Важно! Для того,что бы произвести замер, необходимо открыть оконную створку. ")])),_:1,__:[3]}),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:i0,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:r0,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",c0,[l[9]||(l[9]=i.createElementVNode("img",{src:s0,alt:"measurement-height",class:"w-[7.5rem]"},null,-1)),i.createElementVNode("div",d0,[l[8]||(l[8]=i.createElementVNode("span",{class:"text-lg font-bold"},"Крепление на раме сетки",-1)),i.createElementVNode("span",null,[l[4]||(l[4]=i.createTextVNode(" Расчетные размеры москитной сетки: ")),l[5]||(l[5]=i.createElementVNode("br",null,null,-1)),i.createTextVNode(" Ширина светового проема +"+i.toDisplayString(a.widthOverlaps.frame)+" мм. Высота светового проема +"+i.toDisplayString(a.heightOverlaps.frame)+" мм. ",1),l[6]||(l[6]=i.createElementVNode("br",null,null,-1)),l[7]||(l[7]=i.createTextVNode(" Крепления находятся на раме сетки. "))])])]),i.createElementVNode("div",h0,[l[15]||(l[15]=i.createElementVNode("img",{src:o0,alt:"measurement-height",class:"w-[7.5rem]"},null,-1)),i.createElementVNode("div",u0,[l[14]||(l[14]=i.createElementVNode("span",{class:"text-lg font-bold"},"Z-Образное крепление пластик (верх+низ)",-1)),i.createElementVNode("span",null,[l[10]||(l[10]=i.createTextVNode(" Расчетные размеры москитной сетки:")),l[11]||(l[11]=i.createElementVNode("br",null,null,-1)),i.createTextVNode(" Ширина светового проема +"+i.toDisplayString(a.widthOverlaps.external_plastic)+" мм. Высота светового проема +"+i.toDisplayString(a.heightOverlaps.external_plastic)+" мм. ",1),l[12]||(l[12]=i.createElementVNode("br",null,null,-1)),l[13]||(l[13]=i.createTextVNode(" Крепления прикручиваются к раме окна c помощью шурупов. "))])])]),i.createElementVNode("div",f0,[l[21]||(l[21]=i.createElementVNode("img",{src:a0,alt:"measurement-height",class:"w-[7.5rem]"},null,-1)),i.createElementVNode("div",p0,[l[20]||(l[20]=i.createElementVNode("span",{class:"text-lg font-bold"},"Z-Образное крепление металл (верх+низ)",-1)),i.createElementVNode("span",null,[l[16]||(l[16]=i.createTextVNode(" Расчетные размеры москитной сетки: ")),l[17]||(l[17]=i.createElementVNode("br",null,null,-1)),i.createTextVNode(" Ширина светового проема +"+i.toDisplayString(a.widthOverlaps.external_metal)+" мм. Высота светового проема +"+i.toDisplayString(a.heightOverlaps.external_metal)+" мм. ",1),l[18]||(l[18]=i.createElementVNode("br",null,null,-1)),l[19]||(l[19]=i.createTextVNode(" Крепления прикручиваются к раме окна c помощью шурупов. "))])])])])]),_:1},8,["show","size","style"])}}}),m0={class:"flex flex-col items-center justify-between rounded-xl"},_0={class:"img-preview relative flex justify-center"},y0={},b0=i.defineComponent({...y0,__name:"mosquito-configurator-preview",props:{configuratorParams:{},settings:{}},emits:["open-instructions"],setup(e,{emit:t}){const n=e,r=i.computed(()=>W.keys(n.settings.crossbarCount).find(o=>n.settings.crossbarCount[Number(o)]&&(!n.settings.crossbarCount[Number(o)+1]||n.configuratorParams.height<n.settings.crossbarCount[Number(o)+1]-n.settings.heightOverlaps[n.configuratorParams.mountType]))),s=t;return(o,a)=>{const l=V.NButton;return i.openBlock(),i.createElementBlock("div",m0,[i.createElementVNode("div",_0,[a[1]||(a[1]=i.createElementVNode("div",{class:"window"},null,-1)),i.createElementVNode("div",{class:i.normalizeClass(["net",`net-${o.configuratorParams.netType}`])},null,2),i.createElementVNode("div",{class:i.normalizeClass(["frame",`frame-${o.configuratorParams.color}`])},null,2),r.value?(i.openBlock(),i.createElementBlock("div",{key:0,class:i.normalizeClass(["frame-crossbar",`frame-crossbar-${r.value}-${o.configuratorParams.color}`])},null,2)):i.createCommentVNode("",!0),i.createElementVNode("div",{class:i.normalizeClass(["mount",`mount-${o.configuratorParams.mountType}-${o.configuratorParams.color}`])},null,2),i.createElementVNode("div",{class:i.normalizeClass(["cut-preview",`cut-preview-${o.configuratorParams.mountType}-${o.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,__:[2]})])}}}),lo=Ln(b0,[["__scopeId","data-v-8b43aa68"]]),w0={class:"grid md:grid-cols-2"},v0={},k0=i.defineComponent({...v0,__name:"mosquito-configurator",props:{settings:{},cartItem:{},client:{}},emits:["submit-success"],setup(e,{emit:t}){const n=e,r=t,s=i.computed(()=>pt.isPhoneDevice()),o=i.ref(!1),a=i.ref(!1),l=i.ref(n.cartItem),c=i.ref({width:{},height:{},quantity:{},marker:{}}),d=i.ref(!1),h=i.ref(!1),u=async p=>{p.height>0&&p.width>0&&(d.value=!0,await Y.HttpRequester.getInstance(Y.ConfiguratorProvider).searchProduct(n.cartItem.category,p,c.value).then(g=>{l.value.product=g}).catch(()=>{d.value=!1}),d.value=!1)},f=async()=>{h.value=!0,await(l.value.isNewRec()?Y.HttpRequester.getInstance(Y.CartProvider).addCartItem(n.client,l.value).then(p=>{r("submit-success",p)}).catch(()=>{h.value=!1}):Y.HttpRequester.getInstance(Y.CartProvider).patchCartItem(n.client,l.value).then(p=>{r("submit-success",p)}).catch(()=>{h.value=!1})),h.value=!1};return(p,g)=>{const m=Br;return i.openBlock(),i.createElementBlock(i.Fragment,null,[i.createVNode(Nc,{show:a.value,"onUpdate:show":g[0]||(g[0]=_=>a.value=_),"height-overlaps":p.settings.heightOverlaps,"width-overlaps":p.settings.widthOverlaps},null,8,["show","height-overlaps","width-overlaps"]),i.createElementVNode("div",w0,[s.value?(i.openBlock(),i.createBlock(i.unref(V.NDrawer),{key:1,show:o.value,"onUpdate:show":g[4]||(g[4]=_=>o.value=_),"default-width":375,resizable:""},{default:i.withCtx(()=>[i.createVNode(i.unref(V.NDrawerContent),null,{header:i.withCtx(()=>[i.createVNode(i.unref(V.NButton),{size:"small",type:"primary",class:"block justify-self-end",onClick:g[2]||(g[2]=_=>o.value=!1)},{default:i.withCtx(()=>[i.createVNode(m)]),_:1})]),default:i.withCtx(()=>[i.createVNode(lo,{"configurator-params":l.value.configuratorParams,settings:p.settings,onOpenInstructions:g[3]||(g[3]=_=>a.value=!0)},null,8,["configurator-params","settings"])]),_:1})]),_:1},8,["show"])):(i.openBlock(),i.createBlock(lo,{key:0,"configurator-params":l.value.configuratorParams,settings:p.settings,onOpenInstructions:g[1]||(g[1]=_=>a.value=!0)},null,8,["configurator-params","settings"])),i.createVNode($c,{value:l.value,"onUpdate:value":g[5]||(g[5]=_=>l.value=_),validation:c.value,settings:p.settings,"is-product-searching":d.value,"is-submit-processing":h.value,"onUpdate:params":g[6]||(g[6]=_=>u(_)),onSubmit:g[7]||(g[7]=_=>f()),"onClick:instructionsToggle":g[8]||(g[8]=_=>a.value=!a.value),"onClick:showPreviewDrawer":g[9]||(g[9]=_=>o.value=!0)},null,8,["value","validation","settings","is-product-searching","is-submit-processing"])])],64)}}}),x0={},Pc=i.defineComponent({...x0,__name:"strip-configurator-line-item",props:{value:{},index:{},settings:{},product:{default:void 0},addLineButtonDisabled:{type:Boolean,default:!1},removeLineButtonDisabled:{type:Boolean,default:!1},suggestionOption:{default:void 0},autoFocus:{type:Boolean,default:!1},validation:{default:()=>({})}},emits:["update:value","click:add-line","click:remove-line"],setup(e,{expose:t,emit:n}){const r=e,s=n,o=i.useTemplateRef("width-input-element"),a=i.ref(!1),l=d=>{s("update:value",d??0,r.index,a)};i.onMounted(()=>{r.autoFocus&&i.nextTick(()=>{c()})});const c=()=>{var d;(d=o.value)==null||d.select()};return t({focusWidthInput:c}),(d,h)=>{const u=$a,f=Ea;return i.openBlock(),i.createBlock(i.unref(V.NFormItem),{label:`Полоса №${d.index+1}, мм`,required:!0},{feedback:i.withCtx(()=>[i.createVNode(qi,{"is-product-searching":a.value,product:d.product},null,8,["is-product-searching","product"])]),default:i.withCtx(()=>[i.createVNode(i.unref(V.NDropdown),{trigger:"click",options:d.suggestionOption,placement:"bottom-start",size:"large",onSelect:l},{default:i.withCtx(()=>[i.createVNode(Fi,{ref:"width-input-element",value:d.value,class:"w-full",step:d.value<d.settings.minLineWidth?d.settings.minLineWidth-d.value:d.settings.lineWidthStep,validator:p=>!!p&&p>=d.settings.minLineWidth&&p%d.settings.lineWidthStep===0,placeholder:"Введите ширину","onUpdate:value":l},null,8,["value","step","validator"])]),_:1},8,["options"]),i.createVNode(i.unref(V.NButton),{disabled:d.addLineButtonDisabled,size:"medium",class:"ml-2",onClick:h[0]||(h[0]=p=>s("click:add-line",d.index))},{default:i.withCtx(()=>[i.createVNode(u)]),_:1},8,["disabled"]),i.createVNode(i.unref(V.NButton),{disabled:d.removeLineButtonDisabled,size:"medium",class:"ml-2",onClick:h[1]||(h[1]=p=>s("click:remove-line",d.index))},{default:i.withCtx(()=>[i.createVNode(f)]),_:1},8,["disabled"])]),_:1},8,["label"])}}}),C0={class:"my-2 flex w-full flex-col"},S0={class:"flex gap-3"},B0={},Rc=i.defineComponent({...B0,__name:"strip-configurator-form",props:{value:{},settings:{},isSubmitProcessing:{type:Boolean,default:!1},validation:{default:void 0}},emits:["update:value","update:params","click:view-switch","submit","click:add-line","click:remove-line"],setup(e,{emit:t}){const n=e,r=t,s=i.computed(()=>n.value[0].configuratorParams.linesWidths.map(h=>h).reduce((h,u)=>h+u,0)),o=i.computed(()=>n.settings.width-s.value),a=i.computed(()=>!n.value.some(({product:h})=>!h)),l=i.computed(()=>o.value===0?void 0:[{label:`${(o.value>0?"Остаток +":"Излишек ")+o.value} мм.`,key:o.value}]),c=(h,u,f)=>{const p=n.value.at(u);if(p)if(h&&h>=n.settings.minLineWidth&&h%n.settings.lineWidthStep===0){const g={linesWidths:p.configuratorParams.linesWidths.toSpliced(u,1,h)};r("update:params",g,u,f),d("configuratorParams",g)}else p.product.id=-1},d=(h,u)=>{const f=n.value.map(p=>new Y.CartItemBase(p));f.forEach(p=>{p[h]=u}),r("update:value",f)};return(h,u)=>{const f=V.NText,p=V.NInput;return i.openBlock(),i.createBlock(i.unref(V.NForm),{class:"flex flex-col gap-2"},{default:i.withCtx(()=>{var g;return[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(h.value,(m,_)=>(i.openBlock(),i.createBlock(Pc,{key:_,"auto-focus":!0,index:_,value:m.configuratorParams.linesWidths.at(_)??0,product:m.product,settings:h.settings,"suggestion-option":l.value,"add-line-button-disabled":o.value<=0||h.value.length>=h.settings.maxLinesCount,"remove-line-button-disabled":h.value.length===1,"onUpdate:value":c,"onClick:addLine":u[0]||(u[0]=y=>r("click:add-line",y)),"onClick:removeLine":u[1]||(u[1]=y=>r("click:remove-line",y))},null,8,["index","value","product","settings","suggestion-option","add-line-button-disabled","remove-line-button-disabled"]))),128)),i.createElementVNode("div",C0,[o.value<0?(i.openBlock(),i.createBlock(f,{key:0,type:"error"},{default:i.withCtx(()=>[i.createTextVNode(" Сумма ширин всех полос должна быть равна "+i.toDisplayString(h.settings.width),1)]),_:1})):i.createCommentVNode("",!0),a.value&&h.value.length===h.settings.maxLinesCount&&o.value>0?(i.openBlock(),i.createBlock(f,{key:1,type:"error"},{default:i.withCtx(()=>u[8]||(u[8]=[i.createTextVNode(" Остаток резки должен быть равен 0 ")])),_:1,__:[8]})):i.createCommentVNode("",!0),i.createElementVNode("div",null,[u[9]||(u[9]=i.createTextVNode(" Остаток для резки: ")),i.createVNode(f,{type:o.value>=0?"Success":"error"},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(o.value),1)]),_:1},8,["type"]),i.createTextVNode(" из "+i.toDisplayString(h.settings.width)+" мм ",1)])]),i.createVNode(i.unref(V.NButton),{loading:h.isSubmitProcessing,disabled:!a.value||o.value<=0||h.value.length>=h.settings.maxLinesCount,type:"primary",class:"self-center",onClick:u[2]||(u[2]=m=>r("click:add-line",h.value.length))},{default:i.withCtx(()=>u[10]||(u[10]=[i.createTextVNode(" Добавить полосу ")])),_:1,__:[10]},8,["loading","disabled"]),i.createVNode(i.unref(V.NFormItem),{required:!0,label:`Метраж ${h.settings.minLength?" от "+h.settings.minLength:""} ${h.settings.maxLength?" до "+h.settings.maxLength:""} м.`},{default:i.withCtx(()=>[i.createVNode(i.unref(V.NInputNumber),{value:n.value[0].length,max:h.settings.maxLength||void 0,min:h.settings.minLength,step:h.settings.lengthStep,validator:m=>m%h.settings.lengthStep===0,placeholder:"Введите метраж",class:"w-full","onUpdate:value":u[3]||(u[3]=m=>d("length",m??0))},null,8,["value","max","min","step","validator"])]),_:1},8,["label"]),i.createVNode(i.unref(V.NFormItem),{required:!0,label:"Количество"},{default:i.withCtx(()=>[i.createVNode(i.unref(V.NInputNumber),{value:n.value[0].quantity,min:1,validator:m=>Number.isInteger(m),placeholder:"Введите количество",class:"w-full","onUpdate:value":u[4]||(u[4]=m=>d("quantity",m??0))},null,8,["value","validator"])]),_:1}),i.createVNode(i.unref(V.NFormItem),{label:"Маркировка"},{default:i.withCtx(()=>[i.createVNode(p,{value:n.value[0].marker,placeholder:"Введите маркировку","onUpdate:value":u[5]||(u[5]=m=>d("marker",m))},null,8,["value"])]),_:1}),i.createElementVNode("div",S0,[i.createVNode(i.unref(V.NButton),{loading:h.isSubmitProcessing,disabled:!a.value||o.value!=0||!((g=h.value[0])!=null&&g.length)||h.value[0].length>h.settings.maxLength||h.value[0].length<h.settings.minLength||h.value[0].quantity===0,type:"primary",class:"self-start",onClick:u[6]||(u[6]=m=>r("submit",h.value))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(h.value[0].isNewRec()?"В корзину":"Изменить"),1)]),_:1},8,["loading","disabled"]),h.settings.allowShowTable?(i.openBlock(),i.createBlock(i.unref(V.NButton),{key:0,type:"tertiary",class:"self-start",onClick:u[7]||(u[7]=m=>r("click:view-switch"))},{default:i.withCtx(()=>u[11]||(u[11]=[i.createTextVNode(" Показать в виде списка ")])),_:1,__:[11]})):i.createCommentVNode("",!0)])]}),_:1})}}}),T0={class:"flex grow flex-col"},E0=["src"],$0={class:"w-full"},N0={},Fc=i.defineComponent({...N0,__name:"strip-configurator-preview",props:{value:{},settings:{}},setup(e){return(t,n)=>(i.openBlock(),i.createElementBlock("div",T0,[i.createElementVNode("img",{src:"/img/configurators/strip/strip-"+t.value.length+".png",class:"w-full max-w-96 self-center",alt:"Штрипс"},null,8,E0),i.createElementVNode("div",$0,[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)])]))}}),P0={class:"w-104 flex grow flex-col px-5"},R0={},F0=i.defineComponent({...R0,__name:"strip-configurator",props:{settings:{},cartItems:{},client:{}},emits:["submit-success"],setup(e,{emit:t}){const n=e,r=t,s=i.ref(n.cartItems),o=i.ref({width:{},length:{},quantity:{},marker:{}}),a=i.ref(!1),l=i.computed(()=>s.value[0].configuratorParams.linesWidths.map(f=>f).reduce((f,p)=>f+p,0)),c=f=>{f===void 0&&(f=s.value.length-1);const p=s.value.at(0);if(!p)return;p.configuratorParams.linesWidths=p.configuratorParams.linesWidths.toSpliced(f+1,0,0),s.value.forEach(m=>{m.configuratorParams.linesWidths=p.configuratorParams.linesWidths});const g=new Y.CartItemBase({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}});s.value=s.value.toSpliced(f+1,0,g)},d=f=>{const p=s.value.at(0);p&&(p.configuratorParams.linesWidths=p.configuratorParams.linesWidths.toSpliced(f,1),s.value.forEach(g=>{g.configuratorParams.linesWidths=p.configuratorParams.linesWidths}),s.value=s.value.toSpliced(f,1),delete o[`linesWidths.${f}`],delete o[`linesWidths.${f}`])},h=async(f,p,g)=>{g.value=!0,await Y.HttpRequester.getInstance(Y.ConfiguratorProvider).searchProduct(s.value[p].category,{linesWidths:f.linesWidths.at(p)},o.value).then(m=>{s.value[p].product=m,s.value.length<n.settings.maxLinesCount&&l.value<n.settings.width&&c()}).catch(()=>{s.value[p].product=new Y.Product,g.value=!1}),g.value=!1},u=async()=>{a.value=!0,await(s.value[0].isNewRec()?Y.HttpRequester.getInstance(Y.CartProvider).addCartItem(n.client,s.value[0]).then(f=>{r("submit-success",f)}).catch(()=>{a.value=!1}):Y.HttpRequester.getInstance(Y.CartProvider).patchCartItem(n.client,s.value[0]).then(f=>{r("submit-success",f)}).catch(()=>{a.value=!1})),a.value=!1};return(f,p)=>(i.openBlock(),i.createElementBlock("div",P0,[i.createVNode(Fc,{value:s.value,"onUpdate:value":p[0]||(p[0]=g=>s.value=g),settings:f.settings},null,8,["value","settings"]),i.createVNode(Rc,{value:s.value,"onUpdate:value":p[1]||(p[1]=g=>s.value=g),validation:o.value,settings:f.settings,"is-submit-processing":a.value,"onUpdate:params":h,onSubmit:u,"onClick:addLine":c,"onClick:removeLine":d},null,8,["value","validation","settings","is-submit-processing"])]))}}),M0={class:"flex flex-row gap-2.5"},A0={class:"flex flex-col"},O0={class:"flex flex-col"},V0={},z0=i.defineComponent({...V0,__name:"date-range",props:{clearable:{type:Boolean,default:!0},dateRange:{default:void 0},dateFormat:{default:()=>Y.AppConfigProvider.getConfig().dateFormats.uiDate},predefinedDateRanges:{default:void 0},useDefaultPredefinedDateRanges:{type:Boolean,default:!1}},emits:["update:date-range"],setup(e,{emit:t}){const n=e,r=t,s=i.computed(()=>{if(n.predefinedDateRanges)return n.predefinedDateRanges;if(n.useDefaultPredefinedDateRanges){const a={};return W.forOwn(Y.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?Sn.startOfDay(new Date(a)):void 0,to:l?Sn.endOfDay(new Date(l)):void 0})};return(a,l)=>{var h,u,f,p;const c=V.NButton,d=V.NDatePicker;return i.openBlock(),i.createElementBlock("div",M0,[i.createVNode(d,{value:(u=(h=a.dateRange)==null?void 0:h.from)==null?void 0:u.getTime(),clearable:a.clearable,"is-date-disabled":g=>{var m,_;return((m=a.dateRange)==null?void 0:m.to)&&g>((_=a.dateRange)==null?void 0:_.to)},format:a.dateFormat,type:"date",onUpdateValue:l[0]||(l[0]=g=>{var m,_;return o(g,(_=(m=a.dateRange)==null?void 0:m.to)==null?void 0:_.getTime())})},i.createSlots({_:2},[s.value?{name:"footer",fn:i.withCtx(()=>[i.createElementVNode("div",A0,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(s.value,(g,m)=>(i.openBlock(),i.createBlock(c,{key:m,class:"my-1 mr-2",size:"small",type:"info",ghost:"",onClick:_=>{var y,b;return o((y=g==null?void 0:g.from)==null?void 0:y.getTime(),(b=g==null?void 0:g.to)==null?void 0:b.getTime())}},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(g.label),1)]),_:2},1032,["onClick"]))),128))])]),key:"0"}:void 0]),1032,["value","clearable","is-date-disabled","format"]),i.createVNode(d,{value:(p=(f=a.dateRange)==null?void 0:f.to)==null?void 0:p.getTime(),clearable:a.clearable,"is-date-disabled":g=>{var m,_;return((m=a.dateRange)==null?void 0:m.from)&&g<((_=a.dateRange)==null?void 0:_.from)},format:a.dateFormat,type:"date",onUpdateValue:l[1]||(l[1]=g=>{var m,_;return o((_=(m=a.dateRange)==null?void 0:m.from)==null?void 0:_.getTime(),g)})},i.createSlots({_:2},[s.value?{name:"footer",fn:i.withCtx(()=>[i.createElementVNode("div",O0,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(s.value,(g,m)=>(i.openBlock(),i.createBlock(c,{key:m,class:"my-1 mr-2",size:"small",type:"info",ghost:"",onClick:_=>{var y,b;return o((y=g==null?void 0:g.from)==null?void 0:y.getTime(),(b=g==null?void 0:g.to)==null?void 0:b.getTime())}},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(g.label),1)]),_:2},1032,["onClick"]))),128))])]),key:"0"}:void 0]),1032,["value","clearable","is-date-disabled","format"])])}}}),I0={class:"sc-lbl-date text-nowrap"},L0={},co=i.defineComponent({...L0,__name:"date-time-label",props:{date:{},isTimeSecondary:{type:Boolean},isTimeOnSecondLine:{type:Boolean}},setup(e){const t=e,n=i.computed(()=>Sn.format(t.date,Y.AppConfigProvider.getConfig().dateFormats.uiDate)),r=i.computed(()=>Sn.format(t.date,"HH:mm"));return(s,o)=>(i.openBlock(),i.createElementBlock("span",{class:i.normalizeClass({"flex flex-col":s.isTimeOnSecondLine})},[i.createElementVNode("span",I0,i.toDisplayString(n.value),1),i.createElementVNode("span",{class:i.normalizeClass([{"text-sc-grey":s.isTimeSecondary,"ml-1":!s.isTimeOnSecondLine},"sc-lbl-time"])},i.toDisplayString(r.value),3)],2))}}),D0={class:"flex flex-row gap-2.5"},H0={class:"flex grow basis-0 flex-row flex-wrap justify-start justify-items-start gap-y-1 md:flex-nowrap"},W0={class:"flex min-w-0 flex-col-reverse flex-wrap-reverse justify-end gap-1 sm:flex-row"},j0={class:"mb-0.5 sm:mb-0 sm:ml-3"},X0={},q0=i.defineComponent({...X0,__name:"dialog-header",props:{showCloseButton:{type:Boolean,default:!0}},emits:["close"],setup(e){return(t,n)=>{const r=Br,s=V.NButton,o=V.NPopover;return i.openBlock(),i.createElementBlock("div",D0,[i.createElementVNode("div",H0,[i.renderSlot(t.$slots,"main")]),i.createElementVNode("div",null,[i.createElementVNode("div",W0,[i.renderSlot(t.$slots,"extra-buttons"),i.createElementVNode("div",j0,[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=>t.$emit("close"))},{default:i.withCtx(()=>[i.createVNode(r)]),_:1})]),default:i.withCtx(()=>[n[1]||(n[1]=i.createTextVNode(" Закрыть "))]),_:1,__:[1]})):i.createCommentVNode("",!0)])])])])}}}),Y0={key:0,class:"flex flex-row gap-2.5"},U0={key:1,class:"flex flex-row flex-wrap justify-end gap-2.5"},G0={},K0=i.defineComponent({...G0,__name:"base-dialog",props:{show:{type:Boolean},title:{},sizes:{default:()=>({phone:{size:"small",scale:.98},tablet:{size:"small",scale:.9},default:{size:"medium",scale:.7}})},processing:{type:Boolean,default:!1},acceptButton:{default:()=>({show:!0,text:"ОК"})},cancelButton:{default:()=>({show:!0,text:"Отмена"})}},emits:["update:show","opening","closing","accept","processing:cancel"],setup(e,{expose:t,emit:n}){const r=e,s=n,o=i.ref(r.show),a=i.ref(r.processing),l=pt.initRefDependingOnDeviceResolution(r.sizes.phone.size,r.sizes.tablet.size,r.sizes.default.size),c=pt.initRefDependingOnDeviceResolution(r.sizes.phone.scale,r.sizes.tablet.scale,r.sizes.default.scale),d=i.computed(()=>window.innerWidth*c.value),h=()=>{s("opening"),o.value=!0,s("update:show",o.value)},u=(p="other")=>{if(a.value){s("processing:cancel",y=>{a.value=y});return}let g=!1;s("closing",p,()=>{g=!0}),g||(o.value=!1,s("update:show",o.value))},f=()=>{s("accept",g=>{a.value=g})};return i.watch(()=>r.show,p=>{p?h():u("other")}),i.watch(()=>r.processing,p=>{a.value=p}),t({open:h,close:u}),(p,g)=>{const m=V.NButton,_=V.NModal;return i.openBlock(),i.createBlock(_,{loading:a.value,show:o.value,"show-icon":!1,size:i.unref(l),style:i.normalizeStyle(`width: ${d.value}px`),title:p.title,"action-class":p.$slots["extra-action"]?"grid grid-cols-2 !justify-between":void 0,preset:"dialog",onClose:g[1]||(g[1]=y=>u("header")),onEsc:g[2]||(g[2]=y=>u("esc")),onMaskClick:g[3]||(g[3]=y=>u("mask"))},i.createSlots({default:i.withCtx(()=>[i.renderSlot(p.$slots,"default")]),_:2},[p.$slots.header?{name:"header",fn:i.withCtx(()=>[i.renderSlot(p.$slots,"header")]),key:"0"}:void 0,p.$slots.action||p.$slots["extra-action"]||p.acceptButton.show||p.cancelButton.show?{name:"action",fn:i.withCtx(()=>[p.$slots["extra-action"]?(i.openBlock(),i.createElementBlock("div",Y0,[i.renderSlot(p.$slots,"extra-action")])):i.createCommentVNode("",!0),p.$slots.action||p.acceptButton.show||p.cancelButton.show?(i.openBlock(),i.createElementBlock("div",U0,[i.renderSlot(p.$slots,"action",{disabled:a.value}),p.acceptButton.show??!0?(i.openBlock(),i.createBlock(m,{key:0,disabled:a.value,size:i.unref(l),type:"primary",onClick:f},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(p.acceptButton.text??"ОК"),1)]),_:1},8,["disabled","size"])):i.createCommentVNode("",!0),p.cancelButton.show??!0?(i.openBlock(),i.createBlock(m,{key:1,size:i.unref(l),type:"default",onClick:g[0]||(g[0]=y=>u("footer"))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(p.cancelButton.text??"Отмена"),1)]),_:1},8,["size"])):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)]),key:"1"}:void 0]),1032,["loading","show","size","style","title","action-class"])}}}),Z0={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function J0(e,t){return i.openBlock(),i.createElementBlock("svg",Z0,t[0]||(t[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 Q0=i.markRaw({name:"ion-download-outline",render:J0}),e_={},t_=i.defineComponent({...e_,__name:"single-file-upload-selector",props:{draggedAreaText:{}},emits:["update:file"],setup(e,{emit:t}){const n=t,r=i.ref({name:"",content:""}),s=o=>{if(r.value={name:"",content:""},o.length===0)return;const a=o[0];r.value.name=a.name;const l=new FileReader;l.addEventListener("load",()=>{r.value.content=l.result??"",n("update:file",r.value)}),l.readAsDataURL(a.file)};return(o,a)=>{const l=Q0,c=V.NUploadDragger,d=V.NUpload;return i.openBlock(),i.createBlock(d,{"default-upload":!1,max:1,action:"","directory-dnd":"",class:"content-center","onUpdate:fileList":s},{default:i.withCtx(()=>[i.createVNode(c,null,{default:i.withCtx(()=>[i.renderSlot(o.$slots,"dragged-area",{},()=>[i.createElementVNode("div",null,[i.createVNode(l,{class:"text-2xl"}),i.createElementVNode("div",null,i.toDisplayString(o.draggedAreaText??"Перетащите в эту область файл, который необходимо загрузить."),1)])])]),_:3})]),_:3})}}}),n_={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function i_(e,t){return i.openBlock(),i.createElementBlock("svg",n_,t[0]||(t[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 r_=i.markRaw({name:"ion-checkmark-done-sharp",render:i_}),s_={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function o_(e,t){return i.openBlock(),i.createElementBlock("svg",s_,t[0]||(t[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 a_=i.markRaw({name:"ion-options-outline",render:o_}),l_={class:"flex flex-row gap-x-2.5 p-0 sm:p-1"},c_={class:"flex-auto"},d_={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"},h_={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"},u_={},ho=i.defineComponent({...u_,__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(e,{emit:t}){const n=t,r=i.ref(!1),s=()=>{n("edit")},o=()=>{r.value=!1},a=()=>{r.value=!0,n("apply",o)},l=()=>{n("cancel",o)};return(c,d)=>{const h=a_,u=V.NButton,f=V.NPopover,p=r_,g=Br;return i.openBlock(),i.createElementBlock("div",l_,[i.createElementVNode("div",c_,[i.renderSlot(c.$slots,"default")]),i.createElementVNode("div",null,[i.createElementVNode("div",d_,[i.createElementVNode("div",h_,[c.showEditButton?(i.openBlock(),i.createBlock(f,{key:0,placement:"bottom"},{trigger:i.withCtx(()=>[i.createVNode(u,{disabled:c.disabled||r.value,type:"info",ghost:"",size:"small",onClick:s},{default:i.withCtx(()=>[i.createVNode(h)]),_:1},8,["disabled"])]),default:i.withCtx(()=>[d[0]||(d[0]=i.createTextVNode(" Редактировать данные "))]),_:1,__:[0]})):i.createCommentVNode("",!0),c.showApplyButton?(i.openBlock(),i.createBlock(f,{key:1,disabled:r.value,placement:"bottom"},{trigger:i.withCtx(()=>[i.createVNode(u,{disabled:c.disabled||r.value,type:"primary",size:"small",onClick:a},{default:i.withCtx(()=>[i.createVNode(p)]),_:1},8,["disabled"])]),default:i.withCtx(()=>[d[1]||(d[1]=i.createTextVNode(" Сохранить изменения "))]),_:1,__:[1]},8,["disabled"])):i.createCommentVNode("",!0),c.showCancelButton?(i.openBlock(),i.createBlock(f,{key:2,placement:"bottom"},{trigger:i.withCtx(()=>[i.createVNode(u,{disabled:c.disabled||r.value,type:"error",size:"small",onClick:l},{default:i.withCtx(()=>[i.createVNode(g)]),_:1},8,["disabled"])]),default:i.withCtx(()=>[d[2]||(d[2]=i.createTextVNode(" Отменить изменения "))]),_:1,__:[2]})):i.createCommentVNode("",!0)]),i.renderSlot(c.$slots,"extra-buttons")])])])}}}),f_={},Mc=i.defineComponent({...f_,__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(e,{emit:t}){const n=e,r=t,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(l,c)=>(i.openBlock(),i.createElementBlock("div",null,[s.value?(i.openBlock(),i.createBlock(ho,{key:1,disabled:l.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(ho,{key:0,disabled:l.disabled,"show-edit-button":l.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"]))]))}}),p_={},g_=i.defineComponent({...p_,__name:"debounced-input",props:{value:{default:void 0},clearable:{type:Boolean,default:!1},debounceTime:{default:800},placeholder:{default:""}},emits:["update:value"],setup(e,{emit:t}){const n=e,r=t,s=i.ref(n.value),o=i.computed(()=>i.inject("debounce-input-time",n.debounceTime)),a=W.debounce(()=>r("update:value",s.value),o.value),l=c=>{s.value=c,a()};return i.watch(()=>n.value,c=>{s.value=c}),(c,d)=>(i.openBlock(),i.createBlock(i.unref(V.NInput),{value:s.value,"onUpdate:value":[d[0]||(d[0]=h=>s.value=h),l],clearable:c.clearable,placeholder:c.placeholder},null,8,["value","clearable","placeholder"]))}}),m_={},__=i.defineComponent({...m_,__name:"phone-input",props:{value:{},debounceTime:{},disabled:{type:Boolean},placeholder:{},defaultCountry:{},preferredCountries:{},onlyCountries:{}},emits:["update:value"],setup(e,{emit:t}){const n=e,r=t,s=i.ref((n.value??"").replaceAll(/\D*/g,"")),o=W.debounce(c=>r("update:value",c),n.debounceTime??0),a=c=>{let d="";if(W.isString(c))s.value=c,d=c.replaceAll(/(\s|\(|\)|-|_)*/g,"");else if(W.isObject(c)){if(s.value=c.formatted,!c.valid)return;d=c instanceof Wi.PhoneNumber?c.format("E.164"):`+${c.countryCallingCode}${c.nationalNumber}`}n.debounceTime?o(d):r("update:value",d)},l=c=>{const d=c.replaceAll(/\D*/g,"");try{const h=Wi.parsePhoneNumberWithError(`+${d}`);h.isValid()?s.value=h.format("E.164"):h.getPossibleCountries().length>0&&(s.value=`+${d}`)}catch(h){if(h instanceof Wi.ParseError)s.value=d;else throw h}};return i.watch(()=>n.value,c=>{var d;(c==null?void 0:c.replaceAll(/\D*/g,""))!==((d=s.value)==null?void 0:d.replaceAll(/\D*/g,""))&&l(c)},{immediate:!0}),i.onBeforeMount(()=>l(s.value??"")),(c,d)=>(i.openBlock(),i.createBlock(i.unref(Ih.VueTelInput),{modelValue:s.value,"onUpdate:modelValue":[d[0]||(d[0]=h=>s.value=h),a],"auto-default-country":!1,"auto-format":!0,"default-country":c.defaultCountry,disabled:c.disabled,"input-options":{placeholder:c.placeholder},"preferred-countries":c.preferredCountries,"only-countries":c.onlyCountries,mode:"international",class:"tel-input"},null,8,["modelValue","default-country","disabled","input-options","preferred-countries","only-countries"]))}}),y_=Ln(__,[["__scopeId","data-v-751dbb0e"]]),b_={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function w_(e,t){return i.openBlock(),i.createElementBlock("svg",b_,t[0]||(t[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 v_=i.markRaw({name:"tabler-external-link",render:w_}),k_={class:"flex flex-row gap-1 hover:underline hover:decoration-dashed"},x_=["href"],C_={},S_=i.defineComponent({...C_,__name:"external-link",props:{text:{},url:{},description:{}},setup(e){return(t,n)=>{const r=v_,s=V.NTooltip;return i.openBlock(),i.createBlock(s,{disabled:i.unref(W.isUndefined)(t.description),placement:"top-start"},{trigger:i.withCtx(()=>[i.createElementVNode("span",k_,[i.createElementVNode("a",{href:t.url,target:"_blank",class:"no-underline"},i.toDisplayString(t.text),9,x_),i.createVNode(r,{class:"mt-0.5 flex-none"})])]),default:i.withCtx(()=>[i.createTextVNode(" "+i.toDisplayString(t.description),1)]),_:1},8,["disabled"])}}}),B_={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function T_(e,t){return i.openBlock(),i.createElementBlock("svg",B_,t[0]||(t[0]=[i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-miterlimit":"10","stroke-width":"32",d:"M448 256c0-106-86-192-192-192S64 150 64 256s86 192 192 192s192-86 192-192Z"},null,-1),i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M336 256H176"},null,-1)]))}const E_=i.markRaw({name:"ion-remove-circle-outline",render:T_});let Qr=[];const Ac=new WeakMap;function $_(){Qr.forEach(e=>e(...Ac.get(e))),Qr=[]}function Oc(e,...t){Ac.set(e,t),!Qr.includes(e)&&Qr.push(e)===1&&requestAnimationFrame($_)}function sr(e,t){let{target:n}=e;for(;n;){if(n.dataset&&n.dataset[t]!==void 0)return!0;n=n.parentElement}return!1}function or(e){return e.composedPath()[0]||null}function ar(e){return typeof e=="string"?e.endsWith("px")?Number(e.slice(0,e.length-2)):Number(e):e}function lr(e){if(e!=null)return typeof e=="number"?`${e}px`:e.endsWith("px")?e:`${e}px`}function Ht(e,t){const n=e.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]:"+e+" is not a valid value.")}return t===void 0?r:r[t]}const Vc={aliceblue:"#F0F8FF",antiquewhite:"#FAEBD7",aqua:"#0FF",aquamarine:"#7FFFD4",azure:"#F0FFFF",beige:"#F5F5DC",bisque:"#FFE4C4",black:"#000",blanchedalmond:"#FFEBCD",blue:"#00F",blueviolet:"#8A2BE2",brown:"#A52A2A",burlywood:"#DEB887",cadetblue:"#5F9EA0",chartreuse:"#7FFF00",chocolate:"#D2691E",coral:"#FF7F50",cornflowerblue:"#6495ED",cornsilk:"#FFF8DC",crimson:"#DC143C",cyan:"#0FF",darkblue:"#00008B",darkcyan:"#008B8B",darkgoldenrod:"#B8860B",darkgray:"#A9A9A9",darkgrey:"#A9A9A9",darkgreen:"#006400",darkkhaki:"#BDB76B",darkmagenta:"#8B008B",darkolivegreen:"#556B2F",darkorange:"#FF8C00",darkorchid:"#9932CC",darkred:"#8B0000",darksalmon:"#E9967A",darkseagreen:"#8FBC8F",darkslateblue:"#483D8B",darkslategray:"#2F4F4F",darkslategrey:"#2F4F4F",darkturquoise:"#00CED1",darkviolet:"#9400D3",deeppink:"#FF1493",deepskyblue:"#00BFFF",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1E90FF",firebrick:"#B22222",floralwhite:"#FFFAF0",forestgreen:"#228B22",fuchsia:"#F0F",gainsboro:"#DCDCDC",ghostwhite:"#F8F8FF",gold:"#FFD700",goldenrod:"#DAA520",gray:"#808080",grey:"#808080",green:"#008000",greenyellow:"#ADFF2F",honeydew:"#F0FFF0",hotpink:"#FF69B4",indianred:"#CD5C5C",indigo:"#4B0082",ivory:"#FFFFF0",khaki:"#F0E68C",lavender:"#E6E6FA",lavenderblush:"#FFF0F5",lawngreen:"#7CFC00",lemonchiffon:"#FFFACD",lightblue:"#ADD8E6",lightcoral:"#F08080",lightcyan:"#E0FFFF",lightgoldenrodyellow:"#FAFAD2",lightgray:"#D3D3D3",lightgrey:"#D3D3D3",lightgreen:"#90EE90",lightpink:"#FFB6C1",lightsalmon:"#FFA07A",lightseagreen:"#20B2AA",lightskyblue:"#87CEFA",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#B0C4DE",lightyellow:"#FFFFE0",lime:"#0F0",limegreen:"#32CD32",linen:"#FAF0E6",magenta:"#F0F",maroon:"#800000",mediumaquamarine:"#66CDAA",mediumblue:"#0000CD",mediumorchid:"#BA55D3",mediumpurple:"#9370DB",mediumseagreen:"#3CB371",mediumslateblue:"#7B68EE",mediumspringgreen:"#00FA9A",mediumturquoise:"#48D1CC",mediumvioletred:"#C71585",midnightblue:"#191970",mintcream:"#F5FFFA",mistyrose:"#FFE4E1",moccasin:"#FFE4B5",navajowhite:"#FFDEAD",navy:"#000080",oldlace:"#FDF5E6",olive:"#808000",olivedrab:"#6B8E23",orange:"#FFA500",orangered:"#FF4500",orchid:"#DA70D6",palegoldenrod:"#EEE8AA",palegreen:"#98FB98",paleturquoise:"#AFEEEE",palevioletred:"#DB7093",papayawhip:"#FFEFD5",peachpuff:"#FFDAB9",peru:"#CD853F",pink:"#FFC0CB",plum:"#DDA0DD",powderblue:"#B0E0E6",purple:"#800080",rebeccapurple:"#663399",red:"#F00",rosybrown:"#BC8F8F",royalblue:"#4169E1",saddlebrown:"#8B4513",salmon:"#FA8072",sandybrown:"#F4A460",seagreen:"#2E8B57",seashell:"#FFF5EE",sienna:"#A0522D",silver:"#C0C0C0",skyblue:"#87CEEB",slateblue:"#6A5ACD",slategray:"#708090",slategrey:"#708090",snow:"#FFFAFA",springgreen:"#00FF7F",steelblue:"#4682B4",tan:"#D2B48C",teal:"#008080",thistle:"#D8BFD8",tomato:"#FF6347",turquoise:"#40E0D0",violet:"#EE82EE",wheat:"#F5DEB3",white:"#FFF",whitesmoke:"#F5F5F5",yellow:"#FF0",yellowgreen:"#9ACD32",transparent:"#0000"};function N_(e,t,n){t/=100,n/=100;let r=(s,o=(s+e/60)%6)=>n-n*t*Math.max(Math.min(o,4-o,1),0);return[r(5)*255,r(3)*255,r(1)*255]}function P_(e,t,n){t/=100,n/=100;let r=t*Math.min(n,1-n),s=(o,a=(o+e/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 Qt="^\\s*",en="\\s*$",Pn="\\s*((\\.\\d+)|(\\d+(\\.\\d*)?))%\\s*",Ft="\\s*((\\.\\d+)|(\\d+(\\.\\d*)?))\\s*",ni="([0-9A-Fa-f])",ii="([0-9A-Fa-f]{2})",zc=new RegExp(`${Qt}hsl\\s*\\(${Ft},${Pn},${Pn}\\)${en}`),Ic=new RegExp(`${Qt}hsv\\s*\\(${Ft},${Pn},${Pn}\\)${en}`),Lc=new RegExp(`${Qt}hsla\\s*\\(${Ft},${Pn},${Pn},${Ft}\\)${en}`),Dc=new RegExp(`${Qt}hsva\\s*\\(${Ft},${Pn},${Pn},${Ft}\\)${en}`),R_=new RegExp(`${Qt}rgb\\s*\\(${Ft},${Ft},${Ft}\\)${en}`),F_=new RegExp(`${Qt}rgba\\s*\\(${Ft},${Ft},${Ft},${Ft}\\)${en}`),M_=new RegExp(`${Qt}#${ni}${ni}${ni}${en}`),A_=new RegExp(`${Qt}#${ii}${ii}${ii}${en}`),O_=new RegExp(`${Qt}#${ni}${ni}${ni}${ni}${en}`),V_=new RegExp(`${Qt}#${ii}${ii}${ii}${ii}${en}`);function St(e){return parseInt(e,16)}function z_(e){try{let t;if(t=Lc.exec(e))return[ts(t[1]),Rn(t[5]),Rn(t[9]),si(t[13])];if(t=zc.exec(e))return[ts(t[1]),Rn(t[5]),Rn(t[9]),1];throw new Error(`[seemly/hsla]: Invalid color value ${e}.`)}catch(t){throw t}}function I_(e){try{let t;if(t=Dc.exec(e))return[ts(t[1]),Rn(t[5]),Rn(t[9]),si(t[13])];if(t=Ic.exec(e))return[ts(t[1]),Rn(t[5]),Rn(t[9]),1];throw new Error(`[seemly/hsva]: Invalid color value ${e}.`)}catch(t){throw t}}function ri(e){try{let t;if(t=A_.exec(e))return[St(t[1]),St(t[2]),St(t[3]),1];if(t=R_.exec(e))return[ct(t[1]),ct(t[5]),ct(t[9]),1];if(t=F_.exec(e))return[ct(t[1]),ct(t[5]),ct(t[9]),si(t[13])];if(t=M_.exec(e))return[St(t[1]+t[1]),St(t[2]+t[2]),St(t[3]+t[3]),1];if(t=V_.exec(e))return[St(t[1]),St(t[2]),St(t[3]),si(St(t[4])/255)];if(t=O_.exec(e))return[St(t[1]+t[1]),St(t[2]+t[2]),St(t[3]+t[3]),si(St(t[4]+t[4])/255)];if(e in Vc)return ri(Vc[e]);if(zc.test(e)||Lc.test(e)){const[n,r,s,o]=z_(e);return[...P_(n,r,s),o]}else if(Ic.test(e)||Dc.test(e)){const[n,r,s,o]=I_(e);return[...N_(n,r,s),o]}throw new Error(`[seemly/rgba]: Invalid color value ${e}.`)}catch(t){throw t}}function L_(e){return e>1?1:e<0?0:e}function uo(e,t,n,r){return`rgba(${ct(e)}, ${ct(t)}, ${ct(n)}, ${L_(r)})`}function fo(e,t,n,r,s){return ct((e*t*(1-r)+n*r)/s)}function D_(e,t){Array.isArray(e)||(e=ri(e)),Array.isArray(t)||(t=ri(t));const n=e[3],r=t[3],s=si(n+r-n*r);return uo(fo(e[0],n,t[0],r,s),fo(e[1],n,t[1],r,s),fo(e[2],n,t[2],r,s),s)}function Re(e,t){const[n,r,s,o=1]=Array.isArray(e)?e:ri(e);return typeof t.alpha=="number"?uo(n,r,s,t.alpha):uo(n,r,s,o)}function es(e,t){const[n,r,s,o=1]=Array.isArray(e)?e:ri(e),{lightness:a=1,alpha:l=1}=t;return H_([n*a,r*a,s*a,o*l])}function si(e){const t=Math.round(Number(e)*100)/100;return t>1?1:t<0?0:t}function ts(e){const t=Math.round(Number(e));return t>=360||t<0?0:t}function ct(e){const t=Math.round(Number(e));return t>255?255:t<0?0:t}function Rn(e){const t=Math.round(Number(e));return t>100?100:t<0?0:t}function H_(e){const[t,n,r]=e;return 3 in e?`rgba(${ct(t)}, ${ct(n)}, ${ct(r)}, ${si(e[3])})`:`rgba(${ct(t)}, ${ct(n)}, ${ct(r)}, 1)`}function W_(e=8){return Math.random().toString(16).slice(2,2+e)}function Hc(e){return Array.isArray(e)?e:[e]}const po={STOP:"STOP"};function Wc(e,t){const n=t(e);e.children!==void 0&&n!==po.STOP&&e.children.forEach(r=>Wc(r,t))}function j_(e,t={}){const{preserveGroup:n=!1}=t,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(e),r}function X_(e,t){const{isLeaf:n}=e;return n!==void 0?n:!t(e)}function q_(e){return e.children}function Y_(e){return e.key}function U_(){return!1}function G_(e,t){const{isLeaf:n}=e;return!(n===!1&&!Array.isArray(t(e)))}function K_(e){return e.disabled===!0}function Z_(e,t){return e.isLeaf===!1&&!Array.isArray(t(e))}function J_(e,t){if(e.isLeaf===!0){const n=t(e);if(Array.isArray(n)&&n.length>0)return!0}return!1}function go(e){var t;return e==null?[]:Array.isArray(e)?e:(t=e.checkedKeys)!==null&&t!==void 0?t:[]}function mo(e){var t;return e==null||Array.isArray(e)?[]:(t=e.indeterminateKeys)!==null&&t!==void 0?t:[]}function Q_(e,t){const n=new Set(e);return t.forEach(r=>{n.has(r)||n.add(r)}),Array.from(n)}function ey(e,t){const n=new Set(e);return t.forEach(r=>{n.has(r)&&n.delete(r)}),Array.from(n)}function ty(e){return(e==null?void 0:e.type)==="group"}function ny(e){const t=new Map;return e.forEach((n,r)=>{t.set(n.key,r)}),n=>{var r;return(r=t.get(n))!==null&&r!==void 0?r:null}}class iy extends Error{constructor(){super(),this.message="SubtreeNotLoadedError: checking a subtree whose required nodes are not fully loaded."}}function ry(e,t,n,r){return ns(t.concat(e),n,r,!1)}function sy(e,t){const n=new Set;return e.forEach(r=>{const s=t.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 oy(e,t,n,r){const s=ns(t,n,r,!1),o=ns(e,n,r,!0),a=sy(e,n),l=[];return s.forEach(c=>{(o.has(c)||a.has(c))&&l.push(c)}),l.forEach(c=>s.delete(c)),s}function _o(e,t){const{checkedKeys:n,keysToCheck:r,keysToUncheck:s,indeterminateKeys:o,cascade:a,leafOnly:l,checkStrategy:c,allowNotLoaded:d}=e;if(!a)return r!==void 0?{checkedKeys:Q_(n,r),indeterminateKeys:Array.from(o)}:s!==void 0?{checkedKeys:ey(n,s),indeterminateKeys:Array.from(o)}:{checkedKeys:Array.from(n),indeterminateKeys:Array.from(o)};const{levelTreeNodeMap:h}=t;let u;s!==void 0?u=oy(s,n,t,d):r!==void 0?u=ry(r,n,t,d):u=ns(n,t,d,!1);const f=c==="parent",p=c==="child"||l,g=u,m=new Set,_=Math.max.apply(null,Array.from(h.keys()));for(let y=_;y>=0;y-=1){const b=y===0,S=h.get(y);for(const x of S){if(x.isLeaf)continue;const{key:C,shallowLoaded:B}=x;if(p&&B&&x.children.forEach(R=>{!R.disabled&&!R.isLeaf&&R.shallowLoaded&&g.has(R.key)&&g.delete(R.key)}),x.disabled||!B)continue;let v=!0,$=!1,F=!0;for(const R of x.children){const X=R.key;if(!R.disabled){if(F&&(F=!1),g.has(X))$=!0;else if(m.has(X)){$=!0,v=!1;break}else if(v=!1,$)break}}v&&!F?(f&&x.children.forEach(R=>{!R.disabled&&g.has(R.key)&&g.delete(R.key)}),g.add(C)):$&&m.add(C),b&&p&&g.has(C)&&g.delete(C)}}return{checkedKeys:Array.from(g),indeterminateKeys:Array.from(m)}}function ns(e,t,n,r){const{treeNodeMap:s,getChildren:o}=t,a=new Set,l=new Set(e);return e.forEach(c=>{const d=s.get(c);d!==void 0&&Wc(d,h=>{if(h.disabled)return po.STOP;const{key:u}=h;if(!a.has(u)&&(a.add(u),l.add(u),Z_(h.rawNode,o))){if(r)return po.STOP;if(!n)throw new iy}})}),l}function ay(e,{includeGroup:t=!1,includeSelf:n=!0},r){var s;const o=r.treeNodeMap;let a=e==null?null:(s=o.get(e))!==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&&(t||!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 ly(e){if(e.length===0)return null;const t=e[0];return t.isGroup||t.ignored||t.disabled?t.getNext():t}function cy(e,t){const n=e.siblings,r=n.length,{index:s}=e;return t?n[(s+1)%r]:s===n.length-1?null:n[s+1]}function jc(e,t,{loop:n=!1,includeDisabled:r=!1}={}){const s=t==="prev"?dy:cy,o={reverse:t==="prev"};let a=!1,l=null;function c(d){if(d!==null){if(d===e){if(!a)a=!0;else if(!e.disabled&&!e.isGroup){l=e;return}}else if((!d.disabled||r)&&!d.ignored&&!d.isGroup){l=d;return}if(d.isGroup){const h=yo(d,o);h!==null?l=h:c(s(d,n))}else{const h=s(d,!1);if(h!==null)c(h);else{const u=hy(d);u!=null&&u.isGroup?c(s(u,n)):n&&c(s(d,!0))}}}}return c(e),l}function dy(e,t){const n=e.siblings,r=n.length,{index:s}=e;return t?n[(s-1+r)%r]:s===0?null:n[s-1]}function hy(e){return e.parent}function yo(e,t={}){const{reverse:n=!1}=t,{children:r}=e;if(r){const{length:s}=r,o=n?s-1:0,a=n?-1:s,l=n?-1:1;for(let c=o;c!==a;c+=l){const d=r[c];if(!d.disabled&&!d.ignored)if(d.isGroup){const h=yo(d,t);if(h!==null)return h}else return d}}return null}const uy={getChild(){return this.ignored?null:yo(this)},getParent(){const{parent:e}=this;return e!=null&&e.isGroup?e.getParent():e},getNext(e={}){return jc(this,"next",e)},getPrev(e={}){return jc(this,"prev",e)}};function fy(e,t){const n=t?new Set(t):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(e),r}function py(e,t){const n=e.key;for(;t;){if(t.key===n)return!0;t=t.parent}return!1}var gy={};function Xc(e,t,n,r,s,o=null,a=0){const l=[];return e.forEach((c,d)=>{var h;gy.NODE_ENV!=="production"&&J_(c,s)&&console.error("[treemate]: node",c,"is invalid");const u=Object.create(r);if(u.rawNode=c,u.siblings=l,u.level=a,u.index=d,u.isFirstChild=d===0,u.isLastChild=d+1===e.length,u.parent=o,!u.ignored){const f=s(c);Array.isArray(f)&&(u.children=Xc(f,t,n,r,s,u,a+1))}l.push(u),t.set(u.key,u),n.has(a)||n.set(a,[]),(h=n.get(a))===null||h===void 0||h.push(u)}),l}function my(e,t={}){var n;const r=new Map,s=new Map,{getDisabled:o=K_,getIgnored:a=U_,getIsGroup:l=ty,getKey:c=Y_}=t,d=(n=t.getChildren)!==null&&n!==void 0?n:q_,h=t.ignoreEmptyChildren?x=>{const C=d(x);return Array.isArray(C)?C.length?C:null:C}:d,u=Object.assign({get key(){return c(this.rawNode)},get disabled(){return o(this.rawNode)},get isGroup(){return l(this.rawNode)},get isLeaf(){return X_(this.rawNode,h)},get shallowLoaded(){return G_(this.rawNode,h)},get ignored(){return a(this.rawNode)},contains(x){return py(this,x)}},uy),f=Xc(e,r,s,u,h);function p(x){if(x==null)return null;const C=r.get(x);return C&&!C.isGroup&&!C.ignored?C:null}function g(x){if(x==null)return null;const C=r.get(x);return C&&!C.ignored?C:null}function m(x,C){const B=g(x);return B?B.getPrev(C):null}function _(x,C){const B=g(x);return B?B.getNext(C):null}function y(x){const C=g(x);return C?C.getParent():null}function b(x){const C=g(x);return C?C.getChild():null}const S={treeNodes:f,treeNodeMap:r,levelTreeNodeMap:s,maxLevel:Math.max(...s.keys()),getChildren:h,getFlattenedNodes(x){return fy(f,x)},getNode:p,getPrev:m,getNext:_,getParent:y,getChild:b,getFirstAvailableNode(){return ly(f)},getPath(x,C={}){return ay(x,C,S)},getCheckedKeys(x,C={}){const{cascade:B=!0,leafOnly:v=!1,checkStrategy:$="all",allowNotLoaded:F=!1}=C;return _o({checkedKeys:go(x),indeterminateKeys:mo(x),cascade:B,leafOnly:v,checkStrategy:$,allowNotLoaded:F},S)},check(x,C,B={}){const{cascade:v=!0,leafOnly:$=!1,checkStrategy:F="all",allowNotLoaded:R=!1}=B;return _o({checkedKeys:go(C),indeterminateKeys:mo(C),keysToCheck:x==null?[]:Hc(x),cascade:v,leafOnly:$,checkStrategy:F,allowNotLoaded:R},S)},uncheck(x,C,B={}){const{cascade:v=!0,leafOnly:$=!1,checkStrategy:F="all",allowNotLoaded:R=!1}=B;return _o({checkedKeys:go(C),indeterminateKeys:mo(C),keysToUncheck:x==null?[]:Hc(x),cascade:v,leafOnly:$,checkStrategy:F,allowNotLoaded:R},S)},getNonLeafKeys(x={}){return j_(f,x)}};return S}function is(e){return e.composedPath()[0]}const _y={mousemoveoutside:new WeakMap,clickoutside:new WeakMap};function yy(e,t,n){if(e==="mousemoveoutside"){const r=s=>{t.contains(is(s))||n(s)};return{mousemove:r,touchstart:r}}else if(e==="clickoutside"){let r=!1;const s=a=>{r=!t.contains(is(a))},o=a=>{r&&(t.contains(is(a))||n(a))};return{mousedown:s,mouseup:o,touchstart:s,touchend:o}}return console.error(`[evtd/create-trap-handler]: name \`${e}\` is invalid. This could be a bug of evtd.`),{}}function qc(e,t,n){const r=_y[e];let s=r.get(t);s===void 0&&r.set(t,s=new WeakMap);let o=s.get(n);return o===void 0&&s.set(n,o=yy(e,t,n)),o}function by(e,t,n,r){if(e==="mousemoveoutside"||e==="clickoutside"){const s=qc(e,t,n);return Object.keys(s).forEach(o=>{bt(o,document,s[o],r)}),!0}return!1}function wy(e,t,n,r){if(e==="mousemoveoutside"||e==="clickoutside"){const s=qc(e,t,n);return Object.keys(s).forEach(o=>{Qe(o,document,s[o],r)}),!0}return!1}function vy(){if(typeof window>"u")return{on:()=>{},off:()=>{}};const e=new WeakMap,t=new WeakMap;function n(){e.set(this,!0)}function r(){e.set(this,!0),t.set(this,!0)}function s(v,$,F){const R=v[$];return v[$]=function(){return F.apply(v,arguments),R.apply(v,arguments)},v}function o(v,$){v[$]=Event.prototype[$]}const a=new WeakMap,l=Object.getOwnPropertyDescriptor(Event.prototype,"currentTarget");function c(){var v;return(v=a.get(this))!==null&&v!==void 0?v:null}function d(v,$){l!==void 0&&Object.defineProperty(v,"currentTarget",{configurable:!0,enumerable:!0,get:$??l.get})}const h={bubble:{},capture:{}},u={};function f(){const v=function($){const{type:F,eventPhase:R,bubbles:X}=$,M=is($);if(R===2)return;const N=R===1?"capture":"bubble";let A=M;const L=[];for(;A===null&&(A=window),L.push(A),A!==window;)A=A.parentNode||null;const U=h.capture[F],P=h.bubble[F];if(s($,"stopPropagation",n),s($,"stopImmediatePropagation",r),d($,c),N==="capture"){if(U===void 0)return;for(let E=L.length-1;E>=0&&!e.has($);--E){const H=L[E],I=U.get(H);if(I!==void 0){a.set($,H);for(const G of I){if(t.has($))break;G($)}}if(E===0&&!X&&P!==void 0){const G=P.get(H);if(G!==void 0)for(const O of G){if(t.has($))break;O($)}}}}else if(N==="bubble"){if(P===void 0)return;for(let E=0;E<L.length&&!e.has($);++E){const H=L[E],I=P.get(H);if(I!==void 0){a.set($,H);for(const G of I){if(t.has($))break;G($)}}}}o($,"stopPropagation"),o($,"stopImmediatePropagation"),d($)};return v.displayName="evtdUnifiedHandler",v}function p(){const v=function($){const{type:F,eventPhase:R}=$;if(R!==2)return;const X=u[F];X!==void 0&&X.forEach(M=>M($))};return v.displayName="evtdUnifiedWindowEventHandler",v}const g=f(),m=p();function _(v,$){const F=h[v];return F[$]===void 0&&(F[$]=new Map,window.addEventListener($,g,v==="capture")),F[$]}function y(v){return u[v]===void 0&&(u[v]=new Set,window.addEventListener(v,m)),u[v]}function b(v,$){let F=v.get($);return F===void 0&&v.set($,F=new Set),F}function S(v,$,F,R){const X=h[$][F];if(X!==void 0){const M=X.get(v);if(M!==void 0&&M.has(R))return!0}return!1}function x(v,$){const F=u[v];return!!(F!==void 0&&F.has($))}function C(v,$,F,R){let X;if(typeof R=="object"&&R.once===!0?X=U=>{B(v,$,X,R),F(U)}:X=F,by(v,$,X,R))return;const N=R===!0||typeof R=="object"&&R.capture===!0?"capture":"bubble",A=_(N,v),L=b(A,$);if(L.has(X)||L.add(X),$===window){const U=y(v);U.has(X)||U.add(X)}}function B(v,$,F,R){if(wy(v,$,F,R))return;const M=R===!0||typeof R=="object"&&R.capture===!0,N=M?"capture":"bubble",A=_(N,v),L=b(A,$);if($===window&&!S($,M?"bubble":"capture",v,F)&&x(v,F)){const P=u[v];P.delete(F),P.size===0&&(window.removeEventListener(v,m),u[v]=void 0)}L.has(F)&&L.delete(F),L.size===0&&A.delete($),A.size===0&&(window.removeEventListener(v,g,N==="capture"),h[N][v]=void 0)}return{on:C,off:B}}const{on:bt,off:Qe}=vy(),Mi="@@mmoContext",ky={mounted(e,{value:t}){e[Mi]={handler:void 0},typeof t=="function"&&(e[Mi].handler=t,bt("mousemoveoutside",e,t))},updated(e,{value:t}){const n=e[Mi];typeof t=="function"?n.handler?n.handler!==t&&(Qe("mousemoveoutside",e,n.handler),n.handler=t,bt("mousemoveoutside",e,t)):(e[Mi].handler=t,bt("mousemoveoutside",e,t)):n.handler&&(Qe("mousemoveoutside",e,n.handler),n.handler=void 0)},unmounted(e){const{handler:t}=e[Mi];t&&Qe("mousemoveoutside",e,t),e[Mi].handler=void 0}},Ai="@@coContext",rs={mounted(e,{value:t,modifiers:n}){e[Ai]={handler:void 0},typeof t=="function"&&(e[Ai].handler=t,bt("clickoutside",e,t,{capture:n.capture}))},updated(e,{value:t,modifiers:n}){const r=e[Ai];typeof t=="function"?r.handler?r.handler!==t&&(Qe("clickoutside",e,r.handler,{capture:n.capture}),r.handler=t,bt("clickoutside",e,t,{capture:n.capture})):(e[Ai].handler=t,bt("clickoutside",e,t,{capture:n.capture})):r.handler&&(Qe("clickoutside",e,r.handler,{capture:n.capture}),r.handler=void 0)},unmounted(e,{modifiers:t}){const{handler:n}=e[Ai];n&&Qe("clickoutside",e,n,{capture:t.capture}),e[Ai].handler=void 0}};function xy(e,t){console.error(`[vdirs/${e}]: ${t}`)}class Cy{constructor(){this.elementZIndex=new Map,this.nextZIndex=2e3}get elementCount(){return this.elementZIndex.size}ensureZIndex(t,n){const{elementZIndex:r}=this;if(n!==void 0){t.style.zIndex=`${n}`,r.delete(t);return}const{nextZIndex:s}=this;r.has(t)&&r.get(t)+1===this.nextZIndex||(t.style.zIndex=`${s}`,r.set(t,s),this.nextZIndex=s+1,this.squashState())}unregister(t,n){const{elementZIndex:r}=this;r.has(t)?r.delete(t):n===void 0&&xy("z-index-manager/unregister-element","Element not found when unregistering."),this.squashState()}squashState(){const{elementCount:t}=this;t||(this.nextZIndex=2e3),this.nextZIndex-t>2500&&this.rearrange()}rearrange(){const t=Array.from(this.elementZIndex.entries());t.sort((n,r)=>n[1]-r[1]),this.nextZIndex=2e3,t.forEach(n=>{const r=n[0],s=this.nextZIndex++;`${s}`!==r.style.zIndex&&(r.style.zIndex=`${s}`)})}}const bo=new Cy,Oi="@@ziContext",Yc={mounted(e,t){const{value:n={}}=t,{zIndex:r,enabled:s}=n;e[Oi]={enabled:!!s,initialized:!1},s&&(bo.ensureZIndex(e,r),e[Oi].initialized=!0)},updated(e,t){const{value:n={}}=t,{zIndex:r,enabled:s}=n,o=e[Oi].enabled;s&&!o&&(bo.ensureZIndex(e,r),e[Oi].initialized=!0),e[Oi].enabled=!!s},unmounted(e,t){if(!e[Oi].initialized)return;const{value:n={}}=t,{zIndex:r}=n;bo.unregister(e,r)}};function Sy(e){const t=i.ref(!!e.value);if(t.value)return i.readonly(t);const n=i.watch(e,r=>{r&&(t.value=!0,n())});return i.readonly(t)}function zt(e){const t=i.computed(e),n=i.ref(t.value);return i.watch(t,r=>{n.value=r}),typeof e=="function"?n:{__v_isRef:!0,get value(){return n.value},set value(r){e.set(r)}}}const By=typeof window<"u";let Vi,cr;(()=>{var e,t;Vi=By?(t=(e=document)===null||e===void 0?void 0:e.fonts)===null||t===void 0?void 0:t.ready:void 0,cr=!1,Vi!==void 0?Vi.then(()=>{cr=!0}):cr=!0})();function Ty(e){if(cr)return;let t=!1;i.onMounted(()=>{cr||Vi==null||Vi.then(()=>{t||e()})}),i.onBeforeUnmount(()=>{t=!0})}function wo(e,t){return i.watch(e,n=>{n!==void 0&&(t.value=n)}),i.computed(()=>e.value===void 0?t.value:e.value)}function ss(){const e=i.ref(!1);return i.onMounted(()=>{e.value=!0}),i.readonly(e)}function Uc(e,t){return i.computed(()=>{for(const n of t)if(e[n]!==void 0)return e[n];return e[t[t.length-1]]})}const Ey=(typeof window>"u"?!1:/iPad|iPhone|iPod/.test(navigator.platform)||navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1)&&!window.MSStream;function $y(){return Ey}function vo(e,t,n="default"){const r=t[n];if(r===void 0)throw new Error(`[vueuc/${e}]: slot[${n}] is empty.`);return r()}function ko(e,t=!0,n=[]){return e.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)){ko(r,t,n);return}if(r.type===i.Fragment){if(r.children===null)return;Array.isArray(r.children)&&ko(r.children,t,n)}else r.type!==i.Comment&&n.push(r)}}),n}function Gc(e,t,n="default"){const r=t[n];if(r===void 0)throw new Error(`[vueuc/${e}]: slot[${n}] is empty.`);const s=ko(r());if(s.length===1)return s[0];throw new Error(`[vueuc/${e}]: slot[${n}] should have exactly one child.`)}let Fn=null;function Kc(){if(Fn===null&&(Fn=document.getElementById("v-binder-view-measurer"),Fn===null)){Fn=document.createElement("div"),Fn.id="v-binder-view-measurer";const{style:e}=Fn;e.position="fixed",e.left="0",e.right="0",e.top="0",e.bottom="0",e.pointerEvents="none",e.visibility="hidden",document.body.appendChild(Fn)}return Fn.getBoundingClientRect()}function Ny(e,t){const n=Kc();return{top:t,left:e,height:0,width:0,right:n.width-e,bottom:n.height-t}}function xo(e){const t=e.getBoundingClientRect(),n=Kc();return{left:t.left-n.left,top:t.top-n.top,bottom:n.height+n.top-t.bottom,right:n.width+n.left-t.right,width:t.width,height:t.height}}function Py(e){return e.nodeType===9?null:e.parentNode}function Zc(e){if(e===null)return null;const t=Py(e);if(t===null)return null;if(t.nodeType===9)return document;if(t.nodeType===1){const{overflow:n,overflowX:r,overflowY:s}=getComputedStyle(t);if(/(auto|scroll|overlay)/.test(n+s+r))return t}return Zc(t)}const Jc=i.defineComponent({name:"Binder",props:{syncTargetWithParent:Boolean,syncTarget:{type:Boolean,default:!0}},setup(e){var t;i.provide("VBinder",(t=i.getCurrentInstance())===null||t===void 0?void 0:t.proxy);const n=i.inject("VBinder",null),r=i.ref(null),s=y=>{r.value=y,n&&e.syncTargetWithParent&&n.setTargetRef(y)};let o=[];const a=()=>{let y=r.value;for(;y=Zc(y),y!==null;)o.push(y);for(const b of o)bt("scroll",b,u,!0)},l=()=>{for(const y of o)Qe("scroll",y,u,!0);o=[]},c=new Set,d=y=>{c.size===0&&a(),c.has(y)||c.add(y)},h=y=>{c.has(y)&&c.delete(y),c.size===0&&l()},u=()=>{Oc(f)},f=()=>{c.forEach(y=>y())},p=new Set,g=y=>{p.size===0&&bt("resize",window,_),p.has(y)||p.add(y)},m=y=>{p.has(y)&&p.delete(y),p.size===0&&Qe("resize",window,_)},_=()=>{p.forEach(y=>y())};return i.onBeforeUnmount(()=>{Qe("resize",window,_),l()}),{targetRef:r,setTargetRef:s,addScrollListener:d,removeScrollListener:h,addResizeListener:g,removeResizeListener:m}},render(){return vo("binder",this.$slots)}}),Qc=i.defineComponent({name:"Target",setup(){const{setTargetRef:e,syncTarget:t}=i.inject("VBinder");return{syncTarget:t,setTargetDirective:{mounted:e,updated:e}}},render(){const{syncTarget:e,setTargetDirective:t}=this;return e?i.withDirectives(Gc("follower",this.$slots),[[t]]):Gc("follower",this.$slots)}}),Ry="@css-render/vue3-ssr";function Fy(e,t){return`<style cssr-id="${e}">
|
103
|
+
`}},Wr=Xn.Multiply,Qg=[1,0,0,0,1,0,0,0,1],Nn=new Yt(9),em=lt.Utils,Il=new Z,js=new Yt([0,0,1,0,0,1,0,1,1,0,1,1]),ye={precision:.9,isHidden:/(undefined|none|transparent)/i,canvas:He.document?He.document.createElement("canvas"):{getContext:function(){}},alignments:{left:"start",middle:"center",right:"end"},matrix:new Xn,group:{removeChild:function(e,t){if(e.children)for(let n=0;n<e.children.length;n++)ye.group.removeChild(e.children[n],t);e._renderer.texture&&(t.deleteTexture(e._renderer.texture),delete e._renderer.texture),e._renderer.positionBuffer&&(t.deleteBuffer(e._renderer.positionBuffer),delete e._renderer.positionBuffer)},render:function(e,t){if(!this._visible)return;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 Yt(9)),this._matrix.toTransformArray(!0,Nn),Wr(Nn,n._renderer.matrix,this._renderer.matrix),this._renderer.scale instanceof Z||(this._renderer.scale=new Z),this._scale instanceof Z?(this._renderer.scale.x=this._scale.x,this._renderer.scale.y=this._scale.y):(this._renderer.scale.x=this._scale,this._renderer.scale.y=this._scale),/renderer/i.test(n._renderer.type)||(this._renderer.scale.x*=n._renderer.scale.x,this._renderer.scale.y*=n._renderer.scale.y),r&&(this._flagMatrix=!0)),this._mask){e.clear(e.STENCIL_BUFFER_BIT),e.enable(e.STENCIL_TEST),e.stencilFunc(e.ALWAYS,1,0),e.stencilOp(e.KEEP,e.KEEP,e.REPLACE),e.colorMask(!1,!1,!1,!1);const a=lt.Utils.getRendererType(this._mask._renderer.type);ye[a].render.call(this._mask,e,t,this),e.stencilFunc(e.EQUAL,1,255),e.stencilOp(e.KEEP,e.KEEP,e.KEEP),e.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++)ye.group.removeChild(this.subtractions[o],e);for(o=0;o<this.children.length;o++){const a=this.children[o],l=lt.Utils.getRendererType(a._renderer.type);ye[l].render.call(a,e,t)}return this._mask&&e.disable(e.STENCIL_TEST),this.flagReset()}},path:{updateCanvas:function(e,t){let n,r,s,o,a,l,c,d,h,u,f,p,g,m;const _=t._renderer.vertices,y=this.canvas,b=this.ctx,S=e.renderer.ratio,x=Il.copy(t._renderer.scale).multiply(S),C=t._stroke,B=t._linewidth,v=t._fill,$=t._renderer.opacity||t._opacity,F=t._cap,R=t._join,X=t._miter,M=t._closed,N=t.dashes,A=_.length,L=A-1;y.width=Math.max(Math.ceil(t._renderer.rect.width*x.x),1),y.height=Math.max(Math.ceil(t._renderer.rect.height*x.y),1);const U=t._renderer.rect.centroid,P=U.x,E=U.y;if(b.clearRect(0,0,y.width,y.height),v)if(typeof v=="string")b.fillStyle=v;else{const ge=lt.Utils.getRendererType(v._renderer.type);ye[ge].render.call(v,b,t),b.fillStyle=v._renderer.effect}if(C){if(typeof C=="string")b.strokeStyle=C;else{const ge=lt.Utils.getRendererType(C._renderer.type);ye[ge].render.call(C,b,t),b.strokeStyle=C._renderer.effect}B&&(b.lineWidth=B),X&&(b.miterLimit=X),R&&(b.lineJoin=R),!M&&F&&(b.lineCap=F)}typeof $=="number"&&(b.globalAlpha=$),N&&N.length>0&&(b.lineDashOffset=N.offset||0,b.setLineDash(N));let H,I,G,O,z,J,pe,re;b.save(),b.scale(x.x,x.y),b.translate(P,E),b.beginPath();for(let ge=0;ge<_.length;ge++){const ie=_[ge];switch(p=ie.x,g=ie.y,ie.command){case ee.close:b.closePath();break;case ee.arc:I=ie.rx,G=ie.ry,O=ie.xAxisRotation,z=ie.largeArcFlag,J=ie.sweepFlag,n=M?$t(ge-1,A):Math.max(ge-1,0),r=_[n],pe=r.x,re=r.y,em.renderSvgArcCommand(b,pe,re,I,G,z,J,O,p,g);break;case ee.curve:n=M?$t(ge-1,A):Math.max(ge-1,0),r=_[n],d=r.controls&&r.controls.right||Z.zero,h=ie.controls&&ie.controls.left||Z.zero,r._relative?(l=d.x+r.x,c=d.y+r.y):(l=d.x,c=d.y),ie._relative?(o=h.x+ie.x,a=h.y+ie.y):(o=h.x,a=h.y),b.bezierCurveTo(l,c,o,a,p,g),ge>=L&&M&&(s=H,u=ie.controls&&ie.controls.right||Z.zero,f=s.controls&&s.controls.left||Z.zero,ie._relative?(l=u.x+ie.x,c=u.y+ie.y):(l=u.x,c=u.y),s._relative?(o=f.x+s.x,a=f.y+s.y):(o=f.x,a=f.y),p=s.x,g=s.y,b.bezierCurveTo(l,c,o,a,p,g));break;case ee.line:b.lineTo(p,g);break;case ee.move:H=ie,b.moveTo(p,g);break}}M&&b.closePath(),ye.isHidden.test(v)||(m=v._renderer&&v._renderer.offset,m&&(b.save(),b.translate(-v._renderer.offset.x,-v._renderer.offset.y),b.scale(v._renderer.scale.x,v._renderer.scale.y)),b.fill(),m&&b.restore()),ye.isHidden.test(C)||(m=C._renderer&&C._renderer.offset,m&&(b.save(),b.translate(-C._renderer.offset.x,-C._renderer.offset.y),b.scale(C._renderer.scale.x,C._renderer.scale.y),b.lineWidth=B/C._renderer.scale.x),b.stroke(),m&&b.restore()),b.restore()},getBoundingClientRect:function(e,t,n){let r=1/0,s=-1/0,o=1/0,a=-1/0,l,c;e.forEach(function(d){const h=d.x,u=d.y,f=d.controls;let p,g,m,_,y,b;o=Math.min(u,o),r=Math.min(h,r),s=Math.max(h,s),a=Math.max(u,a),d.controls&&(y=f.left,b=f.right,!(!y||!b)&&(p=d._relative?y.x+h:y.x,g=d._relative?y.y+u:y.y,m=d._relative?b.x+h:b.x,_=d._relative?b.y+u:b.y,!(!p||!g||!m||!_)&&(o=Math.min(g,_,o),r=Math.min(p,m,r),s=Math.max(p,m,s),a=Math.max(g,_,a))))}),typeof t=="number"&&(o-=t,r-=t,s+=t,a+=t),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(e,t,n){if(!this._visible||!this._opacity)return this;this._update();const r=n||this.parent,s=lt.Utils.getRendererType(this._renderer.type),o=t[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 Oe&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagEndPoints)||this._fill instanceof Ve&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagRadius||this._fill._flagCenter||this._fill._flagFocal)||this._fill instanceof Ee&&(this._fill._flagLoaded&&this._fill.loaded||this._fill._flagImage||this._fill._flagVideo||this._fill._flagRepeat||this._fill._flagOffset||this._fill._flagScale)||this._stroke instanceof Oe&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagEndPoints)||this._stroke instanceof Ve&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagRadius||this._stroke._flagCenter||this._stroke._flagFocal)||this._stroke instanceof Ee&&(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 Yt(9)),this._matrix.toTransformArray(!0,Nn),Wr(Nn,r._renderer.matrix,this._renderer.matrix),this._renderer.scale instanceof Z||(this._renderer.scale=new Z);let u,f;this._scale instanceof Z?(u=this._scale.x*r._renderer.scale.x,f=this._scale.y*r._renderer.scale.y):(u=this._scale*r._renderer.scale.x,f=this._scale*r._renderer.scale.y),this._renderer.scale.x=u<0?-u:u,this._renderer.scale.y=f<0?-f:f,c&&(this._renderer.parent=r)}if(this._mask){e.clear(e.STENCIL_BUFFER_BIT),e.enable(e.STENCIL_TEST),e.stencilFunc(e.ALWAYS,1,0),e.stencilOp(e.KEEP,e.KEEP,e.REPLACE),e.colorMask(!1,!1,!1,!1);const u=lt.Utils.getRendererType(this._mask._renderer.type);ye[u].render.call(this._mask,e,t,this),e.stencilFunc(e.EQUAL,1,255),e.stencilOp(e.KEEP,e.KEEP,e.KEEP),e.colorMask(!0,!0,!0,!0)}if(d?(this._renderer.rect||(this._renderer.rect={}),this._renderer.opacity=this._opacity*r._renderer.opacity,ye.path.getBoundingClientRect(this._renderer.vertices,this._linewidth,this._renderer.rect),ye.updateTexture.call(ye,e,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;t.current!==o&&(e.useProgram(o),e.bindBuffer(e.ARRAY_BUFFER,t.buffers.position),e.vertexAttribPointer(o.position,2,e.FLOAT,!1,0,0),e.enableVertexAttribArray(o.position),e.bufferData(e.ARRAY_BUFFER,js,e.STATIC_DRAW),t.resolution.flagged||e.uniform2f(e.getUniformLocation(o,"u_resolution"),t.resolution.width,t.resolution.height),t.current=o),t.resolution.flagged&&e.uniform2f(e.getUniformLocation(o,"u_resolution"),t.resolution.width,t.resolution.height),e.bindTexture(e.TEXTURE_2D,this._renderer.texture);const h=this._renderer.rect;return e.uniformMatrix3fv(o.matrix,!1,this._renderer.matrix),e.uniform4f(o.rect,h.left,h.top,h.right,h.bottom),e.drawArrays(e.TRIANGLES,0,6),this._mask&&e.disable(e.STENCIL_TEST),this.flagReset()}},points:{updateCanvas:function(e,t){let n;const r=this.canvas,s=this.ctx,o=e.renderer.ratio,a=t._stroke,l=t._linewidth,c=t._fill,d=t._renderer.opacity||t._opacity,h=t.dashes,u=t._size*o;let f=u;ye.isHidden.test(a)||(f+=l),r.width=Da(f),r.height=r.width;const p=f/r.width,g=r.width/2,m=r.height/2;if(s.clearRect(0,0,r.width,r.height),c)if(typeof c=="string")s.fillStyle=c;else{const _=lt.Utils.getRendererType(c._renderer.type);ye[_].render.call(c,s,t),s.fillStyle=c._renderer.effect}if(a){if(typeof a=="string")s.strokeStyle=a;else{const _=lt.Utils.getRendererType(a._renderer.type);ye[_].render.call(a,s,t),s.strokeStyle=a._renderer.effect}l&&(s.lineWidth=l/p)}typeof d=="number"&&(s.globalAlpha=d),h&&h.length>0&&(s.lineDashOffset=h.offset||0,s.setLineDash(h)),s.save(),s.translate(g,m),s.scale(ye.precision,ye.precision),s.beginPath(),s.arc(0,0,u/p*.5,0,ot),s.restore(),closed&&s.closePath(),ye.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()),ye.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(e,t,n){if(!this._visible||!this._opacity)return this;this._update();let r=this._size;const s=n||this.parent,o=t[this._renderer.type],a=this._sizeAttenuation,l=this._stroke,c=this._linewidth,d=s._matrix.manual||s._flagMatrix,h=this._matrix.manual||this._flagMatrix,u=this._renderer.parent!==s,f=this._renderer.vertices,p=this._renderer.collection.length,g=this._flagVertices,m=this._flagFill||this._fill instanceof Oe&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagEndPoints)||this._fill instanceof Ve&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagRadius||this._fill._flagCenter||this._fill._flagFocal)||this._fill instanceof Ee&&(this._fill._flagLoaded&&this._fill.loaded||this._fill._flagImage||this._fill._flagVideo||this._fill._flagRepeat||this._fill._flagOffset||this._fill._flagScale)||this._stroke instanceof Oe&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagEndPoints)||this._stroke instanceof Ve&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagRadius||this._stroke._flagCenter||this._stroke._flagFocal)||this._stroke instanceof Ee&&(this._stroke._flagLoaded&&this._stroke.loaded||this._stroke._flagImage||this._stroke._flagVideo||this._stroke._flagRepeat||this._stroke._flagOffset||this._fill._flagScale)||this._flagStroke||this._flagLinewidth||this._flagOpacity||s._flagOpacity||this._flagVisible||this._flagScale||this.dashes&&this.dashes.length>0||!this._renderer.texture;if(d||h||u){this._renderer.matrix||(this._renderer.matrix=new Yt(9)),this._matrix.toTransformArray(!0,Nn),Wr(Nn,s._renderer.matrix,this._renderer.matrix),this._renderer.scale instanceof Z||(this._renderer.scale=new Z);let _,y;this._scale instanceof Z?(_=this._scale.x*s._renderer.scale.x,y=this._scale.y*s._renderer.scale.y):(_=this._scale*s._renderer.scale.x,y=this._scale*s._renderer.scale.y),this._renderer.scale.x=_<0?-_:_,this._renderer.scale.y=y<0?-y:y,u&&(this._renderer.parent=s)}if(g){const _=this._renderer.positionBuffer;_&&e.deleteBuffer(_),this._renderer.positionBuffer=e.createBuffer(),e.bindBuffer(e.ARRAY_BUFFER,this._renderer.positionBuffer),e.vertexAttribPointer(o.position,2,e.FLOAT,!1,0,0),e.enableVertexAttribArray(o.position),e.bufferData(e.ARRAY_BUFFER,f,e.STATIC_DRAW)}return m?(this._renderer.opacity=this._opacity*s._renderer.opacity,ye.updateTexture.call(ye,e,this)):(this._fill&&this._fill._update&&this._fill._update(),this._stroke&&this._stroke._update&&this._stroke._update()),this._clip&&!n||!this._renderer.texture?this:(ye.isHidden.test(l)||(r+=c),r/=ye.precision,a&&(r*=Math.max(this._renderer.scale.x,this._renderer.scale.y)),t.current!==o&&(e.useProgram(o),t.resolution.flagged||e.uniform2f(e.getUniformLocation(o,"u_resolution"),t.resolution.width,t.resolution.height),t.current=o),t.resolution.flagged&&e.uniform2f(e.getUniformLocation(o,"u_resolution"),t.resolution.width,t.resolution.height),e.bindTexture(e.TEXTURE_2D,this._renderer.texture),e.uniformMatrix3fv(o.matrix,!1,this._renderer.matrix),e.uniform1f(o.size,r*t.resolution.ratio),e.drawArrays(e.POINTS,0,p),this.flagReset())}},text:{updateCanvas:function(e,t){const n=this.canvas,r=this.ctx,s=e.renderer.ratio,o=Il.copy(t._renderer.scale).multiply(s),a=t._stroke,l=t._linewidth,c=t._fill,d=t._renderer.opacity||t._opacity,h=t.dashes,u=t._decoration,f=t._direction;n.width=Math.max(Math.ceil(t._renderer.rect.width*o.x),1),n.height=Math.max(Math.ceil(t._renderer.rect.height*o.y),1);const p=t._renderer.rect.centroid,g=p.x,m=p.y;let _,y,b,S,x,C,B,v,$,F,R;const X=c._renderer&&c._renderer.offset&&a._renderer&&a._renderer.offset;if(r.clearRect(0,0,n.width,n.height),X||(r.font=[t._style,t._weight,t._size+"px/"+t._leading+"px",t._family].join(" ")),r.textAlign="center",r.textBaseline="middle",r.textDirection=f,c)if(typeof c=="string")r.fillStyle=c;else{const M=lt.Utils.getRendererType(c._renderer.type);ye[M].render.call(c,r,t),r.fillStyle=c._renderer.effect}if(a){if(typeof a=="string")r.strokeStyle=a;else{const M=lt.Utils.getRendererType(a._renderer.type);ye[M].render.call(a,r,t),r.strokeStyle=a._renderer.effect}l&&(r.lineWidth=l)}if(typeof d=="number"&&(r.globalAlpha=d),h&&h.length>0&&(r.lineDashOffset=h.offset||0,r.setLineDash(h)),r.save(),r.scale(o.x,o.y),r.translate(g,m),ye.isHidden.test(c)||(c._renderer&&c._renderer.offset?(C=c._renderer.scale.x,B=c._renderer.scale.y,r.save(),r.translate(-c._renderer.offset.x,-c._renderer.offset.y),r.scale(C,B),_=t._size/c._renderer.scale.y,y=t._leading/c._renderer.scale.y,r.font=[t._style,t._weight,_+"px/",y+"px",t._family].join(" "),b=c._renderer.offset.x/c._renderer.scale.x,S=c._renderer.offset.y/c._renderer.scale.y,r.fillText(t.value,b,S),r.restore()):r.fillText(t.value,0,0)),ye.isHidden.test(a)||(a._renderer&&a._renderer.offset?(C=a._renderer.scale.x,B=a._renderer.scale.y,r.save(),r.translate(-a._renderer.offset.x,-a._renderer.offset.y),r.scale(C,B),_=t._size/a._renderer.scale.y,y=t._leading/a._renderer.scale.y,r.font=[t._style,t._weight,_+"px/",y+"px",t._family].join(" "),b=a._renderer.offset.x/a._renderer.scale.x,S=a._renderer.offset.y/a._renderer.scale.y,x=l/a._renderer.scale.x,r.lineWidth=x,r.strokeText(t.value,b,S),r.restore()):r.strokeText(t.value,0,0)),/(underline|strikethrough)/i.test(u)){const M=r.measureText(t.value);switch(u){case"underline":$=M.actualBoundingBoxDescent,R=M.actualBoundingBoxDescent;break;case"strikethrough":$=0,R=0;break}v=-M.width/2,F=M.width/2,r.lineWidth=Math.max(Math.floor(t._size/15),1),r.strokeStyle=r.fillStyle,r.beginPath(),r.moveTo(v,$),r.lineTo(F,R),r.stroke()}r.restore()},getBoundingClientRect:function(e,t){const n=ye.ctx;n.font=[e._style,e._weight,e._size+"px/"+e._leading+"px",e._family].join(" "),n.textAlign="center",n.textBaseline=lt.Utils.baselines[e._baseline]||e._baseline;const r=n.measureText(e._value);let s=r.width,o=1.15*(r.actualBoundingBoxAscent+r.actualBoundingBoxDescent);this._linewidth&&!ye.isHidden.test(this._stroke)&&(s+=this._linewidth*2,o+=this._linewidth*2);const a=s/2,l=o/2;switch(ye.alignments[e._alignment]||e._alignment){case ye.alignments.left:e.direction==="ltr"?(t.left=0,t.right=s):(t.left=-s,t.right=0);break;case ye.alignments.right:e.direction==="ltr"?(t.left=-s,t.right=0):(t.left=0,t.right=s);break;default:t.left=-a,t.right=a}switch(e._baseline){case"bottom":t.top=-o,t.bottom=0;break;case"top":t.top=0,t.bottom=o;break;case"baseline":t.top=-l*1.5,t.bottom=l*.5;break;default:t.top=-l,t.bottom=l}t.width=s,t.height=o,t.centroid||(t.centroid={}),t.centroid.x=a,t.centroid.y=l},render:function(e,t,n){if(!this._visible||!this._opacity)return this;this._update();const r=n||this.parent,s=t[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 Oe&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagEndPoints)||this._fill instanceof Ve&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagRadius||this._fill._flagCenter||this._fill._flagFocal)||this._fill instanceof Ee&&(this._fill._flagLoaded&&this._fill.loaded||this._fill._flagImage||this._fill._flagVideo||this._fill._flagRepeat||this._fill._flagOffset||this._fill._flagScale)||this._stroke instanceof Oe&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagEndPoints)||this._stroke instanceof Ve&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagRadius||this._stroke._flagCenter||this._stroke._flagFocal)||this._stroke instanceof Ee&&(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 Yt(9)),this._matrix.toTransformArray(!0,Nn),Wr(Nn,r._renderer.matrix,this._renderer.matrix),this._renderer.scale instanceof Z||(this._renderer.scale=new Z);let h,u;this._scale instanceof Z?(h=this._scale.x*r._renderer.scale.x,u=this._scale.y*r._renderer.scale.y):(h=this._scale*r._renderer.scale.x,u=this._scale*r._renderer.scale.y),this._renderer.scale.x=h<0?-h:h,this._renderer.scale.y=u<0?-u:u,l&&(this._renderer.parent=r)}if(this._mask){e.clear(e.STENCIL_BUFFER_BIT),e.enable(e.STENCIL_TEST),e.stencilFunc(e.ALWAYS,1,0),e.stencilOp(e.KEEP,e.KEEP,e.REPLACE),e.colorMask(!1,!1,!1,!1);const h=lt.Utils.getRendererType(this._mask._renderer.type);ye[h].render.call(this._mask,e,t,this),e.stencilFunc(e.EQUAL,1,255),e.stencilOp(e.KEEP,e.KEEP,e.KEEP),e.colorMask(!0,!0,!0,!0)}if(c?(this._renderer.rect||(this._renderer.rect={}),this._renderer.opacity=this._opacity*r._renderer.opacity,ye.text.getBoundingClientRect(this,this._renderer.rect),ye.updateTexture.call(ye,e,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;t.current!==s&&(e.useProgram(s),e.bindBuffer(e.ARRAY_BUFFER,t.buffers.position),e.vertexAttribPointer(s.position,2,e.FLOAT,!1,0,0),e.enableVertexAttribArray(s.position),e.bufferData(e.ARRAY_BUFFER,js,e.STATIC_DRAW),t.resolution.flagged||e.uniform2f(e.getUniformLocation(s,"u_resolution"),t.resolution.width,t.resolution.height),t.current=s),t.resolution.flagged&&e.uniform2f(e.getUniformLocation(s,"u_resolution"),t.resolution.width,t.resolution.height),e.bindTexture(e.TEXTURE_2D,this._renderer.texture);const d=this._renderer.rect;return e.uniformMatrix3fv(s.matrix,!1,this._renderer.matrix),e.uniform4f(s.rect,d.left,d.top,d.right,d.bottom),e.drawArrays(e.TRIANGLES,0,6),this._mask&&e.disable(e.STENCIL_TEST),this.flagReset()}},"linear-gradient":{render:function(e,t){if(!(!e.canvas.getContext("2d")||!t)){if(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=t.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=e.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 this.flagReset()}}},"radial-gradient":{render:function(e,t){if(!(!e.canvas.getContext("2d")||!t)){if(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=t.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=e.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 this.flagReset()}}},texture:{render:function(e,t){if(!e.canvas.getContext("2d"))return;this._update();const n=this.image;if((this._flagLoaded||this._flagImage||this._flagVideo||this._flagRepeat)&&this.loaded)this._renderer.effect=e.createPattern(n,this._repeat);else if(!this._renderer.effect)return this.flagReset();if((this._flagOffset||this._flagLoaded||this._flagScale)&&(this._renderer.offset instanceof Z||(this._renderer.offset=new Z),this._renderer.offset.x=-this._offset.x,this._renderer.offset.y=-this._offset.y,n&&(this._renderer.offset.x+=n.width/2,this._renderer.offset.y+=n.height/2,this._scale instanceof Z?(this._renderer.offset.x*=this._scale.x,this._renderer.offset.y*=this._scale.y):(this._renderer.offset.x*=this._scale,this._renderer.offset.y*=this._scale))),this._flagScale||this._flagLoaded){this._renderer.scale instanceof Z||(this._renderer.scale=new Z);let r,s;this._scale instanceof Z?(r=this._scale.x,s=this._scale.y):(r=this._scale,s=this._scale),this._renderer.scale.x=r<0?-r:r,this._renderer.scale.y=s<0?-s:s}return this.flagReset()}},updateTexture:function(e,t){const n=lt.Utils.getRendererType(t._renderer.type);if(this[n].updateCanvas.call(ye,e,t),this.canvas.width<=0||this.canvas.height<=0){t._renderer.texture&&e.deleteTexture(t._renderer.texture),delete t._renderer.texture;return}t._renderer.texture||(t._renderer.texture=e.createTexture()),e.bindTexture(e.TEXTURE_2D,t._renderer.texture),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,this.canvas),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR)},program:{create:function(e,t){let n,r,s;if(n=e.createProgram(),ae.each(t,function(o){e.attachShader(n,o)}),e.linkProgram(n),r=e.getProgramParameter(n,e.LINK_STATUS),!r)throw s=e.getProgramInfoLog(n),e.deleteProgram(n),new Ct("unable to link program: "+s);return n}},extensions:{init:function(e){const t={},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];t[s]=ye.extensions.get(e,s)}return t},get:function(e,t){return e.getExtension(t)||e.getExtension(`MOZ_${t}`)||e.getExtension(`WEBKIT_${t}`)}},TextureRegistry:new Tr};ye.ctx=ye.canvas.getContext("2d");var Ll=class extends j{constructor(e){super();let t,n,r,s;if(this.domElement=e.domElement||document.createElement("canvas"),typeof e.offscreenElement<"u"&&(ye.canvas=e.offscreenElement,ye.ctx=ye.canvas.getContext("2d")),this.scene=new Ge,this.scene.parent=this,this._renderer={type:"renderer",matrix:new Yt(Qg),scale:1,opacity:1},this._flagMatrix=!0,e=ae.defaults(e||{},{antialias:!1,alpha:!0,premultipliedAlpha:!0,stencil:!0,preserveDrawingBuffer:!0,overdraw:!1}),this.overdraw=e.overdraw,t=this.ctx=this.domElement.getContext("webgl",e)||this.domElement.getContext("experimental-webgl",e),!this.ctx)throw new Ct("unable to create a webgl context. Try using another renderer.");r=Vt.create(t,Vt.path.vertex,Vt.types.vertex),s=Vt.create(t,Vt.path.fragment,Vt.types.fragment),this.programs={current:null,buffers:{position:t.createBuffer()},resolution:{width:0,height:0,ratio:1,flagged:!1}},n=this.programs.path=ye.program.create(t,[r,s]),this.programs.text=this.programs.path,t.extensions=ye.extensions.init(t),t.renderer=this,n.position=t.getAttribLocation(n,"a_position"),n.matrix=t.getUniformLocation(n,"u_matrix"),n.rect=t.getUniformLocation(n,"u_rect");const o=t.createBuffer();t.bindBuffer(t.ARRAY_BUFFER,o),t.vertexAttribPointer(n.position,2,t.FLOAT,!1,0,0),t.enableVertexAttribArray(n.position),t.bufferData(t.ARRAY_BUFFER,js,t.STATIC_DRAW),r=Vt.create(t,Vt.points.vertex,Vt.types.vertex),s=Vt.create(t,Vt.points.fragment,Vt.types.fragment),n=this.programs.points=ye.program.create(t,[r,s]),n.position=t.getAttribLocation(n,"a_position"),n.matrix=t.getUniformLocation(n,"u_matrix"),n.size=t.getUniformLocation(n,"u_size"),t.enable(t.BLEND),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0),t.blendEquation(t.FUNC_ADD),t.blendFunc(t.ONE,t.ONE_MINUS_SRC_ALPHA)}setSize(e,t,n){let r,s;const o=this.ctx;return this.width=e,this.height=t,this.ratio=typeof n>"u"?Rs(o):n,this.domElement.width=e*this.ratio,this.domElement.height=t*this.ratio,ae.isObject(this.domElement.style)&&ae.extend(this.domElement.style,{width:e+"px",height:t+"px"}),this._renderer.matrix[0]=this._renderer.matrix[4]=this._renderer.scale=this.ratio,this._flagMatrix=!0,r=e*this.ratio,s=t*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(j.Types.resize,e,t,n)}render(){const e=this.ctx;return this.overdraw||e.clear(e.COLOR_BUFFER_BIT),ye.group.render.call(this.scene,e,this.programs),this._flagMatrix=!1,this.programs.resolution.flagged=!0,this}};w(Ll,"Utils",ye);var tm=ae.extend({Error:Ct,getRatio:Rs,read:Le,xhr:Fl},ae,gt,Oa,Va),tr=class{constructor(e){w(this,"_events",new j),w(this,"type",""),w(this,"renderer",null),w(this,"scene",null),w(this,"width",0),w(this,"height",0),w(this,"frameCount",0),w(this,"timeDelta",0),w(this,"playing",!1);const t=ae.defaults(e||{},{fullscreen:!1,fitted:!1,width:640,height:480,type:tr.Types.svg,autostart:!1});if(ae.each(t,function(n,r){/fullscreen/i.test(r)||/autostart/i.test(r)||(this[r]=n)},this),ae.isElement(t.domElement)){const n=t.domElement.tagName.toLowerCase();/^(CanvasRenderer-canvas|WebGLRenderer-canvas|SVGRenderer-svg)$/.test(this.type+"-"+n)||(this.type=tr.Types[n])}this.renderer=new tr[this.type](this),this.setPlaying(t.autostart),this.frameCount=0,t.fullscreen?(this.fit=nm.bind(this),this.fit.domElement=window,this.fit.attached=!0,ae.extend(document.body.style,{overflow:"hidden",margin:0,padding:0,top:0,left:0,right:0,bottom:0,position:"fixed"}),ae.extend(this.renderer.domElement.style,{display:"block",top:0,left:0,right:0,bottom:0,position:"fixed"}),Nt.bind(this.fit.domElement,"resize",this.fit),this.fit()):t.fitted?(this.fit=im.bind(this),ae.extend(this.renderer.domElement.style,{display:"block"})):typeof t.width=="number"&&typeof t.height=="number"&&(this.renderer.setSize(t.width,t.height,this.ratio),this.width=t.width,this.height=t.height),this.renderer.bind(j.Types.resize,rm.bind(this)),this.scene=this.renderer.scene,tr.Instances.push(this),t.autostart&&nr.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,nr.init(),this.trigger(j.Types.play)}pause(){return this.playing=!1,this.trigger(j.Types.pause)}setPlaying(e){this.playing=e}release(e){let t,n,r;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)for(typeof e.vertices.unbind=="function"&&e.vertices.unbind(),t=0;t<e.vertices.length;t++)n=e.vertices[t],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());if(e.children){for(t=0;t<e.children.length;t++)r=e.children[t],this.release(r);typeof e.children.unbind=="function"&&e.children.unbind()}return e}update(){const e=!!this._lastFrame,t=ae.performance.now();e&&(this.timeDelta=parseFloat((t-this._lastFrame).toFixed(3))),this._lastFrame=t,this.fit&&this.fit.domElement&&!this.fit.attached&&(Nt.bind(this.fit.domElement,"resize",this.fit),this.fit.attached=!0,this.fit());const n=this.width,r=this.height,s=this.renderer;return(n!==s.width||r!==s.height)&&s.setSize(n,r,this.ratio),this.trigger(j.Types.update,this.frameCount,this.timeDelta),this.render()}render(){return this.renderer.render(),this.trigger(j.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,t,n,r){const s=new Ds(e,t,n,r);return this.scene.add(s),s}makeArrow(e,t,n,r,s){const o=typeof s=="number"?s:10,a=Math.atan2(r-t,n-e),l=[new ve(e,t,void 0,void 0,void 0,void 0,ee.move),new ve(n,r,void 0,void 0,void 0,void 0,ee.line),new ve(n-o*Math.cos(a-Math.PI/4),r-o*Math.sin(a-Math.PI/4),void 0,void 0,void 0,void 0,ee.line),new ve(n,r,void 0,void 0,void 0,void 0,ee.move),new ve(n-o*Math.cos(a+Math.PI/4),r-o*Math.sin(a+Math.PI/4),void 0,void 0,void 0,void 0,ee.line)],c=new Se(l,!1,!1,!0);return c.noFill(),c.cap="round",c.join="round",this.scene.add(c),c}makeRectangle(e,t,n,r){const s=new En(e,t,n,r);return this.scene.add(s),s}makeRoundedRectangle(e,t,n,r,s){const o=new Qi(e,t,n,r,s);return this.scene.add(o),o}makeCircle(e,t,n,r){const s=new Zi(e,t,n,r);return this.scene.add(s),s}makeEllipse(e,t,n,r,s){const o=new Ji(e,t,n,r,s);return this.scene.add(o),o}makeStar(e,t,n,r,s){const o=new Ar(e,t,n,r,s);return this.scene.add(o),o}makeCurve(e){const t=arguments.length;if(!Array.isArray(e)){e=[];for(let o=0;o<t;o+=2){const a=arguments[o];if(typeof a!="number")break;const l=arguments[o+1];e.push(new ve(a,l))}}const n=arguments[t-1],r=new Se(e,!(typeof n=="boolean"&&n),!0),s=r.getBoundingClientRect();return r.center().translation.set(s.left+s.width/2,s.top+s.height/2),this.scene.add(r),r}makePolygon(e,t,n,r){const s=new Mr(e,t,n,r);return this.scene.add(s),s}makeArcSegment(e,t,n,r,s,o,a){const l=new Rr(e,t,n,r,s,o,a);return this.scene.add(l),l}makePoints(e){const t=arguments.length;let n=e;if(!Array.isArray(e)){n=[];for(let s=0;s<t;s+=2){const o=arguments[s];if(typeof o!="number")break;const a=arguments[s+1];n.push(new Z(o,a))}}const r=new Fr(n);return this.scene.add(r),r}makePath(e){const t=arguments.length;let n=e;if(!Array.isArray(e)){n=[];for(let a=0;a<t;a+=2){const l=arguments[a];if(typeof l!="number")break;const c=arguments[a+1];n.push(new ve(l,c))}}const r=arguments[t-1],s=new Se(n,!(typeof r=="boolean"&&r)),o=s.getBoundingClientRect();return typeof o.top=="number"&&typeof o.left=="number"&&typeof o.right=="number"&&typeof o.bottom=="number"&&s.center().translation.set(o.left+o.width/2,o.top+o.height/2),this.scene.add(s),s}makeText(e,t,n,r){const s=new At(e,t,n,r);return this.add(s),s}makeLinearGradient(e,t,n,r){const s=Array.prototype.slice.call(arguments,4),o=new Oe(e,t,n,r,s);return this.add(o),o}makeRadialGradient(e,t,n){const r=Array.prototype.slice.call(arguments,3),s=new Ve(e,t,n,r);return this.add(s),s}makeSprite(e,t,n,r,s,o,a){const l=new Pr(e,t,n,r,s,o);return a&&l.play(),this.add(l),l}makeImageSequence(e,t,n,r,s){const o=new zr(e,t,n,r);return s&&o.play(),this.add(o),o}makeTexture(e,t){return new Ee(e,t)}makeGroup(e){e instanceof Array||(e=Array.prototype.slice.call(arguments));const t=new Ge;return this.scene.add(t),t.add(e),t}interpret(e,t,n){const r=e.tagName.toLowerCase();if(n=typeof n<"u"?n:!0,!(r in Le))return null;const s=Le[r].call(this,e);return n?this.add(t&&s instanceof Ge?s.children:s):s.parent&&s.remove(),s}load(e,t){const n=new Ge;let r,s,o;const a=(function(l){for(Nt.temp.innerHTML=l,s=0;s<Nt.temp.children.length;s++)r=Nt.temp.children[s],o=this.interpret(r,!1,!1),o!==null&&n.add(o);if(typeof t=="function"){const c=Nt.temp.children.length<=1?Nt.temp.children[0]:Nt.temp.children;t(n,c)}}).bind(this);return/\.svg$/i.test(e)?(Fl(e,a),n):(a(e),n)}},he=tr;w(he,"NextFrameId",mt.NextFrameId),w(he,"Types",mt.Types),w(he,"Version",mt.Version),w(he,"PublishDate",mt.PublishDate),w(he,"Identifier",mt.Identifier),w(he,"Resolution",mt.Resolution),w(he,"AutoCalculateImportedMatrices",mt.AutoCalculateImportedMatrices),w(he,"Instances",mt.Instances),w(he,"uniqueId",mt.uniqueId),w(he,"Anchor",ve),w(he,"Collection",Bn),w(he,"Events",j),w(he,"Group",Ge),w(he,"Matrix",Xn),w(he,"Path",Se),w(he,"Registry",Tr),w(he,"Element",Dn),w(he,"Shape",dn),w(he,"Text",At),w(he,"Vector",Z),w(he,"Gradient",Ye),w(he,"ImageSequence",zr),w(he,"LinearGradient",Oe),w(he,"RadialGradient",Ve),w(he,"Sprite",Pr),w(he,"Stop",Ut),w(he,"Texture",Ee),w(he,"ArcSegment",Rr),w(he,"Circle",Zi),w(he,"Ellipse",Ji),w(he,"Line",Ds),w(he,"Points",Fr),w(he,"Polygon",Mr),w(he,"Rectangle",En),w(he,"RoundedRectangle",Qi),w(he,"Star",Ar),w(he,"CanvasRenderer",lt),w(he,"SVGRenderer",zl),w(he,"WebGLRenderer",Ll),w(he,"Commands",ee),w(he,"Utils",tm);function nm(){const e=document.body.getBoundingClientRect(),t=this.width=e.width,n=this.height=e.height;this.renderer.setSize(t,n,this.ratio)}function im(){const e=this.renderer.domElement.parentElement;if(!e){console.warn("Two.js: Attempting to fit to parent, but no parent found.");return}const t=e.getBoundingClientRect(),n=this.width=t.width,r=this.height=t.height;this.renderer.setSize(n,r,this.ratio)}function rm(e,t){this.width=e,this.height=t,this.trigger(j.Types.resize,e,t)}var nr=Nt.getRequestAnimationFrame();function Dl(){for(let e=0;e<he.Instances.length;e++){const t=he.Instances[e];t.playing&&t.update()}he.NextFrameId=nr(Dl)}nr.init=function(){Dl(),nr.init=function(){}};let Kt;typeof window<"u"?Kt=window:typeof global<"u"?Kt=global:typeof self<"u"&&(Kt=self);let Hl;const Jn=Math.PI*2,tt=Math.PI*.5;function sm(e,t,n,r,s,o){let a;return arguments.length<=1?(a=e.a,t=e.b,n=e.c,r=e.d,s=e.e,o=e.f):a=e,{translateX:s,translateY:o,scaleX:Math.sqrt(a*a+t*t),scaleY:Math.sqrt(n*n+r*r),rotation:180*Math.atan2(t,a)/Math.PI}}function om(e){Hl=e}function am(e,t){t=t&&t.identity()||new Hl;let n=e;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;t.multiply(a[0],a[1],a[2],a[3],a[4],a[5],a[6],a[7],a[8],a[9])}return t}function Zt(e,t,n){return n*(t-e)+e}function Ti(e,t){for(;e<0;)e+=t;return e%t}const Wl=Kt.Float32Array||Array,lm=Math.floor;function Jt(e){return lm(e*1e6)/1e6}const fe={move:"M",line:"L",curve:"C",close:"Z"};class K{constructor(){k(this,"_events",{});k(this,"_bound",!1)}addEventListener(t,n){return(this._events[t]||(this._events[t]=[])).push(n),this._bound=!0,this}on(){return this.addEventListener.apply(this,arguments)}bind(){return this.addEventListener.apply(this,arguments)}removeEventListener(t,n){if(!this._events)return this;if(!t&&!n)return this._events={},this._bound=!1,this;const r=t?[t]:Object.keys(this._events);for(let s=0,o=r.length;s<o;s++){t=r[s];let a=this._events[t];if(a){let l=[];if(n)for(let c=0,d=a.length;c<d;c++){let h=a[c];h=h.handler?h.handler:h,n!==h&&l.push(h)}this._events[t]=l}}return this}off(){return this.removeEventListener.apply(this,arguments)}unbind(){return this.removeEventListener.apply(this,arguments)}dispatchEvent(t){if(!this._events)return this;const n=Array.prototype.slice.call(arguments,1),r=this._events[t];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(t,n,r){const s=this;t&&(o.obj=t,o.name=n,o.handler=r,t.on(n,o));function o(){r.apply(s,arguments)}return s}ignore(t,n,r){return t.off(n,r),this}}k(K,"Types",{play:"play",pause:"pause",update:"update",render:"render",resize:"resize",change:"change",remove:"remove",insert:"insert",order:"order",load:"load"}),k(K,"Methods",["addEventListener","on","removeEventListener","off","unbind","dispatchEvent","trigger","listen","ignore"]);const jl={x:{enumerable:!0,get:function(){return this._x},set:function(e){this._x!==e&&(this._x=e,this._bound&&this.dispatchEvent(K.Types.change))}},y:{enumerable:!0,get:function(){return this._y},set:function(e){this._y!==e&&(this._y=e,this._bound&&this.dispatchEvent(K.Types.change))}}},it=class it extends K{constructor(n=0,r=0){super();k(this,"_x",0);k(this,"_y",0);for(let s in jl)Object.defineProperty(this,s,jl[s]);this.x=n,this.y=r}static add(n,r){return new it(n.x+r.x,n.y+r.y)}static sub(n,r){return new it(n.x-r.x,n.y-r.y)}static subtract(n,r){return it.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(it.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 it(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:Jt(this.x),y:Jt(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}};k(it,"zero",new it),k(it,"left",new it(-1,0)),k(it,"right",new it(1,0)),k(it,"up",new it(0,-1)),k(it,"down",new it(0,1));let we=it;class $e extends we{constructor(n=0,r=0,s=0,o=0,a=0,l=0,c=fe.move){super(n,r);k(this,"controls",{left:new we,right:new we});k(this,"_command",fe.move);k(this,"_relative",!0);k(this,"_rx",0);k(this,"_ry",0);k(this,"_xAxisRotation",0);k(this,"_largeArcFlag",0);k(this,"_sweepFlag",1);for(let h in Xl)Object.defineProperty(this,h,Xl[h]);this.command=c,this.relative=!0;const d=$e.makeBroadcast(this);this.controls.left.set(s,o).addEventListener(K.Types.change,d),this.controls.right.set(a,l).addEventListener(K.Types.change,d)}static makeBroadcast(n){return r;function r(){n._bound&&n.dispatchEvent(K.Types.change)}}static fromObject(n){return new $e().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 $e().copy(this)}toObject(){return{x:Jt(this.x),y:Jt(this.y),command:this.command,relative:this.relative,controls:{left:this.controls.left.toObject(),right:this.controls.right.toObject()},rx:Jt(this.rx),ry:Jt(this.ry),xAxisRotation:Jt(this.xAxisRotation),largeArcFlag:Jt(this.largeArcFlag),sweepFlag:Jt(this.sweepFlag)}}toString(){return JSON.stringify(this.toObject())}}const Xl={command:{enumerable:!0,get:function(){return this._command},set:function(e){this._command!==e&&(this._command=e,this._bound&&this.dispatchEvent(K.Types.change))}},relative:{enumerable:!0,get:function(){return this._relative},set:function(e){this._relative!==!!e&&(this._relative=!!e,this._bound&&this.dispatchEvent(K.Types.change))}},rx:{enumerable:!0,get:function(){return this._rx},set:function(e){this._rx!==e&&(this._rx=e,this._bound&&this.dispatchEvent(K.Types.change))}},ry:{enumerable:!0,get:function(){return this._ry},set:function(e){this._ry!==e&&(this._ry=e,this._bound&&this.dispatchEvent(K.Types.change))}},xAxisRotation:{enumerable:!0,get:function(){return this._xAxisRotation},set:function(e){this._xAxisRotation!==e&&(this._xAxisRotation=e,this._bound&&this.dispatchEvent(K.Types.change))}},largeArcFlag:{enumerable:!0,get:function(){return this._largeArcFlag},set:function(e){this._largeArcFlag!==e&&(this._largeArcFlag=e,this._bound&&this.dispatchEvent(K.Types.change))}},sweepFlag:{get:function(){return this._sweepFlag},set:function(e){this._sweepFlag!==e&&(this._sweepFlag=e,this._bound&&this.dispatchEvent(K.Types.change))}}};let cm=0;const Xs={NextFrameId:null,Types:{webgl:"WebGLRenderer",svg:"SVGRenderer",canvas:"CanvasRenderer"},Version:"<%= version %>",PublishDate:"<%= publishDate %>",Identifier:"two-",Resolution:12,AutoCalculateImportedMatrices:!0,Instances:[],uniqueId:function(){return cm++}},jr={RecursionLimit:16,abscissas:[[.5773502691896257],[0,.7745966692414834],[.33998104358485626,.8611363115940526],[0,.5384693101056831,.906179845938664],[.2386191860831969,.6612093864662645,.932469514203152],[0,.4058451513773972,.7415311855993945,.9491079123427585],[.1834346424956498,.525532409916329,.7966664774136267,.9602898564975363],[0,.3242534234038089,.6133714327005904,.8360311073266358,.9681602395076261],[.14887433898163122,.4333953941292472,.6794095682990244,.8650633666889845,.9739065285171717],[0,.26954315595234496,.5190961292068118,.7301520055740494,.8870625997680953,.978228658146057],[.1252334085114689,.3678314989981802,.5873179542866175,.7699026741943047,.9041172563704749,.9815606342467192],[0,.2304583159551348,.44849275103644687,.6423493394403402,.8015780907333099,.9175983992229779,.9841830547185881],[.10805494870734367,.31911236892788974,.5152486363581541,.6872929048116855,.827201315069765,.9284348836635735,.9862838086968123],[0,.20119409399743451,.3941513470775634,.5709721726085388,.7244177313601701,.8482065834104272,.937273392400706,.9879925180204854],[.09501250983763744,.2816035507792589,.45801677765722737,.6178762444026438,.755404408355003,.8656312023878318,.9445750230732326,.9894009349916499]],weights:[[1],[.8888888888888888,.5555555555555556],[.6521451548625461,.34785484513745385],[.5688888888888889,.47862867049936647,.23692688505618908],[.46791393457269104,.3607615730481386,.17132449237917036],[.4179591836734694,.3818300505051189,.27970539148927664,.1294849661688697],[.362683783378362,.31370664587788727,.22238103445337448,.10122853629037626],[.3302393550012598,.31234707704000286,.26061069640293544,.1806481606948574,.08127438836157441],[.29552422471475287,.26926671930999635,.21908636251598204,.1494513491505806,.06667134430868814],[.2729250867779006,.26280454451024665,.23319376459199048,.18629021092773426,.1255803694649046,.05566856711617366],[.24914704581340277,.2334925365383548,.20316742672306592,.16007832854334622,.10693932599531843,.04717533638651183],[.2325515532308739,.22628318026289723,.2078160475368885,.17814598076194574,.13887351021978725,.09212149983772845,.04048400476531588],[.2152638534631578,.2051984637212956,.18553839747793782,.15720316715819355,.12151857068790319,.08015808715976021,.03511946033175186],[.2025782419255613,.19843148532711158,.1861610000155622,.16626920581699392,.13957067792615432,.10715922046717194,.07036604748810812,.03075324199611727],[.1894506104550685,.18260341504492358,.16915651939500254,.14959598881657674,.12462897125553388,.09515851168249279,.062253523938647894,.027152459411754096]]};function Xr(e,t,n,r,s){const o=1-e;return o*o*o*t+3*o*o*e*n+3*o*e*e*r+e*e*e*s}function ql(e,t,n,r,s,o,a,l,c){c=c||jr.RecursionLimit;const d=c+1;if(Math.abs(e-a)<.001&&Math.abs(t-l)<.001)return[new $e(a,l)];const h=[];for(let u=0;u<d;u++){const f=u/d,p=Xr(f,e,n,s,a),g=Xr(f,t,r,o,l);h.push(new $e(p,g))}return h}function dm(e,t,n,r,s,o,a,l,c){if(e===n&&t===r&&s===a&&o===l){const _=a-e,y=l-t;return Math.sqrt(_*_+y*y)}const d=9*(n-s)+3*(a-e),h=6*(e+s)-12*n,u=3*(n-e),f=9*(r-o)+3*(l-t),p=6*(t+o)-12*r,g=3*(r-t);function m(_){const y=(d*_+h)*_+u,b=(f*_+p)*_+g;return Math.sqrt(y*y+b*b)}return um(m,0,1,c||jr.RecursionLimit)}function hm(e,t,n,r,s,o,a,l){const c=[],d=[[],[]];let h,u,f,p,g,m,_,y;for(let C=0;C<2;++C){if(C==0?(u=6*e-12*n+6*s,h=-3*e+9*n-9*s+3*a,f=3*n-3*e):(u=6*t-12*r+6*o,h=-3*t+9*r-9*o+3*l,f=3*r-3*t),Math.abs(h)<1e-12){if(Math.abs(u)<1e-12)continue;p=-f/u,0<p&&p<1&&c.push(p);continue}_=u*u-4*f*h,y=Math.sqrt(_),!(_<0)&&(g=(-u+y)/(2*h),0<g&&g<1&&c.push(g),m=(-u-y)/(2*h),0<m&&m<1&&c.push(m))}let b=c.length,S=b,x;for(;b--;)p=c[b],x=1-p,d[0][b]=x*x*x*e+3*x*x*p*n+3*x*p*p*s+p*p*p*a,d[1][b]=x*x*x*t+3*x*x*p*r+3*x*p*p*o+p*p*p*l;return d[0][S]=e,d[1][S]=t,d[0][S+1]=a,d[1][S+1]=l,d[0].length=d[1].length=S+2,{min:{x:Math.min.apply(0,d[0]),y:Math.min.apply(0,d[1])},max:{x:Math.max.apply(0,d[0]),y:Math.max.apply(0,d[1])}}}function um(e,t,n,r){let s=jr.abscissas[r-2],o=jr.weights[r-2],a=.5*(n-t),l=a+t,c=0,d=r+1>>1,h=r&1?o[c++]*e(l):0;for(;c<d;){const u=a*s[c];h+=o[c++]*(e(l+u)+e(l-u))}return a*h}function fm(e,t){const n=e.length,r=n-1;for(let s=0;s<n;s++){const o=e[s],a=t?Ti(s-1,n):Math.max(s-1,0),l=t?Ti(s+1,n):Math.min(s+1,r),c=e[a],d=o,h=e[l];pm(c,d,h),d.command=s===0?fe.move:fe.curve}}function pm(e,t,n){const r=we.angleBetween(e,t),s=we.angleBetween(n,t);let o=we.distanceBetween(e,t),a=we.distanceBetween(n,t),l=(r+s)/2;return o<1e-4||a<1e-4?(typeof t.relative=="boolean"&&!t.relative&&(t.controls.left.copy(t),t.controls.right.copy(t)),t):(o*=.33,a*=.33,s<r?l+=tt:l-=tt,t.controls.left.x=Math.cos(l)*o,t.controls.left.y=Math.sin(l)*o,l-=Math.PI,t.controls.right.x=Math.cos(l)*a,t.controls.right.y=Math.sin(l)*a,typeof t.relative=="boolean"&&!t.relative&&(t.controls.left.x+=t.x,t.controls.left.y+=t.y,t.controls.right.x+=t.x,t.controls.right.y+=t.y),t)}let ir=(pi=class extends K{constructor(){super();k(this,"_flagId",!1);k(this,"_flagClassName",!1);k(this,"_renderer",{});k(this,"_id",Xs.Identifier+Xs.uniqueId());k(this,"_className","");k(this,"classList",[]);for(let n in Yl)Object.defineProperty(this,n,Yl[n])}static fromObject(n){const r=new pi().copy(n);return"id"in n&&(r.id=n.id),r}flagReset(){return this._flagId=this._flagClassName=!1,this}copy(n){return this.renderer.type=n.renderer.type,this.className=n.className,this}toObject(){return{renderer:{type:this.renderer.type},id:this.id,className:this.className}}},k(pi,"Properties",["renderer","id","className"]),pi);const Yl={renderer:{enumerable:!1,get:function(){return this._renderer}},id:{enumerable:!0,get:function(){return this._id},set:function(e){const t=this._id;e!==this._id&&(this._id=e,this._flagId=!0,this.parent&&(delete this.parent.children.ids[t],this.parent.children.ids[this._id]=this))}},className:{enumerable:!0,get:function(){return this._className},set:function(e){this._className!==e&&(this._flagClassName=!0,this.classList=e.split(/\s+?/),this._className=e)}}};class qr extends Error{constructor(n){super();k(this,"name","Two.js");k(this,"message");this.message=n}}class gm{constructor(){k(this,"map",{})}add(t,n){return this.map[t]=n,this}remove(t){return delete this.map[t],this}get(t){return this.map[t]}contains(t){return t in this.map}}let Yr;const Ul={video:/\.(mp4|webm|ogg)$/i,image:/\.(jpe?g|png|gif|tiff|webp)$/i,effect:/texture|gradient/i};Kt.document&&(Yr=document.createElement("a"));const We=class We extends ir{constructor(n,r){super();k(this,"_flagSrc",!1);k(this,"_flagImage",!1);k(this,"_flagVideo",!1);k(this,"_flagLoaded",!1);k(this,"_flagRepeat",!1);k(this,"_flagOffset",!1);k(this,"_flagScale",!1);k(this,"_src","");k(this,"_image",null);k(this,"_loaded",!1);k(this,"_repeat","no-repeat");k(this,"_scale",1);k(this,"_offset",null);for(let s in Gl)Object.defineProperty(this,s,Gl[s]);if(this._renderer.type="texture",this._renderer.flagOffset=mm.bind(this),this._renderer.flagScale=_m.bind(this),this.loaded=!1,this.repeat="no-repeat",this.offset=new we,typeof r=="function"){const s=(function(){this.unbind(K.Types.load,s),typeof r=="function"&&r()}).bind(this);this.bind(K.Types.load,s)}if(typeof n=="string")this.src=n;else if(typeof n=="object"){const s=Object.prototype.toString.call(n);(s==="[object HTMLImageElement]"||s==="[object HTMLCanvasElement]"||s==="[object HTMLVideoElement]"||s==="[object Image]")&&(this.image=n)}this._update()}fromObject(n){const r=new We().copy(n);return"id"in n&&(r.id=n.id),r}static getAbsoluteURL(n){return Yr?(Yr.href=n,Yr.href):n}static loadHeadlessBuffer(n,r){n.image.onload=r,n.image.src=n.src}static getTag(n){return n&&n.nodeName&&n.nodeName.toLowerCase()||"img"}static getImage(n){const r=We.getAbsoluteURL(n);if(We.ImageRegistry.contains(r))return We.ImageRegistry.get(r);let s;return Kt.document?Ul.video.test(r)?s=document.createElement("video"):s=document.createElement("img"):console.warn("Two.js: no prototypical image defined for Two.Texture"),s.crossOrigin="anonymous",s.referrerPolicy="no-referrer",s}static load(n,r){let s=n.image,o=We.getTag(s);n._flagImage&&(/canvas/i.test(o)?We.Register.canvas(n,r):(n._src=s.getAttribute("two-src")||s.src,We.Register[o](n,r))),n._flagSrc&&(s||(s=We.getImage(n.src),n.image=s),o=We.getTag(s),We.Register[o](n,r))}clone(){const n=new We(this.src);return n.repeat=this.repeat,n.offset.copy(this.offset),n.scale=this.scale,n}copy(n){return this.src=n.src,this.repeat=n.repeat,this.offset=typeof n.offset=="number"||n.offset instanceof we?n.offset:new we().copy(n.offset),this.scale=typeof n.scale=="number"||n.scale instanceof we?n.scale:new we().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(K.Types.change),(this._flagSrc||this._flagImage)&&(this.loaded=!1,We.load(this,(function(){this.loaded=!0,this.trigger(K.Types.change).trigger(K.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("elem"in this._renderer){const n=this._renderer.elem;n.parentNode.removeChild(n)}return"effect"in this._renderer&&(this._renderer.effect=null),this}};k(We,"Properties",["src","loaded","repeat","scale","offset","image"]),k(We,"RegularExpressions",Ul),k(We,"ImageRegistry",new gm),k(We,"Register",{canvas:function(n,r){n._src="#"+n.id,We.ImageRegistry.add(n.src,n.image),typeof r=="function"&&r()},img:function(n,r){const s=n.image,o=function(l){s.removeEventListener&&typeof s.removeEventListener=="function"&&(s.removeEventListener("load",o,!1),s.removeEventListener("error",a,!1)),typeof r=="function"&&r()},a=function(l){throw typeof s.removeEventListener=="function"&&(s.removeEventListener("load",o,!1),s.removeEventListener("error",a,!1)),new qr("unable to load "+n.src)};typeof s.width=="number"&&s.width>0&&typeof s.height=="number"&&s.height>0?o():typeof s.addEventListener=="function"&&(s.addEventListener("load",o,!1),s.addEventListener("error",a,!1)),n._src=We.getAbsoluteURL(n._src),!(s&&s.getAttribute("two-src"))&&(s.setAttribute("two-src",n.src),We.ImageRegistry.add(n.src,s),n.image.src=n.src)},video:function(n,r){const s=function(a){n.image.removeEventListener("canplaythrough",s,!1),n.image.removeEventListener("error",o,!1),n.image.width=n.image.videoWidth,n.image.height=n.image.videoHeight,typeof r=="function"&&r()},o=function(a){throw n.image.removeEventListener("canplaythrough",s,!1),n.image.removeEventListener("error",o,!1),new qr("unable to load "+n.src)};n._src=We.getAbsoluteURL(n._src),n.image.getAttribute("two-src")||(n.image.setAttribute("two-src",n.src),We.ImageRegistry.add(n.src,n.image)),n.image.readyState>=4?s():(n.image.addEventListener("canplaythrough",s,!1),n.image.addEventListener("error",o,!1),n.image.src=n.src,n.image.load())}});let nt=We;const Gl={src:{enumerable:!0,get:function(){return this._src},set:function(e){this._src=e,this._flagSrc=!0}},loaded:{enumerable:!0,get:function(){return this._loaded},set:function(e){this._loaded=e,this._flagLoaded=!0}},repeat:{enumerable:!0,get:function(){return this._repeat},set:function(e){this._repeat=e,this._flagRepeat=!0}},image:{enumerable:!0,get:function(){return this._image},set:function(e){const t=nt.getTag(e);let n;switch(t){case"canvas":n="#"+e.id;break;default:n=e.src}nt.ImageRegistry.contains(n)?this._image=nt.ImageRegistry.get(e.src):this._image=e,this._flagImage=!0}},offset:{enumerable:!0,get:function(){return this._offset},set:function(e){this._offset&&this._offset.unbind(K.Types.change,this._renderer.flagOffset),this._offset=e,this._offset.bind(K.Types.change,this._renderer.flagOffset),this._flagOffset=!0}},scale:{enumerable:!0,get:function(){return this._scale},set:function(e){this._scale instanceof we&&this._scale.unbind(K.Types.change,this._renderer.flagScale),this._scale=e,this._scale instanceof we&&this._scale.bind(K.Types.change,this._renderer.flagScale),this._flagScale=!0}}};function mm(){this._flagOffset=!0}function _m(){this._flagScale=!0}class Ei extends Array{constructor(){super();ha(this,rt,new K);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 kt(this,rt)}set _events(n){zh(this,rt,n)}get _bound(){return kt(this,rt)._bound}set _bound(n){kt(this,rt)._bound=n}addEventListener(){return kt(this,rt).addEventListener.apply(this,arguments)}on(){return kt(this,rt).on.apply(this,arguments)}bind(){return kt(this,rt).bind.apply(this,arguments)}removeEventListener(){return kt(this,rt).removeEventListener.apply(this,arguments)}off(){return kt(this,rt).off.apply(this,arguments)}unbind(){return kt(this,rt).unbind.apply(this,arguments)}dispatchEvent(){return kt(this,rt).dispatchEvent.apply(this,arguments)}trigger(){return kt(this,rt).trigger.apply(this,arguments)}listen(){return kt(this,rt).listen.apply(this,arguments)}ignore(){return kt(this,rt).ignore.apply(this,arguments)}pop(){const n=super.pop.apply(this,arguments);return this.trigger(K.Types.remove,[n]),n}shift(){const n=super.shift.apply(this,arguments);return this.trigger(K.Types.remove,[n]),n}push(){const n=super.push.apply(this,arguments);return this.trigger(K.Types.insert,arguments),n}unshift(){const n=super.unshift.apply(this,arguments);return this.trigger(K.Types.insert,arguments),n}splice(){const n=super.splice.apply(this,arguments);if(this.trigger(K.Types.remove,n),arguments.length>2){const r=this.slice(arguments[0],arguments[0]+arguments.length-2);this.trigger(K.Types.insert,r),this.trigger(K.Types.order)}return n}sort(){return super.sort.apply(this,arguments),this.trigger(K.Types.order),this}reverse(){return super.reverse.apply(this,arguments),this.trigger(K.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}}rt=new WeakMap;const Kl=Array.prototype.slice;function ym(e){if(e==null)return!1;const t=e.length;return typeof t=="number"&&t>=0&&t<4294967296}const Ae={isNaN:function(e){return typeof e=="number"&&e!==+e},isElement:function(e){return!!(e&&e.nodeType===1)},isObject:function(e){const t=typeof e;return t==="function"||t==="object"&&!!e},extend:function(e){const t=Kl.call(arguments,1);for(let n=0;n<t.length;n++){const r=t[n];for(let s in r)e[s]=r[s]}return e},defaults:function(e){const t=Kl.call(arguments,1);for(let n=0;n<t.length;n++){const r=t[n];for(let s in r)e[s]===void 0&&(e[s]=r[s])}return e},each:function(e,t,n){const r=n||this,s=!ym(e)&&Object.keys(e),o=(s||e).length;for(let a=0;a<o;a++){const l=s?s[a]:a;t.call(r,e[l],l,e)}return e},performance:Kt.performance&&Kt.performance.now?Kt.performance:Date},Bt=class Bt extends ir{constructor(n,r,s){super();k(this,"_flagOffset",!0);k(this,"_flagOpacity",!0);k(this,"_flagColor",!0);k(this,"_offset",0);k(this,"_opacity",1);k(this,"_color","#fff");for(let o in Zl)Object.defineProperty(this,o,Zl[o]);this._renderer.type="stop",this.offset=typeof n=="number"?n:Bt.Index<=0?0:1,this.opacity=typeof s=="number"?s:1,this.color=typeof r=="string"?r:Bt.Index<=0?"#fff":"#000",Bt.Index=(Bt.Index+1)%2}static fromObject(n){const r=new Bt().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<Bt.Properties.length;r++){const s=Bt.Properties[r];s in n&&(this[s]=n[s])}return this}clone(n){const r=new Bt;return Ae.each(Bt.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",Ae.each(Bt.Properties,r=>{n[r]=this[r]},this),n}flagReset(){return this._flagOffset=this._flagColor=this._flagOpacity=!1,super.flagReset.call(this),this}};k(Bt,"Index",0),k(Bt,"Properties",["offset","opacity","color"]);let Qn=Bt;const Zl={offset:{enumerable:!0,get:function(){return this._offset},set:function(e){this._offset=e,this._flagOffset=!0,this.parent&&(this.parent._flagStops=!0)}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(e){this._opacity=e,this._flagOpacity=!0,this.parent&&(this.parent._flagStops=!0)}},color:{enumerable:!0,get:function(){return this._color},set:function(e){this._color=e,this._flagColor=!0,this.parent&&(this.parent._flagStops=!0)}}},nn=class nn extends ir{constructor(n){super();k(this,"_flagStops",!1);k(this,"_flagSpread",!1);k(this,"_flagUnits",!1);k(this,"_spread","");k(this,"_units","");for(let r in Jl)Object.defineProperty(this,r,Jl[r]);this._renderer.type="gradient",this._renderer.flagStops=bm.bind(this),this._renderer.bindStops=wm.bind(this),this._renderer.unbindStops=vm.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 Qn?o:new Qn().copy(o)));const s=new nn().copy(n);return"id"in n&&(s.id=n.id),s}clone(n){const r=this.stops.map(o=>o.clone()),s=new nn(r);return Ae.each(nn.Properties,o=>{s[o]=this[o]},this),n&&n.add(s),s}copy(n){super.copy.call(this,n);for(let r=0;r<nn.Properties.length;r++){const s=nn.Properties[r];s in n&&(this[s]=n[s])}return this}toObject(){const n={stops:this.stops.map(r=>r.toObject())};return Ae.each(nn.Properties,r=>{n[r]=this[r]},this),n}_update(){return(this._flagSpread||this._flagStops)&&this.trigger(K.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}};k(nn,"Stop",Qn),k(nn,"Properties",["spread","stops","units"]);let Je=nn;const Jl={spread:{enumerable:!0,get:function(){return this._spread},set:function(e){this._spread=e,this._flagSpread=!0}},units:{enumerable:!0,get:function(){return this._units},set:function(e){this._units=e,this._flagUnits=!0}},stops:{enumerable:!0,get:function(){return this._stops},set:function(e){const t=this._renderer.bindStops,n=this._renderer.unbindStops;this._stops&&this._stops.unbind(K.Types.insert,t).unbind(K.Types.remove,n),this._stops=new Ei((e||[]).slice(0)),this._stops.bind(K.Types.insert,t).bind(K.Types.remove,n),t(this._stops)}}};function bm(){this._flagStops=!0}function wm(e){let t=e.length;for(;t--;)e[t].bind(K.Types.change,this._renderer.flagStops),e[t].parent=this;this._renderer.flagStops()}function vm(e){let t=e.length;for(;t--;)e[t].unbind(K.Types.change,this._renderer.flagStops),delete e[t].parent;this._renderer.flagStops()}const On=class On extends Je{constructor(n,r,s,o,a){super(a);k(this,"_flagEndPoints",!1);k(this,"_left",null);k(this,"_right",null);for(let l in Ql)Object.defineProperty(this,l,Ql[l]);this._renderer.type="linear-gradient",this._renderer.flagEndPoints=km.bind(this),this.left=new we,this.right=new we,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 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];s in n&&(this[s]=n[s]instanceof we?n[s]:new we().copy(n[s]))}return this}clone(n){const r=this.stops.map(function(o){return o.clone()}),s=new On(this.left._x,this.left._y,this.right._x,this.right._y,r);return Ae.each(Je.Properties,function(o){s[o]=this[o]},this),n&&n.add(s),s}toObject(){const n=super.toObject.call(this);return n.left=this.left.toObject(),n.right=this.right.toObject(),n}_update(){return(this._flagEndPoints||this._flagSpread||this._flagStops)&&this.trigger(K.Types.change),this}flagReset(){return this._flagEndPoints=!1,super.flagReset.call(this),this}};k(On,"Stop",Qn),k(On,"Properties",["left","right"]);let _t=On;const Ql={left:{enumerable:!0,get:function(){return this._left},set:function(e){this._left instanceof we&&this._left.unbind(K.Types.change,this._renderer.flagEndPoints),this._left=e,this._left.bind(K.Types.change,this._renderer.flagEndPoints),this._flagEndPoints=!0}},right:{enumerable:!0,get:function(){return this._right},set:function(e){this._right instanceof we&&this._right.unbind(K.Types.change,this._renderer.flagEndPoints),this._right=e,this._right.bind(K.Types.change,this._renderer.flagEndPoints),this._flagEndPoints=!0}}};function km(){this._flagEndPoints=!0}const rn=class rn extends Je{constructor(n,r,s,o,a,l){super(o);k(this,"_flagRadius",!1);k(this,"_flagCenter",!1);k(this,"_flagFocal",!1);k(this,"_radius",0);k(this,"_center",null);k(this,"_focal",null);for(let c in ec)Object.defineProperty(this,c,ec[c]);this._renderer.type="radial-gradient",this._renderer.flagCenter=xm.bind(this),this._renderer.flagFocal=Cm.bind(this),this.center=new we,this.radius=typeof s=="number"?s:1,this.focal=new we,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 rn().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<rn.Properties.length;r++){const s=rn.Properties[r];s in n&&(/(center|focal)i/.test(s)?this[s]=n[s]instanceof we?n[s]:new we().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 rn(this.center._x,this.center._y,this._radius,r,this.focal._x,this.focal._y);return Ae.each(Je.Properties.concat(rn.Properties),function(o){s[o]=this[o]},this),n&&n.add(s),s}toObject(){const n=super.toObject.call(this);return Ae.each(rn.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(K.Types.change),this}flagReset(){return this._flagRadius=this._flagCenter=this._flagFocal=!1,super.flagReset.call(this),this}};k(rn,"Stop",Qn),k(rn,"Properties",["center","radius","focal"]);let yt=rn;const ec={radius:{enumerable:!0,get:function(){return this._radius},set:function(e){this._radius=e,this._flagRadius=!0}},center:{enumerable:!0,get:function(){return this._center},set:function(e){this._center&&this._center.unbind(K.Types.change,this._renderer.flagCenter),this._center=e,this._center.bind(K.Types.change,this._renderer.flagCenter),this._flagCenter=!0}},focal:{enumerable:!0,get:function(){return this._focal},set:function(e){this._focal&&this._focal.unbind(K.Types.change,this._renderer.flagFocal),this._focal=e,this._focal.bind(K.Types.change,this._renderer.flagFocal),this._flagFocal=!0}}};function xm(){this._flagCenter=!0}function Cm(){this._flagFocal=!0}function tc(e,t){if(t===0||t===1)return!0;const r=e._length*t;let s=0;for(let o=0;o<e._lengths.length;o++){const a=e._lengths[o];if(s>=r)return r-s>=0;s+=a}return!1}function Ur(e,t){const n=e._length;if(t<=0)return 0;if(t>=n)return e._lengths.length-1;for(let r=0,s=0;r<e._lengths.length;r++){if(s+e._lengths[r]>=t)return t-=s,Math.max(r-1,0)+t/e._lengths[r];s+=e._lengths[r]}return-1}function nc(e,t,n){let r,s,o,a,l,c,d,h;const u=t.controls&&t.controls.right,f=e.controls&&e.controls.left;return r=t.x,l=t.y,s=(u||t).x,c=(u||t).y,o=(f||e).x,d=(f||e).y,a=e.x,h=e.y,u&&t._relative&&(s+=t.x,c+=t.y),f&&e._relative&&(o+=e.x,d+=e.y),dm(r,l,s,c,o,d,a,h,n)}function ic(e,t,n){let r,s,o,a,l,c,d,h;const u=t.controls&&t.controls.right,f=e.controls&&e.controls.left;return r=t.x,l=t.y,s=(u||t).x,c=(u||t).y,o=(f||e).x,d=(f||e).y,a=e.x,h=e.y,u&&t._relative&&(s+=t.x,c+=t.y),f&&e._relative&&(o+=e.x,d+=e.y),ql(r,l,s,c,o,d,a,h,n)}function ei(e){switch(e.renderer.type){case"texture":return nt.fromObject(e);case"gradient":return Je.fromObject(e);case"linear-gradient":return _t.fromObject(e);case"radial-gradient":return yt.fromObject(e)}return e}const Sm=Math.cos,Bm=Math.sin,rc=Math.tan,qs=[],wt=class wt extends K{constructor(n,r,s,o,a,l){super();k(this,"elements",new Wl(9));k(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 v=n;let $,F,R;const X=r[0]||0,M=r[1]||0,N=r[2]||0;return $=v[0]*X+v[1]*M+v[2]*N,F=v[3]*X+v[4]*M+v[5]*N,R=v[6]*X+v[7]*M+v[8]*N,[$,F,R]}const o=n[0],a=n[1],l=n[2],c=n[3],d=n[4],h=n[5],u=n[6],f=n[7],p=n[8],g=r[0],m=r[1],_=r[2],y=r[3],b=r[4],S=r[5],x=r[6],C=r[7],B=r[8];return s=s||new Wl(9),s[0]=o*g+a*y+l*x,s[1]=o*m+a*b+l*C,s[2]=o*_+a*S+l*B,s[3]=c*g+d*y+h*x,s[4]=c*m+d*b+h*C,s[5]=c*_+d*S+h*B,s[6]=u*g+f*y+p*x,s[7]=u*m+f*b+p*C,s[8]=u*_+f*S+p*B,s}static fromObject(n){return new wt().copy(n)}set(n,r,s,o,a,l,c,d,h){if(typeof r>"u"){const u=n;n=u[0],r=u[1],s=u[2],o=u[3],a=u[4],l=u[5],c=u[6],d=u[7],h=u[8]}return this.elements[0]=n,this.elements[1]=r,this.elements[2]=s,this.elements[3]=o,this.elements[4]=a,this.elements[5]=l,this.elements[6]=c,this.elements[7]=d,this.elements[8]=h,this.trigger(K.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(K.Types.change)}identity(){return this.elements[0]=wt.Identity[0],this.elements[1]=wt.Identity[1],this.elements[2]=wt.Identity[2],this.elements[3]=wt.Identity[3],this.elements[4]=wt.Identity[4],this.elements[5]=wt.Identity[5],this.elements[6]=wt.Identity[6],this.elements[7]=wt.Identity[7],this.elements[8]=wt.Identity[8],this.trigger(K.Types.change)}multiply(n,r,s,o,a,l,c,d,h){if(typeof r>"u")return this.elements[0]*=n,this.elements[1]*=n,this.elements[2]*=n,this.elements[3]*=n,this.elements[4]*=n,this.elements[5]*=n,this.elements[6]*=n,this.elements[7]*=n,this.elements[8]*=n,this.trigger(K.Types.change);if(typeof s>"u"&&(s=1),typeof o>"u"){n=n||0,r=r||0,s=s||0,a=this.elements;const L=a[0]*n+a[1]*r+a[2]*s,U=a[3]*n+a[4]*r+a[5]*s,P=a[6]*n+a[7]*r+a[8]*s;return[L,U,P]}const u=this.elements,f=[n,r,s,o,a,l,c,d,h],p=u[0],g=u[1],m=u[2],_=u[3],y=u[4],b=u[5],S=u[6],x=u[7],C=u[8],B=f[0],v=f[1],$=f[2],F=f[3],R=f[4],X=f[5],M=f[6],N=f[7],A=f[8];return this.elements[0]=p*B+g*F+m*M,this.elements[1]=p*v+g*R+m*N,this.elements[2]=p*$+g*X+m*A,this.elements[3]=_*B+y*F+b*M,this.elements[4]=_*v+y*R+b*N,this.elements[5]=_*$+y*X+b*A,this.elements[6]=S*B+x*F+C*M,this.elements[7]=S*v+x*R+C*N,this.elements[8]=S*$+x*X+C*A,this.trigger(K.Types.change)}inverse(n){const r=this.elements;n=n||new wt;const s=r[0],o=r[1],a=r[2],l=r[3],c=r[4],d=r[5],h=r[6],u=r[7],f=r[8],p=f*c-d*u,g=-f*l+d*h,m=u*l-c*h;let _=s*p+o*g+a*m;return _?(_=1/_,n.elements[0]=p*_,n.elements[1]=(-f*o+a*u)*_,n.elements[2]=(d*o-a*c)*_,n.elements[3]=g*_,n.elements[4]=(f*s-a*h)*_,n.elements[5]=(-d*s+a*l)*_,n.elements[6]=m*_,n.elements[7]=(-u*s+o*h)*_,n.elements[8]=(c*s-o*l)*_,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=Sm(n),s=Bm(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=rc(n);return this.multiply(1,r,0,0,1,0,0,0,1)}skewY(n){const r=rc(n);return this.multiply(1,0,0,r,1,0,0,0,1)}toString(n){return qs.length=0,this.toTransformArray(n,qs),qs.map(Jt).join(" ")}toTransformArray(n,r){const s=this.elements,o=!!r,a=s[0],l=s[1],c=s[2],d=s[3],h=s[4],u=s[5];if(n){const f=s[6],p=s[7],g=s[8];if(o){r[0]=a,r[1]=d,r[2]=f,r[3]=l,r[4]=h,r[5]=p,r[6]=c,r[7]=u,r[8]=g;return}return[a,d,f,l,h,p,c,u,g]}if(o){r[0]=a,r[1]=d,r[2]=l,r[3]=h,r[4]=c,r[5]=u;return}return[a,d,l,h,c,u]}toArray(n,r){const s=this.elements,o=!!r,a=s[0],l=s[1],c=s[2],d=s[3],h=s[4],u=s[5];if(n){const f=s[6],p=s[7],g=s[8];if(o){r[0]=a,r[1]=l,r[2]=c,r[3]=d,r[4]=h,r[5]=u,r[6]=f,r[7]=p,r[8]=g;return}return[a,l,c,d,h,u,f,p,g]}if(o){r[0]=a,r[1]=l,r[2]=c,r[3]=d,r[4]=h,r[5]=u;return}return[a,l,c,d,h,u]}toObject(){return{renderer:{type:"matrix"},elements:this.toArray(!0),manual:!!this.manual}}clone(){return new wt().copy(this)}};k(wt,"Identity",[1,0,0,0,1,0,0,0,1]);let rr=wt;om(rr);const br=class br extends ir{constructor(){super();k(this,"_flagMatrix",!0);k(this,"_flagScale",!1);k(this,"_matrix",null);k(this,"_worldMatrix",null);k(this,"_position",null);k(this,"_rotation",0);k(this,"_scale",1);k(this,"_skewX",0);k(this,"_skewY",0);for(let n in Gr)Object.defineProperty(this,n,Gr[n]);this._renderer.flagMatrix=sc.bind(this),this.isShape=!0,this.matrix=new rr,this.worldMatrix=new rr,this.position=new we,this.rotation=0,this.scale=1,this.skewX=0,this.skewY=0}static fromObject(n){const r=new br().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 Gr.position.get.apply(this,arguments)}set translation(n){Gr.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 we?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 we?n.scale:new we(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 br;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 we?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 we?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}};k(br,"Properties",["position","rotation","scale","skewX","skewY","matrix","worldMatrix"]);let hn=br;const Gr={position:{enumerable:!0,get:function(){return this._position},set:function(e){this._position&&this._position.unbind(K.Types.change,this._renderer.flagMatrix),this._position=e,this._position.bind(K.Types.change,this._renderer.flagMatrix),sc.call(this)}},rotation:{enumerable:!0,get:function(){return this._rotation},set:function(e){this._rotation=e,this._flagMatrix=!0}},scale:{enumerable:!0,get:function(){return this._scale},set:function(e){this._scale instanceof we&&this._scale.unbind(K.Types.change,this._renderer.flagMatrix),this._scale=e,this._scale instanceof we&&this._scale.bind(K.Types.change,this._renderer.flagMatrix),this._flagMatrix=!0,this._flagScale=!0}},skewX:{enumerable:!0,get:function(){return this._skewX},set:function(e){this._skewX=e,this._flagMatrix=!0}},skewY:{enumerable:!0,get:function(){return this._skewY},set:function(e){this._skewY=e,this._flagMatrix=!0}},matrix:{enumerable:!0,get:function(){return this._matrix},set:function(e){this._matrix=e,this._flagMatrix=!0}},worldMatrix:{enumerable:!0,get:function(){return am(this,this._worldMatrix),this._worldMatrix},set:function(e){this._worldMatrix=e}}};function sc(){this._flagMatrix=!0}const $i=Math.min,Ni=Math.max,Tm=Math.ceil,Em=Math.floor,$m=new we,jt=class jt extends hn{constructor(n,r,s,o){super();k(this,"_flagVertices",!0);k(this,"_flagLength",!0);k(this,"_flagFill",!0);k(this,"_flagStroke",!0);k(this,"_flagLinewidth",!0);k(this,"_flagOpacity",!0);k(this,"_flagVisible",!0);k(this,"_flagCap",!0);k(this,"_flagJoin",!0);k(this,"_flagMiter",!0);k(this,"_flagMask",!1);k(this,"_flagClip",!1);k(this,"_length",0);k(this,"_fill","#fff");k(this,"_stroke","#000");k(this,"_linewidth",1);k(this,"_opacity",1);k(this,"_visible",!0);k(this,"_cap","round");k(this,"_join","round");k(this,"_miter",4);k(this,"_closed",!0);k(this,"_curved",!1);k(this,"_automatic",!0);k(this,"_beginning",0);k(this,"_ending",1);k(this,"_mask",null);k(this,"_clip",!1);k(this,"_dashes",null);for(let a in oc)Object.defineProperty(this,a,oc[a]);this._renderer.type="path",this._renderer.flagVertices=ac.bind(this),this._renderer.bindVertices=lc.bind(this),this._renderer.unbindVertices=cc.bind(this),this._renderer.flagFill=dc.bind(this),this._renderer.flagStroke=hc.bind(this),this._renderer.vertices=[],this._renderer.collection=[],this.closed=!!r,this.curved=!!s,this.beginning=0,this.ending=1,this.fill="#fff",this.stroke="#000",this.linewidth=1,this.opacity=1,this.className="",this.visible=!0,this.cap="butt",this.join="miter",this.miter=4,this.vertices=n,this.automatic=!o,this.dashes=[],this.dashes.offset=0}static fromObject(n){const r=typeof n.fill=="string"?n.fill:ei(n.fill),s=typeof n.stroke=="string"?n.stroke:ei(n.stroke),o=new jt().copy({...n,fill:r,stroke:s});return"id"in n&&(o.id=n.id),o}copy(n){super.copy.call(this,n),this.vertices=[];for(let r=0;r<n.vertices.length;r++){const s=n.vertices[r];s instanceof $e?this.vertices.push(n.vertices[r].clone()):this.vertices.push(new $e().copy(s))}for(let r=0;r<jt.Properties.length;r++){const s=jt.Properties[r];s in n&&(this[s]=n[s])}return this}clone(n){const r=new jt;for(let s=0;s<this.vertices.length;s++)r.vertices.push(this.vertices[s].clone());for(let s=0;s<jt.Properties.length;s++){const o=jt.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()),Ae.each(jt.Properties,r=>{typeof this[r]<"u"&&(this[r].toObject?n[r]=this[r].toObject():n[r]=this[r])},this),n}noFill(){return this.fill="none",this}noStroke(){return this.stroke="none",this.linewidth=0,this}corner(){const n=this.getBoundingClientRect(!0),r=n.width/2,s=n.height/2,o=n.left+n.width/2,a=n.top+n.height/2;for(let l=0;l<this.vertices.length;l++){const c=this.vertices[l];c.x-=o,c.y-=a,c.x+=r,c.y+=s}return this.mask&&(this.mask.translation.x-=o,this.mask.translation.x+=r,this.mask.translation.y-=a,this.mask.translation.y+=s),this}center(){const n=this.getBoundingClientRect(!0),r=n.left+n.width/2-this.translation.x,s=n.top+n.height/2-this.translation.y;for(let o=0;o<this.vertices.length;o++){const a=this.vertices[o];a.x-=r,a.y-=s}return this.mask&&(this.mask.translation.x-=r,this.mask.translation.y-=s),this}getBoundingClientRect(n){let r,s,o,a,l,c,d=1/0,h=-1/0,u=1/0,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:p,scaleY:g}=sm(r.elements[0],r.elements[3],r.elements[1],r.elements[4],r.elements[2],r.elements[5]);typeof p=="number"&&typeof g=="number"&&(s=Math.max(p,g)*(this.linewidth||0)/2)}else s*=typeof this.scale=="number"?this.scale:Math.max(this.scale.x,this.scale.y);if(o<=0)return{width:0,height:0};for(a=0;a<o;a++){c=this._renderer.vertices[a],l=this._renderer.vertices[(a+o-1)%o];const[p,g]=r.multiply(l.x,l.y),[m,_]=r.multiply(c.x,c.y);if(l.controls&&c.controls){let y=l.controls.right.x,b=l.controls.right.y;l.relative&&(y+=l.x,b+=l.y);let[S,x]=r.multiply(y,b),C=c.controls.left.x,B=c.controls.left.y;c.relative&&(C+=c.x,B+=c.y);let[v,$]=r.multiply(C,B);const F=hm(p,g,S,x,v,$,m,_);u=$i(F.min.y-s,u),d=$i(F.min.x-s,d),h=Ni(F.max.x+s,h),f=Ni(F.max.y+s,f)}else a<=1&&(u=$i(g-s,u),d=$i(p-s,d),h=Ni(p+s,h),f=Ni(g+s,f)),u=$i(_-s,u),d=$i(m-s,d),h=Ni(m+s,h),f=Ni(_+s,f)}return{top:u,left:d,right:h,bottom:f,width:h-d,height:f-u}}getPointAt(n,r){let s,o,a,l,c,d,h,u,f,p,g,m,_,y,b,S=this.length*Math.min(Math.max(n,0),1);const x=this.vertices.length,C=x-1;let B=null,v=null;for(let E=0,H=this._lengths.length,I=0;E<H;E++){if(I+this._lengths[E]>=S){this._closed?(s=Ti(E,x),o=Ti(E-1,x),E===0&&(s=o,o=E)):(s=E,o=Math.min(Math.max(E-1,0),C)),B=this.vertices[s],v=this.vertices[o],S-=I,this._lengths[E]!==0?n=S/this._lengths[E]:n=0;break}I+=this._lengths[E]}if(B===null||v===null)return null;if(B){if(!v)return B}else return v;b=v.controls&&v.controls.right,y=B.controls&&B.controls.left,c=v.x,p=v.y,d=(b||v).x,g=(b||v).y,h=(y||B).x,m=(y||B).y,u=B.x,_=B.y,b&&v.relative&&(d+=v.x,g+=v.y),y&&B.relative&&(h+=B.x,m+=B.y),l=Xr(n,c,d,h,u),f=Xr(n,p,g,m,_);const $=Zt(c,d,n),F=Zt(p,g,n),R=Zt(d,h,n),X=Zt(g,m,n),M=Zt(h,u,n),N=Zt(m,_,n),A=Zt($,R,n),L=Zt(F,X,n),U=Zt(R,M,n),P=Zt(X,N,n);return Ae.isObject(r)?(r.x=l,r.y=f,r instanceof $e&&(r.controls.left.x=A,r.controls.left.y=L,r.controls.right.x=U,r.controls.right.y=P,(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 $e(l,f,A-l,L-f,U-l,P-f,this._curved?fe.curve:fe.line),a.t=n,a)}plot(){if(this.curved)return fm(this._collection,this.closed),this;for(let n=0;n<this._collection.length;n++)this._collection[n].command=n===0?fe.move:fe.line;return this}subdivide(n){this._update();const r=this.vertices.length-1,s=this._closed||this.vertices[r]._command===fe.close;let o=this.vertices[r],a=[],l;return Ae.each(this.vertices,function(c,d){if(d<=0&&!s){o=c;return}if(c.command===fe.move){a.push(new $e(o.x,o.y)),d>0&&(a[a.length-1].command=fe.line),o=c;return}l=ic(c,o,n),a=a.concat(l),Ae.each(l,function(h,u){u<=0&&o.command===fe.move?h.command=fe.move:h.command=fe.line}),d>=r&&(this._closed&&this._automatic&&(o=c,l=ic(c,o,n),a=a.concat(l),Ae.each(l,function(h,u){u<=0&&o.command===fe.move?h.command=fe.move:h.command=fe.line})),a.push(new $e(c.x,c.y)),a[a.length-1].command=s?fe.close:fe.line),o=c},this),this._automatic=!1,this._curved=!1,this.vertices=a,this}_updateLength(n,r){r||this._update();const o=this.vertices.length-1;let a=this.vertices[o],l=0;return typeof this._lengths>"u"&&(this._lengths=[]),Ae.each(this.vertices,function(c,d){if(d<=0||c.command===fe.move){a=c,this._lengths[d]=0;return}this._lengths[d]=nc(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=Ur(this,s*this._length),l=Ur(this,o*this._length),c=Tm(a),d=Em(l);let h,u,f,p,g,m;for(this._renderer.vertices.length=0,m=0;m<n;m++)this._renderer.collection.length<=m&&this._renderer.collection.push(new $e),m>d&&!u?(g=this._renderer.collection[m].copy(this._collection[m]),this.getPointAt(o,g),g.command=this._renderer.collection[m].command,this._renderer.vertices.push(g),u=g,f=this._collection[m-1],f&&f.controls&&(g.relative?g.controls.right.clear():g.controls.right.copy(g),f.relative?this._renderer.collection[m-1].controls.right.copy(f.controls.right).lerp(we.zero,1-g.t):this._renderer.collection[m-1].controls.right.copy(f.controls.right).lerp(f,1-g.t))):m>=c&&m<=d&&(g=this._renderer.collection[m].copy(this._collection[m]),this._renderer.vertices.push(g),m===d&&tc(this,o)?(u=g,!r&&u.controls&&(u.relative?u.controls.right.clear():u.controls.right.copy(u))):m===c&&tc(this,s)&&(h=g,h.command=fe.move,!r&&h.controls&&(h.relative?h.controls.left.clear():h.controls.left.copy(h))));c>0&&!h&&(m=c-1,g=this._renderer.collection[m].copy(this._collection[m]),this.getPointAt(s,g),g.command=fe.move,this._renderer.vertices.unshift(g),p=this._collection[m+1],p&&p.controls&&(g.controls.left.clear(),p.relative?this._renderer.collection[m+1].controls.left.copy(p.controls.left).lerp(we.zero,g.t):($m.copy(p),this._renderer.collection[m+1].controls.left.copy(p.controls.left).lerp(p,g.t))))}return hn.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=!1,hn.prototype.flagReset.call(this),this}};k(jt,"Properties",["fill","stroke","linewidth","opacity","visible","cap","join","miter","closed","curved","automatic","beginning","ending","dashes"]),k(jt,"Utils",{getCurveLength:nc});let Ne=jt;const oc={linewidth:{enumerable:!0,get:function(){return this._linewidth},set:function(e){this._linewidth=e,this._flagLinewidth=!0}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(e){this._opacity=e,this._flagOpacity=!0}},visible:{enumerable:!0,get:function(){return this._visible},set:function(e){this._visible=e,this._flagVisible=!0}},cap:{enumerable:!0,get:function(){return this._cap},set:function(e){this._cap=e,this._flagCap=!0}},join:{enumerable:!0,get:function(){return this._join},set:function(e){this._join=e,this._flagJoin=!0}},miter:{enumerable:!0,get:function(){return this._miter},set:function(e){this._miter=e,this._flagMiter=!0}},fill:{enumerable:!0,get:function(){return this._fill},set:function(e){(this._fill instanceof Je||this._fill instanceof _t||this._fill instanceof yt||this._fill instanceof nt)&&this._fill.unbind(K.Types.change,this._renderer.flagFill),this._fill=e,this._flagFill=!0,(this._fill instanceof Je||this._fill instanceof _t||this._fill instanceof yt||this._fill instanceof nt)&&this._fill.bind(K.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(e){(this._stroke instanceof Je||this._stroke instanceof _t||this._stroke instanceof yt||this._stroke instanceof nt)&&this._stroke.unbind(K.Types.change,this._renderer.flagStroke),this._stroke=e,this._flagStroke=!0,(this._stroke instanceof Je||this._stroke instanceof _t||this._stroke instanceof yt||this._stroke instanceof nt)&&this._stroke.bind(K.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(e){this._closed=!!e,this._flagVertices=!0}},curved:{enumerable:!0,get:function(){return this._curved},set:function(e){this._curved=!!e,this._flagVertices=!0}},automatic:{enumerable:!0,get:function(){return this._automatic},set:function(e){if(e===this._automatic)return;this._automatic=!!e;const t=this._automatic?"ignore":"listen";Ae.each(this.vertices,function(n){n[t]()})}},beginning:{enumerable:!0,get:function(){return this._beginning},set:function(e){this._beginning=e,this._flagVertices=!0}},ending:{enumerable:!0,get:function(){return this._ending},set:function(e){this._ending=e,this._flagVertices=!0}},vertices:{enumerable:!0,get:function(){return this._collection},set:function(e){const t=this._renderer.bindVertices,n=this._renderer.unbindVertices;this._collection&&this._collection.unbind(K.Types.insert,t).unbind(K.Types.remove,n),e instanceof Ei?this._collection=e:this._collection=new Ei(e||[]),this._collection.bind(K.Types.insert,t).bind(K.Types.remove,n),t(this._collection)}},mask:{enumerable:!0,get:function(){return this._mask},set:function(e){this._mask=e,this._flagMask=!0,Ae.isObject(e)&&!e.clip&&(e.clip=!0)}},clip:{enumerable:!0,get:function(){return this._clip},set:function(e){this._clip=e,this._flagClip=!0}},dashes:{enumerable:!0,get:function(){return this._dashes},set:function(e){typeof e.offset!="number"&&(e.offset=this.dashes&&this._dashes.offset||0),this._dashes=e}}};function ac(){this._flagVertices=!0,this._flagLength=!0,this.parent&&(this.parent._flagLength=!0)}function lc(e){let t=e.length;for(;t--;)e[t].bind(K.Types.change,this._renderer.flagVertices);this._renderer.flagVertices()}function cc(e){let t=e.length;for(;t--;)e[t].unbind(K.Types.change,this._renderer.flagVertices);this._renderer.flagVertices()}function dc(){this._flagFill=!0}function hc(){this._flagStroke=!0}const Nm=Math.ceil,Pm=Math.floor,sn=class sn extends hn{constructor(n){super();k(this,"_flagVertices",!0);k(this,"_flagLength",!0);k(this,"_flagFill",!0);k(this,"_flagStroke",!0);k(this,"_flagLinewidth",!0);k(this,"_flagOpacity",!0);k(this,"_flagVisible",!0);k(this,"_flagSize",!0);k(this,"_flagSizeAttenuation",!0);k(this,"_length",0);k(this,"_fill","#fff");k(this,"_stroke","#000");k(this,"_linewidth",1);k(this,"_opacity",1);k(this,"_visible",!0);k(this,"_size",1);k(this,"_sizeAttenuation",!1);k(this,"_beginning",0);k(this,"_ending",1);k(this,"_dashes",null);k(this,"noFill",Ne.prototype.noFill);k(this,"noStroke",Ne.prototype.noStroke);k(this,"corner",Ne.prototype.corner);k(this,"center",Ne.prototype.center);k(this,"getBoundingClientRect",Ne.prototype.getBoundingClientRect);k(this,"_updateLength",Ne.prototype._updateLength);for(let r in uc)Object.defineProperty(this,r,uc[r]);this._renderer.type="points",this._renderer.flagVertices=ac.bind(this),this._renderer.bindVertices=lc.bind(this),this._renderer.unbindVertices=cc.bind(this),this._renderer.flagFill=dc.bind(this),this._renderer.flagStroke=hc.bind(this),this._renderer.vertices=null,this._renderer.collection=null,this.size=1,this.sizeAttenuation=!1,this.beginning=0,this.ending=1,this.fill="#fff",this.stroke="#000",this.linewidth=1,this.opacity=1,this.className="",this.visible=!0,this.vertices=n,this.dashes=[],this.dashes.offset=0}static fromObject(n){const r=typeof n.fill=="string"?n.fill:ei(n.fill),s=typeof n.stroke=="string"?n.stroke:ei(n.stroke),o=new sn().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 $e?this.vertices.push(n.vertices[r].clone()):this.vertices.push(new $e().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="points",n.vertices=this.vertices.map(r=>r.toObject()),Ae.each(sn.Properties,function(r){typeof this[r]<"u"&&(this[r].toObject?n[r]=this[r].toObject():n[r]=this[r])},this),n}subdivide(n){this._update();let r=[];for(let s=0;s<this.vertices.length;s++){const o=this.vertices[s],a=this.vertices[s-1];if(!a)continue;const l=o.x,c=o.y,d=a.x,h=a.y,u=ql(l,c,l,c,d,h,d,h,n);r=r.concat(u)}return this.vertices=r,this}_update(){if(this._flagVertices){this._flagLength&&this._updateLength(void 0,!0);const n=Math.min(this._beginning,this._ending),r=Math.max(this._beginning,this._ending),s=Ur(this,n*this._length),o=Ur(this,r*this._length),a=Nm(s),l=Pm(o);let c=0,d;this._renderer.vertices=[],this._renderer.collection=[];for(let h=0;h<this._collection.length;h++)h>=a&&h<=l&&(d=this._collection[h],this._renderer.collection.push(d),this._renderer.vertices[c*2+0]=d.x,this._renderer.vertices[c*2+1]=d.y,c++)}return super._update.apply(this,arguments),this}flagReset(){return this._flagVertices=this._flagLength=this._flagFill=this._flagStroke=this._flagLinewidth=this._flagOpacity=this._flagVisible=this._flagSize=this._flagSizeAttenuation=!1,super.flagReset.call(this),this}};k(sn,"Properties",["fill","stroke","linewidth","opacity","visible","size","sizeAttenuation","beginning","ending","dashes"]);let Kr=sn;const uc={linewidth:{enumerable:!0,get:function(){return this._linewidth},set:function(e){this._linewidth=e,this._flagLinewidth=!0}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(e){this._opacity=e,this._flagOpacity=!0}},visible:{enumerable:!0,get:function(){return this._visible},set:function(e){this._visible=e,this._flagVisible=!0}},size:{enumerable:!0,get:function(){return this._size},set:function(e){this._size=e,this._flagSize=!0}},sizeAttenuation:{enumerable:!0,get:function(){return this._sizeAttenuation},set:function(e){this._sizeAttenuation=e,this._flagSizeAttenuation=!0}},fill:{enumerable:!0,get:function(){return this._fill},set:function(e){(this._fill instanceof Je||this._fill instanceof _t||this._fill instanceof yt||this._fill instanceof nt)&&this._fill.unbind(K.Types.change,this._renderer.flagFill),this._fill=e,this._flagFill=!0,(this._fill instanceof Je||this._fill instanceof _t||this._fill instanceof yt||this._fill instanceof nt)&&this._fill.bind(K.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(e){(this._stroke instanceof Je||this._stroke instanceof _t||this._stroke instanceof yt||this._stroke instanceof nt)&&this._stroke.unbind(K.Types.change,this._renderer.flagStroke),this._stroke=e,this._flagStroke=!0,(this._stroke instanceof Je||this._stroke instanceof _t||this._stroke instanceof yt||this._stroke instanceof nt)&&this._stroke.bind(K.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(e){this._beginning=e,this._flagVertices=!0}},ending:{enumerable:!0,get:function(){return this._ending},set:function(e){this._ending=e,this._flagVertices=!0}},vertices:{enumerable:!0,get:function(){return this._collection},set:function(e){const t=this._renderer.bindVertices,n=this._renderer.unbindVertices;this._collection&&this._collection.unbind(K.Types.insert,t).unbind(K.Types.remove,n),e instanceof Ei?this._collection=e:this._collection=new Ei(e||[]),this._collection.bind(K.Types.insert,t).bind(K.Types.remove,n),t(this._collection)}},dashes:{enumerable:!0,get:function(){return this._dashes},set:function(e){typeof e.offset!="number"&&(e.offset=this.dashes&&this._dashes.offset||0),this._dashes=e}}};class fc extends Ei{constructor(n){n=Array.isArray(n)?n:Array.prototype.slice.call(arguments);super(n);ha(this,vs,{});this.attach(n),this.on(K.Types.insert,this.attach),this.on(K.Types.remove,this.detach)}get ids(){return kt(this,vs)}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}}vs=new WeakMap;const mn=class mn extends Ne{constructor(n,r,s,o,a,l,c){const d=c||Xs.Resolution*3,h=[];for(let u=0;u<d;u++)h.push(new $e);super(h,!0,!1,!0);k(this,"_flagStartAngle",!1);k(this,"_flagEndAngle",!1);k(this,"_flagInnerRadius",!1);k(this,"_flagOuterRadius",!1);k(this,"_startAngle",0);k(this,"_endAngle",Jn);k(this,"_innerRadius",0);k(this,"_outerRadius",0);this._renderer.type="arc-segment";for(let u in pc)Object.defineProperty(this,u,pc[u]);typeof s=="number"&&(this.innerRadius=s),typeof o=="number"&&(this.outerRadius=o),typeof a=="number"&&(this.startAngle=a),typeof l=="number"&&(this.endAngle=l),this._update(),typeof n=="number"&&(this.translation.x=n),typeof r=="number"&&(this.translation.y=r)}static fromObject(n){const r=new 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._flagStartAngle||this._flagEndAngle||this._flagInnerRadius||this._flagOuterRadius){const n=this._startAngle,r=this._endAngle,s=this._innerRadius,o=this._outerRadius,a=Ti(n,Jn)===Ti(r,Jn),l=s>0,c=this.vertices;let d=l?c.length/2:c.length,h,u=0,f,p,g,m,_,y,b,S,x;for(a?d--:l||(d-=2),f=0,p=d-1;f<d;f++){switch(g=f/p,m=c[u],_=g*(r-n)+n,y=(r-n)/d,b=o*Math.cos(_),S=o*Math.sin(_),f){case 0:h=fe.move;break;default:h=fe.curve}m.command=h,m.x=b,m.y=S,m.controls.left.clear(),m.controls.right.clear(),m.command===fe.curve&&(x=o*y/Math.PI,m.controls.left.x=x*Math.cos(_-tt),m.controls.left.y=x*Math.sin(_-tt),m.controls.right.x=x*Math.cos(_+tt),m.controls.right.y=x*Math.sin(_+tt),f===1&&m.controls.left.multiplyScalar(2),f===p&&m.controls.right.multiplyScalar(2)),u++}if(l){for(a?(c[u].command=fe.close,u++):(d--,p=d-1),f=0;f<d;f++)g=f/p,m=c[u],_=(1-g)*(r-n)+n,y=(r-n)/d,b=s*Math.cos(_),S=s*Math.sin(_),h=fe.curve,f<=0&&(h=a?fe.move:fe.line),m.command=h,m.x=b,m.y=S,m.controls.left.clear(),m.controls.right.clear(),m.command===fe.curve&&(x=s*y/Math.PI,m.controls.left.x=x*Math.cos(_+tt),m.controls.left.y=x*Math.sin(_+tt),m.controls.right.x=x*Math.cos(_-tt),m.controls.right.y=x*Math.sin(_-tt),f===1&&m.controls.left.multiplyScalar(2),f===p&&m.controls.right.multiplyScalar(2)),u++;c[u].copy(c[0]),c[u].command=fe.line}else a||(c[u].command=fe.line,c[u].x=0,c[u].y=0,u++,c[u].copy(c[0]),c[u].command=fe.line)}return super._update.call(this),this}flagReset(){return super.flagReset.call(this),this._flagStartAngle=this._flagEndAngle=this._flagInnerRadius=this._flagOuterRadius=!1,this}clone(n){const r=this.innerRadius,s=this.outerRadius,o=this.startAngle,a=this.endAngle,l=this.vertices.length,c=new mn(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<Ne.Properties.length;d++){const h=Ne.Properties[d];c[h]=this[h]}return n&&n.add(c),c}toObject(){const n=super.toObject.call(this);n.renderer.type="arc-segment";for(let r=0;r<mn.Properties.length;r++){const s=mn.Properties[r];n[s]=this[s]}return n}};k(mn,"Properties",["startAngle","endAngle","innerRadius","outerRadius"]);let Ys=mn;const pc={startAngle:{enumerable:!0,get:function(){return this._startAngle},set:function(e){this._startAngle=e,this._flagStartAngle=!0}},endAngle:{enumerable:!0,get:function(){return this._endAngle},set:function(e){this._endAngle=e,this._flagEndAngle=!0}},innerRadius:{enumerable:!0,get:function(){return this._innerRadius},set:function(e){this._innerRadius=e,this._flagInnerRadius=!0}},outerRadius:{enumerable:!0,get:function(){return this._outerRadius},set:function(e){this._outerRadius=e,this._flagOuterRadius=!0}}},Us=Math.cos,Gs=Math.sin,_n=class _n extends Ne{constructor(n,r,s,o){const a=o?Math.max(o,2):4,l=[];for(let c=0;c<a;c++)l.push(new $e(0,0,0,0,0,0));super(l,!0,!0,!0);k(this,"_flagRadius",!1);k(this,"_radius",0);this._renderer.type="circle";for(let c in gc)Object.defineProperty(this,c,gc[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 _n().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<_n.Properties.length;r++){const s=_n.Properties[r];s in n&&typeof n[s]=="number"&&(this[s]=n[s])}return this}_update(){if(this._flagVertices||this._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*Jn,d=s*Us(c),h=s*Gs(c),u=o*Us(c-tt),f=o*Gs(c-tt),p=o*Us(c+tt),g=o*Gs(c+tt),m=this.vertices[a];m.command=a===0?fe.move:fe.curve,m.set(d,h),m.controls.left.set(u,f),m.controls.right.set(p,g)}}return super._update.call(this),this}flagReset(){return this._flagRadius=!1,super.flagReset.call(this),this}clone(n){const r=new _n(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<Ne.Properties.length;s++){const o=Ne.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<_n.Properties.length;r++){const s=_n.Properties[r];n[s]=this[s]}return n}};k(_n,"Properties",["radius"]);let Ks=_n;const gc={radius:{enumerable:!0,get:function(){return this._radius},set:function(e){this._radius=e,this._flagRadius=!0}}},Zs=Math.cos,Js=Math.sin,yn=class yn extends Ne{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 $e);super(c,!0,!0,!0);k(this,"_flagWidth",!1);k(this,"_flagHeight",!1);k(this,"_width",0);k(this,"_height",0);this._renderer.type="ellipse";for(let d in mc)Object.defineProperty(this,d,mc[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 yn().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<yn.Properties.length;r++){const s=yn.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*Jn,d=s*Zs(c),h=o*Js(c),u=s*r*Zs(c-tt),f=o*r*Js(c-tt),p=s*r*Zs(c+tt),g=o*r*Js(c+tt),m=this.vertices[a];m.command=a===0?fe.move:fe.curve,m.set(d,h),m.controls.left.set(u,f),m.controls.right.set(p,g)}}return super._update.call(this),this}flagReset(){return this._flagWidth=this._flagHeight=!1,super.flagReset.call(this),this}clone(n){const r=this.width/2,s=this.height/2,o=this.vertices.length,a=new yn(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<Ne.Properties.length;l++){const c=Ne.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<yn.Properties.length;r++){const s=yn.Properties[r];n[s]=this[s]}return n}};k(yn,"Properties",["width","height"]);let Qs=yn;const mc={width:{enumerable:!0,get:function(){return this._width},set:function(e){this._width=e,this._flagWidth=!0}},height:{enumerable:!0,get:function(){return this._height},set:function(e){this._height=e,this._flagHeight=!0}}},Rm=Math.cos,Fm=Math.sin,bn=class bn extends Ne{constructor(n,r,s,o){o=Math.max(o||0,3);super();k(this,"_flagWidth",!1);k(this,"_flagHeight",!1);k(this,"_flagSides",!1);k(this,"_radius",0);k(this,"_width",0);k(this,"_height",0);k(this,"_sides",0);this._renderer.type="polygon";for(let a in _c)Object.defineProperty(this,a,_c[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 bn().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<bn.Properties.length;r++){const s=bn.Properties[r];s in n&&typeof n[s]=="number"&&(this[s]=n[s])}return this}_update(){if(this._flagVertices||this._flagWidth||this._flagHeight||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=Jn*a+Math.PI/2,c=this._width*Rm(l)/2,d=this._height*Fm(l)/2;o>=s?this.vertices.push(new $e(c,d)):this.vertices[o].set(c,d),this.vertices[o].command=o===0?fe.move:fe.line}}return super._update.call(this),this}flagReset(){return this._flagWidth=this._flagHeight=this._flagSides=!1,super.flagReset.call(this),this}clone(n){const r=new bn(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<Ne.Properties.length;s++){const o=Ne.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<bn.Properties.length;r++){const s=bn.Properties[r];n[s]=this[s]}return n}};k(bn,"Properties",["width","height","sides"]);let eo=bn;const _c={radius:{enumerable:!0,get:function(){return this._radius},set:function(e){this._radius=e,this.width=e*2,this.height=e*2}},width:{enumerable:!0,get:function(){return this._width},set:function(e){this._width=e,this._flagWidth=!0,this._radius=Math.max(this.width,this.height)/2}},height:{enumerable:!0,get:function(){return this._height},set:function(e){this._height=e,this._flagHeight=!0,this._radius=Math.max(this.width,this.height)/2}},sides:{enumerable:!0,get:function(){return this._sides},set:function(e){this._sides=e,this._flagSides=!0}}},gi=class gi extends Ne{constructor(n,r,s,o){const a=[new $e,new $e,new $e,new $e];super(a,!0,!1,!0);k(this,"_flagWidth",0);k(this,"_flagHeight",0);k(this,"_width",0);k(this,"_height",0);k(this,"_origin",null);this._renderer.type="rectangle";for(let l in yc)Object.defineProperty(this,l,yc[l]);this.width=typeof s=="number"?s:1,this.height=typeof o=="number"?o:1,this.origin=new we,typeof n=="number"&&(this.translation.x=n),typeof r=="number"&&(this.translation.y=r),this._update()}static fromObject(n){const r=new gi().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<gi.Properties.length;r++){const s=gi.Properties[r];s in n&&typeof n[s]=="number"&&(this[s]=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 $e),this.vertices[0].set(-n,-r).sub(this._origin).command=fe.move,this.vertices[1].set(n,-r).sub(this._origin).command=fe.line,this.vertices[2].set(n,r).sub(this._origin).command=fe.line,this.vertices[3].set(-n,r).sub(this._origin).command=fe.line,this.vertices[4]&&(this.vertices[4].set(-n,-r).sub(this._origin).command=fe.line)}return super._update.call(this),this}flagReset(){return this._flagWidth=this._flagHeight=!1,super.flagReset.call(this),this}clone(n){const r=new gi(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<Ne.Properties.length;s++){const o=Ne.Properties[s];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}};k(gi,"Properties",["width","height"]);let to=gi;const yc={width:{enumerable:!0,get:function(){return this._width},set:function(e){this._width=e,this._flagWidth=!0}},height:{enumerable:!0,get:function(){return this._height},set:function(e){this._height=e,this._flagHeight=!0}},origin:{enumerable:!0,get:function(){return this._origin},set:function(e){this._origin&&this._origin.unbind(K.Types.change,this._renderer.flagVertices),this._origin=e,this._origin.bind(K.Types.change,this._renderer.flagVertices),this._renderer.flagVertices()}}},wn=class wn extends Ne{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 $e(0,0,0,0,0,0,c===0?fe.move:fe.curve));super(l);k(this,"_flagWidth",!1);k(this,"_flagHeight",!1);k(this,"_flagRadius",!1);k(this,"_width",0);k(this,"_height",0);k(this,"_radius",12);this._renderer.type="rounded-rectangle";for(let c in bc)Object.defineProperty(this,c,bc[c]);this.closed=!0,this.automatic=!1,this._renderer.flagRadius=Mm.bind(this),typeof s=="number"&&(this.width=s),typeof o=="number"&&(this.height=o),typeof a=="number"&&(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 wn().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<wn.Properties.length;r++){const s=wn.Properties[r];if(s in n){const o=n[s];/radius/i.test(s)?this[s]=typeof o=="number"||o instanceof we?o:new we().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 we?(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 wn(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<Ne.Properties.length;l++){const c=Ne.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<wn.Properties.length;r++){const s=wn.Properties[r];n[s]=this[s]}return n.radius=typeof this.radius=="number"?this.radius:this.radius.toObject(),n}};k(wn,"Properties",["width","height","radius"]);let no=wn;const bc={width:{enumerable:!0,get:function(){return this._width},set:function(e){this._width=e,this._flagWidth=!0}},height:{enumerable:!0,get:function(){return this._height},set:function(e){this._height=e,this._flagHeight=!0}},radius:{enumerable:!0,get:function(){return this._radius},set:function(e){this._radius instanceof we&&this._radius.unbind(K.Types.change,this._renderer.flagRadius),this._radius=e,this._radius instanceof we&&this._radius.bind(K.Types.change,this._renderer.flagRadius),this._flagRadius=!0}}};function Mm(){this._flagRadius=!0}const Am=Math.cos,Om=Math.sin,vn=class vn extends Ne{constructor(n,r,s,o,a){arguments.length<=3&&(o=s,s=o/2),(typeof a!="number"||a<=0)&&(a=5);super();k(this,"_flagInnerRadius",!1);k(this,"_flagOuterRadius",!1);k(this,"_flagSides",!1);k(this,"_innerRadius",0);k(this,"_outerRadius",0);k(this,"_sides",0);this._renderer.type="star";for(let l in wc)Object.defineProperty(this,l,wc[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 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._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=Jn*a,c=(o%2?this._outerRadius:this._innerRadius)/2,d=c*Am(l),h=c*Om(l);o>=s?this.vertices.push(new $e(d,h)):this.vertices[o].set(d,h),this.vertices[o].command=o===0?fe.move:fe.line}}return super._update.call(this),this}flagReset(){return this._flagInnerRadius=this._flagOuterRadius=this._flagSides=!1,super.flagReset.call(this),this}clone(n){const r=this.innerRadius,s=this.outerRadius,o=this.sides,a=new vn(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<Ne.Properties.length;l++){const c=Ne.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<vn.Properties.length;r++){const s=vn.Properties[r];n[s]=this[s]}return n}};k(vn,"Properties",["innerRadius","outerRadius","sides"]);let io=vn;const wc={innerRadius:{enumerable:!0,get:function(){return this._innerRadius},set:function(e){this._innerRadius=e,this._flagInnerRadius=!0}},outerRadius:{enumerable:!0,get:function(){return this._outerRadius},set:function(e){this._outerRadius=e,this._flagOuterRadius=!0}},sides:{enumerable:!0,get:function(){return this._sides},set:function(e){this._sides=e,this._flagSides=!0}}};let ro;const vc=Math.min,kc=Math.max;Kt.document&&(ro=document.createElement("canvas"));const ft=class ft extends hn{constructor(n,r,s,o){super();k(this,"_flagValue",!0);k(this,"_flagFamily",!0);k(this,"_flagSize",!0);k(this,"_flagLeading",!0);k(this,"_flagAlignment",!0);k(this,"_flagBaseline",!0);k(this,"_flagStyle",!0);k(this,"_flagWeight",!0);k(this,"_flagDecoration",!0);k(this,"_flagFill",!0);k(this,"_flagStroke",!0);k(this,"_flagLinewidth",!0);k(this,"_flagOpacity",!0);k(this,"_flagVisible",!0);k(this,"_flagMask",!1);k(this,"_flagClip",!1);k(this,"_flagDirection",!0);k(this,"_value","");k(this,"_family","sans-serif");k(this,"_size",13);k(this,"_leading",17);k(this,"_alignment","center");k(this,"_baseline","middle");k(this,"_style","normal");k(this,"_weight",500);k(this,"_decoration","none");k(this,"_direction","ltr");k(this,"_fill","#000");k(this,"_stroke","none");k(this,"_linewidth",1);k(this,"_opacity",1);k(this,"_visible",!0);k(this,"_mask",null);k(this,"_clip",!1);k(this,"_dashes",null);for(let a in xc)Object.defineProperty(this,a,xc[a]);if(this._renderer.type="text",this._renderer.flagFill=Vm.bind(this),this._renderer.flagStroke=zm.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,!Ae.isObject(o))return this;for(let a=0;a<ft.Properties.length;a++){const l=ft.Properties[a];l in o&&(this[l]=o[l])}}static Measure(n){if(ro){const r=ro.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*ft.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:ei(n.fill),s=typeof n.stroke=="string"?n.stroke:ei(n.stroke),o=new ft().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<ft.Properties.length;r++){const s=ft.Properties[r];s in n&&(this[s]=n[s])}return this}clone(n){const r=new ft(this.value);r.translation.copy(this.translation),r.rotation=this.rotation,r.scale=this.scale;for(let s=0;s<ft.Properties.length;s++){const o=ft.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<ft.Properties.length;r++){const s=ft.Properties[r];n[s]=this[s]}return n}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}=ft.Measure(this),h=(this._linewidth||0)/2;switch(this.alignment){case"left":s=-h,o=c+h;break;case"right":s=-(c+h),o=h;break;default:s=-(c/2+h),o=c/2+h}switch(this.baseline){case"middle":a=-(d/2+h),l=d/2+h;break;default:a=-(d+h),l=h}const[u,f]=r.multiply(s,a),[p,g]=r.multiply(s,l),[m,_]=r.multiply(o,a),[y,b]=r.multiply(o,l);return a=vc(f,g,_,b),s=vc(u,p,m,y),o=kc(u,p,m,y),l=kc(f,g,_,b),{top:a,left:s,right:o,bottom:l,width:o-s,height:l-a}}flagReset(){return super.flagReset.call(this),this._flagValue=this._flagFamily=this._flagSize=this._flagLeading=this._flagAlignment=this._flagFill=this._flagStroke=this._flagLinewidth=this._flagOpacity=this._flagVisible=this._flagClip=this._flagDecoration=this._flagClassName=this._flagBaseline=this._flagWeight=this._flagStyle=this._flagDirection=!1,this}};k(ft,"Ratio",.6),k(ft,"Properties",["value","family","size","leading","alignment","linewidth","style","weight","decoration","direction","baseline","opacity","visible","fill","stroke","dashes"]);let Pi=ft;const xc={value:{enumerable:!0,get:function(){return this._value},set:function(e){this._value=e,this._flagValue=!0}},family:{enumerable:!0,get:function(){return this._family},set:function(e){this._family=e,this._flagFamily=!0}},size:{enumerable:!0,get:function(){return this._size},set:function(e){this._size=e,this._flagSize=!0}},leading:{enumerable:!0,get:function(){return this._leading},set:function(e){this._leading=e,this._flagLeading=!0}},alignment:{enumerable:!0,get:function(){return this._alignment},set:function(e){this._alignment=e,this._flagAlignment=!0}},linewidth:{enumerable:!0,get:function(){return this._linewidth},set:function(e){this._linewidth=e,this._flagLinewidth=!0}},style:{enumerable:!0,get:function(){return this._style},set:function(e){this._style=e,this._flagStyle=!0}},weight:{enumerable:!0,get:function(){return this._weight},set:function(e){this._weight=e,this._flagWeight=!0}},decoration:{enumerable:!0,get:function(){return this._decoration},set:function(e){this._decoration=e,this._flagDecoration=!0}},direction:{enumerable:!0,get:function(){return this._direction},set:function(e){this._direction=e,this._flagDirection=!0}},baseline:{enumerable:!0,get:function(){return this._baseline},set:function(e){this._baseline=e,this._flagBaseline=!0}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(e){this._opacity=e,this._flagOpacity=!0}},visible:{enumerable:!0,get:function(){return this._visible},set:function(e){this._visible=e,this._flagVisible=!0}},fill:{enumerable:!0,get:function(){return this._fill},set:function(e){(this._fill instanceof Je||this._fill instanceof _t||this._fill instanceof yt||this._fill instanceof nt)&&this._fill.unbind(K.Types.change,this._renderer.flagFill),this._fill=e,this._flagFill=!0,(this._fill instanceof Je||this._fill instanceof _t||this._fill instanceof yt||this._fill instanceof nt)&&this._fill.bind(K.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(e){(this._stroke instanceof Je||this._stroke instanceof _t||this._stroke instanceof yt||this._stroke instanceof nt)&&this._stroke.unbind(K.Types.change,this._renderer.flagStroke),this._stroke=e,this._flagStroke=!0,(this._stroke instanceof Je||this._stroke instanceof _t||this._stroke instanceof yt||this._stroke instanceof nt)&&this._stroke.bind(K.Types.change,this._renderer.flagStroke)}},mask:{enumerable:!0,get:function(){return this._mask},set:function(e){this._mask=e,this._flagMask=!0,Ae.isObject(e)&&!e.clip&&(e.clip=!0)}},clip:{enumerable:!0,get:function(){return this._clip},set:function(e){this._clip=e,this._flagClip=!0}},dashes:{enumerable:!0,get:function(){return this._dashes},set:function(e){typeof e.offset!="number"&&(e.offset=this.dashes&&this._dashes.offset||0),this._dashes=e}}};function Vm(){this._flagFill=!0}function zm(){this._flagStroke=!0}const Zr=Math.min,Jr=Math.max,kn=class kn extends hn{constructor(n){super();k(this,"_flagAdditions",!1);k(this,"_flagSubtractions",!1);k(this,"_flagOrder",!1);k(this,"_flagOpacity",!0);k(this,"_flagBeginning",!1);k(this,"_flagEnding",!1);k(this,"_flagLength",!1);k(this,"_flagMask",!1);k(this,"_fill","#fff");k(this,"_stroke","#000");k(this,"_linewidth",1);k(this,"_opacity",1);k(this,"_visible",!0);k(this,"_cap","round");k(this,"_join","round");k(this,"_miter",4);k(this,"_closed",!0);k(this,"_curved",!1);k(this,"_automatic",!0);k(this,"_beginning",0);k(this,"_ending",1);k(this,"_length",0);k(this,"_mask",null);for(let r in Cc)Object.defineProperty(this,r,Cc[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++)Sc.call(this,n[r],this)}static RemoveChildren(n){for(let r=0;r<n.length;r++)Sc.call(this,n[r])}static OrderChildren(n){this._flagOrder=!0}static fromObject(n){const r=new kn;for(let o=0;o<kn.Properties.length;o++){const a=kn.Properties[o];a in n&&(/(fill|stroke)/i.test(a)?r[a]=typeof n[a]=="string"?n[a]:ei(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 Ys.fromObject(o);case"circle":return Ks.fromObject(o);case"ellipse":return Qs.fromObject(o);case"points":return Kr.fromObject(o);case"polygon":return eo.fromObject(o);case"rectangle":return to.fromObject(o);case"rounded-rectangle":return no.fromObject(o);case"star":return io.fromObject(o);case"path":return Ne.fromObject(o);case"text":return Pi.fromObject(o);case"group":return kn.fromObject(o);case"shape":return hn.fromObject(o);case"element":return ir.fromObject(o)}return o}}copy(n){return super.copy.call(this,n),console.warn("Two.Group.copy is not supported yet."),this}clone(n){const r=new kn,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,Ae.each(this.children,(r,s)=>{n.children[s]=r.toObject()},this),n}corner(){const n=this.getBoundingClientRect(!0);for(let r=0;r<this.children.length;r++){const s=this.children[r];s.translation.x-=n.left,s.translation.y-=n.top}return this.mask&&(this.mask.translation.x-=n.left,this.mask.translation.y-=n.top),this}center(){const n=this.getBoundingClientRect(!0),r=n.left+n.width/2-this.translation.x,s=n.top+n.height/2-this.translation.y;for(let o=0;o<this.children.length;o++){const a=this.children[o];a.isShape&&(a.translation.x-=r,a.translation.y-=s)}return this.mask&&(this.mask.translation.x-=r,this.mask.translation.y-=s),this}getById(n){let r=null;function s(o){if(o.id===n)return o;if(o.children){if(o.children.ids[n])return o.children.ids[n];for(let a=0;a<o.children.length;a++)if(r=s(o.children[a]),r)return r}return null}return s(this)}getByClassName(n){const r=[];function s(o){if(Array.prototype.indexOf.call(o.classList,n)>=0&&r.push(o),o.children)for(let a=0;a<o.children.length;a++){const l=o.children[a];s(l)}return r}return s(this)}getByType(n){const r=[];function s(o){if(o instanceof n&&r.push(o),o.children)for(let a=0;a<o.children.length;a++){const l=o.children[a];s(l)}return r}return s(this)}add(n){n instanceof Array?n=n.slice():n=Array.prototype.slice.call(arguments);for(let r=0;r<n.length;r++){const s=n[r];if(!(s&&s.id))continue;const o=Array.prototype.indexOf.call(this.children,s);o>=0&&this.children.splice(o,1),this.children.push(s)}return this}remove(n){const r=arguments.length,s=this.parent;if(r<=0&&s)return s.remove(this),this;n instanceof Array?n=n.slice():n=Array.prototype.slice.call(arguments);for(let o=0;o<n.length;o++){const a=n[o];if(!a||!this.children.ids[a.id])continue;const l=this.children.indexOf(a);l>=0&&this.children.splice(l,1)}return this}getBoundingClientRect(n){let r,s,o,a,l,c;this._update(!0);let d=1/0,h=-1/0,u=1/0,f=-1/0;const p=/texture|gradient/i;s=n?this.matrix:this.worldMatrix;for(let g=0;g<this.children.length;g++){const m=this.children[g];if(!(!m.visible||p.test(m._renderer.type))&&(r=m.getBoundingClientRect(n),o=typeof r.top!="number"||Ae.isNaN(r.top)||!isFinite(r.top),a=typeof r.left!="number"||Ae.isNaN(r.left)||!isFinite(r.left),l=typeof r.right!="number"||Ae.isNaN(r.right)||!isFinite(r.right),c=typeof r.bottom!="number"||Ae.isNaN(r.bottom)||!isFinite(r.bottom),!(o||a||l||c)))if(n){const[_,y]=s.multiply(r.left,r.top),[b,S]=s.multiply(r.right,r.top),[x,C]=s.multiply(r.left,r.bottom),[B,v]=s.multiply(r.right,r.bottom);u=Zr(y,S,C,v,u),d=Zr(_,b,x,B,d),h=Jr(_,b,x,B,h),f=Jr(y,S,C,v,f)}else u=Zr(r.top,u),d=Zr(r.left,d),h=Jr(r.right,h),f=Jr(r.bottom,f)}return{top:u,left:d,right:h,bottom:f,width:h-d,height:f-u}}noFill(){return this.children.forEach(function(n){n.noFill()}),this}noStroke(){return this.children.forEach(function(n){n.noStroke()}),this}subdivide(){const n=arguments;return this.children.forEach(function(r){r.subdivide.apply(r,n)}),this}_update(){let n,r,s;if(this._flagBeginning||this._flagEnding){const o=Math.min(this._beginning,this._ending),a=Math.max(this._beginning,this._ending),l=this.length;let c=0;const d=o*l,h=a*l;for(n=0;n<this.children.length;n++)s=this.children[n],r=s.length,d>c+r?(s.beginning=1,s.ending=1):h<c?(s.beginning=0,s.ending=0):d>c&&d<c+r?(s.beginning=(d-c)/r,s.ending=1):h>c&&h<c+r?(s.beginning=0,s.ending=(h-c)/r):(s.beginning=0,s.ending=1),c+=r}return super._update.apply(this,arguments)}flagReset(){return this._flagAdditions&&(this.additions.length=0,this._flagAdditions=!1),this._flagSubtractions&&(this.subtractions.length=0,this._flagSubtractions=!1),this._flagOrder=this._flagMask=this._flagOpacity=this._flagBeginning=this._flagEnding=!1,super.flagReset.call(this),this}};k(kn,"Children",fc),k(kn,"Properties",["fill","stroke","linewidth","cap","join","miter","closed","curved","automatic"]);let un=kn;const Cc={visible:{enumerable:!0,get:function(){return this._visible},set:function(e){this._flagVisible=this._visible!==e||this._flagVisible,this._visible=e}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(e){this._flagOpacity=this._opacity!==e||this._flagOpacity,this._opacity=e}},beginning:{enumerable:!0,get:function(){return this._beginning},set:function(e){this._flagBeginning=this._beginning!==e||this._flagBeginning,this._beginning=e}},ending:{enumerable:!0,get:function(){return this._ending},set:function(e){this._flagEnding=this._ending!==e||this._flagEnding,this._ending=e}},length:{enumerable:!0,get:function(){if(this._flagLength||this._length<=0){if(this._length=0,!this.children)return this._length;for(let e=0;e<this.children.length;e++){const t=this.children[e];this._length+=t.length}}return this._length}},fill:{enumerable:!0,get:function(){return this._fill},set:function(e){this._fill=e;for(let t=0;t<this.children.length;t++){const n=this.children[t];n.fill=e}}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(e){this._stroke=e;for(let t=0;t<this.children.length;t++){const n=this.children[t];n.stroke=e}}},linewidth:{enumerable:!0,get:function(){return this._linewidth},set:function(e){this._linewidth=e;for(let t=0;t<this.children.length;t++){const n=this.children[t];n.linewidth=e}}},join:{enumerable:!0,get:function(){return this._join},set:function(e){this._join=e;for(let t=0;t<this.children.length;t++){const n=this.children[t];n.join=e}}},miter:{enumerable:!0,get:function(){return this._miter},set:function(e){this._miter=e;for(let t=0;t<this.children.length;t++){const n=this.children[t];n.miter=e}}},cap:{enumerable:!0,get:function(){return this._cap},set:function(e){this._cap=e;for(let t=0;t<this.children.length;t++){const n=this.children[t];n.cap=e}}},closed:{enumerable:!0,get:function(){return this._closed},set:function(e){this._closed=e;for(let t=0;t<this.children.length;t++){const n=this.children[t];n.closed=e}}},curved:{enumerable:!0,get:function(){return this._curved},set:function(e){this._curved=e;for(let t=0;t<this.children.length;t++){const n=this.children[t];n.curved=e}}},automatic:{enumerable:!0,get:function(){return this._automatic},set:function(e){this._automatic=e;for(let t=0;t<this.children.length;t++){const n=this.children[t];n.automatic=e}}},children:{enumerable:!0,get:function(){return this._children},set:function(e){const t=un.InsertChildren.bind(this),n=un.RemoveChildren.bind(this),r=un.OrderChildren.bind(this);this._children&&(this._children.unbind(),this._children.length>0&&n(this._children)),this._children=new fc(e),this._children.bind(K.Types.insert,t),this._children.bind(K.Types.remove,n),this._children.bind(K.Types.order,r),e.length>0&&t(e)}},mask:{enumerable:!0,get:function(){return this._mask},set:function(e){this._mask=e,this._flagMask=!0,Ae.isObject(e)&&!e.clip&&(e.clip=!0)}}};function Sc(e,t){const n=e.parent;let r;if(n===t){s();return}if(n&&n.children.ids[e.id]&&(r=Array.prototype.indexOf.call(n.children,e),n.children.splice(r,1),o()),t){s();return}o(),n._flagAdditions&&n.additions.length===0&&(n._flagAdditions=!1),n._flagSubtractions&&n.subtractions.length===0&&(n._flagSubtractions=!1),delete e.parent;function s(){t.subtractions.length>0&&(r=Array.prototype.indexOf.call(t.subtractions,e),r>=0&&t.subtractions.splice(r,1)),t.additions.length>0&&(r=Array.prototype.indexOf.call(t.additions,e),r>=0&&t.additions.splice(r,1)),e.parent=t,t.additions.push(e),t._flagAdditions=!0}function o(){r=Array.prototype.indexOf.call(n.additions,e),r>=0&&n.additions.splice(r,1),r=Array.prototype.indexOf.call(n.subtractions,e),r<0&&(n.subtractions.push(e),n._flagSubtractions=!0)}}class so extends Ne{constructor(t,n,r,s){const o=[new $e(t,n),new $e(r,s)];super(o);for(let a in Bc)Object.defineProperty(this,a,Bc[a]);this.vertices[0].command=fe.move,this.vertices[1].command=fe.line,this.automatic=!1}}const Bc={left:{enumerable:!0,get:function(){return this.vertices[0]},set:function(e){if(Ae.isObject(e))this.vertices.splice(0,1,e);else{const t=new qr("Two.Line.x argument is not an object.");console.warn(t.name,t.message)}}},right:{enumerable:!0,get:function(){return this.vertices[1]},set:function(e){if(Ae.isObject(e))this.vertices.splice(1,1,e);else{const t=new qr("Two.Line.y argument is not an object.");console.warn(t.name,t.message)}}}};class oo{constructor(t=0,n=0){this.x=t,this.y=n}}class ti{constructor(t=10,n=0,r="A"){k(this,"start",new oo);k(this,"end",new oo);this.width=t,this.angle=n,this.label=r}}const ze={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"}},Im={class:"flex gap-3"},Lm={class:"kozyrek-preview w-fill h-[12.5rem] grow touch-none overflow-hidden rounded-lg bg-gray-200 p-2"},Dm={ref:"drawing-container",class:"size-full"},Hm={},Tc=i.defineComponent({...Hm,__name:"kozyrek-configurator-preview",props:{settings:{},value:{},selectTemplateIndex:{}},emits:["pointer:move","pointer:up","template:select"],setup(e,{emit:t}){const n=e,r=t,s=i.useTemplateRef("drawing-container");let o=[],a=[],l=[],c=null;const d=.75,h=i.computed(()=>n.value.configuratorParams.linesAngles.map((P,E)=>new ti(n.value.configuratorParams.linesWidths[E],P,`A-${E+1}`))),u=i.computed(()=>n.value.configuratorParams.colorSide==="bottom"),f=i.computed(()=>{var P,E;return n.value.configuratorParams.startTailType&&((P=n.settings.startTailConfigs)!=null&&P[n.value.configuratorParams.startTailType])?(E=n.settings.startTailConfigs)==null?void 0:E[n.value.configuratorParams.startTailType].points:[]}),p=i.computed(()=>{var P,E;return n.value.configuratorParams.endTailType&&((P=n.settings.endTailConfigs)!=null&&P[n.value.configuratorParams.endTailType])?(E=n.settings.endTailConfigs)==null?void 0:E[n.value.configuratorParams.endTailType].points:[]}),g=(P,E=!1)=>{P[0].start.x=0,P[0].start.y=0;let H=0;for(let I=0;I<P.length;I++){const G=P[I],O=P[I-1]??new ti(0,H);H+=!E||I>1?O.angle:0;const z=(!E||I>0?G.angle:0)+H;if(P[I].end.x=G.width*Math.cos(z*Math.PI/180)+P[I].start.x,P[I].end.y=G.width*Math.sin(z*Math.PI/180)+P[I].start.y,I<P.length-1){const J=I+1;P[J].start.x=P[I].end.x,P[J].start.y=P[I].end.y}}return P},m=(P,E,H,I,G=!1)=>{let O=g([...H,...I]);E.length>0&&(O=[...g(E),...O]);let z=0,J=0,pe=0,re=0;O.forEach(xe=>{z=Math.min(z,xe.start.x,xe.end.x),J=Math.min(J,xe.start.y,xe.end.y),pe=Math.max(pe,xe.start.x,xe.end.x),re=Math.max(re,xe.start.y,xe.end.y)});let ge,ie;z===0&&J===0&&pe===0&&re===0?(ge=1,ie=1):(ge=P.width/Math.abs(pe-z),ie=(G?P.height:P.height-ze.colorSideLabel.size)/Math.abs(re-J));const Me=Math.min(ge,ie);return z=z<0?-z*Me:0,J=J<0?-J*Me:0,[Me,z,J]},_=P=>{const E=new Kr([P]);return E._size=ze.anchorPoint.size,E.fill=ze.anchorPoint.color,E.stroke="transparent",E._linewidth=ze.anchorPoint.strokeSize,l.push(E),E},y=(P,E)=>{if(l=[],n.settings.allowChangeFirstPoint){const H=P[0],I=new we(H.vertices[0].x,H.vertices[0].y);I.bind(K.Types.change,()=>{H.vertices[0].copy(I)});const G=_(I);E.add(G)}P.forEach((H,I)=>{const G=P[I+1],O=new we(H.vertices[1].x,H.vertices[1].y);O.bind(K.Types.change,()=>{H.vertices[1].copy(O),G!==void 0&&G.vertices[0].copy(O)});const z=_(O);E.add(z)})},b=P=>P*(Math.PI/180),S=(P,E,H)=>{const I=E.vertices.length-1;P.position.x=E.vertices[I].x,P.position.y=E.vertices[I].y;const G=Math.atan2(E.vertices[I].y-E.vertices[0].y,E.vertices[I].x-E.vertices[0].x);P.rotation=b(H)+G},x=(P,E,H)=>{if(E.vertices[0]===void 0)return;P.position.x=E.vertices[0].x,P.position.y=E.vertices[0].y;const I=E.vertices.length-1,G=Math.atan2(E.vertices[I].y-E.vertices[0].y,E.vertices[I].x-E.vertices[0].x);P.rotation=b(H)+G},C=(P,E,H)=>{const I=new un;if(P.length===0)return I;const G=[];return[...P].reverse().forEach((O,z)=>{z!==0&&O.angle>0&&(O.angle*=-1),G.push(O)}),P=g(G,!0),x(I,E,P[0].angle),[E.vertices[0],E.vertices[1]].forEach(O=>{O.bind(K.Types.change,()=>{x(I,E,P[0].angle)})}),P.forEach(O=>{const z=O.start.x*H,J=O.end.x*H,pe=O.start.y*H,re=O.end.y*H,ge=new so(z,pe,J,re);ge.linewidth=ze.line.size,ge.stroke=ze.line.color,I.add(ge)}),I},B=(P,E,H)=>{const I=new un;return P.length===0||(P=g(P,!0),S(I,E,P[0].angle),[E.vertices[0],E.vertices[1]].forEach(G=>{G.bind(K.Types.change,()=>{S(I,E,P[0].angle)})}),P.forEach(G=>{const O=G.start.x*H,z=G.end.x*H,J=G.start.y*H,pe=G.end.y*H,re=new so(O,J,z,pe);re.linewidth=ze.line.size,re.stroke=ze.line.color,I.add(re)})),I},v=(P,E,H,I)=>{const G=E.vertices[0].x+(E.vertices[1].x-E.vertices[0].x)/2-8*Math.sin(P.angle*Math.PI/180),O=E.vertices[0].y+(E.vertices[1].y-E.vertices[0].y)/2-8*Math.cos(P.angle*Math.PI/180),z=new Pi(P.label,G+10,O-10);let J;z.size=ze.lineLabel.size,z.weight=600,z.fill=ze.lineLabel.color,z.id+=1,z.rotation=ze.lineLabel.rotation,I>0&&(J=new Pi(`${P.angle}°`,E.vertices[0].x+25,E.vertices[0].y-25),J.size=ze.angleLabel.size,J.weight=600,J.fill=ze.angleLabel.color,J.rotation=ze.angleLabel.rotation,J.id+=I,o.push(J),H.add(J)),H.add(z),F(z,E,0,J),F(z,E,1)},$=()=>{const{size:P}=ze.colorSideLabel,E=0,H=0,I=u.value?P/2:P/2-P,G=u.value?P/2-P:P/2,O=new un;if(!c)return O;const z=5,J=Math.atan2(G-I,H-E),pe=[new $e(E,I,0,0,0,0,he.Commands.move),new $e(H,G,0,0,0,0,he.Commands.line),new $e(H-z*Math.cos(J-Math.PI/4),G-z*Math.sin(J-Math.PI/4),0,0,0,0,he.Commands.line),new $e(H,G,0,0,0,0,he.Commands.move),new $e(H-z*Math.cos(J+Math.PI/4),G-z*Math.sin(J+Math.PI/4),0,0,0,0,he.Commands.line)],re=new Ne(pe,!1,!1,!0);re.noFill(),re.cap="round",re.join="round",re.linewidth=P/7,re.stroke=ze.colorSideLabel.color,O.add(re);const ge=new Pi(u.value?"Цвет снизу":"Цвет сверху",10,0);ge.size=P,ge.weight=600,ge.fill=ze.colorSideLabel.color,ge.alignment="left",O.add(ge);const ie=O.getBoundingClientRect();return O.position.x=(c.width-ie.width)*d+10,O.position.y=u.value?c.height+ie.height*2:ie.height/2,O},F=(P,E,H,I)=>{E.vertices[H].bind(K.Types.change,()=>{const G=E.vertices.length-1,O=Math.atan2(E.vertices[0].y-E.vertices[G].y,E.vertices[0].x-E.vertices[G].x)*180/Math.PI,z=E.vertices[0].x+(E.vertices[G].x-E.vertices[0].x)/2-8*Math.sin(O*Math.PI/180),J=E.vertices[0].y+(E.vertices[G].y-E.vertices[0].y)/2-8*Math.cos(O*Math.PI/180);P.position.x=z+10,P.position.y=J-10,P.rotation=-.5,I&&(I.position.x=E.vertices[0].x+25,I.position.y=E.vertices[0].y-25)})},R=(P,E,H,I,G=!1)=>{var Ce;if(P.clear(),H.length===0){P.update();return}const O=g(H),[z,J,pe]=m(P,E,O,I,G),re=new un,ge=new Array,ie=new Array;G||(o=[],a=[]),O.forEach((Fe,Ie)=>{const vt=Fe.start.x*z+J,xn=Fe.end.x*z+J,Mt=Fe.start.y*z+pe,Xt=Fe.end.y*z+pe,Tt=new so(vt,Mt,xn,Xt);Tt.linewidth=G?ze.previewLine.size:ze.line.size,Tt.stroke=G?ze.previewLine.color:ze.line.color,a.push(Tt),ge.push(Tt),re.add(Tt),!G&&Fe.label!==""&&v(Fe,Tt,re,Ie)});const Me=ge.at(-1);let xe=re.getBoundingClientRect();if(!G){const Fe=$();ie.push(Fe)}if(E.length>0){const Fe=C(E,ge[0],z);re.add(Fe)}if(I.length>0&&Me){const Fe=B(I,Me,z);re.add(Fe)}if(ie.push(re),P.makeGroup(ie),xe=re.getBoundingClientRect(),re.position.x=0-xe.left+(P.width-xe.width)/(2*(G?1:d)),re.position.y=0-xe.top+(P.height-xe.height)/(2*(G?1:d)),P.update(),!G){const Fe=((Ce=n.value.configuratorParams)==null?void 0:Ce.colorSide)==="top";re.position.y=re.position.y+ze.colorSideLabel.size*Number(Fe),y(ge,re),P.update()}},X=(P,E)=>{if(P&&!E.isNewRec()){const H=new he({width:P.scrollWidth,height:P.scrollHeight});H.appendTo(P),R(H,[],E.points,[],!0)}},M=()=>{c&&R(c,f.value,h.value,p.value,!1)},N=P=>P*(180/Math.PI),A=(P,E)=>{const H=P[1].x-P[0].x,I=P[1].y-P[0].y,G=E[1].x-E[0].x,O=E[1].y-E[0].y;let z=Math.atan2(H*O-I*G,H*G+I*O);return z=N(z),Math.round(z)*-1},L=P=>{const E=a.map((H,I,G)=>{const O=G[I-1]??{vertices:[{x:-10,y:0},{x:0,y:0}]};let z=Math.ceil(H._length/P/n.settings.lineWidthStep)*n.settings.lineWidthStep;const J=o[I-1];z<(G.length>1?n.settings.minLineWidth:n.settings.stripMinWidth)&&(z=G.length>1?n.settings.minLineWidth:n.settings.stripMinWidth),z>n.settings.maxLineWidth&&(z=n.settings.maxLineWidth);const pe=A(H.vertices,O.vertices);return J&&(J.value=`${pe}°`),new ti(z,pe,`A-${I+1}`)});r("pointer:move",E)},U=P=>{let E=null,H;const I=J=>{E=l.find(pe=>{const re=pe.renderer;return(re==null?void 0:re.elem)===J.target}),[H]=m(P,f.value,h.value.map(pe=>pe),p.value)},G=J=>{if(E){const pe=E.renderer,re=pe==null?void 0:pe.elem;if(!re)return;const ge=re.getBoundingClientRect();E.vertices[0].x-=ge.x-(J instanceof MouseEvent?J.clientX:J.targetTouches[0].clientX)+ze.anchorPoint.size/2,E.vertices[0].y-=ge.y-(J instanceof MouseEvent?J.clientY:J.targetTouches[0].clientY)+ze.anchorPoint.size/2,L(H),P.update()}},O=()=>{E&&r("pointer:up",h.value),E=null},z=s.value;z&&(z.addEventListener("touchstart",I),z.addEventListener("touchend",O),z.addEventListener("mousedown",I),z.addEventListener("mouseup",O),z.addEventListener("mousemove",G),z.addEventListener("touchmove",G))};return i.onMounted(()=>{s.value&&(c=new he({width:s.value.scrollWidth,height:s.value.scrollHeight,fullscreen:!1}).appendTo(s.value),c.scene.scale=d,c.update(),i.watch(()=>n.value,()=>{M()},{deep:!0,immediate:!0}),U(c))}),i.onBeforeUnmount(()=>{c&&(c.clear(),c=null)}),(P,E)=>(i.openBlock(),i.createElementBlock("div",Im,[i.createVNode(Ta,{"select-template-index":P.selectTemplateIndex,settings:P.settings,"onTemplate:select":E[0]||(E[0]=H=>r("template:select",H)),onInitDrawTemplate:X},null,8,["select-template-index","settings"]),i.createElementVNode("div",Lm,[i.createElementVNode("div",Dm,null,512)])]))}}),Wm={class:"flex max-w-[50rem] flex-col gap-3"},jm={},Xm=i.defineComponent({...jm,__name:"kozyrek-configurator",props:{settings:{},cartItem:{},client:{}},emits:["submit-success"],setup(e,{emit:t}){const n=e,r=t,s=i.ref(!1),o=i.ref(!1),a=i.ref(!1),l=i.ref(n.cartItem),c=i.ref(n.settings),d=i.ref({linesWidths:[...n.cartItem.configuratorParams.linesWidths],linesAngles:[...n.cartItem.configuratorParams.linesAngles]}),h=i.ref({quantity:{},marker:{},length:{}}),u=i.ref(0),f=(C=0)=>{const B=c.value.allTemplates.at(C);B!==void 0&&(u.value=C,l.value.configuratorParams.linesWidths=B.points.map(v=>W.isArray(v)?v[0]:v.width),l.value.configuratorParams.linesAngles=B.points.map(v=>W.isArray(v)?v[1]:v.angle),y()),m(l.value.configuratorParams)},p=async()=>{const C=prompt("Введите название шаблона:");if(!C)return;a.value=!0;const B={label:C,points:l.value.configuratorParams.linesWidths.map((v,$)=>[v,l.value.configuratorParams.linesAngles[$]])};await Y.HttpRequester.getInstance(Y.ConfiguratorProvider).createTemplate(n.cartItem.category,B,h.value).then(()=>{c.value.addCustomTemplate(B),u.value=c.value.allTemplates.length-1}).catch(()=>{a.value=!1}),a.value=!1},g=()=>{c.value.showOnlyTemplates||c.value.allowSaveTemplates&&(u.value=c.value.allTemplates.length-1)},m=async C=>{y(),s.value=!0,await Y.HttpRequester.getInstance(Y.ConfiguratorProvider).searchProduct(n.cartItem.category,C,h.value).then(B=>{l.value.product=B}).catch(()=>{s.value=!1}),s.value=!1},_=async()=>{o.value=!0,await(l.value.isNewRec()?Y.HttpRequester.getInstance(Y.CartProvider).addCartItem(n.client,l.value).then(C=>{r("submit-success",C)}).catch(()=>{o.value=!1}):Y.HttpRequester.getInstance(Y.CartProvider).patchCartItem(n.client,l.value).then(C=>{r("submit-success",C)}).catch(()=>{o.value=!1})),o.value=!1},y=()=>{const C={quantity:h.value.quantity,marker:h.value.marker};l.value.configuratorParams.linesWidths.forEach((B,v)=>{C[`lines_widths[${v+1}]`]={},C[`lines_angles[${v+1}]`]={}}),h.value=C},b=C=>{d.value.linesWidths=C.map(B=>B.width),d.value.linesAngles=C.map(B=>B.angle)},S=C=>{l.value.configuratorParams.linesWidths=d.value.linesWidths,l.value.configuratorParams.linesAngles=d.value.linesAngles,y(),g(),m(l.value.configuratorParams)},x=(C,B)=>{d.value.linesWidths=C,d.value.linesAngles=B};return i.onBeforeMount(()=>{f()}),(C,B)=>(i.openBlock(),i.createElementBlock("div",Wm,[i.createVNode(Tc,{value:l.value,"select-template-index":u.value,settings:c.value,"onPointer:up":S,"onPointer:move":b,"onTemplate:select":f},null,8,["value","select-template-index","settings"]),i.createVNode(Na,{value:l.value,"onUpdate:value":B[0]||(B[0]=v=>l.value=v),"preview-params":d.value,validation:h.value,settings:c.value,"is-submit-processing":o.value,"is-product-searching":s.value,"select-template-index":u.value,"onUpdate:params":B[1]||(B[1]=v=>m(v)),"onUpdate:preview":x,onSubmit:_,"onClick:saveTemplate":p},null,8,["value","preview-params","validation","settings","is-submit-processing","is-product-searching","select-template-index"])]))}});class Ri extends Y.Identity{constructor(n,r){super();k(this,"label","");k(this,"points",[]);k(this,"isCustom",!1);k(this,"id",-1);k(this,"guid","");n?(this.label=n.label,this.points=n.points.map((s,o)=>W.isArray(s)?new ti(s[0],s[1],`A-${o+1}`):new ti(s.width,s.angle,`A-${o+1}`))):(this.label="-- Новая конфигурация --",this.points=[new ti(0,0,"A-1")],this.isCustom=!0,this.id=r??this.id)}}class ao extends Ri{constructor(n){super(n);k(this,"isDefault");this.isDefault=n.isDefault??!1}}class qm{constructor(t){k(this,"minLineWidth");k(this,"maxLineWidth");k(this,"lineWidthStep");k(this,"minLineAngle");k(this,"maxLineAngle");k(this,"lineAngleStep");k(this,"stripMinWidth");k(this,"stripMaxWidth");k(this,"stripMinLength");k(this,"stripMaxLength");k(this,"allowShowTable");k(this,"showOnlyTemplates");k(this,"templates");k(this,"customTemplates",[]);k(this,"startTailConfigs");k(this,"endTailConfigs");k(this,"bendCountForExtended");k(this,"extendedProductCatalog");k(this,"allowChangeFirstPoint");k(this,"allowSaveTemplates");k(this,"userTemplatesPrefix");k(this,"lengthStep");this.minLineWidth=t.minLineWidth,this.maxLineWidth=t.maxLineWidth,this.lineWidthStep=t.lineWidthStep,this.minLineAngle=t.minLineAngle,this.maxLineAngle=t.maxLineAngle,this.lineAngleStep=t.lineAngleStep,this.stripMinWidth=t.stripMinWidth,this.stripMaxWidth=t.stripMaxWidth,this.stripMinLength=t.stripMinLength,this.stripMaxLength=t.stripMaxLength,this.allowShowTable=t.allowShowTable,this.showOnlyTemplates=t.showOnlyTemplates,this.templates=t.templates.map(n=>new Ri(n)),this.templates.forEach((n,r)=>{n.id=r}),this.startTailConfigs=t.startTailConfigs.map(n=>new ao(n)),this.endTailConfigs=t.endTailConfigs.map(n=>new ao(n)),this.bendCountForExtended=t.bendCountForExtended,this.extendedProductCatalog=t.extendedProductCatalog,this.allowChangeFirstPoint=t.allowChangeFirstPoint,this.allowSaveTemplates=t.allowSaveTemplates,this.userTemplatesPrefix=t.userTemplatesPrefix,this.lengthStep=t.lengthStep,this.showOnlyTemplates||(this.customTemplates=t.customTemplates?Object.entries(t.customTemplates).map(([n,r])=>{const s=new Ri(r);return s.isCustom=!0,s.id=+n,s}):[],this.customTemplates.push(new Ri))}get allTemplates(){return[...this.templates,...this.customTemplates]}addCustomTemplate(t){var r,s;if(!this.allowSaveTemplates)return;const n=new Ri(t);n.isCustom=!0,n.id=(((r=this.customTemplates.at(-1))==null?void 0:r.id)??((s=this.templates.at(-1))==null?void 0:s.id)??0)+1,this.customTemplates.splice(-1,0,n)}removeCustomTemplate(t){if(this.allowSaveTemplates)return;const n=this.customTemplates.findIndex(r=>r.id===t);n&&n!==-1&&this.customTemplates.splice(n,1)}}const Ym={},Fi=i.defineComponent({...Ym,__name:"debounced-input-number",props:{value:{default:void 0},clearable:{type:Boolean,default:!1},debounceTime:{default:500},placeholder:{default:""},min:{default:void 0},max:{default:void 0},step:{default:1},validator:{type:Function,default:void 0}},emits:["update:value"],setup(e,{expose:t,emit:n}){const r=e,s=n,o=i.ref(r.value),a=i.computed(()=>i.inject("debounce-input-time",r.debounceTime)),l=W.debounce(()=>s("update:value",o.value),a.value),c=p=>{o.value=p,l()};i.watch(()=>r.value,p=>{o.value=p});const d=i.ref(null);return t({focus:()=>{var p;return(p=d.value)==null?void 0:p.focus()},blur:()=>{var p;return(p=d.value)==null?void 0:p.blur()},select:()=>{var p;return(p=d.value)==null?void 0:p.select()}}),(p,g)=>(i.openBlock(),i.createBlock(i.unref(V.NInputNumber),{ref_key:"inputReference",ref:d,value:o.value,"onUpdate:value":[g[0]||(g[0]=m=>o.value=m),c],clearable:p.clearable,placeholder:p.placeholder,min:p.min,max:p.max,step:p.step,validator:p.validator},{prefix:i.withCtx(()=>[i.renderSlot(p.$slots,"prefix")]),_:3},8,["value","clearable","placeholder","min","max","step","validator"]))}}),Um={class:"flex flex-col gap-3"},Gm={},Ec=i.defineComponent({...Gm,__name:"metal-for-doors-configurator-form",props:{value:{},settings:{},isProductSearching:{type:Boolean,default:!1},isSubmitProcessing:{type:Boolean,default:!1},validation:{default:void 0}},emits:["update:value","update:params","click:view-switch","submit"],setup(e,{emit:t}){const n=e,r=t,s=i.useTemplateRef("first-input-element"),o=i.ref(W.cloneDeep(i.toRaw(n.value.configuratorParams))),a=()=>{o.value.length>0&&o.value.width>0&&(r("update:params",o.value),l("configuratorParams",o.value))},l=(c,d)=>{const h=new Y.CartItemBase(n.value);h[c]=d,r("update:value",h)};return i.onMounted(()=>{n.value.isNewRec()&&i.nextTick(()=>{var c;(c=s.value)==null||c.focus()})}),(c,d)=>{const h=V.NInput;return i.openBlock(),i.createBlock(i.unref(V.NForm),{disabled:c.isSubmitProcessing,class:"flex flex-col gap-2"},{default:i.withCtx(()=>[i.createVNode(i.unref(V.NFormItem),{required:!0,feedback:c.validation.width.feedback||"","show-feedback":c.validation.width.showFeedback||!1,"validation-status":c.validation.width.validationStatus||void 0,label:`Ширина, ${c.settings.minWidth?" от "+c.settings.minWidth:""}${c.settings.maxWidth?" до "+c.settings.maxWidth:""} мм`},{default:i.withCtx(()=>[i.createVNode(Fi,{ref:"first-input-element",value:o.value.width,"onUpdate:value":[d[0]||(d[0]=u=>o.value.width=u),a],class:"w-full",max:c.settings.maxWidth??void 0,min:c.settings.minWidth,validator:u=>!!u&&u>=c.settings.minWidth&&(!c.settings.maxWidth||u<=c.settings.maxWidth),placeholder:"Введите ширину"},null,8,["value","max","min","validator"])]),_:1},8,["feedback","show-feedback","validation-status","label"]),i.createVNode(i.unref(V.NFormItem),{required:!0,feedback:c.validation.length.feedback||"","show-feedback":c.validation.length.showFeedback||!1,"validation-status":c.validation.length.validationStatus||void 0,label:`Длина, ${c.settings.minLength?" от "+c.settings.minLength:""}${c.settings.maxLength?" до "+c.settings.maxLength:""} мм`},{default:i.withCtx(()=>[i.createVNode(Fi,{value:o.value.length,"onUpdate:value":[d[1]||(d[1]=u=>o.value.length=u),a],placeholder:"Введите длину",max:c.settings.maxLength,min:c.settings.minLength,validator:u=>u>=c.settings.minLength&&u<=c.settings.maxLength,class:"w-full"},null,8,["value","max","min","validator"])]),_:1},8,["feedback","show-feedback","validation-status","label"]),i.createVNode(i.unref(V.NFormItem),{required:!0,feedback:c.validation.quantity.feedback||"","show-feedback":c.validation.quantity.showFeedback||!1,"validation-status":c.validation.quantity.validationStatus||void 0,label:"Количество"},{default:i.withCtx(()=>[i.createVNode(i.unref(V.NInputNumber),{value:c.value.quantity,placeholder:"Введите количество",min:1,validator:u=>u>0,class:"w-full","onUpdate:value":d[2]||(d[2]=u=>l("quantity",u??0))},null,8,["value","validator"])]),_:1},8,["feedback","show-feedback","validation-status"]),i.createVNode(i.unref(V.NFormItem),{feedback:c.validation.marker.feedback||"","show-feedback":c.validation.marker.showFeedback||!1,"validation-status":c.validation.marker.validationStatus||void 0,label:"Маркировка"},{default:i.withCtx(()=>[i.createVNode(h,{value:c.value.marker,placeholder:"Введите маркировку","onUpdate:value":d[3]||(d[3]=u=>l("marker",u))},null,8,["value"])]),_:1},8,["feedback","show-feedback","validation-status"]),i.createVNode(qi,{"is-product-searching":c.isProductSearching,product:c.value.product},null,8,["is-product-searching","product"]),i.createElementVNode("div",Um,[i.createVNode(i.unref(V.NButton),{disabled:c.value.product.isNewRec()||c.isProductSearching||c.isSubmitProcessing||c.value.length===0||c.value.width===0||c.value.quantity===0,type:"primary",class:"self-start",onClick:d[4]||(d[4]=u=>r("submit",c.value))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(c.value.isNewRec()?"В корзину":"Изменить"),1)]),_:1},8,["disabled"]),c.settings.allowShowTable?(i.openBlock(),i.createBlock(i.unref(V.NButton),{key:0,type:"tertiary",class:"self-start",onClick:d[5]||(d[5]=u=>r("click:view-switch"))},{default:i.withCtx(()=>d[6]||(d[6]=[i.createTextVNode(" Показать в виде списка ")])),_:1,__:[6]})):i.createCommentVNode("",!0)])]),_:1},8,["disabled"])}}}),Km={class:"w-104 px-5"},Zm={},Jm=i.defineComponent({...Zm,__name:"metal-for-doors-configurator",props:{settings:{},cartItem:{},client:{}},emits:["submit-success"],setup(e,{emit:t}){const n=e,r=t,s=i.ref(n.cartItem),o=i.ref({width:{},length:{},quantity:{},marker:{}}),a=i.ref(!1),l=i.ref(!1),c=async h=>{a.value=!0,await Y.HttpRequester.getInstance(Y.ConfiguratorProvider).searchProduct(n.cartItem.category,h,o.value).then(u=>{s.value.product=u}).catch(()=>{a.value=!1}),a.value=!1},d=async()=>{l.value=!0,await(s.value.isNewRec()?Y.HttpRequester.getInstance(Y.CartProvider).addCartItem(n.client,s.value).then(h=>{r("submit-success",h)}).catch(()=>{l.value=!1}):Y.HttpRequester.getInstance(Y.CartProvider).patchCartItem(n.client,s.value).then(h=>{r("submit-success",h)}).catch(()=>{l.value=!1})),l.value=!1};return(h,u)=>(i.openBlock(),i.createElementBlock("div",Km,[i.createVNode(Ec,{value:s.value,"onUpdate:value":u[0]||(u[0]=f=>s.value=f),validation:o.value,settings:h.settings,"is-submit-processing":l.value,"onUpdate:params":u[1]||(u[1]=f=>c(f)),onSubmit:u[2]||(u[2]=f=>d())},null,8,["value","validation","settings","is-submit-processing"])]))}}),Qm={key:0,class:"flex items-baseline gap-1"},e0={key:0,class:"flex items-baseline gap-1"},t0={class:"flex gap-3"},n0={},$c=i.defineComponent({...n0,__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(e,{emit:t}){const n=e,r=t,s=i.computed(()=>pt.isPhoneDevice()),o=i.ref(W.cloneDeep(i.toRaw(n.value.configuratorParams))),a=i.computed(()=>n.settings.widthOverlaps[o.value.mountType]??0),l=i.computed(()=>n.settings.heightOverlaps[o.value.mountType]??0),c=i.computed(()=>n.settings.maxWidths[o.value.netType]),d=i.computed(()=>n.settings.maxHeights[o.value.netType]-l.value),h=(f,p)=>{f&&f in o.value&&(o.value[f]=p??0),r("update:params",o.value),u("configuratorParams",o.value)},u=(f,p)=>{const g=new Y.CartItemBase(n.value);g[f]=p,r("update:value",g)};return(f,p)=>{const g=V.NInput;return i.openBlock(),i.createBlock(i.unref(V.NForm),{class:"flex flex-col gap-2 px-4 md:max-w-96"},{default:i.withCtx(()=>[i.createVNode(i.unref(V.NFormItem),{required:!0,"show-feedback":!1,label:"Тип сетки"},{default:i.withCtx(()=>[i.createVNode(i.unref(V.NSelect),{value:o.value.netType,"onUpdate:value":[p[0]||(p[0]=m=>o.value.netType=m),h],options:f.settings.netType.map(m=>({label:f.settings.descriptions.net_type[m],value:m}))},null,8,["value","options"])]),_:1}),i.createVNode(i.unref(V.NFormItem),{required:!0,"show-feedback":!1,label:"Цвет профиля"},{default:i.withCtx(()=>[i.createVNode(i.unref(V.NSelect),{value:o.value.color,"onUpdate:value":p[1]||(p[1]=m=>o.value.color=m),options:f.settings.color.map(m=>({label:f.settings.descriptions.color[m],value:m}))},null,8,["value","options"])]),_:1}),i.createVNode(i.unref(V.NFormItem),{required:!0,"show-feedback":!1,label:"Вид крепления"},{default:i.withCtx(()=>[i.createVNode(i.unref(V.NSelect),{value:o.value.mountType,"onUpdate:value":[p[2]||(p[2]=m=>o.value.mountType=m),h],options:f.settings.mountType.map(m=>({label:f.settings.descriptions.mount_type[m],value:m}))},null,8,["value","options"])]),_:1}),i.createVNode(i.unref(V.NFormItem),{required:!0,feedback:f.validation.width.feedback||"","show-feedback":f.validation.width.showFeedback||o.value.width>=f.settings.minWidth&&o.value.width<=f.settings.maxWidths[o.value.netType],"validation-status":f.validation.width.validationStatus||void 0,label:`Ширина светового проёма от ${f.settings.minWidth-a.value} ${c.value?" до "+c.value:""} мм.`},{feedback:i.withCtx(()=>[!f.validation.width.showFeedback&&o.value.width>=f.settings.minWidth&&o.value.width<=f.settings.maxWidths[o.value.netType]?(i.openBlock(),i.createElementBlock("div",Qm,[i.createVNode(i.unref(V.NText),{type:"success"},{default:i.withCtx(()=>[i.createTextVNode("Ширина готового изделия "+i.toDisplayString(o.value.width+a.value),1)]),_:1}),i.createVNode(i.unref(V.NButton),{quaternary:"",type:"info",size:"tiny",onClick:p[4]||(p[4]=m=>r("click:instructions-toggle"))},{default:i.withCtx(()=>p[11]||(p[11]=[i.createElementVNode("span",{class:"text-sm"},"Руководство",-1)])),_:1,__:[11]})])):i.createCommentVNode("",!0)]),default:i.withCtx(()=>[i.createVNode(Fi,{value:o.value.width&&o.value.width-a.value,max:c.value,min:f.settings.minWidth-a.value,placeholder:"Введите ширину светового проёма",class:"w-full","onUpdate:value":p[3]||(p[3]=m=>h("width",(m&&m+a.value)??void 0))},null,8,["value","max","min"])]),_:1},8,["feedback","show-feedback","validation-status","label"]),i.createVNode(i.unref(V.NFormItem),{required:!0,feedback:f.validation.height.feedback||"","show-feedback":f.validation.height.showFeedback||o.value.height>=f.settings.minHeight&&o.value.height<=f.settings.maxHeights[o.value.netType],"validation-status":f.validation.height.validationStatus||void 0,label:`Высота светового проёма от ${f.settings.minHeight-l.value} ${d.value?" до "+d.value:""} мм.`},{feedback:i.withCtx(()=>[!f.validation.height.showFeedback&&o.value.height>=f.settings.minHeight&&o.value.height<=f.settings.maxHeights[o.value.netType]?(i.openBlock(),i.createElementBlock("div",e0,[i.createVNode(i.unref(V.NText),{type:"success"},{default:i.withCtx(()=>[i.createTextVNode("Высота готового изделия "+i.toDisplayString(o.value.height+l.value),1)]),_:1}),i.createVNode(i.unref(V.NButton),{quaternary:"",type:"info",size:"tiny",onClick:p[6]||(p[6]=m=>r("click:instructions-toggle"))},{default:i.withCtx(()=>p[12]||(p[12]=[i.createElementVNode("span",{class:"text-sm"},"Руководство",-1)])),_:1,__:[12]})])):i.createCommentVNode("",!0)]),default:i.withCtx(()=>[i.createVNode(Fi,{value:o.value.height&&o.value.height-l.value,max:d.value,min:f.settings.minHeight-l.value,placeholder:"Введите высоту светового проёма",class:"w-full","onUpdate:value":p[5]||(p[5]=m=>h("height",(m&&m+l.value)??void 0))},null,8,["value","max","min"])]),_:1},8,["feedback","show-feedback","validation-status","label"]),i.createVNode(i.unref(V.NFormItem),{required:!0,feedback:f.validation.quantity.feedback||"","show-feedback":f.validation.quantity.showFeedback||!1,"validation-status":f.validation.quantity.validationStatus||void 0,label:"Количество"},{default:i.withCtx(()=>[i.createVNode(i.unref(V.NInputNumber),{value:f.value.quantity,"onUpdate:value":p[7]||(p[7]=m=>f.value.quantity=m),min:1,validator:m=>Number.isInteger(m),placeholder:"Введите количество",class:"w-full"},null,8,["value","validator"])]),_:1},8,["feedback","show-feedback","validation-status"]),i.createVNode(i.unref(V.NFormItem),{feedback:f.validation.marker.feedback||"","show-feedback":f.validation.marker.showFeedback||!1,"validation-status":f.validation.marker.validationStatus||void 0,label:"Маркировка"},{default:i.withCtx(()=>[i.createVNode(g,{value:f.value.marker,"onUpdate:value":p[8]||(p[8]=m=>f.value.marker=m),placeholder:"Введите маркировку"},null,8,["value"])]),_:1},8,["feedback","show-feedback","validation-status"]),i.createVNode(qi,{"is-product-searching":f.isProductSearching,product:f.value.product},null,8,["is-product-searching","product"]),i.createElementVNode("div",t0,[i.createVNode(i.unref(V.NButton),{loading:f.isSubmitProcessing,disabled:f.isProductSearching||!f.value.product||f.value.product.isNewRec()||o.value.width<f.settings.minHeight-l.value||o.value.height<f.settings.minHeight-l.value,type:"primary",class:"self-start",onClick:p[9]||(p[9]=m=>r("submit",f.value))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(f.value.isNewRec()?"В корзину":"Изменить"),1)]),_:1},8,["loading","disabled"]),s.value?(i.openBlock(),i.createBlock(i.unref(V.NButton),{key:0,type:"default",onClick:p[10]||(p[10]=m=>r("click:show-preview-drawer"))},{default:i.withCtx(()=>p[13]||(p[13]=[i.createTextVNode(" Предварительный просмотр ")])),_:1,__:[13]})):i.createCommentVNode("",!0)])]),_:1})}}}),i0="/img/configurators/mosquitto/measurement-instructions/measurement-height.png",r0="/img/configurators/mosquitto/measurement-instructions/measurement-width.png",s0="/img/configurators/mosquitto/measurement-instructions/mount.png",o0="/img/configurators/mosquitto/measurement-instructions/mount-z-plastic.png",a0="/img/configurators/mosquitto/measurement-instructions/mount-z-metal.png",l0={class:"flex flex-col gap-6"},c0={class:"flex gap-4"},d0={class:"flex flex-col gap-2"},h0={class:"flex gap-4"},u0={class:"flex flex-col gap-2"},f0={class:"flex gap-4"},p0={class:"flex flex-col gap-2"},g0={},Nc=i.defineComponent({...g0,__name:"mosquito-configurator-measurement-instructions",props:{heightOverlaps:{},widthOverlaps:{},show:{type:Boolean}},emits:["update:show"],setup(e,{emit:t}){const n=pt.initRefDependingOnDeviceResolution("small","small","medium"),r=pt.initRefDependingOnDeviceResolution(.98,.95,.8),s=i.computed(()=>window.innerWidth*r.value),o=t;return(a,l)=>{const c=V.NText;return i.openBlock(),i.createBlock(i.unref(V.NModal),{show:a.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",l0,[i.createVNode(c,{type:"error",class:"text-base font-medium"},{default:i.withCtx(()=>l[3]||(l[3]=[i.createTextVNode(" Важно! Для того,что бы произвести замер, необходимо открыть оконную створку. ")])),_:1,__:[3]}),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:i0,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:r0,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",c0,[l[9]||(l[9]=i.createElementVNode("img",{src:s0,alt:"measurement-height",class:"w-[7.5rem]"},null,-1)),i.createElementVNode("div",d0,[l[8]||(l[8]=i.createElementVNode("span",{class:"text-lg font-bold"},"Крепление на раме сетки",-1)),i.createElementVNode("span",null,[l[4]||(l[4]=i.createTextVNode(" Расчетные размеры москитной сетки: ")),l[5]||(l[5]=i.createElementVNode("br",null,null,-1)),i.createTextVNode(" Ширина светового проема +"+i.toDisplayString(a.widthOverlaps.frame)+" мм. Высота светового проема +"+i.toDisplayString(a.heightOverlaps.frame)+" мм. ",1),l[6]||(l[6]=i.createElementVNode("br",null,null,-1)),l[7]||(l[7]=i.createTextVNode(" Крепления находятся на раме сетки. "))])])]),i.createElementVNode("div",h0,[l[15]||(l[15]=i.createElementVNode("img",{src:o0,alt:"measurement-height",class:"w-[7.5rem]"},null,-1)),i.createElementVNode("div",u0,[l[14]||(l[14]=i.createElementVNode("span",{class:"text-lg font-bold"},"Z-Образное крепление пластик (верх+низ)",-1)),i.createElementVNode("span",null,[l[10]||(l[10]=i.createTextVNode(" Расчетные размеры москитной сетки:")),l[11]||(l[11]=i.createElementVNode("br",null,null,-1)),i.createTextVNode(" Ширина светового проема +"+i.toDisplayString(a.widthOverlaps.external_plastic)+" мм. Высота светового проема +"+i.toDisplayString(a.heightOverlaps.external_plastic)+" мм. ",1),l[12]||(l[12]=i.createElementVNode("br",null,null,-1)),l[13]||(l[13]=i.createTextVNode(" Крепления прикручиваются к раме окна c помощью шурупов. "))])])]),i.createElementVNode("div",f0,[l[21]||(l[21]=i.createElementVNode("img",{src:a0,alt:"measurement-height",class:"w-[7.5rem]"},null,-1)),i.createElementVNode("div",p0,[l[20]||(l[20]=i.createElementVNode("span",{class:"text-lg font-bold"},"Z-Образное крепление металл (верх+низ)",-1)),i.createElementVNode("span",null,[l[16]||(l[16]=i.createTextVNode(" Расчетные размеры москитной сетки: ")),l[17]||(l[17]=i.createElementVNode("br",null,null,-1)),i.createTextVNode(" Ширина светового проема +"+i.toDisplayString(a.widthOverlaps.external_metal)+" мм. Высота светового проема +"+i.toDisplayString(a.heightOverlaps.external_metal)+" мм. ",1),l[18]||(l[18]=i.createElementVNode("br",null,null,-1)),l[19]||(l[19]=i.createTextVNode(" Крепления прикручиваются к раме окна c помощью шурупов. "))])])])])]),_:1},8,["show","size","style"])}}}),m0={class:"flex flex-col items-center justify-between rounded-xl"},_0={class:"img-preview relative flex justify-center"},y0={},b0=i.defineComponent({...y0,__name:"mosquito-configurator-preview",props:{configuratorParams:{},settings:{}},emits:["open-instructions"],setup(e,{emit:t}){const n=e,r=i.computed(()=>W.keys(n.settings.crossbarCount).find(o=>n.settings.crossbarCount[Number(o)]&&(!n.settings.crossbarCount[Number(o)+1]||n.configuratorParams.height<n.settings.crossbarCount[Number(o)+1]-n.settings.heightOverlaps[n.configuratorParams.mountType]))),s=t;return(o,a)=>{const l=V.NButton;return i.openBlock(),i.createElementBlock("div",m0,[i.createElementVNode("div",_0,[a[1]||(a[1]=i.createElementVNode("div",{class:"window"},null,-1)),i.createElementVNode("div",{class:i.normalizeClass(["net",`net-${o.configuratorParams.netType}`])},null,2),i.createElementVNode("div",{class:i.normalizeClass(["frame",`frame-${o.configuratorParams.color}`])},null,2),r.value?(i.openBlock(),i.createElementBlock("div",{key:0,class:i.normalizeClass(["frame-crossbar",`frame-crossbar-${r.value}-${o.configuratorParams.color}`])},null,2)):i.createCommentVNode("",!0),i.createElementVNode("div",{class:i.normalizeClass(["mount",`mount-${o.configuratorParams.mountType}-${o.configuratorParams.color}`])},null,2),i.createElementVNode("div",{class:i.normalizeClass(["cut-preview",`cut-preview-${o.configuratorParams.mountType}-${o.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,__:[2]})])}}}),lo=Ln(b0,[["__scopeId","data-v-8b43aa68"]]),w0={class:"grid md:grid-cols-2"},v0={},k0=i.defineComponent({...v0,__name:"mosquito-configurator",props:{settings:{},cartItem:{},client:{}},emits:["submit-success"],setup(e,{emit:t}){const n=e,r=t,s=i.computed(()=>pt.isPhoneDevice()),o=i.ref(!1),a=i.ref(!1),l=i.ref(n.cartItem),c=i.ref({width:{},height:{},quantity:{},marker:{}}),d=i.ref(!1),h=i.ref(!1),u=async p=>{p.height>0&&p.width>0&&(d.value=!0,await Y.HttpRequester.getInstance(Y.ConfiguratorProvider).searchProduct(n.cartItem.category,p,c.value).then(g=>{l.value.product=g}).catch(()=>{d.value=!1}),d.value=!1)},f=async()=>{h.value=!0,await(l.value.isNewRec()?Y.HttpRequester.getInstance(Y.CartProvider).addCartItem(n.client,l.value).then(p=>{r("submit-success",p)}).catch(()=>{h.value=!1}):Y.HttpRequester.getInstance(Y.CartProvider).patchCartItem(n.client,l.value).then(p=>{r("submit-success",p)}).catch(()=>{h.value=!1})),h.value=!1};return(p,g)=>{const m=Br;return i.openBlock(),i.createElementBlock(i.Fragment,null,[i.createVNode(Nc,{show:a.value,"onUpdate:show":g[0]||(g[0]=_=>a.value=_),"height-overlaps":p.settings.heightOverlaps,"width-overlaps":p.settings.widthOverlaps},null,8,["show","height-overlaps","width-overlaps"]),i.createElementVNode("div",w0,[s.value?(i.openBlock(),i.createBlock(i.unref(V.NDrawer),{key:1,show:o.value,"onUpdate:show":g[4]||(g[4]=_=>o.value=_),"default-width":375,resizable:""},{default:i.withCtx(()=>[i.createVNode(i.unref(V.NDrawerContent),null,{header:i.withCtx(()=>[i.createVNode(i.unref(V.NButton),{size:"small",type:"primary",class:"block justify-self-end",onClick:g[2]||(g[2]=_=>o.value=!1)},{default:i.withCtx(()=>[i.createVNode(m)]),_:1})]),default:i.withCtx(()=>[i.createVNode(lo,{"configurator-params":l.value.configuratorParams,settings:p.settings,onOpenInstructions:g[3]||(g[3]=_=>a.value=!0)},null,8,["configurator-params","settings"])]),_:1})]),_:1},8,["show"])):(i.openBlock(),i.createBlock(lo,{key:0,"configurator-params":l.value.configuratorParams,settings:p.settings,onOpenInstructions:g[1]||(g[1]=_=>a.value=!0)},null,8,["configurator-params","settings"])),i.createVNode($c,{value:l.value,"onUpdate:value":g[5]||(g[5]=_=>l.value=_),validation:c.value,settings:p.settings,"is-product-searching":d.value,"is-submit-processing":h.value,"onUpdate:params":g[6]||(g[6]=_=>u(_)),onSubmit:g[7]||(g[7]=_=>f()),"onClick:instructionsToggle":g[8]||(g[8]=_=>a.value=!a.value),"onClick:showPreviewDrawer":g[9]||(g[9]=_=>o.value=!0)},null,8,["value","validation","settings","is-product-searching","is-submit-processing"])])],64)}}}),x0={},Pc=i.defineComponent({...x0,__name:"strip-configurator-line-item",props:{value:{},index:{},settings:{},product:{default:void 0},addLineButtonDisabled:{type:Boolean,default:!1},removeLineButtonDisabled:{type:Boolean,default:!1},suggestionOption:{default:void 0},autoFocus:{type:Boolean,default:!1},validation:{default:()=>({})}},emits:["update:value","click:add-line","click:remove-line"],setup(e,{expose:t,emit:n}){const r=e,s=n,o=i.useTemplateRef("width-input-element"),a=i.ref(!1),l=d=>{s("update:value",d??0,r.index,a)};i.onMounted(()=>{r.autoFocus&&i.nextTick(()=>{c()})});const c=()=>{var d;(d=o.value)==null||d.select()};return t({focusWidthInput:c}),(d,h)=>{const u=$a,f=Ea;return i.openBlock(),i.createBlock(i.unref(V.NFormItem),{label:`Полоса №${d.index+1}, мм`,required:!0},{feedback:i.withCtx(()=>[i.createVNode(qi,{"is-product-searching":a.value,product:d.product},null,8,["is-product-searching","product"])]),default:i.withCtx(()=>[i.createVNode(i.unref(V.NDropdown),{trigger:"click",options:d.suggestionOption,placement:"bottom-start",size:"large",onSelect:l},{default:i.withCtx(()=>[i.createVNode(Fi,{ref:"width-input-element",value:d.value,class:"w-full",step:d.value<d.settings.minLineWidth?d.settings.minLineWidth-d.value:d.settings.lineWidthStep,validator:p=>!!p&&p>=d.settings.minLineWidth&&p%d.settings.lineWidthStep===0,placeholder:"Введите ширину","onUpdate:value":l},null,8,["value","step","validator"])]),_:1},8,["options"]),i.createVNode(i.unref(V.NButton),{disabled:d.addLineButtonDisabled,size:"medium",class:"ml-2",onClick:h[0]||(h[0]=p=>s("click:add-line",d.index))},{default:i.withCtx(()=>[i.createVNode(u)]),_:1},8,["disabled"]),i.createVNode(i.unref(V.NButton),{disabled:d.removeLineButtonDisabled,size:"medium",class:"ml-2",onClick:h[1]||(h[1]=p=>s("click:remove-line",d.index))},{default:i.withCtx(()=>[i.createVNode(f)]),_:1},8,["disabled"])]),_:1},8,["label"])}}}),C0={class:"my-2 flex w-full flex-col"},S0={class:"flex gap-3"},B0={},Rc=i.defineComponent({...B0,__name:"strip-configurator-form",props:{value:{},settings:{},isSubmitProcessing:{type:Boolean,default:!1},validation:{default:void 0}},emits:["update:value","update:params","click:view-switch","submit","click:add-line","click:remove-line"],setup(e,{emit:t}){const n=e,r=t,s=i.computed(()=>n.value[0].configuratorParams.linesWidths.map(h=>h).reduce((h,u)=>h+u,0)),o=i.computed(()=>n.settings.width-s.value),a=i.computed(()=>!n.value.some(({product:h})=>!h)),l=i.computed(()=>o.value===0?void 0:[{label:`${(o.value>0?"Остаток +":"Излишек ")+o.value} мм.`,key:o.value}]),c=(h,u,f)=>{const p=n.value.at(u);if(p)if(h&&h>=n.settings.minLineWidth&&h%n.settings.lineWidthStep===0){const g={linesWidths:p.configuratorParams.linesWidths.toSpliced(u,1,h)};r("update:params",g,u,f),d("configuratorParams",g)}else p.product.id=-1},d=(h,u)=>{const f=n.value.map(p=>new Y.CartItemBase(p));f.forEach(p=>{p[h]=u}),r("update:value",f)};return(h,u)=>{const f=V.NText,p=V.NInput;return i.openBlock(),i.createBlock(i.unref(V.NForm),{class:"flex flex-col gap-2"},{default:i.withCtx(()=>{var g;return[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(h.value,(m,_)=>(i.openBlock(),i.createBlock(Pc,{key:_,"auto-focus":!0,index:_,value:m.configuratorParams.linesWidths.at(_)??0,product:m.product,settings:h.settings,"suggestion-option":l.value,"add-line-button-disabled":o.value<=0||h.value.length>=h.settings.maxLinesCount,"remove-line-button-disabled":h.value.length===1,"onUpdate:value":c,"onClick:addLine":u[0]||(u[0]=y=>r("click:add-line",y)),"onClick:removeLine":u[1]||(u[1]=y=>r("click:remove-line",y))},null,8,["index","value","product","settings","suggestion-option","add-line-button-disabled","remove-line-button-disabled"]))),128)),i.createElementVNode("div",C0,[o.value<0?(i.openBlock(),i.createBlock(f,{key:0,type:"error"},{default:i.withCtx(()=>[i.createTextVNode(" Сумма ширин всех полос должна быть равна "+i.toDisplayString(h.settings.width),1)]),_:1})):i.createCommentVNode("",!0),a.value&&h.value.length===h.settings.maxLinesCount&&o.value>0?(i.openBlock(),i.createBlock(f,{key:1,type:"error"},{default:i.withCtx(()=>u[8]||(u[8]=[i.createTextVNode(" Остаток резки должен быть равен 0 ")])),_:1,__:[8]})):i.createCommentVNode("",!0),i.createElementVNode("div",null,[u[9]||(u[9]=i.createTextVNode(" Остаток для резки: ")),i.createVNode(f,{type:o.value>=0?"Success":"error"},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(o.value),1)]),_:1},8,["type"]),i.createTextVNode(" из "+i.toDisplayString(h.settings.width)+" мм ",1)])]),i.createVNode(i.unref(V.NButton),{loading:h.isSubmitProcessing,disabled:!a.value||o.value<=0||h.value.length>=h.settings.maxLinesCount,type:"primary",class:"self-center",onClick:u[2]||(u[2]=m=>r("click:add-line",h.value.length))},{default:i.withCtx(()=>u[10]||(u[10]=[i.createTextVNode(" Добавить полосу ")])),_:1,__:[10]},8,["loading","disabled"]),i.createVNode(i.unref(V.NFormItem),{required:!0,label:`Метраж ${h.settings.minLength?" от "+h.settings.minLength:""} ${h.settings.maxLength?" до "+h.settings.maxLength:""} м.`},{default:i.withCtx(()=>[i.createVNode(i.unref(V.NInputNumber),{value:n.value[0].length,max:h.settings.maxLength||void 0,min:h.settings.minLength,step:h.settings.lengthStep,validator:m=>m%h.settings.lengthStep===0,placeholder:"Введите метраж",class:"w-full","onUpdate:value":u[3]||(u[3]=m=>d("length",m??0))},null,8,["value","max","min","step","validator"])]),_:1},8,["label"]),i.createVNode(i.unref(V.NFormItem),{required:!0,label:"Количество"},{default:i.withCtx(()=>[i.createVNode(i.unref(V.NInputNumber),{value:n.value[0].quantity,min:1,validator:m=>Number.isInteger(m),placeholder:"Введите количество",class:"w-full","onUpdate:value":u[4]||(u[4]=m=>d("quantity",m??0))},null,8,["value","validator"])]),_:1}),i.createVNode(i.unref(V.NFormItem),{label:"Маркировка"},{default:i.withCtx(()=>[i.createVNode(p,{value:n.value[0].marker,placeholder:"Введите маркировку","onUpdate:value":u[5]||(u[5]=m=>d("marker",m))},null,8,["value"])]),_:1}),i.createElementVNode("div",S0,[i.createVNode(i.unref(V.NButton),{loading:h.isSubmitProcessing,disabled:!a.value||o.value!=0||!((g=h.value[0])!=null&&g.length)||h.value[0].length>h.settings.maxLength||h.value[0].length<h.settings.minLength||h.value[0].quantity===0,type:"primary",class:"self-start",onClick:u[6]||(u[6]=m=>r("submit",h.value))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(h.value[0].isNewRec()?"В корзину":"Изменить"),1)]),_:1},8,["loading","disabled"]),h.settings.allowShowTable?(i.openBlock(),i.createBlock(i.unref(V.NButton),{key:0,type:"tertiary",class:"self-start",onClick:u[7]||(u[7]=m=>r("click:view-switch"))},{default:i.withCtx(()=>u[11]||(u[11]=[i.createTextVNode(" Показать в виде списка ")])),_:1,__:[11]})):i.createCommentVNode("",!0)])]}),_:1})}}}),T0={class:"flex grow flex-col"},E0=["src"],$0={class:"w-full"},N0={},Fc=i.defineComponent({...N0,__name:"strip-configurator-preview",props:{value:{},settings:{}},setup(e){return(t,n)=>(i.openBlock(),i.createElementBlock("div",T0,[i.createElementVNode("img",{src:"/img/configurators/strip/strip-"+t.value.length+".png",class:"w-full max-w-96 self-center",alt:"Штрипс"},null,8,E0),i.createElementVNode("div",$0,[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)])]))}}),P0={class:"w-104 flex grow flex-col px-5"},R0={},F0=i.defineComponent({...R0,__name:"strip-configurator",props:{settings:{},cartItems:{},client:{}},emits:["submit-success"],setup(e,{emit:t}){const n=e,r=t,s=i.ref(n.cartItems),o=i.ref({width:{},length:{},quantity:{},marker:{}}),a=i.ref(!1),l=i.computed(()=>s.value[0].configuratorParams.linesWidths.map(f=>f).reduce((f,p)=>f+p,0)),c=f=>{f===void 0&&(f=s.value.length-1);const p=s.value.at(0);if(!p)return;p.configuratorParams.linesWidths=p.configuratorParams.linesWidths.toSpliced(f+1,0,0),s.value.forEach(m=>{m.configuratorParams.linesWidths=p.configuratorParams.linesWidths});const g=new Y.CartItemBase({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}});s.value=s.value.toSpliced(f+1,0,g)},d=f=>{const p=s.value.at(0);p&&(p.configuratorParams.linesWidths=p.configuratorParams.linesWidths.toSpliced(f,1),s.value.forEach(g=>{g.configuratorParams.linesWidths=p.configuratorParams.linesWidths}),s.value=s.value.toSpliced(f,1),delete o[`linesWidths.${f}`],delete o[`linesWidths.${f}`])},h=async(f,p,g)=>{g.value=!0,await Y.HttpRequester.getInstance(Y.ConfiguratorProvider).searchProduct(s.value[p].category,{linesWidths:f.linesWidths.at(p)},o.value).then(m=>{s.value[p].product=m,s.value.length<n.settings.maxLinesCount&&l.value<n.settings.width&&c()}).catch(()=>{s.value[p].product=new Y.Product,g.value=!1}),g.value=!1},u=async()=>{a.value=!0,await(s.value[0].isNewRec()?Y.HttpRequester.getInstance(Y.CartProvider).addCartItem(n.client,s.value[0]).then(f=>{r("submit-success",f)}).catch(()=>{a.value=!1}):Y.HttpRequester.getInstance(Y.CartProvider).patchCartItem(n.client,s.value[0]).then(f=>{r("submit-success",f)}).catch(()=>{a.value=!1})),a.value=!1};return(f,p)=>(i.openBlock(),i.createElementBlock("div",P0,[i.createVNode(Fc,{value:s.value,"onUpdate:value":p[0]||(p[0]=g=>s.value=g),settings:f.settings},null,8,["value","settings"]),i.createVNode(Rc,{value:s.value,"onUpdate:value":p[1]||(p[1]=g=>s.value=g),validation:o.value,settings:f.settings,"is-submit-processing":a.value,"onUpdate:params":h,onSubmit:u,"onClick:addLine":c,"onClick:removeLine":d},null,8,["value","validation","settings","is-submit-processing"])]))}}),M0={class:"flex flex-row gap-2.5"},A0={class:"flex flex-col"},O0={class:"flex flex-col"},V0={},z0=i.defineComponent({...V0,__name:"date-range",props:{clearable:{type:Boolean,default:!0},dateRange:{default:void 0},dateFormat:{default:()=>Y.AppConfigProvider.getConfig().dateFormats.uiDate},predefinedDateRanges:{default:void 0},useDefaultPredefinedDateRanges:{type:Boolean,default:!1}},emits:["update:date-range"],setup(e,{emit:t}){const n=e,r=t,s=i.computed(()=>{if(n.predefinedDateRanges)return n.predefinedDateRanges;if(n.useDefaultPredefinedDateRanges){const a={};return W.forOwn(Y.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?Sn.startOfDay(new Date(a)):void 0,to:l?Sn.endOfDay(new Date(l)):void 0})};return(a,l)=>{var h,u,f,p;const c=V.NButton,d=V.NDatePicker;return i.openBlock(),i.createElementBlock("div",M0,[i.createVNode(d,{value:(u=(h=a.dateRange)==null?void 0:h.from)==null?void 0:u.getTime(),clearable:a.clearable,"is-date-disabled":g=>{var m,_;return((m=a.dateRange)==null?void 0:m.to)&&g>((_=a.dateRange)==null?void 0:_.to)},format:a.dateFormat,type:"date",onUpdateValue:l[0]||(l[0]=g=>{var m,_;return o(g,(_=(m=a.dateRange)==null?void 0:m.to)==null?void 0:_.getTime())})},i.createSlots({_:2},[s.value?{name:"footer",fn:i.withCtx(()=>[i.createElementVNode("div",A0,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(s.value,(g,m)=>(i.openBlock(),i.createBlock(c,{key:m,class:"my-1 mr-2",size:"small",type:"info",ghost:"",onClick:_=>{var y,b;return o((y=g==null?void 0:g.from)==null?void 0:y.getTime(),(b=g==null?void 0:g.to)==null?void 0:b.getTime())}},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(g.label),1)]),_:2},1032,["onClick"]))),128))])]),key:"0"}:void 0]),1032,["value","clearable","is-date-disabled","format"]),i.createVNode(d,{value:(p=(f=a.dateRange)==null?void 0:f.to)==null?void 0:p.getTime(),clearable:a.clearable,"is-date-disabled":g=>{var m,_;return((m=a.dateRange)==null?void 0:m.from)&&g<((_=a.dateRange)==null?void 0:_.from)},format:a.dateFormat,type:"date",onUpdateValue:l[1]||(l[1]=g=>{var m,_;return o((_=(m=a.dateRange)==null?void 0:m.from)==null?void 0:_.getTime(),g)})},i.createSlots({_:2},[s.value?{name:"footer",fn:i.withCtx(()=>[i.createElementVNode("div",O0,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(s.value,(g,m)=>(i.openBlock(),i.createBlock(c,{key:m,class:"my-1 mr-2",size:"small",type:"info",ghost:"",onClick:_=>{var y,b;return o((y=g==null?void 0:g.from)==null?void 0:y.getTime(),(b=g==null?void 0:g.to)==null?void 0:b.getTime())}},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(g.label),1)]),_:2},1032,["onClick"]))),128))])]),key:"0"}:void 0]),1032,["value","clearable","is-date-disabled","format"])])}}}),I0={class:"sc-lbl-date text-nowrap"},L0={},co=i.defineComponent({...L0,__name:"date-time-label",props:{date:{},isTimeSecondary:{type:Boolean},isTimeOnSecondLine:{type:Boolean}},setup(e){const t=e,n=i.computed(()=>Sn.format(t.date,Y.AppConfigProvider.getConfig().dateFormats.uiDate)),r=i.computed(()=>Sn.format(t.date,"HH:mm"));return(s,o)=>(i.openBlock(),i.createElementBlock("span",{class:i.normalizeClass({"flex flex-col":s.isTimeOnSecondLine})},[i.createElementVNode("span",I0,i.toDisplayString(n.value),1),i.createElementVNode("span",{class:i.normalizeClass([{"text-sc-grey":s.isTimeSecondary,"ml-1":!s.isTimeOnSecondLine},"sc-lbl-time"])},i.toDisplayString(r.value),3)],2))}}),D0={class:"flex flex-row gap-2.5"},H0={class:"flex grow basis-0 flex-row flex-wrap justify-start justify-items-start gap-y-1 md:flex-nowrap"},W0={class:"flex min-w-0 flex-col-reverse flex-wrap-reverse justify-end gap-1 sm:flex-row"},j0={class:"mb-0.5 sm:mb-0 sm:ml-3"},X0={},q0=i.defineComponent({...X0,__name:"dialog-header",props:{showCloseButton:{type:Boolean,default:!0}},emits:["close"],setup(e){return(t,n)=>{const r=Br,s=V.NButton,o=V.NPopover;return i.openBlock(),i.createElementBlock("div",D0,[i.createElementVNode("div",H0,[i.renderSlot(t.$slots,"main")]),i.createElementVNode("div",null,[i.createElementVNode("div",W0,[i.renderSlot(t.$slots,"extra-buttons"),i.createElementVNode("div",j0,[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=>t.$emit("close"))},{default:i.withCtx(()=>[i.createVNode(r)]),_:1})]),default:i.withCtx(()=>[n[1]||(n[1]=i.createTextVNode(" Закрыть "))]),_:1,__:[1]})):i.createCommentVNode("",!0)])])])])}}}),Y0={key:0,class:"flex flex-row gap-2.5"},U0={key:1,class:"flex flex-row flex-wrap justify-end gap-2.5"},G0={},K0=i.defineComponent({...G0,__name:"base-dialog",props:{show:{type:Boolean},title:{},sizes:{default:()=>({phone:{size:"small",scale:.98},tablet:{size:"small",scale:.9},default:{size:"medium",scale:.7}})},processing:{type:Boolean,default:!1},acceptButton:{default:()=>({show:!0,text:"ОК"})},cancelButton:{default:()=>({show:!0,text:"Отмена"})}},emits:["update:show","opening","closing","accept","processing:cancel"],setup(e,{expose:t,emit:n}){const r=e,s=n,o=i.ref(r.show),a=i.ref(r.processing),l=pt.initRefDependingOnDeviceResolution(r.sizes.phone.size,r.sizes.tablet.size,r.sizes.default.size),c=pt.initRefDependingOnDeviceResolution(r.sizes.phone.scale,r.sizes.tablet.scale,r.sizes.default.scale),d=i.computed(()=>window.innerWidth*c.value),h=()=>{s("opening"),o.value=!0,s("update:show",o.value)},u=(p="other")=>{if(a.value){s("processing:cancel",y=>{a.value=y});return}let g=!1;s("closing",p,()=>{g=!0}),g||(o.value=!1,s("update:show",o.value))},f=()=>{s("accept",g=>{a.value=g})};return i.watch(()=>r.show,p=>{p?h():u("other")}),i.watch(()=>r.processing,p=>{a.value=p}),t({open:h,close:u}),(p,g)=>{const m=V.NButton,_=V.NModal;return i.openBlock(),i.createBlock(_,{loading:a.value,show:o.value,"show-icon":!1,size:i.unref(l),style:i.normalizeStyle(`width: ${d.value}px`),title:p.title,"action-class":p.$slots["extra-action"]?"grid grid-cols-2 !justify-between":void 0,preset:"dialog",onClose:g[1]||(g[1]=y=>u("header")),onEsc:g[2]||(g[2]=y=>u("esc")),onMaskClick:g[3]||(g[3]=y=>u("mask"))},i.createSlots({default:i.withCtx(()=>[i.renderSlot(p.$slots,"default")]),_:2},[p.$slots.header?{name:"header",fn:i.withCtx(()=>[i.renderSlot(p.$slots,"header")]),key:"0"}:void 0,p.$slots.action||p.$slots["extra-action"]||p.acceptButton.show||p.cancelButton.show?{name:"action",fn:i.withCtx(()=>[p.$slots["extra-action"]?(i.openBlock(),i.createElementBlock("div",Y0,[i.renderSlot(p.$slots,"extra-action")])):i.createCommentVNode("",!0),p.$slots.action||p.acceptButton.show||p.cancelButton.show?(i.openBlock(),i.createElementBlock("div",U0,[i.renderSlot(p.$slots,"action",{disabled:a.value}),p.acceptButton.show??!0?(i.openBlock(),i.createBlock(m,{key:0,disabled:a.value,size:i.unref(l),type:"primary",onClick:f},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(p.acceptButton.text??"ОК"),1)]),_:1},8,["disabled","size"])):i.createCommentVNode("",!0),p.cancelButton.show??!0?(i.openBlock(),i.createBlock(m,{key:1,size:i.unref(l),type:"default",onClick:g[0]||(g[0]=y=>u("footer"))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(p.cancelButton.text??"Отмена"),1)]),_:1},8,["size"])):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)]),key:"1"}:void 0]),1032,["loading","show","size","style","title","action-class"])}}}),Z0={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function J0(e,t){return i.openBlock(),i.createElementBlock("svg",Z0,t[0]||(t[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 Q0=i.markRaw({name:"ion-download-outline",render:J0}),e_={},t_=i.defineComponent({...e_,__name:"single-file-upload-selector",props:{draggedAreaText:{}},emits:["update:file"],setup(e,{emit:t}){const n=t,r=i.ref({name:"",content:""}),s=o=>{if(r.value={name:"",content:""},o.length===0)return;const a=o[0];r.value.name=a.name;const l=new FileReader;l.addEventListener("load",()=>{r.value.content=l.result??"",n("update:file",r.value)}),l.readAsDataURL(a.file)};return(o,a)=>{const l=Q0,c=V.NUploadDragger,d=V.NUpload;return i.openBlock(),i.createBlock(d,{"default-upload":!1,max:1,action:"","directory-dnd":"",class:"content-center","onUpdate:fileList":s},{default:i.withCtx(()=>[i.createVNode(c,null,{default:i.withCtx(()=>[i.renderSlot(o.$slots,"dragged-area",{},()=>[i.createElementVNode("div",null,[i.createVNode(l,{class:"text-2xl"}),i.createElementVNode("div",null,i.toDisplayString(o.draggedAreaText??"Перетащите в эту область файл, который необходимо загрузить."),1)])])]),_:3})]),_:3})}}}),n_={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function i_(e,t){return i.openBlock(),i.createElementBlock("svg",n_,t[0]||(t[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 r_=i.markRaw({name:"ion-checkmark-done-sharp",render:i_}),s_={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function o_(e,t){return i.openBlock(),i.createElementBlock("svg",s_,t[0]||(t[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 a_=i.markRaw({name:"ion-options-outline",render:o_}),l_={class:"flex flex-row gap-x-2.5 p-0 sm:p-1"},c_={class:"flex-auto"},d_={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"},h_={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"},u_={},ho=i.defineComponent({...u_,__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(e,{emit:t}){const n=t,r=i.ref(!1),s=()=>{n("edit")},o=()=>{r.value=!1},a=()=>{r.value=!0,n("apply",o)},l=()=>{n("cancel",o)};return(c,d)=>{const h=a_,u=V.NButton,f=V.NPopover,p=r_,g=Br;return i.openBlock(),i.createElementBlock("div",l_,[i.createElementVNode("div",c_,[i.renderSlot(c.$slots,"default")]),i.createElementVNode("div",null,[i.createElementVNode("div",d_,[i.createElementVNode("div",h_,[c.showEditButton?(i.openBlock(),i.createBlock(f,{key:0,placement:"bottom"},{trigger:i.withCtx(()=>[i.createVNode(u,{disabled:c.disabled||r.value,type:"info",ghost:"",size:"small",onClick:s},{default:i.withCtx(()=>[i.createVNode(h)]),_:1},8,["disabled"])]),default:i.withCtx(()=>[d[0]||(d[0]=i.createTextVNode(" Редактировать данные "))]),_:1,__:[0]})):i.createCommentVNode("",!0),c.showApplyButton?(i.openBlock(),i.createBlock(f,{key:1,disabled:r.value,placement:"bottom"},{trigger:i.withCtx(()=>[i.createVNode(u,{disabled:c.disabled||r.value,type:"primary",size:"small",onClick:a},{default:i.withCtx(()=>[i.createVNode(p)]),_:1},8,["disabled"])]),default:i.withCtx(()=>[d[1]||(d[1]=i.createTextVNode(" Сохранить изменения "))]),_:1,__:[1]},8,["disabled"])):i.createCommentVNode("",!0),c.showCancelButton?(i.openBlock(),i.createBlock(f,{key:2,placement:"bottom"},{trigger:i.withCtx(()=>[i.createVNode(u,{disabled:c.disabled||r.value,type:"error",size:"small",onClick:l},{default:i.withCtx(()=>[i.createVNode(g)]),_:1},8,["disabled"])]),default:i.withCtx(()=>[d[2]||(d[2]=i.createTextVNode(" Отменить изменения "))]),_:1,__:[2]})):i.createCommentVNode("",!0)]),i.renderSlot(c.$slots,"extra-buttons")])])])}}}),f_={},Mc=i.defineComponent({...f_,__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(e,{emit:t}){const n=e,r=t,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(l,c)=>(i.openBlock(),i.createElementBlock("div",null,[s.value?(i.openBlock(),i.createBlock(ho,{key:1,disabled:l.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(ho,{key:0,disabled:l.disabled,"show-edit-button":l.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"]))]))}}),p_={},g_=i.defineComponent({...p_,__name:"debounced-input",props:{value:{default:void 0},clearable:{type:Boolean,default:!1},debounceTime:{default:800},placeholder:{default:""}},emits:["update:value"],setup(e,{emit:t}){const n=e,r=t,s=i.ref(n.value),o=i.computed(()=>i.inject("debounce-input-time",n.debounceTime)),a=W.debounce(()=>r("update:value",s.value),o.value),l=c=>{s.value=c,a()};return i.watch(()=>n.value,c=>{s.value=c}),(c,d)=>(i.openBlock(),i.createBlock(i.unref(V.NInput),{value:s.value,"onUpdate:value":[d[0]||(d[0]=h=>s.value=h),l],clearable:c.clearable,placeholder:c.placeholder},{prefix:i.withCtx(()=>[i.renderSlot(c.$slots,"prefix")]),_:3},8,["value","clearable","placeholder"]))}}),m_={},__=i.defineComponent({...m_,__name:"phone-input",props:{value:{},debounceTime:{},disabled:{type:Boolean},placeholder:{},defaultCountry:{},preferredCountries:{},onlyCountries:{}},emits:["update:value"],setup(e,{emit:t}){const n=e,r=t,s=i.ref((n.value??"").replaceAll(/\D*/g,"")),o=W.debounce(c=>r("update:value",c),n.debounceTime??0),a=c=>{let d="";if(W.isString(c))s.value=c,d=c.replaceAll(/(\s|\(|\)|-|_)*/g,"");else if(W.isObject(c)){if(s.value=c.formatted,!c.valid)return;d=c instanceof Wi.PhoneNumber?c.format("E.164"):`+${c.countryCallingCode}${c.nationalNumber}`}n.debounceTime?o(d):r("update:value",d)},l=c=>{const d=c.replaceAll(/\D*/g,"");try{const h=Wi.parsePhoneNumberWithError(`+${d}`);h.isValid()?s.value=h.format("E.164"):h.getPossibleCountries().length>0&&(s.value=`+${d}`)}catch(h){if(h instanceof Wi.ParseError)s.value=d;else throw h}};return i.watch(()=>n.value,c=>{var d;(c==null?void 0:c.replaceAll(/\D*/g,""))!==((d=s.value)==null?void 0:d.replaceAll(/\D*/g,""))&&l(c)},{immediate:!0}),i.onBeforeMount(()=>l(s.value??"")),(c,d)=>(i.openBlock(),i.createBlock(i.unref(Ih.VueTelInput),{modelValue:s.value,"onUpdate:modelValue":[d[0]||(d[0]=h=>s.value=h),a],"auto-default-country":!1,"auto-format":!0,"default-country":c.defaultCountry,disabled:c.disabled,"input-options":{placeholder:c.placeholder},"preferred-countries":c.preferredCountries,"only-countries":c.onlyCountries,mode:"international",class:"tel-input"},null,8,["modelValue","default-country","disabled","input-options","preferred-countries","only-countries"]))}}),y_=Ln(__,[["__scopeId","data-v-751dbb0e"]]),b_={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function w_(e,t){return i.openBlock(),i.createElementBlock("svg",b_,t[0]||(t[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 v_=i.markRaw({name:"tabler-external-link",render:w_}),k_={class:"flex flex-row gap-1 hover:underline hover:decoration-dashed"},x_=["href"],C_={},S_=i.defineComponent({...C_,__name:"external-link",props:{text:{},url:{},description:{}},setup(e){return(t,n)=>{const r=v_,s=V.NTooltip;return i.openBlock(),i.createBlock(s,{disabled:i.unref(W.isUndefined)(t.description),placement:"top-start"},{trigger:i.withCtx(()=>[i.createElementVNode("span",k_,[i.createElementVNode("a",{href:t.url,target:"_blank",class:"no-underline"},i.toDisplayString(t.text),9,x_),i.createVNode(r,{class:"mt-0.5 flex-none"})])]),default:i.withCtx(()=>[i.createTextVNode(" "+i.toDisplayString(t.description),1)]),_:1},8,["disabled"])}}}),B_={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function T_(e,t){return i.openBlock(),i.createElementBlock("svg",B_,t[0]||(t[0]=[i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-miterlimit":"10","stroke-width":"32",d:"M448 256c0-106-86-192-192-192S64 150 64 256s86 192 192 192s192-86 192-192Z"},null,-1),i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M336 256H176"},null,-1)]))}const E_=i.markRaw({name:"ion-remove-circle-outline",render:T_});let Qr=[];const Ac=new WeakMap;function $_(){Qr.forEach(e=>e(...Ac.get(e))),Qr=[]}function Oc(e,...t){Ac.set(e,t),!Qr.includes(e)&&Qr.push(e)===1&&requestAnimationFrame($_)}function sr(e,t){let{target:n}=e;for(;n;){if(n.dataset&&n.dataset[t]!==void 0)return!0;n=n.parentElement}return!1}function or(e){return e.composedPath()[0]||null}function ar(e){return typeof e=="string"?e.endsWith("px")?Number(e.slice(0,e.length-2)):Number(e):e}function lr(e){if(e!=null)return typeof e=="number"?`${e}px`:e.endsWith("px")?e:`${e}px`}function Ht(e,t){const n=e.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]:"+e+" is not a valid value.")}return t===void 0?r:r[t]}const Vc={aliceblue:"#F0F8FF",antiquewhite:"#FAEBD7",aqua:"#0FF",aquamarine:"#7FFFD4",azure:"#F0FFFF",beige:"#F5F5DC",bisque:"#FFE4C4",black:"#000",blanchedalmond:"#FFEBCD",blue:"#00F",blueviolet:"#8A2BE2",brown:"#A52A2A",burlywood:"#DEB887",cadetblue:"#5F9EA0",chartreuse:"#7FFF00",chocolate:"#D2691E",coral:"#FF7F50",cornflowerblue:"#6495ED",cornsilk:"#FFF8DC",crimson:"#DC143C",cyan:"#0FF",darkblue:"#00008B",darkcyan:"#008B8B",darkgoldenrod:"#B8860B",darkgray:"#A9A9A9",darkgrey:"#A9A9A9",darkgreen:"#006400",darkkhaki:"#BDB76B",darkmagenta:"#8B008B",darkolivegreen:"#556B2F",darkorange:"#FF8C00",darkorchid:"#9932CC",darkred:"#8B0000",darksalmon:"#E9967A",darkseagreen:"#8FBC8F",darkslateblue:"#483D8B",darkslategray:"#2F4F4F",darkslategrey:"#2F4F4F",darkturquoise:"#00CED1",darkviolet:"#9400D3",deeppink:"#FF1493",deepskyblue:"#00BFFF",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1E90FF",firebrick:"#B22222",floralwhite:"#FFFAF0",forestgreen:"#228B22",fuchsia:"#F0F",gainsboro:"#DCDCDC",ghostwhite:"#F8F8FF",gold:"#FFD700",goldenrod:"#DAA520",gray:"#808080",grey:"#808080",green:"#008000",greenyellow:"#ADFF2F",honeydew:"#F0FFF0",hotpink:"#FF69B4",indianred:"#CD5C5C",indigo:"#4B0082",ivory:"#FFFFF0",khaki:"#F0E68C",lavender:"#E6E6FA",lavenderblush:"#FFF0F5",lawngreen:"#7CFC00",lemonchiffon:"#FFFACD",lightblue:"#ADD8E6",lightcoral:"#F08080",lightcyan:"#E0FFFF",lightgoldenrodyellow:"#FAFAD2",lightgray:"#D3D3D3",lightgrey:"#D3D3D3",lightgreen:"#90EE90",lightpink:"#FFB6C1",lightsalmon:"#FFA07A",lightseagreen:"#20B2AA",lightskyblue:"#87CEFA",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#B0C4DE",lightyellow:"#FFFFE0",lime:"#0F0",limegreen:"#32CD32",linen:"#FAF0E6",magenta:"#F0F",maroon:"#800000",mediumaquamarine:"#66CDAA",mediumblue:"#0000CD",mediumorchid:"#BA55D3",mediumpurple:"#9370DB",mediumseagreen:"#3CB371",mediumslateblue:"#7B68EE",mediumspringgreen:"#00FA9A",mediumturquoise:"#48D1CC",mediumvioletred:"#C71585",midnightblue:"#191970",mintcream:"#F5FFFA",mistyrose:"#FFE4E1",moccasin:"#FFE4B5",navajowhite:"#FFDEAD",navy:"#000080",oldlace:"#FDF5E6",olive:"#808000",olivedrab:"#6B8E23",orange:"#FFA500",orangered:"#FF4500",orchid:"#DA70D6",palegoldenrod:"#EEE8AA",palegreen:"#98FB98",paleturquoise:"#AFEEEE",palevioletred:"#DB7093",papayawhip:"#FFEFD5",peachpuff:"#FFDAB9",peru:"#CD853F",pink:"#FFC0CB",plum:"#DDA0DD",powderblue:"#B0E0E6",purple:"#800080",rebeccapurple:"#663399",red:"#F00",rosybrown:"#BC8F8F",royalblue:"#4169E1",saddlebrown:"#8B4513",salmon:"#FA8072",sandybrown:"#F4A460",seagreen:"#2E8B57",seashell:"#FFF5EE",sienna:"#A0522D",silver:"#C0C0C0",skyblue:"#87CEEB",slateblue:"#6A5ACD",slategray:"#708090",slategrey:"#708090",snow:"#FFFAFA",springgreen:"#00FF7F",steelblue:"#4682B4",tan:"#D2B48C",teal:"#008080",thistle:"#D8BFD8",tomato:"#FF6347",turquoise:"#40E0D0",violet:"#EE82EE",wheat:"#F5DEB3",white:"#FFF",whitesmoke:"#F5F5F5",yellow:"#FF0",yellowgreen:"#9ACD32",transparent:"#0000"};function N_(e,t,n){t/=100,n/=100;let r=(s,o=(s+e/60)%6)=>n-n*t*Math.max(Math.min(o,4-o,1),0);return[r(5)*255,r(3)*255,r(1)*255]}function P_(e,t,n){t/=100,n/=100;let r=t*Math.min(n,1-n),s=(o,a=(o+e/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 Qt="^\\s*",en="\\s*$",Pn="\\s*((\\.\\d+)|(\\d+(\\.\\d*)?))%\\s*",Ft="\\s*((\\.\\d+)|(\\d+(\\.\\d*)?))\\s*",ni="([0-9A-Fa-f])",ii="([0-9A-Fa-f]{2})",zc=new RegExp(`${Qt}hsl\\s*\\(${Ft},${Pn},${Pn}\\)${en}`),Ic=new RegExp(`${Qt}hsv\\s*\\(${Ft},${Pn},${Pn}\\)${en}`),Lc=new RegExp(`${Qt}hsla\\s*\\(${Ft},${Pn},${Pn},${Ft}\\)${en}`),Dc=new RegExp(`${Qt}hsva\\s*\\(${Ft},${Pn},${Pn},${Ft}\\)${en}`),R_=new RegExp(`${Qt}rgb\\s*\\(${Ft},${Ft},${Ft}\\)${en}`),F_=new RegExp(`${Qt}rgba\\s*\\(${Ft},${Ft},${Ft},${Ft}\\)${en}`),M_=new RegExp(`${Qt}#${ni}${ni}${ni}${en}`),A_=new RegExp(`${Qt}#${ii}${ii}${ii}${en}`),O_=new RegExp(`${Qt}#${ni}${ni}${ni}${ni}${en}`),V_=new RegExp(`${Qt}#${ii}${ii}${ii}${ii}${en}`);function St(e){return parseInt(e,16)}function z_(e){try{let t;if(t=Lc.exec(e))return[ts(t[1]),Rn(t[5]),Rn(t[9]),si(t[13])];if(t=zc.exec(e))return[ts(t[1]),Rn(t[5]),Rn(t[9]),1];throw new Error(`[seemly/hsla]: Invalid color value ${e}.`)}catch(t){throw t}}function I_(e){try{let t;if(t=Dc.exec(e))return[ts(t[1]),Rn(t[5]),Rn(t[9]),si(t[13])];if(t=Ic.exec(e))return[ts(t[1]),Rn(t[5]),Rn(t[9]),1];throw new Error(`[seemly/hsva]: Invalid color value ${e}.`)}catch(t){throw t}}function ri(e){try{let t;if(t=A_.exec(e))return[St(t[1]),St(t[2]),St(t[3]),1];if(t=R_.exec(e))return[ct(t[1]),ct(t[5]),ct(t[9]),1];if(t=F_.exec(e))return[ct(t[1]),ct(t[5]),ct(t[9]),si(t[13])];if(t=M_.exec(e))return[St(t[1]+t[1]),St(t[2]+t[2]),St(t[3]+t[3]),1];if(t=V_.exec(e))return[St(t[1]),St(t[2]),St(t[3]),si(St(t[4])/255)];if(t=O_.exec(e))return[St(t[1]+t[1]),St(t[2]+t[2]),St(t[3]+t[3]),si(St(t[4]+t[4])/255)];if(e in Vc)return ri(Vc[e]);if(zc.test(e)||Lc.test(e)){const[n,r,s,o]=z_(e);return[...P_(n,r,s),o]}else if(Ic.test(e)||Dc.test(e)){const[n,r,s,o]=I_(e);return[...N_(n,r,s),o]}throw new Error(`[seemly/rgba]: Invalid color value ${e}.`)}catch(t){throw t}}function L_(e){return e>1?1:e<0?0:e}function uo(e,t,n,r){return`rgba(${ct(e)}, ${ct(t)}, ${ct(n)}, ${L_(r)})`}function fo(e,t,n,r,s){return ct((e*t*(1-r)+n*r)/s)}function D_(e,t){Array.isArray(e)||(e=ri(e)),Array.isArray(t)||(t=ri(t));const n=e[3],r=t[3],s=si(n+r-n*r);return uo(fo(e[0],n,t[0],r,s),fo(e[1],n,t[1],r,s),fo(e[2],n,t[2],r,s),s)}function Re(e,t){const[n,r,s,o=1]=Array.isArray(e)?e:ri(e);return typeof t.alpha=="number"?uo(n,r,s,t.alpha):uo(n,r,s,o)}function es(e,t){const[n,r,s,o=1]=Array.isArray(e)?e:ri(e),{lightness:a=1,alpha:l=1}=t;return H_([n*a,r*a,s*a,o*l])}function si(e){const t=Math.round(Number(e)*100)/100;return t>1?1:t<0?0:t}function ts(e){const t=Math.round(Number(e));return t>=360||t<0?0:t}function ct(e){const t=Math.round(Number(e));return t>255?255:t<0?0:t}function Rn(e){const t=Math.round(Number(e));return t>100?100:t<0?0:t}function H_(e){const[t,n,r]=e;return 3 in e?`rgba(${ct(t)}, ${ct(n)}, ${ct(r)}, ${si(e[3])})`:`rgba(${ct(t)}, ${ct(n)}, ${ct(r)}, 1)`}function W_(e=8){return Math.random().toString(16).slice(2,2+e)}function Hc(e){return Array.isArray(e)?e:[e]}const po={STOP:"STOP"};function Wc(e,t){const n=t(e);e.children!==void 0&&n!==po.STOP&&e.children.forEach(r=>Wc(r,t))}function j_(e,t={}){const{preserveGroup:n=!1}=t,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(e),r}function X_(e,t){const{isLeaf:n}=e;return n!==void 0?n:!t(e)}function q_(e){return e.children}function Y_(e){return e.key}function U_(){return!1}function G_(e,t){const{isLeaf:n}=e;return!(n===!1&&!Array.isArray(t(e)))}function K_(e){return e.disabled===!0}function Z_(e,t){return e.isLeaf===!1&&!Array.isArray(t(e))}function J_(e,t){if(e.isLeaf===!0){const n=t(e);if(Array.isArray(n)&&n.length>0)return!0}return!1}function go(e){var t;return e==null?[]:Array.isArray(e)?e:(t=e.checkedKeys)!==null&&t!==void 0?t:[]}function mo(e){var t;return e==null||Array.isArray(e)?[]:(t=e.indeterminateKeys)!==null&&t!==void 0?t:[]}function Q_(e,t){const n=new Set(e);return t.forEach(r=>{n.has(r)||n.add(r)}),Array.from(n)}function ey(e,t){const n=new Set(e);return t.forEach(r=>{n.has(r)&&n.delete(r)}),Array.from(n)}function ty(e){return(e==null?void 0:e.type)==="group"}function ny(e){const t=new Map;return e.forEach((n,r)=>{t.set(n.key,r)}),n=>{var r;return(r=t.get(n))!==null&&r!==void 0?r:null}}class iy extends Error{constructor(){super(),this.message="SubtreeNotLoadedError: checking a subtree whose required nodes are not fully loaded."}}function ry(e,t,n,r){return ns(t.concat(e),n,r,!1)}function sy(e,t){const n=new Set;return e.forEach(r=>{const s=t.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 oy(e,t,n,r){const s=ns(t,n,r,!1),o=ns(e,n,r,!0),a=sy(e,n),l=[];return s.forEach(c=>{(o.has(c)||a.has(c))&&l.push(c)}),l.forEach(c=>s.delete(c)),s}function _o(e,t){const{checkedKeys:n,keysToCheck:r,keysToUncheck:s,indeterminateKeys:o,cascade:a,leafOnly:l,checkStrategy:c,allowNotLoaded:d}=e;if(!a)return r!==void 0?{checkedKeys:Q_(n,r),indeterminateKeys:Array.from(o)}:s!==void 0?{checkedKeys:ey(n,s),indeterminateKeys:Array.from(o)}:{checkedKeys:Array.from(n),indeterminateKeys:Array.from(o)};const{levelTreeNodeMap:h}=t;let u;s!==void 0?u=oy(s,n,t,d):r!==void 0?u=ry(r,n,t,d):u=ns(n,t,d,!1);const f=c==="parent",p=c==="child"||l,g=u,m=new Set,_=Math.max.apply(null,Array.from(h.keys()));for(let y=_;y>=0;y-=1){const b=y===0,S=h.get(y);for(const x of S){if(x.isLeaf)continue;const{key:C,shallowLoaded:B}=x;if(p&&B&&x.children.forEach(R=>{!R.disabled&&!R.isLeaf&&R.shallowLoaded&&g.has(R.key)&&g.delete(R.key)}),x.disabled||!B)continue;let v=!0,$=!1,F=!0;for(const R of x.children){const X=R.key;if(!R.disabled){if(F&&(F=!1),g.has(X))$=!0;else if(m.has(X)){$=!0,v=!1;break}else if(v=!1,$)break}}v&&!F?(f&&x.children.forEach(R=>{!R.disabled&&g.has(R.key)&&g.delete(R.key)}),g.add(C)):$&&m.add(C),b&&p&&g.has(C)&&g.delete(C)}}return{checkedKeys:Array.from(g),indeterminateKeys:Array.from(m)}}function ns(e,t,n,r){const{treeNodeMap:s,getChildren:o}=t,a=new Set,l=new Set(e);return e.forEach(c=>{const d=s.get(c);d!==void 0&&Wc(d,h=>{if(h.disabled)return po.STOP;const{key:u}=h;if(!a.has(u)&&(a.add(u),l.add(u),Z_(h.rawNode,o))){if(r)return po.STOP;if(!n)throw new iy}})}),l}function ay(e,{includeGroup:t=!1,includeSelf:n=!0},r){var s;const o=r.treeNodeMap;let a=e==null?null:(s=o.get(e))!==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&&(t||!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 ly(e){if(e.length===0)return null;const t=e[0];return t.isGroup||t.ignored||t.disabled?t.getNext():t}function cy(e,t){const n=e.siblings,r=n.length,{index:s}=e;return t?n[(s+1)%r]:s===n.length-1?null:n[s+1]}function jc(e,t,{loop:n=!1,includeDisabled:r=!1}={}){const s=t==="prev"?dy:cy,o={reverse:t==="prev"};let a=!1,l=null;function c(d){if(d!==null){if(d===e){if(!a)a=!0;else if(!e.disabled&&!e.isGroup){l=e;return}}else if((!d.disabled||r)&&!d.ignored&&!d.isGroup){l=d;return}if(d.isGroup){const h=yo(d,o);h!==null?l=h:c(s(d,n))}else{const h=s(d,!1);if(h!==null)c(h);else{const u=hy(d);u!=null&&u.isGroup?c(s(u,n)):n&&c(s(d,!0))}}}}return c(e),l}function dy(e,t){const n=e.siblings,r=n.length,{index:s}=e;return t?n[(s-1+r)%r]:s===0?null:n[s-1]}function hy(e){return e.parent}function yo(e,t={}){const{reverse:n=!1}=t,{children:r}=e;if(r){const{length:s}=r,o=n?s-1:0,a=n?-1:s,l=n?-1:1;for(let c=o;c!==a;c+=l){const d=r[c];if(!d.disabled&&!d.ignored)if(d.isGroup){const h=yo(d,t);if(h!==null)return h}else return d}}return null}const uy={getChild(){return this.ignored?null:yo(this)},getParent(){const{parent:e}=this;return e!=null&&e.isGroup?e.getParent():e},getNext(e={}){return jc(this,"next",e)},getPrev(e={}){return jc(this,"prev",e)}};function fy(e,t){const n=t?new Set(t):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(e),r}function py(e,t){const n=e.key;for(;t;){if(t.key===n)return!0;t=t.parent}return!1}var gy={};function Xc(e,t,n,r,s,o=null,a=0){const l=[];return e.forEach((c,d)=>{var h;gy.NODE_ENV!=="production"&&J_(c,s)&&console.error("[treemate]: node",c,"is invalid");const u=Object.create(r);if(u.rawNode=c,u.siblings=l,u.level=a,u.index=d,u.isFirstChild=d===0,u.isLastChild=d+1===e.length,u.parent=o,!u.ignored){const f=s(c);Array.isArray(f)&&(u.children=Xc(f,t,n,r,s,u,a+1))}l.push(u),t.set(u.key,u),n.has(a)||n.set(a,[]),(h=n.get(a))===null||h===void 0||h.push(u)}),l}function my(e,t={}){var n;const r=new Map,s=new Map,{getDisabled:o=K_,getIgnored:a=U_,getIsGroup:l=ty,getKey:c=Y_}=t,d=(n=t.getChildren)!==null&&n!==void 0?n:q_,h=t.ignoreEmptyChildren?x=>{const C=d(x);return Array.isArray(C)?C.length?C:null:C}:d,u=Object.assign({get key(){return c(this.rawNode)},get disabled(){return o(this.rawNode)},get isGroup(){return l(this.rawNode)},get isLeaf(){return X_(this.rawNode,h)},get shallowLoaded(){return G_(this.rawNode,h)},get ignored(){return a(this.rawNode)},contains(x){return py(this,x)}},uy),f=Xc(e,r,s,u,h);function p(x){if(x==null)return null;const C=r.get(x);return C&&!C.isGroup&&!C.ignored?C:null}function g(x){if(x==null)return null;const C=r.get(x);return C&&!C.ignored?C:null}function m(x,C){const B=g(x);return B?B.getPrev(C):null}function _(x,C){const B=g(x);return B?B.getNext(C):null}function y(x){const C=g(x);return C?C.getParent():null}function b(x){const C=g(x);return C?C.getChild():null}const S={treeNodes:f,treeNodeMap:r,levelTreeNodeMap:s,maxLevel:Math.max(...s.keys()),getChildren:h,getFlattenedNodes(x){return fy(f,x)},getNode:p,getPrev:m,getNext:_,getParent:y,getChild:b,getFirstAvailableNode(){return ly(f)},getPath(x,C={}){return ay(x,C,S)},getCheckedKeys(x,C={}){const{cascade:B=!0,leafOnly:v=!1,checkStrategy:$="all",allowNotLoaded:F=!1}=C;return _o({checkedKeys:go(x),indeterminateKeys:mo(x),cascade:B,leafOnly:v,checkStrategy:$,allowNotLoaded:F},S)},check(x,C,B={}){const{cascade:v=!0,leafOnly:$=!1,checkStrategy:F="all",allowNotLoaded:R=!1}=B;return _o({checkedKeys:go(C),indeterminateKeys:mo(C),keysToCheck:x==null?[]:Hc(x),cascade:v,leafOnly:$,checkStrategy:F,allowNotLoaded:R},S)},uncheck(x,C,B={}){const{cascade:v=!0,leafOnly:$=!1,checkStrategy:F="all",allowNotLoaded:R=!1}=B;return _o({checkedKeys:go(C),indeterminateKeys:mo(C),keysToUncheck:x==null?[]:Hc(x),cascade:v,leafOnly:$,checkStrategy:F,allowNotLoaded:R},S)},getNonLeafKeys(x={}){return j_(f,x)}};return S}function is(e){return e.composedPath()[0]}const _y={mousemoveoutside:new WeakMap,clickoutside:new WeakMap};function yy(e,t,n){if(e==="mousemoveoutside"){const r=s=>{t.contains(is(s))||n(s)};return{mousemove:r,touchstart:r}}else if(e==="clickoutside"){let r=!1;const s=a=>{r=!t.contains(is(a))},o=a=>{r&&(t.contains(is(a))||n(a))};return{mousedown:s,mouseup:o,touchstart:s,touchend:o}}return console.error(`[evtd/create-trap-handler]: name \`${e}\` is invalid. This could be a bug of evtd.`),{}}function qc(e,t,n){const r=_y[e];let s=r.get(t);s===void 0&&r.set(t,s=new WeakMap);let o=s.get(n);return o===void 0&&s.set(n,o=yy(e,t,n)),o}function by(e,t,n,r){if(e==="mousemoveoutside"||e==="clickoutside"){const s=qc(e,t,n);return Object.keys(s).forEach(o=>{bt(o,document,s[o],r)}),!0}return!1}function wy(e,t,n,r){if(e==="mousemoveoutside"||e==="clickoutside"){const s=qc(e,t,n);return Object.keys(s).forEach(o=>{Qe(o,document,s[o],r)}),!0}return!1}function vy(){if(typeof window>"u")return{on:()=>{},off:()=>{}};const e=new WeakMap,t=new WeakMap;function n(){e.set(this,!0)}function r(){e.set(this,!0),t.set(this,!0)}function s(v,$,F){const R=v[$];return v[$]=function(){return F.apply(v,arguments),R.apply(v,arguments)},v}function o(v,$){v[$]=Event.prototype[$]}const a=new WeakMap,l=Object.getOwnPropertyDescriptor(Event.prototype,"currentTarget");function c(){var v;return(v=a.get(this))!==null&&v!==void 0?v:null}function d(v,$){l!==void 0&&Object.defineProperty(v,"currentTarget",{configurable:!0,enumerable:!0,get:$??l.get})}const h={bubble:{},capture:{}},u={};function f(){const v=function($){const{type:F,eventPhase:R,bubbles:X}=$,M=is($);if(R===2)return;const N=R===1?"capture":"bubble";let A=M;const L=[];for(;A===null&&(A=window),L.push(A),A!==window;)A=A.parentNode||null;const U=h.capture[F],P=h.bubble[F];if(s($,"stopPropagation",n),s($,"stopImmediatePropagation",r),d($,c),N==="capture"){if(U===void 0)return;for(let E=L.length-1;E>=0&&!e.has($);--E){const H=L[E],I=U.get(H);if(I!==void 0){a.set($,H);for(const G of I){if(t.has($))break;G($)}}if(E===0&&!X&&P!==void 0){const G=P.get(H);if(G!==void 0)for(const O of G){if(t.has($))break;O($)}}}}else if(N==="bubble"){if(P===void 0)return;for(let E=0;E<L.length&&!e.has($);++E){const H=L[E],I=P.get(H);if(I!==void 0){a.set($,H);for(const G of I){if(t.has($))break;G($)}}}}o($,"stopPropagation"),o($,"stopImmediatePropagation"),d($)};return v.displayName="evtdUnifiedHandler",v}function p(){const v=function($){const{type:F,eventPhase:R}=$;if(R!==2)return;const X=u[F];X!==void 0&&X.forEach(M=>M($))};return v.displayName="evtdUnifiedWindowEventHandler",v}const g=f(),m=p();function _(v,$){const F=h[v];return F[$]===void 0&&(F[$]=new Map,window.addEventListener($,g,v==="capture")),F[$]}function y(v){return u[v]===void 0&&(u[v]=new Set,window.addEventListener(v,m)),u[v]}function b(v,$){let F=v.get($);return F===void 0&&v.set($,F=new Set),F}function S(v,$,F,R){const X=h[$][F];if(X!==void 0){const M=X.get(v);if(M!==void 0&&M.has(R))return!0}return!1}function x(v,$){const F=u[v];return!!(F!==void 0&&F.has($))}function C(v,$,F,R){let X;if(typeof R=="object"&&R.once===!0?X=U=>{B(v,$,X,R),F(U)}:X=F,by(v,$,X,R))return;const N=R===!0||typeof R=="object"&&R.capture===!0?"capture":"bubble",A=_(N,v),L=b(A,$);if(L.has(X)||L.add(X),$===window){const U=y(v);U.has(X)||U.add(X)}}function B(v,$,F,R){if(wy(v,$,F,R))return;const M=R===!0||typeof R=="object"&&R.capture===!0,N=M?"capture":"bubble",A=_(N,v),L=b(A,$);if($===window&&!S($,M?"bubble":"capture",v,F)&&x(v,F)){const P=u[v];P.delete(F),P.size===0&&(window.removeEventListener(v,m),u[v]=void 0)}L.has(F)&&L.delete(F),L.size===0&&A.delete($),A.size===0&&(window.removeEventListener(v,g,N==="capture"),h[N][v]=void 0)}return{on:C,off:B}}const{on:bt,off:Qe}=vy(),Mi="@@mmoContext",ky={mounted(e,{value:t}){e[Mi]={handler:void 0},typeof t=="function"&&(e[Mi].handler=t,bt("mousemoveoutside",e,t))},updated(e,{value:t}){const n=e[Mi];typeof t=="function"?n.handler?n.handler!==t&&(Qe("mousemoveoutside",e,n.handler),n.handler=t,bt("mousemoveoutside",e,t)):(e[Mi].handler=t,bt("mousemoveoutside",e,t)):n.handler&&(Qe("mousemoveoutside",e,n.handler),n.handler=void 0)},unmounted(e){const{handler:t}=e[Mi];t&&Qe("mousemoveoutside",e,t),e[Mi].handler=void 0}},Ai="@@coContext",rs={mounted(e,{value:t,modifiers:n}){e[Ai]={handler:void 0},typeof t=="function"&&(e[Ai].handler=t,bt("clickoutside",e,t,{capture:n.capture}))},updated(e,{value:t,modifiers:n}){const r=e[Ai];typeof t=="function"?r.handler?r.handler!==t&&(Qe("clickoutside",e,r.handler,{capture:n.capture}),r.handler=t,bt("clickoutside",e,t,{capture:n.capture})):(e[Ai].handler=t,bt("clickoutside",e,t,{capture:n.capture})):r.handler&&(Qe("clickoutside",e,r.handler,{capture:n.capture}),r.handler=void 0)},unmounted(e,{modifiers:t}){const{handler:n}=e[Ai];n&&Qe("clickoutside",e,n,{capture:t.capture}),e[Ai].handler=void 0}};function xy(e,t){console.error(`[vdirs/${e}]: ${t}`)}class Cy{constructor(){this.elementZIndex=new Map,this.nextZIndex=2e3}get elementCount(){return this.elementZIndex.size}ensureZIndex(t,n){const{elementZIndex:r}=this;if(n!==void 0){t.style.zIndex=`${n}`,r.delete(t);return}const{nextZIndex:s}=this;r.has(t)&&r.get(t)+1===this.nextZIndex||(t.style.zIndex=`${s}`,r.set(t,s),this.nextZIndex=s+1,this.squashState())}unregister(t,n){const{elementZIndex:r}=this;r.has(t)?r.delete(t):n===void 0&&xy("z-index-manager/unregister-element","Element not found when unregistering."),this.squashState()}squashState(){const{elementCount:t}=this;t||(this.nextZIndex=2e3),this.nextZIndex-t>2500&&this.rearrange()}rearrange(){const t=Array.from(this.elementZIndex.entries());t.sort((n,r)=>n[1]-r[1]),this.nextZIndex=2e3,t.forEach(n=>{const r=n[0],s=this.nextZIndex++;`${s}`!==r.style.zIndex&&(r.style.zIndex=`${s}`)})}}const bo=new Cy,Oi="@@ziContext",Yc={mounted(e,t){const{value:n={}}=t,{zIndex:r,enabled:s}=n;e[Oi]={enabled:!!s,initialized:!1},s&&(bo.ensureZIndex(e,r),e[Oi].initialized=!0)},updated(e,t){const{value:n={}}=t,{zIndex:r,enabled:s}=n,o=e[Oi].enabled;s&&!o&&(bo.ensureZIndex(e,r),e[Oi].initialized=!0),e[Oi].enabled=!!s},unmounted(e,t){if(!e[Oi].initialized)return;const{value:n={}}=t,{zIndex:r}=n;bo.unregister(e,r)}};function Sy(e){const t=i.ref(!!e.value);if(t.value)return i.readonly(t);const n=i.watch(e,r=>{r&&(t.value=!0,n())});return i.readonly(t)}function zt(e){const t=i.computed(e),n=i.ref(t.value);return i.watch(t,r=>{n.value=r}),typeof e=="function"?n:{__v_isRef:!0,get value(){return n.value},set value(r){e.set(r)}}}const By=typeof window<"u";let Vi,cr;(()=>{var e,t;Vi=By?(t=(e=document)===null||e===void 0?void 0:e.fonts)===null||t===void 0?void 0:t.ready:void 0,cr=!1,Vi!==void 0?Vi.then(()=>{cr=!0}):cr=!0})();function Ty(e){if(cr)return;let t=!1;i.onMounted(()=>{cr||Vi==null||Vi.then(()=>{t||e()})}),i.onBeforeUnmount(()=>{t=!0})}function wo(e,t){return i.watch(e,n=>{n!==void 0&&(t.value=n)}),i.computed(()=>e.value===void 0?t.value:e.value)}function ss(){const e=i.ref(!1);return i.onMounted(()=>{e.value=!0}),i.readonly(e)}function Uc(e,t){return i.computed(()=>{for(const n of t)if(e[n]!==void 0)return e[n];return e[t[t.length-1]]})}const Ey=(typeof window>"u"?!1:/iPad|iPhone|iPod/.test(navigator.platform)||navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1)&&!window.MSStream;function $y(){return Ey}function vo(e,t,n="default"){const r=t[n];if(r===void 0)throw new Error(`[vueuc/${e}]: slot[${n}] is empty.`);return r()}function ko(e,t=!0,n=[]){return e.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)){ko(r,t,n);return}if(r.type===i.Fragment){if(r.children===null)return;Array.isArray(r.children)&&ko(r.children,t,n)}else r.type!==i.Comment&&n.push(r)}}),n}function Gc(e,t,n="default"){const r=t[n];if(r===void 0)throw new Error(`[vueuc/${e}]: slot[${n}] is empty.`);const s=ko(r());if(s.length===1)return s[0];throw new Error(`[vueuc/${e}]: slot[${n}] should have exactly one child.`)}let Fn=null;function Kc(){if(Fn===null&&(Fn=document.getElementById("v-binder-view-measurer"),Fn===null)){Fn=document.createElement("div"),Fn.id="v-binder-view-measurer";const{style:e}=Fn;e.position="fixed",e.left="0",e.right="0",e.top="0",e.bottom="0",e.pointerEvents="none",e.visibility="hidden",document.body.appendChild(Fn)}return Fn.getBoundingClientRect()}function Ny(e,t){const n=Kc();return{top:t,left:e,height:0,width:0,right:n.width-e,bottom:n.height-t}}function xo(e){const t=e.getBoundingClientRect(),n=Kc();return{left:t.left-n.left,top:t.top-n.top,bottom:n.height+n.top-t.bottom,right:n.width+n.left-t.right,width:t.width,height:t.height}}function Py(e){return e.nodeType===9?null:e.parentNode}function Zc(e){if(e===null)return null;const t=Py(e);if(t===null)return null;if(t.nodeType===9)return document;if(t.nodeType===1){const{overflow:n,overflowX:r,overflowY:s}=getComputedStyle(t);if(/(auto|scroll|overlay)/.test(n+s+r))return t}return Zc(t)}const Jc=i.defineComponent({name:"Binder",props:{syncTargetWithParent:Boolean,syncTarget:{type:Boolean,default:!0}},setup(e){var t;i.provide("VBinder",(t=i.getCurrentInstance())===null||t===void 0?void 0:t.proxy);const n=i.inject("VBinder",null),r=i.ref(null),s=y=>{r.value=y,n&&e.syncTargetWithParent&&n.setTargetRef(y)};let o=[];const a=()=>{let y=r.value;for(;y=Zc(y),y!==null;)o.push(y);for(const b of o)bt("scroll",b,u,!0)},l=()=>{for(const y of o)Qe("scroll",y,u,!0);o=[]},c=new Set,d=y=>{c.size===0&&a(),c.has(y)||c.add(y)},h=y=>{c.has(y)&&c.delete(y),c.size===0&&l()},u=()=>{Oc(f)},f=()=>{c.forEach(y=>y())},p=new Set,g=y=>{p.size===0&&bt("resize",window,_),p.has(y)||p.add(y)},m=y=>{p.has(y)&&p.delete(y),p.size===0&&Qe("resize",window,_)},_=()=>{p.forEach(y=>y())};return i.onBeforeUnmount(()=>{Qe("resize",window,_),l()}),{targetRef:r,setTargetRef:s,addScrollListener:d,removeScrollListener:h,addResizeListener:g,removeResizeListener:m}},render(){return vo("binder",this.$slots)}}),Qc=i.defineComponent({name:"Target",setup(){const{setTargetRef:e,syncTarget:t}=i.inject("VBinder");return{syncTarget:t,setTargetDirective:{mounted:e,updated:e}}},render(){const{syncTarget:e,setTargetDirective:t}=this;return e?i.withDirectives(Gc("follower",this.$slots),[[t]]):Gc("follower",this.$slots)}}),Ry="@css-render/vue3-ssr";function Fy(e,t){return`<style cssr-id="${e}">
|
104
104
|
${t}
|
105
105
|
</style>`}function My(e,t,n){const{styles:r,ids:s}=n;s.has(e)||r!==null&&(s.add(e),r.push(Fy(e,t)))}const Ay=typeof document<"u";function oi(){if(Ay)return;const e=i.inject(Ry,null);if(e!==null)return{adapter:(t,n)=>My(t,n,e),context:e}}function ed(e,t){console.error(`[vueuc/${e}]: ${t}`)}function Oy(e){let t=0;for(let n=0;n<e.length;++n)e[n]==="&"&&++t;return t}const td=/\s*,(?![^(]*\))\s*/g,Vy=/\s+/g;function zy(e,t){const n=[];return t.split(td).forEach(r=>{let s=Oy(r);if(s){if(s===1){e.forEach(a=>{n.push(r.replace("&",a))});return}}else{e.forEach(a=>{n.push((a&&a+" ")+r)});return}let o=[r];for(;s--;){const a=[];o.forEach(l=>{e.forEach(c=>{a.push(l.replace("&",c))})}),o=a}o.forEach(a=>n.push(a))}),n}function Iy(e,t){const n=[];return t.split(td).forEach(r=>{e.forEach(s=>{n.push((s&&s+" ")+r)})}),n}function Ly(e){let t=[""];return e.forEach(n=>{n=n&&n.trim(),n&&(n.includes("&")?t=zy(t,n):t=Iy(t,n))}),t.join(", ").replace(Vy," ")}function nd(e){if(!e)return;const t=e.parentElement;t&&t.removeChild(e)}function os(e,t){return(t??document.head).querySelector(`style[cssr-id="${e}"]`)}function Dy(e){const t=document.createElement("style");return t.setAttribute("cssr-id",e),t}function as(e){return e?/^\s*@(s|m)/.test(e):!1}const Hy=/[A-Z]/g;function id(e){return e.replace(Hy,t=>"-"+t.toLowerCase())}function Wy(e,t=" "){return typeof e=="object"&&e!==null?` {
|
106
106
|
`+Object.entries(e).map(n=>t+` ${id(n[0])}: ${n[1]};`).join(`
|
@@ -820,5 +820,5 @@ ${s}
|
|
820
820
|
`),ue("select-menu",`
|
821
821
|
margin: 4px 0;
|
822
822
|
box-shadow: var(--n-menu-box-shadow);
|
823
|
-
`,[yh({originalTransition:"background-color .3s var(--n-bezier), box-shadow .3s var(--n-bezier)"})])]);function bs(e){return e.type==="group"}function kh(e){return e.type==="ignored"}function Xo(e,t){try{return!!(1+t.toString().toLowerCase().indexOf(e.trim().toLowerCase()))}catch{return!1}}function Iw(e,t){return{getIsGroup:bs,getIgnored:kh,getKey(r){return bs(r)?r.name||r.key||"key-required":r[e]},getChildren(r){return r[t]}}}function Lw(e,t,n,r){if(!t)return e;function s(o){if(!Array.isArray(o))return[];const a=[];for(const l of o)if(bs(l)){const c=s(l[r]);c.length&&a.push(Object.assign({},l,{[r]:c}))}else{if(kh(l))continue;t(n,l)&&a.push(l)}return a}return s(e)}function Dw(e,t,n){const r=new Map;return e.forEach(s=>{bs(s)?s[n].forEach(o=>{r.set(o[t],o)}):r.set(s[t],s)}),r}var Hw={};const Ww=Object.assign(Object.assign({},ht.props),{to:pn.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}),jw=i.defineComponent({name:"Select",props:Ww,slots:Object,setup(e){Hw.NODE_ENV!=="production"&&i.watchEffect(()=>{e.items!==void 0&&An("select","`items` is deprecated, please use `options` instead."),e.onChange!==void 0&&An("select","`on-change` is deprecated, please use `on-update:value` instead.")});const{mergedClsPrefixRef:t,mergedBorderedRef:n,namespaceRef:r,inlineThemeDisabled:s}=hi(e),o=ht("Select","-select",zw,Vw,e,t),a=i.ref(e.defaultValue),l=i.toRef(e,"value"),c=wo(l,a),d=i.ref(!1),h=i.ref(""),u=Uc(e,["items","options"]),f=i.ref([]),p=i.ref([]),g=i.computed(()=>p.value.concat(f.value).concat(u.value)),m=i.computed(()=>{const{filter:T}=e;if(T)return T;const{labelField:D,valueField:Q}=e;return(le,ce)=>{if(!ce)return!1;const me=ce[D];if(typeof me=="string")return Xo(le,me);const be=ce[Q];return typeof be=="string"?Xo(le,be):typeof be=="number"?Xo(le,String(be)):!1}}),_=i.computed(()=>{if(e.remote)return u.value;{const{value:T}=g,{value:D}=h;return!D.length||!e.filterable?T:Lw(T,m.value,D,e.childrenField)}}),y=i.computed(()=>{const{valueField:T,childrenField:D}=e,Q=Iw(T,D);return my(_.value,Q)}),b=i.computed(()=>Dw(g.value,e.valueField,e.childrenField)),S=i.ref(!1),x=wo(i.toRef(e,"show"),S),C=i.ref(null),B=i.ref(null),v=i.ref(null),{localeRef:$}=nh("Select"),F=i.computed(()=>{var T;return(T=e.placeholder)!==null&&T!==void 0?T:$.value.placeholder}),R=[],X=i.ref(new Map),M=i.computed(()=>{const{fallbackOption:T}=e;if(T===void 0){const{labelField:D,valueField:Q}=e;return le=>({[D]:String(le),[Q]:le})}return T===!1?!1:D=>Object.assign(T(D),{value:D})});function N(T){const D=e.remote,{value:Q}=X,{value:le}=b,{value:ce}=M,me=[];return T.forEach(be=>{if(le.has(be))me.push(le.get(be));else if(D&&Q.has(be))me.push(Q.get(be));else if(ce){const ke=ce(be);ke&&me.push(ke)}}),me}const A=i.computed(()=>{if(e.multiple){const{value:T}=c;return Array.isArray(T)?N(T):[]}return null}),L=i.computed(()=>{const{value:T}=c;return!e.multiple&&!Array.isArray(T)?T===null?null:N([T])[0]||null:null}),U=Gb(e),{mergedSizeRef:P,mergedDisabledRef:E,mergedStatusRef:H}=U;function I(T,D){const{onChange:Q,"onUpdate:value":le,onUpdateValue:ce}=e,{nTriggerFormChange:me,nTriggerFormInput:be}=U;Q&&dt(Q,T,D),ce&&dt(ce,T,D),le&&dt(le,T,D),a.value=T,me(),be()}function G(T){const{onBlur:D}=e,{nTriggerFormBlur:Q}=U;D&&dt(D,T),Q()}function O(){const{onClear:T}=e;T&&dt(T)}function z(T){const{onFocus:D,showOnFocus:Q}=e,{nTriggerFormFocus:le}=U;D&&dt(D,T),le(),Q&&ie()}function J(T){const{onSearch:D}=e;D&&dt(D,T)}function pe(T){const{onScroll:D}=e;D&&dt(D,T)}function re(){var T;const{remote:D,multiple:Q}=e;if(D){const{value:le}=X;if(Q){const{valueField:ce}=e;(T=A.value)===null||T===void 0||T.forEach(me=>{le.set(me[ce],me)})}else{const ce=L.value;ce&&le.set(ce[e.valueField],ce)}}}function ge(T){const{onUpdateShow:D,"onUpdate:show":Q}=e;D&&dt(D,T),Q&&dt(Q,T),S.value=T}function ie(){E.value||(ge(!0),S.value=!0,e.filterable&&zn())}function Me(){ge(!1)}function xe(){h.value="",p.value=R}const Ce=i.ref(!1);function Fe(){e.filterable&&(Ce.value=!0)}function Ie(){e.filterable&&(Ce.value=!1,x.value||xe())}function vt(){E.value||(x.value?e.filterable?zn():Me():ie())}function xn(T){var D,Q;!((Q=(D=v.value)===null||D===void 0?void 0:D.selfRef)===null||Q===void 0)&&Q.contains(T.relatedTarget)||(d.value=!1,G(T),Me())}function Mt(T){z(T),d.value=!0}function Xt(){d.value=!0}function Tt(T){var D;!((D=C.value)===null||D===void 0)&&D.$el.contains(T.relatedTarget)||(d.value=!1,G(T),Me())}function mi(){var T;(T=C.value)===null||T===void 0||T.focus(),Me()}function _i(T){var D;x.value&&(!((D=C.value)===null||D===void 0)&&D.$el.contains(or(T))||Me())}function Vn(T){if(!Array.isArray(T))return[];if(M.value)return Array.from(T);{const{remote:D}=e,{value:Q}=b;if(D){const{value:le}=X;return T.filter(ce=>Q.has(ce)||le.has(ce))}else return T.filter(le=>Q.has(le))}}function on(T){st(T.rawNode)}function st(T){if(E.value)return;const{tag:D,remote:Q,clearFilterAfterSelect:le,valueField:ce}=e;if(D&&!Q){const{value:me}=p,be=me[0]||null;if(be){const ke=f.value;ke.length?ke.push(be):f.value=[be],p.value=R}}if(Q&&X.value.set(T[ce],T),e.multiple){const me=Vn(c.value),be=me.findIndex(ke=>ke===T[ce]);if(~be){if(me.splice(be,1),D&&!Q){const ke=te(T[ce]);~ke&&(f.value.splice(ke,1),le&&(h.value=""))}}else me.push(T[ce]),le&&(h.value="");I(me,N(me))}else{if(D&&!Q){const me=te(T[ce]);~me?f.value=[f.value[me]]:f.value=R}Di(),Me(),I(T[ce],T)}}function te(T){return f.value.findIndex(Q=>Q[e.valueField]===T)}function ne(T){x.value||ie();const{value:D}=T.target;h.value=D;const{tag:Q,remote:le}=e;if(J(D),Q&&!le){if(!D){p.value=R;return}const{onCreate:ce}=e,me=ce?ce(D):{[e.labelField]:D,[e.valueField]:D},{valueField:be,labelField:ke}=e;u.value.some(Xe=>Xe[be]===me[be]||Xe[ke]===me[ke])||f.value.some(Xe=>Xe[be]===me[be]||Xe[ke]===me[ke])?p.value=R:p.value=[me]}}function je(T){T.stopPropagation();const{multiple:D}=e;!D&&e.filterable&&Me(),O(),D?I([],[]):I(null,null)}function wr(T){!sr(T,"action")&&!sr(T,"empty")&&!sr(T,"header")&&T.preventDefault()}function Li(T){pe(T)}function yi(T){var D,Q,le,ce,me;if(!e.keyboard){T.preventDefault();return}switch(T.key){case" ":if(e.filterable)break;T.preventDefault();case"Enter":if(!(!((D=C.value)===null||D===void 0)&&D.isComposing)){if(x.value){const be=(Q=v.value)===null||Q===void 0?void 0:Q.getPendingTmNode();be?on(be):e.filterable||(Me(),Di())}else if(ie(),e.tag&&Ce.value){const be=p.value[0];if(be){const ke=be[e.valueField],{value:Xe}=c;e.multiple&&Array.isArray(Xe)&&Xe.includes(ke)||st(be)}}}T.preventDefault();break;case"ArrowUp":if(T.preventDefault(),e.loading)return;x.value&&((le=v.value)===null||le===void 0||le.prev());break;case"ArrowDown":if(T.preventDefault(),e.loading)return;x.value?(ce=v.value)===null||ce===void 0||ce.next():ie();break;case"Escape":x.value&&(Xb(T),Me()),(me=C.value)===null||me===void 0||me.focus();break}}function Di(){var T;(T=C.value)===null||T===void 0||T.focus()}function zn(){var T;(T=C.value)===null||T===void 0||T.focusInput()}function bi(){var T;x.value&&((T=B.value)===null||T===void 0||T.syncPosition())}re(),i.watch(i.toRef(e,"options"),re);const Hi={focus:()=>{var T;(T=C.value)===null||T===void 0||T.focus()},focusInput:()=>{var T;(T=C.value)===null||T===void 0||T.focusInput()},blur:()=>{var T;(T=C.value)===null||T===void 0||T.blur()},blurInput:()=>{var T;(T=C.value)===null||T===void 0||T.blurInput()}},qt=i.computed(()=>{const{self:{menuBoxShadow:T}}=o.value;return{"--n-menu-box-shadow":T}}),Cn=s?ui("select",void 0,qt,e):void 0;return Object.assign(Object.assign({},Hi),{mergedStatus:H,mergedClsPrefix:t,mergedBordered:n,namespace:r,treeMate:y,isMounted:ss(),triggerRef:C,menuRef:v,pattern:h,uncontrolledShow:S,mergedShow:x,adjustedTo:pn(e),uncontrolledValue:a,mergedValue:c,followerRef:B,localizedPlaceholder:F,selectedOption:L,selectedOptions:A,mergedSize:P,mergedDisabled:E,focused:d,activeWithoutMenuOpen:Ce,inlineThemeDisabled:s,onTriggerInputFocus:Fe,onTriggerInputBlur:Ie,handleTriggerOrMenuResize:bi,handleMenuFocus:Xt,handleMenuBlur:Tt,handleMenuTabOut:mi,handleTriggerClick:vt,handleToggle:on,handleDeleteOption:st,handlePatternInput:ne,handleClear:je,handleTriggerBlur:xn,handleTriggerFocus:Mt,handleKeydown:yi,handleMenuAfterLeave:xe,handleMenuClickOutside:_i,handleMenuScroll:Li,handleMenuKeydown:yi,handleMenuMousedown:wr,mergedTheme:o,cssVars:s?void 0:qt,themeClass:Cn==null?void 0:Cn.themeClass,onRender:Cn==null?void 0:Cn.onRender})},render(){return i.h("div",{class:`${this.mergedClsPrefix}-select`},i.h(Jc,null,{default:()=>[i.h(Qc,null,{default:()=>i.h(Aw,{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 e,t;return[(t=(e=this.$slots).arrow)===null||t===void 0?void 0:t.call(e)]}})}),i.h(pd,{ref:"followerRef",show:this.mergedShow,to:this.adjustedTo,teleportDisabled:this.adjustedTo===pn.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 e,t,n;return this.mergedShow||this.displayDirective==="show"?((e=this.onRender)===null||e===void 0||e.call(this),i.withDirectives(i.h(dw,Object.assign({},this.menuProps,{ref:"menuRef",onResize:this.handleTriggerOrMenuResize,inlineThemeDisabled:this.inlineThemeDisabled,virtualScroll:this.consistentMenuWidth&&this.virtualScroll,class:[`${this.mergedClsPrefix}-select-menu`,this.themeClass,(t=this.menuProps)===null||t===void 0?void 0:t.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],[rs,this.handleMenuClickOutside,void 0,{capture:!0}]]:[[rs,this.handleMenuClickOutside,void 0,{capture:!0}]])):null}})})]}))}}),Xw={},xh=i.defineComponent({...Xw,__name:"searchable-reference-select",props:{searchDataHandler:{},optionsListConverter:{},wrapContent:{type:Boolean,default:!1},renderLabel:{},renderTag:{},value:{},clearable:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},minTermLength:{default:()=>Y.AppConfigProvider.getConfig().minSearchTermLength},consistentMenuWidth:{type:Boolean,default:!1},placeholder:{default:""}},emits:["update:value"],setup(e,{expose:t,emit:n}){const r=e,s=n,o=i.computed(()=>W.isArray(r.value)),a=i.computed(()=>o.value?r.value.map(b=>b.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(b=>({...b,class:r.wrapContent?`${b.class} consistent-menu-width`:b.class}))),d=i.ref(!1),h=i.useTemplateRef("select-component"),u=b=>{b.length<r.minTermLength||(d.value=!0,r.searchDataHandler(b,d).then(S=>{if(W.isEmpty(S))return;const x=o.value?r.value:r.value?[r.value]:[],C=S.filter(B=>!x.some(v=>v.id===B.id));l.value=r.optionsListConverter([...x,...C])}).finally(()=>{d.value=!1}))};let f="";const p=W.debounce(()=>u(f),800),g=b=>{f=b,p()},m=b=>{var S;if(W.isArray(b)){const x=b.length>0?b.map(C=>{var B;return i.toRaw((B=l.value.find(v=>v.value===C))==null?void 0:B.item)}):[];s("update:value",x)}else if(b>0){const x=i.toRaw((S=l.value.find(C=>C.value===b))==null?void 0:S.item);s("update:value",x)}else s("update:value",null)};return t({focus:()=>{var b;return(b=h.value)==null?void 0:b.focusInput()},blur:()=>{var b;return(b=h.value)==null?void 0:b.blurInput()}}),(b,S)=>(i.openBlock(),i.createBlock(i.unref(jw),{ref:"select-component","clear-filter-after-select":!0,clearable:b.clearable,"consistent-menu-width":b.consistentMenuWidth,disabled:b.disabled,filterable:!0,loading:d.value,multiple:o.value,options:c.value,placeholder:b.placeholder,remote:!0,value:a.value,"render-label":b.renderLabel,"render-tag":b.renderTag,onSearch:g,"onUpdate:value":m},null,8,["clearable","consistent-menu-width","disabled","loading","multiple","options","placeholder","value","render-label","render-tag"]))}}),qw={},Ch=i.defineComponent({...qw,__name:"searchable-product-select",props:{wrapContent:{type:Boolean,default:!1},renderLabel:{},renderTag:{},value:{},clearable:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},minTermLength:{default:()=>Y.AppConfigProvider.getConfig().minSearchTermLength},consistentMenuWidth:{type:Boolean,default:!1},placeholder:{default:""},searchType:{}},emits:["update:value"],setup(e,{expose:t,emit:n}){const r=e,s=n,o=i.useTemplateRef("select-component"),a=async u=>r.searchType==="categories"?Y.HttpRequester.getInstance(Y.ProductCategoryDataProvider).publicSimpleSearch(u):r.searchType==="products"?Y.HttpRequester.getInstance(Y.ProductDataProvider).publicSimpleSearch(u):new Promise(f=>{f([])}),l=u=>r.searchType==="categories"?ln.convertReferencesToSelectOptionsList(u,!0,!1,f=>f!=null&&f.isNewRec()?"-":f.name):r.searchType==="products"?ln.convertReferencesToSelectOptionsList(u,!0,!1,f=>f!=null&&f.isNewRec()?"-":`[${f.code}] ${f.name}`):[],c=(u,f)=>{if(r.renderLabel)return r.renderLabel(u,f);if(r.searchType==="products"){const p=u.item;return i.h("div",{},[i.h("span",{class:"text-sc-grey mr-2.5"},p.code),i.h("span",{},[p.name])])}if(r.searchType==="categories"){const p=u.item;return i.h("div",{},[p.name])}};return t({focus:()=>{var u;return(u=o.value)==null?void 0:u.focus()},blur:()=>{var u;return(u=o.value)==null?void 0:u.blur()}}),(u,f)=>(i.openBlock(),i.createBlock(xh,{ref:"select-component",value:u.value,clearable:u.clearable,disabled:u.disabled,placeholder:u.placeholder,"search-data-handler":a,"options-list-converter":l,"consistent-menu-width":u.consistentMenuWidth,"wrap-content":u.wrapContent,"min-term-length":u.minTermLength,"render-label":c,"render-tag":u.renderTag,"onUpdate:value":f[0]||(f[0]=p=>s("update:value",p))},null,8,["value","clearable","disabled","placeholder","consistent-menu-width","wrap-content","min-term-length","render-tag"]))}}),Yw={class:"col-span-2 flex flex-row gap-2.5"},Uw={class:"flex-1"},Gw={class:"text-sc-grey"},Kw={class:"ml-2.5"},Zw={key:0,class:"flex-none"},Jw={},Qw=i.defineComponent({...Jw,__name:"products-list",props:{value:{},searchType:{},minTermLength:{default:()=>Y.AppConfigProvider.getConfig().minSearchTermLength},disabled:{type:Boolean}},emits:["update:value"],setup(e,{emit:t}){const n=e,r=t,s=i.ref(null),o=()=>structuredClone(i.toRaw(n.value)),a=i.ref(o()),l=()=>{r("update:value",a.value.map(u=>i.toRaw(u)))},c=u=>{u&&(a.value=[...a.value.map(f=>i.toRaw(f)),...(W.isArray(u)?u:[u]).filter(f=>!a.value.some(p=>p.id===f.id))],i.nextTick(()=>{s.value=null}),l())},d=u=>{u&&(a.value=a.value.map(f=>f.id===u.id?u:i.toRaw(f)),l())},h=u=>{a.value=a.value.filter(f=>f.id!==u.id),l()};return i.watch(()=>n.value,()=>{a.value=o()}),(u,f)=>{const p=V.NListItem,g=E_,m=V.NButton,_=V.NList;return i.openBlock(),i.createBlock(_,{"show-divider":!1,hoverable:!0},{header:i.withCtx(()=>[i.renderSlot(u.$slots,"header")]),footer:i.withCtx(()=>[i.createVNode(Ch,{value:s.value,"onUpdate:value":[f[0]||(f[0]=y=>s.value=y),c],clearable:!0,disabled:u.disabled,"min-term-length":u.minTermLength,"search-type":u.searchType,placeholder:"Введите название"},null,8,["value","disabled","min-term-length","search-type"])]),default:i.withCtx(()=>[a.value.length===0?(i.openBlock(),i.createBlock(p,{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,y=>(i.openBlock(),i.createBlock(p,{key:y.id},{suffix:i.withCtx(()=>[i.createVNode(m,{disabled:u.disabled,quaternary:"",type:"error",onClick:b=>h(y)},{default:i.withCtx(()=>[i.createVNode(g)]),_:2},1032,["disabled","onClick"])]),default:i.withCtx(()=>[i.createElementVNode("div",Yw,[i.createElementVNode("span",Uw,[i.createElementVNode("span",Gw,i.toDisplayString(y.code),1),i.createElementVNode("span",Kw,i.toDisplayString(y.name),1)]),u.$slots["item-extra"]?(i.openBlock(),i.createElementBlock("div",Zw,[i.renderSlot(u.$slots,"item-extra",{item:y,updateItemCallback:d})])):i.createCommentVNode("",!0)])]),_:2},1024))),128))]),_:3})}}}),ev={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function tv(e,t){return i.openBlock(),i.createElementBlock("svg",ev,t[0]||(t[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 nv=i.markRaw({name:"tabler-truck-filled",render:tv}),iv={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function rv(e,t){return i.openBlock(),i.createElementBlock("svg",iv,t[0]||(t[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 sv=i.markRaw({name:"tabler-truck-delivery",render:rv}),ov={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function av(e,t){return i.openBlock(),i.createElementBlock("svg",ov,t[0]||(t[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 lv=i.markRaw({name:"tabler-truck-loading",render:av}),cv={class:"flex flex-col gap-1"},dv={key:0,class:"flex flex-row gap-1 text-base"},hv={key:1,class:"text-sc-dark-grey text-sm"},uv={class:"text-sc-grey mr-1.5"},fv={key:0},pv={key:1},gv={key:2},mv={},ws=i.defineComponent({...mv,__name:"order-delivery-label",props:{delivery:{},showType:{type:Boolean,default:!0},showDetails:{type:Boolean,default:!0}},setup(e){const t=i.computed(()=>{var s;return(s=Y.useReferencesStore().deliveryTypeReference)==null?void 0:s.find(o=>o.id===r.delivery.type)}),n=i.computed(()=>Sn.format(r.delivery.date,"dd.MM.yyyy")),r=e;return(s,o)=>{var d,h,u,f,p,g,m,_;const a=lv,l=sv,c=nv;return i.openBlock(),i.createElementBlock("div",cv,[s.showType?(i.openBlock(),i.createElementBlock("span",dv,[((d=t.value)==null?void 0:d.slug)==="self_delivery"?(i.openBlock(),i.createBlock(a,{key:0})):i.createCommentVNode("",!0),((h=t.value)==null?void 0:h.slug)==="delivery"?(i.openBlock(),i.createBlock(l,{key:1})):i.createCommentVNode("",!0),((u=t.value)==null?void 0:u.slug)==="transport_company_delivery"?(i.openBlock(),i.createBlock(c,{key:2})):i.createCommentVNode("",!0),i.createElementVNode("span",null,i.toDisplayString((f=t.value)==null?void 0:f.name),1)])):i.createCommentVNode("",!0),s.showDetails?(i.openBlock(),i.createElementBlock("span",hv,[i.createElementVNode("span",uv,i.toDisplayString(n.value),1),(g=(p=s.delivery)==null?void 0:p.address)!=null&&g.address?(i.openBlock(),i.createElementBlock("span",fv,i.toDisplayString(s.delivery.address.address),1)):i.createCommentVNode("",!0),(_=(m=s.delivery)==null?void 0:m.warehouse)!=null&&_.address?(i.openBlock(),i.createElementBlock("span",pv,"со склада "+i.toDisplayString(s.delivery.warehouse.address),1)):(i.openBlock(),i.createElementBlock("span",gv,"(не указано)"))])):i.createCommentVNode("",!0)])}}}),_v={class:"flex flex-col gap-2.5"},yv={class:"text-base"},bv=["href"],wv={class:"text-sc-grey"},vv={},Sh=i.defineComponent({...vv,__name:"order-common-info",props:{order:{},fields:{},orderUrl:{}},setup(e){const t=e,n=i.computed(()=>t.fields.includes(Ue.Id)?t.order.id:void 0),r=i.computed(()=>{var l,c;return t.fields.includes(Ue.Status)?(c=(l=Y.useReferencesStore().orderStatusReference)==null?void 0:l.find(d=>d.id===(t.order.status??-1)))==null?void 0:c.name:void 0}),s=i.computed(()=>t.fields.includes(Ue.CreatedAt)),o=i.computed(()=>t.fields.includes(Ue.ClientInfo)?t.order.client:void 0),a=i.computed(()=>t.fields.includes(Ue.DeliveryInfo)?t.order.delivery:void 0);return(l,c)=>(i.openBlock(),i.createElementBlock("div",_v,[i.createElementVNode("span",yv,[n.value?(i.openBlock(),i.createElementBlock("a",{key:0,href:l.orderUrl.replace(":id",l.order.id.toString()),target:"_blank",class:"text-sc-dark-grey"}," #"+i.toDisplayString(n.value),9,bv)):i.createCommentVNode("",!0),s.value?(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[c[0]||(c[0]=i.createTextVNode(" от ")),i.createVNode(co,{date:l.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(" - ")),i.createElementVNode("span",wv,i.toDisplayString(r.value),1)],64)):i.createCommentVNode("",!0)]),o.value?(i.openBlock(),i.createBlock(Sr,{key:0,client:o.value,class:"ml-3"},null,8,["client"])):i.createCommentVNode("",!0),a.value?(i.openBlock(),i.createBlock(ws,{key:1,delivery:a.value,class:"ml-3"},null,8,["delivery"])):i.createCommentVNode("",!0)]))}}),kv={},Bh=i.defineComponent({...kv,__name:"order-payment",props:{payment:{}},setup(e){const t=e,n=i.computed(()=>{var r;return(r=Y.useReferencesStore().paymentTypeReference)==null?void 0:r.find(s=>s.id===t.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)}}}),xv={class:"flex flex-row gap-1.5"},Cv={class:"flex-none text-nowrap"},Sv={class:"flex flex-1 flex-col"},Bv={class:"mt-2.5 grid grid-flow-col grid-rows-2 gap-1 text-base"},Tv={key:0},Ev={key:1},$v={},Th=i.defineComponent({...$v,__name:"order-product-info",props:{product:{},index:{}},setup(e){return(t,n)=>(i.openBlock(),i.createElementBlock("div",xv,[i.createElementVNode("span",Cv,i.toDisplayString(t.index+1)+".",1),i.createElementVNode("div",Sv,[i.createVNode(Xi,{product:t.product.product,"show-planning-dates":!1},null,8,["product"]),i.createElementVNode("div",Bv,[n[0]||(n[0]=i.createElementVNode("span",null,"Кол-во",-1)),t.product.product.getIsMeasurable()?(i.openBlock(),i.createElementBlock("span",Tv,i.toDisplayString(`${t.product.length} ${t.product.product.unit} x ${t.product.quantity} шт.`),1)):(i.openBlock(),i.createElementBlock("span",Ev,i.toDisplayString(`${t.product.quantity} ${t.product.product.unit}`),1)),n[1]||(n[1]=i.createElementVNode("span",null,"Цена за ед.",-1)),i.createElementVNode("span",null,i.toDisplayString(`${t.product.costOneRub.toLocaleString("ru-ru",{minimumFractionDigits:2})} ${t.product.currency}`),1),n[2]||(n[2]=i.createElementVNode("span",null,"Сумма",-1)),i.createElementVNode("span",null,i.toDisplayString(`${t.product.cost.toLocaleString("ru-ru",{minimumFractionDigits:2})} ${t.product.currency}`),1)])])]))}}),Nv={},Pv=i.defineComponent({...Nv,__name:"order-items-list",props:{order:{}},setup(e){const t=()=>{const s=[{title:"№ п.п.",key:"id",resizable:!0,width:50,render:(o,a)=>i.h("span",{class:"text-base"},[a+1,"."])},{title:"Артикул",key:"codeNumber",resizable:!0,minWidth:120,render:o=>i.h("span",{class:"text-base"},[o.product.code])},{title:"Наименование",key:"name",resizable:!0,render:o=>i.h(Xi,{product:o.product,showCode:!1,showPlanningDates:!1})},{title:"Кол-во",key:"quantity",resizable:!0,minWidth:100,render:o=>i.h("span",{class:"text-nowrap text-base"},o.product.getIsMeasurable()?[`${o.length} ${o.product.unit} x ${o.quantity} шт.`]:[`${o.quantity} ${o.product.unit}`])},{title:"Цена за ед.",key:"costOneRub",resizable:!0,minWidth:100,render:o=>i.h("span",{class:"text-base"},[`${o.costOneRub.toLocaleString("ru-ru",{minimumFractionDigits:2})} ${o.currency}`])},{title:"Сумма",key:"cost",resizable:!0,minWidth:100,render:o=>i.h("span",{class:"text-base"},[`${o.cost.toLocaleString("ru-ru",{minimumFractionDigits:2})} ${o.currency}`])}];switch(pt.getDeviceTypeByResolution()){case Y.WindowResolutionEnum.phone:case Y.WindowResolutionEnum.tablet:return[{title:"",key:"items",resizable:!0,render:(o,a)=>i.h(Th,{product:o,index:a})}];case Y.WindowResolutionEnum.laptop:return s;default:return s}},n=i.ref(t()),r=()=>{n.value=t()};return i.onMounted(()=>{r(),window.addEventListener("resize",r)}),i.onUnmounted(()=>{window.removeEventListener("resize",r)}),(s,o)=>{const a=V.NDataTable;return i.openBlock(),i.createElementBlock(i.Fragment,null,[o[0]||(o[0]=i.createElementVNode("h3",null,"Список позиций",-1)),i.createVNode(a,{columns:n.value,data:s.order.products,"row-key":l=>l.id,"bottom-bordered":!1,bordered:!1},null,8,["columns","data","row-key"])],64)}}}),Eh=Ln(Pv,[["__scopeId","data-v-b1bc6269"]]),Rv={class:"text-base"},Fv={},qo=i.defineComponent({...Fv,__name:"user-short-info",props:{user:{},showUserType:{type:Boolean,default:!0},extraInfoOnSecondLine:{type:Boolean,default:!0}},setup(e){return(t,n)=>(i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass({"flex flex-col":t.showUserType&&t.extraInfoOnSecondLine})},[i.createElementVNode("span",Rv,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))}}),Mv={class:"ml-4 grid grid-cols-3 gap-1.5 text-base"},Av={class:"col-span-2"},Ov={class:"col-span-2"},Vv={class:"btn btn-primary",href:"{{ invoice }}"},zv={},$h=i.defineComponent({...zv,__name:"order-details",props:{order:{}},setup(e){return(t,n)=>(i.openBlock(),i.createElementBlock("div",null,[n[11]||(n[11]=i.createElementVNode("h3",null,"Детали заказа",-1)),i.createElementVNode("div",Mv,[t.order.creator.id!==t.order.client.id?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[n[0]||(n[0]=i.createElementVNode("span",null,"Создал",-1)),i.createVNode(qo,{user:t.order.creator,class:"col-span-2"},null,8,["user"])],64)):i.createCommentVNode("",!0),n[10]||(n[10]=i.createElementVNode("span",null,"Клиент",-1)),i.createVNode(Sr,{client:t.order.client,class:"col-span-2"},null,8,["client"]),t.order.contragent?(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[n[1]||(n[1]=i.createElementVNode("span",null,"Контрагент",-1)),i.createVNode(ka,{contragent:t.order.contragent,class:"col-span-2"},null,8,["contragent"])],64)):i.createCommentVNode("",!0),t.order.image?(i.openBlock(),i.createElementBlock(i.Fragment,{key:2},[n[2]||(n[2]=i.createElementVNode("span",null,"Графический файл клиента",-1)),n[3]||(n[3]=i.createElementVNode("a",{class:"fancybox col-span-2",href:"{{ order.image }}"}," Посмотреть ",-1))],64)):i.createCommentVNode("",!0),t.order.barcode?(i.openBlock(),i.createElementBlock(i.Fragment,{key:3},[n[4]||(n[4]=i.createElementVNode("span",null,"Штрих-код",-1)),i.createElementVNode("span",Av,i.toDisplayString(t.order.barcode),1)],64)):i.createCommentVNode("",!0),t.order.payment?(i.openBlock(),i.createElementBlock(i.Fragment,{key:4},[n[5]||(n[5]=i.createElementVNode("span",null,"Оплата",-1)),i.createVNode(Bh,{payment:t.order.payment,class:"col-span-2"},null,8,["payment"])],64)):i.createCommentVNode("",!0),t.order.delivery?(i.openBlock(),i.createElementBlock(i.Fragment,{key:5},[n[6]||(n[6]=i.createElementVNode("span",null,"Доставка",-1)),i.createVNode(ws,{delivery:t.order.delivery,class:"col-span-2"},null,8,["delivery"])],64)):i.createCommentVNode("",!0),t.order.comment?(i.openBlock(),i.createElementBlock(i.Fragment,{key:6},[n[7]||(n[7]=i.createElementVNode("span",null,"Комментарий",-1)),i.createElementVNode("span",Ov,i.toDisplayString(t.order.comment),1)],64)):i.createCommentVNode("",!0),t.order.attachedUser?(i.openBlock(),i.createElementBlock(i.Fragment,{key:7},[n[8]||(n[8]=i.createElementVNode("span",null,"Закреплен за",-1)),i.createVNode(qo,{user:t.order.attachedUser,class:"col-span-2"},null,8,["user"])],64)):i.createCommentVNode("",!0),t.order.invoices&&t.order.invoices.length>0?(i.openBlock(),i.createElementBlock(i.Fragment,{key:8},[n[9]||(n[9]=i.createElementVNode("span",null,"Прикрепленные счета",-1)),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(t.order.invoices,(r,s)=>(i.openBlock(),i.createElementBlock("div",{key:s,class:"col-span-2"},[i.createElementVNode("a",Vv," Скачать счет №"+i.toDisplayString(s+1),1)]))),128))],64)):i.createCommentVNode("",!0)])]))}}),Iv={key:0},Lv={class:"text-sc-dark-grey my-2 text-center"},Dv={key:1,class:"text-sc-dark-grey my-2 text-center"},Hv={key:2},Wv={class:"text-sc-dark-grey mt-4 text-right font-bold"},jv={class:"text-sc-primary"},Xv={},Nh=i.defineComponent({...Xv,__name:"order-info",props:{order:{}},setup(e){const t=e,n=i.ref(!1),r=i.ref(new Y.Order(t.order)),s=()=>{n.value=!0,Y.HttpRequester.getInstance(Y.OrdersDataProvider).getOrder(t.order.id).then(a=>{r.value=a}).finally(()=>{n.value=!1})},o=i.computed(()=>(r.value.products??[]).reduce((a,l)=>a+l.costRub,0).toLocaleString("ru-ru",{minimumFractionDigits:2}));return i.onMounted(()=>{s()}),(a,l)=>{const c=V.NSpin;return n.value?(i.openBlock(),i.createElementBlock("div",Iv,[i.createElementVNode("div",Lv,[i.createVNode(c,{size:"small",class:"mb-2.5 align-middle"}),l[0]||(l[0]=i.createElementVNode("div",null,[i.createElementVNode("span",null,"Загрузка данных ...")],-1))])])):r.value.products.length===0?(i.openBlock(),i.createElementBlock("div",Dv," --- Не удалось загрузить данные о заказе --- ")):(i.openBlock(),i.createElementBlock("div",Hv,[i.createVNode(Eh,{order:r.value},null,8,["order"]),i.createElementVNode("div",Wv,[l[1]||(l[1]=i.createTextVNode(" ИТОГО: ")),i.createElementVNode("span",jv,i.toDisplayString(o.value)+" ₽",1)]),i.createVNode($h,{order:r.value},null,8,["order"])]))}}}),qv={},Yv=i.defineComponent({...qv,__name:"orders-list",props:{fields:{},orderUrl:{},filters:{},sort:{},pagination:{}},setup(e){const t=e,n=()=>structuredClone(i.toRaw(t.sort??{field:"id",direction:"desc"})),r=i.ref(n()),s=i.ref([]),o=i.ref(!1),a=i.computed(()=>Y.useReferencesStore().orderStatusReference),l=()=>{const m=t.fields.length>0?t.fields:[Ue.CreatedAt,Ue.Id,Ue.DeliveryInfo,Ue.Status,Ue.SalesDirections,Ue.AttachedUser],_={title:"???",key:"undefined",render:()=>i.h("span",{},["--- unknown ---"])},y={type:"expand",expandable:W.constant(!0),renderExpand:S=>i.h(Nh,{order:S,class:"pl-10 pt-3 pb-10"}),width:"30"},b=[{title:"Дата заказа",key:Ue.CreatedAt,resizable:!0,minWidth:100,render:S=>i.h(co,{date:S.createdAt,isTimeSecondary:!0,isTimeOnSecondLine:!0,class:"text-base"})},{title:"Номер заказа",key:Ue.Id,resizable:!0,minWidth:70,render:S=>i.h("a",{href:t.orderUrl.replace(":id",S.id.toString()),target:"_blank",class:"text-base"},S.id)},{title:"Клиент",key:Ue.ClientInfo,resizable:!0,render:S=>i.h(Sr,{client:S.client})},{title:"Тип доставки",key:Ue.DeliveryInfo,resizable:!0,render:S=>i.h(ws,{delivery:S.delivery})},{title:"Статус",key:Ue.Status,resizable:!0,minWidth:90,render:S=>{var x,C;return i.h("span",{class:"text-base"},[((C=(x=a.value)==null?void 0:x.find(B=>B.id===(S.status??-1)))==null?void 0:C.name)??""])}},{title:"Напр. продаж",key:Ue.SalesDirections,resizable:!0,minWidth:70,render:S=>i.h("span",{class:"text-base"},[S.salesDirection.name])},{title:"Закреплено за",key:Ue.AttachedUser,resizable:!0,render:S=>{var x;return i.h("span",{class:"text-base"},[(x=S==null?void 0:S.attachedUser)==null?void 0:x.name])}}];switch(pt.getDeviceTypeByResolution()){case Y.WindowResolutionEnum.phone:case Y.WindowResolutionEnum.tablet:return[y,{key:"order",title:"Заказ",resizable:!0,render:S=>i.h(Sh,{order:S,fields:m,orderUrl:t.orderUrl})}];case Y.WindowResolutionEnum.laptop:return[y,...m.map(S=>b.find(x=>x.key===S)??_)];default:return[_]}},c=i.ref(l()),d=i.ref(new Y.DataTablePagination(t.pagination??{page:1,pageSize:10,itemCount:0,pageCount:1,pageSlot:5,pageSizes:[10,15,25],showSizePicker:!1})),h=()=>{t.filters&&(o.value=!0,Y.HttpRequester.getInstance(Y.OrdersDataProvider).getOrders(t.filters,r.value,{page:d.value.page,pageSize:d.value.pageSize}).then(m=>{d.value.itemCount!==m.meta.total&&(d.value.itemCount=m.meta.total),d.value.page!==m.meta.currentPage&&(d.value.page=m.meta.currentPage),d.value.pageCount!==m.meta.lastPage&&(d.value.pageCount=m.meta.lastPage),d.value.pageSize!==m.meta.perPage&&(d.value.pageSize=m.meta.perPage),s.value=m.data}).finally(()=>{o.value=!1}))},u=m=>{d.value.page=m,h()},f=m=>{d.value.pageSize=m,h()},p=m=>{W.isNull(m)?r.value=n():(r.value.field=m.columnKey.toString(),r.value.direction=m.order==="ascend"?"asc":"desc"),c.value.forEach(_=>{if(Object.hasOwn(_,"sortOrder")){const y=_;y.sortOrder=y.key===(m==null?void 0:m.columnKey)&&(m!=null&&m.sorter)&&m.order!==!1?m.order:!1}}),h()},g=()=>{c.value=l()};return i.watch(()=>t.filters,()=>{h()}),i.watch(()=>t.sort,()=>{r.value=n(),h()}),i.onMounted(()=>{g(),window.addEventListener("resize",g),i.nextTick(()=>{h()})}),i.onUnmounted(()=>{window.removeEventListener("resize",g)}),(m,_)=>{const y=V.NDataTable;return i.openBlock(),i.createBlock(y,{columns:c.value,data:s.value,"row-key":b=>b.id,pagination:d.value,loading:o.value,remote:!0,bordered:!1,"bottom-bordered":!1,"sticky-expanded-rows":!0,"pagination-behavior-on-filter":"first","onUpdate:page":u,"onUpdate:pageSize":f,"onUpdate:sorter":p},null,8,["columns","data","row-key","pagination","loading"])}}}),Uv=Ln(Yv,[["__scopeId","data-v-d66ad43e"]]),Gv=["href"],Kv={class:"text-sc-dark-grey"},Zv={},Jv=i.defineComponent({...Zv,__name:"short-text-order-info",props:{order:{},orderLink:{}},emits:["click:order-id"],setup(e,{emit:t}){const n=e,r=t,s=i.computed(()=>Sn.format(n.order.createdAt,Y.AppConfigProvider.getConfig().dateFormats.uiDateWithTime)),o=a=>{W.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(" #")),i.createElementVNode("a",{href:a.orderLink??"#",onClick:l[0]||(l[0]=c=>o(c))},i.toDisplayString(a.order.id),9,Gv),i.createTextVNode(" от "+i.toDisplayString(s.value),1),a.order.isApproved1c?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[i.createTextVNode(" (подтверждён)")],64)):i.createCommentVNode("",!0)]),l[2]||(l[2]=i.createTextVNode(", ")),i.createElementVNode("span",Kv,"автор: "+i.toDisplayString(a.order.creator.name)+" ["+i.toDisplayString(a.order.creator.type)+"]",1)],64))}}),Qv={class:"sc-page flex flex-col"},e2={class:"flex flex-row"},t2={class:"sc-title grow"},n2={key:0,class:"sc-title-buttons mt-1 flex-1 grow-0 lg:mt-3"},i2={class:"flex flex-col justify-end gap-1 sm:mt-0 sm:flex-row"},r2={key:0,class:"sc-title-extra mt-2 sm:mt-4"},s2={},Ph=i.defineComponent({...s2,__name:"page",props:{title:{}},setup(e){return(t,n)=>{const r=V.NH1;return i.openBlock(),i.createElementBlock("div",Qv,[i.createElementVNode("div",e2,[i.createElementVNode("div",t2,[i.renderSlot(t.$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})])]),t.$slots["title-buttons"]?(i.openBlock(),i.createElementBlock("div",n2,[i.createElementVNode("div",i2,[i.renderSlot(t.$slots,"title-buttons")])])):i.createCommentVNode("",!0)]),t.$slots["title-extra"]?(i.openBlock(),i.createElementBlock("div",r2,[i.renderSlot(t.$slots,"title-extra")])):i.createCommentVNode("",!0),i.renderSlot(t.$slots,"default")])}}}),o2={class:"overflow-hidden transition-all duration-300"},a2={class:"text-lg font-medium leading-none"},l2={},Rh=i.defineComponent({...l2,__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(e,{emit:t}){const n=e,r=t,s=i.ref(0),o=i.ref(n.showDrawer),a=()=>{switch(pt.getDeviceTypeByResolution()){case Y.WindowResolutionEnum.phone:return window.innerWidth*.66;case Y.WindowResolutionEnum.tablet:return window.innerWidth*.5;default:return window.innerWidth*.33}},l=()=>{o.value?W.isUndefined(n.drawerWidth)?s.value=a():s.value=W.isFunction(n.drawerWidth)?n.drawerWidth():n.drawerWidth:s.value=0};return i.watch(()=>n.drawerWidth,()=>{l()}),i.watch(()=>o.value,()=>{l(),r("update:show-drawer",o.value)}),i.watch(()=>n.showDrawer,c=>{o.value=c}),i.onUnmounted(()=>{window.removeEventListener("resize",l)}),l(),window.addEventListener("resize",l),(c,d)=>{const h=V.NDrawerContent,u=V.NDrawer;return i.openBlock(),i.createElementBlock(i.Fragment,null,[i.createElementVNode("div",o2,[i.createElementVNode("div",{style:i.normalizeStyle(`margin-left: ${s.value}px;`),class:"w-full"},[i.renderSlot(c.$slots,"default")],4)]),i.createVNode(u,{show:o.value,"onUpdate:show":d[0]||(d[0]=f=>o.value=f),resizable:!0,width:s.value,placement:"left"},{default:i.withCtx(()=>[i.createVNode(h,{closable:""},{header:i.withCtx(()=>[i.renderSlot(c.$slots,"drawer-header",{},()=>[i.createElementVNode("div",a2,i.toDisplayString(c.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)}}}),c2={key:0,ref:"panel-component-ref",class:"sc-page-panel flex flex-row gap-2.5 sm:gap-8"},d2={key:0},h2={class:"sc-page-preview-panel grow"},u2={key:1,class:"sc-page-preview-panel-extra flex-none"},f2={},p2=i.defineComponent({...f2,__name:"page-with-sliding-panel",props:{title:{},isShowPanelButtonVisible:{type:Boolean,default:!0},showPanelButtonText:{default:""},panelTitle:{default:""}},setup(e,{expose:t}){const n=i.ref(!1),r=()=>{n.value=!0},s=i.useTemplateRef("panel-component-ref");return t({scrollToTopOfPanel:a=>{var l;(l=s.value)==null||l.scrollIntoView({behavior:"smooth"}),a&&i.nextTick(()=>{var c,d;window.scrollTo({top:(((d=(c=s.value)==null?void 0:c.getBoundingClientRect())==null?void 0:d.top)??0)+window.pageYOffset+a,behavior:"smooth"})})},showPanel:r}),(a,l)=>{const c=V.NButton;return i.openBlock(),i.createBlock(Ph,{title:a.title},i.createSlots({default:i.withCtx(()=>[a.$slots["preview-panel"]||a.$slots["preview-panel-extra"]||a.isShowPanelButtonVisible?(i.openBlock(),i.createElementBlock("div",c2,[a.isShowPanelButtonVisible?(i.openBlock(),i.createElementBlock("div",d2,[i.renderSlot(a.$slots,"show-panel-button",{onClickHandler:()=>{n.value=!0}},()=>[i.createVNode(c,{class:"flex-none sm:px-10 sm:py-4",onClick:l[0]||(l[0]=d=>n.value=!0)},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(a.showPanelButtonText),1)]),_:1})])])):i.createCommentVNode("",!0),i.createElementVNode("div",h2,[i.renderSlot(a.$slots,"preview-panel")]),a.$slots["preview-panel-extra"]?(i.openBlock(),i.createElementBlock("div",u2,[i.renderSlot(a.$slots,"preview-panel-extra")])):i.createCommentVNode("",!0)],512)):i.createCommentVNode("",!0),i.createVNode(Rh,{"show-drawer":n.value,"onUpdate:showDrawer":l[1]||(l[1]=d=>n.value=d),title:a.panelTitle},i.createSlots({"drawer-content":i.withCtx(()=>[i.renderSlot(a.$slots,"panel-content")]),default:i.withCtx(()=>[i.renderSlot(a.$slots,"default")]),_:2},[a.$slots["panel-header"]?{name:"drawer-header",fn:i.withCtx(()=>[i.renderSlot(a.$slots,"panel-header")]),key:"0"}:void 0,a.$slots["panel-bottom"]?{name:"drawer-footer",fn:i.withCtx(()=>[i.renderSlot(a.$slots,"panel-bottom")]),key:"1"}:void 0]),1032,["show-drawer","title"])]),_:2},[a.$slots.title?{name:"title",fn:i.withCtx(()=>[i.renderSlot(a.$slots,"title")]),key:"0"}:void 0,a.$slots["title-buttons"]?{name:"title-buttons",fn:i.withCtx(()=>[i.renderSlot(a.$slots,"title-buttons")]),key:"1"}:void 0,a.$slots["title-extra"]?{name:"title-extra",fn:i.withCtx(()=>[i.renderSlot(a.$slots,"title-extra")]),key:"2"}:void 0]),1032,["title"])}}}),g2={},m2=i.defineComponent({...g2,__name:"reference-select",props:{value:{default:void 0},clearable:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},consistentMenuWidth:{type:Boolean,default:!0},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(e,{expose:t,emit:n}){const r=e,s=n,o=i.computed(()=>W.isArray(r.value)),a=new Y.Reference,l=i.computed(()=>{const p=o.value?[]:a,g=W.isUndefined(r.value)?p:r.value;return W.isArray(g)?g.map(m=>m.id):g==null?void 0:g.id}),c=i.computed(()=>ln.convertReferencesToSelectOptionsList(r.referenceList,r.sortOptionsByLabel,r.showEmptyValue)),d=p=>{var g;if(W.isArray(p)){const m=p.length>0?p.map(_=>{var y;return(y=c.value.find(b=>b.value===_))==null?void 0:y.item}):[];s("update:value",m)}else{const m=p===a.id||(g=c.value.find(_=>_.value===p))==null?void 0:g.item;s("update:value",m)}},h=i.useTemplateRef("select-component");return t({focus:()=>{var p;return(p=h.value)==null?void 0:p.focus()},blur:()=>{var p;return(p=h.value)==null?void 0:p.blur()}}),(p,g)=>(i.openBlock(),i.createBlock(i.unref(V.NSelect),{ref:"select-component",value:l.value,clearable:r.clearable,"consistent-menu-width":p.consistentMenuWidth,disabled:p.disabled||c.value.length===0,filterable:p.filterable,"max-tag-count":p.maxTagCount,multiple:o.value,options:c.value,placeholder:"","onUpdate:value":d},null,8,["value","clearable","consistent-menu-width","disabled","filterable","max-tag-count","multiple","options"]))}}),_2={},y2=i.defineComponent({..._2,__name:"manager-select",props:{value:{default:null},clearable:{type:Boolean,default:!1},managerReferenceList:{default:()=>[]},showActualOnly:{type:Boolean,default:!1},showEmptyValue:{type:Boolean,default:!1}},emits:["update:value"],setup(e,{expose:t,emit:n}){const r=e,s=n,o=i.computed(()=>W.isArray(r.value)),a=i.computed(()=>{var f;return W.isArray(r.value)?r.value.map(p=>p.id):((f=r.value)==null?void 0:f.id)??null}),l=i.computed(()=>{var g;let f=r.showEmptyValue?[Y.ManagerDataFactory.generateUndefinedManagerInstance(),...r.managerReferenceList]:r.managerReferenceList,p=[];if(r.showActualOnly){const m=W.isArray(r.value)?r.value.map(_=>_.id):[(g=r.value)==null?void 0:g.id];p=r.managerReferenceList.filter(_=>!_.isActive).map(_=>_.id),f=r.managerReferenceList.filter(_=>_.isActive||m.includes(_.id))}return ln.convertReferencesToSelectOptionsList(f,!0,!0,m=>m.salesDirection.isNewRec()?m.name:`${m.name} (${m.salesDirection.name})`,m=>p.includes(m.id))}),c=i.useTemplateRef("select-component"),d=f=>{var p;if(W.isArray(f)){const g=f.length>0?f.map(m=>{var _;return(_=l.value.find(y=>y.value===m))==null?void 0:_.item}):[];s("update:value",g)}else{const g=f>0?(p=l.value.find(m=>m.value===f))==null?void 0:p.item:new Y.Manager;s("update:value",g)}};return t({focus:()=>{var f;return(f=c.value)==null?void 0:f.focusInput()},blur:()=>{var f;return(f=c.value)==null?void 0:f.blurInput()}}),(f,p)=>(i.openBlock(),i.createBlock(i.unref(V.NSelect),{ref:"select-component",value:a.value,clearable:f.clearable,disabled:l.value.length===0,multiple:o.value,options:l.value,placeholder:"","onUpdate:value":d},null,8,["value","clearable","disabled","multiple","options"]))}}),b2={class:"m-0.5 flex flex-col p-0.5"},w2={class:"flex flex-row gap-1"},v2={key:0},k2={key:1},x2={key:2},C2={key:3},S2={class:"flex flex-row gap-1"},B2={key:0},T2={key:1},E2={key:2},$2={key:3},N2={},Fh=i.defineComponent({...N2,__name:"address-suggestion-label",props:{addr:{},selected:{type:Boolean}},setup(e){return(t,n)=>(i.openBlock(),i.createElementBlock("div",b2,[i.createElementVNode("span",w2,[t.addr.postIndex?(i.openBlock(),i.createElementBlock("span",v2,i.toDisplayString(t.addr.postIndex)+", ",1)):i.createCommentVNode("",!0),t.addr.city?(i.openBlock(),i.createElementBlock("span",k2,i.toDisplayString(t.addr.city)+", ",1)):i.createCommentVNode("",!0),t.addr.locality?(i.openBlock(),i.createElementBlock("span",x2,i.toDisplayString(t.addr.locality)+", ",1)):i.createCommentVNode("",!0),t.addr.region?(i.openBlock(),i.createElementBlock("span",C2,i.toDisplayString(t.addr.region)+", ",1)):i.createCommentVNode("",!0)]),i.createElementVNode("span",S2,[t.addr.street?(i.openBlock(),i.createElementBlock("span",B2,i.toDisplayString(t.addr.street)+", ",1)):i.createCommentVNode("",!0),t.addr.building?(i.openBlock(),i.createElementBlock("span",T2,i.toDisplayString(t.addr.building)+", ",1)):i.createCommentVNode("",!0),t.addr.buildingPart?(i.openBlock(),i.createElementBlock("span",E2,i.toDisplayString(t.addr.buildingPart)+", ",1)):i.createCommentVNode("",!0),t.addr.apartments?(i.openBlock(),i.createElementBlock("span",$2,i.toDisplayString(t.addr.apartments)+", ",1)):i.createCommentVNode("",!0)])]))}}),Yo={clearable:!1,value:"",field:void 0,disabled:!1},P2={},R2=i.defineComponent({...P2,__name:"address-suggestion",props:i.mergeDefaults({disabled:{type:Boolean},value:{},clearable:{type:Boolean},field:{},minTermLength:{},searchDataHandler:{}},{...Yo,minTermLength:()=>Y.AppConfigProvider.getConfig().minSearchTermLength,searchDataHandler:()=>e=>Y.HttpRequester.getInstance(Y.DataSuggestionProvider).searchAddresses(e)}),emits:["select","update:value"],setup(e,{expose:t,emit:n}){const r=e,s=n,o=i.ref(r.value),a=i.ref(!1),l=i.ref([]),c=i.computed(()=>l.value.map(m=>({label:m[r.field??"addressString"]??"-",value:m.id})));i.watch(()=>r.value,m=>{o.value=m}),i.watch(o,()=>{s("update:value",o.value)});const d=W.debounce(()=>h(),800),h=async()=>{!o.value||o.value.length<r.minTermLength||(a.value=!0,l.value=await r.searchDataHandler(o.value,a).finally(()=>{a.value=!1}))},u=(m,_)=>{const y=l.value.find(b=>b.id===m.value)||{};return i.h(Fh,{addr:y,selected:_},{default:W.constant("-")})},f=m=>{d.cancel();const _=l.value.find(y=>y.id===m)||{};s("select",_)},p=i.ref(null);function g(){p.value.focus()}return t({focus:g}),(m,_)=>{const y=V.NAutoComplete;return i.openBlock(),i.createBlock(y,{ref_key:"autoCompleteElement",ref:p,value:o.value,"onUpdate:value":[_[0]||(_[0]=b=>o.value=b),i.unref(d)],clearable:m.clearable,disabled:m.disabled,loading:a.value,options:c.value,"render-label":u,placeholder:"",onSelect:f},null,8,["value","clearable","disabled","loading","options","onUpdate:value"])}}}),F2={class:"m-0.5 flex flex-col p-0.5"},M2={class:"font-medium"},A2={class:"flex flex-row gap-1 text-xs font-light text-blue-800"},O2={key:0},V2={key:1},z2={},Mh=i.defineComponent({...z2,__name:"bank-suggestion-label",props:{bank:{},selected:{type:Boolean}},setup(e){return(t,n)=>(i.openBlock(),i.createElementBlock("div",F2,[i.createElementVNode("span",M2,i.toDisplayString(t.bank.name),1),i.createElementVNode("span",A2,[t.bank.bic?(i.openBlock(),i.createElementBlock("span",O2," БИК: "+i.toDisplayString(t.bank.bic),1)):i.createCommentVNode("",!0),t.bank.inn?(i.openBlock(),i.createElementBlock("span",V2," ИНН: "+i.toDisplayString(t.bank.inn),1)):i.createCommentVNode("",!0)])]))}}),I2={},L2=i.defineComponent({...I2,__name:"bank-suggestion",props:i.mergeDefaults({disabled:{type:Boolean},value:{},clearable:{type:Boolean},field:{},minTermLength:{}},{...Yo,minTermLength:()=>Y.AppConfigProvider.getConfig().minSearchTermLength}),emits:["select","update:value"],setup(e,{expose:t,emit:n}){const r=e,s=n,o=i.ref(r.value),a=i.ref(!1),l=i.ref([]),c=i.computed(()=>l.value.map(m=>({label:m[r.field??"_"]??"-",value:m.id})));i.watch(()=>r.value,m=>{o.value=m}),i.watch(o,()=>{s("update:value",o.value)});const d=W.debounce(()=>h(),800),h=async()=>{if(!(!o.value||o.value.length<r.minTermLength)){a.value=!0;try{l.value=await Y.HttpRequester.getInstance(Y.DataSuggestionProvider).searchBank(o.value)}finally{a.value=!1}}},u=(m,_)=>{const y=l.value.find(b=>b.id===m.value)||{};return i.h(Mh,{bank:y,selected:_},{default:W.constant("-")})},f=m=>{d.cancel();const _=l.value.find(y=>y.id===m)||{};s("select",_)},p=i.ref(null);function g(){p.value.focus()}return t({focus:g}),(m,_)=>{const y=V.NAutoComplete;return i.openBlock(),i.createBlock(y,{ref_key:"autoCompleteElement",ref:p,value:o.value,"onUpdate:value":[_[0]||(_[0]=b=>o.value=b),i.unref(d)],clearable:m.clearable,disabled:m.disabled,loading:a.value,options:c.value,"render-label":u,placeholder:"",onSelect:f},null,8,["value","clearable","disabled","loading","options","onUpdate:value"])}}}),D2={class:"font-medium"},H2={key:0,class:"flex flex-row gap-2"},W2={key:0,class:"text-xs font-light text-blue-800"},j2={key:1,class:"text-sc-dark-grey text-xs font-light"},X2={},Ah=i.defineComponent({...X2,__name:"org-suggestion-label",props:{org:{},selected:{type:Boolean}},setup(e){const t=e,n=i.computed(()=>{var s,o;return((o=(s=t.org.rawData)==null?void 0:s.state)==null?void 0:o.liquidationDate)??!1}),r=i.computed(()=>{var s,o;return((o=(s=t.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",D2,i.toDisplayString(s.org.name),1),s.org.inn||r.value?(i.openBlock(),i.createElementBlock("div",H2,[s.org.inn?(i.openBlock(),i.createElementBlock("span",W2,i.toDisplayString(s.org.inn),1)):i.createCommentVNode("",!0),r.value?(i.openBlock(),i.createElementBlock("span",j2,i.toDisplayString(r.value),1)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)],2))}}),q2={},Y2=i.defineComponent({...q2,__name:"org-suggestion",props:i.mergeDefaults({disabled:{type:Boolean},value:{},clearable:{type:Boolean},field:{},minTermLength:{},allowSelectTerminated:{type:Boolean}},{...Yo,minTermLength:()=>Y.AppConfigProvider.getConfig().minSearchTermLength}),emits:["select","update:value"],setup(e,{expose:t,emit:n}){const r=e,s=n,o=i.ref(r.value),a=i.ref(!1),l=i.ref([]),c=_=>{var y,b;return!!(((b=(y=_.rawData)==null?void 0:y.state)==null?void 0:b.liquidationDate)??!1)},d=i.computed(()=>ln.convertReferencesToSelectOptionsList(l.value,!1,!1,_=>_[r.field??"_"]??"-",_=>!r.allowSelectTerminated&&c(_)));i.watch(()=>r.value,_=>{o.value=_}),i.watch(o,()=>{s("update:value",o.value)});const h=W.debounce(()=>u(),800),u=async()=>{if(!(!o.value||o.value.length<r.minTermLength)){a.value=!0;try{l.value=await Y.HttpRequester.getInstance(Y.DataSuggestionProvider).searchOrganization(o.value)}finally{a.value=!1}}},f=(_,y)=>{const b=l.value.find(S=>S.id===_.value)||{};return i.h(Ah,{org:b,selected:y},{default:W.constant("-")})},p=_=>{h.cancel();const y=l.value.find(b=>b.id===_)||{};(r.allowSelectTerminated||!c(y))&&s("select",y)},g=i.ref(null);function m(){g.value.focus()}return t({focus:m}),(_,y)=>{const b=V.NAutoComplete;return i.openBlock(),i.createBlock(b,{ref_key:"autoCompleteElement",ref:g,value:o.value,"onUpdate:value":[y[0]||(y[0]=S=>o.value=S),i.unref(h)],clearable:_.clearable,disabled:_.disabled,loading:a.value,options:d.value,"render-label":f,placeholder:"",onSelect:p},null,8,["value","clearable","disabled","loading","options","onUpdate:value"])}}}),U2={},G2=i.defineComponent({...U2,__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(e,{emit:t}){const n=e,r=t,s=i.ref(!1),o=()=>{r("accept",()=>{s.value=!1})},a=()=>{n.disableConfirm?o():s.value=!0};return(l,c)=>{const d=V.NButton,h=V.NPopover,u=V.NModal;return i.openBlock(),i.createElementBlock("div",null,[i.createVNode(h,{disabled:l.popoverText.length===0,placement:"bottom"},{trigger:i.withCtx(()=>[i.createVNode(d,{disabled:l.disabled,ghost:l.ghost,loading:l.loading,size:l.size,type:l.type,quaternary:l.quaternary,circle:l.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(l.popoverText),1)]),_:3},8,["disabled"]),i.createVNode(u,{show:s.value,"onUpdate:show":c[1]||(c[1]=f=>s.value=f),content:l.dialogContent,closable:!1,"mask-closable":!1,"show-icon":!1,title:l.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,__:[2]}),i.createVNode(d,{type:"default",onClick:c[0]||(c[0]=f=>s.value=!1)},{default:i.withCtx(()=>c[3]||(c[3]=[i.createTextVNode(" Отмена ")])),_:1,__:[3]})]),_:1},8,["show","content","title"])])}}}),K2={key:0,class:"whitespace-pre-line"},Z2={key:1,class:"text-sc-dark-grey"},J2={},Q2=i.defineComponent({...J2,__name:"comment-editor",props:{disabled:{type:Boolean,default:!1},comment:{default:""}},emits:["update:comment"],setup(e,{emit:t}){const n=e,r=t,s=i.ref(n.comment);i.watch(()=>s.value,l=>{s.value=l});const o=l=>{r("update:comment",s.value,l)},a=()=>{s.value=n.comment};return(l,c)=>{const d=V.NInput;return i.openBlock(),i.createBlock(Mc,{disabled:l.disabled,"onEditor:apply":o,"onEditor:cancel":a},{viewer:i.withCtx(()=>[i.createElementVNode("div",null,[l.comment?(i.openBlock(),i.createElementBlock("span",K2,i.toDisplayString(l.comment),1)):(i.openBlock(),i.createElementBlock("span",Z2," - Комментарий отсутствует - "))])]),editor:i.withCtx(()=>[i.createVNode(d,{value:s.value,"onUpdate:value":c[0]||(c[0]=h=>s.value=h),clearable:!0,type:"textarea"},null,8,["value"])]),_:1},8,["disabled"])}}}),ek={key:0,class:"text-sm"},tk={key:1},nk={},ik=i.defineComponent({...nk,__name:"debt",props:{debt:{default:0},showLabel:{type:Boolean,default:!1},wrapAsSmall:{type:Boolean,default:!1}},setup(e){const t=e,n=i.computed(()=>{let r="";return(t.showLabel??!1)&&(t.debt>0?r="Переплата: ":t.debt<0&&(r="Задолженность: ")),r});return(r,s)=>(i.openBlock(),i.createElementBlock("span",null,[r.wrapAsSmall&&r.debt!==0?(i.openBlock(),i.createElementBlock("span",ek,[i.createTextVNode(i.toDisplayString(n.value)+" ",1),i.createElementVNode("span",{class:i.normalizeClass({"text-green-700":r.debt>0,"text-red-700":r.debt<0})},i.toDisplayString(r.debt)+" ₽ ",3)])):i.createCommentVNode("",!0),!r.wrapAsSmall&&r.debt!==0?(i.openBlock(),i.createElementBlock("span",tk,[i.createTextVNode(i.toDisplayString(n.value)+" ",1),i.createElementVNode("span",{class:i.normalizeClass({"text-green-700":r.debt>0,"text-red-700":r.debt<0})},i.toDisplayString(r.debt)+" ₽ ",3)])):i.createCommentVNode("",!0)]))}}),rk={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function sk(e,t){return i.openBlock(),i.createElementBlock("svg",rk,t[0]||(t[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 ok=i.markRaw({name:"ion-warning",render:sk}),ak={},lk=i.defineComponent({...ak,__name:"warning-icon",props:{popoverText:{default:""},iconClass:{default:"text-sc-warning"}},setup(e){return(t,n)=>{const r=ok,s=V.NPopover;return i.openBlock(),i.createBlock(s,{disabled:t.popoverText.length===0,placement:"bottom"},{trigger:i.withCtx(()=>[i.createVNode(r,{class:i.normalizeClass(`ml-0.5 ${t.iconClass}`)},null,8,["class"])]),default:i.withCtx(()=>[i.createTextVNode(" "+i.toDisplayString(t.popoverText),1)]),_:1},8,["disabled"])}}});q.ConfiguratorSettingsKozyrek=qm,q.ContentHelper=In,q.KozyrekLine=ti,q.KozyrekTailTemplate=ao,q.KozyrekTemplate=Ri,q.OrdersTableFields=Ue,q.Point=oo,q.ScAddProductToCartForm=$f,q.ScAddressSuggestion=R2,q.ScAddressSuggestionLabel=Fh,q.ScBankSuggestion=L2,q.ScBankSuggestionLabel=Mh,q.ScBaseDialog=K0,q.ScButtonWithConfirmAction=G2,q.ScCategoryCollapse=va,q.ScClientNameWithShortInfo=Sr,q.ScCollapse=wa,q.ScCollapseItem=ga,q.ScCommentEditor=Q2,q.ScConfiguratorsProductInfo=qi,q.ScContragentWithShortInfo=ka,q.ScDateRange=z0,q.ScDateTimeLabel=co,q.ScDebouncedInput=g_,q.ScDebouncedInputNumber=Fi,q.ScDebt=ik,q.ScDialogHeader=q0,q.ScEmail=Xf,q.ScExternalLink=S_,q.ScImageGallery=ba,q.ScInlineEditableItem=Mc,q.ScInlineView=ho,q.ScKozyrekConfigurator=Xm,q.ScKozyrekConfiguratorParamsForm=Na,q.ScKozyrekConfiguratorPreview=Tc,q.ScKozyrekConfiguratorTemplates=Ta,q.ScLightGallery=ya,q.ScManagerSelect=y2,q.ScMetalForDoorsConfigurator=Jm,q.ScMetalForDoorsConfiguratorForm=Ec,q.ScMosquitoConfigurator=k0,q.ScMosquitoConfiguratorForm=$c,q.ScMosquitoConfiguratorMeasurementInstructions=Nc,q.ScMosquitoConfiguratorPreview=lo,q.ScOrderCommonInfo=Sh,q.ScOrderDeliveryLabel=ws,q.ScOrderDetails=$h,q.ScOrderInfo=Nh,q.ScOrderItemsList=Eh,q.ScOrderPayment=Bh,q.ScOrderProductInfo=Th,q.ScOrdersList=Uv,q.ScOrgSuggestion=Y2,q.ScOrgSuggestionLabel=Ah,q.ScPage=Ph,q.ScPageWithSlidingPanel=p2,q.ScPersonContactsBlock=Ap,q.ScPhone=gp,q.ScPhoneInput=y_,q.ScProductName=Xi,q.ScProductsList=Qw,q.ScReferenceSelect=m2,q.ScSearchableProductSelect=Ch,q.ScSearchableReferenceSelect=xh,q.ScShortTextOrderInfo=Jv,q.ScSingleFileUploadSelector=t_,q.ScSlidingContentWithDrawer=Rh,q.ScStripConfigurator=F0,q.ScStripConfiguratorForm=Rc,q.ScStripConfiguratorLineItem=Pc,q.ScStripConfiguratorPreview=Fc,q.ScUserShortInfo=qo,q.ScWarningIcon=lk,q.SelectOptionHelper=ln,q.UiProvider=pt,q.componentSizeInjectionKey=vr,q.naiveUiTheme=vu,q.renderConfig=ze,Object.defineProperty(q,Symbol.toStringTag,{value:"Module"})});
|
823
|
+
`,[yh({originalTransition:"background-color .3s var(--n-bezier), box-shadow .3s var(--n-bezier)"})])]);function bs(e){return e.type==="group"}function kh(e){return e.type==="ignored"}function Xo(e,t){try{return!!(1+t.toString().toLowerCase().indexOf(e.trim().toLowerCase()))}catch{return!1}}function Iw(e,t){return{getIsGroup:bs,getIgnored:kh,getKey(r){return bs(r)?r.name||r.key||"key-required":r[e]},getChildren(r){return r[t]}}}function Lw(e,t,n,r){if(!t)return e;function s(o){if(!Array.isArray(o))return[];const a=[];for(const l of o)if(bs(l)){const c=s(l[r]);c.length&&a.push(Object.assign({},l,{[r]:c}))}else{if(kh(l))continue;t(n,l)&&a.push(l)}return a}return s(e)}function Dw(e,t,n){const r=new Map;return e.forEach(s=>{bs(s)?s[n].forEach(o=>{r.set(o[t],o)}):r.set(s[t],s)}),r}var Hw={};const Ww=Object.assign(Object.assign({},ht.props),{to:pn.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}),jw=i.defineComponent({name:"Select",props:Ww,slots:Object,setup(e){Hw.NODE_ENV!=="production"&&i.watchEffect(()=>{e.items!==void 0&&An("select","`items` is deprecated, please use `options` instead."),e.onChange!==void 0&&An("select","`on-change` is deprecated, please use `on-update:value` instead.")});const{mergedClsPrefixRef:t,mergedBorderedRef:n,namespaceRef:r,inlineThemeDisabled:s}=hi(e),o=ht("Select","-select",zw,Vw,e,t),a=i.ref(e.defaultValue),l=i.toRef(e,"value"),c=wo(l,a),d=i.ref(!1),h=i.ref(""),u=Uc(e,["items","options"]),f=i.ref([]),p=i.ref([]),g=i.computed(()=>p.value.concat(f.value).concat(u.value)),m=i.computed(()=>{const{filter:T}=e;if(T)return T;const{labelField:D,valueField:Q}=e;return(le,ce)=>{if(!ce)return!1;const me=ce[D];if(typeof me=="string")return Xo(le,me);const be=ce[Q];return typeof be=="string"?Xo(le,be):typeof be=="number"?Xo(le,String(be)):!1}}),_=i.computed(()=>{if(e.remote)return u.value;{const{value:T}=g,{value:D}=h;return!D.length||!e.filterable?T:Lw(T,m.value,D,e.childrenField)}}),y=i.computed(()=>{const{valueField:T,childrenField:D}=e,Q=Iw(T,D);return my(_.value,Q)}),b=i.computed(()=>Dw(g.value,e.valueField,e.childrenField)),S=i.ref(!1),x=wo(i.toRef(e,"show"),S),C=i.ref(null),B=i.ref(null),v=i.ref(null),{localeRef:$}=nh("Select"),F=i.computed(()=>{var T;return(T=e.placeholder)!==null&&T!==void 0?T:$.value.placeholder}),R=[],X=i.ref(new Map),M=i.computed(()=>{const{fallbackOption:T}=e;if(T===void 0){const{labelField:D,valueField:Q}=e;return le=>({[D]:String(le),[Q]:le})}return T===!1?!1:D=>Object.assign(T(D),{value:D})});function N(T){const D=e.remote,{value:Q}=X,{value:le}=b,{value:ce}=M,me=[];return T.forEach(be=>{if(le.has(be))me.push(le.get(be));else if(D&&Q.has(be))me.push(Q.get(be));else if(ce){const ke=ce(be);ke&&me.push(ke)}}),me}const A=i.computed(()=>{if(e.multiple){const{value:T}=c;return Array.isArray(T)?N(T):[]}return null}),L=i.computed(()=>{const{value:T}=c;return!e.multiple&&!Array.isArray(T)?T===null?null:N([T])[0]||null:null}),U=Gb(e),{mergedSizeRef:P,mergedDisabledRef:E,mergedStatusRef:H}=U;function I(T,D){const{onChange:Q,"onUpdate:value":le,onUpdateValue:ce}=e,{nTriggerFormChange:me,nTriggerFormInput:be}=U;Q&&dt(Q,T,D),ce&&dt(ce,T,D),le&&dt(le,T,D),a.value=T,me(),be()}function G(T){const{onBlur:D}=e,{nTriggerFormBlur:Q}=U;D&&dt(D,T),Q()}function O(){const{onClear:T}=e;T&&dt(T)}function z(T){const{onFocus:D,showOnFocus:Q}=e,{nTriggerFormFocus:le}=U;D&&dt(D,T),le(),Q&&ie()}function J(T){const{onSearch:D}=e;D&&dt(D,T)}function pe(T){const{onScroll:D}=e;D&&dt(D,T)}function re(){var T;const{remote:D,multiple:Q}=e;if(D){const{value:le}=X;if(Q){const{valueField:ce}=e;(T=A.value)===null||T===void 0||T.forEach(me=>{le.set(me[ce],me)})}else{const ce=L.value;ce&&le.set(ce[e.valueField],ce)}}}function ge(T){const{onUpdateShow:D,"onUpdate:show":Q}=e;D&&dt(D,T),Q&&dt(Q,T),S.value=T}function ie(){E.value||(ge(!0),S.value=!0,e.filterable&&zn())}function Me(){ge(!1)}function xe(){h.value="",p.value=R}const Ce=i.ref(!1);function Fe(){e.filterable&&(Ce.value=!0)}function Ie(){e.filterable&&(Ce.value=!1,x.value||xe())}function vt(){E.value||(x.value?e.filterable?zn():Me():ie())}function xn(T){var D,Q;!((Q=(D=v.value)===null||D===void 0?void 0:D.selfRef)===null||Q===void 0)&&Q.contains(T.relatedTarget)||(d.value=!1,G(T),Me())}function Mt(T){z(T),d.value=!0}function Xt(){d.value=!0}function Tt(T){var D;!((D=C.value)===null||D===void 0)&&D.$el.contains(T.relatedTarget)||(d.value=!1,G(T),Me())}function mi(){var T;(T=C.value)===null||T===void 0||T.focus(),Me()}function _i(T){var D;x.value&&(!((D=C.value)===null||D===void 0)&&D.$el.contains(or(T))||Me())}function Vn(T){if(!Array.isArray(T))return[];if(M.value)return Array.from(T);{const{remote:D}=e,{value:Q}=b;if(D){const{value:le}=X;return T.filter(ce=>Q.has(ce)||le.has(ce))}else return T.filter(le=>Q.has(le))}}function on(T){st(T.rawNode)}function st(T){if(E.value)return;const{tag:D,remote:Q,clearFilterAfterSelect:le,valueField:ce}=e;if(D&&!Q){const{value:me}=p,be=me[0]||null;if(be){const ke=f.value;ke.length?ke.push(be):f.value=[be],p.value=R}}if(Q&&X.value.set(T[ce],T),e.multiple){const me=Vn(c.value),be=me.findIndex(ke=>ke===T[ce]);if(~be){if(me.splice(be,1),D&&!Q){const ke=te(T[ce]);~ke&&(f.value.splice(ke,1),le&&(h.value=""))}}else me.push(T[ce]),le&&(h.value="");I(me,N(me))}else{if(D&&!Q){const me=te(T[ce]);~me?f.value=[f.value[me]]:f.value=R}Di(),Me(),I(T[ce],T)}}function te(T){return f.value.findIndex(Q=>Q[e.valueField]===T)}function ne(T){x.value||ie();const{value:D}=T.target;h.value=D;const{tag:Q,remote:le}=e;if(J(D),Q&&!le){if(!D){p.value=R;return}const{onCreate:ce}=e,me=ce?ce(D):{[e.labelField]:D,[e.valueField]:D},{valueField:be,labelField:ke}=e;u.value.some(Xe=>Xe[be]===me[be]||Xe[ke]===me[ke])||f.value.some(Xe=>Xe[be]===me[be]||Xe[ke]===me[ke])?p.value=R:p.value=[me]}}function je(T){T.stopPropagation();const{multiple:D}=e;!D&&e.filterable&&Me(),O(),D?I([],[]):I(null,null)}function wr(T){!sr(T,"action")&&!sr(T,"empty")&&!sr(T,"header")&&T.preventDefault()}function Li(T){pe(T)}function yi(T){var D,Q,le,ce,me;if(!e.keyboard){T.preventDefault();return}switch(T.key){case" ":if(e.filterable)break;T.preventDefault();case"Enter":if(!(!((D=C.value)===null||D===void 0)&&D.isComposing)){if(x.value){const be=(Q=v.value)===null||Q===void 0?void 0:Q.getPendingTmNode();be?on(be):e.filterable||(Me(),Di())}else if(ie(),e.tag&&Ce.value){const be=p.value[0];if(be){const ke=be[e.valueField],{value:Xe}=c;e.multiple&&Array.isArray(Xe)&&Xe.includes(ke)||st(be)}}}T.preventDefault();break;case"ArrowUp":if(T.preventDefault(),e.loading)return;x.value&&((le=v.value)===null||le===void 0||le.prev());break;case"ArrowDown":if(T.preventDefault(),e.loading)return;x.value?(ce=v.value)===null||ce===void 0||ce.next():ie();break;case"Escape":x.value&&(Xb(T),Me()),(me=C.value)===null||me===void 0||me.focus();break}}function Di(){var T;(T=C.value)===null||T===void 0||T.focus()}function zn(){var T;(T=C.value)===null||T===void 0||T.focusInput()}function bi(){var T;x.value&&((T=B.value)===null||T===void 0||T.syncPosition())}re(),i.watch(i.toRef(e,"options"),re);const Hi={focus:()=>{var T;(T=C.value)===null||T===void 0||T.focus()},focusInput:()=>{var T;(T=C.value)===null||T===void 0||T.focusInput()},blur:()=>{var T;(T=C.value)===null||T===void 0||T.blur()},blurInput:()=>{var T;(T=C.value)===null||T===void 0||T.blurInput()}},qt=i.computed(()=>{const{self:{menuBoxShadow:T}}=o.value;return{"--n-menu-box-shadow":T}}),Cn=s?ui("select",void 0,qt,e):void 0;return Object.assign(Object.assign({},Hi),{mergedStatus:H,mergedClsPrefix:t,mergedBordered:n,namespace:r,treeMate:y,isMounted:ss(),triggerRef:C,menuRef:v,pattern:h,uncontrolledShow:S,mergedShow:x,adjustedTo:pn(e),uncontrolledValue:a,mergedValue:c,followerRef:B,localizedPlaceholder:F,selectedOption:L,selectedOptions:A,mergedSize:P,mergedDisabled:E,focused:d,activeWithoutMenuOpen:Ce,inlineThemeDisabled:s,onTriggerInputFocus:Fe,onTriggerInputBlur:Ie,handleTriggerOrMenuResize:bi,handleMenuFocus:Xt,handleMenuBlur:Tt,handleMenuTabOut:mi,handleTriggerClick:vt,handleToggle:on,handleDeleteOption:st,handlePatternInput:ne,handleClear:je,handleTriggerBlur:xn,handleTriggerFocus:Mt,handleKeydown:yi,handleMenuAfterLeave:xe,handleMenuClickOutside:_i,handleMenuScroll:Li,handleMenuKeydown:yi,handleMenuMousedown:wr,mergedTheme:o,cssVars:s?void 0:qt,themeClass:Cn==null?void 0:Cn.themeClass,onRender:Cn==null?void 0:Cn.onRender})},render(){return i.h("div",{class:`${this.mergedClsPrefix}-select`},i.h(Jc,null,{default:()=>[i.h(Qc,null,{default:()=>i.h(Aw,{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 e,t;return[(t=(e=this.$slots).arrow)===null||t===void 0?void 0:t.call(e)]}})}),i.h(pd,{ref:"followerRef",show:this.mergedShow,to:this.adjustedTo,teleportDisabled:this.adjustedTo===pn.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 e,t,n;return this.mergedShow||this.displayDirective==="show"?((e=this.onRender)===null||e===void 0||e.call(this),i.withDirectives(i.h(dw,Object.assign({},this.menuProps,{ref:"menuRef",onResize:this.handleTriggerOrMenuResize,inlineThemeDisabled:this.inlineThemeDisabled,virtualScroll:this.consistentMenuWidth&&this.virtualScroll,class:[`${this.mergedClsPrefix}-select-menu`,this.themeClass,(t=this.menuProps)===null||t===void 0?void 0:t.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],[rs,this.handleMenuClickOutside,void 0,{capture:!0}]]:[[rs,this.handleMenuClickOutside,void 0,{capture:!0}]])):null}})})]}))}}),Xw={},xh=i.defineComponent({...Xw,__name:"searchable-reference-select",props:{searchDataHandler:{},optionsListConverter:{},wrapContent:{type:Boolean,default:!1},renderLabel:{},renderTag:{},value:{},clearable:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},minTermLength:{default:()=>Y.AppConfigProvider.getConfig().minSearchTermLength},consistentMenuWidth:{type:Boolean,default:!1},placeholder:{default:""}},emits:["update:value"],setup(e,{expose:t,emit:n}){const r=e,s=n,o=i.computed(()=>W.isArray(r.value)),a=i.computed(()=>o.value?r.value.map(b=>b.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(b=>({...b,class:r.wrapContent?`${b.class} consistent-menu-width`:b.class}))),d=i.ref(!1),h=i.useTemplateRef("select-component"),u=b=>{b.length<r.minTermLength||(d.value=!0,r.searchDataHandler(b,d).then(S=>{if(W.isEmpty(S))return;const x=o.value?r.value:r.value?[r.value]:[],C=S.filter(B=>!x.some(v=>v.id===B.id));l.value=r.optionsListConverter([...x,...C])}).finally(()=>{d.value=!1}))};let f="";const p=W.debounce(()=>u(f),800),g=b=>{f=b,p()},m=b=>{var S;if(W.isArray(b)){const x=b.length>0?b.map(C=>{var B;return i.toRaw((B=l.value.find(v=>v.value===C))==null?void 0:B.item)}):[];s("update:value",x)}else if(b>0){const x=i.toRaw((S=l.value.find(C=>C.value===b))==null?void 0:S.item);s("update:value",x)}else s("update:value",null)};return t({focus:()=>{var b;return(b=h.value)==null?void 0:b.focusInput()},blur:()=>{var b;return(b=h.value)==null?void 0:b.blurInput()}}),(b,S)=>(i.openBlock(),i.createBlock(i.unref(jw),{ref:"select-component","clear-filter-after-select":!0,clearable:b.clearable,"consistent-menu-width":b.consistentMenuWidth,disabled:b.disabled,filterable:!0,loading:d.value,multiple:o.value,options:c.value,placeholder:b.placeholder,remote:!0,value:a.value,"render-label":b.renderLabel,"render-tag":b.renderTag,onSearch:g,"onUpdate:value":m},null,8,["clearable","consistent-menu-width","disabled","loading","multiple","options","placeholder","value","render-label","render-tag"]))}}),qw={},Ch=i.defineComponent({...qw,__name:"searchable-product-select",props:{wrapContent:{type:Boolean,default:!1},renderLabel:{},renderTag:{},value:{},clearable:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},minTermLength:{default:()=>Y.AppConfigProvider.getConfig().minSearchTermLength},consistentMenuWidth:{type:Boolean,default:!1},placeholder:{default:""},searchType:{}},emits:["update:value"],setup(e,{expose:t,emit:n}){const r=e,s=n,o=i.useTemplateRef("select-component"),a=async u=>r.searchType==="categories"?Y.HttpRequester.getInstance(Y.ProductCategoryDataProvider).publicSimpleSearch(u):r.searchType==="products"?Y.HttpRequester.getInstance(Y.ProductDataProvider).publicSimpleSearch(u):new Promise(f=>{f([])}),l=u=>r.searchType==="categories"?ln.convertReferencesToSelectOptionsList(u,!0,!1,f=>f!=null&&f.isNewRec()?"-":f.name):r.searchType==="products"?ln.convertReferencesToSelectOptionsList(u,!0,!1,f=>f!=null&&f.isNewRec()?"-":`[${f.code}] ${f.name}`):[],c=(u,f)=>{if(r.renderLabel)return r.renderLabel(u,f);if(r.searchType==="products"){const p=u.item;return i.h("div",{},[i.h("span",{class:"text-sc-grey mr-2.5"},p.code),i.h("span",{},[p.name])])}if(r.searchType==="categories"){const p=u.item;return i.h("div",{},[p.name])}};return t({focus:()=>{var u;return(u=o.value)==null?void 0:u.focus()},blur:()=>{var u;return(u=o.value)==null?void 0:u.blur()}}),(u,f)=>(i.openBlock(),i.createBlock(xh,{ref:"select-component",value:u.value,clearable:u.clearable,disabled:u.disabled,placeholder:u.placeholder,"search-data-handler":a,"options-list-converter":l,"consistent-menu-width":u.consistentMenuWidth,"wrap-content":u.wrapContent,"min-term-length":u.minTermLength,"render-label":c,"render-tag":u.renderTag,"onUpdate:value":f[0]||(f[0]=p=>s("update:value",p))},null,8,["value","clearable","disabled","placeholder","consistent-menu-width","wrap-content","min-term-length","render-tag"]))}}),Yw={class:"col-span-2 flex flex-row gap-2.5"},Uw={class:"flex-1"},Gw={class:"text-sc-grey"},Kw={class:"ml-2.5"},Zw={key:0,class:"flex-none"},Jw={},Qw=i.defineComponent({...Jw,__name:"products-list",props:{value:{},searchType:{},minTermLength:{default:()=>Y.AppConfigProvider.getConfig().minSearchTermLength},disabled:{type:Boolean}},emits:["update:value"],setup(e,{emit:t}){const n=e,r=t,s=i.ref(null),o=()=>structuredClone(i.toRaw(n.value)),a=i.ref(o()),l=()=>{r("update:value",a.value.map(u=>i.toRaw(u)))},c=u=>{u&&(a.value=[...a.value.map(f=>i.toRaw(f)),...(W.isArray(u)?u:[u]).filter(f=>!a.value.some(p=>p.id===f.id))],i.nextTick(()=>{s.value=null}),l())},d=u=>{u&&(a.value=a.value.map(f=>f.id===u.id?u:i.toRaw(f)),l())},h=u=>{a.value=a.value.filter(f=>f.id!==u.id),l()};return i.watch(()=>n.value,()=>{a.value=o()}),(u,f)=>{const p=V.NListItem,g=E_,m=V.NButton,_=V.NList;return i.openBlock(),i.createBlock(_,{"show-divider":!1,hoverable:!0},{header:i.withCtx(()=>[i.renderSlot(u.$slots,"header")]),footer:i.withCtx(()=>[i.createVNode(Ch,{value:s.value,"onUpdate:value":[f[0]||(f[0]=y=>s.value=y),c],clearable:!0,disabled:u.disabled,"min-term-length":u.minTermLength,"search-type":u.searchType,placeholder:"Введите название"},null,8,["value","disabled","min-term-length","search-type"])]),default:i.withCtx(()=>[a.value.length===0?(i.openBlock(),i.createBlock(p,{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,y=>(i.openBlock(),i.createBlock(p,{key:y.id},{suffix:i.withCtx(()=>[i.createVNode(m,{disabled:u.disabled,quaternary:"",type:"error",onClick:b=>h(y)},{default:i.withCtx(()=>[i.createVNode(g)]),_:2},1032,["disabled","onClick"])]),default:i.withCtx(()=>[i.createElementVNode("div",Yw,[i.createElementVNode("span",Uw,[i.createElementVNode("span",Gw,i.toDisplayString(y.code),1),i.createElementVNode("span",Kw,i.toDisplayString(y.name),1)]),u.$slots["item-extra"]?(i.openBlock(),i.createElementBlock("div",Zw,[i.renderSlot(u.$slots,"item-extra",{item:y,updateItemCallback:d})])):i.createCommentVNode("",!0)])]),_:2},1024))),128))]),_:3})}}}),ev={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function tv(e,t){return i.openBlock(),i.createElementBlock("svg",ev,t[0]||(t[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 nv=i.markRaw({name:"tabler-truck-filled",render:tv}),iv={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function rv(e,t){return i.openBlock(),i.createElementBlock("svg",iv,t[0]||(t[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 sv=i.markRaw({name:"tabler-truck-delivery",render:rv}),ov={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function av(e,t){return i.openBlock(),i.createElementBlock("svg",ov,t[0]||(t[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 lv=i.markRaw({name:"tabler-truck-loading",render:av}),cv={class:"flex flex-col gap-1"},dv={key:0,class:"flex flex-row gap-1 text-base"},hv={key:1,class:"text-sc-dark-grey text-sm"},uv={class:"text-sc-grey mr-1.5"},fv={key:0},pv={key:1},gv={key:2},mv={},ws=i.defineComponent({...mv,__name:"order-delivery-label",props:{delivery:{},showType:{type:Boolean,default:!0},showDetails:{type:Boolean,default:!0}},setup(e){const t=i.computed(()=>{var s;return(s=Y.useReferencesStore().deliveryTypeReference)==null?void 0:s.find(o=>o.id===r.delivery.type)}),n=i.computed(()=>Sn.format(r.delivery.date,"dd.MM.yyyy")),r=e;return(s,o)=>{var d,h,u,f,p,g,m,_;const a=lv,l=sv,c=nv;return i.openBlock(),i.createElementBlock("div",cv,[s.showType?(i.openBlock(),i.createElementBlock("span",dv,[((d=t.value)==null?void 0:d.slug)==="self_delivery"?(i.openBlock(),i.createBlock(a,{key:0})):i.createCommentVNode("",!0),((h=t.value)==null?void 0:h.slug)==="delivery"?(i.openBlock(),i.createBlock(l,{key:1})):i.createCommentVNode("",!0),((u=t.value)==null?void 0:u.slug)==="transport_company_delivery"?(i.openBlock(),i.createBlock(c,{key:2})):i.createCommentVNode("",!0),i.createElementVNode("span",null,i.toDisplayString((f=t.value)==null?void 0:f.name),1)])):i.createCommentVNode("",!0),s.showDetails?(i.openBlock(),i.createElementBlock("span",hv,[i.createElementVNode("span",uv,i.toDisplayString(n.value),1),(g=(p=s.delivery)==null?void 0:p.address)!=null&&g.address?(i.openBlock(),i.createElementBlock("span",fv,i.toDisplayString(s.delivery.address.address),1)):i.createCommentVNode("",!0),(_=(m=s.delivery)==null?void 0:m.warehouse)!=null&&_.address?(i.openBlock(),i.createElementBlock("span",pv,"со склада "+i.toDisplayString(s.delivery.warehouse.address),1)):(i.openBlock(),i.createElementBlock("span",gv,"(не указано)"))])):i.createCommentVNode("",!0)])}}}),_v={class:"flex flex-col gap-2.5"},yv={class:"text-base"},bv=["href"],wv={class:"text-sc-grey"},vv={},Sh=i.defineComponent({...vv,__name:"order-common-info",props:{order:{},fields:{},orderUrl:{}},setup(e){const t=e,n=i.computed(()=>t.fields.includes(Ue.Id)?t.order.id:void 0),r=i.computed(()=>{var l,c;return t.fields.includes(Ue.Status)?(c=(l=Y.useReferencesStore().orderStatusReference)==null?void 0:l.find(d=>d.id===(t.order.status??-1)))==null?void 0:c.name:void 0}),s=i.computed(()=>t.fields.includes(Ue.CreatedAt)),o=i.computed(()=>t.fields.includes(Ue.ClientInfo)?t.order.client:void 0),a=i.computed(()=>t.fields.includes(Ue.DeliveryInfo)?t.order.delivery:void 0);return(l,c)=>(i.openBlock(),i.createElementBlock("div",_v,[i.createElementVNode("span",yv,[n.value?(i.openBlock(),i.createElementBlock("a",{key:0,href:l.orderUrl.replace(":id",l.order.id.toString()),target:"_blank",class:"text-sc-dark-grey"}," #"+i.toDisplayString(n.value),9,bv)):i.createCommentVNode("",!0),s.value?(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[c[0]||(c[0]=i.createTextVNode(" от ")),i.createVNode(co,{date:l.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(" - ")),i.createElementVNode("span",wv,i.toDisplayString(r.value),1)],64)):i.createCommentVNode("",!0)]),o.value?(i.openBlock(),i.createBlock(Sr,{key:0,client:o.value,class:"ml-3"},null,8,["client"])):i.createCommentVNode("",!0),a.value?(i.openBlock(),i.createBlock(ws,{key:1,delivery:a.value,class:"ml-3"},null,8,["delivery"])):i.createCommentVNode("",!0)]))}}),kv={},Bh=i.defineComponent({...kv,__name:"order-payment",props:{payment:{}},setup(e){const t=e,n=i.computed(()=>{var r;return(r=Y.useReferencesStore().paymentTypeReference)==null?void 0:r.find(s=>s.id===t.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)}}}),xv={class:"flex flex-row gap-1.5"},Cv={class:"flex-none text-nowrap"},Sv={class:"flex flex-1 flex-col"},Bv={class:"mt-2.5 grid grid-flow-col grid-rows-2 gap-1 text-base"},Tv={key:0},Ev={key:1},$v={},Th=i.defineComponent({...$v,__name:"order-product-info",props:{product:{},index:{}},setup(e){return(t,n)=>(i.openBlock(),i.createElementBlock("div",xv,[i.createElementVNode("span",Cv,i.toDisplayString(t.index+1)+".",1),i.createElementVNode("div",Sv,[i.createVNode(Xi,{product:t.product.product,"show-planning-dates":!1},null,8,["product"]),i.createElementVNode("div",Bv,[n[0]||(n[0]=i.createElementVNode("span",null,"Кол-во",-1)),t.product.product.getIsMeasurable()?(i.openBlock(),i.createElementBlock("span",Tv,i.toDisplayString(`${t.product.length} ${t.product.product.unit} x ${t.product.quantity} шт.`),1)):(i.openBlock(),i.createElementBlock("span",Ev,i.toDisplayString(`${t.product.quantity} ${t.product.product.unit}`),1)),n[1]||(n[1]=i.createElementVNode("span",null,"Цена за ед.",-1)),i.createElementVNode("span",null,i.toDisplayString(`${t.product.costOneRub.toLocaleString("ru-ru",{minimumFractionDigits:2})} ${t.product.currency}`),1),n[2]||(n[2]=i.createElementVNode("span",null,"Сумма",-1)),i.createElementVNode("span",null,i.toDisplayString(`${t.product.cost.toLocaleString("ru-ru",{minimumFractionDigits:2})} ${t.product.currency}`),1)])])]))}}),Nv={},Pv=i.defineComponent({...Nv,__name:"order-items-list",props:{order:{}},setup(e){const t=()=>{const s=[{title:"№ п.п.",key:"id",resizable:!0,width:50,render:(o,a)=>i.h("span",{class:"text-base"},[a+1,"."])},{title:"Артикул",key:"codeNumber",resizable:!0,minWidth:120,render:o=>i.h("span",{class:"text-base"},[o.product.code])},{title:"Наименование",key:"name",resizable:!0,render:o=>i.h(Xi,{product:o.product,showCode:!1,showPlanningDates:!1})},{title:"Кол-во",key:"quantity",resizable:!0,minWidth:100,render:o=>i.h("span",{class:"text-nowrap text-base"},o.product.getIsMeasurable()?[`${o.length} ${o.product.unit} x ${o.quantity} шт.`]:[`${o.quantity} ${o.product.unit}`])},{title:"Цена за ед.",key:"costOneRub",resizable:!0,minWidth:100,render:o=>i.h("span",{class:"text-base"},[`${o.costOneRub.toLocaleString("ru-ru",{minimumFractionDigits:2})} ${o.currency}`])},{title:"Сумма",key:"cost",resizable:!0,minWidth:100,render:o=>i.h("span",{class:"text-base"},[`${o.cost.toLocaleString("ru-ru",{minimumFractionDigits:2})} ${o.currency}`])}];switch(pt.getDeviceTypeByResolution()){case Y.WindowResolutionEnum.phone:case Y.WindowResolutionEnum.tablet:return[{title:"",key:"items",resizable:!0,render:(o,a)=>i.h(Th,{product:o,index:a})}];case Y.WindowResolutionEnum.laptop:return s;default:return s}},n=i.ref(t()),r=()=>{n.value=t()};return i.onMounted(()=>{r(),window.addEventListener("resize",r)}),i.onUnmounted(()=>{window.removeEventListener("resize",r)}),(s,o)=>{const a=V.NDataTable;return i.openBlock(),i.createElementBlock(i.Fragment,null,[o[0]||(o[0]=i.createElementVNode("h3",null,"Список позиций",-1)),i.createVNode(a,{columns:n.value,data:s.order.products,"row-key":l=>l.id,"bottom-bordered":!1,bordered:!1},null,8,["columns","data","row-key"])],64)}}}),Eh=Ln(Pv,[["__scopeId","data-v-b1bc6269"]]),Rv={class:"text-base"},Fv={},qo=i.defineComponent({...Fv,__name:"user-short-info",props:{user:{},showUserType:{type:Boolean,default:!0},extraInfoOnSecondLine:{type:Boolean,default:!0}},setup(e){return(t,n)=>(i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass({"flex flex-col":t.showUserType&&t.extraInfoOnSecondLine})},[i.createElementVNode("span",Rv,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))}}),Mv={class:"ml-4 grid grid-cols-3 gap-1.5 text-base"},Av={class:"col-span-2"},Ov={class:"col-span-2"},Vv={class:"btn btn-primary",href:"{{ invoice }}"},zv={},$h=i.defineComponent({...zv,__name:"order-details",props:{order:{}},setup(e){return(t,n)=>(i.openBlock(),i.createElementBlock("div",null,[n[11]||(n[11]=i.createElementVNode("h3",null,"Детали заказа",-1)),i.createElementVNode("div",Mv,[t.order.creator.id!==t.order.client.id?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[n[0]||(n[0]=i.createElementVNode("span",null,"Создал",-1)),i.createVNode(qo,{user:t.order.creator,class:"col-span-2"},null,8,["user"])],64)):i.createCommentVNode("",!0),n[10]||(n[10]=i.createElementVNode("span",null,"Клиент",-1)),i.createVNode(Sr,{client:t.order.client,class:"col-span-2"},null,8,["client"]),t.order.contragent?(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[n[1]||(n[1]=i.createElementVNode("span",null,"Контрагент",-1)),i.createVNode(ka,{contragent:t.order.contragent,class:"col-span-2"},null,8,["contragent"])],64)):i.createCommentVNode("",!0),t.order.image?(i.openBlock(),i.createElementBlock(i.Fragment,{key:2},[n[2]||(n[2]=i.createElementVNode("span",null,"Графический файл клиента",-1)),n[3]||(n[3]=i.createElementVNode("a",{class:"fancybox col-span-2",href:"{{ order.image }}"}," Посмотреть ",-1))],64)):i.createCommentVNode("",!0),t.order.barcode?(i.openBlock(),i.createElementBlock(i.Fragment,{key:3},[n[4]||(n[4]=i.createElementVNode("span",null,"Штрих-код",-1)),i.createElementVNode("span",Av,i.toDisplayString(t.order.barcode),1)],64)):i.createCommentVNode("",!0),t.order.payment?(i.openBlock(),i.createElementBlock(i.Fragment,{key:4},[n[5]||(n[5]=i.createElementVNode("span",null,"Оплата",-1)),i.createVNode(Bh,{payment:t.order.payment,class:"col-span-2"},null,8,["payment"])],64)):i.createCommentVNode("",!0),t.order.delivery?(i.openBlock(),i.createElementBlock(i.Fragment,{key:5},[n[6]||(n[6]=i.createElementVNode("span",null,"Доставка",-1)),i.createVNode(ws,{delivery:t.order.delivery,class:"col-span-2"},null,8,["delivery"])],64)):i.createCommentVNode("",!0),t.order.comment?(i.openBlock(),i.createElementBlock(i.Fragment,{key:6},[n[7]||(n[7]=i.createElementVNode("span",null,"Комментарий",-1)),i.createElementVNode("span",Ov,i.toDisplayString(t.order.comment),1)],64)):i.createCommentVNode("",!0),t.order.attachedUser?(i.openBlock(),i.createElementBlock(i.Fragment,{key:7},[n[8]||(n[8]=i.createElementVNode("span",null,"Закреплен за",-1)),i.createVNode(qo,{user:t.order.attachedUser,class:"col-span-2"},null,8,["user"])],64)):i.createCommentVNode("",!0),t.order.invoices&&t.order.invoices.length>0?(i.openBlock(),i.createElementBlock(i.Fragment,{key:8},[n[9]||(n[9]=i.createElementVNode("span",null,"Прикрепленные счета",-1)),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(t.order.invoices,(r,s)=>(i.openBlock(),i.createElementBlock("div",{key:s,class:"col-span-2"},[i.createElementVNode("a",Vv," Скачать счет №"+i.toDisplayString(s+1),1)]))),128))],64)):i.createCommentVNode("",!0)])]))}}),Iv={key:0},Lv={class:"text-sc-dark-grey my-2 text-center"},Dv={key:1,class:"text-sc-dark-grey my-2 text-center"},Hv={key:2},Wv={class:"text-sc-dark-grey mt-4 text-right font-bold"},jv={class:"text-sc-primary"},Xv={},Nh=i.defineComponent({...Xv,__name:"order-info",props:{order:{}},setup(e){const t=e,n=i.ref(!1),r=i.ref(new Y.Order(t.order)),s=()=>{n.value=!0,Y.HttpRequester.getInstance(Y.OrdersDataProvider).getOrder(t.order.id).then(a=>{r.value=a}).finally(()=>{n.value=!1})},o=i.computed(()=>(r.value.products??[]).reduce((a,l)=>a+l.costRub,0).toLocaleString("ru-ru",{minimumFractionDigits:2}));return i.onMounted(()=>{s()}),(a,l)=>{const c=V.NSpin;return n.value?(i.openBlock(),i.createElementBlock("div",Iv,[i.createElementVNode("div",Lv,[i.createVNode(c,{size:"small",class:"mb-2.5 align-middle"}),l[0]||(l[0]=i.createElementVNode("div",null,[i.createElementVNode("span",null,"Загрузка данных ...")],-1))])])):r.value.products.length===0?(i.openBlock(),i.createElementBlock("div",Dv," --- Не удалось загрузить данные о заказе --- ")):(i.openBlock(),i.createElementBlock("div",Hv,[i.createVNode(Eh,{order:r.value},null,8,["order"]),i.createElementVNode("div",Wv,[l[1]||(l[1]=i.createTextVNode(" ИТОГО: ")),i.createElementVNode("span",jv,i.toDisplayString(o.value)+" ₽",1)]),i.createVNode($h,{order:r.value},null,8,["order"])]))}}}),qv={},Yv=i.defineComponent({...qv,__name:"orders-list",props:{fields:{},orderUrl:{},filters:{},sort:{},pagination:{}},setup(e){const t=e,n=()=>structuredClone(i.toRaw(t.sort??{field:"id",direction:"desc"})),r=i.ref(n()),s=i.ref([]),o=i.ref(!1),a=i.computed(()=>Y.useReferencesStore().orderStatusReference),l=()=>{const m=t.fields.length>0?t.fields:[Ue.CreatedAt,Ue.Id,Ue.DeliveryInfo,Ue.Status,Ue.SalesDirections,Ue.AttachedUser],_={title:"???",key:"undefined",render:()=>i.h("span",{},["--- unknown ---"])},y={type:"expand",expandable:W.constant(!0),renderExpand:S=>i.h(Nh,{order:S,class:"pl-10 pt-3 pb-10"}),width:"30"},b=[{title:"Дата заказа",key:Ue.CreatedAt,resizable:!0,minWidth:100,render:S=>i.h(co,{date:S.createdAt,isTimeSecondary:!0,isTimeOnSecondLine:!0,class:"text-base"})},{title:"Номер заказа",key:Ue.Id,resizable:!0,minWidth:70,render:S=>i.h("a",{href:t.orderUrl.replace(":id",S.id.toString()),target:"_blank",class:"text-base"},S.id)},{title:"Клиент",key:Ue.ClientInfo,resizable:!0,render:S=>i.h(Sr,{client:S.client})},{title:"Тип доставки",key:Ue.DeliveryInfo,resizable:!0,render:S=>i.h(ws,{delivery:S.delivery})},{title:"Статус",key:Ue.Status,resizable:!0,minWidth:90,render:S=>{var x,C;return i.h("span",{class:"text-base"},[((C=(x=a.value)==null?void 0:x.find(B=>B.id===(S.status??-1)))==null?void 0:C.name)??""])}},{title:"Напр. продаж",key:Ue.SalesDirections,resizable:!0,minWidth:70,render:S=>i.h("span",{class:"text-base"},[S.salesDirection.name])},{title:"Закреплено за",key:Ue.AttachedUser,resizable:!0,render:S=>{var x;return i.h("span",{class:"text-base"},[(x=S==null?void 0:S.attachedUser)==null?void 0:x.name])}}];switch(pt.getDeviceTypeByResolution()){case Y.WindowResolutionEnum.phone:case Y.WindowResolutionEnum.tablet:return[y,{key:"order",title:"Заказ",resizable:!0,render:S=>i.h(Sh,{order:S,fields:m,orderUrl:t.orderUrl})}];case Y.WindowResolutionEnum.laptop:return[y,...m.map(S=>b.find(x=>x.key===S)??_)];default:return[_]}},c=i.ref(l()),d=i.ref(new Y.DataTablePagination(t.pagination??{page:1,pageSize:10,itemCount:0,pageCount:1,pageSlot:5,pageSizes:[10,15,25],showSizePicker:!1})),h=()=>{t.filters&&(o.value=!0,Y.HttpRequester.getInstance(Y.OrdersDataProvider).getOrders(t.filters,r.value,{page:d.value.page,pageSize:d.value.pageSize}).then(m=>{d.value.itemCount!==m.meta.total&&(d.value.itemCount=m.meta.total),d.value.page!==m.meta.currentPage&&(d.value.page=m.meta.currentPage),d.value.pageCount!==m.meta.lastPage&&(d.value.pageCount=m.meta.lastPage),d.value.pageSize!==m.meta.perPage&&(d.value.pageSize=m.meta.perPage),s.value=m.data}).finally(()=>{o.value=!1}))},u=m=>{d.value.page=m,h()},f=m=>{d.value.pageSize=m,h()},p=m=>{W.isNull(m)?r.value=n():(r.value.field=m.columnKey.toString(),r.value.direction=m.order==="ascend"?"asc":"desc"),c.value.forEach(_=>{if(Object.hasOwn(_,"sortOrder")){const y=_;y.sortOrder=y.key===(m==null?void 0:m.columnKey)&&(m!=null&&m.sorter)&&m.order!==!1?m.order:!1}}),h()},g=()=>{c.value=l()};return i.watch(()=>t.filters,()=>{h()}),i.watch(()=>t.sort,()=>{r.value=n(),h()}),i.onMounted(()=>{g(),window.addEventListener("resize",g),i.nextTick(()=>{h()})}),i.onUnmounted(()=>{window.removeEventListener("resize",g)}),(m,_)=>{const y=V.NDataTable;return i.openBlock(),i.createBlock(y,{columns:c.value,data:s.value,"row-key":b=>b.id,pagination:d.value,loading:o.value,remote:!0,bordered:!1,"bottom-bordered":!1,"sticky-expanded-rows":!0,"pagination-behavior-on-filter":"first","onUpdate:page":u,"onUpdate:pageSize":f,"onUpdate:sorter":p},null,8,["columns","data","row-key","pagination","loading"])}}}),Uv=Ln(Yv,[["__scopeId","data-v-d66ad43e"]]),Gv=["href"],Kv={class:"text-sc-dark-grey"},Zv={},Jv=i.defineComponent({...Zv,__name:"short-text-order-info",props:{order:{},orderLink:{}},emits:["click:order-id"],setup(e,{emit:t}){const n=e,r=t,s=i.computed(()=>Sn.format(n.order.createdAt,Y.AppConfigProvider.getConfig().dateFormats.uiDateWithTime)),o=a=>{W.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(" #")),i.createElementVNode("a",{href:a.orderLink??"#",onClick:l[0]||(l[0]=c=>o(c))},i.toDisplayString(a.order.id),9,Gv),i.createTextVNode(" от "+i.toDisplayString(s.value),1),a.order.isApproved1c?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[i.createTextVNode(" (подтверждён)")],64)):i.createCommentVNode("",!0)]),l[2]||(l[2]=i.createTextVNode(", ")),i.createElementVNode("span",Kv,"автор: "+i.toDisplayString(a.order.creator.name)+" ["+i.toDisplayString(a.order.creator.type)+"]",1)],64))}}),Qv={class:"sc-page flex flex-col"},e2={class:"my-2 flex flex-row items-end"},t2={class:"sc-title grow"},n2={key:0,class:"sc-title-buttons flex-1 grow-0"},i2={class:"flex flex-col justify-end gap-1 sm:mt-0 sm:flex-row"},r2={key:0,class:"sc-title-extra mt-2 sm:mt-4"},s2={},Ph=i.defineComponent({...s2,__name:"page",props:{title:{}},setup(e){return(t,n)=>{const r=V.NH1;return i.openBlock(),i.createElementBlock("div",Qv,[i.createElementVNode("div",e2,[i.createElementVNode("div",t2,[i.renderSlot(t.$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})])]),t.$slots["title-buttons"]?(i.openBlock(),i.createElementBlock("div",n2,[i.createElementVNode("div",i2,[i.renderSlot(t.$slots,"title-buttons")])])):i.createCommentVNode("",!0)]),t.$slots["title-extra"]?(i.openBlock(),i.createElementBlock("div",r2,[i.renderSlot(t.$slots,"title-extra")])):i.createCommentVNode("",!0),i.renderSlot(t.$slots,"default")])}}}),o2={class:"overflow-hidden transition-all duration-300"},a2={class:"text-lg font-medium leading-none"},l2={},Rh=i.defineComponent({...l2,__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(e,{emit:t}){const n=e,r=t,s=i.ref(0),o=i.ref(n.showDrawer),a=()=>{switch(pt.getDeviceTypeByResolution()){case Y.WindowResolutionEnum.phone:return window.innerWidth*.66;case Y.WindowResolutionEnum.tablet:return window.innerWidth*.5;default:return window.innerWidth*.33}},l=()=>{o.value?W.isUndefined(n.drawerWidth)?s.value=a():s.value=W.isFunction(n.drawerWidth)?n.drawerWidth():n.drawerWidth:s.value=0};return i.watch(()=>n.drawerWidth,()=>{l()}),i.watch(()=>o.value,()=>{l(),r("update:show-drawer",o.value)}),i.watch(()=>n.showDrawer,c=>{o.value=c}),i.onUnmounted(()=>{window.removeEventListener("resize",l)}),l(),window.addEventListener("resize",l),(c,d)=>{const h=V.NDrawerContent,u=V.NDrawer;return i.openBlock(),i.createElementBlock(i.Fragment,null,[i.createElementVNode("div",o2,[i.createElementVNode("div",{style:i.normalizeStyle(`margin-left: ${s.value}px;`),class:"w-full"},[i.renderSlot(c.$slots,"default")],4)]),i.createVNode(u,{show:o.value,"onUpdate:show":d[0]||(d[0]=f=>o.value=f),resizable:!0,width:s.value,placement:"left"},{default:i.withCtx(()=>[i.createVNode(h,{closable:""},{header:i.withCtx(()=>[i.renderSlot(c.$slots,"drawer-header",{},()=>[i.createElementVNode("div",a2,i.toDisplayString(c.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)}}}),c2={key:0,ref:"panel-component-ref",class:"sc-page-panel flex flex-row gap-2.5 sm:gap-8"},d2={key:0},h2={class:"sc-page-preview-panel grow"},u2={key:1,class:"sc-page-preview-panel-extra flex-none"},f2={},p2=i.defineComponent({...f2,__name:"page-with-sliding-panel",props:{title:{},isShowPanelButtonVisible:{type:Boolean,default:!0},showPanelButtonText:{default:""},panelTitle:{default:""}},setup(e,{expose:t}){const n=i.ref(!1),r=()=>{n.value=!0},s=i.useTemplateRef("panel-component-ref");return t({scrollToTopOfPanel:a=>{var l;(l=s.value)==null||l.scrollIntoView({behavior:"smooth"}),a&&i.nextTick(()=>{var c,d;window.scrollTo({top:(((d=(c=s.value)==null?void 0:c.getBoundingClientRect())==null?void 0:d.top)??0)+window.pageYOffset+a,behavior:"smooth"})})},showPanel:r}),(a,l)=>{const c=V.NButton;return i.openBlock(),i.createBlock(Ph,{title:a.title},i.createSlots({default:i.withCtx(()=>[a.$slots["preview-panel"]||a.$slots["preview-panel-extra"]||a.isShowPanelButtonVisible?(i.openBlock(),i.createElementBlock("div",c2,[a.isShowPanelButtonVisible?(i.openBlock(),i.createElementBlock("div",d2,[i.renderSlot(a.$slots,"show-panel-button",{onClickHandler:()=>{n.value=!0}},()=>[i.createVNode(c,{class:"flex-none sm:px-10 sm:py-4",onClick:l[0]||(l[0]=d=>n.value=!0)},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(a.showPanelButtonText),1)]),_:1})])])):i.createCommentVNode("",!0),i.createElementVNode("div",h2,[i.renderSlot(a.$slots,"preview-panel")]),a.$slots["preview-panel-extra"]?(i.openBlock(),i.createElementBlock("div",u2,[i.renderSlot(a.$slots,"preview-panel-extra")])):i.createCommentVNode("",!0)],512)):i.createCommentVNode("",!0),i.createVNode(Rh,{"show-drawer":n.value,"onUpdate:showDrawer":l[1]||(l[1]=d=>n.value=d),title:a.panelTitle},i.createSlots({"drawer-content":i.withCtx(()=>[i.renderSlot(a.$slots,"panel-content")]),default:i.withCtx(()=>[i.renderSlot(a.$slots,"default")]),_:2},[a.$slots["panel-header"]?{name:"drawer-header",fn:i.withCtx(()=>[i.renderSlot(a.$slots,"panel-header")]),key:"0"}:void 0,a.$slots["panel-bottom"]?{name:"drawer-footer",fn:i.withCtx(()=>[i.renderSlot(a.$slots,"panel-bottom")]),key:"1"}:void 0]),1032,["show-drawer","title"])]),_:2},[a.$slots.title?{name:"title",fn:i.withCtx(()=>[i.renderSlot(a.$slots,"title")]),key:"0"}:void 0,a.$slots["title-buttons"]?{name:"title-buttons",fn:i.withCtx(()=>[i.renderSlot(a.$slots,"title-buttons")]),key:"1"}:void 0,a.$slots["title-extra"]?{name:"title-extra",fn:i.withCtx(()=>[i.renderSlot(a.$slots,"title-extra")]),key:"2"}:void 0]),1032,["title"])}}}),g2={},m2=i.defineComponent({...g2,__name:"reference-select",props:{value:{default:void 0},clearable:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},consistentMenuWidth:{type:Boolean,default:!0},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(e,{expose:t,emit:n}){const r=e,s=n,o=i.computed(()=>W.isArray(r.value)),a=new Y.Reference,l=i.computed(()=>{const p=o.value?[]:a,g=W.isUndefined(r.value)?p:r.value;return W.isArray(g)?g.map(m=>m.id):g==null?void 0:g.id}),c=i.computed(()=>ln.convertReferencesToSelectOptionsList(r.referenceList,r.sortOptionsByLabel,r.showEmptyValue)),d=p=>{var g;if(W.isArray(p)){const m=p.length>0?p.map(_=>{var y;return(y=c.value.find(b=>b.value===_))==null?void 0:y.item}):[];s("update:value",m)}else{const m=p===a.id||(g=c.value.find(_=>_.value===p))==null?void 0:g.item;s("update:value",m)}},h=i.useTemplateRef("select-component");return t({focus:()=>{var p;return(p=h.value)==null?void 0:p.focus()},blur:()=>{var p;return(p=h.value)==null?void 0:p.blur()}}),(p,g)=>(i.openBlock(),i.createBlock(i.unref(V.NSelect),{ref:"select-component",value:l.value,clearable:r.clearable,"consistent-menu-width":p.consistentMenuWidth,disabled:p.disabled||c.value.length===0,filterable:p.filterable,"max-tag-count":p.maxTagCount,multiple:o.value,options:c.value,placeholder:"","onUpdate:value":d},null,8,["value","clearable","consistent-menu-width","disabled","filterable","max-tag-count","multiple","options"]))}}),_2={},y2=i.defineComponent({..._2,__name:"manager-select",props:{value:{default:null},clearable:{type:Boolean,default:!1},managerReferenceList:{default:()=>[]},showActualOnly:{type:Boolean,default:!1},showEmptyValue:{type:Boolean,default:!1}},emits:["update:value"],setup(e,{expose:t,emit:n}){const r=e,s=n,o=i.computed(()=>W.isArray(r.value)),a=i.computed(()=>{var f;return W.isArray(r.value)?r.value.map(p=>p.id):((f=r.value)==null?void 0:f.id)??null}),l=i.computed(()=>{var g;let f=r.showEmptyValue?[Y.ManagerDataFactory.generateUndefinedManagerInstance(),...r.managerReferenceList]:r.managerReferenceList,p=[];if(r.showActualOnly){const m=W.isArray(r.value)?r.value.map(_=>_.id):[(g=r.value)==null?void 0:g.id];p=r.managerReferenceList.filter(_=>!_.isActive).map(_=>_.id),f=r.managerReferenceList.filter(_=>_.isActive||m.includes(_.id))}return ln.convertReferencesToSelectOptionsList(f,!0,!0,m=>m.salesDirection.isNewRec()?m.name:`${m.name} (${m.salesDirection.name})`,m=>p.includes(m.id))}),c=i.useTemplateRef("select-component"),d=f=>{var p;if(W.isArray(f)){const g=f.length>0?f.map(m=>{var _;return(_=l.value.find(y=>y.value===m))==null?void 0:_.item}):[];s("update:value",g)}else{const g=f>0?(p=l.value.find(m=>m.value===f))==null?void 0:p.item:new Y.Manager;s("update:value",g)}};return t({focus:()=>{var f;return(f=c.value)==null?void 0:f.focusInput()},blur:()=>{var f;return(f=c.value)==null?void 0:f.blurInput()}}),(f,p)=>(i.openBlock(),i.createBlock(i.unref(V.NSelect),{ref:"select-component",value:a.value,clearable:f.clearable,disabled:l.value.length===0,multiple:o.value,options:l.value,placeholder:"","onUpdate:value":d},null,8,["value","clearable","disabled","multiple","options"]))}}),b2={class:"m-0.5 flex flex-col p-0.5"},w2={class:"flex flex-row gap-1"},v2={key:0},k2={key:1},x2={key:2},C2={key:3},S2={class:"flex flex-row gap-1"},B2={key:0},T2={key:1},E2={key:2},$2={key:3},N2={},Fh=i.defineComponent({...N2,__name:"address-suggestion-label",props:{addr:{},selected:{type:Boolean}},setup(e){return(t,n)=>(i.openBlock(),i.createElementBlock("div",b2,[i.createElementVNode("span",w2,[t.addr.postIndex?(i.openBlock(),i.createElementBlock("span",v2,i.toDisplayString(t.addr.postIndex)+", ",1)):i.createCommentVNode("",!0),t.addr.city?(i.openBlock(),i.createElementBlock("span",k2,i.toDisplayString(t.addr.city)+", ",1)):i.createCommentVNode("",!0),t.addr.locality?(i.openBlock(),i.createElementBlock("span",x2,i.toDisplayString(t.addr.locality)+", ",1)):i.createCommentVNode("",!0),t.addr.region?(i.openBlock(),i.createElementBlock("span",C2,i.toDisplayString(t.addr.region)+", ",1)):i.createCommentVNode("",!0)]),i.createElementVNode("span",S2,[t.addr.street?(i.openBlock(),i.createElementBlock("span",B2,i.toDisplayString(t.addr.street)+", ",1)):i.createCommentVNode("",!0),t.addr.building?(i.openBlock(),i.createElementBlock("span",T2,i.toDisplayString(t.addr.building)+", ",1)):i.createCommentVNode("",!0),t.addr.buildingPart?(i.openBlock(),i.createElementBlock("span",E2,i.toDisplayString(t.addr.buildingPart)+", ",1)):i.createCommentVNode("",!0),t.addr.apartments?(i.openBlock(),i.createElementBlock("span",$2,i.toDisplayString(t.addr.apartments)+", ",1)):i.createCommentVNode("",!0)])]))}}),Yo={clearable:!1,value:"",field:void 0,disabled:!1},P2={},R2=i.defineComponent({...P2,__name:"address-suggestion",props:i.mergeDefaults({disabled:{type:Boolean},value:{},clearable:{type:Boolean},field:{},minTermLength:{},searchDataHandler:{}},{...Yo,minTermLength:()=>Y.AppConfigProvider.getConfig().minSearchTermLength,searchDataHandler:()=>e=>Y.HttpRequester.getInstance(Y.DataSuggestionProvider).searchAddresses(e)}),emits:["select","update:value"],setup(e,{expose:t,emit:n}){const r=e,s=n,o=i.ref(r.value),a=i.ref(!1),l=i.ref([]),c=i.computed(()=>l.value.map(m=>({label:m[r.field??"addressString"]??"-",value:m.id})));i.watch(()=>r.value,m=>{o.value=m}),i.watch(o,()=>{s("update:value",o.value)});const d=W.debounce(()=>h(),800),h=async()=>{!o.value||o.value.length<r.minTermLength||(a.value=!0,l.value=await r.searchDataHandler(o.value,a).finally(()=>{a.value=!1}))},u=(m,_)=>{const y=l.value.find(b=>b.id===m.value)||{};return i.h(Fh,{addr:y,selected:_},{default:W.constant("-")})},f=m=>{d.cancel();const _=l.value.find(y=>y.id===m)||{};s("select",_)},p=i.ref(null);function g(){p.value.focus()}return t({focus:g}),(m,_)=>{const y=V.NAutoComplete;return i.openBlock(),i.createBlock(y,{ref_key:"autoCompleteElement",ref:p,value:o.value,"onUpdate:value":[_[0]||(_[0]=b=>o.value=b),i.unref(d)],clearable:m.clearable,disabled:m.disabled,loading:a.value,options:c.value,"render-label":u,placeholder:"",onSelect:f},null,8,["value","clearable","disabled","loading","options","onUpdate:value"])}}}),F2={class:"m-0.5 flex flex-col p-0.5"},M2={class:"font-medium"},A2={class:"flex flex-row gap-1 text-xs font-light text-blue-800"},O2={key:0},V2={key:1},z2={},Mh=i.defineComponent({...z2,__name:"bank-suggestion-label",props:{bank:{},selected:{type:Boolean}},setup(e){return(t,n)=>(i.openBlock(),i.createElementBlock("div",F2,[i.createElementVNode("span",M2,i.toDisplayString(t.bank.name),1),i.createElementVNode("span",A2,[t.bank.bic?(i.openBlock(),i.createElementBlock("span",O2," БИК: "+i.toDisplayString(t.bank.bic),1)):i.createCommentVNode("",!0),t.bank.inn?(i.openBlock(),i.createElementBlock("span",V2," ИНН: "+i.toDisplayString(t.bank.inn),1)):i.createCommentVNode("",!0)])]))}}),I2={},L2=i.defineComponent({...I2,__name:"bank-suggestion",props:i.mergeDefaults({disabled:{type:Boolean},value:{},clearable:{type:Boolean},field:{},minTermLength:{}},{...Yo,minTermLength:()=>Y.AppConfigProvider.getConfig().minSearchTermLength}),emits:["select","update:value"],setup(e,{expose:t,emit:n}){const r=e,s=n,o=i.ref(r.value),a=i.ref(!1),l=i.ref([]),c=i.computed(()=>l.value.map(m=>({label:m[r.field??"_"]??"-",value:m.id})));i.watch(()=>r.value,m=>{o.value=m}),i.watch(o,()=>{s("update:value",o.value)});const d=W.debounce(()=>h(),800),h=async()=>{if(!(!o.value||o.value.length<r.minTermLength)){a.value=!0;try{l.value=await Y.HttpRequester.getInstance(Y.DataSuggestionProvider).searchBank(o.value)}finally{a.value=!1}}},u=(m,_)=>{const y=l.value.find(b=>b.id===m.value)||{};return i.h(Mh,{bank:y,selected:_},{default:W.constant("-")})},f=m=>{d.cancel();const _=l.value.find(y=>y.id===m)||{};s("select",_)},p=i.ref(null);function g(){p.value.focus()}return t({focus:g}),(m,_)=>{const y=V.NAutoComplete;return i.openBlock(),i.createBlock(y,{ref_key:"autoCompleteElement",ref:p,value:o.value,"onUpdate:value":[_[0]||(_[0]=b=>o.value=b),i.unref(d)],clearable:m.clearable,disabled:m.disabled,loading:a.value,options:c.value,"render-label":u,placeholder:"",onSelect:f},null,8,["value","clearable","disabled","loading","options","onUpdate:value"])}}}),D2={class:"font-medium"},H2={key:0,class:"flex flex-row gap-2"},W2={key:0,class:"text-xs font-light text-blue-800"},j2={key:1,class:"text-sc-dark-grey text-xs font-light"},X2={},Ah=i.defineComponent({...X2,__name:"org-suggestion-label",props:{org:{},selected:{type:Boolean}},setup(e){const t=e,n=i.computed(()=>{var s,o;return((o=(s=t.org.rawData)==null?void 0:s.state)==null?void 0:o.liquidationDate)??!1}),r=i.computed(()=>{var s,o;return((o=(s=t.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",D2,i.toDisplayString(s.org.name),1),s.org.inn||r.value?(i.openBlock(),i.createElementBlock("div",H2,[s.org.inn?(i.openBlock(),i.createElementBlock("span",W2,i.toDisplayString(s.org.inn),1)):i.createCommentVNode("",!0),r.value?(i.openBlock(),i.createElementBlock("span",j2,i.toDisplayString(r.value),1)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)],2))}}),q2={},Y2=i.defineComponent({...q2,__name:"org-suggestion",props:i.mergeDefaults({disabled:{type:Boolean},value:{},clearable:{type:Boolean},field:{},minTermLength:{},allowSelectTerminated:{type:Boolean}},{...Yo,minTermLength:()=>Y.AppConfigProvider.getConfig().minSearchTermLength}),emits:["select","update:value"],setup(e,{expose:t,emit:n}){const r=e,s=n,o=i.ref(r.value),a=i.ref(!1),l=i.ref([]),c=_=>{var y,b;return!!(((b=(y=_.rawData)==null?void 0:y.state)==null?void 0:b.liquidationDate)??!1)},d=i.computed(()=>ln.convertReferencesToSelectOptionsList(l.value,!1,!1,_=>_[r.field??"_"]??"-",_=>!r.allowSelectTerminated&&c(_)));i.watch(()=>r.value,_=>{o.value=_}),i.watch(o,()=>{s("update:value",o.value)});const h=W.debounce(()=>u(),800),u=async()=>{if(!(!o.value||o.value.length<r.minTermLength)){a.value=!0;try{l.value=await Y.HttpRequester.getInstance(Y.DataSuggestionProvider).searchOrganization(o.value)}finally{a.value=!1}}},f=(_,y)=>{const b=l.value.find(S=>S.id===_.value)||{};return i.h(Ah,{org:b,selected:y},{default:W.constant("-")})},p=_=>{h.cancel();const y=l.value.find(b=>b.id===_)||{};(r.allowSelectTerminated||!c(y))&&s("select",y)},g=i.ref(null);function m(){g.value.focus()}return t({focus:m}),(_,y)=>{const b=V.NAutoComplete;return i.openBlock(),i.createBlock(b,{ref_key:"autoCompleteElement",ref:g,value:o.value,"onUpdate:value":[y[0]||(y[0]=S=>o.value=S),i.unref(h)],clearable:_.clearable,disabled:_.disabled,loading:a.value,options:d.value,"render-label":f,placeholder:"",onSelect:p},null,8,["value","clearable","disabled","loading","options","onUpdate:value"])}}}),U2={},G2=i.defineComponent({...U2,__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(e,{emit:t}){const n=e,r=t,s=i.ref(!1),o=()=>{r("accept",()=>{s.value=!1})},a=()=>{n.disableConfirm?o():s.value=!0};return(l,c)=>{const d=V.NButton,h=V.NPopover,u=V.NModal;return i.openBlock(),i.createElementBlock("div",null,[i.createVNode(h,{disabled:l.popoverText.length===0,placement:"bottom"},{trigger:i.withCtx(()=>[i.createVNode(d,{disabled:l.disabled,ghost:l.ghost,loading:l.loading,size:l.size,type:l.type,quaternary:l.quaternary,circle:l.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(l.popoverText),1)]),_:3},8,["disabled"]),i.createVNode(u,{show:s.value,"onUpdate:show":c[1]||(c[1]=f=>s.value=f),content:l.dialogContent,closable:!1,"mask-closable":!1,"show-icon":!1,title:l.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,__:[2]}),i.createVNode(d,{type:"default",onClick:c[0]||(c[0]=f=>s.value=!1)},{default:i.withCtx(()=>c[3]||(c[3]=[i.createTextVNode(" Отмена ")])),_:1,__:[3]})]),_:1},8,["show","content","title"])])}}}),K2={key:0,class:"whitespace-pre-line"},Z2={key:1,class:"text-sc-dark-grey"},J2={},Q2=i.defineComponent({...J2,__name:"comment-editor",props:{disabled:{type:Boolean,default:!1},comment:{default:""}},emits:["update:comment"],setup(e,{emit:t}){const n=e,r=t,s=i.ref(n.comment);i.watch(()=>s.value,l=>{s.value=l});const o=l=>{r("update:comment",s.value,l)},a=()=>{s.value=n.comment};return(l,c)=>{const d=V.NInput;return i.openBlock(),i.createBlock(Mc,{disabled:l.disabled,"onEditor:apply":o,"onEditor:cancel":a},{viewer:i.withCtx(()=>[i.createElementVNode("div",null,[l.comment?(i.openBlock(),i.createElementBlock("span",K2,i.toDisplayString(l.comment),1)):(i.openBlock(),i.createElementBlock("span",Z2," - Комментарий отсутствует - "))])]),editor:i.withCtx(()=>[i.createVNode(d,{value:s.value,"onUpdate:value":c[0]||(c[0]=h=>s.value=h),clearable:!0,type:"textarea"},null,8,["value"])]),_:1},8,["disabled"])}}}),ek={key:0,class:"text-sm"},tk={key:1},nk={},ik=i.defineComponent({...nk,__name:"debt",props:{debt:{default:0},showLabel:{type:Boolean,default:!1},wrapAsSmall:{type:Boolean,default:!1}},setup(e){const t=e,n=i.computed(()=>{let r="";return(t.showLabel??!1)&&(t.debt>0?r="Переплата: ":t.debt<0&&(r="Задолженность: ")),r});return(r,s)=>(i.openBlock(),i.createElementBlock("span",null,[r.wrapAsSmall&&r.debt!==0?(i.openBlock(),i.createElementBlock("span",ek,[i.createTextVNode(i.toDisplayString(n.value)+" ",1),i.createElementVNode("span",{class:i.normalizeClass({"text-green-700":r.debt>0,"text-red-700":r.debt<0})},i.toDisplayString(r.debt)+" ₽ ",3)])):i.createCommentVNode("",!0),!r.wrapAsSmall&&r.debt!==0?(i.openBlock(),i.createElementBlock("span",tk,[i.createTextVNode(i.toDisplayString(n.value)+" ",1),i.createElementVNode("span",{class:i.normalizeClass({"text-green-700":r.debt>0,"text-red-700":r.debt<0})},i.toDisplayString(r.debt)+" ₽ ",3)])):i.createCommentVNode("",!0)]))}}),rk={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function sk(e,t){return i.openBlock(),i.createElementBlock("svg",rk,t[0]||(t[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 ok=i.markRaw({name:"ion-warning",render:sk}),ak={},lk=i.defineComponent({...ak,__name:"warning-icon",props:{popoverText:{default:""},iconClass:{default:"text-sc-warning"}},setup(e){return(t,n)=>{const r=ok,s=V.NPopover;return i.openBlock(),i.createBlock(s,{disabled:t.popoverText.length===0,placement:"bottom"},{trigger:i.withCtx(()=>[i.createVNode(r,{class:i.normalizeClass(`ml-0.5 ${t.iconClass}`)},null,8,["class"])]),default:i.withCtx(()=>[i.createTextVNode(" "+i.toDisplayString(t.popoverText),1)]),_:1},8,["disabled"])}}});q.ConfiguratorSettingsKozyrek=qm,q.ContentHelper=In,q.KozyrekLine=ti,q.KozyrekTailTemplate=ao,q.KozyrekTemplate=Ri,q.OrdersTableFields=Ue,q.Point=oo,q.ScAddProductToCartForm=$f,q.ScAddressSuggestion=R2,q.ScAddressSuggestionLabel=Fh,q.ScBankSuggestion=L2,q.ScBankSuggestionLabel=Mh,q.ScBaseDialog=K0,q.ScButtonWithConfirmAction=G2,q.ScCategoryCollapse=va,q.ScClientNameWithShortInfo=Sr,q.ScCollapse=wa,q.ScCollapseItem=ga,q.ScCommentEditor=Q2,q.ScConfiguratorsProductInfo=qi,q.ScContragentWithShortInfo=ka,q.ScDateRange=z0,q.ScDateTimeLabel=co,q.ScDebouncedInput=g_,q.ScDebouncedInputNumber=Fi,q.ScDebt=ik,q.ScDialogHeader=q0,q.ScEmail=Xf,q.ScExternalLink=S_,q.ScImageGallery=ba,q.ScInlineEditableItem=Mc,q.ScInlineView=ho,q.ScKozyrekConfigurator=Xm,q.ScKozyrekConfiguratorParamsForm=Na,q.ScKozyrekConfiguratorPreview=Tc,q.ScKozyrekConfiguratorTemplates=Ta,q.ScLightGallery=ya,q.ScManagerSelect=y2,q.ScMetalForDoorsConfigurator=Jm,q.ScMetalForDoorsConfiguratorForm=Ec,q.ScMosquitoConfigurator=k0,q.ScMosquitoConfiguratorForm=$c,q.ScMosquitoConfiguratorMeasurementInstructions=Nc,q.ScMosquitoConfiguratorPreview=lo,q.ScOrderCommonInfo=Sh,q.ScOrderDeliveryLabel=ws,q.ScOrderDetails=$h,q.ScOrderInfo=Nh,q.ScOrderItemsList=Eh,q.ScOrderPayment=Bh,q.ScOrderProductInfo=Th,q.ScOrdersList=Uv,q.ScOrgSuggestion=Y2,q.ScOrgSuggestionLabel=Ah,q.ScPage=Ph,q.ScPageWithSlidingPanel=p2,q.ScPersonContactsBlock=Ap,q.ScPhone=gp,q.ScPhoneInput=y_,q.ScProductName=Xi,q.ScProductsList=Qw,q.ScReferenceSelect=m2,q.ScSearchableProductSelect=Ch,q.ScSearchableReferenceSelect=xh,q.ScShortTextOrderInfo=Jv,q.ScSingleFileUploadSelector=t_,q.ScSlidingContentWithDrawer=Rh,q.ScStripConfigurator=F0,q.ScStripConfiguratorForm=Rc,q.ScStripConfiguratorLineItem=Pc,q.ScStripConfiguratorPreview=Fc,q.ScUserShortInfo=qo,q.ScWarningIcon=lk,q.SelectOptionHelper=ln,q.UiProvider=pt,q.componentSizeInjectionKey=vr,q.naiveUiTheme=vu,q.renderConfig=ze,Object.defineProperty(q,Symbol.toStringTag,{value:"Module"})});
|
824
824
|
//# sourceMappingURL=sc-vue-ui-lib.umd.cjs.map
|