@zyzgroup/core-web 0.0.66 → 0.0.69
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/zyzgroup_core_web.iife.js +14 -14
- package/dist/zyzgroup_core_web.iife.js.map +1 -1
- package/dist/zyzgroup_core_web.js +1813 -1737
- package/dist/zyzgroup_core_web.js.map +1 -1
- package/dist/zyzgroup_core_web.umd.cjs +14 -14
- package/dist/zyzgroup_core_web.umd.cjs.map +1 -1
- package/package.json +1 -1
- package/types/math/Light3d.d.ts +22 -0
- package/types/math/Light3d.d.ts.map +1 -0
- package/types/math/Matrix.d.ts +12 -2
- package/types/math/Matrix.d.ts.map +1 -1
- package/types/math/Point.d.ts +3 -0
- package/types/math/Point.d.ts.map +1 -1
- package/types/math/Point3d.d.ts +6 -3
- package/types/math/Point3d.d.ts.map +1 -1
- package/types/math/Point3ds.d.ts +7 -3
- package/types/math/Point3ds.d.ts.map +1 -1
- package/types/shapes/index.d.ts +0 -3
- package/types/shapes/index.d.ts.map +1 -1
- package/types/theme.d.ts +2 -3
- package/types/theme.d.ts.map +1 -1
- package/types/shapes/ShapeLight.d.ts +0 -9
- package/types/shapes/ShapeLight.d.ts.map +0 -1
- package/types/shapes/ShapeTriangle.d.ts +0 -14
- package/types/shapes/ShapeTriangle.d.ts.map +0 -1
- package/types/shapes/ShapeTriangleLight.d.ts +0 -19
- package/types/shapes/ShapeTriangleLight.d.ts.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var ZYZGroupCoreWeb=function(p){"use strict";typeof process<"u"&&process.versions!=null&&process.versions.node!=null;function
|
|
1
|
+
var ZYZGroupCoreWeb=function(p){"use strict";typeof process<"u"&&process.versions!=null&&process.versions.node!=null;function Ts(s){this.message=s}Ts.prototype=new Error,Ts.prototype.name="InvalidCharacterError";const Cn=s=>{let t=null;switch(s){case"any-character":t=/[^]/;break;case"bin":t=/^(0b)?[0-1]+$/;break;case"oct":t=/^(0o)?[0-7]+$/i;break;case"hex":t=/^(0x)?[0-9a-fA-F]+$/i;break;case"int":t=/^[-+]?[0-9]+$/;break;case"number":t=/[-+]?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/gi;break;case"number-single":t=/[-+]?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/i;break;case"split":t=/\s*,\s*/gi;break;case"svg-segment":t=/([mlhvzaqtcs])([^mlhvzaqtcs]*)/gi;break;case"mobile-china":t=/^\+[1-9]{1}[0-9]{10}$/g;break;case"phone-number":t=/^[+]?[(]?[0-9]{3}[)]?[-\s.]?[0-9]{3}[-\s.]?[0-9]{4,6}$/gi;break;case"email":t=/^[A-Za-z0-9_!#$%&'*+/=?`{|}~^.-]+@[A-Za-z0-9._-]+$/gm;break;case"ip":t=/^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/;break;case"whitespace":t=/[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u2028\u2029\u202f\u205f\u3000]/g;break;case"commaSpaces":t=/[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*,[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*/;break;case"trim":t=/^\s+|\s+$/g;break;case"base64-data":t=/^\s*data:(?:[a-z]+\/[a-z0-9-+.]+(?:;[a-z-]+=[a-z0-9-]+)?)?(?:;base64)?,([a-z0-9!$&',()*+;=\-._~:@/?%\s]*?)\s*$/i;break;case"var-name":t=/^[a-zA-Z_$][a-zA-Z0-9_$]*$/;break;case"element-url":t=/^url\(['"]?(.+?)['"]?\)$/i;break;case"hex-color":t=/^#([0-9A-F]{3}|[0-9A-F]{4}|[0-9A-F]{6}|[0-9A-F]{8})$/i;break;case"color":t=/^\s*((#[a-f\d]{6})|(#[a-f\d]{3})|rgba?\(\s*([\d\.]+%?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+%?)?)\s*\)|hsba?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+(?:%?\s*,\s*[\d\.]+)?)%?\s*\)|hsla?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+(?:%?\s*,\s*[\d\.]+)?)%?\s*\))\s*$/i;break;case"bezier":t=/^(?:cubic-)?bezier\(([^,]+),([^,]+),([^,]+),([^\)]+)\)/;break;case"chinese-name":t=/^(?:[\u4e00-\u9fa5·]{2,16})$/;break;case"chinese":t=new RegExp(String.raw`
|
|
2
2
|
[\u{FA0E}\u{FA0F}\u{FA11}\u{FA13}\u{FA14}\u{FA1F}\u{FA21}\u{FA23}\u{FA24}\u{FA27}-\u{FA29}]
|
|
3
3
|
|[\u{4E00}-\u{9FCC}]
|
|
4
4
|
|[\u{3400}-\u{4DB5}]
|
|
@@ -7,40 +7,40 @@ var ZYZGroupCoreWeb=function(p){"use strict";typeof process<"u"&&process.version
|
|
|
7
7
|
|[\u{2B740}-\u{2B81D}]
|
|
8
8
|
|[\u{2B820}-\u{2CEAF}]
|
|
9
9
|
|[\u{2CEB0}-\u{2EBEF}]
|
|
10
|
-
`.replace(/\s+/g,""),"u");break;case"mime-image":t=/^image\//;break;case"mime-video":t=/^video\//;break;case"mime-audio":t=/^audio\//;break;case"mime-document-word":t=/^application\/(?:vnd\.openxmlformats-officedocument\.wordprocessingml\.document|msword|vnd\.ms-word\.document\.macroenabled\.12|vnd\.openxmlformats-officedocument\.wordprocessingml\.template|vnd\.ms-word\.template\.macroenabled\.12)$/;break;case"mime-document-excel":t=/^application\/(?:vnd\.openxmlformats-officedocument\.spreadsheetml\.sheet|vnd\.ms-excel|vnd\.ms-excel\.sheet\.macroenabled\.12|vnd\.openxmlformats-officedocument\.spreadsheetml\.template|vnd\.ms-excel\.template\.macroenabled\.12)$/;break;case"mime-document-ppt":t=/^application\/(?:vnd\.ms-powerpoint|vnd\.openxmlformats-officedocument\.presentationml\.presentation|vnd\.ms-powerpoint\.presentation\.macroenabled\.12|vnd\.openxmlformats-officedocument\.presentationml\.template|vnd\.ms-powerpoint\.template\.macroenabled\.12)$/;break;case"mime-document-json":t=/^application\/json$/;break;case"mime-document-xml":t=/^(?:application|text)\/(?:xml|xhtml\+xml)$/;break}return t},
|
|
11
|
-
`);n=~F?k.length-F:n+k.length}function r(){var k={line:e,column:n};return function(_){return _.position=new a(k),m(),_}}function a(k){this.start=k,this.end={line:e,column:n},this.source=t.source}a.prototype.content=s;var o=[];function c(k){var _=new Error(t.source+":"+e+":"+n+": "+k);if(_.reason=k,_.filename=t.source,_.line=e,_.column=n,_.source=s,t.silent)o.push(_);else throw _}function h(){var k=g();return{type:"stylesheet",stylesheet:{source:t.source,rules:k,parsingErrors:o}}}function l(){return w(/^{\s*/)}function f(){return w(/^}/)}function g(){var k,_=[];for(m(),v(_);s.length&&s.charAt(0)!="}"&&(k=U()||A());)k!==!1&&(_.push(k),v(_));return _}function w(k){var _=k.exec(s);if(_){var F=_[0];return i(F),s=s.slice(F.length),_}}function m(){w(/^\s*/)}function v(k){var _;for(k=k||[];_=b();)_!==!1&&k.push(_);return k}function b(){var k=r();if(!(s.charAt(0)!="/"||s.charAt(1)!="*")){for(var _=2;s.charAt(_)!=""&&(s.charAt(_)!="*"||s.charAt(_+1)!="/");)++_;if(_+=2,s.charAt(_-1)==="")return c("End of comment missing");var F=s.slice(2,_-2);return n+=2,i(F),s=s.slice(_),n+=2,k({type:"comment",comment:F})}}function S(){var k=w(/^([^{]+)/);if(k)return Lt(k[0]).replace(/\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*\/+/g,"").replace(/"(?:\\"|[^"])*"|'(?:\\'|[^'])*'/g,function(_){return _.replace(/,/g,"")}).split(/\s*(?![^(]*\)),\s*/).map(function(_){return _.replace(/\u200C/g,",")})}function C(){var k=r(),_=w(/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(_){if(_=Lt(_[0]),!w(/^:\s*/))return c("property missing ':'");var F=w(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/),G=k({type:"declaration",property:_.replace(Os,""),value:F?Lt(F[0]).replace(Os,""):""});return w(/^[;\s]*/),G}}function M(){var k=[];if(!l())return c("missing '{'");v(k);for(var _;_=C();)_!==!1&&(k.push(_),v(k));return f()?k:c("missing '}'")}function R(){for(var k,_=[],F=r();k=w(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/);)_.push(k[1]),w(/^,\s*/);if(_.length)return F({type:"keyframe",values:_,declarations:M()})}function B(){var k=r(),_=w(/^@([-\w]+)?keyframes\s*/);if(_){var F=_[1];if(_=w(/^([-\w]+)\s*/),!_)return c("@keyframes missing name");var G=_[1];if(!l())return c("@keyframes missing '{'");for(var St,qt=v();St=R();)qt.push(St),qt=qt.concat(v());return f()?k({type:"keyframes",name:G,vendor:F,keyframes:qt}):c("@keyframes missing '}'")}}function N(){var k=r(),_=w(/^@supports *([^{]+)/);if(_){var F=Lt(_[1]);if(!l())return c("@supports missing '{'");var G=v().concat(g());return f()?k({type:"supports",supports:F,rules:G}):c("@supports missing '}'")}}function W(){var k=r(),_=w(/^@host\s*/);if(_){if(!l())return c("@host missing '{'");var F=v().concat(g());return f()?k({type:"host",rules:F}):c("@host missing '}'")}}function it(){var k=r(),_=w(/^@media *([^{]+)/);if(_){var F=Lt(_[1]);if(!l())return c("@media missing '{'");var G=v().concat(g());return f()?k({type:"media",media:F,rules:G}):c("@media missing '}'")}}function q(){var k=r(),_=w(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(_)return k({type:"custom-media",name:Lt(_[1]),media:Lt(_[2])})}function tt(){var k=r(),_=w(/^@page */);if(_){var F=S()||[];if(!l())return c("@page missing '{'");for(var G=v(),St;St=C();)G.push(St),G=G.concat(v());return f()?k({type:"page",selectors:F,declarations:G}):c("@page missing '}'")}}function Y(){var k=r(),_=w(/^@([-\w]+)?document *([^{]+)/);if(_){var F=Lt(_[1]),G=Lt(_[2]);if(!l())return c("@document missing '{'");var St=v().concat(g());return f()?k({type:"document",document:G,vendor:F,rules:St}):c("@document missing '}'")}}function $(){var k=r(),_=w(/^@font-face\s*/);if(_){if(!l())return c("@font-face missing '{'");for(var F=v(),G;G=C();)F.push(G),F=F.concat(v());return f()?k({type:"font-face",declarations:F}):c("@font-face missing '}'")}}var ht=V("import"),rt=V("charset"),X=V("namespace");function V(k){var _=new RegExp("^@"+k+"\\s*([^;]+);");return function(){var F=r(),G=w(_);if(G){var St={type:k};return St[k]=G[1].trim(),F(St)}}}function U(){if(s[0]=="@")return B()||it()||q()||N()||ht()||rt()||X()||Y()||tt()||W()||$()}function A(){var k=r(),_=S();return _?(v(),k({type:"rule",selectors:_,declarations:M()})):c("selector missing")}return Cn(h())}function Lt(s){return s?s.replace(/^\s+|\s+$/g,""):""}function Cn(s,t){var e=s&&typeof s.type=="string",n=e?s:t;for(var i in s){var r=s[i];Array.isArray(r)?r.forEach(function(a){Cn(a,n)}):r&&typeof r=="object"&&Cn(r,n)}return e&&Object.defineProperty(s,"parent",{configurable:!0,writable:!0,enumerable:!1,value:t||null}),s}const Ls=crypto.subtle;Ls||console.warn("Crypto API not supported");function zr(s){return new TextEncoder().encode(s)}async function qr(s,t="SHA-256"){const e=await Ls.digest(t,zr(s));return Fr(e)}async function Yr(s,t="SHA-256"){const e=JSON.stringify(s);return qr(e,t)}const Tn=(s,t="image/svg+xml",e="utf-8")=>e==="base64"?new Blob([s],{type:`${t};${e}`}):new Blob([s],{type:`${t};charset=${e}`}),En=s=>new XMLSerializer().serializeToString(s),Hr=(s,t="text/html")=>new DOMParser().parseFromString(s,t),Ns=(s,t="image/svg+xml",e="utf-8")=>Tn(En(s),t,e),Pn=(s,t)=>{const e=document.createElement("a");e.style.visibility="hidden",document.body.appendChild(e),e.download=t,typeof s=="string"?e.href=s:e.href=window.URL.createObjectURL(s),e.click(),document.body.removeChild(e),window.URL.revokeObjectURL(e.href)};function Fs(s=["*"],t){return new Promise((e,n)=>{if(!globalThis.document||!(globalThis.document instanceof Document))return n(new Error("This is not a browser environment"));const i=globalThis.document.createElement("input");i.setAttribute("type","file"),i.setAttribute("visibility","hidden"),Array.isArray(s)&&s.length>0&&i.setAttribute("accept",s.join(",")),t&&i.setAttribute("multiple","true"),globalThis.addEventListener("focus",()=>{setTimeout(()=>{(!i.files||i.files?.length===0)&&n(new Error("Cancel select"))},1e3)},{once:!0});const r=()=>{if(i.removeEventListener("change",r),!i.files||i.files?.length===0)n(new Error("Cancel select"));else{const a=Array.from(i.files);!s.includes("*")&&a.some(o=>!s.includes(`.${Bs(o)}`))&&n(new Error(`Please select files in ${s} format`)),i.remove(),e(a)}};i.addEventListener("change",r),i.click()})}function Ve(s,t="text",e){return new Promise((n,i)=>{const r=new FileReader;switch(r.addEventListener("progress",a=>{e?.(a.loaded,a.total)}),r.addEventListener("load",a=>{n(a.target?.result)}),r.addEventListener("error",a=>{i(a)}),t){case"dataURL":r.readAsDataURL(s);break;case"binaryString":r.readAsBinaryString(s);break;case"arrayBuffer":r.readAsArrayBuffer(s);break;case"text":default:r.readAsText(s)}})}async function Wr(s){const t=await Ve(s,"arrayBuffer");return As(t)}const Bs=s=>{let t;return s instanceof File?t=s.name:t=s,t.match(/\.([0-9a-z]+)(?:[\\?#]|$)/i)?.[1]??""};function $r(s){typeof queueMicrotask=="function"?queueMicrotask(s):Promise.resolve().then(s).catch(t=>setTimeout(()=>{throw t}))}function Jr(s,t={},e=[]){return{tag:s,props:t,children:e}}function ue(s,t){if(s.el)return;const e=s.el=document.createElement(s.tag);if(s.props)for(const n in s.props){const i=s.props[n];n.startsWith("on")?e.addEventListener(n.slice(2).toLowerCase(),i):e.setAttribute(n,i)}s.children&&(typeof s.children=="string"?e.textContent=s.children:s.children.forEach(n=>{ue(n,e)})),t.appendChild(e)}function Us(s,t){if(s.tag!==t.tag){if(!s.el)return;const e=s.el.parentElement||document.body;e.removeChild(s.el),ue(t,e)}else{const e=t.el=s.el;if(!e)return;const n=s.props,i=t.props;for(const o in n)o in i||(o.startsWith("on")?e.removeEventListener(o.slice(2).toLowerCase(),n[o]):e.removeAttribute(o));for(const o in i){const c=n[o],h=i[o];h!=c&&(o.startsWith("on")?e.addEventListener(o.slice(2).toLowerCase(),h):e.setAttribute(o,h))}const r=s.children||[],a=t.children||[];if(typeof a=="string")e.innerHTML=a;else if(typeof r=="string")e.innerHTML="",a.forEach(o=>{ue(o,e)});else{const o=Math.min(r.length,a.length);for(let c=0;c<o;c++)Us(r[c],a[c]);a.length>r.length&&a.slice(r.length).forEach(c=>{ue(c,e)}),a.length<r.length&&r.slice(a.length).forEach(c=>{c.el&&e.removeChild(c.el)})}}}function Vs(s,t,e){if(!s){e&&t&&e.appendChild(t);return}if(!s.isEqualNode(t)){if(s.nodeName!==t.nodeName){e.replaceChild(t,s);return}if(s.nodeType===Node.TEXT_NODE){s.textContent!==t.textContent&&(s.textContent=t.textContent);return}for(let n=s.attributes.length-1;n>=0;n--){const i=s.attributes[n].name;!t.hasAttribute(i)&&i!=="open"&&s.removeAttribute(i)}for(let n=0;n<t.attributes.length;n++){const i=t.attributes[n].name,r=t.attributes[n].value;s.setAttribute(i,r)}for(let n=0;n<t.childNodes.length;n++)s.childNodes[n]?Vs(s.childNodes[n],t.childNodes[n],s):s.appendChild(t.childNodes[n].cloneNode(!0));for(;s.childNodes.length>t.childNodes.length;)s.lastChild&&s.removeChild(s.lastChild)}}class Zr{url;socket;waitingResponse={};sendMessageQueue=[];constructor(t){this.url=t,this.createSocket()}createSocket(){console.log("Socket Create Attempted"),this.socket=new WebSocket(this.url),this.socket.onopen=()=>{this.sendMessageQueue.forEach(t=>this.socket?.send(t)),this.sendMessageQueue=[]},this.socket.onclose=t=>{const{code:e,reason:n,wasClean:i}=t;console.log(`ws closed : ${e} ${n} ${i}`)},this.socket.onerror=t=>{console.log(`ws error : ${t.type}`)},this.socket.onmessage=t=>{this.processMessage(t)}}recreateSocket(t){console.log("Socket Recreate Attempted"),this.sendMessageQueue.push(t),this.createSocket()}closeSocket(){this.socket&&(this.socket.close(),console.log("Socket closed"))}openSocket(){this.createSocket(),console.log("Socket opened manually")}sendWithRetry(t){this.socket?.readyState===WebSocket.OPEN?this.socket.send(t):this.recreateSocket(t)}async processMessage(t){if(typeof t.data=="string")try{const e=JSON.parse(t.data);if(Object.prototype.hasOwnProperty.call(e,"requestid")){const n=this.waitingResponse[e.requestid];n?n.resolve?.(e):console.warn("Got data but found no associated request, already timed out?",e)}else console.warn("Got data without request id",e)}catch{console.log(`Received String : ${t.data}`)}else t.data instanceof ArrayBuffer?console.log(`Received ArrayBuffer : ${t.data}`):t.data instanceof Blob&&console.log(`Received Blob : ${t.data}`)}async sendPayload(t){const e=+new Date,n=this.waitingResponse[e]={requestid:e};try{let i;t instanceof Blob||t instanceof ArrayBuffer||typeof t=="string"?i=t:i=JSON.stringify({...n,...t});const r=await new Promise((a,o)=>{n.resolve=a,this.sendWithRetry(i),setTimeout(()=>{o("Timeout")},5e3)});return console.info("Time took",(+new Date-n.requestid)/1e3),r}catch(i){return Promise.reject(i)}finally{delete this.waitingResponse[e]}}async send(t,e,n=i=>{console.log(i)}){this.sendPayload(t).then(e,n)}}function Kr(){const s=window.screen;return{screenWidth:s.width,screenHeight:s.height,screenX:window.screenX,screenY:window.screenY}}function Qr(){const s=document.body;return{clientWidth:s.clientWidth,clientHeight:s.clientHeight,clientTop:s.clientTop,clientLeft:s.clientLeft,scrollWidth:s.scrollWidth,scrollHeight:s.scrollHeight,scrollTop:s.scrollTop,scrollLeft:s.scrollLeft,pageX:s.getBoundingClientRect().x,pageY:s.getBoundingClientRect().y}}function te(){const s=document.documentElement;return{clientWidth:s.clientWidth,clientHeight:s.clientHeight,clientTop:s.clientTop,clientLeft:s.clientLeft,scrollWidth:s.scrollWidth,scrollHeight:s.scrollHeight,scrollTop:s.scrollTop,scrollLeft:s.scrollLeft,offsetWidth:s.offsetWidth,offsetHeight:s.offsetHeight,offsetTop:s.offsetTop,offsetLeft:s.offsetLeft,offsetParent:s.offsetParent,clientX:s.getBoundingClientRect().x,clientY:s.getBoundingClientRect().y}}function ta(){const{clientWidth:s,clientHeight:t}=te();return{width:s||window.innerWidth,height:t||window.innerHeight}}function ea(){const{scrollWidth:s,scrollHeight:t}=te();return{width:s,height:t}}function Gs(s){const{top:t,left:e}=s.getBoundingClientRect(),{scrollLeft:n,scrollTop:i}=te();return{x:e+n,y:t+i}}function na(s){return{x:js(s),y:Xs(s)}}function js(s){let t=0;for(;s!==null;)t+=s.offsetLeft,s=s.offsetParent;return t}function Xs(s){let t=0;for(;s!==null;)t+=s.offsetTop,s=s.offsetParent;return t}function sa(s){const t=s.getBoundingClientRect();return{x:t.left,y:t.top}}function ia(s,t){const e=s.getBoundingClientRect(),n=t.getBoundingClientRect();return{x:n.x-e.x,y:n.y-e.y,width:n.width||n.right-n.left,height:n.height||n.bottom-n.top}}function ra(){const{clientHeight:s,scrollTop:t,scrollHeight:e}=te(),n=e-s;return n<=0?0:t/n*100}function aa(s){return{x:s.clientX,y:s.clientY}}function zs(s){if("center"in s)return s.center;if(s.pageX&&s.pageY)return{x:s.pageX,y:s.pageY};const{scrollLeft:t,scrollTop:e}=te();return{x:s.clientX+t,y:s.clientY+e}}function qs(s,t){const e=zs(t),n=Gs(s);return{x:e.x-n.x,y:e.y-n.y}}function _n(){return typeof window<"u"?window:this||{}}const Ge=()=>{const s=navigator.userAgent.toLowerCase();let t="Unknown";return/mac/i.test(s)?t="macOS":/win/i.test(s)?t="Windows":/android/i.test(s)?t="Android":/iphone|ipad|ipod/i.test(s)?t="iOS":/linux/i.test(s)?t="Linux":/bsd/i.test(s)&&(t="BSD"),t.toLowerCase()},oa=()=>{const s=navigator.userAgent;let t="Unknown";if(/Windows NT/.test(s)){const e=s.match(/Windows NT (\d+\.\d+)/);e&&(t=e[1])}else if(/Mac OS X/.test(s)){const e=s.match(/Mac OS X (\d+_\d+)/);e&&(t=e[1].replace("_","."))}else if(/Android/.test(s)){const e=s.match(/Android (\d+\.\d+)/);e&&(t=e[1])}else if(/iPhone|iPad|iPod/.test(s)){const e=s.match(/OS (\d+_\d+)/);e&&(t=e[1].replace("_","."))}return t.toLowerCase()},Dn=()=>{const s=navigator.userAgent.toLowerCase();let t="Unknown";return/opr/i.test(s)||/opera/i.test(s)?t="Opera":/chrome/i.test(s)?t="Chrome":/firefox/i.test(s)?t="Firefox":/safari/i.test(s)?t="Safari":/edge/i.test(s)?t="Edge":/msie|trident/i.test(s)?t="IE":/MicroMessenger/i.test(s)?t="Wechat":/alipay/i.test(s)&&(t="Ali"),t.toLowerCase()},ca=()=>{const s=navigator.userAgent;let t="Unknown";if(/Chrome/.test(s)){const e=s.match(/Chrome\/(\d+\.\d+)/);e&&(t=e[1])}else if(/Firefox/.test(s)){const e=s.match(/Firefox\/(\d+\.\d+)/);e&&(t=e[1])}else if(/Safari/.test(s)){const e=s.match(/Version\/(\d+\.\d+)/);e&&(t=e[1])}else if(/Edge/.test(s)){const e=s.match(/Edge\/(\d+\.\d+)/);e&&(t=e[1])}else if(/MSIE|Trident/.test(s)){const e=s.match(/(?:MSIE|rv:)(\d+\.\d+)/);e&&(t=e[1])}return t},ha=()=>"geolocation"in navigator?new Promise((s,t)=>{navigator.geolocation.getCurrentPosition(e=>{const n=e.coords.latitude,i=e.coords.longitude;s({latitude:n,longitude:i})},e=>{t(e)})}):Promise.reject("Geolocation is not available.");function la(){return(navigator.browserLanguage||navigator.language).toLowerCase()}function ua(){return Intl.DateTimeFormat().resolvedOptions().timeZone.toLowerCase()}function An(){return Ge()==="ios"}function kn(){return Ge()==="macos"}function fa(){return An()|kn()}function Ys(){return Ge()==="android"}function da(){return An()||Ys()}function ma(){return typeof window=="object"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches}function Hs(){const s=window.navigator.userAgent,t=s.indexOf("MSIE ");if(t>0)return parseInt(s.substring(t+5,s.indexOf(".",t)),10);if(s.indexOf("Trident/")>0){const i=s.indexOf("rv:");return parseInt(s.substring(i+3,s.indexOf(".",i)),10)}const n=s.indexOf("Edge/");return n>0?parseInt(s.substring(n+5,s.indexOf(".",n)),10):-1}const pa=Hs()!==-1;function ga(){const s=document.documentMode;return s&&(s===9||s===10)}function Ws(){return Dn()==="wechat"}function $s(){return Dn()==="ali"}function ya(){return Ws()&&navigator.userAgent.match(/miniprogram/i)||window.__wxjs_environment==="miniprogram"}function wa(){return $s()&&navigator.userAgent.match(/miniprogram/i)}const va=typeof document<"u",Js=typeof window<"u",ba=typeof history<"u",xa=Js&&window.File&&window.FileReader&&window.FileList&&window.Blob,Zs=(()=>{const s=_n();return!!(s.Worker&&s.Blob&&s.Promise&&s.OffscreenCanvas&&s.OffscreenCanvasRenderingContext2D&&s.HTMLCanvasElement&&s.HTMLCanvasElement.prototype.transferControlToOffscreen&&s.URL&&s.URL.createObjectURL)})(),Sa=typeof Path2D=="function"&&typeof DOMMatrix=="function",Ca=function(){if(!_n().OffscreenCanvas)return!1;var t=new OffscreenCanvas(1,1),e=t.getContext("2d");e.fillRect(0,0,1,1);var n=t.transferToImageBitmap();try{e.createPattern(n,"no-repeat")}catch{return!1}return!0}();function Ta(s){const t=document.documentElement,e=window.top===window.self?window.devicePixelRatio:1;t.dataset.dpr=e;let n=100;const i=function(){const r=Math.min(t.clientWidth,s);t.dataset.width=r,t.dataset.rem=n=Math.round(100*(r/s)),t.style.fontSize=n+"px"};i(),window.rem2px=function(r){return r=parseFloat(r),r*n},window.px2rem=function(r){return r=parseFloat(r),r/n},window.addEventListener&&window.addEventListener("orientationchange"in window?"orientationchange":"resize",i,!1)}function ot(s){return s*Math.PI/180}function nt(s){return s*180/Math.PI}function Ks(s,t,e=0){return Math.sqrt(s*s+t*t+e*e)}function In(s,t,e,n){const i=s-e,r=t-n;return Ks(i,r)}function fe(s,t,e,n){const i=e-s,r=n-t;let a=Math.atan2(r,i);return a<0&&(a+=Math.PI*2),a}function Gt(s,t){return{x:Math.cos(s)*t,y:Math.sin(s)*t}}function Ea(s,t){const e=Math.sqrt(Math.pow(s,2)+Math.pow(t,2));return{x:s/=e,y:t/=e}}function Pa(s,t,e,n,i=10){if(Math.abs(e-s)<i&&Math.abs(n-t)<i)return"no";const r=nt(fe(s,t,e,n));return r>=-135&&r<=-45?"up":r>45&&r<135?"down":r>=135&&r<=180||r>=-180&&r<-135?"left":r>=-45&&r<=45?"right":"no"}const Qs=[1,0,0,1,0,0],ti=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];class st{value;matrix3d;isEverTo3d=!1;constructor(t=Qs){this.value=Array.from(t),this.matrix3d=this.toMatrix3D()}get m11(){return this.value[0]}get m12(){return this.value[1]}get m13(){return 0}get m21(){return this.value[2]}get m22(){return this.value[3]}get m23(){return 0}get m31(){return this.value[4]}get m32(){return this.value[5]}get m33(){return 1}toMatrix3D(t=this.matrix3d){const e=[this.value[0],this.value[1],0,0,this.value[2],this.value[3],0,0,0,0,1,0,this.value[4],this.value[5],0,1];return t?(t.value=e,t):new Wt(e)}unit(){return this.value=Array.from(Qs),this.matrix3d=this.toMatrix3D(),this}transformPoint(t,e,n=0,i=0){const r=t-n,a=e-i;return t=this.m11*r+this.m21*a+this.m31,e=this.m12*r+this.m22*a+this.m32,[t+n,e+i]}fromString(t){const e=Cs("number",t);return e.length===6?e.forEach((n,i)=>{n.fullMatch&&(this.value[i]=parseFloat(n.fullMatch))}):this.unit(),this}clone(){return new st(this.value)}multiply(t){const e=this.value;let n;t instanceof st?n=t.value:n=t;const i=e[0]*n[0]+e[2]*n[1],r=e[1]*n[0]+e[3]*n[1],a=e[0]*n[2]+e[2]*n[3],o=e[1]*n[2]+e[3]*n[3],c=e[0]*n[4]+e[2]*n[5]+e[4],h=e[1]*n[4]+e[3]*n[5]+e[5];return e[0]=i,e[1]=r,e[2]=a,e[3]=o,e[4]=c,e[5]=h,this}inverse(){const t=new st(this.value),e=t.value,n=1/(e[0]*e[3]-e[1]*e[2]),i=e[3]*n,r=-e[1]*n,a=-e[2]*n,o=e[0]*n,c=n*(e[2]*e[5]-e[3]*e[4]),h=n*(e[1]*e[4]-e[0]*e[5]);return e[0]=i,e[1]=r,e[2]=a,e[3]=o,e[4]=c,e[5]=h,t}offset(t=0,e=0){return[t-this.m31,e-this.m32]}translate(t,e){return this.multiply([1,0,0,1,t,e]),this.toMatrix3D(),this}translateTo(t,e){const n=this.offset(t,e);return this.translate(n[0],n[1])}translateX(t){return this.translate(t,0)}translateXTo(t){return this.translateTo(t,this.m32)}translateY(t){return this.translate(0,t)}translateYTo(t){return this.translateTo(this.m31,t)}translateZ(t){return this.isEverTo3d=!0,this.matrix3d.translate(0,0,t),this.matrix3d.toMatrix(this),this}translateZTo(t){return this.translateZ(t-this.matrix3d.m43),this}translate3d(t,e,n){return this.isEverTo3d=!0,this.matrix3d.translate(t,e,n),this.matrix3d.toMatrix(this),this}translate3dTo(t,e,n){return this.translate3d(t-this.matrix3d.m41,e-this.matrix3d.m42,n-this.matrix3d.m43),this}rotate(t,e=0,n=0){const i=ot(t),r=Math.cos(i),a=Math.sin(i);return this.multiply([r,a,-a,r,e,n]),this.translate(-e,-n),this.toMatrix3D(),this}rotateTo(t,e=0,n=0){const{rotateZ:i}=this.matrix3d.split();return this.rotate(t-i,e,n),this}rotateX(t){return this.isEverTo3d=!0,this.matrix3d.rotate("x",t),this.matrix3d.toMatrix(this),this}rotateXTo(t){const{rotateX:e}=this.matrix3d.split();return this.rotateX(t-e),this}rotateY(t){return this.isEverTo3d=!0,this.matrix3d.rotate("y",t),this.matrix3d.toMatrix(this),this}rotateYTo(t){const{rotateY:e}=this.matrix3d.split();return this.rotateY(t-e),this}rotateZ(t){return this.isEverTo3d=!0,this.matrix3d.rotate("z",t),this.matrix3d.toMatrix(this),this}rotateZTo(t){const{rotateZ:e}=this.matrix3d.split();return this.rotateZ(t-e),this}rotate3d(t,e,n){return this.isEverTo3d=!0,this.matrix3d.rotate("x",t).rotate("y",e).rotate("z",n),this.matrix3d.toMatrix(this),this}rotate3dTo(t,e,n){const{rotateX:i,rotateY:r,rotateZ:a}=this.matrix3d.split();return this.rotate3d(t-i,e-r,n-a),this}scale(t,e=t,n=0,i=0){return this.translate(n,i),this.multiply([t,0,0,e,0,0]),this.translate(-n,-i),this.toMatrix3D(),this}scaleTo(t,e=t,n=0,i=0){return this.scale(t/this.m11,e/this.m22,n,i)}scaleX(t){return this.scale(t,1)}scaleXTo(t){return this.scale(t/this.m11,1)}scaleY(t){return this.scale(1,t)}scaleYTo(t){return this.scale(1,t/this.m22)}scaleZ(t){return this.isEverTo3d=!0,this.matrix3d.scale(1,1,t),this.matrix3d.toMatrix(this),this}scaleZTo(t){const{scaleZ:e}=this.matrix3d.split();return this.scaleZ(t/e),this}scale3d(t,e=t,n=t){return this.isEverTo3d=!0,this.matrix3d.scale(t,e,n),this.matrix3d.toMatrix(this),this}scale3dTo(t,e=t,n=t){const{scaleX:i,scaleY:r,scaleZ:a}=this.matrix3d.split();return this.scale3d(t/i,e/r,n/a),this}skew(t,e=t){const n=Math.tan(ot(t)),i=Math.tan(ot(e));return this.multiply([1,i,n,1,0,0]),this.toMatrix3D(),this}skewTo(t,e=t){return this.skew(t-nt(this.m21),e-nt(this.m12))}skewX(t){return this.skew(t,nt(this.m12))}skewXTo(t){return this.skewTo(t,nt(this.m12))}skewY(t){return this.skew(nt(this.m21),t)}skewYTo(t){return this.skewTo(nt(this.m21),t)}skewZ(t){return this}skewZTo(t){return this}skew3d(t,e,n){return this}skew3dTo(t,e,n){return this}getGroupCoords(t){const e=this.value[0],n=this.value[1],i=this.value[2],r=this.value[3],a=this.value[4],o=this.value[5],c=t.value[0],h=t.value[1],l=t.value[2],f=t.value[3],g=t.value[4],w=t.value[5],m=c*f,v=h*l,b=(l*n-e*f)/(v-m),S=(c*n-e*h)/(m-v),C=(l*r-i*f)/(v-m),M=(c*r-i*h)/(m-v),R=(l*(o-w)+f*(g-a))/(v-m),B=(c*(o-w)+h*(g-a))/(m-v),N=[b,S,C,M,R,B];return new st(N)}toString(){return this.isEverTo3d?this.matrix3d.toString():`matrix(${this.value.map(t=>Qt(t,6)).join(",")})`}toFilter(){return"progid:DXImageTransform.Microsoft.Matrix(M11="+this.value[0]+", M12="+this.value[2]+", M21="+this.value[1]+", M22="+this.value[3]+", Dx="+this.value[4]+", Dy="+this.value[5]+", sizingmethod='auto expand')"}}class Wt{value;constructor(t=ti){this.value=Array.from(t)}get m11(){return this.value[0]}get m12(){return this.value[1]}get m13(){return this.value[2]}get m14(){return this.value[3]}get m21(){return this.value[4]}get m22(){return this.value[5]}get m23(){return this.value[6]}get m24(){return this.value[7]}get m31(){return this.value[8]}get m32(){return this.value[9]}get m33(){return this.value[10]}get m34(){return this.value[11]}get m41(){return this.value[12]}get m42(){return this.value[13]}get m43(){return this.value[14]}get m44(){return this.value[15]}unit(){return this.value=Array.from(ti),this}fromString(t){const e=Cs("number",t);return e.length===16?e.forEach((n,i)=>{n.fullMatch&&(this.value[i]=parseFloat(n.fullMatch))}):this.unit(),this}toMatrix(t){const{scaleX:e,scaleY:n,skewX:i,skewY:r,x:a,y:o}=this.split(),c=[e,r,i,n,a,o];return t?(t.value=c,t):new st(c)}multiplyMatrix(t){const e=t.value[0],n=t.value[1],i=t.value[2],r=t.value[3],a=e*this.m11+n*this.m21+i*this.m31+r*this.m41,o=e*this.m12+n*this.m22+i*this.m32+r*this.m42,c=e*this.m13+n*this.m23+i*this.m33+r*this.m43,h=e*this.m14+n*this.m24+i*this.m34+r*this.m44;return new st([a,o,c,h,0,0])}multiply(t){const e=new st([t.value[0],t.value[1],t.value[2],t.value[3],0,0]),n=new st([t.value[4],t.value[5],t.value[6],t.value[7],0,0]),i=new st([t.value[8],t.value[9],t.value[10],t.value[11],0,0]),r=new st([t.value[12],t.value[13],t.value[14],t.value[15],0,0]),a=this.multiplyMatrix(e),o=this.multiplyMatrix(n),c=this.multiplyMatrix(i),h=this.multiplyMatrix(r);return this.value[0]=a.value[0],this.value[1]=a.value[1],this.value[2]=a.value[2],this.value[3]=a.value[3],this.value[4]=o.value[0],this.value[5]=o.value[1],this.value[6]=o.value[2],this.value[7]=o.value[3],this.value[8]=c.value[0],this.value[9]=c.value[1],this.value[10]=c.value[2],this.value[11]=c.value[3],this.value[12]=h.value[0],this.value[13]=h.value[1],this.value[14]=h.value[2],this.value[15]=h.value[3],this}translate(t=0,e=0,n=0){return this.multiply(new Wt([1,0,0,0,0,1,0,0,0,0,1,0,t,e,n,1]))}scale(t=1,e=1,n=1){return this.multiply(new Wt([t,0,0,0,0,e,0,0,0,0,n,0,0,0,0,1]))}rotate(t,e){const n=ot(e),i=Math.sin,r=Math.cos;let a;switch(t){case"x":a=[1,0,0,0,0,r(n),i(n),0,0,-i(n),r(n),0,0,0,0,1];break;case"y":a=[r(n),0,-i(n),0,0,1,0,0,i(n),0,r(n),0,0,0,0,1];break;case"z":a=[r(n),i(n),0,0,-i(n),r(n),0,0,0,0,1,0,0,0,0,1];break}return this.multiply(new Wt(a))}toString(){return`matrix3d(${this.value.map(t=>Qt(t,6)).join(",")})`}split(){let t=nt(yt(Math.asin(-this.m13),-1,1)),e=nt(Math.atan2(this.m23,this.m33)),n=nt(Math.atan2(this.m12,this.m11));return Math.cos(t)===0&&(e=nt(Math.atan2(-this.m31,this.m22)),n=0),{x:this.m41,y:this.m42,z:this.m43,rotateX:e,rotateY:t,rotateZ:n,scaleX:Math.sqrt(this.m11*this.m11+this.m12*this.m12+this.m13*this.m13),scaleY:Math.sqrt(this.m21*this.m21+this.m22*this.m22+this.m23*this.m23),scaleZ:Math.sqrt(this.m31*this.m31+this.m32*this.m32+this.m33*this.m33),skewX:nt(this.m14),skewY:nt(this.m24),skewZ:nt(this.m34),skewW:this.m44}}inverse(){const t=[],e=this.m11,n=this.m12,i=this.m13,r=this.m14,a=this.m21,o=this.m22,c=this.m23,h=this.m24,l=this.m31,f=this.m32,g=this.m33,w=this.m34,m=this.m41,v=this.m42,b=this.m43,S=this.m44;t[0]=c*w*v-h*g*v+h*f*b-o*w*b-c*f*S+o*g*S,t[1]=r*g*v-i*w*v-r*f*b+n*w*b+i*f*S-n*g*S,t[2]=i*h*v-r*c*v+r*o*b-n*h*b-i*o*S+n*c*S,t[3]=r*c*f-i*h*f-r*o*g+n*h*g+i*o*w-n*c*w;const C=e*t[0]+a*t[1]+l*t[2]+m*t[3];if(C==0)return console.warn("Can't invert matrix, determinant is 0");t[4]=h*g*m-c*w*m-h*l*b+a*w*b+c*l*S-a*g*S,t[5]=i*w*m-r*g*m+r*l*b-e*w*b-i*l*S+e*g*S,t[6]=r*c*m-i*h*m-r*a*b+e*h*b+i*a*S-e*c*S,t[7]=i*h*l-r*c*l+r*a*g-e*h*g-i*a*w+e*c*w,t[8]=o*w*m-h*f*m+h*l*v-a*w*v-o*l*S+a*f*S,t[9]=r*f*m-n*w*m-r*l*v+e*w*v+n*l*S-e*f*S,t[10]=n*h*m-r*o*m+r*a*v-e*h*v-n*a*S+e*o*S,t[11]=r*o*l-n*h*l-r*a*f+e*h*f+n*a*w-e*o*w,t[12]=c*f*m-o*g*m-c*l*v+a*g*v+o*l*b-a*f*b,t[13]=n*g*m-i*f*m+i*l*v-e*g*v-n*l*b+e*f*b,t[14]=i*o*m-n*c*m-i*a*v+e*c*v+n*a*b-e*o*b,t[15]=n*c*l-i*o*l+i*a*f-e*c*f-n*a*g+e*o*g,this.value=t;const M=1/C;this.value.map(R=>R*M)}}function Mn(s){const t=new st;return s.replace(/([a-z0-9]+)\s*\(?\s*((-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)*[a-z%]*\s*,?\s*)+)\)?/gi,function(e,n,i){i.indexOf(",")>=0?i=i.split(/\s*,\s*/):i=i.split(/\s+/);const r=[];for(let a=0,o=i.length;a<o;a++)i[a].trim()&&r.push(parseFloat(""+i[a]));switch(n.toLowerCase()){case"t":case"translate":t.translate(r[0],r[1]);break;case"translatex":t.translateX(r[0]);break;case"translatey":t.translateY(r[0]);break;case"translatez":t.translateZ(r[0]);break;case"translate3d":t.translate3d(r[0],r[1],r[2]);break;case"r":case"rotate":t.rotate(r[0],r[1]??0,r[2]??0);break;case"rotatex":t.rotateX(r[0]);break;case"rotatey":t.rotateY(r[0]);break;case"rotatez":t.rotateZ(r[0]);break;case"rotate3d":t.rotate3d(r[0],r[1],r[2]);break;case"s":case"scale":t.scale(r[0],r[1]??r[0]);break;case"scalex":t.scaleX(r[0]);break;case"scaley":t.scaleY(r[0]);break;case"scalez":t.scaleZ(r[0]);break;case"scale3d":t.scale3d(r[0],r[1],r[2]);break;case"skew":t.skew(r[0],r[1]??0);break;case"skewx":t.skewX(r[0]);break;case"skewy":t.skewY(r[0]);break;case"skewz":t.skewZ(r[0]);break;case"skew3d":t.skew3d(r[0],r[1],r[2]);break;case"m":case"matrix":t.multiply([r[0],r[1],r[2],r[3],r[4],r[5]]),t.toMatrix3D();break;case"matrix3d":t.matrix3d.multiply(new Wt(r)),t.matrix3d.toMatrix(t);break}return""}),t}class D{static onDocumentReady(t){let e=!1;function n(){document.readyState==="loading"||e||(e=!0,t(),document.removeEventListener("DOMContentLoaded",n))}typeof document<"u"&&(document.addEventListener("DOMContentLoaded",n),n())}static onBeforeUnload(t){function e(){t(),document.removeEventListener("beforeunload",e)}typeof document<"u"&&document.addEventListener("beforeunload",e)}static getCSSVar(t){return getComputedStyle(document.documentElement).getPropertyValue(t)}static setCSSVar(t,e){document.documentElement.style.setProperty(t,e)}static add3DSupport(t,e="1000px"){if(t.parentElement){const n=D.getStyle(t.parentElement,"position");D.setStyle(t.parentElement,{position:n=="static"?"relative":n,perspective:e})}D.setStyle(t,{"transform-style":"preserve-3d"})}static convertAttrs(t,e,n={}){n.hasOwnProperty("transform")||Object.assign(n,{transform:D.getStyle(t,"transform")||""});const i=Mn(n.transform),r={};for(let a in e){const o=e[a];switch(a){case"transform":break;case"translate":i.translate(o[0]||0,o[1]||0);break;case"translateTo":i.translateTo(o[0]||0,o[1]||0);break;case"translateX":i.translateX(o||0);break;case"translateXTo":i.translateXTo(o||0);break;case"translateY":i.translateY(o||0);break;case"translateYTo":i.translateYTo(o||0);break;case"translateZ":i.translateZ(o||0);break;case"translateZTo":i.translateZTo(o||0);break;case"translate3d":i.translate3d(o[0]||0,o[1]||0,o[2]||0);break;case"translate3dTo":i.translate3dTo(o[0]||0,o[1]||0,o[2]||0);break;case"rotate":typeof o=="number"?i.rotate(o||0):i.rotate(o[0]||0,o[1]||0,o[2]||0);break;case"rotateTo":typeof o=="number"?i.rotateTo(o||0):i.rotateTo(o[0]||0,o[1]||0,o[2]||0);break;case"rotateX":i.rotateX(o||0);break;case"rotateXTo":i.rotateXTo(o||0);break;case"rotateY":i.rotateY(o||0);break;case"rotateYTo":i.rotateYTo(o||0);break;case"rotateZ":i.rotateZ(o||0);break;case"rotateZTo":i.rotateZTo(o||0);break;case"rotate3d":i.rotate3d(o[0]||0,o[1]||0,o[2]||0);break;case"rotate3dTo":i.rotate3dTo(o[0]||0,o[1]||0,o[2]||0);break;case"scale":typeof o=="number"?i.scale(o||1):i.scale(o[0]||1,o[1]||1,o[2]||0,o[3]||0);break;case"scaleTo":typeof o=="number"?i.scaleTo(o||1):i.scaleTo(o[0]||1,o[1]||1,o[2]||0,o[3]||0);break;case"scaleX":i.scaleX(o||1);break;case"scaleXTo":i.scaleXTo(o||1);break;case"scaleY":i.scaleY(o||1);break;case"scaleYTo":i.scaleYTo(o||1);break;case"scaleZ":i.scaleZ(o||1);break;case"scaleZTo":i.scaleZTo(o||1);break;case"scale3d":typeof o=="number"?i.scale3d(o||1):i.scale3d(o[0]||1,o[1]||1,o[2]||1);break;case"scale3dTo":typeof o=="number"?i.scale3dTo(o||1):i.scale3dTo(o[0]||1,o[1]||1,o[2]||1);break;case"skew":typeof o=="number"?i.skew(o||0):i.skew(o[0]||0,o[1]||0);break;case"skewTo":typeof o=="number"?i.skewTo(o||0):i.skewTo(o[0]||0,o[1]||0);break;case"skewX":i.skewX(o||0);break;case"skewXTo":i.skewXTo(o||0);break;case"skewY":i.skewY(o||0);break;case"skewYTo":i.skewYTo(o||0);break;case"skewZ":break;case"skewZTo":break;case"skew3d":break;case"skew3dTo":break;default:n.hasOwnProperty(a)||(n[a]=D.getStyle(t,a)),Object.assign(r,{[a]:`${o}`});break}}return Object.assign(r,{transform:i.toString()}),r}static attrsToCanvas(t,e){for(const n in e){const i=e[n];switch(ft(n)){case"fill":i!=="none"&&(t.fillStyle=i);break;case"stroke":i!=="none"&&(t.strokeStyle=i);break;case"stroke-width":t.lineWidth=Number(i);break;case"stroke-linecap":t.lineCap=i;break;case"stroke-linejoin":switch(i){case"round":case"bevel":case"miter":t.lineJoin=i;break;default:t.lineJoin="miter";break}break;case"stroke-miterlimit":t.miterLimit=Number(i);break;case"stroke-opacity":break;case"cursor":break;case"font":t.font=i;break;case"font-size":t.font+=` ${i}`;break;case"font-family":t.font+=` ${i}`;break;case"font-weight":break;case"font-style":break;case"text-anchor":switch(i){case"middle":t.textAlign="center";break;case"end":t.textAlign="end";break;case"start":t.textAlign="start";break}break;case"alignment-baseline":switch(i){case"middle":case"bottom":case"top":case"alphabetic":case"hanging":case"ideographic":t.textBaseline=i;break;default:t.textBaseline="alphabetic";break}break}}}static getStyle(t,e,n){const i=t;if(getComputedStyle)if(e){e=ft(e);const r=getComputedStyle(i,n).getPropertyPriority(e);return getComputedStyle(i,n).getPropertyValue(e).trim()+(r?"!"+r:"")}else{const r=[],a=getComputedStyle(i,"");for(let o=0;o<a.length;o++)r.push(a[o]+":"+a.getPropertyValue(a[o]));return r.push(...(i.style.cssText||"").split(";")),Object.fromEntries(r.filter(o=>!!o).map(o=>o.split(":").map(c=>c.trim()))||[])}else if(t.currentStyle){if(e)return e=Ps(e),t.currentStyle[e];{const r=[],a=i.currentStyle;for(let o in a)r.push(o+":"+a[o]);return r.push(...(i.style.cssText||"").split(";")),Object.fromEntries(r.filter(o=>!!o).map(o=>o.split(":").map(c=>c.trim()))||[])}}}static setStyle(t,e,n){if(typeof e=="string"&&n){const i=String(n).toLowerCase().includes("!important")?"important":"";t.style.setProperty(ft(e),n.replace(/!important/i,""),i)}else e instanceof Object&&Object.keys(e).forEach(i=>{const r=String(e[i]).toLowerCase().includes("!important")?"important":"";t.style.setProperty(ft(i),String(e[i]).replace(/!important/i,""),r)})}static setStyleSheet(t,e){let n;if(typeof e=="string"){const r=document.querySelector(e)?.shadowRoot;r?n=r:n=document.querySelector(e)}else n=e;const i=document.createElement("style");if(i.innerHTML=t,n)return n.appendChild(i),()=>{(n instanceof HTMLElement||n instanceof ShadowRoot)&&n.removeChild(i)};{const r=document.styleSheets[0].insertRule(t);return()=>{document.styleSheets[0].deleteRule(r)}}}static toggleClass(t,e,n="toggle"){e.split(/[,\s]+/).forEach(i=>{i.trim()!==""&&t.classList[n](i.trim())})}static addClass(t,e){this.toggleClass(t,e,"add")}static removeClass(t,e){this.toggleClass(t,e,"remove")}static hasClass(t,e){return e.split(/[,\s]+/).every(n=>n.trim()!==""?Array.from(t.classList||[]).includes(n.trim()):!0)}static toggleDisplay(t,e){this.getStyle(t,"display")=="none"&&e===void 0||e===!0?t.style.setProperty("display",t instanceof HTMLTableRowElement?"table-row":t instanceof HTMLTableCellElement?"table-cell":"block"):t.style.setProperty("display","none")}static show(t){this.toggleDisplay(t,!0)}static hide(t){this.toggleDisplay(t,!1)}static attribute(t,e,n){let i={};if(e===void 0&&n===void 0){for(let r=0,a=t.attributes,o=a.length;r<o;r++){const c=a[r];c.nodeName&&c.nodeValue&&(i[c.nodeName]=c.nodeValue)}return i}if(typeof e=="string"&&n===void 0)return t.getAttribute(ft(e));typeof e=="object"?i=e:typeof e=="string"&&n!==void 0&&(i[e]=n),Object.entries(i).forEach(([r,a])=>{t.setAttribute(ft(r),a)})}static removeAttribute(t,e){e.split(/[,\s]+/).forEach(n=>{n.trim()!=""&&t.removeAttribute(n.trim())})}static fixProp(t){const e={cellpadding:"cellPadding",cellspacing:"cellSpacing",class:"className",colspan:"colSpan",contenteditable:"contentEditable",for:"htmlFor",frameborder:"frameBorder",maxlength:"maxLength",readonly:"readOnly",rowspan:"rowSpan",tabindex:"tabIndex",usemap:"useMap"};return e[t]?e[t]:t}static prop(t,e,n){if(n===void 0&&typeof e=="string")return t[e];{let i={};typeof e=="object"?i=e:typeof e=="string"&&n!==void 0&&(i[e]=n),Object.entries(i).forEach(([r,a])=>{const o=this.fixProp(r);t[o]=a,o=="innerHTML"&&this.scriptConvert(t)})}}static removeProp(t,e){e.split(/[,\s]+/).forEach(n=>{n.trim()!=""&&delete t[this.fixProp(n.trim())]})}static data(t,e,n){if(typeof e=="string"&&(e=Ps(e)),(typeof e=="string"||e===void 0)&&n===void 0){const i=Object.assign({},t.dataset);return Object.keys(i).forEach(r=>{if(i[r]?.startsWith("[")||i[r]?.startsWith("{"))try{i[r]=JSON.parse(i[r]||"")}catch{}}),typeof e=="string"?i[e]:i}else{let i={};typeof e=="object"?i=e:typeof e=="string"&&(i[e]=n),Object.entries(i).forEach(([r,a])=>{a!=null?t.dataset[r]=a instanceof Object?JSON.stringify(a):a:delete t.dataset[r]})}}static removeData(t,e){e.split(/[,\s]+/).forEach(n=>{n.trim()!=""&&delete t.dataset[n.trim()]})}static empty(t){this.html(t,"")}static html(t,e){e instanceof HTMLElement||e instanceof SVGElement?this.insert(t,e,"replaceWith"):this.prop(t,"innerHTML",e)}static text(t,e){return this.prop(t,"textContent",e)}static value(t,e){return this.prop(t,"value",e)}static dispatchEvent(t,e,n){let i;const r=["click","dblclick","mousedown","mouseup","mousemove"],a=["keydown","keyup","keypress"];typeof e=="string"?r.includes(e)?i=new MouseEvent(e,n):a.includes(e)?i=new KeyboardEvent(e,n):i=new Event(e,n):i=e,t.dispatchEvent(i)}static scriptConvert(t){const e=n=>{const r=n.ownerDocument.createElement("script");r.text=n.text;const a=n.attributes;for(let o=0;o<a.length;o++)r.setAttribute(a[o].name,a[o].value);return r};return t.tagName=="SCRIPT"&&(t=e(t)),t.querySelectorAll&&t.querySelectorAll("script").forEach(n=>{n.parentNode?.replaceChild(e(n),n)}),t}static fragment(t){const e=document.createElement("template");return e.innerHTML=t,e.content.childNodes.forEach(n=>{const i=this.scriptConvert(n);i!=n&&e.content.replaceChild(i,n)}),e.content}static insert(t,e,n="append"){return typeof e=="string"?t[n](this.fragment(e)):(e instanceof HTMLElement||e instanceof SVGElement)&&t[n](e),this}static createElement(t){return document.createElement.call(document,t)}static createTextNode(t){return document.createTextNode.call(document,t)}static createDocumentFragment(){return document.createDocumentFragment.call(document)}static remove(t){return t.remove()}static siblings=t=>Array.prototype.slice.call(t.parentElement?.children).filter(e=>e!==t);static nextElementSibling(t){return t.nextElementSibling}static previousElementSibling(t){return t.previousElementSibling}static closest(t,e){return t.closest(e)}static shadowRoot(t){return t.shadowRoot}static parentElement=t=>t.parentElement;static changeSelectSelected(t,e){if(t instanceof HTMLSelectElement){const n=t.options;for(let i=0,r=n.length;i<r;i++)n[i].value==e?n[i].selected=!0:n[i].selected=!1}}static changeRadioChecked(t,e){t instanceof HTMLInputElement&&(t.value==e?t.checked=!0:t.checked=!1)}static entity2text(t){const e={lt:60,"lt;":60,"AMP;":38,AMP:38,"GT;":62,GT:62,"QUOT;":34,QUOT:34,"apos;":39,"bull;":8226,"bullet;":8226,"copy;":169,copy:169,"deg;":176,deg:176};let n;return t.charAt(0)=="#"?t.charAt(1).toLowerCase()=="x"?n=parseInt(t.substring(2),16):n=parseInt(t.substring(1),10):n=e[t],n?String.fromCharCode(n):"&"+t}static waitForStyleSheetsLoaded=()=>new Promise(t=>{const e=Array.from(document.querySelectorAll("link[rel=stylesheet]"));let n=document.styleSheets.length||0;const i=()=>n>=e.length?(t(),!0):!1;i()||e.forEach(r=>{r.onload=()=>{n+=1,i()}})});static loadScript(t,e=()=>{},n=(i,r,a,o,c)=>{}){const i=document.createElement("script");i.type="text/javascript",i.src=t,i.async=!1,i.onload=e,i.onerror=n,document.body.appendChild(i)}static runInSafe(t){const e=new Proxy(window,{get(n,i,r){if(typeof i=="string"&&["open","location","document"].includes(i))throw new Error(`禁止访问 key: ${i}`);return i==="window"?e:Reflect.get(n,i,r)},set(n,i,r,a){return Reflect.set(n,i,r,a)}});new Function("window",`with(window) { ${t} }`)(e,null)}static dom=new Proxy({},{get(t,e){return function(n={},...i){const r=document.createElement(e);for(const a of Object.keys(n))r.setAttribute(a,n[a]);for(const a of i)typeof a=="string"?r.appendChild(document.createTextNode(a)):r.appendChild(a);return r}}});static compileTemplate(t){return t=t.replace(/<%=(.+?)%>/g,"`); \n echo( $1 ); \n echo(`").replace(/<%([\s\S]+?)%>/g,"`); \n $1 \n echo(`"),t="echo(`"+t+"`);",`(function parse(data){
|
|
10
|
+
`.replace(/\s+/g,""),"u");break;case"mime-image":t=/^image\//;break;case"mime-video":t=/^video\//;break;case"mime-audio":t=/^audio\//;break;case"mime-document-word":t=/^application\/(?:vnd\.openxmlformats-officedocument\.wordprocessingml\.document|msword|vnd\.ms-word\.document\.macroenabled\.12|vnd\.openxmlformats-officedocument\.wordprocessingml\.template|vnd\.ms-word\.template\.macroenabled\.12)$/;break;case"mime-document-excel":t=/^application\/(?:vnd\.openxmlformats-officedocument\.spreadsheetml\.sheet|vnd\.ms-excel|vnd\.ms-excel\.sheet\.macroenabled\.12|vnd\.openxmlformats-officedocument\.spreadsheetml\.template|vnd\.ms-excel\.template\.macroenabled\.12)$/;break;case"mime-document-ppt":t=/^application\/(?:vnd\.ms-powerpoint|vnd\.openxmlformats-officedocument\.presentationml\.presentation|vnd\.ms-powerpoint\.presentation\.macroenabled\.12|vnd\.openxmlformats-officedocument\.presentationml\.template|vnd\.ms-powerpoint\.template\.macroenabled\.12)$/;break;case"mime-document-json":t=/^application\/json$/;break;case"mime-document-xml":t=/^(?:application|text)\/(?:xml|xhtml\+xml)$/;break}return t},Ot=(s,t)=>(typeof s=="string"&&(s=Cn(s)||new RegExp(s)),s.test(t)),Rr=(s,t)=>{typeof s=="string"&&(s=Cn(s)||new RegExp(s));const e=t.match(s);return e?s.flags.toLowerCase().indexOf("g")>=0?e.map(n=>({matchIndex:-1,fullMatch:n,groupMatchs:[]})):{matchIndex:typeof e.index=="number"?e.index:-1,fullMatch:e[0],groupMatchs:e.slice(1)}:null},Es=(s,t)=>{typeof s=="string"&&(s=Cn(s)||new RegExp(s));const e=[],n=t.matchAll(s);for(const i of n)e.push({matchIndex:typeof i.index=="number"?i.index:-1,fullMatch:i[0],groupMatchs:i.slice(1)});return e};function Ps(s){const t=s.match(/[\s\S]/gu);return t?t.length:0}function _s(s,t){const e=s.codePointAt(t);return e?String.fromCodePoint(e):void 0}function Or(){let s=new Date().getTime();return"xxxxxxxx_xxxx_xxxx_yxxx_xxxxxxxxxxxx".replace(/[xy]/g,function(e){const n=(s+Math.random()*16)%16|0;return s=Math.floor(s/16),(e=="x"?n:n&3|8).toString(16)})}function Lr(s){return s.replace(/(^\w)/g,function(t){return t.toLowerCase()})}const ft=(s,t="-")=>{const e=new RegExp(`${t}?([A-Z])`,"g");return s=s.replace(e,t+"$1").toLowerCase(),s.indexOf(t)==0?s.slice(1):s};function Tn(s){return s.replace(/(^\w|[_-]\w)/g,function(t){return t.slice(-1).toUpperCase()})}function Ds(s){return Lr(Tn(s))}function Nr(s,t,e="0",n="left"){const i=Ps(s);if(t>i){const r=t-i;switch(n){case"left":s=Array(r+1).join(e)+s;break;case"right":s=s+Array(r+1).join(e);break;default:const a=Math.ceil(r/2),o=r-a;s=Array(o+1).join(e)+s+Array(a+1).join(e);break}}return s}function As(s){let t="";for(let e=0,n=s.length;e<n;e++){const i=s.charCodeAt(e);i>=1&&i<=127?t+=s.charAt(e):i>2047?(t+=String.fromCharCode(224|i>>12&15),t+=String.fromCharCode(128|i>>6&63),t+=String.fromCharCode(128|i>>0&63)):(t+=String.fromCharCode(192|i>>6&31),t+=String.fromCharCode(128|i>>0&63))}return t}var Lt=(s=>(s.UNKNOWN="",s.HTML="text/html",s.CSS="text/css",s.TEXT="text/plain",s.MD="text/plain",s.JPEG="image/jpeg",s.PNG="image/png",s.GIF="image/gif",s.WEBP="image/webp",s.SVG="image/svg+xml",s.ICO="image/x-icon",s.MPEG="audio/mpeg",s.MP3="audio/mpeg",s.OGG="audio/ogg",s.WAV="audio/wav",s.MP4="video/mp4",s.WEBM="video/webm",s.JSON="application/json",s.XWWW="application/x-www-form-urlencoded",s.XHTML="application/xhtml+xml",s.XML="application/xml",s.XML_TEXT="text/xml",s.JAVASCRIPT="application/javascript",s.ECMASCRIPT="application/ecmascript",s.DOC="application/msword",s.CSV="application/x-csv",s.EXCEL="application/vnb.ms-excel",s.PDF="application/pdf",s.ZIP="application/zip",s.TGZ="application/x-gtar",s.TAR_GZ="application/x-gzip",s.EOT="appliaction/vnd.ms-fontobject",s.TTF="aplication/font-sfnt",s))(Lt||{});const Fr=(s,t=16)=>s.toString(t),$t=(s,t=16)=>{let e=s.toLowerCase();const n=e.indexOf("0b")==0,i=e.indexOf("0o")==0,r=e.indexOf("0x")==0;(n||i||r)&&(e=e.slice(2));const a=parseInt(e,t);if(isNaN(a))throw new Error(`radixStringToNumber(${s}, ${t}) 无法解析!`);return a};function ks(s,t){if(s instanceof ArrayBuffer)return Array.from(new Uint8Array(s));let e=[];if(Array.isArray(s))return s.forEach(n=>{typeof n=="number"?e.push(n):e=e.concat(ks(n,t))}),e;if(typeof s=="number")for(;s>0;){const n=s&255;e.unshift(n),s=(s-n)/256}if(typeof s=="string")if(t){let n=s.toLowerCase();switch(t){case 16:default:n.indexOf("0x")==0&&(n=n.slice(2));for(let i=0,r=n.length;i<r;i+=2)e.push($t(n.slice(i,i+2),t));break}}else for(const n of s){const i=n.codePointAt(0);i&&e.push(i)}return e}function Br(s,t){const e=ks(s,t);let n="";for(let i=0,r=e.length;i<r;i++)n+=Fr(e[i],16).padStart(2,"0");return n}function Ur(){const s=Uint32Array.of(305419896),t=new Uint8Array(s.buffer);switch(t[0]*16777216+t[1]*65536+t[2]*256+t[3]){case 305419896:return!1;case 2018915346:return!0}}const Is=s=>{let t=Lt.UNKNOWN;switch(new DataView(s).getUint32(0,Ur()).toString(16).toUpperCase()){case"FFD8FFDB":t=Lt.JPEG;break;case"FFD8FFE0":case"FFD8FFE1":case"FFD8FFE2":case"FFD8FFE3":t=Lt.JPEG;break;case"89504E47":t=Lt.PNG;break;case"47494638":t=Lt.GIF;break;case"52494646":t=Lt.WEBP;break;case"25504446":t=Lt.PDF;break;case"504B0304":t=Lt.ZIP;break}return t};function Ms(s){const t=typeof s;return t!=="object"?t:Object.prototype.toString.call(s).replace(/^\[object (\S+)\]$/,"$1").toLowerCase()}function Vr(s){return Ms(s)==="array"}function Rs(s){return Ms(s)==="object"}function Ve(s,t){for(const e of Reflect.ownKeys(t))if(e!=="constructor"&&e!=="prototype"&&e!=="name"&&e!=="displayName"){const n=Object.getOwnPropertyDescriptor(t,e);n&&Object.defineProperty(s,e,n)}}function Gr(s,t){const e=Object.getPrototypeOf(s),n=Object.getPrototypeOf(t);for(const i of Reflect.ownKeys(n))if(!Object.prototype.hasOwnProperty.call(e,i)){const r=Object.getOwnPropertyDescriptor(n,i);r&&Object.defineProperty(e,i,r)}}function Os(s,t=new WeakMap){if(s==null)return s;if(s.constructor===Date)return new Date(s);if(s.constructor===RegExp)return new RegExp(s);if(typeof s!="object")return s;if(t.has(s))return t.get(s);const e=Object.create(Object.getPrototypeOf(s),Object.getOwnPropertyDescriptors(s));for(const n of Reflect.ownKeys(s))e[n]=Rs(s[n])?Os(s[n],t):s[n];return t.set(s,e),e}function zr(s){if(s=parseFloat(s),isNaN(s))throw new Error(`${s}不能转换为number!`);return s}function ue(s,t,e=Number.EPSILON*Math.pow(2,2)){return Math.abs(s-t)<e}const yt=(s,t,e)=>s<t?t:s>e?e:s;function Jt(s,t=12){return+zr(s).toFixed(t)}function jr(s){const t=Rr("number",s);return t?Array.isArray(t)?t.map(e=>Number(e.fullMatch)):[Number(t.fullMatch)]:[]}function Xr(s,t){let e;return function(...n){clearTimeout(e),e=setTimeout(()=>{s.apply(this,n)},t)}}class Ls{events;constructor(){this.events={}}on(t,e){return this.events[t]||(this.events[t]=[]),this.events[t].push(e),this}addListener(t,e){return this.on(t,e),this}prependListener(t,e){return this.events[t]||(this.events[t]=[]),this.events[t].unshift(e),this}removeListener(t,e){if(this.events[t])return this.events[t]=this.events[t].filter(n=>n!==e),this}off(t,e){return this.removeListener(t,e),this}removeAllListeners(t){return t?this.events[t]=[]:this.events={},this}emit(t,...e){return this.events[t]&&this.events[t].forEach(n=>{Reflect.apply(n,this,e)}),this}once(t,e){const i=(()=>{let r=!1;return(...a)=>{r||(r=!0,Reflect.apply(e,this,a),this.off(t,i))}})();return this.on(t,i),this}}var Ns=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function qr(s,t={}){var e=1,n=1;function i(k){var _=k.match(/\n/g);_&&(e+=_.length);var F=k.lastIndexOf(`
|
|
11
|
+
`);n=~F?k.length-F:n+k.length}function r(){var k={line:e,column:n};return function(_){return _.position=new a(k),m(),_}}function a(k){this.start=k,this.end={line:e,column:n},this.source=t.source}a.prototype.content=s;var o=[];function c(k){var _=new Error(t.source+":"+e+":"+n+": "+k);if(_.reason=k,_.filename=t.source,_.line=e,_.column=n,_.source=s,t.silent)o.push(_);else throw _}function h(){var k=g();return{type:"stylesheet",stylesheet:{source:t.source,rules:k,parsingErrors:o}}}function l(){return w(/^{\s*/)}function f(){return w(/^}/)}function g(){var k,_=[];for(m(),v(_);s.length&&s.charAt(0)!="}"&&(k=U()||A());)k!==!1&&(_.push(k),v(_));return _}function w(k){var _=k.exec(s);if(_){var F=_[0];return i(F),s=s.slice(F.length),_}}function m(){w(/^\s*/)}function v(k){var _;for(k=k||[];_=b();)_!==!1&&k.push(_);return k}function b(){var k=r();if(!(s.charAt(0)!="/"||s.charAt(1)!="*")){for(var _=2;s.charAt(_)!=""&&(s.charAt(_)!="*"||s.charAt(_+1)!="/");)++_;if(_+=2,s.charAt(_-1)==="")return c("End of comment missing");var F=s.slice(2,_-2);return n+=2,i(F),s=s.slice(_),n+=2,k({type:"comment",comment:F})}}function S(){var k=w(/^([^{]+)/);if(k)return Nt(k[0]).replace(/\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*\/+/g,"").replace(/"(?:\\"|[^"])*"|'(?:\\'|[^'])*'/g,function(_){return _.replace(/,/g,"")}).split(/\s*(?![^(]*\)),\s*/).map(function(_){return _.replace(/\u200C/g,",")})}function C(){var k=r(),_=w(/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(_){if(_=Nt(_[0]),!w(/^:\s*/))return c("property missing ':'");var F=w(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/),G=k({type:"declaration",property:_.replace(Ns,""),value:F?Nt(F[0]).replace(Ns,""):""});return w(/^[;\s]*/),G}}function M(){var k=[];if(!l())return c("missing '{'");v(k);for(var _;_=C();)_!==!1&&(k.push(_),v(k));return f()?k:c("missing '}'")}function R(){for(var k,_=[],F=r();k=w(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/);)_.push(k[1]),w(/^,\s*/);if(_.length)return F({type:"keyframe",values:_,declarations:M()})}function B(){var k=r(),_=w(/^@([-\w]+)?keyframes\s*/);if(_){var F=_[1];if(_=w(/^([-\w]+)\s*/),!_)return c("@keyframes missing name");var G=_[1];if(!l())return c("@keyframes missing '{'");for(var St,Ht=v();St=R();)Ht.push(St),Ht=Ht.concat(v());return f()?k({type:"keyframes",name:G,vendor:F,keyframes:Ht}):c("@keyframes missing '}'")}}function N(){var k=r(),_=w(/^@supports *([^{]+)/);if(_){var F=Nt(_[1]);if(!l())return c("@supports missing '{'");var G=v().concat(g());return f()?k({type:"supports",supports:F,rules:G}):c("@supports missing '}'")}}function W(){var k=r(),_=w(/^@host\s*/);if(_){if(!l())return c("@host missing '{'");var F=v().concat(g());return f()?k({type:"host",rules:F}):c("@host missing '}'")}}function it(){var k=r(),_=w(/^@media *([^{]+)/);if(_){var F=Nt(_[1]);if(!l())return c("@media missing '{'");var G=v().concat(g());return f()?k({type:"media",media:F,rules:G}):c("@media missing '}'")}}function q(){var k=r(),_=w(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(_)return k({type:"custom-media",name:Nt(_[1]),media:Nt(_[2])})}function nt(){var k=r(),_=w(/^@page */);if(_){var F=S()||[];if(!l())return c("@page missing '{'");for(var G=v(),St;St=C();)G.push(St),G=G.concat(v());return f()?k({type:"page",selectors:F,declarations:G}):c("@page missing '}'")}}function Y(){var k=r(),_=w(/^@([-\w]+)?document *([^{]+)/);if(_){var F=Nt(_[1]),G=Nt(_[2]);if(!l())return c("@document missing '{'");var St=v().concat(g());return f()?k({type:"document",document:G,vendor:F,rules:St}):c("@document missing '}'")}}function $(){var k=r(),_=w(/^@font-face\s*/);if(_){if(!l())return c("@font-face missing '{'");for(var F=v(),G;G=C();)F.push(G),F=F.concat(v());return f()?k({type:"font-face",declarations:F}):c("@font-face missing '}'")}}var ht=V("import"),rt=V("charset"),j=V("namespace");function V(k){var _=new RegExp("^@"+k+"\\s*([^;]+);");return function(){var F=r(),G=w(_);if(G){var St={type:k};return St[k]=G[1].trim(),F(St)}}}function U(){if(s[0]=="@")return B()||it()||q()||N()||ht()||rt()||j()||Y()||nt()||W()||$()}function A(){var k=r(),_=S();return _?(v(),k({type:"rule",selectors:_,declarations:M()})):c("selector missing")}return En(h())}function Nt(s){return s?s.replace(/^\s+|\s+$/g,""):""}function En(s,t){var e=s&&typeof s.type=="string",n=e?s:t;for(var i in s){var r=s[i];Array.isArray(r)?r.forEach(function(a){En(a,n)}):r&&typeof r=="object"&&En(r,n)}return e&&Object.defineProperty(s,"parent",{configurable:!0,writable:!0,enumerable:!1,value:t||null}),s}const Fs=crypto.subtle;Fs||console.warn("Crypto API not supported");function Yr(s){return new TextEncoder().encode(s)}async function Hr(s,t="SHA-256"){const e=await Fs.digest(t,Yr(s));return Br(e)}async function Wr(s,t="SHA-256"){const e=JSON.stringify(s);return Hr(e,t)}const Pn=(s,t="image/svg+xml",e="utf-8")=>e==="base64"?new Blob([s],{type:`${t};${e}`}):new Blob([s],{type:`${t};charset=${e}`}),_n=s=>new XMLSerializer().serializeToString(s),$r=(s,t="text/html")=>new DOMParser().parseFromString(s,t),Bs=(s,t="image/svg+xml",e="utf-8")=>Pn(_n(s),t,e),Dn=(s,t)=>{const e=document.createElement("a");e.style.visibility="hidden",document.body.appendChild(e),e.download=t,typeof s=="string"?e.href=s:e.href=window.URL.createObjectURL(s),e.click(),document.body.removeChild(e),window.URL.revokeObjectURL(e.href)};function Us(s=["*"],t){return new Promise((e,n)=>{if(!globalThis.document||!(globalThis.document instanceof Document))return n(new Error("This is not a browser environment"));const i=globalThis.document.createElement("input");i.setAttribute("type","file"),i.setAttribute("visibility","hidden"),Array.isArray(s)&&s.length>0&&i.setAttribute("accept",s.join(",")),t&&i.setAttribute("multiple","true"),globalThis.addEventListener("focus",()=>{setTimeout(()=>{(!i.files||i.files?.length===0)&&n(new Error("Cancel select"))},1e3)},{once:!0});const r=()=>{if(i.removeEventListener("change",r),!i.files||i.files?.length===0)n(new Error("Cancel select"));else{const a=Array.from(i.files);!s.includes("*")&&a.some(o=>!s.includes(`.${Vs(o)}`))&&n(new Error(`Please select files in ${s} format`)),i.remove(),e(a)}};i.addEventListener("change",r),i.click()})}function Ge(s,t="text",e){return new Promise((n,i)=>{const r=new FileReader;switch(r.addEventListener("progress",a=>{e?.(a.loaded,a.total)}),r.addEventListener("load",a=>{n(a.target?.result)}),r.addEventListener("error",a=>{i(a)}),t){case"dataURL":r.readAsDataURL(s);break;case"binaryString":r.readAsBinaryString(s);break;case"arrayBuffer":r.readAsArrayBuffer(s);break;case"text":default:r.readAsText(s)}})}async function Jr(s){const t=await Ge(s,"arrayBuffer");return Is(t)}const Vs=s=>{let t;return s instanceof File?t=s.name:t=s,t.match(/\.([0-9a-z]+)(?:[\\?#]|$)/i)?.[1]??""};function Zr(s){typeof queueMicrotask=="function"?queueMicrotask(s):Promise.resolve().then(s).catch(t=>setTimeout(()=>{throw t}))}function Kr(s,t={},e=[]){return{tag:s,props:t,children:e}}function fe(s,t){if(s.el)return;const e=s.el=document.createElement(s.tag);if(s.props)for(const n in s.props){const i=s.props[n];n.startsWith("on")?e.addEventListener(n.slice(2).toLowerCase(),i):e.setAttribute(n,i)}s.children&&(typeof s.children=="string"?e.textContent=s.children:s.children.forEach(n=>{fe(n,e)})),t.appendChild(e)}function Gs(s,t){if(s.tag!==t.tag){if(!s.el)return;const e=s.el.parentElement||document.body;e.removeChild(s.el),fe(t,e)}else{const e=t.el=s.el;if(!e)return;const n=s.props,i=t.props;for(const o in n)o in i||(o.startsWith("on")?e.removeEventListener(o.slice(2).toLowerCase(),n[o]):e.removeAttribute(o));for(const o in i){const c=n[o],h=i[o];h!=c&&(o.startsWith("on")?e.addEventListener(o.slice(2).toLowerCase(),h):e.setAttribute(o,h))}const r=s.children||[],a=t.children||[];if(typeof a=="string")e.innerHTML=a;else if(typeof r=="string")e.innerHTML="",a.forEach(o=>{fe(o,e)});else{const o=Math.min(r.length,a.length);for(let c=0;c<o;c++)Gs(r[c],a[c]);a.length>r.length&&a.slice(r.length).forEach(c=>{fe(c,e)}),a.length<r.length&&r.slice(a.length).forEach(c=>{c.el&&e.removeChild(c.el)})}}}function zs(s,t,e){if(!s){e&&t&&e.appendChild(t);return}if(!s.isEqualNode(t)){if(s.nodeName!==t.nodeName){e.replaceChild(t,s);return}if(s.nodeType===Node.TEXT_NODE){s.textContent!==t.textContent&&(s.textContent=t.textContent);return}for(let n=s.attributes.length-1;n>=0;n--){const i=s.attributes[n].name;!t.hasAttribute(i)&&i!=="open"&&s.removeAttribute(i)}for(let n=0;n<t.attributes.length;n++){const i=t.attributes[n].name,r=t.attributes[n].value;s.setAttribute(i,r)}for(let n=0;n<t.childNodes.length;n++)s.childNodes[n]?zs(s.childNodes[n],t.childNodes[n],s):s.appendChild(t.childNodes[n].cloneNode(!0));for(;s.childNodes.length>t.childNodes.length;)s.lastChild&&s.removeChild(s.lastChild)}}class Qr{url;socket;waitingResponse={};sendMessageQueue=[];constructor(t){this.url=t,this.createSocket()}createSocket(){console.log("Socket Create Attempted"),this.socket=new WebSocket(this.url),this.socket.onopen=()=>{this.sendMessageQueue.forEach(t=>this.socket?.send(t)),this.sendMessageQueue=[]},this.socket.onclose=t=>{const{code:e,reason:n,wasClean:i}=t;console.log(`ws closed : ${e} ${n} ${i}`)},this.socket.onerror=t=>{console.log(`ws error : ${t.type}`)},this.socket.onmessage=t=>{this.processMessage(t)}}recreateSocket(t){console.log("Socket Recreate Attempted"),this.sendMessageQueue.push(t),this.createSocket()}closeSocket(){this.socket&&(this.socket.close(),console.log("Socket closed"))}openSocket(){this.createSocket(),console.log("Socket opened manually")}sendWithRetry(t){this.socket?.readyState===WebSocket.OPEN?this.socket.send(t):this.recreateSocket(t)}async processMessage(t){if(typeof t.data=="string")try{const e=JSON.parse(t.data);if(Object.prototype.hasOwnProperty.call(e,"requestid")){const n=this.waitingResponse[e.requestid];n?n.resolve?.(e):console.warn("Got data but found no associated request, already timed out?",e)}else console.warn("Got data without request id",e)}catch{console.log(`Received String : ${t.data}`)}else t.data instanceof ArrayBuffer?console.log(`Received ArrayBuffer : ${t.data}`):t.data instanceof Blob&&console.log(`Received Blob : ${t.data}`)}async sendPayload(t){const e=+new Date,n=this.waitingResponse[e]={requestid:e};try{let i;t instanceof Blob||t instanceof ArrayBuffer||typeof t=="string"?i=t:i=JSON.stringify({...n,...t});const r=await new Promise((a,o)=>{n.resolve=a,this.sendWithRetry(i),setTimeout(()=>{o("Timeout")},5e3)});return console.info("Time took",(+new Date-n.requestid)/1e3),r}catch(i){return Promise.reject(i)}finally{delete this.waitingResponse[e]}}async send(t,e,n=i=>{console.log(i)}){this.sendPayload(t).then(e,n)}}function ta(){const s=window.screen;return{screenWidth:s.width,screenHeight:s.height,screenX:window.screenX,screenY:window.screenY}}function ea(){const s=document.body;return{clientWidth:s.clientWidth,clientHeight:s.clientHeight,clientTop:s.clientTop,clientLeft:s.clientLeft,scrollWidth:s.scrollWidth,scrollHeight:s.scrollHeight,scrollTop:s.scrollTop,scrollLeft:s.scrollLeft,pageX:s.getBoundingClientRect().x,pageY:s.getBoundingClientRect().y}}function ee(){const s=document.documentElement;return{clientWidth:s.clientWidth,clientHeight:s.clientHeight,clientTop:s.clientTop,clientLeft:s.clientLeft,scrollWidth:s.scrollWidth,scrollHeight:s.scrollHeight,scrollTop:s.scrollTop,scrollLeft:s.scrollLeft,offsetWidth:s.offsetWidth,offsetHeight:s.offsetHeight,offsetTop:s.offsetTop,offsetLeft:s.offsetLeft,offsetParent:s.offsetParent,clientX:s.getBoundingClientRect().x,clientY:s.getBoundingClientRect().y}}function na(){const{clientWidth:s,clientHeight:t}=ee();return{width:s||window.innerWidth,height:t||window.innerHeight}}function sa(){const{scrollWidth:s,scrollHeight:t}=ee();return{width:s,height:t}}function js(s){const{top:t,left:e}=s.getBoundingClientRect(),{scrollLeft:n,scrollTop:i}=ee();return{x:e+n,y:t+i}}function ia(s){return{x:Xs(s),y:qs(s)}}function Xs(s){let t=0;for(;s!==null;)t+=s.offsetLeft,s=s.offsetParent;return t}function qs(s){let t=0;for(;s!==null;)t+=s.offsetTop,s=s.offsetParent;return t}function ra(s){const t=s.getBoundingClientRect();return{x:t.left,y:t.top}}function aa(s,t){const e=s.getBoundingClientRect(),n=t.getBoundingClientRect();return{x:n.x-e.x,y:n.y-e.y,width:n.width||n.right-n.left,height:n.height||n.bottom-n.top}}function oa(){const{clientHeight:s,scrollTop:t,scrollHeight:e}=ee(),n=e-s;return n<=0?0:t/n*100}function ca(s){return{x:s.clientX,y:s.clientY}}function Ys(s){if("center"in s)return s.center;if(s.pageX&&s.pageY)return{x:s.pageX,y:s.pageY};const{scrollLeft:t,scrollTop:e}=ee();return{x:s.clientX+t,y:s.clientY+e}}function Hs(s,t){const e=Ys(t),n=js(s);return{x:e.x-n.x,y:e.y-n.y}}function An(){return typeof window<"u"?window:this||{}}const ze=()=>{const s=navigator.userAgent.toLowerCase();let t="Unknown";return/mac/i.test(s)?t="macOS":/win/i.test(s)?t="Windows":/android/i.test(s)?t="Android":/iphone|ipad|ipod/i.test(s)?t="iOS":/linux/i.test(s)?t="Linux":/bsd/i.test(s)&&(t="BSD"),t.toLowerCase()},ha=()=>{const s=navigator.userAgent;let t="Unknown";if(/Windows NT/.test(s)){const e=s.match(/Windows NT (\d+\.\d+)/);e&&(t=e[1])}else if(/Mac OS X/.test(s)){const e=s.match(/Mac OS X (\d+_\d+)/);e&&(t=e[1].replace("_","."))}else if(/Android/.test(s)){const e=s.match(/Android (\d+\.\d+)/);e&&(t=e[1])}else if(/iPhone|iPad|iPod/.test(s)){const e=s.match(/OS (\d+_\d+)/);e&&(t=e[1].replace("_","."))}return t.toLowerCase()},kn=()=>{const s=navigator.userAgent.toLowerCase();let t="Unknown";return/opr/i.test(s)||/opera/i.test(s)?t="Opera":/chrome/i.test(s)?t="Chrome":/firefox/i.test(s)?t="Firefox":/safari/i.test(s)?t="Safari":/edge/i.test(s)?t="Edge":/msie|trident/i.test(s)?t="IE":/MicroMessenger/i.test(s)?t="Wechat":/alipay/i.test(s)&&(t="Ali"),t.toLowerCase()},la=()=>{const s=navigator.userAgent;let t="Unknown";if(/Chrome/.test(s)){const e=s.match(/Chrome\/(\d+\.\d+)/);e&&(t=e[1])}else if(/Firefox/.test(s)){const e=s.match(/Firefox\/(\d+\.\d+)/);e&&(t=e[1])}else if(/Safari/.test(s)){const e=s.match(/Version\/(\d+\.\d+)/);e&&(t=e[1])}else if(/Edge/.test(s)){const e=s.match(/Edge\/(\d+\.\d+)/);e&&(t=e[1])}else if(/MSIE|Trident/.test(s)){const e=s.match(/(?:MSIE|rv:)(\d+\.\d+)/);e&&(t=e[1])}return t},ua=()=>"geolocation"in navigator?new Promise((s,t)=>{navigator.geolocation.getCurrentPosition(e=>{const n=e.coords.latitude,i=e.coords.longitude;s({latitude:n,longitude:i})},e=>{t(e)})}):Promise.reject("Geolocation is not available.");function fa(){return(navigator.browserLanguage||navigator.language).toLowerCase()}function da(){return Intl.DateTimeFormat().resolvedOptions().timeZone.toLowerCase()}function In(){return ze()==="ios"}function Mn(){return ze()==="macos"}function ma(){return In()|Mn()}function Ws(){return ze()==="android"}function pa(){return In()||Ws()}function ga(){return typeof window=="object"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches}function $s(){const s=window.navigator.userAgent,t=s.indexOf("MSIE ");if(t>0)return parseInt(s.substring(t+5,s.indexOf(".",t)),10);if(s.indexOf("Trident/")>0){const i=s.indexOf("rv:");return parseInt(s.substring(i+3,s.indexOf(".",i)),10)}const n=s.indexOf("Edge/");return n>0?parseInt(s.substring(n+5,s.indexOf(".",n)),10):-1}const ya=$s()!==-1;function wa(){const s=document.documentMode;return s&&(s===9||s===10)}function Js(){return kn()==="wechat"}function Zs(){return kn()==="ali"}function va(){return Js()&&navigator.userAgent.match(/miniprogram/i)||window.__wxjs_environment==="miniprogram"}function ba(){return Zs()&&navigator.userAgent.match(/miniprogram/i)}const xa=typeof document<"u",Ks=typeof window<"u",Sa=typeof history<"u",Ca=Ks&&window.File&&window.FileReader&&window.FileList&&window.Blob,Qs=(()=>{const s=An();return!!(s.Worker&&s.Blob&&s.Promise&&s.OffscreenCanvas&&s.OffscreenCanvasRenderingContext2D&&s.HTMLCanvasElement&&s.HTMLCanvasElement.prototype.transferControlToOffscreen&&s.URL&&s.URL.createObjectURL)})(),Ta=typeof Path2D=="function"&&typeof DOMMatrix=="function",Ea=function(){if(!An().OffscreenCanvas)return!1;var t=new OffscreenCanvas(1,1),e=t.getContext("2d");e.fillRect(0,0,1,1);var n=t.transferToImageBitmap();try{e.createPattern(n,"no-repeat")}catch{return!1}return!0}();function Pa(s){const t=document.documentElement,e=window.top===window.self?window.devicePixelRatio:1;t.dataset.dpr=e;let n=100;const i=function(){const r=Math.min(t.clientWidth,s);t.dataset.width=r,t.dataset.rem=n=Math.round(100*(r/s)),t.style.fontSize=n+"px"};i(),window.rem2px=function(r){return r=parseFloat(r),r*n},window.px2rem=function(r){return r=parseFloat(r),r/n},window.addEventListener&&window.addEventListener("orientationchange"in window?"orientationchange":"resize",i,!1)}function ot(s){return s*Math.PI/180}function Q(s){return s*180/Math.PI}function je(s,t,e=0){return Math.sqrt(s*s+t*t+e*e)}function Rn(s,t,e,n){const i=s-e,r=t-n;return je(i,r)}function de(s,t,e,n){const i=e-s,r=n-t;let a=Math.atan2(r,i);return a<0&&(a+=Math.PI*2),a}function zt(s,t){return{x:Math.cos(s)*t,y:Math.sin(s)*t}}function _a(s,t){const e=Math.sqrt(Math.pow(s,2)+Math.pow(t,2));return{x:s/=e,y:t/=e}}function Da(s,t,e,n,i=10){if(Math.abs(e-s)<i&&Math.abs(n-t)<i)return"no";const r=Q(de(s,t,e,n));return r>=-135&&r<=-45?"up":r>45&&r<135?"down":r>=135&&r<=180||r>=-180&&r<-135?"left":r>=-45&&r<=45?"right":"no"}const ti=[1,0,0,1,0,0],ei=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];class tt{value;matrix3d;isEverTo3d=!1;constructor(t=ti){this.value=Array.from(t),this.matrix3d=this.toMatrix3D()}get m11(){return this.value[0]}get m12(){return this.value[1]}get m13(){return 0}get m21(){return this.value[2]}get m22(){return this.value[3]}get m23(){return 0}get m31(){return this.value[4]}get m32(){return this.value[5]}get m33(){return 1}toMatrix3D(t=this.matrix3d){const e=[this.value[0],this.value[1],0,0,this.value[2],this.value[3],0,0,0,0,1,0,this.value[4],this.value[5],0,1];return t?(t.value=e,t):new Zt(e)}unit(){return this.value=Array.from(ti),this.matrix3d=this.toMatrix3D(),this}multiplyPoint(t,e,n=0,i=0){const r=t-n,a=e-i;return t=this.m11*r+this.m21*a+this.m31,e=this.m12*r+this.m22*a+this.m32,{x:t+n,y:e+i}}fromString(t){const e=Es("number",t);return e.length===6?e.forEach((n,i)=>{n.fullMatch&&(this.value[i]=parseFloat(n.fullMatch))}):this.unit(),this}clone(){return new tt(this.value)}multiply(t){const e=this.value;let n;t instanceof tt?n=t.value:n=t;const i=e[0]*n[0]+e[2]*n[1],r=e[1]*n[0]+e[3]*n[1],a=e[0]*n[2]+e[2]*n[3],o=e[1]*n[2]+e[3]*n[3],c=e[0]*n[4]+e[2]*n[5]+e[4],h=e[1]*n[4]+e[3]*n[5]+e[5];return e[0]=i,e[1]=r,e[2]=a,e[3]=o,e[4]=c,e[5]=h,this}inverse(){const t=new tt(this.value),e=t.value,n=1/(e[0]*e[3]-e[1]*e[2]),i=e[3]*n,r=-e[1]*n,a=-e[2]*n,o=e[0]*n,c=n*(e[2]*e[5]-e[3]*e[4]),h=n*(e[1]*e[4]-e[0]*e[5]);return e[0]=i,e[1]=r,e[2]=a,e[3]=o,e[4]=c,e[5]=h,t}offset(t=0,e=0){return{x:t-this.m31,y:e-this.m32}}translate(t,e){return this.multiply([1,0,0,1,t,e]),this.toMatrix3D(),this}translateTo(t,e){const n=this.offset(t,e);return this.translate(n.x,n.y)}translateX(t){return this.translate(t,0)}translateXTo(t){return this.translateTo(t,this.m32)}translateY(t){return this.translate(0,t)}translateYTo(t){return this.translateTo(this.m31,t)}translateZ(t){return this.isEverTo3d=!0,this.matrix3d.translate(0,0,t),this.matrix3d.toMatrix(this),this}translateZTo(t){return this.translateZ(t-this.matrix3d.m43),this}translate3d(t,e,n){return this.isEverTo3d=!0,this.matrix3d.translate(t,e,n),this.matrix3d.toMatrix(this),this}translate3dTo(t,e,n){return this.translate3d(t-this.matrix3d.m41,e-this.matrix3d.m42,n-this.matrix3d.m43),this}rotate(t,e=0,n=0){const i=ot(t),r=Math.cos(i),a=Math.sin(i);return this.multiply([r,a,-a,r,e,n]),this.translate(-e,-n),this.toMatrix3D(),this}rotateTo(t,e=0,n=0){const{rotateZ:i}=this.matrix3d.split();return this.rotate(t-i,e,n),this}rotateX(t){return this.isEverTo3d=!0,this.matrix3d.rotate("x",t),this.matrix3d.toMatrix(this),this}rotateXTo(t){const{rotateX:e}=this.matrix3d.split();return this.rotateX(t-e),this}rotateY(t){return this.isEverTo3d=!0,this.matrix3d.rotate("y",t),this.matrix3d.toMatrix(this),this}rotateYTo(t){const{rotateY:e}=this.matrix3d.split();return this.rotateY(t-e),this}rotateZ(t){return this.isEverTo3d=!0,this.matrix3d.rotate("z",t),this.matrix3d.toMatrix(this),this}rotateZTo(t){const{rotateZ:e}=this.matrix3d.split();return this.rotateZ(t-e),this}rotate3d(t,e,n){return this.isEverTo3d=!0,this.matrix3d.rotate("x",t).rotate("y",e).rotate("z",n),this.matrix3d.toMatrix(this),this}rotate3dTo(t,e,n){const{rotateX:i,rotateY:r,rotateZ:a}=this.matrix3d.split();return this.rotate3d(t-i,e-r,n-a),this}scale(t,e=t,n=0,i=0){return this.translate(n,i),this.multiply([t,0,0,e,0,0]),this.translate(-n,-i),this.toMatrix3D(),this}scaleTo(t,e=t,n=0,i=0){return this.scale(t/this.m11,e/this.m22,n,i)}scaleX(t){return this.scale(t,1)}scaleXTo(t){return this.scale(t/this.m11,1)}scaleY(t){return this.scale(1,t)}scaleYTo(t){return this.scale(1,t/this.m22)}scaleZ(t){return this.isEverTo3d=!0,this.matrix3d.scale(1,1,t),this.matrix3d.toMatrix(this),this}scaleZTo(t){const{scaleZ:e}=this.matrix3d.split();return this.scaleZ(t/e),this}scale3d(t,e=t,n=t){return this.isEverTo3d=!0,this.matrix3d.scale(t,e,n),this.matrix3d.toMatrix(this),this}scale3dTo(t,e=t,n=t){const{scaleX:i,scaleY:r,scaleZ:a}=this.matrix3d.split();return this.scale3d(t/i,e/r,n/a),this}skew(t,e=t){const n=Math.tan(ot(t)),i=Math.tan(ot(e));return this.multiply([1,i,n,1,0,0]),this.toMatrix3D(),this}skewTo(t,e=t){return this.skew(t-Q(this.m21),e-Q(this.m12))}skewX(t){return this.skew(t,Q(this.m12))}skewXTo(t){return this.skewTo(t,Q(this.m12))}skewY(t){return this.skew(Q(this.m21),t)}skewYTo(t){return this.skewTo(Q(this.m21),t)}skewZ(t){return this}skewZTo(t){return this}skew3d(t,e,n){return this}skew3dTo(t,e,n){return this}getGroupCoords(t){const e=this.value[0],n=this.value[1],i=this.value[2],r=this.value[3],a=this.value[4],o=this.value[5],c=t.value[0],h=t.value[1],l=t.value[2],f=t.value[3],g=t.value[4],w=t.value[5],m=c*f,v=h*l,b=(l*n-e*f)/(v-m),S=(c*n-e*h)/(m-v),C=(l*r-i*f)/(v-m),M=(c*r-i*h)/(m-v),R=(l*(o-w)+f*(g-a))/(v-m),B=(c*(o-w)+h*(g-a))/(m-v),N=[b,S,C,M,R,B];return new tt(N)}toString(){return this.isEverTo3d?this.matrix3d.toString():`matrix(${this.value.map(t=>Jt(t,6)).join(",")})`}toFilter(){return"progid:DXImageTransform.Microsoft.Matrix(M11="+this.value[0]+", M12="+this.value[2]+", M21="+this.value[1]+", M22="+this.value[3]+", Dx="+this.value[4]+", Dy="+this.value[5]+", sizingmethod='auto expand')"}}class Zt{value;constructor(t=ei){this.value=Array.from(t)}get m11(){return this.value[0]}get m12(){return this.value[1]}get m13(){return this.value[2]}get m14(){return this.value[3]}get m21(){return this.value[4]}get m22(){return this.value[5]}get m23(){return this.value[6]}get m24(){return this.value[7]}get m31(){return this.value[8]}get m32(){return this.value[9]}get m33(){return this.value[10]}get m34(){return this.value[11]}get m41(){return this.value[12]}get m42(){return this.value[13]}get m43(){return this.value[14]}get m44(){return this.value[15]}unit(){return this.value=Array.from(ei),this}fromString(t){const e=Es("number",t);return e.length===16?e.forEach((n,i)=>{n.fullMatch&&(this.value[i]=parseFloat(n.fullMatch))}):this.unit(),this}toMatrix(t){const{scaleX:e,scaleY:n,skewX:i,skewY:r,x:a,y:o}=this.split(),c=[e,r,i,n,a,o];return t?(t.value=c,t):new tt(c)}multiplyMatrix(t){const e=t.value[0],n=t.value[1],i=t.value[2],r=t.value[3],a=e*this.m11+n*this.m21+i*this.m31+r*this.m41,o=e*this.m12+n*this.m22+i*this.m32+r*this.m42,c=e*this.m13+n*this.m23+i*this.m33+r*this.m43,h=e*this.m14+n*this.m24+i*this.m34+r*this.m44;return new tt([a,o,c,h,0,0])}multiply(t){const e=new tt([t.value[0],t.value[1],t.value[2],t.value[3],0,0]),n=new tt([t.value[4],t.value[5],t.value[6],t.value[7],0,0]),i=new tt([t.value[8],t.value[9],t.value[10],t.value[11],0,0]),r=new tt([t.value[12],t.value[13],t.value[14],t.value[15],0,0]),a=this.multiplyMatrix(e),o=this.multiplyMatrix(n),c=this.multiplyMatrix(i),h=this.multiplyMatrix(r);return this.value[0]=a.value[0],this.value[1]=a.value[1],this.value[2]=a.value[2],this.value[3]=a.value[3],this.value[4]=o.value[0],this.value[5]=o.value[1],this.value[6]=o.value[2],this.value[7]=o.value[3],this.value[8]=c.value[0],this.value[9]=c.value[1],this.value[10]=c.value[2],this.value[11]=c.value[3],this.value[12]=h.value[0],this.value[13]=h.value[1],this.value[14]=h.value[2],this.value[15]=h.value[3],this}translate(t=0,e=0,n=0){return this.multiply(new Zt([1,0,0,0,0,1,0,0,0,0,1,0,t,e,n,1]))}scale(t=1,e=1,n=1){return this.multiply(new Zt([t,0,0,0,0,e,0,0,0,0,n,0,0,0,0,1]))}rotate(t,e){const n=ot(e),i=Math.sin,r=Math.cos;let a;switch(t){case"x":a=[1,0,0,0,0,r(n),i(n),0,0,-i(n),r(n),0,0,0,0,1];break;case"y":a=[r(n),0,-i(n),0,0,1,0,0,i(n),0,r(n),0,0,0,0,1];break;case"z":a=[r(n),i(n),0,0,-i(n),r(n),0,0,0,0,1,0,0,0,0,1];break}return this.multiply(new Zt(a))}toString(){return`matrix3d(${this.value.map(t=>Jt(t,6)).join(",")})`}split(){let t=Q(yt(Math.asin(-this.m13),-1,1)),e=Q(Math.atan2(this.m23,this.m33)),n=Q(Math.atan2(this.m12,this.m11));return Math.cos(t)===0&&(e=Q(Math.atan2(-this.m31,this.m22)),n=0),{x:this.m41,y:this.m42,z:this.m43,rotateX:e,rotateY:t,rotateZ:n,scaleX:Math.sqrt(this.m11*this.m11+this.m12*this.m12+this.m13*this.m13),scaleY:Math.sqrt(this.m21*this.m21+this.m22*this.m22+this.m23*this.m23),scaleZ:Math.sqrt(this.m31*this.m31+this.m32*this.m32+this.m33*this.m33),skewX:Q(this.m14),skewY:Q(this.m24),skewZ:Q(this.m34),skewW:this.m44}}inverse(){const t=[],e=this.m11,n=this.m12,i=this.m13,r=this.m14,a=this.m21,o=this.m22,c=this.m23,h=this.m24,l=this.m31,f=this.m32,g=this.m33,w=this.m34,m=this.m41,v=this.m42,b=this.m43,S=this.m44;t[0]=c*w*v-h*g*v+h*f*b-o*w*b-c*f*S+o*g*S,t[1]=r*g*v-i*w*v-r*f*b+n*w*b+i*f*S-n*g*S,t[2]=i*h*v-r*c*v+r*o*b-n*h*b-i*o*S+n*c*S,t[3]=r*c*f-i*h*f-r*o*g+n*h*g+i*o*w-n*c*w;const C=e*t[0]+a*t[1]+l*t[2]+m*t[3];if(C==0)return console.warn("Can't invert matrix, determinant is 0");t[4]=h*g*m-c*w*m-h*l*b+a*w*b+c*l*S-a*g*S,t[5]=i*w*m-r*g*m+r*l*b-e*w*b-i*l*S+e*g*S,t[6]=r*c*m-i*h*m-r*a*b+e*h*b+i*a*S-e*c*S,t[7]=i*h*l-r*c*l+r*a*g-e*h*g-i*a*w+e*c*w,t[8]=o*w*m-h*f*m+h*l*v-a*w*v-o*l*S+a*f*S,t[9]=r*f*m-n*w*m-r*l*v+e*w*v+n*l*S-e*f*S,t[10]=n*h*m-r*o*m+r*a*v-e*h*v-n*a*S+e*o*S,t[11]=r*o*l-n*h*l-r*a*f+e*h*f+n*a*w-e*o*w,t[12]=c*f*m-o*g*m-c*l*v+a*g*v+o*l*b-a*f*b,t[13]=n*g*m-i*f*m+i*l*v-e*g*v-n*l*b+e*f*b,t[14]=i*o*m-n*c*m-i*a*v+e*c*v+n*a*b-e*o*b,t[15]=n*c*l-i*o*l+i*a*f-e*c*f-n*a*g+e*o*g,this.value=t;const M=1/C;this.value.map(R=>R*M)}}function On(s){const t=new tt;return s.replace(/([a-z0-9]+)\s*\(?\s*((-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)*[a-z%]*\s*,?\s*)+)\)?/gi,function(e,n,i){i.indexOf(",")>=0?i=i.split(/\s*,\s*/):i=i.split(/\s+/);const r=[];for(let a=0,o=i.length;a<o;a++)i[a].trim()&&r.push(parseFloat(""+i[a]));switch(n.toLowerCase()){case"t":case"translate":t.translate(r[0],r[1]);break;case"translatex":t.translateX(r[0]);break;case"translatey":t.translateY(r[0]);break;case"translatez":t.translateZ(r[0]);break;case"translate3d":t.translate3d(r[0],r[1],r[2]);break;case"r":case"rotate":t.rotate(r[0],r[1]??0,r[2]??0);break;case"rotatex":t.rotateX(r[0]);break;case"rotatey":t.rotateY(r[0]);break;case"rotatez":t.rotateZ(r[0]);break;case"rotate3d":t.rotate3d(r[0],r[1],r[2]);break;case"s":case"scale":t.scale(r[0],r[1]??r[0]);break;case"scalex":t.scaleX(r[0]);break;case"scaley":t.scaleY(r[0]);break;case"scalez":t.scaleZ(r[0]);break;case"scale3d":t.scale3d(r[0],r[1],r[2]);break;case"skew":t.skew(r[0],r[1]??0);break;case"skewx":t.skewX(r[0]);break;case"skewy":t.skewY(r[0]);break;case"skewz":t.skewZ(r[0]);break;case"skew3d":t.skew3d(r[0],r[1],r[2]);break;case"m":case"matrix":t.multiply([r[0],r[1],r[2],r[3],r[4],r[5]]),t.toMatrix3D();break;case"matrix3d":t.matrix3d.multiply(new Zt(r)),t.matrix3d.toMatrix(t);break}return""}),t}function Et(s,t,e,n=0,i=0){const r=new tt;return r.rotate(Q(s),n,i),r.multiplyPoint(t,e,n,i)}class D{static onDocumentReady(t){let e=!1;function n(){document.readyState==="loading"||e||(e=!0,t(),document.removeEventListener("DOMContentLoaded",n))}typeof document<"u"&&(document.addEventListener("DOMContentLoaded",n),n())}static onBeforeUnload(t){function e(){t(),document.removeEventListener("beforeunload",e)}typeof document<"u"&&document.addEventListener("beforeunload",e)}static getCSSVar(t){return getComputedStyle(document.documentElement).getPropertyValue(t)}static setCSSVar(t,e){document.documentElement.style.setProperty(t,e)}static add3DSupport(t,e="1000px"){if(t.parentElement){const n=D.getStyle(t.parentElement,"position");D.setStyle(t.parentElement,{position:n=="static"?"relative":n,perspective:e})}D.setStyle(t,{"transform-style":"preserve-3d"})}static convertAttrs(t,e,n={}){n.hasOwnProperty("transform")||Object.assign(n,{transform:D.getStyle(t,"transform")||""});const i=On(n.transform),r={};for(let a in e){const o=e[a];switch(a){case"transform":break;case"translate":i.translate(o[0]||0,o[1]||0);break;case"translateTo":i.translateTo(o[0]||0,o[1]||0);break;case"translateX":i.translateX(o||0);break;case"translateXTo":i.translateXTo(o||0);break;case"translateY":i.translateY(o||0);break;case"translateYTo":i.translateYTo(o||0);break;case"translateZ":i.translateZ(o||0);break;case"translateZTo":i.translateZTo(o||0);break;case"translate3d":i.translate3d(o[0]||0,o[1]||0,o[2]||0);break;case"translate3dTo":i.translate3dTo(o[0]||0,o[1]||0,o[2]||0);break;case"rotate":typeof o=="number"?i.rotate(o||0):i.rotate(o[0]||0,o[1]||0,o[2]||0);break;case"rotateTo":typeof o=="number"?i.rotateTo(o||0):i.rotateTo(o[0]||0,o[1]||0,o[2]||0);break;case"rotateX":i.rotateX(o||0);break;case"rotateXTo":i.rotateXTo(o||0);break;case"rotateY":i.rotateY(o||0);break;case"rotateYTo":i.rotateYTo(o||0);break;case"rotateZ":i.rotateZ(o||0);break;case"rotateZTo":i.rotateZTo(o||0);break;case"rotate3d":i.rotate3d(o[0]||0,o[1]||0,o[2]||0);break;case"rotate3dTo":i.rotate3dTo(o[0]||0,o[1]||0,o[2]||0);break;case"scale":typeof o=="number"?i.scale(o||1):i.scale(o[0]||1,o[1]||1,o[2]||0,o[3]||0);break;case"scaleTo":typeof o=="number"?i.scaleTo(o||1):i.scaleTo(o[0]||1,o[1]||1,o[2]||0,o[3]||0);break;case"scaleX":i.scaleX(o||1);break;case"scaleXTo":i.scaleXTo(o||1);break;case"scaleY":i.scaleY(o||1);break;case"scaleYTo":i.scaleYTo(o||1);break;case"scaleZ":i.scaleZ(o||1);break;case"scaleZTo":i.scaleZTo(o||1);break;case"scale3d":typeof o=="number"?i.scale3d(o||1):i.scale3d(o[0]||1,o[1]||1,o[2]||1);break;case"scale3dTo":typeof o=="number"?i.scale3dTo(o||1):i.scale3dTo(o[0]||1,o[1]||1,o[2]||1);break;case"skew":typeof o=="number"?i.skew(o||0):i.skew(o[0]||0,o[1]||0);break;case"skewTo":typeof o=="number"?i.skewTo(o||0):i.skewTo(o[0]||0,o[1]||0);break;case"skewX":i.skewX(o||0);break;case"skewXTo":i.skewXTo(o||0);break;case"skewY":i.skewY(o||0);break;case"skewYTo":i.skewYTo(o||0);break;case"skewZ":break;case"skewZTo":break;case"skew3d":break;case"skew3dTo":break;default:n.hasOwnProperty(a)||(n[a]=D.getStyle(t,a)),Object.assign(r,{[a]:`${o}`});break}}return Object.assign(r,{transform:i.toString()}),r}static attrsToCanvas(t,e){for(const n in e){const i=e[n];switch(ft(n)){case"fill":i!=="none"&&(t.fillStyle=i);break;case"stroke":i!=="none"&&(t.strokeStyle=i);break;case"stroke-width":t.lineWidth=Number(i);break;case"stroke-linecap":t.lineCap=i;break;case"stroke-linejoin":switch(i){case"round":case"bevel":case"miter":t.lineJoin=i;break;default:t.lineJoin="miter";break}break;case"stroke-miterlimit":t.miterLimit=Number(i);break;case"stroke-opacity":break;case"cursor":break;case"font":t.font=i;break;case"font-size":t.font+=` ${i}`;break;case"font-family":t.font+=` ${i}`;break;case"font-weight":break;case"font-style":break;case"text-anchor":switch(i){case"middle":t.textAlign="center";break;case"end":t.textAlign="end";break;case"start":t.textAlign="start";break}break;case"alignment-baseline":switch(i){case"middle":case"bottom":case"top":case"alphabetic":case"hanging":case"ideographic":t.textBaseline=i;break;default:t.textBaseline="alphabetic";break}break}}}static getStyle(t,e,n){const i=t;if(getComputedStyle)if(e){e=ft(e);const r=getComputedStyle(i,n).getPropertyPriority(e);return getComputedStyle(i,n).getPropertyValue(e).trim()+(r?"!"+r:"")}else{const r=[],a=getComputedStyle(i,"");for(let o=0;o<a.length;o++)r.push(a[o]+":"+a.getPropertyValue(a[o]));return r.push(...(i.style.cssText||"").split(";")),Object.fromEntries(r.filter(o=>!!o).map(o=>o.split(":").map(c=>c.trim()))||[])}else if(t.currentStyle){if(e)return e=Ds(e),t.currentStyle[e];{const r=[],a=i.currentStyle;for(let o in a)r.push(o+":"+a[o]);return r.push(...(i.style.cssText||"").split(";")),Object.fromEntries(r.filter(o=>!!o).map(o=>o.split(":").map(c=>c.trim()))||[])}}}static setStyle(t,e,n){if(typeof e=="string"&&n){const i=String(n).toLowerCase().includes("!important")?"important":"";t.style.setProperty(ft(e),n.replace(/!important/i,""),i)}else e instanceof Object&&Object.keys(e).forEach(i=>{const r=String(e[i]).toLowerCase().includes("!important")?"important":"";t.style.setProperty(ft(i),String(e[i]).replace(/!important/i,""),r)})}static setStyleSheet(t,e){let n;if(typeof e=="string"){const r=document.querySelector(e)?.shadowRoot;r?n=r:n=document.querySelector(e)}else n=e;const i=document.createElement("style");if(i.innerHTML=t,n)return n.appendChild(i),()=>{(n instanceof HTMLElement||n instanceof ShadowRoot)&&n.removeChild(i)};{const r=document.styleSheets[0].insertRule(t);return()=>{document.styleSheets[0].deleteRule(r)}}}static toggleClass(t,e,n="toggle"){e.split(/[,\s]+/).forEach(i=>{i.trim()!==""&&t.classList[n](i.trim())})}static addClass(t,e){this.toggleClass(t,e,"add")}static removeClass(t,e){this.toggleClass(t,e,"remove")}static hasClass(t,e){return e.split(/[,\s]+/).every(n=>n.trim()!==""?Array.from(t.classList||[]).includes(n.trim()):!0)}static toggleDisplay(t,e){this.getStyle(t,"display")=="none"&&e===void 0||e===!0?t.style.setProperty("display",t instanceof HTMLTableRowElement?"table-row":t instanceof HTMLTableCellElement?"table-cell":"block"):t.style.setProperty("display","none")}static show(t){this.toggleDisplay(t,!0)}static hide(t){this.toggleDisplay(t,!1)}static attribute(t,e,n){let i={};if(e===void 0&&n===void 0){for(let r=0,a=t.attributes,o=a.length;r<o;r++){const c=a[r];c.nodeName&&c.nodeValue&&(i[c.nodeName]=c.nodeValue)}return i}if(typeof e=="string"&&n===void 0)return t.getAttribute(ft(e));typeof e=="object"?i=e:typeof e=="string"&&n!==void 0&&(i[e]=n),Object.entries(i).forEach(([r,a])=>{t.setAttribute(ft(r),a)})}static removeAttribute(t,e){e.split(/[,\s]+/).forEach(n=>{n.trim()!=""&&t.removeAttribute(n.trim())})}static fixProp(t){const e={cellpadding:"cellPadding",cellspacing:"cellSpacing",class:"className",colspan:"colSpan",contenteditable:"contentEditable",for:"htmlFor",frameborder:"frameBorder",maxlength:"maxLength",readonly:"readOnly",rowspan:"rowSpan",tabindex:"tabIndex",usemap:"useMap"};return e[t]?e[t]:t}static prop(t,e,n){if(n===void 0&&typeof e=="string")return t[e];{let i={};typeof e=="object"?i=e:typeof e=="string"&&n!==void 0&&(i[e]=n),Object.entries(i).forEach(([r,a])=>{const o=this.fixProp(r);t[o]=a,o=="innerHTML"&&this.scriptConvert(t)})}}static removeProp(t,e){e.split(/[,\s]+/).forEach(n=>{n.trim()!=""&&delete t[this.fixProp(n.trim())]})}static data(t,e,n){if(typeof e=="string"&&(e=Ds(e)),(typeof e=="string"||e===void 0)&&n===void 0){const i=Object.assign({},t.dataset);return Object.keys(i).forEach(r=>{if(i[r]?.startsWith("[")||i[r]?.startsWith("{"))try{i[r]=JSON.parse(i[r]||"")}catch{}}),typeof e=="string"?i[e]:i}else{let i={};typeof e=="object"?i=e:typeof e=="string"&&(i[e]=n),Object.entries(i).forEach(([r,a])=>{a!=null?t.dataset[r]=a instanceof Object?JSON.stringify(a):a:delete t.dataset[r]})}}static removeData(t,e){e.split(/[,\s]+/).forEach(n=>{n.trim()!=""&&delete t.dataset[n.trim()]})}static empty(t){this.html(t,"")}static html(t,e){e instanceof HTMLElement||e instanceof SVGElement?this.insert(t,e,"replaceWith"):this.prop(t,"innerHTML",e)}static text(t,e){return this.prop(t,"textContent",e)}static value(t,e){return this.prop(t,"value",e)}static dispatchEvent(t,e,n){let i;const r=["click","dblclick","mousedown","mouseup","mousemove"],a=["keydown","keyup","keypress"];typeof e=="string"?r.includes(e)?i=new MouseEvent(e,n):a.includes(e)?i=new KeyboardEvent(e,n):i=new Event(e,n):i=e,t.dispatchEvent(i)}static scriptConvert(t){const e=n=>{const r=n.ownerDocument.createElement("script");r.text=n.text;const a=n.attributes;for(let o=0;o<a.length;o++)r.setAttribute(a[o].name,a[o].value);return r};return t.tagName=="SCRIPT"&&(t=e(t)),t.querySelectorAll&&t.querySelectorAll("script").forEach(n=>{n.parentNode?.replaceChild(e(n),n)}),t}static fragment(t){const e=document.createElement("template");return e.innerHTML=t,e.content.childNodes.forEach(n=>{const i=this.scriptConvert(n);i!=n&&e.content.replaceChild(i,n)}),e.content}static insert(t,e,n="append"){return typeof e=="string"?t[n](this.fragment(e)):(e instanceof HTMLElement||e instanceof SVGElement)&&t[n](e),this}static createElement(t){return document.createElement.call(document,t)}static createTextNode(t){return document.createTextNode.call(document,t)}static createDocumentFragment(){return document.createDocumentFragment.call(document)}static remove(t){return t.remove()}static siblings=t=>Array.prototype.slice.call(t.parentElement?.children).filter(e=>e!==t);static nextElementSibling(t){return t.nextElementSibling}static previousElementSibling(t){return t.previousElementSibling}static closest(t,e){return t.closest(e)}static shadowRoot(t){return t.shadowRoot}static parentElement=t=>t.parentElement;static changeSelectSelected(t,e){if(t instanceof HTMLSelectElement){const n=t.options;for(let i=0,r=n.length;i<r;i++)n[i].value==e?n[i].selected=!0:n[i].selected=!1}}static changeRadioChecked(t,e){t instanceof HTMLInputElement&&(t.value==e?t.checked=!0:t.checked=!1)}static entity2text(t){const e={lt:60,"lt;":60,"AMP;":38,AMP:38,"GT;":62,GT:62,"QUOT;":34,QUOT:34,"apos;":39,"bull;":8226,"bullet;":8226,"copy;":169,copy:169,"deg;":176,deg:176};let n;return t.charAt(0)=="#"?t.charAt(1).toLowerCase()=="x"?n=parseInt(t.substring(2),16):n=parseInt(t.substring(1),10):n=e[t],n?String.fromCharCode(n):"&"+t}static waitForStyleSheetsLoaded=()=>new Promise(t=>{const e=Array.from(document.querySelectorAll("link[rel=stylesheet]"));let n=document.styleSheets.length||0;const i=()=>n>=e.length?(t(),!0):!1;i()||e.forEach(r=>{r.onload=()=>{n+=1,i()}})});static loadScript(t,e=()=>{},n=(i,r,a,o,c)=>{}){const i=document.createElement("script");i.type="text/javascript",i.src=t,i.async=!1,i.onload=e,i.onerror=n,document.body.appendChild(i)}static runInSafe(t){const e=new Proxy(window,{get(n,i,r){if(typeof i=="string"&&["open","location","document"].includes(i))throw new Error(`禁止访问 key: ${i}`);return i==="window"?e:Reflect.get(n,i,r)},set(n,i,r,a){return Reflect.set(n,i,r,a)}});new Function("window",`with(window) { ${t} }`)(e,null)}static dom=new Proxy({},{get(t,e){return function(n={},...i){const r=document.createElement(e);for(const a of Object.keys(n))r.setAttribute(a,n[a]);for(const a of i)typeof a=="string"?r.appendChild(document.createTextNode(a)):r.appendChild(a);return r}}});static compileTemplate(t){return t=t.replace(/<%=(.+?)%>/g,"`); \n echo( $1 ); \n echo(`").replace(/<%([\s\S]+?)%>/g,"`); \n $1 \n echo(`"),t="echo(`"+t+"`);",`(function parse(data){
|
|
12
12
|
let output = "";
|
|
13
13
|
function echo(html){
|
|
14
14
|
output += html;
|
|
15
15
|
}
|
|
16
16
|
${t}
|
|
17
17
|
return output;
|
|
18
|
-
})`}static escape(t,e="encode"){const n={"&":"&","<":"<",">":">",'"':""","'":"'"};for(const i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t=t.replace(new RegExp(e=="encode"?i:n[i],"g"),e=="encode"?n[i]:i));return t}static getInnerText=t=>{let e=t.innerText;if(!e){const n=t.querySelector("slot")?.assignedNodes()||[];let i=0;for(;!e&&i<=n.length-1;)"innerText"in n[i]&&(e=n[i].innerText),i++}return e};static copyToClipboard=t=>new Promise((e,n)=>{if(navigator.clipboard)navigator.clipboard.writeText(t).then(e).catch(n);else{const i=document.createElement("textarea");i.value=t,i.style.opacity="0",i.style.top="0",i.style.left="0",i.style.position="fixed",document.body.appendChild(i),i.focus(),i.select();try{document.execCommand("copy")?e():n()}catch(r){n(r)}document.body.removeChild(i)}});static scrollTo=(t,e)=>window.scrollTo(t,e);static setScrollRestoration(t){try{window.history.scrollRestoration=t}catch{}}static getLocation(){return new Promise((t,e)=>{navigator.geolocation?navigator.geolocation.getCurrentPosition(n=>{t(n.coords)}):e("Geolocation is not supported by this browser")})}static vibrate(t=200){"vibrate"in navigator?window.navigator.vibrate(t):console.error("Your device is not support vibrate on this browser.")}static getSelectedText=()=>window.getSelection()?.toString();static isElementFocus=t=>t===document.activeElement;static isTabInView=()=>!document.hidden;static navigateBack=()=>history.back();static navigateBack2=()=>history.go(-1);static iframePostMessage(t,e="http://test.com/localstorage.html"){const n=document.createElement("iframe");n.src=e,document.body.append(n),setTimeout(function(){n.contentWindow?.postMessage(t,e)},4e3),setTimeout(function(){n.remove()},6e3)}static measureText=(t,e=12,n=400)=>{const i=document.createElement("span");i.style.visibility="hidden",i.style.padding="0",i.style.whiteSpace="nowrap",i.style.overflow="visible",i.style.fontSize=e>12?e+"px":"12px",i.style.fontWeight=n.toString(),i.innerText=t,document.body.appendChild(i);const r=i.offsetWidth;return document.body.removeChild(i),r};static getFixedWidthText=(t,e,n=12,i=400,r=!0)=>{let a="";if(!t||e<n)return a;const o=t.split(""),c="...";let h=r?D.measureText(c,n,i):0;for(let l=0,f=o.length;l<f;l++)if(h+=D.measureText(o[l],n,i),h>e){r&&(a+=c);break}else a+=o[l];return a}}function
|
|
18
|
+
})`}static escape(t,e="encode"){const n={"&":"&","<":"<",">":">",'"':""","'":"'"};for(const i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t=t.replace(new RegExp(e=="encode"?i:n[i],"g"),e=="encode"?n[i]:i));return t}static getInnerText=t=>{let e=t.innerText;if(!e){const n=t.querySelector("slot")?.assignedNodes()||[];let i=0;for(;!e&&i<=n.length-1;)"innerText"in n[i]&&(e=n[i].innerText),i++}return e};static copyToClipboard=t=>new Promise((e,n)=>{if(navigator.clipboard)navigator.clipboard.writeText(t).then(e).catch(n);else{const i=document.createElement("textarea");i.value=t,i.style.opacity="0",i.style.top="0",i.style.left="0",i.style.position="fixed",document.body.appendChild(i),i.focus(),i.select();try{document.execCommand("copy")?e():n()}catch(r){n(r)}document.body.removeChild(i)}});static scrollTo=(t,e)=>window.scrollTo(t,e);static setScrollRestoration(t){try{window.history.scrollRestoration=t}catch{}}static getLocation(){return new Promise((t,e)=>{navigator.geolocation?navigator.geolocation.getCurrentPosition(n=>{t(n.coords)}):e("Geolocation is not supported by this browser")})}static vibrate(t=200){"vibrate"in navigator?window.navigator.vibrate(t):console.error("Your device is not support vibrate on this browser.")}static getSelectedText=()=>window.getSelection()?.toString();static isElementFocus=t=>t===document.activeElement;static isTabInView=()=>!document.hidden;static navigateBack=()=>history.back();static navigateBack2=()=>history.go(-1);static iframePostMessage(t,e="http://test.com/localstorage.html"){const n=document.createElement("iframe");n.src=e,document.body.append(n),setTimeout(function(){n.contentWindow?.postMessage(t,e)},4e3),setTimeout(function(){n.remove()},6e3)}static measureText=(t,e=12,n=400)=>{const i=document.createElement("span");i.style.visibility="hidden",i.style.padding="0",i.style.whiteSpace="nowrap",i.style.overflow="visible",i.style.fontSize=e>12?e+"px":"12px",i.style.fontWeight=n.toString(),i.innerText=t,document.body.appendChild(i);const r=i.offsetWidth;return document.body.removeChild(i),r};static getFixedWidthText=(t,e,n=12,i=400,r=!0)=>{let a="";if(!t||e<n)return a;const o=t.split(""),c="...";let h=r?D.measureText(c,n,i):0;for(let l=0,f=o.length;l<f;l++)if(h+=D.measureText(o[l],n,i),h>e){r&&(a+=c);break}else a+=o[l];return a}}function Aa(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}var ni={exports:{}};/*! Hammer.JS - v2.0.7 - 2016-04-22
|
|
19
19
|
* http://hammerjs.github.io/
|
|
20
20
|
*
|
|
21
21
|
* Copyright (c) 2016 Jorik Tangelder;
|
|
22
22
|
* Licensed under the MIT license */(function(s){(function(t,e,n,i){var r=["","webkit","Moz","MS","ms","o"],a=e.createElement("div"),o="function",c=Math.round,h=Math.abs,l=Date.now;function f(u,d,y){return setTimeout(M(u,y),d)}function g(u,d,y){return Array.isArray(u)?(w(u,y[d],y),!0):!1}function w(u,d,y){var x;if(u)if(u.forEach)u.forEach(d,y);else if(u.length!==i)for(x=0;x<u.length;)d.call(y,u[x],x,u),x++;else for(x in u)u.hasOwnProperty(x)&&d.call(y,u[x],x,u)}function m(u,d,y){var x="DEPRECATED METHOD: "+d+`
|
|
23
23
|
`+y+` AT
|
|
24
|
-
`;return function(){var P=new Error("get-stack-trace"),I=P&&P.stack?P.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",O=t.console&&(t.console.warn||t.console.log);return O&&O.call(t.console,x,I),u.apply(this,arguments)}}var v;typeof Object.assign!="function"?v=function(d){if(d===i||d===null)throw new TypeError("Cannot convert undefined or null to object");for(var y=Object(d),x=1;x<arguments.length;x++){var P=arguments[x];if(P!==i&&P!==null)for(var I in P)P.hasOwnProperty(I)&&(y[I]=P[I])}return y}:v=Object.assign;var b=m(function(d,y,x){for(var P=Object.keys(y),I=0;I<P.length;)(!x||x&&d[P[I]]===i)&&(d[P[I]]=y[P[I]]),I++;return d},"extend","Use `assign`."),S=m(function(d,y){return b(d,y,!0)},"merge","Use `assign`.");function C(u,d,y){var x=d.prototype,P;P=u.prototype=Object.create(x),P.constructor=u,P._super=x,y&&v(P,y)}function M(u,d){return function(){return u.apply(d,arguments)}}function R(u,d){return typeof u==o?u.apply(d&&d[0]||i,d):u}function B(u,d){return u===i?d:u}function N(u,d,y){w(tt(d),function(x){u.addEventListener(x,y,!1)})}function W(u,d,y){w(tt(d),function(x){u.removeEventListener(x,y,!1)})}function it(u,d){for(;u;){if(u==d)return!0;u=u.parentNode}return!1}function q(u,d){return u.indexOf(d)>-1}function tt(u){return u.trim().split(/\s+/g)}function Y(u,d,y){if(u.indexOf&&!y)return u.indexOf(d);for(var x=0;x<u.length;){if(y&&u[x][y]==d||!y&&u[x]===d)return x;x++}return-1}function $(u){return Array.prototype.slice.call(u,0)}function ht(u,d,y){for(var x=[],P=[],I=0;I<u.length;){var O=d?u[I][d]:u[I];Y(P,O)<0&&x.push(u[I]),P[I]=O,I++}return y&&(d?x=x.sort(function(at,ut){return at[d]>ut[d]}):x=x.sort()),x}function rt(u,d){for(var y,x,P=d[0].toUpperCase()+d.slice(1),I=0;I<r.length;){if(y=r[I],x=y?y+P:d,x in u)return x;I++}return i}var X=1;function V(){return X++}function U(u){var d=u.ownerDocument||u;return d.defaultView||d.parentWindow||t}var A=/mobile|tablet|ip(ad|hone|od)|android/i,k="ontouchstart"in t,_=rt(t,"PointerEvent")!==i,F=k&&A.test(navigator.userAgent),G="touch",St="pen",qt="mouse",rl="kinect",al=25,lt=1,Jt=2,Z=4,dt=8,un=1,Me=2,Re=4,Oe=8,Le=16,kt=Me|Re,Zt=Oe|Le,dr=kt|Zt,mr=["x","y"],fn=["clientX","clientY"];function Ct(u,d){var y=this;this.manager=u,this.callback=d,this.element=u.element,this.target=u.options.inputTarget,this.domHandler=function(x){R(u.options.enable,[u])&&y.handler(x)},this.init()}Ct.prototype={handler:function(){},init:function(){this.evEl&&N(this.element,this.evEl,this.domHandler),this.evTarget&&N(this.target,this.evTarget,this.domHandler),this.evWin&&N(U(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&W(this.element,this.evEl,this.domHandler),this.evTarget&&W(this.target,this.evTarget,this.domHandler),this.evWin&&W(U(this.element),this.evWin,this.domHandler)}};function ol(u){var d,y=u.options.inputClass;return y?d=y:_?d=ds:F?d=pn:k?d=ms:d=mn,new d(u,cl)}function cl(u,d,y){var x=y.pointers.length,P=y.changedPointers.length,I=d<&&x-P===0,O=d&(Z|dt)&&x-P===0;y.isFirst=!!I,y.isFinal=!!O,I&&(u.session={}),y.eventType=d,hl(u,y),u.emit("hammer.input",y),u.recognize(y),u.session.prevInput=y}function hl(u,d){var y=u.session,x=d.pointers,P=x.length;y.firstInput||(y.firstInput=pr(d)),P>1&&!y.firstMultiple?y.firstMultiple=pr(d):P===1&&(y.firstMultiple=!1);var I=y.firstInput,O=y.firstMultiple,et=O?O.center:I.center,at=d.center=gr(x);d.timeStamp=l(),d.deltaTime=d.timeStamp-I.timeStamp,d.angle=fs(et,at),d.distance=dn(et,at),ll(y,d),d.offsetDirection=wr(d.deltaX,d.deltaY);var ut=yr(d.deltaTime,d.deltaX,d.deltaY);d.overallVelocityX=ut.x,d.overallVelocityY=ut.y,d.overallVelocity=h(ut.x)>h(ut.y)?ut.x:ut.y,d.scale=O?dl(O.pointers,x):1,d.rotation=O?fl(O.pointers,x):0,d.maxPointers=y.prevInput?d.pointers.length>y.prevInput.maxPointers?d.pointers.length:y.prevInput.maxPointers:d.pointers.length,ul(y,d);var Mt=u.element;it(d.srcEvent.target,Mt)&&(Mt=d.srcEvent.target),d.target=Mt}function ll(u,d){var y=d.center,x=u.offsetDelta||{},P=u.prevDelta||{},I=u.prevInput||{};(d.eventType===lt||I.eventType===Z)&&(P=u.prevDelta={x:I.deltaX||0,y:I.deltaY||0},x=u.offsetDelta={x:y.x,y:y.y}),d.deltaX=P.x+(y.x-x.x),d.deltaY=P.y+(y.y-x.y)}function ul(u,d){var y=u.lastInterval||d,x=d.timeStamp-y.timeStamp,P,I,O,et;if(d.eventType!=dt&&(x>al||y.velocity===i)){var at=d.deltaX-y.deltaX,ut=d.deltaY-y.deltaY,Mt=yr(x,at,ut);I=Mt.x,O=Mt.y,P=h(Mt.x)>h(Mt.y)?Mt.x:Mt.y,et=wr(at,ut),u.lastInterval=d}else P=y.velocity,I=y.velocityX,O=y.velocityY,et=y.direction;d.velocity=P,d.velocityX=I,d.velocityY=O,d.direction=et}function pr(u){for(var d=[],y=0;y<u.pointers.length;)d[y]={clientX:c(u.pointers[y].clientX),clientY:c(u.pointers[y].clientY)},y++;return{timeStamp:l(),pointers:d,center:gr(d),deltaX:u.deltaX,deltaY:u.deltaY}}function gr(u){var d=u.length;if(d===1)return{x:c(u[0].clientX),y:c(u[0].clientY)};for(var y=0,x=0,P=0;P<d;)y+=u[P].clientX,x+=u[P].clientY,P++;return{x:c(y/d),y:c(x/d)}}function yr(u,d,y){return{x:d/u||0,y:y/u||0}}function wr(u,d){return u===d?un:h(u)>=h(d)?u<0?Me:Re:d<0?Oe:Le}function dn(u,d,y){y||(y=mr);var x=d[y[0]]-u[y[0]],P=d[y[1]]-u[y[1]];return Math.sqrt(x*x+P*P)}function fs(u,d,y){y||(y=mr);var x=d[y[0]]-u[y[0]],P=d[y[1]]-u[y[1]];return Math.atan2(P,x)*180/Math.PI}function fl(u,d){return fs(d[1],d[0],fn)+fs(u[1],u[0],fn)}function dl(u,d){return dn(d[0],d[1],fn)/dn(u[0],u[1],fn)}var ml={mousedown:lt,mousemove:Jt,mouseup:Z},pl="mousedown",gl="mousemove mouseup";function mn(){this.evEl=pl,this.evWin=gl,this.pressed=!1,Ct.apply(this,arguments)}C(mn,Ct,{handler:function(d){var y=ml[d.type];y<&&d.button===0&&(this.pressed=!0),y&Jt&&d.which!==1&&(y=Z),this.pressed&&(y&Z&&(this.pressed=!1),this.callback(this.manager,y,{pointers:[d],changedPointers:[d],pointerType:qt,srcEvent:d}))}});var yl={pointerdown:lt,pointermove:Jt,pointerup:Z,pointercancel:dt,pointerout:dt},wl={2:G,3:St,4:qt,5:rl},vr="pointerdown",br="pointermove pointerup pointercancel";t.MSPointerEvent&&!t.PointerEvent&&(vr="MSPointerDown",br="MSPointerMove MSPointerUp MSPointerCancel");function ds(){this.evEl=vr,this.evWin=br,Ct.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}C(ds,Ct,{handler:function(d){var y=this.store,x=!1,P=d.type.toLowerCase().replace("ms",""),I=yl[P],O=wl[d.pointerType]||d.pointerType,et=O==G,at=Y(y,d.pointerId,"pointerId");I<&&(d.button===0||et)?at<0&&(y.push(d),at=y.length-1):I&(Z|dt)&&(x=!0),!(at<0)&&(y[at]=d,this.callback(this.manager,I,{pointers:y,changedPointers:[d],pointerType:O,srcEvent:d}),x&&y.splice(at,1))}});var vl={touchstart:lt,touchmove:Jt,touchend:Z,touchcancel:dt},bl="touchstart",xl="touchstart touchmove touchend touchcancel";function xr(){this.evTarget=bl,this.evWin=xl,this.started=!1,Ct.apply(this,arguments)}C(xr,Ct,{handler:function(d){var y=vl[d.type];if(y===lt&&(this.started=!0),!!this.started){var x=Sl.call(this,d,y);y&(Z|dt)&&x[0].length-x[1].length===0&&(this.started=!1),this.callback(this.manager,y,{pointers:x[0],changedPointers:x[1],pointerType:G,srcEvent:d})}}});function Sl(u,d){var y=$(u.touches),x=$(u.changedTouches);return d&(Z|dt)&&(y=ht(y.concat(x),"identifier",!0)),[y,x]}var Cl={touchstart:lt,touchmove:Jt,touchend:Z,touchcancel:dt},Tl="touchstart touchmove touchend touchcancel";function pn(){this.evTarget=Tl,this.targetIds={},Ct.apply(this,arguments)}C(pn,Ct,{handler:function(d){var y=Cl[d.type],x=El.call(this,d,y);x&&this.callback(this.manager,y,{pointers:x[0],changedPointers:x[1],pointerType:G,srcEvent:d})}});function El(u,d){var y=$(u.touches),x=this.targetIds;if(d&(lt|Jt)&&y.length===1)return x[y[0].identifier]=!0,[y,y];var P,I,O=$(u.changedTouches),et=[],at=this.target;if(I=y.filter(function(ut){return it(ut.target,at)}),d===lt)for(P=0;P<I.length;)x[I[P].identifier]=!0,P++;for(P=0;P<O.length;)x[O[P].identifier]&&et.push(O[P]),d&(Z|dt)&&delete x[O[P].identifier],P++;if(et.length)return[ht(I.concat(et),"identifier",!0),et]}var Pl=2500,Sr=25;function ms(){Ct.apply(this,arguments);var u=M(this.handler,this);this.touch=new pn(this.manager,u),this.mouse=new mn(this.manager,u),this.primaryTouch=null,this.lastTouches=[]}C(ms,Ct,{handler:function(d,y,x){var P=x.pointerType==G,I=x.pointerType==qt;if(!(I&&x.sourceCapabilities&&x.sourceCapabilities.firesTouchEvents)){if(P)_l.call(this,y,x);else if(I&&Dl.call(this,x))return;this.callback(d,y,x)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});function _l(u,d){u<?(this.primaryTouch=d.changedPointers[0].identifier,Cr.call(this,d)):u&(Z|dt)&&Cr.call(this,d)}function Cr(u){var d=u.changedPointers[0];if(d.identifier===this.primaryTouch){var y={x:d.clientX,y:d.clientY};this.lastTouches.push(y);var x=this.lastTouches,P=function(){var I=x.indexOf(y);I>-1&&x.splice(I,1)};setTimeout(P,Pl)}}function Dl(u){for(var d=u.srcEvent.clientX,y=u.srcEvent.clientY,x=0;x<this.lastTouches.length;x++){var P=this.lastTouches[x],I=Math.abs(d-P.x),O=Math.abs(y-P.y);if(I<=Sr&&O<=Sr)return!0}return!1}var Tr=rt(a.style,"touchAction"),Er=Tr!==i,Pr="compute",_r="auto",ps="manipulation",Kt="none",Ne="pan-x",Fe="pan-y",gn=kl();function gs(u,d){this.manager=u,this.set(d)}gs.prototype={set:function(u){u==Pr&&(u=this.compute()),Er&&this.manager.element.style&&gn[u]&&(this.manager.element.style[Tr]=u),this.actions=u.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var u=[];return w(this.manager.recognizers,function(d){R(d.options.enable,[d])&&(u=u.concat(d.getTouchAction()))}),Al(u.join(" "))},preventDefaults:function(u){var d=u.srcEvent,y=u.offsetDirection;if(this.manager.session.prevented){d.preventDefault();return}var x=this.actions,P=q(x,Kt)&&!gn[Kt],I=q(x,Fe)&&!gn[Fe],O=q(x,Ne)&&!gn[Ne];if(P){var et=u.pointers.length===1,at=u.distance<2,ut=u.deltaTime<250;if(et&&at&&ut)return}if(!(O&&I)&&(P||I&&y&kt||O&&y&Zt))return this.preventSrc(d)},preventSrc:function(u){this.manager.session.prevented=!0,u.preventDefault()}};function Al(u){if(q(u,Kt))return Kt;var d=q(u,Ne),y=q(u,Fe);return d&&y?Kt:d||y?d?Ne:Fe:q(u,ps)?ps:_r}function kl(){if(!Er)return!1;var u={},d=t.CSS&&t.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(y){u[y]=d?t.CSS.supports("touch-action",y):!0}),u}var yn=1,Tt=2,he=4,Yt=8,Bt=Yt,Be=16,It=32;function Ut(u){this.options=v({},this.defaults,u||{}),this.id=V(),this.manager=null,this.options.enable=B(this.options.enable,!0),this.state=yn,this.simultaneous={},this.requireFail=[]}Ut.prototype={defaults:{},set:function(u){return v(this.options,u),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(u){if(g(u,"recognizeWith",this))return this;var d=this.simultaneous;return u=wn(u,this),d[u.id]||(d[u.id]=u,u.recognizeWith(this)),this},dropRecognizeWith:function(u){return g(u,"dropRecognizeWith",this)?this:(u=wn(u,this),delete this.simultaneous[u.id],this)},requireFailure:function(u){if(g(u,"requireFailure",this))return this;var d=this.requireFail;return u=wn(u,this),Y(d,u)===-1&&(d.push(u),u.requireFailure(this)),this},dropRequireFailure:function(u){if(g(u,"dropRequireFailure",this))return this;u=wn(u,this);var d=Y(this.requireFail,u);return d>-1&&this.requireFail.splice(d,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(u){return!!this.simultaneous[u.id]},emit:function(u){var d=this,y=this.state;function x(P){d.manager.emit(P,u)}y<Yt&&x(d.options.event+Dr(y)),x(d.options.event),u.additionalEvent&&x(u.additionalEvent),y>=Yt&&x(d.options.event+Dr(y))},tryEmit:function(u){if(this.canEmit())return this.emit(u);this.state=It},canEmit:function(){for(var u=0;u<this.requireFail.length;){if(!(this.requireFail[u].state&(It|yn)))return!1;u++}return!0},recognize:function(u){var d=v({},u);if(!R(this.options.enable,[this,d])){this.reset(),this.state=It;return}this.state&(Bt|Be|It)&&(this.state=yn),this.state=this.process(d),this.state&(Tt|he|Yt|Be)&&this.tryEmit(d)},process:function(u){},getTouchAction:function(){},reset:function(){}};function Dr(u){return u&Be?"cancel":u&Yt?"end":u&he?"move":u&Tt?"start":""}function Ar(u){return u==Le?"down":u==Oe?"up":u==Me?"left":u==Re?"right":""}function wn(u,d){var y=d.manager;return y?y.get(u):u}function _t(){Ut.apply(this,arguments)}C(_t,Ut,{defaults:{pointers:1},attrTest:function(u){var d=this.options.pointers;return d===0||u.pointers.length===d},process:function(u){var d=this.state,y=u.eventType,x=d&(Tt|he),P=this.attrTest(u);return x&&(y&dt||!P)?d|Be:x||P?y&Z?d|Yt:d&Tt?d|he:Tt:It}});function vn(){_t.apply(this,arguments),this.pX=null,this.pY=null}C(vn,_t,{defaults:{event:"pan",threshold:10,pointers:1,direction:dr},getTouchAction:function(){var u=this.options.direction,d=[];return u&kt&&d.push(Fe),u&Zt&&d.push(Ne),d},directionTest:function(u){var d=this.options,y=!0,x=u.distance,P=u.direction,I=u.deltaX,O=u.deltaY;return P&d.direction||(d.direction&kt?(P=I===0?un:I<0?Me:Re,y=I!=this.pX,x=Math.abs(u.deltaX)):(P=O===0?un:O<0?Oe:Le,y=O!=this.pY,x=Math.abs(u.deltaY))),u.direction=P,y&&x>d.threshold&&P&d.direction},attrTest:function(u){return _t.prototype.attrTest.call(this,u)&&(this.state&Tt||!(this.state&Tt)&&this.directionTest(u))},emit:function(u){this.pX=u.deltaX,this.pY=u.deltaY;var d=Ar(u.direction);d&&(u.additionalEvent=this.options.event+d),this._super.emit.call(this,u)}});function ys(){_t.apply(this,arguments)}C(ys,_t,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[Kt]},attrTest:function(u){return this._super.attrTest.call(this,u)&&(Math.abs(u.scale-1)>this.options.threshold||this.state&Tt)},emit:function(u){if(u.scale!==1){var d=u.scale<1?"in":"out";u.additionalEvent=this.options.event+d}this._super.emit.call(this,u)}});function ws(){Ut.apply(this,arguments),this._timer=null,this._input=null}C(ws,Ut,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[_r]},process:function(u){var d=this.options,y=u.pointers.length===d.pointers,x=u.distance<d.threshold,P=u.deltaTime>d.time;if(this._input=u,!x||!y||u.eventType&(Z|dt)&&!P)this.reset();else if(u.eventType<)this.reset(),this._timer=f(function(){this.state=Bt,this.tryEmit()},d.time,this);else if(u.eventType&Z)return Bt;return It},reset:function(){clearTimeout(this._timer)},emit:function(u){this.state===Bt&&(u&&u.eventType&Z?this.manager.emit(this.options.event+"up",u):(this._input.timeStamp=l(),this.manager.emit(this.options.event,this._input)))}});function vs(){_t.apply(this,arguments)}C(vs,_t,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[Kt]},attrTest:function(u){return this._super.attrTest.call(this,u)&&(Math.abs(u.rotation)>this.options.threshold||this.state&Tt)}});function bs(){_t.apply(this,arguments)}C(bs,_t,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:kt|Zt,pointers:1},getTouchAction:function(){return vn.prototype.getTouchAction.call(this)},attrTest:function(u){var d=this.options.direction,y;return d&(kt|Zt)?y=u.overallVelocity:d&kt?y=u.overallVelocityX:d&Zt&&(y=u.overallVelocityY),this._super.attrTest.call(this,u)&&d&u.offsetDirection&&u.distance>this.options.threshold&&u.maxPointers==this.options.pointers&&h(y)>this.options.velocity&&u.eventType&Z},emit:function(u){var d=Ar(u.offsetDirection);d&&this.manager.emit(this.options.event+d,u),this.manager.emit(this.options.event,u)}});function bn(){Ut.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}C(bn,Ut,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[ps]},process:function(u){var d=this.options,y=u.pointers.length===d.pointers,x=u.distance<d.threshold,P=u.deltaTime<d.time;if(this.reset(),u.eventType<&&this.count===0)return this.failTimeout();if(x&&P&&y){if(u.eventType!=Z)return this.failTimeout();var I=this.pTime?u.timeStamp-this.pTime<d.interval:!0,O=!this.pCenter||dn(this.pCenter,u.center)<d.posThreshold;this.pTime=u.timeStamp,this.pCenter=u.center,!O||!I?this.count=1:this.count+=1,this._input=u;var et=this.count%d.taps;if(et===0)return this.hasRequireFailures()?(this._timer=f(function(){this.state=Bt,this.tryEmit()},d.interval,this),Tt):Bt}return It},failTimeout:function(){return this._timer=f(function(){this.state=It},this.options.interval,this),It},reset:function(){clearTimeout(this._timer)},emit:function(){this.state==Bt&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}});function Vt(u,d){return d=d||{},d.recognizers=B(d.recognizers,Vt.defaults.preset),new xs(u,d)}Vt.VERSION="2.0.7",Vt.defaults={domEvents:!1,touchAction:Pr,enable:!0,inputTarget:null,inputClass:null,preset:[[vs,{enable:!1}],[ys,{enable:!1},["rotate"]],[bs,{direction:kt}],[vn,{direction:kt},["swipe"]],[bn],[bn,{event:"doubletap",taps:2},["tap"]],[ws]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};var Il=1,kr=2;function xs(u,d){this.options=v({},Vt.defaults,d||{}),this.options.inputTarget=this.options.inputTarget||u,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=u,this.input=ol(this),this.touchAction=new gs(this,this.options.touchAction),Ir(this,!0),w(this.options.recognizers,function(y){var x=this.add(new y[0](y[1]));y[2]&&x.recognizeWith(y[2]),y[3]&&x.requireFailure(y[3])},this)}xs.prototype={set:function(u){return v(this.options,u),u.touchAction&&this.touchAction.update(),u.inputTarget&&(this.input.destroy(),this.input.target=u.inputTarget,this.input.init()),this},stop:function(u){this.session.stopped=u?kr:Il},recognize:function(u){var d=this.session;if(!d.stopped){this.touchAction.preventDefaults(u);var y,x=this.recognizers,P=d.curRecognizer;(!P||P&&P.state&Bt)&&(P=d.curRecognizer=null);for(var I=0;I<x.length;)y=x[I],d.stopped!==kr&&(!P||y==P||y.canRecognizeWith(P))?y.recognize(u):y.reset(),!P&&y.state&(Tt|he|Yt)&&(P=d.curRecognizer=y),I++}},get:function(u){if(u instanceof Ut)return u;for(var d=this.recognizers,y=0;y<d.length;y++)if(d[y].options.event==u)return d[y];return null},add:function(u){if(g(u,"add",this))return this;var d=this.get(u.options.event);return d&&this.remove(d),this.recognizers.push(u),u.manager=this,this.touchAction.update(),u},remove:function(u){if(g(u,"remove",this))return this;if(u=this.get(u),u){var d=this.recognizers,y=Y(d,u);y!==-1&&(d.splice(y,1),this.touchAction.update())}return this},on:function(u,d){if(u!==i&&d!==i){var y=this.handlers;return w(tt(u),function(x){y[x]=y[x]||[],y[x].push(d)}),this}},off:function(u,d){if(u!==i){var y=this.handlers;return w(tt(u),function(x){d?y[x]&&y[x].splice(Y(y[x],d),1):delete y[x]}),this}},emit:function(u,d){this.options.domEvents&&Ml(u,d);var y=this.handlers[u]&&this.handlers[u].slice();if(!(!y||!y.length)){d.type=u,d.preventDefault=function(){d.srcEvent.preventDefault()};for(var x=0;x<y.length;)y[x](d),x++}},destroy:function(){this.element&&Ir(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}};function Ir(u,d){var y=u.element;if(y.style){var x;w(u.options.cssProps,function(P,I){x=rt(y.style,I),d?(u.oldCssProps[x]=y.style[x],y.style[x]=P):y.style[x]=u.oldCssProps[x]||""}),d||(u.oldCssProps={})}}function Ml(u,d){var y=e.createEvent("Event");y.initEvent(u,!0,!0),y.gesture=d,d.target.dispatchEvent(y)}v(Vt,{INPUT_START:lt,INPUT_MOVE:Jt,INPUT_END:Z,INPUT_CANCEL:dt,STATE_POSSIBLE:yn,STATE_BEGAN:Tt,STATE_CHANGED:he,STATE_ENDED:Yt,STATE_RECOGNIZED:Bt,STATE_CANCELLED:Be,STATE_FAILED:It,DIRECTION_NONE:un,DIRECTION_LEFT:Me,DIRECTION_RIGHT:Re,DIRECTION_UP:Oe,DIRECTION_DOWN:Le,DIRECTION_HORIZONTAL:kt,DIRECTION_VERTICAL:Zt,DIRECTION_ALL:dr,Manager:xs,Input:Ct,TouchAction:gs,TouchInput:pn,MouseInput:mn,PointerEventInput:ds,TouchMouseInput:ms,SingleTouchInput:xr,Recognizer:Ut,AttrRecognizer:_t,Tap:bn,Pan:vn,Swipe:bs,Pinch:ys,Rotate:vs,Press:ws,on:N,off:W,each:w,merge:S,extend:b,assign:v,inherit:C,bindFn:M,prefixed:rt});var Rl=typeof t<"u"?t:typeof self<"u"?self:{};Rl.Hammer=Vt,typeof i=="function"&&i.amd?i(function(){return Vt}):s.exports?s.exports=Vt:t[n]=Vt})(window,document,"Hammer")})(ei);var Da=ei.exports;const Aa=_a(Da);function Rn(s,t,e,n,i,r,a,o,c,h){let l=Math.PI*120/180,f=Math.PI/180*(+i||0),g=[],w,m=function(X,V,U){const A=X*Math.cos(U)-V*Math.sin(U),k=X*Math.sin(U)+V*Math.cos(U);return{x:A,y:k}},v,b,S,C;if(h)v=h[0],b=h[1],S=h[2],C=h[3];else{w=m(s,t,-f),s=w.x,t=w.y,w=m(o,c,-f),o=w.x,c=w.y;let X=(s-o)/2,V=(t-c)/2,U=X*X/(e*e)+V*V/(n*n);U>1&&(U=Math.sqrt(U),e=U*e,n=U*n);let A=e*e,k=n*n,_=(r==a?-1:1)*Math.sqrt(Math.abs((A*k-A*V*V-k*X*X)/(A*V*V+k*X*X)));S=_*e*V/n+(s+o)/2,C=_*-n*X/e+(t+c)/2,v=Math.asin(Number(((t-C)/n).toFixed(9))),b=Math.asin(Number(((c-C)/n).toFixed(9))),v=s<S?Math.PI-v:v,b=o<S?Math.PI-b:b,v<0&&(v=Math.PI*2+v),b<0&&(b=Math.PI*2+b),a&&v>b&&(v=v-Math.PI*2),!a&&b>v&&(b=b-Math.PI*2)}let M=b-v;if(Math.abs(M)>l){let X=b,V=o,U=c;b=v+l*(a&&b>v?1:-1),o=S+e*Math.cos(b),c=C+n*Math.sin(b),g=Rn(o,c,e,n,i,0,a,V,U,[b,X,S,C])}M=b-v;let R=Math.cos(v),B=Math.sin(v),N=Math.cos(b),W=Math.sin(b),it=Math.tan(M/4),q=4/3*e*it,tt=4/3*n*it,Y=[s,t],$=[s+q*B,t-tt*R],ht=[o+q*W,c-tt*N],rt=[o,c];return $[0]=2*Y[0]-$[0],$[1]=2*Y[1]-$[1],h?[[...$,...ht,...rt]].concat(g):[[...$,...ht,...rt]].concat(g).map(X=>{const V=[];for(let U=0,A=X.length;U<A;U++)V[U]=U%2?m(X[U-1],X[U],f).y:m(X[U],X[U+1],f).x;return V})}function On(s,t,e,n,i,r){return[s/3+.6666666666666666*e,t/3+.6666666666666666*n,i/3+.6666666666666666*e,r/3+.6666666666666666*n,i,r]}function de(s,t,e,n){return[s,t,e,n,e,n]}const me={a:7,c:6,s:4,q:4,t:2,m:2,l:2,h:1,v:1,z:0};class ee{static createSVGElement(t="path",e){const n=document.createElementNS.call(document,"http://www.w3.org/2000/svg",t);return e&&D.attribute(n,e),n}static createSvgPath(t){return this.createSVGElement("path",{d:t})}static downloadFromSVGElement(t,e="shape"){return Pn(Ns(t),`${e}.svg`)}static downloadFromSVGString(t,e="shape"){return Pn(Tn(t),`${e}.svg`)}static getSVGRawStringFromElement(t){return En(t)}static isSVGPath(t){return typeof t!="string"?!1:(t=t.trim(),/^[mlhvzaqtcs]\s*[-+.0-9][^mlhvzaqtcs]+/i.test(t)&&/[\dz]$/i.test(t))}static SVGPathDataToD(t){return t.map(e=>{if(!e[0])return"";switch(e[0].toLowerCase()){case"a":return`${e[0]} ${e[1]},${e[2]} ${e[3]} ${e[4]},${e[5]} ${e[6]},${e[7]}`;case"c":return`${e[0]} ${e[1]},${e[2]} ${e[3]},${e[4]} ${e[5]},${e[6]}`;case"s":case"q":return`${e[0]} ${e[1]},${e[2]} ${e[3]},${e[4]}`;default:return e[0]+" "+e.slice(1).join(",")}}).join(" ")}static parseSVGPath(t){const e=[];return t.replace(/([mlhvzaqtcs])([^mlhvzaqtcs]*)/gi,(n,i,r)=>{let a=i.toLowerCase();const o=Gr(r);for(a=="m"&&o.length>me[a]&&(e.push([i,...o.splice(0,me[a])]),a="l",i=i=="m"?"l":"L");o.length;){if(o.length<me[a])throw new Error(`parseSVGPath substring:{ ${n} } command:{ ${i} } args:{ ${o} }`);e.push([i,...o.splice(0,me[a])])}return a=="z"&&e.push([i]),""}),e}static absolutizeSVGPath(t){let e=0,n=0,i=0,r=0;return t.map(function(a){const o=a[0],c=o.toUpperCase();if(o!=c)switch(a[0]=c,o){case"a":a[6]+=i,a[7]+=r;break;case"v":a[1]+=r;break;case"h":a[1]+=i;break;default:for(let h=1;h<a.length;)a[h++]+=i,a[h++]+=r}switch(c){case"Z":i=e,r=n;break;case"H":i=a[1];break;case"V":r=a[1];break;case"M":i=e=a[1],r=n=a[2];break;default:i=a[a.length-2],r=a[a.length-1]}return a})}static relativeSVGPath(t){let e=0,n=0,i=0,r=0;return t.map(function(a){const o=a[0],c=o.toLowerCase();if(o!=c)switch(a[0]=c,o){case"A":a[6]-=i,a[7]-=r;break;case"V":a[1]-=r;break;case"H":a[1]-=i;break;default:for(let h=1;h<a.length;)a[h++]-=i,a[h++]-=r}switch(c){case"z":i=e,r=n;break;case"h":i+=a[1];break;case"v":r+=a[1];break;case"m":i+=a[1],r+=a[2],e+=a[1],n+=a[2];break;default:i+=a[a.length-2],r+=a[a.length-1]}return a})}static normalizeSVGPath(t){let e=[],n=0,i=0,r=0,a=0,o=0,c=0,h=0,l=0,f;for(let g=0,w=t.length;g<w;g++){let m=t[g];const v=m[0];switch(v){case"M":n=m[1],i=m[2];break;case"A":const b=Rn(r,a,m[1],m[2],m[3],m[4],m[5],m[6],m[7]);if(!b.length)continue;b.forEach((M,R)=>{const[B,N,W,it,q,tt]=M;m=["C",B,N,W,it,q,tt],R<b.length-1&&e.push(m)});break;case"S":let S=r,C=a;(f=="C"||f=="S")&&(S+=S-h,C+=C-l),m=["C",S,C,m[1],m[2],m[3],m[4]];break;case"T":f=="Q"||f=="T"?(o=r*2-o,c=a*2-c):(o=r,c=a),m=["C",...On(r,a,o,c,m[1],m[2])];break;case"Q":o=m[1],c=m[2],m=["C",...On(r,a,m[1],m[2],m[3],m[4])];break;case"L":m=["C",...de(r,a,m[1],m[2])];break;case"H":m=["C",...de(r,a,m[1],a)];break;case"V":m=["C",...de(r,a,r,m[1])];break;case"Z":m=["C",...de(r,a,n,i)];break}f=v,r=m[m.length-2],a=m[m.length-1],m.length>4?(h=m[m.length-4],l=m[m.length-3]):(h=r,l=a),e.push(m)}return e}static catmullRom2bezier(t){let e=[];for(let n=0,i=t.length;i-2>n;n+=2){let r;n==0?r=[{x:t[n],y:t[n+1]},{x:t[n],y:t[n+1]},{x:t[n+2],y:t[n+3]},{x:t[n+4],y:t[n+5]}]:i-4==n?r=[{x:t[n-2],y:t[n-1]},{x:t[n],y:t[n+1]},{x:t[n+2],y:t[n+3]},{x:t[n+2],y:t[n+3]}]:r=[{x:t[n-2],y:t[n-1]},{x:t[n],y:t[n+1]},{x:t[n+2],y:t[n+3]},{x:t[n+4],y:t[n+5]}];const a=[{x:r[1].x,y:r[1].y},{x:(-r[0].x+6*r[1].x+r[2].x)/6,y:(-r[0].y+6*r[1].y+r[2].y)/6},{x:(r[1].x+6*r[2].x-r[3].x)/6,y:(r[1].y+6*r[2].y-r[3].y)/6},{x:r[2].x,y:r[2].y}];e.push(["C",a[1].x,a[1].y,a[2].x,a[2].y,a[3].x,a[3].y])}return e}static zvhToLSVGPath(t){let e=[],n=["L",0,0],i;for(let r=0,a=t.length;r<a;r++){let o=t[r];switch(o[0]){case"M":n=["L",o[1],o[2]],e.push(o);break;case"Z":e.push(n);break;case"H":i=e[e.length-1]||["L",0,0],e.push(["L",o[1],i[i.length-1]]);break;case"V":i=e[e.length-1]||["L",0,0],e.push(["L",i[i.length-2],o[1]]);break;default:e.push(o)}}return e}static longhandSVGPath(t){const e={S:{to:"C",x:3},T:{to:"Q",x:1}};let n,i=0,r=0;for(let a=0,o=t.length;a<o;a++){const c=t[a],h=e[c[0]];h&&(c[0]=h.to,n&&(n[0]===h.to?(i=2*Number(n[h.x+2])-Number(n[h.x]),r=2*Number(n[h.x+3])-Number(n[h.x+1])):(i=Number(n[n.length-2]),r=Number(n[n.length-1]))),c.splice(1,0,i,r)),n=c}return t}static curveDim(t,e,n,i,r,a,o,c){const h=[],l=[[],[]];let f,g,w,m,v,b,S,C;for(let N=0;N<2;++N){if(N===0?(g=6*t-12*n+6*r,f=-3*t+9*n-9*r+3*o,w=3*n-3*t):(g=6*e-12*i+6*a,f=-3*e+9*i-9*a+3*c,w=3*i-3*e),Math.abs(f)<1e-12){if(Math.abs(g)<1e-12)continue;m=-w/g,m>0&&m<1&&h.push(m);continue}S=g*g-4*w*f,C=Math.sqrt(S),!(S<0)&&(v=(-g+C)/(2*f),v>0&&v<1&&h.push(v),b=(-g-C)/(2*f),b>0&&b<1&&h.push(b))}let M=h.length,R;const B=M;for(;M--;)m=h[M],R=1-m,l[0][M]=R*R*R*t+3*R*R*m*n+3*R*m*m*r+m*m*m*o,l[1][M]=R*R*R*e+3*R*R*m*i+3*R*m*m*a+m*m*m*c;return l[0][B]=t,l[1][B]=e,l[0][B+1]=o,l[1][B+1]=c,l[0].length=l[1].length=B+2,{min:{x:Math.min.apply(0,l[0]),y:Math.min.apply(0,l[1])},max:{x:Math.max.apply(0,l[0]),y:Math.max.apply(0,l[1])}}}static base3(t,e,n,i,r){const a=-3*e+9*n-9*i+3*r,o=t*a+6*e-12*n+6*i;return t*o-3*e+3*n}static bezlen(t,e,n,i,r,a,o,c,h=1){h=Math.max(0,Math.min(h,1));const l=h/2,f=12,g=[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816],w=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472];let m=0;for(let v=0;v<f;v++){const b=l*g[v]+l,S=this.base3(b,t,n,r,o),C=this.base3(b,e,i,a,c),M=S*S+C*C;m+=w[v]*Math.sqrt(M)}return l*m}}const H=ee;class K{id;x;prevX;y;prevY;degree;prevDegree;scaleOnOrigin;prevScaleOnOrigin;skewDegreeOnOrigin;prevSkewDegreeOnOrigin;vx;vy;ax;ay;mass;attrs;enableDrag;targetToAfterDragFree;followMouse;isShow=!0;mouseMove;history=[];path2d=new Path2D;isDragging=!1;el;constructor(t){this.id=Rr(),this.prevX=this.x=t?.x||0,this.prevY=this.y=t?.y||0,this.prevDegree=this.degree=t?.degree||0,this.prevScaleOnOrigin=this.scaleOnOrigin=t?.scaleOnOrigin||1,this.prevSkewDegreeOnOrigin=this.skewDegreeOnOrigin=t?.skewDegreeOnOrigin||0,this.vx=t?.vx||0,this.vy=t?.vy||0,this.ax=t?.ax||0,this.ay=t?.ay||0,this.mass=t?.mass||0,this.attrs=Object.assign({fill:"none",stroke:"none"},t?.attrs),this.enableDrag=t?.enableDrag||!1,this.targetToAfterDragFree=t?.targetToAfterDragFree,this.followMouse=t?.followMouse||!1,this.isShow=typeof t?.isShow=="boolean"?t?.isShow:!0,this.mouseMove=t?.mouseMove}save(){this.history.push(Ms(this))}restore(){const t=this.history.pop();t&&Ue(this,t)}get centerX(){const t=this.getBoundingClientRect();return t?t.x+t.width/2:this.x}get centerY(){const t=this.getBoundingClientRect();return t?t.y+t.height/2:this.y}get centerDiff(){return{dx:this.centerX-this.x,dy:this.centerY-this.y}}getBoundingClientRect(){return null}toSVGPathD(){const t=[],e=this.toSVGPathData();return e[0]&&Array.isArray(e[0])?t.push(...e):t.push(e),H.SVGPathDataToD(t)}distanceTo(t){return In(this.x,this.y,t.x,t.y)}angleTo(t){return this.degree=nt(fe(this.x,this.y,t.x,t.y)),this.degree}followTo(t,e=3){const n=this.angleTo(t),{x:i,y:r}=Gt(ot(n),e);this.vx=i,this.vy=r,this.nextFrame()}followAccelerationTo(t,e=.05){const n=this.angleTo(t),{x:i,y:r}=Gt(ot(n),e);this.ax=i,this.ay=r,this.nextFrame()}nextFrame(t){const e=t?.gravity??0,n=t?.friction??0;if(this.vx+=this.ax,this.vy+=this.ay,this.vy+=e,n>0){const i=Math.atan2(this.vy,this.vx);let r=Math.sqrt(this.vx*this.vx+this.vy*this.vy);r>n?r-=n:r=0,this.vx=Math.cos(i)*r,this.vy=Math.sin(i)*r}this.x+=this.vx,this.y+=this.vy}nextFrameEaseTo(t,e){const n=e?.gravity??0,i=e?.friction??1,r=e?.easing??.05,{dx:a,dy:o}=this.centerDiff,c=t.x-this.x-a,h=t.y-this.y-o;this.vx=c*r,this.vy=h*r,this.vy+=n,this.vx*=i,this.vy*=i,this.x+=this.vx,this.y+=this.vy}nextFrameSpringTo(t,e){const n=e?.gravity??0,i=e?.friction??.95,r=e?.spring??.03,{dx:a,dy:o}=this.centerDiff;(Array.isArray(t)?t:[t]).forEach(h=>{const l=h.x-this.x-a,f=h.y-this.y-o,g=l*r,w=f*r;this.vx+=g,this.vy+=w}),this.vy+=n,this.vx*=i,this.vy*=i,this.x+=this.vx,this.y+=this.vy}static nextFrameSpringConnect(t,e){const n=e?.springLength??100,i=e?.spring??.03,r=e?.gravity??0,a=e?.friction??.95;t.forEach(o=>{o.isDragging||t.filter(c=>c.id!==o.id).forEach(c=>{const h=o.angleTo(c);o.nextFrameSpringTo(new ni({x:c.x-Math.cos(ot(h))*n,y:c.y-Math.sin(ot(h))*n}),{spring:i,gravity:r,friction:a})})})}}class Et extends K{width;height;borderRadius;constructor(t){super(t),this.width=t.width,this.height=t.height,this.borderRadius=t.borderRadius||0}static fromBezier(t,e,n,i,r,a,o,c){const h=ee.curveDim(t,e,n,i,r,a,o,c);return new Et({x:h.min.x,y:h.min.y,width:h.max.x-h.min.x,height:h.max.y-h.min.y})}getBoundingClientRect(){return this}toSVGPathData(){return this.borderRadius?[["M",this.x+this.borderRadius,this.y],["l",this.width-this.borderRadius*2,0],["a",this.borderRadius,this.borderRadius,0,0,1,this.borderRadius,this.borderRadius],["l",0,this.height-this.borderRadius*2],["a",this.borderRadius,this.borderRadius,0,0,1,-this.borderRadius,this.borderRadius],["l",this.borderRadius*2-this.width,0],["a",this.borderRadius,this.borderRadius,0,0,1,-this.borderRadius,-this.borderRadius],["l",0,this.borderRadius*2-this.height],["a",this.borderRadius,this.borderRadius,0,0,1,this.borderRadius,-this.borderRadius],["z"]]:[["M",this.x,this.y],["l",this.width,0],["l",0,this.height],["l",-this.width,0],["z"]]}toCanvasContext(t){t.beginPath(),this.borderRadius<=0?t.rect(0,0,this.width,this.height):(t.moveTo(0,this.borderRadius),t.lineTo(0,this.height-this.borderRadius),t.quadraticCurveTo(0,this.height,this.borderRadius,this.height),t.lineTo(this.width-this.borderRadius,this.height),t.quadraticCurveTo(this.width,this.height,this.width,this.height-this.borderRadius),t.lineTo(this.width,this.borderRadius),t.quadraticCurveTo(this.width,0,this.width-this.borderRadius,0),t.lineTo(this.borderRadius,0),t.quadraticCurveTo(0,0,0,this.borderRadius)),t.closePath()}eq(t){return this.x===t.x&&this.y===t.y&&this.width===t.width&&this.height===t.height&&this.borderRadius===t.borderRadius}isIntersectRect(t){return!(this.x+this.width<t.x||t.x+t.width<this.x||this.y+this.height<t.y||t.y+t.height<this.y)}isContainPoint(t,e){return t>=this.x&&t<=this.x+this.width&&e>=this.y&&e<=this.y+this.height}clone(t){return new Et({x:t.x,y:t.y,width:t.width,height:t.height,borderRadius:t.borderRadius})}toArray(){return[this.x,this.y,this.width,this.height,this.borderRadius]}}class mt extends K{radius;constructor(t){super(t),this.radius=t?.radius||0}getBoundingClientRect(){return new Et({x:this.x-this.radius,y:this.y-this.radius,width:this.radius*2,height:this.radius*2})}toSVGPathData(){return this.radius?[["M",this.x,this.y-this.radius],["a",this.radius,this.radius,0,1,1,0,2*this.radius],["a",this.radius,this.radius,0,1,1,0,-2*this.radius],["z"]]:["M",this.x,this.y]}toCanvasContext(t){t.beginPath(),t.arc(0,0,this.radius,0,Math.PI*2,!0),t.closePath()}toArray(){return[this.x,this.y,this.radius]}setX(t){this.x=t}setY(t){this.y=t}setXY(t,e){this.x=t,this.y=e}eq(t){return this.x===t.x&&this.y===t.y&&this.radius===t.radius}midPointBtw(t){return new mt({x:this.x+(t.x-this.x)/2,y:this.y+(t.y-this.y)/2})}clone(t){return new mt({x:t.x,y:t.y,radius:t.radius})}nextFrameCollisionTo(t){const e=t.x-this.x,n=t.y-this.y;if(Math.sqrt(e*e+n*n)<this.radius+t.radius){const a=Math.atan2(n,e),o=Math.sin(a),c=Math.cos(a),h={x:0,y:0},l=r(e,n,o,c,!0),f=r(this.vx,this.vy,o,c,!0),g=r(t.vx,t.vy,o,c,!0),w=f.x-g.x;f.x=((this.mass-t.mass)*f.x+2*t.mass*g.x)/(this.mass+t.mass),g.x=w+f.x;const m=Math.abs(f.x)+Math.abs(g.x),v=this.radius+t.radius-Math.abs(h.x-l.x);h.x+=f.x/m*v,l.x+=g.x/m*v;const b=r(h.x,h.y,o,c,!1),S=r(l.x,l.y,o,c,!1);t.x=this.x+S.x,t.y=this.y+S.y,this.x=this.x+b.x,this.y=this.y+b.y;const C=r(f.x,f.y,o,c,!1),M=r(g.x,g.y,o,c,!1);this.vx=C.x,this.vy=C.y,t.vx=M.x,t.vy=M.y}function r(a,o,c,h,l=!1){return{x:l?a*h+o*c:a*h-o*c,y:l?o*h-a*c:o*h+a*c}}}nextFrameBounce(t,e){const n=t.x,i=t.y,r=t.x+t.width,a=t.y+t.height,o=e?.bounce??-1;this.x+this.radius>r?(this.x=r-this.radius,this.vx*=o):this.x-this.radius<n&&(this.x=n+this.radius,this.vx*=o),this.y+this.radius>a?(this.y=a-this.radius,this.vy*=o):this.y-this.radius<i&&(this.y=i+this.radius,this.vy*=o)}}const ni=mt;class si{constructor(){}static getFormatKeyNames(t){const e=kn(),n=[];return t.ctrl&&n.push(e?"Cmd":"Ctrl"),t.shift&&n.push("Shift"),t.alt&&n.push("Alt"),typeof t.key=="string"?n.push(Sn(t.key)):Array.isArray(t.key)&&(t.key.map(i=>Sn(i)),n.push(...t.key)),n}static matchKeyScheme(t,e){const n=t.ctrl??!1,i=t.shift??!1,r=t.alt??!1;if(t.exact)return(n===e.metaKey||n===e.ctrlKey)&&i===e.shiftKey&&r===e.altKey;const a=[];return n&&a.push(n===e.metaKey||n===e.ctrlKey),i&&a.push(i===e.shiftKey),r&&a.push(r===e.altKey),a.every(o=>o)}static on(t,e){if(t?.key===void 0||t?.key===null)return e;const n=t?.target??window;let i=!1;const r=this.getFormatKeyNames(t),a=o=>{if(o.stopPropagation(),!i&&o.key!=="Control"&&o.key!=="Meta"&&o.key!=="Shift"&&o.key!=="Option"&&o.key!=="Alt"&&r.find(c=>c.toLowerCase()===o.key.toLowerCase())&&this.matchKeyScheme(t,o)){o.preventDefault();const c=e(o);if(typeof c!="function")return;const h=l=>{l.preventDefault(),c(l),n.removeEventListener("keyup",h)};n.addEventListener("keyup",h)}};return e.title=t?.title??"",e.formatedKeyNames=r,e.pause=()=>i=!0,e.restart=()=>i=!1,e.removeListener=()=>n.removeEventListener("keydown",a),n.addEventListener("keydown",a),e}}let wt;const ne=[];class pe extends Rs{container;width;height;mousePoint;hammer;domEventBusRemoves=[];constructor(t=document.documentElement,e=!0){super(),this.container=t,this.width=this.container.clientWidth,this.height=this.container.clientHeight,this.hammer=new Aa(this.container),this.mousePoint=new mt({x:0,y:0}),e&&this.start()}emitDebounce=jr((t,...e)=>super.emit(t,...e),50);emit(t,...e){switch(t){case"panLeft":case"panRight":this.emitDebounce(t,...e);break;default:super.emit(t,...e);break}return this}static get page(){if(wt)return wt;wt=new pe,window.addEventListener("hashchange",()=>{wt.emit("hashchange",location.hash)}),window.addEventListener("popstate",()=>{wt.emit("popstate")}),wt.registerKeyDown({title:"打开",key:"o",ctrl:!0,exact:!0},()=>{Fs().then(e=>Ve(e[0])).then(e=>{wt.emit("openFile",e)}).catch(e=>{wt.emit("openFileError",e)})}),wt.registerMatchMediaChange("(prefers-color-scheme: dark)");const t=()=>ne.forEach(e=>e());return wt.registerGlobalScrollChange=e=>{ne.push(e),ne.length==1&&document.addEventListener("scroll",t)},wt.removeGlobalScrollChange=e=>{const n=ne.findIndex(i=>i==e);n>=0&&(ne.splice(n,1),ne.length==0&&document.removeEventListener("scroll",t))},wt}start(){this.registerMouseEventListeners(),this.registerInputEventListeners(),this.registerTransitionEventListeners(),this.on("pointerMove",this.setMousePoint),this.addDOMEventBusRemoves(()=>{this.off("pointerMove",this.setMousePoint)}),this.registerResizeObserver(),this.registerElementDisplayInParentWhenScrollChange()}restart(){this.destroy(),this.start()}destroy(){this.domEventBusRemoves.forEach(t=>t()),this.domEventBusRemoves=[],this.removeAllListeners()}addDOMEventBusRemoves(t){this.domEventBusRemoves.push(t)}setMousePoint(t){const e=qs(this.container,t);return this.mousePoint.x=e.x,this.mousePoint.y=e.y,e}registerMouseEventListeners(){const t=A=>{this.emit("mouseDown",A),this.container.style.userSelect="none"},e=A=>{this.emit("mouseUp",A),this.container.style.userSelect=""},n=A=>{this.emit("mouseMove",A)},i=A=>{this.emit("mouseOver",A)},r=A=>{this.emit("mouseOut",A),this.container.style.userSelect=""},a=A=>{this.emit("mouseClick",A)},o=A=>{this.emit("mouseDoubleClick",A)},c=A=>{this.emit("mouseWheel",A)},h=A=>{this.emit("mouseContextMenu",A)},l=A=>{this.emit("touchStart",A),this.container.style.userSelect="none"},f=A=>{this.emit("touchEnd",A),this.container.style.userSelect=""},g=A=>{this.emit("touchCancel",A),this.container.style.userSelect=""},w=A=>{this.emit("touchMove",A)},m=A=>{this.emit("pointerDown",A),this.container.style.userSelect="none"},v=A=>{this.emit("pointerUp",A),this.container.style.userSelect=""},b=A=>{this.emit("pointerCancel",A),this.container.style.userSelect=""},S=A=>{this.emit("pointerMove",A)},C=A=>{this.emit("pan",A)},M=A=>{this.emit("panStart",A),this.container.style.userSelect="none"},R=A=>{this.emit("panMove",A)},B=A=>{this.emit("panEnd",A),this.container.style.userSelect=""},N=A=>{this.emit("panCancel",A),this.container.style.userSelect=""},W=A=>{this.emit("panLeft",A)},it=A=>{this.emit("panRight",A)},q=A=>{this.emit("panUp",A),this.container.style.userSelect=""},tt=A=>{this.emit("panDown",A),this.container.style.userSelect="none"},Y=A=>{this.emit("pinch",A)},$=A=>{this.emit("press",A)},ht=A=>{this.emit("rotate",A)},rt=A=>{this.emit("swipe",A)},X=A=>{this.emit("tap",A)},V=A=>{!A.target||this.container==A.target||this.container.contains(A.target)||this.emit("tapOutSide",A)};this.container.addEventListener("mousedown",t),this.container.addEventListener("mouseup",e),this.container.addEventListener("mousemove",n),this.container.addEventListener("mouseover",i),this.container.addEventListener("mouseout",r),this.container.addEventListener("click",a),this.container.addEventListener("dblclick",o),this.container.addEventListener("wheel",c),this.container.addEventListener("contextmenu",h),this.container.addEventListener("touchstart",l),this.container.addEventListener("touchend",f),this.container.addEventListener("touchcancel",g),this.container.addEventListener("touchmove",w),this.container.addEventListener("pointerdown",m),this.container.addEventListener("pointerup",v),this.container.addEventListener("pointercancel",b),this.container.addEventListener("pointermove",S),this.hammer.on("pan",C),this.hammer.on("panstart",M),this.hammer.on("panmove",R),this.hammer.on("panend",B),this.hammer.on("pancancel",N),this.hammer.on("panleft",W),this.hammer.on("panright",it),this.hammer.on("panup",q),this.hammer.on("pandown",tt),this.hammer.on("pinch",Y),this.hammer.on("press",$),this.hammer.on("rotate",ht),this.hammer.on("swipe",rt),this.hammer.on("tap",X),document.addEventListener("pointerdown",V,!1);const U=()=>{this.container.removeEventListener("mousedown",t),this.container.removeEventListener("mouseup",e),this.container.removeEventListener("mousemove",n),this.container.removeEventListener("mouseover",i),this.container.removeEventListener("mouseout",r),this.container.removeEventListener("click",a),this.container.removeEventListener("dblclick",o),this.container.removeEventListener("wheel",c),this.container.removeEventListener("contextmenu",h),this.container.removeEventListener("touchstart",l),this.container.removeEventListener("touchend",f),this.container.removeEventListener("touchcancel",g),this.container.removeEventListener("touchmove",w),this.container.removeEventListener("pointerdown",m),this.container.removeEventListener("pointerup",v),this.container.removeEventListener("pointercancel",b),this.container.removeEventListener("pointermove",S),this.hammer.off("pan",C),this.hammer.off("panstart",M),this.hammer.off("panmove",R),this.hammer.off("panend",B),this.hammer.off("pancancel",N),this.hammer.off("panleft",W),this.hammer.off("panright",it),this.hammer.off("panup",q),this.hammer.off("pandown",tt),this.hammer.off("pinch",Y),this.hammer.off("press",$),this.hammer.off("rotate",ht),this.hammer.off("swipe",rt),this.hammer.off("tap",X),document.removeEventListener("pointerdown",V,!1),document.removeEventListener("touchstart",V,!1),document.removeEventListener("mousedown",V,!1)};return this.addDOMEventBusRemoves(U),U}registerInputEventListeners(){const t=c=>{this.emit("inputChange",c,this.container.files)},e=c=>{this.emit("dragstart",c)},n=c=>{c.stopPropagation(),c.preventDefault(),c.dataTransfer&&(c.dataTransfer.dropEffect="copy"),this.emit("dragover",c)},i=c=>{this.emit("dragenter",c)},r=c=>{this.emit("dragend",c)},a=c=>{c.stopPropagation(),c.preventDefault(),c.dataTransfer,this.emit("drop",c,c.dataTransfer?.files)};this.container instanceof HTMLInputElement&&this.container.addEventListener("change",t,!1),this.container.addEventListener("dragstart",e,!1),this.container.addEventListener("dragover",n,!1),this.container.addEventListener("dragenter",i,!1),this.container.addEventListener("dragend",r,!1),this.container.addEventListener("drop",a,!1);const o=()=>{this.container instanceof HTMLInputElement&&this.container.removeEventListener("change",t,!1),this.container.removeEventListener("dragstart",e,!1),this.container.removeEventListener("dragover",n,!1),this.container.removeEventListener("dragenter",i,!1),this.container.removeEventListener("dragend",r,!1),this.container.removeEventListener("drop",a,!1)};return this.addDOMEventBusRemoves(o),o}registerTransitionEventListeners(){const t=n=>{this.emit("transitionend",n)};this.container.addEventListener("transitionend",t);const e=()=>{this.container.removeEventListener("transitionend",t)};return this.addDOMEventBusRemoves(e),e}registerKeyDown(t,e,n){const i=si.on(t,a=>(e(a,i.formatedKeyNames,i.pause,i.restart),n)),r=()=>{i.removeListener?.()};return this.addDOMEventBusRemoves(r),r}registerResizeObserver(){const t=new ResizeObserver(n=>{const{width:i,height:r}=n[0].contentRect;this.width=i,this.height=r,this.emit("resize",i,r)});t.observe(this.container);const e=()=>{t.unobserve(this.container)};return this.addDOMEventBusRemoves(e),e}registerMatchMediaChange(t){let e="";switch(t){case"(prefers-color-scheme: dark)":e="matchMediaChangePrefersColorSchemeDark";break;default:e=t;break}const n=r=>{this.emit(e,r.matches)};window.matchMedia(t).addEventListener("change",n);const i=()=>{window.matchMedia(t).removeEventListener("change",n)};return this.addDOMEventBusRemoves(i),i}registerElementDisplayInParentWhenScrollChange(t){const e={threshold:t?.threshold||.5,root:t?.parentElement},n=new IntersectionObserver((r,a)=>{let o=r[0];if(r.length>1){const h=r.find(l=>l.isIntersecting);h&&(o=h)}o.isIntersecting&&o.intersectionRatio>=e.threshold?this.emit("showInParent"):this.emit("showOffParent")},e);n.observe(this.container);const i=()=>{n.unobserve(this.container)};return this.addDOMEventBusRemoves(i),i}registerPullDownRefresh(t){const e=t?.distance||50;let n=0,i=0;return this.captureMove({start:r=>{n=this.setMousePoint(r).y},move:()=>{i=this.mousePoint.y-n,i>0&&i<e&&this.emit("pullDownIng",i)},end:()=>{i>=e&&this.emit("pullDown")}})}registerPullUpLoading(t){const e=t?.distance||50;let n=0,i=0;return this.captureMove({start:r=>{n=this.setMousePoint(r).y},move:()=>{i=n-this.mousePoint.y,i>0&&i<e&&this.emit("pullUpIng",i)},end:()=>{i>=e&&this.emit("pullUp")}})}static isTouchEnabled(){return"ontouchstart"in window||navigator.maxTouchPoints>0}captureMove(t){return this.captureMoveUsePointer(t)}captureMoveUsePointer(t){const e=a=>{this.container.setPointerCapture(a.pointerId),this.container.style.userSelect="none",t?.start?.(a)},n=a=>{this.container.style.userSelect="",t?.end?.(a)},i=a=>{t?.move?.(a)};this.on("pointerDown",e),this.on("pointerUp",n),this.on("pointerCancel",n),this.on("pointerMove",i);const r=()=>{this.off("pointerDown",e),this.off("pointerUp",n),this.off("pointerCancel",n),this.off("pointerMove",i)};return this.addDOMEventBusRemoves(r),r}captureMoveUseMouse(t){const e=a=>{document.addEventListener("mousemove",i,!1),document.addEventListener("mouseup",n,!1),this.container.style.userSelect="none",t?.start?.(a)},n=a=>{document.removeEventListener("mousemove",i,!1),document.removeEventListener("mouseup",n,!1),this.container.style.userSelect="",t?.end?.(a)},i=a=>{t?.move?.(a)};this.on("mouseDown",e);const r=()=>{this.off("mouseDown",e)};return this.addDOMEventBusRemoves(r),r}captureMoveUseTouch(t){const e=a=>{a.preventDefault(),t?.start?.(a)},n=a=>{t?.end?.(a)},i=a=>{t?.move?.(a)};this.on("touchStart",e),this.on("touchEnd",n),this.on("touchCancel",n),this.on("touchMove",i);const r=()=>{this.off("touchStart",e),this.off("touchEnd",n),this.off("touchCancel",n),this.off("touchMove",i)};return this.addDOMEventBusRemoves(r),r}static getMouseButton(t){if(document.implementation.hasFeature("MouseEvents","2.0"))return t.button;switch(t.button){case 0:case 1:case 3:case 5:case 7:return 0;case 2:case 6:return 2;case 4:return 1}}}class ge{video;constructor(t){this.video=t}setSrcObject(t){this.video.addEventListener("loadedmetadata",e=>{e.target}),this.video.srcObject=t}captureWebCamera(){navigator.mediaDevices.getUserMedia({video:!0}).then(t=>{this.setSrcObject(t)})}static async videoMediaChangeSupport(){return new Promise(t=>{const e=document.createElement("iframe"),n=document.createElement("video"),i=document.createElement("source"),r=new MediaSource;r.addEventListener("sourceopen",()=>t(!0)),i.src=URL.createObjectURL(r),i.media="(min-width:10px)",n.append(i),e.width="5",e.style.cssText="position: absolute; visibility: hidden;",document.documentElement.append(e),e.contentDocument?.body.append(n),setTimeout(()=>{e.width="15"}),setTimeout(()=>{e.remove(),t(!1)},1e3)})}static tryAutoPlayOrAutoPlayAfterClick(t){return new Promise(e=>{t.play().then(()=>{t.autoplay=!0,e(!0)}).catch(()=>{ge.setAutoPlayWhenClick(t),e(!1)})})}static setAutoPlayWhenClick(t){function e(){t.autoplay=!0,t.play(),document.removeEventListener("click",e),document.removeEventListener("touchend",e)}document.addEventListener("click",e),document.addEventListener("touchend",e)}}class ii extends Rs{source;raw="";mode="text";tagname="";nodename="";textchunk="";entity="";quote="";attrs={};constructor(t){super(),this.source=t}parse(){const t=Ts(this.source);if(t===0){this.emit("finish");return}let e,n,i=Es(this.source,0);for(let r=1;r<t;r++)e=n,n=i,i=Es(this.source,r),this.raw+=n,n&&this.step(n,i,e);i&&this.step(i,void 0,n),this.emit("finish")}step(t,e,n){t==`
|
|
25
|
-
`&&this.emit("newline"),this.act(t,e,n)}act(t,e,n){switch(this.mode){case"text":switch(t){case"<":case"eof":this.nodename="",this.attrs={},this.mode="tag name start",this.raw=this.raw.slice(0,-1),this.textchunk&&this.emit("text",this.textchunk),this.raw+=t,this.textchunk="";break;case"&":this.mode="entity",this.entity="";break;default:this.textchunk+=t;break}break;case"entity":Rt("whitespace",t)?(this.textchunk+=D.entity2text(this.entity),this.mode="text"):t==";"?(this.textchunk+=D.entity2text(this.entity+t),this.mode="text"):this.entity+=t;break;case"special":if(n=="!"&&t=="-"&&e=="-"){this.mode="comment start";break}if(this.textchunk=="[CDATA"&&t=="["){this.mode="cdata",this.textchunk="";break}if(t==">"||t=="eof"){this.emit("special",this.textchunk),this.mode="text",this.textchunk="";break}this.textchunk+=t;break;case"cdata":if(n=="]"&&t=="]"&&e==">"){this.mode="cdata end",this.textchunk=this.textchunk.slice(0,-1);break}t=="eof"&&(this.mode="cdata end",this.act(t,e,n)),this.textchunk+=t;break;case"cdata end":this.emit("cdata",this.textchunk),this.textchunk="",this.mode="text";break;case"comment start":e==">"||t=="eof"?(this.emit("comment",""),this.mode="skip"):this.mode="comment";break;case"skip":this.mode="text";break;case"comment":t=="-"&&n=="-"&&e==">"?(this.mode="comment end",this.textchunk=this.textchunk.slice(0,-1)):t=="eof"?this.emit("comment",this.textchunk):this.textchunk+=t;break;case"comment end":this.emit("comment",this.textchunk),this.textchunk="",this.mode="text";break;case"declaration":if(t=="?"&&e==">"){this.mode="declaration end";break}t=="eof"&&this.emit("comment",this.textchunk),this.textchunk+=t;break;case"declaration end":this.emit("comment",this.textchunk),this.textchunk="",this.mode="text";break;case"tag name start":if(t=="eof"){this.emit("text","<");break}if(!Rt("whitespace",t)){if(this.mode="tag name",t=="/"){this.mode="close tag name start";break}else if(t=="!"){this.mode="special",this.textchunk="";break}else if(t=="?"){this.mode="declaration";break}this.act(t,e,n)}break;case"close tag name start":Rt("whitespace",t)||(this.mode="close tag name",this.tagname="",this.nodename="",this.act(t,e,n));break;case"close tag name":if(Rt("whitespace",t))this.tagname=this.nodename;else switch(t){case">":this.emit("/tag",this.tagname||this.nodename,this.attrs),this.mode="text";break;default:!this.tagname&&(this.nodename+=t);break}break;case"tag name":if(Rt("whitespace",t))this.tagname=this.nodename,this.nodename="",this.mode="attr start";else switch(t){case">":this.emit("tag",this.nodename,this.attrs),this.mode="text";break;case"/":this.raw+=e,this.emit("tag",this.nodename,this.attrs),this.emit("/tag",this.nodename,this.attrs),this.mode="skip";break;default:this.nodename+=t;break}break;case"attr start":Rt("whitespace",t)||(this.mode="attr",this.nodename="",this.act(t,e,n));break;case"attr":if(Rt("whitespace",t)||t=="=")this.attrs[this.nodename]="",this.mode="attr value start";else switch(t){case">":this.nodename=="/"?(delete this.attrs["/"],this.emit("tag",this.tagname,this.attrs),this.emit("/tag",this.tagname,this.attrs)):(this.nodename&&(this.attrs[this.nodename]=""),this.emit("tag",this.tagname,this.attrs)),this.mode="text";break;default:this.nodename+=t;break}break;case"attr value start":if(!Rt("whitespace",t)){if(this.mode="attr value",this.quote="",t=="'"||t=='"'){this.quote=t;return}this.act(t,e,n)}break;case"attr value":if(Rt("whitespace",t)&&!this.quote)this.mode="attr start";else if(t==">"&&!this.quote)this.emit("tag",this.tagname,this.attrs),this.mode="text";else switch(t){case'"':case"'":this.quote==t&&n!="\\"&&(this.mode="attr start");break;default:this.attrs[this.nodename]+=t;break}break}}}function Ln(s,t){if(typeof t<"u")window.localStorage.setItem(s,t);else return window.localStorage.getItem(s)??void 0}function ka(s,t,e){const n=new Date;n.setTime(n.getTime()+e*24*60*60*1e3);const i="expires="+n.toUTCString();document.cookie=s+"="+t+"; "+i}function Ia(s){const t=s+"=",e=document.cookie.split(";");for(let n=0,i=e.length;n<i;n++){const r=e[n].trim();if(r.indexOf(t)==0)return r.substring(t.length,r.length)}return""}const Ma=()=>document.cookie.split(";").map(s=>s.split("=")).reduce((s,[t,e])=>(s[t.trim().replace('"',"")]=e,s),{}),Ra=()=>document.cookie.split(";").forEach(s=>document.cookie=s.replace(/^ +/,"").replace(/=.*/,`=;expires=${new Date().toUTCString()};path=/`));pe.page.on("matchMediaChangePrefersColorSchemeDark",s=>{je(s?"dark":"light")}),ri();function je(s){Ln("colorScheme",s),document.documentElement.classList.toggle("dark",s=="dark")}function ri(){const s=Ln("colorScheme");if(s=="dark"||s=="light")return je(s),s;{const t=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";return je(t),t}}const Oa={safeAreaTop:D.getCSSVar("--safe-area-inset-top"),safeAreaRight:D.getCSSVar("--safe-area-inset-right"),safeAreaBottom:D.getCSSVar("--safe-area-inset-bottom"),safeAreaLeft:D.getCSSVar("--safe-area-inset-left"),colorPrimary:D.getCSSVar("--color-primary")||"#5078f0",colorRed:D.getCSSVar("--color-red")||"#ff5050",colorOrange:D.getCSSVar("--color-orange")||"#fa8c00",colorYellow:D.getCSSVar("--color-yellow")||"#fadc32",colorGreen:D.getCSSVar("--color-green")||"#00c878",colorBlue:D.getCSSVar("--color-blue")||"#00b4fa",colorPurple:D.getCSSVar("--color-purple")||"#6464fa",colorBlack:D.getCSSVar("--color-black")||"#001428",colorGray00:D.getCSSVar("--color-gray-00")||"#000000",colorGray33:D.getCSSVar("--color-gray-33")||"#333333",colorGray66:D.getCSSVar("--color-gray-66")||"#666666",colorGray99:D.getCSSVar("--color-gray-99")||"#999999",colorGrayCC:D.getCSSVar("--color-gray-cc")||"#cccccc",colorGrayDD:D.getCSSVar("--color-gray-dd")||"#dddddd",colorGrayE6:D.getCSSVar("--color-gray-e6")||"#e6e6e6",colorGrayEE:D.getCSSVar("--color-gray-ee")||"#eeeeee",colorGrayEF:D.getCSSVar("--color-gray-ef")||"#efefef",colorGrayF5:D.getCSSVar("--color-gray-f5")||"#f5f5f5",colorGrayFF:D.getCSSVar("--color-gray-ff")||"#ffffff",fontLineHeight:D.getCSSVar("--font-line-height")||"1,4",fontSize32:D.getCSSVar("--font-size-32")||"32px",fontSize24:D.getCSSVar("--font-size-24")||"24px",fontSize20:D.getCSSVar("--font-size-20")||"20px",fontSize18:D.getCSSVar("--font-size-18")||"18px",fontSize16:D.getCSSVar("--font-size-16")||"16px",fontSize14:D.getCSSVar("--font-size-14")||"14px",fontSize12:D.getCSSVar("--font-size-12")||"12px",fontSize11:D.getCSSVar("--font-size-11")||"11px",gap4:D.getCSSVar("--gap-4")||"4px",gap8:D.getCSSVar("--gap-8")||"8px",gap12:D.getCSSVar("--gap-12")||"12px",gap16:D.getCSSVar("--gap-16")||"16px",gap20:D.getCSSVar("--gap-20")||"20px",gap40:D.getCSSVar("--gap-40")||"40px",height44:D.getCSSVar("--height-44")||"44px",height32:D.getCSSVar("--height-32")||"32px",borderRadius:D.getCSSVar("--border-radius")||"4px"};function $t(s,t){if(s.hasOwnProperty("r")&&s.hasOwnProperty("g")&&s.hasOwnProperty("b"))return s.r=Math.round(yt(s.r,0,255)),s.g=Math.round(yt(s.g,0,255)),s.b=Math.round(yt(s.b,0,255)),s.hasOwnProperty("a")?s.a=typeof t=="number"?t:s.a:s.a=typeof t=="number"?t:1,s.a=yt(s.a,0,1),s;const e={r:0,g:0,b:0,a:1};let n=-1;if(typeof s=="number")n=s;else if(typeof s=="string")if(s[0].toLowerCase()==="r"){const i=/rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,?\s*(\d?\.?\d*)?\s*\)/gi.exec(s);i&&(n=(parseInt(i[1])<<16)+(parseInt(i[2])<<8)+parseInt(i[3]),i[4]&&(e.a=parseFloat(i[4])))}else if(s[0]==="#")n=parseInt(s.slice(1,7),16),s.length>7&&(e.a=Qt(parseInt(s.slice(7,9),16)/255,2));else throw new Error("getColor 不支持的颜色解析:"+s);return n>=0&&(e.r=n>>16&255,e.g=n>>8&255,e.b=n&255),typeof t=="number"&&(e.a=t),e.a=yt(e.a,0,1),e}function La(s,t){const e=$t(s,t);return e.a===1?`rgb(${e.r},${e.g},${e.b})`:`rgba(${e.r},${e.g},${e.b},${e.a})`}function ye(s){return Lr(s.toString(16),2,"0","left")}function Xe(s,t){const e=$t(s,t);let n=`#${ye(e.r)}${ye(e.g)}${ye(e.b)}`;return e.a===1?n:n+`${ye(e.a)}`}const ai=()=>Math.random()*16777215,Na=()=>Xe(ai());function Fa(s,t){const e=$t(s);return e.r==0&&(e.r=32),e.g==0&&(e.g=32),e.b==0&&(e.b=32),e.r=e.r*(100+t)/100,e.g=e.g*(100+t)/100,e.b=e.b*(100+t)/100,e.r=Math.round(yt(e.r,0,255)),e.g=Math.round(yt(e.g,0,255)),e.b=Math.round(yt(e.b,0,255)),Xe(e)}function Ba(s,t,e){const n=$t(s),i=$t(t);return Xe({r:(i.r-n.r)*e+n.r,g:(i.g-n.g)*e+n.g,b:(i.b-n.b)*e+n.b})}function Ua(s,t,e,n){let i,r,a;s=s/360,t=t/100,e=e/100;const o=Math.floor(s*6),c=s*6-o,h=e*(1-t),l=e*(1-c*t),f=e*(1-(1-c)*t);switch(o%6){case 0:i=e,r=f,a=h;break;case 1:i=l,r=e,a=h;break;case 2:i=h,r=e,a=f;break;case 3:i=h,r=l,a=e;break;case 4:i=f,r=h,a=e;break;case 5:default:i=e,r=h,a=l;break}return{r:Math.round(i*255),g:Math.round(r*255),b:Math.round(a*255),opacity:n??1}}function Va(s,t,e,n){s*=360;let i,r,a,o,c;return s=s%360/60,c=e*t,o=c*(1-Math.abs(s%2-1)),i=r=a=e-c,s=~~s,i+=[c,o,0,0,o,c][s],r+=[o,c,c,o,0,0][s],a+=[0,0,o,c,c,o][s],{r:i,g:r,b:a,opacity:n??1}}function Ga(s,t,e,n){(s>1||t>1||e>1)&&(s/=360,t/=100,e/=100),s*=360;var i,r,a,o,c;return s=s%360/60,c=2*t*(e<.5?e:1-e),o=c*(1-Math.abs(s%2-1)),i=r=a=e-c/2,s=~~s,i+=[c,o,0,0,o,c][s],r+=[o,c,c,o,0,0][s],a+=[0,0,o,c,c,o][s],{r:i,g:r,b:a,opacity:n??1}}function ja(s,t,e,n){const i=Math.max(s,t,e),r=Math.min(s,t,e),a=i-r,o=i===0?0:a/i,c=i/255;let h;switch(i){case r:h=0;break;case s:h=t-e+a*(t<e?6:0),h/=6*a;break;case t:h=e-s+a*2,h/=6*a;break;case e:default:h=s-t+a*4,h/=6*a;break}return{h:Math.round(h*360),s:Math.round(o*100),v:Math.round(c*100),opacity:n??1}}function Xa(s,t,e){let n,i,r,a;return r=Math.max(s,t,e),a=r-Math.min(s,t,e),n=a==0?0:r==s?(t-e)/a:r==t?(e-s)/a+2:(s-t)/a+4,n=(n+360)%6*60/360,i=a==0?0:a/r,{h:n,s:i,b:r}}function za(s,t,e){let n,i,r,a,o,c;return a=Math.max(s,t,e),o=Math.min(s,t,e),c=a-o,n=c==0?0:a==s?(t-e)/c:a==t?(e-s)/c+2:(s-t)/c+4,n=(n+360)%6*60/360,r=(a+o)/2,i=c==0?0:r<.5?c/(2*r):c/(2-2*r),{h:n,s:i,l:r}}function ze(s=window.location.href){return Is(URL)?new URL(s):oi(s)}function oi(s=window.location.href){const t="(?<protocol>https?:)",e="(?<host>(?<hostname>[^/#?:]+)(?::(?<port>\\d+))?)",n="(?<pathname>(?:\\/[^/#?]+)*\\/?)",i="(?<search>(?:\\?[^#]*)?)",r="(?<hash>(?:#.*)?)",o=new RegExp(`^${t}//${e}${n}${i}${r}$`).exec(s);return{href:s,protocol:o?.groups?.protocol??"",host:o?.groups?.host??"",hostname:o?.groups?.hostname??"",port:o?.groups?.port??"",pathname:o?.groups?.pathname??"",search:o?.groups?.search??"",hash:o?.groups?.hash??""}}function qa(s){const t=ze(s);return t.protocol==="http:"||t.protocol==="https:"}function ci(s=window.location.href){const t=ze(s),e=t.href.indexOf(t.hash);return t.hash&&e>=0?t.href.substring(0,e):t.href}function Ya(s=ze().search){s=decodeURIComponent(s).replace(/^[#?&]/,"");const t={};if(!s)return t;const e=/(?:^|&)([^&=]*)=?([^&]*?)(?=&|$)/y;let n=e.exec(s);for(;n;)t[n[1]]=n[2],n=e.exec(s);return t}function hi(s){return"?"+Object.entries(s).map(([t,e])=>`${encodeURIComponent(t)}=${encodeURIComponent(e)}`).join("&")}function li(s){return"?"+[...s.entries()].map(t=>encodeURIComponent(t[0])+"="+encodeURIComponent(t[1]instanceof File?t[1].name:t[1])).join("&")}function Ha(s,t){return s.replace(/(?:\?.*)?$/,t.replace(/^[&?]/,"?"))}function ui(s,t){return s+t.replace(/^[&?]/,s.indexOf("?")>=0?"&":"?")}function Wa(s){let t=null;if(Zs)try{t=new Worker(URL.createObjectURL(new Blob([s])))}catch(e){return typeof console!==void 0&&typeof console.warn=="function"&&console.warn("🎊 Could not load worker",e),null}return t}function fi(){let s=null;if(window.ActiveXObject){const t=["Microsoft.XMLHTTP","MSXML6.XMLHTTP","MSXML5.XMLHTTP","MSXML4.XMLHTTP","MSXML3.XMLHTTP","MSXML2.XMLHTTP","MSXML.XMLHTTP"];for(let e=0;e<t.length;e++)try{s=new window.ActiveXObject(t[e]);break}catch{continue}}else s=new XMLHttpRequest;return s}function $a(s){return new Promise((t,e)=>{fetch(s,{}).then(n=>n.text()).then(t).catch(e)})}function Ja(s,t){return new Promise((e,n)=>{const{method:i="GET",data:r={},segments:a=[],headers:o={},withCredentials:c=!1,responseType:h="json",timeout:l=3e4}=t||{},f=fi();f.timeout=l,f.responseType=h,f.onreadystatechange=function(C){f.readyState===4&&(f.status===200?e(f.response):n(f.statusText))},f.ontimeout=function(){n(`${s} is timed out for ${l}ms.`)},f.addEventListener("error",function(C){n(C)},!1),f.addEventListener("progress",function(C){if(C.lengthComputable){const M=Math.round(C.loaded*100/C.total);t?.progress?.(M,f)}},!1),f.addEventListener("load",function(C){t?.load?.(C,f)},!1),f.addEventListener("loadstart",function(C){t?.loadstart?.(C,f)},!1),f.addEventListener("loadend",function(C){t?.loadend?.(C,f)},!1),f.addEventListener("abort",function(C){t?.abort?.(C,f)},!1);const g=i.toUpperCase();Object.assign(o,{Accept:"*/*"});const w="---------------------------"+Date.now().toString(16);let m=!1,v=!1,b=!1;function S(){c&&(f.withCredentials=!0);for(const C in o)ft(C).toLowerCase()=="content-type"&&o[C].toLowerCase()=="multipart/form-data"?(m=!0,f.setRequestHeader("Content-Type","multipart/form-data; boundary="+w)):(ft(C).toLowerCase()=="content-type"&&(o[C].toLowerCase().indexOf("text/plain")>=0?v=!0:o[C].toLowerCase().indexOf("application/json")>=0&&(b=!0)),f.setRequestHeader(C,o[C]))}switch(g){case"GET":let C="";r instanceof FormData?C=li(r):C=hi(r),f.open("GET",ui(s,C),!0),S(),f.send(null);break;case"POST":default:f.open(g,s,!0),S(),m&&a.length?f.sendAsBinary("--"+w+`\r
|
|
24
|
+
`;return function(){var P=new Error("get-stack-trace"),I=P&&P.stack?P.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",O=t.console&&(t.console.warn||t.console.log);return O&&O.call(t.console,x,I),u.apply(this,arguments)}}var v;typeof Object.assign!="function"?v=function(d){if(d===i||d===null)throw new TypeError("Cannot convert undefined or null to object");for(var y=Object(d),x=1;x<arguments.length;x++){var P=arguments[x];if(P!==i&&P!==null)for(var I in P)P.hasOwnProperty(I)&&(y[I]=P[I])}return y}:v=Object.assign;var b=m(function(d,y,x){for(var P=Object.keys(y),I=0;I<P.length;)(!x||x&&d[P[I]]===i)&&(d[P[I]]=y[P[I]]),I++;return d},"extend","Use `assign`."),S=m(function(d,y){return b(d,y,!0)},"merge","Use `assign`.");function C(u,d,y){var x=d.prototype,P;P=u.prototype=Object.create(x),P.constructor=u,P._super=x,y&&v(P,y)}function M(u,d){return function(){return u.apply(d,arguments)}}function R(u,d){return typeof u==o?u.apply(d&&d[0]||i,d):u}function B(u,d){return u===i?d:u}function N(u,d,y){w(nt(d),function(x){u.addEventListener(x,y,!1)})}function W(u,d,y){w(nt(d),function(x){u.removeEventListener(x,y,!1)})}function it(u,d){for(;u;){if(u==d)return!0;u=u.parentNode}return!1}function q(u,d){return u.indexOf(d)>-1}function nt(u){return u.trim().split(/\s+/g)}function Y(u,d,y){if(u.indexOf&&!y)return u.indexOf(d);for(var x=0;x<u.length;){if(y&&u[x][y]==d||!y&&u[x]===d)return x;x++}return-1}function $(u){return Array.prototype.slice.call(u,0)}function ht(u,d,y){for(var x=[],P=[],I=0;I<u.length;){var O=d?u[I][d]:u[I];Y(P,O)<0&&x.push(u[I]),P[I]=O,I++}return y&&(d?x=x.sort(function(at,ut){return at[d]>ut[d]}):x=x.sort()),x}function rt(u,d){for(var y,x,P=d[0].toUpperCase()+d.slice(1),I=0;I<r.length;){if(y=r[I],x=y?y+P:d,x in u)return x;I++}return i}var j=1;function V(){return j++}function U(u){var d=u.ownerDocument||u;return d.defaultView||d.parentWindow||t}var A=/mobile|tablet|ip(ad|hone|od)|android/i,k="ontouchstart"in t,_=rt(t,"PointerEvent")!==i,F=k&&A.test(navigator.userAgent),G="touch",St="pen",Ht="mouse",hl="kinect",ll=25,lt=1,Kt=2,K=4,dt=8,dn=1,Re=2,Oe=4,Le=8,Ne=16,It=Re|Oe,Qt=Le|Ne,mr=It|Qt,pr=["x","y"],mn=["clientX","clientY"];function Ct(u,d){var y=this;this.manager=u,this.callback=d,this.element=u.element,this.target=u.options.inputTarget,this.domHandler=function(x){R(u.options.enable,[u])&&y.handler(x)},this.init()}Ct.prototype={handler:function(){},init:function(){this.evEl&&N(this.element,this.evEl,this.domHandler),this.evTarget&&N(this.target,this.evTarget,this.domHandler),this.evWin&&N(U(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&W(this.element,this.evEl,this.domHandler),this.evTarget&&W(this.target,this.evTarget,this.domHandler),this.evWin&&W(U(this.element),this.evWin,this.domHandler)}};function ul(u){var d,y=u.options.inputClass;return y?d=y:_?d=ps:F?d=yn:k?d=gs:d=gn,new d(u,fl)}function fl(u,d,y){var x=y.pointers.length,P=y.changedPointers.length,I=d<&&x-P===0,O=d&(K|dt)&&x-P===0;y.isFirst=!!I,y.isFinal=!!O,I&&(u.session={}),y.eventType=d,dl(u,y),u.emit("hammer.input",y),u.recognize(y),u.session.prevInput=y}function dl(u,d){var y=u.session,x=d.pointers,P=x.length;y.firstInput||(y.firstInput=gr(d)),P>1&&!y.firstMultiple?y.firstMultiple=gr(d):P===1&&(y.firstMultiple=!1);var I=y.firstInput,O=y.firstMultiple,st=O?O.center:I.center,at=d.center=yr(x);d.timeStamp=l(),d.deltaTime=d.timeStamp-I.timeStamp,d.angle=ms(st,at),d.distance=pn(st,at),ml(y,d),d.offsetDirection=vr(d.deltaX,d.deltaY);var ut=wr(d.deltaTime,d.deltaX,d.deltaY);d.overallVelocityX=ut.x,d.overallVelocityY=ut.y,d.overallVelocity=h(ut.x)>h(ut.y)?ut.x:ut.y,d.scale=O?yl(O.pointers,x):1,d.rotation=O?gl(O.pointers,x):0,d.maxPointers=y.prevInput?d.pointers.length>y.prevInput.maxPointers?d.pointers.length:y.prevInput.maxPointers:d.pointers.length,pl(y,d);var Rt=u.element;it(d.srcEvent.target,Rt)&&(Rt=d.srcEvent.target),d.target=Rt}function ml(u,d){var y=d.center,x=u.offsetDelta||{},P=u.prevDelta||{},I=u.prevInput||{};(d.eventType===lt||I.eventType===K)&&(P=u.prevDelta={x:I.deltaX||0,y:I.deltaY||0},x=u.offsetDelta={x:y.x,y:y.y}),d.deltaX=P.x+(y.x-x.x),d.deltaY=P.y+(y.y-x.y)}function pl(u,d){var y=u.lastInterval||d,x=d.timeStamp-y.timeStamp,P,I,O,st;if(d.eventType!=dt&&(x>ll||y.velocity===i)){var at=d.deltaX-y.deltaX,ut=d.deltaY-y.deltaY,Rt=wr(x,at,ut);I=Rt.x,O=Rt.y,P=h(Rt.x)>h(Rt.y)?Rt.x:Rt.y,st=vr(at,ut),u.lastInterval=d}else P=y.velocity,I=y.velocityX,O=y.velocityY,st=y.direction;d.velocity=P,d.velocityX=I,d.velocityY=O,d.direction=st}function gr(u){for(var d=[],y=0;y<u.pointers.length;)d[y]={clientX:c(u.pointers[y].clientX),clientY:c(u.pointers[y].clientY)},y++;return{timeStamp:l(),pointers:d,center:yr(d),deltaX:u.deltaX,deltaY:u.deltaY}}function yr(u){var d=u.length;if(d===1)return{x:c(u[0].clientX),y:c(u[0].clientY)};for(var y=0,x=0,P=0;P<d;)y+=u[P].clientX,x+=u[P].clientY,P++;return{x:c(y/d),y:c(x/d)}}function wr(u,d,y){return{x:d/u||0,y:y/u||0}}function vr(u,d){return u===d?dn:h(u)>=h(d)?u<0?Re:Oe:d<0?Le:Ne}function pn(u,d,y){y||(y=pr);var x=d[y[0]]-u[y[0]],P=d[y[1]]-u[y[1]];return Math.sqrt(x*x+P*P)}function ms(u,d,y){y||(y=pr);var x=d[y[0]]-u[y[0]],P=d[y[1]]-u[y[1]];return Math.atan2(P,x)*180/Math.PI}function gl(u,d){return ms(d[1],d[0],mn)+ms(u[1],u[0],mn)}function yl(u,d){return pn(d[0],d[1],mn)/pn(u[0],u[1],mn)}var wl={mousedown:lt,mousemove:Kt,mouseup:K},vl="mousedown",bl="mousemove mouseup";function gn(){this.evEl=vl,this.evWin=bl,this.pressed=!1,Ct.apply(this,arguments)}C(gn,Ct,{handler:function(d){var y=wl[d.type];y<&&d.button===0&&(this.pressed=!0),y&Kt&&d.which!==1&&(y=K),this.pressed&&(y&K&&(this.pressed=!1),this.callback(this.manager,y,{pointers:[d],changedPointers:[d],pointerType:Ht,srcEvent:d}))}});var xl={pointerdown:lt,pointermove:Kt,pointerup:K,pointercancel:dt,pointerout:dt},Sl={2:G,3:St,4:Ht,5:hl},br="pointerdown",xr="pointermove pointerup pointercancel";t.MSPointerEvent&&!t.PointerEvent&&(br="MSPointerDown",xr="MSPointerMove MSPointerUp MSPointerCancel");function ps(){this.evEl=br,this.evWin=xr,Ct.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}C(ps,Ct,{handler:function(d){var y=this.store,x=!1,P=d.type.toLowerCase().replace("ms",""),I=xl[P],O=Sl[d.pointerType]||d.pointerType,st=O==G,at=Y(y,d.pointerId,"pointerId");I<&&(d.button===0||st)?at<0&&(y.push(d),at=y.length-1):I&(K|dt)&&(x=!0),!(at<0)&&(y[at]=d,this.callback(this.manager,I,{pointers:y,changedPointers:[d],pointerType:O,srcEvent:d}),x&&y.splice(at,1))}});var Cl={touchstart:lt,touchmove:Kt,touchend:K,touchcancel:dt},Tl="touchstart",El="touchstart touchmove touchend touchcancel";function Sr(){this.evTarget=Tl,this.evWin=El,this.started=!1,Ct.apply(this,arguments)}C(Sr,Ct,{handler:function(d){var y=Cl[d.type];if(y===lt&&(this.started=!0),!!this.started){var x=Pl.call(this,d,y);y&(K|dt)&&x[0].length-x[1].length===0&&(this.started=!1),this.callback(this.manager,y,{pointers:x[0],changedPointers:x[1],pointerType:G,srcEvent:d})}}});function Pl(u,d){var y=$(u.touches),x=$(u.changedTouches);return d&(K|dt)&&(y=ht(y.concat(x),"identifier",!0)),[y,x]}var _l={touchstart:lt,touchmove:Kt,touchend:K,touchcancel:dt},Dl="touchstart touchmove touchend touchcancel";function yn(){this.evTarget=Dl,this.targetIds={},Ct.apply(this,arguments)}C(yn,Ct,{handler:function(d){var y=_l[d.type],x=Al.call(this,d,y);x&&this.callback(this.manager,y,{pointers:x[0],changedPointers:x[1],pointerType:G,srcEvent:d})}});function Al(u,d){var y=$(u.touches),x=this.targetIds;if(d&(lt|Kt)&&y.length===1)return x[y[0].identifier]=!0,[y,y];var P,I,O=$(u.changedTouches),st=[],at=this.target;if(I=y.filter(function(ut){return it(ut.target,at)}),d===lt)for(P=0;P<I.length;)x[I[P].identifier]=!0,P++;for(P=0;P<O.length;)x[O[P].identifier]&&st.push(O[P]),d&(K|dt)&&delete x[O[P].identifier],P++;if(st.length)return[ht(I.concat(st),"identifier",!0),st]}var kl=2500,Cr=25;function gs(){Ct.apply(this,arguments);var u=M(this.handler,this);this.touch=new yn(this.manager,u),this.mouse=new gn(this.manager,u),this.primaryTouch=null,this.lastTouches=[]}C(gs,Ct,{handler:function(d,y,x){var P=x.pointerType==G,I=x.pointerType==Ht;if(!(I&&x.sourceCapabilities&&x.sourceCapabilities.firesTouchEvents)){if(P)Il.call(this,y,x);else if(I&&Ml.call(this,x))return;this.callback(d,y,x)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});function Il(u,d){u<?(this.primaryTouch=d.changedPointers[0].identifier,Tr.call(this,d)):u&(K|dt)&&Tr.call(this,d)}function Tr(u){var d=u.changedPointers[0];if(d.identifier===this.primaryTouch){var y={x:d.clientX,y:d.clientY};this.lastTouches.push(y);var x=this.lastTouches,P=function(){var I=x.indexOf(y);I>-1&&x.splice(I,1)};setTimeout(P,kl)}}function Ml(u){for(var d=u.srcEvent.clientX,y=u.srcEvent.clientY,x=0;x<this.lastTouches.length;x++){var P=this.lastTouches[x],I=Math.abs(d-P.x),O=Math.abs(y-P.y);if(I<=Cr&&O<=Cr)return!0}return!1}var Er=rt(a.style,"touchAction"),Pr=Er!==i,_r="compute",Dr="auto",ys="manipulation",te="none",Fe="pan-x",Be="pan-y",wn=Ol();function ws(u,d){this.manager=u,this.set(d)}ws.prototype={set:function(u){u==_r&&(u=this.compute()),Pr&&this.manager.element.style&&wn[u]&&(this.manager.element.style[Er]=u),this.actions=u.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var u=[];return w(this.manager.recognizers,function(d){R(d.options.enable,[d])&&(u=u.concat(d.getTouchAction()))}),Rl(u.join(" "))},preventDefaults:function(u){var d=u.srcEvent,y=u.offsetDirection;if(this.manager.session.prevented){d.preventDefault();return}var x=this.actions,P=q(x,te)&&!wn[te],I=q(x,Be)&&!wn[Be],O=q(x,Fe)&&!wn[Fe];if(P){var st=u.pointers.length===1,at=u.distance<2,ut=u.deltaTime<250;if(st&&at&&ut)return}if(!(O&&I)&&(P||I&&y&It||O&&y&Qt))return this.preventSrc(d)},preventSrc:function(u){this.manager.session.prevented=!0,u.preventDefault()}};function Rl(u){if(q(u,te))return te;var d=q(u,Fe),y=q(u,Be);return d&&y?te:d||y?d?Fe:Be:q(u,ys)?ys:Dr}function Ol(){if(!Pr)return!1;var u={},d=t.CSS&&t.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(y){u[y]=d?t.CSS.supports("touch-action",y):!0}),u}var vn=1,Tt=2,le=4,Wt=8,Ut=Wt,Ue=16,Mt=32;function Vt(u){this.options=v({},this.defaults,u||{}),this.id=V(),this.manager=null,this.options.enable=B(this.options.enable,!0),this.state=vn,this.simultaneous={},this.requireFail=[]}Vt.prototype={defaults:{},set:function(u){return v(this.options,u),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(u){if(g(u,"recognizeWith",this))return this;var d=this.simultaneous;return u=bn(u,this),d[u.id]||(d[u.id]=u,u.recognizeWith(this)),this},dropRecognizeWith:function(u){return g(u,"dropRecognizeWith",this)?this:(u=bn(u,this),delete this.simultaneous[u.id],this)},requireFailure:function(u){if(g(u,"requireFailure",this))return this;var d=this.requireFail;return u=bn(u,this),Y(d,u)===-1&&(d.push(u),u.requireFailure(this)),this},dropRequireFailure:function(u){if(g(u,"dropRequireFailure",this))return this;u=bn(u,this);var d=Y(this.requireFail,u);return d>-1&&this.requireFail.splice(d,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(u){return!!this.simultaneous[u.id]},emit:function(u){var d=this,y=this.state;function x(P){d.manager.emit(P,u)}y<Wt&&x(d.options.event+Ar(y)),x(d.options.event),u.additionalEvent&&x(u.additionalEvent),y>=Wt&&x(d.options.event+Ar(y))},tryEmit:function(u){if(this.canEmit())return this.emit(u);this.state=Mt},canEmit:function(){for(var u=0;u<this.requireFail.length;){if(!(this.requireFail[u].state&(Mt|vn)))return!1;u++}return!0},recognize:function(u){var d=v({},u);if(!R(this.options.enable,[this,d])){this.reset(),this.state=Mt;return}this.state&(Ut|Ue|Mt)&&(this.state=vn),this.state=this.process(d),this.state&(Tt|le|Wt|Ue)&&this.tryEmit(d)},process:function(u){},getTouchAction:function(){},reset:function(){}};function Ar(u){return u&Ue?"cancel":u&Wt?"end":u&le?"move":u&Tt?"start":""}function kr(u){return u==Ne?"down":u==Le?"up":u==Re?"left":u==Oe?"right":""}function bn(u,d){var y=d.manager;return y?y.get(u):u}function Dt(){Vt.apply(this,arguments)}C(Dt,Vt,{defaults:{pointers:1},attrTest:function(u){var d=this.options.pointers;return d===0||u.pointers.length===d},process:function(u){var d=this.state,y=u.eventType,x=d&(Tt|le),P=this.attrTest(u);return x&&(y&dt||!P)?d|Ue:x||P?y&K?d|Wt:d&Tt?d|le:Tt:Mt}});function xn(){Dt.apply(this,arguments),this.pX=null,this.pY=null}C(xn,Dt,{defaults:{event:"pan",threshold:10,pointers:1,direction:mr},getTouchAction:function(){var u=this.options.direction,d=[];return u&It&&d.push(Be),u&Qt&&d.push(Fe),d},directionTest:function(u){var d=this.options,y=!0,x=u.distance,P=u.direction,I=u.deltaX,O=u.deltaY;return P&d.direction||(d.direction&It?(P=I===0?dn:I<0?Re:Oe,y=I!=this.pX,x=Math.abs(u.deltaX)):(P=O===0?dn:O<0?Le:Ne,y=O!=this.pY,x=Math.abs(u.deltaY))),u.direction=P,y&&x>d.threshold&&P&d.direction},attrTest:function(u){return Dt.prototype.attrTest.call(this,u)&&(this.state&Tt||!(this.state&Tt)&&this.directionTest(u))},emit:function(u){this.pX=u.deltaX,this.pY=u.deltaY;var d=kr(u.direction);d&&(u.additionalEvent=this.options.event+d),this._super.emit.call(this,u)}});function vs(){Dt.apply(this,arguments)}C(vs,Dt,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[te]},attrTest:function(u){return this._super.attrTest.call(this,u)&&(Math.abs(u.scale-1)>this.options.threshold||this.state&Tt)},emit:function(u){if(u.scale!==1){var d=u.scale<1?"in":"out";u.additionalEvent=this.options.event+d}this._super.emit.call(this,u)}});function bs(){Vt.apply(this,arguments),this._timer=null,this._input=null}C(bs,Vt,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[Dr]},process:function(u){var d=this.options,y=u.pointers.length===d.pointers,x=u.distance<d.threshold,P=u.deltaTime>d.time;if(this._input=u,!x||!y||u.eventType&(K|dt)&&!P)this.reset();else if(u.eventType<)this.reset(),this._timer=f(function(){this.state=Ut,this.tryEmit()},d.time,this);else if(u.eventType&K)return Ut;return Mt},reset:function(){clearTimeout(this._timer)},emit:function(u){this.state===Ut&&(u&&u.eventType&K?this.manager.emit(this.options.event+"up",u):(this._input.timeStamp=l(),this.manager.emit(this.options.event,this._input)))}});function xs(){Dt.apply(this,arguments)}C(xs,Dt,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[te]},attrTest:function(u){return this._super.attrTest.call(this,u)&&(Math.abs(u.rotation)>this.options.threshold||this.state&Tt)}});function Ss(){Dt.apply(this,arguments)}C(Ss,Dt,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:It|Qt,pointers:1},getTouchAction:function(){return xn.prototype.getTouchAction.call(this)},attrTest:function(u){var d=this.options.direction,y;return d&(It|Qt)?y=u.overallVelocity:d&It?y=u.overallVelocityX:d&Qt&&(y=u.overallVelocityY),this._super.attrTest.call(this,u)&&d&u.offsetDirection&&u.distance>this.options.threshold&&u.maxPointers==this.options.pointers&&h(y)>this.options.velocity&&u.eventType&K},emit:function(u){var d=kr(u.offsetDirection);d&&this.manager.emit(this.options.event+d,u),this.manager.emit(this.options.event,u)}});function Sn(){Vt.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}C(Sn,Vt,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[ys]},process:function(u){var d=this.options,y=u.pointers.length===d.pointers,x=u.distance<d.threshold,P=u.deltaTime<d.time;if(this.reset(),u.eventType<&&this.count===0)return this.failTimeout();if(x&&P&&y){if(u.eventType!=K)return this.failTimeout();var I=this.pTime?u.timeStamp-this.pTime<d.interval:!0,O=!this.pCenter||pn(this.pCenter,u.center)<d.posThreshold;this.pTime=u.timeStamp,this.pCenter=u.center,!O||!I?this.count=1:this.count+=1,this._input=u;var st=this.count%d.taps;if(st===0)return this.hasRequireFailures()?(this._timer=f(function(){this.state=Ut,this.tryEmit()},d.interval,this),Tt):Ut}return Mt},failTimeout:function(){return this._timer=f(function(){this.state=Mt},this.options.interval,this),Mt},reset:function(){clearTimeout(this._timer)},emit:function(){this.state==Ut&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}});function Gt(u,d){return d=d||{},d.recognizers=B(d.recognizers,Gt.defaults.preset),new Cs(u,d)}Gt.VERSION="2.0.7",Gt.defaults={domEvents:!1,touchAction:_r,enable:!0,inputTarget:null,inputClass:null,preset:[[xs,{enable:!1}],[vs,{enable:!1},["rotate"]],[Ss,{direction:It}],[xn,{direction:It},["swipe"]],[Sn],[Sn,{event:"doubletap",taps:2},["tap"]],[bs]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};var Ll=1,Ir=2;function Cs(u,d){this.options=v({},Gt.defaults,d||{}),this.options.inputTarget=this.options.inputTarget||u,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=u,this.input=ul(this),this.touchAction=new ws(this,this.options.touchAction),Mr(this,!0),w(this.options.recognizers,function(y){var x=this.add(new y[0](y[1]));y[2]&&x.recognizeWith(y[2]),y[3]&&x.requireFailure(y[3])},this)}Cs.prototype={set:function(u){return v(this.options,u),u.touchAction&&this.touchAction.update(),u.inputTarget&&(this.input.destroy(),this.input.target=u.inputTarget,this.input.init()),this},stop:function(u){this.session.stopped=u?Ir:Ll},recognize:function(u){var d=this.session;if(!d.stopped){this.touchAction.preventDefaults(u);var y,x=this.recognizers,P=d.curRecognizer;(!P||P&&P.state&Ut)&&(P=d.curRecognizer=null);for(var I=0;I<x.length;)y=x[I],d.stopped!==Ir&&(!P||y==P||y.canRecognizeWith(P))?y.recognize(u):y.reset(),!P&&y.state&(Tt|le|Wt)&&(P=d.curRecognizer=y),I++}},get:function(u){if(u instanceof Vt)return u;for(var d=this.recognizers,y=0;y<d.length;y++)if(d[y].options.event==u)return d[y];return null},add:function(u){if(g(u,"add",this))return this;var d=this.get(u.options.event);return d&&this.remove(d),this.recognizers.push(u),u.manager=this,this.touchAction.update(),u},remove:function(u){if(g(u,"remove",this))return this;if(u=this.get(u),u){var d=this.recognizers,y=Y(d,u);y!==-1&&(d.splice(y,1),this.touchAction.update())}return this},on:function(u,d){if(u!==i&&d!==i){var y=this.handlers;return w(nt(u),function(x){y[x]=y[x]||[],y[x].push(d)}),this}},off:function(u,d){if(u!==i){var y=this.handlers;return w(nt(u),function(x){d?y[x]&&y[x].splice(Y(y[x],d),1):delete y[x]}),this}},emit:function(u,d){this.options.domEvents&&Nl(u,d);var y=this.handlers[u]&&this.handlers[u].slice();if(!(!y||!y.length)){d.type=u,d.preventDefault=function(){d.srcEvent.preventDefault()};for(var x=0;x<y.length;)y[x](d),x++}},destroy:function(){this.element&&Mr(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}};function Mr(u,d){var y=u.element;if(y.style){var x;w(u.options.cssProps,function(P,I){x=rt(y.style,I),d?(u.oldCssProps[x]=y.style[x],y.style[x]=P):y.style[x]=u.oldCssProps[x]||""}),d||(u.oldCssProps={})}}function Nl(u,d){var y=e.createEvent("Event");y.initEvent(u,!0,!0),y.gesture=d,d.target.dispatchEvent(y)}v(Gt,{INPUT_START:lt,INPUT_MOVE:Kt,INPUT_END:K,INPUT_CANCEL:dt,STATE_POSSIBLE:vn,STATE_BEGAN:Tt,STATE_CHANGED:le,STATE_ENDED:Wt,STATE_RECOGNIZED:Ut,STATE_CANCELLED:Ue,STATE_FAILED:Mt,DIRECTION_NONE:dn,DIRECTION_LEFT:Re,DIRECTION_RIGHT:Oe,DIRECTION_UP:Le,DIRECTION_DOWN:Ne,DIRECTION_HORIZONTAL:It,DIRECTION_VERTICAL:Qt,DIRECTION_ALL:mr,Manager:Cs,Input:Ct,TouchAction:ws,TouchInput:yn,MouseInput:gn,PointerEventInput:ps,TouchMouseInput:gs,SingleTouchInput:Sr,Recognizer:Vt,AttrRecognizer:Dt,Tap:Sn,Pan:xn,Swipe:Ss,Pinch:vs,Rotate:xs,Press:bs,on:N,off:W,each:w,merge:S,extend:b,assign:v,inherit:C,bindFn:M,prefixed:rt});var Fl=typeof t<"u"?t:typeof self<"u"?self:{};Fl.Hammer=Gt,typeof i=="function"&&i.amd?i(function(){return Gt}):s.exports?s.exports=Gt:t[n]=Gt})(window,document,"Hammer")})(ni);var ka=ni.exports;const Ia=Aa(ka);function Ln(s,t,e,n,i,r,a,o,c,h){let l=Math.PI*120/180,f=Math.PI/180*(+i||0),g=[],w,m=function(j,V,U){const A=j*Math.cos(U)-V*Math.sin(U),k=j*Math.sin(U)+V*Math.cos(U);return{x:A,y:k}},v,b,S,C;if(h)v=h[0],b=h[1],S=h[2],C=h[3];else{w=m(s,t,-f),s=w.x,t=w.y,w=m(o,c,-f),o=w.x,c=w.y;let j=(s-o)/2,V=(t-c)/2,U=j*j/(e*e)+V*V/(n*n);U>1&&(U=Math.sqrt(U),e=U*e,n=U*n);let A=e*e,k=n*n,_=(r==a?-1:1)*Math.sqrt(Math.abs((A*k-A*V*V-k*j*j)/(A*V*V+k*j*j)));S=_*e*V/n+(s+o)/2,C=_*-n*j/e+(t+c)/2,v=Math.asin(Number(((t-C)/n).toFixed(9))),b=Math.asin(Number(((c-C)/n).toFixed(9))),v=s<S?Math.PI-v:v,b=o<S?Math.PI-b:b,v<0&&(v=Math.PI*2+v),b<0&&(b=Math.PI*2+b),a&&v>b&&(v=v-Math.PI*2),!a&&b>v&&(b=b-Math.PI*2)}let M=b-v;if(Math.abs(M)>l){let j=b,V=o,U=c;b=v+l*(a&&b>v?1:-1),o=S+e*Math.cos(b),c=C+n*Math.sin(b),g=Ln(o,c,e,n,i,0,a,V,U,[b,j,S,C])}M=b-v;let R=Math.cos(v),B=Math.sin(v),N=Math.cos(b),W=Math.sin(b),it=Math.tan(M/4),q=4/3*e*it,nt=4/3*n*it,Y=[s,t],$=[s+q*B,t-nt*R],ht=[o+q*W,c-nt*N],rt=[o,c];return $[0]=2*Y[0]-$[0],$[1]=2*Y[1]-$[1],h?[[...$,...ht,...rt]].concat(g):[[...$,...ht,...rt]].concat(g).map(j=>{const V=[];for(let U=0,A=j.length;U<A;U++)V[U]=U%2?m(j[U-1],j[U],f).y:m(j[U],j[U+1],f).x;return V})}function Nn(s,t,e,n,i,r){return[s/3+.6666666666666666*e,t/3+.6666666666666666*n,i/3+.6666666666666666*e,r/3+.6666666666666666*n,i,r]}function me(s,t,e,n){return[s,t,e,n,e,n]}const pe={a:7,c:6,s:4,q:4,t:2,m:2,l:2,h:1,v:1,z:0};class ne{static createSVGElement(t="path",e){const n=document.createElementNS.call(document,"http://www.w3.org/2000/svg",t);return e&&D.attribute(n,e),n}static createSvgPath(t){return this.createSVGElement("path",{d:t})}static downloadFromSVGElement(t,e="shape"){return Dn(Bs(t),`${e}.svg`)}static downloadFromSVGString(t,e="shape"){return Dn(Pn(t),`${e}.svg`)}static getSVGRawStringFromElement(t){return _n(t)}static isSVGPath(t){return typeof t!="string"?!1:(t=t.trim(),/^[mlhvzaqtcs]\s*[-+.0-9][^mlhvzaqtcs]+/i.test(t)&&/[\dz]$/i.test(t))}static SVGPathDataToD(t){return t.map(e=>{if(!e[0])return"";switch(e[0].toLowerCase()){case"a":return`${e[0]} ${e[1]},${e[2]} ${e[3]} ${e[4]},${e[5]} ${e[6]},${e[7]}`;case"c":return`${e[0]} ${e[1]},${e[2]} ${e[3]},${e[4]} ${e[5]},${e[6]}`;case"s":case"q":return`${e[0]} ${e[1]},${e[2]} ${e[3]},${e[4]}`;default:return e[0]+" "+e.slice(1).join(",")}}).join(" ")}static parseSVGPath(t){const e=[];return t.replace(/([mlhvzaqtcs])([^mlhvzaqtcs]*)/gi,(n,i,r)=>{let a=i.toLowerCase();const o=jr(r);for(a=="m"&&o.length>pe[a]&&(e.push([i,...o.splice(0,pe[a])]),a="l",i=i=="m"?"l":"L");o.length;){if(o.length<pe[a])throw new Error(`parseSVGPath substring:{ ${n} } command:{ ${i} } args:{ ${o} }`);e.push([i,...o.splice(0,pe[a])])}return a=="z"&&e.push([i]),""}),e}static absolutizeSVGPath(t){let e=0,n=0,i=0,r=0;return t.map(function(a){const o=a[0],c=o.toUpperCase();if(o!=c)switch(a[0]=c,o){case"a":a[6]+=i,a[7]+=r;break;case"v":a[1]+=r;break;case"h":a[1]+=i;break;default:for(let h=1;h<a.length;)a[h++]+=i,a[h++]+=r}switch(c){case"Z":i=e,r=n;break;case"H":i=a[1];break;case"V":r=a[1];break;case"M":i=e=a[1],r=n=a[2];break;default:i=a[a.length-2],r=a[a.length-1]}return a})}static relativeSVGPath(t){let e=0,n=0,i=0,r=0;return t.map(function(a){const o=a[0],c=o.toLowerCase();if(o!=c)switch(a[0]=c,o){case"A":a[6]-=i,a[7]-=r;break;case"V":a[1]-=r;break;case"H":a[1]-=i;break;default:for(let h=1;h<a.length;)a[h++]-=i,a[h++]-=r}switch(c){case"z":i=e,r=n;break;case"h":i+=a[1];break;case"v":r+=a[1];break;case"m":i+=a[1],r+=a[2],e+=a[1],n+=a[2];break;default:i+=a[a.length-2],r+=a[a.length-1]}return a})}static normalizeSVGPath(t){let e=[],n=0,i=0,r=0,a=0,o=0,c=0,h=0,l=0,f;for(let g=0,w=t.length;g<w;g++){let m=t[g];const v=m[0];switch(v){case"M":n=m[1],i=m[2];break;case"A":const b=Ln(r,a,m[1],m[2],m[3],m[4],m[5],m[6],m[7]);if(!b.length)continue;b.forEach((M,R)=>{const[B,N,W,it,q,nt]=M;m=["C",B,N,W,it,q,nt],R<b.length-1&&e.push(m)});break;case"S":let S=r,C=a;(f=="C"||f=="S")&&(S+=S-h,C+=C-l),m=["C",S,C,m[1],m[2],m[3],m[4]];break;case"T":f=="Q"||f=="T"?(o=r*2-o,c=a*2-c):(o=r,c=a),m=["C",...Nn(r,a,o,c,m[1],m[2])];break;case"Q":o=m[1],c=m[2],m=["C",...Nn(r,a,m[1],m[2],m[3],m[4])];break;case"L":m=["C",...me(r,a,m[1],m[2])];break;case"H":m=["C",...me(r,a,m[1],a)];break;case"V":m=["C",...me(r,a,r,m[1])];break;case"Z":m=["C",...me(r,a,n,i)];break}f=v,r=m[m.length-2],a=m[m.length-1],m.length>4?(h=m[m.length-4],l=m[m.length-3]):(h=r,l=a),e.push(m)}return e}static catmullRom2bezier(t){let e=[];for(let n=0,i=t.length;i-2>n;n+=2){let r;n==0?r=[{x:t[n],y:t[n+1]},{x:t[n],y:t[n+1]},{x:t[n+2],y:t[n+3]},{x:t[n+4],y:t[n+5]}]:i-4==n?r=[{x:t[n-2],y:t[n-1]},{x:t[n],y:t[n+1]},{x:t[n+2],y:t[n+3]},{x:t[n+2],y:t[n+3]}]:r=[{x:t[n-2],y:t[n-1]},{x:t[n],y:t[n+1]},{x:t[n+2],y:t[n+3]},{x:t[n+4],y:t[n+5]}];const a=[{x:r[1].x,y:r[1].y},{x:(-r[0].x+6*r[1].x+r[2].x)/6,y:(-r[0].y+6*r[1].y+r[2].y)/6},{x:(r[1].x+6*r[2].x-r[3].x)/6,y:(r[1].y+6*r[2].y-r[3].y)/6},{x:r[2].x,y:r[2].y}];e.push(["C",a[1].x,a[1].y,a[2].x,a[2].y,a[3].x,a[3].y])}return e}static zvhToLSVGPath(t){let e=[],n=["L",0,0],i;for(let r=0,a=t.length;r<a;r++){let o=t[r];switch(o[0]){case"M":n=["L",o[1],o[2]],e.push(o);break;case"Z":e.push(n);break;case"H":i=e[e.length-1]||["L",0,0],e.push(["L",o[1],i[i.length-1]]);break;case"V":i=e[e.length-1]||["L",0,0],e.push(["L",i[i.length-2],o[1]]);break;default:e.push(o)}}return e}static longhandSVGPath(t){const e={S:{to:"C",x:3},T:{to:"Q",x:1}};let n,i=0,r=0;for(let a=0,o=t.length;a<o;a++){const c=t[a],h=e[c[0]];h&&(c[0]=h.to,n&&(n[0]===h.to?(i=2*Number(n[h.x+2])-Number(n[h.x]),r=2*Number(n[h.x+3])-Number(n[h.x+1])):(i=Number(n[n.length-2]),r=Number(n[n.length-1]))),c.splice(1,0,i,r)),n=c}return t}static curveDim(t,e,n,i,r,a,o,c){const h=[],l=[[],[]];let f,g,w,m,v,b,S,C;for(let N=0;N<2;++N){if(N===0?(g=6*t-12*n+6*r,f=-3*t+9*n-9*r+3*o,w=3*n-3*t):(g=6*e-12*i+6*a,f=-3*e+9*i-9*a+3*c,w=3*i-3*e),Math.abs(f)<1e-12){if(Math.abs(g)<1e-12)continue;m=-w/g,m>0&&m<1&&h.push(m);continue}S=g*g-4*w*f,C=Math.sqrt(S),!(S<0)&&(v=(-g+C)/(2*f),v>0&&v<1&&h.push(v),b=(-g-C)/(2*f),b>0&&b<1&&h.push(b))}let M=h.length,R;const B=M;for(;M--;)m=h[M],R=1-m,l[0][M]=R*R*R*t+3*R*R*m*n+3*R*m*m*r+m*m*m*o,l[1][M]=R*R*R*e+3*R*R*m*i+3*R*m*m*a+m*m*m*c;return l[0][B]=t,l[1][B]=e,l[0][B+1]=o,l[1][B+1]=c,l[0].length=l[1].length=B+2,{min:{x:Math.min.apply(0,l[0]),y:Math.min.apply(0,l[1])},max:{x:Math.max.apply(0,l[0]),y:Math.max.apply(0,l[1])}}}static base3(t,e,n,i,r){const a=-3*e+9*n-9*i+3*r,o=t*a+6*e-12*n+6*i;return t*o-3*e+3*n}static bezlen(t,e,n,i,r,a,o,c,h=1){h=Math.max(0,Math.min(h,1));const l=h/2,f=12,g=[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816],w=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472];let m=0;for(let v=0;v<f;v++){const b=l*g[v]+l,S=this.base3(b,t,n,r,o),C=this.base3(b,e,i,a,c),M=S*S+C*C;m+=w[v]*Math.sqrt(M)}return l*m}}const H=ne;class J{id;x;prevX;y;prevY;degree;prevDegree;scaleOnOrigin;prevScaleOnOrigin;skewDegreeOnOrigin;prevSkewDegreeOnOrigin;vx;vy;ax;ay;mass;attrs;enableDrag;targetToAfterDragFree;followMouse;isShow=!0;mouseMove;history=[];path2d=new Path2D;isDragging=!1;el;constructor(t){this.id=Or(),this.prevX=this.x=t?.x||0,this.prevY=this.y=t?.y||0,this.prevDegree=this.degree=t?.degree||0,this.prevScaleOnOrigin=this.scaleOnOrigin=t?.scaleOnOrigin||1,this.prevSkewDegreeOnOrigin=this.skewDegreeOnOrigin=t?.skewDegreeOnOrigin||0,this.vx=t?.vx||0,this.vy=t?.vy||0,this.ax=t?.ax||0,this.ay=t?.ay||0,this.mass=t?.mass||0,this.attrs=Object.assign({fill:"none",stroke:"none"},t?.attrs),this.enableDrag=t?.enableDrag||!1,this.targetToAfterDragFree=t?.targetToAfterDragFree,this.followMouse=t?.followMouse||!1,this.isShow=typeof t?.isShow=="boolean"?t?.isShow:!0,this.mouseMove=t?.mouseMove}save(){this.history.push(Os(this))}restore(){const t=this.history.pop();t&&Ve(this,t)}get centerX(){const t=this.getBoundingClientRect();return t?t.x+t.width/2:this.x}get centerY(){const t=this.getBoundingClientRect();return t?t.y+t.height/2:this.y}get centerDiff(){return{dx:this.centerX-this.x,dy:this.centerY-this.y}}getBoundingClientRect(){return null}toSVGPathD(){const t=[],e=this.toSVGPathData();return e[0]&&Array.isArray(e[0])?t.push(...e):t.push(e),H.SVGPathDataToD(t)}distanceTo(t){return Rn(this.x,this.y,t.x,t.y)}angleTo(t){return this.degree=Q(de(this.x,this.y,t.x,t.y)),this.degree}followTo(t,e=3){const n=this.angleTo(t),{x:i,y:r}=zt(ot(n),e);this.vx=i,this.vy=r,this.nextFrame()}followAccelerationTo(t,e=.05){const n=this.angleTo(t),{x:i,y:r}=zt(ot(n),e);this.ax=i,this.ay=r,this.nextFrame()}nextFrame(t){const e=t?.gravity??0,n=t?.friction??0;if(this.vx+=this.ax,this.vy+=this.ay,this.vy+=e,n>0){const i=Math.atan2(this.vy,this.vx);let r=Math.sqrt(this.vx*this.vx+this.vy*this.vy);r>n?r-=n:r=0,this.vx=Math.cos(i)*r,this.vy=Math.sin(i)*r}this.x+=this.vx,this.y+=this.vy}nextFrameEaseTo(t,e){const n=e?.gravity??0,i=e?.friction??1,r=e?.easing??.05,{dx:a,dy:o}=this.centerDiff,c=t.x-this.x-a,h=t.y-this.y-o;this.vx=c*r,this.vy=h*r,this.vy+=n,this.vx*=i,this.vy*=i,this.x+=this.vx,this.y+=this.vy}nextFrameSpringTo(t,e){const n=e?.gravity??0,i=e?.friction??.95,r=e?.spring??.03,{dx:a,dy:o}=this.centerDiff;(Array.isArray(t)?t:[t]).forEach(h=>{const l=h.x-this.x-a,f=h.y-this.y-o,g=l*r,w=f*r;this.vx+=g,this.vy+=w}),this.vy+=n,this.vx*=i,this.vy*=i,this.x+=this.vx,this.y+=this.vy}static nextFrameSpringConnect(t,e){const n=e?.springLength??100,i=e?.spring??.03,r=e?.gravity??0,a=e?.friction??.95;t.forEach(o=>{o.isDragging||t.filter(c=>c.id!==o.id).forEach(c=>{const h=o.angleTo(c);o.nextFrameSpringTo(new si({x:c.x-Math.cos(ot(h))*n,y:c.y-Math.sin(ot(h))*n}),{spring:i,gravity:r,friction:a})})})}}class Pt extends J{width;height;borderRadius;constructor(t){super(t),this.width=t.width,this.height=t.height,this.borderRadius=t.borderRadius||0}static fromBezier(t,e,n,i,r,a,o,c){const h=ne.curveDim(t,e,n,i,r,a,o,c);return new Pt({x:h.min.x,y:h.min.y,width:h.max.x-h.min.x,height:h.max.y-h.min.y})}getBoundingClientRect(){return this}toSVGPathData(){return this.borderRadius?[["M",this.x+this.borderRadius,this.y],["l",this.width-this.borderRadius*2,0],["a",this.borderRadius,this.borderRadius,0,0,1,this.borderRadius,this.borderRadius],["l",0,this.height-this.borderRadius*2],["a",this.borderRadius,this.borderRadius,0,0,1,-this.borderRadius,this.borderRadius],["l",this.borderRadius*2-this.width,0],["a",this.borderRadius,this.borderRadius,0,0,1,-this.borderRadius,-this.borderRadius],["l",0,this.borderRadius*2-this.height],["a",this.borderRadius,this.borderRadius,0,0,1,this.borderRadius,-this.borderRadius],["z"]]:[["M",this.x,this.y],["l",this.width,0],["l",0,this.height],["l",-this.width,0],["z"]]}toCanvasContext(t){t.beginPath(),this.borderRadius<=0?t.rect(0,0,this.width,this.height):(t.moveTo(0,this.borderRadius),t.lineTo(0,this.height-this.borderRadius),t.quadraticCurveTo(0,this.height,this.borderRadius,this.height),t.lineTo(this.width-this.borderRadius,this.height),t.quadraticCurveTo(this.width,this.height,this.width,this.height-this.borderRadius),t.lineTo(this.width,this.borderRadius),t.quadraticCurveTo(this.width,0,this.width-this.borderRadius,0),t.lineTo(this.borderRadius,0),t.quadraticCurveTo(0,0,0,this.borderRadius)),t.closePath()}eq(t){return this.x===t.x&&this.y===t.y&&this.width===t.width&&this.height===t.height&&this.borderRadius===t.borderRadius}isIntersectRect(t){return!(this.x+this.width<t.x||t.x+t.width<this.x||this.y+this.height<t.y||t.y+t.height<this.y)}isContainPoint(t,e){return t>=this.x&&t<=this.x+this.width&&e>=this.y&&e<=this.y+this.height}clone(t){return new Pt({x:t.x,y:t.y,width:t.width,height:t.height,borderRadius:t.borderRadius})}toArray(){return[this.x,this.y,this.width,this.height,this.borderRadius]}}class mt extends J{radius;constructor(t){super(t),this.radius=t?.radius||0}getBoundingClientRect(){return new Pt({x:this.x-this.radius,y:this.y-this.radius,width:this.radius*2,height:this.radius*2})}toSVGPathData(){return this.radius?[["M",this.x,this.y-this.radius],["a",this.radius,this.radius,0,1,1,0,2*this.radius],["a",this.radius,this.radius,0,1,1,0,-2*this.radius],["z"]]:["M",this.x,this.y]}toCanvasContext(t){t.beginPath(),t.arc(0,0,this.radius,0,Math.PI*2,!0),t.closePath()}toArray(){return[this.x,this.y,this.radius]}setX(t){this.x=t}setY(t){this.y=t}setXY(t,e){this.x=t,this.y=e}eq(t){return this.x===t.x&&this.y===t.y&&this.radius===t.radius}midPointBtw(t){return new mt({x:this.x+(t.x-this.x)/2,y:this.y+(t.y-this.y)/2})}cross(t){const e=this.x,n=this.y;return this.x=n*t.x-e*t.y,this.y=e*t.y-n*t.x,this}normalize(t=1){const e=je(this.x,this.y);if(e){const n=t/e;this.x*=n,this.y*=n}return this}reflect(t,e){const n=t.x*e.x+t.y*e.y;return this.x=t.x-2*n*e.x,this.y=t.y-2*n*e.y,this}clone(t){return new mt({x:t.x,y:t.y,radius:t.radius})}nextFrameCollisionTo(t){const e=t.x-this.x,n=t.y-this.y;if(Math.sqrt(e*e+n*n)<this.radius+t.radius){const r=Math.atan2(n,e),a={x:0,y:0},o=Et(-r,e,n),c=Et(-r,this.vx,this.vy),h=Et(-r,t.vx,t.vy),l=c.x-h.x;c.x=((this.mass-t.mass)*c.x+2*t.mass*h.x)/(this.mass+t.mass),h.x=l+c.x;const f=Math.abs(c.x)+Math.abs(h.x),g=this.radius+t.radius-Math.abs(a.x-o.x);a.x+=c.x/f*g,o.x+=h.x/f*g;const w=Et(r,a.x,a.y),m=Et(r,o.x,o.y);t.x=this.x+m.x,t.y=this.y+m.y,this.x=this.x+w.x,this.y=this.y+w.y;const v=Et(r,c.x,c.y),b=Et(r,h.x,h.y);this.vx=v.x,this.vy=v.y,t.vx=b.x,t.vy=b.y}}nextFrameBounce(t,e){const n=e?.bounce??-1,i=t.x,r=t.y,a=t.x+t.width,o=t.y+t.height;this.x+this.radius>a?(this.x=a-this.radius,this.vx*=n):this.x-this.radius<i&&(this.x=i+this.radius,this.vx*=n),this.y+this.radius>o?(this.y=o-this.radius,this.vy*=n):this.y-this.radius<r&&(this.y=r+this.radius,this.vy*=n)}}const si=mt;class ii{constructor(){}static getFormatKeyNames(t){const e=Mn(),n=[];return t.ctrl&&n.push(e?"Cmd":"Ctrl"),t.shift&&n.push("Shift"),t.alt&&n.push("Alt"),typeof t.key=="string"?n.push(Tn(t.key)):Array.isArray(t.key)&&(t.key.map(i=>Tn(i)),n.push(...t.key)),n}static matchKeyScheme(t,e){const n=t.ctrl??!1,i=t.shift??!1,r=t.alt??!1;if(t.exact)return(n===e.metaKey||n===e.ctrlKey)&&i===e.shiftKey&&r===e.altKey;const a=[];return n&&a.push(n===e.metaKey||n===e.ctrlKey),i&&a.push(i===e.shiftKey),r&&a.push(r===e.altKey),a.every(o=>o)}static on(t,e){if(t?.key===void 0||t?.key===null)return e;const n=t?.target??window;let i=!1;const r=this.getFormatKeyNames(t),a=o=>{if(o.stopPropagation(),!i&&o.key!=="Control"&&o.key!=="Meta"&&o.key!=="Shift"&&o.key!=="Option"&&o.key!=="Alt"&&r.find(c=>c.toLowerCase()===o.key.toLowerCase())&&this.matchKeyScheme(t,o)){o.preventDefault();const c=e(o);if(typeof c!="function")return;const h=l=>{l.preventDefault(),c(l),n.removeEventListener("keyup",h)};n.addEventListener("keyup",h)}};return e.title=t?.title??"",e.formatedKeyNames=r,e.pause=()=>i=!0,e.restart=()=>i=!1,e.removeListener=()=>n.removeEventListener("keydown",a),n.addEventListener("keydown",a),e}}let wt;const se=[];class ge extends Ls{container;width;height;mousePoint;hammer;domEventBusRemoves=[];constructor(t=document.documentElement,e=!0){super(),this.container=t,this.width=this.container.clientWidth,this.height=this.container.clientHeight,this.hammer=new Ia(this.container),this.mousePoint=new mt({x:0,y:0}),e&&this.start()}emitDebounce=Xr((t,...e)=>super.emit(t,...e),50);emit(t,...e){switch(t){case"panLeft":case"panRight":this.emitDebounce(t,...e);break;default:super.emit(t,...e);break}return this}static get page(){if(wt)return wt;wt=new ge,window.addEventListener("hashchange",()=>{wt.emit("hashchange",location.hash)}),window.addEventListener("popstate",()=>{wt.emit("popstate")}),wt.registerKeyDown({title:"打开",key:"o",ctrl:!0,exact:!0},()=>{Us().then(e=>Ge(e[0])).then(e=>{wt.emit("openFile",e)}).catch(e=>{wt.emit("openFileError",e)})}),wt.registerMatchMediaChange("(prefers-color-scheme: dark)");const t=()=>se.forEach(e=>e());return wt.registerGlobalScrollChange=e=>{se.push(e),se.length==1&&document.addEventListener("scroll",t)},wt.removeGlobalScrollChange=e=>{const n=se.findIndex(i=>i==e);n>=0&&(se.splice(n,1),se.length==0&&document.removeEventListener("scroll",t))},wt}start(){this.registerMouseEventListeners(),this.registerInputEventListeners(),this.registerTransitionEventListeners(),this.on("pointerMove",this.setMousePoint),this.addDOMEventBusRemoves(()=>{this.off("pointerMove",this.setMousePoint)}),this.registerResizeObserver(),this.registerElementDisplayInParentWhenScrollChange()}restart(){this.destroy(),this.start()}destroy(){this.domEventBusRemoves.forEach(t=>t()),this.domEventBusRemoves=[],this.removeAllListeners()}addDOMEventBusRemoves(t){this.domEventBusRemoves.push(t)}setMousePoint(t){const e=Hs(this.container,t);return this.mousePoint.x=e.x,this.mousePoint.y=e.y,e}registerMouseEventListeners(){const t=A=>{this.emit("mouseDown",A),this.container.style.userSelect="none"},e=A=>{this.emit("mouseUp",A),this.container.style.userSelect=""},n=A=>{this.emit("mouseMove",A)},i=A=>{this.emit("mouseOver",A)},r=A=>{this.emit("mouseOut",A),this.container.style.userSelect=""},a=A=>{this.emit("mouseClick",A)},o=A=>{this.emit("mouseDoubleClick",A)},c=A=>{this.emit("mouseWheel",A)},h=A=>{this.emit("mouseContextMenu",A)},l=A=>{this.emit("touchStart",A),this.container.style.userSelect="none"},f=A=>{this.emit("touchEnd",A),this.container.style.userSelect=""},g=A=>{this.emit("touchCancel",A),this.container.style.userSelect=""},w=A=>{this.emit("touchMove",A)},m=A=>{this.emit("pointerDown",A),this.container.style.userSelect="none"},v=A=>{this.emit("pointerUp",A),this.container.style.userSelect=""},b=A=>{this.emit("pointerCancel",A),this.container.style.userSelect=""},S=A=>{this.emit("pointerMove",A)},C=A=>{this.emit("pan",A)},M=A=>{this.emit("panStart",A),this.container.style.userSelect="none"},R=A=>{this.emit("panMove",A)},B=A=>{this.emit("panEnd",A),this.container.style.userSelect=""},N=A=>{this.emit("panCancel",A),this.container.style.userSelect=""},W=A=>{this.emit("panLeft",A)},it=A=>{this.emit("panRight",A)},q=A=>{this.emit("panUp",A),this.container.style.userSelect=""},nt=A=>{this.emit("panDown",A),this.container.style.userSelect="none"},Y=A=>{this.emit("pinch",A)},$=A=>{this.emit("press",A)},ht=A=>{this.emit("rotate",A)},rt=A=>{this.emit("swipe",A)},j=A=>{this.emit("tap",A)},V=A=>{!A.target||this.container==A.target||this.container.contains(A.target)||this.emit("tapOutSide",A)};this.container.addEventListener("mousedown",t),this.container.addEventListener("mouseup",e),this.container.addEventListener("mousemove",n),this.container.addEventListener("mouseover",i),this.container.addEventListener("mouseout",r),this.container.addEventListener("click",a),this.container.addEventListener("dblclick",o),this.container.addEventListener("wheel",c),this.container.addEventListener("contextmenu",h),this.container.addEventListener("touchstart",l),this.container.addEventListener("touchend",f),this.container.addEventListener("touchcancel",g),this.container.addEventListener("touchmove",w),this.container.addEventListener("pointerdown",m),this.container.addEventListener("pointerup",v),this.container.addEventListener("pointercancel",b),this.container.addEventListener("pointermove",S),this.hammer.on("pan",C),this.hammer.on("panstart",M),this.hammer.on("panmove",R),this.hammer.on("panend",B),this.hammer.on("pancancel",N),this.hammer.on("panleft",W),this.hammer.on("panright",it),this.hammer.on("panup",q),this.hammer.on("pandown",nt),this.hammer.on("pinch",Y),this.hammer.on("press",$),this.hammer.on("rotate",ht),this.hammer.on("swipe",rt),this.hammer.on("tap",j),document.addEventListener("pointerdown",V,!1);const U=()=>{this.container.removeEventListener("mousedown",t),this.container.removeEventListener("mouseup",e),this.container.removeEventListener("mousemove",n),this.container.removeEventListener("mouseover",i),this.container.removeEventListener("mouseout",r),this.container.removeEventListener("click",a),this.container.removeEventListener("dblclick",o),this.container.removeEventListener("wheel",c),this.container.removeEventListener("contextmenu",h),this.container.removeEventListener("touchstart",l),this.container.removeEventListener("touchend",f),this.container.removeEventListener("touchcancel",g),this.container.removeEventListener("touchmove",w),this.container.removeEventListener("pointerdown",m),this.container.removeEventListener("pointerup",v),this.container.removeEventListener("pointercancel",b),this.container.removeEventListener("pointermove",S),this.hammer.off("pan",C),this.hammer.off("panstart",M),this.hammer.off("panmove",R),this.hammer.off("panend",B),this.hammer.off("pancancel",N),this.hammer.off("panleft",W),this.hammer.off("panright",it),this.hammer.off("panup",q),this.hammer.off("pandown",nt),this.hammer.off("pinch",Y),this.hammer.off("press",$),this.hammer.off("rotate",ht),this.hammer.off("swipe",rt),this.hammer.off("tap",j),document.removeEventListener("pointerdown",V,!1),document.removeEventListener("touchstart",V,!1),document.removeEventListener("mousedown",V,!1)};return this.addDOMEventBusRemoves(U),U}registerInputEventListeners(){const t=c=>{this.emit("inputChange",c,this.container.files)},e=c=>{this.emit("dragstart",c)},n=c=>{c.stopPropagation(),c.preventDefault(),c.dataTransfer&&(c.dataTransfer.dropEffect="copy"),this.emit("dragover",c)},i=c=>{this.emit("dragenter",c)},r=c=>{this.emit("dragend",c)},a=c=>{c.stopPropagation(),c.preventDefault(),c.dataTransfer,this.emit("drop",c,c.dataTransfer?.files)};this.container instanceof HTMLInputElement&&this.container.addEventListener("change",t,!1),this.container.addEventListener("dragstart",e,!1),this.container.addEventListener("dragover",n,!1),this.container.addEventListener("dragenter",i,!1),this.container.addEventListener("dragend",r,!1),this.container.addEventListener("drop",a,!1);const o=()=>{this.container instanceof HTMLInputElement&&this.container.removeEventListener("change",t,!1),this.container.removeEventListener("dragstart",e,!1),this.container.removeEventListener("dragover",n,!1),this.container.removeEventListener("dragenter",i,!1),this.container.removeEventListener("dragend",r,!1),this.container.removeEventListener("drop",a,!1)};return this.addDOMEventBusRemoves(o),o}registerTransitionEventListeners(){const t=n=>{this.emit("transitionend",n)};this.container.addEventListener("transitionend",t);const e=()=>{this.container.removeEventListener("transitionend",t)};return this.addDOMEventBusRemoves(e),e}registerKeyDown(t,e,n){const i=ii.on(t,a=>(e(a,i.formatedKeyNames,i.pause,i.restart),n)),r=()=>{i.removeListener?.()};return this.addDOMEventBusRemoves(r),r}registerResizeObserver(){const t=new ResizeObserver(n=>{const{width:i,height:r}=n[0].contentRect;this.width=i,this.height=r,this.emit("resize",i,r)});t.observe(this.container);const e=()=>{t.unobserve(this.container)};return this.addDOMEventBusRemoves(e),e}registerMatchMediaChange(t){let e="";switch(t){case"(prefers-color-scheme: dark)":e="matchMediaChangePrefersColorSchemeDark";break;default:e=t;break}const n=r=>{this.emit(e,r.matches)};window.matchMedia(t).addEventListener("change",n);const i=()=>{window.matchMedia(t).removeEventListener("change",n)};return this.addDOMEventBusRemoves(i),i}registerElementDisplayInParentWhenScrollChange(t){const e={threshold:t?.threshold||.5,root:t?.parentElement},n=new IntersectionObserver((r,a)=>{let o=r[0];if(r.length>1){const h=r.find(l=>l.isIntersecting);h&&(o=h)}o.isIntersecting&&o.intersectionRatio>=e.threshold?this.emit("showInParent"):this.emit("showOffParent")},e);n.observe(this.container);const i=()=>{n.unobserve(this.container)};return this.addDOMEventBusRemoves(i),i}registerPullDownRefresh(t){const e=t?.distance||50;let n=0,i=0;return this.captureMove({start:r=>{n=this.setMousePoint(r).y},move:()=>{i=this.mousePoint.y-n,i>0&&i<e&&this.emit("pullDownIng",i)},end:()=>{i>=e&&this.emit("pullDown")}})}registerPullUpLoading(t){const e=t?.distance||50;let n=0,i=0;return this.captureMove({start:r=>{n=this.setMousePoint(r).y},move:()=>{i=n-this.mousePoint.y,i>0&&i<e&&this.emit("pullUpIng",i)},end:()=>{i>=e&&this.emit("pullUp")}})}static isTouchEnabled(){return"ontouchstart"in window||navigator.maxTouchPoints>0}captureMove(t){return this.captureMoveUsePointer(t)}captureMoveUsePointer(t){const e=a=>{this.container.setPointerCapture(a.pointerId),this.container.style.userSelect="none",t?.start?.(a)},n=a=>{this.container.style.userSelect="",t?.end?.(a)},i=a=>{t?.move?.(a)};this.on("pointerDown",e),this.on("pointerUp",n),this.on("pointerCancel",n),this.on("pointerMove",i);const r=()=>{this.off("pointerDown",e),this.off("pointerUp",n),this.off("pointerCancel",n),this.off("pointerMove",i)};return this.addDOMEventBusRemoves(r),r}captureMoveUseMouse(t){const e=a=>{document.addEventListener("mousemove",i,!1),document.addEventListener("mouseup",n,!1),this.container.style.userSelect="none",t?.start?.(a)},n=a=>{document.removeEventListener("mousemove",i,!1),document.removeEventListener("mouseup",n,!1),this.container.style.userSelect="",t?.end?.(a)},i=a=>{t?.move?.(a)};this.on("mouseDown",e);const r=()=>{this.off("mouseDown",e)};return this.addDOMEventBusRemoves(r),r}captureMoveUseTouch(t){const e=a=>{a.preventDefault(),t?.start?.(a)},n=a=>{t?.end?.(a)},i=a=>{t?.move?.(a)};this.on("touchStart",e),this.on("touchEnd",n),this.on("touchCancel",n),this.on("touchMove",i);const r=()=>{this.off("touchStart",e),this.off("touchEnd",n),this.off("touchCancel",n),this.off("touchMove",i)};return this.addDOMEventBusRemoves(r),r}static getMouseButton(t){if(document.implementation.hasFeature("MouseEvents","2.0"))return t.button;switch(t.button){case 0:case 1:case 3:case 5:case 7:return 0;case 2:case 6:return 2;case 4:return 1}}}class ye{video;constructor(t){this.video=t}setSrcObject(t){this.video.addEventListener("loadedmetadata",e=>{e.target}),this.video.srcObject=t}captureWebCamera(){navigator.mediaDevices.getUserMedia({video:!0}).then(t=>{this.setSrcObject(t)})}static async videoMediaChangeSupport(){return new Promise(t=>{const e=document.createElement("iframe"),n=document.createElement("video"),i=document.createElement("source"),r=new MediaSource;r.addEventListener("sourceopen",()=>t(!0)),i.src=URL.createObjectURL(r),i.media="(min-width:10px)",n.append(i),e.width="5",e.style.cssText="position: absolute; visibility: hidden;",document.documentElement.append(e),e.contentDocument?.body.append(n),setTimeout(()=>{e.width="15"}),setTimeout(()=>{e.remove(),t(!1)},1e3)})}static tryAutoPlayOrAutoPlayAfterClick(t){return new Promise(e=>{t.play().then(()=>{t.autoplay=!0,e(!0)}).catch(()=>{ye.setAutoPlayWhenClick(t),e(!1)})})}static setAutoPlayWhenClick(t){function e(){t.autoplay=!0,t.play(),document.removeEventListener("click",e),document.removeEventListener("touchend",e)}document.addEventListener("click",e),document.addEventListener("touchend",e)}}class ri extends Ls{source;raw="";mode="text";tagname="";nodename="";textchunk="";entity="";quote="";attrs={};constructor(t){super(),this.source=t}parse(){const t=Ps(this.source);if(t===0){this.emit("finish");return}let e,n,i=_s(this.source,0);for(let r=1;r<t;r++)e=n,n=i,i=_s(this.source,r),this.raw+=n,n&&this.step(n,i,e);i&&this.step(i,void 0,n),this.emit("finish")}step(t,e,n){t==`
|
|
25
|
+
`&&this.emit("newline"),this.act(t,e,n)}act(t,e,n){switch(this.mode){case"text":switch(t){case"<":case"eof":this.nodename="",this.attrs={},this.mode="tag name start",this.raw=this.raw.slice(0,-1),this.textchunk&&this.emit("text",this.textchunk),this.raw+=t,this.textchunk="";break;case"&":this.mode="entity",this.entity="";break;default:this.textchunk+=t;break}break;case"entity":Ot("whitespace",t)?(this.textchunk+=D.entity2text(this.entity),this.mode="text"):t==";"?(this.textchunk+=D.entity2text(this.entity+t),this.mode="text"):this.entity+=t;break;case"special":if(n=="!"&&t=="-"&&e=="-"){this.mode="comment start";break}if(this.textchunk=="[CDATA"&&t=="["){this.mode="cdata",this.textchunk="";break}if(t==">"||t=="eof"){this.emit("special",this.textchunk),this.mode="text",this.textchunk="";break}this.textchunk+=t;break;case"cdata":if(n=="]"&&t=="]"&&e==">"){this.mode="cdata end",this.textchunk=this.textchunk.slice(0,-1);break}t=="eof"&&(this.mode="cdata end",this.act(t,e,n)),this.textchunk+=t;break;case"cdata end":this.emit("cdata",this.textchunk),this.textchunk="",this.mode="text";break;case"comment start":e==">"||t=="eof"?(this.emit("comment",""),this.mode="skip"):this.mode="comment";break;case"skip":this.mode="text";break;case"comment":t=="-"&&n=="-"&&e==">"?(this.mode="comment end",this.textchunk=this.textchunk.slice(0,-1)):t=="eof"?this.emit("comment",this.textchunk):this.textchunk+=t;break;case"comment end":this.emit("comment",this.textchunk),this.textchunk="",this.mode="text";break;case"declaration":if(t=="?"&&e==">"){this.mode="declaration end";break}t=="eof"&&this.emit("comment",this.textchunk),this.textchunk+=t;break;case"declaration end":this.emit("comment",this.textchunk),this.textchunk="",this.mode="text";break;case"tag name start":if(t=="eof"){this.emit("text","<");break}if(!Ot("whitespace",t)){if(this.mode="tag name",t=="/"){this.mode="close tag name start";break}else if(t=="!"){this.mode="special",this.textchunk="";break}else if(t=="?"){this.mode="declaration";break}this.act(t,e,n)}break;case"close tag name start":Ot("whitespace",t)||(this.mode="close tag name",this.tagname="",this.nodename="",this.act(t,e,n));break;case"close tag name":if(Ot("whitespace",t))this.tagname=this.nodename;else switch(t){case">":this.emit("/tag",this.tagname||this.nodename,this.attrs),this.mode="text";break;default:!this.tagname&&(this.nodename+=t);break}break;case"tag name":if(Ot("whitespace",t))this.tagname=this.nodename,this.nodename="",this.mode="attr start";else switch(t){case">":this.emit("tag",this.nodename,this.attrs),this.mode="text";break;case"/":this.raw+=e,this.emit("tag",this.nodename,this.attrs),this.emit("/tag",this.nodename,this.attrs),this.mode="skip";break;default:this.nodename+=t;break}break;case"attr start":Ot("whitespace",t)||(this.mode="attr",this.nodename="",this.act(t,e,n));break;case"attr":if(Ot("whitespace",t)||t=="=")this.attrs[this.nodename]="",this.mode="attr value start";else switch(t){case">":this.nodename=="/"?(delete this.attrs["/"],this.emit("tag",this.tagname,this.attrs),this.emit("/tag",this.tagname,this.attrs)):(this.nodename&&(this.attrs[this.nodename]=""),this.emit("tag",this.tagname,this.attrs)),this.mode="text";break;default:this.nodename+=t;break}break;case"attr value start":if(!Ot("whitespace",t)){if(this.mode="attr value",this.quote="",t=="'"||t=='"'){this.quote=t;return}this.act(t,e,n)}break;case"attr value":if(Ot("whitespace",t)&&!this.quote)this.mode="attr start";else if(t==">"&&!this.quote)this.emit("tag",this.tagname,this.attrs),this.mode="text";else switch(t){case'"':case"'":this.quote==t&&n!="\\"&&(this.mode="attr start");break;default:this.attrs[this.nodename]+=t;break}break}}}function Fn(s,t){if(typeof t<"u")window.localStorage.setItem(s,t);else return window.localStorage.getItem(s)??void 0}function Ma(s,t,e){const n=new Date;n.setTime(n.getTime()+e*24*60*60*1e3);const i="expires="+n.toUTCString();document.cookie=s+"="+t+"; "+i}function Ra(s){const t=s+"=",e=document.cookie.split(";");for(let n=0,i=e.length;n<i;n++){const r=e[n].trim();if(r.indexOf(t)==0)return r.substring(t.length,r.length)}return""}const Oa=()=>document.cookie.split(";").map(s=>s.split("=")).reduce((s,[t,e])=>(s[t.trim().replace('"',"")]=e,s),{}),La=()=>document.cookie.split(";").forEach(s=>document.cookie=s.replace(/^ +/,"").replace(/=.*/,`=;expires=${new Date().toUTCString()};path=/`));ge.page.on("matchMediaChangePrefersColorSchemeDark",s=>{Xe(s?"dark":"light")}),ai();function Xe(s){Fn("colorScheme",s),document.documentElement.classList.toggle("dark",s=="dark")}function ai(){const s=Fn("colorScheme");if(s=="dark"||s=="light")return Xe(s),s;{const t=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";return Xe(t),t}}const Na={safeAreaTop:D.getCSSVar("--safe-area-inset-top"),safeAreaRight:D.getCSSVar("--safe-area-inset-right"),safeAreaBottom:D.getCSSVar("--safe-area-inset-bottom"),safeAreaLeft:D.getCSSVar("--safe-area-inset-left"),colorPrimary:D.getCSSVar("--color-primary")||"#5078f0",colorRed:D.getCSSVar("--color-red")||"#ff5050",colorOrange:D.getCSSVar("--color-orange")||"#fa8c00",colorYellow:D.getCSSVar("--color-yellow")||"#fadc32",colorGreen:D.getCSSVar("--color-green")||"#00c878",colorBlue:D.getCSSVar("--color-blue")||"#00b4fa",colorPurple:D.getCSSVar("--color-purple")||"#6464fa",colorBlack:D.getCSSVar("--color-black")||"#001428",colorGray00:D.getCSSVar("--color-gray-00")||"#000000",colorGray33:D.getCSSVar("--color-gray-33")||"#333333",colorGray66:D.getCSSVar("--color-gray-66")||"#666666",colorGray99:D.getCSSVar("--color-gray-99")||"#999999",colorGrayCC:D.getCSSVar("--color-gray-cc")||"#cccccc",colorGrayDD:D.getCSSVar("--color-gray-dd")||"#dddddd",colorGrayE6:D.getCSSVar("--color-gray-e6")||"#e6e6e6",colorGrayEE:D.getCSSVar("--color-gray-ee")||"#eeeeee",colorGrayEF:D.getCSSVar("--color-gray-ef")||"#efefef",colorGrayF5:D.getCSSVar("--color-gray-f5")||"#f5f5f5",colorGrayFF:D.getCSSVar("--color-gray-ff")||"#ffffff",fontLineHeight:D.getCSSVar("--font-line-height")||"1,4",fontSize32:D.getCSSVar("--font-size-32")||"32px",fontSize24:D.getCSSVar("--font-size-24")||"24px",fontSize20:D.getCSSVar("--font-size-20")||"20px",fontSize18:D.getCSSVar("--font-size-18")||"18px",fontSize16:D.getCSSVar("--font-size-16")||"16px",fontSize14:D.getCSSVar("--font-size-14")||"14px",fontSize12:D.getCSSVar("--font-size-12")||"12px",fontSize11:D.getCSSVar("--font-size-11")||"11px",gap4:D.getCSSVar("--gap-4")||"4px",gap8:D.getCSSVar("--gap-8")||"8px",gap12:D.getCSSVar("--gap-12")||"12px",gap16:D.getCSSVar("--gap-16")||"16px",gap20:D.getCSSVar("--gap-20")||"20px",gap40:D.getCSSVar("--gap-40")||"40px",height44:D.getCSSVar("--height-44")||"44px",height32:D.getCSSVar("--height-32")||"32px",borderRadius:D.getCSSVar("--border-radius")||"4px"};function jt(s,t){if(s.hasOwnProperty("r")&&s.hasOwnProperty("g")&&s.hasOwnProperty("b"))return s.r=Math.round(yt(s.r,0,255)),s.g=Math.round(yt(s.g,0,255)),s.b=Math.round(yt(s.b,0,255)),s.hasOwnProperty("a")?s.a=typeof t=="number"?t:s.a:s.a=typeof t=="number"?t:1,s.a=yt(s.a,0,1),s;const e={r:0,g:0,b:0,a:1};let n=-1;if(typeof s=="number")n=s;else if(typeof s=="string")if(s[0].toLowerCase()==="r"){const i=/rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,?\s*(\d?\.?\d*)?\s*\)/gi.exec(s);i&&(n=(parseInt(i[1])<<16)+(parseInt(i[2])<<8)+parseInt(i[3]),i[4]&&(e.a=Jt(parseFloat(i[4]),2)))}else if(s[0]==="#")n=parseInt(s.slice(1,7),16),s.length>7&&(e.a=Jt(parseInt(s.slice(7,9),16)/255,2));else throw new Error("getColor 不支持的颜色解析:"+s);return n>=0&&(e.r=n>>16&255,e.g=n>>8&255,e.b=n&255),typeof t=="number"&&(e.a=t),e.a=yt(e.a,0,1),e}function Fa(s,t){const e=jt(s,t);return e.a===1?`rgb(${e.r},${e.g},${e.b})`:`rgba(${e.r},${e.g},${e.b},${e.a})`}function qe(s){return Nr(s.toString(16),2,"0","left")}function we(s,t){const e=jt(s,t);let n=`#${qe(e.r)}${qe(e.g)}${qe(e.b)}`;return e.a===1?n:n+`${qe(Math.ceil(e.a*255))}`}const oi=()=>Math.random()*16777215,Ba=()=>we(oi());function Ua(s,t){const e=jt(s);return e.r==0&&(e.r=32),e.g==0&&(e.g=32),e.b==0&&(e.b=32),e.r=e.r*(100+t)/100,e.g=e.g*(100+t)/100,e.b=e.b*(100+t)/100,e.r=Math.round(yt(e.r,0,255)),e.g=Math.round(yt(e.g,0,255)),e.b=Math.round(yt(e.b,0,255)),we(e)}function Va(s,t,e){const n=jt(s),i=jt(t);return we({r:(i.r-n.r)*e+n.r,g:(i.g-n.g)*e+n.g,b:(i.b-n.b)*e+n.b})}function Ga(s,t,e,n){let i,r,a;s=s/360,t=t/100,e=e/100;const o=Math.floor(s*6),c=s*6-o,h=e*(1-t),l=e*(1-c*t),f=e*(1-(1-c)*t);switch(o%6){case 0:i=e,r=f,a=h;break;case 1:i=l,r=e,a=h;break;case 2:i=h,r=e,a=f;break;case 3:i=h,r=l,a=e;break;case 4:i=f,r=h,a=e;break;case 5:default:i=e,r=h,a=l;break}return{r:Math.round(i*255),g:Math.round(r*255),b:Math.round(a*255),opacity:n??1}}function za(s,t,e,n){s*=360;let i,r,a,o,c;return s=s%360/60,c=e*t,o=c*(1-Math.abs(s%2-1)),i=r=a=e-c,s=~~s,i+=[c,o,0,0,o,c][s],r+=[o,c,c,o,0,0][s],a+=[0,0,o,c,c,o][s],{r:i,g:r,b:a,opacity:n??1}}function ja(s,t,e,n){(s>1||t>1||e>1)&&(s/=360,t/=100,e/=100),s*=360;var i,r,a,o,c;return s=s%360/60,c=2*t*(e<.5?e:1-e),o=c*(1-Math.abs(s%2-1)),i=r=a=e-c/2,s=~~s,i+=[c,o,0,0,o,c][s],r+=[o,c,c,o,0,0][s],a+=[0,0,o,c,c,o][s],{r:i,g:r,b:a,opacity:n??1}}function Xa(s,t,e,n){const i=Math.max(s,t,e),r=Math.min(s,t,e),a=i-r,o=i===0?0:a/i,c=i/255;let h;switch(i){case r:h=0;break;case s:h=t-e+a*(t<e?6:0),h/=6*a;break;case t:h=e-s+a*2,h/=6*a;break;case e:default:h=s-t+a*4,h/=6*a;break}return{h:Math.round(h*360),s:Math.round(o*100),v:Math.round(c*100),opacity:n??1}}function qa(s,t,e){let n,i,r,a;return r=Math.max(s,t,e),a=r-Math.min(s,t,e),n=a==0?0:r==s?(t-e)/a:r==t?(e-s)/a+2:(s-t)/a+4,n=(n+360)%6*60/360,i=a==0?0:a/r,{h:n,s:i,b:r}}function Ya(s,t,e){let n,i,r,a,o,c;return a=Math.max(s,t,e),o=Math.min(s,t,e),c=a-o,n=c==0?0:a==s?(t-e)/c:a==t?(e-s)/c+2:(s-t)/c+4,n=(n+360)%6*60/360,r=(a+o)/2,i=c==0?0:r<.5?c/(2*r):c/(2-2*r),{h:n,s:i,l:r}}function Ye(s=window.location.href){return Rs(URL)?new URL(s):ci(s)}function ci(s=window.location.href){const t="(?<protocol>https?:)",e="(?<host>(?<hostname>[^/#?:]+)(?::(?<port>\\d+))?)",n="(?<pathname>(?:\\/[^/#?]+)*\\/?)",i="(?<search>(?:\\?[^#]*)?)",r="(?<hash>(?:#.*)?)",o=new RegExp(`^${t}//${e}${n}${i}${r}$`).exec(s);return{href:s,protocol:o?.groups?.protocol??"",host:o?.groups?.host??"",hostname:o?.groups?.hostname??"",port:o?.groups?.port??"",pathname:o?.groups?.pathname??"",search:o?.groups?.search??"",hash:o?.groups?.hash??""}}function Ha(s){const t=Ye(s);return t.protocol==="http:"||t.protocol==="https:"}function hi(s=window.location.href){const t=Ye(s),e=t.href.indexOf(t.hash);return t.hash&&e>=0?t.href.substring(0,e):t.href}function Wa(s=Ye().search){s=decodeURIComponent(s).replace(/^[#?&]/,"");const t={};if(!s)return t;const e=/(?:^|&)([^&=]*)=?([^&]*?)(?=&|$)/y;let n=e.exec(s);for(;n;)t[n[1]]=n[2],n=e.exec(s);return t}function li(s){return"?"+Object.entries(s).map(([t,e])=>`${encodeURIComponent(t)}=${encodeURIComponent(e)}`).join("&")}function ui(s){return"?"+[...s.entries()].map(t=>encodeURIComponent(t[0])+"="+encodeURIComponent(t[1]instanceof File?t[1].name:t[1])).join("&")}function $a(s,t){return s.replace(/(?:\?.*)?$/,t.replace(/^[&?]/,"?"))}function fi(s,t){return s+t.replace(/^[&?]/,s.indexOf("?")>=0?"&":"?")}function Ja(s){let t=null;if(Qs)try{t=new Worker(URL.createObjectURL(new Blob([s])))}catch(e){return typeof console!==void 0&&typeof console.warn=="function"&&console.warn("🎊 Could not load worker",e),null}return t}function di(){let s=null;if(window.ActiveXObject){const t=["Microsoft.XMLHTTP","MSXML6.XMLHTTP","MSXML5.XMLHTTP","MSXML4.XMLHTTP","MSXML3.XMLHTTP","MSXML2.XMLHTTP","MSXML.XMLHTTP"];for(let e=0;e<t.length;e++)try{s=new window.ActiveXObject(t[e]);break}catch{continue}}else s=new XMLHttpRequest;return s}function Za(s){return new Promise((t,e)=>{fetch(s,{}).then(n=>n.text()).then(t).catch(e)})}function Ka(s,t){return new Promise((e,n)=>{const{method:i="GET",data:r={},segments:a=[],headers:o={},withCredentials:c=!1,responseType:h="json",timeout:l=3e4}=t||{},f=di();f.timeout=l,f.responseType=h,f.onreadystatechange=function(C){f.readyState===4&&(f.status===200?e(f.response):n(f.statusText))},f.ontimeout=function(){n(`${s} is timed out for ${l}ms.`)},f.addEventListener("error",function(C){n(C)},!1),f.addEventListener("progress",function(C){if(C.lengthComputable){const M=Math.round(C.loaded*100/C.total);t?.progress?.(M,f)}},!1),f.addEventListener("load",function(C){t?.load?.(C,f)},!1),f.addEventListener("loadstart",function(C){t?.loadstart?.(C,f)},!1),f.addEventListener("loadend",function(C){t?.loadend?.(C,f)},!1),f.addEventListener("abort",function(C){t?.abort?.(C,f)},!1);const g=i.toUpperCase();Object.assign(o,{Accept:"*/*"});const w="---------------------------"+Date.now().toString(16);let m=!1,v=!1,b=!1;function S(){c&&(f.withCredentials=!0);for(const C in o)ft(C).toLowerCase()=="content-type"&&o[C].toLowerCase()=="multipart/form-data"?(m=!0,f.setRequestHeader("Content-Type","multipart/form-data; boundary="+w)):(ft(C).toLowerCase()=="content-type"&&(o[C].toLowerCase().indexOf("text/plain")>=0?v=!0:o[C].toLowerCase().indexOf("application/json")>=0&&(b=!0)),f.setRequestHeader(C,o[C]))}switch(g){case"GET":let C="";r instanceof FormData?C=ui(r):C=li(r),f.open("GET",fi(s,C),!0),S(),f.send(null);break;case"POST":default:f.open(g,s,!0),S(),m&&a.length?f.sendAsBinary("--"+w+`\r
|
|
26
26
|
`+a.join("--"+w+`\r
|
|
27
27
|
`)+"--"+w+`--\r
|
|
28
28
|
`):b?f.send(JSON.stringify(r)):f.send(Object.entries(r).map(([M,R])=>`${encodeURIComponent(M)}=${encodeURIComponent(R)}`).join(v?`\r
|
|
29
|
-
`:"&"));break}})}async function
|
|
29
|
+
`:"&"));break}})}async function Qa(s){const t={url:"",data:{},segments:[],contentType:""};if(!s.action)return t;t.url=s.action;const e=s.method.toLowerCase()==="post";t.contentType=e&&s.enctype?s.enctype:"application/x-www-form-urlencoded";const n=t.contentType=="multipart/form-data";for(let i=0;i<s.elements.length;i++){const r=s.elements[i];if(!r.hasAttribute("name"))continue;const a=r.nodeName.toUpperCase()==="INPUT"&&r.getAttribute("type")?r.getAttribute("type").toUpperCase():"";if(a==="FILE"){const o=r.files?r.files.length:0;if(o==0)continue;if(n)for(let c=0;c<o;c++){const h=r.files[c],l=await Ge(h,"binaryString");t.segments.push('Content-Disposition: form-data; name="'+r.name+'"; filename="'+h.name+`"\r
|
|
30
30
|
Content-Type: `+h.type+`\r
|
|
31
31
|
\r
|
|
32
32
|
`+l+`\r
|
|
33
33
|
`)}else for(let c=0;c<o;c++)t.data[r.name]=r.files[c].name}else(a!=="RADIO"&&a!=="CHECKBOX"||(a=="RADIO"||a=="CHECKBOX")&&r.checked)&&(n?t.segments.push('Content-Disposition: form-data; name="'+r.name+`"\r
|
|
34
34
|
\r
|
|
35
35
|
`+r.value+`\r
|
|
36
|
-
`):t.data[r.name]=r.value)}return t}function di(s,t){return function(){return s.apply(t,arguments)}}const{toString:Ka}=Object.prototype,{getPrototypeOf:Nn}=Object,qe=(s=>t=>{const e=Ka.call(t);return s[e]||(s[e]=e.slice(8,-1).toLowerCase())})(Object.create(null)),Dt=s=>(s=s.toLowerCase(),t=>qe(t)===s),Ye=s=>t=>typeof t===s,{isArray:se}=Array,we=Ye("undefined");function Qa(s){return s!==null&&!we(s)&&s.constructor!==null&&!we(s.constructor)&&vt(s.constructor.isBuffer)&&s.constructor.isBuffer(s)}const mi=Dt("ArrayBuffer");function to(s){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(s):t=s&&s.buffer&&mi(s.buffer),t}const eo=Ye("string"),vt=Ye("function"),pi=Ye("number"),He=s=>s!==null&&typeof s=="object",no=s=>s===!0||s===!1,We=s=>{if(qe(s)!=="object")return!1;const t=Nn(s);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in s)&&!(Symbol.iterator in s)},so=Dt("Date"),io=Dt("File"),ro=Dt("Blob"),ao=Dt("FileList"),oo=s=>He(s)&&vt(s.pipe),co=s=>{let t;return s&&(typeof FormData=="function"&&s instanceof FormData||vt(s.append)&&((t=qe(s))==="formdata"||t==="object"&&vt(s.toString)&&s.toString()==="[object FormData]"))},ho=Dt("URLSearchParams"),lo=s=>s.trim?s.trim():s.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function ve(s,t,{allOwnKeys:e=!1}={}){if(s===null||typeof s>"u")return;let n,i;if(typeof s!="object"&&(s=[s]),se(s))for(n=0,i=s.length;n<i;n++)t.call(null,s[n],n,s);else{const r=e?Object.getOwnPropertyNames(s):Object.keys(s),a=r.length;let o;for(n=0;n<a;n++)o=r[n],t.call(null,s[o],o,s)}}function gi(s,t){t=t.toLowerCase();const e=Object.keys(s);let n=e.length,i;for(;n-- >0;)if(i=e[n],t===i.toLowerCase())return i;return null}const yi=(()=>typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global)(),wi=s=>!we(s)&&s!==yi;function Fn(){const{caseless:s}=wi(this)&&this||{},t={},e=(n,i)=>{const r=s&&gi(t,i)||i;We(t[r])&&We(n)?t[r]=Fn(t[r],n):We(n)?t[r]=Fn({},n):se(n)?t[r]=n.slice():t[r]=n};for(let n=0,i=arguments.length;n<i;n++)arguments[n]&&ve(arguments[n],e);return t}const uo=(s,t,e,{allOwnKeys:n}={})=>(ve(t,(i,r)=>{e&&vt(i)?s[r]=di(i,e):s[r]=i},{allOwnKeys:n}),s),fo=s=>(s.charCodeAt(0)===65279&&(s=s.slice(1)),s),mo=(s,t,e,n)=>{s.prototype=Object.create(t.prototype,n),s.prototype.constructor=s,Object.defineProperty(s,"super",{value:t.prototype}),e&&Object.assign(s.prototype,e)},po=(s,t,e,n)=>{let i,r,a;const o={};if(t=t||{},s==null)return t;do{for(i=Object.getOwnPropertyNames(s),r=i.length;r-- >0;)a=i[r],(!n||n(a,s,t))&&!o[a]&&(t[a]=s[a],o[a]=!0);s=e!==!1&&Nn(s)}while(s&&(!e||e(s,t))&&s!==Object.prototype);return t},go=(s,t,e)=>{s=String(s),(e===void 0||e>s.length)&&(e=s.length),e-=t.length;const n=s.indexOf(t,e);return n!==-1&&n===e},yo=s=>{if(!s)return null;if(se(s))return s;let t=s.length;if(!pi(t))return null;const e=new Array(t);for(;t-- >0;)e[t]=s[t];return e},wo=(s=>t=>s&&t instanceof s)(typeof Uint8Array<"u"&&Nn(Uint8Array)),vo=(s,t)=>{const n=(s&&s[Symbol.iterator]).call(s);let i;for(;(i=n.next())&&!i.done;){const r=i.value;t.call(s,r[0],r[1])}},bo=(s,t)=>{let e;const n=[];for(;(e=s.exec(t))!==null;)n.push(e);return n},xo=Dt("HTMLFormElement"),So=s=>s.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,n,i){return n.toUpperCase()+i}),vi=(({hasOwnProperty:s})=>(t,e)=>s.call(t,e))(Object.prototype),Co=Dt("RegExp"),bi=(s,t)=>{const e=Object.getOwnPropertyDescriptors(s),n={};ve(e,(i,r)=>{let a;(a=t(i,r,s))!==!1&&(n[r]=a||i)}),Object.defineProperties(s,n)},To=s=>{bi(s,(t,e)=>{if(vt(s)&&["arguments","caller","callee"].indexOf(e)!==-1)return!1;const n=s[e];if(vt(n)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+e+"'")})}})},Eo=(s,t)=>{const e={},n=i=>{i.forEach(r=>{e[r]=!0})};return se(s)?n(s):n(String(s).split(t)),e},Po=()=>{},_o=(s,t)=>(s=+s,Number.isFinite(s)?s:t),Bn="abcdefghijklmnopqrstuvwxyz",xi="0123456789",Si={DIGIT:xi,ALPHA:Bn,ALPHA_DIGIT:Bn+Bn.toUpperCase()+xi},Do=(s=16,t=Si.ALPHA_DIGIT)=>{let e="";const{length:n}=t;for(;s--;)e+=t[Math.random()*n|0];return e};function Ao(s){return!!(s&&vt(s.append)&&s[Symbol.toStringTag]==="FormData"&&s[Symbol.iterator])}const ko=s=>{const t=new Array(10),e=(n,i)=>{if(He(n)){if(t.indexOf(n)>=0)return;if(!("toJSON"in n)){t[i]=n;const r=se(n)?[]:{};return ve(n,(a,o)=>{const c=e(a,i+1);!we(c)&&(r[o]=c)}),t[i]=void 0,r}}return n};return e(s,0)},Io=Dt("AsyncFunction"),E={isArray:se,isArrayBuffer:mi,isBuffer:Qa,isFormData:co,isArrayBufferView:to,isString:eo,isNumber:pi,isBoolean:no,isObject:He,isPlainObject:We,isUndefined:we,isDate:so,isFile:io,isBlob:ro,isRegExp:Co,isFunction:vt,isStream:oo,isURLSearchParams:ho,isTypedArray:wo,isFileList:ao,forEach:ve,merge:Fn,extend:uo,trim:lo,stripBOM:fo,inherits:mo,toFlatObject:po,kindOf:qe,kindOfTest:Dt,endsWith:go,toArray:yo,forEachEntry:vo,matchAll:bo,isHTMLForm:xo,hasOwnProperty:vi,hasOwnProp:vi,reduceDescriptors:bi,freezeMethods:To,toObjectSet:Eo,toCamelCase:So,noop:Po,toFiniteNumber:_o,findKey:gi,global:yi,isContextDefined:wi,ALPHABET:Si,generateString:Do,isSpecCompliantForm:Ao,toJSONObject:ko,isAsyncFn:Io,isThenable:s=>s&&(He(s)||vt(s))&&vt(s.then)&&vt(s.catch)};function L(s,t,e,n,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=s,this.name="AxiosError",t&&(this.code=t),e&&(this.config=e),n&&(this.request=n),i&&(this.response=i)}E.inherits(L,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:E.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const Ci=L.prototype,Ti={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(s=>{Ti[s]={value:s}}),Object.defineProperties(L,Ti),Object.defineProperty(Ci,"isAxiosError",{value:!0}),L.from=(s,t,e,n,i,r)=>{const a=Object.create(Ci);return E.toFlatObject(s,a,function(c){return c!==Error.prototype},o=>o!=="isAxiosError"),L.call(a,s.message,t,e,n,i),a.cause=s,a.name=s.name,r&&Object.assign(a,r),a};const Mo=null;function Un(s){return E.isPlainObject(s)||E.isArray(s)}function Ei(s){return E.endsWith(s,"[]")?s.slice(0,-2):s}function Pi(s,t,e){return s?s.concat(t).map(function(i,r){return i=Ei(i),!e&&r?"["+i+"]":i}).join(e?".":""):t}function Ro(s){return E.isArray(s)&&!s.some(Un)}const Oo=E.toFlatObject(E,{},null,function(t){return/^is[A-Z]/.test(t)});function $e(s,t,e){if(!E.isObject(s))throw new TypeError("target must be an object");t=t||new FormData,e=E.toFlatObject(e,{metaTokens:!0,dots:!1,indexes:!1},!1,function(v,b){return!E.isUndefined(b[v])});const n=e.metaTokens,i=e.visitor||l,r=e.dots,a=e.indexes,c=(e.Blob||typeof Blob<"u"&&Blob)&&E.isSpecCompliantForm(t);if(!E.isFunction(i))throw new TypeError("visitor must be a function");function h(m){if(m===null)return"";if(E.isDate(m))return m.toISOString();if(!c&&E.isBlob(m))throw new L("Blob is not supported. Use a Buffer instead.");return E.isArrayBuffer(m)||E.isTypedArray(m)?c&&typeof Blob=="function"?new Blob([m]):Buffer.from(m):m}function l(m,v,b){let S=m;if(m&&!b&&typeof m=="object"){if(E.endsWith(v,"{}"))v=n?v:v.slice(0,-2),m=JSON.stringify(m);else if(E.isArray(m)&&Ro(m)||(E.isFileList(m)||E.endsWith(v,"[]"))&&(S=E.toArray(m)))return v=Ei(v),S.forEach(function(M,R){!(E.isUndefined(M)||M===null)&&t.append(a===!0?Pi([v],R,r):a===null?v:v+"[]",h(M))}),!1}return Un(m)?!0:(t.append(Pi(b,v,r),h(m)),!1)}const f=[],g=Object.assign(Oo,{defaultVisitor:l,convertValue:h,isVisitable:Un});function w(m,v){if(!E.isUndefined(m)){if(f.indexOf(m)!==-1)throw Error("Circular reference detected in "+v.join("."));f.push(m),E.forEach(m,function(S,C){(!(E.isUndefined(S)||S===null)&&i.call(t,S,E.isString(C)?C.trim():C,v,g))===!0&&w(S,v?v.concat(C):[C])}),f.pop()}}if(!E.isObject(s))throw new TypeError("data must be an object");return w(s),t}function _i(s){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(s).replace(/[!'()~]|%20|%00/g,function(n){return t[n]})}function Vn(s,t){this._pairs=[],s&&$e(s,this,t)}const Di=Vn.prototype;Di.append=function(t,e){this._pairs.push([t,e])},Di.toString=function(t){const e=t?function(n){return t.call(this,n,_i)}:_i;return this._pairs.map(function(i){return e(i[0])+"="+e(i[1])},"").join("&")};function Lo(s){return encodeURIComponent(s).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Ai(s,t,e){if(!t)return s;const n=e&&e.encode||Lo,i=e&&e.serialize;let r;if(i?r=i(t,e):r=E.isURLSearchParams(t)?t.toString():new Vn(t,e).toString(n),r){const a=s.indexOf("#");a!==-1&&(s=s.slice(0,a)),s+=(s.indexOf("?")===-1?"?":"&")+r}return s}class No{constructor(){this.handlers=[]}use(t,e,n){return this.handlers.push({fulfilled:t,rejected:e,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){E.forEach(this.handlers,function(n){n!==null&&t(n)})}}const ki=No,Ii={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Fo=typeof URLSearchParams<"u"?URLSearchParams:Vn,Bo=typeof FormData<"u"?FormData:null,Uo=typeof Blob<"u"?Blob:null,Vo=(()=>{let s;return typeof navigator<"u"&&((s=navigator.product)==="ReactNative"||s==="NativeScript"||s==="NS")?!1:typeof window<"u"&&typeof document<"u"})(),Go=(()=>typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function")(),At={isBrowser:!0,classes:{URLSearchParams:Fo,FormData:Bo,Blob:Uo},isStandardBrowserEnv:Vo,isStandardBrowserWebWorkerEnv:Go,protocols:["http","https","file","blob","url","data"]};function jo(s,t){return $e(s,new At.classes.URLSearchParams,Object.assign({visitor:function(e,n,i,r){return At.isNode&&E.isBuffer(e)?(this.append(n,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)}},t))}function Xo(s){return E.matchAll(/\w+|\[(\w*)]/g,s).map(t=>t[0]==="[]"?"":t[1]||t[0])}function zo(s){const t={},e=Object.keys(s);let n;const i=e.length;let r;for(n=0;n<i;n++)r=e[n],t[r]=s[r];return t}function Mi(s){function t(e,n,i,r){let a=e[r++];const o=Number.isFinite(+a),c=r>=e.length;return a=!a&&E.isArray(i)?i.length:a,c?(E.hasOwnProp(i,a)?i[a]=[i[a],n]:i[a]=n,!o):((!i[a]||!E.isObject(i[a]))&&(i[a]=[]),t(e,n,i[a],r)&&E.isArray(i[a])&&(i[a]=zo(i[a])),!o)}if(E.isFormData(s)&&E.isFunction(s.entries)){const e={};return E.forEachEntry(s,(n,i)=>{t(Xo(n),i,e,0)}),e}return null}function qo(s,t,e){if(E.isString(s))try{return(t||JSON.parse)(s),E.trim(s)}catch(n){if(n.name!=="SyntaxError")throw n}return(e||JSON.stringify)(s)}const Gn={transitional:Ii,adapter:["xhr","http"],transformRequest:[function(t,e){const n=e.getContentType()||"",i=n.indexOf("application/json")>-1,r=E.isObject(t);if(r&&E.isHTMLForm(t)&&(t=new FormData(t)),E.isFormData(t))return i&&i?JSON.stringify(Mi(t)):t;if(E.isArrayBuffer(t)||E.isBuffer(t)||E.isStream(t)||E.isFile(t)||E.isBlob(t))return t;if(E.isArrayBufferView(t))return t.buffer;if(E.isURLSearchParams(t))return e.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let o;if(r){if(n.indexOf("application/x-www-form-urlencoded")>-1)return jo(t,this.formSerializer).toString();if((o=E.isFileList(t))||n.indexOf("multipart/form-data")>-1){const c=this.env&&this.env.FormData;return $e(o?{"files[]":t}:t,c&&new c,this.formSerializer)}}return r||i?(e.setContentType("application/json",!1),qo(t)):t}],transformResponse:[function(t){const e=this.transitional||Gn.transitional,n=e&&e.forcedJSONParsing,i=this.responseType==="json";if(t&&E.isString(t)&&(n&&!this.responseType||i)){const a=!(e&&e.silentJSONParsing)&&i;try{return JSON.parse(t)}catch(o){if(a)throw o.name==="SyntaxError"?L.from(o,L.ERR_BAD_RESPONSE,this,null,this.response):o}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:At.classes.FormData,Blob:At.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};E.forEach(["delete","get","head","post","put","patch"],s=>{Gn.headers[s]={}});const jn=Gn,Yo=E.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Ho=s=>{const t={};let e,n,i;return s&&s.split(`
|
|
37
|
-
`).forEach(function(a){i=a.indexOf(":"),e=a.substring(0,i).trim().toLowerCase(),n=a.substring(i+1).trim(),!(!e||t[e]&&
|
|
38
|
-
`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...e){const n=new this(t);return e.forEach(i=>n.set(i)),n}static accessor(t){const n=(this[
|
|
39
|
-
`+r.map(
|
|
40
|
-
`):" "+Fi(r[0]):"as no adapter specified";throw new L("There is no suitable adapter to dispatch the request "+a,"ERR_NOT_SUPPORT")}return n},adapters:qn};function Yn(s){if(s.cancelToken&&s.cancelToken.throwIfRequested(),s.signal&&s.signal.aborted)throw new xe(null,s)}function Ui(s){return Yn(s),s.headers=Nt.from(s.headers),s.data=zn.call(s,s.transformRequest),["post","put","patch"].indexOf(s.method)!==-1&&s.headers.setContentType("application/x-www-form-urlencoded",!1),Bi.getAdapter(s.adapter||jn.adapter)(s).then(function(n){return Yn(s),n.data=zn.call(s,s.transformResponse,n),n.headers=Nt.from(n.headers),n},function(n){return Oi(n)||(Yn(s),n&&n.response&&(n.response.data=zn.call(s,s.transformResponse,n.response),n.response.headers=Nt.from(n.response.headers))),Promise.reject(n)})}const Vi=s=>s instanceof Nt?s.toJSON():s;function ie(s,t){t=t||{};const e={};function n(h,l,f){return E.isPlainObject(h)&&E.isPlainObject(l)?E.merge.call({caseless:f},h,l):E.isPlainObject(l)?E.merge({},l):E.isArray(l)?l.slice():l}function i(h,l,f){if(E.isUndefined(l)){if(!E.isUndefined(h))return n(void 0,h,f)}else return n(h,l,f)}function r(h,l){if(!E.isUndefined(l))return n(void 0,l)}function a(h,l){if(E.isUndefined(l)){if(!E.isUndefined(h))return n(void 0,h)}else return n(void 0,l)}function o(h,l,f){if(f in t)return n(h,l);if(f in s)return n(void 0,h)}const c={url:r,method:r,data:r,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:o,headers:(h,l)=>i(Vi(h),Vi(l),!0)};return E.forEach(Object.keys(Object.assign({},s,t)),function(l){const f=c[l]||i,g=f(s[l],t[l],l);E.isUndefined(g)&&f!==o||(e[l]=g)}),e}const Gi="1.5.1",Hn={};["object","boolean","number","function","string","symbol"].forEach((s,t)=>{Hn[s]=function(n){return typeof n===s||"a"+(t<1?"n ":" ")+s}});const ji={};Hn.transitional=function(t,e,n){function i(r,a){return"[Axios v"+Gi+"] Transitional option '"+r+"'"+a+(n?". "+n:"")}return(r,a,o)=>{if(t===!1)throw new L(i(a," has been removed"+(e?" in "+e:"")),L.ERR_DEPRECATED);return e&&!ji[a]&&(ji[a]=!0,console.warn(i(a," has been deprecated since v"+e+" and will be removed in the near future"))),t?t(r,a,o):!0}};function ac(s,t,e){if(typeof s!="object")throw new L("options must be an object",L.ERR_BAD_OPTION_VALUE);const n=Object.keys(s);let i=n.length;for(;i-- >0;){const r=n[i],a=t[r];if(a){const o=s[r],c=o===void 0||a(o,r,s);if(c!==!0)throw new L("option "+r+" must be "+c,L.ERR_BAD_OPTION_VALUE);continue}if(e!==!0)throw new L("Unknown option "+r,L.ERR_BAD_OPTION)}}const Wn={assertOptions:ac,validators:Hn},jt=Wn.validators;class Ke{constructor(t){this.defaults=t,this.interceptors={request:new ki,response:new ki}}request(t,e){typeof t=="string"?(e=e||{},e.url=t):e=t||{},e=ie(this.defaults,e);const{transitional:n,paramsSerializer:i,headers:r}=e;n!==void 0&&Wn.assertOptions(n,{silentJSONParsing:jt.transitional(jt.boolean),forcedJSONParsing:jt.transitional(jt.boolean),clarifyTimeoutError:jt.transitional(jt.boolean)},!1),i!=null&&(E.isFunction(i)?e.paramsSerializer={serialize:i}:Wn.assertOptions(i,{encode:jt.function,serialize:jt.function},!0)),e.method=(e.method||this.defaults.method||"get").toLowerCase();let a=r&&E.merge(r.common,r[e.method]);r&&E.forEach(["delete","get","head","post","put","patch","common"],m=>{delete r[m]}),e.headers=Nt.concat(a,r);const o=[];let c=!0;this.interceptors.request.forEach(function(v){typeof v.runWhen=="function"&&v.runWhen(e)===!1||(c=c&&v.synchronous,o.unshift(v.fulfilled,v.rejected))});const h=[];this.interceptors.response.forEach(function(v){h.push(v.fulfilled,v.rejected)});let l,f=0,g;if(!c){const m=[Ui.bind(this),void 0];for(m.unshift.apply(m,o),m.push.apply(m,h),g=m.length,l=Promise.resolve(e);f<g;)l=l.then(m[f++],m[f++]);return l}g=o.length;let w=e;for(f=0;f<g;){const m=o[f++],v=o[f++];try{w=m(w)}catch(b){v.call(this,b);break}}try{l=Ui.call(this,w)}catch(m){return Promise.reject(m)}for(f=0,g=h.length;f<g;)l=l.then(h[f++],h[f++]);return l}getUri(t){t=ie(this.defaults,t);const e=Li(t.baseURL,t.url);return Ai(e,t.params,t.paramsSerializer)}}E.forEach(["delete","get","head","options"],function(t){Ke.prototype[t]=function(e,n){return this.request(ie(n||{},{method:t,url:e,data:(n||{}).data}))}}),E.forEach(["post","put","patch"],function(t){function e(n){return function(r,a,o){return this.request(ie(o||{},{method:t,headers:n?{"Content-Type":"multipart/form-data"}:{},url:r,data:a}))}}Ke.prototype[t]=e(),Ke.prototype[t+"Form"]=e(!0)});const Qe=Ke;class $n{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let e;this.promise=new Promise(function(r){e=r});const n=this;this.promise.then(i=>{if(!n._listeners)return;let r=n._listeners.length;for(;r-- >0;)n._listeners[r](i);n._listeners=null}),this.promise.then=i=>{let r;const a=new Promise(o=>{n.subscribe(o),r=o}).then(i);return a.cancel=function(){n.unsubscribe(r)},a},t(function(r,a,o){n.reason||(n.reason=new xe(r,a,o),e(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const e=this._listeners.indexOf(t);e!==-1&&this._listeners.splice(e,1)}static source(){let t;return{token:new $n(function(i){t=i}),cancel:t}}}const oc=$n;function cc(s){return function(e){return s.apply(null,e)}}function hc(s){return E.isObject(s)&&s.isAxiosError===!0}const Jn={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Jn).forEach(([s,t])=>{Jn[t]=s});const lc=Jn;function Xi(s){const t=new Qe(s),e=di(Qe.prototype.request,t);return E.extend(e,Qe.prototype,t,{allOwnKeys:!0}),E.extend(e,t,null,{allOwnKeys:!0}),e.create=function(i){return Xi(ie(s,i))},e}const J=Xi(jn);J.Axios=Qe,J.CanceledError=xe,J.CancelToken=oc,J.isCancel=Oi,J.VERSION=Gi,J.toFormData=$e,J.AxiosError=L,J.Cancel=J.CanceledError,J.all=function(t){return Promise.all(t)},J.spread=cc,J.isAxiosError=hc,J.mergeConfig=ie,J.AxiosHeaders=Nt,J.formToJSON=s=>Mi(E.isHTMLForm(s)?new FormData(s):s),J.getAdapter=Bi.getAdapter,J.HttpStatusCode=lc,J.default=J;const uc=J;class fc{instance;interceptors;requestCanceler;constructor(t){this.instance=uc.create(t),this.interceptors=t?.interceptors,this.requestCanceler=new zi,this.instance.interceptors.request.use(e=>(this.requestCanceler.pendingRequest(e),e),e=>(this.requestCanceler.cancelRequest(e.config),e)),this.instance.interceptors.request.use(this.interceptors?.requestInterceptor,this.interceptors?.requestInterceptorCatch),this.instance.interceptors.response.use(this.interceptors?.responseInterceptor,this.interceptors?.responseInterceptorCatch),this.instance.interceptors.response.use(e=>new Promise((n,i)=>{this.requestCanceler.confirmRequest(e.config),e.status===200?n(e.data):i(e.data)}),async e=>{const{code:n="",config:i}=e;return!i||!i.retry||!i.retryStatus?.includes(n)||(i.retryCounted=i.retryCounted??0,i.retryCounted>=i.retry)?Promise.reject(e):(i.retryCounted++,await new Promise(r=>{setTimeout(()=>{r(void 0)},i.retryDelay)}),await this.request(i))})}request(t){return new Promise((e,n)=>{try{t.interceptors?.requestInterceptor&&(t=t.interceptors?.requestInterceptor(t)),this.instance.request(t).then(i=>{t.interceptors?.responseInterceptor&&(i=t.interceptors.responseInterceptor(i)),e(i)}).catch(i=>{t.interceptors?.responseInterceptorCatch&&(i=t.interceptors?.responseInterceptorCatch(i)),n(i)})}catch(i){t.interceptors?.requestInterceptorCatch&&t.interceptors.requestInterceptorCatch(i)}})}get(t,e){return this.request({...e,method:"get",url:t})}delete(t,e){return this.request({...e,method:"delete",url:t})}head(t,e){return this.request({...e,method:"head",url:t})}options(t,e){return this.request({...e,method:"options",url:t})}post(t,e,n){return this.request({...n,method:"post",url:t,data:e})}put(t,e,n){return this.request({...n,method:"put",url:t,data:e})}patch(t,e,n){return this.request({...n,method:"patch",url:t,data:e})}getUri(t){return this.instance.getUri(t)}}class zi{pendingRequestMap;constructor(){this.pendingRequestMap=new Map}async pendingRequest(t){const e=await this.getRequestId(t);if(this.pendingRequestMap.has(e))t.signal=this.pendingRequestMap.get(e)?.signal;else{const n=new AbortController;t.signal=n.signal,this.pendingRequestMap.set(e,n)}}async confirmRequest(t){if(this.pendingRequestMap.size===0)return;const e=await this.getRequestId(t);this.pendingRequestMap.has(e)&&this.pendingRequestMap.delete(e)}async cancelRequest(t){if(this.pendingRequestMap.size===0)return;const e=await this.getRequestId(t);this.pendingRequestMap.has(e)&&(this.pendingRequestMap.get(e)?.abort(),this.pendingRequestMap.delete(e))}async cancelAllRequest(){for(const t of this.pendingRequestMap.values())t.abort();this.pendingRequestMap.clear()}async getRequestId(t){const{url:e,method:n,params:i,data:r}=t;return await Yr({url:e,method:n,params:i,data:r})}}const tn=new Map;async function dc(s){return new Promise((t,e)=>{en(s,(n,i)=>n?e(n):t({width:i.width,height:i.height,aspectRatio:i.width/i.height}))})}const en=(s,t)=>{if(tn.has(s))return t(null,tn.get(s));const e=new Image;e.onload=function(){tn.set(s,{width:e.naturalWidth||e.width,height:e.naturalHeight||e.height,element:e}),t(null,tn.get(s))},e.onerror=function(n){t(n,null)},e.src=s},mc=(s,t)=>{for(let e=0,n=s.length;e<n;e++){const i=s[e],{type:r}=i;if(r.split("/")[0]!=="image")continue;const a=new FileReader;a.onload=function(o){if(!o.target)return t("no reader target",null);const c=o.target.result,h=As(c),l=new Blob([c]);Zn(l,(f,g)=>{if(!g)return t(f,null);en(g,(w,m)=>{if(!m)return t(w,null);qi(g,(v,b)=>{if(!b)return t(v,null);const S={name:i.name,fileType:h,size:i.size,width:m.width,height:m.height,imgUrl:g,imageData:b,blob:l};return t(null,S)})})})},a.readAsArrayBuffer(i)}},qi=(s,t)=>{en(s,(e,n)=>{if(!n)return t(e,null);const i=document.createElement("canvas"),r=i.getContext("2d");i.width=n.width,i.height=n.height,r.drawImage(n.element,0,0,i.width,i.height);const a=r.getImageData(0,0,i.width,i.height);return t(null,a)})},pc=(s,t=0,e=0)=>{const n=document.createElement("canvas"),i=n.getContext("2d");return n.width=t,n.height=e,i.drawImage(s,0,0,t,e),i.getImageData(0,0,t,e)},gc=(s,t=0,e=0)=>{const n=document.createElement("canvas"),i=n.getContext("2d");return n.width=t,n.height=e,i.drawImage(s,0,0,t,e),i.getImageData(0,0,t,e)},yc=s=>{const t=s.width,e=s.height,n=t*e*3,i=n+54,r=[66,77,i&255,i>>8&255,i>>16&255,i>>24&255,0,0,0,0,54,0,0,0],a=[40,0,0,0,t&255,t>>8&255,t>>16&255,t>>24&255,e&255,e>>8&255,e>>16&255,e>>24&255,1,0,24,0,0,0,0,0,n&255,n>>8&255,n>>16&255,n>>24&255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],o=(4-t*3%4)%4,c=s.data;let h="";const l=t<<2;let f=e;const g=String.fromCharCode;do{const m=l*(f-1);let v="";for(let b=0;b<t;b++){const S=b<<2;v+=g(c[m+S+2])+g(c[m+S+1])+g(c[m+S])}for(let b=0;b<o;b++)v+=String.fromCharCode(0);h+=v}while(--f);function w(m){if(!window.btoa)throw"btoa undefined";let v="";if(typeof m=="string")v=m;else for(let b=0;b<m.length;b++)v+=String.fromCharCode(m[b]);return btoa(v)}return w(r.concat(a))+w(h)},wc=s=>{const{width:t,height:e}=s,n=document.createElement("canvas"),i=n.getContext("2d");return n.width=t,n.height=e,i.putImageData(s,0,0,0,0,t,e),n.toDataURL("image/png")},vc=(s,t,e)=>{const{width:n,height:i}=s,r=document.createElement("canvas"),a=r.getContext("2d");r.width=n,r.height=i,a.putImageData(s,0,0,0,0,n,i);const o=`image/${t?t.toLowerCase():"png"}`;r.toBlob(c=>{e?.(null,c)},o,1)},Zn=(s,t)=>{const e=new FileReader;e.onload=function(n){n.target?t(null,n.target.result):t("can't readAsDataURL",null)},e.readAsDataURL(s)},bc=(s,t)=>{Zn(s,function(e,n){if(n){const i=new Image;i.src=n}else t(e)})};function xc(s){const t=[],e=[],n=[];let i=0;for(let c=0,h=s.data.length;c<h;c+=4)t[i]=s.data[c],e[i]=s.data[c+1],n[i]=s.data[c+2],i+=1;const r=Kn(t),a=Kn(e),o=Kn(n);return"rgb("+r+","+a+","+o+")"}function Kn(s){const t={},e=[],n=[];for(let o=0;o<s.length;o++)t[s[o]]?e.push(s[o]):t[s[o]]=1;let i=0;for(let o=0;o<e.length;o++){i=0;for(let c=0;c<e.length;c++)e[o]===e[c]&&(i+=1),n[o]=i}const r=Math.max.apply(null,n);let a=0;for(;a<n.length;a++)if(n[a]===r)return;return e[a]}const Sc=s=>{const{data:t,width:e,height:n}=s,i=new Uint8ClampedArray(t.length);for(let a=0;a<n;a++)for(let o=0;o<e;o++){const c=(a*e+o)*4;i[c]=t[(a*e+e-o-1)*4],i[c+1]=t[(a*e+e-o-1)*4+1],i[c+2]=t[(a*e+e-o-1)*4+2],i[c+3]=t[(a*e+e-o-1)*4+3]}return new ImageData(i,e,n)},Cc=s=>{const{data:t,width:e,height:n}=s,i=new Uint8ClampedArray(t.length);for(let a=0;a<n;a++)for(let o=0;o<e;o++){const c=(a*e+o)*4;i[c]=t[((n-a-1)*e+o)*4],i[c+1]=t[((n-a-1)*e+o)*4+1],i[c+2]=t[((n-a-1)*e+o)*4+2],i[c+3]=t[((n-a-1)*e+o)*4+3]}return new ImageData(i,e,n)},Tc=s=>{const{data:t,width:e,height:n}=s,i=new Uint8ClampedArray(t.length);for(let a=0;a<e;a++)for(let o=0;o<n;o++){const c=(a*n+o)*4;i[c]=t[(o*e+e-a-1)*4],i[c+1]=t[(o*e+e-a-1)*4+1],i[c+2]=t[(o*e+e-a-1)*4+2],i[c+3]=t[(o*e+e-a-1)*4+3]}return new ImageData(i,n,e)},Ec=s=>{const{data:t,width:e,height:n}=s,i=new Uint8ClampedArray(t.length);for(let a=0;a<e;a++)for(let o=0;o<n;o++){const c=(a*n+o)*4;i[c]=t[((n-o-1)*e+a)*4],i[c+1]=t[((n-o-1)*e+a)*4+1],i[c+2]=t[((n-o-1)*e+a)*4+2],i[c+3]=t[((n-o-1)*e+a)*4+3]}return new ImageData(i,n,e)},Pc=s=>{const{data:t,width:e,height:n}=s,i=new Uint8ClampedArray(t.length);for(let a=0;a<n;a++)for(let o=0;o<e;o++){const c=(a*e+o)*4,h=(t[c]+t[c+1]+t[c+2])/3;i[c]=h,i[c+1]=h,i[c+2]=h,i[c+3]=t[c+3]}return new ImageData(i,e,n)},_c=s=>{const{data:t,width:e,height:n}=s,i=new Uint8ClampedArray(t.length);for(let a=0;a<n;a++)for(let o=0;o<e;o++){const c=(a*e+o)*4,h=.2126*t[c]+.7152*t[c+1]+.0722*t[c+2];i[c]=h,i[c+1]=h,i[c+2]=h,i[c+3]=t[c+3]}return new ImageData(i,e,n)},Dc=s=>{const{data:t,width:e,height:n}=s,i=new Uint8ClampedArray(t.length);for(let a=0;a<n;a++)for(let o=0;o<e;o++){const c=(a*e+o)*4,l=(t[c]+t[c+1]+t[c+2])/3>127?255:0;i[c]=l,i[c+1]=l,i[c+2]=l,i[c+3]=t[c+3]}return new ImageData(i,e,n)},Ac=s=>{const{data:t,width:e,height:n}=s,i=new Uint8ClampedArray(t.length);for(let a=0;a<n;a++)for(let o=0;o<e;o++){const c=(a*e+o)*4;i[c]=255-t[c],i[c+1]=255-t[c+1],i[c+2]=255-t[c+2],i[c+3]=t[c+3]}return new ImageData(i,e,n)},kc=s=>{const{data:t,width:e,height:n}=s,i=new Uint8ClampedArray(t.length);for(let a=0;a<n;a++)for(let o=0;o<e;o++){const c=(a*e+o)*4;i[c]=t[c],i[c+1]=0,i[c+2]=0,i[c+3]=t[c+3]}return new ImageData(i,e,n)},Ic=s=>{const{data:t,width:e,height:n}=s,i=new Uint8ClampedArray(t.length);for(let a=0;a<n;a++)for(let o=0;o<e;o++){const c=(a*e+o)*4;i[c]=0,i[c+1]=t[c+1],i[c+2]=0,i[c+3]=t[c+3]}return new ImageData(i,e,n)},Mc=s=>{const{data:t,width:e,height:n}=s,i=new Uint8ClampedArray(t.length);for(let a=0;a<n;a++)for(let o=0;o<e;o++){const c=(a*e+o)*4;i[c]=0,i[c+1]=0,i[c+2]=t[c+2],i[c+3]=t[c+3]}return new ImageData(i,e,n)},Rc=s=>{const{data:t,width:e,height:n}=s,i=new Uint8ClampedArray(t.length);for(let a=0;a<n;a++)for(let o=0;o<e;o++){const c=(a*e+o)*4;i[c]=t[c],i[c+1]=t[c+1],i[c+2]=0,i[c+3]=t[c+3]}return new ImageData(i,e,n)},Oc=s=>{const{data:t,width:e,height:n}=s,i=new Uint8ClampedArray(t.length);for(let a=0;a<n;a++)for(let o=0;o<e;o++){const c=(a*e+o)*4;i[c]=t[c],i[c+1]=0,i[c+2]=t[c+1],i[c+3]=t[c+3]}return new ImageData(i,e,n)},Lc=s=>{const{data:t,width:e,height:n}=s,i=new Uint8ClampedArray(t.length);for(let a=0;a<n;a++)for(let o=0;o<e;o++){const c=(a*e+o)*4;i[c]=0,i[c+1]=t[c+1],i[c+2]=t[c+1],i[c+3]=t[c+3]}return new ImageData(i,e,n)},Nc=s=>{const{data:t,width:e,height:n}=s,i=new Uint8ClampedArray(t.length);for(let a=0;a<n;a++)for(let o=0;o<e;o++){const c=(a*e+o)*4,h=(t[c+1]+t[c+2])/2;i[c]=t[c],i[c+1]=h,i[c+2]=h,i[c+3]=t[c+3]}return new ImageData(i,e,n)},Fc=s=>{const{data:t,width:e,height:n}=s,i=new Uint8ClampedArray(t.length);for(let a=0;a<n;a++)for(let o=0;o<e;o++){const c=(a*e+o)*4,h=(t[c]+t[c+2])/2;i[c]=h,i[c+1]=t[c+1],i[c+2]=h,i[c+3]=t[c+3]}return new ImageData(i,e,n)},Bc=s=>{const{data:t,width:e,height:n}=s,i=new Uint8ClampedArray(t.length);for(let a=0;a<n;a++)for(let o=0;o<e;o++){const c=(a*e+o)*4,h=(t[c]+t[c+1])/2;i[c]=h,i[c+1]=h,i[c+2]=t[c+2],i[c+3]=t[c+3]}return new ImageData(i,e,n)},Uc=s=>Yi(s,[-1,-1,-1,-1,9,-1,-1,-1,-1]),Vc=s=>Yi(s,[-1,-1,-1,-1,8,-1,-1,-1,-1]),Gc=s=>{const{data:t,width:e,height:n}=s,i=new Uint8ClampedArray(t.length);for(let a=0;a<n;a++)for(let o=0;o<e;o++){const c=(a*e+o)*4;i[c]=t[c],i[c+1]=t[c+1],i[c+2]=t[c+2],i[c+3]=255}return new ImageData(i,e,n)},jc=s=>{const{data:t,width:e,height:n}=s,i=new Uint8ClampedArray(t.length);for(let a=0;a<n;a++)for(let o=0;o<e;o++){const c=(a*e+o)*4;if(t[c+3]===0)i[c]=255,i[c+1]=255,i[c+2]=255,i[c+3]=255;else{const h=Hi([t[c],t[c+1],t[c+2],t[c+3]],[255,255,255,255]);i[c]=h[0],i[c+1]=h[1],i[c+2]=h[2],i[c+3]=h[3]}}return new ImageData(i,e,n)},Xc=(s,t,e,n,i,r=!1,a)=>{const{data:o,width:c,height:h}=s;let l=i,f=n,g=t,w=e;if(l<0?l=0:l>c&&(l=c),f<0?f=0:f>h&&(f=h),g<1?g=1:g>c&&(g=c),w<1?w=1:w>h&&(w=h),l+g>c&&(g=c-l),f+w>h&&(w=h-f),r){const m=new Uint8ClampedArray(o.length);for(let b=0;b<h;b++)for(let S=0;S<c;S++){const C=(b*c+S)*4;S>=l&&S<=l+g&&b>=f&&b<=f+w?(m[C]=o[C],m[C+1]=o[C+1],m[C+2]=o[C+2],m[C+3]=o[C+3]):(m[C]=255,m[C+1]=255,m[C+2]=255,m[C+3]=a&&["JPG","JPEG"].includes(a.toUpperCase())?255:0)}return new ImageData(m,c,h)}else{const m=new Uint8ClampedArray(g*w*4);for(let b=f;b<=f+w;b++)for(let S=l;S<=l+g;S++){const C=((b-f)*g+S-l)*4,M=(b*c+S)*4;m[C]=o[M],m[C+1]=o[M+1],m[C+2]=o[M+2],m[C+3]=o[M+3]}return new ImageData(m,g,w)}},zc=(s,t,e,n)=>{const{data:i,width:r,height:a}=s;let o=t;o>Math.floor(r/2)&&(o=Math.floor(r/2)),o>Math.floor(a/2)&&(o=Math.floor(a/2)),o<0&&(o=0);const c=new Uint8ClampedArray(i.length);for(let l=0;l<a;l++)for(let f=0;f<r;f++){const g=(l*r+f)*4;let w=-1;f<o?l<o?w=Math.sqrt(Math.pow(o-f-1,2)+Math.pow(o-l-1,2)):l>a-o-1&&(w=Math.sqrt(Math.pow(o-f-1,2)+Math.pow(l-(a-o),2))):f>r-o-1&&(l<o?w=Math.sqrt(Math.pow(f-(r-o),2)+Math.pow(o-l-1,2)):l>a-o-1&&(w=Math.sqrt(Math.pow(f-(r-o),2)+Math.pow(l-(a-o),2)))),Math.round(w)>o?(c[g]=255,c[g+1]=255,c[g+2]=255,c[g+3]=n||e.toUpperCase()==="PNG"?0:255):(c[g]=i[g],c[g+1]=i[g+1],c[g+2]=i[g+2],c[g+3]=n||e.toUpperCase()==="PNG"?i[g+3]:255)}return new ImageData(c,r,a)},qc=(s,t,e,n,i,r=1e4)=>{const a=new Image;a.src=s;const o=document.createElement("canvas"),c=o.getContext("2d");return o.width=r,o.height=r,c.drawImage(a,0,0,t,e,0,0,n,i),c.getImageData(0,0,n,i)},Yc=(s,t)=>{const{data:e,width:n,height:i}=s,r=new Uint8ClampedArray(e.length);for(let o=0;o<i;o++)for(let c=0;c<n;c++){const h=(o*n+c)*4;r[h]=Math.max(Math.min(e[h]+t,255),0),r[h+1]=Math.max(Math.min(e[h+1]+t,255),0),r[h+2]=Math.max(Math.min(e[h+2]+t,255),0),r[h+3]=e[h+3]}return new ImageData(r,n,i)},Hc=(s,t,e=!1)=>{const{data:n,width:i,height:r}=s,a=new Uint8ClampedArray(n.length);for(let c=0;c<r;c++)for(let h=0;h<i;h++){const l=(c*i+h)*4;n[l+3]===0?(a[l]=255,a[l+1]=255,a[l+2]=255):(a[l]=n[l],a[l+1]=n[l+1],a[l+2]=n[l+2]);let f=n[l+3];e?f=Math.max(Math.min(Math.floor(255*t),255),0):f=Math.max(Math.min(Math.floor(f+255*t),255),0),a[l+3]=f}return new ImageData(a,i,r)},Wc=(s,t,e,n)=>{const{data:i,width:r,height:a}=s,{data:o,width:c,height:h}=t;let l=e,f=n;e+h>a&&(l=a-h),n+c>r&&(f=r-c);const g=new Uint8ClampedArray(i.length);for(let m=0;m<a;m++)for(let v=0;v<r;v++){const b=(m*r+v)*4;if(v<f||v>f+c||m<=l||m>=l+h)g[b]=i[b],g[b+1]=i[b+1],g[b+2]=i[b+2],g[b+3]=i[b+3];else{const S=(m*r+v-((l+1)*r+(m-(l+1))*(r-c))+c-f-1)*4,C=[o[S],o[S+1],o[S+2],o[S+3]],M=[i[b],i[b+1],i[b+2],i[b+3]],R=Hi(C,M);g[b]=R[0],g[b+1]=R[1],g[b+2]=R[2],g[b+3]=R[3]}}return new ImageData(g,r,a)},$c=(s,t,e,n,i,r=10)=>{const{data:a,width:o,height:c}=s;let h=i,l=n,f=t,g=e;h<0?h=0:h>o&&(h=o),l<0?l=0:l>c&&(l=c),f<1?f=1:f>o&&(f=o),g<1?g=1:g>c&&(g=c),h+f>o&&(f=o-h),l+g>c&&(g=c-l);const w=new Uint8ClampedArray(a.length);for(let v=0;v<c;v++)for(let b=0;b<o;b++){const S=(v*o+b)*4;if(b>=h&&b<=h+f&&v>=l&&v<=l+g){const C=Math.floor((b-h)/r),M=Math.floor((v-l)/r);let R=Math.floor(r*(C+1)-r/2+h),B=Math.floor(r*(M+1)-r/2+l);R>o-1&&(R=o-1),B>c-1&&(B=c-1);const N=(B*o+R)*4;w[S]=a[N],w[S+1]=a[N+1],w[S+2]=a[N+2],w[S+3]=a[N+3]}else w[S]=a[S],w[S+1]=a[S+1],w[S+2]=a[S+2],w[S+3]=a[S+3]}return new ImageData(w,o,c)},Jc=(s,t,e={backgroundColor:{r:0,g:0,b:0,a:255},changeIntoColor:{r:0,g:0,b:0,a:0}})=>{if(t&&e){const{data:n,width:i,height:r}=s,{data:a}=t,o=new Uint8ClampedArray(n.length),{backgroundColor:c,changeIntoColor:h}=e;for(let f=0;f<r;f++)for(let g=0;g<i;g++){const w=(f*i+g)*4,m=a[w],v=a[w+1],b=a[w+2],S=a[w+3];m===c.r&&v===c.g&&b===c.b&&S===c.a&&h.a!==0?(o[w]=h.r,o[w+1]=h.g,o[w+2]=h.b,o[w+3]=h.a):(o[w]=n[w],o[w+1]=n[w+1],o[w+2]=n[w+2],o[w+3]=n[w+3])}return new ImageData(o,i,r)}return s},Yi=(s,t)=>{const{data:e,width:n,height:i}=s,r=new Uint8ClampedArray(e.length);for(let o=0;o<i;o++)for(let c=0;c<n;c++){const h=(o*n+c)*4;for(let l=0;l<3;l++){const f=h+l;c===0||c===n-1||o===0||o===i-1?r[f]=e[f]:r[f]=t[0]*e[f-n*4-4]+t[1]*e[f-n*4]+t[2]*e[f-n*4+4]+t[3]*e[f-4]+t[4]*e[f]+t[5]*e[f+4]+t[6]*e[f+n*4-4]+t[7]*e[f+n*4]+t[8]*e[f+n*4+4]}r[h+3]=e[h+3]}return new ImageData(r,n,i)},Hi=(s,t)=>{if(s&&s.length===4&&t&&t.length===4){const e=s[3],n=t[3];if(e===255||n===0)return s;if(e===0)return t;{const i=e/255,r=n/255,a=Math.max(Math.min(Math.floor(s[0]*i+t[0]*r*(1-i)),255),0),o=Math.max(Math.min(Math.floor(s[1]*i+t[1]*r*(1-i)),255),0),c=Math.max(Math.min(Math.floor(s[2]*i+t[2]*r*(1-i)),255),0),h=Math.max(Math.min(Math.floor((i+r*(1-i))*255),255),0);return[a,o,c,h]}}return[255,255,255,255]},Qn=function(){const s=[];return{writeByte(t){s.push(t&255)},writeShort(t){this.writeByte(t),this.writeByte(t>>>8)},writeBytes(t,e=0,n=t.length){for(let i=0;i<n;i++)this.writeByte(t[i+e])},writeString(t){for(let e=0,n=t.length;e<n;e++)this.writeByte(t.charCodeAt(e))},toByteArray(){return s},toString(){let t="[";for(let e=0,n=s.length;e<n;e++)e>0&&(t+=","),t+=s[e];return t+="]",t}}},Wi=function(){let s=0,t=0,e=0,n="";const i=function(a){if(!(a<0)){if(a<26)return 65+a;if(a<52)return 97+(a-26);if(a<62)return 48+(a-52);if(a==62)return 43;if(a==63)return 47}throw new Error("n:"+a)},r=function(a){n+=String.fromCharCode(i(a&63))};return{writeByte(a){for(s=s<<8|a&255,t+=8,e+=1;t>=6;)r(s>>>t-6),t-=6},flush(){if(t>0&&(r(s<<6-t),s=0,t=0),e%3!=0){const a=3-e%3;for(let o=0;o<a;o++)n+="="}},toString(){return n}}},$i=function(s,t,e){const n=new Array(s*s),i=function(o){const c=o;let h=0,l=0;return{write(f,g){if(f>>>g)throw new Error("length over");for(;h+g>=8;)c.writeByte(255&(f<<h|l)),g-=8-h,f>>>=8-h,l=0,h=0;l=f<<h|l,h=h+g},flush(){h>0&&c.writeByte(l)}}},r=function(o){const c=1<<o,h=(1<<o)+1;let l=o+1;const f=a();for(let b=0;b<c;b++)f.add(String.fromCharCode(b));f.add(String.fromCharCode(c)),f.add(String.fromCharCode(h));const g=Qn(),w=i(g);w.write(c,l);let m=0,v=String.fromCharCode(n[m]);for(m+=1;m<n.length;){const b=String.fromCharCode(n[m]);m+=1,f.contains(v+b)?v=v+b:(w.write(f.indexOf(v),l),f.size()<4095&&(f.size()==1<<l&&(l+=1),f.add(v+b)),v=b)}return w.write(f.indexOf(v),l),w.write(h,l),w.flush(),g.toByteArray()},a=function(){const o={};let c=0;return{add(h){if(this.contains(h))throw new Error("dup key:"+h);o[h]=c,c+=1},size(){return c},indexOf(h){return o[h]},contains(h){return typeof o[h]<"u"}}};return{setPixel(o,c,h){n[c*s+o]=h},write(o){o.writeString("GIF87a"),o.writeShort(s),o.writeShort(s),o.writeByte(128),o.writeByte(0),o.writeByte(0),o.writeByte(Ht("0x"+t[1]+t[2])),o.writeByte(Ht("0x"+t[3]+t[4])),o.writeByte(Ht("0x"+t[5]+t[6])),o.writeByte(Ht("0x"+e[1]+e[2])),o.writeByte(Ht("0x"+e[3]+e[4])),o.writeByte(Ht("0x"+e[5]+e[6])),o.writeString(","),o.writeShort(0),o.writeShort(0),o.writeShort(s),o.writeShort(s),o.writeByte(0);const c=2,h=r(c);o.writeByte(c);let l=0;for(;h.length-l>255;)o.writeByte(255),o.writeBytes(h,l,255),l+=255;o.writeByte(h.length-l),o.writeBytes(h,l,h.length-l),o.writeByte(0),o.writeString(";")}}},Ji=function(s,t,e,n){const i=$i(s,t,e);for(let h=0;h<s;h++)for(let l=0;l<s;l++)i.setPixel(l,h,n(l,h));const r=Qn();i.write(r);const a=Wi(),o=r.toByteArray();for(let h=0,l=o.length;h<l;h++)a.writeByte(o[h]);a.flush();let c="";return c+="data:image/gif;base64,",c+=a,c},pt={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},Se={M:0,L:1,H:2,Q:3},Xt={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},Q={glog:function(s){if(s<1)throw new Error("glog("+s+")");return Q.LOG_TABLE[s]},gexp:function(s){for(;s<0;)s+=255;for(;s>=256;)s-=255;return Q.EXP_TABLE[s]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)};for(let s=0;s<8;s++)Q.EXP_TABLE[s]=1<<s;for(let s=8;s<256;s++)Q.EXP_TABLE[s]=Q.EXP_TABLE[s-4]^Q.EXP_TABLE[s-5]^Q.EXP_TABLE[s-6]^Q.EXP_TABLE[s-8];for(let s=0;s<255;s++)Q.LOG_TABLE[Q.EXP_TABLE[s]]=s;const z={PATTERN_POSITION_TABLE:[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],G15:1335,G18:7973,G15_MASK:21522,getBCHTypeInfo:function(s){let t=s<<10;for(;z.getBCHDigit(t)-z.getBCHDigit(z.G15)>=0;)t^=z.G15<<z.getBCHDigit(t)-z.getBCHDigit(z.G15);return(s<<10|t)^z.G15_MASK},getBCHTypeNumber:function(s){let t=s<<12;for(;z.getBCHDigit(t)-z.getBCHDigit(z.G18)>=0;)t^=z.G18<<z.getBCHDigit(t)-z.getBCHDigit(z.G18);return s<<12|t},getBCHDigit:function(s){let t=0;for(;s!=0;)t++,s>>>=1;return t},getPatternPosition:function(s){return z.PATTERN_POSITION_TABLE[s-1]},getMask:function(s,t,e){switch(s){case Xt.PATTERN000:return(t+e)%2==0;case Xt.PATTERN001:return t%2==0;case Xt.PATTERN010:return e%3==0;case Xt.PATTERN011:return(t+e)%3==0;case Xt.PATTERN100:return(Math.floor(t/2)+Math.floor(e/3))%2==0;case Xt.PATTERN101:return t*e%2+t*e%3==0;case Xt.PATTERN110:return(t*e%2+t*e%3)%2==0;case Xt.PATTERN111:return(t*e%3+(t+e)%2)%2==0;default:throw new Error("bad maskPattern:"+s)}},getErrorCorrectPolynomial:function(s){let t=new re([1],0);for(let e=0;e<s;e++)t=t.multiply(new re([1,Q.gexp(e)],0));return t},getLengthInBits:function(s,t){if(1<=t&&t<10)switch(s){case pt.MODE_NUMBER:return 10;case pt.MODE_ALPHA_NUM:return 9;case pt.MODE_8BIT_BYTE:return 8;case pt.MODE_KANJI:return 8;default:throw new Error("mode:"+s)}else if(t<27)switch(s){case pt.MODE_NUMBER:return 12;case pt.MODE_ALPHA_NUM:return 11;case pt.MODE_8BIT_BYTE:return 16;case pt.MODE_KANJI:return 10;default:throw new Error("mode:"+s)}else if(t<41)switch(s){case pt.MODE_NUMBER:return 14;case pt.MODE_ALPHA_NUM:return 13;case pt.MODE_8BIT_BYTE:return 16;case pt.MODE_KANJI:return 12;default:throw new Error("mode:"+s)}else throw new Error("type:"+t)},getLostPoint:function(s){const t=s.getModuleCount();let e=0;for(let r=0;r<t;r++)for(let a=0;a<t;a++){let o=0;const c=s.isDark(r,a);for(let h=-1;h<=1;h++)if(!(r+h<0||t<=r+h))for(let l=-1;l<=1;l++)a+l<0||t<=a+l||h==0&&l==0||c==s.isDark(r+h,a+l)&&o++;o>5&&(e+=3+o-5)}for(let r=0;r<t-1;r++)for(let a=0;a<t-1;a++){let o=0;s.isDark(r,a)&&o++,s.isDark(r+1,a)&&o++,s.isDark(r,a+1)&&o++,s.isDark(r+1,a+1)&&o++,(o==0||o==4)&&(e+=3)}for(let r=0;r<t;r++)for(let a=0;a<t-6;a++)s.isDark(r,a)&&!s.isDark(r,a+1)&&s.isDark(r,a+2)&&s.isDark(r,a+3)&&s.isDark(r,a+4)&&!s.isDark(r,a+5)&&s.isDark(r,a+6)&&(e+=40);for(let r=0;r<t;r++)for(let a=0;a<t-6;a++)s.isDark(a,r)&&!s.isDark(a+1,r)&&s.isDark(a+2,r)&&s.isDark(a+3,r)&&s.isDark(a+4,r)&&!s.isDark(a+5,r)&&s.isDark(a+6,r)&&(e+=40);let n=0;for(let r=0;r<t;r++)for(let a=0;a<t;a++)s.isDark(a,r)&&n++;const i=Math.abs(100*n/t/t-50)/5;return e+=i*10,e}};class re{num;constructor(t,e){if(t.length==null)throw new Error(t.length+"/"+e);let n=0;for(;n<t.length&&t[n]==0;)n++;this.num=new Array(t.length-n+e);for(let i=0;i<t.length-n;i++)this.num[i]=t[i+n]}get(t){return this.num[t]}getLength(){return this.num.length}multiply(t){const e=new Array(this.getLength()+t.getLength()-1);for(let n=0;n<this.getLength();n++)for(let i=0;i<t.getLength();i++)e[n+i]^=Q.gexp(Q.glog(this.get(n))+Q.glog(t.get(i)));return new re(e,0)}mod(t){if(this.getLength()-t.getLength()<0)return this;const e=Q.glog(this.get(0))-Q.glog(t.get(0)),n=new Array(this.getLength());for(let i=0;i<this.getLength();i++)n[i]=this.get(i);for(let i=0;i<t.getLength();i++)n[i]^=Q.gexp(Q.glog(t.get(i))+e);return new re(n,0).mod(t)}}class Ft{totalCount;dataCount;constructor(t,e){this.totalCount=t,this.dataCount=e}static RS_BLOCK_TABLE=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]];static getRSBlocks(t,e){const n=Ft.getRsBlockTable(t,e);if(n==null)throw new Error("bad rs block @ typeNumber:"+t+"/errorCorrectLevel:"+e);const i=n.length/3,r=[];for(let a=0;a<i;a++){const o=n[a*3+0],c=n[a*3+1],h=n[a*3+2];for(let l=0;l<o;l++)r.push(new Ft(c,h))}return r}static getRsBlockTable(t,e){switch(e){case Se.L:return Ft.RS_BLOCK_TABLE[(t-1)*4+0];case Se.M:return Ft.RS_BLOCK_TABLE[(t-1)*4+1];case Se.Q:return Ft.RS_BLOCK_TABLE[(t-1)*4+2];case Se.H:return Ft.RS_BLOCK_TABLE[(t-1)*4+3];default:return}}}class Zi{buffer;length;constructor(){this.buffer=[],this.length=0}get(t){const e=Math.floor(t/8);return(this.buffer[e]>>>7-t%8&1)==1}put(t,e){for(let n=0;n<e;n++)this.putBit((t>>>e-n-1&1)==1)}getLengthInBits(){return this.length}putBit(t){const e=Math.floor(this.length/8);this.buffer.length<=e&&this.buffer.push(0),t&&(this.buffer[e]|=128>>>this.length%8),this.length++}}class Zc{mode;data;constructor(t){this.mode=pt.MODE_8BIT_BYTE,this.data=t}getLength(){return this.data.length}write(t){for(let e=0,n=this.data.length;e<n;e++)t.put(this.data.charCodeAt(e),8)}}class zt{static PAD0=236;static PAD1=17;typeNumber;errorCorrectLevel;modules;moduleCount;dataCache;dataList;constructor(t,e){this.typeNumber=t,this.errorCorrectLevel=Se[e],this.modules=[],this.moduleCount=0,this.dataCache=null,this.dataList=[]}addData(t){const e=new Zc(t);this.dataList.push(e),this.dataCache=null}isDark(t,e){if(t<0||this.moduleCount<=t||e<0||this.moduleCount<=e)throw new Error(t+","+e);return this.modules[t][e]}getModuleCount(){return this.moduleCount}make(){if(this.typeNumber<1){let t=1;for(t=1;t<40;t++){const e=Ft.getRSBlocks(t,this.errorCorrectLevel),n=new Zi;let i=0;for(let r=0;r<e.length;r++)i+=e[r].dataCount;for(let r=0;r<this.dataList.length;r++){const a=this.dataList[r];n.put(a.mode,4),n.put(a.getLength(),z.getLengthInBits(a.mode,t)),a.write(n)}if(n.getLengthInBits()<=i*8)break}this.typeNumber=t}this.makeImpl(!1,this.getBestMaskPattern())}makeImpl(t,e){this.moduleCount=this.typeNumber*4+17,this.modules=new Array(this.moduleCount);for(let n=0;n<this.moduleCount;n++){this.modules[n]=new Array(this.moduleCount);for(let i=0;i<this.moduleCount;i++)this.modules[n][i]=null}this.setupPositionProbePattern(0,0),this.setupPositionProbePattern(this.moduleCount-7,0),this.setupPositionProbePattern(0,this.moduleCount-7),this.setupPositionAdjustPattern(),this.setupTimingPattern(),this.setupTypeInfo(t,e),this.typeNumber>=7&&this.setupTypeNumber(t),this.dataCache==null&&(this.dataCache=zt.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,e)}setupPositionProbePattern(t,e){for(let n=-1;n<=7;n++)if(!(t+n<=-1||this.moduleCount<=t+n))for(let i=-1;i<=7;i++)e+i<=-1||this.moduleCount<=e+i||(0<=n&&n<=6&&(i==0||i==6)||0<=i&&i<=6&&(n==0||n==6)||2<=n&&n<=4&&2<=i&&i<=4?this.modules[t+n][e+i]=!0:this.modules[t+n][e+i]=!1)}getBestMaskPattern(){let t=0,e=0;for(let n=0;n<8;n++){this.makeImpl(!0,n);const i=z.getLostPoint(this);(n==0||t>i)&&(t=i,e=n)}return e}createMovieClip(t,e,n){const i=t.createEmptyMovieClip(e,n),r=1;this.make();for(let a=0;a<this.modules.length;a++){const o=a*r;for(let c=0;c<this.modules[a].length;c++){const h=c*r;this.modules[a][c]&&(i.beginFill(0,100),i.moveTo(h,o),i.lineTo(h+r,o),i.lineTo(h+r,o+r),i.lineTo(h,o+r),i.endFill())}}return i}setupTimingPattern(){for(let t=8;t<this.moduleCount-8;t++)this.modules[t][6]==null&&(this.modules[t][6]=t%2==0);for(let t=8;t<this.moduleCount-8;t++)this.modules[6][t]==null&&(this.modules[6][t]=t%2==0)}setupPositionAdjustPattern(){const t=z.getPatternPosition(this.typeNumber);for(let e=0;e<t.length;e++)for(let n=0;n<t.length;n++){const i=t[e],r=t[n];if(this.modules[i][r]==null)for(let a=-2;a<=2;a++)for(let o=-2;o<=2;o++)a==-2||a==2||o==-2||o==2||a==0&&o==0?this.modules[i+a][r+o]=!0:this.modules[i+a][r+o]=!1}}setupTypeNumber(t){const e=z.getBCHTypeNumber(this.typeNumber);for(let n=0;n<18;n++){const i=!t&&(e>>n&1)==1;this.modules[Math.floor(n/3)][n%3+this.moduleCount-8-3]=i}for(let n=0;n<18;n++){const i=!t&&(e>>n&1)==1;this.modules[n%3+this.moduleCount-8-3][Math.floor(n/3)]=i}}setupTypeInfo(t,e){const n=this.errorCorrectLevel<<3|e,i=z.getBCHTypeInfo(n);for(let r=0;r<15;r++){const a=!t&&(i>>r&1)==1;r<6?this.modules[r][8]=a:r<8?this.modules[r+1][8]=a:this.modules[this.moduleCount-15+r][8]=a}for(let r=0;r<15;r++){const a=!t&&(i>>r&1)==1;r<8?this.modules[8][this.moduleCount-r-1]=a:r<9?this.modules[8][15-r-1+1]=a:this.modules[8][15-r-1]=a}this.modules[this.moduleCount-8][8]=!t}mapData(t,e){let n=-1,i=this.moduleCount-1,r=7,a=0;for(let o=this.moduleCount-1;o>0;o-=2)for(o==6&&o--;;){for(let c=0;c<2;c++)if(this.modules[i][o-c]==null){let h=!1;a<t.length&&(h=(t[a]>>>r&1)==1),z.getMask(e,i,o-c)&&(h=!h),this.modules[i][o-c]=h,r--,r==-1&&(a++,r=7)}if(i+=n,i<0||this.moduleCount<=i){i-=n,n=-n;break}}}static createData(t,e,n){const i=Ft.getRSBlocks(t,e),r=new Zi;for(let o=0;o<n.length;o++){const c=n[o];r.put(c.mode,4),r.put(c.getLength(),z.getLengthInBits(c.mode,t)),c.write(r)}let a=0;for(let o=0;o<i.length;o++)a+=i[o].dataCount;if(r.getLengthInBits()>a*8)throw new Error("code length overflow. ("+r.getLengthInBits()+">"+a*8+")");for(r.getLengthInBits()+4<=a*8&&r.put(0,4);r.getLengthInBits()%8!=0;)r.putBit(!1);for(;!(r.getLengthInBits()>=a*8||(r.put(zt.PAD0,8),r.getLengthInBits()>=a*8));)r.put(zt.PAD1,8);return zt.createBytes(r,i)}static createBytes(t,e){let n=0,i=0,r=0;const a=new Array(e.length),o=new Array(e.length);for(let f=0;f<e.length;f++){const g=e[f].dataCount,w=e[f].totalCount-g;i=Math.max(i,g),r=Math.max(r,w),a[f]=new Array(g);for(let S=0;S<a[f].length;S++)a[f][S]=255&t.buffer[S+n];n+=g;const m=z.getErrorCorrectPolynomial(w),b=new re(a[f],m.getLength()-1).mod(m);o[f]=new Array(m.getLength()-1);for(let S=0;S<o[f].length;S++){const C=S+b.getLength()-o[f].length;o[f][S]=C>=0?b.get(C):0}}let c=0;for(let f=0;f<e.length;f++)c+=e[f].totalCount;const h=new Array(c);let l=0;for(let f=0;f<i;f++)for(let g=0;g<e.length;g++)f<a[g].length&&(h[l++]=a[g][f]);for(let f=0;f<r;f++)for(let g=0;g<e.length;g++)f<o[g].length&&(h[l++]=o[g][f]);return h}}const Ki=Math.ceil,Ce=Math.floor,Qi=Math.round;function Kc(s,t){const e=_s(s),n=t?.ecc||"H",i=t?.size||256,r=-1,a=t?.padding||0,o=t?.color||"#000000",c=t?.background||"#ffffff",h=new zt(r,n);h.addData(e),h.make();const l=h.getModuleCount(),f=(i-a*2)/l,g=a,w=i-a;return Ji(i,o,c,function(m,v){if(g<=m&&m<w&&g<=v&&v<w){const b=Ce((m-g)/f),S=Ce((v-g)/f);return h.isDark(S,b)?0:1}else return 1})}function Qc(s,t){const e=t.x||0,n=t.y||0,i=_s(s),r=t.ctx,a=t.ecc||"H",o=typeof t.size=="number"?Ce(t.size):256,c=t.padding||0,h=-1,l=t.color||"#000000",f=t.background||"#ffffff",g=new zt(h,a);g.addData(i),g.make();const w=g.getModuleCount(),m=(o-c*2)/w;r.fillStyle=f,r.fillRect(e,n,o,o);for(let v=0;v<w;v++)for(let b=0;b<w;b++){const S=Ki((b+1)*m)-Ce(b*m),C=Ki((v+1)*m)-Ce(v*m);r.fillStyle=g.isDark(v,b)?l:f,r.fillRect(e+Qi(b*m)+c,n+Qi(v*m)+c,S,C)}}let nn;const tr=new WeakMap;function ts(s,t){let e=tr.get(s);e||(e=new Map,tr.set(s,e));let n=e.get(t);return n||(n=new er,e.set(t,n)),n}class er{subscribers;constructor(){this.subscribers=new Set}depend(){nn&&this.subscribers.add(nn)}notify(){this.subscribers.forEach(t=>t())}}function th(s){nn=s,s(),nn=null}function eh(s){return Object.keys(s).forEach(t=>{let e=s[t];const n=ts(s,t);Object.defineProperty(s,t,{get(){return n.depend(),e},set(i){i!=e&&(e=i,n.notify())}})}),s}function nr(s){return new Proxy(s,{get(t,e,n){return ts(s,e).depend(),Reflect.get(t,e,n)},set(t,e,n,i){const r=ts(s,e);return s[e]!=n&&(s[e]=n,r.notify()),Reflect.set(t,e,n,i)}})}const nh=nr;class sn{x;y;z;constructor(t=[0,0,0],e=[0,0,0]){const[n,i,r]=t,[a,o,c]=e;this.x=n-a,this.y=i-o,this.z=r-c}get length(){const{x:t,y:e,z:n}=this;return Math.sqrt(t*t+e*e+n*n)}unit(){const t=this.length;return new sn([this.x/t,this.y/t,this.z/t])}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z}cross(t){const e=this.x,n=this.y,i=this.z,r=t.x,a=t.y,o=t.z;return new sn([n*o-i*a,i*r-e*o,e*a-r*n])}}class ae extends K{shapes=[];constructor(t){super(t)}toSVGPathData(){return this.shapes.reduce((t,e,n)=>{const i=e.toSVGPathData();return Array.isArray(i[0])?t.push(...i):t.push(i),t},[])}toCanvasContext(t){}}class sr extends ii{currentItem={};items=[];groups=[];globalStyles={};grad={};idtops={};text="";constructor(t){super(t),this.on("tag",(e,n)=>{switch(this.text="",this.currentItem={type:e},e){case"g":this.groups.push(this.currentItem);break}this.processAttrs(e,n)}),this.on("text",e=>{if(this.currentItem.type=="style"){try{const n=Xr(e);for(let i of n.stylesheet.rules)for(let r of i.declarations)for(let a of i.selectors)this.globalStyles[a]=this.globalStyles[a]||[],this.globalStyles[a].push(`${r.property}:${r.value}`)}catch{console.error("CAN'T parse css text: "+e)}return}this.text+=e}),this.on("/tag",(e,n)=>{let i=this.groups.length;for(;i--;)if(this.groups[i]!=this.currentItem){let r="",a="";for(let o in this.groups[i])o=="transform"?r=this.groups[i].transform:o=="class"&&this.globalStyles["."+this.groups[i][o]]?a=this.globalStyles["."+this.groups[i][o]].join(";")+";"+a:o=="id"&&this.globalStyles["#"+this.groups[i][o]]?a=this.globalStyles["#"+this.groups[i][o]].join(";")+";"+a:typeof this.currentItem[o]>"u"&&(this.currentItem[o]=this.groups[i][o]);typeof this.currentItem.transform>"u"?this.currentItem.transform=r:this.currentItem.transform+=" "+r,typeof this.currentItem.style>"u"?this.currentItem.style=a:this.currentItem.style=a+this.currentItem.style,this.currentItem.class&&this.globalStyles["."+this.currentItem.class]?this.currentItem.style=this.globalStyles["."+this.currentItem.class].join(";")+";"+this.currentItem.style:this.currentItem.id&&this.globalStyles["#"+this.currentItem.id]&&(this.currentItem.style=this.globalStyles["#"+this.currentItem.id].join(";")+";"+this.currentItem.style),ns(this.currentItem.style,this.currentItem,ss)}switch(this.processAttrs(e,n),e){case"g":this.groups.pop();break;case"cirlce":this.addToItems();break;case"ellipse":this.addToItems();break;case"polygon":this.addToItems();break;case"path":this.addToItems();break;case"line":this.addToItems();break;case"rect":this.addToItems();break;case"image":this.addToItems();break;case"text":this.currentItem.text=this.text,this.currentItem["text-anchor"]=this.currentItem["text-anchor"]||"start",this.addToItems();break}}),this.on("finish",()=>{this.emit("result",this.items)})}parse(){return super.parse(),this.items}processAttrs(t,e){let n=[],i;switch(t){case"svg":let r="",a="";if(e.width&&e.height)r=e.width,a=e.height;else if(e.viewBox){const o=e.viewBox.split(/\s+/gi);o.length==4&&(r=String(parseFloat(o[2])-parseFloat(o[0])),a=String(parseFloat(o[3])-parseFloat(o[1])))}r&&a&&this.items.push({type:"viewbox",width:r,height:a});break;case"line":typeof e.x1=="number"&&typeof e.y1=="number"&&typeof e.x2=="number"&&typeof e.y2=="number"&&(this.currentItem.path="M"+[e.x1,e.y1,e.x2,e.y2]);break;case"stop":i={},e.style&&ns(e.style,i),i.offset=i.offset||e.offset,i.color=i["stop-color"]||e["stop-color"],i.opacity=i["stop-opacity"]||e["stop-opacity"],~(i.offset+"").indexOf("%")?i.offset=parseFloat(i.offset):i.offset=parseFloat(i.offset)*100,i.offset=+i.offset.toFixed(2),this.grad.stops.push(i);break;case"linearGradient":this.grad.angle=(360+es(parseFloat(e.x1),parseFloat(e.y1),parseFloat(e.x2),parseFloat(e.y2),parseFloat(e.x1)+100,parseFloat(e.y1))).toFixed(2),n=[this.grad.angle];for(let o=0,c=this.grad.stops.length;o<c;o++)i=this.grad.stops[o],o&&o!=c-1?n.push(i.color+":"+i.offset):n.push(i.color);this.idtops[this.grad.id]=n.join("-"),this.items.forEach(o=>{o.fillid==this.grad.id&&(o.fill=this.idtops[this.grad.id])});break;case"radialGradient":n=[];for(let o=0,c=this.grad.stops.length;o<c;o++)i=this.grad.stops[o],o&&o!=c-1?n.push(i.color+":"+i.offset):n.push(i.color);this.idtops[this.grad.id]=n.join("-"),this.items.forEach(o=>{o.fillid==this.grad.id&&(o.fill=this.idtops[this.grad.id])});break}for(let r in e){const a=e[r];if(ss.includes(r)&&(this.currentItem[r]=a),r==="id"&&(this.currentItem.type==="linearGradient"&&(this.grad={id:r,stops:[]}),this.currentItem.type==="radialGradient"&&(this.grad={id:r,stops:[]})),r==="style"&&ns(a,this.currentItem,ss),r==="transform"&&(this.currentItem.transform=a+(this.currentItem.transform||" ")),r==="fill"){const o=a.match(/url\(#([^)]+)\)/);if(o){const c=o[1];this.currentItem.fillid=c,this.idtops[c]&&(this.currentItem.fill=this.idtops[c])}}r==="points"&&this.currentItem.type=="polygon"&&(this.currentItem.path="M"+a+"z"),r==="d"&&this.currentItem.type=="path"&&(this.currentItem.path=a),r==="xlink:href"&&this.currentItem.type=="image"&&(this.currentItem.src=a)}}addToItems(){this.items.push(this.currentItem)}}function es(s,t,e,n,i,r){if(typeof i>"u"||typeof r>"u"){const a=s-e,o=t-n;return!a&&!o?0:(180+Math.atan2(-o,-a)*180/Math.PI+360)%360}else return es(s,t,i,r)-es(e,n,i,r)}function ns(s,t,e){const n=(s+"").split(";"),i=/^\s+|\s+$/g;for(let r=0,a=n.length;r<a;r++){let o=n[r].split(":"),c=o[0].replace(i,"").replace(/[A-Z]/g,function(h){return"-"+h.toLowerCase()});(!e||e.includes(c))&&(t[c]=o[1].replace(i,""))}}const ss=["id","class","viewBox","width","height","x","y","cx","cy","r","rx","ry","cursor","opacity","src","fill","fill-opacity","stroke","stroke-dasharray","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-anchor","font","font-family","font-size","font-style","font-weight","letter-spacing"];class sh{app;rootEl;shapes=[];allShapes=[];isMouseDown=!1;currentMouseInShapeID="";currentEnableDragMouseInShapeID="";constructor(t,e,n){this.app=t,this.rootEl=H.createSVGElement("svg"),D.empty(this.app.container),D.insert(this.app.container,this.rootEl),e&&n?this.setSize(e,n):(this.setSize(this.app.width,this.app.height),this.app.on("resize",()=>{this.setSize(this.app.width,this.app.height)})),this.app.captureMove({start:()=>{this.isMouseDown=!0,this.setCursor()},end:()=>{this.isMouseDown=!1,this.setCursor()},move:()=>{if(this.currentMouseInShapeID="",this.isMouseDown&&this.currentEnableDragMouseInShapeID){this.setCursor();return}let i=0,r=this.shapes.length;for(;i<r;i++){const a=this.shapes[i];if(!(a instanceof j))continue;const o=a.isPointInPath(this.app.mousePoint.x,this.app.mousePoint.y,this.rootEl)||!1;if(o&&(this.currentMouseInShapeID=a.id),a.mouseMove&&a.mouseMove(o),o&&a.enableDrag){this.currentEnableDragMouseInShapeID=a.id;break}}i>=r&&(this.currentEnableDragMouseInShapeID=""),this.setCursor()}})}setCursor(){this.currentEnableDragMouseInShapeID?(this.app.container.style.cursor="grab",this.isMouseDown&&(this.app.container.style.cursor="grabbing")):this.currentMouseInShapeID?this.app.container.style.cursor="pointer":this.app.container.style.cursor="default"}setSize(t,e){return D.attribute(this.rootEl,{viewBox:`0 0 ${t} ${e}`,width:`${t}`,height:`${e}`}),this}download(){return H.downloadFromSVGElement(this.rootEl)}attr(t,e,n){const i=t.el||t;if(!(i instanceof SVGElement))return this;if(e===void 0&&n===void 0)return D.attribute(i);if(typeof e=="string"&&n===void 0)return D.attribute(i,ft(e))||"";if(typeof e=="object"){const r=D.attribute(i);if(D.attribute(i,e),t instanceof K){t.attrs={...e};for(let a in e)ft(a)===r[ft(a)]&&delete r[ft(a)];for(let a in r)a!=="d"&&a!=="fill"&&a!=="stroke"&&D.removeAttribute(i,a)}}else typeof e=="string"&&n!==void 0&&(D.attribute(i,ft(e),n),t instanceof K&&(t.attrs[ft(e)]=n));return this}path(t,e){const n=typeof e?.addToShapes=="boolean"?e?.addToShapes:!0;if(t instanceof as){t.el=this.text(t.text,t.x,t.y),this.attr(t.el,t.attrs),this.allShapes.push(t);return}if(t instanceof bt){const r=`M ${t.fromX} ${t.fromY} `+t.toSVGPathD();t.el=H.createSvgPath(r),D.insert(this.rootEl,t.el),this.update(t),this.allShapes.push(t),n&&this.shapes.push(t);return}if(t instanceof Pe){t.shapes.forEach(r=>{r.el=H.createSvgPath(r.toSVGPathD()),D.insert(this.rootEl,r.el),this.update(r),this.allShapes.push(r),n&&this.shapes.push(r)});return}if(t instanceof ae){t.shapes.forEach(r=>this.path(r,e));return}let i;return t instanceof j?i=t:t instanceof K?i=j.fromShape(t):(i=j.fromSVGPathD(t||"M0,0"),Ue(i,e||{})),i.el=H.createSvgPath(i.toSVGPathD()),D.insert(this.rootEl,i.el),this.update(i),this.allShapes.push(i),n&&this.shapes.push(i),i}update(t){if(!t)return;const e=[];t instanceof ae?e.push(...t.shapes):e.push(t),e.forEach(n=>{if(n instanceof j){if(n.followMouse&&(!le(n.x,this.app.mousePoint.x,5)||!le(n.y,this.app.mousePoint.y,5))&&(n.angleTo(this.app.mousePoint),n.followTo(this.app.mousePoint)),n.targetToAfterDragFree&&(this.isMouseDown||n.nextFrameEaseTo(new mt({x:n.targetToAfterDragFree.targetX,y:n.targetToAfterDragFree.targetY}),{easing:n.targetToAfterDragFree?.easing})),this.isMouseDown&&this.currentEnableDragMouseInShapeID==n.id){const{dx:i,dy:r}=n.centerDiff;n.x=this.app.mousePoint.x,n.y=this.app.mousePoint.y,n.x-=i,n.y-=r,n.isDragging=!0,this.shapes.filter(a=>a.id!=n.id).forEach(a=>{a instanceof K&&(a.isDragging=!1)})}n.updateTransform()}(n instanceof bt||n instanceof j)&&(this.attr(n,"d",n instanceof bt?`M ${n.fromX} ${n.fromY} `+n.toSVGPathD():n.toSVGPathD()),this.attr(n,n.attrs)),n.el&&(n.isShow?D.show(n.el):D.hide(n.el))})}click(t){const e=()=>{this.shapes.forEach(n=>{n instanceof j&&n.isPointInPath(this.app.mousePoint.x,this.app.mousePoint.y,this.rootEl)&&t(n)})};return this.app.on("tap",e),()=>{this.app.off("tap",e)}}delete(t){t.el&&D.remove(t.el),this.shapes=this.shapes.filter(e=>e.id!=t.id),this.allShapes=this.allShapes.filter(e=>e.id!=t.id)}clear(){this.allShapes.forEach(t=>{t instanceof SVGElement?D.remove(t):t.el&&D.remove(t.el)}),this.shapes=[],this.allShapes=[]}pathRosetta(t,e,n,i,r){if(r==0)throw new Error("no dividing by zero, please");const a=new j({x:t,y:e}),o=360/r;for(let c=0;c<r;c+=1){const h=o*c*Math.PI/180,l=t+2*n*Math.cos(h),f=e+2*n*Math.sin(h);a.appendLine(new oe({x:l,y:f,rx:n,ry:i,xAxisRotate:o*c,largeArcFlag:1,sweepFlag:1})),a.appendLine(new oe({x:t,y:e,rx:n,ry:i,xAxisRotate:o*c,largeArcFlag:1,sweepFlag:1}))}return this.path(a),a}trailPath(t,e,n=0){const i=t.getTotalLength();return this.attr(e,"d",t.getSubpath(0,n*i).toSVGPathD()),t.getPointAtLength(n*i)}circle(t,e,n){return this.path(new mt({x:t,y:e,radius:n}))}circleEl(t,e,n){const i=H.createSVGElement("circle",{cx:String(t),cy:String(e),r:String(n)});return D.insert(this.rootEl,i),i}ellipse(t,e,n,i){return this.path(new rr({x:t,y:e,rx:n,ry:i}))}ellipseEl(t,e,n,i){const r=H.createSVGElement("ellipse",{cx:String(t),cy:String(e),rx:String(n),ry:String(i)});return D.insert(this.rootEl,r),r}rect(t,e,n,i){return this.path(new Et({x:t,y:e,width:n,height:i}))}rectEl(t,e,n,i){const r=H.createSVGElement("rect",{x:String(t),y:String(e),width:String(n),height:String(i)});return D.insert(this.rootEl,r),r}image(t,e,n,i,r){}text(t,e,n,i="1.2em"){const r=H.createSVGElement("text",{x:String(e),y:String(n)});return t.split(`
|
|
41
|
-
`).forEach((a,o)=>{if(a.trim()){const c=H.createSVGElement("tspan",{x:String(e),dy:o>0?i:"0"});D.html(c,a),D.insert(r,c),this.attr(c,{"alignment-baseline":"middle"})}}),D.insert(this.rootEl,r),r}}const ir=ih("50,nbsp,51,iexcl,52,cent,53,pound,54,curren,55,yen,56,brvbar,57,sect,58,uml,59,copy,5a,ordf,5b,laquo,5c,not,5d,shy,5e,reg,5f,macr,5g,deg,5h,plusmn,5i,sup2,5j,sup3,5k,acute,5l,micro,5m,para,5n,middot,5o,cedil,5p,sup1,5q,ordm,5r,raquo,5s,frac14,5t,frac12,5u,frac34,5v,iquest,60,Agrave,61,Aacute,62,Acirc,63,Atilde,64,Auml,65,Aring,66,AElig,67,Ccedil,68,Egrave,69,Eacute,6a,Ecirc,6b,Euml,6c,Igrave,6d,Iacute,6e,Icirc,6f,Iuml,6g,ETH,6h,Ntilde,6i,Ograve,6j,Oacute,6k,Ocirc,6l,Otilde,6m,Ouml,6n,times,6o,Oslash,6p,Ugrave,6q,Uacute,6r,Ucirc,6s,Uuml,6t,Yacute,6u,THORN,6v,szlig,70,agrave,71,aacute,72,acirc,73,atilde,74,auml,75,aring,76,aelig,77,ccedil,78,egrave,79,eacute,7a,ecirc,7b,euml,7c,igrave,7d,iacute,7e,icirc,7f,iuml,7g,eth,7h,ntilde,7i,ograve,7j,oacute,7k,ocirc,7l,otilde,7m,ouml,7n,divide,7o,oslash,7p,ugrave,7q,uacute,7r,ucirc,7s,uuml,7t,yacute,7u,thorn,7v,yuml,ci,fnof,sh,Alpha,si,Beta,sj,Gamma,sk,Delta,sl,Epsilon,sm,Zeta,sn,Eta,so,Theta,sp,Iota,sq,Kappa,sr,Lambda,ss,Mu,st,Nu,su,Xi,sv,Omicron,t0,Pi,t1,Rho,t3,Sigma,t4,Tau,t5,Upsilon,t6,Phi,t7,Chi,t8,Psi,t9,Omega,th,alpha,ti,beta,tj,gamma,tk,delta,tl,epsilon,tm,zeta,tn,eta,to,theta,tp,iota,tq,kappa,tr,lambda,ts,mu,tt,nu,tu,xi,tv,omicron,u0,pi,u1,rho,u2,sigmaf,u3,sigma,u4,tau,u5,upsilon,u6,phi,u7,chi,u8,psi,u9,omega,uh,thetasym,ui,upsih,um,piv,812,bull,816,hellip,81i,prime,81j,Prime,81u,oline,824,frasl,88o,weierp,88h,image,88s,real,892,trade,89l,alefsym,8cg,larr,8ch,uarr,8ci,rarr,8cj,darr,8ck,harr,8dl,crarr,8eg,lArr,8eh,uArr,8ei,rArr,8ej,dArr,8ek,hArr,8g0,forall,8g2,part,8g3,exist,8g5,empty,8g7,nabla,8g8,isin,8g9,notin,8gb,ni,8gf,prod,8gh,sum,8gi,minus,8gn,lowast,8gq,radic,8gt,prop,8gu,infin,8h0,ang,8h7,and,8h8,or,8h9,cap,8ha,cup,8hb,int,8hk,there4,8hs,sim,8i5,cong,8i8,asymp,8j0,ne,8j1,equiv,8j4,le,8j5,ge,8k2,sub,8k3,sup,8k4,nsub,8k6,sube,8k7,supe,8kl,oplus,8kn,otimes,8l5,perp,8m5,sdot,8o8,lceil,8o9,rceil,8oa,lfloor,8ob,rfloor,8p9,lang,8pa,rang,9ea,loz,9j0,spades,9j3,clubs,9j5,hearts,9j6,diams,ai,OElig,aj,oelig,b0,Scaron,b1,scaron,bo,Yuml,m6,circ,ms,tilde,802,ensp,803,emsp,809,thinsp,80c,zwnj,80d,zwj,80e,lrm,80f,rlm,80j,ndash,80k,mdash,80o,lsquo,80p,rsquo,80q,sbquo,80s,ldquo,80t,rdquo,80u,bdquo,810,dagger,811,Dagger,81g,permil,81p,lsaquo,81q,rsaquo,85c,euro",32);function ih(s,t=10){const e={},n=s.split(",");for(let i=0;i<n.length;i+=2){const r="&"+n[i+1]+";",a=parseInt(n[i],t);e[r]="&#"+a+";"}return e["\\xa0"]=" ",e}function ct(s,t){const e=Object.keys(t);for(let n=0;n<e.length;n++)s=s.replace(new RegExp("{"+e[n]+"}","gi"),""+t[e[n]]);return s}function rn(s){let t,e;if(!s)throw new Error("cannot create a random attribute name for an undefined object");const n="ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz";t="";do for(t="",e=0;e<12;e++)t+=n[Math.floor(Math.random()*n.length)];while(s[t]);return t}function rh(s){const t={left:"start",right:"end",center:"middle",start:"start",end:"end"};return t[s]||t.start}function ah(s){const t={alphabetic:"alphabetic",hanging:"hanging",top:"text-before-edge",bottom:"text-after-edge",middle:"central"};return t[s]||t.alphabetic}const Te={strokeStyle:{svgAttr:"stroke",canvas:"#000000",svg:"none",apply:"stroke"},fillStyle:{svgAttr:"fill",canvas:"#000000",svg:null,apply:"fill"},lineCap:{svgAttr:"stroke-linecap",canvas:"butt",svg:"butt",apply:"stroke"},lineJoin:{svgAttr:"stroke-linejoin",canvas:"miter",svg:"miter",apply:"stroke"},miterLimit:{svgAttr:"stroke-miterlimit",canvas:10,svg:4,apply:"stroke"},lineWidth:{svgAttr:"stroke-width",canvas:1,svg:1,apply:"stroke"},globalAlpha:{svgAttr:"opacity",canvas:1,svg:1,apply:"fill stroke"},font:{canvas:"10px sans-serif"},shadowColor:{canvas:"#000000"},shadowOffsetX:{canvas:0},shadowOffsetY:{canvas:0},shadowBlur:{canvas:0},textAlign:{canvas:"start"},textBaseline:{canvas:"alphabetic"},lineDash:{svgAttr:"stroke-dasharray",canvas:[],svg:null,apply:"stroke"}};class an{__root;__ctx;constructor(t,e){this.__root=t,this.__ctx=e}addColorStop(t,e){const n=this.__ctx.__createElement("stop");if(n.setAttribute("offset",""+t),e.indexOf("rgba")!==-1){const r=/rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d?\.?\d*)\s*\)/gi.exec(e);r&&(n.setAttribute("stop-color",ct("rgb({r},{g},{b})",{r:r[1],g:r[2],b:r[3]})),n.setAttribute("stop-opacity",r[4]))}else n.setAttribute("stop-color",e);this.__root.appendChild(n)}}class is{__root;__ctx;constructor(t,e){this.__root=t,this.__ctx=e}}class Ee{__document=document;__canvas;__ctx;width;height;__styleStack;__groupStack;__rootSVG;__ids;__SVGdefs;__currentElement;__currentElementsToStyle=null;constructor({canvas:t,width:e=500,height:n=500}){t?(this.__canvas=t,this.__ctx=t.getContext("2d"),this.width=t.width,this.height=t.height):(this.__canvas=this.__document.createElement("canvas"),this.__ctx=this.__canvas.getContext("2d"),this.width=e,this.height=n),this.__setDefaultStyles(),this.__styleStack=[this.__getStyleState()],this.__groupStack=[],this.__rootSVG=this.__document.createElementNS("http://www.w3.org/2000/svg","svg"),this.__rootSVG.setAttribute("version","1.1"),this.__rootSVG.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.__rootSVG.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink","http://www.w3.org/1999/xlink"),this.__rootSVG.setAttribute("width",""+this.width),this.__rootSVG.setAttribute("height",""+this.height),this.__ids={},this.__SVGdefs=this.__document.createElementNS("http://www.w3.org/2000/svg","defs"),this.__rootSVG.appendChild(this.__SVGdefs),this.__currentElement=this.__document.createElementNS("http://www.w3.org/2000/svg","g"),this.__rootSVG.appendChild(this.__currentElement)}__setDefaultStyles(){const t=Object.keys(Te);for(let e=0,n=t.length;e<n;e++){const i=t[e];this[i]=Te[i].canvas}}__getStyleState(){const t={},e=Object.keys(Te);for(let n=0,i=e.length;n<i;n++){const r=e[n];t[r]=this[r]}return t}__applyStyleState(t){const e=Object.keys(t);for(let n=0,i=e.length;n<i;n++){const r=e[n];this[r]=t[r]}}__createElement(t,e={},n=!1){const i=this.__document.createElementNS("http://www.w3.org/2000/svg",t),r=Object.keys(e);n&&(i.setAttribute("fill","none"),i.setAttribute("stroke","none"));for(let a=0;a<r.length;a++){const o=r[a];i.setAttribute(o,e[o])}return i}__applyStyleToCurrentElement(t){let e=this.__currentElement;const n=this.__currentElementsToStyle;n&&(e.setAttribute(t,""),e=n.element,n.children.forEach(r=>{r.setAttribute(t,"")}));const i=Object.keys(Te);for(let r=0;r<i.length;r++){const a=Te[i[r]],o=this[i[r]];if(a.apply){if(o instanceof is){if(o.__ctx)for(;o.__ctx.__SVGdefs.childNodes.length;){const c=o.__ctx.__SVGdefs.childNodes[0].getAttribute("id");this.__ids[c]=c,this.__SVGdefs.appendChild(o.__ctx.__SVGdefs.childNodes[0])}e.setAttribute(a.apply,ct("url(#{id})",{id:o.__root.getAttribute("id")}))}else if(o instanceof an)e.setAttribute(a.apply,ct("url(#{id})",{id:o.__root.getAttribute("id")}));else if(a.apply.indexOf(t)!==-1&&a.svg!==o)if((a.svgAttr==="stroke"||a.svgAttr==="fill")&&o.indexOf("rgba")!==-1){const h=/rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d?\.?\d*)\s*\)/gi.exec(o);e.setAttribute(a.svgAttr,ct("rgb({r},{g},{b})",{r:h[1],g:h[2],b:h[3]}));let l=parseFloat(h[4]);const f=this.globalAlpha;f!=null&&(l*=f),e.setAttribute(a.svgAttr+"-opacity",""+l)}else{let c=a.svgAttr;if(i[r]==="globalAlpha"&&(c=t+"-"+a.svgAttr,e.getAttribute(c)))continue;c&&e.setAttribute(c,o)}}}}__closestGroupOrSvg(t){return t=t||this.__currentElement,t.nodeName==="g"||t.nodeName==="svg"?t:this.__closestGroupOrSvg(t.parentNode)}getSerializedSvg(t){let e=new XMLSerializer().serializeToString(this.__rootSVG);if(/xmlns="http:\/\/www\.w3\.org\/2000\/svg".+xmlns="http:\/\/www\.w3\.org\/2000\/svg/gi.test(e)&&(e=e.replace('xmlns="http://www.w3.org/2000/svg','xmlns:xlink="http://www.w3.org/1999/xlink')),t){const i=Object.keys(ir);for(let r=0,a=i.length;r<a;r++){const o=i[r],c=ir[o],h=new RegExp(o,"gi");h.test(e)&&(e=e.replace(h,c))}}return e}getSvg(){return this.__rootSVG}save(){const t=this.__createElement("g"),e=this.__closestGroupOrSvg();this.__groupStack.push(e),e.appendChild(t),this.__currentElement=t,this.__styleStack.push(this.__getStyleState())}restore(){this.__currentElementsToStyle=null;const t=this.__groupStack.pop();t?this.__currentElement=t:this.__currentElement=this.__rootSVG.childNodes[1];const e=this.__styleStack.pop();e&&this.__applyStyleState(e)}__addTransform(t){const e=this.__closestGroupOrSvg();if(e.childNodes.length>0){this.__currentElement.nodeName==="path"&&(this.__currentElementsToStyle||(this.__currentElementsToStyle={element:e,children:[]}),this.__currentElementsToStyle.children.push(this.__currentElement),this.__applyCurrentDefaultPath());const i=this.__createElement("g");e.appendChild(i),this.__currentElement=i}let n=this.__currentElement.getAttribute("transform");n?n+=" ":n="",n+=t,this.__currentElement.setAttribute("transform",n)}scale(t,e){e===void 0&&(e=t),this.__addTransform(ct("scale({x},{y})",{x:t,y:e}))}rotate(t){const e=t*180/Math.PI;this.__addTransform(ct("rotate({angle},{cx},{cy})",{angle:e,cx:0,cy:0}))}translate(t,e){this.__addTransform(ct("translate({x},{y})",{x:t,y:e}))}transform(t,e,n,i,r,a){this.__addTransform(ct("matrix({a},{b},{c},{d},{e},{f})",{a:t,b:e,c:n,d:i,e:r,f:a}))}beginPath(){this.__currentDefaultPath="",this.__currentPosition={};const t=this.__createElement("path",{},!0);this.__closestGroupOrSvg().appendChild(t),this.__currentElement=t}__applyCurrentDefaultPath(){const t=this.__currentElement;t.nodeName==="path"&&t.setAttribute("d",this.__currentDefaultPath)}__addPathCommand(t){this.__currentDefaultPath+=" ",this.__currentDefaultPath+=t}moveTo(t,e){this.__currentElement.nodeName!=="path"&&this.beginPath(),this.__currentPosition={x:t,y:e},this.__addPathCommand(ct("M {x} {y}",this.__currentPosition))}closePath(){this.__currentDefaultPath&&this.__addPathCommand("Z")}lineTo(t,e){this.__currentPosition={x:t,y:e},this.__currentDefaultPath.indexOf("M")>-1?this.__addPathCommand(ct("L {x} {y}",this.__currentPosition)):this.__addPathCommand(ct("M {x} {y}",this.__currentPosition))}bezierCurveTo(t,e,n,i,r,a){this.__currentPosition={x:r,y:a},this.__addPathCommand(ct("C {cp1x} {cp1y} {cp2x} {cp2y} {x} {y}",{cp1x:t,cp1y:e,cp2x:n,cp2y:i,x:r,y:a}))}quadraticCurveTo(t,e,n,i){this.__currentPosition={x:n,y:i},this.__addPathCommand(ct("Q {cpx} {cpy} {x} {y}",{cpx:t,cpy:e,x:n,y:i}))}normalize(t){const e=Math.sqrt(t[0]*t[0]+t[1]*t[1]);return[t[0]/e,t[1]/e]}arcTo(t,e,n,i,r){const a=this.__currentPosition&&this.__currentPosition.x,o=this.__currentPosition&&this.__currentPosition.y;if(typeof a>"u"||typeof o>"u")return;if(r<0)throw new Error("IndexSizeError: The radius provided ("+r+") is negative.");if(a===t&&o===e||t===n&&e===i||r===0){this.lineTo(t,e);return}const c=this.normalize([a-t,o-e]),h=this.normalize([n-t,i-e]);if(c[0]*h[1]===c[1]*h[0]){this.lineTo(t,e);return}const l=c[0]*h[0]+c[1]*h[1],f=Math.acos(Math.abs(l)),g=this.normalize([c[0]+h[0],c[1]+h[1]]),w=r/Math.sin(f/2),m=t+w*g[0],v=e+w*g[1],b=[-c[1],c[0]],S=[h[1],-h[0]],C=function(B){const N=B[0];return B[1]>=0?Math.acos(N):-Math.acos(N)},M=C(b),R=C(S);this.lineTo(m+b[0]*r,v+b[1]*r),this.arc(m,v,r,M,R)}stroke(){this.__currentElement.nodeName==="path"&&this.__currentElement.setAttribute("paint-order","fill stroke markers"),this.__applyCurrentDefaultPath(),this.__applyStyleToCurrentElement("stroke")}fill(){this.__currentElement.nodeName==="path"&&this.__currentElement.setAttribute("paint-order","stroke fill markers"),this.__applyCurrentDefaultPath(),this.__applyStyleToCurrentElement("fill")}rect(t,e,n,i){this.__currentElement.nodeName!=="path"&&this.beginPath(),this.moveTo(t,e),this.lineTo(t+n,e),this.lineTo(t+n,e+i),this.lineTo(t,e+i),this.lineTo(t,e),this.closePath()}fillRect(t,e,n,i){const r=this.__createElement("rect",{x:t,y:e,width:n,height:i},!0);this.__closestGroupOrSvg().appendChild(r),this.__currentElement=r,this.__applyStyleToCurrentElement("fill")}strokeRect(t,e,n,i){const r=this.__createElement("rect",{x:t,y:e,width:n,height:i},!0);this.__closestGroupOrSvg().appendChild(r),this.__currentElement=r,this.__applyStyleToCurrentElement("stroke")}__clearCanvas(){const e=this.__closestGroupOrSvg().getAttribute("transform"),n=this.__rootSVG.childNodes[1],i=n.childNodes;for(let r=i.length-1;r>=0;r--)i[r]&&n.removeChild(i[r]);this.__currentElement=n,this.__groupStack=[],e&&this.__addTransform(e)}clearRect(t,e,n,i){if(t===0&&e===0&&n===this.width&&i===this.height){this.__clearCanvas();return}const r=this.__closestGroupOrSvg(),a=this.__createElement("rect",{x:t,y:e,width:n,height:i,fill:"#FFFFFF"},!0);r.appendChild(a)}createLinearGradient(t,e,n,i){const r=this.__createElement("linearGradient",{id:rn(this.__ids),x1:t+"px",x2:n+"px",y1:e+"px",y2:i+"px",gradientUnits:"userSpaceOnUse"},!1);return this.__SVGdefs.appendChild(r),new an(r,this)}createRadialGradient(t,e,n,i,r,a){const o=this.__createElement("radialGradient",{id:rn(this.__ids),cx:i+"px",cy:r+"px",r:a+"px",fx:t+"px",fy:e+"px",gradientUnits:"userSpaceOnUse"},!1);return this.__SVGdefs.appendChild(o),new an(o,this)}__parseFont(){const e=/^\s*(?=(?:(?:[-a-z]+\s*){0,2}(italic|oblique))?)(?=(?:(?:[-a-z]+\s*){0,2}(small-caps))?)(?=(?:(?:[-a-z]+\s*){0,2}(bold(?:er)?|lighter|[1-9]00))?)(?:(?:normal|\1|\2|\3)\s*){0,3}((?:xx?-)?(?:small|large)|medium|smaller|larger|[.\d]+(?:%|in|[cem]m|ex|p[CustomCanvasContext]))(?:\s*\/\s*(normal|[.\d]+(?:%|in|[cem]m|ex|p[CustomCanvasContext])))?\s*([-,'"\sa-z0-9]+?)\s*$/i.exec(this.font),n={style:e[1]||"normal",size:e[4]||"10px",family:e[6]||"sans-serif",weight:e[3]||"normal",decoration:e[2]||"normal",href:null};return this.__fontUnderline==="underline"&&(n.decoration="underline"),this.__fontHref&&(n.href=this.__fontHref),n}__wrapTextLink(t,e){if(t.href){const n=this.__createElement("a");return n.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",t.href),n.appendChild(e),n}return e}__applyText(t,e,n,i){const r=this.__parseFont(),a=this.__closestGroupOrSvg(),o=this.__createElement("text",{"font-family":r.family,"font-size":r.size,"font-style":r.style,"font-weight":r.weight,"text-decoration":r.decoration,x:e,y:n,"text-anchor":rh(this.textAlign),"dominant-baseline":ah(this.textBaseline)},!0);o.appendChild(this.__document.createTextNode(t)),this.__currentElement=o,this.__applyStyleToCurrentElement(i),a.appendChild(this.__wrapTextLink(r,o))}fillText(t,e,n){this.__applyText(t,e,n,"fill")}strokeText(t,e,n){this.__applyText(t,e,n,"stroke")}measureText(t){return this.__ctx.font=this.font,this.__ctx.measureText(t)}arc(t,e,n,i,r,a){if(i===r)return;i=i%(2*Math.PI),r=r%(2*Math.PI),i===r&&(r=(r+2*Math.PI-.001*(a?-1:1))%(2*Math.PI));const o=t+n*Math.cos(r),c=e+n*Math.sin(r),h=t+n*Math.cos(i),l=e+n*Math.sin(i),f=a?0:1;let g=0,w=r-i;w<0&&(w+=2*Math.PI),a?g=w>Math.PI?0:1:g=w>Math.PI?1:0,this.lineTo(h,l),this.__addPathCommand(ct("A {rx} {ry} {xAxisRotation} {largeArcFlag} {sweepFlag} {endX} {endY}",{rx:n,ry:n,xAxisRotation:0,largeArcFlag:g,sweepFlag:f,endX:o,endY:c})),this.__currentPosition={x:o,y:c}}clip(){const t=this.__closestGroupOrSvg(),e=this.__createElement("clipPath"),n=rn(this.__ids),i=this.__createElement("g");this.__applyCurrentDefaultPath(),t.removeChild(this.__currentElement),e.setAttribute("id",n),e.appendChild(this.__currentElement),this.__SVGdefs.appendChild(e),t.setAttribute("clip-path",ct("url(#{id})",{id:n})),t.appendChild(i),this.__currentElement=i}drawImage(...t){let e=t[0],n,i,r,a,o=0,c=0,h,l,f,g,w,m,v,b;if(t.length===3)n=t[1],i=t[2],h=e.width,l=e.height,r=h,a=l;else if(t.length===5)n=t[1],i=t[2],r=t[3],a=t[4],h=e.width,l=e.height;else if(t.length===9)o=t[1],c=t[2],h=t[3],l=t[4],n=t[5],i=t[6],r=t[7],a=t[8];else throw new Error("Invalid number of arguments passed to drawImage: "+arguments.length);const S=this.__closestGroupOrSvg();this.__currentElement;const C="translate("+n+", "+i+")";if(e instanceof Ee){if(f=e.getSvg().cloneNode(!0),f.childNodes&&f.childNodes.length>1){for(g=f.childNodes[0];g.childNodes.length;)b=g.childNodes[0].getAttribute("id"),this.__ids[b]=b,this.__SVGdefs.appendChild(g.childNodes[0]);if(w=f.childNodes[1],w){const M=w.getAttribute("transform");let R;M?R=M+" "+C:R=C,w.setAttribute("transform",R),S.appendChild(w)}}}else(e.nodeName==="CANVAS"||e.nodeName==="IMG")&&(m=this.__createElement("image"),m.setAttribute("width",r),m.setAttribute("height",a),m.setAttribute("preserveAspectRatio","none"),(o||c||h!==e.width||l!==e.height)&&(v=this.__document.createElement("canvas"),v.width=r,v.height=a,v.getContext("2d")?.drawImage(e,o,c,h,l,0,0,r,a),e=v),m.setAttribute("transform",C),m.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",e.nodeName==="CANVAS"?e.toDataURL():e.getAttribute("src")),S.appendChild(m))}createPattern(t,e){const n=this.__document.createElementNS("http://www.w3.org/2000/svg","pattern"),i=rn(this.__ids);let r;return n.setAttribute("id",i),t.nodeName==="CANVAS"||t.nodeName==="IMG"?(r=this.__document.createElementNS("http://www.w3.org/2000/svg","image"),r.setAttribute("width",""+t.width),r.setAttribute("height",""+t.height),r.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",t.nodeName==="CANVAS"?t.toDataURL():t.getAttribute("src")),n.appendChild(r),this.__SVGdefs.appendChild(n)):t instanceof Ee&&(n.setAttribute("width",""+t.width),n.setAttribute("height",""+t.height),n.appendChild(t.__rootSVG.childNodes[1]),this.__SVGdefs.appendChild(n)),new is(n,this)}setLineDash(t){t&&t.length>0?this.lineDash=t.join(","):this.lineDash=null}drawFocusRing(){}createImageData(){}getImageData(){}putImageData(){}globalCompositeOperation(){}setTransform(){}}class on{canvas;context;customContext;currentPath2D=new Path2D;path2Ds=[];currentMatrix=new DOMMatrix;hasSetCustomStrokeStyle=!1;hasSetCustomFillStyle=!1;constructor(t){this.canvas=t,this.context=t.getContext("2d",{willReadFrequently:!0}),this.customContext=new Ee({canvas:this.canvas,width:this.canvas.width,height:this.canvas.height})}set lineWidth(t){this.hasSetCustomStrokeStyle=!0,this.context.lineWidth=t,this.customContext.lineWidth=t}get lineWidth(){return this.context.lineWidth}set lineCap(t){this.hasSetCustomStrokeStyle=!0,this.context.lineCap=t,this.customContext.lineCap=t}get lineCap(){return this.context.lineCap}set lineJoin(t){this.hasSetCustomStrokeStyle=!0,this.context.lineJoin=t,this.customContext.lineCap=t}get lineJoin(){return this.context.lineJoin}set lineDashOffset(t){this.hasSetCustomStrokeStyle=!0,this.context.lineDashOffset=t,this.customContext.lineDashOffset=t}get lineDashOffset(){return this.context.lineDashOffset}set miterLimit(t){this.hasSetCustomStrokeStyle=!0,this.context.miterLimit=t,this.customContext.miterLimit=t}get miterLimit(){return this.context.miterLimit}set globalAlpha(t){this.context.globalAlpha=t,this.customContext.globalAlpha=t}get globalAlpha(){return this.context.globalAlpha}set fillStyle(t){this.hasSetCustomFillStyle=!0,typeof t=="string"||t instanceof CanvasGradient||t instanceof CanvasPattern?(this.context.fillStyle=t,this.customContext.fillStyle=t):(this.context.fillStyle=t.gradient,this.customContext.fillStyle=t.gradientCustom)}get fillStyle(){return this.context.fillStyle}set strokeStyle(t){this.hasSetCustomStrokeStyle=!0,typeof t=="string"||t instanceof CanvasGradient||t instanceof CanvasPattern?(this.context.strokeStyle=t,this.customContext.strokeStyle=t):(this.context.strokeStyle=t.gradient,this.customContext.strokeStyle=t.gradientCustom)}get strokeStyle(){return this.context.strokeStyle}set font(t){this.context.font=t,this.customContext.font=t}get font(){return this.context.font}set textBaseline(t){this.context.textBaseline=t,this.customContext.textBaseline=t}get textBaseline(){return this.context.textBaseline}set textAlign(t){this.context.textAlign=t,this.customContext.textAlign=t}get textAlign(){return this.context.textAlign}fill(t){return t?this.context.fill(t):(this.context.fill(),this.customContext.fill()),this}fillRect(t,e,n,i){return this.context.fillRect(t,e,n,i),this.customContext.fillRect(t,e,n,i),this}fillText(t,e,n,i){return this.context.fillText(t,e,n,i),this.customContext.fillText(t,e,n),this}setLineDash(t){return this.context.setLineDash(t),this.customContext.setLineDash(t),this}stroke(t){return t?this.context.stroke(t):(this.context.stroke(),this.customContext.stroke()),this}strokeText(t,e,n,i){return this.context.strokeText(t,e,n,i),this.customContext.strokeText(t,e,n),this}strokeRect(t,e,n,i){return this.context.strokeRect(t,e,n,i),this.customContext.strokeRect(t,e,n,i),this}measureText(t){return this.context.measureText(t)}clearRect(t=0,e=0,n=this.canvas.width,i=this.canvas.height){return this.context.clearRect(t,e,n,i),this.customContext.clearRect(t,e,n,i),this}save(){return this.context.save(),this.customContext.save(),this.currentMatrix=new DOMMatrix,this.path2Ds.push(this.currentPath2D),this.currentPath2D=new Path2D,this}restore(){return this.context.restore(),this.customContext.restore(),this.hasSetCustomStrokeStyle=!1,this.hasSetCustomFillStyle=!1,this.currentMatrix=new DOMMatrix,this.currentPath2D=this.path2Ds.pop()||new Path2D,this}beginPath(){return this.context.beginPath(),this.customContext.beginPath(),this}closePath(){return this.context.closePath(),this.customContext.closePath(),this.currentPath2D.closePath(),this}changePath2D(t=this.currentPath2D,e=this.currentMatrix){const n=new Path2D;n.addPath(t,e),this.currentPath2D=n}isPointInStroke(...t){return t[0]instanceof Path2D?this.context.isPointInStroke(t[0],t[1],t[2]):this.context.isPointInStroke(t[0],t[1])}isPointInPath(...t){return t[0]instanceof Path2D?this.context.isPointInPath(t[0],t[1],t[2]):this.context.isPointInPath(t[0],t[1])}translate(t,e){return this.context.translate(t,e),this.customContext.translate(t,e),this.currentMatrix.translate(t,e),this.changePath2D(),this}rotate(t){return this.context.rotate(t),this.customContext.rotate(t),this.currentMatrix.rotate(t),this.changePath2D(),this}scale(t,e=t){return this.context.scale(t,e),this.customContext.scale(t,e),this.currentMatrix.scale(t,e),this.changePath2D(),this}moveTo(t,e){return this.context.moveTo(t,e),this.customContext.moveTo(t,e),this.currentPath2D.moveTo(t,e),this}lineTo(t,e){return this.context.lineTo(t,e),this.customContext.lineTo(t,e),this.currentPath2D.lineTo(t,e),this}arc(t,e,n,i,r,a){return this.context.arc(t,e,n,i,r,a),this.customContext.arc(t,e,n,i,r,a?-1:1),this.currentPath2D.arc(t,e,n,i,r,a),this}arcTo(t,e,n,i,r){return this.context.arcTo(t,e,n,i,r),this.customContext.arcTo(t,e,n,i,r),this.currentPath2D.arcTo(t,e,n,i,r),this}ellipse(t,e,n,i,r,a,o,c){return this.context.ellipse(t,e,n,i,r,a,o,c),this.currentPath2D.ellipse(t,e,n,i,r,a,o,c),this}quadraticCurveTo(t,e,n,i){return this.context.quadraticCurveTo(t,e,n,i),this.customContext.quadraticCurveTo(t,e,n,i),this.currentPath2D.quadraticCurveTo(t,e,n,i),this}bezierCurveTo(t,e,n,i,r,a){return this.context.bezierCurveTo(t,e,n,i,r,a),this.customContext.bezierCurveTo(t,e,n,i,r,a),this.currentPath2D.bezierCurveTo(t,e,n,i,r,a),this}rect(t,e,n,i){return this.context.rect(t,e,n,i),this.customContext.rect(t,e,n,i),this.currentPath2D.rect(t,e,n,i),this}createLinearGradient(t,e,n,i,r){const a=this.context.createLinearGradient(t,e,n,i),o=this.customContext.createLinearGradient(t,e,n,i);return r&&Object.keys(r).forEach(c=>{const h=parseFloat(c);a.addColorStop(h,r[h]),o.addColorStop(h,r[h])}),{gradient:a,gradientCustom:o}}createRadialGradient(t,e,n,i,r,a,o){const c=this.context.createRadialGradient(t,e,n,i,r,a),h=this.customContext.createRadialGradient(t,e,n,i,r,a);return o&&Object.keys(o).forEach(l=>{const f=parseFloat(l);c.addColorStop(f,o[f]),h.addColorStop(f,o[f])}),{gradient:c,gradientCustom:h}}drawImage(t,...e){if(e.length===0)this.context.drawImage(t,0,0);else if(e.length===2){const n=e[0],i=e[1];this.context.drawImage(t,n,i)}else if(e.length===4){const n=e[0],i=e[1],r=e[2],a=e[3];this.context.drawImage(t,n,i,r,a)}else if(e.length===8){const n=e[0],i=e[1],r=e[2],a=e[3],o=e[4],c=e[5],h=e[6],l=e[7];this.context.drawImage(t,n,i,r,a,o,c,h,l)}else throw new Error("Invalid number of arguments passed to drawImage: "+e.length);return this.customContext.drawImage(t,...e),this}getImageData(t=0,e=0,n=this.canvas.width,i=this.canvas.height,r){return this.context.getImageData(t,e,n,i,r)}putImageData(t,e=0,n=0){return this.context.putImageData(t,e,n)}toRawSVG(){const t=this.customContext.getSerializedSvg(!0),e=this.customContext.getSvg();return{raw:t,element:e}}}class bt extends K{fromX;fromY;constructor(t){super(t),this.fromX=t?.fromX||0,this.fromY=t?.fromY||0}static fromSVGPathData(t,e){if(t.length<3)throw new Error("Line 参数个数错误");if(t[0].toUpperCase()!=="L")throw new Error("Line command 错误");return new bt({x:t[1],y:t[2],fromX:e?.x,fromY:e?.y})}toSVGPathData(){return["L",this.x,this.y]}toCanvasContext(t){t.beginPath(),t.moveTo(this.fromX,this.fromY),t.lineTo(this.x,this.y)}getBoundingClientRect(){const t=fe(this.fromX,this.fromY,this.x,this.y);if(t===0){const e=Math.min(this.x,this.fromX),n=Math.min(this.y,this.fromY),i=Math.max(this.x,this.fromX),r=Math.max(this.y,this.fromY);return new Et({x:e,y:n,width:i-e,height:r-n})}else{const e=Math.sin(t),n=Math.cos(t),i=n*this.fromX-e*this.fromY,r=n*this.x-e*this.y,a=n*this.fromY+e*this.fromX,o=n*this.y+e*this.x;return new Et({x:Math.min(i,r),y:Math.min(a,o),width:Math.max(i,r)-Math.min(i,r),height:Math.max(a,o)-Math.min(a,o)})}}interpolate(t){return{x:this.fromX+t*(this.x-this.fromX),y:this.fromY+t*(this.y-this.fromY)}}}class Pt extends bt{c1x;c1y;c2x;c2y;constructor(t){super(t),this.c1x=t.c1x,this.c1y=t.c1y,this.c2x=t.c2x,this.c2y=t.c2y}static fromSVGPathData(t,e){if(t.length<7)throw new Error("CubicBezier 参数个数错误");if(t[0].toUpperCase()!=="C")throw new Error("CubicBezier command 错误");return new Pt({c1x:t[1],c1y:t[2],c2x:t[3],c2y:t[4],x:t[5],y:t[6],fromX:e?.x,fromY:e?.y})}toSVGPathData(){return["C",this.c1x,this.c1y,this.c2x,this.c2y,this.x,this.y]}toCanvasContext(t){t.beginPath(),t.moveTo(this.fromX,this.fromY),t.bezierCurveTo(this.c1x,this.c1y,this.c2x,this.c2y,this.x,this.y)}getBoundingClientRect(){const t=H.curveDim(this.fromX,this.fromY,this.c1x,this.c1y,this.c2x,this.c2y,this.x,this.y);return new Et({x:t.min.x,y:t.min.y,width:t.max.x-t.min.x,height:t.max.y-t.min.y})}interpolate(t){return{x:Math.pow(1-t,3)*this.fromX+3*Math.pow(1-t,2)*t*this.c1x+3*Math.pow(1-t,1)*Math.pow(t,2)*this.c2x+Math.pow(t,3)*this.x,y:Math.pow(1-t,3)*this.fromY+3*Math.pow(1-t,2)*t*this.c1y+3*Math.pow(1-t,1)*Math.pow(t,2)*this.c2y+Math.pow(t,3)*this.y}}length(t=1){return H.bezlen(this.fromX,this.fromY,this.c1x,this.c1y,this.c2x,this.c2y,this.x,this.y,t)}getTatLen(t){const e=this.fromX,n=this.fromY,i=this.c1x,r=this.c1y,a=this.c2x,o=this.c2y,c=this.x,h=this.y;if(t<0||H.bezlen(e,n,i,r,a,o,c,h)<t)return 0;let l=1,f=l/2,g=l-f,w,m=.01;for(w=H.bezlen(e,n,i,r,a,o,c,h,g);Math.abs(w-t)>m;)f/=2,g+=(w<t?1:-1)*f,w=H.bezlen(e,n,i,r,a,o,c,h,g);return g}getPointAtSegmentLength(t){const e=this.getTatLen(t),n=this.fromX,i=this.fromY,r=this.c1x,a=this.c1y,o=this.c2x,c=this.c2y,h=this.x,l=this.y;let f=1-e,g=Math.pow(f,3),w=Math.pow(f,2),m=e*e,v=m*e,b=g*n+w*3*e*r+f*3*e*e*o+v*h,S=g*i+w*3*e*a+f*3*e*e*c+v*l,C=n+2*e*(r-n)+m*(o-2*r+n),M=i+2*e*(a-i)+m*(c-2*a+i),R=r+2*e*(o-r)+m*(h-2*o+r),B=a+2*e*(c-a)+m*(l-2*c+a),N=f*n+e*r,W=f*i+e*a,it=f*o+e*h,q=f*c+e*l,tt=90-Math.atan2(C-R,M-B)*180/Math.PI;return{x:b,y:S,m:{x:C,y:M},n:{x:R,y:B},start:{x:N,y:W},end:{x:it,y:q},alpha:tt}}}class cn extends bt{cx;cy;isLineThrough;constructor(t){super(t),this.cx=t.cx,this.cy=t.cy,this.isLineThrough=typeof t.isLineThrough=="boolean"?t.isLineThrough:!0}static fromSVGPathData(t,e){if(t.length<5)throw new Error("QuadraticBezier 参数个数错误");if(t[0].toUpperCase()!=="Q")throw new Error("QuadraticBezier command 错误");return new cn({cx:t[1],cy:t[2],x:t[3],y:t[4],fromX:e?.x,fromY:e?.y})}toSVGPathData(){if(this.isLineThrough){const t=this.cx*2-(this.fromX+this.x)/2,e=this.cy*2-(this.fromY+this.y)/2;return["Q",t,e,this.x,this.y]}else return["Q",this.cx,this.cy,this.x,this.y]}toCanvasContext(t){if(t.beginPath(),t.moveTo(this.fromX,this.fromY),this.isLineThrough){const e=this.cx*2-(this.fromX+this.x)/2,n=this.cy*2-(this.fromY+this.y)/2;t.quadraticCurveTo(e,n,this.x,this.y)}else t.quadraticCurveTo(this.cx,this.cy,this.x,this.y)}interpolate(t){return{x:(1-t)*(1-t)*this.fromX+2*(1-t)*t*this.cx+t*t*this.x,y:(1-t)*(1-t)*this.fromY+2*(1-t)*t*this.cy+t*t*this.y}}}class oe extends bt{rx;ry;xAxisRotate;largeArcFlag;sweepFlag;constructor(t){super(t),this.rx=t.rx,this.ry=t.ry,this.xAxisRotate=t?.xAxisRotate??0,this.largeArcFlag=t?.largeArcFlag??1,this.sweepFlag=t?.sweepFlag??1}static fromSVGPathData(t,e){if(t.length<8)throw new Error("Arc 参数个数错误");if(t[0].toUpperCase()!=="A")throw new Error("Arc command 错误");return new oe({rx:t[1],ry:t[2],xAxisRotate:t[3],largeArcFlag:t[4],sweepFlag:t[5],x:t[6],y:t[7],fromX:e?.x,fromY:e?.y})}toSVGPathData(){return["A",this.rx,this.ry,this.xAxisRotate,this.largeArcFlag,this.sweepFlag,this.x,this.y]}toCanvasContext(t){t.beginPath();const[e,n,i,r,a,o,c]=this.convertSVGToCanvas(this.fromX,this.fromY,this.x,this.y,this.rx,this.ry,this.xAxisRotate,this.largeArcFlag,this.sweepFlag);t.ellipse(e,n,i,r,a,o,c,!this.sweepFlag)}convertSVGToCanvas(t,e,n,i,r,a,o,c,h){const l=o/180*Math.PI,f=(t-n)/2,g=(e-i)/2,w=Math.cos(l)*f+Math.sin(l)*g,m=-Math.sin(l)*f+Math.cos(l)*g,v=w*w/(r*r)+m*m/(a*a);if(v>1){const Y=Math.sqrt(v);throw r=Y*r,a=Y*a,new Error(`Radii are too small to build an arc. Correcting them to ${r}/${a}.`)}const b=Math.sqrt((r*r*a*a-r*r*m*m-a*a*w*w)/(r*r*m*m+a*a*w*w)),S=c!=h?1:-1,C=S*b*r*m/a,M=S*b*-a*w/r,R=(t+n)/2,B=(e+i)/2,N=Math.cos(l)*C-Math.sin(l)*M+R,W=Math.sin(l)*C+Math.cos(l)*M+B,it=(Y,$,ht,rt)=>(Y*rt>=$*ht?1:-1)*Math.acos((Y*ht+$*rt)/(Math.sqrt(Y*Y+$*$)*Math.sqrt(ht*ht+rt*rt))),q=it(1,0,t-N,e-W)-l,tt=it(t-N,e-W,n-N,i-W);return[N,W,r,a,l,q,q+tt]}}class j extends K{startPathX=0;startPathY=0;prevPathX=0;prevPathY=0;normalizedLines=[];constructor(t){super(t),this.prevPathX=this.startPathX=this.x,this.prevPathY=this.startPathY=this.y}appendLine(t){if(t instanceof oe){Rn(this.prevPathX,this.prevPathY,t.rx,t.ry,t.xAxisRotate,t.largeArcFlag,t.sweepFlag,t.x,t.y).forEach(h=>{const[l,f,g,w,m,v]=h;this.normalizedLines.push(new Pt({c1x:l,c1y:f,c2x:g,c2y:w,x:m,y:v,fromX:this.prevPathX,fromY:this.prevPathY})),this.prevPathX=m,this.prevPathY=v});return}let e,n,i,r,a,o;t instanceof Pt?(e=t.c1x,n=t.c1y,i=t.c2x,r=t.c2y,a=t.x,o=t.y):t instanceof cn?[e,n,i,r,a,o]=On(this.prevPathX,this.prevPathY,t.cx,t.cy,t.x,t.y):[e,n,i,r,a,o]=de(this.prevPathX,this.prevPathY,t.x,t.y),this.normalizedLines.push(new Pt({c1x:e,c1y:n,c2x:i,c2y:r,x:a,y:o,fromX:this.prevPathX,fromY:this.prevPathY})),this.prevPathX=a,this.prevPathY=o}static fromShape(t){const e=j.fromSVGPathD(t.toSVGPathD());return Ue(e,t),Vr(e,t),e.prevDegree=0,e.prevScaleOnOrigin=1,e.prevSkewDegreeOnOrigin=0,e.updateTransform(),e}static fromSVGPathD(t,e){const n=new j;return n.updateFromSVGPathD(t,e),n}static fromSVGPathData(t,e){const n=new j;return n.updateFromSVGPathData(t,e),n}updateFromSVGPathD(t,e){if(!H.isSVGPath(t))throw new Error("Not a SVG path!");return this.updateFromSVGPathData(H.parseSVGPath(t),e)}updateFromSVGPathData(t,e){this.normalizedLines=[];const n=H.normalizeSVGPath(H.absolutizeSVGPath(t));for(let r=0,a=n.length;r<a;r++){const o=n[r];if(o[0]=="M"){this.prevPathX=this.startPathX=o[1],this.prevPathY=this.startPathY=o[2];continue}this.appendLine(new Pt({c1x:o[1],c1y:o[2],c2x:o[3],c2y:o[4],x:o[5],y:o[6]}))}const i=Mn(e??"");return this.transform(i)}toSVGPathData(){const t=[];t.push(["M",this.startPathX,this.startPathY]);for(let e=0,n=this.normalizedLines.length;e<n;e++)t.push(this.normalizedLines[e].toSVGPathData());return t}toCanvasContext(t){t.beginPath(),t.moveTo(this.startPathX,this.startPathY),this.normalizedLines.forEach(e=>{const[n,...i]=e.toSVGPathData();t.bezierCurveTo(i[0],i[1],i[2],i[3],i[4],i[5])})}updateTransform(){if((this.x!=this.prevX||this.y!=this.prevY)&&this.translate(this.x-this.prevX,this.y-this.prevY),this.degree!=this.prevDegree){const t=this.getBoundingClientRect();this.rotate(this.degree-this.prevDegree,t.x+t.width/2,t.y+t.height/2)}if(this.scaleOnOrigin!=this.prevScaleOnOrigin){const t=this.getBoundingClientRect(),e=this.scaleOnOrigin/this.prevScaleOnOrigin;this.scale(e,e,t.x+t.width/2,t.y+t.height/2)}}transform(t){return[this.startPathX,this.startPathY]=t.transformPoint(this.startPathX,this.startPathY),[this.prevPathX,this.prevPathY]=t.transformPoint(this.prevPathX,this.prevPathY),this.normalizedLines.forEach(e=>{[e.fromX,e.fromY]=t.transformPoint(e.fromX,e.fromY),[e.c1x,e.c1y]=t.transformPoint(e.c1x,e.c1y),[e.c2x,e.c2y]=t.transformPoint(e.c2x,e.c2y),[e.x,e.y]=t.transformPoint(e.x,e.y)}),this}translate(t,e){const n=new st().translate(t,e);return this.transform(n),this.prevX=this.x,this.prevY=this.y,this}rotate(t,e=0,n=0){const i=new st().rotate(t,e,n);return this.transform(i),this.prevDegree=this.degree,this}scale(t,e=t,n=0,i=0){const r=new st().scale(t,e,n,i);return this.transform(r),this.prevScaleOnOrigin=this.scaleOnOrigin,this}skew(t,e=0){const n=new st().skew(t,e);return this.transform(n),this.prevSkewDegreeOnOrigin=this.skewDegreeOnOrigin,this}trim(){const t=this.getBoundingClientRect();return this.translate(-t.x,-t.y),this}getBoundingClientRect(){let t=0,e=0,n=[],i=[];t=this.startPathX,e=this.startPathY,n.push(t),i.push(e),this.normalizedLines.forEach(h=>{const l=H.curveDim(t,e,h.c1x,h.c1y,h.c2x,h.c2y,h.x,h.y);n=n.concat(l.min.x,l.max.x),i=i.concat(l.min.y,l.max.y),t=h.x,e=h.y});const r=Math.min.apply(0,n),a=Math.min.apply(0,i),o=Math.max.apply(0,n),c=Math.max.apply(0,i);return new Et({x:r,y:a,width:o-r,height:c-a})}getTotalLength(){return this.normalizedLines.reduce((t,e)=>t+=e.length(),0)}interpolate(t){if(this.normalizedLines.length===0)return{x:this.startPathX,y:this.startPathX};if(this.normalizedLines.length===1)return this.normalizedLines[0].interpolate(t);{let e=t*this.normalizedLines.length,n=this.normalizedLines[0];if(e--,e>1)for(let i=1,r=this.normalizedLines.length;i<r&&(n=this.normalizedLines[i],e>1);i++)e-=1;return n.interpolate(e)}}getPointAtLength(t){let e={x:0,y:0,alpha:0},n=0;for(let i=0,r=this.normalizedLines.length;i<r;i++){const a=this.normalizedLines[i],o=a.length();if(n+o>t){e=a.getPointAtSegmentLength(t-n);break}n+=o}return e}getSubpathsAtLength(t,e,n){let i=null,r=0;const a=new j;a.prevPathX=a.startPathX=t.x,a.prevPathY=a.startPathY=t.y;for(let o=0,c=t.normalizedLines.length;o<c;o++){const h=t.normalizedLines[o],l=h.length();if(r+l>e&&!i){const f=h.getPointAtSegmentLength(e-r);if(a.appendLine(new Pt({c1x:f.start.x,c1y:f.start.y,c2x:f.m.x,c2y:f.m.y,x:f.x,y:f.y})),n)return a;i=a,a.prevPathX=f.x,a.prevPathY=f.y,a.appendLine(new Pt({c1x:f.n.x,c1y:f.n.y,c2x:f.end.x,c2y:f.end.y,x:h.x,y:h.y})),r+=l;continue}r+=l,a.appendLine(h)}return a}getSubpath(t,e){if(this.getTotalLength()-e<1e-6)return this.getSubpathsAtLength(this,t);{const n=this.getSubpathsAtLength(this,e,1);return t?this.getSubpathsAtLength(n,t):n}}isPointInPath(t,e,n){if(n instanceof on)return n.isPointInPath(new Path2D(this.toSVGPathD()),t,e);let i;try{i=new SVGPoint(t,e)}catch{i=n.createSVGPoint(),i.x=t,i.y=e}return this.el instanceof SVGGeometryElement?this.el.isPointInFill(i):!1}isPointInStroke(t,e,n){if(n instanceof on)return n.isPointInStroke(new Path2D(this.toSVGPathD()),t,e);let i;try{i=new SVGPoint(t,e)}catch{i=n.createSVGPoint(),i.x=t,i.y=e}return this.el instanceof SVGGeometryElement?this.el.isPointInStroke(i):!1}get polymorphPoints(){return[this.startPathX,this.startPathY].concat(this.normalizedLines.reduce((t,e)=>t.concat([e.c1x,e.c1y,e.c2x,e.c2y,e.x,e.y]),[]))}static fromPolymorphPoints(t){const e=new j({x:t[0],y:t[1]});for(let n=2;n+5<t.length;n+=6)e.appendLine(new Pt({c1x:t[n],c1y:t[n+1],c2x:t[n+2],c2y:t[n+3],x:t[n+4],y:t[n+5]}));return e}perimeterPoints(){const t=this.polymorphPoints,e=t.length;let n=t[e-2],i=t[e-1],r=0;for(let a=0;a<e;a+=6)r+=In(t[a],t[a+1],n,i),n=t[a],i=t[a+1];return Math.floor(r)}fillPathD(t){const e=this.polymorphPoints,n=e.length;let i=t-n;const r=Math.ceil(t/n),a=[];a.push(["M",e[0],e[1]]);let o=2;for(;o+5<=n-1;){const c=e[o++],h=e[o++],l=e[o++],f=e[o++],g=e[o++],w=e[o++];a.push(["C",c,h,l,f,g,w]);let m=0;for(;m<r&&i>0;)a.push(["C",g,w,g,w,g,w]),i-=6,m++}return j.fromSVGPathData(a)}static mixPoints(t,e,n){const i=t.length,r=new Array(i);for(let a=0;a<i;a++)r[a]=Qt(t[a]+(e[a]-t[a])*n,6);return r}static getPathInterpolator(t,e){return n=>Math.abs(n-0)<Number.EPSILON?t.toSVGPathD():Math.abs(n-1)<Number.EPSILON?e.toSVGPathD():j.fromPolymorphPoints(this.mixPoints(t.polymorphPoints,e.polymorphPoints,n)).toSVGPathD()}static polymorph(t){if(!t.length)throw new Error("paths 为空!");const e=t.length-1,n=new Array(e);for(let r=0;r<e;r++){const a=Math.max(t[r].polymorphPoints.length,t[r+1].polymorphPoints.length);n[r]=this.getPathInterpolator(t[r].fillPathD(a),t[r+1].fillPathD(a))}const i=j.fromSVGPathD(n[0](0));return r=>{const a=Qt(e*r,6),o=Math.min(Math.floor(a),e-1),c=Qt(a-o,6);return i.updateFromSVGPathD(n[o](c)),i.attrs=t[o+1].attrs,i}}}class Pe extends ae{svgWidth=0;svgHeight=0;width=0;height=0;shapes=[];constructor(t){if(super(t),!t?.svg)return;const e=new sr(t.svg).parse();for(let n=0,i=e.length;n<i;n++){const r=e[n];if(r.type=="viewbox"&&r.width&&r.height){if(this.svgWidth=parseFloat(r.width),this.svgHeight=parseFloat(r.height),t.width){const l=this.svgWidth/this.svgHeight;this.width=t.width,this.height=this.width/l}else this.width=this.svgWidth,this.height=this.svgHeight;continue}if(r.type!="path"||!ee.isSVGPath(r.path))continue;const a={};for(const l in r)l==="type"||l==="path"||l==="transform"||(a[l]=r[l]);const o=ee.absolutizeSVGPath(ee.parseSVGPath(r.path));let c=[],h=[];for(let l=0,f=o.length;l<f;l++){const g=o[l];h.push(g),g[0].toLowerCase()=="z"&&(c.push(h),h=[])}h.length&&c.push(h),c.forEach(l=>{const f=j.fromSVGPathData(l,r.transform);Ue(f,t),f.attrs={...f.attrs,...a,...t.attrs},this.width&&this.svgWidth&&f.scale(this.width/this.svgWidth),this.shapes.push(f)})}}static fromShape(t){const e=new Pe;return t instanceof K?e.shapes.push(j.fromShape(t)):e.shapes.push(...t.map(n=>j.fromShape(n))),e}sortPathD(){this.shapes=this.shapes.map(t=>({path:t,perimeter:t.perimeterPoints()})).sort((t,e)=>e.perimeter-t.perimeter).map(t=>t.path)}fillPathDGroup(t){const e=t.shapes.length,n=this.shapes.length;if(e<n)return t.fillPathDGroup(this);for(let i=n;i<e;i++){const r=t.shapes[i].polymorphPoints,a=r[0],o=r[1],c=new j({x:a,y:o,attrs:t.shapes[i].attrs});for(let h=2;h+5<r.length;h+=6)c.appendLine(new Pt({c1x:a,c1y:o,c2x:a,c2y:o,x:a,y:o}));this.shapes.push(c)}}static polymorph(t){if(!t.length)throw new Error("groups 为空!");let e=-1,n=0;t.forEach((o,c)=>{o.sortPathD(),n<o.shapes.length&&(n=o.shapes.length,e=c)}),t.forEach(o=>o.fillPathDGroup(t[e]));const i=[];t.forEach((o,c)=>{o.shapes.forEach((h,l)=>{i[l]=i[l]||[],i[l][c]=h})});const r=[];i.forEach(o=>r.push(j.polymorph(o)));const a=new Pe;return r.forEach(o=>{a.shapes.push(o(0))}),o=>(r.forEach(c=>{c(o)}),a)}}class rr extends K{rx;ry;constructor(t){super(t),this.rx=t?.rx||0,this.ry=t?.ry||0}getBoundingClientRect(){return new Et({x:this.x-this.rx,y:this.y-this.ry,width:this.rx*2,height:this.ry*2})}toSVGPathData(){return[["M",this.x,this.y],["m",0,-this.ry],["a",this.rx,this.ry,0,1,1,0,2*this.ry],["a",this.rx,this.ry,0,1,1,0,-2*this.ry],["z"]]}toCanvasContext(t){t.beginPath(),t.ellipse(this.x,this.y,this.rx,this.ry,0,0,2*Math.PI,!0),t.closePath()}}class rs extends K{points;constructor(t=[]){if(!t.length)throw new Error("points can't be null");super(t[0]),this.points=t}toSVGPathData(){const t=this.points.length;if(t<3)throw new Error("points length must >= 3");const e=[];e.push(["M",this.points[0].x,this.points[0].y]);for(let n=0;n<=t-1;n++)e.push(["L",this.points[n].x,this.points[n].y]);return e.push(["L",this.points[0].x,this.points[0].y]),e}toCanvasContext(t){const e=this.points.length;if(e<3)throw new Error("points length must >= 3");t.beginPath(),t.moveTo(0,0);for(let n=0;n<=e-1;n++)t.lineTo(this.points[n].x-this.points[0].x,this.points[n].y-this.points[0].y);t.lineTo(0,0)}get length(){return this.points.length}addPoint(t){this.points.push(t)}getPoint(t){return this.points[t]}isContainPoint(t,e){const n=this.length;let i=!1;const r=2e-10;for(let a=0,o=n-1;a<n;o=a,a++){const c=this.points[a].x,h=this.points[a].y,l=this.points[o].x,f=this.points[o].y;if(c===t&&h===e||l===t&&f===e||e===h&&e===f)return!0;if(e>=h&&e<f||e<h&&e>=f){const g=(l-c)/(f-h),w=c+g*(e-h);if(w===t||Math.abs(w-t)<r)return!0;w>t&&(i=!i)}}return i}[Symbol.iterator](){let t=0;return{next:()=>({value:t>=this.length-1?this.points[++t]:void 0,done:t>=this.length})}}static generatePoints(t,e,n,i){const r=[];for(let a=0;a<i;a++){const o=a/i*2*Math.PI,{x:c,y:h}=Gt(o,n);r.push(new ni({x:t+c,y:e+h}))}return new rs(r)}}class oh extends K{x;y;z;fl;vpX;vpY;cX;cY;cZ;radius;constructor(t){super(t),this.x=t?.x||0,this.y=t?.y||0,this.z=t?.x||0,this.fl=t?.fl||250,this.vpX=t?.vpX||0,this.vpY=t?.vpY||0,this.cX=t?.cX||0,this.cY=t?.cY||0,this.cZ=t?.cZ||0,this.radius=t?.radius||0}getBoundingClientRect(){return null}toSVGPathData(){return this.radius?[["M",this.getScreenX(),this.getScreenY()-this.radius],["a",this.radius,this.radius,0,1,1,0,2*this.radius],["a",this.radius,this.radius,0,1,1,0,-2*this.radius],["z"]]:["M",this.getScreenX(),this.getScreenY()]}toCanvasContext(t){t.beginPath(),t.arc(0,0,this.radius,0,Math.PI*2,!0),t.closePath()}toArray(){return[this.x,this.y,this.z]}setVanishingPoint(t,e){this.vpX=t,this.vpY=e}setCenter(t,e,n){this.cX=t,this.cY=e,this.cZ=n}rotateX(t){const e=Math.cos(t),n=Math.sin(t),i=this.y*e-this.z*n,r=this.z*e+this.y*n;this.y=i,this.z=r}rotateY(t){const e=Math.cos(t),n=Math.sin(t),i=this.x*e-this.z*n,r=this.z*e+this.x*n;this.x=i,this.z=r}rotateZ(t){const e=Math.cos(t),n=Math.sin(t),i=this.x*e-this.y*n,r=this.y*e+this.x*n;this.x=i,this.y=r}getScreenX(){const t=this.fl/(this.fl+this.z+this.cZ);return this.vpX+(this.cX+this.x)*t}getScreenY(){const t=this.fl/(this.fl+this.z+this.cZ);return this.vpY+(this.cY+this.y)*t}}class ch extends K{points;constructor(t=[]){if(!t.length)throw new Error("points can't be null");super(t[0]),this.points=t}toSVGPathData(){const t=this.points.length;if(t<3)throw new Error("points length must >= 3");const e=[];e.push(["M",this.points[0].getScreenX(),this.points[0].getScreenY()]);for(let n=0;n<=t-1;n++)e.push(["L",this.points[n].getScreenX(),this.points[n].getScreenY()]);return e.push(["L",this.points[0].getScreenX(),this.points[0].getScreenY()]),e}toCanvasContext(t){const e=this.points.length;if(e<3)throw new Error("points length must >= 3");t.beginPath(),t.moveTo(0,0);for(let n=0;n<=e-1;n++)t.lineTo(this.points[n].getScreenX()-this.points[0].getScreenX(),this.points[n].getScreenY()-this.points[0].getScreenY());t.lineTo(0,0)}get length(){return this.points.length}addPoint(t){this.points.push(t)}getPoint(t){return this.points[t]}}class as extends K{text;constructor(t){super(t),this.text=t.text,this.attrs={fontSize:"10px",fontFamily:'system-ui, Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", Roboto, Oxygen, Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif',fill:"#666666","alignment-baseline":"middle",...this.attrs}}getBoundingClientRect(){return null}toSVGPathData(){return[]}toCanvasContext(t){t.fillText(this.text,0,0)}}class hh extends ae{radius;startDegree;endDegree;text="";defaultShowText;p1=new mt;p1Offset=10;p2=new mt;p2Offset=40;p3=new mt;p3Offset=10;p4=new mt;p4Offset=10;direction=1;constructor(t){super(t),this.radius=t.radius,this.startDegree=t.startDegree,this.endDegree=t.endDegree,this.text=t.text||"",this.defaultShowText=typeof t?.defaultShowText=="boolean"?t.defaultShowText:!1;const e=this.startDegree+(this.endDegree-this.startDegree)/2,{x:n,y:i}=Gt(ot(e),this.radius+this.p1Offset);this.p1.x=this.x+n,this.p1.y=this.y+i;const{x:r,y:a}=Gt(ot(e),this.radius+this.p1Offset+this.p2Offset);this.p2.x=this.x+r,this.p2.y=this.y+a,this.direction=this.p1.x>this.x?1:-1,this.p3.x=this.p2.x+this.direction*this.p3Offset,this.p3.y=this.p2.y,this.p4.x=this.p3.x+this.direction*this.p4Offset,this.p4.y=this.p3.y;const o=Object.assign({...this.attrs},{fill:"none"}),c=new bt({fromX:this.p1.x,fromY:this.p1.y,x:this.p2.x,y:this.p2.y,attrs:o,isShow:this.defaultShowText}),h=new bt({fromX:this.p2.x,fromY:this.p2.y,x:this.p3.x,y:this.p3.y,attrs:o,isShow:this.defaultShowText}),l=new as({x:this.p4.x,y:this.p4.y,text:this.text,attrs:{...o,textAnchor:this.direction==1?"start":"end"},isShow:this.defaultShowText});this.shapes.push(new ar({x:this.x,y:this.y,radius:this.radius,startDegree:this.startDegree,endDegree:this.endDegree,attrs:Object.assign({...this.attrs},{strokeWidth:"0"}),mouseMove:f=>{this.text&&!this.defaultShowText&&(c.isShow=f,h.isShow=f,l.isShow=f)}})),this.text&&(this.shapes.push(c),this.shapes.push(h),this.shapes.push(l))}}class ar extends K{radius;startDegree;endDegree;constructor(t){super(t),this.radius=t.radius,this.startDegree=t.startDegree,this.endDegree=t.endDegree}toSVGPathData(){const{x:t,y:e}=Gt(ot(this.startDegree),this.radius),{x:n,y:i}=Gt(ot(this.endDegree),this.radius);return[["M",this.x,this.y],["l",t,e],["A",this.radius,this.radius,0,Math.abs(this.endDegree-this.startDegree)>=180?1:0,1,this.x+n,this.y+i],["z"]]}toCanvasContext(t){t.beginPath(),t.moveTo(0,0),t.arc(0,0,this.radius,ot(this.startDegree),ot(this.endDegree),!1),t.closePath()}containPoint(t,e){const[n,i]=[t-this.x,e-this.y],r=Math.sqrt(n*n+i*i);let a=fe(this.x,this.y,t,e);a<0&&(a+=Math.PI*2);const o=nt(a);return r<this.radius&&o>this.startDegree&&o<this.endDegree}}class lh extends K{constructor(t){super(t)}toSVGPathData(){return[["M",this.x,this.y],["m",-50,-25],["l",50,0],["l",0,-25],["l",50,50],["l",-50,50],["l",0,-25],["l",-50,0],["l",0,-50],["z"]]}toCanvasContext(t){t.beginPath(),t.moveTo(-50,-25),t.lineTo(0,-25),t.lineTo(0,-50),t.lineTo(50,0),t.lineTo(0,50),t.lineTo(0,25),t.lineTo(-50,25),t.lineTo(-50,-25),t.closePath()}}class uh extends K{constructor(t){super(t)}toSVGPathData(){return[["M",this.x,this.y],["m",4,24],["l",4,-8],["l",6,-6],["l",1,-10],["l",-6,-10],["l",-7,10],["l",-4,0],["l",-7,-10],["l",-6,10],["l",1,10],["l",6,6],["l",4,8],["z"]]}toCanvasContext(t){t.beginPath(),t.moveTo(4,24),t.lineTo(8,16),t.lineTo(14,10),t.lineTo(15,0),t.lineTo(9,-10),t.lineTo(2,0),t.lineTo(-2,0),t.lineTo(-9,-10),t.lineTo(-15,0),t.lineTo(-14,10),t.lineTo(-8,16),t.lineTo(-4,24),t.closePath()}}(function(){let s=0;window.requestAnimationFrame||(window.requestAnimationFrame=function(t){const e=new Date().getTime(),n=Math.max(0,16-(e-s)),i=window.setTimeout(function(){t(e+n)},n);return s=e+n,i}),window.cancelAnimationFrame||(window.cancelAnimationFrame=function(t){clearTimeout(t)})})();const or=s=>{let t=window.requestAnimationFrame(function e(n){s(n),t=window.requestAnimationFrame(e)});return()=>window.cancelAnimationFrame(t)};class fh{id=0;renders={};cancelAnimateInWeb;constructor(){}get length(){let t=0;for(let e in this.renders)t++;return t}run(t){const e=this.id++;this.renders[e]=t,!this.cancelAnimateInWeb&&(this.cancelAnimateInWeb=or(n=>{const i=[];for(let r in this.renders)this.renders[r](n)===!1&&i.push(parseInt(r));for(let r of i)delete this.renders[r];!this.length&&this.cancelAnimateInWeb&&(this.cancelAnimateInWeb(),this.cancelAnimateInWeb=void 0)}))}runAccurateSetTimeout(t,e=0){let n=!1,i;return this.run(r=>n?!1:(i||(i=r),r-i>=e?(t(),!1):!0)),()=>{n=!0}}}const _e=new fh;let De;typeof self>"u"&&typeof process<"u"&&process.hrtime?De=function(){const s=process.hrtime();return s[0]*1e3+s[1]/1e6}:typeof self<"u"&&self.performance!==void 0&&self.performance.now!==void 0?De=self.performance.now.bind(self.performance):Date.now!==void 0?De=Date.now:De=function(){return new Date().getTime()};const ce=De;class Ae{static _nextId=0;static nextId(){return Ae._nextId++}}const hn={Linear:{None:function(s){return s}},Ease:{In:function(s){return Math.pow(s,1.7)}},Quadratic:{In:function(s){return s*s},Out:function(s){return s*(2-s)},InOut:function(s){return(s*=2)<1?.5*s*s:-.5*(--s*(s-2)-1)}},Cubic:{In:function(s){return s*s*s},Out:function(s){return--s*s*s+1},InOut:function(s){return(s*=2)<1?.5*s*s*s:.5*((s-=2)*s*s+2)}},Quartic:{In:function(s){return s*s*s*s},Out:function(s){return 1- --s*s*s*s},InOut:function(s){return(s*=2)<1?.5*s*s*s*s:-.5*((s-=2)*s*s*s-2)}},Quintic:{In:function(s){return s*s*s*s*s},Out:function(s){return--s*s*s*s*s+1},InOut:function(s){return(s*=2)<1?.5*s*s*s*s*s:.5*((s-=2)*s*s*s*s+2)}},Sinusoidal:{In:function(s){return 1-Math.sin((1-s)*Math.PI/2)},Out:function(s){return Math.sin(s*Math.PI/2)},InOut:function(s){return .5*(1-Math.sin(Math.PI*(.5-s)))}},Exponential:{In:function(s){return s===0?0:Math.pow(1024,s-1)},Out:function(s){return s===1?1:1-Math.pow(2,-10*s)},InOut:function(s){return s===0?0:s===1?1:(s*=2)<1?.5*Math.pow(1024,s-1):.5*(-Math.pow(2,-10*(s-1))+2)}},Circular:{In:function(s){return 1-Math.sqrt(1-s*s)},Out:function(s){return Math.sqrt(1- --s*s)},InOut:function(s){return(s*=2)<1?-.5*(Math.sqrt(1-s*s)-1):.5*(Math.sqrt(1-(s-=2)*s)+1)}},Elastic:{In:function(s){return s===0?0:s===1?1:-Math.pow(2,10*(s-1))*Math.sin((s-1.1)*5*Math.PI)},Out:function(s){return s===0?0:s===1?1:Math.pow(2,-10*s)*Math.sin((s-.1)*5*Math.PI)+1},InOut:function(s){return s===0?0:s===1?1:(s*=2,s<1?-.5*Math.pow(2,10*(s-1))*Math.sin((s-1.1)*5*Math.PI):.5*Math.pow(2,-10*(s-1))*Math.sin((s-1.1)*5*Math.PI)+1)}},Back:{In:function(s){return s===1?1:s*s*((1.70158+1)*s-1.70158)},Out:function(s){return s===0?0:--s*s*((1.70158+1)*s+1.70158)+1},InOut:function(s){const t=2.5949095;return(s*=2)<1?.5*(s*s*((t+1)*s-t)):.5*((s-=2)*s*((t+1)*s+t)+2)}},Bounce:{In:function(s){return 1-hn.Bounce.Out(1-s)},Out:function(s){return s<1/2.75?7.5625*s*s:s<2/2.75?7.5625*(s-=1.5/2.75)*s+.75:s<2.5/2.75?7.5625*(s-=2.25/2.75)*s+.9375:7.5625*(s-=2.625/2.75)*s+.984375},InOut:function(s){return s<.5?hn.Bounce.In(s*2)*.5:hn.Bounce.Out(s*2-1)*.5+.5}},generatePow:function(s=4){return s=s<Number.EPSILON?Number.EPSILON:s,s=s>1e4?1e4:s,{In:function(t){return t**s},Out:function(t){return 1-(1-t)**s},InOut:function(t){return t<.5?(t*2)**s/2:(1-(2-t*2)**s)/2+.5}}},random:function(s){return Math.random()},createStep:function(s){return function(t){return Math.floor(t*s)/s}},createNoisyEasing:function(s,t=.1){const e=1-t;return function(n){return t*Math.random()+e*s(n)}},swing:function(s){return s+Math.sin(s*Math.PI*2)/2},causeSeizures:function(s){return s+.2*Math.random()-.1}},os=hn,ke={Utils:{Linear:function(s,t,e){return(t-s)*e+s},Factorial:function(){const s=[1];return function(t){let e=1;if(s[t])return s[t];for(let n=t;n>1;n--)e*=n;return s[t]=e,e}}(),Bernstein:function(s,t){const e=ke.Utils.Factorial;return e(s)/e(t)/e(s-t)},CatmullRom:function(s,t,e,n,i){const r=(e-s)*.5,a=(n-t)*.5,o=i*i,c=i*o;return(2*t-2*e+r+a)*c+(-3*t+3*e-2*r-a)*o+r*i+t}},Linear:function(s,t){const e=s.length-1,n=e*t,i=Math.floor(n),r=ke.Utils.Linear;return t<0?r(s[0],s[1],n):t>1?r(s[e],s[e-1],e-n):r(s[i],s[i+1>e?e:i+1],n-i)},Bezier:function(s,t){let e=0;const n=s.length-1,i=Math.pow,r=ke.Utils.Bernstein;for(let a=0;a<=n;a++)e+=i(1-t,n-a)*i(t,a)*s[a]*r(n,a);return e},CatmullRom:function(s,t){const e=s.length-1;let n=e*t,i=Math.floor(n);const r=ke.Utils.CatmullRom;return s[0]===s[e]?(t<0&&(i=Math.floor(n=e*(1+t))),r(s[(i-1+e)%e],s[i],s[(i+1)%e],s[(i+2)%e],n-i)):t<0?s[0]-(r(s[0],s[0],s[1],s[1],-n)-s[0]):t>1?s[e]-(r(s[e],s[e],s[e-1],s[e-1],n-e)-s[e]):r(s[i?i-1:0],s[i],s[e<i+1?e:i+1],s[e<i+2?e:i+2],n-i)}},cs=ke;class cr{_tweens={};_tweensAddedDuringUpdate={};getAll(){return Object.keys(this._tweens).map(t=>this._tweens[t])}removeAll(){this._tweens={}}add(t){this._tweens[t.getId()]=t,this._tweensAddedDuringUpdate[t.getId()]=t}remove(t){delete this._tweens[t.getId()],delete this._tweensAddedDuringUpdate[t.getId()]}update(t=ce(),e=!1){let n=Object.keys(this._tweens);if(n.length===0)return!1;for(;n.length>0;){this._tweensAddedDuringUpdate={};for(let i=0;i<n.length;i++){const r=this._tweens[n[i]],a=!e;r&&r.update(t,a)===!1&&!e&&delete this._tweens[n[i]]}n=Object.keys(this._tweensAddedDuringUpdate)}return!0}}const xt=new cr;class hr{constructor(t,e=xt){this._object=t,this._group=e}_id=Ae.nextId();_isPlaying=!1;_startTime=0;_delayTime=0;_durationTime=1e3;_isPaused=!1;_pauseStartTime=0;_initialRepeat=0;_repeat=0;_repeatDelayTime;_yoyo=!1;_reversed=!1;_valuesStart={};_valuesEnd={};_valuesStartRepeat={};_easingFunction=os.Linear.None;_interpolationFunction=cs.Linear;_chainedTweens=[];_isChainStopped=!1;_onStartCallback;_onStartCallbackFired=!1;_onEveryStartCallback;_onEveryStartCallbackFired=!1;_onUpdateCallback;_onRepeatCallback;_onCompleteCallback;_onStopCallback;_goToEnd=!1;getId(){return this._id}isPlaying(){return this._isPlaying}isPaused(){return this._isPaused}to(t,e){return this._valuesEnd=Object.create(t),e!==void 0&&(this._durationTime=e),this}duration(t=1e3){return this._durationTime=t,this}start(t=ce()){if(this._isPlaying)return this;if(this._group&&this._group.add(this),this._repeat=this._initialRepeat,this._reversed){this._reversed=!1;for(const e in this._valuesStartRepeat)this._swapEndStartRepeatValues(e),this._valuesStart[e]=this._valuesStartRepeat[e]}return this._isPlaying=!0,this._isPaused=!1,this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._isChainStopped=!1,this._startTime=t,this._startTime+=this._delayTime,this._setupProperties(this._object,this._valuesStart,this._valuesEnd,this._valuesStartRepeat),this}_setupProperties(t,e,n,i){for(const r in n){const a=t[r],o=Array.isArray(a),c=o?"array":typeof a,h=!o&&Array.isArray(n[r]);if(!(c==="undefined"||c==="function")){if(h){let l=n[r];if(l.length===0)continue;l=l.map(this._handleRelativeValue.bind(this,a)),n[r]=[a].concat(l)}if((c==="object"||o)&&a&&!h){e[r]=o?[]:{};for(const l in a)e[r][l]=a[l];i[r]=o?[]:{},this._setupProperties(a,e[r],n[r],i[r])}else typeof e[r]>"u"&&(e[r]=a),o||(e[r]*=1),h?i[r]=n[r].slice().reverse():i[r]=e[r]||0}}}stop(){return this._isChainStopped||(this._isChainStopped=!0,this.stopChainedTweens()),this._isPlaying?(this._group&&this._group.remove(this),this._isPlaying=!1,this._isPaused=!1,this._onStopCallback&&this._onStopCallback(this._object),this):this}end(){return this._goToEnd=!0,this.update(1/0),this}pause(t=ce()){return this._isPaused||!this._isPlaying?this:(this._isPaused=!0,this._pauseStartTime=t,this._group&&this._group.remove(this),this)}resume(t=ce()){return!this._isPaused||!this._isPlaying?this:(this._isPaused=!1,this._startTime+=t-this._pauseStartTime,this._pauseStartTime=0,this._group&&this._group.add(this),this)}stopChainedTweens(){for(let t=0,e=this._chainedTweens.length;t<e;t++)this._chainedTweens[t].stop();return this}group(t=xt){return this._group=t,this}delay(t=0){return this._delayTime=t,this}repeat(t=0){return this._initialRepeat=t,this._repeat=t,this}repeatDelay(t){return this._repeatDelayTime=t,this}yoyo(t=!1){return this._yoyo=t,this}easing(t=os.Linear.None){return this._easingFunction=t,this}interpolation(t=cs.Linear){return this._interpolationFunction=t,this}chain(...t){return this._chainedTweens=t,this}onStart(t){return this._onStartCallback=t,this}onEveryStart(t){return this._onEveryStartCallback=t,this}onUpdate(t){return this._onUpdateCallback=t,this}onRepeat(t){return this._onRepeatCallback=t,this}onComplete(t){return this._onCompleteCallback=t,this}onStop(t){return this._onStopCallback=t,this}update(t=ce(),e=!0){if(this._isPaused)return!0;let n,i;const r=this._startTime+this._durationTime;if(!this._goToEnd&&!this._isPlaying){if(t>r)return!1;e&&this.start(t)}if(this._goToEnd=!1,t<this._startTime)return!0;this._onStartCallbackFired===!1&&(this._onStartCallback&&this._onStartCallback(this._object),this._onStartCallbackFired=!0),this._onEveryStartCallbackFired===!1&&(this._onEveryStartCallback&&this._onEveryStartCallback(this._object),this._onEveryStartCallbackFired=!0),i=(t-this._startTime)/this._durationTime,i=this._durationTime===0||i>1?1:i;const a=this._easingFunction(i);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,a),this._onUpdateCallback&&this._onUpdateCallback(this._object,i),i===1)if(this._repeat>0){isFinite(this._repeat)&&this._repeat--;for(n in this._valuesStartRepeat)!this._yoyo&&typeof this._valuesEnd[n]=="string"&&(this._valuesStartRepeat[n]=this._valuesStartRepeat[n]+parseFloat(this._valuesEnd[n])),this._yoyo&&this._swapEndStartRepeatValues(n),this._valuesStart[n]=this._valuesStartRepeat[n];return this._yoyo&&(this._reversed=!this._reversed),this._repeatDelayTime!==void 0?this._startTime=t+this._repeatDelayTime:this._startTime=t+this._delayTime,this._onRepeatCallback&&this._onRepeatCallback(this._object),this._onEveryStartCallbackFired=!1,!0}else{this._onCompleteCallback&&this._onCompleteCallback(this._object);for(let o=0,c=this._chainedTweens.length;o<c;o++)this._chainedTweens[o].start(this._startTime+this._durationTime);return this._isPlaying=!1,!1}return!0}_updateProperties(t,e,n,i){for(const r in n){if(e[r]===void 0)continue;const a=e[r]||0;let o=n[r];const c=Array.isArray(t[r]),h=Array.isArray(o);!c&&h?t[r]=this._interpolationFunction(o,i):typeof o=="object"&&o?this._updateProperties(t[r],a,o,i):(o=this._handleRelativeValue(a,o),typeof o=="number"&&(t[r]=a+(o-a)*i))}}_handleRelativeValue(t,e){return typeof e!="string"?e:e.charAt(0)==="+"||e.charAt(0)==="-"?t+parseFloat(e):parseFloat(e)}_swapEndStartRepeatValues(t){const e=this._valuesStartRepeat[t],n=this._valuesEnd[t];typeof n=="string"?this._valuesStartRepeat[t]=this._valuesStartRepeat[t]+parseFloat(n):this._valuesStartRepeat[t]=n,this._valuesEnd[t]=e}}const dh=Ae.nextId,mh=xt.getAll.bind(xt),ph=xt.removeAll.bind(xt),gh=xt.add.bind(xt),yh=xt.remove.bind(xt),wh=xt.update.bind(xt),ln={now:ce,Sequence:Ae,Easing:os,Interpolation:cs,Group:cr,Tween:hr,nextId:dh,getAll:mh,removeAll:ph,add:gh,remove:yh,update:wh};function vh(s){switch(s){case"linear":return[0,0,1,1];case"ease":return[.25,.1,.25,1];case"ease-in":return[.42,0,1,1];case"ease-in-out":return[.42,0,.58,1];case"ease-out":return[0,0,.58,1]}}const bh={attributeName:["display"],values:[["block","block"]],immediate:!1},gt={easeName:"linear",begin:0,dur:300,repeatCount:1,direction:"normal",fill:"freeze",keyTimes:[0,1]};class hs{objects=[];animateObjects=[];currentAnimateName;constructor(){}hasObjects(){return this.objects.length>0}fromDOM(t){return Array.isArray(t)||(t=[t]),this.objects.forEach(e=>{e.app.destroy()}),this.objects=[],t.forEach(e=>{this.objects.push({el:e,app:new pe(e),originAttrs:{}})}),this}static isRunningGlobalTween=!1;static runGlobalTween(t){this.isRunningGlobalTween||_e.run(()=>(this.isRunningGlobalTween=ln.update(t?.()),this.isRunningGlobalTween))}static toTween(t,e,n){const i=n?.onStart||(()=>{}),r=n?.onUpdate||(()=>{}),a=n?.onComplete||(()=>{}),o=n?.duration||1e3,c=n?.delay||0,h=n?.easeFunction||ln.Easing.Linear.None,l=n?.repeat||0,f=n?.yoyo||!1,g=new ln.Tween(t).to(e,o).delay(c).easing(h).repeat(l).yoyo(f).onStart(i).onUpdate((w,m)=>{r(w,m)}).onComplete(a);return n?.interpolationFunction&&g.interpolation(n.interpolationFunction),{tween:g,startAuto:w=>{g.start(w?.()),_e.run(()=>{const m=g.update(w?.());if(n?.precision){let v=!0;for(let b in t)le(t[b],e[b],n.precision)||(v=!1);return v?!1:m}return m})}}}static toTweenCSS(t,e,n,i){D.add3DSupport(t);const r=i?.onUpdate||(()=>{});return hs.toTween(e,n,Object.assign(i||{},{onUpdate:(a,o)=>{const c=D.convertAttrs(t,a);D.setStyle(t,c),r(a,o)}}))}addAnimateObject(t=bh,e=gt,n=0,i=!1){const r=e.easeName||"linear",a=e.dur||300,o=e.keyTimes||[0,1],c=[];o.forEach((l,f)=>{f>0&&c.push(vh(r))});const h=this.objects[n];return this.animateObjects=i?[]:this.animateObjects,this.animateObjects.push({el:h.el,app:h.app,originAttrs:h.originAttrs,attributeName:t.attributeName,values:t.values,immediate:t.immediate||!1,easeName:r,begin:e.begin||0,dur:a,repeatCount:e.repeatCount||1,direction:e.direction||"normal",fill:e.fill||"freeze",keyTimes:o,realKeyTimes:o.map(l=>a*l),keySplines:c,calcMode:e.calcMode||"linear",onComplete:e.onComplete||(()=>{})}),this}resetAnimateObjects(t,e,n,i,r=gt,a=this.objects.length-1){let o=!0,c=!1,h=!1,l=!1;const f=this.objects.length-1;a=yt(a,0,f);let g=a-1;g=yt(g,0,f);let w=a+1;w=yt(w,0,f);const m=this.objects[a],v=this.objects[g],b=this.objects[w];if(v&&g!==a){const S=t(v);S&&(this.addAnimateObject(S,r,g,o),o=!1,c=!0)}if(m){const S=e(m);S&&(this.addAnimateObject(S,r,a,o),o=!1,h=!0)}if(b&&w!==a){const S=n(b);S&&(this.addAnimateObject(S,r,w,o),o=!1,l=!0)}this.objects.forEach((S,C)=>{if(!(C==g&&c||C==a&&h||C==w&&l)){const M=i(S);M&&(this.addAnimateObject(M,r,C,o),o=!1)}})}toCSS(t,...e){if(!this.hasObjects())return;this.currentAnimateName=t,this[t](...e),D.add3DSupport(this.objects[0].el),this.objects.forEach((r,a)=>{D.setStyle(r.el,{position:"absolute","z-index":String(2e3+a),"transform-style":"preserve-3d","backface-visibility":"hidden"})});let n=0;const i=()=>{this.animateObjects.forEach((r,a)=>{let o=[],c=[];Array.isArray(r.attributeName)?(o=r.attributeName,c=r.values):r.attributeName&&(o=[r.attributeName],c=[r.values]);const h=r.keyTimes.length;let l=r.begin;r.keyTimes.forEach((f,g)=>{if(g==0||r.immediate){const w={};o.forEach((v,b)=>{const S=c[b][r.direction=="reverse"?h-1-g:g];w[v]=S});const m=D.convertAttrs(r.el,w,r.originAttrs);D.setStyle(r.el,Object.assign(m,{transition:"none"}))}else _e.runAccurateSetTimeout(()=>{const w={};o.forEach((v,b)=>{const S=c[b][r.direction=="reverse"?h-1-g:g];w[v]=S});const m=D.convertAttrs(r.el,w,r.originAttrs);D.setStyle(r.el,Object.assign(m,{transition:`all ${r.realKeyTimes[g]}ms cubic-bezier(${r.keySplines[g-1].join(",")})`}))},l),l+=r.realKeyTimes[g]}),_e.runAccurateSetTimeout(()=>{r.fill==="remove"&&D.setStyle(r.el,r.originAttrs||{}),a==this.animateObjects.length-1&&(r.onComplete?.(),this.currentAnimateName==t&&(r.repeatCount=="infinite"||typeof r.repeatCount=="number"&&++n<r.repeatCount)&&i())},r.begin+r.dur)})};i()}slideLeft(t=gt,e=this.objects.length-1){this.resetAnimateObjects(n=>({attributeName:["opacity","translateTo"],values:[[1,1],[[0,0],[-n.app.width,0]]]}),n=>({attributeName:["opacity","translateTo"],values:[[1,1],[[n.app.width,0],[0,0]]]}),n=>{},n=>({attributeName:["opacity","translateTo"],values:[[0,0],[[n.app.width,0],[n.app.width,0]]],immediate:!0}),t,e)}slideRight(t=gt,e=this.objects.length-1){this.resetAnimateObjects(n=>{},n=>({attributeName:["opacity","translateTo"],values:[[1,1],[[-n.app.width,0],[0,0]]]}),n=>({attributeName:["opacity","translateTo"],values:[[1,1],[[0,0],[n.app.width,0]]]}),n=>({attributeName:["opacity","translateTo"],values:[[0,0],[[-n.app.width,0],[-n.app.width,0]]],immediate:!0}),t,e)}slideDown(t=gt,e=this.objects.length-1){this.resetAnimateObjects(n=>({attributeName:["opacity","translateTo"],values:[[1,1],[[0,0],[0,n.app.height]]]}),n=>({attributeName:["opacity","translateTo"],values:[[1,1],[[0,-n.app.height],[0,0]]]}),n=>{},n=>({attributeName:["opacity","translateTo"],values:[[0,0],[[0,-n.app.height],[0,-n.app.height]]],immediate:!0}),t,e)}slideUp(t=gt,e=this.objects.length-1){this.resetAnimateObjects(n=>({attributeName:["opacity","translateTo"],values:[[1,1],[[0,0],[0,-n.app.height]]]}),n=>({attributeName:["opacity","translateTo"],values:[[1,1],[[0,n.app.height],[0,0]]]}),n=>{},n=>({attributeName:["opacity","translateTo"],values:[[0,0],[[0,n.app.height],[0,n.app.height]]],immediate:!0}),t,e)}flipLeft(t=gt,e=this.objects.length-1){this.resetAnimateObjects(n=>({attributeName:["opacity","rotateYTo"],values:[[1,1],[0,180]]}),n=>({attributeName:["opacity","rotateYTo"],values:[[1,1],[-180,0]]}),n=>{},n=>({attributeName:["opacity"],values:[[0,0]],immediate:!0}),t,e)}flipRight(t=gt,e=this.objects.length-1){this.resetAnimateObjects(n=>({attributeName:["opacity","rotateYTo"],values:[[1,1],[0,-180]]}),n=>({attributeName:["opacity","rotateYTo"],values:[[1,1],[180,0]]}),n=>{},n=>({attributeName:["opacity"],values:[[0,0]],immediate:!0}),t,e)}flipDown(t=gt,e=this.objects.length-1){this.resetAnimateObjects(n=>({attributeName:["opacity","rotateXTo"],values:[[1,1],[0,-180]]}),n=>({attributeName:["opacity","rotateXTo"],values:[[1,1],[180,0]]}),n=>{},n=>({attributeName:["opacity"],values:[[0,0]],immediate:!0}),t,e)}flipUp(t=gt,e=this.objects.length-1){this.resetAnimateObjects(n=>({attributeName:["opacity","rotateXTo"],values:[[1,1],[0,180]]}),n=>({attributeName:["opacity","rotateXTo"],values:[[1,1],[-180,0]]}),n=>{},n=>({attributeName:["opacity"],values:[[0,0]],immediate:!0}),t,e)}popIn(t=gt,e=this.objects.length-1){this.resetAnimateObjects(n=>{},n=>({attributeName:["translateTo","scaleTo","opacity"],values:[[[0,0],[0,0]],[.8,1],[0,1]]}),n=>{},n=>({attributeName:["opacity"],values:[[0,0]],immediate:!0}),t,e)}popOut(t=gt,e=this.objects.length-1){this.resetAnimateObjects(n=>{},n=>({attributeName:["translateTo","scaleTo","opacity"],values:[[[0,0],[0,0]],[1,1.2],[1,0]]}),n=>{},n=>({attributeName:["opacity"],values:[[0,0]],immediate:!0}),t,e)}rotate(t=gt,e=this.objects.length-1){Object.assign(t,{keyTimes:[0,1]});const n=t.degree||360;this.resetAnimateObjects(i=>{},i=>({attributeName:["opacity","rotate"],values:[[1,1],[0,n]]}),i=>{},i=>({attributeName:["opacity"],values:[[0,0]],immediate:!0}),t,e)}}class xh{app;ctx;shapes=[];isMouseDown=!1;currentMouseInShapeID="";currentEnableDragMouseInShapeID="";constructor(t){this.app=t,this.ctx=new on(this.app.container),this.app.captureMove({start:()=>{this.isMouseDown=!0,this.setCursor()},end:()=>{this.isMouseDown=!1,this.setCursor()},move:()=>{if(this.currentMouseInShapeID="",this.isMouseDown&&this.currentEnableDragMouseInShapeID){this.setCursor();return}let e=0,n=this.shapes.length;for(;e<n;e++){const i=this.shapes[e];this.ctx.save(),this.transformCtxBaseOnShape(i);const r=this.ctx.isPointInPath(i.path2d,this.app.mousePoint.x,this.app.mousePoint.y)||!1;if(this.ctx.restore(),r&&(this.currentMouseInShapeID=i.id),i.mouseMove&&i.mouseMove(r),r&&i.enableDrag){this.currentEnableDragMouseInShapeID=i.id;break}}e>=n&&(this.currentEnableDragMouseInShapeID=""),this.setCursor()}})}setCursor(){this.currentEnableDragMouseInShapeID?(this.app.container.style.cursor="grab",this.isMouseDown&&(this.app.container.style.cursor="grabbing")):this.currentMouseInShapeID?this.app.container.style.cursor="pointer":this.app.container.style.cursor="default"}transformCtxBaseOnShape(t){!(t instanceof bt)&&!(t instanceof j)&&this.ctx.translate(t.x,t.y),this.ctx.rotate(ot(t.degree)),this.ctx.scale(t.scaleOnOrigin,t.scaleOnOrigin)}draw(t=[]){const e=[];Ur(t)?e.push(...t):e.push(t),this.shapes=[],e.forEach(n=>{n instanceof ae?this.shapes.push(...n.shapes):this.shapes.push(n)});for(let n of this.shapes)if(n.isShow){if(this.ctx.save(),D.attrsToCanvas(this.ctx,n.attrs),n.followMouse&&(!le(n.x,this.app.mousePoint.x,5)||!le(n.y,this.app.mousePoint.y,5))&&(n.angleTo(this.app.mousePoint),n.followTo(this.app.mousePoint)),n.targetToAfterDragFree&&(this.isMouseDown||n.nextFrameEaseTo(new mt({x:n.targetToAfterDragFree.targetX,y:n.targetToAfterDragFree.targetY}),{easing:n.targetToAfterDragFree?.easing})),this.isMouseDown&&this.currentEnableDragMouseInShapeID==n.id){const{dx:i,dy:r}=n.centerDiff;n.x=this.app.mousePoint.x,n.y=this.app.mousePoint.y,n.x-=i,n.y-=r,n.isDragging=!0,this.shapes.filter(a=>a.id!=n.id).forEach(a=>a.isDragging=!1)}this.transformCtxBaseOnShape(n),n.toCanvasContext(this.ctx),this.ctx.hasSetCustomStrokeStyle&&this.ctx.stroke(),this.ctx.hasSetCustomFillStyle&&this.ctx.fill(),n.path2d=this.ctx.currentPath2D,this.ctx.restore()}return this}click(t){const e=()=>{this.shapes.forEach(n=>{(n instanceof j&&n.isPointInPath(this.app.mousePoint.x,this.app.mousePoint.y,this.ctx)||this.currentMouseInShapeID==n.id)&&t(n)})};return this.app.on("tap",e),()=>{this.app.off("tap",e)}}drawMouseMoveLine(t="line",e){switch(t){case"brush":const n=e?.brushSize??10,i=e?.brushDensity??50,r=e?.brushColor??"#000000",a=this.ctx.getImageData(0,0,this.ctx.canvas.width,this.ctx.canvas.height),o=a.data,c=$t(r);return this.app.captureMove({move:()=>{if(this.isMouseDown){for(let h=0;h<i;h++){const l=Math.random()*Math.PI*2,f=Math.random()*n,g=this.app.mousePoint.x+Math.cos(l)*f|0,w=this.app.mousePoint.y+Math.sin(l)*f|0,m=(g+w*a.width)*4;o[m]=c.r,o[m+1]=c.g,o[m+2]=c.b,o[m+3]=255}this.ctx.putImageData(a)}}});case"line":default:return this.app.captureMove({start:h=>{this.ctx.beginPath(),this.app.setMousePoint(h),this.ctx.moveTo(this.app.mousePoint.x,this.app.mousePoint.y)},end:()=>{this.ctx.closePath()},move:()=>{this.isMouseDown&&(this.ctx.lineTo(this.app.mousePoint.x,this.app.mousePoint.y),this.ctx.stroke())}})}}}class Sh{localVideoUtil;remoteVideoUtil;localPeerConnection=null;remotePeerConnection=null;constructor(t,e){this.localVideoUtil=new ge(t),this.remoteVideoUtil=new ge(e)}start(){this.getLocalMediaStream().then(t=>{this.call(t)})}end(){this.localPeerConnection?.close(),this.remotePeerConnection?.close(),this.localPeerConnection=null,this.remotePeerConnection=null,this.trace("Ending call.")}getLocalMediaStream(){return new Promise((t,e)=>{navigator.mediaDevices.getUserMedia({audio:!0,video:!0}).then(n=>{this.localVideoUtil.setSrcObject(n),t(n)}).catch(n=>{this.trace(`navigator.getUserMedia error: ${n}.`),e(n)})})}gotRemoteMediaStream(t){const e=t.streams[0];this.remoteVideoUtil.setSrcObject(e),this.trace("Remote peer connection received remote stream.")}call(t){const e=t.getVideoTracks(),n=t.getAudioTracks();e.length>0&&this.trace(`Using video device: ${e[0].label}.`),n.length>0&&this.trace(`Using audio device: ${n[0].label}.`);const i=void 0,r=new RTCPeerConnection(i);this.localPeerConnection=r,this.trace("Created local peer connection object localPeerConnection."),r.addEventListener("icecandidate",this.handleConnection),r.addEventListener("iceconnectionstatechange",this.handleConnectionChange);const a=new RTCPeerConnection(i);this.remotePeerConnection=a,this.trace("Created remote peer connection object remotePeerConnection."),a.addEventListener("icecandidate",this.handleConnection),a.addEventListener("iceconnectionstatechange",this.handleConnectionChange),a.addEventListener("track",this.gotRemoteMediaStream),this.trace("Add local localStream to localPeerConnection."),r.addTrack(e[0],t),r.addTrack(n[0],t),this.trace("localPeerConnection createOffer start."),r.createOffer({offerToReceiveVideo:!0}).then(o=>this.createdOffer(o)).catch(o=>this.setSessionDescriptionError(o))}handleConnection(t){const e=t.target,n=t.candidate;if(e&&n){const i=new RTCIceCandidate(n),r=this.getOtherPeer(e);r&&(r.addIceCandidate(i).then(()=>{this.handleConnectionSuccess(e)}).catch(a=>{this.handleConnectionFailure(e,a)}),this.trace(`${this.getPeerName(e)} ICE candidate:
|
|
36
|
+
`):t.data[r.name]=r.value)}return t}function mi(s,t){return function(){return s.apply(t,arguments)}}const{toString:to}=Object.prototype,{getPrototypeOf:Bn}=Object,He=(s=>t=>{const e=to.call(t);return s[e]||(s[e]=e.slice(8,-1).toLowerCase())})(Object.create(null)),At=s=>(s=s.toLowerCase(),t=>He(t)===s),We=s=>t=>typeof t===s,{isArray:ie}=Array,ve=We("undefined");function eo(s){return s!==null&&!ve(s)&&s.constructor!==null&&!ve(s.constructor)&&vt(s.constructor.isBuffer)&&s.constructor.isBuffer(s)}const pi=At("ArrayBuffer");function no(s){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(s):t=s&&s.buffer&&pi(s.buffer),t}const so=We("string"),vt=We("function"),gi=We("number"),$e=s=>s!==null&&typeof s=="object",io=s=>s===!0||s===!1,Je=s=>{if(He(s)!=="object")return!1;const t=Bn(s);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in s)&&!(Symbol.iterator in s)},ro=At("Date"),ao=At("File"),oo=At("Blob"),co=At("FileList"),ho=s=>$e(s)&&vt(s.pipe),lo=s=>{let t;return s&&(typeof FormData=="function"&&s instanceof FormData||vt(s.append)&&((t=He(s))==="formdata"||t==="object"&&vt(s.toString)&&s.toString()==="[object FormData]"))},uo=At("URLSearchParams"),fo=s=>s.trim?s.trim():s.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function be(s,t,{allOwnKeys:e=!1}={}){if(s===null||typeof s>"u")return;let n,i;if(typeof s!="object"&&(s=[s]),ie(s))for(n=0,i=s.length;n<i;n++)t.call(null,s[n],n,s);else{const r=e?Object.getOwnPropertyNames(s):Object.keys(s),a=r.length;let o;for(n=0;n<a;n++)o=r[n],t.call(null,s[o],o,s)}}function yi(s,t){t=t.toLowerCase();const e=Object.keys(s);let n=e.length,i;for(;n-- >0;)if(i=e[n],t===i.toLowerCase())return i;return null}const wi=(()=>typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global)(),vi=s=>!ve(s)&&s!==wi;function Un(){const{caseless:s}=vi(this)&&this||{},t={},e=(n,i)=>{const r=s&&yi(t,i)||i;Je(t[r])&&Je(n)?t[r]=Un(t[r],n):Je(n)?t[r]=Un({},n):ie(n)?t[r]=n.slice():t[r]=n};for(let n=0,i=arguments.length;n<i;n++)arguments[n]&&be(arguments[n],e);return t}const mo=(s,t,e,{allOwnKeys:n}={})=>(be(t,(i,r)=>{e&&vt(i)?s[r]=mi(i,e):s[r]=i},{allOwnKeys:n}),s),po=s=>(s.charCodeAt(0)===65279&&(s=s.slice(1)),s),go=(s,t,e,n)=>{s.prototype=Object.create(t.prototype,n),s.prototype.constructor=s,Object.defineProperty(s,"super",{value:t.prototype}),e&&Object.assign(s.prototype,e)},yo=(s,t,e,n)=>{let i,r,a;const o={};if(t=t||{},s==null)return t;do{for(i=Object.getOwnPropertyNames(s),r=i.length;r-- >0;)a=i[r],(!n||n(a,s,t))&&!o[a]&&(t[a]=s[a],o[a]=!0);s=e!==!1&&Bn(s)}while(s&&(!e||e(s,t))&&s!==Object.prototype);return t},wo=(s,t,e)=>{s=String(s),(e===void 0||e>s.length)&&(e=s.length),e-=t.length;const n=s.indexOf(t,e);return n!==-1&&n===e},vo=s=>{if(!s)return null;if(ie(s))return s;let t=s.length;if(!gi(t))return null;const e=new Array(t);for(;t-- >0;)e[t]=s[t];return e},bo=(s=>t=>s&&t instanceof s)(typeof Uint8Array<"u"&&Bn(Uint8Array)),xo=(s,t)=>{const n=(s&&s[Symbol.iterator]).call(s);let i;for(;(i=n.next())&&!i.done;){const r=i.value;t.call(s,r[0],r[1])}},So=(s,t)=>{let e;const n=[];for(;(e=s.exec(t))!==null;)n.push(e);return n},Co=At("HTMLFormElement"),To=s=>s.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,n,i){return n.toUpperCase()+i}),bi=(({hasOwnProperty:s})=>(t,e)=>s.call(t,e))(Object.prototype),Eo=At("RegExp"),xi=(s,t)=>{const e=Object.getOwnPropertyDescriptors(s),n={};be(e,(i,r)=>{let a;(a=t(i,r,s))!==!1&&(n[r]=a||i)}),Object.defineProperties(s,n)},Po=s=>{xi(s,(t,e)=>{if(vt(s)&&["arguments","caller","callee"].indexOf(e)!==-1)return!1;const n=s[e];if(vt(n)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+e+"'")})}})},_o=(s,t)=>{const e={},n=i=>{i.forEach(r=>{e[r]=!0})};return ie(s)?n(s):n(String(s).split(t)),e},Do=()=>{},Ao=(s,t)=>(s=+s,Number.isFinite(s)?s:t),Vn="abcdefghijklmnopqrstuvwxyz",Si="0123456789",Ci={DIGIT:Si,ALPHA:Vn,ALPHA_DIGIT:Vn+Vn.toUpperCase()+Si},ko=(s=16,t=Ci.ALPHA_DIGIT)=>{let e="";const{length:n}=t;for(;s--;)e+=t[Math.random()*n|0];return e};function Io(s){return!!(s&&vt(s.append)&&s[Symbol.toStringTag]==="FormData"&&s[Symbol.iterator])}const Mo=s=>{const t=new Array(10),e=(n,i)=>{if($e(n)){if(t.indexOf(n)>=0)return;if(!("toJSON"in n)){t[i]=n;const r=ie(n)?[]:{};return be(n,(a,o)=>{const c=e(a,i+1);!ve(c)&&(r[o]=c)}),t[i]=void 0,r}}return n};return e(s,0)},Ro=At("AsyncFunction"),E={isArray:ie,isArrayBuffer:pi,isBuffer:eo,isFormData:lo,isArrayBufferView:no,isString:so,isNumber:gi,isBoolean:io,isObject:$e,isPlainObject:Je,isUndefined:ve,isDate:ro,isFile:ao,isBlob:oo,isRegExp:Eo,isFunction:vt,isStream:ho,isURLSearchParams:uo,isTypedArray:bo,isFileList:co,forEach:be,merge:Un,extend:mo,trim:fo,stripBOM:po,inherits:go,toFlatObject:yo,kindOf:He,kindOfTest:At,endsWith:wo,toArray:vo,forEachEntry:xo,matchAll:So,isHTMLForm:Co,hasOwnProperty:bi,hasOwnProp:bi,reduceDescriptors:xi,freezeMethods:Po,toObjectSet:_o,toCamelCase:To,noop:Do,toFiniteNumber:Ao,findKey:yi,global:wi,isContextDefined:vi,ALPHABET:Ci,generateString:ko,isSpecCompliantForm:Io,toJSONObject:Mo,isAsyncFn:Ro,isThenable:s=>s&&($e(s)||vt(s))&&vt(s.then)&&vt(s.catch)};function L(s,t,e,n,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=s,this.name="AxiosError",t&&(this.code=t),e&&(this.config=e),n&&(this.request=n),i&&(this.response=i)}E.inherits(L,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:E.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const Ti=L.prototype,Ei={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(s=>{Ei[s]={value:s}}),Object.defineProperties(L,Ei),Object.defineProperty(Ti,"isAxiosError",{value:!0}),L.from=(s,t,e,n,i,r)=>{const a=Object.create(Ti);return E.toFlatObject(s,a,function(c){return c!==Error.prototype},o=>o!=="isAxiosError"),L.call(a,s.message,t,e,n,i),a.cause=s,a.name=s.name,r&&Object.assign(a,r),a};const Oo=null;function Gn(s){return E.isPlainObject(s)||E.isArray(s)}function Pi(s){return E.endsWith(s,"[]")?s.slice(0,-2):s}function _i(s,t,e){return s?s.concat(t).map(function(i,r){return i=Pi(i),!e&&r?"["+i+"]":i}).join(e?".":""):t}function Lo(s){return E.isArray(s)&&!s.some(Gn)}const No=E.toFlatObject(E,{},null,function(t){return/^is[A-Z]/.test(t)});function Ze(s,t,e){if(!E.isObject(s))throw new TypeError("target must be an object");t=t||new FormData,e=E.toFlatObject(e,{metaTokens:!0,dots:!1,indexes:!1},!1,function(v,b){return!E.isUndefined(b[v])});const n=e.metaTokens,i=e.visitor||l,r=e.dots,a=e.indexes,c=(e.Blob||typeof Blob<"u"&&Blob)&&E.isSpecCompliantForm(t);if(!E.isFunction(i))throw new TypeError("visitor must be a function");function h(m){if(m===null)return"";if(E.isDate(m))return m.toISOString();if(!c&&E.isBlob(m))throw new L("Blob is not supported. Use a Buffer instead.");return E.isArrayBuffer(m)||E.isTypedArray(m)?c&&typeof Blob=="function"?new Blob([m]):Buffer.from(m):m}function l(m,v,b){let S=m;if(m&&!b&&typeof m=="object"){if(E.endsWith(v,"{}"))v=n?v:v.slice(0,-2),m=JSON.stringify(m);else if(E.isArray(m)&&Lo(m)||(E.isFileList(m)||E.endsWith(v,"[]"))&&(S=E.toArray(m)))return v=Pi(v),S.forEach(function(M,R){!(E.isUndefined(M)||M===null)&&t.append(a===!0?_i([v],R,r):a===null?v:v+"[]",h(M))}),!1}return Gn(m)?!0:(t.append(_i(b,v,r),h(m)),!1)}const f=[],g=Object.assign(No,{defaultVisitor:l,convertValue:h,isVisitable:Gn});function w(m,v){if(!E.isUndefined(m)){if(f.indexOf(m)!==-1)throw Error("Circular reference detected in "+v.join("."));f.push(m),E.forEach(m,function(S,C){(!(E.isUndefined(S)||S===null)&&i.call(t,S,E.isString(C)?C.trim():C,v,g))===!0&&w(S,v?v.concat(C):[C])}),f.pop()}}if(!E.isObject(s))throw new TypeError("data must be an object");return w(s),t}function Di(s){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(s).replace(/[!'()~]|%20|%00/g,function(n){return t[n]})}function zn(s,t){this._pairs=[],s&&Ze(s,this,t)}const Ai=zn.prototype;Ai.append=function(t,e){this._pairs.push([t,e])},Ai.toString=function(t){const e=t?function(n){return t.call(this,n,Di)}:Di;return this._pairs.map(function(i){return e(i[0])+"="+e(i[1])},"").join("&")};function Fo(s){return encodeURIComponent(s).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function ki(s,t,e){if(!t)return s;const n=e&&e.encode||Fo,i=e&&e.serialize;let r;if(i?r=i(t,e):r=E.isURLSearchParams(t)?t.toString():new zn(t,e).toString(n),r){const a=s.indexOf("#");a!==-1&&(s=s.slice(0,a)),s+=(s.indexOf("?")===-1?"?":"&")+r}return s}class Bo{constructor(){this.handlers=[]}use(t,e,n){return this.handlers.push({fulfilled:t,rejected:e,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){E.forEach(this.handlers,function(n){n!==null&&t(n)})}}const Ii=Bo,Mi={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Uo=typeof URLSearchParams<"u"?URLSearchParams:zn,Vo=typeof FormData<"u"?FormData:null,Go=typeof Blob<"u"?Blob:null,zo=(()=>{let s;return typeof navigator<"u"&&((s=navigator.product)==="ReactNative"||s==="NativeScript"||s==="NS")?!1:typeof window<"u"&&typeof document<"u"})(),jo=(()=>typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function")(),kt={isBrowser:!0,classes:{URLSearchParams:Uo,FormData:Vo,Blob:Go},isStandardBrowserEnv:zo,isStandardBrowserWebWorkerEnv:jo,protocols:["http","https","file","blob","url","data"]};function Xo(s,t){return Ze(s,new kt.classes.URLSearchParams,Object.assign({visitor:function(e,n,i,r){return kt.isNode&&E.isBuffer(e)?(this.append(n,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)}},t))}function qo(s){return E.matchAll(/\w+|\[(\w*)]/g,s).map(t=>t[0]==="[]"?"":t[1]||t[0])}function Yo(s){const t={},e=Object.keys(s);let n;const i=e.length;let r;for(n=0;n<i;n++)r=e[n],t[r]=s[r];return t}function Ri(s){function t(e,n,i,r){let a=e[r++];const o=Number.isFinite(+a),c=r>=e.length;return a=!a&&E.isArray(i)?i.length:a,c?(E.hasOwnProp(i,a)?i[a]=[i[a],n]:i[a]=n,!o):((!i[a]||!E.isObject(i[a]))&&(i[a]=[]),t(e,n,i[a],r)&&E.isArray(i[a])&&(i[a]=Yo(i[a])),!o)}if(E.isFormData(s)&&E.isFunction(s.entries)){const e={};return E.forEachEntry(s,(n,i)=>{t(qo(n),i,e,0)}),e}return null}function Ho(s,t,e){if(E.isString(s))try{return(t||JSON.parse)(s),E.trim(s)}catch(n){if(n.name!=="SyntaxError")throw n}return(e||JSON.stringify)(s)}const jn={transitional:Mi,adapter:["xhr","http"],transformRequest:[function(t,e){const n=e.getContentType()||"",i=n.indexOf("application/json")>-1,r=E.isObject(t);if(r&&E.isHTMLForm(t)&&(t=new FormData(t)),E.isFormData(t))return i&&i?JSON.stringify(Ri(t)):t;if(E.isArrayBuffer(t)||E.isBuffer(t)||E.isStream(t)||E.isFile(t)||E.isBlob(t))return t;if(E.isArrayBufferView(t))return t.buffer;if(E.isURLSearchParams(t))return e.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let o;if(r){if(n.indexOf("application/x-www-form-urlencoded")>-1)return Xo(t,this.formSerializer).toString();if((o=E.isFileList(t))||n.indexOf("multipart/form-data")>-1){const c=this.env&&this.env.FormData;return Ze(o?{"files[]":t}:t,c&&new c,this.formSerializer)}}return r||i?(e.setContentType("application/json",!1),Ho(t)):t}],transformResponse:[function(t){const e=this.transitional||jn.transitional,n=e&&e.forcedJSONParsing,i=this.responseType==="json";if(t&&E.isString(t)&&(n&&!this.responseType||i)){const a=!(e&&e.silentJSONParsing)&&i;try{return JSON.parse(t)}catch(o){if(a)throw o.name==="SyntaxError"?L.from(o,L.ERR_BAD_RESPONSE,this,null,this.response):o}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:kt.classes.FormData,Blob:kt.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};E.forEach(["delete","get","head","post","put","patch"],s=>{jn.headers[s]={}});const Xn=jn,Wo=E.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),$o=s=>{const t={};let e,n,i;return s&&s.split(`
|
|
37
|
+
`).forEach(function(a){i=a.indexOf(":"),e=a.substring(0,i).trim().toLowerCase(),n=a.substring(i+1).trim(),!(!e||t[e]&&Wo[e])&&(e==="set-cookie"?t[e]?t[e].push(n):t[e]=[n]:t[e]=t[e]?t[e]+", "+n:n)}),t},Oi=Symbol("internals");function xe(s){return s&&String(s).trim().toLowerCase()}function Ke(s){return s===!1||s==null?s:E.isArray(s)?s.map(Ke):String(s)}function Jo(s){const t=Object.create(null),e=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=e.exec(s);)t[n[1]]=n[2];return t}const Zo=s=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(s.trim());function qn(s,t,e,n,i){if(E.isFunction(n))return n.call(this,t,e);if(i&&(t=e),!!E.isString(t)){if(E.isString(n))return t.indexOf(n)!==-1;if(E.isRegExp(n))return n.test(t)}}function Ko(s){return s.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,e,n)=>e.toUpperCase()+n)}function Qo(s,t){const e=E.toCamelCase(" "+t);["get","set","has"].forEach(n=>{Object.defineProperty(s,n+e,{value:function(i,r,a){return this[n].call(this,t,i,r,a)},configurable:!0})})}class Qe{constructor(t){t&&this.set(t)}set(t,e,n){const i=this;function r(o,c,h){const l=xe(c);if(!l)throw new Error("header name must be a non-empty string");const f=E.findKey(i,l);(!f||i[f]===void 0||h===!0||h===void 0&&i[f]!==!1)&&(i[f||c]=Ke(o))}const a=(o,c)=>E.forEach(o,(h,l)=>r(h,l,c));return E.isPlainObject(t)||t instanceof this.constructor?a(t,e):E.isString(t)&&(t=t.trim())&&!Zo(t)?a($o(t),e):t!=null&&r(e,t,n),this}get(t,e){if(t=xe(t),t){const n=E.findKey(this,t);if(n){const i=this[n];if(!e)return i;if(e===!0)return Jo(i);if(E.isFunction(e))return e.call(this,i,n);if(E.isRegExp(e))return e.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,e){if(t=xe(t),t){const n=E.findKey(this,t);return!!(n&&this[n]!==void 0&&(!e||qn(this,this[n],n,e)))}return!1}delete(t,e){const n=this;let i=!1;function r(a){if(a=xe(a),a){const o=E.findKey(n,a);o&&(!e||qn(n,n[o],o,e))&&(delete n[o],i=!0)}}return E.isArray(t)?t.forEach(r):r(t),i}clear(t){const e=Object.keys(this);let n=e.length,i=!1;for(;n--;){const r=e[n];(!t||qn(this,this[r],r,t,!0))&&(delete this[r],i=!0)}return i}normalize(t){const e=this,n={};return E.forEach(this,(i,r)=>{const a=E.findKey(n,r);if(a){e[a]=Ke(i),delete e[r];return}const o=t?Ko(r):String(r).trim();o!==r&&delete e[r],e[o]=Ke(i),n[o]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const e=Object.create(null);return E.forEach(this,(n,i)=>{n!=null&&n!==!1&&(e[i]=t&&E.isArray(n)?n.join(", "):n)}),e}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,e])=>t+": "+e).join(`
|
|
38
|
+
`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...e){const n=new this(t);return e.forEach(i=>n.set(i)),n}static accessor(t){const n=(this[Oi]=this[Oi]={accessors:{}}).accessors,i=this.prototype;function r(a){const o=xe(a);n[o]||(Qo(i,a),n[o]=!0)}return E.isArray(t)?t.forEach(r):r(t),this}}Qe.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),E.reduceDescriptors(Qe.prototype,({value:s},t)=>{let e=t[0].toUpperCase()+t.slice(1);return{get:()=>s,set(n){this[e]=n}}}),E.freezeMethods(Qe);const Ft=Qe;function Yn(s,t){const e=this||Xn,n=t||e,i=Ft.from(n.headers);let r=n.data;return E.forEach(s,function(o){r=o.call(e,r,i.normalize(),t?t.status:void 0)}),i.normalize(),r}function Li(s){return!!(s&&s.__CANCEL__)}function Se(s,t,e){L.call(this,s??"canceled",L.ERR_CANCELED,t,e),this.name="CanceledError"}E.inherits(Se,L,{__CANCEL__:!0});function tc(s,t,e){const n=e.config.validateStatus;!e.status||!n||n(e.status)?s(e):t(new L("Request failed with status code "+e.status,[L.ERR_BAD_REQUEST,L.ERR_BAD_RESPONSE][Math.floor(e.status/100)-4],e.config,e.request,e))}const ec=kt.isStandardBrowserEnv?function(){return{write:function(e,n,i,r,a,o){const c=[];c.push(e+"="+encodeURIComponent(n)),E.isNumber(i)&&c.push("expires="+new Date(i).toGMTString()),E.isString(r)&&c.push("path="+r),E.isString(a)&&c.push("domain="+a),o===!0&&c.push("secure"),document.cookie=c.join("; ")},read:function(e){const n=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return n?decodeURIComponent(n[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}();function nc(s){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(s)}function sc(s,t){return t?s.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):s}function Ni(s,t){return s&&!nc(t)?sc(s,t):t}const ic=kt.isStandardBrowserEnv?function(){const t=/(msie|trident)/i.test(navigator.userAgent),e=document.createElement("a");let n;function i(r){let a=r;return t&&(e.setAttribute("href",a),a=e.href),e.setAttribute("href",a),{href:e.href,protocol:e.protocol?e.protocol.replace(/:$/,""):"",host:e.host,search:e.search?e.search.replace(/^\?/,""):"",hash:e.hash?e.hash.replace(/^#/,""):"",hostname:e.hostname,port:e.port,pathname:e.pathname.charAt(0)==="/"?e.pathname:"/"+e.pathname}}return n=i(window.location.href),function(a){const o=E.isString(a)?i(a):a;return o.protocol===n.protocol&&o.host===n.host}}():function(){return function(){return!0}}();function rc(s){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(s);return t&&t[1]||""}function ac(s,t){s=s||10;const e=new Array(s),n=new Array(s);let i=0,r=0,a;return t=t!==void 0?t:1e3,function(c){const h=Date.now(),l=n[r];a||(a=h),e[i]=c,n[i]=h;let f=r,g=0;for(;f!==i;)g+=e[f++],f=f%s;if(i=(i+1)%s,i===r&&(r=(r+1)%s),h-a<t)return;const w=l&&h-l;return w?Math.round(g*1e3/w):void 0}}function Fi(s,t){let e=0;const n=ac(50,250);return i=>{const r=i.loaded,a=i.lengthComputable?i.total:void 0,o=r-e,c=n(o),h=r<=a;e=r;const l={loaded:r,total:a,progress:a?r/a:void 0,bytes:o,rate:c||void 0,estimated:c&&a&&h?(a-r)/c:void 0,event:i};l[t?"download":"upload"]=!0,s(l)}}const Hn={http:Oo,xhr:typeof XMLHttpRequest<"u"&&function(s){return new Promise(function(e,n){let i=s.data;const r=Ft.from(s.headers).normalize(),a=s.responseType;let o;function c(){s.cancelToken&&s.cancelToken.unsubscribe(o),s.signal&&s.signal.removeEventListener("abort",o)}let h;E.isFormData(i)&&(kt.isStandardBrowserEnv||kt.isStandardBrowserWebWorkerEnv?r.setContentType(!1):r.getContentType(/^\s*multipart\/form-data/)?E.isString(h=r.getContentType())&&r.setContentType(h.replace(/^\s*(multipart\/form-data);+/,"$1")):r.setContentType("multipart/form-data"));let l=new XMLHttpRequest;if(s.auth){const m=s.auth.username||"",v=s.auth.password?unescape(encodeURIComponent(s.auth.password)):"";r.set("Authorization","Basic "+btoa(m+":"+v))}const f=Ni(s.baseURL,s.url);l.open(s.method.toUpperCase(),ki(f,s.params,s.paramsSerializer),!0),l.timeout=s.timeout;function g(){if(!l)return;const m=Ft.from("getAllResponseHeaders"in l&&l.getAllResponseHeaders()),b={data:!a||a==="text"||a==="json"?l.responseText:l.response,status:l.status,statusText:l.statusText,headers:m,config:s,request:l};tc(function(C){e(C),c()},function(C){n(C),c()},b),l=null}if("onloadend"in l?l.onloadend=g:l.onreadystatechange=function(){!l||l.readyState!==4||l.status===0&&!(l.responseURL&&l.responseURL.indexOf("file:")===0)||setTimeout(g)},l.onabort=function(){l&&(n(new L("Request aborted",L.ECONNABORTED,s,l)),l=null)},l.onerror=function(){n(new L("Network Error",L.ERR_NETWORK,s,l)),l=null},l.ontimeout=function(){let v=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const b=s.transitional||Mi;s.timeoutErrorMessage&&(v=s.timeoutErrorMessage),n(new L(v,b.clarifyTimeoutError?L.ETIMEDOUT:L.ECONNABORTED,s,l)),l=null},kt.isStandardBrowserEnv){const m=(s.withCredentials||ic(f))&&s.xsrfCookieName&&ec.read(s.xsrfCookieName);m&&r.set(s.xsrfHeaderName,m)}i===void 0&&r.setContentType(null),"setRequestHeader"in l&&E.forEach(r.toJSON(),function(v,b){l.setRequestHeader(b,v)}),E.isUndefined(s.withCredentials)||(l.withCredentials=!!s.withCredentials),a&&a!=="json"&&(l.responseType=s.responseType),typeof s.onDownloadProgress=="function"&&l.addEventListener("progress",Fi(s.onDownloadProgress,!0)),typeof s.onUploadProgress=="function"&&l.upload&&l.upload.addEventListener("progress",Fi(s.onUploadProgress)),(s.cancelToken||s.signal)&&(o=m=>{l&&(n(!m||m.type?new Se(null,s,l):m),l.abort(),l=null)},s.cancelToken&&s.cancelToken.subscribe(o),s.signal&&(s.signal.aborted?o():s.signal.addEventListener("abort",o)));const w=rc(f);if(w&&kt.protocols.indexOf(w)===-1){n(new L("Unsupported protocol "+w+":",L.ERR_BAD_REQUEST,s));return}l.send(i||null)})}};E.forEach(Hn,(s,t)=>{if(s){try{Object.defineProperty(s,"name",{value:t})}catch{}Object.defineProperty(s,"adapterName",{value:t})}});const Bi=s=>`- ${s}`,oc=s=>E.isFunction(s)||s===null||s===!1,Ui={getAdapter:s=>{s=E.isArray(s)?s:[s];const{length:t}=s;let e,n;const i={};for(let r=0;r<t;r++){e=s[r];let a;if(n=e,!oc(e)&&(n=Hn[(a=String(e)).toLowerCase()],n===void 0))throw new L(`Unknown adapter '${a}'`);if(n)break;i[a||"#"+r]=n}if(!n){const r=Object.entries(i).map(([o,c])=>`adapter ${o} `+(c===!1?"is not supported by the environment":"is not available in the build"));let a=t?r.length>1?`since :
|
|
39
|
+
`+r.map(Bi).join(`
|
|
40
|
+
`):" "+Bi(r[0]):"as no adapter specified";throw new L("There is no suitable adapter to dispatch the request "+a,"ERR_NOT_SUPPORT")}return n},adapters:Hn};function Wn(s){if(s.cancelToken&&s.cancelToken.throwIfRequested(),s.signal&&s.signal.aborted)throw new Se(null,s)}function Vi(s){return Wn(s),s.headers=Ft.from(s.headers),s.data=Yn.call(s,s.transformRequest),["post","put","patch"].indexOf(s.method)!==-1&&s.headers.setContentType("application/x-www-form-urlencoded",!1),Ui.getAdapter(s.adapter||Xn.adapter)(s).then(function(n){return Wn(s),n.data=Yn.call(s,s.transformResponse,n),n.headers=Ft.from(n.headers),n},function(n){return Li(n)||(Wn(s),n&&n.response&&(n.response.data=Yn.call(s,s.transformResponse,n.response),n.response.headers=Ft.from(n.response.headers))),Promise.reject(n)})}const Gi=s=>s instanceof Ft?s.toJSON():s;function re(s,t){t=t||{};const e={};function n(h,l,f){return E.isPlainObject(h)&&E.isPlainObject(l)?E.merge.call({caseless:f},h,l):E.isPlainObject(l)?E.merge({},l):E.isArray(l)?l.slice():l}function i(h,l,f){if(E.isUndefined(l)){if(!E.isUndefined(h))return n(void 0,h,f)}else return n(h,l,f)}function r(h,l){if(!E.isUndefined(l))return n(void 0,l)}function a(h,l){if(E.isUndefined(l)){if(!E.isUndefined(h))return n(void 0,h)}else return n(void 0,l)}function o(h,l,f){if(f in t)return n(h,l);if(f in s)return n(void 0,h)}const c={url:r,method:r,data:r,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:o,headers:(h,l)=>i(Gi(h),Gi(l),!0)};return E.forEach(Object.keys(Object.assign({},s,t)),function(l){const f=c[l]||i,g=f(s[l],t[l],l);E.isUndefined(g)&&f!==o||(e[l]=g)}),e}const zi="1.5.1",$n={};["object","boolean","number","function","string","symbol"].forEach((s,t)=>{$n[s]=function(n){return typeof n===s||"a"+(t<1?"n ":" ")+s}});const ji={};$n.transitional=function(t,e,n){function i(r,a){return"[Axios v"+zi+"] Transitional option '"+r+"'"+a+(n?". "+n:"")}return(r,a,o)=>{if(t===!1)throw new L(i(a," has been removed"+(e?" in "+e:"")),L.ERR_DEPRECATED);return e&&!ji[a]&&(ji[a]=!0,console.warn(i(a," has been deprecated since v"+e+" and will be removed in the near future"))),t?t(r,a,o):!0}};function cc(s,t,e){if(typeof s!="object")throw new L("options must be an object",L.ERR_BAD_OPTION_VALUE);const n=Object.keys(s);let i=n.length;for(;i-- >0;){const r=n[i],a=t[r];if(a){const o=s[r],c=o===void 0||a(o,r,s);if(c!==!0)throw new L("option "+r+" must be "+c,L.ERR_BAD_OPTION_VALUE);continue}if(e!==!0)throw new L("Unknown option "+r,L.ERR_BAD_OPTION)}}const Jn={assertOptions:cc,validators:$n},Xt=Jn.validators;class tn{constructor(t){this.defaults=t,this.interceptors={request:new Ii,response:new Ii}}request(t,e){typeof t=="string"?(e=e||{},e.url=t):e=t||{},e=re(this.defaults,e);const{transitional:n,paramsSerializer:i,headers:r}=e;n!==void 0&&Jn.assertOptions(n,{silentJSONParsing:Xt.transitional(Xt.boolean),forcedJSONParsing:Xt.transitional(Xt.boolean),clarifyTimeoutError:Xt.transitional(Xt.boolean)},!1),i!=null&&(E.isFunction(i)?e.paramsSerializer={serialize:i}:Jn.assertOptions(i,{encode:Xt.function,serialize:Xt.function},!0)),e.method=(e.method||this.defaults.method||"get").toLowerCase();let a=r&&E.merge(r.common,r[e.method]);r&&E.forEach(["delete","get","head","post","put","patch","common"],m=>{delete r[m]}),e.headers=Ft.concat(a,r);const o=[];let c=!0;this.interceptors.request.forEach(function(v){typeof v.runWhen=="function"&&v.runWhen(e)===!1||(c=c&&v.synchronous,o.unshift(v.fulfilled,v.rejected))});const h=[];this.interceptors.response.forEach(function(v){h.push(v.fulfilled,v.rejected)});let l,f=0,g;if(!c){const m=[Vi.bind(this),void 0];for(m.unshift.apply(m,o),m.push.apply(m,h),g=m.length,l=Promise.resolve(e);f<g;)l=l.then(m[f++],m[f++]);return l}g=o.length;let w=e;for(f=0;f<g;){const m=o[f++],v=o[f++];try{w=m(w)}catch(b){v.call(this,b);break}}try{l=Vi.call(this,w)}catch(m){return Promise.reject(m)}for(f=0,g=h.length;f<g;)l=l.then(h[f++],h[f++]);return l}getUri(t){t=re(this.defaults,t);const e=Ni(t.baseURL,t.url);return ki(e,t.params,t.paramsSerializer)}}E.forEach(["delete","get","head","options"],function(t){tn.prototype[t]=function(e,n){return this.request(re(n||{},{method:t,url:e,data:(n||{}).data}))}}),E.forEach(["post","put","patch"],function(t){function e(n){return function(r,a,o){return this.request(re(o||{},{method:t,headers:n?{"Content-Type":"multipart/form-data"}:{},url:r,data:a}))}}tn.prototype[t]=e(),tn.prototype[t+"Form"]=e(!0)});const en=tn;class Zn{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let e;this.promise=new Promise(function(r){e=r});const n=this;this.promise.then(i=>{if(!n._listeners)return;let r=n._listeners.length;for(;r-- >0;)n._listeners[r](i);n._listeners=null}),this.promise.then=i=>{let r;const a=new Promise(o=>{n.subscribe(o),r=o}).then(i);return a.cancel=function(){n.unsubscribe(r)},a},t(function(r,a,o){n.reason||(n.reason=new Se(r,a,o),e(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const e=this._listeners.indexOf(t);e!==-1&&this._listeners.splice(e,1)}static source(){let t;return{token:new Zn(function(i){t=i}),cancel:t}}}const hc=Zn;function lc(s){return function(e){return s.apply(null,e)}}function uc(s){return E.isObject(s)&&s.isAxiosError===!0}const Kn={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Kn).forEach(([s,t])=>{Kn[t]=s});const fc=Kn;function Xi(s){const t=new en(s),e=mi(en.prototype.request,t);return E.extend(e,en.prototype,t,{allOwnKeys:!0}),E.extend(e,t,null,{allOwnKeys:!0}),e.create=function(i){return Xi(re(s,i))},e}const Z=Xi(Xn);Z.Axios=en,Z.CanceledError=Se,Z.CancelToken=hc,Z.isCancel=Li,Z.VERSION=zi,Z.toFormData=Ze,Z.AxiosError=L,Z.Cancel=Z.CanceledError,Z.all=function(t){return Promise.all(t)},Z.spread=lc,Z.isAxiosError=uc,Z.mergeConfig=re,Z.AxiosHeaders=Ft,Z.formToJSON=s=>Ri(E.isHTMLForm(s)?new FormData(s):s),Z.getAdapter=Ui.getAdapter,Z.HttpStatusCode=fc,Z.default=Z;const dc=Z;class mc{instance;interceptors;requestCanceler;constructor(t){this.instance=dc.create(t),this.interceptors=t?.interceptors,this.requestCanceler=new qi,this.instance.interceptors.request.use(e=>(this.requestCanceler.pendingRequest(e),e),e=>(this.requestCanceler.cancelRequest(e.config),e)),this.instance.interceptors.request.use(this.interceptors?.requestInterceptor,this.interceptors?.requestInterceptorCatch),this.instance.interceptors.response.use(this.interceptors?.responseInterceptor,this.interceptors?.responseInterceptorCatch),this.instance.interceptors.response.use(e=>new Promise((n,i)=>{this.requestCanceler.confirmRequest(e.config),e.status===200?n(e.data):i(e.data)}),async e=>{const{code:n="",config:i}=e;return!i||!i.retry||!i.retryStatus?.includes(n)||(i.retryCounted=i.retryCounted??0,i.retryCounted>=i.retry)?Promise.reject(e):(i.retryCounted++,await new Promise(r=>{setTimeout(()=>{r(void 0)},i.retryDelay)}),await this.request(i))})}request(t){return new Promise((e,n)=>{try{t.interceptors?.requestInterceptor&&(t=t.interceptors?.requestInterceptor(t)),this.instance.request(t).then(i=>{t.interceptors?.responseInterceptor&&(i=t.interceptors.responseInterceptor(i)),e(i)}).catch(i=>{t.interceptors?.responseInterceptorCatch&&(i=t.interceptors?.responseInterceptorCatch(i)),n(i)})}catch(i){t.interceptors?.requestInterceptorCatch&&t.interceptors.requestInterceptorCatch(i)}})}get(t,e){return this.request({...e,method:"get",url:t})}delete(t,e){return this.request({...e,method:"delete",url:t})}head(t,e){return this.request({...e,method:"head",url:t})}options(t,e){return this.request({...e,method:"options",url:t})}post(t,e,n){return this.request({...n,method:"post",url:t,data:e})}put(t,e,n){return this.request({...n,method:"put",url:t,data:e})}patch(t,e,n){return this.request({...n,method:"patch",url:t,data:e})}getUri(t){return this.instance.getUri(t)}}class qi{pendingRequestMap;constructor(){this.pendingRequestMap=new Map}async pendingRequest(t){const e=await this.getRequestId(t);if(this.pendingRequestMap.has(e))t.signal=this.pendingRequestMap.get(e)?.signal;else{const n=new AbortController;t.signal=n.signal,this.pendingRequestMap.set(e,n)}}async confirmRequest(t){if(this.pendingRequestMap.size===0)return;const e=await this.getRequestId(t);this.pendingRequestMap.has(e)&&this.pendingRequestMap.delete(e)}async cancelRequest(t){if(this.pendingRequestMap.size===0)return;const e=await this.getRequestId(t);this.pendingRequestMap.has(e)&&(this.pendingRequestMap.get(e)?.abort(),this.pendingRequestMap.delete(e))}async cancelAllRequest(){for(const t of this.pendingRequestMap.values())t.abort();this.pendingRequestMap.clear()}async getRequestId(t){const{url:e,method:n,params:i,data:r}=t;return await Wr({url:e,method:n,params:i,data:r})}}const nn=new Map;async function pc(s){return new Promise((t,e)=>{sn(s,(n,i)=>n?e(n):t({width:i.width,height:i.height,aspectRatio:i.width/i.height}))})}const sn=(s,t)=>{if(nn.has(s))return t(null,nn.get(s));const e=new Image;e.onload=function(){nn.set(s,{width:e.naturalWidth||e.width,height:e.naturalHeight||e.height,element:e}),t(null,nn.get(s))},e.onerror=function(n){t(n,null)},e.src=s},gc=(s,t)=>{for(let e=0,n=s.length;e<n;e++){const i=s[e],{type:r}=i;if(r.split("/")[0]!=="image")continue;const a=new FileReader;a.onload=function(o){if(!o.target)return t("no reader target",null);const c=o.target.result,h=Is(c),l=new Blob([c]);Qn(l,(f,g)=>{if(!g)return t(f,null);sn(g,(w,m)=>{if(!m)return t(w,null);Yi(g,(v,b)=>{if(!b)return t(v,null);const S={name:i.name,fileType:h,size:i.size,width:m.width,height:m.height,imgUrl:g,imageData:b,blob:l};return t(null,S)})})})},a.readAsArrayBuffer(i)}},Yi=(s,t)=>{sn(s,(e,n)=>{if(!n)return t(e,null);const i=document.createElement("canvas"),r=i.getContext("2d");i.width=n.width,i.height=n.height,r.drawImage(n.element,0,0,i.width,i.height);const a=r.getImageData(0,0,i.width,i.height);return t(null,a)})},yc=(s,t=0,e=0)=>{const n=document.createElement("canvas"),i=n.getContext("2d");return n.width=t,n.height=e,i.drawImage(s,0,0,t,e),i.getImageData(0,0,t,e)},wc=(s,t=0,e=0)=>{const n=document.createElement("canvas"),i=n.getContext("2d");return n.width=t,n.height=e,i.drawImage(s,0,0,t,e),i.getImageData(0,0,t,e)},vc=s=>{const t=s.width,e=s.height,n=t*e*3,i=n+54,r=[66,77,i&255,i>>8&255,i>>16&255,i>>24&255,0,0,0,0,54,0,0,0],a=[40,0,0,0,t&255,t>>8&255,t>>16&255,t>>24&255,e&255,e>>8&255,e>>16&255,e>>24&255,1,0,24,0,0,0,0,0,n&255,n>>8&255,n>>16&255,n>>24&255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],o=(4-t*3%4)%4,c=s.data;let h="";const l=t<<2;let f=e;const g=String.fromCharCode;do{const m=l*(f-1);let v="";for(let b=0;b<t;b++){const S=b<<2;v+=g(c[m+S+2])+g(c[m+S+1])+g(c[m+S])}for(let b=0;b<o;b++)v+=String.fromCharCode(0);h+=v}while(--f);function w(m){if(!window.btoa)throw"btoa undefined";let v="";if(typeof m=="string")v=m;else for(let b=0;b<m.length;b++)v+=String.fromCharCode(m[b]);return btoa(v)}return w(r.concat(a))+w(h)},bc=s=>{const{width:t,height:e}=s,n=document.createElement("canvas"),i=n.getContext("2d");return n.width=t,n.height=e,i.putImageData(s,0,0,0,0,t,e),n.toDataURL("image/png")},xc=(s,t,e)=>{const{width:n,height:i}=s,r=document.createElement("canvas"),a=r.getContext("2d");r.width=n,r.height=i,a.putImageData(s,0,0,0,0,n,i);const o=`image/${t?t.toLowerCase():"png"}`;r.toBlob(c=>{e?.(null,c)},o,1)},Qn=(s,t)=>{const e=new FileReader;e.onload=function(n){n.target?t(null,n.target.result):t("can't readAsDataURL",null)},e.readAsDataURL(s)},Sc=(s,t)=>{Qn(s,function(e,n){if(n){const i=new Image;i.src=n}else t(e)})};function Cc(s){const t=[],e=[],n=[];let i=0;for(let c=0,h=s.data.length;c<h;c+=4)t[i]=s.data[c],e[i]=s.data[c+1],n[i]=s.data[c+2],i+=1;const r=ts(t),a=ts(e),o=ts(n);return"rgb("+r+","+a+","+o+")"}function ts(s){const t={},e=[],n=[];for(let o=0;o<s.length;o++)t[s[o]]?e.push(s[o]):t[s[o]]=1;let i=0;for(let o=0;o<e.length;o++){i=0;for(let c=0;c<e.length;c++)e[o]===e[c]&&(i+=1),n[o]=i}const r=Math.max.apply(null,n);let a=0;for(;a<n.length;a++)if(n[a]===r)return;return e[a]}const Tc=s=>{const{data:t,width:e,height:n}=s,i=new Uint8ClampedArray(t.length);for(let a=0;a<n;a++)for(let o=0;o<e;o++){const c=(a*e+o)*4;i[c]=t[(a*e+e-o-1)*4],i[c+1]=t[(a*e+e-o-1)*4+1],i[c+2]=t[(a*e+e-o-1)*4+2],i[c+3]=t[(a*e+e-o-1)*4+3]}return new ImageData(i,e,n)},Ec=s=>{const{data:t,width:e,height:n}=s,i=new Uint8ClampedArray(t.length);for(let a=0;a<n;a++)for(let o=0;o<e;o++){const c=(a*e+o)*4;i[c]=t[((n-a-1)*e+o)*4],i[c+1]=t[((n-a-1)*e+o)*4+1],i[c+2]=t[((n-a-1)*e+o)*4+2],i[c+3]=t[((n-a-1)*e+o)*4+3]}return new ImageData(i,e,n)},Pc=s=>{const{data:t,width:e,height:n}=s,i=new Uint8ClampedArray(t.length);for(let a=0;a<e;a++)for(let o=0;o<n;o++){const c=(a*n+o)*4;i[c]=t[(o*e+e-a-1)*4],i[c+1]=t[(o*e+e-a-1)*4+1],i[c+2]=t[(o*e+e-a-1)*4+2],i[c+3]=t[(o*e+e-a-1)*4+3]}return new ImageData(i,n,e)},_c=s=>{const{data:t,width:e,height:n}=s,i=new Uint8ClampedArray(t.length);for(let a=0;a<e;a++)for(let o=0;o<n;o++){const c=(a*n+o)*4;i[c]=t[((n-o-1)*e+a)*4],i[c+1]=t[((n-o-1)*e+a)*4+1],i[c+2]=t[((n-o-1)*e+a)*4+2],i[c+3]=t[((n-o-1)*e+a)*4+3]}return new ImageData(i,n,e)},Dc=s=>{const{data:t,width:e,height:n}=s,i=new Uint8ClampedArray(t.length);for(let a=0;a<n;a++)for(let o=0;o<e;o++){const c=(a*e+o)*4,h=(t[c]+t[c+1]+t[c+2])/3;i[c]=h,i[c+1]=h,i[c+2]=h,i[c+3]=t[c+3]}return new ImageData(i,e,n)},Ac=s=>{const{data:t,width:e,height:n}=s,i=new Uint8ClampedArray(t.length);for(let a=0;a<n;a++)for(let o=0;o<e;o++){const c=(a*e+o)*4,h=.2126*t[c]+.7152*t[c+1]+.0722*t[c+2];i[c]=h,i[c+1]=h,i[c+2]=h,i[c+3]=t[c+3]}return new ImageData(i,e,n)},kc=s=>{const{data:t,width:e,height:n}=s,i=new Uint8ClampedArray(t.length);for(let a=0;a<n;a++)for(let o=0;o<e;o++){const c=(a*e+o)*4,l=(t[c]+t[c+1]+t[c+2])/3>127?255:0;i[c]=l,i[c+1]=l,i[c+2]=l,i[c+3]=t[c+3]}return new ImageData(i,e,n)},Ic=s=>{const{data:t,width:e,height:n}=s,i=new Uint8ClampedArray(t.length);for(let a=0;a<n;a++)for(let o=0;o<e;o++){const c=(a*e+o)*4;i[c]=255-t[c],i[c+1]=255-t[c+1],i[c+2]=255-t[c+2],i[c+3]=t[c+3]}return new ImageData(i,e,n)},Mc=s=>{const{data:t,width:e,height:n}=s,i=new Uint8ClampedArray(t.length);for(let a=0;a<n;a++)for(let o=0;o<e;o++){const c=(a*e+o)*4;i[c]=t[c],i[c+1]=0,i[c+2]=0,i[c+3]=t[c+3]}return new ImageData(i,e,n)},Rc=s=>{const{data:t,width:e,height:n}=s,i=new Uint8ClampedArray(t.length);for(let a=0;a<n;a++)for(let o=0;o<e;o++){const c=(a*e+o)*4;i[c]=0,i[c+1]=t[c+1],i[c+2]=0,i[c+3]=t[c+3]}return new ImageData(i,e,n)},Oc=s=>{const{data:t,width:e,height:n}=s,i=new Uint8ClampedArray(t.length);for(let a=0;a<n;a++)for(let o=0;o<e;o++){const c=(a*e+o)*4;i[c]=0,i[c+1]=0,i[c+2]=t[c+2],i[c+3]=t[c+3]}return new ImageData(i,e,n)},Lc=s=>{const{data:t,width:e,height:n}=s,i=new Uint8ClampedArray(t.length);for(let a=0;a<n;a++)for(let o=0;o<e;o++){const c=(a*e+o)*4;i[c]=t[c],i[c+1]=t[c+1],i[c+2]=0,i[c+3]=t[c+3]}return new ImageData(i,e,n)},Nc=s=>{const{data:t,width:e,height:n}=s,i=new Uint8ClampedArray(t.length);for(let a=0;a<n;a++)for(let o=0;o<e;o++){const c=(a*e+o)*4;i[c]=t[c],i[c+1]=0,i[c+2]=t[c+1],i[c+3]=t[c+3]}return new ImageData(i,e,n)},Fc=s=>{const{data:t,width:e,height:n}=s,i=new Uint8ClampedArray(t.length);for(let a=0;a<n;a++)for(let o=0;o<e;o++){const c=(a*e+o)*4;i[c]=0,i[c+1]=t[c+1],i[c+2]=t[c+1],i[c+3]=t[c+3]}return new ImageData(i,e,n)},Bc=s=>{const{data:t,width:e,height:n}=s,i=new Uint8ClampedArray(t.length);for(let a=0;a<n;a++)for(let o=0;o<e;o++){const c=(a*e+o)*4,h=(t[c+1]+t[c+2])/2;i[c]=t[c],i[c+1]=h,i[c+2]=h,i[c+3]=t[c+3]}return new ImageData(i,e,n)},Uc=s=>{const{data:t,width:e,height:n}=s,i=new Uint8ClampedArray(t.length);for(let a=0;a<n;a++)for(let o=0;o<e;o++){const c=(a*e+o)*4,h=(t[c]+t[c+2])/2;i[c]=h,i[c+1]=t[c+1],i[c+2]=h,i[c+3]=t[c+3]}return new ImageData(i,e,n)},Vc=s=>{const{data:t,width:e,height:n}=s,i=new Uint8ClampedArray(t.length);for(let a=0;a<n;a++)for(let o=0;o<e;o++){const c=(a*e+o)*4,h=(t[c]+t[c+1])/2;i[c]=h,i[c+1]=h,i[c+2]=t[c+2],i[c+3]=t[c+3]}return new ImageData(i,e,n)},Gc=s=>Hi(s,[-1,-1,-1,-1,9,-1,-1,-1,-1]),zc=s=>Hi(s,[-1,-1,-1,-1,8,-1,-1,-1,-1]),jc=s=>{const{data:t,width:e,height:n}=s,i=new Uint8ClampedArray(t.length);for(let a=0;a<n;a++)for(let o=0;o<e;o++){const c=(a*e+o)*4;i[c]=t[c],i[c+1]=t[c+1],i[c+2]=t[c+2],i[c+3]=255}return new ImageData(i,e,n)},Xc=s=>{const{data:t,width:e,height:n}=s,i=new Uint8ClampedArray(t.length);for(let a=0;a<n;a++)for(let o=0;o<e;o++){const c=(a*e+o)*4;if(t[c+3]===0)i[c]=255,i[c+1]=255,i[c+2]=255,i[c+3]=255;else{const h=Wi([t[c],t[c+1],t[c+2],t[c+3]],[255,255,255,255]);i[c]=h[0],i[c+1]=h[1],i[c+2]=h[2],i[c+3]=h[3]}}return new ImageData(i,e,n)},qc=(s,t,e,n,i,r=!1,a)=>{const{data:o,width:c,height:h}=s;let l=i,f=n,g=t,w=e;if(l<0?l=0:l>c&&(l=c),f<0?f=0:f>h&&(f=h),g<1?g=1:g>c&&(g=c),w<1?w=1:w>h&&(w=h),l+g>c&&(g=c-l),f+w>h&&(w=h-f),r){const m=new Uint8ClampedArray(o.length);for(let b=0;b<h;b++)for(let S=0;S<c;S++){const C=(b*c+S)*4;S>=l&&S<=l+g&&b>=f&&b<=f+w?(m[C]=o[C],m[C+1]=o[C+1],m[C+2]=o[C+2],m[C+3]=o[C+3]):(m[C]=255,m[C+1]=255,m[C+2]=255,m[C+3]=a&&["JPG","JPEG"].includes(a.toUpperCase())?255:0)}return new ImageData(m,c,h)}else{const m=new Uint8ClampedArray(g*w*4);for(let b=f;b<=f+w;b++)for(let S=l;S<=l+g;S++){const C=((b-f)*g+S-l)*4,M=(b*c+S)*4;m[C]=o[M],m[C+1]=o[M+1],m[C+2]=o[M+2],m[C+3]=o[M+3]}return new ImageData(m,g,w)}},Yc=(s,t,e,n)=>{const{data:i,width:r,height:a}=s;let o=t;o>Math.floor(r/2)&&(o=Math.floor(r/2)),o>Math.floor(a/2)&&(o=Math.floor(a/2)),o<0&&(o=0);const c=new Uint8ClampedArray(i.length);for(let l=0;l<a;l++)for(let f=0;f<r;f++){const g=(l*r+f)*4;let w=-1;f<o?l<o?w=Math.sqrt(Math.pow(o-f-1,2)+Math.pow(o-l-1,2)):l>a-o-1&&(w=Math.sqrt(Math.pow(o-f-1,2)+Math.pow(l-(a-o),2))):f>r-o-1&&(l<o?w=Math.sqrt(Math.pow(f-(r-o),2)+Math.pow(o-l-1,2)):l>a-o-1&&(w=Math.sqrt(Math.pow(f-(r-o),2)+Math.pow(l-(a-o),2)))),Math.round(w)>o?(c[g]=255,c[g+1]=255,c[g+2]=255,c[g+3]=n||e.toUpperCase()==="PNG"?0:255):(c[g]=i[g],c[g+1]=i[g+1],c[g+2]=i[g+2],c[g+3]=n||e.toUpperCase()==="PNG"?i[g+3]:255)}return new ImageData(c,r,a)},Hc=(s,t,e,n,i,r=1e4)=>{const a=new Image;a.src=s;const o=document.createElement("canvas"),c=o.getContext("2d");return o.width=r,o.height=r,c.drawImage(a,0,0,t,e,0,0,n,i),c.getImageData(0,0,n,i)},Wc=(s,t)=>{const{data:e,width:n,height:i}=s,r=new Uint8ClampedArray(e.length);for(let o=0;o<i;o++)for(let c=0;c<n;c++){const h=(o*n+c)*4;r[h]=Math.max(Math.min(e[h]+t,255),0),r[h+1]=Math.max(Math.min(e[h+1]+t,255),0),r[h+2]=Math.max(Math.min(e[h+2]+t,255),0),r[h+3]=e[h+3]}return new ImageData(r,n,i)},$c=(s,t,e=!1)=>{const{data:n,width:i,height:r}=s,a=new Uint8ClampedArray(n.length);for(let c=0;c<r;c++)for(let h=0;h<i;h++){const l=(c*i+h)*4;n[l+3]===0?(a[l]=255,a[l+1]=255,a[l+2]=255):(a[l]=n[l],a[l+1]=n[l+1],a[l+2]=n[l+2]);let f=n[l+3];e?f=Math.max(Math.min(Math.floor(255*t),255),0):f=Math.max(Math.min(Math.floor(f+255*t),255),0),a[l+3]=f}return new ImageData(a,i,r)},Jc=(s,t,e,n)=>{const{data:i,width:r,height:a}=s,{data:o,width:c,height:h}=t;let l=e,f=n;e+h>a&&(l=a-h),n+c>r&&(f=r-c);const g=new Uint8ClampedArray(i.length);for(let m=0;m<a;m++)for(let v=0;v<r;v++){const b=(m*r+v)*4;if(v<f||v>f+c||m<=l||m>=l+h)g[b]=i[b],g[b+1]=i[b+1],g[b+2]=i[b+2],g[b+3]=i[b+3];else{const S=(m*r+v-((l+1)*r+(m-(l+1))*(r-c))+c-f-1)*4,C=[o[S],o[S+1],o[S+2],o[S+3]],M=[i[b],i[b+1],i[b+2],i[b+3]],R=Wi(C,M);g[b]=R[0],g[b+1]=R[1],g[b+2]=R[2],g[b+3]=R[3]}}return new ImageData(g,r,a)},Zc=(s,t,e,n,i,r=10)=>{const{data:a,width:o,height:c}=s;let h=i,l=n,f=t,g=e;h<0?h=0:h>o&&(h=o),l<0?l=0:l>c&&(l=c),f<1?f=1:f>o&&(f=o),g<1?g=1:g>c&&(g=c),h+f>o&&(f=o-h),l+g>c&&(g=c-l);const w=new Uint8ClampedArray(a.length);for(let v=0;v<c;v++)for(let b=0;b<o;b++){const S=(v*o+b)*4;if(b>=h&&b<=h+f&&v>=l&&v<=l+g){const C=Math.floor((b-h)/r),M=Math.floor((v-l)/r);let R=Math.floor(r*(C+1)-r/2+h),B=Math.floor(r*(M+1)-r/2+l);R>o-1&&(R=o-1),B>c-1&&(B=c-1);const N=(B*o+R)*4;w[S]=a[N],w[S+1]=a[N+1],w[S+2]=a[N+2],w[S+3]=a[N+3]}else w[S]=a[S],w[S+1]=a[S+1],w[S+2]=a[S+2],w[S+3]=a[S+3]}return new ImageData(w,o,c)},Kc=(s,t,e={backgroundColor:{r:0,g:0,b:0,a:255},changeIntoColor:{r:0,g:0,b:0,a:0}})=>{if(t&&e){const{data:n,width:i,height:r}=s,{data:a}=t,o=new Uint8ClampedArray(n.length),{backgroundColor:c,changeIntoColor:h}=e;for(let f=0;f<r;f++)for(let g=0;g<i;g++){const w=(f*i+g)*4,m=a[w],v=a[w+1],b=a[w+2],S=a[w+3];m===c.r&&v===c.g&&b===c.b&&S===c.a&&h.a!==0?(o[w]=h.r,o[w+1]=h.g,o[w+2]=h.b,o[w+3]=h.a):(o[w]=n[w],o[w+1]=n[w+1],o[w+2]=n[w+2],o[w+3]=n[w+3])}return new ImageData(o,i,r)}return s},Hi=(s,t)=>{const{data:e,width:n,height:i}=s,r=new Uint8ClampedArray(e.length);for(let o=0;o<i;o++)for(let c=0;c<n;c++){const h=(o*n+c)*4;for(let l=0;l<3;l++){const f=h+l;c===0||c===n-1||o===0||o===i-1?r[f]=e[f]:r[f]=t[0]*e[f-n*4-4]+t[1]*e[f-n*4]+t[2]*e[f-n*4+4]+t[3]*e[f-4]+t[4]*e[f]+t[5]*e[f+4]+t[6]*e[f+n*4-4]+t[7]*e[f+n*4]+t[8]*e[f+n*4+4]}r[h+3]=e[h+3]}return new ImageData(r,n,i)},Wi=(s,t)=>{if(s&&s.length===4&&t&&t.length===4){const e=s[3],n=t[3];if(e===255||n===0)return s;if(e===0)return t;{const i=e/255,r=n/255,a=Math.max(Math.min(Math.floor(s[0]*i+t[0]*r*(1-i)),255),0),o=Math.max(Math.min(Math.floor(s[1]*i+t[1]*r*(1-i)),255),0),c=Math.max(Math.min(Math.floor(s[2]*i+t[2]*r*(1-i)),255),0),h=Math.max(Math.min(Math.floor((i+r*(1-i))*255),255),0);return[a,o,c,h]}}return[255,255,255,255]},es=function(){const s=[];return{writeByte(t){s.push(t&255)},writeShort(t){this.writeByte(t),this.writeByte(t>>>8)},writeBytes(t,e=0,n=t.length){for(let i=0;i<n;i++)this.writeByte(t[i+e])},writeString(t){for(let e=0,n=t.length;e<n;e++)this.writeByte(t.charCodeAt(e))},toByteArray(){return s},toString(){let t="[";for(let e=0,n=s.length;e<n;e++)e>0&&(t+=","),t+=s[e];return t+="]",t}}},$i=function(){let s=0,t=0,e=0,n="";const i=function(a){if(!(a<0)){if(a<26)return 65+a;if(a<52)return 97+(a-26);if(a<62)return 48+(a-52);if(a==62)return 43;if(a==63)return 47}throw new Error("n:"+a)},r=function(a){n+=String.fromCharCode(i(a&63))};return{writeByte(a){for(s=s<<8|a&255,t+=8,e+=1;t>=6;)r(s>>>t-6),t-=6},flush(){if(t>0&&(r(s<<6-t),s=0,t=0),e%3!=0){const a=3-e%3;for(let o=0;o<a;o++)n+="="}},toString(){return n}}},Ji=function(s,t,e){const n=new Array(s*s),i=function(o){const c=o;let h=0,l=0;return{write(f,g){if(f>>>g)throw new Error("length over");for(;h+g>=8;)c.writeByte(255&(f<<h|l)),g-=8-h,f>>>=8-h,l=0,h=0;l=f<<h|l,h=h+g},flush(){h>0&&c.writeByte(l)}}},r=function(o){const c=1<<o,h=(1<<o)+1;let l=o+1;const f=a();for(let b=0;b<c;b++)f.add(String.fromCharCode(b));f.add(String.fromCharCode(c)),f.add(String.fromCharCode(h));const g=es(),w=i(g);w.write(c,l);let m=0,v=String.fromCharCode(n[m]);for(m+=1;m<n.length;){const b=String.fromCharCode(n[m]);m+=1,f.contains(v+b)?v=v+b:(w.write(f.indexOf(v),l),f.size()<4095&&(f.size()==1<<l&&(l+=1),f.add(v+b)),v=b)}return w.write(f.indexOf(v),l),w.write(h,l),w.flush(),g.toByteArray()},a=function(){const o={};let c=0;return{add(h){if(this.contains(h))throw new Error("dup key:"+h);o[h]=c,c+=1},size(){return c},indexOf(h){return o[h]},contains(h){return typeof o[h]<"u"}}};return{setPixel(o,c,h){n[c*s+o]=h},write(o){o.writeString("GIF87a"),o.writeShort(s),o.writeShort(s),o.writeByte(128),o.writeByte(0),o.writeByte(0),o.writeByte($t("0x"+t[1]+t[2])),o.writeByte($t("0x"+t[3]+t[4])),o.writeByte($t("0x"+t[5]+t[6])),o.writeByte($t("0x"+e[1]+e[2])),o.writeByte($t("0x"+e[3]+e[4])),o.writeByte($t("0x"+e[5]+e[6])),o.writeString(","),o.writeShort(0),o.writeShort(0),o.writeShort(s),o.writeShort(s),o.writeByte(0);const c=2,h=r(c);o.writeByte(c);let l=0;for(;h.length-l>255;)o.writeByte(255),o.writeBytes(h,l,255),l+=255;o.writeByte(h.length-l),o.writeBytes(h,l,h.length-l),o.writeByte(0),o.writeString(";")}}},Zi=function(s,t,e,n){const i=Ji(s,t,e);for(let h=0;h<s;h++)for(let l=0;l<s;l++)i.setPixel(l,h,n(l,h));const r=es();i.write(r);const a=$i(),o=r.toByteArray();for(let h=0,l=o.length;h<l;h++)a.writeByte(o[h]);a.flush();let c="";return c+="data:image/gif;base64,",c+=a,c},pt={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},Ce={M:0,L:1,H:2,Q:3},qt={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},et={glog:function(s){if(s<1)throw new Error("glog("+s+")");return et.LOG_TABLE[s]},gexp:function(s){for(;s<0;)s+=255;for(;s>=256;)s-=255;return et.EXP_TABLE[s]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)};for(let s=0;s<8;s++)et.EXP_TABLE[s]=1<<s;for(let s=8;s<256;s++)et.EXP_TABLE[s]=et.EXP_TABLE[s-4]^et.EXP_TABLE[s-5]^et.EXP_TABLE[s-6]^et.EXP_TABLE[s-8];for(let s=0;s<255;s++)et.LOG_TABLE[et.EXP_TABLE[s]]=s;const X={PATTERN_POSITION_TABLE:[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],G15:1335,G18:7973,G15_MASK:21522,getBCHTypeInfo:function(s){let t=s<<10;for(;X.getBCHDigit(t)-X.getBCHDigit(X.G15)>=0;)t^=X.G15<<X.getBCHDigit(t)-X.getBCHDigit(X.G15);return(s<<10|t)^X.G15_MASK},getBCHTypeNumber:function(s){let t=s<<12;for(;X.getBCHDigit(t)-X.getBCHDigit(X.G18)>=0;)t^=X.G18<<X.getBCHDigit(t)-X.getBCHDigit(X.G18);return s<<12|t},getBCHDigit:function(s){let t=0;for(;s!=0;)t++,s>>>=1;return t},getPatternPosition:function(s){return X.PATTERN_POSITION_TABLE[s-1]},getMask:function(s,t,e){switch(s){case qt.PATTERN000:return(t+e)%2==0;case qt.PATTERN001:return t%2==0;case qt.PATTERN010:return e%3==0;case qt.PATTERN011:return(t+e)%3==0;case qt.PATTERN100:return(Math.floor(t/2)+Math.floor(e/3))%2==0;case qt.PATTERN101:return t*e%2+t*e%3==0;case qt.PATTERN110:return(t*e%2+t*e%3)%2==0;case qt.PATTERN111:return(t*e%3+(t+e)%2)%2==0;default:throw new Error("bad maskPattern:"+s)}},getErrorCorrectPolynomial:function(s){let t=new ae([1],0);for(let e=0;e<s;e++)t=t.multiply(new ae([1,et.gexp(e)],0));return t},getLengthInBits:function(s,t){if(1<=t&&t<10)switch(s){case pt.MODE_NUMBER:return 10;case pt.MODE_ALPHA_NUM:return 9;case pt.MODE_8BIT_BYTE:return 8;case pt.MODE_KANJI:return 8;default:throw new Error("mode:"+s)}else if(t<27)switch(s){case pt.MODE_NUMBER:return 12;case pt.MODE_ALPHA_NUM:return 11;case pt.MODE_8BIT_BYTE:return 16;case pt.MODE_KANJI:return 10;default:throw new Error("mode:"+s)}else if(t<41)switch(s){case pt.MODE_NUMBER:return 14;case pt.MODE_ALPHA_NUM:return 13;case pt.MODE_8BIT_BYTE:return 16;case pt.MODE_KANJI:return 12;default:throw new Error("mode:"+s)}else throw new Error("type:"+t)},getLostPoint:function(s){const t=s.getModuleCount();let e=0;for(let r=0;r<t;r++)for(let a=0;a<t;a++){let o=0;const c=s.isDark(r,a);for(let h=-1;h<=1;h++)if(!(r+h<0||t<=r+h))for(let l=-1;l<=1;l++)a+l<0||t<=a+l||h==0&&l==0||c==s.isDark(r+h,a+l)&&o++;o>5&&(e+=3+o-5)}for(let r=0;r<t-1;r++)for(let a=0;a<t-1;a++){let o=0;s.isDark(r,a)&&o++,s.isDark(r+1,a)&&o++,s.isDark(r,a+1)&&o++,s.isDark(r+1,a+1)&&o++,(o==0||o==4)&&(e+=3)}for(let r=0;r<t;r++)for(let a=0;a<t-6;a++)s.isDark(r,a)&&!s.isDark(r,a+1)&&s.isDark(r,a+2)&&s.isDark(r,a+3)&&s.isDark(r,a+4)&&!s.isDark(r,a+5)&&s.isDark(r,a+6)&&(e+=40);for(let r=0;r<t;r++)for(let a=0;a<t-6;a++)s.isDark(a,r)&&!s.isDark(a+1,r)&&s.isDark(a+2,r)&&s.isDark(a+3,r)&&s.isDark(a+4,r)&&!s.isDark(a+5,r)&&s.isDark(a+6,r)&&(e+=40);let n=0;for(let r=0;r<t;r++)for(let a=0;a<t;a++)s.isDark(a,r)&&n++;const i=Math.abs(100*n/t/t-50)/5;return e+=i*10,e}};class ae{num;constructor(t,e){if(t.length==null)throw new Error(t.length+"/"+e);let n=0;for(;n<t.length&&t[n]==0;)n++;this.num=new Array(t.length-n+e);for(let i=0;i<t.length-n;i++)this.num[i]=t[i+n]}get(t){return this.num[t]}getLength(){return this.num.length}multiply(t){const e=new Array(this.getLength()+t.getLength()-1);for(let n=0;n<this.getLength();n++)for(let i=0;i<t.getLength();i++)e[n+i]^=et.gexp(et.glog(this.get(n))+et.glog(t.get(i)));return new ae(e,0)}mod(t){if(this.getLength()-t.getLength()<0)return this;const e=et.glog(this.get(0))-et.glog(t.get(0)),n=new Array(this.getLength());for(let i=0;i<this.getLength();i++)n[i]=this.get(i);for(let i=0;i<t.getLength();i++)n[i]^=et.gexp(et.glog(t.get(i))+e);return new ae(n,0).mod(t)}}class Bt{totalCount;dataCount;constructor(t,e){this.totalCount=t,this.dataCount=e}static RS_BLOCK_TABLE=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]];static getRSBlocks(t,e){const n=Bt.getRsBlockTable(t,e);if(n==null)throw new Error("bad rs block @ typeNumber:"+t+"/errorCorrectLevel:"+e);const i=n.length/3,r=[];for(let a=0;a<i;a++){const o=n[a*3+0],c=n[a*3+1],h=n[a*3+2];for(let l=0;l<o;l++)r.push(new Bt(c,h))}return r}static getRsBlockTable(t,e){switch(e){case Ce.L:return Bt.RS_BLOCK_TABLE[(t-1)*4+0];case Ce.M:return Bt.RS_BLOCK_TABLE[(t-1)*4+1];case Ce.Q:return Bt.RS_BLOCK_TABLE[(t-1)*4+2];case Ce.H:return Bt.RS_BLOCK_TABLE[(t-1)*4+3];default:return}}}class Ki{buffer;length;constructor(){this.buffer=[],this.length=0}get(t){const e=Math.floor(t/8);return(this.buffer[e]>>>7-t%8&1)==1}put(t,e){for(let n=0;n<e;n++)this.putBit((t>>>e-n-1&1)==1)}getLengthInBits(){return this.length}putBit(t){const e=Math.floor(this.length/8);this.buffer.length<=e&&this.buffer.push(0),t&&(this.buffer[e]|=128>>>this.length%8),this.length++}}class Qc{mode;data;constructor(t){this.mode=pt.MODE_8BIT_BYTE,this.data=t}getLength(){return this.data.length}write(t){for(let e=0,n=this.data.length;e<n;e++)t.put(this.data.charCodeAt(e),8)}}class Yt{static PAD0=236;static PAD1=17;typeNumber;errorCorrectLevel;modules;moduleCount;dataCache;dataList;constructor(t,e){this.typeNumber=t,this.errorCorrectLevel=Ce[e],this.modules=[],this.moduleCount=0,this.dataCache=null,this.dataList=[]}addData(t){const e=new Qc(t);this.dataList.push(e),this.dataCache=null}isDark(t,e){if(t<0||this.moduleCount<=t||e<0||this.moduleCount<=e)throw new Error(t+","+e);return this.modules[t][e]}getModuleCount(){return this.moduleCount}make(){if(this.typeNumber<1){let t=1;for(t=1;t<40;t++){const e=Bt.getRSBlocks(t,this.errorCorrectLevel),n=new Ki;let i=0;for(let r=0;r<e.length;r++)i+=e[r].dataCount;for(let r=0;r<this.dataList.length;r++){const a=this.dataList[r];n.put(a.mode,4),n.put(a.getLength(),X.getLengthInBits(a.mode,t)),a.write(n)}if(n.getLengthInBits()<=i*8)break}this.typeNumber=t}this.makeImpl(!1,this.getBestMaskPattern())}makeImpl(t,e){this.moduleCount=this.typeNumber*4+17,this.modules=new Array(this.moduleCount);for(let n=0;n<this.moduleCount;n++){this.modules[n]=new Array(this.moduleCount);for(let i=0;i<this.moduleCount;i++)this.modules[n][i]=null}this.setupPositionProbePattern(0,0),this.setupPositionProbePattern(this.moduleCount-7,0),this.setupPositionProbePattern(0,this.moduleCount-7),this.setupPositionAdjustPattern(),this.setupTimingPattern(),this.setupTypeInfo(t,e),this.typeNumber>=7&&this.setupTypeNumber(t),this.dataCache==null&&(this.dataCache=Yt.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,e)}setupPositionProbePattern(t,e){for(let n=-1;n<=7;n++)if(!(t+n<=-1||this.moduleCount<=t+n))for(let i=-1;i<=7;i++)e+i<=-1||this.moduleCount<=e+i||(0<=n&&n<=6&&(i==0||i==6)||0<=i&&i<=6&&(n==0||n==6)||2<=n&&n<=4&&2<=i&&i<=4?this.modules[t+n][e+i]=!0:this.modules[t+n][e+i]=!1)}getBestMaskPattern(){let t=0,e=0;for(let n=0;n<8;n++){this.makeImpl(!0,n);const i=X.getLostPoint(this);(n==0||t>i)&&(t=i,e=n)}return e}createMovieClip(t,e,n){const i=t.createEmptyMovieClip(e,n),r=1;this.make();for(let a=0;a<this.modules.length;a++){const o=a*r;for(let c=0;c<this.modules[a].length;c++){const h=c*r;this.modules[a][c]&&(i.beginFill(0,100),i.moveTo(h,o),i.lineTo(h+r,o),i.lineTo(h+r,o+r),i.lineTo(h,o+r),i.endFill())}}return i}setupTimingPattern(){for(let t=8;t<this.moduleCount-8;t++)this.modules[t][6]==null&&(this.modules[t][6]=t%2==0);for(let t=8;t<this.moduleCount-8;t++)this.modules[6][t]==null&&(this.modules[6][t]=t%2==0)}setupPositionAdjustPattern(){const t=X.getPatternPosition(this.typeNumber);for(let e=0;e<t.length;e++)for(let n=0;n<t.length;n++){const i=t[e],r=t[n];if(this.modules[i][r]==null)for(let a=-2;a<=2;a++)for(let o=-2;o<=2;o++)a==-2||a==2||o==-2||o==2||a==0&&o==0?this.modules[i+a][r+o]=!0:this.modules[i+a][r+o]=!1}}setupTypeNumber(t){const e=X.getBCHTypeNumber(this.typeNumber);for(let n=0;n<18;n++){const i=!t&&(e>>n&1)==1;this.modules[Math.floor(n/3)][n%3+this.moduleCount-8-3]=i}for(let n=0;n<18;n++){const i=!t&&(e>>n&1)==1;this.modules[n%3+this.moduleCount-8-3][Math.floor(n/3)]=i}}setupTypeInfo(t,e){const n=this.errorCorrectLevel<<3|e,i=X.getBCHTypeInfo(n);for(let r=0;r<15;r++){const a=!t&&(i>>r&1)==1;r<6?this.modules[r][8]=a:r<8?this.modules[r+1][8]=a:this.modules[this.moduleCount-15+r][8]=a}for(let r=0;r<15;r++){const a=!t&&(i>>r&1)==1;r<8?this.modules[8][this.moduleCount-r-1]=a:r<9?this.modules[8][15-r-1+1]=a:this.modules[8][15-r-1]=a}this.modules[this.moduleCount-8][8]=!t}mapData(t,e){let n=-1,i=this.moduleCount-1,r=7,a=0;for(let o=this.moduleCount-1;o>0;o-=2)for(o==6&&o--;;){for(let c=0;c<2;c++)if(this.modules[i][o-c]==null){let h=!1;a<t.length&&(h=(t[a]>>>r&1)==1),X.getMask(e,i,o-c)&&(h=!h),this.modules[i][o-c]=h,r--,r==-1&&(a++,r=7)}if(i+=n,i<0||this.moduleCount<=i){i-=n,n=-n;break}}}static createData(t,e,n){const i=Bt.getRSBlocks(t,e),r=new Ki;for(let o=0;o<n.length;o++){const c=n[o];r.put(c.mode,4),r.put(c.getLength(),X.getLengthInBits(c.mode,t)),c.write(r)}let a=0;for(let o=0;o<i.length;o++)a+=i[o].dataCount;if(r.getLengthInBits()>a*8)throw new Error("code length overflow. ("+r.getLengthInBits()+">"+a*8+")");for(r.getLengthInBits()+4<=a*8&&r.put(0,4);r.getLengthInBits()%8!=0;)r.putBit(!1);for(;!(r.getLengthInBits()>=a*8||(r.put(Yt.PAD0,8),r.getLengthInBits()>=a*8));)r.put(Yt.PAD1,8);return Yt.createBytes(r,i)}static createBytes(t,e){let n=0,i=0,r=0;const a=new Array(e.length),o=new Array(e.length);for(let f=0;f<e.length;f++){const g=e[f].dataCount,w=e[f].totalCount-g;i=Math.max(i,g),r=Math.max(r,w),a[f]=new Array(g);for(let S=0;S<a[f].length;S++)a[f][S]=255&t.buffer[S+n];n+=g;const m=X.getErrorCorrectPolynomial(w),b=new ae(a[f],m.getLength()-1).mod(m);o[f]=new Array(m.getLength()-1);for(let S=0;S<o[f].length;S++){const C=S+b.getLength()-o[f].length;o[f][S]=C>=0?b.get(C):0}}let c=0;for(let f=0;f<e.length;f++)c+=e[f].totalCount;const h=new Array(c);let l=0;for(let f=0;f<i;f++)for(let g=0;g<e.length;g++)f<a[g].length&&(h[l++]=a[g][f]);for(let f=0;f<r;f++)for(let g=0;g<e.length;g++)f<o[g].length&&(h[l++]=o[g][f]);return h}}const Qi=Math.ceil,Te=Math.floor,tr=Math.round;function th(s,t){const e=As(s),n=t?.ecc||"H",i=t?.size||256,r=-1,a=t?.padding||0,o=t?.color||"#000000",c=t?.background||"#ffffff",h=new Yt(r,n);h.addData(e),h.make();const l=h.getModuleCount(),f=(i-a*2)/l,g=a,w=i-a;return Zi(i,o,c,function(m,v){if(g<=m&&m<w&&g<=v&&v<w){const b=Te((m-g)/f),S=Te((v-g)/f);return h.isDark(S,b)?0:1}else return 1})}function eh(s,t){const e=t.x||0,n=t.y||0,i=As(s),r=t.ctx,a=t.ecc||"H",o=typeof t.size=="number"?Te(t.size):256,c=t.padding||0,h=-1,l=t.color||"#000000",f=t.background||"#ffffff",g=new Yt(h,a);g.addData(i),g.make();const w=g.getModuleCount(),m=(o-c*2)/w;r.fillStyle=f,r.fillRect(e,n,o,o);for(let v=0;v<w;v++)for(let b=0;b<w;b++){const S=Qi((b+1)*m)-Te(b*m),C=Qi((v+1)*m)-Te(v*m);r.fillStyle=g.isDark(v,b)?l:f,r.fillRect(e+tr(b*m)+c,n+tr(v*m)+c,S,C)}}let rn;const er=new WeakMap;function ns(s,t){let e=er.get(s);e||(e=new Map,er.set(s,e));let n=e.get(t);return n||(n=new nr,e.set(t,n)),n}class nr{subscribers;constructor(){this.subscribers=new Set}depend(){rn&&this.subscribers.add(rn)}notify(){this.subscribers.forEach(t=>t())}}function nh(s){rn=s,s(),rn=null}function sh(s){return Object.keys(s).forEach(t=>{let e=s[t];const n=ns(s,t);Object.defineProperty(s,t,{get(){return n.depend(),e},set(i){i!=e&&(e=i,n.notify())}})}),s}function sr(s){return new Proxy(s,{get(t,e,n){return ns(s,e).depend(),Reflect.get(t,e,n)},set(t,e,n,i){const r=ns(s,e);return s[e]!=n&&(s[e]=n,r.notify()),Reflect.set(t,e,n,i)}})}const ih=sr;class an{x;y;z;constructor(t=[0,0,0],e=[0,0,0]){const[n,i,r]=t,[a,o,c]=e;this.x=n-a,this.y=i-o,this.z=r-c}get length(){const{x:t,y:e,z:n}=this;return Math.sqrt(t*t+e*e+n*n)}unit(){const t=this.length;return new an([this.x/t,this.y/t,this.z/t])}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z}cross(t){const e=this.x,n=this.y,i=this.z,r=t.x,a=t.y,o=t.z;return new an([n*o-i*a,i*r-e*o,e*a-r*n])}}class oe extends J{shapes=[];constructor(t){super(t)}toSVGPathData(){return this.shapes.reduce((t,e,n)=>{const i=e.toSVGPathData();return Array.isArray(i[0])?t.push(...i):t.push(i),t},[])}toCanvasContext(t){}}class ir extends ri{currentItem={};items=[];groups=[];globalStyles={};grad={};idtops={};text="";constructor(t){super(t),this.on("tag",(e,n)=>{switch(this.text="",this.currentItem={type:e},e){case"g":this.groups.push(this.currentItem);break}this.processAttrs(e,n)}),this.on("text",e=>{if(this.currentItem.type=="style"){try{const n=qr(e);for(let i of n.stylesheet.rules)for(let r of i.declarations)for(let a of i.selectors)this.globalStyles[a]=this.globalStyles[a]||[],this.globalStyles[a].push(`${r.property}:${r.value}`)}catch{console.error("CAN'T parse css text: "+e)}return}this.text+=e}),this.on("/tag",(e,n)=>{let i=this.groups.length;for(;i--;)if(this.groups[i]!=this.currentItem){let r="",a="";for(let o in this.groups[i])o=="transform"?r=this.groups[i].transform:o=="class"&&this.globalStyles["."+this.groups[i][o]]?a=this.globalStyles["."+this.groups[i][o]].join(";")+";"+a:o=="id"&&this.globalStyles["#"+this.groups[i][o]]?a=this.globalStyles["#"+this.groups[i][o]].join(";")+";"+a:typeof this.currentItem[o]>"u"&&(this.currentItem[o]=this.groups[i][o]);typeof this.currentItem.transform>"u"?this.currentItem.transform=r:this.currentItem.transform+=" "+r,typeof this.currentItem.style>"u"?this.currentItem.style=a:this.currentItem.style=a+this.currentItem.style,this.currentItem.class&&this.globalStyles["."+this.currentItem.class]?this.currentItem.style=this.globalStyles["."+this.currentItem.class].join(";")+";"+this.currentItem.style:this.currentItem.id&&this.globalStyles["#"+this.currentItem.id]&&(this.currentItem.style=this.globalStyles["#"+this.currentItem.id].join(";")+";"+this.currentItem.style),is(this.currentItem.style,this.currentItem,rs)}switch(this.processAttrs(e,n),e){case"g":this.groups.pop();break;case"cirlce":this.addToItems();break;case"ellipse":this.addToItems();break;case"polygon":this.addToItems();break;case"path":this.addToItems();break;case"line":this.addToItems();break;case"rect":this.addToItems();break;case"image":this.addToItems();break;case"text":this.currentItem.text=this.text,this.currentItem["text-anchor"]=this.currentItem["text-anchor"]||"start",this.addToItems();break}}),this.on("finish",()=>{this.emit("result",this.items)})}parse(){return super.parse(),this.items}processAttrs(t,e){let n=[],i;switch(t){case"svg":let r="",a="";if(e.width&&e.height)r=e.width,a=e.height;else if(e.viewBox){const o=e.viewBox.split(/\s+/gi);o.length==4&&(r=String(parseFloat(o[2])-parseFloat(o[0])),a=String(parseFloat(o[3])-parseFloat(o[1])))}r&&a&&this.items.push({type:"viewbox",width:r,height:a});break;case"line":typeof e.x1=="number"&&typeof e.y1=="number"&&typeof e.x2=="number"&&typeof e.y2=="number"&&(this.currentItem.path="M"+[e.x1,e.y1,e.x2,e.y2]);break;case"stop":i={},e.style&&is(e.style,i),i.offset=i.offset||e.offset,i.color=i["stop-color"]||e["stop-color"],i.opacity=i["stop-opacity"]||e["stop-opacity"],~(i.offset+"").indexOf("%")?i.offset=parseFloat(i.offset):i.offset=parseFloat(i.offset)*100,i.offset=+i.offset.toFixed(2),this.grad.stops.push(i);break;case"linearGradient":this.grad.angle=(360+ss(parseFloat(e.x1),parseFloat(e.y1),parseFloat(e.x2),parseFloat(e.y2),parseFloat(e.x1)+100,parseFloat(e.y1))).toFixed(2),n=[this.grad.angle];for(let o=0,c=this.grad.stops.length;o<c;o++)i=this.grad.stops[o],o&&o!=c-1?n.push(i.color+":"+i.offset):n.push(i.color);this.idtops[this.grad.id]=n.join("-"),this.items.forEach(o=>{o.fillid==this.grad.id&&(o.fill=this.idtops[this.grad.id])});break;case"radialGradient":n=[];for(let o=0,c=this.grad.stops.length;o<c;o++)i=this.grad.stops[o],o&&o!=c-1?n.push(i.color+":"+i.offset):n.push(i.color);this.idtops[this.grad.id]=n.join("-"),this.items.forEach(o=>{o.fillid==this.grad.id&&(o.fill=this.idtops[this.grad.id])});break}for(let r in e){const a=e[r];if(rs.includes(r)&&(this.currentItem[r]=a),r==="id"&&(this.currentItem.type==="linearGradient"&&(this.grad={id:r,stops:[]}),this.currentItem.type==="radialGradient"&&(this.grad={id:r,stops:[]})),r==="style"&&is(a,this.currentItem,rs),r==="transform"&&(this.currentItem.transform=a+(this.currentItem.transform||" ")),r==="fill"){const o=a.match(/url\(#([^)]+)\)/);if(o){const c=o[1];this.currentItem.fillid=c,this.idtops[c]&&(this.currentItem.fill=this.idtops[c])}}r==="points"&&this.currentItem.type=="polygon"&&(this.currentItem.path="M"+a+"z"),r==="d"&&this.currentItem.type=="path"&&(this.currentItem.path=a),r==="xlink:href"&&this.currentItem.type=="image"&&(this.currentItem.src=a)}}addToItems(){this.items.push(this.currentItem)}}function ss(s,t,e,n,i,r){if(typeof i>"u"||typeof r>"u"){const a=s-e,o=t-n;return!a&&!o?0:(180+Math.atan2(-o,-a)*180/Math.PI+360)%360}else return ss(s,t,i,r)-ss(e,n,i,r)}function is(s,t,e){const n=(s+"").split(";"),i=/^\s+|\s+$/g;for(let r=0,a=n.length;r<a;r++){let o=n[r].split(":"),c=o[0].replace(i,"").replace(/[A-Z]/g,function(h){return"-"+h.toLowerCase()});(!e||e.includes(c))&&(t[c]=o[1].replace(i,""))}}const rs=["id","class","viewBox","width","height","x","y","cx","cy","r","rx","ry","cursor","opacity","src","fill","fill-opacity","stroke","stroke-dasharray","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-anchor","font","font-family","font-size","font-style","font-weight","letter-spacing"];class rh{app;rootEl;shapes=[];allShapes=[];isMouseDown=!1;currentMouseInShapeID="";currentEnableDragMouseInShapeID="";constructor(t,e,n){this.app=t,this.rootEl=H.createSVGElement("svg"),D.empty(this.app.container),D.insert(this.app.container,this.rootEl),e&&n?this.setSize(e,n):(this.setSize(this.app.width,this.app.height),this.app.on("resize",()=>{this.setSize(this.app.width,this.app.height)})),this.app.captureMove({start:()=>{this.isMouseDown=!0,this.setCursor()},end:()=>{this.isMouseDown=!1,this.setCursor()},move:()=>{if(this.currentMouseInShapeID="",this.isMouseDown&&this.currentEnableDragMouseInShapeID){this.setCursor();return}let i=0,r=this.shapes.length;for(;i<r;i++){const a=this.shapes[i];if(!(a instanceof z))continue;const o=a.isPointInPath(this.app.mousePoint.x,this.app.mousePoint.y,this.rootEl)||!1;if(o&&(this.currentMouseInShapeID=a.id),a.mouseMove&&a.mouseMove(o),o&&a.enableDrag){this.currentEnableDragMouseInShapeID=a.id;break}}i>=r&&(this.currentEnableDragMouseInShapeID=""),this.setCursor()}})}setCursor(){this.currentEnableDragMouseInShapeID?(this.app.container.style.cursor="grab",this.isMouseDown&&(this.app.container.style.cursor="grabbing")):this.currentMouseInShapeID?this.app.container.style.cursor="pointer":this.app.container.style.cursor="default"}setSize(t,e){return D.attribute(this.rootEl,{viewBox:`0 0 ${t} ${e}`,width:`${t}`,height:`${e}`}),this}download(){return H.downloadFromSVGElement(this.rootEl)}attr(t,e,n){const i=t.el||t;if(!(i instanceof SVGElement))return this;if(e===void 0&&n===void 0)return D.attribute(i);if(typeof e=="string"&&n===void 0)return D.attribute(i,ft(e))||"";if(typeof e=="object"){const r=D.attribute(i);if(D.attribute(i,e),t instanceof J){t.attrs={...e};for(let a in e)ft(a)===r[ft(a)]&&delete r[ft(a)];for(let a in r)a!=="d"&&a!=="fill"&&a!=="stroke"&&D.removeAttribute(i,a)}}else typeof e=="string"&&n!==void 0&&(D.attribute(i,ft(e),n),t instanceof J&&(t.attrs[ft(e)]=n));return this}path(t,e){const n=typeof e?.addToShapes=="boolean"?e?.addToShapes:!0;if(t instanceof cs){t.el=this.text(t.text,t.x,t.y),this.attr(t.el,t.attrs),this.allShapes.push(t);return}if(t instanceof bt){const r=`M ${t.fromX} ${t.fromY} `+t.toSVGPathD();t.el=H.createSvgPath(r),D.insert(this.rootEl,t.el),this.update(t),this.allShapes.push(t),n&&this.shapes.push(t);return}if(t instanceof _e){t.shapes.forEach(r=>{r.el=H.createSvgPath(r.toSVGPathD()),D.insert(this.rootEl,r.el),this.update(r),this.allShapes.push(r),n&&this.shapes.push(r)});return}if(t instanceof oe){t.shapes.forEach(r=>this.path(r,e));return}let i;return t instanceof z?i=t:t instanceof J?i=z.fromShape(t):(i=z.fromSVGPathD(t||"M0,0"),Ve(i,e||{})),i.el=H.createSvgPath(i.toSVGPathD()),D.insert(this.rootEl,i.el),this.update(i),this.allShapes.push(i),n&&this.shapes.push(i),i}update(t){if(!t)return;const e=[];t instanceof oe?e.push(...t.shapes):e.push(t),e.forEach(n=>{if(n instanceof z){if(n.followMouse&&(!ue(n.x,this.app.mousePoint.x,5)||!ue(n.y,this.app.mousePoint.y,5))&&(n.angleTo(this.app.mousePoint),n.followTo(this.app.mousePoint)),n.targetToAfterDragFree&&(this.isMouseDown||n.nextFrameEaseTo(new mt({x:n.targetToAfterDragFree.targetX,y:n.targetToAfterDragFree.targetY}),{easing:n.targetToAfterDragFree?.easing})),this.isMouseDown&&this.currentEnableDragMouseInShapeID==n.id){const{dx:i,dy:r}=n.centerDiff;n.x=this.app.mousePoint.x,n.y=this.app.mousePoint.y,n.x-=i,n.y-=r,n.isDragging=!0,this.shapes.filter(a=>a.id!=n.id).forEach(a=>{a instanceof J&&(a.isDragging=!1)})}n.updateTransform()}(n instanceof bt||n instanceof z)&&(this.attr(n,"d",n instanceof bt?`M ${n.fromX} ${n.fromY} `+n.toSVGPathD():n.toSVGPathD()),this.attr(n,n.attrs)),n.el&&(n.isShow?D.show(n.el):D.hide(n.el))})}click(t){const e=()=>{this.shapes.forEach(n=>{n instanceof z&&n.isPointInPath(this.app.mousePoint.x,this.app.mousePoint.y,this.rootEl)&&t(n)})};return this.app.on("tap",e),()=>{this.app.off("tap",e)}}delete(t){t.el&&D.remove(t.el),this.shapes=this.shapes.filter(e=>e.id!=t.id),this.allShapes=this.allShapes.filter(e=>e.id!=t.id)}clear(){this.allShapes.forEach(t=>{t instanceof SVGElement?D.remove(t):t.el&&D.remove(t.el)}),this.shapes=[],this.allShapes=[]}pathRosetta(t,e,n,i,r){if(r==0)throw new Error("no dividing by zero, please");const a=new z({x:t,y:e}),o=360/r;for(let c=0;c<r;c+=1){const h=o*c*Math.PI/180,l=t+2*n*Math.cos(h),f=e+2*n*Math.sin(h);a.appendLine(new ce({x:l,y:f,rx:n,ry:i,xAxisRotate:o*c,largeArcFlag:1,sweepFlag:1})),a.appendLine(new ce({x:t,y:e,rx:n,ry:i,xAxisRotate:o*c,largeArcFlag:1,sweepFlag:1}))}return this.path(a),a}trailPath(t,e,n=0){const i=t.getTotalLength();return this.attr(e,"d",t.getSubpath(0,n*i).toSVGPathD()),t.getPointAtLength(n*i)}circle(t,e,n){return this.path(new mt({x:t,y:e,radius:n}))}circleEl(t,e,n){const i=H.createSVGElement("circle",{cx:String(t),cy:String(e),r:String(n)});return D.insert(this.rootEl,i),i}ellipse(t,e,n,i){return this.path(new ar({x:t,y:e,rx:n,ry:i}))}ellipseEl(t,e,n,i){const r=H.createSVGElement("ellipse",{cx:String(t),cy:String(e),rx:String(n),ry:String(i)});return D.insert(this.rootEl,r),r}rect(t,e,n,i){return this.path(new Pt({x:t,y:e,width:n,height:i}))}rectEl(t,e,n,i){const r=H.createSVGElement("rect",{x:String(t),y:String(e),width:String(n),height:String(i)});return D.insert(this.rootEl,r),r}image(t,e,n,i,r){}text(t,e,n,i="1.2em"){const r=H.createSVGElement("text",{x:String(e),y:String(n)});return t.split(`
|
|
41
|
+
`).forEach((a,o)=>{if(a.trim()){const c=H.createSVGElement("tspan",{x:String(e),dy:o>0?i:"0"});D.html(c,a),D.insert(r,c),this.attr(c,{"alignment-baseline":"middle"})}}),D.insert(this.rootEl,r),r}}const rr=ah("50,nbsp,51,iexcl,52,cent,53,pound,54,curren,55,yen,56,brvbar,57,sect,58,uml,59,copy,5a,ordf,5b,laquo,5c,not,5d,shy,5e,reg,5f,macr,5g,deg,5h,plusmn,5i,sup2,5j,sup3,5k,acute,5l,micro,5m,para,5n,middot,5o,cedil,5p,sup1,5q,ordm,5r,raquo,5s,frac14,5t,frac12,5u,frac34,5v,iquest,60,Agrave,61,Aacute,62,Acirc,63,Atilde,64,Auml,65,Aring,66,AElig,67,Ccedil,68,Egrave,69,Eacute,6a,Ecirc,6b,Euml,6c,Igrave,6d,Iacute,6e,Icirc,6f,Iuml,6g,ETH,6h,Ntilde,6i,Ograve,6j,Oacute,6k,Ocirc,6l,Otilde,6m,Ouml,6n,times,6o,Oslash,6p,Ugrave,6q,Uacute,6r,Ucirc,6s,Uuml,6t,Yacute,6u,THORN,6v,szlig,70,agrave,71,aacute,72,acirc,73,atilde,74,auml,75,aring,76,aelig,77,ccedil,78,egrave,79,eacute,7a,ecirc,7b,euml,7c,igrave,7d,iacute,7e,icirc,7f,iuml,7g,eth,7h,ntilde,7i,ograve,7j,oacute,7k,ocirc,7l,otilde,7m,ouml,7n,divide,7o,oslash,7p,ugrave,7q,uacute,7r,ucirc,7s,uuml,7t,yacute,7u,thorn,7v,yuml,ci,fnof,sh,Alpha,si,Beta,sj,Gamma,sk,Delta,sl,Epsilon,sm,Zeta,sn,Eta,so,Theta,sp,Iota,sq,Kappa,sr,Lambda,ss,Mu,st,Nu,su,Xi,sv,Omicron,t0,Pi,t1,Rho,t3,Sigma,t4,Tau,t5,Upsilon,t6,Phi,t7,Chi,t8,Psi,t9,Omega,th,alpha,ti,beta,tj,gamma,tk,delta,tl,epsilon,tm,zeta,tn,eta,to,theta,tp,iota,tq,kappa,tr,lambda,ts,mu,tt,nu,tu,xi,tv,omicron,u0,pi,u1,rho,u2,sigmaf,u3,sigma,u4,tau,u5,upsilon,u6,phi,u7,chi,u8,psi,u9,omega,uh,thetasym,ui,upsih,um,piv,812,bull,816,hellip,81i,prime,81j,Prime,81u,oline,824,frasl,88o,weierp,88h,image,88s,real,892,trade,89l,alefsym,8cg,larr,8ch,uarr,8ci,rarr,8cj,darr,8ck,harr,8dl,crarr,8eg,lArr,8eh,uArr,8ei,rArr,8ej,dArr,8ek,hArr,8g0,forall,8g2,part,8g3,exist,8g5,empty,8g7,nabla,8g8,isin,8g9,notin,8gb,ni,8gf,prod,8gh,sum,8gi,minus,8gn,lowast,8gq,radic,8gt,prop,8gu,infin,8h0,ang,8h7,and,8h8,or,8h9,cap,8ha,cup,8hb,int,8hk,there4,8hs,sim,8i5,cong,8i8,asymp,8j0,ne,8j1,equiv,8j4,le,8j5,ge,8k2,sub,8k3,sup,8k4,nsub,8k6,sube,8k7,supe,8kl,oplus,8kn,otimes,8l5,perp,8m5,sdot,8o8,lceil,8o9,rceil,8oa,lfloor,8ob,rfloor,8p9,lang,8pa,rang,9ea,loz,9j0,spades,9j3,clubs,9j5,hearts,9j6,diams,ai,OElig,aj,oelig,b0,Scaron,b1,scaron,bo,Yuml,m6,circ,ms,tilde,802,ensp,803,emsp,809,thinsp,80c,zwnj,80d,zwj,80e,lrm,80f,rlm,80j,ndash,80k,mdash,80o,lsquo,80p,rsquo,80q,sbquo,80s,ldquo,80t,rdquo,80u,bdquo,810,dagger,811,Dagger,81g,permil,81p,lsaquo,81q,rsaquo,85c,euro",32);function ah(s,t=10){const e={},n=s.split(",");for(let i=0;i<n.length;i+=2){const r="&"+n[i+1]+";",a=parseInt(n[i],t);e[r]="&#"+a+";"}return e["\\xa0"]=" ",e}function ct(s,t){const e=Object.keys(t);for(let n=0;n<e.length;n++)s=s.replace(new RegExp("{"+e[n]+"}","gi"),""+t[e[n]]);return s}function on(s){let t,e;if(!s)throw new Error("cannot create a random attribute name for an undefined object");const n="ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz";t="";do for(t="",e=0;e<12;e++)t+=n[Math.floor(Math.random()*n.length)];while(s[t]);return t}function oh(s){const t={left:"start",right:"end",center:"middle",start:"start",end:"end"};return t[s]||t.start}function ch(s){const t={alphabetic:"alphabetic",hanging:"hanging",top:"text-before-edge",bottom:"text-after-edge",middle:"central"};return t[s]||t.alphabetic}const Ee={strokeStyle:{svgAttr:"stroke",canvas:"#000000",svg:"none",apply:"stroke"},fillStyle:{svgAttr:"fill",canvas:"#000000",svg:null,apply:"fill"},lineCap:{svgAttr:"stroke-linecap",canvas:"butt",svg:"butt",apply:"stroke"},lineJoin:{svgAttr:"stroke-linejoin",canvas:"miter",svg:"miter",apply:"stroke"},miterLimit:{svgAttr:"stroke-miterlimit",canvas:10,svg:4,apply:"stroke"},lineWidth:{svgAttr:"stroke-width",canvas:1,svg:1,apply:"stroke"},globalAlpha:{svgAttr:"opacity",canvas:1,svg:1,apply:"fill stroke"},font:{canvas:"10px sans-serif"},shadowColor:{canvas:"#000000"},shadowOffsetX:{canvas:0},shadowOffsetY:{canvas:0},shadowBlur:{canvas:0},textAlign:{canvas:"start"},textBaseline:{canvas:"alphabetic"},lineDash:{svgAttr:"stroke-dasharray",canvas:[],svg:null,apply:"stroke"}};class cn{__root;__ctx;constructor(t,e){this.__root=t,this.__ctx=e}addColorStop(t,e){const n=this.__ctx.__createElement("stop");if(n.setAttribute("offset",""+t),e.indexOf("rgba")!==-1){const r=/rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d?\.?\d*)\s*\)/gi.exec(e);r&&(n.setAttribute("stop-color",ct("rgb({r},{g},{b})",{r:r[1],g:r[2],b:r[3]})),n.setAttribute("stop-opacity",r[4]))}else n.setAttribute("stop-color",e);this.__root.appendChild(n)}}class as{__root;__ctx;constructor(t,e){this.__root=t,this.__ctx=e}}class Pe{__document=document;__canvas;__ctx;width;height;__styleStack;__groupStack;__rootSVG;__ids;__SVGdefs;__currentElement;__currentElementsToStyle=null;constructor({canvas:t,width:e=500,height:n=500}){t?(this.__canvas=t,this.__ctx=t.getContext("2d"),this.width=t.width,this.height=t.height):(this.__canvas=this.__document.createElement("canvas"),this.__ctx=this.__canvas.getContext("2d"),this.width=e,this.height=n),this.__setDefaultStyles(),this.__styleStack=[this.__getStyleState()],this.__groupStack=[],this.__rootSVG=this.__document.createElementNS("http://www.w3.org/2000/svg","svg"),this.__rootSVG.setAttribute("version","1.1"),this.__rootSVG.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.__rootSVG.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink","http://www.w3.org/1999/xlink"),this.__rootSVG.setAttribute("width",""+this.width),this.__rootSVG.setAttribute("height",""+this.height),this.__ids={},this.__SVGdefs=this.__document.createElementNS("http://www.w3.org/2000/svg","defs"),this.__rootSVG.appendChild(this.__SVGdefs),this.__currentElement=this.__document.createElementNS("http://www.w3.org/2000/svg","g"),this.__rootSVG.appendChild(this.__currentElement)}__setDefaultStyles(){const t=Object.keys(Ee);for(let e=0,n=t.length;e<n;e++){const i=t[e];this[i]=Ee[i].canvas}}__getStyleState(){const t={},e=Object.keys(Ee);for(let n=0,i=e.length;n<i;n++){const r=e[n];t[r]=this[r]}return t}__applyStyleState(t){const e=Object.keys(t);for(let n=0,i=e.length;n<i;n++){const r=e[n];this[r]=t[r]}}__createElement(t,e={},n=!1){const i=this.__document.createElementNS("http://www.w3.org/2000/svg",t),r=Object.keys(e);n&&(i.setAttribute("fill","none"),i.setAttribute("stroke","none"));for(let a=0;a<r.length;a++){const o=r[a];i.setAttribute(o,e[o])}return i}__applyStyleToCurrentElement(t){let e=this.__currentElement;const n=this.__currentElementsToStyle;n&&(e.setAttribute(t,""),e=n.element,n.children.forEach(r=>{r.setAttribute(t,"")}));const i=Object.keys(Ee);for(let r=0;r<i.length;r++){const a=Ee[i[r]],o=this[i[r]];if(a.apply){if(o instanceof as){if(o.__ctx)for(;o.__ctx.__SVGdefs.childNodes.length;){const c=o.__ctx.__SVGdefs.childNodes[0].getAttribute("id");this.__ids[c]=c,this.__SVGdefs.appendChild(o.__ctx.__SVGdefs.childNodes[0])}e.setAttribute(a.apply,ct("url(#{id})",{id:o.__root.getAttribute("id")}))}else if(o instanceof cn)e.setAttribute(a.apply,ct("url(#{id})",{id:o.__root.getAttribute("id")}));else if(a.apply.indexOf(t)!==-1&&a.svg!==o)if((a.svgAttr==="stroke"||a.svgAttr==="fill")&&o.indexOf("rgba")!==-1){const h=/rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d?\.?\d*)\s*\)/gi.exec(o);e.setAttribute(a.svgAttr,ct("rgb({r},{g},{b})",{r:h[1],g:h[2],b:h[3]}));let l=parseFloat(h[4]);const f=this.globalAlpha;f!=null&&(l*=f),e.setAttribute(a.svgAttr+"-opacity",""+l)}else{let c=a.svgAttr;if(i[r]==="globalAlpha"&&(c=t+"-"+a.svgAttr,e.getAttribute(c)))continue;c&&e.setAttribute(c,o)}}}}__closestGroupOrSvg(t){return t=t||this.__currentElement,t.nodeName==="g"||t.nodeName==="svg"?t:this.__closestGroupOrSvg(t.parentNode)}getSerializedSvg(t){let e=new XMLSerializer().serializeToString(this.__rootSVG);if(/xmlns="http:\/\/www\.w3\.org\/2000\/svg".+xmlns="http:\/\/www\.w3\.org\/2000\/svg/gi.test(e)&&(e=e.replace('xmlns="http://www.w3.org/2000/svg','xmlns:xlink="http://www.w3.org/1999/xlink')),t){const i=Object.keys(rr);for(let r=0,a=i.length;r<a;r++){const o=i[r],c=rr[o],h=new RegExp(o,"gi");h.test(e)&&(e=e.replace(h,c))}}return e}getSvg(){return this.__rootSVG}save(){const t=this.__createElement("g"),e=this.__closestGroupOrSvg();this.__groupStack.push(e),e.appendChild(t),this.__currentElement=t,this.__styleStack.push(this.__getStyleState())}restore(){this.__currentElementsToStyle=null;const t=this.__groupStack.pop();t?this.__currentElement=t:this.__currentElement=this.__rootSVG.childNodes[1];const e=this.__styleStack.pop();e&&this.__applyStyleState(e)}__addTransform(t){const e=this.__closestGroupOrSvg();if(e.childNodes.length>0){this.__currentElement.nodeName==="path"&&(this.__currentElementsToStyle||(this.__currentElementsToStyle={element:e,children:[]}),this.__currentElementsToStyle.children.push(this.__currentElement),this.__applyCurrentDefaultPath());const i=this.__createElement("g");e.appendChild(i),this.__currentElement=i}let n=this.__currentElement.getAttribute("transform");n?n+=" ":n="",n+=t,this.__currentElement.setAttribute("transform",n)}scale(t,e){e===void 0&&(e=t),this.__addTransform(ct("scale({x},{y})",{x:t,y:e}))}rotate(t){const e=t*180/Math.PI;this.__addTransform(ct("rotate({angle},{cx},{cy})",{angle:e,cx:0,cy:0}))}translate(t,e){this.__addTransform(ct("translate({x},{y})",{x:t,y:e}))}transform(t,e,n,i,r,a){this.__addTransform(ct("matrix({a},{b},{c},{d},{e},{f})",{a:t,b:e,c:n,d:i,e:r,f:a}))}beginPath(){this.__currentDefaultPath="",this.__currentPosition={};const t=this.__createElement("path",{},!0);this.__closestGroupOrSvg().appendChild(t),this.__currentElement=t}__applyCurrentDefaultPath(){const t=this.__currentElement;t.nodeName==="path"&&t.setAttribute("d",this.__currentDefaultPath)}__addPathCommand(t){this.__currentDefaultPath+=" ",this.__currentDefaultPath+=t}moveTo(t,e){this.__currentElement.nodeName!=="path"&&this.beginPath(),this.__currentPosition={x:t,y:e},this.__addPathCommand(ct("M {x} {y}",this.__currentPosition))}closePath(){this.__currentDefaultPath&&this.__addPathCommand("Z")}lineTo(t,e){this.__currentPosition={x:t,y:e},this.__currentDefaultPath.indexOf("M")>-1?this.__addPathCommand(ct("L {x} {y}",this.__currentPosition)):this.__addPathCommand(ct("M {x} {y}",this.__currentPosition))}bezierCurveTo(t,e,n,i,r,a){this.__currentPosition={x:r,y:a},this.__addPathCommand(ct("C {cp1x} {cp1y} {cp2x} {cp2y} {x} {y}",{cp1x:t,cp1y:e,cp2x:n,cp2y:i,x:r,y:a}))}quadraticCurveTo(t,e,n,i){this.__currentPosition={x:n,y:i},this.__addPathCommand(ct("Q {cpx} {cpy} {x} {y}",{cpx:t,cpy:e,x:n,y:i}))}normalize(t){const e=Math.sqrt(t[0]*t[0]+t[1]*t[1]);return[t[0]/e,t[1]/e]}arcTo(t,e,n,i,r){const a=this.__currentPosition&&this.__currentPosition.x,o=this.__currentPosition&&this.__currentPosition.y;if(typeof a>"u"||typeof o>"u")return;if(r<0)throw new Error("IndexSizeError: The radius provided ("+r+") is negative.");if(a===t&&o===e||t===n&&e===i||r===0){this.lineTo(t,e);return}const c=this.normalize([a-t,o-e]),h=this.normalize([n-t,i-e]);if(c[0]*h[1]===c[1]*h[0]){this.lineTo(t,e);return}const l=c[0]*h[0]+c[1]*h[1],f=Math.acos(Math.abs(l)),g=this.normalize([c[0]+h[0],c[1]+h[1]]),w=r/Math.sin(f/2),m=t+w*g[0],v=e+w*g[1],b=[-c[1],c[0]],S=[h[1],-h[0]],C=function(B){const N=B[0];return B[1]>=0?Math.acos(N):-Math.acos(N)},M=C(b),R=C(S);this.lineTo(m+b[0]*r,v+b[1]*r),this.arc(m,v,r,M,R)}stroke(){this.__currentElement.nodeName==="path"&&this.__currentElement.setAttribute("paint-order","fill stroke markers"),this.__applyCurrentDefaultPath(),this.__applyStyleToCurrentElement("stroke")}fill(){this.__currentElement.nodeName==="path"&&this.__currentElement.setAttribute("paint-order","stroke fill markers"),this.__applyCurrentDefaultPath(),this.__applyStyleToCurrentElement("fill")}rect(t,e,n,i){this.__currentElement.nodeName!=="path"&&this.beginPath(),this.moveTo(t,e),this.lineTo(t+n,e),this.lineTo(t+n,e+i),this.lineTo(t,e+i),this.lineTo(t,e),this.closePath()}fillRect(t,e,n,i){const r=this.__createElement("rect",{x:t,y:e,width:n,height:i},!0);this.__closestGroupOrSvg().appendChild(r),this.__currentElement=r,this.__applyStyleToCurrentElement("fill")}strokeRect(t,e,n,i){const r=this.__createElement("rect",{x:t,y:e,width:n,height:i},!0);this.__closestGroupOrSvg().appendChild(r),this.__currentElement=r,this.__applyStyleToCurrentElement("stroke")}__clearCanvas(){const e=this.__closestGroupOrSvg().getAttribute("transform"),n=this.__rootSVG.childNodes[1],i=n.childNodes;for(let r=i.length-1;r>=0;r--)i[r]&&n.removeChild(i[r]);this.__currentElement=n,this.__groupStack=[],e&&this.__addTransform(e)}clearRect(t,e,n,i){if(t===0&&e===0&&n===this.width&&i===this.height){this.__clearCanvas();return}const r=this.__closestGroupOrSvg(),a=this.__createElement("rect",{x:t,y:e,width:n,height:i,fill:"#FFFFFF"},!0);r.appendChild(a)}createLinearGradient(t,e,n,i){const r=this.__createElement("linearGradient",{id:on(this.__ids),x1:t+"px",x2:n+"px",y1:e+"px",y2:i+"px",gradientUnits:"userSpaceOnUse"},!1);return this.__SVGdefs.appendChild(r),new cn(r,this)}createRadialGradient(t,e,n,i,r,a){const o=this.__createElement("radialGradient",{id:on(this.__ids),cx:i+"px",cy:r+"px",r:a+"px",fx:t+"px",fy:e+"px",gradientUnits:"userSpaceOnUse"},!1);return this.__SVGdefs.appendChild(o),new cn(o,this)}__parseFont(){const e=/^\s*(?=(?:(?:[-a-z]+\s*){0,2}(italic|oblique))?)(?=(?:(?:[-a-z]+\s*){0,2}(small-caps))?)(?=(?:(?:[-a-z]+\s*){0,2}(bold(?:er)?|lighter|[1-9]00))?)(?:(?:normal|\1|\2|\3)\s*){0,3}((?:xx?-)?(?:small|large)|medium|smaller|larger|[.\d]+(?:%|in|[cem]m|ex|p[CustomCanvasContext]))(?:\s*\/\s*(normal|[.\d]+(?:%|in|[cem]m|ex|p[CustomCanvasContext])))?\s*([-,'"\sa-z0-9]+?)\s*$/i.exec(this.font),n={style:e[1]||"normal",size:e[4]||"10px",family:e[6]||"sans-serif",weight:e[3]||"normal",decoration:e[2]||"normal",href:null};return this.__fontUnderline==="underline"&&(n.decoration="underline"),this.__fontHref&&(n.href=this.__fontHref),n}__wrapTextLink(t,e){if(t.href){const n=this.__createElement("a");return n.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",t.href),n.appendChild(e),n}return e}__applyText(t,e,n,i){const r=this.__parseFont(),a=this.__closestGroupOrSvg(),o=this.__createElement("text",{"font-family":r.family,"font-size":r.size,"font-style":r.style,"font-weight":r.weight,"text-decoration":r.decoration,x:e,y:n,"text-anchor":oh(this.textAlign),"dominant-baseline":ch(this.textBaseline)},!0);o.appendChild(this.__document.createTextNode(t)),this.__currentElement=o,this.__applyStyleToCurrentElement(i),a.appendChild(this.__wrapTextLink(r,o))}fillText(t,e,n){this.__applyText(t,e,n,"fill")}strokeText(t,e,n){this.__applyText(t,e,n,"stroke")}measureText(t){return this.__ctx.font=this.font,this.__ctx.measureText(t)}arc(t,e,n,i,r,a){if(i===r)return;i=i%(2*Math.PI),r=r%(2*Math.PI),i===r&&(r=(r+2*Math.PI-.001*(a?-1:1))%(2*Math.PI));const o=t+n*Math.cos(r),c=e+n*Math.sin(r),h=t+n*Math.cos(i),l=e+n*Math.sin(i),f=a?0:1;let g=0,w=r-i;w<0&&(w+=2*Math.PI),a?g=w>Math.PI?0:1:g=w>Math.PI?1:0,this.lineTo(h,l),this.__addPathCommand(ct("A {rx} {ry} {xAxisRotation} {largeArcFlag} {sweepFlag} {endX} {endY}",{rx:n,ry:n,xAxisRotation:0,largeArcFlag:g,sweepFlag:f,endX:o,endY:c})),this.__currentPosition={x:o,y:c}}clip(){const t=this.__closestGroupOrSvg(),e=this.__createElement("clipPath"),n=on(this.__ids),i=this.__createElement("g");this.__applyCurrentDefaultPath(),t.removeChild(this.__currentElement),e.setAttribute("id",n),e.appendChild(this.__currentElement),this.__SVGdefs.appendChild(e),t.setAttribute("clip-path",ct("url(#{id})",{id:n})),t.appendChild(i),this.__currentElement=i}drawImage(...t){let e=t[0],n,i,r,a,o=0,c=0,h,l,f,g,w,m,v,b;if(t.length===3)n=t[1],i=t[2],h=e.width,l=e.height,r=h,a=l;else if(t.length===5)n=t[1],i=t[2],r=t[3],a=t[4],h=e.width,l=e.height;else if(t.length===9)o=t[1],c=t[2],h=t[3],l=t[4],n=t[5],i=t[6],r=t[7],a=t[8];else throw new Error("Invalid number of arguments passed to drawImage: "+arguments.length);const S=this.__closestGroupOrSvg();this.__currentElement;const C="translate("+n+", "+i+")";if(e instanceof Pe){if(f=e.getSvg().cloneNode(!0),f.childNodes&&f.childNodes.length>1){for(g=f.childNodes[0];g.childNodes.length;)b=g.childNodes[0].getAttribute("id"),this.__ids[b]=b,this.__SVGdefs.appendChild(g.childNodes[0]);if(w=f.childNodes[1],w){const M=w.getAttribute("transform");let R;M?R=M+" "+C:R=C,w.setAttribute("transform",R),S.appendChild(w)}}}else(e.nodeName==="CANVAS"||e.nodeName==="IMG")&&(m=this.__createElement("image"),m.setAttribute("width",r),m.setAttribute("height",a),m.setAttribute("preserveAspectRatio","none"),(o||c||h!==e.width||l!==e.height)&&(v=this.__document.createElement("canvas"),v.width=r,v.height=a,v.getContext("2d")?.drawImage(e,o,c,h,l,0,0,r,a),e=v),m.setAttribute("transform",C),m.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",e.nodeName==="CANVAS"?e.toDataURL():e.getAttribute("src")),S.appendChild(m))}createPattern(t,e){const n=this.__document.createElementNS("http://www.w3.org/2000/svg","pattern"),i=on(this.__ids);let r;return n.setAttribute("id",i),t.nodeName==="CANVAS"||t.nodeName==="IMG"?(r=this.__document.createElementNS("http://www.w3.org/2000/svg","image"),r.setAttribute("width",""+t.width),r.setAttribute("height",""+t.height),r.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",t.nodeName==="CANVAS"?t.toDataURL():t.getAttribute("src")),n.appendChild(r),this.__SVGdefs.appendChild(n)):t instanceof Pe&&(n.setAttribute("width",""+t.width),n.setAttribute("height",""+t.height),n.appendChild(t.__rootSVG.childNodes[1]),this.__SVGdefs.appendChild(n)),new as(n,this)}setLineDash(t){t&&t.length>0?this.lineDash=t.join(","):this.lineDash=null}drawFocusRing(){}createImageData(){}getImageData(){}putImageData(){}globalCompositeOperation(){}setTransform(){}}class hn{canvas;context;customContext;currentPath2D=new Path2D;path2Ds=[];currentMatrix=new DOMMatrix;hasSetCustomStrokeStyle=!1;hasSetCustomFillStyle=!1;constructor(t){this.canvas=t,this.context=t.getContext("2d",{willReadFrequently:!0}),this.customContext=new Pe({canvas:this.canvas,width:this.canvas.width,height:this.canvas.height})}set lineWidth(t){this.hasSetCustomStrokeStyle=!0,this.context.lineWidth=t,this.customContext.lineWidth=t}get lineWidth(){return this.context.lineWidth}set lineCap(t){this.hasSetCustomStrokeStyle=!0,this.context.lineCap=t,this.customContext.lineCap=t}get lineCap(){return this.context.lineCap}set lineJoin(t){this.hasSetCustomStrokeStyle=!0,this.context.lineJoin=t,this.customContext.lineCap=t}get lineJoin(){return this.context.lineJoin}set lineDashOffset(t){this.hasSetCustomStrokeStyle=!0,this.context.lineDashOffset=t,this.customContext.lineDashOffset=t}get lineDashOffset(){return this.context.lineDashOffset}set miterLimit(t){this.hasSetCustomStrokeStyle=!0,this.context.miterLimit=t,this.customContext.miterLimit=t}get miterLimit(){return this.context.miterLimit}set globalAlpha(t){this.context.globalAlpha=t,this.customContext.globalAlpha=t}get globalAlpha(){return this.context.globalAlpha}set fillStyle(t){this.hasSetCustomFillStyle=!0,typeof t=="string"||t instanceof CanvasGradient||t instanceof CanvasPattern?(this.context.fillStyle=t,this.customContext.fillStyle=t):(this.context.fillStyle=t.gradient,this.customContext.fillStyle=t.gradientCustom)}get fillStyle(){return this.context.fillStyle}set strokeStyle(t){this.hasSetCustomStrokeStyle=!0,typeof t=="string"||t instanceof CanvasGradient||t instanceof CanvasPattern?(this.context.strokeStyle=t,this.customContext.strokeStyle=t):(this.context.strokeStyle=t.gradient,this.customContext.strokeStyle=t.gradientCustom)}get strokeStyle(){return this.context.strokeStyle}set font(t){this.context.font=t,this.customContext.font=t}get font(){return this.context.font}set textBaseline(t){this.context.textBaseline=t,this.customContext.textBaseline=t}get textBaseline(){return this.context.textBaseline}set textAlign(t){this.context.textAlign=t,this.customContext.textAlign=t}get textAlign(){return this.context.textAlign}fill(t){return t?this.context.fill(t):(this.context.fill(),this.customContext.fill()),this}fillRect(t,e,n,i){return this.context.fillRect(t,e,n,i),this.customContext.fillRect(t,e,n,i),this}fillText(t,e,n,i){return this.context.fillText(t,e,n,i),this.customContext.fillText(t,e,n),this}setLineDash(t){return this.context.setLineDash(t),this.customContext.setLineDash(t),this}stroke(t){return t?this.context.stroke(t):(this.context.stroke(),this.customContext.stroke()),this}strokeText(t,e,n,i){return this.context.strokeText(t,e,n,i),this.customContext.strokeText(t,e,n),this}strokeRect(t,e,n,i){return this.context.strokeRect(t,e,n,i),this.customContext.strokeRect(t,e,n,i),this}measureText(t){return this.context.measureText(t)}clearRect(t=0,e=0,n=this.canvas.width,i=this.canvas.height){return this.context.clearRect(t,e,n,i),this.customContext.clearRect(t,e,n,i),this}save(){return this.context.save(),this.customContext.save(),this.currentMatrix=new DOMMatrix,this.path2Ds.push(this.currentPath2D),this.currentPath2D=new Path2D,this}restore(){return this.context.restore(),this.customContext.restore(),this.hasSetCustomStrokeStyle=!1,this.hasSetCustomFillStyle=!1,this.currentMatrix=new DOMMatrix,this.currentPath2D=this.path2Ds.pop()||new Path2D,this}beginPath(){return this.context.beginPath(),this.customContext.beginPath(),this}closePath(){return this.context.closePath(),this.customContext.closePath(),this.currentPath2D.closePath(),this}changePath2D(t=this.currentPath2D,e=this.currentMatrix){const n=new Path2D;n.addPath(t,e),this.currentPath2D=n}isPointInStroke(...t){return t[0]instanceof Path2D?this.context.isPointInStroke(t[0],t[1],t[2]):this.context.isPointInStroke(t[0],t[1])}isPointInPath(...t){return t[0]instanceof Path2D?this.context.isPointInPath(t[0],t[1],t[2]):this.context.isPointInPath(t[0],t[1])}translate(t,e){return this.context.translate(t,e),this.customContext.translate(t,e),this.currentMatrix.translate(t,e),this.changePath2D(),this}rotate(t){return this.context.rotate(t),this.customContext.rotate(t),this.currentMatrix.rotate(t),this.changePath2D(),this}scale(t,e=t){return this.context.scale(t,e),this.customContext.scale(t,e),this.currentMatrix.scale(t,e),this.changePath2D(),this}moveTo(t,e){return this.context.moveTo(t,e),this.customContext.moveTo(t,e),this.currentPath2D.moveTo(t,e),this}lineTo(t,e){return this.context.lineTo(t,e),this.customContext.lineTo(t,e),this.currentPath2D.lineTo(t,e),this}arc(t,e,n,i,r,a){return this.context.arc(t,e,n,i,r,a),this.customContext.arc(t,e,n,i,r,a?-1:1),this.currentPath2D.arc(t,e,n,i,r,a),this}arcTo(t,e,n,i,r){return this.context.arcTo(t,e,n,i,r),this.customContext.arcTo(t,e,n,i,r),this.currentPath2D.arcTo(t,e,n,i,r),this}ellipse(t,e,n,i,r,a,o,c){return this.context.ellipse(t,e,n,i,r,a,o,c),this.currentPath2D.ellipse(t,e,n,i,r,a,o,c),this}quadraticCurveTo(t,e,n,i){return this.context.quadraticCurveTo(t,e,n,i),this.customContext.quadraticCurveTo(t,e,n,i),this.currentPath2D.quadraticCurveTo(t,e,n,i),this}bezierCurveTo(t,e,n,i,r,a){return this.context.bezierCurveTo(t,e,n,i,r,a),this.customContext.bezierCurveTo(t,e,n,i,r,a),this.currentPath2D.bezierCurveTo(t,e,n,i,r,a),this}rect(t,e,n,i){return this.context.rect(t,e,n,i),this.customContext.rect(t,e,n,i),this.currentPath2D.rect(t,e,n,i),this}createLinearGradient(t,e,n,i,r){const a=this.context.createLinearGradient(t,e,n,i),o=this.customContext.createLinearGradient(t,e,n,i);return r&&Object.keys(r).forEach(c=>{const h=parseFloat(c);a.addColorStop(h,r[h]),o.addColorStop(h,r[h])}),{gradient:a,gradientCustom:o}}createRadialGradient(t,e,n,i,r,a,o){const c=this.context.createRadialGradient(t,e,n,i,r,a),h=this.customContext.createRadialGradient(t,e,n,i,r,a);return o&&Object.keys(o).forEach(l=>{const f=parseFloat(l);c.addColorStop(f,o[f]),h.addColorStop(f,o[f])}),{gradient:c,gradientCustom:h}}drawImage(t,...e){if(e.length===0)this.context.drawImage(t,0,0);else if(e.length===2){const n=e[0],i=e[1];this.context.drawImage(t,n,i)}else if(e.length===4){const n=e[0],i=e[1],r=e[2],a=e[3];this.context.drawImage(t,n,i,r,a)}else if(e.length===8){const n=e[0],i=e[1],r=e[2],a=e[3],o=e[4],c=e[5],h=e[6],l=e[7];this.context.drawImage(t,n,i,r,a,o,c,h,l)}else throw new Error("Invalid number of arguments passed to drawImage: "+e.length);return this.customContext.drawImage(t,...e),this}getImageData(t=0,e=0,n=this.canvas.width,i=this.canvas.height,r){return this.context.getImageData(t,e,n,i,r)}putImageData(t,e=0,n=0){return this.context.putImageData(t,e,n)}toRawSVG(){const t=this.customContext.getSerializedSvg(!0),e=this.customContext.getSvg();return{raw:t,element:e}}}class bt extends J{fromX;fromY;constructor(t){super(t),this.fromX=t?.fromX||0,this.fromY=t?.fromY||0}static fromSVGPathData(t,e){if(t.length<3)throw new Error("Line 参数个数错误");if(t[0].toUpperCase()!=="L")throw new Error("Line command 错误");return new bt({x:t[1],y:t[2],fromX:e?.x,fromY:e?.y})}toSVGPathData(){return["L",this.x,this.y]}toCanvasContext(t){t.beginPath(),t.moveTo(this.fromX,this.fromY),t.lineTo(this.x,this.y)}getBoundingClientRect(){const t=de(this.fromX,this.fromY,this.x,this.y);if(t===0){const e=Math.min(this.x,this.fromX),n=Math.min(this.y,this.fromY),i=Math.max(this.x,this.fromX),r=Math.max(this.y,this.fromY);return new Pt({x:e,y:n,width:i-e,height:r-n})}else{const e=Math.sin(t),n=Math.cos(t),i=n*this.fromX-e*this.fromY,r=n*this.x-e*this.y,a=n*this.fromY+e*this.fromX,o=n*this.y+e*this.x;return new Pt({x:Math.min(i,r),y:Math.min(a,o),width:Math.max(i,r)-Math.min(i,r),height:Math.max(a,o)-Math.min(a,o)})}}interpolate(t){return{x:this.fromX+t*(this.x-this.fromX),y:this.fromY+t*(this.y-this.fromY)}}}class _t extends bt{c1x;c1y;c2x;c2y;constructor(t){super(t),this.c1x=t.c1x,this.c1y=t.c1y,this.c2x=t.c2x,this.c2y=t.c2y}static fromSVGPathData(t,e){if(t.length<7)throw new Error("CubicBezier 参数个数错误");if(t[0].toUpperCase()!=="C")throw new Error("CubicBezier command 错误");return new _t({c1x:t[1],c1y:t[2],c2x:t[3],c2y:t[4],x:t[5],y:t[6],fromX:e?.x,fromY:e?.y})}toSVGPathData(){return["C",this.c1x,this.c1y,this.c2x,this.c2y,this.x,this.y]}toCanvasContext(t){t.beginPath(),t.moveTo(this.fromX,this.fromY),t.bezierCurveTo(this.c1x,this.c1y,this.c2x,this.c2y,this.x,this.y)}getBoundingClientRect(){const t=H.curveDim(this.fromX,this.fromY,this.c1x,this.c1y,this.c2x,this.c2y,this.x,this.y);return new Pt({x:t.min.x,y:t.min.y,width:t.max.x-t.min.x,height:t.max.y-t.min.y})}interpolate(t){return{x:Math.pow(1-t,3)*this.fromX+3*Math.pow(1-t,2)*t*this.c1x+3*Math.pow(1-t,1)*Math.pow(t,2)*this.c2x+Math.pow(t,3)*this.x,y:Math.pow(1-t,3)*this.fromY+3*Math.pow(1-t,2)*t*this.c1y+3*Math.pow(1-t,1)*Math.pow(t,2)*this.c2y+Math.pow(t,3)*this.y}}length(t=1){return H.bezlen(this.fromX,this.fromY,this.c1x,this.c1y,this.c2x,this.c2y,this.x,this.y,t)}getTatLen(t){const e=this.fromX,n=this.fromY,i=this.c1x,r=this.c1y,a=this.c2x,o=this.c2y,c=this.x,h=this.y;if(t<0||H.bezlen(e,n,i,r,a,o,c,h)<t)return 0;let l=1,f=l/2,g=l-f,w,m=.01;for(w=H.bezlen(e,n,i,r,a,o,c,h,g);Math.abs(w-t)>m;)f/=2,g+=(w<t?1:-1)*f,w=H.bezlen(e,n,i,r,a,o,c,h,g);return g}getPointAtSegmentLength(t){const e=this.getTatLen(t),n=this.fromX,i=this.fromY,r=this.c1x,a=this.c1y,o=this.c2x,c=this.c2y,h=this.x,l=this.y;let f=1-e,g=Math.pow(f,3),w=Math.pow(f,2),m=e*e,v=m*e,b=g*n+w*3*e*r+f*3*e*e*o+v*h,S=g*i+w*3*e*a+f*3*e*e*c+v*l,C=n+2*e*(r-n)+m*(o-2*r+n),M=i+2*e*(a-i)+m*(c-2*a+i),R=r+2*e*(o-r)+m*(h-2*o+r),B=a+2*e*(c-a)+m*(l-2*c+a),N=f*n+e*r,W=f*i+e*a,it=f*o+e*h,q=f*c+e*l,nt=90-Math.atan2(C-R,M-B)*180/Math.PI;return{x:b,y:S,m:{x:C,y:M},n:{x:R,y:B},start:{x:N,y:W},end:{x:it,y:q},alpha:nt}}}class ln extends bt{cx;cy;isLineThrough;constructor(t){super(t),this.cx=t.cx,this.cy=t.cy,this.isLineThrough=typeof t.isLineThrough=="boolean"?t.isLineThrough:!0}static fromSVGPathData(t,e){if(t.length<5)throw new Error("QuadraticBezier 参数个数错误");if(t[0].toUpperCase()!=="Q")throw new Error("QuadraticBezier command 错误");return new ln({cx:t[1],cy:t[2],x:t[3],y:t[4],fromX:e?.x,fromY:e?.y})}toSVGPathData(){if(this.isLineThrough){const t=this.cx*2-(this.fromX+this.x)/2,e=this.cy*2-(this.fromY+this.y)/2;return["Q",t,e,this.x,this.y]}else return["Q",this.cx,this.cy,this.x,this.y]}toCanvasContext(t){if(t.beginPath(),t.moveTo(this.fromX,this.fromY),this.isLineThrough){const e=this.cx*2-(this.fromX+this.x)/2,n=this.cy*2-(this.fromY+this.y)/2;t.quadraticCurveTo(e,n,this.x,this.y)}else t.quadraticCurveTo(this.cx,this.cy,this.x,this.y)}interpolate(t){return{x:(1-t)*(1-t)*this.fromX+2*(1-t)*t*this.cx+t*t*this.x,y:(1-t)*(1-t)*this.fromY+2*(1-t)*t*this.cy+t*t*this.y}}}class ce extends bt{rx;ry;xAxisRotate;largeArcFlag;sweepFlag;constructor(t){super(t),this.rx=t.rx,this.ry=t.ry,this.xAxisRotate=t?.xAxisRotate??0,this.largeArcFlag=t?.largeArcFlag??1,this.sweepFlag=t?.sweepFlag??1}static fromSVGPathData(t,e){if(t.length<8)throw new Error("Arc 参数个数错误");if(t[0].toUpperCase()!=="A")throw new Error("Arc command 错误");return new ce({rx:t[1],ry:t[2],xAxisRotate:t[3],largeArcFlag:t[4],sweepFlag:t[5],x:t[6],y:t[7],fromX:e?.x,fromY:e?.y})}toSVGPathData(){return["A",this.rx,this.ry,this.xAxisRotate,this.largeArcFlag,this.sweepFlag,this.x,this.y]}toCanvasContext(t){t.beginPath();const[e,n,i,r,a,o,c]=this.convertSVGToCanvas(this.fromX,this.fromY,this.x,this.y,this.rx,this.ry,this.xAxisRotate,this.largeArcFlag,this.sweepFlag);t.ellipse(e,n,i,r,a,o,c,!this.sweepFlag)}convertSVGToCanvas(t,e,n,i,r,a,o,c,h){const l=o/180*Math.PI,f=(t-n)/2,g=(e-i)/2,w=Math.cos(l)*f+Math.sin(l)*g,m=-Math.sin(l)*f+Math.cos(l)*g,v=w*w/(r*r)+m*m/(a*a);if(v>1){const Y=Math.sqrt(v);throw r=Y*r,a=Y*a,new Error(`Radii are too small to build an arc. Correcting them to ${r}/${a}.`)}const b=Math.sqrt((r*r*a*a-r*r*m*m-a*a*w*w)/(r*r*m*m+a*a*w*w)),S=c!=h?1:-1,C=S*b*r*m/a,M=S*b*-a*w/r,R=(t+n)/2,B=(e+i)/2,N=Math.cos(l)*C-Math.sin(l)*M+R,W=Math.sin(l)*C+Math.cos(l)*M+B,it=(Y,$,ht,rt)=>(Y*rt>=$*ht?1:-1)*Math.acos((Y*ht+$*rt)/(Math.sqrt(Y*Y+$*$)*Math.sqrt(ht*ht+rt*rt))),q=it(1,0,t-N,e-W)-l,nt=it(t-N,e-W,n-N,i-W);return[N,W,r,a,l,q,q+nt]}}class z extends J{startPathX=0;startPathY=0;prevPathX=0;prevPathY=0;normalizedLines=[];constructor(t){super(t),this.prevPathX=this.startPathX=this.x,this.prevPathY=this.startPathY=this.y}appendLine(t){if(t instanceof ce){Ln(this.prevPathX,this.prevPathY,t.rx,t.ry,t.xAxisRotate,t.largeArcFlag,t.sweepFlag,t.x,t.y).forEach(h=>{const[l,f,g,w,m,v]=h;this.normalizedLines.push(new _t({c1x:l,c1y:f,c2x:g,c2y:w,x:m,y:v,fromX:this.prevPathX,fromY:this.prevPathY})),this.prevPathX=m,this.prevPathY=v});return}let e,n,i,r,a,o;t instanceof _t?(e=t.c1x,n=t.c1y,i=t.c2x,r=t.c2y,a=t.x,o=t.y):t instanceof ln?[e,n,i,r,a,o]=Nn(this.prevPathX,this.prevPathY,t.cx,t.cy,t.x,t.y):[e,n,i,r,a,o]=me(this.prevPathX,this.prevPathY,t.x,t.y),this.normalizedLines.push(new _t({c1x:e,c1y:n,c2x:i,c2y:r,x:a,y:o,fromX:this.prevPathX,fromY:this.prevPathY})),this.prevPathX=a,this.prevPathY=o}static fromShape(t){const e=z.fromSVGPathD(t.toSVGPathD());return Ve(e,t),Gr(e,t),e.prevDegree=0,e.prevScaleOnOrigin=1,e.prevSkewDegreeOnOrigin=0,e.updateTransform(),e}static fromSVGPathD(t,e){const n=new z;return n.updateFromSVGPathD(t,e),n}static fromSVGPathData(t,e){const n=new z;return n.updateFromSVGPathData(t,e),n}updateFromSVGPathD(t,e){if(!H.isSVGPath(t))throw new Error("Not a SVG path!");return this.updateFromSVGPathData(H.parseSVGPath(t),e)}updateFromSVGPathData(t,e){this.normalizedLines=[];const n=H.normalizeSVGPath(H.absolutizeSVGPath(t));for(let r=0,a=n.length;r<a;r++){const o=n[r];if(o[0]=="M"){this.prevPathX=this.startPathX=o[1],this.prevPathY=this.startPathY=o[2];continue}this.appendLine(new _t({c1x:o[1],c1y:o[2],c2x:o[3],c2y:o[4],x:o[5],y:o[6]}))}const i=On(e??"");return this.transform(i)}toSVGPathData(){const t=[];t.push(["M",this.startPathX,this.startPathY]);for(let e=0,n=this.normalizedLines.length;e<n;e++)t.push(this.normalizedLines[e].toSVGPathData());return t}toCanvasContext(t){t.beginPath(),t.moveTo(this.startPathX,this.startPathY),this.normalizedLines.forEach(e=>{const[n,...i]=e.toSVGPathData();t.bezierCurveTo(i[0],i[1],i[2],i[3],i[4],i[5])})}updateTransform(){if((this.x!=this.prevX||this.y!=this.prevY)&&this.translate(this.x-this.prevX,this.y-this.prevY),this.degree!=this.prevDegree){const t=this.getBoundingClientRect();this.rotate(this.degree-this.prevDegree,t.x+t.width/2,t.y+t.height/2)}if(this.scaleOnOrigin!=this.prevScaleOnOrigin){const t=this.getBoundingClientRect(),e=this.scaleOnOrigin/this.prevScaleOnOrigin;this.scale(e,e,t.x+t.width/2,t.y+t.height/2)}}transform(t){return{x:this.startPathX,y:this.startPathY}=t.multiplyPoint(this.startPathX,this.startPathY),{x:this.prevPathX,y:this.prevPathY}=t.multiplyPoint(this.prevPathX,this.prevPathY),this.normalizedLines.forEach(e=>{({x:e.fromX,y:e.fromY}=t.multiplyPoint(e.fromX,e.fromY)),{x:e.c1x,y:e.c1y}=t.multiplyPoint(e.c1x,e.c1y),{x:e.c2x,y:e.c2y}=t.multiplyPoint(e.c2x,e.c2y),{x:e.x,y:e.y}=t.multiplyPoint(e.x,e.y)}),this}translate(t,e){const n=new tt().translate(t,e);return this.transform(n),this.prevX=this.x,this.prevY=this.y,this}rotate(t,e=0,n=0){const i=new tt().rotate(t,e,n);return this.transform(i),this.prevDegree=this.degree,this}scale(t,e=t,n=0,i=0){const r=new tt().scale(t,e,n,i);return this.transform(r),this.prevScaleOnOrigin=this.scaleOnOrigin,this}skew(t,e=0){const n=new tt().skew(t,e);return this.transform(n),this.prevSkewDegreeOnOrigin=this.skewDegreeOnOrigin,this}trim(){const t=this.getBoundingClientRect();return this.translate(-t.x,-t.y),this}getBoundingClientRect(){let t=0,e=0,n=[],i=[];t=this.startPathX,e=this.startPathY,n.push(t),i.push(e),this.normalizedLines.forEach(h=>{const l=H.curveDim(t,e,h.c1x,h.c1y,h.c2x,h.c2y,h.x,h.y);n=n.concat(l.min.x,l.max.x),i=i.concat(l.min.y,l.max.y),t=h.x,e=h.y});const r=Math.min.apply(0,n),a=Math.min.apply(0,i),o=Math.max.apply(0,n),c=Math.max.apply(0,i);return new Pt({x:r,y:a,width:o-r,height:c-a})}getTotalLength(){return this.normalizedLines.reduce((t,e)=>t+=e.length(),0)}interpolate(t){if(this.normalizedLines.length===0)return{x:this.startPathX,y:this.startPathX};if(this.normalizedLines.length===1)return this.normalizedLines[0].interpolate(t);{let e=t*this.normalizedLines.length,n=this.normalizedLines[0];if(e--,e>1)for(let i=1,r=this.normalizedLines.length;i<r&&(n=this.normalizedLines[i],e>1);i++)e-=1;return n.interpolate(e)}}getPointAtLength(t){let e={x:0,y:0,alpha:0},n=0;for(let i=0,r=this.normalizedLines.length;i<r;i++){const a=this.normalizedLines[i],o=a.length();if(n+o>t){e=a.getPointAtSegmentLength(t-n);break}n+=o}return e}getSubpathsAtLength(t,e,n){let i=null,r=0;const a=new z;a.prevPathX=a.startPathX=t.x,a.prevPathY=a.startPathY=t.y;for(let o=0,c=t.normalizedLines.length;o<c;o++){const h=t.normalizedLines[o],l=h.length();if(r+l>e&&!i){const f=h.getPointAtSegmentLength(e-r);if(a.appendLine(new _t({c1x:f.start.x,c1y:f.start.y,c2x:f.m.x,c2y:f.m.y,x:f.x,y:f.y})),n)return a;i=a,a.prevPathX=f.x,a.prevPathY=f.y,a.appendLine(new _t({c1x:f.n.x,c1y:f.n.y,c2x:f.end.x,c2y:f.end.y,x:h.x,y:h.y})),r+=l;continue}r+=l,a.appendLine(h)}return a}getSubpath(t,e){if(this.getTotalLength()-e<1e-6)return this.getSubpathsAtLength(this,t);{const n=this.getSubpathsAtLength(this,e,1);return t?this.getSubpathsAtLength(n,t):n}}isPointInPath(t,e,n){if(n instanceof hn)return n.isPointInPath(new Path2D(this.toSVGPathD()),t,e);let i;try{i=new SVGPoint(t,e)}catch{i=n.createSVGPoint(),i.x=t,i.y=e}return this.el instanceof SVGGeometryElement?this.el.isPointInFill(i):!1}isPointInStroke(t,e,n){if(n instanceof hn)return n.isPointInStroke(new Path2D(this.toSVGPathD()),t,e);let i;try{i=new SVGPoint(t,e)}catch{i=n.createSVGPoint(),i.x=t,i.y=e}return this.el instanceof SVGGeometryElement?this.el.isPointInStroke(i):!1}get polymorphPoints(){return[this.startPathX,this.startPathY].concat(this.normalizedLines.reduce((t,e)=>t.concat([e.c1x,e.c1y,e.c2x,e.c2y,e.x,e.y]),[]))}static fromPolymorphPoints(t){const e=new z({x:t[0],y:t[1]});for(let n=2;n+5<t.length;n+=6)e.appendLine(new _t({c1x:t[n],c1y:t[n+1],c2x:t[n+2],c2y:t[n+3],x:t[n+4],y:t[n+5]}));return e}perimeterPoints(){const t=this.polymorphPoints,e=t.length;let n=t[e-2],i=t[e-1],r=0;for(let a=0;a<e;a+=6)r+=Rn(t[a],t[a+1],n,i),n=t[a],i=t[a+1];return Math.floor(r)}fillPathD(t){const e=this.polymorphPoints,n=e.length;let i=t-n;const r=Math.ceil(t/n),a=[];a.push(["M",e[0],e[1]]);let o=2;for(;o+5<=n-1;){const c=e[o++],h=e[o++],l=e[o++],f=e[o++],g=e[o++],w=e[o++];a.push(["C",c,h,l,f,g,w]);let m=0;for(;m<r&&i>0;)a.push(["C",g,w,g,w,g,w]),i-=6,m++}return z.fromSVGPathData(a)}static mixPoints(t,e,n){const i=t.length,r=new Array(i);for(let a=0;a<i;a++)r[a]=Jt(t[a]+(e[a]-t[a])*n,6);return r}static getPathInterpolator(t,e){return n=>Math.abs(n-0)<Number.EPSILON?t.toSVGPathD():Math.abs(n-1)<Number.EPSILON?e.toSVGPathD():z.fromPolymorphPoints(this.mixPoints(t.polymorphPoints,e.polymorphPoints,n)).toSVGPathD()}static polymorph(t){if(!t.length)throw new Error("paths 为空!");const e=t.length-1,n=new Array(e);for(let r=0;r<e;r++){const a=Math.max(t[r].polymorphPoints.length,t[r+1].polymorphPoints.length);n[r]=this.getPathInterpolator(t[r].fillPathD(a),t[r+1].fillPathD(a))}const i=z.fromSVGPathD(n[0](0));return r=>{const a=Jt(e*r,6),o=Math.min(Math.floor(a),e-1),c=Jt(a-o,6);return i.updateFromSVGPathD(n[o](c)),i.attrs=t[o+1].attrs,i}}}class _e extends oe{svgWidth=0;svgHeight=0;width=0;height=0;shapes=[];constructor(t){if(super(t),!t?.svg)return;const e=new ir(t.svg).parse();for(let n=0,i=e.length;n<i;n++){const r=e[n];if(r.type=="viewbox"&&r.width&&r.height){if(this.svgWidth=parseFloat(r.width),this.svgHeight=parseFloat(r.height),t.width){const l=this.svgWidth/this.svgHeight;this.width=t.width,this.height=this.width/l}else this.width=this.svgWidth,this.height=this.svgHeight;continue}if(r.type!="path"||!ne.isSVGPath(r.path))continue;const a={};for(const l in r)l==="type"||l==="path"||l==="transform"||(a[l]=r[l]);const o=ne.absolutizeSVGPath(ne.parseSVGPath(r.path));let c=[],h=[];for(let l=0,f=o.length;l<f;l++){const g=o[l];h.push(g),g[0].toLowerCase()=="z"&&(c.push(h),h=[])}h.length&&c.push(h),c.forEach(l=>{const f=z.fromSVGPathData(l,r.transform);Ve(f,t),f.attrs={...f.attrs,...a,...t.attrs},this.width&&this.svgWidth&&f.scale(this.width/this.svgWidth),this.shapes.push(f)})}}static fromShape(t){const e=new _e;return t instanceof J?e.shapes.push(z.fromShape(t)):e.shapes.push(...t.map(n=>z.fromShape(n))),e}sortPathD(){this.shapes=this.shapes.map(t=>({path:t,perimeter:t.perimeterPoints()})).sort((t,e)=>e.perimeter-t.perimeter).map(t=>t.path)}fillPathDGroup(t){const e=t.shapes.length,n=this.shapes.length;if(e<n)return t.fillPathDGroup(this);for(let i=n;i<e;i++){const r=t.shapes[i].polymorphPoints,a=r[0],o=r[1],c=new z({x:a,y:o,attrs:t.shapes[i].attrs});for(let h=2;h+5<r.length;h+=6)c.appendLine(new _t({c1x:a,c1y:o,c2x:a,c2y:o,x:a,y:o}));this.shapes.push(c)}}static polymorph(t){if(!t.length)throw new Error("groups 为空!");let e=-1,n=0;t.forEach((o,c)=>{o.sortPathD(),n<o.shapes.length&&(n=o.shapes.length,e=c)}),t.forEach(o=>o.fillPathDGroup(t[e]));const i=[];t.forEach((o,c)=>{o.shapes.forEach((h,l)=>{i[l]=i[l]||[],i[l][c]=h})});const r=[];i.forEach(o=>r.push(z.polymorph(o)));const a=new _e;return r.forEach(o=>{a.shapes.push(o(0))}),o=>(r.forEach(c=>{c(o)}),a)}}class ar extends J{rx;ry;constructor(t){super(t),this.rx=t?.rx||0,this.ry=t?.ry||0}getBoundingClientRect(){return new Pt({x:this.x-this.rx,y:this.y-this.ry,width:this.rx*2,height:this.ry*2})}toSVGPathData(){return[["M",this.x,this.y],["m",0,-this.ry],["a",this.rx,this.ry,0,1,1,0,2*this.ry],["a",this.rx,this.ry,0,1,1,0,-2*this.ry],["z"]]}toCanvasContext(t){t.beginPath(),t.ellipse(this.x,this.y,this.rx,this.ry,0,0,2*Math.PI,!0),t.closePath()}}class os extends J{points;constructor(t=[]){if(!t.length)throw new Error("points can't be null");super(t[0]),this.points=t}toSVGPathData(){const t=this.points.length;if(t<3)throw new Error("points length must >= 3");const e=[];e.push(["M",this.points[0].x,this.points[0].y]);for(let n=0;n<=t-1;n++)e.push(["L",this.points[n].x,this.points[n].y]);return e.push(["L",this.points[0].x,this.points[0].y]),e}toCanvasContext(t){const e=this.points.length;if(e<3)throw new Error("points length must >= 3");t.beginPath(),t.moveTo(0,0);for(let n=0;n<=e-1;n++)t.lineTo(this.points[n].x-this.points[0].x,this.points[n].y-this.points[0].y);t.lineTo(0,0)}get length(){return this.points.length}addPoint(t){this.points.push(t)}getPoint(t){return this.points[t]}isContainPoint(t,e){const n=this.length;let i=!1;const r=2e-10;for(let a=0,o=n-1;a<n;o=a,a++){const c=this.points[a].x,h=this.points[a].y,l=this.points[o].x,f=this.points[o].y;if(c===t&&h===e||l===t&&f===e||e===h&&e===f)return!0;if(e>=h&&e<f||e<h&&e>=f){const g=(l-c)/(f-h),w=c+g*(e-h);if(w===t||Math.abs(w-t)<r)return!0;w>t&&(i=!i)}}return i}[Symbol.iterator](){let t=0;return{next:()=>({value:t>=this.length-1?this.points[++t]:void 0,done:t>=this.length})}}static generatePoints(t,e,n,i){const r=[];for(let a=0;a<i;a++){const o=a/i*2*Math.PI,{x:c,y:h}=zt(o,n);r.push(new si({x:t+c,y:e+h}))}return new os(r)}}class hh extends J{x;y;z;fl;vpX;vpY;cX;cY;cZ;radius;constructor(t){super(t),this.x=t?.x||0,this.y=t?.y||0,this.z=t?.z||0,this.fl=t?.fl||250,this.vpX=t?.vpX||0,this.vpY=t?.vpY||0,this.cX=t?.cX||0,this.cY=t?.cY||0,this.cZ=t?.cZ||0,this.radius=t?.radius||0}getBoundingClientRect(){return null}toSVGPathData(){return this.radius?[["M",this.getScreenX(),this.getScreenY()-this.radius],["a",this.radius,this.radius,0,1,1,0,2*this.radius],["a",this.radius,this.radius,0,1,1,0,-2*this.radius],["z"]]:["M",this.getScreenX(),this.getScreenY()]}toCanvasContext(t){t.beginPath(),t.arc(0,0,this.radius,0,Math.PI*2,!0),t.closePath()}toArray(){return[this.x,this.y,this.z]}setVanishingPoint(t,e){this.vpX=t,this.vpY=e}setCenter(t,e,n){this.cX=t,this.cY=e,this.cZ=n}rotateX(t){({x:this.y,y:this.z}=Et(t,this.y,this.z))}rotateY(t){({x:this.x,y:this.z}=Et(t,this.x,this.z))}rotateZ(t){({x:this.x,y:this.y}=Et(t,this.x,this.y))}getScreenX(){const t=this.fl/(this.fl+this.z+this.cZ);return this.vpX+(this.cX+this.x)*t}getScreenY(){const t=this.fl/(this.fl+this.z+this.cZ);return this.vpY+(this.cY+this.y)*t}cross(t){const e=this.x,n=this.y,i=this.z;return this.x=n*t.z-i*t.y,this.y=i*t.x-e*t.z,this.z=e*t.y-n*t.x,this}normalize(t=1){const e=je(this.x,this.y,this.z);if(e){const n=t/e;this.x*=n,this.y*=n,this.z*=n}return this}reflect(t,e){const n=t.x*e.x+t.y*e.y+t.z*e.z;return this.x=t.x-2*n*e.x,this.y=t.y-2*n*e.y,this.z=t.z-2*n*e.z,this}}class lh extends J{x;y;z;brightness;constructor(t){super(t),this.x=t?.x||0,this.y=t?.y||0,this.z=t?.z||0,this.brightness=t?.brightness||1}setBrightness(t){this.brightness=Math.min(Math.max(t,0),1)}getBoundingClientRect(){return null}toSVGPathData(){return[]}toCanvasContext(t){}}const uh=lh;class fh extends J{points;light;constructor(t=[]){if(t.length<3)throw new Error("points length must >= 3");super(t[0]),this.points=t,this.light=new uh({x:0,y:0,z:0,brightness:1})}toSVGPathData(){const t=[];t.push(["M",this.points[0].getScreenX(),this.points[0].getScreenY()]);for(let e=0,n=this.points.length;e<=n-1;e++)t.push(["L",this.points[e].getScreenX(),this.points[e].getScreenY()]);return t.push(["L",this.points[0].getScreenX(),this.points[0].getScreenY()]),t}toCanvasContext(t){t.beginPath(),t.moveTo(0,0);for(let e=0,n=this.points.length;e<=n-1;e++)t.lineTo(this.points[e].getScreenX()-this.points[0].getScreenX(),this.points[e].getScreenY()-this.points[0].getScreenY());t.lineTo(0,0)}get length(){return this.points.length}getDepth(){return Math.min(...this.points.map(t=>t.z))}isBackface(){const t=this.points[2].getScreenX()-this.points[0].getScreenX(),e=this.points[2].getScreenY()-this.points[0].getScreenY(),n=this.points[1].getScreenX()-this.points[2].getScreenX(),i=this.points[1].getScreenY()-this.points[2].getScreenY();return t*i>e*n}getLightFactor(){const t={x:this.points[0].x-this.points[1].x,y:this.points[0].y-this.points[1].y,z:this.points[0].z-this.points[1].z},e={x:this.points[1].x-this.points[2].x,y:this.points[1].y-this.points[2].y,z:this.points[1].z-this.points[2].z},n={x:t.y*e.z-t.z*e.y,y:-(t.x*e.z-t.z*e.x),z:t.x*e.y-t.y*e.x},i=n.x*this.light.x+n.y*this.light.y+n.z*this.light.z,r=Math.sqrt(n.x*n.x+n.y*n.y+n.z*n.z),a=Math.sqrt(this.light.x*this.light.x+this.light.y*this.light.y+this.light.z*this.light.z);return Math.acos(i/(r*a))/Math.PI*this.light.brightness}getAdjustedColor(t){const e=jt(t),n=this.getLightFactor();return e.r*=n,e.g*=n,e.b*=n,we(e)}}class cs extends J{text;constructor(t){super(t),this.text=t.text,this.attrs={fontSize:"10px",fontFamily:'system-ui, Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", Roboto, Oxygen, Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif',fill:"#666666","alignment-baseline":"middle",...this.attrs}}getBoundingClientRect(){return null}toSVGPathData(){return[]}toCanvasContext(t){t.fillText(this.text,0,0)}}class dh extends oe{radius;startDegree;endDegree;text="";defaultShowText;p1=new mt;p1Offset=10;p2=new mt;p2Offset=40;p3=new mt;p3Offset=10;p4=new mt;p4Offset=10;direction=1;constructor(t){super(t),this.radius=t.radius,this.startDegree=t.startDegree,this.endDegree=t.endDegree,this.text=t.text||"",this.defaultShowText=typeof t?.defaultShowText=="boolean"?t.defaultShowText:!1;const e=this.startDegree+(this.endDegree-this.startDegree)/2,{x:n,y:i}=zt(ot(e),this.radius+this.p1Offset);this.p1.x=this.x+n,this.p1.y=this.y+i;const{x:r,y:a}=zt(ot(e),this.radius+this.p1Offset+this.p2Offset);this.p2.x=this.x+r,this.p2.y=this.y+a,this.direction=this.p1.x>this.x?1:-1,this.p3.x=this.p2.x+this.direction*this.p3Offset,this.p3.y=this.p2.y,this.p4.x=this.p3.x+this.direction*this.p4Offset,this.p4.y=this.p3.y;const o=Object.assign({...this.attrs},{fill:"none"}),c=new bt({fromX:this.p1.x,fromY:this.p1.y,x:this.p2.x,y:this.p2.y,attrs:o,isShow:this.defaultShowText}),h=new bt({fromX:this.p2.x,fromY:this.p2.y,x:this.p3.x,y:this.p3.y,attrs:o,isShow:this.defaultShowText}),l=new cs({x:this.p4.x,y:this.p4.y,text:this.text,attrs:{...o,textAnchor:this.direction==1?"start":"end"},isShow:this.defaultShowText});this.shapes.push(new or({x:this.x,y:this.y,radius:this.radius,startDegree:this.startDegree,endDegree:this.endDegree,attrs:Object.assign({...this.attrs},{strokeWidth:"0"}),mouseMove:f=>{this.text&&!this.defaultShowText&&(c.isShow=f,h.isShow=f,l.isShow=f)}})),this.text&&(this.shapes.push(c),this.shapes.push(h),this.shapes.push(l))}}class or extends J{radius;startDegree;endDegree;constructor(t){super(t),this.radius=t.radius,this.startDegree=t.startDegree,this.endDegree=t.endDegree}toSVGPathData(){const{x:t,y:e}=zt(ot(this.startDegree),this.radius),{x:n,y:i}=zt(ot(this.endDegree),this.radius);return[["M",this.x,this.y],["l",t,e],["A",this.radius,this.radius,0,Math.abs(this.endDegree-this.startDegree)>=180?1:0,1,this.x+n,this.y+i],["z"]]}toCanvasContext(t){t.beginPath(),t.moveTo(0,0),t.arc(0,0,this.radius,ot(this.startDegree),ot(this.endDegree),!1),t.closePath()}containPoint(t,e){const[n,i]=[t-this.x,e-this.y],r=Math.sqrt(n*n+i*i);let a=de(this.x,this.y,t,e);a<0&&(a+=Math.PI*2);const o=Q(a);return r<this.radius&&o>this.startDegree&&o<this.endDegree}}class mh extends J{constructor(t){super(t)}toSVGPathData(){return[["M",this.x,this.y],["m",-50,-25],["l",50,0],["l",0,-25],["l",50,50],["l",-50,50],["l",0,-25],["l",-50,0],["l",0,-50],["z"]]}toCanvasContext(t){t.beginPath(),t.moveTo(-50,-25),t.lineTo(0,-25),t.lineTo(0,-50),t.lineTo(50,0),t.lineTo(0,50),t.lineTo(0,25),t.lineTo(-50,25),t.lineTo(-50,-25),t.closePath()}}class ph extends J{constructor(t){super(t)}toSVGPathData(){return[["M",this.x,this.y],["m",4,24],["l",4,-8],["l",6,-6],["l",1,-10],["l",-6,-10],["l",-7,10],["l",-4,0],["l",-7,-10],["l",-6,10],["l",1,10],["l",6,6],["l",4,8],["z"]]}toCanvasContext(t){t.beginPath(),t.moveTo(4,24),t.lineTo(8,16),t.lineTo(14,10),t.lineTo(15,0),t.lineTo(9,-10),t.lineTo(2,0),t.lineTo(-2,0),t.lineTo(-9,-10),t.lineTo(-15,0),t.lineTo(-14,10),t.lineTo(-8,16),t.lineTo(-4,24),t.closePath()}}(function(){let s=0;window.requestAnimationFrame||(window.requestAnimationFrame=function(t){const e=new Date().getTime(),n=Math.max(0,16-(e-s)),i=window.setTimeout(function(){t(e+n)},n);return s=e+n,i}),window.cancelAnimationFrame||(window.cancelAnimationFrame=function(t){clearTimeout(t)})})();const cr=s=>{let t=window.requestAnimationFrame(function e(n){s(n),t=window.requestAnimationFrame(e)});return()=>window.cancelAnimationFrame(t)};class gh{id=0;renders={};cancelAnimateInWeb;constructor(){}get length(){let t=0;for(let e in this.renders)t++;return t}run(t){const e=this.id++;this.renders[e]=t,!this.cancelAnimateInWeb&&(this.cancelAnimateInWeb=cr(n=>{const i=[];for(let r in this.renders)this.renders[r](n)===!1&&i.push(parseInt(r));for(let r of i)delete this.renders[r];!this.length&&this.cancelAnimateInWeb&&(this.cancelAnimateInWeb(),this.cancelAnimateInWeb=void 0)}))}runAccurateSetTimeout(t,e=0){let n=!1,i;return this.run(r=>n?!1:(i||(i=r),r-i>=e?(t(),!1):!0)),()=>{n=!0}}}const De=new gh;let Ae;typeof self>"u"&&typeof process<"u"&&process.hrtime?Ae=function(){const s=process.hrtime();return s[0]*1e3+s[1]/1e6}:typeof self<"u"&&self.performance!==void 0&&self.performance.now!==void 0?Ae=self.performance.now.bind(self.performance):Date.now!==void 0?Ae=Date.now:Ae=function(){return new Date().getTime()};const he=Ae;class ke{static _nextId=0;static nextId(){return ke._nextId++}}const un={Linear:{None:function(s){return s}},Ease:{In:function(s){return Math.pow(s,1.7)}},Quadratic:{In:function(s){return s*s},Out:function(s){return s*(2-s)},InOut:function(s){return(s*=2)<1?.5*s*s:-.5*(--s*(s-2)-1)}},Cubic:{In:function(s){return s*s*s},Out:function(s){return--s*s*s+1},InOut:function(s){return(s*=2)<1?.5*s*s*s:.5*((s-=2)*s*s+2)}},Quartic:{In:function(s){return s*s*s*s},Out:function(s){return 1- --s*s*s*s},InOut:function(s){return(s*=2)<1?.5*s*s*s*s:-.5*((s-=2)*s*s*s-2)}},Quintic:{In:function(s){return s*s*s*s*s},Out:function(s){return--s*s*s*s*s+1},InOut:function(s){return(s*=2)<1?.5*s*s*s*s*s:.5*((s-=2)*s*s*s*s+2)}},Sinusoidal:{In:function(s){return 1-Math.sin((1-s)*Math.PI/2)},Out:function(s){return Math.sin(s*Math.PI/2)},InOut:function(s){return .5*(1-Math.sin(Math.PI*(.5-s)))}},Exponential:{In:function(s){return s===0?0:Math.pow(1024,s-1)},Out:function(s){return s===1?1:1-Math.pow(2,-10*s)},InOut:function(s){return s===0?0:s===1?1:(s*=2)<1?.5*Math.pow(1024,s-1):.5*(-Math.pow(2,-10*(s-1))+2)}},Circular:{In:function(s){return 1-Math.sqrt(1-s*s)},Out:function(s){return Math.sqrt(1- --s*s)},InOut:function(s){return(s*=2)<1?-.5*(Math.sqrt(1-s*s)-1):.5*(Math.sqrt(1-(s-=2)*s)+1)}},Elastic:{In:function(s){return s===0?0:s===1?1:-Math.pow(2,10*(s-1))*Math.sin((s-1.1)*5*Math.PI)},Out:function(s){return s===0?0:s===1?1:Math.pow(2,-10*s)*Math.sin((s-.1)*5*Math.PI)+1},InOut:function(s){return s===0?0:s===1?1:(s*=2,s<1?-.5*Math.pow(2,10*(s-1))*Math.sin((s-1.1)*5*Math.PI):.5*Math.pow(2,-10*(s-1))*Math.sin((s-1.1)*5*Math.PI)+1)}},Back:{In:function(s){return s===1?1:s*s*((1.70158+1)*s-1.70158)},Out:function(s){return s===0?0:--s*s*((1.70158+1)*s+1.70158)+1},InOut:function(s){const t=2.5949095;return(s*=2)<1?.5*(s*s*((t+1)*s-t)):.5*((s-=2)*s*((t+1)*s+t)+2)}},Bounce:{In:function(s){return 1-un.Bounce.Out(1-s)},Out:function(s){return s<1/2.75?7.5625*s*s:s<2/2.75?7.5625*(s-=1.5/2.75)*s+.75:s<2.5/2.75?7.5625*(s-=2.25/2.75)*s+.9375:7.5625*(s-=2.625/2.75)*s+.984375},InOut:function(s){return s<.5?un.Bounce.In(s*2)*.5:un.Bounce.Out(s*2-1)*.5+.5}},generatePow:function(s=4){return s=s<Number.EPSILON?Number.EPSILON:s,s=s>1e4?1e4:s,{In:function(t){return t**s},Out:function(t){return 1-(1-t)**s},InOut:function(t){return t<.5?(t*2)**s/2:(1-(2-t*2)**s)/2+.5}}},random:function(s){return Math.random()},createStep:function(s){return function(t){return Math.floor(t*s)/s}},createNoisyEasing:function(s,t=.1){const e=1-t;return function(n){return t*Math.random()+e*s(n)}},swing:function(s){return s+Math.sin(s*Math.PI*2)/2},causeSeizures:function(s){return s+.2*Math.random()-.1}},hs=un,Ie={Utils:{Linear:function(s,t,e){return(t-s)*e+s},Factorial:function(){const s=[1];return function(t){let e=1;if(s[t])return s[t];for(let n=t;n>1;n--)e*=n;return s[t]=e,e}}(),Bernstein:function(s,t){const e=Ie.Utils.Factorial;return e(s)/e(t)/e(s-t)},CatmullRom:function(s,t,e,n,i){const r=(e-s)*.5,a=(n-t)*.5,o=i*i,c=i*o;return(2*t-2*e+r+a)*c+(-3*t+3*e-2*r-a)*o+r*i+t}},Linear:function(s,t){const e=s.length-1,n=e*t,i=Math.floor(n),r=Ie.Utils.Linear;return t<0?r(s[0],s[1],n):t>1?r(s[e],s[e-1],e-n):r(s[i],s[i+1>e?e:i+1],n-i)},Bezier:function(s,t){let e=0;const n=s.length-1,i=Math.pow,r=Ie.Utils.Bernstein;for(let a=0;a<=n;a++)e+=i(1-t,n-a)*i(t,a)*s[a]*r(n,a);return e},CatmullRom:function(s,t){const e=s.length-1;let n=e*t,i=Math.floor(n);const r=Ie.Utils.CatmullRom;return s[0]===s[e]?(t<0&&(i=Math.floor(n=e*(1+t))),r(s[(i-1+e)%e],s[i],s[(i+1)%e],s[(i+2)%e],n-i)):t<0?s[0]-(r(s[0],s[0],s[1],s[1],-n)-s[0]):t>1?s[e]-(r(s[e],s[e],s[e-1],s[e-1],n-e)-s[e]):r(s[i?i-1:0],s[i],s[e<i+1?e:i+1],s[e<i+2?e:i+2],n-i)}},ls=Ie;class hr{_tweens={};_tweensAddedDuringUpdate={};getAll(){return Object.keys(this._tweens).map(t=>this._tweens[t])}removeAll(){this._tweens={}}add(t){this._tweens[t.getId()]=t,this._tweensAddedDuringUpdate[t.getId()]=t}remove(t){delete this._tweens[t.getId()],delete this._tweensAddedDuringUpdate[t.getId()]}update(t=he(),e=!1){let n=Object.keys(this._tweens);if(n.length===0)return!1;for(;n.length>0;){this._tweensAddedDuringUpdate={};for(let i=0;i<n.length;i++){const r=this._tweens[n[i]],a=!e;r&&r.update(t,a)===!1&&!e&&delete this._tweens[n[i]]}n=Object.keys(this._tweensAddedDuringUpdate)}return!0}}const xt=new hr;class lr{constructor(t,e=xt){this._object=t,this._group=e}_id=ke.nextId();_isPlaying=!1;_startTime=0;_delayTime=0;_durationTime=1e3;_isPaused=!1;_pauseStartTime=0;_initialRepeat=0;_repeat=0;_repeatDelayTime;_yoyo=!1;_reversed=!1;_valuesStart={};_valuesEnd={};_valuesStartRepeat={};_easingFunction=hs.Linear.None;_interpolationFunction=ls.Linear;_chainedTweens=[];_isChainStopped=!1;_onStartCallback;_onStartCallbackFired=!1;_onEveryStartCallback;_onEveryStartCallbackFired=!1;_onUpdateCallback;_onRepeatCallback;_onCompleteCallback;_onStopCallback;_goToEnd=!1;getId(){return this._id}isPlaying(){return this._isPlaying}isPaused(){return this._isPaused}to(t,e){return this._valuesEnd=Object.create(t),e!==void 0&&(this._durationTime=e),this}duration(t=1e3){return this._durationTime=t,this}start(t=he()){if(this._isPlaying)return this;if(this._group&&this._group.add(this),this._repeat=this._initialRepeat,this._reversed){this._reversed=!1;for(const e in this._valuesStartRepeat)this._swapEndStartRepeatValues(e),this._valuesStart[e]=this._valuesStartRepeat[e]}return this._isPlaying=!0,this._isPaused=!1,this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._isChainStopped=!1,this._startTime=t,this._startTime+=this._delayTime,this._setupProperties(this._object,this._valuesStart,this._valuesEnd,this._valuesStartRepeat),this}_setupProperties(t,e,n,i){for(const r in n){const a=t[r],o=Array.isArray(a),c=o?"array":typeof a,h=!o&&Array.isArray(n[r]);if(!(c==="undefined"||c==="function")){if(h){let l=n[r];if(l.length===0)continue;l=l.map(this._handleRelativeValue.bind(this,a)),n[r]=[a].concat(l)}if((c==="object"||o)&&a&&!h){e[r]=o?[]:{};for(const l in a)e[r][l]=a[l];i[r]=o?[]:{},this._setupProperties(a,e[r],n[r],i[r])}else typeof e[r]>"u"&&(e[r]=a),o||(e[r]*=1),h?i[r]=n[r].slice().reverse():i[r]=e[r]||0}}}stop(){return this._isChainStopped||(this._isChainStopped=!0,this.stopChainedTweens()),this._isPlaying?(this._group&&this._group.remove(this),this._isPlaying=!1,this._isPaused=!1,this._onStopCallback&&this._onStopCallback(this._object),this):this}end(){return this._goToEnd=!0,this.update(1/0),this}pause(t=he()){return this._isPaused||!this._isPlaying?this:(this._isPaused=!0,this._pauseStartTime=t,this._group&&this._group.remove(this),this)}resume(t=he()){return!this._isPaused||!this._isPlaying?this:(this._isPaused=!1,this._startTime+=t-this._pauseStartTime,this._pauseStartTime=0,this._group&&this._group.add(this),this)}stopChainedTweens(){for(let t=0,e=this._chainedTweens.length;t<e;t++)this._chainedTweens[t].stop();return this}group(t=xt){return this._group=t,this}delay(t=0){return this._delayTime=t,this}repeat(t=0){return this._initialRepeat=t,this._repeat=t,this}repeatDelay(t){return this._repeatDelayTime=t,this}yoyo(t=!1){return this._yoyo=t,this}easing(t=hs.Linear.None){return this._easingFunction=t,this}interpolation(t=ls.Linear){return this._interpolationFunction=t,this}chain(...t){return this._chainedTweens=t,this}onStart(t){return this._onStartCallback=t,this}onEveryStart(t){return this._onEveryStartCallback=t,this}onUpdate(t){return this._onUpdateCallback=t,this}onRepeat(t){return this._onRepeatCallback=t,this}onComplete(t){return this._onCompleteCallback=t,this}onStop(t){return this._onStopCallback=t,this}update(t=he(),e=!0){if(this._isPaused)return!0;let n,i;const r=this._startTime+this._durationTime;if(!this._goToEnd&&!this._isPlaying){if(t>r)return!1;e&&this.start(t)}if(this._goToEnd=!1,t<this._startTime)return!0;this._onStartCallbackFired===!1&&(this._onStartCallback&&this._onStartCallback(this._object),this._onStartCallbackFired=!0),this._onEveryStartCallbackFired===!1&&(this._onEveryStartCallback&&this._onEveryStartCallback(this._object),this._onEveryStartCallbackFired=!0),i=(t-this._startTime)/this._durationTime,i=this._durationTime===0||i>1?1:i;const a=this._easingFunction(i);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,a),this._onUpdateCallback&&this._onUpdateCallback(this._object,i),i===1)if(this._repeat>0){isFinite(this._repeat)&&this._repeat--;for(n in this._valuesStartRepeat)!this._yoyo&&typeof this._valuesEnd[n]=="string"&&(this._valuesStartRepeat[n]=this._valuesStartRepeat[n]+parseFloat(this._valuesEnd[n])),this._yoyo&&this._swapEndStartRepeatValues(n),this._valuesStart[n]=this._valuesStartRepeat[n];return this._yoyo&&(this._reversed=!this._reversed),this._repeatDelayTime!==void 0?this._startTime=t+this._repeatDelayTime:this._startTime=t+this._delayTime,this._onRepeatCallback&&this._onRepeatCallback(this._object),this._onEveryStartCallbackFired=!1,!0}else{this._onCompleteCallback&&this._onCompleteCallback(this._object);for(let o=0,c=this._chainedTweens.length;o<c;o++)this._chainedTweens[o].start(this._startTime+this._durationTime);return this._isPlaying=!1,!1}return!0}_updateProperties(t,e,n,i){for(const r in n){if(e[r]===void 0)continue;const a=e[r]||0;let o=n[r];const c=Array.isArray(t[r]),h=Array.isArray(o);!c&&h?t[r]=this._interpolationFunction(o,i):typeof o=="object"&&o?this._updateProperties(t[r],a,o,i):(o=this._handleRelativeValue(a,o),typeof o=="number"&&(t[r]=a+(o-a)*i))}}_handleRelativeValue(t,e){return typeof e!="string"?e:e.charAt(0)==="+"||e.charAt(0)==="-"?t+parseFloat(e):parseFloat(e)}_swapEndStartRepeatValues(t){const e=this._valuesStartRepeat[t],n=this._valuesEnd[t];typeof n=="string"?this._valuesStartRepeat[t]=this._valuesStartRepeat[t]+parseFloat(n):this._valuesStartRepeat[t]=n,this._valuesEnd[t]=e}}const yh=ke.nextId,wh=xt.getAll.bind(xt),vh=xt.removeAll.bind(xt),bh=xt.add.bind(xt),xh=xt.remove.bind(xt),Sh=xt.update.bind(xt),fn={now:he,Sequence:ke,Easing:hs,Interpolation:ls,Group:hr,Tween:lr,nextId:yh,getAll:wh,removeAll:vh,add:bh,remove:xh,update:Sh};function Ch(s){switch(s){case"linear":return[0,0,1,1];case"ease":return[.25,.1,.25,1];case"ease-in":return[.42,0,1,1];case"ease-in-out":return[.42,0,.58,1];case"ease-out":return[0,0,.58,1]}}const Th={attributeName:["display"],values:[["block","block"]],immediate:!1},gt={easeName:"linear",begin:0,dur:300,repeatCount:1,direction:"normal",fill:"freeze",keyTimes:[0,1]};class us{objects=[];animateObjects=[];currentAnimateName;constructor(){}hasObjects(){return this.objects.length>0}fromDOM(t){return Array.isArray(t)||(t=[t]),this.objects.forEach(e=>{e.app.destroy()}),this.objects=[],t.forEach(e=>{this.objects.push({el:e,app:new ge(e),originAttrs:{}})}),this}static isRunningGlobalTween=!1;static runGlobalTween(t){this.isRunningGlobalTween||De.run(()=>(this.isRunningGlobalTween=fn.update(t?.()),this.isRunningGlobalTween))}static toTween(t,e,n){const i=n?.onStart||(()=>{}),r=n?.onUpdate||(()=>{}),a=n?.onComplete||(()=>{}),o=n?.duration||1e3,c=n?.delay||0,h=n?.easeFunction||fn.Easing.Linear.None,l=n?.repeat||0,f=n?.yoyo||!1,g=new fn.Tween(t).to(e,o).delay(c).easing(h).repeat(l).yoyo(f).onStart(i).onUpdate((w,m)=>{r(w,m)}).onComplete(a);return n?.interpolationFunction&&g.interpolation(n.interpolationFunction),{tween:g,startAuto:w=>{g.start(w?.()),De.run(()=>{const m=g.update(w?.());if(n?.precision){let v=!0;for(let b in t)ue(t[b],e[b],n.precision)||(v=!1);return v?!1:m}return m})}}}static toTweenCSS(t,e,n,i){D.add3DSupport(t);const r=i?.onUpdate||(()=>{});return us.toTween(e,n,Object.assign(i||{},{onUpdate:(a,o)=>{const c=D.convertAttrs(t,a);D.setStyle(t,c),r(a,o)}}))}addAnimateObject(t=Th,e=gt,n=0,i=!1){const r=e.easeName||"linear",a=e.dur||300,o=e.keyTimes||[0,1],c=[];o.forEach((l,f)=>{f>0&&c.push(Ch(r))});const h=this.objects[n];return this.animateObjects=i?[]:this.animateObjects,this.animateObjects.push({el:h.el,app:h.app,originAttrs:h.originAttrs,attributeName:t.attributeName,values:t.values,immediate:t.immediate||!1,easeName:r,begin:e.begin||0,dur:a,repeatCount:e.repeatCount||1,direction:e.direction||"normal",fill:e.fill||"freeze",keyTimes:o,realKeyTimes:o.map(l=>a*l),keySplines:c,calcMode:e.calcMode||"linear",onComplete:e.onComplete||(()=>{})}),this}resetAnimateObjects(t,e,n,i,r=gt,a=this.objects.length-1){let o=!0,c=!1,h=!1,l=!1;const f=this.objects.length-1;a=yt(a,0,f);let g=a-1;g=yt(g,0,f);let w=a+1;w=yt(w,0,f);const m=this.objects[a],v=this.objects[g],b=this.objects[w];if(v&&g!==a){const S=t(v);S&&(this.addAnimateObject(S,r,g,o),o=!1,c=!0)}if(m){const S=e(m);S&&(this.addAnimateObject(S,r,a,o),o=!1,h=!0)}if(b&&w!==a){const S=n(b);S&&(this.addAnimateObject(S,r,w,o),o=!1,l=!0)}this.objects.forEach((S,C)=>{if(!(C==g&&c||C==a&&h||C==w&&l)){const M=i(S);M&&(this.addAnimateObject(M,r,C,o),o=!1)}})}toCSS(t,...e){if(!this.hasObjects())return;this.currentAnimateName=t,this[t](...e),D.add3DSupport(this.objects[0].el),this.objects.forEach((r,a)=>{D.setStyle(r.el,{position:"absolute","z-index":String(2e3+a),"transform-style":"preserve-3d","backface-visibility":"hidden"})});let n=0;const i=()=>{this.animateObjects.forEach((r,a)=>{let o=[],c=[];Array.isArray(r.attributeName)?(o=r.attributeName,c=r.values):r.attributeName&&(o=[r.attributeName],c=[r.values]);const h=r.keyTimes.length;let l=r.begin;r.keyTimes.forEach((f,g)=>{if(g==0||r.immediate){const w={};o.forEach((v,b)=>{const S=c[b][r.direction=="reverse"?h-1-g:g];w[v]=S});const m=D.convertAttrs(r.el,w,r.originAttrs);D.setStyle(r.el,Object.assign(m,{transition:"none"}))}else De.runAccurateSetTimeout(()=>{const w={};o.forEach((v,b)=>{const S=c[b][r.direction=="reverse"?h-1-g:g];w[v]=S});const m=D.convertAttrs(r.el,w,r.originAttrs);D.setStyle(r.el,Object.assign(m,{transition:`all ${r.realKeyTimes[g]}ms cubic-bezier(${r.keySplines[g-1].join(",")})`}))},l),l+=r.realKeyTimes[g]}),De.runAccurateSetTimeout(()=>{r.fill==="remove"&&D.setStyle(r.el,r.originAttrs||{}),a==this.animateObjects.length-1&&(r.onComplete?.(),this.currentAnimateName==t&&(r.repeatCount=="infinite"||typeof r.repeatCount=="number"&&++n<r.repeatCount)&&i())},r.begin+r.dur)})};i()}slideLeft(t=gt,e=this.objects.length-1){this.resetAnimateObjects(n=>({attributeName:["opacity","translateTo"],values:[[1,1],[[0,0],[-n.app.width,0]]]}),n=>({attributeName:["opacity","translateTo"],values:[[1,1],[[n.app.width,0],[0,0]]]}),n=>{},n=>({attributeName:["opacity","translateTo"],values:[[0,0],[[n.app.width,0],[n.app.width,0]]],immediate:!0}),t,e)}slideRight(t=gt,e=this.objects.length-1){this.resetAnimateObjects(n=>{},n=>({attributeName:["opacity","translateTo"],values:[[1,1],[[-n.app.width,0],[0,0]]]}),n=>({attributeName:["opacity","translateTo"],values:[[1,1],[[0,0],[n.app.width,0]]]}),n=>({attributeName:["opacity","translateTo"],values:[[0,0],[[-n.app.width,0],[-n.app.width,0]]],immediate:!0}),t,e)}slideDown(t=gt,e=this.objects.length-1){this.resetAnimateObjects(n=>({attributeName:["opacity","translateTo"],values:[[1,1],[[0,0],[0,n.app.height]]]}),n=>({attributeName:["opacity","translateTo"],values:[[1,1],[[0,-n.app.height],[0,0]]]}),n=>{},n=>({attributeName:["opacity","translateTo"],values:[[0,0],[[0,-n.app.height],[0,-n.app.height]]],immediate:!0}),t,e)}slideUp(t=gt,e=this.objects.length-1){this.resetAnimateObjects(n=>({attributeName:["opacity","translateTo"],values:[[1,1],[[0,0],[0,-n.app.height]]]}),n=>({attributeName:["opacity","translateTo"],values:[[1,1],[[0,n.app.height],[0,0]]]}),n=>{},n=>({attributeName:["opacity","translateTo"],values:[[0,0],[[0,n.app.height],[0,n.app.height]]],immediate:!0}),t,e)}flipLeft(t=gt,e=this.objects.length-1){this.resetAnimateObjects(n=>({attributeName:["opacity","rotateYTo"],values:[[1,1],[0,180]]}),n=>({attributeName:["opacity","rotateYTo"],values:[[1,1],[-180,0]]}),n=>{},n=>({attributeName:["opacity"],values:[[0,0]],immediate:!0}),t,e)}flipRight(t=gt,e=this.objects.length-1){this.resetAnimateObjects(n=>({attributeName:["opacity","rotateYTo"],values:[[1,1],[0,-180]]}),n=>({attributeName:["opacity","rotateYTo"],values:[[1,1],[180,0]]}),n=>{},n=>({attributeName:["opacity"],values:[[0,0]],immediate:!0}),t,e)}flipDown(t=gt,e=this.objects.length-1){this.resetAnimateObjects(n=>({attributeName:["opacity","rotateXTo"],values:[[1,1],[0,-180]]}),n=>({attributeName:["opacity","rotateXTo"],values:[[1,1],[180,0]]}),n=>{},n=>({attributeName:["opacity"],values:[[0,0]],immediate:!0}),t,e)}flipUp(t=gt,e=this.objects.length-1){this.resetAnimateObjects(n=>({attributeName:["opacity","rotateXTo"],values:[[1,1],[0,180]]}),n=>({attributeName:["opacity","rotateXTo"],values:[[1,1],[-180,0]]}),n=>{},n=>({attributeName:["opacity"],values:[[0,0]],immediate:!0}),t,e)}popIn(t=gt,e=this.objects.length-1){this.resetAnimateObjects(n=>{},n=>({attributeName:["translateTo","scaleTo","opacity"],values:[[[0,0],[0,0]],[.8,1],[0,1]]}),n=>{},n=>({attributeName:["opacity"],values:[[0,0]],immediate:!0}),t,e)}popOut(t=gt,e=this.objects.length-1){this.resetAnimateObjects(n=>{},n=>({attributeName:["translateTo","scaleTo","opacity"],values:[[[0,0],[0,0]],[1,1.2],[1,0]]}),n=>{},n=>({attributeName:["opacity"],values:[[0,0]],immediate:!0}),t,e)}rotate(t=gt,e=this.objects.length-1){Object.assign(t,{keyTimes:[0,1]});const n=t.degree||360;this.resetAnimateObjects(i=>{},i=>({attributeName:["opacity","rotate"],values:[[1,1],[0,n]]}),i=>{},i=>({attributeName:["opacity"],values:[[0,0]],immediate:!0}),t,e)}}class Eh{app;ctx;shapes=[];isMouseDown=!1;currentMouseInShapeID="";currentEnableDragMouseInShapeID="";constructor(t){this.app=t,this.ctx=new hn(this.app.container),this.app.captureMove({start:()=>{this.isMouseDown=!0,this.setCursor()},end:()=>{this.isMouseDown=!1,this.setCursor()},move:()=>{if(this.currentMouseInShapeID="",this.isMouseDown&&this.currentEnableDragMouseInShapeID){this.setCursor();return}let e=0,n=this.shapes.length;for(;e<n;e++){const i=this.shapes[e];this.ctx.save(),this.transformCtxBaseOnShape(i);const r=this.ctx.isPointInPath(i.path2d,this.app.mousePoint.x,this.app.mousePoint.y)||!1;if(this.ctx.restore(),r&&(this.currentMouseInShapeID=i.id),i.mouseMove&&i.mouseMove(r),r&&i.enableDrag){this.currentEnableDragMouseInShapeID=i.id;break}}e>=n&&(this.currentEnableDragMouseInShapeID=""),this.setCursor()}})}setCursor(){this.currentEnableDragMouseInShapeID?(this.app.container.style.cursor="grab",this.isMouseDown&&(this.app.container.style.cursor="grabbing")):this.currentMouseInShapeID?this.app.container.style.cursor="pointer":this.app.container.style.cursor="default"}transformCtxBaseOnShape(t){!(t instanceof bt)&&!(t instanceof z)&&this.ctx.translate(t.x,t.y),this.ctx.rotate(ot(t.degree)),this.ctx.scale(t.scaleOnOrigin,t.scaleOnOrigin)}draw(t=[]){const e=[];Vr(t)?e.push(...t):e.push(t),this.shapes=[],e.forEach(n=>{n instanceof oe?this.shapes.push(...n.shapes):this.shapes.push(n)});for(let n of this.shapes)if(n.isShow){if(this.ctx.save(),D.attrsToCanvas(this.ctx,n.attrs),n.followMouse&&(!ue(n.x,this.app.mousePoint.x,5)||!ue(n.y,this.app.mousePoint.y,5))&&(n.angleTo(this.app.mousePoint),n.followTo(this.app.mousePoint)),n.targetToAfterDragFree&&(this.isMouseDown||n.nextFrameEaseTo(new mt({x:n.targetToAfterDragFree.targetX,y:n.targetToAfterDragFree.targetY}),{easing:n.targetToAfterDragFree?.easing})),this.isMouseDown&&this.currentEnableDragMouseInShapeID==n.id){const{dx:i,dy:r}=n.centerDiff;n.x=this.app.mousePoint.x,n.y=this.app.mousePoint.y,n.x-=i,n.y-=r,n.isDragging=!0,this.shapes.filter(a=>a.id!=n.id).forEach(a=>a.isDragging=!1)}this.transformCtxBaseOnShape(n),n.toCanvasContext(this.ctx),this.ctx.hasSetCustomStrokeStyle&&this.ctx.stroke(),this.ctx.hasSetCustomFillStyle&&this.ctx.fill(),n.path2d=this.ctx.currentPath2D,this.ctx.restore()}return this}click(t){const e=()=>{this.shapes.forEach(n=>{(n instanceof z&&n.isPointInPath(this.app.mousePoint.x,this.app.mousePoint.y,this.ctx)||this.currentMouseInShapeID==n.id)&&t(n)})};return this.app.on("tap",e),()=>{this.app.off("tap",e)}}drawMouseMoveLine(t="line",e){switch(t){case"brush":const n=e?.brushSize??10,i=e?.brushDensity??50,r=e?.brushColor??"#000000",a=this.ctx.getImageData(0,0,this.ctx.canvas.width,this.ctx.canvas.height),o=a.data,c=jt(r);return this.app.captureMove({move:()=>{if(this.isMouseDown){for(let h=0;h<i;h++){const l=Math.random()*Math.PI*2,f=Math.random()*n,g=this.app.mousePoint.x+Math.cos(l)*f|0,w=this.app.mousePoint.y+Math.sin(l)*f|0,m=(g+w*a.width)*4;o[m]=c.r,o[m+1]=c.g,o[m+2]=c.b,o[m+3]=255}this.ctx.putImageData(a)}}});case"line":default:return this.app.captureMove({start:h=>{this.ctx.beginPath(),this.app.setMousePoint(h),this.ctx.moveTo(this.app.mousePoint.x,this.app.mousePoint.y)},end:()=>{this.ctx.closePath()},move:()=>{this.isMouseDown&&(this.ctx.lineTo(this.app.mousePoint.x,this.app.mousePoint.y),this.ctx.stroke())}})}}}class Ph{localVideoUtil;remoteVideoUtil;localPeerConnection=null;remotePeerConnection=null;constructor(t,e){this.localVideoUtil=new ye(t),this.remoteVideoUtil=new ye(e)}start(){this.getLocalMediaStream().then(t=>{this.call(t)})}end(){this.localPeerConnection?.close(),this.remotePeerConnection?.close(),this.localPeerConnection=null,this.remotePeerConnection=null,this.trace("Ending call.")}getLocalMediaStream(){return new Promise((t,e)=>{navigator.mediaDevices.getUserMedia({audio:!0,video:!0}).then(n=>{this.localVideoUtil.setSrcObject(n),t(n)}).catch(n=>{this.trace(`navigator.getUserMedia error: ${n}.`),e(n)})})}gotRemoteMediaStream(t){const e=t.streams[0];this.remoteVideoUtil.setSrcObject(e),this.trace("Remote peer connection received remote stream.")}call(t){const e=t.getVideoTracks(),n=t.getAudioTracks();e.length>0&&this.trace(`Using video device: ${e[0].label}.`),n.length>0&&this.trace(`Using audio device: ${n[0].label}.`);const i=void 0,r=new RTCPeerConnection(i);this.localPeerConnection=r,this.trace("Created local peer connection object localPeerConnection."),r.addEventListener("icecandidate",this.handleConnection),r.addEventListener("iceconnectionstatechange",this.handleConnectionChange);const a=new RTCPeerConnection(i);this.remotePeerConnection=a,this.trace("Created remote peer connection object remotePeerConnection."),a.addEventListener("icecandidate",this.handleConnection),a.addEventListener("iceconnectionstatechange",this.handleConnectionChange),a.addEventListener("track",this.gotRemoteMediaStream),this.trace("Add local localStream to localPeerConnection."),r.addTrack(e[0],t),r.addTrack(n[0],t),this.trace("localPeerConnection createOffer start."),r.createOffer({offerToReceiveVideo:!0}).then(o=>this.createdOffer(o)).catch(o=>this.setSessionDescriptionError(o))}handleConnection(t){const e=t.target,n=t.candidate;if(e&&n){const i=new RTCIceCandidate(n),r=this.getOtherPeer(e);r&&(r.addIceCandidate(i).then(()=>{this.handleConnectionSuccess(e)}).catch(a=>{this.handleConnectionFailure(e,a)}),this.trace(`${this.getPeerName(e)} ICE candidate:
|
|
42
42
|
${t.candidate.candidate}.`))}}handleConnectionSuccess(t){this.trace(`${this.getPeerName(t)} addIceCandidate success.`)}handleConnectionFailure(t,e){this.trace(`${this.getPeerName(t)} failed to add ICE Candidate:
|
|
43
43
|
${e.toString()}.`)}handleConnectionChange(t){const e=t.target;console.log("ICE state change event: ",t),e&&this.trace(`${this.getPeerName(e)} ICE state: ${e.iceConnectionState}.`)}createdOffer(t){this.trace(`Offer from localPeerConnection:
|
|
44
44
|
${t.sdp}`),this.localPeerConnection&&(this.trace("localPeerConnection setLocalDescription start."),this.localPeerConnection.setLocalDescription(t).then(()=>{this.setLocalDescriptionSuccess(this.localPeerConnection)}).catch(e=>this.setSessionDescriptionError(e))),this.remotePeerConnection&&(this.trace("remotePeerConnection setRemoteDescription start."),this.remotePeerConnection.setRemoteDescription(t).then(()=>{this.setRemoteDescriptionSuccess(this.remotePeerConnection)}).catch(e=>this.setSessionDescriptionError(e)),this.trace("remotePeerConnection createAnswer start."),this.remotePeerConnection.createAnswer().then(e=>this.createdAnswer(e)).catch(e=>this.setSessionDescriptionError(e)))}createdAnswer(t){this.trace(`Answer from remotePeerConnection:
|
|
45
|
-
${t.sdp}.`),this.remotePeerConnection&&(this.trace("remotePeerConnection setLocalDescription start."),this.remotePeerConnection.setLocalDescription(t).then(()=>{this.setLocalDescriptionSuccess(this.remotePeerConnection)}).catch(e=>this.setSessionDescriptionError(e))),this.localPeerConnection&&(this.trace("localPeerConnection setRemoteDescription start."),this.localPeerConnection.setRemoteDescription(t).then(()=>{this.setRemoteDescriptionSuccess(this.localPeerConnection)}).catch(e=>this.setSessionDescriptionError(e)))}setSessionDescriptionError(t){this.trace(`Failed to create session description: ${t.toString()}.`)}setDescriptionSuccess(t,e){const n=this.getPeerName(t);this.trace(`${n} ${e} complete.`)}setLocalDescriptionSuccess(t){this.setDescriptionSuccess(t,"setLocalDescription")}setRemoteDescriptionSuccess(t){this.setDescriptionSuccess(t,"setRemoteDescription")}trace(t){t=t.trim();const e=(window.performance.now()/1e3).toFixed(3);console.log(e,t);const n=document.createElement("div");n.innerHTML=`<div>${e}, ${t}</div>`,document.getElementById("trace")?.appendChild(n)}getOtherPeer(t){return t===this.localPeerConnection?this.remotePeerConnection:this.localPeerConnection}getPeerName(t){return t===this.localPeerConnection?"localPeerConnection":"remotePeerConnection"}}class Ch{canvas;gl;constructor(t){this.canvas=t;const e={alpha:!0,premultipliedAlpha:!1};if(this.gl=this.canvas.getContext("webgl",e),!this.gl)throw new Error("WebGL failed to initialize.")}}function lr(s,t){return!s||s.parentElement===null?t:lr(s.parentElement,t.concat([s]))}const ls=function(s,t){return getComputedStyle(s,null).getPropertyValue(t)},Th=function(s){return ls(s,"overflow")+ls(s,"overflow-y")+ls(s,"overflow-x")},Eh=function(s){return/(auto|scroll)/.test(Th(s))};function Ph(s){if(!(s instanceof HTMLElement||s instanceof SVGElement))return;const t=lr(s.parentElement,[]);for(let e=0;e<t.length;e+=1)if(Eh(t[e]))return t[e];return document.scrollingElement||document.documentElement}const ur=[],fr={};function us(s){ur.push(s)}function _h(s,t=!1){const e=ci();if(fr[e])return;wx.error(r=>{console.log(r.errMsg??JSON.stringify(r))}),wx.ready(()=>{ur.forEach(r=>r())});const n=["updateAppMessageShareData","updateTimelineShareData","onMenuShareWeibo","onMenuShareQZone","startRecord","stopRecord","onVoiceRecordEnd","playVoice","pauseVoice","stopVoice","onVoicePlayEnd","uploadVoice","downloadVoice","chooseImage","previewImage","uploadImage","downloadImage","getLocalImgData","translateVoice","getNetworkType","openLocation","getLocation","hideOptionMenu","showOptionMenu","hideMenuItems","showMenuItems","hideAllNonBaseMenuItem","showAllNonBaseMenuItem","closeWindow","scanQRCode","openProductSpecificView","addCard","chooseCard","openCard"],i=["wx-open-launch-app","wx-open-launch-app","wx-open-subscribe","wx-open-audio"];wx.config(Object.assign(s,{debug:t,jsApiList:n,openTagList:i})),fr[e]=!0}function Dh(s){return new Promise((t,e)=>{wx.checkJsApi({jsApiList:[s],success:function(n){n.checkResult[s]?t(!0):e(!1)},fail:function(){e(!1)}})})}function Ah(s){us(function(){wx.updateAppMessageShareData(s)})}function kh(s){us(function(){wx.updateTimelineShareData(s)})}function Ih(s){wx.chooseImage(s)}function Mh(s){wx.previewImage(s)}function Rh(s){wx.uploadImage(s)}function Oh(s){wx.downloadImage(s)}function Lh(s){wx.getLocalImgData(s)}function Nh(){wx.startRecord()}function Fh(s){wx.stopRecord(s)}function Bh(s){wx.onVoiceRecordEnd(s)}function Uh(s){wx.playVoice(s)}function Vh(s){wx.pauseVoice(s)}function Gh(s){wx.stopVoice(s)}function jh(s){wx.onVoicePlayEnd(s)}function Xh(s){wx.uploadVoice(s)}function zh(s){wx.downloadVoice(s)}function qh(s){wx.translateVoice(s)}function Yh(s){wx.getNetworkType(s)}function Hh(s){wx.openLocation(s)}function Wh(s){wx.getLocation(s)}function $h(s){wx.scanQRCode(s)}function Jh(s,t,e){function n(){WeixinJSBridge.invoke("getBrandWCPayRequest",s,function(i){i.err_msg=="get_brand_wcpay_request:ok"?t():e(i.err_msg)})}typeof WeixinJSBridge>"u"?document.addEventListener?document.addEventListener("WeixinJSBridgeReady",n,!1):document.attachEvent&&(document.attachEvent("WeixinJSBridgeReady",n),document.attachEvent("onWeixinJSBridgeReady",n)):n()}function Zh(s){window.AlipayJSBridge?s&&s():document.addEventListener("AlipayJSBridgeReady",s,!1)}function Ie(s,t){let e="未知错误";switch(s.error){case 1:e="接口不存在";break;case 2:e="参数无效";break;case 3:e="发生未知错误";break;case 4:e="接口无权限";break;case 10:e="用户取消";break;case 11:e="操作失败",t==="chooseImage"&&(e="操作失败(权限不够)");break;case 12:e="GPS打开,但定位失败";break;case 13:e="获取地理位置信息失败";break;case 14:e="定位超时";break;case 15:e="网络错误";break;case 16:e="GPS未打开或用户未授权";break}return`${s.error}(${e}): ${s.errorMessage}`}function Kh(s,t,e){ap.tradePay(Object.assign(s,{}),function(n){let i="未知错误";switch(n.resultCode){case 9e3:return i="订单支付成功",t?.(i);case 8e3:i="正在处理中";break;case 4e3:i="订单支付失败";break;case 6001:i="用户中途取消";break;case 6002:i="网络连接出错";break;case 99:i="用户点击忘记密码导致快捷界面退出(only iOS)";break}e?.(i)})}function Qh(s,t,e){ap.scan(Object.assign(s,{fail:n=>{e?.(Ie(n))}}),function(n){t?.(n.code)})}function tl(s,t,e){ap.getLocation(Object.assign(s,{fail:n=>{e?.(Ie(n))}}),function(n){t?.(n)})}function el(s,t,e){ap.openLocation(Object.assign(s,{fail:n=>{e?.(Ie(n))}}),function(){t?.()})}function nl(s,t,e){ap.chooseImage(Object.assign(s,{fail:n=>{e?.(Ie(n,"chooseImage"))}}),function(n){t?.(n)})}function sl(s,t,e){ap.previewImage(Object.assign(s,{fail:n=>{e?.(Ie(n))}}),function(){t?.()})}class il{map;constructor(t,e=120.619585,n=31.299379,i=18){this.map=new T.Map(t),this.map.centerAndZoom(new T.LngLat(e,n),i)}}return p.AnimateOperation=hs,p.Arc=oe,p.Arrow=lh,p.Canvas=xh,p.CanvasOperation=on,p.CubicBezier=Pt,p.CustomCanvasContext=Ee,p.CustomCanvasGradient=an,p.CustomCanvasPattern=is,p.DOMEventBus=pe,p.DOMKey=si,p.DOMParse=ii,p.DOMSVGUtil=ee,p.DOMToBlob=Ns,p.DOMToString=En,p.DOMUtil=D,p.DOMVideo=ge,p.Dep=er,p.Ellipse=rr,p.FetchWithAxios=fc,p.FetchWithAxiosRequestCancel=zi,p.Fox=uh,p.Line=bt,p.Matrix=st,p.Matrix3D=Wt,p.PathD=j,p.PathDGroup=Pe,p.Point=mt,p.Point3d=oh,p.Point3ds=ch,p.Points=rs,p.QRCode=zt,p.QuadraticBezier=cn,p.Rect=Et,p.SVG=sh,p.SVGParse=sr,p.SVGParsedPathArgsLength=me,p.Sector=hh,p.SectorArc=ar,p.Shape=K,p.ShapeGroup=ae,p.TWEEN=ln,p.Text=as,p.Tween=hr,p.Vector=sn,p.WebGLRenderer=Ch,p.WebRTCClient=Sh,p.WebSocketClient=Zr,p.addWatermark=Wc,p.addWxJsReadyFnBeforeConfig=us,p.ajax=Ja,p.aliJsChooseImage=nl,p.aliJsGetLocation=tl,p.aliJsOpenLocation=el,p.aliJsPreviewImage=sl,p.aliJsReady=Zh,p.aliJsScan=Qh,p.aliJsTradePay=Kh,p.angle=fe,p.animateInWeb=or,p.appendURLSearchString=ui,p.base64EncodeOutputStream=Wi,p.blobToRawImage=bc,p.byteArrayOutputStream=Qn,p.canDrawBitmap=Ca,p.canUsePaths=Sa,p.canUseWorker=Zs,p.changeBrightness=Yc,p.changeDiaphaneity=Hc,p.changeSize=qc,p.checkWxJsApi=Dh,p.clearCookies=Ra,p.createXMLHttpRequest=fi,p.distance=In,p.drawQRCodeToCanvas=Qc,p.fileOrBlobToDataURL=Zn,p.flipSideToSide=Sc,p.flipUpsideDown=Cc,p.flushURLSearchString=Ha,p.formDataToSearchString=li,p.fromRadianAndLength=Gt,p.getBrowserClient=Dn,p.getBrowserClientVersion=ca,p.getBrowserLanguage=la,p.getColor=$t,p.getColorScheme=ri,p.getCookie=Ia,p.getCookieObject=Ma,p.getDirection=Pa,p.getElementLeftPositionInPage2=js,p.getElementPositionInPage=Gs,p.getElementPositionInPage2=na,p.getElementPositionInViewport=sa,p.getElementTopPositionInPage2=Xs,p.getFileExtension=Bs,p.getFileString=$a,p.getFileTypeFromFile=Wr,p.getFilesImageInfo=mc,p.getFormSubmitData=Za,p.getGlobal=_n,p.getHexString=Xe,p.getImageAspectRatio=dc,p.getImageDataByAIData=Jc,p.getImageDataFromBitmap=gc,p.getImageDataFromUrl=qi,p.getImageDataFromVideo=pc,p.getImageMainColor=xc,p.getInternetExplorerVersion=Hs,p.getMousePositionInElement=qs,p.getMousePositionInPage=zs,p.getMousePositionInViewport=aa,p.getOperatingSystem=Ge,p.getOperatingSystemVersion=oa,p.getPageBodyElement=Qr,p.getPageDocumentElement=te,p.getPageSize=ea,p.getRGBString=La,p.getRawImageInfo=en,p.getRelativeBoundingClientRect=ia,p.getScreenElement=Kr,p.getScrollParent=Ph,p.getTimeZone=ua,p.getURL=ze,p.getUserGeolocationPromise=ha,p.getVerticalScrollPercentInPage=ra,p.getViewportSize=ta,p.getWorker=Wa,p.gifImage=$i,p.gradientColor=Ba,p.h=Jr,p.hasDocument=va,p.hasHistory=ba,p.hasWindow=Js,p.hsb2rgb=Va,p.hsl2rgb=Ga,p.hsv2rgb=Ua,p.imageDataToBitmap=yc,p.imageDataToBlob=vc,p.imageDataToDataURL=wc,p.injectWxJsConfig=_h,p.isAliBrowser=$s,p.isAliMiniProgram=wa,p.isAndroid=Ys,p.isAppleDevice=fa,p.isBrowserSupportFileAPI=xa,p.isDarkMode=ma,p.isIE=pa,p.isIE9or10=ga,p.isIOS=An,p.isMacOS=kn,p.isMobile=da,p.isURL=qa,p.isWxBrowser=Ws,p.isWxMiniProgram=ya,p.jpgToPng=Gc,p.leftRotate=Tc,p.length=Ks,p.linkExport=Pn,p.localstorage=Ln,p.mapTDTJSSDK=il,p.marginSharpen=Vc,p.microTask=$r,p.mosaic=$c,p.mount=ue,p.normalizePoint=Ea,p.outputGifBase64=Ji,p.outputQRCodeBase64=Kc,p.padColorString=ye,p.parseTransformToMatrix=Mn,p.parseURL=oi,p.patch=Us,p.patchDOM=Vs,p.pngToJpg=jc,p.radiusClip=zc,p.randomColorHexString=Na,p.randomColorNumber=ai,p.reactive=nh,p.reactiveVue2=eh,p.reactiveVue3=nr,p.readFileInBrowser=Ve,p.recordToSearchString=hi,p.rectClip=Xc,p.rgb2hsb=Xa,p.rgb2hsl=za,p.rgb2hsv=ja,p.rightRotate=Ec,p.searchStringToRecord=Ya,p.selectFileInBrowser=Fs,p.setColorScheme=je,p.setCookie=ka,p.setRem=Ta,p.shadeColor=Fa,p.sharpen=Uc,p.singletonGlobalAnimateInWeb=_e,p.stringToBlob=Tn,p.stringToDOM=Hr,p.theme=Oa,p.toBlackAndWhite=Dc,p.toBlue=Mc,p.toBlueAndGreen=Lc,p.toBlueAndGrey=Bc,p.toDegree=nt,p.toGreen=Ic,p.toGreenAndGrey=Fc,p.toGrey=Pc,p.toGrey2=_c,p.toOpposite=Ac,p.toRadian=ot,p.toRed=kc,p.toRedAndBlue=Oc,p.toRedAndGreen=Rc,p.toRedAndGrey=Nc,p.trimURLHash=ci,p.watchEffect=th,p.wxJsChooseImage=Ih,p.wxJsDownloadImage=Oh,p.wxJsDownloadVoice=zh,p.wxJsGetLocalImgData=Lh,p.wxJsGetLocation=Wh,p.wxJsGetNetworkType=Yh,p.wxJsOnVoicePlayEnd=jh,p.wxJsOnVoiceRecordEnd=Bh,p.wxJsOpenLocation=Hh,p.wxJsPauseVoice=Vh,p.wxJsPay=Jh,p.wxJsPlayVoice=Uh,p.wxJsPreviewImage=Mh,p.wxJsScanQRCode=$h,p.wxJsStartRecord=Nh,p.wxJsStopRecord=Fh,p.wxJsStopVoice=Gh,p.wxJsTranslateVoice=qh,p.wxJsUpdateAppMessageShareData=Ah,p.wxJsUpdateTimelineShareData=kh,p.wxJsUploadImage=Rh,p.wxJsUploadVoice=Xh,Object.defineProperty(p,Symbol.toStringTag,{value:"Module"}),p}({});
|
|
45
|
+
${t.sdp}.`),this.remotePeerConnection&&(this.trace("remotePeerConnection setLocalDescription start."),this.remotePeerConnection.setLocalDescription(t).then(()=>{this.setLocalDescriptionSuccess(this.remotePeerConnection)}).catch(e=>this.setSessionDescriptionError(e))),this.localPeerConnection&&(this.trace("localPeerConnection setRemoteDescription start."),this.localPeerConnection.setRemoteDescription(t).then(()=>{this.setRemoteDescriptionSuccess(this.localPeerConnection)}).catch(e=>this.setSessionDescriptionError(e)))}setSessionDescriptionError(t){this.trace(`Failed to create session description: ${t.toString()}.`)}setDescriptionSuccess(t,e){const n=this.getPeerName(t);this.trace(`${n} ${e} complete.`)}setLocalDescriptionSuccess(t){this.setDescriptionSuccess(t,"setLocalDescription")}setRemoteDescriptionSuccess(t){this.setDescriptionSuccess(t,"setRemoteDescription")}trace(t){t=t.trim();const e=(window.performance.now()/1e3).toFixed(3);console.log(e,t);const n=document.createElement("div");n.innerHTML=`<div>${e}, ${t}</div>`,document.getElementById("trace")?.appendChild(n)}getOtherPeer(t){return t===this.localPeerConnection?this.remotePeerConnection:this.localPeerConnection}getPeerName(t){return t===this.localPeerConnection?"localPeerConnection":"remotePeerConnection"}}class _h{canvas;gl;constructor(t){this.canvas=t;const e={alpha:!0,premultipliedAlpha:!1};if(this.gl=this.canvas.getContext("webgl",e),!this.gl)throw new Error("WebGL failed to initialize.")}}function ur(s,t){return!s||s.parentElement===null?t:ur(s.parentElement,t.concat([s]))}const fs=function(s,t){return getComputedStyle(s,null).getPropertyValue(t)},Dh=function(s){return fs(s,"overflow")+fs(s,"overflow-y")+fs(s,"overflow-x")},Ah=function(s){return/(auto|scroll)/.test(Dh(s))};function kh(s){if(!(s instanceof HTMLElement||s instanceof SVGElement))return;const t=ur(s.parentElement,[]);for(let e=0;e<t.length;e+=1)if(Ah(t[e]))return t[e];return document.scrollingElement||document.documentElement}const fr=[],dr={};function ds(s){fr.push(s)}function Ih(s,t=!1){const e=hi();if(dr[e])return;wx.error(r=>{console.log(r.errMsg??JSON.stringify(r))}),wx.ready(()=>{fr.forEach(r=>r())});const n=["updateAppMessageShareData","updateTimelineShareData","onMenuShareWeibo","onMenuShareQZone","startRecord","stopRecord","onVoiceRecordEnd","playVoice","pauseVoice","stopVoice","onVoicePlayEnd","uploadVoice","downloadVoice","chooseImage","previewImage","uploadImage","downloadImage","getLocalImgData","translateVoice","getNetworkType","openLocation","getLocation","hideOptionMenu","showOptionMenu","hideMenuItems","showMenuItems","hideAllNonBaseMenuItem","showAllNonBaseMenuItem","closeWindow","scanQRCode","openProductSpecificView","addCard","chooseCard","openCard"],i=["wx-open-launch-app","wx-open-launch-app","wx-open-subscribe","wx-open-audio"];wx.config(Object.assign(s,{debug:t,jsApiList:n,openTagList:i})),dr[e]=!0}function Mh(s){return new Promise((t,e)=>{wx.checkJsApi({jsApiList:[s],success:function(n){n.checkResult[s]?t(!0):e(!1)},fail:function(){e(!1)}})})}function Rh(s){ds(function(){wx.updateAppMessageShareData(s)})}function Oh(s){ds(function(){wx.updateTimelineShareData(s)})}function Lh(s){wx.chooseImage(s)}function Nh(s){wx.previewImage(s)}function Fh(s){wx.uploadImage(s)}function Bh(s){wx.downloadImage(s)}function Uh(s){wx.getLocalImgData(s)}function Vh(){wx.startRecord()}function Gh(s){wx.stopRecord(s)}function zh(s){wx.onVoiceRecordEnd(s)}function jh(s){wx.playVoice(s)}function Xh(s){wx.pauseVoice(s)}function qh(s){wx.stopVoice(s)}function Yh(s){wx.onVoicePlayEnd(s)}function Hh(s){wx.uploadVoice(s)}function Wh(s){wx.downloadVoice(s)}function $h(s){wx.translateVoice(s)}function Jh(s){wx.getNetworkType(s)}function Zh(s){wx.openLocation(s)}function Kh(s){wx.getLocation(s)}function Qh(s){wx.scanQRCode(s)}function tl(s,t,e){function n(){WeixinJSBridge.invoke("getBrandWCPayRequest",s,function(i){i.err_msg=="get_brand_wcpay_request:ok"?t():e(i.err_msg)})}typeof WeixinJSBridge>"u"?document.addEventListener?document.addEventListener("WeixinJSBridgeReady",n,!1):document.attachEvent&&(document.attachEvent("WeixinJSBridgeReady",n),document.attachEvent("onWeixinJSBridgeReady",n)):n()}function el(s){window.AlipayJSBridge?s&&s():document.addEventListener("AlipayJSBridgeReady",s,!1)}function Me(s,t){let e="未知错误";switch(s.error){case 1:e="接口不存在";break;case 2:e="参数无效";break;case 3:e="发生未知错误";break;case 4:e="接口无权限";break;case 10:e="用户取消";break;case 11:e="操作失败",t==="chooseImage"&&(e="操作失败(权限不够)");break;case 12:e="GPS打开,但定位失败";break;case 13:e="获取地理位置信息失败";break;case 14:e="定位超时";break;case 15:e="网络错误";break;case 16:e="GPS未打开或用户未授权";break}return`${s.error}(${e}): ${s.errorMessage}`}function nl(s,t,e){ap.tradePay(Object.assign(s,{}),function(n){let i="未知错误";switch(n.resultCode){case 9e3:return i="订单支付成功",t?.(i);case 8e3:i="正在处理中";break;case 4e3:i="订单支付失败";break;case 6001:i="用户中途取消";break;case 6002:i="网络连接出错";break;case 99:i="用户点击忘记密码导致快捷界面退出(only iOS)";break}e?.(i)})}function sl(s,t,e){ap.scan(Object.assign(s,{fail:n=>{e?.(Me(n))}}),function(n){t?.(n.code)})}function il(s,t,e){ap.getLocation(Object.assign(s,{fail:n=>{e?.(Me(n))}}),function(n){t?.(n)})}function rl(s,t,e){ap.openLocation(Object.assign(s,{fail:n=>{e?.(Me(n))}}),function(){t?.()})}function al(s,t,e){ap.chooseImage(Object.assign(s,{fail:n=>{e?.(Me(n,"chooseImage"))}}),function(n){t?.(n)})}function ol(s,t,e){ap.previewImage(Object.assign(s,{fail:n=>{e?.(Me(n))}}),function(){t?.()})}class cl{map;constructor(t,e=120.619585,n=31.299379,i=18){this.map=new T.Map(t),this.map.centerAndZoom(new T.LngLat(e,n),i)}}return p.AnimateOperation=us,p.Arc=ce,p.Arrow=mh,p.Canvas=Eh,p.CanvasOperation=hn,p.CubicBezier=_t,p.CustomCanvasContext=Pe,p.CustomCanvasGradient=cn,p.CustomCanvasPattern=as,p.DOMEventBus=ge,p.DOMKey=ii,p.DOMParse=ri,p.DOMSVGUtil=ne,p.DOMToBlob=Bs,p.DOMToString=_n,p.DOMUtil=D,p.DOMVideo=ye,p.Dep=nr,p.Ellipse=ar,p.FetchWithAxios=mc,p.FetchWithAxiosRequestCancel=qi,p.Fox=ph,p.Line=bt,p.Matrix=tt,p.Matrix3D=Zt,p.PathD=z,p.PathDGroup=_e,p.Point=mt,p.Point3d=hh,p.Point3ds=fh,p.Points=os,p.QRCode=Yt,p.QuadraticBezier=ln,p.Rect=Pt,p.SVG=rh,p.SVGParse=ir,p.SVGParsedPathArgsLength=pe,p.Sector=dh,p.SectorArc=or,p.Shape=J,p.ShapeGroup=oe,p.TWEEN=fn,p.Text=cs,p.Tween=lr,p.Vector=an,p.WebGLRenderer=_h,p.WebRTCClient=Ph,p.WebSocketClient=Qr,p.addWatermark=Jc,p.addWxJsReadyFnBeforeConfig=ds,p.ajax=Ka,p.aliJsChooseImage=al,p.aliJsGetLocation=il,p.aliJsOpenLocation=rl,p.aliJsPreviewImage=ol,p.aliJsReady=el,p.aliJsScan=sl,p.aliJsTradePay=nl,p.angle=de,p.animateInWeb=cr,p.appendURLSearchString=fi,p.base64EncodeOutputStream=$i,p.blobToRawImage=Sc,p.byteArrayOutputStream=es,p.canDrawBitmap=Ea,p.canUsePaths=Ta,p.canUseWorker=Qs,p.changeBrightness=Wc,p.changeDiaphaneity=$c,p.changeSize=Hc,p.checkWxJsApi=Mh,p.clearCookies=La,p.createXMLHttpRequest=di,p.distance=Rn,p.drawQRCodeToCanvas=eh,p.fileOrBlobToDataURL=Qn,p.flipSideToSide=Tc,p.flipUpsideDown=Ec,p.flushURLSearchString=$a,p.formDataToSearchString=ui,p.fromRadianAndLength=zt,p.getBrowserClient=kn,p.getBrowserClientVersion=la,p.getBrowserLanguage=fa,p.getColor=jt,p.getColorScheme=ai,p.getCookie=Ra,p.getCookieObject=Oa,p.getDirection=Da,p.getElementLeftPositionInPage2=Xs,p.getElementPositionInPage=js,p.getElementPositionInPage2=ia,p.getElementPositionInViewport=ra,p.getElementTopPositionInPage2=qs,p.getFileExtension=Vs,p.getFileString=Za,p.getFileTypeFromFile=Jr,p.getFilesImageInfo=gc,p.getFormSubmitData=Qa,p.getGlobal=An,p.getHexColorString=we,p.getImageAspectRatio=pc,p.getImageDataByAIData=Kc,p.getImageDataFromBitmap=wc,p.getImageDataFromUrl=Yi,p.getImageDataFromVideo=yc,p.getImageMainColor=Cc,p.getInternetExplorerVersion=$s,p.getMousePositionInElement=Hs,p.getMousePositionInPage=Ys,p.getMousePositionInViewport=ca,p.getOperatingSystem=ze,p.getOperatingSystemVersion=ha,p.getPageBodyElement=ea,p.getPageDocumentElement=ee,p.getPageSize=sa,p.getRGBColorString=Fa,p.getRawImageInfo=sn,p.getRelativeBoundingClientRect=aa,p.getScreenElement=ta,p.getScrollParent=kh,p.getTimeZone=da,p.getURL=Ye,p.getUserGeolocationPromise=ua,p.getVerticalScrollPercentInPage=oa,p.getViewportSize=na,p.getWorker=Ja,p.gifImage=Ji,p.gradientColor=Va,p.h=Kr,p.hasDocument=xa,p.hasHistory=Sa,p.hasWindow=Ks,p.hsb2rgb=za,p.hsl2rgb=ja,p.hsv2rgb=Ga,p.imageDataToBitmap=vc,p.imageDataToBlob=xc,p.imageDataToDataURL=bc,p.injectWxJsConfig=Ih,p.isAliBrowser=Zs,p.isAliMiniProgram=ba,p.isAndroid=Ws,p.isAppleDevice=ma,p.isBrowserSupportFileAPI=Ca,p.isDarkMode=ga,p.isIE=ya,p.isIE9or10=wa,p.isIOS=In,p.isMacOS=Mn,p.isMobile=pa,p.isURL=Ha,p.isWxBrowser=Js,p.isWxMiniProgram=va,p.jpgToPng=jc,p.leftRotate=Pc,p.length=je,p.linkExport=Dn,p.localstorage=Fn,p.mapTDTJSSDK=cl,p.marginSharpen=zc,p.microTask=Zr,p.mosaic=Zc,p.mount=fe,p.normalizePoint=_a,p.outputGifBase64=Zi,p.outputQRCodeBase64=th,p.parseTransformToMatrix=On,p.parseURL=ci,p.patch=Gs,p.patchDOM=zs,p.pngToJpg=Xc,p.radiusClip=Yc,p.randomColorHexString=Ba,p.randomColorNumber=oi,p.reactive=ih,p.reactiveVue2=sh,p.reactiveVue3=sr,p.readFileInBrowser=Ge,p.recordToSearchString=li,p.rectClip=qc,p.rgb2hsb=qa,p.rgb2hsl=Ya,p.rgb2hsv=Xa,p.rightRotate=_c,p.rotatePoint=Et,p.searchStringToRecord=Wa,p.selectFileInBrowser=Us,p.setColorScheme=Xe,p.setCookie=Ma,p.setRem=Pa,p.shadeColor=Ua,p.sharpen=Gc,p.singletonGlobalAnimateInWeb=De,p.stringToBlob=Pn,p.stringToDOM=$r,p.theme=Na,p.toBlackAndWhite=kc,p.toBlue=Oc,p.toBlueAndGreen=Fc,p.toBlueAndGrey=Vc,p.toDegree=Q,p.toGreen=Rc,p.toGreenAndGrey=Uc,p.toGrey=Dc,p.toGrey2=Ac,p.toOpposite=Ic,p.toRadian=ot,p.toRed=Mc,p.toRedAndBlue=Nc,p.toRedAndGreen=Lc,p.toRedAndGrey=Bc,p.trimURLHash=hi,p.watchEffect=nh,p.wxJsChooseImage=Lh,p.wxJsDownloadImage=Bh,p.wxJsDownloadVoice=Wh,p.wxJsGetLocalImgData=Uh,p.wxJsGetLocation=Kh,p.wxJsGetNetworkType=Jh,p.wxJsOnVoicePlayEnd=Yh,p.wxJsOnVoiceRecordEnd=zh,p.wxJsOpenLocation=Zh,p.wxJsPauseVoice=Xh,p.wxJsPay=tl,p.wxJsPlayVoice=jh,p.wxJsPreviewImage=Nh,p.wxJsScanQRCode=Qh,p.wxJsStartRecord=Vh,p.wxJsStopRecord=Gh,p.wxJsStopVoice=qh,p.wxJsTranslateVoice=$h,p.wxJsUpdateAppMessageShareData=Rh,p.wxJsUpdateTimelineShareData=Oh,p.wxJsUploadImage=Fh,p.wxJsUploadVoice=Hh,Object.defineProperty(p,Symbol.toStringTag,{value:"Module"}),p}({});
|
|
46
46
|
//# sourceMappingURL=zyzgroup_core_web.iife.js.map
|