@zyzgroup/core-web 0.0.80 → 0.0.81

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- var ZYZGroupCoreWeb=function(m){"use strict";function en(){return typeof window<"u"?window:typeof global<"u"?global:this||{}}const sn="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function Je(i){this.message=i}Je.prototype=new Error,Je.prototype.name="InvalidCharacterError";function La(i){const t=String(i);let e="";for(let s,n,r=0,a=sn;t.charAt(r|0)||(a="=",r%1);e+=a.charAt(63&s>>8-r%1*8)){if(n=t.charCodeAt(r+=.75),n>255)throw new Je("'btoa' failed: The string to be encoded contains characters outside of the Latin1 range.");s=s<<8|n}return e}function Ra(i){const t=String(i).replace(/[=]+$/,"");if(t.length%4===1)throw new Je("'atob' failed: The string to be decoded is not correctly encoded.");let e="";for(let s=0,n,r,a=0;r=t.charAt(a++);~r&&(n=s%4?n*64+r:r,s++%4)?e+=String.fromCharCode(255&n>>(-2*s&6)):0)r=sn.indexOf(r);return e}class Ze{maps=new Map;mapsAddedDuringUpdate=new Map;constructor(){}entries(){return Array.from(this.maps.entries())}keys(){return Array.from(this.maps.keys())}values(){return Array.from(this.maps.values())}get length(){return this.entries().length}set(t,e){this.maps.set(t,e),this.mapsAddedDuringUpdate.set(t,e)}get(t){return this.maps.get(t)}shift(){const t=this.entries();if(t.length){const[e,s]=t[0];return this.delete(e),[e,s]}}delete(t){return this.mapsAddedDuringUpdate.delete(t),this.maps.delete(t)}deleteAll(){this.maps=new Map,this.mapsAddedDuringUpdate=new Map}filter(t){let e=Array.from(this.maps.entries());for(;e.length>0;){this.mapsAddedDuringUpdate=new Map;for(let s=0,n=e.length;s<n;s++){const[r,a]=e[s];t(r,a)===!1&&this.delete(r)}e=Array.from(this.mapsAddedDuringUpdate.entries())}}}const me=new Ze,Ke=i=>{let t=null;switch(i){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"ascii":t=/^[\x00-\xFF]+$/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"regexp":t=/[\\^$.*+?()[\]{}|]/g;break;case"regexp-flags":t=/\w*$/;break;case"native-method":t=RegExp("^"+Function.prototype.toString.call(Object.prototype.hasOwnProperty).replace(Ke("regexp"),"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");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._-]+\.[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"url":t=/^http[s]?:\/\/([\w-]+\.)+[\w-]+([\w-./?%&=]*)?$/;break;case"date":t=/^\d{4}(\-|\/|\.)(\d{1,2})(\-|\/|\.)(\d{1,2})$/;break;case"time":t=/^(\d{1,2}):(\d{1,2}):(\d{1,2})$/;break;case"datetime":t=/^\d{4}(\-|\/|\.)(\d{1,2})(\-|\/|\.)(\d{1,2})\s+(\d{1,2}):(\d{1,2}):(\d{1,2})$/;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`
1
+ var ZYZGroupCoreWeb=function(p){"use strict";function sn(){return typeof window<"u"?window:typeof global<"u"?global:this||{}}class Je{maps=new Map;mapsAddedDuringUpdate=new Map;entries(){return Array.from(this.maps.entries())}keys(){return Array.from(this.maps.keys())}values(){return Array.from(this.maps.values())}get length(){return this.entries().length}set(t,e){this.maps.set(t,e),this.mapsAddedDuringUpdate.set(t,e)}get(t){return this.maps.get(t)}shift(){const t=this.entries();if(t.length){const[e,s]=t[0];return this.delete(e),[e,s]}}delete(t){return this.mapsAddedDuringUpdate.delete(t),this.maps.delete(t)}deleteAll(){this.maps=new Map,this.mapsAddedDuringUpdate=new Map}filter(t){let e=Array.from(this.maps.entries());for(;e.length>0;){this.mapsAddedDuringUpdate=new Map;for(let s=0,i=e.length;s<i;s++){const[r,a]=e[s];t(r,a)===!1&&this.delete(r)}e=Array.from(this.mapsAddedDuringUpdate.entries())}}}const fe=new Je,Ze=n=>{let t=null;switch(n){case"any-character":t=/[^]/;break;case"bin":t=/^(0b)?[0-1]+$/i;break;case"oct":t=/^(0o)?[0-7]+$/i;break;case"hex":t=/^(0x)?[0-9a-fA-F]+$/i;break;case"ascii":t=/^[\x00-\xFF]+$/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"trim":t=/^\s+|\s+$/g;break;case"regexp":t=/[\\^$.*+?()[\]{}|]/g;break;case"regexp-flags":t=/\w*$/;break;case"native-method":t=RegExp("^"+Function.prototype.toString.call(Object.prototype.hasOwnProperty).replace(Ze("regexp"),"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");break;case"svg-segment":t=/([mlhvzaqtcs])([^mlhvzaqtcs]*)/gi;break;case"mobile-china":t=/^\+?[1-9]{1}[0-9]{10}$/g;break;case"email":t=/^[A-Za-z0-9_!#$%&'*+/=?`{|}~^.-]+\@[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"url":t=/^http[s]?:\/\/([\w-]+\.)+[\w-]+([\w-./?%&=]*)?$/;break;case"element-url":t=/^url\(['"]?(.+?)['"]?\)$/i;break;case"date":t=/^\d{4}(\-|\/|\.)(\d{1,2})(\-|\/|\.)(\d{1,2})$/;break;case"time":t=/^(\d{1,2}):(\d{1,2}):(\d{1,2})$/;break;case"datetime":t=/^\d{4}(\-|\/|\.)(\d{1,2})(\-|\/|\.)(\d{1,2})\s+(\d{1,2}):(\d{1,2}):(\d{1,2})$/;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"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"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"var-name":t=/^[a-zA-Z_$][a-zA-Z0-9_$]*$/;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(m){"use strict";function en(){return typeof window<
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},Ot=(i,t)=>(typeof i=="string"&&(i=Ke(i)||new RegExp(i)),i.test(t)),nn=(i,t)=>{if(typeof i=="string"&&(i=Ke(i)||new RegExp(i)),!t)return null;const e=t.match(i);return e?i.flags.toLowerCase().indexOf("g")>=0?e.map(s=>({matchIndex:-1,fullMatch:s,groupMatchs:[]})):{matchIndex:typeof e.index=="number"?e.index:-1,fullMatch:e[0],groupMatchs:e.slice(1)}:null},rn=(i,t)=>{typeof i=="string"&&(i=Ke(i)||new RegExp(i));const e=[],s=t.matchAll(i);for(const n of s)e.push({matchIndex:typeof n.index=="number"?n.index:-1,fullMatch:n[0],groupMatchs:n.slice(1)});return e};function an(i){const t=i.match(/[\s\S]/gu);return t?t.length:0}function on(i,t){const e=i.codePointAt(t);return e?String.fromCodePoint(e):void 0}const Q=["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"];function Gs(){const i=Math.random()*4294967295|0,t=Math.random()*4294967295|0,e=Math.random()*4294967295|0,s=Math.random()*4294967295|0;return(Q[i&255]+Q[i>>8&255]+Q[i>>16&255]+Q[i>>24&255]+"-"+Q[t&255]+Q[t>>8&255]+"-"+Q[t>>16&15|64]+Q[t>>24&255]+"-"+Q[e&63|128]+Q[e>>8&255]+"-"+Q[e>>16&255]+Q[e>>24&255]+Q[s&255]+Q[s>>8&255]+Q[s>>16&255]+Q[s>>24&255]).toLowerCase()}function Oa(i){const t=me.get(i);if(t)return t;const e=i.replace(/(^\w)/g,function(s){return s.toLowerCase()});return me.set(i,e),e}const ct=(i,t="-")=>{const e=me.get(i);if(e)return e;let s=i.replace(new RegExp(`${t}?([A-Z])`,"g"),t+"$1").toLowerCase();return s=s.replace(new RegExp(`^${t}`),""),me.set(i,s),s};function Vs(i){const t=me.get(i);if(t)return t;const e=i.replace(/(^\w|[_-]\w)/g,function(s){return s.slice(-1).toUpperCase()});return me.set(i,e),e}function hn(i){return Oa(Vs(i))}function Na(i,t,e="0",s="left"){const n=an(i);if(t>n){const r=t-n;let a,o;switch(s){case"left":i=Array(r+1).join(e)+i;break;case"right":i=i+Array(r+1).join(e);break;default:a=Math.ceil(r/2),o=r-a,i=Array(o+1).join(e)+i+Array(a+1).join(e);break}}return i}function cn(i){let t="";for(let e=0,s=i.length;e<s;e++){const n=i.charCodeAt(e);n>=1&&n<=127?t+=i.charAt(e):n>2047?(t+=String.fromCharCode(224|n>>12&15),t+=String.fromCharCode(128|n>>6&63),t+=String.fromCharCode(128|n>>0&63)):(t+=String.fromCharCode(192|n>>6&31),t+=String.fromCharCode(128|n>>0&63))}return t}var Nt=(i=>(i.UNKNOWN="",i.HTML="text/html",i.CSS="text/css",i.TEXT="text/plain",i.MD="text/plain",i.JPEG="image/jpeg",i.PNG="image/png",i.GIF="image/gif",i.WEBP="image/webp",i.SVG="image/svg+xml",i.ICO="image/x-icon",i.MPEG="audio/mpeg",i.MP3="audio/mpeg",i.OGG="audio/ogg",i.WAV="audio/wav",i.MP4="video/mp4",i.WEBM="video/webm",i.JSON="application/json",i.XWWW="application/x-www-form-urlencoded",i.XHTML="application/xhtml+xml",i.XML="application/xml",i.XML_TEXT="text/xml",i.JAVASCRIPT="application/javascript",i.ECMASCRIPT="application/ecmascript",i.DOC="application/msword",i.CSV="application/x-csv",i.EXCEL="application/vnb.ms-excel",i.PDF="application/pdf",i.ZIP="application/zip",i.TGZ="application/x-gtar",i.TAR_GZ="application/x-gzip",i.EOT="appliaction/vnd.ms-fontobject",i.TTF="aplication/font-sfnt",i))(Nt||{});const Fa=(i,t=16)=>i.toString(t),ae=(i,t=16)=>{let e=i.toLowerCase();const s=e.indexOf("0b")==0,n=e.indexOf("0o")==0,r=e.indexOf("0x")==0;(s||n||r)&&(e=e.slice(2));const a=parseInt(e,t);if(isNaN(a))throw new Error(`radixStringToNumber(${i}, ${t}) 无法解析!`);return a};function Qe(i,t){if(i instanceof ArrayBuffer)return Array.from(new Uint8Array(i));let e=[];if(Array.isArray(i))return i.forEach(s=>{typeof s=="number"?e.push(s):e=e.concat(Qe(s,t))}),e;if(typeof i=="number")for(;i>0;){const s=i&255;e.unshift(s),i=(i-s)/256}if(typeof i=="string")if(t){let s=i.toLowerCase();switch(t){case 16:default:s.indexOf("0x")==0&&(s=s.slice(2));for(let n=0,r=s.length;n<r;n+=2)e.push(ae(s.slice(n,n+2),t));break}}else for(const s of i){const n=s.codePointAt(0);n&&e.push(n)}return e}function Ba(i,t){if(i instanceof ArrayBuffer)return i;const e=Qe(i,t);return new Uint8Array(e).buffer}function Xa(i,t){const e=Qe(i,t);return String.fromCodePoint.apply(null,e)}function Ya(i,t){const e=Qe(i,t);let s="";for(let n=0,r=e.length;n<r;n++)s+=Fa(e[n],16).padStart(2,"0");return s}function Ua(){const i=Uint32Array.of(305419896),t=new Uint8Array(i.buffer);switch(t[0]*16777216+t[1]*65536+t[2]*256+t[3]){case 305419896:return!1;case 2018915346:return!0}}const ln=i=>{let t=Nt.UNKNOWN;switch(new DataView(i).getUint32(0,Ua()).toString(16).toUpperCase()){case"FFD8FFDB":t=Nt.JPEG;break;case"FFD8FFE0":case"FFD8FFE1":case"FFD8FFE2":case"FFD8FFE3":t=Nt.JPEG;break;case"89504E47":t=Nt.PNG;break;case"47494638":t=Nt.GIF;break;case"52494646":t=Nt.WEBP;break;case"25504446":t=Nt.PDF;break;case"504B0304":t=Nt.ZIP;break}return t};let Ce;class Ga{subscribers;constructor(){this.subscribers=new Set}add(){Ce&&!this.subscribers.has(Ce)&&this.subscribers.add(Ce)}notify(){this.subscribers.forEach(t=>t())}}const un=new WeakMap;function dn(i,t){let e=un.get(i);e||(e=new Map,un.set(i,e));let s=e.get(t);return s||(s=new Ga,e.set(t,s)),s}function zs(i){Ce=i,i(),Ce=null}const Va=Symbol("isProxy");function za(i){return new Proxy(i,{get(t,e,s){return e===Va?!0:(dn(i,e).add(),Reflect.get(t,e,s))},set(t,e,s,n){const r=dn(i,e);return i[e]!=s&&(i[e]=s,r.notify()),Reflect.set(t,e,s,n)}})}const qa=za,Ha="[object Object]";function ja(i){return Object.prototype.toString.call(i)}function Wa(i){return i!=null}function fn(i){return ja(i)===Ha}function $a(i,...t){return new i.constructor(...t)}function mn(i,t){for(const e in t)Object.prototype.hasOwnProperty.call(t,e)&&(fn(t[e])?(typeof i[e]>"u"&&(i[e]={}),mn(i[e],t[e])):typeof i[e]>"u"&&(i[e]=t[e]));return i}function pn(i,t){for(const e in i)Object.prototype.hasOwnProperty.call(i,e)&&!t(e,i[e])&&delete i[e];return i}function Ee(i,t){const e=i.findIndex(s=>s===t);return e>=0&&i.splice(e,1),i}let gn;try{gn=Map}catch{gn=function(){}}let yn;try{yn=Set}catch{yn=function(){}}function jt(i,t){if(i=parseFloat(i),isNaN(i)){if(typeof t=="number")return t;throw new Error(`parseNumber(${i}) isNaN!`)}return i}function ts(i,t,e=Number.EPSILON*Math.pow(2,2)){return Math.abs(i-t)<e}const yt=(i,t,e)=>i<t?t:i>e?e:i,Ja=(i,t,e)=>s=>{const n=Math.min(Math.max(i,s),t);return t-n<e?t:Math.round(n/e)*e};function Za(i,t=12){return jt(i).toFixed(t)}function Et(i,t=12){return+Za(i,t)}function qs(i,t){const e=nn("number-single",String(i));return{hasNumber:!!e,number:e&&!Array.isArray(e)&&e.fullMatch?parseFloat(e.fullMatch):Wa(t)?t:NaN,prefix:e&&!Array.isArray(e)&&e.fullMatch?i.substring(0,e.matchIndex):"",suffix:e&&!Array.isArray(e)&&e.fullMatch?i.substring(e.matchIndex+e.fullMatch.length):""}}function wn(i){const t=nn("number",i);return t?Array.isArray(t)?t.map(e=>Number(e.fullMatch)):[Number(t.fullMatch)]:[]}Ka();function Ka(){const i=new ArrayBuffer(4),t=new Float32Array(i),e=new Uint32Array(i),s=new Uint32Array(512),n=new Uint32Array(512);for(let h=0;h<256;++h){const c=h-127;c<-27?(s[h]=0,s[h|256]=32768,n[h]=24,n[h|256]=24):c<-14?(s[h]=1024>>-c-14,s[h|256]=1024>>-c-14|32768,n[h]=-c-1,n[h|256]=-c-1):c<=15?(s[h]=c+15<<10,s[h|256]=c+15<<10|32768,n[h]=13,n[h|256]=13):c<128?(s[h]=31744,s[h|256]=64512,n[h]=24,n[h|256]=24):(s[h]=31744,s[h|256]=64512,n[h]=13,n[h|256]=13)}const r=new Uint32Array(2048),a=new Uint32Array(64),o=new Uint32Array(64);for(let h=1;h<1024;++h){let c=h<<13,l=0;for(;!(c&8388608);)c<<=1,l-=8388608;c&=-8388609,l+=947912704,r[h]=c|l}for(let h=1024;h<2048;++h)r[h]=939524096+(h-1024<<13);for(let h=1;h<31;++h)a[h]=h<<23;a[31]=1199570944,a[32]=2147483648;for(let h=33;h<63;++h)a[h]=2147483648+(h-32<<23);a[63]=3347054592;for(let h=1;h<64;++h)h!==32&&(o[h]=1024);return{floatView:t,uint32View:e,baseTable:s,shiftTable:n,mantissaTable:r,exponentTable:a,offsetTable:o}}function j(){return(performance||Date).now()}function Qa(i,t){let e;return function(...s){clearTimeout(e),e=setTimeout(()=>{i.apply(this,s)},t)}}class Hs{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(s=>s!==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(s=>{Reflect.apply(s,this,e)}),this}once(t,e){const n=(()=>{let r=!1;return(...a)=>{r||(r=!0,Reflect.apply(e,this,a),this.off(t,n))}})();return this.on(t,n),this}}function to(i,t=(e,s)=>e<=s){const e=i.length;let s=Math.floor(e/2);for(;s>0;){for(let n=s;n<e;n++){const r=i[n];let a=n;for(;a>=s&&!t(i[a-s],r);)i[a]=i[a-s],a-=s;i[a]=r}s=Math.floor(s/2)}}var xn=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function eo(i,t={}){var e=1,s=1;function n(_){var A=_.match(/\n/g);A&&(e+=A.length);var N=_.lastIndexOf(`
11
- `);s=~N?_.length-N:s+_.length}function r(){var _={line:e,column:s};return function(A){return A.position=new a(_),p(),A}}function a(_){this.start=_,this.end={line:e,column:s},this.source=t.source}a.prototype.content=i;var o=[];function h(_){var A=new Error(t.source+":"+e+":"+s+": "+_);if(A.reason=_,A.filename=t.source,A.line=e,A.column=s,A.source=i,t.silent)o.push(A);else throw A}function c(){var _=g();return{type:"stylesheet",stylesheet:{source:t.source,rules:_,parsingErrors:o}}}function l(){return y(/^{\s*/)}function d(){return y(/^}/)}function g(){var _,A=[];for(p(),x(A);i.length&&i.charAt(0)!="}"&&(_=le()||ve());)_!==!1&&(A.push(_),x(A));return A}function y(_){var A=_.exec(i);if(A){var N=A[0];return n(N),i=i.slice(N.length),A}}function p(){y(/^\s*/)}function x(_){var A;for(_=_||[];A=b();)A!==!1&&_.push(A);return _}function b(){var _=r();if(!(i.charAt(0)!="/"||i.charAt(1)!="*")){for(var A=2;i.charAt(A)!=""&&(i.charAt(A)!="*"||i.charAt(A+1)!="/");)++A;if(A+=2,i.charAt(A-1)==="")return h("End of comment missing");var N=i.slice(2,A-2);return s+=2,n(N),i=i.slice(A),s+=2,_({type:"comment",comment:N})}}function S(){var _=y(/^([^{]+)/);if(_)return Ft(_[0]).replace(/\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*\/+/g,"").replace(/"(?:\\"|[^"])*"|'(?:\\'|[^'])*'/g,function(A){return A.replace(/,/g,"‌")}).split(/\s*(?![^(]*\)),\s*/).map(function(A){return A.replace(/\u200C/g,",")})}function C(){var _=r(),A=y(/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(A){if(A=Ft(A[0]),!y(/^:\s*/))return h("property missing ':'");var N=y(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/),P=_({type:"declaration",property:A.replace(xn,""),value:N?Ft(N[0]).replace(xn,""):""});return y(/^[;\s]*/),P}}function L(){var _=[];if(!l())return h("missing '{'");x(_);for(var A;A=C();)A!==!1&&(_.push(A),x(_));return d()?_:h("missing '}'")}function R(){for(var _,A=[],N=r();_=y(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/);)A.push(_[1]),y(/^,\s*/);if(A.length)return N({type:"keyframe",values:A,declarations:L()})}function Y(){var _=r(),A=y(/^@([-\w]+)?keyframes\s*/);if(A){var N=A[1];if(A=y(/^([-\w]+)\s*/),!A)return h("@keyframes missing name");var P=A[1];if(!l())return h("@keyframes missing '{'");for(var vt,ne=x();vt=R();)ne.push(vt),ne=ne.concat(x());return d()?_({type:"keyframes",name:P,vendor:N,keyframes:ne}):h("@keyframes missing '}'")}}function X(){var _=r(),A=y(/^@supports *([^{]+)/);if(A){var N=Ft(A[1]);if(!l())return h("@supports missing '{'");var P=x().concat(g());return d()?_({type:"supports",supports:N,rules:P}):h("@supports missing '}'")}}function V(){var _=r(),A=y(/^@host\s*/);if(A){if(!l())return h("@host missing '{'");var N=x().concat(g());return d()?_({type:"host",rules:N}):h("@host missing '}'")}}function it(){var _=r(),A=y(/^@media *([^{]+)/);if(A){var N=Ft(A[1]);if(!l())return h("@media missing '{'");var P=x().concat(g());return d()?_({type:"media",media:N,rules:P}):h("@media missing '}'")}}function W(){var _=r(),A=y(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(A)return _({type:"custom-media",name:Ft(A[1]),media:Ft(A[2])})}function $(){var _=r(),A=y(/^@page */);if(A){var N=S()||[];if(!l())return h("@page missing '{'");for(var P=x(),vt;vt=C();)P.push(vt),P=P.concat(x());return d()?_({type:"page",selectors:N,declarations:P}):h("@page missing '}'")}}function z(){var _=r(),A=y(/^@([-\w]+)?document *([^{]+)/);if(A){var N=Ft(A[1]),P=Ft(A[2]);if(!l())return h("@document missing '{'");var vt=x().concat(g());return d()?_({type:"document",document:P,vendor:N,rules:vt}):h("@document missing '}'")}}function nt(){var _=r(),A=y(/^@font-face\s*/);if(A){if(!l())return h("@font-face missing '{'");for(var N=x(),P;P=C();)N.push(P),N=N.concat(x());return d()?_({type:"font-face",declarations:N}):h("@font-face missing '}'")}}var bt=ie("import"),dt=ie("charset"),be=ie("namespace");function ie(_){var A=new RegExp("^@"+_+"\\s*([^;]+);");return function(){var N=r(),P=y(A);if(P){var vt={type:_};return vt[_]=P[1].trim(),N(vt)}}}function le(){if(i[0]=="@")return Y()||it()||W()||X()||bt()||dt()||be()||z()||$()||V()||nt()}function ve(){var _=r(),A=S();return A?(x(),_({type:"rule",selectors:A,declarations:L()})):h("selector missing")}return js(c())}function Ft(i){return i?i.replace(/^\s+|\s+$/g,""):""}function js(i,t){var e=i&&typeof i.type=="string",s=e?i:t;for(var n in i){var r=i[n];Array.isArray(r)?r.forEach(function(a){js(a,s)}):r&&typeof r=="object"&&js(r,s)}return e&&Object.defineProperty(i,"parent",{configurable:!0,writable:!0,enumerable:!1,value:t||null}),i}const Ws=(i,t="image/svg+xml",e="utf-8")=>e==="base64"?new Blob([i],{type:`${t};${e}`}):new Blob([i],{type:`${t};charset=${e}`}),$s=i=>new XMLSerializer().serializeToString(i),so=(i,t="text/html")=>new DOMParser().parseFromString(i,t),bn=(i,t="image/svg+xml",e="utf-8")=>Ws($s(i),t,e),Js=(i,t)=>new Promise(e=>{const s=document.createElement("a");s.style.visibility="hidden",document.body.appendChild(s),s.download=t,typeof i=="string"?s.href=i:s.href=window.URL.createObjectURL(i),s.click(),document.body.removeChild(s),window.URL.revokeObjectURL(s.href),e()});function vn(i=["*"],t){return new Promise((e,s)=>{if(!globalThis.document||!(globalThis.document instanceof Document))return s(new Error("This is not a browser environment"));const n=globalThis.document.createElement("input");n.setAttribute("type","file"),n.setAttribute("visibility","hidden"),Array.isArray(i)&&i.length>0&&n.setAttribute("accept",i.join(",")),t&&n.setAttribute("multiple","true"),globalThis.addEventListener("focus",()=>{setTimeout(()=>{(!n.files||n.files?.length===0)&&s(new Error("Cancel select"))},1e3)},{once:!0});const r=()=>{if(n.removeEventListener("change",r),!n.files||n.files?.length===0)s(new Error("Cancel select"));else{const a=Array.from(n.files);!i.includes("*")&&a.some(o=>!i.includes(`.${Sn(o)}`))&&s(new Error(`Please select files in ${i} format`)),n.remove(),e(a)}};n.addEventListener("change",r),n.click()})}function es(i,t="text",e){return new Promise((s,n)=>{const r=new FileReader;switch(r.addEventListener("progress",a=>{e?.(a.loaded,a.total)}),r.addEventListener("load",a=>{s(a.target?.result)}),r.addEventListener("error",a=>{n(a)}),t){case"dataURL":r.readAsDataURL(i);break;case"binaryString":r.readAsBinaryString(i);break;case"arrayBuffer":r.readAsArrayBuffer(i);break;case"text":default:r.readAsText(i)}})}async function io(i){const t=await es(i,"arrayBuffer");return ln(t)}const Sn=i=>{let t;return i instanceof File?t=i.name:t=i,t.match(/\.([0-9a-z]+)(?:[\\?#]|$)/i)?.[1]??""};function Wt(i,t={},e=[],s){return{tag:i,props:t,children:e,el:s}}function pe(i,t){if(i.el)return i.el;if(i.el=document.createElement(i.tag),i.props)for(const e in i.props){const s=i.props[e];e.startsWith("on")?i.el.addEventListener(e.slice(2).toLowerCase(),s):i.el.setAttribute(e,s)}return i.children&&(typeof i.children=="string"?i.el.textContent=i.children:i.children.forEach(e=>{pe(e,i.el)})),t?.appendChild(i.el),i.el}function ss(i,t){if(!i.el)return;if(i.tag!==t.tag){(i.el.parentElement||document.body).replaceChild(pe(t),i.el);return}const e=t.el=i.el,s=i.props,n=t.props;for(const o in s)o in n||(o.startsWith("on")?e.removeEventListener(o.slice(2).toLowerCase(),s[o]):e.removeAttribute(o));for(const o in n){const h=s[o],c=n[o];if(c!=h)if(o.startsWith("on")){const l=o.slice(2).toLowerCase();e.removeEventListener(l,h),e.addEventListener(l,c)}else o==="style"?Object.keys(c||{}).forEach(l=>{const d=String(c[l]).toLowerCase().includes("!important")?"important":"";e.style.setProperty(ct(l),String(c[l]).replace(/!important/i,""),d)}):e.setAttribute(o,c)}const r=i.children||[],a=t.children||[];if(typeof a=="string")e.innerHTML=a;else if(typeof r=="string")e.innerHTML="",a.forEach(o=>{pe(o,e)});else{const o=Math.min(r.length,a.length);for(let h=0;h<o;h++)ss(r[h],a[h]);a.length>r.length&&a.slice(r.length).forEach(h=>{pe(h,e)}),a.length<r.length&&r.slice(a.length).forEach(h=>{h.el&&e.removeChild(h.el)})}}function Cn(i,t){if(!i.isEqualNode(t)){if(i.nodeName!==t.nodeName){(i.parentElement||document.body).replaceChild(t,i);return}if(i.nodeType===Node.TEXT_NODE){i.textContent!==t.textContent&&(i.textContent=t.textContent);return}for(let e=i.attributes.length-1;e>=0;e--){const s=i.attributes[e].name;!t.hasAttribute(s)&&s!=="open"&&i.removeAttribute(s)}for(let e=0;e<t.attributes.length;e++){const s=t.attributes[e].name,n=t.attributes[e].value;i.setAttribute(s,n)}for(let e=0;e<t.childNodes.length;e++)i.childNodes[e]?Cn(i.childNodes[e],t.childNodes[e]):i.appendChild(t.childNodes[e].cloneNode(!0));for(;i.childNodes.length>t.childNodes.length;)i.lastChild&&i.removeChild(i.lastChild)}}class no{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:s,wasClean:n}=t;console.log(`ws closed : ${e} ${s} ${n}`)},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 s=this.waitingResponse[e.requestid];s?s.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,s=this.waitingResponse[e]={requestid:e};try{let n;t instanceof Blob||t instanceof ArrayBuffer||typeof t=="string"?n=t:n=JSON.stringify({...s,...t});const r=await new Promise((a,o)=>{s.resolve=a,this.sendWithRetry(n),setTimeout(()=>{o("Timeout")},5e3)});return console.info("Time took",(+new Date-s.requestid)/1e3),r}catch(n){return Promise.reject(n)}finally{delete this.waitingResponse[e]}}async send(t,e,s=n=>{console.log(n)}){this.sendPayload(t).then(e,s)}}function ro(){const i=window.screen;return{screenWidth:i.width,screenHeight:i.height,screenX:window.screenX,screenY:window.screenY}}function Te(){const i=document.documentElement;return{clientWidth:i.clientWidth,clientHeight:i.clientHeight,clientTop:i.clientTop,clientLeft:i.clientLeft,scrollWidth:i.scrollWidth,scrollHeight:i.scrollHeight,scrollTop:i.scrollTop,scrollLeft:i.scrollLeft,offsetWidth:i.offsetWidth,offsetHeight:i.offsetHeight,offsetTop:i.offsetTop,offsetLeft:i.offsetLeft,offsetParent:i.offsetParent}}function ao(){const i=document.body;return{clientWidth:i.clientWidth,clientHeight:i.clientHeight,clientTop:i.clientTop,clientLeft:i.clientLeft,scrollWidth:i.scrollWidth,scrollHeight:i.scrollHeight,scrollTop:i.scrollTop,scrollLeft:i.scrollLeft,offsetWidth:i.offsetWidth,offsetHeight:i.offsetHeight,offsetTop:i.offsetTop,offsetLeft:i.offsetLeft,offsetParent:i.offsetParent}}function oo(){return typeof window.innerWidth=="number"?{width:window.innerWidth,height:window.innerHeight}:document.compatMode==="CSS1Compat"?{width:document.documentElement.clientWidth,height:document.documentElement.clientHeight}:{width:document.body.clientWidth,height:document.body.clientHeight}}function ho(){const{scrollWidth:i,scrollHeight:t}=Te();return{width:i,height:t}}function En(i){const{top:t,left:e,width:s,height:n}=i.getBoundingClientRect(),{scrollLeft:r,scrollTop:a}=Te();return{x:e+r,y:t+a,width:s,height:n}}function co(i){let t=0,e=0;i&&(t=i.offsetWidth,e=i.offsetHeight);let s=0,n=0;for(;i!==null;)s+=i.offsetLeft,n+=i.offsetTop,i.offsetParent instanceof HTMLElement?i=i.offsetParent:i=null;return{x:s,y:n,width:t,height:e}}function Tn(i){return i.getBoundingClientRect()}function lo(i){const t=i.getBoundingClientRect();return{x:i.offsetLeft,y:i.offsetTop,width:t.width||t.right-t.left,height:t.height||t.bottom-t.top}}function uo(){const{clientHeight:i,scrollTop:t,scrollHeight:e}=Te(),s=e-i;return s<=0?0:t/s*100}function fo(i){if("center"in i){const t=i.center,e=Tn(i.target);return{x:t.x-e.x,y:t.y-e.y}}return{x:i.clientX,y:i.clientY}}function Pn(i){if("center"in i)return i.center;if(typeof i.pageX=="number"&&typeof i.pageY=="number")return{x:i.pageX,y:i.pageY};const{scrollLeft:t,scrollTop:e}=Te();return{x:i.clientX+t,y:i.clientY+e}}function Mt(i,t){if(!t&&"offsetX"in i)return{x:i.offsetX,y:i.offsetY};const e=Pn(i),s=En(t||i.target);return{x:e.x-s.x,y:e.y-s.y}}const is=()=>{const i=navigator.userAgent.toLowerCase();let t="Unknown";return/mac/i.test(i)?t="macOS":/win/i.test(i)?t="Windows":/android/i.test(i)?t="Android":/iphone|ipad|ipod/i.test(i)?t="iOS":/linux/i.test(i)?t="Linux":/bsd/i.test(i)&&(t="BSD"),t.toLowerCase()},mo=()=>{const i=navigator.userAgent;let t="Unknown";if(/Windows NT/.test(i)){const e=i.match(/Windows NT (\d+\.\d+)/);e&&(t=e[1])}else if(/Mac OS X/.test(i)){const e=i.match(/Mac OS X (\d+_\d+)/);e&&(t=e[1].replace("_","."))}else if(/Android/.test(i)){const e=i.match(/Android (\d+\.\d+)/);e&&(t=e[1])}else if(/iPhone|iPad|iPod/.test(i)){const e=i.match(/OS (\d+_\d+)/);e&&(t=e[1].replace("_","."))}return t.toLowerCase()},Zs=()=>{const i=navigator.userAgent.toLowerCase();let t="Unknown";return/opr/i.test(i)||/opera/i.test(i)?t="Opera":/chrome/i.test(i)?t="Chrome":/firefox/i.test(i)?t="Firefox":/safari/i.test(i)?t="Safari":/edge/i.test(i)?t="Edge":/msie|trident/i.test(i)?t="IE":/MicroMessenger/i.test(i)?t="Wechat":/alipay/i.test(i)&&(t="Ali"),t.toLowerCase()},po=()=>{const i=navigator.userAgent;let t="Unknown";if(/Chrome/.test(i)){const e=i.match(/Chrome\/(\d+\.\d+)/);e&&(t=e[1])}else if(/Firefox/.test(i)){const e=i.match(/Firefox\/(\d+\.\d+)/);e&&(t=e[1])}else if(/Safari/.test(i)){const e=i.match(/Version\/(\d+\.\d+)/);e&&(t=e[1])}else if(/Edge/.test(i)){const e=i.match(/Edge\/(\d+\.\d+)/);e&&(t=e[1])}else if(/MSIE|Trident/.test(i)){const e=i.match(/(?:MSIE|rv:)(\d+\.\d+)/);e&&(t=e[1])}return t},go=()=>"geolocation"in navigator?new Promise((i,t)=>{navigator.geolocation.getCurrentPosition(e=>{const s=e.coords.latitude,n=e.coords.longitude;i({latitude:s,longitude:n})},e=>{t(e)})}):Promise.reject("Geolocation is not available.");function yo(){return(navigator.browserLanguage||navigator.language).toLowerCase()}function wo(){return Intl.DateTimeFormat().resolvedOptions().timeZone.toLowerCase()}function Ks(){return is()==="ios"}function Qs(){return is()==="macos"}function xo(){return Ks()|Qs()}function Mn(){return is()==="android"}function bo(){return Ks()||Mn()}function vo(){return typeof window=="object"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches}function An(){const i=window.navigator.userAgent,t=i.indexOf("MSIE ");if(t>0)return parseInt(i.substring(t+5,i.indexOf(".",t)),10);if(i.indexOf("Trident/")>0){const n=i.indexOf("rv:");return parseInt(i.substring(n+3,i.indexOf(".",n)),10)}const s=i.indexOf("Edge/");return s>0?parseInt(i.substring(s+5,i.indexOf(".",s)),10):-1}const So=An()!==-1;function Co(){const i=document.documentMode;return i&&(i===9||i===10)}function In(){return Zs()==="wechat"}function Dn(){return Zs()==="ali"}function Eo(){return In()&&navigator.userAgent.match(/miniprogram/i)||window.__wxjs_environment==="miniprogram"}function To(){return Dn()&&navigator.userAgent.match(/miniprogram/i)}const Po=typeof document<"u",kn=typeof window<"u",Mo=typeof history<"u",Ao=kn&&window.File&&window.FileReader&&window.FileList&&window.Blob,_n=(()=>{const i=en();return!!(i.Worker&&i.Blob&&i.Promise&&i.OffscreenCanvas&&i.OffscreenCanvasRenderingContext2D&&i.HTMLCanvasElement&&i.HTMLCanvasElement.prototype.transferControlToOffscreen&&i.URL&&i.URL.createObjectURL)})(),Io=typeof Path2D=="function"&&typeof DOMMatrix=="function",Ln=function(){if(!en().OffscreenCanvas)return!1;const t=new OffscreenCanvas(1,1),e=t.getContext("2d");e.fillRect(0,0,1,1);const s=t.transferToImageBitmap();try{e.createPattern(s,"no-repeat")}catch{return!1}return!0}(),Do=typeof HTMLElement=="object"?function(t){return t instanceof HTMLElement}:function(t){return t&&typeof t=="object"&&t.nodeType===1&&typeof t.nodeName=="string"},ko="webkit moz ms o".split(" ");function ns(i){return typeof i=="function"&&/native code/.test(i.toString())}function _o(i){const t=document.documentElement,e=window.top===window.self?window.devicePixelRatio:1;t.dataset.dpr=e;let s=100;const n=function(){const r=Math.min(t.clientWidth,i);t.dataset.width=r,t.dataset.rem=s=Math.round(100*(r/i)),t.style.fontSize=s+"px"};n(),window.rem2px=function(r){return r=parseFloat(r),r*s},window.px2rem=function(r){return r=parseFloat(r),r/s},window.addEventListener&&window.addEventListener("orientationchange"in window?"orientationchange":"resize",n,!1)}function O(i){return i*Math.PI/180}function tt(i){return i*180/Math.PI}function rs(i,t,e=0){return Math.sqrt(i*i+t*t+e*e)}function as(i,t,e,s){return rs(e-i,s-t)}function os(i,t,e,s){const n=e-i,r=s-t;return n*n+r*r}function $t(i,t,e,s){let n=Math.atan2(s-t,e-i);return n<0&&(n+=Math.PI*2),n}function At(i,t){return{dx:Math.cos(i)*t,dy:Math.sin(i)*t}}function Lo(i,t,e){if(typeof e=="number"){const s=Math.sqrt(Math.pow(i,2)+Math.pow(t,2)+Math.pow(e,2));return{x:i/=s,y:t/=s,z:e/=s}}else{const s=Math.sqrt(Math.pow(i,2)+Math.pow(t,2));return{x:i/=s,y:t/=s}}}function Ro(i,t,e,s,n=10){if(Math.abs(e-i)<n&&Math.abs(s-t)<n)return"no";const r=tt($t(i,t,e,s));return r>=-135&&r<=-45?"up":r>45&&r<135?"down":r>=135&&r<=180||r>=-180&&r<-135?"left":"right"}const Rn=Oo("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 Oo(i,t=10){const e={},s=i.split(",");for(let n=0;n<s.length;n+=2){const r="&"+s[n+1]+";",a=parseInt(s[n],t);e[r]="&#"+a+";"}return e["\\xa0"]="&#160;",e}function rt(i,t){const e=Object.keys(t);for(let s=0;s<e.length;s++)i=i.replace(new RegExp("{"+e[s]+"}","gi"),""+t[e[s]]);return i}function hs(i){let t,e;if(!i)throw new Error("cannot create a random attribute name for an undefined object");const s="ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz";t="";do for(t="",e=0;e<12;e++)t+=s[Math.floor(Math.random()*s.length)];while(i[t]);return t}function No(i){const t={left:"start",right:"end",center:"middle",start:"start",end:"end"};return t[i]||t.start}function Fo(i){const t={alphabetic:"alphabetic",hanging:"hanging",top:"text-before-edge",bottom:"text-after-edge",middle:"central"};return t[i]||t.alphabetic}const Pe={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"},lineDashOffset:{svgAttr:"stroke-dashoffset",canvas:0,svg:0,apply:"stroke"}};class cs{__root;__ctx;constructor(t,e){this.__root=t,this.__ctx=e}addColorStop(t,e){const s=this.__ctx.__createElement("stop");if(s.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&&(s.setAttribute("stop-color",rt("rgb({r},{g},{b})",{r:r[1],g:r[2],b:r[3]})),s.setAttribute("stop-opacity",r[4]))}else s.setAttribute("stop-color",e);this.__root.appendChild(s)}}class ti{__root;__ctx;constructor(t,e){this.__root=t,this.__ctx=e}}class Me{__document=document;__canvas;__ctx;width;height;__styleStack;__groupStack;__rootSVG;__ids;__SVGdefs;__currentElement;__currentElementsToStyle=null;constructor({canvas:t,width:e=500,height:s=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=s),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(Pe);for(let e=0,s=t.length;e<s;e++){const n=t[e];this[n]=Pe[n].canvas}}__getStyleState(){const t={},e=Object.keys(Pe);for(let s=0,n=e.length;s<n;s++){const r=e[s];t[r]=this[r]}return t}__applyStyleState(t){const e=Object.keys(t);for(let s=0,n=e.length;s<n;s++){const r=e[s];this[r]=t[r]}}__createElement(t,e={},s=!1){const n=this.__document.createElementNS("http://www.w3.org/2000/svg",t),r=Object.keys(e);s&&(n.setAttribute("fill","none"),n.setAttribute("stroke","none"));for(let a=0;a<r.length;a++){const o=r[a];n.setAttribute(o,e[o])}return n}__applyStyleToCurrentElement(t){let e=this.__currentElement;const s=this.__currentElementsToStyle;s&&(e.setAttribute(t,""),e=s.element,s.children.forEach(r=>{r.setAttribute(t,"")}));const n=Object.keys(Pe);for(let r=0;r<n.length;r++){const a=Pe[n[r]],o=this[n[r]];if(a.apply){if(o instanceof ti){if(o.__ctx)for(;o.__ctx.__SVGdefs.childNodes.length;){const h=o.__ctx.__SVGdefs.childNodes[0].getAttribute("id");this.__ids[h]=h,this.__SVGdefs.appendChild(o.__ctx.__SVGdefs.childNodes[0])}e.setAttribute(a.apply,rt("url(#{id})",{id:o.__root.getAttribute("id")}))}else if(o instanceof cs)e.setAttribute(a.apply,rt("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 c=/rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d?\.?\d*)\s*\)/gi.exec(o);if(c){e.setAttribute(a.svgAttr,rt("rgb({r},{g},{b})",{r:c[1],g:c[2],b:c[3]}));let l=parseFloat(c[4]);const d=this.globalAlpha;d!=null&&(l*=d),e.setAttribute(a.svgAttr+"-opacity",""+l)}}else{let h=a.svgAttr;if(n[r]==="globalAlpha"&&(h=t+"-"+a.svgAttr,e.getAttribute(h)))continue;h&&e.setAttribute(h,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 n=Object.keys(Rn);for(let r=0,a=n.length;r<a;r++){const o=n[r],h=Rn[o],c=new RegExp(o,"gi");c.test(e)&&(e=e.replace(c,h))}}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 n=this.__createElement("g");e.appendChild(n),this.__currentElement=n}let s=this.__currentElement.getAttribute("transform");s?s+=" ":s="",s+=t,this.__currentElement.setAttribute("transform",s)}scale(t,e){e===void 0&&(e=t),this.__addTransform(rt("scale({x},{y})",{x:t,y:e}))}rotate(t){const e=t*180/Math.PI;this.__addTransform(rt("rotate({angle},{cx},{cy})",{angle:e,cx:0,cy:0}))}translate(t,e){this.__addTransform(rt("translate({x},{y})",{x:t,y:e}))}transform(t,e,s,n,r,a){this.__addTransform(rt("matrix({a},{b},{c},{d},{e},{f})",{a:t,b:e,c:s,d:n,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(rt("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(rt("L {x} {y}",this.__currentPosition)):this.__addPathCommand(rt("M {x} {y}",this.__currentPosition))}bezierCurveTo(t,e,s,n,r,a){this.__currentPosition={x:r,y:a},this.__addPathCommand(rt("C {cp1x} {cp1y} {cp2x} {cp2y} {x} {y}",{cp1x:t,cp1y:e,cp2x:s,cp2y:n,x:r,y:a}))}quadraticCurveTo(t,e,s,n){this.__currentPosition={x:s,y:n},this.__addPathCommand(rt("Q {cpx} {cpy} {x} {y}",{cpx:t,cpy:e,x:s,y:n}))}normalize(t){const e=Math.sqrt(t[0]*t[0]+t[1]*t[1]);return[t[0]/e,t[1]/e]}arcTo(t,e,s,n,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===s&&e===n||r===0){this.lineTo(t,e);return}const h=this.normalize([a-t,o-e]),c=this.normalize([s-t,n-e]);if(h[0]*c[1]===h[1]*c[0]){this.lineTo(t,e);return}const l=h[0]*c[0]+h[1]*c[1],d=Math.acos(Math.abs(l)),g=this.normalize([h[0]+c[0],h[1]+c[1]]),y=r/Math.sin(d/2),p=t+y*g[0],x=e+y*g[1],b=[-h[1],h[0]],S=[c[1],-c[0]],C=function(Y){const X=Y[0];return Y[1]>=0?Math.acos(X):-Math.acos(X)},L=C(b),R=C(S);this.lineTo(p+b[0]*r,x+b[1]*r),this.arc(p,x,r,L,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,s,n){this.__currentElement.nodeName!=="path"&&this.beginPath(),this.moveTo(t,e),this.lineTo(t+s,e),this.lineTo(t+s,e+n),this.lineTo(t,e+n),this.lineTo(t,e),this.closePath()}fillRect(t,e,s,n){const r=this.__createElement("rect",{x:t,y:e,width:s,height:n},!0);this.__closestGroupOrSvg().appendChild(r),this.__currentElement=r,this.__applyStyleToCurrentElement("fill")}strokeRect(t,e,s,n){const r=this.__createElement("rect",{x:t,y:e,width:s,height:n},!0);this.__closestGroupOrSvg().appendChild(r),this.__currentElement=r,this.__applyStyleToCurrentElement("stroke")}__clearCanvas(){const e=this.__closestGroupOrSvg().getAttribute("transform"),s=this.__rootSVG.childNodes[1],n=s.childNodes;for(let r=n.length-1;r>=0;r--)n[r]&&s.removeChild(n[r]);this.__currentElement=s,this.__groupStack=[],e&&this.__addTransform(e)}clearRect(t,e,s,n){if(t===0&&e===0&&s===this.width&&n===this.height){this.__clearCanvas();return}const r=this.__closestGroupOrSvg(),a=this.__createElement("rect",{x:t,y:e,width:s,height:n,fill:"#FFFFFF"},!0);r.appendChild(a)}createLinearGradient(t,e,s,n){const r=this.__createElement("linearGradient",{id:hs(this.__ids),x1:t+"px",x2:s+"px",y1:e+"px",y2:n+"px",gradientUnits:"userSpaceOnUse"},!1);return this.__SVGdefs.appendChild(r),new cs(r,this)}createRadialGradient(t,e,s,n,r,a){const o=this.__createElement("radialGradient",{id:hs(this.__ids),cx:n+"px",cy:r+"px",r:a+"px",fx:t+"px",fy:e+"px",gradientUnits:"userSpaceOnUse"},!1);return this.__SVGdefs.appendChild(o),new cs(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),s={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"&&(s.decoration="underline"),this.__fontHref&&(s.href=this.__fontHref),s}__wrapTextLink(t,e){if(t.href){const s=this.__createElement("a");return s.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",t.href),s.appendChild(e),s}return e}__applyText(t,e,s,n){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:s,"text-anchor":No(this.textAlign),"dominant-baseline":Fo(this.textBaseline)},!0);o.appendChild(this.__document.createTextNode(t)),this.__currentElement=o,this.__applyStyleToCurrentElement(n),a.appendChild(this.__wrapTextLink(r,o))}fillText(t,e,s){this.__applyText(t,e,s,"fill")}strokeText(t,e,s){this.__applyText(t,e,s,"stroke")}measureText(t){return this.__ctx.font=this.font,this.__ctx.measureText(t)}arc(t,e,s,n,r,a){if(n===r)return;n=n%(2*Math.PI),r=r%(2*Math.PI),n===r&&(r=(r+2*Math.PI-.001*(a?-1:1))%(2*Math.PI));const o=t+s*Math.cos(r),h=e+s*Math.sin(r),c=t+s*Math.cos(n),l=e+s*Math.sin(n),d=a?0:1;let g=0,y=r-n;y<0&&(y+=2*Math.PI),a?g=y>Math.PI?0:1:g=y>Math.PI?1:0,this.lineTo(c,l),this.__addPathCommand(rt("A {rx} {ry} {xAxisRotation} {largeArcFlag} {sweepFlag} {endX} {endY}",{rx:s,ry:s,xAxisRotation:0,largeArcFlag:g,sweepFlag:d,endX:o,endY:h})),this.__currentPosition={x:o,y:h}}clip(){const t=this.__closestGroupOrSvg(),e=this.__createElement("clipPath"),s=hs(this.__ids),n=this.__createElement("g");this.__applyCurrentDefaultPath(),t.removeChild(this.__currentElement),e.setAttribute("id",s),e.appendChild(this.__currentElement),this.__SVGdefs.appendChild(e),t.setAttribute("clip-path",rt("url(#{id})",{id:s})),t.appendChild(n),this.__currentElement=n}drawImage(...t){let e=t[0],s,n,r,a,o=0,h=0,c,l,d,g,y,p,x,b;if(t.length===3)s=t[1],n=t[2],c=e.width,l=e.height,r=c,a=l;else if(t.length===5)s=t[1],n=t[2],r=t[3],a=t[4],c=e.width,l=e.height;else if(t.length===9)o=t[1],h=t[2],c=t[3],l=t[4],s=t[5],n=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("+s+", "+n+")";if(e instanceof Me){if(d=e.getSvg().cloneNode(!0),d.childNodes&&d.childNodes.length>1){for(g=d.childNodes[0];g.childNodes.length;)b=g.childNodes[0].getAttribute("id"),this.__ids[b]=b,this.__SVGdefs.appendChild(g.childNodes[0]);if(y=d.childNodes[1],y){const L=y.getAttribute("transform");let R;L?R=L+" "+C:R=C,y.setAttribute("transform",R),S.appendChild(y)}}}else(e.nodeName==="CANVAS"||e.nodeName==="IMG")&&(p=this.__createElement("image"),p.setAttribute("width",r),p.setAttribute("height",a),p.setAttribute("preserveAspectRatio","none"),(o||h||c!==e.width||l!==e.height)&&(x=this.__document.createElement("canvas"),x.width=r,x.height=a,x.getContext("2d")?.drawImage(e,o,h,c,l,0,0,r,a),e=x),p.setAttribute("transform",C),p.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",e.nodeName==="CANVAS"?e.toDataURL():e.getAttribute("src")),S.appendChild(p))}createPattern(t,e){const s=this.__document.createElementNS("http://www.w3.org/2000/svg","pattern"),n=hs(this.__ids);let r;return s.setAttribute("id",n),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")),s.appendChild(r),this.__SVGdefs.appendChild(s)):t instanceof Me&&(s.setAttribute("width",""+t.width),s.setAttribute("height",""+t.height),s.appendChild(t.__rootSVG.childNodes[1]),this.__SVGdefs.appendChild(s)),new ti(s,this)}setLineDash(t){t&&t.length>0?this.lineDash=t.join(","):this.lineDash=null}drawFocusRing(){}createImageData(){}getImageData(){}putImageData(){}globalCompositeOperation(){}setTransform(){}}class ls{canvas;context;customContext;currentPath2D=new Path2D;path2Ds=[];currentMatrix=new DOMMatrix;hasSetCustomStrokeStyle=!1;hasSetCustomFillStyle=!1;constructor(t,e,s,n=!1){this.canvas=t,this.context=t.getContext("2d",{willReadFrequently:!0}),n&&(this.customContext=new Me({canvas:this.canvas,width:e||this.canvas.width,height:s||this.canvas.height}))}set lineWidth(t){this.hasSetCustomStrokeStyle=!0,this.context.lineWidth=t,this.customContext&&(this.customContext.lineWidth=t)}get lineWidth(){return this.context.lineWidth}set lineCap(t){this.hasSetCustomStrokeStyle=!0,this.context.lineCap=t,this.customContext&&(this.customContext.lineCap=t)}get lineCap(){return this.context.lineCap}set lineJoin(t){this.hasSetCustomStrokeStyle=!0,this.context.lineJoin=t,this.customContext&&(this.customContext.lineCap=t)}get lineJoin(){return this.context.lineJoin}set lineDashOffset(t){this.hasSetCustomStrokeStyle=!0,this.context.lineDashOffset=t,this.customContext&&(this.customContext.lineDashOffset=t)}get lineDashOffset(){return this.context.lineDashOffset}set miterLimit(t){this.hasSetCustomStrokeStyle=!0,this.context.miterLimit=t,this.customContext&&(this.customContext.miterLimit=t)}get miterLimit(){return this.context.miterLimit}set globalAlpha(t){this.context.globalAlpha=t,this.customContext&&(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&&(this.customContext.fillStyle=t)):(this.context.fillStyle=t.gradient,this.customContext&&(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&&(this.customContext.strokeStyle=t)):(this.context.strokeStyle=t.gradient,this.customContext&&(this.customContext.strokeStyle=t.gradientCustom))}get strokeStyle(){return this.context.strokeStyle}set font(t){this.context.font=t,this.customContext&&(this.customContext.font=t)}get font(){return this.context.font}set textBaseline(t){this.context.textBaseline=t,this.customContext&&(this.customContext.textBaseline=t)}get textBaseline(){return this.context.textBaseline}set textAlign(t){this.context.textAlign=t,this.customContext&&(this.customContext.textAlign=t)}get textAlign(){return this.context.textAlign}fill(t){return t?this.context.fill(t):(this.context.fill(),this.customContext&&this.customContext.fill()),this}fillRect(t,e,s,n){return this.context.fillRect(t,e,s,n),this.customContext&&this.customContext.fillRect(t,e,s,n),this}fillText(t,e,s,n){return this.hasSetCustomFillStyle=!1,this.context.fillText(t,e,s,n),this.customContext&&this.customContext.fillText(t,e,s),this}setLineDash(t){return this.context.setLineDash(t),this.customContext&&this.customContext.setLineDash(t),this}stroke(t){return t?this.context.stroke(t):(this.context.stroke(),this.customContext&&this.customContext.stroke()),this}strokeText(t,e,s,n){return this.context.strokeText(t,e,s,n),this.customContext&&this.customContext.strokeText(t,e,s),this}strokeRect(t,e,s,n){return this.context.strokeRect(t,e,s,n),this.customContext&&this.customContext.strokeRect(t,e,s,n),this}measureText(t){return this.context.measureText(t)}clearRect(t=0,e=0,s=this.canvas.width,n=this.canvas.height){return this.context.clearRect(t,e,s,n),this.customContext&&this.customContext.clearRect(t,e,s,n),this}save(){return this.context.save(),this.customContext&&this.customContext.save(),this.currentMatrix=new DOMMatrix,this.path2Ds.push(this.currentPath2D),this.currentPath2D=new Path2D,this}restore(){return this.context.restore(),this.customContext&&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&&this.customContext.beginPath(),this}closePath(){return this.context.closePath(),this.customContext&&this.customContext.closePath(),this.currentPath2D.closePath(),this}changePath2D(t=this.currentPath2D,e=this.currentMatrix){const s=new Path2D;s.addPath(t,e),this.currentPath2D=s}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&&this.customContext.translate(t,e),this.currentMatrix.translate(t,e),this.changePath2D(),this}rotate(t,e=0,s=0){return this.translate(e,s),this.context.rotate(t),this.customContext&&this.customContext.rotate(t),this.currentMatrix.rotate(t),this.translate(-e,-s),this.changePath2D(),this}scale(t,e=t,s=0,n=0){return this.translate(s,n),this.context.scale(t,e),this.customContext&&this.customContext.scale(t,e),this.currentMatrix.scale(t,e),this.translate(-s,-n),this.changePath2D(),this}moveTo(t,e){return this.context.moveTo(t,e),this.customContext&&this.customContext.moveTo(t,e),this.currentPath2D.moveTo(t,e),this}lineTo(t,e){return this.context.lineTo(t,e),this.customContext&&this.customContext.lineTo(t,e),this.currentPath2D.lineTo(t,e),this}arc(t,e,s,n,r,a){return this.context.arc(t,e,s,n,r,a),this.customContext&&this.customContext.arc(t,e,s,n,r,a?-1:1),this.currentPath2D.arc(t,e,s,n,r,a),this}arcTo(t,e,s,n,r){return this.context.arcTo(t,e,s,n,r),this.customContext&&this.customContext.arcTo(t,e,s,n,r),this.currentPath2D.arcTo(t,e,s,n,r),this}ellipse(t,e,s,n,r,a,o,h){return this.context.ellipse(t,e,s,n,r,a,o,h),this.currentPath2D.ellipse(t,e,s,n,r,a,o,h),this}quadraticCurveTo(t,e,s,n){return this.context.quadraticCurveTo(t,e,s,n),this.customContext&&this.customContext.quadraticCurveTo(t,e,s,n),this.currentPath2D.quadraticCurveTo(t,e,s,n),this}bezierCurveTo(t,e,s,n,r,a){return this.context.bezierCurveTo(t,e,s,n,r,a),this.customContext&&this.customContext.bezierCurveTo(t,e,s,n,r,a),this.currentPath2D.bezierCurveTo(t,e,s,n,r,a),this}rect(t,e,s,n){return this.context.rect(t,e,s,n),this.customContext&&this.customContext.rect(t,e,s,n),this.currentPath2D.rect(t,e,s,n),this}createLinearGradient(t,e,s,n,r){const a=this.context.createLinearGradient(t,e,s,n);return r&&Object.entries(r).forEach(([o,h])=>{a.addColorStop(parseFloat(o),h)}),a}createRadialGradient(t,e,s,n,r,a,o){const h=this.context.createRadialGradient(t,e,s,n,r,a);return o&&Object.entries(o).forEach(([c,l])=>{h.addColorStop(parseFloat(c),l)}),h}drawImage(t,...e){if(e.length===0)this.context.drawImage(t,0,0);else if(e.length===2){const s=e[0],n=e[1];this.context.drawImage(t,s,n)}else if(e.length===4){const s=e[0],n=e[1],r=e[2],a=e[3];this.context.drawImage(t,s,n,r,a)}else if(e.length===8){const s=e[0],n=e[1],r=e[2],a=e[3],o=e[4],h=e[5],c=e[6],l=e[7];this.context.drawImage(t,s,n,r,a,o,h,c,l)}else throw new Error("Invalid number of arguments passed to drawImage: "+e.length);return this.customContext&&this.customContext.drawImage(t,...e),this}getImageData(t=0,e=0,s=this.canvas.width,n=this.canvas.height,r){return this.context.getImageData(t,e,s,n,r)}putImageData(t,e=0,s=0){return this.context.putImageData(t,e,s)}createPattern(t,e){return this.context.createPattern(t,e)}toRawSVG(){if(this.customContext){const t=this.customContext.getSerializedSvg(!0),e=this.customContext.getSvg();return{raw:t,element:e}}else return{raw:"",element:null}}}class us{x;y;toX;toY;constructor(t){this.x=t?.x||0,this.y=t?.y||0,this.toX=t?.toX||0,this.toY=t?.toY||0}toSVGPathData(){return[["L",this.toX,this.toY]]}toCanvasContext(t){t.lineTo(this.toX,this.toY)}getBoundingClientRect(){const t=$t(this.x,this.y,this.toX,this.toY);if(t===0){const e=Math.min(this.x,this.toX),s=Math.min(this.y,this.toY),n=Math.max(this.x,this.toX),r=Math.max(this.y,this.toY);return{x:e,y:s,width:n-e,height:r-s}}else{const e=Math.sin(t),s=Math.cos(t),n=s*this.x-e*this.y,r=s*this.toX-e*this.toY,a=s*this.y+e*this.x,o=s*this.toY+e*this.toX;return{x:Math.min(n,r),y:Math.min(a,o),width:Math.max(n,r)-Math.min(n,r),height:Math.max(a,o)-Math.min(a,o)}}}interpolate(t){return{x:this.x+t*(this.toX-this.x),y:this.y+t*(this.toY-this.y)}}intersection(t){const e=this.x,s=this.y,n=t.toX,r=t.toY,a=this.toX-e,o=t.x-n;if(!a&&!o)return null;const h=(this.toY-s)/a,c=(t.y-r)/o;if(a){if(!o)return{x:n,y:h*(n-e)+s}}else return{x:e,y:c*(e-n)+r};const l=(-c*n+r+h*e-s)/(h-c),d=h*(l-e)+s;return isNaN(l)||isNaN(d)?null:{x:l,y:d}}}const On=us;class ei extends us{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,this.toX=t.toX,this.toY=t.toY}toSVGPathData(){return[["A",this.rx,this.ry,this.xAxisRotate,this.largeArcFlag,this.sweepFlag,this.toX,this.toY]]}toCanvasContext(t){const[e,s,n,r,a,o,h]=this.convert(this.x,this.y,this.toX,this.toY,this.rx,this.ry,this.xAxisRotate,this.largeArcFlag,this.sweepFlag);t.ellipse(e,s,n,r,a,o,h,!this.sweepFlag)}convert(t,e,s,n,r,a,o,h,c){const l=o/180*Math.PI,d=(t-s)/2,g=(e-n)/2,y=Math.cos(l)*d+Math.sin(l)*g,p=-Math.sin(l)*d+Math.cos(l)*g,x=y*y/(r*r)+p*p/(a*a);if(x>1){const z=Math.sqrt(x);throw r=z*r,a=z*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*p*p-a*a*y*y)/(r*r*p*p+a*a*y*y)),S=h!=c?1:-1,C=S*b*r*p/a,L=S*b*-a*y/r,R=(t+s)/2,Y=(e+n)/2,X=Math.cos(l)*C-Math.sin(l)*L+R,V=Math.sin(l)*C+Math.cos(l)*L+Y,it=(z,nt,bt,dt)=>(z*dt>=nt*bt?1:-1)*Math.acos((z*bt+nt*dt)/(Math.sqrt(z*z+nt*nt)*Math.sqrt(bt*bt+dt*dt))),W=it(1,0,t-X,e-V)-l,$=it(t-X,e-V,s-X,n-V);return[X,V,r,a,l,W,W+$]}}class Bo extends us{cx;cy;isLineThrough;constructor(t){super(t),this.cx=t.cx,this.cy=t.cy,this.isLineThrough=typeof t.isLineThrough=="boolean"?t.isLineThrough:!1}toSVGPathData(){if(this.isLineThrough){const t=this.cx*2-(this.x+this.toX)/2,e=this.cy*2-(this.y+this.toY)/2;return[["Q",t,e,this.toX,this.toY]]}else return[["Q",this.cx,this.cy,this.toX,this.toY]]}toCanvasContext(t){if(this.isLineThrough){const e=this.cx*2-(this.x+this.toX)/2,s=this.cy*2-(this.y+this.toY)/2;t.quadraticCurveTo(e,s,this.toX,this.toY)}else t.quadraticCurveTo(this.cx,this.cy,this.toX,this.toY)}getBoundingClientRect(){const t=[this.x,this.toX],e=[this.y,this.toY];let s,n,r,a;for(let c=0;c<2;++c)s=c==0?this.x-2*this.cx+this.toX:this.y-2*this.cy+this.toY,n=c==0?-2*this.x+2*this.cx:-2*this.y+2*this.cy,r=c==0?this.x:this.y,Math.abs(s)>1e-12&&(a=-n/(2*s),0<a&&a<1&&[t,e][c].push(s*a*a+n*a+r));const o={x:Math.min.apply(0,t),y:Math.min.apply(0,e)},h={x:Math.max.apply(0,t),y:Math.max.apply(0,e)};return{x:o.x,y:o.y,width:h.x-o.x,height:h.y-o.y}}interpolate(t){return{x:(1-t)*(1-t)*this.x+2*(1-t)*t*this.cx+t*t*this.toX,y:(1-t)*(1-t)*this.y+2*(1-t)*t*this.cy+t*t*this.toY}}}const Xo=Bo;class lt extends us{c1x;c1y;c2x;c2y;constructor(t){super(t),this.c1x=t.c1x,this.c1y=t.c1y,this.c2x=t.c2x,this.c2y=t.c2y}toSVGPathData(){return[["C",this.c1x,this.c1y,this.c2x,this.c2y,this.toX,this.toY]]}toCanvasContext(t){t.bezierCurveTo(this.c1x,this.c1y,this.c2x,this.c2y,this.toX,this.toY)}getBoundingClientRect(){let t=this.c2x-2*this.c1x+this.x-(this.toX-2*this.c2x+this.c1x),e=2*(this.c1x-this.x)-2*(this.c2x-this.c1x),s=this.x-this.c1x,n=(-e+Math.sqrt(e*e-4*t*s))/2/t,r=(-e-Math.sqrt(e*e-4*t*s))/2/t;const a=[this.y,this.toY],o=[this.x,this.toX];let h;const c=[];Math.abs(n)>1e12&&(n=.5),Math.abs(r)>1e12&&(r=.5),n>=0&&n<=1&&(h=this.interpolate(n),o.push(h.x),a.push(h.y),c.push({X:h.x,Y:h.y})),r>=0&&r<=1&&(h=this.interpolate(r),o.push(h.x),a.push(h.y),c.push({X:h.x,Y:h.y})),t=this.c2y-2*this.c1y+this.y-(this.toY-2*this.c2y+this.c1y),e=2*(this.c1y-this.y)-2*(this.c2y-this.c1y),s=this.y-this.c1y,n=(-e+Math.sqrt(e*e-4*t*s))/2/t,r=(-e-Math.sqrt(e*e-4*t*s))/2/t,Math.abs(n)>1e12&&(n=.5),Math.abs(r)>1e12&&(r=.5),n>=0&&n<=1&&(h=this.interpolate(n),o.push(h.x),a.push(h.y),c.push({X:h.x,Y:h.y})),r>=0&&r<=1&&(h=this.interpolate(r),o.push(h.x),a.push(h.y),c.push({X:h.x,Y:h.y}));let l=[],d=c.length;for(let p=0;p<d;p++){for(let x=p+1;x<d;x++)c[p].X===c[x].X&&c[p].Y===c[x].Y&&(x=++p);l.push({X:c[p].X,Y:c[p].Y})}const g={x:Math.min.apply(Math,o),y:Math.min.apply(Math,a)},y={x:Math.max.apply(Math,o),y:Math.max.apply(Math,a)};return{x:g.x,y:g.y,width:y.x-g.x,height:y.y-g.y,dots:l}}interpolate(t){return{x:Math.pow(1-t,3)*this.x+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.toX,y:Math.pow(1-t,3)*this.y+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.toY}}static base3(t,e,s,n,r){const a=-3*e+9*s-9*n+3*r,o=t*a+6*e-12*s+6*n;return t*o-3*e+3*s}static bezlen(t,e,s,n,r,a,o,h,c=1){c=Math.max(0,Math.min(c,1));const l=c/2,d=[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816],g=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472];let y=0;for(let p=0;p<12;p++){const x=l*d[p]+l,b=this.base3(x,t,s,r,o),S=this.base3(x,e,n,a,h);y+=g[p]*Math.sqrt(b*b+S*S)}return l*y}length(t=1){return lt.bezlen(this.x,this.y,this.c1x,this.c1y,this.c2x,this.c2y,this.toX,this.toY,t)}getTatLen(t){const e=this.x,s=this.y,n=this.c1x,r=this.c1y,a=this.c2x,o=this.c2y,h=this.toX,c=this.toY;if(t<0||lt.bezlen(e,s,n,r,a,o,h,c)<t)return 0;let l=1,d=l/2,g=l-d,y=lt.bezlen(e,s,n,r,a,o,h,c,g);for(;Math.abs(y-t)>.01;)d/=2,g+=(y<t?1:-1)*d,y=lt.bezlen(e,s,n,r,a,o,h,c,g);return g}getPointAtSegmentLength(t){const e=this.getTatLen(t);let s=1-e,n=Math.pow(s,3),r=Math.pow(s,2),a=e*e,o=a*e,h=n*this.x+r*3*e*this.c1x+s*3*e*e*this.c2x+o*this.toX,c=n*this.y+r*3*e*this.c1y+s*3*e*e*this.c2y+o*this.toY,l=this.x+2*e*(this.c1x-this.x)+a*(this.c2x-2*this.c1x+this.x),d=this.y+2*e*(this.c1y-this.y)+a*(this.c2y-2*this.c1y+this.y),g=this.c1x+2*e*(this.c2x-this.c1x)+a*(this.toX-2*this.c2x+this.c1x),y=this.c1y+2*e*(this.c2y-this.c1y)+a*(this.toY-2*this.c2y+this.c1y),p=s*this.x+e*this.c1x,x=s*this.y+e*this.c1y,b=s*this.c2x+e*this.toX,S=s*this.c2y+e*this.toY,C=90-Math.atan2(l-g,d-y)*180/Math.PI;return{x:h,y:c,m:{x:l,y:d},n:{x:g,y},start:{x:p,y:x},end:{x:b,y:S},alpha:C}}}const Ae=Math.PI*2;function Nn(i,t,e,s){const n=i*s-t*e<0?-1:1;let r=i*e+t*s;return r>1&&(r=1),r<-1&&(r=-1),n*Math.acos(r)}function Yo(i,t,e,s,n,r,a,o,h,c){const l=c*(i-e)/2+h*(t-s)/2,d=-h*(i-e)/2+c*(t-s)/2,g=a*a,y=o*o,p=l*l,x=d*d;let b=g*y-g*x-y*p;b<0&&(b=0),b/=g*x+y*p,b=Math.sqrt(b)*(n===r?-1:1);const S=b*a/o*d,C=b*-o/a*l,L=c*S-h*C+(i+e)/2,R=h*S+c*C+(t+s)/2,Y=(l-S)/a,X=(d-C)/o,V=(-l-S)/a,it=(-d-C)/o,W=Nn(1,0,Y,X);let $=Nn(Y,X,V,it);return r===0&&$>0&&($-=Ae),r===1&&$<0&&($+=Ae),[L,R,W,$]}function Uo(i,t){const e=1.3333333333333333*Math.tan(t/4),s=Math.cos(i),n=Math.sin(i),r=Math.cos(i+t),a=Math.sin(i+t);return[s,n,s-n*e,n+s*e,r+a*e,a-r*e,r,a]}function Fn(i,t,e,s,n,r,a,o,h){const c=Math.sin(h*Ae/360),l=Math.cos(h*Ae/360),d=l*(i-e)/2+c*(t-s)/2,g=-c*(i-e)/2+l*(t-s)/2;if(d===0&&g===0)return[];if(a===0||o===0)return[];a=Math.abs(a),o=Math.abs(o);const y=d*d/(a*a)+g*g/(o*o);y>1&&(a*=Math.sqrt(y),o*=Math.sqrt(y));const p=Yo(i,t,e,s,n,r,a,o,c,l),x=[];let b=p[2],S=p[3];const C=Math.max(Math.ceil(Math.abs(S)/(Ae/4)),1);S/=C;for(let L=0;L<C;L++)x.push(Uo(b,S)),b+=S;return x.map(L=>{for(let R=0;R<L.length;R+=2){let Y=L[R+0],X=L[R+1];Y*=a,X*=o;const V=l*Y-c*X,it=c*Y+l*X;L[R+0]=V+p[0],L[R+1]=it+p[1]}return L})}function si(i,t,e,s,n,r){return[i/3+.6666666666666666*e,t/3+.6666666666666666*s,n/3+.6666666666666666*e,r/3+.6666666666666666*s,n,r]}function Ie(i,t,e,s){return[i,t,e,s,e,s]}const De={a:7,c:6,s:4,q:4,t:2,m:2,l:2,h:1,v:1,z:0};class oe{static createSVGElement(t="path",e){const s=document.createElementNS.call(document,"http://www.w3.org/2000/svg",t);return e&&I.attribute(s,e),s}static createSvgPath(t,e){return this.createSVGElement("path",{d:t,id:e||Gs()})}static downloadFromSVGElement(t,e="shape"){return Js(bn(t),`${e}.svg`)}static downloadFromSVGString(t,e="shape"){return Js(Ws(t),`${e}.svg`)}static getSVGRawStringFromElement(t){return $s(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 oe.isSVGPath(t)&&t.replace(/([mlhvzaqtcs])([^mlhvzaqtcs]*)/gi,(s,n,r)=>{let a=n.toLowerCase();const o=wn(r);for(a=="m"&&o.length>De[a]&&(e.push([n,...o.splice(0,De[a])]),a="l",n=n=="m"?"l":"L");o.length;){if(o.length<De[a])throw new Error(`parseSVGPath substring:{ ${s} } command:{ ${n} } args:{ ${o} }`);e.push([n,...o.splice(0,De[a])])}return a=="z"&&e.push([n]),""}),e}static absolutizeSVGPath(t){let e=0,s=0,n=0,r=0;return t.map(function(a){const o=a[0],h=o.toUpperCase();if(o!=h)switch(a[0]=h,o){case"a":a[6]+=n,a[7]+=r;break;case"v":a[1]+=r;break;case"h":a[1]+=n;break;default:for(let c=1;c<a.length;)a[c++]+=n,a[c++]+=r}switch(h){case"Z":n=e,r=s;break;case"H":n=a[1];break;case"V":r=a[1];break;case"M":n=e=a[1],r=s=a[2];break;default:n=a[a.length-2],r=a[a.length-1]}return a})}static relativeSVGPath(t){let e=0,s=0,n=0,r=0;return t.map(function(a){const o=a[0],h=o.toLowerCase();if(o!=h)switch(a[0]=h,o){case"A":a[6]-=n,a[7]-=r;break;case"V":a[1]-=r;break;case"H":a[1]-=n;break;default:for(let c=1;c<a.length;)a[c++]-=n,a[c++]-=r}switch(h){case"z":n=e,r=s;break;case"h":n+=a[1];break;case"v":r+=a[1];break;case"m":n+=a[1],r+=a[2],e+=a[1],s+=a[2];break;default:n+=a[a.length-2],r+=a[a.length-1]}return a})}static normalizeSVGPath(t){const e=[];let s=0,n=0,r=0,a=0,o=0,h=0,c=0,l=0,d;for(let g=0,y=t.length;g<y;g++){let p=t[g];const x=p[0];switch(x){case"M":s=p[1],n=p[2];break;case"A":const b=Fn(r,a,p[6],p[7],p[4],p[5],p[1],p[2],p[3]);if(!b.length)continue;b.forEach((L,R)=>{const[Y,X,V,it,W,$,z,nt]=L;p=["C",V,it,W,$,z,nt],R<b.length-1&&e.push(p)});break;case"S":let S=r,C=a;(d=="C"||d=="S")&&(S+=S-c,C+=C-l),p=["C",S,C,p[1],p[2],p[3],p[4]];break;case"T":d=="Q"||d=="T"?(o=r*2-o,h=a*2-h):(o=r,h=a),p=["C",...si(r,a,o,h,p[1],p[2])];break;case"Q":o=p[1],h=p[2],p=["C",...si(r,a,p[1],p[2],p[3],p[4])];break;case"L":p=["C",...Ie(r,a,p[1],p[2])];break;case"H":p=["C",...Ie(r,a,p[1],a)];break;case"V":p=["C",...Ie(r,a,r,p[1])];break;case"Z":p=["C",...Ie(r,a,s,n)];break}d=x,r=p[p.length-2],a=p[p.length-1],p.length>4?(c=p[p.length-4],l=p[p.length-3]):(c=r,l=a),e.push(p)}return e}static catmullRom2bezier(t){const e=[];for(let s=0,n=t.length;n-2>s;s+=2){let r;s==0?r=[{x:t[s],y:t[s+1]},{x:t[s],y:t[s+1]},{x:t[s+2],y:t[s+3]},{x:t[s+4],y:t[s+5]}]:n-4==s?r=[{x:t[s-2],y:t[s-1]},{x:t[s],y:t[s+1]},{x:t[s+2],y:t[s+3]},{x:t[s+2],y:t[s+3]}]:r=[{x:t[s-2],y:t[s-1]},{x:t[s],y:t[s+1]},{x:t[s+2],y:t[s+3]},{x:t[s+4],y:t[s+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){const e=[];let s=["L",0,0],n;for(let r=0,a=t.length;r<a;r++){const o=t[r];switch(o[0]){case"M":s=["L",o[1],o[2]],e.push(o);break;case"Z":e.push(s);break;case"H":n=e[e.length-1]||["L",0,0],e.push(["L",o[1],n[n.length-1]]);break;case"V":n=e[e.length-1]||["L",0,0],e.push(["L",n[n.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 s,n=0,r=0;for(let a=0,o=t.length;a<o;a++){const h=t[a],c=e[h[0]];c&&(h[0]=c.to,s&&(s[0]===c.to?(n=2*Number(s[c.x+2])-Number(s[c.x]),r=2*Number(s[c.x+3])-Number(s[c.x+1])):(n=Number(s[s.length-2]),r=Number(s[s.length-1]))),h.splice(1,0,n,r)),s=h}return t}}const mt=oe;class pt{cX;cY;x;y;degree;scalarX;scalarY;startPathX=0;startPathY=0;prevPathX=0;prevPathY=0;normalizedLines=[];constructor(t){this.cX=0,this.cY=0,this.x=t?.x||0,this.y=t?.y||0,typeof t?.centerX=="number"&&typeof t?.centerY=="number"&&(this.cX=t.centerX-this.x,this.cY=t.centerY-this.y),this.degree=t?.degree||0,this.scalarX=1,this.scalarY=1,t?.scalar!==void 0&&(this.scalarX=t.scalar,this.scalarY=t.scalar),t?.scalarX!==void 0&&(this.scalarX=t.scalarX),t?.scalarY!==void 0&&(this.scalarY=t.scalarY),this.reset(t?.d,t?.originMatrix)}reset(t,e){typeof t=="string"?this.resetFromSVGPathData(mt.parseSVGPath(t),e):t instanceof pt?this.resetFromSVGPathData(t.toSVGPathData(),e):this.resetFromSVGPathData(t||[],e)}resetFromSVGPathData(t,e){this.normalizedLines=[];const s=mt.normalizeSVGPath(mt.absolutizeSVGPath(t));this.prevPathX=this.startPathX=0,this.prevPathY=this.startPathY=0;let n=!1;for(let r=0,a=s.length;r<a;r++){const o=s[r];if(o[0]=="M"){n||(n=!0,this.startPathX=o[1],this.startPathY=o[2]),this.prevPathX=o[1],this.prevPathY=o[2];continue}this.appendLine(new lt({c1x:o[1],c1y:o[2],c2x:o[3],c2y:o[4],toX:o[5],toY:o[6]}))}e&&({x:this.startPathX,y:this.startPathY}=e.transformPoint({x:this.startPathX,y:this.startPathY}),{x:this.prevPathX,y:this.prevPathY}=e.transformPoint({x:this.prevPathX,y:this.prevPathY}),this.normalizedLines.forEach(r=>{({x:r.x,y:r.y}=e.transformPoint({x:r.x,y:r.y})),{x:r.c1x,y:r.c1y}=e.transformPoint({x:r.c1x,y:r.c1y}),{x:r.c2x,y:r.c2y}=e.transformPoint({x:r.c2x,y:r.c2y}),{x:r.toX,y:r.toY}=e.transformPoint({x:r.toX,y:r.toY})}))}static fromPolymorphPoints(t){const e=new pt;e.prevPathX=e.startPathX=t[0]||0,e.prevPathY=e.startPathY=t[1]||0;for(let s=2,n=t.length;s+5<n;s+=6)e.appendLine(new lt({c1x:t[s],c1y:t[s+1],c2x:t[s+2],c2y:t[s+3],toX:t[s+4],toY:t[s+5]}));return e}static fromLines(t){const e=new pt;e.prevPathX=e.startPathX=t[0].x||0,e.prevPathY=e.startPathY=t[0].y||0;for(let s=0,n=t.length;s<n;s++)e.appendLine(t[s]);return e}appendLine(t){if(t instanceof ei){Fn(this.prevPathX,this.prevPathY,t.toX,t.toY,t.largeArcFlag,t.sweepFlag,t.rx,t.ry,t.xAxisRotate).forEach(c=>{const[l,d,g,y,p,x,b,S]=c;this.normalizedLines.push(new lt({x:this.prevPathX,y:this.prevPathY,c1x:g,c1y:y,c2x:p,c2y:x,toX:b,toY:S})),this.prevPathX=b,this.prevPathY=S});return}let e,s,n,r,a,o;t instanceof lt?(e=t.c1x,s=t.c1y,n=t.c2x,r=t.c2y,a=t.toX,o=t.toY):t instanceof Xo?[e,s,n,r,a,o]=si(this.prevPathX,this.prevPathY,t.cx,t.cy,t.toX,t.toY):[e,s,n,r,a,o]=Ie(this.prevPathX,this.prevPathY,t.toX,t.toY),this.normalizedLines.push(new lt({x:this.prevPathX,y:this.prevPathY,c1x:e,c1y:s,c2x:n,c2y:r,toX:a,toY:o})),this.prevPathX=a,this.prevPathY=o}toSVGPathData(){const{startPathX:t,startPathY:e,normalizedLines:s}=this.updateTransform(),n=[];n.push(["M",t,e]);for(let r=0,a=s.length;r<a;r++)n.push(...s[r].toSVGPathData());return n}toSVGPathD(){return mt.SVGPathDataToD(this.toSVGPathData())}toCanvasContext(t){const{startPathX:e,startPathY:s,normalizedLines:n}=this.updateTransform();t.beginPath(),t.moveTo(e,s),n.forEach(r=>{r.toCanvasContext(t)})}getBoundingClientRect(){const{normalizedLines:t}=this.updateTransform(),e=[],s=[];if(t.forEach(h=>{const c=h.getBoundingClientRect();e.push(c.x,c.x+c.width),s.push(c.y,c.y+c.height)}),e.length==0||s.length==0)return{x:0,y:0,width:0,height:0};const n=Math.min.apply(0,e),r=Math.min.apply(0,s),a=Math.max.apply(0,e),o=Math.max.apply(0,s);return{x:n,y:r,width:a-n,height:o-r}}update(t){this.cX=typeof t.cX=="number"?t.cX:this.cX,this.cY=typeof t.cY=="number"?t.cY:this.cY,this.x=t.x,this.y=t.y,this.degree=t.degree,this.scalarX=t.scalarX,this.scalarY=t.scalarY}updateTransform(){const t=new at;if(t.translate(this.x+this.cX,this.y+this.cY),t.rotate(this.degree),t.scale(this.scalarX,this.scalarY),t.translate(-this.cX,-this.cY),t.isIdentity)return{startPathX:this.startPathX,startPathY:this.startPathY,normalizedLines:this.normalizedLines};{let e=this.startPathX,s=this.startPathY;({x:e,y:s}=t.transformPoint({x:e,y:s}));const n=[];return this.normalizedLines.forEach(r=>{let a=r.x,o=r.y,h=r.c1x,c=r.c1y,l=r.c2x,d=r.c2y,g=r.toX,y=r.toY;({x:a,y:o}=t.transformPoint({x:a,y:o})),{x:h,y:c}=t.transformPoint({x:h,y:c}),{x:l,y:d}=t.transformPoint({x:l,y:d}),{x:g,y}=t.transformPoint({x:g,y}),n.push(new lt({x:a,y:o,c1x:h,c1y:c,c2x:l,c2y:d,toX:g,toY:y}))}),{startPathX:e,startPathY:s,normalizedLines:n}}}getTotalLength(){const{normalizedLines:t}=this.updateTransform();return t.reduce((e,s)=>e+=s.length(),0)}getPointAtLength(t){const{normalizedLines:e}=this.updateTransform();let s=0;const n=e.length;for(let r=0;r<n;r++){const a=e[r],o=a.length();if(s+o>=t)return a.getPointAtSegmentLength(t-s);s+=o}return e[n-1].getPointAtSegmentLength(1)}interpolate(t){const{startPathX:e,startPathY:s,normalizedLines:n}=this.updateTransform(),r=n.length;if(r===0)return{x:e,y:s};if(r===1)return n[0].interpolate(t);{let a=t*r,o=n[0];if(a--,a>1)for(let h=1;h<r&&(o=n[h],a>1);h++)a-=1;return o.interpolate(a)}}getSubpath(t,e){if(this.getTotalLength()-e<1e-6)return this.getSubpathsAtLength(this,t);{const s=this.getSubpathsAtLength(this,e,1);return t?this.getSubpathsAtLength(s,t):s}}getSubpathsAtLength(t,e,s){const{startPathX:n,startPathY:r,normalizedLines:a}=t.updateTransform();let o=null,h=0;const c=new pt;c.prevPathX=c.startPathX=n,c.prevPathY=c.startPathY=r;for(let l=0,d=a.length;l<d;l++){const g=a[l],y=g.length();if(h+y>e&&!o){const p=g.getPointAtSegmentLength(e-h);if(c.appendLine(new lt({c1x:p.start.x,c1y:p.start.y,c2x:p.m.x,c2y:p.m.y,toX:p.x,toY:p.y})),s)return c;o=c,c.appendLine(new lt({c1x:p.n.x,c1y:p.n.y,c2x:p.end.x,c2y:p.end.y,toX:g.x,toY:g.y})),h+=y;continue}h+=y,c.appendLine(g)}return c}closestPoint(t,e){const s=this.getTotalLength();let n={x:t,y:e},r=0,a=1/0,o=8;for(let c=0;c<=s;c+=o){let l=this.getPointAtLength(c),d=os(l.x,l.y,t,e);d<a&&(n=l,r=c,a=d)}for(o/=2;o>.5;){let c=r-o,l=this.getPointAtLength(c),d=os(l.x,l.y,t,e),g=r+o,y=this.getPointAtLength(g),p=os(y.x,y.y,t,e);c>=0&&d<a?(n=l,r=c,a=d):g<=s&&p<a?(n=y,r=g,a=p):o/=2}const h=this.getPointAtLength(r+(r===s?-.1:.1));return{point:n,rotation:r>=s?$t(h.x,h.y,n.x,n.y):$t(n.x,n.y,h.x,h.y),distance:Math.sqrt(a)}}get polymorphPoints(){const{startPathX:t,startPathY:e,normalizedLines:s}=this.updateTransform();return[t,e].concat(s.reduce((n,r)=>n.concat([r.c1x,r.c1y,r.c2x,r.c2y,r.toX,r.toY]),[]))}perimeterPoints(){const t=this.polymorphPoints,e=t.length;let s=t[e-2],n=t[e-1],r=0;for(let a=0;a<e;a+=6)r+=as(t[a],t[a+1],s,n),s=t[a],n=t[a+1];return Math.floor(r)}expendFill(t){const e=this.polymorphPoints,s=e.length;let n=t-s;const r=Math.ceil(t/s),a=[];a.push(["M",e[0],e[1]]);let o=2;for(;o+5<=s-1;){const h=e[o++],c=e[o++],l=e[o++],d=e[o++],g=e[o++],y=e[o++];a.push(["C",h,c,l,d,g,y]);let p=0;for(;p<r&&n>0;)a.push(["C",g,y,g,y,g,y]),n-=6,p++}return a}static mixPoints(t,e,s){const n=t.length,r=new Array(n);for(let a=0;a<n;a++)r[a]=Et(t[a]+(e[a]-t[a])*s,6);return r}static getPathInterpolator(t,e){return s=>Math.abs(s-0)<Number.EPSILON?t:Math.abs(s-1)<Number.EPSILON?e:pt.fromPolymorphPoints(pt.mixPoints(new pt({d:t}).polymorphPoints,new pt({d:e}).polymorphPoints,s)).toSVGPathData()}}const Go=pt;(function(){if(!window.requestAnimationFrame){let i=j();window.requestAnimationFrame=function(t){const e=j(),s=Math.max(0,16-(e-i)),n=window.setTimeout(function(){t(e+s)},s);return i=e+s,n}}window.cancelAnimationFrame||(window.cancelAnimationFrame=function(i){clearTimeout(i)})})();const ii=i=>{let t=!1;return window.requestAnimationFrame(function e(s){!t&&i(s)&&window.requestAnimationFrame(e)}),()=>{t=!0}};function ni(i,t=0){if(t==0)return i(j()),()=>{};{const e=j();return ii(s=>s-e>=t?(i(s),!1):!0)}}function Vo(i,t=0){let e=!1,s=0,n=j();const r=a=>{if(e)return;s++;const o=a-n-s*t;i(a,s,t-o<=0),ni(r,Math.max(0,t-o))};return ni(r,t),()=>{e=!0}}function zo(i,t=20){const e=1e3/t;let s=0,n;return()=>(j()-s>=e&&(s=j(),n=i()),n)}const Jt=new Ze;let ri=!1;function Bn(i,t,e){i&&t&&Jt.set(i,t),!ri&&(ri=!0,requestIdleCallback(s=>{for(ri=!1;s.timeRemaining()>0&&Jt.length>0;){const n=Jt.shift();n&&n[1]()}Jt.length>0&&Bn()},{timeout:e}))}let ai=!1;function oi(i,t,e){if(i&&t&&Jt.set(i,t),ai)return;ai=!0;const s=j();Yn(n=>{for(ai=!1;(n.timeRemaining()>0||e&&j()-s>=e)&&Jt.length>0;){const r=Jt.shift();r&&r[1]()}Jt.length>0&&oi()})}let ds=0,he=33,Zt=33,hi;const Xn=new MessageChannel,qo=Xn.port2;Xn.port1.onmessage=i=>{hi!==null&&hi({didTimeout:ds<=j(),timeRemaining:()=>Math.max(0,ds-j())})};function Yn(i){return hi=i,requestAnimationFrame(t=>{let e=t-ds+Zt;e<Zt&&he<Zt?(e<8&&(e=8),Zt=e<he?he:e):e>Zt&&he>Zt?Zt=e<he?he:e:he=e,ds=t+Zt,qo.postMessage(null)})}function Ho(i){return cancelAnimationFrame(i)}function jo(i){if(typeof setImmediate<"u"&&ns(setImmediate))setImmediate(i);else if(typeof MessageChannel<"u"&&(ns(MessageChannel)||MessageChannel.toString()==="[object MessageChannelConstructor]")){const{port1:t,port2:e}=new MessageChannel;e.onmessage=i,t.postMessage(null)}else typeof Promise<"u"&&ns(Promise)?Promise.resolve().then(i):setTimeout(i,0)}function Wo(i){typeof queueMicrotask=="function"?queueMicrotask(i):Promise.resolve().then(i).catch(t=>setTimeout(()=>{throw t}))}class ke{static _nextId=0;static nextId(){return ke._nextId++}}const D={Linear:{None:function(i){return i}},Ease:{In:function(i){return Math.pow(i,1.7)}},Quadratic:{In:function(i){return i*i},Out:function(i){return i*(2-i)},InOut:function(i){return(i*=2)<1?.5*i*i:-.5*(--i*(i-2)-1)}},Cubic:{In:function(i){return i*i*i},Out:function(i){return--i*i*i+1},InOut:function(i){return(i*=2)<1?.5*i*i*i:.5*((i-=2)*i*i+2)}},Quartic:{In:function(i){return i*i*i*i},Out:function(i){return 1- --i*i*i*i},InOut:function(i){return(i*=2)<1?.5*i*i*i*i:-.5*((i-=2)*i*i*i-2)}},Quintic:{In:function(i){return i*i*i*i*i},Out:function(i){return--i*i*i*i*i+1},InOut:function(i){return(i*=2)<1?.5*i*i*i*i*i:.5*((i-=2)*i*i*i*i+2)}},Sinusoidal:{In:function(i){return 1-Math.sin((1-i)*Math.PI/2)},Out:function(i){return Math.sin(i*Math.PI/2)},InOut:function(i){return .5*(1-Math.sin(Math.PI*(.5-i)))}},Exponential:{In:function(i){return i===0?0:Math.pow(1024,i-1)},Out:function(i){return i===1?1:1-Math.pow(2,-10*i)},InOut:function(i){return i===0?0:i===1?1:(i*=2)<1?.5*Math.pow(1024,i-1):.5*(-Math.pow(2,-10*(i-1))+2)}},Circular:{In:function(i){return 1-Math.sqrt(1-i*i)},Out:function(i){return Math.sqrt(1- --i*i)},InOut:function(i){return(i*=2)<1?-.5*(Math.sqrt(1-i*i)-1):.5*(Math.sqrt(1-(i-=2)*i)+1)}},Elastic:{In:function(i){return i===0?0:i===1?1:-Math.pow(2,10*(i-1))*Math.sin((i-1.1)*5*Math.PI)},Out:function(i){return i===0?0:i===1?1:Math.pow(2,-10*i)*Math.sin((i-.1)*5*Math.PI)+1},InOut:function(i){return i===0?0:i===1?1:(i*=2,i<1?-.5*Math.pow(2,10*(i-1))*Math.sin((i-1.1)*5*Math.PI):.5*Math.pow(2,-10*(i-1))*Math.sin((i-1.1)*5*Math.PI)+1)}},Back:{In:function(i){return i===1?1:i*i*((1.70158+1)*i-1.70158)},Out:function(i){return i===0?0:--i*i*((1.70158+1)*i+1.70158)+1},InOut:function(i){const t=2.5949095;return(i*=2)<1?.5*(i*i*((t+1)*i-t)):.5*((i-=2)*i*((t+1)*i+t)+2)}},Bounce:{In:function(i){return 1-D.Bounce.Out(1-i)},Out:function(i){return i<1/2.75?7.5625*i*i:i<2/2.75?7.5625*(i-=1.5/2.75)*i+.75:i<2.5/2.75?7.5625*(i-=2.25/2.75)*i+.9375:7.5625*(i-=2.625/2.75)*i+.984375},InOut:function(i){return i<.5?D.Bounce.In(i*2)*.5:D.Bounce.Out(i*2-1)*.5+.5}},generatePow:function(i=4){return i=i<Number.EPSILON?Number.EPSILON:i,i=i>1e4?1e4:i,{In:function(t){return t**i},Out:function(t){return 1-(1-t)**i},InOut:function(t){return t<.5?(t*2)**i/2:(1-(2-t*2)**i)/2+.5}}},random:function(i){return Math.random()},createStep:function(i){return function(t){return Math.floor(t*i)/i}},createNoisyEasing:function(i,t=.1){const e=1-t;return function(s){return t*Math.random()+e*i(s)}},swing:function(i){return i+Math.sin(i*Math.PI*2)/2},causeSeizures:function(i){return i+.2*Math.random()-.1}};function Un(i){switch(i){case D.Quadratic.In:return D.Quadratic.Out;case D.Quadratic.Out:return D.Quadratic.In;case D.Quadratic.InOut:return D.Quadratic.InOut;case D.Cubic.In:return D.Cubic.Out;case D.Cubic.Out:return D.Cubic.In;case D.Cubic.InOut:return D.Cubic.InOut;case D.Quartic.In:return D.Quartic.Out;case D.Quartic.Out:return D.Quartic.In;case D.Quartic.InOut:return D.Quartic.InOut;case D.Quintic.In:return D.Quintic.Out;case D.Quintic.Out:return D.Quintic.In;case D.Quintic.InOut:return D.Quintic.InOut;case D.Sinusoidal.In:return D.Sinusoidal.Out;case D.Sinusoidal.Out:return D.Sinusoidal.In;case D.Sinusoidal.InOut:return D.Sinusoidal.InOut;case D.Exponential.In:return D.Exponential.Out;case D.Exponential.Out:return D.Exponential.In;case D.Exponential.InOut:return D.Exponential.InOut;case D.Circular.In:return D.Circular.Out;case D.Circular.Out:return D.Circular.In;case D.Circular.InOut:return D.Circular.InOut;case D.Elastic.In:return D.Elastic.Out;case D.Elastic.Out:return D.Elastic.In;case D.Elastic.InOut:return D.Elastic.InOut;case D.Back.In:return D.Back.Out;case D.Back.Out:return D.Back.In;case D.Back.InOut:return D.Back.InOut;case D.Bounce.In:return D.Bounce.Out;case D.Bounce.Out:return D.Bounce.In;case D.Bounce.InOut:return D.Bounce.InOut;default:return i}}const $o=4,Jo=.001,Zo=1e-7,Ko=10,_e=11,fs=1/(_e-1),Qo=typeof Float32Array=="function";function Gn(i,t){return 1-3*t+3*i}function Vn(i,t){return 3*t-6*i}function zn(i){return 3*i}function ms(i,t,e){return((Gn(t,e)*i+Vn(t,e))*i+zn(t))*i}function qn(i,t,e){return 3*Gn(t,e)*i*i+2*Vn(t,e)*i+zn(t)}function th(i,t,e,s,n){let r,a,o=0;do a=t+(e-t)/2,r=ms(a,s,n)-i,r>0?e=a:t=a;while(Math.abs(r)>Zo&&++o<Ko);return a}function eh(i,t,e,s){for(let n=0;n<$o;++n){const r=qn(t,e,s);if(r===0)return t;const a=ms(t,e,s)-i;t-=a/r}return t}function sh(i){return i}function ci(i,t,e,s){if(!(0<=i&&i<=1&&0<=e&&e<=1))throw new Error("bezier x values must be in [0, 1] range");if(i===t&&e===s)return sh;const n=Qo?new Float32Array(_e):new Array(_e);for(let a=0;a<_e;++a)n[a]=ms(a*fs,i,e);function r(a){let o=0,h=1;const c=_e-1;for(;h!==c&&n[h]<=a;++h)o+=fs;--h;const l=(a-n[h])/(n[h+1]-n[h]),d=o+l*fs,g=qn(d,i,e);return g>=Jo?eh(a,d,i,e):g===0?d:th(a,o,o+fs,i,e)}return a=>a===0||a===1?a:ms(r(a),t,s)}function li(i){switch(i){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]}}function Hn(i){const[t,e,s,n]=li(i);return[1-s,1-n,1-t,1-e]}function ih(i){return ci(...li(i))}function nh(i){return ci(...Hn(i))}const Bt={Utils:{Linear:function(i,t,e){return(t-i)*e+i},Factorial:function(){const i=[1];return function(t){let e=1;if(i[t])return i[t];for(let s=t;s>1;s--)e*=s;return i[t]=e,e}}(),Bernstein:function(i,t){const e=Bt.Utils.Factorial;return e(i)/e(t)/e(i-t)},CatmullRom:function(i,t,e,s,n){const r=(e-i)*.5,a=(s-t)*.5,o=n*n,h=n*o;return(2*t-2*e+r+a)*h+(-3*t+3*e-2*r-a)*o+r*n+t},QuadraticBezier:(i,t,e,s)=>{const n=1-s;return n*n*i+2*n*s*t+s*s*e},CubicBezier:(i,t,e,s,n)=>{const r=1-n;return r*r*r*i+3*r*r*n*t+3*r*n*n*e+n*n*n*s}},Linear:function(i,t){const e=i.length-1,s=e*t,n=Math.floor(s),r=Bt.Utils.Linear;return t<0?r(i[0],i[1],s):t>1?r(i[e],i[e-1],e-s):r(i[n],i[n+1>e?e:n+1],s-n)},Bezier:function(i,t){let e=0;const s=i.length-1,n=Math.pow,r=Bt.Utils.Bernstein;for(let a=0;a<=s;a++)e+=n(1-t,s-a)*n(t,a)*i[a]*r(s,a);return e},CatmullRom:function(i,t){const e=i.length-1;let s=e*t,n=Math.floor(s);const r=Bt.Utils.CatmullRom;return i[0]===i[e]?(t<0&&(n=Math.floor(s=e*(1+t))),r(i[(n-1+e)%e],i[n],i[(n+1)%e],i[(n+2)%e],s-n)):t<0?i[0]-(r(i[0],i[0],i[1],i[1],-s)-i[0]):t>1?i[e]-(r(i[e],i[e],i[e-1],i[e-1],s-e)-i[e]):r(i[n?n-1:0],i[n],i[e<n+1?e:n+1],i[e<n+2?e:n+2],s-n)}};class jn{_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=j(),e=!1){const s=Object.keys(this._tweens);for(let n=0;n<s.length;n++){const r=this._tweens[s[n]],a=!e;r&&r.update(t,a)===!1&&!e&&delete this._tweens[s[n]]}return!!Object.keys(this._tweens).length}}const wt=new jn;class ui{constructor(t,e=wt){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=D.Linear.None;_interpolationFunction=Bt.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=j()){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,s,n){for(const r in s){const a=t[r],o=Array.isArray(a),h=o?"array":typeof a,c=!o&&Array.isArray(s[r]);if(!(h==="undefined"||h==="function")){if(c){let l=s[r];if(l.length===0)continue;l=l.map(this._handleRelativeValue.bind(this,a)),s[r]=[a].concat(l)}if((h==="object"||o)&&a&&!c){e[r]=o?[]:{};for(const l in a)e[r][l]=a[l];n[r]=o?[]:{},this._setupProperties(a,e[r],s[r],n[r])}else typeof e[r]>"u"&&(e[r]=a),o||(e[r]*=1),c?n[r]=s[r].slice().reverse():n[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=j()){return this._isPaused||!this._isPlaying?this:(this._isPaused=!0,this._pauseStartTime=t,this._group&&this._group.remove(this),this)}resume(t=j()){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=wt){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=D.Linear.None){return this._easingFunction=t,this}interpolation(t=Bt.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=j(),e=!0){if(this._isPaused)return!0;let s,n;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),n=(t-this._startTime)/this._durationTime,n=this._durationTime===0||n>1?1:n;const a=this._easingFunction(n);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,a),this._onUpdateCallback&&this._onUpdateCallback(this._object,n),n===1)if(this._repeat>0){isFinite(this._repeat)&&this._repeat--;for(s in this._valuesStartRepeat)!this._yoyo&&typeof this._valuesEnd[s]=="string"&&(this._valuesStartRepeat[s]=this._valuesStartRepeat[s]+parseFloat(this._valuesEnd[s])),this._yoyo&&this._swapEndStartRepeatValues(s),this._valuesStart[s]=this._valuesStartRepeat[s];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,h=this._chainedTweens.length;o<h;o++)this._chainedTweens[o].start(this._startTime+this._durationTime);return this._isPlaying=!1,!1}return!0}_updateProperties(t,e,s,n){for(const r in s){if(e[r]===void 0)continue;const a=e[r]||0;let o=s[r];const h=Array.isArray(t[r]),c=Array.isArray(o);!h&&c?t[r]=this._interpolationFunction(o,n):typeof o=="object"&&o?this._updateProperties(t[r],a,o,n):(o=this._handleRelativeValue(a,o),typeof o=="number"&&(t[r]=a+(o-a)*n))}}_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],s=this._valuesEnd[t];typeof s=="string"?this._valuesStartRepeat[t]=this._valuesStartRepeat[t]+parseFloat(s):this._valuesStartRepeat[t]=s,this._valuesEnd[t]=e}}const rh=ke.nextId,ah=wt.getAll.bind(wt),oh=wt.removeAll.bind(wt),hh=wt.add.bind(wt),ch=wt.remove.bind(wt),lh=wt.update.bind(wt),uh={now:j,Sequence:ke,Easing:D,Interpolation:Bt,Group:jn,Tween:ui,nextId:rh,getAll:ah,removeAll:oh,add:hh,remove:ch,update:lh};class di{autoStart;startTime;oldTime;elapsedTime;running;constructor(t=!0){this.autoStart=t,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=j(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0}stop(){this.getElapsedTime(),this.running=!1,this.autoStart=!1}getElapsedTime(){return this.getDelta(),this.elapsedTime}getDelta(){let t=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){const e=j();t=e-this.oldTime,this.oldTime=e,this.elapsedTime+=t}return t}}class ps{tweens=[];frameDuration;onGroupStart;onGroupComplete;constructor(t){this.frameDuration=t?.frameDuration||1e3,this.onGroupStart=t?.onGroupStart,this.onGroupComplete=t?.onGroupComplete}get count(){return this.tweens.length}clear(){this.tweens=[]}sort(t=!1){to(this.tweens,(e,s)=>t?e.delay>s.delay:e.delay<=s.delay)}cloneTweens(t=this.tweens){const e=[];return t.forEach(s=>{const n={...s};delete n.tween,n.fromValues={...n.fromValues},n.toValues={...n.toValues},e.push(n)}),e}addTween(t,e,s){const n={fromValues:t,toValues:e,frames:typeof s?.frames=="number"?s.frames:1,delay:typeof s?.delay=="number"?s.delay:this.tweens.length,easeFunction:s?.easeFunction||D.Linear.None,interpolationFunction:s?.interpolationFunction||Bt.Linear,repeat:typeof s?.repeat=="number"?s.repeat:0,yoyo:s?.yoyo||!1,onStart:s?.onStart||(()=>{}),onUpdate:s?.onUpdate||(()=>{}),onComplete:s?.onComplete||(()=>{})};return this.tweens.push(n),this}cancelRequestAnimationCycle=()=>{};runTweens(t){this.cancelRequestAnimationCycle();const e=new di,s=this.frameDuration;return new Promise(n=>{this.onGroupStart?.(),this.cancelRequestAnimationCycle=ii(r=>{if(!this.isPaused){const o=Math.max(0,r-this.pausedDuration),h=Math.max(0,e.getElapsedTime()-this.pausedDuration);t.filter(c=>c.delay*s<=h).forEach(c=>{c.tween||(c.tween=new ui({...c.fromValues}).to({...c.toValues},c.frames*s).easing(c.easeFunction).interpolation(c.interpolationFunction).repeat(c.repeat).yoyo(c.yoyo).onStart(c.onStart).onUpdate(c.onUpdate).onComplete(c.onComplete),c.tween.start(o)),(c.delay+c.frames*(c.repeat+1))*s>h?c.tween.update(o):(c.tween.isPlaying()&&c.tween.end(),Ee(t,c))})}const a=!!t.length;return a||(this.onGroupComplete?.(),n()),a})})}isPaused=!1;pausedClock=new di;pausedDuration=0;play(t=this.cloneTweens(this.tweens)){this.isPaused=!1,this.pausedDuration=0,this.runTweens(t)}reverse(){const t=this.cloneTweens(this.tweens);let e=0;t.forEach(s=>{e=Math.max(e,s.delay+s.frames),s.easeFunction=Un(s.easeFunction);const n={...s.toValues};s.toValues={...s.fromValues},s.fromValues={...n}}),t.forEach(s=>{s.delay=e-s.frames}),this.play(t)}pause(){this.pausedClock.start(),this.isPaused=!0}resume(){this.pausedDuration+=this.pausedClock.getElapsedTime(),this.pausedClock.stop(),this.isPaused=!1}}class U extends Hs{id;originD;originMatrix;independentTransformInGroup;forceCXY=!1;cX;cY;x;y;degree;scalarX;scalarY;diffXInGroup;diffYInGroup;diffDegreeInGroup;diffScalarXInGroup;diffScalarYInGroup;vx;vy;ax;ay;mass;attrs;enableDrag;alongPath;isDragging=!1;isMouseIn=!1;targetToAfterDragFree;followMouse;strokeArmyAnts;strokeArmyAntsOffset=0;strokeDashTotalLength=0;isShow=!0;el;pathd;usePathDtoCanvasContext=!1;parent;shapes=[];constructor(t){if(super(),this.id=Gs(),t?.d&&(this.originD=t?.d),t?.originMatrix&&(this.originMatrix=t.originMatrix),this.independentTransformInGroup=typeof t?.independentTransformInGroup=="boolean"?t.independentTransformInGroup:!1,this.x=t?.x||0,this.y=t?.y||0,this.cX=0,this.cY=0,typeof t?.centerX=="number"&&typeof t?.centerY=="number"&&this.forceSetCXY(t.centerX-this.x,t.centerY-this.y),this.degree=t?.degree||0,this.scalarX=1,this.scalarY=1,t?.scalar!==void 0&&(this.scalarX=t.scalar,this.scalarY=t.scalar),t?.scalarX!==void 0&&(this.scalarX=t.scalarX),t?.scalarY!==void 0&&(this.scalarY=t.scalarY),this.diffXInGroup=t?.diffXInGroup||0,this.diffYInGroup=t?.diffYInGroup||0,this.diffDegreeInGroup=t?.diffDegreeInGroup||0,this.diffScalarXInGroup=t?.diffScalarXInGroup||1,this.diffScalarYInGroup=t?.diffScalarYInGroup||1,this.vx=t?.vx||0,this.vy=t?.vy||0,this.ax=t?.ax||0,this.ay=t?.ay||0,this.mass=t?.mass||1,this.attrs={stroke:"none",fill:"none"},t?.attrs&&this.setAttr(t?.attrs),this.enableDrag=t?.enableDrag||!1,this.alongPath=t?.alongPath,this.targetToAfterDragFree=t?.targetToAfterDragFree,this.followMouse=t?.followMouse||!1,this.isShow=typeof t?.isShow=="boolean"?t?.isShow:!0,this.strokeArmyAnts=t?.strokeArmyAnts||!1,this.strokeArmyAnts){const s=this.getAttr("stroke-dasharray","4 4");this.setAttr("stroke-dasharray",s),this.strokeDashTotalLength=wn(s).reduce((n,r)=>n+r,0)}return qa(this)}forceSetCXY(t,e){this.cX=t,this.cY=e,this.forceCXY=!0}shapeInit(){}initPathD(){if(!this.pathd){if(this.pathd=new pt,zs(()=>{this.pathd?.reset(this.originD||this.toSVGPathData(),this.originMatrix)}),this.pathd&&!this.forceCXY){const t=this.shapes.length==0?this.pathd.getBoundingClientRect():this.getBoundingClientRect();t&&(this.pathd.cX=this.cX=t.x+t.width/2-this.pathd.x,this.pathd.cY=this.cY=t.y+t.height/2-this.pathd.y)}this.shapeInit()}return this.pathd}frameStart(t){}frameUpdate(t,e){this.pathd=this.initPathD(),this.pathd.update(this),this.strokeArmyAnts&&(this.isMouseIn||(this.setAttr("stroke-dashoffset",String(this.strokeArmyAntsOffset++)),this.strokeArmyAntsOffset>this.strokeDashTotalLength&&(this.strokeArmyAntsOffset=0)))}frameEnd(t){}toSVGPathData(){return[]}toSVGPathD(){return this.pathd?.toSVGPathD()||""}toCanvasContext(t){this.usePathDtoCanvasContext=!0,this.pathd?.toCanvasContext(t)}getBoundingClientRect(){return this.pathd?.getBoundingClientRect()||null}get center(){const t=this.getBoundingClientRect(),e={x:this.x,y:this.y};return t&&(e.x=t.x+t.width/2,e.y=t.y+t.height/2),e}trim(){if(this.parent)return;const t=this.getBoundingClientRect();if(!t)return;this.shapes.forEach(s=>{const n=s.originMatrix?s.originMatrix.clone():new at;n.translate(-t.x+s.x,-t.y+s.y),s.originMatrix=n});const e=this.originMatrix?this.originMatrix.clone():new at;e.translate(-t.x+this.x,-t.y+this.y),this.originMatrix=e}isPointInPath(t,e,s){if(s instanceof ls)return s.isPointInPath(new Path2D(this.toSVGPathD()),t,e);let n;try{n=new SVGPoint(t,e)}catch{n=s.createSVGPoint(),n.x=t,n.y=e}if(this.el instanceof SVGGeometryElement)return this.el.isPointInFill(n);{const r=this.getBoundingClientRect();if(r)return t>=r.x&&t<=r.x+r.width&&e>=r.y&&e<=r.y+r.height}return!1}isPointInStroke(t,e,s){if(s instanceof ls)return s.isPointInStroke(new Path2D(this.toSVGPathD()),t,e);let n;try{n=new SVGPoint(t,e)}catch{n=s.createSVGPoint(),n.x=t,n.y=e}return this.el instanceof SVGGeometryElement?this.el.isPointInStroke(n):!1}clone(){return $a(this).copy(this)}copy(t){return this.id=t.id,this.originD=t.originD,this.originMatrix=t.originMatrix,this.independentTransformInGroup=t.independentTransformInGroup,this.x=t.x,this.y=t.y,this.cX=t.cX,this.cY=t.cY,this.degree=t.degree,this.scalarX=t.scalarX,this.scalarY=t.scalarY,this.diffXInGroup=t.diffXInGroup,this.diffYInGroup=t.diffYInGroup,this.diffDegreeInGroup=t.diffDegreeInGroup,this.diffScalarXInGroup=t.diffScalarXInGroup,this.diffScalarYInGroup=t.diffScalarYInGroup,this.vx=t.vx,this.vy=t.vy,this.ax=t.ax,this.ay=t.ay,this.mass=t.mass,this.attrs={...t.attrs},this.enableDrag=t.enableDrag,this.alongPath=t.alongPath,this.targetToAfterDragFree=t.targetToAfterDragFree,this.followMouse=t.followMouse,this.isShow=t.isShow,this.strokeArmyAnts=t.strokeArmyAnts,this.strokeDashTotalLength=t.strokeDashTotalLength,this}save(){}restore(){}setAttr(t,e){typeof t!="string"?Object.assign(this.attrs,Object.fromEntries(Object.entries(t).map(([s,n])=>[ct(s),n]))):e&&(this.attrs[ct(t)]=e)}getAttr(t,e){return this.attrs[t]||this.attrs[ct(t)]||e}getAttrs(){return this.attrs}hasAttr(t){return!!this.attrs[t]||!!this.attrs[ct(t)]}distance(t){return as(this.x,this.y,t.x,t.y)}rotateTo(t){this.degree=tt($t(this.x,this.y,t.x,t.y))}followTo(t,e=3){this.rotateTo(t);const{dx:s,dy:n}=At(O(this.degree),e);this.vx=s,this.vy=n,this.run()}followAccelerationTo(t,e=.05){this.rotateTo(t);const{dx:s,dy:n}=At(O(this.degree),e);this.ax=s,this.ay=n,this.run()}checkCollision(t){}checkWall(t){}gravitateTo(t){const e=t.x-this.x,s=t.y-this.y,n=e*e+s*s,r=Math.sqrt(n),a=this.mass*t.mass/n,o=a*e/r,h=a*s/r;this.vx+=o/this.mass,this.vy+=h/this.mass,t.vx-=o/t.mass,t.vy-=h/t.mass}run(t){this.vx+=this.ax,this.vy+=this.ay;const e=jt(t?.gravity,0);this.vy+=e;const s=jt(t?.friction,1);this.vx*=s,this.vy*=s,this.x+=this.vx,this.y+=this.vy}runEaseTo(t,e){const s=jt(e?.easing,.05),n=t.x-this.cX-this.x,r=t.y-this.cY-this.y;this.vx=n*s,this.vy=r*s,this.run(e)}runSpringTo(t,e){const s=jt(e?.spring,.03);(Array.isArray(t)?t:[t]).forEach(n=>{const r=n.x-this.cX-this.x,a=n.y-this.cY-this.y,o=r*s,h=a*s;this.vx+=o,this.vy+=h}),this.run({friction:.9,...e})}springMassTo(t,e){const s=jt(e?.springLength,100),n=jt(e?.spring,1e-4),r=t.x-this.x,a=t.y-this.y,o=Math.sqrt(r*r+a*a);if(o<s){const h=r*n,c=a*n;return this.vx+=h/this.mass,this.vy+=c/this.mass,t.vx-=h/t.mass,t.vy-=c/t.mass,1-o/s}return 0}getTotalLength(){return this.initPathD().getTotalLength()}interpolate(t){return this.initPathD().interpolate(t)}getPointAtLength(t){return this.initPathD().getPointAtLength(t)}trailPath(t,e=0){const s=this.getTotalLength();return t.originD=this.initPathD().getSubpath(0,e*s),this.getPointAtLength(e*s)}strokeDashTween(t=1e3,e){const s=this.initPathD(),n=Et(s.getTotalLength(),0);this.setAttr({strokeDasharray:`${n} ${n}`,strokeDashoffset:`${n}`});const r=e?.onUpdate,a=new ps({frameDuration:t});a.addTween({offset:n},{offset:0},Object.assign(e||{},{onUpdate:(o,h)=>{this.setAttr("strokeDashoffset",""+Et(o.offset,2)),r?.(o,h)}})),a.play()}}class Le extends U{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}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()}setVanishingPoint(t,e){this.vpX=t,this.vpY=e}setCenter(t,e,s){this.cX=t,this.cY=e,this.cZ=s}rotateX(t){({x:this.y,y:this.z}=Tt(O(t),this.y,this.z))}rotateY(t){({x:this.x,y:this.z}=Tt(O(t),this.x,this.z))}rotateZ(t){({x:this.x,y:this.y}=Tt(O(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}eq(t){return this.x===t.x&&this.y===t.y&&this.z===t.z&&this.radius===t.radius&&this.mass===t.mass}length(){return rs(this.x,this.y,this.z)}distance(t){const e=t.x-this.x,s=t.y-this.y,n=t.z-this.z;return Math.sqrt(e*e+s*s+n*n)}scalar(t){return this.x*=t,this.y*=t,this.z*=t,this}normalize(t=1){const e=this.length();if(e){const s=t/e;this.scalar(s)}return this}clamp(t){const e=this.length();return e&&e>t&&this.scalar(t/e),this}cross(t){const e=this.x,s=this.y,n=this.z;return{x:s*t.z-n*t.y,y:n*t.x-e*t.z,z:e*t.y-s*t.x}}multiply(t){return{x:this.x*t.x,y:this.y*t.y,z:this.z*t.z}}div(t){return{x:this.x/t.x,y:this.y/t.y,z:this.z/t.z}}add(t){return{x:this.x+t.x,y:this.y+t.y,z:this.z+t.z}}sub(t){return{x:this.x-t.x,y:this.y-t.y,z:this.z-t.z}}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z}reflect(t){const e=this.dot(t);return{x:this.x-2*e*t.x,y:this.y-2*e*t.y,z:this.z-2*e*t.z}}}const Wn=[1,0,0,1,0,0],$n=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];class at{value;_m13=0;_m23=0;_m33=1;matrix3d;constructor(t=Wn){this.value=Array.from(t),this.m13=0,this.m23=0,this.m33=1,this.matrix3d=this.toMatrix3D()}static fromString(t){const e=new at,s=rn("number",t);return s.length===6&&s.forEach((n,r)=>{n.fullMatch&&(e.value[r]=parseFloat(n.fullMatch))}),e}get m11(){return this.value[0]}get m12(){return this.value[1]}get m13(){return this._m13}get m21(){return this.value[2]}get m22(){return this.value[3]}get m23(){return this._m23}get m31(){return this.value[4]}get m32(){return this.value[5]}get m33(){return this._m33}set m11(t){this.value[0]=t}set m12(t){this.value[1]=t}set m13(t){this._m13=t}set m21(t){this.value[2]=t}set m22(t){this.value[3]=t}set m23(t){this._m23=t}set m31(t){this.value[4]=t}set m32(t){this.value[5]=t}set m33(t){this._m33=t}toMatrix3D(t=this.matrix3d){const e=[this.m11,this.m12,0,this.m13,this.m21,this.m22,0,this.m23,0,0,1,0,this.m31,this.m32,0,this.m33];return t?(t.value=e,t):new ut(e)}identity(){return this.value=Array.from(Wn),this.m13=0,this.m23=0,this.m33=1,this.matrix3d=this.toMatrix3D(),this}get isIdentity(){return this.m11==1&&this.m12==0&&this.m13==0&&this.m21==0&&this.m22==1&&this.m23==0&&this.m31==0&&this.m32==0&&this.m33==1}scalar(t){return this.m11*=t,this.m12*=t,this.m13*=t,this.m21*=t,this.m22*=t,this.m23*=t,this.m31*=t,this.m32*=t,this.m33*=t,this}normalize(){const t=this.m33||1e-4;return this.scalar(1/t)}transformPoint(t){const e=t.z||1;return{x:t.x*this.m11+t.y*this.m21+e*this.m31,y:t.x*this.m12+t.y*this.m22+e*this.m32,z:t.x*this.m13+t.y*this.m23+e*this.m33}}clone(){return new at([...this.value])}multiply(t){const e=this.clone(),s=t instanceof at?t:new at(t);return this.m11=s.m11*e.m11+s.m12*e.m21+s.m13*e.m31,this.m12=s.m11*e.m12+s.m12*e.m22+s.m13*e.m32,this.m13=s.m11*e.m13+s.m12*e.m23+s.m13*e.m33,this.m21=s.m21*e.m11+s.m22*e.m21+s.m23*e.m31,this.m22=s.m21*e.m12+s.m22*e.m22+s.m23*e.m32,this.m23=s.m21*e.m13+s.m22*e.m23+s.m23*e.m33,this.m31=s.m31*e.m11+s.m32*e.m21+s.m33*e.m31,this.m32=s.m31*e.m12+s.m32*e.m22+s.m33*e.m32,this.m33=s.m31*e.m13+s.m32*e.m23+s.m33*e.m33,this}append(t){return this.multiply(t)}prepend(t){return t.multiply(this),this}inverse(){const t=this.m11,e=this.m12,s=this.m13,n=this.m21,r=this.m22,a=this.m23,o=this.m31,h=this.m32,c=this.m33,l=c*r-a*h,d=-c*n+a*o,g=h*n-r*o;let y=t*l+e*d+s*g;return y?(y=1/y,this.m11=l*y,this.m12=(-c*e+s*h)*y,this.m13=(a*e-s*r)*y,this.m21=d*y,this.m22=(c*t-s*o)*y,this.m23=(-a*t+s*n)*y,this.m31=g*y,this.m32=(-h*t+e*o)*y,this.m33=(r*t-e*n)*y,this):null}adjugate(){const t=new at;return t.m11=this.m22*this.m33-this.m32*this.m23,t.m12=this.m32*this.m13-this.m12*this.m33,t.m13=this.m12*this.m23-this.m22*this.m13,t.m21=this.m31*this.m23-this.m21*this.m33,t.m22=this.m11*this.m33-this.m31*this.m13,t.m23=this.m21*this.m13-this.m11*this.m23,t.m31=this.m21*this.m32-this.m31*this.m22,t.m32=this.m31*this.m12-this.m11*this.m32,t.m33=this.m11*this.m22-this.m21*this.m12,t}split(){let t=tt(Math.atan2(this.m12,this.m11));return this.m11<0&&this.m22>=0&&(t+=180),{x:this.m31,y:this.m32,degree:t,scaleX:Math.sqrt(this.m11*this.m11+this.m12*this.m12),scaleY:Math.sqrt(this.m21*this.m21+this.m22*this.m22),skewX:tt(Math.atan2(-this.m21,this.m22)),skewY:tt(Math.atan2(this.m12,this.m11))}}getGroupCoords(t){const e=this.value[0],s=this.value[1],n=this.value[2],r=this.value[3],a=this.value[4],o=this.value[5],h=t.value[0],c=t.value[1],l=t.value[2],d=t.value[3],g=t.value[4],y=t.value[5],p=h*d,x=c*l,b=(l*s-e*d)/(x-p),S=(h*s-e*c)/(p-x),C=(l*r-n*d)/(x-p),L=(h*r-n*c)/(p-x),R=(l*(o-y)+d*(g-a))/(x-p),Y=(h*(o-y)+c*(g-a))/(p-x),X=[b,S,C,L,R,Y];return new at(X)}toString(t=6){return this.matrix3d.is2D()?`matrix(${this.value.map(e=>Et(e,t)).join(",")})`:this.matrix3d.toString()}translate(t,e){return this.multiply([1,0,0,1,t,e]),this.toMatrix3D(),this}translateTo(t,e){return this.translate(t-this.m31,e-this.m32)}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.matrix3d.translate(0,0,t),this.matrix3d.toMatrix(this),this}translateZTo(t){return this.translateZ(t-this.matrix3d.m43),this}translate3d(t,e,s){return this.matrix3d.translate(t,e,s),this.matrix3d.toMatrix(this),this}translate3dTo(t,e,s){return this.translate3d(t-this.matrix3d.m41,e-this.matrix3d.m42,s-this.matrix3d.m43),this}rotate(t,e=0,s=0){const n=O(t),r=Math.cos(n),a=Math.sin(n);return this.translate(e,s),this.multiply([r,a,-a,r,0,0]),this.translate(-e,-s),this.toMatrix3D(),this}rotateTo(t,e=0,s=0){const{degree:n}=this.split();return this.rotate(t-n,e,s),this}rotateX(t){return this.matrix3d.rotateX(t),this.matrix3d.toMatrix(this),this}rotateXTo(t){const{degreeX:e}=this.matrix3d.split();return this.rotateX(t-e),this}rotateY(t){return this.matrix3d.rotateY(t),this.matrix3d.toMatrix(this),this}rotateYTo(t){const{degreeY:e}=this.matrix3d.split();return this.rotateY(t-e),this}rotateZ(t){return this.matrix3d.rotateZ(t),this.matrix3d.toMatrix(this),this}rotateZTo(t){const{degreeZ:e}=this.matrix3d.split();return this.rotateZ(t-e),this}rotate3d(t,e,s){return this.matrix3d.rotateX(t).rotateY(e).rotateZ(s),this.matrix3d.toMatrix(this),this}rotate3dTo(t,e,s){const{degreeX:n,degreeY:r,degreeZ:a}=this.matrix3d.split();return this.rotate3d(t-n,e-r,s-a),this}scale(t,e=t,s=0,n=0){return this.translate(s,n),this.multiply([t,0,0,e,0,0]),this.translate(-s,-n),this.toMatrix3D(),this}scaleTo(t,e=t,s=0,n=0){return this.scale(t/this.m11,e/this.m22,s,n)}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.matrix3d.scale(1,1,t),this.matrix3d.toMatrix(this),this}scaleZTo(t){const{scalarZ:e}=this.matrix3d.split();return this.scaleZ(t/e),this}scale3d(t,e=t,s=t){return this.matrix3d.scale(t,e,s),this.matrix3d.toMatrix(this),this}scale3dTo(t,e=t,s=t){const{scalarX:n,scalarY:r,scalarZ:a}=this.matrix3d.split();return this.scale3d(t/n,e/r,s/a),this}skew(t,e=t){return this.multiply([Math.cos(O(e)),Math.sin(O(e)),-Math.sin(O(t)),Math.cos(O(t)),0,0]),this.toMatrix3D(),this}skewTo(t,e=t){const{skewX:s,skewY:n}=this.split();return this.skew(t-s,e-n)}skewX(t){const{skewY:e}=this.split();return this.skew(t,e)}skewXTo(t){const{skewY:e}=this.split();return this.skewTo(t,e)}skewY(t){const{skewX:e}=this.split();return this.skew(e,t)}skewYTo(t){const{skewX:e}=this.split();return this.skewTo(e,t)}skewZ(t){return this}skewZTo(t){return this}skew3d(t,e,s){return this}skew3dTo(t,e,s){return this}perspective(t){return this.matrix3d.perspective(t),this.matrix3d.toMatrix(this),this}}class ut{value;is3dSpecial=!1;constructor(t=$n){this.value=Array.from(t)}static fromString(t){const e=new ut,s=rn("number",t);return s.length===16&&s.forEach((n,r)=>{n.fullMatch&&(e.value[r]=parseFloat(n.fullMatch))}),e}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]}set m11(t){this.value[0]=t}set m12(t){this.value[1]=t}set m13(t){this.value[2]=t}set m14(t){this.value[3]=t}set m21(t){this.value[4]=t}set m22(t){this.value[5]=t}set m23(t){this.value[6]=t}set m24(t){this.value[7]=t}set m31(t){this.value[8]=t}set m32(t){this.value[9]=t}set m33(t){this.value[10]=t}set m34(t){this.value[11]=t}set m41(t){this.value[12]=t}set m42(t){this.value[13]=t}set m43(t){this.value[14]=t}set m44(t){this.value[15]=t}is2D(){return!this.is3dSpecial&&this.m31==0&&this.m32==0&&this.m33==1&&this.m34==0&&this.m43==0&&this.m44==1}is3D(){return!this.is2D()}identity(){return this.value=Array.from($n),this}get isIdentity(){return this.m11==1&&this.m12==0&&this.m13==0&&this.m14==0&&this.m21==0&&this.m22==1&&this.m23==0&&this.m24==0&&this.m31==0&&this.m32==0&&this.m33==1&&this.m34==0&&this.m41==0&&this.m42==0&&this.m43==0&&this.m44==1}clone(){return new ut([...this.value])}scalar(t){return this.m11*=t,this.m12*=t,this.m13*=t,this.m14*=t,this.m21*=t,this.m22*=t,this.m23*=t,this.m24*=t,this.m31*=t,this.m32*=t,this.m33*=t,this.m34*=t,this.m41*=t,this.m42*=t,this.m43*=t,this.m44*=t,this}normalize(){return this.scalar(1/(this.m44||1e-4))}transformPoint(t){const e=t.z||1,s=t.w||1;return{x:t.x*this.m11+t.y*this.m21+e*this.m31+s*this.m41,y:t.x*this.m12+t.y*this.m22+e*this.m32+s*this.m42,z:t.x*this.m13+t.y*this.m23+e*this.m33+s*this.m43,w:t.x*this.m14+t.y*this.m24+e*this.m34+s*this.m44}}toMatrix(t){const{scalarX:e,scalarY:s,skewX:n,skewY:r,x:a,y:o}=this.split(),h=[e,r,n,s,a,o];return t?(t.value=h,t):new at(h)}flatten(){return this.m31=0,this.m32=0,this.m33=1,this.m34=0,this.m14=0,this.m24=0,this.m43=0,this.m44=1,this}toString(t=6){return`matrix3d(${this.value.map(e=>Et(e,t)).join(",")})`}split(){const t=Math.sqrt(this.m11*this.m11+this.m12*this.m12+this.m13*this.m13),e=Math.sqrt(this.m21*this.m21+this.m22*this.m22+this.m23*this.m23),s=Math.sqrt(this.m31*this.m31+this.m32*this.m32+this.m33*this.m33),n=tt(yt(Math.asin(-this.m13),-1,1));let r=tt(Math.atan2(this.m23,this.m33));Math.cos(O(n))===0&&(r=tt(Math.atan2(-this.m31,this.m22)));let a=tt(Math.atan2(this.m12,this.m11));return this.m11<0&&this.m22>=0&&(a+=180),{x:this.m41,y:this.m42,z:this.m43,scalarX:t,scalarY:e,scalarZ:s,degreeX:r,degreeY:n,degreeZ:a,skewX:tt(this.m14),skewY:tt(this.m24),skewZ:tt(this.m34),skewW:this.m44,perspective:this.m34?-(1/this.m34):0}}inverse(){const t=[],e=this.m11,s=this.m12,n=this.m13,r=this.m14,a=this.m21,o=this.m22,h=this.m23,c=this.m24,l=this.m31,d=this.m32,g=this.m33,y=this.m34,p=this.m41,x=this.m42,b=this.m43,S=this.m44;t[0]=h*y*x-c*g*x+c*d*b-o*y*b-h*d*S+o*g*S,t[1]=r*g*x-n*y*x-r*d*b+s*y*b+n*d*S-s*g*S,t[2]=n*c*x-r*h*x+r*o*b-s*c*b-n*o*S+s*h*S,t[3]=r*h*d-n*c*d-r*o*g+s*c*g+n*o*y-s*h*y;const C=e*t[0]+a*t[1]+l*t[2]+p*t[3];if(C==0)return console.warn("Can't invert matrix, determinant is 0");t[4]=c*g*p-h*y*p-c*l*b+a*y*b+h*l*S-a*g*S,t[5]=n*y*p-r*g*p+r*l*b-e*y*b-n*l*S+e*g*S,t[6]=r*h*p-n*c*p-r*a*b+e*c*b+n*a*S-e*h*S,t[7]=n*c*l-r*h*l+r*a*g-e*c*g-n*a*y+e*h*y,t[8]=o*y*p-c*d*p+c*l*x-a*y*x-o*l*S+a*d*S,t[9]=r*d*p-s*y*p-r*l*x+e*y*x+s*l*S-e*d*S,t[10]=s*c*p-r*o*p+r*a*x-e*c*x-s*a*S+e*o*S,t[11]=r*o*l-s*c*l-r*a*d+e*c*d+s*a*y-e*o*y,t[12]=h*d*p-o*g*p-h*l*x+a*g*x+o*l*b-a*d*b,t[13]=s*g*p-n*d*p+n*l*x-e*g*x-s*l*b+e*d*b,t[14]=n*o*p-s*h*p-n*a*x+e*h*x+s*a*b-e*o*b,t[15]=s*h*l-n*o*l+n*a*d-e*h*d-s*a*g+e*o*g,this.value=t,this.scalar(1/C)}multiply(t){const e=this.clone();return this.m11=t.m11*e.m11+t.m12*e.m21+t.m13*e.m31+t.m14*e.m41,this.m12=t.m11*e.m12+t.m12*e.m22+t.m13*e.m32+t.m14*e.m42,this.m13=t.m11*e.m13+t.m12*e.m23+t.m13*e.m33+t.m14*e.m43,this.m14=t.m11*e.m14+t.m12*e.m24+t.m13*e.m34+t.m14*e.m44,this.m21=t.m21*e.m11+t.m22*e.m21+t.m23*e.m31+t.m24*e.m41,this.m22=t.m21*e.m12+t.m22*e.m22+t.m23*e.m32+t.m24*e.m42,this.m23=t.m21*e.m13+t.m22*e.m23+t.m23*e.m33+t.m24*e.m43,this.m24=t.m21*e.m14+t.m22*e.m24+t.m23*e.m34+t.m24*e.m44,this.m31=t.m31*e.m11+t.m32*e.m21+t.m33*e.m31+t.m34*e.m41,this.m32=t.m31*e.m12+t.m32*e.m22+t.m33*e.m32+t.m34*e.m42,this.m33=t.m31*e.m13+t.m32*e.m23+t.m33*e.m33+t.m34*e.m43,this.m34=t.m31*e.m14+t.m32*e.m24+t.m33*e.m34+t.m34*e.m44,this.m41=t.m41*e.m11+t.m42*e.m21+t.m43*e.m31+t.m44*e.m41,this.m42=t.m41*e.m12+t.m42*e.m22+t.m43*e.m32+t.m44*e.m42,this.m43=t.m41*e.m13+t.m42*e.m23+t.m43*e.m33+t.m44*e.m43,this.m44=t.m41*e.m14+t.m42*e.m24+t.m43*e.m34+t.m44*e.m44,this}translate(t=0,e=0,s=0){return this.multiply(new ut([1,0,0,0,0,1,0,0,0,0,1,0,t,e,s,1]))}scale(t=1,e=1,s=1){return this.multiply(new ut([t,0,0,0,0,e,0,0,0,0,s,0,0,0,0,1]))}rotateX(t){const e=O(t),s=Math.cos(e),n=Math.sin(e);return this.multiply(new ut([1,0,0,0,0,s,n,0,0,-n,s,0,0,0,0,1]))}rotateY(t){const e=O(t),s=Math.cos(e),n=Math.sin(e);return this.multiply(new ut([s,0,-n,0,0,1,0,0,n,0,s,0,0,0,0,1]))}rotateZ(t){this.is3dSpecial=!0;const e=O(t),s=Math.cos(e),n=Math.sin(e);return this.multiply(new ut([s,n,0,0,-n,s,0,0,0,0,1,0,0,0,0,1]))}skew(t=0,e=0,s=0){return this.multiply(new ut([1,0,0,O(t),0,1,0,O(e),0,0,1,O(s),0,0,0,1]))}perspective(t){return this.multiply(new ut([1,0,0,0,0,1,0,0,0,0,1,t?-(1/t):0,0,0,0,1]))}unproject(t){let e=t.x*this.m11+t.y*this.m21+this.m41,s=t.x*this.m12+t.y*this.m22+this.m42,n=t.x*this.m13+t.y*this.m23+this.m43,r=t.x*this.m14+t.y*this.m24+this.m44,a=e+this.m31,o=s+this.m32,h=n+this.m33,c=r+this.m34;r==0&&(r=1e-4),e/=r,s/=r,n/=r,c==0&&(c=1e-4),a/=c,o/=c,h/=c;const l=h-n;if(l==0)return{x:e,y:s,z:n,mass:r};const d=-n/l;return e+=d*(a-e),s+=d*(o-s),{x:e,y:s,z:n,mass:r}}project(t){const e=t.z;let s=t.x*this.m11+t.y*this.m21+e*this.m31+this.m41,n=t.x*this.m12+t.y*this.m22+e*this.m32+this.m42,r=t.x*this.m14+t.y*this.m24+e*this.m34+this.m44;return r==0&&(r=1e-4),s/=r,n/=r,r<0&&(s-=this.m41,n-=this.m42,s*=1/r,n*=1/r,s+=this.m41,n+=this.m42),{x:s,y:n,z:e,mass:r}}bounds(t,e,s,n){const r=new Le({x:t,y:e}),a=new Le({x:t+s,y:e}),o=new Le({x:t+s,y:e+n}),h=new Le({x:t,y:e+n});({x:r.x,y:r.y,z:r.z,mass:r.mass}=this.project(r)),{x:a.x,y:a.y,z:a.z,mass:a.mass}=this.project(a),{x:o.x,y:o.y,z:o.z,mass:o.mass}=this.project(o),{x:h.x,y:h.y,z:h.z,mass:h.mass}=this.project(h);const c=Math.min(r.x,a.x,o.x,h.x),l=Math.min(r.y,a.y,o.y,h.y),d=Math.max(r.x,a.x,o.x,h.x)-c,g=Math.max(r.y,a.y,o.y,h.y)-l;return{x:c,y:l,width:d,height:g}}}function fi(i){const t=new at;return i.replace(/([a-z0-9]+)\s*\(?\s*((-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)*[a-z%]*\s*,?\s*)+)\)?/gi,function(e,s,n){n.indexOf(",")>=0?n=n.split(/\s*,\s*/):n=n.split(/\s+/);const r=[];for(let a=0,o=n.length;a<o;a++)n[a].trim()&&r.push(parseFloat(""+n[a]));switch(s.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 ut(r)),t.matrix3d.toMatrix(t);break}return""}),t}function Tt(i,t,e){const s=new at;return s.rotate(tt(i)),s.transformPoint({x:t,y:e})}function mi(i){const t=typeof i?.x=="number"?i?.x:0,e=typeof i?.y=="number"?i?.y:0,s=typeof i?.degree=="number"?i?.degree:0,n=typeof i?.scalarX=="number"?i?.scalarX:1,r=typeof i?.scalarY=="number"?i?.scalarY:1,a=O(s),o=Math.cos(a),h=Math.sin(a),c=new DOMMatrix([o*n,h*n,-h*r,o*r,t,e]);return c.multiplySelf(new DOMMatrix(i?.originMatrix||"")),c}function dh(i,t){const e=new Path2D(i),s=new Path2D;return s.addPath(e,mi(t)),s}function Jn(i,t){const e={x:t.m11,y:t.m12,z:t.m13},s={x:t.m21,y:t.m22,z:t.m23},n={x:t.m31,y:t.m32,z:t.m33},r=i.transformPoint(e),a=i.transformPoint(s),o=i.transformPoint(n),h=new at;return h.m11=r.x,h.m12=r.y,h.m13=r.z,h.m21=a.x,h.m22=a.y,h.m23=a.z,h.m31=o.x,h.m32=o.y,h.m33=o.z,h}function Zn(i,t){const e={x:t.m11,y:t.m12,z:t.m13,w:t.m14},s={x:t.m21,y:t.m22,z:t.m23,w:t.m24},n={x:t.m31,y:t.m32,z:t.m33,w:t.m34},r={x:t.m41,y:t.m42,z:t.m43,w:t.m44},a=i.transformPoint(e),o=i.transformPoint(s),h=i.transformPoint(n),c=i.transformPoint(r);return new ut([a.x,a.y,a.z,a.w,o.x,o.y,o.z,o.w,h.x,h.y,h.z,h.w,c.x,c.y,c.z,c.w])}function fh(i){let t=i[0];for(let e=1,s=i.length;e<s;e++)t=Jn(t,i[e]);return t}function mh(i){let t=i[0];for(let e=1,s=i.length;e<s;e++)t=Zn(t,i[e]);return t}class I{static createElementNS(t){return document.createElementNS("http://www.w3.org/1999/xhtml",t)}static origins=new Ze;static updates=new Ze;static patchDom=()=>{this.origins.filter((t,e)=>{const s=this.updates.get(t);return s&&ss(e,s),this.updates.delete(t),!1})};static getVNode(t,e){let s=t.getAttribute("id")||"";s||(s=e||Gs(),t.setAttribute("id",s)),this.origins.get(s)||this.origins.set(s,Wt(t.tagName,{},[],t));const n=this.updates.get(s)||Wt(t.tagName,{},[],t);return{vnode:n,immediate:()=>{this.updates.set(s,n),I.patchDom()},schedule:()=>{this.updates.set(s,n),oi("FLUSH_DOM_ACTIONS",I.patchDom,50)}}}static getElement(t){const e=t.style?t.ownerDocument:t.document||t;return{el:t,document:e,window:e.defaultView,isRootNode:/(html|body)/i.test(t.tagName)||t===document}}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 s=I.getStyle(t.parentElement,"position");I.setStyle(t.parentElement,{position:s=="static"?"relative":s,perspective:e})}I.setStyle(t,{"transform-style":"preserve-3d"})}static convertAttrs(t,e,s={}){Object.prototype.hasOwnProperty.call(s,"transform")||Object.assign(s,{transform:I.getStyle(t,"transform")||""});const n=fi(s.transform),r={};for(const a in e){const o=e[a];switch(a){case"transform":break;case"translate":n.translate(o[0]||0,o[1]||0);break;case"translateTo":n.translateTo(o[0]||0,o[1]||0);break;case"translateX":n.translateX(o||0);break;case"translateXTo":n.translateXTo(o||0);break;case"translateY":n.translateY(o||0);break;case"translateYTo":n.translateYTo(o||0);break;case"translateZ":n.translateZ(o||0);break;case"translateZTo":n.translateZTo(o||0);break;case"translate3d":n.translate3d(o[0]||0,o[1]||0,o[2]||0);break;case"translate3dTo":n.translate3dTo(o[0]||0,o[1]||0,o[2]||0);break;case"rotate":typeof o=="number"?n.rotate(o||0):n.rotate(o[0]||0,o[1]||0,o[2]||0);break;case"rotateTo":typeof o=="number"?n.rotateTo(o||0):n.rotateTo(o[0]||0,o[1]||0,o[2]||0);break;case"rotateX":n.rotateX(o||0);break;case"rotateXTo":n.rotateXTo(o||0);break;case"rotateY":n.rotateY(o||0);break;case"rotateYTo":n.rotateYTo(o||0);break;case"rotateZ":n.rotateZ(o||0);break;case"rotateZTo":n.rotateZTo(o||0);break;case"rotate3d":n.rotate3d(o[0]||0,o[1]||0,o[2]||0);break;case"rotate3dTo":n.rotate3dTo(o[0]||0,o[1]||0,o[2]||0);break;case"scale":typeof o=="number"?n.scale(o||1):n.scale(o[0]||1,o[1]||1,o[2]||0,o[3]||0);break;case"scaleTo":typeof o=="number"?n.scaleTo(o||1):n.scaleTo(o[0]||1,o[1]||1,o[2]||0,o[3]||0);break;case"scaleX":n.scaleX(o||1);break;case"scaleXTo":n.scaleXTo(o||1);break;case"scaleY":n.scaleY(o||1);break;case"scaleYTo":n.scaleYTo(o||1);break;case"scaleZ":n.scaleZ(o||1);break;case"scaleZTo":n.scaleZTo(o||1);break;case"scale3d":typeof o=="number"?n.scale3d(o||1):n.scale3d(o[0]||1,o[1]||1,o[2]||1);break;case"scale3dTo":typeof o=="number"?n.scale3dTo(o||1):n.scale3dTo(o[0]||1,o[1]||1,o[2]||1);break;case"skew":typeof o=="number"?n.skew(o||0):n.skew(o[0]||0,o[1]||0);break;case"skewTo":typeof o=="number"?n.skewTo(o||0):n.skewTo(o[0]||0,o[1]||0);break;case"skewX":n.skewX(o||0);break;case"skewXTo":n.skewXTo(o||0);break;case"skewY":n.skewY(o||0);break;case"skewYTo":n.skewYTo(o||0);break;case"skewZ":break;case"skewZTo":break;case"skew3d":break;case"skew3dTo":break;case"perspective":n.perspective(o||0);break;default:Object.prototype.hasOwnProperty.call(s,a)||(s[a]=I.getStyle(t,a)),Object.assign(r,{[a]:`${o}`});break}}return Object.assign(r,{transform:n.toString()}),r}static attrsToCanvas(t,e){for(const s in e){const n=e[s];switch(s){case"fill":n!=="none"&&(t.fillStyle=n);break;case"stroke":n!=="none"&&(t.strokeStyle=n);break;case"stroke-width":case"strokeWidth":t.lineWidth=Number(n);break;case"stroke-linecap":case"strokeLinecap":t.lineCap=n;break;case"stroke-linejoin":case"strokeLinejoin":switch(n){case"round":case"bevel":case"miter":t.lineJoin=n;break;default:t.lineJoin="miter";break}break;case"stroke-miterlimit":case"strokeMiterlimit":t.miterLimit=Number(n);break;case"stroke-opacity":case"strokeOpacity":break;case"stroke-dashoffset":case"strokeDashoffset":t.lineDashOffset=Number(n);break;case"stroke-dasharray":case"strokeDasharray":typeof n=="string"&&t.setLineDash(n.split(/\s+/).map(r=>Number(r)));break;case"cursor":break;case"font":typeof n=="string"&&(t.font=n);break;case"font-size":case"fontSize":t.font+=` ${n}`;break;case"font-family":case"fontFamily":t.font+=` ${n}`;break;case"font-weight":case"fontWeight":break;case"font-style":case"fontStyle":break;case"text-anchor":case"textAnchor":switch(n){case"middle":t.textAlign="center";break;case"end":t.textAlign="end";break;case"start":t.textAlign="start";break}break;case"alignment-baseline":case"alignmentBaseline":switch(n){case"middle":case"bottom":case"top":case"alphabetic":case"hanging":case"ideographic":t.textBaseline=n;break;default:t.textBaseline="alphabetic";break}break}}}static getStyle(t,e,s){const n=t;if(getComputedStyle)if(e){e=ct(e);const r=getComputedStyle(n,s).getPropertyPriority(e);return getComputedStyle(n,s).getPropertyValue(e).trim()+(r?"!"+r:"")}else{const r=[],a=getComputedStyle(n,"");for(let o=0;o<a.length;o++)r.push(a[o]+":"+a.getPropertyValue(a[o]));return r.push(...(n.style.cssText||"").split(";")),Object.fromEntries(r.filter(o=>!!o).map(o=>o.split(":").map(h=>h.trim()))||[])}else if(t.currentStyle){if(e)return e=hn(e),t.currentStyle[e];{const r=[],a=n.currentStyle;for(const o in a)r.push(o+":"+a[o]);return r.push(...(n.style.cssText||"").split(";")),Object.fromEntries(r.filter(o=>!!o).map(o=>o.split(":").map(h=>h.trim()))||[])}}}static setStyle(t,e,s){typeof e=="string"&&s?t.style.setProperty(ct(e),s.replace(/!important/i,""),String(s).toLowerCase().includes("!important")?"important":""):e instanceof Object&&Object.keys(e).forEach(n=>{t.style.setProperty(ct(n),String(e[n]).replace(/!important/i,""),String(e[n]).toLowerCase().includes("!important")?"important":"")})}static setStyleSheet(t,e){let s;if(typeof e=="string"){const r=document.querySelector(e)?.shadowRoot;r?s=r:s=document.querySelector(e)}else s=e;const n=document.createElement("style");if(n.innerHTML=t,s)return s.appendChild(n),()=>{(s instanceof HTMLElement||s instanceof ShadowRoot)&&s.removeChild(n)};{const r=document.styleSheets[0].insertRule(t);return()=>{document.styleSheets[0].deleteRule(r)}}}static toggleClass(t,e,s="toggle"){e.split(/[,\s]+/).forEach(n=>{n.trim()!==""&&t.classList[s](n.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(s=>s.trim()!==""?Array.from(t.classList||[]).includes(s.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){t.style.setProperty("display",t instanceof HTMLTableRowElement?"table-row":t instanceof HTMLTableCellElement?"table-cell":"block")}static hide(t){t.style.setProperty("display","none")}static attribute(t,e,s){let n={};if(e===void 0&&s===void 0){for(let o=0,h=t.attributes,c=h.length;o<c;o++){const l=h[o];l.nodeName&&l.nodeValue&&(n[l.nodeName]=l.nodeValue)}return n}if(typeof e=="string"&&s===void 0)return t.getAttribute(ct(e));typeof e=="object"?n=e:typeof e=="string"&&s!==void 0&&(n[e]=s);const{vnode:r,schedule:a}=this.getVNode(t,n.id);Object.entries(n).forEach(([o,h])=>{r.props[ct(o)]=h}),a()}static removeAttribute(t,e){e.split(/[,\s]+/).forEach(s=>{s.trim()!=""&&t.removeAttribute(s.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,s){if(s===void 0&&typeof e=="string")return t[e];{let n={};typeof e=="object"?n=e:typeof e=="string"&&s!==void 0&&(n[e]=s),Object.entries(n).forEach(([r,a])=>{const o=this.fixProp(r);t[o]=a,o=="innerHTML"&&this.scriptConvert(t)})}}static removeProp(t,e){e.split(/[,\s]+/).forEach(s=>{s.trim()!=""&&delete t[this.fixProp(s.trim())]})}static data(t,e,s){if(typeof e=="string"&&(e=hn(e)),(typeof e=="string"||e===void 0)&&s===void 0){const n=Object.assign({},t.dataset);return Object.keys(n).forEach(r=>{if(n[r]?.startsWith("[")||n[r]?.startsWith("{"))try{n[r]=JSON.parse(n[r]||"")}catch{}}),typeof e=="string"?n[e]:n}else{let n={};typeof e=="object"?n=e:typeof e=="string"&&(n[e]=s),Object.entries(n).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(s=>{s.trim()!=""&&delete t.dataset[s.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,s){let n;const r=["click","dblclick","mousedown","mouseup","mousemove"],a=["keydown","keyup","keypress"];typeof e=="string"?r.includes(e)?n=new MouseEvent(e,s):a.includes(e)?n=new KeyboardEvent(e,s):n=new Event(e,s):n=e,t.dispatchEvent(n)}static scriptConvert(t){const e=s=>{const r=s.ownerDocument.createElement("script");r.text=s.text;const a=s.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(s=>{s.parentNode?.replaceChild(e(s),s)}),t}static insert(t,e,s="append"){return typeof e=="string"?t[s](this.fragment(e)):(e instanceof HTMLElement||e instanceof SVGElement)&&t[s](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 fragment(t){const e=document.createElement("template");return e.innerHTML=t,e.content.childNodes.forEach(s=>{const n=this.scriptConvert(s);n!=s&&e.content.replaceChild(n,s)}),e.content}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 s=t.options;for(let n=0,r=s.length;n<r;n++)s[n].value==e?s[n].selected=!0:s[n].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 s;return t.charAt(0)=="#"?t.charAt(1).toLowerCase()=="x"?s=parseInt(t.substring(2),16):s=parseInt(t.substring(1),10):s=e[t],s?String.fromCharCode(s):"&"+t}static waitForStyleSheetsLoaded=()=>new Promise(t=>{const e=Array.from(document.querySelectorAll("link[rel=stylesheet]"));let s=document.styleSheets.length||0;const n=()=>s>=e.length?(t(),!0):!1;n()||e.forEach(r=>{r.onload=()=>{s+=1,n()}})});static loadScript(t,e=()=>{},s=(n,r,a,o,h)=>{}){const n=document.createElement("script");n.type="text/javascript",n.src=t,n.async=!1,n.onload=e,n.onerror=s,document.body.appendChild(n)}static runInSafe(t){const e=new Proxy(window,{get(s,n,r){if(typeof n=="string"&&["open","location","document"].includes(n))throw new Error(`禁止访问 key: ${n}`);return n==="window"?e:Reflect.get(s,n,r)},set(s,n,r,a){return Reflect.set(s,n,r,a)}});new Function("window",`with(window) { ${t} }`)(e,null)}static dom=new Proxy({},{get(t,e){return function(s={},...n){const r=document.createElement(e);for(const a of Object.keys(s))r.setAttribute(a,s[a]);for(const a of n)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},Ft=(n,t)=>(typeof n=="string"&&(n=Ze(n)||new RegExp(n)),n.test(t)),nn=(n,t)=>{typeof n=="string"&&(n=Ze(n)||new RegExp(n));const e=t.match(n);return e?n.flags.toLowerCase().indexOf("g")>=0?e.map(s=>({matchIndex:-1,fullMatch:s,groupMatchs:[]})):{matchIndex:typeof e.index=="number"?e.index:-1,fullMatch:e[0],groupMatchs:e.slice(1)}:null},rn=(n,t)=>{typeof n=="string"&&(n=Ze(n)||new RegExp(n));const e=[],s=t.matchAll(n);for(const i of s)e.push({matchIndex:typeof i.index=="number"?i.index:-1,fullMatch:i[0],groupMatchs:i.slice(1)});return e};function Aa(n){const t=n.match(/[\s\S]/gu);return t?t.length:0}function an(n,t){const e=n.codePointAt(t);return e?String.fromCodePoint(e):void 0}const st=["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"];function Vs(){const n=Math.random()*4294967295|0,t=Math.random()*4294967295|0,e=Math.random()*4294967295|0,s=Math.random()*4294967295|0;return(st[n&255]+st[n>>8&255]+st[n>>16&255]+st[n>>24&255]+"-"+st[t&255]+st[t>>8&255]+"-"+st[t>>16&15|64]+st[t>>24&255]+"-"+st[e&63|128]+st[e>>8&255]+"-"+st[e>>16&255]+st[e>>24&255]+st[s&255]+st[s>>8&255]+st[s>>16&255]+st[s>>24&255]).toLowerCase()}function Ia(n){const t=fe.get(n);if(t)return t;const e=n.replace(/(^\w)/g,function(s){return s.toLowerCase()});return fe.set(n,e),e}const ft=(n,t="-")=>{const e=fe.get(n);if(e)return e;let s=n.replace(new RegExp(`${t}?([A-Z])`,"g"),t+"$1").toLowerCase();return s=s.replace(new RegExp(`^${t}`),""),fe.set(n,s),s};function zs(n){const t=fe.get(n);if(t)return t;const e=n.replace(/(^\w|[_-]\w)/g,function(s){return s.slice(-1).toUpperCase()});return fe.set(n,e),e}function on(n){return Ia(zs(n))}function hn(n){let t="";for(let e=0,s=n.length;e<s;e++){const i=n.charCodeAt(e);i>=1&&i<=127?t+=n.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 Yt=(n=>(n.UNKNOWN="",n.HTML="text/html",n.XHTML="application/xhtml+xml",n.XML="application/xml",n.XML_TEXT="text/xml",n.TEXT="text/plain",n.MD="text/plain",n.JPEG="image/jpeg",n.PNG="image/png",n.GIF="image/gif",n.WEBP="image/webp",n.SVG="image/svg+xml",n.ICO="image/x-icon",n.MPEG="audio/mpeg",n.MP3="audio/mpeg",n.MP4="video/mp4",n.OGG="audio/ogg",n.WAV="audio/wav",n.WEBM="video/webm",n.CSS="text/css",n.JAVASCRIPT="application/javascript",n.ECMASCRIPT="application/ecmascript",n.JSON="application/json",n.XWWW="application/x-www-form-urlencoded",n.DOC="application/msword",n.CSV="application/x-csv",n.EXCEL="application/vnb.ms-excel",n.PDF="application/pdf",n.ZIP="application/zip",n.TGZ="application/x-gtar",n.TAR_GZ="application/x-gzip",n.EOT="appliaction/vnd.ms-fontobject",n.TTF="aplication/font-sfnt",n))(Yt||{}),cn=(n=>(n.ascii="ascii",n.utf8="utf8",n.utf16le="utf16le",n.ucs2="ucs2",n.base64="base64",n.base64url="base64url",n.latin1="latin1",n.binary="binary",n.hex="hex",n))(cn||{}),qs=(n=>(n.md5="md5",n.sha1="sha1",n.sha256="sha256",n.sha512="sha512",n.aesgcm="AES-GCM",n))(qs||{});const me=(n,t=16)=>{let e=n.toLowerCase();const s=e.indexOf("0b")==0,i=e.indexOf("0o")==0,r=e.indexOf("0x")==0;(s||i||r)&&(e=e.slice(2)),s&&(t=2),i&&(t=8),r&&(t=16);const a=parseInt(e,t);if(isNaN(a))throw new Error(`radixStringToNumber(${n}, ${t}) 无法解析!`);return a};function ka(n){return new TextEncoder().encode(n)}function Ma(n,t=cn.utf8){return new TextDecoder(t).decode(n)}function La(){const n=Uint32Array.of(305419896),t=new Uint8Array(n.buffer);switch(t[0]*16777216+t[1]*65536+t[2]*256+t[3]){case 305419896:return!1;case 2018915346:return!0}}const ln=n=>{let t=Yt.UNKNOWN;switch(new DataView(n).getUint32(0,La()).toString(16).toUpperCase()){case"FFD8FFDB":t=Yt.JPEG;break;case"FFD8FFE0":case"FFD8FFE1":case"FFD8FFE2":case"FFD8FFE3":t=Yt.JPEG;break;case"89504E47":t=Yt.PNG;break;case"47494638":t=Yt.GIF;break;case"52494646":t=Yt.WEBP;break;case"25504446":t=Yt.PDF;break;case"504B0304":t=Yt.ZIP;break}return t};let Se;class Ra{subscribers;constructor(){this.subscribers=new Set}add(){Se&&!this.subscribers.has(Se)&&this.subscribers.add(Se)}notify(){this.subscribers.forEach(t=>t())}}const un=new WeakMap;function dn(n,t){let e=un.get(n);e||(e=new Map,un.set(n,e));let s=e.get(t);return s||(s=new Ra,e.set(t,s)),s}function Hs(n){Se=n,n(),Se=null}const Oa=Symbol("isProxy");function Na(n){return new Proxy(n,{get(t,e,s){return e===Oa?!0:(dn(n,e).add(),Reflect.get(t,e,s))},set(t,e,s,i){const r=dn(n,e);return n[e]!=s&&(n[e]=s,r.notify()),Reflect.set(t,e,s,i)}})}const Fa=Na;function fn(n){return n!=null}function Ya(n,...t){return new n.constructor(...t)}function mn(n,t){for(const e in n)Object.prototype.hasOwnProperty.call(n,e)&&!t(e,n[e])&&delete n[e];return n}function Ba(n,t="",e=["","sign","key"]){return Object.keys(n).filter(s=>{for(let i=0,r=e.length;i<r;i++)if(n[s]==e[i])return!1;return!0}).sort().map(s=>`${s}=${n[s]}`).join("&")+t}function Ce(n,t){const e=n.findIndex(s=>s===t);return e>=0&&n.splice(e,1),n}let pn;try{pn=Map}catch{pn=function(){}}let gn;try{gn=Set}catch{gn=function(){}}function $t(n,t){if(n=parseFloat(n),isNaN(n)){if(typeof t=="number")return t;throw new Error(`parseNumber(${n}) isNaN!`)}return n}function Ke(n,t,e=Number.EPSILON*Math.pow(2,2)){return Math.abs(n-t)<e}const V=(n,t,e)=>n<t?t:n>e?e:n,Xa=(n,t,e)=>s=>{const i=V(s,n,t);return e==0?i:t-i<e?t:Math.round(i/e)*e};function Ga(n,t=12){return $t(n).toFixed(t)}function At(n,t=12){return+Ga(n,t)}function js(n,t){const e=nn("number-single",String(n));return{hasNumber:!!e,number:e&&!Array.isArray(e)&&e.fullMatch?parseFloat(e.fullMatch):fn(t)?t:NaN,prefix:e&&!Array.isArray(e)&&e.fullMatch?n.substring(0,e.matchIndex):"",suffix:e&&!Array.isArray(e)&&e.fullMatch?n.substring(e.matchIndex+e.fullMatch.length):""}}function yn(n){const t=nn("number",n);return t?Array.isArray(t)?t.map(e=>Number(e.fullMatch)):[Number(t.fullMatch)]:[]}Ua();function Ua(){const n=new ArrayBuffer(4),t=new Float32Array(n),e=new Uint32Array(n),s=new Uint32Array(512),i=new Uint32Array(512);for(let h=0;h<256;++h){const c=h-127;c<-27?(s[h]=0,s[h|256]=32768,i[h]=24,i[h|256]=24):c<-14?(s[h]=1024>>-c-14,s[h|256]=1024>>-c-14|32768,i[h]=-c-1,i[h|256]=-c-1):c<=15?(s[h]=c+15<<10,s[h|256]=c+15<<10|32768,i[h]=13,i[h|256]=13):c<128?(s[h]=31744,s[h|256]=64512,i[h]=24,i[h|256]=24):(s[h]=31744,s[h|256]=64512,i[h]=13,i[h|256]=13)}const r=new Uint32Array(2048),a=new Uint32Array(64),o=new Uint32Array(64);for(let h=1;h<1024;++h){let c=h<<13,l=0;for(;!(c&8388608);)c<<=1,l-=8388608;c&=-8388609,l+=947912704,r[h]=c|l}for(let h=1024;h<2048;++h)r[h]=939524096+(h-1024<<13);for(let h=1;h<31;++h)a[h]=h<<23;a[31]=1199570944,a[32]=2147483648;for(let h=33;h<63;++h)a[h]=2147483648+(h-32<<23);a[63]=3347054592;for(let h=1;h<64;++h)h!==32&&(o[h]=1024);return{floatView:t,uint32View:e,baseTable:s,shiftTable:i,mantissaTable:r,exponentTable:a,offsetTable:o}}const Va={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:n=>{const t=["th","st","nd","rd"],e=n%100;return`[${n}${t[(e-20)%10]||t[e]||t[0]}]`}};let Qe="en";const ts={};ts[Qe]=Va;function wn(n,t){if(!n)return Qe;let e;if(typeof n=="string"){const s=n.toLowerCase();ts[s]&&(e=s),t&&(ts[s]=t,e=s);const i=n.split("-");if(!e&&i.length>1)return wn(i[0])}else{const{name:s}=n;ts[s]=n,e=s}return e&&(Qe=e),e||Qe}function $(){return(performance||Date).now()}function za(n,t){let e;return function(...s){clearTimeout(e),e=setTimeout(()=>{n.apply(this,s)},t)}}class Ws{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(s=>s!==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(s=>{Reflect.apply(s,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 xn=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function qa(n,t={}){var e=1,s=1;function i(M){var D=M.match(/\n/g);D&&(e+=D.length);var N=M.lastIndexOf(`
11
+ `);s=~N?M.length-N:s+M.length}function r(){var M={line:e,column:s};return function(D){return D.position=new a(M),m(),D}}function a(M){this.start=M,this.end={line:e,column:s},this.source=t.source}a.prototype.content=n;var o=[];function h(M){var D=new Error(t.source+":"+e+":"+s+": "+M);if(D.reason=M,D.filename=t.source,D.line=e,D.column=s,D.source=n,t.silent)o.push(D);else throw D}function c(){var M=g();return{type:"stylesheet",stylesheet:{source:t.source,rules:M,parsingErrors:o}}}function l(){return y(/^{\s*/)}function d(){return y(/^}/)}function g(){var M,D=[];for(m(),x(D);n.length&&n.charAt(0)!="}"&&(M=le()||be());)M!==!1&&(D.push(M),x(D));return D}function y(M){var D=M.exec(n);if(D){var N=D[0];return i(N),n=n.slice(N.length),D}}function m(){y(/^\s*/)}function x(M){var D;for(M=M||[];D=b();)D!==!1&&M.push(D);return M}function b(){var M=r();if(!(n.charAt(0)!="/"||n.charAt(1)!="*")){for(var D=2;n.charAt(D)!=""&&(n.charAt(D)!="*"||n.charAt(D+1)!="/");)++D;if(D+=2,n.charAt(D-1)==="")return h("End of comment missing");var N=n.slice(2,D-2);return s+=2,i(N),n=n.slice(D),s+=2,M({type:"comment",comment:N})}}function S(){var M=y(/^([^{]+)/);if(M)return Bt(M[0]).replace(/\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*\/+/g,"").replace(/"(?:\\"|[^"])*"|'(?:\\'|[^'])*'/g,function(D){return D.replace(/,/g,"‌")}).split(/\s*(?![^(]*\)),\s*/).map(function(D){return D.replace(/\u200C/g,",")})}function C(){var M=r(),D=y(/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(D){if(D=Bt(D[0]),!y(/^:\s*/))return h("property missing ':'");var N=y(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/),G=M({type:"declaration",property:D.replace(xn,""),value:N?Bt(N[0]).replace(xn,""):""});return y(/^[;\s]*/),G}}function L(){var M=[];if(!l())return h("missing '{'");x(M);for(var D;D=C();)D!==!1&&(M.push(D),x(M));return d()?M:h("missing '}'")}function R(){for(var M,D=[],N=r();M=y(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/);)D.push(M[1]),y(/^,\s*/);if(D.length)return N({type:"keyframe",values:D,declarations:L()})}function X(){var M=r(),D=y(/^@([-\w]+)?keyframes\s*/);if(D){var N=D[1];if(D=y(/^([-\w]+)\s*/),!D)return h("@keyframes missing name");var G=D[1];if(!l())return h("@keyframes missing '{'");for(var ut,_t=x();ut=R();)_t.push(ut),_t=_t.concat(x());return d()?M({type:"keyframes",name:G,vendor:N,keyframes:_t}):h("@keyframes missing '}'")}}function Y(){var M=r(),D=y(/^@supports *([^{]+)/);if(D){var N=Bt(D[1]);if(!l())return h("@supports missing '{'");var G=x().concat(g());return d()?M({type:"supports",supports:N,rules:G}):h("@supports missing '}'")}}function H(){var M=r(),D=y(/^@host\s*/);if(D){if(!l())return h("@host missing '{'");var N=x().concat(g());return d()?M({type:"host",rules:N}):h("@host missing '}'")}}function at(){var M=r(),D=y(/^@media *([^{]+)/);if(D){var N=Bt(D[1]);if(!l())return h("@media missing '{'");var G=x().concat(g());return d()?M({type:"media",media:N,rules:G}):h("@media missing '}'")}}function J(){var M=r(),D=y(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(D)return M({type:"custom-media",name:Bt(D[1]),media:Bt(D[2])})}function Z(){var M=r(),D=y(/^@page */);if(D){var N=S()||[];if(!l())return h("@page missing '{'");for(var G=x(),ut;ut=C();)G.push(ut),G=G.concat(x());return d()?M({type:"page",selectors:N,declarations:G}):h("@page missing '}'")}}function j(){var M=r(),D=y(/^@([-\w]+)?document *([^{]+)/);if(D){var N=Bt(D[1]),G=Bt(D[2]);if(!l())return h("@document missing '{'");var ut=x().concat(g());return d()?M({type:"document",document:G,vendor:N,rules:ut}):h("@document missing '}'")}}function ot(){var M=r(),D=y(/^@font-face\s*/);if(D){if(!l())return h("@font-face missing '{'");for(var N=x(),G;G=C();)N.push(G),N=N.concat(x());return d()?M({type:"font-face",declarations:N}):h("@font-face missing '}'")}}var St=ne("import"),gt=ne("charset"),xe=ne("namespace");function ne(M){var D=new RegExp("^@"+M+"\\s*([^;]+);");return function(){var N=r(),G=y(D);if(G){var ut={type:M};return ut[M]=G[1].trim(),N(ut)}}}function le(){if(n[0]=="@")return X()||at()||J()||Y()||St()||gt()||xe()||j()||Z()||H()||ot()}function be(){var M=r(),D=S();return D?(x(),M({type:"rule",selectors:D,declarations:L()})):h("selector missing")}return $s(c())}function Bt(n){return n?n.replace(/^\s+|\s+$/g,""):""}function $s(n,t){var e=n&&typeof n.type=="string",s=e?n:t;for(var i in n){var r=n[i];Array.isArray(r)?r.forEach(function(a){$s(a,s)}):r&&typeof r=="object"&&$s(r,s)}return e&&Object.defineProperty(n,"parent",{configurable:!0,writable:!0,enumerable:!1,value:t||null}),n}const Ha={name:"zh-cn",weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"周日_周一_周二_周三_周四_周五_周六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),ordinal:(n,t)=>{switch(t){case"W":return`${n}周`;default:return`${n}日`}},weekStart:1,yearStart:4,formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日Ah点mm分",LLLL:"YYYY年M月D日ddddAh点mm分",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},relativeTime:{future:"%s内",past:"%s前",s:"几秒",m:"1 分钟",mm:"%d 分钟",h:"1 小时",hh:"%d 小时",d:"1 天",dd:"%d 天",M:"1 个月",MM:"%d 个月",y:"1 年",yy:"%d 年"},meridiem:(n,t)=>{const e=n*100+t;return e<600?"凌晨":e<900?"早上":e<1100?"上午":e<1300?"中午":e<1800?"下午":"晚上"}};wn(Ha);function ja(n,t=(e,s)=>e<=s){const e=n.length;let s=Math.floor(e/2);for(;s>0;){for(let i=s;i<e;i++){const r=n[i];let a=i;for(;a>=s&&!t(n[a-s],r);)n[a]=n[a-s],a-=s;n[a]=r}s=Math.floor(s/2)}}let bn;try{bn=Promise}catch{bn=function(){}}const Js=(n,t="image/svg+xml",e="utf-8")=>e==="base64"?new Blob([n],{type:`${t};${e}`}):new Blob([n],{type:`${t};charset=${e}`}),Zs=n=>new XMLSerializer().serializeToString(n),Wa=(n,t="text/html")=>new DOMParser().parseFromString(n,t),vn=(n,t="image/svg+xml",e="utf-8")=>Js(Zs(n),t,e),Ks=(n,t)=>new Promise(e=>{const s=document.createElement("a");s.style.visibility="hidden",document.body.appendChild(s),s.download=t,typeof n=="string"?s.href=n:s.href=window.URL.createObjectURL(n),s.click(),document.body.removeChild(s),window.URL.revokeObjectURL(s.href),e()});function Sn(n=["*"],t){return new Promise((e,s)=>{if(!globalThis.document||!(globalThis.document instanceof Document))return s(new Error("This is not a browser environment"));const i=globalThis.document.createElement("input");i.setAttribute("type","file"),i.setAttribute("visibility","hidden"),Array.isArray(n)&&n.length>0&&i.setAttribute("accept",n.join(",")),t&&i.setAttribute("multiple","true"),globalThis.addEventListener("focus",()=>{setTimeout(()=>{(!i.files||i.files?.length===0)&&s(new Error("Cancel select"))},1e3)},{once:!0});const r=()=>{if(i.removeEventListener("change",r),!i.files||i.files?.length===0)s(new Error("Cancel select"));else{const a=Array.from(i.files);!n.includes("*")&&a.some(o=>!n.includes(`.${Cn(o)}`))&&s(new Error(`Please select files in ${n} format`)),i.remove(),e(a)}};i.addEventListener("change",r),i.click()})}function es(n,t="text",e){return new Promise((s,i)=>{const r=new FileReader;switch(r.addEventListener("progress",a=>{e?.(a.loaded,a.total)}),r.addEventListener("load",a=>{s(a.target?.result)}),r.addEventListener("error",a=>{i(a)}),t){case"dataURL":r.readAsDataURL(n);break;case"binaryString":r.readAsBinaryString(n);break;case"arrayBuffer":r.readAsArrayBuffer(n);break;case"text":default:r.readAsText(n)}})}async function $a(n){const t=await es(n,"arrayBuffer");return ln(t)}const Cn=n=>{let t;return n instanceof File?t=n.name:t=n,t.match(/\.([0-9a-z]+)(?:[\\?#]|$)/i)?.[1]??""};function Jt(n,t={},e=[],s){return{tag:n,props:t,children:e,el:s}}function pe(n,t){if(n.el)return n.el;if(n.el=document.createElement(n.tag),n.props)for(const e in n.props){const s=n.props[e];e.startsWith("on")?n.el.addEventListener(e.slice(2).toLowerCase(),s):n.el.setAttribute(e,s)}return n.children&&(typeof n.children=="string"?n.el.textContent=n.children:n.children.forEach(e=>{pe(e,n.el)})),t?.appendChild(n.el),n.el}function ss(n,t){if(!n.el)return;if(n.tag!==t.tag){(n.el.parentElement||document.body).replaceChild(pe(t),n.el);return}const e=t.el=n.el,s=n.props,i=t.props;for(const o in s)o in i||(o.startsWith("on")?e.removeEventListener(o.slice(2).toLowerCase(),s[o]):e.removeAttribute(o));for(const o in i){const h=s[o],c=i[o];if(c!=h)if(o.startsWith("on")){const l=o.slice(2).toLowerCase();e.removeEventListener(l,h),e.addEventListener(l,c)}else o==="style"?Object.keys(c||{}).forEach(l=>{const d=String(c[l]).toLowerCase().includes("!important")?"important":"";e.style.setProperty(ft(l),String(c[l]).replace(/!important/i,""),d)}):e.setAttribute(o,c)}const r=n.children||[],a=t.children||[];if(typeof a=="string")e.innerHTML=a;else if(typeof r=="string")e.innerHTML="",a.forEach(o=>{pe(o,e)});else{const o=Math.min(r.length,a.length);for(let h=0;h<o;h++)ss(r[h],a[h]);a.length>r.length&&a.slice(r.length).forEach(h=>{pe(h,e)}),a.length<r.length&&r.slice(a.length).forEach(h=>{h.el&&e.removeChild(h.el)})}}function En(n,t){if(!n.isEqualNode(t)){if(n.nodeName!==t.nodeName){(n.parentElement||document.body).replaceChild(t,n);return}if(n.nodeType===Node.TEXT_NODE){n.textContent!==t.textContent&&(n.textContent=t.textContent);return}for(let e=n.attributes.length-1;e>=0;e--){const s=n.attributes[e].name;!t.hasAttribute(s)&&s!=="open"&&n.removeAttribute(s)}for(let e=0;e<t.attributes.length;e++){const s=t.attributes[e].name,i=t.attributes[e].value;n.setAttribute(s,i)}for(let e=0;e<t.childNodes.length;e++)n.childNodes[e]?En(n.childNodes[e],t.childNodes[e]):n.appendChild(t.childNodes[e].cloneNode(!0));for(;n.childNodes.length>t.childNodes.length;)n.lastChild&&n.removeChild(n.lastChild)}}class Ja{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:s,wasClean:i}=t;console.log(`ws closed : ${e} ${s} ${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 s=this.waitingResponse[e.requestid];s?s.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,s=this.waitingResponse[e]={requestid:e};try{let i;t instanceof Blob||t instanceof ArrayBuffer||typeof t=="string"?i=t:i=JSON.stringify({...s,...t});const r=await new Promise((a,o)=>{s.resolve=a,this.sendWithRetry(i),setTimeout(()=>{o("Timeout")},5e3)});return console.info("Time took",(+new Date-s.requestid)/1e3),r}catch(i){return Promise.reject(i)}finally{delete this.waitingResponse[e]}}async send(t,e,s=i=>{console.log(i)}){this.sendPayload(t).then(e,s)}}function Za(){const n=window.screen;return{screenWidth:n.width,screenHeight:n.height,screenX:window.screenX,screenY:window.screenY}}function Ee(){const n=document.documentElement;return{clientWidth:n.clientWidth,clientHeight:n.clientHeight,clientTop:n.clientTop,clientLeft:n.clientLeft,scrollWidth:n.scrollWidth,scrollHeight:n.scrollHeight,scrollTop:n.scrollTop,scrollLeft:n.scrollLeft,offsetWidth:n.offsetWidth,offsetHeight:n.offsetHeight,offsetTop:n.offsetTop,offsetLeft:n.offsetLeft,offsetParent:n.offsetParent}}function Ka(){const n=document.body;return{clientWidth:n.clientWidth,clientHeight:n.clientHeight,clientTop:n.clientTop,clientLeft:n.clientLeft,scrollWidth:n.scrollWidth,scrollHeight:n.scrollHeight,scrollTop:n.scrollTop,scrollLeft:n.scrollLeft,offsetWidth:n.offsetWidth,offsetHeight:n.offsetHeight,offsetTop:n.offsetTop,offsetLeft:n.offsetLeft,offsetParent:n.offsetParent}}function Qa(){return typeof window.innerWidth=="number"?{width:window.innerWidth,height:window.innerHeight}:document.compatMode==="CSS1Compat"?{width:document.documentElement.clientWidth,height:document.documentElement.clientHeight}:{width:document.body.clientWidth,height:document.body.clientHeight}}function to(){const{scrollWidth:n,scrollHeight:t}=Ee();return{width:n,height:t}}function Pn(n){const{top:t,left:e,width:s,height:i}=n.getBoundingClientRect(),{scrollLeft:r,scrollTop:a}=Ee();return{x:e+r,y:t+a,width:s,height:i}}function eo(n){let t=n,e=0,s=0;for(;t!==null;)e+=t.offsetLeft,s+=t.offsetTop,t.offsetParent instanceof HTMLElement?t=t.offsetParent:t=null;return{x:e,y:s,width:n.offsetWidth,height:n.offsetHeight}}function Tn(n){return n.getBoundingClientRect()}function so(n){const t=n.getBoundingClientRect();return{x:n.offsetLeft,y:n.offsetTop,width:t.width||t.right-t.left,height:t.height||t.bottom-t.top}}function io(){const{clientHeight:n,scrollTop:t,scrollHeight:e}=Ee(),s=e-n;return s<=0?0:t/s*100}function no(n){if("center"in n){const t=n.center,e=Tn(n.target);return{x:t.x-e.x,y:t.y-e.y}}return{x:n.clientX,y:n.clientY}}function _n(n){if("center"in n)return n.center;if(typeof n.pageX=="number"&&typeof n.pageY=="number")return{x:n.pageX,y:n.pageY};const{scrollLeft:t,scrollTop:e}=Ee();return{x:n.clientX+t,y:n.clientY+e}}function Pt(n,t){if(!t&&"offsetX"in n)return{x:n.offsetX,y:n.offsetY};const e=_n(n),s=Pn(t||n.target);return{x:e.x-s.x,y:e.y-s.y}}const is=()=>{const n=navigator.userAgent.toLowerCase();let t="Unknown";return/mac/i.test(n)?t="macOS":/win/i.test(n)?t="Windows":/android/i.test(n)?t="Android":/iphone|ipad|ipod/i.test(n)?t="iOS":/linux/i.test(n)?t="Linux":/bsd/i.test(n)&&(t="BSD"),t.toLowerCase()},ro=()=>{const n=navigator.userAgent;let t="Unknown";if(/Windows NT/.test(n)){const e=n.match(/Windows NT (\d+\.\d+)/);e&&(t=e[1])}else if(/Mac OS X/.test(n)){const e=n.match(/Mac OS X (\d+_\d+)/);e&&(t=e[1].replace("_","."))}else if(/Android/.test(n)){const e=n.match(/Android (\d+\.\d+)/);e&&(t=e[1])}else if(/iPhone|iPad|iPod/.test(n)){const e=n.match(/OS (\d+_\d+)/);e&&(t=e[1].replace("_","."))}return t.toLowerCase()},Qs=()=>{const n=navigator.userAgent.toLowerCase();let t="Unknown";return/opr/i.test(n)||/opera/i.test(n)?t="Opera":/chrome/i.test(n)?t="Chrome":/firefox/i.test(n)?t="Firefox":/safari/i.test(n)?t="Safari":/edge/i.test(n)?t="Edge":/msie|trident/i.test(n)?t="IE":/MicroMessenger/i.test(n)?t="Wechat":/alipay/i.test(n)&&(t="Ali"),t.toLowerCase()},ao=()=>{const n=navigator.userAgent;let t="Unknown";if(/Chrome/.test(n)){const e=n.match(/Chrome\/(\d+\.\d+)/);e&&(t=e[1])}else if(/Firefox/.test(n)){const e=n.match(/Firefox\/(\d+\.\d+)/);e&&(t=e[1])}else if(/Safari/.test(n)){const e=n.match(/Version\/(\d+\.\d+)/);e&&(t=e[1])}else if(/Edge/.test(n)){const e=n.match(/Edge\/(\d+\.\d+)/);e&&(t=e[1])}else if(/MSIE|Trident/.test(n)){const e=n.match(/(?:MSIE|rv:)(\d+\.\d+)/);e&&(t=e[1])}return t},oo=()=>"geolocation"in navigator?new Promise((n,t)=>{navigator.geolocation.getCurrentPosition(e=>{const s=e.coords.latitude,i=e.coords.longitude;n({latitude:s,longitude:i})},e=>{t(e)})}):Promise.reject("Geolocation is not available.");function ho(){return(navigator.browserLanguage||navigator.language).toLowerCase()}function co(){return Intl.DateTimeFormat().resolvedOptions().timeZone.toLowerCase()}function ti(){return is()==="ios"}function ei(){return is()==="macos"}function lo(){return ti()|ei()}function Dn(){return is()==="android"}function uo(){return ti()||Dn()}function fo(){return typeof window=="object"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches}function An(){const n=window.navigator.userAgent,t=n.indexOf("MSIE ");if(t>0)return parseInt(n.substring(t+5,n.indexOf(".",t)),10);if(n.indexOf("Trident/")>0){const i=n.indexOf("rv:");return parseInt(n.substring(i+3,n.indexOf(".",i)),10)}const s=n.indexOf("Edge/");return s>0?parseInt(n.substring(s+5,n.indexOf(".",s)),10):-1}const mo=An()!==-1;function po(){const n=document.documentMode;return n&&(n===9||n===10)}function In(){return Qs()==="wechat"}function kn(){return Qs()==="ali"}function go(){return In()&&navigator.userAgent.match(/miniprogram/i)||window.__wxjs_environment==="miniprogram"}function yo(){return kn()&&navigator.userAgent.match(/miniprogram/i)}const wo=typeof document<"u",Mn=typeof window<"u",xo=typeof history<"u",bo=Mn&&window.File&&window.FileReader&&window.FileList&&window.Blob,Ln=(()=>{const n=sn();return!!(n.Worker&&n.Blob&&n.Promise&&n.OffscreenCanvas&&n.OffscreenCanvasRenderingContext2D&&n.HTMLCanvasElement&&n.HTMLCanvasElement.prototype.transferControlToOffscreen&&n.URL&&n.URL.createObjectURL)})(),vo=typeof Path2D=="function"&&typeof DOMMatrix=="function",Rn=function(){if(!sn().OffscreenCanvas)return!1;const t=new OffscreenCanvas(1,1),e=t.getContext("2d");e.fillRect(0,0,1,1);const s=t.transferToImageBitmap();try{e.createPattern(s,"no-repeat")}catch{return!1}return!0}(),So=typeof HTMLElement=="object"?function(t){return t instanceof HTMLElement}:function(t){return t&&typeof t=="object"&&t.nodeType===1&&typeof t.nodeName=="string"},Co="webkit moz ms o".split(" ");function ns(n){return typeof n=="function"&&/native code/.test(n.toString())}function Eo(n){const t=document.documentElement,e=window.top===window.self?window.devicePixelRatio:1;t.dataset.dpr=e;let s=100;const i=function(){const r=Math.min(t.clientWidth,n);t.dataset.width=r,t.dataset.rem=s=Math.round(100*(r/n)),t.style.fontSize=s+"px"};i(),window.rem2px=function(r){return r=parseFloat(r),r*s},window.px2rem=function(r){return r=parseFloat(r),r/s},window.addEventListener&&window.addEventListener("orientationchange"in window?"orientationchange":"resize",i,!1)}function O(n){return n*Math.PI/180}function it(n){return n*180/Math.PI}function rs(n,t,e=0){return Math.sqrt(n*n+t*t+e*e)}function as(n,t,e,s){return rs(e-n,s-t)}function os(n,t,e,s){const i=e-n,r=s-t;return i*i+r*r}function Zt(n,t,e,s){let i=Math.atan2(s-t,e-n);return i<0&&(i+=Math.PI*2),i}function It(n,t){return{dx:Math.cos(n)*t,dy:Math.sin(n)*t}}function Po(n,t,e){if(typeof e=="number"){const s=Math.sqrt(Math.pow(n,2)+Math.pow(t,2)+Math.pow(e,2));return{x:n/=s,y:t/=s,z:e/=s}}else{const s=Math.sqrt(Math.pow(n,2)+Math.pow(t,2));return{x:n/=s,y:t/=s}}}function To(n,t,e,s,i=10){if(Math.abs(e-n)<i&&Math.abs(s-t)<i)return"no";const r=it(Zt(n,t,e,s));return r>=-135&&r<=-45?"up":r>45&&r<135?"down":r>=135&&r<=180||r>=-180&&r<-135?"left":"right"}const On=_o("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 _o(n,t=10){const e={},s=n.split(",");for(let i=0;i<s.length;i+=2){const r="&"+s[i+1]+";",a=parseInt(s[i],t);e[r]="&#"+a+";"}return e["\\xa0"]="&#160;",e}function ht(n,t){const e=Object.keys(t);for(let s=0;s<e.length;s++)n=n.replace(new RegExp("{"+e[s]+"}","gi"),""+t[e[s]]);return n}function hs(n){let t,e;if(!n)throw new Error("cannot create a random attribute name for an undefined object");const s="ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz";t="";do for(t="",e=0;e<12;e++)t+=s[Math.floor(Math.random()*s.length)];while(n[t]);return t}function Do(n){const t={left:"start",right:"end",center:"middle",start:"start",end:"end"};return t[n]||t.start}function Ao(n){const t={alphabetic:"alphabetic",hanging:"hanging",top:"text-before-edge",bottom:"text-after-edge",middle:"central"};return t[n]||t.alphabetic}const Pe={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"},lineDashOffset:{svgAttr:"stroke-dashoffset",canvas:0,svg:0,apply:"stroke"}};class cs{__root;__ctx;constructor(t,e){this.__root=t,this.__ctx=e}addColorStop(t,e){const s=this.__ctx.__createElement("stop");if(s.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&&(s.setAttribute("stop-color",ht("rgb({r},{g},{b})",{r:r[1],g:r[2],b:r[3]})),s.setAttribute("stop-opacity",r[4]))}else s.setAttribute("stop-color",e);this.__root.appendChild(s)}}class si{__root;__ctx;constructor(t,e){this.__root=t,this.__ctx=e}}class Te{__document=document;__canvas;__ctx;width;height;__styleStack;__groupStack;__rootSVG;__ids;__SVGdefs;__currentElement;__currentElementsToStyle=null;constructor({canvas:t,width:e=500,height:s=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=s),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(Pe);for(let e=0,s=t.length;e<s;e++){const i=t[e];this[i]=Pe[i].canvas}}__getStyleState(){const t={},e=Object.keys(Pe);for(let s=0,i=e.length;s<i;s++){const r=e[s];t[r]=this[r]}return t}__applyStyleState(t){const e=Object.keys(t);for(let s=0,i=e.length;s<i;s++){const r=e[s];this[r]=t[r]}}__createElement(t,e={},s=!1){const i=this.__document.createElementNS("http://www.w3.org/2000/svg",t),r=Object.keys(e);s&&(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 s=this.__currentElementsToStyle;s&&(e.setAttribute(t,""),e=s.element,s.children.forEach(r=>{r.setAttribute(t,"")}));const i=Object.keys(Pe);for(let r=0;r<i.length;r++){const a=Pe[i[r]],o=this[i[r]];if(a.apply){if(o instanceof si){if(o.__ctx)for(;o.__ctx.__SVGdefs.childNodes.length;){const h=o.__ctx.__SVGdefs.childNodes[0].getAttribute("id");this.__ids[h]=h,this.__SVGdefs.appendChild(o.__ctx.__SVGdefs.childNodes[0])}e.setAttribute(a.apply,ht("url(#{id})",{id:o.__root.getAttribute("id")}))}else if(o instanceof cs)e.setAttribute(a.apply,ht("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 c=/rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d?\.?\d*)\s*\)/gi.exec(o);if(c){e.setAttribute(a.svgAttr,ht("rgb({r},{g},{b})",{r:c[1],g:c[2],b:c[3]}));let l=parseFloat(c[4]);const d=this.globalAlpha;d!=null&&(l*=d),e.setAttribute(a.svgAttr+"-opacity",""+l)}}else{let h=a.svgAttr;if(i[r]==="globalAlpha"&&(h=t+"-"+a.svgAttr,e.getAttribute(h)))continue;h&&e.setAttribute(h,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(On);for(let r=0,a=i.length;r<a;r++){const o=i[r],h=On[o],c=new RegExp(o,"gi");c.test(e)&&(e=e.replace(c,h))}}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 s=this.__currentElement.getAttribute("transform");s?s+=" ":s="",s+=t,this.__currentElement.setAttribute("transform",s)}scale(t,e){e===void 0&&(e=t),this.__addTransform(ht("scale({x},{y})",{x:t,y:e}))}rotate(t){const e=t*180/Math.PI;this.__addTransform(ht("rotate({angle},{cx},{cy})",{angle:e,cx:0,cy:0}))}translate(t,e){this.__addTransform(ht("translate({x},{y})",{x:t,y:e}))}transform(t,e,s,i,r,a){this.__addTransform(ht("matrix({a},{b},{c},{d},{e},{f})",{a:t,b:e,c:s,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(ht("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(ht("L {x} {y}",this.__currentPosition)):this.__addPathCommand(ht("M {x} {y}",this.__currentPosition))}bezierCurveTo(t,e,s,i,r,a){this.__currentPosition={x:r,y:a},this.__addPathCommand(ht("C {cp1x} {cp1y} {cp2x} {cp2y} {x} {y}",{cp1x:t,cp1y:e,cp2x:s,cp2y:i,x:r,y:a}))}quadraticCurveTo(t,e,s,i){this.__currentPosition={x:s,y:i},this.__addPathCommand(ht("Q {cpx} {cpy} {x} {y}",{cpx:t,cpy:e,x:s,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,s,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===s&&e===i||r===0){this.lineTo(t,e);return}const h=this.normalize([a-t,o-e]),c=this.normalize([s-t,i-e]);if(h[0]*c[1]===h[1]*c[0]){this.lineTo(t,e);return}const l=h[0]*c[0]+h[1]*c[1],d=Math.acos(Math.abs(l)),g=this.normalize([h[0]+c[0],h[1]+c[1]]),y=r/Math.sin(d/2),m=t+y*g[0],x=e+y*g[1],b=[-h[1],h[0]],S=[c[1],-c[0]],C=function(X){const Y=X[0];return X[1]>=0?Math.acos(Y):-Math.acos(Y)},L=C(b),R=C(S);this.lineTo(m+b[0]*r,x+b[1]*r),this.arc(m,x,r,L,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,s,i){this.__currentElement.nodeName!=="path"&&this.beginPath(),this.moveTo(t,e),this.lineTo(t+s,e),this.lineTo(t+s,e+i),this.lineTo(t,e+i),this.lineTo(t,e),this.closePath()}fillRect(t,e,s,i){const r=this.__createElement("rect",{x:t,y:e,width:s,height:i},!0);this.__closestGroupOrSvg().appendChild(r),this.__currentElement=r,this.__applyStyleToCurrentElement("fill")}strokeRect(t,e,s,i){const r=this.__createElement("rect",{x:t,y:e,width:s,height:i},!0);this.__closestGroupOrSvg().appendChild(r),this.__currentElement=r,this.__applyStyleToCurrentElement("stroke")}__clearCanvas(){const e=this.__closestGroupOrSvg().getAttribute("transform"),s=this.__rootSVG.childNodes[1],i=s.childNodes;for(let r=i.length-1;r>=0;r--)i[r]&&s.removeChild(i[r]);this.__currentElement=s,this.__groupStack=[],e&&this.__addTransform(e)}clearRect(t,e,s,i){if(t===0&&e===0&&s===this.width&&i===this.height){this.__clearCanvas();return}const r=this.__closestGroupOrSvg(),a=this.__createElement("rect",{x:t,y:e,width:s,height:i,fill:"#FFFFFF"},!0);r.appendChild(a)}createLinearGradient(t,e,s,i){const r=this.__createElement("linearGradient",{id:hs(this.__ids),x1:t+"px",x2:s+"px",y1:e+"px",y2:i+"px",gradientUnits:"userSpaceOnUse"},!1);return this.__SVGdefs.appendChild(r),new cs(r,this)}createRadialGradient(t,e,s,i,r,a){const o=this.__createElement("radialGradient",{id:hs(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 cs(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),s={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"&&(s.decoration="underline"),this.__fontHref&&(s.href=this.__fontHref),s}__wrapTextLink(t,e){if(t.href){const s=this.__createElement("a");return s.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",t.href),s.appendChild(e),s}return e}__applyText(t,e,s,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:s,"text-anchor":Do(this.textAlign),"dominant-baseline":Ao(this.textBaseline)},!0);o.appendChild(this.__document.createTextNode(t)),this.__currentElement=o,this.__applyStyleToCurrentElement(i),a.appendChild(this.__wrapTextLink(r,o))}fillText(t,e,s){this.__applyText(t,e,s,"fill")}strokeText(t,e,s){this.__applyText(t,e,s,"stroke")}measureText(t){return this.__ctx.font=this.font,this.__ctx.measureText(t)}arc(t,e,s,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+s*Math.cos(r),h=e+s*Math.sin(r),c=t+s*Math.cos(i),l=e+s*Math.sin(i),d=a?0:1;let g=0,y=r-i;y<0&&(y+=2*Math.PI),a?g=y>Math.PI?0:1:g=y>Math.PI?1:0,this.lineTo(c,l),this.__addPathCommand(ht("A {rx} {ry} {xAxisRotation} {largeArcFlag} {sweepFlag} {endX} {endY}",{rx:s,ry:s,xAxisRotation:0,largeArcFlag:g,sweepFlag:d,endX:o,endY:h})),this.__currentPosition={x:o,y:h}}clip(){const t=this.__closestGroupOrSvg(),e=this.__createElement("clipPath"),s=hs(this.__ids),i=this.__createElement("g");this.__applyCurrentDefaultPath(),t.removeChild(this.__currentElement),e.setAttribute("id",s),e.appendChild(this.__currentElement),this.__SVGdefs.appendChild(e),t.setAttribute("clip-path",ht("url(#{id})",{id:s})),t.appendChild(i),this.__currentElement=i}drawImage(...t){let e=t[0],s,i,r,a,o=0,h=0,c,l,d,g,y,m,x,b;if(t.length===3)s=t[1],i=t[2],c=e.width,l=e.height,r=c,a=l;else if(t.length===5)s=t[1],i=t[2],r=t[3],a=t[4],c=e.width,l=e.height;else if(t.length===9)o=t[1],h=t[2],c=t[3],l=t[4],s=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("+s+", "+i+")";if(e instanceof Te){if(d=e.getSvg().cloneNode(!0),d.childNodes&&d.childNodes.length>1){for(g=d.childNodes[0];g.childNodes.length;)b=g.childNodes[0].getAttribute("id"),this.__ids[b]=b,this.__SVGdefs.appendChild(g.childNodes[0]);if(y=d.childNodes[1],y){const L=y.getAttribute("transform");let R;L?R=L+" "+C:R=C,y.setAttribute("transform",R),S.appendChild(y)}}}else(e.nodeName==="CANVAS"||e.nodeName==="IMG")&&(m=this.__createElement("image"),m.setAttribute("width",r),m.setAttribute("height",a),m.setAttribute("preserveAspectRatio","none"),(o||h||c!==e.width||l!==e.height)&&(x=this.__document.createElement("canvas"),x.width=r,x.height=a,x.getContext("2d")?.drawImage(e,o,h,c,l,0,0,r,a),e=x),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 s=this.__document.createElementNS("http://www.w3.org/2000/svg","pattern"),i=hs(this.__ids);let r;return s.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")),s.appendChild(r),this.__SVGdefs.appendChild(s)):t instanceof Te&&(s.setAttribute("width",""+t.width),s.setAttribute("height",""+t.height),s.appendChild(t.__rootSVG.childNodes[1]),this.__SVGdefs.appendChild(s)),new si(s,this)}setLineDash(t){t&&t.length>0?this.lineDash=t.join(","):this.lineDash=null}drawFocusRing(){}createImageData(){}getImageData(){}putImageData(){}globalCompositeOperation(){}setTransform(){}}class ls{canvas;context;customContext;currentPath2D=new Path2D;path2Ds=[];currentMatrix=new DOMMatrix;hasSetCustomStrokeStyle=!1;hasSetCustomFillStyle=!1;constructor(t,e,s,i=!1){this.canvas=t,this.context=t.getContext("2d",{willReadFrequently:!0}),i&&(this.customContext=new Te({canvas:this.canvas,width:e||this.canvas.width,height:s||this.canvas.height}))}set lineWidth(t){this.hasSetCustomStrokeStyle=!0,this.context.lineWidth=t,this.customContext&&(this.customContext.lineWidth=t)}get lineWidth(){return this.context.lineWidth}set lineCap(t){this.hasSetCustomStrokeStyle=!0,this.context.lineCap=t,this.customContext&&(this.customContext.lineCap=t)}get lineCap(){return this.context.lineCap}set lineJoin(t){this.hasSetCustomStrokeStyle=!0,this.context.lineJoin=t,this.customContext&&(this.customContext.lineCap=t)}get lineJoin(){return this.context.lineJoin}set lineDashOffset(t){this.hasSetCustomStrokeStyle=!0,this.context.lineDashOffset=t,this.customContext&&(this.customContext.lineDashOffset=t)}get lineDashOffset(){return this.context.lineDashOffset}set miterLimit(t){this.hasSetCustomStrokeStyle=!0,this.context.miterLimit=t,this.customContext&&(this.customContext.miterLimit=t)}get miterLimit(){return this.context.miterLimit}set globalAlpha(t){this.context.globalAlpha=t,this.customContext&&(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&&(this.customContext.fillStyle=t)):(this.context.fillStyle=t.gradient,this.customContext&&(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&&(this.customContext.strokeStyle=t)):(this.context.strokeStyle=t.gradient,this.customContext&&(this.customContext.strokeStyle=t.gradientCustom))}get strokeStyle(){return this.context.strokeStyle}set font(t){this.context.font=t,this.customContext&&(this.customContext.font=t)}get font(){return this.context.font}set textBaseline(t){this.context.textBaseline=t,this.customContext&&(this.customContext.textBaseline=t)}get textBaseline(){return this.context.textBaseline}set textAlign(t){this.context.textAlign=t,this.customContext&&(this.customContext.textAlign=t)}get textAlign(){return this.context.textAlign}fill(t){return t?this.context.fill(t):(this.context.fill(),this.customContext&&this.customContext.fill()),this}fillRect(t,e,s,i){return this.context.fillRect(t,e,s,i),this.customContext&&this.customContext.fillRect(t,e,s,i),this}fillText(t,e,s,i){return this.hasSetCustomFillStyle=!1,this.context.fillText(t,e,s,i),this.customContext&&this.customContext.fillText(t,e,s),this}setLineDash(t){return this.context.setLineDash(t),this.customContext&&this.customContext.setLineDash(t),this}stroke(t){return t?this.context.stroke(t):(this.context.stroke(),this.customContext&&this.customContext.stroke()),this}strokeText(t,e,s,i){return this.context.strokeText(t,e,s,i),this.customContext&&this.customContext.strokeText(t,e,s),this}strokeRect(t,e,s,i){return this.context.strokeRect(t,e,s,i),this.customContext&&this.customContext.strokeRect(t,e,s,i),this}measureText(t){return this.context.measureText(t)}clearRect(t=0,e=0,s=this.canvas.width,i=this.canvas.height){return this.context.clearRect(t,e,s,i),this.customContext&&this.customContext.clearRect(t,e,s,i),this}save(){return this.context.save(),this.customContext&&this.customContext.save(),this.currentMatrix=new DOMMatrix,this.path2Ds.push(this.currentPath2D),this.currentPath2D=new Path2D,this}restore(){return this.context.restore(),this.customContext&&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&&this.customContext.beginPath(),this}closePath(){return this.context.closePath(),this.customContext&&this.customContext.closePath(),this.currentPath2D.closePath(),this}changePath2D(t=this.currentPath2D,e=this.currentMatrix){const s=new Path2D;s.addPath(t,e),this.currentPath2D=s}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&&this.customContext.translate(t,e),this.currentMatrix.translate(t,e),this.changePath2D(),this}rotate(t,e=0,s=0){return this.translate(e,s),this.context.rotate(t),this.customContext&&this.customContext.rotate(t),this.currentMatrix.rotate(t),this.translate(-e,-s),this.changePath2D(),this}scale(t,e=t,s=0,i=0){return this.translate(s,i),this.context.scale(t,e),this.customContext&&this.customContext.scale(t,e),this.currentMatrix.scale(t,e),this.translate(-s,-i),this.changePath2D(),this}moveTo(t,e){return this.context.moveTo(t,e),this.customContext&&this.customContext.moveTo(t,e),this.currentPath2D.moveTo(t,e),this}lineTo(t,e){return this.context.lineTo(t,e),this.customContext&&this.customContext.lineTo(t,e),this.currentPath2D.lineTo(t,e),this}arc(t,e,s,i,r,a){return this.context.arc(t,e,s,i,r,a),this.customContext&&this.customContext.arc(t,e,s,i,r,a?-1:1),this.currentPath2D.arc(t,e,s,i,r,a),this}arcTo(t,e,s,i,r){return this.context.arcTo(t,e,s,i,r),this.customContext&&this.customContext.arcTo(t,e,s,i,r),this.currentPath2D.arcTo(t,e,s,i,r),this}ellipse(t,e,s,i,r,a,o,h){return this.context.ellipse(t,e,s,i,r,a,o,h),this.currentPath2D.ellipse(t,e,s,i,r,a,o,h),this}quadraticCurveTo(t,e,s,i){return this.context.quadraticCurveTo(t,e,s,i),this.customContext&&this.customContext.quadraticCurveTo(t,e,s,i),this.currentPath2D.quadraticCurveTo(t,e,s,i),this}bezierCurveTo(t,e,s,i,r,a){return this.context.bezierCurveTo(t,e,s,i,r,a),this.customContext&&this.customContext.bezierCurveTo(t,e,s,i,r,a),this.currentPath2D.bezierCurveTo(t,e,s,i,r,a),this}rect(t,e,s,i){return this.context.rect(t,e,s,i),this.customContext&&this.customContext.rect(t,e,s,i),this.currentPath2D.rect(t,e,s,i),this}createLinearGradient(t,e,s,i,r){const a=this.context.createLinearGradient(t,e,s,i);return r&&Object.entries(r).forEach(([o,h])=>{a.addColorStop(parseFloat(o),h)}),a}createRadialGradient(t,e,s,i,r,a,o){const h=this.context.createRadialGradient(t,e,s,i,r,a);return o&&Object.entries(o).forEach(([c,l])=>{h.addColorStop(parseFloat(c),l)}),h}drawImage(t,...e){if(e.length===0)this.context.drawImage(t,0,0);else if(e.length===2){const s=e[0],i=e[1];this.context.drawImage(t,s,i)}else if(e.length===4){const s=e[0],i=e[1],r=e[2],a=e[3];this.context.drawImage(t,s,i,r,a)}else if(e.length===8){const s=e[0],i=e[1],r=e[2],a=e[3],o=e[4],h=e[5],c=e[6],l=e[7];this.context.drawImage(t,s,i,r,a,o,h,c,l)}else throw new Error("Invalid number of arguments passed to drawImage: "+e.length);return this.customContext&&this.customContext.drawImage(t,...e),this}getImageData(t=0,e=0,s=this.canvas.width,i=this.canvas.height,r){return this.context.getImageData(t,e,s,i,r)}putImageData(t,e=0,s=0){return this.context.putImageData(t,e,s)}createPattern(t,e){return this.context.createPattern(t,e)}toRawSVG(){if(this.customContext){const t=this.customContext.getSerializedSvg(!0),e=this.customContext.getSvg();return{raw:t,element:e}}else return{raw:"",element:null}}}class us{x;y;toX;toY;constructor(t){this.x=t?.x||0,this.y=t?.y||0,this.toX=t?.toX||0,this.toY=t?.toY||0}toSVGPathData(){return[["L",this.toX,this.toY]]}toCanvasContext(t){t.lineTo(this.toX,this.toY)}getBoundingClientRect(){const t=Zt(this.x,this.y,this.toX,this.toY);if(t===0){const e=Math.min(this.x,this.toX),s=Math.min(this.y,this.toY),i=Math.max(this.x,this.toX),r=Math.max(this.y,this.toY);return{x:e,y:s,width:i-e,height:r-s}}else{const e=Math.sin(t),s=Math.cos(t),i=s*this.x-e*this.y,r=s*this.toX-e*this.toY,a=s*this.y+e*this.x,o=s*this.toY+e*this.toX;return{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.x+t*(this.toX-this.x),y:this.y+t*(this.toY-this.y)}}intersection(t){const e=this.x,s=this.y,i=t.toX,r=t.toY,a=this.toX-e,o=t.x-i;if(!a&&!o)return null;const h=(this.toY-s)/a,c=(t.y-r)/o;if(a){if(!o)return{x:i,y:h*(i-e)+s}}else return{x:e,y:c*(e-i)+r};const l=(-c*i+r+h*e-s)/(h-c),d=h*(l-e)+s;return isNaN(l)||isNaN(d)?null:{x:l,y:d}}}const Nn=us;class ii extends us{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,this.toX=t.toX,this.toY=t.toY}toSVGPathData(){return[["A",this.rx,this.ry,this.xAxisRotate,this.largeArcFlag,this.sweepFlag,this.toX,this.toY]]}toCanvasContext(t){const[e,s,i,r,a,o,h]=this.convert(this.x,this.y,this.toX,this.toY,this.rx,this.ry,this.xAxisRotate,this.largeArcFlag,this.sweepFlag);t.ellipse(e,s,i,r,a,o,h,!this.sweepFlag)}convert(t,e,s,i,r,a,o,h,c){const l=o/180*Math.PI,d=(t-s)/2,g=(e-i)/2,y=Math.cos(l)*d+Math.sin(l)*g,m=-Math.sin(l)*d+Math.cos(l)*g,x=y*y/(r*r)+m*m/(a*a);if(x>1){const j=Math.sqrt(x);throw r=j*r,a=j*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*y*y)/(r*r*m*m+a*a*y*y)),S=h!=c?1:-1,C=S*b*r*m/a,L=S*b*-a*y/r,R=(t+s)/2,X=(e+i)/2,Y=Math.cos(l)*C-Math.sin(l)*L+R,H=Math.sin(l)*C+Math.cos(l)*L+X,at=(j,ot,St,gt)=>(j*gt>=ot*St?1:-1)*Math.acos((j*St+ot*gt)/(Math.sqrt(j*j+ot*ot)*Math.sqrt(St*St+gt*gt))),J=at(1,0,t-Y,e-H)-l,Z=at(t-Y,e-H,s-Y,i-H);return[Y,H,r,a,l,J,J+Z]}}class Io extends us{cx;cy;isLineThrough;constructor(t){super(t),this.cx=t.cx,this.cy=t.cy,this.isLineThrough=typeof t.isLineThrough=="boolean"?t.isLineThrough:!1}toSVGPathData(){if(this.isLineThrough){const t=this.cx*2-(this.x+this.toX)/2,e=this.cy*2-(this.y+this.toY)/2;return[["Q",t,e,this.toX,this.toY]]}else return[["Q",this.cx,this.cy,this.toX,this.toY]]}toCanvasContext(t){if(this.isLineThrough){const e=this.cx*2-(this.x+this.toX)/2,s=this.cy*2-(this.y+this.toY)/2;t.quadraticCurveTo(e,s,this.toX,this.toY)}else t.quadraticCurveTo(this.cx,this.cy,this.toX,this.toY)}getBoundingClientRect(){const t=[this.x,this.toX],e=[this.y,this.toY];let s,i,r,a;for(let c=0;c<2;++c)s=c==0?this.x-2*this.cx+this.toX:this.y-2*this.cy+this.toY,i=c==0?-2*this.x+2*this.cx:-2*this.y+2*this.cy,r=c==0?this.x:this.y,Math.abs(s)>1e-12&&(a=-i/(2*s),0<a&&a<1&&[t,e][c].push(s*a*a+i*a+r));const o={x:Math.min.apply(0,t),y:Math.min.apply(0,e)},h={x:Math.max.apply(0,t),y:Math.max.apply(0,e)};return{x:o.x,y:o.y,width:h.x-o.x,height:h.y-o.y}}interpolate(t){return{x:(1-t)*(1-t)*this.x+2*(1-t)*t*this.cx+t*t*this.toX,y:(1-t)*(1-t)*this.y+2*(1-t)*t*this.cy+t*t*this.toY}}}const ko=Io;class mt extends us{c1x;c1y;c2x;c2y;constructor(t){super(t),this.c1x=t.c1x,this.c1y=t.c1y,this.c2x=t.c2x,this.c2y=t.c2y}toSVGPathData(){return[["C",this.c1x,this.c1y,this.c2x,this.c2y,this.toX,this.toY]]}toCanvasContext(t){t.bezierCurveTo(this.c1x,this.c1y,this.c2x,this.c2y,this.toX,this.toY)}getBoundingClientRect(){let t=this.c2x-2*this.c1x+this.x-(this.toX-2*this.c2x+this.c1x),e=2*(this.c1x-this.x)-2*(this.c2x-this.c1x),s=this.x-this.c1x,i=(-e+Math.sqrt(e*e-4*t*s))/2/t,r=(-e-Math.sqrt(e*e-4*t*s))/2/t;const a=[this.y,this.toY],o=[this.x,this.toX];let h;const c=[];Math.abs(i)>1e12&&(i=.5),Math.abs(r)>1e12&&(r=.5),i>=0&&i<=1&&(h=this.interpolate(i),o.push(h.x),a.push(h.y),c.push({X:h.x,Y:h.y})),r>=0&&r<=1&&(h=this.interpolate(r),o.push(h.x),a.push(h.y),c.push({X:h.x,Y:h.y})),t=this.c2y-2*this.c1y+this.y-(this.toY-2*this.c2y+this.c1y),e=2*(this.c1y-this.y)-2*(this.c2y-this.c1y),s=this.y-this.c1y,i=(-e+Math.sqrt(e*e-4*t*s))/2/t,r=(-e-Math.sqrt(e*e-4*t*s))/2/t,Math.abs(i)>1e12&&(i=.5),Math.abs(r)>1e12&&(r=.5),i>=0&&i<=1&&(h=this.interpolate(i),o.push(h.x),a.push(h.y),c.push({X:h.x,Y:h.y})),r>=0&&r<=1&&(h=this.interpolate(r),o.push(h.x),a.push(h.y),c.push({X:h.x,Y:h.y}));let l=[],d=c.length;for(let m=0;m<d;m++){for(let x=m+1;x<d;x++)c[m].X===c[x].X&&c[m].Y===c[x].Y&&(x=++m);l.push({X:c[m].X,Y:c[m].Y})}const g={x:Math.min.apply(Math,o),y:Math.min.apply(Math,a)},y={x:Math.max.apply(Math,o),y:Math.max.apply(Math,a)};return{x:g.x,y:g.y,width:y.x-g.x,height:y.y-g.y,dots:l}}interpolate(t){return{x:Math.pow(1-t,3)*this.x+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.toX,y:Math.pow(1-t,3)*this.y+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.toY}}static base3(t,e,s,i,r){const a=-3*e+9*s-9*i+3*r,o=t*a+6*e-12*s+6*i;return t*o-3*e+3*s}static bezlen(t,e,s,i,r,a,o,h,c=1){c=Math.max(0,Math.min(c,1));const l=c/2,d=[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816],g=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472];let y=0;for(let m=0;m<12;m++){const x=l*d[m]+l,b=this.base3(x,t,s,r,o),S=this.base3(x,e,i,a,h);y+=g[m]*Math.sqrt(b*b+S*S)}return l*y}length(t=1){return mt.bezlen(this.x,this.y,this.c1x,this.c1y,this.c2x,this.c2y,this.toX,this.toY,t)}getTatLen(t){const e=this.x,s=this.y,i=this.c1x,r=this.c1y,a=this.c2x,o=this.c2y,h=this.toX,c=this.toY;if(t<0||mt.bezlen(e,s,i,r,a,o,h,c)<t)return 0;let l=1,d=l/2,g=l-d,y=mt.bezlen(e,s,i,r,a,o,h,c,g);for(;Math.abs(y-t)>.01;)d/=2,g+=(y<t?1:-1)*d,y=mt.bezlen(e,s,i,r,a,o,h,c,g);return g}getPointAtSegmentLength(t){const e=this.getTatLen(t);let s=1-e,i=Math.pow(s,3),r=Math.pow(s,2),a=e*e,o=a*e,h=i*this.x+r*3*e*this.c1x+s*3*e*e*this.c2x+o*this.toX,c=i*this.y+r*3*e*this.c1y+s*3*e*e*this.c2y+o*this.toY,l=this.x+2*e*(this.c1x-this.x)+a*(this.c2x-2*this.c1x+this.x),d=this.y+2*e*(this.c1y-this.y)+a*(this.c2y-2*this.c1y+this.y),g=this.c1x+2*e*(this.c2x-this.c1x)+a*(this.toX-2*this.c2x+this.c1x),y=this.c1y+2*e*(this.c2y-this.c1y)+a*(this.toY-2*this.c2y+this.c1y),m=s*this.x+e*this.c1x,x=s*this.y+e*this.c1y,b=s*this.c2x+e*this.toX,S=s*this.c2y+e*this.toY,C=90-Math.atan2(l-g,d-y)*180/Math.PI;return{x:h,y:c,m:{x:l,y:d},n:{x:g,y},start:{x:m,y:x},end:{x:b,y:S},alpha:C}}}const _e=Math.PI*2;function Fn(n,t,e,s){const i=n*s-t*e<0?-1:1;let r=n*e+t*s;return r>1&&(r=1),r<-1&&(r=-1),i*Math.acos(r)}function Mo(n,t,e,s,i,r,a,o,h,c){const l=c*(n-e)/2+h*(t-s)/2,d=-h*(n-e)/2+c*(t-s)/2,g=a*a,y=o*o,m=l*l,x=d*d;let b=g*y-g*x-y*m;b<0&&(b=0),b/=g*x+y*m,b=Math.sqrt(b)*(i===r?-1:1);const S=b*a/o*d,C=b*-o/a*l,L=c*S-h*C+(n+e)/2,R=h*S+c*C+(t+s)/2,X=(l-S)/a,Y=(d-C)/o,H=(-l-S)/a,at=(-d-C)/o,J=Fn(1,0,X,Y);let Z=Fn(X,Y,H,at);return r===0&&Z>0&&(Z-=_e),r===1&&Z<0&&(Z+=_e),[L,R,J,Z]}function Lo(n,t){const e=1.3333333333333333*Math.tan(t/4),s=Math.cos(n),i=Math.sin(n),r=Math.cos(n+t),a=Math.sin(n+t);return[s,i,s-i*e,i+s*e,r+a*e,a-r*e,r,a]}function Yn(n,t,e,s,i,r,a,o,h){const c=Math.sin(h*_e/360),l=Math.cos(h*_e/360),d=l*(n-e)/2+c*(t-s)/2,g=-c*(n-e)/2+l*(t-s)/2;if(d===0&&g===0)return[];if(a===0||o===0)return[];a=Math.abs(a),o=Math.abs(o);const y=d*d/(a*a)+g*g/(o*o);y>1&&(a*=Math.sqrt(y),o*=Math.sqrt(y));const m=Mo(n,t,e,s,i,r,a,o,c,l),x=[];let b=m[2],S=m[3];const C=Math.max(Math.ceil(Math.abs(S)/(_e/4)),1);S/=C;for(let L=0;L<C;L++)x.push(Lo(b,S)),b+=S;return x.map(L=>{for(let R=0;R<L.length;R+=2){let X=L[R+0],Y=L[R+1];X*=a,Y*=o;const H=l*X-c*Y,at=c*X+l*Y;L[R+0]=H+m[0],L[R+1]=at+m[1]}return L})}function ni(n,t,e,s,i,r){return[n/3+.6666666666666666*e,t/3+.6666666666666666*s,i/3+.6666666666666666*e,r/3+.6666666666666666*s,i,r]}function De(n,t,e,s){return[n,t,e,s,e,s]}const Ae={a:7,c:6,s:4,q:4,t:2,m:2,l:2,h:1,v:1,z:0};class ae{static createSVGElement(t="path",e){const s=document.createElementNS.call(document,"http://www.w3.org/2000/svg",t);return e&&A.attribute(s,e),s}static createSvgPath(t,e){return this.createSVGElement("path",{d:t,id:e||Vs()})}static downloadFromSVGElement(t,e="shape"){return Ks(vn(t),`${e}.svg`)}static downloadFromSVGString(t,e="shape"){return Ks(Js(t),`${e}.svg`)}static getSVGRawStringFromElement(t){return Zs(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 ae.isSVGPath(t)&&t.replace(/([mlhvzaqtcs])([^mlhvzaqtcs]*)/gi,(s,i,r)=>{let a=i.toLowerCase();const o=yn(r);for(a=="m"&&o.length>Ae[a]&&(e.push([i,...o.splice(0,Ae[a])]),a="l",i=i=="m"?"l":"L");o.length;){if(o.length<Ae[a])throw new Error(`parseSVGPath substring:{ ${s} } command:{ ${i} } args:{ ${o} }`);e.push([i,...o.splice(0,Ae[a])])}return a=="z"&&e.push([i]),""}),e}static absolutizeSVGPath(t){let e=0,s=0,i=0,r=0;return t.map(function(a){const o=a[0],h=o.toUpperCase();if(o!=h)switch(a[0]=h,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 c=1;c<a.length;)a[c++]+=i,a[c++]+=r}switch(h){case"Z":i=e,r=s;break;case"H":i=a[1];break;case"V":r=a[1];break;case"M":i=e=a[1],r=s=a[2];break;default:i=a[a.length-2],r=a[a.length-1]}return a})}static relativeSVGPath(t){let e=0,s=0,i=0,r=0;return t.map(function(a){const o=a[0],h=o.toLowerCase();if(o!=h)switch(a[0]=h,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 c=1;c<a.length;)a[c++]-=i,a[c++]-=r}switch(h){case"z":i=e,r=s;break;case"h":i+=a[1];break;case"v":r+=a[1];break;case"m":i+=a[1],r+=a[2],e+=a[1],s+=a[2];break;default:i+=a[a.length-2],r+=a[a.length-1]}return a})}static normalizeSVGPath(t){const e=[];let s=0,i=0,r=0,a=0,o=0,h=0,c=0,l=0,d;for(let g=0,y=t.length;g<y;g++){let m=t[g];const x=m[0];switch(x){case"M":s=m[1],i=m[2];break;case"A":const b=Yn(r,a,m[6],m[7],m[4],m[5],m[1],m[2],m[3]);if(!b.length)continue;b.forEach((L,R)=>{const[X,Y,H,at,J,Z,j,ot]=L;m=["C",H,at,J,Z,j,ot],R<b.length-1&&e.push(m)});break;case"S":let S=r,C=a;(d=="C"||d=="S")&&(S+=S-c,C+=C-l),m=["C",S,C,m[1],m[2],m[3],m[4]];break;case"T":d=="Q"||d=="T"?(o=r*2-o,h=a*2-h):(o=r,h=a),m=["C",...ni(r,a,o,h,m[1],m[2])];break;case"Q":o=m[1],h=m[2],m=["C",...ni(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,s,i)];break}d=x,r=m[m.length-2],a=m[m.length-1],m.length>4?(c=m[m.length-4],l=m[m.length-3]):(c=r,l=a),e.push(m)}return e}static catmullRom2bezier(t){const e=[];for(let s=0,i=t.length;i-2>s;s+=2){let r;s==0?r=[{x:t[s],y:t[s+1]},{x:t[s],y:t[s+1]},{x:t[s+2],y:t[s+3]},{x:t[s+4],y:t[s+5]}]:i-4==s?r=[{x:t[s-2],y:t[s-1]},{x:t[s],y:t[s+1]},{x:t[s+2],y:t[s+3]},{x:t[s+2],y:t[s+3]}]:r=[{x:t[s-2],y:t[s-1]},{x:t[s],y:t[s+1]},{x:t[s+2],y:t[s+3]},{x:t[s+4],y:t[s+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){const e=[];let s=["L",0,0],i;for(let r=0,a=t.length;r<a;r++){const o=t[r];switch(o[0]){case"M":s=["L",o[1],o[2]],e.push(o);break;case"Z":e.push(s);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 s,i=0,r=0;for(let a=0,o=t.length;a<o;a++){const h=t[a],c=e[h[0]];c&&(h[0]=c.to,s&&(s[0]===c.to?(i=2*Number(s[c.x+2])-Number(s[c.x]),r=2*Number(s[c.x+3])-Number(s[c.x+1])):(i=Number(s[s.length-2]),r=Number(s[s.length-1]))),h.splice(1,0,i,r)),s=h}return t}}const yt=ae;class wt{cX;cY;x;y;degree;scalarX;scalarY;startPathX=0;startPathY=0;prevPathX=0;prevPathY=0;normalizedLines=[];constructor(t){this.cX=0,this.cY=0,this.x=t?.x||0,this.y=t?.y||0,typeof t?.centerX=="number"&&typeof t?.centerY=="number"&&(this.cX=t.centerX-this.x,this.cY=t.centerY-this.y),this.degree=t?.degree||0,this.scalarX=1,this.scalarY=1,t?.scalar!==void 0&&(this.scalarX=t.scalar,this.scalarY=t.scalar),t?.scalarX!==void 0&&(this.scalarX=t.scalarX),t?.scalarY!==void 0&&(this.scalarY=t.scalarY),this.reset(t?.d,t?.originMatrix)}reset(t,e){typeof t=="string"?this.resetFromSVGPathData(yt.parseSVGPath(t),e):t instanceof wt?this.resetFromSVGPathData(t.toSVGPathData(),e):this.resetFromSVGPathData(t||[],e)}resetFromSVGPathData(t,e){this.normalizedLines=[];const s=yt.normalizeSVGPath(yt.absolutizeSVGPath(t));this.prevPathX=this.startPathX=0,this.prevPathY=this.startPathY=0;let i=!1;for(let r=0,a=s.length;r<a;r++){const o=s[r];if(o[0]=="M"){i||(i=!0,this.startPathX=o[1],this.startPathY=o[2]),this.prevPathX=o[1],this.prevPathY=o[2];continue}this.appendLine(new mt({c1x:o[1],c1y:o[2],c2x:o[3],c2y:o[4],toX:o[5],toY:o[6]}))}e&&({x:this.startPathX,y:this.startPathY}=e.transformPoint({x:this.startPathX,y:this.startPathY}),{x:this.prevPathX,y:this.prevPathY}=e.transformPoint({x:this.prevPathX,y:this.prevPathY}),this.normalizedLines.forEach(r=>{({x:r.x,y:r.y}=e.transformPoint({x:r.x,y:r.y})),{x:r.c1x,y:r.c1y}=e.transformPoint({x:r.c1x,y:r.c1y}),{x:r.c2x,y:r.c2y}=e.transformPoint({x:r.c2x,y:r.c2y}),{x:r.toX,y:r.toY}=e.transformPoint({x:r.toX,y:r.toY})}))}static fromPolymorphPoints(t){const e=new wt;e.prevPathX=e.startPathX=t[0]||0,e.prevPathY=e.startPathY=t[1]||0;for(let s=2,i=t.length;s+5<i;s+=6)e.appendLine(new mt({c1x:t[s],c1y:t[s+1],c2x:t[s+2],c2y:t[s+3],toX:t[s+4],toY:t[s+5]}));return e}static fromLines(t){const e=new wt;e.prevPathX=e.startPathX=t[0].x||0,e.prevPathY=e.startPathY=t[0].y||0;for(let s=0,i=t.length;s<i;s++)e.appendLine(t[s]);return e}appendLine(t){if(t instanceof ii){Yn(this.prevPathX,this.prevPathY,t.toX,t.toY,t.largeArcFlag,t.sweepFlag,t.rx,t.ry,t.xAxisRotate).forEach(c=>{const[l,d,g,y,m,x,b,S]=c;this.normalizedLines.push(new mt({x:this.prevPathX,y:this.prevPathY,c1x:g,c1y:y,c2x:m,c2y:x,toX:b,toY:S})),this.prevPathX=b,this.prevPathY=S});return}let e,s,i,r,a,o;t instanceof mt?(e=t.c1x,s=t.c1y,i=t.c2x,r=t.c2y,a=t.toX,o=t.toY):t instanceof ko?[e,s,i,r,a,o]=ni(this.prevPathX,this.prevPathY,t.cx,t.cy,t.toX,t.toY):[e,s,i,r,a,o]=De(this.prevPathX,this.prevPathY,t.toX,t.toY),this.normalizedLines.push(new mt({x:this.prevPathX,y:this.prevPathY,c1x:e,c1y:s,c2x:i,c2y:r,toX:a,toY:o})),this.prevPathX=a,this.prevPathY=o}toSVGPathData(){const{startPathX:t,startPathY:e,normalizedLines:s}=this.updateTransform(),i=[];i.push(["M",t,e]);for(let r=0,a=s.length;r<a;r++)i.push(...s[r].toSVGPathData());return i}toSVGPathD(){return yt.SVGPathDataToD(this.toSVGPathData())}toCanvasContext(t){const{startPathX:e,startPathY:s,normalizedLines:i}=this.updateTransform();t.beginPath(),t.moveTo(e,s),i.forEach(r=>{r.toCanvasContext(t)})}getBoundingClientRect(){const{normalizedLines:t}=this.updateTransform(),e=[],s=[];if(t.forEach(h=>{const c=h.getBoundingClientRect();e.push(c.x,c.x+c.width),s.push(c.y,c.y+c.height)}),e.length==0||s.length==0)return{x:0,y:0,width:0,height:0};const i=Math.min.apply(0,e),r=Math.min.apply(0,s),a=Math.max.apply(0,e),o=Math.max.apply(0,s);return{x:i,y:r,width:a-i,height:o-r}}update(t){this.cX=typeof t.cX=="number"?t.cX:this.cX,this.cY=typeof t.cY=="number"?t.cY:this.cY,this.x=t.x,this.y=t.y,this.degree=t.degree,this.scalarX=t.scalarX,this.scalarY=t.scalarY}updateTransform(){const t=new ct;if(t.translate(this.x+this.cX,this.y+this.cY),t.rotate(this.degree),t.scale(this.scalarX,this.scalarY),t.translate(-this.cX,-this.cY),t.isIdentity)return{startPathX:this.startPathX,startPathY:this.startPathY,normalizedLines:this.normalizedLines};{let e=this.startPathX,s=this.startPathY;({x:e,y:s}=t.transformPoint({x:e,y:s}));const i=[];return this.normalizedLines.forEach(r=>{let a=r.x,o=r.y,h=r.c1x,c=r.c1y,l=r.c2x,d=r.c2y,g=r.toX,y=r.toY;({x:a,y:o}=t.transformPoint({x:a,y:o})),{x:h,y:c}=t.transformPoint({x:h,y:c}),{x:l,y:d}=t.transformPoint({x:l,y:d}),{x:g,y}=t.transformPoint({x:g,y}),i.push(new mt({x:a,y:o,c1x:h,c1y:c,c2x:l,c2y:d,toX:g,toY:y}))}),{startPathX:e,startPathY:s,normalizedLines:i}}}getTotalLength(){const{normalizedLines:t}=this.updateTransform();return t.reduce((e,s)=>e+=s.length(),0)}getPointAtLength(t){const{normalizedLines:e}=this.updateTransform();let s=0;const i=e.length;for(let r=0;r<i;r++){const a=e[r],o=a.length();if(s+o>=t)return a.getPointAtSegmentLength(t-s);s+=o}return e[i-1].getPointAtSegmentLength(1)}interpolate(t){const{startPathX:e,startPathY:s,normalizedLines:i}=this.updateTransform(),r=i.length;if(r===0)return{x:e,y:s};if(r===1)return i[0].interpolate(t);{let a=t*r,o=i[0];if(a--,a>1)for(let h=1;h<r&&(o=i[h],a>1);h++)a-=1;return o.interpolate(a)}}getSubpath(t,e){if(this.getTotalLength()-e<1e-6)return this.getSubpathsAtLength(this,t);{const s=this.getSubpathsAtLength(this,e,1);return t?this.getSubpathsAtLength(s,t):s}}getSubpathsAtLength(t,e,s){const{startPathX:i,startPathY:r,normalizedLines:a}=t.updateTransform();let o=null,h=0;const c=new wt;c.prevPathX=c.startPathX=i,c.prevPathY=c.startPathY=r;for(let l=0,d=a.length;l<d;l++){const g=a[l],y=g.length();if(h+y>e&&!o){const m=g.getPointAtSegmentLength(e-h);if(c.appendLine(new mt({c1x:m.start.x,c1y:m.start.y,c2x:m.m.x,c2y:m.m.y,toX:m.x,toY:m.y})),s)return c;o=c,c.appendLine(new mt({c1x:m.n.x,c1y:m.n.y,c2x:m.end.x,c2y:m.end.y,toX:g.x,toY:g.y})),h+=y;continue}h+=y,c.appendLine(g)}return c}closestPoint(t,e){const s=this.getTotalLength();let i={x:t,y:e},r=0,a=1/0,o=8;for(let c=0;c<=s;c+=o){let l=this.getPointAtLength(c),d=os(l.x,l.y,t,e);d<a&&(i=l,r=c,a=d)}for(o/=2;o>.5;){let c=r-o,l=this.getPointAtLength(c),d=os(l.x,l.y,t,e),g=r+o,y=this.getPointAtLength(g),m=os(y.x,y.y,t,e);c>=0&&d<a?(i=l,r=c,a=d):g<=s&&m<a?(i=y,r=g,a=m):o/=2}const h=this.getPointAtLength(r+(r===s?-.1:.1));return{point:i,rotation:r>=s?Zt(h.x,h.y,i.x,i.y):Zt(i.x,i.y,h.x,h.y),distance:Math.sqrt(a)}}get polymorphPoints(){const{startPathX:t,startPathY:e,normalizedLines:s}=this.updateTransform();return[t,e].concat(s.reduce((i,r)=>i.concat([r.c1x,r.c1y,r.c2x,r.c2y,r.toX,r.toY]),[]))}perimeterPoints(){const t=this.polymorphPoints,e=t.length;let s=t[e-2],i=t[e-1],r=0;for(let a=0;a<e;a+=6)r+=as(t[a],t[a+1],s,i),s=t[a],i=t[a+1];return Math.floor(r)}expendFill(t){const e=this.polymorphPoints,s=e.length;let i=t-s;const r=Math.ceil(t/s),a=[];a.push(["M",e[0],e[1]]);let o=2;for(;o+5<=s-1;){const h=e[o++],c=e[o++],l=e[o++],d=e[o++],g=e[o++],y=e[o++];a.push(["C",h,c,l,d,g,y]);let m=0;for(;m<r&&i>0;)a.push(["C",g,y,g,y,g,y]),i-=6,m++}return a}static mixPoints(t,e,s){const i=t.length,r=new Array(i);for(let a=0;a<i;a++)r[a]=At(t[a]+(e[a]-t[a])*s,6);return r}static getPathInterpolator(t,e){return s=>Math.abs(s-0)<Number.EPSILON?t:Math.abs(s-1)<Number.EPSILON?e:wt.fromPolymorphPoints(wt.mixPoints(new wt({d:t}).polymorphPoints,new wt({d:e}).polymorphPoints,s)).toSVGPathData()}}const Ro=wt;(function(){if(!window.requestAnimationFrame){let n=$();window.requestAnimationFrame=function(t){const e=$(),s=Math.max(0,16-(e-n)),i=window.setTimeout(function(){t(e+s)},s);return n=e+s,i}}window.cancelAnimationFrame||(window.cancelAnimationFrame=function(n){clearTimeout(n)})})();const ri=n=>{let t=!1;return window.requestAnimationFrame(function e(s){!t&&n(s)&&window.requestAnimationFrame(e)}),()=>{t=!0}};function ai(n,t=0){if(t==0)return n($()),()=>{};{const e=$();return ri(s=>s-e>=t?(n(s),!1):!0)}}function Oo(n,t=0){let e=!1,s=0,i=$();const r=a=>{if(e)return;s++;const o=a-i-s*t;n(a,s,t-o<=0),ai(r,Math.max(0,t-o))};return ai(r,t),()=>{e=!0}}function No(n,t=20){const e=1e3/t;let s=0,i;return()=>($()-s>=e&&(s=$(),i=n()),i)}const Kt=new Je;let oi=!1;function Bn(n,t,e){n&&t&&Kt.set(n,t),!oi&&(oi=!0,requestIdleCallback(s=>{for(oi=!1;s.timeRemaining()>0&&Kt.length>0;){const i=Kt.shift();i&&i[1]()}Kt.length>0&&Bn()},{timeout:e}))}let hi=!1;function ci(n,t,e){if(n&&t&&Kt.set(n,t),hi)return;hi=!0;const s=$();Gn(i=>{for(hi=!1;(i.timeRemaining()>0||e&&$()-s>=e)&&Kt.length>0;){const r=Kt.shift();r&&r[1]()}Kt.length>0&&ci()})}let ds=0,oe=33,Qt=33,li;const Xn=new MessageChannel,Fo=Xn.port2;Xn.port1.onmessage=n=>{li!==null&&li({didTimeout:ds<=$(),timeRemaining:()=>Math.max(0,ds-$())})};function Gn(n){return li=n,requestAnimationFrame(t=>{let e=t-ds+Qt;e<Qt&&oe<Qt?(e<8&&(e=8),Qt=e<oe?oe:e):e>Qt&&oe>Qt?Qt=e<oe?oe:e:oe=e,ds=t+Qt,Fo.postMessage(null)})}function Yo(n){return cancelAnimationFrame(n)}function Bo(n){if(typeof setImmediate<"u"&&ns(setImmediate))setImmediate(n);else if(typeof MessageChannel<"u"&&(ns(MessageChannel)||MessageChannel.toString()==="[object MessageChannelConstructor]")){const{port1:t,port2:e}=new MessageChannel;e.onmessage=n,t.postMessage(null)}else typeof Promise<"u"&&ns(Promise)?Promise.resolve().then(n):setTimeout(n,0)}function Xo(n){typeof queueMicrotask=="function"?queueMicrotask(n):Promise.resolve().then(n).catch(t=>setTimeout(()=>{throw t}))}class Ie{static _nextId=0;static nextId(){return Ie._nextId++}}const I={Linear:{None:function(n){return n}},Ease:{In:function(n){return Math.pow(n,1.7)}},Quadratic:{In:function(n){return n*n},Out:function(n){return n*(2-n)},InOut:function(n){return(n*=2)<1?.5*n*n:-.5*(--n*(n-2)-1)}},Cubic:{In:function(n){return n*n*n},Out:function(n){return--n*n*n+1},InOut:function(n){return(n*=2)<1?.5*n*n*n:.5*((n-=2)*n*n+2)}},Quartic:{In:function(n){return n*n*n*n},Out:function(n){return 1- --n*n*n*n},InOut:function(n){return(n*=2)<1?.5*n*n*n*n:-.5*((n-=2)*n*n*n-2)}},Quintic:{In:function(n){return n*n*n*n*n},Out:function(n){return--n*n*n*n*n+1},InOut:function(n){return(n*=2)<1?.5*n*n*n*n*n:.5*((n-=2)*n*n*n*n+2)}},Sinusoidal:{In:function(n){return 1-Math.sin((1-n)*Math.PI/2)},Out:function(n){return Math.sin(n*Math.PI/2)},InOut:function(n){return .5*(1-Math.sin(Math.PI*(.5-n)))}},Exponential:{In:function(n){return n===0?0:Math.pow(1024,n-1)},Out:function(n){return n===1?1:1-Math.pow(2,-10*n)},InOut:function(n){return n===0?0:n===1?1:(n*=2)<1?.5*Math.pow(1024,n-1):.5*(-Math.pow(2,-10*(n-1))+2)}},Circular:{In:function(n){return 1-Math.sqrt(1-n*n)},Out:function(n){return Math.sqrt(1- --n*n)},InOut:function(n){return(n*=2)<1?-.5*(Math.sqrt(1-n*n)-1):.5*(Math.sqrt(1-(n-=2)*n)+1)}},Elastic:{In:function(n){return n===0?0:n===1?1:-Math.pow(2,10*(n-1))*Math.sin((n-1.1)*5*Math.PI)},Out:function(n){return n===0?0:n===1?1:Math.pow(2,-10*n)*Math.sin((n-.1)*5*Math.PI)+1},InOut:function(n){return n===0?0:n===1?1:(n*=2,n<1?-.5*Math.pow(2,10*(n-1))*Math.sin((n-1.1)*5*Math.PI):.5*Math.pow(2,-10*(n-1))*Math.sin((n-1.1)*5*Math.PI)+1)}},Back:{In:function(n){return n===1?1:n*n*((1.70158+1)*n-1.70158)},Out:function(n){return n===0?0:--n*n*((1.70158+1)*n+1.70158)+1},InOut:function(n){const t=2.5949095;return(n*=2)<1?.5*(n*n*((t+1)*n-t)):.5*((n-=2)*n*((t+1)*n+t)+2)}},Bounce:{In:function(n){return 1-I.Bounce.Out(1-n)},Out:function(n){return n<1/2.75?7.5625*n*n:n<2/2.75?7.5625*(n-=1.5/2.75)*n+.75:n<2.5/2.75?7.5625*(n-=2.25/2.75)*n+.9375:7.5625*(n-=2.625/2.75)*n+.984375},InOut:function(n){return n<.5?I.Bounce.In(n*2)*.5:I.Bounce.Out(n*2-1)*.5+.5}},generatePow:function(n=4){return n=n<Number.EPSILON?Number.EPSILON:n,n=n>1e4?1e4:n,{In:function(t){return t**n},Out:function(t){return 1-(1-t)**n},InOut:function(t){return t<.5?(t*2)**n/2:(1-(2-t*2)**n)/2+.5}}},random:function(n){return Math.random()},createStep:function(n){return function(t){return Math.floor(t*n)/n}},createNoisyEasing:function(n,t=.1){const e=1-t;return function(s){return t*Math.random()+e*n(s)}},swing:function(n){return n+Math.sin(n*Math.PI*2)/2},causeSeizures:function(n){return n+.2*Math.random()-.1}};function Un(n){switch(n){case I.Quadratic.In:return I.Quadratic.Out;case I.Quadratic.Out:return I.Quadratic.In;case I.Quadratic.InOut:return I.Quadratic.InOut;case I.Cubic.In:return I.Cubic.Out;case I.Cubic.Out:return I.Cubic.In;case I.Cubic.InOut:return I.Cubic.InOut;case I.Quartic.In:return I.Quartic.Out;case I.Quartic.Out:return I.Quartic.In;case I.Quartic.InOut:return I.Quartic.InOut;case I.Quintic.In:return I.Quintic.Out;case I.Quintic.Out:return I.Quintic.In;case I.Quintic.InOut:return I.Quintic.InOut;case I.Sinusoidal.In:return I.Sinusoidal.Out;case I.Sinusoidal.Out:return I.Sinusoidal.In;case I.Sinusoidal.InOut:return I.Sinusoidal.InOut;case I.Exponential.In:return I.Exponential.Out;case I.Exponential.Out:return I.Exponential.In;case I.Exponential.InOut:return I.Exponential.InOut;case I.Circular.In:return I.Circular.Out;case I.Circular.Out:return I.Circular.In;case I.Circular.InOut:return I.Circular.InOut;case I.Elastic.In:return I.Elastic.Out;case I.Elastic.Out:return I.Elastic.In;case I.Elastic.InOut:return I.Elastic.InOut;case I.Back.In:return I.Back.Out;case I.Back.Out:return I.Back.In;case I.Back.InOut:return I.Back.InOut;case I.Bounce.In:return I.Bounce.Out;case I.Bounce.Out:return I.Bounce.In;case I.Bounce.InOut:return I.Bounce.InOut;default:return n}}const Go=4,Uo=.001,Vo=1e-7,zo=10,ke=11,fs=1/(ke-1),qo=typeof Float32Array=="function";function Vn(n,t){return 1-3*t+3*n}function zn(n,t){return 3*t-6*n}function qn(n){return 3*n}function ms(n,t,e){return((Vn(t,e)*n+zn(t,e))*n+qn(t))*n}function Hn(n,t,e){return 3*Vn(t,e)*n*n+2*zn(t,e)*n+qn(t)}function Ho(n,t,e,s,i){let r,a,o=0;do a=t+(e-t)/2,r=ms(a,s,i)-n,r>0?e=a:t=a;while(Math.abs(r)>Vo&&++o<zo);return a}function jo(n,t,e,s){for(let i=0;i<Go;++i){const r=Hn(t,e,s);if(r===0)return t;const a=ms(t,e,s)-n;t-=a/r}return t}function Wo(n){return n}function ui(n,t,e,s){if(!(0<=n&&n<=1&&0<=e&&e<=1))throw new Error("bezier x values must be in [0, 1] range");if(n===t&&e===s)return Wo;const i=qo?new Float32Array(ke):new Array(ke);for(let a=0;a<ke;++a)i[a]=ms(a*fs,n,e);function r(a){let o=0,h=1;const c=ke-1;for(;h!==c&&i[h]<=a;++h)o+=fs;--h;const l=(a-i[h])/(i[h+1]-i[h]),d=o+l*fs,g=Hn(d,n,e);return g>=Uo?jo(a,d,n,e):g===0?d:Ho(a,o,o+fs,n,e)}return a=>a===0||a===1?a:ms(r(a),t,s)}function di(n){switch(n){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]}}function jn(n){const[t,e,s,i]=di(n);return[1-s,1-i,1-t,1-e]}function $o(n){return ui(...di(n))}function Jo(n){return ui(...jn(n))}const Xt={Utils:{Linear:function(n,t,e){return(t-n)*e+n},Factorial:function(){const n=[1];return function(t){let e=1;if(n[t])return n[t];for(let s=t;s>1;s--)e*=s;return n[t]=e,e}}(),Bernstein:function(n,t){const e=Xt.Utils.Factorial;return e(n)/e(t)/e(n-t)},CatmullRom:function(n,t,e,s,i){const r=(e-n)*.5,a=(s-t)*.5,o=i*i,h=i*o;return(2*t-2*e+r+a)*h+(-3*t+3*e-2*r-a)*o+r*i+t},QuadraticBezier:(n,t,e,s)=>{const i=1-s;return i*i*n+2*i*s*t+s*s*e},CubicBezier:(n,t,e,s,i)=>{const r=1-i;return r*r*r*n+3*r*r*i*t+3*r*i*i*e+i*i*i*s}},Linear:function(n,t){const e=n.length-1,s=e*t,i=Math.floor(s),r=Xt.Utils.Linear;return t<0?r(n[0],n[1],s):t>1?r(n[e],n[e-1],e-s):r(n[i],n[i+1>e?e:i+1],s-i)},Bezier:function(n,t){let e=0;const s=n.length-1,i=Math.pow,r=Xt.Utils.Bernstein;for(let a=0;a<=s;a++)e+=i(1-t,s-a)*i(t,a)*n[a]*r(s,a);return e},CatmullRom:function(n,t){const e=n.length-1;let s=e*t,i=Math.floor(s);const r=Xt.Utils.CatmullRom;return n[0]===n[e]?(t<0&&(i=Math.floor(s=e*(1+t))),r(n[(i-1+e)%e],n[i],n[(i+1)%e],n[(i+2)%e],s-i)):t<0?n[0]-(r(n[0],n[0],n[1],n[1],-s)-n[0]):t>1?n[e]-(r(n[e],n[e],n[e-1],n[e-1],s-e)-n[e]):r(n[i?i-1:0],n[i],n[e<i+1?e:i+1],n[e<i+2?e:i+2],s-i)}};class Wn{_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=$(),e=!1){const s=Object.keys(this._tweens);for(let i=0;i<s.length;i++){const r=this._tweens[s[i]],a=!e;r&&r.update(t,a)===!1&&!e&&delete this._tweens[s[i]]}return!!Object.keys(this._tweens).length}}const bt=new Wn;class fi{constructor(t,e=bt){this._object=t,this._group=e}_id=Ie.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=I.Linear.None;_interpolationFunction=Xt.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=$()){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,s,i){for(const r in s){const a=t[r],o=Array.isArray(a),h=o?"array":typeof a,c=!o&&Array.isArray(s[r]);if(!(h==="undefined"||h==="function")){if(c){let l=s[r];if(l.length===0)continue;l=l.map(this._handleRelativeValue.bind(this,a)),s[r]=[a].concat(l)}if((h==="object"||o)&&a&&!c){e[r]=o?[]:{};for(const l in a)e[r][l]=a[l];i[r]=o?[]:{},this._setupProperties(a,e[r],s[r],i[r])}else typeof e[r]>"u"&&(e[r]=a),o||(e[r]*=1),c?i[r]=s[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=$()){return this._isPaused||!this._isPlaying?this:(this._isPaused=!0,this._pauseStartTime=t,this._group&&this._group.remove(this),this)}resume(t=$()){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=bt){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=I.Linear.None){return this._easingFunction=t,this}interpolation(t=Xt.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=$(),e=!0){if(this._isPaused)return!0;let s,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(s in this._valuesStartRepeat)!this._yoyo&&typeof this._valuesEnd[s]=="string"&&(this._valuesStartRepeat[s]=this._valuesStartRepeat[s]+parseFloat(this._valuesEnd[s])),this._yoyo&&this._swapEndStartRepeatValues(s),this._valuesStart[s]=this._valuesStartRepeat[s];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,h=this._chainedTweens.length;o<h;o++)this._chainedTweens[o].start(this._startTime+this._durationTime);return this._isPlaying=!1,!1}return!0}_updateProperties(t,e,s,i){for(const r in s){if(e[r]===void 0)continue;const a=e[r]||0;let o=s[r];const h=Array.isArray(t[r]),c=Array.isArray(o);!h&&c?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],s=this._valuesEnd[t];typeof s=="string"?this._valuesStartRepeat[t]=this._valuesStartRepeat[t]+parseFloat(s):this._valuesStartRepeat[t]=s,this._valuesEnd[t]=e}}const Zo=Ie.nextId,Ko=bt.getAll.bind(bt),Qo=bt.removeAll.bind(bt),th=bt.add.bind(bt),eh=bt.remove.bind(bt),sh=bt.update.bind(bt),ih={now:$,Sequence:Ie,Easing:I,Interpolation:Xt,Group:Wn,Tween:fi,nextId:Zo,getAll:Ko,removeAll:Qo,add:th,remove:eh,update:sh};class mi{autoStart;startTime;oldTime;elapsedTime;running;constructor(t=!0){this.autoStart=t,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=$(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0}stop(){this.getElapsedTime(),this.running=!1,this.autoStart=!1}getElapsedTime(){return this.getDelta(),this.elapsedTime}getDelta(){let t=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){const e=$();t=e-this.oldTime,this.oldTime=e,this.elapsedTime+=t}return t}}class ps{tweens=[];frameDuration;onGroupStart;onGroupComplete;constructor(t){this.frameDuration=t?.frameDuration||1e3,this.onGroupStart=t?.onGroupStart,this.onGroupComplete=t?.onGroupComplete}get count(){return this.tweens.length}clear(){this.tweens=[]}sort(t=!1){ja(this.tweens,(e,s)=>t?e.delay>s.delay:e.delay<=s.delay)}cloneTweens(t=this.tweens){const e=[];return t.forEach(s=>{const i={...s};delete i.tween,i.fromValues={...i.fromValues},i.toValues={...i.toValues},e.push(i)}),e}addTween(t,e,s){const i={fromValues:t,toValues:e,frames:typeof s?.frames=="number"?s.frames:1,delay:typeof s?.delay=="number"?s.delay:this.tweens.length,easeFunction:s?.easeFunction||I.Linear.None,interpolationFunction:s?.interpolationFunction||Xt.Linear,repeat:typeof s?.repeat=="number"?s.repeat:0,yoyo:s?.yoyo||!1,onStart:s?.onStart||(()=>{}),onUpdate:s?.onUpdate||(()=>{}),onComplete:s?.onComplete||(()=>{})};return this.tweens.push(i),this}cancelRequestAnimationCycle=()=>{};runTweens(t){this.cancelRequestAnimationCycle();const e=new mi,s=this.frameDuration;return new Promise(i=>{this.onGroupStart?.(),this.cancelRequestAnimationCycle=ri(r=>{if(!this.isPaused){const o=Math.max(0,r-this.pausedDuration),h=Math.max(0,e.getElapsedTime()-this.pausedDuration);t.filter(c=>c.delay*s<=h).forEach(c=>{c.tween||(c.tween=new fi({...c.fromValues}).to({...c.toValues},c.frames*s).easing(c.easeFunction).interpolation(c.interpolationFunction).repeat(c.repeat).yoyo(c.yoyo).onStart(c.onStart).onUpdate(c.onUpdate).onComplete(c.onComplete),c.tween.start(o)),(c.delay+c.frames*(c.repeat+1))*s>h?c.tween.update(o):(c.tween.isPlaying()&&c.tween.end(),Ce(t,c))})}const a=!!t.length;return a||(this.onGroupComplete?.(),i()),a})})}isPaused=!1;pausedClock=new mi;pausedDuration=0;play(t=this.cloneTweens(this.tweens)){this.isPaused=!1,this.pausedDuration=0,this.runTweens(t)}reverse(){const t=this.cloneTweens(this.tweens);let e=0;t.forEach(s=>{e=Math.max(e,s.delay+s.frames),s.easeFunction=Un(s.easeFunction);const i={...s.toValues};s.toValues={...s.fromValues},s.fromValues={...i}}),t.forEach(s=>{s.delay=e-s.frames}),this.play(t)}pause(){this.pausedClock.start(),this.isPaused=!0}resume(){this.pausedDuration+=this.pausedClock.getElapsedTime(),this.pausedClock.stop(),this.isPaused=!1}}class U extends Ws{id;originD;originMatrix;independentTransformInGroup;forceCXY=!1;cX;cY;x;y;degree;scalarX;scalarY;diffXInGroup;diffYInGroup;diffDegreeInGroup;diffScalarXInGroup;diffScalarYInGroup;vx;vy;ax;ay;mass;attrs;enableDrag;alongPath;isDragging=!1;isMouseIn=!1;targetToAfterDragFree;followMouse;strokeArmyAnts;strokeArmyAntsOffset=0;strokeDashTotalLength=0;isShow=!0;el;pathd;usePathDtoCanvasContext=!1;parent;shapes=[];constructor(t){if(super(),this.id=Vs(),t?.d&&(this.originD=t?.d),t?.originMatrix&&(this.originMatrix=t.originMatrix),this.independentTransformInGroup=typeof t?.independentTransformInGroup=="boolean"?t.independentTransformInGroup:!1,this.x=t?.x||0,this.y=t?.y||0,this.cX=0,this.cY=0,typeof t?.centerX=="number"&&typeof t?.centerY=="number"&&this.forceSetCXY(t.centerX-this.x,t.centerY-this.y),this.degree=t?.degree||0,this.scalarX=1,this.scalarY=1,t?.scalar!==void 0&&(this.scalarX=t.scalar,this.scalarY=t.scalar),t?.scalarX!==void 0&&(this.scalarX=t.scalarX),t?.scalarY!==void 0&&(this.scalarY=t.scalarY),this.diffXInGroup=t?.diffXInGroup||0,this.diffYInGroup=t?.diffYInGroup||0,this.diffDegreeInGroup=t?.diffDegreeInGroup||0,this.diffScalarXInGroup=t?.diffScalarXInGroup||1,this.diffScalarYInGroup=t?.diffScalarYInGroup||1,this.vx=t?.vx||0,this.vy=t?.vy||0,this.ax=t?.ax||0,this.ay=t?.ay||0,this.mass=t?.mass||1,this.attrs={stroke:"none",fill:"none"},t?.attrs&&this.setAttr(t?.attrs),this.enableDrag=t?.enableDrag||!1,this.alongPath=t?.alongPath,this.targetToAfterDragFree=t?.targetToAfterDragFree,this.followMouse=t?.followMouse||!1,this.isShow=typeof t?.isShow=="boolean"?t?.isShow:!0,this.strokeArmyAnts=t?.strokeArmyAnts||!1,this.strokeArmyAnts){const s=this.getAttr("stroke-dasharray","4 4");this.setAttr("stroke-dasharray",s),this.strokeDashTotalLength=yn(s).reduce((i,r)=>i+r,0)}return Fa(this)}forceSetCXY(t,e){this.cX=t,this.cY=e,this.forceCXY=!0}shapeInit(){}initPathD(){if(!this.pathd){if(this.pathd=new wt,Hs(()=>{this.pathd?.reset(this.originD||this.toSVGPathData(),this.originMatrix)}),this.pathd&&!this.forceCXY){const t=this.shapes.length==0?this.pathd.getBoundingClientRect():this.getBoundingClientRect();t&&(this.pathd.cX=this.cX=t.x+t.width/2-this.pathd.x,this.pathd.cY=this.cY=t.y+t.height/2-this.pathd.y)}this.shapeInit()}return this.pathd}frameStart(t){}frameUpdate(t,e){this.pathd=this.initPathD(),this.pathd.update(this),this.strokeArmyAnts&&(this.isMouseIn||(this.setAttr("stroke-dashoffset",String(this.strokeArmyAntsOffset++)),this.strokeArmyAntsOffset>this.strokeDashTotalLength&&(this.strokeArmyAntsOffset=0)))}frameEnd(t){}toSVGPathData(){return[]}toSVGPathD(){return this.pathd?.toSVGPathD()||""}toCanvasContext(t){this.usePathDtoCanvasContext=!0,this.pathd?.toCanvasContext(t)}getBoundingClientRect(){return this.pathd?.getBoundingClientRect()||null}get center(){const t=this.getBoundingClientRect(),e={x:this.x,y:this.y};return t&&(e.x=t.x+t.width/2,e.y=t.y+t.height/2),e}trim(){if(this.parent)return;const t=this.getBoundingClientRect();if(!t)return;this.shapes.forEach(s=>{const i=s.originMatrix?s.originMatrix.clone():new ct;i.translate(-t.x+s.x,-t.y+s.y),s.originMatrix=i});const e=this.originMatrix?this.originMatrix.clone():new ct;e.translate(-t.x+this.x,-t.y+this.y),this.originMatrix=e}isPointInPath(t,e,s){if(s instanceof ls)return s.isPointInPath(new Path2D(this.toSVGPathD()),t,e);let i;try{i=new SVGPoint(t,e)}catch{i=s.createSVGPoint(),i.x=t,i.y=e}if(this.el instanceof SVGGeometryElement)return this.el.isPointInFill(i);{const r=this.getBoundingClientRect();if(r)return t>=r.x&&t<=r.x+r.width&&e>=r.y&&e<=r.y+r.height}return!1}isPointInStroke(t,e,s){if(s instanceof ls)return s.isPointInStroke(new Path2D(this.toSVGPathD()),t,e);let i;try{i=new SVGPoint(t,e)}catch{i=s.createSVGPoint(),i.x=t,i.y=e}return this.el instanceof SVGGeometryElement?this.el.isPointInStroke(i):!1}clone(){return Ya(this).copy(this)}copy(t){return this.id=t.id,this.originD=t.originD,this.originMatrix=t.originMatrix,this.independentTransformInGroup=t.independentTransformInGroup,this.x=t.x,this.y=t.y,this.cX=t.cX,this.cY=t.cY,this.degree=t.degree,this.scalarX=t.scalarX,this.scalarY=t.scalarY,this.diffXInGroup=t.diffXInGroup,this.diffYInGroup=t.diffYInGroup,this.diffDegreeInGroup=t.diffDegreeInGroup,this.diffScalarXInGroup=t.diffScalarXInGroup,this.diffScalarYInGroup=t.diffScalarYInGroup,this.vx=t.vx,this.vy=t.vy,this.ax=t.ax,this.ay=t.ay,this.mass=t.mass,this.attrs={...t.attrs},this.enableDrag=t.enableDrag,this.alongPath=t.alongPath,this.targetToAfterDragFree=t.targetToAfterDragFree,this.followMouse=t.followMouse,this.isShow=t.isShow,this.strokeArmyAnts=t.strokeArmyAnts,this.strokeDashTotalLength=t.strokeDashTotalLength,this}save(){}restore(){}setAttr(t,e){typeof t!="string"?Object.assign(this.attrs,Object.fromEntries(Object.entries(t).map(([s,i])=>[ft(s),i]))):e&&(this.attrs[ft(t)]=e)}getAttr(t,e){return this.attrs[t]||this.attrs[ft(t)]||e}getAttrs(){return this.attrs}hasAttr(t){return!!this.attrs[t]||!!this.attrs[ft(t)]}distance(t){return as(this.x,this.y,t.x,t.y)}rotateTo(t){this.degree=it(Zt(this.x,this.y,t.x,t.y))}followTo(t,e=3){this.rotateTo(t);const{dx:s,dy:i}=It(O(this.degree),e);this.vx=s,this.vy=i,this.run()}followAccelerationTo(t,e=.05){this.rotateTo(t);const{dx:s,dy:i}=It(O(this.degree),e);this.ax=s,this.ay=i,this.run()}checkCollision(t){}checkWall(t){}gravitateTo(t){const e=t.x-this.x,s=t.y-this.y,i=e*e+s*s,r=Math.sqrt(i),a=this.mass*t.mass/i,o=a*e/r,h=a*s/r;this.vx+=o/this.mass,this.vy+=h/this.mass,t.vx-=o/t.mass,t.vy-=h/t.mass}run(t){this.vx+=this.ax,this.vy+=this.ay;const e=$t(t?.gravity,0);this.vy+=e;const s=$t(t?.friction,1);this.vx*=s,this.vy*=s,this.x+=this.vx,this.y+=this.vy}runEaseTo(t,e){const s=$t(e?.easing,.05),i=t.x-this.cX-this.x,r=t.y-this.cY-this.y;this.vx=i*s,this.vy=r*s,this.run(e)}runSpringTo(t,e){const s=$t(e?.spring,.03);(Array.isArray(t)?t:[t]).forEach(i=>{const r=i.x-this.cX-this.x,a=i.y-this.cY-this.y,o=r*s,h=a*s;this.vx+=o,this.vy+=h}),this.run({friction:.9,...e})}springMassTo(t,e){const s=$t(e?.springLength,100),i=$t(e?.spring,1e-4),r=t.x-this.x,a=t.y-this.y,o=Math.sqrt(r*r+a*a);if(o<s){const h=r*i,c=a*i;return this.vx+=h/this.mass,this.vy+=c/this.mass,t.vx-=h/t.mass,t.vy-=c/t.mass,1-o/s}return 0}getTotalLength(){return this.initPathD().getTotalLength()}interpolate(t){return this.initPathD().interpolate(t)}getPointAtLength(t){return this.initPathD().getPointAtLength(t)}trailPath(t,e=0){const s=this.getTotalLength();return t.originD=this.initPathD().getSubpath(0,e*s),this.getPointAtLength(e*s)}strokeDashTween(t=1e3,e){const s=this.initPathD(),i=At(s.getTotalLength(),0);this.setAttr({strokeDasharray:`${i} ${i}`,strokeDashoffset:`${i}`});const r=e?.onUpdate,a=new ps({frameDuration:t});a.addTween({offset:i},{offset:0},Object.assign(e||{},{onUpdate:(o,h)=>{this.setAttr("strokeDashoffset",""+At(o.offset,2)),r?.(o,h)}})),a.play()}}class Me extends U{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}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()}setVanishingPoint(t,e){this.vpX=t,this.vpY=e}setCenter(t,e,s){this.cX=t,this.cY=e,this.cZ=s}rotateX(t){({x:this.y,y:this.z}=Tt(O(t),this.y,this.z))}rotateY(t){({x:this.x,y:this.z}=Tt(O(t),this.x,this.z))}rotateZ(t){({x:this.x,y:this.y}=Tt(O(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}eq(t){return this.x===t.x&&this.y===t.y&&this.z===t.z&&this.radius===t.radius&&this.mass===t.mass}length(){return rs(this.x,this.y,this.z)}distance(t){const e=t.x-this.x,s=t.y-this.y,i=t.z-this.z;return Math.sqrt(e*e+s*s+i*i)}scalar(t){return this.x*=t,this.y*=t,this.z*=t,this}normalize(t=1){const e=this.length();if(e){const s=t/e;this.scalar(s)}return this}clamp(t){const e=this.length();return e&&e>t&&this.scalar(t/e),this}cross(t){const e=this.x,s=this.y,i=this.z;return{x:s*t.z-i*t.y,y:i*t.x-e*t.z,z:e*t.y-s*t.x}}multiply(t){return{x:this.x*t.x,y:this.y*t.y,z:this.z*t.z}}div(t){return{x:this.x/t.x,y:this.y/t.y,z:this.z/t.z}}add(t){return{x:this.x+t.x,y:this.y+t.y,z:this.z+t.z}}sub(t){return{x:this.x-t.x,y:this.y-t.y,z:this.z-t.z}}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z}reflect(t){const e=this.dot(t);return{x:this.x-2*e*t.x,y:this.y-2*e*t.y,z:this.z-2*e*t.z}}}const $n=[1,0,0,1,0,0],Jn=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];class ct{value;_m13=0;_m23=0;_m33=1;matrix3d;constructor(t=$n){this.value=Array.from(t),this.m13=0,this.m23=0,this.m33=1,this.matrix3d=this.toMatrix3D()}static fromString(t){const e=new ct,s=rn("number",t);return s.length===6&&s.forEach((i,r)=>{i.fullMatch&&(e.value[r]=parseFloat(i.fullMatch))}),e}get m11(){return this.value[0]}get m12(){return this.value[1]}get m13(){return this._m13}get m21(){return this.value[2]}get m22(){return this.value[3]}get m23(){return this._m23}get m31(){return this.value[4]}get m32(){return this.value[5]}get m33(){return this._m33}set m11(t){this.value[0]=t}set m12(t){this.value[1]=t}set m13(t){this._m13=t}set m21(t){this.value[2]=t}set m22(t){this.value[3]=t}set m23(t){this._m23=t}set m31(t){this.value[4]=t}set m32(t){this.value[5]=t}set m33(t){this._m33=t}toMatrix3D(t=this.matrix3d){const e=[this.m11,this.m12,0,this.m13,this.m21,this.m22,0,this.m23,0,0,1,0,this.m31,this.m32,0,this.m33];return t?(t.value=e,t):new pt(e)}identity(){return this.value=Array.from($n),this.m13=0,this.m23=0,this.m33=1,this.matrix3d=this.toMatrix3D(),this}get isIdentity(){return this.m11==1&&this.m12==0&&this.m13==0&&this.m21==0&&this.m22==1&&this.m23==0&&this.m31==0&&this.m32==0&&this.m33==1}scalar(t){return this.m11*=t,this.m12*=t,this.m13*=t,this.m21*=t,this.m22*=t,this.m23*=t,this.m31*=t,this.m32*=t,this.m33*=t,this}normalize(){const t=this.m33||1e-4;return this.scalar(1/t)}transformPoint(t){const e=t.z||1;return{x:t.x*this.m11+t.y*this.m21+e*this.m31,y:t.x*this.m12+t.y*this.m22+e*this.m32,z:t.x*this.m13+t.y*this.m23+e*this.m33}}clone(){return new ct([...this.value])}multiply(t){const e=this.clone(),s=t instanceof ct?t:new ct(t);return this.m11=s.m11*e.m11+s.m12*e.m21+s.m13*e.m31,this.m12=s.m11*e.m12+s.m12*e.m22+s.m13*e.m32,this.m13=s.m11*e.m13+s.m12*e.m23+s.m13*e.m33,this.m21=s.m21*e.m11+s.m22*e.m21+s.m23*e.m31,this.m22=s.m21*e.m12+s.m22*e.m22+s.m23*e.m32,this.m23=s.m21*e.m13+s.m22*e.m23+s.m23*e.m33,this.m31=s.m31*e.m11+s.m32*e.m21+s.m33*e.m31,this.m32=s.m31*e.m12+s.m32*e.m22+s.m33*e.m32,this.m33=s.m31*e.m13+s.m32*e.m23+s.m33*e.m33,this}append(t){return this.multiply(t)}prepend(t){return t.multiply(this),this}inverse(){const t=this.m11,e=this.m12,s=this.m13,i=this.m21,r=this.m22,a=this.m23,o=this.m31,h=this.m32,c=this.m33,l=c*r-a*h,d=-c*i+a*o,g=h*i-r*o;let y=t*l+e*d+s*g;return y?(y=1/y,this.m11=l*y,this.m12=(-c*e+s*h)*y,this.m13=(a*e-s*r)*y,this.m21=d*y,this.m22=(c*t-s*o)*y,this.m23=(-a*t+s*i)*y,this.m31=g*y,this.m32=(-h*t+e*o)*y,this.m33=(r*t-e*i)*y,this):null}adjugate(){const t=new ct;return t.m11=this.m22*this.m33-this.m32*this.m23,t.m12=this.m32*this.m13-this.m12*this.m33,t.m13=this.m12*this.m23-this.m22*this.m13,t.m21=this.m31*this.m23-this.m21*this.m33,t.m22=this.m11*this.m33-this.m31*this.m13,t.m23=this.m21*this.m13-this.m11*this.m23,t.m31=this.m21*this.m32-this.m31*this.m22,t.m32=this.m31*this.m12-this.m11*this.m32,t.m33=this.m11*this.m22-this.m21*this.m12,t}split(){let t=it(Math.atan2(this.m12,this.m11));return this.m11<0&&this.m22>=0&&(t+=180),{x:this.m31,y:this.m32,degree:t,scaleX:Math.sqrt(this.m11*this.m11+this.m12*this.m12),scaleY:Math.sqrt(this.m21*this.m21+this.m22*this.m22),skewX:it(Math.atan2(-this.m21,this.m22)),skewY:it(Math.atan2(this.m12,this.m11))}}getGroupCoords(t){const e=this.value[0],s=this.value[1],i=this.value[2],r=this.value[3],a=this.value[4],o=this.value[5],h=t.value[0],c=t.value[1],l=t.value[2],d=t.value[3],g=t.value[4],y=t.value[5],m=h*d,x=c*l,b=(l*s-e*d)/(x-m),S=(h*s-e*c)/(m-x),C=(l*r-i*d)/(x-m),L=(h*r-i*c)/(m-x),R=(l*(o-y)+d*(g-a))/(x-m),X=(h*(o-y)+c*(g-a))/(m-x),Y=[b,S,C,L,R,X];return new ct(Y)}toString(t=6){return this.matrix3d.is2D()?`matrix(${this.value.map(e=>At(e,t)).join(",")})`:this.matrix3d.toString()}translate(t,e){return this.multiply([1,0,0,1,t,e]),this.toMatrix3D(),this}translateTo(t,e){return this.translate(t-this.m31,e-this.m32)}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.matrix3d.translate(0,0,t),this.matrix3d.toMatrix(this),this}translateZTo(t){return this.translateZ(t-this.matrix3d.m43),this}translate3d(t,e,s){return this.matrix3d.translate(t,e,s),this.matrix3d.toMatrix(this),this}translate3dTo(t,e,s){return this.translate3d(t-this.matrix3d.m41,e-this.matrix3d.m42,s-this.matrix3d.m43),this}rotate(t,e=0,s=0){const i=O(t),r=Math.cos(i),a=Math.sin(i);return this.translate(e,s),this.multiply([r,a,-a,r,0,0]),this.translate(-e,-s),this.toMatrix3D(),this}rotateTo(t,e=0,s=0){const{degree:i}=this.split();return this.rotate(t-i,e,s),this}rotateX(t){return this.matrix3d.rotateX(t),this.matrix3d.toMatrix(this),this}rotateXTo(t){const{degreeX:e}=this.matrix3d.split();return this.rotateX(t-e),this}rotateY(t){return this.matrix3d.rotateY(t),this.matrix3d.toMatrix(this),this}rotateYTo(t){const{degreeY:e}=this.matrix3d.split();return this.rotateY(t-e),this}rotateZ(t){return this.matrix3d.rotateZ(t),this.matrix3d.toMatrix(this),this}rotateZTo(t){const{degreeZ:e}=this.matrix3d.split();return this.rotateZ(t-e),this}rotate3d(t,e,s){return this.matrix3d.rotateX(t).rotateY(e).rotateZ(s),this.matrix3d.toMatrix(this),this}rotate3dTo(t,e,s){const{degreeX:i,degreeY:r,degreeZ:a}=this.matrix3d.split();return this.rotate3d(t-i,e-r,s-a),this}scale(t,e=t,s=0,i=0){return this.translate(s,i),this.multiply([t,0,0,e,0,0]),this.translate(-s,-i),this.toMatrix3D(),this}scaleTo(t,e=t,s=0,i=0){return this.scale(t/this.m11,e/this.m22,s,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.matrix3d.scale(1,1,t),this.matrix3d.toMatrix(this),this}scaleZTo(t){const{scalarZ:e}=this.matrix3d.split();return this.scaleZ(t/e),this}scale3d(t,e=t,s=t){return this.matrix3d.scale(t,e,s),this.matrix3d.toMatrix(this),this}scale3dTo(t,e=t,s=t){const{scalarX:i,scalarY:r,scalarZ:a}=this.matrix3d.split();return this.scale3d(t/i,e/r,s/a),this}skew(t,e=t){return this.multiply([Math.cos(O(e)),Math.sin(O(e)),-Math.sin(O(t)),Math.cos(O(t)),0,0]),this.toMatrix3D(),this}skewTo(t,e=t){const{skewX:s,skewY:i}=this.split();return this.skew(t-s,e-i)}skewX(t){const{skewY:e}=this.split();return this.skew(t,e)}skewXTo(t){const{skewY:e}=this.split();return this.skewTo(t,e)}skewY(t){const{skewX:e}=this.split();return this.skew(e,t)}skewYTo(t){const{skewX:e}=this.split();return this.skewTo(e,t)}skewZ(t){return this}skewZTo(t){return this}skew3d(t,e,s){return this}skew3dTo(t,e,s){return this}perspective(t){return this.matrix3d.perspective(t),this.matrix3d.toMatrix(this),this}}class pt{value;is3dSpecial=!1;constructor(t=Jn){this.value=Array.from(t)}static fromString(t){const e=new pt,s=rn("number",t);return s.length===16&&s.forEach((i,r)=>{i.fullMatch&&(e.value[r]=parseFloat(i.fullMatch))}),e}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]}set m11(t){this.value[0]=t}set m12(t){this.value[1]=t}set m13(t){this.value[2]=t}set m14(t){this.value[3]=t}set m21(t){this.value[4]=t}set m22(t){this.value[5]=t}set m23(t){this.value[6]=t}set m24(t){this.value[7]=t}set m31(t){this.value[8]=t}set m32(t){this.value[9]=t}set m33(t){this.value[10]=t}set m34(t){this.value[11]=t}set m41(t){this.value[12]=t}set m42(t){this.value[13]=t}set m43(t){this.value[14]=t}set m44(t){this.value[15]=t}is2D(){return!this.is3dSpecial&&this.m31==0&&this.m32==0&&this.m33==1&&this.m34==0&&this.m43==0&&this.m44==1}is3D(){return!this.is2D()}identity(){return this.value=Array.from(Jn),this}get isIdentity(){return this.m11==1&&this.m12==0&&this.m13==0&&this.m14==0&&this.m21==0&&this.m22==1&&this.m23==0&&this.m24==0&&this.m31==0&&this.m32==0&&this.m33==1&&this.m34==0&&this.m41==0&&this.m42==0&&this.m43==0&&this.m44==1}clone(){return new pt([...this.value])}scalar(t){return this.m11*=t,this.m12*=t,this.m13*=t,this.m14*=t,this.m21*=t,this.m22*=t,this.m23*=t,this.m24*=t,this.m31*=t,this.m32*=t,this.m33*=t,this.m34*=t,this.m41*=t,this.m42*=t,this.m43*=t,this.m44*=t,this}normalize(){return this.scalar(1/(this.m44||1e-4))}transformPoint(t){const e=t.z||1,s=t.w||1;return{x:t.x*this.m11+t.y*this.m21+e*this.m31+s*this.m41,y:t.x*this.m12+t.y*this.m22+e*this.m32+s*this.m42,z:t.x*this.m13+t.y*this.m23+e*this.m33+s*this.m43,w:t.x*this.m14+t.y*this.m24+e*this.m34+s*this.m44}}toMatrix(t){const{scalarX:e,scalarY:s,skewX:i,skewY:r,x:a,y:o}=this.split(),h=[e,r,i,s,a,o];return t?(t.value=h,t):new ct(h)}flatten(){return this.m31=0,this.m32=0,this.m33=1,this.m34=0,this.m14=0,this.m24=0,this.m43=0,this.m44=1,this}toString(t=6){return`matrix3d(${this.value.map(e=>At(e,t)).join(",")})`}split(){const t=Math.sqrt(this.m11*this.m11+this.m12*this.m12+this.m13*this.m13),e=Math.sqrt(this.m21*this.m21+this.m22*this.m22+this.m23*this.m23),s=Math.sqrt(this.m31*this.m31+this.m32*this.m32+this.m33*this.m33),i=it(V(Math.asin(-this.m13),-1,1));let r=it(Math.atan2(this.m23,this.m33));Math.cos(O(i))===0&&(r=it(Math.atan2(-this.m31,this.m22)));let a=it(Math.atan2(this.m12,this.m11));return this.m11<0&&this.m22>=0&&(a+=180),{x:this.m41,y:this.m42,z:this.m43,scalarX:t,scalarY:e,scalarZ:s,degreeX:r,degreeY:i,degreeZ:a,skewX:it(this.m14),skewY:it(this.m24),skewZ:it(this.m34),skewW:this.m44,perspective:this.m34?-(1/this.m34):0}}inverse(){const t=[],e=this.m11,s=this.m12,i=this.m13,r=this.m14,a=this.m21,o=this.m22,h=this.m23,c=this.m24,l=this.m31,d=this.m32,g=this.m33,y=this.m34,m=this.m41,x=this.m42,b=this.m43,S=this.m44;t[0]=h*y*x-c*g*x+c*d*b-o*y*b-h*d*S+o*g*S,t[1]=r*g*x-i*y*x-r*d*b+s*y*b+i*d*S-s*g*S,t[2]=i*c*x-r*h*x+r*o*b-s*c*b-i*o*S+s*h*S,t[3]=r*h*d-i*c*d-r*o*g+s*c*g+i*o*y-s*h*y;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]=c*g*m-h*y*m-c*l*b+a*y*b+h*l*S-a*g*S,t[5]=i*y*m-r*g*m+r*l*b-e*y*b-i*l*S+e*g*S,t[6]=r*h*m-i*c*m-r*a*b+e*c*b+i*a*S-e*h*S,t[7]=i*c*l-r*h*l+r*a*g-e*c*g-i*a*y+e*h*y,t[8]=o*y*m-c*d*m+c*l*x-a*y*x-o*l*S+a*d*S,t[9]=r*d*m-s*y*m-r*l*x+e*y*x+s*l*S-e*d*S,t[10]=s*c*m-r*o*m+r*a*x-e*c*x-s*a*S+e*o*S,t[11]=r*o*l-s*c*l-r*a*d+e*c*d+s*a*y-e*o*y,t[12]=h*d*m-o*g*m-h*l*x+a*g*x+o*l*b-a*d*b,t[13]=s*g*m-i*d*m+i*l*x-e*g*x-s*l*b+e*d*b,t[14]=i*o*m-s*h*m-i*a*x+e*h*x+s*a*b-e*o*b,t[15]=s*h*l-i*o*l+i*a*d-e*h*d-s*a*g+e*o*g,this.value=t,this.scalar(1/C)}multiply(t){const e=this.clone();return this.m11=t.m11*e.m11+t.m12*e.m21+t.m13*e.m31+t.m14*e.m41,this.m12=t.m11*e.m12+t.m12*e.m22+t.m13*e.m32+t.m14*e.m42,this.m13=t.m11*e.m13+t.m12*e.m23+t.m13*e.m33+t.m14*e.m43,this.m14=t.m11*e.m14+t.m12*e.m24+t.m13*e.m34+t.m14*e.m44,this.m21=t.m21*e.m11+t.m22*e.m21+t.m23*e.m31+t.m24*e.m41,this.m22=t.m21*e.m12+t.m22*e.m22+t.m23*e.m32+t.m24*e.m42,this.m23=t.m21*e.m13+t.m22*e.m23+t.m23*e.m33+t.m24*e.m43,this.m24=t.m21*e.m14+t.m22*e.m24+t.m23*e.m34+t.m24*e.m44,this.m31=t.m31*e.m11+t.m32*e.m21+t.m33*e.m31+t.m34*e.m41,this.m32=t.m31*e.m12+t.m32*e.m22+t.m33*e.m32+t.m34*e.m42,this.m33=t.m31*e.m13+t.m32*e.m23+t.m33*e.m33+t.m34*e.m43,this.m34=t.m31*e.m14+t.m32*e.m24+t.m33*e.m34+t.m34*e.m44,this.m41=t.m41*e.m11+t.m42*e.m21+t.m43*e.m31+t.m44*e.m41,this.m42=t.m41*e.m12+t.m42*e.m22+t.m43*e.m32+t.m44*e.m42,this.m43=t.m41*e.m13+t.m42*e.m23+t.m43*e.m33+t.m44*e.m43,this.m44=t.m41*e.m14+t.m42*e.m24+t.m43*e.m34+t.m44*e.m44,this}translate(t=0,e=0,s=0){return this.multiply(new pt([1,0,0,0,0,1,0,0,0,0,1,0,t,e,s,1]))}scale(t=1,e=1,s=1){return this.multiply(new pt([t,0,0,0,0,e,0,0,0,0,s,0,0,0,0,1]))}rotateX(t){const e=O(t),s=Math.cos(e),i=Math.sin(e);return this.multiply(new pt([1,0,0,0,0,s,i,0,0,-i,s,0,0,0,0,1]))}rotateY(t){const e=O(t),s=Math.cos(e),i=Math.sin(e);return this.multiply(new pt([s,0,-i,0,0,1,0,0,i,0,s,0,0,0,0,1]))}rotateZ(t){this.is3dSpecial=!0;const e=O(t),s=Math.cos(e),i=Math.sin(e);return this.multiply(new pt([s,i,0,0,-i,s,0,0,0,0,1,0,0,0,0,1]))}skew(t=0,e=0,s=0){return this.multiply(new pt([1,0,0,O(t),0,1,0,O(e),0,0,1,O(s),0,0,0,1]))}perspective(t){return this.multiply(new pt([1,0,0,0,0,1,0,0,0,0,1,t?-(1/t):0,0,0,0,1]))}unproject(t){let e=t.x*this.m11+t.y*this.m21+this.m41,s=t.x*this.m12+t.y*this.m22+this.m42,i=t.x*this.m13+t.y*this.m23+this.m43,r=t.x*this.m14+t.y*this.m24+this.m44,a=e+this.m31,o=s+this.m32,h=i+this.m33,c=r+this.m34;r==0&&(r=1e-4),e/=r,s/=r,i/=r,c==0&&(c=1e-4),a/=c,o/=c,h/=c;const l=h-i;if(l==0)return{x:e,y:s,z:i,mass:r};const d=-i/l;return e+=d*(a-e),s+=d*(o-s),{x:e,y:s,z:i,mass:r}}project(t){const e=t.z;let s=t.x*this.m11+t.y*this.m21+e*this.m31+this.m41,i=t.x*this.m12+t.y*this.m22+e*this.m32+this.m42,r=t.x*this.m14+t.y*this.m24+e*this.m34+this.m44;return r==0&&(r=1e-4),s/=r,i/=r,r<0&&(s-=this.m41,i-=this.m42,s*=1/r,i*=1/r,s+=this.m41,i+=this.m42),{x:s,y:i,z:e,mass:r}}bounds(t,e,s,i){const r=new Me({x:t,y:e}),a=new Me({x:t+s,y:e}),o=new Me({x:t+s,y:e+i}),h=new Me({x:t,y:e+i});({x:r.x,y:r.y,z:r.z,mass:r.mass}=this.project(r)),{x:a.x,y:a.y,z:a.z,mass:a.mass}=this.project(a),{x:o.x,y:o.y,z:o.z,mass:o.mass}=this.project(o),{x:h.x,y:h.y,z:h.z,mass:h.mass}=this.project(h);const c=Math.min(r.x,a.x,o.x,h.x),l=Math.min(r.y,a.y,o.y,h.y),d=Math.max(r.x,a.x,o.x,h.x)-c,g=Math.max(r.y,a.y,o.y,h.y)-l;return{x:c,y:l,width:d,height:g}}}function pi(n){const t=new ct;return n.replace(/([a-z0-9]+)\s*\(?\s*((-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)*[a-z%]*\s*,?\s*)+)\)?/gi,function(e,s,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(s.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 pt(r)),t.matrix3d.toMatrix(t);break}return""}),t}function Tt(n,t,e){const s=new ct;return s.rotate(it(n)),s.transformPoint({x:t,y:e})}function gi(n){const t=typeof n?.x=="number"?n?.x:0,e=typeof n?.y=="number"?n?.y:0,s=typeof n?.degree=="number"?n?.degree:0,i=typeof n?.scalarX=="number"?n?.scalarX:1,r=typeof n?.scalarY=="number"?n?.scalarY:1,a=O(s),o=Math.cos(a),h=Math.sin(a),c=new DOMMatrix([o*i,h*i,-h*r,o*r,t,e]);return c.multiplySelf(new DOMMatrix(n?.originMatrix||"")),c}function nh(n,t){const e=new Path2D(n),s=new Path2D;return s.addPath(e,gi(t)),s}function Zn(n,t){const e={x:t.m11,y:t.m12,z:t.m13},s={x:t.m21,y:t.m22,z:t.m23},i={x:t.m31,y:t.m32,z:t.m33},r=n.transformPoint(e),a=n.transformPoint(s),o=n.transformPoint(i),h=new ct;return h.m11=r.x,h.m12=r.y,h.m13=r.z,h.m21=a.x,h.m22=a.y,h.m23=a.z,h.m31=o.x,h.m32=o.y,h.m33=o.z,h}function Kn(n,t){const e={x:t.m11,y:t.m12,z:t.m13,w:t.m14},s={x:t.m21,y:t.m22,z:t.m23,w:t.m24},i={x:t.m31,y:t.m32,z:t.m33,w:t.m34},r={x:t.m41,y:t.m42,z:t.m43,w:t.m44},a=n.transformPoint(e),o=n.transformPoint(s),h=n.transformPoint(i),c=n.transformPoint(r);return new pt([a.x,a.y,a.z,a.w,o.x,o.y,o.z,o.w,h.x,h.y,h.z,h.w,c.x,c.y,c.z,c.w])}function rh(n){let t=n[0];for(let e=1,s=n.length;e<s;e++)t=Zn(t,n[e]);return t}function ah(n){let t=n[0];for(let e=1,s=n.length;e<s;e++)t=Kn(t,n[e]);return t}class A{static createElementNS(t){return document.createElementNS("http://www.w3.org/1999/xhtml",t)}static isActive(t){return t===document.activeElement&&(t.type||t.href)}static isTouchEnabled(){return"ontouchstart"in window||"ontouchend"in document||navigator.maxTouchPoints>0}static origins=new Je;static updates=new Je;static patchDom=()=>{this.origins.filter((t,e)=>{const s=this.updates.get(t);return s&&ss(e,s),this.updates.delete(t),!1})};static getVNode(t,e){let s=t.getAttribute("id")||"";s||(s=e||Vs(),t.setAttribute("id",s)),this.origins.get(s)||this.origins.set(s,Jt(t.tagName,{},[],t));const i=this.updates.get(s)||Jt(t.tagName,{},[],t);return{vnode:i,immediate:()=>{this.updates.set(s,i),A.patchDom()},schedule:()=>{this.updates.set(s,i),ci("FLUSH_DOM_ACTIONS",A.patchDom,50)}}}static getElement(t){const e=t.style?t.ownerDocument:t.document||t;return{el:t,document:e,window:e.defaultView,isRootNode:/(html|body)/i.test(t.tagName)||t===document}}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 s=A.getStyle(t.parentElement,"position");A.setStyle(t.parentElement,{position:s=="static"?"relative":s,perspective:e})}A.setStyle(t,{"transform-style":"preserve-3d"})}static convertAttrs(t,e,s={}){Object.prototype.hasOwnProperty.call(s,"transform")||Object.assign(s,{transform:A.getStyle(t,"transform")||""});const i=pi(s.transform),r={};for(const 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;case"perspective":i.perspective(o||0);break;default:Object.prototype.hasOwnProperty.call(s,a)||(s[a]=A.getStyle(t,a)),Object.assign(r,{[a]:`${o}`});break}}return Object.assign(r,{transform:i.toString()}),r}static attrsToCanvas(t,e){for(const s in e){const i=e[s];switch(s){case"fill":i!=="none"&&(t.fillStyle=i);break;case"stroke":i!=="none"&&(t.strokeStyle=i);break;case"stroke-width":case"strokeWidth":t.lineWidth=Number(i);break;case"stroke-linecap":case"strokeLinecap":t.lineCap=i;break;case"stroke-linejoin":case"strokeLinejoin":switch(i){case"round":case"bevel":case"miter":t.lineJoin=i;break;default:t.lineJoin="miter";break}break;case"stroke-miterlimit":case"strokeMiterlimit":t.miterLimit=Number(i);break;case"stroke-opacity":case"strokeOpacity":break;case"stroke-dashoffset":case"strokeDashoffset":t.lineDashOffset=Number(i);break;case"stroke-dasharray":case"strokeDasharray":typeof i=="string"&&t.setLineDash(i.split(/\s+/).map(r=>Number(r)));break;case"cursor":break;case"font":typeof i=="string"&&(t.font=i);break;case"font-size":case"fontSize":t.font+=` ${i}`;break;case"font-family":case"fontFamily":t.font+=` ${i}`;break;case"font-weight":case"fontWeight":break;case"font-style":case"fontStyle":break;case"text-anchor":case"textAnchor":switch(i){case"middle":t.textAlign="center";break;case"end":t.textAlign="end";break;case"start":t.textAlign="start";break}break;case"alignment-baseline":case"alignmentBaseline":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,s){const i=t;if(getComputedStyle)if(e){e=ft(e);const r=getComputedStyle(i,s).getPropertyPriority(e);return getComputedStyle(i,s).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(h=>h.trim()))||[])}else if(t.currentStyle){if(e)return e=on(e),t.currentStyle[e];{const r=[],a=i.currentStyle;for(const 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(h=>h.trim()))||[])}}}static setStyle(t,e,s){typeof e=="string"&&s?t.style.setProperty(ft(e),s.replace(/!important/i,""),String(s).toLowerCase().includes("!important")?"important":""):e instanceof Object&&Object.keys(e).forEach(i=>{t.style.setProperty(ft(i),String(e[i]).replace(/!important/i,""),String(e[i]).toLowerCase().includes("!important")?"important":"")})}static injectStyle(t,e){let s;if(typeof e=="string"){const r=document.querySelector(e)?.shadowRoot;r?s=r:s=document.querySelector(e)}else s=e||document.getElementsByTagName("head")[0];const i=document.createElement("style");if(i.innerHTML=t,s)return s.appendChild(i),()=>{(s instanceof HTMLElement||s instanceof ShadowRoot)&&s.removeChild(i)};{const r=document.styleSheets[0].insertRule(t);return()=>{document.styleSheets[0].deleteRule(r)}}}static loadLink(t,e=()=>{},s=(i,r,a,o,h)=>{}){const i=document.createElement("link");i.type="text/css",i.rel="stylesheet",i.href=t,i.onload=e,i.onerror=s,document.getElementsByTagName("head")[0].appendChild(i)}static loadScript(t,e=()=>{},s=(i,r,a,o,h)=>{}){const i=document.createElement("script");i.type="text/javascript",i.src=t,i.async=!1,i.onload=e,i.onerror=s,document.body.appendChild(i)}static waitForStyleSheetsLoaded(){return new Promise(t=>{const e=Array.from(document.querySelectorAll("link[rel=stylesheet]"));let s=document.styleSheets.length||0;const i=()=>s>=e.length?(t(),!0):!1;i()||e.forEach(r=>{r.onload=()=>{s+=1,i()}})})}static toggleClass(t,e,s="toggle"){if(t.classList)e.split(/[,\s]+/).forEach(i=>{const r=i.trim();r!==""&&t.classList[s](r)});else{const i=t.className.split(/ +/);let r=!1;e.split(/[,\s]+/).forEach(a=>{const o=a.trim();if(o!==""){const h=i.indexOf(o);switch(s){case"add":h===-1&&(i.push(o),r=!0);break;case"remove":h!==-1&&(i.splice(h,1),r=!0);break;case"toggle":h===-1?i.push(o):i.splice(h,1),r=!0;break}}}),r&&t.setAttribute("class",i.join(" ").replace(/^\s+/,"").replace(/\s+$/,""))}}static addClass(t,e){this.toggleClass(t,e,"add")}static removeClass(t,e){this.toggleClass(t,e,"remove")}static hasClass(t,e){return new RegExp("(?:^|\\s+)"+e+"(?:\\s+|$)").test(t.className)||!1}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){t.style.setProperty("display",t instanceof HTMLTableRowElement?"table-row":t instanceof HTMLTableCellElement?"table-cell":"block")}static hide(t){t.style.setProperty("display","none")}static attribute(t,e,s){let i={};if(e===void 0&&s===void 0){for(let o=0,h=t.attributes,c=h.length;o<c;o++){const l=h[o];l.nodeName&&l.nodeValue&&(i[l.nodeName]=l.nodeValue)}return i}if(typeof e=="string"&&s===void 0)return t.getAttribute(ft(e));typeof e=="object"?i=e:typeof e=="string"&&s!==void 0&&(i[e]=s);const{vnode:r,schedule:a}=this.getVNode(t,i.id);Object.entries(i).forEach(([o,h])=>{r.props[ft(o)]=h}),a()}static removeAttribute(t,e){e.split(/[,\s]+/).forEach(s=>{s.trim()!=""&&t.removeAttribute(s.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,s){if(s===void 0&&typeof e=="string")return t[e];{let i={};typeof e=="object"?i=e:typeof e=="string"&&s!==void 0&&(i[e]=s),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(s=>{s.trim()!=""&&delete t[this.fixProp(s.trim())]})}static data(t,e,s){if(typeof e=="string"&&(e=on(e)),(typeof e=="string"||e===void 0)&&s===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]=s),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(s=>{s.trim()!=""&&delete t.dataset[s.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 bind(t,e,s,i=!1){t.addEventListener&&t.addEventListener(e,s,i)}static unbind(t,e,s,i=!1){t.removeEventListener&&t.removeEventListener(e,s,i)}static MouseEvents=["click","dblclick","mousedown","mouseup","mousemove","mouseover","mouseout"];static KeyboardEvents=["keydown","keyup","keypress"];static TouchEvents=["touchstart","touchend","touchcancel","touchmove"];static DragEvents=["dragstart","dragend","dragenter","dragover"];static Events=["change"];static fakeEvent(t,e,s){let i;A.MouseEvents.includes(e)?i=new MouseEvent(e,s):A.KeyboardEvents.includes(e)?i=new KeyboardEvent(e,s):A.TouchEvents.includes(e)?i=new TouchEvent(e,s):A.DragEvents.includes(e)?i=new DragEvent(e,s):A.Events.includes(e)?i=new Event(e,s):i=new CustomEvent(e,s),(t||i.target)?.dispatchEvent(i)}static fireEvent(t,e,s){t.dispatchEvent(new CustomEvent(e,{bubbles:!0,detail:s}))}static scriptConvert(t){const e=s=>{const r=s.ownerDocument.createElement("script");r.text=s.text;const a=s.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(s=>{s.parentNode?.replaceChild(e(s),s)}),t}static insert(t,e,s="append"){return typeof e=="string"?t[s](this.fragment(e)):(e instanceof HTMLElement||e instanceof SVGElement)&&t[s](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 fragment(t){const e=document.createElement("template");return e.innerHTML=t,e.content.childNodes.forEach(s=>{const i=this.scriptConvert(s);i!=s&&e.content.replaceChild(i,s)}),e.content}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 contains(t,e){return t.contains?t!=e&&t.contains(e):!!(t.compareDocumentPosition(e)&16)}static changeSelectSelected(t,e){if(t instanceof HTMLSelectElement){const s=t.options;for(let i=0,r=s.length;i<r;i++)s[i].value==e?s[i].selected=!0:s[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 s;return t.charAt(0)=="#"?t.charAt(1).toLowerCase()=="x"?s=parseInt(t.substring(2),16):s=parseInt(t.substring(1),10):s=e[t],s?String.fromCharCode(s):"&"+t}static runInSafe(t){const e=new Proxy(window,{get(s,i,r){if(typeof i=="string"&&["open","location","document"].includes(i))throw new Error(`禁止访问 key: ${i}`);return i==="window"?e:Reflect.get(s,i,r)},set(s,i,r,a){return Reflect.set(s,i,r,a)}});new Function("window",`with(window) { ${t} }`)(e,null)}static dom=new Proxy({},{get(t,e){return function(s={},...i){const r=document.createElement(e);for(const a of Object.keys(s))r.setAttribute(a,s[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 s={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};for(const n in s)Object.prototype.hasOwnProperty.call(s,n)&&(t=t.replace(new RegExp(e=="encode"?n:s[n],"g"),e=="encode"?s[n]:n));return t}static getInnerText=t=>{let e=t.innerText;if(!e){const s=t.querySelector("slot")?.assignedNodes()||[];let n=0;for(;!e&&n<=s.length-1;)"innerText"in s[n]&&(e=s[n].innerText),n++}return e};static copyToClipboard=t=>new Promise((e,s)=>{if(navigator.clipboard)navigator.clipboard.writeText(t).then(e).catch(s);else{const n=document.createElement("textarea");n.value=t,n.style.opacity="0",n.style.top="0",n.style.left="0",n.style.position="fixed",document.body.appendChild(n),n.focus(),n.select();try{document.execCommand("copy")?e():s()}catch(r){s(r)}document.body.removeChild(n)}});static scrollTo=(t,e)=>window.scrollTo(t,e);static getLocation(){return new Promise((t,e)=>{navigator.geolocation?navigator.geolocation.getCurrentPosition(s=>{t(s.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 s=document.createElement("iframe");s.src=e,document.body.append(s),setTimeout(function(){s.contentWindow?.postMessage(t,e)},4e3),setTimeout(function(){s.remove()},6e3)}static measureText=(t,e=12,s=400)=>{const n=document.createElement("span");n.style.visibility="hidden",n.style.margin="0",n.style.padding="0",n.style.inset="0",n.style.whiteSpace="nowrap",n.style.overflow="visible",n.style.fontSize=e+"px",n.style.fontWeight=s.toString(),n.innerText=t,document.body.appendChild(n);const r=n.offsetWidth,a=n.offsetHeight;return document.body.removeChild(n),{width:r,height:a}};static getFixedWidthText=(t,e,s=12,n=400,r=!0)=>{let a="";if(!t||e<s)return a;const o=t.split(""),h="...";let c=r?I.measureText(h,s,n).width:0;for(let l=0,d=o.length;l<d;l++)if(c+=I.measureText(o[l],s,n).width,c>e){r&&(a+=h);break}else a+=o[l];return a};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}}}function ph(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}var Kn={exports:{}};/*! Hammer.JS - v2.0.7 - 2016-04-22
18
+ })`}static escape(t,e="encode"){const s={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};for(const i in s)Object.prototype.hasOwnProperty.call(s,i)&&(t=t.replace(new RegExp(e=="encode"?i:s[i],"g"),e=="encode"?s[i]:i));return t}static getInnerText=t=>{let e=t.innerText;if(!e){const s=t.querySelector("slot")?.assignedNodes()||[];let i=0;for(;!e&&i<=s.length-1;)"innerText"in s[i]&&(e=s[i].innerText),i++}return e};static copyToClipboard=t=>new Promise((e,s)=>{if(navigator.clipboard)navigator.clipboard.writeText(t).then(e).catch(s);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():s()}catch(r){s(r)}document.body.removeChild(i)}});static scrollTo=(t,e)=>window.scrollTo(t,e);static getLocation(){return new Promise((t,e)=>{navigator.geolocation?navigator.geolocation.getCurrentPosition(s=>{t(s.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 s=document.createElement("iframe");s.src=e,document.body.append(s),setTimeout(function(){s.contentWindow?.postMessage(t,e)},4e3),setTimeout(function(){s.remove()},6e3)}static measureText=(t,e=12,s=400)=>{const i=document.createElement("span");i.style.visibility="hidden",i.style.margin="0",i.style.padding="0",i.style.inset="0",i.style.whiteSpace="nowrap",i.style.overflow="visible",i.style.fontSize=e+"px",i.style.fontWeight=s.toString(),i.innerText=t,document.body.appendChild(i);const r=i.offsetWidth,a=i.offsetHeight;return document.body.removeChild(i),{width:r,height:a}};static getFixedWidthText=(t,e,s=12,i=400,r=!0)=>{let a="";if(!t||e<s)return a;const o=t.split(""),h="...";let c=r?A.measureText(h,s,i).width:0;for(let l=0,d=o.length;l<d;l++)if(c+=A.measureText(o[l],s,i).width,c>e){r&&(a+=h);break}else a+=o[l];return a};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}}}function oh(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Qn={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
- * Licensed under the MIT license */(function(i){(function(t,e,s,n){var r=["","webkit","Moz","MS","ms","o"],a=e.createElement("div"),o="function",h=Math.round,c=Math.abs,l=Date.now;function d(u,f,w){return setTimeout(L(u,w),f)}function g(u,f,w){return Array.isArray(u)?(y(u,w[f],w),!0):!1}function y(u,f,w){var v;if(u)if(u.forEach)u.forEach(f,w);else if(u.length!==n)for(v=0;v<u.length;)f.call(w,u[v],v,u),v++;else for(v in u)u.hasOwnProperty(v)&&f.call(w,u[v],v,u)}function p(u,f,w){var v="DEPRECATED METHOD: "+f+`
22
+ * Licensed under the MIT license */(function(n){(function(t,e,s,i){var r=["","webkit","Moz","MS","ms","o"],a=e.createElement("div"),o="function",h=Math.round,c=Math.abs,l=Date.now;function d(u,f,w){return setTimeout(L(u,w),f)}function g(u,f,w){return Array.isArray(u)?(y(u,w[f],w),!0):!1}function y(u,f,w){var v;if(u)if(u.forEach)u.forEach(f,w);else if(u.length!==i)for(v=0;v<u.length;)f.call(w,u[v],v,u),v++;else for(v in u)u.hasOwnProperty(v)&&f.call(w,u[v],v,u)}function m(u,f,w){var v="DEPRECATED METHOD: "+f+`
23
23
  `+w+` AT
24
- `;return function(){var M=new Error("get-stack-trace"),k=M&&M.stack?M.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",F=t.console&&(t.console.warn||t.console.log);return F&&F.call(t.console,v,k),u.apply(this,arguments)}}var x;typeof Object.assign!="function"?x=function(f){if(f===n||f===null)throw new TypeError("Cannot convert undefined or null to object");for(var w=Object(f),v=1;v<arguments.length;v++){var M=arguments[v];if(M!==n&&M!==null)for(var k in M)M.hasOwnProperty(k)&&(w[k]=M[k])}return w}:x=Object.assign;var b=p(function(f,w,v){for(var M=Object.keys(w),k=0;k<M.length;)(!v||v&&f[M[k]]===n)&&(f[M[k]]=w[M[k]]),k++;return f},"extend","Use `assign`."),S=p(function(f,w){return b(f,w,!0)},"merge","Use `assign`.");function C(u,f,w){var v=f.prototype,M;M=u.prototype=Object.create(v),M.constructor=u,M._super=v,w&&x(M,w)}function L(u,f){return function(){return u.apply(f,arguments)}}function R(u,f){return typeof u==o?u.apply(f&&f[0]||n,f):u}function Y(u,f){return u===n?f:u}function X(u,f,w){y($(f),function(v){u.addEventListener(v,w,!1)})}function V(u,f,w){y($(f),function(v){u.removeEventListener(v,w,!1)})}function it(u,f){for(;u;){if(u==f)return!0;u=u.parentNode}return!1}function W(u,f){return u.indexOf(f)>-1}function $(u){return u.trim().split(/\s+/g)}function z(u,f,w){if(u.indexOf&&!w)return u.indexOf(f);for(var v=0;v<u.length;){if(w&&u[v][w]==f||!w&&u[v]===f)return v;v++}return-1}function nt(u){return Array.prototype.slice.call(u,0)}function bt(u,f,w){for(var v=[],M=[],k=0;k<u.length;){var F=f?u[k][f]:u[k];z(M,F)<0&&v.push(u[k]),M[k]=F,k++}return w&&(f?v=v.sort(function(K,ht){return K[f]>ht[f]}):v=v.sort()),v}function dt(u,f){for(var w,v,M=f[0].toUpperCase()+f.slice(1),k=0;k<r.length;){if(w=r[k],v=w?w+M:f,v in u)return v;k++}return n}var be=1;function ie(){return be++}function le(u){var f=u.ownerDocument||u;return f.defaultView||f.parentWindow||t}var ve=/mobile|tablet|ip(ad|hone|od)|android/i,_="ontouchstart"in t,A=dt(t,"PointerEvent")!==n,N=_&&ve.test(navigator.userAgent),P="touch",vt="pen",ne="mouse",dd="kinect",fd=25,ot=1,ue=2,H=4,ft=8,_s=1,Ve=2,ze=4,qe=8,He=16,_t=Ve|ze,de=qe|He,ma=_t|de,pa=["x","y"],Ls=["clientX","clientY"];function St(u,f){var w=this;this.manager=u,this.callback=f,this.element=u.element,this.target=u.options.inputTarget,this.domHandler=function(v){R(u.options.enable,[u])&&w.handler(v)},this.init()}St.prototype={handler:function(){},init:function(){this.evEl&&X(this.element,this.evEl,this.domHandler),this.evTarget&&X(this.target,this.evTarget,this.domHandler),this.evWin&&X(le(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&V(this.element,this.evEl,this.domHandler),this.evTarget&&V(this.target,this.evTarget,this.domHandler),this.evWin&&V(le(this.element),this.evWin,this.domHandler)}};function md(u){var f,w=u.options.inputClass;return w?f=w:A?f=Hi:N?f=Ns:_?f=ji:f=Os,new f(u,pd)}function pd(u,f,w){var v=w.pointers.length,M=w.changedPointers.length,k=f&ot&&v-M===0,F=f&(H|ft)&&v-M===0;w.isFirst=!!k,w.isFinal=!!F,k&&(u.session={}),w.eventType=f,gd(u,w),u.emit("hammer.input",w),u.recognize(w),u.session.prevInput=w}function gd(u,f){var w=u.session,v=f.pointers,M=v.length;w.firstInput||(w.firstInput=ga(f)),M>1&&!w.firstMultiple?w.firstMultiple=ga(f):M===1&&(w.firstMultiple=!1);var k=w.firstInput,F=w.firstMultiple,Z=F?F.center:k.center,K=f.center=ya(v);f.timeStamp=l(),f.deltaTime=f.timeStamp-k.timeStamp,f.angle=qi(Z,K),f.distance=Rs(Z,K),yd(w,f),f.offsetDirection=xa(f.deltaX,f.deltaY);var ht=wa(f.deltaTime,f.deltaX,f.deltaY);f.overallVelocityX=ht.x,f.overallVelocityY=ht.y,f.overallVelocity=c(ht.x)>c(ht.y)?ht.x:ht.y,f.scale=F?bd(F.pointers,v):1,f.rotation=F?xd(F.pointers,v):0,f.maxPointers=w.prevInput?f.pointers.length>w.prevInput.maxPointers?f.pointers.length:w.prevInput.maxPointers:f.pointers.length,wd(w,f);var Rt=u.element;it(f.srcEvent.target,Rt)&&(Rt=f.srcEvent.target),f.target=Rt}function yd(u,f){var w=f.center,v=u.offsetDelta||{},M=u.prevDelta||{},k=u.prevInput||{};(f.eventType===ot||k.eventType===H)&&(M=u.prevDelta={x:k.deltaX||0,y:k.deltaY||0},v=u.offsetDelta={x:w.x,y:w.y}),f.deltaX=M.x+(w.x-v.x),f.deltaY=M.y+(w.y-v.y)}function wd(u,f){var w=u.lastInterval||f,v=f.timeStamp-w.timeStamp,M,k,F,Z;if(f.eventType!=ft&&(v>fd||w.velocity===n)){var K=f.deltaX-w.deltaX,ht=f.deltaY-w.deltaY,Rt=wa(v,K,ht);k=Rt.x,F=Rt.y,M=c(Rt.x)>c(Rt.y)?Rt.x:Rt.y,Z=xa(K,ht),u.lastInterval=f}else M=w.velocity,k=w.velocityX,F=w.velocityY,Z=w.direction;f.velocity=M,f.velocityX=k,f.velocityY=F,f.direction=Z}function ga(u){for(var f=[],w=0;w<u.pointers.length;)f[w]={clientX:h(u.pointers[w].clientX),clientY:h(u.pointers[w].clientY)},w++;return{timeStamp:l(),pointers:f,center:ya(f),deltaX:u.deltaX,deltaY:u.deltaY}}function ya(u){var f=u.length;if(f===1)return{x:h(u[0].clientX),y:h(u[0].clientY)};for(var w=0,v=0,M=0;M<f;)w+=u[M].clientX,v+=u[M].clientY,M++;return{x:h(w/f),y:h(v/f)}}function wa(u,f,w){return{x:f/u||0,y:w/u||0}}function xa(u,f){return u===f?_s:c(u)>=c(f)?u<0?Ve:ze:f<0?qe:He}function Rs(u,f,w){w||(w=pa);var v=f[w[0]]-u[w[0]],M=f[w[1]]-u[w[1]];return Math.sqrt(v*v+M*M)}function qi(u,f,w){w||(w=pa);var v=f[w[0]]-u[w[0]],M=f[w[1]]-u[w[1]];return Math.atan2(M,v)*180/Math.PI}function xd(u,f){return qi(f[1],f[0],Ls)+qi(u[1],u[0],Ls)}function bd(u,f){return Rs(f[0],f[1],Ls)/Rs(u[0],u[1],Ls)}var vd={mousedown:ot,mousemove:ue,mouseup:H},Sd="mousedown",Cd="mousemove mouseup";function Os(){this.evEl=Sd,this.evWin=Cd,this.pressed=!1,St.apply(this,arguments)}C(Os,St,{handler:function(f){var w=vd[f.type];w&ot&&f.button===0&&(this.pressed=!0),w&ue&&f.which!==1&&(w=H),this.pressed&&(w&H&&(this.pressed=!1),this.callback(this.manager,w,{pointers:[f],changedPointers:[f],pointerType:ne,srcEvent:f}))}});var Ed={pointerdown:ot,pointermove:ue,pointerup:H,pointercancel:ft,pointerout:ft},Td={2:P,3:vt,4:ne,5:dd},ba="pointerdown",va="pointermove pointerup pointercancel";t.MSPointerEvent&&!t.PointerEvent&&(ba="MSPointerDown",va="MSPointerMove MSPointerUp MSPointerCancel");function Hi(){this.evEl=ba,this.evWin=va,St.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}C(Hi,St,{handler:function(f){var w=this.store,v=!1,M=f.type.toLowerCase().replace("ms",""),k=Ed[M],F=Td[f.pointerType]||f.pointerType,Z=F==P,K=z(w,f.pointerId,"pointerId");k&ot&&(f.button===0||Z)?K<0&&(w.push(f),K=w.length-1):k&(H|ft)&&(v=!0),!(K<0)&&(w[K]=f,this.callback(this.manager,k,{pointers:w,changedPointers:[f],pointerType:F,srcEvent:f}),v&&w.splice(K,1))}});var Pd={touchstart:ot,touchmove:ue,touchend:H,touchcancel:ft},Md="touchstart",Ad="touchstart touchmove touchend touchcancel";function Sa(){this.evTarget=Md,this.evWin=Ad,this.started=!1,St.apply(this,arguments)}C(Sa,St,{handler:function(f){var w=Pd[f.type];if(w===ot&&(this.started=!0),!!this.started){var v=Id.call(this,f,w);w&(H|ft)&&v[0].length-v[1].length===0&&(this.started=!1),this.callback(this.manager,w,{pointers:v[0],changedPointers:v[1],pointerType:P,srcEvent:f})}}});function Id(u,f){var w=nt(u.touches),v=nt(u.changedTouches);return f&(H|ft)&&(w=bt(w.concat(v),"identifier",!0)),[w,v]}var Dd={touchstart:ot,touchmove:ue,touchend:H,touchcancel:ft},kd="touchstart touchmove touchend touchcancel";function Ns(){this.evTarget=kd,this.targetIds={},St.apply(this,arguments)}C(Ns,St,{handler:function(f){var w=Dd[f.type],v=_d.call(this,f,w);v&&this.callback(this.manager,w,{pointers:v[0],changedPointers:v[1],pointerType:P,srcEvent:f})}});function _d(u,f){var w=nt(u.touches),v=this.targetIds;if(f&(ot|ue)&&w.length===1)return v[w[0].identifier]=!0,[w,w];var M,k,F=nt(u.changedTouches),Z=[],K=this.target;if(k=w.filter(function(ht){return it(ht.target,K)}),f===ot)for(M=0;M<k.length;)v[k[M].identifier]=!0,M++;for(M=0;M<F.length;)v[F[M].identifier]&&Z.push(F[M]),f&(H|ft)&&delete v[F[M].identifier],M++;if(Z.length)return[bt(k.concat(Z),"identifier",!0),Z]}var Ld=2500,Ca=25;function ji(){St.apply(this,arguments);var u=L(this.handler,this);this.touch=new Ns(this.manager,u),this.mouse=new Os(this.manager,u),this.primaryTouch=null,this.lastTouches=[]}C(ji,St,{handler:function(f,w,v){var M=v.pointerType==P,k=v.pointerType==ne;if(!(k&&v.sourceCapabilities&&v.sourceCapabilities.firesTouchEvents)){if(M)Rd.call(this,w,v);else if(k&&Od.call(this,v))return;this.callback(f,w,v)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});function Rd(u,f){u&ot?(this.primaryTouch=f.changedPointers[0].identifier,Ea.call(this,f)):u&(H|ft)&&Ea.call(this,f)}function Ea(u){var f=u.changedPointers[0];if(f.identifier===this.primaryTouch){var w={x:f.clientX,y:f.clientY};this.lastTouches.push(w);var v=this.lastTouches,M=function(){var k=v.indexOf(w);k>-1&&v.splice(k,1)};setTimeout(M,Ld)}}function Od(u){for(var f=u.srcEvent.clientX,w=u.srcEvent.clientY,v=0;v<this.lastTouches.length;v++){var M=this.lastTouches[v],k=Math.abs(f-M.x),F=Math.abs(w-M.y);if(k<=Ca&&F<=Ca)return!0}return!1}var Ta=dt(a.style,"touchAction"),Pa=Ta!==n,Ma="compute",Aa="auto",Wi="manipulation",fe="none",je="pan-x",We="pan-y",Fs=Fd();function $i(u,f){this.manager=u,this.set(f)}$i.prototype={set:function(u){u==Ma&&(u=this.compute()),Pa&&this.manager.element.style&&Fs[u]&&(this.manager.element.style[Ta]=u),this.actions=u.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var u=[];return y(this.manager.recognizers,function(f){R(f.options.enable,[f])&&(u=u.concat(f.getTouchAction()))}),Nd(u.join(" "))},preventDefaults:function(u){var f=u.srcEvent,w=u.offsetDirection;if(this.manager.session.prevented){f.preventDefault();return}var v=this.actions,M=W(v,fe)&&!Fs[fe],k=W(v,We)&&!Fs[We],F=W(v,je)&&!Fs[je];if(M){var Z=u.pointers.length===1,K=u.distance<2,ht=u.deltaTime<250;if(Z&&K&&ht)return}if(!(F&&k)&&(M||k&&w&_t||F&&w&de))return this.preventSrc(f)},preventSrc:function(u){this.manager.session.prevented=!0,u.preventDefault()}};function Nd(u){if(W(u,fe))return fe;var f=W(u,je),w=W(u,We);return f&&w?fe:f||w?f?je:We:W(u,Wi)?Wi:Aa}function Fd(){if(!Pa)return!1;var u={},f=t.CSS&&t.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(w){u[w]=f?t.CSS.supports("touch-action",w):!0}),u}var Bs=1,Ct=2,Se=4,re=8,zt=re,$e=16,Lt=32;function qt(u){this.options=x({},this.defaults,u||{}),this.id=ie(),this.manager=null,this.options.enable=Y(this.options.enable,!0),this.state=Bs,this.simultaneous={},this.requireFail=[]}qt.prototype={defaults:{},set:function(u){return x(this.options,u),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(u){if(g(u,"recognizeWith",this))return this;var f=this.simultaneous;return u=Xs(u,this),f[u.id]||(f[u.id]=u,u.recognizeWith(this)),this},dropRecognizeWith:function(u){return g(u,"dropRecognizeWith",this)?this:(u=Xs(u,this),delete this.simultaneous[u.id],this)},requireFailure:function(u){if(g(u,"requireFailure",this))return this;var f=this.requireFail;return u=Xs(u,this),z(f,u)===-1&&(f.push(u),u.requireFailure(this)),this},dropRequireFailure:function(u){if(g(u,"dropRequireFailure",this))return this;u=Xs(u,this);var f=z(this.requireFail,u);return f>-1&&this.requireFail.splice(f,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(u){return!!this.simultaneous[u.id]},emit:function(u){var f=this,w=this.state;function v(M){f.manager.emit(M,u)}w<re&&v(f.options.event+Ia(w)),v(f.options.event),u.additionalEvent&&v(u.additionalEvent),w>=re&&v(f.options.event+Ia(w))},tryEmit:function(u){if(this.canEmit())return this.emit(u);this.state=Lt},canEmit:function(){for(var u=0;u<this.requireFail.length;){if(!(this.requireFail[u].state&(Lt|Bs)))return!1;u++}return!0},recognize:function(u){var f=x({},u);if(!R(this.options.enable,[this,f])){this.reset(),this.state=Lt;return}this.state&(zt|$e|Lt)&&(this.state=Bs),this.state=this.process(f),this.state&(Ct|Se|re|$e)&&this.tryEmit(f)},process:function(u){},getTouchAction:function(){},reset:function(){}};function Ia(u){return u&$e?"cancel":u&re?"end":u&Se?"move":u&Ct?"start":""}function Da(u){return u==He?"down":u==qe?"up":u==Ve?"left":u==ze?"right":""}function Xs(u,f){var w=f.manager;return w?w.get(u):u}function Pt(){qt.apply(this,arguments)}C(Pt,qt,{defaults:{pointers:1},attrTest:function(u){var f=this.options.pointers;return f===0||u.pointers.length===f},process:function(u){var f=this.state,w=u.eventType,v=f&(Ct|Se),M=this.attrTest(u);return v&&(w&ft||!M)?f|$e:v||M?w&H?f|re:f&Ct?f|Se:Ct:Lt}});function Ys(){Pt.apply(this,arguments),this.pX=null,this.pY=null}C(Ys,Pt,{defaults:{event:"pan",threshold:10,pointers:1,direction:ma},getTouchAction:function(){var u=this.options.direction,f=[];return u&_t&&f.push(We),u&de&&f.push(je),f},directionTest:function(u){var f=this.options,w=!0,v=u.distance,M=u.direction,k=u.deltaX,F=u.deltaY;return M&f.direction||(f.direction&_t?(M=k===0?_s:k<0?Ve:ze,w=k!=this.pX,v=Math.abs(u.deltaX)):(M=F===0?_s:F<0?qe:He,w=F!=this.pY,v=Math.abs(u.deltaY))),u.direction=M,w&&v>f.threshold&&M&f.direction},attrTest:function(u){return Pt.prototype.attrTest.call(this,u)&&(this.state&Ct||!(this.state&Ct)&&this.directionTest(u))},emit:function(u){this.pX=u.deltaX,this.pY=u.deltaY;var f=Da(u.direction);f&&(u.additionalEvent=this.options.event+f),this._super.emit.call(this,u)}});function Ji(){Pt.apply(this,arguments)}C(Ji,Pt,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[fe]},attrTest:function(u){return this._super.attrTest.call(this,u)&&(Math.abs(u.scale-1)>this.options.threshold||this.state&Ct)},emit:function(u){if(u.scale!==1){var f=u.scale<1?"in":"out";u.additionalEvent=this.options.event+f}this._super.emit.call(this,u)}});function Zi(){qt.apply(this,arguments),this._timer=null,this._input=null}C(Zi,qt,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[Aa]},process:function(u){var f=this.options,w=u.pointers.length===f.pointers,v=u.distance<f.threshold,M=u.deltaTime>f.time;if(this._input=u,!v||!w||u.eventType&(H|ft)&&!M)this.reset();else if(u.eventType&ot)this.reset(),this._timer=d(function(){this.state=zt,this.tryEmit()},f.time,this);else if(u.eventType&H)return zt;return Lt},reset:function(){clearTimeout(this._timer)},emit:function(u){this.state===zt&&(u&&u.eventType&H?this.manager.emit(this.options.event+"up",u):(this._input.timeStamp=l(),this.manager.emit(this.options.event,this._input)))}});function Ki(){Pt.apply(this,arguments)}C(Ki,Pt,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[fe]},attrTest:function(u){return this._super.attrTest.call(this,u)&&(Math.abs(u.rotation)>this.options.threshold||this.state&Ct)}});function Qi(){Pt.apply(this,arguments)}C(Qi,Pt,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:_t|de,pointers:1},getTouchAction:function(){return Ys.prototype.getTouchAction.call(this)},attrTest:function(u){var f=this.options.direction,w;return f&(_t|de)?w=u.overallVelocity:f&_t?w=u.overallVelocityX:f&de&&(w=u.overallVelocityY),this._super.attrTest.call(this,u)&&f&u.offsetDirection&&u.distance>this.options.threshold&&u.maxPointers==this.options.pointers&&c(w)>this.options.velocity&&u.eventType&H},emit:function(u){var f=Da(u.offsetDirection);f&&this.manager.emit(this.options.event+f,u),this.manager.emit(this.options.event,u)}});function Us(){qt.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}C(Us,qt,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[Wi]},process:function(u){var f=this.options,w=u.pointers.length===f.pointers,v=u.distance<f.threshold,M=u.deltaTime<f.time;if(this.reset(),u.eventType&ot&&this.count===0)return this.failTimeout();if(v&&M&&w){if(u.eventType!=H)return this.failTimeout();var k=this.pTime?u.timeStamp-this.pTime<f.interval:!0,F=!this.pCenter||Rs(this.pCenter,u.center)<f.posThreshold;this.pTime=u.timeStamp,this.pCenter=u.center,!F||!k?this.count=1:this.count+=1,this._input=u;var Z=this.count%f.taps;if(Z===0)return this.hasRequireFailures()?(this._timer=d(function(){this.state=zt,this.tryEmit()},f.interval,this),Ct):zt}return Lt},failTimeout:function(){return this._timer=d(function(){this.state=Lt},this.options.interval,this),Lt},reset:function(){clearTimeout(this._timer)},emit:function(){this.state==zt&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}});function Ht(u,f){return f=f||{},f.recognizers=Y(f.recognizers,Ht.defaults.preset),new tn(u,f)}Ht.VERSION="2.0.7",Ht.defaults={domEvents:!1,touchAction:Ma,enable:!0,inputTarget:null,inputClass:null,preset:[[Ki,{enable:!1}],[Ji,{enable:!1},["rotate"]],[Qi,{direction:_t}],[Ys,{direction:_t},["swipe"]],[Us],[Us,{event:"doubletap",taps:2},["tap"]],[Zi]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};var Bd=1,ka=2;function tn(u,f){this.options=x({},Ht.defaults,f||{}),this.options.inputTarget=this.options.inputTarget||u,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=u,this.input=md(this),this.touchAction=new $i(this,this.options.touchAction),_a(this,!0),y(this.options.recognizers,function(w){var v=this.add(new w[0](w[1]));w[2]&&v.recognizeWith(w[2]),w[3]&&v.requireFailure(w[3])},this)}tn.prototype={set:function(u){return x(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?ka:Bd},recognize:function(u){var f=this.session;if(!f.stopped){this.touchAction.preventDefaults(u);var w,v=this.recognizers,M=f.curRecognizer;(!M||M&&M.state&zt)&&(M=f.curRecognizer=null);for(var k=0;k<v.length;)w=v[k],f.stopped!==ka&&(!M||w==M||w.canRecognizeWith(M))?w.recognize(u):w.reset(),!M&&w.state&(Ct|Se|re)&&(M=f.curRecognizer=w),k++}},get:function(u){if(u instanceof qt)return u;for(var f=this.recognizers,w=0;w<f.length;w++)if(f[w].options.event==u)return f[w];return null},add:function(u){if(g(u,"add",this))return this;var f=this.get(u.options.event);return f&&this.remove(f),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 f=this.recognizers,w=z(f,u);w!==-1&&(f.splice(w,1),this.touchAction.update())}return this},on:function(u,f){if(u!==n&&f!==n){var w=this.handlers;return y($(u),function(v){w[v]=w[v]||[],w[v].push(f)}),this}},off:function(u,f){if(u!==n){var w=this.handlers;return y($(u),function(v){f?w[v]&&w[v].splice(z(w[v],f),1):delete w[v]}),this}},emit:function(u,f){this.options.domEvents&&Xd(u,f);var w=this.handlers[u]&&this.handlers[u].slice();if(!(!w||!w.length)){f.type=u,f.preventDefault=function(){f.srcEvent.preventDefault()};for(var v=0;v<w.length;)w[v](f),v++}},destroy:function(){this.element&&_a(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}};function _a(u,f){var w=u.element;if(w.style){var v;y(u.options.cssProps,function(M,k){v=dt(w.style,k),f?(u.oldCssProps[v]=w.style[v],w.style[v]=M):w.style[v]=u.oldCssProps[v]||""}),f||(u.oldCssProps={})}}function Xd(u,f){var w=e.createEvent("Event");w.initEvent(u,!0,!0),w.gesture=f,f.target.dispatchEvent(w)}x(Ht,{INPUT_START:ot,INPUT_MOVE:ue,INPUT_END:H,INPUT_CANCEL:ft,STATE_POSSIBLE:Bs,STATE_BEGAN:Ct,STATE_CHANGED:Se,STATE_ENDED:re,STATE_RECOGNIZED:zt,STATE_CANCELLED:$e,STATE_FAILED:Lt,DIRECTION_NONE:_s,DIRECTION_LEFT:Ve,DIRECTION_RIGHT:ze,DIRECTION_UP:qe,DIRECTION_DOWN:He,DIRECTION_HORIZONTAL:_t,DIRECTION_VERTICAL:de,DIRECTION_ALL:ma,Manager:tn,Input:St,TouchAction:$i,TouchInput:Ns,MouseInput:Os,PointerEventInput:Hi,TouchMouseInput:ji,SingleTouchInput:Sa,Recognizer:qt,AttrRecognizer:Pt,Tap:Us,Pan:Ys,Swipe:Qi,Pinch:Ji,Rotate:Ki,Press:Zi,on:X,off:V,each:y,merge:S,extend:b,assign:x,inherit:C,bindFn:L,prefixed:dt});var Yd=typeof t<"u"?t:typeof self<"u"?self:{};Yd.Hammer=Ht,typeof n=="function"&&n.amd?n(function(){return Ht}):i.exports?i.exports=Ht:t[s]=Ht})(window,document,"Hammer")})(Kn);var gh=Kn.exports;const yh=ph(gh);class Qn{constructor(){}static getFormatKeyNames(t){const e=Qs(),s=[];return t.ctrl&&s.push(e?"Cmd":"Ctrl"),t.shift&&s.push("Shift"),t.alt&&s.push("Alt"),typeof t.key=="string"?s.push(Vs(t.key)):Array.isArray(t.key)&&(t.key.map(n=>Vs(n)),s.push(...t.key)),s}static matchKeyScheme(t,e){const s=t.ctrl??!1,n=t.shift??!1,r=t.alt??!1;if(t.exact)return(s===e.metaKey||s===e.ctrlKey)&&n===e.shiftKey&&r===e.altKey;const a=[];return s&&a.push(s===e.metaKey||s===e.ctrlKey),n&&a.push(n===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 s=t?.target??window;let n=!1;const r=this.getFormatKeyNames(t),a=o=>{if(o.stopPropagation(),!n&&o.key!=="Control"&&o.key!=="Meta"&&o.key!=="Shift"&&o.key!=="Option"&&o.key!=="Alt"&&r.find(h=>h.toLowerCase()===o.key.toLowerCase())&&this.matchKeyScheme(t,o)){o.preventDefault();const h=e(o);if(typeof h!="function")return;const c=l=>{l.preventDefault(),h(l),s.removeEventListener("keyup",c)};s.addEventListener("keyup",c)}};return e.title=t?.title??"",e.formatedKeyNames=r,e.pause=()=>n=!0,e.restart=()=>n=!1,e.removeListener=()=>s.removeEventListener("keydown",a),s.addEventListener("keydown",a),e}}const wh={BACKSPACE:8,TAB:9,COMMA:188,DELETE:46,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,UP:38,DOWN:40,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32};class tr extends Hs{container;width;height;mousePoint;hammer;removes=[];constructor(t=document.documentElement,e=!0,s){super(),this.container=t,this.width=this.container.offsetWidth,this.height=this.container.offsetHeight,this.hammer=new yh(this.container),this.mousePoint={x:0,y:0,dx:0,dy:0,dStartX:0,dStartY:0},e&&this.start(s)}emitDebounce=Qa((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}start(t){this.registerMouseEventListeners(),this.registerInputEventListeners(),this.registerTransitionEventListeners(),this.registerAnimationEventListeners(),this.registerResizeObserver(),this.registerElementDisplayInParent(),t&&t.forEach(e=>{this.addRemoves(e())}),this.captureMove()}destroy(){this.removes.forEach(t=>t()),this.removes=[],this.removeAllListeners()}restart(){this.destroy(),this.start()}addRemoves(t){this.removes.push(t)}registerMouseEventListeners(){const t=P=>{this.emit("mouseDown",P)},e=P=>{this.emit("mouseUp",P)},s=P=>{this.emit("mouseMove",P)},n=P=>{this.emit("mouseOver",P)},r=P=>{this.emit("mouseOut",P)},a=P=>{this.emit("mouseClick",P)},o=P=>{this.emit("mouseDoubleClick",P)},h=P=>{this.emit("mouseWheel",P)},c=P=>{this.emit("mouseContextMenu",P)},l=P=>{this.emit("touchStart",P)},d=P=>{this.emit("touchEnd",P)},g=P=>{this.emit("touchCancel",P)},y=P=>{this.emit("touchMove",P)},p=P=>{this.emit("pointerDown",P)},x=P=>{this.emit("pointerUp",P)},b=P=>{this.emit("pointerCancel",P)},S=P=>{this.emit("pointerMove",P)},C=P=>{this.emit("pan",P)},L=P=>{this.emit("panStart",P)},R=P=>{this.emit("panMove",P)},Y=P=>{this.emit("panEnd",P)},X=P=>{this.emit("panCancel",P)},V=P=>{this.emit("panLeft",P)},it=P=>{this.emit("panRight",P)},W=P=>{this.emit("panUp",P)},$=P=>{this.emit("panDown",P)},z=P=>{this.emit("pinch",P)},nt=P=>{this.emit("press",P)},bt=P=>{this.emit("rotate",P)},dt=P=>{this.emit("swipe",P)},be=P=>{this.emit("swipeLeft",P)},ie=P=>{this.emit("swipeRight",P)},le=P=>{this.emit("swipeUp",P)},ve=P=>{this.emit("swipeDown",P)},_=P=>{this.emit("tap",P)},A=P=>{!P.target||this.container==P.target||this.container.contains(P.target)||this.emit("tapOutSide",P)};this.container.addEventListener("mousedown",t),this.container.addEventListener("mouseup",e),this.container.addEventListener("mousemove",s),this.container.addEventListener("mouseover",n),this.container.addEventListener("mouseout",r),this.container.addEventListener("click",a),this.container.addEventListener("dblclick",o),this.container.addEventListener("wheel",h),this.container.addEventListener("contextmenu",c),this.container.addEventListener("touchstart",l),this.container.addEventListener("touchend",d),this.container.addEventListener("touchcancel",g),this.container.addEventListener("touchmove",y),this.container.addEventListener("pointerdown",p),this.container.addEventListener("pointerup",x),this.container.addEventListener("pointercancel",b),this.container.addEventListener("pointermove",S),this.hammer.on("pan",C),this.hammer.on("panstart",L),this.hammer.on("panmove",R),this.hammer.on("panend",Y),this.hammer.on("pancancel",X),this.hammer.on("panleft",V),this.hammer.on("panright",it),this.hammer.on("panup",W),this.hammer.on("pandown",$),this.hammer.on("pinch",z),this.hammer.on("press",nt),this.hammer.on("rotate",bt),this.hammer.on("swipe",dt),this.hammer.on("swipeleft",be),this.hammer.on("swiperight",ie),this.hammer.on("swipeup",le),this.hammer.on("swipedown",ve),this.hammer.on("tap",_),document.addEventListener("pointerdown",A,!1);const N=()=>{this.container.removeEventListener("mousedown",t),this.container.removeEventListener("mouseup",e),this.container.removeEventListener("mousemove",s),this.container.removeEventListener("mouseover",n),this.container.removeEventListener("mouseout",r),this.container.removeEventListener("click",a),this.container.removeEventListener("dblclick",o),this.container.removeEventListener("wheel",h),this.container.removeEventListener("contextmenu",c),this.container.removeEventListener("touchstart",l),this.container.removeEventListener("touchend",d),this.container.removeEventListener("touchcancel",g),this.container.removeEventListener("touchmove",y),this.container.removeEventListener("pointerdown",p),this.container.removeEventListener("pointerup",x),this.container.removeEventListener("pointercancel",b),this.container.removeEventListener("pointermove",S),this.hammer.off("pan",C),this.hammer.off("panstart",L),this.hammer.off("panmove",R),this.hammer.off("panend",Y),this.hammer.off("pancancel",X),this.hammer.off("panleft",V),this.hammer.off("panright",it),this.hammer.off("panup",W),this.hammer.off("pandown",$),this.hammer.off("pinch",z),this.hammer.off("press",nt),this.hammer.off("rotate",bt),this.hammer.off("swipe",dt),this.hammer.off("swipeleft",be),this.hammer.off("swiperight",ie),this.hammer.off("swipeup",le),this.hammer.off("swipedown",ve),this.hammer.off("tap",_),document.removeEventListener("pointerdown",A,!1),document.removeEventListener("touchstart",A,!1),document.removeEventListener("mousedown",A,!1)};return this.addRemoves(N),N}registerInputEventListeners(){const t=h=>{this.emit("inputChange",h,this.container.files)},e=h=>{this.emit("dragstart",h)},s=h=>{h.dataTransfer&&(h.dataTransfer.dropEffect="copy"),this.emit("dragover",h)},n=h=>{this.emit("dragenter",h)},r=h=>{this.emit("dragend",h)},a=h=>{h.dataTransfer,this.emit("drop",h,h.dataTransfer?.files)};this.container instanceof HTMLInputElement&&this.container.addEventListener("change",t,!1),this.container.addEventListener("dragstart",e,!1),this.container.addEventListener("dragover",s,!1),this.container.addEventListener("dragenter",n,!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",s,!1),this.container.removeEventListener("dragenter",n,!1),this.container.removeEventListener("dragend",r,!1),this.container.removeEventListener("drop",a,!1)};return this.addRemoves(o),o}registerTransitionEventListeners(){const t=n=>{this.emit("transitionstart",n)},e=n=>{this.emit("transitionend",n)};this.container.addEventListener("transitionstart",t),this.container.addEventListener("transitionend",e);const s=()=>{this.container.removeEventListener("transitionstart",t),this.container.removeEventListener("transitionend",e)};return this.addRemoves(s),s}registerAnimationEventListeners(){const t=n=>{this.emit("animationstart",n)},e=n=>{this.emit("animationend",n)};this.container.addEventListener("animationstart",t),this.container.addEventListener("animationend",e);const s=()=>{this.container.removeEventListener("animationstart",t),this.container.removeEventListener("animationend",e)};return this.addRemoves(s),s}registerKeyDown(t,e,s){const n=Qn.on(t,a=>(e(a,n.formatedKeyNames,n.pause,n.restart),s)),r=()=>{n.removeListener?.()};return this.addRemoves(r),r}registerResizeObserver(){let t;if(typeof ResizeObserver<"u"){const e=new ResizeObserver(s=>{const{width:n,height:r}=s[0].contentRect;this.width=n,this.height=r,this.emit("resize",n,r)});e.observe(this.container),t=()=>{e.unobserve(this.container)}}else{const e="orientationchange"in window?"orientationchange":"resize",s=n=>{const r=n.target.innerWidth,a=n.target.innerHeight;this.emit("resize",r,a)};window.addEventListener(e,s),t=()=>{window.removeEventListener(e,s)}}return this.addRemoves(t),t}registerElementDisplayInParent(t){const e={threshold:t?.threshold||.5,root:t?.parentElement},s=new IntersectionObserver((r,a)=>{let o=r[0];if(r.length>1){const c=r.find(l=>l.isIntersecting);c&&(o=c)}o.isIntersecting&&o.intersectionRatio>=e.threshold?this.emit("showInParent"):this.emit("showOffParent")},e);s.observe(this.container);const n=()=>{s.unobserve(this.container)};return this.addRemoves(n),n}registerPullDownRefresh(t){const e=t?.distance||50;return this.captureMove({move:(s,n)=>{n.dStartY>0&&n.dStartY<e&&this.emit("pullDowning",n.dStartY)},end:(s,n)=>{n.dStartY>=e&&this.emit("pullDown")}})}registerPullUpLoading(t){const e=t?.distance||50;return this.captureMove({move:(s,n)=>{n.dStartY>0&&n.dStartY<e&&this.emit("pullUping",n.dStartY)},end:(s,n)=>{n.dStartY>=e&&this.emit("pullUp")}})}static isTouchEnabled(){return"ontouchstart"in window||"ontouchend"in document||navigator.maxTouchPoints>0}isRunningSingletonCaptureMove=!1;captureMoveStarts=[];captureMoveMoves=[];captureMoveEnds=[];captureMove(t){const e=t?.start||(()=>{}),s=t?.move||(()=>{}),n=t?.end||(()=>{});return this.captureMoveStarts.push(e),this.captureMoveMoves.push(s),this.captureMoveEnds.push(n),this.isRunningSingletonCaptureMove||(this.isRunningSingletonCaptureMove=!0,this.captureMoveUsePointer(),this.addRemoves(()=>{this.captureMoveStarts=[],this.captureMoveMoves=[],this.captureMoveEnds=[]})),()=>{this.captureMoveStarts=this.captureMoveStarts.filter(r=>r!=e),this.captureMoveMoves=this.captureMoveMoves.filter(r=>r!=s),this.captureMoveEnds=this.captureMoveEnds.filter(r=>r!=n)}}setMousePoint(t){this.mousePoint.x=t.x,this.mousePoint.y=t.y,this.mousePoint.dx=typeof t.dx=="number"?t.dx:0,this.mousePoint.dy=typeof t.dy=="number"?t.dy:0,this.mousePoint.dStartX=typeof t.dStartX=="number"?t.dStartX:0,this.mousePoint.dStartY=typeof t.dStartY=="number"?t.dStartY:0}captureMoveUsePointer(){let t,e;const s=o=>{e=Mt(o);const h={...e};t=h,this.setMousePoint(h),this.captureMoveStarts.forEach(c=>{c(o,h)})},n=o=>{e=Mt(o);const h={...e,dStartX:t?e.x-t.x:0,dStartY:t?e.y-t.y:0};this.setMousePoint(h),this.captureMoveEnds.forEach(c=>{c(o,h)}),t=null},r=o=>{const h={...e};e=Mt(o);const c={...e,dx:e.x-h.x,dy:e.y-h.y,dStartX:t?e.x-t.x:0,dStartY:t?e.y-t.y:0};this.setMousePoint(c),this.captureMoveMoves.forEach(l=>{l(o,c)})};this.on("pointerDown",s),this.on("pointerUp",n),this.on("pointerCancel",n),this.on("pointerMove",r);const a=()=>{this.off("pointerDown",s),this.off("pointerUp",n),this.off("pointerCancel",n),this.off("pointerMove",r)};return this.addRemoves(a),a}captureMoveUseMouse(){let t,e;const s=o=>{document.addEventListener("mousemove",r,!1),document.addEventListener("mouseup",n,!1),e=Mt(o);const h={...e};t=h,this.setMousePoint(h),this.captureMoveStarts.forEach(c=>{c(o,h)})},n=o=>{document.removeEventListener("mousemove",r,!1),document.removeEventListener("mouseup",n,!1),e=Mt(o);const h={...e,dStartX:t?e.x-t.x:0,dStartY:t?e.y-t.y:0};this.setMousePoint(h),this.captureMoveEnds.forEach(c=>{c(o,h)}),t=null},r=o=>{const h={...e};e=Mt(o);const c={...e,dx:e.x-h.x,dy:e.y-h.y,dStartX:t?e.x-t.x:0,dStartY:t?e.y-t.y:0};this.setMousePoint(c),this.captureMoveMoves.forEach(l=>{l(o,c)})};this.on("mouseDown",s);const a=()=>{this.off("mouseDown",s)};return this.addRemoves(a),a}captureMoveUseTouch(){let t,e;const s=o=>{const h=o.changedTouches[0];e=Mt(h);const c={...e};t=c,this.setMousePoint(c),this.captureMoveStarts.forEach(l=>{l(h,c)})},n=o=>{const h=o.changedTouches[0];e=Mt(h);const c={...e,dStartX:t?e.x-t.x:0,dStartY:t?e.y-t.y:0};this.setMousePoint(c),this.captureMoveEnds.forEach(l=>{l(h,c)}),t=null},r=o=>{const h=o.changedTouches[0],c={...e};e=Mt(h);const l={...e,dx:e.x-c.x,dy:e.y-c.y,dStartX:t?e.x-t.x:0,dStartY:t?e.y-t.y:0};this.setMousePoint(l),this.captureMoveMoves.forEach(d=>{d(h,l)})};this.on("touchStart",s),this.on("touchEnd",n),this.on("touchCancel",n),this.on("touchMove",r);const a=()=>{this.off("touchStart",s),this.off("touchEnd",n),this.off("touchCancel",n),this.off("touchMove",r)};return this.addRemoves(a),a}simulateMouseEvent(t,e){if(t.touches.length>1)return;const s=t.changedTouches[0],n=new MouseEvent(e,{bubbles:!0,cancelable:!0,view:window,detail:1,screenX:s.screenX,screenY:s.screenY,clientX:s.clientX,clientY:s.clientY,ctrlKey:!1,altKey:!1,shiftKey:!1,metaKey:!1,button:0,relatedTarget:null});t.target?.dispatchEvent(n)}}const et=new tr(document.documentElement,!0,[()=>xh("(prefers-color-scheme: dark)"),bh,Sh,vh]);et.registerKeyDown({title:"打开",key:"o",ctrl:!0,exact:!0},()=>{vn().then(i=>es(i[0])).then(i=>{et.emit("openFile",i)}).catch(i=>{et.emit("openFileError",i)})});function xh(i){let t="";switch(i){case"(prefers-color-scheme: dark)":t="matchMediaChangePrefersColorSchemeDark";break;default:t=i;break}const e=s=>{et.emit(t,s.matches)};return window.matchMedia(i).addEventListener("change",e),()=>{window.matchMedia(i).removeEventListener("change",e)}}function bh(){let i="";const t=new MutationObserver(n=>{location.href!==i&&(i=location.href,et.emit("urlchange",location.href))});t.observe(document,{attributes:!0,childList:!0,subtree:!0});const e=()=>{et.emit("hashchange",location.hash)};window.addEventListener("hashchange",e);const s=()=>{et.emit("popstate")};return window.addEventListener("popstate",s),()=>{t.disconnect(),window.removeEventListener("hashchange",e),window.removeEventListener("popstate",s)}}function vh(){const i=r=>{et.emit("beforeunload",r)};window.addEventListener("beforeunload",i);const t=r=>{et.emit("pagehide",r)};window.addEventListener("pagehide",t);const e=r=>{et.emit("windowFocus",r)};window.addEventListener("focus",e);const s=r=>{et.emit("windowBlur",r)};window.addEventListener("blur",s);const n=r=>{document.hidden?et.emit("windowVisibilityChangeHide",r):et.emit("windowVisibilityChangeShow",r)};return document.addEventListener("visibilitychange",n),()=>{window.removeEventListener("beforeunload",i),window.removeEventListener("pagehide",t),window.removeEventListener("focus",e),window.removeEventListener("blur",s),document.removeEventListener("visibilitychange",n)}}function Sh(){const i=t=>{et.emit("scroll",t)};return document.addEventListener("scroll",i),()=>{document.removeEventListener("scroll",i)}}const Ch=i=>{let t=!1;function e(){if(document.readyState!=="loading"){if(t){document.removeEventListener("DOMContentLoaded",e);return}t=!0,document.removeEventListener("DOMContentLoaded",e),i()}}document.addEventListener("DOMContentLoaded",e),e()};class Re{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"),s=document.createElement("video"),n=document.createElement("source"),r=new MediaSource;r.addEventListener("sourceopen",()=>t(!0)),n.src=URL.createObjectURL(r),n.media="(min-width:10px)",s.append(n),e.width="5",e.style.cssText="position: absolute; visibility: hidden;",document.documentElement.append(e),e.contentDocument?.body.append(s),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(()=>{Re.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 er extends Hs{source;raw="";mode="text";tagname="";nodename="";textchunk="";entity="";quote="";attrs={};constructor(t){super(),this.source=t}parse(){const t=an(this.source);if(t===0){this.emit("finish");return}let e,s,n=on(this.source,0);for(let r=1;r<t;r++)e=s,s=n,n=on(this.source,r),this.raw+=s,s&&this.step(s,n,e);n&&this.step(n,void 0,s),this.emit("finish")}step(t,e,s){t==`
25
- `&&this.emit("newline"),this.act(t,e,s)}act(t,e,s){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+=I.entity2text(this.entity),this.mode="text"):t==";"?(this.textchunk+=I.entity2text(this.entity+t),this.mode="text"):this.entity+=t;break;case"special":if(s=="!"&&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(s=="]"&&t=="]"&&e==">"){this.mode="cdata end",this.textchunk=this.textchunk.slice(0,-1);break}t=="eof"&&(this.mode="cdata end",this.act(t,e,s)),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=="-"&&s=="-"&&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,s)}break;case"close tag name start":Ot("whitespace",t)||(this.mode="close tag name",this.tagname="",this.nodename="",this.act(t,e,s));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,s));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,s)}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&&s!="\\"&&(this.mode="attr start");break;default:this.attrs[this.nodename]+=t;break}break}}}function pi(i,t,e){if(typeof t<"u")window.localStorage.setItem(i,JSON.stringify({value:t,expires:typeof e=="number"?e:-1}));else{const s=window.localStorage.getItem(i);try{const n=JSON.parse(s||"");return"expires"in n&&parseInt(n.expires)>=0&&new Date().getTime()>parseInt(n.expires)?void 0:n.value||void 0}catch{return s||void 0}}}function Eh(i,t,e){const s=new Date;s.setTime(s.getTime()+e*24*60*60*1e3);const n="expires="+s.toUTCString();document.cookie=i+"="+t+"; "+n}function Th(i){const t=i+"=",e=document.cookie.split(";");for(let s=0,n=e.length;s<n;s++){const r=e[s].trim();if(r.indexOf(t)==0)return r.substring(t.length,r.length)}return""}const Ph=()=>document.cookie.split(";").map(i=>i.split("=")).reduce((i,[t,e])=>(i[t.trim().replace('"',"")]=e,i),{}),Mh=()=>document.cookie.split(";").forEach(i=>document.cookie=i.replace(/^ +/,"").replace(/=.*/,`=;expires=${new Date().toUTCString()};path=/`));et.on("matchMediaChangePrefersColorSchemeDark",i=>{gs(i?"dark":"light")}),sr();function gs(i){pi("colorScheme",i),document.documentElement.classList.toggle("dark",i=="dark")}function sr(){const i=pi("colorScheme");if(i=="dark"||i=="light")return gs(i),i;{const t=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";return gs(t),t}}const gi={safeAreaTop:I.getCSSVar("--safe-area-inset-top"),safeAreaRight:I.getCSSVar("--safe-area-inset-right"),safeAreaBottom:I.getCSSVar("--safe-area-inset-bottom"),safeAreaLeft:I.getCSSVar("--safe-area-inset-left"),colorPrimary:I.getCSSVar("--color-primary")||"#5078f0",colorRed:I.getCSSVar("--color-red")||"#ff5050",colorOrange:I.getCSSVar("--color-orange")||"#fa8c00",colorYellow:I.getCSSVar("--color-yellow")||"#fadc32",colorGreen:I.getCSSVar("--color-green")||"#00c878",colorBlue:I.getCSSVar("--color-blue")||"#00b4fa",colorPurple:I.getCSSVar("--color-purple")||"#6464fa",colorBlack:I.getCSSVar("--color-black")||"#001428",colorGray00:I.getCSSVar("--color-gray-00")||"#000000",colorGray33:I.getCSSVar("--color-gray-33")||"#333333",colorGray66:I.getCSSVar("--color-gray-66")||"#666666",colorGray99:I.getCSSVar("--color-gray-99")||"#999999",colorGrayCC:I.getCSSVar("--color-gray-cc")||"#cccccc",colorGrayDD:I.getCSSVar("--color-gray-dd")||"#dddddd",colorGrayE6:I.getCSSVar("--color-gray-e6")||"#e6e6e6",colorGrayEE:I.getCSSVar("--color-gray-ee")||"#eeeeee",colorGrayEF:I.getCSSVar("--color-gray-ef")||"#efefef",colorGrayF5:I.getCSSVar("--color-gray-f5")||"#f5f5f5",colorGrayFF:I.getCSSVar("--color-gray-ff")||"#ffffff",fontLineHeight:I.getCSSVar("--font-line-height")||"1,4",fontSize32:I.getCSSVar("--font-size-32")||"32px",fontSize24:I.getCSSVar("--font-size-24")||"24px",fontSize20:I.getCSSVar("--font-size-20")||"20px",fontSize18:I.getCSSVar("--font-size-18")||"18px",fontSize16:I.getCSSVar("--font-size-16")||"16px",fontSize14:I.getCSSVar("--font-size-14")||"14px",fontSize12:I.getCSSVar("--font-size-12")||"12px",fontSize11:I.getCSSVar("--font-size-11")||"11px",gap4:I.getCSSVar("--gap-4")||"4px",gap8:I.getCSSVar("--gap-8")||"8px",gap12:I.getCSSVar("--gap-12")||"12px",gap16:I.getCSSVar("--gap-16")||"16px",gap20:I.getCSSVar("--gap-20")||"20px",gap40:I.getCSSVar("--gap-40")||"40px",height44:I.getCSSVar("--height-44")||"44px",height32:I.getCSSVar("--height-32")||"32px",borderRadius:I.getCSSVar("--border-radius")||"4px"},ir=["#0ac2d2","#7bb7fa","#60d7a9","#fdc162","#fd6a62","#f68dbb","#26ccff","#a25afd","#ff5e7e","#88ff5a","#fcff42","#ffa62d","#ff36ff","#dc4916","#6871b1","#d1b935","#1bbc9b","#FF7F50","#4BBFC3","#ff9900"];function It(i,t){if(Object.prototype.hasOwnProperty.call(i,"r")&&Object.prototype.hasOwnProperty.call(i,"g")&&Object.prototype.hasOwnProperty.call(i,"b"))return i.r=Math.round(yt(i.r,0,255)),i.g=Math.round(yt(i.g,0,255)),i.b=Math.round(yt(i.b,0,255)),Object.prototype.hasOwnProperty.call(i,"a")?i.a=typeof t=="number"?t:i.a:i.a=typeof t=="number"?t:1,i.a=yt(i.a,0,1),i;const e={r:0,g:0,b:0,a:1};let s=-1;if(typeof i=="number")s=i;else if(typeof i=="string")if(i[0].toLowerCase()==="r"){const n=/rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,?\s*(\d?\.?\d*)?\s*\)/gi.exec(i);n&&(s=(parseInt(n[1])<<16)+(parseInt(n[2])<<8)+parseInt(n[3]),n[4]&&(e.a=Et(parseFloat(n[4]),2)))}else if(i[0]==="#")s=parseInt(i.slice(1,7),16),i.length>7&&(e.a=Et(parseInt(i.slice(7,9),16)/255,2));else throw new Error("getColor 不支持的颜色解析:"+i);return s>=0&&(e.r=s>>16&255,e.g=s>>8&255,e.b=s&255),typeof t=="number"&&(e.a=t),e.a=yt(e.a,0,1),e}function yi(i,t=!1,e="#000000",s="#ffffff"){let n=It(i);return t?n=It(n.r*.299+n.g*.587+n.b*.114>186?e:s):(n.r=255-n.r,n.g=255-n.g,n.b=255-n.b),n}function wi(i,t){const e=It(i,t);return e.a===1?`rgb(${e.r},${e.g},${e.b})`:`rgba(${e.r},${e.g},${e.b},${e.a})`}function Ah(i,t=!1,e="#000000",s="#ffffff"){return wi(yi(i,t,e,s))}function ys(i){return Na(i.toString(16),2,"0","left")}function ge(i,t){const e=It(i,t),s=`#${ys(e.r)}${ys(e.g)}${ys(e.b)}`;return e.a===1?s:s+`${ys(Math.ceil(e.a*255))}`}function nr(i,t=!1,e="#000000",s="#ffffff"){return ge(yi(i,t,e,s))}const rr=()=>Math.random()*16777215,Ih=()=>ge(rr());function Dh(i,t){const e=It(i);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)),ge(e)}function xi(i,t,e){try{const s=It(i),n=It(t);return ge({r:(n.r-s.r)*e+s.r,g:(n.g-s.g)*e+s.g,b:(n.b-s.b)*e+s.b,a:(n.a-s.a)*e+s.a})}catch{return t}}function kh(i,t,e,s){let n,r,a;i=i/360,t=t/100,e=e/100;const o=Math.floor(i*6),h=i*6-o,c=e*(1-t),l=e*(1-h*t),d=e*(1-(1-h)*t);switch(o%6){case 0:n=e,r=d,a=c;break;case 1:n=l,r=e,a=c;break;case 2:n=c,r=e,a=d;break;case 3:n=c,r=l,a=e;break;case 4:n=d,r=c,a=e;break;case 5:default:n=e,r=c,a=l;break}return{r:Math.round(n*255),g:Math.round(r*255),b:Math.round(a*255),opacity:s??1}}function _h(i,t,e,s){i*=360;let n,r,a;i=i%360/60;const o=e*t,h=o*(1-Math.abs(i%2-1));return n=r=a=e-o,i=~~i,n+=[o,h,0,0,h,o][i],r+=[h,o,o,h,0,0][i],a+=[0,0,h,o,o,h][i],{r:n,g:r,b:a,opacity:s??1}}function Lh(i,t,e,s){(i>1||t>1||e>1)&&(i/=360,t/=100,e/=100),i*=360;let n,r,a;i=i%360/60;const o=2*t*(e<.5?e:1-e),h=o*(1-Math.abs(i%2-1));return n=r=a=e-o/2,i=~~i,n+=[o,h,0,0,h,o][i],r+=[h,o,o,h,0,0][i],a+=[0,0,h,o,o,h][i],{r:n,g:r,b:a,opacity:s??1}}function Rh(i,t,e,s){const n=Math.max(i,t,e),r=Math.min(i,t,e),a=n-r,o=n===0?0:a/n,h=n/255;let c;switch(n){case r:c=0;break;case i:c=t-e+a*(t<e?6:0),c/=6*a;break;case t:c=e-i+a*2,c/=6*a;break;case e:default:c=i-t+a*4,c/=6*a;break}return{h:Math.round(c*360),s:Math.round(o*100),v:Math.round(h*100),opacity:s??1}}function Oh(i,t,e){const s=Math.max(i,t,e),n=s-Math.min(i,t,e);let r=n==0?0:s==i?(t-e)/n:s==t?(e-i)/n+2:(i-t)/n+4;r=(r+360)%6*60/360;const a=n==0?0:n/s;return{h:r,s:a,b:s}}function Nh(i,t,e){const s=Math.max(i,t,e),n=Math.min(i,t,e),r=s-n;let a=r==0?0:s==i?(t-e)/r:s==t?(e-i)/r+2:(i-t)/r+4;a=(a+360)%6*60/360;const o=(s+n)/2,h=r==0?0:o<.5?r/(2*o):r/(2-2*o);return{h:a,s:h,l:o}}function ws(i=window.location.href){return fn(URL)?new URL(i):ar(i)}function ar(i=window.location.href){const t="(?<protocol>https?:)",e="(?<host>(?<hostname>[^/#?:]+)(?::(?<port>\\d+))?)",s="(?<pathname>(?:\\/[^/#?]+)*\\/?)",n="(?<search>(?:\\?[^#]*)?)",r="(?<hash>(?:#.*)?)",o=new RegExp(`^${t}//${e}${s}${n}${r}$`).exec(i);return{href:i,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 Fh(i){const t=ws(i);return t.protocol==="http:"||t.protocol==="https:"}function or(i=window.location.href){const t=ws(i),e=t.href.indexOf(t.hash);return t.hash&&e>=0?t.href.substring(0,e):t.href}function Bh(i=ws().search){i=decodeURIComponent(i).replace(/^[#?&]/,"");const t={};if(!i)return t;const e=/(?:^|&)([^&=]*)=?([^&]*?)(?=&|$)/y;let s=e.exec(i);for(;s;)t[s[1]]=s[2],s=e.exec(i);return t}function hr(i){return"?"+Object.entries(i).map(([t,e])=>`${encodeURIComponent(t)}=${encodeURIComponent(e)}`).join("&")}function cr(i){return"?"+[...i.entries()].map(t=>encodeURIComponent(t[0])+"="+encodeURIComponent(t[1]instanceof File?t[1].name:t[1])).join("&")}function Xh(i,t){return i.replace(/(?:\?.*)?$/,t.replace(/^[&?]/,"?"))}function lr(i,t){return i+t.replace(/^[&?]/,i.indexOf("?")>=0?"&":"?")}class Yh{worker;cbs={};constructor(t){if(_n)try{this.worker=new Worker(URL.createObjectURL(new Blob([t])))}catch(e){throw typeof console!==void 0&&typeof console.warn=="function"&&console.warn("🎊 Could not load worker",e),e}else throw new Error("Your environment do not support Worker !")}postMessage(t,e=[]){this.worker.postMessage(t,e)}onmessage(t){this.worker.addEventListener("message",t)}offmessage(t){this.worker.removeEventListener("message",t)}onmessageerror(t){this.worker.addEventListener("messageerror",t)}offmessageerror(t){this.worker.removeEventListener("messageerror",t)}postCanvas(t){const e=t.transferControlToOffscreen();this.worker.postMessage({canvas:e},[e])}postPort(t){this.worker.postMessage({port:t},[t])}postReset(){this.worker.postMessage({reset:!0});for(const t in this.cbs)this.cbs[t](),delete this.cbs[t]}fire(t,e){return new Promise(s=>{if(e){const n=Math.random().toString(36).slice(2),r=a=>{a.data.id===n&&(this.worker.removeEventListener("message",r),delete this.cbs[n],e(),s())};this.cbs[n]=r.bind(this,{data:{id:n}}),this.worker.addEventListener("message",r),this.worker.postMessage({...t,id:n})}else this.worker.postMessage(t),s()})}}class Uh{port1;port2;port1MessageCbs=[];port2MessageCbs=[];port1MessageErrorCbs=[];port2MessageErrorCbs=[];constructor(){const{port1:t,port2:e}=new MessageChannel;this.port1=t,this.port2=e,this.port1.addEventListener("message",s=>{this.port1MessageCbs.forEach(n=>n(this.port1,s))}),this.port1.addEventListener("messageerror",s=>{this.port1MessageErrorCbs.forEach(n=>n(this.port1,s))}),this.port1.start(),this.port2.addEventListener("message",s=>{this.port2MessageCbs.forEach(n=>n(this.port2,s))}),this.port2.addEventListener("messageerror",s=>{this.port2MessageErrorCbs.forEach(n=>n(this.port2,s))}),this.port2.start()}close(){this.port1.close(),this.port2.close()}onPort1Message(t){this.port1MessageCbs.push(t)}onPort1MessageError(t){this.port1MessageErrorCbs.push(t)}offPort1Message(t){Ee(this.port1MessageCbs,t)}offPort1MessageError(t){Ee(this.port1MessageErrorCbs,t)}onPort2Message(t){this.port2MessageCbs.push(t)}onPort2MessageError(t){this.port2MessageErrorCbs.push(t)}offPort2Message(t){Ee(this.port2MessageCbs,t)}offPort2MessageError(t){Ee(this.port2MessageErrorCbs,t)}}function ur(){let i=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{i=new window.ActiveXObject(t[e]);break}catch{continue}}else i=new XMLHttpRequest;return i}function Gh(i,t){return new Promise((e,s)=>{const{method:n="GET",data:r={},segments:a=[],headers:o={},withCredentials:h=!1,responseType:c="json",timeout:l=3e4}=t||{},d=ur();d.timeout=l,d.responseType=c,d.onreadystatechange=function(C){d.readyState===4&&(d.status===200?e(d.response):s(d.statusText))},d.ontimeout=function(){s(`${i} is timed out for ${l}ms.`)},d.addEventListener("error",function(C){s(C)},!1),d.addEventListener("progress",function(C){if(C.lengthComputable){const L=Math.round(C.loaded*100/C.total);t?.progress?.(L,d)}},!1),d.addEventListener("load",function(C){t?.load?.(C,d)},!1),d.addEventListener("loadstart",function(C){t?.loadstart?.(C,d)},!1),d.addEventListener("loadend",function(C){t?.loadend?.(C,d)},!1),d.addEventListener("abort",function(C){t?.abort?.(C,d)},!1);const g=n.toUpperCase();Object.assign(o,{Accept:"*/*"});const y="---------------------------"+Date.now().toString(16);let p=!1,x=!1,b=!1;function S(){h&&(d.withCredentials=!0);for(const C in o)ct(C).toLowerCase()=="content-type"&&o[C].toLowerCase()=="multipart/form-data"?(p=!0,d.setRequestHeader("Content-Type","multipart/form-data; boundary="+y)):(ct(C).toLowerCase()=="content-type"&&(o[C].toLowerCase().indexOf("text/plain")>=0?x=!0:o[C].toLowerCase().indexOf("application/json")>=0&&(b=!0)),d.setRequestHeader(C,o[C]))}switch(g){case"GET":let C="";r instanceof FormData?C=cr(r):C=hr(r),d.open("GET",lr(i,C),!0),S(),d.send(null);break;case"POST":default:d.open(g,i,!0),S(),p&&a.length?d.sendAsBinary("--"+y+`\r
24
+ `;return function(){var _=new Error("get-stack-trace"),k=_&&_.stack?_.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",F=t.console&&(t.console.warn||t.console.log);return F&&F.call(t.console,v,k),u.apply(this,arguments)}}var x;typeof Object.assign!="function"?x=function(f){if(f===i||f===null)throw new TypeError("Cannot convert undefined or null to object");for(var w=Object(f),v=1;v<arguments.length;v++){var _=arguments[v];if(_!==i&&_!==null)for(var k in _)_.hasOwnProperty(k)&&(w[k]=_[k])}return w}:x=Object.assign;var b=m(function(f,w,v){for(var _=Object.keys(w),k=0;k<_.length;)(!v||v&&f[_[k]]===i)&&(f[_[k]]=w[_[k]]),k++;return f},"extend","Use `assign`."),S=m(function(f,w){return b(f,w,!0)},"merge","Use `assign`.");function C(u,f,w){var v=f.prototype,_;_=u.prototype=Object.create(v),_.constructor=u,_._super=v,w&&x(_,w)}function L(u,f){return function(){return u.apply(f,arguments)}}function R(u,f){return typeof u==o?u.apply(f&&f[0]||i,f):u}function X(u,f){return u===i?f:u}function Y(u,f,w){y(Z(f),function(v){u.addEventListener(v,w,!1)})}function H(u,f,w){y(Z(f),function(v){u.removeEventListener(v,w,!1)})}function at(u,f){for(;u;){if(u==f)return!0;u=u.parentNode}return!1}function J(u,f){return u.indexOf(f)>-1}function Z(u){return u.trim().split(/\s+/g)}function j(u,f,w){if(u.indexOf&&!w)return u.indexOf(f);for(var v=0;v<u.length;){if(w&&u[v][w]==f||!w&&u[v]===f)return v;v++}return-1}function ot(u){return Array.prototype.slice.call(u,0)}function St(u,f,w){for(var v=[],_=[],k=0;k<u.length;){var F=f?u[k][f]:u[k];j(_,F)<0&&v.push(u[k]),_[k]=F,k++}return w&&(f?v=v.sort(function(et,dt){return et[f]>dt[f]}):v=v.sort()),v}function gt(u,f){for(var w,v,_=f[0].toUpperCase()+f.slice(1),k=0;k<r.length;){if(w=r[k],v=w?w+_:f,v in u)return v;k++}return i}var xe=1;function ne(){return xe++}function le(u){var f=u.ownerDocument||u;return f.defaultView||f.parentWindow||t}var be=/mobile|tablet|ip(ad|hone|od)|android/i,M="ontouchstart"in t,D=gt(t,"PointerEvent")!==i,N=M&&be.test(navigator.userAgent),G="touch",ut="pen",_t="mouse",ks="kinect",Ms=25,Q=1,Lt=2,q=4,P=8,Ls=1,Ve=2,ze=4,qe=8,He=16,Rt=Ve|ze,ue=qe|He,la=Rt|ue,ua=["x","y"],Rs=["clientX","clientY"];function Ct(u,f){var w=this;this.manager=u,this.callback=f,this.element=u.element,this.target=u.options.inputTarget,this.domHandler=function(v){R(u.options.enable,[u])&&w.handler(v)},this.init()}Ct.prototype={handler:function(){},init:function(){this.evEl&&Y(this.element,this.evEl,this.domHandler),this.evTarget&&Y(this.target,this.evTarget,this.domHandler),this.evWin&&Y(le(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&H(this.element,this.evEl,this.domHandler),this.evTarget&&H(this.target,this.evTarget,this.domHandler),this.evWin&&H(le(this.element),this.evWin,this.domHandler)}};function zu(u){var f,w=u.options.inputClass;return w?f=w:D?f=ji:N?f=Fs:M?f=Wi:f=Ns,new f(u,qu)}function qu(u,f,w){var v=w.pointers.length,_=w.changedPointers.length,k=f&Q&&v-_===0,F=f&(q|P)&&v-_===0;w.isFirst=!!k,w.isFinal=!!F,k&&(u.session={}),w.eventType=f,Hu(u,w),u.emit("hammer.input",w),u.recognize(w),u.session.prevInput=w}function Hu(u,f){var w=u.session,v=f.pointers,_=v.length;w.firstInput||(w.firstInput=da(f)),_>1&&!w.firstMultiple?w.firstMultiple=da(f):_===1&&(w.firstMultiple=!1);var k=w.firstInput,F=w.firstMultiple,tt=F?F.center:k.center,et=f.center=fa(v);f.timeStamp=l(),f.deltaTime=f.timeStamp-k.timeStamp,f.angle=Hi(tt,et),f.distance=Os(tt,et),ju(w,f),f.offsetDirection=pa(f.deltaX,f.deltaY);var dt=ma(f.deltaTime,f.deltaX,f.deltaY);f.overallVelocityX=dt.x,f.overallVelocityY=dt.y,f.overallVelocity=c(dt.x)>c(dt.y)?dt.x:dt.y,f.scale=F?Ju(F.pointers,v):1,f.rotation=F?$u(F.pointers,v):0,f.maxPointers=w.prevInput?f.pointers.length>w.prevInput.maxPointers?f.pointers.length:w.prevInput.maxPointers:f.pointers.length,Wu(w,f);var Nt=u.element;at(f.srcEvent.target,Nt)&&(Nt=f.srcEvent.target),f.target=Nt}function ju(u,f){var w=f.center,v=u.offsetDelta||{},_=u.prevDelta||{},k=u.prevInput||{};(f.eventType===Q||k.eventType===q)&&(_=u.prevDelta={x:k.deltaX||0,y:k.deltaY||0},v=u.offsetDelta={x:w.x,y:w.y}),f.deltaX=_.x+(w.x-v.x),f.deltaY=_.y+(w.y-v.y)}function Wu(u,f){var w=u.lastInterval||f,v=f.timeStamp-w.timeStamp,_,k,F,tt;if(f.eventType!=P&&(v>Ms||w.velocity===i)){var et=f.deltaX-w.deltaX,dt=f.deltaY-w.deltaY,Nt=ma(v,et,dt);k=Nt.x,F=Nt.y,_=c(Nt.x)>c(Nt.y)?Nt.x:Nt.y,tt=pa(et,dt),u.lastInterval=f}else _=w.velocity,k=w.velocityX,F=w.velocityY,tt=w.direction;f.velocity=_,f.velocityX=k,f.velocityY=F,f.direction=tt}function da(u){for(var f=[],w=0;w<u.pointers.length;)f[w]={clientX:h(u.pointers[w].clientX),clientY:h(u.pointers[w].clientY)},w++;return{timeStamp:l(),pointers:f,center:fa(f),deltaX:u.deltaX,deltaY:u.deltaY}}function fa(u){var f=u.length;if(f===1)return{x:h(u[0].clientX),y:h(u[0].clientY)};for(var w=0,v=0,_=0;_<f;)w+=u[_].clientX,v+=u[_].clientY,_++;return{x:h(w/f),y:h(v/f)}}function ma(u,f,w){return{x:f/u||0,y:w/u||0}}function pa(u,f){return u===f?Ls:c(u)>=c(f)?u<0?Ve:ze:f<0?qe:He}function Os(u,f,w){w||(w=ua);var v=f[w[0]]-u[w[0]],_=f[w[1]]-u[w[1]];return Math.sqrt(v*v+_*_)}function Hi(u,f,w){w||(w=ua);var v=f[w[0]]-u[w[0]],_=f[w[1]]-u[w[1]];return Math.atan2(_,v)*180/Math.PI}function $u(u,f){return Hi(f[1],f[0],Rs)+Hi(u[1],u[0],Rs)}function Ju(u,f){return Os(f[0],f[1],Rs)/Os(u[0],u[1],Rs)}var Zu={mousedown:Q,mousemove:Lt,mouseup:q},Ku="mousedown",Qu="mousemove mouseup";function Ns(){this.evEl=Ku,this.evWin=Qu,this.pressed=!1,Ct.apply(this,arguments)}C(Ns,Ct,{handler:function(f){var w=Zu[f.type];w&Q&&f.button===0&&(this.pressed=!0),w&Lt&&f.which!==1&&(w=q),this.pressed&&(w&q&&(this.pressed=!1),this.callback(this.manager,w,{pointers:[f],changedPointers:[f],pointerType:_t,srcEvent:f}))}});var td={pointerdown:Q,pointermove:Lt,pointerup:q,pointercancel:P,pointerout:P},ed={2:G,3:ut,4:_t,5:ks},ga="pointerdown",ya="pointermove pointerup pointercancel";t.MSPointerEvent&&!t.PointerEvent&&(ga="MSPointerDown",ya="MSPointerMove MSPointerUp MSPointerCancel");function ji(){this.evEl=ga,this.evWin=ya,Ct.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}C(ji,Ct,{handler:function(f){var w=this.store,v=!1,_=f.type.toLowerCase().replace("ms",""),k=td[_],F=ed[f.pointerType]||f.pointerType,tt=F==G,et=j(w,f.pointerId,"pointerId");k&Q&&(f.button===0||tt)?et<0&&(w.push(f),et=w.length-1):k&(q|P)&&(v=!0),!(et<0)&&(w[et]=f,this.callback(this.manager,k,{pointers:w,changedPointers:[f],pointerType:F,srcEvent:f}),v&&w.splice(et,1))}});var sd={touchstart:Q,touchmove:Lt,touchend:q,touchcancel:P},id="touchstart",nd="touchstart touchmove touchend touchcancel";function wa(){this.evTarget=id,this.evWin=nd,this.started=!1,Ct.apply(this,arguments)}C(wa,Ct,{handler:function(f){var w=sd[f.type];if(w===Q&&(this.started=!0),!!this.started){var v=rd.call(this,f,w);w&(q|P)&&v[0].length-v[1].length===0&&(this.started=!1),this.callback(this.manager,w,{pointers:v[0],changedPointers:v[1],pointerType:G,srcEvent:f})}}});function rd(u,f){var w=ot(u.touches),v=ot(u.changedTouches);return f&(q|P)&&(w=St(w.concat(v),"identifier",!0)),[w,v]}var ad={touchstart:Q,touchmove:Lt,touchend:q,touchcancel:P},od="touchstart touchmove touchend touchcancel";function Fs(){this.evTarget=od,this.targetIds={},Ct.apply(this,arguments)}C(Fs,Ct,{handler:function(f){var w=ad[f.type],v=hd.call(this,f,w);v&&this.callback(this.manager,w,{pointers:v[0],changedPointers:v[1],pointerType:G,srcEvent:f})}});function hd(u,f){var w=ot(u.touches),v=this.targetIds;if(f&(Q|Lt)&&w.length===1)return v[w[0].identifier]=!0,[w,w];var _,k,F=ot(u.changedTouches),tt=[],et=this.target;if(k=w.filter(function(dt){return at(dt.target,et)}),f===Q)for(_=0;_<k.length;)v[k[_].identifier]=!0,_++;for(_=0;_<F.length;)v[F[_].identifier]&&tt.push(F[_]),f&(q|P)&&delete v[F[_].identifier],_++;if(tt.length)return[St(k.concat(tt),"identifier",!0),tt]}var cd=2500,xa=25;function Wi(){Ct.apply(this,arguments);var u=L(this.handler,this);this.touch=new Fs(this.manager,u),this.mouse=new Ns(this.manager,u),this.primaryTouch=null,this.lastTouches=[]}C(Wi,Ct,{handler:function(f,w,v){var _=v.pointerType==G,k=v.pointerType==_t;if(!(k&&v.sourceCapabilities&&v.sourceCapabilities.firesTouchEvents)){if(_)ld.call(this,w,v);else if(k&&ud.call(this,v))return;this.callback(f,w,v)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});function ld(u,f){u&Q?(this.primaryTouch=f.changedPointers[0].identifier,ba.call(this,f)):u&(q|P)&&ba.call(this,f)}function ba(u){var f=u.changedPointers[0];if(f.identifier===this.primaryTouch){var w={x:f.clientX,y:f.clientY};this.lastTouches.push(w);var v=this.lastTouches,_=function(){var k=v.indexOf(w);k>-1&&v.splice(k,1)};setTimeout(_,cd)}}function ud(u){for(var f=u.srcEvent.clientX,w=u.srcEvent.clientY,v=0;v<this.lastTouches.length;v++){var _=this.lastTouches[v],k=Math.abs(f-_.x),F=Math.abs(w-_.y);if(k<=xa&&F<=xa)return!0}return!1}var va=gt(a.style,"touchAction"),Sa=va!==i,Ca="compute",Ea="auto",$i="manipulation",de="none",je="pan-x",We="pan-y",Ys=fd();function Ji(u,f){this.manager=u,this.set(f)}Ji.prototype={set:function(u){u==Ca&&(u=this.compute()),Sa&&this.manager.element.style&&Ys[u]&&(this.manager.element.style[va]=u),this.actions=u.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var u=[];return y(this.manager.recognizers,function(f){R(f.options.enable,[f])&&(u=u.concat(f.getTouchAction()))}),dd(u.join(" "))},preventDefaults:function(u){var f=u.srcEvent,w=u.offsetDirection;if(this.manager.session.prevented){f.preventDefault();return}var v=this.actions,_=J(v,de)&&!Ys[de],k=J(v,We)&&!Ys[We],F=J(v,je)&&!Ys[je];if(_){var tt=u.pointers.length===1,et=u.distance<2,dt=u.deltaTime<250;if(tt&&et&&dt)return}if(!(F&&k)&&(_||k&&w&Rt||F&&w&ue))return this.preventSrc(f)},preventSrc:function(u){this.manager.session.prevented=!0,u.preventDefault()}};function dd(u){if(J(u,de))return de;var f=J(u,je),w=J(u,We);return f&&w?de:f||w?f?je:We:J(u,$i)?$i:Ea}function fd(){if(!Sa)return!1;var u={},f=t.CSS&&t.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(w){u[w]=f?t.CSS.supports("touch-action",w):!0}),u}var Bs=1,Et=2,ve=4,re=8,Ht=re,$e=16,Ot=32;function jt(u){this.options=x({},this.defaults,u||{}),this.id=ne(),this.manager=null,this.options.enable=X(this.options.enable,!0),this.state=Bs,this.simultaneous={},this.requireFail=[]}jt.prototype={defaults:{},set:function(u){return x(this.options,u),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(u){if(g(u,"recognizeWith",this))return this;var f=this.simultaneous;return u=Xs(u,this),f[u.id]||(f[u.id]=u,u.recognizeWith(this)),this},dropRecognizeWith:function(u){return g(u,"dropRecognizeWith",this)?this:(u=Xs(u,this),delete this.simultaneous[u.id],this)},requireFailure:function(u){if(g(u,"requireFailure",this))return this;var f=this.requireFail;return u=Xs(u,this),j(f,u)===-1&&(f.push(u),u.requireFailure(this)),this},dropRequireFailure:function(u){if(g(u,"dropRequireFailure",this))return this;u=Xs(u,this);var f=j(this.requireFail,u);return f>-1&&this.requireFail.splice(f,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(u){return!!this.simultaneous[u.id]},emit:function(u){var f=this,w=this.state;function v(_){f.manager.emit(_,u)}w<re&&v(f.options.event+Pa(w)),v(f.options.event),u.additionalEvent&&v(u.additionalEvent),w>=re&&v(f.options.event+Pa(w))},tryEmit:function(u){if(this.canEmit())return this.emit(u);this.state=Ot},canEmit:function(){for(var u=0;u<this.requireFail.length;){if(!(this.requireFail[u].state&(Ot|Bs)))return!1;u++}return!0},recognize:function(u){var f=x({},u);if(!R(this.options.enable,[this,f])){this.reset(),this.state=Ot;return}this.state&(Ht|$e|Ot)&&(this.state=Bs),this.state=this.process(f),this.state&(Et|ve|re|$e)&&this.tryEmit(f)},process:function(u){},getTouchAction:function(){},reset:function(){}};function Pa(u){return u&$e?"cancel":u&re?"end":u&ve?"move":u&Et?"start":""}function Ta(u){return u==He?"down":u==qe?"up":u==Ve?"left":u==ze?"right":""}function Xs(u,f){var w=f.manager;return w?w.get(u):u}function Dt(){jt.apply(this,arguments)}C(Dt,jt,{defaults:{pointers:1},attrTest:function(u){var f=this.options.pointers;return f===0||u.pointers.length===f},process:function(u){var f=this.state,w=u.eventType,v=f&(Et|ve),_=this.attrTest(u);return v&&(w&P||!_)?f|$e:v||_?w&q?f|re:f&Et?f|ve:Et:Ot}});function Gs(){Dt.apply(this,arguments),this.pX=null,this.pY=null}C(Gs,Dt,{defaults:{event:"pan",threshold:10,pointers:1,direction:la},getTouchAction:function(){var u=this.options.direction,f=[];return u&Rt&&f.push(We),u&ue&&f.push(je),f},directionTest:function(u){var f=this.options,w=!0,v=u.distance,_=u.direction,k=u.deltaX,F=u.deltaY;return _&f.direction||(f.direction&Rt?(_=k===0?Ls:k<0?Ve:ze,w=k!=this.pX,v=Math.abs(u.deltaX)):(_=F===0?Ls:F<0?qe:He,w=F!=this.pY,v=Math.abs(u.deltaY))),u.direction=_,w&&v>f.threshold&&_&f.direction},attrTest:function(u){return Dt.prototype.attrTest.call(this,u)&&(this.state&Et||!(this.state&Et)&&this.directionTest(u))},emit:function(u){this.pX=u.deltaX,this.pY=u.deltaY;var f=Ta(u.direction);f&&(u.additionalEvent=this.options.event+f),this._super.emit.call(this,u)}});function Zi(){Dt.apply(this,arguments)}C(Zi,Dt,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[de]},attrTest:function(u){return this._super.attrTest.call(this,u)&&(Math.abs(u.scale-1)>this.options.threshold||this.state&Et)},emit:function(u){if(u.scale!==1){var f=u.scale<1?"in":"out";u.additionalEvent=this.options.event+f}this._super.emit.call(this,u)}});function Ki(){jt.apply(this,arguments),this._timer=null,this._input=null}C(Ki,jt,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[Ea]},process:function(u){var f=this.options,w=u.pointers.length===f.pointers,v=u.distance<f.threshold,_=u.deltaTime>f.time;if(this._input=u,!v||!w||u.eventType&(q|P)&&!_)this.reset();else if(u.eventType&Q)this.reset(),this._timer=d(function(){this.state=Ht,this.tryEmit()},f.time,this);else if(u.eventType&q)return Ht;return Ot},reset:function(){clearTimeout(this._timer)},emit:function(u){this.state===Ht&&(u&&u.eventType&q?this.manager.emit(this.options.event+"up",u):(this._input.timeStamp=l(),this.manager.emit(this.options.event,this._input)))}});function Qi(){Dt.apply(this,arguments)}C(Qi,Dt,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[de]},attrTest:function(u){return this._super.attrTest.call(this,u)&&(Math.abs(u.rotation)>this.options.threshold||this.state&Et)}});function tn(){Dt.apply(this,arguments)}C(tn,Dt,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:Rt|ue,pointers:1},getTouchAction:function(){return Gs.prototype.getTouchAction.call(this)},attrTest:function(u){var f=this.options.direction,w;return f&(Rt|ue)?w=u.overallVelocity:f&Rt?w=u.overallVelocityX:f&ue&&(w=u.overallVelocityY),this._super.attrTest.call(this,u)&&f&u.offsetDirection&&u.distance>this.options.threshold&&u.maxPointers==this.options.pointers&&c(w)>this.options.velocity&&u.eventType&q},emit:function(u){var f=Ta(u.offsetDirection);f&&this.manager.emit(this.options.event+f,u),this.manager.emit(this.options.event,u)}});function Us(){jt.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}C(Us,jt,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[$i]},process:function(u){var f=this.options,w=u.pointers.length===f.pointers,v=u.distance<f.threshold,_=u.deltaTime<f.time;if(this.reset(),u.eventType&Q&&this.count===0)return this.failTimeout();if(v&&_&&w){if(u.eventType!=q)return this.failTimeout();var k=this.pTime?u.timeStamp-this.pTime<f.interval:!0,F=!this.pCenter||Os(this.pCenter,u.center)<f.posThreshold;this.pTime=u.timeStamp,this.pCenter=u.center,!F||!k?this.count=1:this.count+=1,this._input=u;var tt=this.count%f.taps;if(tt===0)return this.hasRequireFailures()?(this._timer=d(function(){this.state=Ht,this.tryEmit()},f.interval,this),Et):Ht}return Ot},failTimeout:function(){return this._timer=d(function(){this.state=Ot},this.options.interval,this),Ot},reset:function(){clearTimeout(this._timer)},emit:function(){this.state==Ht&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}});function Wt(u,f){return f=f||{},f.recognizers=X(f.recognizers,Wt.defaults.preset),new en(u,f)}Wt.VERSION="2.0.7",Wt.defaults={domEvents:!1,touchAction:Ca,enable:!0,inputTarget:null,inputClass:null,preset:[[Qi,{enable:!1}],[Zi,{enable:!1},["rotate"]],[tn,{direction:Rt}],[Gs,{direction:Rt},["swipe"]],[Us],[Us,{event:"doubletap",taps:2},["tap"]],[Ki]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};var md=1,_a=2;function en(u,f){this.options=x({},Wt.defaults,f||{}),this.options.inputTarget=this.options.inputTarget||u,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=u,this.input=zu(this),this.touchAction=new Ji(this,this.options.touchAction),Da(this,!0),y(this.options.recognizers,function(w){var v=this.add(new w[0](w[1]));w[2]&&v.recognizeWith(w[2]),w[3]&&v.requireFailure(w[3])},this)}en.prototype={set:function(u){return x(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?_a:md},recognize:function(u){var f=this.session;if(!f.stopped){this.touchAction.preventDefaults(u);var w,v=this.recognizers,_=f.curRecognizer;(!_||_&&_.state&Ht)&&(_=f.curRecognizer=null);for(var k=0;k<v.length;)w=v[k],f.stopped!==_a&&(!_||w==_||w.canRecognizeWith(_))?w.recognize(u):w.reset(),!_&&w.state&(Et|ve|re)&&(_=f.curRecognizer=w),k++}},get:function(u){if(u instanceof jt)return u;for(var f=this.recognizers,w=0;w<f.length;w++)if(f[w].options.event==u)return f[w];return null},add:function(u){if(g(u,"add",this))return this;var f=this.get(u.options.event);return f&&this.remove(f),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 f=this.recognizers,w=j(f,u);w!==-1&&(f.splice(w,1),this.touchAction.update())}return this},on:function(u,f){if(u!==i&&f!==i){var w=this.handlers;return y(Z(u),function(v){w[v]=w[v]||[],w[v].push(f)}),this}},off:function(u,f){if(u!==i){var w=this.handlers;return y(Z(u),function(v){f?w[v]&&w[v].splice(j(w[v],f),1):delete w[v]}),this}},emit:function(u,f){this.options.domEvents&&pd(u,f);var w=this.handlers[u]&&this.handlers[u].slice();if(!(!w||!w.length)){f.type=u,f.preventDefault=function(){f.srcEvent.preventDefault()};for(var v=0;v<w.length;)w[v](f),v++}},destroy:function(){this.element&&Da(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}};function Da(u,f){var w=u.element;if(w.style){var v;y(u.options.cssProps,function(_,k){v=gt(w.style,k),f?(u.oldCssProps[v]=w.style[v],w.style[v]=_):w.style[v]=u.oldCssProps[v]||""}),f||(u.oldCssProps={})}}function pd(u,f){var w=e.createEvent("Event");w.initEvent(u,!0,!0),w.gesture=f,f.target.dispatchEvent(w)}x(Wt,{INPUT_START:Q,INPUT_MOVE:Lt,INPUT_END:q,INPUT_CANCEL:P,STATE_POSSIBLE:Bs,STATE_BEGAN:Et,STATE_CHANGED:ve,STATE_ENDED:re,STATE_RECOGNIZED:Ht,STATE_CANCELLED:$e,STATE_FAILED:Ot,DIRECTION_NONE:Ls,DIRECTION_LEFT:Ve,DIRECTION_RIGHT:ze,DIRECTION_UP:qe,DIRECTION_DOWN:He,DIRECTION_HORIZONTAL:Rt,DIRECTION_VERTICAL:ue,DIRECTION_ALL:la,Manager:en,Input:Ct,TouchAction:Ji,TouchInput:Fs,MouseInput:Ns,PointerEventInput:ji,TouchMouseInput:Wi,SingleTouchInput:wa,Recognizer:jt,AttrRecognizer:Dt,Tap:Us,Pan:Gs,Swipe:tn,Pinch:Zi,Rotate:Qi,Press:Ki,on:Y,off:H,each:y,merge:S,extend:b,assign:x,inherit:C,bindFn:L,prefixed:gt});var gd=typeof t<"u"?t:typeof self<"u"?self:{};gd.Hammer=Wt,typeof i=="function"&&i.amd?i(function(){return Wt}):n.exports?n.exports=Wt:t[s]=Wt})(window,document,"Hammer")})(Qn);var hh=Qn.exports;const ch=oh(hh);class tr{constructor(){}static getFormatKeyNames(t){const e=ei(),s=[];return t.ctrl&&s.push(e?"Cmd":"Ctrl"),t.shift&&s.push("Shift"),t.alt&&s.push("Alt"),typeof t.key=="string"?s.push(zs(t.key)):Array.isArray(t.key)&&(t.key.map(i=>zs(i)),s.push(...t.key)),s}static matchKeyScheme(t,e){const s=t.ctrl??!1,i=t.shift??!1,r=t.alt??!1;if(t.exact)return(s===e.metaKey||s===e.ctrlKey)&&i===e.shiftKey&&r===e.altKey;const a=[];return s&&a.push(s===e.metaKey||s===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 s=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(h=>h.toLowerCase()===o.key.toLowerCase())&&this.matchKeyScheme(t,o)){o.preventDefault();const h=e(o);if(typeof h!="function")return;const c=l=>{l.preventDefault(),h(l),s.removeEventListener("keyup",c)};s.addEventListener("keyup",c)}};return e.title=t?.title??"",e.formatedKeyNames=r,e.pause=()=>i=!0,e.restart=()=>i=!1,e.removeListener=()=>s.removeEventListener("keydown",a),s.addEventListener("keydown",a),e}}const lh={BACKSPACE:8,TAB:9,COMMA:188,DELETE:46,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,UP:38,DOWN:40,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32};class er extends Ws{container;width;height;mousePoint={x:0,y:0,dx:0,dy:0,dStartX:0,dStartY:0};hammer;removes=[];constructor(t=document.documentElement,e=!0,s){super(),this.container=t,this.width=t.offsetWidth,this.height=t.offsetHeight,this.hammer=new ch(this.container),e&&this.start(s)}emitDebounce=za((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}start(t){this.registerMouseEventListeners(),this.registerTransitionEventListeners(),this.registerAnimationEventListeners(),this.registerResizeObserver(),this.registerElementDisplayInParent(),t&&t.forEach(e=>{this.addRemoves(e())}),this.on("pointerMove",e=>{this.setMousePoint(Pt(e,this.container))})}destroy(){this.removes.forEach(t=>t()),this.removes=[],this.removeAllListeners()}restart(){this.destroy(),this.start()}addRemoves(t){this.removes.push(t)}registerMouseEventListeners(){const t=P=>{this.emit("mouseDown",P)},e=P=>{this.emit("mouseUp",P)},s=P=>{this.emit("mouseMove",P)},i=P=>{this.emit("mouseOver",P)},r=P=>{this.emit("mouseOut",P)},a=P=>{this.emit("mouseEnter",P)},o=P=>{this.emit("mouseLeave",P)},h=P=>{this.emit("mouseClick",P)},c=P=>{this.emit("mouseDoubleClick",P)},l=P=>{this.emit("mouseWheel",P)},d=P=>{this.emit("mouseContextMenu",P)},g=P=>{this.emit("touchStart",P)},y=P=>{this.emit("touchEnd",P)},m=P=>{this.emit("touchCancel",P)},x=P=>{this.emit("touchMove",P)},b=P=>{this.emit("pointerDown",P)},S=P=>{this.emit("pointerUp",P)},C=P=>{this.emit("pointerCancel",P)},L=P=>{this.emit("pointerMove",P)},R=P=>{this.emit("pan",P)},X=P=>{this.emit("panStart",P)},Y=P=>{this.emit("panMove",P)},H=P=>{this.emit("panEnd",P)},at=P=>{this.emit("panCancel",P)},J=P=>{this.emit("panLeft",P)},Z=P=>{this.emit("panRight",P)},j=P=>{this.emit("panUp",P)},ot=P=>{this.emit("panDown",P)},St=P=>{this.emit("pinch",P)},gt=P=>{this.emit("press",P)},xe=P=>{this.emit("rotate",P)},ne=P=>{this.emit("swipe",P)},le=P=>{this.emit("swipeLeft",P)},be=P=>{this.emit("swipeRight",P)},M=P=>{this.emit("swipeUp",P)},D=P=>{this.emit("swipeDown",P)},N=P=>{this.emit("tap",P)},G=P=>{!P.target||this.container==P.target||this.container.contains(P.target)||this.emit("tapOutSide",P)},ut=P=>{this.emit("inputChange",P,this.container.files)},_t=P=>{this.emit("dragstart",P)},ks=P=>{P.dataTransfer&&(P.dataTransfer.dropEffect="copy"),this.emit("dragover",P)},Ms=P=>{this.emit("dragenter",P)},Q=P=>{this.emit("dragend",P)},Lt=P=>{P.dataTransfer,this.emit("drop",P,P.dataTransfer?.files)};this.container.addEventListener("mousedown",t,!1),this.container.addEventListener("mouseup",e,!1),this.container.addEventListener("mousemove",s,!1),this.container.addEventListener("mouseover",i,!1),this.container.addEventListener("mouseout",r,!1),this.container.addEventListener("mouseenter",a,!1),this.container.addEventListener("mouseleave",o,!1),this.container.addEventListener("click",h,!1),this.container.addEventListener("dblclick",c,!1),this.container.addEventListener("wheel",l,!1),this.container.addEventListener("contextmenu",d,!1),this.container.addEventListener("touchstart",g,!1),this.container.addEventListener("touchend",y,!1),this.container.addEventListener("touchcancel",m,!1),this.container.addEventListener("touchmove",x,!1),this.container.addEventListener("pointerdown",b,!1),this.container.addEventListener("pointerup",S,!1),this.container.addEventListener("pointercancel",C,!1),this.container.addEventListener("pointermove",L,!1),this.hammer.on("pan",R),this.hammer.on("panstart",X),this.hammer.on("panmove",Y),this.hammer.on("panend",H),this.hammer.on("pancancel",at),this.hammer.on("panleft",J),this.hammer.on("panright",Z),this.hammer.on("panup",j),this.hammer.on("pandown",ot),this.hammer.on("pinch",St),this.hammer.on("press",gt),this.hammer.on("rotate",xe),this.hammer.on("swipe",ne),this.hammer.on("swipeleft",le),this.hammer.on("swiperight",be),this.hammer.on("swipeup",M),this.hammer.on("swipedown",D),this.hammer.on("tap",N),document.addEventListener("pointerdown",G,!1),this.container instanceof HTMLInputElement&&this.container.addEventListener("change",ut,!1),this.container.addEventListener("dragstart",_t,!1),this.container.addEventListener("dragover",ks,!1),this.container.addEventListener("dragenter",Ms,!1),this.container.addEventListener("dragend",Q,!1),this.container.addEventListener("drop",Lt,!1);const q=()=>{this.container.removeEventListener("mousedown",t,!1),this.container.removeEventListener("mouseup",e,!1),this.container.removeEventListener("mousemove",s,!1),this.container.removeEventListener("mouseover",i,!1),this.container.removeEventListener("mouseout",r,!1),this.container.removeEventListener("mouseenter",a,!1),this.container.removeEventListener("mouseleave",o,!1),this.container.removeEventListener("click",h,!1),this.container.removeEventListener("dblclick",c,!1),this.container.removeEventListener("wheel",l,!1),this.container.removeEventListener("contextmenu",d,!1),this.container.removeEventListener("touchstart",g,!1),this.container.removeEventListener("touchend",y,!1),this.container.removeEventListener("touchcancel",m,!1),this.container.removeEventListener("touchmove",x,!1),this.container.removeEventListener("pointerdown",b,!1),this.container.removeEventListener("pointerup",S,!1),this.container.removeEventListener("pointercancel",C),this.container.removeEventListener("pointermove",L,!1),this.hammer.off("pan",R),this.hammer.off("panstart",X),this.hammer.off("panmove",Y),this.hammer.off("panend",H),this.hammer.off("pancancel",at),this.hammer.off("panleft",J),this.hammer.off("panright",Z),this.hammer.off("panup",j),this.hammer.off("pandown",ot),this.hammer.off("pinch",St),this.hammer.off("press",gt),this.hammer.off("rotate",xe),this.hammer.off("swipe",ne),this.hammer.off("swipeleft",le),this.hammer.off("swiperight",be),this.hammer.off("swipeup",M),this.hammer.off("swipedown",D),this.hammer.off("tap",N),document.removeEventListener("pointerdown",G,!1),document.removeEventListener("touchstart",G,!1),document.removeEventListener("mousedown",G,!1),this.container instanceof HTMLInputElement&&this.container.removeEventListener("change",ut,!1),this.container.removeEventListener("dragstart",_t,!1),this.container.removeEventListener("dragover",ks,!1),this.container.removeEventListener("dragenter",Ms,!1),this.container.removeEventListener("dragend",Q,!1),this.container.removeEventListener("drop",Lt,!1)};return this.addRemoves(q),q}registerTransitionEventListeners(){const t=i=>{this.emit("transitionstart",i)},e=i=>{this.emit("transitionend",i)};this.container.addEventListener("transitionstart",t,!1),this.container.addEventListener("transitionend",e,!1);const s=()=>{this.container.removeEventListener("transitionstart",t,!1),this.container.removeEventListener("transitionend",e,!1)};return this.addRemoves(s),s}registerAnimationEventListeners(){const t=i=>{this.emit("animationstart",i)},e=i=>{this.emit("animationend",i)};this.container.addEventListener("animationstart",t,!1),this.container.addEventListener("animationend",e,!1);const s=()=>{this.container.removeEventListener("animationstart",t,!1),this.container.removeEventListener("animationend",e,!1)};return this.addRemoves(s),s}registerKeyDown(t,e,s){const i=tr.on(t,a=>(e(a,i.formatedKeyNames,i.pause,i.restart),s)),r=()=>{i.removeListener?.()};return this.addRemoves(r),r}registerResizeObserver(){let t;if(typeof ResizeObserver<"u"){const e=new ResizeObserver(s=>{const{width:i,height:r}=s[0].contentRect;this.width=i,this.height=r,this.emit("resize",i,r)});e.observe(this.container),t=()=>{e.unobserve(this.container)}}else{const e="orientationchange"in window?"orientationchange":"resize",s=i=>{const r=i.target.innerWidth,a=i.target.innerHeight;this.emit("resize",r,a)};window.addEventListener(e,s,!1),t=()=>{window.removeEventListener(e,s,!1)}}return this.addRemoves(t),t}registerElementDisplayInParent(t){const e={threshold:t?.threshold||.5,root:t?.parentElement},s=new IntersectionObserver((r,a)=>{let o=r[0];if(r.length>1){const c=r.find(l=>l.isIntersecting);c&&(o=c)}o.isIntersecting&&o.intersectionRatio>=e.threshold?this.emit("showInParent"):this.emit("showOffParent")},e);s.observe(this.container);const i=()=>{s.unobserve(this.container)};return this.addRemoves(i),i}registerPullDownRefresh(t){const e=t?.distance||50;return this.captureDrag({move:(s,i)=>{i.dStartY>0&&i.dStartY<e&&this.emit("pullDowning",i.dStartY)},end:(s,i)=>{i.dStartY>=e&&this.emit("pullDown")}})}registerPullUpLoading(t){const e=t?.distance||50;return this.captureDrag({move:(s,i)=>{i.dStartY>0&&i.dStartY<e&&this.emit("pullUping",i.dStartY)},end:(s,i)=>{i.dStartY>=e&&this.emit("pullUp")}})}setMousePoint(t){this.mousePoint.x=t.x,this.mousePoint.y=t.y,this.mousePoint.dx=typeof t.dx=="number"?t.dx:0,this.mousePoint.dy=typeof t.dy=="number"?t.dy:0,this.mousePoint.dStartX=typeof t.dStartX=="number"?t.dStartX:0,this.mousePoint.dStartY=typeof t.dStartY=="number"?t.dStartY:0}captureDrag(t){return this.captureDragUsePointer(t)}captureDragUsePointer(t){let e,s;const i=h=>{h.preventDefault(),h.stopPropagation(),this.on("pointerMove",a),this.on("pointerUp",r),this.on("pointerCancel",r),s=Pt(h,this.container);const c={...s};e=c,this.setMousePoint(c),t?.start?.(h,c)},r=h=>{h.preventDefault(),h.stopPropagation(),this.off("pointerMove",a),this.off("pointerUp",r),this.off("pointerCancel",r),s=Pt(h,this.container);const c={...s,dStartX:e?s.x-e.x:0,dStartY:e?s.y-e.y:0};this.setMousePoint(c),t?.end?.(h,c),e=null},a=h=>{h.preventDefault(),h.stopPropagation();const c={...s};s=Pt(h,this.container);const l={...s,dx:s.x-(c.x||0),dy:s.y-(c.y||0),dStartX:e?s.x-e.x:0,dStartY:e?s.y-e.y:0};this.setMousePoint(l),t?.move?.(h,l)};this.on("pointerDown",i);const o=()=>{this.off("pointerDown",i)};return this.addRemoves(o),o}captureDragUseMouse(t){let e,s;const i=h=>{h.preventDefault(),h.stopPropagation(),document.addEventListener("mousemove",a,!1),document.addEventListener("mouseup",r,!1),s=Pt(h,this.container);const c={...s};e=c,this.setMousePoint(c),t?.start?.(h,c)},r=h=>{h.preventDefault(),h.stopPropagation(),document.removeEventListener("mousemove",a,!1),document.removeEventListener("mouseup",r,!1),s=Pt(h,this.container);const c={...s,dStartX:e?s.x-e.x:0,dStartY:e?s.y-e.y:0};this.setMousePoint(c),t?.end?.(h,c),e=null},a=h=>{h.preventDefault(),h.stopPropagation();const c={...s};s=Pt(h,this.container);const l={...s,dx:s.x-(c.x||0),dy:s.y-(c.y||0),dStartX:e?s.x-e.x:0,dStartY:e?s.y-e.y:0};this.setMousePoint(l),t?.move?.(h,l)};this.on("mouseDown",i);const o=()=>{this.off("mouseDown",i)};return this.addRemoves(o),o}captureDragUseTouch(t){let e,s;const i=h=>{h.preventDefault(),h.stopPropagation(),this.on("touchMove",a),this.on("touchEnd",r),this.on("touchCancel",r);const c=h.changedTouches[0];s=Pt(c,this.container);const l={...s};e=l,this.setMousePoint(l),t?.start?.(c,l)},r=h=>{h.preventDefault(),h.stopPropagation(),this.off("touchMove",a),this.off("touchEnd",r),this.off("touchCancel",r);const c=h.changedTouches[0];s=Pt(c,this.container);const l={...s,dStartX:e?s.x-e.x:0,dStartY:e?s.y-e.y:0};this.setMousePoint(l),t?.end?.(c,l),e=null},a=h=>{h.preventDefault(),h.stopPropagation();const c=h.changedTouches[0],l={...s};s=Pt(c,this.container);const d={...s,dx:s.x-(l.x||0),dy:s.y-(l.y||0),dStartX:e?s.x-e.x:0,dStartY:e?s.y-e.y:0};this.setMousePoint(d),t?.move?.(c,d)};this.on("touchStart",i);const o=()=>{this.off("touchStart",i)};return this.addRemoves(o),o}}const nt=new er(document.documentElement,!0,[()=>uh("(prefers-color-scheme: dark)"),dh,mh,fh]);nt.registerKeyDown({title:"打开",key:"o",ctrl:!0,exact:!0},()=>{Sn().then(n=>es(n[0])).then(n=>{nt.emit("openFile",n)}).catch(n=>{nt.emit("openFileError",n)})});function uh(n){let t="";switch(n){case"(prefers-color-scheme: dark)":t="matchMediaChangePrefersColorSchemeDark";break;default:t=n;break}const e=s=>{nt.emit(t,s.matches)};return window.matchMedia(n).addEventListener("change",e,!1),()=>{window.matchMedia(n).removeEventListener("change",e,!1)}}function dh(){let n="";const t=new MutationObserver(i=>{location.href!==n&&(n=location.href,nt.emit("urlchange",location.href))});t.observe(document,{attributes:!0,childList:!0,subtree:!0});const e=()=>{nt.emit("hashchange",location.hash)};window.addEventListener("hashchange",e,!1);const s=()=>{nt.emit("popstate")};return window.addEventListener("popstate",s,!1),()=>{t.disconnect(),window.removeEventListener("hashchange",e,!1),window.removeEventListener("popstate",s,!1)}}function fh(){const n=r=>{nt.emit("beforeunload",r)};window.addEventListener("beforeunload",n,!1);const t=r=>{nt.emit("pagehide",r)};window.addEventListener("pagehide",t,!1);const e=r=>{nt.emit("windowFocus",r)};window.addEventListener("focus",e,!1);const s=r=>{nt.emit("windowBlur",r)};window.addEventListener("blur",s,!1);const i=r=>{document.hidden?nt.emit("windowVisibilityChangeHide",r):nt.emit("windowVisibilityChangeShow",r)};return document.addEventListener("visibilitychange",i,!1),()=>{window.removeEventListener("beforeunload",n,!1),window.removeEventListener("pagehide",t,!1),window.removeEventListener("focus",e,!1),window.removeEventListener("blur",s,!1),document.removeEventListener("visibilitychange",i,!1)}}function mh(){const n=t=>{nt.emit("scroll",t)};return document.addEventListener("scroll",n,!1),()=>{document.removeEventListener("scroll",n,!1)}}const ph=n=>{let t=!1;function e(){if(document.readyState!=="loading"){if(t){document.removeEventListener("DOMContentLoaded",e,!1);return}t=!0,document.removeEventListener("DOMContentLoaded",e,!1),n()}}document.addEventListener("DOMContentLoaded",e,!1),e()};class Le{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"),s=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)",s.append(i),e.width="5",e.style.cssText="position: absolute; visibility: hidden;",document.documentElement.append(e),e.contentDocument?.body.append(s),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(()=>{Le.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 sr extends Ws{source;raw="";mode="text";tagname="";nodename="";textchunk="";entity="";quote="";attrs={};constructor(t){super(),this.source=t}parse(){const t=Aa(this.source);if(t===0){this.emit("finish");return}let e,s,i=an(this.source,0);for(let r=1;r<t;r++)e=s,s=i,i=an(this.source,r),this.raw+=s,s&&this.step(s,i,e);i&&this.step(i,void 0,s),this.emit("finish")}step(t,e,s){t==`
25
+ `&&this.emit("newline"),this.act(t,e,s)}act(t,e,s){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":Ft("whitespace",t)?(this.textchunk+=A.entity2text(this.entity),this.mode="text"):t==";"?(this.textchunk+=A.entity2text(this.entity+t),this.mode="text"):this.entity+=t;break;case"special":if(s=="!"&&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(s=="]"&&t=="]"&&e==">"){this.mode="cdata end",this.textchunk=this.textchunk.slice(0,-1);break}t=="eof"&&(this.mode="cdata end",this.act(t,e,s)),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=="-"&&s=="-"&&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(!Ft("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,s)}break;case"close tag name start":Ft("whitespace",t)||(this.mode="close tag name",this.tagname="",this.nodename="",this.act(t,e,s));break;case"close tag name":if(Ft("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(Ft("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":Ft("whitespace",t)||(this.mode="attr",this.nodename="",this.act(t,e,s));break;case"attr":if(Ft("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(!Ft("whitespace",t)){if(this.mode="attr value",this.quote="",t=="'"||t=='"'){this.quote=t;return}this.act(t,e,s)}break;case"attr value":if(Ft("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&&s!="\\"&&(this.mode="attr start");break;default:this.attrs[this.nodename]+=t;break}break}}}function yi(n,t,e){if(typeof t<"u")window.localStorage.setItem(n,JSON.stringify({value:t,expires:typeof e=="number"?e:-1}));else{const s=window.localStorage.getItem(n);try{const i=JSON.parse(s||"");return"expires"in i&&parseInt(i.expires)>=0&&new Date().getTime()>parseInt(i.expires)?void 0:i.value||void 0}catch{return s||void 0}}}function gh(n,t,e){const s=new Date;s.setTime(s.getTime()+e*24*60*60*1e3);const i="expires="+s.toUTCString();document.cookie=n+"="+t+"; "+i}function yh(n){const t=n+"=",e=document.cookie.split(";");for(let s=0,i=e.length;s<i;s++){const r=e[s].trim();if(r.indexOf(t)==0)return r.substring(t.length,r.length)}return""}const wh=()=>document.cookie.split(";").map(n=>n.split("=")).reduce((n,[t,e])=>(n[t.trim().replace('"',"")]=e,n),{}),xh=()=>document.cookie.split(";").forEach(n=>document.cookie=n.replace(/^ +/,"").replace(/=.*/,`=;expires=${new Date().toUTCString()};path=/`));nt.on("matchMediaChangePrefersColorSchemeDark",n=>{gs(n?"dark":"light")}),ir();function gs(n){yi("ColorScheme",n),document.documentElement.classList.toggle("dark",n=="dark")}function ir(){const n=yi("ColorScheme");if(n=="dark"||n=="light")return gs(n),n;{const t=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";return gs(t),t}}const wi={safeAreaTop:A.getCSSVar("--safe-area-inset-top"),safeAreaRight:A.getCSSVar("--safe-area-inset-right"),safeAreaBottom:A.getCSSVar("--safe-area-inset-bottom"),safeAreaLeft:A.getCSSVar("--safe-area-inset-left"),colorPrimary:A.getCSSVar("--color-primary")||"#5078f0",colorRed:A.getCSSVar("--color-red")||"#ff5050",colorOrange:A.getCSSVar("--color-orange")||"#fa8c00",colorYellow:A.getCSSVar("--color-yellow")||"#fadc32",colorGreen:A.getCSSVar("--color-green")||"#00c878",colorBlue:A.getCSSVar("--color-blue")||"#00b4fa",colorPurple:A.getCSSVar("--color-purple")||"#6464fa",colorBlack:A.getCSSVar("--color-black")||"#001428",colorGray00:A.getCSSVar("--color-gray-00")||"#000000",colorGray33:A.getCSSVar("--color-gray-33")||"#333333",colorGray66:A.getCSSVar("--color-gray-66")||"#666666",colorGray99:A.getCSSVar("--color-gray-99")||"#999999",colorGrayCC:A.getCSSVar("--color-gray-cc")||"#cccccc",colorGrayDD:A.getCSSVar("--color-gray-dd")||"#dddddd",colorGrayE6:A.getCSSVar("--color-gray-e6")||"#e6e6e6",colorGrayEE:A.getCSSVar("--color-gray-ee")||"#eeeeee",colorGrayEF:A.getCSSVar("--color-gray-ef")||"#efefef",colorGrayF5:A.getCSSVar("--color-gray-f5")||"#f5f5f5",colorGrayFF:A.getCSSVar("--color-gray-ff")||"#ffffff",fontLineHeight:A.getCSSVar("--font-line-height")||"1.4",fontSize32:A.getCSSVar("--font-size-32")||"32px",fontSize24:A.getCSSVar("--font-size-24")||"24px",fontSize22:A.getCSSVar("--font-size-22")||"22px",fontSize20:A.getCSSVar("--font-size-20")||"20px",fontSize18:A.getCSSVar("--font-size-18")||"18px",fontSize16:A.getCSSVar("--font-size-16")||"16px",fontSize14:A.getCSSVar("--font-size-14")||"14px",fontSize12:A.getCSSVar("--font-size-12")||"12px",fontSize10:A.getCSSVar("--font-size-10")||"10px",d4:A.getCSSVar("--distance-4")||"4px",d8:A.getCSSVar("--distance-8")||"8px",d12:A.getCSSVar("--distance-12")||"12px",d16:A.getCSSVar("--distance-16")||"16px",d20:A.getCSSVar("--distance-20")||"20px",d32:A.getCSSVar("--distance-32")||"32px",d40:A.getCSSVar("--distance-40")||"40px",d44:A.getCSSVar("--distance-44")||"44px"};class lt{__color={r:0,g:0,b:0,a:1};constructor(t,e){t&&this.setColor(t),typeof e=="number"&&this.setAlpha(e)}get color(){return this.__color}set color(t){this.__color=xi(t)}setColor(t){return this.color=t,this}get r(){return this.__color.r}set r(t){this.__color.r=V(Math.round(t),0,255)}get g(){return this.__color.g}set g(t){this.__color.g=V(Math.round(t),0,255)}get b(){return this.__color.b}set b(t){this.__color.b=V(Math.round(t),0,255)}get a(){return this.__color.a}set a(t){this.__color.a=V(t,0,1)}setAlpha(t){return this.a=t,this}setRGB(t,e,s){return this.r=t,this.g=e,this.b=s,this}setRGBA(t,e,s,i){return this.r=t,this.g=e,this.b=s,this.a=i,this}get hex(){return(this.r<<16)+(this.g<<8)+this.b}toString(){if(this.a===1){const t="000000"+this.hex.toString(16);return"#"+t.slice(t.length-6)}else return`rgba(${this.r},${this.g},${this.b},${At(this.a,6)})`}clone(){return new lt(this.color)}copy(t){this.setColor(t.color)}opposite(t=!1,e="#000000",s="#ffffff"){if(t)return new lt(this.r*.299+this.g*.587+this.b*.114>186?e:s);{const i=this.clone();return i.r=255-i.r,i.g=255-i.g,i.b=255-i.b,i}}lighten(t){t=V(Math.abs(t),0,1);let{r:e,g:s,b:i,a:r}=this.color;return e+=(255-e)*t,s+=(255-s)*t,i+=(255-i)*t,new lt().setRGBA(e,s,i,r)}darken(t){t=V(Math.abs(t),0,1);let{r:e,g:s,b:i,a:r}=this.color;return e=e*(1-t),s=s*(1-t),i=i*(1-t),new lt().setRGBA(e,s,i,r)}static gradient(t,e,s){try{const i=xi(t),r=xi(e);return new lt().setRGB((r.r-i.r)*s+i.r,(r.g-i.g)*s+i.g,(r.b-i.b)*s+i.b)}catch{return new lt(e)}}static random(){return new lt(Math.random()*16777215)}get hsv(){const{r:t,g:e,b:s,a:i}=this.color,r=Math.max(t,e,s),a=Math.min(t,e,s),o=r-a;let h;return t===r?h=(e-s)/o:e===r?h=2+(s-t)/o:h=4+(t-e)/o,h/=6,h<0&&(h+=1),{h:o==0?0:h*360,s:r===0?0:o/r,v:r/255,a:i}}set h(t){const e=this.hsv;e.h=V(t,0,360),this.setColor(e)}get h(){return this.hsv.h}set s(t){const e=this.hsv;e.s=V(t,0,1),this.setColor(e)}get s(){return this.hsv.s}set v(t){const e=this.hsv;e.v=V(t,0,1),this.setColor(e)}get v(){return this.hsv.v}}function Re(n,t){return new lt(n,t)}function xi(n){const t=Object.prototype.hasOwnProperty.call(n,"a")?V(n.a,0,1):1;if(Object.prototype.hasOwnProperty.call(n,"r")&&Object.prototype.hasOwnProperty.call(n,"g")&&Object.prototype.hasOwnProperty.call(n,"b"))return n.r=V(Math.round(n.r),0,255),n.g=V(Math.round(n.g),0,255),n.b=V(Math.round(n.b),0,255),n.a=t,n;if(Object.prototype.hasOwnProperty.call(n,"h")&&Object.prototype.hasOwnProperty.call(n,"s")&&Object.prototype.hasOwnProperty.call(n,"v")){let s=V(n.h,0,360),i=V(n.s,0,1),r=V(n.v,0,1);const a=Math.floor(s/60)%6,o=s/60-Math.floor(s/60),h=r*(1-i),c=r*(1-o*i),l=r*(1-(1-o)*i),d=[[r,l,h],[c,r,h],[h,r,l],[h,c,r],[l,h,r],[r,h,c]][a];return{r:Math.round(d[0]*255),g:Math.round(d[1]*255),b:Math.round(d[2]*255),a:t}}const e={r:0,g:0,b:0,a:t};if(typeof n=="number")n<Math.pow(2,24)?(e.r=n>>16&255,e.g=n>>8&255,e.b=n&255):(e.r=n>>24&255,e.g=n>>16&255,e.b=n>>8&255,e.a=(n&255)/255);else if(typeof n=="string"){const s=/rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,?\s*(\d?\.?\d*)?\s*\)/gi.exec(n);if(s)e.r=parseInt(s[1]),e.g=parseInt(s[2]),e.b=parseInt(s[3]),s[4]&&(e.a=parseFloat(s[4]));else{let i=n.match(/^#([A-F0-9])([A-F0-9])([A-F0-9])$/i);i?(e.r=parseInt(`${i[1]}${i[1]}`,16),e.g=parseInt(`${i[2]}${i[2]}`,16),e.b=parseInt(`${i[3]}${i[3]}`,16)):(i=n.match(/^#([A-F0-9]{2})([A-F0-9]{2})([A-F0-9]{2})$/i),i?(e.r=parseInt(i[1],16),e.g=parseInt(i[2],16),e.b=parseInt(i[3],16)):(i=n.match(/^#([A-F0-9]{2})([A-F0-9]{2})([A-F0-9]{2})([A-F0-9]{2})$/i),i?(e.r=parseInt(i[1],16),e.g=parseInt(i[2],16),e.b=parseInt(i[3],16),e.a=parseInt(i[4],16)/255):n==="none"&&(e.a=0)))}}else throw new Error("parseColor 不支持的颜色解析:"+n);return e.r=V(e.r,0,255),e.g=V(e.g,0,255),e.b=V(e.b,0,255),e.a=V(e.a,0,1),e}const nr=["#0ac2d2","#7bb7fa","#60d7a9","#fdc162","#fd6a62","#f68dbb","#26ccff","#a25afd","#ff5e7e","#88ff5a","#fcff42","#ffa62d","#ff36ff","#dc4916","#6871b1","#d1b935","#1bbc9b","#FF7F50","#4BBFC3","#ff9900"],he={backgroundColor:"#1a1a1a",numberColor:"#2FA1D6",booleanColor:"#806787",stringColor:"#1ed36f",functionColor:"#e61d5f",saveRowColor:"#dad5cb",buttonColor:"",borderColor:"",inputColor:""};he.buttonColor=new lt(he.saveRowColor).darken(.1).toString(),he.borderColor=new lt(he.backgroundColor).lighten(.07).toString(),he.inputColor=new lt(he.backgroundColor).lighten(.085).toString();function ys(n=window.location.href){return fn(URL)?new URL(n):rr(n)}function rr(n=window.location.href){const t="(?<protocol>https?:)",e="(?<host>(?<hostname>[^/#?:]+)(?::(?<port>\\d+))?)",s="(?<pathname>(?:\\/[^/#?]+)*\\/?)",i="(?<search>(?:\\?[^#]*)?)",r="(?<hash>(?:#.*)?)",o=new RegExp(`^${t}//${e}${s}${i}${r}$`).exec(n);return{href:n,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 bh(n){const t=ys(n);return t.protocol==="http:"||t.protocol==="https:"}function ar(n=window.location.href){const t=ys(n),e=t.href.indexOf(t.hash);return t.hash&&e>=0?t.href.substring(0,e):t.href}function vh(n=ys().search){n=decodeURIComponent(n).replace(/^[#?&]/,"");const t={};if(!n)return t;const e=/(?:^|&)([^&=]*)=?([^&]*?)(?=&|$)/y;let s=e.exec(n);for(;s;)t[s[1]]=s[2],s=e.exec(n);return t}function ws(n){return"?"+Object.entries(n).map(([t,e])=>`${encodeURIComponent(t)}=${encodeURIComponent(e)}`).join("&")}function or(n){return"?"+[...n.entries()].map(t=>encodeURIComponent(t[0])+"="+encodeURIComponent(t[1]instanceof File?t[1].name:t[1])).join("&")}function hr(n,t){return n.replace(/(?:\?.*)?$/,t.replace(/^[&?]/,"?"))}function Sh(n,t){return hr(n,ws(t))}function bi(n,t){return n+t.replace(/^[&?]/,n.indexOf("?")>=0?"&":"?")}function Ch(n,t){return bi(n,ws(t))}class Eh{worker;cbs={};constructor(t){if(Ln)try{this.worker=new Worker(URL.createObjectURL(new Blob([t])))}catch(e){throw typeof console!==void 0&&typeof console.warn=="function"&&console.warn("🎊 Could not load worker",e),e}else throw new Error("Your environment do not support Worker !")}postMessage(t,e=[]){this.worker.postMessage(t,e)}onmessage(t){this.worker.addEventListener("message",t)}offmessage(t){this.worker.removeEventListener("message",t)}onmessageerror(t){this.worker.addEventListener("messageerror",t)}offmessageerror(t){this.worker.removeEventListener("messageerror",t)}postCanvas(t){const e=t.transferControlToOffscreen();this.worker.postMessage({canvas:e},[e])}postPort(t){this.worker.postMessage({port:t},[t])}postReset(){this.worker.postMessage({reset:!0});for(const t in this.cbs)this.cbs[t](),delete this.cbs[t]}fire(t,e){return new Promise(s=>{if(e){const i=Math.random().toString(36).slice(2),r=a=>{a.data.id===i&&(this.worker.removeEventListener("message",r),delete this.cbs[i],e(),s())};this.cbs[i]=r.bind(this,{data:{id:i}}),this.worker.addEventListener("message",r),this.worker.postMessage({...t,id:i})}else this.worker.postMessage(t),s()})}}class Ph{port1;port2;port1MessageCbs=[];port2MessageCbs=[];port1MessageErrorCbs=[];port2MessageErrorCbs=[];constructor(){const{port1:t,port2:e}=new MessageChannel;this.port1=t,this.port2=e,this.port1.addEventListener("message",s=>{this.port1MessageCbs.forEach(i=>i(this.port1,s))}),this.port1.addEventListener("messageerror",s=>{this.port1MessageErrorCbs.forEach(i=>i(this.port1,s))}),this.port1.start(),this.port2.addEventListener("message",s=>{this.port2MessageCbs.forEach(i=>i(this.port2,s))}),this.port2.addEventListener("messageerror",s=>{this.port2MessageErrorCbs.forEach(i=>i(this.port2,s))}),this.port2.start()}close(){this.port1.close(),this.port2.close()}onPort1Message(t){this.port1MessageCbs.push(t)}onPort1MessageError(t){this.port1MessageErrorCbs.push(t)}offPort1Message(t){Ce(this.port1MessageCbs,t)}offPort1MessageError(t){Ce(this.port1MessageErrorCbs,t)}onPort2Message(t){this.port2MessageCbs.push(t)}onPort2MessageError(t){this.port2MessageErrorCbs.push(t)}offPort2Message(t){Ce(this.port2MessageCbs,t)}offPort2MessageError(t){Ce(this.port2MessageErrorCbs,t)}}function cr(){let n=null;if(window.ActiveXObject){const t=["Microsoft.XMLHTTP","MSXML6.XMLHTTP","MSXML5.XMLHTTP","MSXML4.XMLHTTP","MSXML3.XMLHTTP","MSXML2.XMLHTTP","MSXML.XMLHTTP"];for(let e=0,s=t.length;e<s;e++)try{n=new window.ActiveXObject(t[e]);break}catch{continue}}else n=new XMLHttpRequest;return n}function Th(n,t){return new Promise((e,s)=>{const{method:i="GET",data:r={},segments:a=[],headers:o={},withCredentials:h=!1,responseType:c="json",timeout:l=3e4}=t||{},d=cr();d.timeout=l,d.responseType=c,d.onreadystatechange=function(C){d.readyState===4&&(d.status===200?e(d.response):s(d.statusText))},d.ontimeout=function(){s(`${n} is timed out for ${l}ms.`)},d.addEventListener("error",function(C){s(C)},!1),d.addEventListener("progress",function(C){if(C.lengthComputable){const L=Math.round(C.loaded*100/C.total);t?.progress?.(L,d)}},!1),d.addEventListener("load",function(C){t?.load?.(C,d)},!1),d.addEventListener("loadstart",function(C){t?.loadstart?.(C,d)},!1),d.addEventListener("loadend",function(C){t?.loadend?.(C,d)},!1),d.addEventListener("abort",function(C){t?.abort?.(C,d)},!1);const g=i.toUpperCase();Object.assign(o,{Accept:"*/*"});const y="---------------------------"+Date.now().toString(16);let m=!1,x=!1,b=!1;function S(){h&&(d.withCredentials=!0);for(const C in o)ft(C).toLowerCase()=="content-type"&&o[C].toLowerCase()=="multipart/form-data"?(m=!0,d.setRequestHeader("Content-Type","multipart/form-data; boundary="+y)):(ft(C).toLowerCase()=="content-type"&&(o[C].toLowerCase().indexOf("text/plain")>=0?x=!0:o[C].toLowerCase().indexOf("application/json")>=0&&(b=!0)),d.setRequestHeader(C,o[C]))}switch(g){case"GET":let C="";r instanceof FormData?C=or(r):C=ws(r),d.open("GET",bi(n,C),!0),S(),d.send(null);break;case"POST":default:d.open(g,n,!0),S(),m&&a.length?d.sendAsBinary("--"+y+`\r
26
26
  `+a.join("--"+y+`\r
27
27
  `)+"--"+y+`--\r
28
28
  `):b?d.send(JSON.stringify(r)):d.send(Object.entries(r).map(([L,R])=>`${encodeURIComponent(L)}=${encodeURIComponent(R)}`).join(x?`\r
29
- `:"&"));break}})}async function Vh(i){const t={url:"",data:{},segments:[],contentType:""};if(!i.action)return t;t.url=i.action;const e=i.method.toLowerCase()==="post";t.contentType=e&&i.enctype?i.enctype:"application/x-www-form-urlencoded";const s=t.contentType=="multipart/form-data";for(let n=0;n<i.elements.length;n++){const r=i.elements[n];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(s)for(let h=0;h<o;h++){const c=r.files[h],l=await es(c,"binaryString");t.segments.push('Content-Disposition: form-data; name="'+r.name+'"; filename="'+c.name+`"\r
29
+ `:"&"));break}})}async function _h(n){const t={url:"",data:{},segments:[],contentType:""};if(!n.action)return t;t.url=n.action;const e=n.method.toLowerCase()==="post";t.contentType=e&&n.enctype?n.enctype:"application/x-www-form-urlencoded";const s=t.contentType=="multipart/form-data";for(let i=0;i<n.elements.length;i++){const r=n.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(s)for(let h=0;h<o;h++){const c=r.files[h],l=await es(c,"binaryString");t.segments.push('Content-Disposition: form-data; name="'+r.name+'"; filename="'+c.name+`"\r
30
30
  Content-Type: `+c.type+`\r
31
31
  \r
32
32
  `+l+`\r
33
33
  `)}else for(let h=0;h<o;h++)t.data[r.name]=r.files[h].name}else(a!=="RADIO"&&a!=="CHECKBOX"||(a=="RADIO"||a=="CHECKBOX")&&r.checked)&&(s?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 dr(i,t){return function(){return i.apply(t,arguments)}}const{toString:zh}=Object.prototype,{getPrototypeOf:bi}=Object,xs=(i=>t=>{const e=zh.call(t);return i[e]||(i[e]=e.slice(8,-1).toLowerCase())})(Object.create(null)),Dt=i=>(i=i.toLowerCase(),t=>xs(t)===i),bs=i=>t=>typeof t===i,{isArray:ye}=Array,Oe=bs("undefined");function qh(i){return i!==null&&!Oe(i)&&i.constructor!==null&&!Oe(i.constructor)&&xt(i.constructor.isBuffer)&&i.constructor.isBuffer(i)}const fr=Dt("ArrayBuffer");function Hh(i){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(i):t=i&&i.buffer&&fr(i.buffer),t}const jh=bs("string"),xt=bs("function"),mr=bs("number"),vs=i=>i!==null&&typeof i=="object",Wh=i=>i===!0||i===!1,Ss=i=>{if(xs(i)!=="object")return!1;const t=bi(i);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in i)&&!(Symbol.iterator in i)},$h=Dt("Date"),Jh=Dt("File"),Zh=Dt("Blob"),Kh=Dt("FileList"),Qh=i=>vs(i)&&xt(i.pipe),tc=i=>{let t;return i&&(typeof FormData=="function"&&i instanceof FormData||xt(i.append)&&((t=xs(i))==="formdata"||t==="object"&&xt(i.toString)&&i.toString()==="[object FormData]"))},ec=Dt("URLSearchParams"),sc=i=>i.trim?i.trim():i.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Ne(i,t,{allOwnKeys:e=!1}={}){if(i===null||typeof i>"u")return;let s,n;if(typeof i!="object"&&(i=[i]),ye(i))for(s=0,n=i.length;s<n;s++)t.call(null,i[s],s,i);else{const r=e?Object.getOwnPropertyNames(i):Object.keys(i),a=r.length;let o;for(s=0;s<a;s++)o=r[s],t.call(null,i[o],o,i)}}function pr(i,t){t=t.toLowerCase();const e=Object.keys(i);let s=e.length,n;for(;s-- >0;)if(n=e[s],t===n.toLowerCase())return n;return null}const gr=(()=>typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global)(),yr=i=>!Oe(i)&&i!==gr;function vi(){const{caseless:i}=yr(this)&&this||{},t={},e=(s,n)=>{const r=i&&pr(t,n)||n;Ss(t[r])&&Ss(s)?t[r]=vi(t[r],s):Ss(s)?t[r]=vi({},s):ye(s)?t[r]=s.slice():t[r]=s};for(let s=0,n=arguments.length;s<n;s++)arguments[s]&&Ne(arguments[s],e);return t}const ic=(i,t,e,{allOwnKeys:s}={})=>(Ne(t,(n,r)=>{e&&xt(n)?i[r]=dr(n,e):i[r]=n},{allOwnKeys:s}),i),nc=i=>(i.charCodeAt(0)===65279&&(i=i.slice(1)),i),rc=(i,t,e,s)=>{i.prototype=Object.create(t.prototype,s),i.prototype.constructor=i,Object.defineProperty(i,"super",{value:t.prototype}),e&&Object.assign(i.prototype,e)},ac=(i,t,e,s)=>{let n,r,a;const o={};if(t=t||{},i==null)return t;do{for(n=Object.getOwnPropertyNames(i),r=n.length;r-- >0;)a=n[r],(!s||s(a,i,t))&&!o[a]&&(t[a]=i[a],o[a]=!0);i=e!==!1&&bi(i)}while(i&&(!e||e(i,t))&&i!==Object.prototype);return t},oc=(i,t,e)=>{i=String(i),(e===void 0||e>i.length)&&(e=i.length),e-=t.length;const s=i.indexOf(t,e);return s!==-1&&s===e},hc=i=>{if(!i)return null;if(ye(i))return i;let t=i.length;if(!mr(t))return null;const e=new Array(t);for(;t-- >0;)e[t]=i[t];return e},cc=(i=>t=>i&&t instanceof i)(typeof Uint8Array<"u"&&bi(Uint8Array)),lc=(i,t)=>{const s=(i&&i[Symbol.iterator]).call(i);let n;for(;(n=s.next())&&!n.done;){const r=n.value;t.call(i,r[0],r[1])}},uc=(i,t)=>{let e;const s=[];for(;(e=i.exec(t))!==null;)s.push(e);return s},dc=Dt("HTMLFormElement"),fc=i=>i.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,s,n){return s.toUpperCase()+n}),wr=(({hasOwnProperty:i})=>(t,e)=>i.call(t,e))(Object.prototype),mc=Dt("RegExp"),xr=(i,t)=>{const e=Object.getOwnPropertyDescriptors(i),s={};Ne(e,(n,r)=>{let a;(a=t(n,r,i))!==!1&&(s[r]=a||n)}),Object.defineProperties(i,s)},pc=i=>{xr(i,(t,e)=>{if(xt(i)&&["arguments","caller","callee"].indexOf(e)!==-1)return!1;const s=i[e];if(xt(s)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+e+"'")})}})},gc=(i,t)=>{const e={},s=n=>{n.forEach(r=>{e[r]=!0})};return ye(i)?s(i):s(String(i).split(t)),e},yc=()=>{},wc=(i,t)=>(i=+i,Number.isFinite(i)?i:t),Si="abcdefghijklmnopqrstuvwxyz",br="0123456789",vr={DIGIT:br,ALPHA:Si,ALPHA_DIGIT:Si+Si.toUpperCase()+br},xc=(i=16,t=vr.ALPHA_DIGIT)=>{let e="";const{length:s}=t;for(;i--;)e+=t[Math.random()*s|0];return e};function bc(i){return!!(i&&xt(i.append)&&i[Symbol.toStringTag]==="FormData"&&i[Symbol.iterator])}const vc=i=>{const t=new Array(10),e=(s,n)=>{if(vs(s)){if(t.indexOf(s)>=0)return;if(!("toJSON"in s)){t[n]=s;const r=ye(s)?[]:{};return Ne(s,(a,o)=>{const h=e(a,n+1);!Oe(h)&&(r[o]=h)}),t[n]=void 0,r}}return s};return e(i,0)},Sc=Dt("AsyncFunction"),E={isArray:ye,isArrayBuffer:fr,isBuffer:qh,isFormData:tc,isArrayBufferView:Hh,isString:jh,isNumber:mr,isBoolean:Wh,isObject:vs,isPlainObject:Ss,isUndefined:Oe,isDate:$h,isFile:Jh,isBlob:Zh,isRegExp:mc,isFunction:xt,isStream:Qh,isURLSearchParams:ec,isTypedArray:cc,isFileList:Kh,forEach:Ne,merge:vi,extend:ic,trim:sc,stripBOM:nc,inherits:rc,toFlatObject:ac,kindOf:xs,kindOfTest:Dt,endsWith:oc,toArray:hc,forEachEntry:lc,matchAll:uc,isHTMLForm:dc,hasOwnProperty:wr,hasOwnProp:wr,reduceDescriptors:xr,freezeMethods:pc,toObjectSet:gc,toCamelCase:fc,noop:yc,toFiniteNumber:wc,findKey:pr,global:gr,isContextDefined:yr,ALPHABET:vr,generateString:xc,isSpecCompliantForm:bc,toJSONObject:vc,isAsyncFn:Sc,isThenable:i=>i&&(vs(i)||xt(i))&&xt(i.then)&&xt(i.catch)};function B(i,t,e,s,n){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=i,this.name="AxiosError",t&&(this.code=t),e&&(this.config=e),s&&(this.request=s),n&&(this.response=n)}E.inherits(B,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 Sr=B.prototype,Cr={};["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(i=>{Cr[i]={value:i}}),Object.defineProperties(B,Cr),Object.defineProperty(Sr,"isAxiosError",{value:!0}),B.from=(i,t,e,s,n,r)=>{const a=Object.create(Sr);return E.toFlatObject(i,a,function(h){return h!==Error.prototype},o=>o!=="isAxiosError"),B.call(a,i.message,t,e,s,n),a.cause=i,a.name=i.name,r&&Object.assign(a,r),a};const Cc=null;function Ci(i){return E.isPlainObject(i)||E.isArray(i)}function Er(i){return E.endsWith(i,"[]")?i.slice(0,-2):i}function Tr(i,t,e){return i?i.concat(t).map(function(n,r){return n=Er(n),!e&&r?"["+n+"]":n}).join(e?".":""):t}function Ec(i){return E.isArray(i)&&!i.some(Ci)}const Tc=E.toFlatObject(E,{},null,function(t){return/^is[A-Z]/.test(t)});function Cs(i,t,e){if(!E.isObject(i))throw new TypeError("target must be an object");t=t||new FormData,e=E.toFlatObject(e,{metaTokens:!0,dots:!1,indexes:!1},!1,function(x,b){return!E.isUndefined(b[x])});const s=e.metaTokens,n=e.visitor||l,r=e.dots,a=e.indexes,h=(e.Blob||typeof Blob<"u"&&Blob)&&E.isSpecCompliantForm(t);if(!E.isFunction(n))throw new TypeError("visitor must be a function");function c(p){if(p===null)return"";if(E.isDate(p))return p.toISOString();if(!h&&E.isBlob(p))throw new B("Blob is not supported. Use a Buffer instead.");return E.isArrayBuffer(p)||E.isTypedArray(p)?h&&typeof Blob=="function"?new Blob([p]):Buffer.from(p):p}function l(p,x,b){let S=p;if(p&&!b&&typeof p=="object"){if(E.endsWith(x,"{}"))x=s?x:x.slice(0,-2),p=JSON.stringify(p);else if(E.isArray(p)&&Ec(p)||(E.isFileList(p)||E.endsWith(x,"[]"))&&(S=E.toArray(p)))return x=Er(x),S.forEach(function(L,R){!(E.isUndefined(L)||L===null)&&t.append(a===!0?Tr([x],R,r):a===null?x:x+"[]",c(L))}),!1}return Ci(p)?!0:(t.append(Tr(b,x,r),c(p)),!1)}const d=[],g=Object.assign(Tc,{defaultVisitor:l,convertValue:c,isVisitable:Ci});function y(p,x){if(!E.isUndefined(p)){if(d.indexOf(p)!==-1)throw Error("Circular reference detected in "+x.join("."));d.push(p),E.forEach(p,function(S,C){(!(E.isUndefined(S)||S===null)&&n.call(t,S,E.isString(C)?C.trim():C,x,g))===!0&&y(S,x?x.concat(C):[C])}),d.pop()}}if(!E.isObject(i))throw new TypeError("data must be an object");return y(i),t}function Pr(i){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(i).replace(/[!'()~]|%20|%00/g,function(s){return t[s]})}function Ei(i,t){this._pairs=[],i&&Cs(i,this,t)}const Mr=Ei.prototype;Mr.append=function(t,e){this._pairs.push([t,e])},Mr.toString=function(t){const e=t?function(s){return t.call(this,s,Pr)}:Pr;return this._pairs.map(function(n){return e(n[0])+"="+e(n[1])},"").join("&")};function Pc(i){return encodeURIComponent(i).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Ar(i,t,e){if(!t)return i;const s=e&&e.encode||Pc,n=e&&e.serialize;let r;if(n?r=n(t,e):r=E.isURLSearchParams(t)?t.toString():new Ei(t,e).toString(s),r){const a=i.indexOf("#");a!==-1&&(i=i.slice(0,a)),i+=(i.indexOf("?")===-1?"?":"&")+r}return i}class Mc{constructor(){this.handlers=[]}use(t,e,s){return this.handlers.push({fulfilled:t,rejected:e,synchronous:s?s.synchronous:!1,runWhen:s?s.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(s){s!==null&&t(s)})}}const Ir=Mc,Dr={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Ac=typeof URLSearchParams<"u"?URLSearchParams:Ei,Ic=typeof FormData<"u"?FormData:null,Dc=typeof Blob<"u"?Blob:null,kc=(()=>{let i;return typeof navigator<"u"&&((i=navigator.product)==="ReactNative"||i==="NativeScript"||i==="NS")?!1:typeof window<"u"&&typeof document<"u"})(),_c=(()=>typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function")(),kt={isBrowser:!0,classes:{URLSearchParams:Ac,FormData:Ic,Blob:Dc},isStandardBrowserEnv:kc,isStandardBrowserWebWorkerEnv:_c,protocols:["http","https","file","blob","url","data"]};function Lc(i,t){return Cs(i,new kt.classes.URLSearchParams,Object.assign({visitor:function(e,s,n,r){return kt.isNode&&E.isBuffer(e)?(this.append(s,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)}},t))}function Rc(i){return E.matchAll(/\w+|\[(\w*)]/g,i).map(t=>t[0]==="[]"?"":t[1]||t[0])}function Oc(i){const t={},e=Object.keys(i);let s;const n=e.length;let r;for(s=0;s<n;s++)r=e[s],t[r]=i[r];return t}function kr(i){function t(e,s,n,r){let a=e[r++];const o=Number.isFinite(+a),h=r>=e.length;return a=!a&&E.isArray(n)?n.length:a,h?(E.hasOwnProp(n,a)?n[a]=[n[a],s]:n[a]=s,!o):((!n[a]||!E.isObject(n[a]))&&(n[a]=[]),t(e,s,n[a],r)&&E.isArray(n[a])&&(n[a]=Oc(n[a])),!o)}if(E.isFormData(i)&&E.isFunction(i.entries)){const e={};return E.forEachEntry(i,(s,n)=>{t(Rc(s),n,e,0)}),e}return null}function Nc(i,t,e){if(E.isString(i))try{return(t||JSON.parse)(i),E.trim(i)}catch(s){if(s.name!=="SyntaxError")throw s}return(e||JSON.stringify)(i)}const Ti={transitional:Dr,adapter:["xhr","http"],transformRequest:[function(t,e){const s=e.getContentType()||"",n=s.indexOf("application/json")>-1,r=E.isObject(t);if(r&&E.isHTMLForm(t)&&(t=new FormData(t)),E.isFormData(t))return n&&n?JSON.stringify(kr(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(s.indexOf("application/x-www-form-urlencoded")>-1)return Lc(t,this.formSerializer).toString();if((o=E.isFileList(t))||s.indexOf("multipart/form-data")>-1){const h=this.env&&this.env.FormData;return Cs(o?{"files[]":t}:t,h&&new h,this.formSerializer)}}return r||n?(e.setContentType("application/json",!1),Nc(t)):t}],transformResponse:[function(t){const e=this.transitional||Ti.transitional,s=e&&e.forcedJSONParsing,n=this.responseType==="json";if(t&&E.isString(t)&&(s&&!this.responseType||n)){const a=!(e&&e.silentJSONParsing)&&n;try{return JSON.parse(t)}catch(o){if(a)throw o.name==="SyntaxError"?B.from(o,B.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"],i=>{Ti.headers[i]={}});const Pi=Ti,Fc=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"]),Bc=i=>{const t={};let e,s,n;return i&&i.split(`
37
- `).forEach(function(a){n=a.indexOf(":"),e=a.substring(0,n).trim().toLowerCase(),s=a.substring(n+1).trim(),!(!e||t[e]&&Fc[e])&&(e==="set-cookie"?t[e]?t[e].push(s):t[e]=[s]:t[e]=t[e]?t[e]+", "+s:s)}),t},_r=Symbol("internals");function Fe(i){return i&&String(i).trim().toLowerCase()}function Es(i){return i===!1||i==null?i:E.isArray(i)?i.map(Es):String(i)}function Xc(i){const t=Object.create(null),e=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let s;for(;s=e.exec(i);)t[s[1]]=s[2];return t}const Yc=i=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(i.trim());function Mi(i,t,e,s,n){if(E.isFunction(s))return s.call(this,t,e);if(n&&(t=e),!!E.isString(t)){if(E.isString(s))return t.indexOf(s)!==-1;if(E.isRegExp(s))return s.test(t)}}function Uc(i){return i.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,e,s)=>e.toUpperCase()+s)}function Gc(i,t){const e=E.toCamelCase(" "+t);["get","set","has"].forEach(s=>{Object.defineProperty(i,s+e,{value:function(n,r,a){return this[s].call(this,t,n,r,a)},configurable:!0})})}class Ts{constructor(t){t&&this.set(t)}set(t,e,s){const n=this;function r(o,h,c){const l=Fe(h);if(!l)throw new Error("header name must be a non-empty string");const d=E.findKey(n,l);(!d||n[d]===void 0||c===!0||c===void 0&&n[d]!==!1)&&(n[d||h]=Es(o))}const a=(o,h)=>E.forEach(o,(c,l)=>r(c,l,h));return E.isPlainObject(t)||t instanceof this.constructor?a(t,e):E.isString(t)&&(t=t.trim())&&!Yc(t)?a(Bc(t),e):t!=null&&r(e,t,s),this}get(t,e){if(t=Fe(t),t){const s=E.findKey(this,t);if(s){const n=this[s];if(!e)return n;if(e===!0)return Xc(n);if(E.isFunction(e))return e.call(this,n,s);if(E.isRegExp(e))return e.exec(n);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,e){if(t=Fe(t),t){const s=E.findKey(this,t);return!!(s&&this[s]!==void 0&&(!e||Mi(this,this[s],s,e)))}return!1}delete(t,e){const s=this;let n=!1;function r(a){if(a=Fe(a),a){const o=E.findKey(s,a);o&&(!e||Mi(s,s[o],o,e))&&(delete s[o],n=!0)}}return E.isArray(t)?t.forEach(r):r(t),n}clear(t){const e=Object.keys(this);let s=e.length,n=!1;for(;s--;){const r=e[s];(!t||Mi(this,this[r],r,t,!0))&&(delete this[r],n=!0)}return n}normalize(t){const e=this,s={};return E.forEach(this,(n,r)=>{const a=E.findKey(s,r);if(a){e[a]=Es(n),delete e[r];return}const o=t?Uc(r):String(r).trim();o!==r&&delete e[r],e[o]=Es(n),s[o]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const e=Object.create(null);return E.forEach(this,(s,n)=>{s!=null&&s!==!1&&(e[n]=t&&E.isArray(s)?s.join(", "):s)}),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 s=new this(t);return e.forEach(n=>s.set(n)),s}static accessor(t){const s=(this[_r]=this[_r]={accessors:{}}).accessors,n=this.prototype;function r(a){const o=Fe(a);s[o]||(Gc(n,a),s[o]=!0)}return E.isArray(t)?t.forEach(r):r(t),this}}Ts.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),E.reduceDescriptors(Ts.prototype,({value:i},t)=>{let e=t[0].toUpperCase()+t.slice(1);return{get:()=>i,set(s){this[e]=s}}}),E.freezeMethods(Ts);const Xt=Ts;function Ai(i,t){const e=this||Pi,s=t||e,n=Xt.from(s.headers);let r=s.data;return E.forEach(i,function(o){r=o.call(e,r,n.normalize(),t?t.status:void 0)}),n.normalize(),r}function Lr(i){return!!(i&&i.__CANCEL__)}function Be(i,t,e){B.call(this,i??"canceled",B.ERR_CANCELED,t,e),this.name="CanceledError"}E.inherits(Be,B,{__CANCEL__:!0});function Vc(i,t,e){const s=e.config.validateStatus;!e.status||!s||s(e.status)?i(e):t(new B("Request failed with status code "+e.status,[B.ERR_BAD_REQUEST,B.ERR_BAD_RESPONSE][Math.floor(e.status/100)-4],e.config,e.request,e))}const zc=kt.isStandardBrowserEnv?function(){return{write:function(e,s,n,r,a,o){const h=[];h.push(e+"="+encodeURIComponent(s)),E.isNumber(n)&&h.push("expires="+new Date(n).toGMTString()),E.isString(r)&&h.push("path="+r),E.isString(a)&&h.push("domain="+a),o===!0&&h.push("secure"),document.cookie=h.join("; ")},read:function(e){const s=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return s?decodeURIComponent(s[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}();function qc(i){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(i)}function Hc(i,t){return t?i.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):i}function Rr(i,t){return i&&!qc(t)?Hc(i,t):t}const jc=kt.isStandardBrowserEnv?function(){const t=/(msie|trident)/i.test(navigator.userAgent),e=document.createElement("a");let s;function n(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 s=n(window.location.href),function(a){const o=E.isString(a)?n(a):a;return o.protocol===s.protocol&&o.host===s.host}}():function(){return function(){return!0}}();function Wc(i){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(i);return t&&t[1]||""}function $c(i,t){i=i||10;const e=new Array(i),s=new Array(i);let n=0,r=0,a;return t=t!==void 0?t:1e3,function(h){const c=Date.now(),l=s[r];a||(a=c),e[n]=h,s[n]=c;let d=r,g=0;for(;d!==n;)g+=e[d++],d=d%i;if(n=(n+1)%i,n===r&&(r=(r+1)%i),c-a<t)return;const y=l&&c-l;return y?Math.round(g*1e3/y):void 0}}function Or(i,t){let e=0;const s=$c(50,250);return n=>{const r=n.loaded,a=n.lengthComputable?n.total:void 0,o=r-e,h=s(o),c=r<=a;e=r;const l={loaded:r,total:a,progress:a?r/a:void 0,bytes:o,rate:h||void 0,estimated:h&&a&&c?(a-r)/h:void 0,event:n};l[t?"download":"upload"]=!0,i(l)}}const Ii={http:Cc,xhr:typeof XMLHttpRequest<"u"&&function(i){return new Promise(function(e,s){let n=i.data;const r=Xt.from(i.headers).normalize(),a=i.responseType;let o;function h(){i.cancelToken&&i.cancelToken.unsubscribe(o),i.signal&&i.signal.removeEventListener("abort",o)}let c;E.isFormData(n)&&(kt.isStandardBrowserEnv||kt.isStandardBrowserWebWorkerEnv?r.setContentType(!1):r.getContentType(/^\s*multipart\/form-data/)?E.isString(c=r.getContentType())&&r.setContentType(c.replace(/^\s*(multipart\/form-data);+/,"$1")):r.setContentType("multipart/form-data"));let l=new XMLHttpRequest;if(i.auth){const p=i.auth.username||"",x=i.auth.password?unescape(encodeURIComponent(i.auth.password)):"";r.set("Authorization","Basic "+btoa(p+":"+x))}const d=Rr(i.baseURL,i.url);l.open(i.method.toUpperCase(),Ar(d,i.params,i.paramsSerializer),!0),l.timeout=i.timeout;function g(){if(!l)return;const p=Xt.from("getAllResponseHeaders"in l&&l.getAllResponseHeaders()),b={data:!a||a==="text"||a==="json"?l.responseText:l.response,status:l.status,statusText:l.statusText,headers:p,config:i,request:l};Vc(function(C){e(C),h()},function(C){s(C),h()},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&&(s(new B("Request aborted",B.ECONNABORTED,i,l)),l=null)},l.onerror=function(){s(new B("Network Error",B.ERR_NETWORK,i,l)),l=null},l.ontimeout=function(){let x=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded";const b=i.transitional||Dr;i.timeoutErrorMessage&&(x=i.timeoutErrorMessage),s(new B(x,b.clarifyTimeoutError?B.ETIMEDOUT:B.ECONNABORTED,i,l)),l=null},kt.isStandardBrowserEnv){const p=(i.withCredentials||jc(d))&&i.xsrfCookieName&&zc.read(i.xsrfCookieName);p&&r.set(i.xsrfHeaderName,p)}n===void 0&&r.setContentType(null),"setRequestHeader"in l&&E.forEach(r.toJSON(),function(x,b){l.setRequestHeader(b,x)}),E.isUndefined(i.withCredentials)||(l.withCredentials=!!i.withCredentials),a&&a!=="json"&&(l.responseType=i.responseType),typeof i.onDownloadProgress=="function"&&l.addEventListener("progress",Or(i.onDownloadProgress,!0)),typeof i.onUploadProgress=="function"&&l.upload&&l.upload.addEventListener("progress",Or(i.onUploadProgress)),(i.cancelToken||i.signal)&&(o=p=>{l&&(s(!p||p.type?new Be(null,i,l):p),l.abort(),l=null)},i.cancelToken&&i.cancelToken.subscribe(o),i.signal&&(i.signal.aborted?o():i.signal.addEventListener("abort",o)));const y=Wc(d);if(y&&kt.protocols.indexOf(y)===-1){s(new B("Unsupported protocol "+y+":",B.ERR_BAD_REQUEST,i));return}l.send(n||null)})}};E.forEach(Ii,(i,t)=>{if(i){try{Object.defineProperty(i,"name",{value:t})}catch{}Object.defineProperty(i,"adapterName",{value:t})}});const Nr=i=>`- ${i}`,Jc=i=>E.isFunction(i)||i===null||i===!1,Fr={getAdapter:i=>{i=E.isArray(i)?i:[i];const{length:t}=i;let e,s;const n={};for(let r=0;r<t;r++){e=i[r];let a;if(s=e,!Jc(e)&&(s=Ii[(a=String(e)).toLowerCase()],s===void 0))throw new B(`Unknown adapter '${a}'`);if(s)break;n[a||"#"+r]=s}if(!s){const r=Object.entries(n).map(([o,h])=>`adapter ${o} `+(h===!1?"is not supported by the environment":"is not available in the build"));let a=t?r.length>1?`since :
39
- `+r.map(Nr).join(`
40
- `):" "+Nr(r[0]):"as no adapter specified";throw new B("There is no suitable adapter to dispatch the request "+a,"ERR_NOT_SUPPORT")}return s},adapters:Ii};function Di(i){if(i.cancelToken&&i.cancelToken.throwIfRequested(),i.signal&&i.signal.aborted)throw new Be(null,i)}function Br(i){return Di(i),i.headers=Xt.from(i.headers),i.data=Ai.call(i,i.transformRequest),["post","put","patch"].indexOf(i.method)!==-1&&i.headers.setContentType("application/x-www-form-urlencoded",!1),Fr.getAdapter(i.adapter||Pi.adapter)(i).then(function(s){return Di(i),s.data=Ai.call(i,i.transformResponse,s),s.headers=Xt.from(s.headers),s},function(s){return Lr(s)||(Di(i),s&&s.response&&(s.response.data=Ai.call(i,i.transformResponse,s.response),s.response.headers=Xt.from(s.response.headers))),Promise.reject(s)})}const Xr=i=>i instanceof Xt?i.toJSON():i;function we(i,t){t=t||{};const e={};function s(c,l,d){return E.isPlainObject(c)&&E.isPlainObject(l)?E.merge.call({caseless:d},c,l):E.isPlainObject(l)?E.merge({},l):E.isArray(l)?l.slice():l}function n(c,l,d){if(E.isUndefined(l)){if(!E.isUndefined(c))return s(void 0,c,d)}else return s(c,l,d)}function r(c,l){if(!E.isUndefined(l))return s(void 0,l)}function a(c,l){if(E.isUndefined(l)){if(!E.isUndefined(c))return s(void 0,c)}else return s(void 0,l)}function o(c,l,d){if(d in t)return s(c,l);if(d in i)return s(void 0,c)}const h={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:(c,l)=>n(Xr(c),Xr(l),!0)};return E.forEach(Object.keys(Object.assign({},i,t)),function(l){const d=h[l]||n,g=d(i[l],t[l],l);E.isUndefined(g)&&d!==o||(e[l]=g)}),e}const Yr="1.5.1",ki={};["object","boolean","number","function","string","symbol"].forEach((i,t)=>{ki[i]=function(s){return typeof s===i||"a"+(t<1?"n ":" ")+i}});const Ur={};ki.transitional=function(t,e,s){function n(r,a){return"[Axios v"+Yr+"] Transitional option '"+r+"'"+a+(s?". "+s:"")}return(r,a,o)=>{if(t===!1)throw new B(n(a," has been removed"+(e?" in "+e:"")),B.ERR_DEPRECATED);return e&&!Ur[a]&&(Ur[a]=!0,console.warn(n(a," has been deprecated since v"+e+" and will be removed in the near future"))),t?t(r,a,o):!0}};function Zc(i,t,e){if(typeof i!="object")throw new B("options must be an object",B.ERR_BAD_OPTION_VALUE);const s=Object.keys(i);let n=s.length;for(;n-- >0;){const r=s[n],a=t[r];if(a){const o=i[r],h=o===void 0||a(o,r,i);if(h!==!0)throw new B("option "+r+" must be "+h,B.ERR_BAD_OPTION_VALUE);continue}if(e!==!0)throw new B("Unknown option "+r,B.ERR_BAD_OPTION)}}const _i={assertOptions:Zc,validators:ki},Kt=_i.validators;class Ps{constructor(t){this.defaults=t,this.interceptors={request:new Ir,response:new Ir}}request(t,e){typeof t=="string"?(e=e||{},e.url=t):e=t||{},e=we(this.defaults,e);const{transitional:s,paramsSerializer:n,headers:r}=e;s!==void 0&&_i.assertOptions(s,{silentJSONParsing:Kt.transitional(Kt.boolean),forcedJSONParsing:Kt.transitional(Kt.boolean),clarifyTimeoutError:Kt.transitional(Kt.boolean)},!1),n!=null&&(E.isFunction(n)?e.paramsSerializer={serialize:n}:_i.assertOptions(n,{encode:Kt.function,serialize:Kt.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"],p=>{delete r[p]}),e.headers=Xt.concat(a,r);const o=[];let h=!0;this.interceptors.request.forEach(function(x){typeof x.runWhen=="function"&&x.runWhen(e)===!1||(h=h&&x.synchronous,o.unshift(x.fulfilled,x.rejected))});const c=[];this.interceptors.response.forEach(function(x){c.push(x.fulfilled,x.rejected)});let l,d=0,g;if(!h){const p=[Br.bind(this),void 0];for(p.unshift.apply(p,o),p.push.apply(p,c),g=p.length,l=Promise.resolve(e);d<g;)l=l.then(p[d++],p[d++]);return l}g=o.length;let y=e;for(d=0;d<g;){const p=o[d++],x=o[d++];try{y=p(y)}catch(b){x.call(this,b);break}}try{l=Br.call(this,y)}catch(p){return Promise.reject(p)}for(d=0,g=c.length;d<g;)l=l.then(c[d++],c[d++]);return l}getUri(t){t=we(this.defaults,t);const e=Rr(t.baseURL,t.url);return Ar(e,t.params,t.paramsSerializer)}}E.forEach(["delete","get","head","options"],function(t){Ps.prototype[t]=function(e,s){return this.request(we(s||{},{method:t,url:e,data:(s||{}).data}))}}),E.forEach(["post","put","patch"],function(t){function e(s){return function(r,a,o){return this.request(we(o||{},{method:t,headers:s?{"Content-Type":"multipart/form-data"}:{},url:r,data:a}))}}Ps.prototype[t]=e(),Ps.prototype[t+"Form"]=e(!0)});const Ms=Ps;class Li{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 s=this;this.promise.then(n=>{if(!s._listeners)return;let r=s._listeners.length;for(;r-- >0;)s._listeners[r](n);s._listeners=null}),this.promise.then=n=>{let r;const a=new Promise(o=>{s.subscribe(o),r=o}).then(n);return a.cancel=function(){s.unsubscribe(r)},a},t(function(r,a,o){s.reason||(s.reason=new Be(r,a,o),e(s.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 Li(function(n){t=n}),cancel:t}}}const Kc=Li;function Qc(i){return function(e){return i.apply(null,e)}}function tl(i){return E.isObject(i)&&i.isAxiosError===!0}const Ri={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(Ri).forEach(([i,t])=>{Ri[t]=i});const el=Ri;function Gr(i){const t=new Ms(i),e=dr(Ms.prototype.request,t);return E.extend(e,Ms.prototype,t,{allOwnKeys:!0}),E.extend(e,t,null,{allOwnKeys:!0}),e.create=function(n){return Gr(we(i,n))},e}const q=Gr(Pi);q.Axios=Ms,q.CanceledError=Be,q.CancelToken=Kc,q.isCancel=Lr,q.VERSION=Yr,q.toFormData=Cs,q.AxiosError=B,q.Cancel=q.CanceledError,q.all=function(t){return Promise.all(t)},q.spread=Qc,q.isAxiosError=tl,q.mergeConfig=we,q.AxiosHeaders=Xt,q.formToJSON=i=>kr(E.isHTMLForm(i)?new FormData(i):i),q.getAdapter=Fr.getAdapter,q.HttpStatusCode=el,q.default=q;const sl=q,Qt=window.crypto.subtle;Qt||console.warn("Crypto API not supported");function Vr(i){return La(encodeURIComponent(i)).replaceAll("+","*").replaceAll("/","-").replaceAll("=","")}function zr(i){let t=i.replaceAll("*","+").replaceAll("-","/");const e=t.length%4;return e&&(t=t.padEnd(t.length+(4-e),"=")),decodeURIComponent(Ra(t))}function il(i){return Vr(Xa(i))}function nl(i){return Ba(zr(i))}function As(i){return new TextEncoder().encode(i)}function qr(i,t="utf-8"){return new TextDecoder(t).decode(i)}async function rl(i,t="AES-GCM"){const e=crypto.getRandomValues(new Uint8Array(12)),s=await Qt.generateKey({name:t,length:256},!1,["encrypt","decrypt"]),n=await Qt.encrypt({name:t,iv:e},s,As(i));return{algorithm:t,iv:e,key:s,encryptedData:n}}async function al(i){const t=await Qt.decrypt({name:i.algorithm,iv:i.iv},i.key,i.encryptedData);return qr(t)}async function ol(i,t="ECDSA",e="SHA-384"){const{privateKey:s,publicKey:n}=await Qt.generateKey({name:t,namedCurve:"P-384"},!1,["sign","verify"]),r=As(JSON.stringify(i)),a=await Qt.sign({name:t,hash:{name:e}},s,r);return{algorithm:t,hash:e,publicKey:n,signature:a,encodedData:r}}async function hl(i){return await Qt.verify({name:i.algorithm,hash:{name:i.hash}},i.publicKey,i.signature,i.encodedData)}async function Hr(i,t="SHA-256"){const e=await Qt.digest(t,As(i));return Ya(e)}async function jr(i,t="SHA-256"){const e=JSON.stringify(i);return Hr(e,t)}class cl{instance;interceptors;requestCanceler;constructor(t){this.instance=sl.create(t),this.interceptors=t?.interceptors,this.requestCanceler=new Wr,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((s,n)=>{this.requestCanceler.confirmRequest(e.config),e.status===200?s(e.data):n(e.data)}),async e=>{const{code:s="",config:n}=e;return!n||!n.retry||!n.retryStatus?.includes(s)||(n.retryCounted=n.retryCounted??0,n.retryCounted>=n.retry)?Promise.reject(e):(n.retryCounted++,await new Promise(r=>{setTimeout(()=>{r(void 0)},n.retryDelay)}),await this.request(n))})}request(t){return new Promise((e,s)=>{try{t.interceptors?.requestInterceptor&&(t=t.interceptors?.requestInterceptor(t)),this.instance.request(t).then(n=>{t.interceptors?.responseInterceptor&&(n=t.interceptors.responseInterceptor(n)),e(n)}).catch(n=>{t.interceptors?.responseInterceptorCatch&&(n=t.interceptors?.responseInterceptorCatch(n)),s(n)})}catch(n){t.interceptors?.requestInterceptorCatch&&t.interceptors.requestInterceptorCatch(n)}})}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,s){return this.request({...s,method:"post",url:t,data:e})}put(t,e,s){return this.request({...s,method:"put",url:t,data:e})}patch(t,e,s){return this.request({...s,method:"patch",url:t,data:e})}getUri(t){return this.instance.getUri(t)}}class Wr{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 s=new AbortController;t.signal=s.signal,this.pendingRequestMap.set(e,s)}}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:s,params:n,data:r}=t;return await jr({url:e,method:s,params:n,data:r})}}function ll(i,t,e,s,n){const r=t/e;let a=0,o=0;switch(i){case"aspectFit":r>=1?(a=s,o=a/r,o>n&&(o=n,a=o*r)):(o=n,a=o*r,a>s&&(a=s,o=a/r));break;case"aspectFill":r>=1?(o=n,a=o*r):(a=s,o=a/r);break;case"widthFix":a=s,o=a/r;break;case"heightFix":o=n,a=o*r;break;case"scaleToFill":default:a=s,o=n;break}return{width:a,height:o}}const Is=new Map;async function ul(i){return new Promise((t,e)=>{Ds(i,(s,n)=>s?e(s):t({width:n.width,height:n.height,aspectRatio:n.width/n.height}))})}const Ds=(i,t)=>{if(Is.has(i))return t(null,Is.get(i));const e=new Image;e.onload=function(){Is.set(i,{width:e.naturalWidth||e.width,height:e.naturalHeight||e.height,element:e}),t(null,Is.get(i))},e.onerror=function(s){t(s,null)},e.src=i},dl=(i,t)=>{for(let e=0,s=i.length;e<s;e++){const n=i[e],{type:r}=n;if(r.split("/")[0]!=="image")continue;const a=new FileReader;a.onload=function(o){if(!o.target)return t("no reader target",null);const h=o.target.result,c=ln(h),l=new Blob([h]);Oi(l,(d,g)=>{if(!g)return t(d,null);Ds(g,(y,p)=>{if(!p)return t(y,null);$r(g,(x,b)=>{if(!b)return t(x,null);const S={name:n.name,fileType:c,size:n.size,width:p.width,height:p.height,imgUrl:g,imageData:b,blob:l};return t(null,S)})})})},a.readAsArrayBuffer(n)}},$r=(i,t)=>{Ds(i,(e,s)=>{if(!s)return t(e,null);const n=document.createElement("canvas"),r=n.getContext("2d");n.width=s.width,n.height=s.height,r.drawImage(s.element,0,0,n.width,n.height);const a=r.getImageData(0,0,n.width,n.height);return t(null,a)})},fl=(i,t=0,e=0)=>{const s=document.createElement("canvas"),n=s.getContext("2d");return s.width=t,s.height=e,n.drawImage(i,0,0,t,e),n.getImageData(0,0,t,e)},ml=(i,t=0,e=0)=>{const s=document.createElement("canvas"),n=s.getContext("2d");return s.width=t,s.height=e,n.drawImage(i,0,0,t,e),n.getImageData(0,0,t,e)},pl=i=>{const t=i.width,e=i.height,s=t*e*3,n=s+54,r=[66,77,n&255,n>>8&255,n>>16&255,n>>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,s&255,s>>8&255,s>>16&255,s>>24&255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],o=(4-t*3%4)%4,h=i.data;let c="";const l=t<<2;let d=e;const g=String.fromCharCode;do{const p=l*(d-1);let x="";for(let b=0;b<t;b++){const S=b<<2;x+=g(h[p+S+2])+g(h[p+S+1])+g(h[p+S])}for(let b=0;b<o;b++)x+=String.fromCharCode(0);c+=x}while(--d);function y(p){if(!window.btoa)throw"btoa undefined";let x="";if(typeof p=="string")x=p;else for(let b=0;b<p.length;b++)x+=String.fromCharCode(p[b]);return btoa(x)}return y(r.concat(a))+y(c)},gl=i=>{const{width:t,height:e}=i,s=document.createElement("canvas"),n=s.getContext("2d");return s.width=t,s.height=e,n.putImageData(i,0,0,0,0,t,e),s.toDataURL("image/png")},yl=(i,t,e)=>{const{width:s,height:n}=i,r=document.createElement("canvas"),a=r.getContext("2d");r.width=s,r.height=n,a.putImageData(i,0,0,0,0,s,n);const o=`image/${t?t.toLowerCase():"png"}`;r.toBlob(h=>{e?.(null,h)},o,1)},Oi=(i,t)=>{const e=new FileReader;e.onload=function(s){s.target?t(null,s.target.result):t("can't readAsDataURL",null)},e.readAsDataURL(i)},wl=(i,t)=>{Oi(i,function(e,s){if(s){const n=new Image;n.src=s}else t(e)})};function xl(i){const t=[],e=[],s=[];let n=0;for(let h=0,c=i.data.length;h<c;h+=4)t[n]=i.data[h],e[n]=i.data[h+1],s[n]=i.data[h+2],n+=1;const r=Ni(t),a=Ni(e),o=Ni(s);return"rgb("+r+","+a+","+o+")"}function Ni(i){const t={},e=[],s=[];for(let o=0;o<i.length;o++)t[i[o]]?e.push(i[o]):t[i[o]]=1;let n=0;for(let o=0;o<e.length;o++){n=0;for(let h=0;h<e.length;h++)e[o]===e[h]&&(n+=1),s[o]=n}const r=Math.max.apply(null,s);let a=0;for(;a<s.length;a++)if(s[a]===r)return;return e[a]}const bl=i=>{const{data:t,width:e,height:s}=i,n=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4;n[h]=t[(a*e+e-o-1)*4],n[h+1]=t[(a*e+e-o-1)*4+1],n[h+2]=t[(a*e+e-o-1)*4+2],n[h+3]=t[(a*e+e-o-1)*4+3]}return new ImageData(n,e,s)},vl=i=>{const{data:t,width:e,height:s}=i,n=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4;n[h]=t[((s-a-1)*e+o)*4],n[h+1]=t[((s-a-1)*e+o)*4+1],n[h+2]=t[((s-a-1)*e+o)*4+2],n[h+3]=t[((s-a-1)*e+o)*4+3]}return new ImageData(n,e,s)},Sl=i=>{const{data:t,width:e,height:s}=i,n=new Uint8ClampedArray(t.length);for(let a=0;a<e;a++)for(let o=0;o<s;o++){const h=(a*s+o)*4;n[h]=t[(o*e+e-a-1)*4],n[h+1]=t[(o*e+e-a-1)*4+1],n[h+2]=t[(o*e+e-a-1)*4+2],n[h+3]=t[(o*e+e-a-1)*4+3]}return new ImageData(n,s,e)},Cl=i=>{const{data:t,width:e,height:s}=i,n=new Uint8ClampedArray(t.length);for(let a=0;a<e;a++)for(let o=0;o<s;o++){const h=(a*s+o)*4;n[h]=t[((s-o-1)*e+a)*4],n[h+1]=t[((s-o-1)*e+a)*4+1],n[h+2]=t[((s-o-1)*e+a)*4+2],n[h+3]=t[((s-o-1)*e+a)*4+3]}return new ImageData(n,s,e)},El=i=>{const{data:t,width:e,height:s}=i,n=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4,c=(t[h]+t[h+1]+t[h+2])/3;n[h]=c,n[h+1]=c,n[h+2]=c,n[h+3]=t[h+3]}return new ImageData(n,e,s)},Tl=i=>{const{data:t,width:e,height:s}=i,n=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4,c=.2126*t[h]+.7152*t[h+1]+.0722*t[h+2];n[h]=c,n[h+1]=c,n[h+2]=c,n[h+3]=t[h+3]}return new ImageData(n,e,s)},Pl=i=>{const{data:t,width:e,height:s}=i,n=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4,l=(t[h]+t[h+1]+t[h+2])/3>127?255:0;n[h]=l,n[h+1]=l,n[h+2]=l,n[h+3]=t[h+3]}return new ImageData(n,e,s)},Ml=i=>{const{data:t,width:e,height:s}=i,n=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4;n[h]=255-t[h],n[h+1]=255-t[h+1],n[h+2]=255-t[h+2],n[h+3]=t[h+3]}return new ImageData(n,e,s)},Al=i=>{const{data:t,width:e,height:s}=i,n=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4;n[h]=t[h],n[h+1]=0,n[h+2]=0,n[h+3]=t[h+3]}return new ImageData(n,e,s)},Il=i=>{const{data:t,width:e,height:s}=i,n=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4;n[h]=0,n[h+1]=t[h+1],n[h+2]=0,n[h+3]=t[h+3]}return new ImageData(n,e,s)},Dl=i=>{const{data:t,width:e,height:s}=i,n=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4;n[h]=0,n[h+1]=0,n[h+2]=t[h+2],n[h+3]=t[h+3]}return new ImageData(n,e,s)},kl=i=>{const{data:t,width:e,height:s}=i,n=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4;n[h]=t[h],n[h+1]=t[h+1],n[h+2]=0,n[h+3]=t[h+3]}return new ImageData(n,e,s)},_l=i=>{const{data:t,width:e,height:s}=i,n=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4;n[h]=t[h],n[h+1]=0,n[h+2]=t[h+1],n[h+3]=t[h+3]}return new ImageData(n,e,s)},Ll=i=>{const{data:t,width:e,height:s}=i,n=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4;n[h]=0,n[h+1]=t[h+1],n[h+2]=t[h+1],n[h+3]=t[h+3]}return new ImageData(n,e,s)},Rl=i=>{const{data:t,width:e,height:s}=i,n=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4,c=(t[h+1]+t[h+2])/2;n[h]=t[h],n[h+1]=c,n[h+2]=c,n[h+3]=t[h+3]}return new ImageData(n,e,s)},Ol=i=>{const{data:t,width:e,height:s}=i,n=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4,c=(t[h]+t[h+2])/2;n[h]=c,n[h+1]=t[h+1],n[h+2]=c,n[h+3]=t[h+3]}return new ImageData(n,e,s)},Nl=i=>{const{data:t,width:e,height:s}=i,n=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4,c=(t[h]+t[h+1])/2;n[h]=c,n[h+1]=c,n[h+2]=t[h+2],n[h+3]=t[h+3]}return new ImageData(n,e,s)},Fl=i=>Jr(i,[-1,-1,-1,-1,9,-1,-1,-1,-1]),Bl=i=>Jr(i,[-1,-1,-1,-1,8,-1,-1,-1,-1]),Xl=i=>{const{data:t,width:e,height:s}=i,n=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4;n[h]=t[h],n[h+1]=t[h+1],n[h+2]=t[h+2],n[h+3]=255}return new ImageData(n,e,s)},Yl=i=>{const{data:t,width:e,height:s}=i,n=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4;if(t[h+3]===0)n[h]=255,n[h+1]=255,n[h+2]=255,n[h+3]=255;else{const c=Zr([t[h],t[h+1],t[h+2],t[h+3]],[255,255,255,255]);n[h]=c[0],n[h+1]=c[1],n[h+2]=c[2],n[h+3]=c[3]}}return new ImageData(n,e,s)},Ul=(i,t,e,s,n,r=!1,a)=>{const{data:o,width:h,height:c}=i;let l=n,d=s,g=t,y=e;if(l<0?l=0:l>h&&(l=h),d<0?d=0:d>c&&(d=c),g<1?g=1:g>h&&(g=h),y<1?y=1:y>c&&(y=c),l+g>h&&(g=h-l),d+y>c&&(y=c-d),r){const p=new Uint8ClampedArray(o.length);for(let b=0;b<c;b++)for(let S=0;S<h;S++){const C=(b*h+S)*4;S>=l&&S<=l+g&&b>=d&&b<=d+y?(p[C]=o[C],p[C+1]=o[C+1],p[C+2]=o[C+2],p[C+3]=o[C+3]):(p[C]=255,p[C+1]=255,p[C+2]=255,p[C+3]=a&&["JPG","JPEG"].includes(a.toUpperCase())?255:0)}return new ImageData(p,h,c)}else{const p=new Uint8ClampedArray(g*y*4);for(let b=d;b<=d+y;b++)for(let S=l;S<=l+g;S++){const C=((b-d)*g+S-l)*4,L=(b*h+S)*4;p[C]=o[L],p[C+1]=o[L+1],p[C+2]=o[L+2],p[C+3]=o[L+3]}return new ImageData(p,g,y)}},Gl=(i,t,e,s)=>{const{data:n,width:r,height:a}=i;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 h=new Uint8ClampedArray(n.length);for(let l=0;l<a;l++)for(let d=0;d<r;d++){const g=(l*r+d)*4;let y=-1;d<o?l<o?y=Math.sqrt(Math.pow(o-d-1,2)+Math.pow(o-l-1,2)):l>a-o-1&&(y=Math.sqrt(Math.pow(o-d-1,2)+Math.pow(l-(a-o),2))):d>r-o-1&&(l<o?y=Math.sqrt(Math.pow(d-(r-o),2)+Math.pow(o-l-1,2)):l>a-o-1&&(y=Math.sqrt(Math.pow(d-(r-o),2)+Math.pow(l-(a-o),2)))),Math.round(y)>o?(h[g]=255,h[g+1]=255,h[g+2]=255,h[g+3]=s||e.toUpperCase()==="PNG"?0:255):(h[g]=n[g],h[g+1]=n[g+1],h[g+2]=n[g+2],h[g+3]=s||e.toUpperCase()==="PNG"?n[g+3]:255)}return new ImageData(h,r,a)},Vl=(i,t,e,s,n,r=1e4)=>{const a=new Image;a.src=i;const o=document.createElement("canvas"),h=o.getContext("2d");return o.width=r,o.height=r,h.drawImage(a,0,0,t,e,0,0,s,n),h.getImageData(0,0,s,n)},zl=(i,t)=>{const{data:e,width:s,height:n}=i,r=new Uint8ClampedArray(e.length);for(let o=0;o<n;o++)for(let h=0;h<s;h++){const c=(o*s+h)*4;r[c]=Math.max(Math.min(e[c]+t,255),0),r[c+1]=Math.max(Math.min(e[c+1]+t,255),0),r[c+2]=Math.max(Math.min(e[c+2]+t,255),0),r[c+3]=e[c+3]}return new ImageData(r,s,n)},ql=(i,t,e=!1)=>{const{data:s,width:n,height:r}=i,a=new Uint8ClampedArray(s.length);for(let h=0;h<r;h++)for(let c=0;c<n;c++){const l=(h*n+c)*4;s[l+3]===0?(a[l]=255,a[l+1]=255,a[l+2]=255):(a[l]=s[l],a[l+1]=s[l+1],a[l+2]=s[l+2]);let d=s[l+3];e?d=Math.max(Math.min(Math.floor(255*t),255),0):d=Math.max(Math.min(Math.floor(d+255*t),255),0),a[l+3]=d}return new ImageData(a,n,r)},Hl=(i,t,e,s)=>{const{data:n,width:r,height:a}=i,{data:o,width:h,height:c}=t;let l=e,d=s;e+c>a&&(l=a-c),s+h>r&&(d=r-h);const g=new Uint8ClampedArray(n.length);for(let p=0;p<a;p++)for(let x=0;x<r;x++){const b=(p*r+x)*4;if(x<d||x>d+h||p<=l||p>=l+c)g[b]=n[b],g[b+1]=n[b+1],g[b+2]=n[b+2],g[b+3]=n[b+3];else{const S=(p*r+x-((l+1)*r+(p-(l+1))*(r-h))+h-d-1)*4,C=[o[S],o[S+1],o[S+2],o[S+3]],L=[n[b],n[b+1],n[b+2],n[b+3]],R=Zr(C,L);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)},jl=(i,t,e,s,n,r=10)=>{const{data:a,width:o,height:h}=i;let c=n,l=s,d=t,g=e;c<0?c=0:c>o&&(c=o),l<0?l=0:l>h&&(l=h),d<1?d=1:d>o&&(d=o),g<1?g=1:g>h&&(g=h),c+d>o&&(d=o-c),l+g>h&&(g=h-l);const y=new Uint8ClampedArray(a.length);for(let x=0;x<h;x++)for(let b=0;b<o;b++){const S=(x*o+b)*4;if(b>=c&&b<=c+d&&x>=l&&x<=l+g){const C=Math.floor((b-c)/r),L=Math.floor((x-l)/r);let R=Math.floor(r*(C+1)-r/2+c),Y=Math.floor(r*(L+1)-r/2+l);R>o-1&&(R=o-1),Y>h-1&&(Y=h-1);const X=(Y*o+R)*4;y[S]=a[X],y[S+1]=a[X+1],y[S+2]=a[X+2],y[S+3]=a[X+3]}else y[S]=a[S],y[S+1]=a[S+1],y[S+2]=a[S+2],y[S+3]=a[S+3]}return new ImageData(y,o,h)},Wl=(i,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:s,width:n,height:r}=i,{data:a}=t,o=new Uint8ClampedArray(s.length),{backgroundColor:h,changeIntoColor:c}=e;for(let d=0;d<r;d++)for(let g=0;g<n;g++){const y=(d*n+g)*4,p=a[y],x=a[y+1],b=a[y+2],S=a[y+3];p===h.r&&x===h.g&&b===h.b&&S===h.a&&c.a!==0?(o[y]=c.r,o[y+1]=c.g,o[y+2]=c.b,o[y+3]=c.a):(o[y]=s[y],o[y+1]=s[y+1],o[y+2]=s[y+2],o[y+3]=s[y+3])}return new ImageData(o,n,r)}return i},Jr=(i,t)=>{const{data:e,width:s,height:n}=i,r=new Uint8ClampedArray(e.length);for(let o=0;o<n;o++)for(let h=0;h<s;h++){const c=(o*s+h)*4;for(let l=0;l<3;l++){const d=c+l;h===0||h===s-1||o===0||o===n-1?r[d]=e[d]:r[d]=t[0]*e[d-s*4-4]+t[1]*e[d-s*4]+t[2]*e[d-s*4+4]+t[3]*e[d-4]+t[4]*e[d]+t[5]*e[d+4]+t[6]*e[d+s*4-4]+t[7]*e[d+s*4]+t[8]*e[d+s*4+4]}r[c+3]=e[c+3]}return new ImageData(r,s,n)},Zr=(i,t)=>{if(i&&i.length===4&&t&&t.length===4){const e=i[3],s=t[3];if(e===255||s===0)return i;if(e===0)return t;{const n=e/255,r=s/255,a=Math.max(Math.min(Math.floor(i[0]*n+t[0]*r*(1-n)),255),0),o=Math.max(Math.min(Math.floor(i[1]*n+t[1]*r*(1-n)),255),0),h=Math.max(Math.min(Math.floor(i[2]*n+t[2]*r*(1-n)),255),0),c=Math.max(Math.min(Math.floor((n+r*(1-n))*255),255),0);return[a,o,h,c]}}return[255,255,255,255]},Fi=function(){const i=[];return{writeByte(t){i.push(t&255)},writeShort(t){this.writeByte(t),this.writeByte(t>>>8)},writeBytes(t,e=0,s=t.length){for(let n=0;n<s;n++)this.writeByte(t[n+e])},writeString(t){for(let e=0,s=t.length;e<s;e++)this.writeByte(t.charCodeAt(e))},toByteArray(){return i},toString(){let t="[";for(let e=0,s=i.length;e<s;e++)e>0&&(t+=","),t+=i[e];return t+="]",t}}},Kr=function(){let i=0,t=0,e=0,s="";const n=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){s+=String.fromCharCode(n(a&63))};return{writeByte(a){for(i=i<<8|a&255,t+=8,e+=1;t>=6;)r(i>>>t-6),t-=6},flush(){if(t>0&&(r(i<<6-t),i=0,t=0),e%3!=0){const a=3-e%3;for(let o=0;o<a;o++)s+="="}},toString(){return s}}},Qr=function(i,t,e){const s=new Array(i*i),n=function(o){const h=o;let c=0,l=0;return{write(d,g){if(d>>>g)throw new Error("length over");for(;c+g>=8;)h.writeByte(255&(d<<c|l)),g-=8-c,d>>>=8-c,l=0,c=0;l=d<<c|l,c=c+g},flush(){c>0&&h.writeByte(l)}}},r=function(o){const h=1<<o,c=(1<<o)+1;let l=o+1;const d=a();for(let b=0;b<h;b++)d.add(String.fromCharCode(b));d.add(String.fromCharCode(h)),d.add(String.fromCharCode(c));const g=Fi(),y=n(g);y.write(h,l);let p=0,x=String.fromCharCode(s[p]);for(p+=1;p<s.length;){const b=String.fromCharCode(s[p]);p+=1,d.contains(x+b)?x=x+b:(y.write(d.indexOf(x),l),d.size()<4095&&(d.size()==1<<l&&(l+=1),d.add(x+b)),x=b)}return y.write(d.indexOf(x),l),y.write(c,l),y.flush(),g.toByteArray()},a=function(){const o={};let h=0;return{add(c){if(this.contains(c))throw new Error("dup key:"+c);o[c]=h,h+=1},size(){return h},indexOf(c){return o[c]},contains(c){return typeof o[c]<"u"}}};return{setPixel(o,h,c){s[h*i+o]=c},write(o){o.writeString("GIF87a"),o.writeShort(i),o.writeShort(i),o.writeByte(128),o.writeByte(0),o.writeByte(0),o.writeByte(ae("0x"+t[1]+t[2])),o.writeByte(ae("0x"+t[3]+t[4])),o.writeByte(ae("0x"+t[5]+t[6])),o.writeByte(ae("0x"+e[1]+e[2])),o.writeByte(ae("0x"+e[3]+e[4])),o.writeByte(ae("0x"+e[5]+e[6])),o.writeString(","),o.writeShort(0),o.writeShort(0),o.writeShort(i),o.writeShort(i),o.writeByte(0);const h=2,c=r(h);o.writeByte(h);let l=0;for(;c.length-l>255;)o.writeByte(255),o.writeBytes(c,l,255),l+=255;o.writeByte(c.length-l),o.writeBytes(c,l,c.length-l),o.writeByte(0),o.writeString(";")}}},ta=function(i,t,e,s){const n=Qr(i,t,e);for(let c=0;c<i;c++)for(let l=0;l<i;l++)n.setPixel(l,c,s(l,c));const r=Fi();n.write(r);const a=Kr(),o=r.toByteArray();for(let c=0,l=o.length;c<l;c++)a.writeByte(o[c]);a.flush();let h="";return h+="data:image/gif;base64,",h+=a,h},gt={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},Xe={M:0,L:1,H:2,Q:3},te={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},J={glog:function(i){if(i<1)throw new Error("glog("+i+")");return J.LOG_TABLE[i]},gexp:function(i){for(;i<0;)i+=255;for(;i>=256;)i-=255;return J.EXP_TABLE[i]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)};for(let i=0;i<8;i++)J.EXP_TABLE[i]=1<<i;for(let i=8;i<256;i++)J.EXP_TABLE[i]=J.EXP_TABLE[i-4]^J.EXP_TABLE[i-5]^J.EXP_TABLE[i-6]^J.EXP_TABLE[i-8];for(let i=0;i<255;i++)J.LOG_TABLE[J.EXP_TABLE[i]]=i;const G={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(i){let t=i<<10;for(;G.getBCHDigit(t)-G.getBCHDigit(G.G15)>=0;)t^=G.G15<<G.getBCHDigit(t)-G.getBCHDigit(G.G15);return(i<<10|t)^G.G15_MASK},getBCHTypeNumber:function(i){let t=i<<12;for(;G.getBCHDigit(t)-G.getBCHDigit(G.G18)>=0;)t^=G.G18<<G.getBCHDigit(t)-G.getBCHDigit(G.G18);return i<<12|t},getBCHDigit:function(i){let t=0;for(;i!=0;)t++,i>>>=1;return t},getPatternPosition:function(i){return G.PATTERN_POSITION_TABLE[i-1]},getMask:function(i,t,e){switch(i){case te.PATTERN000:return(t+e)%2==0;case te.PATTERN001:return t%2==0;case te.PATTERN010:return e%3==0;case te.PATTERN011:return(t+e)%3==0;case te.PATTERN100:return(Math.floor(t/2)+Math.floor(e/3))%2==0;case te.PATTERN101:return t*e%2+t*e%3==0;case te.PATTERN110:return(t*e%2+t*e%3)%2==0;case te.PATTERN111:return(t*e%3+(t+e)%2)%2==0;default:throw new Error("bad maskPattern:"+i)}},getErrorCorrectPolynomial:function(i){let t=new xe([1],0);for(let e=0;e<i;e++)t=t.multiply(new xe([1,J.gexp(e)],0));return t},getLengthInBits:function(i,t){if(1<=t&&t<10)switch(i){case gt.MODE_NUMBER:return 10;case gt.MODE_ALPHA_NUM:return 9;case gt.MODE_8BIT_BYTE:return 8;case gt.MODE_KANJI:return 8;default:throw new Error("mode:"+i)}else if(t<27)switch(i){case gt.MODE_NUMBER:return 12;case gt.MODE_ALPHA_NUM:return 11;case gt.MODE_8BIT_BYTE:return 16;case gt.MODE_KANJI:return 10;default:throw new Error("mode:"+i)}else if(t<41)switch(i){case gt.MODE_NUMBER:return 14;case gt.MODE_ALPHA_NUM:return 13;case gt.MODE_8BIT_BYTE:return 16;case gt.MODE_KANJI:return 12;default:throw new Error("mode:"+i)}else throw new Error("type:"+t)},getLostPoint:function(i){const t=i.getModuleCount();let e=0;for(let r=0;r<t;r++)for(let a=0;a<t;a++){let o=0;const h=i.isDark(r,a);for(let c=-1;c<=1;c++)if(!(r+c<0||t<=r+c))for(let l=-1;l<=1;l++)a+l<0||t<=a+l||c==0&&l==0||h==i.isDark(r+c,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;i.isDark(r,a)&&o++,i.isDark(r+1,a)&&o++,i.isDark(r,a+1)&&o++,i.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++)i.isDark(r,a)&&!i.isDark(r,a+1)&&i.isDark(r,a+2)&&i.isDark(r,a+3)&&i.isDark(r,a+4)&&!i.isDark(r,a+5)&&i.isDark(r,a+6)&&(e+=40);for(let r=0;r<t;r++)for(let a=0;a<t-6;a++)i.isDark(a,r)&&!i.isDark(a+1,r)&&i.isDark(a+2,r)&&i.isDark(a+3,r)&&i.isDark(a+4,r)&&!i.isDark(a+5,r)&&i.isDark(a+6,r)&&(e+=40);let s=0;for(let r=0;r<t;r++)for(let a=0;a<t;a++)i.isDark(a,r)&&s++;const n=Math.abs(100*s/t/t-50)/5;return e+=n*10,e}};class xe{num;constructor(t,e){if(t.length==null)throw new Error(t.length+"/"+e);let s=0;for(;s<t.length&&t[s]==0;)s++;this.num=new Array(t.length-s+e);for(let n=0;n<t.length-s;n++)this.num[n]=t[n+s]}get(t){return this.num[t]}getLength(){return this.num.length}multiply(t){const e=new Array(this.getLength()+t.getLength()-1);for(let s=0;s<this.getLength();s++)for(let n=0;n<t.getLength();n++)e[s+n]^=J.gexp(J.glog(this.get(s))+J.glog(t.get(n)));return new xe(e,0)}mod(t){if(this.getLength()-t.getLength()<0)return this;const e=J.glog(this.get(0))-J.glog(t.get(0)),s=new Array(this.getLength());for(let n=0;n<this.getLength();n++)s[n]=this.get(n);for(let n=0;n<t.getLength();n++)s[n]^=J.gexp(J.glog(t.get(n))+e);return new xe(s,0).mod(t)}}class Yt{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 s=Yt.getRsBlockTable(t,e);if(s==null)throw new Error("bad rs block @ typeNumber:"+t+"/errorCorrectLevel:"+e);const n=s.length/3,r=[];for(let a=0;a<n;a++){const o=s[a*3+0],h=s[a*3+1],c=s[a*3+2];for(let l=0;l<o;l++)r.push(new Yt(h,c))}return r}static getRsBlockTable(t,e){switch(e){case Xe.L:return Yt.RS_BLOCK_TABLE[(t-1)*4+0];case Xe.M:return Yt.RS_BLOCK_TABLE[(t-1)*4+1];case Xe.Q:return Yt.RS_BLOCK_TABLE[(t-1)*4+2];case Xe.H:return Yt.RS_BLOCK_TABLE[(t-1)*4+3];default:return}}}class ea{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 s=0;s<e;s++)this.putBit((t>>>e-s-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 $l{mode;data;constructor(t){this.mode=gt.MODE_8BIT_BYTE,this.data=t}getLength(){return this.data.length}write(t){for(let e=0,s=this.data.length;e<s;e++)t.put(this.data.charCodeAt(e),8)}}class ee{static PAD0=236;static PAD1=17;typeNumber;errorCorrectLevel;modules;moduleCount;dataCache;dataList;constructor(t,e){this.typeNumber=t,this.errorCorrectLevel=Xe[e],this.modules=[],this.moduleCount=0,this.dataCache=null,this.dataList=[]}addData(t){const e=new $l(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=Yt.getRSBlocks(t,this.errorCorrectLevel),s=new ea;let n=0;for(let r=0;r<e.length;r++)n+=e[r].dataCount;for(let r=0;r<this.dataList.length;r++){const a=this.dataList[r];s.put(a.mode,4),s.put(a.getLength(),G.getLengthInBits(a.mode,t)),a.write(s)}if(s.getLengthInBits()<=n*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 s=0;s<this.moduleCount;s++){this.modules[s]=new Array(this.moduleCount);for(let n=0;n<this.moduleCount;n++)this.modules[s][n]=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=ee.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,e)}setupPositionProbePattern(t,e){for(let s=-1;s<=7;s++)if(!(t+s<=-1||this.moduleCount<=t+s))for(let n=-1;n<=7;n++)e+n<=-1||this.moduleCount<=e+n||(0<=s&&s<=6&&(n==0||n==6)||0<=n&&n<=6&&(s==0||s==6)||2<=s&&s<=4&&2<=n&&n<=4?this.modules[t+s][e+n]=!0:this.modules[t+s][e+n]=!1)}getBestMaskPattern(){let t=0,e=0;for(let s=0;s<8;s++){this.makeImpl(!0,s);const n=G.getLostPoint(this);(s==0||t>n)&&(t=n,e=s)}return e}createMovieClip(t,e,s){const n=t.createEmptyMovieClip(e,s),r=1;this.make();for(let a=0;a<this.modules.length;a++){const o=a*r;for(let h=0;h<this.modules[a].length;h++){const c=h*r;this.modules[a][h]&&(n.beginFill(0,100),n.moveTo(c,o),n.lineTo(c+r,o),n.lineTo(c+r,o+r),n.lineTo(c,o+r),n.endFill())}}return n}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=G.getPatternPosition(this.typeNumber);for(let e=0;e<t.length;e++)for(let s=0;s<t.length;s++){const n=t[e],r=t[s];if(this.modules[n][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[n+a][r+o]=!0:this.modules[n+a][r+o]=!1}}setupTypeNumber(t){const e=G.getBCHTypeNumber(this.typeNumber);for(let s=0;s<18;s++){const n=!t&&(e>>s&1)==1;this.modules[Math.floor(s/3)][s%3+this.moduleCount-8-3]=n}for(let s=0;s<18;s++){const n=!t&&(e>>s&1)==1;this.modules[s%3+this.moduleCount-8-3][Math.floor(s/3)]=n}}setupTypeInfo(t,e){const s=this.errorCorrectLevel<<3|e,n=G.getBCHTypeInfo(s);for(let r=0;r<15;r++){const a=!t&&(n>>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&&(n>>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 s=-1,n=this.moduleCount-1,r=7,a=0;for(let o=this.moduleCount-1;o>0;o-=2)for(o==6&&o--;;){for(let h=0;h<2;h++)if(this.modules[n][o-h]==null){let c=!1;a<t.length&&(c=(t[a]>>>r&1)==1),G.getMask(e,n,o-h)&&(c=!c),this.modules[n][o-h]=c,r--,r==-1&&(a++,r=7)}if(n+=s,n<0||this.moduleCount<=n){n-=s,s=-s;break}}}static createData(t,e,s){const n=Yt.getRSBlocks(t,e),r=new ea;for(let o=0;o<s.length;o++){const h=s[o];r.put(h.mode,4),r.put(h.getLength(),G.getLengthInBits(h.mode,t)),h.write(r)}let a=0;for(let o=0;o<n.length;o++)a+=n[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(ee.PAD0,8),r.getLengthInBits()>=a*8));)r.put(ee.PAD1,8);return ee.createBytes(r,n)}static createBytes(t,e){let s=0,n=0,r=0;const a=new Array(e.length),o=new Array(e.length);for(let d=0;d<e.length;d++){const g=e[d].dataCount,y=e[d].totalCount-g;n=Math.max(n,g),r=Math.max(r,y),a[d]=new Array(g);for(let S=0;S<a[d].length;S++)a[d][S]=255&t.buffer[S+s];s+=g;const p=G.getErrorCorrectPolynomial(y),b=new xe(a[d],p.getLength()-1).mod(p);o[d]=new Array(p.getLength()-1);for(let S=0;S<o[d].length;S++){const C=S+b.getLength()-o[d].length;o[d][S]=C>=0?b.get(C):0}}let h=0;for(let d=0;d<e.length;d++)h+=e[d].totalCount;const c=new Array(h);let l=0;for(let d=0;d<n;d++)for(let g=0;g<e.length;g++)d<a[g].length&&(c[l++]=a[g][d]);for(let d=0;d<r;d++)for(let g=0;g<e.length;g++)d<o[g].length&&(c[l++]=o[g][d]);return c}}const sa=Math.ceil,Ye=Math.floor,ia=Math.round;function Jl(i,t){const e=cn(i),s=t?.ecc||"H",n=t?.size||256,r=-1,a=t?.padding||0,o=t?.color||"#000000",h=t?.background||"#ffffff",c=new ee(r,s);c.addData(e),c.make();const l=c.getModuleCount(),d=(n-a*2)/l,g=a,y=n-a;return ta(n,o,h,function(p,x){if(g<=p&&p<y&&g<=x&&x<y){const b=Ye((p-g)/d),S=Ye((x-g)/d);return c.isDark(S,b)?0:1}else return 1})}function Zl(i,t){const e=t.x||0,s=t.y||0,n=cn(i),r=t.ctx,a=t.ecc||"H",o=typeof t.size=="number"?Ye(t.size):256,h=t.padding||0,c=-1,l=t.color||"#000000",d=t.background||"#ffffff",g=new ee(c,a);g.addData(n),g.make();const y=g.getModuleCount(),p=(o-h*2)/y;r.fillStyle=d,r.fillRect(e,s,o,o);for(let x=0;x<y;x++)for(let b=0;b<y;b++){const S=sa((b+1)*p)-Ye(b*p),C=sa((x+1)*p)-Ye(x*p);r.fillStyle=g.isDark(x,b)?l:d,r.fillRect(e+ia(b*p)+h,s+ia(x*p)+h,S,C)}}class st extends U{shapesCountChange=!1;constructor(t){super(t)}shapeInit(){}frameStart(t){return this.shapesCountChange&&(this.shapesCountChange=!1,this.shapes.forEach(e=>{e.parent=this,e.initPathD()}),this.pathd=this.initPathD(),this.shapes.forEach(e=>{!e.forceCXY&&!e.independentTransformInGroup&&(e.cX=this.cX-e.diffXInGroup,e.cY=this.cY-e.diffYInGroup)})),super.frameStart(t)}frameUpdate(t,e){this.shapes.forEach(s=>{!s.independentTransformInGroup&&!s.isDragging&&(s.x=this.x+s.diffXInGroup,s.y=this.y+s.diffYInGroup,s.degree=this.degree+s.diffDegreeInGroup,s.scalarX=this.scalarX*s.diffScalarXInGroup,s.scalarY=this.scalarY*s.diffScalarYInGroup)}),super.frameUpdate(t,e)}addShape(t){(Array.isArray(t)?t:[t]).forEach(e=>{this.shapes.findIndex(s=>s.id==e.id)==-1&&(e.on("draging",(s,n)=>{this.enableDrag&&(this.x+=s,this.y+=n,this.emit("draging",s,n,e))}),this.shapes.push(e),this.shapesCountChange=!0)})}getBoundingClientRect(){const t=[],e=[];this.shapes.forEach(h=>{const c=h.getBoundingClientRect();c&&(t.push(c.x,c.x+c.width),e.push(c.y,c.y+c.height))});const s=this.pathd?.getBoundingClientRect();if(s&&(s.width||s.height)&&(t.push(s.x,s.x+s.width),e.push(s.y,s.y+s.height)),t.length==0||e.length==0)return null;const n=Math.min.apply(0,t),r=Math.min.apply(0,e),a=Math.max.apply(0,t),o=Math.max.apply(0,e);return{x:n,y:r,width:a-n,height:o-r}}setAttrs(t,e){typeof t!="string"?(super.setAttr(t),this.shapes.forEach(s=>{s.setAttr(t)})):e&&(super.setAttr(t,e),this.shapes.forEach(s=>{s.setAttr(t,e)}))}sortPathD(){this.shapes=this.shapes.map(t=>{const e=t.initPathD();return{shape:t,perimeter:e.perimeterPoints()}}).sort((t,e)=>e.perimeter-t.perimeter).map(t=>t.shape)}expendFill(t){const e=t.shapes.length,s=this.shapes.length;if(e<s)return t.expendFill(this);for(let n=s;n<e;n++){const a=t.shapes[n].initPathD().polymorphPoints,o=a[0],h=a[1],c=[["M",o,h]];for(let l=2;l+5<a.length;l+=6)c.push(["C",o,h,o,h,o,h]);this.addShape(new U({attrs:{...t.shapes[n].getAttrs()},d:c}))}}strokeDashTween(t,e){switch(e?.type){case"sequence":const s=this.shapes.length-1;this.shapes.forEach((o,h)=>{o.strokeDashTween(t,{...e,delay:h,onStart:()=>{h==0&&e?.onGroupStart?.()},onUpdate:()=>{e?.onGroupUpdate?.()},onComplete:()=>{h==s&&e?.onGroupComplete?.()}})});break;case"parallel":default:const n=new ps({frameDuration:t}),r={},a={};this.shapes.forEach((o,h)=>{const c=Et(o.getTotalLength(),0);r[`offset_${h}`]=c,a[`offset_${h}`]=0,o.setAttr({strokeDasharray:`${c} ${c}`,strokeDashoffset:`${c}`})}),n.addTween(r,a,Object.assign(e||{},{onStart:()=>{e?.onGroupStart?.()},onUpdate:(o,h)=>{for(let c in o){const l=qs(c).number;this.shapes[l].setAttr("strokeDashoffset",""+Et(o[c],2))}e?.onGroupUpdate?.()},onComplete:()=>{e?.onGroupComplete?.()}})),n.play();break}}}class ce extends U{toX;toY;constructor(t){super(t),this.toX=t?.toX||0,this.toY=t?.toY||0;let e=this.toX-this.x,s=this.toY-this.y;return new Proxy(this,{set(n,r,a,o){switch(r){case"x":n.toX=a+e;break;case"y":n.toY=a+s;break;case"toX":e=a-n.x;break;case"toY":s=a-n.y;break}return Reflect.set(n,r,a,o)}})}toSVGPathData(){return[["m",0,0],["l",this.toX-this.x,this.toY-this.y]]}toCanvasContext(t){t.beginPath(),t.moveTo(0,0),t.lineTo(this.toX-this.x,this.toY-this.y)}intersection(t){const e=new On({x:this.x,y:this.y,toX:this.toX,toY:this.toY}),s=new On({x:t.x,y:t.y,toX:t.toX,toY:t.toY});return e.intersection(s)}}class Kl extends U{cx;cy;toX;toY;isLineThrough;constructor(t){super(t),this.cx=t?.cx||0,this.cy=t?.cy||0,this.toX=t?.toX||0,this.toY=t?.toY||0,this.isLineThrough=typeof t?.isLineThrough=="boolean"?t.isLineThrough:!1}toSVGPathData(){if(this.isLineThrough){const t=this.cx*2-(this.x+this.toX)/2,e=this.cy*2-(this.y+this.toY)/2;return[["m",0,0],["q",t-this.x,e-this.y,this.toX-this.x,this.toY-this.y]]}else return[["m",0,0],["q",this.cx-this.x,this.cy-this.y,this.toX-this.x,this.toY-this.y]]}toCanvasContext(t){if(t.beginPath(),t.moveTo(0,0),this.isLineThrough){const e=this.cx*2-(this.x+this.toX)/2,s=this.cy*2-(this.y+this.toY)/2;t.quadraticCurveTo(e-this.x,s-this.y,this.toX-this.x,this.toY-this.y)}else t.quadraticCurveTo(this.cx-this.x,this.cy-this.y,this.toX-this.x,this.toY-this.y)}}class na extends er{currentItem={};items=[];groups=[];globalStyles={};grad={};idtops={};text="";constructor(t){super(t),this.on("tag",(e,s)=>{switch(this.text="",this.currentItem={type:e},e){case"g":this.groups.push(this.currentItem);break}this.processAttrs(e,s)}),this.on("text",e=>{if(this.currentItem.type=="style"){try{const s=eo(e);for(let n of s.stylesheet.rules)for(let r of n.declarations)for(let a of n.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,s)=>{let n=this.groups.length;for(;n--;)if(this.groups[n]!=this.currentItem){let r="",a="";for(let o in this.groups[n])o=="transform"?r=this.groups[n].transform:o=="class"&&this.globalStyles["."+this.groups[n][o]]?a=this.globalStyles["."+this.groups[n][o]].join(";")+";"+a:o=="id"&&this.globalStyles["#"+this.groups[n][o]]?a=this.globalStyles["#"+this.groups[n][o]].join(";")+";"+a:typeof this.currentItem[o]>"u"&&(this.currentItem[o]=this.groups[n][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),Xi(this.currentItem.style,this.currentItem,Yi)}switch(this.processAttrs(e,s),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 s=[],n;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":n={},e.style&&Xi(e.style,n),n.offset=n.offset||e.offset,n.color=n["stop-color"]||e["stop-color"],n.opacity=n["stop-opacity"]||e["stop-opacity"],~(n.offset+"").indexOf("%")?n.offset=parseFloat(n.offset):n.offset=parseFloat(n.offset)*100,n.offset=+n.offset.toFixed(2),this.grad.stops.push(n);break;case"linearGradient":this.grad.angle=(360+Bi(parseFloat(e.x1),parseFloat(e.y1),parseFloat(e.x2),parseFloat(e.y2),parseFloat(e.x1)+100,parseFloat(e.y1))).toFixed(2),s=[this.grad.angle];for(let o=0,h=this.grad.stops.length;o<h;o++)n=this.grad.stops[o],o&&o!=h-1?s.push(n.color+":"+n.offset):s.push(n.color);this.idtops[this.grad.id]=s.join("-"),this.items.forEach(o=>{o.fillid==this.grad.id&&(o.fill=this.idtops[this.grad.id])});break;case"radialGradient":s=[];for(let o=0,h=this.grad.stops.length;o<h;o++)n=this.grad.stops[o],o&&o!=h-1?s.push(n.color+":"+n.offset):s.push(n.color);this.idtops[this.grad.id]=s.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(Yi.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"&&Xi(a,this.currentItem,Yi),r==="transform"&&(this.currentItem.transform=a+(this.currentItem.transform||" ")),r==="fill"){const o=a.match(/url\(#([^)]+)\)/);if(o){const h=o[1];this.currentItem.fillid=h,this.idtops[h]&&(this.currentItem.fill=this.idtops[h])}}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 Bi(i,t,e,s,n,r){if(typeof n>"u"||typeof r>"u"){const a=i-e,o=t-s;return!a&&!o?0:(180+Math.atan2(-o,-a)*180/Math.PI+360)%360}else return Bi(i,t,n,r)-Bi(e,s,n,r)}function Xi(i,t,e){const s=(i+"").split(";"),n=/^\s+|\s+$/g;for(let r=0,a=s.length;r<a;r++){let o=s[r].split(":"),h=o[0].replace(n,"").replace(/[A-Z]/g,function(c){return"-"+c.toLowerCase()});(!e||e.includes(h))&&(t[h]=o[1].replace(n,""))}}const Yi=["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 Ql{app;rootEl;shapes=[];isMouseDown=!1;currentMouseInShape;currentEnableDragMouseInShape;dragDx=0;dragDy=0;constructor(t,e,s){this.app=t,this.rootEl=mt.createSVGElement("svg"),I.empty(this.app.container),I.insert(this.app.container,this.rootEl),e&&s?this.setSize(e,s):(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.dragDx=0,this.dragDy=0,this.setCursor()},end:()=>{this.isMouseDown=!1,this.dragDx=0,this.dragDy=0,this.setCursor()},move:(n,r)=>{this.currentEnableDragMouseInShape&&(this.dragDx+=r.dx,this.dragDy+=r.dy),this.setCursor()}}),this.app.on("tap",()=>{for(let n of this.shapes)if(this.currentMouseInShape==n){n.emit("clicked");let r=n.parent;for(;r;)r.emit("clicked",n),r=r.parent;break}})}setCursor(){this.currentEnableDragMouseInShape?(this.app.container.style.cursor="grab",this.isMouseDown&&(this.app.container.style.cursor="grabbing")):this.currentMouseInShape?this.app.container.style.cursor="pointer":this.app.container.style.cursor="default"}setSize(t,e){return I.attribute(this.rootEl,{viewBox:`0 0 ${t} ${e}`,width:`${t}`,height:`${e}`}),this}download(){return mt.downloadFromSVGElement(this.rootEl)}_addDrawShape(t){this.shapes.findIndex(e=>e.id==t.id)===-1&&(this.shapes.push(t),t instanceof st&&t.shapes.forEach(e=>{this._addDrawShape(e)}))}path(t){(Array.isArray(t)?t:[t]).forEach(e=>{this._addDrawShape(e)}),this.isMouseDown&&this.currentEnableDragMouseInShape||(this.currentMouseInShape=void 0);for(let e of this.shapes){if(!e.isShow){e.el&&(I.remove(e.el),delete e.el);continue}if(e.frameStart(this.app.mousePoint),e.el||(e instanceof Ue?e.el=this.text(e.text,e.x,e.y,pn(e.getAttrs(),(n,r)=>typeof r=="string")):(e.el=mt.createSvgPath(e.toSVGPathD(),e.id),I.insert(this.rootEl,e.el))),e.followMouse&&(!ts(e.x,this.app.mousePoint.x,5)||!ts(e.y,this.app.mousePoint.y,5))&&e.followTo(this.app.mousePoint),e.targetToAfterDragFree&&(this.isMouseDown||e.runEaseTo({x:e.targetToAfterDragFree.targetX,y:e.targetToAfterDragFree.targetY},{easing:e.targetToAfterDragFree?.easing})),this.isMouseDown&&this.currentEnableDragMouseInShape==e){e.isDragging=!0;const n=this.dragDx,r=this.dragDy;if(this.dragDx=0,this.dragDy=0,n||r){if(e.x+=n,e.y+=r,e.alongPath){const a=e.alongPath.closestPoint(e.x,e.y);e.x=a.point.x-e.cX,e.y=a.point.y-e.cY}e.emit("draging",n,r)}}else e.isDragging=!1;e instanceof Ue&&(e.setAttr("x",String(e.x)),e.setAttr("y",String(e.y))),e.frameUpdate(this.app.mousePoint);const s=e.toSVGPathD();if(this.attr(e,pn(e.getAttrs(),(n,r)=>typeof r=="string")),this.attr(e,"d",s),!this.currentMouseInShape){const n=e.isPointInPath(this.app.mousePoint.x,this.app.mousePoint.y,this.rootEl)||e.isPointInStroke(this.app.mousePoint.x,this.app.mousePoint.y,this.rootEl)||!1;e.isMouseIn=n,n&&(this.currentMouseInShape=e,e.enableDrag&&(this.currentEnableDragMouseInShape=e))}e.frameEnd(this.app.mousePoint)}this.currentMouseInShape||(this.currentEnableDragMouseInShape=void 0)}delete(t){(Array.isArray(t)?t:[t]).forEach(e=>{e.el&&I.remove(e.el),delete e.el,this.shapes=this.shapes.filter(s=>s.id!==e.id)})}clear(){this.shapes.forEach(t=>{t.el&&I.remove(t.el),delete t.el}),I.empty(this.rootEl),this.shapes=[]}attr(t,e,s){const n=t.el||t;return n instanceof SVGElement?e===void 0&&s===void 0?I.attribute(n):typeof e=="string"&&s===void 0?I.attribute(n,ct(e))||"":(typeof e=="object"?I.attribute(n,e):typeof e=="string"&&s!==void 0&&I.attribute(n,ct(e),s),this):this}circle(t,e,s){return this.path(new Ut({x:t,y:e,radius:s}))}circleEl(t,e,s){const n=mt.createSVGElement("circle",{cx:String(t),cy:String(e),r:String(s)});return I.insert(this.rootEl,n),n}ellipse(t,e,s,n){return this.path(new aa({x:t,y:e,rx:s,ry:n}))}ellipseEl(t,e,s,n){const r=mt.createSVGElement("ellipse",{cx:String(t),cy:String(e),rx:String(s),ry:String(n)});return I.insert(this.rootEl,r),r}rect(t,e,s,n){return this.path(new Gt({x:t,y:e,width:s,height:n}))}rectEl(t,e,s,n){const r=mt.createSVGElement("rect",{x:String(t),y:String(e),width:String(s),height:String(n)});return I.insert(this.rootEl,r),r}image(t,e,s,n,r){}text(t,e,s,n){const r=mt.createSVGElement("text",{x:String(e),y:String(s)});return I.html(r,t),this.attr(r,Object.assign({"alignment-baseline":"middle"},n)),I.insert(this.rootEl,r),r}textWithTspan(t,e,s,n){const r=n?.["line-height"]||"1.2em",a=mt.createSVGElement("text",{x:String(e),y:String(s)});return t.split(`
41
- `).forEach((o,h)=>{if(o.trim()){const c=mt.createSVGElement("tspan",{x:String(e),dy:h>0?r:"0"});I.html(c,o),I.insert(a,c),this.attr(c,Object.assign({"alignment-baseline":"middle"},n))}}),I.insert(this.rootEl,a),a}}class tu extends st{svgWidth=0;svgHeight=0;width=0;height=0;constructor(t){super(t);const e=new na(t.svg).parse();for(let s=0,n=e.length;s<n;s++){const r=e[s];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"||!oe.isSVGPath(r.path))continue;const a={};for(const l in r)l==="type"||l==="path"||l==="transform"||(a[l]=r[l]);const o=oe.absolutizeSVGPath(oe.parseSVGPath(r.path)),h=[];let c=[];for(let l=0,d=o.length;l<d;l++){const g=o[l];c.push(g),g[0].toLowerCase()=="z"&&(h.push(c),c=[])}c.length&&h.push(c),h.forEach(l=>{const d=fi(r.transform??"");d.scale(this.width&&this.svgWidth?this.width/this.svgWidth:1),this.addShape(new U({...t,attrs:{...a,...t?.attrs||{}},d:l,originMatrix:d}))})}}shapeInit(){this.trim()}}class Ut extends U{radius;constructor(t){super(t),this.radius=t?.radius||0}getBoundingClientRect(){return{x:this.x-this.radius,y:this.y-this.radius,width:this.radius*2,height:this.radius*2}}toSVGPathData(){return this.radius?[["m",0,-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",0,0]]}toCanvasContext(t){t.beginPath(),t.arc(0,0,this.radius,0,Math.PI*2,!0),t.closePath()}eq(t){return this.x===t.x&&this.y===t.y&&this.radius===t.radius&&this.mass===t.mass}midPointBtw(t){return{x:this.x+(t.x-this.x)/2,y:this.y+(t.y-this.y)/2}}length(){return rs(this.x,this.y)}scalar(t){return this.x*=t,this.y*=t,this}normalize(t=1){const e=this.length();if(e){const s=t/e;this.scalar(s)}return this}clamp(t){const e=this.length();return e&&e>t&&this.scalar(t/e),this}cross(t){const e=this.x,s=this.y;return{x:s*t.x-e*t.y,y:e*t.y-s*t.x}}multiply(t){return{x:this.x*t.x,y:this.y*t.y}}div(t){return{x:this.x/t.x,y:this.y/t.y}}add(t){return{x:this.x+t.x,y:this.y+t.y}}sub(t){return{x:this.x-t.x,y:this.y-t.y}}dot(t){return this.x*t.x+this.y*t.y}reflect(t){const e=this.dot(t);return{x:this.x-2*e*t.x,y:this.y-2*e*t.y}}checkCollision(t){const e=t.x-this.x,s=t.y-this.y;if(Math.sqrt(e*e+s*s)<this.radius+t.radius){const r=Math.atan2(s,e),a={x:0,y:0},o=Tt(-r,e,s),h=Tt(-r,this.vx,this.vy),c=Tt(-r,t.vx,t.vy),l=h.x-c.x;h.x=((this.mass-t.mass)*h.x+2*t.mass*c.x)/(this.mass+t.mass),c.x=l+h.x;const d=Math.abs(h.x)+Math.abs(c.x),g=this.radius+t.radius-Math.abs(a.x-o.x);a.x+=h.x/d*g,o.x+=c.x/d*g;const y=Tt(r,a.x,a.y),p=Tt(r,o.x,o.y);t.x=this.x+p.x,t.y=this.y+p.y,this.x=this.x+y.x,this.y=this.y+y.y;const x=Tt(r,h.x,h.y),b=Tt(r,c.x,c.y);this.vx=x.x,this.vy=x.y,t.vx=b.x,t.vy=b.y}}checkWall(t){const e=typeof t?.bounce=="number"?t.bounce:-1,s=t.wall.x,n=t.wall.y,r=t.wall.x+t.wall.width,a=t.wall.y+t.wall.height;this.x+this.radius>r?(this.x=r-this.radius,this.vx*=e):this.x-this.radius<s&&(this.x=s+this.radius,this.vx*=e),this.y+this.radius>a?(this.y=a-this.radius,this.vy*=e):this.y-this.radius<n&&(this.y=n+this.radius,this.vy*=e)}}class ra extends U{points;isStraight;constructor(t){if(super(t),this.points=t.points,this.points.length<3)throw new Error("points length must >= 3");this.isStraight=typeof t?.isStraight=="boolean"?t.isStraight:!0}toSVGPathData(){const t=[],e=this.points.length;if(this.isStraight){t.push(["M",this.points[0].x,this.points[0].y]);for(let s=1;s<=e-1;s++)t.push(["L",this.points[s].x,this.points[s].y]);t.push(["Z"])}else{const s=(this.points[0].x+this.points[e-1].x)/2,n=(this.points[0].y+this.points[e-1].y)/2;t.push(["M",s,n]);for(let r=0;r<e-1;r++){const a=(this.points[r].x+this.points[r+1].x)/2,o=(this.points[r].y+this.points[r+1].y)/2;t.push(["Q",this.points[r].x,this.points[r].y,a,o])}t.push(["Q",this.points[e-1].x,this.points[e-1].y,s,n])}return t}toCanvasContext(t){t.beginPath();const e=this.points.length;if(this.isStraight){t.moveTo(this.points[0].x,this.points[0].y);for(let s=1;s<=e-1;s++)t.lineTo(this.points[s].x,this.points[s].y);t.closePath()}else{const s=(this.points[0].x+this.points[e-1].x)/2,n=(this.points[0].y+this.points[e-1].y)/2;t.moveTo(s,n);for(let r=0;r<e-1;r++){const a=(this.points[r].x+this.points[r+1].x)/2,o=(this.points[r].y+this.points[r+1].y)/2;t.quadraticCurveTo(this.points[r].x,this.points[r].y,a,o)}t.quadraticCurveTo(this.points[e-1].x,this.points[e-1].y,s,n)}}isContainPoint(t,e){const s=this.points.length;let n=!1;const r=2e-10;for(let a=0,o=s-1;a<s;o=a,a++){const h=this.points[a].x,c=this.points[a].y,l=this.points[o].x,d=this.points[o].y;if(h===t&&c===e||l===t&&d===e||e===c&&e===d)return!0;if(e>=c&&e<d||e<c&&e>=d){const g=(l-h)/(d-c),y=h+g*(e-c);if(y===t||Math.abs(y-t)<r)return!0;y>t&&(n=!n)}}return n}[Symbol.iterator](){let t=-1;return{next:()=>({value:t<=this.points.length-1?this.points[++t]:void 0,done:t>=this.points.length})}}}class Gt extends U{width;height;borderRadius;constructor(t){super(t),this.width=t.width,this.height=t.height,this.borderRadius=t.borderRadius||0}static fromCubicBezier(t,e,s,n,r,a,o,h){const c=new lt({x:t,y:e,c1x:s,c1y:n,c2x:r,c2y:a,toX:o,toY:h});return new Gt(c.getBoundingClientRect())}getBoundingClientRect(){return{x:this.x,y:this.y,width:this.width,height:this.height}}toSVGPathData(){return this.borderRadius?[["m",this.borderRadius,0],["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",0,0],["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}}class aa extends U{rx;ry;constructor(t){super(t),this.rx=t?.rx||0,this.ry=t?.ry||0}getBoundingClientRect(){return{x:this.x-this.rx,y:this.y-this.ry,width:this.rx*2,height:this.ry*2}}toSVGPathData(){return[["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(0,0,this.rx,this.ry,0,0,2*Math.PI,!0),t.closePath()}}class eu extends U{constructor(t){super(t)}toSVGPathData(){return[["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 su extends U{constructor(t){super(t)}toSVGPathData(){return[["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()}}class iu extends U{rx;ry;constructor(t){super(t),this.rx=t?.rx||10,this.ry=t?.ry||10}toSVGPathData(){return[["m",0,0],["l",this.rx*2.4,-this.ry*3.14],["a",this.rx/2,this.ry/2,0,0,0,-this.rx*2.4,-this.ry*1.5],["a",this.rx/2,this.ry/2,0,0,0,-this.rx*2.4,this.ry*1.5],["l",this.rx*2.4,this.ry*3.14],["z"]]}}class nu extends U{rx;ry;constructor(t){super(t),this.rx=t?.rx??50,this.ry=t?.ry??50}toSVGPathData(){return[["m",0,0+this.ry*.3],["C",0,0,0-this.rx/2,0,0-this.rx/2,0+this.ry*.3],["C",0-this.rx/2,0+(this.ry+this.ry*.3)/2,0,0+(this.ry+this.ry*.3)/1.4,0,0+this.ry],["C",0,0+(this.ry+this.ry*.3)/1.8,0+this.rx/2,0+(this.ry+this.ry*.3)/2,0+this.rx/2,0+this.ry*.3],["C",0+this.rx/2,0,0,0,0,0+this.ry*.3],["z"]]}}class ru extends U{r;constructor(t){super(t),this.r=t?.r||20}toSVGPathData(){const t=[["m",0,-this.r]];for(let e=0;e<6;e+=1){const s=288+e*144,n=this.r*Math.cos(O(s)),r=this.r*Math.sin(O(s));t.push(["l",n,r])}return t}}class au extends U{constructor(t){super(t)}toSVGPathData(){return[["M",0,0],["C",15,0,15,-40,5,-30],["L",0,0],["C",-15,0,-15,-40,-5,-30],["L",0,0],["a",15,15,0,1,1,0,30],["a",15,15,0,1,1,0,-30]]}}class ou extends U{constructor(t){super(t),this.originD="m5.068 9.267-3.08-.77a.512.512 0 0 1 0-.994l3.08-.77a2.289 2.289 0 0 0 1.665-1.665l.77-3.08a.512.512 0 0 1 .994 0l.77 3.08c.205.82.845 1.46 1.665 1.665l3.08.77a.512.512 0 0 1 0 .994l-3.08.77a2.29 2.29 0 0 0-1.665 1.665l-.77 3.08a.512.512 0 0 1-.994 0l-.77-3.08a2.289 2.289 0 0 0-1.665-1.665Z"}}class hu extends st{constructor(t){super(t);const e=new ce({...t,x:this.x,y:this.y,toX:this.x,toY:this.y-140-Math.random()*20}),s=30+Math.random()*30,n=new ce({...t,x:this.x,y:this.y-s,diffYInGroup:-s,toX:this.x+Math.random()*80-40,toY:this.y-100-Math.random()*40}),r=60+Math.random()*40,a=new ce({...t,x:this.x,y:this.y-r,diffYInGroup:-r,toX:this.x+Math.random()*60-30,toY:this.y-110-Math.random()*20});this.addShape([e,n,a])}}class Ue extends U{text;width=0;height=0;constructor(t){super(t),this.text=t.text,this.setAttr({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',emojiFontFamily:'"Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji", "EmojiOne Color", "Android Emoji", "Twemoji Mozilla", "system emoji", sans-serif',fill:"#666666",stroke:"none","alignment-baseline":"middle",textAnchor:"start",...this.getAttrs()});const e=qs(this.getAttr("fontSize"),10).number,s=qs(this.getAttr("fontWeight"),400).number,n=I.measureText(this.text,e,s);this.width=n.width,this.height=n.height}getBoundingClientRect(){return null}toSVGPathData(){return[]}toCanvasContext(t){t.fillText(this.text,0,0)}}class oa extends st{text;bg;padding;offset;isShow;textShape;bgShape;constructor(t){super(t),this.text=t.text,this.bg=t.bg||"rgba(0,0,0,0.5)",this.padding=t.padding||4,this.offset=t.offset||20,this.isShow=typeof t?.isShow=="boolean"?t?.isShow:!1,this.textShape=new Ue({...t,x:this.x+this.offset,y:this.y+this.offset,text:this.text,attrs:{...this.getAttrs(),fill:nr(this.bg,!0),textAnchor:"start"}}),this.bgShape=new Gt({...t,x:this.textShape.x-this.padding,y:this.textShape.y-this.textShape.height/2-this.padding,width:this.textShape.width+this.padding*2,height:this.textShape.height+this.padding*2,attrs:{...this.getAttrs(),fill:this.bg}}),this.addShape([this.bgShape,this.textShape])}shapeInit(){zs(()=>{this.textShape.x=this.x+this.offset,this.textShape.y=this.y+this.offset,this.textShape.text=this.text,this.textShape.isShow=this.isShow,this.bgShape.x=this.textShape.x-this.padding,this.bgShape.y=this.textShape.y-this.textShape.height/2-this.padding,this.bgShape.width=this.textShape.width+this.padding*2,this.bgShape.height=this.textShape.height+this.padding*2,this.bgShape.isShow=this.isShow})}}class cu extends st{radius;expandRaidus;startDegree;endDegree;text="";defaultShowText;tip="";p1=new Ut;p1Offset=10;p2=new Ut;p2Offset=40;p3=new Ut;p3Offset=10;p4=new Ut;p4Offset=10;direction=1;sectorArc;line12;line23;textShape;tipShape;constructor(t){super(t),this.radius=t.radius,this.expandRaidus=t.expandRaidus??20,this.startDegree=t.startDegree,this.endDegree=t.endDegree,this.text=t.text||"",this.defaultShowText=typeof t?.defaultShowText=="boolean"?t.defaultShowText:!!this.text,this.tip=t.tip||"",this.sectorArc=new ha({x:this.x,y:this.y,radius:this.radius,expandRaidus:this.expandRaidus,startDegree:this.startDegree,endDegree:this.endDegree,attrs:Object.assign({...this.getAttrs()},{strokeWidth:"0"})}),this.addShape(this.sectorArc);const e=Object.assign({...this.getAttrs()},{fill:"none"});this.line12=new ce({x:this.p1.x,y:this.p1.y,toX:this.p2.x,toY:this.p2.y,attrs:{...e},isShow:this.defaultShowText}),this.line23=new ce({x:this.p2.x,y:this.p2.y,toX:this.p3.x,toY:this.p3.y,attrs:{...e},isShow:this.defaultShowText}),this.textShape=new Ue({x:this.p4.x,y:this.p4.y,text:this.text,attrs:{stroke:e.stroke,textAnchor:this.direction==1?"start":"end"},isShow:this.defaultShowText}),this.text&&(this.addShape(this.line12),this.addShape(this.line23),this.addShape(this.textShape)),this.tipShape=new oa({x:0,y:0,text:this.tip,isShow:!1}),this.tip&&this.addShape(this.tipShape)}frameUpdate(t){this.text&&!this.defaultShowText&&(this.line12.isShow=this.sectorArc.isMouseIn,this.line23.isShow=this.sectorArc.isMouseIn,this.textShape.isShow=this.sectorArc.isMouseIn);const e=this.startDegree+(this.endDegree-this.startDegree)/2,{dx:s,dy:n}=At(O(e),this.sectorArc.radius+this.p1Offset);this.p1.x=this.x+s,this.p1.y=this.y+n;const{dx:r,dy:a}=At(O(e),this.sectorArc.radius+this.p1Offset+this.p2Offset);this.p2.x=this.x+r,this.p2.y=this.y+a,this.line12.x=this.p1.x,this.line12.y=this.p1.y,this.line12.toX=this.p2.x,this.line12.toY=this.p2.y,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,this.line23.x=this.p2.x,this.line23.y=this.p2.y,this.line23.toX=this.p3.x,this.line23.toY=this.p3.y,this.textShape.x=this.p4.x,this.textShape.y=this.p4.y,this.textShape.setAttr("textAnchor",this.direction==1?"start":"end"),this.sectorArc.isMouseIn?(this.tipShape.isShow=!0,this.tipShape.x=t.x,this.tipShape.y=t.y):(this.tipShape.isShow=!1,this.tipShape.x=t.x,this.tipShape.y=t.y)}}class ha extends U{radius;realRadius;expandRaidus;startDegree;endDegree;vr;ar;bounce;durationTime;status;constructor(t){super(t),this.radius=0,this.realRadius=t.radius,this.expandRaidus=t.expandRaidus??20,this.startDegree=t.startDegree,this.endDegree=t.endDegree,this.vr=0,this.ar=.03,this.bounce=.6,this.durationTime=8.333333333333334,this.status=0}frameUpdate(){this.status==0&&this.radius<this.realRadius?(this.expand(this.realRadius),this.radius>=this.realRadius&&(this.status=1)):this.isMouseIn?this.expand(this.realRadius+this.expandRaidus):this.shrink(this.realRadius)}expand(t){this.vr+=this.ar,this.radius+=this.vr*this.durationTime,this.radius>t&&(this.radius=t,this.vr*=-this.bounce)}shrink(t){this.vr-=this.ar,this.radius+=this.vr*this.durationTime,this.radius<t&&(this.radius=t,this.vr*=-this.bounce)}toSVGPathData(){const{dx:t,dy:e}=At(O(this.startDegree),this.radius),{dx:s,dy:n}=At(O(this.endDegree),this.radius);return[["m",0,0],["l",t,e],["a",this.radius,this.radius,0,Math.abs(this.endDegree-this.startDegree)>=180?1:0,1,s-t,n-e],["z"]]}toCanvasContext(t){t.beginPath(),t.moveTo(0,0),t.arc(0,0,this.radius,O(this.startDegree),O(this.endDegree),!1),t.closePath()}containPoint(t,e){const s=as(this.x,this.y,t,e),n=tt($t(this.x,this.y,t,e));return s<=this.radius&&n>=this.startDegree&&n<=this.endDegree}}class lu extends st{showFlame;ship;flame;constructor(t){super(t),this.showFlame=typeof t?.showFlame=="boolean"?t.showFlame:!1,this.ship=new U({...t,d:[["M",10,0],["L",-10,10],["L",-5,0],["L",-10,-10],["L",10,0],["Z"]]}),this.addShape(this.ship),this.flame=new U({...t,isShow:this.showFlame,d:[["m",-10,-5],["l",-7.5,5],["l",7.5,5],["z"]]}),this.addShape(this.flame)}shapeInit(){zs(()=>{this.ship.x=this.x,this.ship.y=this.y,this.flame.x=this.x,this.flame.y=this.y,this.flame.isShow=this.showFlame})}}class uu extends st{value;backgroundRect;occupyRect;handle;constructor(t){super(t);const e=t?.min||0,s=t?.max||100,n=t?.step||1,r=Ja(e,s,n);this.value=r(typeof t?.defaultValue=="number"?yt(t.defaultValue,e,s):e);const a=this.value/(s-e),o=t?.barWidth||100,h=t?.barHeight||4,c=t?.handleRadius||10,l=h*.5,d=t?.barColor||gi.colorGrayF5,g=t?.handleColor||gi.colorPrimary;this.backgroundRect=new Gt({x:this.x,y:this.y,width:o,height:h,borderRadius:l,attrs:{fill:d},enableDrag:!1,independentTransformInGroup:!0}),this.addShape(this.backgroundRect),this.occupyRect=new Gt({x:this.x,y:this.y,width:o*a,height:h,borderRadius:l,attrs:{fill:g},enableDrag:!1,independentTransformInGroup:!0}),this.addShape(this.occupyRect),this.handle=new Ut({x:this.x+o*a,y:this.y+l,diffXInGroup:o*a,diffYInGroup:l,radius:c,alongPath:new Go({x:this.x,y:this.y+l,d:[["m",0,0],["l",o,0]]}),attrs:{fill:g},enableDrag:!0,independentTransformInGroup:!0}),this.addShape(this.handle),this.handle.on("draging",y=>{this.occupyRect.width=yt(this.occupyRect.width+y,0,o),this.value=r((this.handle.x-this.x)/o*(s-e)+e),this.emit("change",this.value)})}}class du extends st{width;height;cornerRadius;controlPoint;mainRect;rightPoint;constructor(t){super(t),this.width=t.width,this.height=t.height,this.cornerRadius=this.height/2,this.controlPoint=new Ut({...t,x:this.x,y:this.y,radius:2}),this.forceSetCXY(this.controlPoint.cX,this.controlPoint.cY),this.mainRect=new Gt({...t,x:this.x-this.cornerRadius,y:this.y-this.cornerRadius,diffXInGroup:-this.cornerRadius,diffYInGroup:-this.cornerRadius,width:this.width+this.cornerRadius*2,height:this.height,borderRadius:this.cornerRadius}),this.rightPoint=new Ut({...t,x:this.x+this.width,y:this.y,diffXInGroup:this.width,radius:2}),this.addShape([this.mainRect,this.controlPoint,this.rightPoint])}getPin(){return{x:this.controlPoint.x+Math.cos(O(this.controlPoint.degree))*this.width,y:this.controlPoint.y+Math.sin(O(this.controlPoint.degree))*this.width}}}class Ui extends U{extendDegree;radius;startDegree;endDegree;diffDegree;constructor(t){super(t),this.extendDegree=t?.extendDegree||0,this.x=(t.x||0)+t.width/2;const e=Math.min(t.width/2,t.height)-t.lineWidth;this.radius=e-e*Math.abs(Math.sin(O(this.extendDegree))),this.y=(t.y||0)+t.height-t.lineWidth-this.radius*Math.abs(Math.sin(O(this.extendDegree))),this.diffDegree=t.endDegree-t.startDegree,this.startDegree=180+t.startDegree-this.extendDegree,this.endDegree=180+t.endDegree+this.extendDegree,this.setAttr({"stroke-linecap":"round","stroke-width":String(t.lineWidth),stroke:t.color||"none"})}setPercent(t){this.endDegree=this.startDegree+(this.diffDegree+this.extendDegree*2)*t}toSVGPathData(){const{dx:t,dy:e}=At(O(this.startDegree),this.radius),{dx:s,dy:n}=At(O(this.endDegree),this.radius);return[["m",t,e],["a",this.radius,this.radius,0,Math.abs(this.endDegree-this.startDegree)>=180?1:0,1,s-t,n-e]]}toCanvasContext(t){t.beginPath(),t.arc(0,0,this.radius,O(this.startDegree),O(this.endDegree),!1)}}class fu extends st{percent=0;ringBg;ring;lines=[];bgColor;startColor;endColor;indicatorLineCount;constructor(t){super(t);const e=t?.startDegree||0,s=t?.endDegree||180,n=t?.extendDegree||15,r=t?.lineWidth||12;this.bgColor=t?.bgColor||"#B3C6E7",this.startColor=t?.startColor||"#5A82F0",this.endColor=t?.endColor||"#66B3FF",this.percent=t?.percent||0,this.indicatorLineCount=23;const a=20,o=2,h=17;this.ringBg=new Ui({...t,x:t?.x,y:t?.y,width:t.width,height:t.height,startDegree:e,endDegree:s,extendDegree:n,lineWidth:r,color:this.bgColor}),this.addShape(this.ringBg),this.ring=new Ui({...t,x:t?.x,y:t?.y,width:t.width,height:t.height,startDegree:e,endDegree:s,extendDegree:n,lineWidth:r}),this.addShape(this.ring);const c=this.ringBg.y-this.ringBg.radius+a;for(let l=0;l<this.indicatorLineCount;l++)this.lines.push(new ce({...t,centerX:this.ringBg.x,centerY:this.ringBg.y,x:this.ringBg.x,y:c,toX:this.ringBg.x,toY:c+h,degree:this.ringBg.startDegree+90+(s-e+n*2)/(this.indicatorLineCount-1)*l,attrs:{"stroke-linecap":"round","stroke-width":String(o),stroke:this.bgColor}}));this.addShape(this.lines)}setPercent(t){this.percent=t}shapeInit(){this.on("draging",(t,e,s)=>{this.shapes.forEach(n=>{n!=s&&(n.x+=t,n.y+=e)})})}frameUpdate(t,e){const s=this.ringBg.radius-this.ringBg.radius*Math.cos(Math.PI*this.percent),n=this.ringBg.radius*Math.sin(Math.PI*this.percent);if(e){const r=e.createLinearGradient(-this.ringBg.radius,0,-this.ringBg.radius+s,-n,{0:this.startColor,1:this.endColor});this.ring.setAttr({stroke:r})}else this.ring.setAttr({stroke:this.startColor});this.ring.setPercent(this.percent);for(let r=0;r<this.indicatorLineCount;r++){const a=r/(this.indicatorLineCount-1)<=this.percent;this.lines[r].setAttr({stroke:a&&e?e.createLinearGradient(0,0,this.lines[r].toX-this.lines[r].x,this.lines[r].toY-this.lines[r].y,{0:this.startColor,1:this.endColor}):a?this.startColor:this.bgColor})}}}class mu extends U{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=this.setBrightness(t?.brightness||1)}setBrightness(t){return this.brightness=yt(t,0,1),this.brightness}toSVGPathData(){return[]}}const pu=mu;class gu extends U{points;light;constructor(t=[]){if(t.length<3)throw new Error("points length must >= 3");super(),this.points=t,this.light=new pu({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,s=this.points.length;e<=s-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,s=this.points.length;e<=s-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(),s=this.points[1].getScreenX()-this.points[2].getScreenX(),n=this.points[1].getScreenY()-this.points[2].getScreenY();return t*n>e*s}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},s={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},n=s.x*this.light.x+s.y*this.light.y+s.z*this.light.z,r=Math.sqrt(s.x*s.x+s.y*s.y+s.z*s.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(n/(r*a))/Math.PI*this.light.brightness}getAdjustedColor(t){const e=It(t),s=this.getLightFactor();return e.r*=s,e.g*=s,e.b*=s,ge(e)}}class yu extends st{fettis=[];constructor(t,e,s){super();const{shape:n,x:r,y:a,particleCount:o,angle:h,spread:c,startVelocity:l,decay:d,gravity:g,drift:y,ticks:p,colors:x,scalar:b,flat:S}=mn(s||{},{shape:Gt,x:.5,y:.6,particleCount:100,angle:90,spread:70,startVelocity:45,decay:.9,gravity:1,drift:0,ticks:200,colors:ir,scalar:1,flat:!1}),C=O(h),L=O(c);let R=o;for(;R--;){const Y=new n({x:t*r,y:e*a,width:10,height:10,scalar:b,attrs:{fill:x[R%x.length]},independentTransformInGroup:!0});this.addShape(Y),this.fettis.push({shape:Y,wobble:Math.random()*10,wobbleSpeed:Math.min(.11,Math.random()*.1+.05),velocity:l*.5+Math.random()*l,angle2D:-C+(.5*L-Math.random()*L),tiltAngle:(Math.random()*.5+.25)*Math.PI,tick:0,totalTicks:p,decay:d,drift:y,random:Math.random()+2,tiltSin:0,tiltCos:0,wobbleX:0,wobbleY:0,gravity:g*3,scalar:b,flat:S})}}frameUpdate(t){this.fettis.length&&(this.fettis=this.fettis.filter(e=>{e.shape.x+=Math.cos(e.angle2D)*e.velocity+e.drift,e.shape.y+=Math.sin(e.angle2D)*e.velocity+e.gravity,e.velocity*=e.decay,e.flat?(e.wobble=0,e.wobbleX=e.shape.x+10*e.scalar,e.wobbleY=e.shape.y+10*e.scalar,e.tiltSin=0,e.tiltCos=0,e.random=1):(e.wobble+=e.wobbleSpeed,e.wobbleX=e.shape.x+10*e.scalar*Math.cos(e.wobble),e.wobbleY=e.shape.y+10*e.scalar*Math.sin(e.wobble),e.tiltAngle+=.1,e.tiltSin=Math.sin(e.tiltAngle),e.tiltCos=Math.cos(e.tiltAngle),e.random=Math.random()+2);const s=e.tick++/e.totalTicks,n=e.shape.x+e.random*e.tiltCos,r=e.shape.y+e.random*e.tiltSin,a=e.wobbleX+e.random*e.tiltCos,o=e.wobbleY+e.random*e.tiltSin;return e.shape.setAttr("fill",wi(e.shape.getAttr("fill"),1-s)),e.shape.degree=tt(Math.PI/10*e.wobble),e.shape.scalarX=Math.abs(a-n)*.1,e.shape.scalarY=Math.abs(o-r)*.1,e.tick<e.totalTicks}))}}class Gi{shapes;constructor(t){this.shapes=t}run(t){this.shapes.forEach(s=>{s.run(),t?.wall&&s.checkWall({wall:t.wall,bounce:t.bounce})});const e=this.shapes.length;for(let s=0,n=e-1;s<n;s++)for(let r=s+1;r<e;r++)this.shapes[s].checkCollision(this.shapes[r])}gravitate(){const t=this.shapes.length;this.shapes.forEach((e,s)=>{e.run();for(let n=s+1;n<t;n++)e.checkCollision(this.shapes[n]),e.gravitateTo(this.shapes[n])})}springChain(t){this.shapes.forEach((e,s)=>{s>0&&e.runSpringTo(this.shapes[s-1],t)})}springConnect(t){const e=jt(t?.springLength,100);this.shapes.forEach(s=>{s.isDragging||this.shapes.filter(n=>n.id!==s.id).forEach(n=>{const r=$t(s.x,s.y,n.x,n.y);s.runSpringTo({x:n.x-Math.cos(r)*e,y:n.y-Math.sin(r)*e},t)})})}springMass(t,e){const s=this.shapes.length,n=[];return this.shapes.forEach((r,a)=>{r.run(e),r.x>t.x+t.width?r.x=t.x:r.x<t.x&&(r.x=t.x+t.width),r.y>t.y+t.height?r.y=t.y:r.y<t.y&&(r.y=t.y+t.height);for(let o=a+1;o<s;o++)n.push([r.x,r.y,this.shapes[o].x,this.shapes[o].y,r.springMassTo(this.shapes[o],e)])}),n}polymorph(){if(this.shapes.length<2)throw new Error("shapes个数必须大于等于2");const t=this.shapes.length-1,e=new Array(t);for(let n=0;n<t;n++){const r=this.shapes[n].initPathD();this.shapes[n].frameStart();const a=this.shapes[n+1].initPathD();this.shapes[n+1].frameStart();const o=Math.max(r.polymorphPoints.length,a.polymorphPoints.length);e[n]=pt.getPathInterpolator(r.expendFill(o),a.expendFill(o))}const s=new U({d:e[0](0)});return n=>{const r=Et(t*n,6),a=Math.min(Math.floor(r),t-1),o=Et(r-a,6);s.originD=e[a](o);const h=this.shapes[a].getAttr("fill","none"),c=this.shapes[a+1].getAttr("fill","none");typeof h=="string"&&typeof c=="string"&&s.setAttr("fill",xi(h,c,o));const l=this.shapes[a].getAttr("stroke","none"),d=this.shapes[a+1].getAttr("stroke","none");return typeof l=="string"&&typeof d=="string"&&s.setAttr("stroke",xi(l,d,o)),s}}polymorphGroup(){if(this.shapes.length<2)throw new Error("shapes个数必须大于等于2");let t=0,e;const s=[];this.shapes.forEach(o=>{let h;o instanceof st?(h=o,h.sortPathD()):(h=new st,h.addShape(o)),s.push(h),t<h.shapes.length&&(t=h.shapes.length,e=h)}),s.forEach(o=>{o!==e&&o.expendFill(e)});const n=[];s.forEach((o,h)=>{o.shapes.forEach((c,l)=>{n[l]=n[l]||[],n[l][h]=c})});const r=[];n.forEach(o=>{r.push(new Gi(o).polymorph())});const a=new st;return r.forEach(o=>{a.addShape(o(0))}),o=>(r.forEach(h=>{h(o)}),a)}polymorphTween(t=6e3,e){const s=this.shapes.findIndex(o=>o instanceof st)>=0?this.polymorphGroup():this.polymorph(),n=s(0),r=e?.onUpdate,a=new ps({frameDuration:t});a.addTween({t:0},{t:1},Object.assign(e||{},{onUpdate:(o,h)=>{s(o.t),r?.(o,h),e?.draw?.(n)}})),a.play()}static generatePointsShape(t,e,s,n){const r=[];for(let a=0;a<n;a++){const o=a/n*2*Math.PI,{dx:h,dy:c}=At(o,s);r.push({x:t+h,y:e+c})}return new ra({points:r})}static generateRosettaShape(t,e,s,n,r){if(r==0)throw new Error("no dividing by zero, please");const a=[],o=360/r;for(let h=0;h<r;h+=1){const c=o*h*Math.PI/180,l=t+2*s*Math.cos(c),d=e+2*s*Math.sin(c);a.push(new ei({x:t,y:e,rx:s,ry:n,xAxisRotate:o*h,largeArcFlag:1,sweepFlag:1,toX:l,toY:d})),a.push(new ei({x:l,y:d,rx:s,ry:n,xAxisRotate:o*h,largeArcFlag:1,sweepFlag:1,toX:t,toY:e}))}return new U({d:pt.fromLines(a)})}}const ca={map:new Map,transform:function(i){if(Ln)return i;if(this.map.has(i))return this.map.get(i);const t=new OffscreenCanvas(i.width,i.height);return t.getContext("2d")?.drawImage(i,0,0),this.map.set(i,t),t},clear:function(){this.map.clear()}};function wu(i,t,e){const s=new OffscreenCanvas(i,t),n=s.getContext("2d");if(n)return e(n),s.transferToImageBitmap()}function xu(i,t,e){const s=i.createPattern(ca.transform(t),"no-repeat");if(s){const n=mi(e);s.setTransform(n),i.fillStyle=s}}class bu{app;ctx;shapes=[];isMouseDown=!1;currentMouseInShape;currentEnableDragMouseInShape;dragDx=0;dragDy=0;constructor(t,e=!1){if(this.app=t,!(this.app.container instanceof HTMLCanvasElement))throw new Error("app.container 应该为 HTMLCanvasElement!");this.ctx=new ls(this.app.container,this.app.width,this.app.height,e),this.app.captureMove({start:()=>{this.isMouseDown=!0,this.dragDx=0,this.dragDy=0,this.setCursor()},end:()=>{this.isMouseDown=!1,this.dragDx=0,this.dragDy=0,this.setCursor()},move:(s,n)=>{this.currentEnableDragMouseInShape&&(this.dragDx+=n.dx,this.dragDy+=n.dy),this.setCursor()}}),this.app.on("tap",()=>{for(let s of this.shapes)if(this.currentMouseInShape==s){s.emit("clicked");let n=s.parent;for(;n;)n.emit("clicked",s),n=n.parent;break}})}setCursor(){this.currentEnableDragMouseInShape?(this.app.container.style.cursor="grab",this.isMouseDown&&(this.app.container.style.cursor="grabbing")):this.currentMouseInShape?this.app.container.style.cursor="pointer":this.app.container.style.cursor="default"}transformCtxBaseOnShape(t){t.usePathDtoCanvasContext||(this.ctx.translate(t.x,t.y),this.ctx.rotate(O(t.degree),t.cX,t.cY),this.ctx.scale(t.scalarX,t.scalarY,t.cX,t.cY))}_addDrawShape(t){this.shapes.push(t),t instanceof st&&t.shapes.forEach(e=>{this._addDrawShape(e)})}draw(t=[]){this.shapes=[],(Array.isArray(t)?t:[t]).forEach(e=>{this._addDrawShape(e)}),this.isMouseDown&&this.currentEnableDragMouseInShape||(this.currentMouseInShape=void 0);for(let e of this.shapes){if(!e.isShow)continue;if(this.ctx.save(),e.frameStart(this.app.mousePoint),I.attrsToCanvas(this.ctx,e.getAttrs()),e.followMouse&&(!ts(e.x,this.app.mousePoint.x,5)||!ts(e.y,this.app.mousePoint.y,5))&&e.followTo(this.app.mousePoint),e.targetToAfterDragFree&&(this.isMouseDown||e.runEaseTo({x:e.targetToAfterDragFree.targetX,y:e.targetToAfterDragFree.targetY},{easing:e.targetToAfterDragFree?.easing})),this.isMouseDown&&this.currentEnableDragMouseInShape==e){e.isDragging=!0;const n=this.dragDx,r=this.dragDy;if(this.dragDx=0,this.dragDy=0,n||r){if(e.x+=n,e.y+=r,e.alongPath){const a=e.alongPath.closestPoint(e.x,e.y);e.x=a.point.x-e.cX,e.y=a.point.y-e.cY}e.emit("draging",n,r)}}else e.isDragging=!1;e.frameUpdate(this.app.mousePoint,this.ctx),this.transformCtxBaseOnShape(e),e.toCanvasContext(this.ctx),this.ctx.hasSetCustomStrokeStyle&&this.ctx.stroke(),this.ctx.hasSetCustomFillStyle&&this.ctx.fill();const s=this.ctx.currentPath2D;if(!this.currentMouseInShape){const n=this.ctx.isPointInPath(s,this.app.mousePoint.x,this.app.mousePoint.y)||this.ctx.isPointInStroke(s,this.app.mousePoint.x,this.app.mousePoint.y)||!1;e.isMouseIn=n,n&&(this.currentMouseInShape=e,e.enableDrag&&(this.currentEnableDragMouseInShape=e))}e.frameEnd(this.app.mousePoint),this.ctx.restore()}this.currentMouseInShape||(this.currentEnableDragMouseInShape=void 0)}drawMouseMoveLine(t="line",e){switch(t){case"brush":const s=e?.brushSize??10,n=e?.brushDensity??50,r=e?.brushColor??"#000000",a=this.ctx.getImageData(0,0,this.ctx.canvas.width,this.ctx.canvas.height),o=a.data,h=It(r);return this.app.captureMove({move:()=>{if(this.isMouseDown){for(let c=0;c<n;c++){const l=Math.random()*Math.PI*2,d=Math.random()*s,g=this.app.mousePoint.x+Math.cos(l)*d|0,y=this.app.mousePoint.y+Math.sin(l)*d|0,p=(g+y*a.width)*4;o[p]=h.r,o[p+1]=h.g,o[p+2]=h.b,o[p+3]=255}this.ctx.putImageData(a)}}});case"line":default:return this.app.captureMove({start:c=>{this.ctx.beginPath(),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 vu{localVideoUtil;remoteVideoUtil;localPeerConnection=null;remotePeerConnection=null;constructor(t,e){this.localVideoUtil=new Re(t),this.remoteVideoUtil=new Re(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(s=>{this.localVideoUtil.setSrcObject(s),t(s)}).catch(s=>{this.trace(`navigator.getUserMedia error: ${s}.`),e(s)})})}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(),s=t.getAudioTracks();e.length>0&&this.trace(`Using video device: ${e[0].label}.`),s.length>0&&this.trace(`Using audio device: ${s[0].label}.`);const n=void 0,r=new RTCPeerConnection(n);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(n);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(s[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,s=t.candidate;if(e&&s){const n=new RTCIceCandidate(s),r=this.getOtherPeer(e);r&&(r.addIceCandidate(n).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 lr(n,t){return function(){return n.apply(t,arguments)}}const{toString:Dh}=Object.prototype,{getPrototypeOf:vi}=Object,xs=(n=>t=>{const e=Dh.call(t);return n[e]||(n[e]=e.slice(8,-1).toLowerCase())})(Object.create(null)),kt=n=>(n=n.toLowerCase(),t=>xs(t)===n),bs=n=>t=>typeof t===n,{isArray:ge}=Array,Oe=bs("undefined");function Ah(n){return n!==null&&!Oe(n)&&n.constructor!==null&&!Oe(n.constructor)&&vt(n.constructor.isBuffer)&&n.constructor.isBuffer(n)}const ur=kt("ArrayBuffer");function Ih(n){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(n):t=n&&n.buffer&&ur(n.buffer),t}const kh=bs("string"),vt=bs("function"),dr=bs("number"),vs=n=>n!==null&&typeof n=="object",Mh=n=>n===!0||n===!1,Ss=n=>{if(xs(n)!=="object")return!1;const t=vi(n);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in n)&&!(Symbol.iterator in n)},Lh=kt("Date"),Rh=kt("File"),Oh=kt("Blob"),Nh=kt("FileList"),Fh=n=>vs(n)&&vt(n.pipe),Yh=n=>{let t;return n&&(typeof FormData=="function"&&n instanceof FormData||vt(n.append)&&((t=xs(n))==="formdata"||t==="object"&&vt(n.toString)&&n.toString()==="[object FormData]"))},Bh=kt("URLSearchParams"),Xh=n=>n.trim?n.trim():n.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Ne(n,t,{allOwnKeys:e=!1}={}){if(n===null||typeof n>"u")return;let s,i;if(typeof n!="object"&&(n=[n]),ge(n))for(s=0,i=n.length;s<i;s++)t.call(null,n[s],s,n);else{const r=e?Object.getOwnPropertyNames(n):Object.keys(n),a=r.length;let o;for(s=0;s<a;s++)o=r[s],t.call(null,n[o],o,n)}}function fr(n,t){t=t.toLowerCase();const e=Object.keys(n);let s=e.length,i;for(;s-- >0;)if(i=e[s],t===i.toLowerCase())return i;return null}const mr=(()=>typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global)(),pr=n=>!Oe(n)&&n!==mr;function Si(){const{caseless:n}=pr(this)&&this||{},t={},e=(s,i)=>{const r=n&&fr(t,i)||i;Ss(t[r])&&Ss(s)?t[r]=Si(t[r],s):Ss(s)?t[r]=Si({},s):ge(s)?t[r]=s.slice():t[r]=s};for(let s=0,i=arguments.length;s<i;s++)arguments[s]&&Ne(arguments[s],e);return t}const Gh=(n,t,e,{allOwnKeys:s}={})=>(Ne(t,(i,r)=>{e&&vt(i)?n[r]=lr(i,e):n[r]=i},{allOwnKeys:s}),n),Uh=n=>(n.charCodeAt(0)===65279&&(n=n.slice(1)),n),Vh=(n,t,e,s)=>{n.prototype=Object.create(t.prototype,s),n.prototype.constructor=n,Object.defineProperty(n,"super",{value:t.prototype}),e&&Object.assign(n.prototype,e)},zh=(n,t,e,s)=>{let i,r,a;const o={};if(t=t||{},n==null)return t;do{for(i=Object.getOwnPropertyNames(n),r=i.length;r-- >0;)a=i[r],(!s||s(a,n,t))&&!o[a]&&(t[a]=n[a],o[a]=!0);n=e!==!1&&vi(n)}while(n&&(!e||e(n,t))&&n!==Object.prototype);return t},qh=(n,t,e)=>{n=String(n),(e===void 0||e>n.length)&&(e=n.length),e-=t.length;const s=n.indexOf(t,e);return s!==-1&&s===e},Hh=n=>{if(!n)return null;if(ge(n))return n;let t=n.length;if(!dr(t))return null;const e=new Array(t);for(;t-- >0;)e[t]=n[t];return e},jh=(n=>t=>n&&t instanceof n)(typeof Uint8Array<"u"&&vi(Uint8Array)),Wh=(n,t)=>{const s=(n&&n[Symbol.iterator]).call(n);let i;for(;(i=s.next())&&!i.done;){const r=i.value;t.call(n,r[0],r[1])}},$h=(n,t)=>{let e;const s=[];for(;(e=n.exec(t))!==null;)s.push(e);return s},Jh=kt("HTMLFormElement"),Zh=n=>n.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,s,i){return s.toUpperCase()+i}),gr=(({hasOwnProperty:n})=>(t,e)=>n.call(t,e))(Object.prototype),Kh=kt("RegExp"),yr=(n,t)=>{const e=Object.getOwnPropertyDescriptors(n),s={};Ne(e,(i,r)=>{let a;(a=t(i,r,n))!==!1&&(s[r]=a||i)}),Object.defineProperties(n,s)},Qh=n=>{yr(n,(t,e)=>{if(vt(n)&&["arguments","caller","callee"].indexOf(e)!==-1)return!1;const s=n[e];if(vt(s)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+e+"'")})}})},tc=(n,t)=>{const e={},s=i=>{i.forEach(r=>{e[r]=!0})};return ge(n)?s(n):s(String(n).split(t)),e},ec=()=>{},sc=(n,t)=>(n=+n,Number.isFinite(n)?n:t),Ci="abcdefghijklmnopqrstuvwxyz",wr="0123456789",xr={DIGIT:wr,ALPHA:Ci,ALPHA_DIGIT:Ci+Ci.toUpperCase()+wr},ic=(n=16,t=xr.ALPHA_DIGIT)=>{let e="";const{length:s}=t;for(;n--;)e+=t[Math.random()*s|0];return e};function nc(n){return!!(n&&vt(n.append)&&n[Symbol.toStringTag]==="FormData"&&n[Symbol.iterator])}const rc=n=>{const t=new Array(10),e=(s,i)=>{if(vs(s)){if(t.indexOf(s)>=0)return;if(!("toJSON"in s)){t[i]=s;const r=ge(s)?[]:{};return Ne(s,(a,o)=>{const h=e(a,i+1);!Oe(h)&&(r[o]=h)}),t[i]=void 0,r}}return s};return e(n,0)},ac=kt("AsyncFunction"),E={isArray:ge,isArrayBuffer:ur,isBuffer:Ah,isFormData:Yh,isArrayBufferView:Ih,isString:kh,isNumber:dr,isBoolean:Mh,isObject:vs,isPlainObject:Ss,isUndefined:Oe,isDate:Lh,isFile:Rh,isBlob:Oh,isRegExp:Kh,isFunction:vt,isStream:Fh,isURLSearchParams:Bh,isTypedArray:jh,isFileList:Nh,forEach:Ne,merge:Si,extend:Gh,trim:Xh,stripBOM:Uh,inherits:Vh,toFlatObject:zh,kindOf:xs,kindOfTest:kt,endsWith:qh,toArray:Hh,forEachEntry:Wh,matchAll:$h,isHTMLForm:Jh,hasOwnProperty:gr,hasOwnProp:gr,reduceDescriptors:yr,freezeMethods:Qh,toObjectSet:tc,toCamelCase:Zh,noop:ec,toFiniteNumber:sc,findKey:fr,global:mr,isContextDefined:pr,ALPHABET:xr,generateString:ic,isSpecCompliantForm:nc,toJSONObject:rc,isAsyncFn:ac,isThenable:n=>n&&(vs(n)||vt(n))&&vt(n.then)&&vt(n.catch)};function B(n,t,e,s,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=n,this.name="AxiosError",t&&(this.code=t),e&&(this.config=e),s&&(this.request=s),i&&(this.response=i)}E.inherits(B,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 br=B.prototype,vr={};["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(n=>{vr[n]={value:n}}),Object.defineProperties(B,vr),Object.defineProperty(br,"isAxiosError",{value:!0}),B.from=(n,t,e,s,i,r)=>{const a=Object.create(br);return E.toFlatObject(n,a,function(h){return h!==Error.prototype},o=>o!=="isAxiosError"),B.call(a,n.message,t,e,s,i),a.cause=n,a.name=n.name,r&&Object.assign(a,r),a};const oc=null;function Ei(n){return E.isPlainObject(n)||E.isArray(n)}function Sr(n){return E.endsWith(n,"[]")?n.slice(0,-2):n}function Cr(n,t,e){return n?n.concat(t).map(function(i,r){return i=Sr(i),!e&&r?"["+i+"]":i}).join(e?".":""):t}function hc(n){return E.isArray(n)&&!n.some(Ei)}const cc=E.toFlatObject(E,{},null,function(t){return/^is[A-Z]/.test(t)});function Cs(n,t,e){if(!E.isObject(n))throw new TypeError("target must be an object");t=t||new FormData,e=E.toFlatObject(e,{metaTokens:!0,dots:!1,indexes:!1},!1,function(x,b){return!E.isUndefined(b[x])});const s=e.metaTokens,i=e.visitor||l,r=e.dots,a=e.indexes,h=(e.Blob||typeof Blob<"u"&&Blob)&&E.isSpecCompliantForm(t);if(!E.isFunction(i))throw new TypeError("visitor must be a function");function c(m){if(m===null)return"";if(E.isDate(m))return m.toISOString();if(!h&&E.isBlob(m))throw new B("Blob is not supported. Use a Buffer instead.");return E.isArrayBuffer(m)||E.isTypedArray(m)?h&&typeof Blob=="function"?new Blob([m]):Buffer.from(m):m}function l(m,x,b){let S=m;if(m&&!b&&typeof m=="object"){if(E.endsWith(x,"{}"))x=s?x:x.slice(0,-2),m=JSON.stringify(m);else if(E.isArray(m)&&hc(m)||(E.isFileList(m)||E.endsWith(x,"[]"))&&(S=E.toArray(m)))return x=Sr(x),S.forEach(function(L,R){!(E.isUndefined(L)||L===null)&&t.append(a===!0?Cr([x],R,r):a===null?x:x+"[]",c(L))}),!1}return Ei(m)?!0:(t.append(Cr(b,x,r),c(m)),!1)}const d=[],g=Object.assign(cc,{defaultVisitor:l,convertValue:c,isVisitable:Ei});function y(m,x){if(!E.isUndefined(m)){if(d.indexOf(m)!==-1)throw Error("Circular reference detected in "+x.join("."));d.push(m),E.forEach(m,function(S,C){(!(E.isUndefined(S)||S===null)&&i.call(t,S,E.isString(C)?C.trim():C,x,g))===!0&&y(S,x?x.concat(C):[C])}),d.pop()}}if(!E.isObject(n))throw new TypeError("data must be an object");return y(n),t}function Er(n){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(n).replace(/[!'()~]|%20|%00/g,function(s){return t[s]})}function Pi(n,t){this._pairs=[],n&&Cs(n,this,t)}const Pr=Pi.prototype;Pr.append=function(t,e){this._pairs.push([t,e])},Pr.toString=function(t){const e=t?function(s){return t.call(this,s,Er)}:Er;return this._pairs.map(function(i){return e(i[0])+"="+e(i[1])},"").join("&")};function lc(n){return encodeURIComponent(n).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Tr(n,t,e){if(!t)return n;const s=e&&e.encode||lc,i=e&&e.serialize;let r;if(i?r=i(t,e):r=E.isURLSearchParams(t)?t.toString():new Pi(t,e).toString(s),r){const a=n.indexOf("#");a!==-1&&(n=n.slice(0,a)),n+=(n.indexOf("?")===-1?"?":"&")+r}return n}class uc{constructor(){this.handlers=[]}use(t,e,s){return this.handlers.push({fulfilled:t,rejected:e,synchronous:s?s.synchronous:!1,runWhen:s?s.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(s){s!==null&&t(s)})}}const _r=uc,Dr={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},dc=typeof URLSearchParams<"u"?URLSearchParams:Pi,fc=typeof FormData<"u"?FormData:null,mc=typeof Blob<"u"?Blob:null,pc=(()=>{let n;return typeof navigator<"u"&&((n=navigator.product)==="ReactNative"||n==="NativeScript"||n==="NS")?!1:typeof window<"u"&&typeof document<"u"})(),gc=(()=>typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function")(),Mt={isBrowser:!0,classes:{URLSearchParams:dc,FormData:fc,Blob:mc},isStandardBrowserEnv:pc,isStandardBrowserWebWorkerEnv:gc,protocols:["http","https","file","blob","url","data"]};function yc(n,t){return Cs(n,new Mt.classes.URLSearchParams,Object.assign({visitor:function(e,s,i,r){return Mt.isNode&&E.isBuffer(e)?(this.append(s,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)}},t))}function wc(n){return E.matchAll(/\w+|\[(\w*)]/g,n).map(t=>t[0]==="[]"?"":t[1]||t[0])}function xc(n){const t={},e=Object.keys(n);let s;const i=e.length;let r;for(s=0;s<i;s++)r=e[s],t[r]=n[r];return t}function Ar(n){function t(e,s,i,r){let a=e[r++];const o=Number.isFinite(+a),h=r>=e.length;return a=!a&&E.isArray(i)?i.length:a,h?(E.hasOwnProp(i,a)?i[a]=[i[a],s]:i[a]=s,!o):((!i[a]||!E.isObject(i[a]))&&(i[a]=[]),t(e,s,i[a],r)&&E.isArray(i[a])&&(i[a]=xc(i[a])),!o)}if(E.isFormData(n)&&E.isFunction(n.entries)){const e={};return E.forEachEntry(n,(s,i)=>{t(wc(s),i,e,0)}),e}return null}function bc(n,t,e){if(E.isString(n))try{return(t||JSON.parse)(n),E.trim(n)}catch(s){if(s.name!=="SyntaxError")throw s}return(e||JSON.stringify)(n)}const Ti={transitional:Dr,adapter:["xhr","http"],transformRequest:[function(t,e){const s=e.getContentType()||"",i=s.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(Ar(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(s.indexOf("application/x-www-form-urlencoded")>-1)return yc(t,this.formSerializer).toString();if((o=E.isFileList(t))||s.indexOf("multipart/form-data")>-1){const h=this.env&&this.env.FormData;return Cs(o?{"files[]":t}:t,h&&new h,this.formSerializer)}}return r||i?(e.setContentType("application/json",!1),bc(t)):t}],transformResponse:[function(t){const e=this.transitional||Ti.transitional,s=e&&e.forcedJSONParsing,i=this.responseType==="json";if(t&&E.isString(t)&&(s&&!this.responseType||i)){const a=!(e&&e.silentJSONParsing)&&i;try{return JSON.parse(t)}catch(o){if(a)throw o.name==="SyntaxError"?B.from(o,B.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:Mt.classes.FormData,Blob:Mt.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"],n=>{Ti.headers[n]={}});const _i=Ti,vc=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"]),Sc=n=>{const t={};let e,s,i;return n&&n.split(`
37
+ `).forEach(function(a){i=a.indexOf(":"),e=a.substring(0,i).trim().toLowerCase(),s=a.substring(i+1).trim(),!(!e||t[e]&&vc[e])&&(e==="set-cookie"?t[e]?t[e].push(s):t[e]=[s]:t[e]=t[e]?t[e]+", "+s:s)}),t},Ir=Symbol("internals");function Fe(n){return n&&String(n).trim().toLowerCase()}function Es(n){return n===!1||n==null?n:E.isArray(n)?n.map(Es):String(n)}function Cc(n){const t=Object.create(null),e=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let s;for(;s=e.exec(n);)t[s[1]]=s[2];return t}const Ec=n=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(n.trim());function Di(n,t,e,s,i){if(E.isFunction(s))return s.call(this,t,e);if(i&&(t=e),!!E.isString(t)){if(E.isString(s))return t.indexOf(s)!==-1;if(E.isRegExp(s))return s.test(t)}}function Pc(n){return n.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,e,s)=>e.toUpperCase()+s)}function Tc(n,t){const e=E.toCamelCase(" "+t);["get","set","has"].forEach(s=>{Object.defineProperty(n,s+e,{value:function(i,r,a){return this[s].call(this,t,i,r,a)},configurable:!0})})}class Ps{constructor(t){t&&this.set(t)}set(t,e,s){const i=this;function r(o,h,c){const l=Fe(h);if(!l)throw new Error("header name must be a non-empty string");const d=E.findKey(i,l);(!d||i[d]===void 0||c===!0||c===void 0&&i[d]!==!1)&&(i[d||h]=Es(o))}const a=(o,h)=>E.forEach(o,(c,l)=>r(c,l,h));return E.isPlainObject(t)||t instanceof this.constructor?a(t,e):E.isString(t)&&(t=t.trim())&&!Ec(t)?a(Sc(t),e):t!=null&&r(e,t,s),this}get(t,e){if(t=Fe(t),t){const s=E.findKey(this,t);if(s){const i=this[s];if(!e)return i;if(e===!0)return Cc(i);if(E.isFunction(e))return e.call(this,i,s);if(E.isRegExp(e))return e.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,e){if(t=Fe(t),t){const s=E.findKey(this,t);return!!(s&&this[s]!==void 0&&(!e||Di(this,this[s],s,e)))}return!1}delete(t,e){const s=this;let i=!1;function r(a){if(a=Fe(a),a){const o=E.findKey(s,a);o&&(!e||Di(s,s[o],o,e))&&(delete s[o],i=!0)}}return E.isArray(t)?t.forEach(r):r(t),i}clear(t){const e=Object.keys(this);let s=e.length,i=!1;for(;s--;){const r=e[s];(!t||Di(this,this[r],r,t,!0))&&(delete this[r],i=!0)}return i}normalize(t){const e=this,s={};return E.forEach(this,(i,r)=>{const a=E.findKey(s,r);if(a){e[a]=Es(i),delete e[r];return}const o=t?Pc(r):String(r).trim();o!==r&&delete e[r],e[o]=Es(i),s[o]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const e=Object.create(null);return E.forEach(this,(s,i)=>{s!=null&&s!==!1&&(e[i]=t&&E.isArray(s)?s.join(", "):s)}),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 s=new this(t);return e.forEach(i=>s.set(i)),s}static accessor(t){const s=(this[Ir]=this[Ir]={accessors:{}}).accessors,i=this.prototype;function r(a){const o=Fe(a);s[o]||(Tc(i,a),s[o]=!0)}return E.isArray(t)?t.forEach(r):r(t),this}}Ps.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),E.reduceDescriptors(Ps.prototype,({value:n},t)=>{let e=t[0].toUpperCase()+t.slice(1);return{get:()=>n,set(s){this[e]=s}}}),E.freezeMethods(Ps);const Gt=Ps;function Ai(n,t){const e=this||_i,s=t||e,i=Gt.from(s.headers);let r=s.data;return E.forEach(n,function(o){r=o.call(e,r,i.normalize(),t?t.status:void 0)}),i.normalize(),r}function kr(n){return!!(n&&n.__CANCEL__)}function Ye(n,t,e){B.call(this,n??"canceled",B.ERR_CANCELED,t,e),this.name="CanceledError"}E.inherits(Ye,B,{__CANCEL__:!0});function _c(n,t,e){const s=e.config.validateStatus;!e.status||!s||s(e.status)?n(e):t(new B("Request failed with status code "+e.status,[B.ERR_BAD_REQUEST,B.ERR_BAD_RESPONSE][Math.floor(e.status/100)-4],e.config,e.request,e))}const Dc=Mt.isStandardBrowserEnv?function(){return{write:function(e,s,i,r,a,o){const h=[];h.push(e+"="+encodeURIComponent(s)),E.isNumber(i)&&h.push("expires="+new Date(i).toGMTString()),E.isString(r)&&h.push("path="+r),E.isString(a)&&h.push("domain="+a),o===!0&&h.push("secure"),document.cookie=h.join("; ")},read:function(e){const s=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return s?decodeURIComponent(s[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}();function Ac(n){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(n)}function Ic(n,t){return t?n.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):n}function Mr(n,t){return n&&!Ac(t)?Ic(n,t):t}const kc=Mt.isStandardBrowserEnv?function(){const t=/(msie|trident)/i.test(navigator.userAgent),e=document.createElement("a");let s;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 s=i(window.location.href),function(a){const o=E.isString(a)?i(a):a;return o.protocol===s.protocol&&o.host===s.host}}():function(){return function(){return!0}}();function Mc(n){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(n);return t&&t[1]||""}function Lc(n,t){n=n||10;const e=new Array(n),s=new Array(n);let i=0,r=0,a;return t=t!==void 0?t:1e3,function(h){const c=Date.now(),l=s[r];a||(a=c),e[i]=h,s[i]=c;let d=r,g=0;for(;d!==i;)g+=e[d++],d=d%n;if(i=(i+1)%n,i===r&&(r=(r+1)%n),c-a<t)return;const y=l&&c-l;return y?Math.round(g*1e3/y):void 0}}function Lr(n,t){let e=0;const s=Lc(50,250);return i=>{const r=i.loaded,a=i.lengthComputable?i.total:void 0,o=r-e,h=s(o),c=r<=a;e=r;const l={loaded:r,total:a,progress:a?r/a:void 0,bytes:o,rate:h||void 0,estimated:h&&a&&c?(a-r)/h:void 0,event:i};l[t?"download":"upload"]=!0,n(l)}}const Ii={http:oc,xhr:typeof XMLHttpRequest<"u"&&function(n){return new Promise(function(e,s){let i=n.data;const r=Gt.from(n.headers).normalize(),a=n.responseType;let o;function h(){n.cancelToken&&n.cancelToken.unsubscribe(o),n.signal&&n.signal.removeEventListener("abort",o)}let c;E.isFormData(i)&&(Mt.isStandardBrowserEnv||Mt.isStandardBrowserWebWorkerEnv?r.setContentType(!1):r.getContentType(/^\s*multipart\/form-data/)?E.isString(c=r.getContentType())&&r.setContentType(c.replace(/^\s*(multipart\/form-data);+/,"$1")):r.setContentType("multipart/form-data"));let l=new XMLHttpRequest;if(n.auth){const m=n.auth.username||"",x=n.auth.password?unescape(encodeURIComponent(n.auth.password)):"";r.set("Authorization","Basic "+btoa(m+":"+x))}const d=Mr(n.baseURL,n.url);l.open(n.method.toUpperCase(),Tr(d,n.params,n.paramsSerializer),!0),l.timeout=n.timeout;function g(){if(!l)return;const m=Gt.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:n,request:l};_c(function(C){e(C),h()},function(C){s(C),h()},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&&(s(new B("Request aborted",B.ECONNABORTED,n,l)),l=null)},l.onerror=function(){s(new B("Network Error",B.ERR_NETWORK,n,l)),l=null},l.ontimeout=function(){let x=n.timeout?"timeout of "+n.timeout+"ms exceeded":"timeout exceeded";const b=n.transitional||Dr;n.timeoutErrorMessage&&(x=n.timeoutErrorMessage),s(new B(x,b.clarifyTimeoutError?B.ETIMEDOUT:B.ECONNABORTED,n,l)),l=null},Mt.isStandardBrowserEnv){const m=(n.withCredentials||kc(d))&&n.xsrfCookieName&&Dc.read(n.xsrfCookieName);m&&r.set(n.xsrfHeaderName,m)}i===void 0&&r.setContentType(null),"setRequestHeader"in l&&E.forEach(r.toJSON(),function(x,b){l.setRequestHeader(b,x)}),E.isUndefined(n.withCredentials)||(l.withCredentials=!!n.withCredentials),a&&a!=="json"&&(l.responseType=n.responseType),typeof n.onDownloadProgress=="function"&&l.addEventListener("progress",Lr(n.onDownloadProgress,!0)),typeof n.onUploadProgress=="function"&&l.upload&&l.upload.addEventListener("progress",Lr(n.onUploadProgress)),(n.cancelToken||n.signal)&&(o=m=>{l&&(s(!m||m.type?new Ye(null,n,l):m),l.abort(),l=null)},n.cancelToken&&n.cancelToken.subscribe(o),n.signal&&(n.signal.aborted?o():n.signal.addEventListener("abort",o)));const y=Mc(d);if(y&&Mt.protocols.indexOf(y)===-1){s(new B("Unsupported protocol "+y+":",B.ERR_BAD_REQUEST,n));return}l.send(i||null)})}};E.forEach(Ii,(n,t)=>{if(n){try{Object.defineProperty(n,"name",{value:t})}catch{}Object.defineProperty(n,"adapterName",{value:t})}});const Rr=n=>`- ${n}`,Rc=n=>E.isFunction(n)||n===null||n===!1,Or={getAdapter:n=>{n=E.isArray(n)?n:[n];const{length:t}=n;let e,s;const i={};for(let r=0;r<t;r++){e=n[r];let a;if(s=e,!Rc(e)&&(s=Ii[(a=String(e)).toLowerCase()],s===void 0))throw new B(`Unknown adapter '${a}'`);if(s)break;i[a||"#"+r]=s}if(!s){const r=Object.entries(i).map(([o,h])=>`adapter ${o} `+(h===!1?"is not supported by the environment":"is not available in the build"));let a=t?r.length>1?`since :
39
+ `+r.map(Rr).join(`
40
+ `):" "+Rr(r[0]):"as no adapter specified";throw new B("There is no suitable adapter to dispatch the request "+a,"ERR_NOT_SUPPORT")}return s},adapters:Ii};function ki(n){if(n.cancelToken&&n.cancelToken.throwIfRequested(),n.signal&&n.signal.aborted)throw new Ye(null,n)}function Nr(n){return ki(n),n.headers=Gt.from(n.headers),n.data=Ai.call(n,n.transformRequest),["post","put","patch"].indexOf(n.method)!==-1&&n.headers.setContentType("application/x-www-form-urlencoded",!1),Or.getAdapter(n.adapter||_i.adapter)(n).then(function(s){return ki(n),s.data=Ai.call(n,n.transformResponse,s),s.headers=Gt.from(s.headers),s},function(s){return kr(s)||(ki(n),s&&s.response&&(s.response.data=Ai.call(n,n.transformResponse,s.response),s.response.headers=Gt.from(s.response.headers))),Promise.reject(s)})}const Fr=n=>n instanceof Gt?n.toJSON():n;function ye(n,t){t=t||{};const e={};function s(c,l,d){return E.isPlainObject(c)&&E.isPlainObject(l)?E.merge.call({caseless:d},c,l):E.isPlainObject(l)?E.merge({},l):E.isArray(l)?l.slice():l}function i(c,l,d){if(E.isUndefined(l)){if(!E.isUndefined(c))return s(void 0,c,d)}else return s(c,l,d)}function r(c,l){if(!E.isUndefined(l))return s(void 0,l)}function a(c,l){if(E.isUndefined(l)){if(!E.isUndefined(c))return s(void 0,c)}else return s(void 0,l)}function o(c,l,d){if(d in t)return s(c,l);if(d in n)return s(void 0,c)}const h={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:(c,l)=>i(Fr(c),Fr(l),!0)};return E.forEach(Object.keys(Object.assign({},n,t)),function(l){const d=h[l]||i,g=d(n[l],t[l],l);E.isUndefined(g)&&d!==o||(e[l]=g)}),e}const Yr="1.5.1",Mi={};["object","boolean","number","function","string","symbol"].forEach((n,t)=>{Mi[n]=function(s){return typeof s===n||"a"+(t<1?"n ":" ")+n}});const Br={};Mi.transitional=function(t,e,s){function i(r,a){return"[Axios v"+Yr+"] Transitional option '"+r+"'"+a+(s?". "+s:"")}return(r,a,o)=>{if(t===!1)throw new B(i(a," has been removed"+(e?" in "+e:"")),B.ERR_DEPRECATED);return e&&!Br[a]&&(Br[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 Oc(n,t,e){if(typeof n!="object")throw new B("options must be an object",B.ERR_BAD_OPTION_VALUE);const s=Object.keys(n);let i=s.length;for(;i-- >0;){const r=s[i],a=t[r];if(a){const o=n[r],h=o===void 0||a(o,r,n);if(h!==!0)throw new B("option "+r+" must be "+h,B.ERR_BAD_OPTION_VALUE);continue}if(e!==!0)throw new B("Unknown option "+r,B.ERR_BAD_OPTION)}}const Li={assertOptions:Oc,validators:Mi},te=Li.validators;class Ts{constructor(t){this.defaults=t,this.interceptors={request:new _r,response:new _r}}request(t,e){typeof t=="string"?(e=e||{},e.url=t):e=t||{},e=ye(this.defaults,e);const{transitional:s,paramsSerializer:i,headers:r}=e;s!==void 0&&Li.assertOptions(s,{silentJSONParsing:te.transitional(te.boolean),forcedJSONParsing:te.transitional(te.boolean),clarifyTimeoutError:te.transitional(te.boolean)},!1),i!=null&&(E.isFunction(i)?e.paramsSerializer={serialize:i}:Li.assertOptions(i,{encode:te.function,serialize:te.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=Gt.concat(a,r);const o=[];let h=!0;this.interceptors.request.forEach(function(x){typeof x.runWhen=="function"&&x.runWhen(e)===!1||(h=h&&x.synchronous,o.unshift(x.fulfilled,x.rejected))});const c=[];this.interceptors.response.forEach(function(x){c.push(x.fulfilled,x.rejected)});let l,d=0,g;if(!h){const m=[Nr.bind(this),void 0];for(m.unshift.apply(m,o),m.push.apply(m,c),g=m.length,l=Promise.resolve(e);d<g;)l=l.then(m[d++],m[d++]);return l}g=o.length;let y=e;for(d=0;d<g;){const m=o[d++],x=o[d++];try{y=m(y)}catch(b){x.call(this,b);break}}try{l=Nr.call(this,y)}catch(m){return Promise.reject(m)}for(d=0,g=c.length;d<g;)l=l.then(c[d++],c[d++]);return l}getUri(t){t=ye(this.defaults,t);const e=Mr(t.baseURL,t.url);return Tr(e,t.params,t.paramsSerializer)}}E.forEach(["delete","get","head","options"],function(t){Ts.prototype[t]=function(e,s){return this.request(ye(s||{},{method:t,url:e,data:(s||{}).data}))}}),E.forEach(["post","put","patch"],function(t){function e(s){return function(r,a,o){return this.request(ye(o||{},{method:t,headers:s?{"Content-Type":"multipart/form-data"}:{},url:r,data:a}))}}Ts.prototype[t]=e(),Ts.prototype[t+"Form"]=e(!0)});const _s=Ts;class Ri{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 s=this;this.promise.then(i=>{if(!s._listeners)return;let r=s._listeners.length;for(;r-- >0;)s._listeners[r](i);s._listeners=null}),this.promise.then=i=>{let r;const a=new Promise(o=>{s.subscribe(o),r=o}).then(i);return a.cancel=function(){s.unsubscribe(r)},a},t(function(r,a,o){s.reason||(s.reason=new Ye(r,a,o),e(s.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 Ri(function(i){t=i}),cancel:t}}}const Nc=Ri;function Fc(n){return function(e){return n.apply(null,e)}}function Yc(n){return E.isObject(n)&&n.isAxiosError===!0}const Oi={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(Oi).forEach(([n,t])=>{Oi[t]=n});const Bc=Oi;function Xr(n){const t=new _s(n),e=lr(_s.prototype.request,t);return E.extend(e,_s.prototype,t,{allOwnKeys:!0}),E.extend(e,t,null,{allOwnKeys:!0}),e.create=function(i){return Xr(ye(n,i))},e}const W=Xr(_i);W.Axios=_s,W.CanceledError=Ye,W.CancelToken=Nc,W.isCancel=kr,W.VERSION=Yr,W.toFormData=Cs,W.AxiosError=B,W.Cancel=W.CanceledError,W.all=function(t){return Promise.all(t)},W.spread=Fc,W.isAxiosError=Yc,W.mergeConfig=ye,W.AxiosHeaders=Gt,W.formToJSON=n=>Ar(E.isHTMLForm(n)?new FormData(n):n),W.getAdapter=Or.getAdapter,W.HttpStatusCode=Bc,W.default=W;const Xc=W,Gr=window.crypto.subtle;Gr||console.warn("Crypto API not supported");async function Ur(n,t=qs.sha256){const e=await Gr.digest(t,ka(n));return Ma(e)}async function Vr(n,t=qs.sha256){const e=JSON.stringify(Ba(n));return Ur(e,t)}class Gc{instance;interceptors;requestCanceler;constructor(t){this.instance=Xc.create(t),this.interceptors=t?.interceptors,this.requestCanceler=new zr,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((s,i)=>{this.requestCanceler.confirmRequest(e.config),e.status===200?s(e.data):i(e.data)}),async e=>{const{code:s="",config:i}=e;return!i||!i.retry||!i.retryStatus?.includes(s)||(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,s)=>{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)),s(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,s){return this.request({...s,method:"post",url:t,data:e})}put(t,e,s){return this.request({...s,method:"put",url:t,data:e})}patch(t,e,s){return this.request({...s,method:"patch",url:t,data:e})}getUri(t){return this.instance.getUri(t)}}class zr{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 s=new AbortController;t.signal=s.signal,this.pendingRequestMap.set(e,s)}}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:s,params:i,data:r}=t;return await Vr({url:e,method:s,params:i,data:r})}}function Uc(n,t,e,s,i){const r=t/e;let a=0,o=0;switch(n){case"aspectFit":r>=1?(a=s,o=a/r,o>i&&(o=i,a=o*r)):(o=i,a=o*r,a>s&&(a=s,o=a/r));break;case"aspectFill":r>=1?(o=i,a=o*r):(a=s,o=a/r);break;case"widthFix":a=s,o=a/r;break;case"heightFix":o=i,a=o*r;break;case"scaleToFill":default:a=s,o=i;break}return{width:a,height:o}}const Ds=new Map;async function Vc(n){return new Promise((t,e)=>{As(n,(s,i)=>s?e(s):t({width:i.width,height:i.height,aspectRatio:i.width/i.height}))})}const As=(n,t)=>{if(Ds.has(n))return t(null,Ds.get(n));const e=new Image;e.onload=function(){Ds.set(n,{width:e.naturalWidth||e.width,height:e.naturalHeight||e.height,element:e}),t(null,Ds.get(n))},e.onerror=function(s){t(s,null)},e.src=n},zc=(n,t)=>{for(let e=0,s=n.length;e<s;e++){const i=n[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 h=o.target.result,c=ln(h),l=new Blob([h]);Ni(l,(d,g)=>{if(!g)return t(d,null);As(g,(y,m)=>{if(!m)return t(y,null);qr(g,(x,b)=>{if(!b)return t(x,null);const S={name:i.name,fileType:c,size:i.size,width:m.width,height:m.height,imgUrl:g,imageData:b,blob:l};return t(null,S)})})})},a.readAsArrayBuffer(i)}},qr=(n,t)=>{As(n,(e,s)=>{if(!s)return t(e,null);const i=document.createElement("canvas"),r=i.getContext("2d");i.width=s.width,i.height=s.height,r.drawImage(s.element,0,0,i.width,i.height);const a=r.getImageData(0,0,i.width,i.height);return t(null,a)})},qc=(n,t=0,e=0)=>{const s=document.createElement("canvas"),i=s.getContext("2d");return s.width=t,s.height=e,i.drawImage(n,0,0,t,e),i.getImageData(0,0,t,e)},Hc=(n,t=0,e=0)=>{const s=document.createElement("canvas"),i=s.getContext("2d");return s.width=t,s.height=e,i.drawImage(n,0,0,t,e),i.getImageData(0,0,t,e)},jc=n=>{const t=n.width,e=n.height,s=t*e*3,i=s+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,s&255,s>>8&255,s>>16&255,s>>24&255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],o=(4-t*3%4)%4,h=n.data;let c="";const l=t<<2;let d=e;const g=String.fromCharCode;do{const m=l*(d-1);let x="";for(let b=0;b<t;b++){const S=b<<2;x+=g(h[m+S+2])+g(h[m+S+1])+g(h[m+S])}for(let b=0;b<o;b++)x+=String.fromCharCode(0);c+=x}while(--d);function y(m){if(!window.btoa)throw"btoa undefined";let x="";if(typeof m=="string")x=m;else for(let b=0;b<m.length;b++)x+=String.fromCharCode(m[b]);return btoa(x)}return y(r.concat(a))+y(c)},Wc=n=>{const{width:t,height:e}=n,s=document.createElement("canvas"),i=s.getContext("2d");return s.width=t,s.height=e,i.putImageData(n,0,0,0,0,t,e),s.toDataURL("image/png")},$c=(n,t,e)=>{const{width:s,height:i}=n,r=document.createElement("canvas"),a=r.getContext("2d");r.width=s,r.height=i,a.putImageData(n,0,0,0,0,s,i);const o=`image/${t?t.toLowerCase():"png"}`;r.toBlob(h=>{e?.(null,h)},o,1)},Ni=(n,t)=>{const e=new FileReader;e.onload=function(s){s.target?t(null,s.target.result):t("can't readAsDataURL",null)},e.readAsDataURL(n)},Jc=(n,t)=>{Ni(n,function(e,s){if(s){const i=new Image;i.src=s}else t(e)})};function Zc(n){const t=[],e=[],s=[];let i=0;for(let h=0,c=n.data.length;h<c;h+=4)t[i]=n.data[h],e[i]=n.data[h+1],s[i]=n.data[h+2],i+=1;const r=Fi(t),a=Fi(e),o=Fi(s);return"rgb("+r+","+a+","+o+")"}function Fi(n){const t={},e=[],s=[];for(let o=0;o<n.length;o++)t[n[o]]?e.push(n[o]):t[n[o]]=1;let i=0;for(let o=0;o<e.length;o++){i=0;for(let h=0;h<e.length;h++)e[o]===e[h]&&(i+=1),s[o]=i}const r=Math.max.apply(null,s);let a=0;for(;a<s.length;a++)if(s[a]===r)return;return e[a]}const Kc=n=>{const{data:t,width:e,height:s}=n,i=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4;i[h]=t[(a*e+e-o-1)*4],i[h+1]=t[(a*e+e-o-1)*4+1],i[h+2]=t[(a*e+e-o-1)*4+2],i[h+3]=t[(a*e+e-o-1)*4+3]}return new ImageData(i,e,s)},Qc=n=>{const{data:t,width:e,height:s}=n,i=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4;i[h]=t[((s-a-1)*e+o)*4],i[h+1]=t[((s-a-1)*e+o)*4+1],i[h+2]=t[((s-a-1)*e+o)*4+2],i[h+3]=t[((s-a-1)*e+o)*4+3]}return new ImageData(i,e,s)},tl=n=>{const{data:t,width:e,height:s}=n,i=new Uint8ClampedArray(t.length);for(let a=0;a<e;a++)for(let o=0;o<s;o++){const h=(a*s+o)*4;i[h]=t[(o*e+e-a-1)*4],i[h+1]=t[(o*e+e-a-1)*4+1],i[h+2]=t[(o*e+e-a-1)*4+2],i[h+3]=t[(o*e+e-a-1)*4+3]}return new ImageData(i,s,e)},el=n=>{const{data:t,width:e,height:s}=n,i=new Uint8ClampedArray(t.length);for(let a=0;a<e;a++)for(let o=0;o<s;o++){const h=(a*s+o)*4;i[h]=t[((s-o-1)*e+a)*4],i[h+1]=t[((s-o-1)*e+a)*4+1],i[h+2]=t[((s-o-1)*e+a)*4+2],i[h+3]=t[((s-o-1)*e+a)*4+3]}return new ImageData(i,s,e)},sl=n=>{const{data:t,width:e,height:s}=n,i=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4,c=(t[h]+t[h+1]+t[h+2])/3;i[h]=c,i[h+1]=c,i[h+2]=c,i[h+3]=t[h+3]}return new ImageData(i,e,s)},il=n=>{const{data:t,width:e,height:s}=n,i=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4,c=.2126*t[h]+.7152*t[h+1]+.0722*t[h+2];i[h]=c,i[h+1]=c,i[h+2]=c,i[h+3]=t[h+3]}return new ImageData(i,e,s)},nl=n=>{const{data:t,width:e,height:s}=n,i=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4,l=(t[h]+t[h+1]+t[h+2])/3>127?255:0;i[h]=l,i[h+1]=l,i[h+2]=l,i[h+3]=t[h+3]}return new ImageData(i,e,s)},rl=n=>{const{data:t,width:e,height:s}=n,i=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4;i[h]=255-t[h],i[h+1]=255-t[h+1],i[h+2]=255-t[h+2],i[h+3]=t[h+3]}return new ImageData(i,e,s)},al=n=>{const{data:t,width:e,height:s}=n,i=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4;i[h]=t[h],i[h+1]=0,i[h+2]=0,i[h+3]=t[h+3]}return new ImageData(i,e,s)},ol=n=>{const{data:t,width:e,height:s}=n,i=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4;i[h]=0,i[h+1]=t[h+1],i[h+2]=0,i[h+3]=t[h+3]}return new ImageData(i,e,s)},hl=n=>{const{data:t,width:e,height:s}=n,i=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4;i[h]=0,i[h+1]=0,i[h+2]=t[h+2],i[h+3]=t[h+3]}return new ImageData(i,e,s)},cl=n=>{const{data:t,width:e,height:s}=n,i=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4;i[h]=t[h],i[h+1]=t[h+1],i[h+2]=0,i[h+3]=t[h+3]}return new ImageData(i,e,s)},ll=n=>{const{data:t,width:e,height:s}=n,i=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4;i[h]=t[h],i[h+1]=0,i[h+2]=t[h+1],i[h+3]=t[h+3]}return new ImageData(i,e,s)},ul=n=>{const{data:t,width:e,height:s}=n,i=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4;i[h]=0,i[h+1]=t[h+1],i[h+2]=t[h+1],i[h+3]=t[h+3]}return new ImageData(i,e,s)},dl=n=>{const{data:t,width:e,height:s}=n,i=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4,c=(t[h+1]+t[h+2])/2;i[h]=t[h],i[h+1]=c,i[h+2]=c,i[h+3]=t[h+3]}return new ImageData(i,e,s)},fl=n=>{const{data:t,width:e,height:s}=n,i=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4,c=(t[h]+t[h+2])/2;i[h]=c,i[h+1]=t[h+1],i[h+2]=c,i[h+3]=t[h+3]}return new ImageData(i,e,s)},ml=n=>{const{data:t,width:e,height:s}=n,i=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4,c=(t[h]+t[h+1])/2;i[h]=c,i[h+1]=c,i[h+2]=t[h+2],i[h+3]=t[h+3]}return new ImageData(i,e,s)},pl=n=>Hr(n,[-1,-1,-1,-1,9,-1,-1,-1,-1]),gl=n=>Hr(n,[-1,-1,-1,-1,8,-1,-1,-1,-1]),yl=n=>{const{data:t,width:e,height:s}=n,i=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4;i[h]=t[h],i[h+1]=t[h+1],i[h+2]=t[h+2],i[h+3]=255}return new ImageData(i,e,s)},wl=n=>{const{data:t,width:e,height:s}=n,i=new Uint8ClampedArray(t.length);for(let a=0;a<s;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4;if(t[h+3]===0)i[h]=255,i[h+1]=255,i[h+2]=255,i[h+3]=255;else{const c=jr([t[h],t[h+1],t[h+2],t[h+3]],[255,255,255,255]);i[h]=c[0],i[h+1]=c[1],i[h+2]=c[2],i[h+3]=c[3]}}return new ImageData(i,e,s)},xl=(n,t,e,s,i,r=!1,a)=>{const{data:o,width:h,height:c}=n;let l=i,d=s,g=t,y=e;if(l<0?l=0:l>h&&(l=h),d<0?d=0:d>c&&(d=c),g<1?g=1:g>h&&(g=h),y<1?y=1:y>c&&(y=c),l+g>h&&(g=h-l),d+y>c&&(y=c-d),r){const m=new Uint8ClampedArray(o.length);for(let b=0;b<c;b++)for(let S=0;S<h;S++){const C=(b*h+S)*4;S>=l&&S<=l+g&&b>=d&&b<=d+y?(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,h,c)}else{const m=new Uint8ClampedArray(g*y*4);for(let b=d;b<=d+y;b++)for(let S=l;S<=l+g;S++){const C=((b-d)*g+S-l)*4,L=(b*h+S)*4;m[C]=o[L],m[C+1]=o[L+1],m[C+2]=o[L+2],m[C+3]=o[L+3]}return new ImageData(m,g,y)}},bl=(n,t,e,s)=>{const{data:i,width:r,height:a}=n;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 h=new Uint8ClampedArray(i.length);for(let l=0;l<a;l++)for(let d=0;d<r;d++){const g=(l*r+d)*4;let y=-1;d<o?l<o?y=Math.sqrt(Math.pow(o-d-1,2)+Math.pow(o-l-1,2)):l>a-o-1&&(y=Math.sqrt(Math.pow(o-d-1,2)+Math.pow(l-(a-o),2))):d>r-o-1&&(l<o?y=Math.sqrt(Math.pow(d-(r-o),2)+Math.pow(o-l-1,2)):l>a-o-1&&(y=Math.sqrt(Math.pow(d-(r-o),2)+Math.pow(l-(a-o),2)))),Math.round(y)>o?(h[g]=255,h[g+1]=255,h[g+2]=255,h[g+3]=s||e.toUpperCase()==="PNG"?0:255):(h[g]=i[g],h[g+1]=i[g+1],h[g+2]=i[g+2],h[g+3]=s||e.toUpperCase()==="PNG"?i[g+3]:255)}return new ImageData(h,r,a)},vl=(n,t,e,s,i,r=1e4)=>{const a=new Image;a.src=n;const o=document.createElement("canvas"),h=o.getContext("2d");return o.width=r,o.height=r,h.drawImage(a,0,0,t,e,0,0,s,i),h.getImageData(0,0,s,i)},Sl=(n,t)=>{const{data:e,width:s,height:i}=n,r=new Uint8ClampedArray(e.length);for(let o=0;o<i;o++)for(let h=0;h<s;h++){const c=(o*s+h)*4;r[c]=Math.max(Math.min(e[c]+t,255),0),r[c+1]=Math.max(Math.min(e[c+1]+t,255),0),r[c+2]=Math.max(Math.min(e[c+2]+t,255),0),r[c+3]=e[c+3]}return new ImageData(r,s,i)},Cl=(n,t,e=!1)=>{const{data:s,width:i,height:r}=n,a=new Uint8ClampedArray(s.length);for(let h=0;h<r;h++)for(let c=0;c<i;c++){const l=(h*i+c)*4;s[l+3]===0?(a[l]=255,a[l+1]=255,a[l+2]=255):(a[l]=s[l],a[l+1]=s[l+1],a[l+2]=s[l+2]);let d=s[l+3];e?d=Math.max(Math.min(Math.floor(255*t),255),0):d=Math.max(Math.min(Math.floor(d+255*t),255),0),a[l+3]=d}return new ImageData(a,i,r)},El=(n,t,e,s)=>{const{data:i,width:r,height:a}=n,{data:o,width:h,height:c}=t;let l=e,d=s;e+c>a&&(l=a-c),s+h>r&&(d=r-h);const g=new Uint8ClampedArray(i.length);for(let m=0;m<a;m++)for(let x=0;x<r;x++){const b=(m*r+x)*4;if(x<d||x>d+h||m<=l||m>=l+c)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+x-((l+1)*r+(m-(l+1))*(r-h))+h-d-1)*4,C=[o[S],o[S+1],o[S+2],o[S+3]],L=[i[b],i[b+1],i[b+2],i[b+3]],R=jr(C,L);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)},Pl=(n,t,e,s,i,r=10)=>{const{data:a,width:o,height:h}=n;let c=i,l=s,d=t,g=e;c<0?c=0:c>o&&(c=o),l<0?l=0:l>h&&(l=h),d<1?d=1:d>o&&(d=o),g<1?g=1:g>h&&(g=h),c+d>o&&(d=o-c),l+g>h&&(g=h-l);const y=new Uint8ClampedArray(a.length);for(let x=0;x<h;x++)for(let b=0;b<o;b++){const S=(x*o+b)*4;if(b>=c&&b<=c+d&&x>=l&&x<=l+g){const C=Math.floor((b-c)/r),L=Math.floor((x-l)/r);let R=Math.floor(r*(C+1)-r/2+c),X=Math.floor(r*(L+1)-r/2+l);R>o-1&&(R=o-1),X>h-1&&(X=h-1);const Y=(X*o+R)*4;y[S]=a[Y],y[S+1]=a[Y+1],y[S+2]=a[Y+2],y[S+3]=a[Y+3]}else y[S]=a[S],y[S+1]=a[S+1],y[S+2]=a[S+2],y[S+3]=a[S+3]}return new ImageData(y,o,h)},Tl=(n,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:s,width:i,height:r}=n,{data:a}=t,o=new Uint8ClampedArray(s.length),{backgroundColor:h,changeIntoColor:c}=e;for(let d=0;d<r;d++)for(let g=0;g<i;g++){const y=(d*i+g)*4,m=a[y],x=a[y+1],b=a[y+2],S=a[y+3];m===h.r&&x===h.g&&b===h.b&&S===h.a&&c.a!==0?(o[y]=c.r,o[y+1]=c.g,o[y+2]=c.b,o[y+3]=c.a):(o[y]=s[y],o[y+1]=s[y+1],o[y+2]=s[y+2],o[y+3]=s[y+3])}return new ImageData(o,i,r)}return n},Hr=(n,t)=>{const{data:e,width:s,height:i}=n,r=new Uint8ClampedArray(e.length);for(let o=0;o<i;o++)for(let h=0;h<s;h++){const c=(o*s+h)*4;for(let l=0;l<3;l++){const d=c+l;h===0||h===s-1||o===0||o===i-1?r[d]=e[d]:r[d]=t[0]*e[d-s*4-4]+t[1]*e[d-s*4]+t[2]*e[d-s*4+4]+t[3]*e[d-4]+t[4]*e[d]+t[5]*e[d+4]+t[6]*e[d+s*4-4]+t[7]*e[d+s*4]+t[8]*e[d+s*4+4]}r[c+3]=e[c+3]}return new ImageData(r,s,i)},jr=(n,t)=>{if(n&&n.length===4&&t&&t.length===4){const e=n[3],s=t[3];if(e===255||s===0)return n;if(e===0)return t;{const i=e/255,r=s/255,a=Math.max(Math.min(Math.floor(n[0]*i+t[0]*r*(1-i)),255),0),o=Math.max(Math.min(Math.floor(n[1]*i+t[1]*r*(1-i)),255),0),h=Math.max(Math.min(Math.floor(n[2]*i+t[2]*r*(1-i)),255),0),c=Math.max(Math.min(Math.floor((i+r*(1-i))*255),255),0);return[a,o,h,c]}}return[255,255,255,255]},Yi=function(){const n=[];return{writeByte(t){n.push(t&255)},writeShort(t){this.writeByte(t),this.writeByte(t>>>8)},writeBytes(t,e=0,s=t.length){for(let i=0;i<s;i++)this.writeByte(t[i+e])},writeString(t){for(let e=0,s=t.length;e<s;e++)this.writeByte(t.charCodeAt(e))},toByteArray(){return n},toString(){let t="[";for(let e=0,s=n.length;e<s;e++)e>0&&(t+=","),t+=n[e];return t+="]",t}}},Wr=function(){let n=0,t=0,e=0,s="";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){s+=String.fromCharCode(i(a&63))};return{writeByte(a){for(n=n<<8|a&255,t+=8,e+=1;t>=6;)r(n>>>t-6),t-=6},flush(){if(t>0&&(r(n<<6-t),n=0,t=0),e%3!=0){const a=3-e%3;for(let o=0;o<a;o++)s+="="}},toString(){return s}}},$r=function(n,t,e){const s=new Array(n*n),i=function(o){const h=o;let c=0,l=0;return{write(d,g){if(d>>>g)throw new Error("length over");for(;c+g>=8;)h.writeByte(255&(d<<c|l)),g-=8-c,d>>>=8-c,l=0,c=0;l=d<<c|l,c=c+g},flush(){c>0&&h.writeByte(l)}}},r=function(o){const h=1<<o,c=(1<<o)+1;let l=o+1;const d=a();for(let b=0;b<h;b++)d.add(String.fromCharCode(b));d.add(String.fromCharCode(h)),d.add(String.fromCharCode(c));const g=Yi(),y=i(g);y.write(h,l);let m=0,x=String.fromCharCode(s[m]);for(m+=1;m<s.length;){const b=String.fromCharCode(s[m]);m+=1,d.contains(x+b)?x=x+b:(y.write(d.indexOf(x),l),d.size()<4095&&(d.size()==1<<l&&(l+=1),d.add(x+b)),x=b)}return y.write(d.indexOf(x),l),y.write(c,l),y.flush(),g.toByteArray()},a=function(){const o={};let h=0;return{add(c){if(this.contains(c))throw new Error("dup key:"+c);o[c]=h,h+=1},size(){return h},indexOf(c){return o[c]},contains(c){return typeof o[c]<"u"}}};return{setPixel(o,h,c){s[h*n+o]=c},write(o){o.writeString("GIF87a"),o.writeShort(n),o.writeShort(n),o.writeByte(128),o.writeByte(0),o.writeByte(0),o.writeByte(me("0x"+t[1]+t[2])),o.writeByte(me("0x"+t[3]+t[4])),o.writeByte(me("0x"+t[5]+t[6])),o.writeByte(me("0x"+e[1]+e[2])),o.writeByte(me("0x"+e[3]+e[4])),o.writeByte(me("0x"+e[5]+e[6])),o.writeString(","),o.writeShort(0),o.writeShort(0),o.writeShort(n),o.writeShort(n),o.writeByte(0);const h=2,c=r(h);o.writeByte(h);let l=0;for(;c.length-l>255;)o.writeByte(255),o.writeBytes(c,l,255),l+=255;o.writeByte(c.length-l),o.writeBytes(c,l,c.length-l),o.writeByte(0),o.writeString(";")}}},Jr=function(n,t,e,s){const i=$r(n,t,e);for(let c=0;c<n;c++)for(let l=0;l<n;l++)i.setPixel(l,c,s(l,c));const r=Yi();i.write(r);const a=Wr(),o=r.toByteArray();for(let c=0,l=o.length;c<l;c++)a.writeByte(o[c]);a.flush();let h="";return h+="data:image/gif;base64,",h+=a,h},xt={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},Be={M:0,L:1,H:2,Q:3},ee={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},K={glog:function(n){if(n<1)throw new Error("glog("+n+")");return K.LOG_TABLE[n]},gexp:function(n){for(;n<0;)n+=255;for(;n>=256;)n-=255;return K.EXP_TABLE[n]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)};for(let n=0;n<8;n++)K.EXP_TABLE[n]=1<<n;for(let n=8;n<256;n++)K.EXP_TABLE[n]=K.EXP_TABLE[n-4]^K.EXP_TABLE[n-5]^K.EXP_TABLE[n-6]^K.EXP_TABLE[n-8];for(let n=0;n<255;n++)K.LOG_TABLE[K.EXP_TABLE[n]]=n;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(n){let t=n<<10;for(;z.getBCHDigit(t)-z.getBCHDigit(z.G15)>=0;)t^=z.G15<<z.getBCHDigit(t)-z.getBCHDigit(z.G15);return(n<<10|t)^z.G15_MASK},getBCHTypeNumber:function(n){let t=n<<12;for(;z.getBCHDigit(t)-z.getBCHDigit(z.G18)>=0;)t^=z.G18<<z.getBCHDigit(t)-z.getBCHDigit(z.G18);return n<<12|t},getBCHDigit:function(n){let t=0;for(;n!=0;)t++,n>>>=1;return t},getPatternPosition:function(n){return z.PATTERN_POSITION_TABLE[n-1]},getMask:function(n,t,e){switch(n){case ee.PATTERN000:return(t+e)%2==0;case ee.PATTERN001:return t%2==0;case ee.PATTERN010:return e%3==0;case ee.PATTERN011:return(t+e)%3==0;case ee.PATTERN100:return(Math.floor(t/2)+Math.floor(e/3))%2==0;case ee.PATTERN101:return t*e%2+t*e%3==0;case ee.PATTERN110:return(t*e%2+t*e%3)%2==0;case ee.PATTERN111:return(t*e%3+(t+e)%2)%2==0;default:throw new Error("bad maskPattern:"+n)}},getErrorCorrectPolynomial:function(n){let t=new we([1],0);for(let e=0;e<n;e++)t=t.multiply(new we([1,K.gexp(e)],0));return t},getLengthInBits:function(n,t){if(1<=t&&t<10)switch(n){case xt.MODE_NUMBER:return 10;case xt.MODE_ALPHA_NUM:return 9;case xt.MODE_8BIT_BYTE:return 8;case xt.MODE_KANJI:return 8;default:throw new Error("mode:"+n)}else if(t<27)switch(n){case xt.MODE_NUMBER:return 12;case xt.MODE_ALPHA_NUM:return 11;case xt.MODE_8BIT_BYTE:return 16;case xt.MODE_KANJI:return 10;default:throw new Error("mode:"+n)}else if(t<41)switch(n){case xt.MODE_NUMBER:return 14;case xt.MODE_ALPHA_NUM:return 13;case xt.MODE_8BIT_BYTE:return 16;case xt.MODE_KANJI:return 12;default:throw new Error("mode:"+n)}else throw new Error("type:"+t)},getLostPoint:function(n){const t=n.getModuleCount();let e=0;for(let r=0;r<t;r++)for(let a=0;a<t;a++){let o=0;const h=n.isDark(r,a);for(let c=-1;c<=1;c++)if(!(r+c<0||t<=r+c))for(let l=-1;l<=1;l++)a+l<0||t<=a+l||c==0&&l==0||h==n.isDark(r+c,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;n.isDark(r,a)&&o++,n.isDark(r+1,a)&&o++,n.isDark(r,a+1)&&o++,n.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++)n.isDark(r,a)&&!n.isDark(r,a+1)&&n.isDark(r,a+2)&&n.isDark(r,a+3)&&n.isDark(r,a+4)&&!n.isDark(r,a+5)&&n.isDark(r,a+6)&&(e+=40);for(let r=0;r<t;r++)for(let a=0;a<t-6;a++)n.isDark(a,r)&&!n.isDark(a+1,r)&&n.isDark(a+2,r)&&n.isDark(a+3,r)&&n.isDark(a+4,r)&&!n.isDark(a+5,r)&&n.isDark(a+6,r)&&(e+=40);let s=0;for(let r=0;r<t;r++)for(let a=0;a<t;a++)n.isDark(a,r)&&s++;const i=Math.abs(100*s/t/t-50)/5;return e+=i*10,e}};class we{num;constructor(t,e){if(t.length==null)throw new Error(t.length+"/"+e);let s=0;for(;s<t.length&&t[s]==0;)s++;this.num=new Array(t.length-s+e);for(let i=0;i<t.length-s;i++)this.num[i]=t[i+s]}get(t){return this.num[t]}getLength(){return this.num.length}multiply(t){const e=new Array(this.getLength()+t.getLength()-1);for(let s=0;s<this.getLength();s++)for(let i=0;i<t.getLength();i++)e[s+i]^=K.gexp(K.glog(this.get(s))+K.glog(t.get(i)));return new we(e,0)}mod(t){if(this.getLength()-t.getLength()<0)return this;const e=K.glog(this.get(0))-K.glog(t.get(0)),s=new Array(this.getLength());for(let i=0;i<this.getLength();i++)s[i]=this.get(i);for(let i=0;i<t.getLength();i++)s[i]^=K.gexp(K.glog(t.get(i))+e);return new we(s,0).mod(t)}}class Ut{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 s=Ut.getRsBlockTable(t,e);if(s==null)throw new Error("bad rs block @ typeNumber:"+t+"/errorCorrectLevel:"+e);const i=s.length/3,r=[];for(let a=0;a<i;a++){const o=s[a*3+0],h=s[a*3+1],c=s[a*3+2];for(let l=0;l<o;l++)r.push(new Ut(h,c))}return r}static getRsBlockTable(t,e){switch(e){case Be.L:return Ut.RS_BLOCK_TABLE[(t-1)*4+0];case Be.M:return Ut.RS_BLOCK_TABLE[(t-1)*4+1];case Be.Q:return Ut.RS_BLOCK_TABLE[(t-1)*4+2];case Be.H:return Ut.RS_BLOCK_TABLE[(t-1)*4+3];default:return}}}class Zr{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 s=0;s<e;s++)this.putBit((t>>>e-s-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 _l{mode;data;constructor(t){this.mode=xt.MODE_8BIT_BYTE,this.data=t}getLength(){return this.data.length}write(t){for(let e=0,s=this.data.length;e<s;e++)t.put(this.data.charCodeAt(e),8)}}class se{static PAD0=236;static PAD1=17;typeNumber;errorCorrectLevel;modules;moduleCount;dataCache;dataList;constructor(t,e){this.typeNumber=t,this.errorCorrectLevel=Be[e],this.modules=[],this.moduleCount=0,this.dataCache=null,this.dataList=[]}addData(t){const e=new _l(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=Ut.getRSBlocks(t,this.errorCorrectLevel),s=new Zr;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];s.put(a.mode,4),s.put(a.getLength(),z.getLengthInBits(a.mode,t)),a.write(s)}if(s.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 s=0;s<this.moduleCount;s++){this.modules[s]=new Array(this.moduleCount);for(let i=0;i<this.moduleCount;i++)this.modules[s][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=se.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,e)}setupPositionProbePattern(t,e){for(let s=-1;s<=7;s++)if(!(t+s<=-1||this.moduleCount<=t+s))for(let i=-1;i<=7;i++)e+i<=-1||this.moduleCount<=e+i||(0<=s&&s<=6&&(i==0||i==6)||0<=i&&i<=6&&(s==0||s==6)||2<=s&&s<=4&&2<=i&&i<=4?this.modules[t+s][e+i]=!0:this.modules[t+s][e+i]=!1)}getBestMaskPattern(){let t=0,e=0;for(let s=0;s<8;s++){this.makeImpl(!0,s);const i=z.getLostPoint(this);(s==0||t>i)&&(t=i,e=s)}return e}createMovieClip(t,e,s){const i=t.createEmptyMovieClip(e,s),r=1;this.make();for(let a=0;a<this.modules.length;a++){const o=a*r;for(let h=0;h<this.modules[a].length;h++){const c=h*r;this.modules[a][h]&&(i.beginFill(0,100),i.moveTo(c,o),i.lineTo(c+r,o),i.lineTo(c+r,o+r),i.lineTo(c,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 s=0;s<t.length;s++){const i=t[e],r=t[s];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 s=0;s<18;s++){const i=!t&&(e>>s&1)==1;this.modules[Math.floor(s/3)][s%3+this.moduleCount-8-3]=i}for(let s=0;s<18;s++){const i=!t&&(e>>s&1)==1;this.modules[s%3+this.moduleCount-8-3][Math.floor(s/3)]=i}}setupTypeInfo(t,e){const s=this.errorCorrectLevel<<3|e,i=z.getBCHTypeInfo(s);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 s=-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 h=0;h<2;h++)if(this.modules[i][o-h]==null){let c=!1;a<t.length&&(c=(t[a]>>>r&1)==1),z.getMask(e,i,o-h)&&(c=!c),this.modules[i][o-h]=c,r--,r==-1&&(a++,r=7)}if(i+=s,i<0||this.moduleCount<=i){i-=s,s=-s;break}}}static createData(t,e,s){const i=Ut.getRSBlocks(t,e),r=new Zr;for(let o=0;o<s.length;o++){const h=s[o];r.put(h.mode,4),r.put(h.getLength(),z.getLengthInBits(h.mode,t)),h.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(se.PAD0,8),r.getLengthInBits()>=a*8));)r.put(se.PAD1,8);return se.createBytes(r,i)}static createBytes(t,e){let s=0,i=0,r=0;const a=new Array(e.length),o=new Array(e.length);for(let d=0;d<e.length;d++){const g=e[d].dataCount,y=e[d].totalCount-g;i=Math.max(i,g),r=Math.max(r,y),a[d]=new Array(g);for(let S=0;S<a[d].length;S++)a[d][S]=255&t.buffer[S+s];s+=g;const m=z.getErrorCorrectPolynomial(y),b=new we(a[d],m.getLength()-1).mod(m);o[d]=new Array(m.getLength()-1);for(let S=0;S<o[d].length;S++){const C=S+b.getLength()-o[d].length;o[d][S]=C>=0?b.get(C):0}}let h=0;for(let d=0;d<e.length;d++)h+=e[d].totalCount;const c=new Array(h);let l=0;for(let d=0;d<i;d++)for(let g=0;g<e.length;g++)d<a[g].length&&(c[l++]=a[g][d]);for(let d=0;d<r;d++)for(let g=0;g<e.length;g++)d<o[g].length&&(c[l++]=o[g][d]);return c}}const Kr=Math.ceil,Xe=Math.floor,Qr=Math.round;function Dl(n,t){const e=hn(n),s=t?.ecc||"H",i=t?.size||256,r=-1,a=t?.padding||0,o=t?.color||"#000000",h=t?.background||"#ffffff",c=new se(r,s);c.addData(e),c.make();const l=c.getModuleCount(),d=(i-a*2)/l,g=a,y=i-a;return Jr(i,o,h,function(m,x){if(g<=m&&m<y&&g<=x&&x<y){const b=Xe((m-g)/d),S=Xe((x-g)/d);return c.isDark(S,b)?0:1}else return 1})}function Al(n,t){const e=t.x||0,s=t.y||0,i=hn(n),r=t.ctx,a=t.ecc||"H",o=typeof t.size=="number"?Xe(t.size):256,h=t.padding||0,c=-1,l=t.color||"#000000",d=t.background||"#ffffff",g=new se(c,a);g.addData(i),g.make();const y=g.getModuleCount(),m=(o-h*2)/y;r.fillStyle=d,r.fillRect(e,s,o,o);for(let x=0;x<y;x++)for(let b=0;b<y;b++){const S=Kr((b+1)*m)-Xe(b*m),C=Kr((x+1)*m)-Xe(x*m);r.fillStyle=g.isDark(x,b)?l:d,r.fillRect(e+Qr(b*m)+h,s+Qr(x*m)+h,S,C)}}class rt extends U{shapesCountChange=!1;constructor(t){super(t)}shapeInit(){}frameStart(t){return this.shapesCountChange&&(this.shapesCountChange=!1,this.shapes.forEach(e=>{e.parent=this,e.initPathD()}),this.pathd=this.initPathD(),this.shapes.forEach(e=>{!e.forceCXY&&!e.independentTransformInGroup&&(e.cX=this.cX-e.diffXInGroup,e.cY=this.cY-e.diffYInGroup)})),super.frameStart(t)}frameUpdate(t,e){this.shapes.forEach(s=>{!s.independentTransformInGroup&&!s.isDragging&&(s.x=this.x+s.diffXInGroup,s.y=this.y+s.diffYInGroup,s.degree=this.degree+s.diffDegreeInGroup,s.scalarX=this.scalarX*s.diffScalarXInGroup,s.scalarY=this.scalarY*s.diffScalarYInGroup)}),super.frameUpdate(t,e)}addShape(t){(Array.isArray(t)?t:[t]).forEach(e=>{this.shapes.findIndex(s=>s.id==e.id)==-1&&(e.on("draging",(s,i)=>{this.enableDrag&&(this.x+=s,this.y+=i,this.emit("draging",s,i,e))}),this.shapes.push(e),this.shapesCountChange=!0)})}getBoundingClientRect(){const t=[],e=[];this.shapes.forEach(h=>{const c=h.getBoundingClientRect();c&&(t.push(c.x,c.x+c.width),e.push(c.y,c.y+c.height))});const s=this.pathd?.getBoundingClientRect();if(s&&(s.width||s.height)&&(t.push(s.x,s.x+s.width),e.push(s.y,s.y+s.height)),t.length==0||e.length==0)return null;const i=Math.min.apply(0,t),r=Math.min.apply(0,e),a=Math.max.apply(0,t),o=Math.max.apply(0,e);return{x:i,y:r,width:a-i,height:o-r}}setAttrs(t,e){typeof t!="string"?(super.setAttr(t),this.shapes.forEach(s=>{s.setAttr(t)})):e&&(super.setAttr(t,e),this.shapes.forEach(s=>{s.setAttr(t,e)}))}sortPathD(){this.shapes=this.shapes.map(t=>{const e=t.initPathD();return{shape:t,perimeter:e.perimeterPoints()}}).sort((t,e)=>e.perimeter-t.perimeter).map(t=>t.shape)}expendFill(t){const e=t.shapes.length,s=this.shapes.length;if(e<s)return t.expendFill(this);for(let i=s;i<e;i++){const a=t.shapes[i].initPathD().polymorphPoints,o=a[0],h=a[1],c=[["M",o,h]];for(let l=2;l+5<a.length;l+=6)c.push(["C",o,h,o,h,o,h]);this.addShape(new U({attrs:{...t.shapes[i].getAttrs()},d:c}))}}strokeDashTween(t,e){switch(e?.type){case"sequence":const s=this.shapes.length-1;this.shapes.forEach((o,h)=>{o.strokeDashTween(t,{...e,delay:h,onStart:()=>{h==0&&e?.onGroupStart?.()},onUpdate:()=>{e?.onGroupUpdate?.()},onComplete:()=>{h==s&&e?.onGroupComplete?.()}})});break;case"parallel":default:const i=new ps({frameDuration:t}),r={},a={};this.shapes.forEach((o,h)=>{const c=At(o.getTotalLength(),0);r[`offset_${h}`]=c,a[`offset_${h}`]=0,o.setAttr({strokeDasharray:`${c} ${c}`,strokeDashoffset:`${c}`})}),i.addTween(r,a,Object.assign(e||{},{onStart:()=>{e?.onGroupStart?.()},onUpdate:(o,h)=>{for(let c in o){const l=js(c).number;this.shapes[l].setAttr("strokeDashoffset",""+At(o[c],2))}e?.onGroupUpdate?.()},onComplete:()=>{e?.onGroupComplete?.()}})),i.play();break}}}class ce extends U{toX;toY;constructor(t){super(t),this.toX=t?.toX||0,this.toY=t?.toY||0;let e=this.toX-this.x,s=this.toY-this.y;return new Proxy(this,{set(i,r,a,o){switch(r){case"x":i.toX=a+e;break;case"y":i.toY=a+s;break;case"toX":e=a-i.x;break;case"toY":s=a-i.y;break}return Reflect.set(i,r,a,o)}})}toSVGPathData(){return[["m",0,0],["l",this.toX-this.x,this.toY-this.y]]}toCanvasContext(t){t.beginPath(),t.moveTo(0,0),t.lineTo(this.toX-this.x,this.toY-this.y)}intersection(t){const e=new Nn({x:this.x,y:this.y,toX:this.toX,toY:this.toY}),s=new Nn({x:t.x,y:t.y,toX:t.toX,toY:t.toY});return e.intersection(s)}}class Il extends U{cx;cy;toX;toY;isLineThrough;constructor(t){super(t),this.cx=t?.cx||0,this.cy=t?.cy||0,this.toX=t?.toX||0,this.toY=t?.toY||0,this.isLineThrough=typeof t?.isLineThrough=="boolean"?t.isLineThrough:!1}toSVGPathData(){if(this.isLineThrough){const t=this.cx*2-(this.x+this.toX)/2,e=this.cy*2-(this.y+this.toY)/2;return[["m",0,0],["q",t-this.x,e-this.y,this.toX-this.x,this.toY-this.y]]}else return[["m",0,0],["q",this.cx-this.x,this.cy-this.y,this.toX-this.x,this.toY-this.y]]}toCanvasContext(t){if(t.beginPath(),t.moveTo(0,0),this.isLineThrough){const e=this.cx*2-(this.x+this.toX)/2,s=this.cy*2-(this.y+this.toY)/2;t.quadraticCurveTo(e-this.x,s-this.y,this.toX-this.x,this.toY-this.y)}else t.quadraticCurveTo(this.cx-this.x,this.cy-this.y,this.toX-this.x,this.toY-this.y)}}class ta extends sr{currentItem={};items=[];groups=[];globalStyles={};grad={};idtops={};text="";constructor(t){super(t),this.on("tag",(e,s)=>{switch(this.text="",this.currentItem={type:e},e){case"g":this.groups.push(this.currentItem);break}this.processAttrs(e,s)}),this.on("text",e=>{if(this.currentItem.type=="style"){try{const s=qa(e);for(let i of s.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,s)=>{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),Xi(this.currentItem.style,this.currentItem,Gi)}switch(this.processAttrs(e,s),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 s=[],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&&Xi(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+Bi(parseFloat(e.x1),parseFloat(e.y1),parseFloat(e.x2),parseFloat(e.y2),parseFloat(e.x1)+100,parseFloat(e.y1))).toFixed(2),s=[this.grad.angle];for(let o=0,h=this.grad.stops.length;o<h;o++)i=this.grad.stops[o],o&&o!=h-1?s.push(i.color+":"+i.offset):s.push(i.color);this.idtops[this.grad.id]=s.join("-"),this.items.forEach(o=>{o.fillid==this.grad.id&&(o.fill=this.idtops[this.grad.id])});break;case"radialGradient":s=[];for(let o=0,h=this.grad.stops.length;o<h;o++)i=this.grad.stops[o],o&&o!=h-1?s.push(i.color+":"+i.offset):s.push(i.color);this.idtops[this.grad.id]=s.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(Gi.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"&&Xi(a,this.currentItem,Gi),r==="transform"&&(this.currentItem.transform=a+(this.currentItem.transform||" ")),r==="fill"){const o=a.match(/url\(#([^)]+)\)/);if(o){const h=o[1];this.currentItem.fillid=h,this.idtops[h]&&(this.currentItem.fill=this.idtops[h])}}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 Bi(n,t,e,s,i,r){if(typeof i>"u"||typeof r>"u"){const a=n-e,o=t-s;return!a&&!o?0:(180+Math.atan2(-o,-a)*180/Math.PI+360)%360}else return Bi(n,t,i,r)-Bi(e,s,i,r)}function Xi(n,t,e){const s=(n+"").split(";"),i=/^\s+|\s+$/g;for(let r=0,a=s.length;r<a;r++){let o=s[r].split(":"),h=o[0].replace(i,"").replace(/[A-Z]/g,function(c){return"-"+c.toLowerCase()});(!e||e.includes(h))&&(t[h]=o[1].replace(i,""))}}const Gi=["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 kl{app;rootEl;shapes=[];isMouseDown=!1;currentMouseInShape;currentEnableDragMouseInShape;dragDx=0;dragDy=0;constructor(t,e,s){this.app=t,this.rootEl=yt.createSVGElement("svg"),A.empty(this.app.container),A.insert(this.app.container,this.rootEl),e&&s?this.setSize(e,s):(this.setSize(this.app.width,this.app.height),this.app.on("resize",()=>{this.setSize(this.app.width,this.app.height)})),this.app.captureDrag({start:()=>{this.isMouseDown=!0,this.dragDx=0,this.dragDy=0,this.setCursor()},end:()=>{this.isMouseDown=!1,this.dragDx=0,this.dragDy=0,this.setCursor()},move:(i,r)=>{this.currentEnableDragMouseInShape&&(this.dragDx+=r.dx,this.dragDy+=r.dy),this.setCursor()}}),this.app.on("tap",()=>{for(let i of this.shapes)if(this.currentMouseInShape==i){i.emit("clicked");let r=i.parent;for(;r;)r.emit("clicked",i),r=r.parent;break}})}setCursor(){this.currentEnableDragMouseInShape?(this.app.container.style.cursor="grab",this.isMouseDown&&(this.app.container.style.cursor="grabbing")):this.currentMouseInShape?this.app.container.style.cursor="pointer":this.app.container.style.cursor="default"}setSize(t,e){return A.attribute(this.rootEl,{viewBox:`0 0 ${t} ${e}`,width:`${t}`,height:`${e}`}),this}download(){return yt.downloadFromSVGElement(this.rootEl)}_addDrawShape(t){this.shapes.findIndex(e=>e.id==t.id)===-1&&(this.shapes.push(t),t instanceof rt&&t.shapes.forEach(e=>{this._addDrawShape(e)}))}path(t){(Array.isArray(t)?t:[t]).forEach(e=>{this._addDrawShape(e)}),this.isMouseDown&&this.currentEnableDragMouseInShape||(this.currentMouseInShape=void 0);for(let e of this.shapes){if(!e.isShow){e.el&&(A.remove(e.el),delete e.el);continue}if(e.frameStart(this.app.mousePoint),e.el||(e instanceof Ge?e.el=this.text(e.text,e.x,e.y,mn(e.getAttrs(),(i,r)=>typeof r=="string")):(e.el=yt.createSvgPath(e.toSVGPathD(),e.id),A.insert(this.rootEl,e.el))),e.followMouse&&(!Ke(e.x,this.app.mousePoint.x,5)||!Ke(e.y,this.app.mousePoint.y,5))&&e.followTo(this.app.mousePoint),e.targetToAfterDragFree&&(this.isMouseDown||e.runEaseTo({x:e.targetToAfterDragFree.targetX,y:e.targetToAfterDragFree.targetY},{easing:e.targetToAfterDragFree?.easing})),this.isMouseDown&&this.currentEnableDragMouseInShape==e){e.isDragging=!0;const i=this.dragDx,r=this.dragDy;if(this.dragDx=0,this.dragDy=0,i||r){if(e.x+=i,e.y+=r,e.alongPath){const a=e.alongPath.closestPoint(e.x,e.y);e.x=a.point.x-e.cX,e.y=a.point.y-e.cY}e.emit("draging",i,r)}}else e.isDragging=!1;e instanceof Ge&&(e.setAttr("x",String(e.x)),e.setAttr("y",String(e.y))),e.frameUpdate(this.app.mousePoint);const s=e.toSVGPathD();if(this.attr(e,mn(e.getAttrs(),(i,r)=>typeof r=="string")),this.attr(e,"d",s),!this.currentMouseInShape){const i=e.isPointInPath(this.app.mousePoint.x,this.app.mousePoint.y,this.rootEl)||e.isPointInStroke(this.app.mousePoint.x,this.app.mousePoint.y,this.rootEl)||!1;e.isMouseIn=i,i&&(this.currentMouseInShape=e,e.enableDrag&&(this.currentEnableDragMouseInShape=e))}e.frameEnd(this.app.mousePoint)}this.currentMouseInShape||(this.currentEnableDragMouseInShape=void 0)}delete(t){(Array.isArray(t)?t:[t]).forEach(e=>{e.el&&A.remove(e.el),delete e.el,this.shapes=this.shapes.filter(s=>s.id!==e.id)})}clear(){this.shapes.forEach(t=>{t.el&&A.remove(t.el),delete t.el}),A.empty(this.rootEl),this.shapes=[]}attr(t,e,s){const i=t.el||t;return i instanceof SVGElement?e===void 0&&s===void 0?A.attribute(i):typeof e=="string"&&s===void 0?A.attribute(i,ft(e))||"":(typeof e=="object"?A.attribute(i,e):typeof e=="string"&&s!==void 0&&A.attribute(i,ft(e),s),this):this}circle(t,e,s){return this.path(new Vt({x:t,y:e,radius:s}))}circleEl(t,e,s){const i=yt.createSVGElement("circle",{cx:String(t),cy:String(e),r:String(s)});return A.insert(this.rootEl,i),i}ellipse(t,e,s,i){return this.path(new sa({x:t,y:e,rx:s,ry:i}))}ellipseEl(t,e,s,i){const r=yt.createSVGElement("ellipse",{cx:String(t),cy:String(e),rx:String(s),ry:String(i)});return A.insert(this.rootEl,r),r}rect(t,e,s,i){return this.path(new zt({x:t,y:e,width:s,height:i}))}rectEl(t,e,s,i){const r=yt.createSVGElement("rect",{x:String(t),y:String(e),width:String(s),height:String(i)});return A.insert(this.rootEl,r),r}image(t,e,s,i,r){}text(t,e,s,i){const r=yt.createSVGElement("text",{x:String(e),y:String(s)});return A.html(r,t),this.attr(r,Object.assign({"alignment-baseline":"middle"},i)),A.insert(this.rootEl,r),r}textWithTspan(t,e,s,i){const r=i?.["line-height"]||"1.2em",a=yt.createSVGElement("text",{x:String(e),y:String(s)});return t.split(`
41
+ `).forEach((o,h)=>{if(o.trim()){const c=yt.createSVGElement("tspan",{x:String(e),dy:h>0?r:"0"});A.html(c,o),A.insert(a,c),this.attr(c,Object.assign({"alignment-baseline":"middle"},i))}}),A.insert(this.rootEl,a),a}}class Ml extends rt{svgWidth=0;svgHeight=0;width=0;height=0;constructor(t){super(t);const e=new ta(t.svg).parse();for(let s=0,i=e.length;s<i;s++){const r=e[s];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"||!ae.isSVGPath(r.path))continue;const a={};for(const l in r)l==="type"||l==="path"||l==="transform"||(a[l]=r[l]);const o=ae.absolutizeSVGPath(ae.parseSVGPath(r.path)),h=[];let c=[];for(let l=0,d=o.length;l<d;l++){const g=o[l];c.push(g),g[0].toLowerCase()=="z"&&(h.push(c),c=[])}c.length&&h.push(c),h.forEach(l=>{const d=pi(r.transform??"");d.scale(this.width&&this.svgWidth?this.width/this.svgWidth:1),this.addShape(new U({...t,attrs:{...a,...t?.attrs||{}},d:l,originMatrix:d}))})}}shapeInit(){this.trim()}}class Vt extends U{radius;constructor(t){super(t),this.radius=t?.radius||0}getBoundingClientRect(){return{x:this.x-this.radius,y:this.y-this.radius,width:this.radius*2,height:this.radius*2}}toSVGPathData(){return this.radius?[["m",0,-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",0,0]]}toCanvasContext(t){t.beginPath(),t.arc(0,0,this.radius,0,Math.PI*2,!0),t.closePath()}eq(t){return this.x===t.x&&this.y===t.y&&this.radius===t.radius&&this.mass===t.mass}midPointBtw(t){return{x:this.x+(t.x-this.x)/2,y:this.y+(t.y-this.y)/2}}length(){return rs(this.x,this.y)}scalar(t){return this.x*=t,this.y*=t,this}normalize(t=1){const e=this.length();if(e){const s=t/e;this.scalar(s)}return this}clamp(t){const e=this.length();return e&&e>t&&this.scalar(t/e),this}cross(t){const e=this.x,s=this.y;return{x:s*t.x-e*t.y,y:e*t.y-s*t.x}}multiply(t){return{x:this.x*t.x,y:this.y*t.y}}div(t){return{x:this.x/t.x,y:this.y/t.y}}add(t){return{x:this.x+t.x,y:this.y+t.y}}sub(t){return{x:this.x-t.x,y:this.y-t.y}}dot(t){return this.x*t.x+this.y*t.y}reflect(t){const e=this.dot(t);return{x:this.x-2*e*t.x,y:this.y-2*e*t.y}}checkCollision(t){const e=t.x-this.x,s=t.y-this.y;if(Math.sqrt(e*e+s*s)<this.radius+t.radius){const r=Math.atan2(s,e),a={x:0,y:0},o=Tt(-r,e,s),h=Tt(-r,this.vx,this.vy),c=Tt(-r,t.vx,t.vy),l=h.x-c.x;h.x=((this.mass-t.mass)*h.x+2*t.mass*c.x)/(this.mass+t.mass),c.x=l+h.x;const d=Math.abs(h.x)+Math.abs(c.x),g=this.radius+t.radius-Math.abs(a.x-o.x);a.x+=h.x/d*g,o.x+=c.x/d*g;const y=Tt(r,a.x,a.y),m=Tt(r,o.x,o.y);t.x=this.x+m.x,t.y=this.y+m.y,this.x=this.x+y.x,this.y=this.y+y.y;const x=Tt(r,h.x,h.y),b=Tt(r,c.x,c.y);this.vx=x.x,this.vy=x.y,t.vx=b.x,t.vy=b.y}}checkWall(t){const e=typeof t?.bounce=="number"?t.bounce:-1,s=t.wall.x,i=t.wall.y,r=t.wall.x+t.wall.width,a=t.wall.y+t.wall.height;this.x+this.radius>r?(this.x=r-this.radius,this.vx*=e):this.x-this.radius<s&&(this.x=s+this.radius,this.vx*=e),this.y+this.radius>a?(this.y=a-this.radius,this.vy*=e):this.y-this.radius<i&&(this.y=i+this.radius,this.vy*=e)}}class ea extends U{points;isStraight;constructor(t){if(super(t),this.points=t.points,this.points.length<3)throw new Error("points length must >= 3");this.isStraight=typeof t?.isStraight=="boolean"?t.isStraight:!0}toSVGPathData(){const t=[],e=this.points.length;if(this.isStraight){t.push(["M",this.points[0].x,this.points[0].y]);for(let s=1;s<=e-1;s++)t.push(["L",this.points[s].x,this.points[s].y]);t.push(["Z"])}else{const s=(this.points[0].x+this.points[e-1].x)/2,i=(this.points[0].y+this.points[e-1].y)/2;t.push(["M",s,i]);for(let r=0;r<e-1;r++){const a=(this.points[r].x+this.points[r+1].x)/2,o=(this.points[r].y+this.points[r+1].y)/2;t.push(["Q",this.points[r].x,this.points[r].y,a,o])}t.push(["Q",this.points[e-1].x,this.points[e-1].y,s,i])}return t}toCanvasContext(t){t.beginPath();const e=this.points.length;if(this.isStraight){t.moveTo(this.points[0].x,this.points[0].y);for(let s=1;s<=e-1;s++)t.lineTo(this.points[s].x,this.points[s].y);t.closePath()}else{const s=(this.points[0].x+this.points[e-1].x)/2,i=(this.points[0].y+this.points[e-1].y)/2;t.moveTo(s,i);for(let r=0;r<e-1;r++){const a=(this.points[r].x+this.points[r+1].x)/2,o=(this.points[r].y+this.points[r+1].y)/2;t.quadraticCurveTo(this.points[r].x,this.points[r].y,a,o)}t.quadraticCurveTo(this.points[e-1].x,this.points[e-1].y,s,i)}}isContainPoint(t,e){const s=this.points.length;let i=!1;const r=2e-10;for(let a=0,o=s-1;a<s;o=a,a++){const h=this.points[a].x,c=this.points[a].y,l=this.points[o].x,d=this.points[o].y;if(h===t&&c===e||l===t&&d===e||e===c&&e===d)return!0;if(e>=c&&e<d||e<c&&e>=d){const g=(l-h)/(d-c),y=h+g*(e-c);if(y===t||Math.abs(y-t)<r)return!0;y>t&&(i=!i)}}return i}[Symbol.iterator](){let t=-1;return{next:()=>({value:t<=this.points.length-1?this.points[++t]:void 0,done:t>=this.points.length})}}}class zt extends U{width;height;borderRadius;constructor(t){super(t),this.width=t.width,this.height=t.height,this.borderRadius=t.borderRadius||0}static fromCubicBezier(t,e,s,i,r,a,o,h){const c=new mt({x:t,y:e,c1x:s,c1y:i,c2x:r,c2y:a,toX:o,toY:h});return new zt(c.getBoundingClientRect())}getBoundingClientRect(){return{x:this.x,y:this.y,width:this.width,height:this.height}}toSVGPathData(){return this.borderRadius?[["m",this.borderRadius,0],["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",0,0],["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}}class sa extends U{rx;ry;constructor(t){super(t),this.rx=t?.rx||0,this.ry=t?.ry||0}getBoundingClientRect(){return{x:this.x-this.rx,y:this.y-this.ry,width:this.rx*2,height:this.ry*2}}toSVGPathData(){return[["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(0,0,this.rx,this.ry,0,0,2*Math.PI,!0),t.closePath()}}class Ll extends U{constructor(t){super(t)}toSVGPathData(){return[["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 Rl extends U{constructor(t){super(t)}toSVGPathData(){return[["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()}}class Ol extends U{rx;ry;constructor(t){super(t),this.rx=t?.rx||10,this.ry=t?.ry||10}toSVGPathData(){return[["m",0,0],["l",this.rx*2.4,-this.ry*3.14],["a",this.rx/2,this.ry/2,0,0,0,-this.rx*2.4,-this.ry*1.5],["a",this.rx/2,this.ry/2,0,0,0,-this.rx*2.4,this.ry*1.5],["l",this.rx*2.4,this.ry*3.14],["z"]]}}class Nl extends U{rx;ry;constructor(t){super(t),this.rx=t?.rx??50,this.ry=t?.ry??50}toSVGPathData(){return[["m",0,0+this.ry*.3],["C",0,0,0-this.rx/2,0,0-this.rx/2,0+this.ry*.3],["C",0-this.rx/2,0+(this.ry+this.ry*.3)/2,0,0+(this.ry+this.ry*.3)/1.4,0,0+this.ry],["C",0,0+(this.ry+this.ry*.3)/1.8,0+this.rx/2,0+(this.ry+this.ry*.3)/2,0+this.rx/2,0+this.ry*.3],["C",0+this.rx/2,0,0,0,0,0+this.ry*.3],["z"]]}}class Fl extends U{r;constructor(t){super(t),this.r=t?.r||20}toSVGPathData(){const t=[["m",0,-this.r]];for(let e=0;e<6;e+=1){const s=288+e*144,i=this.r*Math.cos(O(s)),r=this.r*Math.sin(O(s));t.push(["l",i,r])}return t}}class Yl extends U{constructor(t){super(t)}toSVGPathData(){return[["M",0,0],["C",15,0,15,-40,5,-30],["L",0,0],["C",-15,0,-15,-40,-5,-30],["L",0,0],["a",15,15,0,1,1,0,30],["a",15,15,0,1,1,0,-30]]}}class Bl extends U{constructor(t){super(t),this.originD="m5.068 9.267-3.08-.77a.512.512 0 0 1 0-.994l3.08-.77a2.289 2.289 0 0 0 1.665-1.665l.77-3.08a.512.512 0 0 1 .994 0l.77 3.08c.205.82.845 1.46 1.665 1.665l3.08.77a.512.512 0 0 1 0 .994l-3.08.77a2.29 2.29 0 0 0-1.665 1.665l-.77 3.08a.512.512 0 0 1-.994 0l-.77-3.08a2.289 2.289 0 0 0-1.665-1.665Z"}}class Xl extends rt{constructor(t){super(t);const e=new ce({...t,x:this.x,y:this.y,toX:this.x,toY:this.y-140-Math.random()*20}),s=30+Math.random()*30,i=new ce({...t,x:this.x,y:this.y-s,diffYInGroup:-s,toX:this.x+Math.random()*80-40,toY:this.y-100-Math.random()*40}),r=60+Math.random()*40,a=new ce({...t,x:this.x,y:this.y-r,diffYInGroup:-r,toX:this.x+Math.random()*60-30,toY:this.y-110-Math.random()*20});this.addShape([e,i,a])}}class Ge extends U{text;width=0;height=0;constructor(t){super(t),this.text=t.text,this.setAttr({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',emojiFontFamily:'"Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji", "EmojiOne Color", "Android Emoji", "Twemoji Mozilla", "system emoji", sans-serif',fill:"#666666",stroke:"none","alignment-baseline":"middle",textAnchor:"start",...this.getAttrs()});const e=js(this.getAttr("fontSize"),10).number,s=js(this.getAttr("fontWeight"),400).number,i=A.measureText(this.text,e,s);this.width=i.width,this.height=i.height}getBoundingClientRect(){return null}toSVGPathData(){return[]}toCanvasContext(t){t.fillText(this.text,0,0)}}class ia extends rt{text;bg;padding;offset;isShow;textShape;bgShape;constructor(t){super(t),this.text=t.text,this.bg=t.bg||"rgba(0,0,0,0.5)",this.padding=t.padding||4,this.offset=t.offset||20,this.isShow=typeof t?.isShow=="boolean"?t?.isShow:!1,this.textShape=new Ge({...t,x:this.x+this.offset,y:this.y+this.offset,text:this.text,attrs:{...this.getAttrs(),fill:Re(this.bg).opposite(!0).toString(),textAnchor:"start"}}),this.bgShape=new zt({...t,x:this.textShape.x-this.padding,y:this.textShape.y-this.textShape.height/2-this.padding,width:this.textShape.width+this.padding*2,height:this.textShape.height+this.padding*2,attrs:{...this.getAttrs(),fill:this.bg}}),this.addShape([this.bgShape,this.textShape])}shapeInit(){Hs(()=>{this.textShape.x=this.x+this.offset,this.textShape.y=this.y+this.offset,this.textShape.text=this.text,this.textShape.isShow=this.isShow,this.bgShape.x=this.textShape.x-this.padding,this.bgShape.y=this.textShape.y-this.textShape.height/2-this.padding,this.bgShape.width=this.textShape.width+this.padding*2,this.bgShape.height=this.textShape.height+this.padding*2,this.bgShape.isShow=this.isShow})}}class Gl extends rt{radius;expandRaidus;startDegree;endDegree;text="";defaultShowText;tip="";p1=new Vt;p1Offset=10;p2=new Vt;p2Offset=40;p3=new Vt;p3Offset=10;p4=new Vt;p4Offset=10;direction=1;sectorArc;line12;line23;textShape;tipShape;constructor(t){super(t),this.radius=t.radius,this.expandRaidus=t.expandRaidus??20,this.startDegree=t.startDegree,this.endDegree=t.endDegree,this.text=t.text||"",this.defaultShowText=typeof t?.defaultShowText=="boolean"?t.defaultShowText:!!this.text,this.tip=t.tip||"",this.sectorArc=new na({x:this.x,y:this.y,radius:this.radius,expandRaidus:this.expandRaidus,startDegree:this.startDegree,endDegree:this.endDegree,attrs:Object.assign({...this.getAttrs()},{strokeWidth:"0"})}),this.addShape(this.sectorArc);const e=Object.assign({...this.getAttrs()},{fill:"none"});this.line12=new ce({x:this.p1.x,y:this.p1.y,toX:this.p2.x,toY:this.p2.y,attrs:{...e},isShow:this.defaultShowText}),this.line23=new ce({x:this.p2.x,y:this.p2.y,toX:this.p3.x,toY:this.p3.y,attrs:{...e},isShow:this.defaultShowText}),this.textShape=new Ge({x:this.p4.x,y:this.p4.y,text:this.text,attrs:{stroke:e.stroke,textAnchor:this.direction==1?"start":"end"},isShow:this.defaultShowText}),this.text&&(this.addShape(this.line12),this.addShape(this.line23),this.addShape(this.textShape)),this.tipShape=new ia({x:0,y:0,text:this.tip,isShow:!1}),this.tip&&this.addShape(this.tipShape)}frameUpdate(t){this.text&&!this.defaultShowText&&(this.line12.isShow=this.sectorArc.isMouseIn,this.line23.isShow=this.sectorArc.isMouseIn,this.textShape.isShow=this.sectorArc.isMouseIn);const e=this.startDegree+(this.endDegree-this.startDegree)/2,{dx:s,dy:i}=It(O(e),this.sectorArc.radius+this.p1Offset);this.p1.x=this.x+s,this.p1.y=this.y+i;const{dx:r,dy:a}=It(O(e),this.sectorArc.radius+this.p1Offset+this.p2Offset);this.p2.x=this.x+r,this.p2.y=this.y+a,this.line12.x=this.p1.x,this.line12.y=this.p1.y,this.line12.toX=this.p2.x,this.line12.toY=this.p2.y,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,this.line23.x=this.p2.x,this.line23.y=this.p2.y,this.line23.toX=this.p3.x,this.line23.toY=this.p3.y,this.textShape.x=this.p4.x,this.textShape.y=this.p4.y,this.textShape.setAttr("textAnchor",this.direction==1?"start":"end"),this.sectorArc.isMouseIn?(this.tipShape.isShow=!0,this.tipShape.x=t.x,this.tipShape.y=t.y):(this.tipShape.isShow=!1,this.tipShape.x=t.x,this.tipShape.y=t.y)}}class na extends U{radius;realRadius;expandRaidus;startDegree;endDegree;vr;ar;bounce;durationTime;status;constructor(t){super(t),this.radius=0,this.realRadius=t.radius,this.expandRaidus=t.expandRaidus??20,this.startDegree=t.startDegree,this.endDegree=t.endDegree,this.vr=0,this.ar=.03,this.bounce=.6,this.durationTime=8.333333333333334,this.status=0}frameUpdate(){this.status==0&&this.radius<this.realRadius?(this.expand(this.realRadius),this.radius>=this.realRadius&&(this.status=1)):this.isMouseIn?this.expand(this.realRadius+this.expandRaidus):this.shrink(this.realRadius)}expand(t){this.vr+=this.ar,this.radius+=this.vr*this.durationTime,this.radius>t&&(this.radius=t,this.vr*=-this.bounce)}shrink(t){this.vr-=this.ar,this.radius+=this.vr*this.durationTime,this.radius<t&&(this.radius=t,this.vr*=-this.bounce)}toSVGPathData(){const{dx:t,dy:e}=It(O(this.startDegree),this.radius),{dx:s,dy:i}=It(O(this.endDegree),this.radius);return[["m",0,0],["l",t,e],["a",this.radius,this.radius,0,Math.abs(this.endDegree-this.startDegree)>=180?1:0,1,s-t,i-e],["z"]]}toCanvasContext(t){t.beginPath(),t.moveTo(0,0),t.arc(0,0,this.radius,O(this.startDegree),O(this.endDegree),!1),t.closePath()}containPoint(t,e){const s=as(this.x,this.y,t,e),i=it(Zt(this.x,this.y,t,e));return s<=this.radius&&i>=this.startDegree&&i<=this.endDegree}}class Ul extends rt{showFlame;ship;flame;constructor(t){super(t),this.showFlame=typeof t?.showFlame=="boolean"?t.showFlame:!1,this.ship=new U({...t,d:[["M",10,0],["L",-10,10],["L",-5,0],["L",-10,-10],["L",10,0],["Z"]]}),this.addShape(this.ship),this.flame=new U({...t,isShow:this.showFlame,d:[["m",-10,-5],["l",-7.5,5],["l",7.5,5],["z"]]}),this.addShape(this.flame)}shapeInit(){Hs(()=>{this.ship.x=this.x,this.ship.y=this.y,this.flame.x=this.x,this.flame.y=this.y,this.flame.isShow=this.showFlame})}}class Vl extends rt{value;backgroundRect;occupyRect;handle;constructor(t){super(t);const e=t?.min||0,s=t?.max||100,i=t?.step||1,r=Xa(e,s,i);this.value=r(typeof t?.defaultValue=="number"?V(t.defaultValue,e,s):e);const a=this.value/(s-e),o=t?.barWidth||100,h=t?.barHeight||4,c=t?.handleRadius||10,l=h*.5,d=t?.barColor||wi.colorGrayF5,g=t?.handleColor||wi.colorPrimary;this.backgroundRect=new zt({x:this.x,y:this.y,width:o,height:h,borderRadius:l,attrs:{fill:d},enableDrag:!1,independentTransformInGroup:!0}),this.addShape(this.backgroundRect),this.occupyRect=new zt({x:this.x,y:this.y,width:o*a,height:h,borderRadius:l,attrs:{fill:g},enableDrag:!1,independentTransformInGroup:!0}),this.addShape(this.occupyRect),this.handle=new Vt({x:this.x+o*a,y:this.y+l,diffXInGroup:o*a,diffYInGroup:l,radius:c,alongPath:new Ro({x:this.x,y:this.y+l,d:[["m",0,0],["l",o,0]]}),attrs:{fill:g},enableDrag:!0,independentTransformInGroup:!0}),this.addShape(this.handle),this.handle.on("draging",y=>{this.occupyRect.width=V(this.occupyRect.width+y,0,o),this.value=r((this.handle.x-this.x)/o*(s-e)+e),this.emit("change",this.value)})}}class zl extends rt{width;height;cornerRadius;controlPoint;mainRect;rightPoint;constructor(t){super(t),this.width=t.width,this.height=t.height,this.cornerRadius=this.height/2,this.controlPoint=new Vt({...t,x:this.x,y:this.y,radius:2}),this.forceSetCXY(this.controlPoint.cX,this.controlPoint.cY),this.mainRect=new zt({...t,x:this.x-this.cornerRadius,y:this.y-this.cornerRadius,diffXInGroup:-this.cornerRadius,diffYInGroup:-this.cornerRadius,width:this.width+this.cornerRadius*2,height:this.height,borderRadius:this.cornerRadius}),this.rightPoint=new Vt({...t,x:this.x+this.width,y:this.y,diffXInGroup:this.width,radius:2}),this.addShape([this.mainRect,this.controlPoint,this.rightPoint])}getPin(){return{x:this.controlPoint.x+Math.cos(O(this.controlPoint.degree))*this.width,y:this.controlPoint.y+Math.sin(O(this.controlPoint.degree))*this.width}}}class Ui extends U{extendDegree;radius;startDegree;endDegree;diffDegree;constructor(t){super(t),this.extendDegree=t?.extendDegree||0,this.x=(t.x||0)+t.width/2;const e=Math.min(t.width/2,t.height)-t.lineWidth;this.radius=e-e*Math.abs(Math.sin(O(this.extendDegree))),this.y=(t.y||0)+t.height-t.lineWidth-this.radius*Math.abs(Math.sin(O(this.extendDegree))),this.diffDegree=t.endDegree-t.startDegree,this.startDegree=180+t.startDegree-this.extendDegree,this.endDegree=180+t.endDegree+this.extendDegree,this.setAttr({"stroke-linecap":"round","stroke-width":String(t.lineWidth),stroke:t.color||"none"})}setPercent(t){this.endDegree=this.startDegree+(this.diffDegree+this.extendDegree*2)*t}toSVGPathData(){const{dx:t,dy:e}=It(O(this.startDegree),this.radius),{dx:s,dy:i}=It(O(this.endDegree),this.radius);return[["m",t,e],["a",this.radius,this.radius,0,Math.abs(this.endDegree-this.startDegree)>=180?1:0,1,s-t,i-e]]}toCanvasContext(t){t.beginPath(),t.arc(0,0,this.radius,O(this.startDegree),O(this.endDegree),!1)}}class ql extends rt{percent=0;ringBg;ring;lines=[];bgColor;startColor;endColor;indicatorLineCount;constructor(t){super(t);const e=t?.startDegree||0,s=t?.endDegree||180,i=t?.extendDegree||15,r=t?.lineWidth||12;this.bgColor=t?.bgColor||"#B3C6E7",this.startColor=t?.startColor||"#5A82F0",this.endColor=t?.endColor||"#66B3FF",this.percent=t?.percent||0,this.indicatorLineCount=23;const a=20,o=2,h=17;this.ringBg=new Ui({...t,x:t?.x,y:t?.y,width:t.width,height:t.height,startDegree:e,endDegree:s,extendDegree:i,lineWidth:r,color:this.bgColor}),this.addShape(this.ringBg),this.ring=new Ui({...t,x:t?.x,y:t?.y,width:t.width,height:t.height,startDegree:e,endDegree:s,extendDegree:i,lineWidth:r}),this.addShape(this.ring);const c=this.ringBg.y-this.ringBg.radius+a;for(let l=0;l<this.indicatorLineCount;l++)this.lines.push(new ce({...t,centerX:this.ringBg.x,centerY:this.ringBg.y,x:this.ringBg.x,y:c,toX:this.ringBg.x,toY:c+h,degree:this.ringBg.startDegree+90+(s-e+i*2)/(this.indicatorLineCount-1)*l,attrs:{"stroke-linecap":"round","stroke-width":String(o),stroke:this.bgColor}}));this.addShape(this.lines)}setPercent(t){this.percent=t}shapeInit(){this.on("draging",(t,e,s)=>{this.shapes.forEach(i=>{i!=s&&(i.x+=t,i.y+=e)})})}frameUpdate(t,e){const s=this.ringBg.radius-this.ringBg.radius*Math.cos(Math.PI*this.percent),i=this.ringBg.radius*Math.sin(Math.PI*this.percent);if(e){const r=e.createLinearGradient(-this.ringBg.radius,0,-this.ringBg.radius+s,-i,{0:this.startColor,1:this.endColor});this.ring.setAttr({stroke:r})}else this.ring.setAttr({stroke:this.startColor});this.ring.setPercent(this.percent);for(let r=0;r<this.indicatorLineCount;r++){const a=r/(this.indicatorLineCount-1)<=this.percent;this.lines[r].setAttr({stroke:a&&e?e.createLinearGradient(0,0,this.lines[r].toX-this.lines[r].x,this.lines[r].toY-this.lines[r].y,{0:this.startColor,1:this.endColor}):a?this.startColor:this.bgColor})}}}class Hl extends U{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=this.setBrightness(t?.brightness||1)}setBrightness(t){return this.brightness=V(t,0,1),this.brightness}toSVGPathData(){return[]}}const jl=Hl;class Wl extends U{points;light;constructor(t=[]){if(t.length<3)throw new Error("points length must >= 3");super(),this.points=t,this.light=new jl({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,s=this.points.length;e<=s-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,s=this.points.length;e<=s-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(),s=this.points[1].getScreenX()-this.points[2].getScreenX(),i=this.points[1].getScreenY()-this.points[2].getScreenY();return t*i>e*s}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},s={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=s.x*this.light.x+s.y*this.light.y+s.z*this.light.z,r=Math.sqrt(s.x*s.x+s.y*s.y+s.z*s.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=Re(t),s=this.getLightFactor();return e.r*=s,e.g*=s,e.b*=s,e.toString()}}class $l extends rt{fettis=[];constructor(t,e,s){super();const{shape:i,x:r,y:a,particleCount:o,angle:h,spread:c,startVelocity:l,decay:d,gravity:g,drift:y,ticks:m,colors:x,scalar:b,flat:S}=Object.assign({shape:zt,x:.5,y:.6,particleCount:100,angle:90,spread:70,startVelocity:45,decay:.9,gravity:1,drift:0,ticks:200,colors:nr,scalar:1,flat:!1},s||{}),C=O(h),L=O(c);let R=o;for(;R--;){const X=x[R%x.length],Y=new i({x:t*r,y:e*a,width:10,height:10,scalar:b,attrs:{fill:X},independentTransformInGroup:!0});this.addShape(Y),this.fettis.push({shape:Y,wobble:Math.random()*10,wobbleSpeed:Math.min(.11,Math.random()*.1+.05),velocity:l*.5+Math.random()*l,angle2D:-C+(.5*L-Math.random()*L),tiltAngle:(Math.random()*.5+.25)*Math.PI,tick:0,totalTicks:m,decay:d,drift:y,random:Math.random()+2,tiltSin:0,tiltCos:0,wobbleX:0,wobbleY:0,gravity:g*3,scalar:b,flat:S,color:Re(X)})}}frameUpdate(t){this.fettis.length&&(this.fettis=this.fettis.filter(e=>{e.shape.x+=Math.cos(e.angle2D)*e.velocity+e.drift,e.shape.y+=Math.sin(e.angle2D)*e.velocity+e.gravity,e.velocity*=e.decay,e.flat?(e.wobble=0,e.wobbleX=e.shape.x+10*e.scalar,e.wobbleY=e.shape.y+10*e.scalar,e.tiltSin=0,e.tiltCos=0,e.random=1):(e.wobble+=e.wobbleSpeed,e.wobbleX=e.shape.x+10*e.scalar*Math.cos(e.wobble),e.wobbleY=e.shape.y+10*e.scalar*Math.sin(e.wobble),e.tiltAngle+=.1,e.tiltSin=Math.sin(e.tiltAngle),e.tiltCos=Math.cos(e.tiltAngle),e.random=Math.random()+2);const s=e.tick++/e.totalTicks,i=e.shape.x+e.random*e.tiltCos,r=e.shape.y+e.random*e.tiltSin,a=e.wobbleX+e.random*e.tiltCos,o=e.wobbleY+e.random*e.tiltSin;return e.shape.setAttr("fill",e.color.setAlpha(1-s).toString()),e.shape.degree=it(Math.PI/10*e.wobble),e.shape.scalarX=Math.abs(a-i)*.1,e.shape.scalarY=Math.abs(o-r)*.1,e.tick<e.totalTicks}))}}class Vi{shapes;constructor(t){this.shapes=t}run(t){this.shapes.forEach(s=>{s.run(),t?.wall&&s.checkWall({wall:t.wall,bounce:t.bounce})});const e=this.shapes.length;for(let s=0,i=e-1;s<i;s++)for(let r=s+1;r<e;r++)this.shapes[s].checkCollision(this.shapes[r])}gravitate(){const t=this.shapes.length;this.shapes.forEach((e,s)=>{e.run();for(let i=s+1;i<t;i++)e.checkCollision(this.shapes[i]),e.gravitateTo(this.shapes[i])})}springChain(t){this.shapes.forEach((e,s)=>{s>0&&e.runSpringTo(this.shapes[s-1],t)})}springConnect(t){const e=$t(t?.springLength,100);this.shapes.forEach(s=>{s.isDragging||this.shapes.filter(i=>i.id!==s.id).forEach(i=>{const r=Zt(s.x,s.y,i.x,i.y);s.runSpringTo({x:i.x-Math.cos(r)*e,y:i.y-Math.sin(r)*e},t)})})}springMass(t,e){const s=this.shapes.length,i=[];return this.shapes.forEach((r,a)=>{r.run(e),r.x>t.x+t.width?r.x=t.x:r.x<t.x&&(r.x=t.x+t.width),r.y>t.y+t.height?r.y=t.y:r.y<t.y&&(r.y=t.y+t.height);for(let o=a+1;o<s;o++)i.push([r.x,r.y,this.shapes[o].x,this.shapes[o].y,r.springMassTo(this.shapes[o],e)])}),i}polymorph(){if(this.shapes.length<2)throw new Error("shapes个数必须大于等于2");const t=this.shapes.length-1,e=new Array(t);for(let i=0;i<t;i++){const r=this.shapes[i].initPathD();this.shapes[i].frameStart();const a=this.shapes[i+1].initPathD();this.shapes[i+1].frameStart();const o=Math.max(r.polymorphPoints.length,a.polymorphPoints.length);e[i]=wt.getPathInterpolator(r.expendFill(o),a.expendFill(o))}const s=new U({d:e[0](0)});return i=>{const r=At(t*i,6),a=Math.min(Math.floor(r),t-1),o=At(r-a,6);s.originD=e[a](o);const h=this.shapes[a].getAttr("fill","none"),c=this.shapes[a+1].getAttr("fill","none");typeof h=="string"&&typeof c=="string"&&s.setAttr("fill",lt.gradient(h,c,o).toString());const l=this.shapes[a].getAttr("stroke","none"),d=this.shapes[a+1].getAttr("stroke","none");return typeof l=="string"&&typeof d=="string"&&s.setAttr("stroke",lt.gradient(l,d,o).toString()),s}}polymorphGroup(){if(this.shapes.length<2)throw new Error("shapes个数必须大于等于2");let t=0,e;const s=[];this.shapes.forEach(o=>{let h;o instanceof rt?(h=o,h.sortPathD()):(h=new rt,h.addShape(o)),s.push(h),t<h.shapes.length&&(t=h.shapes.length,e=h)}),s.forEach(o=>{o!==e&&o.expendFill(e)});const i=[];s.forEach((o,h)=>{o.shapes.forEach((c,l)=>{i[l]=i[l]||[],i[l][h]=c})});const r=[];i.forEach(o=>{r.push(new Vi(o).polymorph())});const a=new rt;return r.forEach(o=>{a.addShape(o(0))}),o=>(r.forEach(h=>{h(o)}),a)}polymorphTween(t=6e3,e){const s=this.shapes.findIndex(o=>o instanceof rt)>=0?this.polymorphGroup():this.polymorph(),i=s(0),r=e?.onUpdate,a=new ps({frameDuration:t});a.addTween({t:0},{t:1},Object.assign(e||{},{onUpdate:(o,h)=>{s(o.t),r?.(o,h),e?.draw?.(i)}})),a.play()}static generatePointsShape(t,e,s,i){const r=[];for(let a=0;a<i;a++){const o=a/i*2*Math.PI,{dx:h,dy:c}=It(o,s);r.push({x:t+h,y:e+c})}return new ea({points:r})}static generateRosettaShape(t,e,s,i,r){if(r==0)throw new Error("no dividing by zero, please");const a=[],o=360/r;for(let h=0;h<r;h+=1){const c=o*h*Math.PI/180,l=t+2*s*Math.cos(c),d=e+2*s*Math.sin(c);a.push(new ii({x:t,y:e,rx:s,ry:i,xAxisRotate:o*h,largeArcFlag:1,sweepFlag:1,toX:l,toY:d})),a.push(new ii({x:l,y:d,rx:s,ry:i,xAxisRotate:o*h,largeArcFlag:1,sweepFlag:1,toX:t,toY:e}))}return new U({d:wt.fromLines(a)})}}const ra={map:new Map,transform:function(n){if(Rn)return n;if(this.map.has(n))return this.map.get(n);const t=new OffscreenCanvas(n.width,n.height);return t.getContext("2d")?.drawImage(n,0,0),this.map.set(n,t),t},clear:function(){this.map.clear()}};function Jl(n,t,e){const s=new OffscreenCanvas(n,t),i=s.getContext("2d");if(i)return e(i),s.transferToImageBitmap()}function Zl(n,t,e){const s=n.createPattern(ra.transform(t),"no-repeat");if(s){const i=gi(e);s.setTransform(i),n.fillStyle=s}}class Kl{app;ctx;shapes=[];isMouseDown=!1;currentMouseInShape;currentEnableDragMouseInShape;dragDx=0;dragDy=0;constructor(t,e=!1){if(this.app=t,!(this.app.container instanceof HTMLCanvasElement))throw new Error("app.container 应该为 HTMLCanvasElement!");this.ctx=new ls(this.app.container,this.app.width,this.app.height,e),this.app.captureDrag({start:()=>{this.isMouseDown=!0,this.dragDx=0,this.dragDy=0,this.setCursor()},end:()=>{this.isMouseDown=!1,this.dragDx=0,this.dragDy=0,this.setCursor()},move:(s,i)=>{this.currentEnableDragMouseInShape&&(this.dragDx+=i.dx,this.dragDy+=i.dy),this.setCursor()}}),this.app.on("tap",()=>{for(let s of this.shapes)if(this.currentMouseInShape==s){s.emit("clicked");let i=s.parent;for(;i;)i.emit("clicked",s),i=i.parent;break}})}setCursor(){this.currentEnableDragMouseInShape?(this.app.container.style.cursor="grab",this.isMouseDown&&(this.app.container.style.cursor="grabbing")):this.currentMouseInShape?this.app.container.style.cursor="pointer":this.app.container.style.cursor="default"}transformCtxBaseOnShape(t){t.usePathDtoCanvasContext||(this.ctx.translate(t.x,t.y),this.ctx.rotate(O(t.degree),t.cX,t.cY),this.ctx.scale(t.scalarX,t.scalarY,t.cX,t.cY))}_addDrawShape(t){this.shapes.push(t),t instanceof rt&&t.shapes.forEach(e=>{this._addDrawShape(e)})}draw(t=[]){this.shapes=[],(Array.isArray(t)?t:[t]).forEach(e=>{this._addDrawShape(e)}),this.isMouseDown&&this.currentEnableDragMouseInShape||(this.currentMouseInShape=void 0);for(let e of this.shapes){if(!e.isShow)continue;if(this.ctx.save(),e.frameStart(this.app.mousePoint),A.attrsToCanvas(this.ctx,e.getAttrs()),e.followMouse&&(!Ke(e.x,this.app.mousePoint.x,5)||!Ke(e.y,this.app.mousePoint.y,5))&&e.followTo(this.app.mousePoint),e.targetToAfterDragFree&&(this.isMouseDown||e.runEaseTo({x:e.targetToAfterDragFree.targetX,y:e.targetToAfterDragFree.targetY},{easing:e.targetToAfterDragFree?.easing})),this.isMouseDown&&this.currentEnableDragMouseInShape==e){e.isDragging=!0;const i=this.dragDx,r=this.dragDy;if(this.dragDx=0,this.dragDy=0,i||r){if(e.x+=i,e.y+=r,e.alongPath){const a=e.alongPath.closestPoint(e.x,e.y);e.x=a.point.x-e.cX,e.y=a.point.y-e.cY}e.emit("draging",i,r)}}else e.isDragging=!1;e.frameUpdate(this.app.mousePoint,this.ctx),this.transformCtxBaseOnShape(e),e.toCanvasContext(this.ctx),this.ctx.hasSetCustomStrokeStyle&&this.ctx.stroke(),this.ctx.hasSetCustomFillStyle&&this.ctx.fill();const s=this.ctx.currentPath2D;if(!this.currentMouseInShape){const i=this.ctx.isPointInPath(s,this.app.mousePoint.x,this.app.mousePoint.y)||this.ctx.isPointInStroke(s,this.app.mousePoint.x,this.app.mousePoint.y)||!1;e.isMouseIn=i,i&&(this.currentMouseInShape=e,e.enableDrag&&(this.currentEnableDragMouseInShape=e))}e.frameEnd(this.app.mousePoint),this.ctx.restore()}this.currentMouseInShape||(this.currentEnableDragMouseInShape=void 0)}drawMouseMoveLine(t="line",e){switch(t){case"brush":const s=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,h=Re(r);return this.app.captureDrag({move:()=>{if(this.isMouseDown){for(let c=0;c<i;c++){const l=Math.random()*Math.PI*2,d=Math.random()*s,g=this.app.mousePoint.x+Math.cos(l)*d|0,y=this.app.mousePoint.y+Math.sin(l)*d|0,m=(g+y*a.width)*4;o[m]=h.r,o[m+1]=h.g,o[m+2]=h.b,o[m+3]=255}this.ctx.putImageData(a)}}});case"line":default:return this.app.captureDrag({start:c=>{this.ctx.beginPath(),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 Ql{localVideoUtil;remoteVideoUtil;localPeerConnection=null;remotePeerConnection=null;constructor(t,e){this.localVideoUtil=new Le(t),this.remoteVideoUtil=new Le(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(s=>{this.localVideoUtil.setSrcObject(s),t(s)}).catch(s=>{this.trace(`navigator.getUserMedia error: ${s}.`),e(s)})})}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(),s=t.getAudioTracks();e.length>0&&this.trace(`Using video device: ${e[0].label}.`),s.length>0&&this.trace(`Using audio device: ${s[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(s[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,s=t.candidate;if(e&&s){const i=new RTCIceCandidate(s),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 s=this.getPeerName(t);this.trace(`${s} ${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 s=document.createElement("div");s.innerHTML=`<div>${e}, ${t}</div>`,document.getElementById("trace")?.appendChild(s)}getOtherPeer(t){return t===this.localPeerConnection?this.remotePeerConnection:this.localPeerConnection}getPeerName(t){return t===this.localPeerConnection?"localPeerConnection":"remotePeerConnection"}}class Su{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 la(i,t){return!i||i.parentElement===null?t:la(i.parentElement,t.concat([i]))}const Vi=function(i,t){return getComputedStyle(i,null).getPropertyValue(t)},Cu=function(i){return Vi(i,"overflow")+Vi(i,"overflow-y")+Vi(i,"overflow-x")},Eu=function(i){return/(auto|scroll)/.test(Cu(i))};function Tu(i){if(!(i instanceof HTMLElement||i instanceof SVGElement))return;const t=la(i.parentElement,[]);for(let e=0;e<t.length;e+=1)if(Eu(t[e]))return t[e];return document.scrollingElement||document.documentElement}const ua=[],da={};function zi(i){ua.push(i)}function Pu(i,t=!1){const e=or();if(da[e])return;wx.error(r=>{console.log(r.errMsg??JSON.stringify(r))}),wx.ready(()=>{ua.forEach(r=>r())});const s=["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"],n=["wx-open-launch-app","wx-open-launch-app","wx-open-subscribe","wx-open-audio"];wx.config(Object.assign(i,{debug:t,jsApiList:s,openTagList:n})),da[e]=!0}function Mu(i){return new Promise((t,e)=>{wx.checkJsApi({jsApiList:[i],success:function(s){s.checkResult[i]?t(!0):e(!1)},fail:function(){e(!1)}})})}function Au(i){zi(function(){wx.updateAppMessageShareData(i)})}function Iu(i){zi(function(){wx.updateTimelineShareData(i)})}function Du(i){wx.chooseImage(i)}function ku(i){wx.previewImage(i)}function _u(i){wx.uploadImage(i)}function Lu(i){wx.downloadImage(i)}function Ru(i){wx.getLocalImgData(i)}function Ou(){wx.startRecord()}function Nu(i){wx.stopRecord(i)}function Fu(i){wx.onVoiceRecordEnd(i)}function Bu(i){wx.playVoice(i)}function Xu(i){wx.pauseVoice(i)}function Yu(i){wx.stopVoice(i)}function Uu(i){wx.onVoicePlayEnd(i)}function Gu(i){wx.uploadVoice(i)}function Vu(i){wx.downloadVoice(i)}function zu(i){wx.translateVoice(i)}function qu(i){wx.getNetworkType(i)}function Hu(i){wx.openLocation(i)}function ju(i){wx.getLocation(i)}function Wu(i){wx.scanQRCode(i)}function $u(i,t,e){function s(){WeixinJSBridge.invoke("getBrandWCPayRequest",i,function(n){n.err_msg=="get_brand_wcpay_request:ok"?t():e(n.err_msg)})}typeof WeixinJSBridge>"u"?document.addEventListener?document.addEventListener("WeixinJSBridgeReady",s,!1):document.attachEvent&&(document.attachEvent("WeixinJSBridgeReady",s),document.attachEvent("onWeixinJSBridgeReady",s)):s()}function Ju(i){window.AlipayJSBridge?i&&i():document.addEventListener("AlipayJSBridgeReady",i,!1)}function Ge(i,t){let e="未知错误";switch(i.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`${i.error}(${e}): ${i.errorMessage}`}function Zu(i,t,e){ap.tradePay(Object.assign(i,{}),function(s){let n="未知错误";switch(s.resultCode){case 9e3:return n="订单支付成功",t?.(n);case 8e3:n="正在处理中";break;case 4e3:n="订单支付失败";break;case 6001:n="用户中途取消";break;case 6002:n="网络连接出错";break;case 99:n="用户点击忘记密码导致快捷界面退出(only iOS)";break}e?.(n)})}function Ku(i,t,e){ap.scan(Object.assign(i,{fail:s=>{e?.(Ge(s))}}),function(s){t?.(s.code)})}function Qu(i,t,e){ap.getLocation(Object.assign(i,{fail:s=>{e?.(Ge(s))}}),function(s){t?.(s)})}function td(i,t,e){ap.openLocation(Object.assign(i,{fail:s=>{e?.(Ge(s))}}),function(){t?.()})}function ed(i,t,e){ap.chooseImage(Object.assign(i,{fail:s=>{e?.(Ge(s,"chooseImage"))}}),function(s){t?.(s)})}function sd(i,t,e){ap.previewImage(Object.assign(i,{fail:s=>{e?.(Ge(s))}}),function(){t?.()})}class id{map;constructor(t,e=120.619585,s=31.299379,n=18){this.map=new T.Map(t),this.map.centerAndZoom(new T.LngLat(e,s),n)}}class nd{currentPage;itemsPerPage;entriesInterval;entriesEdge;linkTo;prevText;nextText;ellipseText;prevShowAlways;nextShowAlways;callback;totalPages;parentVNode;constructor(t,e,s){this.currentPage=s?.currentPage||0,this.itemsPerPage=s?.itemsPerPage||10,this.entriesInterval=s?.entriesInterval||5,this.entriesEdge=s?.entriesEdge||1,this.linkTo=s?.linkTo||"javascript:;",this.prevText=s?.prevText||"上一页",this.nextText=s?.nextText||"下一页",this.ellipseText=s?.ellipseText||"...",this.prevShowAlways=typeof s?.prevShowAlways=="boolean"?s?.prevShowAlways:!0,this.nextShowAlways=typeof s?.nextShowAlways=="boolean"?s?.nextShowAlways:!0,this.callback=s?.callback||(n=>!1),this.totalPages=Math.ceil(e/this.itemsPerPage),this.parentVNode=this.createParentVNode(),pe(this.parentVNode,t),this.selectPage(this.currentPage)}createParentVNode(){return Wt("div",{class:"pagination"},[])}appendVNode(t,e,s){e=e<0?0:e<this.totalPages?e:this.totalPages-1;const n=s?.text||String(e+1),r=s?.classes||"";t.children.push(e==this.currentPage&&r.indexOf("prev")==-1&&r.indexOf("next")==-1?Wt("span",{class:`current ${r}`},n):Wt("a",{class:r,href:this.linkTo.replace(/__id__/,String(e)),onClick:a=>this.selectPage(e,a)},n))}drawLinks(){const t=this.createParentVNode(),e=Math.ceil(this.entriesInterval/2),s=this.currentPage>e?Math.max(Math.min(this.currentPage-e,this.totalPages-this.entriesInterval),0):0,n=this.currentPage>e?Math.min(this.currentPage+e,this.totalPages):Math.min(this.entriesInterval,this.totalPages);if(this.prevText&&(this.currentPage>0||this.prevShowAlways)&&this.appendVNode(t,this.currentPage-1,{text:this.prevText,classes:"prev"}),s>0&&this.entriesEdge>0){const r=Math.min(this.entriesEdge,s);for(let a=0;a<r;a++)this.appendVNode(t,a);this.entriesEdge<s&&this.ellipseText&&t.children.push(Wt("span",{},this.ellipseText))}for(let r=s;r<n;r++)this.appendVNode(t,r);if(n<this.totalPages&&this.entriesEdge>0){this.totalPages-this.entriesEdge>n&&this.ellipseText&&t.children.push(Wt("span",{},this.ellipseText));const r=Math.max(this.totalPages-this.entriesEdge,n);for(let a=r;a<this.totalPages;a++)this.appendVNode(t,a)}this.nextText&&(this.currentPage<this.totalPages-1||this.nextShowAlways)&&this.appendVNode(t,this.currentPage+1,{text:this.nextText,classes:"next"}),ss(this.parentVNode,t),this.parentVNode=t}selectPage(t,e){this.currentPage=t=t<0?0:t<this.totalPages?t:this.totalPages-1,this.drawLinks();const s=this.callback(t);return e&&(s||(e.stopPropagation?e.stopPropagation():e.cancelBubble=!0)),s}prevPage(){return this.selectPage(this.currentPage-1)}nextPage(){return this.selectPage(this.currentPage+1)}}const se={enabled:!1,files:{},add:function(i,t){this.enabled!==!1&&(this.files[i]=t)},get:function(i){if(this.enabled!==!1)return this.files[i]},remove:function(i){delete this.files[i]},clear:function(){this.files={}}};class rd{isLoading=!1;itemsLoaded=0;itemsTotal=0;urlModifier;handlers=[];_onStart;_onLoad;_onProgress;_onError;constructor(t){this._onStart=t?.onStart,this._onLoad=t?.onLoad,this._onProgress=t?.onProgress,this._onError=t?.onError}itemStart(t){this.itemsTotal++,this.isLoading===!1&&this._onStart?.(t,this.itemsLoaded,this.itemsTotal),this.isLoading=!0}itemEnd(t){this.itemsLoaded++,this._onProgress?.(t,this.itemsLoaded,this.itemsTotal),this.itemsLoaded===this.itemsTotal&&(this.isLoading=!1,this._onLoad?.())}itemError(t){this._onError?.(t)}resolveURL(t){return this.urlModifier?this.urlModifier(t):t}setURLModifier(t){return this.urlModifier=t,this}addHandler(t,e){return this.handlers.push(t,e),this}removeHandler(t){const e=this.handlers.indexOf(t);return e!==-1&&this.handlers.splice(e,2),this}getHandler(t){for(let e=0,s=this.handlers.length;e<s;e+=2){const n=this.handlers[e],r=this.handlers[e+1];if(n.global&&(n.lastIndex=0),n.test(t))return r}return null}}const ad=new rd;class od{static DEFAULT_MATERIAL_NAME="__DEFAULT";manager;crossOrigin;withCredentials;path;resourcePath;requestHeader;constructor(t){this.manager=t!==void 0?t:ad,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}load(t,e){}loadAsync(t,e){return new Promise((s,n)=>{this.load(t,{onLoad:s,onProgress:e,onError:n})})}parse(t){}setCrossOrigin(t){return this.crossOrigin=t,this}setWithCredentials(t){return this.withCredentials=t,this}setPath(t){return this.path=t,this}setResourcePath(t){return this.resourcePath=t,this}setRequestHeader(t){return this.requestHeader=t,this}}const ks=od;class hd extends ks{constructor(t){super(t)}load(t,e){this.path!==void 0&&(t=this.path+t),t=this.manager.resolveURL(t);const s=se.get(t);if(s!==void 0)return this.manager.itemStart(t),setTimeout(()=>{e?.onLoad?.(s),this.manager.itemEnd(t)},0),s;const n=I.createElementNS("img"),r=()=>{o(),se.add(t,n),e?.onLoad?.(n),this.manager.itemEnd(t)},a=h=>{o(),e?.onError?.(h),this.manager.itemError(t),this.manager.itemEnd(t)};function o(){n.removeEventListener("load",r,!1),n.removeEventListener("error",a,!1)}return n.addEventListener("load",r,!1),n.addEventListener("error",a,!1),t.slice(0,5)!=="data:"&&this.crossOrigin!==void 0&&(n.crossOrigin=this.crossOrigin),this.manager.itemStart(t),n.src=t,n}}class cd extends ks{isImageBitmapLoader=!0;options;constructor(t){super(t),typeof createImageBitmap>"u"&&console.warn("ImageBitmapLoader: createImageBitmap() not supported."),typeof fetch>"u"&&console.warn("ImageBitmapLoader: fetch() not supported."),this.options={premultiplyAlpha:"none"}}setOptions(t){return this.options=t,this}load(t,e){this.path!==void 0&&(t=this.path+t),t=this.manager.resolveURL(t);const s=se.get(t);if(s!==void 0){if(this.manager.itemStart(t),s.then){s.then(r=>{e?.onLoad?.(r),this.manager.itemEnd(t)}).catch(r=>{e?.onError?.(r)});return}return setTimeout(()=>{e?.onLoad?.(s),this.manager.itemEnd(t)},0),s}const n=fetch(t,{credentials:this.crossOrigin==="anonymous"?"same-origin":"include",headers:this.requestHeader}).then(r=>r.blob()).then(r=>createImageBitmap(r,Object.assign(this.options,{colorSpaceConversion:"none"}))).then(r=>(se.add(t,r),e?.onLoad?.(r),this.manager.itemEnd(t),r)).catch(r=>{e?.onError?.(r),se.remove(t),this.manager.itemError(t),this.manager.itemEnd(t)});se.add(t,n),this.manager.itemStart(t)}}const Vt={};class ld extends Error{response;constructor(t,e){super(t),this.response=e}}class fa extends ks{mimeType;responseType="";constructor(t){super(t),typeof fetch>"u"&&console.warn("FileLoader: fetch() not supported.")}load(t,e){this.path!==void 0&&(t=this.path+t),t=this.manager.resolveURL(t);const s=se.get(t);if(s!==void 0)return this.manager.itemStart(t),setTimeout(()=>{e?.onLoad?.(s),this.manager.itemEnd(t)},0),s;if(Vt[t]!==void 0){Vt[t].push({onLoad:e?.onLoad,onProgress:e?.onProgress,onError:e?.onError});return}Vt[t]=[],Vt[t].push({onLoad:e?.onLoad,onProgress:e?.onProgress,onError:e?.onError});const n=new Request(t,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),r=this.mimeType,a=this.responseType;fetch(n).then(o=>{if(o.status===200||o.status===0){if(o.status===0&&console.warn("FileLoader: HTTP Status 0 received."),typeof ReadableStream>"u"||o.body===void 0||o.body?.getReader===void 0)return o;const h=Vt[t],c=o.body.getReader(),l=o.headers.get("X-File-Size")||o.headers.get("Content-Length"),d=l?parseInt(l):0,g=d!==0;let y=0;const p=new ReadableStream({start(x){b();function b(){c.read().then(({done:S,value:C})=>{if(S)x.close();else{y+=C.byteLength;const L=new ProgressEvent("progress",{lengthComputable:g,loaded:y,total:d});for(let R=0,Y=h.length;R<Y;R++)h[R].onProgress?.(L);x.enqueue(C),b()}},S=>{x.error(S)})}}});return new Response(p)}else throw new ld(`fetch for "${o.url}" responded with ${o.status}: ${o.statusText}`,o)}).then(o=>{switch(a){case"arraybuffer":return o.arrayBuffer();case"blob":return o.blob();case"document":return o.text().then(h=>new DOMParser().parseFromString(h,r));case"json":return o.json();default:if(r===void 0)return o.text();{const c=/charset="?([^;"\s]*)"?/i.exec(r),l=c&&c[1]?c[1].toLowerCase():void 0,d=new TextDecoder(l);return o.arrayBuffer().then(g=>d.decode(g))}}}).then(o=>{se.add(t,o);const h=Vt[t];delete Vt[t];for(let c=0,l=h.length;c<l;c++)h[c].onLoad?.(o)}).catch(o=>{const h=Vt[t];if(h===void 0)throw this.manager.itemError(t),o;delete Vt[t];for(let c=0,l=h.length;c<l;c++)h[c].onError?.(o);this.manager.itemError(t)}).finally(()=>{this.manager.itemEnd(t)}),this.manager.itemStart(t)}setResponseType(t){return this.responseType=t,this}setMimeType(t){return this.mimeType=t,this}}class ud extends ks{constructor(t){super(t)}load(t,e){const s=new fa(this.manager);s.setResponseType("arraybuffer"),s.setPath(this.path),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials),s.load(t,{onLoad:n=>{try{const r=n.slice(0);new AudioContext().decodeAudioData(r,o=>{e?.onLoad?.(o)}).catch(o=>{e?.onError?.(o),this.manager.itemError(t)})}catch(r){e?.onError?.(r),this.manager.itemError(t)}},onProgress:e?.onProgress,onError:e?.onError})}}return m.Arrow=eu,m.AudioLoader=ud,m.BezierEasing=ci,m.COLORS=ir,m.CSSToJSEasing=ih,m.Clock=di,m.CommonKeyCode=wh,m.Confetti=yu,m.Cross=ou,m.CustomCanvasContext=Me,m.CustomCanvasGradient=cs,m.CustomCanvasPattern=ti,m.DOMEventBus=tr,m.DOMKey=Qn,m.DOMParse=er,m.DOMSVGUtil=oe,m.DOMToBlob=bn,m.DOMToString=$s,m.DOMUtil=I,m.DOMVideo=Re,m.Easing=D,m.Ellipse=aa,m.FetchWithAxios=cl,m.FetchWithAxiosRequestCancel=Wr,m.FileLoader=fa,m.Fox=su,m.Heart=iu,m.HeartVariant=nu,m.ImageBitmapLoader=cd,m.ImageLoader=hd,m.Interpolation=Bt,m.Line=ce,m.LinePicture=tu,m.LineQuadraticBezier=Kl,m.Matrix=at,m.Matrix3D=ut,m.Pagination=nd,m.Point=Ut,m.Point3D=Le,m.Point3Ds=gu,m.Points=ra,m.QRCode=ee,m.Rabbit=au,m.Rect=Gt,m.Ring=Ui,m.RingIndicator=fu,m.SVGParse=na,m.SVGParsedPathArgsLength=De,m.Sector=cu,m.SectorArc=ha,m.Segment=du,m.Shape=U,m.ShapeCombo=Gi,m.ShapeGroup=st,m.Ship=lu,m.Slider=uu,m.Star=ru,m.TWEEN=uh,m.Text=Ue,m.Timeline=ps,m.Tip=oa,m.Tree=hu,m.Tween=ui,m.WebGLRenderer=Su,m.WebRTCClient=vu,m.WebSocketClient=no,m.YZCanvas=bu,m.YZCanvasContext=ls,m.YZMessageChannel=Uh,m.YZSVG=Ql,m.YZWorker=Yh,m.addWatermark=Hl,m.addWxJsReadyFnBeforeConfig=zi,m.ajax=Gh,m.aliJsChooseImage=ed,m.aliJsGetLocation=Qu,m.aliJsOpenLocation=td,m.aliJsPreviewImage=sd,m.aliJsReady=Ju,m.aliJsScan=Ku,m.aliJsTradePay=Zu,m.angle=$t,m.appendURLSearchString=lr,m.base64EncodeOutputStream=Kr,m.base64URLDecode=zr,m.base64URLEncode=Vr,m.bitmapMapper=ca,m.blobToRawImage=wl,m.byteArrayOutputStream=Fi,m.canDrawBitmap=Ln,m.canUsePaths=Io,m.canUseWorker=_n,m.changeBrightness=zl,m.changeDiaphaneity=ql,m.changeSize=Vl,m.checkWxJsApi=Mu,m.clearCookies=Mh,m.computeImageDisplayRect=ll,m.createXMLHttpRequest=ur,m.decodeUseTextDecoder=qr,m.decryptInCommon=al,m.distance=as,m.distance2=os,m.drawBitmapInCanvas=xu,m.drawQRCodeToCanvas=Zl,m.easeNameToCubicBezier=li,m.encodeUseTextEncoder=As,m.encryptInCommon=rl,m.fileOrBlobToDataURL=Oi,m.flipSideToSide=bl,m.flipUpsideDown=vl,m.flushURLSearchString=Xh,m.formDataToSearchString=cr,m.fpsTask=zo,m.getBitmapFromCanvas=wu,m.getBrowserClient=Zs,m.getBrowserClientVersion=po,m.getBrowserLanguage=yo,m.getColor=It,m.getColorScheme=sr,m.getCookie=Th,m.getCookieObject=Ph,m.getDOMMatrix=mi,m.getDirection=Ro,m.getElementPositionInPage=En,m.getElementPositionInPage2=co,m.getElementPositionInViewport=Tn,m.getFileExtension=Sn,m.getFileTypeFromFile=io,m.getFilesImageInfo=dl,m.getFormSubmitData=Vh,m.getHexColorString=ge,m.getImageAspectRatio=ul,m.getImageDataByAIData=Wl,m.getImageDataFromBitmap=ml,m.getImageDataFromUrl=$r,m.getImageDataFromVideo=fl,m.getImageMainColor=xl,m.getInternetExplorerVersion=An,m.getMousePositionInElement=Mt,m.getMousePositionInPage=Pn,m.getMousePositionInViewport=fo,m.getOperatingSystem=is,m.getOperatingSystemVersion=mo,m.getOppositeColor=yi,m.getOppositeHexColorString=nr,m.getOppositeRGBColorString=Ah,m.getPageBodyElement=ao,m.getPageDocumentElement=Te,m.getPageSize=ho,m.getRGBColorString=wi,m.getRawImageInfo=Ds,m.getRelativeBoundingClientRect=lo,m.getScreenElement=ro,m.getScrollParent=Tu,m.getTimeZone=wo,m.getURL=ws,m.getUserGeolocationPromise=go,m.getVerticalScrollPercentInPage=uo,m.getViewportSize=oo,m.gifImage=Qr,m.gradientColor=xi,m.h=Wt,m.hasDocument=Po,m.hasHistory=Mo,m.hasWindow=kn,m.hsb2rgb=_h,m.hsl2rgb=Lh,m.hsv2rgb=kh,m.imageDataToBitmap=pl,m.imageDataToBlob=yl,m.imageDataToDataURL=gl,m.injectWxJsConfig=Pu,m.isAliBrowser=Dn,m.isAliMiniProgram=To,m.isAndroid=Mn,m.isAppleDevice=xo,m.isBrowserSupportFileAPI=Ao,m.isDarkMode=vo,m.isElement=Do,m.isIE=So,m.isIE9or10=Co,m.isIOS=Ks,m.isMacOS=Qs,m.isMobile=bo,m.isNative=ns,m.isURL=Fh,m.isWxBrowser=In,m.isWxMiniProgram=Eo,m.jpgToPng=Xl,m.leftRotate=Sl,m.length=rs,m.linkExport=Js,m.localstorage=pi,m.mapTDTJSSDK=id,m.marginSharpen=Bl,m.microTask=Wo,m.mosaic=jl,m.mount=pe,m.multiplyArrayOfMatrix=fh,m.multiplyArrayOfMatrix3D=mh,m.multiplyMatrix=Jn,m.multiplyMatrix3D=Zn,m.nextTick=jo,m.normalizePoint=Lo,m.objectHash=jr,m.onDocumentReady=Ch,m.outputGifBase64=ta,m.outputQRCodeBase64=Jl,m.pack=il,m.parseTransformToMatrix=fi,m.parseURL=ar,m.patch=ss,m.patchDOM=Cn,m.pngToJpg=Yl,m.polar=At,m.prefixes=ko,m.radiusClip=Gl,m.randomColorHexString=Ih,m.randomColorNumber=rr,m.readFileInBrowser=es,m.recordToSearchString=hr,m.rectClip=Ul,m.requestAnimationFrameCycle=ii,m.reverseCSSToJSEasing=nh,m.reverseEaseNameToCubicBezier=Hn,m.reverseEasing=Un,m.rgb2hsb=Oh,m.rgb2hsl=Nh,m.rgb2hsv=Rh,m.rightRotate=Cl,m.rotatePoint=Tt,m.scheduleIdle=Bn,m.scheduleYZIdle=oi,m.searchStringToRecord=Bh,m.selectFileInBrowser=vn,m.setColorScheme=gs,m.setCookie=Eh,m.setIntervalAccurate=Vo,m.setRem=_o,m.setTimeoutAccurate=ni,m.shadeColor=Dh,m.sharpen=Fl,m.signInCommon=ol,m.singletonDOMEventBus=et,m.stringHash=Hr,m.stringToBlob=Ws,m.stringToDOM=so,m.theme=gi,m.toBlackAndWhite=Pl,m.toBlue=Dl,m.toBlueAndGreen=Ll,m.toBlueAndGrey=Nl,m.toDegree=tt,m.toGreen=Il,m.toGreenAndGrey=Ol,m.toGrey=El,m.toGrey2=Tl,m.toOpposite=Ml,m.toRadian=O,m.toRed=Al,m.toRedAndBlue=_l,m.toRedAndGreen=kl,m.toRedAndGrey=Rl,m.transformPath2D=dh,m.trimURLHash=or,m.unpack=nl,m.verifyInCommon=hl,m.wxJsChooseImage=Du,m.wxJsDownloadImage=Lu,m.wxJsDownloadVoice=Vu,m.wxJsGetLocalImgData=Ru,m.wxJsGetLocation=ju,m.wxJsGetNetworkType=qu,m.wxJsOnVoicePlayEnd=Uu,m.wxJsOnVoiceRecordEnd=Fu,m.wxJsOpenLocation=Hu,m.wxJsPauseVoice=Xu,m.wxJsPay=$u,m.wxJsPlayVoice=Bu,m.wxJsPreviewImage=ku,m.wxJsScanQRCode=Wu,m.wxJsStartRecord=Ou,m.wxJsStopRecord=Nu,m.wxJsStopVoice=Yu,m.wxJsTranslateVoice=zu,m.wxJsUpdateAppMessageShareData=Au,m.wxJsUpdateTimelineShareData=Iu,m.wxJsUploadImage=_u,m.wxJsUploadVoice=Gu,m.yzCancelIdleCallback=Ho,m.yzRequestIdleCallback=Yn,Object.defineProperty(m,Symbol.toStringTag,{value:"Module"}),m}({});
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 s=this.getPeerName(t);this.trace(`${s} ${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 s=document.createElement("div");s.innerHTML=`<div>${e}, ${t}</div>`,document.getElementById("trace")?.appendChild(s)}getOtherPeer(t){return t===this.localPeerConnection?this.remotePeerConnection:this.localPeerConnection}getPeerName(t){return t===this.localPeerConnection?"localPeerConnection":"remotePeerConnection"}}class tu{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 aa(n,t){return!n||n.parentElement===null?t:aa(n.parentElement,t.concat([n]))}const zi=function(n,t){return getComputedStyle(n,null).getPropertyValue(t)},eu=function(n){return zi(n,"overflow")+zi(n,"overflow-y")+zi(n,"overflow-x")},su=function(n){return/(auto|scroll)/.test(eu(n))};function iu(n){if(!(n instanceof HTMLElement||n instanceof SVGElement))return;const t=aa(n.parentElement,[]);for(let e=0;e<t.length;e+=1)if(su(t[e]))return t[e];return document.scrollingElement||document.documentElement}const oa=[],ha={};function qi(n){oa.push(n)}function nu(n,t=!1){const e=ar();if(ha[e])return;wx.error(r=>{console.log(r.errMsg??JSON.stringify(r))}),wx.ready(()=>{oa.forEach(r=>r())});const s=["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(n,{debug:t,jsApiList:s,openTagList:i})),ha[e]=!0}function ru(n){return new Promise((t,e)=>{wx.checkJsApi({jsApiList:[n],success:function(s){s.checkResult[n]?t(!0):e(!1)},fail:function(){e(!1)}})})}function au(n){qi(function(){wx.updateAppMessageShareData(n)})}function ou(n){qi(function(){wx.updateTimelineShareData(n)})}function hu(n){wx.chooseImage(n)}function cu(n){wx.previewImage(n)}function lu(n){wx.uploadImage(n)}function uu(n){wx.downloadImage(n)}function du(n){wx.getLocalImgData(n)}function fu(){wx.startRecord()}function mu(n){wx.stopRecord(n)}function pu(n){wx.onVoiceRecordEnd(n)}function gu(n){wx.playVoice(n)}function yu(n){wx.pauseVoice(n)}function wu(n){wx.stopVoice(n)}function xu(n){wx.onVoicePlayEnd(n)}function bu(n){wx.uploadVoice(n)}function vu(n){wx.downloadVoice(n)}function Su(n){wx.translateVoice(n)}function Cu(n){wx.getNetworkType(n)}function Eu(n){wx.openLocation(n)}function Pu(n){wx.getLocation(n)}function Tu(n){wx.scanQRCode(n)}function _u(n,t,e){function s(){WeixinJSBridge.invoke("getBrandWCPayRequest",n,function(i){i.err_msg=="get_brand_wcpay_request:ok"?t():e(i.err_msg)})}typeof WeixinJSBridge>"u"?document.addEventListener?document.addEventListener("WeixinJSBridgeReady",s,!1):document.attachEvent&&(document.attachEvent("WeixinJSBridgeReady",s),document.attachEvent("onWeixinJSBridgeReady",s)):s()}function Du(n){window.AlipayJSBridge?n&&n():document.addEventListener("AlipayJSBridgeReady",n,!1)}function Ue(n,t){let e="未知错误";switch(n.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`${n.error}(${e}): ${n.errorMessage}`}function Au(n,t,e){ap.tradePay(Object.assign(n,{}),function(s){let i="未知错误";switch(s.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 Iu(n,t,e){ap.scan(Object.assign(n,{fail:s=>{e?.(Ue(s))}}),function(s){t?.(s.code)})}function ku(n,t,e){ap.getLocation(Object.assign(n,{fail:s=>{e?.(Ue(s))}}),function(s){t?.(s)})}function Mu(n,t,e){ap.openLocation(Object.assign(n,{fail:s=>{e?.(Ue(s))}}),function(){t?.()})}function Lu(n,t,e){ap.chooseImage(Object.assign(n,{fail:s=>{e?.(Ue(s,"chooseImage"))}}),function(s){t?.(s)})}function Ru(n,t,e){ap.previewImage(Object.assign(n,{fail:s=>{e?.(Ue(s))}}),function(){t?.()})}class Ou{map;constructor(t,e=120.619585,s=31.299379,i=18){this.map=new T.Map(t),this.map.centerAndZoom(new T.LngLat(e,s),i)}}class Nu{currentPage;itemsPerPage;entriesInterval;entriesEdge;linkTo;prevText;nextText;ellipseText;prevShowAlways;nextShowAlways;callback;totalPages;parentVNode;constructor(t,e,s){this.currentPage=s?.currentPage||0,this.itemsPerPage=s?.itemsPerPage||10,this.entriesInterval=s?.entriesInterval||5,this.entriesEdge=s?.entriesEdge||1,this.linkTo=s?.linkTo||"javascript:;",this.prevText=s?.prevText||"上一页",this.nextText=s?.nextText||"下一页",this.ellipseText=s?.ellipseText||"...",this.prevShowAlways=typeof s?.prevShowAlways=="boolean"?s?.prevShowAlways:!0,this.nextShowAlways=typeof s?.nextShowAlways=="boolean"?s?.nextShowAlways:!0,this.callback=s?.callback||(i=>!1),this.totalPages=Math.ceil(e/this.itemsPerPage),this.parentVNode=this.createParentVNode(),pe(this.parentVNode,t),this.selectPage(this.currentPage)}createParentVNode(){return Jt("div",{class:"pagination"},[])}appendVNode(t,e,s){e=e<0?0:e<this.totalPages?e:this.totalPages-1;const i=s?.text||String(e+1),r=s?.classes||"";t.children.push(e==this.currentPage&&r.indexOf("prev")==-1&&r.indexOf("next")==-1?Jt("span",{class:`current ${r}`},i):Jt("a",{class:r,href:this.linkTo.replace(/__id__/,String(e)),onClick:a=>this.selectPage(e,a)},i))}drawLinks(){const t=this.createParentVNode(),e=Math.ceil(this.entriesInterval/2),s=this.currentPage>e?Math.max(Math.min(this.currentPage-e,this.totalPages-this.entriesInterval),0):0,i=this.currentPage>e?Math.min(this.currentPage+e,this.totalPages):Math.min(this.entriesInterval,this.totalPages);if(this.prevText&&(this.currentPage>0||this.prevShowAlways)&&this.appendVNode(t,this.currentPage-1,{text:this.prevText,classes:"prev"}),s>0&&this.entriesEdge>0){const r=Math.min(this.entriesEdge,s);for(let a=0;a<r;a++)this.appendVNode(t,a);this.entriesEdge<s&&this.ellipseText&&t.children.push(Jt("span",{},this.ellipseText))}for(let r=s;r<i;r++)this.appendVNode(t,r);if(i<this.totalPages&&this.entriesEdge>0){this.totalPages-this.entriesEdge>i&&this.ellipseText&&t.children.push(Jt("span",{},this.ellipseText));const r=Math.max(this.totalPages-this.entriesEdge,i);for(let a=r;a<this.totalPages;a++)this.appendVNode(t,a)}this.nextText&&(this.currentPage<this.totalPages-1||this.nextShowAlways)&&this.appendVNode(t,this.currentPage+1,{text:this.nextText,classes:"next"}),ss(this.parentVNode,t),this.parentVNode=t}selectPage(t,e){this.currentPage=t=t<0?0:t<this.totalPages?t:this.totalPages-1,this.drawLinks();const s=this.callback(t);return e&&(s||(e.stopPropagation?e.stopPropagation():e.cancelBubble=!0)),s}prevPage(){return this.selectPage(this.currentPage-1)}nextPage(){return this.selectPage(this.currentPage+1)}}const ie={enabled:!1,files:{},add:function(n,t){this.enabled!==!1&&(this.files[n]=t)},get:function(n){if(this.enabled!==!1)return this.files[n]},remove:function(n){delete this.files[n]},clear:function(){this.files={}}};class Fu{isLoading=!1;itemsLoaded=0;itemsTotal=0;urlModifier;handlers=[];_onStart;_onLoad;_onProgress;_onError;constructor(t){this._onStart=t?.onStart,this._onLoad=t?.onLoad,this._onProgress=t?.onProgress,this._onError=t?.onError}itemStart(t){this.itemsTotal++,this.isLoading===!1&&this._onStart?.(t,this.itemsLoaded,this.itemsTotal),this.isLoading=!0}itemEnd(t){this.itemsLoaded++,this._onProgress?.(t,this.itemsLoaded,this.itemsTotal),this.itemsLoaded===this.itemsTotal&&(this.isLoading=!1,this._onLoad?.())}itemError(t){this._onError?.(t)}resolveURL(t){return this.urlModifier?this.urlModifier(t):t}setURLModifier(t){return this.urlModifier=t,this}addHandler(t,e){return this.handlers.push(t,e),this}removeHandler(t){const e=this.handlers.indexOf(t);return e!==-1&&this.handlers.splice(e,2),this}getHandler(t){for(let e=0,s=this.handlers.length;e<s;e+=2){const i=this.handlers[e],r=this.handlers[e+1];if(i.global&&(i.lastIndex=0),i.test(t))return r}return null}}const Yu=new Fu;class Bu{static DEFAULT_MATERIAL_NAME="__DEFAULT";manager;crossOrigin;withCredentials;path;resourcePath;requestHeader;constructor(t){this.manager=t!==void 0?t:Yu,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}load(t,e){}loadAsync(t,e){return new Promise((s,i)=>{this.load(t,{onLoad:s,onProgress:e,onError:i})})}parse(t){}setCrossOrigin(t){return this.crossOrigin=t,this}setWithCredentials(t){return this.withCredentials=t,this}setPath(t){return this.path=t,this}setResourcePath(t){return this.resourcePath=t,this}setRequestHeader(t){return this.requestHeader=t,this}}const Is=Bu;class Xu extends Is{constructor(t){super(t)}load(t,e){this.path!==void 0&&(t=this.path+t),t=this.manager.resolveURL(t);const s=ie.get(t);if(s!==void 0)return this.manager.itemStart(t),setTimeout(()=>{e?.onLoad?.(s),this.manager.itemEnd(t)},0),s;const i=A.createElementNS("img"),r=()=>{o(),ie.add(t,i),e?.onLoad?.(i),this.manager.itemEnd(t)},a=h=>{o(),e?.onError?.(h),this.manager.itemError(t),this.manager.itemEnd(t)};function o(){i.removeEventListener("load",r,!1),i.removeEventListener("error",a,!1)}return i.addEventListener("load",r,!1),i.addEventListener("error",a,!1),t.slice(0,5)!=="data:"&&this.crossOrigin!==void 0&&(i.crossOrigin=this.crossOrigin),this.manager.itemStart(t),i.src=t,i}}class Gu extends Is{isImageBitmapLoader=!0;options;constructor(t){super(t),typeof createImageBitmap>"u"&&console.warn("ImageBitmapLoader: createImageBitmap() not supported."),typeof fetch>"u"&&console.warn("ImageBitmapLoader: fetch() not supported."),this.options={premultiplyAlpha:"none"}}setOptions(t){return this.options=t,this}load(t,e){this.path!==void 0&&(t=this.path+t),t=this.manager.resolveURL(t);const s=ie.get(t);if(s!==void 0){if(this.manager.itemStart(t),s.then){s.then(r=>{e?.onLoad?.(r),this.manager.itemEnd(t)}).catch(r=>{e?.onError?.(r)});return}return setTimeout(()=>{e?.onLoad?.(s),this.manager.itemEnd(t)},0),s}const i=fetch(t,{credentials:this.crossOrigin==="anonymous"?"same-origin":"include",headers:this.requestHeader}).then(r=>r.blob()).then(r=>createImageBitmap(r,Object.assign(this.options,{colorSpaceConversion:"none"}))).then(r=>(ie.add(t,r),e?.onLoad?.(r),this.manager.itemEnd(t),r)).catch(r=>{e?.onError?.(r),ie.remove(t),this.manager.itemError(t),this.manager.itemEnd(t)});ie.add(t,i),this.manager.itemStart(t)}}const qt={};class Uu extends Error{response;constructor(t,e){super(t),this.response=e}}class ca extends Is{mimeType;responseType="";constructor(t){super(t),typeof fetch>"u"&&console.warn("FileLoader: fetch() not supported.")}load(t,e){this.path!==void 0&&(t=this.path+t),t=this.manager.resolveURL(t);const s=ie.get(t);if(s!==void 0)return this.manager.itemStart(t),setTimeout(()=>{e?.onLoad?.(s),this.manager.itemEnd(t)},0),s;if(qt[t]!==void 0){qt[t].push({onLoad:e?.onLoad,onProgress:e?.onProgress,onError:e?.onError});return}qt[t]=[],qt[t].push({onLoad:e?.onLoad,onProgress:e?.onProgress,onError:e?.onError});const i=new Request(t,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),r=this.mimeType,a=this.responseType;fetch(i).then(o=>{if(o.status===200||o.status===0){if(o.status===0&&console.warn("FileLoader: HTTP Status 0 received."),typeof ReadableStream>"u"||o.body===void 0||o.body?.getReader===void 0)return o;const h=qt[t],c=o.body.getReader(),l=o.headers.get("X-File-Size")||o.headers.get("Content-Length"),d=l?parseInt(l):0,g=d!==0;let y=0;const m=new ReadableStream({start(x){b();function b(){c.read().then(({done:S,value:C})=>{if(S)x.close();else{y+=C.byteLength;const L=new ProgressEvent("progress",{lengthComputable:g,loaded:y,total:d});for(let R=0,X=h.length;R<X;R++)h[R].onProgress?.(L);x.enqueue(C),b()}},S=>{x.error(S)})}}});return new Response(m)}else throw new Uu(`fetch for "${o.url}" responded with ${o.status}: ${o.statusText}`,o)}).then(o=>{switch(a){case"arraybuffer":return o.arrayBuffer();case"blob":return o.blob();case"document":return o.text().then(h=>new DOMParser().parseFromString(h,r));case"json":return o.json();default:if(r===void 0)return o.text();{const c=/charset="?([^;"\s]*)"?/i.exec(r),l=c&&c[1]?c[1].toLowerCase():void 0,d=new TextDecoder(l);return o.arrayBuffer().then(g=>d.decode(g))}}}).then(o=>{ie.add(t,o);const h=qt[t];delete qt[t];for(let c=0,l=h.length;c<l;c++)h[c].onLoad?.(o)}).catch(o=>{const h=qt[t];if(h===void 0)throw this.manager.itemError(t),o;delete qt[t];for(let c=0,l=h.length;c<l;c++)h[c].onError?.(o);this.manager.itemError(t)}).finally(()=>{this.manager.itemEnd(t)}),this.manager.itemStart(t)}setResponseType(t){return this.responseType=t,this}setMimeType(t){return this.mimeType=t,this}}class Vu extends Is{constructor(t){super(t)}load(t,e){const s=new ca(this.manager);s.setResponseType("arraybuffer"),s.setPath(this.path),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials),s.load(t,{onLoad:i=>{try{const r=i.slice(0);new AudioContext().decodeAudioData(r,o=>{e?.onLoad?.(o)}).catch(o=>{e?.onError?.(o),this.manager.itemError(t)})}catch(r){e?.onError?.(r),this.manager.itemError(t)}},onProgress:e?.onProgress,onError:e?.onError})}}return p.Arrow=Ll,p.AudioLoader=Vu,p.BezierEasing=ui,p.CSSToJSEasing=$o,p.Clock=mi,p.Color=lt,p.CommonKeyCode=lh,p.Confetti=$l,p.ControlsColorPattern=he,p.Cross=Bl,p.CustomCanvasContext=Te,p.CustomCanvasGradient=cs,p.CustomCanvasPattern=si,p.DOMEventBus=er,p.DOMKey=tr,p.DOMParse=sr,p.DOMSVGUtil=ae,p.DOMToBlob=vn,p.DOMToString=Zs,p.DOMUtil=A,p.DOMVideo=Le,p.Easing=I,p.Ellipse=sa,p.FetchWithAxios=Gc,p.FetchWithAxiosRequestCancel=zr,p.FileLoader=ca,p.Fox=Rl,p.Heart=Ol,p.HeartVariant=Nl,p.ImageBitmapLoader=Gu,p.ImageLoader=Xu,p.Interpolation=Xt,p.Line=ce,p.LinePicture=Ml,p.LineQuadraticBezier=Il,p.Matrix=ct,p.Matrix3D=pt,p.NormalColors=nr,p.Pagination=Nu,p.Point=Vt,p.Point3D=Me,p.Point3Ds=Wl,p.Points=ea,p.QRCode=se,p.Rabbit=Yl,p.Rect=zt,p.Ring=Ui,p.RingIndicator=ql,p.SVGParse=ta,p.SVGParsedPathArgsLength=Ae,p.Sector=Gl,p.SectorArc=na,p.Segment=zl,p.Shape=U,p.ShapeCombo=Vi,p.ShapeGroup=rt,p.Ship=Ul,p.Slider=Vl,p.Star=Fl,p.TWEEN=ih,p.Text=Ge,p.Timeline=ps,p.Tip=ia,p.Tree=Xl,p.Tween=fi,p.WebGLRenderer=tu,p.WebRTCClient=Ql,p.WebSocketClient=Ja,p.YZCanvas=Kl,p.YZCanvasContext=ls,p.YZMessageChannel=Ph,p.YZSVG=kl,p.YZWorker=Eh,p.addWatermark=El,p.addWxJsReadyFnBeforeConfig=qi,p.ajax=Th,p.aliJsChooseImage=Lu,p.aliJsGetLocation=ku,p.aliJsOpenLocation=Mu,p.aliJsPreviewImage=Ru,p.aliJsReady=Du,p.aliJsScan=Iu,p.aliJsTradePay=Au,p.angle=Zt,p.appendURL=bi,p.appendURLRecord=Ch,p.base64EncodeOutputStream=Wr,p.bitmapMapper=ra,p.blobToRawImage=Jc,p.byteArrayOutputStream=Yi,p.canDrawBitmap=Rn,p.canUsePaths=vo,p.canUseWorker=Ln,p.changeBrightness=Sl,p.changeDiaphaneity=Cl,p.changeSize=vl,p.checkWxJsApi=ru,p.clearCookies=xh,p.color=Re,p.computeImageDisplayRect=Uc,p.createXMLHttpRequest=cr,p.distance=as,p.distance2=os,p.drawBitmapInCanvas=Zl,p.drawQRCodeToCanvas=Al,p.easeNameToCubicBezier=di,p.fileOrBlobToDataURL=Ni,p.flipSideToSide=Kc,p.flipUpsideDown=Qc,p.flushURL=hr,p.flushURLRecord=Sh,p.formDataToString=or,p.fpsTask=No,p.getBitmapFromCanvas=Jl,p.getBodyPosition=Ka,p.getBrowserClient=Qs,p.getBrowserClientVersion=ao,p.getBrowserLanguage=ho,p.getColorScheme=ir,p.getCookie=yh,p.getCookieObject=wh,p.getDOMMatrix=gi,p.getDirection=To,p.getDocumentElementPosition=Ee,p.getElementPositionInPage=Pn,p.getElementPositionInPage2=eo,p.getElementPositionInViewport=Tn,p.getFileExtension=Cn,p.getFileTypeFromFile=$a,p.getFilesImageInfo=zc,p.getFormSubmitData=_h,p.getImageAspectRatio=Vc,p.getImageDataByAIData=Tl,p.getImageDataFromBitmap=Hc,p.getImageDataFromUrl=qr,p.getImageDataFromVideo=qc,p.getImageMainColor=Zc,p.getInternetExplorerVersion=An,p.getMousePositionInElement=Pt,p.getMousePositionInPage=_n,p.getMousePositionInViewport=no,p.getOperatingSystem=is,p.getOperatingSystemVersion=ro,p.getPageSize=to,p.getRawImageInfo=As,p.getRelativeBoundingClientRect=so,p.getScreenPosition=Za,p.getScrollParent=iu,p.getTimeZone=co,p.getURL=ys,p.getUserGeolocationPromise=oo,p.getVerticalScrollPercentInPage=io,p.getViewportSize=Qa,p.gifImage=$r,p.h=Jt,p.hasDocument=wo,p.hasHistory=xo,p.hasWindow=Mn,p.imageDataToBitmap=jc,p.imageDataToBlob=$c,p.imageDataToDataURL=Wc,p.injectWxJsConfig=nu,p.isAliBrowser=kn,p.isAliMiniProgram=yo,p.isAndroid=Dn,p.isAppleDevice=lo,p.isBrowserSupportFileAPI=bo,p.isDarkMode=fo,p.isElement=So,p.isIE=mo,p.isIE9or10=po,p.isIOS=ti,p.isMacOS=ei,p.isMobile=uo,p.isNative=ns,p.isURL=bh,p.isWxBrowser=In,p.isWxMiniProgram=go,p.jpgToPng=yl,p.leftRotate=tl,p.length=rs,p.linkExport=Ks,p.localstorage=yi,p.mapTDTJSSDK=Ou,p.marginSharpen=gl,p.microTask=Xo,p.mosaic=Pl,p.mount=pe,p.multiplyArrayOfMatrix=rh,p.multiplyArrayOfMatrix3D=ah,p.multiplyMatrix=Zn,p.multiplyMatrix3D=Kn,p.nextTick=Bo,p.normalizePoint=Po,p.objectSignature=Vr,p.onDocumentReady=ph,p.outputGifBase64=Jr,p.outputQRCodeBase64=Dl,p.parseTransformToMatrix=pi,p.parseURL=rr,p.patch=ss,p.patchDOM=En,p.pngToJpg=wl,p.polar=It,p.prefixes=Co,p.radiusClip=bl,p.readFileInBrowser=es,p.recordToString=ws,p.rectClip=xl,p.requestAnimationFrameCycle=ri,p.reverseCSSToJSEasing=Jo,p.reverseEaseNameToCubicBezier=jn,p.reverseEasing=Un,p.rightRotate=el,p.rotatePoint=Tt,p.scheduleIdle=Bn,p.scheduleYZIdle=ci,p.selectFileInBrowser=Sn,p.setColorScheme=gs,p.setCookie=gh,p.setIntervalAccurate=Oo,p.setRem=Eo,p.setTimeoutAccurate=ai,p.sharpen=pl,p.signature=Ur,p.singletonDOMEventBus=nt,p.stringToBlob=Js,p.stringToDOM=Wa,p.stringToRecord=vh,p.theme=wi,p.toBlackAndWhite=nl,p.toBlue=hl,p.toBlueAndGreen=ul,p.toBlueAndGrey=ml,p.toDegree=it,p.toGreen=ol,p.toGreenAndGrey=fl,p.toGrey=sl,p.toGrey2=il,p.toOpposite=rl,p.toRadian=O,p.toRed=al,p.toRedAndBlue=ll,p.toRedAndGreen=cl,p.toRedAndGrey=dl,p.transformPath2D=nh,p.trimURLHash=ar,p.wxJsChooseImage=hu,p.wxJsDownloadImage=uu,p.wxJsDownloadVoice=vu,p.wxJsGetLocalImgData=du,p.wxJsGetLocation=Pu,p.wxJsGetNetworkType=Cu,p.wxJsOnVoicePlayEnd=xu,p.wxJsOnVoiceRecordEnd=pu,p.wxJsOpenLocation=Eu,p.wxJsPauseVoice=yu,p.wxJsPay=_u,p.wxJsPlayVoice=gu,p.wxJsPreviewImage=cu,p.wxJsScanQRCode=Tu,p.wxJsStartRecord=fu,p.wxJsStopRecord=mu,p.wxJsStopVoice=wu,p.wxJsTranslateVoice=Su,p.wxJsUpdateAppMessageShareData=au,p.wxJsUpdateTimelineShareData=ou,p.wxJsUploadImage=lu,p.wxJsUploadVoice=bu,p.yzCancelIdleCallback=Yo,p.yzRequestIdleCallback=Gn,Object.defineProperty(p,Symbol.toStringTag,{value:"Module"}),p}({});
46
46
  //# sourceMappingURL=zyzgroup_core_web.iife.js.map