@zzalai/leafer-point-annotation 1.1.1 → 1.1.3
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/README.md +493 -250
- package/README_EN.md +498 -250
- package/docs/assets/index-BcqmlFff.js +1 -0
- package/docs/assets/{index-Dqqq7qvI.css → index-dq8tjOSG.css} +1 -1
- package/docs/index.html +2 -2
- package/package.json +2 -1
- package/project-docs/ARCHITECTURE.md +345 -354
- package/project-docs/REQUIREMENTS.md +232 -500
- package/skills/project-context.md +402 -0
- package/src/App.vue +502 -17
- package/src/components/PointAnnotation.vue +639 -219
- package/src/elements/PointAnnotationElement.ts +115 -17
- package/src/types/index.ts +22 -5
- package/src/utils/CanvasBrush.ts +20 -0
- package/docs/assets/index-CPn8AE3g.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function t(t){const e=Object.create(null);for(const n of t.split(","))e[n]=1;return t=>t in e}!function(){const t=document.createElement("link").relList;if(!(t&&t.supports&&t.supports("modulepreload"))){for(const t of document.querySelectorAll('link[rel="modulepreload"]'))e(t);new MutationObserver(t=>{for(const n of t)if("childList"===n.type)for(const t of n.addedNodes)"LINK"===t.tagName&&"modulepreload"===t.rel&&e(t)}).observe(document,{childList:!0,subtree:!0})}function e(t){if(t.ep)return;t.ep=!0;const e=function(t){const e={};return t.integrity&&(e.integrity=t.integrity),t.referrerPolicy&&(e.referrerPolicy=t.referrerPolicy),"use-credentials"===t.crossOrigin?e.credentials="include":"anonymous"===t.crossOrigin?e.credentials="omit":e.credentials="same-origin",e}(t);fetch(t.href,e)}}();var e,n={},i=[],r=()=>{},o=()=>!1,s=t=>111===t.charCodeAt(0)&&110===t.charCodeAt(1)&&(t.charCodeAt(2)>122||t.charCodeAt(2)<97),a=t=>t.startsWith("onUpdate:"),l=Object.assign,h=(t,e)=>{const n=t.indexOf(e);n>-1&&t.splice(n,1)},c=Object.prototype.hasOwnProperty,u=(t,e)=>c.call(t,e),d=Array.isArray,p=t=>"[object Map]"===x(t),f=t=>"[object Set]"===x(t),g=t=>"[object Date]"===x(t),v=t=>"function"==typeof t,_=t=>"string"==typeof t,m=t=>"symbol"==typeof t,y=t=>null!==t&&"object"==typeof t,b=t=>(y(t)||v(t))&&v(t.then)&&v(t.catch),w=Object.prototype.toString,x=t=>w.call(t),S=t=>"[object Object]"===x(t),k=t=>_(t)&&"NaN"!==t&&"-"!==t[0]&&""+parseInt(t,10)===t,C=t(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),E=t=>{const e=Object.create(null);return n=>e[n]||(e[n]=t(n))},O=/-\w/g,L=E(t=>t.replace(O,t=>t.slice(1).toUpperCase())),P=/\B([A-Z])/g,T=E(t=>t.replace(P,"-$1").toLowerCase()),B=E(t=>t.charAt(0).toUpperCase()+t.slice(1)),R=E(t=>t?`on${B(t)}`:""),A=(t,e)=>!Object.is(t,e),M=(t,...e)=>{for(let n=0;n<t.length;n++)t[n](...e)},D=(t,e,n,i=!1)=>{Object.defineProperty(t,e,{configurable:!0,enumerable:!1,writable:i,value:n})},I=t=>{const e=parseFloat(t);return isNaN(e)?t:e},F=()=>e||(e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{});function W(t){if(d(t)){const e={};for(let n=0;n<t.length;n++){const i=t[n],r=_(i)?V(i):W(i);if(r)for(const t in r)e[t]=r[t]}return e}if(_(t)||y(t))return t}var z=/;(?![^(]*\))/g,N=/:([^]+)/,j=/\/\*[^]*?\*\//g;function V(t){const e={};return t.replace(j,"").split(z).forEach(t=>{if(t){const n=t.split(N);n.length>1&&(e[n[0].trim()]=n[1].trim())}}),e}function H(t){let e="";if(_(t))e=t;else if(d(t))for(let n=0;n<t.length;n++){const i=H(t[n]);i&&(e+=i+" ")}else if(y(t))for(const n in t)t[n]&&(e+=n+" ");return e.trim()}var U="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",Y=t(U);function X(t){return!!t||""===t}function G(t,e){if(t===e)return!0;let n=g(t),i=g(e);if(n||i)return!(!n||!i)&&t.getTime()===e.getTime();if(n=m(t),i=m(e),n||i)return t===e;if(n=d(t),i=d(e),n||i)return!(!n||!i)&&function(t,e){if(t.length!==e.length)return!1;let n=!0;for(let i=0;n&&i<t.length;i++)n=G(t[i],e[i]);return n}(t,e);if(n=y(t),i=y(e),n||i){if(!n||!i)return!1;if(Object.keys(t).length!==Object.keys(e).length)return!1;for(const n in t){const i=t.hasOwnProperty(n),r=e.hasOwnProperty(n);if(i&&!r||!i&&r||!G(t[n],e[n]))return!1}}return String(t)===String(e)}function $(t,e){return t.findIndex(t=>G(t,e))}var K,q,Z=t=>!(!t||!0!==t.__v_isRef),J=t=>_(t)?t:null==t?"":d(t)||y(t)&&(t.toString===w||!v(t.toString))?Z(t)?J(t.value):JSON.stringify(t,Q,2):String(t),Q=(t,e)=>Z(e)?Q(t,e.value):p(e)?{[`Map(${e.size})`]:[...e.entries()].reduce((t,[e,n],i)=>(t[tt(e,i)+" =>"]=n,t),{})}:f(e)?{[`Set(${e.size})`]:[...e.values()].map(t=>tt(t))}:m(e)?tt(e):!y(e)||d(e)||S(e)?e:String(e),tt=(t,e="")=>{var n;return m(t)?`Symbol(${null!=(n=t.description)?n:e})`:t},et=class{constructor(t=!1){this.detached=t,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this.__v_skip=!0,this.parent=K,!t&&K&&(this.index=(K.scopes||(K.scopes=[])).push(this)-1)}get active(){return this._active}pause(){if(this._active){let t,e;if(this._isPaused=!0,this.scopes)for(t=0,e=this.scopes.length;t<e;t++)this.scopes[t].pause();for(t=0,e=this.effects.length;t<e;t++)this.effects[t].pause()}}resume(){if(this._active&&this._isPaused){let t,e;if(this._isPaused=!1,this.scopes)for(t=0,e=this.scopes.length;t<e;t++)this.scopes[t].resume();for(t=0,e=this.effects.length;t<e;t++)this.effects[t].resume()}}run(t){if(this._active){const e=K;try{return K=this,t()}finally{K=e}}}on(){1===++this._on&&(this.prevScope=K,K=this)}off(){if(this._on>0&&0===--this._on){if(K===this)K=this.prevScope;else{let t=K;for(;t;){if(t.prevScope===this){t.prevScope=this.prevScope;break}t=t.prevScope}}this.prevScope=void 0}}stop(t){if(this._active){let e,n;for(this._active=!1,e=0,n=this.effects.length;e<n;e++)this.effects[e].stop();for(this.effects.length=0,e=0,n=this.cleanups.length;e<n;e++)this.cleanups[e]();if(this.cleanups.length=0,this.scopes){for(e=0,n=this.scopes.length;e<n;e++)this.scopes[e].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!t){const t=this.parent.scopes.pop();t&&t!==this&&(this.parent.scopes[this.index]=t,t.index=this.index)}this.parent=void 0}}};var nt,it,rt=new WeakSet,ot=class{constructor(t){this.fn=t,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,K&&K.active&&K.effects.push(this)}pause(){this.flags|=64}resume(){64&this.flags&&(this.flags&=-65,rt.has(this)&&(rt.delete(this),this.trigger()))}notify(){2&this.flags&&!(32&this.flags)||8&this.flags||at(this)}run(){if(!(1&this.flags))return this.fn();this.flags|=2,bt(this),ct(this);const t=q,e=vt;q=this,vt=!0;try{return this.fn()}finally{ut(this),q=t,vt=e,this.flags&=-3}}stop(){if(1&this.flags){for(let t=this.deps;t;t=t.nextDep)ft(t);this.deps=this.depsTail=void 0,bt(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){64&this.flags?rt.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){dt(this)&&this.run()}get dirty(){return dt(this)}},st=0;function at(t,e=!1){if(t.flags|=8,e)return t.next=it,void(it=t);t.next=nt,nt=t}function lt(){st++}function ht(){if(--st>0)return;if(it){let t=it;for(it=void 0;t;){const e=t.next;t.next=void 0,t.flags&=-9,t=e}}let t;for(;nt;){let n=nt;for(nt=void 0;n;){const i=n.next;if(n.next=void 0,n.flags&=-9,1&n.flags)try{n.trigger()}catch(e){t||(t=e)}n=i}}if(t)throw t}function ct(t){for(let e=t.deps;e;e=e.nextDep)e.version=-1,e.prevActiveLink=e.dep.activeLink,e.dep.activeLink=e}function ut(t){let e,n=t.depsTail,i=n;for(;i;){const t=i.prevDep;-1===i.version?(i===n&&(n=t),ft(i),gt(i)):e=i,i.dep.activeLink=i.prevActiveLink,i.prevActiveLink=void 0,i=t}t.deps=e,t.depsTail=n}function dt(t){for(let e=t.deps;e;e=e.nextDep)if(e.dep.version!==e.version||e.dep.computed&&(pt(e.dep.computed)||e.dep.version!==e.version))return!0;return!!t._dirty}function pt(t){if(4&t.flags&&!(16&t.flags))return;if(t.flags&=-17,t.globalVersion===wt)return;if(t.globalVersion=wt,!t.isSSR&&128&t.flags&&(!t.deps&&!t._dirty||!dt(t)))return;t.flags|=2;const e=t.dep,n=q,i=vt;q=t,vt=!0;try{ct(t);const n=t.fn(t._value);(0===e.version||A(n,t._value))&&(t.flags|=128,t._value=n,e.version++)}catch(r){throw e.version++,r}finally{q=n,vt=i,ut(t),t.flags&=-3}}function ft(t,e=!1){const{dep:n,prevSub:i,nextSub:r}=t;if(i&&(i.nextSub=r,t.prevSub=void 0),r&&(r.prevSub=i,t.nextSub=void 0),n.subs===t&&(n.subs=i,!i&&n.computed)){n.computed.flags&=-5;for(let t=n.computed.deps;t;t=t.nextDep)ft(t,!0)}e||--n.sc||!n.map||n.map.delete(n.key)}function gt(t){const{prevDep:e,nextDep:n}=t;e&&(e.nextDep=n,t.prevDep=void 0),n&&(n.prevDep=e,t.nextDep=void 0)}var vt=!0,_t=[];function mt(){_t.push(vt),vt=!1}function yt(){const t=_t.pop();vt=void 0===t||t}function bt(t){const{cleanup:e}=t;if(t.cleanup=void 0,e){const t=q;q=void 0;try{e()}finally{q=t}}}var wt=0,xt=class{constructor(t,e){this.sub=t,this.dep=e,this.version=e.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}},St=class{constructor(t){this.computed=t,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(t){if(!q||!vt||q===this.computed)return;let e=this.activeLink;if(void 0===e||e.sub!==q)e=this.activeLink=new xt(q,this),q.deps?(e.prevDep=q.depsTail,q.depsTail.nextDep=e,q.depsTail=e):q.deps=q.depsTail=e,kt(e);else if(-1===e.version&&(e.version=this.version,e.nextDep)){const t=e.nextDep;t.prevDep=e.prevDep,e.prevDep&&(e.prevDep.nextDep=t),e.prevDep=q.depsTail,e.nextDep=void 0,q.depsTail.nextDep=e,q.depsTail=e,q.deps===e&&(q.deps=t)}return e}trigger(t){this.version++,wt++,this.notify(t)}notify(t){lt();try{for(let t=this.subs;t;t=t.prevSub)t.sub.notify()&&t.sub.dep.notify()}finally{ht()}}};function kt(t){if(t.dep.sc++,4&t.sub.flags){const e=t.dep.computed;if(e&&!t.dep.subs){e.flags|=20;for(let t=e.deps;t;t=t.nextDep)kt(t)}const n=t.dep.subs;n!==t&&(t.prevSub=n,n&&(n.nextSub=t)),t.dep.subs=t}}var Ct=new WeakMap,Et=Symbol(""),Ot=Symbol(""),Lt=Symbol("");function Pt(t,e,n){if(vt&&q){let e=Ct.get(t);e||Ct.set(t,e=new Map);let i=e.get(n);i||(e.set(n,i=new St),i.map=e,i.key=n),i.track()}}function Tt(t,e,n,i,r,o){const s=Ct.get(t);if(!s)return void wt++;const a=t=>{t&&t.trigger()};if(lt(),"clear"===e)s.forEach(a);else{const r=d(t),o=r&&k(n);if(r&&"length"===n){const t=Number(i);s.forEach((e,n)=>{("length"===n||n===Lt||!m(n)&&n>=t)&&a(e)})}else switch((void 0!==n||s.has(void 0))&&a(s.get(n)),o&&a(s.get(Lt)),e){case"add":r?o&&a(s.get("length")):(a(s.get(Et)),p(t)&&a(s.get(Ot)));break;case"delete":r||(a(s.get(Et)),p(t)&&a(s.get(Ot)));break;case"set":p(t)&&a(s.get(Et))}}ht()}function Bt(t){const e=ve(t);return e===t?e:(Pt(e,0,Lt),fe(t)?e:e.map(_e))}function Rt(t){return Pt(t=ve(t),0,Lt),t}function At(t,e){return pe(t)?me(de(t)?_e(e):e):_e(e)}var Mt={__proto__:null,[Symbol.iterator](){return Dt(this,Symbol.iterator,t=>At(this,t))},concat(...t){return Bt(this).concat(...t.map(t=>d(t)?Bt(t):t))},entries(){return Dt(this,"entries",t=>(t[1]=At(this,t[1]),t))},every(t,e){return Ft(this,"every",t,e,void 0,arguments)},filter(t,e){return Ft(this,"filter",t,e,t=>t.map(t=>At(this,t)),arguments)},find(t,e){return Ft(this,"find",t,e,t=>At(this,t),arguments)},findIndex(t,e){return Ft(this,"findIndex",t,e,void 0,arguments)},findLast(t,e){return Ft(this,"findLast",t,e,t=>At(this,t),arguments)},findLastIndex(t,e){return Ft(this,"findLastIndex",t,e,void 0,arguments)},forEach(t,e){return Ft(this,"forEach",t,e,void 0,arguments)},includes(...t){return zt(this,"includes",t)},indexOf(...t){return zt(this,"indexOf",t)},join(t){return Bt(this).join(t)},lastIndexOf(...t){return zt(this,"lastIndexOf",t)},map(t,e){return Ft(this,"map",t,e,void 0,arguments)},pop(){return Nt(this,"pop")},push(...t){return Nt(this,"push",t)},reduce(t,...e){return Wt(this,"reduce",t,e)},reduceRight(t,...e){return Wt(this,"reduceRight",t,e)},shift(){return Nt(this,"shift")},some(t,e){return Ft(this,"some",t,e,void 0,arguments)},splice(...t){return Nt(this,"splice",t)},toReversed(){return Bt(this).toReversed()},toSorted(t){return Bt(this).toSorted(t)},toSpliced(...t){return Bt(this).toSpliced(...t)},unshift(...t){return Nt(this,"unshift",t)},values(){return Dt(this,"values",t=>At(this,t))}};function Dt(t,e,n){const i=Rt(t),r=i[e]();return i===t||fe(t)||(r._next=r.next,r.next=()=>{const t=r._next();return t.done||(t.value=n(t.value)),t}),r}var It=Array.prototype;function Ft(t,e,n,i,r,o){const s=Rt(t),a=s!==t&&!fe(t),l=s[e];if(l!==It[e]){const e=l.apply(t,o);return a?_e(e):e}let h=n;s!==t&&(a?h=function(e,i){return n.call(this,At(t,e),i,t)}:n.length>2&&(h=function(e,i){return n.call(this,e,i,t)}));const c=l.call(s,h,i);return a&&r?r(c):c}function Wt(t,e,n,i){const r=Rt(t);let o=n,s=!1;r!==t&&(r!==t&&!fe(t)?(s=0===i.length,o=function(e,i,r){return s&&(s=!1,e=At(t,e)),n.call(this,e,At(t,i),r,t)}):n.length>3&&(o=function(e,i,r){return n.call(this,e,i,r,t)}));const a=r[e](o,...i);return s?At(t,a):a}function zt(t,e,n){const i=ve(t);Pt(i,0,Lt);const r=i[e](...n);return-1!==r&&!1!==r||!ge(n[0])?r:(n[0]=ve(n[0]),i[e](...n))}function Nt(t,e,n=[]){mt(),lt();const i=ve(t)[e].apply(t,n);return ht(),yt(),i}var jt=t("__proto__,__v_isRef,__isVue"),Vt=new Set(Object.getOwnPropertyNames(Symbol).filter(t=>"arguments"!==t&&"caller"!==t).map(t=>Symbol[t]).filter(m));function Ht(t){m(t)||(t=String(t));const e=ve(this);return Pt(e,0,t),e.hasOwnProperty(t)}var Ut=class{constructor(t=!1,e=!1){this._isReadonly=t,this._isShallow=e}get(t,e,n){if("__v_skip"===e)return t.__v_skip;const i=this._isReadonly,r=this._isShallow;if("__v_isReactive"===e)return!i;if("__v_isReadonly"===e)return i;if("__v_isShallow"===e)return r;if("__v_raw"===e)return n===(i?r?ae:se:r?oe:re).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(n)?t:void 0;const o=d(t);if(!i){let t;if(o&&(t=Mt[e]))return t;if("hasOwnProperty"===e)return Ht}const s=Reflect.get(t,e,ye(t)?t:n);if(m(e)?Vt.has(e):jt(e))return s;if(i||Pt(t,0,e),r)return s;if(ye(s)){const t=o&&k(e)?s:s.value;return i&&y(t)?ce(t):t}return y(s)?i?ce(s):he(s):s}},Yt=class extends Ut{constructor(t=!1){super(!1,t)}set(t,e,n,i){let r=t[e];const o=d(t)&&k(e);if(!this._isShallow){const t=pe(r);if(fe(n)||pe(n)||(r=ve(r),n=ve(n)),!o&&ye(r)&&!ye(n))return t||(r.value=n),!0}const s=o?Number(e)<t.length:u(t,e),a=Reflect.set(t,e,n,ye(t)?t:i);return t===ve(i)&&(s?A(n,r)&&Tt(t,"set",e,n):Tt(t,"add",e,n)),a}deleteProperty(t,e){const n=u(t,e),i=(t[e],Reflect.deleteProperty(t,e));return i&&n&&Tt(t,"delete",e,void 0),i}has(t,e){const n=Reflect.has(t,e);return m(e)&&Vt.has(e)||Pt(t,0,e),n}ownKeys(t){return Pt(t,0,d(t)?"length":Et),Reflect.ownKeys(t)}},Xt=class extends Ut{constructor(t=!1){super(!0,t)}set(t,e){return!0}deleteProperty(t,e){return!0}},Gt=new Yt,$t=new Xt,Kt=new Yt(!0),qt=t=>t,Zt=t=>Reflect.getPrototypeOf(t);function Jt(t){return function(...e){return"delete"!==t&&("clear"===t?void 0:this)}}function Qt(t,e){const n={get(n){const i=this.__v_raw,r=ve(i),o=ve(n);t||(A(n,o)&&Pt(r,0,n),Pt(r,0,o));const{has:s}=Zt(r),a=e?qt:t?me:_e;return s.call(r,n)?a(i.get(n)):s.call(r,o)?a(i.get(o)):void(i!==r&&i.get(n))},get size(){const e=this.__v_raw;return!t&&Pt(ve(e),0,Et),e.size},has(e){const n=this.__v_raw,i=ve(n),r=ve(e);return t||(A(e,r)&&Pt(i,0,e),Pt(i,0,r)),e===r?n.has(e):n.has(e)||n.has(r)},forEach(n,i){const r=this,o=r.__v_raw,s=e?qt:t?me:_e;return!t&&Pt(ve(o),0,Et),o.forEach((t,e)=>n.call(i,s(t),s(e),r))}};return l(n,t?{add:Jt("add"),set:Jt("set"),delete:Jt("delete"),clear:Jt("clear")}:{add(t){const n=ve(this),i=Zt(n),r=ve(t),o=e||fe(t)||pe(t)?t:r;return i.has.call(n,o)||A(t,o)&&i.has.call(n,t)||A(r,o)&&i.has.call(n,r)||(n.add(o),Tt(n,"add",o,o)),this},set(t,n){e||fe(n)||pe(n)||(n=ve(n));const i=ve(this),{has:r,get:o}=Zt(i);let s=r.call(i,t);s||(t=ve(t),s=r.call(i,t));const a=o.call(i,t);return i.set(t,n),s?A(n,a)&&Tt(i,"set",t,n):Tt(i,"add",t,n),this},delete(t){const e=ve(this),{has:n,get:i}=Zt(e);let r=n.call(e,t);r||(t=ve(t),r=n.call(e,t));i&&i.call(e,t);const o=e.delete(t);return r&&Tt(e,"delete",t,void 0),o},clear(){const t=ve(this),e=0!==t.size,n=t.clear();return e&&Tt(t,"clear",void 0,void 0),n}}),["keys","values","entries",Symbol.iterator].forEach(i=>{n[i]=function(t,e,n){return function(...i){const r=this.__v_raw,o=ve(r),s=p(o),a="entries"===t||t===Symbol.iterator&&s,h="keys"===t&&s,c=r[t](...i),u=n?qt:e?me:_e;return!e&&Pt(o,0,h?Ot:Et),l(Object.create(c),{next(){const{value:t,done:e}=c.next();return e?{value:t,done:e}:{value:a?[u(t[0]),u(t[1])]:u(t),done:e}}})}}(i,t,e)}),n}function te(t,e){const n=Qt(t,e);return(e,i,r)=>"__v_isReactive"===i?!t:"__v_isReadonly"===i?t:"__v_raw"===i?e:Reflect.get(u(n,i)&&i in e?n:e,i,r)}var ee={get:te(!1,!1)},ne={get:te(!1,!0)},ie={get:te(!0,!1)},re=new WeakMap,oe=new WeakMap,se=new WeakMap,ae=new WeakMap;function le(t){return t.__v_skip||!Object.isExtensible(t)?0:function(t){switch(t){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}((t=>x(t).slice(8,-1))(t))}function he(t){return pe(t)?t:ue(t,!1,Gt,ee,re)}function ce(t){return ue(t,!0,$t,ie,se)}function ue(t,e,n,i,r){if(!y(t))return t;if(t.__v_raw&&(!e||!t.__v_isReactive))return t;const o=le(t);if(0===o)return t;const s=r.get(t);if(s)return s;const a=new Proxy(t,2===o?i:n);return r.set(t,a),a}function de(t){return pe(t)?de(t.__v_raw):!(!t||!t.__v_isReactive)}function pe(t){return!(!t||!t.__v_isReadonly)}function fe(t){return!(!t||!t.__v_isShallow)}function ge(t){return!!t&&!!t.__v_raw}function ve(t){const e=t&&t.__v_raw;return e?ve(e):t}var _e=t=>y(t)?he(t):t,me=t=>y(t)?ce(t):t;function ye(t){return!!t&&!0===t.__v_isRef}function be(t){return n=!1,ye(e=t)?e:new we(e,n);var e,n}var we=class{constructor(t,e){this.dep=new St,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=e?t:ve(t),this._value=e?t:_e(t),this.__v_isShallow=e}get value(){return this.dep.track(),this._value}set value(t){const e=this._rawValue,n=this.__v_isShallow||fe(t)||pe(t);A(t=n?t:ve(t),e)&&(this._rawValue=t,this._value=n?t:_e(t),this.dep.trigger())}};function xe(t){return ye(t)?t.value:t}var Se={get:(t,e,n)=>"__v_raw"===e?t:xe(Reflect.get(t,e,n)),set:(t,e,n,i)=>{const r=t[e];return ye(r)&&!ye(n)?(r.value=n,!0):Reflect.set(t,e,n,i)}};function ke(t){return de(t)?t:new Proxy(t,Se)}var Ce=class{constructor(t,e,n){this.fn=t,this.setter=e,this._value=void 0,this.dep=new St(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=wt-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!e,this.isSSR=n}notify(){if(this.flags|=16,!(8&this.flags)&&q!==this)return at(this,!0),!0}get value(){const t=this.dep.track();return pt(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}};var Ee={},Oe=new WeakMap,Le=void 0;function Pe(t,e,i=n){const{immediate:o,deep:s,once:a,scheduler:l,augmentJob:c,call:u}=i,p=t=>s?t:fe(t)||!1===s||0===s?Te(t,1):Te(t);let f,g,_,m,y=!1,b=!1;if(ye(t)?(g=()=>t.value,y=fe(t)):de(t)?(g=()=>p(t),y=!0):d(t)?(b=!0,y=t.some(t=>de(t)||fe(t)),g=()=>t.map(t=>ye(t)?t.value:de(t)?p(t):v(t)?u?u(t,2):t():void 0)):g=v(t)?e?u?()=>u(t,2):t:()=>{if(_){mt();try{_()}finally{yt()}}const e=Le;Le=f;try{return u?u(t,3,[m]):t(m)}finally{Le=e}}:r,e&&s){const t=g,e=!0===s?1/0:s;g=()=>Te(t(),e)}const w=K,x=()=>{f.stop(),w&&w.active&&h(w.effects,f)};if(a&&e){const t=e;e=(...e)=>{t(...e),x()}}let S=b?new Array(t.length).fill(Ee):Ee;const k=t=>{if(1&f.flags&&(f.dirty||t))if(e){const t=f.run();if(s||y||(b?t.some((t,e)=>A(t,S[e])):A(t,S))){_&&_();const n=Le;Le=f;try{const n=[t,S===Ee?void 0:b&&S[0]===Ee?[]:S,m];S=t,u?u(e,3,n):e(...n)}finally{Le=n}}}else f.run()};return c&&c(k),f=new ot(g),f.scheduler=l?()=>l(k,!1):k,m=t=>function(t,e=!1,n=Le){if(n){let e=Oe.get(n);e||Oe.set(n,e=[]),e.push(t)}}(t,!1,f),_=f.onStop=()=>{const t=Oe.get(f);if(t){if(u)u(t,4);else for(const e of t)e();Oe.delete(f)}},e?o?k(!0):S=f.run():l?l(k.bind(null,!0),!0):f.run(),x.pause=f.pause.bind(f),x.resume=f.resume.bind(f),x.stop=x,x}function Te(t,e=1/0,n){if(e<=0||!y(t)||t.__v_skip)return t;if(((n=n||new Map).get(t)||0)>=e)return t;if(n.set(t,e),e--,ye(t))Te(t.value,e,n);else if(d(t))for(let i=0;i<t.length;i++)Te(t[i],e,n);else if(f(t)||p(t))t.forEach(t=>{Te(t,e,n)});else if(S(t)){for(const i in t)Te(t[i],e,n);for(const i of Object.getOwnPropertySymbols(t))Object.prototype.propertyIsEnumerable.call(t,i)&&Te(t[i],e,n)}return t}function Be(t,e,n,i){try{return i?t(...i):t()}catch(r){Ae(r,e,n)}}function Re(t,e,n,i){if(v(t)){const r=Be(t,e,n,i);return r&&b(r)&&r.catch(t=>{Ae(t,e,n)}),r}if(d(t)){const r=[];for(let o=0;o<t.length;o++)r.push(Re(t[o],e,n,i));return r}}function Ae(t,e,i,r=!0){e&&e.vnode;const{errorHandler:o,throwUnhandledErrorInProduction:s}=e&&e.appContext.config||n;if(e){let n=e.parent;const r=e.proxy,s=`https://vuejs.org/error-reference/#runtime-${i}`;for(;n;){const e=n.ec;if(e)for(let n=0;n<e.length;n++)if(!1===e[n](t,r,s))return;n=n.parent}if(o)return mt(),Be(o,null,10,[t,r,s]),void yt()}!function(t,e,n,i=!0,r=!1){if(r)throw t}(t,0,0,r,s)}var Me=[],De=-1,Ie=[],Fe=null,We=0,ze=Promise.resolve(),Ne=null;function je(t){const e=Ne||ze;return t?e.then(this?t.bind(this):t):e}function Ve(t){if(!(1&t.flags)){const e=Xe(t),n=Me[Me.length-1];!n||!(2&t.flags)&&e>=Xe(n)?Me.push(t):Me.splice(function(t){let e=De+1,n=Me.length;for(;e<n;){const i=e+n>>>1,r=Me[i],o=Xe(r);o<t||o===t&&2&r.flags?e=i+1:n=i}return e}(e),0,t),t.flags|=1,He()}}function He(){Ne||(Ne=ze.then(Ge))}function Ue(t,e,n=De+1){for(;n<Me.length;n++){const e=Me[n];if(e&&2&e.flags){if(t&&e.id!==t.uid)continue;Me.splice(n,1),n--,4&e.flags&&(e.flags&=-2),e(),4&e.flags||(e.flags&=-2)}}}function Ye(t){if(Ie.length){const t=[...new Set(Ie)].sort((t,e)=>Xe(t)-Xe(e));if(Ie.length=0,Fe)return void Fe.push(...t);for(Fe=t,We=0;We<Fe.length;We++){const t=Fe[We];4&t.flags&&(t.flags&=-2),8&t.flags||t(),t.flags&=-2}Fe=null,We=0}}var Xe=t=>null==t.id?2&t.flags?-1:1/0:t.id;function Ge(t){try{for(De=0;De<Me.length;De++){const t=Me[De];!t||8&t.flags||(4&t.flags&&(t.flags&=-2),Be(t,t.i,t.i?15:14),4&t.flags||(t.flags&=-2))}}finally{for(;De<Me.length;De++){const t=Me[De];t&&(t.flags&=-2)}De=-1,Me.length=0,Ye(),Ne=null,(Me.length||Ie.length)&&Ge(t)}}var $e=null,Ke=null;function qe(t){const e=$e;return $e=t,Ke=t&&t.type.__scopeId||null,e}function Ze(t,e=$e,n){if(!e)return t;if(t._n)return t;const i=(...n)=>{i._d&&vr(-1);const r=qe(e);let o;try{o=t(...n)}finally{qe(r),i._d&&vr(1)}return o};return i._n=!0,i._c=!0,i._d=!0,i}function Je(t,e){if(null===$e)return t;const i=Kr($e),r=t.dirs||(t.dirs=[]);for(let o=0;o<e.length;o++){let[t,s,a,l=n]=e[o];t&&(v(t)&&(t={mounted:t,updated:t}),t.deep&&Te(s),r.push({dir:t,instance:i,value:s,oldValue:void 0,arg:a,modifiers:l}))}return t}function Qe(t,e,n,i){const r=t.dirs,o=e&&e.dirs;for(let s=0;s<r.length;s++){const a=r[s];o&&(a.oldValue=o[s].value);let l=a.dir[i];l&&(mt(),Re(l,n,8,[t.el,a,t,e]),yt())}}function tn(t,e){if(Wr){let n=Wr.provides;const i=Wr.parent&&Wr.parent.provides;i===n&&(n=Wr.provides=Object.create(i)),n[t]=e}}function en(t,e,n=!1){const i=zr();if(i||Li){let r=Li?Li._context.provides:i?null==i.parent||i.ce?i.vnode.appContext&&i.vnode.appContext.provides:i.parent.provides:void 0;if(r&&t in r)return r[t];if(arguments.length>1)return n&&v(e)?e.call(i&&i.proxy):e}}var nn=Symbol.for("v-scx");function rn(t,e,n){return on(t,e,n)}function on(t,e,i=n){const{immediate:o,deep:s,flush:a,once:h}=i,c=l({},i),u=e&&o||!e&&"post"!==a;let d;if(Yr)if("sync"===a){const t=en(nn);d=t.__watcherHandles||(t.__watcherHandles=[])}else if(!u){const t=()=>{};return t.stop=r,t.resume=r,t.pause=r,t}const p=Wr;c.call=(t,e,n)=>Re(t,p,e,n);let f=!1;"post"===a?c.scheduler=t=>{Qi(t,p&&p.suspense)}:"sync"!==a&&(f=!0,c.scheduler=(t,e)=>{e?t():Ve(t)}),c.augmentJob=t=>{e&&(t.flags|=4),f&&(t.flags|=2,p&&(t.id=p.uid,t.i=p))};const g=Pe(t,e,c);return Yr&&(d?d.push(g):u&&g()),g}function sn(t,e,n){const i=this.proxy,r=_(t)?t.includes(".")?an(i,t):()=>i[t]:t.bind(i,i);let o;v(e)?o=e:(o=e.handler,n=e);const s=Nr(this),a=on(r,o.bind(i),n);return s(),a}function an(t,e){const n=e.split(".");return()=>{let e=t;for(let t=0;t<n.length&&e;t++)e=e[n[t]];return e}}var ln=new WeakMap,hn=Symbol("_vte"),cn=t=>t.__isTeleport,un=t=>t&&(t.disabled||""===t.disabled),dn=t=>"undefined"!=typeof SVGElement&&t instanceof SVGElement,pn=t=>"function"==typeof MathMLElement&&t instanceof MathMLElement,fn=(t,e)=>{const n=t&&t.to;return _(n)?e?e(n):null:n},gn={name:"Teleport",__isTeleport:!0,process(t,e,n,i,r,o,s,a,l,h){const{mc:c,pc:u,pbc:d,o:{insert:p,querySelector:f,createText:g,createComment:v,parentNode:_}}=h,m=un(e.props);let{dynamicChildren:y}=e;const b=(t,e,n)=>{16&t.shapeFlag&&c(t.children,e,n,r,o,s,a,l)},w=(t=e)=>{const n=un(t.props),i=t.target=fn(t.props,f),o=yn(i,t,g,p);i&&("svg"!==s&&dn(i)?s="svg":"mathml"!==s&&pn(i)&&(s="mathml"),r&&r.isCE&&(r.ce._teleportTargets||(r.ce._teleportTargets=new Set)).add(i),n||(b(t,i,o),mn(t,!1)))},x=t=>{const e=()=>{ln.get(t)===e&&(ln.delete(t),un(t.props)&&(b(t,_(t.el)||n,t.anchor),mn(t,!0)),w(t))};ln.set(t,e),Qi(e,o)};if(null==t){const t=e.el=g(""),r=e.anchor=g("");if(p(t,n,i),p(r,n,i),(S=e.props)&&(S.defer||""===S.defer)||o&&o.pendingBranch)return void x(e);m&&(b(e,n,r),mn(e,!0)),w()}else{e.el=t.el;const i=e.anchor=t.anchor,c=ln.get(t);if(c)return c.flags|=8,ln.delete(t),void x(e);e.targetStart=t.targetStart;const p=e.target=t.target,g=e.targetAnchor=t.targetAnchor,v=un(t.props),_=v?n:p,b=v?i:g;if("svg"===s||dn(p)?s="svg":("mathml"===s||pn(p))&&(s="mathml"),y?(d(t.dynamicChildren,y,_,r,o,s,a),ir(t,e,!0)):l||u(t,e,_,b,r,o,s,a,!1),m)v?e.props&&t.props&&e.props.to!==t.props.to&&(e.props.to=t.props.to):vn(e,n,i,h,1);else if((e.props&&e.props.to)!==(t.props&&t.props.to)){const t=e.target=fn(e.props,f);t&&vn(e,t,null,h,0)}else v&&vn(e,p,g,h,1);mn(e,m)}var S},remove(t,e,n,{um:i,o:{remove:r}},o){const{shapeFlag:s,children:a,anchor:l,targetStart:h,targetAnchor:c,target:u,props:d}=t;let p=o||!un(d);const f=ln.get(t);if(f&&(f.flags|=8,ln.delete(t),p=!1),u&&(r(h),r(c)),o&&r(l),16&s)for(let g=0;g<a.length;g++){const t=a[g];i(t,e,n,p,!!t.dynamicChildren)}},move:vn,hydrate:function(t,e,n,i,r,o,{o:{nextSibling:s,parentNode:a,querySelector:l,insert:h,createText:c}},u){function d(t,n){let i=n;for(;i;){if(i&&8===i.nodeType)if("teleport start anchor"===i.data)e.targetStart=i;else if("teleport anchor"===i.data){e.targetAnchor=i,t._lpa=e.targetAnchor&&s(e.targetAnchor);break}i=s(i)}}function p(t,e){e.anchor=u(s(t),e,a(t),n,i,r,o)}const f=e.target=fn(e.props,l),g=un(e.props);if(f){const l=f._lpa||f.firstChild;16&e.shapeFlag&&(g?(p(t,e),d(f,l),e.targetAnchor||yn(f,e,c,h,a(t)===f?t:null)):(e.anchor=s(t),d(f,l),e.targetAnchor||yn(f,e,c,h),u(l&&s(l),e,f,n,i,r,o))),mn(e,g)}else g&&16&e.shapeFlag&&(p(t,e),e.targetStart=t,e.targetAnchor=s(t));return e.anchor&&s(e.anchor)}};function vn(t,e,n,{o:{insert:i},m:r},o=2){0===o&&i(t.targetAnchor,e,n);const{el:s,anchor:a,shapeFlag:l,children:h,props:c}=t,u=2===o;if(u&&i(s,e,n),!ln.has(t)&&(!u||un(c))&&16&l)for(let d=0;d<h.length;d++)r(h[d],e,n,2);u&&i(a,e,n)}var _n=gn;function mn(t,e){const n=t.ctx;if(n&&n.ut){let i,r;for(e?(i=t.el,r=t.anchor):(i=t.targetStart,r=t.targetAnchor);i&&i!==r;)1===i.nodeType&&i.setAttribute("data-v-owner",n.uid),i=i.nextSibling;n.ut()}}function yn(t,e,n,i,r=null){const o=e.targetStart=n(""),s=e.targetAnchor=n("");return o[hn]=s,t&&(i(o,t,r),i(s,t,r)),s}var bn=Symbol("_leaveCb"),wn=Symbol("_enterCb");var xn=[Function,Array],Sn={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:xn,onEnter:xn,onAfterEnter:xn,onEnterCancelled:xn,onBeforeLeave:xn,onLeave:xn,onAfterLeave:xn,onLeaveCancelled:xn,onBeforeAppear:xn,onAppear:xn,onAfterAppear:xn,onAppearCancelled:xn},kn=t=>{const e=t.subTree;return e.component?kn(e.component):e};function Cn(t){let e=t[0];if(t.length>1)for(const n of t)if(n.type!==cr){e=n;break}return e}var En={name:"BaseTransition",props:Sn,setup(t,{slots:e}){const n=zr(),i=function(){const t={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return $n(()=>{t.isMounted=!0}),Zn(()=>{t.isUnmounting=!0}),t}();return()=>{const r=e.default&&Rn(e.default(),!0),o=r&&r.length?Cn(r):n.subTree?Pr():void 0;if(!o)return;const s=ve(t),{mode:a}=s;if(i.isLeaving)return Pn(o);const l=Tn(o);if(!l)return Pn(o);let h=Ln(l,s,i,n,t=>h=t);l.type!==cr&&Bn(l,h);let c=n.subTree&&Tn(n.subTree);if(c&&c.type!==cr&&!wr(c,l)&&kn(n).type!==cr){let t=Ln(c,s,i,n);if(Bn(c,t),"out-in"===a&&l.type!==cr)return i.isLeaving=!0,t.afterLeave=()=>{i.isLeaving=!1,8&n.job.flags||n.update(),delete t.afterLeave,c=void 0},Pn(o);"in-out"===a&&l.type!==cr?t.delayLeave=(t,e,n)=>{On(i,c)[String(c.key)]=c,t[bn]=()=>{e(),t[bn]=void 0,delete h.delayedLeave,c=void 0},h.delayedLeave=()=>{n(),delete h.delayedLeave,c=void 0}}:c=void 0}else c&&(c=void 0);return o}}};function On(t,e){const{leavingVNodes:n}=t;let i=n.get(e.type);return i||(i=Object.create(null),n.set(e.type,i)),i}function Ln(t,e,n,i,r){const{appear:o,mode:s,persisted:a=!1,onBeforeEnter:l,onEnter:h,onAfterEnter:c,onEnterCancelled:u,onBeforeLeave:p,onLeave:f,onAfterLeave:g,onLeaveCancelled:v,onBeforeAppear:_,onAppear:m,onAfterAppear:y,onAppearCancelled:b}=e,w=String(t.key),x=On(n,t),S=(t,e)=>{t&&Re(t,i,9,e)},k=(t,e)=>{const n=e[1];S(t,e),d(t)?t.every(t=>t.length<=1)&&n():t.length<=1&&n()},C={mode:s,persisted:a,beforeEnter(e){let i=l;if(!n.isMounted){if(!o)return;i=_||l}e[bn]&&e[bn](!0);const r=x[w];r&&wr(t,r)&&r.el[bn]&&r.el[bn](),S(i,[e])},enter(e){if(x[w]===t)return;let i=h,r=c,s=u;if(!n.isMounted){if(!o)return;i=m||h,r=y||c,s=b||u}let a=!1;e[wn]=t=>{a||(a=!0,S(t?s:r,[e]),C.delayedLeave&&C.delayedLeave(),e[wn]=void 0)};const l=e[wn].bind(null,!1);i?k(i,[e,l]):l()},leave(e,i){const r=String(t.key);if(e[wn]&&e[wn](!0),n.isUnmounting)return i();S(p,[e]);let o=!1;e[bn]=n=>{o||(o=!0,i(),S(n?v:g,[e]),e[bn]=void 0,x[r]===t&&delete x[r])};const s=e[bn].bind(null,!1);x[r]=t,f?k(f,[e,s]):s()},clone(t){const o=Ln(t,e,n,i,r);return r&&r(o),o}};return C}function Pn(t){if(Nn(t))return(t=Er(t)).children=null,t}function Tn(t){if(!Nn(t))return cn(t.type)&&t.children?Cn(t.children):t;if(t.component)return t.component.subTree;const{shapeFlag:e,children:n}=t;if(n){if(16&e)return n[0];if(32&e&&v(n.default))return n.default()}}function Bn(t,e){6&t.shapeFlag&&t.component?(t.transition=e,Bn(t.component.subTree,e)):128&t.shapeFlag?(t.ssContent.transition=e.clone(t.ssContent),t.ssFallback.transition=e.clone(t.ssFallback)):t.transition=e}function Rn(t,e=!1,n){let i=[],r=0;for(let o=0;o<t.length;o++){let s=t[o];const a=null==n?s.key:String(n)+String(null!=s.key?s.key:o);s.type===lr?(128&s.patchFlag&&r++,i=i.concat(Rn(s.children,e,a))):(e||s.type!==cr)&&i.push(null!=a?Er(s,{key:a}):s)}if(r>1)for(let o=0;o<i.length;o++)i[o].patchFlag=-2;return i}function An(t,e){return v(t)?l({name:t.name},e,{setup:t}):t}function Mn(t){t.ids=[t.ids[0]+t.ids[2]+++"-",0,0]}function Dn(t,e){let n;return!(!(n=Object.getOwnPropertyDescriptor(t,e))||n.configurable)}var In=new WeakMap;function Fn(t,e,i,r,s=!1){if(d(t))return void t.forEach((t,n)=>Fn(t,e&&(d(e)?e[n]:e),i,r,s));if(zn(r)&&!s)return void(512&r.shapeFlag&&r.type.__asyncResolved&&r.component.subTree.component&&Fn(t,e,i,r.component.subTree));const a=4&r.shapeFlag?Kr(r.component):r.el,l=s?null:a,{i:c,r:p}=t,f=e&&e.r,g=c.refs===n?c.refs={}:c.refs,m=c.setupState,y=ve(m),b=m===n?o:t=>!Dn(g,t)&&u(y,t),w=(t,e)=>!e||!Dn(g,e);if(null!=f&&f!==p)if(Wn(e),_(f))g[f]=null,b(f)&&(m[f]=null);else if(ye(f)){const t=e;w(0,t.k)&&(f.value=null),t.k&&(g[t.k]=null)}if(v(p))Be(p,c,12,[l,g]);else{const e=_(p),n=ye(p);if(e||n){const r=()=>{if(t.f){const n=e?b(p)?m[p]:g[p]:w()||!t.k?p.value:g[t.k];if(s)d(n)&&h(n,a);else if(d(n))n.includes(a)||n.push(a);else if(e)g[p]=[a],b(p)&&(m[p]=g[p]);else{const e=[a];w(0,t.k)&&(p.value=e),t.k&&(g[t.k]=e)}}else e?(g[p]=l,b(p)&&(m[p]=l)):n&&(w(0,t.k)&&(p.value=l),t.k&&(g[t.k]=l))};if(l){const e=()=>{r(),In.delete(t)};e.id=-1,In.set(t,e),Qi(e,i)}else Wn(t),r()}}}function Wn(t){const e=In.get(t);e&&(e.flags|=8,In.delete(t))}F().requestIdleCallback,F().cancelIdleCallback;var zn=t=>!!t.type.__asyncLoader,Nn=t=>t.type.__isKeepAlive;function jn(t,e){Hn(t,"a",e)}function Vn(t,e){Hn(t,"da",e)}function Hn(t,e,n=Wr){const i=t.__wdc||(t.__wdc=()=>{let e=n;for(;e;){if(e.isDeactivated)return;e=e.parent}return t()});if(Yn(e,i,n),n){let t=n.parent;for(;t&&t.parent;)Nn(t.parent.vnode)&&Un(i,e,n,t),t=t.parent}}function Un(t,e,n,i){const r=Yn(e,t,i,!0);Jn(()=>{h(i[e],r)},n)}function Yn(t,e,n=Wr,i=!1){if(n){const r=n[t]||(n[t]=[]),o=e.__weh||(e.__weh=(...i)=>{mt();const r=Nr(n),o=Re(e,n,t,i);return r(),yt(),o});return i?r.unshift(o):r.push(o),o}}var Xn=t=>(e,n=Wr)=>{Yr&&"sp"!==t||Yn(t,(...t)=>e(...t),n)},Gn=Xn("bm"),$n=Xn("m"),Kn=Xn("bu"),qn=Xn("u"),Zn=Xn("bum"),Jn=Xn("um"),Qn=Xn("sp"),ti=Xn("rtg"),ei=Xn("rtc");function ni(t,e=Wr){Yn("ec",t,e)}var ii="components";function ri(t,e){return function(t,e,n=!0,i=!1){const r=$e||Wr;if(r){const n=r.type;if(t===ii){const t=function(t,e=!0){return v(t)?t.displayName||t.name:t.name||e&&t.__name}(n,!1);if(t&&(t===e||t===L(e)||t===B(L(e))))return n}const o=si(r[t]||n[t],e)||si(r.appContext[t],e);return!o&&i?n:o}}(ii,t,!0,e)||t}var oi=Symbol.for("v-ndc");function si(t,e){return t&&(t[e]||t[L(e)]||t[B(L(e))])}function ai(t,e,n,i){let r;const o=n&&n[i],s=d(t);if(s||_(t)){let n=!1,i=!1;s&&de(t)&&(n=!fe(t),i=pe(t),t=Rt(t)),r=new Array(t.length);for(let s=0,a=t.length;s<a;s++)r[s]=e(n?i?me(_e(t[s])):_e(t[s]):t[s],s,void 0,o&&o[s])}else if("number"==typeof t){r=new Array(t);for(let n=0;n<t;n++)r[n]=e(n+1,n,void 0,o&&o[n])}else if(y(t))if(t[Symbol.iterator])r=Array.from(t,(t,n)=>e(t,n,void 0,o&&o[n]));else{const n=Object.keys(t);r=new Array(n.length);for(let i=0,s=n.length;i<s;i++){const s=n[i];r[i]=e(t[s],s,i,o&&o[i])}}else r=[];return n&&(n[i]=r),r}var li=t=>t?Vr(t)?Kr(t):li(t.parent):null,hi=l(Object.create(null),{$:t=>t,$el:t=>t.vnode.el,$data:t=>t.data,$props:t=>t.props,$attrs:t=>t.attrs,$slots:t=>t.slots,$refs:t=>t.refs,$parent:t=>li(t.parent),$root:t=>li(t.root),$host:t=>t.ce,$emit:t=>t.emit,$options:t=>_i(t),$forceUpdate:t=>t.f||(t.f=()=>{Ve(t.update)}),$nextTick:t=>t.n||(t.n=je.bind(t.proxy)),$watch:t=>sn.bind(t)}),ci=(t,e)=>t!==n&&!t.__isScriptSetup&&u(t,e),ui={get({_:t},e){if("__v_skip"===e)return!0;const{ctx:i,setupState:r,data:o,props:s,accessCache:a,type:l,appContext:h}=t;if("$"!==e[0]){const t=a[e];if(void 0!==t)switch(t){case 1:return r[e];case 2:return o[e];case 4:return i[e];case 3:return s[e]}else{if(ci(r,e))return a[e]=1,r[e];if(o!==n&&u(o,e))return a[e]=2,o[e];if(u(s,e))return a[e]=3,s[e];if(i!==n&&u(i,e))return a[e]=4,i[e];pi&&(a[e]=0)}}const c=hi[e];let d,p;return c?("$attrs"===e&&Pt(t.attrs,0,""),c(t)):(d=l.__cssModules)&&(d=d[e])?d:i!==n&&u(i,e)?(a[e]=4,i[e]):(p=h.config.globalProperties,u(p,e)?p[e]:void 0)},set({_:t},e,i){const{data:r,setupState:o,ctx:s}=t;return ci(o,e)?(o[e]=i,!0):r!==n&&u(r,e)?(r[e]=i,!0):!u(t.props,e)&&(("$"!==e[0]||!(e.slice(1)in t))&&(s[e]=i,!0))},has({_:{data:t,setupState:e,accessCache:i,ctx:r,appContext:o,props:s,type:a}},l){let h;return!!(i[l]||t!==n&&"$"!==l[0]&&u(t,l)||ci(e,l)||u(s,l)||u(r,l)||u(hi,l)||u(o.config.globalProperties,l)||(h=a.__cssModules)&&h[l])},defineProperty(t,e,n){return null!=n.get?t._.accessCache[e]=0:u(n,"value")&&this.set(t,e,n.value,null),Reflect.defineProperty(t,e,n)}};function di(t){return d(t)?t.reduce((t,e)=>(t[e]=null,t),{}):t}var pi=!0;function fi(t){const e=_i(t),n=t.proxy,i=t.ctx;pi=!1,e.beforeCreate&&gi(e.beforeCreate,t,"bc");const{data:o,computed:s,methods:a,watch:l,provide:h,inject:c,created:u,beforeMount:p,mounted:f,beforeUpdate:g,updated:_,activated:m,deactivated:b,beforeDestroy:w,beforeUnmount:x,destroyed:S,unmounted:k,render:C,renderTracked:E,renderTriggered:O,errorCaptured:L,serverPrefetch:P,expose:T,inheritAttrs:B,components:R,directives:A,filters:M}=e;if(c&&function(t,e){d(t)&&(t=wi(t));for(const n in t){const i=t[n];let r;r=y(i)?"default"in i?en(i.from||n,i.default,!0):en(i.from||n):en(i),ye(r)?Object.defineProperty(e,n,{enumerable:!0,configurable:!0,get:()=>r.value,set:t=>r.value=t}):e[n]=r}}(c,i,null),a)for(const r in a){const t=a[r];v(t)&&(i[r]=t.bind(n))}if(o){const e=o.call(n,n);y(e)&&(t.data=he(e))}if(pi=!0,s)for(const d in s){const t=s[d],e=qr({get:v(t)?t.bind(n,n):v(t.get)?t.get.bind(n,n):r,set:!v(t)&&v(t.set)?t.set.bind(n):r});Object.defineProperty(i,d,{enumerable:!0,configurable:!0,get:()=>e.value,set:t=>e.value=t})}if(l)for(const r in l)vi(l[r],i,n,r);if(h){const t=v(h)?h.call(n):h;Reflect.ownKeys(t).forEach(e=>{tn(e,t[e])})}function D(t,e){d(e)?e.forEach(e=>t(e.bind(n))):e&&t(e.bind(n))}if(u&&gi(u,t,"c"),D(Gn,p),D($n,f),D(Kn,g),D(qn,_),D(jn,m),D(Vn,b),D(ni,L),D(ei,E),D(ti,O),D(Zn,x),D(Jn,k),D(Qn,P),d(T))if(T.length){const e=t.exposed||(t.exposed={});T.forEach(t=>{Object.defineProperty(e,t,{get:()=>n[t],set:e=>n[t]=e,enumerable:!0})})}else t.exposed||(t.exposed={});C&&t.render===r&&(t.render=C),null!=B&&(t.inheritAttrs=B),R&&(t.components=R),A&&(t.directives=A),P&&Mn(t)}function gi(t,e,n){Re(d(t)?t.map(t=>t.bind(e.proxy)):t.bind(e.proxy),e,n)}function vi(t,e,n,i){let r=i.includes(".")?an(n,i):()=>n[i];if(_(t)){const n=e[t];v(n)&&rn(r,n)}else if(v(t))rn(r,t.bind(n));else if(y(t))if(d(t))t.forEach(t=>vi(t,e,n,i));else{const i=v(t.handler)?t.handler.bind(n):e[t.handler];v(i)&&rn(r,i,t)}}function _i(t){const e=t.type,{mixins:n,extends:i}=e,{mixins:r,optionsCache:o,config:{optionMergeStrategies:s}}=t.appContext,a=o.get(e);let l;return a?l=a:r.length||n||i?(l={},r.length&&r.forEach(t=>mi(l,t,s,!0)),mi(l,e,s)):l=e,y(e)&&o.set(e,l),l}function mi(t,e,n,i=!1){const{mixins:r,extends:o}=e;o&&mi(t,o,n,!0),r&&r.forEach(e=>mi(t,e,n,!0));for(const s in e)if(i&&"expose"===s);else{const i=yi[s]||n&&n[s];t[s]=i?i(t[s],e[s]):e[s]}return t}var yi={data:bi,props:ki,emits:ki,methods:Si,computed:Si,beforeCreate:xi,created:xi,beforeMount:xi,mounted:xi,beforeUpdate:xi,updated:xi,beforeDestroy:xi,beforeUnmount:xi,destroyed:xi,unmounted:xi,activated:xi,deactivated:xi,errorCaptured:xi,serverPrefetch:xi,components:Si,directives:Si,watch:function(t,e){if(!t)return e;if(!e)return t;const n=l(Object.create(null),t);for(const i in e)n[i]=xi(t[i],e[i]);return n},provide:bi,inject:function(t,e){return Si(wi(t),wi(e))}};function bi(t,e){return e?t?function(){return l(v(t)?t.call(this,this):t,v(e)?e.call(this,this):e)}:e:t}function wi(t){if(d(t)){const e={};for(let n=0;n<t.length;n++)e[t[n]]=t[n];return e}return t}function xi(t,e){return t?[...new Set([].concat(t,e))]:e}function Si(t,e){return t?l(Object.create(null),t,e):e}function ki(t,e){return t?d(t)&&d(e)?[...new Set([...t,...e])]:l(Object.create(null),di(t),di(null!=e?e:{})):e}function Ci(){return{app:null,config:{isNativeTag:o,performance:!1,globalProperties:{},optionMergeStrategies:{},errorHandler:void 0,warnHandler:void 0,compilerOptions:{}},mixins:[],components:{},directives:{},provides:Object.create(null),optionsCache:new WeakMap,propsCache:new WeakMap,emitsCache:new WeakMap}}var Ei=0;function Oi(t,e){return function(n,i=null){v(n)||(n=l({},n)),null==i||y(i)||(i=null);const r=Ci(),o=new WeakSet,s=[];let a=!1;const h=r.app={_uid:Ei++,_component:n,_props:i,_container:null,_context:r,_instance:null,version:Zr,get config(){return r.config},set config(t){},use:(t,...e)=>(o.has(t)||(t&&v(t.install)?(o.add(t),t.install(h,...e)):v(t)&&(o.add(t),t(h,...e))),h),mixin:t=>(r.mixins.includes(t)||r.mixins.push(t),h),component:(t,e)=>e?(r.components[t]=e,h):r.components[t],directive:(t,e)=>e?(r.directives[t]=e,h):r.directives[t],mount(o,s,l){if(!a){const c=h._ceVNode||Cr(n,i);return c.appContext=r,!0===l?l="svg":!1===l&&(l=void 0),s&&e?e(c,o):t(c,o,l),a=!0,h._container=o,o.__vue_app__=h,Kr(c.component)}},onUnmount(t){s.push(t)},unmount(){a&&(Re(s,h._instance,16),t(null,h._container),delete h._container.__vue_app__)},provide:(t,e)=>(r.provides[t]=e,h),runWithContext(t){const e=Li;Li=h;try{return t()}finally{Li=e}}};return h}}var Li=null;function Pi(t,e,...i){if(t.isUnmounted)return;const r=t.vnode.props||n;let o=i;const s=e.startsWith("update:"),a=s&&((t,e)=>"modelValue"===e||"model-value"===e?t.modelModifiers:t[`${e}Modifiers`]||t[`${L(e)}Modifiers`]||t[`${T(e)}Modifiers`])(r,e.slice(7));let l;a&&(a.trim&&(o=i.map(t=>_(t)?t.trim():t)),a.number&&(o=i.map(I)));let h=r[l=R(e)]||r[l=R(L(e))];!h&&s&&(h=r[l=R(T(e))]),h&&Re(h,t,6,o);const c=r[l+"Once"];if(c){if(t.emitted){if(t.emitted[l])return}else t.emitted={};t.emitted[l]=!0,Re(c,t,6,o)}}var Ti=new WeakMap;function Bi(t,e,n=!1){const i=n?Ti:e.emitsCache,r=i.get(t);if(void 0!==r)return r;const o=t.emits;let s={},a=!1;if(!v(t)){const i=t=>{const n=Bi(t,e,!0);n&&(a=!0,l(s,n))};!n&&e.mixins.length&&e.mixins.forEach(i),t.extends&&i(t.extends),t.mixins&&t.mixins.forEach(i)}return o||a?(d(o)?o.forEach(t=>s[t]=null):l(s,o),y(t)&&i.set(t,s),s):(y(t)&&i.set(t,null),null)}function Ri(t,e){return!(!t||!s(e))&&(e=e.slice(2).replace(/Once$/,""),u(t,e[0].toLowerCase()+e.slice(1))||u(t,T(e))||u(t,e))}function Ai(t){const{type:e,vnode:n,proxy:i,withProxy:r,propsOptions:[o],slots:s,attrs:l,emit:h,render:c,renderCache:u,props:d,data:p,setupState:f,ctx:g,inheritAttrs:v}=t,_=qe(t);let m,y;try{if(4&n.shapeFlag){const t=r||i,e=t;m=Tr(c.call(e,t,u,d,f,p,g)),y=l}else{const t=e;m=Tr(t.length>1?t(d,{attrs:l,slots:s,emit:h}):t(d,null)),y=e.props?l:Mi(l)}}catch(w){dr.length=0,Ae(w,t,1),m=Cr(cr)}let b=m;if(y&&!1!==v){const t=Object.keys(y),{shapeFlag:e}=b;t.length&&7&e&&(o&&t.some(a)&&(y=Di(y,o)),b=Er(b,y,!1,!0))}return n.dirs&&(b=Er(b,null,!1,!0),b.dirs=b.dirs?b.dirs.concat(n.dirs):n.dirs),n.transition&&Bn(b,n.transition),m=b,qe(_),m}var Mi=t=>{let e;for(const n in t)("class"===n||"style"===n||s(n))&&((e||(e={}))[n]=t[n]);return e},Di=(t,e)=>{const n={};for(const i in t)a(i)&&i.slice(9)in e||(n[i]=t[i]);return n};function Ii(t,e,n){const i=Object.keys(e);if(i.length!==Object.keys(t).length)return!0;for(let r=0;r<i.length;r++){const o=i[r];if(Fi(e,t,o)&&!Ri(n,o))return!0}return!1}function Fi(t,e,n){const i=t[n],r=e[n];return"style"===n&&y(i)&&y(r)?!G(i,r):i!==r}var Wi={},zi=()=>Object.create(Wi),Ni=t=>Object.getPrototypeOf(t)===Wi;function ji(t,e,n,i=!1){const r={},o=zi();t.propsDefaults=Object.create(null),Vi(t,e,r,o);for(const s in t.propsOptions[0])s in r||(r[s]=void 0);n?t.props=i?r:ue(r,!1,Kt,ne,oe):t.type.props?t.props=r:t.props=o,t.attrs=o}function Vi(t,e,i,r){const[o,s]=t.propsOptions;let a,l=!1;if(e)for(let n in e){if(C(n))continue;const h=e[n];let c;o&&u(o,c=L(n))?s&&s.includes(c)?(a||(a={}))[c]=h:i[c]=h:Ri(t.emitsOptions,n)||n in r&&h===r[n]||(r[n]=h,l=!0)}if(s){const e=ve(i),r=a||n;for(let n=0;n<s.length;n++){const a=s[n];i[a]=Hi(o,e,a,r[a],t,!u(r,a))}}return l}function Hi(t,e,n,i,r,o){const s=t[n];if(null!=s){const t=u(s,"default");if(t&&void 0===i){const t=s.default;if(s.type!==Function&&!s.skipFactory&&v(t)){const{propsDefaults:o}=r;if(n in o)i=o[n];else{const s=Nr(r);i=o[n]=t.call(null,e),s()}}else i=t;r.ce&&r.ce._setProp(n,i)}s[0]&&(o&&!t?i=!1:!s[1]||""!==i&&i!==T(n)||(i=!0))}return i}var Ui=new WeakMap;function Yi(t,e,r=!1){const o=r?Ui:e.propsCache,s=o.get(t);if(s)return s;const a=t.props,h={},c=[];let p=!1;if(!v(t)){const n=t=>{p=!0;const[n,i]=Yi(t,e,!0);l(h,n),i&&c.push(...i)};!r&&e.mixins.length&&e.mixins.forEach(n),t.extends&&n(t.extends),t.mixins&&t.mixins.forEach(n)}if(!a&&!p)return y(t)&&o.set(t,i),i;if(d(a))for(let i=0;i<a.length;i++){const t=L(a[i]);Xi(t)&&(h[t]=n)}else if(a)for(const n in a){const t=L(n);if(Xi(t)){const e=a[n],i=h[t]=d(e)||v(e)?{type:e}:l({},e),r=i.type;let o=!1,s=!0;if(d(r))for(let t=0;t<r.length;++t){const e=r[t],n=v(e)&&e.name;if("Boolean"===n){o=!0;break}"String"===n&&(s=!1)}else o=v(r)&&"Boolean"===r.name;i[0]=o,i[1]=s,(o||u(i,"default"))&&c.push(t)}}const f=[h,c];return y(t)&&o.set(t,f),f}function Xi(t){return"$"!==t[0]&&!C(t)}var Gi=t=>"_"===t||"_ctx"===t||"$stable"===t,$i=t=>d(t)?t.map(Tr):[Tr(t)],Ki=(t,e,n)=>{if(e._n)return e;const i=Ze((...t)=>$i(e(...t)),n);return i._c=!1,i},qi=(t,e,n)=>{const i=t._ctx;for(const r in t){if(Gi(r))continue;const n=t[r];if(v(n))e[r]=Ki(0,n,i);else if(null!=n){const t=$i(n);e[r]=()=>t}}},Zi=(t,e)=>{const n=$i(e);t.slots.default=()=>n},Ji=(t,e,n)=>{for(const i in e)!n&&Gi(i)||(t[i]=e[i])};var Qi=function(t,e){e&&e.pendingBranch?d(t)?e.effects.push(...t):e.effects.push(t):(n=t,d(n)?Ie.push(...n):Fe&&-1===n.id?Fe.splice(We+1,0,n):1&n.flags||(Ie.push(n),n.flags|=1),He());var n};function tr(t){return function(t,e){F().__VUE__=!0;const{insert:o,remove:s,patchProp:a,createElement:l,createText:h,createComment:c,setText:d,setElementText:p,parentNode:f,nextSibling:g,setScopeId:v=r,insertStaticContent:_}=t,m=(t,e,n,i=null,r=null,o=null,s=void 0,a=null,l=!!e.dynamicChildren)=>{if(t===e)return;t&&!wr(t,e)&&(i=Q(t),$(t,r,o,!0),t=null),-2===e.patchFlag&&(l=!1,e.dynamicChildren=null);const{type:h,ref:c,shapeFlag:u}=e;switch(h){case hr:y(t,e,n,i);break;case cr:w(t,e,n,i);break;case ur:null==t&&x(e,n,i,s);break;case lr:W(t,e,n,i,r,o,s,a,l);break;default:1&u?E(t,e,n,i,r,o,s,a,l):6&u?z(t,e,n,i,r,o,s,a,l):(64&u||128&u)&&h.process(t,e,n,i,r,o,s,a,l,it)}null!=c&&r?Fn(c,t&&t.ref,o,e||t,!e):null==c&&t&&null!=t.ref&&Fn(t.ref,null,o,t,!0)},y=(t,e,n,i)=>{if(null==t)o(e.el=h(e.children),n,i);else{const n=e.el=t.el;e.children!==t.children&&d(n,e.children)}},w=(t,e,n,i)=>{null==t?o(e.el=c(e.children||""),n,i):e.el=t.el},x=(t,e,n,i)=>{[t.el,t.anchor]=_(t.children,e,n,i,t.el,t.anchor)},S=({el:t,anchor:e},n,i)=>{let r;for(;t&&t!==e;)r=g(t),o(t,n,i),t=r;o(e,n,i)},k=({el:t,anchor:e})=>{let n;for(;t&&t!==e;)n=g(t),s(t),t=n;s(e)},E=(t,e,n,i,r,o,s,a,l)=>{if("svg"===e.type?s="svg":"math"===e.type&&(s="mathml"),null==t)O(e,n,i,r,o,s,a,l);else{const n=t.el&&t.el._isVueCE?t.el:null;try{n&&n._beginPatch(),R(t,e,r,o,s,a,l)}finally{n&&n._endPatch()}}},O=(t,e,n,i,r,s,h,c)=>{let u,d;const{props:f,shapeFlag:g,transition:v,dirs:_}=t;if(u=t.el=l(t.type,s,f&&f.is,f),8&g?p(u,t.children):16&g&&B(t.children,u,null,i,r,er(t,s),h,c),_&&Qe(t,null,i,"created"),P(u,t,t.scopeId,h,i),f){for(const t in f)"value"===t||C(t)||a(u,t,null,f[t],s,i);"value"in f&&a(u,"value",null,f.value,s),(d=f.onVnodeBeforeMount)&&Ar(d,i,t)}_&&Qe(t,null,i,"beforeMount");const m=function(t,e){return(!t||t&&!t.pendingBranch)&&e&&!e.persisted}(r,v);m&&v.beforeEnter(u),o(u,e,n),((d=f&&f.onVnodeMounted)||m||_)&&Qi(()=>{try{d&&Ar(d,i,t),m&&v.enter(u),_&&Qe(t,null,i,"mounted")}finally{}},r)},P=(t,e,n,i,r)=>{if(n&&v(t,n),i)for(let o=0;o<i.length;o++)v(t,i[o]);if(r){let n=r.subTree;if(e===n||ar(n.type)&&(n.ssContent===e||n.ssFallback===e)){const e=r.vnode;P(t,e,e.scopeId,e.slotScopeIds,r.parent)}}},B=(t,e,n,i,r,o,s,a,l=0)=>{for(let h=l;h<t.length;h++)m(null,t[h]=a?Br(t[h]):Tr(t[h]),e,n,i,r,o,s,a)},R=(t,e,i,r,o,s,l)=>{const h=e.el=t.el;let{patchFlag:c,dynamicChildren:u,dirs:d}=e;c|=16&t.patchFlag;const f=t.props||n,g=e.props||n;let v;if(i&&nr(i,!1),(v=g.onVnodeBeforeUpdate)&&Ar(v,i,e,t),d&&Qe(e,t,i,"beforeUpdate"),i&&nr(i,!0),(f.innerHTML&&null==g.innerHTML||f.textContent&&null==g.textContent)&&p(h,""),u?A(t.dynamicChildren,u,h,i,r,er(e,o),s):l||U(t,e,h,null,i,r,er(e,o),s,!1),c>0){if(16&c)I(h,f,g,i,o);else if(2&c&&f.class!==g.class&&a(h,"class",null,g.class,o),4&c&&a(h,"style",f.style,g.style,o),8&c){const t=e.dynamicProps;for(let e=0;e<t.length;e++){const n=t[e],r=f[n],s=g[n];s===r&&"value"!==n||a(h,n,r,s,o,i)}}1&c&&t.children!==e.children&&p(h,e.children)}else l||null!=u||I(h,f,g,i,o);((v=g.onVnodeUpdated)||d)&&Qi(()=>{v&&Ar(v,i,e,t),d&&Qe(e,t,i,"updated")},r)},A=(t,e,n,i,r,o,s)=>{for(let a=0;a<e.length;a++){const l=t[a],h=e[a];m(l,h,l.el&&(l.type===lr||!wr(l,h)||198&l.shapeFlag)?f(l.el):n,null,i,r,o,s,!0)}},I=(t,e,i,r,o)=>{if(e!==i){if(e!==n)for(const n in e)C(n)||n in i||a(t,n,e[n],null,o,r);for(const n in i){if(C(n))continue;const s=i[n],l=e[n];s!==l&&"value"!==n&&a(t,n,l,s,o,r)}"value"in i&&a(t,"value",e.value,i.value,o)}},W=(t,e,n,i,r,s,a,l,c)=>{const u=e.el=t?t.el:h(""),d=e.anchor=t?t.anchor:h("");let{patchFlag:p,dynamicChildren:f,slotScopeIds:g}=e;g&&(l=l?l.concat(g):g),null==t?(o(u,n,i),o(d,n,i),B(e.children||[],n,d,r,s,a,l,c)):p>0&&64&p&&f&&t.dynamicChildren&&t.dynamicChildren.length===f.length?(A(t.dynamicChildren,f,n,r,s,a,l),(null!=e.key||r&&e===r.subTree)&&ir(t,e,!0)):U(t,e,n,d,r,s,a,l,c)},z=(t,e,n,i,r,o,s,a,l)=>{e.slotScopeIds=a,null==t?512&e.shapeFlag?r.ctx.activate(e,n,i,s,l):N(e,n,i,r,o,s,l):j(t,e,l)},N=(t,e,i,r,o,s,a)=>{const l=t.component=function(t,e,i){const r=t.type,o=(e?e.appContext:t.appContext)||Mr,s={uid:Dr++,vnode:t,type:r,parent:e,appContext:o,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new et(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:e?e.provides:Object.create(o.provides),ids:e?e.ids:["",0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:Yi(r,o),emitsOptions:Bi(r,o),emit:null,emitted:null,propsDefaults:n,inheritAttrs:r.inheritAttrs,ctx:n,data:n,props:n,attrs:n,slots:n,refs:n,setupState:n,setupContext:null,suspense:i,suspenseId:i?i.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null};s.ctx={_:s},s.root=e?e.root:s,s.emit=Pi.bind(null,s),t.ce&&t.ce(s);return s}(t,r,o);if(Nn(t)&&(l.ctx.renderer=it),function(t,e=!1,n=!1){e&&Fr(e);const{props:i,children:r}=t.vnode,o=Vr(t);ji(t,i,o,e),((t,e,n)=>{const i=t.slots=zi();if(32&t.vnode.shapeFlag){const t=e._;t?(Ji(i,e,n),n&&D(i,"_",t,!0)):qi(e,i)}else e&&Zi(t,e)})(t,r,n||e);const s=o?function(t,e){const n=t.type;t.accessCache=Object.create(null),t.proxy=new Proxy(t.ctx,ui);const{setup:i}=n;if(i){mt();const n=t.setupContext=i.length>1?function(t){const e=e=>{t.exposed=e||{}};return{attrs:new Proxy(t.attrs,$r),slots:t.slots,emit:t.emit,expose:e}}(t):null,r=Nr(t),o=Be(i,t,0,[t.props,n]),s=b(o);if(yt(),r(),!s&&!t.sp||zn(t)||Mn(t),s){if(o.then(jr,jr),e)return o.then(n=>{Xr(t,n,e)}).catch(e=>{Ae(e,t,0)});t.asyncDep=o}else Xr(t,o,e)}else Gr(t,e)}(t,e):void 0;e&&Fr(!1)}(l,!1,a),l.asyncDep){if(o&&o.registerDep(l,V,a),!t.el){const n=l.subTree=Cr(cr);w(null,n,e,i),t.placeholder=n.el}}else V(l,t,e,i,o,s,a)},j=(t,e,n)=>{const i=e.component=t.component;if(function(t,e,n){const{props:i,children:r,component:o}=t,{props:s,children:a,patchFlag:l}=e,h=o.emitsOptions;if(e.dirs||e.transition)return!0;if(!(n&&l>=0))return!(!r&&!a||a&&a.$stable)||i!==s&&(i?!s||Ii(i,s,h):!!s);if(1024&l)return!0;if(16&l)return i?Ii(i,s,h):!!s;if(8&l){const t=e.dynamicProps;for(let e=0;e<t.length;e++){const n=t[e];if(Fi(s,i,n)&&!Ri(h,n))return!0}}return!1}(t,e,n)){if(i.asyncDep&&!i.asyncResolved)return void H(i,e,n);i.next=e,i.update()}else e.el=t.el,i.vnode=e},V=(t,e,n,i,r,o,s)=>{const a=()=>{if(t.isMounted){let{next:e,bu:n,u:i,parent:a,vnode:l}=t;{const n=rr(t);if(n)return e&&(e.el=l.el,H(t,e,s)),void n.asyncDep.then(()=>{Qi(()=>{t.isUnmounted||h()},r)})}let c,u=e;nr(t,!1),e?(e.el=l.el,H(t,e,s)):e=l,n&&M(n),(c=e.props&&e.props.onVnodeBeforeUpdate)&&Ar(c,a,e,l),nr(t,!0);const d=Ai(t),p=t.subTree;t.subTree=d,m(p,d,f(p.el),Q(p),t,r,o),e.el=d.el,null===u&&function({vnode:t,parent:e,suspense:n},i){for(;e;){const n=e.subTree;if(n.suspense&&n.suspense.activeBranch===t&&(n.suspense.vnode.el=n.el=i,t=n),n!==t)break;(t=e.vnode).el=i,e=e.parent}n&&n.activeBranch===t&&(n.vnode.el=i)}(t,d.el),i&&Qi(i,r),(c=e.props&&e.props.onVnodeUpdated)&&Qi(()=>Ar(c,a,e,l),r)}else{let s;const{el:a,props:l}=e,{bm:h,m:c,parent:u,root:d,type:p}=t,f=zn(e);if(nr(t,!1),h&&M(h),!f&&(s=l&&l.onVnodeBeforeMount)&&Ar(s,u,e),nr(t,!0),a&&st){const e=()=>{t.subTree=Ai(t),st(a,t.subTree,t,r,null)};f&&p.__asyncHydrate?p.__asyncHydrate(a,t,e):e()}else{d.ce&&d.ce._hasShadowRoot()&&d.ce._injectChildStyle(p,t.parent?t.parent.type:void 0);const s=t.subTree=Ai(t);m(null,s,n,i,t,r,o),e.el=s.el}if(c&&Qi(c,r),!f&&(s=l&&l.onVnodeMounted)){const t=e;Qi(()=>Ar(s,u,t),r)}(256&e.shapeFlag||u&&zn(u.vnode)&&256&u.vnode.shapeFlag)&&t.a&&Qi(t.a,r),t.isMounted=!0,e=n=i=null}};t.scope.on();const l=t.effect=new ot(a);t.scope.off();const h=t.update=l.run.bind(l),c=t.job=l.runIfDirty.bind(l);c.i=t,c.id=t.uid,l.scheduler=()=>Ve(c),nr(t,!0),h()},H=(t,e,i)=>{e.component=t;const r=t.vnode.props;t.vnode=e,t.next=null,function(t,e,n,i){const{props:r,attrs:o,vnode:{patchFlag:s}}=t,a=ve(r),[l]=t.propsOptions;let h=!1;if(!(i||s>0)||16&s){let i;Vi(t,e,r,o)&&(h=!0);for(const o in a)e&&(u(e,o)||(i=T(o))!==o&&u(e,i))||(l?!n||void 0===n[o]&&void 0===n[i]||(r[o]=Hi(l,a,o,void 0,t,!0)):delete r[o]);if(o!==a)for(const t in o)e&&u(e,t)||(delete o[t],h=!0)}else if(8&s){const n=t.vnode.dynamicProps;for(let i=0;i<n.length;i++){let s=n[i];if(Ri(t.emitsOptions,s))continue;const c=e[s];if(l)if(u(o,s))c!==o[s]&&(o[s]=c,h=!0);else{const e=L(s);r[e]=Hi(l,a,e,c,t,!1)}else c!==o[s]&&(o[s]=c,h=!0)}}h&&Tt(t.attrs,"set","")}(t,e.props,r,i),((t,e,i)=>{const{vnode:r,slots:o}=t;let s=!0,a=n;if(32&r.shapeFlag){const t=e._;t?i&&1===t?s=!1:Ji(o,e,i):(s=!e.$stable,qi(e,o)),a=e}else e&&(Zi(t,e),a={default:1});if(s)for(const n in o)Gi(n)||null!=a[n]||delete o[n]})(t,e.children,i),mt(),Ue(t),yt()},U=(t,e,n,i,r,o,s,a,l=!1)=>{const h=t&&t.children,c=t?t.shapeFlag:0,u=e.children,{patchFlag:d,shapeFlag:f}=e;if(d>0){if(128&d)return void X(h,u,n,i,r,o,s,a,l);if(256&d)return void Y(h,u,n,i,r,o,s,a,l)}8&f?(16&c&&J(h,r,o),u!==h&&p(n,u)):16&c?16&f?X(h,u,n,i,r,o,s,a,l):J(h,r,o,!0):(8&c&&p(n,""),16&f&&B(u,n,i,r,o,s,a,l))},Y=(t,e,n,r,o,s,a,l,h)=>{e=e||i;const c=(t=t||i).length,u=e.length,d=Math.min(c,u);let p;for(p=0;p<d;p++){const i=e[p]=h?Br(e[p]):Tr(e[p]);m(t[p],i,n,null,o,s,a,l,h)}c>u?J(t,o,s,!0,!1,d):B(e,n,r,o,s,a,l,h,d)},X=(t,e,n,r,o,s,a,l,h)=>{let c=0;const u=e.length;let d=t.length-1,p=u-1;for(;c<=d&&c<=p;){const i=t[c],r=e[c]=h?Br(e[c]):Tr(e[c]);if(!wr(i,r))break;m(i,r,n,null,o,s,a,l,h),c++}for(;c<=d&&c<=p;){const i=t[d],r=e[p]=h?Br(e[p]):Tr(e[p]);if(!wr(i,r))break;m(i,r,n,null,o,s,a,l,h),d--,p--}if(c>d){if(c<=p){const t=p+1,i=t<u?e[t].el:r;for(;c<=p;)m(null,e[c]=h?Br(e[c]):Tr(e[c]),n,i,o,s,a,l,h),c++}}else if(c>p)for(;c<=d;)$(t[c],o,s,!0),c++;else{const f=c,g=c,v=new Map;for(c=g;c<=p;c++){const t=e[c]=h?Br(e[c]):Tr(e[c]);null!=t.key&&v.set(t.key,c)}let _,y=0;const b=p-g+1;let w=!1,x=0;const S=new Array(b);for(c=0;c<b;c++)S[c]=0;for(c=f;c<=d;c++){const i=t[c];if(y>=b){$(i,o,s,!0);continue}let r;if(null!=i.key)r=v.get(i.key);else for(_=g;_<=p;_++)if(0===S[_-g]&&wr(i,e[_])){r=_;break}void 0===r?$(i,o,s,!0):(S[r-g]=c+1,r>=x?x=r:w=!0,m(i,e[r],n,null,o,s,a,l,h),y++)}const k=w?function(t){const e=t.slice(),n=[0];let i,r,o,s,a;const l=t.length;for(i=0;i<l;i++){const l=t[i];if(0!==l){if(r=n[n.length-1],t[r]<l){e[i]=r,n.push(i);continue}for(o=0,s=n.length-1;o<s;)a=o+s>>1,t[n[a]]<l?o=a+1:s=a;l<t[n[o]]&&(o>0&&(e[i]=n[o-1]),n[o]=i)}}o=n.length,s=n[o-1];for(;o-- >0;)n[o]=s,s=e[s];return n}(S):i;for(_=k.length-1,c=b-1;c>=0;c--){const t=g+c,i=e[t],d=e[t+1],p=t+1<u?d.el||sr(d):r;0===S[c]?m(null,i,n,p,o,s,a,l,h):w&&(_<0||c!==k[_]?G(i,n,p,2):_--)}}},G=(t,e,n,i,r=null)=>{const{el:a,type:l,transition:h,children:c,shapeFlag:u}=t;if(6&u)G(t.component.subTree,e,n,i);else if(128&u)t.suspense.move(e,n,i);else if(64&u)l.move(t,e,n,it);else if(l!==lr)if(l!==ur)if(2!==i&&1&u&&h)if(0===i)h.beforeEnter(a),o(a,e,n),Qi(()=>h.enter(a),r);else{const{leave:i,delayLeave:r,afterLeave:l}=h,c=()=>{t.ctx.isUnmounted?s(a):o(a,e,n)},u=()=>{a._isLeaving&&a[bn](!0),i(a,()=>{c(),l&&l()})};r?r(a,c,u):u()}else o(a,e,n);else S(t,e,n);else{o(a,e,n);for(let t=0;t<c.length;t++)G(c[t],e,n,i);o(t.anchor,e,n)}},$=(t,e,n,i=!1,r=!1)=>{const{type:o,props:s,ref:a,children:l,dynamicChildren:h,shapeFlag:c,patchFlag:u,dirs:d,cacheIndex:p,memo:f}=t;if(-2===u&&(r=!1),null!=a&&(mt(),Fn(a,null,n,t,!0),yt()),null!=p&&(e.renderCache[p]=void 0),256&c)return void e.ctx.deactivate(t);const g=1&c&&d,v=!zn(t);let _;if(v&&(_=s&&s.onVnodeBeforeUnmount)&&Ar(_,e,t),6&c)Z(t.component,n,i);else{if(128&c)return void t.suspense.unmount(n,i);g&&Qe(t,null,e,"beforeUnmount"),64&c?t.type.remove(t,e,n,it,i):h&&!h.hasOnce&&(o!==lr||u>0&&64&u)?J(h,e,n,!1,!0):(o===lr&&384&u||!r&&16&c)&&J(l,e,n),i&&K(t)}const m=null!=f&&null==p;(v&&(_=s&&s.onVnodeUnmounted)||g||m)&&Qi(()=>{_&&Ar(_,e,t),g&&Qe(t,null,e,"unmounted"),m&&(t.el=null)},n)},K=t=>{const{type:e,el:n,anchor:i,transition:r}=t;if(e===lr)return void q(n,i);if(e===ur)return void k(t);const o=()=>{s(n),r&&!r.persisted&&r.afterLeave&&r.afterLeave()};if(1&t.shapeFlag&&r&&!r.persisted){const{leave:e,delayLeave:i}=r,s=()=>e(n,o);i?i(t.el,o,s):s()}else o()},q=(t,e)=>{let n;for(;t!==e;)n=g(t),s(t),t=n;s(e)},Z=(t,e,n)=>{const{bum:i,scope:r,job:o,subTree:s,um:a,m:l,a:h}=t;or(l),or(h),i&&M(i),r.stop(),o&&(o.flags|=8,$(s,t,e,n)),a&&Qi(a,e),Qi(()=>{t.isUnmounted=!0},e)},J=(t,e,n,i=!1,r=!1,o=0)=>{for(let s=o;s<t.length;s++)$(t[s],e,n,i,r)},Q=t=>{if(6&t.shapeFlag)return Q(t.component.subTree);if(128&t.shapeFlag)return t.suspense.next();const e=g(t.anchor||t.el),n=e&&e[hn];return n?g(n):e};let tt=!1;const nt=(t,e,n)=>{let i;null==t?e._vnode&&($(e._vnode,null,null,!0),i=e._vnode.component):m(e._vnode||null,t,e,null,null,null,n),e._vnode=t,tt||(tt=!0,Ue(i),Ye(),tt=!1)},it={p:m,um:$,m:G,r:K,mt:N,mc:B,pc:U,pbc:A,n:Q,o:t};let rt,st;e&&([rt,st]=e(it));return{render:nt,hydrate:rt,createApp:Oi(nt,rt)}}(t)}function er({type:t,props:e},n){return"svg"===n&&"foreignObject"===t||"mathml"===n&&"annotation-xml"===t&&e&&e.encoding&&e.encoding.includes("html")?void 0:n}function nr({effect:t,job:e},n){n?(t.flags|=32,e.flags|=4):(t.flags&=-33,e.flags&=-5)}function ir(t,e,n=!1){const i=t.children,r=e.children;if(d(i)&&d(r))for(let o=0;o<i.length;o++){const t=i[o];let e=r[o];1&e.shapeFlag&&!e.dynamicChildren&&((e.patchFlag<=0||32===e.patchFlag)&&(e=r[o]=Br(r[o]),e.el=t.el),n||-2===e.patchFlag||ir(t,e)),e.type===hr&&(-1===e.patchFlag&&(e=r[o]=Br(e)),e.el=t.el),e.type!==cr||e.el||(e.el=t.el)}}function rr(t){const e=t.subTree.component;if(e)return e.asyncDep&&!e.asyncResolved?e:rr(e)}function or(t){if(t)for(let e=0;e<t.length;e++)t[e].flags|=8}function sr(t){if(t.placeholder)return t.placeholder;const e=t.component;return e?sr(e.subTree):null}var ar=t=>t.__isSuspense;var lr=Symbol.for("v-fgt"),hr=Symbol.for("v-txt"),cr=Symbol.for("v-cmt"),ur=Symbol.for("v-stc"),dr=[],pr=null;function fr(t=!1){dr.push(pr=t?null:[])}var gr=1;function vr(t,e=!1){gr+=t,t<0&&pr&&e&&(pr.hasOnce=!0)}function _r(t){return t.dynamicChildren=gr>0?pr||i:null,dr.pop(),pr=dr[dr.length-1]||null,gr>0&&pr&&pr.push(t),t}function mr(t,e,n,i,r,o){return _r(kr(t,e,n,i,r,o,!0))}function yr(t,e,n,i,r){return _r(Cr(t,e,n,i,r,!0))}function br(t){return!!t&&!0===t.__v_isVNode}function wr(t,e){return t.type===e.type&&t.key===e.key}var xr=({key:t})=>null!=t?t:null,Sr=({ref:t,ref_key:e,ref_for:n})=>("number"==typeof t&&(t=""+t),null!=t?_(t)||ye(t)||v(t)?{i:$e,r:t,k:e,f:!!n}:t:null);function kr(t,e=null,n=null,i=0,r=null,o=(t===lr?0:1),s=!1,a=!1){const l={__v_isVNode:!0,__v_skip:!0,type:t,props:e,key:e&&xr(e),ref:e&&Sr(e),scopeId:Ke,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:o,patchFlag:i,dynamicProps:r,dynamicChildren:null,appContext:null,ctx:$e};return a?(Rr(l,n),128&o&&t.normalize(l)):n&&(l.shapeFlag|=_(n)?8:16),gr>0&&!s&&pr&&(l.patchFlag>0||6&o)&&32!==l.patchFlag&&pr.push(l),l}var Cr=function(t,e=null,n=null,i=0,r=null,o=!1){t&&t!==oi||(t=cr);if(br(t)){const i=Er(t,e,!0);return n&&Rr(i,n),gr>0&&!o&&pr&&(6&i.shapeFlag?pr[pr.indexOf(t)]=i:pr.push(i)),i.patchFlag=-2,i}s=t,v(s)&&"__vccOpts"in s&&(t=t.__vccOpts);var s;if(e){e=function(t){return t?ge(t)||Ni(t)?l({},t):t:null}(e);let{class:t,style:n}=e;t&&!_(t)&&(e.class=H(t)),y(n)&&(ge(n)&&!d(n)&&(n=l({},n)),e.style=W(n))}const a=_(t)?1:ar(t)?128:cn(t)?64:y(t)?4:v(t)?2:0;return kr(t,e,n,i,r,a,o,!0)};function Er(t,e,n=!1,i=!1){const{props:r,ref:o,patchFlag:l,children:h,transition:c}=t,u=e?function(...t){const e={};for(let n=0;n<t.length;n++){const i=t[n];for(const t in i)if("class"===t)e.class!==i.class&&(e.class=H([e.class,i.class]));else if("style"===t)e.style=W([e.style,i.style]);else if(s(t)){const n=e[t],r=i[t];!r||n===r||d(n)&&n.includes(r)?null!=r||null!=n||a(t)||(e[t]=r):e[t]=n?[].concat(n,r):r}else""!==t&&(e[t]=i[t])}return e}(r||{},e):r,p={__v_isVNode:!0,__v_skip:!0,type:t.type,props:u,key:u&&xr(u),ref:e&&e.ref?n&&o?d(o)?o.concat(Sr(e)):[o,Sr(e)]:Sr(e):o,scopeId:t.scopeId,slotScopeIds:t.slotScopeIds,children:h,target:t.target,targetStart:t.targetStart,targetAnchor:t.targetAnchor,staticCount:t.staticCount,shapeFlag:t.shapeFlag,patchFlag:e&&t.type!==lr?-1===l?16:16|l:l,dynamicProps:t.dynamicProps,dynamicChildren:t.dynamicChildren,appContext:t.appContext,dirs:t.dirs,transition:c,component:t.component,suspense:t.suspense,ssContent:t.ssContent&&Er(t.ssContent),ssFallback:t.ssFallback&&Er(t.ssFallback),placeholder:t.placeholder,el:t.el,anchor:t.anchor,ctx:t.ctx,ce:t.ce};return c&&i&&Bn(p,c.clone(p)),p}function Or(t=" ",e=0){return Cr(hr,null,t,e)}function Lr(t,e){const n=Cr(ur,null,t);return n.staticCount=e,n}function Pr(t="",e=!1){return e?(fr(),yr(cr,null,t)):Cr(cr,null,t)}function Tr(t){return null==t||"boolean"==typeof t?Cr(cr):d(t)?Cr(lr,null,t.slice()):br(t)?Br(t):Cr(hr,null,String(t))}function Br(t){return null===t.el&&-1!==t.patchFlag||t.memo?t:Er(t)}function Rr(t,e){let n=0;const{shapeFlag:i}=t;if(null==e)e=null;else if(d(e))n=16;else if("object"==typeof e){if(65&i){const n=e.default;return void(n&&(n._c&&(n._d=!1),Rr(t,n()),n._c&&(n._d=!0)))}{n=32;const i=e._;i||Ni(e)?3===i&&$e&&(1===$e.slots._?e._=1:(e._=2,t.patchFlag|=1024)):e._ctx=$e}}else v(e)?(e={default:e,_ctx:$e},n=32):(e=String(e),64&i?(n=16,e=[Or(e)]):n=8);t.children=e,t.shapeFlag|=n}function Ar(t,e,n,i=null){Re(t,e,7,[n,i])}var Mr=Ci(),Dr=0;var Ir,Fr,Wr=null,zr=()=>Wr||$e;{const t=F(),e=(e,n)=>{let i;return(i=t[e])||(i=t[e]=[]),i.push(n),t=>{i.length>1?i.forEach(e=>e(t)):i[0](t)}};Ir=e("__VUE_INSTANCE_SETTERS__",t=>Wr=t),Fr=e("__VUE_SSR_SETTERS__",t=>Yr=t)}var Nr=t=>{const e=Wr;return Ir(t),t.scope.on(),()=>{t.scope.off(),Ir(e)}},jr=()=>{Wr&&Wr.scope.off(),Ir(null)};function Vr(t){return 4&t.vnode.shapeFlag}var Hr,Ur,Yr=!1;function Xr(t,e,n){v(e)?t.type.__ssrInlineRender?t.ssrRender=e:t.render=e:y(e)&&(t.setupState=ke(e)),Gr(t,n)}function Gr(t,e,n){const i=t.type;if(!t.render){if(!e&&Hr&&!i.render){const e=i.template||_i(t).template;if(e){const{isCustomElement:n,compilerOptions:r}=t.appContext.config,{delimiters:o,compilerOptions:s}=i,a=l(l({isCustomElement:n,delimiters:o},r),s);i.render=Hr(e,a)}}t.render=i.render||r,Ur&&Ur(t)}{const e=Nr(t);mt();try{fi(t)}finally{yt(),e()}}}var $r={get:(t,e)=>(Pt(t,0,""),t[e])};function Kr(t){return t.exposed?t.exposeProxy||(t.exposeProxy=new Proxy(ke((e=t.exposed,!u(e,"__v_skip")&&Object.isExtensible(e)&&D(e,"__v_skip",!0),e)),{get:(e,n)=>n in e?e[n]:n in hi?hi[n](t):void 0,has:(t,e)=>e in t||e in hi})):t.proxy;var e}var qr=(t,e)=>function(t,e,n=!1){let i,r;return v(t)?i=t:(i=t.get,r=t.set),new Ce(i,r,n)}(t,0,Yr);var Zr="3.5.33",Jr=void 0,Qr="undefined"!=typeof window&&window.trustedTypes;if(Qr)try{Jr=Qr.createPolicy("vue",{createHTML:t=>t})}catch(ES){}var to=Jr?t=>Jr.createHTML(t):t=>t,eo="undefined"!=typeof document?document:null,no=eo&&eo.createElement("template"),io={insert:(t,e,n)=>{e.insertBefore(t,n||null)},remove:t=>{const e=t.parentNode;e&&e.removeChild(t)},createElement:(t,e,n,i)=>{const r="svg"===e?eo.createElementNS("http://www.w3.org/2000/svg",t):"mathml"===e?eo.createElementNS("http://www.w3.org/1998/Math/MathML",t):n?eo.createElement(t,{is:n}):eo.createElement(t);return"select"===t&&i&&null!=i.multiple&&r.setAttribute("multiple",i.multiple),r},createText:t=>eo.createTextNode(t),createComment:t=>eo.createComment(t),setText:(t,e)=>{t.nodeValue=e},setElementText:(t,e)=>{t.textContent=e},parentNode:t=>t.parentNode,nextSibling:t=>t.nextSibling,querySelector:t=>eo.querySelector(t),setScopeId(t,e){t.setAttribute(e,"")},insertStaticContent(t,e,n,i,r,o){const s=n?n.previousSibling:e.lastChild;if(r&&(r===o||r.nextSibling))for(;e.insertBefore(r.cloneNode(!0),n),r!==o&&(r=r.nextSibling););else{no.innerHTML=to("svg"===i?`<svg>${t}</svg>`:"mathml"===i?`<math>${t}</math>`:t);const r=no.content;if("svg"===i||"mathml"===i){const t=r.firstChild;for(;t.firstChild;)r.appendChild(t.firstChild);r.removeChild(t)}e.insertBefore(r,n)}return[s?s.nextSibling:e.firstChild,n?n.previousSibling:e.lastChild]}},ro="transition",oo="animation",so=Symbol("_vtc"),ao={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},lo=l({},Sn,ao),ho=t=>(t.displayName="Transition",t.props=lo,t),co=ho((t,{slots:e})=>function(t,e,n){try{vr(-1);const i=arguments.length;return 2===i?y(e)&&!d(e)?br(e)?Cr(t,null,[e]):Cr(t,e):Cr(t,null,e):(i>3?n=Array.prototype.slice.call(arguments,2):3===i&&br(n)&&(n=[n]),Cr(t,e,n))}finally{vr(1)}}(En,function(t){const e={};for(const l in t)l in ao||(e[l]=t[l]);if(!1===t.css)return e;const{name:n="v",type:i,duration:r,enterFromClass:o=`${n}-enter-from`,enterActiveClass:s=`${n}-enter-active`,enterToClass:a=`${n}-enter-to`,appearFromClass:h=o,appearActiveClass:c=s,appearToClass:u=a,leaveFromClass:d=`${n}-leave-from`,leaveActiveClass:p=`${n}-leave-active`,leaveToClass:f=`${n}-leave-to`}=t,g=function(t){if(null==t)return null;if(y(t))return[fo(t.enter),fo(t.leave)];{const e=fo(t);return[e,e]}}(r),v=g&&g[0],_=g&&g[1],{onBeforeEnter:m,onEnter:b,onEnterCancelled:w,onLeave:x,onLeaveCancelled:S,onBeforeAppear:k=m,onAppear:C=b,onAppearCancelled:E=w}=e,O=(t,e,n,i)=>{t._enterCancelled=i,vo(t,e?u:a),vo(t,e?c:s),n&&n()},L=(t,e)=>{t._isLeaving=!1,vo(t,d),vo(t,f),vo(t,p),e&&e()},P=t=>(e,n)=>{const r=t?C:b,s=()=>O(e,t,n);uo(r,[e,s]),_o(()=>{vo(e,t?h:o),go(e,t?u:a),po(r)||yo(e,i,v,s)})};return l(e,{onBeforeEnter(t){uo(m,[t]),go(t,o),go(t,s)},onBeforeAppear(t){uo(k,[t]),go(t,h),go(t,c)},onEnter:P(!1),onAppear:P(!0),onLeave(t,e){t._isLeaving=!0;const n=()=>L(t,e);go(t,d),t._enterCancelled?(go(t,p),xo(t)):(xo(t),go(t,p)),_o(()=>{t._isLeaving&&(vo(t,d),go(t,f),po(x)||yo(t,i,_,n))}),uo(x,[t,n])},onEnterCancelled(t){O(t,!1,void 0,!0),uo(w,[t])},onAppearCancelled(t){O(t,!0,void 0,!0),uo(E,[t])},onLeaveCancelled(t){L(t),uo(S,[t])}})}(t),e)),uo=(t,e=[])=>{d(t)?t.forEach(t=>t(...e)):t&&t(...e)},po=t=>!!t&&(d(t)?t.some(t=>t.length>1):t.length>1);function fo(t){return(t=>{const e=_(t)?Number(t):NaN;return isNaN(e)?t:e})(t)}function go(t,e){e.split(/\s+/).forEach(e=>e&&t.classList.add(e)),(t[so]||(t[so]=new Set)).add(e)}function vo(t,e){e.split(/\s+/).forEach(e=>e&&t.classList.remove(e));const n=t[so];n&&(n.delete(e),n.size||(t[so]=void 0))}function _o(t){requestAnimationFrame(()=>{requestAnimationFrame(t)})}var mo=0;function yo(t,e,n,i){const r=t._endId=++mo,o=()=>{r===t._endId&&i()};if(null!=n)return setTimeout(o,n);const{type:s,timeout:a,propCount:l}=function(t,e){const n=window.getComputedStyle(t),i=t=>(n[t]||"").split(", "),r=i(`${ro}Delay`),o=i(`${ro}Duration`),s=bo(r,o),a=i(`${oo}Delay`),l=i(`${oo}Duration`),h=bo(a,l);let c=null,u=0,d=0;e===ro?s>0&&(c=ro,u=s,d=o.length):e===oo?h>0&&(c=oo,u=h,d=l.length):(u=Math.max(s,h),c=u>0?s>h?ro:oo:null,d=c?c===ro?o.length:l.length:0);const p=c===ro&&/\b(?:transform|all)(?:,|$)/.test(i(`${ro}Property`).toString());return{type:c,timeout:u,propCount:d,hasTransform:p}}(t,e);if(!s)return i();const h=s+"end";let c=0;const u=()=>{t.removeEventListener(h,d),o()},d=e=>{e.target===t&&++c>=l&&u()};setTimeout(()=>{c<l&&u()},a+1),t.addEventListener(h,d)}function bo(t,e){for(;t.length<e.length;)t=t.concat(t);return Math.max(...e.map((e,n)=>wo(e)+wo(t[n])))}function wo(t){return"auto"===t?0:1e3*Number(t.slice(0,-1).replace(",","."))}function xo(t){return(t?t.ownerDocument:document).body.offsetHeight}var So=Symbol("_vod"),ko=Symbol("_vsh"),Co=Symbol(""),Eo=/(?:^|;)\s*display\s*:/;var Oo=/\s*!important$/;function Lo(t,e,n){if(d(n))n.forEach(n=>Lo(t,e,n));else if(null==n&&(n=""),e.startsWith("--"))t.setProperty(e,n);else{const i=function(t,e){const n=To[e];if(n)return n;let i=L(e);if("filter"!==i&&i in t)return To[e]=i;i=B(i);for(let r=0;r<Po.length;r++){const n=Po[r]+i;if(n in t)return To[e]=n}return e}(t,e);Oo.test(n)?t.setProperty(T(i),n.replace(Oo,""),"important"):t[i]=n}}var Po=["Webkit","Moz","ms"],To={};function Bo(t,e,n,i){return"TEXTAREA"===t.tagName&&("width"===e||"height"===e)&&_(i)&&n===i}var Ro="http://www.w3.org/1999/xlink";function Ao(t,e,n,i,r,o=Y(e)){i&&e.startsWith("xlink:")?null==n?t.removeAttributeNS(Ro,e.slice(6,e.length)):t.setAttributeNS(Ro,e,n):null==n||o&&!X(n)?t.removeAttribute(e):t.setAttribute(e,o?"":m(n)?String(n):n)}function Mo(t,e,n,i,r){if("innerHTML"===e||"textContent"===e)return void(null!=n&&(t[e]="innerHTML"===e?to(n):n));const o=t.tagName;if("value"===e&&"PROGRESS"!==o&&!o.includes("-")){const i="OPTION"===o?t.getAttribute("value")||"":t.value,r=null==n?"checkbox"===t.type?"on":"":String(n);return i===r&&"_value"in t||(t.value=r),null==n&&t.removeAttribute(e),void(t._value=n)}let s=!1;if(""===n||null==n){const i=typeof t[e];"boolean"===i?n=X(n):null==n&&"string"===i?(n="",s=!0):"number"===i&&(n=0,s=!0)}try{t[e]=n}catch(ES){}s&&t.removeAttribute(r||e)}function Do(t,e,n,i){t.addEventListener(e,n,i)}var Io=Symbol("_vei");function Fo(t,e,n,i,r=null){const o=t[Io]||(t[Io]={}),s=o[e];if(i&&s)s.value=i;else{const[n,a]=function(t){let e;if(Wo.test(t)){let n;for(e={};n=t.match(Wo);)t=t.slice(0,t.length-n[0].length),e[n[0].toLowerCase()]=!0}return[":"===t[2]?t.slice(3):T(t.slice(2)),e]}(e);i?Do(t,n,o[e]=function(t,e){const n=t=>{if(t._vts){if(t._vts<=n.attached)return}else t._vts=Date.now();Re(function(t,e){if(d(e)){const n=t.stopImmediatePropagation;return t.stopImmediatePropagation=()=>{n.call(t),t._stopped=!0},e.map(t=>e=>!e._stopped&&t&&t(e))}return e}(t,n.value),e,5,[t])};return n.value=t,n.attached=jo(),n}(i,r),a):s&&(!function(t,e,n,i){t.removeEventListener(e,n,i)}(t,n,s,a),o[e]=void 0)}}var Wo=/(?:Once|Passive|Capture)$/;var zo=0,No=Promise.resolve(),jo=()=>zo||(No.then(()=>zo=0),zo=Date.now());var Vo=t=>111===t.charCodeAt(0)&&110===t.charCodeAt(1)&&t.charCodeAt(2)>96&&t.charCodeAt(2)<123;var Ho=t=>{const e=t.props["onUpdate:modelValue"]||!1;return d(e)?t=>M(e,t):e};function Uo(t){t.target.composing=!0}function Yo(t){const e=t.target;e.composing&&(e.composing=!1,e.dispatchEvent(new Event("input")))}var Xo=Symbol("_assign");function Go(t,e,n){return e&&(t=t.trim()),n&&(t=I(t)),t}var $o={created(t,{modifiers:{lazy:e,trim:n,number:i}},r){t[Xo]=Ho(r);const o=i||r.props&&"number"===r.props.type;Do(t,e?"change":"input",e=>{e.target.composing||t[Xo](Go(t.value,n,o))}),(n||o)&&Do(t,"change",()=>{t.value=Go(t.value,n,o)}),e||(Do(t,"compositionstart",Uo),Do(t,"compositionend",Yo),Do(t,"change",Yo))},mounted(t,{value:e}){t.value=null==e?"":e},beforeUpdate(t,{value:e,oldValue:n,modifiers:{lazy:i,trim:r,number:o}},s){if(t[Xo]=Ho(s),t.composing)return;const a=null==e?"":e;if((!o&&"number"!==t.type||/^0\d/.test(t.value)?t.value:I(t.value))===a)return;const l=t.getRootNode();if((l instanceof Document||l instanceof ShadowRoot)&&l.activeElement===t&&"range"!==t.type){if(i&&e===n)return;if(r&&t.value.trim()===a)return}t.value=a}},Ko={deep:!0,created(t,e,n){t[Xo]=Ho(n),Do(t,"change",()=>{const e=t._modelValue,n=Qo(t),i=t.checked,r=t[Xo];if(d(e)){const t=$(e,n),o=-1!==t;if(i&&!o)r(e.concat(n));else if(!i&&o){const n=[...e];n.splice(t,1),r(n)}}else if(f(e)){const t=new Set(e);i?t.add(n):t.delete(n),r(t)}else r(ts(t,i))})},mounted:qo,beforeUpdate(t,e,n){t[Xo]=Ho(n),qo(t,e,n)}};function qo(t,{value:e,oldValue:n},i){let r;if(t._modelValue=e,d(e))r=$(e,i.props.value)>-1;else if(f(e))r=e.has(i.props.value);else{if(e===n)return;r=G(e,ts(t,!0))}t.checked!==r&&(t.checked=r)}var Zo={deep:!0,created(t,{value:e,modifiers:{number:n}},i){const r=f(e);Do(t,"change",()=>{const e=Array.prototype.filter.call(t.options,t=>t.selected).map(t=>n?I(Qo(t)):Qo(t));t[Xo](t.multiple?r?new Set(e):e:e[0]),t._assigning=!0,je(()=>{t._assigning=!1})}),t[Xo]=Ho(i)},mounted(t,{value:e}){Jo(t,e)},beforeUpdate(t,e,n){t[Xo]=Ho(n)},updated(t,{value:e}){t._assigning||Jo(t,e)}};function Jo(t,e){const n=t.multiple,i=d(e);if(!n||i||f(e)){for(let r=0,o=t.options.length;r<o;r++){const o=t.options[r],s=Qo(o);if(n)if(i){const t=typeof s;o.selected="string"===t||"number"===t?e.some(t=>String(t)===String(s)):$(e,s)>-1}else o.selected=e.has(s);else if(G(Qo(o),e))return void(t.selectedIndex!==r&&(t.selectedIndex=r))}n||-1===t.selectedIndex||(t.selectedIndex=-1)}}function Qo(t){return"_value"in t?t._value:t.value}function ts(t,e){const n=e?"_trueValue":"_falseValue";return n in t?t[n]:e}var es,ns=["ctrl","shift","alt","meta"],is={stop:t=>t.stopPropagation(),prevent:t=>t.preventDefault(),self:t=>t.target!==t.currentTarget,ctrl:t=>!t.ctrlKey,shift:t=>!t.shiftKey,alt:t=>!t.altKey,meta:t=>!t.metaKey,left:t=>"button"in t&&0!==t.button,middle:t=>"button"in t&&1!==t.button,right:t=>"button"in t&&2!==t.button,exact:(t,e)=>ns.some(n=>t[`${n}Key`]&&!e.includes(n))},rs=(t,e)=>{if(!t)return t;const n=t._withMods||(t._withMods={}),i=e.join(".");return n[i]||(n[i]=(n,...i)=>{for(let t=0;t<e.length;t++){const i=is[e[t]];if(i&&i(n,e))return}return t(n,...i)})},os={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},ss=(t,e)=>{const n=t._withKeys||(t._withKeys={}),i=e.join(".");return n[i]||(n[i]=n=>{if(!("key"in n))return;const i=T(n.key);return e.some(t=>t===i||os[t]===i)?t(n):void 0})},as=l({patchProp:(t,e,n,i,r,o)=>{const l="svg"===r;"class"===e?function(t,e,n){const i=t[so];i&&(e=(e?[e,...i]:[...i]).join(" ")),null==e?t.removeAttribute("class"):n?t.setAttribute("class",e):t.className=e}(t,i,l):"style"===e?function(t,e,n){const i=t.style,r=_(n);let o=!1;if(n&&!r){if(e)if(_(e))for(const t of e.split(";")){const e=t.slice(0,t.indexOf(":")).trim();null==n[e]&&Lo(i,e,"")}else for(const t in e)null==n[t]&&Lo(i,t,"");for(const r in n){"display"===r&&(o=!0);const s=n[r];null!=s?Bo(t,r,!_(e)&&e?e[r]:void 0,s)||Lo(i,r,s):Lo(i,r,"")}}else if(r){if(e!==n){const t=i[Co];t&&(n+=";"+t),i.cssText=n,o=Eo.test(n)}}else e&&t.removeAttribute("style");So in t&&(t[So]=o?i.display:"",t[ko]&&(i.display="none"))}(t,n,i):s(e)?a(e)||Fo(t,e,0,i,o):("."===e[0]?(e=e.slice(1),1):"^"===e[0]?(e=e.slice(1),0):function(t,e,n,i){if(i)return"innerHTML"===e||"textContent"===e||!!(e in t&&Vo(e)&&v(n));if("spellcheck"===e||"draggable"===e||"translate"===e||"autocorrect"===e)return!1;if("sandbox"===e&&"IFRAME"===t.tagName)return!1;if("form"===e)return!1;if("list"===e&&"INPUT"===t.tagName)return!1;if("type"===e&&"TEXTAREA"===t.tagName)return!1;if("width"===e||"height"===e){const e=t.tagName;if("IMG"===e||"VIDEO"===e||"CANVAS"===e||"SOURCE"===e)return!1}return(!Vo(e)||!_(n))&&e in t}(t,e,i,l))?(Mo(t,e,i),t.tagName.includes("-")||"value"!==e&&"checked"!==e&&"selected"!==e||Ao(t,e,i,l,0,"value"!==e)):t._isVueCE&&(function(t,e){const n=t._def.props;if(!n)return!1;const i=L(e);return Array.isArray(n)?n.some(t=>L(t)===i):Object.keys(n).some(t=>L(t)===i)}(t,e)||t._def.__asyncLoader&&(/[A-Z]/.test(e)||!_(i)))?Mo(t,L(e),i,0,e):("true-value"===e?t._trueValue=i:"false-value"===e&&(t._falseValue=i),Ao(t,e,i,l))}},io);var ls;!function(t){t[t.No=0]="No",t[t.Yes=1]="Yes",t[t.NoAndSkip=2]="NoAndSkip",t[t.YesAndSkip=3]="YesAndSkip"}(ls||(ls={}));var hs={};function cs(t){return void 0===t}function us(t){return null==t}function ds(t){return"string"==typeof t}var{isFinite:ps}=Number;function fs(t){return"number"==typeof t}var{isArray:gs}=Array;function vs(t){return t&&"object"==typeof t}var _s,ms,ys,bs={default:(t,e)=>(ws(e,t),ws(t,e),t),assign(t,e,n){let i;Object.keys(e).forEach(r=>{var o,s;if(i=e[r],(null==i?void 0:i.constructor)===Object&&(null===(o=t[r])||void 0===o?void 0:o.constructor)===Object)return ws(t[r],e[r],n&&n[r]);n&&r in n?(null===(s=n[r])||void 0===s?void 0:s.constructor)===Object&&ws(t[r]={},e[r],n[r]):t[r]=e[r]})},copyAttrs:(t,e,n)=>(n.forEach(n=>{cs(e[n])||(t[n]=e[n])}),t),clone:t=>JSON.parse(JSON.stringify(t)),toMap(t){const e={};for(let n=0,i=t.length;n<i;n++)e[t[n]]=!0;return e},stintSet(t,e,n){n||(n=void 0),t[e]!==n&&(t[e]=n)}},{assign:ws}=bs,xs=class{get __useNaturalRatio(){return!0}get __isLinePath(){const{path:t}=this;return t&&6===t.length&&1===t[0]}get __usePathBox(){return this.__pathInputed}get __blendMode(){if(this.eraser&&"path"!==this.eraser)return"destination-out";const{blendMode:t}=this;return"pass-through"===t?null:t}constructor(t){this.__leaf=t}__get(t){if(this.__input){const e=this.__input[t];if(!cs(e))return e}return this[t]}__getData(){const t={tag:this.__leaf.tag},{__input:e}=this;let n;for(let i in this)"_"!==i[0]&&(n=e?e[i]:void 0,t[i]=cs(n)?this[i]:n);return t}__setInput(t,e){this.__input||(this.__input={}),this.__input[t]=e}__getInput(t){if(this.__input){const e=this.__input[t];if(!cs(e))return e}if("path"!==t||this.__pathInputed)return this["_"+t]}__removeInput(t){this.__input&&!cs(this.__input[t])&&(this.__input[t]=void 0)}__getInputData(t,e){const n={};if(t)if(gs(t))for(let i of t)n[i]=this.__getInput(i);else for(let i in t)n[i]=this.__getInput(i);else{let t,e,{__input:i}=this;n.tag=this.__leaf.tag;for(let r in this)if("_"!==r[0]&&(t=this["_"+r],!cs(t))){if("path"===r&&!this.__pathInputed)continue;e=i?i[r]:void 0,n[r]=cs(e)?t:e}}if(e&&e.matrix){const{a:t,b:e,c:i,d:r,e:o,f:s}=this.__leaf.__localMatrix;n.matrix={a:t,b:e,c:i,d:r,e:o,f:s}}return n}__setMiddle(t,e){this.__middle||(this.__middle={}),this.__middle[t]=e}__getMiddle(t){return this.__middle&&this.__middle[t]}__checkSingle(){const t=this;if("pass-through"===t.blendMode){const e=this.__leaf;t.opacity<1&&(e.isBranch||t.__hasMultiPaint)||e.__hasEraser||t.eraser||t.filter?t.__single=!0:t.__single&&(t.__single=!1)}else t.__single=!0}__removeNaturalSize(){this.__naturalWidth=this.__naturalHeight=void 0}destroy(){this.__input=this.__middle=null,this.__complexData&&this.__complexData.destroy()}},Ss={RUNTIME:"runtime",LEAF:"leaf",TASK:"task",CNAVAS:"canvas",IMAGE:"image",types:{},create(t){const{types:e}=ks;return e[t]?e[t]++:(e[t]=1,0)}},ks=Ss,{max:Cs}=Math,Es=[0,0,0,0],Os={zero:[...Es],tempFour:Es,set:(t,e,n,i,r)=>(void 0===n&&(n=i=r=e),t[0]=e,t[1]=n,t[2]=i,t[3]=r,t),setTemp:(t,e,n,i)=>Ls(Es,t,e,n,i),toTempAB(t,e,n){ys=n?fs(t)?e:t:[],fs(t)?(_s=Ts(t),ms=e):fs(e)?(_s=t,ms=Ts(e)):(_s=t,ms=e),4!==_s.length&&(_s=Ps(_s)),4!==ms.length&&(ms=Ps(ms))},get(t,e){let n;if(!fs(t))switch(t.length){case 4:n=cs(e)?t:[...t];break;case 2:n=[t[0],t[1],t[0],t[1]];break;case 3:n=[t[0],t[1],t[2],t[1]];break;case 1:t=t[0];break;default:t=0}if(n||(n=[t,t,t,t]),!cs(e))for(let i=0;i<4;i++)n[i]>e&&(n[i]=e);return n},max:(t,e,n)=>fs(t)&&fs(e)?Cs(t,e):(Bs(t,e,n),Ls(ys,Cs(_s[0],ms[0]),Cs(_s[1],ms[1]),Cs(_s[2],ms[2]),Cs(_s[3],ms[3]))),add:(t,e,n)=>fs(t)&&fs(e)?t+e:(Bs(t,e,n),Ls(ys,_s[0]+ms[0],_s[1]+ms[1],_s[2]+ms[2],_s[3]+ms[3])),swapAndScale(t,e,n,i){if(fs(t))return e===n?t*e:[t*n,t*e];const r=i?t:[],[o,s,a,l]=4===t.length?t:Ps(t);return Ls(r,a*n,l*e,o*n,s*e)}},{set:Ls,get:Ps,setTemp:Ts,toTempAB:Bs}=Os,{round:Rs,pow:As,max:Ms,floor:Ds,PI:Is}=Math,Fs={},Ws={within:(t,e,n)=>(vs(e)&&(n=e.max,e=e.min),!cs(e)&&t<e&&(t=e),!cs(n)&&t>n&&(t=n),t),fourNumber:Os.get,formatRotation:(t,e)=>(t%=360,e?t<0&&(t+=360):(t>180&&(t-=360),t<-180&&(t+=360)),Ws.float(t)),getGapRotation(t,e,n=0){let i=t+n;if(e>1){const t=Math.abs(i%e);(t<1||t>e-1)&&(i=Math.round(i/e)*e)}return i-n},float(t,e){const n=cs(e)?1e12:As(10,e);return-0===(t=Rs(t*n)/n)?0:t},sign:t=>t<0?-1:1,getScaleData(t,e,n,i){if(i||(i={}),e){const t=(fs(e)?e:e.width||0)/n.width,r=(fs(e)?e:e.height||0)/n.height;i.scaleX=t||r||1,i.scaleY=r||t||1}else t&&Ws.assignScale(i,t);return i},getScaleFixedData(t,e,n,i,r){let{scaleX:o,scaleY:s}=t;if((i||e)&&(o<0&&(o=-o),s<0&&(s=-s)),e)if(!0===e)o=s=n?1:1/o;else{let t;fs(e)?t=e:"zoom-in"===e&&(t=1),t&&(o=s=o>t||s>t?n?1:1/o:n?1:1/t)}return Fs.scaleX=o,Fs.scaleY=s,Fs},assignScale(t,e){fs(e)?t.scaleX=t.scaleY=e:(t.scaleX=e.x,t.scaleY=e.y)},getFloorScale:(t,e=1)=>Ms(Ds(t),e)/t,randInt:zs,randColor:t=>`rgba(${zs(255)},${zs(255)},${zs(255)},${t||1})`};function zs(t){return Math.round(Math.random()*t)}var Ns=Is/180,js=2*Is,Vs=Is/2;function Hs(){return{a:1,b:0,c:0,d:1,e:0,f:0}}var{sin:Us,cos:Ys,acos:Xs,sqrt:Gs}=Math,{float:$s}=Ws,Ks={};function qs(){return Object.assign(Object.assign(Object.assign({},{a:1,b:0,c:0,d:1,e:0,f:0}),{x:0,y:0,width:0,height:0}),{scaleX:1,scaleY:1,rotation:0,skewX:0,skewY:0})}var Zs,Js,Qs={defaultMatrix:{a:1,b:0,c:0,d:1,e:0,f:0},defaultWorld:qs(),tempMatrix:{},set(t,e=1,n=0,i=0,r=1,o=0,s=0){t.a=e,t.b=n,t.c=i,t.d=r,t.e=o,t.f=s},get:Hs,getWorld:qs,copy(t,e){t.a=e.a,t.b=e.b,t.c=e.c,t.d=e.d,t.e=e.e,t.f=e.f},translate(t,e,n){t.e+=e,t.f+=n},translateInner(t,e,n,i){t.e+=t.a*e+t.c*n,t.f+=t.b*e+t.d*n,i&&(t.e-=e,t.f-=n)},scale(t,e,n=e){t.a*=e,t.b*=e,t.c*=n,t.d*=n},pixelScale(t,e,n){n||(n=t),n.a=t.a*e,n.b=t.b*e,n.c=t.c*e,n.d=t.d*e,n.e=t.e*e,n.f=t.f*e},scaleOfOuter(t,e,n,i){ta.toInnerPoint(t,e,Ks),ta.scaleOfInner(t,Ks,n,i)},scaleOfInner(t,e,n,i=n){ta.translateInner(t,e.x,e.y),ta.scale(t,n,i),ta.translateInner(t,-e.x,-e.y)},rotate(t,e){const{a:n,b:i,c:r,d:o}=t,s=Ys(e*=Ns),a=Us(e);t.a=n*s-i*a,t.b=n*a+i*s,t.c=r*s-o*a,t.d=r*a+o*s},rotateOfOuter(t,e,n){ta.toInnerPoint(t,e,Ks),ta.rotateOfInner(t,Ks,n)},rotateOfInner(t,e,n){ta.translateInner(t,e.x,e.y),ta.rotate(t,n),ta.translateInner(t,-e.x,-e.y)},skew(t,e,n){const{a:i,b:r,c:o,d:s}=t;n&&(n*=Ns,t.a=i+o*n,t.b=r+s*n),e&&(e*=Ns,t.c=o+i*e,t.d=s+r*e)},skewOfOuter(t,e,n,i){ta.toInnerPoint(t,e,Ks),ta.skewOfInner(t,Ks,n,i)},skewOfInner(t,e,n,i=0){ta.translateInner(t,e.x,e.y),ta.skew(t,n,i),ta.translateInner(t,-e.x,-e.y)},multiply(t,e){const{a:n,b:i,c:r,d:o,e:s,f:a}=t;t.a=e.a*n+e.b*r,t.b=e.a*i+e.b*o,t.c=e.c*n+e.d*r,t.d=e.c*i+e.d*o,t.e=e.e*n+e.f*r+s,t.f=e.e*i+e.f*o+a},multiplyParent(t,e,n,i,r){const{e:o,f:s}=t;if(n||(n=t),cs(i)&&(i=1!==t.a||t.b||t.c||1!==t.d),i){const{a:i,b:o,c:s,d:a}=t;n.a=i*e.a+o*e.c,n.b=i*e.b+o*e.d,n.c=s*e.a+a*e.c,n.d=s*e.b+a*e.d,r&&(n.scaleX=e.scaleX*r.scaleX,n.scaleY=e.scaleY*r.scaleY)}else n.a=e.a,n.b=e.b,n.c=e.c,n.d=e.d,r&&(n.scaleX=e.scaleX,n.scaleY=e.scaleY);n.e=o*e.a+s*e.c+e.e,n.f=o*e.b+s*e.d+e.f},divide(t,e){ta.multiply(t,ta.tempInvert(e))},divideParent(t,e){ta.multiplyParent(t,ta.tempInvert(e))},tempInvert(t){const{tempMatrix:e}=ta;return ta.copy(e,t),ta.invert(e),e},invert(t){const{a:e,b:n,c:i,d:r,e:o,f:s}=t;if(n||i){const a=1/(e*r-n*i);t.a=r*a,t.b=-n*a,t.c=-i*a,t.d=e*a,t.e=-(o*r-s*i)*a,t.f=-(s*e-o*n)*a}else if(1===e&&1===r)t.e=-o,t.f=-s;else{const n=1/(e*r);t.a=r*n,t.d=e*n,t.e=-o*r*n,t.f=-s*e*n}},toOuterPoint(t,e,n,i){const{x:r,y:o}=e;n||(n=e),n.x=r*t.a+o*t.c,n.y=r*t.b+o*t.d,i||(n.x+=t.e,n.y+=t.f)},toInnerPoint(t,e,n,i){const{a:r,b:o,c:s,d:a}=t,l=1/(r*a-o*s),{x:h,y:c}=e;if(n||(n=e),n.x=(h*a-c*s)*l,n.y=(c*r-h*o)*l,!i){const{e:e,f:i}=t;n.x-=(e*a-i*s)*l,n.y-=(i*r-e*o)*l}},setLayout(t,e,n,i,r){const{x:o,y:s,scaleX:a,scaleY:l}=e;if(cs(r)&&(r=e.rotation||e.skewX||e.skewY),r){const{rotation:n,skewX:i,skewY:r}=e,o=n*Ns,s=Ys(o),h=Us(o);if(i||r){const e=i*Ns,n=r*Ns;t.a=(s+n*-h)*a,t.b=(h+n*s)*a,t.c=(e*s-h)*l,t.d=(s+e*h)*l}else t.a=s*a,t.b=h*a,t.c=-h*l,t.d=s*l}else t.a=a,t.b=0,t.c=0,t.d=l;t.e=o,t.f=s,(n=n||i)&&ta.translateInner(t,-n.x,-n.y,!i)},getLayout(t,e,n,i){const{a:r,b:o,c:s,d:a,e:l,f:h}=t;let c,u,d,p,f,g=l,v=h;if(o||s){const t=r*a-o*s;if(s&&!i){c=Gs(r*r+o*o),u=t/c;const e=r/c;d=o>0?Xs(e):-Xs(e)}else{u=Gs(s*s+a*a),c=t/u;const e=s/u;d=Vs-(a>0?Xs(-e):-Xs(e))}const e=$s(Ys(d)),n=Us(d);c=$s(c),u=$s(u),p=e?$s((s/u+n)/e/Ns,9):0,f=e?$s((o/c-n)/e/Ns,9):0,d=$s(d/Ns)}else c=r,u=a,d=p=f=0;return(e=n||e)&&(g+=e.x*r+e.y*s,v+=e.x*o+e.y*a,n||(g-=e.x,v-=e.y)),{x:g,y:v,scaleX:c,scaleY:u,rotation:d,skewX:p,skewY:f}},withScale(t,e,n=e){const i=t;if(!e||!n){const{a:i,b:r,c:o,d:s}=t;r||o?n=(i*s-r*o)/(e=Gs(i*i+r*r)):(e=i,n=s)}return i.scaleX=e,i.scaleY=n,i},reset(t){ta.set(t)}},ta=Qs,{float:ea}=Ws,{toInnerPoint:na,toOuterPoint:ia}=Qs,{sin:ra,cos:oa,abs:sa,sqrt:aa,atan2:la,min:ha,round:ca}=Math,ua={defaultPoint:{x:0,y:0},tempPoint:{},tempRadiusPoint:{},set(t,e=0,n=0){t.x=e,t.y=n},setRadius(t,e,n){t.radiusX=e,t.radiusY=cs(n)?e:n},copy(t,e){t.x=e.x,t.y=e.y},copyFrom(t,e,n){t.x=e,t.y=n},round(t,e){t.x=e?ca(t.x-.5)+.5:ca(t.x),t.y=e?ca(t.y-.5)+.5:ca(t.y)},move(t,e,n){vs(e)?(t.x+=e.x,t.y+=e.y):(t.x+=e,t.y+=n)},scale(t,e,n=e){t.x&&(t.x*=e),t.y&&(t.y*=n)},scaleOf(t,e,n,i=n){t.x+=(t.x-e.x)*(n-1),t.y+=(t.y-e.y)*(i-1)},rotate(t,e,n){n||(n=da.defaultPoint);const i=oa(e*=Ns),r=ra(e),o=t.x-n.x,s=t.y-n.y;t.x=n.x+o*i-s*r,t.y=n.y+o*r+s*i},tempToInnerOf(t,e){const{tempPoint:n}=da;return fa(n,t),na(e,n,n),n},tempToOuterOf(t,e){const{tempPoint:n}=da;return fa(n,t),ia(e,n,n),n},tempToInnerRadiusPointOf(t,e){const{tempRadiusPoint:n}=da;return fa(n,t),da.toInnerRadiusPointOf(t,e,n),n},copyRadiusPoint:(t,e,n,i)=>(fa(t,e),ga(t,n,i),t),toInnerRadiusPointOf(t,e,n){n||(n=t),na(e,t,n),n.radiusX=Math.abs(t.radiusX/e.scaleX),n.radiusY=Math.abs(t.radiusY/e.scaleY)},toInnerOf(t,e,n){na(e,t,n)},toOuterOf(t,e,n){ia(e,t,n)},getCenter:(t,e)=>({x:t.x+(e.x-t.x)/2,y:t.y+(e.y-t.y)/2}),getCenterX:(t,e)=>t+(e-t)/2,getCenterY:(t,e)=>t+(e-t)/2,getDistance:(t,e)=>pa(t.x,t.y,e.x,e.y),getDistanceFrom(t,e,n,i){const r=sa(n-t),o=sa(i-e);return aa(r*r+o*o)},getMinDistanceFrom:(t,e,n,i,r,o)=>ha(pa(t,e,n,i),pa(n,i,r,o)),getAngle:(t,e)=>va(t,e)/Ns,getRotation:(t,e,n,i)=>(i||(i=e),da.getRadianFrom(t.x,t.y,e.x,e.y,n.x,n.y,i.x,i.y)/Ns),getRadianFrom(t,e,n,i,r,o,s,a){cs(s)&&(s=n,a=i);const l=t-n,h=e-i,c=r-s,u=o-a;return Math.atan2(l*u-h*c,l*c+h*u)},getAtan2:(t,e)=>la(e.y-t.y,e.x-t.x),getDistancePoint(t,e,n,i,r){const o=va(t,e);return r&&(t=e),i||(e={}),e.x=t.x+oa(o)*n,e.y=t.y+ra(o)*n,e},toNumberPoints(t){let e=t;return vs(t[0])&&(e=[],t.forEach(t=>e.push(t.x,t.y))),e},isSame:(t,e,n)=>n?t.x===e.x&&t.y===e.y:ea(t.x)===ea(e.x)&&ea(t.y)===ea(e.y),reset(t){da.reset(t)}},da=ua,{getDistanceFrom:pa,copy:fa,setRadius:ga,getAtan2:va}=da,_a=class t{constructor(t,e){this.set(t,e)}set(t,e){return vs(t)?ua.copy(this,t):ua.set(this,t,e),this}get(){const{x:t,y:e}=this;return{x:t,y:e}}clone(){return new t(this)}move(t,e){return ua.move(this,t,e),this}scale(t,e){return ua.scale(this,t,e),this}scaleOf(t,e,n){return ua.scaleOf(this,t,e,n),this}rotate(t,e){return ua.rotate(this,t,e),this}rotateOf(t,e){return ua.rotate(this,e,t),this}getRotation(t,e,n){return ua.getRotation(this,t,e,n)}toInnerOf(t,e){return ua.toInnerOf(this,t,e),this}toOuterOf(t,e){return ua.toOuterOf(this,t,e),this}getCenter(e){return new t(ua.getCenter(this,e))}getDistance(t){return ua.getDistance(this,t)}getDistancePoint(e,n,i,r){return new t(ua.getDistancePoint(this,e,n,i,r))}getAngle(t){return ua.getAngle(this,t)}getAtan2(t){return ua.getAtan2(this,t)}isSame(t,e){return ua.isSame(this,t,e)}reset(){return ua.reset(this),this}},ma=(new _a,class t{constructor(t,e,n,i,r,o){this.set(t,e,n,i,r,o)}set(t,e,n,i,r,o){return vs(t)?Qs.copy(this,t):Qs.set(this,t,e,n,i,r,o),this}setWith(t){return Qs.copy(this,t),this.scaleX=t.scaleX,this.scaleY=t.scaleY,this}get(){const{a:t,b:e,c:n,d:i,e:r,f:o}=this;return{a:t,b:e,c:n,d:i,e:r,f:o}}clone(){return new t(this)}translate(t,e){return Qs.translate(this,t,e),this}translateInner(t,e){return Qs.translateInner(this,t,e),this}scale(t,e){return Qs.scale(this,t,e),this}scaleWith(t,e){return Qs.scale(this,t,e),this.scaleX*=t,this.scaleY*=e||t,this}pixelScale(t){return Qs.pixelScale(this,t),this}scaleOfOuter(t,e,n){return Qs.scaleOfOuter(this,t,e,n),this}scaleOfInner(t,e,n){return Qs.scaleOfInner(this,t,e,n),this}rotate(t){return Qs.rotate(this,t),this}rotateOfOuter(t,e){return Qs.rotateOfOuter(this,t,e),this}rotateOfInner(t,e){return Qs.rotateOfInner(this,t,e),this}skew(t,e){return Qs.skew(this,t,e),this}skewOfOuter(t,e,n){return Qs.skewOfOuter(this,t,e,n),this}skewOfInner(t,e,n){return Qs.skewOfInner(this,t,e,n),this}multiply(t){return Qs.multiply(this,t),this}multiplyParent(t){return Qs.multiplyParent(this,t),this}divide(t){return Qs.divide(this,t),this}divideParent(t){return Qs.divideParent(this,t),this}invert(){return Qs.invert(this),this}invertWith(){return Qs.invert(this),this.scaleX=1/this.scaleX,this.scaleY=1/this.scaleY,this}toOuterPoint(t,e,n){Qs.toOuterPoint(this,t,e,n)}toInnerPoint(t,e,n){Qs.toInnerPoint(this,t,e,n)}setLayout(t,e,n){return Qs.setLayout(this,t,e,n),this}getLayout(t,e,n){return Qs.getLayout(this,t,e,n)}withScale(t,e){return Qs.withScale(this,t,e)}reset(){Qs.reset(this)}}),ya=(new ma,{tempPointBounds:{},setPoint(t,e,n){t.minX=t.maxX=e,t.minY=t.maxY=n},addPoint(t,e,n){t.minX=e<t.minX?e:t.minX,t.minY=n<t.minY?n:t.minY,t.maxX=e>t.maxX?e:t.maxX,t.maxY=n>t.maxY?n:t.maxY},addBounds(t,e,n,i,r){ba(t,e,n),ba(t,e+i,n+r)},copy(t,e){t.minX=e.minX,t.minY=e.minY,t.maxX=e.maxX,t.maxY=e.maxY},addPointBounds(t,e){t.minX=e.minX<t.minX?e.minX:t.minX,t.minY=e.minY<t.minY?e.minY:t.minY,t.maxX=e.maxX>t.maxX?e.maxX:t.maxX,t.maxY=e.maxY>t.maxY?e.maxY:t.maxY},toBounds(t,e){e.x=t.minX,e.y=t.minY,e.width=t.maxX-t.minX,e.height=t.maxY-t.minY}}),{addPoint:ba}=ya;(function(t){t[t.top=0]="top",t[t.right=1]="right",t[t.bottom=2]="bottom",t[t.left=3]="left"})(Zs||(Zs={})),function(t){t[t.topLeft=0]="topLeft",t[t.top=1]="top",t[t.topRight=2]="topRight",t[t.right=3]="right",t[t.bottomRight=4]="bottomRight",t[t.bottom=5]="bottom",t[t.bottomLeft=6]="bottomLeft",t[t.left=7]="left",t[t.center=8]="center",t[t["top-left"]=0]="top-left",t[t["top-right"]=2]="top-right",t[t["bottom-right"]=4]="bottom-right",t[t["bottom-left"]=6]="bottom-left"}(Js||(Js={}));var wa=[{x:0,y:0},{x:.5,y:0},{x:1,y:0},{x:1,y:.5},{x:1,y:1},{x:.5,y:1},{x:0,y:1},{x:0,y:.5},{x:.5,y:.5}];wa.forEach(t=>t.type="percent");var xa={directionData:wa,tempPoint:{},get:Sa,toPoint(t,e,n,i,r,o){const s=Sa(t);n.x=s.x,n.y=s.y,"percent"===s.type&&(n.x*=e.width,n.y*=e.height,r&&(o||(n.x-=r.x,n.y-=r.y),s.x&&(n.x-=1===s.x?r.width:.5===s.x?s.x*r.width:0),s.y&&(n.y-=1===s.y?r.height:.5===s.y?s.y*r.height:0))),i||(n.x+=e.x,n.y+=e.y)},getPoint:(t,e,n,i=!0)=>(n||(n={}),xa.toPoint(t,e,n,i),n)};function Sa(t){return ds(t)?wa[Js[t]]:t}var ka,Ca,Ea,Oa,{toPoint:La}=xa,Pa={toPoint(t,e,n,i,r,o){La(t,n,i,r,e,o)}},{tempPointBounds:Ta,setPoint:Ba,addPoint:Ra,toBounds:Aa}=ya,{toOuterPoint:Ma}=Qs,{float:Da,fourNumber:Ia}=Ws,{floor:Fa,ceil:Wa}=Math,za={},Na={},ja={},Va={tempBounds:ja,set(t,e=0,n=0,i=0,r=0){t.x=e,t.y=n,t.width=i,t.height=r},copy(t,e){t.x=e.x,t.y=e.y,t.width=e.width,t.height=e.height},copyAndSpread(t,e,n,i,r){const{x:o,y:s,width:a,height:l}=e;if(gs(n)){const e=Ia(n);i?Ha.set(t,o+e[3],s+e[0],a-e[1]-e[3],l-e[2]-e[0]):Ha.set(t,o-e[3],s-e[0],a+e[1]+e[3],l+e[2]+e[0])}else i&&(n=-n),Ha.set(t,o-n,s-n,a+2*n,l+2*n);r&&("width"===r?(t.y=s,t.height=l):(t.x=o,t.width=a))},minX:t=>t.width>0?t.x:t.x+t.width,minY:t=>t.height>0?t.y:t.y+t.height,maxX:t=>t.width>0?t.x+t.width:t.x,maxY:t=>t.height>0?t.y+t.height:t.y,move(t,e,n){t.x+=e,t.y+=n},scroll(t,e){t.x+=e.scrollX,t.y+=e.scrollY},getByMove:(t,e,n)=>(t=Object.assign({},t),Ha.move(t,e,n),t),toOffsetOutBounds(t,e,n){e?Ya(e,t):e=t,n||(n=t),e.offsetX=Ha.maxX(n),e.offsetY=Ha.maxY(n),Ha.move(e,-e.offsetX,-e.offsetY)},scale(t,e,n=e,i){i||ua.scale(t,e,n),t.width*=e,t.height*=n},scaleOf(t,e,n,i=n){ua.scaleOf(t,e,n,i),t.width*=n,t.height*=i},tempToOuterOf:(t,e)=>(Ha.copy(ja,t),Ha.toOuterOf(ja,e),ja),getOuterOf:(t,e)=>(t=Object.assign({},t),Ha.toOuterOf(t,e),t),toOuterOf(t,e,n){if(n||(n=t),0===e.b&&0===e.c){const{a:i,d:r,e:o,f:s}=e;i>0?(n.width=t.width*i,n.x=o+t.x*i):(n.width=t.width*-i,n.x=o+t.x*i-n.width),r>0?(n.height=t.height*r,n.y=s+t.y*r):(n.height=t.height*-r,n.y=s+t.y*r-n.height)}else za.x=t.x,za.y=t.y,Ma(e,za,Na),Ba(Ta,Na.x,Na.y),za.x=t.x+t.width,Ma(e,za,Na),Ra(Ta,Na.x,Na.y),za.y=t.y+t.height,Ma(e,za,Na),Ra(Ta,Na.x,Na.y),za.x=t.x,Ma(e,za,Na),Ra(Ta,Na.x,Na.y),Aa(Ta,n)},toInnerOf(t,e,n){n||(n=t),Ha.move(n,-e.e,-e.f),Ha.scale(n,1/e.a,1/e.d)},getFitMatrix(t,e,n=1){const i=Math.min(n,Ha.getFitScale(t,e));return new ma(i,0,0,i,-e.x*i,-e.y*i)},getFitScale(t,e,n){const i=t.width/e.width,r=t.height/e.height;return n?Math.max(i,r):Math.min(i,r)},put(t,e,n="center",i=1,r=!0,o){o||(o=e),ds(i)&&(i=Ha.getFitScale(t,e,"cover"===i)),ja.width=r?e.width*=i:e.width*i,ja.height=r?e.height*=i:e.height*i,Pa.toPoint(n,ja,t,o,!0,!0)},getSpread(t,e,n){const i={};return Ha.copyAndSpread(i,t,e,!1,n),i},spread(t,e,n){Ha.copyAndSpread(t,t,e,!1,n)},shrink(t,e,n){Ha.copyAndSpread(t,t,e,!0,n)},ceil(t){const{x:e,y:n}=t;t.x=Fa(t.x),t.y=Fa(t.y),t.width=e>t.x?Wa(t.width+e-t.x):Wa(t.width),t.height=n>t.y?Wa(t.height+n-t.y):Wa(t.height)},unsign(t){t.width<0&&(t.x+=t.width,t.width=-t.width),t.height<0&&(t.y+=t.height,t.height=-t.height)},float(t,e){t.x=Da(t.x,e),t.y=Da(t.y,e),t.width=Da(t.width,e),t.height=Da(t.height,e)},add(t,e,n){ka=t.x+t.width,Ca=t.y+t.height,Ea=e.x,Oa=e.y,n||(Ea+=e.width,Oa+=e.height),ka=ka>Ea?ka:Ea,Ca=Ca>Oa?Ca:Oa,t.x=t.x<e.x?t.x:e.x,t.y=t.y<e.y?t.y:e.y,t.width=ka-t.x,t.height=Ca-t.y},addList(t,e){Ha.setListWithFn(t,e,void 0,!0)},setList(t,e,n=!1){Ha.setListWithFn(t,e,void 0,n)},addListWithFn(t,e,n){Ha.setListWithFn(t,e,n,!0)},setListWithFn(t,e,n,i=!1){let r,o=!0;for(let s=0,a=e.length;s<a;s++)r=n?n(e[s],s):e[s],r&&(r.width||r.height)&&(o?(o=!1,i||Ya(t,r)):Ua(t,r));o&&Ha.reset(t)},setPoints(t,e){e.forEach((t,e)=>0===e?Ba(Ta,t.x,t.y):Ra(Ta,t.x,t.y)),Aa(Ta,t)},setPoint(t,e){Ha.set(t,e.x,e.y)},addPoint(t,e){Ua(t,e,!0)},getPoints(t){const{x:e,y:n,width:i,height:r}=t;return[{x:e,y:n},{x:e+i,y:n},{x:e+i,y:n+r},{x:e,y:n+r}]},getPoint:(t,e,n=!1,i)=>xa.getPoint(e,t,i,n),hitRadiusPoint:(t,e,n)=>(n&&(e=ua.tempToInnerRadiusPointOf(e,n)),e.x>=t.x-e.radiusX&&e.x<=t.x+t.width+e.radiusX&&e.y>=t.y-e.radiusY&&e.y<=t.y+t.height+e.radiusY),hitPoint:(t,e,n)=>(n&&(e=ua.tempToInnerOf(e,n)),e.x>=t.x&&e.x<=t.x+t.width&&e.y>=t.y&&e.y<=t.y+t.height),hit:(t,e,n)=>(n&&(e=Ha.tempToOuterOf(e,n)),!(t.y+t.height<e.y||e.y+e.height<t.y||t.x+t.width<e.x||e.x+e.width<t.x)),includes:(t,e,n)=>(n&&(e=Ha.tempToOuterOf(e,n)),t.x<=e.x&&t.y<=e.y&&t.x+t.width>=e.x+e.width&&t.y+t.height>=e.y+e.height),getIntersectData(t,e,n){if(n&&(e=Ha.tempToOuterOf(e,n)),!Ha.hit(t,e))return{x:0,y:0,width:0,height:0};let{x:i,y:r,width:o,height:s}=e;return ka=i+o,Ca=r+s,Ea=t.x+t.width,Oa=t.y+t.height,i=i>t.x?i:t.x,r=r>t.y?r:t.y,o=(ka=ka<Ea?ka:Ea)-i,s=(Ca=Ca<Oa?Ca:Oa)-r,{x:i,y:r,width:o,height:s}},intersect(t,e,n){Ha.copy(t,Ha.getIntersectData(t,e,n))},isSame:(t,e)=>t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height,isEmpty:t=>0===t.x&&0===t.y&&0===t.width&&0===t.height,hasSize:t=>t.width&&t.height,reset(t){Ha.set(t)}},Ha=Va,{add:Ua,copy:Ya}=Ha,Xa=class t{get minX(){return Va.minX(this)}get minY(){return Va.minY(this)}get maxX(){return Va.maxX(this)}get maxY(){return Va.maxY(this)}constructor(t,e,n,i){this.set(t,e,n,i)}set(t,e,n,i){return vs(t)?Va.copy(this,t):Va.set(this,t,e,n,i),this}get(){const{x:t,y:e,width:n,height:i}=this;return{x:t,y:e,width:n,height:i}}clone(){return new t(this)}move(t,e){return Va.move(this,t,e),this}scale(t,e,n){return Va.scale(this,t,e,n),this}scaleOf(t,e,n){return Va.scaleOf(this,t,e,n),this}toOuterOf(t,e){return Va.toOuterOf(this,t,e),this}toInnerOf(t,e){return Va.toInnerOf(this,t,e),this}getFitMatrix(t,e){return Va.getFitMatrix(this,t,e)}put(t,e,n){Va.put(this,t,e,n)}spread(t,e){return Va.spread(this,t,e),this}shrink(t,e){return Va.shrink(this,t,e),this}ceil(){return Va.ceil(this),this}unsign(){return Va.unsign(this),this}float(t){return Va.float(this,t),this}add(t){return Va.add(this,t),this}addList(t){return Va.setList(this,t,!0),this}setList(t){return Va.setList(this,t),this}addListWithFn(t,e){return Va.setListWithFn(this,t,e,!0),this}setListWithFn(t,e){return Va.setListWithFn(this,t,e),this}setPoint(t){return Va.setPoint(this,t),this}setPoints(t){return Va.setPoints(this,t),this}addPoint(t){return Va.addPoint(this,t),this}getPoints(){return Va.getPoints(this)}getPoint(t,e,n){return Va.getPoint(this,t,e,n)}hitPoint(t,e){return Va.hitPoint(this,t,e)}hitRadiusPoint(t,e){return Va.hitRadiusPoint(this,t,e)}hit(t,e){return Va.hit(this,t,e)}includes(t,e){return Va.includes(this,t,e)}intersect(t,e){return Va.intersect(this,t,e),this}getIntersect(e,n){return new t(Va.getIntersectData(this,e,n))}isSame(t){return Va.isSame(this,t)}isEmpty(){return Va.isEmpty(this)}reset(){Va.reset(this)}},Ga=new Xa,$a=class{constructor(t,e,n,i,r,o){vs(t)?this.copy(t):this.set(t,e,n,i,r,o)}set(t=0,e=0,n=0,i=0,r=0,o=0){this.top=t,this.right=e,this.bottom=n,this.left=i,this.width=r,this.height=o}copy(t){const{top:e,right:n,bottom:i,left:r,width:o,height:s}=t;this.set(e,n,i,r,o,s)}getBoundsFrom(t){const{top:e,right:n,bottom:i,left:r,width:o,height:s}=this;return new Xa(r,e,o||t.width-r-n,s||t.height-e-i)}},Ka={number:(t,e)=>vs(t)?"percent"===t.type?t.value*e:t.value:t},qa={0:1,1:1,2:1,3:1,4:1,5:1,6:1,7:1,8:1,9:1,".":1,e:1,E:1},{floor:Za,max:Ja}=Math,Qa={toURL(t,e){let n=encodeURIComponent(t);return"text"===e?n="data:text/plain;charset=utf-8,"+n:"svg"===e&&(n="data:image/svg+xml,"+n),n},image:{hitCanvasSize:100,maxCacheSize:4096e3,maxPatternSize:8847360,crossOrigin:"anonymous",isLarge:(t,e,n,i)=>t.width*t.height*(e?e*n:1)>(i||tl.maxCacheSize),isSuperLarge:(t,e,n)=>tl.isLarge(t,e,n,tl.maxPatternSize),getRealURL(t){const{prefix:e,suffix:n}=tl;return!n||t.startsWith("data:")||t.startsWith("blob:")||(t+=(t.includes("?")?"&":"?")+n),e&&"/"===t[0]&&(t=e+t),t},resize(t,e,n,i,r,o,s,a,l,h){const c=Ja(Za(e+(i||0)),1),u=Ja(Za(n+(r||0)),1);let d,p,f;h&&(f=Ka.number(h.offset,"x"===h.type?e:n))&&("x"===h.type?d=!0:p=!0);const g=Qa.origin.createCanvas(p?2*c:c,d?2*u:u),v=g.getContext("2d");if(a&&(v.globalAlpha=a),v.imageSmoothingEnabled=!1!==s,tl.canUse(t)){if(o){const i=e/o.width,r=n/o.height;v.setTransform(i,0,0,r,-o.x*i,-o.y*r),v.drawImage(t,0,0,t.width,t.height)}else v.drawImage(t,0,0,e,n);f&&(v.drawImage(g,0,0,c,u,d?f-c:c,d?u:f-u,c,u),v.drawImage(g,0,0,c,u,d?f:c,d?u:f,c,u))}return g},canUse:t=>t&&t.width&&!t.__closed,setPatternTransform(t,e,n){try{e&&t.setTransform&&(t.setTransform(e),e=void 0)}catch(t){}n&&bs.stintSet(n,"transform",e)}}},{image:tl}=Qa,{randColor:el}=Ws,nl=class t{constructor(t){this.repeatMap={},this.name=t}static get(e){return new t(e)}static set filter(t){this.filterList=il(t)}static set exclude(t){this.excludeList=il(t)}static drawRepaint(t,e){const n=el();t.fillWorld(e,n.replace("1)",".1)")),t.strokeWorld(e,n)}static drawBounds(e,n,i){const r="hit"===t.showBounds,o=e.__nowWorld,s=el();r&&(n.setWorld(o),e.__drawHitPath(n),n.fillStyle=s.replace("1)",".2)"),n.fill()),n.resetTransform(),n.setStroke(s,2),r?n.stroke():n.strokeWorld(o,s)}log(...t){if(rl.enable){if(rl.filterList.length&&rl.filterList.every(t=>t!==this.name))return;if(rl.excludeList.length&&rl.excludeList.some(t=>t===this.name))return}}tip(...t){rl.enable&&this.warn(...t)}warn(...t){rl.showWarn}repeat(t,...e){this.repeatMap[t]||(this.warn("repeat:"+t,...e),this.repeatMap[t]=!0)}error(...t){try{throw new Error}catch(ES){}}};function il(t){return t?ds(t)&&(t=[t]):t=[],t}nl.filterList=[],nl.excludeList=[],nl.showWarn=!0;var rl=nl,ol=nl.get("RunTime"),sl={currentId:0,currentName:"",idMap:{},nameMap:{},nameToIdMap:{},start(t,e){const n=Ss.create(Ss.RUNTIME);return al.currentId=al.idMap[n]=e?performance.now():Date.now(),al.currentName=al.nameMap[n]=t,al.nameToIdMap[t]=n,n},end(t,e){const n=al.idMap[t],i=al.nameMap[t],r=e?(performance.now()-n)/1e3:Date.now()-n;al.idMap[t]=al.nameMap[t]=al.nameToIdMap[i]=void 0,ol.log(i,r,"ms")},endOfName(t,e){const n=al.nameToIdMap[t];cs(n)||al.end(n,e)}},al=sl,ll=[],hl={list:{},add(t,...e){this.list[t]=!0,ll.push(...e)},has(t,e){const n=this.list[t];return!n&&e&&this.need(t),n},need(t){}};setTimeout(()=>ll.forEach(t=>hl.has(t,!0)));var cl={editor:t=>hl.need("editor")},ul=nl.get("UICreator"),dl={list:{},register(t){const{__tag:e}=t.prototype;pl[e]&&ul.repeat(e),pl[e]=t},get(t,e,n,i,r,o){if(!pl[t])return void ul.warn("not register "+t);const s=new pl[t](e);return cs(n)||(s.x=n,i&&(s.y=i),r&&(s.width=r),o&&(s.height=o)),s}},{list:pl}=dl,fl=nl.get("EventCreator"),gl={nameList:{},register(t){let e;Object.keys(t).forEach(n=>{e=t[n],ds(e)&&(vl[e]&&fl.repeat(e),vl[e]=t)})},changeName(t,e){const n=vl[t];if(n){const i=Object.keys(n).find(e=>n[e]===t);i&&(n[i]=e,vl[e]=n)}},has(t){return!!this.nameList[t]},get:(t,...e)=>new vl[t](...e)},{nameList:vl}=gl,_l=class{constructor(){this.list=[]}add(t){t.manager=this,this.list.push(t)}get(t){let e;const{list:n}=this;for(let r=0,o=n.length;r<o;r++)if(e=n[r],e.recycled&&e.isSameSize(t))return e.recycled=!1,e.manager||(e.manager=this),e;const i=cl.canvas(t);return this.add(i),i}recycle(t){t.recycled=!0}clearRecycled(){let t;const e=[];for(let n=0,i=this.list.length;n<i;n++)t=this.list[n],t.recycled?t.destroy():e.push(t);this.list=e}clear(){this.list.forEach(t=>{t.destroy()}),this.list.length=0}destroy(){this.clear()}};function ml(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s}function yl(t,e,n,i){return new(n||(n=Promise))(function(r,o){function s(t){try{l(i.next(t))}catch(t){o(t)}}function a(t){try{l(i.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n(function(t){t(e)})).then(s,a)}l((i=i.apply(t,e||[])).next())})}function bl(t){return(e,n)=>{t||(t=n);const i={get(){return this.context[t]},set(e){this.context[t]=e}};"strokeCap"===n&&(i.set=function(e){this.context[t]="none"===e?"butt":e}),Object.defineProperty(e,n,i)}}var wl=[];function xl(){return(t,e)=>{wl.push(e)}}var Sl=[],kl=class{set blendMode(t){"normal"===t&&(t="source-over"),this.context.globalCompositeOperation=t}get blendMode(){return this.context.globalCompositeOperation}set dashPattern(t){this.context.setLineDash(t||Sl)}get dashPattern(){return this.context.getLineDash()}__bindContext(){let t;wl.forEach(e=>{t=this.context[e],t&&(this[e]=t.bind(this.context))}),this.textBaseline="alphabetic"}setTransform(t,e,n,i,r,o){}resetTransform(){}getTransform(){}save(){}restore(){}transform(t,e,n,i,r,o){vs(t)?this.context.transform(t.a,t.b,t.c,t.d,t.e,t.f):this.context.transform(t,e,n,i,r,o)}translate(t,e){}scale(t,e){}rotate(t){}fill(t,e){}stroke(t){}clip(t,e){}fillRect(t,e,n,i){}strokeRect(t,e,n,i){}clearRect(t,e,n,i){}drawImage(t,e,n,i,r,o,s,a,l){switch(arguments.length){case 9:if(e<0){const t=-e/i*a;i+=e,e=0,o+=t,a-=t}if(n<0){const t=-n/r*l;r+=n,n=0,s+=t,l-=t}this.context.drawImage(t,e,n,i,r,o,s,a,l);break;case 5:this.context.drawImage(t,e,n,i,r);break;case 3:this.context.drawImage(t,e,n)}}beginPath(){}moveTo(t,e){}lineTo(t,e){}bezierCurveTo(t,e,n,i,r,o){}quadraticCurveTo(t,e,n,i){}closePath(){}arc(t,e,n,i,r,o){}arcTo(t,e,n,i,r){}ellipse(t,e,n,i,r,o,s,a){}rect(t,e,n,i){}roundRect(t,e,n,i,r){}createConicGradient(t,e,n){}createLinearGradient(t,e,n,i){}createPattern(t,e){}createRadialGradient(t,e,n,i,r,o){}fillText(t,e,n,i){}measureText(t){}strokeText(t,e,n,i){}destroy(){this.context=null}};ml([bl("imageSmoothingEnabled")],kl.prototype,"smooth",void 0),ml([bl("imageSmoothingQuality")],kl.prototype,"smoothLevel",void 0),ml([bl("globalAlpha")],kl.prototype,"opacity",void 0),ml([bl()],kl.prototype,"fillStyle",void 0),ml([bl()],kl.prototype,"strokeStyle",void 0),ml([bl("lineWidth")],kl.prototype,"strokeWidth",void 0),ml([bl("lineCap")],kl.prototype,"strokeCap",void 0),ml([bl("lineJoin")],kl.prototype,"strokeJoin",void 0),ml([bl("lineDashOffset")],kl.prototype,"dashOffset",void 0),ml([bl()],kl.prototype,"miterLimit",void 0),ml([bl()],kl.prototype,"shadowBlur",void 0),ml([bl()],kl.prototype,"shadowColor",void 0),ml([bl()],kl.prototype,"shadowOffsetX",void 0),ml([bl()],kl.prototype,"shadowOffsetY",void 0),ml([bl()],kl.prototype,"filter",void 0),ml([bl()],kl.prototype,"font",void 0),ml([bl()],kl.prototype,"fontKerning",void 0),ml([bl()],kl.prototype,"fontStretch",void 0),ml([bl()],kl.prototype,"fontVariantCaps",void 0),ml([bl()],kl.prototype,"textAlign",void 0),ml([bl()],kl.prototype,"textBaseline",void 0),ml([bl()],kl.prototype,"textRendering",void 0),ml([bl()],kl.prototype,"wordSpacing",void 0),ml([bl()],kl.prototype,"letterSpacing",void 0),ml([bl()],kl.prototype,"direction",void 0),ml([xl()],kl.prototype,"setTransform",null),ml([xl()],kl.prototype,"resetTransform",null),ml([xl()],kl.prototype,"getTransform",null),ml([xl()],kl.prototype,"save",null),ml([xl()],kl.prototype,"restore",null),ml([xl()],kl.prototype,"translate",null),ml([xl()],kl.prototype,"scale",null),ml([xl()],kl.prototype,"rotate",null),ml([xl()],kl.prototype,"fill",null),ml([xl()],kl.prototype,"stroke",null),ml([xl()],kl.prototype,"clip",null),ml([xl()],kl.prototype,"fillRect",null),ml([xl()],kl.prototype,"strokeRect",null),ml([xl()],kl.prototype,"clearRect",null),ml([xl()],kl.prototype,"beginPath",null),ml([xl()],kl.prototype,"moveTo",null),ml([xl()],kl.prototype,"lineTo",null),ml([xl()],kl.prototype,"bezierCurveTo",null),ml([xl()],kl.prototype,"quadraticCurveTo",null),ml([xl()],kl.prototype,"closePath",null),ml([xl()],kl.prototype,"arc",null),ml([xl()],kl.prototype,"arcTo",null),ml([xl()],kl.prototype,"ellipse",null),ml([xl()],kl.prototype,"rect",null),ml([xl()],kl.prototype,"roundRect",null),ml([xl()],kl.prototype,"createConicGradient",null),ml([xl()],kl.prototype,"createLinearGradient",null),ml([xl()],kl.prototype,"createPattern",null),ml([xl()],kl.prototype,"createRadialGradient",null),ml([xl()],kl.prototype,"fillText",null),ml([xl()],kl.prototype,"measureText",null),ml([xl()],kl.prototype,"strokeText",null);var{copy:Cl,multiplyParent:El,pixelScale:Ol}=Qs,{round:Ll}=Math,Pl=new Xa,Tl=new Xa,Bl={width:1,height:1,pixelRatio:1},Rl=["width","height","pixelRatio"],Al=class extends kl{get width(){return this.size.width}get height(){return this.size.height}get pixelRatio(){return this.size.pixelRatio}get pixelWidth(){return this.width*this.pixelRatio||0}get pixelHeight(){return this.height*this.pixelRatio||0}get pixelSnap(){return this.config.pixelSnap}set pixelSnap(t){this.config.pixelSnap=t}get allowBackgroundColor(){return this.view&&this.parentView}constructor(t,e){super(),this.size={},this.worldTransform={},t||(t=Bl),this.manager=e,this.innerId=Ss.create(Ss.CNAVAS);const{width:n,height:i,pixelRatio:r}=t;this.autoLayout=!n||!i,this.size.pixelRatio=r||Qa.devicePixelRatio,this.config=t,this.init()}init(){}__createContext(){const{view:t}=this,{contextSettings:e}=this.config;this.context=e?t.getContext("2d",e):t.getContext("2d"),this.__bindContext()}export(t,e){}toBlob(t,e){}toDataURL(t,e){}saveAs(t,e){}resize(t,e=!0){if(this.isSameSize(t))return;let n;this.context&&!this.unreal&&e&&this.width&&(n=this.getSameCanvas(),n.copyWorld(this));const i=this.size;bs.copyAttrs(i,t,Rl),Rl.forEach(t=>i[t]||(i[t]=1)),this.bounds=new Xa(0,0,this.width,this.height),this.updateViewSize(),this.updateClientBounds(),this.context&&(this.smooth=this.config.smooth,!this.unreal&&n&&(this.clearWorld(n.bounds),this.copyWorld(n),n.recycle()))}updateViewSize(){}updateClientBounds(){}getClientBounds(t){return t&&this.updateClientBounds(),this.clientBounds||this.bounds}startAutoLayout(t,e){}stopAutoLayout(){}setCursor(t){}setWorld(t,e){const{pixelRatio:n,pixelSnap:i}=this,r=this.worldTransform;e&&El(t,e,r),Ol(t,n,r),i&&!t.ignorePixelSnap&&(t.half&&t.half*n%2?(r.e=Ll(r.e-.5)+.5,r.f=Ll(r.f-.5)+.5):(r.e=Ll(r.e),r.f=Ll(r.f))),this.setTransform(r.a,r.b,r.c,r.d,r.e,r.f)}useWorldTransform(t){t&&(this.worldTransform=t);const e=this.worldTransform;e&&this.setTransform(e.a,e.b,e.c,e.d,e.e,e.f)}setStroke(t,e,n,i){e&&(this.strokeWidth=e),t&&(this.strokeStyle=t),n&&this.setStrokeOptions(n,i)}setStrokeOptions(t,e){let{strokeCap:n,strokeJoin:i,dashPattern:r,dashOffset:o,miterLimit:s}=t;e&&(e.strokeCap&&(n=e.strokeCap),e.strokeJoin&&(i=e.strokeJoin),cs(e.dashPattern)||(r=e.dashPattern),cs(e.dashOffset)||(o=e.dashOffset),e.miterLimit&&(s=e.miterLimit)),this.strokeCap=n,this.strokeJoin=i,this.dashPattern=r,this.dashOffset=o,this.miterLimit=s}saveBlendMode(t){this.savedBlendMode=this.blendMode,this.blendMode=t}restoreBlendMode(){this.blendMode=this.savedBlendMode}hitFill(t,e){return!0}hitStroke(t,e){return!0}hitPixel(t,e,n=1){return!0}setWorldShadow(t,e,n,i){const{pixelRatio:r}=this;this.shadowOffsetX=t*r,this.shadowOffsetY=e*r,this.shadowBlur=n*r,this.shadowColor=i||"black"}setWorldBlur(t){const{pixelRatio:e}=this;this.filter=`blur(${t*e}px)`}copyWorld(t,e,n,i,r){i&&(this.blendMode=i),e?(this.setTempPixelBounds(e,r),n?(this.setTempPixelBounds2(n,r),n=Tl):n=Pl,this.drawImage(t.view,Pl.x,Pl.y,Pl.width,Pl.height,n.x,n.y,n.width,n.height)):this.drawImage(t.view,0,0),i&&(this.blendMode="source-over")}copyWorldToInner(t,e,n,i,r){e.b||e.c?(this.save(),this.resetTransform(),this.copyWorld(t,e,Va.tempToOuterOf(n,e),i,r),this.restore()):(i&&(this.blendMode=i),this.setTempPixelBounds(e,r),this.drawImage(t.view,Pl.x,Pl.y,Pl.width,Pl.height,n.x,n.y,n.width,n.height),i&&(this.blendMode="source-over"))}copyWorldByReset(t,e,n,i,r,o){this.resetTransform(),this.copyWorld(t,e,n,i,o),r||this.useWorldTransform()}useGrayscaleAlpha(t){let e,n;this.setTempPixelBounds(t,!0,!0);const{context:i}=this,r=i.getImageData(Pl.x,Pl.y,Pl.width,Pl.height),{data:o}=r;for(let s=0,a=o.length;s<a;s+=4)n=.299*o[s]+.587*o[s+1]+.114*o[s+2],(e=o[s+3])&&(o[s+3]=255===e?n:e*(n/255));i.putImageData(r,Pl.x,Pl.y)}useMask(t,e,n){this.copyWorld(t,e,n,"destination-in")}useEraser(t,e,n){this.copyWorld(t,e,n,"destination-out")}fillWorld(t,e,n,i){n&&(this.blendMode=n),this.fillStyle=e,this.setTempPixelBounds(t,i),this.fillRect(Pl.x,Pl.y,Pl.width,Pl.height),n&&(this.blendMode="source-over")}strokeWorld(t,e,n,i){n&&(this.blendMode=n),this.strokeStyle=e,this.setTempPixelBounds(t,i),this.strokeRect(Pl.x,Pl.y,Pl.width,Pl.height),n&&(this.blendMode="source-over")}clipWorld(t,e=!0){this.beginPath(),this.setTempPixelBounds(t,e),this.rect(Pl.x,Pl.y,Pl.width,Pl.height),this.clip()}clipUI(t){t.windingRule?this.clip(t.windingRule):this.clip()}clearWorld(t,e=!0){this.setTempPixelBounds(t,e),this.clearRect(Pl.x,Pl.y,Pl.width,Pl.height)}clear(){const{pixelRatio:t}=this;this.clearRect(0,0,this.width*t+2,this.height*t+2)}setTempPixelBounds(t,e,n){this.copyToPixelBounds(Pl,t,e,n)}setTempPixelBounds2(t,e,n){this.copyToPixelBounds(Tl,t,e,n)}copyToPixelBounds(t,e,n,i){t.set(e),i&&t.intersect(this.bounds),t.scale(this.pixelRatio),n&&t.ceil()}isSameSize(t){return this.width===t.width&&this.height===t.height&&(!t.pixelRatio||this.pixelRatio===t.pixelRatio)}getSameCanvas(t,e){const{size:n,pixelSnap:i}=this,r=this.manager?this.manager.get(n):cl.canvas(Object.assign({},n));return r.save(),t&&(Cl(r.worldTransform,this.worldTransform),r.useWorldTransform()),e&&(r.smooth=this.smooth),r.pixelSnap!==i&&(r.pixelSnap=i),r}recycle(t){this.recycled||(this.restore(),t?this.clearWorld(t):this.clear(),this.manager?this.manager.recycle(this):this.destroy())}updateRender(t){}unrealCanvas(){}destroy(){this.manager=this.view=this.parentView=null}},Ml={creator:{},parse(t,e){},convertToCanvasData(t,e){}},Dl={N:21,D:22,X:23,G:24,F:25,O:26,P:27,U:28},Il=Object.assign({M:1,m:10,L:2,l:20,H:3,h:30,V:4,v:40,C:5,c:50,S:6,s:60,Q:7,q:70,T:8,t:80,A:9,a:90,Z:11,z:11,R:12},Dl),Fl={M:3,m:3,L:3,l:3,H:2,h:2,V:2,v:2,C:7,c:7,S:5,s:5,Q:5,q:5,T:3,t:3,A:8,a:8,Z:1,z:1,N:5,D:9,X:6,G:9,F:5,O:7,P:4,U:6},Wl={m:10,l:20,H:3,h:30,V:4,v:40,c:50,S:6,s:60,q:70,T:8,t:80,A:9,a:90},zl=Object.assign(Object.assign({},Wl),Dl),Nl=Il,jl={};for(let nL in Nl)jl[Nl[nL]]=nL;var Vl={};for(let nL in Nl)Vl[Nl[nL]]=Fl[nL];var Hl,Ul,Yl,Xl={drawRoundRect(t,e,n,i,r,o){const s=Ws.fourNumber(o,Math.min(i/2,r/2)),a=e+i,l=n+r;s[0]?t.moveTo(e+s[0],n):t.moveTo(e,n),s[1]?t.arcTo(a,n,a,l,s[1]):t.lineTo(a,n),s[2]?t.arcTo(a,l,e,l,s[2]):t.lineTo(a,l),s[3]?t.arcTo(e,l,e,n,s[3]):t.lineTo(e,l),s[0]?t.arcTo(e,n,a,n,s[0]):t.lineTo(e,n)}},{sin:Gl,cos:$l,hypot:Kl,atan2:ql,ceil:Zl,abs:Jl,PI:Ql,sqrt:th,pow:eh}=Math,{setPoint:nh,addPoint:ih}=ya,{set:rh,toNumberPoints:oh}=ua,{M:sh,L:ah,C:lh,Q:hh,Z:ch}=Il,uh={},dh={points(t,e,n,i){let r=oh(e);if(t.push(sh,r[0],r[1]),n&&r.length>5){let e,o,s,a,l,h,c,u,d,p,f,g,v,_,m,y=r.length;const b=!0===n?.5:n;i&&(r=[r[y-2],r[y-1],...r,r[0],r[1],r[2],r[3]],y=r.length);for(let n=2;n<y-2;n+=2)e=r[n-2],o=r[n-1],s=r[n],a=r[n+1],l=r[n+2],h=r[n+3],f=s-e,g=a-o,v=th(eh(f,2)+eh(g,2)),_=th(eh(l-s,2)+eh(h-a,2)),(v||_)&&(m=v+_,v=b*v/m,_=b*_/m,l-=e,h-=o,c=s-v*l,u=a-v*h,2===n?i||t.push(hh,c,u,s,a):(f||g)&&t.push(lh,d,p,c,u,s,a),d=s+_*l,p=a+_*h);i||t.push(hh,d,p,r[y-2],r[y-1])}else for(let o=2,s=r.length;o<s;o+=2)t.push(ah,r[o],r[o+1]);i&&t.push(ch)},rect(t,e,n,i,r){Ml.creator.path=t,Ml.creator.moveTo(e,n).lineTo(e+i,n).lineTo(e+i,n+r).lineTo(e,n+r).lineTo(e,n)},roundRect(t,e,n,i,r,o){Ml.creator.path=[],Xl.drawRoundRect(Ml.creator,e,n,i,r,o),t.push(...Ml.convertToCanvasData(Ml.creator.path,!0))},arcTo(t,e,n,i,r,o,s,a,l,h,c){const u=i-e,d=r-n,p=o-i,f=s-r;let g=ql(d,u),v=ql(f,p);const _=Kl(u,d),m=Kl(p,f);let y=v-g;if(y<0&&(y+=js),_<1e-12||m<1e-12||y<1e-12||Jl(y-Ql)<1e-12)return t&&t.push(ah,i,r),l&&(nh(l,e,n),ih(l,i,r)),c&&rh(c,e,n),void(h&&rh(h,i,r));const b=u*f-p*d<0,w=b?-1:1,x=a/$l(y/2),S=i+x*$l(g+y/2+Vs*w),k=r+x*Gl(g+y/2+Vs*w);return g-=Vs*w,v-=Vs*w,gh(t,S,k,a,a,0,g/Ns,v/Ns,b,l,h,c)},arc:(t,e,n,i,r,o,s,a,l,h)=>gh(t,e,n,i,i,0,r,o,s,a,l,h),ellipse(t,e,n,i,r,o,s,a,l,h,c,u){const d=o*Ns,p=Gl(d),f=$l(d);let g=s*Ns,v=a*Ns;g>Ql&&(g-=js),v<0&&(v+=js);let _=v-g;_<0?_+=js:_>js&&(_-=js),l&&(_-=js);const m=Zl(Jl(_/Vs)),y=_/m,b=Gl(y/4),w=8/3*b*b/Gl(y/2);v=g+y;let x,S,k,C,E,O,L,P,T=$l(g),B=Gl(g),R=k=f*i*T-p*r*B,A=C=p*i*T+f*r*B,M=e+k,D=n+C;t&&t.push(t.length?ah:sh,M,D),h&&nh(h,M,D),u&&rh(u,M,D);for(let I=0;I<m;I++)x=$l(v),S=Gl(v),k=f*i*x-p*r*S,C=p*i*x+f*r*S,E=e+R-w*(f*i*B+p*r*T),O=n+A-w*(p*i*B-f*r*T),L=e+k+w*(f*i*S+p*r*x),P=n+C+w*(p*i*S-f*r*x),t&&t.push(lh,E,O,L,P,e+k,n+C),h&&fh(e+R,n+A,E,O,L,P,e+k,n+C,h,!0),R=k,A=C,T=x,B=S,g=v,v+=y;c&&rh(c,e+k,n+C)},quadraticCurveTo(t,e,n,i,r,o,s){t.push(lh,(e+2*i)/3,(n+2*r)/3,(o+2*i)/3,(s+2*r)/3,o,s)},toTwoPointBoundsByQuadraticCurve(t,e,n,i,r,o,s,a){fh(t,e,(t+2*n)/3,(e+2*i)/3,(r+2*n)/3,(o+2*i)/3,r,o,s,a)},toTwoPointBounds(t,e,n,i,r,o,s,a,l,h){const c=[];let u,d,p,f,g,v,_,m,y=t,b=n,w=r,x=s;for(let S=0;S<2;++S)if(1==S&&(y=e,b=i,w=o,x=a),u=-3*y+9*b-9*w+3*x,d=6*y-12*b+6*w,p=3*b-3*y,Math.abs(u)<1e-12){if(Math.abs(d)<1e-12)continue;f=-p/d,0<f&&f<1&&c.push(f)}else _=d*d-4*p*u,m=Math.sqrt(_),_<0||(g=(-d+m)/(2*u),0<g&&g<1&&c.push(g),v=(-d-m)/(2*u),0<v&&v<1&&c.push(v));h?ih(l,t,e):nh(l,t,e),ih(l,s,a);for(let S=0,k=c.length;S<k;S++)ph(c[S],t,e,n,i,r,o,s,a,uh),ih(l,uh.x,uh.y)},getPointAndSet(t,e,n,i,r,o,s,a,l,h){const c=1-t,u=c*c*c,d=3*c*c*t,p=3*c*t*t,f=t*t*t;h.x=u*e+d*i+p*o+f*a,h.y=u*n+d*r+p*s+f*l},getPoint(t,e,n,i,r,o,s,a,l){const h={};return ph(t,e,n,i,r,o,s,a,l,h),h},getDerivative(t,e,n,i,r){const o=1-t;return 3*o*o*(n-e)+6*o*t*(i-n)+3*t*t*(r-i)},cut(t,e,n,i,r,o,s,a,l){if(t<=0)return{left:null,right:[i,r,o,s,a,l]};if(t>=1)return{left:[i,r,o,s,a,l],right:null};const h=1-t,c=e*h+i*t,u=n*h+r*t,d=i*h+o*t,p=r*h+s*t,f=o*h+a*t,g=s*h+l*t,v=c*h+d*t,_=u*h+p*t,m=d*h+f*t,y=p*h+g*t;return{left:[c,u,v,_,v*h+m*t,_*h+y*t],right:[m,y,f,g,a,l]}}},{getPointAndSet:ph,toTwoPointBounds:fh,ellipse:gh}=dh,{sin:vh,cos:_h,sqrt:mh,atan2:yh}=Math,{ellipse:bh}=dh,wh={ellipticalArc(t,e,n,i,r,o,s,a,l,h,c){const u=(l-e)/2,d=(h-n)/2,p=o*Ns,f=vh(p),g=_h(p),v=-g*u-f*d,_=-g*d+f*u,m=i*i,y=r*r,b=_*_,w=v*v,x=m*y-m*b-y*w;let S=0;if(x<0){const t=mh(1-x/(m*y));i*=t,r*=t}else S=(s===a?-1:1)*mh(x/(m*b+y*w));const k=S*i*_/r,C=-S*r*v/i,E=yh((_-C)/r,(v-k)/i),O=yh((-_-C)/r,(-v-k)/i);let L=O-E;0===a&&L>0?L-=js:1===a&&L<0&&(L+=js);const P=e+u+g*k-f*C,T=n+d+f*k+g*C,B=L<0?1:0;c||Qa.ellipseToCurve?bh(t,P,T,i,r,o,E/Ns,O/Ns,B):i!==r||o?t.push(Il.G,P,T,i,r,o,E/Ns,O/Ns,B):t.push(Il.O,P,T,i,E/Ns,O/Ns,B)}},xh=t=>[],{M:Sh,m:kh,L:Ch,l:Eh,H:Oh,h:Lh,V:Ph,v:Th,C:Bh,c:Rh,S:Ah,s:Mh,Q:Dh,q:Ih,T:Fh,t:Wh,A:zh,a:Nh,Z:jh,z:Vh,N:Hh,D:Uh,X:Yh,G:Xh,F:Gh,O:$h,P:Kh,U:qh}=Il,{rect:Zh,roundRect:Jh,arcTo:Qh,arc:tc,ellipse:ec,quadraticCurveTo:nc}=dh,{ellipticalArc:ic}=wh,rc=nl.get("PathConvert"),oc={},sc={current:{dot:0},stringify(t,e){let n,i,r,o=0,s=t.length,a="";for(;o<s;){i=t[o],n=Vl[i],a+=i===r?" ":jl[i];for(let i=1;i<n;i++)a+=Ws.float(t[o+i],e),i===n-1||(a+=" ");r=i,o+=n}return a},parse(t,e){let n,i,r,o="";const s=[],a=e?zl:Wl;for(let l=0,h=t.length;l<h;l++)i=t[l],qa[i]?("."===i&&(ac.dot&&(lc(s,o),o=""),ac.dot++),"0"===o&&"."!==i&&(lc(s,o),o=""),o+=i):Il[i]?(o&&(lc(s,o),o=""),ac.name=Il[i],ac.length=Fl[i],ac.index=0,lc(s,ac.name),!n&&a[i]&&(n=!0)):"-"===i||"+"===i?"e"===r||"E"===r?o+=i:(o&&lc(s,o),o=i):o&&(lc(s,o),o=""),r=i;return o&&lc(s,o),n?sc.toCanvasData(s,e):s},toCanvasData(t,e){let n,i,r,o,s,a=0,l=0,h=0,c=0,u=0,d=t.length;const p=[];for(;u<d;){switch(r=t[u],r){case kh:t[u+1]+=a,t[u+2]+=l;case Sh:a=t[u+1],l=t[u+2],p.push(Sh,a,l),u+=3;break;case Lh:t[u+1]+=a;case Oh:a=t[u+1],p.push(Ch,a,l),u+=2;break;case Th:t[u+1]+=l;case Ph:l=t[u+1],p.push(Ch,a,l),u+=2;break;case Eh:t[u+1]+=a,t[u+2]+=l;case Ch:a=t[u+1],l=t[u+2],p.push(Ch,a,l),u+=3;break;case Mh:t[u+1]+=a,t[u+2]+=l,t[u+3]+=a,t[u+4]+=l,r=Ah;case Ah:s=o===Bh||o===Ah,h=s?2*a-n:t[u+1],c=s?2*l-i:t[u+2],n=t[u+1],i=t[u+2],a=t[u+3],l=t[u+4],p.push(Bh,h,c,n,i,a,l),u+=5;break;case Rh:t[u+1]+=a,t[u+2]+=l,t[u+3]+=a,t[u+4]+=l,t[u+5]+=a,t[u+6]+=l,r=Bh;case Bh:n=t[u+3],i=t[u+4],a=t[u+5],l=t[u+6],p.push(Bh,t[u+1],t[u+2],n,i,a,l),u+=7;break;case Wh:t[u+1]+=a,t[u+2]+=l,r=Fh;case Fh:s=o===Dh||o===Fh,n=s?2*a-n:t[u+1],i=s?2*l-i:t[u+2],e?nc(p,a,l,n,i,t[u+1],t[u+2]):p.push(Dh,n,i,t[u+1],t[u+2]),a=t[u+1],l=t[u+2],u+=3;break;case Ih:t[u+1]+=a,t[u+2]+=l,t[u+3]+=a,t[u+4]+=l,r=Dh;case Dh:n=t[u+1],i=t[u+2],e?nc(p,a,l,n,i,t[u+3],t[u+4]):p.push(Dh,n,i,t[u+3],t[u+4]),a=t[u+3],l=t[u+4],u+=5;break;case Nh:t[u+6]+=a,t[u+7]+=l;case zh:ic(p,a,l,t[u+1],t[u+2],t[u+3],t[u+4],t[u+5],t[u+6],t[u+7],e),a=t[u+6],l=t[u+7],u+=8;break;case Vh:case jh:p.push(jh),u++;break;case Hh:a=t[u+1],l=t[u+2],e?Zh(p,a,l,t[u+3],t[u+4]):hc(p,t,u,5),u+=5;break;case Uh:a=t[u+1],l=t[u+2],e?Jh(p,a,l,t[u+3],t[u+4],[t[u+5],t[u+6],t[u+7],t[u+8]]):hc(p,t,u,9),u+=9;break;case Yh:a=t[u+1],l=t[u+2],e?Jh(p,a,l,t[u+3],t[u+4],t[u+5]):hc(p,t,u,6),u+=6;break;case Xh:ec(e?p:hc(p,t,u,9),t[u+1],t[u+2],t[u+3],t[u+4],t[u+5],t[u+6],t[u+7],t[u+8],null,oc),a=oc.x,l=oc.y,u+=9;break;case Gh:e?ec(p,t[u+1],t[u+2],t[u+3],t[u+4],0,0,360,!1):hc(p,t,u,5),a=t[u+1]+t[u+3],l=t[u+2],u+=5;break;case $h:tc(e?p:hc(p,t,u,7),t[u+1],t[u+2],t[u+3],t[u+4],t[u+5],t[u+6],null,oc),a=oc.x,l=oc.y,u+=7;break;case Kh:e?tc(p,t[u+1],t[u+2],t[u+3],0,360,!1):hc(p,t,u,4),a=t[u+1]+t[u+3],l=t[u+2],u+=4;break;case qh:Qh(e?p:hc(p,t,u,6),a,l,t[u+1],t[u+2],t[u+3],t[u+4],t[u+5],null,oc),a=oc.x,l=oc.y,u+=6;break;default:return rc.error(`command: ${r} [index:${u}]`,t),p}o=r}return p},objectToCanvasData(t){if(t[0].name.length>1)return xh(t);{const e=[];return t.forEach(t=>{switch(t.name){case"M":e.push(Sh,t.x,t.y);break;case"L":e.push(Ch,t.x,t.y);break;case"C":e.push(Bh,t.x1,t.y1,t.x2,t.y2,t.x,t.y);break;case"Q":e.push(Dh,t.x1,t.y1,t.x,t.y);break;case"Z":e.push(jh)}}),e}},copyData(t,e,n,i){for(let r=n,o=n+i;r<o;r++)t.push(e[r])},pushData(t,e){ac.index===ac.length&&(ac.index=1,t.push(ac.name)),t.push(Number(e)),ac.index++,ac.dot=0}},{current:ac,pushData:lc,copyData:hc}=sc,{M:cc,L:uc,C:dc,Q:pc,Z:fc,N:gc,D:vc,X:_c,G:mc,F:yc,O:bc,P:wc,U:xc}=Il,{getMinDistanceFrom:Sc,getRadianFrom:kc}=ua,{tan:Cc,min:Ec,abs:Oc}=Math,Lc={},Pc={beginPath(t){t.length=0},moveTo(t,e,n){t.push(cc,e,n)},lineTo(t,e,n){t.push(uc,e,n)},bezierCurveTo(t,e,n,i,r,o,s){t.push(dc,e,n,i,r,o,s)},quadraticCurveTo(t,e,n,i,r){t.push(pc,e,n,i,r)},closePath(t){t.push(fc)},rect(t,e,n,i,r){t.push(gc,e,n,i,r)},roundRect(t,e,n,i,r,o){if(fs(o))t.push(_c,e,n,i,r,o);else{const s=Ws.fourNumber(o);s?t.push(vc,e,n,i,r,...s):t.push(gc,e,n,i,r)}},ellipse(t,e,n,i,r,o,s,a,l){if(i===r)return Bc(t,e,n,i,s,a,l);us(o)?t.push(yc,e,n,i,r):(us(s)&&(s=0),us(a)&&(a=360),t.push(mc,e,n,i,r,o,s,a,l?1:0))},arc(t,e,n,i,r,o,s){us(r)?t.push(wc,e,n,i):(us(r)&&(r=0),us(o)&&(o=360),t.push(bc,e,n,i,r,o,s?1:0))},arcTo(t,e,n,i,r,o,s,a,l){if(!cs(s)){const t=Sc(s,a,e,n,i,r)/(l?1:2);o=Ec(o,Ec(t,t*Oc(Cc(kc(s,a,e,n,i,r)/2))))}t.push(xc,e,n,i,r,o)},drawEllipse(t,e,n,i,r,o,s,a,l){dh.ellipse(null,e,n,i,r,us(o)?0:o,us(s)?0:s,us(a)?360:a,l,null,null,Lc),t.push(cc,Lc.x,Lc.y),Tc(t,e,n,i,r,o,s,a,l)},drawArc(t,e,n,i,r,o,s){dh.arc(null,e,n,i,us(r)?0:r,us(o)?360:o,s,null,null,Lc),t.push(cc,Lc.x,Lc.y),Bc(t,e,n,i,r,o,s)},drawPoints(t,e,n,i){dh.points(t,e,n,i)}},{ellipse:Tc,arc:Bc}=Pc,{moveTo:Rc,lineTo:Ac,quadraticCurveTo:Mc,bezierCurveTo:Dc,closePath:Ic,beginPath:Fc,rect:Wc,roundRect:zc,ellipse:Nc,arc:jc,arcTo:Vc,drawEllipse:Hc,drawArc:Uc,drawPoints:Yc}=Pc,Xc=class{set path(t){this.__path=t}get path(){return this.__path}constructor(t){this.set(t)}set(t){return this.__path=t?ds(t)?Ml.parse(t):t:[],this}beginPath(){return Fc(this.__path),this.paint(),this}moveTo(t,e){return Rc(this.__path,t,e),this.paint(),this}lineTo(t,e){return Ac(this.__path,t,e),this.paint(),this}bezierCurveTo(t,e,n,i,r,o){return Dc(this.__path,t,e,n,i,r,o),this.paint(),this}quadraticCurveTo(t,e,n,i){return Mc(this.__path,t,e,n,i),this.paint(),this}closePath(){return Ic(this.__path),this.paint(),this}rect(t,e,n,i){return Wc(this.__path,t,e,n,i),this.paint(),this}roundRect(t,e,n,i,r){return zc(this.__path,t,e,n,i,r),this.paint(),this}ellipse(t,e,n,i,r,o,s,a){return Nc(this.__path,t,e,n,i,r,o,s,a),this.paint(),this}arc(t,e,n,i,r,o){return jc(this.__path,t,e,n,i,r,o),this.paint(),this}arcTo(t,e,n,i,r){return Vc(this.__path,t,e,n,i,r),this.paint(),this}drawEllipse(t,e,n,i,r,o,s,a){return Hc(this.__path,t,e,n,i,r,o,s,a),this.paint(),this}drawArc(t,e,n,i,r,o){return Uc(this.__path,t,e,n,i,r,o),this.paint(),this}drawPoints(t,e,n){return Yc(this.__path,t,e,n),this.paint(),this}clearPath(){return this.beginPath()}paint(){}},{M:Gc,L:$c,C:Kc,Q:qc,Z:Zc,N:Jc,D:Qc,X:tu,G:eu,F:nu,O:iu,P:ru,U:ou}=Il,su=nl.get("PathDrawer"),au={drawPathByData(t,e){if(!e)return;let n,i=0,r=e.length;for(;i<r;)switch(n=e[i],n){case Gc:t.moveTo(e[i+1],e[i+2]),i+=3;break;case $c:t.lineTo(e[i+1],e[i+2]),i+=3;break;case Kc:t.bezierCurveTo(e[i+1],e[i+2],e[i+3],e[i+4],e[i+5],e[i+6]),i+=7;break;case qc:t.quadraticCurveTo(e[i+1],e[i+2],e[i+3],e[i+4]),i+=5;break;case Zc:t.closePath(),i+=1;break;case Jc:t.rect(e[i+1],e[i+2],e[i+3],e[i+4]),i+=5;break;case Qc:t.roundRect(e[i+1],e[i+2],e[i+3],e[i+4],[e[i+5],e[i+6],e[i+7],e[i+8]]),i+=9;break;case tu:t.roundRect(e[i+1],e[i+2],e[i+3],e[i+4],e[i+5]),i+=6;break;case eu:t.ellipse(e[i+1],e[i+2],e[i+3],e[i+4],e[i+5]*Ns,e[i+6]*Ns,e[i+7]*Ns,e[i+8]),i+=9;break;case nu:t.ellipse(e[i+1],e[i+2],e[i+3],e[i+4],0,0,js,!1),i+=5;break;case iu:t.arc(e[i+1],e[i+2],e[i+3],e[i+4]*Ns,e[i+5]*Ns,e[i+6]),i+=7;break;case ru:t.arc(e[i+1],e[i+2],e[i+3],0,js,!1),i+=4;break;case ou:t.arcTo(e[i+1],e[i+2],e[i+3],e[i+4],e[i+5]),i+=6;break;default:return void su.error(`command: ${n} [index:${i}]`,e)}}},{M:lu,L:hu,C:cu,Q:uu,Z:du,N:pu,D:fu,X:gu,G:vu,F:_u,O:mu,P:yu,U:bu}=Il,{toTwoPointBounds:wu,toTwoPointBoundsByQuadraticCurve:xu,arcTo:Su,arc:ku,ellipse:Cu}=dh,{addPointBounds:Eu,copy:Ou,addPoint:Lu,setPoint:Pu,addBounds:Tu,toBounds:Bu}=ya,Ru=nl.get("PathBounds"),Au={},Mu={},Du={},Iu={toBounds(t,e){Iu.toTwoPointBounds(t,Mu),Bu(Mu,e)},toTwoPointBounds(t,e){if(!t||!t.length)return Pu(e,0,0);let n,i,r,o,s,a=0,l=0,h=0;const c=t.length;for(;a<c;)switch(s=t[a],0===a&&(s===du||s===cu||s===uu?Pu(e,l,h):Pu(e,t[a+1],t[a+2])),s){case lu:case hu:l=t[a+1],h=t[a+2],Lu(e,l,h),a+=3;break;case cu:r=t[a+5],o=t[a+6],wu(l,h,t[a+1],t[a+2],t[a+3],t[a+4],r,o,Au),Eu(e,Au),l=r,h=o,a+=7;break;case uu:n=t[a+1],i=t[a+2],r=t[a+3],o=t[a+4],xu(l,h,n,i,r,o,Au),Eu(e,Au),l=r,h=o,a+=5;break;case du:a+=1;break;case pu:l=t[a+1],h=t[a+2],Tu(e,l,h,t[a+3],t[a+4]),a+=5;break;case fu:case gu:l=t[a+1],h=t[a+2],Tu(e,l,h,t[a+3],t[a+4]),a+=s===fu?9:6;break;case vu:Cu(null,t[a+1],t[a+2],t[a+3],t[a+4],t[a+5],t[a+6],t[a+7],t[a+8],Au,Du),0===a?Ou(e,Au):Eu(e,Au),l=Du.x,h=Du.y,a+=9;break;case _u:l=t[a+1],h=t[a+2],Ul=t[a+3],Yl=t[a+4],Tu(e,l-Ul,h-Yl,2*Ul,2*Yl),l+=Ul,a+=5;break;case mu:ku(null,t[a+1],t[a+2],t[a+3],t[a+4],t[a+5],t[a+6],Au,Du),0===a?Ou(e,Au):Eu(e,Au),l=Du.x,h=Du.y,a+=7;break;case yu:l=t[a+1],h=t[a+2],Hl=t[a+3],Tu(e,l-Hl,h-Hl,2*Hl,2*Hl),l+=Hl,a+=4;break;case bu:Su(null,l,h,t[a+1],t[a+2],t[a+3],t[a+4],t[a+5],Au,Du),0===a?Ou(e,Au):Eu(e,Au),l=Du.x,h=Du.y,a+=6;break;default:return void Ru.error(`command: ${s} [index:${a}]`,t)}}},{M:Fu,L:Wu,Z:zu}=Il,{getCenterX:Nu,getCenterY:ju}=ua,{arcTo:Vu}=Pc,Hu={smooth(t,e,n){let i,r,o,s=0,a=0,l=0,h=0,c=0,u=0,d=0,p=0,f=0;gs(e)&&(e=e[0]||0);const g=t.length,v=9===g,_=[];for(;s<g;){switch(i=t[s],i){case Fu:h=p=t[s+1],c=f=t[s+2],s+=3,t[s]===Wu?(u=t[s+1],d=t[s+2],v?_.push(Fu,h,c):_.push(Fu,Nu(h,u),ju(c,d))):_.push(Fu,h,c);break;case Wu:switch(a=t[s+1],l=t[s+2],s+=3,t[s]){case Wu:Vu(_,a,l,t[s+1],t[s+2],e,p,f,v);break;case zu:Vu(_,a,l,h,c,e,p,f,v);break;default:_.push(Wu,a,l)}p=a,f=l;break;case zu:r!==zu&&(Vu(_,h,c,u,d,e,p,f,v),_.push(zu)),s+=1;break;default:o=Vl[i];for(let e=0;e<o;e++)_.push(t[s+e]);s+=o}r=i}return i!==zu&&(_[1]=h,_[2]=c),_}};function Uu(t){return new Xc(t)}var Yu=Uu();Ml.creator=Uu(),Ml.parse=sc.parse,Ml.convertToCanvasData=sc.toCanvasData;var{drawRoundRect:Xu}=Xl;function Gu(t){!function(t){t&&!t.roundRect&&(t.roundRect=function(t,e,n,i,r){Xu(this,t,e,n,i,r)})}(t)}var $u={alphaPixelTypes:["png","webp","svg"],upperCaseTypeMap:{},mimeType:(t,e="image")=>!t||t.startsWith(e)?t:("jpg"===t&&(t="jpeg"),e+"/"+t),fileType(t){const e=t.split(".");return e[e.length-1]},isOpaqueImage(t){const e=Ku.fileType(t);return["jpg","jpeg"].some(t=>t===e)},getExportOptions(t){switch(typeof t){case"object":return t;case"number":return{quality:t};case"boolean":return{blob:t};default:return{}}}},Ku=$u;Ku.mineType=Ku.mimeType,Ku.alphaPixelTypes.forEach(t=>Ku.upperCaseTypeMap[t]=t.toUpperCase());var qu=nl.get("TaskProcessor"),Zu=class{constructor(t){this.parallel=!0,this.time=1,this.id=Ss.create(Ss.TASK),this.task=t}run(){return yl(this,void 0,void 0,function*(){try{if(this.isComplete||this.runing)return;if(this.runing=!0,this.canUse&&!this.canUse())return this.cancel();this.task&&(yield this.task())}catch(CS){qu.error(CS)}})}complete(){this.isComplete=!0,this.parent=this.task=this.canUse=null}cancel(){this.isCancel=!0,this.complete()}},Ju=class{get total(){return this.list.length+this.delayNumber}get finishedIndex(){return this.isComplete?0:this.index+this.parallelSuccessNumber}get remain(){return this.isComplete?this.total:this.total-this.finishedIndex}get percent(){const{total:t}=this;let e=0,n=0;for(let i=0;i<t;i++)i<=this.finishedIndex?(n+=this.list[i].time,i===this.finishedIndex&&(e=n)):e+=this.list[i].time;return this.isComplete?1:n/e}constructor(t){this.config={parallel:6},this.list=[],this.running=!1,this.isComplete=!0,this.index=0,this.delayNumber=0,t&&bs.assign(this.config,t),this.empty()}add(t,e,n){let i,r,o,s;const a=new Zu(t);return a.parent=this,fs(e)?s=e:e&&(r=e.parallel,i=e.start,o=e.time,s=e.delay,n||(n=e.canUse)),o&&(a.time=o),!1===r&&(a.parallel=!1),n&&(a.canUse=n),cs(s)?this.push(a,i):(this.delayNumber++,setTimeout(()=>{this.delayNumber&&(this.delayNumber--,this.push(a,i))},s)),this.isComplete=!1,a}push(t,e){this.list.push(t),!1===e||this.timer||(this.timer=setTimeout(()=>this.start()))}empty(){this.index=0,this.parallelSuccessNumber=0,this.list=[],this.parallelList=[],this.delayNumber=0}start(){this.running||(this.running=!0,this.isComplete=!1,this.run())}pause(){clearTimeout(this.timer),this.timer=null,this.running=!1}resume(){this.start()}skip(){this.index++,this.resume()}stop(){this.isComplete=!0,this.list.forEach(t=>{t.isComplete||t.run()}),this.pause(),this.empty()}run(){this.running&&(this.setParallelList(),this.parallelList.length>1?this.runParallelTasks():this.remain?this.runTask():this.onComplete())}runTask(){const t=this.list[this.index];t?t.run().then(()=>{this.onTask(t),this.index++,t.isCancel?this.runTask():this.nextTask()}).catch(t=>{this.onError(t)}):this.timer=setTimeout(()=>this.nextTask())}runParallelTasks(){this.parallelList.forEach(t=>this.runParallelTask(t))}runParallelTask(t){t.run().then(()=>{this.onTask(t),this.fillParallelTask()}).catch(t=>{this.onParallelError(t)})}nextTask(){this.total===this.finishedIndex?this.onComplete():this.timer=setTimeout(()=>this.run())}setParallelList(){let t;const{config:e,list:n,index:i}=this;this.parallelList=[],this.parallelSuccessNumber=0;let r=i+e.parallel;if(r>n.length&&(r=n.length),e.parallel>1)for(let o=i;o<r&&(t=n[o],t.parallel);o++)this.parallelList.push(t)}fillParallelTask(){let t;const e=this.parallelList;this.parallelSuccessNumber++,e.pop();const n=e.length,i=this.finishedIndex+n;if(e.length){if(!this.running)return;i<this.total&&(t=this.list[i],t&&t.parallel&&(e.push(t),this.runParallelTask(t)))}else this.index+=this.parallelSuccessNumber,this.parallelSuccessNumber=0,this.nextTask()}onComplete(){this.stop(),this.config.onComplete&&this.config.onComplete()}onTask(t){t.complete(),this.config.onTask&&this.config.onTask()}onParallelError(t){this.parallelList.forEach(t=>{t.parallel=!1}),this.parallelList.length=0,this.parallelSuccessNumber=0,this.onError(t)}onError(t){this.pause(),this.config.onError&&this.config.onError(t)}destroy(){this.stop()}},Qu=nl.get("Resource"),td={tasker:new Ju,queue:new Ju({parallel:1}),map:{},get isComplete(){return ed.tasker.isComplete},set(t,e){ed.map[t]&&Qu.repeat(t),ed.map[t]=e},get:t=>ed.map[t],remove(t){const e=ed.map[t];e&&(e.destroy&&e.destroy(),delete ed.map[t])},loadImage(t,e){return new Promise((n,i)=>{const r=this.setImage(t,t,e);r.load(()=>n(r),t=>i(t))})},setImage(t,e,n){let i;return ds(e)?i={url:e}:e.url||(i={url:t,view:e}),i&&(n&&(i.format=n),e=cl.image(i)),ed.set(t,e),e},loadFilm(t,e){},loadVideo(t,e){},destroy(){ed.map={}}},ed=td,nd={maxRecycled:10,recycledList:[],patternTasker:td.queue,get(t,e){let n=td.get(t.url);return n||td.set(t.url,n="film"===e?cl.film(t):cl.image(t)),n.use++,n},recycle(t){t.parent&&(t=t.parent),t.use--,setTimeout(()=>{t.use||(Qa.image.isLarge(t)?t.url&&td.remove(t.url):(t.clearLevels(),id.recycledList.push(t)))})},recyclePaint(t){id.recycle(t.image)},clearRecycled(t){const e=id.recycledList;(e.length>id.maxRecycled||t)&&(e.forEach(e=>(!e.use||t)&&e.url&&td.remove(e.url)),e.length=0)},clearLevels(){},hasAlphaPixel:t=>$u.alphaPixelTypes.some(e=>id.isFormat(e,t)),isFormat(t,e){if(e.format)return e.format===t;const{url:n}=e;if(n.startsWith("data:")){if(n.startsWith("data:"+$u.mimeType(t)))return!0}else{if(n.includes("."+t)||n.includes("."+$u.upperCaseTypeMap[t]))return!0;if("png"===t&&!n.includes("."))return!0}return!1},destroy(){this.clearRecycled(!0)}},id=nd,{IMAGE:rd,create:od}=Ss,sd=class{get tag(){return"Image"}get url(){return this.config.url}get crossOrigin(){const{crossOrigin:t}=this.config;return cs(t)?Qa.image.crossOrigin:t}get completed(){return this.ready||!!this.error}constructor(t){if(this.use=0,this.waitComplete=[],this.innerId=od(rd),this.config=t||(t={url:""}),t.view){const{view:e}=t;this.setView(e.config?e.view:e)}nd.isFormat("svg",t)&&(this.isSVG=!0),nd.hasAlphaPixel(t)&&(this.hasAlphaPixel=!0)}load(t,e,n){return this.loading||(this.loading=!0,td.tasker.add(()=>yl(this,void 0,void 0,function*(){return yield Qa.origin["load"+this.tag](this.getLoadUrl(n),this.crossOrigin,this).then(t=>{n&&this.setThumbView(t),this.setView(t)}).catch(t=>{this.error=t,this.onComplete(!1)})}))),this.waitComplete.push(t,e),this.waitComplete.length-2}unload(t,e){const n=this.waitComplete;if(e){const e=n[t+1];e&&e({type:"stop"})}n[t]=n[t+1]=void 0}setView(t){this.ready=!0,this.width||(this.width=t.width,this.height=t.height,this.view=t),this.onComplete(!0)}onComplete(t){let e;this.waitComplete.forEach((n,i)=>{e=i%2,n&&(t?e||n(this):e&&n(this.error))}),this.waitComplete.length=0,this.loading=!1}getFull(t){return this.view}getCanvas(t,e,n,i,r,o,s,a){if(t||(t=this.width),e||(e=this.height),this.cache){let{params:t,data:e}=this.cache;for(let n in t)if(t[n]!==arguments[n]){e=null;break}if(e)return e}const l=Qa.image.resize(this.view,t,e,r,o,void 0,s,n,i,a);return this.cache=this.use>1?{data:l,params:arguments}:null,l}getPattern(t,e,n,i){const r=Qa.canvas.createPattern(t,e);return Qa.image.setPatternTransform(r,n,i),r}render(t,e,n,i,r,o,s,a,l){t.drawImage(this.view,e,n,i,r)}getLoadUrl(t){return this.url}setThumbView(t){}getThumbSize(t){}getMinLevel(){}getLevelData(t,e,n){}clearLevels(t){}destroyFilter(){}destroy(){this.clearLevels(),this.destroyFilter();const{view:t}=this;t&&t.close&&t.close(),this.config={url:""},this.cache=this.view=null,this.waitComplete.length=0}};function ad(t,e,n,i){i||(n.configurable=n.enumerable=!0),Object.defineProperty(t,e,n)}function ld(t,e){return Object.getOwnPropertyDescriptor(t,e)}function hd(t,e){return(n,i)=>function(t,e,n,i){ad(t,e,Object.assign({get(){return this.__getAttr(e)},set(t){this.__setAttr(e,t)}},i||{})),Ld(t,e,n)}(n,i,t,e&&e(i))}function cd(t){return hd(t)}function ud(t,e){return hd(t,t=>({set(n){this.__setAttr(t,n,e)&&(this.__layout.matrixChanged||this.__layout.matrixChange())}}))}function dd(t,e){return hd(t,t=>({set(n){this.__setAttr(t,n,e)&&(this.__layout.matrixChanged||this.__layout.matrixChange(),this.__scrollWorld||(this.__scrollWorld={}))}}))}function pd(t){return hd(t,t=>({set(e){this.__setAttr(t,e)&&(this.__hasAutoLayout=!!(this.origin||this.around||this.flow),this.__local||this.__layout.createLocal(),_d(this))}}))}function fd(t,e){return hd(t,t=>({set(n){this.__setAttr(t,n,e)&&(this.__layout.scaleChanged||this.__layout.scaleChange())}}))}function gd(t,e){return hd(t,t=>({set(n){this.__setAttr(t,n,e)&&(this.__layout.rotationChanged||this.__layout.rotationChange())}}))}function vd(t,e){return hd(t,t=>({set(n){this.__setAttr(t,n,e)&&_d(this)}}))}function _d(t){t.__layout.boxChanged||t.__layout.boxChange(),t.__hasAutoLayout&&(t.__layout.matrixChanged||t.__layout.matrixChange())}var md=vd;function yd(t,e){return hd(t,t=>({set(n){this.__setAttr(t,n)&&(function(t){t.__layout.strokeChanged||t.__layout.strokeChange(),t.__.__useArrow&&_d(t)}(this),e&&(this.__.__useStroke=!0))}}))}var bd=yd;function wd(t){return hd(t,t=>({set(e){this.__setAttr(t,e),this.__layout.renderChanged||this.__layout.renderChange()}}))}function xd(t){return hd(t,t=>({set(e){this.__setAttr(t,e)&&(this.__layout.surfaceChanged||this.__layout.surfaceChange())}}))}function Sd(t){return hd(t,t=>({set(e){if(this.__setAttr(t,e)){const t=this.__;bs.stintSet(t,"__useDim",t.dim||t.bright||t.dimskip)}}}))}function kd(t){const{parent:e}=t;if(e){const{__hasMask:t}=e;e.__updateMask(),t!==e.__hasMask&&e.forceUpdate()}}function Cd(t,e,n,i){t.__setAttr(e,n)&&(t.__layout.opacityChanged||t.__layout.opacityChange(),0!==i&&0!==n||_d(t))}function Ed(t){return hd(t,t=>({set(e){this.__setAttr(t,e)&&(this.__layout.hitCanvasChanged=!0,this.leafer&&this.leafer.updateCursor())}}))}function Od(t){return(e,n)=>{ad(e,"__DataProcessor",{get:()=>t})}}function Ld(t,e,n){const i=t.__DataProcessor.prototype,r="_"+e,o=function(t){return"set"+t.charAt(0).toUpperCase()+t.slice(1)}(e),s=function(t,e){const n="_"+t;return{get(){const t=this[n];return null==t?e:t},set(t){this[n]=t}}}(e,n);if(cs(n))s.get=function(){return this[r]};else if("function"==typeof n)s.get=function(){const t=this[r];return null==t?n(this.__leaf):t};else if(vs(n)){const t=function(t){return"{}"===JSON.stringify(t)}(n);s.get=function(){const e=this[r];return null==e?this[r]=t?{}:bs.clone(n):e}}const a=t.isBranchLeaf;"width"===e?s.get=function(){const t=this[r];if(null==t){const t=this,e=t.__naturalWidth,i=t.__leaf;return!n||i.pathInputed?i.boxBounds.width:e?t._height&&t.__useNaturalRatio?t._height*e/t.__naturalHeight:e:a&&i.children.length?i.boxBounds.width:n}return t}:"height"===e&&(s.get=function(){const t=this[r];if(null==t){const t=this,e=t.__naturalHeight,i=t.__leaf;return!n||i.pathInputed?i.boxBounds.height:e?t._width&&t.__useNaturalRatio?t._width*e/t.__naturalWidth:e:a&&i.children.length?i.boxBounds.height:n}return t});let l,h=i;for(;!l&&h;)l=ld(h,e),h=h.__proto__;l&&l.set&&(s.set=l.set),i[o]&&(s.set=i[o],delete i[o]),ad(i,e,s)}var Pd=new nl("rewrite"),Td=[],Bd=["destroy","constructor"];function Rd(t){return(e,n)=>{Td.push({name:e.constructor.name+"."+n,run:()=>{e[n]=t}})}}function Ad(){return t=>{Md()}}function Md(t){Td.length&&(Td.forEach(e=>{t&&Pd.error(e.name,"需在Class上装饰@rewriteAble()"),e.run()}),Td.length=0)}function Dd(t,e){return n=>{var i;(t.prototype?(i=t.prototype,Object.getOwnPropertyNames(i)):Object.keys(t)).forEach(i=>{Bd.includes(i)||e&&e.includes(i)||(t.prototype?ld(t.prototype,i).writable&&(n.prototype[i]=t.prototype[i]):n.prototype[i]=t[i])})}}function Id(){return t=>{dl.register(t)}}function Fd(){return t=>{gl.register(t)}}setTimeout(()=>Md(!0));var{copy:Wd,toInnerPoint:zd,toOuterPoint:Nd,scaleOfOuter:jd,rotateOfOuter:Vd,skewOfOuter:Hd,multiplyParent:Ud,divideParent:Yd,getLayout:Xd}=Qs,Gd={},{round:$d}=Math,Kd={updateAllMatrix(t,e,n){if(e&&t.__hasAutoLayout&&t.__layout.matrixChanged&&(n=!0),Jd(t,e,n),t.isBranch){const{children:i}=t;for(let t=0,r=i.length;t<r;t++)Zd(i[t],e,n)}},updateMatrix(t,e,n){const i=t.__layout;e?n&&(i.waitAutoLayout=!0,t.__hasAutoLayout&&(i.matrixChanged=!1)):i.waitAutoLayout&&(i.waitAutoLayout=!1),i.matrixChanged&&t.__updateLocalMatrix(),i.waitAutoLayout||t.__updateWorldMatrix()},updateBounds(t){const e=t.__layout;e.boundsChanged&&t.__updateLocalBounds(),e.waitAutoLayout||t.__updateWorldBounds()},updateAllWorldOpacity(t){if(t.__updateWorldOpacity(),t.isBranch){const{children:e}=t;for(let t=0,n=e.length;t<n;t++)Qd(e[t])}},updateChange(t){const e=t.__layout;e.stateStyleChanged&&t.updateState(),e.opacityChanged&&Qd(t),t.__updateChange(),e.surfaceChanged&&(t.__hasComplex&&qd.updateComplex(t),e.surfaceChanged=!1)},updateAllChange(t){if(ep(t),t.isBranch){const{children:e}=t;for(let t=0,n=e.length;t<n;t++)tp(e[t])}},worldHittable(t){for(;t;){if(!t.__.hittable)return!1;t=t.parent}return!0},draggable:t=>(t.draggable||t.editable)&&t.hitSelf&&!t.locked,copyCanvasByWorld(t,e,n,i,r,o){i||(i=t.__nowWorld),t.__worldFlipped||Qa.fullImageShadow?e.copyWorldByReset(n,i,t.__nowWorld,r,o):e.copyWorldToInner(n,i,t.__layout.renderBounds,r)},renderComplex(t,e,n){},updateComplex(t){},checkComplex(t){},moveWorld(t,e,n=0,i,r){const o=vs(e)?Object.assign({},e):{x:e,y:n};i?Nd(t.localTransform,o,o,!0):t.parent&&zd(t.parent.scrollWorldTransform,o,o,!0),qd.moveLocal(t,o.x,o.y,r)},moveLocal(t,e,n=0,i){vs(e)&&(n=e.y,e=e.x),e+=t.x,n+=t.y,t.leafer&&t.leafer.config.pointSnap&&(e=$d(e),n=$d(n)),i?t.animate({x:e,y:n},i):(t.x=e,t.y=n)},zoomOfWorld(t,e,n,i,r,o){qd.zoomOfLocal(t,np(t,e),n,i,r,o)},zoomOfLocal(t,e,n,i=n,r,o){const s=t.__localMatrix;if(fs(i)||(i&&(o=i),i=n),Wd(Gd,s),jd(Gd,e,n,i),qd.hasHighPosition(t))qd.setTransform(t,Gd,r,o);else{const e=t.x+Gd.e-s.e,a=t.y+Gd.f-s.f;o&&!r?t.animate({x:e,y:a,scaleX:t.scaleX*n,scaleY:t.scaleY*i},o):(t.x=e,t.y=a,t.scaleResize(n,i,!0!==r))}},rotateOfWorld(t,e,n,i){qd.rotateOfLocal(t,np(t,e),n,i)},rotateOfLocal(t,e,n,i){const r=t.__localMatrix;Wd(Gd,r),Vd(Gd,e,n),qd.hasHighPosition(t)?qd.setTransform(t,Gd,!1,i):t.set({x:t.x+Gd.e-r.e,y:t.y+Gd.f-r.f,rotation:Ws.formatRotation(t.rotation+n)},i)},skewOfWorld(t,e,n,i,r,o){qd.skewOfLocal(t,np(t,e),n,i,r,o)},skewOfLocal(t,e,n,i=0,r,o){Wd(Gd,t.__localMatrix),Hd(Gd,e,n,i),qd.setTransform(t,Gd,r,o)},transformWorld(t,e,n,i){Wd(Gd,t.worldTransform),Ud(Gd,e),t.parent&&Yd(Gd,t.parent.scrollWorldTransform),qd.setTransform(t,Gd,n,i)},transform(t,e,n,i){Wd(Gd,t.localTransform),Ud(Gd,e),qd.setTransform(t,Gd,n,i)},setTransform(t,e,n,i){const r=t.__,o=r.origin&&qd.getInnerOrigin(t,r.origin),s=Xd(e,o,r.around&&qd.getInnerOrigin(t,r.around));if(qd.hasOffset(t)&&(s.x-=r.offsetX,s.y-=r.offsetY),n){const e=s.scaleX/t.scaleX,n=s.scaleY/t.scaleY;if(delete s.scaleX,delete s.scaleY,o){Va.scale(t.boxBounds,Math.abs(e),Math.abs(n));const i=qd.getInnerOrigin(t,r.origin);ua.move(s,o.x-i.x,o.y-i.y)}t.set(s),t.scaleResize(e,n,!1)}else t.set(s,i)},getFlipTransform(t,e){const n={a:1,b:0,c:0,d:1,e:0,f:0},i="x"===e?1:-1;return jd(n,qd.getLocalOrigin(t,"center"),-1*i,1*i),n},getLocalOrigin:(t,e)=>ua.tempToOuterOf(qd.getInnerOrigin(t,e),t.localTransform),getInnerOrigin(t,e){const n={};return xa.toPoint(e,t.boxBounds,n),n},getRelativeWorld:(t,e,n)=>(Wd(Gd,t.worldTransform),Yd(Gd,e.scrollWorldTransform),n?Gd:Object.assign({},Gd)),updateScaleFixedWorld(t){},updateOuterBounds(t){},cacheId(t){},drop(t,e,n,i){t.setTransform(qd.getRelativeWorld(t,e,!0),i),e.add(t,n)},hasHighPosition:t=>t.origin||t.around||qd.hasOffset(t),hasOffset:t=>t.offsetX||t.offsetY,hasParent(t,e){if(!e)return!1;for(;t;){if(e===t)return!0;t=t.parent}},animateMove(t,e,n=.3){if(e.x||e.y)if(Math.abs(e.x)<1&&Math.abs(e.y)<1)t.move(e);else{const i=e.x*n,r=e.y*n;e.x-=i,e.y-=r,t.move(i,r),Qa.requestRender(()=>qd.animateMove(t,e,n))}}},qd=Kd,{updateAllMatrix:Zd,updateMatrix:Jd,updateAllWorldOpacity:Qd,updateAllChange:tp,updateChange:ep}=qd;function np(t,e){return t.updateLayout(),t.parent?ua.tempToInnerOf(e,t.parent.scrollWorldTransform):e}var ip,rp={worldBounds:t=>t.__world,localBoxBounds:t=>t.__.eraser||0===t.__.visible?null:t.__local||t.__layout,localStrokeBounds:t=>t.__.eraser||0===t.__.visible?null:t.__layout.localStrokeBounds,localRenderBounds(t){const{__:e,__layout:n}=t;return e.eraser||0===e.visible?null:n.localOuterBounds||n.localRenderBounds},maskLocalBoxBounds:(t,e)=>op(t,e)&&t.__localBoxBounds,maskLocalStrokeBounds:(t,e)=>op(t,e)&&t.__layout.localStrokeBounds,maskLocalRenderBounds(t,e){const{__layout:n}=t;return op(t,e)&&(n.localOuterBounds||n.localRenderBounds)},excludeRenderBounds:(t,e)=>!(!e.bounds||e.bounds.hit(t.__world,e.matrix))||!(!e.hideBounds||!e.hideBounds.includes(t.__world,e.matrix))};function op(t,e){return e||(ip=0),t.__.mask&&(ip=1),ip<0?null:(ip&&(ip=-1),!0)}var{updateBounds:sp}=Kd,ap={sort:(t,e)=>t.__.zIndex===e.__.zIndex?t.__tempNumber-e.__tempNumber:t.__.zIndex-e.__.zIndex,pushAllChildBranch(t,e){if(t.__tempNumber=1,t.__.__childBranchNumber){const{children:n}=t;for(let i=0,r=n.length;i<r;i++)(t=n[i]).isBranch&&(t.__tempNumber=1,e.add(t),lp(t,e))}},pushAllParent(t,e){const{keys:n}=e;if(n)for(;t.parent&&cs(n[t.parent.innerId]);)e.add(t.parent),t=t.parent;else for(;t.parent;)e.add(t.parent),t=t.parent},pushAllBranchStack(t,e){let n=e.length;const{children:i}=t;for(let r=0,o=i.length;r<o;r++)i[r].isBranch&&e.push(i[r]);for(let r=n,o=e.length;r<o;r++)hp(e[r],e)},updateBounds(t,e){const n=[t];hp(t,n),cp(n,e)},updateBoundsByBranchStack(t,e){let n,i;for(let r=t.length-1;r>-1;r--){n=t[r],i=n.children;for(let t=0,e=i.length;t<e;t++)sp(i[t]);e&&e===n||sp(n)}},move(t,e,n){let i;const{children:r}=t;for(let o=0,s=r.length;o<s;o++)i=(t=r[o]).__world,i.e+=e,i.f+=n,i.x+=e,i.y+=n,t.isBranch&&up(t,e,n)},scale(t,e,n,i,r,o,s){let a;const{children:l}=t,h=i-1,c=r-1;for(let u=0,d=l.length;u<d;u++)a=(t=l[u]).__world,a.a*=i,a.d*=r,(a.b||a.c)&&(a.b*=i,a.c*=r),a.e===a.x&&a.f===a.y?(a.x=a.e+=(a.e-o)*h+e,a.y=a.f+=(a.f-s)*c+n):(a.e+=(a.e-o)*h+e,a.f+=(a.f-s)*c+n,a.x+=(a.x-o)*h+e,a.y+=(a.y-s)*c+n),a.width*=i,a.height*=r,a.scaleX*=i,a.scaleY*=r,t.isBranch&&dp(t,e,n,i,r,o,s)}},{pushAllChildBranch:lp,pushAllBranchStack:hp,updateBoundsByBranchStack:cp,move:up,scale:dp}=ap,pp={run(t){if(t&&t.length){const e=t.length;for(let n=0;n<e;n++)t[n]();t.length===e?t.length=0:t.splice(0,e)}}},{getRelativeWorld:fp,updateBounds:gp}=Kd,{toOuterOf:vp,getPoints:_p,copy:mp}=Va,yp="_localContentBounds",bp="_worldContentBounds",wp="_worldBoxBounds",xp="_worldStrokeBounds",Sp=class{get contentBounds(){return this._contentBounds||this.boxBounds}set contentBounds(t){this._contentBounds=t}get strokeBounds(){return this._strokeBounds||this.boxBounds}get renderBounds(){return this._renderBounds||this.boxBounds}set renderBounds(t){this._renderBounds=t}get localContentBounds(){return vp(this.contentBounds,this.leaf.__localMatrix,this[yp]||(this[yp]={})),this[yp]}get localStrokeBounds(){return this._localStrokeBounds||this}get localRenderBounds(){return this._localRenderBounds||this}get worldContentBounds(){return vp(this.contentBounds,this.leaf.__world,this[bp]||(this[bp]={})),this[bp]}get worldBoxBounds(){return vp(this.boxBounds,this.leaf.__world,this[wp]||(this[wp]={})),this[wp]}get worldStrokeBounds(){return vp(this.strokeBounds,this.leaf.__world,this[xp]||(this[xp]={})),this[xp]}get a(){return 1}get b(){return 0}get c(){return 0}get d(){return 1}get e(){return this.leaf.__.x}get f(){return this.leaf.__.y}get x(){return this.e+this.boxBounds.x}get y(){return this.f+this.boxBounds.y}get width(){return this.boxBounds.width}get height(){return this.boxBounds.height}constructor(t){this.leaf=t,this.leaf.__local&&(this._localRenderBounds=this._localStrokeBounds=this.leaf.__local),t.__world&&(this.boxBounds={x:0,y:0,width:0,height:0},this.boxChange(),this.matrixChange())}createLocal(){const t=this.leaf.__local={a:1,b:0,c:0,d:1,e:0,f:0,x:0,y:0,width:0,height:0};this._localStrokeBounds||(this._localStrokeBounds=t),this._localRenderBounds||(this._localRenderBounds=t)}update(){const{leaf:t}=this,{leafer:e}=t;if(t.isApp)return gp(t);if(e)e.ready?e.watcher.changed&&e.layouter.layout():e.start();else{let e=t;for(;e.parent&&!e.parent.leafer;)e=e.parent;const n=e;if(n.__fullLayouting)return;n.__fullLayouting=!0,Qa.layout(n),delete n.__fullLayouting}}getTransform(t="world"){this.update();const{leaf:e}=this;switch(t){case"world":return e.__world;case"local":return e.__localMatrix;case"inner":return Qs.defaultMatrix;case"page":t=e.zoomLayer;default:return fp(e,t)}}getBounds(t,e="world"){switch(this.update(),e){case"world":return this.getWorldBounds(t);case"local":return this.getLocalBounds(t);case"inner":return this.getInnerBounds(t);case"page":e=this.leaf.zoomLayer;default:return new Xa(this.getInnerBounds(t)).toOuterOf(this.getTransform(e))}}getInnerBounds(t="box"){switch(t){case"render":return this.renderBounds;case"content":if(this.contentBounds)return this.contentBounds;case"box":return this.boxBounds;case"stroke":return this.strokeBounds}}getLocalBounds(t="box"){switch(t){case"render":return this.localRenderBounds;case"stroke":return this.localStrokeBounds;case"content":if(this.contentBounds)return this.localContentBounds;case"box":return this.leaf.__localBoxBounds}}getWorldBounds(t="box"){switch(t){case"render":return this.leaf.__world;case"stroke":return this.worldStrokeBounds;case"content":if(this.contentBounds)return this.worldContentBounds;case"box":return this.worldBoxBounds}}getLayoutBounds(t,e="world",n){const{leaf:i}=this;let r,o,s,a=this.getInnerBounds(t);switch(e){case"world":r=i.getWorldPoint(a),o=i.__world;break;case"local":const{scaleX:t,scaleY:n,rotation:l,skewX:h,skewY:c}=i.__;s={scaleX:t,scaleY:n,rotation:l,skewX:h,skewY:c},r=i.getLocalPointByInner(a);break;case"inner":r=a,o=Qs.defaultMatrix;break;case"page":e=i.zoomLayer;default:r=i.getWorldPoint(a,e),o=fp(i,e,!0)}if(s||(s=Qs.getLayout(o)),mp(s,a),ua.copy(s,r),n){const{scaleX:t,scaleY:e}=s,n=Math.abs(t),i=Math.abs(e);1===n&&1===i||(s.scaleX/=n,s.scaleY/=i,s.width*=n,s.height*=i)}return s}getLayoutPoints(t,e="world"){const{leaf:n}=this,i=_p(this.getInnerBounds(t));let r;switch(e){case"world":r=null;break;case"local":r=n.parent;break;case"inner":break;case"page":e=n.zoomLayer;default:r=e}return cs(r)||i.forEach(t=>n.innerToWorld(t,null,!1,r)),i}shrinkContent(){const{x:t,y:e,width:n,height:i}=this.boxBounds;this._contentBounds={x:t,y:e,width:n,height:i}}spreadStroke(){const{x:t,y:e,width:n,height:i}=this.strokeBounds;this._strokeBounds={x:t,y:e,width:n,height:i},this._localStrokeBounds={x:t,y:e,width:n,height:i},this.renderSpread||this.spreadRenderCancel()}spreadRender(){const{x:t,y:e,width:n,height:i}=this.renderBounds;this._renderBounds={x:t,y:e,width:n,height:i},this._localRenderBounds={x:t,y:e,width:n,height:i}}shrinkContentCancel(){this._contentBounds=void 0}spreadStrokeCancel(){const t=this.renderBounds===this.strokeBounds;this._strokeBounds=this.boxBounds,this._localStrokeBounds=this.leaf.__localBoxBounds,t&&this.spreadRenderCancel()}spreadRenderCancel(){this._renderBounds=this._strokeBounds,this._localRenderBounds=this._localStrokeBounds}boxChange(){this.boxChanged=!0,this.localBoxChanged?this.boundsChanged||(this.boundsChanged=!0):this.localBoxChange(),this.hitCanvasChanged=!0}localBoxChange(){this.localBoxChanged=!0,this.boundsChanged=!0}strokeChange(){this.strokeChanged=!0,this.strokeSpread||(this.strokeSpread=1),this.boundsChanged=!0,this.hitCanvasChanged=!0}renderChange(){this.renderChanged=!0,this.renderSpread||(this.renderSpread=1),this.boundsChanged=!0}scaleChange(){this.scaleChanged=!0,this._scaleOrRotationChange()}rotationChange(){this.rotationChanged=!0,this.affectRotation=!0,this._scaleOrRotationChange()}_scaleOrRotationChange(){this.affectScaleOrRotation=!0,this.matrixChange(),this.leaf.__local||this.createLocal()}matrixChange(){this.matrixChanged=!0,this.localBoxChanged?this.boundsChanged||(this.boundsChanged=!0):this.localBoxChange()}surfaceChange(){this.surfaceChanged=!0}opacityChange(){this.opacityChanged=!0}childrenSortChange(){this.childrenSortChanged||(this.childrenSortChanged=this.affectChildrenSort=!0,this.leaf.forceUpdate("surface"))}destroy(){}},kp=class{constructor(t,e){this.bubbles=!1,this.type=t,e&&(this.target=e)}stopDefault(){this.isStopDefault=!0,this.origin&&Qa.event.stopDefault(this.origin)}stopNow(){this.isStopNow=!0,this.isStop=!0,this.origin&&Qa.event.stopNow(this.origin)}stop(){this.isStop=!0,this.origin&&Qa.event.stop(this.origin)}},Cp=class extends kp{constructor(t,e,n){super(t,e),this.parent=n,this.child=e}};Cp.ADD="child.add",Cp.REMOVE="child.remove",Cp.CREATED="created",Cp.MOUNTED="mounted",Cp.UNMOUNTED="unmounted",Cp.DESTROY="destroy";var Ep="property.scroll",Op=class extends kp{constructor(t,e,n,i,r){super(t,e),this.attrName=n,this.oldValue=i,this.newValue=r}};Op.CHANGE="property.change",Op.LEAFER_CHANGE="property.leafer_change",Op.SCROLL=Ep;var Lp={scrollX:Ep,scrollY:Ep},Pp=class extends kp{constructor(t,e){super(t),Object.assign(this,e)}};Pp.LOAD="image.load",Pp.LOADED="image.loaded",Pp.ERROR="image.error";var Tp=class extends kp{static checkHas(t,e,n){"on"===n?e===Mp?t.__hasWorldEvent=!0:t.__hasLocalEvent=!0:(t.__hasLocalEvent=t.hasEvent(Bp)||t.hasEvent(Rp)||t.hasEvent(Ap),t.__hasWorldEvent=t.hasEvent(Mp))}static emitLocal(t){if(t.leaferIsReady){const{resized:e}=t.__layout;"local"!==e&&(t.emit(Bp,t),"inner"===e&&t.emit(Rp,t)),t.emit(Ap,t)}}static emitWorld(t){t.leaferIsReady&&t.emit(Mp,t)}};Tp.RESIZE="bounds.resize",Tp.INNER="bounds.inner",Tp.LOCAL="bounds.local",Tp.WORLD="bounds.world";var{RESIZE:Bp,INNER:Rp,LOCAL:Ap,WORLD:Mp}=Tp,Dp={};[Bp,Rp,Ap,Mp].forEach(t=>Dp[t]=1);var Ip=class t extends kp{get bigger(){if(!this.old)return!0;const{width:t,height:e}=this.old;return this.width>=t&&this.height>=e}get smaller(){return!this.bigger}get samePixelRatio(){return!this.old||this.pixelRatio===this.old.pixelRatio}constructor(e,n){vs(e)?(super(t.RESIZE),Object.assign(this,e)):super(e),this.old=n}static isResizing(t){return this.resizingKeys&&!cs(this.resizingKeys[t.innerId])}};Ip.RESIZE="resize";var Fp=class extends kp{constructor(t,e){super(t),this.data=e}};Fp.REQUEST="watch.request",Fp.DATA="watch.data";var Wp=class extends kp{constructor(t,e,n){super(t),e&&(this.data=e,this.times=n)}};Wp.REQUEST="layout.request",Wp.START="layout.start",Wp.BEFORE="layout.before",Wp.LAYOUT="layout",Wp.AFTER="layout.after",Wp.AGAIN="layout.again",Wp.END="layout.end";var zp=class extends kp{constructor(t,e,n,i){super(t),e&&(this.times=e),n&&(this.renderBounds=n,this.renderOptions=i)}};zp.REQUEST="render.request",zp.CHILD_START="render.child_start",zp.CHILD_END="render.child_end",zp.START="render.start",zp.BEFORE="render.before",zp.RENDER="render",zp.AFTER="render.after",zp.AGAIN="render.again",zp.END="render.end",zp.NEXT="render.next";var Np=class extends kp{};Np.START="leafer.start",Np.BEFORE_READY="leafer.before_ready",Np.READY="leafer.ready",Np.AFTER_READY="leafer.after_ready",Np.VIEW_READY="leafer.view_ready",Np.VIEW_COMPLETED="leafer.view_completed",Np.STOP="leafer.stop",Np.RESTART="leafer.restart",Np.END="leafer.end",Np.UPDATE_MODE="leafer.update_mode",Np.TRANSFORM="leafer.transform",Np.MOVE="leafer.move",Np.SCALE="leafer.scale",Np.ROTATE="leafer.rotate",Np.SKEW="leafer.skew";var{MOVE:jp,SCALE:Vp,ROTATE:Hp,SKEW:Up}=Np,Yp={x:jp,y:jp,scaleX:Vp,scaleY:Vp,rotation:Hp,skewX:Up,skewY:Up},Xp={};function Gp(t,e,n){if(e){const{__captureMap:e}=t;return e||(n?t.__captureMap={}:Xp)}{const{__bubbleMap:e}=t;return e||(n?t.__bubbleMap={}:Xp)}}var{on:$p,on_:Kp,off:qp,off_:Zp,once:Jp,emit:Qp,emitEvent:tf,hasEvent:ef,destroy:nf}=class{set event(t){this.on(t)}on(t,e,n){if(!e){let e;if(gs(t))t.forEach(t=>this.on(t[0],t[1],t[2]));else for(let n in t)gs(e=t[n])?this.on(n,e[0],e[1]):this.on(n,e);return}let i,r,o;n&&("once"===n?r=!0:"boolean"==typeof n?i=n:(i=n.capture,r=n.once));const s=Gp(this,i,!0),a=ds(t)?t.split(" "):t,l=r?{listener:e,once:r}:{listener:e};a.forEach(t=>{t&&(o=s[t],o?-1===o.findIndex(t=>t.listener===e)&&o.push(l):s[t]=[l],Dp[t]&&Tp.checkHas(this,t,"on"))})}off(t,e,n){if(t){const i=ds(t)?t.split(" "):t;if(e){let t,r,o;n&&(t="boolean"==typeof n?n:"once"!==n&&n.capture);const s=Gp(this,t);i.forEach(t=>{t&&(r=s[t],r&&(o=r.findIndex(t=>t.listener===e),o>-1&&r.splice(o,1),r.length||delete s[t],Dp[t]&&Tp.checkHas(this,t,"off")))})}else{const{__bubbleMap:t,__captureMap:e}=this;i.forEach(n=>{t&&delete t[n],e&&delete e[n]})}}else this.__bubbleMap=this.__captureMap=void 0}on_(t,e,n,i){return e?this.on(t,n?e=e.bind(n):e,i):gs(t)&&t.forEach(t=>this.on(t[0],t[2]?t[1]=t[1].bind(t[2]):t[1],t[3])),{type:t,current:this,listener:e,options:i}}off_(t){if(!t)return;const e=gs(t)?t:[t];e.forEach(t=>{t&&(t.listener?t.current.off(t.type,t.listener,t.options):gs(t.type)&&t.type.forEach(e=>t.current.off(e[0],e[1],e[3])))}),e.length=0}once(t,e,n,i){if(!e)return gs(t)&&t.forEach(t=>this.once(t[0],t[1],t[2],t[3]));vs(n)?e=e.bind(n):i=n,this.on(t,e,{once:!0,capture:i})}emit(t,e,n){!e&&gl.has(t)&&(e=gl.get(t,{type:t,target:this,current:this}));const i=Gp(this,n)[t];if(i){let r;for(let o=0,s=i.length;o<s&&!((r=i[o])&&(r.listener(e),r.once&&(this.off(t,r.listener,n),o--,s--),e&&e.isStopNow));o++);}this.syncEventer&&this.syncEventer.emitEvent(e,n)}emitEvent(t,e){t.current=this,this.emit(t.type,t,e)}hasEvent(t,e){if(this.syncEventer&&this.syncEventer.hasEvent(t,e))return!0;const{__bubbleMap:n,__captureMap:i}=this,r=n&&n[t],o=i&&i[t];return!!(cs(e)?r||o:e?o:r)}destroy(){this.__captureMap=this.__bubbleMap=this.syncEventer=null}}.prototype,rf={on:$p,on_:Kp,off:qp,off_:Zp,once:Jp,emit:Qp,emitEvent:tf,hasEvent:ef,destroyEventer:nf},of=nl.get("setAttr"),sf={__setAttr(t,e,n){if(this.leaferIsCreated){const i=this.__.__getInput(t);if(!n||ps(e)||cs(e)||(of.warn(this.innerName,t,e),e=void 0),vs(e)||i!==e){if(this.__realSetAttr(t,e),this.isLeafer){this.emitEvent(new Op(Op.LEAFER_CHANGE,this,t,i,e));const n=Yp[t];n&&(this.emitEvent(new Np(n,this)),this.emitEvent(new Np(Np.TRANSFORM,this)))}this.emitPropertyEvent(Op.CHANGE,t,i,e);const n=Lp[t];return n&&this.emitPropertyEvent(n,t,i,e),!0}return!1}return this.__realSetAttr(t,e),!0},emitPropertyEvent(t,e,n,i){const r=new Op(t,this,e,n,i);this.isLeafer||this.hasEvent(t)&&this.emitEvent(r),this.leafer.emitEvent(r)},__realSetAttr(t,e){const n=this.__;n[t]=e,this.__proxyData&&this.setProxyAttr(t,e),n.normalStyle&&(this.lockNormalStyle||cs(n.normalStyle[t])||(n.normalStyle[t]=e))},__getAttr(t){return this.__proxyData?this.getProxyAttr(t):this.__.__get(t)}},{setLayout:af,multiplyParent:lf,translateInner:hf,defaultWorld:cf}=Qs,{toPoint:uf,tempPoint:df}=xa,pf={__updateWorldMatrix(){const{parent:t,__layout:e,__world:n,__scrollWorld:i,__:r}=this;lf(this.__local||e,t?t.__scrollWorld||t.__world:cf,n,!!e.affectScaleOrRotation,r),i&&hf(Object.assign(i,n),r.scrollX,r.scrollY),e.scaleFixed&&Kd.updateScaleFixedWorld(this)},__updateLocalMatrix(){if(this.__local){const t=this.__layout,e=this.__local,n=this.__;t.affectScaleOrRotation&&(t.scaleChanged&&(t.resized||(t.resized="scale"))||t.rotationChanged)&&(af(e,n,null,null,t.affectRotation),t.scaleChanged=t.rotationChanged=void 0),e.e=n.x+n.offsetX,e.f=n.y+n.offsetY,(n.around||n.origin)&&(uf(n.around||n.origin,t.boxBounds,df),hf(e,-df.x,-df.y,!n.around))}this.__layout.matrixChanged=void 0}},{updateMatrix:ff,updateAllMatrix:gf}=Kd,{updateBounds:vf}=ap,{toOuterOf:_f,copyAndSpread:mf,copy:yf}=Va,{toBounds:bf}=Iu,wf={__updateWorldBounds(){const{__layout:t,__world:e}=this;_f(t.renderBounds,e,e),this.__hasComplex&&Kd.checkComplex(this),t.resized&&("inner"===t.resized&&this.__onUpdateSize(),this.__hasLocalEvent&&Tp.emitLocal(this),t.resized=void 0),this.__hasWorldEvent&&Tp.emitWorld(this)},__updateLocalBounds(){const t=this.__layout;t.boxChanged&&(this.__.__pathInputed||this.__updatePath(),this.__updateRenderPath(),this.__updateBoxBounds(),t.resized="inner"),t.localBoxChanged&&(this.__local&&this.__updateLocalBoxBounds(),t.localBoxChanged=void 0,t.strokeSpread&&(t.strokeChanged=!0),t.renderSpread&&(t.renderChanged=!0),this.parent&&this.parent.__layout.boxChange()),t.boxChanged=void 0,t.strokeChanged&&(t.strokeSpread=this.__updateStrokeSpread(),t.strokeSpread?(t.strokeBounds===t.boxBounds&&t.spreadStroke(),this.__updateStrokeBounds(),this.__updateLocalStrokeBounds()):t.spreadStrokeCancel(),t.strokeChanged=void 0,(t.renderSpread||t.strokeSpread!==t.strokeBoxSpread)&&(t.renderChanged=!0),this.parent&&this.parent.__layout.strokeChange(),t.resized="inner"),t.renderChanged&&(t.renderSpread=this.__updateRenderSpread(),t.renderSpread?(t.renderBounds!==t.boxBounds&&t.renderBounds!==t.strokeBounds||t.spreadRender(),this.__updateRenderBounds(),this.__updateLocalRenderBounds()):t.spreadRenderCancel(),t.renderChanged=void 0,this.parent&&this.parent.__layout.renderChange()),t.outerScale&&Kd.updateOuterBounds(this),t.resized||(t.resized="local"),t.boundsChanged=void 0},__updateLocalBoxBounds(){this.__hasMotionPath&&this.__updateMotionPath(),this.__hasAutoLayout&&this.__updateAutoLayout(),_f(this.__layout.boxBounds,this.__local,this.__local)},__updateLocalStrokeBounds(){_f(this.__layout.strokeBounds,this.__localMatrix,this.__layout.localStrokeBounds)},__updateLocalRenderBounds(){_f(this.__layout.renderBounds,this.__localMatrix,this.__layout.localRenderBounds)},__updateBoxBounds(t,e){const n=this.__layout.boxBounds,i=this.__;i.__usePathBox?bf(i.path,n):(n.x=0,n.y=0,n.width=i.width,n.height=i.height)},__updateAutoLayout(){this.__layout.matrixChanged=!0,this.isBranch?(this.__extraUpdate(),this.__.flow?(this.__layout.boxChanged&&this.__updateFlowLayout(),gf(this),vf(this,this),this.__.__autoSide&&this.__updateBoxBounds(!0)):(gf(this),vf(this,this))):ff(this)},__updateNaturalSize(){const{__:t,__layout:e}=this;t.__naturalWidth=e.boxBounds.width,t.__naturalHeight=e.boxBounds.height},__updateStrokeBounds(t){const e=this.__layout;mf(e.strokeBounds,e.boxBounds,e.strokeBoxSpread)},__updateRenderBounds(t){const e=this.__layout,{renderSpread:n}=e;fs(n)&&n<=0?yf(e.renderBounds,e.strokeBounds):mf(e.renderBounds,e.boxBounds,n)}},xf={__render(t,e){if(e.shape)return this.__renderShape(t,e);if((!e.cellList||e.cellList.has(this))&&this.__worldOpacity){const n=this.__;if(n.bright&&!e.topRendering)return e.topList.add(this);if(t.setWorld(this.__nowWorld=this.__getNowWorld(e)),t.opacity=e.ignoreOpacity?1:e.dimOpacity&&!n.dimskip?n.opacity*e.dimOpacity:n.opacity,this.__.__single){if("path"===n.eraser)return this.__renderEraser(t,e);const i=t.getSameCanvas(!0,!0);this.__draw(i,e,t),Kd.copyCanvasByWorld(this,t,i,this.__nowWorld,n.__blendMode,!0),i.recycle(this.__nowWorld)}else this.__draw(t,e);nl.showBounds&&nl.drawBounds(this,t,e)}},__renderShape(t,e){this.__worldOpacity&&(t.setWorld(this.__nowWorld=this.__getNowWorld(e)),this.__drawShape(t,e))},__clip(t,e){this.__worldOpacity&&(t.setWorld(this.__nowWorld=this.__getNowWorld(e)),this.__drawRenderPath(t),t.clipUI(this))},__updateWorldOpacity(){this.__worldOpacity=this.__.visible?this.parent?this.parent.__worldOpacity*this.__.opacity:this.__.opacity:0,this.__layout.opacityChanged&&(this.__layout.opacityChanged=!1)}},{excludeRenderBounds:Sf}=rp,{hasSize:kf}=Va,Cf={__updateChange(){const{__layout:t}=this;t.childrenSortChanged&&(this.__updateSortChildren(),t.childrenSortChanged=!1),this.__.__checkSingle()},__render(t,e){const n=this.__nowWorld=this.__getNowWorld(e);if(this.__worldOpacity&&kf(n)){const i=this.__;if(i.__useDim)if(i.dim)e.dimOpacity=!0===i.dim?.2:i.dim;else{if(i.bright&&!e.topRendering)return e.topList.add(this);i.dimskip&&e.dimOpacity&&(e.dimOpacity=0)}if(i.__single&&!this.isBranchLeaf){if("path"===i.eraser)return this.__renderEraser(t,e);const r=t.getSameCanvas(!1,!0);this.__renderBranch(r,e),t.opacity=e.ignoreOpacity?1:e.dimOpacity?i.opacity*e.dimOpacity:i.opacity,t.copyWorldByReset(r,n,n,i.__blendMode,!0),r.recycle(n)}else this.__renderBranch(t,e)}},__renderBranch(t,e){if(this.__hasMask)this.__renderMask(t,e);else{let n;const{children:i}=this;for(let r=0,o=i.length;r<o;r++)n=i[r],Sf(n,e)||(n.__hasComplex?Kd.renderComplex(n,t,e):n.__render(t,e))}},__clip(t,e){if(this.__worldOpacity){const{children:n}=this;for(let i=0,r=n.length;i<r;i++)Sf(n[i],e)||n[i].__clip(t,e)}}},{LEAF:Ef,create:Of}=Ss,{stintSet:Lf}=bs,{toInnerPoint:Pf,toOuterPoint:Tf,multiplyParent:Bf}=Qs,{toOuterOf:Rf}=Va,{copy:Af,move:Mf}=ua,{getScaleFixedData:Df}=Ws,{moveLocal:If,zoomOfLocal:Ff,rotateOfLocal:Wf,skewOfLocal:zf,moveWorld:Nf,zoomOfWorld:jf,rotateOfWorld:Vf,skewOfWorld:Hf,transform:Uf,transformWorld:Yf,setTransform:Xf,getFlipTransform:Gf,getLocalOrigin:$f,getRelativeWorld:Kf,drop:qf}=Kd,Zf=class{get tag(){return this.__tag}set tag(t){}get __tag(){return"Leaf"}get innerName(){return this.__.name||this.tag+this.innerId}get __DataProcessor(){return xs}get __LayoutProcessor(){return Sp}get leaferIsCreated(){return this.leafer&&this.leafer.created}get leaferIsReady(){return this.leafer&&this.leafer.ready}get isLeafer(){return!1}get isBranch(){return!1}get isBranchLeaf(){return!1}get __localMatrix(){return this.__local||this.__layout}get __localBoxBounds(){return this.__local||this.__layout}get worldTransform(){return this.__layout.getTransform("world")}get localTransform(){return this.__layout.getTransform("local")}get scrollWorldTransform(){return this.updateLayout(),this.__scrollWorld||this.__world}get boxBounds(){return this.getBounds("box","inner")}get renderBounds(){return this.getBounds("render","inner")}get worldBoxBounds(){return this.getBounds("box")}get worldStrokeBounds(){return this.getBounds("stroke")}get worldRenderBounds(){return this.getBounds("render")}get worldOpacity(){return this.updateLayout(),this.__worldOpacity}get __worldFlipped(){return this.__world.scaleX<0||this.__world.scaleY<0}get __onlyHitMask(){return this.__hasMask&&!this.__.hitChildren}get __ignoreHitWorld(){return(this.__hasMask||this.__hasEraser)&&this.__.hitChildren}get __inLazyBounds(){return this.leaferIsCreated&&this.leafer.lazyBounds.hit(this.__world)}get pathInputed(){return this.__.__pathInputed}set event(t){this.on(t)}constructor(t){this.innerId=Of(Ef),this.reset(t),this.__bubbleMap&&this.__emitLifeEvent(Cp.CREATED)}reset(t){this.leafer&&this.leafer.forceRender(this.__world),0!==t&&(this.__world={a:1,b:0,c:0,d:1,e:0,f:0,x:0,y:0,width:0,height:0,scaleX:1,scaleY:1},null!==t&&(this.__local={a:1,b:0,c:0,d:1,e:0,f:0,x:0,y:0,width:0,height:0})),this.__worldOpacity=1,this.__=new this.__DataProcessor(this),this.__layout=new this.__LayoutProcessor(this),this.__level&&this.resetCustom(),t&&(t.__&&(t=t.toJSON()),t.children?this.set(t):Object.assign(this,t))}resetCustom(){this.__hasMask=this.__hasEraser=null,this.forceUpdate()}waitParent(t,e){e&&(t=t.bind(e)),this.parent?t():this.on(Cp.ADD,t,"once")}waitLeafer(t,e){e&&(t=t.bind(e)),this.leafer?t():this.on(Cp.MOUNTED,t,"once")}nextRender(t,e,n){this.leafer?this.leafer.nextRender(t,e,n):this.waitLeafer(()=>this.leafer.nextRender(t,e,n))}removeNextRender(t){this.nextRender(t,null,"off")}__bindLeafer(t){if(this.isLeafer&&null!==t&&(t=this),this.leafer&&!t&&this.leafer.leafs--,this.leafer=t,t?(t.leafs++,this.__level=this.parent?this.parent.__level+1:1,this.animation&&this.__runAnimation("in"),this.__bubbleMap&&this.__emitLifeEvent(Cp.MOUNTED),t.cacheId&&Kd.cacheId(this)):this.__emitLifeEvent(Cp.UNMOUNTED),this.isBranch){const{children:e}=this;for(let n=0,i=e.length;n<i;n++)e[n].__bindLeafer(t)}}set(t,e){}get(t){}setAttr(t,e){this[t]=e}getAttr(t){return this[t]}getComputedAttr(t){return this.__[t]}toJSON(t){return t&&this.__layout.update(),this.__.__getInputData(null,t)}toString(t){return JSON.stringify(this.toJSON(t))}toSVG(){}__SVG(t){}toHTML(){}__setAttr(t,e){return!0}__getAttr(t){}setProxyAttr(t,e){}getProxyAttr(t){}find(t,e){}findTag(t){}findOne(t,e){}findId(t){}focus(t){}updateState(){}updateLayout(){this.__layout.update()}forceUpdate(t){cs(t)?t="width":"surface"===t&&(t="blendMode");const e=this.__.__getInput(t);this.__[t]=cs(e)?null:void 0,this[t]=e}forceRender(t,e){this.forceUpdate("surface")}__extraUpdate(){this.leaferIsReady&&this.leafer.layouter.addExtra(this)}__updateWorldMatrix(){}__updateLocalMatrix(){}__updateWorldBounds(){}__updateLocalBounds(){}__updateLocalBoxBounds(){}__updateLocalStrokeBounds(){}__updateLocalRenderBounds(){}__updateBoxBounds(t,e){}__updateContentBounds(){}__updateStrokeBounds(t){}__updateRenderBounds(t){}__updateAutoLayout(){}__updateFlowLayout(){}__updateNaturalSize(){}__updateStrokeSpread(){return 0}__updateRenderSpread(){return 0}__onUpdateSize(){}__updateEraser(t){this.__hasEraser=!!t||this.children.some(t=>t.__.eraser)}__renderEraser(t,e){t.save(),this.__clip(t,e);const{renderBounds:n}=this.__layout;t.clearRect(n.x,n.y,n.width,n.height),t.restore()}__updateMask(t){this.__hasMask=this.children.some(t=>t.__.mask&&t.__.visible&&t.__.opacity)}__renderMask(t,e){}__getNowWorld(t){if(t.matrix){this.__cameraWorld||(this.__cameraWorld={});const e=this.__cameraWorld,n=this.__world;return Bf(n,t.matrix,e,void 0,n),Rf(this.__layout.renderBounds,e,e),Lf(e,"half",n.half),Lf(e,"ignorePixelSnap",n.ignorePixelSnap),e}return this.__world}getClampRenderScale(){let{scaleX:t}=this.__nowWorld||this.__world;return t<0&&(t=-t),t>1?t:1}getRenderScaleData(t,e,n=!0){return Df(nd.patternLocked?this.__world:this.__nowWorld||this.__world,e,n,t)}getTransform(t){return this.__layout.getTransform(t||"local")}getBounds(t,e){return this.__layout.getBounds(t,e)}getLayoutBounds(t,e,n){return this.__layout.getLayoutBounds(t,e,n)}getLayoutPoints(t,e){return this.__layout.getLayoutPoints(t,e)}getWorldBounds(t,e,n){const i=e?Kf(this,e):this.worldTransform,r=n?t:{};return Rf(t,i,r),r}worldToLocal(t,e,n,i){this.parent?this.parent.worldToInner(t,e,n,i):e&&Af(e,t)}localToWorld(t,e,n,i){this.parent?this.parent.innerToWorld(t,e,n,i):e&&Af(e,t)}worldToInner(t,e,n,i){i&&(i.innerToWorld(t,e,n),t=e||t),Pf(this.worldTransform,t,e,n)}innerToWorld(t,e,n,i){Tf(this.worldTransform,t,e,n),i&&i.worldToInner(e||t,null,n)}getBoxPoint(t,e,n,i){const r=this.getInnerPoint(t,e,n,i);return n?r:this.getBoxPointByInner(r,null,null,!0)}getBoxPointByInner(t,e,n,i){const r=i?t:Object.assign({},t),{x:o,y:s}=this.boxBounds;return Mf(r,-o,-s),r}getInnerPoint(t,e,n,i){const r=i?t:{};return this.worldToInner(t,r,n,e),r}getInnerPointByBox(t,e,n,i){const r=i?t:Object.assign({},t),{x:o,y:s}=this.boxBounds;return Mf(r,o,s),r}getInnerPointByLocal(t,e,n,i){return this.getInnerPoint(t,this.parent,n,i)}getLocalPoint(t,e,n,i){const r=i?t:{};return this.worldToLocal(t,r,n,e),r}getLocalPointByInner(t,e,n,i){return this.getWorldPoint(t,this.parent,n,i)}getPagePoint(t,e,n,i){return(this.leafer?this.leafer.zoomLayer:this).getInnerPoint(t,e,n,i)}getWorldPoint(t,e,n,i){const r=i?t:{};return this.innerToWorld(t,r,n,e),r}getWorldPointByBox(t,e,n,i){return this.getWorldPoint(this.getInnerPointByBox(t,null,null,i),e,n,!0)}getWorldPointByLocal(t,e,n,i){const r=i?t:{};return this.localToWorld(t,r,n,e),r}getWorldPointByPage(t,e,n,i){return(this.leafer?this.leafer.zoomLayer:this).getWorldPoint(t,e,n,i)}setTransform(t,e,n){Xf(this,t,e,n)}transform(t,e,n){Uf(this,t,e,n)}move(t,e,n){If(this,t,e,n)}moveInner(t,e,n){Nf(this,t,e,!0,n)}scaleOf(t,e,n,i,r){Ff(this,$f(this,t),e,n,i,r)}rotateOf(t,e,n){Wf(this,$f(this,t),e,n)}skewOf(t,e,n,i,r){zf(this,$f(this,t),e,n,i,r)}transformWorld(t,e,n){Yf(this,t,e,n)}moveWorld(t,e,n){Nf(this,t,e,!1,n)}scaleOfWorld(t,e,n,i,r){jf(this,t,e,n,i,r)}rotateOfWorld(t,e){Vf(this,t,e)}skewOfWorld(t,e,n,i,r){Hf(this,t,e,n,i,r)}flip(t,e){Uf(this,Gf(this,t),!1,e)}scaleResize(t,e=t,n){this.scaleX*=t,this.scaleY*=e}__scaleResize(t,e){}resizeWidth(t){}resizeHeight(t){}hit(t,e){return!0}__hitWorld(t,e){return!0}__hit(t,e){return!0}__hitFill(t){return!0}__hitStroke(t,e){return!0}__hitPixel(t){return!0}__drawHitPath(t){}__updateHitCanvas(){}__render(t,e){}__drawFast(t,e){}__draw(t,e,n){}__clip(t,e){}__renderShape(t,e){}__drawShape(t,e){}__updateWorldOpacity(){}__updateChange(){}__drawPath(t){}__drawRenderPath(t){}__updatePath(){}__updateRenderPath(t){}getMotionPathData(){return hl.need("path")}getMotionPoint(t){return hl.need("path")}getMotionTotal(){return 0}__updateMotionPath(){}__runAnimation(t,e){}__updateSortChildren(){}add(t,e){}remove(t,e){this.parent&&this.parent.remove(this,e)}dropTo(t,e,n){qf(this,t,e,n)}on(t,e,n){}off(t,e,n){}on_(t,e,n,i){}off_(t){}once(t,e,n,i){}emit(t,e,n){}emitEvent(t,e){}hasEvent(t,e){return!1}static changeAttr(t,e,n){n?this.addAttr(t,e,n):Ld(this.prototype,t,e)}static addAttr(t,e,n,i){n||(n=vd),n(e,i)(this.prototype,t)}__emitLifeEvent(t){this.hasEvent(t)&&this.emitEvent(new Cp(t,this,this.parent))}destroy(){this.destroyed||(this.parent&&this.remove(),this.children&&this.clear(),this.__emitLifeEvent(Cp.DESTROY),this.__.destroy(),this.__layout.destroy(),this.destroyEventer(),this.destroyed=!0)}};Zf=ml([Dd(sf),Dd(pf),Dd(wf),Dd(rf),Dd(xf)],Zf);var{setListWithFn:Jf}=Va,{sort:Qf}=ap,{localBoxBounds:tg,localStrokeBounds:eg,localRenderBounds:ng,maskLocalBoxBounds:ig,maskLocalStrokeBounds:rg,maskLocalRenderBounds:og}=rp,sg=new nl("Branch"),ag=class extends Zf{__updateStrokeSpread(){const{children:t}=this;for(let e=0,n=t.length;e<n;e++)if(t[e].__layout.strokeSpread)return 1;return 0}__updateRenderSpread(){let t;const{children:e}=this;for(let n=0,i=e.length;n<i;n++)if(t=e[n].__layout,t.renderSpread||t.localOuterBounds)return 1;return 0}__updateBoxBounds(t,e){Jf(e||this.__layout.boxBounds,this.children,this.__hasMask?ig:tg)}__updateStrokeBounds(t){Jf(t||this.__layout.strokeBounds,this.children,this.__hasMask?rg:eg)}__updateRenderBounds(t){Jf(t||this.__layout.renderBounds,this.children,this.__hasMask?og:ng)}__updateSortChildren(){let t;const{children:e}=this;if(e.length>1){for(let n=0,i=e.length;n<i;n++)e[n].__tempNumber=n,e[n].__.zIndex&&(t=!0);e.sort(Qf),this.__layout.affectChildrenSort=t}}add(t,e){if(t===this||t.destroyed)return sg.warn("add self or destroyed");const n=cs(e);if(!t.__){if(gs(t))return t.forEach(t=>{this.add(t,e),n||e++});if(!(t=dl.get(t.tag,t)))return}t.parent&&t.parent.remove(t),t.parent=this,n?this.children.push(t):this.children.splice(e,0,t),t.isBranch&&(this.__.__childBranchNumber=(this.__.__childBranchNumber||0)+1);const i=t.__layout;i.boxChanged||i.boxChange(),i.matrixChanged||i.matrixChange(),t.__bubbleMap&&t.__emitLifeEvent(Cp.ADD),this.leafer&&(t.__bindLeafer(this.leafer),this.leafer.created&&this.__emitChildEvent(Cp.ADD,t)),this.__layout.affectChildrenSort&&this.__layout.childrenSortChange()}addMany(...t){this.add(t)}remove(t,e){t?t.__?t.animationOut?t.__runAnimation("out",()=>this.__remove(t,e)):this.__remove(t,e):this.find(t).forEach(t=>this.remove(t,e)):cs(t)&&super.remove(null,e)}removeAll(t){const{children:e}=this;e.length&&(this.children=[],this.__preRemove(),this.__.__childBranchNumber=0,e.forEach(e=>{this.__realRemoveChild(e),t&&e.destroy()}))}clear(){this.removeAll(!0)}__remove(t,e){const n=this.children.indexOf(t);n>-1&&(this.children.splice(n,1),t.isBranch&&(this.__.__childBranchNumber=(this.__.__childBranchNumber||1)-1),this.__preRemove(),this.__realRemoveChild(t),e&&t.destroy())}__preRemove(){this.__hasMask&&this.__updateMask(),this.__hasEraser&&this.__updateEraser(),this.__layout.boxChange(),this.__layout.affectChildrenSort&&this.__layout.childrenSortChange()}__realRemoveChild(t){t.__emitLifeEvent(Cp.REMOVE),t.parent=null,this.leafer&&(t.__bindLeafer(null),this.leafer.created&&(this.__emitChildEvent(Cp.REMOVE,t),this.leafer.hitCanvasManager&&this.leafer.hitCanvasManager.clear()))}__emitChildEvent(t,e){const n=new Cp(t,e,this);this.hasEvent(t)&&!this.isLeafer&&this.emitEvent(n),this.leafer.emitEvent(n)}};ag=ml([Dd(Cf)],ag);var lg=class t{get length(){return this.list.length}constructor(t){this.reset(),t&&(gs(t)?this.addList(t):this.add(t))}has(t){return t&&!cs(this.keys[t.innerId])}indexAt(t){return this.list[t]}indexOf(t){const e=this.keys[t.innerId];return cs(e)?-1:e}add(t){const{list:e,keys:n}=this;cs(n[t.innerId])&&(e.push(t),n[t.innerId]=e.length-1)}addAt(t,e=0){const{keys:n}=this;if(cs(n[t.innerId])){const{list:i}=this;for(let t=e,r=i.length;t<r;t++)n[i[t].innerId]++;0===e?i.unshift(t):(e>i.length&&(e=i.length),i.splice(e,0,t)),n[t.innerId]=e}}addList(t){for(let e=0;e<t.length;e++)this.add(t[e])}remove(t){const{list:e}=this;let n;for(let i=0,r=e.length;i<r;i++)cs(n)?e[i].innerId===t.innerId&&(n=i,delete this.keys[t.innerId]):this.keys[e[i].innerId]=i-1;cs(n)||e.splice(n,1)}sort(t){const{list:e}=this;t?e.sort((t,e)=>e.__level-t.__level):e.sort((t,e)=>t.__level-e.__level)}forEach(t){this.list.forEach(t)}clone(){const e=new t;return e.list=[...this.list],e.keys=Object.assign({},this.keys),e}update(){this.keys={};const{list:t,keys:e}=this;for(let n=0,i=t.length;n<i;n++)e[t[n].innerId]=n}reset(){this.list=[],this.keys={}}destroy(){this.reset()}},hg=class{get length(){return this._length}constructor(t){this._length=0,this.reset(),t&&(gs(t)?this.addList(t):this.add(t))}has(t){return!cs(this.keys[t.innerId])}without(t){return cs(this.keys[t.innerId])}sort(t){const{levels:e}=this;t?e.sort((t,e)=>e-t):e.sort((t,e)=>t-e)}addList(t){t.forEach(t=>{this.add(t)})}add(t){const{keys:e,levelMap:n}=this;e[t.innerId]||(e[t.innerId]=1,n[t.__level]?n[t.__level].push(t):(n[t.__level]=[t],this.levels.push(t.__level)),this._length++)}forEach(t){let e;this.levels.forEach(n=>{e=this.levelMap[n];for(let i=0,r=e.length;i<r;i++)t(e[i])})}reset(){this.levelMap={},this.keys={},this.levels=[],this._length=0}destroy(){this.levelMap=null}};function cg(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s}function ug(t){return hd(t,t=>({set(e){this.__setAttr(t,e),e&&(this.__.__useEffect=!0);const n=this.__layout;n.renderChanged||n.renderChange(),n.surfaceChange()}}))}function dg(t){return hd(t,t=>({set(e){this.__setAttr(t,e),this.__layout.boxChanged||this.__layout.boxChange(),this.__updateSize()}}))}var pg={},fg={hasTransparent:function(t){if(!t||7===t.length||4===t.length)return!1;if("transparent"===t)return!0;const e=t[0];if("#"===e)switch(t.length){case 5:return"f"!==t[4]&&"F"!==t[4];case 9:return"f"!==t[7]&&"F"!==t[7]||"f"!==t[8]&&"F"!==t[8]}else if(("r"===e||"h"===e)&&"a"===t[3]){const e=t.lastIndexOf(",");if(e>-1)return parseFloat(t.slice(e+1))<1}return!1}},gg=Ka,vg={},_g={},mg={},yg={},bg={},wg={apply(){hl.need("filter")}},xg={},Sg={setStyleName:()=>hl.need("state"),set:()=>hl.need("state")},{parse:kg,objectToCanvasData:Cg}=sc,{stintSet:Eg}=bs,{hasTransparent:Og}=fg,Lg={originPaint:{}},Pg=nl.get("UIData"),Tg=class extends xs{get scale(){const{scaleX:t,scaleY:e}=this;return t!==e?{x:t,y:e}:t}get __strokeWidth(){return this.__getRealStrokeWidth()}get __maxStrokeWidth(){const t=this,e=t.__hasStrokeSides||t.strokeWidth;return t.__hasMultiStrokeStyle?Math.max(t.__hasMultiStrokeStyle,e):e}get __hasMultiPaint(){const t=this;return t.fill&&this.__useStroke||t.__isFills&&t.fill.length>1||t.__isStrokes&&t.stroke.length>1||t.__useEffect}get __clipAfterFill(){const t=this;return t.cornerRadius||t.innerShadow||t.__pathInputed}get __hasSurface(){return this.fill||this.stroke}get __autoWidth(){return null==this._width}get __autoHeight(){return null==this._height}get __autoSide(){return null==this._width||null==this._height}get __autoSize(){return null==this._width&&null==this._height}setVisible(t){this._visible=t;const{leafer:e}=this.__leaf;e&&(e.watcher.hasVisible=!0)}setWidth(t){t<0?(this._width=-t,this.__leaf.scaleX*=-1,Pg.warn("width < 0, instead -scaleX ",this)):this._width=t}setHeight(t){t<0?(this._height=-t,this.__leaf.scaleY*=-1,Pg.warn("height < 0, instead -scaleY",this)):this._height=t}setFill(t){this.__naturalWidth&&this.__removeNaturalSize(),ds(t)||!t?(Eg(this,"__isTransparentFill",Og(t)),this.__isFills&&this.__removePaint("fill",!0),this._fill=t):vs(t)&&this.__setPaint("fill",t)}setStroke(t){ds(t)||!t?(Eg(this,"__isTransparentStroke",Og(t)),this.__isStrokes&&this.__removePaint("stroke",!0),this._stroke=t):vs(t)&&this.__setPaint("stroke",t)}setPath(t){const e=ds(t);e||t&&vs(t[0])?(this.__setInput("path",t),this._path=e?kg(t):Cg(t)):(this.__input&&this.__removeInput("path"),this._path=t)}setShadow(t){Bg(this,"shadow",t)}setInnerShadow(t){Bg(this,"innerShadow",t)}setFilter(t){Bg(this,"filter",t)}__computePaint(){const{fill:t,stroke:e}=this.__input;t&&_g.compute("fill",this.__leaf),e&&_g.compute("stroke",this.__leaf),this.__needComputePaint=void 0}__getRealStrokeWidth(t){let{strokeWidth:e,strokeScaleFixed:n}=this;if(t&&(t.strokeWidth&&(e=t.strokeWidth),cs(t.strokeScaleFixed)||(n=t.strokeScaleFixed)),n){const{scaleX:t}=this.__leaf.getRenderScaleData(!0,n,!1);if(1!==t)return e*t}return e}__checkComplex(){const t=this;Eg(t,"__complex",t.__isFills||t.__isStrokes||t.cornerRadius||t.__useEffect)}__setPaint(t,e){this.__setInput(t,e);const n=this.__leaf.__layout;n.boxChanged||n.boxChange(),gs(e)&&!e.length?this.__removePaint(t):"fill"===t?(this.__isFills=!0,this._fill||(this._fill=Lg)):(this.__isStrokes=!0,this._stroke||(this._stroke=Lg))}__removePaint(t,e){e&&this.__removeInput(t),mg.recycleImage(t,this),"fill"===t?(Eg(this,"__isAlphaPixelFill",void 0),this._fill=this.__isFills=void 0):(Eg(this,"__isAlphaPixelStroke",void 0),Eg(this,"__hasMultiStrokeStyle",void 0),this._stroke=this.__isStrokes=void 0)}};function Bg(t,e,n){t.__setInput(e,n),gs(n)?(n.some(t=>!1===t.visible)&&(n=n.filter(t=>!1!==t.visible)),n.length||(n=void 0)):n=n&&!1!==n.visible?[n]:void 0,t["_"+e]=n}var Rg=class extends Tg{},Ag=class extends Rg{get __boxStroke(){return!this.__pathInputed}get __drawAfterFill(){return this.__single||this.__clipAfterFill}get __clipAfterFill(){const t=this;return"show"!==t.overflow&&t.__leaf.children.length&&(t.__leaf.isOverflow||super.__clipAfterFill)}},Mg=class extends Tg{get __usePathBox(){return this.points||this.__pathInputed}},Dg=class extends Tg{get __boxStroke(){return!this.__pathInputed}},Ig={thin:100,"extra-light":200,light:300,normal:400,medium:500,"semi-bold":600,bold:700,"extra-bold":800,black:900},{max:Fg,add:Wg}=Os,zg={__updateStrokeSpread(){let t=0,e=0;const n=this.__,{strokeAlign:i,__maxStrokeWidth:r}=n,o=this.__box;if((n.stroke||"all"===n.hitStroke)&&r&&"inside"!==i&&(e=t="center"===i?r/2:r,!n.__boxStroke||n.__useArrow)){const e=n.__isLinePath?0:10*t,i="none"===n.strokeCap?0:r;t+=Math.max(e,i)}return n.__useArrow&&(t+=5*r),o&&(t=Fg(t,o.__layout.strokeSpread=o.__updateStrokeSpread()),e=Math.max(e,o.__layout.strokeBoxSpread)),this.__layout.strokeBoxSpread=e,t},__updateRenderSpread(){let t=0;const{shadow:e,innerShadow:n,blur:i,backgroundBlur:r,filter:o,renderSpread:s}=this.__,{strokeSpread:a}=this.__layout,l=this.__box;e&&(t=bg.getShadowRenderSpread(this,e)),i&&(t=Fg(t,i)),o&&(t=Wg(t,wg.getSpread(o))),s&&(t=Wg(t,s)),a&&(t=Wg(t,a));let h=t;return n&&(h=Fg(h,bg.getInnerShadowSpread(this,n))),r&&(h=Fg(h,r)),this.__layout.renderShapeSpread=h,l?Fg(l.__updateRenderSpread(),t):t}},{stintSet:Ng}=bs,jg={__updateChange(){const t=this.__;if(t.__useStroke){const e=t.__useStroke=!(!t.stroke||!t.strokeWidth);Ng(this.__world,"half",e&&"center"===t.strokeAlign&&t.strokeWidth%2),Ng(t,"__fillAfterStroke",e&&"outside"===t.strokeAlign&&t.fill&&!t.__isTransparentFill)}if(t.__useEffect){const{shadow:e,fill:n,stroke:i}=t,r=t.innerShadow||t.blur||t.backgroundBlur||t.filter;Ng(t,"__isFastShadow",e&&!r&&e.length<2&&!e[0].spread&&!bg.isTransformShadow(e[0])&&n&&!t.__isTransparentFill&&!(gs(n)&&n.length>1)&&(this.useFastShadow||!i||i&&"inside"===t.strokeAlign)),t.__useEffect=!(!e&&!r)}t.__checkSingle(),t.__checkComplex()},__drawFast(t,e){Vg(this,t,e)},__draw(t,e,n){const i=this.__;if(i.__complex){i.__needComputePaint&&i.__computePaint();const{fill:r,stroke:o,__drawAfterFill:s,__fillAfterStroke:a,__isFastShadow:l}=i;if(this.__drawRenderPath(t),i.__useEffect&&!l){const l=_g.shape(this,t,e);this.__nowWorld=this.__getNowWorld(e);const{shadow:h,innerShadow:c,filter:u}=i;h&&bg.shadow(this,t,l),a&&(i.__isStrokes?_g.strokes(o,this,t,e):_g.stroke(o,this,t,e)),r&&(i.__isFills?_g.fills(r,this,t,e):_g.fill(r,this,t,e)),s&&this.__drawAfterFill(t,e),c&&bg.innerShadow(this,t,l),o&&!a&&(i.__isStrokes?_g.strokes(o,this,t,e):_g.stroke(o,this,t,e)),u&&wg.apply(u,this,this.__nowWorld,t,n,l),l.worldCanvas&&l.worldCanvas.recycle(),l.canvas.recycle()}else{if(a&&(i.__isStrokes?_g.strokes(o,this,t,e):_g.stroke(o,this,t,e)),l){const e=i.shadow[0],{scaleX:n,scaleY:r}=this.getRenderScaleData(!0,e.scaleFixed);t.save(),t.setWorldShadow(e.x*n,e.y*r,e.blur*n,fg.string(e.color))}r&&(i.__isFills?_g.fills(r,this,t,e):_g.fill(r,this,t,e)),l&&t.restore(),s&&this.__drawAfterFill(t,e),o&&!a&&(i.__isStrokes?_g.strokes(o,this,t,e):_g.stroke(o,this,t,e))}}else i.__pathForRender?Vg(this,t,e):this.__drawFast(t,e)},__drawShape(t,e){this.__drawRenderPath(t);const n=this.__,{fill:i,stroke:r}=n;i&&!e.ignoreFill&&(n.__isAlphaPixelFill?_g.fills(i,this,t,e):_g.fill("#000000",this,t,e)),n.__isCanvas&&this.__drawAfterFill(t,e),r&&!e.ignoreStroke&&(n.__isAlphaPixelStroke?_g.strokes(r,this,t,e):_g.stroke("#000000",this,t,e))},__drawAfterFill(t,e){this.__.__clipAfterFill?(t.save(),t.clipUI(this),this.__drawContent(t,e),t.restore()):this.__drawContent(t,e)}};function Vg(t,e,n){const{fill:i,stroke:r,__drawAfterFill:o,__fillAfterStroke:s}=t.__;t.__drawRenderPath(e),s&&_g.stroke(r,t,e,n),i&&_g.fill(i,t,e,n),o&&t.__drawAfterFill(e,n),r&&!s&&_g.stroke(r,t,e,n)}var Hg,Ug={__drawFast(t,e){let{x:n,y:i,width:r,height:o}=this.__layout.boxBounds;const{fill:s,stroke:a,__drawAfterFill:l}=this.__;if(s&&(t.fillStyle=s,t.fillRect(n,i,r,o)),l&&this.__drawAfterFill(t,e),a){const{strokeAlign:s,__strokeWidth:l}=this.__;if(!l)return;t.setStroke(a,l,this.__);const h=l/2;switch(s){case"center":t.strokeRect(0,0,r,o);break;case"inside":r-=l,o-=l,r<0||o<0?(t.save(),this.__clip(t,e),t.strokeRect(n+h,i+h,r,o),t.restore()):t.strokeRect(n+h,i+h,r,o);break;case"outside":t.strokeRect(n-h,i-h,r+l,o+l)}}}},Yg=Hg=class extends Zf{get app(){return this.leafer&&this.leafer.app}get isFrame(){return!1}set strokeWidthFixed(t){this.strokeScaleFixed=t}get strokeWidthFixed(){return this.strokeScaleFixed}set scale(t){Ws.assignScale(this,t)}get scale(){return this.__.scale}get isAutoWidth(){const t=this.__;return t.__autoWidth||t.autoWidth}get isAutoHeight(){const t=this.__;return t.__autoHeight||t.autoHeight}get pen(){const{path:t}=this.__;return Yu.set(this.path=t||[]),t||this.__drawPathByBox(Yu),Yu}reset(t){}set(t,e){t&&Object.assign(this,t)}get(t){return ds(t)?this.__.__getInput(t):this.__.__getInputData(t)}createProxyData(){}clearProxyData(){}find(t,e){return hl.need("find")}findTag(t){return this.find({tag:t})}findOne(t,e){return hl.need("find")}findId(t){return this.findOne({id:t})}getPath(t,e){this.__layout.update();let n=e?this.__.__pathForRender:this.__.path;return n||(Yu.set(n=[]),this.__drawPathByBox(Yu,!e)),t?sc.toCanvasData(n,!0):n}getPathString(t,e,n){return sc.stringify(this.getPath(t,e),n)}asPath(t,e){this.path=this.getPath(t,e)}load(){this.__.__computePaint()}__onUpdateSize(){if(this.__.__input){const t=this.__;!t.lazy||this.__inLazyBounds||xg.running?t.__computePaint():t.__needComputePaint=!0}}__updateRenderPath(t){const e=this.__;e.path?(e.__pathForRender=e.cornerRadius||e.path.radius?Hu.smooth(e.path,e.cornerRadius,e.cornerSmoothing):e.path,e.__useArrow&&vg.addArrows(this,t)):e.__pathForRender&&(e.__pathForRender=void 0)}__drawRenderPath(t){const e=this.__;t.beginPath(),e.__useArrow&&vg.updateArrow(this),this.__drawPathByData(t,e.__pathForRender)}__drawPath(t){t.beginPath(),this.__drawPathByData(t,this.__.path,!0)}__drawPathByData(t,e,n){e?au.drawPathByData(t,e):this.__drawPathByBox(t,n)}__drawPathByBox(t,e){const{x:n,y:i,width:r,height:o}=this.__layout.boxBounds;if(this.__.cornerRadius&&!e){const{cornerRadius:e}=this.__;t.roundRect(n,i,r,o,fs(e)?[e]:e)}else t.rect(n,i,r,o);t.closePath()}drawImagePlaceholder(t,e,n){_g.fill(this.__.placeholderColor,this,e,n)}animate(t,e,n,i){return this.set(t),hl.need("animate")}killAnimate(t,e){}export(t,e){return hl.need("export")}syncExport(t,e){return hl.need("export")}clone(t){const e=bs.clone(this.toJSON());return t&&Object.assign(e,t),Hg.one(e)}static one(t,e,n,i,r){return dl.get(t.tag||this.prototype.__tag,t,e,n,i,r)}static registerUI(){Id()(this)}static registerData(t){Od(t)(this.prototype)}static setEditConfig(t){}static setEditOuter(t){}static setEditInner(t){}destroy(){this.__.__willDestroy=!0,this.fill=this.stroke=null,this.__animate&&this.killAnimate(),super.destroy()}};cg([Od(Tg)],Yg.prototype,"__",void 0),cg([(t,e)=>{const n="_"+e;ad(t,e,{set(t){this.isLeafer&&(this[n]=t)},get(){return this.isApp?this.tree.zoomLayer:this.isLeafer?this[n]||this:this.leafer&&this.leafer.zoomLayer}})}],Yg.prototype,"zoomLayer",void 0),cg([cd("")],Yg.prototype,"id",void 0),cg([cd("")],Yg.prototype,"name",void 0),cg([cd("")],Yg.prototype,"className",void 0),cg([xd("pass-through")],Yg.prototype,"blendMode",void 0),cg([function(t){return hd(t,t=>({set(e){this.__setAttr(t,e)&&(this.__layout.opacityChanged||this.__layout.opacityChange()),this.mask&&kd(this)}}))}(1)],Yg.prototype,"opacity",void 0),cg([function(t){return hd(t,t=>({set(e){const n=this.visible;if(!0===n&&0===e){if(this.animationOut)return this.__runAnimation("out",()=>Cd(this,t,e,n))}else 0===n&&!0===e&&this.animation&&this.__runAnimation("in");Cd(this,t,e,n),this.mask&&kd(this)}}))}(!0)],Yg.prototype,"visible",void 0),cg([xd(!1)],Yg.prototype,"locked",void 0),cg([Sd(!1)],Yg.prototype,"dim",void 0),cg([Sd(!1)],Yg.prototype,"dimskip",void 0),cg([function(t){return hd(t,t=>({set(e){this.__setAttr(t,e)&&this.waitParent(()=>{this.parent.__layout.childrenSortChange()})}}))}(0)],Yg.prototype,"zIndex",void 0),cg([function(t){return hd(t,t=>({set(e){this.__setAttr(t,e)&&(this.__layout.boxChanged||this.__layout.boxChange(),this.waitParent(()=>{this.parent.__updateMask(e)}))}}))}(!1)],Yg.prototype,"mask",void 0),cg([function(t){return hd(t,t=>({set(e){this.__setAttr(t,e)&&this.waitParent(()=>{this.parent.__updateEraser(e)})}}))}(!1)],Yg.prototype,"eraser",void 0),cg([ud(0,!0)],Yg.prototype,"x",void 0),cg([ud(0,!0)],Yg.prototype,"y",void 0),cg([vd(100,!0)],Yg.prototype,"width",void 0),cg([vd(100,!0)],Yg.prototype,"height",void 0),cg([fd(1,!0)],Yg.prototype,"scaleX",void 0),cg([fd(1,!0)],Yg.prototype,"scaleY",void 0),cg([gd(0,!0)],Yg.prototype,"rotation",void 0),cg([gd(0,!0)],Yg.prototype,"skewX",void 0),cg([gd(0,!0)],Yg.prototype,"skewY",void 0),cg([ud(0,!0)],Yg.prototype,"offsetX",void 0),cg([ud(0,!0)],Yg.prototype,"offsetY",void 0),cg([dd(0,!0)],Yg.prototype,"scrollX",void 0),cg([dd(0,!0)],Yg.prototype,"scrollY",void 0),cg([pd()],Yg.prototype,"origin",void 0),cg([pd()],Yg.prototype,"around",void 0),cg([cd(!1)],Yg.prototype,"lazy",void 0),cg([function(t){return hd(t,t=>({set(e){this.__setAttr(t,e)&&(_d(this),this.__.__removeNaturalSize())}}))}(1)],Yg.prototype,"pixelRatio",void 0),cg([wd(0)],Yg.prototype,"renderSpread",void 0),cg([function(t){return hd(t,t=>({set(e){const n=this.__;2!==n.__pathInputed&&(n.__pathInputed=e?1:0),e||(n.__pathForRender=void 0),this.__setAttr(t,e),_d(this)}}))}()],Yg.prototype,"path",void 0),cg([md()],Yg.prototype,"windingRule",void 0),cg([md(!0)],Yg.prototype,"closed",void 0),cg([vd(0)],Yg.prototype,"padding",void 0),cg([vd(!1)],Yg.prototype,"lockRatio",void 0),cg([vd()],Yg.prototype,"widthRange",void 0),cg([vd()],Yg.prototype,"heightRange",void 0),cg([cd(!1)],Yg.prototype,"draggable",void 0),cg([cd()],Yg.prototype,"dragBounds",void 0),cg([cd("auto")],Yg.prototype,"dragBoundsType",void 0),cg([cd(!1)],Yg.prototype,"editable",void 0),cg([Ed(!0)],Yg.prototype,"hittable",void 0),cg([Ed("path")],Yg.prototype,"hitFill",void 0),cg([bd("path")],Yg.prototype,"hitStroke",void 0),cg([Ed(!1)],Yg.prototype,"hitBox",void 0),cg([Ed(!0)],Yg.prototype,"hitChildren",void 0),cg([Ed(!0)],Yg.prototype,"hitSelf",void 0),cg([Ed()],Yg.prototype,"hitRadius",void 0),cg([function(t){return hd(t,t=>({set(e){this.__setAttr(t,e),this.leafer&&this.leafer.updateCursor()}}))}("")],Yg.prototype,"cursor",void 0),cg([xd()],Yg.prototype,"fill",void 0),cg([bd(void 0,!0)],Yg.prototype,"stroke",void 0),cg([bd("inside")],Yg.prototype,"strokeAlign",void 0),cg([bd(1,!0)],Yg.prototype,"strokeWidth",void 0),cg([bd(!1)],Yg.prototype,"strokeScaleFixed",void 0),cg([bd("none")],Yg.prototype,"strokeCap",void 0),cg([bd("miter")],Yg.prototype,"strokeJoin",void 0),cg([bd()],Yg.prototype,"dashPattern",void 0),cg([bd(0)],Yg.prototype,"dashOffset",void 0),cg([bd(10)],Yg.prototype,"miterLimit",void 0),cg([md(0)],Yg.prototype,"cornerRadius",void 0),cg([md()],Yg.prototype,"cornerSmoothing",void 0),cg([ug()],Yg.prototype,"shadow",void 0),cg([ug()],Yg.prototype,"innerShadow",void 0),cg([ug()],Yg.prototype,"blur",void 0),cg([ug()],Yg.prototype,"backgroundBlur",void 0),cg([ug()],Yg.prototype,"grayscale",void 0),cg([ug()],Yg.prototype,"filter",void 0),cg([xd()],Yg.prototype,"placeholderColor",void 0),cg([cd(100)],Yg.prototype,"placeholderDelay",void 0),cg([cd({})],Yg.prototype,"data",void 0),cg([Rd(Zf.prototype.reset)],Yg.prototype,"reset",null),Yg=Hg=cg([Dd(zg),Dd(jg),Ad()],Yg);var Xg,Gg=class extends Yg{get __tag(){return"Group"}get isBranch(){return!0}reset(t){this.__setBranch(),super.reset(t)}__setBranch(){this.children||(this.children=[])}set(t,e){if(t)if(t.children){const{children:n}=t;delete t.children,this.children?this.clear():this.__setBranch(),super.set(t,e),n.forEach(t=>this.add(t)),t.children=n}else super.set(t,e)}toJSON(t){const e=super.toJSON(t);if(!this.childlessJSON){const n=e.children=[];this.children.forEach(e=>e.skipJSON||n.push(e.toJSON(t)))}return e}pick(t,e){}addAt(t,e){this.add(t,e)}addAfter(t,e){this.add(t,this.children.indexOf(e)+1)}addBefore(t,e){this.add(t,this.children.indexOf(e))}add(t,e){}addMany(...t){}remove(t,e){}removeAll(t){}clear(){}};cg([Od(Rg)],Gg.prototype,"__",void 0),cg([vd(0)],Gg.prototype,"width",void 0),cg([vd(0)],Gg.prototype,"height",void 0),Gg=cg([Dd(ag),Id()],Gg);var $g=nl.get("Leafer"),Kg=Xg=class extends Gg{get __tag(){return"Leafer"}get isApp(){return!1}get app(){return this.parent||this}get isLeafer(){return!0}get imageReady(){return this.viewReady&&td.isComplete}get layoutLocked(){return!this.layouter.running}get view(){return this.canvas&&this.canvas.view}get FPS(){return this.renderer?this.renderer.FPS:60}get cursorPoint(){return this.interaction&&this.interaction.hoverData||{x:this.width/2,y:this.height/2}}get clientBounds(){return this.canvas&&this.canvas.getClientBounds(!0)||{x:0,y:0,width:0,height:0}}constructor(t,e){super(e),this.config={start:!0,hittable:!0,smooth:!0,lazySpeard:100},this.leafs=0,this.__eventIds=[],this.__controllers=[],this.__readyWait=[],this.__viewReadyWait=[],this.__viewCompletedWait=[],this.__nextRenderWait=[],this.userConfig=t,t&&(t.view||t.width)&&this.init(t),Xg.list.add(this)}init(t,e){if(this.canvas)return;let n;const{config:i}=this;this.__setLeafer(this),e&&(this.parentApp=e,this.__bindApp(e),n=e.running),t&&(this.parent=e,this.initType(t.type),this.parent=void 0,bs.assign(i,t));const r=this.canvas=cl.canvas(i);this.__controllers.push(this.renderer=cl.renderer(this,r,i),this.watcher=cl.watcher(this,i),this.layouter=cl.layouter(this,i)),this.isApp&&this.__setApp(),this.__checkAutoLayout(),e||(this.selector=cl.selector(this),this.interaction=cl.interaction(this,r,this.selector,i),this.interaction&&(this.__controllers.unshift(this.interaction),this.hitCanvasManager=cl.hitCanvasManager()),this.canvasManager=new _l,n=i.start),this.hittable=i.hittable,this.fill=i.fill,this.canvasManager.add(r),this.__listenEvents(),n&&(this.__startTimer=setTimeout(this.start.bind(this))),pp.run(this.__initWait),this.onInit()}onInit(){}initType(t){}set(t,e){this.waitInit(()=>{super.set(t,e)})}start(){clearTimeout(this.__startTimer),!this.running&&this.canvas&&(this.running=!0,this.ready?this.emitLeafer(Np.RESTART):this.emitLeafer(Np.START),this.__controllers.forEach(t=>t.start()),this.isApp||this.renderer.render())}stop(){clearTimeout(this.__startTimer),this.running&&this.canvas&&(this.__controllers.forEach(t=>t.stop()),this.running=!1,this.emitLeafer(Np.STOP))}unlockLayout(t=!0){this.layouter.start(),t&&this.updateLayout()}lockLayout(t=!0){t&&this.updateLayout(),this.layouter.stop()}resize(t){const e=bs.copyAttrs({},t,Rl);Object.keys(e).forEach(t=>this[t]=e[t])}forceRender(t,e){const{renderer:n}=this;n&&(n.addBlock(t?new Xa(t):this.canvas.bounds),this.viewReady&&(e?n.render():n.update()))}requestRender(t=!1){this.renderer&&this.renderer.update(t)}updateCursor(t){const e=this.interaction;e&&(t?e.setCursor(t):e.updateCursor())}updateLazyBounds(){this.lazyBounds=this.canvas.bounds.clone().spread(this.config.lazySpeard)}__doResize(t){const{canvas:e}=this;if(!e||e.isSameSize(t))return;const n=bs.copyAttrs({},this.canvas,Rl);e.resize(t),this.updateLazyBounds(),this.__onResize(new Ip(t,n))}__onResize(t){this.emitEvent(t),bs.copyAttrs(this.__,t,Rl),setTimeout(()=>{this.canvasManager&&this.canvasManager.clearRecycled()},0)}__setApp(){}__bindApp(t){this.selector=t.selector,this.interaction=t.interaction,this.canvasManager=t.canvasManager,this.hitCanvasManager=t.hitCanvasManager}__setLeafer(t){this.leafer=t,this.__level=1}__checkAutoLayout(){const{config:t,parentApp:e}=this;e||(t.width&&t.height||(this.autoLayout=new $a(t)),this.canvas.startAutoLayout(this.autoLayout,this.__onResize.bind(this)))}__setAttr(t,e){return this.canvas&&(Rl.includes(t)?this.__changeCanvasSize(t,e):"fill"===t?this.__changeFill(e):"hittable"===t?this.parent||(this.canvas.hittable=e):"zIndex"===t?(this.canvas.zIndex=e,setTimeout(()=>this.parent&&this.parent.__updateSortChildren())):"mode"===t&&this.emit(Np.UPDATE_MODE,{mode:e})),super.__setAttr(t,e)}__getAttr(t){return this.canvas&&Rl.includes(t)?this.canvas[t]:super.__getAttr(t)}__changeCanvasSize(t,e){const{config:n,canvas:i}=this,r=bs.copyAttrs({},i,Rl);r[t]=n[t]=e,n.width&&n.height?i.stopAutoLayout():this.__checkAutoLayout(),this.__doResize(r)}__changeFill(t){this.config.fill=t,this.canvas.allowBackgroundColor?this.canvas.backgroundColor=t:this.forceRender()}__onCreated(){this.created=!0}__onReady(){this.ready=!0,this.emitLeafer(Np.BEFORE_READY),this.emitLeafer(Np.READY),this.emitLeafer(Np.AFTER_READY),pp.run(this.__readyWait)}__onViewReady(){this.viewReady||(this.viewReady=!0,this.emitLeafer(Np.VIEW_READY),pp.run(this.__viewReadyWait))}__onLayoutEnd(){const{grow:t,width:e,height:n}=this.config;if(t){let{width:i,height:r,pixelRatio:o}=this;const s="box"===t?this.worldBoxBounds:this.__world;e||(i=Math.max(1,s.x+s.width)),n||(r=Math.max(1,s.y+s.height)),this.__doResize({width:i,height:r,pixelRatio:o})}this.ready||this.__onReady()}__onNextRender(){if(this.viewReady){pp.run(this.__nextRenderWait);const{imageReady:t}=this;t&&!this.viewCompleted&&this.__checkViewCompleted(),t||(this.viewCompleted=!1,this.requestRender())}else this.requestRender()}__checkViewCompleted(t=!0){this.nextRender(()=>{this.imageReady&&(t&&this.emitLeafer(Np.VIEW_COMPLETED),pp.run(this.__viewCompletedWait),this.viewCompleted=!0)})}__onWatchData(){this.watcher.childrenChanged&&this.interaction&&this.nextRender(()=>this.interaction.updateCursor())}waitInit(t,e){e&&(t=t.bind(e)),this.__initWait||(this.__initWait=[]),this.canvas?t():this.__initWait.push(t)}waitReady(t,e){e&&(t=t.bind(e)),this.ready?t():this.__readyWait.push(t)}waitViewReady(t,e){e&&(t=t.bind(e)),this.viewReady?t():this.__viewReadyWait.push(t)}waitViewCompleted(t,e){e&&(t=t.bind(e)),this.__viewCompletedWait.push(t),this.viewCompleted?this.__checkViewCompleted(!1):this.running||this.start()}nextRender(t,e,n){e&&(t=t.bind(e));const i=this.__nextRenderWait;if(n){for(let r=0;r<i.length;r++)if(i[r]===t){i.splice(r,1);break}}else i.push(t);this.requestRender()}zoom(t,e,n,i){return hl.need("view")}getValidMove(t,e,n){return{x:t,y:e}}getValidScale(t){return t}getWorldPointByClient(t,e){return this.interaction&&this.interaction.getLocal(t,e)}getPagePointByClient(t,e){return this.getPagePoint(this.getWorldPointByClient(t,e))}getClientPointByWorld(t){const{x:e,y:n}=this.clientBounds;return{x:e+t.x,y:n+t.y}}updateClientBounds(){this.canvas&&this.canvas.updateClientBounds()}receiveEvent(t){}emitLeafer(t){this.emitEvent(new Np(t,this))}__listenEvents(){const t=sl.start("FirstCreate "+this.innerName);this.once([[Np.START,()=>sl.end(t)],[Wp.START,this.updateLazyBounds,this],[zp.START,this.__onCreated,this],[zp.END,this.__onViewReady,this]]),this.__eventIds.push(this.on_([[Fp.DATA,this.__onWatchData,this],[Wp.END,this.__onLayoutEnd,this],[zp.NEXT,this.__onNextRender,this]]))}__removeListenEvents(){this.off_(this.__eventIds)}destroy(t){const e=()=>{if(!this.destroyed){Xg.list.remove(this);try{this.stop(),this.emitLeafer(Np.END),this.__removeListenEvents(),this.__controllers.forEach(t=>!(this.parent&&t===this.interaction)&&t.destroy()),this.__controllers.length=0,this.parent||(this.selector&&this.selector.destroy(),this.hitCanvasManager&&this.hitCanvasManager.destroy(),this.canvasManager&&this.canvasManager.destroy()),this.canvas&&this.canvas.destroy(),this.config.view=this.parentApp=null,this.userConfig&&(this.userConfig.view=null),super.destroy(),setTimeout(()=>{nd.clearRecycled()},100)}catch(t){$g.error(t)}}};t?e():setTimeout(e)}};Kg.list=new lg,cg([Od(class extends Rg{__getInputData(t,e){const n=super.__getInputData(t,e);return Rl.forEach(t=>delete n[t]),n}})],Kg.prototype,"__",void 0),cg([vd()],Kg.prototype,"pixelRatio",void 0),cg([cd("normal")],Kg.prototype,"mode",void 0),Kg=Xg=cg([Id()],Kg);var qg=class extends Yg{get __tag(){return"Rect"}};cg([Od(Dg)],qg.prototype,"__",void 0),qg=cg([Dd(Ug),Ad(),Id()],qg);var{add:Zg,includes:Jg,scroll:Qg}=Va,tv=qg.prototype,ev=Gg.prototype,nv=class extends Gg{get __tag(){return"Box"}get isBranchLeaf(){return!0}get __useSelfBox(){return this.pathInputed}constructor(t){super(t),this.__layout.renderChanged||this.__layout.renderChange()}__updateStrokeSpread(){return 0}__updateRectRenderSpread(){return 0}__updateRenderSpread(){return this.__updateRectRenderSpread()||-1}__updateRectBoxBounds(){}__updateBoxBounds(t){if(this.children.length&&!this.__useSelfBox){const t=this.__;if(t.__autoSide){t.__hasSurface&&this.__extraUpdate(),super.__updateBoxBounds();const{boxBounds:e}=this.__layout;t.__autoSize||(t.__autoWidth?(e.width+=e.x,e.x=0,e.height=t.height,e.y=0):(e.height+=e.y,e.y=0,e.width=t.width,e.x=0)),this.__updateNaturalSize()}else this.__updateRectBoxBounds()}else this.__updateRectBoxBounds()}__updateStrokeBounds(){}__updateRenderBounds(){let t,e;if(this.children.length){const n=this.__,i=this.__layout,{renderBounds:r,boxBounds:o}=i,{overflow:s}=n,a=i.childrenRenderBounds||(i.childrenRenderBounds={x:0,y:0,width:0,height:0});super.__updateRenderBounds(a),(e=s&&s.includes("scroll"))&&(Zg(a,o),Qg(a,n)),this.__updateRectRenderBounds(),t=!Jg(o,a),t&&"show"===s&&Zg(r,a)}else this.__updateRectRenderBounds();bs.stintSet(this,"isOverflow",t),this.__checkScroll(e)}__updateRectRenderBounds(){}__checkScroll(t){}__updateRectChange(){}__updateChange(){super.__updateChange(),this.__updateRectChange()}__renderRect(t,e){}__renderGroup(t,e){}__render(t,e){this.__.__drawAfterFill?this.__renderRect(t,e):(this.__renderRect(t,e),this.children.length&&this.__renderGroup(t,e)),this.hasScroller&&this.scroller.__render(t,e)}__drawContent(t,e){this.__renderGroup(t,e),(this.__.__useStroke||this.__.__useEffect)&&(t.setWorld(this.__nowWorld),this.__drawRenderPath(t))}};cg([Od(Ag)],nv.prototype,"__",void 0),cg([vd(100)],nv.prototype,"width",void 0),cg([vd(100)],nv.prototype,"height",void 0),cg([cd(!1)],nv.prototype,"resizeChildren",void 0),cg([wd("show")],nv.prototype,"overflow",void 0),cg([Rd(tv.__updateStrokeSpread)],nv.prototype,"__updateStrokeSpread",null),cg([Rd(tv.__updateRenderSpread)],nv.prototype,"__updateRectRenderSpread",null),cg([Rd(tv.__updateBoxBounds)],nv.prototype,"__updateRectBoxBounds",null),cg([Rd(tv.__updateStrokeBounds)],nv.prototype,"__updateStrokeBounds",null),cg([Rd(tv.__updateRenderBounds)],nv.prototype,"__updateRectRenderBounds",null),cg([Rd(tv.__updateChange)],nv.prototype,"__updateRectChange",null),cg([Rd(tv.__render)],nv.prototype,"__renderRect",null),cg([Rd(ev.__render)],nv.prototype,"__renderGroup",null),nv=cg([Ad(),Id()],nv);var iv=class extends nv{get __tag(){return"Frame"}get isFrame(){return!0}};cg([Od(class extends Ag{})],iv.prototype,"__",void 0),cg([xd("#FFFFFF")],iv.prototype,"fill",void 0),cg([wd("hide")],iv.prototype,"overflow",void 0),iv=cg([Id()],iv);var{moveTo:rv,closePath:ov,ellipse:sv}=Pc,av=class extends Yg{get __tag(){return"Ellipse"}__updatePath(){const t=this.__,{width:e,height:n,innerRadius:i,startAngle:r,endAngle:o}=t,s=e/2,a=n/2,l=t.path=[];let h;i?r||o?(i<1?sv(l,s,a,s*i,a*i,0,r,o,!1):h=!0,sv(l,s,a,s,a,0,o,r,!0)):(i<1&&(sv(l,s,a,s*i,a*i),rv(l,e,a)),sv(l,s,a,s,a,0,360,0,!0)):r||o?(rv(l,s,a),sv(l,s,a,s,a,0,r,o,!1)):sv(l,s,a,s,a),h||ov(l),(Qa.ellipseToCurve||t.__useArrow||t.cornerRadius)&&(t.path=this.getPath(!0))}};cg([Od(class extends Tg{get __boxStroke(){return!this.__pathInputed}})],av.prototype,"__",void 0),cg([md(0)],av.prototype,"innerRadius",void 0),cg([md(0)],av.prototype,"startAngle",void 0),cg([md(0)],av.prototype,"endAngle",void 0),av=cg([Id()],av);var{sin:lv,cos:hv,PI:cv}=Math,{moveTo:uv,lineTo:dv,closePath:pv,drawPoints:fv}=Pc,gv=class extends Yg{get __tag(){return"Polygon"}__updatePath(){const t=this.__,e=t.path=[];if(t.points)fv(e,t.points,t.curve,t.closed);else{const{width:n,height:i,sides:r,startAngle:o}=t,s=n/2,a=i/2;let l,h=0;o?(h=o*Ns,uv(e,s+s*lv(h),a-a*hv(h))):uv(e,s,0);for(let t=1;t<r;t++)l=2*t*cv/r+h,dv(e,s+s*lv(l),a-a*hv(l));pv(e)}}};cg([Od(class extends Mg{})],gv.prototype,"__",void 0),cg([md(3)],gv.prototype,"sides",void 0),cg([md(0)],gv.prototype,"startAngle",void 0),cg([md()],gv.prototype,"points",void 0),cg([md(0)],gv.prototype,"curve",void 0),gv=cg([Ad(),Id()],gv);var{sin:vv,cos:_v,PI:mv}=Math,{moveTo:yv,lineTo:bv,closePath:wv}=Pc,xv=class extends Yg{get __tag(){return"Star"}__updatePath(){const{width:t,height:e,corners:n,innerRadius:i,startAngle:r}=this.__,o=t/2,s=e/2,a=this.__.path=[];let l,h=0;r?(h=r*Ns,yv(a,o+o*vv(h),s-s*_v(h))):yv(a,o,0);for(let c=1;c<2*n;c++)l=c*mv/n+h,bv(a,o+(c%2==0?o:o*i)*vv(l),s-(c%2==0?s:s*i)*_v(l));wv(a)}};cg([Od(class extends Tg{get __boxStroke(){return!this.__pathInputed}})],xv.prototype,"__",void 0),cg([md(5)],xv.prototype,"corners",void 0),cg([md(.382)],xv.prototype,"innerRadius",void 0),cg([md(0)],xv.prototype,"startAngle",void 0),xv=cg([Id()],xv);var{moveTo:Sv,lineTo:kv,drawPoints:Cv}=Pc,{rotate:Ev,getAngle:Ov,getDistance:Lv,defaultPoint:Pv}=ua,Tv=class extends Yg{get __tag(){return"Line"}get toPoint(){const{width:t,rotation:e}=this.__,n={x:0,y:0};return t&&(n.x=t),e&&Ev(n,e),n}set toPoint(t){this.width=Lv(Pv,t),this.rotation=Ov(Pv,t),this.height&&(this.height=0)}__updatePath(){const t=this.__,e=t.path=[];t.points?Cv(e,t.points,t.curve,t.closed):(Sv(e,0,0),kv(e,this.width,0))}};cg([Od(Mg)],Tv.prototype,"__",void 0),cg([yd("center")],Tv.prototype,"strokeAlign",void 0),cg([vd(0)],Tv.prototype,"height",void 0),cg([md()],Tv.prototype,"points",void 0),cg([md(0)],Tv.prototype,"curve",void 0),cg([md(!1)],Tv.prototype,"closed",void 0),Tv=cg([Id()],Tv);var Bv=class extends qg{get __tag(){return"Image"}get ready(){const{image:t}=this;return t&&t.ready}get image(){const{fill:t}=this.__;return gs(t)&&t[0].image}};cg([Od(class extends Dg{get __urlType(){return"image"}setUrl(t){this.__setImageFill(t),this._url=t}__setImageFill(t){this.fill=t?{type:this.__urlType,mode:"stretch",url:t}:void 0}__getData(){const t=super.__getData();return t.url&&delete t.fill,t}__getInputData(t,e){const n=super.__getInputData(t,e);return n.url&&delete n.fill,n}})],Bv.prototype,"__",void 0),cg([vd("")],Bv.prototype,"url",void 0),Bv=cg([Id()],Bv);var Rv=class extends qg{get __tag(){return"Canvas"}get context(){return this.canvas.context}get ready(){return!this.url}constructor(t){super(t),this.canvas=cl.canvas(this.__),t&&t.url&&this.drawImage(t.url)}drawImage(t){new sd({url:t}).load(t=>{this.context.drawImage(t.view,0,0),this.url=void 0,this.paint(),this.emitEvent(new Pp(Pp.LOADED,{image:t}))})}draw(t,e,n,i){const r=new ma(t.worldTransform).invert(),o=new ma;e&&o.translate(e.x,e.y),n&&(fs(n)?o.scale(n):o.scale(n.x,n.y)),i&&o.rotate(i),r.multiplyParent(o),t.__render(this.canvas,{matrix:r.withScale()}),this.paint()}paint(){this.forceRender()}__drawContent(t,e){const{width:n,height:i}=this.__,{view:r}=this.canvas;t.drawImage(r,0,0,r.width,r.height,0,0,n,i)}__updateSize(){const{canvas:t}=this;if(t){const{smooth:e,safeResize:n}=this.__;t.resize(this.__,n),t.smooth!==e&&(t.smooth=e)}}destroy(){this.canvas&&(this.canvas.destroy(),this.canvas=null),super.destroy()}};cg([Od(class extends Dg{get __isCanvas(){return!0}get __drawAfterFill(){return!0}__getInputData(t,e){const n=super.__getInputData(t,e);return n.url=this.__leaf.canvas.toDataURL("image/png"),n}})],Rv.prototype,"__",void 0),cg([dg(100)],Rv.prototype,"width",void 0),cg([dg(100)],Rv.prototype,"height",void 0),cg([dg(1)],Rv.prototype,"pixelRatio",void 0),cg([dg(!0)],Rv.prototype,"smooth",void 0),cg([cd(!1)],Rv.prototype,"safeResize",void 0),cg([dg()],Rv.prototype,"contextSettings",void 0),Rv=cg([Id()],Rv);var{copyAndSpread:Av,includes:Mv,spread:Dv,setList:Iv}=Va,{stintSet:Fv}=bs,Wv=class extends Yg{get __tag(){return"Text"}get textDrawData(){return this.updateLayout(),this.__.__textDrawData}__updateTextDrawData(){const t=this.__,{lineHeight:e,letterSpacing:n,fontFamily:i,fontSize:r,fontWeight:o,italic:s,textCase:a,textOverflow:l,padding:h,width:c,height:u}=t;t.__lineHeight=gg.number(e,r),t.__letterSpacing=gg.number(n,r),t.__baseLine=t.__lineHeight-(t.__lineHeight-.7*r)/2,t.__font=`${s?"italic ":""}${"small-caps"===a?"small-caps ":""}${"normal"!==o?o+" ":""}${r||12}px ${i||"caption"}`,Fv(t,"__padding",h&&Ws.fourNumber(h)),Fv(t,"__clipText","show"!==l&&!t.__autoSize),Fv(t,"__isCharMode",c||u||t.__letterSpacing||"none"!==a),t.__textDrawData=pg.getDrawData((t.__isPlacehold=t.placeholder&&""===t.text)?t.placeholder:t.text,this.__)}__updateBoxBounds(){const t=this.__,e=this.__layout,{fontSize:n,italic:i,padding:r,__autoWidth:o,__autoHeight:s}=t;this.__updateTextDrawData();const{bounds:a}=t.__textDrawData,l=e.boxBounds;if(e.contentBounds=a,t.__lineHeight<n&&Dv(a,n/2),o||s){if(l.x=o?a.x:0,l.y=s?a.y:0,l.width=o?a.width:t.width,l.height=s?a.height:t.height,r){const[e,n,i,r]=t.__padding;o&&(l.x-=r,l.width+=n+r),s&&(l.y-=e,l.height+=i+e)}this.__updateNaturalSize()}else super.__updateBoxBounds();i&&(l.width+=.16*n),bs.stintSet(this,"isOverflow",!Mv(l,a)),this.isOverflow?(Iv(t.__textBoxBounds={},[l,a]),e.renderChanged=!0):t.__textBoxBounds=l}__updateRenderSpread(){let t=super.__updateRenderSpread();return t||(t=this.isOverflow?1:0),t}__updateRenderBounds(){const{renderBounds:t,renderSpread:e}=this.__layout;Av(t,this.__.__textBoxBounds,e),this.__box&&(this.__box.__layout.renderBounds=t)}__updateChange(){super.__updateChange();const t=this.__box;t&&(t.__onUpdateSize(),t.__updateChange())}__drawRenderPath(t){t.font=this.__.__font}__draw(t,e,n){const i=this.__box;i&&(i.__nowWorld=this.__nowWorld,i.__draw(t,e,n)),this.textEditing&&!e.exporting||super.__draw(t,e,n)}__drawShape(t,e){e.shape&&this.__box&&this.__box.__drawShape(t,e),super.__drawShape(t,e)}destroy(){this.boxStyle&&(this.boxStyle=null),super.destroy()}};cg([Od(class extends Tg{get __useNaturalRatio(){return!1}setFontWeight(t){ds(t)?(this.__setInput("fontWeight",t),t=Ig[t]||400):this.__input&&this.__removeInput("fontWeight"),this._fontWeight=t}setBoxStyle(t){let e=this.__leaf,n=e.__box;if(t){const{boxStyle:i}=this;if(n)for(let t in i)n[t]=void 0;else n=e.__box=dl.get("Rect",0);const r=e.__layout,o=n.__layout;i||(n.parent=e,n.__world=e.__world,o.boxBounds=r.boxBounds),n.set(t),o.strokeChanged&&r.strokeChange()}else n&&(e.__box=n.parent=null,n.destroy());this._boxStyle=t}__getInputData(t,e){const n=super.__getInputData(t,e);return n.textEditing&&delete n.textEditing,n}})],Wv.prototype,"__",void 0),cg([vd(0)],Wv.prototype,"width",void 0),cg([vd(0)],Wv.prototype,"height",void 0),cg([xd()],Wv.prototype,"boxStyle",void 0),cg([cd(!1)],Wv.prototype,"resizeFontSize",void 0),cg([xd("#000000")],Wv.prototype,"fill",void 0),cg([yd("outside")],Wv.prototype,"strokeAlign",void 0),cg([Ed("all")],Wv.prototype,"hitFill",void 0),cg([vd("")],Wv.prototype,"text",void 0),cg([vd("")],Wv.prototype,"placeholder",void 0),cg([vd("caption")],Wv.prototype,"fontFamily",void 0),cg([vd(12)],Wv.prototype,"fontSize",void 0),cg([vd("normal")],Wv.prototype,"fontWeight",void 0),cg([vd(!1)],Wv.prototype,"italic",void 0),cg([vd("none")],Wv.prototype,"textCase",void 0),cg([vd("none")],Wv.prototype,"textDecoration",void 0),cg([vd(0)],Wv.prototype,"letterSpacing",void 0),cg([vd({type:"percent",value:1.5})],Wv.prototype,"lineHeight",void 0),cg([vd(0)],Wv.prototype,"paraIndent",void 0),cg([vd(0)],Wv.prototype,"paraSpacing",void 0),cg([vd("x")],Wv.prototype,"writingMode",void 0),cg([vd("left")],Wv.prototype,"textAlign",void 0),cg([vd("top")],Wv.prototype,"verticalAlign",void 0),cg([vd(!0)],Wv.prototype,"autoSizeAlign",void 0),cg([vd("normal")],Wv.prototype,"textWrap",void 0),cg([vd("show")],Wv.prototype,"textOverflow",void 0),cg([xd(!1)],Wv.prototype,"textEditing",void 0),Wv=cg([Id()],Wv);var zv=class extends Yg{get __tag(){return"Path"}};cg([Od(class extends Tg{get __pathInputed(){return 2}})],zv.prototype,"__",void 0),cg([yd("center")],zv.prototype,"strokeAlign",void 0),zv=cg([Id()],zv);var Nv=class extends Gg{get __tag(){return"Pen"}setStyle(t){const e=this.pathElement=new zv(t);return this.pathStyle=t,this.__path=e.path||(e.path=[]),this.add(e),this}beginPath(){return this}moveTo(t,e){return this}lineTo(t,e){return this}bezierCurveTo(t,e,n,i,r,o){return this}quadraticCurveTo(t,e,n,i){return this}closePath(){return this}rect(t,e,n,i){return this}roundRect(t,e,n,i,r){return this}ellipse(t,e,n,i,r,o,s,a){return this}arc(t,e,n,i,r,o){return this}arcTo(t,e,n,i,r){return this}drawEllipse(t,e,n,i,r,o,s,a){return this}drawArc(t,e,n,i,r,o){return this}drawPoints(t,e,n){return this}clearPath(){return this}paint(){const{pathElement:t}=this;t.__layout.boxChanged||t.forceUpdate("path")}};function jv(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s}cg([Od(class extends Rg{})],Nv.prototype,"__",void 0),cg([(t,e)=>{ad(t,e,{get(){return this.__path}})}],Nv.prototype,"path",void 0),Nv=cg([Dd(Xc,["set","path","paint"]),Id()],Nv);var Vv=class extends Kg{get __tag(){return"App"}get isApp(){return!0}constructor(t,e){super(t,e)}init(t,e){if(super.init(t,e),t){const{ground:e,tree:n,sky:i,editor:r}=t;e&&(this.ground=this.addLeafer(e)),(n||r)&&(this.tree=this.addLeafer(n||{type:t.type||"design"})),(i||r)&&(this.sky=this.addLeafer(i)),r&&cl.editor(r,this)}}__setApp(){const{canvas:t}=this,{realCanvas:e,view:n}=this.config;e||n===this.canvas.view||!t.parentView?this.realCanvas=!0:t.unrealCanvas(),this.leafer=this,this.watcher.disable(),this.layouter.disable()}__updateLocalBounds(){this.forEach(t=>t.updateLayout()),super.__updateLocalBounds()}start(){super.start(),this.forEach(t=>t.start())}stop(){this.forEach(t=>t.stop()),super.stop()}unlockLayout(){super.unlockLayout(),this.forEach(t=>t.unlockLayout())}lockLayout(){super.lockLayout(),this.forEach(t=>t.lockLayout())}forceRender(t,e){this.forEach(n=>n.forceRender(t,e))}addLeafer(t){const e=new Kg(t);return this.add(e),e}add(t,e){if(!t.view){if(this.realCanvas&&!this.canvas.bounds)return void setTimeout(()=>this.add(t,e),10);t.init(this.__getChildConfig(t.userConfig),this)}super.add(t,e),cs(e)||(t.canvas.childIndex=e),this.__listenChildEvents(t)}forEach(t){this.children.forEach(t)}__onCreated(){this.created=this.children.every(t=>t.created)}__onReady(){this.children.every(t=>t.ready)&&super.__onReady()}__onViewReady(){this.children.every(t=>t.viewReady)&&super.__onViewReady()}__onChildRenderEnd(t){this.renderer.addBlock(t.renderBounds),this.viewReady&&this.renderer.update()}__render(t,e){t.context&&this.forEach(n=>e.matrix?n.__render(t,e):t.copyWorld(n.canvas,e.bounds,void 0,void 0,!0))}__onResize(t){this.forEach(e=>e.resize(t)),super.__onResize(t)}updateLayout(){this.forEach(t=>t.updateLayout())}__getChildConfig(t){const e=Object.assign({},this.config);return e.hittable=e.realCanvas=void 0,t&&bs.assign(e,t),this.autoLayout&&bs.copyAttrs(e,this,Rl),e.view=this.realCanvas?void 0:this.view,e.fill=void 0,e}__listenChildEvents(t){t.once([[Wp.END,this.__onReady,this],[zp.START,this.__onCreated,this],[zp.END,this.__onViewReady,this]]),this.realCanvas&&this.__eventIds.push(t.on_(zp.END,this.__onChildRenderEnd,this))}};Vv=jv([Id()],Vv);var Hv={},Uv={isHoldSpaceKey:()=>Uv.isHold("Space"),isHold:t=>Hv[t],isHoldKeys:(t,e)=>e?t(e):void 0,setDownCode(t){Hv[t]||(Hv[t]=!0)},setUpCode(t){Hv[t]=!1}},Yv={LEFT:1,RIGHT:2,MIDDLE:4,defaultLeft(t){t.buttons||(t.buttons=1)},left:t=>1===t.buttons,right:t=>2===t.buttons,middle:t=>4===t.buttons},Xv=class extends kp{get spaceKey(){return Uv.isHoldSpaceKey()}get left(){return Yv.left(this)}get right(){return Yv.right(this)}get middle(){return Yv.middle(this)}constructor(t){super(t.type),this.bubbles=!0,Object.assign(this,t)}isHoldKeys(t){return Uv.isHoldKeys(t,this)}getBoxPoint(t){return(t||this.current).getBoxPoint(this)}getInnerPoint(t){return(t||this.current).getInnerPoint(this)}getLocalPoint(t){return(t||this.current).getLocalPoint(this)}getPagePoint(){return this.current.getPagePoint(this)}getInner(t){return this.getInnerPoint(t)}getLocal(t){return this.getLocalPoint(t)}getPage(){return this.getPagePoint()}static changeName(t,e){gl.changeName(t,e)}},{min:Gv,max:$v,abs:Kv}=Math,{float:qv,sign:Zv}=Ws,{minX:Jv,maxX:Qv,minY:t_,maxY:e_}=Va,n_=new Xa,i_=new Xa,r_={limitMove(t,e){const{dragBounds:n,dragBoundsType:i}=t;n&&o_.getValidMove(t.__localBoxBounds,o_.getDragBounds(t),i,e,!0),o_.axisMove(t,e)},limitScaleOf(t,e,n,i){const{dragBounds:r,dragBoundsType:o}=t;r&&o_.getValidScaleOf(t.__localBoxBounds,o_.getDragBounds(t),o,t.getLocalPointByInner(t.getInnerPointByBox(e)),n,i,!0)},axisMove(t,e){const{draggable:n}=t;"x"===n&&(e.y=0),"y"===n&&(e.x=0)},getDragBounds(t){const{dragBounds:e}=t;return"parent"===e?t.parent.boxBounds:e},isInnerMode:(t,e,n,i)=>"inner"===n||"auto"===n&&qv(t[i])>qv(e[i]),getValidMove(t,e,n,i,r){const o=t.x+i.x,s=t.y+i.y,a=o+t.width,l=s+t.height,h=e.x+e.width,c=e.y+e.height;return r||(i=Object.assign({},i)),o_.isInnerMode(t,e,n,"width")?o>e.x?i.x+=e.x-o:a<h&&(i.x+=h-a):o<e.x?i.x+=e.x-o:a>h&&(i.x+=h-a),o_.isInnerMode(t,e,n,"height")?s>e.y?i.y+=e.y-s:l<c&&(i.y+=c-l):s<e.y?i.y+=e.y-s:l>c&&(i.y+=c-l),i.x=qv(i.x),i.y=qv(i.y),i},getValidScaleOf(t,e,n,i,r,o,s){s||(r=Object.assign({},r)),i_.set(e),n_.set(t).scaleOf(i,r.x,r.y);const a=(i.x-t.x)/t.width,l=1-a,h=(i.y-t.y)/t.height,c=1-h;let u,d,p,f,g=1,v=1;return o_.isInnerMode(t,e,n,"width")?(r.x<0&&n_.scaleOf(i,g=1/r.x,1),p=qv(n_.minX-i_.minX),f=qv(i_.maxX-n_.maxX),u=a&&p>0?1+p/(a*n_.width):1,d=l&&f>0?1+f/(l*n_.width):1,g*=$v(u,d)):(r.x<0&&((qv(Jv(t)-Jv(e))<=0||qv(Qv(e)-Qv(t))<=0)&&n_.scaleOf(i,g=1/r.x,1),n_.unsign()),p=qv(i_.minX-n_.minX),f=qv(n_.maxX-i_.maxX),u=a&&p>0?1-p/(a*n_.width):1,d=l&&f>0?1-f/(l*n_.width):1,g*=Gv(u,d)),o_.isInnerMode(t,e,n,"height")?(r.y<0&&n_.scaleOf(i,1,v=1/r.y),p=qv(n_.minY-i_.minY),f=qv(i_.maxY-n_.maxY),u=h&&p>0?1+p/(h*n_.height):1,d=c&&f>0?1+f/(c*n_.height):1,v*=$v(u,d),o&&(u=$v(Kv(g),Kv(v)),g=Zv(g)*u,v=Zv(v)*u)):(r.y<0&&((qv(t_(t)-t_(e))<=0||qv(e_(e)-e_(t))<=0)&&n_.scaleOf(i,1,v=1/r.y),n_.unsign()),p=qv(i_.minY-n_.minY),f=qv(n_.maxY-i_.maxY),u=h&&p>0?1-p/(h*n_.height):1,d=c&&f>0?1-f/(c*n_.height):1,v*=Gv(u,d)),r.x*=ps(g)?g:1,r.y*=ps(v)?v:1,r}},o_=r_,s_=class extends Xv{};s_.POINTER="pointer",s_.BEFORE_DOWN="pointer.before_down",s_.BEFORE_MOVE="pointer.before_move",s_.BEFORE_UP="pointer.before_up",s_.DOWN="pointer.down",s_.MOVE="pointer.move",s_.UP="pointer.up",s_.OVER="pointer.over",s_.OUT="pointer.out",s_.ENTER="pointer.enter",s_.LEAVE="pointer.leave",s_.TAP="tap",s_.DOUBLE_TAP="double_tap",s_.CLICK="click",s_.DOUBLE_CLICK="double_click",s_.LONG_PRESS="long_press",s_.LONG_TAP="long_tap",s_.MENU="pointer.menu",s_.MENU_TAP="pointer.menu_tap";s_=jv([Fd()],s_);var a_={},l_=class extends s_{static setList(t){this.list=t instanceof lg?t:new lg(t)}static setData(t){this.data=t}static getValidMove(t,e,n,i=!0){const r=t.getLocalPoint(n,null,!0);return ua.move(r,e.x-t.x,e.y-t.y),i&&this.limitMove(t,r),r_.axisMove(t,r),r}static limitMove(t,e){r_.limitMove(t,e)}getPageMove(t){return this.assignMove(t),this.current.getPagePoint(a_,null,!0)}getInnerMove(t,e){return t||(t=this.current),this.assignMove(e),t.getInnerPoint(a_,null,!0)}getLocalMove(t,e){return t||(t=this.current),this.assignMove(e),t.getLocalPoint(a_,null,!0)}getPageTotal(){return this.getPageMove(!0)}getInnerTotal(t){return this.getInnerMove(t,!0)}getLocalTotal(t){return this.getLocalMove(t,!0)}getPageBounds(){const t=this.getPageTotal(),e=this.getPagePoint(),n={};return Va.set(n,e.x-t.x,e.y-t.y,t.x,t.y),Va.unsign(n),n}assignMove(t){a_.x=t?this.totalX:this.moveX,a_.y=t?this.totalY:this.moveY}};l_.BEFORE_DRAG="drag.before_drag",l_.START="drag.start",l_.DRAG="drag",l_.END="drag.end",l_.OVER="drag.over",l_.OUT="drag.out",l_.ENTER="drag.enter",l_.LEAVE="drag.leave",l_=jv([Fd()],l_);var h_=class extends s_{static setList(t){l_.setList(t)}static setData(t){l_.setData(t)}};h_.DROP="drop",h_=jv([Fd()],h_);var c_=class extends l_{};c_.BEFORE_MOVE="move.before_move",c_.START="move.start",c_.MOVE="move",c_.DRAG_ANIMATE="move.drag_animate",c_.END="move.end",c_.PULL_DOWN="move.pull_down",c_.REACH_BOTTOM="move.reach_bottom",c_=jv([Fd()],c_);var u_=class extends Xv{};u_=jv([Fd()],u_);var d_=class extends s_{};d_.BEFORE_ROTATE="rotate.before_rotate",d_.START="rotate.start",d_.ROTATE="rotate",d_.END="rotate.end",d_=jv([Fd()],d_);var p_=class extends l_{};p_.SWIPE="swipe",p_.LEFT="swipe.left",p_.RIGHT="swipe.right",p_.UP="swipe.up",p_.DOWN="swipe.down",p_=jv([Fd()],p_);var f_=class extends s_{};f_.BEFORE_ZOOM="zoom.before_zoom",f_.START="zoom.start",f_.ZOOM="zoom",f_.END="zoom.end",f_=jv([Fd()],f_);var g_=class extends Xv{};g_.BEFORE_DOWN="key.before_down",g_.BEFORE_UP="key.before_up",g_.DOWN="key.down",g_.HOLD="key.hold",g_.UP="key.up",g_=jv([Fd()],g_);var v_={getDragEventData:(t,e,n)=>Object.assign(Object.assign({},n),{x:n.x,y:n.y,moveX:n.x-e.x,moveY:n.y-e.y,totalX:n.x-t.x,totalY:n.y-t.y}),getDropEventData:(t,e,n)=>Object.assign(Object.assign({},t),{list:e,data:n}),getSwipeDirection:t=>t<-45&&t>-135?p_.UP:t>45&&t<135?p_.DOWN:t<=45&&t>=-45?p_.RIGHT:p_.LEFT,getSwipeEventData:(t,e,n)=>Object.assign(Object.assign({},n),{moveX:e.moveX,moveY:e.moveY,totalX:n.x-t.x,totalY:n.y-t.y,type:__.getSwipeDirection(ua.getAngle(t,n))}),getBase(t){const e=1===t.button?4:t.button;return{altKey:t.altKey,ctrlKey:t.ctrlKey,shiftKey:t.shiftKey,metaKey:t.metaKey,time:Date.now(),buttons:cs(t.buttons)?1:0===t.buttons?e:t.buttons,origin:t}},pathHasEventType(t,e){const{list:n}=t;for(let i=0,r=n.length;i<r;i++)if(n[i].hasEvent(e))return!0;return!1},filterPathByEventType(t,e){const n=new lg,{list:i}=t;for(let r=0,o=i.length;r<o;r++)i[r].hasEvent(e)&&n.add(i[r]);return n},pathCanDrag:t=>t&&t.list.some(t=>Kd.draggable(t)||!t.isLeafer&&t.hasEvent(l_.DRAG)),pathHasOutside:t=>t&&t.list.some(t=>t.isOutside)},__=v_,m_=new lg,{getDragEventData:y_,getDropEventData:b_,getSwipeEventData:w_}=v_,x_=class{constructor(t){this.dragDataList=[],this.interaction=t}setDragData(t){this.animateWait&&this.dragEndReal(),this.downData=this.interaction.downData,this.dragData=y_(t,t,t),this.canAnimate=this.canDragOut=!0}getList(t,e){const{proxy:n}=this.interaction.selector,i=n&&n.list.length,r=l_.list||this.draggableList||m_;return this.dragging&&(i?t?m_:new lg(e?[...n.list,...n.dragHoverExclude]:n.list):r)}checkDrag(t,e){const{interaction:n}=this;if(this.moving&&t.buttons<1)return this.canAnimate=!1,void n.pointerCancel();!this.moving&&e&&(this.moving=n.canMove(this.downData)||n.isHoldRightKey||n.isMobileDragEmpty)&&(this.dragData.moveType="drag",n.emit(c_.START,this.dragData)),this.moving||this.dragStart(t,e),this.drag(t)}dragStart(t,e){this.dragging||(this.dragging=e&&Yv.left(t),this.dragging&&(this.interaction.emit(l_.START,this.dragData),this.getDraggableList(this.dragData.path),this.setDragStartPoints(this.realDraggableList=this.getList(!0))))}setDragStartPoints(t){this.dragStartPoints={},t.forEach(t=>this.dragStartPoints[t.innerId]={x:t.x,y:t.y})}getDraggableList(t){let e;for(let n=0,i=t.length;n<i;n++)if(e=t.list[n],Kd.draggable(e)){this.draggableList=new lg(e);break}}drag(t){const{interaction:e,dragData:n,downData:i}=this,{path:r,throughPath:o}=i;this.dragData=y_(i,n,t),o&&(this.dragData.throughPath=o),this.dragData.path=r,this.dragDataList.push(this.dragData),this.moving?(t.moving=!0,this.dragData.moveType="drag",e.emit(c_.BEFORE_MOVE,this.dragData),e.emit(c_.MOVE,this.dragData)):this.dragging&&(t.dragging=!0,this.dragReal(),e.emit(l_.BEFORE_DRAG,this.dragData),e.emit(l_.DRAG,this.dragData))}dragReal(t){const{interaction:e}=this,{running:n}=e,i=this.realDraggableList;if(i.length&&n){const{totalX:n,totalY:r}=this.dragData,{dragLimitAnimate:o}=e.p,s=!o||!!t;i.forEach(e=>{if(e.draggable){const i=ds(e.draggable),a=l_.getValidMove(e,this.dragStartPoints[e.innerId],{x:n,y:r},s||i);o&&!i&&t?Kd.animateMove(e,a,fs(o)?o:.3):e.move(a)}})}}dragOverOrOut(t){const{interaction:e}=this,{dragOverPath:n}=this,{path:i}=t;this.dragOverPath=i,n?i.indexAt(0)!==n.indexAt(0)&&(e.emit(l_.OUT,t,n),e.emit(l_.OVER,t,i)):e.emit(l_.OVER,t,i)}dragEnterOrLeave(t){const{interaction:e}=this,{dragEnterPath:n}=this,{path:i}=t;e.emit(l_.LEAVE,t,n,i),e.emit(l_.ENTER,t,i,n),this.dragEnterPath=i}dragEnd(t){(this.dragging||this.moving)&&(this.checkDragEndAnimate(t)||this.dragEndReal(t))}dragEndReal(t){const{interaction:e,downData:n,dragData:i}=this;t||(t=i);const{path:r,throughPath:o}=n,s=y_(n,t,t);if(o&&(s.throughPath=o),s.path=r,this.moving&&(this.moving=!1,s.moveType="drag",e.emit(c_.END,s)),this.dragging){const r=this.getList();this.dragging=!1,e.p.dragLimitAnimate&&this.dragReal(!0),e.emit(l_.END,s),this.swipe(t,n,i,s),this.drop(t,r,this.dragEnterPath)}this.autoMoveCancel(),this.dragReset(),this.animate(null,"off")}swipe(t,e,n,i){const{interaction:r}=this;if(ua.getDistance(e,t)>r.config.pointer.swipeDistance){const t=w_(e,n,i);this.interaction.emit(t.type,t)}}drop(t,e,n){const i=b_(t,e,l_.data);i.path=n,this.interaction.emit(h_.DROP,i),this.interaction.emit(l_.LEAVE,t,n)}dragReset(){l_.list=l_.data=this.draggableList=this.dragData=this.downData=this.dragOverPath=this.dragEnterPath=null,this.dragDataList=[]}checkDragEndAnimate(t,e){return!1}animate(t,e){}stopAnimate(){}checkDragOut(t){}autoMoveOnDragOut(t){}autoMoveCancel(){}destroy(){this.dragReset()}},S_=nl.get("emit"),k_=["move","zoom","rotate","key"];function C_(t,e,n,i,r){if(k_.some(t=>e.startsWith(t))&&t.__.hitChildren&&!O_(t,r)){let o;for(let s=0,a=t.children.length;s<a;s++)o=t.children[s],!n.path.has(o)&&o.__.hittable&&E_(o,e,n,i,r)}}function E_(t,e,n,i,r){if(t.destroyed)return!1;if(t.__.hitSelf&&!O_(t,r)&&(Sg.updateEventStyle&&!i&&Sg.updateEventStyle(t,e),t.hasEvent(e,i))){n.phase=i?1:t===n.target?2:3;const r=gl.get(e,n);if(t.emitEvent(r,i),r.isStop)return!0}return!1}function O_(t,e){return e&&e.has(t)}var L_={wheel:{zoomSpeed:.5,moveSpeed:.5,rotateSpeed:.5,delta:{x:20,y:8}},pointer:{type:"pointer",snap:!0,hitRadius:5,tapTime:120,longPressTime:800,transformTime:500,hover:!0,dragHover:!0,dragDistance:2,swipeDistance:20},touch:{preventDefault:"auto"},multiTouch:{},move:{autoDistance:2},zoom:{},cursor:!0,keyEvent:!0},{pathHasEventType:P_,pathCanDrag:T_,pathHasOutside:B_}=v_,R_=class{get dragging(){return this.dragger.dragging}get transforming(){return this.transformer.transforming}get moveMode(){return!0===this.m.drag||this.isHoldSpaceKey||this.isHoldMiddleKey||this.isHoldRightKey&&this.dragger.moving||this.isDragEmpty}get canHover(){return this.p.hover&&!this.config.mobile}get isDragEmpty(){return this.m.dragEmpty&&this.isRootPath(this.hoverData)&&(!this.downData||this.isRootPath(this.downData))}get isMobileDragEmpty(){return this.m.dragEmpty&&!this.canHover&&this.downData&&this.isTreePath(this.downData)}get isHoldMiddleKey(){return this.m.holdMiddleKey&&this.downData&&Yv.middle(this.downData)}get isHoldRightKey(){return this.m.holdRightKey&&this.downData&&Yv.right(this.downData)}get isHoldSpaceKey(){return this.m.holdSpaceKey&&Uv.isHoldSpaceKey()}get m(){return this.config.move}get p(){return this.config.pointer}get hitRadius(){return this.p.hitRadius}constructor(t,e,n,i){this.config=bs.clone(L_),this.tapCount=0,this.downKeyMap={},this.target=t,this.canvas=e,this.selector=n,this.defaultPath=new lg(t),this.createTransformer(),this.dragger=new x_(this),i&&(this.config=bs.default(i,this.config)),this.__listenEvents()}start(){this.running=!0}stop(){this.running=!1}receive(t){}pointerDown(t,e){t||(t=this.hoverData),t&&(Yv.defaultLeft(t),this.updateDownData(t),this.checkPath(t,e),this.downTime=Date.now(),this.emit(s_.BEFORE_DOWN,t),t.path.needUpdate&&this.updateDownData(t),this.emit(s_.DOWN,t),Yv.left(t)&&(this.tapWait(),this.longPressWait(t)),this.waitRightTap=Yv.right(t),this.dragger.setDragData(t),this.isHoldRightKey||this.updateCursor(t))}pointerMove(t){if(t||(t=this.hoverData),!t)return;const{downData:e}=this;e&&Yv.defaultLeft(t),(this.canvas.bounds.hitPoint(t)||e)&&(this.pointerMoveReal(t),e&&this.dragger.checkDragOut(t))}pointerMoveReal(t){if(this.emit(s_.BEFORE_MOVE,t,this.defaultPath),this.downData){const e=ua.getDistance(this.downData,t)>this.p.dragDistance;e&&(this.pointerWaitCancel(),this.waitRightTap=!1),this.dragger.checkDrag(t,e)}this.dragger.moving||(this.updateHoverData(t),this.checkPath(t),this.emit(s_.MOVE,t),this.pointerHover(t),this.dragging&&(this.dragger.dragOverOrOut(t),this.dragger.dragEnterOrLeave(t))),this.updateCursor(this.downData||t)}pointerUp(t){const{downData:e}=this;if(t||(t=e),!e)return;Yv.defaultLeft(t),t.multiTouch=e.multiTouch,this.findPath(t);const n=Object.assign(Object.assign({},t),{path:t.path.clone()});t.path.addList(e.path.list),this.checkPath(t),this.downData=null,this.emit(s_.BEFORE_UP,t),this.emit(s_.UP,t),this.touchLeave(t),t.isCancel||(this.tap(t),this.menuTap(t)),this.dragger.dragEnd(t),this.updateCursor(n)}pointerCancel(){const t=Object.assign({},this.dragger.dragData);t.isCancel=!0,this.pointerUp(t)}menu(t){this.findPath(t),this.emit(s_.MENU,t),this.waitMenuTap=!0,!this.downData&&this.waitRightTap&&this.menuTap(t)}menuTap(t){this.waitRightTap&&this.waitMenuTap&&(this.emit(s_.MENU_TAP,t),this.waitRightTap=this.waitMenuTap=!1)}createTransformer(){}move(t){}zoom(t){}rotate(t){}transformEnd(){}wheel(t){}multiTouch(t,e){}keyDown(t){if(!this.config.keyEvent)return;this.emit(g_.BEFORE_DOWN,t,this.defaultPath);const{code:e}=t;this.downKeyMap[e]||(this.downKeyMap[e]=!0,Uv.setDownCode(e),this.emit(g_.HOLD,t,this.defaultPath),this.moveMode&&(this.cancelHover(),this.updateCursor())),this.emit(g_.DOWN,t,this.defaultPath)}keyUp(t){if(!this.config.keyEvent)return;this.emit(g_.BEFORE_UP,t,this.defaultPath);const{code:e}=t;this.downKeyMap[e]=!1,Uv.setUpCode(e),this.emit(g_.UP,t,this.defaultPath),"grab"===this.cursor&&this.updateCursor()}pointerHover(t){!this.canHover||this.dragging&&!this.p.dragHover||(t.path||(t.path=new lg),this.pointerOverOrOut(t),this.pointerEnterOrLeave(t))}pointerOverOrOut(t){const{path:e}=t,{overPath:n}=this;this.overPath=e,n?e.indexAt(0)!==n.indexAt(0)&&(this.emit(s_.OUT,t,n),this.emit(s_.OVER,t,e)):this.emit(s_.OVER,t,e)}pointerEnterOrLeave(t){let{path:e}=t;this.downData&&!this.moveMode&&(e=e.clone(),this.downData.path.forEach(t=>e.add(t)));const{enterPath:n}=this;this.enterPath=e,this.emit(s_.LEAVE,t,n,e),this.emit(s_.ENTER,t,e,n)}touchLeave(t){"touch"===t.pointerType&&this.enterPath&&(this.emit(s_.LEAVE,t),this.dragger.dragging&&this.emit(h_.LEAVE,t))}tap(t){const{pointer:e}=this.config,n=this.longTap(t);if(!e.tapMore&&n)return;if(!this.waitTap)return;e.tapMore&&this.emitTap(t);const i=Date.now()-this.downTime,r=[s_.DOUBLE_TAP,s_.DOUBLE_CLICK].some(e=>P_(t.path,e));i<e.tapTime+50&&r?(this.tapCount++,2===this.tapCount?(this.tapWaitCancel(),this.emitDoubleTap(t)):(clearTimeout(this.tapTimer),this.tapTimer=setTimeout(()=>{e.tapMore||(this.tapWaitCancel(),this.emitTap(t))},e.tapTime))):e.tapMore||(this.tapWaitCancel(),this.emitTap(t))}findPath(t,e){const{hitRadius:n,through:i}=this.p,{bottomList:r,target:o}=this;Qa.backgrounder||t.origin||o&&o.updateLayout();const s=this.selector.getByPoint(t,n,Object.assign({bottomList:r,name:t.type},e||{through:i}));return s.throughPath&&(t.throughPath=s.throughPath),t.path=s.path,s.path}isRootPath(t){return t&&t.path.list[0].isLeafer}isTreePath(t){const e=this.target.app;return!(!e||!e.isApp)&&e.editor&&!t.path.has(e.editor)&&t.path.has(e.tree)&&!t.target.syncEventer}checkPath(t,e){(e||this.moveMode&&!B_(t.path))&&(t.path=this.defaultPath)}canMove(t){return t&&(this.moveMode||"auto"===this.m.drag&&!T_(t.path))&&!B_(t.path)}isDrag(t){return this.dragger.getList().has(t)}isPress(t){return this.downData&&this.downData.path.has(t)}isHover(t){return this.enterPath&&this.enterPath.has(t)}isFocus(t){return this.focusData===t}cancelHover(){const{hoverData:t}=this;t&&(t.path=this.defaultPath,this.pointerHover(t))}stopDragAnimate(){this.dragger.stopAnimate()}replaceDownTarget(t){const{downData:e}=this;if(e&&t){const{path:n}=e;n.remove(n.list[0]),n.addAt(t,0)}}updateDownData(t,e,n){const{downData:i}=this;!t&&i&&(t=i),t&&(this.findPath(t,e),n&&i&&t.path.addList(i.path.list),this.downData=t)}updateHoverData(t){t||(t=this.hoverData),t&&(this.findPath(t,{exclude:this.dragger.getList(!1,!0),name:s_.MOVE}),this.hoverData=t)}updateCursor(t){if(!this.config.cursor||!this.canHover)return;if(t||(this.updateHoverData(),t=this.downData||this.hoverData),this.dragger.moving)return this.setCursor("grabbing");if(this.canMove(t))return this.setCursor(this.downData?"grabbing":"grab");if(!t)return;let e,n;const{path:i}=t;for(let r=0,o=i.length;r<o&&(e=i.list[r],n=e.syncEventer&&e.syncEventer.cursor||e.cursor,!n);r++);this.setCursor(n)}setCursor(t){this.cursor=t}getLocal(t,e){const n=this.canvas.getClientBounds(e),i={x:t.clientX-n.x,y:t.clientY-n.y},{bounds:r}=this.canvas;return i.x*=r.width/n.width,i.y*=r.height/n.height,this.p.snap&&ua.round(i),i}emitTap(t){this.emit(s_.TAP,t),this.emit(s_.CLICK,t)}emitDoubleTap(t){this.emit(s_.DOUBLE_TAP,t),this.emit(s_.DOUBLE_CLICK,t)}pointerWaitCancel(){this.tapWaitCancel(),this.longPressWaitCancel()}tapWait(){clearTimeout(this.tapTimer),this.waitTap=!0}tapWaitCancel(){this.waitTap&&(clearTimeout(this.tapTimer),this.waitTap=!1,this.tapCount=0)}longPressWait(t){clearTimeout(this.longPressTimer),this.longPressTimer=setTimeout(()=>{this.longPressed=!0,this.emit(s_.LONG_PRESS,t)},this.p.longPressTime)}longTap(t){let e;return this.longPressed&&(this.emit(s_.LONG_TAP,t),(P_(t.path,s_.LONG_TAP)||P_(t.path,s_.LONG_PRESS))&&(e=!0)),this.longPressWaitCancel(),e}longPressWaitCancel(){this.longPressTimer&&(clearTimeout(this.longPressTimer),this.longPressed=!1)}__onResize(){const{dragOut:t}=this.m;this.shrinkCanvasBounds=new Xa(this.canvas.bounds),this.shrinkCanvasBounds.spread(-(fs(t)?t:2))}__listenEvents(){const{target:t}=this;this.__eventIds=[t.on_(Ip.RESIZE,this.__onResize,this)],t.once(Np.READY,()=>this.__onResize())}__removeListenEvents(){this.target.off_(this.__eventIds),this.__eventIds.length=0}emit(t,e,n,i){this.running&&function(t,e,n,i){if(!n&&!e.path)return;let r;e.type=t,n?e=Object.assign(Object.assign({},e),{path:n}):n=e.path,e.target=n.indexAt(0);try{for(let o=n.length-1;o>-1;o--){if(r=n.list[o],E_(r,t,e,!0,i))return;r.isApp&&C_(r,t,e,!0,i)}for(let o=0,s=n.length;o<s;o++)if(r=n.list[o],r.isApp&&C_(r,t,e,!1,i),E_(r,t,e,!1,i))return}catch(t){S_.error(t)}}(t,e,n,i)}destroy(){this.__eventIds.length&&(this.stop(),this.__removeListenEvents(),this.dragger.destroy(),this.transformer&&this.transformer.destroy(),this.downData=this.overPath=this.enterPath=null)}},A_=class{static set(t,e){this.custom[t]=e}static get(t){return this.custom[t]}};A_.custom={};var M_=class extends _l{constructor(){super(...arguments),this.maxTotal=1e3,this.pathList=new lg,this.pixelList=new lg}getPixelType(t,e){return this.__autoClear(),this.pixelList.add(t),cl.hitCanvas(e)}getPathType(t){return this.__autoClear(),this.pathList.add(t),cl.hitCanvas()}clearImageType(){this.__clearLeafList(this.pixelList)}clearPathType(){this.__clearLeafList(this.pathList)}__clearLeafList(t){t.length&&(t.forEach(t=>{t.__hitCanvas&&(t.__hitCanvas.destroy(),t.__hitCanvas=null)}),t.reset())}__autoClear(){this.pathList.length+this.pixelList.length>this.maxTotal&&this.clear()}clear(){this.clearPathType(),this.clearImageType()}};Qa.getSelector=function(t){return t.leafer?t.leafer.selector:Qa.selector||(Qa.selector=cl.selector())};var{toInnerRadiusPointOf:D_,copyRadiusPoint:I_}=ua,{hitRadiusPoint:F_,hitPoint:W_}=Va,z_={},N_={},j_=Zf.prototype;j_.hit=function(t,e=0){this.updateLayout(),I_(N_,t,e);const n=this.__world;return!!(e?F_(n,N_):W_(n,N_))&&(this.isBranch?Qa.getSelector(this).hitPoint(Object.assign({},N_),e,{target:this}):this.__hitWorld(N_))},j_.__hitWorld=function(t,e){const n=this.__;if(!n.hitSelf)return!1;const i=this.__world,r=this.__layout,o=i.width<10&&i.height<10;if(n.hitRadius&&(I_(z_,t,n.hitRadius),t=z_),D_(t,i,z_),n.hitBox||o){if(Va.hitRadiusPoint(r.boxBounds,z_))return!0;if(o)return!1}return!r.hitCanvasChanged&&this.__hitCanvas||(this.__updateHitCanvas(),r.boundsChanged||(r.hitCanvasChanged=!1)),this.__hit(z_,e)},j_.__hitFill=function(t){const e=this.__hitCanvas;return e&&e.hitFill(t,this.__.windingRule)},j_.__hitStroke=function(t,e){const n=this.__hitCanvas;return n&&n.hitStroke(t,e)},j_.__hitPixel=function(t){const e=this.__hitCanvas;return e&&e.hitPixel(t,this.__layout.renderBounds,e.hitScale)},j_.__drawHitPath=function(t){t&&this.__drawRenderPath(t)};var V_=new ma,H_=Yg.prototype;H_.__updateHitCanvas=function(){this.__box&&this.__box.__updateHitCanvas();const{hitCanvasManager:t}=this.leafer||this.parent&&this.parent.leafer||{};if(!t)return;const e=this.__,n=(e.__isAlphaPixelFill||e.__isCanvas)&&"pixel"===e.hitFill,i=e.__isAlphaPixelStroke&&"pixel"===e.hitStroke,r=n||i;this.__hitCanvas||(this.__hitCanvas=r?t.getPixelType(this,{contextSettings:{willReadFrequently:!0}}):t.getPathType(this));const o=this.__hitCanvas;if(r){const{renderBounds:t}=this.__layout,r=Qa.image.hitCanvasSize,s=o.hitScale=Ga.set(0,0,r,r).getFitMatrix(t).a,{x:a,y:l,width:h,height:c}=Ga.set(t).scale(s);o.resize({width:h,height:c,pixelRatio:1}),o.clear(),nd.patternLocked=!0,this.__renderShape(o,{matrix:V_.setWith(this.__world).scaleWith(1/s).invertWith().translate(-a,-l),snapshot:!0,ignoreFill:!n,ignoreStroke:!i}),nd.patternLocked=!1,o.resetTransform(),e.__isHitPixel=!0}else e.__isHitPixel&&(e.__isHitPixel=!1);this.__drawHitPath(o),o.setStrokeOptions(e)},H_.__hit=function(t,e){if(this.__box&&this.__box.__hit(t))return!0;const n=this.__;if(n.__isHitPixel&&this.__hitPixel(t))return!0;const{hitFill:i}=n,r=(n.fill||n.__isCanvas)&&("path"===i||"pixel"===i&&!(n.__isAlphaPixelFill||n.__isCanvas))||"all"===i||e;if(r&&this.__hitFill(t))return!0;const{hitStroke:o,__maxStrokeWidth:s}=n,a=n.stroke&&("path"===o||"pixel"===o&&!n.__isAlphaPixelStroke)||"all"===o;if(!r&&!a)return!1;const l=2*t.radiusX;let h=l;if(a)switch(n.strokeAlign){case"inside":if(h+=2*s,!r&&this.__hitFill(t)&&this.__hitStroke(t,h))return!0;h=l;break;case"center":h+=s;break;case"outside":if(h+=2*s,!r){if(!this.__hitFill(t)&&this.__hitStroke(t,h))return!0;h=l}}return!!h&&this.__hitStroke(t,h)};var U_=Yg.prototype,Y_=qg.prototype,X_=nv.prototype;Y_.__updateHitCanvas=X_.__updateHitCanvas=function(){this.stroke||this.cornerRadius||(this.fill||this.__.__isCanvas)&&"pixel"===this.hitFill||"all"===this.hitStroke?U_.__updateHitCanvas.call(this):this.__hitCanvas&&(this.__hitCanvas=null)},Y_.__hitFill=X_.__hitFill=function(t){return this.__hitCanvas?U_.__hitFill.call(this,t):Va.hitRadiusPoint(this.__layout.boxBounds,t)},Wv.prototype.__drawHitPath=function(t){const{__lineHeight:e,fontSize:n,__baseLine:i,__letterSpacing:r,__textDrawData:o}=this.__;t.beginPath(),r<0?this.__drawPathByBox(t):o.rows.forEach(r=>t.rect(r.x,r.y-i,r.width,e<n?n:e))},Gg.prototype.pick=function(t,e){return e||(e=hs),this.updateLayout(),Qa.getSelector(this).getByPoint(t,e.hitRadius||0,Object.assign(Object.assign({},e),{target:this}))};var G_,$_=Al.prototype;function K_(t,e,n,i){return new(n||(n=Promise))(function(r,o){function s(t){try{l(i.next(t))}catch(t){o(t)}}function a(t){try{l(i.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n(function(t){t(e)})).then(s,a)}l((i=i.apply(t,e||[])).next())})}$_.hitFill=function(t,e){return e?this.context.isPointInPath(t.x,t.y,e):this.context.isPointInPath(t.x,t.y)},$_.hitStroke=function(t,e){return this.strokeWidth=e,this.context.isPointInStroke(t.x,t.y)},$_.hitPixel=function(t,e,n=1){let{x:i,y:r,radiusX:o,radiusY:s}=t;e&&(i-=e.x,r-=e.y),Ga.set(i-o,r-s,2*o,2*s).scale(n).ceil();const{data:a}=this.context.getImageData(Ga.x,Ga.y,Ga.width||1,Ga.height||1);for(let l=0,h=a.length;l<h;l+=4)if(a[l+3]>0)return!0;return a[3]>0},function(t){t[t.none=1]="none",t[t.free=2]="free",t[t.mirrorAngle=3]="mirrorAngle",t[t.mirror=4]="mirror"}(G_||(G_={}));var q_=nl.get("LeaferCanvas"),Z_=class extends Al{set zIndex(t){const{style:e}=this.view;e.zIndex=t,this.setAbsolute(this.view)}set childIndex(t){const{view:e,parentView:n}=this;if(e&&n){const i=n.children[t];i?(this.setAbsolute(i),n.insertBefore(e,i)):n.appendChild(i)}}init(){const{config:t}=this,e=t.view||t.canvas;e?this.__createViewFrom(e):this.__createView();const{style:n}=this.view;if(n.display||(n.display="block"),this.parentView=this.view.parentElement,this.parentView){const t=this.parentView.style;t.webkitUserSelect=t.userSelect="none",this.view.classList.add("leafer-canvas-view")}Qa.syncDomFont&&!this.parentView&&(n.display="none",document.body&&document.body.appendChild(this.view)),this.__createContext(),this.autoLayout||this.resize(t)}set backgroundColor(t){this.view.style.backgroundColor=t}get backgroundColor(){return this.view.style.backgroundColor}set hittable(t){this.view.style.pointerEvents=t?"auto":"none"}get hittable(){return"none"!==this.view.style.pointerEvents}__createView(){this.view=document.createElement("canvas")}__createViewFrom(t){let e=ds(t)?document.getElementById(t):t;if(e)if(e instanceof HTMLCanvasElement)this.view=e;else{let t=e;if(e===window||e===document){const e=document.createElement("div"),{style:n}=e;n.position="absolute",n.top=n.bottom=n.left=n.right="0px",document.body.appendChild(e),t=e}this.__createView();const n=this.view;t.hasChildNodes()&&(this.setAbsolute(n),t.style.position||(t.style.position="relative")),t.appendChild(n)}else q_.error(`no id: ${t}`),this.__createView()}setAbsolute(t){const{style:e}=t;e.position="absolute",e.top=e.left="0px"}updateViewSize(){const{width:t,height:e,pixelRatio:n}=this,{style:i}=this.view;i.width=t+"px",i.height=e+"px",this.unreal||(this.view.width=Math.ceil(t*n),this.view.height=Math.ceil(e*n))}updateClientBounds(){this.view.parentElement&&(this.clientBounds=this.view.getBoundingClientRect())}startAutoLayout(t,e){if(this.resizeListener=e,t){if(this.autoBounds=t,this.resizeObserver)return;try{this.resizeObserver=new ResizeObserver(t=>{this.updateClientBounds();for(const e of t)this.checkAutoBounds(e.contentRect)});const t=this.parentView;t?(this.resizeObserver.observe(t),this.checkAutoBounds(t.getBoundingClientRect())):(this.checkAutoBounds(this.view),q_.warn("no parent"))}catch(t){this.imitateResizeObserver()}this.stopListenPixelRatio()}else this.listenPixelRatio(),this.unreal&&this.updateViewSize()}imitateResizeObserver(){this.autoLayout&&(this.parentView&&this.checkAutoBounds(this.parentView.getBoundingClientRect()),Qa.requestRender(this.imitateResizeObserver.bind(this)))}listenPixelRatio(){this.windowListener||window.addEventListener("resize",this.windowListener=()=>{const t=Qa.devicePixelRatio;if(!this.config.pixelRatio&&this.pixelRatio!==t){const{width:e,height:n}=this;this.emitResize({width:e,height:n,pixelRatio:t})}})}stopListenPixelRatio(){this.windowListener&&(window.removeEventListener("resize",this.windowListener),this.windowListener=null)}checkAutoBounds(t){const e=this.view,{x:n,y:i,width:r,height:o}=this.autoBounds.getBoundsFrom(t),s={width:r,height:o,pixelRatio:this.config.pixelRatio?this.pixelRatio:Qa.devicePixelRatio};if(!this.isSameSize(s)){const{style:t}=e;t.marginLeft=n+"px",t.marginTop=i+"px",this.emitResize(s)}}stopAutoLayout(){this.autoLayout=!1,this.resizeObserver&&this.resizeObserver.disconnect(),this.resizeListener=this.resizeObserver=null}emitResize(t){const e={};bs.copyAttrs(e,this,Rl),this.resize(t),this.resizeListener&&!cs(this.width)&&this.resizeListener(new Ip(t,e))}unrealCanvas(){if(!this.unreal&&this.parentView){let t=this.view;t&&t.remove(),t=this.view=document.createElement("div"),this.parentView.appendChild(this.view),t.classList.add("leafer-app-view"),this.unreal=!0}}destroy(){const{view:t}=this;t&&(this.stopAutoLayout(),this.stopListenPixelRatio(),t.parentElement&&t.remove(),super.destroy())}};Gu(CanvasRenderingContext2D.prototype),Gu(Path2D.prototype),Object.assign(cl,{canvas:(t,e)=>new Z_(t,e),image:t=>new sd(t)}),Qa.name="web",Qa.isMobile="ontouchstart"in window,Qa.requestRender=function(t){window.requestAnimationFrame(t)},ad(Qa,"devicePixelRatio",{get:()=>devicePixelRatio});var{userAgent:J_}=navigator;J_.indexOf("Firefox")>-1?(Qa.intWheelDeltaY=!0,Qa.syncDomFont=!0):(/iPhone|iPad|iPod/.test(navigator.userAgent)||/Macintosh/.test(navigator.userAgent)&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent))&&(Qa.fullImageShadow=!0),J_.indexOf("Windows")>-1?(Qa.os="Windows",Qa.intWheelDeltaY=!0):J_.indexOf("Mac")>-1?Qa.os="Mac":J_.indexOf("Linux")>-1&&(Qa.os="Linux");var Q_=class{get childrenChanged(){return this.hasAdd||this.hasRemove||this.hasVisible}get updatedList(){if(this.hasRemove&&this.config.usePartLayout){const t=new lg;return this.__updatedList.list.forEach(e=>{e.leafer&&t.add(e)}),t}return this.__updatedList}constructor(t,e){this.totalTimes=0,this.config={},this.__updatedList=new lg,this.target=t,e&&(this.config=bs.default(e,this.config)),this.__listenEvents()}start(){this.disabled||(this.running=!0)}stop(){this.running=!1}disable(){this.stop(),this.__removeListenEvents(),this.disabled=!0}update(){this.changed=!0,this.running&&this.target.emit(zp.REQUEST)}__onAttrChange(t){this.config.usePartLayout&&this.__updatedList.add(t.target),this.update()}__onChildEvent(t){this.config.usePartLayout&&(t.type===Cp.ADD?(this.hasAdd=!0,this.__pushChild(t.child)):(this.hasRemove=!0,this.__updatedList.add(t.parent))),this.update()}__pushChild(t){this.__updatedList.add(t),t.isBranch&&this.__loopChildren(t)}__loopChildren(t){const{children:e}=t;for(let n=0,i=e.length;n<i;n++)this.__pushChild(e[n])}__onRquestData(){this.target.emitEvent(new Fp(Fp.DATA,{updatedList:this.updatedList})),this.__updatedList=new lg,this.totalTimes++,this.changed=this.hasVisible=this.hasRemove=this.hasAdd=!1}__listenEvents(){this.__eventIds=[this.target.on_([[Op.CHANGE,this.__onAttrChange,this],[[Cp.ADD,Cp.REMOVE],this.__onChildEvent,this],[Fp.REQUEST,this.__onRquestData,this]])]}__removeListenEvents(){this.target.off_(this.__eventIds)}destroy(){this.target&&(this.stop(),this.__removeListenEvents(),this.target=this.__updatedList=null)}},{updateAllMatrix:tm,updateBounds:em,updateChange:nm}=Kd,{pushAllChildBranch:im,pushAllParent:rm}=ap,{worldBounds:om}=rp,sm=class{constructor(t){this.updatedBounds=new Xa,this.beforeBounds=new Xa,this.afterBounds=new Xa,gs(t)&&(t=new lg(t)),this.updatedList=t}setBefore(){this.beforeBounds.setListWithFn(this.updatedList.list,om)}setAfter(){this.afterBounds.setListWithFn(this.updatedList.list,om),this.updatedBounds.setList([this.beforeBounds,this.afterBounds])}merge(t){this.updatedList.addList(t.updatedList.list),this.beforeBounds.add(t.beforeBounds),this.afterBounds.add(t.afterBounds),this.updatedBounds.add(t.updatedBounds)}destroy(){this.updatedList=null}},{updateAllMatrix:am,updateAllChange:lm}=Kd,hm=nl.get("Layouter"),cm=class t{constructor(t,e){this.totalTimes=0,this.config={usePartLayout:!0},this.__levelList=new hg,this.target=t,e&&(this.config=bs.default(e,this.config)),this.__listenEvents()}start(){this.disabled||(this.running=!0)}stop(){this.running=!1}disable(){this.stop(),this.__removeListenEvents(),this.disabled=!0}layout(){if(this.layouting||!this.running)return;const{target:t}=this;this.times=0;try{t.emit(Wp.START),this.layoutOnce(),t.emitEvent(new Wp(Wp.END,this.layoutedBlocks,this.times))}catch(t){hm.error(t)}this.layoutedBlocks=null}layoutAgain(){this.layouting?this.waitAgain=!0:this.layoutOnce()}layoutOnce(){return this.layouting?hm.warn("layouting"):this.times>3?hm.warn("layout max times"):(this.times++,this.totalTimes++,this.layouting=!0,this.target.emit(Fp.REQUEST),this.totalTimes>1&&this.config.usePartLayout?this.partLayout():this.fullLayout(),this.layouting=!1,void(this.waitAgain&&(this.waitAgain=!1,this.layoutOnce())))}partLayout(){var t;if(!(null===(t=this.__updatedList)||void 0===t?void 0:t.length))return;const e=sl.start("PartLayout"),{target:n,__updatedList:i}=this,{BEFORE:r,LAYOUT:o,AFTER:s}=Wp,a=this.getBlocks(i);a.forEach(t=>t.setBefore()),n.emitEvent(new Wp(r,a,this.times)),this.extraBlock=null,i.sort(),function(t,e){let n;t.list.forEach(t=>{n=t.__layout,e.without(t)&&!n.proxyZoom&&(n.matrixChanged?(tm(t,!0),e.add(t),t.isBranch&&im(t,e),rm(t,e)):n.boundsChanged&&(e.add(t),t.isBranch&&(t.__tempNumber=0),rm(t,e)))})}(i,this.__levelList),function(t){let e,n,i;t.sort(!0),t.levels.forEach(r=>{e=t.levelMap[r];for(let t=0,o=e.length;t<o;t++){if(n=e[t],n.isBranch&&n.__tempNumber){i=n.children;for(let t=0,e=i.length;t<e;t++)i[t].isBranch||em(i[t])}em(n)}})}(this.__levelList),function(t){t.list.forEach(nm)}(i),this.extraBlock&&a.push(this.extraBlock),a.forEach(t=>t.setAfter()),n.emitEvent(new Wp(o,a,this.times)),n.emitEvent(new Wp(s,a,this.times)),this.addBlocks(a),this.__levelList.reset(),this.__updatedList=null,sl.end(e)}fullLayout(){const e=sl.start("FullLayout"),{target:n}=this,{BEFORE:i,LAYOUT:r,AFTER:o}=Wp,s=this.getBlocks(new lg(n));n.emitEvent(new Wp(i,s,this.times)),t.fullLayout(n),s.forEach(t=>{t.setAfter()}),n.emitEvent(new Wp(r,s,this.times)),n.emitEvent(new Wp(o,s,this.times)),this.addBlocks(s),sl.end(e)}static fullLayout(t){am(t,!0),t.isBranch?ap.updateBounds(t):Kd.updateBounds(t),lm(t)}addExtra(t){if(!this.__updatedList.has(t)){const{updatedList:e,beforeBounds:n}=this.extraBlock||(this.extraBlock=new sm([]));e.length?n.add(t.__world):n.set(t.__world),e.add(t)}}createBlock(t){return new sm(t)}getBlocks(t){return[this.createBlock(t)]}addBlocks(t){this.layoutedBlocks?this.layoutedBlocks.push(...t):this.layoutedBlocks=t}__onReceiveWatchData(t){this.__updatedList=t.data.updatedList}__listenEvents(){this.__eventIds=[this.target.on_([[Wp.REQUEST,this.layout,this],[Wp.AGAIN,this.layoutAgain,this],[Fp.DATA,this.__onReceiveWatchData,this]])]}__removeListenEvents(){this.target.off_(this.__eventIds)}destroy(){this.target&&(this.stop(),this.__removeListenEvents(),this.target=this.config=null)}},um=nl.get("Renderer"),dm=class t{get needFill(){return!(this.canvas.allowBackgroundColor||!this.config.fill)}constructor(t,e,n){this.FPS=60,this.totalTimes=0,this.times=0,this.config={usePartRender:!0,ceilPartPixel:!0,maxFPS:120},this.frames=[],this.target=t,this.canvas=e,n&&(this.config=bs.default(n,this.config)),this.__listenEvents()}start(){this.running=!0,this.update(!1)}stop(){this.running=!1}update(t=!0){this.changed||(this.changed=t),this.requestTime||this.__requestRender()}requestLayout(){this.target.emit(Wp.REQUEST)}checkRender(){if(this.running){const{target:t}=this;t.isApp&&(t.emit(zp.CHILD_START,t),t.children.forEach(t=>{t.renderer.FPS=this.FPS,t.renderer.checkRender()}),t.emit(zp.CHILD_END,t)),this.changed&&this.canvas.view&&this.render(),this.target.emit(zp.NEXT)}}render(t){if(!this.running||!this.canvas.view)return this.update();const{target:e}=this;this.times=0,this.totalBounds=new Xa,um.log(e.innerName,"---\x3e");try{this.emitRender(zp.START),this.renderOnce(t),this.emitRender(zp.END,this.totalBounds),nd.clearRecycled()}catch(t){this.rendering=!1,um.error(t)}um.log("-------------|")}renderAgain(){this.rendering?this.waitAgain=!0:this.renderOnce()}renderOnce(t){if(this.rendering)return um.warn("rendering");if(this.times>3)return um.warn("render max times");if(this.times++,this.totalTimes++,this.rendering=!0,this.changed=!1,this.renderBounds=new Xa,this.renderOptions={},t)this.emitRender(zp.BEFORE),t();else{if(this.requestLayout(),this.ignore)return void(this.ignore=this.rendering=!1);this.emitRender(zp.BEFORE),this.config.usePartRender&&this.totalTimes>1?this.partRender():this.fullRender()}this.emitRender(zp.RENDER,this.renderBounds,this.renderOptions),this.emitRender(zp.AFTER,this.renderBounds,this.renderOptions),this.updateBlocks=null,this.rendering=!1,this.waitAgain&&(this.waitAgain=!1,this.renderOnce())}partRender(){const{canvas:t,updateBlocks:e}=this;e&&(this.mergeBlocks(),e.forEach(e=>{t.bounds.hit(e)&&!e.isEmpty()&&this.clipRender(e)}))}clipRender(e){const n=sl.start("PartRender"),{canvas:i}=this,r=e.getIntersect(i.bounds),o=new Xa(r);i.save(),r.spread(t.clipSpread).ceil();const{ceilPartPixel:s}=this.config;i.clipWorld(r,s),i.clearWorld(r,s),this.__render(r,o),i.restore(),sl.end(n)}fullRender(){const t=sl.start("FullRender"),{canvas:e}=this;e.save(),e.clear(),this.__render(e.bounds),e.restore(),sl.end(t)}__render(t,e){const{canvas:n,target:i}=this,r=t.includes(i.__world),o=r?{includes:r}:{bounds:t,includes:r};this.needFill&&n.fillWorld(t,this.config.fill),nl.showRepaint&&nl.drawRepaint(n,t),this.config.useCellRender&&(o.cellList=this.getCellList()),Qa.render(i,n,o),this.renderBounds=e=e||t,this.renderOptions=o,this.totalBounds.isEmpty()?this.totalBounds=e:this.totalBounds.add(e),n.updateRender(e)}getCellList(){}addBlock(t,e){this.updateBlocks||(this.updateBlocks=[]),this.updateBlocks.push(t)}mergeBlocks(){const{updateBlocks:t}=this;if(t){const e=new Xa;e.setList(t),t.length=0,t.push(e)}}__requestRender(){const t=this.target;if(this.requestTime||!t)return;if(t.parentApp)return t.parentApp.requestRender(!1);this.requestTime=this.frameTime||Date.now();const e=()=>{const t=1e3/((this.frameTime=Date.now())-this.requestTime),{maxFPS:n}=this.config;if(n&&t>n)return Qa.requestRender(e);const{frames:i}=this;i.length>30&&i.shift(),i.push(t),this.FPS=Math.round(i.reduce((t,e)=>t+e,0)/i.length),this.requestTime=0,this.checkRender()};Qa.requestRender(e)}__onResize(t){if(!this.canvas.unreal){if(t.bigger||!t.samePixelRatio){const{width:e,height:n}=t.old;if(!new Xa(0,0,e,n).includes(this.target.__world)||this.needFill||!t.samePixelRatio)return this.addBlock(this.canvas.bounds),void this.target.forceUpdate("surface")}this.addBlock(new Xa(0,0,1,1)),this.update()}}__onLayoutEnd(t){t.data&&t.data.map(t=>{let e;const{updatedList:n}=t;n&&n.list.some(t=>(e=!t.__world.width||!t.__world.height,e&&(t.isLeafer||um.tip(t.innerName,": empty"),e=!t.isBranch||t.isBranchLeaf),e)),this.addBlock(e?this.canvas.bounds:t.updatedBounds,n)})}emitRender(t,e,n){this.target.emitEvent(new zp(t,this.times,e,n))}__listenEvents(){this.__eventIds=[this.target.on_([[zp.REQUEST,this.update,this],[Wp.END,this.__onLayoutEnd,this],[zp.AGAIN,this.renderAgain,this],[Ip.RESIZE,this.__onResize,this]])]}__removeListenEvents(){this.target.off_(this.__eventIds)}destroy(){this.target&&(this.stop(),this.__removeListenEvents(),this.config={},this.target=this.canvas=null)}};dm.clipSpread=10;var pm={},{copyRadiusPoint:fm}=ua,{hitRadiusPoint:gm}=Va,vm=class{constructor(t,e){this.target=t,this.selector=e}getByPoint(t,e,n){e||(e=0),n||(n={});const i=n.through||!1,r=n.ignoreHittable||!1,o=n.target||this.target;this.exclude=n.exclude||null,this.point={x:t.x,y:t.y,radiusX:e,radiusY:e},this.findList=new lg(n.findList),n.findList||this.hitBranch(o.isBranchLeaf?{children:[o]}:o);const{list:s}=this.findList,a=this.getBestMatchLeaf(s,n.bottomList,r,!!n.findList),l=r?this.getPath(a):this.getHitablePath(a);return this.clear(),i?{path:l,target:a,throughPath:s.length?this.getThroughPath(s):l}:{path:l,target:a}}hitPoint(t,e,n){return!!this.getByPoint(t,e,n).target}getBestMatchLeaf(t,e,n,i){const r=this.findList=new lg;if(t.length){let e;const{x:i,y:o}=this.point,s={x:i,y:o,radiusX:0,radiusY:0};for(let a=0,l=t.length;a<l;a++)if(e=t[a],(n||Kd.worldHittable(e))&&(this.hitChild(e,s),r.length)){if(e.isBranchLeaf&&t.some(t=>t!==e&&Kd.hasParent(t,e))){r.reset();break}return r.list[0]}}if(e)for(let o=0,s=e.length;o<s;o++)if(this.hitChild(e[o].target,this.point,e[o].proxy),r.length)return r.list[0];return i?null:n?t[0]:t.find(t=>Kd.worldHittable(t))}getPath(t){const e=new lg,n=[],{target:i}=this;for(;t&&(t.syncEventer&&n.push(t.syncEventer),e.add(t),(t=t.parent)!==i););return n.length&&n.forEach(t=>{for(;t&&(t.__.hittable&&e.add(t),(t=t.parent)!==i););}),i&&e.add(i),e}getHitablePath(t){const e=this.getPath(t&&t.hittable?t:null);let n,i=new lg;for(let r=e.list.length-1;r>-1&&(n=e.list[r],n.__.hittable)&&(i.addAt(n,0),n.__.hitChildren&&(!n.isLeafer||"draw"!==n.mode));r--);return i}getThroughPath(t){const e=new lg,n=[];for(let s=t.length-1;s>-1;s--)n.push(this.getPath(t[s]));let i,r,o;for(let s=0,a=n.length;s<a;s++){i=n[s],r=n[s+1];for(let t=0,n=i.length;t<n&&(o=i.list[t],!r||!r.has(o));t++)e.add(o)}return e}hitBranch(t){this.eachFind(t.children,t.__onlyHitMask)}eachFind(t,e){let n,i,r;const{point:o}=this;for(let s=t.length-1;s>-1;s--)if(n=t[s],r=n.__,r.visible&&(!e||r.mask))if(i=gm(n.__world,r.hitRadius?fm(pm,o,r.hitRadius):o),n.isBranch){if(i||n.__ignoreHitWorld){if(n.isBranchLeaf&&r.__clipAfterFill&&!n.__hitWorld(o,!0))continue;n.topChildren&&this.eachFind(n.topChildren,!1),this.eachFind(n.children,n.__onlyHitMask),n.isBranchLeaf&&this.hitChild(n,o)}}else i&&this.hitChild(n,o)}hitChild(t,e,n){if((!this.exclude||!this.exclude.has(t))&&t.__hitWorld(e)){const{parent:i}=t;if(i&&i.__hasMask&&!t.__.mask){let n,r=[];const{children:o}=i;for(let i=0,s=o.length;i<s;i++)if(n=o[i],n.__.mask&&r.push(n),n===t){if(r&&!r.every(t=>t.__hitWorld(e)))return;break}}this.findList.add(n||t)}}clear(){this.point=null,this.findList=null,this.exclude=null}destroy(){this.clear()}},_m=class{constructor(t,e){this.config={},e&&(this.config=bs.default(e,this.config)),this.picker=new vm(this.target=t,this),this.finder=cl.finder&&cl.finder(t,this.config)}getByPoint(t,e,n){const{target:i,picker:r}=this;return Qa.backgrounder&&i&&i.updateLayout(),r.getByPoint(t,e,n)}hitPoint(t,e,n){return this.picker.hitPoint(t,e,n)}getBy(t,e,n,i){return this.finder?this.finder.getBy(t,e,n,i):hl.need("find")}destroy(){this.picker.destroy(),this.finder&&this.finder.destroy()}};Object.assign(cl,{watcher:(t,e)=>new Q_(t,e),layouter:(t,e)=>new cm(t,e),renderer:(t,e,n)=>new dm(t,e,n),selector:(t,e)=>new _m(t,e)}),Qa.layout=cm.fullLayout,Qa.render=function(t,e,n){const i=Object.assign(Object.assign({},n),{topRendering:!0});n.topList=new lg,t.__render(e,n),n.topList.length&&n.topList.forEach(t=>t.__render(e,i))};var mm={convert(t,e){const n=v_.getBase(t),{x:i,y:r}=e,o=Object.assign(Object.assign({},n),{x:i,y:r,width:t.width,height:t.height,pointerType:t.pointerType,pressure:t.pressure});return"pen"===o.pointerType&&(o.tangentialPressure=t.tangentialPressure,o.tiltX=t.tiltX,o.tiltY=t.tiltY,o.twist=t.twist),o},convertMouse(t,e){const n=v_.getBase(t),{x:i,y:r}=e;return Object.assign(Object.assign({},n),{x:i,y:r,width:1,height:1,pointerType:"mouse",pressure:.5})},convertTouch(t,e){const n=mm.getTouch(t),i=v_.getBase(t),{x:r,y:o}=e;return Object.assign(Object.assign({},i),{x:r,y:o,width:1,height:1,pointerType:"touch",multiTouch:t.touches.length>1,pressure:n.force})},getTouch:t=>t.targetTouches[0]||t.changedTouches[0]},ym={convert(t){const e=v_.getBase(t);return Object.assign(Object.assign({},e),{code:t.code,key:t.key})}},{pathCanDrag:bm}=v_,wm=class extends R_{get windowTarget(){const{view:t}=this;return t&&t.ownerDocument||window}get notPointer(){const{p:t}=this;return"pointer"!==t.type||t.touch||this.useMultiTouch}get notTouch(){const{p:t}=this;return"mouse"===t.type||this.usePointer}get notMouse(){return this.usePointer||this.useTouch}__listenEvents(){super.__listenEvents();const t=this.view=this.canvas.view;this.viewEvents={pointerdown:this.onPointerDown,mousedown:this.onMouseDown,touchstart:this.onTouchStart,pointerleave:this.onPointerLeave,contextmenu:this.onContextMenu,wheel:this.onWheel,gesturestart:this.onGesturestart,gesturechange:this.onGesturechange,gestureend:this.onGestureend},this.windowEvents={pointermove:this.onPointerMove,pointerup:this.onPointerUp,pointercancel:this.onPointerCancel,mousemove:this.onMouseMove,mouseup:this.onMouseUp,touchmove:this.onTouchMove,touchend:this.onTouchEnd,touchcancel:this.onTouchCancel,keydown:this.onKeyDown,keyup:this.onKeyUp,scroll:this.onScroll};const{viewEvents:e,windowEvents:n}=this;for(let i in e)e[i]=e[i].bind(this),t.addEventListener(i,e[i]);for(let i in n)n[i]=n[i].bind(this),this.windowTarget.addEventListener(i,n[i])}__removeListenEvents(){super.__removeListenEvents();const{viewEvents:t,windowEvents:e}=this;for(let n in t)this.view.removeEventListener(n,t[n]),this.viewEvents={};for(let n in e)this.windowTarget.removeEventListener(n,e[n]),this.windowEvents={}}getTouches(t){const e=[];for(let n=0,i=t.length;n<i;n++)e.push(t[n]);return e}preventDefaultPointer(t){const{pointer:e}=this.config;e.preventDefault&&t.preventDefault()}preventDefaultWheel(t){const{wheel:e}=this.config;e.preventDefault&&t.preventDefault()}preventWindowPointer(t){return!(this.downData||t.target===this.view||this.config.shadowDOM&&t.composedPath&&t.composedPath().includes(this.view))}onKeyDown(t){this.keyDown(ym.convert(t))}onKeyUp(t){this.keyUp(ym.convert(t))}onContextMenu(t){this.config.pointer.preventDefaultMenu&&t.preventDefault(),this.menu(mm.convert(t,this.getLocal(t)))}onScroll(){this.canvas.updateClientBounds()}onPointerDown(t){this.preventDefaultPointer(t),this.notPointer||(this.usePointer||(this.usePointer=!0),this.pointerDown(mm.convert(t,this.getLocal(t))))}onPointerMove(t,e){if(this.notPointer||this.preventWindowPointer(t))return;this.usePointer||(this.usePointer=!0);const n=mm.convert(t,this.getLocal(t,!0));e?this.pointerHover(n):this.pointerMove(n)}onPointerLeave(t){this.onPointerMove(t,!0)}onPointerUp(t){this.downData&&this.preventDefaultPointer(t),this.notPointer||this.preventWindowPointer(t)||this.pointerUp(mm.convert(t,this.getLocal(t)))}onPointerCancel(){this.useMultiTouch||this.pointerCancel()}onMouseDown(t){this.preventDefaultPointer(t),this.notMouse||this.pointerDown(mm.convertMouse(t,this.getLocal(t)))}onMouseMove(t){this.notMouse||this.preventWindowPointer(t)||this.pointerMove(mm.convertMouse(t,this.getLocal(t,!0)))}onMouseUp(t){this.downData&&this.preventDefaultPointer(t),this.notMouse||this.preventWindowPointer(t)||this.pointerUp(mm.convertMouse(t,this.getLocal(t)))}onMouseCancel(){this.notMouse||this.pointerCancel()}onTouchStart(t){const e=mm.getTouch(t),n=this.getLocal(e,!0),{preventDefault:i}=this.config.touch;(!0===i||"auto"===i&&bm(this.findPath(n)))&&t.preventDefault(),this.multiTouchStart(t),this.notTouch||(this.touchTimer&&(window.clearTimeout(this.touchTimer),this.touchTimer=0),this.useTouch=!0,this.pointerDown(mm.convertTouch(t,n)))}onTouchMove(t){if(this.multiTouchMove(t),this.notTouch||this.preventWindowPointer(t))return;const e=mm.getTouch(t);this.pointerMove(mm.convertTouch(t,this.getLocal(e)))}onTouchEnd(t){if(this.multiTouchEnd(),this.notTouch||this.preventWindowPointer(t))return;this.touchTimer&&clearTimeout(this.touchTimer),this.touchTimer=setTimeout(()=>{this.useTouch=!1},500);const e=mm.getTouch(t);this.pointerUp(mm.convertTouch(t,this.getLocal(e)))}onTouchCancel(){this.notTouch||this.pointerCancel()}multiTouchStart(t){this.useMultiTouch=t.touches.length>1,this.touches=this.useMultiTouch?this.getTouches(t.touches):void 0,this.useMultiTouch&&this.pointerCancel()}multiTouchMove(t){if(this.useMultiTouch&&t.touches.length>1){const e=this.getTouches(t.touches),n=this.getKeepTouchList(this.touches,e);n.length>1&&(this.multiTouch(v_.getBase(t),n),this.touches=e)}}multiTouchEnd(){this.touches=null,this.useMultiTouch=!1,this.transformEnd()}getKeepTouchList(t,e){let n;const i=[];return t.forEach(t=>{n=e.find(e=>e.identifier===t.identifier),n&&i.push({from:this.getLocal(t),to:this.getLocal(n)})}),i}getLocalTouchs(t){return t.map(t=>this.getLocal(t))}onWheel(t){this.preventDefaultWheel(t),this.wheel(Object.assign(Object.assign(Object.assign({},v_.getBase(t)),this.getLocal(t)),{deltaX:t.deltaX,deltaY:t.deltaY}))}onGesturestart(t){this.useMultiTouch||(this.preventDefaultWheel(t),this.lastGestureScale=1,this.lastGestureRotation=0)}onGesturechange(t){if(this.useMultiTouch)return;this.preventDefaultWheel(t);const e=v_.getBase(t);Object.assign(e,this.getLocal(t));const n=t.scale/this.lastGestureScale,i=(t.rotation-this.lastGestureRotation)/Math.PI*180*(Ws.within(this.config.wheel.rotateSpeed,0,1)/4+.1);this.zoom(Object.assign(Object.assign({},e),{scale:n*n})),this.rotate(Object.assign(Object.assign({},e),{rotation:i})),this.lastGestureScale=t.scale,this.lastGestureRotation=t.rotation}onGestureend(t){this.useMultiTouch||(this.preventDefaultWheel(t),this.transformEnd())}setCursor(t){super.setCursor(t);const e=[];this.eachCursor(t,e),vs(e[e.length-1])&&e.push("default"),this.canvas.view.style.cursor=e.map(t=>vs(t)?`url(${t.url}) ${t.x||0} ${t.y||0}`:t).join(",")}eachCursor(t,e,n=0){if(n++,gs(t))t.forEach(t=>this.eachCursor(t,e,n));else{const i=ds(t)&&A_.get(t);i&&n<2?this.eachCursor(i,e,n):e.push(t)}}destroy(){this.view&&(super.destroy(),this.view=null,this.touches=null)}};function xm(t,e,n){t.__.__font?_g.fillText(t,e,n):t.__.windingRule?e.fill(t.__.windingRule):e.fill()}function Sm(t,e,n,i,r){const o=n.__;vs(t)?_g.drawStrokesStyle(t,e,!1,n,i,r):(i.setStroke(t,o.__strokeWidth*e,o),i.stroke()),o.__useArrow&&_g.strokeArrow(t,n,i,r)}function km(t,e,n,i,r){const o=n.__;vs(t)?_g.drawStrokesStyle(t,e,!0,n,i,r):(i.setStroke(t,o.__strokeWidth*e,o),_g.drawTextStroke(n,i,r))}function Cm(t,e,n,i,r){const o=i.getSameCanvas(!0,!0);o.font=n.__.__font,km(t,2,n,o,r),o.blendMode="outside"===e?"destination-out":"destination-in",_g.fillText(n,o,r),o.blendMode="normal",Kd.copyCanvasByWorld(n,i,o),o.recycle(n.__nowWorld)}var Em,{getSpread:Om,copyAndSpread:Lm,toOuterOf:Pm,getOuterOf:Tm,getByMove:Bm,move:Rm,getIntersectData:Am}=Va,Mm={},{stintSet:Dm}=bs,{hasTransparent:Im}=fg;function Fm(t,e,n){if(!vs(e)||!1===e.visible||0===e.opacity)return;let i;const{boxBounds:r}=n.__layout,{type:o}=e;switch(o){case"image":case"film":case"video":if(!e.url)return;i=mg.image(n,t,e,r,!Em||!Em[e.url]),"image"!==o&&mg[o](i);break;case"linear":i=yg.linearGradient(e,r);break;case"radial":i=yg.radialGradient(e,r);break;case"angular":i=yg.conicGradient(e,r);break;case"solid":const{color:s,opacity:a}=e;i={type:o,style:fg.string(s,a)};break;default:cs(e.r)||(i={type:"solid",style:fg.string(e)})}if(i&&(i.originPaint=e,ds(i.style)&&Im(i.style)&&(i.isTransparent=!0),e.style)){if(0===e.style.strokeWidth)return;i.strokeStyle=e.style}return i}var Wm,zm={compute:function(t,e){const n=e.__,i=[];let r,o,s,a=n.__input[t];gs(a)||(a=[a]),Em=mg.recycleImage(t,n);for(let l,h=0,c=a.length;h<c;h++)(l=Fm(t,a[h],e))&&(i.push(l),l.strokeStyle&&(s||(s=1),l.strokeStyle.strokeWidth&&(s=Math.max(s,l.strokeStyle.strokeWidth))));n["_"+t]=i.length?i:void 0,i.length?(i.every(t=>t.isTransparent)&&(i.some(t=>t.image)&&(r=!0),o=!0),"fill"===t?(Dm(n,"__isAlphaPixelFill",r),Dm(n,"__isTransparentFill",o)):(Dm(n,"__isAlphaPixelStroke",r),Dm(n,"__isTransparentStroke",o),Dm(n,"__hasMultiStrokeStyle",s))):n.__removePaint(t,!1)},fill:function(t,e,n,i){n.fillStyle=t,xm(e,n,i)},fills:function(t,e,n,i){let r,o,s;for(let a=0,l=t.length;a<l;a++){if(r=t[a],o=r.originPaint,r.image){if(s?s++:s=1,mg.checkImage(r,!e.__.__font,e,n,i))continue;if(!r.style){1===s&&r.image.isPlacehold&&e.drawImagePlaceholder(r,n,i);continue}}if(n.fillStyle=r.style,r.transform||o.scaleFixed){if(n.save(),r.transform&&n.transform(r.transform),o.scaleFixed){const{scaleX:t,scaleY:i}=e.getRenderScaleData(!0,o.scaleFixed,!1);1!==t&&n.scale(t,i)}o.blendMode&&(n.blendMode=o.blendMode),xm(e,n,i),n.restore()}else o.blendMode?(n.saveBlendMode(o.blendMode),xm(e,n,i),n.restoreBlendMode()):xm(e,n,i)}},fillPathOrText:xm,fillText:function(t,e,n){const i=t.__,{rows:r,decorationY:o}=i.__textDrawData;let s;i.__isPlacehold&&i.placeholderColor&&(e.fillStyle=i.placeholderColor);for(let a=0,l=r.length;a<l;a++)s=r[a],s.text?e.fillText(s.text,s.x,s.y):s.data&&s.data.forEach(t=>{e.fillText(t.char,t.x,s.y)});if(o){const{decorationColor:t,decorationHeight:n}=i.__textDrawData;t&&(e.fillStyle=t),r.forEach(t=>o.forEach(i=>e.fillRect(t.x,t.y+i,t.width,n)))}},stroke:function(t,e,n,i){const r=e.__;if(r.__strokeWidth)if(r.__font)_g.strokeText(t,e,n,i);else if(r.__pathForStroke)_g.fillStroke(t,e,n,i);else switch(r.strokeAlign){case"center":Sm(t,1,e,n,i);break;case"inside":!function(t,e,n,i){n.save(),n.clipUI(e),Sm(t,2,e,n,i),n.restore()}(t,e,n,i);break;case"outside":!function(t,e,n,i){const r=e.__;if(r.__fillAfterStroke)Sm(t,2,e,n,i);else{const{renderBounds:o}=e.__layout,s=n.getSameCanvas(!0,!0);e.__drawRenderPath(s),Sm(t,2,e,s,i),s.clipUI(r),s.clearWorld(o),Kd.copyCanvasByWorld(e,n,s),s.recycle(e.__nowWorld)}}(t,e,n,i)}},strokes:function(t,e,n,i){_g.stroke(t,e,n,i)},strokeText:function(t,e,n,i){switch(e.__.strokeAlign){case"center":km(t,1,e,n,i);break;case"inside":Cm(t,"inside",e,n,i);break;case"outside":e.__.__fillAfterStroke?km(t,2,e,n,i):Cm(t,"outside",e,n,i)}},drawTextStroke:function(t,e,n){let i,r=t.__.__textDrawData;const{rows:o,decorationY:s}=r;for(let a=0,l=o.length;a<l;a++)i=o[a],i.text?e.strokeText(i.text,i.x,i.y):i.data&&i.data.forEach(t=>{e.strokeText(t.char,t.x,i.y)});if(s){const{decorationHeight:t}=r;o.forEach(n=>s.forEach(i=>e.strokeRect(n.x,n.y+i,n.width,t)))}},drawStrokesStyle:function(t,e,n,i,r,o){let s;const a=i.__,{__hasMultiStrokeStyle:l}=a;l||r.setStroke(void 0,a.__strokeWidth*e,a);for(let h=0,c=t.length;h<c;h++)if(s=t[h],(!s.image||!mg.checkImage(s,!1,i,r,o))&&s.style){if(l){const{strokeStyle:t}=s;t?r.setStroke(s.style,a.__getRealStrokeWidth(t)*e,a,t):r.setStroke(s.style,a.__strokeWidth*e,a)}else r.strokeStyle=s.style;s.originPaint.blendMode?(r.saveBlendMode(s.originPaint.blendMode),n?_g.drawTextStroke(i,r,o):r.stroke(),r.restoreBlendMode()):n?_g.drawTextStroke(i,r,o):r.stroke()}},shape:function(t,e,n){const i=e.getSameCanvas(),r=e.bounds,o=t.__nowWorld,s=t.__layout,a=t.__nowWorldShapeBounds||(t.__nowWorldShapeBounds={});let l,h,c,u,d,p;Pm(s.strokeSpread?(Lm(Mm,s.boxBounds,s.strokeSpread),Mm):s.boxBounds,o,a);let{scaleX:f,scaleY:g}=t.getRenderScaleData(!0);if(r.includes(a))p=i,l=d=a,h=o;else{let i;i=Qa.fullImageShadow?a:Am(s.renderShapeSpread?Om(r,Os.swapAndScale(s.renderShapeSpread,f,g)):r,a),u=r.getFitMatrix(i);let{a:v,d:_}=u;u.a<1&&(p=e.getSameCanvas(),t.__renderShape(p,n),f*=v,g*=_),d=Tm(a,u),l=Bm(d,-u.e,-u.f),h=Tm(o,u),Rm(h,-u.e,-u.f);const m=n.matrix;m?(c=new ma(u),c.multiply(m),v*=m.scaleX,_*=m.scaleY):c=u,c.withScale(v,_),n=Object.assign(Object.assign({},n),{matrix:c})}return t.__renderShape(i,n),{canvas:i,matrix:c,fitMatrix:u,bounds:l,renderBounds:h,worldCanvas:p,shapeBounds:d,scaleX:f,scaleY:g}}},Nm=new Xa,{isSame:jm}=Va;function Vm(t,e,n,i,r,o){let s=!0;const a=t.__;if("fill"!==e||a.__naturalWidth||(a.__naturalWidth=i.width/a.pixelRatio,a.__naturalHeight=i.height/a.pixelRatio,a.__autoSide&&(t.forceUpdate("width"),Kd.updateBounds(t),t.__proxyData&&(t.setProxyAttr("width",a.width),t.setProxyAttr("height",a.height)),s=!1)),!r.data){mg.createData(r,i,n,o);const{transform:t}=r.data,{opacity:e,blendMode:s}=n,l=t&&!t.onlyScale||a.path||a.cornerRadius;(l||e&&e<1||s)&&(r.complex=!l||2)}return n.filter&&mg.applyFilter(r,i,n.filter,t),s}function Hm(t,e){Xm(t,Pp.LOAD,e)}function Um(t,e){Xm(t,Pp.LOADED,e)}function Ym(t,e,n){e.error=n,t.forceUpdate("surface"),Xm(t,Pp.ERROR,e)}function Xm(t,e,n){t.hasEvent(e)&&t.emitEvent(new Pp(e,n))}function Gm(t,e){const{leafer:n}=t;n&&n.viewReady&&(n.renderer.ignore=e)}var{get:$m,translate:Km}=Qs,qm=new Xa,Zm={},Jm={};function Qm(t,e,n,i){const r=ds(t)||i?(i?n-i*e:n%e)/((i||Math.floor(n/e))-1):t;return"auto"===t&&r<0?0:r}var ty={},ey={a:1,b:0,c:0,d:1,e:0,f:0},{get:ny,set:iy,rotateOfOuter:ry,translate:oy,scaleOfOuter:sy,multiplyParent:ay,scale:ly,rotate:hy,skew:cy}=Qs;function uy(t,e,n,i,r,o,s,a){s&&hy(t,s),a&&cy(t,a.x,a.y),r&&ly(t,r,o),oy(t,e.x+n,e.y+i)}var{get:dy,scale:py,copy:fy}=Qs,{getFloorScale:gy}=Ws,{abs:vy}=Math,_y={image:function(t,e,n,i,r){let o,s;const a=nd.get(n,n.type);return Wm&&n===Wm.paint&&jm(i,Wm.boxBounds)?o=Wm.leafPaint:(o={type:n.type,image:a},a.hasAlphaPixel&&(o.isTransparent=!0),Wm=a.use>1?{leafPaint:o,paint:n,boxBounds:Nm.set(i)}:null),(r||a.loading)&&(s={image:a,attrName:e,attrValue:n}),a.ready?(Vm(t,e,n,a,o,i),r&&(Hm(t,s),Um(t,s))):a.error?r&&Ym(t,s,a.error):(r&&(Gm(t,!0),Hm(t,s)),o.loadId=a.load(()=>{Gm(t,!1),t.destroyed||(Vm(t,e,n,a,o,i)&&(a.hasAlphaPixel&&(t.__layout.hitCanvasChanged=!0),t.forceUpdate("surface")),Um(t,s)),o.loadId=void 0},e=>{Gm(t,!1),Ym(t,s,e),o.loadId=void 0},n.lod&&a.getThumbSize(n.lod)),t.placeholderColor&&(t.placeholderDelay?setTimeout(()=>{a.ready||(a.isPlacehold=!0,t.forceUpdate("surface"))},t.placeholderDelay):a.isPlacehold=!0)),o},checkImage:function(t,e,n,i,r){const{scaleX:o,scaleY:s}=mg.getImageRenderScaleData(t,n,i,r),a=t.film?t.nowIndex:o+"-"+s,{image:l,data:h,originPaint:c}=t,{exporting:u,snapshot:d}=r;return!(!h||t.patternId===a&&!u||d||(e&&(h.repeat?e=!1:c.changeful||t.film||"miniapp"===Qa.name||u||(e=Qa.image.isLarge(l,o,s)||l.width*o>8096||l.height*s>8096)),e?(n.__.__isFastShadow&&(i.fillStyle=t.style||"#000",i.fill()),mg.drawImage(t,o,s,n,i,r),0):(!t.style||c.sync||u?mg.createPattern(t,n,i,r):mg.createPatternTask(t,n,i,r),1)))},drawImage:function(t,e,n,i,r,o){const{data:s,image:a,complex:l}=t;let{width:h,height:c}=a;if(l){const{blendMode:o,opacity:u}=t.originPaint,{transform:d}=s;r.save(),2===l&&r.clipUI(i),o&&(r.blendMode=o),u&&(r.opacity*=u),d&&r.transform(d),a.render(r,0,0,h,c,i,t,e,n),r.restore()}else s.scaleX&&(h*=s.scaleX,c*=s.scaleY),a.render(r,0,0,h,c,i,t,e,n)},getImageRenderScaleData:function(t,e,n,i){const r=e.getRenderScaleData(!0,t.originPaint.scaleFixed),{data:o}=t;if(n){const{pixelRatio:t}=n;r.scaleX*=t,r.scaleY*=t}return o&&o.scaleX&&(r.scaleX*=Math.abs(o.scaleX),r.scaleY*=Math.abs(o.scaleY)),r},recycleImage:function(t,e){const n=e["_"+t];if(gs(n)){let i,r,o,s,a;for(let l=0,h=n.length;l<h;l++)i=n[l],r=i.image,a=r&&r.url,a&&(o||(o={}),o[a]=!0,nd.recyclePaint(i),e.__willDestroy&&r.parent&&mg.recycleFilter(r,e.__leaf),r.loading&&(s||(s=e.__input&&e.__input[t]||[],gs(s)||(s=[s])),r.unload(n[l].loadId,!s.some(t=>t.url===a))));return o}return null},createPatternTask:function(t,e,n,i){t.patternTask||(t.patternTask=nd.patternTasker.add(()=>K_(this,void 0,void 0,function*(){mg.createPattern(t,e,n,i),e.forceUpdate("surface")}),0,()=>(t.patternTask=null,n.bounds.hit(e.__nowWorld))))},createPattern:function(t,e,n,i){let{scaleX:r,scaleY:o}=mg.getImageRenderScaleData(t,e,n,i),s=t.film?t.nowIndex:r+"-"+o;if(t.patternId!==s&&!e.destroyed&&(!Qa.image.isLarge(t.image,r,o)||t.data.repeat)){const{image:n,data:i}=t,{opacity:a}=t.originPaint,{transform:l,gap:h}=i,c=mg.getPatternFixScale(t,r,o);let u,d,p,{width:f,height:g}=n;c&&(r*=c,o*=c),f*=r,g*=o,h&&(d=h.x*r/vy(i.scaleX||1),p=h.y*o/vy(i.scaleY||1)),(l||1!==r||1!==o)&&(r*=gy(f+(d||0)),o*=gy(g+(p||0)),u=dy(),l&&fy(u,l),py(u,1/r,1/o));const v=n.getCanvas(f,g,a,void 0,d,p,e.leafer&&e.leafer.config.smooth,i.interlace);t.style=n.getPattern(v,i.repeat||Qa.origin.noRepeat||"no-repeat",u,t),t.patternId=s}},getPatternFixScale:function(t,e,n){const{image:i}=t;let r,o=Qa.image.maxPatternSize,s=i.width*i.height;return i.isSVG?e>1&&(r=Math.ceil(e)/e):o>s&&(o=s),(s*=e*n)>o&&(r=Math.sqrt(o/s)),r},createData:function(t,e,n,i){t.data=mg.getPatternData(n,i,e)},getPatternData:function(t,e,n){t.padding&&(e=qm.set(e).shrink(t.padding)),"strench"===t.mode&&(t.mode="stretch");const{width:i,height:r}=n,{mode:o,align:s,offset:a,scale:l,size:h,rotation:c,skew:u,clipSize:d,repeat:p,gap:f,interlace:g}=t,v=e.width===i&&e.height===r,_={mode:o},m="center"!==s&&(c||0)%180==90;let y,b;switch(Va.set(Jm,0,0,m?r:i,m?i:r),o&&"cover"!==o&&"fit"!==o?((l||h)&&(Ws.getScaleData(l,h,n,Zm),y=Zm.scaleX,b=Zm.scaleY),(s||f||p)&&(y&&Va.scale(Jm,y,b,!0),s&&Pa.toPoint(s,Jm,e,Jm,!0,!0))):v&&!c||(y=b=Va.getFitScale(e,Jm,"fit"!==o),Va.put(e,n,s,y,!1,Jm),Va.scale(Jm,y,b,!0)),a&&ua.move(Jm,a),o){case"stretch":v?y&&(y=b=void 0):(y=e.width/i,b=e.height/r,mg.stretchMode(_,e,y,b));break;case"normal":case"clip":if(Jm.x||Jm.y||y||d||c||u){let t,n;d&&(t=e.width/d.width,n=e.height/d.height),mg.clipMode(_,e,Jm.x,Jm.y,y,b,c,u,t,n),t&&(y=y?y*t:t,b=b?b*n:n)}break;case"repeat":(!v||y||c||u)&&mg.repeatMode(_,e,i,r,Jm.x,Jm.y,y,b,c,u,s,t.freeTransform),p||(_.repeat="repeat");const n=vs(p);(f||n)&&(_.gap=function(t,e,n,i,r){let o,s;return vs(t)?(o=t.x,s=t.y):o=s=t,{x:Qm(o,n,r.width,e&&e.x),y:Qm(s,i,r.height,e&&e.y)}}(f,n&&p,Jm.width,Jm.height,e));break;default:y&&mg.fillOrFitMode(_,e,Jm.x,Jm.y,y,b,c)}return _.transform||(e.x||e.y)&&Km(_.transform=$m(),e.x,e.y),y&&(_.scaleX=y,_.scaleY=b),p&&(_.repeat=ds(p)?"x"===p?"repeat-x":"repeat-y":"repeat"),g&&(_.interlace=fs(g)||"percent"===g.type?{type:"x",offset:g}:g),_},stretchMode:function(t,e,n,i){const r=ny(),{x:o,y:s}=e;o||s?oy(r,o,s):n>0&&i>0&&(r.onlyScale=!0),ly(r,n,i),t.transform=r},fillOrFitMode:function(t,e,n,i,r,o,s){const a=ny();oy(a,e.x+n,e.y+i),ly(a,r,o),s&&ry(a,{x:e.x+e.width/2,y:e.y+e.height/2},s),t.transform=a},clipMode:function(t,e,n,i,r,o,s,a,l,h){const c=ny();uy(c,e,n,i,r,o,s,a),l&&(s||a?(iy(ey),sy(ey,e,l,h),ay(c,ey)):sy(c,e,l,h)),t.transform=c},repeatMode:function(t,e,n,i,r,o,s,a,l,h,c,u){const d=ny();if(u)uy(d,e,r,o,s,a,l,h);else{if(l)if("center"===c)ry(d,{x:n/2,y:i/2},l);else switch(hy(d,l),l){case 90:oy(d,i,0);break;case 180:oy(d,n,i);break;case 270:oy(d,0,n)}ty.x=e.x+r,ty.y=e.y+o,oy(d,ty.x,ty.y),s&&sy(d,ty,s,a)}t.transform=d}},{toPoint:my}=xa,{hasTransparent:yy}=fg,by={},wy={};function xy(t,e,n,i){if(n){let r,o,s,a;for(let t=0,l=n.length;t<l;t++)r=n[t],ds(r)?(s=t/(l-1),o=fg.string(r,i)):(s=r.offset,o=fg.string(r.color,i)),e.addColorStop(s,o),!a&&yy(o)&&(a=!0);a&&(t.isTransparent=!0)}}var{getAngle:Sy,getDistance:ky}=ua,{get:Cy,rotateOfOuter:Ey,scaleOfOuter:Oy}=Qs,{toPoint:Ly}=xa,Py={},Ty={};function By(t,e,n,i,r){let o;const{width:s,height:a}=t;if(s!==a||i){const t=Sy(e,n);o=Cy(),r?(Oy(o,e,s/a*(i||1),1),Ey(o,e,t+90)):(Oy(o,e,1,s/a*(i||1)),Ey(o,e,t))}return o}var{getDistance:Ry}=ua,{toPoint:Ay}=xa,My={},Dy={},Iy={linearGradient:function(t,e){let{from:n,to:i,type:r,opacity:o}=t;my(n||"top",e,by),my(i||"bottom",e,wy);const s=Qa.canvas.createLinearGradient(by.x,by.y,wy.x,wy.y),a={type:r,style:s};return xy(a,s,t.stops,o),a},radialGradient:function(t,e){let{from:n,to:i,type:r,opacity:o,stretch:s}=t;Ly(n||"center",e,Py),Ly(i||"bottom",e,Ty);const a=Qa.canvas.createRadialGradient(Py.x,Py.y,0,Py.x,Py.y,ky(Py,Ty)),l={type:r,style:a};xy(l,a,t.stops,o);const h=By(e,Py,Ty,s,!0);return h&&(l.transform=h),l},conicGradient:function(t,e){let{from:n,to:i,type:r,opacity:o,rotation:s,stretch:a}=t;Ay(n||"center",e,My),Ay(i||"bottom",e,Dy);const l=Qa.conicGradientSupport?Qa.canvas.createConicGradient(s?s*Ns:0,My.x,My.y):Qa.canvas.createRadialGradient(My.x,My.y,0,My.x,My.y,Ry(My,Dy)),h={type:r,style:l};xy(h,l,t.stops,o);const c=By(e,My,Dy,a||1,Qa.conicGradientRotate90);return c&&(h.transform=c),h},getTransform:By},{copy:Fy,move:Wy,toOffsetOutBounds:zy}=Va,{max:Ny,abs:jy}=Math,Vy={},Hy=new ma,Uy={};function Yy(t,e){let n,i,r,o,s=0,a=0,l=0,h=0;return e.forEach(t=>{n=t.x||0,i=t.y||0,o=1.5*(t.blur||0),r=jy(t.spread||0),s=Ny(s,r+o-i),a=Ny(a,r+o+n),l=Ny(l,r+o+i),h=Ny(h,r+o-n)}),s===a&&a===l&&l===h?s:[s,a,l,h]}function Xy(t,e,n){const{shapeBounds:i}=n;let r,o;Qa.fullImageShadow?(Fy(Vy,t.bounds),Wy(Vy,e.x-i.x,e.y-i.y),r=t.bounds,o=Vy):(r=i,o=e),t.copyWorld(n.canvas,r,o)}var Gy,{toOffsetOutBounds:$y}=Va,Ky={},qy={shadow:function(t,e,n){let i,r;const{__nowWorld:o}=t,{shadow:s}=t.__,{worldCanvas:a,bounds:l,renderBounds:h,shapeBounds:c,scaleX:u,scaleY:d}=n,p=e.getSameCanvas(),f=s.length-1;zy(l,Uy,h),s.forEach((s,g)=>{let v=1;if(s.scaleFixed){const t=Math.abs(o.scaleX);t>1&&(v=1/t)}p.setWorldShadow(Uy.offsetX+(s.x||0)*u*v,Uy.offsetY+(s.y||0)*d*v,(s.blur||0)*u*v,fg.string(s.color)),r=bg.getShadowTransform(t,p,n,s,Uy,v),r&&p.setTransform(r),Xy(p,Uy,n),r&&p.resetTransform(),i=h,s.box&&(p.restore(),p.save(),a&&(p.copyWorld(p,h,o,"copy"),i=o),a?p.copyWorld(a,o,o,"destination-out"):p.copyWorld(n.canvas,c,l,"destination-out")),Kd.copyCanvasByWorld(t,e,p,i,s.blendMode),f&&g<f&&p.clearWorld(i)}),p.recycle(i)},innerShadow:function(t,e,n){let i,r;const{__nowWorld:o}=t,{innerShadow:s}=t.__,{worldCanvas:a,bounds:l,renderBounds:h,shapeBounds:c,scaleX:u,scaleY:d}=n,p=e.getSameCanvas(),f=s.length-1;$y(l,Ky,h),s.forEach((s,g)=>{let v=1;if(s.scaleFixed){const t=Math.abs(o.scaleX);t>1&&(v=1/t)}p.save(),p.setWorldShadow(Ky.offsetX+(s.x||0)*u*v,Ky.offsetY+(s.y||0)*d*v,(s.blur||0)*u*v),r=bg.getShadowTransform(t,p,n,s,Ky,v,!0),r&&p.setTransform(r),Xy(p,Ky,n),p.restore(),a?(p.copyWorld(p,h,o,"copy"),p.copyWorld(a,o,o,"source-out"),i=o):(p.copyWorld(n.canvas,c,l,"source-out"),i=h),p.fillWorld(i,fg.string(s.color),"source-in"),Kd.copyCanvasByWorld(t,e,p,i,s.blendMode),f&&g<f&&p.clearWorld(i)}),p.recycle(i)},blur:function(t,e,n){const{blur:i}=t.__;n.setWorldBlur(i*t.__nowWorld.a),n.copyWorldToInner(e,t.__nowWorld,t.__layout.renderBounds),n.filter="none"},backgroundBlur:function(t,e,n){},getShadowRenderSpread:Yy,getShadowTransform:function(t,e,n,i,r,o,s){if(i.spread){const n=2*i.spread*o*(s?-1:1),{width:a,height:l}=t.__layout.strokeBounds;return Hy.set().scaleOfOuter({x:(r.x+r.width/2)*e.pixelRatio,y:(r.y+r.height/2)*e.pixelRatio},1+n/a,1+n/l),Hy}},isTransformShadow(t){},getInnerShadowSpread:Yy},{excludeRenderBounds:Zy}=rp;function Jy(t,e,n,i,r,o,s,a){switch(e){case"grayscale":Gy||(Gy=!0,r.useGrayscaleAlpha(t.__nowWorld));case"alpha":!function(t,e,n,i,r,o){const s=t.__nowWorld;n.resetTransform(),n.opacity=1,n.useMask(i,s),o&&i.recycle(s),tb(t,e,n,1,r,o)}(t,n,i,r,s,a);break;case"opacity-path":tb(t,n,i,o,s,a);break;case"path":a&&n.restore()}}function Qy(t){return t.getSameCanvas(!1,!0)}function tb(t,e,n,i,r,o){const s=t.__nowWorld;e.resetTransform(),e.opacity=i,e.copyWorld(n,s,void 0,r),o?n.recycle(s):n.clearWorld(s)}Gg.prototype.__renderMask=function(t,e){let n,i,r,o,s,a;const{children:l}=this;for(let h=0,c=l.length;h<c;h++){if(n=l[h],a=n.__.mask,a){s&&(Jy(this,s,t,r,i,o,void 0,!0),i=r=null),"clipping"!==a&&"clipping-path"!==a||Zy(n,e)||n.__render(t,e),o=n.__.opacity,Gy=!1,"path"===a||"clipping-path"===a?(o<1?(s="opacity-path",r||(r=Qy(t))):(s="path",t.save()),n.__clip(r||t,e)):(s="grayscale"===a?"grayscale":"alpha",i||(i=Qy(t)),r||(r=Qy(t)),n.__render(i,e));continue}const c=1===o&&n.__.__blendMode;c&&Jy(this,s,t,r,i,o,void 0,!1),Zy(n,e)||n.__render(r||t,e),c&&Jy(this,s,t,r,i,o,c,!1)}Jy(this,s,t,r,i,o,void 0,!0)};var eb=">)]}%!?,.:;'\"》)」〉』〗】〕}┐>’”!?,、。:;‰",nb=eb+"_#~&*+\\=|≮≯≈≠=…",ib=new RegExp([[19968,40959],[13312,19903],[131072,173791],[173824,177983],[177984,178207],[178208,183983],[183984,191471],[196608,201551],[201552,205743],[11904,12031],[12032,12255],[12272,12287],[12288,12351],[12736,12783],[12800,13055],[13056,13311],[63744,64255],[65072,65103],[127488,127743],[194560,195103]].map(([t,e])=>`[\\u${t.toString(16)}-\\u${e.toString(16)}]`).join("|"));function rb(t){const e={};return t.split("").forEach(t=>e[t]=!0),e}var ob,sb=rb("ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyz"),ab=rb("{[(<'\"《(「〈『〖【〔{┌<‘“=¥¥$€££¢¢"),lb=rb(eb),hb=rb(nb),cb=rb("- —/~|┆·");!function(t){t[t.Letter=0]="Letter",t[t.Single=1]="Single",t[t.Before=2]="Before",t[t.After=3]="After",t[t.Symbol=4]="Symbol",t[t.Break=5]="Break"}(ob||(ob={}));var{Letter:ub,Single:db,Before:pb,After:fb,Symbol:gb,Break:vb}=ob;function _b(t){return sb[t]?ub:cb[t]?vb:ab[t]?pb:lb[t]?fb:hb[t]?gb:ib.test(t)?db:ub}var mb={trimRight(t){const{words:e}=t;let n,i=0,r=e.length;for(let o=r-1;o>-1&&(n=e[o].data[0]," "===n.char);o--)i++,t.width-=n.width;i&&e.splice(r-i,i)}};function yb(t,e,n){switch(e){case"title":return n?t.toUpperCase():t;case"upper":return t.toUpperCase();case"lower":return t.toLowerCase();default:return t}}var bb,wb,xb,Sb,kb,Cb,Eb,Ob,Lb,Pb,Tb,Bb,Rb,Ab,Mb,Db,Ib,{trimRight:Fb}=mb,{Letter:Wb,Single:zb,Before:Nb,After:jb,Symbol:Vb,Break:Hb}=ob,Ub=[];function Yb(t,e){Lb&&!Ob&&(Ob=Lb),bb.data.push({char:t,width:e}),xb+=e}function Xb(){Sb+=xb,bb.width=xb,wb.words.push(bb),bb={data:[]},xb=0}function Gb(){Ab&&(Mb.paraNumber++,wb.paraStart=!0,Ab=!1),Lb&&(wb.startCharSize=Ob,wb.endCharSize=Lb,Ob=0),wb.width=Sb,Db.width?Fb(wb):Ib&&$b(),Ub.push(wb),wb={words:[]},Sb=0}function $b(){Sb>(Mb.maxWidth||0)&&(Mb.maxWidth=Sb)}var{top:Kb,right:qb,bottom:Zb,left:Jb}=Zs;function Qb(t,e,n){const{bounds:i,rows:r}=t;i[e]+=n;for(let o=0;o<r.length;o++)r[o][e]+=n}Object.assign(pg,{getDrawData:function(t,e){ds(t)||(t=String(t));let n=0,i=0,r=e.__getInput("width")||0,o=e.__getInput("height")||0;const{__padding:s}=e;s&&(r?(n=s[Jb],r-=s[qb]+s[Jb],!r&&(r=.01)):e.autoSizeAlign||(n=s[Jb]),o?(i=s[Kb],o-=s[Kb]+s[Zb],!o&&(o=.01)):e.autoSizeAlign||(i=s[Kb]));const a={bounds:{x:n,y:i,width:r,height:o},rows:[],paraNumber:0,font:Qa.canvas.font=e.__font};return function(t,e,n){Mb=t,Ub=t.rows,Ib=!(Db=t.bounds).width&&!n.autoSizeAlign;const{__letterSpacing:i,paraIndent:r,textCase:o}=n,{canvas:s}=Qa,{width:a}=Db;if(n.__isCharMode){const t="none"!==n.textWrap,l="break"===n.textWrap;Ab=!0,Tb=null,Ob=Eb=Lb=xb=Sb=0,bb={data:[]},wb={words:[]};for(let n=0,h=(e=[...e]).length;n<h;n++)"\n"===(Cb=e[n])?(xb&&Xb(),wb.paraEnd=!0,Gb(),Ab=!0):((Pb=_b(Cb))===Wb&&"none"!==o&&(Cb=yb(Cb,o,!xb)),Eb=s.measureText(Cb).width,i&&(i<0&&(Lb=Eb),Eb+=i),Bb=Pb===zb&&(Tb===zb||Tb===Wb)||Tb===zb&&Pb!==jb,Rb=!(Pb!==Nb&&Pb!==zb||Tb!==Vb&&Tb!==jb),kb=Ab&&r?a-r:a,t&&a&&Sb+xb+Eb>kb&&(l?(xb&&Xb(),Sb&&Gb()):(Rb||(Rb=Pb===Wb&&Tb==jb),Bb||Rb||Pb===Hb||Pb===Nb||Pb===zb||xb+Eb>kb?(xb&&Xb(),Sb&&Gb()):Sb&&Gb()))," "===Cb&&!0!==Ab&&Sb+xb===0||(Pb===Hb?(" "===Cb&&xb&&Xb(),Yb(Cb,Eb),Xb()):Bb||Rb?(xb&&Xb(),Yb(Cb,Eb)):Yb(Cb,Eb)),Tb=Pb);xb&&Xb(),Sb&&Gb(),Ub.length>0&&(Ub[Ub.length-1].paraEnd=!0)}else e.split("\n").forEach(t=>{Mb.paraNumber++,Sb=s.measureText(t).width,Ub.push({x:r||0,text:t,width:Sb,paraStart:!0}),Ib&&$b()})}(a,t,e),s&&function(t,e,n,i,r){if(!i&&n.autoSizeAlign)switch(n.textAlign){case"left":Qb(e,"x",t[Jb]);break;case"right":Qb(e,"x",-t[qb])}if(!r&&n.autoSizeAlign)switch(n.verticalAlign){case"top":Qb(e,"y",t[Kb]);break;case"bottom":Qb(e,"y",-t[Zb])}}(s,a,e,r,o),function(t,e){const{rows:n,bounds:i}=t,r=n.length,{__lineHeight:o,__baseLine:s,__letterSpacing:a,__clipText:l,textAlign:h,verticalAlign:c,paraSpacing:u,autoSizeAlign:d}=e;let{x:p,y:f,width:g,height:v}=i,_=o*r+(u?u*(t.paraNumber-1):0),m=s;if(l&&_>v)_=Math.max(e.__autoHeight?_:v,o),r>1&&(t.overflow=r);else if(v||d)switch(c){case"middle":f+=(v-_)/2;break;case"bottom":f+=v-_}m+=f;let y,b,w,x=g||d?g:t.maxWidth;for(let S=0,k=r;S<k;S++){if(y=n[S],y.x=p,y.width<g||y.width>g&&!l)switch(h){case"center":y.x+=(x-y.width)/2;break;case"right":y.x+=x-y.width}y.paraStart&&u&&S>0&&(m+=u),y.y=m,m+=o,t.overflow>S&&m>_&&(y.isOverflow=!0,t.overflow=S+1),b=y.x,w=y.width,a<0&&(y.width<0?(w=-y.width+e.fontSize+a,b-=w,w+=e.fontSize):w-=a),b<i.x&&(i.x=b),w>i.width&&(i.width=w),l&&g&&g<w&&(y.isOverflow=!0,t.overflow||(t.overflow=n.length))}i.y=f,i.height=_}(a,e),e.__isCharMode&&function(t,e,n){const{rows:i}=t,{textAlign:r,paraIndent:o,__letterSpacing:s}=e,a=n&&r.includes("both"),l=a||n&&r.includes("justify"),h=l&&r.includes("letter");let c,u,d,p,f,g,v,_,m,y;i.forEach(t=>{t.words&&(f=o&&t.paraStart?o:0,_=t.words.length,l&&(y=!t.paraEnd||a,u=n-t.width-f,h?p=u/(t.words.reduce((t,e)=>t+e.data.length,0)-1):d=_>1?u/(_-1):0),g=s||t.isOverflow||h?0:d?1:2,t.isOverflow&&!s&&(t.textMode=!0),2===g?(t.x+=f,function(t){t.text="",t.words.forEach(e=>{e.data.forEach(e=>{t.text+=e.char})})}(t)):(t.x+=f,c=t.x,t.data=[],t.words.forEach((e,n)=>{1===g?(v={char:"",x:c},c=function(t,e,n){return t.forEach(t=>{n.char+=t.char,e+=t.width}),e}(e.data,c,v),(t.isOverflow||" "!==v.char)&&t.data.push(v)):c=function(t,e,n,i,r){return t.forEach(t=>{(i||" "!==t.char)&&(t.x=e,n.push(t)),e+=t.width,r&&(e+=r)}),e}(e.data,c,t.data,t.isOverflow,y&&p),y&&(m=n===_-1,d?m||(c+=d,t.width+=d):p&&(t.width+=p*(e.data.length-(m?1:0))))})),t.words=null)})}(a,e,r),a.overflow&&function(t,e,n,i){const{rows:r,overflow:o}=t;let{textOverflow:s}=e;if(o&&r.splice(o),i&&s&&"show"!==s){let t,a;"hide"===s?s="":"ellipsis"===s&&(s="...");const l=s?Qa.canvas.measureText(s).width:0,h=n+i-l;("none"===e.textWrap?r:[r[o-1]]).forEach(e=>{if(e.isOverflow&&e.data){let n=e.data.length-1;for(let i=n;i>-1&&(t=e.data[i],a=t.x+t.width,!(i===n&&a<h));i--){if(a<h&&" "!==t.char||!i){e.data.splice(i+1),e.width-=t.width;break}e.width-=t.width}e.width+=l,e.data.push({char:s,x:a}),e.textMode&&function(t){t.text="",t.data.forEach(e=>{t.text+=e.char}),t.data=null}(e)}})}}(a,e,n,r),"none"!==e.textDecoration&&function(t,e){let n,i=0;const{fontSize:r,textDecoration:o}=e;switch(t.decorationHeight=r/11,vs(o)?(n=o.type,o.color&&(t.decorationColor=fg.string(o.color)),o.offset&&(i=Math.min(.3*r,Math.max(o.offset,.15*-r)))):n=o,n){case"under":t.decorationY=[.15*r+i];break;case"delete":t.decorationY=[.35*-r];break;case"under-delete":t.decorationY=[.15*r+i,.35*-r]}}(a,e),a}}),Object.assign(fg,{string:function(t,e){if(!t)return"#000";const n=fs(e)&&e<1;if(ds(t)){if(!n||!fg.object)return t;t=fg.object(t)}let i=cs(t.a)?1:t.a;n&&(i*=e);const r=t.r+","+t.g+","+t.b;return 1===i?"rgb("+r+")":"rgba("+r+","+i+")"}}),Object.assign(_g,zm),Object.assign(mg,_y),Object.assign(yg,Iy),Object.assign(bg,qy),Object.assign(cl,{interaction:(t,e,n,i)=>new wm(t,e,n,i),hitCanvas:(t,e)=>new Z_(t,e),hitCanvasManager:()=>new M_}),Qa.origin={createCanvas(t,e){const n=document.createElement("canvas");return n.width=t,n.height=e,n},canvasToDataURL:(t,e,n)=>{const i=$u.mimeType(e),r=t.toDataURL(i,n);return"image/bmp"===i?r.replace("image/png;","image/bmp;"):r},canvasToBolb:(t,e,n)=>new Promise(i=>t.toBlob(i,$u.mimeType(e),n)),canvasSaveAs:(t,e,n)=>{const i=t.toDataURL($u.mimeType($u.fileType(e)),n);return Qa.origin.download(i,e)},download(t,e){return K_(this,void 0,void 0,function*(){let n=document.createElement("a");n.href=t,n.download=e,document.body.appendChild(n),n.click(),document.body.removeChild(n)})},loadImage:(t,e,n)=>new Promise((n,i)=>{const r=new Qa.origin.Image;e&&(r.setAttribute("crossOrigin",e),r.crossOrigin=e),r.onload=()=>{n(r)},r.onerror=t=>{i(t)},r.src=Qa.image.getRealURL(t)}),loadContent(t){return K_(this,arguments,void 0,function*(t,e="text"){const n=yield fetch(t);if(!n.ok)throw new Error(`${n.status}`);return yield n[e]()})},Image:Image,PointerEvent:PointerEvent,DragEvent:DragEvent},Qa.event={stopDefault(t){t.preventDefault()},stopNow(t){t.stopImmediatePropagation()},stop(t){t.stopPropagation()}},Qa.canvas=cl.canvas(),Qa.conicGradientSupport=!!Qa.canvas.context.createConicGradient;var{M:tw,L:ew,C:nw,Q:iw,Z:rw,N:ow,D:sw,X:aw,G:lw,F:hw,O:cw,P:uw,U:dw}=Il,pw={scale(t,e,n){if(!t)return;let i,r=0,o=t.length;for(;r<o;)switch(i=t[r],i){case tw:case ew:fw(t,e,n,r,1),r+=3;break;case nw:fw(t,e,n,r,3),r+=7;break;case iw:fw(t,e,n,r,2),r+=5;break;case rw:r+=1;break;case ow:fw(t,e,n,r,2),r+=5;break;case sw:fw(t,e,n,r,2),r+=9;break;case aw:fw(t,e,n,r,2),r+=6;break;case lw:fw(t,e,n,r,2),r+=9;break;case hw:fw(t,e,n,r,2),r+=5;break;case cw:t[r]=lw,t.splice(r+4,0,t[r+3],0),fw(t,e,n,r,2),r+=9,o+=2;break;case uw:t[r]=hw,t.splice(r+4,0,t[r+3]),fw(t,e,n,r,2),r+=5,o+=1;break;case dw:fw(t,e,n,r,2),r+=6}},scalePoints(t,e,n,i,r){for(let o=r?i+1:0,s=r?o+2*r:t.length;o<s;o+=2)t[o]*=e,t[o+1]*=n}},{scalePoints:fw}=pw,gw=Qs.get(),{topLeft:vw,top:_w,topRight:mw,right:yw,bottom:bw,left:ww}=Js;function xw(t,e,n){t.pathInputed?kw(t,e,n):(1!==e&&(t.width*=e),1!==n&&(t.height*=n))}function Sw(t,e,n,i){let r=e;if(!cs(i)){const o=t.__layout;let{width:s,height:a}=o.boxBounds;switch(s*=n-e,a*=e-n,i){case _w:case bw:r=n,o.affectScaleOrRotation?t.moveInner(-s/2,0):t.x-=s/2;break;case ww:case yw:o.affectScaleOrRotation?t.moveInner(0,-a/2):t.y-=a/2;break;case vw:case mw:o.affectScaleOrRotation?t.moveInner(0,-a):t.y-=a}}t.fontSize*=r;const o=t.__,{padding:s,lineHeight:a,letterSpacing:l}=o;s&&(t.padding=gs(s)?s.map(t=>t*r):s*r),o.__autoWidth||(t.width*=r),o.__autoHeight||(t.height*=r),vs(a)?"px"===a.type&&(o.lineHeight={type:"px",value:a.value*r}):a&&(o.lineHeight=a*r),vs(l)?"px"===l.type&&(o.letterSpacing={type:"px",value:l.value*r}):l&&(o.letterSpacing=l*r)}function kw(t,e,n){pw.scale(t.__.path,e,n),t.path=t.__.path}function Cw(t,e,n){const{points:i}=t;vs(i[0])?i.forEach(t=>{t.x*=e,t.y*=n}):pw.scalePoints(i,e,n),t.points=i}function Ew(t,e,n){const{children:i}=t;for(let r=0;r<i.length;r++)gw.a=e,gw.d=n,i[r].transform(gw,!0)}var Ow=Zf.prototype;function Lw(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s}function Pw(t){return t?gs(t)?t:[t]:[]}Ow.scaleResize=function(t,e=t,n){const i=this;n||i.editConfig&&"scale"===i.editConfig.editSize?(i.scaleX*=t,i.scaleY*=e):(t<0&&(i.scaleX*=-1,t=-t),e<0&&(i.scaleY*=-1,e=-e),this.__scaleResize(t,e))},Ow.__scaleResize=function(t,e){xw(this,t,e)},Ow.resizeWidth=function(t){const e=t/this.getBounds("box","local").width||1;this.scaleOf(this.__layout.boxBounds,e,this.__.lockRatio?e:1,!0)},Ow.resizeHeight=function(t){const e=t/this.getBounds("box","local").height||1;this.scaleOf(this.__layout.boxBounds,this.__.lockRatio?e:1,e,!0)},Wv.prototype.__scaleResize=function(t,e){const{app:n,editConfig:i}=this,r=n&&n.editor,o=r&&r.dragPoint;if(this.__.resizeFontSize||i&&"font-size"===i.editSize||o&&"font-size"===r.mergedConfig.editSize)Sw(this,t,e,o&&o.direction);else{const{__autoWidth:n,__autoHeight:i,textAlign:r,verticalAlign:o}=this.__,{boxBounds:s}=this.__layout;n&&"left"!==r&&1!==t&&(this.x+=s.x),i&&"top"!==o&&1!==e&&(this.y+=s.y),xw(this,t,e)}},zv.prototype.__scaleResize=function(t,e){kw(this,t,e)},Tv.prototype.__scaleResize=function(t,e){this.pathInputed?kw(this,t,e):this.points?Cw(this,t,e):this.width*=t},gv.prototype.__scaleResize=function(t,e){this.pathInputed?kw(this,t,e):this.points?Cw(this,t,e):xw(this,t,e)},Gg.prototype.__scaleResize=function(t,e){Ew(this,t,e)},nv.prototype.__scaleResize=function(t,e){const{resizeChildren:n,__autoSize:i}=this.__;i&&n||xw(this,t,e),n&&Ew(this,t,e)},hl.add("resize");var Tw=class extends kp{get list(){return Pw(this.value)}get oldList(){return Pw(this.oldValue)}constructor(t,e){super(t),e&&Object.assign(this,e)}};function Bw(t){return(e,n)=>{const i="_"+n;ad(e,n,{get(){return this[i]},set(e){const r=this[i];if(r!==e){const o=this;if(o.config){const t="target"===n;if(t){const{beforeSelect:t}=o.config;if(t){const n=t({target:e});if(vs(n))e=n;else if(!1===n)return}o.hasDimOthers&&o.cancelDimOthers(),gs(e)&&e.length>1&&e[0].locked&&e.splice(0,1),o.single&&(delete o.element.syncEventer,delete o.element.__world.ignorePixelSnap)}const i=t?Tw.BEFORE_SELECT:Tw.BEFORE_HOVER;this.hasEvent(i)&&this.emitEvent(new Tw(i,{editor:o,value:e,oldValue:r}))}this[i]=e,t(this,r)}}})}}Tw.BEFORE_SELECT="editor.before_select",Tw.SELECT="editor.select",Tw.AFTER_SELECT="editor.after_select",Tw.BEFORE_HOVER="editor.before_hover",Tw.HOVER="editor.hover";var{abs:Rw}=Math,{copy:Aw}=Qs,{setListWithFn:Mw}=Va,{worldBounds:Dw}=rp,Iw={a:1,b:0,c:0,d:1,e:0,f:0},Fw={x:0,y:0,width:0,height:0},Ww=class extends Yg{constructor(){super(),this.list=[],this.visible=0,this.hittable=!1,this.strokeAlign="center"}setTarget(t,e){e&&this.set(e),this.target=t,this.update()}update(t){const{list:e}=this;e.length?(Mw(Fw,e,Dw),t&&this.set(t),this.set(Fw),this.visible=!0):this.visible=0}__draw(t,e){const{list:n}=this;if(n.length){let i;const r=this.__,{stroke:o,strokeWidth:s,fill:a}=r,{bounds:l}=e;for(let h=0;h<n.length;h++){i=n[h];const{worldTransform:c,worldRenderBounds:u}=i;if(u.width&&u.height&&(!l||l.hit(u,e.matrix))){const n=Rw(c.scaleX),l=Rw(c.scaleY);if(Aw(Iw,c),Iw.half=s%2,t.setWorld(Iw,e.matrix),t.beginPath(),"path"===this.strokePathType||i.__.__useArrow?i.__drawPath(t):i.__.__pathForRender?i.__drawRenderPath(t):i.__drawPathByBox(t),r.strokeWidth=s/Math.max(n,l),r.shadow){const e=r.shadow[0],{scaleX:n,scaleY:i}=this.getRenderScaleData(!0,e.scaleFixed);t.save(),t.setWorldShadow(e.x*n,e.y*i,e.blur*n,fg.string(e.color))}o&&(ds(o)?_g.stroke(o,this,t,e):_g.strokes(o,this,t,e)),a&&(ds(a)?_g.fill(a,this,t,e):_g.fills(a,this,t,e)),r.shadow&&t.restore()}}r.strokeWidth=s}}destroy(){this.target=null,super.destroy()}};Lw([Bw(function(t){const e=t.target;t.list=e?gs(e)?e:[e]:[]})],Ww.prototype,"target",void 0),Lw([xd("render-path")],Ww.prototype,"strokePathType",void 0);var zw=class extends Gg{constructor(t){super(t),this.strokeArea=new qg({strokeAlign:"center"}),this.fillArea=new qg,this.visible=0,this.hittable=!1,this.addMany(this.fillArea,this.strokeArea)}setStyle(t,e){const{visible:n,stroke:i,strokeWidth:r}=t;this.visible=n,this.strokeArea.reset(Object.assign({stroke:i,strokeWidth:r},e||{})),this.fillArea.reset({visible:!e,fill:i,opacity:.2})}setBounds(t){this.strokeArea.set(t),this.fillArea.set(t)}},Nw={findOne:t=>t.list.find(t=>t.editable),findByBounds(t,e){const n=[];return jw([t],n,e),n}};function jw(t,e,n){let i,r;for(let o=0,s=t.length;o<s;o++)if(i=t[o],r=i.__,r.hittable&&r.visible&&!r.locked&&n.hit(i.__world)){if(r.editable){if(i.isBranch&&!r.hitChildren){r.hitSelf&&e.push(i);continue}if(i.isFrame){if(n.includes(i.__layout.boxBounds,i.__world)){e.push(i);continue}}else n.hit(i.__layout.boxBounds,i.__world)&&r.hitSelf&&e.push(i)}i.isBranch&&jw(i.children,e,n)}}var{findOne:Vw,findByBounds:Hw}=Nw,Uw=class extends Gg{get dragging(){return!!this.originList}get running(){const{editor:t,app:e}=this;return this.hittable&&t.visible&&t.hittable&&t.mergeConfig.selector&&e&&"normal"===e.mode}get isMoveMode(){const{app:t}=this;return t&&t.interaction.moveMode}constructor(t){super(),this.hoverStroker=new Ww,this.targetStroker=new Ww,this.bounds=new Xa,this.selectArea=new zw,this.__eventIds=[],this.editor=t,this.addMany(this.targetStroker,this.hoverStroker,this.selectArea),this.__listenEvents()}onHover(){const{editor:t}=this;if(!this.running||this.dragging||t.dragging)this.hoverStroker.target=null;else{const{hoverTarget:e,mergeConfig:n}=t,i=Object.assign({},n);e&&e.editConfig&&Object.assign(i,e.editConfig);const{stroke:r,strokeWidth:o,hover:s,hoverStyle:a}=i;this.hoverStroker.setTarget(s?e:null,Object.assign({stroke:r,strokeWidth:o},a||{}))}}onSelect(){this.running&&(this.targetStroker.setTarget(this.editor.list),this.hoverStroker.target=null)}update(){this.hoverStroker.update();const{stroke:t,strokeWidth:e,selectedPathType:n,selectedStyle:i}=this.editor.mergedConfig;this.targetStroker.update(Object.assign({stroke:t,strokeWidth:e&&Math.max(1,e/2),strokePathType:n},i||{}))}onPointerMove(t){const{app:e,editor:n}=this;if(this.running&&!this.isMoveMode&&e.interaction.canHover&&!e.interaction.dragging){const e=this.findUI(t);n.hoverTarget=n.hasItem(e)?null:e}this.isMoveMode&&(n.hoverTarget=null)}onBeforeDown(t){if(t.multiTouch)return;const{select:e}=this.editor.mergeConfig;"press"===e&&(this.app.config.mobile?this.waitSelect=()=>this.checkAndSelect(t):this.checkAndSelect(t))}onTap(t){if(t.multiTouch)return;const{editor:e}=this,{select:n,selectKeep:i}=e.mergeConfig;"tap"===n?this.checkAndSelect(t):this.waitSelect&&this.waitSelect(),this.needRemoveItem?e.removeItem(this.needRemoveItem):this.isMoveMode&&(i||(e.target=null))}checkAndSelect(t){if(this.needRemoveItem=null,this.allowSelect(t)){const{editor:e}=this,n=this.findUI(t);n?(this.isMultipleSelect(t)?e.hasItem(n)?this.needRemoveItem=n:e.addItem(n):e.target=n,t.path.needUpdate=!0):this.allow(t.target)&&(this.isHoldMultipleSelectKey(t)||this.editor.mergedConfig.selectKeep||(e.target=null))}}onDragStart(t){if(!t.multiTouch&&(this.waitSelect&&this.waitSelect(),this.allowDrag(t))){const{editor:e}=this,{stroke:n,area:i}=e.mergeConfig,{x:r,y:o}=t.getInnerPoint(this);this.bounds.set(r,o),this.selectArea.setStyle({visible:!0,stroke:n,x:r,y:o},i),this.selectArea.setBounds(this.bounds.get()),this.originList=e.leafList.clone()}}onDrag(t){if(!t.multiTouch){if(this.editor.dragging)return this.onDragEnd(t);if(this.dragging){const{editor:e}=this,n=t.getInnerTotal(this),i=this.bounds.clone().unsign(),r=new lg(Hw(e.app,i));if(this.bounds.width=n.x,this.bounds.height=n.y,this.selectArea.setBounds(i.get()),r.length){const t=[];this.originList.forEach(e=>{r.has(e)||t.push(e)}),r.forEach(e=>{this.originList.has(e)||t.push(e)}),(t.length!==e.list.length||e.list.some((e,n)=>e!==t[n]))&&(e.target=t)}else e.target=this.originList.list}}}onDragEnd(t){t.multiTouch||this.dragging&&(this.originList=null,this.selectArea.visible=0)}onAutoMove(t){if(this.dragging){const{x:e,y:n}=t.getLocalMove(this);this.bounds.x+=e,this.bounds.y+=n}}allow(t){return t.leafer!==this.editor.leafer}allowDrag(t){const{boxSelect:e,multipleSelect:n}=this.editor.mergeConfig;return!(!(this.running&&n&&e)||t.target.draggable)&&(!this.editor.editing&&this.allow(t.target)||this.isHoldMultipleSelectKey(t)&&!Vw(t.path))}allowSelect(t){return this.running&&!this.isMoveMode&&!t.middle}findDeepOne(t){const e={exclude:new lg(this.editor.editBox.rect)};return Vw(t.target.leafer.interaction.findPath(t,e))}findUI(t){return this.isMultipleSelect(t)?this.findDeepOne(t):Vw(t.path)}isMultipleSelect(t){const{multipleSelect:e,continuousSelect:n}=this.editor.mergeConfig;return e&&(this.isHoldMultipleSelectKey(t)||n)}isHoldMultipleSelectKey(t){const{multipleSelectKey:e}=this.editor.mergedConfig;return e?t.isHoldKeys(e):t.shiftKey}__listenEvents(){const{editor:t}=this;t.waitLeafer(()=>{const{app:e}=t;e.selector.proxy=t,this.__eventIds=[t.on_([[Tw.HOVER,this.onHover,this],[Tw.SELECT,this.onSelect,this]]),e.on_([[s_.MOVE,this.onPointerMove,this],[s_.BEFORE_DOWN,this.onBeforeDown,this],[s_.TAP,this.onTap,this],[l_.START,this.onDragStart,this,!0],[l_.DRAG,this.onDrag,this],[l_.END,this.onDragEnd,this],[c_.MOVE,this.onAutoMove,this],[[f_.ZOOM,c_.MOVE],()=>{this.editor.hoverTarget=null}]])]})}__removeListenEvents(){this.off_(this.__eventIds)}destroy(){this.editor=this.originList=this.needRemoveItem=null,this.__removeListenEvents(),super.destroy()}},{topLeft:Yw,top:Xw,topRight:Gw,right:$w,bottomRight:Kw,bottom:qw,bottomLeft:Zw,left:Jw}=Js,{toPoint:Qw}=xa,{within:tx,sign:ex}=Ws,{abs:nx}=Math,ix={getScaleData(t,e,n,i,r,o,s,a){let l,h,c={},u=1,d=1;const{boxBounds:p,widthRange:f,heightRange:g,dragBounds:v,worldBoxBounds:_}=t,{width:m,height:y}=e,b=t.scaleX/e.scaleX,w=t.scaleY/e.scaleY,x=ex(b),S=ex(w),k=a?b:x*p.width/m,C=a?w:S*p.height/y;if(fs(i))u=d=Math.sqrt(i);else{o&&(i.x*=2,i.y*=2),i.x*=a?b:x,i.y*=a?w:S;const t=(-i.y+y)/y,e=(i.x+m)/m,s=(i.y+y)/y,c=(-i.x+m)/m;switch(n){case Xw:d=t,l="bottom";break;case $w:u=e,l="left";break;case qw:d=s,l="top";break;case Jw:u=c,l="right";break;case Yw:d=t,u=c,l="bottom-right";break;case Gw:d=t,u=e,l="bottom-left";break;case Kw:d=s,u=e,l="top-left";break;case Zw:d=s,u=c,l="top-right"}if(r)if("corner"===r&&n%2)r=!1;else switch(n){case Xw:case qw:u=d;break;case Jw:case $w:d=u;break;default:h=Math.sqrt(nx(u*d)),u=ex(u)*h,d=ex(d)*h}}const E=1!==u,O=1!==d;if(E&&(u/=k),O&&(d/=C),!s){const{worldTransform:e}=t;u<0&&(u=1/p.width/e.scaleX),d<0&&(d=1/p.height/e.scaleY)}if(Qw(o||l,p,c,!0),v){const e={x:u,y:d};r_.limitScaleOf(t,c,e,r),u=e.x,d=e.y}if(E&&f){const e=p.width*t.scaleX;u=tx(e*u,f)/e}if(O&&g){const e=p.height*t.scaleY;d=tx(e*d,g)/e}return E&&nx(u*_.width)<1&&(u=ex(u)/_.width),O&&nx(d*_.height)<1&&(d=ex(d)/_.height),r&&u!==d&&(h=Math.min(nx(u),nx(d)),u=ex(u)*h,d=ex(d)*h),isFinite(u)||(u=1),isFinite(d)||(d=1),{origin:c,scaleX:u,scaleY:d,direction:n,lockRatio:r,around:o}},getRotateData(t,e,n,i,r){let o,s={};switch(e){case Yw:o="bottom-right";break;case Gw:o="bottom-left";break;case Kw:o="top-left";break;case Zw:o="top-right";break;default:o="center"}return Qw(r||o,t.boxBounds,s,!0),{origin:s,rotation:ua.getRotation(i,t.getWorldPointByBox(s),n)}},getSkewData(t,e,n,i){let r,o,s={},a=0,l=0;switch(e){case Xw:case Yw:o={x:.5,y:0},r="bottom",a=1;break;case qw:case Kw:o={x:.5,y:1},r="top",a=1;break;case Jw:case Zw:o={x:0,y:.5},r="right",l=1;break;case $w:case Gw:o={x:1,y:.5},r="left",l=1}const{width:h,height:c}=t;o.x=o.x*h,o.y=o.y*c,Qw(i||r,t,s,!0);const u=ua.getRotation(o,s,{x:o.x+(a?n.x:0),y:o.y+(l?n.y:0)});return a?a=-u:l=u,{origin:s,skewX:a,skewY:l}},getAround:(t,e)=>e&&!t?"center":t,getRotateDirection:(t,e,n=8)=>((t=(t+Math.round(e/(360/n)))%n)<0&&(t+=n),t),getFlipDirection(t,e,n){if(e)switch(t){case Jw:t=$w;break;case Yw:t=Gw;break;case Zw:t=Kw;break;case $w:t=Jw;break;case Gw:t=Yw;break;case Kw:t=Zw}if(n)switch(t){case Xw:t=qw;break;case Yw:t=Zw;break;case Gw:t=Kw;break;case qw:t=Xw;break;case Zw:t=Yw;break;case Kw:t=Gw}return t}},rx={};function ox(t,e){const{enterPoint:n,dragging:i,skewing:r,resizing:o,flippedX:s,flippedY:a}=t;if(!n||!t.editor.editing||!t.canUse)return;if("rect"===n.name)return sx(t);if("circle"===n.name)return;let{rotation:l}=t;const{pointType:h}=n,{moveCursor:c,resizeCursor:u,rotateCursor:d,skewCursor:p,moveable:f,resizeable:g,rotateable:v,skewable:_}=t.mergeConfig;if("move"===h)return n.cursor=c,void(f||(n.visible=!1));if("button"===h)return void(n.cursor||(n.cursor="pointer"));let m=h.includes("resize");m&&v&&(t.isHoldRotateKey(e)||!g)&&(m=!1);const y=_&&!m&&("resize-line"===n.name||"skew"===h),b=i?r?p:o?u:d:y?p:m?u:d;l+=45*(ix.getFlipDirection(n.direction,s,a)+1),l=2*Math.round(Ws.formatRotation(l,!0)/2);const{url:w,x:x,y:S}=b,k=w+l;rx[k]?n.cursor=rx[k]:rx[k]=n.cursor={url:ax(w,l),x:x,y:S}}function sx(t){const{moveCursor:e,moveable:n}=t.mergeConfig;t.canUse&&(t.rect.cursor=n?e:void 0)}function ax(t,e){return'"data:image/svg+xml,'+encodeURIComponent(t.replace("{{rotation}}",e.toString()))+'"'}var lx=class extends nv{constructor(t){super(t),this.useFastShadow=!0}},hx=["top","right","bottom","left"],cx=void 0,ux=class extends Gg{get mergeConfig(){const{config:t}=this,{mergeConfig:e,editBox:n}=this.editor;return this.mergedConfig=t&&n!==this?Object.assign(Object.assign({},e),t):e}get target(){return this._target||this.editor.element}set target(t){this._target=t}get single(){return!!this._target||this.editor.single}get transformTool(){return this._transformTool||this.editor}set transformTool(t){this._transformTool=t}get flipped(){return this.flippedX||this.flippedY}get flippedX(){return this.scaleX<0}get flippedY(){return this.scaleY<0}get flippedOne(){return this.scaleX*this.scaleY<0}get canUse(){return this.app&&this.editor.editing}get canGesture(){if(!this.canUse)return!1;const{moveable:t,resizeable:e,rotateable:n}=this.mergeConfig;return ds(t)||ds(e)||ds(n)}get canDragLimitAnimate(){return this.moving&&this.mergeConfig.dragLimitAnimate&&this.target.dragBounds}constructor(t){super(),this.view=new Gg,this.rect=new lx({name:"rect",hitFill:"all",hitStroke:"none",strokeAlign:"center",hitRadius:5}),this.circle=new lx({name:"circle",strokeAlign:"center",around:"center",cursor:"crosshair",hitRadius:5}),this.buttons=new Gg({around:"center",hitSelf:!1,visible:0}),this.resizePoints=[],this.rotatePoints=[],this.resizeLines=[],this.dragStartData={},this.__eventIds=[],this.editor=t,this.visible=!1,this.create(),this.__listenEvents()}create(){let t,e,n;const{view:i,resizePoints:r,rotatePoints:o,resizeLines:s,rect:a,circle:l,buttons:h}=this,c=["bottom-right","bottom","bottom-left","left","top-left","top","top-right","right"];for(let u=0;u<8;u++)t=new lx({name:"rotate-point",around:c[u],width:15,height:15,hitFill:"all"}),o.push(t),this.listenPointEvents(t,"rotate",u),u%2&&(e=new lx({name:"resize-line",around:"center",width:10,height:10,hitFill:"all"}),s.push(e),this.listenPointEvents(e,"resize",u)),n=new lx({name:"resize-point",hitRadius:5}),r.push(n),this.listenPointEvents(n,"resize",u);this.listenPointEvents(l,"rotate",2),this.listenPointEvents(a,"move",8),i.addMany(...o,a,l,h,...s,...r),this.add(i)}load(){const{target:t,mergeConfig:e,single:n,rect:i,circle:r,resizePoints:o,resizeLines:s}=this,{stroke:a,strokeWidth:l,ignorePixelSnap:h}=e,c=this.getPointsStyle(),u=this.getMiddlePointsStyle(),d=this.getResizeLinesStyle();let p;this.visible=!t.locked;for(let g=0;g<8;g++)p=o[g],p.set(this.getPointStyle(g%2?u[(g-1)/2%u.length]:c[g/2%c.length])),p.rotation=(g-(g%2?1:0))/2*90,g%2&&s[(g-1)/2].set(Object.assign({pointType:"resize",rotation:(g-1)/2*90},d[(g-1)/2%d.length]||{}));r.set(this.getPointStyle(e.circle||e.rotatePoint||c[0])),i.set(Object.assign({stroke:a,strokeWidth:l,opacity:1,editConfig:cx},e.rect||{}));const f=us(e.rectThrough)?n:e.rectThrough;i.hittable=!f,f&&(t.syncEventer=i,this.app.interaction.bottomList=[{target:i,proxy:t}]),n&&bs.stintSet(t.__world,"ignorePixelSnap",h),sx(this)}update(){const{editor:t}=this,{x:e,y:n,scaleX:i,scaleY:r,rotation:o,skewX:s,skewY:a,width:l,height:h}=this.target.getLayoutBounds("box",t,!0);this.visible=!this.target.locked,this.set({x:e,y:n,scaleX:i,scaleY:r,rotation:o,skewX:s,skewY:a}),this.updateBounds({x:0,y:0,width:l,height:h})}unload(){this.visible=!1,this.app&&(this.rect.syncEventer=this.app.interaction.bottomList=null)}updateBounds(t){const{editor:e,mergeConfig:n,single:i,rect:r,circle:o,buttons:s,resizePoints:a,rotatePoints:l,resizeLines:h}=this,{editMask:c}=e,{middlePoint:u,resizeable:d,rotateable:p,hideOnSmall:f,editBox:g,mask:v,dimOthers:_,bright:m,spread:y,hideRotatePoints:b,hideResizeLines:w}=n;if(c.visible=!!v||0,cs(_)&&cs(m)?e.hasDimOthers&&e.cancelDimOthers():(e.setDimOthers(_),e.setBright(!!_||m),e.hasDimOthers=!0),y&&Va.spread(t,y),this.view.worldOpacity){const{width:e,height:c}=t,v=fs(f)?f:10,_=g&&!(f&&e<v&&c<v);let m,y,x,S={};for(let n=0;n<8;n++)xa.toPoint(xa.directionData[n],t,S),y=a[n],m=l[n],y.set(S),m.set(S),y.visible=_&&!(!d&&!p),m.visible=_&&p&&d&&!b,n%2&&(x=h[(n-1)/2],x.set(S),x.visible=y.visible&&!w,y.visible&&(y.visible=!!u),m.visible&&(m.visible=!!u),(n+1)/2%2?(x.width=e+x.height,f&&2*y.width>e&&(y.visible=!1)):(x.width=c+x.height,f&&2*y.width>c&&(y.visible=!1)));o.visible=_&&p&&!(!n.circle&&!n.rotatePoint),o.visible&&this.layoutCircle(),r.path&&(r.path=null),r.set(Object.assign(Object.assign({},t),{visible:!i||g})),s.visible=_&&s.children.length>0||0,s.visible&&this.layoutButtons()}else r.set(t)}layoutCircle(){const{circleDirection:t,circleMargin:e,buttonsMargin:n,buttonsDirection:i,middlePoint:r}=this.mergedConfig,o=hx.indexOf(t||(this.buttons.children.length&&"bottom"===i?"top":"bottom"));this.setButtonPosition(this.circle,o,e||n,!!r)}layoutButtons(){const{buttons:t}=this,{buttonsDirection:e,buttonsFixed:n,buttonsMargin:i,middlePoint:r}=this.mergedConfig,{flippedX:o,flippedY:s}=this;let a=hx.indexOf(e);(a%2&&o||(a+1)%2&&s)&&n&&(a=(a+2)%4);const l=n?ix.getRotateDirection(a,this.flippedOne?this.rotation:-this.rotation,4):a;this.setButtonPosition(t,l,i,!!r),n&&(t.rotation=90*(l-a)),t.scaleX=o?-1:1,t.scaleY=s?-1:1}setButtonPosition(t,e,n,i){const r=this.resizePoints[2*e+1],o=e%2,s=e&&3!==e?1:-1,a=(n+(e%2?(i?r.width:0)+t.boxBounds.width:(i?r.height:0)+t.boxBounds.height)/2)*s;o?(t.x=r.x+a,t.y=r.y):(t.x=r.x,t.y=r.y+a)}getPointStyle(t){const{stroke:e,strokeWidth:n,pointFill:i,pointSize:r,pointRadius:o}=this.mergedConfig,s={fill:i,stroke:e,strokeWidth:n,around:"center",strokeAlign:"center",opacity:1,width:r,height:r,cornerRadius:o,offsetX:0,offsetY:0,editConfig:cx};return t?Object.assign(s,t):s}getPointsStyle(){const{point:t}=this.mergedConfig;return gs(t)?t:[t]}getMiddlePointsStyle(){const{middlePoint:t}=this.mergedConfig;return gs(t)?t:t?[t]:this.getPointsStyle()}getResizeLinesStyle(){const{resizeLine:t}=this.mergedConfig;return gs(t)?t:[t]}onDragStart(t){this.dragging=!0;const e=this.dragPoint=t.current,{pointType:n}=e,{moveable:i,resizeable:r,rotateable:o,skewable:s,onCopy:a}=this.mergeConfig;"move"===n?(t.altKey&&a&&a()&&this.editor.single&&this.app.interaction.replaceDownTarget(this.target),i&&(this.moving=!0)):(n.includes("rotate")||this.isHoldRotateKey(t)||!r?(o&&(this.rotating=!0),"resize-rotate"===n?r&&(this.resizing=!0):"resize-line"===e.name&&(s&&(this.skewing=!0),this.rotating=!1)):"resize"===n&&r&&(this.resizing=!0),"skew"===n&&s&&(this.skewing=!0)),this.onTransformStart(t)}onDrag(t){const{transformTool:e,moving:n,resizing:i,rotating:r,skewing:o}=this;if(n)e.onMove(t);else if(i||r||o){const n=t.current;n.pointType&&(this.enterPoint=n),r&&e.onRotate(t),i&&e.onScale(t),o&&e.onSkew(t)}ox(this,t)}onDragEnd(t){this.onTransformEnd(t),this.dragPoint=null}onTransformStart(t){(this.moving||this.gesturing)&&(this.editor.opacity=this.mergedConfig.hideOnMove?0:1),this.resizing&&(Ip.resizingKeys=this.editor.leafList.keys);const{dragStartData:e,target:n}=this;e.x=t.x,e.y=t.y,e.totalOffset={x:0,y:0},e.point={x:n.x,y:n.y},e.bounds=Object.assign({},n.getLayoutBounds("box","local")),e.rotation=n.rotation}onTransformEnd(t){this.canDragLimitAnimate&&(t instanceof l_||t instanceof c_)&&this.transformTool.onMove(t),this.resizing&&(Ip.resizingKeys=null),this.dragging=this.gesturing=this.moving=this.resizing=this.rotating=this.skewing=!1,this.editor.opacity=1,this.editor.update()}onMove(t){if(this.canGesture&&"drag"!==t.moveType&&(t.stop(),ds(this.mergedConfig.moveable)))switch(this.gesturing=this.moving=!0,t.type){case c_.START:this.onTransformStart(t);break;case c_.END:this.onTransformEnd(t);break;default:this.transformTool.onMove(t)}}onScale(t){if(this.canGesture&&(t.stop(),ds(this.mergedConfig.resizeable)))switch(this.gesturing=this.resizing=!0,t.type){case f_.START:this.onTransformStart(t);break;case f_.END:this.onTransformEnd(t);break;default:this.transformTool.onScale(t)}}onRotate(t){if(this.canGesture&&(t.stop(),ds(this.mergedConfig.rotateable)))switch(this.gesturing=this.rotating=!0,t.type){case f_.START:this.onTransformStart(t);break;case f_.END:this.onTransformEnd(t);break;default:this.transformTool.onRotate(t)}}isHoldRotateKey(t){const{rotateKey:e}=this.mergedConfig;return e?t.isHoldKeys(e):t.metaKey||t.ctrlKey}onKey(t){ox(this,t)}onArrow(t){if(this.canUse){let e=0,n=0;switch(t.code){case"ArrowDown":n=1;break;case"ArrowUp":n=-1;break;case"ArrowLeft":e=-1;break;case"ArrowRight":e=1}if(e||n){const{keyEvent:i,arrowStep:r,arrowFastStep:o}=this.mergeConfig;if(i){const i=t.shiftKey?o:r;this.transformTool.move(e*i,n*i)}}}}onDoubleTap(t){const{openInner:e,preventEditInner:n}=this.mergeConfig;"double"!==e||n||this.openInner(t)}onLongPress(t){const{openInner:e,preventEditInner:n}=this.mergeConfig;"long"===e&&n&&this.openInner(t)}openInner(t){const{editor:e,target:n}=this;if(this.single){if(n.locked)return;if(n.isBranch&&!n.editInner){if(n.textBox){const{children:t}=n,i=t.find(t=>t.editable&&t instanceof Wv)||t.find(t=>t instanceof Wv);if(i)return e.openInnerEditor(i)}e.openGroup(n),e.target=e.selector.findDeepOne(t)}else e.openInnerEditor()}}listenPointEvents(t,e,n){t.direction=n,t.pointType=e,this.__eventIds.push(t.on_([[l_.START,this.onDragStart,this],[l_.DRAG,this.onDrag,this],[l_.END,this.onDragEnd,this],[s_.ENTER,e=>{this.enterPoint=t,ox(this,e)}],[s_.LEAVE,()=>{this.enterPoint=null}]]))}__listenEvents(){const{rect:t,editor:e,__eventIds:n}=this;n.push(t.on_([[s_.DOUBLE_TAP,this.onDoubleTap,this],[s_.LONG_PRESS,this.onLongPress,this]])),this.waitLeafer(()=>{n.push(e.app.on_([[[g_.HOLD,g_.UP],this.onKey,this],[g_.DOWN,this.onArrow,this],[[c_.START,c_.BEFORE_MOVE,c_.END],this.onMove,this,!0],[[f_.START,f_.BEFORE_ZOOM,f_.END],this.onScale,this,!0],[[d_.START,d_.BEFORE_ROTATE,d_.END],this.onRotate,this,!0]]))})}__removeListenEvents(){this.off_(this.__eventIds)}destroy(){this.editor=null,this.__removeListenEvents(),super.destroy()}},dx={x:0,y:0,width:1e5,height:1e5},px=class extends Yg{constructor(t){super(),this.editor=t,this.hittable=!1,this.visible=0}__updateWorldBounds(){Object.assign(this.__local,dx),Object.assign(this.__world,dx)}__draw(t,e){const{editor:n}=this,{mask:i}=n.mergedConfig;if(i&&n.editing){if(t.fillWorld(t.bounds,!0===i?"rgba(0,0,0,0.8)":i),e.bounds&&!e.bounds.hit(n.editBox.rect.__world,e.matrix))return;t.saveBlendMode("destination-out"),e=Object.assign(Object.assign({},e),{shape:!0}),n.list.forEach(n=>{n.__render(t,e);const{parent:i}=n;i&&i.textBox&&i.__renderShape(t,e)}),t.restoreBlendMode()}}destroy(){this.editor=null,super.destroy()}},fx='\n<feOffset dy="1"/>\n<feGaussianBlur stdDeviation="1.5"/>\n<feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.2 0"/>\n<feBlend mode="normal" in="SourceGraphic" result="shape"/>',gx={editSize:"size",keyEvent:!0,stroke:"#836DFF",strokeWidth:2,pointFill:"#FFFFFF",pointSize:10,pointRadius:16,rotateGap:45,arrowStep:1,arrowFastStep:10,buttonsDirection:"bottom",buttonsMargin:12,hideOnSmall:!0,moveCursor:"move",resizeCursor:{url:`\n<svg width="24" height="24" xmlns="http://www.w3.org/2000/svg">\n<g filter="url(#f)">\n<g transform="rotate({{rotation}},12,12)">\n<path d="M7.5 8.0H8.5V5.9L6.8 7.2L7.5 8.0ZM3 11.4L2.3 10.6L1.3 11.4L2.3 12.2L3 11.4ZM7.5 10.4H6.5V11.4H7.5V10.4ZM16.5 10.4V11.4H17.5V10.4H16.5ZM16.5 8.0L17.1 7.2L15.5 5.9V8.0H16.5ZM21 11.4L21.6 12.2L22.6 11.4L21.6 10.6L21 11.4ZM16.5 14.9H15.5V16.9L17.1 15.7L16.5 14.9ZM16.5 12.4H17.5V11.4H16.5V12.4ZM7.5 12.4V11.4H6.5V12.4H7.5ZM7.5 14.9L6.8 15.7L8.5 16.9V14.9H7.5ZM6.8 7.2L2.3 10.6L3.6 12.2L8.1 8.7L6.8 7.2ZM8.5 10.4V8.0H6.5V10.4H8.5ZM16.5 9.4H7.5V11.4H16.5V9.4ZM17.5 10.4V8.0H15.5V10.4H17.5ZM15.8 8.7L20.3 12.2L21.6 10.6L17.1 7.2L15.8 8.7ZM20.3 10.6L15.8 14.1L17.1 15.7L21.6 12.2L20.3 10.6ZM17.5 14.9V12.4H15.5V14.9H17.5ZM7.5 13.4H16.5V11.4H7.5V13.4ZM8.5 14.9V12.4H6.5V14.9H8.5ZM2.3 12.2L6.8 15.7L8.1 14.1L3.6 10.6L2.3 12.2Z" fill="white"/>\n<path fill-rule="evenodd" d="M3 11.4L7.5 8.0V10.4H16.5V8.0L21 11.4L16.5 14.9V12.4H7.5V14.9L3 11.4Z" fill="black"/>\n</g>\n</g>\n<defs>\n<filter id="f" x="-1.6" y="3.9" width="27.2" height="16.9" filterUnits="userSpaceOnUse">\n${fx}\n</filter>\n</defs>\n</svg>\n`,x:12,y:12},rotateCursor:{url:`\n<svg width="24" height="24" xmlns="http://www.w3.org/2000/svg">\n<g filter="url(#f)">\n<g transform="rotate(135,12,12),rotate({{rotation}},12,12)">\n<path d="M20.4 8H21.4L20.8 7.1L17.3 2.6L17 2.1L16.6 2.6L13.1 7.1L12.5 8H13.5H15.4C14.9 11.8 11.8 14.9 8 15.4V13.5V12.5L7.1 13.1L2.6 16.6L2.1 17L2.6 17.3L7.1 20.8L8 21.4V20.4V18.4C13.5 17.9 17.9 13.5 18.4 8H20.4Z" stroke="white"/>\n<path fill-rule="evenodd" d="M17 3L20.4 7.5H17.9C17.7 13.1 13.1 17.7 7.5 17.9V20.4L3 17L7.5 13.5V15.9C12.0 15.7 15.7 12.0 15.9 7.5H13.5L17 3Z" fill="black"/>\n</g>\n</g>\n<defs>\n<filter id="f" x="-1.6" y="-0.6" width="27.1" height="27.1" filterUnits="userSpaceOnUse">\n${fx}\n</filter>\n</defs>\n</svg>\n`,x:12,y:12},skewCursor:{url:`\n<svg width="24" height="24" xmlns="http://www.w3.org/2000/svg">\n<g filter="url(#f)">\n<g transform="rotate(90,12,12),rotate({{rotation}},12,12)">\n<path d="M21 10.4L21 11.4L23.8 11.4L21.6 9.6L21 10.4ZM17 10.4V11.4L17 11.4L17 10.4ZM15.5 6L16.1 5.2L14.5 3.9V6H15.5ZM15.5 8.4V9.4H16.5V8.4H15.5ZM6 8.4V7.4H5V8.4H6ZM6 10.4H5V11.4H6V10.4ZM7 14.4V13.4L7 13.4L7 14.4ZM3 14.4L3 13.4L0.1 13.4L2.3 15.2L3 14.4ZM8.5 18.9L7.8 19.7L9.5 21.0V18.9H8.5ZM8.5 16.4V15.4H7.5V16.4H8.5ZM19 16.4V17.4H20V16.4H19ZM19 14.4H20V13.4H19V14.4ZM21 9.4L17 9.4L17 11.4L21 11.4L21 9.4ZM14.8 6.7L20.3 11.2L21.6 9.6L16.1 5.2L14.8 6.7ZM16.5 8.4V6H14.5V8.4H16.5ZM6 9.4H15.5V7.4H6V9.4ZM7 10.4V8.4H5V10.4H7ZM15.5 9.4H6V11.4H15.5V9.4ZM17 9.4H15.5V11.4H17V9.4ZM7 15.4H8.5V13.4H7V15.4ZM3 15.4L7 15.4L7 13.4L3 13.4L3 15.4ZM9.1 18.1L3.6 13.6L2.3 15.2L7.8 19.7L9.1 18.1ZM7.5 16.4V18.9H9.5V16.4H7.5ZM19 15.4H8.5V17.4H19V15.4ZM18 14.4V16.4H20V14.4H18ZM8.5 15.4H19V13.4H8.5V15.4Z" fill="white"/>\n<path fill-rule="evenodd" d="M17 10.4L21 10.4L15.5 6V8.4H6V10.4H15.5H17ZM8.5 14.4H7L3 14.4L8.5 18.9V16.4H19V14.4H8.5Z" fill="black"/>\n</g>\n</g>\n<defs>\n<filter x="-2.8" y="1.9" width="29.6" height="23.1" filterUnits="userSpaceOnUse" >\n${fx}\n</filter>\n</defs>\n</svg>\n`,x:12,y:12},selector:!0,editBox:!0,hover:!0,select:"press",openInner:"double",multipleSelect:!0,boxSelect:!0,moveable:!0,resizeable:!0,flipable:!0,rotateable:!0,skewable:!0},vx=new Xa;function _x(t){const{simulateTarget:e,list:n}=t,{zoomLayer:i}=n[0].leafer;e.safeChange(()=>{vx.setListWithFn(n,t=>t.getBounds("box","page")),0===vx.width&&(vx.width=.1),0===vx.height&&(vx.height=.1),e.reset(vx.get())}),i.add(e)}var mx=(t,e)=>t.parent.children.indexOf(t)-e.parent.children.indexOf(e),yx=(t,e)=>e.parent.children.indexOf(e)-t.parent.children.indexOf(t),bx={group(t,e,n){t.sort(yx);const{app:i,parent:r}=t[0];let o;o=n&&n.add?n:new Gg(n),r.addAt(o,r.children.indexOf(t[0])),t.sort(mx);const s=new ma(e.worldTransform);return s.divideParent(r.scrollWorldTransform),o.setTransform(s),o.editable=!0,o.hitChildren=!1,i.lockLayout(),t.forEach(t=>t.dropTo(o)),i.unlockLayout(),o},ungroup(t){const{app:e}=t[0],n=[];return e.lockLayout(),t.forEach(t=>{if(t.isBranch){const{parent:e,children:i}=t;for(;i.length;)n.push(i[0]),i[0].dropTo(e,e.children.indexOf(t));t.isBranchLeaf?n.push(t):t.remove()}else n.push(t)}),e.unlockLayout(),n},toTop(t){t.sort(mx),t.forEach(t=>{t.parent&&t.parent.add(t)})},toBottom(t){t.sort(yx),t.forEach(t=>{t.parent&&t.parent.addAt(t,0)})}},wx=nl.get("EditToolCreator");function xx(){return t=>{kx.register(t)}}var Sx=xx,kx={list:{},register(t){const{tag:e}=t.prototype;Cx[e]&&wx.repeat(e),Cx[e]=t},get:(t,e)=>new Cx[t](e)},{list:Cx}=kx,Ex=class extends Tw{constructor(t,e){super(t,e)}};Ex.BEFORE_OPEN="innerEditor.before_open",Ex.OPEN="innerEditor.open",Ex.BEFORE_CLOSE="innerEditor.before_close",Ex.CLOSE="innerEditor.close";var Ox=class extends Tw{constructor(t,e){super(t,e)}};Ox.BEFORE_GROUP="editor.before_group",Ox.GROUP="editor.group",Ox.BEFORE_UNGROUP="editor.before_ungroup",Ox.UNGROUP="editor.ungroup",Ox.BEFORE_OPEN="editor.before_open_group",Ox.OPEN="editor.open_group",Ox.BEFORE_CLOSE="editor.before_close_group",Ox.CLOSE="editor.close_group";var{updateMatrix:Lx}=Kd,Px={x:1,y:1,scaleX:1,scaleY:1,rotation:1,skewX:1,skewY:1},Tx="top-left",Bx=class extends qg{get __tag(){return"SimulateElement"}constructor(t){super(),this.checkChange=!0,this.canChange=!0,this.visible=this.hittable=!1,this.skipJSON=!0,this.on(Op.CHANGE,e=>{if(this.checkChange&&Px[e.attrName]){const{attrName:n,newValue:i,oldValue:r}=e,o="s"===n[0]?(i||1)/(r||1):(i||0)-(r||0);this.canChange=!1;const s=this.__;s[n]=r,Lx(this.parent),Lx(this);const a=new ma(this.__world);switch(s[n]=i,this.__layout.rotationChange(),Lx(this),this.changedTransform=new ma(this.__world).divide(a),n){case"x":t.move(o,0);break;case"y":t.move(0,o);break;case"rotation":t.rotateOf(Tx,o);break;case"scaleX":t.scaleOf(Tx,o,1);break;case"scaleY":t.scaleOf(Tx,1,o);break;case"skewX":t.skewOf(Tx,o,0);break;case"skewY":t.skewOf(Tx,0,o)}this.canChange=!0}})}safeChange(t){this.canChange&&(this.checkChange=!1,t(),this.checkChange=!0)}},Rx=class extends Tw{constructor(t,e){super(t,e)}};Rx.BEFORE_MOVE="editor.before_move",Rx.MOVE="editor.move";var Ax=class extends Tw{constructor(t,e){super(t,e)}};Ax.BEFORE_SCALE="editor.before_scale",Ax.SCALE="editor.scale";var Mx=class extends Tw{constructor(t,e){super(t,e)}};Mx.BEFORE_ROTATE="editor.before_rotate",Mx.ROTATE="editor.rotate";var Dx=class extends Tw{constructor(t,e){super(t,e)}};Dx.BEFORE_SKEW="editor.before_skew",Dx.SKEW="editor.skew";var Ix=class extends Gg{get list(){return this.leafList.list}get dragHoverExclude(){return[this.editBox.rect]}get editing(){return!!this.list.length}get groupOpening(){return!!this.openedGroupList.length}get multiple(){return this.list.length>1}get single(){return 1===this.list.length}get dragPoint(){return this.editBox.dragPoint}get dragging(){return this.editBox.dragging}get gesturing(){return this.editBox.gesturing}get moving(){return this.editBox.moving}get resizing(){return this.editBox.resizing}get rotating(){return this.editBox.rotating}get skewing(){return this.editBox.skewing}get element(){return this.multiple?this.simulateTarget:this.list[0]}get buttons(){return this.editBox.buttons}get targetLeafer(){const t=this.list[0];return t&&t.leafer}constructor(t,e){super(e),this.leafList=new lg,this.openedGroupList=new lg,this.simulateTarget=new Bx(this),this.editBox=new ux(this),this.editToolList={},this.selector=new Uw(this),this.editMask=new px(this),this.targetEventIds=[];let n=bs.clone(gx);t&&(n=bs.default(t,n)),this.mergedConfig=this.config=n,this.addMany(this.editMask,this.selector,this.editBox),hl.has("resize")||(this.config.editSize="scale")}select(t){this.target=t}cancel(){this.target=null}hasItem(t){return this.leafList.has(t)}getItem(t){return this.list[t||0]}addItem(t){this.hasItem(t)||t.locked||(this.leafList.add(t),this.target=this.leafList.list)}removeItem(t){this.hasItem(t)&&(this.leafList.remove(t),this.target=this.leafList.list)}shiftItem(t){this.hasItem(t)?this.removeItem(t):this.addItem(t)}setDimOthers(t,e="dim",n){if(!n){const{dimTarget:t,targetLeafer:e}=this;n=t?gs(t)?t:[t]:[e]}n[0]&&n[0][e]!==(t||!1)&&n.forEach(n=>bs.stintSet(n,e,t))}setBright(t){this.setDimOthers(t,"bright",this.list)}cancelDimOthers(){this.setDimOthers(!1),this.setBright(!1),this.hasDimOthers=void 0}update(){if(this.editing){if(!this.element.parent)return this.cancel();this.innerEditing&&this.innerEditor.update(),this.editTool.update(),this.selector.update()}}updateEditBox(){this.multiple&&_x(this),this.update()}getEditTool(t){return this.editToolList[t]=this.editToolList[t]||kx.get(t,this)}updateEditTool(){if(this.unloadEditTool(),this.editing){const t=this.element;let e=t.editOuter||"EditTool";const{beforeEditOuter:n}=this.mergeConfig;if(n){const i=n({target:t,name:e});if(ds(i))e=i;else if(!1===i)return}if(kx.list[e]){const t=this.editTool=this.getEditTool(e);this.editBox.load(),t.load(),this.update()}}}unloadEditTool(){let t=this.editTool;t&&(this.editBox.unload(),t.unload(),this.editTool=null)}getEditSize(t){return this.mergeConfig.editSize}onMove(t){}onScale(t){}onRotate(t){}onSkew(t){}move(t,e=0){}scaleWithDrag(t){}scaleOf(t,e,n=e,i){}flip(t){}rotateOf(t,e){}skewOf(t,e,n=0,i){}checkTransform(t){}getWorldOrigin(t){}getChangedTransform(t){}group(t){return this.multiple&&(this.emitGroupEvent(Ox.BEFORE_GROUP),this.target=bx.group(this.list,this.element,t),this.emitGroupEvent(Ox.GROUP,this.target)),this.target}ungroup(){const{list:t}=this;return t.length&&(t.forEach(t=>t.isBranch&&this.emitGroupEvent(Ox.BEFORE_UNGROUP,t)),this.target=bx.ungroup(t),t.forEach(t=>t.isBranch&&this.emitGroupEvent(Ox.UNGROUP,t))),this.list}openGroup(t){this.emitGroupEvent(Ox.BEFORE_OPEN,t),this.openedGroupList.add(t),t.hitChildren=!0,this.emitGroupEvent(Ox.OPEN,t)}closeGroup(t){this.emitGroupEvent(Ox.BEFORE_CLOSE,t),this.openedGroupList.remove(t),t.hitChildren=!1,this.emitGroupEvent(Ox.CLOSE,t)}checkOpenedGroups(){const t=this.openedGroupList;if(t.length){let{list:e}=t;this.editing&&(e=[],t.forEach(t=>this.list.every(e=>!Kd.hasParent(e,t))&&e.push(t))),e.forEach(t=>this.closeGroup(t))}this.editing&&!this.selector.dragging&&this.checkDeepSelect()}checkDeepSelect(){let t,{list:e}=this;for(let n=0;n<e.length;n++)for(t=e[n].parent;t&&!t.hitChildren;)this.openGroup(t),t=t.parent}emitGroupEvent(t,e){const n=new Ox(t,{editTarget:e});this.emitEvent(n),e&&e.emitEvent(n)}getInnerEditor(t){return this.editToolList[t]=this.editToolList[t]||kx.get(t,this)}openInnerEditor(t,e,n){let i;if(ds(e)?i=e:n||(n=e),t&&n&&(this.target=t),this.single){t||(t=this.element),i||(i=t.editInner);const{beforeEditInner:e}=this.mergeConfig;if(e){const n=e({target:t,name:i});if(ds(n))i=n;else if(!1===n)return}kx.list[i]&&(this.editTool.unload(),this.innerEditing=!0,this.innerEditor=this.getInnerEditor(i),this.innerEditor.editTarget=t,this.emitInnerEvent(Ex.BEFORE_OPEN),this.innerEditor.load(),this.emitInnerEvent(Ex.OPEN))}}closeInnerEditor(t){this.innerEditing&&(this.innerEditing=!1,this.emitInnerEvent(Ex.BEFORE_CLOSE),this.innerEditor.unload(),this.emitInnerEvent(Ex.CLOSE),t||this.updateEditTool(),this.innerEditor=null)}emitInnerEvent(t){const{innerEditor:e}=this,{editTarget:n}=e,i=new Ex(t,{editTarget:n,innerEditor:e});this.emitEvent(i),n.emitEvent(i)}lock(){this.list.forEach(t=>t.locked=!0),this.update()}unlock(){this.list.forEach(t=>t.locked=!1),this.update()}toTop(){this.list.length&&(bx.toTop(this.list),this.leafList.update())}toBottom(){this.list.length&&(bx.toBottom(this.list),this.leafList.update())}onAppRenderStart(t){(this.targetChanged=t.children.some(t=>t!==this.leafer&&t.renderer.changed))&&this.editBox.forceRender()}onRenderStart(){this.targetChanged&&this.update()}onChildScroll(){this.multiple&&this.updateEditBox()}listenTargetEvents(){if(!this.targetEventIds.length){const{app:t,leafer:e,targetLeafer:n,editMask:i}=this;this.targetEventIds=[e.on_(zp.START,this.onRenderStart,this),n&&n.on_(Op.SCROLL,this.onChildScroll,this),t.on_(zp.CHILD_START,this.onAppRenderStart,this),t.on_(Np.UPDATE_MODE,t=>{t.mode&&"normal"!==t.mode&&this.cancel()})],i.visible&&i.forceRender()}}removeTargetEvents(){const{targetEventIds:t,editMask:e}=this;t.length&&(this.off_(t),e.visible&&e.forceRender())}destroy(){this.destroyed||(this.target=this.hoverTarget=null,Object.values(this.editToolList).forEach(t=>t.destroy()),this.simulateTarget.destroy(),this.editToolList={},this.simulateTarget=this.editTool=this.innerEditor=null,super.destroy())}};Lw([(t,e)=>{ad(t,e,{get(){const{config:t,element:e,dragPoint:n,editBox:i,editTool:r,innerEditor:o,app:s}=this,a=Object.assign({},t);if(o?o.editConfig&&Object.assign(a,o.editConfig):r&&r.editConfig&&Object.assign(a,r.editConfig),e&&e.editConfig){let{editConfig:t}=e;(t.hover||t.hoverStyle)&&(t=Object.assign({},t),delete t.hover,delete t.hoverStyle),Object.assign(a,t)}return i.config&&Object.assign(a,i.config),n&&(n.editConfig&&Object.assign(a,n.editConfig),"font-size"===a.editSize&&(a.lockRatio=!0),"resize-rotate"===n.pointType&&(a.around||(a.around="center"),us(a.lockRatio)&&(a.lockRatio=!0))),cs(a.dragLimitAnimate)&&(a.dragLimitAnimate=s&&s.config.pointer.dragLimitAnimate),this.mergedConfig=a}})}],Ix.prototype,"mergeConfig",void 0),Lw([Bw(function(t,e){const{target:n}=t;n?(t.leafList=n instanceof lg?n:new lg(n),t.multiple&&_x(t)):(t.simulateTarget.remove(),t.leafList.reset()),t.closeInnerEditor(!0),t.unloadEditTool();const i={editor:t,value:n,oldValue:e};t.emitEvent(new Tw(Tw.SELECT,i)),t.checkOpenedGroups(),t.editing?t.waitLeafer(()=>{t.updateEditTool(),t.listenTargetEvents()}):(t.updateEditTool(),t.removeTargetEvents()),t.emitEvent(new Tw(Tw.AFTER_SELECT,i))})],Ix.prototype,"target",void 0),Lw([Bw(function(t,e){t.emitEvent(new Tw(Tw.HOVER,{editor:t,value:t.hoverTarget,oldValue:e}))})],Ix.prototype,"hoverTarget",void 0),Ix=Lw([Dd(class{onMove(t){const{target:e,mergeConfig:n,dragStartData:i}=this.editBox;let r,{dragLimitAnimate:o}=n;const s=t.type===c_.END||t.type===l_.END,a=ds(e.draggable),l=!o||s||a,h={x:t.totalX,y:t.totalY};t instanceof c_&&ua.move(h,e.getWorldPointByLocal(i.totalOffset,null,!0)),t.shiftKey&&(Math.abs(h.x)>Math.abs(h.y)?h.y=0:h.x=0),r=l_.getValidMove(e,i.point,h,l),(r.x||r.y)&&(o&&!a&&s?Kd.animateMove(this,r,fs(o)?o:.3):this.move(r))}onScale(t){const{target:e,mergeConfig:n,single:i,dragStartData:r}=this.editBox;let o,{around:s,lockRatio:a,flipable:l,editSize:h}=n;t instanceof f_?(s||(s=e.getBoxPoint(t)),o=t.totalScale):o=t.getInnerTotal(e);const{direction:c}=t.current;(t.shiftKey||e.lockRatio)&&(a=!0);const u=ix.getScaleData(e,r.bounds,c,o,a,ix.getAround(s,t.altKey),l,!i||"scale"===h),d=e.x,p=e.y;t instanceof l_&&this.editTool&&this.editTool.onScaleWithDrag?(u.drag=t,this.scaleWithDrag(u)):this.scaleOf(u.origin,u.scaleX,u.scaleY),ua.move(r.totalOffset,e.x-d,e.y-p)}onRotate(t){const{target:e,mergeConfig:n,dragStartData:i}=this.editBox,{around:r,rotateAround:o,rotateGap:s,diagonalRotateKey:a}=n,{direction:l}=t.current;let h,c;if(t instanceof d_)c=t.rotation,h=o?xa.getPoint(o,e.boxBounds):e.getBoxPoint(t);else{const n=a?t.isHoldKeys(a):t.shiftKey,s=ix.getRotateData(e,l,t,i,n?null:o||e.around||e.origin||r||"center");c=i.rotation+s.rotation-e.rotation,h=s.origin}if(c=Ws.float(Ws.getGapRotation(c,s,e.rotation),2),!c)return;const u=e.x,d=e.y;this.rotateOf(h,c),ua.move(i.totalOffset,e.x-u,e.y-d)}onSkew(t){const{target:e,mergeConfig:n}=this.editBox,{around:i}=n,{origin:r,skewX:o,skewY:s}=ix.getSkewData(e.boxBounds,t.current.direction,t.getInnerMove(e),ix.getAround(i,t.altKey));(o||s)&&this.skewOf(r,o,s)}move(t,e=0){if(!this.checkTransform("moveable"))return;vs(t)&&(e=t.y,t=t.x);const{target:n,mergeConfig:i,single:r,editor:o}=this.editBox,{beforeMove:s}=i;if(s){const i=s({target:n,x:t,y:e});if(vs(i))t=i.x,e=i.y;else if(!1===i)return}const a=n.getWorldPointByLocal({x:t,y:e},null,!0);r||n.safeChange(()=>n.move(t,e));const l={target:n,editor:o,moveX:a.x,moveY:a.y};this.emitEvent(new Rx(Rx.BEFORE_MOVE,l));const h=new Rx(Rx.MOVE,l);this.doMove(h),this.emitEvent(h)}scaleWithDrag(t){if(!this.checkTransform("resizeable"))return;const{target:e,mergeConfig:n,editor:i}=this.editBox,{beforeScale:r}=n;if(r){const{origin:n,scaleX:i,scaleY:o,drag:s}=t;if(!1===r({target:e,drag:s,origin:n,scaleX:i,scaleY:o}))return}t=Object.assign(Object.assign({},t),{target:e,editor:i,worldOrigin:e.getWorldPoint(t.origin)}),this.emitEvent(new Ax(Ax.BEFORE_SCALE,t));const o=new Ax(Ax.SCALE,t);this.editTool.onScaleWithDrag(o),this.emitEvent(o)}scaleOf(t,e,n=e,i){if(!this.checkTransform("resizeable"))return;const{target:r,mergeConfig:o,single:s,editor:a}=this.editBox,{beforeScale:l}=o;if(l){const i=l({target:r,origin:t,scaleX:e,scaleY:n});if(vs(i))e=i.scaleX,n=i.scaleY;else if(!1===i)return}const h=this.getWorldOrigin(t),c=!s&&this.getChangedTransform(()=>r.safeChange(()=>r.scaleOf(t,e,n))),u={target:r,editor:a,worldOrigin:h,scaleX:e,scaleY:n,transform:c};this.emitEvent(new Ax(Ax.BEFORE_SCALE,u));const d=new Ax(Ax.SCALE,u);this.doScale(d),this.emitEvent(d)}flip(t){if(!this.checkTransform("resizeable"))return;const{target:e,single:n,editor:i}=this.editBox,r=this.getWorldOrigin("center"),o=n?new ma(Kd.getFlipTransform(e,t)):this.getChangedTransform(()=>e.safeChange(()=>e.flip(t))),s={target:e,editor:i,worldOrigin:r,scaleX:"x"===t?-1:1,scaleY:"y"===t?-1:1,transform:o};this.emitEvent(new Ax(Ax.BEFORE_SCALE,s));const a=new Ax(Ax.SCALE,s);this.doScale(a),this.emitEvent(a)}rotateOf(t,e){if(!this.checkTransform("rotateable"))return;const{target:n,mergeConfig:i,single:r,editor:o}=this.editBox,{beforeRotate:s}=i;if(s){const i=s({target:n,origin:t,rotation:e});if(fs(i))e=i;else if(!1===i)return}const a=this.getWorldOrigin(t),l=!r&&this.getChangedTransform(()=>n.safeChange(()=>n.rotateOf(t,e))),h={target:n,editor:o,worldOrigin:a,rotation:e,transform:l};this.emitEvent(new Mx(Mx.BEFORE_ROTATE,h));const c=new Mx(Mx.ROTATE,h);this.doRotate(c),this.emitEvent(c)}skewOf(t,e,n=0,i){if(!this.checkTransform("skewable"))return;const{target:r,mergeConfig:o,single:s,editor:a}=this.editBox,{beforeSkew:l}=o;if(l){const i=l({target:r,origin:t,skewX:e,skewY:n});if(vs(i))e=i.skewX,n=i.skewY;else if(!1===i)return}const h=this.getWorldOrigin(t),c=!s&&this.getChangedTransform(()=>r.safeChange(()=>r.skewOf(t,e,n))),u={target:r,editor:a,worldOrigin:h,skewX:e,skewY:n,transform:c};this.emitEvent(new Dx(Dx.BEFORE_SKEW,u));const d=new Dx(Dx.SKEW,u);this.doSkew(d),this.emitEvent(d)}doMove(t){this.editTool.onMove(t)}doScale(t){this.editTool.onScale(t)}doRotate(t){this.editTool.onRotate(t)}doSkew(t){this.editTool.onSkew(t)}checkTransform(t){const{target:e,mergeConfig:n}=this.editBox;return e&&!e.locked&&n[t]}getWorldOrigin(t){const{target:e}=this.editBox;return e.getWorldPoint(Kd.getInnerOrigin(e,t))}getChangedTransform(t){const{target:e,single:n}=this.editBox;if(!n&&!e.canChange)return e.changedTransform;const i=new ma(e.worldTransform);return t(),new ma(e.worldTransform).divide(i)}emitEvent(t,e){this.editBox.editor.emitEvent(t,e)}},["editBox","editTool","emitEvent"])],Ix);var Fx=class{static registerInnerEditor(){kx.register(this)}get tag(){return"InnerEditor"}get mode(){return"focus"}get editBox(){return this._editBox||this.editor.editBox}set editBox(t){this._editBox=t}constructor(t){this.eventIds=[],this.editor=t,this.create()}onCreate(){}create(){this.view=new Gg,this.onCreate()}onLoad(){}load(){const{editor:t}=this;t&&(t.app&&"focus"===this.mode&&(t.selector.hittable=t.app.tree.hitChildren=!1),this.onLoad())}onUpdate(){}update(){this.onUpdate()}onUnload(){}unload(){const{editor:t}=this;t&&(t.app&&"focus"===this.mode&&(t.selector.hittable=t.app.tree.hitChildren=!0),this.onUnload())}onDestroy(){}destroy(){this.onDestroy(),this.editor&&(this.view&&this.view.destroy(),this.eventIds&&this.editor.off_(this.eventIds),this.editor=this.view=this.eventIds=null)}},Wx=class extends Fx{static registerEditTool(){kx.register(this)}get tag(){return"EditTool"}onMove(t){const{moveX:e,moveY:n,editor:i}=t,{app:r,list:o}=i;r.lockLayout(),o.forEach(t=>{t.moveWorld(e,n)}),r.unlockLayout()}onScale(t){const{scaleX:e,scaleY:n,transform:i,worldOrigin:r,editor:o}=t,{app:s,list:a}=o;s.lockLayout(),a.forEach(t=>{const s="scale"!==o.getEditSize(t);i?t.transformWorld(i,s):t.scaleOfWorld(r,e,n,s)}),s.unlockLayout()}onRotate(t){const{rotation:e,transform:n,worldOrigin:i,editor:r}=t,{app:o,list:s}=r;o.lockLayout(),s.forEach(t=>{const o="scale"!==r.getEditSize(t);n?t.transformWorld(n,o):t.rotateOfWorld(i,e)}),o.unlockLayout()}onSkew(t){const{skewX:e,skewY:n,transform:i,worldOrigin:r,editor:o}=t,{app:s,list:a}=o;s.lockLayout(),a.forEach(t=>{const s="scale"!==o.getEditSize(t);i?t.transformWorld(i,s):t.skewOfWorld(r,e,n,s)}),s.unlockLayout()}load(){this.editBox.view.visible=!0,this.onLoad()}update(){this.editBox.update(),this.onUpdate()}unload(){this.editBox.view.visible=!1,this.onUnload()}};Wx=Lw([xx()],Wx);var{left:zx,right:Nx}=Js,{move:jx,copy:Vx,toNumberPoints:Hx}=ua,Ux=class extends Wx{constructor(){super(...arguments),this.scaleOfEvent=!0}get tag(){return"LineEditTool"}onScaleWithDrag(t){const{drag:e,direction:n,lockRatio:i,around:r}=t,o=t.target,s=n===zx;if(o.pathInputed){const{path:t}=o.__,{from:n,to:a}=this.getFromToByPath(t);this.dragPoint(n,a,s,r,this.getInnerMove(o,e,i)),t[1]=n.x,t[2]=n.y,t[4]=a.x,t[5]=a.y,o.path=t}else if(o.points){const{points:t}=o,{from:n,to:a}=this.getFromToByPoints(t);this.dragPoint(n,a,s,r,this.getInnerMove(o,e,i)),t[0]=n.x,t[1]=n.y,t[2]=a.x,t[3]=a.y,o.points=t}else{const t={x:0,y:0},{toPoint:n}=o;o.rotation=0,this.dragPoint(t,n,s,r,this.getInnerMove(o,e,i)),o.getLocalPointByInner(t,null,null,!0),o.getLocalPointByInner(n,null,null,!0),o.x=t.x,o.y=t.y,o.getInnerPointByLocal(n,null,null,!0),o.toPoint=n}}getInnerMove(t,e,n){const i=e.getInnerMove(t);return n&&(Math.abs(i.x)>Math.abs(i.y)?i.y=0:i.x=0),i}getFromToByPath(t){return{from:{x:t[1],y:t[2]},to:{x:t[4],y:t[5]}}}getFromToByPoints(t){const e=Hx(t);return{from:{x:e[0],y:e[1]},to:{x:e[2],y:e[3]}}}dragPoint(t,e,n,i,r){const{x:o,y:s}=r;n?(jx(t,o,s),i&&jx(e,-o,-s)):(i&&jx(t,-o,-s),jx(e,o,s))}onSkew(t){}onUpdate(){const{editBox:t}=this,{rotatePoints:e,resizeLines:n,resizePoints:i,rect:r}=t,o=t.target;let s,a;if(o.pathInputed?s=this.getFromToByPath(o.__.path):o.points&&(s=this.getFromToByPoints(o.__.points)),s){const{from:n,to:a}=s;o.innerToWorld(n,n,!1,t),o.innerToWorld(a,a,!1,t),r.pen.clearPath().moveTo(n.x,n.y).lineTo(a.x,a.y),Vx(i[7],n),Vx(e[7],n),Vx(i[3],a),Vx(e[3],a)}for(let l=0;l<8;l++)l<4&&(n[l].visible=!1),a=l===zx||l===Nx,i[l].visible=a,e[l].visible=!s&&a}};function Yx(t){const{scroll:e,disabled:n}=t.app.config.move;return!e||n?"":!0===e?"free":e}function Xx(t,e,n){(function(t,e){const n={wheel:{preventDefault:!0},touch:{preventDefault:!0},pointer:{preventDefaultMenu:!0}};e&&bs.assign(n,e),bs.assign(t.config,n,t.userConfig)})(t.parentApp?t.parentApp:t,e),t.isApp||n||t.__eventIds.push(t.on_(c_.BEFORE_MOVE,e=>{const n=t.getValidMove(e.moveX,e.moveY,!1);if(Yx(t).includes("limit")){const i=t.getValidMove(0,0);if(i.x||i.y){const t=100,r=200,o="drag"===e.moveType?.3:.05;Math.abs(i.x)>t?n.x=0:n.x*=o,Math.abs(i.y)>r?n.y=0:n.y*=o}}t.zoomLayer.move(n)}),t.on_(c_.DRAG_ANIMATE,()=>{const e=t.getValidMove(0,0);(e.x||e.y)&&t.interaction.stopDragAnimate()}),t.on_(c_.END,e=>{Kd.animateMove(t.zoomLayer,t.getValidMove(e.moveX,e.moveY))}),t.on_(f_.BEFORE_ZOOM,e=>{const{zoomLayer:n,layouter:i}=t,r=t.getValidScale(e.scale);1!==r&&(i.stop(),Kd.updateMatrix(t),n.scaleOfWorld(e,r),i.start())}))}Ux=Lw([xx()],Ux),hl.add("editor","resize"),cl.editor=function(t,e){const n=new Ix(t);return e&&e.sky.add(e.editor=n),n},nv.addAttr("textBox",!1,cd),Yg.addAttr("editConfig",void 0,cd),Yg.addAttr("editOuter",t=>(t.updateLayout(),t.__.__isLinePath?"LineEditTool":"EditTool"),cd),Yg.addAttr("editInner","PathEditor",cd),Gg.addAttr("editInner","",cd),Wv.addAttr("editInner","TextEditor",cd),Yg.setEditConfig=function(t){this.changeAttr("editConfig",t)},Yg.setEditOuter=function(t){this.changeAttr("editOuter",t)},Yg.setEditInner=function(t){this.changeAttr("editInner",t)};var Gx=nl.get("LeaferTypeCreator"),$x={list:{},register(t,e){Kx[t]&&Gx.repeat(t),Kx[t]=e},run(t,e){const n=Kx[t];n&&n(e)}},{list:Kx,register:qx}=$x;qx("viewport",Xx),qx("custom",function(t){Xx(t,null,!0)}),qx("design",function(t){Xx(t,{zoom:{min:.01,max:256},move:{holdSpaceKey:!0,holdMiddleKey:!0}})}),qx("document",function(t){Xx(t,{zoom:{min:1},move:{scroll:"limit"}})});var Zx,Jx,Qx,tS,eS={state:{type:"none",typeCount:0,startTime:0,totalData:null,center:{}},getData(t){const e=t[0],n=t[1],i=ua.getCenter(e.from,n.from),r=ua.getCenter(e.to,n.to),o={x:r.x-i.x,y:r.y-i.y},s=ua.getDistance(e.from,n.from);return{move:o,scale:ua.getDistance(e.to,n.to)/s,rotation:ua.getRotation(e.from,n.from,e.to,n.to),center:r}},getType(t,e){const n=Math.hypot(t.move.x,t.move.y)/(e.move||5),i=Math.abs(t.scale-1)/(e.scale||.03),r=Math.abs(t.rotation)/(e.rotation||2);return n<1&&i<1&&r<1?"none":n>=i&&n>=r?"move":i>=r?"zoom":"rotate"},detect(t,e){const{state:n}=nS,i=nS.getType(t,e);if(n.totalData||(n.startTime=Date.now(),n.center=t.center),nS.add(t,n.totalData),n.totalData=t,i===n.type){if(n.typeCount++,n.typeCount>=(e.count||3)&&"none"!==i)return i}else n.type=i,n.typeCount=1;return Date.now()-n.startTime>=(e.time||160)?nS.getType(n.totalData,e):"none"},add(t,e){e&&(ua.move(t.move,e.move),t.scale*=e.scale,t.rotation+=e.rotation,t.center=e.center)},reset(){const{state:t}=nS;t.type="none",t.typeCount=0,t.startTime=0,t.totalData=null}},nS=eS,{abs:iS,max:rS}=Math,{sign:oS,within:sS}=Ws,aS={getMove(t,e){let{moveSpeed:n}=e,{deltaX:i,deltaY:r}=t;t.shiftKey&&!i&&(i=r,r=0);const o=iS(i),s=iS(r);return o>50&&(i=rS(50,o/3)*oS(i)),s>50&&(r=rS(50,s/3)*oS(r)),{x:-i*n*2,y:-r*n*2}},getScale(t,e){let n,i=1,{zoomMode:r,zoomSpeed:o}=e;const s=t.deltaY||t.deltaX;if(r?(n="mouse"===r||!t.deltaX&&(Qa.intWheelDeltaY?Math.abs(s)>17:Math.ceil(s)!==s),(t.shiftKey||t.metaKey||t.ctrlKey)&&(n=!0)):n=!t.shiftKey&&(t.metaKey||t.ctrlKey),n){o=sS(o,0,1);const n=t.deltaY?e.delta.y:e.delta.x,r=sS(1-iS(s)/(4*n)*o,.5,2);i=s>0?r:1/r}return i}},lS=class{get transforming(){return this.moving||this.zooming||this.rotating}get moving(){return!!this.moveData}get zooming(){return!!this.zoomData}get rotating(){return!!this.rotateData}constructor(t){this.interaction=t}move(t){const{interaction:e}=this;t.moveType||(t.moveType="move"),this.moveData||(this.setPath(t),Zx=0,Jx=0,this.moveData=Object.assign(Object.assign({},t),{moveX:0,moveY:0,totalX:Zx,totalY:Jx}),e.emit(c_.START,this.moveData)),t.path=this.moveData.path,t.totalX=Zx+=t.moveX,t.totalY=Jx+=t.moveY,e.emit(c_.BEFORE_MOVE,t),e.emit(c_.MOVE,t),this.transformEndWait()}zoom(t){const{interaction:e}=this;this.zoomData||(this.setPath(t),Qx=1,this.zoomData=Object.assign(Object.assign({},t),{scale:1,totalScale:Qx}),e.emit(f_.START,this.zoomData)),t.path=this.zoomData.path,t.totalScale=Qx*=t.scale,e.emit(f_.BEFORE_ZOOM,t),e.emit(f_.ZOOM,t),this.transformEndWait()}rotate(t){const{interaction:e}=this;this.rotateData||(this.setPath(t),tS=0,this.rotateData=Object.assign(Object.assign({},t),{rotation:0,totalRotation:tS}),e.emit(d_.START,this.rotateData)),t.path=this.rotateData.path,t.totalRotation=tS+=t.rotation,e.emit(d_.BEFORE_ROTATE,t),e.emit(d_.ROTATE,t),this.transformEndWait()}setPath(t){const{interaction:e}=this,{path:n}=e.selector.getByPoint(t,e.hitRadius);t.path=n,e.cancelHover()}transformEndWait(){clearTimeout(this.transformTimer),this.transformTimer=setTimeout(()=>{this.transformEnd()},this.interaction.p.transformTime)}transformEnd(){const{interaction:t,moveData:e,zoomData:n,rotateData:i}=this;e&&t.emit(c_.END,Object.assign(Object.assign({},e),{totalX:Zx,totalY:Jx})),n&&t.emit(f_.END,Object.assign(Object.assign({},n),{totalScale:Qx})),i&&t.emit(d_.END,Object.assign(Object.assign({},i),{totalRotation:tS})),this.reset()}reset(){this.zoomData=this.moveData=this.rotateData=null}destroy(){this.reset()}},hS=Kg.prototype,cS=new Xa,uS=new _a;function dS(t,e){return Object.assign(Object.assign({},e),{moveX:t.x,moveY:t.y})}function pS(t,e){return Object.assign(Object.assign({},e),{scale:t})}hS.initType=function(t){$x.run(t,this)},hS.getValidMove=function(t,e,n=!0){const{disabled:i,scrollSpread:r}=this.app.config.move;uS.set(t,e);const o=Yx(this);return o&&(o.includes("x")?uS.y=0:o.includes("y")?uS.x=0:Math.abs(uS.x)>Math.abs(uS.y)?uS.y=0:uS.x=0,n&&o.includes("limit")&&(cS.set(this.__world).addPoint(this.zoomLayer),r&&cS.spread(r),r_.getValidMove(cS,this.canvas.bounds,"auto",uS,!0),o.includes("x")?uS.y=0:o.includes("y")&&(uS.x=0))),{x:i?0:uS.x,y:i?0:uS.y}},hS.getValidScale=function(t){const{scaleX:e}=this.zoomLayer.__,{min:n,max:i,disabled:r}=this.app.config.zoom,o=Math.abs(e*t);return n&&o<n?t=n/e:i&&o>i&&(t=i/e),r?1:t};var fS=R_.prototype;fS.createTransformer=function(){this.transformer=new lS(this)},fS.move=function(t){this.transformer.move(t)},fS.zoom=function(t){this.transformer.zoom(t)},fS.rotate=function(t){this.transformer.rotate(t)},fS.transformEnd=function(){this.transformer.transformEnd()},fS.wheel=function(t){const{wheel:e,pointer:n}=this.config,{posDeltaSpeed:i,negDeltaSpeed:r}=e;if(e.disabled)return;t.deltaX>0?i&&(t.deltaX*=i):r&&(t.deltaX*=r),t.deltaY>0?i&&(t.deltaY*=i):r&&(t.deltaY*=r);const o=e.getScale?e.getScale(t,e):aS.getScale(t,e);if(1!==o)this.zoom(pS(o,t));else{const i=e.getMove?e.getMove(t,e):aS.getMove(t,e);n.snap&&ua.round(i),this.move(dS(i,t))}},fS.multiTouch=function(t,e){const{disabled:n,singleGesture:i}=this.config.multiTouch;if(n)return;this.pointerWaitCancel();let r=eS.getData(e),{moving:o,zooming:s,rotating:a}=this.transformer;if(i){if(!this.transformer.transforming){switch(eS.detect(r,vs(i)?i:{})){case"move":o=!0;break;case"zoom":s=!0;break;case"rotate":a=!0;break;default:return}eS.reset()}o||(r.center=eS.state.center)}else o=s=a=!0;var l,h;Object.assign(t,r.center),t.multiTouch=!0,a&&this.rotate((l=r.rotation,h=t,Object.assign(Object.assign({},h),{rotation:l}))),s&&this.zoom(pS(r.scale,t)),o&&this.move(dS(r.move,t))};var gS=x_.prototype,{abs:vS,min:_S,max:mS,hypot:yS}=Math;function bS(t,e){let n=1;const i="out"===e,r=Math.abs(t);if(r>1){for(;i?n<r:n<=r;)n*=2;i&&(n/=2)}else{for(;i?n>=r:n>r;)n/=2;i||(n*=2)}return n/t}gS.checkDragEndAnimate=function(t){const{interaction:e}=this,n=this.canAnimate&&this.moving&&e.m.dragAnimate;if(n){const i=fs(n)?n:.95,r=.15,o=150;let s,a,l,h=0,c=0,u=0,d=0,p=3;const{dragDataList:f}=this,g=f.length;for(let t=g-1;t>=mS(g-3,0)&&(l=f[t],!(l.time&&Date.now()-l.time>100));t--)s=p--,h+=l.moveX*s,c+=l.moveY*s,d+=s,a=yS(l.moveX,l.moveY),a>u&&(u=a);if(d&&(h/=d,c/=d),u>8){const t=1.15+.4500000000000002*_S((u-8)/17,1);h*=t,c*=t}const v=mS(vS(h),vS(c));v>o&&(a=o/v,h*=a,c*=a);const _=()=>{if(h*=i,c*=i,t=Object.assign({},t),vS(h)<r&&vS(c)<r)return this.dragEndReal(t);ua.move(t,h,c),this.drag(t),this.animate(_),e.emit(c_.DRAG_ANIMATE,t)};this.animate(_)}return n},gS.animate=function(t,e){const n=t||this.animateWait;n&&this.interaction.target.nextRender(n,null,e),this.animateWait=t},gS.stopAnimate=function(){this.animate(null,"off"),this.interaction.target.nextRender(()=>{this.dragData&&this.dragEndReal(this.dragData)})},gS.checkDragOut=function(t){const{interaction:e}=this;this.autoMoveCancel(),this.dragging&&!e.shrinkCanvasBounds.hitPoint(t)&&this.autoMoveOnDragOut(t)},gS.autoMoveOnDragOut=function(t){const{interaction:e,downData:n,canDragOut:i}=this,{autoDistance:r,dragOut:o}=e.m;if(!o||!i||!r)return;const s=e.shrinkCanvasBounds,{x:a,y:l}=s,h=Va.maxX(s),c=Va.maxY(s),u=t.x<a?r:h<t.x?-r:0,d=t.y<l?r:c<t.y?-r:0;let p=0,f=0;this.autoMoveTimer=setInterval(()=>{p+=u,f+=d,ua.move(n,u,d),ua.move(this.dragData,u,d),e.move(Object.assign(Object.assign({},t),{moveX:u,moveY:d,totalX:p,totalY:f,moveType:"drag"})),e.pointerMoveReal(t)},10)},gS.autoMoveCancel=function(){this.autoMoveTimer&&(clearInterval(this.autoMoveTimer),this.autoMoveTimer=0)},hl.add("viewport"),hl.add("view"),Kg.prototype.zoom=function(t,e,n,i){let r;!function(t){return vs(t)&&!gs(t)}(e)?r=e:(r=e.padding,n=e.scroll,i=e.transition);const{zoomLayer:o}=this,s=this.canvas.bounds.clone().shrink(us(r)?30:r),a=new Xa,l={x:s.x+s.width/2,y:s.y+s.height/2};let h;o.killAnimate();const{x:c,y:u,scaleX:d,scaleY:p}=o.__,{boxBounds:f}=o;if(ds(t))switch(t){case"in":h=bS(d,"in");break;case"out":h=bS(d,"out");break;case"fit":t=f;break;case"fit-width":(t=new Xa(f)).height=0;break;case"fit-height":(t=new Xa(f)).width=0}else fs(t)&&(h=t/d);if(h)h=this.getValidScale(h),o.scaleOfWorld(l,h,h,!1,i);else if(vs(t)){const e={x:c,y:u,scaleX:d,scaleY:p},r=gs(t);if(r||t.tag){const e=r?t:[t];a.setListWithFn(e,rp.worldBounds)}else{const e=function(t,e){let n,{x:i,y:r,width:o,height:s}=t;return s||(s=o*(e.height/e.width),n=!0),o||(o=s*(e.width/e.height),n=!0),n?{x:i,y:r,width:o,height:s}:t}(t,s);a.set(o.getWorldBounds(e))}const{width:l,height:f}=a;let g=s.x-a.x,v=s.y-a.y;return n?(g+=Math.max((s.width-l)/2,0),v+=Math.max((s.height-f)/2,0)):(h=this.getValidScale(Math.min(s.width/l,s.height/f)),g+=(s.width-l*h)/2,v+=(s.height-f*h)/2,ua.scaleOf(e,a,h),a.scaleOf(a,h),e.scaleX*=h,e.scaleY*=h),"x"===n?v=0:"y"===n&&(g=0),ua.move(e,g,v),a.move(g,v),o.set(e,i),a}return o.worldBoxBounds};var wS=class{constructor(t){this.undoStack=[],this.redoStack=[],this.limit=50,void 0!==t&&t>0&&(this.limit=t)}executeCommand(t){t.execute(),this.undoStack.push(t),this.redoStack=[],this.undoStack.length>this.limit&&this.undoStack.shift()}undo(){if(this.canUndo()){const t=this.undoStack.pop();t&&(t.undo(),this.redoStack.push(t))}}redo(){if(this.canRedo()){const t=this.redoStack.pop();t&&(t.execute(),this.undoStack.push(t))}}canUndo(){return this.undoStack.length>0}canRedo(){return this.redoStack.length>0}clear(){this.undoStack=[],this.redoStack=[]}},xS=class{container;element;dataArray;pointData;constructor(t,e,n,i){this.container=t,this.element=e,this.dataArray=n,this.pointData=i}execute(){this.container.add(this.element),this.dataArray.push(this.pointData)}undo(){this.container.remove(this.element);const t=this.dataArray.findIndex(t=>t.id===this.pointData.id);t>-1&&this.dataArray.splice(t,1)}},SS=class{container;element;dataArray;insertIndex;constructor(t,e,n){this.container=t,this.element=e,this.dataArray=n,this.insertIndex=n.findIndex(t=>t.id===e.data.id)}execute(){this.container.remove(this.element);const t=this.dataArray.findIndex(t=>t.id===this.element.data.id);t>-1&&this.dataArray.splice(t,1)}undo(){this.container.add(this.element),this.insertIndex>-1&&this.insertIndex<=this.dataArray.length?this.dataArray.splice(this.insertIndex,0,this.element.data):this.dataArray.push(this.element.data)}},kS=class{canvasBrush;beforeSnapshot;afterSnapshot;isFirstExecute;isClearOperation;constructor(t,e,n=!1){this.canvasBrush=t,this.beforeSnapshot=e,this.afterSnapshot="",this.isFirstExecute=!0,this.isClearOperation=n}execute(){this.isFirstExecute?(this.isClearOperation?this.afterSnapshot="":this.afterSnapshot=this.canvasBrush.getImageData(),this.isFirstExecute=!1):this.afterSnapshot?this.canvasBrush.restoreImageData(this.afterSnapshot):this.canvasBrush.clear()}undo(){this.canvasBrush.restoreImageData(this.beforeSnapshot)}redo(){this.afterSnapshot?this.canvasBrush.restoreImageData(this.afterSnapshot):this.canvasBrush.clear()}};var CS=["Shift","Meta","Alt","Control"],ES="object"==typeof navigator?navigator.platform:"",OS=/Mac|iPod|iPhone|iPad/.test(ES),LS=OS?"Meta":"Control",PS="Win32"===ES?["Control","Alt"]:OS?["Alt"]:[];function TS(t,e){return"function"==typeof t.getModifierState&&(t.getModifierState(e)||PS.includes(e)&&t.getModifierState("AltGraph"))}function BS(t){return t.trim().split(" ").map(function(t){var e=t.split(/\b\+/),n=e.pop(),i=n.match(/^\((.+)\)$/);return i&&(n=new RegExp("^"+i[1]+"$")),[e=e.map(function(t){return"$mod"===t?LS:t}),n]})}function RS(t,e){var n=e[0],i=e[1];return!((i instanceof RegExp?!i.test(t.key)&&!i.test(t.code):i.toUpperCase()!==t.key.toUpperCase()&&i!==t.code)||n.find(function(e){return!TS(t,e)})||CS.find(function(e){return!n.includes(e)&&i!==e&&TS(t,e)}))}function AS(t,e){var n;void 0===e&&(e={});var i=null!=(n=e.timeout)?n:1e3,r=Object.keys(t).map(function(e){return[BS(e),t[e]]}),o=new Map,s=null;return function(t){t instanceof KeyboardEvent&&(r.forEach(function(e){var n=e[0],i=e[1],r=o.get(n)||n;RS(t,r[0])?r.length>1?o.set(n,r.slice(1)):(o.delete(n),i(t)):TS(t,t.key)||o.delete(n)}),s&&clearTimeout(s),s=setTimeout(o.clear.bind(o),i))}}var MS={circleRadius:20,circleFill:"#1890ff",circleStroke:"#ffffff",circleStrokeWidth:2,hoverCircleFill:"#ff7875",hoverCircleStroke:"#ffffff",selectedCircleFill:"#ff4d4f",selectedCircleStroke:"#ffffff",selectedCircleScale:1.2,circleTextFontSize:12,circleTextFontFamily:'"Open Sans", Tahoma, Consolas, monospace, sans-serif, Roboto',circleTextFill:"white",labelBackgroundColor:"#ffffff",labelTextColor:"#333333",labelFontSize:16,labelPadding:[2,4],fixedSizeOnZoom:!1,fixedSizeScale:1},DS={color:"rgba(255,0,0,1)",opacity:.55,size:100,minSize:50,maxSize:150,continuity:28};function IS(t,e){return hd(t,t=>({set(n){this.__setAttr(t,n),this.leaferIsReady?e?Sg.setStyleName(this,e,n):Sg.set(this,n):this.__layout.stateStyleChanged=!0}}))}function FS(t){return hd(t,t=>({set(e){this.__setAttr(t,e),this.__layout.stateStyleChanged=!0}}))}function WS(t,e){if(e&&!0!==e)return e;if(!t.button){let{parent:e}=t;for(let t=0;t<2;t++)if(e){if(e.button)return e;e=e.parent}}return null}function zS(t,e){vs(e)||(e=void 0),VS(t,e,"in")}function NS(t,e){const{normalStyle:n}=t;vs(e)||(e=void 0),n&&(e||(e=n),VS(t,e,"out"))}var jS={};function VS(t,e,n){const{normalStyle:i}=t;e||(e=jS),e.scale&&(Ws.assignScale(e,e.scale),delete e.scale),e!==jS&&Sg.canAnimate||(n=null);let r=!!n&&function(t,e,n){let i="in"===t?"transition":"transitionOut";return"out"===t&&us(n[i])&&us(e[i])&&(i="transition"),us(e[i])?n[i]:e[i]}(n,e,t);const o=r?function(t,e){const n=YS(e,t),i=t.animate();return i&&YS(n,t,i.fromStyle),n}(t,e):void 0;Sg.canAnimate&&HS(t)&&t.killAnimate("transition"),i&&t.set(i,"temp");const s=HS(t);if(s){const{animation:i}=s;if(i){const o=t.animate(i,void 0,"animation",!0);Object.assign(s,o.endingStyle),"in"!==n||e.animation!==i?o.kill():r=!1,delete s.animation}t.normalStyle=US(s,t),t.set(s,"temp")}else t.normalStyle=void 0;if(r){const e=US(o,t);t.set(o,"temp"),t.animate([o,e],r,"transition",!0)}t.__layout.stateStyleChanged=!1}function HS(t){let e;const n={},i=WS(t),r=i?t.state||i.state:t.state,o=r&&t.states[r];o&&Sg.isState(r,t,i)&&(e=XS(n,o));const s=n.selectedStyle||t.selectedStyle;s&&Sg.isSelected(t,i)&&(e=XS(n,s));const a=n.placeholderStyle||t.placeholderStyle;if(a&&Sg.isPlacehold(t,i)&&(e=XS(n,a)),Sg.isDisabled(t,i)){const i=n.disabledStyle||t.disabledStyle;i&&(e=XS(n,i))}else{const r=n.focusStyle||t.focusStyle;r&&Sg.isFocus(t,i)&&(e=XS(n,r));const o=n.hoverStyle||t.hoverStyle;o&&Sg.isHover(t,i)&&(e=XS(n,o));const s=n.pressStyle||t.pressStyle;s&&Sg.isPress(t,i)&&(e=XS(n,s))}return e?n:void 0}function US(t,e,n,i){const r=n?t:{},o=n||t;for(let s in o)i&&Sg.animateExcludes[s]||(r[s]=e[s]);return r}function YS(t,e,n){return US(t,e,n,!0)}function XS(t,e){return Object.assign(t,e),!0}function GS(t,e){const n=t[e];n&&zS(t,n),t.button&&KS(t.children,e)}function $S(t,e,n){n||(n=t.states[e]),zS(t,n),t.button&&KS(t.children,null,e)}function KS(t,e,n){if(!t)return;let i,r;for(let o=0,s=t.length;o<s;o++){if(i=t[o],e){switch(r=!0,e){case"hoverStyle":Sg.isHover(i)&&(r=!1);break;case"pressStyle":Sg.isPress(i)&&(r=!1);break;case"focusStyle":Sg.isFocus(i)&&(r=!1)}r&&GS(i,e)}else cs(n)||$S(i,n);i.isBranch&&KS(i.children,e,n)}}function qS(t,e){const n=t[e];n&&NS(t,n),t.button&&JS(t.children,e)}function ZS(t,e,n){NS(t,n),t.button&&JS(t.children,null,e)}function JS(t,e,n){if(!t)return;let i;for(let r=0,o=t.length;r<o;r++)i=t[r],e?qS(i,e):cs(n)||ZS(i,n),i.isBranch&&JS(i.children,e,n)}function QS(t,e,n){let i;const r=e.leafer?e.leafer.interaction:null;if(r&&(i=r[t](e),!i&&n)){const o=WS(e,n);o&&(i=r[t](o))}return i}function tk(t,e,n){let i=e[t];if(!i&&n){const r=WS(e,n);r&&(i=r[t])}return i}hl.add("state"),Sg.animateExcludes={animation:1,animationOut:1,transition:1,transitionOut:1,states:1,state:1,placeholder:1,normalStyle:1,hoverStyle:1,pressStyle:1,focusStyle:1,selectedStyle:1,disabledStyle:1,placeholderStyle:1},Sg.isState=function(t,e,n){return function(t,e,n){let i=e.states[t];if(!i&&n){const r=WS(e,n);r&&(i=r.states[t])}return!!i}(t,e,n)},Sg.isSelected=function(t,e){return tk("selected",t,e)},Sg.isDisabled=function(t,e){return tk("disabled",t,e)},Sg.isFocus=function(t,e){return QS("isFocus",t,e)},Sg.isHover=function(t,e){return QS("isHover",t,e)},Sg.isPress=function(t,e){return QS("isPress",t,e)},Sg.isPlacehold=function(t,e){return t.__.__isPlacehold},Sg.isDrag=function(t,e){return QS("isDrag",t,e)},Sg.setStyleName=function(t,e,n){n?$S(t,e,t[e]):ZS(t,e,t[e])},Sg.set=function(t,e){const n=t.states[e];n?$S(t,e,n):ZS(t,e,n)},Sg.getStyle=HS,Sg.updateStyle=VS,Sg.updateEventStyle=function(t,e){switch(e){case s_.ENTER:GS(t,"hoverStyle");break;case s_.LEAVE:qS(t,"hoverStyle");break;case s_.DOWN:GS(t,"pressStyle");break;case s_.UP:qS(t,"pressStyle")}};var ek=Yg.prototype;Yg.addAttr("selected",!1,IS,"selectedStyle"),Yg.addAttr("disabled",!1,IS,"disabledStyle"),Yg.addAttr("states",{},FS),Yg.addAttr("state","",IS),Yg.addAttr("normalStyle",void 0,cd),Yg.addAttr("hoverStyle",void 0,FS),Yg.addAttr("pressStyle",void 0,FS),Yg.addAttr("focusStyle",void 0,FS),Yg.addAttr("selectedStyle",void 0,FS),Yg.addAttr("disabledStyle",void 0,FS),Yg.addAttr("placeholderStyle",void 0,FS),Yg.addAttr("button",!1,cd),ek.set=function(t,e){t&&(e?"temp"===e?(this.lockNormalStyle=!0,Object.assign(this,t),this.lockNormalStyle=!1):this.animate(t,e):Object.assign(this,t))},ek.focus=function(t=!0){this.waitLeafer(()=>{let{focusData:e}=this.app.interaction;t?(e&&e.focus(!1),e=this):e=null,this.app.interaction.focusData=e,t?GS(this,"focusStyle"):qS(this,"focusStyle")})},ek.updateState=function(){Sg.updateStyle(this,void 0,"in")};var nk=Wv.prototype,ik="text";ad(nk,ik,Object.assign(Object.assign({},ld(nk,ik)),{set(t){const e=this,n=e.text;e.__setAttr(ik,t)&&(_d(e),e.placeholderStyle&&e.placeholder&&(""===n||""===t)&&(e.__layout.stateStyleChanged=!0))}}));var rk={none:"none",title:"capitalize",upper:"uppercase",lower:"lowercase","small-caps":"small-caps"},ok={top:"flex-start",middle:"center",bottom:"flex-end"},sk={none:"none",under:"underline",delete:"line-through","under-delete":"underline line-through"};function ak(t,e,n){const{style:i}=t,{fill:r,padding:o,textWrap:s,textOverflow:a,textDecoration:l}=e;let h;i.fontFamily=e.fontFamily,i.fontSize=e.fontSize*n+"px",function(t,e){let n="black";if(gs(e)&&(e=e[0]),vs(e))switch(e.type){case"solid":n=fg.string(e.color);break;case"image":case"film":case"video":break;case"linear":case"radial":case"angular":const t=e.stops[0];n=fg.string(ds(t)?t:t.color);break;default:cs(e.r)||(n=fg.string(e))}else n=e;t.color=n}(i,r),i.fontStyle=e.italic?"italic":"normal",i.fontWeight=e.fontWeight,vs(l)?(h=l.type,l.color&&(i.textDecorationColor=fg.string(l.color))):h=l,i.textDecoration=sk[h],i.textTransform=rk[e.textCase],i.textAlign="both"===e.textAlign?"justify":e.textAlign,i.display="flex",i.flexDirection="column",i.justifyContent=ok[e.verticalAlign],i.lineHeight=(e.__.__lineHeight||0)*n+"px",i.letterSpacing=(e.__.__letterSpacing||0)*n+"px",i.whiteSpace="none"===s||e.__.__autoWidth?"nowrap":"normal",i.wordBreak="break"===s?"break-all":"normal",i.textIndent=(e.paraIndent||0)*n+"px",i.padding=gs(o)?o.map(t=>t*n+"px").join(" "):(o||0)*n+"px",i.textOverflow="show"===a?"":"hide"===a?"clip":a}var lk=class extends Fx{constructor(){super(...arguments),this.config={selectAll:!0},this.eventIds=[]}get tag(){return"TextEditor"}onLoad(){const{editor:t}=this,{config:e}=t.app,n=this.editTarget;n.textEditing=!0,this.isHTMLText=!(n instanceof Wv),this._keyEvent=e.keyEvent,e.keyEvent=!1;const i=this.editDom=document.createElement("div");i.classList.add("leafer-text-editor");const{style:r}=i;i.contentEditable="true",r.position="fixed",r.transformOrigin="left top",r.boxSizing="border-box",this.isHTMLText?i.innerHTML=String(n.text):i.innerText=String(n.text);const{view:o}=t.app;(this.inBody=o instanceof HTMLCanvasElement)?document.body.appendChild(i):o.appendChild(i),this.eventIds=[t.app.on_(s_.DOWN,e=>{let n,{target:r}=e.origin;for(;r;)r===i&&(n=!0),r=r.parentElement;n||t.closeInnerEditor()})],this.onFocus=this.onFocus.bind(this),this.onInput=this.onInput.bind(this),this.onPaste=this.onPaste.bind(this),this.onUpdate=this.onUpdate.bind(this),this.onKeydown=this.onKeydown.bind(this),i.addEventListener("focus",this.onFocus),i.addEventListener("input",this.onInput),i.addEventListener("paste",this.onPaste),window.addEventListener("keydown",this.onKeydown),window.addEventListener("scroll",this.onUpdate);const s=window.getSelection(),a=document.createRange();if(this.config.selectAll)a.selectNodeContents(i);else{const t=i.childNodes[0];t&&(a.setStartAfter(t),a.setEndAfter(t)),a.collapse(!0)}s.removeAllRanges(),s.addRange(a)}onInput(){const{editDom:t}=this;this.editTarget.text=this.isHTMLText?t.innerHTML:t.innerText}onFocus(){this.editDom.style.outline="none"}onKeydown(t){if("Escape"===t.code&&this.editor.closeInnerEditor(),"Enter"===t.key){t.preventDefault();const e=document.createElement("br"),n=document.createTextNode(""),i=window.getSelection().getRangeAt(0);i.deleteContents(),i.insertNode(n),i.insertNode(e),i.setStartAfter(e),i.setEndAfter(e),this.onInput()}}onPaste(t){if(this.isHTMLText)return;t.preventDefault();const e=t.clipboardData;if(!e)return;let n=e.getData("text/plain").replace(/\r\n?/g,"\n");const i=window.getSelection();if(!i||!i.rangeCount)return;const r=i.getRangeAt(0);r.deleteContents();const o=n.split("\n"),s=document.createDocumentFragment();o.forEach((t,e)=>{e>0&&s.appendChild(document.createElement("br")),s.appendChild(document.createTextNode(t))}),r.insertNode(s),r.collapse(!1),i.removeAllRanges(),i.addRange(r),this.onInput()}onUpdate(){const{editTarget:t}=this;let e=1;if(!this.isHTMLText){const{scaleX:n,scaleY:i}=t.worldTransform;e=Math.max(Math.abs(n),Math.abs(i)),t.fontSize*e<12&&(e*=12/t.fontSize)}this.textScale=e;let{width:n,height:i}=t,r=0,o=0;n*=e,i*=e;const s=t.__;if(s.__autoWidth)switch(n+=20,s.textAlign){case"center":r=s.autoSizeAlign?-n/2:-10;break;case"right":r=s.autoSizeAlign?-n:-20}if(s.__autoHeight)switch(i+=20,s.verticalAlign){case"middle":o=s.autoSizeAlign?-i/2:-10;break;case"bottom":o=s.autoSizeAlign?-i:-20}const{x:a,y:l}=this.inBody?t.app.clientBounds:t.app.tree.clientBounds,{a:h,b:c,c:u,d:d,e:p,f:f}=new ma(t.worldTransform).scale(1/e).translateInner(r,o),{style:g}=this.editDom;g.transform=`matrix(${h},${c},${u},${d},${p},${f})`,g.left=a+"px",g.top=l+"px",g.width=n+"px",g.height=i+"px",this.isHTMLText||ak(this.editDom,t,e)}onUnload(){const{editTarget:t,editor:e,editDom:n}=this;t&&(this.onInput(),"\n"===t.text&&(t.text=""),t.textEditing=void 0,e.app&&(e.app.config.keyEvent=this._keyEvent),e.off_(this.eventIds),n.removeEventListener("focus",this.onFocus),n.removeEventListener("input",this.onInput),n.removeEventListener("paste",this.onPaste),window.removeEventListener("keydown",this.onKeydown),window.removeEventListener("scroll",this.onUpdate),n.remove(),this.editDom=this.eventIds=void 0)}};lk=function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s}([Sx()],lk),hl.add("text-editor","editor");var hk=class extends Gg{circle;circleText;label;data;style;_element_tag;_lastValidLabel;_isSelected;_defaultLabel;_isRenumbering;constructor(t,e){super(),this._defaultLabel=t.label??`#${t.sequenceNumber}`,this.data=t,this.style={...MS,...e},this._lastValidLabel=this._defaultLabel,this._isSelected=!1,this._isRenumbering=!1,this.circleText=new Wv({x:-this.style.circleRadius/2,y:-this.style.circleRadius/2,text:t.sequenceNumber??t.order,width:this.style.circleRadius,height:this.style.circleRadius,lineHeight:this.style.circleRadius,fontSize:this.style.circleTextFontSize,fontFamily:this.style.circleTextFontFamily,fill:this.style.circleTextFill,editable:!1,editConfig:{strokeWidth:0,moveable:!1,resizeable:!1},textAlign:"center"}),this.circle=new av({x:0,y:0,width:this.style.circleRadius,height:this.style.circleRadius,fill:this.style.circleFill,stroke:this.style.circleStroke,strokeWidth:this.style.circleStrokeWidth,draggable:!1,editable:!1,around:"center"}),this.label=new Wv({x:this.style.circleRadius/2-2,y:-this.style.circleRadius/2+2,text:this._defaultLabel,fontSize:this.style.labelFontSize,fill:this.style.labelTextColor,padding:this.style.labelPadding,editable:!1,editConfig:{strokeWidth:0,moveable:!1,resizeable:!1},around:"bottom-left",boxStyle:{fill:this.style.labelBackgroundColor,cornerRadius:4,whiteSpace:"nowrap",shadow:{x:1,y:1,blur:2,color:"rgba(0,0,0, .2)"}}}),this.add(this.circle),this.add(this.circleText),this.add(this.label),this.x=t.pixel.x,this.y=t.pixel.y,this.draggable=!0,this.editable=!0,this.hitChildren=!1,this.editConfig={strokeWidth:0,resizeable:!1},this._element_tag="point-annotation",this.bindEvents()}bindEvents(){this.on(s_.ENTER,()=>{this.circle.set({fill:this.style.selectedCircleFill,stroke:this.style.selectedCircleStroke})}),this.on(s_.LEAVE,()=>{this._isSelected||this.circle.set({fill:this.style.circleFill,stroke:this.style.circleStroke})}),this.label.on("property.change",t=>{const e=t.data||t;"text"===e.attrName&&this.handleLabelChange(e.newValue)})}handlePointAnnotationSelected(t){const e=t?this.style.selectedCircleFill:this.style.circleFill,n=t?this.style.selectedCircleStroke:this.style.circleStroke;this._isSelected=t,this.circle.set({fill:e,stroke:n})}handleLabelChange(t){const e=t.trim();e?this._isRenumbering?this._lastValidLabel=e:(this._lastValidLabel=e,this.data.label=e,this.data.updatedAt=Date.now()):this.label.text=this._defaultLabel}updatePosition(t,e){this.x=t,this.y=e,this.data.pixel={x:t,y:e},this.data.updatedAt=Date.now()}updateLabel(t){this.label.text=t,this._lastValidLabel=t,this.data.label=t,this.data.updatedAt=Date.now()}getLabel(){return this.data.label??this._defaultLabel}getLastValidLabel(){return this._lastValidLabel}updateSequenceNumber(t){if(this.data.sequenceNumber=t,this.circleText&&(this.circleText.text=String(t)),!this.data.label){this._isRenumbering=!0;try{this._defaultLabel=`#${t}`,this.label.text=this._defaultLabel}finally{this._isRenumbering=!1}}}},ck=class{canvas;group;width;height;lastPoint=null;constructor(t,e,n){this.width=t,this.height=e,this.canvas=new Rv({width:t,height:e}),this.canvas.set({pointerEvents:!1}),this.group=new Gg({opacity:n.opacity}),this.group.add(this.canvas)}getCanvas(){return this.canvas}getGroup(){return this.group}setOpacity(t){this.group.set({opacity:t})}setPointerEvents(t){this.canvas.set({pointerEvents:t})}resetLastPoint(){this.lastPoint=null}draw(t,e,n,i,r,o){const{context:s}=this.canvas;if(s.save(),s.fillStyle=i,s.globalAlpha=1,this.lastPoint){const i=t-this.lastPoint.x,r=e-this.lastPoint.y,a=Math.sqrt(i*i+r*r);if(a>o){const t=Math.ceil(a/(n/2));for(let e=1;e<=t;e++){const o=e/t,a=this.lastPoint.x+i*o,l=this.lastPoint.y+r*o;s.beginPath(),s.arc(a,l,n/2,0,2*Math.PI),s.fill()}}}s.beginPath(),s.arc(t,e,n/2,0,2*Math.PI),s.fill(),s.restore(),this.lastPoint={x:t,y:e}}erase(t,e,n,i){const{context:r}=this.canvas;if(r.save(),r.globalCompositeOperation="destination-out",this.lastPoint){const o=t-this.lastPoint.x,s=e-this.lastPoint.y,a=Math.sqrt(o*o+s*s);if(a>i){const t=Math.ceil(a/(n/2));for(let e=1;e<=t;e++){const i=e/t,a=this.lastPoint.x+o*i,l=this.lastPoint.y+s*i;r.beginPath(),r.arc(a,l,n/2,0,2*Math.PI),r.fill()}}}r.beginPath(),r.arc(t,e,n/2,0,2*Math.PI),r.fill(),r.restore(),this.lastPoint={x:t,y:e}}clear(){const{context:t}=this.canvas;t.clearRect(0,0,this.width,this.height),this.resetLastPoint(),this.canvas.paint(),this.group.set({dirty:!0})}getImageData(){return this.canvas.context.canvas.toDataURL("image/png")}restoreImageData(t,e){const n=new Image;n.onload=()=>{const{context:t}=this.canvas;t.clearRect(0,0,this.width,this.height),t.drawImage(n,0,0),this.canvas.paint(),this.group.set({dirty:!0}),e&&e()},n.src=t}hasContent(){if(0===this.width||0===this.height)return!1;const t=this.canvas.context.getImageData(0,0,this.width,this.height).data;for(let e=3;e<t.length;e+=4)if(t[e]>0)return!0;return!1}fillPolygon(t,e){if(t.length<3)return;const{context:n}=this.canvas;n.save(),n.fillStyle=e,n.globalAlpha=1,n.beginPath(),n.moveTo(t[0].x,t[0].y);for(let i=1;i<t.length;i++)n.lineTo(t[i].x,t[i].y);n.closePath(),n.fill(),n.restore(),this.canvas.paint(),this.group.set({dirty:!0})}},uk="bottom",dk="right",pk="left",fk=["top",uk,dk,pk],gk="start",vk="popper",_k=fk.reduce(function(t,e){return t.concat([e+"-"+gk,e+"-end"])},[]),mk=[].concat(fk,["auto"]).reduce(function(t,e){return t.concat([e,e+"-"+gk,e+"-end"])},[]),yk=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function bk(t){return t?(t.nodeName||"").toLowerCase():null}function wk(t){if(null==t)return window;if("[object Window]"!==t.toString()){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function xk(t){return t instanceof wk(t).Element||t instanceof Element}function Sk(t){return t instanceof wk(t).HTMLElement||t instanceof HTMLElement}function kk(t){return"undefined"!=typeof ShadowRoot&&(t instanceof wk(t).ShadowRoot||t instanceof ShadowRoot)}var Ck={name:"applyStyles",enabled:!0,phase:"write",fn:function(t){var e=t.state;Object.keys(e.elements).forEach(function(t){var n=e.styles[t]||{},i=e.attributes[t]||{},r=e.elements[t];Sk(r)&&bk(r)&&(Object.assign(r.style,n),Object.keys(i).forEach(function(t){var e=i[t];!1===e?r.removeAttribute(t):r.setAttribute(t,!0===e?"":e)}))})},effect:function(t){var e=t.state,n={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,n.popper),e.styles=n,e.elements.arrow&&Object.assign(e.elements.arrow.style,n.arrow),function(){Object.keys(e.elements).forEach(function(t){var i=e.elements[t],r=e.attributes[t]||{},o=Object.keys(e.styles.hasOwnProperty(t)?e.styles[t]:n[t]).reduce(function(t,e){return t[e]="",t},{});Sk(i)&&bk(i)&&(Object.assign(i.style,o),Object.keys(r).forEach(function(t){i.removeAttribute(t)}))})}},requires:["computeStyles"]};function Ek(t){return t.split("-")[0]}var Ok=Math.max,Lk=Math.min,Pk=Math.round;function Tk(){var t=navigator.userAgentData;return null!=t&&t.brands&&Array.isArray(t.brands)?t.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function Bk(){return!/^((?!chrome|android).)*safari/i.test(Tk())}function Rk(t,e,n){void 0===e&&(e=!1),void 0===n&&(n=!1);var i=t.getBoundingClientRect(),r=1,o=1;e&&Sk(t)&&(r=t.offsetWidth>0&&Pk(i.width)/t.offsetWidth||1,o=t.offsetHeight>0&&Pk(i.height)/t.offsetHeight||1);var s=(xk(t)?wk(t):window).visualViewport,a=!Bk()&&n,l=(i.left+(a&&s?s.offsetLeft:0))/r,h=(i.top+(a&&s?s.offsetTop:0))/o,c=i.width/r,u=i.height/o;return{width:c,height:u,top:h,right:l+c,bottom:h+u,left:l,x:l,y:h}}function Ak(t){var e=Rk(t),n=t.offsetWidth,i=t.offsetHeight;return Math.abs(e.width-n)<=1&&(n=e.width),Math.abs(e.height-i)<=1&&(i=e.height),{x:t.offsetLeft,y:t.offsetTop,width:n,height:i}}function Mk(t,e){var n=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(n&&kk(n)){var i=e;do{if(i&&t.isSameNode(i))return!0;i=i.parentNode||i.host}while(i)}return!1}function Dk(t){return wk(t).getComputedStyle(t)}function Ik(t){return["table","td","th"].indexOf(bk(t))>=0}function Fk(t){return((xk(t)?t.ownerDocument:t.document)||window.document).documentElement}function Wk(t){return"html"===bk(t)?t:t.assignedSlot||t.parentNode||(kk(t)?t.host:null)||Fk(t)}function zk(t){return Sk(t)&&"fixed"!==Dk(t).position?t.offsetParent:null}function Nk(t){for(var e=wk(t),n=zk(t);n&&Ik(n)&&"static"===Dk(n).position;)n=zk(n);return n&&("html"===bk(n)||"body"===bk(n)&&"static"===Dk(n).position)?e:n||function(t){var e=/firefox/i.test(Tk());if(/Trident/i.test(Tk())&&Sk(t)&&"fixed"===Dk(t).position)return null;var n=Wk(t);for(kk(n)&&(n=n.host);Sk(n)&&["html","body"].indexOf(bk(n))<0;){var i=Dk(n);if("none"!==i.transform||"none"!==i.perspective||"paint"===i.contain||-1!==["transform","perspective"].indexOf(i.willChange)||e&&"filter"===i.willChange||e&&i.filter&&"none"!==i.filter)return n;n=n.parentNode}return null}(t)||e}function jk(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function Vk(t,e,n){return Ok(t,Lk(e,n))}function Hk(t){return Object.assign({},{top:0,right:0,bottom:0,left:0},t)}function Uk(t,e){return e.reduce(function(e,n){return e[n]=t,e},{})}var Yk={name:"arrow",enabled:!0,phase:"main",fn:function(t){var e,n=t.state,i=t.name,r=t.options,o=n.elements.arrow,s=n.modifiersData.popperOffsets,a=Ek(n.placement),l=jk(a),h=["left","right"].indexOf(a)>=0?"height":"width";if(o&&s){var c=function(t,e){return Hk("number"!=typeof(t="function"==typeof t?t(Object.assign({},e.rects,{placement:e.placement})):t)?t:Uk(t,fk))}(r.padding,n),u=Ak(o),d="y"===l?"top":pk,p="y"===l?uk:dk,f=n.rects.reference[h]+n.rects.reference[l]-s[l]-n.rects.popper[h],g=s[l]-n.rects.reference[l],v=Nk(o),_=v?"y"===l?v.clientHeight||0:v.clientWidth||0:0,m=f/2-g/2,y=c[d],b=_-u[h]-c[p],w=_/2-u[h]/2+m,x=Vk(y,w,b),S=l;n.modifiersData[i]=((e={})[S]=x,e.centerOffset=x-w,e)}},effect:function(t){var e=t.state,n=t.options.element,i=void 0===n?"[data-popper-arrow]":n;null!=i&&("string"!=typeof i||(i=e.elements.popper.querySelector(i)))&&Mk(e.elements.popper,i)&&(e.elements.arrow=i)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Xk(t){return t.split("-")[1]}var Gk={top:"auto",right:"auto",bottom:"auto",left:"auto"};function $k(t){var e,n=t.popper,i=t.popperRect,r=t.placement,o=t.variation,s=t.offsets,a=t.position,l=t.gpuAcceleration,h=t.adaptive,c=t.roundOffsets,u=t.isFixed,d=s.x,p=void 0===d?0:d,f=s.y,g=void 0===f?0:f,v="function"==typeof c?c({x:p,y:g}):{x:p,y:g};p=v.x,g=v.y;var _=s.hasOwnProperty("x"),m=s.hasOwnProperty("y"),y=pk,b="top",w=window;if(h){var x=Nk(n),S="clientHeight",k="clientWidth";if(x===wk(n)&&"static"!==Dk(x=Fk(n)).position&&"absolute"===a&&(S="scrollHeight",k="scrollWidth"),"top"===r||("left"===r||"right"===r)&&"end"===o)b=uk,g-=(u&&x===w&&w.visualViewport?w.visualViewport.height:x[S])-i.height,g*=l?1:-1;if("left"===r||("top"===r||"bottom"===r)&&"end"===o)y=dk,p-=(u&&x===w&&w.visualViewport?w.visualViewport.width:x[k])-i.width,p*=l?1:-1}var C,E=Object.assign({position:a},h&&Gk),O=!0===c?function(t,e){var n=t.x,i=t.y,r=e.devicePixelRatio||1;return{x:Pk(n*r)/r||0,y:Pk(i*r)/r||0}}({x:p,y:g},wk(n)):{x:p,y:g};return p=O.x,g=O.y,l?Object.assign({},E,((C={})[b]=m?"0":"",C[y]=_?"0":"",C.transform=(w.devicePixelRatio||1)<=1?"translate("+p+"px, "+g+"px)":"translate3d("+p+"px, "+g+"px, 0)",C)):Object.assign({},E,((e={})[b]=m?g+"px":"",e[y]=_?p+"px":"",e.transform="",e))}var Kk={passive:!0};var qk={left:"right",right:"left",bottom:"top",top:"bottom"};function Zk(t){return t.replace(/left|right|bottom|top/g,function(t){return qk[t]})}var Jk={start:"end",end:"start"};function Qk(t){return t.replace(/start|end/g,function(t){return Jk[t]})}function tC(t){var e=wk(t);return{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function eC(t){return Rk(Fk(t)).left+tC(t).scrollLeft}function nC(t){var e=Dk(t),n=e.overflow,i=e.overflowX,r=e.overflowY;return/auto|scroll|overlay|hidden/.test(n+r+i)}function iC(t){return["html","body","#document"].indexOf(bk(t))>=0?t.ownerDocument.body:Sk(t)&&nC(t)?t:iC(Wk(t))}function rC(t,e){var n;void 0===e&&(e=[]);var i=iC(t),r=i===(null==(n=t.ownerDocument)?void 0:n.body),o=wk(i),s=r?[o].concat(o.visualViewport||[],nC(i)?i:[]):i,a=e.concat(s);return r?a:a.concat(rC(Wk(s)))}function oC(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function sC(t,e,n){return"viewport"===e?oC(function(t,e){var n=wk(t),i=Fk(t),r=n.visualViewport,o=i.clientWidth,s=i.clientHeight,a=0,l=0;if(r){o=r.width,s=r.height;var h=Bk();(h||!h&&"fixed"===e)&&(a=r.offsetLeft,l=r.offsetTop)}return{width:o,height:s,x:a+eC(t),y:l}}(t,n)):xk(e)?function(t,e){var n=Rk(t,!1,"fixed"===e);return n.top=n.top+t.clientTop,n.left=n.left+t.clientLeft,n.bottom=n.top+t.clientHeight,n.right=n.left+t.clientWidth,n.width=t.clientWidth,n.height=t.clientHeight,n.x=n.left,n.y=n.top,n}(e,n):oC(function(t){var e,n=Fk(t),i=tC(t),r=null==(e=t.ownerDocument)?void 0:e.body,o=Ok(n.scrollWidth,n.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),s=Ok(n.scrollHeight,n.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0),a=-i.scrollLeft+eC(t),l=-i.scrollTop;return"rtl"===Dk(r||n).direction&&(a+=Ok(n.clientWidth,r?r.clientWidth:0)-o),{width:o,height:s,x:a,y:l}}(Fk(t)))}function aC(t,e,n,i){var r="clippingParents"===e?function(t){var e=rC(Wk(t)),n=["absolute","fixed"].indexOf(Dk(t).position)>=0&&Sk(t)?Nk(t):t;return xk(n)?e.filter(function(t){return xk(t)&&Mk(t,n)&&"body"!==bk(t)}):[]}(t):[].concat(e),o=[].concat(r,[n]),s=o[0],a=o.reduce(function(e,n){var r=sC(t,n,i);return e.top=Ok(r.top,e.top),e.right=Lk(r.right,e.right),e.bottom=Lk(r.bottom,e.bottom),e.left=Ok(r.left,e.left),e},sC(t,s,i));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function lC(t){var e,n=t.reference,i=t.element,r=t.placement,o=r?Ek(r):null,s=r?Xk(r):null,a=n.x+n.width/2-i.width/2,l=n.y+n.height/2-i.height/2;switch(o){case"top":e={x:a,y:n.y-i.height};break;case uk:e={x:a,y:n.y+n.height};break;case dk:e={x:n.x+n.width,y:l};break;case pk:e={x:n.x-i.width,y:l};break;default:e={x:n.x,y:n.y}}var h=o?jk(o):null;if(null!=h){var c="y"===h?"height":"width";switch(s){case gk:e[h]=e[h]-(n[c]/2-i[c]/2);break;case"end":e[h]=e[h]+(n[c]/2-i[c]/2)}}return e}function hC(t,e){void 0===e&&(e={});var n=e,i=n.placement,r=void 0===i?t.placement:i,o=n.strategy,s=void 0===o?t.strategy:o,a=n.boundary,l=void 0===a?"clippingParents":a,h=n.rootBoundary,c=void 0===h?"viewport":h,u=n.elementContext,d=void 0===u?vk:u,p=n.altBoundary,f=void 0!==p&&p,g=n.padding,v=void 0===g?0:g,_=Hk("number"!=typeof v?v:Uk(v,fk)),m="popper"===d?"reference":vk,y=t.rects.popper,b=t.elements[f?m:d],w=aC(xk(b)?b:b.contextElement||Fk(t.elements.popper),l,c,s),x=Rk(t.elements.reference),S=lC({reference:x,element:y,strategy:"absolute",placement:r}),k=oC(Object.assign({},y,S)),C="popper"===d?k:x,E={top:w.top-C.top+_.top,bottom:C.bottom-w.bottom+_.bottom,left:w.left-C.left+_.left,right:C.right-w.right+_.right},O=t.modifiersData.offset;if("popper"===d&&O){var L=O[r];Object.keys(E).forEach(function(t){var e=["right","bottom"].indexOf(t)>=0?1:-1,n=["top","bottom"].indexOf(t)>=0?"y":"x";E[t]+=L[n]*e})}return E}function cC(t,e){void 0===e&&(e={});var n=e,i=n.placement,r=n.boundary,o=n.rootBoundary,s=n.padding,a=n.flipVariations,l=n.allowedAutoPlacements,h=void 0===l?mk:l,c=Xk(i),u=c?a?_k:_k.filter(function(t){return Xk(t)===c}):fk,d=u.filter(function(t){return h.indexOf(t)>=0});0===d.length&&(d=u);var p=d.reduce(function(e,n){return e[n]=hC(t,{placement:n,boundary:r,rootBoundary:o,padding:s})[Ek(n)],e},{});return Object.keys(p).sort(function(t,e){return p[t]-p[e]})}var uC={name:"flip",enabled:!0,phase:"main",fn:function(t){var e=t.state,n=t.options,i=t.name;if(!e.modifiersData[i]._skip){for(var r=n.mainAxis,o=void 0===r||r,s=n.altAxis,a=void 0===s||s,l=n.fallbackPlacements,h=n.padding,c=n.boundary,u=n.rootBoundary,d=n.altBoundary,p=n.flipVariations,f=void 0===p||p,g=n.allowedAutoPlacements,v=e.options.placement,_=Ek(v)===v,m=l||(_||!f?[Zk(v)]:function(t){if("auto"===Ek(t))return[];var e=Zk(t);return[Qk(t),e,Qk(e)]}(v)),y=[v].concat(m).reduce(function(t,n){return t.concat("auto"===Ek(n)?cC(e,{placement:n,boundary:c,rootBoundary:u,padding:h,flipVariations:f,allowedAutoPlacements:g}):n)},[]),b=e.rects.reference,w=e.rects.popper,x=new Map,S=!0,k=y[0],C=0;C<y.length;C++){var E=y[C],O=Ek(E),L=Xk(E)===gk,P=["top",uk].indexOf(O)>=0,T=P?"width":"height",B=hC(e,{placement:E,boundary:c,rootBoundary:u,altBoundary:d,padding:h}),R=P?L?dk:pk:L?uk:"top";b[T]>w[T]&&(R=Zk(R));var A=Zk(R),M=[];if(o&&M.push(B[O]<=0),a&&M.push(B[R]<=0,B[A]<=0),M.every(function(t){return t})){k=E,S=!1;break}x.set(E,M)}if(S)for(var D=function(t){var e=y.find(function(e){var n=x.get(e);if(n)return n.slice(0,t).every(function(t){return t})});if(e)return k=e,"break"},I=f?3:1;I>0&&"break"!==D(I);I--);e.placement!==k&&(e.modifiersData[i]._skip=!0,e.placement=k,e.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function dC(t,e,n){return void 0===n&&(n={x:0,y:0}),{top:t.top-e.height-n.y,right:t.right-e.width+n.x,bottom:t.bottom-e.height+n.y,left:t.left-e.width-n.x}}function pC(t){return["top",dk,uk,pk].some(function(e){return t[e]>=0})}var fC={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(t){var e=t.state,n=t.options,i=t.name,r=n.offset,o=void 0===r?[0,0]:r,s=mk.reduce(function(t,n){return t[n]=function(t,e,n){var i=Ek(t),r=["left","top"].indexOf(i)>=0?-1:1,o="function"==typeof n?n(Object.assign({},e,{placement:t})):n,s=o[0],a=o[1];return s=s||0,a=(a||0)*r,["left","right"].indexOf(i)>=0?{x:a,y:s}:{x:s,y:a}}(n,e.rects,o),t},{}),a=s[e.placement],l=a.x,h=a.y;null!=e.modifiersData.popperOffsets&&(e.modifiersData.popperOffsets.x+=l,e.modifiersData.popperOffsets.y+=h),e.modifiersData[i]=s}};var gC={name:"preventOverflow",enabled:!0,phase:"main",fn:function(t){var e=t.state,n=t.options,i=t.name,r=n.mainAxis,o=void 0===r||r,s=n.altAxis,a=void 0!==s&&s,l=n.boundary,h=n.rootBoundary,c=n.altBoundary,u=n.padding,d=n.tether,p=void 0===d||d,f=n.tetherOffset,g=void 0===f?0:f,v=hC(e,{boundary:l,rootBoundary:h,padding:u,altBoundary:c}),_=Ek(e.placement),m=Xk(e.placement),y=!m,b=jk(_),w="x"===b?"y":"x",x=e.modifiersData.popperOffsets,S=e.rects.reference,k=e.rects.popper,C="function"==typeof g?g(Object.assign({},e.rects,{placement:e.placement})):g,E="number"==typeof C?{mainAxis:C,altAxis:C}:Object.assign({mainAxis:0,altAxis:0},C),O=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,L={x:0,y:0};if(x){if(o){var P,T="y"===b?"top":pk,B="y"===b?uk:dk,R="y"===b?"height":"width",A=x[b],M=A+v[T],D=A-v[B],I=p?-k[R]/2:0,F="start"===m?S[R]:k[R],W="start"===m?-k[R]:-S[R],z=e.elements.arrow,N=p&&z?Ak(z):{width:0,height:0},j=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},V=j[T],H=j[B],U=Vk(0,S[R],N[R]),Y=y?S[R]/2-I-U-V-E.mainAxis:F-U-V-E.mainAxis,X=y?-S[R]/2+I+U+H+E.mainAxis:W+U+H+E.mainAxis,G=e.elements.arrow&&Nk(e.elements.arrow),$=G?"y"===b?G.clientTop||0:G.clientLeft||0:0,K=null!=(P=null==O?void 0:O[b])?P:0,q=A+X-K,Z=Vk(p?Lk(M,A+Y-K-$):M,A,p?Ok(D,q):D);x[b]=Z,L[b]=Z-A}if(a){var J,Q="x"===b?"top":pk,tt="x"===b?uk:dk,et=x[w],nt="y"===w?"height":"width",it=et+v[Q],rt=et-v[tt],ot=-1!==["top",pk].indexOf(_),st=null!=(J=null==O?void 0:O[w])?J:0,at=ot?it:et-S[nt]-k[nt]-st+E.altAxis,lt=ot?et+S[nt]+k[nt]-st-E.altAxis:rt,ht=p&&ot?function(t,e,n){var i=Vk(t,e,n);return i>n?n:i}(at,et,lt):Vk(p?at:it,et,p?lt:rt);x[w]=ht,L[w]=ht-et}e.modifiersData[i]=L}},requiresIfExists:["offset"]};function vC(t,e,n){void 0===n&&(n=!1);var i,r,o=Sk(e),s=Sk(e)&&function(t){var e=t.getBoundingClientRect(),n=Pk(e.width)/t.offsetWidth||1,i=Pk(e.height)/t.offsetHeight||1;return 1!==n||1!==i}(e),a=Fk(e),l=Rk(t,s,n),h={scrollLeft:0,scrollTop:0},c={x:0,y:0};return(o||!o&&!n)&&(("body"!==bk(e)||nC(a))&&(h=(i=e)!==wk(i)&&Sk(i)?{scrollLeft:(r=i).scrollLeft,scrollTop:r.scrollTop}:tC(i)),Sk(e)?((c=Rk(e,!0)).x+=e.clientLeft,c.y+=e.clientTop):a&&(c.x=eC(a))),{x:l.left+h.scrollLeft-c.x,y:l.top+h.scrollTop-c.y,width:l.width,height:l.height}}function _C(t){var e=new Map,n=new Set,i=[];function r(t){n.add(t.name),[].concat(t.requires||[],t.requiresIfExists||[]).forEach(function(t){if(!n.has(t)){var i=e.get(t);i&&r(i)}}),i.push(t)}return t.forEach(function(t){e.set(t.name,t)}),t.forEach(function(t){n.has(t.name)||r(t)}),i}function mC(t){var e;return function(){return e||(e=new Promise(function(n){Promise.resolve().then(function(){e=void 0,n(t())})})),e}}var yC={placement:"bottom",modifiers:[],strategy:"absolute"};function bC(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return!e.some(function(t){return!(t&&"function"==typeof t.getBoundingClientRect)})}function wC(t){void 0===t&&(t={});var e=t,n=e.defaultModifiers,i=void 0===n?[]:n,r=e.defaultOptions,o=void 0===r?yC:r;return function(t,e,n){void 0===n&&(n=o);var r={placement:"bottom",orderedModifiers:[],options:Object.assign({},yC,o),modifiersData:{},elements:{reference:t,popper:e},attributes:{},styles:{}},s=[],a=!1,l={state:r,setOptions:function(n){var a="function"==typeof n?n(r.options):n;h(),r.options=Object.assign({},o,r.options,a),r.scrollParents={reference:xk(t)?rC(t):t.contextElement?rC(t.contextElement):[],popper:rC(e)};var c,u,d=function(t){var e=_C(t);return yk.reduce(function(t,n){return t.concat(e.filter(function(t){return t.phase===n}))},[])}((c=[].concat(i,r.options.modifiers),u=c.reduce(function(t,e){var n=t[e.name];return t[e.name]=n?Object.assign({},n,e,{options:Object.assign({},n.options,e.options),data:Object.assign({},n.data,e.data)}):e,t},{}),Object.keys(u).map(function(t){return u[t]})));return r.orderedModifiers=d.filter(function(t){return t.enabled}),r.orderedModifiers.forEach(function(t){var e=t.name,n=t.options,i=void 0===n?{}:n,o=t.effect;if("function"==typeof o){var a=o({state:r,name:e,instance:l,options:i});s.push(a||function(){})}}),l.update()},forceUpdate:function(){if(!a){var t=r.elements,e=t.reference,n=t.popper;if(bC(e,n)){r.rects={reference:vC(e,Nk(n),"fixed"===r.options.strategy),popper:Ak(n)},r.reset=!1,r.placement=r.options.placement,r.orderedModifiers.forEach(function(t){return r.modifiersData[t.name]=Object.assign({},t.data)});for(var i=0;i<r.orderedModifiers.length;i++)if(!0!==r.reset){var o=r.orderedModifiers[i],s=o.fn,h=o.options,c=void 0===h?{}:h,u=o.name;"function"==typeof s&&(r=s({state:r,options:c,name:u,instance:l})||r)}else r.reset=!1,i=-1}}},update:mC(function(){return new Promise(function(t){l.forceUpdate(),t(r)})}),destroy:function(){h(),a=!0}};if(!bC(t,e))return l;function h(){s.forEach(function(t){return t()}),s=[]}return l.setOptions(n).then(function(t){!a&&n.onFirstUpdate&&n.onFirstUpdate(t)}),l}}var xC=wC({defaultModifiers:[{name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(t){var e=t.state,n=t.instance,i=t.options,r=i.scroll,o=void 0===r||r,s=i.resize,a=void 0===s||s,l=wk(e.elements.popper),h=[].concat(e.scrollParents.reference,e.scrollParents.popper);return o&&h.forEach(function(t){t.addEventListener("scroll",n.update,Kk)}),a&&l.addEventListener("resize",n.update,Kk),function(){o&&h.forEach(function(t){t.removeEventListener("scroll",n.update,Kk)}),a&&l.removeEventListener("resize",n.update,Kk)}},data:{}},{name:"popperOffsets",enabled:!0,phase:"read",fn:function(t){var e=t.state,n=t.name;e.modifiersData[n]=lC({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})},data:{}},{name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(t){var e=t.state,n=t.options,i=n.gpuAcceleration,r=void 0===i||i,o=n.adaptive,s=void 0===o||o,a=n.roundOffsets,l=void 0===a||a,h={placement:Ek(e.placement),variation:Xk(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:r,isFixed:"fixed"===e.options.strategy};null!=e.modifiersData.popperOffsets&&(e.styles.popper=Object.assign({},e.styles.popper,$k(Object.assign({},h,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:s,roundOffsets:l})))),null!=e.modifiersData.arrow&&(e.styles.arrow=Object.assign({},e.styles.arrow,$k(Object.assign({},h,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})},data:{}},Ck,fC,uC,gC,Yk,{name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(t){var e=t.state,n=t.name,i=e.rects.reference,r=e.rects.popper,o=e.modifiersData.preventOverflow,s=hC(e,{elementContext:"reference"}),a=hC(e,{altBoundary:!0}),l=dC(s,i),h=dC(a,r,o),c=pC(l),u=pC(h);e.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:h,isReferenceHidden:c,hasPopperEscaped:u},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":c,"data-popper-escaped":u})}}]});function SC(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=Array(e);n<e;n++)i[n]=t[n];return i}function kC(t,e){if(t){if("string"==typeof t)return SC(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?SC(t,e):void 0}}function CC(t){return function(t){if(Array.isArray(t))return SC(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||kC(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function EC(t){return EC="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},EC(t)}function OC(t,e,n,i,r,o,s){try{var a=t[o](s),l=a.value}catch(t){return void n(t)}a.done?e(l):Promise.resolve(l).then(i,r)}function LC(t){return function(){var e=this,n=arguments;return new Promise(function(i,r){var o=t.apply(e,n);function s(t){OC(o,i,r,s,a,"next",t)}function a(t){OC(o,i,r,s,a,"throw",t)}s(void 0)})}}var PC={exports:{}},TC={exports:{}};(function(t){function e(n){return t.exports=e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t.exports.__esModule=!0,t.exports.default=t.exports,e(n)}t.exports=e,t.exports.__esModule=!0,t.exports.default=t.exports})(TC),function(t){var e=TC.exports.default;function n(){t.exports=n=function(){return r},t.exports.__esModule=!0,t.exports.default=t.exports;var i,r={},o=Object.prototype,s=o.hasOwnProperty,a=Object.defineProperty||function(t,e,n){t[e]=n.value},l="function"==typeof Symbol?Symbol:{},h=l.iterator||"@@iterator",c=l.asyncIterator||"@@asyncIterator",u=l.toStringTag||"@@toStringTag";function d(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{d({},"")}catch(i){d=function(t,e,n){return t[e]=n}}function p(t,e,n,i){var r=e&&e.prototype instanceof b?e:b,o=Object.create(r.prototype);return a(o,"_invoke",{value:P(t,n,new A(i||[]))}),o}function f(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}r.wrap=p;var g="suspendedStart",v="suspendedYield",_="executing",m="completed",y={};function b(){}function w(){}function x(){}var S={};d(S,h,function(){return this});var k=Object.getPrototypeOf,C=k&&k(k(M([])));C&&C!==o&&s.call(C,h)&&(S=C);var E=x.prototype=b.prototype=Object.create(S);function O(t){["next","throw","return"].forEach(function(e){d(t,e,function(t){return this._invoke(e,t)})})}function L(t,n){function i(r,o,a,l){var h=f(t[r],t,o);if("throw"!==h.type){var c=h.arg,u=c.value;return u&&"object"==e(u)&&s.call(u,"__await")?n.resolve(u.__await).then(function(t){i("next",t,a,l)},function(t){i("throw",t,a,l)}):n.resolve(u).then(function(t){c.value=t,a(c)},function(t){return i("throw",t,a,l)})}l(h.arg)}var r;a(this,"_invoke",{value:function(t,e){function o(){return new n(function(n,r){i(t,e,n,r)})}return r=r?r.then(o,o):o()}})}function P(t,e,n){var r=g;return function(o,s){if(r===_)throw Error("Generator is already running");if(r===m){if("throw"===o)throw s;return{value:i,done:!0}}for(n.method=o,n.arg=s;;){var a=n.delegate;if(a){var l=T(a,n);if(l){if(l===y)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===g)throw r=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=_;var h=f(t,e,n);if("normal"===h.type){if(r=n.done?m:v,h.arg===y)continue;return{value:h.arg,done:n.done}}"throw"===h.type&&(r=m,n.method="throw",n.arg=h.arg)}}}function T(t,e){var n=e.method,r=t.iterator[n];if(r===i)return e.delegate=null,"throw"===n&&t.iterator.return&&(e.method="return",e.arg=i,T(t,e),"throw"===e.method)||"return"!==n&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var o=f(r,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,y;var s=o.arg;return s?s.done?(e[t.resultName]=s.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=i),e.delegate=null,y):s:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,y)}function B(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function R(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function A(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(B,this),this.reset(!0)}function M(t){if(t||""===t){var n=t[h];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,o=function e(){for(;++r<t.length;)if(s.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=i,e.done=!0,e};return o.next=o}}throw new TypeError(e(t)+" is not iterable")}return w.prototype=x,a(E,"constructor",{value:x,configurable:!0}),a(x,"constructor",{value:w,configurable:!0}),w.displayName=d(x,u,"GeneratorFunction"),r.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===w||"GeneratorFunction"===(e.displayName||e.name))},r.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,x):(t.__proto__=x,d(t,u,"GeneratorFunction")),t.prototype=Object.create(E),t},r.awrap=function(t){return{__await:t}},O(L.prototype),d(L.prototype,c,function(){return this}),r.AsyncIterator=L,r.async=function(t,e,n,i,o){void 0===o&&(o=Promise);var s=new L(p(t,e,n,i),o);return r.isGeneratorFunction(e)?s:s.next().then(function(t){return t.done?t.value:s.next()})},O(E),d(E,u,"Generator"),d(E,h,function(){return this}),d(E,"toString",function(){return"[object Generator]"}),r.keys=function(t){var e=Object(t),n=[];for(var i in e)n.push(i);return n.reverse(),function t(){for(;n.length;){var i=n.pop();if(i in e)return t.value=i,t.done=!1,t}return t.done=!0,t}},r.values=M,A.prototype={constructor:A,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=i,this.done=!1,this.delegate=null,this.method="next",this.arg=i,this.tryEntries.forEach(R),!t)for(var e in this)"t"===e.charAt(0)&&s.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=i)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(n,r){return a.type="throw",a.arg=t,e.next=n,r&&(e.method="next",e.arg=i),!!r}for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r],a=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var l=s.call(o,"catchLoc"),h=s.call(o,"finallyLoc");if(l&&h){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(l){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!h)throw Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&s.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var r=i;break}}r&&("break"===t||"continue"===t)&&r.tryLoc<=e&&e<=r.finallyLoc&&(r=null);var o=r?r.completion:{};return o.type=t,o.arg=e,r?(this.method="next",this.next=r.finallyLoc,y):this.complete(o)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),y},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),R(n),y}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var i=n.completion;if("throw"===i.type){var r=i.arg;R(n)}return r}}throw Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:M(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=i),y}},r}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports}(PC);var BC=PC.exports(),RC=BC;try{regeneratorRuntime=BC}catch(ES){"object"==typeof globalThis?globalThis.regeneratorRuntime=BC:Function("r","regeneratorRuntime = r")(BC)}function AC(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var i,r,o,s,a=[],l=!0,h=!1;try{if(o=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;l=!1}else for(;!(l=(i=o.call(n)).done)&&(a.push(i.value),a.length!==e);l=!0);}catch(t){h=!0,r=t}finally{try{if(!l&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(h)throw r}}return a}}(t,e)||kC(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function MC(t,e,n){return(e=function(t){var e=function(t){if("object"!=EC(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=EC(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==EC(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var DC=An({name:"Saturation",props:{size:{type:Number,default:160},hue:{type:Number,default:0},saturation:{type:Number,default:0},value:{type:Number,default:0}},emits:["change"],setup:function(t,e){var n=e.emit;return{saturationStyle:qr(function(){return{width:"".concat(t.size,"px"),height:"".concat(t.size,"px"),background:"hsl(".concat(t.hue,", 100%, 50%)")}}),sliderStyle:qr(function(){return{top:"".concat((100-t.value)/100*t.size-5,"px"),left:"".concat(t.saturation*t.size/100-5,"px"),width:"".concat(10,"px"),height:"".concat(10,"px")}}),onSelect:function(e){var i=e.target.getBoundingClientRect(),r=i.left,o=i.top,s=function(e){var i,s;e instanceof MouseEvent?(i=e.clientX,s=e.clientY):e instanceof TouchEvent&&(i=e.touches[0].clientX,s=e.touches[0].clientY);var a=i-r,l=s-o;a<0&&(a=0),l<0&&(l=0),a>t.size&&(a=t.size),l>t.size&&(l=t.size),n("change",a/t.size*100,100-l/t.size*100)};s(e);var a=function(){document.removeEventListener("mousemove",s),document.removeEventListener("mouseup",a),document.removeEventListener("touchmove",s),document.removeEventListener("touchend",a)};s(e),e instanceof MouseEvent&&(document.addEventListener("mousemove",s),document.addEventListener("mouseup",a)),e instanceof TouchEvent&&(e.preventDefault(),document.addEventListener("touchmove",s,{passive:!1}),document.addEventListener("touchend",a))}}}});function IC(t,e){void 0===e&&(e={});var n=e.insertAt;if(t&&"undefined"!=typeof document){var i=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css","top"===n&&i.firstChild?i.insertBefore(r,i.firstChild):i.appendChild(r),r.styleSheet?r.styleSheet.cssText=t:r.appendChild(document.createTextNode(t))}}IC(".saturation[data-v-24517fec]{position:relative}.saturation-black[data-v-24517fec],.saturation-white[data-v-24517fec]{cursor:pointer;height:100%;left:0;position:absolute;top:0;width:100%}.saturation-white[data-v-24517fec]{background:linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.saturation-black[data-v-24517fec]{background:linear-gradient(0deg,#000,transparent)}.slider[data-v-24517fec]{border:1px solid #fff;border-radius:50%;box-shadow:0 0 1px 1px rgba(0,0,0,.3);left:0;pointer-events:none;position:absolute;top:0;z-index:1}"),DC.render=function(t,e,n,i,r,o){return fr(),mr("div",{class:"saturation",style:W(t.saturationStyle),onMousedown:e[0]||(e[0]=rs(function(){return t.onSelect&&t.onSelect.apply(t,arguments)},["prevent","stop"])),onTouchstart:e[1]||(e[1]=rs(function(){return t.onSelect&&t.onSelect.apply(t,arguments)},["prevent","stop"]))},[e[2]||(e[2]=kr("div",{class:"saturation-white"},null,-1)),e[3]||(e[3]=kr("div",{class:"saturation-black"},null,-1)),kr("div",{class:"slider",style:W(t.sliderStyle)},null,4)],36)},DC.__scopeId="data-v-24517fec",DC.__file="src/picker/Saturation.vue";var FC=An({name:"Hue",props:{width:{type:Number,default:15},height:{type:Number,default:160},hue:{type:Number,default:0}},emits:["change"],setup:function(t,e){var n=e.emit,i=qr(function(){return{top:"".concat((1-t.hue/360)*t.height-2,"px"),height:"".concat(4,"px")}}),r=be();return $n(function(){!function(){if(r.value){r.value.width=t.width,r.value.height=t.height;var e=r.value.getContext("2d");if(e){var n=e.createLinearGradient(0,0,0,t.height);n.addColorStop(0,"#FF0000"),n.addColorStop(.17,"#FF00FF"),n.addColorStop(.34,"#0000FF"),n.addColorStop(.51,"#00FFFF"),n.addColorStop(.68,"#00FF00"),n.addColorStop(.17*5,"#FFFF00"),n.addColorStop(1,"#FF0000"),e.fillStyle=n,e.fillRect(0,0,t.width,t.height)}}}()}),{canvas:r,sliderStyle:i,onSelect:function(e){var i=e.target.getBoundingClientRect().top,r=function(e){var r;e instanceof MouseEvent?r=e.clientY:e instanceof TouchEvent&&(r=e.touches[0].clientY);var o=r-i;o<0&&(o=0),o>t.height&&(o=t.height),n("change",360*(-100*o/t.height+100)/100)},o=function(){document.removeEventListener("mousemove",r),document.removeEventListener("mouseup",o),document.removeEventListener("touchmove",r),document.removeEventListener("touchend",o)};r(e),e instanceof MouseEvent&&(document.addEventListener("mousemove",r),document.addEventListener("mouseup",o)),e instanceof TouchEvent&&(e.preventDefault(),document.addEventListener("touchmove",r,{passive:!1}),document.addEventListener("touchend",o))}}}}),WC={ref:"canvas"};IC(".hue[data-v-78b9f4f0]{position:relative;touch-action:none}.slider[data-v-78b9f4f0]{background:#fff;box-shadow:0 0 1px 0 rgba(0,0,0,.3);left:0;pointer-events:none;position:absolute;width:100%;z-index:1}"),FC.render=function(t,e,n,i,r,o){return fr(),mr("div",{class:"hue",onMousedown:e[0]||(e[0]=rs(function(){return t.onSelect&&t.onSelect.apply(t,arguments)},["prevent","stop"])),onTouchstart:e[1]||(e[1]=rs(function(){return t.onSelect&&t.onSelect.apply(t,arguments)},["prevent","stop"]))},[kr("canvas",WC,null,512),kr("div",{class:"slider",style:W(t.sliderStyle)},null,4)],32)},FC.__scopeId="data-v-78b9f4f0",FC.__file="src/picker/Hue.vue";var zC=An({name:"Alpha",props:{width:{type:Number,default:15},height:{type:Number,default:160},color:{type:String,default:"#000000"},alpha:{type:Number,default:1}},setup:function(t,e){var n=e.emit,i=qr(function(){return{top:"".concat(t.alpha*t.height-2,"px"),height:"".concat(4,"px")}}),r=be(),o=function(){var e=r.value.getContext("2d");r.value.width=t.width,r.value.height=t.height;var n=function(){var t=document.createElement("canvas"),e=t.getContext("2d");return t.width=10,t.height=10,e.fillStyle="#ffffff",e.fillRect(0,0,10,10),e.fillStyle="#ccd5db",e.fillRect(0,0,5,5),e.fillRect(5,5,5,5),t}();e.fillStyle=e.createPattern(n,"repeat"),e.fillRect(0,0,t.width,t.height);var i=e.createLinearGradient(0,0,0,t.height);i.addColorStop(.01,"rgba(255,255,255,0)"),i.addColorStop(.99,t.color),e.fillStyle=i,e.fillRect(0,0,t.width,t.height)};return rn(function(){return t.color},function(){o()}),$n(function(){o()}),{canvas:r,sliderStyle:i,onSelect:function(e){var i=e.target.getBoundingClientRect().top,r=function(e){var r;e instanceof MouseEvent?r=e.clientY:e instanceof TouchEvent&&(r=e.touches[0].clientY);var o=r-i;o<0&&(o=0),o>t.height&&(o=t.height),n("change",parseFloat((o/t.height).toFixed(2)))},o=function(){document.removeEventListener("mousemove",r),document.removeEventListener("mouseup",o),document.removeEventListener("touchmove",r),document.removeEventListener("touchend",o)};r(e),e instanceof MouseEvent&&(document.addEventListener("mousemove",r),document.addEventListener("mouseup",o)),e instanceof TouchEvent&&(e.preventDefault(),document.addEventListener("touchmove",r,{passive:!1}),document.addEventListener("touchend",o))}}}}),NC={ref:"canvas"};IC(".alpha[data-v-24dc9656]{position:relative;touch-action:none}.slider[data-v-24dc9656]{background:#fff;box-shadow:0 0 1px 0 rgba(0,0,0,.3);left:0;pointer-events:none;position:absolute;width:100%;z-index:1}"),zC.render=function(t,e,n,i,r,o){return fr(),mr("div",{class:"alpha",onMousedown:e[0]||(e[0]=rs(function(){return t.onSelect&&t.onSelect.apply(t,arguments)},["prevent","stop"])),onTouchstart:e[1]||(e[1]=rs(function(){return t.onSelect&&t.onSelect.apply(t,arguments)},["prevent","stop"]))},[kr("canvas",NC,null,512),kr("div",{class:"slider",style:W(t.sliderStyle)},null,4)],32)},zC.__scopeId="data-v-24dc9656",zC.__file="src/picker/Alpha.vue";var jC={rgb:"RGBA",hex:"HEX",hsl:"HSLA",hsv:"HSVA"},VC={rgb:"RGB",hex:"HEX",hsl:"HSL",hsv:"HSV"},HC={RGB:"rgb",RGBA:"rgb",HEX:"hex",HSL:"hsl",HSLA:"hsl",HSV:"hsv",HSVA:"hsv"};function UC(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,i)}return n}function YC(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?UC(Object(n),!0).forEach(function(e){MC(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):UC(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}var XC=null,GC=function(t,e,n){var i=be({}),r=n||{},o=r.placement,s=r.defaultStyle,a={strategy:r.strategy||"absolute",placement:o||"auto",onFirstUpdate:function(){XC.update()},modifiers:[{name:"offset",options:{offset:[0,5]}},{name:"computeStyles",options:{gpuAcceleration:!1,adaptive:!0}},{name:"flip",options:{allowedAutoPlacements:["top","bottom"]}},{name:"applyStyles",enabled:!1},{name:"updateState",enabled:!0,phase:"write",requires:["computeStyles"],fn:function(t){var e=t.state,n=e.styles,r=e.placement,o=n.popper;i.value=YC(YC(YC({},o),s),{},{transformOrigin:"top"===r?"center bottom":"center top"})}}]};return rn(function(){return[xe(t),xe(e)]},function(t,e){var n,i=AC(t,2),r=i[0],o=i[1],s=AC(e,2),l=s[0],h=s[1];if(r&&o&&(l!==r||h!==l)){null===(n=XC)||void 0===n||n.destroy();var c=r.$el||r,u=o.$el||o;je(function(){XC=xC(c,u,a)})}}),Zn(function(){var t;XC&&(null===(t=XC)||void 0===t||t.destroy(),XC=null)}),{instance:XC,style:i}},$C=An({props:{value:{type:String,default:"RGBA"},showAlpha:{type:Boolean},options:{type:[Boolean,Array]}},emits:["change"],setup:function(t,e){var n=e.emit,i=be(null),r=be(null),o=be(!1),s=GC(i,r,{strategy:"fixed",defaultStyle:{zIndex:2}}).style,a=qr(function(){return Array.isArray(t.options)&&t.options.length>1}),l=qr(function(){var e=t.options,n=t.showAlpha,i=t.value;return Array.isArray(e)?n?e.map(function(t){return jC[t]}).filter(function(t){return!t.includes(i)}):e.map(function(t){return VC[t]}).filter(function(t){return!t.includes(i)}):[]}),h=function(t){var e,n,r=t.target;(null===(e=xe(i))||void 0===e||!e.isEqualNode(r))&&null!==(n=xe(i))&&void 0!==n&&n.contains(r)||(o.value=!1)};return $n(function(){document.addEventListener("mouseup",h,!1)}),Jn(function(){document.removeEventListener("mouseup",h,!1)}),{targetRef:i,selectorRef:r,selectorStyle:s,isShowSelector:o,isNeedSelect:a,formatOptions:l,onShow:function(){a.value&&(o.value=!0)},onFormatChange:function(t){n("change",HC[t])}}}}),KC={class:"format"},qC={key:0,class:"arrow"},ZC=["onClick"];IC(".format[data-v-5f6e8f5e]{position:relative}.label[data-v-5f6e8f5e]{align-items:center;background:#e7e8e9;color:#999;display:flex;float:left;font-weight:500;height:30px;justify-content:center;position:relative;width:60px}[pick-colors-theme=dark] .label[data-v-5f6e8f5e]{background:#252930;color:#999}.arrow[data-v-5f6e8f5e]{height:6px;margin-bottom:4px;margin-left:5px;transform:rotate(135deg);width:6px}.arrow[data-v-5f6e8f5e],[pick-colors-theme=dark] .arrow[data-v-5f6e8f5e]{border-right:1px solid #999;border-top:1px solid #999}.selector[data-v-5f6e8f5e]{align-items:center;background:#f7f8f9;border-radius:5px;box-shadow:0 0 16px 0 rgba(0,0,0,.16);cursor:pointer;display:flex;flex-direction:column;font-weight:400;justify-content:center;padding:4px}[pick-colors-theme=dark] .selector[data-v-5f6e8f5e]{background:#252930;color:#999}.selector-item[data-v-5f6e8f5e]{align-items:center;display:flex;height:30px;justify-content:center;width:60px}.selector-item[data-v-5f6e8f5e]:hover{background:#e1f2fe}[pick-colors-theme=dark] .selector-item[data-v-5f6e8f5e]{color:#fff}[pick-colors-theme=dark] .selector-item[data-v-5f6e8f5e]:hover{background:#0087fa}.active-selector-item[data-v-5f6e8f5e]{background:#e1f2fe}[pick-colors-theme=dark] .active-selector-item[data-v-5f6e8f5e]{background:#0087fa}.v-enter-active[data-v-5f6e8f5e],.v-leave-active[data-v-5f6e8f5e]{opacity:1;transform:scaleY(1);transform-origin:center top;transition:opacity .2s ease-in-out,transform .2s ease-in-out}.v-enter-from[data-v-5f6e8f5e],.v-leave-to[data-v-5f6e8f5e]{opacity:0;transform:scaleY(0)}"),$C.render=function(t,e,n,i,r,o){return fr(),mr("div",KC,[kr("div",{class:"label",ref:"targetRef",onClick:e[0]||(e[0]=function(){return t.onShow&&t.onShow.apply(t,arguments)})},[kr("span",null,J(t.value),1),t.isNeedSelect?(fr(),mr("div",qC)):Pr("v-if",!0)],512),Cr(co,null,{default:Ze(function(){return[t.isShowSelector?(fr(),mr("div",{key:0,class:"selector",ref:"selectorRef",style:W(t.selectorStyle)},[(fr(!0),mr(lr,null,ai(t.formatOptions,function(e){return fr(),mr("div",{class:"selector-item",key:e,onClick:function(n){return t.onFormatChange(e)}},J(e),9,ZC)}),128))],4)):Pr("v-if",!0)]}),_:1})])},$C.__scopeId="data-v-5f6e8f5e",$C.__file="src/picker/input-value/FormatValue.vue";var JC=An({name:"Input",components:{FormatValue:$C},props:{format:{type:String,default:"RGBA"},value:{type:String,default:""},width:{type:Number},showAlpha:{type:Boolean},formatOptions:{type:[Boolean,Array]}},emits:["change","focus","blur","enter","formatChange"],setup:function(t,e){var n=e.emit;return{onInput:function(t){var e;n("change",null===(e=t.target)||void 0===e?void 0:e.value)},valueStyle:qr(function(){return{minWidth:"".concat(t.width,"px"),maxWidth:"".concat(t.width,"px"),width:"".concat(t.width,"px")}}),onFocus:function(){n("focus")},onBlur:function(){n("blur")},onEnter:function(){n("enter")},onFormatChange:function(t){n("formatChange",t)}}}}),QC={class:"input"},tE=[".value"];function eE(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,i)}return n}function nE(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?eE(Object(n),!0).forEach(function(e){MC(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):eE(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}IC(".input[data-v-2c454c00]{display:flex;font-size:12px}.value[data-v-2c454c00]{background:#eceef0;border:1px solid #eceef0;box-sizing:border-box;color:#666;flex:1;height:30px;text-align:center}[pick-colors-theme=dark] .value[data-v-2c454c00]{background:#2e333a;border:1px solid #2e333a;color:#fff}.value[data-v-2c454c00]:focus{border:1px solid #1890ff;outline:none}"),JC.render=function(t,e,n,i,r,o){var s=ri("FormatValue");return fr(),mr("div",QC,[Cr(s,{value:t.format,showAlpha:t.showAlpha,options:t.formatOptions,onChange:t.onFormatChange},null,8,["value","showAlpha","options","onChange"]),kr("input",{class:"value",style:W(t.valueStyle),".value":t.value,onFocus:e[0]||(e[0]=function(){return t.onFocus&&t.onFocus.apply(t,arguments)}),onInput:e[1]||(e[1]=function(){return t.onInput&&t.onInput.apply(t,arguments)}),onBlur:e[2]||(e[2]=function(){return t.onBlur&&t.onBlur.apply(t,arguments)}),onKeydown:e[3]||(e[3]=ss(function(){return t.onEnter&&t.onEnter.apply(t,arguments)},["enter"]))},null,44,tE)])},JC.__scopeId="data-v-2c454c00",JC.__file="src/picker/input-value/InputValue.vue";var iE=function(t,e,n){return[t,e*n/((t=(2-e)*n)<1?t:2-t)||0,t/2]},rE={10:"A",11:"B",12:"C",13:"D",14:"E",15:"F"},oE=function(t){t=Math.min(Math.round(t),255);var e=Math.floor(t/16),n=t%16;return"".concat(rE[e]||e).concat(rE[n]||n)},sE=function(t){var e=t.r,n=t.g,i=t.b;return isNaN(e)||isNaN(n)||isNaN(i)?"":"#".concat(oE(e)).concat(oE(n)).concat(oE(i))},aE=function(t,e){var n;"string"==typeof(n=t)&&-1!==n.indexOf(".")&&1===parseFloat(n)&&(t="100%");var i=function(t){return"string"==typeof t&&-1!==t.indexOf("%")}(t);return t=Math.min(e,Math.max(0,parseFloat("".concat(t)))),i&&(t=parseInt("".concat(t*e),10)/100),Math.abs(t-e)<1e-6?1:t%e/parseFloat(e)},lE=function(t,e,n){t=6*aE(t,360),e=aE(e,100),n=aE(n,100);var i=Math.floor(t),r=t-i,o=n*(1-e),s=n*(1-r*e),a=n*(1-(1-r)*e),l=i%6,h=[n,s,o,o,a,n][l],c=[a,n,n,s,o,o][l],u=[o,o,a,n,n,s][l];return{r:Math.round(255*h),g:Math.round(255*c),b:Math.round(255*u)}},hE=function(t,e,n){var i,r,o=t.h,s=t.s,a=t.v,l=t.a;if(n)switch(["hsl","hsv","rga"].includes(e)&&(l=(r=(i=l).toString().match(/\.(\d{1,2})(\d*)/))&&r[2].length>0?parseFloat(i.toFixed(2)):i),e){case"hsl":var h=iE(o,s/100,a/100);return"hsla(".concat(o.toFixed(0),", ").concat(Math.round(100*h[1]),"%, ").concat(Math.round(100*h[2]),"%, ").concat(l,")");case"hsv":return"hsva(".concat(o.toFixed(0),", ").concat(Math.round(s),"%, ").concat(Math.round(a),"%, ").concat(l,")");case"rgb":var c=lE(o,s,a),u=c.r,d=c.g,p=c.b;return"rgba(".concat(u,", ").concat(d,", ").concat(p,", ").concat(l,")");default:return"".concat(sE(lE(o,s,a))).concat(oE(255*l))}else switch(e){case"hsl":var f=iE(o,s/100,a/100);return"hsl(".concat(o.toFixed(0),", ").concat(Math.round(100*f[1]),"%, ").concat(Math.round(100*f[2]),"%)");case"hsv":return"hsv(".concat(o.toFixed(0),", ").concat(Math.round(s),"%, ").concat(Math.round(a),"%)");case"rgb":var g=lE(o,s,a),v=g.r,_=g.g,m=g.b;return"rgb(".concat(v,", ").concat(_,", ").concat(m,")");default:return sE(lE(o,s,a))}},cE=function(t){var e=t.r,n=t.g,i=t.b;e=aE(e,255),n=aE(n,255),i=aE(i,255);var r,o=Math.max(e,n,i),s=Math.min(e,n,i),a=o,l=o-s,h=0===o?0:l/o;if(o===s)r=0;else{switch(o){case e:r=(n-i)/l+(n<i?6:0);break;case n:r=(i-e)/l+2;break;case i:r=(e-n)/l+4}r/=6}return{h:360*r,s:100*h,v:100*a}},uE=function(t){var e=t.h,n=t.s,i=t.l;i/=100;var r=n/=100,o=Math.max(i,.01);return n*=(i*=2)<=1?i:2-i,r*=o<=1?o:2-o,{h:+e,s:100*(0===i?2*r/(o+r):2*n/(i+n)),v:(i+n)/2*100}},dE=function(t){var e=[];if(t.match(/^#([0-9a-fA-f]{3,4})$/g))for(var n=1;n<t.length;n++)e.push(parseInt("0x"+t[n].repeat(2)));else if(t.match(/^#([0-9a-fA-f]{6}|[0-9a-fA-f]{8})$/g))for(var i=1;i<t.length;i+=2)e.push(parseInt("0x"+t.slice(i,i+2)));return{r:e[0],g:e[1],b:e[2],a:e[3]}},pE=function(t,e,n){if("string"==typeof t&&""!==t){var i=yE(_E(t,mE(t),n));return null==i?"":hE(i,e,n)}return""},fE=function(t){var e=AC(t.match(/(\d(\.\d+)?)+/g),4);return{r:e[0],g:e[1],b:e[2],a:e[3]}},gE=function(t){var e=AC(t.match(/(\d(\.\d+)?)+/g),4),n=e[0],i=e[1],r=e[2],o=e[3];return{h:n,s:parseFloat(i),l:parseFloat(r),a:o}},vE=function(t){var e=AC(t.match(/(\d(\.\d+)?)+/g),4),n=e[0],i=e[1],r=e[2],o=e[3];return{h:parseFloat(n),s:parseFloat(i),v:parseFloat(r),a:parseFloat(o)}},_E=function(t,e){if(arguments.length>2&&void 0!==arguments[2]&&!arguments[2])switch(e){case"rgb":return nE(nE({},cE(fE(t))),{},{a:1});case"hsv":var n=vE(t);return{h:n.h,s:n.s,v:n.v,a:1};case"hsl":return nE(nE({},uE(gE(t))),{},{a:1});default:return nE(nE({},cE(dE(t))),{},{a:1})}else switch(e){case"rgb":var i=fE(t),r=i.r,o=i.g,s=i.b,a=i.a;return nE(nE({},cE({r:r,g:o,b:s})),{},{a:+a});case"hsv":var l=vE(t);return{h:l.h,s:l.s,v:l.v,a:l.a};case"hsl":var h=gE(t),c=h.h,u=h.s,d=h.l,p=h.a;return nE(nE({},uE({h:c,s:u,l:d})),{},{a:+p});default:var f=dE(t),g=f.r,v=f.g,_=f.b,m=f.a;return nE(nE({},cE({r:g,g:v,b:_})),{},{a:m/255})}},mE=function(t){return t.match(/^#/)?"hex":t.match(/^rgb/)?"rgb":t.match(/^hsl/)?"hsl":t.match(/^hsv/)?"hsv":"hex"},yE=function(t){var e=t.h,n=t.s,i=t.v,r=t.a;return isNaN(e)&&isNaN(n)&&isNaN(i)?null:(isNaN(e)&&(e=0),isNaN(n)&&(n=0),isNaN(i)&&(i=0),isNaN(r)&&(r=1),{h:e,s:n,v:i,a:r})},bE=An({name:"ColorItem",props:{size:{type:[Number,String],default:20},width:{type:[Number,String]},height:{type:[Number,String]},value:{type:String,default:""},border:{type:Boolean,default:!0},borderRadius:{type:Number,default:5},selected:{type:Boolean,default:!1},draggable:{type:Boolean,default:!1}},emits:["select"],setup:function(t){var e=be(),n=en("theme",{theme:"light"}).theme,i=qr(function(){return parseFloat((t.width||t.size)+"")}),r=qr(function(){return parseFloat((t.height||t.size)+"")}),o=qr(function(){return{width:"".concat(xe(i),"px"),height:"".concat(xe(r),"px"),border:t.border?"1px solid ".concat("dark"===xe(n)?"#434345":"#d9d9d9"):"",borderRadius:"".concat(t.borderRadius,"px"),boxShadow:t.selected?"0 0 3px 2px ".concat("dark"===xe(n)?"#2681ff":"#1890ff"):""}}),s=function(){var n=e.value.getContext("2d");e.value.width=xe(i),e.value.height=xe(r);var o=function(){var t=document.createElement("canvas"),e=t.getContext("2d");return t.width=10,t.height=10,e.fillStyle="#ffffff",e.fillRect(0,0,10,10),e.fillStyle="#ccd5db",e.fillRect(0,0,5,5),e.fillRect(5,5,5,5),t}();n.fillStyle=n.createPattern(o,"repeat"),n.fillRect(0,0,xe(i),xe(r)),n.fillStyle=t.value,n.fillRect(0,0,xe(i),xe(r))};return rn(function(){return t.value},function(){s()}),$n(function(){s()}),{canvas:e,colorItemStyle:o}}}),wE=["draggable"];IC(".color-item[data-v-02da71fd]{display:inline-block;vertical-align:top}"),bE.render=function(t,e,n,i,r,o){return fr(),mr("canvas",{class:"color-item",style:W(t.colorItemStyle),ref:"canvas",draggable:t.draggable},null,12,wE)},bE.__scopeId="data-v-02da71fd",bE.__file="src/color-item/ColorItem.vue";var xE=An({name:"Colors",components:{ColorItem:bE},props:{colors:{type:Array,default:function(){return[]}},selectedIndex:{type:Number,default:-1}},emits:["change"],setup:function(t,e){var n=e.emit;return{onSelectColor:function(t,e){n("change",t,e)},useColors:qr(function(){return t.colors.map(function(t){return pE(t,"hex",!0)})})}}}),SE={class:"colors"};function kE(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,i)}return n}function CE(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?kE(Object(n),!0).forEach(function(e){MC(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):kE(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}IC(".colors[data-v-0f8b52a8]{align-items:center;display:flex;flex-wrap:wrap;margin-top:5px}.color-item[data-v-0f8b52a8]{margin:5px}"),xE.render=function(t,e,n,i,r,o){var s=ri("color-item");return fr(),mr("div",SE,[(fr(!0),mr(lr,null,ai(t.useColors,function(e,n){return fr(),yr(s,{key:n,class:"color-item",size:16,value:e,border:!1,"border-radius":3,selected:t.selectedIndex===n,onClick:rs(function(i){return t.onSelectColor(e,+n)},["stop","prevent"])},null,8,["value","selected","onClick"])}),128))])},xE.__scopeId="data-v-0f8b52a8",xE.__file="src/picker/Colors.vue";var EE=An({name:"Picker",components:{Colors:xE,Saturation:DC,Hue:FC,Alpha:zC,InputValue:JC},props:{format:{type:String,default:"hex"},showAlpha:{type:Boolean,default:!1},value:{type:String,default:""},colors:{type:Array,default:function(){return[]}},style:{type:Object,default:function(){return{}}},formatOptions:{type:[Boolean,Array]}},emits:["change","formatChange"],setup:function(t,e){var n=e.emit,i=qr(function(){return CE(CE({},t.style),{},{width:t.showAlpha?"230px":"205px"})}),r=be(),o=be(),s=be(),a=function(){var e,n=null===(e=t.value)||void 0===e?void 0:e.trim();return null!=n&&""!==n?yE(_E(n,mE(n),t.showAlpha)):null};rn(function(){return t.value},function(){t.value!==xe(s)&&(r.value=a())},{immediate:!0}),rn(function(){return[xe(r),t.format]},function(e){var i=AC(e,2),r=i[0],l=i[1],h="";null!=r?(h=hE(CE({},r),t.format,t.showAlpha),o.value=CE({},r)):o.value=null,s.value=h;var c=a();JSON.stringify(r)!==JSON.stringify(c)&&JSON.stringify(r)!==JSON.stringify(l)&&n("change",h)},{immediate:!0});var l=qr(function(){var t;return(null===(t=xe(r))||void 0===t?void 0:t.h)||0}),h=qr(function(){var t;return(null===(t=xe(r))||void 0===t?void 0:t.s)||0}),c=qr(function(){var t;return(null===(t=xe(r))||void 0===t?void 0:t.v)||0}),u=qr(function(){var t,e;return null!=(null===(t=xe(r))||void 0===t?void 0:t.a)?null===(e=xe(r))||void 0===e?void 0:e.a:1}),d=qr(function(){return lE(xe(l),xe(h),xe(c))}),p=qr(function(){return"rgb(".concat(xe(d).r,", ").concat(xe(d).g,", ").concat(xe(d).b,")")}),f=be(-1);return{h:l,s:h,v:c,a:u,rgbStr:p,onSelectSaturation:function(t,e){f.value=-1,null==xe(r)?r.value={h:xe(l),s:t,v:e,a:xe(u)}:r.value=CE(CE({},xe(r)),{},{s:t,v:e})},onSelectHue:function(t){f.value=-1,xe(r)??(r.value={h:t,s:xe(h),v:xe(c),a:xe(u)}),r.value=CE(CE({},xe(r)),{},{h:t})},onSelectAlpha:function(t){f.value=-1,null==xe(r)?r.value={h:xe(l),s:xe(h),v:xe(c),a:t}:r.value=CE(CE({},xe(r)),{},{a:t})},handleInputFormat:function(e){return t.showAlpha?jC[e]:VC[e]},colorValue:s,pickerStyle:i,onInputChange:function(t){f.value=-1,s.value=t},handleChange:function(){var e,n=null===(e=xe(s))||void 0===e?void 0:e.trim();if(""!==n){var i=t.showAlpha,a=yE(_E(n,mE(n),i));!function(t){if(!t)return!1;var e=t.h,n=t.s,i=t.v,r=t.a;return!(isNaN(e)||isNaN(n)||isNaN(i)||isNaN(r))}(a)?null!=xe(o)?r.value=xe(o):s.value="":r.value=a}else r.value=null},selectColorIndex:f,onSelectColor:function(t,e){if(f.value=e,""===(t=t.trim()))r.value=null;else{var n=mE(t);n?function(t,e){if(0!==t.length){var n=_E(t,e,!0),i=n.h,o=n.s,s=n.v;if(!(isNaN(i)||isNaN(o)||isNaN(s))){var a=1,l=n.a;isNaN(l)||(a=l),r.value={h:i,s:o,v:s,a:a}}}}(t,n):r.value=null}},onFormatChange:function(t){n("formatChange",t)}}}}),OE={class:"picker-inner"},LE={class:"picker-header"};IC(".picker[data-v-6ceadec6]{background:#f7f8f9;border-radius:4px;box-shadow:0 0 16px 0 rgba(0,0,0,.16)}.picker-inner[data-v-6ceadec6]{padding:10px}[pick-colors-theme=dark] .picker-inner[data-v-6ceadec6]{background:#1d2024;box-shadow:0 0 16px 0 rgba(0,0,0,.16)}.picker-header[data-v-6ceadec6]{display:flex;margin-bottom:5px}.alpha[data-v-6ceadec6],.hue[data-v-6ceadec6]{margin-left:10px}.colors[data-v-6ceadec6]{margin-top:5px}"),EE.render=function(t,e,n,i,r,o){var s=ri("saturation"),a=ri("hue"),l=ri("alpha"),h=ri("input-value"),c=ri("Colors");return fr(),mr("div",{class:"picker",style:W(t.pickerStyle)},[kr("div",OE,[kr("div",LE,[Cr(s,{class:"saturation",hue:t.h,saturation:t.s,value:t.v,onChange:t.onSelectSaturation},null,8,["hue","saturation","value","onChange"]),Cr(a,{class:"hue",hue:t.h,onChange:t.onSelectHue},null,8,["hue","onChange"]),t.showAlpha?(fr(),yr(l,{key:0,class:"alpha",alpha:t.a,color:t.rgbStr,onChange:t.onSelectAlpha},null,8,["alpha","color","onChange"])):Pr("v-if",!0)]),Cr(h,{format:t.handleInputFormat(t.format),value:t.colorValue,showAlpha:t.showAlpha,width:t.showAlpha?150:125,formatOptions:t.formatOptions,onChange:t.onInputChange,onBlur:t.handleChange,onEnter:t.handleChange,onFormatChange:t.onFormatChange},null,8,["format","value","showAlpha","width","formatOptions","onChange","onBlur","onEnter","onFormatChange"]),t.colors.length>0?(fr(),yr(c,{key:0,class:"colors",colors:t.colors,"selected-index":t.selectColorIndex,onChange:t.onSelectColor},null,8,["colors","selected-index","onChange"])):Pr("v-if",!0)])],4)},EE.__scopeId="data-v-6ceadec6",EE.__file="src/picker/Picker.vue";var PE=An({name:"AddColorItem",props:{size:{type:Number,default:20},selected:{type:Boolean,default:!1}},setup:function(t){var e=en("theme",{theme:"light"}).theme;return{addColorItemStyle:qr(function(){return{width:"".concat(t.size,"px"),height:"".concat(t.size,"px"),lineHeight:"".concat(t.size,"px"),boxShadow:t.selected?"0 0 3px 2px ".concat("dark"===xe(e)?"#2681ff":"#1890ff"):""}})}}});IC(".add-color-item[data-v-ceb1719c]{background:#fff;border:1px solid #d9d9d9;border-radius:5px;vertical-align:top}.container[data-v-ceb1719c]{pointer-events:none;transform:scale(.9);transform-origin:center}[pick-colors-theme=dark] .add-color-item[data-v-ceb1719c]{background:#141414;border:1px solid #434343}path[data-v-ceb1719c]{fill:#000}[pick-colors-theme=dark] path[data-v-ceb1719c]{fill:#fff}"),PE.render=function(t,e,n,i,r,o){return fr(),mr("svg",{class:"add-color-item",style:W(t.addColorItemStyle),viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg"},e[0]||(e[0]=[kr("g",{class:"container"},[kr("path",{d:"M544 464V160h-80v304H160v80h304v304h80V544h304v-80z"})],-1)]),4)},PE.__scopeId="data-v-ceb1719c",PE.__file="src/add-color-item/AddColorItem.vue";var TE=An({name:"ColorPicker",components:{ColorItem:bE,Picker:EE,AddColorItem:PE},props:{value:{type:[String,Array]},theme:{type:String,default:"light"},size:{type:[Number,String],default:20},width:{type:[Number,String]},height:{type:[Number,String]},format:{type:String},showPicker:{type:Boolean,default:void 0},showAlpha:{type:Boolean,default:!1},addColor:{type:Boolean,default:!1},deleteColor:{type:Boolean,default:!0},max:{type:Number,default:13},popupContainer:{type:[String,Object,Boolean],default:"body"},zIndex:{type:Number,default:1e3},colors:{type:Array,default:function(){return["#ff4500","#ff8c00","#ffd700","#90ee90","#00ced1","#1e90ff","#c71585","#ff4500","#ff7d4d","#00babd","#1f93ff","#fa64c3"]}},position:{type:String},placement:{type:String},formatOptions:{type:[Boolean,Array],default:!1}},emits:["change","update:value","update:showPicker","overflowMax","closePicker","formatChange"],setup:function(t,e){var n=e.emit,i=be([]),r=qr(function(){return xe(i).map(function(e){return pE(e,"hex",t.showAlpha)})}),o=be("hex");rn(function(){return t.format},function(){o.value=t.format},{immediate:!0}),rn(function(){return t.value},function(){var e=t.value||"";i.value=(Array.isArray(e)?e:[e]).map(function(e){return pE(e,xe(o),t.showAlpha)})},{immediate:!0});var s=be(void 0),a=qr(function(){return xe(i)[xe(s)]}),l=be(!1);rn(function(){return t.showPicker},function(){l.value=t.showPicker},{immediate:!0});var h,c,u=be(null),d=be(null),p=GC(u,d,{defaultStyle:{zIndex:t.zIndex},strategy:t.position,placement:t.placement}).style,f=function(){xe(u)??(u.value=xe(k)[0]),xe(s)??(s.value=0),void 0===t.showPicker?l.value=!0:n("update:showPicker",!0)},g=function(){s.value=void 0,void 0===t.showPicker?l.value=!1:n("update:showPicker",!1),n("closePicker",ve(Array.isArray(t.value)||t.addColor?xe(i):xe(i)[0]))},v=be(),_=function(){var t=LC(RC.mark(function t(e){var n,i,r,o;return RC.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(i=e.target,null!=(r=null===(n=i.dataset)||void 0===n?void 0:n.index)&&""!==r){t.next=4;break}return t.abrupt("return");case 4:if(o=+r,xe(s)!==o){t.next=7;break}return t.abrupt("return");case 7:null!=xe(s)&&xe(s)!==o?(g(),h&&clearTimeout(h),h=setTimeout(function(){f(),clearTimeout(h)},100)):f(),s.value=o,u.value=i;case 10:case"end":return t.stop()}},t)}));return function(e){return t.apply(this,arguments)}}(),m=function(){var t=LC(RC.mark(function t(e){var n,i,r,o,s;return RC.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(o=e.target,null!==(n=xe(v))&&void 0!==n&&n.isEqualNode(o)||!(null===(i=xe(v))||void 0===i?void 0:i.contains(o))){t.next=4;break}return t.abrupt("return");case 4:if(!(null==(s=null===(r=xe(d))||void 0===r?void 0:r.$el)?void 0:s.contains(o))){t.next=8;break}return t.abrupt("return");case 8:c&&clearTimeout(c),c=setTimeout(function(){xe(l)&&g()},0);case 10:case"end":return t.stop()}},t)}));return function(e){return t.apply(this,arguments)}}();rn(l,function(){xe(l)&&(f(),clearTimeout(c))});var y,b=be(t.max>xe(i).length),w=qr(function(){return"string"==typeof t.popupContainer||"object"===EC(t.popupContainer)&&null!=t.popupContainer?t.popupContainer:"body"}),x=qr(function(){return"boolean"==typeof t.popupContainer&&!1===t.popupContainer}),S=qr(function(){return t.theme});rn(function(){return[t.theme,xe(d)]},function(){je(function(){var t,e;null===(t=xe(v))||void 0===t||t.setAttribute("pick-colors-theme",xe(S)),null===(e=xe(d))||void 0===e||null===(e=e.$el)||void 0===e||e.setAttribute("pick-colors-theme",xe(S))})},{immediate:!0}),tn("theme",{theme:S});var k=be([]);return $n(function(){document.addEventListener("mouseup",m,!1),t.showPicker&&f()}),Jn(function(){document.removeEventListener("mouseup",m,!1),h&&(clearTimeout(h),h=null),c&&(clearTimeout(c),c=null)}),{valueList:i,colorItemSelected:function(e){return(t.addColor?xe(i).length>0:xe(i).length>1)&&xe(s)===e},selectedColor:a,selectedIndex:s,isShowPicker:l,addColorItemShow:b,onPickerChange:function(e){var r=xe(s),o=xe(i).slice(),a=xe(i).length;if(null!=r){r>=0?o[r]=e:(s.value=a,o.push(e));var l;l=Array.isArray(t.value)||t.addColor?o:e,i.value=Array.isArray(l)?l:[l],n("update:value",l),n("change",l,e,r),t.addColor&&a>=t.max&&(b.value=!1,n("overflowMax"))}},colorPicker:v,onColorClick:_,pickerRef:d,onColorItemDragStart:function(t){t.dataTransfer.effectAllowed="move",y=+t.target.dataset.index},onColorItemDragOver:function(t){},onColorItemDrop:function(t){var e=+t.target.dataset.index,r=CC(xe(i)),o=r[y];r.splice(y,1);var s=r.slice(0,e),a=r.splice(e),l=s.concat([o]).concat(a);n("update:value",l),n("change",l,l[y],y)},colorItemsRef:k,pickerStyle:p,values:r,teleportDisabled:x,toPopupContainer:w,formatValue:o,onFormatChange:function(t){o.value=t,n("formatChange",t)}}}});IC(".color-picker[data-v-3c43ade8]{display:inline-block}.color-item[data-v-3c43ade8]{margin:5px}.add-color-item[data-v-3c43ade8]{display:inline-block;margin:5px}.picker[data-v-3c43ade8]{overflow:hidden}.v-enter-active[data-v-3c43ade8],.v-leave-active[data-v-3c43ade8]{opacity:1;transform:scaleY(1);transform-origin:center top;transition:opacity .2s ease-in-out,transform .2s ease-in-out}.v-enter-from[data-v-3c43ade8],.v-leave-to[data-v-3c43ade8]{opacity:0;transform:scaleY(0)}"),TE.render=function(t,e,n,i,r,o){var s=ri("color-item"),a=ri("add-color-item"),l=ri("picker");return fr(),mr("div",{class:"color-picker",ref:"colorPicker",onDragstart:e[0]||(e[0]=rs(function(){return t.onColorItemDragStart&&t.onColorItemDragStart.apply(t,arguments)},["stop"])),onDragover:e[1]||(e[1]=rs(function(){return t.onColorItemDragOver&&t.onColorItemDragOver.apply(t,arguments)},["prevent","stop"])),onDrop:e[2]||(e[2]=rs(function(){return t.onColorItemDrop&&t.onColorItemDrop.apply(t,arguments)},["prevent","stop"])),onClick:e[3]||(e[3]=rs(function(){return t.onColorClick&&t.onColorClick.apply(t,arguments)},["stop"]))},[(fr(!0),mr(lr,null,ai(t.values,function(e,n){return fr(),yr(s,{class:"color-item",key:n,ref_for:!0,ref:function(e){return t.colorItemsRef[n]=e},size:t.size,width:t.width,height:t.height,value:e,selected:t.colorItemSelected(n),"data-index":n,draggable:t.valueList.length>1,format:t.formatValue},null,8,["size","width","height","value","selected","data-index","draggable","format"])}),128)),t.addColor&&t.addColorItemShow?(fr(),yr(a,{key:0,class:"add-color-item",ref:"addColorItem",selected:t.colorItemSelected(-1),"data-index":-1},null,8,["selected"])):Pr("v-if",!0),(fr(),yr(_n,{to:t.toPopupContainer,disabled:t.teleportDisabled},[Cr(co,null,{default:Ze(function(){return[t.isShowPicker?(fr(),yr(l,{key:0,class:"picker",style:W(t.pickerStyle),ref:"pickerRef",value:t.selectedColor,format:t.formatValue,"show-alpha":t.showAlpha,colors:t.colors,formatOptions:t.formatOptions,onChange:t.onPickerChange,onFormatChange:t.onFormatChange},null,8,["style","value","format","show-alpha","colors","formatOptions","onChange","onFormatChange"])):Pr("v-if",!0)]}),_:1})],8,["to","disabled"]))],544)},TE.__scopeId="data-v-3c43ade8",TE.__file="src/ColorPicker.vue";var BE={class:"panel-header"},RE={class:"panel-content"},AE={class:"config-item"},ME={class:"color-picker-wrapper"},DE={class:"config-item"},IE={class:"config-value"},FE={class:"config-item"},WE=["min","max"],zE={class:"config-value"},NE={class:"config-item"},jE={class:"config-value"},VE=An({__name:"BrushStylePanel",props:{visible:{type:Boolean},brushStyle:{},buttonRect:{}},emits:["close","update"],setup(t,{emit:e}){const n=t,i=e,r=["#FF4D4F","#FF7875","#FFA940","#FFC53D","#A0D911","#52C41A","#34D399","#10B981","#06B6D4","#0EA5E9","#3B82F6","#6366F1","#8B5CF6","#A855F7","#D946EF","#EC4899","#000000","#666666","#999999","#CCCCCC"],o=be(n.brushStyle.color),s=be(n.brushStyle.opacity),a=be(n.brushStyle.size),l=be(n.brushStyle.continuity);rn(()=>n.brushStyle,t=>{o.value=t.color,s.value=t.opacity,a.value=t.size,l.value=t.continuity},{deep:!0,immediate:!0});rn([o,s,a,l],()=>{(()=>{let t=o.value;if(t.startsWith("rgba")){const e=t.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)/);e&&(t="#"+parseInt(e[1]).toString(16).padStart(2,"0")+parseInt(e[2]).toString(16).padStart(2,"0")+parseInt(e[3]).toString(16).padStart(2,"0"))}else if(t.startsWith("rgb")){const e=t.match(/rgb\((\d+),\s*(\d+),\s*(\d+)\)/);e&&(t="#"+parseInt(e[1]).toString(16).padStart(2,"0")+parseInt(e[2]).toString(16).padStart(2,"0")+parseInt(e[3]).toString(16).padStart(2,"0"))}i("update",{color:t,opacity:s.value,size:a.value,continuity:l.value})})()});const h=qr(()=>{if(!n.buttonRect)return{left:"50%",top:"50%",transform:"translate(-50%, -50%)"};return{left:`${n.buttonRect.left+n.buttonRect.width/2}px`,bottom:`calc(100vh - ${n.buttonRect.top-10}px)`,transform:"translateX(-50%)"}});return(e,n)=>(fr(),yr(_n,{to:"body"},[t.visible?(fr(),mr("div",{key:0,class:"brush-panel-overlay",onClick:n[0]||(n[0]=t=>e.$emit("close"))})):Pr("",!0),t.visible?(fr(),mr("div",{key:1,class:"brush-style-panel",style:W(h.value),onClick:n[6]||(n[6]=rs(()=>{},["stop"]))},[kr("div",BE,[n[7]||(n[7]=kr("span",null,"笔刷配置",-1)),kr("button",{class:"close-btn",onClick:n[1]||(n[1]=t=>e.$emit("close"))},"×")]),kr("div",RE,[kr("div",AE,[n[8]||(n[8]=kr("label",{class:"config-label"},"颜色: ",-1)),kr("div",ME,[Cr(xe(TE),{value:o.value,"onUpdate:value":n[2]||(n[2]=t=>o.value=t),"predefine-colors":r,placement:"right","z-index":2001,popupContainer:!1},null,8,["value"])])]),kr("div",DE,[n[9]||(n[9]=kr("label",{class:"config-label"},"透明度: ",-1)),Je(kr("input",{type:"range",class:"config-slider","onUpdate:modelValue":n[3]||(n[3]=t=>s.value=t),min:"0.1",max:"1",step:"0.01"},null,512),[[$o,s.value,void 0,{number:!0}]]),kr("span",IE,J(Math.round(100*s.value))+"%",1)]),kr("div",FE,[n[10]||(n[10]=kr("label",{class:"config-label"},"大小:",-1)),Je(kr("input",{type:"range",class:"config-slider","onUpdate:modelValue":n[4]||(n[4]=t=>a.value=t),min:t.brushStyle.minSize,max:t.brushStyle.maxSize},null,8,WE),[[$o,a.value,void 0,{number:!0}]]),kr("span",zE,J(a.value),1)]),kr("div",NE,[n[11]||(n[11]=kr("label",{class:"config-label"},"连续性: ",-1)),Je(kr("input",{type:"range",class:"config-slider","onUpdate:modelValue":n[5]||(n[5]=t=>l.value=t),min:"5",max:"50"},null,512),[[$o,l.value,void 0,{number:!0}]]),kr("span",jE,J(l.value),1)])])],4)):Pr("",!0)]))}}),HE=(t,e)=>{const n=t.__vccOpts||t;for(const[i,r]of e)n[i]=r;return n},UE=HE(VE,[["__scopeId","data-v-10bc9982"]]),YE={key:0,class:"loading-overlay"},XE={key:2,class:"error-overlay"},GE={key:3,class:"zoom-controller"},$E={key:0,class:"hotkey-hint"},KE={key:0,class:"hotkey-hint"},qE={key:0,class:"hotkey-hint"},ZE={key:0,class:"toolbar"},JE={key:0,class:"hotkey-hint"},QE={key:0,class:"hotkey-hint"},tO={key:0,class:"hotkey-hint"},eO={key:0,class:"hotkey-hint"},nO={key:0,class:"hotkey-hint"},iO={key:0,class:"hotkey-hint"},rO={key:0,class:"hotkey-hint"},oO="default",sO=An({__name:"PointAnnotation",props:{imageSource:{type:Object,required:!1,default:null},options:{type:Object,default:()=>({})},currentLayer:{type:String,required:!1,default:null}},emits:["pointChange","loadStart","loadSuccess","loadError","undoStateChange","redoStateChange","update:currentLayer","layerChange"],setup(t,{expose:e,emit:n}){const i=t,r=n,o=be(void 0),s=be(null),a=be("idle"),l=be(null),h=be(null),c=be(!1),u=be(""),d=be(!1);let p=null,f=null;const g=new Gg({name:"contentLayer"}),v=new Gg({name:"pointLayer"}),_=be({x:0,y:0}),m=be(!1),y=be(!1),b=be(!1),w=be("select"),x=be(100),S=be(void 0),k=be(!1),C=be(null),E=be([]),O=be(1),L=qr(()=>"success"===a.value),P=qr(()=>L.value&&!1!==i.options?.showToolbar),T=qr(()=>L.value&&!1!==i.options?.showZoomController),B=qr(()=>!1!==i.options?.enableBrush),R=qr(()=>({...MS,...i.options?.pointStyle})),A=qr(()=>({...DS,...i.options?.brushStyle})),M=be({...DS,...i.options?.brushStyle});rn(A,t=>{M.value={...t}},{immediate:!0}),rn(()=>M.value.opacity,t=>{Object.values(I.value).forEach(e=>{e.setOpacity(t)})}),rn(()=>i.imageSource?.url,(t,e)=>{t?(c.value=!1,u.value="",U(t)):e&&!t&&(c.value=!1,u.value="",kt(),f&&(g.clear(),f.destroy(),f=null),a.value="idle")},{immediate:!0});const D=qr(()=>{const t=i.options?.brushLayers;if(!t||0===t.length)return[{label:"笔刷",value:oO,color:M.value.color,opacity:M.value.opacity,size:M.value.size}];const e=i.options?.maxBrushLayers||8;return t.slice(0,e)}),I=be({}),F=be(""),W=qr(()=>i.currentLayer&&D.value.some(t=>t.value===i.currentLayer)?i.currentLayer:F.value&&D.value.some(t=>t.value===F.value)?F.value:D.value[0]?.value||oO),z=qr(()=>I.value[W.value]||null);rn(()=>B.value,t=>{t||("brush"!==w.value&&"eraser"!==w.value||(w.value="select"),k.value=!1),t&&l.value&&h.value&&p&&dt()}),rn(()=>{const t=i.options?.brushLayers;return t?t.map(t=>t.value).sort().join(","):""},()=>{B.value&&l.value&&h.value&&p&&dt()});const N=be(!1);let j=null;const V=t=>{if(R.value.fixedSizeOnZoom&&t&&t.children&&t.children.length){const e=p?.tree.scaleX||1,n=R.value.fixedSizeScale||1;t.children.forEach(t=>{t.scale=n/e})}},U=async t=>{const e=t||(c.value?u.value:i.imageSource?.url||"");if(p&&e){f&&(g.clear(),f.destroy()),a.value="loading",r("loadStart"),l.value=null,h.value=null;try{const t=await(n=e,new Promise((t,e)=>{const i=new window.Image;i.onload=()=>{t({width:i.width,height:i.height})},i.onerror=e,i.src=n}));l.value=t.width,h.value=t.height,f=new Bv({url:e,draggable:!1,editable:!1,lazy:!0,zIndex:-1,placeholderColor:"transparent"}),f.on(Pp.LOADED,function(){a.value="success",r("loadSuccess"),nt(),ft()}),f.on(Pp.ERROR,function(t){a.value="error",r("loadError",t)}),g.add(f)}catch(o){a.value="error",r("loadError",o)}var n}else a.value="idle"},Y=t=>{const e=t.target,n=e.files?.[0];if(n&&n.type.startsWith("image/")){const t=new FileReader;t.onload=t=>{const e=t.target?.result;u.value=e,c.value=!0,U(e)},t.readAsDataURL(n)}e.value=""},X=()=>{s.value?.click()},G=t=>{t.preventDefault(),t.stopPropagation(),d.value=!0},$=t=>{t.preventDefault(),t.stopPropagation(),d.value=!1},K=t=>{t.preventDefault(),t.stopPropagation(),d.value=!1;const e=t.dataTransfer?.files;if(e&&e.length>0){const t=e[0];if(t.type.startsWith("image/")){const e=new FileReader;e.onload=t=>{const e=t.target?.result;u.value=e,c.value=!0,U(e)},e.readAsDataURL(t)}}},q=(t,e,n)=>new Promise(r=>{const o=e||i.options?.maskExportFormat||"png",s=n||i.options?.maskExportForeground||"black",a="png"===o?"image/png":"image/jpeg",c=t.getImageData();if(!c)return void r(null);const u=document.createElement("img");u.onload=()=>{const t=document.createElement("canvas");t.width=l.value||0,t.height=h.value||0;const e=t.getContext("2d");if(!e)return void r(null);e.drawImage(u,0,0);const n="white"===s,i=e.getImageData(0,0,t.width,t.height),c=i.data;for(let r=0;r<c.length;r+=4)c[r+3]>0?(c[r]=n?255:0,c[r+1]=n?255:0,c[r+2]=n?255:0,c[r+3]=255):"png"!==o&&(c[r]=n?0:255,c[r+1]=n?0:255,c[r+2]=n?0:255,c[r+3]=255);e.putImageData(i,0,0),r({canvas:t,mime:a})},u.onerror=()=>{r(null)},u.src=c}),Z=async(t,e,n)=>{const i=await q(t,e,n);if(!i)return null;const{canvas:r,mime:o}=i;return"image/png"===o?r.toDataURL("image/png"):r.toDataURL("image/jpeg",.95)},Q=(t,e)=>new Promise(n=>{try{t.toBlob(t=>{n(t)},e,"image/jpeg"===e?.95:void 0)}catch(kE){n(null)}}),tt=(t,e,n)=>{if(!B.value)return Promise.resolve(null);const i=t?I.value[t]:z.value;return i?new Promise(async t=>{const r=await q(i,e,n);if(!r)return t(null);t(await Q(r.canvas,r.mime))}):Promise.resolve(null)};$n(()=>{je(()=>{(()=>{const t=i.options?.canvasBackground??"#e3e3e3",e=i.options?.zoomMin??.2,n=i.options?.zoomMax??4;p=new Vv({view:o.value,width:o.value?.clientWidth||800,height:o.value?.clientHeight||600,fill:t,zoom:{min:e,max:n},editor:{rotateable:!1,middlePoint:{}},tree:{type:"design"}}),p?.tree.add(g),p?.tree.add(v),v.zIndex=1e4,p&&(p.on(f_.ZOOM,()=>{Rt()}),p.on(s_.TAP,bt),p.editor.on(Tw.SELECT,wt),p.on(s_.DOWN,_t),p.on(s_.MOVE,mt),p.on(s_.UP,yt))})(),U(),j=new wS(100),window.addEventListener("keydown",it),window.addEventListener("mousemove",et),window.addEventListener("focusout",rt);const t=function(t,e,n){var i=void 0===n?{}:n,r=i.event,o=void 0===r?"keydown":r,s=i.capture,a=AS(e,{timeout:i.timeout});return t.addEventListener(o,a,s),function(){t.removeEventListener(o,a,s)}}(window,{v:t=>{(m.value||y.value)&&(t.preventDefault(),st())},p:t=>{(m.value||y.value)&&(t.preventDefault(),at())},b:t=>{B.value&&(m.value||y.value)&&(t.preventDefault(),lt())},e:t=>{B.value&&(m.value||y.value)&&(t.preventDefault(),ut())},"$mod+KeyZ":t=>{(m.value||y.value)&&(t.preventDefault(),t.stopPropagation(),Et())},"$mod+KeyY":t=>{(m.value||y.value)&&(t.preventDefault(),t.stopPropagation(),Ot())},Delete:t=>{(m.value||y.value)&&(t.preventDefault(),t.stopPropagation(),St())},"$mod+Equal":t=>{(m.value||y.value)&&(t.preventDefault(),t.stopPropagation(),Tt())},"$mod+Minus":t=>{(m.value||y.value)&&(t.preventDefault(),t.stopPropagation(),Pt())},"$mod+0":t=>{(m.value||y.value)&&(t.preventDefault(),t.stopPropagation(),Bt())},Alt:t=>{(m.value||y.value)&&(t.preventDefault(),b.value=!b.value)}});window.__pointAnnotationHotkeysUnsubscribe=t})});const et=t=>{_.value={x:t.clientX,y:t.clientY}},nt=()=>{if(!(p&&f&&l.value&&h.value))return;const t=p.width,e=p.height,n=l.value,i=h.value,r=t/n,o=e/i,s=Math.min(r,o,1),a=(t-n*Number(s.toFixed(2)))/2,c=(e-i*Number(s.toFixed(2)))/2;p.tree.scale=Number(s.toFixed(2)),p.tree.x=a,p.tree.y=c,Rt()},it=t=>{if("Space"===t.code&&(()=>{if(!o.value)return!1;const t=o.value.getBoundingClientRect();return _.value.x>=t.left&&_.value.x<=t.right&&_.value.y>=t.top&&_.value.y<=t.bottom})())return t.preventDefault(),!1},rt=t=>{const e=t.target;e instanceof HTMLElement&&"leafer-text-editor"===e.classList[0]&&p?.editor.cancel()},ot=t=>{v&&v.children&&v.children.forEach(e=>{"point-annotation"===e._element_tag&&e.label&&(e.label.editable=t)})};Jn(()=>{f&&(p?.tree.remove(f),f=null),p?.destroy(),p=null,window.removeEventListener("keydown",it),window.removeEventListener("mousemove",et),window.removeEventListener("focusout",rt),window.__pointAnnotationHotkeysUnsubscribe&&(window.__pointAnnotationHotkeysUnsubscribe(),delete window.__pointAnnotationHotkeysUnsubscribe)});const st=()=>{w.value="select",k.value=!1,p&&(p.editor.config.moveable=!1,p.editor.config.resizeable=!1,p.editor.config.multipleSelect=!0,Object.values(I.value).forEach(t=>t.setPointerEvents(!1)),ot(!1))},at=()=>{w.value="point",k.value=!1,p&&(p.editor.config.moveable=!0,p.editor.config.multipleSelect=!1,Object.values(I.value).forEach(t=>t.setPointerEvents(!1)),ot(!1))},lt=t=>{if(!B.value)return;if(w.value="brush",!p)return;p.editor.config.moveable=!1,p.editor.config.resizeable=!1,p.editor.config.multipleSelect=!1,Object.entries(I.value).forEach(([t,e])=>{e.setPointerEvents(t===W.value)}),ot(!1);const e=void 0!==t?t:!k.value;k.value=e,e&&je(()=>{S.value&&(C.value=S.value.getBoundingClientRect())})},ht=()=>{k.value=!1},ct=t=>{B.value&&Object.assign(M.value,t)},ut=()=>{B.value&&(w.value="eraser",k.value=!1,p&&(p.editor.config.moveable=!1,p.editor.config.resizeable=!1,p.editor.config.multipleSelect=!1,Object.entries(I.value).forEach(([t,e])=>{e.setPointerEvents(t===W.value)}),ot(!1)))},dt=()=>{l.value&&h.value&&p&&(Object.values(I.value).forEach(t=>{t.getGroup().remove()}),I.value={},B.value&&(D.value.forEach(t=>{const e={color:t.color||M.value.color,opacity:void 0!==t.opacity?t.opacity:M.value.opacity,size:t.size||M.value.size,minSize:M.value.minSize,maxSize:M.value.maxSize,continuity:M.value.continuity},n=new ck(l.value,h.value,e);g.add(n.getGroup()),I.value[t.value]=n}),F.value||(F.value=D.value[0]?.value||oO),pt()))},pt=()=>{Object.values(I.value).forEach(t=>{const e=t.getGroup();e&&(e.visible=!0)})},ft=dt;let gt=null,vt=null;const _t=t=>{if("brush"!==w.value&&"eraser"!==w.value)return;if(!p||!f||!z.value)return;N.value=!0,vt=W.value,j&&(gt=z.value.getImageData());const e=g.getBoxPoint({x:t.x,y:t.y});"eraser"===w.value?z.value.erase(e.x,e.y,M.value.size,M.value.continuity):z.value.draw(e.x,e.y,M.value.size,M.value.color,M.value.opacity,M.value.continuity),z.value.getCanvas().paint()},mt=t=>{if(!N.value||!z.value||!f)return;const e=g.getBoxPoint({x:t.x,y:t.y});"eraser"===w.value?z.value.erase(e.x,e.y,M.value.size,M.value.continuity):z.value.draw(e.x,e.y,M.value.size,M.value.color,M.value.opacity,M.value.continuity),z.value.getCanvas().paint()},yt=()=>{if(N.value=!1,j&&vt&&I.value[vt]&>){const t=new kS(I.value[vt],gt);j.executeCommand(t),gt=null,vt=null}z.value?.resetLastPoint()},bt=t=>{if("point"!==w.value||!p||!f)return;if(p.editor&&p.editor.list&&p.editor.list.length>0)return;let e=t.target;for(;e;){if("point-annotation"===e._element_tag)return;e=e.parent}const n=g.getBoxPoint({x:t.x,y:t.y});n.x<0||n.x>(l.value||0)||n.y<0||n.y>(h.value||0)||xt(n.x,n.y)},wt=t=>{if("brush"===w.value||"eraser"===w.value||!p||!f)return;const e=new Set;(Array.isArray(t.value)?t.value:t.value?[t.value]:[]).forEach(t=>{t.data?.id&&e.add(t.data.id)}),v.children.forEach(t=>{if("point-annotation"!==t._element_tag)return;const n=e.has(t.data?.id);t.handlePointAnnotationSelected?.(n)})},xt=(t,e)=>{if(!l.value||!h.value)return null;const n=`point_${O.value}`,i={id:n,order:O.value,sequenceNumber:E.value.length+1,pixel:{x:t,y:e},normalized:{x:t/l.value,y:e/h.value},createdAt:Date.now(),updatedAt:Date.now()},o=new hk(i,R.value);if("brush"!==w.value&&"eraser"!==w.value||(o.label.editable=!1),j){const t=new xS(v,o,E.value,i);j.executeCommand(t)}else v.add(o),E.value.push(i);return V(v),O.value++,r("pointChange",[...E.value]),p?.editor&&p.editor.select(o),n},St=()=>{if("brush"===w.value||"eraser"===w.value)return void Ct();if("select"===w.value){const t=p?.editor?.list||[];let e=!1;if(B.value&&(e=Object.values(I.value).some(t=>t?.hasContent?.())),0===t.length&&(E.value.length>0||e)){const t=B.value?"确定清除所有标注和笔刷绘制区域吗?":"确定清除所有标注吗?";return void(confirm(t)&&kt())}}if(!p?.editor)return;const t=p.editor.list;0!==t.length&&(t.forEach(t=>{if("point-annotation"===t._element_tag)if(j){const e=new SS(v,t,E.value);j.executeCommand(e)}else{v.remove(t),t.destroy();const e=E.value.findIndex(e=>e.id===t.data.id);e>-1&&E.value.splice(e,1)}}),p.editor.cancel(),Lt(),r("pointChange",[...E.value]))},kt=()=>{E.value.forEach(t=>{const e=v.children.find(e=>e.data?.id===t.id);e&&(v.remove(e),e.destroy())}),E.value=[],B.value&&Object.values(I.value).forEach(t=>t.clear()),r("pointChange",[])},Ct=()=>{if(B.value&&z.value){if(j){const t=z.value.getImageData(),e=new kS(z.value,t,!0);j.executeCommand(e)}z.value.clear(),z.value.getCanvas().paint()}},Et=()=>{j?.canUndo()&&(j.undo(),Lt(),r("pointChange",[...E.value]))},Ot=()=>{j?.canRedo()&&(j.redo(),Lt(),r("pointChange",[...E.value]))},Lt=()=>{E.value.forEach((t,e)=>{t.sequenceNumber=e+1}),E.value.forEach((t,e)=>{const n=v.children.find(e=>e.data?.id===t.id);n?.updateSequenceNumber&&n.updateSequenceNumber(e+1)})},Pt=()=>{p&&(p.tree.zoom("out"),Rt())},Tt=()=>{p&&(p.tree.zoom("in"),Rt())},Bt=()=>{p&&(p.tree.zoom(1),Rt())},Rt=()=>{p&&p.tree&&void 0!==p.tree.scaleX&&(x.value=Math.round(100*p.tree.scaleX),V(v))};return e({getPointAnnotations:()=>[...E.value],getImageInfo:()=>({id:c.value?"local-image":i.imageSource?.id||"",url:c.value?u.value:i.imageSource?.url||"",width:l.value,height:h.value}),exportCanvasJSON:()=>{const t={};Object.entries(I.value).forEach(([e,n])=>{const i=n.getImageData();i&&(t[e]=i)});const e={version:"1.0",imageUrl:c.value?u.value:i.imageSource?.url||"",imageWidth:l.value,imageHeight:h.value,pointAnnotations:[...E.value],brushLayers:t,brushMask:z.value?.getImageData()||null,exportTime:Date.now()};return JSON.stringify(e,null,2)},exportMaskImage:(t,e)=>B.value&&z.value?Z(z.value,t,e):Promise.resolve(null),exportMaskImageByLayer:(t,e,n)=>{if(!B.value)return Promise.resolve(null);const i=I.value[t];return i?Z(i,e,n):Promise.resolve(null)},exportAllMaskImages:(t,e)=>B.value?new Promise(async n=>{const i={};for(const[r,o]of Object.entries(I.value)){const n=await Z(o,t,e);n&&(i[r]=n)}n(i)}):Promise.resolve({}),getMaskBlob:tt,getMaskFile:(t,e,n,i)=>B.value?new Promise(async r=>{const o=await tt(t,n,i);if(!o)return r(null);const s="jpeg"===n||"jpg"===n?"image/jpeg":"image/png",a="jpeg"===n||"jpg"===n?"jpg":"png",l=e||`mask_${t||"current"}_${Date.now()}.${a}`;try{r(new File([o],l,{type:s}))}catch(kE){const e=o;e.name=l,e.type=s,r(e)}}):Promise.resolve(null),getAllMaskBlobs:(t,e)=>B.value?new Promise(async n=>{const i={};for(const[r,o]of Object.entries(I.value)){const n=await q(o,t,e);if(!n)continue;const s=await Q(n.canvas,n.mime);s&&(i[r]=s)}n(i)}):Promise.resolve({}),exportCOCO:()=>{const t=function(t,e,n,i,r){const o=r?.imageId||1,s=r?.categoryName||"point";return{info:{year:(new Date).getFullYear(),version:"1.0",contributor:"leafer-point-annotation",date_created:(new Date).toISOString().split("T")[0]},images:[{id:o,file_name:(t=>{try{return new URL(t).pathname.split("/").pop()||"image.jpg"}catch{return"image.jpg"}})(e),width:n,height:i}],annotations:t.map((t,e)=>({id:e+1,image_id:o,category_id:1,keypoints:[t.pixel.x,t.pixel.y,2],num_keypoints:1,iscrowd:0})),categories:[{id:1,name:s,supercategory:"annotation",keypoints:["point"],skeleton:[]}]}}(E.value,c.value?u.value:i.imageSource?.url||"",l.value||0,h.value||0);return JSON.stringify(t,null,2)},exportYOLO:()=>{const t=function(t,e,n,i){const r=i?.className||"point",o=i?.pointSize||20;return{annotations:t.map(t=>{const i=t.normalized.x,r=t.normalized.y,s=o/e,a=o/n;return`0 ${i.toFixed(6)} ${r.toFixed(6)} ${s.toFixed(6)} ${a.toFixed(6)}`}).join("\n"),classNames:r,imageWidth:e,imageHeight:n}}(E.value,l.value||0,h.value||0);return{annotations:t.annotations,classNames:t.classNames}},importCanvasJSON:async(t,e)=>{try{const n=JSON.parse(t);if(e?.resetZoom&&(Bt(),nt()),E.value.forEach(t=>{const e=v.findOne(`#${t.id}`);e&&(v.remove(e),e.destroy())}),E.value=[],Object.values(I.value).forEach(t=>t.clear()),n.imageUrl&&n.imageUrl!==i.imageSource.url&&await U(n.imageUrl),n.pointAnnotations&&Array.isArray(n.pointAnnotations))for(const t of n.pointAnnotations){const e=new hk(t,R.value);"brush"!==w.value&&"eraser"!==w.value||(e.label.editable=!1),v.add(e),E.value.push(t)}return n.brushLayers&&"object"==typeof n.brushLayers?Object.entries(n.brushLayers).forEach(([t,e])=>{const n=I.value[t];n&&e&&n.restoreImageData(e)}):n.brushMask&&z.value&&z.value.restoreImageData(n.brushMask),Lt(),V(v),!0}catch(n){return!1}},loadImage:U,clearBrush:Ct,clearAllBrushLayers:()=>{B.value&&Object.entries(I.value).forEach(([t,e])=>{if(j){const t=new kS(e,e.getImageData(),!0);j.executeCommand(t)}e.clear(),e.getCanvas().paint()})},clearAllAnnotationsAndBrush:kt,zoomIn:Tt,zoomOut:Pt,resetZoom:Bt,undo:Et,redo:Ot,getCurrentTool:()=>w.value,setTool:t=>{(B.value||"brush"!==t&&"eraser"!==t)&&(w.value=t)},selectTool:st,pointTool:at,brushTool:lt,eraserTool:ut,deleteSelected:St,getCurrentLayer:()=>W.value,setActiveLayer:t=>{D.value.some(e=>e.value===t)&&(F.value=t,i.currentLayer||(r("update:currentLayer",t),r("layerChange",t)))},getAllLayers:()=>[...D.value],createPointAnnotation:xt,removePointAnnotation:t=>{const e=E.value.findIndex(e=>e.id===t);if(-1===e)return!1;const n=v.children[e];if(!n)return!1;if(j){const t=new SS(v,n,E.value);j.executeCommand(t)}else v.remove(n),n.destroy(),E.value.splice(e,1);return Lt(),r("pointChange",[...E.value]),!0},updatePointAnnotationLabel:(t,e)=>{const n=v.children.find(e=>e.data?.id===t);return!!n&&(n.updateLabel&&n.updateLabel(e),r("pointChange",[...E.value]),!0)},createBrushFromPoints:()=>{if(!B.value)return!1;const t=z.value;if(!t)return!1;const e=[...E.value];if(e.length<3)return!1;e.sort((t,e)=>t.sequenceNumber-e.sequenceNumber);const n=e.map(t=>({x:t.pixel.x,y:t.pixel.y})),i=t.getImageData();if(t.fillPolygon(n,M.value.color),j){const e=new kS(t,i);j.executeCommand(e)}return!0},getBrushStyle:()=>({...M.value}),updateBrushStyle:ct}),(t,e)=>(fr(),mr(lr,null,[kr("div",{class:H(["point-annotation",{"has-image":L.value&&P.value}]),onFocus:e[2]||(e[2]=t=>m.value=!0),onBlur:e[3]||(e[3]=t=>m.value=!1),onMouseenter:e[4]||(e[4]=t=>y.value=!0),onMouseleave:e[5]||(e[5]=t=>y.value=!1)},[kr("div",{ref_key:"canvasContainer",ref:o,class:"canvas-container",tabindex:"0",onDragover:G,onDragleave:$,onDrop:K},["loading"===a.value?(fr(),mr("div",YE,[...e[6]||(e[6]=[kr("div",{class:"gradient-animation"},null,-1),kr("div",{class:"loading-text"},"图片加载中",-1)])])):Pr("",!0),"idle"===a.value?(fr(),mr("div",{key:1,class:H(["upload-overlay",{"drag-over":d.value}])},[kr("input",{ref_key:"fileInputRef",ref:s,type:"file",accept:"image/*",style:{display:"none"},onChange:Y},null,544),e[7]||(e[7]=Lr('<div class="upload-icon" data-v-bbf6bd6d><svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" data-v-bbf6bd6d><rect x="3" y="3" width="18" height="18" rx="2" ry="2" data-v-bbf6bd6d></rect><circle cx="8.5" cy="8.5" r="1.5" data-v-bbf6bd6d></circle><polyline points="21 15 16 10 5 21" data-v-bbf6bd6d></polyline></svg></div><p class="upload-text" data-v-bbf6bd6d>点击选择本地图片</p><p class="upload-hint" data-v-bbf6bd6d>或拖拽图片到此处</p>',3)),kr("button",{class:"upload-button",onClick:X},"选择图片")],2)):Pr("",!0),"error"===a.value?(fr(),mr("div",XE,[e[8]||(e[8]=kr("p",null,"加载失败",-1)),kr("button",{onClick:e[0]||(e[0]=t=>U())},"重试")])):Pr("",!0),T.value?(fr(),mr("div",GE,[kr("button",{class:"zoom-button",title:"缩小 (Ctrl+-)",onClick:Pt},[e[9]||(e[9]=kr("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[kr("line",{x1:"5",y1:"12",x2:"19",y2:"12"})],-1)),b.value?(fr(),mr("span",$E,"Ctrl+-")):Pr("",!0)]),kr("div",{class:"zoom-value",onClick:Bt,title:"点击重置为100% (Ctrl+0)"},[Or(J(x.value)+"% ",1),b.value?(fr(),mr("span",KE,"Ctrl+0")):Pr("",!0)]),kr("button",{class:"zoom-button",title:"放大 (Ctrl++)",onClick:Tt},[e[10]||(e[10]=kr("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[kr("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),kr("line",{x1:"5",y1:"12",x2:"19",y2:"12"})],-1)),b.value?(fr(),mr("span",qE,"Ctrl++")):Pr("",!0)])])):Pr("",!0)],544),P.value?(fr(),mr("div",ZE,[kr("button",{class:H(["tool-button",{active:"select"===w.value}]),title:"选择工具 (V)",onClick:st},[e[11]||(e[11]=kr("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"lucide lucide-mouse-pointer2-icon lucide-mouse-pointer-2"},[kr("path",{d:"M4.037 4.688a.495.495 0 0 1 .651-.651l16 6.5a.5.5 0 0 1-.063.947l-6.124 1.58a2 2 0 0 0-1.438 1.435l-1.579 6.126a.5.5 0 0 1-.947.063z"})],-1)),b.value?(fr(),mr("span",JE,"V")):Pr("",!0)],2),kr("button",{class:H(["tool-button",{active:"point"===w.value}]),title:"点标注工具 (P)",onClick:at},[e[12]||(e[12]=kr("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[kr("circle",{cx:"12",cy:"12",r:"10"}),kr("circle",{cx:"12",cy:"12",r:"3"})],-1)),b.value?(fr(),mr("span",QE,"P")):Pr("",!0)],2),B.value?(fr(),mr(lr,{key:0},[kr("button",{class:H(["tool-button",{active:"brush"===w.value}]),title:"笔刷工具 (B)",onClick:e[1]||(e[1]=t=>lt()),ref_key:"brushButtonRef",ref:S},[e[13]||(e[13]=kr("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[kr("path",{d:"M9.06 11.9l8.07-8.06a2.85 2.85 0 1 1 4.03 4.03l-8.06 8.08"}),kr("path",{d:"M7.07 14.94c-1.66 0-3 1.35-3 3.02 0 1.33-2.5 1.52-2 2.02 1.08 1.1 2.49 2.02 4 2.02 2.2 0 4-1.8 4-4.04a3.01 3.01 0 0 0-3-3.02z"})],-1)),b.value?(fr(),mr("span",tO,"B")):Pr("",!0)],2),kr("button",{class:H(["tool-button",{active:"eraser"===w.value}]),title:"橡皮擦工具 (E)",onClick:ut},[e[14]||(e[14]=kr("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[kr("path",{d:"M20 20H7L3 16C2.4 15.4 2.4 14.4 3 13.8L13.8 3C14.4 2.4 15.4 2.4 16 3L21 8C21.6 8.6 21.6 9.6 21 10.2L10.2 21C9.6 21.6 8.6 21.6 8 21L3 16"})],-1)),b.value?(fr(),mr("span",eO,"E")):Pr("",!0)],2)],64)):Pr("",!0),kr("button",{class:"tool-button",title:"撤销 (Ctrl+Z)",onClick:Et},[e[15]||(e[15]=kr("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[kr("path",{d:"M3 7v6h6"}),kr("path",{d:"M21 17a9 9 0 0 0-9-9 9 9 0 0 0-6 2.3L3 13"})],-1)),b.value?(fr(),mr("span",nO,"Ctrl+Z")):Pr("",!0)]),kr("button",{class:"tool-button",title:"重做 (Ctrl+Y)",onClick:Ot},[e[16]||(e[16]=kr("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[kr("path",{d:"M21 7v6h-6"}),kr("path",{d:"M3 17a9 9 0 0 1 9-9 9 9 0 0 1 6 2.3l3 2.7"})],-1)),b.value?(fr(),mr("span",iO,"Ctrl+Y")):Pr("",!0)]),kr("button",{class:"tool-button",title:"删除 (Delete)",onClick:St},[e[17]||(e[17]=kr("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[kr("path",{d:"M3 6h18"}),kr("path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6"}),kr("path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2"})],-1)),b.value?(fr(),mr("span",rO,"Del")):Pr("",!0)])])):Pr("",!0)],34),B.value?(fr(),yr(UE,{key:0,visible:k.value,"brush-style":M.value,"button-rect":C.value,onClose:ht,onUpdate:ct},null,8,["visible","brush-style","button-rect"])):Pr("",!0)],64))}}),aO=HE(sO,[["__scopeId","data-v-bbf6bd6d"]]),lO={class:"app"},hO={class:"editor-container"},cO={class:"controls"},uO={class:"control-group"},dO={class:"control-group"},pO={class:"multi-layer-row"},fO={class:"layer-info"},gO={key:0,class:"multi-layer-row"},vO=["value"],_O={class:"control-group"},mO={class:"control-group"},yO={class:"multi-layer-row"},bO={class:"multi-layer-row"},wO={class:"multi-layer-row"},xO={class:"multi-layer-row"},SO={class:"control-group"},kO={class:"mask-options"},CO={class:"control-group"},EO={class:"multi-layer-row"},OO={class:"multi-layer-row"},LO=["value"],PO={class:"multi-layer-row"},TO=["value"],BO={class:"multi-layer-row"},RO=["value"],AO={class:"multi-layer-row"},MO={class:"control-group"},DO={class:"multi-layer-row"},IO={class:"multi-layer-row"},FO={key:0,class:"upload-log"},WO={class:"control-group"},zO={key:0,class:"subtle"},NO={key:1,class:"point-list"},jO={class:"point-num"},VO=["value","onInput"],HO={class:"point-id"},UO={class:"control-group"},YO={class:"multi-layer-row"},XO={key:0,class:"control-group"},GO={class:"multi-layer-row"},$O=["value"],KO={class:"control-group"},qO={class:"api-row"},ZO={class:"api-row"},JO={class:"output"},QO={class:"status"},tL={key:0},eL=An({__name:"App",setup(t){const e=be(""),n=qr(()=>{if(e.value)return{id:"test-image",url:e.value}}),i=be(!1),r=[{label:"前景区域",value:"foreground"},{label:"背景区域",value:"background"},{label:"忽略区域",value:"ignore"}],o=be("foreground"),s=be("foreground");rn(i,t=>{t&&(o.value=r[0].value,s.value=r[0].value)});const a={pointStyle:{circleFill:"#00f",circleStroke:"#fff",selectedCircleFill:"#f00",selectedCircleStroke:"#fff"},brushStyle:{color:"#ff4d4f",opacity:.55,size:100}},l=be(!1),h=be(!0),c=be("#f6f6f6"),u=be(.2),d=be(4),p=be(!0),f=qr(()=>i.value?{...a,brushLayers:r,maxBrushLayers:8,showToolbar:l.value,showZoomController:h.value,canvasBackground:c.value,zoomMin:u.value,zoomMax:d.value,enableBrush:p.value}:{...a,showToolbar:l.value,showZoomController:h.value,canvasBackground:c.value,zoomMin:u.value,zoomMax:d.value,enableBrush:p.value}),g=be("idle"),v=be(""),_=be(null),m=be([]),y=be("png"),b=be("black"),w=be("https://your-api.com/upload"),x=be("file"),S=be(""),k=be("select"),C=be("select"),E=be(null),O=be(0);setInterval(()=>{O.value++},500);const L=qr(()=>(O.value,_.value?.getBrushStyle?.()||{color:"#ff4d4f",opacity:.55,size:100,continuity:20,minSize:5,maxSize:300})),P=qr(()=>L.value.size),T=qr(()=>L.value.opacity),B=qr(()=>L.value.continuity),R=qr(()=>(O.value,_.value?.getCurrentTool?.()||"select")),A=()=>{const t=_.value?.getBrushStyle?.();alert("Brush style logged to console:\n"+JSON.stringify(t,null,2))},M=t=>{},D=t=>{v.value=JSON.stringify(t,null,2),m.value=Array.isArray(t)?[...t]:[]},I=()=>{!1===_.value?.createBrushFromPoints()&&alert("请先在画布上添加至少 3 个标注点")},F=async()=>{const t=await(_.value?.getMaskFile(void 0,"mask.png"));if(t)if(w.value)try{const e=new FormData;e.append(x.value||"file",t),S.value=`⏳ 正在上传 ${t.name} (${(t.size/1024).toFixed(1)} KB) 到 ${w.value}...`;const n=await fetch(w.value,{method:"POST",body:e}),i=await n.text();S.value=`✅ 上传完成,状态 ${n.status},响应: ${i.substring(0,300)}`}catch(ES){S.value=`❌ 上传失败: ${ES}`}else S.value="❌ 请先填写上传接口 URL";else S.value="❌ 当前图层没有可导出的 mask,先在画布上画几笔或标注"},W=async()=>{const t=await(_.value?.getAllMaskBlobs());if(t&&0!==Object.keys(t).length)if(w.value)try{const e=new FormData;let n=0;for(const[o,s]of Object.entries(t)){const t=`mask_${o}.png`,i=new File([s],t,{type:"image/png"});e.append(x.value||"file",i),n+=s.size}S.value=`⏳ 正在上传 ${Object.keys(t).length} 个文件 (共 ${(n/1024).toFixed(1)} KB) 到 ${w.value}...`;const i=await fetch(w.value,{method:"POST",body:e}),r=await i.text();S.value=`✅ 上传完成,状态 ${i.status},响应: ${r.substring(0,300)}`}catch(ES){S.value=`❌ 上传失败: ${ES}`}else S.value="❌ 请先填写上传接口 URL";else S.value="❌ 没有可导出的 mask"},z=()=>{g.value="loading"},N=()=>{g.value="success"},j=t=>{g.value="error"},V=()=>{_.value&&_.value.loadImage()},U=()=>{if(_.value){const t=_.value.getPointAnnotations(),e=JSON.stringify(t,null,2),n=new Blob([e],{type:"application/json"}),i=URL.createObjectURL(n),r=document.createElement("a");r.href=i,r.download="point-data.json",r.click(),URL.revokeObjectURL(i)}},Y=()=>{if(_.value){const t=_.value.getPointAnnotations();v.value=JSON.stringify(t,null,2)}},X=()=>{if(_.value){const t=_.value.exportCanvasJSON(),e=new Blob([t],{type:"application/json"}),n=URL.createObjectURL(e),i=document.createElement("a");i.href=n,i.download="canvas-data.json",i.click(),URL.revokeObjectURL(n)}},G=be(null),$=()=>{G.value?.click()},K=async t=>{const e=t.target,n=e.files?.[0];if(n){const t=new FileReader;t.onload=async t=>{const e=t.target?.result;_.value&&(await _.value.importCanvasJSON(e,{resetZoom:!0})?alert("Canvas imported successfully!"):alert("Failed to import canvas."))},t.readAsText(n)}e.value=""},q=async()=>{if(_.value){const t=await _.value.exportMaskImage(y.value,b.value);if(t){const e="png"===y.value?"png":"jpg",n=document.createElement("a");n.href=t,n.download=`brush-mask.${e}`,n.click()}else alert("No brush data to export.")}},Z=()=>{if(_.value){const t=_.value.exportCOCO(),e=new Blob([t],{type:"application/json"}),n=URL.createObjectURL(e),i=document.createElement("a");i.href=n,i.download="annotation-coco.json",i.click(),URL.revokeObjectURL(n)}},Q=()=>{if(_.value){const t=_.value.exportYOLO(),e=new Blob([t.annotations],{type:"text/plain"}),n=URL.createObjectURL(e),i=document.createElement("a");i.href=n,i.download="annotation-yolo.txt",i.click(),URL.revokeObjectURL(n);const r=new Blob([t.classNames],{type:"text/plain"}),o=URL.createObjectURL(r),s=document.createElement("a");s.href=o,s.download="class-names.txt",s.click(),URL.revokeObjectURL(o)}},tt=()=>{_.value&&(_.value.clearBrush?.(),alert("Brush cleared!"))},et=()=>{_.value&&_.value.undo()},nt=()=>{_.value&&_.value.redo()},it=()=>{_.value&&(_.value.setTool(k.value),C.value=k.value)},rt=()=>{if(_.value){const t=_.value.createPointAnnotation(100,100);t&&(E.value=t,alert(`Point added with id: ${t}`))}},ot=()=>{if(_.value&&E.value)_.value.removePointAnnotation(E.value)&&(E.value=null,alert("Point removed"));else{const t=_.value?.getPointAnnotations();if(t&&t.length>0){const e=t[t.length-1];_.value?.removePointAnnotation(e.id)&&alert("Last point removed")}else alert("No points to remove")}},st=()=>{if(!_.value)return;const t=_.value.getAllLayers?.();alert("Layers printed to console: "+JSON.stringify(t,null,2))},at=()=>{if(!_.value)return;const t=_.value.getCurrentLayer?.();alert("Current layer: "+t)},lt=()=>{_.value&&(_.value.clearAllBrushLayers?.(),alert("All brush layers cleared!"))},ht=async()=>{if(!_.value)return;const t=await(_.value.exportMaskImageByLayer?.(s.value,y.value,b.value));if(t){const e="png"===y.value?"png":"jpg",n=document.createElement("a");n.href=t,n.download=`brush-mask-${s.value}.${e}`,n.click()}else alert(`No brush data on layer "${s.value}"`)},ct=async()=>{if(!_.value)return;const t=await(_.value.exportAllMaskImages?.(y.value,b.value));if(!t||0===Object.keys(t).length)return void alert("No brush data on any layer");const e="png"===y.value?"png":"jpg";Object.entries(t).forEach(([t,n],i)=>{setTimeout(()=>{const i=document.createElement("a");i.href=n,i.download=`brush-mask-${t}.${e}`,i.click()},300*i)}),alert(`Started downloading ${Object.keys(t).length} mask images`)};return(t,a)=>(fr(),mr("div",lO,[a[76]||(a[76]=kr("h1",null,"LeaferJS Point Annotation Test",-1)),kr("div",hO,[Cr(aO,{ref_key:"pointAnnotation",ref:_,imageSource:n.value,options:f.value,currentLayer:o.value,"onUpdate:currentLayer":[a[0]||(a[0]=t=>o.value=t),M],onPointChange:D,onLoadStart:z,onLoadSuccess:N,onLoadError:j},null,8,["imageSource","options","currentLayer"])]),kr("div",cO,[a[72]||(a[72]=kr("h2",null,"Controls",-1)),kr("div",uO,[a[36]||(a[36]=kr("label",{for:"imageUrl"},"Image URL:",-1)),Je(kr("input",{type:"text",id:"imageUrl","onUpdate:modelValue":a[1]||(a[1]=t=>e.value=t),placeholder:"Enter image URL (or leave empty for local upload)"},null,512),[[$o,e.value]])]),kr("div",dO,[a[40]||(a[40]=kr("h3",null,"Multi-Layer Mode",-1)),kr("div",pO,[kr("label",null,[Je(kr("input",{type:"checkbox","onUpdate:modelValue":a[2]||(a[2]=t=>i.value=t)},null,512),[[Ko,i.value]]),a[37]||(a[37]=Or(" Enable multi-layer brush ",-1))]),kr("span",fO,[a[38]||(a[38]=Or("Active layer: ",-1)),kr("b",null,J(o.value),1)])]),i.value?(fr(),mr("div",gO,[a[39]||(a[39]=kr("label",null,"Switch layer (parent-driven):",-1)),Je(kr("select",{"onUpdate:modelValue":a[3]||(a[3]=t=>o.value=t)},[(fr(),mr(lr,null,ai(r,t=>kr("option",{key:t.value,value:t.value},J(t.label)+" ("+J(t.value)+")",9,vO)),64))],512),[[Zo,o.value]]),kr("button",{onClick:st},"Log All Layers"),kr("button",{onClick:at},"Log Current Layer")])):Pr("",!0)]),kr("div",{class:"control-group"},[kr("button",{onClick:Y},"Get Point Data"),kr("button",{onClick:U},"Export Point Data"),kr("button",{onClick:V},"Refresh Image")]),kr("div",_O,[a[41]||(a[41]=kr("h3",null,"Canvas Export/Import",-1)),kr("button",{onClick:X},"Export Canvas JSON"),kr("input",{type:"file",ref_key:"fileInput",ref:G,style:{display:"none"},accept:".json",onChange:K},null,544),kr("button",{onClick:$},"Import Canvas JSON")]),kr("div",mO,[a[48]||(a[48]=kr("h3",null,"Custom Toolbar (via ref)",-1)),a[49]||(a[49]=kr("p",{class:"subtle"},"隐藏组件自带工具栏后,父组件自定义按钮调用 API 替代",-1)),kr("div",yO,[kr("label",null,[Je(kr("input",{type:"checkbox","onUpdate:modelValue":a[4]||(a[4]=t=>l.value=t)},null,512),[[Ko,l.value]]),a[42]||(a[42]=Or(" 显示组件工具栏",-1))]),kr("label",null,[Je(kr("input",{type:"checkbox","onUpdate:modelValue":a[5]||(a[5]=t=>h.value=t)},null,512),[[Ko,h.value]]),a[43]||(a[43]=Or(" 显示缩放控制器",-1))]),kr("label",null,[Je(kr("input",{type:"checkbox","onUpdate:modelValue":a[6]||(a[6]=t=>p.value=t)},null,512),[[Ko,p.value]]),a[44]||(a[44]=Or(" 启用笔刷功能",-1))])]),kr("div",bO,[kr("label",null,[a[45]||(a[45]=Or("背景色: ",-1)),Je(kr("input",{type:"color","onUpdate:modelValue":a[7]||(a[7]=t=>c.value=t),style:{width:"40px",height:"28px","vertical-align":"middle","margin-left":"6px"}},null,512),[[$o,c.value]])]),kr("label",null,[a[46]||(a[46]=Or("最小缩放: ",-1)),Je(kr("input",{type:"number","onUpdate:modelValue":a[8]||(a[8]=t=>u.value=t),step:"0.1",min:"0.01",max:"1",style:{width:"70px","margin-left":"6px"}},null,512),[[$o,u.value,void 0,{number:!0}]])]),kr("label",null,[a[47]||(a[47]=Or("最大缩放: ",-1)),Je(kr("input",{type:"number","onUpdate:modelValue":a[9]||(a[9]=t=>d.value=t),step:"0.5",min:"1",max:"32",style:{width:"70px","margin-left":"6px"}},null,512),[[$o,d.value,void 0,{number:!0}]])])]),a[50]||(a[50]=kr("p",{class:"subtle"},"注:画布背景色和缩放范围在图片加载时生效,修改后请重新加载图片",-1)),kr("div",wO,[kr("button",{class:H({"active-btn":"select"===R.value}),onClick:a[10]||(a[10]=t=>_.value?.selectTool())},"选择工具",2),kr("button",{class:H({"active-btn":"point"===R.value}),onClick:a[11]||(a[11]=t=>_.value?.pointTool())},"点标注工具",2),kr("button",{class:H({"active-btn":"brush"===R.value}),onClick:a[12]||(a[12]=t=>_.value?.brushTool(!1))},"笔刷工具",2),kr("button",{class:H({"active-btn":"eraser"===R.value}),onClick:a[13]||(a[13]=t=>_.value?.eraserTool())},"橡皮擦",2)]),kr("div",xO,[kr("button",{onClick:a[14]||(a[14]=t=>_.value?.undo())},"↶ 撤销"),kr("button",{onClick:a[15]||(a[15]=t=>_.value?.redo())},"↷ 重做"),kr("button",{onClick:a[16]||(a[16]=t=>_.value?.deleteSelected())},"🗑 删除当前"),kr("button",{onClick:a[17]||(a[17]=t=>_.value?.clearAllAnnotationsAndBrush())},"⚠ 清除全部")])]),kr("div",SO,[a[55]||(a[55]=kr("h3",null,"Brush Mask Export",-1)),kr("div",kO,[kr("label",null,[a[52]||(a[52]=Or(" Format: ",-1)),Je(kr("select",{"onUpdate:modelValue":a[18]||(a[18]=t=>y.value=t)},[...a[51]||(a[51]=[kr("option",{value:"png"},"PNG",-1),kr("option",{value:"jpeg"},"JPEG",-1)])],512),[[Zo,y.value]])]),kr("label",null,[a[54]||(a[54]=Or(" Foreground: ",-1)),Je(kr("select",{"onUpdate:modelValue":a[19]||(a[19]=t=>b.value=t)},[...a[53]||(a[53]=[kr("option",{value:"black"},"Black",-1),kr("option",{value:"white"},"White",-1)])],512),[[Zo,b.value]])])]),kr("button",{onClick:q},"Export Current Layer Mask"),kr("button",{onClick:tt},"Clear Current Layer Brush"),i.value?(fr(),mr("button",{key:0,onClick:lt},"Clear ALL Layers")):Pr("",!0)]),kr("div",CO,[a[56]||(a[56]=kr("h3",null,"Brush Style (via ref API)",-1)),a[57]||(a[57]=kr("p",{class:"subtle"},"通过组件 ref 调用 updateBrushStyle / getBrushStyle,可单独修改任一字段",-1)),kr("div",EO,[kr("button",{onClick:a[20]||(a[20]=t=>_.value?.updateBrushStyle({color:"#ff4d4f"}))},"🟥 红色"),kr("button",{onClick:a[21]||(a[21]=t=>_.value?.updateBrushStyle({color:"#52c41a"}))},"🟩 绿色"),kr("button",{onClick:a[22]||(a[22]=t=>_.value?.updateBrushStyle({color:"#1890ff"}))},"🟦 蓝色"),kr("button",{onClick:a[23]||(a[23]=t=>_.value?.updateBrushStyle({color:"#faad14"}))},"🟨 黄色")]),kr("div",OO,[kr("label",null,"Size: "+J(P.value),1),kr("input",{type:"range",min:"5",max:"300",value:P.value,onInput:a[24]||(a[24]=t=>(t=>{const e=Number(t.target.value);_.value?.updateBrushStyle({size:e})})(t))},null,40,LO),kr("button",{onClick:a[25]||(a[25]=t=>_.value?.updateBrushStyle({size:100}))},"Reset Size")]),kr("div",PO,[kr("label",null,"Opacity: "+J(T.value),1),kr("input",{type:"range",min:"0.1",max:"1",step:"0.05",value:T.value,onInput:a[26]||(a[26]=t=>(t=>{const e=Number(t.target.value);_.value?.updateBrushStyle({opacity:e})})(t))},null,40,TO),kr("button",{onClick:a[27]||(a[27]=t=>_.value?.updateBrushStyle({opacity:.55}))},"Reset Opacity")]),kr("div",BO,[kr("label",null,"Continuity: "+J(B.value),1),kr("input",{type:"range",min:"5",max:"50",value:B.value,onInput:a[28]||(a[28]=t=>(t=>{const e=Number(t.target.value);_.value?.updateBrushStyle({continuity:e})})(t))},null,40,RO),kr("button",{onClick:a[29]||(a[29]=t=>_.value?.updateBrushStyle({continuity:20}))},"Reset Continuity")]),kr("div",AO,[kr("button",{onClick:A},"Log Current Brush Style"),kr("button",{onClick:a[30]||(a[30]=t=>_.value?.updateBrushStyle({color:"#ff4d4f",size:100,opacity:.55,continuity:20}))},"Restore All Defaults")])]),kr("div",MO,[a[60]||(a[60]=kr("h3",null,"Upload Mask as File to Backend API (via ref API)",-1)),a[61]||(a[61]=kr("p",{class:"subtle"},"直接拿 File 对象传给后端 form-data 上传接口,无需自己做 dataURL 转换",-1)),kr("div",DO,[a[58]||(a[58]=kr("label",null,"上传接口 URL:",-1)),Je(kr("input",{type:"text","onUpdate:modelValue":a[31]||(a[31]=t=>w.value=t),placeholder:"https://your-api.com/upload",style:{width:"280px"}},null,512),[[$o,w.value]])]),kr("div",IO,[a[59]||(a[59]=kr("label",null,"上传字段名:",-1)),Je(kr("input",{type:"text","onUpdate:modelValue":a[32]||(a[32]=t=>x.value=t),placeholder:"file",style:{width:"120px"}},null,512),[[$o,x.value]]),kr("button",{onClick:F},"📤 上传当前图层 mask 到后端"),kr("button",{onClick:W},"📦 上传所有图层 mask")]),S.value?(fr(),mr("div",FO,J(S.value),1)):Pr("",!0)]),kr("div",WO,[a[62]||(a[62]=kr("h3",null,"Point Label Editor (via ref API)",-1)),a[63]||(a[63]=kr("p",{class:"subtle"},"点标注后,父组件通过 updatePointAnnotationLabel(id, label) 修改标注点名称",-1)),0===m.value.length?(fr(),mr("div",zO,"暂无点标注,请在画布上点击添加")):(fr(),mr("div",NO,[(fr(!0),mr(lr,null,ai(m.value,t=>(fr(),mr("div",{key:t.id,class:"point-list-row"},[kr("span",jO,"#"+J(t.sequenceNumber),1),kr("input",{type:"text",class:"label-input",value:t.label||"",placeholder:"输入自定义名称",onInput:e=>{return n=t.id,i=e.target.value,void _.value?.updatePointAnnotationLabel(n,i);var n,i}},null,40,VO),kr("span",HO,J(t.id),1)]))),128))]))]),kr("div",UO,[a[64]||(a[64]=kr("h3",null,"Generate Brush From Points (via ref API)",-1)),a[65]||(a[65]=kr("p",{class:"subtle"},"根据标注点轨迹生成闭合多边形填充区域(需 ≥3 个点),使用当前笔刷颜色和透明度",-1)),kr("div",YO,[kr("button",{onClick:I},"🎨 一键生成笔刷区域"),kr("button",{onClick:a[33]||(a[33]=t=>_.value?.clearBrush())},"🧹 清除当前笔刷层")])]),i.value?(fr(),mr("div",XO,[a[67]||(a[67]=kr("h3",null,"Per-Layer Mask Export",-1)),kr("div",GO,[a[66]||(a[66]=kr("label",null,"Layer:",-1)),Je(kr("select",{"onUpdate:modelValue":a[34]||(a[34]=t=>s.value=t)},[(fr(),mr(lr,null,ai(r,t=>kr("option",{key:t.value,value:t.value},J(t.label)+" ("+J(t.value)+")",9,$O)),64))],512),[[Zo,s.value]]),kr("button",{onClick:ht},"Export This Layer Mask")]),kr("button",{onClick:ct},"Export ALL Layer Masks (zip by browser)")])):Pr("",!0),kr("div",{class:"control-group"},[a[68]||(a[68]=kr("h3",null,"Annotation Format Export",-1)),kr("button",{onClick:Z},"Export COCO JSON"),kr("button",{onClick:Q},"Export YOLO")]),kr("div",KO,[a[71]||(a[71]=kr("h3",null,"API Methods",-1)),kr("div",{class:"api-row"},[kr("button",{onClick:et},"Undo"),kr("button",{onClick:nt},"Redo")]),kr("div",qO,[a[70]||(a[70]=kr("label",null,"Tool:",-1)),Je(kr("select",{"onUpdate:modelValue":a[35]||(a[35]=t=>k.value=t)},[...a[69]||(a[69]=[kr("option",{value:"select"},"Select",-1),kr("option",{value:"point"},"Point",-1),kr("option",{value:"brush"},"Brush",-1),kr("option",{value:"eraser"},"Eraser",-1)])],512),[[Zo,k.value]]),kr("button",{onClick:it},"Set Tool")]),kr("div",{class:"api-row"},[kr("button",{onClick:rt},"Add Point (100,100)"),kr("button",{onClick:ot},"Remove Last Point")]),kr("div",ZO,[kr("span",null,"Current Tool: "+J(C.value),1)])])]),kr("div",JO,[a[73]||(a[73]=kr("h2",null,"Point Data",-1)),kr("pre",null,J(v.value),1)]),kr("div",QO,[a[75]||(a[75]=kr("h2",null,"Status",-1)),kr("p",null,"Image Load Status: "+J(g.value),1),kr("p",null,"Multi-Layer Mode: "+J(i.value?"ON":"OFF"),1),i.value?(fr(),mr("p",tL,[a[74]||(a[74]=Or("Active Layer (v-model:currentLayer): ",-1)),kr("b",null,J(o.value),1)])):Pr("",!0)])]))}});((...t)=>{const e=(es||(es=tr(as))).createApp(...t),{mount:n}=e;return e.mount=t=>{const i=function(t){return _(t)?document.querySelector(t):t}(t);if(!i)return;const r=e._component;v(r)||r.render||r.template||(r.template=i.innerHTML),1===i.nodeType&&(i.textContent="");const o=n(i,!1,function(t){if(t instanceof SVGElement)return"svg";if("function"==typeof MathMLElement&&t instanceof MathMLElement)return"mathml"}(i));return i instanceof Element&&(i.removeAttribute("v-cloak"),i.setAttribute("data-v-app","")),o},e})(HE(eL,[["__scopeId","data-v-374efae5"]])).mount("#app");
|