@zyzgroup/core-web 0.1.65 → 0.1.66
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/animate_ce.css +2 -0
- package/dist/zyzgroup_core_web.iife.js +18 -18
- package/dist/zyzgroup_core_web.iife.js.map +1 -1
- package/dist/zyzgroup_core_web.js +5183 -4944
- package/dist/zyzgroup_core_web.js.map +1 -1
- package/dist/zyzgroup_core_web.umd.cjs +18 -18
- package/dist/zyzgroup_core_web.umd.cjs.map +1 -1
- package/package.json +1 -1
- package/types/Context.d.ts.map +1 -1
- package/types/animate/schedule.d.ts.map +1 -1
- package/types/color.d.ts +2 -2
- package/types/color.d.ts.map +1 -1
- package/types/hooks/useAttribute.d.ts.map +1 -1
- package/types/hooks/useDraw/DrawContext.d.ts +55 -0
- package/types/hooks/useDraw/DrawContext.d.ts.map +1 -0
- package/types/hooks/useDraw/canvas/CustomCanvasContext.d.ts.map +1 -1
- package/types/hooks/useDraw/index.d.ts +1 -1
- package/types/hooks/useDraw/index.d.ts.map +1 -1
- package/types/hooks/useDraw/shapes/EllipseShape.d.ts +23 -0
- package/types/hooks/useDraw/shapes/EllipseShape.d.ts.map +1 -0
- package/types/hooks/useDraw/shapes/LineShape.d.ts +6 -0
- package/types/hooks/useDraw/shapes/LineShape.d.ts.map +1 -1
- package/types/hooks/useDraw/shapes/RingIndicatorShapeCombo.d.ts +36 -0
- package/types/hooks/useDraw/shapes/RingIndicatorShapeCombo.d.ts.map +1 -0
- package/types/hooks/useDraw/shapes/RingShape.d.ts +36 -0
- package/types/hooks/useDraw/shapes/RingShape.d.ts.map +1 -0
- package/types/hooks/useDraw/shapes/index.d.ts +3 -0
- package/types/hooks/useDraw/shapes/index.d.ts.map +1 -1
- package/types/hooks/useElement.d.ts.map +1 -1
- package/types/hooks/useElementEvents.d.ts +2 -2
- package/types/hooks/useElementEvents.d.ts.map +1 -1
- package/types/hooks/useEventListener.d.ts.map +1 -1
- package/types/hooks/useFetch.d.ts.map +1 -1
- package/types/hooks/useIntersection.d.ts +1 -2
- package/types/hooks/useIntersection.d.ts.map +1 -1
- package/types/hooks/useLocale/useLocale.d.ts +2 -2
- package/types/hooks/useLocale/useLocale.d.ts.map +1 -1
- package/types/hooks/useMutation.d.ts +0 -1
- package/types/hooks/useMutation.d.ts.map +1 -1
- package/types/hooks/useResize.d.ts +0 -1
- package/types/hooks/useResize.d.ts.map +1 -1
- package/types/hooks/useStyle.d.ts.map +1 -1
- package/types/hooks/useTimestampValue.d.ts.map +1 -1
- package/types/hooks/useVisible.d.ts.map +1 -1
- package/types/hooks/useVnode.d.ts +3 -2
- package/types/hooks/useVnode.d.ts.map +1 -1
- package/types/image/image.d.ts +1 -1
- package/types/image/image.d.ts.map +1 -1
- package/types/math/shapes/Ring.d.ts.map +1 -1
- package/types/vnode.d.ts +1 -0
- package/types/vnode.d.ts.map +1 -1
- package/types/hooks/useDraw/useDraw.d.ts +0 -20
- package/types/hooks/useDraw/useDraw.d.ts.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var ZYZGroupCoreWeb=function(
|
|
1
|
+
var ZYZGroupCoreWeb=function(d){"use strict";const _l={};function Sl(){return typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:this||_l}const Ct=Sl(),Cl="@YZ/";function di(s,t=Cl){return s.startsWith(t)?s:`${t}${s}`}function mi(s){return typeof s=="string"&&s.startsWith("Symbol(")&&s.endsWith(")")}function pi(s){return mi(s)&&(s=s.slice(7,-1)),s}function rs(s){return s=pi(s),s=di(s),typeof Symbol=="function"?Symbol(s):`Symbol(${s})`}const vn=rs("TIMESTAMP"),Tl=rs("META");function El(s,t){const e=t.toString();if(!mi(e))return!1;if(s&&typeof s=="object"){if(pi(e)=="")return t in s;for(const n of Reflect.ownKeys(s))if(n.toString()==e)return!0;return!1}return!1}function ra(s){if(!mi(s))return s;switch(s=pi(s),s){case di("TIMESTAMP"):return vn;case di("META"):return Tl;default:return rs(s)}}function gi(s){if(Array.isArray(s))return s.map(gi);if(s&&typeof s=="object"){const t={};for(const e of Reflect.ownKeys(s)){const n=s[e];t[typeof e=="symbol"?e.toString():e]=typeof n=="symbol"?n.toString():gi(n)}return t}return typeof s=="symbol"?s.toString():s}function yi(s){if(Array.isArray(s))return s.map(yi);if(s&&typeof s=="object"){const t={};for(const e of Object.keys(s))t[ra(e)]=yi(s[e]);return t}return ra(s)}function wi(s){return JSON.stringify(gi(s))}const xi=wi;function oa(s){return yi(JSON.parse(s))}var Tt=(s=>(s.UNKNOWN="",s.TEXT="text/plain",s.MD="text/plain",s.HTML="text/html",s.XML_TEXT="text/xml",s.CSS="text/css",s.JPEG="image/jpeg",s.PNG="image/png",s.GIF="image/gif",s.BMP="image/bmp",s.WEBP="image/webp",s.SVG="image/svg+xml",s.ICON="image/x-icon",s.MICROSOFT_ICON="image/vnd.microsoft.icon",s.MPEG="audio/mpeg",s.MP3="audio/mpeg",s.MP4="video/mp4",s.OGG="audio/ogg",s.WAV="audio/wav",s.MIDI="audio/midi",s.WEBM="video/webm",s.VIDEO_OGG="video/ogg",s.OCTET_STREAM="application/octet-stream",s.JAVASCRIPT="application/javascript",s.ECMASCRIPT="application/ecmascript",s.JSON="application/json",s.XML="application/xml",s.XHTML="application/xhtml+xml",s.XWWW="application/x-www-form-urlencoded",s.DOC="application/msword",s.CSV="application/x-csv",s.EXCEL="application/vnb.ms-excel",s.PPT="application/vnb.mspowerpoint",s.PDF="application/pdf",s.ZIP="application/zip",s.TGZ="application/x-gtar",s.TAR_GZ="application/x-gzip",s.EOT="appliaction/vnd.ms-fontobject",s.TTF="aplication/font-sfnt",s.PKCS12="aplication/pkcs12",s))(Tt||{}),os=(s=>(s.ascii="ascii",s.utf8="utf8",s.utf16le="utf16le",s.ucs2="ucs2",s.base64="base64",s.base64url="base64url",s.latin1="latin1",s.binary="binary",s.hex="hex",s))(os||{}),Xt=(s=>(s.text="text",s.dataURL="dataURL",s.binaryString="binaryString",s.arraybuffer="arraybuffer",s))(Xt||{});function Pl(s,t=(e,n)=>e<=n){const e=s.length;let n=Math.floor(e/2);for(;n>0;){for(let i=n;i<e;i++){const r=s[i];let o=i;for(;o>=n&&!t(s[o-n],r);)s[o]=s[o-n],o-=n;s[o]=r}n=Math.floor(n/2)}}const as=s=>{let t=null;switch(s){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(as("regexp"),"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");break;case"svg-segment":t=/([mlhvzaqtcs])([^mlhvzaqtcs]*)/gi;break;case"mobile-china":t=/^[1]{1}[0-9]{10}$/;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,24 +7,24 @@ var ZYZGroupCoreWeb=function(m){"use strict";const _l={};function Sl(){return ty
|
|
|
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},ce=(s,t)=>(typeof s=="string"&&(s=is(s)||new RegExp(s)),s.test(t)),sa=(s,t)=>{typeof s=="string"&&(s=is(s)||new RegExp(s));const e=t.match(s);return e?s.flags.toLowerCase().indexOf("g")>=0?e.map(n=>({matchIndex:-1,fullMatch:n,groupMatchs:[]})):{matchIndex:typeof e.index=="number"?e.index:-1,fullMatch:e[0],groupMatchs:e.slice(1)}:null},ia=(s,t)=>{typeof s=="string"&&(s=is(s)||new RegExp(s));const e=[],n=t.matchAll(s);for(const i of n)e.push({matchIndex:typeof i.index=="number"?i.index:-1,fullMatch:i[0],groupMatchs:i.slice(1)});return e};function Ml(s){const t=s.match(/[\s\S]/gu);return t?t.length:0}function ra(s,t){const e=s.codePointAt(t);return e?String.fromCodePoint(e):void 0}function rs(s=12){const t="ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghijklmnopqrstuvwxyz0123456789",e=t.length;let n="";for(let i=0;i<s;i++)n+=t[Math.floor(Math.random()*e)];return n}function Al(s){return s.replace(/(^\w)/g,t=>t.toLowerCase())}const xt=(s,t="-")=>{let e=s.replace(new RegExp(`${t}?([A-Z])`,"g"),t+"$1").toLowerCase();return e=e.replace(new RegExp(`^${t}`),""),e};function kl(s){return s.replace(/(^\w|[_-]\w)/g,t=>t.slice(-1).toUpperCase())}function oa(s){return Al(kl(s))}function aa(s){let t="";for(let e=0,n=s.length;e<n;e++){const i=s.charCodeAt(e);i>=1&&i<=127?t+=s.charAt(e):i>2047?(t+=String.fromCharCode(224|i>>12&15),t+=String.fromCharCode(128|i>>6&63),t+=String.fromCharCode(128|i>>0&63)):(t+=String.fromCharCode(192|i>>6&31),t+=String.fromCharCode(128|i>>0&63))}return t}function Il(s){return s.slice(0)}function Dl(s,t=!0){const e=t?Il(s.buffer):s.buffer;return new s.constructor(e,s.byteOffset,s.length)}const Rl="[object Undefined]",Ll="[object Null]",Ol="[object Boolean]",zl="[object Number]",Fl="[object BigInt]",ca="[object String]",ha="[object Symbol]",Bl="[object Array]";function os(s){return Object.prototype.toString.call(s)}function Nl(s){return s!=null}function Yl(s){return os(s)===ca}function Ul(s){return s===s+0}function Xl(s){return os(s)===ha}function $l(s){const t=os(s);return t===Rl||t===Ll||t===Ol||t===zl||t===ca||t===ha||t===Fl}function Vl(s){return os(s)===Bl}function Gl(s){return!!s&&typeof s=="object"}function ua(s){return Gl(s)&&!Vl(s)}function la(s,...t){return new s.constructor(...t)}function bn(s){if(!ua(s))return""+s;const t=[];for(const e in s)Object.prototype.hasOwnProperty.call(s,e)&&(ua(s[e])?t.push(bn(s[e])):t.push(`${e}: ${s[e]}`));return`{ ${t.join(", ")} }`}function ql(s,t="",e=["","sign","key"]){return Object.keys(s).filter(n=>{for(let i=0,r=e.length;i<r;i++)if(s[n]==e[i])return!1;return!0}).sort().map(n=>`${n}=${s[n]}`).join("&")+t}function jl(s=[],t=[]){const e=s.length,n=t.length;for(let r=0;r<n;r++)s[r]=t[r];let i=Math.max(0,e-n);for(;i>0;)s.pop(),i--;return s}function Le(s,t){const e=s.findIndex(n=>n===t);return e>=0&&s.splice(e,1),s}function fa(s,t){return s.findIndex(e=>e==t)>=0}function Hl(s,...t){return t.forEach(e=>{fa(s,e)||s.push(e)}),s}let da;try{da=Map}catch{da=function(){}}let ma;try{ma=Set}catch{ma=function(){}}function Ht(s,t){const e=parseFloat(s);if(Number.isNaN(e)){if(typeof t=="number")return t;throw new Error(`"${s}" is NaN!`)}return e}function pa(s,t,e=Number.EPSILON*Math.pow(2,2)){return Math.abs(s-t)<e}function B(s,t,e){const n=Math.min(t,e),i=Math.max(t,e);return s<n?n:s>i?i:s}function Wl(s,t){return(s%t+t)%t}function as(s,t,e){return(1-e)*s+e*t}function Jl(s,t,e){const n=s.length,i=new Array(n);for(let r=0;r<n;r++)i[r]=Q(as(s[r],t[r],e),6);return i}const Zl=(s,t,e)=>n=>{const i=B(n,s,t);return e==0?i:t-i<e?t:Math.round(i/e)*e};function Ql(s,t=12){return Ht(s,0).toFixed(t)}function Q(s,t=12){return+Ql(s,t)}function Kl(s,t){const e=sa("number-single",String(s));return{hasNumber:!!e,number:e&&!Array.isArray(e)&&e.fullMatch?parseFloat(e.fullMatch):Nl(t)?t:NaN,prefix:e&&!Array.isArray(e)&&e.fullMatch?s.substring(0,e.matchIndex):"",suffix:e&&!Array.isArray(e)&&e.fullMatch?s.substring(e.matchIndex+e.fullMatch.length):""}}function wi(s){const t=sa("number",s);return t?Array.isArray(t)?t.map(e=>Number(e.fullMatch)):[Number(t.fullMatch)]:[]}const en=(s,t=16)=>{let e=s.toLowerCase();const n=e.indexOf("0b")==0,i=e.indexOf("0o")==0,r=e.indexOf("0x")==0;(n||i||r)&&(e=e.slice(2)),n&&(t=2),i&&(t=8),r&&(t=16);const o=parseInt(e,t);if(isNaN(o))throw new Error(`radixStringToNumber(${s}, ${t}) 无法解析!`);return o};function tf(s){return new TextEncoder().encode(s)}function ef(s){return String.fromCharCode.apply(null,new Uint16Array(s))}const xi=(s,t,e)=>t?e===ss.base64?new Blob([s],{type:`${t};${e}`}):e===ss.utf8?new Blob([s],{type:`${t};charset=${e}`}):new Blob([s],{type:`${t}`}):new Blob([s]),nf=s=>{let t=Et.UNKNOWN;switch(new DataView(s).getUint32(0,sf()).toString(16).toUpperCase()){case"FFD8FFDB":t=Et.JPEG;break;case"FFD8FFE0":case"FFD8FFE1":case"FFD8FFE2":case"FFD8FFE3":t=Et.JPEG;break;case"89504E47":t=Et.PNG;break;case"47494638":t=Et.GIF;break;case"52494646":t=Et.WEBP;break;case"25504446":t=Et.PDF;break;case"504B0304":t=Et.ZIP;break}return t};function sf(){const s=Uint32Array.of(305419896),t=new Uint8Array(s.buffer);switch(t[0]*16777216+t[1]*65536+t[2]*256+t[3]){case 305419896:return!1;case 2018915346:return!0}}function ht(){return(performance||Date).now()}function se(s=new Date){return s.getTime()}function rf(s,t=3){const e=Math.max(s.length,6);let n="";for(let r=0;r<e-4;r++)n+=s[r]||"0";const i=[n,""+(s[e-4]||"0")+(s[e-3]||"0"),""+(s[e-2]||"0")+(s[e-1]||"0")];switch(t){case 1:return i[0];case 2:return i[0]+":"+i[1];case 3:return i[0]+":"+i[1]+":"+i[2]}}function of(s){const t=Math.max(s.length,6);let e=0;e+=(s[t-2]||0)*10+(s[t-1]||0),e+=((s[t-4]||0)*10+(s[t-3]||0))*60;let n=0;for(let i=0;i<t-4;i++)n=n*10+(s[i]||0);return e+=n*60*60,Math.floor(Math.max(0,e))}function af(s,t=!1){let e=0;typeof s=="number"?e=s:e=of(s);const n=[],i=e%60;n.unshift(i%10),n.unshift(Math.floor(i/10)),e=Math.floor(e/60);const r=e%60;if(n.unshift(r%10),n.unshift(Math.floor(r/10)),e=Math.floor(e/60),t){const o=e%100;for(n.unshift(o%10),n.unshift(Math.floor(o/10)),e=Math.floor(e/100);e;)n.unshift(e%10),e=Math.floor(e/10)}else{const o=e%24;n.unshift(o%10),n.unshift(Math.floor(o/10))}return n}function cf(s,t=1,e=!1){return s[s.length-1]+=t,af(s,e)}const hf=1,uf=3,bi=4;function lf(s=10,t=bi){let e=new Array(s),n=0,i=0,r=0;const o=l=>{e[i]=l,i=(i+1)%s,n++},a=l=>{if(n<s)return o(l);{let d;switch(t){case hf:throw new Error(`RingQueue limit(${s}) overflow!`);case uf:o(l),n--,r=i;break;case bi:d=2*s,e=u(),n=e.length,i=e.length,r=0,e.length=d,s=d,o(l);break}}},c=()=>{if(n!=0){const l=e[r];return e[r]=void 0,n--,r=(r+1)%s,l}},h=()=>{e=[],n=0,i=0,r=0},u=()=>{const l=[...e];return h(),l};return{queue:e,length:n,isEmpty:()=>n==0,findIndex:l=>e.findIndex(l),deleteIndex:l=>{const d=e.splice(l,1);return d.length&&(n--,i=(i-1+s)%s,r==l&&(r=(r+1)%s)),!!d.length},delete:function(l){const d=this.findIndex(l);return d>-1?this.deleteIndex(d):!1},enqueue:a,push:a,put:a,dequeue:c,pop:c,take:c,peek:()=>e[r],index:l=>e[l],clear:h,flush:u}}const ff=s=>lf(s,bi);class cs{_maps=new Map;_mapsAddedDuringUpdate=new Map;_overflow;constructor(t){this._overflow=()=>{if(!t)return!1;const e=this.length;return e==0?!1:t?.overflow?t.overflow():!!t.size&&t.size>0&&e>=t.size}}entries(){return Array.from(this._maps.entries())}keys(){return Array.from(this._maps.keys())}values(){return Array.from(this._maps.values())}json(){return this.entries().reduce((t,[e,n])=>((Yl(e)||Ul(e)||Xl(e))&&(t[e]=n),t),{})}get length(){return this.entries().length}set(t,e){for(;this._overflow();){const n=this._maps.keys().next();n.done||this.delete(n.value)}this._maps.set(t,e),this._mapsAddedDuringUpdate.set(t,e)}get(t){return this._maps.get(t)}has(t){return this._maps.has(t)}getIndex(t){const e=this.entries();if(e.length&&e[t])return e[t]}top(){return this.getIndex(0)}shift(){const t=this.top();if(t){const[e]=t;this.delete(e)}return t}delete(t){return this._mapsAddedDuringUpdate.delete(t),this._maps.delete(t)}clear(){this._maps.clear(),this._mapsAddedDuringUpdate.clear()}flush(){this.clear()}filter(t){let e=Array.from(this._maps.entries());for(;e.length>0;){this._mapsAddedDuringUpdate.clear();for(let n=0,i=e.length;n<i;n++){const[r,o]=e[n];t(r,o)===!1&&this.delete(r)}e=Array.from(this._mapsAddedDuringUpdate.entries())}}}class ga{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())}json(){return this.entries().reduce((t,[e,n])=>(t[e]=n,t),{})}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)}has(t){return this.maps.has(t)}getEntryFromIndex(t){return this.entries()[t]}firstEntry(){return this.getEntryFromIndex(0)}shift(){const t=this.firstEntry();if(t){const[e]=t;this.delete(e)}return t}delete(t){return this.mapsAddedDuringUpdate.delete(t),this.maps.delete(t)}clear(){this.mapsAddedDuringUpdate.clear(),this.maps.clear()}async update(t){let e=Array.from(this.maps.entries());for(;e.length>0;){this.mapsAddedDuringUpdate.clear();for(let n=0,i=e.length;n<i;n++){const[r,o]=e[n];await t(r,o)===!1&&this.delete(r)}e=Array.from(this.mapsAddedDuringUpdate.entries())}}}function df(){Tt.OPEN_LOG=!0}function mf(){Tt.OPEN_LOG=!1}function pf(s){Tt.LOG_UPLOAD_FN=s}function ya(){return Tt.OPEN_LOG||!1}function wa(s,t){const e=Tt.LOG_UPLOAD_FN;e&&e(s,t)}function nn(s){wa("info",s),ya()&&(!console||typeof console!="object"||typeof console.log!="function"||console.log(s))}function gf(s){wa("warn",s),ya()&&(!console||typeof console!="object"||typeof console.warn!="function"||console.warn(s))}const xa=()=>{};function vi(s,t=3,e,n){return async function(...i){const r=`retry(${s.name})(${i.map(bn)})`;let o;for(let a=0;a<t;a++)try{return await s.call(n||this,...i)}catch(c){nn(`(${r}) 第 ${a+1} 次尝试失败, retrying...`),o=c,await new Promise(h=>setTimeout(h,typeof e=="number"?e:300*Math.pow(2,a)))}throw nn(`(${r}) 已 ${t} 次失败,不再重试。 Last error: ${bn(o)}`),o}}function _i(s,t=60,e=new ga,n){return async function(...i){const r=`cache(${s.name})(${i.map(bn)})`,o=Date.now();t&&e.update((h,u)=>o-u.timestamp<t*1e3);const a=yi(i),c=e.get(a);if(c){if(!t||o-c.timestamp<t*1e3)return nn(`${r} 击中缓存`),c.value;e.delete(a)}try{nn(`${r} 没有缓存, 尝试立即执行...`);const h=await s.call(n||this,...i);return nn(`${r} 缓存设置成功`),e.set(a,{value:h,timestamp:Date.now()}),h}catch(h){throw nn(`${r} 执行失败 : ${bn(h)}`),h}}}var Si=function(s,t){return Si=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])},Si(s,t)};function Ci(s,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");Si(s,t);function e(){this.constructor=s}s.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}function ba(s){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&s[t],n=0;if(e)return e.call(s);if(s&&typeof s.length=="number")return{next:function(){return s&&n>=s.length&&(s=void 0),{value:s&&s[n++],done:!s}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function Ti(s,t){var e=typeof Symbol=="function"&&s[Symbol.iterator];if(!e)return s;var n=e.call(s),i,r=[],o;try{for(;(t===void 0||t-- >0)&&!(i=n.next()).done;)r.push(i.value)}catch(a){o={error:a}}finally{try{i&&!i.done&&(e=n.return)&&e.call(n)}finally{if(o)throw o.error}}return r}function Ei(s,t,e){if(e||arguments.length===2)for(var n=0,i=t.length,r;n<i;n++)(r||!(n in t))&&(r||(r=Array.prototype.slice.call(t,0,n)),r[n]=t[n]);return s.concat(r||Array.prototype.slice.call(t))}function he(s){return typeof s=="function"}function yf(s){var t=function(n){Error.call(n),n.stack=new Error().stack},e=s(t);return e.prototype=Object.create(Error.prototype),e.prototype.constructor=e,e}var Pi=yf(function(s){return function(t){s(this),this.message=t?t.length+` errors occurred during unsubscription:
|
|
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},he=(s,t)=>(typeof s=="string"&&(s=as(s)||new RegExp(s)),s.test(t)),aa=(s,t)=>{typeof s=="string"&&(s=as(s)||new RegExp(s));const e=t.match(s);return e?s.flags.toLowerCase().indexOf("g")>=0?e.map(n=>({matchIndex:-1,fullMatch:n,groupMatchs:[]})):{matchIndex:typeof e.index=="number"?e.index:-1,fullMatch:e[0],groupMatchs:e.slice(1)}:null},ha=(s,t)=>{typeof s=="string"&&(s=as(s)||new RegExp(s));const e=[],n=t.matchAll(s);for(const i of n)e.push({matchIndex:typeof i.index=="number"?i.index:-1,fullMatch:i[0],groupMatchs:i.slice(1)});return e};function Ml(s){const t=s.match(/[\s\S]/gu);return t?t.length:0}function ca(s,t){const e=s.codePointAt(t);return e?String.fromCodePoint(e):void 0}function hs(s=12){const t="ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghijklmnopqrstuvwxyz0123456789",e=t.length;let n="";for(let i=0;i<s;i++)n+=t[Math.floor(Math.random()*e)];return n}function Al(s){return s.replace(/(^\w)/g,t=>t.toLowerCase())}const wt=(s,t="-")=>{let e=s.replace(new RegExp(`${t}?([A-Z])`,"g"),t+"$1").toLowerCase();return e=e.replace(new RegExp(`^${t}`),""),e};function kl(s){return s.replace(/(^\w|[_-]\w)/g,t=>t.slice(-1).toUpperCase())}function ua(s){return Al(kl(s))}function la(s){let t="";for(let e=0,n=s.length;e<n;e++){const i=s.charCodeAt(e);i>=1&&i<=127?t+=s.charAt(e):i>2047?(t+=String.fromCharCode(224|i>>12&15),t+=String.fromCharCode(128|i>>6&63),t+=String.fromCharCode(128|i>>0&63)):(t+=String.fromCharCode(192|i>>6&31),t+=String.fromCharCode(128|i>>0&63))}return t}function Il(s){return s.slice(0)}function Dl(s,t=!0){const e=t?Il(s.buffer):s.buffer;return new s.constructor(e,s.byteOffset,s.length)}const Ll="[object Undefined]",Rl="[object Null]",Ol="[object Boolean]",zl="[object Number]",Nl="[object BigInt]",Bl="[object String]",Fl="[object Symbol]",Yl="[object Array]";function fa(s){return Object.prototype.toString.call(s)}function Xl(s){return s!=null}function Ul(s){const t=fa(s);return t===Ll||t===Rl||t===Ol||t===zl||t===Bl||t===Fl||t===Nl}function $l(s){return fa(s)===Yl}function Vl(s){return!!s&&typeof s=="object"}function da(s){return Vl(s)&&!$l(s)}function ma(s,...t){return new s.constructor(...t)}function _n(s){if(!da(s))return""+s;const t=[];for(const e in s)Object.prototype.hasOwnProperty.call(s,e)&&(da(s[e])?t.push(_n(s[e])):t.push(`${e}: ${s[e]}`));return`{ ${t.join(", ")} }`}function Gl(s,t="",e=["","sign","key"]){return Object.keys(s).filter(n=>{for(let i=0,r=e.length;i<r;i++)if(s[n]==e[i])return!1;return!0}).sort().map(n=>`${n}=${s[n]}`).join("&")+t}function ql(s=[],t=[]){const e=s.length,n=t.length;for(let r=0;r<n;r++)s[r]=t[r];let i=Math.max(0,e-n);for(;i>0;)s.pop(),i--;return s}function Oe(s,t){const e=s.findIndex(n=>n===t);return e>=0&&s.splice(e,1),s}function pa(s,t){return s.findIndex(e=>e==t)>=0}function jl(s,...t){return t.forEach(e=>{pa(s,e)||s.push(e)}),s}let ga;try{ga=Map}catch{ga=function(){}}let ya;try{ya=Set}catch{ya=function(){}}function qt(s,t){const e=parseFloat(s);if(Number.isNaN(e)){if(typeof t=="number")return t;throw new Error(`"${s}" is NaN!`)}return e}function wa(s,t,e=Number.EPSILON*Math.pow(2,2)){return Math.abs(s-t)<e}function N(s,t,e){const n=Math.min(t,e),i=Math.max(t,e);return s<n?n:s>i?i:s}function Hl(s,t){return(s%t+t)%t}function cs(s,t,e){return(1-e)*s+e*t}function Wl(s,t,e){const n=s.length,i=new Array(n);for(let r=0;r<n;r++)i[r]=Z(cs(s[r],t[r],e),6);return i}const Jl=(s,t,e)=>n=>{const i=N(n,s,t);return e==0?i:t-i<e?t:Math.round(i/e)*e};function Zl(s,t=12){return qt(s,0).toFixed(t)}function Z(s,t=12){return+Zl(s,t)}function Ql(s,t){const e=aa("number-single",String(s));return{hasNumber:!!e,number:e&&!Array.isArray(e)&&e.fullMatch?parseFloat(e.fullMatch):Xl(t)?t:NaN,prefix:e&&!Array.isArray(e)&&e.fullMatch?s.substring(0,e.matchIndex):"",suffix:e&&!Array.isArray(e)&&e.fullMatch?s.substring(e.matchIndex+e.fullMatch.length):""}}function bi(s){const t=aa("number",s);return t?Array.isArray(t)?t.map(e=>Number(e.fullMatch)):[Number(t.fullMatch)]:[]}const sn=(s,t=16)=>{let e=s.toLowerCase();const n=e.indexOf("0b")==0,i=e.indexOf("0o")==0,r=e.indexOf("0x")==0;(n||i||r)&&(e=e.slice(2)),n&&(t=2),i&&(t=8),r&&(t=16);const o=parseInt(e,t);if(isNaN(o))throw new Error(`radixStringToNumber(${s}, ${t}) 无法解析!`);return o};function Kl(s){return new TextEncoder().encode(s)}function tf(s){return String.fromCharCode.apply(null,new Uint16Array(s))}const vi=(s,t,e)=>t?e===os.base64?new Blob([s],{type:`${t};${e}`}):e===os.utf8?new Blob([s],{type:`${t};charset=${e}`}):new Blob([s],{type:`${t}`}):new Blob([s]),ef=s=>{let t=Tt.UNKNOWN;switch(new DataView(s).getUint32(0,nf()).toString(16).toUpperCase()){case"FFD8FFDB":t=Tt.JPEG;break;case"FFD8FFE0":case"FFD8FFE1":case"FFD8FFE2":case"FFD8FFE3":t=Tt.JPEG;break;case"89504E47":t=Tt.PNG;break;case"47494638":t=Tt.GIF;break;case"52494646":t=Tt.WEBP;break;case"25504446":t=Tt.PDF;break;case"504B0304":t=Tt.ZIP;break}return t};function nf(){const s=Uint32Array.of(305419896),t=new Uint8Array(s.buffer);switch(t[0]*16777216+t[1]*65536+t[2]*256+t[3]){case 305419896:return!1;case 2018915346:return!0}}function ut(){return(performance||Date).now()}function se(s=new Date){return s.getTime()}function sf(s,t=3){const e=Math.max(s.length,6);let n="";for(let r=0;r<e-4;r++)n+=s[r]||"0";const i=[n,""+(s[e-4]||"0")+(s[e-3]||"0"),""+(s[e-2]||"0")+(s[e-1]||"0")];switch(t){case 1:return i[0];case 2:return i[0]+":"+i[1];case 3:return i[0]+":"+i[1]+":"+i[2]}}function rf(s){const t=Math.max(s.length,6);let e=0;e+=(s[t-2]||0)*10+(s[t-1]||0),e+=((s[t-4]||0)*10+(s[t-3]||0))*60;let n=0;for(let i=0;i<t-4;i++)n=n*10+(s[i]||0);return e+=n*60*60,Math.floor(Math.max(0,e))}function of(s,t=!1){let e=0;typeof s=="number"?e=s:e=rf(s);const n=[],i=e%60;n.unshift(i%10),n.unshift(Math.floor(i/10)),e=Math.floor(e/60);const r=e%60;if(n.unshift(r%10),n.unshift(Math.floor(r/10)),e=Math.floor(e/60),t){const o=e%100;for(n.unshift(o%10),n.unshift(Math.floor(o/10)),e=Math.floor(e/100);e;)n.unshift(e%10),e=Math.floor(e/10)}else{const o=e%24;n.unshift(o%10),n.unshift(Math.floor(o/10))}return n}function af(s,t=1,e=!1){return s[s.length-1]+=t,of(s,e)}const Sn={THROW:1,DROP:2,SLIDE:3,EXPAND:4};class hf{queue;limit;overflow;constructor(t=10,e=Sn.EXPAND){this.queue=[],this.limit=t,this.overflow=e}length(){return this.queue.length}isEmpty(){return this.length()===0}findIndex(t){return this.queue.findIndex(t)}deleteIndex(t){return!!this.queue.splice(t,1).length}delete(t){const e=this.findIndex(t);return e>-1?this.deleteIndex(e):!1}enqueue(t){if(this.length()<this.limit){this.queue.push(t);return}switch(this.overflow){case Sn.EXPAND:this.limit*=2,this.queue.push(t);break;case Sn.SLIDE:this.deleteIndex(0),this.queue.push(t);break;case Sn.THROW:throw new Error(`Queue limit(${this.limit}) overflow!`)}}push(t){this.enqueue(t)}put(t){this.enqueue(t)}dequeue(){return this.queue.shift()}pop(){return this.dequeue()}take(){return this.dequeue()}peek(){return this.queue[0]}index(t){return this.queue[t]}clear(){this.queue=[]}flush(){const t=[];let e;for(;e=this.dequeue();)t.push(e);return t}}const cf=s=>new hf(s,Sn.EXPAND);class rn{maps=new Map;constructor(){}entries(){return Array.from(this.maps.entries())}keys(){return Array.from(this.maps.keys())}values(){return Array.from(this.maps.values())}json(){return this.entries().reduce((t,[e,n])=>(t[e]=n,t),{})}get length(){return this.entries().length}set(t,e){this.maps.set(t,e)}get(t){return this.maps.get(t)}has(t){return this.maps.has(t)}getEntryFromIndex(t){return this.entries()[t]}getEntry(t){const e=this.entries();for(let n=0,i=e.length;n<i;n++){const r=e[n];if(t(r[0],r[1]))return r}}firstEntry(){return this.getEntryFromIndex(0)}shift(){const t=this.firstEntry();if(t){const[e]=t;this.delete(e)}return t}delete(t){return this.maps.delete(t)}clear(){this.maps.clear()}update(t){const e=this.entries();for(let n=0,i=e.length;n<i;n++){const[r,o]=e[n];t(r,o)===!1&&this.delete(r)}}}function uf(){Ct.OPEN_LOG=!0}function lf(){Ct.OPEN_LOG=!1}function ff(s){Ct.LOG_UPLOAD_FN=s}function xa(){return Ct.OPEN_LOG||!1}function ba(s,t){const e=Ct.LOG_UPLOAD_FN;e&&e(s,t)}function on(s){ba("info",s),xa()&&(!console||typeof console!="object"||typeof console.log!="function"||console.log(s))}function df(s){ba("warn",s),xa()&&(!console||typeof console!="object"||typeof console.warn!="function"||console.warn(s))}const va=()=>{};function _i(s,t=3,e,n){return async function(...i){const r=`retry(${s.name})(${i.map(_n)})`;let o;for(let a=0;a<t;a++)try{return await s.call(n||this,...i)}catch(h){on(`(${r}) 第 ${a+1} 次尝试失败, retrying...`),o=h,await new Promise(c=>setTimeout(c,typeof e=="number"?e:300*Math.pow(2,a)))}throw on(`(${r}) 已 ${t} 次失败,不再重试。 Last error: ${_n(o)}`),o}}function Si(s,t=60,e=new rn,n){return async function(...i){const r=`cache(${s.name})(${i.map(_n)})`,o=Date.now();t&&e.update((c,u)=>o-u.timestamp<t*1e3);const a=xi(i),h=e.get(a);if(h){if(!t||o-h.timestamp<t*1e3)return on(`${r} 击中缓存`),h.value;e.delete(a)}try{on(`${r} 没有缓存, 尝试立即执行...`);const c=await s.call(n||this,...i);return on(`${r} 缓存设置成功`),e.set(a,{value:c,timestamp:Date.now()}),c}catch(c){throw on(`${r} 执行失败 : ${_n(c)}`),c}}}var Ci=function(s,t){return Ci=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])},Ci(s,t)};function Ti(s,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");Ci(s,t);function e(){this.constructor=s}s.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}function _a(s){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&s[t],n=0;if(e)return e.call(s);if(s&&typeof s.length=="number")return{next:function(){return s&&n>=s.length&&(s=void 0),{value:s&&s[n++],done:!s}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function Ei(s,t){var e=typeof Symbol=="function"&&s[Symbol.iterator];if(!e)return s;var n=e.call(s),i,r=[],o;try{for(;(t===void 0||t-- >0)&&!(i=n.next()).done;)r.push(i.value)}catch(a){o={error:a}}finally{try{i&&!i.done&&(e=n.return)&&e.call(n)}finally{if(o)throw o.error}}return r}function Pi(s,t,e){if(e||arguments.length===2)for(var n=0,i=t.length,r;n<i;n++)(r||!(n in t))&&(r||(r=Array.prototype.slice.call(t,0,n)),r[n]=t[n]);return s.concat(r||Array.prototype.slice.call(t))}function ce(s){return typeof s=="function"}function mf(s){var t=function(n){Error.call(n),n.stack=new Error().stack},e=s(t);return e.prototype=Object.create(Error.prototype),e.prototype.constructor=e,e}var Mi=mf(function(s){return function(t){s(this),this.message=t?t.length+` errors occurred during unsubscription:
|
|
11
11
|
`+t.map(function(e,n){return n+1+") "+e.toString()}).join(`
|
|
12
|
-
`):"",this.name="UnsubscriptionError",this.errors=t}});function va(s,t){if(s){var e=s.indexOf(t);0<=e&&s.splice(e,1)}}var Mi=function(){function s(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}return s.prototype.unsubscribe=function(){var t,e,n,i,r;if(!this.closed){this.closed=!0;var o=this._parentage;if(o)if(this._parentage=null,Array.isArray(o))try{for(var a=ba(o),c=a.next();!c.done;c=a.next()){var h=c.value;h.remove(this)}}catch(w){t={error:w}}finally{try{c&&!c.done&&(e=a.return)&&e.call(a)}finally{if(t)throw t.error}}else o.remove(this);var u=this.initialTeardown;if(he(u))try{u()}catch(w){r=w instanceof Pi?w.errors:[w]}var l=this._finalizers;if(l){this._finalizers=null;try{for(var d=ba(l),f=d.next();!f.done;f=d.next()){var p=f.value;try{Sa(p)}catch(w){r=r??[],w instanceof Pi?r=Ei(Ei([],Ti(r)),Ti(w.errors)):r.push(w)}}}catch(w){n={error:w}}finally{try{f&&!f.done&&(i=d.return)&&i.call(d)}finally{if(n)throw n.error}}}if(r)throw new Pi(r)}},s.prototype.add=function(t){var e;if(t&&t!==this)if(this.closed)Sa(t);else{if(t instanceof s){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=(e=this._finalizers)!==null&&e!==void 0?e:[]).push(t)}},s.prototype._hasParent=function(t){var e=this._parentage;return e===t||Array.isArray(e)&&e.includes(t)},s.prototype._addParent=function(t){var e=this._parentage;this._parentage=Array.isArray(e)?(e.push(t),e):e?[e,t]:t},s.prototype._removeParent=function(t){var e=this._parentage;e===t?this._parentage=null:Array.isArray(e)&&va(e,t)},s.prototype.remove=function(t){var e=this._finalizers;e&&va(e,t),t instanceof s&&t._removeParent(this)},s.EMPTY=function(){var t=new s;return t.closed=!0,t}(),s}();Mi.EMPTY;function _a(s){return s instanceof Mi||s&&"closed"in s&&he(s.remove)&&he(s.add)&&he(s.unsubscribe)}function Sa(s){he(s)?s():s.unsubscribe()}var Ca={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},wf={setTimeout:function(s,t){for(var e=[],n=2;n<arguments.length;n++)e[n-2]=arguments[n];return setTimeout.apply(void 0,Ei([s,t],Ti(e)))},clearTimeout:function(s){return clearTimeout(s)},delegate:void 0};function xf(s){wf.setTimeout(function(){throw s})}function Ta(){}function bf(s){s()}var Ai=function(s){Ci(t,s);function t(e){var n=s.call(this)||this;return n.isStopped=!1,e?(n.destination=e,_a(e)&&e.add(n)):n.destination=Cf,n}return t.create=function(e,n,i){return new Ii(e,n,i)},t.prototype.next=function(e){this.isStopped||this._next(e)},t.prototype.error=function(e){this.isStopped||(this.isStopped=!0,this._error(e))},t.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,s.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(e){this.destination.next(e)},t.prototype._error=function(e){try{this.destination.error(e)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t}(Mi),vf=Function.prototype.bind;function ki(s,t){return vf.call(s,t)}var _f=function(){function s(t){this.partialObserver=t}return s.prototype.next=function(t){var e=this.partialObserver;if(e.next)try{e.next(t)}catch(n){hs(n)}},s.prototype.error=function(t){var e=this.partialObserver;if(e.error)try{e.error(t)}catch(n){hs(n)}else hs(t)},s.prototype.complete=function(){var t=this.partialObserver;if(t.complete)try{t.complete()}catch(e){hs(e)}},s}(),Ii=function(s){Ci(t,s);function t(e,n,i){var r=s.call(this)||this,o;if(he(e)||!e)o={next:e??void 0,error:n??void 0,complete:i??void 0};else{var a;r&&Ca.useDeprecatedNextContext?(a=Object.create(e),a.unsubscribe=function(){return r.unsubscribe()},o={next:e.next&&ki(e.next,a),error:e.error&&ki(e.error,a),complete:e.complete&&ki(e.complete,a)}):o=e}return r.destination=new _f(o),r}return t}(Ai);function hs(s){xf(s)}function Sf(s){throw s}var Cf={closed:!0,next:Ta,error:Sf,complete:Ta},Tf=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function Ef(s){return s}function Pf(s){return s.length===0?Ef:s.length===1?s[0]:function(t){return s.reduce(function(e,n){return n(e)},t)}}(function(){function s(t){t&&(this._subscribe=t)}return s.prototype.lift=function(t){var e=new s;return e.source=this,e.operator=t,e},s.prototype.subscribe=function(t,e,n){var i=this,r=Af(t)?t:new Ii(t,e,n);return bf(function(){var o=i,a=o.operator,c=o.source;r.add(a?a.call(r,c):c?i._subscribe(r):i._trySubscribe(r))}),r},s.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(e){t.error(e)}},s.prototype.forEach=function(t,e){var n=this;return e=Ea(e),new e(function(i,r){var o=new Ii({next:function(a){try{t(a)}catch(c){r(c),o.unsubscribe()}},error:r,complete:i});n.subscribe(o)})},s.prototype._subscribe=function(t){var e;return(e=this.source)===null||e===void 0?void 0:e.subscribe(t)},s.prototype[Tf]=function(){return this},s.prototype.pipe=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Pf(t)(this)},s.prototype.toPromise=function(t){var e=this;return t=Ea(t),new t(function(n,i){var r;e.subscribe(function(o){return r=o},function(o){return i(o)},function(){return n(r)})})},s.create=function(t){return new s(t)},s})();function Ea(s){var t;return(t=s??Ca.Promise)!==null&&t!==void 0?t:Promise}function Mf(s){return s&&he(s.next)&&he(s.error)&&he(s.complete)}function Af(s){return s&&s instanceof Ai||Mf(s)&&_a(s)}(function(s){Ci(t,s);function t(e,n,i,r,o,a){var c=s.call(this,e)||this;return c.onFinalize=o,c.shouldUnsubscribe=a,c._next=n?function(h){try{n(h)}catch(u){e.error(u)}}:s.prototype._next,c._error=r?function(h){try{r(h)}catch(u){e.error(u)}finally{this.unsubscribe()}}:s.prototype._error,c._complete=i?function(){try{i()}catch(h){e.error(h)}finally{this.unsubscribe()}}:s.prototype._complete,c}return t.prototype.unsubscribe=function(){var e;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var n=this.closed;s.prototype.unsubscribe.call(this),!n&&((e=this.onFinalize)===null||e===void 0||e.call(this))}},t})(Ai);let vn;function Wt(s){vn=s,s(),vn=null}class kf{subscribers=new Set;add(){vn&&!this.subscribers.has(vn)&&this.subscribers.add(vn)}notify(){this.subscribers.forEach(t=>t())}}const Pa=new WeakMap;function us(s,t){let e=Pa.get(s);e||(e=new Map,Pa.set(s,e));let n=e.get(t);return n||(n=new kf,e.set(t,n)),n}function If(s,t=!1){return Object.keys(s).forEach(e=>{let n=s[e];if(t&&typeof n=="object"&&n!==null)s[e]=Ri(n,t);else{const i=us(s,e);Object.defineProperty(s,e,{configurable:!0,enumerable:!0,get(){return i.add(),n},set(r){n!=r&&(n=r,i.notify())}})}}),s}function Di(s,t=!1){return If({value:s},t)}function Ri(s,t=!1){const e={get(n,i,r){const o=Reflect.get(n,i,r);if(t&&typeof o=="object"&&o!==null&&!("isYZReactiveProxy"in o)){const a=Ri(o,t);a.YZReactiveProxyParentTarget=n,a.YZReactiveProxyParentKey=i,Reflect.set(r,i,a)}return us(n,i).add(),Reflect.get(n,i,r)},set(n,i,r,o){const a=Reflect.get(n,i,o),c=Reflect.set(n,i,r,o);return Array.isArray(n)?us(n.YZReactiveProxyParentTarget,n.YZReactiveProxyParentKey).notify():a!=r&&us(n,i).notify(),c},has(n,i){return i==="isYZReactiveProxy"||i in n}};return new Proxy(s,e)}const Ma=Ri;class ls{events;constructor(){this.events={}}isEmpty(t){return this.events[t]==null||this.events[t].length==0}has(t,e){return this.events[t]!==void 0&&this.events[t].indexOf(e)!==-1}prependListener(t,e,n){return this.events[t]||(this.events[t]=[]),this.events[t].unshift(n?e.bind(n):e),this}addListener(t,e,n){return this.events[t]||(this.events[t]=[]),this.events[t].push(n?e.bind(n):e),this}on(t,e,n){return this.addListener(t,e,n),this}removeListener(t,e){return this.events[t]&&(this.events[t]=this.events[t].filter(n=>n!==e)),this}off(t,e){return this.removeListener(t,e),this}removeAllListeners(t){return t?this.events[t]=[]:this.events={},this}emit(t,...e){return this.events[t]&&this.events[t].slice(0).forEach(n=>{n(...e)}),this}once(t,e,n){const i=(...r)=>{n?e.apply(n,r):e(...r),this.off(t,i)};return this.on(t,i),this}}function Df(){const s={};return s.promise=new Promise((t,e)=>{s.resolve=t,s.reject=e}),s}let Rf=0;function Lf(s){const t=Df();let e=!1;return{name:s.name||String(++Rf),deadline:typeof s.deadline=="number"?Math.max(s.deadline,0):-1,run:async()=>{if(!e){e=!0;try{let n;const i=s.args||[];s.thisArg?n=await s.fn.call(s.thisArg,...i):n=await s.fn(...i),t.resolve(n)}catch(n){t.reject(n)}}},result:()=>t.promise}}class Of{queue;suspend=!1;semaphore=0;concurrency=1;timeRemaining=-1;timeoutId;constructor(t){this.queue=t?.queue||ff(10),typeof t?.concurrency=="number"&&(this.concurrency=Math.max(t?.concurrency,1)),typeof t?.timeRemaining=="number"&&this.setTimeRemaining(t.timeRemaining)}setTimeRemaining(t){this.timeRemaining=Math.max(0,t)}increaseTimeRemaining(t,e=!1){this.timeRemaining!==-1?this.setTimeRemaining(this.timeRemaining+t):e&&this.setTimeRemaining(t)}decreaseTimeRemaining(t){this.timeRemaining!==-1&&this.setTimeRemaining(this.timeRemaining-t)}_addTask(t){this.queue.delete(e=>e.name==t.name),this.queue.enqueue(t)}_exec(t,e=!0){const n=se();try{this.semaphore++,t.run()}finally{this.semaphore--,e&&(this.decreaseTimeRemaining(se()-n),this._flush())}}_flush(){for(;!this.suspend&&this.semaphore<this.concurrency&&(this.timeRemaining==-1||this.timeRemaining>0);){const t=this.queue.dequeue();if(!t)break;this._exec(t)}this._timeout()}_timeout(){clearTimeout(this.timeoutId),this.timeoutId=setTimeout(()=>{if(!(this.suspend||this.semaphore>0||!this.queue.length))for(let t=0;t<this.queue.length;){const e=this.queue.index(t);if(!e)break;e.deadline!=-1&&e.deadline<=se()?(this._exec(e,!1),this.queue.deleteIndex(t)):t++}},0)}pause(){this.suspend=!0}resume(){this.suspend=!1,this._flush()}immediately(t){this._exec(t),this._flush()}asap(t){this._addTask(t),this._flush()}idleCallback(t){this.increaseTimeRemaining(t.timeRemaining(),!0),this._flush()}clear(){this.queue.clear()}}class zf extends Of{constructor(t){super(t)}_exec(t,e=!0){const n=se();try{this.semaphore++,t.run()}finally{t.result().finally(()=>{this.semaphore--,e&&(this.decreaseTimeRemaining(se()-n),this._flush())})}}}function Aa(s,t={},e){if(typeof t=="function"&&(e=t,t={}),e)return e(Aa)(s,t);let n=t;const i=[],r=h=>(i.push(h),()=>{Le(i,h)}),o=h=>{n=s(n,h),i.forEach(u=>u())},a=()=>n,c=h=>{s=h,o({type:Symbol()})};return o({type:Symbol()}),{getState:a,dispatch:o,subscribe:r,replaceReducer:c}}function ka(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}var Ia={exports:{}};(function(s,t){(function(e){s.exports=e()})(function(e){var n=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"];function i(x,g){var v=x[0],_=x[1],E=x[2],C=x[3];v+=(_&E|~_&C)+g[0]-680876936|0,v=(v<<7|v>>>25)+_|0,C+=(v&_|~v&E)+g[1]-389564586|0,C=(C<<12|C>>>20)+v|0,E+=(C&v|~C&_)+g[2]+606105819|0,E=(E<<17|E>>>15)+C|0,_+=(E&C|~E&v)+g[3]-1044525330|0,_=(_<<22|_>>>10)+E|0,v+=(_&E|~_&C)+g[4]-176418897|0,v=(v<<7|v>>>25)+_|0,C+=(v&_|~v&E)+g[5]+1200080426|0,C=(C<<12|C>>>20)+v|0,E+=(C&v|~C&_)+g[6]-1473231341|0,E=(E<<17|E>>>15)+C|0,_+=(E&C|~E&v)+g[7]-45705983|0,_=(_<<22|_>>>10)+E|0,v+=(_&E|~_&C)+g[8]+1770035416|0,v=(v<<7|v>>>25)+_|0,C+=(v&_|~v&E)+g[9]-1958414417|0,C=(C<<12|C>>>20)+v|0,E+=(C&v|~C&_)+g[10]-42063|0,E=(E<<17|E>>>15)+C|0,_+=(E&C|~E&v)+g[11]-1990404162|0,_=(_<<22|_>>>10)+E|0,v+=(_&E|~_&C)+g[12]+1804603682|0,v=(v<<7|v>>>25)+_|0,C+=(v&_|~v&E)+g[13]-40341101|0,C=(C<<12|C>>>20)+v|0,E+=(C&v|~C&_)+g[14]-1502002290|0,E=(E<<17|E>>>15)+C|0,_+=(E&C|~E&v)+g[15]+1236535329|0,_=(_<<22|_>>>10)+E|0,v+=(_&C|E&~C)+g[1]-165796510|0,v=(v<<5|v>>>27)+_|0,C+=(v&E|_&~E)+g[6]-1069501632|0,C=(C<<9|C>>>23)+v|0,E+=(C&_|v&~_)+g[11]+643717713|0,E=(E<<14|E>>>18)+C|0,_+=(E&v|C&~v)+g[0]-373897302|0,_=(_<<20|_>>>12)+E|0,v+=(_&C|E&~C)+g[5]-701558691|0,v=(v<<5|v>>>27)+_|0,C+=(v&E|_&~E)+g[10]+38016083|0,C=(C<<9|C>>>23)+v|0,E+=(C&_|v&~_)+g[15]-660478335|0,E=(E<<14|E>>>18)+C|0,_+=(E&v|C&~v)+g[4]-405537848|0,_=(_<<20|_>>>12)+E|0,v+=(_&C|E&~C)+g[9]+568446438|0,v=(v<<5|v>>>27)+_|0,C+=(v&E|_&~E)+g[14]-1019803690|0,C=(C<<9|C>>>23)+v|0,E+=(C&_|v&~_)+g[3]-187363961|0,E=(E<<14|E>>>18)+C|0,_+=(E&v|C&~v)+g[8]+1163531501|0,_=(_<<20|_>>>12)+E|0,v+=(_&C|E&~C)+g[13]-1444681467|0,v=(v<<5|v>>>27)+_|0,C+=(v&E|_&~E)+g[2]-51403784|0,C=(C<<9|C>>>23)+v|0,E+=(C&_|v&~_)+g[7]+1735328473|0,E=(E<<14|E>>>18)+C|0,_+=(E&v|C&~v)+g[12]-1926607734|0,_=(_<<20|_>>>12)+E|0,v+=(_^E^C)+g[5]-378558|0,v=(v<<4|v>>>28)+_|0,C+=(v^_^E)+g[8]-2022574463|0,C=(C<<11|C>>>21)+v|0,E+=(C^v^_)+g[11]+1839030562|0,E=(E<<16|E>>>16)+C|0,_+=(E^C^v)+g[14]-35309556|0,_=(_<<23|_>>>9)+E|0,v+=(_^E^C)+g[1]-1530992060|0,v=(v<<4|v>>>28)+_|0,C+=(v^_^E)+g[4]+1272893353|0,C=(C<<11|C>>>21)+v|0,E+=(C^v^_)+g[7]-155497632|0,E=(E<<16|E>>>16)+C|0,_+=(E^C^v)+g[10]-1094730640|0,_=(_<<23|_>>>9)+E|0,v+=(_^E^C)+g[13]+681279174|0,v=(v<<4|v>>>28)+_|0,C+=(v^_^E)+g[0]-358537222|0,C=(C<<11|C>>>21)+v|0,E+=(C^v^_)+g[3]-722521979|0,E=(E<<16|E>>>16)+C|0,_+=(E^C^v)+g[6]+76029189|0,_=(_<<23|_>>>9)+E|0,v+=(_^E^C)+g[9]-640364487|0,v=(v<<4|v>>>28)+_|0,C+=(v^_^E)+g[12]-421815835|0,C=(C<<11|C>>>21)+v|0,E+=(C^v^_)+g[15]+530742520|0,E=(E<<16|E>>>16)+C|0,_+=(E^C^v)+g[2]-995338651|0,_=(_<<23|_>>>9)+E|0,v+=(E^(_|~C))+g[0]-198630844|0,v=(v<<6|v>>>26)+_|0,C+=(_^(v|~E))+g[7]+1126891415|0,C=(C<<10|C>>>22)+v|0,E+=(v^(C|~_))+g[14]-1416354905|0,E=(E<<15|E>>>17)+C|0,_+=(C^(E|~v))+g[5]-57434055|0,_=(_<<21|_>>>11)+E|0,v+=(E^(_|~C))+g[12]+1700485571|0,v=(v<<6|v>>>26)+_|0,C+=(_^(v|~E))+g[3]-1894986606|0,C=(C<<10|C>>>22)+v|0,E+=(v^(C|~_))+g[10]-1051523|0,E=(E<<15|E>>>17)+C|0,_+=(C^(E|~v))+g[1]-2054922799|0,_=(_<<21|_>>>11)+E|0,v+=(E^(_|~C))+g[8]+1873313359|0,v=(v<<6|v>>>26)+_|0,C+=(_^(v|~E))+g[15]-30611744|0,C=(C<<10|C>>>22)+v|0,E+=(v^(C|~_))+g[6]-1560198380|0,E=(E<<15|E>>>17)+C|0,_+=(C^(E|~v))+g[13]+1309151649|0,_=(_<<21|_>>>11)+E|0,v+=(E^(_|~C))+g[4]-145523070|0,v=(v<<6|v>>>26)+_|0,C+=(_^(v|~E))+g[11]-1120210379|0,C=(C<<10|C>>>22)+v|0,E+=(v^(C|~_))+g[2]+718787259|0,E=(E<<15|E>>>17)+C|0,_+=(C^(E|~v))+g[9]-343485551|0,_=(_<<21|_>>>11)+E|0,x[0]=v+x[0]|0,x[1]=_+x[1]|0,x[2]=E+x[2]|0,x[3]=C+x[3]|0}function r(x){var g=[],v;for(v=0;v<64;v+=4)g[v>>2]=x.charCodeAt(v)+(x.charCodeAt(v+1)<<8)+(x.charCodeAt(v+2)<<16)+(x.charCodeAt(v+3)<<24);return g}function o(x){var g=[],v;for(v=0;v<64;v+=4)g[v>>2]=x[v]+(x[v+1]<<8)+(x[v+2]<<16)+(x[v+3]<<24);return g}function a(x){var g=x.length,v=[1732584193,-271733879,-1732584194,271733878],_,E,C,I,F,N;for(_=64;_<=g;_+=64)i(v,r(x.substring(_-64,_)));for(x=x.substring(_-64),E=x.length,C=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],_=0;_<E;_+=1)C[_>>2]|=x.charCodeAt(_)<<(_%4<<3);if(C[_>>2]|=128<<(_%4<<3),_>55)for(i(v,C),_=0;_<16;_+=1)C[_]=0;return I=g*8,I=I.toString(16).match(/(.*?)(.{0,8})$/),F=parseInt(I[2],16),N=parseInt(I[1],16)||0,C[14]=F,C[15]=N,i(v,C),v}function c(x){var g=x.length,v=[1732584193,-271733879,-1732584194,271733878],_,E,C,I,F,N;for(_=64;_<=g;_+=64)i(v,o(x.subarray(_-64,_)));for(x=_-64<g?x.subarray(_-64):new Uint8Array(0),E=x.length,C=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],_=0;_<E;_+=1)C[_>>2]|=x[_]<<(_%4<<3);if(C[_>>2]|=128<<(_%4<<3),_>55)for(i(v,C),_=0;_<16;_+=1)C[_]=0;return I=g*8,I=I.toString(16).match(/(.*?)(.{0,8})$/),F=parseInt(I[2],16),N=parseInt(I[1],16)||0,C[14]=F,C[15]=N,i(v,C),v}function h(x){var g="",v;for(v=0;v<4;v+=1)g+=n[x>>v*8+4&15]+n[x>>v*8&15];return g}function u(x){var g;for(g=0;g<x.length;g+=1)x[g]=h(x[g]);return x.join("")}u(a("hello")),typeof ArrayBuffer<"u"&&!ArrayBuffer.prototype.slice&&function(){function x(g,v){return g=g|0||0,g<0?Math.max(g+v,0):Math.min(g,v)}ArrayBuffer.prototype.slice=function(g,v){var _=this.byteLength,E=x(g,_),C=_,I,F,N,$;return v!==e&&(C=x(v,_)),E>C?new ArrayBuffer(0):(I=C-E,F=new ArrayBuffer(I),N=new Uint8Array(F),$=new Uint8Array(this,E,I),N.set($),F)}}();function l(x){return/[\u0080-\uFFFF]/.test(x)&&(x=unescape(encodeURIComponent(x))),x}function d(x,g){var v=x.length,_=new ArrayBuffer(v),E=new Uint8Array(_),C;for(C=0;C<v;C+=1)E[C]=x.charCodeAt(C);return g?E:_}function f(x){return String.fromCharCode.apply(null,new Uint8Array(x))}function p(x,g,v){var _=new Uint8Array(x.byteLength+g.byteLength);return _.set(new Uint8Array(x)),_.set(new Uint8Array(g),x.byteLength),v?_:_.buffer}function w(x){var g=[],v=x.length,_;for(_=0;_<v-1;_+=2)g.push(parseInt(x.substr(_,2),16));return String.fromCharCode.apply(String,g)}function b(){this.reset()}return b.prototype.append=function(x){return this.appendBinary(l(x)),this},b.prototype.appendBinary=function(x){this._buff+=x,this._length+=x.length;var g=this._buff.length,v;for(v=64;v<=g;v+=64)i(this._hash,r(this._buff.substring(v-64,v)));return this._buff=this._buff.substring(v-64),this},b.prototype.end=function(x){var g=this._buff,v=g.length,_,E=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],C;for(_=0;_<v;_+=1)E[_>>2]|=g.charCodeAt(_)<<(_%4<<3);return this._finish(E,v),C=u(this._hash),x&&(C=w(C)),this.reset(),C},b.prototype.reset=function(){return this._buff="",this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},b.prototype.getState=function(){return{buff:this._buff,length:this._length,hash:this._hash.slice()}},b.prototype.setState=function(x){return this._buff=x.buff,this._length=x.length,this._hash=x.hash,this},b.prototype.destroy=function(){delete this._hash,delete this._buff,delete this._length},b.prototype._finish=function(x,g){var v=g,_,E,C;if(x[v>>2]|=128<<(v%4<<3),v>55)for(i(this._hash,x),v=0;v<16;v+=1)x[v]=0;_=this._length*8,_=_.toString(16).match(/(.*?)(.{0,8})$/),E=parseInt(_[2],16),C=parseInt(_[1],16)||0,x[14]=E,x[15]=C,i(this._hash,x)},b.hash=function(x,g){return b.hashBinary(l(x),g)},b.hashBinary=function(x,g){var v=a(x),_=u(v);return g?w(_):_},b.ArrayBuffer=function(){this.reset()},b.ArrayBuffer.prototype.append=function(x){var g=p(this._buff.buffer,x,!0),v=g.length,_;for(this._length+=x.byteLength,_=64;_<=v;_+=64)i(this._hash,o(g.subarray(_-64,_)));return this._buff=_-64<v?new Uint8Array(g.buffer.slice(_-64)):new Uint8Array(0),this},b.ArrayBuffer.prototype.end=function(x){var g=this._buff,v=g.length,_=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],E,C;for(E=0;E<v;E+=1)_[E>>2]|=g[E]<<(E%4<<3);return this._finish(_,v),C=u(this._hash),x&&(C=w(C)),this.reset(),C},b.ArrayBuffer.prototype.reset=function(){return this._buff=new Uint8Array(0),this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},b.ArrayBuffer.prototype.getState=function(){var x=b.prototype.getState.call(this);return x.buff=f(x.buff),x},b.ArrayBuffer.prototype.setState=function(x){return x.buff=d(x.buff,!0),b.prototype.setState.call(this,x)},b.ArrayBuffer.prototype.destroy=b.prototype.destroy,b.ArrayBuffer.prototype._finish=b.prototype._finish,b.ArrayBuffer.hash=function(x,g){var v=c(new Uint8Array(x)),_=u(v);return g?w(_):_},b})})(Ia);var Ff=Ia.exports;const Bf=ka(Ff);function Da(s,t){return function(){return s.apply(t,arguments)}}const{toString:Nf}=Object.prototype,{getPrototypeOf:Li}=Object,fs=(s=>t=>{const e=Nf.call(t);return s[e]||(s[e]=e.slice(8,-1).toLowerCase())})(Object.create(null)),Jt=s=>(s=s.toLowerCase(),t=>fs(t)===s),ds=s=>t=>typeof t===s,{isArray:sn}=Array,_n=ds("undefined");function Yf(s){return s!==null&&!_n(s)&&s.constructor!==null&&!_n(s.constructor)&&zt(s.constructor.isBuffer)&&s.constructor.isBuffer(s)}const Ra=Jt("ArrayBuffer");function Uf(s){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(s):t=s&&s.buffer&&Ra(s.buffer),t}const Xf=ds("string"),zt=ds("function"),La=ds("number"),ms=s=>s!==null&&typeof s=="object",$f=s=>s===!0||s===!1,ps=s=>{if(fs(s)!=="object")return!1;const t=Li(s);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in s)&&!(Symbol.iterator in s)},Vf=Jt("Date"),Gf=Jt("File"),qf=Jt("Blob"),jf=Jt("FileList"),Hf=s=>ms(s)&&zt(s.pipe),Wf=s=>{let t;return s&&(typeof FormData=="function"&&s instanceof FormData||zt(s.append)&&((t=fs(s))==="formdata"||t==="object"&&zt(s.toString)&&s.toString()==="[object FormData]"))},Jf=Jt("URLSearchParams"),[Zf,Qf,Kf,td]=["ReadableStream","Request","Response","Headers"].map(Jt),ed=s=>s.trim?s.trim():s.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Sn(s,t,{allOwnKeys:e=!1}={}){if(s===null||typeof s>"u")return;let n,i;if(typeof s!="object"&&(s=[s]),sn(s))for(n=0,i=s.length;n<i;n++)t.call(null,s[n],n,s);else{const r=e?Object.getOwnPropertyNames(s):Object.keys(s),o=r.length;let a;for(n=0;n<o;n++)a=r[n],t.call(null,s[a],a,s)}}function Oa(s,t){t=t.toLowerCase();const e=Object.keys(s);let n=e.length,i;for(;n-- >0;)if(i=e[n],t===i.toLowerCase())return i;return null}const Oe=(()=>typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global)(),za=s=>!_n(s)&&s!==Oe;function Oi(){const{caseless:s}=za(this)&&this||{},t={},e=(n,i)=>{const r=s&&Oa(t,i)||i;ps(t[r])&&ps(n)?t[r]=Oi(t[r],n):ps(n)?t[r]=Oi({},n):sn(n)?t[r]=n.slice():t[r]=n};for(let n=0,i=arguments.length;n<i;n++)arguments[n]&&Sn(arguments[n],e);return t}const nd=(s,t,e,{allOwnKeys:n}={})=>(Sn(t,(i,r)=>{e&&zt(i)?s[r]=Da(i,e):s[r]=i},{allOwnKeys:n}),s),sd=s=>(s.charCodeAt(0)===65279&&(s=s.slice(1)),s),id=(s,t,e,n)=>{s.prototype=Object.create(t.prototype,n),s.prototype.constructor=s,Object.defineProperty(s,"super",{value:t.prototype}),e&&Object.assign(s.prototype,e)},rd=(s,t,e,n)=>{let i,r,o;const a={};if(t=t||{},s==null)return t;do{for(i=Object.getOwnPropertyNames(s),r=i.length;r-- >0;)o=i[r],(!n||n(o,s,t))&&!a[o]&&(t[o]=s[o],a[o]=!0);s=e!==!1&&Li(s)}while(s&&(!e||e(s,t))&&s!==Object.prototype);return t},od=(s,t,e)=>{s=String(s),(e===void 0||e>s.length)&&(e=s.length),e-=t.length;const n=s.indexOf(t,e);return n!==-1&&n===e},ad=s=>{if(!s)return null;if(sn(s))return s;let t=s.length;if(!La(t))return null;const e=new Array(t);for(;t-- >0;)e[t]=s[t];return e},cd=(s=>t=>s&&t instanceof s)(typeof Uint8Array<"u"&&Li(Uint8Array)),hd=(s,t)=>{const n=(s&&s[Symbol.iterator]).call(s);let i;for(;(i=n.next())&&!i.done;){const r=i.value;t.call(s,r[0],r[1])}},ud=(s,t)=>{let e;const n=[];for(;(e=s.exec(t))!==null;)n.push(e);return n},ld=Jt("HTMLFormElement"),fd=s=>s.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,n,i){return n.toUpperCase()+i}),Fa=(({hasOwnProperty:s})=>(t,e)=>s.call(t,e))(Object.prototype),dd=Jt("RegExp"),Ba=(s,t)=>{const e=Object.getOwnPropertyDescriptors(s),n={};Sn(e,(i,r)=>{let o;(o=t(i,r,s))!==!1&&(n[r]=o||i)}),Object.defineProperties(s,n)},md=s=>{Ba(s,(t,e)=>{if(zt(s)&&["arguments","caller","callee"].indexOf(e)!==-1)return!1;const n=s[e];if(zt(n)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+e+"'")})}})},pd=(s,t)=>{const e={},n=i=>{i.forEach(r=>{e[r]=!0})};return sn(s)?n(s):n(String(s).split(t)),e},gd=()=>{},yd=(s,t)=>s!=null&&Number.isFinite(s=+s)?s:t;function wd(s){return!!(s&&zt(s.append)&&s[Symbol.toStringTag]==="FormData"&&s[Symbol.iterator])}const xd=s=>{const t=new Array(10),e=(n,i)=>{if(ms(n)){if(t.indexOf(n)>=0)return;if(!("toJSON"in n)){t[i]=n;const r=sn(n)?[]:{};return Sn(n,(o,a)=>{const c=e(o,i+1);!_n(c)&&(r[a]=c)}),t[i]=void 0,r}}return n};return e(s,0)},bd=Jt("AsyncFunction"),vd=s=>s&&(ms(s)||zt(s))&&zt(s.then)&&zt(s.catch),Na=((s,t)=>s?setImmediate:t?((e,n)=>(Oe.addEventListener("message",({source:i,data:r})=>{i===Oe&&r===e&&n.length&&n.shift()()},!1),i=>{n.push(i),Oe.postMessage(e,"*")}))(`axios@${Math.random()}`,[]):e=>setTimeout(e))(typeof setImmediate=="function",zt(Oe.postMessage)),_d=typeof queueMicrotask<"u"?queueMicrotask.bind(Oe):typeof process<"u"&&process.nextTick||Na,A={isArray:sn,isArrayBuffer:Ra,isBuffer:Yf,isFormData:Wf,isArrayBufferView:Uf,isString:Xf,isNumber:La,isBoolean:$f,isObject:ms,isPlainObject:ps,isReadableStream:Zf,isRequest:Qf,isResponse:Kf,isHeaders:td,isUndefined:_n,isDate:Vf,isFile:Gf,isBlob:qf,isRegExp:dd,isFunction:zt,isStream:Hf,isURLSearchParams:Jf,isTypedArray:cd,isFileList:jf,forEach:Sn,merge:Oi,extend:nd,trim:ed,stripBOM:sd,inherits:id,toFlatObject:rd,kindOf:fs,kindOfTest:Jt,endsWith:od,toArray:ad,forEachEntry:hd,matchAll:ud,isHTMLForm:ld,hasOwnProperty:Fa,hasOwnProp:Fa,reduceDescriptors:Ba,freezeMethods:md,toObjectSet:pd,toCamelCase:fd,noop:gd,toFiniteNumber:yd,findKey:Oa,global:Oe,isContextDefined:za,isSpecCompliantForm:wd,toJSONObject:xd,isAsyncFn:bd,isThenable:vd,setImmediate:Na,asap:_d};function Y(s,t,e,n,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=s,this.name="AxiosError",t&&(this.code=t),e&&(this.config=e),n&&(this.request=n),i&&(this.response=i,this.status=i.status?i.status:null)}A.inherits(Y,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:A.toJSONObject(this.config),code:this.code,status:this.status}}});const Ya=Y.prototype,Ua={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(s=>{Ua[s]={value:s}}),Object.defineProperties(Y,Ua),Object.defineProperty(Ya,"isAxiosError",{value:!0}),Y.from=(s,t,e,n,i,r)=>{const o=Object.create(Ya);return A.toFlatObject(s,o,function(c){return c!==Error.prototype},a=>a!=="isAxiosError"),Y.call(o,s.message,t,e,n,i),o.cause=s,o.name=s.name,r&&Object.assign(o,r),o};const Sd=null;function zi(s){return A.isPlainObject(s)||A.isArray(s)}function Xa(s){return A.endsWith(s,"[]")?s.slice(0,-2):s}function $a(s,t,e){return s?s.concat(t).map(function(i,r){return i=Xa(i),!e&&r?"["+i+"]":i}).join(e?".":""):t}function Cd(s){return A.isArray(s)&&!s.some(zi)}const Td=A.toFlatObject(A,{},null,function(t){return/^is[A-Z]/.test(t)});function gs(s,t,e){if(!A.isObject(s))throw new TypeError("target must be an object");t=t||new FormData,e=A.toFlatObject(e,{metaTokens:!0,dots:!1,indexes:!1},!1,function(w,b){return!A.isUndefined(b[w])});const n=e.metaTokens,i=e.visitor||u,r=e.dots,o=e.indexes,c=(e.Blob||typeof Blob<"u"&&Blob)&&A.isSpecCompliantForm(t);if(!A.isFunction(i))throw new TypeError("visitor must be a function");function h(p){if(p===null)return"";if(A.isDate(p))return p.toISOString();if(!c&&A.isBlob(p))throw new Y("Blob is not supported. Use a Buffer instead.");return A.isArrayBuffer(p)||A.isTypedArray(p)?c&&typeof Blob=="function"?new Blob([p]):Buffer.from(p):p}function u(p,w,b){let x=p;if(p&&!b&&typeof p=="object"){if(A.endsWith(w,"{}"))w=n?w:w.slice(0,-2),p=JSON.stringify(p);else if(A.isArray(p)&&Cd(p)||(A.isFileList(p)||A.endsWith(w,"[]"))&&(x=A.toArray(p)))return w=Xa(w),x.forEach(function(v,_){!(A.isUndefined(v)||v===null)&&t.append(o===!0?$a([w],_,r):o===null?w:w+"[]",h(v))}),!1}return zi(p)?!0:(t.append($a(b,w,r),h(p)),!1)}const l=[],d=Object.assign(Td,{defaultVisitor:u,convertValue:h,isVisitable:zi});function f(p,w){if(!A.isUndefined(p)){if(l.indexOf(p)!==-1)throw Error("Circular reference detected in "+w.join("."));l.push(p),A.forEach(p,function(x,g){(!(A.isUndefined(x)||x===null)&&i.call(t,x,A.isString(g)?g.trim():g,w,d))===!0&&f(x,w?w.concat(g):[g])}),l.pop()}}if(!A.isObject(s))throw new TypeError("data must be an object");return f(s),t}function Va(s){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(s).replace(/[!'()~]|%20|%00/g,function(n){return t[n]})}function Fi(s,t){this._pairs=[],s&&gs(s,this,t)}const Ga=Fi.prototype;Ga.append=function(t,e){this._pairs.push([t,e])},Ga.toString=function(t){const e=t?function(n){return t.call(this,n,Va)}:Va;return this._pairs.map(function(i){return e(i[0])+"="+e(i[1])},"").join("&")};function Ed(s){return encodeURIComponent(s).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function qa(s,t,e){if(!t)return s;const n=e&&e.encode||Ed;A.isFunction(e)&&(e={serialize:e});const i=e&&e.serialize;let r;if(i?r=i(t,e):r=A.isURLSearchParams(t)?t.toString():new Fi(t,e).toString(n),r){const o=s.indexOf("#");o!==-1&&(s=s.slice(0,o)),s+=(s.indexOf("?")===-1?"?":"&")+r}return s}class Pd{constructor(){this.handlers=[]}use(t,e,n){return this.handlers.push({fulfilled:t,rejected:e,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){A.forEach(this.handlers,function(n){n!==null&&t(n)})}}const ja=Pd,Ha={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Md={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:Fi,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},Bi=typeof window<"u"&&typeof document<"u",Ni=typeof navigator=="object"&&navigator||void 0,Ad=Bi&&(!Ni||["ReactNative","NativeScript","NS"].indexOf(Ni.product)<0),kd=(()=>typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function")(),Id=Bi&&window.location.href||"http://localhost",bt={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Bi,hasStandardBrowserEnv:Ad,hasStandardBrowserWebWorkerEnv:kd,navigator:Ni,origin:Id},Symbol.toStringTag,{value:"Module"})),...Md};function Dd(s,t){return gs(s,new bt.classes.URLSearchParams,Object.assign({visitor:function(e,n,i,r){return bt.isNode&&A.isBuffer(e)?(this.append(n,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)}},t))}function Rd(s){return A.matchAll(/\w+|\[(\w*)]/g,s).map(t=>t[0]==="[]"?"":t[1]||t[0])}function Ld(s){const t={},e=Object.keys(s);let n;const i=e.length;let r;for(n=0;n<i;n++)r=e[n],t[r]=s[r];return t}function Wa(s){function t(e,n,i,r){let o=e[r++];if(o==="__proto__")return!0;const a=Number.isFinite(+o),c=r>=e.length;return o=!o&&A.isArray(i)?i.length:o,c?(A.hasOwnProp(i,o)?i[o]=[i[o],n]:i[o]=n,!a):((!i[o]||!A.isObject(i[o]))&&(i[o]=[]),t(e,n,i[o],r)&&A.isArray(i[o])&&(i[o]=Ld(i[o])),!a)}if(A.isFormData(s)&&A.isFunction(s.entries)){const e={};return A.forEachEntry(s,(n,i)=>{t(Rd(n),i,e,0)}),e}return null}function Od(s,t,e){if(A.isString(s))try{return(t||JSON.parse)(s),A.trim(s)}catch(n){if(n.name!=="SyntaxError")throw n}return(e||JSON.stringify)(s)}const Yi={transitional:Ha,adapter:["xhr","http","fetch"],transformRequest:[function(t,e){const n=e.getContentType()||"",i=n.indexOf("application/json")>-1,r=A.isObject(t);if(r&&A.isHTMLForm(t)&&(t=new FormData(t)),A.isFormData(t))return i?JSON.stringify(Wa(t)):t;if(A.isArrayBuffer(t)||A.isBuffer(t)||A.isStream(t)||A.isFile(t)||A.isBlob(t)||A.isReadableStream(t))return t;if(A.isArrayBufferView(t))return t.buffer;if(A.isURLSearchParams(t))return e.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let a;if(r){if(n.indexOf("application/x-www-form-urlencoded")>-1)return Dd(t,this.formSerializer).toString();if((a=A.isFileList(t))||n.indexOf("multipart/form-data")>-1){const c=this.env&&this.env.FormData;return gs(a?{"files[]":t}:t,c&&new c,this.formSerializer)}}return r||i?(e.setContentType("application/json",!1),Od(t)):t}],transformResponse:[function(t){const e=this.transitional||Yi.transitional,n=e&&e.forcedJSONParsing,i=this.responseType==="json";if(A.isResponse(t)||A.isReadableStream(t))return t;if(t&&A.isString(t)&&(n&&!this.responseType||i)){const o=!(e&&e.silentJSONParsing)&&i;try{return JSON.parse(t)}catch(a){if(o)throw a.name==="SyntaxError"?Y.from(a,Y.ERR_BAD_RESPONSE,this,null,this.response):a}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:bt.classes.FormData,Blob:bt.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};A.forEach(["delete","get","head","post","put","patch"],s=>{Yi.headers[s]={}});const Ui=Yi,zd=A.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"]),Fd=s=>{const t={};let e,n,i;return s&&s.split(`
|
|
13
|
-
`).forEach(function(o){i=o.indexOf(":"),e=o.substring(0,i).trim().toLowerCase(),n=o.substring(i+1).trim(),!(!e||t[e]&&
|
|
14
|
-
`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...e){const n=new this(t);return e.forEach(i=>n.set(i)),n}static accessor(t){const n=(this[Ja]=this[Ja]={accessors:{}}).accessors,i=this.prototype;function r(o){const a=Cn(o);n[a]||(Ud(i,o),n[a]=!0)}return A.isArray(t)?t.forEach(r):r(t),this}}ws.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),A.reduceDescriptors(ws.prototype,({value:s},t)=>{let e=t[0].toUpperCase()+t.slice(1);return{get:()=>s,set(n){this[e]=n}}}),A.freezeMethods(ws);const Zt=ws;function $i(s,t){const e=this||Ui,n=t||e,i=Zt.from(n.headers);let r=n.data;return A.forEach(s,function(a){r=a.call(e,r,i.normalize(),t?t.status:void 0)}),i.normalize(),r}function Za(s){return!!(s&&s.__CANCEL__)}function rn(s,t,e){Y.call(this,s??"canceled",Y.ERR_CANCELED,t,e),this.name="CanceledError"}A.inherits(rn,Y,{__CANCEL__:!0});function Qa(s,t,e){const n=e.config.validateStatus;!e.status||!n||n(e.status)?s(e):t(new Y("Request failed with status code "+e.status,[Y.ERR_BAD_REQUEST,Y.ERR_BAD_RESPONSE][Math.floor(e.status/100)-4],e.config,e.request,e))}function Xd(s){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(s);return t&&t[1]||""}function $d(s,t){s=s||10;const e=new Array(s),n=new Array(s);let i=0,r=0,o;return t=t!==void 0?t:1e3,function(c){const h=Date.now(),u=n[r];o||(o=h),e[i]=c,n[i]=h;let l=r,d=0;for(;l!==i;)d+=e[l++],l=l%s;if(i=(i+1)%s,i===r&&(r=(r+1)%s),h-o<t)return;const f=u&&h-u;return f?Math.round(d*1e3/f):void 0}}function Vd(s,t){let e=0,n=1e3/t,i,r;const o=(h,u=Date.now())=>{e=u,i=null,r&&(clearTimeout(r),r=null),s.apply(null,h)};return[(...h)=>{const u=Date.now(),l=u-e;l>=n?o(h,u):(i=h,r||(r=setTimeout(()=>{r=null,o(i)},n-l)))},()=>i&&o(i)]}const xs=(s,t,e=3)=>{let n=0;const i=$d(50,250);return Vd(r=>{const o=r.loaded,a=r.lengthComputable?r.total:void 0,c=o-n,h=i(c),u=o<=a;n=o;const l={loaded:o,total:a,progress:a?o/a:void 0,bytes:c,rate:h||void 0,estimated:h&&a&&u?(a-o)/h:void 0,event:r,lengthComputable:a!=null,[t?"download":"upload"]:!0};s(l)},e)},Ka=(s,t)=>{const e=s!=null;return[n=>t[0]({lengthComputable:e,total:s,loaded:n}),t[1]]},tc=s=>(...t)=>A.asap(()=>s(...t)),Gd=bt.hasStandardBrowserEnv?((s,t)=>e=>(e=new URL(e,bt.origin),s.protocol===e.protocol&&s.host===e.host&&(t||s.port===e.port)))(new URL(bt.origin),bt.navigator&&/(msie|trident)/i.test(bt.navigator.userAgent)):()=>!0,qd=bt.hasStandardBrowserEnv?{write(s,t,e,n,i,r){const o=[s+"="+encodeURIComponent(t)];A.isNumber(e)&&o.push("expires="+new Date(e).toGMTString()),A.isString(n)&&o.push("path="+n),A.isString(i)&&o.push("domain="+i),r===!0&&o.push("secure"),document.cookie=o.join("; ")},read(s){const t=document.cookie.match(new RegExp("(^|;\\s*)("+s+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(s){this.write(s,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function jd(s){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(s)}function Hd(s,t){return t?s.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):s}function ec(s,t,e){let n=!jd(t);return s&&(n||e==!1)?Hd(s,t):t}const nc=s=>s instanceof Zt?{...s}:s;function ze(s,t){t=t||{};const e={};function n(h,u,l,d){return A.isPlainObject(h)&&A.isPlainObject(u)?A.merge.call({caseless:d},h,u):A.isPlainObject(u)?A.merge({},u):A.isArray(u)?u.slice():u}function i(h,u,l,d){if(A.isUndefined(u)){if(!A.isUndefined(h))return n(void 0,h,l,d)}else return n(h,u,l,d)}function r(h,u){if(!A.isUndefined(u))return n(void 0,u)}function o(h,u){if(A.isUndefined(u)){if(!A.isUndefined(h))return n(void 0,h)}else return n(void 0,u)}function a(h,u,l){if(l in t)return n(h,u);if(l in s)return n(void 0,h)}const c={url:r,method:r,data:r,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:a,headers:(h,u,l)=>i(nc(h),nc(u),l,!0)};return A.forEach(Object.keys(Object.assign({},s,t)),function(u){const l=c[u]||i,d=l(s[u],t[u],u);A.isUndefined(d)&&l!==a||(e[u]=d)}),e}const sc=s=>{const t=ze({},s);let{data:e,withXSRFToken:n,xsrfHeaderName:i,xsrfCookieName:r,headers:o,auth:a}=t;t.headers=o=Zt.from(o),t.url=qa(ec(t.baseURL,t.url,t.allowAbsoluteUrls),s.params,s.paramsSerializer),a&&o.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):"")));let c;if(A.isFormData(e)){if(bt.hasStandardBrowserEnv||bt.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if((c=o.getContentType())!==!1){const[h,...u]=c?c.split(";").map(l=>l.trim()).filter(Boolean):[];o.setContentType([h||"multipart/form-data",...u].join("; "))}}if(bt.hasStandardBrowserEnv&&(n&&A.isFunction(n)&&(n=n(t)),n||n!==!1&&Gd(t.url))){const h=i&&r&&qd.read(r);h&&o.set(i,h)}return t},Wd=typeof XMLHttpRequest<"u"&&function(s){return new Promise(function(e,n){const i=sc(s);let r=i.data;const o=Zt.from(i.headers).normalize();let{responseType:a,onUploadProgress:c,onDownloadProgress:h}=i,u,l,d,f,p;function w(){f&&f(),p&&p(),i.cancelToken&&i.cancelToken.unsubscribe(u),i.signal&&i.signal.removeEventListener("abort",u)}let b=new XMLHttpRequest;b.open(i.method.toUpperCase(),i.url,!0),b.timeout=i.timeout;function x(){if(!b)return;const v=Zt.from("getAllResponseHeaders"in b&&b.getAllResponseHeaders()),E={data:!a||a==="text"||a==="json"?b.responseText:b.response,status:b.status,statusText:b.statusText,headers:v,config:s,request:b};Qa(function(I){e(I),w()},function(I){n(I),w()},E),b=null}"onloadend"in b?b.onloadend=x:b.onreadystatechange=function(){!b||b.readyState!==4||b.status===0&&!(b.responseURL&&b.responseURL.indexOf("file:")===0)||setTimeout(x)},b.onabort=function(){b&&(n(new Y("Request aborted",Y.ECONNABORTED,s,b)),b=null)},b.onerror=function(){n(new Y("Network Error",Y.ERR_NETWORK,s,b)),b=null},b.ontimeout=function(){let _=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded";const E=i.transitional||Ha;i.timeoutErrorMessage&&(_=i.timeoutErrorMessage),n(new Y(_,E.clarifyTimeoutError?Y.ETIMEDOUT:Y.ECONNABORTED,s,b)),b=null},r===void 0&&o.setContentType(null),"setRequestHeader"in b&&A.forEach(o.toJSON(),function(_,E){b.setRequestHeader(E,_)}),A.isUndefined(i.withCredentials)||(b.withCredentials=!!i.withCredentials),a&&a!=="json"&&(b.responseType=i.responseType),h&&([d,p]=xs(h,!0),b.addEventListener("progress",d)),c&&b.upload&&([l,f]=xs(c),b.upload.addEventListener("progress",l),b.upload.addEventListener("loadend",f)),(i.cancelToken||i.signal)&&(u=v=>{b&&(n(!v||v.type?new rn(null,s,b):v),b.abort(),b=null)},i.cancelToken&&i.cancelToken.subscribe(u),i.signal&&(i.signal.aborted?u():i.signal.addEventListener("abort",u)));const g=Xd(i.url);if(g&&bt.protocols.indexOf(g)===-1){n(new Y("Unsupported protocol "+g+":",Y.ERR_BAD_REQUEST,s));return}b.send(r||null)})},Jd=(s,t)=>{const{length:e}=s=s?s.filter(Boolean):[];if(t||e){let n=new AbortController,i;const r=function(h){if(!i){i=!0,a();const u=h instanceof Error?h:this.reason;n.abort(u instanceof Y?u:new rn(u instanceof Error?u.message:u))}};let o=t&&setTimeout(()=>{o=null,r(new Y(`timeout ${t} of ms exceeded`,Y.ETIMEDOUT))},t);const a=()=>{s&&(o&&clearTimeout(o),o=null,s.forEach(h=>{h.unsubscribe?h.unsubscribe(r):h.removeEventListener("abort",r)}),s=null)};s.forEach(h=>h.addEventListener("abort",r));const{signal:c}=n;return c.unsubscribe=()=>A.asap(a),c}},Zd=function*(s,t){let e=s.byteLength;if(!t||e<t){yield s;return}let n=0,i;for(;n<e;)i=n+t,yield s.slice(n,i),n=i},Qd=async function*(s,t){for await(const e of Kd(s))yield*Zd(e,t)},Kd=async function*(s){if(s[Symbol.asyncIterator]){yield*s;return}const t=s.getReader();try{for(;;){const{done:e,value:n}=await t.read();if(e)break;yield n}}finally{await t.cancel()}},ic=(s,t,e,n)=>{const i=Qd(s,t);let r=0,o,a=c=>{o||(o=!0,n&&n(c))};return new ReadableStream({async pull(c){try{const{done:h,value:u}=await i.next();if(h){a(),c.close();return}let l=u.byteLength;if(e){let d=r+=l;e(d)}c.enqueue(new Uint8Array(u))}catch(h){throw a(h),h}},cancel(c){return a(c),i.return()}},{highWaterMark:2})},bs=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",rc=bs&&typeof ReadableStream=="function",tm=bs&&(typeof TextEncoder=="function"?(s=>t=>s.encode(t))(new TextEncoder):async s=>new Uint8Array(await new Response(s).arrayBuffer())),oc=(s,...t)=>{try{return!!s(...t)}catch{return!1}},em=rc&&oc(()=>{let s=!1;const t=new Request(bt.origin,{body:new ReadableStream,method:"POST",get duplex(){return s=!0,"half"}}).headers.has("Content-Type");return s&&!t}),ac=64*1024,Vi=rc&&oc(()=>A.isReadableStream(new Response("").body)),vs={stream:Vi&&(s=>s.body)};bs&&(s=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!vs[t]&&(vs[t]=A.isFunction(s[t])?e=>e[t]():(e,n)=>{throw new Y(`Response type '${t}' is not supported`,Y.ERR_NOT_SUPPORT,n)})})})(new Response);const nm=async s=>{if(s==null)return 0;if(A.isBlob(s))return s.size;if(A.isSpecCompliantForm(s))return(await new Request(bt.origin,{method:"POST",body:s}).arrayBuffer()).byteLength;if(A.isArrayBufferView(s)||A.isArrayBuffer(s))return s.byteLength;if(A.isURLSearchParams(s)&&(s=s+""),A.isString(s))return(await tm(s)).byteLength},sm=async(s,t)=>{const e=A.toFiniteNumber(s.getContentLength());return e??nm(t)},Gi={http:Sd,xhr:Wd,fetch:bs&&(async s=>{let{url:t,method:e,data:n,signal:i,cancelToken:r,timeout:o,onDownloadProgress:a,onUploadProgress:c,responseType:h,headers:u,withCredentials:l="same-origin",fetchOptions:d}=sc(s);h=h?(h+"").toLowerCase():"text";let f=Jd([i,r&&r.toAbortSignal()],o),p;const w=f&&f.unsubscribe&&(()=>{f.unsubscribe()});let b;try{if(c&&em&&e!=="get"&&e!=="head"&&(b=await sm(u,n))!==0){let E=new Request(t,{method:"POST",body:n,duplex:"half"}),C;if(A.isFormData(n)&&(C=E.headers.get("content-type"))&&u.setContentType(C),E.body){const[I,F]=Ka(b,xs(tc(c)));n=ic(E.body,ac,I,F)}}A.isString(l)||(l=l?"include":"omit");const x="credentials"in Request.prototype;p=new Request(t,{...d,signal:f,method:e.toUpperCase(),headers:u.normalize().toJSON(),body:n,duplex:"half",credentials:x?l:void 0});let g=await fetch(p);const v=Vi&&(h==="stream"||h==="response");if(Vi&&(a||v&&w)){const E={};["status","statusText","headers"].forEach(N=>{E[N]=g[N]});const C=A.toFiniteNumber(g.headers.get("content-length")),[I,F]=a&&Ka(C,xs(tc(a),!0))||[];g=new Response(ic(g.body,ac,I,()=>{F&&F(),w&&w()}),E)}h=h||"text";let _=await vs[A.findKey(vs,h)||"text"](g,s);return!v&&w&&w(),await new Promise((E,C)=>{Qa(E,C,{data:_,headers:Zt.from(g.headers),status:g.status,statusText:g.statusText,config:s,request:p})})}catch(x){throw w&&w(),x&&x.name==="TypeError"&&/fetch/i.test(x.message)?Object.assign(new Y("Network Error",Y.ERR_NETWORK,s,p),{cause:x.cause||x}):Y.from(x,x&&x.code,s,p)}})};A.forEach(Gi,(s,t)=>{if(s){try{Object.defineProperty(s,"name",{value:t})}catch{}Object.defineProperty(s,"adapterName",{value:t})}});const cc=s=>`- ${s}`,im=s=>A.isFunction(s)||s===null||s===!1,hc={getAdapter:s=>{s=A.isArray(s)?s:[s];const{length:t}=s;let e,n;const i={};for(let r=0;r<t;r++){e=s[r];let o;if(n=e,!im(e)&&(n=Gi[(o=String(e)).toLowerCase()],n===void 0))throw new Y(`Unknown adapter '${o}'`);if(n)break;i[o||"#"+r]=n}if(!n){const r=Object.entries(i).map(([a,c])=>`adapter ${a} `+(c===!1?"is not supported by the environment":"is not available in the build"));let o=t?r.length>1?`since :
|
|
15
|
-
`+r.map(
|
|
16
|
-
`):" "+
|
|
17
|
-
`+r):n.stack=r}catch{}}throw n}}_request(t,e){typeof t=="string"?(e=e||{},e.url=t):e=t||{},e=ze(this.defaults,e);const{transitional:n,paramsSerializer:i,headers:r}=e;n!==void 0&&Ss.assertOptions(n,{silentJSONParsing:ie.transitional(ie.boolean),forcedJSONParsing:ie.transitional(ie.boolean),clarifyTimeoutError:ie.transitional(ie.boolean)},!1),i!=null&&(A.isFunction(i)?e.paramsSerializer={serialize:i}:Ss.assertOptions(i,{encode:ie.function,serialize:ie.function},!0)),e.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?e.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:e.allowAbsoluteUrls=!0),Ss.assertOptions(e,{baseUrl:ie.spelling("baseURL"),withXsrfToken:ie.spelling("withXSRFToken")},!0),e.method=(e.method||this.defaults.method||"get").toLowerCase();let o=r&&A.merge(r.common,r[e.method]);r&&A.forEach(["delete","get","head","post","put","patch","common"],p=>{delete r[p]}),e.headers=Zt.concat(o,r);const a=[];let c=!0;this.interceptors.request.forEach(function(w){typeof w.runWhen=="function"&&w.runWhen(e)===!1||(c=c&&w.synchronous,a.unshift(w.fulfilled,w.rejected))});const h=[];this.interceptors.response.forEach(function(w){h.push(w.fulfilled,w.rejected)});let u,l=0,d;if(!c){const p=[uc.bind(this),void 0];for(p.unshift.apply(p,a),p.push.apply(p,h),d=p.length,u=Promise.resolve(e);l<d;)u=u.then(p[l++],p[l++]);return u}d=a.length;let f=e;for(l=0;l<d;){const p=a[l++],w=a[l++];try{f=p(f)}catch(b){w.call(this,b);break}}try{u=uc.call(this,f)}catch(p){return Promise.reject(p)}for(l=0,d=h.length;l<d;)u=u.then(h[l++],h[l++]);return u}getUri(t){t=ze(this.defaults,t);const e=ec(t.baseURL,t.url,t.allowAbsoluteUrls);return qa(e,t.params,t.paramsSerializer)}}A.forEach(["delete","get","head","options"],function(t){Cs.prototype[t]=function(e,n){return this.request(ze(n||{},{method:t,url:e,data:(n||{}).data}))}}),A.forEach(["post","put","patch"],function(t){function e(n){return function(r,o,a){return this.request(ze(a||{},{method:t,headers:n?{"Content-Type":"multipart/form-data"}:{},url:r,data:o}))}}Cs.prototype[t]=e(),Cs.prototype[t+"Form"]=e(!0)});const Ts=Cs;class ji{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let e;this.promise=new Promise(function(r){e=r});const n=this;this.promise.then(i=>{if(!n._listeners)return;let r=n._listeners.length;for(;r-- >0;)n._listeners[r](i);n._listeners=null}),this.promise.then=i=>{let r;const o=new Promise(a=>{n.subscribe(a),r=a}).then(i);return o.cancel=function(){n.unsubscribe(r)},o},t(function(r,o,a){n.reason||(n.reason=new rn(r,o,a),e(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const e=this._listeners.indexOf(t);e!==-1&&this._listeners.splice(e,1)}toAbortSignal(){const t=new AbortController,e=n=>{t.abort(n)};return this.subscribe(e),t.signal.unsubscribe=()=>this.unsubscribe(e),t.signal}static source(){let t;return{token:new ji(function(i){t=i}),cancel:t}}}const om=ji;function am(s){return function(e){return s.apply(null,e)}}function cm(s){return A.isObject(s)&&s.isAxiosError===!0}const Hi={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(Hi).forEach(([s,t])=>{Hi[t]=s});const hm=Hi;function dc(s){const t=new Ts(s),e=Da(Ts.prototype.request,t);return A.extend(e,Ts.prototype,t,{allOwnKeys:!0}),A.extend(e,t,null,{allOwnKeys:!0}),e.create=function(i){return dc(ze(s,i))},e}const at=dc(Ui);at.Axios=Ts,at.CanceledError=rn,at.CancelToken=om,at.isCancel=Za,at.VERSION=lc,at.toFormData=gs,at.AxiosError=Y,at.Cancel=at.CanceledError,at.all=function(t){return Promise.all(t)},at.spread=am,at.isAxiosError=cm,at.mergeConfig=ze,at.AxiosHeaders=Zt,at.formToJSON=s=>Wa(A.isHTMLForm(s)?new FormData(s):s),at.getAdapter=hc.getAdapter,at.HttpStatusCode=hm,at.default=at;const um=at;class Wi{instance;canceler;retryCount=0;cacheTime=0;caches=new ga;constructor(t){this.instance=um.create(t),this.canceler=new lm,this.retryCount=t?.retry||0,this.cacheTime=t?.cache||0,this.instance.interceptors.request.use(e=>(this.canceler.pendingRequest(e),t?.interceptor?.request?.(e),e),e=>(this.canceler.cancelRequest(e.config),t?.interceptor?.requestError?.(e),e)),this.instance.interceptors.response.use(e=>(this.canceler.confirmRequest(e.config),t?.interceptor?.response?.(e),e.status==200?Promise.resolve(e):Promise.reject(e)),e=>(this.canceler.cancelRequest(e.config),t?.interceptor?.responseError?.(e),Promise.reject(e.response)))}request(t){let e=this.instance.request;const n=t.retry||this.retryCount;n&&(e=vi(e,n));const i=t.cache||this.cacheTime;return i&&(e=_i(e,i,this.caches)),e(t)}cancel(t){this.canceler.cancelRequest(t)}get(t,e){return this.request({...e,method:"get",url:t})}delete(t,e){return this.request({...e,method:"delete",url:t})}head(t,e){return this.request({...e,method:"head",url:t})}options(t,e){return this.request({...e,method:"options",url:t})}post(t,e,n){return this.request({...n,method:"post",url:t,data:e})}postBlob(t,e,n){return n={...n,headers:{...n?.headers,"Content-Type":"multipart/form-data"}},this.request({...n,method:"post",url:t,data:e})}postForm(t,e,n){return this.instance.postForm(t,e,{...n})}put(t,e,n){return this.request({...n,method:"put",url:t,data:e})}patch(t,e,n){return this.request({...n,method:"patch",url:t,data:e})}getUri(t){return this.instance.getUri(t)}}class lm{pendingRequestMap;constructor(){this.pendingRequestMap=new Map}getRequestId(t){const{method:e,url:n,params:i,data:r}=t;return yi({method:e,url:n,params:i,data:r})}pendingRequest(t){const e=this.getRequestId(t);if(this.pendingRequestMap.has(e))t.signal=this.pendingRequestMap.get(e)?.signal;else{const n=new AbortController;t.signal=n.signal,this.pendingRequestMap.set(e,n)}}confirmRequest(t){if(this.pendingRequestMap.size===0)return;const e=this.getRequestId(t);this.pendingRequestMap.has(e)&&this.pendingRequestMap.delete(e)}cancelRequest(t){if(this.pendingRequestMap.size===0)return;const e=this.getRequestId(t);this.pendingRequestMap.has(e)&&(this.pendingRequestMap.get(e)?.abort(),this.pendingRequestMap.delete(e))}cancelAllRequest(){const t=this.pendingRequestMap.values();for(const e of t)e.abort();this.pendingRequestMap.clear()}}const Ji=s=>new XMLSerializer().serializeToString(s),fm=(s,t="text/html")=>new DOMParser().parseFromString(s,t),Zi=(s,t=Et.SVG,e=ss.utf8)=>xi(Ji(s),t,e);async function Qi(s=["*"],t){let e=[];const n=document.createElement("input");return n.setAttribute("type","file"),n.setAttribute("visibility","hidden"),n.setAttribute("accept",s.join(",")),t&&n.setAttribute("multiple","true"),n.addEventListener("click",i=>{n.value=""},!1),new Promise((i,r)=>{n.addEventListener("change",o=>{e=Array.from(o.target.files||[]),e.length===0?r(new Error("Cancel")):i(e)},!1),window.addEventListener("focus",()=>{setTimeout(()=>{e.length===0&&r(new Error("Cancel"))},1e3)},{once:!0}),n.click()}).then(i=>(n.remove(),i)).catch(i=>{throw n.remove(),i})}function Tn(s,t=Xt.text,e){return new Promise((n,i)=>{const r=new FileReader;switch(r.addEventListener("progress",o=>{e?.(o.loaded,o.total)}),r.addEventListener("load",o=>{n(o.target?.result)}),r.addEventListener("error",o=>{i(o)}),t){case Xt.dataURL:r.readAsDataURL(s);break;case Xt.binaryString:r.readAsBinaryString(s);break;case Xt.arraybuffer:r.readAsArrayBuffer(s);break;case Xt.text:default:r.readAsText(s)}})}async function dm(s){const t=await Tn(s,Xt.arraybuffer);return nf(t)}const mm=s=>{let t;return s instanceof File?t=s.name:t=s,t.match(/\.([0-9a-z]+)(?:[\\?#]|$)/i)?.[1]||""};function pm(s){switch(s.toLowerCase()){case"jpg":case"jpeg":return Et.JPEG;case"gif":return Et.GIF;case"svg":return Et.SVG;case"pdf":return Et.PDF;case"png":default:return Et.PNG}}function mc(s,t,e,n,i,r,o){const a=new FileReader;a.addEventListener("load",c=>{if(!c.target||!c.target.result)return t(c);if(e.append(c.target.result),o<n.size)mc(s,t,e,n,i,o,Math.min(o+i,n.size));else return s(e.end())}),a.addEventListener("error",c=>t(c)),a.readAsArrayBuffer(n.slice(r,o))}async function pc(s,t=1048576){return await new Promise((e,n)=>mc(e,n,new Bf.ArrayBuffer,s,t,0,Math.min(t,s.size)))}class gm{axios;checkURL;uploadURL;file;fileHash;chunkSize;chunks;currentChunk=0;isUploading=!1;begin=0;end=0;timer;time=[0,0,0,0,0,0];onExist;onStart;onProgress;onComplete;onTime;constructor(t){this.axios=new Wi({baseURL:t.baseURL,interceptor:{response:e=>{e.config.url==this.uploadURL&&e.status==200&&(this.onProgress?.(this.currentChunk++,this.chunks),this.end==this.file.size?(this.isUploading=!1,this.stopTimeCount(),this.onComplete?.()):this.isUploading&&this.uploadChunk())}}}),this.checkURL=t.checkURL,this.uploadURL=t.uploadURL,this.file=t.file,this.chunkSize=t.chunkSize||1048576,this.chunks=Math.ceil(this.file.size/this.chunkSize),this.onExist=t.onExist,this.onStart=t.onStart,this.onProgress=t.onProgress,this.onComplete=t.onComplete,this.onTime=t.onTime}async start(){this.fileHash||(this.fileHash=await pc(this.file,this.chunkSize)),(await this.axios.post(this.checkURL,{fileName:this.file.name,fileHash:this.fileHash})).data.isExist?(this.isUploading=!1,this.onExist?.()):this.isUploading||(this.onStart?.(),this.startTimeCount(),await this.uploadChunk())}pause(){this.isUploading&&(this.isUploading=!1,this.stopTimeCount())}async uploadChunk(){this.isUploading=!0,this.begin=this.currentChunk*this.chunkSize,this.end=Math.min(this.begin+this.chunkSize,this.file.size);const t=this.file.slice(this.begin,this.end),e=new FormData;e.append("fileData",t),e.append("fileName",this.file.name),e.append("fileHash",this.fileHash),e.append("chunkIndex",String(this.currentChunk)),e.append("chunks",String(this.chunks)),await this.axios.postBlob(this.uploadURL,e)}startTimeCount(){this.stopTimeCount(),this.timer=setInterval(()=>{cf(this.time,1),this.onTime?.(rf(this.time))},1e3)}stopTimeCount(){this.timer&&(clearInterval(this.timer),this.timer=void 0)}}var gc={exports:{}};/*! Hammer.JS - v2.0.7 - 2016-04-22
|
|
12
|
+
`):"",this.name="UnsubscriptionError",this.errors=t}});function Sa(s,t){if(s){var e=s.indexOf(t);0<=e&&s.splice(e,1)}}var Ai=function(){function s(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}return s.prototype.unsubscribe=function(){var t,e,n,i,r;if(!this.closed){this.closed=!0;var o=this._parentage;if(o)if(this._parentage=null,Array.isArray(o))try{for(var a=_a(o),h=a.next();!h.done;h=a.next()){var c=h.value;c.remove(this)}}catch(y){t={error:y}}finally{try{h&&!h.done&&(e=a.return)&&e.call(a)}finally{if(t)throw t.error}}else o.remove(this);var u=this.initialTeardown;if(ce(u))try{u()}catch(y){r=y instanceof Mi?y.errors:[y]}var l=this._finalizers;if(l){this._finalizers=null;try{for(var m=_a(l),f=m.next();!f.done;f=m.next()){var p=f.value;try{Ta(p)}catch(y){r=r??[],y instanceof Mi?r=Pi(Pi([],Ei(r)),Ei(y.errors)):r.push(y)}}}catch(y){n={error:y}}finally{try{f&&!f.done&&(i=m.return)&&i.call(m)}finally{if(n)throw n.error}}}if(r)throw new Mi(r)}},s.prototype.add=function(t){var e;if(t&&t!==this)if(this.closed)Ta(t);else{if(t instanceof s){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=(e=this._finalizers)!==null&&e!==void 0?e:[]).push(t)}},s.prototype._hasParent=function(t){var e=this._parentage;return e===t||Array.isArray(e)&&e.includes(t)},s.prototype._addParent=function(t){var e=this._parentage;this._parentage=Array.isArray(e)?(e.push(t),e):e?[e,t]:t},s.prototype._removeParent=function(t){var e=this._parentage;e===t?this._parentage=null:Array.isArray(e)&&Sa(e,t)},s.prototype.remove=function(t){var e=this._finalizers;e&&Sa(e,t),t instanceof s&&t._removeParent(this)},s.EMPTY=function(){var t=new s;return t.closed=!0,t}(),s}();Ai.EMPTY;function Ca(s){return s instanceof Ai||s&&"closed"in s&&ce(s.remove)&&ce(s.add)&&ce(s.unsubscribe)}function Ta(s){ce(s)?s():s.unsubscribe()}var Ea={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},pf={setTimeout:function(s,t){for(var e=[],n=2;n<arguments.length;n++)e[n-2]=arguments[n];return setTimeout.apply(void 0,Pi([s,t],Ei(e)))},clearTimeout:function(s){return clearTimeout(s)},delegate:void 0};function gf(s){pf.setTimeout(function(){throw s})}function Pa(){}function yf(s){s()}var ki=function(s){Ti(t,s);function t(e){var n=s.call(this)||this;return n.isStopped=!1,e?(n.destination=e,Ca(e)&&e.add(n)):n.destination=vf,n}return t.create=function(e,n,i){return new Di(e,n,i)},t.prototype.next=function(e){this.isStopped||this._next(e)},t.prototype.error=function(e){this.isStopped||(this.isStopped=!0,this._error(e))},t.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,s.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(e){this.destination.next(e)},t.prototype._error=function(e){try{this.destination.error(e)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t}(Ai),wf=Function.prototype.bind;function Ii(s,t){return wf.call(s,t)}var xf=function(){function s(t){this.partialObserver=t}return s.prototype.next=function(t){var e=this.partialObserver;if(e.next)try{e.next(t)}catch(n){us(n)}},s.prototype.error=function(t){var e=this.partialObserver;if(e.error)try{e.error(t)}catch(n){us(n)}else us(t)},s.prototype.complete=function(){var t=this.partialObserver;if(t.complete)try{t.complete()}catch(e){us(e)}},s}(),Di=function(s){Ti(t,s);function t(e,n,i){var r=s.call(this)||this,o;if(ce(e)||!e)o={next:e??void 0,error:n??void 0,complete:i??void 0};else{var a;r&&Ea.useDeprecatedNextContext?(a=Object.create(e),a.unsubscribe=function(){return r.unsubscribe()},o={next:e.next&&Ii(e.next,a),error:e.error&&Ii(e.error,a),complete:e.complete&&Ii(e.complete,a)}):o=e}return r.destination=new xf(o),r}return t}(ki);function us(s){gf(s)}function bf(s){throw s}var vf={closed:!0,next:Pa,error:bf,complete:Pa},_f=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function Sf(s){return s}function Cf(s){return s.length===0?Sf:s.length===1?s[0]:function(t){return s.reduce(function(e,n){return n(e)},t)}}(function(){function s(t){t&&(this._subscribe=t)}return s.prototype.lift=function(t){var e=new s;return e.source=this,e.operator=t,e},s.prototype.subscribe=function(t,e,n){var i=this,r=Ef(t)?t:new Di(t,e,n);return yf(function(){var o=i,a=o.operator,h=o.source;r.add(a?a.call(r,h):h?i._subscribe(r):i._trySubscribe(r))}),r},s.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(e){t.error(e)}},s.prototype.forEach=function(t,e){var n=this;return e=Ma(e),new e(function(i,r){var o=new Di({next:function(a){try{t(a)}catch(h){r(h),o.unsubscribe()}},error:r,complete:i});n.subscribe(o)})},s.prototype._subscribe=function(t){var e;return(e=this.source)===null||e===void 0?void 0:e.subscribe(t)},s.prototype[_f]=function(){return this},s.prototype.pipe=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Cf(t)(this)},s.prototype.toPromise=function(t){var e=this;return t=Ma(t),new t(function(n,i){var r;e.subscribe(function(o){return r=o},function(o){return i(o)},function(){return n(r)})})},s.create=function(t){return new s(t)},s})();function Ma(s){var t;return(t=s??Ea.Promise)!==null&&t!==void 0?t:Promise}function Tf(s){return s&&ce(s.next)&&ce(s.error)&&ce(s.complete)}function Ef(s){return s&&s instanceof ki||Tf(s)&&Ca(s)}(function(s){Ti(t,s);function t(e,n,i,r,o,a){var h=s.call(this,e)||this;return h.onFinalize=o,h.shouldUnsubscribe=a,h._next=n?function(c){try{n(c)}catch(u){e.error(u)}}:s.prototype._next,h._error=r?function(c){try{r(c)}catch(u){e.error(u)}finally{this.unsubscribe()}}:s.prototype._error,h._complete=i?function(){try{i()}catch(c){e.error(c)}finally{this.unsubscribe()}}:s.prototype._complete,h}return t.prototype.unsubscribe=function(){var e;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var n=this.closed;s.prototype.unsubscribe.call(this),!n&&((e=this.onFinalize)===null||e===void 0||e.call(this))}},t})(ki);let Cn;function jt(s){Cn=s,s(),Cn=null}class Pf{subscribers=new Set;add(){Cn&&!this.subscribers.has(Cn)&&this.subscribers.add(Cn)}notify(){this.subscribers.forEach(t=>t())}}const Aa=new WeakMap;function ls(s,t){let e=Aa.get(s);e||(e=new Map,Aa.set(s,e));let n=e.get(t);return n||(n=new Pf,e.set(t,n)),n}function Mf(s,t=!1){return Object.keys(s).forEach(e=>{let n=s[e];if(t&&typeof n=="object"&&n!==null)s[e]=Ri(n,t);else{const i=ls(s,e);Object.defineProperty(s,e,{configurable:!0,enumerable:!0,get(){return i.add(),n},set(r){n!=r&&(n=r,i.notify())}})}}),s}function Li(s,t=!1){return Mf({value:s},t)}function Ri(s,t=!1){const e={get(n,i,r){const o=Reflect.get(n,i,r);if(t&&typeof o=="object"&&o!==null&&!("isYZReactiveProxy"in o)){const a=Ri(o,t);a.YZReactiveProxyParentTarget=n,a.YZReactiveProxyParentKey=i,Reflect.set(r,i,a)}return ls(n,i).add(),Reflect.get(n,i,r)},set(n,i,r,o){const a=Reflect.get(n,i,o),h=Reflect.set(n,i,r,o);return Array.isArray(n)?ls(n.YZReactiveProxyParentTarget,n.YZReactiveProxyParentKey).notify():a!=r&&ls(n,i).notify(),h},has(n,i){return i==="isYZReactiveProxy"||i in n}};return new Proxy(s,e)}const ka=Ri;class fs{events;constructor(){this.events={}}isEmpty(t){return this.events[t]==null||this.events[t].length==0}has(t,e){return this.events[t]!==void 0&&this.events[t].indexOf(e)!==-1}prependListener(t,e,n){return this.events[t]||(this.events[t]=[]),this.events[t].unshift(n?e.bind(n):e),this}addListener(t,e,n){return this.events[t]||(this.events[t]=[]),this.events[t].push(n?e.bind(n):e),this}on(t,e,n){return this.addListener(t,e,n),this}removeListener(t,e){return this.events[t]&&(this.events[t]=this.events[t].filter(n=>n!==e)),this}off(t,e){return this.removeListener(t,e),this}removeAllListeners(t){return t?this.events[t]=[]:this.events={},this}emit(t,...e){return this.events[t]&&this.events[t].slice(0).forEach(n=>{n(...e)}),this}once(t,e,n){const i=(...r)=>{n?e.apply(n,r):e(...r),this.off(t,i)};return this.on(t,i),this}}function Af(){const s={};return s.promise=new Promise((t,e)=>{s.resolve=t,s.reject=e}),s}let kf=0;function If(s){const t=Af();let e=!1;return{name:s.name||String(++kf),deadline:typeof s.deadline=="number"?Math.max(s.deadline,0):-1,run:async()=>{if(!e){e=!0;try{let n;const i=s.args||[];s.thisArg?n=await s.fn.call(s.thisArg,...i):n=await s.fn(...i),t.resolve(n)}catch(n){t.reject(n)}}},result:()=>t.promise}}class Df{queue;suspend=!1;semaphore=0;concurrency=1;timeRemaining=-1;timeoutId;constructor(t){this.queue=t?.queue||cf(10),typeof t?.concurrency=="number"&&(this.concurrency=Math.max(t?.concurrency,1)),typeof t?.timeRemaining=="number"&&this.setTimeRemaining(t.timeRemaining)}setTimeRemaining(t){this.timeRemaining=Math.max(0,t)}increaseTimeRemaining(t,e=!1){this.timeRemaining!==-1?this.setTimeRemaining(this.timeRemaining+t):e&&this.setTimeRemaining(t)}decreaseTimeRemaining(t){this.timeRemaining!==-1&&this.setTimeRemaining(this.timeRemaining-t)}_exec(t,e=!0){const n=se();try{this.semaphore++,t.run()}finally{this.semaphore--,e&&(this.decreaseTimeRemaining(se()-n),this._flush())}}_flush(){for(;!this.suspend&&this.semaphore<this.concurrency&&(this.timeRemaining==-1||this.timeRemaining>0);){const t=this.queue.dequeue();if(!t)break;this._exec(t)}this._timeout()}_timeout(t=0,e=0){clearTimeout(this.timeoutId),this.timeoutId=setTimeout(()=>{if(!(this.suspend||this.semaphore>0||!this.queue.length)){for(let n=0;n<this.queue.length();){const i=this.queue.index(n);if(!i)break;i.deadline!=-1&&i.deadline<=se()?(this._exec(i,!1),this.queue.deleteIndex(n)):n++}this.queue.length()&&(this.timeoutId=setTimeout(()=>{this._timeout(t,++e)},300*Math.pow(2,e)))}},t)}pause(){this.suspend=!0}resume(){this.suspend=!1,this._flush()}addTask(t){this.queue.delete(e=>e.name==t.name),this.queue.enqueue(t)}immediately(t){this._exec(t),this._flush()}asap(t){this.addTask(t),this._flush()}idleCallback(t){this.setTimeRemaining(t.timeRemaining()),this._flush()}clear(){this.queue.clear()}}class Lf extends Df{constructor(t){super(t)}_exec(t,e=!0){const n=se();try{this.semaphore++,t.run()}finally{t.result().finally(()=>{this.semaphore--,e&&(this.decreaseTimeRemaining(se()-n),this._flush())})}}}function Ia(s,t={},e){if(typeof t=="function"&&(e=t,t={}),e)return e(Ia)(s,t);let n=t;const i=[],r=c=>(i.push(c),()=>{Oe(i,c)}),o=c=>{n=s(n,c),i.forEach(u=>u())},a=()=>n,h=c=>{s=c,o({type:Symbol()})};return o({type:Symbol()}),{getState:a,dispatch:o,subscribe:r,replaceReducer:h}}function Da(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}var La={exports:{}};(function(s,t){(function(e){s.exports=e()})(function(e){var n=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"];function i(w,_){var x=w[0],b=w[1],E=w[2],C=w[3];x+=(b&E|~b&C)+_[0]-680876936|0,x=(x<<7|x>>>25)+b|0,C+=(x&b|~x&E)+_[1]-389564586|0,C=(C<<12|C>>>20)+x|0,E+=(C&x|~C&b)+_[2]+606105819|0,E=(E<<17|E>>>15)+C|0,b+=(E&C|~E&x)+_[3]-1044525330|0,b=(b<<22|b>>>10)+E|0,x+=(b&E|~b&C)+_[4]-176418897|0,x=(x<<7|x>>>25)+b|0,C+=(x&b|~x&E)+_[5]+1200080426|0,C=(C<<12|C>>>20)+x|0,E+=(C&x|~C&b)+_[6]-1473231341|0,E=(E<<17|E>>>15)+C|0,b+=(E&C|~E&x)+_[7]-45705983|0,b=(b<<22|b>>>10)+E|0,x+=(b&E|~b&C)+_[8]+1770035416|0,x=(x<<7|x>>>25)+b|0,C+=(x&b|~x&E)+_[9]-1958414417|0,C=(C<<12|C>>>20)+x|0,E+=(C&x|~C&b)+_[10]-42063|0,E=(E<<17|E>>>15)+C|0,b+=(E&C|~E&x)+_[11]-1990404162|0,b=(b<<22|b>>>10)+E|0,x+=(b&E|~b&C)+_[12]+1804603682|0,x=(x<<7|x>>>25)+b|0,C+=(x&b|~x&E)+_[13]-40341101|0,C=(C<<12|C>>>20)+x|0,E+=(C&x|~C&b)+_[14]-1502002290|0,E=(E<<17|E>>>15)+C|0,b+=(E&C|~E&x)+_[15]+1236535329|0,b=(b<<22|b>>>10)+E|0,x+=(b&C|E&~C)+_[1]-165796510|0,x=(x<<5|x>>>27)+b|0,C+=(x&E|b&~E)+_[6]-1069501632|0,C=(C<<9|C>>>23)+x|0,E+=(C&b|x&~b)+_[11]+643717713|0,E=(E<<14|E>>>18)+C|0,b+=(E&x|C&~x)+_[0]-373897302|0,b=(b<<20|b>>>12)+E|0,x+=(b&C|E&~C)+_[5]-701558691|0,x=(x<<5|x>>>27)+b|0,C+=(x&E|b&~E)+_[10]+38016083|0,C=(C<<9|C>>>23)+x|0,E+=(C&b|x&~b)+_[15]-660478335|0,E=(E<<14|E>>>18)+C|0,b+=(E&x|C&~x)+_[4]-405537848|0,b=(b<<20|b>>>12)+E|0,x+=(b&C|E&~C)+_[9]+568446438|0,x=(x<<5|x>>>27)+b|0,C+=(x&E|b&~E)+_[14]-1019803690|0,C=(C<<9|C>>>23)+x|0,E+=(C&b|x&~b)+_[3]-187363961|0,E=(E<<14|E>>>18)+C|0,b+=(E&x|C&~x)+_[8]+1163531501|0,b=(b<<20|b>>>12)+E|0,x+=(b&C|E&~C)+_[13]-1444681467|0,x=(x<<5|x>>>27)+b|0,C+=(x&E|b&~E)+_[2]-51403784|0,C=(C<<9|C>>>23)+x|0,E+=(C&b|x&~b)+_[7]+1735328473|0,E=(E<<14|E>>>18)+C|0,b+=(E&x|C&~x)+_[12]-1926607734|0,b=(b<<20|b>>>12)+E|0,x+=(b^E^C)+_[5]-378558|0,x=(x<<4|x>>>28)+b|0,C+=(x^b^E)+_[8]-2022574463|0,C=(C<<11|C>>>21)+x|0,E+=(C^x^b)+_[11]+1839030562|0,E=(E<<16|E>>>16)+C|0,b+=(E^C^x)+_[14]-35309556|0,b=(b<<23|b>>>9)+E|0,x+=(b^E^C)+_[1]-1530992060|0,x=(x<<4|x>>>28)+b|0,C+=(x^b^E)+_[4]+1272893353|0,C=(C<<11|C>>>21)+x|0,E+=(C^x^b)+_[7]-155497632|0,E=(E<<16|E>>>16)+C|0,b+=(E^C^x)+_[10]-1094730640|0,b=(b<<23|b>>>9)+E|0,x+=(b^E^C)+_[13]+681279174|0,x=(x<<4|x>>>28)+b|0,C+=(x^b^E)+_[0]-358537222|0,C=(C<<11|C>>>21)+x|0,E+=(C^x^b)+_[3]-722521979|0,E=(E<<16|E>>>16)+C|0,b+=(E^C^x)+_[6]+76029189|0,b=(b<<23|b>>>9)+E|0,x+=(b^E^C)+_[9]-640364487|0,x=(x<<4|x>>>28)+b|0,C+=(x^b^E)+_[12]-421815835|0,C=(C<<11|C>>>21)+x|0,E+=(C^x^b)+_[15]+530742520|0,E=(E<<16|E>>>16)+C|0,b+=(E^C^x)+_[2]-995338651|0,b=(b<<23|b>>>9)+E|0,x+=(E^(b|~C))+_[0]-198630844|0,x=(x<<6|x>>>26)+b|0,C+=(b^(x|~E))+_[7]+1126891415|0,C=(C<<10|C>>>22)+x|0,E+=(x^(C|~b))+_[14]-1416354905|0,E=(E<<15|E>>>17)+C|0,b+=(C^(E|~x))+_[5]-57434055|0,b=(b<<21|b>>>11)+E|0,x+=(E^(b|~C))+_[12]+1700485571|0,x=(x<<6|x>>>26)+b|0,C+=(b^(x|~E))+_[3]-1894986606|0,C=(C<<10|C>>>22)+x|0,E+=(x^(C|~b))+_[10]-1051523|0,E=(E<<15|E>>>17)+C|0,b+=(C^(E|~x))+_[1]-2054922799|0,b=(b<<21|b>>>11)+E|0,x+=(E^(b|~C))+_[8]+1873313359|0,x=(x<<6|x>>>26)+b|0,C+=(b^(x|~E))+_[15]-30611744|0,C=(C<<10|C>>>22)+x|0,E+=(x^(C|~b))+_[6]-1560198380|0,E=(E<<15|E>>>17)+C|0,b+=(C^(E|~x))+_[13]+1309151649|0,b=(b<<21|b>>>11)+E|0,x+=(E^(b|~C))+_[4]-145523070|0,x=(x<<6|x>>>26)+b|0,C+=(b^(x|~E))+_[11]-1120210379|0,C=(C<<10|C>>>22)+x|0,E+=(x^(C|~b))+_[2]+718787259|0,E=(E<<15|E>>>17)+C|0,b+=(C^(E|~x))+_[9]-343485551|0,b=(b<<21|b>>>11)+E|0,w[0]=x+w[0]|0,w[1]=b+w[1]|0,w[2]=E+w[2]|0,w[3]=C+w[3]|0}function r(w){var _=[],x;for(x=0;x<64;x+=4)_[x>>2]=w.charCodeAt(x)+(w.charCodeAt(x+1)<<8)+(w.charCodeAt(x+2)<<16)+(w.charCodeAt(x+3)<<24);return _}function o(w){var _=[],x;for(x=0;x<64;x+=4)_[x>>2]=w[x]+(w[x+1]<<8)+(w[x+2]<<16)+(w[x+3]<<24);return _}function a(w){var _=w.length,x=[1732584193,-271733879,-1732584194,271733878],b,E,C,L,B,F;for(b=64;b<=_;b+=64)i(x,r(w.substring(b-64,b)));for(w=w.substring(b-64),E=w.length,C=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],b=0;b<E;b+=1)C[b>>2]|=w.charCodeAt(b)<<(b%4<<3);if(C[b>>2]|=128<<(b%4<<3),b>55)for(i(x,C),b=0;b<16;b+=1)C[b]=0;return L=_*8,L=L.toString(16).match(/(.*?)(.{0,8})$/),B=parseInt(L[2],16),F=parseInt(L[1],16)||0,C[14]=B,C[15]=F,i(x,C),x}function h(w){var _=w.length,x=[1732584193,-271733879,-1732584194,271733878],b,E,C,L,B,F;for(b=64;b<=_;b+=64)i(x,o(w.subarray(b-64,b)));for(w=b-64<_?w.subarray(b-64):new Uint8Array(0),E=w.length,C=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],b=0;b<E;b+=1)C[b>>2]|=w[b]<<(b%4<<3);if(C[b>>2]|=128<<(b%4<<3),b>55)for(i(x,C),b=0;b<16;b+=1)C[b]=0;return L=_*8,L=L.toString(16).match(/(.*?)(.{0,8})$/),B=parseInt(L[2],16),F=parseInt(L[1],16)||0,C[14]=B,C[15]=F,i(x,C),x}function c(w){var _="",x;for(x=0;x<4;x+=1)_+=n[w>>x*8+4&15]+n[w>>x*8&15];return _}function u(w){var _;for(_=0;_<w.length;_+=1)w[_]=c(w[_]);return w.join("")}u(a("hello")),typeof ArrayBuffer<"u"&&!ArrayBuffer.prototype.slice&&function(){function w(_,x){return _=_|0||0,_<0?Math.max(_+x,0):Math.min(_,x)}ArrayBuffer.prototype.slice=function(_,x){var b=this.byteLength,E=w(_,b),C=b,L,B,F,$;return x!==e&&(C=w(x,b)),E>C?new ArrayBuffer(0):(L=C-E,B=new ArrayBuffer(L),F=new Uint8Array(B),$=new Uint8Array(this,E,L),F.set($),B)}}();function l(w){return/[\u0080-\uFFFF]/.test(w)&&(w=unescape(encodeURIComponent(w))),w}function m(w,_){var x=w.length,b=new ArrayBuffer(x),E=new Uint8Array(b),C;for(C=0;C<x;C+=1)E[C]=w.charCodeAt(C);return _?E:b}function f(w){return String.fromCharCode.apply(null,new Uint8Array(w))}function p(w,_,x){var b=new Uint8Array(w.byteLength+_.byteLength);return b.set(new Uint8Array(w)),b.set(new Uint8Array(_),w.byteLength),x?b:b.buffer}function y(w){var _=[],x=w.length,b;for(b=0;b<x-1;b+=2)_.push(parseInt(w.substr(b,2),16));return String.fromCharCode.apply(String,_)}function v(){this.reset()}return v.prototype.append=function(w){return this.appendBinary(l(w)),this},v.prototype.appendBinary=function(w){this._buff+=w,this._length+=w.length;var _=this._buff.length,x;for(x=64;x<=_;x+=64)i(this._hash,r(this._buff.substring(x-64,x)));return this._buff=this._buff.substring(x-64),this},v.prototype.end=function(w){var _=this._buff,x=_.length,b,E=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],C;for(b=0;b<x;b+=1)E[b>>2]|=_.charCodeAt(b)<<(b%4<<3);return this._finish(E,x),C=u(this._hash),w&&(C=y(C)),this.reset(),C},v.prototype.reset=function(){return this._buff="",this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},v.prototype.getState=function(){return{buff:this._buff,length:this._length,hash:this._hash.slice()}},v.prototype.setState=function(w){return this._buff=w.buff,this._length=w.length,this._hash=w.hash,this},v.prototype.destroy=function(){delete this._hash,delete this._buff,delete this._length},v.prototype._finish=function(w,_){var x=_,b,E,C;if(w[x>>2]|=128<<(x%4<<3),x>55)for(i(this._hash,w),x=0;x<16;x+=1)w[x]=0;b=this._length*8,b=b.toString(16).match(/(.*?)(.{0,8})$/),E=parseInt(b[2],16),C=parseInt(b[1],16)||0,w[14]=E,w[15]=C,i(this._hash,w)},v.hash=function(w,_){return v.hashBinary(l(w),_)},v.hashBinary=function(w,_){var x=a(w),b=u(x);return _?y(b):b},v.ArrayBuffer=function(){this.reset()},v.ArrayBuffer.prototype.append=function(w){var _=p(this._buff.buffer,w,!0),x=_.length,b;for(this._length+=w.byteLength,b=64;b<=x;b+=64)i(this._hash,o(_.subarray(b-64,b)));return this._buff=b-64<x?new Uint8Array(_.buffer.slice(b-64)):new Uint8Array(0),this},v.ArrayBuffer.prototype.end=function(w){var _=this._buff,x=_.length,b=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],E,C;for(E=0;E<x;E+=1)b[E>>2]|=_[E]<<(E%4<<3);return this._finish(b,x),C=u(this._hash),w&&(C=y(C)),this.reset(),C},v.ArrayBuffer.prototype.reset=function(){return this._buff=new Uint8Array(0),this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},v.ArrayBuffer.prototype.getState=function(){var w=v.prototype.getState.call(this);return w.buff=f(w.buff),w},v.ArrayBuffer.prototype.setState=function(w){return w.buff=m(w.buff,!0),v.prototype.setState.call(this,w)},v.ArrayBuffer.prototype.destroy=v.prototype.destroy,v.ArrayBuffer.prototype._finish=v.prototype._finish,v.ArrayBuffer.hash=function(w,_){var x=h(new Uint8Array(w)),b=u(x);return _?y(b):b},v})})(La);var Rf=La.exports;const Of=Da(Rf);function Ra(s,t){return function(){return s.apply(t,arguments)}}const{toString:zf}=Object.prototype,{getPrototypeOf:Oi}=Object,ds=(s=>t=>{const e=zf.call(t);return s[e]||(s[e]=e.slice(8,-1).toLowerCase())})(Object.create(null)),Ht=s=>(s=s.toLowerCase(),t=>ds(t)===s),ms=s=>t=>typeof t===s,{isArray:an}=Array,Tn=ms("undefined");function Nf(s){return s!==null&&!Tn(s)&&s.constructor!==null&&!Tn(s.constructor)&&Rt(s.constructor.isBuffer)&&s.constructor.isBuffer(s)}const Oa=Ht("ArrayBuffer");function Bf(s){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(s):t=s&&s.buffer&&Oa(s.buffer),t}const Ff=ms("string"),Rt=ms("function"),za=ms("number"),ps=s=>s!==null&&typeof s=="object",Yf=s=>s===!0||s===!1,gs=s=>{if(ds(s)!=="object")return!1;const t=Oi(s);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in s)&&!(Symbol.iterator in s)},Xf=Ht("Date"),Uf=Ht("File"),$f=Ht("Blob"),Vf=Ht("FileList"),Gf=s=>ps(s)&&Rt(s.pipe),qf=s=>{let t;return s&&(typeof FormData=="function"&&s instanceof FormData||Rt(s.append)&&((t=ds(s))==="formdata"||t==="object"&&Rt(s.toString)&&s.toString()==="[object FormData]"))},jf=Ht("URLSearchParams"),[Hf,Wf,Jf,Zf]=["ReadableStream","Request","Response","Headers"].map(Ht),Qf=s=>s.trim?s.trim():s.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function En(s,t,{allOwnKeys:e=!1}={}){if(s===null||typeof s>"u")return;let n,i;if(typeof s!="object"&&(s=[s]),an(s))for(n=0,i=s.length;n<i;n++)t.call(null,s[n],n,s);else{const r=e?Object.getOwnPropertyNames(s):Object.keys(s),o=r.length;let a;for(n=0;n<o;n++)a=r[n],t.call(null,s[a],a,s)}}function Na(s,t){t=t.toLowerCase();const e=Object.keys(s);let n=e.length,i;for(;n-- >0;)if(i=e[n],t===i.toLowerCase())return i;return null}const ze=(()=>typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global)(),Ba=s=>!Tn(s)&&s!==ze;function zi(){const{caseless:s}=Ba(this)&&this||{},t={},e=(n,i)=>{const r=s&&Na(t,i)||i;gs(t[r])&&gs(n)?t[r]=zi(t[r],n):gs(n)?t[r]=zi({},n):an(n)?t[r]=n.slice():t[r]=n};for(let n=0,i=arguments.length;n<i;n++)arguments[n]&&En(arguments[n],e);return t}const Kf=(s,t,e,{allOwnKeys:n}={})=>(En(t,(i,r)=>{e&&Rt(i)?s[r]=Ra(i,e):s[r]=i},{allOwnKeys:n}),s),td=s=>(s.charCodeAt(0)===65279&&(s=s.slice(1)),s),ed=(s,t,e,n)=>{s.prototype=Object.create(t.prototype,n),s.prototype.constructor=s,Object.defineProperty(s,"super",{value:t.prototype}),e&&Object.assign(s.prototype,e)},nd=(s,t,e,n)=>{let i,r,o;const a={};if(t=t||{},s==null)return t;do{for(i=Object.getOwnPropertyNames(s),r=i.length;r-- >0;)o=i[r],(!n||n(o,s,t))&&!a[o]&&(t[o]=s[o],a[o]=!0);s=e!==!1&&Oi(s)}while(s&&(!e||e(s,t))&&s!==Object.prototype);return t},sd=(s,t,e)=>{s=String(s),(e===void 0||e>s.length)&&(e=s.length),e-=t.length;const n=s.indexOf(t,e);return n!==-1&&n===e},id=s=>{if(!s)return null;if(an(s))return s;let t=s.length;if(!za(t))return null;const e=new Array(t);for(;t-- >0;)e[t]=s[t];return e},rd=(s=>t=>s&&t instanceof s)(typeof Uint8Array<"u"&&Oi(Uint8Array)),od=(s,t)=>{const n=(s&&s[Symbol.iterator]).call(s);let i;for(;(i=n.next())&&!i.done;){const r=i.value;t.call(s,r[0],r[1])}},ad=(s,t)=>{let e;const n=[];for(;(e=s.exec(t))!==null;)n.push(e);return n},hd=Ht("HTMLFormElement"),cd=s=>s.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,n,i){return n.toUpperCase()+i}),Fa=(({hasOwnProperty:s})=>(t,e)=>s.call(t,e))(Object.prototype),ud=Ht("RegExp"),Ya=(s,t)=>{const e=Object.getOwnPropertyDescriptors(s),n={};En(e,(i,r)=>{let o;(o=t(i,r,s))!==!1&&(n[r]=o||i)}),Object.defineProperties(s,n)},ld=s=>{Ya(s,(t,e)=>{if(Rt(s)&&["arguments","caller","callee"].indexOf(e)!==-1)return!1;const n=s[e];if(Rt(n)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+e+"'")})}})},fd=(s,t)=>{const e={},n=i=>{i.forEach(r=>{e[r]=!0})};return an(s)?n(s):n(String(s).split(t)),e},dd=()=>{},md=(s,t)=>s!=null&&Number.isFinite(s=+s)?s:t;function pd(s){return!!(s&&Rt(s.append)&&s[Symbol.toStringTag]==="FormData"&&s[Symbol.iterator])}const gd=s=>{const t=new Array(10),e=(n,i)=>{if(ps(n)){if(t.indexOf(n)>=0)return;if(!("toJSON"in n)){t[i]=n;const r=an(n)?[]:{};return En(n,(o,a)=>{const h=e(o,i+1);!Tn(h)&&(r[a]=h)}),t[i]=void 0,r}}return n};return e(s,0)},yd=Ht("AsyncFunction"),wd=s=>s&&(ps(s)||Rt(s))&&Rt(s.then)&&Rt(s.catch),Xa=((s,t)=>s?setImmediate:t?((e,n)=>(ze.addEventListener("message",({source:i,data:r})=>{i===ze&&r===e&&n.length&&n.shift()()},!1),i=>{n.push(i),ze.postMessage(e,"*")}))(`axios@${Math.random()}`,[]):e=>setTimeout(e))(typeof setImmediate=="function",Rt(ze.postMessage)),xd=typeof queueMicrotask<"u"?queueMicrotask.bind(ze):typeof process<"u"&&process.nextTick||Xa,A={isArray:an,isArrayBuffer:Oa,isBuffer:Nf,isFormData:qf,isArrayBufferView:Bf,isString:Ff,isNumber:za,isBoolean:Yf,isObject:ps,isPlainObject:gs,isReadableStream:Hf,isRequest:Wf,isResponse:Jf,isHeaders:Zf,isUndefined:Tn,isDate:Xf,isFile:Uf,isBlob:$f,isRegExp:ud,isFunction:Rt,isStream:Gf,isURLSearchParams:jf,isTypedArray:rd,isFileList:Vf,forEach:En,merge:zi,extend:Kf,trim:Qf,stripBOM:td,inherits:ed,toFlatObject:nd,kindOf:ds,kindOfTest:Ht,endsWith:sd,toArray:id,forEachEntry:od,matchAll:ad,isHTMLForm:hd,hasOwnProperty:Fa,hasOwnProp:Fa,reduceDescriptors:Ya,freezeMethods:ld,toObjectSet:fd,toCamelCase:cd,noop:dd,toFiniteNumber:md,findKey:Na,global:ze,isContextDefined:Ba,isSpecCompliantForm:pd,toJSONObject:gd,isAsyncFn:yd,isThenable:wd,setImmediate:Xa,asap:xd};function Y(s,t,e,n,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=s,this.name="AxiosError",t&&(this.code=t),e&&(this.config=e),n&&(this.request=n),i&&(this.response=i,this.status=i.status?i.status:null)}A.inherits(Y,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:A.toJSONObject(this.config),code:this.code,status:this.status}}});const Ua=Y.prototype,$a={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(s=>{$a[s]={value:s}}),Object.defineProperties(Y,$a),Object.defineProperty(Ua,"isAxiosError",{value:!0}),Y.from=(s,t,e,n,i,r)=>{const o=Object.create(Ua);return A.toFlatObject(s,o,function(h){return h!==Error.prototype},a=>a!=="isAxiosError"),Y.call(o,s.message,t,e,n,i),o.cause=s,o.name=s.name,r&&Object.assign(o,r),o};const bd=null;function Ni(s){return A.isPlainObject(s)||A.isArray(s)}function Va(s){return A.endsWith(s,"[]")?s.slice(0,-2):s}function Ga(s,t,e){return s?s.concat(t).map(function(i,r){return i=Va(i),!e&&r?"["+i+"]":i}).join(e?".":""):t}function vd(s){return A.isArray(s)&&!s.some(Ni)}const _d=A.toFlatObject(A,{},null,function(t){return/^is[A-Z]/.test(t)});function ys(s,t,e){if(!A.isObject(s))throw new TypeError("target must be an object");t=t||new FormData,e=A.toFlatObject(e,{metaTokens:!0,dots:!1,indexes:!1},!1,function(y,v){return!A.isUndefined(v[y])});const n=e.metaTokens,i=e.visitor||u,r=e.dots,o=e.indexes,h=(e.Blob||typeof Blob<"u"&&Blob)&&A.isSpecCompliantForm(t);if(!A.isFunction(i))throw new TypeError("visitor must be a function");function c(p){if(p===null)return"";if(A.isDate(p))return p.toISOString();if(!h&&A.isBlob(p))throw new Y("Blob is not supported. Use a Buffer instead.");return A.isArrayBuffer(p)||A.isTypedArray(p)?h&&typeof Blob=="function"?new Blob([p]):Buffer.from(p):p}function u(p,y,v){let w=p;if(p&&!v&&typeof p=="object"){if(A.endsWith(y,"{}"))y=n?y:y.slice(0,-2),p=JSON.stringify(p);else if(A.isArray(p)&&vd(p)||(A.isFileList(p)||A.endsWith(y,"[]"))&&(w=A.toArray(p)))return y=Va(y),w.forEach(function(x,b){!(A.isUndefined(x)||x===null)&&t.append(o===!0?Ga([y],b,r):o===null?y:y+"[]",c(x))}),!1}return Ni(p)?!0:(t.append(Ga(v,y,r),c(p)),!1)}const l=[],m=Object.assign(_d,{defaultVisitor:u,convertValue:c,isVisitable:Ni});function f(p,y){if(!A.isUndefined(p)){if(l.indexOf(p)!==-1)throw Error("Circular reference detected in "+y.join("."));l.push(p),A.forEach(p,function(w,_){(!(A.isUndefined(w)||w===null)&&i.call(t,w,A.isString(_)?_.trim():_,y,m))===!0&&f(w,y?y.concat(_):[_])}),l.pop()}}if(!A.isObject(s))throw new TypeError("data must be an object");return f(s),t}function qa(s){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(s).replace(/[!'()~]|%20|%00/g,function(n){return t[n]})}function Bi(s,t){this._pairs=[],s&&ys(s,this,t)}const ja=Bi.prototype;ja.append=function(t,e){this._pairs.push([t,e])},ja.toString=function(t){const e=t?function(n){return t.call(this,n,qa)}:qa;return this._pairs.map(function(i){return e(i[0])+"="+e(i[1])},"").join("&")};function Sd(s){return encodeURIComponent(s).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Ha(s,t,e){if(!t)return s;const n=e&&e.encode||Sd;A.isFunction(e)&&(e={serialize:e});const i=e&&e.serialize;let r;if(i?r=i(t,e):r=A.isURLSearchParams(t)?t.toString():new Bi(t,e).toString(n),r){const o=s.indexOf("#");o!==-1&&(s=s.slice(0,o)),s+=(s.indexOf("?")===-1?"?":"&")+r}return s}class Cd{constructor(){this.handlers=[]}use(t,e,n){return this.handlers.push({fulfilled:t,rejected:e,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){A.forEach(this.handlers,function(n){n!==null&&t(n)})}}const Wa=Cd,Ja={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Td={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:Bi,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},Fi=typeof window<"u"&&typeof document<"u",Yi=typeof navigator=="object"&&navigator||void 0,Ed=Fi&&(!Yi||["ReactNative","NativeScript","NS"].indexOf(Yi.product)<0),Pd=(()=>typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function")(),Md=Fi&&window.location.href||"http://localhost",xt={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Fi,hasStandardBrowserEnv:Ed,hasStandardBrowserWebWorkerEnv:Pd,navigator:Yi,origin:Md},Symbol.toStringTag,{value:"Module"})),...Td};function Ad(s,t){return ys(s,new xt.classes.URLSearchParams,Object.assign({visitor:function(e,n,i,r){return xt.isNode&&A.isBuffer(e)?(this.append(n,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)}},t))}function kd(s){return A.matchAll(/\w+|\[(\w*)]/g,s).map(t=>t[0]==="[]"?"":t[1]||t[0])}function Id(s){const t={},e=Object.keys(s);let n;const i=e.length;let r;for(n=0;n<i;n++)r=e[n],t[r]=s[r];return t}function Za(s){function t(e,n,i,r){let o=e[r++];if(o==="__proto__")return!0;const a=Number.isFinite(+o),h=r>=e.length;return o=!o&&A.isArray(i)?i.length:o,h?(A.hasOwnProp(i,o)?i[o]=[i[o],n]:i[o]=n,!a):((!i[o]||!A.isObject(i[o]))&&(i[o]=[]),t(e,n,i[o],r)&&A.isArray(i[o])&&(i[o]=Id(i[o])),!a)}if(A.isFormData(s)&&A.isFunction(s.entries)){const e={};return A.forEachEntry(s,(n,i)=>{t(kd(n),i,e,0)}),e}return null}function Dd(s,t,e){if(A.isString(s))try{return(t||JSON.parse)(s),A.trim(s)}catch(n){if(n.name!=="SyntaxError")throw n}return(e||JSON.stringify)(s)}const Xi={transitional:Ja,adapter:["xhr","http","fetch"],transformRequest:[function(t,e){const n=e.getContentType()||"",i=n.indexOf("application/json")>-1,r=A.isObject(t);if(r&&A.isHTMLForm(t)&&(t=new FormData(t)),A.isFormData(t))return i?JSON.stringify(Za(t)):t;if(A.isArrayBuffer(t)||A.isBuffer(t)||A.isStream(t)||A.isFile(t)||A.isBlob(t)||A.isReadableStream(t))return t;if(A.isArrayBufferView(t))return t.buffer;if(A.isURLSearchParams(t))return e.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let a;if(r){if(n.indexOf("application/x-www-form-urlencoded")>-1)return Ad(t,this.formSerializer).toString();if((a=A.isFileList(t))||n.indexOf("multipart/form-data")>-1){const h=this.env&&this.env.FormData;return ys(a?{"files[]":t}:t,h&&new h,this.formSerializer)}}return r||i?(e.setContentType("application/json",!1),Dd(t)):t}],transformResponse:[function(t){const e=this.transitional||Xi.transitional,n=e&&e.forcedJSONParsing,i=this.responseType==="json";if(A.isResponse(t)||A.isReadableStream(t))return t;if(t&&A.isString(t)&&(n&&!this.responseType||i)){const o=!(e&&e.silentJSONParsing)&&i;try{return JSON.parse(t)}catch(a){if(o)throw a.name==="SyntaxError"?Y.from(a,Y.ERR_BAD_RESPONSE,this,null,this.response):a}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:xt.classes.FormData,Blob:xt.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};A.forEach(["delete","get","head","post","put","patch"],s=>{Xi.headers[s]={}});const Ui=Xi,Ld=A.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"]),Rd=s=>{const t={};let e,n,i;return s&&s.split(`
|
|
13
|
+
`).forEach(function(o){i=o.indexOf(":"),e=o.substring(0,i).trim().toLowerCase(),n=o.substring(i+1).trim(),!(!e||t[e]&&Ld[e])&&(e==="set-cookie"?t[e]?t[e].push(n):t[e]=[n]:t[e]=t[e]?t[e]+", "+n:n)}),t},Qa=Symbol("internals");function Pn(s){return s&&String(s).trim().toLowerCase()}function ws(s){return s===!1||s==null?s:A.isArray(s)?s.map(ws):String(s)}function Od(s){const t=Object.create(null),e=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=e.exec(s);)t[n[1]]=n[2];return t}const zd=s=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(s.trim());function $i(s,t,e,n,i){if(A.isFunction(n))return n.call(this,t,e);if(i&&(t=e),!!A.isString(t)){if(A.isString(n))return t.indexOf(n)!==-1;if(A.isRegExp(n))return n.test(t)}}function Nd(s){return s.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,e,n)=>e.toUpperCase()+n)}function Bd(s,t){const e=A.toCamelCase(" "+t);["get","set","has"].forEach(n=>{Object.defineProperty(s,n+e,{value:function(i,r,o){return this[n].call(this,t,i,r,o)},configurable:!0})})}class xs{constructor(t){t&&this.set(t)}set(t,e,n){const i=this;function r(a,h,c){const u=Pn(h);if(!u)throw new Error("header name must be a non-empty string");const l=A.findKey(i,u);(!l||i[l]===void 0||c===!0||c===void 0&&i[l]!==!1)&&(i[l||h]=ws(a))}const o=(a,h)=>A.forEach(a,(c,u)=>r(c,u,h));if(A.isPlainObject(t)||t instanceof this.constructor)o(t,e);else if(A.isString(t)&&(t=t.trim())&&!zd(t))o(Rd(t),e);else if(A.isHeaders(t))for(const[a,h]of t.entries())r(h,a,n);else t!=null&&r(e,t,n);return this}get(t,e){if(t=Pn(t),t){const n=A.findKey(this,t);if(n){const i=this[n];if(!e)return i;if(e===!0)return Od(i);if(A.isFunction(e))return e.call(this,i,n);if(A.isRegExp(e))return e.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,e){if(t=Pn(t),t){const n=A.findKey(this,t);return!!(n&&this[n]!==void 0&&(!e||$i(this,this[n],n,e)))}return!1}delete(t,e){const n=this;let i=!1;function r(o){if(o=Pn(o),o){const a=A.findKey(n,o);a&&(!e||$i(n,n[a],a,e))&&(delete n[a],i=!0)}}return A.isArray(t)?t.forEach(r):r(t),i}clear(t){const e=Object.keys(this);let n=e.length,i=!1;for(;n--;){const r=e[n];(!t||$i(this,this[r],r,t,!0))&&(delete this[r],i=!0)}return i}normalize(t){const e=this,n={};return A.forEach(this,(i,r)=>{const o=A.findKey(n,r);if(o){e[o]=ws(i),delete e[r];return}const a=t?Nd(r):String(r).trim();a!==r&&delete e[r],e[a]=ws(i),n[a]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const e=Object.create(null);return A.forEach(this,(n,i)=>{n!=null&&n!==!1&&(e[i]=t&&A.isArray(n)?n.join(", "):n)}),e}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,e])=>t+": "+e).join(`
|
|
14
|
+
`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...e){const n=new this(t);return e.forEach(i=>n.set(i)),n}static accessor(t){const n=(this[Qa]=this[Qa]={accessors:{}}).accessors,i=this.prototype;function r(o){const a=Pn(o);n[a]||(Bd(i,o),n[a]=!0)}return A.isArray(t)?t.forEach(r):r(t),this}}xs.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),A.reduceDescriptors(xs.prototype,({value:s},t)=>{let e=t[0].toUpperCase()+t.slice(1);return{get:()=>s,set(n){this[e]=n}}}),A.freezeMethods(xs);const Wt=xs;function Vi(s,t){const e=this||Ui,n=t||e,i=Wt.from(n.headers);let r=n.data;return A.forEach(s,function(a){r=a.call(e,r,i.normalize(),t?t.status:void 0)}),i.normalize(),r}function Ka(s){return!!(s&&s.__CANCEL__)}function hn(s,t,e){Y.call(this,s??"canceled",Y.ERR_CANCELED,t,e),this.name="CanceledError"}A.inherits(hn,Y,{__CANCEL__:!0});function th(s,t,e){const n=e.config.validateStatus;!e.status||!n||n(e.status)?s(e):t(new Y("Request failed with status code "+e.status,[Y.ERR_BAD_REQUEST,Y.ERR_BAD_RESPONSE][Math.floor(e.status/100)-4],e.config,e.request,e))}function Fd(s){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(s);return t&&t[1]||""}function Yd(s,t){s=s||10;const e=new Array(s),n=new Array(s);let i=0,r=0,o;return t=t!==void 0?t:1e3,function(h){const c=Date.now(),u=n[r];o||(o=c),e[i]=h,n[i]=c;let l=r,m=0;for(;l!==i;)m+=e[l++],l=l%s;if(i=(i+1)%s,i===r&&(r=(r+1)%s),c-o<t)return;const f=u&&c-u;return f?Math.round(m*1e3/f):void 0}}function Xd(s,t){let e=0,n=1e3/t,i,r;const o=(c,u=Date.now())=>{e=u,i=null,r&&(clearTimeout(r),r=null),s.apply(null,c)};return[(...c)=>{const u=Date.now(),l=u-e;l>=n?o(c,u):(i=c,r||(r=setTimeout(()=>{r=null,o(i)},n-l)))},()=>i&&o(i)]}const bs=(s,t,e=3)=>{let n=0;const i=Yd(50,250);return Xd(r=>{const o=r.loaded,a=r.lengthComputable?r.total:void 0,h=o-n,c=i(h),u=o<=a;n=o;const l={loaded:o,total:a,progress:a?o/a:void 0,bytes:h,rate:c||void 0,estimated:c&&a&&u?(a-o)/c:void 0,event:r,lengthComputable:a!=null,[t?"download":"upload"]:!0};s(l)},e)},eh=(s,t)=>{const e=s!=null;return[n=>t[0]({lengthComputable:e,total:s,loaded:n}),t[1]]},nh=s=>(...t)=>A.asap(()=>s(...t)),Ud=xt.hasStandardBrowserEnv?((s,t)=>e=>(e=new URL(e,xt.origin),s.protocol===e.protocol&&s.host===e.host&&(t||s.port===e.port)))(new URL(xt.origin),xt.navigator&&/(msie|trident)/i.test(xt.navigator.userAgent)):()=>!0,$d=xt.hasStandardBrowserEnv?{write(s,t,e,n,i,r){const o=[s+"="+encodeURIComponent(t)];A.isNumber(e)&&o.push("expires="+new Date(e).toGMTString()),A.isString(n)&&o.push("path="+n),A.isString(i)&&o.push("domain="+i),r===!0&&o.push("secure"),document.cookie=o.join("; ")},read(s){const t=document.cookie.match(new RegExp("(^|;\\s*)("+s+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(s){this.write(s,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function Vd(s){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(s)}function Gd(s,t){return t?s.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):s}function sh(s,t,e){let n=!Vd(t);return s&&(n||e==!1)?Gd(s,t):t}const ih=s=>s instanceof Wt?{...s}:s;function Ne(s,t){t=t||{};const e={};function n(c,u,l,m){return A.isPlainObject(c)&&A.isPlainObject(u)?A.merge.call({caseless:m},c,u):A.isPlainObject(u)?A.merge({},u):A.isArray(u)?u.slice():u}function i(c,u,l,m){if(A.isUndefined(u)){if(!A.isUndefined(c))return n(void 0,c,l,m)}else return n(c,u,l,m)}function r(c,u){if(!A.isUndefined(u))return n(void 0,u)}function o(c,u){if(A.isUndefined(u)){if(!A.isUndefined(c))return n(void 0,c)}else return n(void 0,u)}function a(c,u,l){if(l in t)return n(c,u);if(l in s)return n(void 0,c)}const h={url:r,method:r,data:r,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:a,headers:(c,u,l)=>i(ih(c),ih(u),l,!0)};return A.forEach(Object.keys(Object.assign({},s,t)),function(u){const l=h[u]||i,m=l(s[u],t[u],u);A.isUndefined(m)&&l!==a||(e[u]=m)}),e}const rh=s=>{const t=Ne({},s);let{data:e,withXSRFToken:n,xsrfHeaderName:i,xsrfCookieName:r,headers:o,auth:a}=t;t.headers=o=Wt.from(o),t.url=Ha(sh(t.baseURL,t.url,t.allowAbsoluteUrls),s.params,s.paramsSerializer),a&&o.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):"")));let h;if(A.isFormData(e)){if(xt.hasStandardBrowserEnv||xt.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if((h=o.getContentType())!==!1){const[c,...u]=h?h.split(";").map(l=>l.trim()).filter(Boolean):[];o.setContentType([c||"multipart/form-data",...u].join("; "))}}if(xt.hasStandardBrowserEnv&&(n&&A.isFunction(n)&&(n=n(t)),n||n!==!1&&Ud(t.url))){const c=i&&r&&$d.read(r);c&&o.set(i,c)}return t},qd=typeof XMLHttpRequest<"u"&&function(s){return new Promise(function(e,n){const i=rh(s);let r=i.data;const o=Wt.from(i.headers).normalize();let{responseType:a,onUploadProgress:h,onDownloadProgress:c}=i,u,l,m,f,p;function y(){f&&f(),p&&p(),i.cancelToken&&i.cancelToken.unsubscribe(u),i.signal&&i.signal.removeEventListener("abort",u)}let v=new XMLHttpRequest;v.open(i.method.toUpperCase(),i.url,!0),v.timeout=i.timeout;function w(){if(!v)return;const x=Wt.from("getAllResponseHeaders"in v&&v.getAllResponseHeaders()),E={data:!a||a==="text"||a==="json"?v.responseText:v.response,status:v.status,statusText:v.statusText,headers:x,config:s,request:v};th(function(L){e(L),y()},function(L){n(L),y()},E),v=null}"onloadend"in v?v.onloadend=w:v.onreadystatechange=function(){!v||v.readyState!==4||v.status===0&&!(v.responseURL&&v.responseURL.indexOf("file:")===0)||setTimeout(w)},v.onabort=function(){v&&(n(new Y("Request aborted",Y.ECONNABORTED,s,v)),v=null)},v.onerror=function(){n(new Y("Network Error",Y.ERR_NETWORK,s,v)),v=null},v.ontimeout=function(){let b=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded";const E=i.transitional||Ja;i.timeoutErrorMessage&&(b=i.timeoutErrorMessage),n(new Y(b,E.clarifyTimeoutError?Y.ETIMEDOUT:Y.ECONNABORTED,s,v)),v=null},r===void 0&&o.setContentType(null),"setRequestHeader"in v&&A.forEach(o.toJSON(),function(b,E){v.setRequestHeader(E,b)}),A.isUndefined(i.withCredentials)||(v.withCredentials=!!i.withCredentials),a&&a!=="json"&&(v.responseType=i.responseType),c&&([m,p]=bs(c,!0),v.addEventListener("progress",m)),h&&v.upload&&([l,f]=bs(h),v.upload.addEventListener("progress",l),v.upload.addEventListener("loadend",f)),(i.cancelToken||i.signal)&&(u=x=>{v&&(n(!x||x.type?new hn(null,s,v):x),v.abort(),v=null)},i.cancelToken&&i.cancelToken.subscribe(u),i.signal&&(i.signal.aborted?u():i.signal.addEventListener("abort",u)));const _=Fd(i.url);if(_&&xt.protocols.indexOf(_)===-1){n(new Y("Unsupported protocol "+_+":",Y.ERR_BAD_REQUEST,s));return}v.send(r||null)})},jd=(s,t)=>{const{length:e}=s=s?s.filter(Boolean):[];if(t||e){let n=new AbortController,i;const r=function(c){if(!i){i=!0,a();const u=c instanceof Error?c:this.reason;n.abort(u instanceof Y?u:new hn(u instanceof Error?u.message:u))}};let o=t&&setTimeout(()=>{o=null,r(new Y(`timeout ${t} of ms exceeded`,Y.ETIMEDOUT))},t);const a=()=>{s&&(o&&clearTimeout(o),o=null,s.forEach(c=>{c.unsubscribe?c.unsubscribe(r):c.removeEventListener("abort",r)}),s=null)};s.forEach(c=>c.addEventListener("abort",r));const{signal:h}=n;return h.unsubscribe=()=>A.asap(a),h}},Hd=function*(s,t){let e=s.byteLength;if(!t||e<t){yield s;return}let n=0,i;for(;n<e;)i=n+t,yield s.slice(n,i),n=i},Wd=async function*(s,t){for await(const e of Jd(s))yield*Hd(e,t)},Jd=async function*(s){if(s[Symbol.asyncIterator]){yield*s;return}const t=s.getReader();try{for(;;){const{done:e,value:n}=await t.read();if(e)break;yield n}}finally{await t.cancel()}},oh=(s,t,e,n)=>{const i=Wd(s,t);let r=0,o,a=h=>{o||(o=!0,n&&n(h))};return new ReadableStream({async pull(h){try{const{done:c,value:u}=await i.next();if(c){a(),h.close();return}let l=u.byteLength;if(e){let m=r+=l;e(m)}h.enqueue(new Uint8Array(u))}catch(c){throw a(c),c}},cancel(h){return a(h),i.return()}},{highWaterMark:2})},vs=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",ah=vs&&typeof ReadableStream=="function",Zd=vs&&(typeof TextEncoder=="function"?(s=>t=>s.encode(t))(new TextEncoder):async s=>new Uint8Array(await new Response(s).arrayBuffer())),hh=(s,...t)=>{try{return!!s(...t)}catch{return!1}},Qd=ah&&hh(()=>{let s=!1;const t=new Request(xt.origin,{body:new ReadableStream,method:"POST",get duplex(){return s=!0,"half"}}).headers.has("Content-Type");return s&&!t}),ch=64*1024,Gi=ah&&hh(()=>A.isReadableStream(new Response("").body)),_s={stream:Gi&&(s=>s.body)};vs&&(s=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!_s[t]&&(_s[t]=A.isFunction(s[t])?e=>e[t]():(e,n)=>{throw new Y(`Response type '${t}' is not supported`,Y.ERR_NOT_SUPPORT,n)})})})(new Response);const Kd=async s=>{if(s==null)return 0;if(A.isBlob(s))return s.size;if(A.isSpecCompliantForm(s))return(await new Request(xt.origin,{method:"POST",body:s}).arrayBuffer()).byteLength;if(A.isArrayBufferView(s)||A.isArrayBuffer(s))return s.byteLength;if(A.isURLSearchParams(s)&&(s=s+""),A.isString(s))return(await Zd(s)).byteLength},tm=async(s,t)=>{const e=A.toFiniteNumber(s.getContentLength());return e??Kd(t)},qi={http:bd,xhr:qd,fetch:vs&&(async s=>{let{url:t,method:e,data:n,signal:i,cancelToken:r,timeout:o,onDownloadProgress:a,onUploadProgress:h,responseType:c,headers:u,withCredentials:l="same-origin",fetchOptions:m}=rh(s);c=c?(c+"").toLowerCase():"text";let f=jd([i,r&&r.toAbortSignal()],o),p;const y=f&&f.unsubscribe&&(()=>{f.unsubscribe()});let v;try{if(h&&Qd&&e!=="get"&&e!=="head"&&(v=await tm(u,n))!==0){let E=new Request(t,{method:"POST",body:n,duplex:"half"}),C;if(A.isFormData(n)&&(C=E.headers.get("content-type"))&&u.setContentType(C),E.body){const[L,B]=eh(v,bs(nh(h)));n=oh(E.body,ch,L,B)}}A.isString(l)||(l=l?"include":"omit");const w="credentials"in Request.prototype;p=new Request(t,{...m,signal:f,method:e.toUpperCase(),headers:u.normalize().toJSON(),body:n,duplex:"half",credentials:w?l:void 0});let _=await fetch(p);const x=Gi&&(c==="stream"||c==="response");if(Gi&&(a||x&&y)){const E={};["status","statusText","headers"].forEach(F=>{E[F]=_[F]});const C=A.toFiniteNumber(_.headers.get("content-length")),[L,B]=a&&eh(C,bs(nh(a),!0))||[];_=new Response(oh(_.body,ch,L,()=>{B&&B(),y&&y()}),E)}c=c||"text";let b=await _s[A.findKey(_s,c)||"text"](_,s);return!x&&y&&y(),await new Promise((E,C)=>{th(E,C,{data:b,headers:Wt.from(_.headers),status:_.status,statusText:_.statusText,config:s,request:p})})}catch(w){throw y&&y(),w&&w.name==="TypeError"&&/fetch/i.test(w.message)?Object.assign(new Y("Network Error",Y.ERR_NETWORK,s,p),{cause:w.cause||w}):Y.from(w,w&&w.code,s,p)}})};A.forEach(qi,(s,t)=>{if(s){try{Object.defineProperty(s,"name",{value:t})}catch{}Object.defineProperty(s,"adapterName",{value:t})}});const uh=s=>`- ${s}`,em=s=>A.isFunction(s)||s===null||s===!1,lh={getAdapter:s=>{s=A.isArray(s)?s:[s];const{length:t}=s;let e,n;const i={};for(let r=0;r<t;r++){e=s[r];let o;if(n=e,!em(e)&&(n=qi[(o=String(e)).toLowerCase()],n===void 0))throw new Y(`Unknown adapter '${o}'`);if(n)break;i[o||"#"+r]=n}if(!n){const r=Object.entries(i).map(([a,h])=>`adapter ${a} `+(h===!1?"is not supported by the environment":"is not available in the build"));let o=t?r.length>1?`since :
|
|
15
|
+
`+r.map(uh).join(`
|
|
16
|
+
`):" "+uh(r[0]):"as no adapter specified";throw new Y("There is no suitable adapter to dispatch the request "+o,"ERR_NOT_SUPPORT")}return n},adapters:qi};function ji(s){if(s.cancelToken&&s.cancelToken.throwIfRequested(),s.signal&&s.signal.aborted)throw new hn(null,s)}function fh(s){return ji(s),s.headers=Wt.from(s.headers),s.data=Vi.call(s,s.transformRequest),["post","put","patch"].indexOf(s.method)!==-1&&s.headers.setContentType("application/x-www-form-urlencoded",!1),lh.getAdapter(s.adapter||Ui.adapter)(s).then(function(n){return ji(s),n.data=Vi.call(s,s.transformResponse,n),n.headers=Wt.from(n.headers),n},function(n){return Ka(n)||(ji(s),n&&n.response&&(n.response.data=Vi.call(s,s.transformResponse,n.response),n.response.headers=Wt.from(n.response.headers))),Promise.reject(n)})}const dh="1.8.4",Ss={};["object","boolean","number","function","string","symbol"].forEach((s,t)=>{Ss[s]=function(n){return typeof n===s||"a"+(t<1?"n ":" ")+s}});const mh={};Ss.transitional=function(t,e,n){function i(r,o){return"[Axios v"+dh+"] Transitional option '"+r+"'"+o+(n?". "+n:"")}return(r,o,a)=>{if(t===!1)throw new Y(i(o," has been removed"+(e?" in "+e:"")),Y.ERR_DEPRECATED);return e&&!mh[o]&&(mh[o]=!0,console.warn(i(o," has been deprecated since v"+e+" and will be removed in the near future"))),t?t(r,o,a):!0}},Ss.spelling=function(t){return(e,n)=>(console.warn(`${n} is likely a misspelling of ${t}`),!0)};function nm(s,t,e){if(typeof s!="object")throw new Y("options must be an object",Y.ERR_BAD_OPTION_VALUE);const n=Object.keys(s);let i=n.length;for(;i-- >0;){const r=n[i],o=t[r];if(o){const a=s[r],h=a===void 0||o(a,r,s);if(h!==!0)throw new Y("option "+r+" must be "+h,Y.ERR_BAD_OPTION_VALUE);continue}if(e!==!0)throw new Y("Unknown option "+r,Y.ERR_BAD_OPTION)}}const Cs={assertOptions:nm,validators:Ss},ie=Cs.validators;class Ts{constructor(t){this.defaults=t,this.interceptors={request:new Wa,response:new Wa}}async request(t,e){try{return await this._request(t,e)}catch(n){if(n instanceof Error){let i={};Error.captureStackTrace?Error.captureStackTrace(i):i=new Error;const r=i.stack?i.stack.replace(/^.+\n/,""):"";try{n.stack?r&&!String(n.stack).endsWith(r.replace(/^.+\n.+\n/,""))&&(n.stack+=`
|
|
17
|
+
`+r):n.stack=r}catch{}}throw n}}_request(t,e){typeof t=="string"?(e=e||{},e.url=t):e=t||{},e=Ne(this.defaults,e);const{transitional:n,paramsSerializer:i,headers:r}=e;n!==void 0&&Cs.assertOptions(n,{silentJSONParsing:ie.transitional(ie.boolean),forcedJSONParsing:ie.transitional(ie.boolean),clarifyTimeoutError:ie.transitional(ie.boolean)},!1),i!=null&&(A.isFunction(i)?e.paramsSerializer={serialize:i}:Cs.assertOptions(i,{encode:ie.function,serialize:ie.function},!0)),e.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?e.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:e.allowAbsoluteUrls=!0),Cs.assertOptions(e,{baseUrl:ie.spelling("baseURL"),withXsrfToken:ie.spelling("withXSRFToken")},!0),e.method=(e.method||this.defaults.method||"get").toLowerCase();let o=r&&A.merge(r.common,r[e.method]);r&&A.forEach(["delete","get","head","post","put","patch","common"],p=>{delete r[p]}),e.headers=Wt.concat(o,r);const a=[];let h=!0;this.interceptors.request.forEach(function(y){typeof y.runWhen=="function"&&y.runWhen(e)===!1||(h=h&&y.synchronous,a.unshift(y.fulfilled,y.rejected))});const c=[];this.interceptors.response.forEach(function(y){c.push(y.fulfilled,y.rejected)});let u,l=0,m;if(!h){const p=[fh.bind(this),void 0];for(p.unshift.apply(p,a),p.push.apply(p,c),m=p.length,u=Promise.resolve(e);l<m;)u=u.then(p[l++],p[l++]);return u}m=a.length;let f=e;for(l=0;l<m;){const p=a[l++],y=a[l++];try{f=p(f)}catch(v){y.call(this,v);break}}try{u=fh.call(this,f)}catch(p){return Promise.reject(p)}for(l=0,m=c.length;l<m;)u=u.then(c[l++],c[l++]);return u}getUri(t){t=Ne(this.defaults,t);const e=sh(t.baseURL,t.url,t.allowAbsoluteUrls);return Ha(e,t.params,t.paramsSerializer)}}A.forEach(["delete","get","head","options"],function(t){Ts.prototype[t]=function(e,n){return this.request(Ne(n||{},{method:t,url:e,data:(n||{}).data}))}}),A.forEach(["post","put","patch"],function(t){function e(n){return function(r,o,a){return this.request(Ne(a||{},{method:t,headers:n?{"Content-Type":"multipart/form-data"}:{},url:r,data:o}))}}Ts.prototype[t]=e(),Ts.prototype[t+"Form"]=e(!0)});const Es=Ts;class Hi{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let e;this.promise=new Promise(function(r){e=r});const n=this;this.promise.then(i=>{if(!n._listeners)return;let r=n._listeners.length;for(;r-- >0;)n._listeners[r](i);n._listeners=null}),this.promise.then=i=>{let r;const o=new Promise(a=>{n.subscribe(a),r=a}).then(i);return o.cancel=function(){n.unsubscribe(r)},o},t(function(r,o,a){n.reason||(n.reason=new hn(r,o,a),e(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const e=this._listeners.indexOf(t);e!==-1&&this._listeners.splice(e,1)}toAbortSignal(){const t=new AbortController,e=n=>{t.abort(n)};return this.subscribe(e),t.signal.unsubscribe=()=>this.unsubscribe(e),t.signal}static source(){let t;return{token:new Hi(function(i){t=i}),cancel:t}}}const sm=Hi;function im(s){return function(e){return s.apply(null,e)}}function rm(s){return A.isObject(s)&&s.isAxiosError===!0}const Wi={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(Wi).forEach(([s,t])=>{Wi[t]=s});const om=Wi;function ph(s){const t=new Es(s),e=Ra(Es.prototype.request,t);return A.extend(e,Es.prototype,t,{allOwnKeys:!0}),A.extend(e,t,null,{allOwnKeys:!0}),e.create=function(i){return ph(Ne(s,i))},e}const ht=ph(Ui);ht.Axios=Es,ht.CanceledError=hn,ht.CancelToken=sm,ht.isCancel=Ka,ht.VERSION=dh,ht.toFormData=ys,ht.AxiosError=Y,ht.Cancel=ht.CanceledError,ht.all=function(t){return Promise.all(t)},ht.spread=im,ht.isAxiosError=rm,ht.mergeConfig=Ne,ht.AxiosHeaders=Wt,ht.formToJSON=s=>Za(A.isHTMLForm(s)?new FormData(s):s),ht.getAdapter=lh.getAdapter,ht.HttpStatusCode=om,ht.default=ht;const am=ht;class Ji{instance;canceler;retryCount=0;cacheTime=0;caches=new rn;constructor(t){this.instance=am.create(t),this.canceler=new hm,this.retryCount=t?.retry||0,this.cacheTime=t?.cache||0,this.instance.interceptors.request.use(e=>(this.canceler.pendingRequest(e),t?.interceptor?.request?.(e),e),e=>(this.canceler.cancelRequest(e.config),t?.interceptor?.requestError?.(e),e)),this.instance.interceptors.response.use(e=>(this.canceler.confirmRequest(e.config),t?.interceptor?.response?.(e),e.status==200?Promise.resolve(e):Promise.reject(e)),e=>(this.canceler.cancelRequest(e.config),t?.interceptor?.responseError?.(e),Promise.reject(e.response)))}request(t){let e=this.instance.request;const n=t.retry||this.retryCount;n&&(e=_i(e,n));const i=t.cache||this.cacheTime;return i&&(e=Si(e,i,this.caches)),e(t)}cancel(t){this.canceler.cancelRequest(t)}get(t,e){return this.request({...e,method:"get",url:t})}delete(t,e){return this.request({...e,method:"delete",url:t})}head(t,e){return this.request({...e,method:"head",url:t})}options(t,e){return this.request({...e,method:"options",url:t})}post(t,e,n){return this.request({...n,method:"post",url:t,data:e})}postBlob(t,e,n){return n={...n,headers:{...n?.headers,"Content-Type":"multipart/form-data"}},this.request({...n,method:"post",url:t,data:e})}postForm(t,e,n){return this.instance.postForm(t,e,{...n})}put(t,e,n){return this.request({...n,method:"put",url:t,data:e})}patch(t,e,n){return this.request({...n,method:"patch",url:t,data:e})}getUri(t){return this.instance.getUri(t)}}class hm{pendingRequestMap;constructor(){this.pendingRequestMap=new Map}getRequestId(t){const{method:e,url:n,params:i,data:r}=t;return xi({method:e,url:n,params:i,data:r})}pendingRequest(t){const e=this.getRequestId(t);if(this.pendingRequestMap.has(e))t.signal=this.pendingRequestMap.get(e)?.signal;else{const n=new AbortController;t.signal=n.signal,this.pendingRequestMap.set(e,n)}}confirmRequest(t){if(this.pendingRequestMap.size===0)return;const e=this.getRequestId(t);this.pendingRequestMap.has(e)&&this.pendingRequestMap.delete(e)}cancelRequest(t){if(this.pendingRequestMap.size===0)return;const e=this.getRequestId(t);this.pendingRequestMap.has(e)&&(this.pendingRequestMap.get(e)?.abort(),this.pendingRequestMap.delete(e))}cancelAllRequest(){const t=this.pendingRequestMap.values();for(const e of t)e.abort();this.pendingRequestMap.clear()}}const Zi=s=>new XMLSerializer().serializeToString(s),cm=(s,t="text/html")=>new DOMParser().parseFromString(s,t),Qi=(s,t=Tt.SVG,e=os.utf8)=>vi(Zi(s),t,e);async function Ki(s=["*"],t){let e=[];const n=document.createElement("input");return n.setAttribute("type","file"),n.setAttribute("visibility","hidden"),n.setAttribute("accept",s.join(",")),t&&n.setAttribute("multiple","true"),n.addEventListener("click",i=>{n.value=""},!1),new Promise((i,r)=>{n.addEventListener("change",o=>{e=Array.from(o.target.files||[]),e.length===0?r(new Error("Cancel")):i(e)},!1),window.addEventListener("focus",()=>{setTimeout(()=>{e.length===0&&r(new Error("Cancel"))},1e3)},{once:!0}),n.click()}).then(i=>(n.remove(),i)).catch(i=>{throw n.remove(),i})}function Mn(s,t=Xt.text,e){return new Promise((n,i)=>{const r=new FileReader;switch(r.addEventListener("progress",o=>{e?.(o.loaded,o.total)}),r.addEventListener("load",o=>{n(o.target?.result)}),r.addEventListener("error",o=>{i(o)}),t){case Xt.dataURL:r.readAsDataURL(s);break;case Xt.binaryString:r.readAsBinaryString(s);break;case Xt.arraybuffer:r.readAsArrayBuffer(s);break;case Xt.text:default:r.readAsText(s)}})}async function um(s){const t=await Mn(s,Xt.arraybuffer);return ef(t)}const lm=s=>{let t;return s instanceof File?t=s.name:t=s,t.match(/\.([0-9a-z]+)(?:[\\?#]|$)/i)?.[1]||""};function fm(s){switch(s.toLowerCase()){case"jpg":case"jpeg":return Tt.JPEG;case"gif":return Tt.GIF;case"svg":return Tt.SVG;case"pdf":return Tt.PDF;case"png":default:return Tt.PNG}}function gh(s,t,e,n,i,r,o){const a=new FileReader;a.addEventListener("load",h=>{if(!h.target||!h.target.result)return t(h);if(e.append(h.target.result),o<n.size)gh(s,t,e,n,i,o,Math.min(o+i,n.size));else return s(e.end())}),a.addEventListener("error",h=>t(h)),a.readAsArrayBuffer(n.slice(r,o))}async function yh(s,t=1048576){return await new Promise((e,n)=>gh(e,n,new Of.ArrayBuffer,s,t,0,Math.min(t,s.size)))}class dm{axios;checkURL;uploadURL;file;fileHash;chunkSize;chunks;currentChunk=0;isUploading=!1;begin=0;end=0;timer;time=[0,0,0,0,0,0];onExist;onStart;onProgress;onComplete;onTime;constructor(t){this.axios=new Ji({baseURL:t.baseURL,interceptor:{response:e=>{e.config.url==this.uploadURL&&e.status==200&&(this.onProgress?.(this.currentChunk++,this.chunks),this.end==this.file.size?(this.isUploading=!1,this.stopTimeCount(),this.onComplete?.()):this.isUploading&&this.uploadChunk())}}}),this.checkURL=t.checkURL,this.uploadURL=t.uploadURL,this.file=t.file,this.chunkSize=t.chunkSize||1048576,this.chunks=Math.ceil(this.file.size/this.chunkSize),this.onExist=t.onExist,this.onStart=t.onStart,this.onProgress=t.onProgress,this.onComplete=t.onComplete,this.onTime=t.onTime}async start(){this.fileHash||(this.fileHash=await yh(this.file,this.chunkSize)),(await this.axios.post(this.checkURL,{fileName:this.file.name,fileHash:this.fileHash})).data.isExist?(this.isUploading=!1,this.onExist?.()):this.isUploading||(this.onStart?.(),this.startTimeCount(),await this.uploadChunk())}pause(){this.isUploading&&(this.isUploading=!1,this.stopTimeCount())}async uploadChunk(){this.isUploading=!0,this.begin=this.currentChunk*this.chunkSize,this.end=Math.min(this.begin+this.chunkSize,this.file.size);const t=this.file.slice(this.begin,this.end),e=new FormData;e.append("fileData",t),e.append("fileName",this.file.name),e.append("fileHash",this.fileHash),e.append("chunkIndex",String(this.currentChunk)),e.append("chunks",String(this.chunks)),await this.axios.postBlob(this.uploadURL,e)}startTimeCount(){this.stopTimeCount(),this.timer=setInterval(()=>{af(this.time,1),this.onTime?.(sf(this.time))},1e3)}stopTimeCount(){this.timer&&(clearInterval(this.timer),this.timer=void 0)}}var wh={exports:{}};/*! Hammer.JS - v2.0.7 - 2016-04-22
|
|
18
18
|
* http://hammerjs.github.io/
|
|
19
19
|
*
|
|
20
20
|
* Copyright (c) 2016 Jorik Tangelder;
|
|
21
|
-
* Licensed under the MIT license */(function(s){(function(t,e,n,i){var r=["","webkit","Moz","MS","ms","o"],o=e.createElement("div"),a="function",
|
|
21
|
+
* Licensed under the MIT license */(function(s){(function(t,e,n,i){var r=["","webkit","Moz","MS","ms","o"],o=e.createElement("div"),a="function",h=Math.round,c=Math.abs,u=Date.now;function l(g,S,P){return setTimeout(x(g,P),S)}function m(g,S,P){return Array.isArray(g)?(f(g,P[S],P),!0):!1}function f(g,S,P){var M;if(g)if(g.forEach)g.forEach(S,P);else if(g.length!==i)for(M=0;M<g.length;)S.call(P,g[M],M,g),M++;else for(M in g)g.hasOwnProperty(M)&&S.call(P,g[M],M,g)}function p(g,S,P){var M="DEPRECATED METHOD: "+S+`
|
|
22
22
|
`+P+` AT
|
|
23
|
-
`;return function(){var D=new Error("get-stack-trace"),z=D&&D.stack?D.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",G=t.console&&(t.console.warn||t.console.log);return G&&G.call(t.console,M,z),y.apply(this,arguments)}}var w;typeof Object.assign!="function"?w=function(S){if(S===i||S===null)throw new TypeError("Cannot convert undefined or null to object");for(var P=Object(S),M=1;M<arguments.length;M++){var D=arguments[M];if(D!==i&&D!==null)for(var z in D)D.hasOwnProperty(z)&&(P[z]=D[z])}return P}:w=Object.assign;var b=p(function(S,P,M){for(var D=Object.keys(P),z=0;z<D.length;)(!M||M&&S[D[z]]===i)&&(S[D[z]]=P[D[z]]),z++;return S},"extend","Use `assign`."),x=p(function(S,P){return b(S,P,!0)},"merge","Use `assign`.");function g(y,S,P){var M=S.prototype,D;D=y.prototype=Object.create(M),D.constructor=y,D._super=M,P&&w(D,P)}function v(y,S){return function(){return y.apply(S,arguments)}}function _(y,S){return typeof y==a?y.apply(S&&S[0]||i,S):y}function E(y,S){return y===i?S:y}function C(y,S,P){f($(S),function(M){y.addEventListener(M,P,!1)})}function I(y,S,P){f($(S),function(M){y.removeEventListener(M,P,!1)})}function F(y,S){for(;y;){if(y==S)return!0;y=y.parentNode}return!1}function N(y,S){return y.indexOf(S)>-1}function $(y){return y.trim().split(/\s+/g)}function V(y,S,P){if(y.indexOf&&!P)return y.indexOf(S);for(var M=0;M<y.length;){if(P&&y[M][P]==S||!P&&y[M]===S)return M;M++}return-1}function W(y){return Array.prototype.slice.call(y,0)}function tt(y,S,P){for(var M=[],D=[],z=0;z<y.length;){var G=S?y[z][S]:y[z];V(D,G)<0&&M.push(y[z]),D[z]=G,z++}return P&&(S?M=M.sort(function(wt,Dt){return wt[S]>Dt[S]}):M=M.sort()),M}function Z(y,S){for(var P,M,D=S[0].toUpperCase()+S.slice(1),z=0;z<r.length;){if(P=r[z],M=P?P+D:S,M in y)return M;z++}return i}var Gt=1;function mt(){return Gt++}function kt(y){var S=y.ownerDocument||y;return S.defaultView||S.parentWindow||t}var Ot=/mobile|tablet|ip(ad|hone|od)|android/i,L="ontouchstart"in t,R=Z(t,"PointerEvent")!==i,U=L&&Ot.test(navigator.userAgent),H="touch",It="pen",ee="mouse",ti="kinect",ei=25,pt=1,re=2,it=4,Ct=8,yn=1,Ze=2,Qe=4,De=8,k=16,ot=Ze|Qe,Ke=De|k,sl=ot|Ke,il=["x","y"],ni=["clientX","clientY"];function qt(y,S){var P=this;this.manager=y,this.callback=S,this.element=y.element,this.target=y.options.inputTarget,this.domHandler=function(M){_(y.options.enable,[y])&&P.handler(M)},this.init()}qt.prototype={handler:function(){},init:function(){this.evEl&&C(this.element,this.evEl,this.domHandler),this.evTarget&&C(this.target,this.evTarget,this.domHandler),this.evWin&&C(kt(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&I(this.element,this.evEl,this.domHandler),this.evTarget&&I(this.target,this.evTarget,this.domHandler),this.evWin&&I(kt(this.element),this.evWin,this.domHandler)}};function P2(y){var S,P=y.options.inputClass;return P?S=P:R?S=Go:U?S=ri:L?S=qo:S=ii,new S(y,M2)}function M2(y,S,P){var M=P.pointers.length,D=P.changedPointers.length,z=S&pt&&M-D===0,G=S&(it|Ct)&&M-D===0;P.isFirst=!!z,P.isFinal=!!G,z&&(y.session={}),P.eventType=S,A2(y,P),y.emit("hammer.input",P),y.recognize(P),y.session.prevInput=P}function A2(y,S){var P=y.session,M=S.pointers,D=M.length;P.firstInput||(P.firstInput=rl(S)),D>1&&!P.firstMultiple?P.firstMultiple=rl(S):D===1&&(P.firstMultiple=!1);var z=P.firstInput,G=P.firstMultiple,gt=G?G.center:z.center,wt=S.center=ol(M);S.timeStamp=u(),S.deltaTime=S.timeStamp-z.timeStamp,S.angle=Vo(gt,wt),S.distance=si(gt,wt),k2(P,S),S.offsetDirection=cl(S.deltaX,S.deltaY);var Dt=al(S.deltaTime,S.deltaX,S.deltaY);S.overallVelocityX=Dt.x,S.overallVelocityY=Dt.y,S.overallVelocity=h(Dt.x)>h(Dt.y)?Dt.x:Dt.y,S.scale=G?R2(G.pointers,M):1,S.rotation=G?D2(G.pointers,M):0,S.maxPointers=P.prevInput?S.pointers.length>P.prevInput.maxPointers?S.pointers.length:P.prevInput.maxPointers:S.pointers.length,I2(P,S);var ae=y.element;F(S.srcEvent.target,ae)&&(ae=S.srcEvent.target),S.target=ae}function k2(y,S){var P=S.center,M=y.offsetDelta||{},D=y.prevDelta||{},z=y.prevInput||{};(S.eventType===pt||z.eventType===it)&&(D=y.prevDelta={x:z.deltaX||0,y:z.deltaY||0},M=y.offsetDelta={x:P.x,y:P.y}),S.deltaX=D.x+(P.x-M.x),S.deltaY=D.y+(P.y-M.y)}function I2(y,S){var P=y.lastInterval||S,M=S.timeStamp-P.timeStamp,D,z,G,gt;if(S.eventType!=Ct&&(M>ei||P.velocity===i)){var wt=S.deltaX-P.deltaX,Dt=S.deltaY-P.deltaY,ae=al(M,wt,Dt);z=ae.x,G=ae.y,D=h(ae.x)>h(ae.y)?ae.x:ae.y,gt=cl(wt,Dt),y.lastInterval=S}else D=P.velocity,z=P.velocityX,G=P.velocityY,gt=P.direction;S.velocity=D,S.velocityX=z,S.velocityY=G,S.direction=gt}function rl(y){for(var S=[],P=0;P<y.pointers.length;)S[P]={clientX:c(y.pointers[P].clientX),clientY:c(y.pointers[P].clientY)},P++;return{timeStamp:u(),pointers:S,center:ol(S),deltaX:y.deltaX,deltaY:y.deltaY}}function ol(y){var S=y.length;if(S===1)return{x:c(y[0].clientX),y:c(y[0].clientY)};for(var P=0,M=0,D=0;D<S;)P+=y[D].clientX,M+=y[D].clientY,D++;return{x:c(P/S),y:c(M/S)}}function al(y,S,P){return{x:S/y||0,y:P/y||0}}function cl(y,S){return y===S?yn:h(y)>=h(S)?y<0?Ze:Qe:S<0?De:k}function si(y,S,P){P||(P=il);var M=S[P[0]]-y[P[0]],D=S[P[1]]-y[P[1]];return Math.sqrt(M*M+D*D)}function Vo(y,S,P){P||(P=il);var M=S[P[0]]-y[P[0]],D=S[P[1]]-y[P[1]];return Math.atan2(D,M)*180/Math.PI}function D2(y,S){return Vo(S[1],S[0],ni)+Vo(y[1],y[0],ni)}function R2(y,S){return si(S[0],S[1],ni)/si(y[0],y[1],ni)}var L2={mousedown:pt,mousemove:re,mouseup:it},O2="mousedown",z2="mousemove mouseup";function ii(){this.evEl=O2,this.evWin=z2,this.pressed=!1,qt.apply(this,arguments)}g(ii,qt,{handler:function(S){var P=L2[S.type];P&pt&&S.button===0&&(this.pressed=!0),P&re&&S.which!==1&&(P=it),this.pressed&&(P&it&&(this.pressed=!1),this.callback(this.manager,P,{pointers:[S],changedPointers:[S],pointerType:ee,srcEvent:S}))}});var F2={pointerdown:pt,pointermove:re,pointerup:it,pointercancel:Ct,pointerout:Ct},B2={2:H,3:It,4:ee,5:ti},hl="pointerdown",ul="pointermove pointerup pointercancel";t.MSPointerEvent&&!t.PointerEvent&&(hl="MSPointerDown",ul="MSPointerMove MSPointerUp MSPointerCancel");function Go(){this.evEl=hl,this.evWin=ul,qt.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}g(Go,qt,{handler:function(S){var P=this.store,M=!1,D=S.type.toLowerCase().replace("ms",""),z=F2[D],G=B2[S.pointerType]||S.pointerType,gt=G==H,wt=V(P,S.pointerId,"pointerId");z&pt&&(S.button===0||gt)?wt<0&&(P.push(S),wt=P.length-1):z&(it|Ct)&&(M=!0),!(wt<0)&&(P[wt]=S,this.callback(this.manager,z,{pointers:P,changedPointers:[S],pointerType:G,srcEvent:S}),M&&P.splice(wt,1))}});var N2={touchstart:pt,touchmove:re,touchend:it,touchcancel:Ct},Y2="touchstart",U2="touchstart touchmove touchend touchcancel";function ll(){this.evTarget=Y2,this.evWin=U2,this.started=!1,qt.apply(this,arguments)}g(ll,qt,{handler:function(S){var P=N2[S.type];if(P===pt&&(this.started=!0),!!this.started){var M=X2.call(this,S,P);P&(it|Ct)&&M[0].length-M[1].length===0&&(this.started=!1),this.callback(this.manager,P,{pointers:M[0],changedPointers:M[1],pointerType:H,srcEvent:S})}}});function X2(y,S){var P=W(y.touches),M=W(y.changedTouches);return S&(it|Ct)&&(P=tt(P.concat(M),"identifier",!0)),[P,M]}var $2={touchstart:pt,touchmove:re,touchend:it,touchcancel:Ct},V2="touchstart touchmove touchend touchcancel";function ri(){this.evTarget=V2,this.targetIds={},qt.apply(this,arguments)}g(ri,qt,{handler:function(S){var P=$2[S.type],M=G2.call(this,S,P);M&&this.callback(this.manager,P,{pointers:M[0],changedPointers:M[1],pointerType:H,srcEvent:S})}});function G2(y,S){var P=W(y.touches),M=this.targetIds;if(S&(pt|re)&&P.length===1)return M[P[0].identifier]=!0,[P,P];var D,z,G=W(y.changedTouches),gt=[],wt=this.target;if(z=P.filter(function(Dt){return F(Dt.target,wt)}),S===pt)for(D=0;D<z.length;)M[z[D].identifier]=!0,D++;for(D=0;D<G.length;)M[G[D].identifier]&>.push(G[D]),S&(it|Ct)&&delete M[G[D].identifier],D++;if(gt.length)return[tt(z.concat(gt),"identifier",!0),gt]}var q2=2500,fl=25;function qo(){qt.apply(this,arguments);var y=v(this.handler,this);this.touch=new ri(this.manager,y),this.mouse=new ii(this.manager,y),this.primaryTouch=null,this.lastTouches=[]}g(qo,qt,{handler:function(S,P,M){var D=M.pointerType==H,z=M.pointerType==ee;if(!(z&&M.sourceCapabilities&&M.sourceCapabilities.firesTouchEvents)){if(D)j2.call(this,P,M);else if(z&&H2.call(this,M))return;this.callback(S,P,M)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});function j2(y,S){y&pt?(this.primaryTouch=S.changedPointers[0].identifier,dl.call(this,S)):y&(it|Ct)&&dl.call(this,S)}function dl(y){var S=y.changedPointers[0];if(S.identifier===this.primaryTouch){var P={x:S.clientX,y:S.clientY};this.lastTouches.push(P);var M=this.lastTouches,D=function(){var z=M.indexOf(P);z>-1&&M.splice(z,1)};setTimeout(D,q2)}}function H2(y){for(var S=y.srcEvent.clientX,P=y.srcEvent.clientY,M=0;M<this.lastTouches.length;M++){var D=this.lastTouches[M],z=Math.abs(S-D.x),G=Math.abs(P-D.y);if(z<=fl&&G<=fl)return!0}return!1}var ml=Z(o.style,"touchAction"),pl=ml!==i,gl="compute",yl="auto",jo="manipulation",tn="none",Qn="pan-x",Kn="pan-y",oi=J2();function Ho(y,S){this.manager=y,this.set(S)}Ho.prototype={set:function(y){y==gl&&(y=this.compute()),pl&&this.manager.element.style&&oi[y]&&(this.manager.element.style[ml]=y),this.actions=y.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var y=[];return f(this.manager.recognizers,function(S){_(S.options.enable,[S])&&(y=y.concat(S.getTouchAction()))}),W2(y.join(" "))},preventDefaults:function(y){var S=y.srcEvent,P=y.offsetDirection;if(this.manager.session.prevented){S.preventDefault();return}var M=this.actions,D=N(M,tn)&&!oi[tn],z=N(M,Kn)&&!oi[Kn],G=N(M,Qn)&&!oi[Qn];if(D){var gt=y.pointers.length===1,wt=y.distance<2,Dt=y.deltaTime<250;if(gt&&wt&&Dt)return}if(!(G&&z)&&(D||z&&P&ot||G&&P&Ke))return this.preventSrc(S)},preventSrc:function(y){this.manager.session.prevented=!0,y.preventDefault()}};function W2(y){if(N(y,tn))return tn;var S=N(y,Qn),P=N(y,Kn);return S&&P?tn:S||P?S?Qn:Kn:N(y,jo)?jo:yl}function J2(){if(!pl)return!1;var y={},S=t.CSS&&t.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(P){y[P]=S?t.CSS.supports("touch-action",P):!0}),y}var ai=1,jt=2,wn=4,Re=8,ge=Re,ts=16,oe=32;function ye(y){this.options=w({},this.defaults,y||{}),this.id=mt(),this.manager=null,this.options.enable=E(this.options.enable,!0),this.state=ai,this.simultaneous={},this.requireFail=[]}ye.prototype={defaults:{},set:function(y){return w(this.options,y),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(y){if(d(y,"recognizeWith",this))return this;var S=this.simultaneous;return y=ci(y,this),S[y.id]||(S[y.id]=y,y.recognizeWith(this)),this},dropRecognizeWith:function(y){return d(y,"dropRecognizeWith",this)?this:(y=ci(y,this),delete this.simultaneous[y.id],this)},requireFailure:function(y){if(d(y,"requireFailure",this))return this;var S=this.requireFail;return y=ci(y,this),V(S,y)===-1&&(S.push(y),y.requireFailure(this)),this},dropRequireFailure:function(y){if(d(y,"dropRequireFailure",this))return this;y=ci(y,this);var S=V(this.requireFail,y);return S>-1&&this.requireFail.splice(S,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(y){return!!this.simultaneous[y.id]},emit:function(y){var S=this,P=this.state;function M(D){S.manager.emit(D,y)}P<Re&&M(S.options.event+wl(P)),M(S.options.event),y.additionalEvent&&M(y.additionalEvent),P>=Re&&M(S.options.event+wl(P))},tryEmit:function(y){if(this.canEmit())return this.emit(y);this.state=oe},canEmit:function(){for(var y=0;y<this.requireFail.length;){if(!(this.requireFail[y].state&(oe|ai)))return!1;y++}return!0},recognize:function(y){var S=w({},y);if(!_(this.options.enable,[this,S])){this.reset(),this.state=oe;return}this.state&(ge|ts|oe)&&(this.state=ai),this.state=this.process(S),this.state&(jt|wn|Re|ts)&&this.tryEmit(S)},process:function(y){},getTouchAction:function(){},reset:function(){}};function wl(y){return y&ts?"cancel":y&Re?"end":y&wn?"move":y&jt?"start":""}function xl(y){return y==k?"down":y==De?"up":y==Ze?"left":y==Qe?"right":""}function ci(y,S){var P=S.manager;return P?P.get(y):y}function ne(){ye.apply(this,arguments)}g(ne,ye,{defaults:{pointers:1},attrTest:function(y){var S=this.options.pointers;return S===0||y.pointers.length===S},process:function(y){var S=this.state,P=y.eventType,M=S&(jt|wn),D=this.attrTest(y);return M&&(P&Ct||!D)?S|ts:M||D?P&it?S|Re:S&jt?S|wn:jt:oe}});function hi(){ne.apply(this,arguments),this.pX=null,this.pY=null}g(hi,ne,{defaults:{event:"pan",threshold:10,pointers:1,direction:sl},getTouchAction:function(){var y=this.options.direction,S=[];return y&ot&&S.push(Kn),y&Ke&&S.push(Qn),S},directionTest:function(y){var S=this.options,P=!0,M=y.distance,D=y.direction,z=y.deltaX,G=y.deltaY;return D&S.direction||(S.direction&ot?(D=z===0?yn:z<0?Ze:Qe,P=z!=this.pX,M=Math.abs(y.deltaX)):(D=G===0?yn:G<0?De:k,P=G!=this.pY,M=Math.abs(y.deltaY))),y.direction=D,P&&M>S.threshold&&D&S.direction},attrTest:function(y){return ne.prototype.attrTest.call(this,y)&&(this.state&jt||!(this.state&jt)&&this.directionTest(y))},emit:function(y){this.pX=y.deltaX,this.pY=y.deltaY;var S=xl(y.direction);S&&(y.additionalEvent=this.options.event+S),this._super.emit.call(this,y)}});function Wo(){ne.apply(this,arguments)}g(Wo,ne,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[tn]},attrTest:function(y){return this._super.attrTest.call(this,y)&&(Math.abs(y.scale-1)>this.options.threshold||this.state&jt)},emit:function(y){if(y.scale!==1){var S=y.scale<1?"in":"out";y.additionalEvent=this.options.event+S}this._super.emit.call(this,y)}});function Jo(){ye.apply(this,arguments),this._timer=null,this._input=null}g(Jo,ye,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[yl]},process:function(y){var S=this.options,P=y.pointers.length===S.pointers,M=y.distance<S.threshold,D=y.deltaTime>S.time;if(this._input=y,!M||!P||y.eventType&(it|Ct)&&!D)this.reset();else if(y.eventType&pt)this.reset(),this._timer=l(function(){this.state=ge,this.tryEmit()},S.time,this);else if(y.eventType&it)return ge;return oe},reset:function(){clearTimeout(this._timer)},emit:function(y){this.state===ge&&(y&&y.eventType&it?this.manager.emit(this.options.event+"up",y):(this._input.timeStamp=u(),this.manager.emit(this.options.event,this._input)))}});function Zo(){ne.apply(this,arguments)}g(Zo,ne,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[tn]},attrTest:function(y){return this._super.attrTest.call(this,y)&&(Math.abs(y.rotation)>this.options.threshold||this.state&jt)}});function Qo(){ne.apply(this,arguments)}g(Qo,ne,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:ot|Ke,pointers:1},getTouchAction:function(){return hi.prototype.getTouchAction.call(this)},attrTest:function(y){var S=this.options.direction,P;return S&(ot|Ke)?P=y.overallVelocity:S&ot?P=y.overallVelocityX:S&Ke&&(P=y.overallVelocityY),this._super.attrTest.call(this,y)&&S&y.offsetDirection&&y.distance>this.options.threshold&&y.maxPointers==this.options.pointers&&h(P)>this.options.velocity&&y.eventType&it},emit:function(y){var S=xl(y.offsetDirection);S&&this.manager.emit(this.options.event+S,y),this.manager.emit(this.options.event,y)}});function ui(){ye.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}g(ui,ye,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[jo]},process:function(y){var S=this.options,P=y.pointers.length===S.pointers,M=y.distance<S.threshold,D=y.deltaTime<S.time;if(this.reset(),y.eventType&pt&&this.count===0)return this.failTimeout();if(M&&D&&P){if(y.eventType!=it)return this.failTimeout();var z=this.pTime?y.timeStamp-this.pTime<S.interval:!0,G=!this.pCenter||si(this.pCenter,y.center)<S.posThreshold;this.pTime=y.timeStamp,this.pCenter=y.center,!G||!z?this.count=1:this.count+=1,this._input=y;var gt=this.count%S.taps;if(gt===0)return this.hasRequireFailures()?(this._timer=l(function(){this.state=ge,this.tryEmit()},S.interval,this),jt):ge}return oe},failTimeout:function(){return this._timer=l(function(){this.state=oe},this.options.interval,this),oe},reset:function(){clearTimeout(this._timer)},emit:function(){this.state==ge&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}});function we(y,S){return S=S||{},S.recognizers=E(S.recognizers,we.defaults.preset),new Ko(y,S)}we.VERSION="2.0.7",we.defaults={domEvents:!1,touchAction:gl,enable:!0,inputTarget:null,inputClass:null,preset:[[Zo,{enable:!1}],[Wo,{enable:!1},["rotate"]],[Qo,{direction:ot}],[hi,{direction:ot},["swipe"]],[ui],[ui,{event:"doubletap",taps:2},["tap"]],[Jo]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};var Z2=1,bl=2;function Ko(y,S){this.options=w({},we.defaults,S||{}),this.options.inputTarget=this.options.inputTarget||y,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=y,this.input=P2(this),this.touchAction=new Ho(this,this.options.touchAction),vl(this,!0),f(this.options.recognizers,function(P){var M=this.add(new P[0](P[1]));P[2]&&M.recognizeWith(P[2]),P[3]&&M.requireFailure(P[3])},this)}Ko.prototype={set:function(y){return w(this.options,y),y.touchAction&&this.touchAction.update(),y.inputTarget&&(this.input.destroy(),this.input.target=y.inputTarget,this.input.init()),this},stop:function(y){this.session.stopped=y?bl:Z2},recognize:function(y){var S=this.session;if(!S.stopped){this.touchAction.preventDefaults(y);var P,M=this.recognizers,D=S.curRecognizer;(!D||D&&D.state&ge)&&(D=S.curRecognizer=null);for(var z=0;z<M.length;)P=M[z],S.stopped!==bl&&(!D||P==D||P.canRecognizeWith(D))?P.recognize(y):P.reset(),!D&&P.state&(jt|wn|Re)&&(D=S.curRecognizer=P),z++}},get:function(y){if(y instanceof ye)return y;for(var S=this.recognizers,P=0;P<S.length;P++)if(S[P].options.event==y)return S[P];return null},add:function(y){if(d(y,"add",this))return this;var S=this.get(y.options.event);return S&&this.remove(S),this.recognizers.push(y),y.manager=this,this.touchAction.update(),y},remove:function(y){if(d(y,"remove",this))return this;if(y=this.get(y),y){var S=this.recognizers,P=V(S,y);P!==-1&&(S.splice(P,1),this.touchAction.update())}return this},on:function(y,S){if(y!==i&&S!==i){var P=this.handlers;return f($(y),function(M){P[M]=P[M]||[],P[M].push(S)}),this}},off:function(y,S){if(y!==i){var P=this.handlers;return f($(y),function(M){S?P[M]&&P[M].splice(V(P[M],S),1):delete P[M]}),this}},emit:function(y,S){this.options.domEvents&&Q2(y,S);var P=this.handlers[y]&&this.handlers[y].slice();if(!(!P||!P.length)){S.type=y,S.preventDefault=function(){S.srcEvent.preventDefault()};for(var M=0;M<P.length;)P[M](S),M++}},destroy:function(){this.element&&vl(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}};function vl(y,S){var P=y.element;if(P.style){var M;f(y.options.cssProps,function(D,z){M=Z(P.style,z),S?(y.oldCssProps[M]=P.style[M],P.style[M]=D):P.style[M]=y.oldCssProps[M]||""}),S||(y.oldCssProps={})}}function Q2(y,S){var P=e.createEvent("Event");P.initEvent(y,!0,!0),P.gesture=S,S.target.dispatchEvent(P)}w(we,{INPUT_START:pt,INPUT_MOVE:re,INPUT_END:it,INPUT_CANCEL:Ct,STATE_POSSIBLE:ai,STATE_BEGAN:jt,STATE_CHANGED:wn,STATE_ENDED:Re,STATE_RECOGNIZED:ge,STATE_CANCELLED:ts,STATE_FAILED:oe,DIRECTION_NONE:yn,DIRECTION_LEFT:Ze,DIRECTION_RIGHT:Qe,DIRECTION_UP:De,DIRECTION_DOWN:k,DIRECTION_HORIZONTAL:ot,DIRECTION_VERTICAL:Ke,DIRECTION_ALL:sl,Manager:Ko,Input:qt,TouchAction:Ho,TouchInput:ri,MouseInput:ii,PointerEventInput:Go,TouchMouseInput:qo,SingleTouchInput:ll,Recognizer:ye,AttrRecognizer:ne,Tap:ui,Pan:hi,Swipe:Qo,Pinch:Wo,Rotate:Zo,Press:Jo,on:C,off:I,each:f,merge:x,extend:b,assign:w,inherit:g,bindFn:v,prefixed:Z});var K2=typeof t<"u"?t:typeof self<"u"?self:{};K2.Hammer=we,typeof i=="function"&&i.amd?i(function(){return we}):s.exports?s.exports=we:t[n]=we})(window,document,"Hammer")})(gc);var ym=gc.exports;const et=ka(ym);var Ki=function(s,t){return Ki=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])},Ki(s,t)};function be(s,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");Ki(s,t);function e(){this.constructor=s}s.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}function wm(s,t,e,n){function i(r){return r instanceof e?r:new e(function(o){o(r)})}return new(e||(e=Promise))(function(r,o){function a(u){try{h(n.next(u))}catch(l){o(l)}}function c(u){try{h(n.throw(u))}catch(l){o(l)}}function h(u){u.done?r(u.value):i(u.value).then(a,c)}h((n=n.apply(s,t||[])).next())})}function yc(s,t){var e={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},n,i,r,o=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return o.next=a(0),o.throw=a(1),o.return=a(2),typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(h){return function(u){return c([h,u])}}function c(h){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,h[0]&&(e=0)),e;)try{if(n=1,i&&(r=h[0]&2?i.return:h[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,h[1])).done)return r;switch(i=0,r&&(h=[h[0]&2,r.value]),h[0]){case 0:case 1:r=h;break;case 4:return e.label++,{value:h[1],done:!1};case 5:e.label++,i=h[1],h=[0];continue;case 7:h=e.ops.pop(),e.trys.pop();continue;default:if(r=e.trys,!(r=r.length>0&&r[r.length-1])&&(h[0]===6||h[0]===2)){e=0;continue}if(h[0]===3&&(!r||h[1]>r[0]&&h[1]<r[3])){e.label=h[1];break}if(h[0]===6&&e.label<r[1]){e.label=r[1],r=h;break}if(r&&e.label<r[2]){e.label=r[2],e.ops.push(h);break}r[2]&&e.ops.pop(),e.trys.pop();continue}h=t.call(s,e)}catch(u){h=[6,u],i=0}finally{n=r=0}if(h[0]&5)throw h[1];return{value:h[0]?h[1]:void 0,done:!0}}}function Fe(s){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&s[t],n=0;if(e)return e.call(s);if(s&&typeof s.length=="number")return{next:function(){return s&&n>=s.length&&(s=void 0),{value:s&&s[n++],done:!s}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function ve(s,t){var e=typeof Symbol=="function"&&s[Symbol.iterator];if(!e)return s;var n=e.call(s),i,r=[],o;try{for(;(t===void 0||t-- >0)&&!(i=n.next()).done;)r.push(i.value)}catch(a){o={error:a}}finally{try{i&&!i.done&&(e=n.return)&&e.call(n)}finally{if(o)throw o.error}}return r}function Be(s,t,e){if(e||arguments.length===2)for(var n=0,i=t.length,r;n<i;n++)(r||!(n in t))&&(r||(r=Array.prototype.slice.call(t,0,n)),r[n]=t[n]);return s.concat(r||Array.prototype.slice.call(t))}function on(s){return this instanceof on?(this.v=s,this):new on(s)}function xm(s,t,e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=e.apply(s,t||[]),i,r=[];return i=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),a("next"),a("throw"),a("return",o),i[Symbol.asyncIterator]=function(){return this},i;function o(f){return function(p){return Promise.resolve(p).then(f,l)}}function a(f,p){n[f]&&(i[f]=function(w){return new Promise(function(b,x){r.push([f,w,b,x])>1||c(f,w)})},p&&(i[f]=p(i[f])))}function c(f,p){try{h(n[f](p))}catch(w){d(r[0][3],w)}}function h(f){f.value instanceof on?Promise.resolve(f.value.v).then(u,l):d(r[0][2],f)}function u(f){c("next",f)}function l(f){c("throw",f)}function d(f,p){f(p),r.shift(),r.length&&c(r[0][0],r[0][1])}}function bm(s){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=s[Symbol.asyncIterator],e;return t?t.call(s):(s=typeof Fe=="function"?Fe(s):s[Symbol.iterator](),e={},n("next"),n("throw"),n("return"),e[Symbol.asyncIterator]=function(){return this},e);function n(r){e[r]=s[r]&&function(o){return new Promise(function(a,c){o=s[r](o),i(a,c,o.done,o.value)})}}function i(r,o,a,c){Promise.resolve(c).then(function(h){r({value:h,done:a})},o)}}typeof SuppressedError=="function"&&SuppressedError;function q(s){return typeof s=="function"}function tr(s){var t=function(n){Error.call(n),n.stack=new Error().stack},e=s(t);return e.prototype=Object.create(Error.prototype),e.prototype.constructor=e,e}var er=tr(function(s){return function(e){s(this),this.message=e?e.length+` errors occurred during unsubscription:
|
|
23
|
+
`;return function(){var I=new Error("get-stack-trace"),z=I&&I.stack?I.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",V=t.console&&(t.console.warn||t.console.log);return V&&V.call(t.console,M,z),g.apply(this,arguments)}}var y;typeof Object.assign!="function"?y=function(S){if(S===i||S===null)throw new TypeError("Cannot convert undefined or null to object");for(var P=Object(S),M=1;M<arguments.length;M++){var I=arguments[M];if(I!==i&&I!==null)for(var z in I)I.hasOwnProperty(z)&&(P[z]=I[z])}return P}:y=Object.assign;var v=p(function(S,P,M){for(var I=Object.keys(P),z=0;z<I.length;)(!M||M&&S[I[z]]===i)&&(S[I[z]]=P[I[z]]),z++;return S},"extend","Use `assign`."),w=p(function(S,P){return v(S,P,!0)},"merge","Use `assign`.");function _(g,S,P){var M=S.prototype,I;I=g.prototype=Object.create(M),I.constructor=g,I._super=M,P&&y(I,P)}function x(g,S){return function(){return g.apply(S,arguments)}}function b(g,S){return typeof g==a?g.apply(S&&S[0]||i,S):g}function E(g,S){return g===i?S:g}function C(g,S,P){f($(S),function(M){g.addEventListener(M,P,!1)})}function L(g,S,P){f($(S),function(M){g.removeEventListener(M,P,!1)})}function B(g,S){for(;g;){if(g==S)return!0;g=g.parentNode}return!1}function F(g,S){return g.indexOf(S)>-1}function $(g){return g.trim().split(/\s+/g)}function G(g,S,P){if(g.indexOf&&!P)return g.indexOf(S);for(var M=0;M<g.length;){if(P&&g[M][P]==S||!P&&g[M]===S)return M;M++}return-1}function J(g){return Array.prototype.slice.call(g,0)}function st(g,S,P){for(var M=[],I=[],z=0;z<g.length;){var V=S?g[z][S]:g[z];G(I,V)<0&&M.push(g[z]),I[z]=V,z++}return P&&(S?M=M.sort(function(yt,kt){return yt[S]>kt[S]}):M=M.sort()),M}function K(g,S){for(var P,M,I=S[0].toUpperCase()+S.slice(1),z=0;z<r.length;){if(P=r[z],M=P?P+I:S,M in g)return M;z++}return i}var Kt=1;function Yt(){return Kt++}function $t(g){var S=g.ownerDocument||g;return S.defaultView||S.parentWindow||t}var te=/mobile|tablet|ip(ad|hone|od)|android/i,R="ontouchstart"in t,D=K(t,"PointerEvent")!==i,X=R&&te.test(navigator.userAgent),H="touch",At="pen",ee="mouse",ni="kinect",si=25,mt=1,re=2,it=4,St=8,xn=1,Ke=2,tn=4,Le=8,k=16,at=Ke|tn,en=Le|k,sl=at|en,il=["x","y"],ii=["clientX","clientY"];function Vt(g,S){var P=this;this.manager=g,this.callback=S,this.element=g.element,this.target=g.options.inputTarget,this.domHandler=function(M){b(g.options.enable,[g])&&P.handler(M)},this.init()}Vt.prototype={handler:function(){},init:function(){this.evEl&&C(this.element,this.evEl,this.domHandler),this.evTarget&&C(this.target,this.evTarget,this.domHandler),this.evWin&&C($t(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&L(this.element,this.evEl,this.domHandler),this.evTarget&&L(this.target,this.evTarget,this.domHandler),this.evWin&&L($t(this.element),this.evWin,this.domHandler)}};function S2(g){var S,P=g.options.inputClass;return P?S=P:D?S=Wo:X?S=ai:R?S=Jo:S=oi,new S(g,C2)}function C2(g,S,P){var M=P.pointers.length,I=P.changedPointers.length,z=S&mt&&M-I===0,V=S&(it|St)&&M-I===0;P.isFirst=!!z,P.isFinal=!!V,z&&(g.session={}),P.eventType=S,T2(g,P),g.emit("hammer.input",P),g.recognize(P),g.session.prevInput=P}function T2(g,S){var P=g.session,M=S.pointers,I=M.length;P.firstInput||(P.firstInput=rl(S)),I>1&&!P.firstMultiple?P.firstMultiple=rl(S):I===1&&(P.firstMultiple=!1);var z=P.firstInput,V=P.firstMultiple,pt=V?V.center:z.center,yt=S.center=ol(M);S.timeStamp=u(),S.deltaTime=S.timeStamp-z.timeStamp,S.angle=Ho(pt,yt),S.distance=ri(pt,yt),E2(P,S),S.offsetDirection=hl(S.deltaX,S.deltaY);var kt=al(S.deltaTime,S.deltaX,S.deltaY);S.overallVelocityX=kt.x,S.overallVelocityY=kt.y,S.overallVelocity=c(kt.x)>c(kt.y)?kt.x:kt.y,S.scale=V?A2(V.pointers,M):1,S.rotation=V?M2(V.pointers,M):0,S.maxPointers=P.prevInput?S.pointers.length>P.prevInput.maxPointers?S.pointers.length:P.prevInput.maxPointers:S.pointers.length,P2(P,S);var ae=g.element;B(S.srcEvent.target,ae)&&(ae=S.srcEvent.target),S.target=ae}function E2(g,S){var P=S.center,M=g.offsetDelta||{},I=g.prevDelta||{},z=g.prevInput||{};(S.eventType===mt||z.eventType===it)&&(I=g.prevDelta={x:z.deltaX||0,y:z.deltaY||0},M=g.offsetDelta={x:P.x,y:P.y}),S.deltaX=I.x+(P.x-M.x),S.deltaY=I.y+(P.y-M.y)}function P2(g,S){var P=g.lastInterval||S,M=S.timeStamp-P.timeStamp,I,z,V,pt;if(S.eventType!=St&&(M>si||P.velocity===i)){var yt=S.deltaX-P.deltaX,kt=S.deltaY-P.deltaY,ae=al(M,yt,kt);z=ae.x,V=ae.y,I=c(ae.x)>c(ae.y)?ae.x:ae.y,pt=hl(yt,kt),g.lastInterval=S}else I=P.velocity,z=P.velocityX,V=P.velocityY,pt=P.direction;S.velocity=I,S.velocityX=z,S.velocityY=V,S.direction=pt}function rl(g){for(var S=[],P=0;P<g.pointers.length;)S[P]={clientX:h(g.pointers[P].clientX),clientY:h(g.pointers[P].clientY)},P++;return{timeStamp:u(),pointers:S,center:ol(S),deltaX:g.deltaX,deltaY:g.deltaY}}function ol(g){var S=g.length;if(S===1)return{x:h(g[0].clientX),y:h(g[0].clientY)};for(var P=0,M=0,I=0;I<S;)P+=g[I].clientX,M+=g[I].clientY,I++;return{x:h(P/S),y:h(M/S)}}function al(g,S,P){return{x:S/g||0,y:P/g||0}}function hl(g,S){return g===S?xn:c(g)>=c(S)?g<0?Ke:tn:S<0?Le:k}function ri(g,S,P){P||(P=il);var M=S[P[0]]-g[P[0]],I=S[P[1]]-g[P[1]];return Math.sqrt(M*M+I*I)}function Ho(g,S,P){P||(P=il);var M=S[P[0]]-g[P[0]],I=S[P[1]]-g[P[1]];return Math.atan2(I,M)*180/Math.PI}function M2(g,S){return Ho(S[1],S[0],ii)+Ho(g[1],g[0],ii)}function A2(g,S){return ri(S[0],S[1],ii)/ri(g[0],g[1],ii)}var k2={mousedown:mt,mousemove:re,mouseup:it},I2="mousedown",D2="mousemove mouseup";function oi(){this.evEl=I2,this.evWin=D2,this.pressed=!1,Vt.apply(this,arguments)}_(oi,Vt,{handler:function(S){var P=k2[S.type];P&mt&&S.button===0&&(this.pressed=!0),P&re&&S.which!==1&&(P=it),this.pressed&&(P&it&&(this.pressed=!1),this.callback(this.manager,P,{pointers:[S],changedPointers:[S],pointerType:ee,srcEvent:S}))}});var L2={pointerdown:mt,pointermove:re,pointerup:it,pointercancel:St,pointerout:St},R2={2:H,3:At,4:ee,5:ni},cl="pointerdown",ul="pointermove pointerup pointercancel";t.MSPointerEvent&&!t.PointerEvent&&(cl="MSPointerDown",ul="MSPointerMove MSPointerUp MSPointerCancel");function Wo(){this.evEl=cl,this.evWin=ul,Vt.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}_(Wo,Vt,{handler:function(S){var P=this.store,M=!1,I=S.type.toLowerCase().replace("ms",""),z=L2[I],V=R2[S.pointerType]||S.pointerType,pt=V==H,yt=G(P,S.pointerId,"pointerId");z&mt&&(S.button===0||pt)?yt<0&&(P.push(S),yt=P.length-1):z&(it|St)&&(M=!0),!(yt<0)&&(P[yt]=S,this.callback(this.manager,z,{pointers:P,changedPointers:[S],pointerType:V,srcEvent:S}),M&&P.splice(yt,1))}});var O2={touchstart:mt,touchmove:re,touchend:it,touchcancel:St},z2="touchstart",N2="touchstart touchmove touchend touchcancel";function ll(){this.evTarget=z2,this.evWin=N2,this.started=!1,Vt.apply(this,arguments)}_(ll,Vt,{handler:function(S){var P=O2[S.type];if(P===mt&&(this.started=!0),!!this.started){var M=B2.call(this,S,P);P&(it|St)&&M[0].length-M[1].length===0&&(this.started=!1),this.callback(this.manager,P,{pointers:M[0],changedPointers:M[1],pointerType:H,srcEvent:S})}}});function B2(g,S){var P=J(g.touches),M=J(g.changedTouches);return S&(it|St)&&(P=st(P.concat(M),"identifier",!0)),[P,M]}var F2={touchstart:mt,touchmove:re,touchend:it,touchcancel:St},Y2="touchstart touchmove touchend touchcancel";function ai(){this.evTarget=Y2,this.targetIds={},Vt.apply(this,arguments)}_(ai,Vt,{handler:function(S){var P=F2[S.type],M=X2.call(this,S,P);M&&this.callback(this.manager,P,{pointers:M[0],changedPointers:M[1],pointerType:H,srcEvent:S})}});function X2(g,S){var P=J(g.touches),M=this.targetIds;if(S&(mt|re)&&P.length===1)return M[P[0].identifier]=!0,[P,P];var I,z,V=J(g.changedTouches),pt=[],yt=this.target;if(z=P.filter(function(kt){return B(kt.target,yt)}),S===mt)for(I=0;I<z.length;)M[z[I].identifier]=!0,I++;for(I=0;I<V.length;)M[V[I].identifier]&&pt.push(V[I]),S&(it|St)&&delete M[V[I].identifier],I++;if(pt.length)return[st(z.concat(pt),"identifier",!0),pt]}var U2=2500,fl=25;function Jo(){Vt.apply(this,arguments);var g=x(this.handler,this);this.touch=new ai(this.manager,g),this.mouse=new oi(this.manager,g),this.primaryTouch=null,this.lastTouches=[]}_(Jo,Vt,{handler:function(S,P,M){var I=M.pointerType==H,z=M.pointerType==ee;if(!(z&&M.sourceCapabilities&&M.sourceCapabilities.firesTouchEvents)){if(I)$2.call(this,P,M);else if(z&&V2.call(this,M))return;this.callback(S,P,M)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});function $2(g,S){g&mt?(this.primaryTouch=S.changedPointers[0].identifier,dl.call(this,S)):g&(it|St)&&dl.call(this,S)}function dl(g){var S=g.changedPointers[0];if(S.identifier===this.primaryTouch){var P={x:S.clientX,y:S.clientY};this.lastTouches.push(P);var M=this.lastTouches,I=function(){var z=M.indexOf(P);z>-1&&M.splice(z,1)};setTimeout(I,U2)}}function V2(g){for(var S=g.srcEvent.clientX,P=g.srcEvent.clientY,M=0;M<this.lastTouches.length;M++){var I=this.lastTouches[M],z=Math.abs(S-I.x),V=Math.abs(P-I.y);if(z<=fl&&V<=fl)return!0}return!1}var ml=K(o.style,"touchAction"),pl=ml!==i,gl="compute",yl="auto",Zo="manipulation",nn="none",es="pan-x",ns="pan-y",hi=q2();function Qo(g,S){this.manager=g,this.set(S)}Qo.prototype={set:function(g){g==gl&&(g=this.compute()),pl&&this.manager.element.style&&hi[g]&&(this.manager.element.style[ml]=g),this.actions=g.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var g=[];return f(this.manager.recognizers,function(S){b(S.options.enable,[S])&&(g=g.concat(S.getTouchAction()))}),G2(g.join(" "))},preventDefaults:function(g){var S=g.srcEvent,P=g.offsetDirection;if(this.manager.session.prevented){S.preventDefault();return}var M=this.actions,I=F(M,nn)&&!hi[nn],z=F(M,ns)&&!hi[ns],V=F(M,es)&&!hi[es];if(I){var pt=g.pointers.length===1,yt=g.distance<2,kt=g.deltaTime<250;if(pt&&yt&&kt)return}if(!(V&&z)&&(I||z&&P&at||V&&P&en))return this.preventSrc(S)},preventSrc:function(g){this.manager.session.prevented=!0,g.preventDefault()}};function G2(g){if(F(g,nn))return nn;var S=F(g,es),P=F(g,ns);return S&&P?nn:S||P?S?es:ns:F(g,Zo)?Zo:yl}function q2(){if(!pl)return!1;var g={},S=t.CSS&&t.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(P){g[P]=S?t.CSS.supports("touch-action",P):!0}),g}var ci=1,Gt=2,bn=4,Re=8,ye=Re,ss=16,oe=32;function we(g){this.options=y({},this.defaults,g||{}),this.id=Yt(),this.manager=null,this.options.enable=E(this.options.enable,!0),this.state=ci,this.simultaneous={},this.requireFail=[]}we.prototype={defaults:{},set:function(g){return y(this.options,g),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(g){if(m(g,"recognizeWith",this))return this;var S=this.simultaneous;return g=ui(g,this),S[g.id]||(S[g.id]=g,g.recognizeWith(this)),this},dropRecognizeWith:function(g){return m(g,"dropRecognizeWith",this)?this:(g=ui(g,this),delete this.simultaneous[g.id],this)},requireFailure:function(g){if(m(g,"requireFailure",this))return this;var S=this.requireFail;return g=ui(g,this),G(S,g)===-1&&(S.push(g),g.requireFailure(this)),this},dropRequireFailure:function(g){if(m(g,"dropRequireFailure",this))return this;g=ui(g,this);var S=G(this.requireFail,g);return S>-1&&this.requireFail.splice(S,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(g){return!!this.simultaneous[g.id]},emit:function(g){var S=this,P=this.state;function M(I){S.manager.emit(I,g)}P<Re&&M(S.options.event+wl(P)),M(S.options.event),g.additionalEvent&&M(g.additionalEvent),P>=Re&&M(S.options.event+wl(P))},tryEmit:function(g){if(this.canEmit())return this.emit(g);this.state=oe},canEmit:function(){for(var g=0;g<this.requireFail.length;){if(!(this.requireFail[g].state&(oe|ci)))return!1;g++}return!0},recognize:function(g){var S=y({},g);if(!b(this.options.enable,[this,S])){this.reset(),this.state=oe;return}this.state&(ye|ss|oe)&&(this.state=ci),this.state=this.process(S),this.state&(Gt|bn|Re|ss)&&this.tryEmit(S)},process:function(g){},getTouchAction:function(){},reset:function(){}};function wl(g){return g&ss?"cancel":g&Re?"end":g&bn?"move":g&Gt?"start":""}function xl(g){return g==k?"down":g==Le?"up":g==Ke?"left":g==tn?"right":""}function ui(g,S){var P=S.manager;return P?P.get(g):g}function ne(){we.apply(this,arguments)}_(ne,we,{defaults:{pointers:1},attrTest:function(g){var S=this.options.pointers;return S===0||g.pointers.length===S},process:function(g){var S=this.state,P=g.eventType,M=S&(Gt|bn),I=this.attrTest(g);return M&&(P&St||!I)?S|ss:M||I?P&it?S|Re:S&Gt?S|bn:Gt:oe}});function li(){ne.apply(this,arguments),this.pX=null,this.pY=null}_(li,ne,{defaults:{event:"pan",threshold:10,pointers:1,direction:sl},getTouchAction:function(){var g=this.options.direction,S=[];return g&at&&S.push(ns),g&en&&S.push(es),S},directionTest:function(g){var S=this.options,P=!0,M=g.distance,I=g.direction,z=g.deltaX,V=g.deltaY;return I&S.direction||(S.direction&at?(I=z===0?xn:z<0?Ke:tn,P=z!=this.pX,M=Math.abs(g.deltaX)):(I=V===0?xn:V<0?Le:k,P=V!=this.pY,M=Math.abs(g.deltaY))),g.direction=I,P&&M>S.threshold&&I&S.direction},attrTest:function(g){return ne.prototype.attrTest.call(this,g)&&(this.state&Gt||!(this.state&Gt)&&this.directionTest(g))},emit:function(g){this.pX=g.deltaX,this.pY=g.deltaY;var S=xl(g.direction);S&&(g.additionalEvent=this.options.event+S),this._super.emit.call(this,g)}});function Ko(){ne.apply(this,arguments)}_(Ko,ne,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[nn]},attrTest:function(g){return this._super.attrTest.call(this,g)&&(Math.abs(g.scale-1)>this.options.threshold||this.state&Gt)},emit:function(g){if(g.scale!==1){var S=g.scale<1?"in":"out";g.additionalEvent=this.options.event+S}this._super.emit.call(this,g)}});function ta(){we.apply(this,arguments),this._timer=null,this._input=null}_(ta,we,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[yl]},process:function(g){var S=this.options,P=g.pointers.length===S.pointers,M=g.distance<S.threshold,I=g.deltaTime>S.time;if(this._input=g,!M||!P||g.eventType&(it|St)&&!I)this.reset();else if(g.eventType&mt)this.reset(),this._timer=l(function(){this.state=ye,this.tryEmit()},S.time,this);else if(g.eventType&it)return ye;return oe},reset:function(){clearTimeout(this._timer)},emit:function(g){this.state===ye&&(g&&g.eventType&it?this.manager.emit(this.options.event+"up",g):(this._input.timeStamp=u(),this.manager.emit(this.options.event,this._input)))}});function ea(){ne.apply(this,arguments)}_(ea,ne,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[nn]},attrTest:function(g){return this._super.attrTest.call(this,g)&&(Math.abs(g.rotation)>this.options.threshold||this.state&Gt)}});function na(){ne.apply(this,arguments)}_(na,ne,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:at|en,pointers:1},getTouchAction:function(){return li.prototype.getTouchAction.call(this)},attrTest:function(g){var S=this.options.direction,P;return S&(at|en)?P=g.overallVelocity:S&at?P=g.overallVelocityX:S&en&&(P=g.overallVelocityY),this._super.attrTest.call(this,g)&&S&g.offsetDirection&&g.distance>this.options.threshold&&g.maxPointers==this.options.pointers&&c(P)>this.options.velocity&&g.eventType&it},emit:function(g){var S=xl(g.offsetDirection);S&&this.manager.emit(this.options.event+S,g),this.manager.emit(this.options.event,g)}});function fi(){we.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}_(fi,we,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[Zo]},process:function(g){var S=this.options,P=g.pointers.length===S.pointers,M=g.distance<S.threshold,I=g.deltaTime<S.time;if(this.reset(),g.eventType&mt&&this.count===0)return this.failTimeout();if(M&&I&&P){if(g.eventType!=it)return this.failTimeout();var z=this.pTime?g.timeStamp-this.pTime<S.interval:!0,V=!this.pCenter||ri(this.pCenter,g.center)<S.posThreshold;this.pTime=g.timeStamp,this.pCenter=g.center,!V||!z?this.count=1:this.count+=1,this._input=g;var pt=this.count%S.taps;if(pt===0)return this.hasRequireFailures()?(this._timer=l(function(){this.state=ye,this.tryEmit()},S.interval,this),Gt):ye}return oe},failTimeout:function(){return this._timer=l(function(){this.state=oe},this.options.interval,this),oe},reset:function(){clearTimeout(this._timer)},emit:function(){this.state==ye&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}});function xe(g,S){return S=S||{},S.recognizers=E(S.recognizers,xe.defaults.preset),new sa(g,S)}xe.VERSION="2.0.7",xe.defaults={domEvents:!1,touchAction:gl,enable:!0,inputTarget:null,inputClass:null,preset:[[ea,{enable:!1}],[Ko,{enable:!1},["rotate"]],[na,{direction:at}],[li,{direction:at},["swipe"]],[fi],[fi,{event:"doubletap",taps:2},["tap"]],[ta]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};var j2=1,bl=2;function sa(g,S){this.options=y({},xe.defaults,S||{}),this.options.inputTarget=this.options.inputTarget||g,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=g,this.input=S2(this),this.touchAction=new Qo(this,this.options.touchAction),vl(this,!0),f(this.options.recognizers,function(P){var M=this.add(new P[0](P[1]));P[2]&&M.recognizeWith(P[2]),P[3]&&M.requireFailure(P[3])},this)}sa.prototype={set:function(g){return y(this.options,g),g.touchAction&&this.touchAction.update(),g.inputTarget&&(this.input.destroy(),this.input.target=g.inputTarget,this.input.init()),this},stop:function(g){this.session.stopped=g?bl:j2},recognize:function(g){var S=this.session;if(!S.stopped){this.touchAction.preventDefaults(g);var P,M=this.recognizers,I=S.curRecognizer;(!I||I&&I.state&ye)&&(I=S.curRecognizer=null);for(var z=0;z<M.length;)P=M[z],S.stopped!==bl&&(!I||P==I||P.canRecognizeWith(I))?P.recognize(g):P.reset(),!I&&P.state&(Gt|bn|Re)&&(I=S.curRecognizer=P),z++}},get:function(g){if(g instanceof we)return g;for(var S=this.recognizers,P=0;P<S.length;P++)if(S[P].options.event==g)return S[P];return null},add:function(g){if(m(g,"add",this))return this;var S=this.get(g.options.event);return S&&this.remove(S),this.recognizers.push(g),g.manager=this,this.touchAction.update(),g},remove:function(g){if(m(g,"remove",this))return this;if(g=this.get(g),g){var S=this.recognizers,P=G(S,g);P!==-1&&(S.splice(P,1),this.touchAction.update())}return this},on:function(g,S){if(g!==i&&S!==i){var P=this.handlers;return f($(g),function(M){P[M]=P[M]||[],P[M].push(S)}),this}},off:function(g,S){if(g!==i){var P=this.handlers;return f($(g),function(M){S?P[M]&&P[M].splice(G(P[M],S),1):delete P[M]}),this}},emit:function(g,S){this.options.domEvents&&H2(g,S);var P=this.handlers[g]&&this.handlers[g].slice();if(!(!P||!P.length)){S.type=g,S.preventDefault=function(){S.srcEvent.preventDefault()};for(var M=0;M<P.length;)P[M](S),M++}},destroy:function(){this.element&&vl(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}};function vl(g,S){var P=g.element;if(P.style){var M;f(g.options.cssProps,function(I,z){M=K(P.style,z),S?(g.oldCssProps[M]=P.style[M],P.style[M]=I):P.style[M]=g.oldCssProps[M]||""}),S||(g.oldCssProps={})}}function H2(g,S){var P=e.createEvent("Event");P.initEvent(g,!0,!0),P.gesture=S,S.target.dispatchEvent(P)}y(xe,{INPUT_START:mt,INPUT_MOVE:re,INPUT_END:it,INPUT_CANCEL:St,STATE_POSSIBLE:ci,STATE_BEGAN:Gt,STATE_CHANGED:bn,STATE_ENDED:Re,STATE_RECOGNIZED:ye,STATE_CANCELLED:ss,STATE_FAILED:oe,DIRECTION_NONE:xn,DIRECTION_LEFT:Ke,DIRECTION_RIGHT:tn,DIRECTION_UP:Le,DIRECTION_DOWN:k,DIRECTION_HORIZONTAL:at,DIRECTION_VERTICAL:en,DIRECTION_ALL:sl,Manager:sa,Input:Vt,TouchAction:Qo,TouchInput:ai,MouseInput:oi,PointerEventInput:Wo,TouchMouseInput:Jo,SingleTouchInput:ll,Recognizer:we,AttrRecognizer:ne,Tap:fi,Pan:li,Swipe:na,Pinch:Ko,Rotate:ea,Press:ta,on:C,off:L,each:f,merge:w,extend:v,assign:y,inherit:_,bindFn:x,prefixed:K});var W2=typeof t<"u"?t:typeof self<"u"?self:{};W2.Hammer=xe,typeof i=="function"&&i.amd?i(function(){return xe}):s.exports?s.exports=xe:t[n]=xe})(window,document,"Hammer")})(wh);var mm=wh.exports;const tt=Da(mm);var tr=function(s,t){return tr=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])},tr(s,t)};function ue(s,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");tr(s,t);function e(){this.constructor=s}s.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}function pm(s,t,e,n){function i(r){return r instanceof e?r:new e(function(o){o(r)})}return new(e||(e=Promise))(function(r,o){function a(u){try{c(n.next(u))}catch(l){o(l)}}function h(u){try{c(n.throw(u))}catch(l){o(l)}}function c(u){u.done?r(u.value):i(u.value).then(a,h)}c((n=n.apply(s,t||[])).next())})}function xh(s,t){var e={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},n,i,r,o=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return o.next=a(0),o.throw=a(1),o.return=a(2),typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(c){return function(u){return h([c,u])}}function h(c){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,c[0]&&(e=0)),e;)try{if(n=1,i&&(r=c[0]&2?i.return:c[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,c[1])).done)return r;switch(i=0,r&&(c=[c[0]&2,r.value]),c[0]){case 0:case 1:r=c;break;case 4:return e.label++,{value:c[1],done:!1};case 5:e.label++,i=c[1],c=[0];continue;case 7:c=e.ops.pop(),e.trys.pop();continue;default:if(r=e.trys,!(r=r.length>0&&r[r.length-1])&&(c[0]===6||c[0]===2)){e=0;continue}if(c[0]===3&&(!r||c[1]>r[0]&&c[1]<r[3])){e.label=c[1];break}if(c[0]===6&&e.label<r[1]){e.label=r[1],r=c;break}if(r&&e.label<r[2]){e.label=r[2],e.ops.push(c);break}r[2]&&e.ops.pop(),e.trys.pop();continue}c=t.call(s,e)}catch(u){c=[6,u],i=0}finally{n=r=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}function Be(s){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&s[t],n=0;if(e)return e.call(s);if(s&&typeof s.length=="number")return{next:function(){return s&&n>=s.length&&(s=void 0),{value:s&&s[n++],done:!s}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function ve(s,t){var e=typeof Symbol=="function"&&s[Symbol.iterator];if(!e)return s;var n=e.call(s),i,r=[],o;try{for(;(t===void 0||t-- >0)&&!(i=n.next()).done;)r.push(i.value)}catch(a){o={error:a}}finally{try{i&&!i.done&&(e=n.return)&&e.call(n)}finally{if(o)throw o.error}}return r}function Fe(s,t,e){if(e||arguments.length===2)for(var n=0,i=t.length,r;n<i;n++)(r||!(n in t))&&(r||(r=Array.prototype.slice.call(t,0,n)),r[n]=t[n]);return s.concat(r||Array.prototype.slice.call(t))}function cn(s){return this instanceof cn?(this.v=s,this):new cn(s)}function gm(s,t,e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=e.apply(s,t||[]),i,r=[];return i=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),a("next"),a("throw"),a("return",o),i[Symbol.asyncIterator]=function(){return this},i;function o(f){return function(p){return Promise.resolve(p).then(f,l)}}function a(f,p){n[f]&&(i[f]=function(y){return new Promise(function(v,w){r.push([f,y,v,w])>1||h(f,y)})},p&&(i[f]=p(i[f])))}function h(f,p){try{c(n[f](p))}catch(y){m(r[0][3],y)}}function c(f){f.value instanceof cn?Promise.resolve(f.value.v).then(u,l):m(r[0][2],f)}function u(f){h("next",f)}function l(f){h("throw",f)}function m(f,p){f(p),r.shift(),r.length&&h(r[0][0],r[0][1])}}function ym(s){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=s[Symbol.asyncIterator],e;return t?t.call(s):(s=typeof Be=="function"?Be(s):s[Symbol.iterator](),e={},n("next"),n("throw"),n("return"),e[Symbol.asyncIterator]=function(){return this},e);function n(r){e[r]=s[r]&&function(o){return new Promise(function(a,h){o=s[r](o),i(a,h,o.done,o.value)})}}function i(r,o,a,h){Promise.resolve(h).then(function(c){r({value:c,done:a})},o)}}typeof SuppressedError=="function"&&SuppressedError;function j(s){return typeof s=="function"}function er(s){var t=function(n){Error.call(n),n.stack=new Error().stack},e=s(t);return e.prototype=Object.create(Error.prototype),e.prototype.constructor=e,e}var nr=er(function(s){return function(e){s(this),this.message=e?e.length+` errors occurred during unsubscription:
|
|
24
24
|
`+e.map(function(n,i){return i+1+") "+n.toString()}).join(`
|
|
25
|
-
`):"",this.name="UnsubscriptionError",this.errors=e}});function En(s,t){if(s){var e=s.indexOf(t);0<=e&&s.splice(e,1)}}var an=function(){function s(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}return s.prototype.unsubscribe=function(){var t,e,n,i,r;if(!this.closed){this.closed=!0;var o=this._parentage;if(o)if(this._parentage=null,Array.isArray(o))try{for(var a=Fe(o),c=a.next();!c.done;c=a.next()){var h=c.value;h.remove(this)}}catch(w){t={error:w}}finally{try{c&&!c.done&&(e=a.return)&&e.call(a)}finally{if(t)throw t.error}}else o.remove(this);var u=this.initialTeardown;if(q(u))try{u()}catch(w){r=w instanceof er?w.errors:[w]}var l=this._finalizers;if(l){this._finalizers=null;try{for(var d=Fe(l),f=d.next();!f.done;f=d.next()){var p=f.value;try{bc(p)}catch(w){r=r??[],w instanceof er?r=Be(Be([],ve(r)),ve(w.errors)):r.push(w)}}}catch(w){n={error:w}}finally{try{f&&!f.done&&(i=d.return)&&i.call(d)}finally{if(n)throw n.error}}}if(r)throw new er(r)}},s.prototype.add=function(t){var e;if(t&&t!==this)if(this.closed)bc(t);else{if(t instanceof s){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=(e=this._finalizers)!==null&&e!==void 0?e:[]).push(t)}},s.prototype._hasParent=function(t){var e=this._parentage;return e===t||Array.isArray(e)&&e.includes(t)},s.prototype._addParent=function(t){var e=this._parentage;this._parentage=Array.isArray(e)?(e.push(t),e):e?[e,t]:t},s.prototype._removeParent=function(t){var e=this._parentage;e===t?this._parentage=null:Array.isArray(e)&&En(e,t)},s.prototype.remove=function(t){var e=this._finalizers;e&&En(e,t),t instanceof s&&t._removeParent(this)},s.EMPTY=function(){var t=new s;return t.closed=!0,t}(),s}(),wc=an.EMPTY;function xc(s){return s instanceof an||s&&"closed"in s&&q(s.remove)&&q(s.add)&&q(s.unsubscribe)}function bc(s){q(s)?s():s.unsubscribe()}var vc={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},nr={setTimeout:function(s,t){for(var e=[],n=2;n<arguments.length;n++)e[n-2]=arguments[n];var i=nr.delegate;return i?.setTimeout?i.setTimeout.apply(i,Be([s,t],ve(e))):setTimeout.apply(void 0,Be([s,t],ve(e)))},clearTimeout:function(s){var t=nr.delegate;return(t?.clearTimeout||clearTimeout)(s)},delegate:void 0};function _c(s){nr.setTimeout(function(){throw s})}function Pn(){}function Es(s){s()}var sr=function(s){be(t,s);function t(e){var n=s.call(this)||this;return n.isStopped=!1,e?(n.destination=e,xc(e)&&e.add(n)):n.destination=Cm,n}return t.create=function(e,n,i){return new Ps(e,n,i)},t.prototype.next=function(e){this.isStopped||this._next(e)},t.prototype.error=function(e){this.isStopped||(this.isStopped=!0,this._error(e))},t.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,s.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(e){this.destination.next(e)},t.prototype._error=function(e){try{this.destination.error(e)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t}(an),vm=Function.prototype.bind;function ir(s,t){return vm.call(s,t)}var _m=function(){function s(t){this.partialObserver=t}return s.prototype.next=function(t){var e=this.partialObserver;if(e.next)try{e.next(t)}catch(n){Ms(n)}},s.prototype.error=function(t){var e=this.partialObserver;if(e.error)try{e.error(t)}catch(n){Ms(n)}else Ms(t)},s.prototype.complete=function(){var t=this.partialObserver;if(t.complete)try{t.complete()}catch(e){Ms(e)}},s}(),Ps=function(s){be(t,s);function t(e,n,i){var r=s.call(this)||this,o;if(q(e)||!e)o={next:e??void 0,error:n??void 0,complete:i??void 0};else{var a;r&&vc.useDeprecatedNextContext?(a=Object.create(e),a.unsubscribe=function(){return r.unsubscribe()},o={next:e.next&&ir(e.next,a),error:e.error&&ir(e.error,a),complete:e.complete&&ir(e.complete,a)}):o=e}return r.destination=new _m(o),r}return t}(sr);function Ms(s){_c(s)}function Sm(s){throw s}var Cm={closed:!0,next:Pn,error:Sm,complete:Pn},rr=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function Ne(s){return s}function Tm(s){return s.length===0?Ne:s.length===1?s[0]:function(e){return s.reduce(function(n,i){return i(n)},e)}}var nt=function(){function s(t){t&&(this._subscribe=t)}return s.prototype.lift=function(t){var e=new s;return e.source=this,e.operator=t,e},s.prototype.subscribe=function(t,e,n){var i=this,r=Pm(t)?t:new Ps(t,e,n);return Es(function(){var o=i,a=o.operator,c=o.source;r.add(a?a.call(r,c):c?i._subscribe(r):i._trySubscribe(r))}),r},s.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(e){t.error(e)}},s.prototype.forEach=function(t,e){var n=this;return e=Sc(e),new e(function(i,r){var o=new Ps({next:function(a){try{t(a)}catch(c){r(c),o.unsubscribe()}},error:r,complete:i});n.subscribe(o)})},s.prototype._subscribe=function(t){var e;return(e=this.source)===null||e===void 0?void 0:e.subscribe(t)},s.prototype[rr]=function(){return this},s.prototype.pipe=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Tm(t)(this)},s.prototype.toPromise=function(t){var e=this;return t=Sc(t),new t(function(n,i){var r;e.subscribe(function(o){return r=o},function(o){return i(o)},function(){return n(r)})})},s.create=function(t){return new s(t)},s}();function Sc(s){var t;return(t=s??vc.Promise)!==null&&t!==void 0?t:Promise}function Em(s){return s&&q(s.next)&&q(s.error)&&q(s.complete)}function Pm(s){return s&&s instanceof sr||Em(s)&&xc(s)}function Mm(s){return q(s?.lift)}function Ft(s){return function(t){if(Mm(t))return t.lift(function(e){try{return s(e,this)}catch(n){this.error(n)}});throw new TypeError("Unable to lift unknown Observable type")}}function ut(s,t,e,n,i){return new Am(s,t,e,n,i)}var Am=function(s){be(t,s);function t(e,n,i,r,o,a){var c=s.call(this,e)||this;return c.onFinalize=o,c.shouldUnsubscribe=a,c._next=n?function(h){try{n(h)}catch(u){e.error(u)}}:s.prototype._next,c._error=r?function(h){try{r(h)}catch(u){e.error(u)}finally{this.unsubscribe()}}:s.prototype._error,c._complete=i?function(){try{i()}catch(h){e.error(h)}finally{this.unsubscribe()}}:s.prototype._complete,c}return t.prototype.unsubscribe=function(){var e;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var n=this.closed;s.prototype.unsubscribe.call(this),!n&&((e=this.onFinalize)===null||e===void 0||e.call(this))}},t}(sr),km=tr(function(s){return function(){s(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),Mn=function(s){be(t,s);function t(){var e=s.call(this)||this;return e.closed=!1,e.currentObservers=null,e.observers=[],e.isStopped=!1,e.hasError=!1,e.thrownError=null,e}return t.prototype.lift=function(e){var n=new Cc(this,this);return n.operator=e,n},t.prototype._throwIfClosed=function(){if(this.closed)throw new km},t.prototype.next=function(e){var n=this;Es(function(){var i,r;if(n._throwIfClosed(),!n.isStopped){n.currentObservers||(n.currentObservers=Array.from(n.observers));try{for(var o=Fe(n.currentObservers),a=o.next();!a.done;a=o.next()){var c=a.value;c.next(e)}}catch(h){i={error:h}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}}})},t.prototype.error=function(e){var n=this;Es(function(){if(n._throwIfClosed(),!n.isStopped){n.hasError=n.isStopped=!0,n.thrownError=e;for(var i=n.observers;i.length;)i.shift().error(e)}})},t.prototype.complete=function(){var e=this;Es(function(){if(e._throwIfClosed(),!e.isStopped){e.isStopped=!0;for(var n=e.observers;n.length;)n.shift().complete()}})},t.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(t.prototype,"observed",{get:function(){var e;return((e=this.observers)===null||e===void 0?void 0:e.length)>0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(e){return this._throwIfClosed(),s.prototype._trySubscribe.call(this,e)},t.prototype._subscribe=function(e){return this._throwIfClosed(),this._checkFinalizedStatuses(e),this._innerSubscribe(e)},t.prototype._innerSubscribe=function(e){var n=this,i=this,r=i.hasError,o=i.isStopped,a=i.observers;return r||o?wc:(this.currentObservers=null,a.push(e),new an(function(){n.currentObservers=null,En(a,e)}))},t.prototype._checkFinalizedStatuses=function(e){var n=this,i=n.hasError,r=n.thrownError,o=n.isStopped;i?e.error(r):o&&e.complete()},t.prototype.asObservable=function(){var e=new nt;return e.source=this,e},t.create=function(e,n){return new Cc(e,n)},t}(nt),Cc=function(s){be(t,s);function t(e,n){var i=s.call(this)||this;return i.destination=e,i.source=n,i}return t.prototype.next=function(e){var n,i;(i=(n=this.destination)===null||n===void 0?void 0:n.next)===null||i===void 0||i.call(n,e)},t.prototype.error=function(e){var n,i;(i=(n=this.destination)===null||n===void 0?void 0:n.error)===null||i===void 0||i.call(n,e)},t.prototype.complete=function(){var e,n;(n=(e=this.destination)===null||e===void 0?void 0:e.complete)===null||n===void 0||n.call(e)},t.prototype._subscribe=function(e){var n,i;return(i=(n=this.source)===null||n===void 0?void 0:n.subscribe(e))!==null&&i!==void 0?i:wc},t}(Mn),Tc={now:function(){return(Tc.delegate||Date).now()},delegate:void 0},Im=function(s){be(t,s);function t(e,n){return s.call(this)||this}return t.prototype.schedule=function(e,n){return this},t}(an),As={setInterval:function(s,t){for(var e=[],n=2;n<arguments.length;n++)e[n-2]=arguments[n];var i=As.delegate;return i?.setInterval?i.setInterval.apply(i,Be([s,t],ve(e))):setInterval.apply(void 0,Be([s,t],ve(e)))},clearInterval:function(s){var t=As.delegate;return(t?.clearInterval||clearInterval)(s)},delegate:void 0},Dm=function(s){be(t,s);function t(e,n){var i=s.call(this,e,n)||this;return i.scheduler=e,i.work=n,i.pending=!1,i}return t.prototype.schedule=function(e,n){var i;if(n===void 0&&(n=0),this.closed)return this;this.state=e;var r=this.id,o=this.scheduler;return r!=null&&(this.id=this.recycleAsyncId(o,r,n)),this.pending=!0,this.delay=n,this.id=(i=this.id)!==null&&i!==void 0?i:this.requestAsyncId(o,this.id,n),this},t.prototype.requestAsyncId=function(e,n,i){return i===void 0&&(i=0),As.setInterval(e.flush.bind(e,this),i)},t.prototype.recycleAsyncId=function(e,n,i){if(i===void 0&&(i=0),i!=null&&this.delay===i&&this.pending===!1)return n;n!=null&&As.clearInterval(n)},t.prototype.execute=function(e,n){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var i=this._execute(e,n);if(i)return i;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},t.prototype._execute=function(e,n){var i=!1,r;try{this.work(e)}catch(o){i=!0,r=o||new Error("Scheduled action threw falsy error")}if(i)return this.unsubscribe(),r},t.prototype.unsubscribe=function(){if(!this.closed){var e=this,n=e.id,i=e.scheduler,r=i.actions;this.work=this.state=this.scheduler=null,this.pending=!1,En(r,this),n!=null&&(this.id=this.recycleAsyncId(i,n,null)),this.delay=null,s.prototype.unsubscribe.call(this)}},t}(Im),Ec=function(){function s(t,e){e===void 0&&(e=s.now),this.schedulerActionCtor=t,this.now=e}return s.prototype.schedule=function(t,e,n){return e===void 0&&(e=0),new this.schedulerActionCtor(this,t).schedule(n,e)},s.now=Tc.now,s}(),Rm=function(s){be(t,s);function t(e,n){n===void 0&&(n=Ec.now);var i=s.call(this,e,n)||this;return i.actions=[],i._active=!1,i}return t.prototype.flush=function(e){var n=this.actions;if(this._active){n.push(e);return}var i;this._active=!0;do if(i=e.execute(e.state,e.delay))break;while(e=n.shift());if(this._active=!1,i){for(;e=n.shift();)e.unsubscribe();throw i}},t}(Ec),or=new Rm(Dm),Lm=or,Pc=new nt(function(s){return s.complete()});function Mc(s){return s&&q(s.schedule)}function ar(s){return s[s.length-1]}function Om(s){return q(ar(s))?s.pop():void 0}function An(s){return Mc(ar(s))?s.pop():void 0}function zm(s,t){return typeof ar(s)=="number"?s.pop():t}var cr=function(s){return s&&typeof s.length=="number"&&typeof s!="function"};function Ac(s){return q(s?.then)}function kc(s){return q(s[rr])}function Ic(s){return Symbol.asyncIterator&&q(s?.[Symbol.asyncIterator])}function Dc(s){return new TypeError("You provided "+(s!==null&&typeof s=="object"?"an invalid object":"'"+s+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}function Fm(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var Rc=Fm();function Lc(s){return q(s?.[Rc])}function Oc(s){return xm(this,arguments,function(){var e,n,i,r;return yc(this,function(o){switch(o.label){case 0:e=s.getReader(),o.label=1;case 1:o.trys.push([1,,9,10]),o.label=2;case 2:return[4,on(e.read())];case 3:return n=o.sent(),i=n.value,r=n.done,r?[4,on(void 0)]:[3,5];case 4:return[2,o.sent()];case 5:return[4,on(i)];case 6:return[4,o.sent()];case 7:return o.sent(),[3,2];case 8:return[3,10];case 9:return e.releaseLock(),[7];case 10:return[2]}})})}function zc(s){return q(s?.getReader)}function vt(s){if(s instanceof nt)return s;if(s!=null){if(kc(s))return Bm(s);if(cr(s))return Nm(s);if(Ac(s))return Ym(s);if(Ic(s))return Fc(s);if(Lc(s))return Um(s);if(zc(s))return Xm(s)}throw Dc(s)}function Bm(s){return new nt(function(t){var e=s[rr]();if(q(e.subscribe))return e.subscribe(t);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function Nm(s){return new nt(function(t){for(var e=0;e<s.length&&!t.closed;e++)t.next(s[e]);t.complete()})}function Ym(s){return new nt(function(t){s.then(function(e){t.closed||(t.next(e),t.complete())},function(e){return t.error(e)}).then(null,_c)})}function Um(s){return new nt(function(t){var e,n;try{for(var i=Fe(s),r=i.next();!r.done;r=i.next()){var o=r.value;if(t.next(o),t.closed)return}}catch(a){e={error:a}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}t.complete()})}function Fc(s){return new nt(function(t){$m(s,t).catch(function(e){return t.error(e)})})}function Xm(s){return Fc(Oc(s))}function $m(s,t){var e,n,i,r;return wm(this,void 0,void 0,function(){var o,a;return yc(this,function(c){switch(c.label){case 0:c.trys.push([0,5,6,11]),e=bm(s),c.label=1;case 1:return[4,e.next()];case 2:if(n=c.sent(),!!n.done)return[3,4];if(o=n.value,t.next(o),t.closed)return[2];c.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return a=c.sent(),i={error:a},[3,11];case 6:return c.trys.push([6,,9,10]),n&&!n.done&&(r=e.return)?[4,r.call(e)]:[3,8];case 7:c.sent(),c.label=8;case 8:return[3,10];case 9:if(i)throw i.error;return[7];case 10:return[7];case 11:return t.complete(),[2]}})})}function ue(s,t,e,n,i){n===void 0&&(n=0),i===void 0&&(i=!1);var r=t.schedule(function(){e(),i?s.add(this.schedule(null,n)):this.unsubscribe()},n);if(s.add(r),!i)return r}function Bc(s,t){return t===void 0&&(t=0),Ft(function(e,n){e.subscribe(ut(n,function(i){return ue(n,s,function(){return n.next(i)},t)},function(){return ue(n,s,function(){return n.complete()},t)},function(i){return ue(n,s,function(){return n.error(i)},t)}))})}function hr(s,t){return t===void 0&&(t=0),Ft(function(e,n){n.add(s.schedule(function(){return e.subscribe(n)},t))})}function Vm(s,t){return vt(s).pipe(hr(t),Bc(t))}function Gm(s,t){return vt(s).pipe(hr(t),Bc(t))}function qm(s,t){return new nt(function(e){var n=0;return t.schedule(function(){n===s.length?e.complete():(e.next(s[n++]),e.closed||this.schedule())})})}function jm(s,t){return new nt(function(e){var n;return ue(e,t,function(){n=s[Rc](),ue(e,t,function(){var i,r,o;try{i=n.next(),r=i.value,o=i.done}catch(a){e.error(a);return}o?e.complete():e.next(r)},0,!0)}),function(){return q(n?.return)&&n.return()}})}function Nc(s,t){if(!s)throw new Error("Iterable cannot be null");return new nt(function(e){ue(e,t,function(){var n=s[Symbol.asyncIterator]();ue(e,t,function(){n.next().then(function(i){i.done?e.complete():e.next(i.value)})},0,!0)})})}function Hm(s,t){return Nc(Oc(s),t)}function Wm(s,t){if(s!=null){if(kc(s))return Vm(s,t);if(cr(s))return qm(s,t);if(Ac(s))return Gm(s,t);if(Ic(s))return Nc(s,t);if(Lc(s))return jm(s,t);if(zc(s))return Hm(s,t)}throw Dc(s)}function kn(s,t){return t?Wm(s,t):vt(s)}function Jm(){for(var s=[],t=0;t<arguments.length;t++)s[t]=arguments[t];var e=An(s);return kn(s,e)}var Zm=tr(function(s){return function(){s(this),this.name="EmptyError",this.message="no elements in sequence"}});function Qm(s,t){var e=typeof t=="object";return new Promise(function(n,i){var r=new Ps({next:function(o){n(o),r.unsubscribe()},error:i,complete:function(){e?n(t.defaultValue):i(new Zm)}});s.subscribe(r)})}function Km(s){return s instanceof Date&&!isNaN(s)}function rt(s,t){return Ft(function(e,n){var i=0;e.subscribe(ut(n,function(r){n.next(s.call(t,r,i++))}))})}var tp=Array.isArray;function ep(s,t){return tp(t)?s.apply(void 0,Be([],ve(t))):s(t)}function ur(s){return rt(function(t){return ep(s,t)})}var np=Array.isArray,sp=Object.getPrototypeOf,ip=Object.prototype,rp=Object.keys;function op(s){if(s.length===1){var t=s[0];if(np(t))return{args:t,keys:null};if(cp(t)){var e=rp(t);return{args:e.map(function(n){return t[n]}),keys:e}}}return{args:s,keys:null}}function cp(s){return s&&typeof s=="object"&&sp(s)===ip}function hp(s,t){return s.reduce(function(e,n,i){return e[n]=t[i],e},{})}function up(){for(var s=[],t=0;t<arguments.length;t++)s[t]=arguments[t];var e=An(s),n=Om(s),i=op(s),r=i.args,o=i.keys;if(r.length===0)return kn([],e);var a=new nt(lp(r,e,o?function(c){return hp(o,c)}:Ne));return n?a.pipe(ur(n)):a}function lp(s,t,e){return e===void 0&&(e=Ne),function(n){Yc(t,function(){for(var i=s.length,r=new Array(i),o=i,a=i,c=function(u){Yc(t,function(){var l=kn(s[u],t),d=!1;l.subscribe(ut(n,function(f){r[u]=f,d||(d=!0,a--),a||n.next(e(r.slice()))},function(){--o||n.complete()}))},n)},h=0;h<i;h++)c(h)},n)}}function Yc(s,t,e){s?ue(e,s,t):t()}function fp(s,t,e,n,i,r,o,a){var c=[],h=0,u=0,l=!1,d=function(){l&&!c.length&&!h&&t.complete()},f=function(w){return h<n?p(w):c.push(w)},p=function(w){r&&t.next(w),h++;var b=!1;vt(e(w,u++)).subscribe(ut(t,function(x){i?.(x),r?f(x):t.next(x)},function(){b=!0},void 0,function(){if(b)try{h--;for(var x=function(){var g=c.shift();o?ue(t,o,function(){return p(g)}):p(g)};c.length&&h<n;)x();d()}catch(g){t.error(g)}}))};return s.subscribe(ut(t,f,function(){l=!0,d()})),function(){a?.()}}function lr(s,t,e){return e===void 0&&(e=1/0),q(t)?lr(function(n,i){return rt(function(r,o){return t(n,r,i,o)})(vt(s(n,i)))},e):(typeof t=="number"&&(e=t),Ft(function(n,i){return fp(n,i,s,e)}))}function Uc(s){return s===void 0&&(s=1/0),lr(Ne,s)}function dp(){return Uc(1)}function Xc(){for(var s=[],t=0;t<arguments.length;t++)s[t]=arguments[t];return dp()(kn(s,An(s)))}var mp=["addListener","removeListener"],pp=["addEventListener","removeEventListener"],gp=["on","off"];function fr(s,t,e,n){if(q(e)&&(n=e,e=void 0),n)return fr(s,t,e).pipe(ur(n));var i=ve(xp(s)?pp.map(function(a){return function(c){return s[a](t,c,e)}}):yp(s)?mp.map($c(s,t)):wp(s)?gp.map($c(s,t)):[],2),r=i[0],o=i[1];if(!r&&cr(s))return lr(function(a){return fr(a,t,e)})(vt(s));if(!r)throw new TypeError("Invalid event target");return new nt(function(a){var c=function(){for(var h=[],u=0;u<arguments.length;u++)h[u]=arguments[u];return a.next(1<h.length?h:h[0])};return r(c),function(){return o(c)}})}function $c(s,t){return function(e){return function(n){return s[e](t,n)}}}function yp(s){return q(s.addListener)&&q(s.removeListener)}function wp(s){return q(s.on)&&q(s.off)}function xp(s){return q(s.addEventListener)&&q(s.removeEventListener)}function st(s,t,e){return e?st(s,t).pipe(ur(e)):new nt(function(n){var i=function(){for(var o=[],a=0;a<arguments.length;a++)o[a]=arguments[a];return n.next(o.length===1?o[0]:o)},r=s(i);return q(t)?function(){return t(i,r)}:void 0})}function bp(s,t,e){s===void 0&&(s=0),e===void 0&&(e=Lm);var n=-1;return t!=null&&(Mc(t)?e=t:n=t),new nt(function(i){var r=Km(s)?+s-e.now():s;r<0&&(r=0);var o=0;return e.schedule(function(){i.closed||(i.next(o++),0<=n?this.schedule(void 0,n):i.complete())},r)})}function vp(){for(var s=[],t=0;t<arguments.length;t++)s[t]=arguments[t];var e=An(s),n=zm(s,1/0),i=s;return i.length?i.length===1?vt(i[0]):Uc(n)(kn(i,e)):Pc}var _p=Array.isArray;function Sp(s){return s.length===1&&_p(s[0])?s[0]:s}function Vc(s,t){return Ft(function(e,n){var i=0;e.subscribe(ut(n,function(r){return s.call(t,r,i++)&&n.next(r)}))})}function dr(){for(var s=[],t=0;t<arguments.length;t++)s[t]=arguments[t];return s=Sp(s),s.length===1?vt(s[0]):new nt(Cp(s))}function Cp(s){return function(t){for(var e=[],n=function(r){e.push(vt(s[r]).subscribe(ut(t,function(o){if(e){for(var a=0;a<e.length;a++)a!==r&&e[a].unsubscribe();e=null}t.next(o)})))},i=0;e&&!t.closed&&i<s.length;i++)n(i)}}function _e(s,t){return t===void 0&&(t=Ne),s=s??Tp,Ft(function(e,n){var i,r=!0;e.subscribe(ut(n,function(o){var a=t(o);(r||!s(i,a))&&(r=!1,i=a,n.next(o))}))})}function Tp(s,t){return s===t}function Gc(s,t){return t?function(e){return e.pipe(Gc(function(n,i){return vt(s(n,i)).pipe(rt(function(r,o){return t(n,r,i,o)}))}))}:Ft(function(e,n){var i=0,r=null,o=!1;e.subscribe(ut(n,function(a){r||(r=ut(n,void 0,function(){r=null,o&&n.complete()}),vt(s(a,i++)).subscribe(r))},function(){o=!0,!r&&n.complete()}))})}function Se(){for(var s=[],t=0;t<arguments.length;t++)s[t]=arguments[t];var e=An(s);return Ft(function(n,i){(e?Xc(s,n,e):Xc(s,n)).subscribe(i)})}function ks(s,t){return Ft(function(e,n){var i=null,r=0,o=!1,a=function(){return o&&!i&&n.complete()};e.subscribe(ut(n,function(c){i?.unsubscribe();var h=0,u=r++;vt(s(c,u)).subscribe(i=ut(n,function(l){return n.next(t?t(c,l,u,h++):l)},function(){i=null,a()}))},function(){o=!0,a()}))})}function Ep(){return ks(Ne)}function mr(s){return Ft(function(t,e){vt(s).subscribe(ut(e,function(){return e.complete()},Pn)),!e.closed&&t.subscribe(e)})}function Ye(s,t,e){var n=q(s)||t||e?{next:s,error:t,complete:e}:s;return n?Ft(function(i,r){var o;(o=n.subscribe)===null||o===void 0||o.call(n);var a=!0;i.subscribe(ut(r,function(c){var h;(h=n.next)===null||h===void 0||h.call(n,c),r.next(c)},function(){var c;a=!1,(c=n.complete)===null||c===void 0||c.call(n),r.complete()},function(c){var h;a=!1,(h=n.error)===null||h===void 0||h.call(n,c),r.error(c)},function(){var c,h;a&&((c=n.unsubscribe)===null||c===void 0||c.call(n)),(h=n.finalize)===null||h===void 0||h.call(n)}))}):Ne}function Pp(s,t){return Ft(function(e,n){var i=t??{},r=i.leading,o=r===void 0?!0:r,a=i.trailing,c=a===void 0?!1:a,h=!1,u=null,l=null,d=!1,f=function(){l?.unsubscribe(),l=null,c&&(b(),d&&n.complete())},p=function(){l=null,d&&n.complete()},w=function(x){return l=vt(s(x)).subscribe(ut(n,f,p))},b=function(){if(h){h=!1;var x=u;u=null,n.next(x),!d&&w(x)}};e.subscribe(ut(n,function(x){h=!0,u=x,!(l&&!l.closed)&&(o?b():w(x))},function(){d=!0,!(c&&h&&l&&!l.closed)&&n.complete()}))})}function Mp(s,t,e){t===void 0&&(t=or);var n=bp(s,t);return Pp(function(){return n},e)}function Ap(s,t){return Ft(function(e,n){var i=[],r=function(o){for(;0<i.length;)i.shift().error(o);n.error(o)};vt(s).subscribe(ut(n,function(o){var a=new Mn;i.push(a);var c=new an,h=function(){En(i,a),a.complete(),c.unsubscribe()},u;try{u=vt(t(o))}catch(l){r(l);return}n.next(a.asObservable()),c.add(u.subscribe(ut(n,h,Pn,r)))},Pn)),e.subscribe(ut(n,function(o){var a,c,h=i.slice();try{for(var u=Fe(h),l=u.next();!l.done;l=u.next()){var d=l.value;d.next(o)}}catch(f){a={error:f}}finally{try{l&&!l.done&&(c=u.return)&&c.call(u)}finally{if(a)throw a.error}}},function(){for(;0<i.length;)i.shift().complete();n.complete()},r,function(){for(;0<i.length;)i.shift().unsubscribe()}))})}function j(s,t,e,n=!1){const i=async r=>{await e(r)};try{s.addEventListener(t,i,n)}catch{s.attachEvent("on"+t,i)}return()=>{try{s.removeEventListener(t,i,n)}catch{s.detachEvent("on"+t,i)}}}function X(s,t,e=!1){return fr(s,t,{capture:e})}function Ce(s){if(s.preventDefault){s.preventDefault();return}try{s.returnValue=!1}catch{}}function qc(s){if(s.stopPropagation){s.stopPropagation();return}try{s.cancelBubble=!0}catch{}}const kp=["click","dblclick","wheel","contextmenu","mousedown","mouseup","mousemove","mouseover","mouseout","mouseenter","mouseleave"],Ip=["keydown","keyup","keypress"],Dp=["touchstart","touchend","touchcancel","touchmove"],Rp=["pointerdown","pointerup","pointercancel","pointermove"],Lp=["dragstart","drag","dragend","dragenter","dragover","dragleave","drop"],Op=["change"];function zp(s,t,e={bubbles:!0,detail:{}}){if(!s)return;let n;try{kp.includes(t)?n=new MouseEvent(t,e):Ip.includes(t)?n=new KeyboardEvent(t,e):Dp.includes(t)?n=new TouchEvent(t,e):Rp.includes(t)?n=new PointerEvent(t,e):Lp.includes(t)?n=new DragEvent(t,e):Op.includes(t)?n=new Event(t,e):n=new CustomEvent(t,e)}catch{document.createEvent?n=document.createEvent("HTMLEvents").initEvent(t,!0,!0):document.createEventObject&&(n=document.createEventObject())}if(s.dispatchEvent)s.dispatchEvent(n);else if(s.fireEvent&&document.createEventObject)s.fireEvent("on"+t,n);else throw new Error(`Can't fire event : ${t}`)}function Fp(s,t){const e=s.changedTouches[0];return new MouseEvent(t,{bubbles:!0,cancelable:!0,view:window,detail:1,screenX:e.screenX,screenY:e.screenY,clientX:e.clientX,clientY:e.clientY,ctrlKey:!1,altKey:!1,shiftKey:!1,metaKey:!1,button:0,relatedTarget:null})}function Bp(s,t){let e=document.createElement(s);t="on"+t;let n=t in e;return n||(e.setAttribute(t,"return;"),n=typeof e[t]=="function"),e=null,n}(function(){if(!window.requestAnimationFrame){let s=ht();window.requestAnimationFrame=function(t){const e=ht(),n=Math.max(0,16-(e-s)),i=window.setTimeout(function(){t(e+n)},n);return s=e+n,i}}window.cancelAnimationFrame||(window.cancelAnimationFrame=function(s){clearTimeout(s)})})();function pr(s){let t=!1;return window.requestAnimationFrame(function e(n){!t&&s(n)&&window.requestAnimationFrame(e)}),()=>{t=!0}}function gr(s,t=0){if(t==0)return s(ht()),()=>{};{const e=ht();return pr(n=>n-e>=t?(s(n),!1):!0)}}function Np(s,t=0){let e=!1,n=0;const i=ht(),r=o=>{if(e)return;n++;const a=o-i-n*t;s(o,n,t<=a),gr(r,Math.max(0,t-a))};return gr(r,t),()=>{e=!0}}function Yp(s,t=20){const e=1e3/t;let n=0,i;return()=>(ht()-n>=e&&(n=ht(),i=s()),i)}window.requestIdleCallback=window.requestIdleCallback||function(s,t){const e=ht();return setTimeout(()=>{const n=ht()-e;s({didTimeout:!0,timeRemaining:()=>Math.max(0,50-n)})},t?.timeout)},window.cancelIdleCallback=window.cancelIdleCallback||function(s){clearTimeout(s)};function jc(s,t){window.requestIdleCallback(e=>{e.timeRemaining()>0||e.didTimeout?s():jc(s,t)},{timeout:t?.timeout})}let Is=0,yr=0,Ue=33,Te=33,wr,xr=-1;const Hc=new MessageChannel,Up=Hc.port2;Hc.port1.onmessage=s=>{wr&&wr({didTimeout:xr==-1?!1:ht()-Is>xr,timeRemaining:()=>Math.max(0,yr-ht())})};function Xp(s,t){return wr=s,xr=typeof t?.timeout=="number"?t?.timeout:-1,requestAnimationFrame(e=>{Is=e;let n=Te+Is-yr;n<Te&&Ue<Te?(n<8&&(n=8),Te=n<Ue?Ue:n):n>Te&&Ue>Te?Te=n<Ue?Ue:n:Ue=n,yr=Is+Te,Up.postMessage(null)})}const Wc=new zf({concurrency:1,timeRemaining:0});let br=!1;function Jc(s,t){const e=Lf({fn:s,name:t?.name,deadline:typeof t?.timeout=="number"?se()+t.timeout:void 0});Wc.asap(e),!br&&(br=!0,Xp(n=>{br=!1,Wc.idleCallback(n)}))}class In{static _nextId=0;static nextId(){return In._nextId++}}const O={Linear:{None:function(s){return s}},Ease:{In:function(s){return Math.pow(s,1.7)}},Quadratic:{In:function(s){return s*s},Out:function(s){return s*(2-s)},InOut:function(s){return(s*=2)<1?.5*s*s:-.5*(--s*(s-2)-1)}},Cubic:{In:function(s){return s*s*s},Out:function(s){return--s*s*s+1},InOut:function(s){return(s*=2)<1?.5*s*s*s:.5*((s-=2)*s*s+2)}},Quartic:{In:function(s){return s*s*s*s},Out:function(s){return 1- --s*s*s*s},InOut:function(s){return(s*=2)<1?.5*s*s*s*s:-.5*((s-=2)*s*s*s-2)}},Quintic:{In:function(s){return s*s*s*s*s},Out:function(s){return--s*s*s*s*s+1},InOut:function(s){return(s*=2)<1?.5*s*s*s*s*s:.5*((s-=2)*s*s*s*s+2)}},Sinusoidal:{In:function(s){return 1-Math.sin((1-s)*Math.PI/2)},Out:function(s){return Math.sin(s*Math.PI/2)},InOut:function(s){return .5*(1-Math.sin(Math.PI*(.5-s)))}},Exponential:{In:function(s){return s===0?0:Math.pow(1024,s-1)},Out:function(s){return s===1?1:1-Math.pow(2,-10*s)},InOut:function(s){return s===0?0:s===1?1:(s*=2)<1?.5*Math.pow(1024,s-1):.5*(-Math.pow(2,-10*(s-1))+2)}},Circular:{In:function(s){return 1-Math.sqrt(1-s*s)},Out:function(s){return Math.sqrt(1- --s*s)},InOut:function(s){return(s*=2)<1?-.5*(Math.sqrt(1-s*s)-1):.5*(Math.sqrt(1-(s-=2)*s)+1)}},Elastic:{In:function(s){return s===0?0:s===1?1:-Math.pow(2,10*(s-1))*Math.sin((s-1.1)*5*Math.PI)},Out:function(s){return s===0?0:s===1?1:Math.pow(2,-10*s)*Math.sin((s-.1)*5*Math.PI)+1},InOut:function(s){return s===0?0:s===1?1:(s*=2,s<1?-.5*Math.pow(2,10*(s-1))*Math.sin((s-1.1)*5*Math.PI):.5*Math.pow(2,-10*(s-1))*Math.sin((s-1.1)*5*Math.PI)+1)}},Back:{In:function(s){return s===1?1:s*s*((1.70158+1)*s-1.70158)},Out:function(s){return s===0?0:--s*s*((1.70158+1)*s+1.70158)+1},InOut:function(s){const t=2.5949095;return(s*=2)<1?.5*(s*s*((t+1)*s-t)):.5*((s-=2)*s*((t+1)*s+t)+2)}},Bounce:{In:function(s){return 1-O.Bounce.Out(1-s)},Out:function(s){return s<1/2.75?7.5625*s*s:s<2/2.75?7.5625*(s-=1.5/2.75)*s+.75:s<2.5/2.75?7.5625*(s-=2.25/2.75)*s+.9375:7.5625*(s-=2.625/2.75)*s+.984375},InOut:function(s){return s<.5?O.Bounce.In(s*2)*.5:O.Bounce.Out(s*2-1)*.5+.5}},generatePow:function(s=4){return s=s<Number.EPSILON?Number.EPSILON:s,s=s>1e4?1e4:s,{In:function(t){return t**s},Out:function(t){return 1-(1-t)**s},InOut:function(t){return t<.5?(t*2)**s/2:(1-(2-t*2)**s)/2+.5}}},random:function(s){return Math.random()},createStep:function(s){return function(t){return Math.floor(t*s)/s}},createNoisyEasing:function(s,t=.1){const e=1-t;return function(n){return t*Math.random()+e*s(n)}},swing:function(s){return s+Math.sin(s*Math.PI*2)/2},causeSeizures:function(s){return s+.2*Math.random()-.1}};function Zc(s){switch(s){case O.Quadratic.In:return O.Quadratic.Out;case O.Quadratic.Out:return O.Quadratic.In;case O.Quadratic.InOut:return O.Quadratic.InOut;case O.Cubic.In:return O.Cubic.Out;case O.Cubic.Out:return O.Cubic.In;case O.Cubic.InOut:return O.Cubic.InOut;case O.Quartic.In:return O.Quartic.Out;case O.Quartic.Out:return O.Quartic.In;case O.Quartic.InOut:return O.Quartic.InOut;case O.Quintic.In:return O.Quintic.Out;case O.Quintic.Out:return O.Quintic.In;case O.Quintic.InOut:return O.Quintic.InOut;case O.Sinusoidal.In:return O.Sinusoidal.Out;case O.Sinusoidal.Out:return O.Sinusoidal.In;case O.Sinusoidal.InOut:return O.Sinusoidal.InOut;case O.Exponential.In:return O.Exponential.Out;case O.Exponential.Out:return O.Exponential.In;case O.Exponential.InOut:return O.Exponential.InOut;case O.Circular.In:return O.Circular.Out;case O.Circular.Out:return O.Circular.In;case O.Circular.InOut:return O.Circular.InOut;case O.Elastic.In:return O.Elastic.Out;case O.Elastic.Out:return O.Elastic.In;case O.Elastic.InOut:return O.Elastic.InOut;case O.Back.In:return O.Back.Out;case O.Back.Out:return O.Back.In;case O.Back.InOut:return O.Back.InOut;case O.Bounce.In:return O.Bounce.Out;case O.Bounce.Out:return O.Bounce.In;case O.Bounce.InOut:return O.Bounce.InOut;default:return s}}const $p=4,Vp=.001,Gp=1e-7,qp=10,Dn=11,Ds=1/(Dn-1),jp=typeof Float32Array=="function";function Qc(s,t){return 1-3*t+3*s}function Kc(s,t){return 3*t-6*s}function th(s){return 3*s}function Rs(s,t,e){return((Qc(t,e)*s+Kc(t,e))*s+th(t))*s}function eh(s,t,e){return 3*Qc(t,e)*s*s+2*Kc(t,e)*s+th(t)}function Hp(s,t,e,n,i){let r,o,a=0;do o=t+(e-t)/2,r=Rs(o,n,i)-s,r>0?e=o:t=o;while(Math.abs(r)>Gp&&++a<qp);return o}function Wp(s,t,e,n){for(let i=0;i<$p;++i){const r=eh(t,e,n);if(r===0)return t;const o=Rs(t,e,n)-s;t-=o/r}return t}function Jp(s){return s}function vr(s,t,e,n){if(!(0<=s&&s<=1&&0<=e&&e<=1))throw new Error("bezier x values must be in [0, 1] range");if(s===t&&e===n)return Jp;const i=jp?new Float32Array(Dn):new Array(Dn);for(let o=0;o<Dn;++o)i[o]=Rs(o*Ds,s,e);function r(o){let a=0,c=1;const h=Dn-1;for(;c!==h&&i[c]<=o;++c)a+=Ds;--c;const u=(o-i[c])/(i[c+1]-i[c]),l=a+u*Ds,d=eh(l,s,e);return d>=Vp?Wp(o,l,s,e):d===0?l:Hp(o,a,a+Ds,s,e)}return o=>o===0||o===1?o:Rs(r(o),t,n)}function _r(s){switch(s){case"linear":return[0,0,1,1];case"ease":return[.25,.1,.25,1];case"ease-in":return[.42,0,1,1];case"ease-in-out":return[.42,0,.58,1];case"ease-out":return[0,0,.58,1]}}function nh(s){const[t,e,n,i]=_r(s);return[1-n,1-i,1-t,1-e]}function Zp(s){return vr(..._r(s))}function Qp(s){return vr(...nh(s))}const le={Utils:{Linear:function(s,t,e){return(t-s)*e+s},Factorial:function(){const s=[1];return function(t){let e=1;if(s[t])return s[t];for(let n=t;n>1;n--)e*=n;return s[t]=e,e}}(),Bernstein:function(s,t){const e=le.Utils.Factorial;return e(s)/e(t)/e(s-t)},CatmullRom:function(s,t,e,n,i){const r=(e-s)*.5,o=(n-t)*.5,a=i*i,c=i*a;return(2*t-2*e+r+o)*c+(-3*t+3*e-2*r-o)*a+r*i+t},QuadraticBezier:(s,t,e,n)=>{const i=1-n;return i*i*s+2*i*n*t+n*n*e},CubicBezier:(s,t,e,n,i)=>{const r=1-i;return r*r*r*s+3*r*r*i*t+3*r*i*i*e+i*i*i*n}},Linear:function(s,t){const e=s.length-1,n=e*t,i=Math.floor(n),r=le.Utils.Linear;return t<0?r(s[0],s[1],n):t>1?r(s[e],s[e-1],e-n):r(s[i],s[i+1>e?e:i+1],n-i)},Bezier:function(s,t){let e=0;const n=s.length-1,i=Math.pow,r=le.Utils.Bernstein;for(let o=0;o<=n;o++)e+=i(1-t,n-o)*i(t,o)*s[o]*r(n,o);return e},CatmullRom:function(s,t){const e=s.length-1;let n=e*t,i=Math.floor(n);const r=le.Utils.CatmullRom;return s[0]===s[e]?(t<0&&(i=Math.floor(n=e*(1+t))),r(s[(i-1+e)%e],s[i],s[(i+1)%e],s[(i+2)%e],n-i)):t<0?s[0]-(r(s[0],s[0],s[1],s[1],-n)-s[0]):t>1?s[e]-(r(s[e],s[e],s[e-1],s[e-1],n-e)-s[e]):r(s[i?i-1:0],s[i],s[e<i+1?e:i+1],s[e<i+2?e:i+2],n-i)}};class sh{_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=ht(),e=!1){const n=Object.keys(this._tweens);for(let i=0;i<n.length;i++){const r=this._tweens[n[i]],o=!e;r&&r.update(t,o)===!1&&!e&&delete this._tweens[n[i]]}return!!Object.keys(this._tweens).length}}const $t=new sh;class Sr{constructor(t,e=$t){this._object=t,this._group=e}_id=In.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=O.Linear.None;_interpolationFunction=le.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=ht()){if(this._isPlaying)return this;if(this._group&&this._group.add(this),this._repeat=this._initialRepeat,this._reversed){this._reversed=!1;for(const e in this._valuesStartRepeat)this._swapEndStartRepeatValues(e),this._valuesStart[e]=this._valuesStartRepeat[e]}return this._isPlaying=!0,this._isPaused=!1,this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._isChainStopped=!1,this._startTime=t,this._startTime+=this._delayTime,this._setupProperties(this._object,this._valuesStart,this._valuesEnd,this._valuesStartRepeat),this}_setupProperties(t,e,n,i){for(const r in n){const o=t[r],a=Array.isArray(o),c=a?"array":typeof o,h=!a&&Array.isArray(n[r]);if(!(c==="undefined"||c==="function")){if(h){let u=n[r];if(u.length===0)continue;u=u.map(this._handleRelativeValue.bind(this,o)),n[r]=[o].concat(u)}if((c==="object"||a)&&o&&!h){e[r]=a?[]:{};for(const u in o)e[r][u]=o[u];i[r]=a?[]:{},this._setupProperties(o,e[r],n[r],i[r])}else typeof e[r]>"u"&&(e[r]=o),a||(e[r]*=1),h?i[r]=n[r].slice().reverse():i[r]=e[r]||0}}}stop(){return this._isChainStopped||(this._isChainStopped=!0,this.stopChainedTweens()),this._isPlaying?(this._group&&this._group.remove(this),this._isPlaying=!1,this._isPaused=!1,this._onStopCallback&&this._onStopCallback(this._object),this):this}end(){return this._goToEnd=!0,this.update(1/0),this}pause(t=ht()){return this._isPaused||!this._isPlaying?this:(this._isPaused=!0,this._pauseStartTime=t,this._group&&this._group.remove(this),this)}resume(t=ht()){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=$t){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=O.Linear.None){return this._easingFunction=t,this}interpolation(t=le.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=ht(),e=!0){if(this._isPaused)return!0;let n,i;const r=this._startTime+this._durationTime;if(!this._goToEnd&&!this._isPlaying){if(t>r)return!1;e&&this.start(t)}if(this._goToEnd=!1,t<this._startTime)return!0;this._onStartCallbackFired===!1&&(this._onStartCallback&&this._onStartCallback(this._object),this._onStartCallbackFired=!0),this._onEveryStartCallbackFired===!1&&(this._onEveryStartCallback&&this._onEveryStartCallback(this._object),this._onEveryStartCallbackFired=!0),i=(t-this._startTime)/this._durationTime,i=this._durationTime===0||i>1?1:i;const o=this._easingFunction(i);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,o),this._onUpdateCallback&&this._onUpdateCallback(this._object,i),i===1)if(this._repeat>0){isFinite(this._repeat)&&this._repeat--;for(n in this._valuesStartRepeat)!this._yoyo&&typeof this._valuesEnd[n]=="string"&&(this._valuesStartRepeat[n]=this._valuesStartRepeat[n]+parseFloat(this._valuesEnd[n])),this._yoyo&&this._swapEndStartRepeatValues(n),this._valuesStart[n]=this._valuesStartRepeat[n];return this._yoyo&&(this._reversed=!this._reversed),this._repeatDelayTime!==void 0?this._startTime=t+this._repeatDelayTime:this._startTime=t+this._delayTime,this._onRepeatCallback&&this._onRepeatCallback(this._object),this._onEveryStartCallbackFired=!1,!0}else{this._onCompleteCallback&&this._onCompleteCallback(this._object);for(let a=0,c=this._chainedTweens.length;a<c;a++)this._chainedTweens[a].start(this._startTime+this._durationTime);return this._isPlaying=!1,!1}return!0}_updateProperties(t,e,n,i){for(const r in n){if(e[r]===void 0)continue;const o=e[r]||0;let a=n[r];const c=Array.isArray(t[r]),h=Array.isArray(a);!c&&h?t[r]=this._interpolationFunction(a,i):typeof a=="object"&&a?this._updateProperties(t[r],o,a,i):(a=this._handleRelativeValue(o,a),typeof a=="number"&&(t[r]=o+(a-o)*i))}}_handleRelativeValue(t,e){return typeof e!="string"?e:e.charAt(0)==="+"||e.charAt(0)==="-"?t+parseFloat(e):parseFloat(e)}_swapEndStartRepeatValues(t){const e=this._valuesStartRepeat[t],n=this._valuesEnd[t];typeof n=="string"?this._valuesStartRepeat[t]=this._valuesStartRepeat[t]+parseFloat(n):this._valuesStartRepeat[t]=n,this._valuesEnd[t]=e}}const Kp=In.nextId,tg=$t.getAll.bind($t),eg=$t.removeAll.bind($t),ng=$t.add.bind($t),sg=$t.remove.bind($t),ig=$t.update.bind($t),rg={now:ht,Sequence:In,Easing:O,Interpolation:le,Group:sh,Tween:Sr,nextId:Kp,getAll:tg,removeAll:eg,add:ng,remove:sg,update:ig};class Cr{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=ht(),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=ht();t=e-this.oldTime,this.oldTime=e,this.elapsedTime+=t}return t}}class Rn{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){Pl(this.tweens,(e,n)=>t?e.delay>n.delay:e.delay<=n.delay)}cloneTweens(t=this.tweens){const e=[];return t.forEach(n=>{const i={...n};delete i.tween,i.fromValues={...i.fromValues},i.toValues={...i.toValues},e.push(i)}),e}addTween(t,e,n){const i={fromValues:t,toValues:e,frames:typeof n?.frames=="number"?n.frames:1,delay:typeof n?.delay=="number"?n.delay:this.tweens.length,easeFunction:n?.easeFunction||O.Linear.None,interpolationFunction:n?.interpolationFunction||le.Linear,repeat:typeof n?.repeat=="number"?n.repeat:0,yoyo:n?.yoyo||!1,onStart:n?.onStart||(()=>{}),onUpdate:n?.onUpdate||(()=>{}),onComplete:n?.onComplete||(()=>{})};return this.tweens.push(i),this}cancelRequestAnimationCycle=()=>{};runTweens(t){this.cancelRequestAnimationCycle();const e=new Cr,n=this.frameDuration;return new Promise(i=>{this.onGroupStart?.(),this.cancelRequestAnimationCycle=pr(r=>{if(!this.isPaused){const a=Math.max(0,r-this.pausedDuration),c=Math.max(0,e.getElapsedTime()-this.pausedDuration);t.filter(h=>h.delay*n<=c).forEach(h=>{h.tween||(h.tween=new Sr({...h.fromValues}).to({...h.toValues},h.frames*n).easing(h.easeFunction).interpolation(h.interpolationFunction).repeat(h.repeat).yoyo(h.yoyo).onStart(h.onStart).onUpdate(h.onUpdate).onComplete(h.onComplete),h.tween.start(a)),(h.delay+h.frames*(h.repeat+1))*n>c?h.tween.update(a):(h.tween.isPlaying()&&h.tween.end(),Le(t,h))})}const o=!!t.length;return o||(this.onGroupComplete?.(),i()),o})})}isPaused=!1;pausedClock=new Cr;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(n=>{e=Math.max(e,n.delay+n.frames),n.easeFunction=Zc(n.easeFunction);const i={...n.toValues};n.toValues={...n.fromValues},n.fromValues={...i}}),t.forEach(n=>{n.delay=e-n.frames}),this.play(t)}pause(){this.pausedClock.start(),this.isPaused=!0}resume(){this.pausedDuration+=this.pausedClock.getElapsedTime(),this.pausedClock.stop(),this.isPaused=!1}}const Ls=new cs,ih=(s=!0)=>{Ls.filter((t,e)=>(e.alternate&&(Zs(e,e.alternate),s&&Ls.set(t,e.alternate),e.alternate=void 0),s))};function Tr(s){let t=Ls.get(s);return t||(t=Js(s),Ls.set(s,t)),t}function rh(s){const t=Tr(s);return t.alternate||(t.alternate=Js(s)),t.alternate}function og(s,t,e=!0){t(rh(s)),ih(e)}function Er(s,t,e=!0){t(rh(s)),Jc(()=>ih(e),{name:"FLUSH_DOM_ACTION",timeout:50})}function J(s){return s*Math.PI/180}function Pt(s){return s*180/Math.PI}function cn(s,t,e=0){return Math.sqrt(s*s+t*t+e*e)}function Ee(s,t,e,n){return cn(e-s,n-t)}function Qt(s,t,e,n){let i=Math.atan2(n-t,e-s);return i<0&&(i+=Math.PI*2),i}function hn(s,t){return{dx:Math.cos(s)*t,dy:Math.sin(s)*t}}function ag(s,t,e){if(typeof e=="number"){const n=cn(s,t,e);return{x:s/=n,y:t/=n,z:e/=n}}else{const n=cn(s,t);return{x:s/=n,y:t/=n}}}function cg(s,t,e,n,i=10){if(Math.abs(e-s)<i&&Math.abs(n-t)<i)return"no";const r=Pt(Qt(s,t,e,n));return r>=-135&&r<=-45?"up":r>45&&r<135?"down":r>=135&&r<=180||r>=-180&&r<-135?"left":"right"}const oh=hg("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 hg(s,t=10){const e={},n=s.split(",");for(let i=0;i<n.length;i+=2){const r="&"+n[i+1]+";",o=parseInt(n[i],t);e[r]="&#"+o+";"}return e["\\xa0"]=" ",e}function Mt(s,t){const e=Object.keys(t);for(let n=0;n<e.length;n++)s=s.replace(new RegExp("{"+e[n]+"}","gi"),""+t[e[n]]);return s}function Os(s){let t,e;if(!s)throw new Error("cannot create a random attribute name for an undefined object");const n="ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz";t="";do for(t="",e=0;e<12;e++)t+=n[Math.floor(Math.random()*n.length)];while(s[t]);return t}function ug(s){const t={left:"start",right:"end",center:"middle",start:"start",end:"end"};return t[s]||t.start}function lg(s){const t={alphabetic:"alphabetic",hanging:"hanging",top:"text-before-edge",bottom:"text-after-edge",middle:"central"};return t[s]||t.alphabetic}const Ln={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"}};let zs=class{__root;__ctx;constructor(t,e){this.__root=t,this.__ctx=e}addColorStop(t,e){const n=this.__ctx.__createElement("stop");if(n.setAttribute("offset",""+t),e.indexOf("rgba")!==-1){const r=/rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d?\.?\d*)\s*\)/gi.exec(e);r&&(n.setAttribute("stop-color",Mt("rgb({r},{g},{b})",{r:r[1],g:r[2],b:r[3]})),n.setAttribute("stop-opacity",r[4]))}else n.setAttribute("stop-color",e);this.__root.appendChild(n)}},Pr=class{__root;__ctx;constructor(t,e){this.__root=t,this.__ctx=e}},ah=class ta{__document=document;__canvas;__ctx;width;height;__styleStack;__groupStack;__rootSVG;__ids;__SVGdefs;__currentElement;__currentElementsToStyle=null;constructor({canvas:t,width:e=500,height:n=500}){t?(this.__canvas=t,this.__ctx=t.getContext("2d"),this.width=t.width,this.height=t.height):(this.__canvas=this.__document.createElement("canvas"),this.__ctx=this.__canvas.getContext("2d"),this.width=e,this.height=n),this.__setDefaultStyles(),this.__styleStack=[this.__getStyleState()],this.__groupStack=[],this.__rootSVG=this.__document.createElementNS("http://www.w3.org/2000/svg","svg"),this.__rootSVG.setAttribute("version","1.1"),this.__rootSVG.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.__rootSVG.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink","http://www.w3.org/1999/xlink"),this.__rootSVG.setAttribute("width",""+this.width),this.__rootSVG.setAttribute("height",""+this.height),this.__ids={},this.__SVGdefs=this.__document.createElementNS("http://www.w3.org/2000/svg","defs"),this.__rootSVG.appendChild(this.__SVGdefs),this.__currentElement=this.__document.createElementNS("http://www.w3.org/2000/svg","g"),this.__rootSVG.appendChild(this.__currentElement)}__setDefaultStyles(){const t=Object.keys(Ln);for(let e=0,n=t.length;e<n;e++){const i=t[e];this[i]=Ln[i].canvas}}__getStyleState(){const t={},e=Object.keys(Ln);for(let n=0,i=e.length;n<i;n++){const r=e[n];t[r]=this[r]}return t}__applyStyleState(t){const e=Object.keys(t);for(let n=0,i=e.length;n<i;n++){const r=e[n];this[r]=t[r]}}__createElement(t,e={},n=!1){const i=this.__document.createElementNS("http://www.w3.org/2000/svg",t),r=Object.keys(e);n&&(i.setAttribute("fill","none"),i.setAttribute("stroke","none"));for(let o=0;o<r.length;o++){const a=r[o];i.setAttribute(a,e[a])}return i}__applyStyleToCurrentElement(t){let e=this.__currentElement;const n=this.__currentElementsToStyle;n&&(e.setAttribute(t,""),e=n.element,n.children.forEach(r=>{r.setAttribute(t,"")}));const i=Object.keys(Ln);for(let r=0;r<i.length;r++){const o=Ln[i[r]],a=this[i[r]];if(o.apply){if(a instanceof Pr){if(a.__ctx)for(;a.__ctx.__SVGdefs.childNodes.length;){const c=a.__ctx.__SVGdefs.childNodes[0].getAttribute("id");this.__ids[c]=c,this.__SVGdefs.appendChild(a.__ctx.__SVGdefs.childNodes[0])}e.setAttribute(o.apply,Mt("url(#{id})",{id:a.__root.getAttribute("id")}))}else if(a instanceof zs)e.setAttribute(o.apply,Mt("url(#{id})",{id:a.__root.getAttribute("id")}));else if(o.apply.indexOf(t)!==-1&&o.svg!==a)if((o.svgAttr==="stroke"||o.svgAttr==="fill")&&a.indexOf("rgba")!==-1){const h=/rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d?\.?\d*)\s*\)/gi.exec(a);if(h){e.setAttribute(o.svgAttr,Mt("rgb({r},{g},{b})",{r:h[1],g:h[2],b:h[3]}));let u=parseFloat(h[4]);const l=this.globalAlpha;l!=null&&(u*=l),e.setAttribute(o.svgAttr+"-opacity",""+u)}}else{let c=o.svgAttr;if(i[r]==="globalAlpha"&&(c=t+"-"+o.svgAttr,e.getAttribute(c)))continue;c&&e.setAttribute(c,a)}}}}__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(oh);for(let r=0,o=i.length;r<o;r++){const a=i[r],c=oh[a],h=new RegExp(a,"gi");h.test(e)&&(e=e.replace(h,c))}}return e}getSvg(){return this.__rootSVG}save(){const t=this.__createElement("g"),e=this.__closestGroupOrSvg();this.__groupStack.push(e),e.appendChild(t),this.__currentElement=t,this.__styleStack.push(this.__getStyleState())}restore(){this.__currentElementsToStyle=null;const t=this.__groupStack.pop();t?this.__currentElement=t:this.__currentElement=this.__rootSVG.childNodes[1];const e=this.__styleStack.pop();e&&this.__applyStyleState(e)}__addTransform(t){const e=this.__closestGroupOrSvg();if(e.childNodes.length>0){this.__currentElement.nodeName==="path"&&(this.__currentElementsToStyle||(this.__currentElementsToStyle={element:e,children:[]}),this.__currentElementsToStyle.children.push(this.__currentElement),this.__applyCurrentDefaultPath());const i=this.__createElement("g");e.appendChild(i),this.__currentElement=i}let n=this.__currentElement.getAttribute("transform");n?n+=" ":n="",n+=t,this.__currentElement.setAttribute("transform",n)}scale(t,e){e===void 0&&(e=t),this.__addTransform(Mt("scale({x},{y})",{x:t,y:e}))}rotate(t){const e=t*180/Math.PI;this.__addTransform(Mt("rotate({angle},{cx},{cy})",{angle:e,cx:0,cy:0}))}translate(t,e){this.__addTransform(Mt("translate({x},{y})",{x:t,y:e}))}transform(t,e,n,i,r,o){this.__addTransform(Mt("matrix({a},{b},{c},{d},{e},{f})",{a:t,b:e,c:n,d:i,e:r,f:o}))}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(Mt("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(Mt("L {x} {y}",this.__currentPosition)):this.__addPathCommand(Mt("M {x} {y}",this.__currentPosition))}bezierCurveTo(t,e,n,i,r,o){this.__currentPosition={x:r,y:o},this.__addPathCommand(Mt("C {cp1x} {cp1y} {cp2x} {cp2y} {x} {y}",{cp1x:t,cp1y:e,cp2x:n,cp2y:i,x:r,y:o}))}quadraticCurveTo(t,e,n,i){this.__currentPosition={x:n,y:i},this.__addPathCommand(Mt("Q {cpx} {cpy} {x} {y}",{cpx:t,cpy:e,x:n,y:i}))}normalize(t){const e=Math.sqrt(t[0]*t[0]+t[1]*t[1]);return[t[0]/e,t[1]/e]}arcTo(t,e,n,i,r){const o=this.__currentPosition&&this.__currentPosition.x,a=this.__currentPosition&&this.__currentPosition.y;if(typeof o>"u"||typeof a>"u")return;if(r<0)throw new Error("IndexSizeError: The radius provided ("+r+") is negative.");if(o===t&&a===e||t===n&&e===i||r===0){this.lineTo(t,e);return}const c=this.normalize([o-t,a-e]),h=this.normalize([n-t,i-e]);if(c[0]*h[1]===c[1]*h[0]){this.lineTo(t,e);return}const u=c[0]*h[0]+c[1]*h[1],l=Math.acos(Math.abs(u)),d=this.normalize([c[0]+h[0],c[1]+h[1]]),f=r/Math.sin(l/2),p=t+f*d[0],w=e+f*d[1],b=[-c[1],c[0]],x=[h[1],-h[0]],g=function(E){const C=E[0];return E[1]>=0?Math.acos(C):-Math.acos(C)},v=g(b),_=g(x);this.lineTo(p+b[0]*r,w+b[1]*r),this.arc(p,w,r,v,_)}stroke(){this.__currentElement.nodeName==="path"&&this.__currentElement.setAttribute("paint-order","fill stroke markers"),this.__applyCurrentDefaultPath(),this.__applyStyleToCurrentElement("stroke")}fill(){this.__currentElement.nodeName==="path"&&this.__currentElement.setAttribute("paint-order","stroke fill markers"),this.__applyCurrentDefaultPath(),this.__applyStyleToCurrentElement("fill")}rect(t,e,n,i){this.__currentElement.nodeName!=="path"&&this.beginPath(),this.moveTo(t,e),this.lineTo(t+n,e),this.lineTo(t+n,e+i),this.lineTo(t,e+i),this.lineTo(t,e),this.closePath()}fillRect(t,e,n,i){const r=this.__createElement("rect",{x:t,y:e,width:n,height:i},!0);this.__closestGroupOrSvg().appendChild(r),this.__currentElement=r,this.__applyStyleToCurrentElement("fill")}strokeRect(t,e,n,i){const r=this.__createElement("rect",{x:t,y:e,width:n,height:i},!0);this.__closestGroupOrSvg().appendChild(r),this.__currentElement=r,this.__applyStyleToCurrentElement("stroke")}__clearCanvas(){const e=this.__closestGroupOrSvg().getAttribute("transform"),n=this.__rootSVG.childNodes[1],i=n.childNodes;for(let r=i.length-1;r>=0;r--)i[r]&&n.removeChild(i[r]);this.__currentElement=n,this.__groupStack=[],e&&this.__addTransform(e)}clearRect(t,e,n,i){if(t===0&&e===0&&n===this.width&&i===this.height){this.__clearCanvas();return}const r=this.__closestGroupOrSvg(),o=this.__createElement("rect",{x:t,y:e,width:n,height:i,fill:"#FFFFFF"},!0);r.appendChild(o)}createLinearGradient(t,e,n,i){const r=this.__createElement("linearGradient",{id:Os(this.__ids),x1:t+"px",x2:n+"px",y1:e+"px",y2:i+"px",gradientUnits:"userSpaceOnUse"},!1);return this.__SVGdefs.appendChild(r),new zs(r,this)}createRadialGradient(t,e,n,i,r,o){const a=this.__createElement("radialGradient",{id:Os(this.__ids),cx:i+"px",cy:r+"px",r:o+"px",fx:t+"px",fy:e+"px",gradientUnits:"userSpaceOnUse"},!1);return this.__SVGdefs.appendChild(a),new zs(a,this)}__parseFont(){const e=/^\s*(?=(?:(?:[-a-z]+\s*){0,2}(italic|oblique))?)(?=(?:(?:[-a-z]+\s*){0,2}(small-caps))?)(?=(?:(?:[-a-z]+\s*){0,2}(bold(?:er)?|lighter|[1-9]00))?)(?:(?:normal|\1|\2|\3)\s*){0,3}((?:xx?-)?(?:small|large)|medium|smaller|larger|[.\d]+(?:%|in|[cem]m|ex|p[CustomCanvasContext]))(?:\s*\/\s*(normal|[.\d]+(?:%|in|[cem]m|ex|p[CustomCanvasContext])))?\s*([-,'"\sa-z0-9]+?)\s*$/i.exec(this.font),n={style:e[1]||"normal",size:e[4]||"10px",family:e[6]||"sans-serif",weight:e[3]||"normal",decoration:e[2]||"normal",href:null};return this.__fontUnderline==="underline"&&(n.decoration="underline"),this.__fontHref&&(n.href=this.__fontHref),n}__wrapTextLink(t,e){if(t.href){const n=this.__createElement("a");return n.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",t.href),n.appendChild(e),n}return e}__applyText(t,e,n,i){const r=this.__parseFont(),o=this.__closestGroupOrSvg(),a=this.__createElement("text",{"font-family":r.family,"font-size":r.size,"font-style":r.style,"font-weight":r.weight,"text-decoration":r.decoration,x:e,y:n,"text-anchor":ug(this.textAlign),"dominant-baseline":lg(this.textBaseline)},!0);a.appendChild(this.__document.createTextNode(t)),this.__currentElement=a,this.__applyStyleToCurrentElement(i),o.appendChild(this.__wrapTextLink(r,a))}fillText(t,e,n){this.__applyText(t,e,n,"fill")}strokeText(t,e,n){this.__applyText(t,e,n,"stroke")}measureText(t){return this.__ctx.font=this.font,this.__ctx.measureText(t)}arc(t,e,n,i,r,o){if(i===r)return;i=i%(2*Math.PI),r=r%(2*Math.PI),i===r&&(r=(r+2*Math.PI-.001*(o?-1:1))%(2*Math.PI));const a=t+n*Math.cos(r),c=e+n*Math.sin(r),h=t+n*Math.cos(i),u=e+n*Math.sin(i),l=o?0:1;let d=0,f=r-i;f<0&&(f+=2*Math.PI),o?d=f>Math.PI?0:1:d=f>Math.PI?1:0,this.lineTo(h,u),this.__addPathCommand(Mt("A {rx} {ry} {xAxisRotation} {largeArcFlag} {sweepFlag} {endX} {endY}",{rx:n,ry:n,xAxisRotation:0,largeArcFlag:d,sweepFlag:l,endX:a,endY:c})),this.__currentPosition={x:a,y:c}}clip(){const t=this.__closestGroupOrSvg(),e=this.__createElement("clipPath"),n=Os(this.__ids),i=this.__createElement("g");this.__applyCurrentDefaultPath(),t.removeChild(this.__currentElement),e.setAttribute("id",n),e.appendChild(this.__currentElement),this.__SVGdefs.appendChild(e),t.setAttribute("clip-path",Mt("url(#{id})",{id:n})),t.appendChild(i),this.__currentElement=i}drawImage(...t){let e=t[0],n,i,r,o,a=0,c=0,h,u,l,d,f,p,w,b;if(t.length===3)n=t[1],i=t[2],h=e.width,u=e.height,r=h,o=u;else if(t.length===5)n=t[1],i=t[2],r=t[3],o=t[4],h=e.width,u=e.height;else if(t.length===9)a=t[1],c=t[2],h=t[3],u=t[4],n=t[5],i=t[6],r=t[7],o=t[8];else throw new Error("Invalid number of arguments passed to drawImage: "+arguments.length);const x=this.__closestGroupOrSvg();this.__currentElement;const g="translate("+n+", "+i+")";if(e instanceof ta){if(l=e.getSvg().cloneNode(!0),l.childNodes&&l.childNodes.length>1){for(d=l.childNodes[0];d.childNodes.length;)b=d.childNodes[0].getAttribute("id"),this.__ids[b]=b,this.__SVGdefs.appendChild(d.childNodes[0]);if(f=l.childNodes[1],f){const v=f.getAttribute("transform");let _;v?_=v+" "+g:_=g,f.setAttribute("transform",_),x.appendChild(f)}}}else(e.nodeName==="CANVAS"||e.nodeName==="IMG")&&(p=this.__createElement("image"),p.setAttribute("width",r),p.setAttribute("height",o),p.setAttribute("preserveAspectRatio","none"),(a||c||h!==e.width||u!==e.height)&&(w=this.__document.createElement("canvas"),w.width=r,w.height=o,w.getContext("2d")?.drawImage(e,a,c,h,u,0,0,r,o),e=w),p.setAttribute("transform",g),p.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",e.nodeName==="CANVAS"?e.toDataURL():e.getAttribute("src")),x.appendChild(p))}createPattern(t,e){const n=this.__document.createElementNS("http://www.w3.org/2000/svg","pattern"),i=Os(this.__ids);let r;return n.setAttribute("id",i),t.nodeName==="CANVAS"||t.nodeName==="IMG"?(r=this.__document.createElementNS("http://www.w3.org/2000/svg","image"),r.setAttribute("width",""+t.width),r.setAttribute("height",""+t.height),r.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",t.nodeName==="CANVAS"?t.toDataURL():t.getAttribute("src")),n.appendChild(r),this.__SVGdefs.appendChild(n)):t instanceof ta&&(n.setAttribute("width",""+t.width),n.setAttribute("height",""+t.height),n.appendChild(t.__rootSVG.childNodes[1]),this.__SVGdefs.appendChild(n)),new Pr(n,this)}setLineDash(t){t&&t.length>0?this.lineDash=t.join(","):this.lineDash=null}drawFocusRing(){}createImageData(){}getImageData(){}putImageData(){}globalCompositeOperation(){}setTransform(){}},Mr=class{canvas;context;customContext;currentPath2D=new Path2D;path2Ds=[];currentMatrix=new DOMMatrix;hasSetCustomStrokeStyle=!1;hasSetCustomFillStyle=!1;constructor(t,e,n,i=!1){this.canvas=t,this.context=t.getContext("2d",{willReadFrequently:!0}),i&&(this.customContext=new ah({canvas:this.canvas,width:e||this.canvas.width,height:n||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,n,i){return this.context.fillRect(t,e,n,i),this.customContext&&this.customContext.fillRect(t,e,n,i),this}fillText(t,e,n,i){return this.hasSetCustomFillStyle=!1,this.context.fillText(t,e,n,i),this.customContext&&this.customContext.fillText(t,e,n),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,n,i){return this.context.strokeText(t,e,n,i),this.customContext&&this.customContext.strokeText(t,e,n),this}strokeRect(t,e,n,i){return this.context.strokeRect(t,e,n,i),this.customContext&&this.customContext.strokeRect(t,e,n,i),this}measureText(t){return this.context.measureText(t)}clearRect(t=0,e=0,n=this.canvas.width,i=this.canvas.height){return this.context.clearRect(t,e,n,i),this.customContext&&this.customContext.clearRect(t,e,n,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 n=new Path2D;n.addPath(t,e),this.currentPath2D=n}isPointInStroke(...t){return t[0]instanceof Path2D?this.context.isPointInStroke(t[0],t[1],t[2]):this.context.isPointInStroke(t[0],t[1])}isPointInPath(...t){return t[0]instanceof Path2D?this.context.isPointInPath(t[0],t[1],t[2]):this.context.isPointInPath(t[0],t[1])}translate(t,e){return this.context.translate(t,e),this.customContext&&this.customContext.translate(t,e),this.currentMatrix.translate(t,e),this.changePath2D(),this}rotate(t,e=0,n=0){return this.translate(e,n),this.context.rotate(t),this.customContext&&this.customContext.rotate(t),this.currentMatrix.rotate(t),this.translate(-e,-n),this.changePath2D(),this}scale(t,e=t,n=0,i=0){return this.translate(n,i),this.context.scale(t,e),this.customContext&&this.customContext.scale(t,e),this.currentMatrix.scale(t,e),this.translate(-n,-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,n,i,r,o){return this.context.arc(t,e,n,i,r,o),this.customContext&&this.customContext.arc(t,e,n,i,r,o?-1:1),this.currentPath2D.arc(t,e,n,i,r,o),this}arcTo(t,e,n,i,r){return this.context.arcTo(t,e,n,i,r),this.customContext&&this.customContext.arcTo(t,e,n,i,r),this.currentPath2D.arcTo(t,e,n,i,r),this}ellipse(t,e,n,i,r,o,a,c){return this.context.ellipse(t,e,n,i,r,o,a,c),this.currentPath2D.ellipse(t,e,n,i,r,o,a,c),this}quadraticCurveTo(t,e,n,i){return this.context.quadraticCurveTo(t,e,n,i),this.customContext&&this.customContext.quadraticCurveTo(t,e,n,i),this.currentPath2D.quadraticCurveTo(t,e,n,i),this}bezierCurveTo(t,e,n,i,r,o){return this.context.bezierCurveTo(t,e,n,i,r,o),this.customContext&&this.customContext.bezierCurveTo(t,e,n,i,r,o),this.currentPath2D.bezierCurveTo(t,e,n,i,r,o),this}rect(t,e,n,i){return this.context.rect(t,e,n,i),this.customContext&&this.customContext.rect(t,e,n,i),this.currentPath2D.rect(t,e,n,i),this}createLinearGradient(t,e,n,i,r){const o=this.context.createLinearGradient(t,e,n,i);return r&&Object.entries(r).forEach(([a,c])=>{o.addColorStop(parseFloat(a),c)}),o}createRadialGradient(t,e,n,i,r,o,a){const c=this.context.createRadialGradient(t,e,n,i,r,o);return a&&Object.entries(a).forEach(([h,u])=>{c.addColorStop(parseFloat(h),u)}),c}drawImage(t,...e){if(e.length===0)this.context.drawImage(t,0,0);else if(e.length===2){const n=e[0],i=e[1];this.context.drawImage(t,n,i)}else if(e.length===4){const n=e[0],i=e[1],r=e[2],o=e[3];this.context.drawImage(t,n,i,r,o)}else if(e.length===8){const n=e[0],i=e[1],r=e[2],o=e[3],a=e[4],c=e[5],h=e[6],u=e[7];this.context.drawImage(t,n,i,r,o,a,c,h,u)}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,n=this.canvas.width,i=this.canvas.height,r){return this.context.getImageData(t,e,n,i,r)}putImageData(t,e=0,n=0){return this.context.putImageData(t,e,n)}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}}},Ar=class{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=Qt(this.x,this.y,this.toX,this.toY);if(t===0){const e=Math.min(this.x,this.toX),n=Math.min(this.y,this.toY),i=Math.max(this.x,this.toX),r=Math.max(this.y,this.toY);return{x:e,y:n,width:i-e,height:r-n}}else{const e=Math.sin(t),n=Math.cos(t),i=n*this.x-e*this.y,r=n*this.toX-e*this.toY,o=n*this.y+e*this.x,a=n*this.toY+e*this.toX;return{x:Math.min(i,r),y:Math.min(o,a),width:Math.max(i,r)-Math.min(i,r),height:Math.max(o,a)-Math.min(o,a)}}}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,n=this.y,i=t.toX,r=t.toY,o=this.toX-e,a=t.x-i;if(!o&&!a)return null;const c=(this.toY-n)/o,h=(t.y-r)/a;if(o){if(!a)return{x:i,y:c*(i-e)+n}}else return{x:e,y:h*(e-i)+r};const u=(-h*i+r+c*e-n)/(c-h),l=c*(u-e)+n;return isNaN(u)||isNaN(l)?null:{x:u,y:l}}};const fg=class extends Ar{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,n,i,r,o,a,c]=this.convert(this.x,this.y,this.toX,this.toY,this.rx,this.ry,this.xAxisRotate,this.largeArcFlag,this.sweepFlag);t.ellipse(e,n,i,r,o,a,c,!this.sweepFlag)}convert(t,e,n,i,r,o,a,c,h){const u=a/180*Math.PI,l=(t-n)/2,d=(e-i)/2,f=Math.cos(u)*l+Math.sin(u)*d,p=-Math.sin(u)*l+Math.cos(u)*d,w=f*f/(r*r)+p*p/(o*o);if(w>1){const V=Math.sqrt(w);throw r=V*r,o=V*o,new Error(`Radii are too small to build an arc. Correcting them to ${r}/${o}.`)}const b=Math.sqrt((r*r*o*o-r*r*p*p-o*o*f*f)/(r*r*p*p+o*o*f*f)),x=c!=h?1:-1,g=x*b*r*p/o,v=x*b*-o*f/r,_=(t+n)/2,E=(e+i)/2,C=Math.cos(u)*g-Math.sin(u)*v+_,I=Math.sin(u)*g+Math.cos(u)*v+E,F=(V,W,tt,Z)=>(V*Z>=W*tt?1:-1)*Math.acos((V*tt+W*Z)/(Math.sqrt(V*V+W*W)*Math.sqrt(tt*tt+Z*Z))),N=F(1,0,t-C,e-I)-u,$=F(t-C,e-I,n-C,i-I);return[C,I,r,o,u,N,N+$]}},dg=class extends Ar{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,n=this.cy*2-(this.y+this.toY)/2;t.quadraticCurveTo(e,n,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 n,i,r,o;for(let h=0;h<2;++h)n=h==0?this.x-2*this.cx+this.toX:this.y-2*this.cy+this.toY,i=h==0?-2*this.x+2*this.cx:-2*this.y+2*this.cy,r=h==0?this.x:this.y,Math.abs(n)>1e-12&&(o=-i/(2*n),0<o&&o<1&&[t,e][h].push(n*o*o+i*o+r));const a={x:Math.min.apply(0,t),y:Math.min.apply(0,e)},c={x:Math.max.apply(0,t),y:Math.max.apply(0,e)};return{x:a.x,y:a.y,width:c.x-a.x,height:c.y-a.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}}},Pe=class es extends Ar{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),n=this.x-this.c1x,i=(-e+Math.sqrt(e*e-4*t*n))/2/t,r=(-e-Math.sqrt(e*e-4*t*n))/2/t;const o=[this.y,this.toY],a=[this.x,this.toX];let c;const h=[];Math.abs(i)>1e12&&(i=.5),Math.abs(r)>1e12&&(r=.5),i>=0&&i<=1&&(c=this.interpolate(i),a.push(c.x),o.push(c.y),h.push({X:c.x,Y:c.y})),r>=0&&r<=1&&(c=this.interpolate(r),a.push(c.x),o.push(c.y),h.push({X:c.x,Y:c.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),n=this.y-this.c1y,i=(-e+Math.sqrt(e*e-4*t*n))/2/t,r=(-e-Math.sqrt(e*e-4*t*n))/2/t,Math.abs(i)>1e12&&(i=.5),Math.abs(r)>1e12&&(r=.5),i>=0&&i<=1&&(c=this.interpolate(i),a.push(c.x),o.push(c.y),h.push({X:c.x,Y:c.y})),r>=0&&r<=1&&(c=this.interpolate(r),a.push(c.x),o.push(c.y),h.push({X:c.x,Y:c.y}));const u=[],l=h.length;for(let p=0;p<l;p++){for(let w=p+1;w<l;w++)h[p].X===h[w].X&&h[p].Y===h[w].Y&&(w=++p);u.push({X:h[p].X,Y:h[p].Y})}const d={x:Math.min.apply(Math,a),y:Math.min.apply(Math,o)},f={x:Math.max.apply(Math,a),y:Math.max.apply(Math,o)};return{x:d.x,y:d.y,width:f.x-d.x,height:f.y-d.y,dots:u}}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,n,i,r){const o=-3*e+9*n-9*i+3*r,a=t*o+6*e-12*n+6*i;return t*a-3*e+3*n}static bezlen(t,e,n,i,r,o,a,c,h=1){h=Math.max(0,Math.min(h,1));const u=h/2,l=[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816],d=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472];let f=0;for(let p=0;p<12;p++){const w=u*l[p]+u,b=this.base3(w,t,n,r,a),x=this.base3(w,e,i,o,c);f+=d[p]*Math.sqrt(b*b+x*x)}return u*f}length(t=1){return es.bezlen(this.x,this.y,this.c1x,this.c1y,this.c2x,this.c2y,this.toX,this.toY,t)}getTatLen(t){const e=this.x,n=this.y,i=this.c1x,r=this.c1y,o=this.c2x,a=this.c2y,c=this.toX,h=this.toY;if(t<0||es.bezlen(e,n,i,r,o,a,c,h)<t)return 0;const u=1;let l=u/2,d=u-l,f=es.bezlen(e,n,i,r,o,a,c,h,d);for(;Math.abs(f-t)>.01;)l/=2,d+=(f<t?1:-1)*l,f=es.bezlen(e,n,i,r,o,a,c,h,d);return d}getPointAtSegmentLength(t){const e=this.getTatLen(t),n=1-e,i=Math.pow(n,3),r=Math.pow(n,2),o=e*e,a=o*e,c=i*this.x+r*3*e*this.c1x+n*3*e*e*this.c2x+a*this.toX,h=i*this.y+r*3*e*this.c1y+n*3*e*e*this.c2y+a*this.toY,u=this.x+2*e*(this.c1x-this.x)+o*(this.c2x-2*this.c1x+this.x),l=this.y+2*e*(this.c1y-this.y)+o*(this.c2y-2*this.c1y+this.y),d=this.c1x+2*e*(this.c2x-this.c1x)+o*(this.toX-2*this.c2x+this.c1x),f=this.c1y+2*e*(this.c2y-this.c1y)+o*(this.toY-2*this.c2y+this.c1y),p=n*this.x+e*this.c1x,w=n*this.y+e*this.c1y,b=n*this.c2x+e*this.toX,x=n*this.c2y+e*this.toY,g=90-Math.atan2(u-d,l-f)*180/Math.PI;return{x:c,y:h,m:{x:u,y:l},n:{x:d,y:f},start:{x:p,y:w},end:{x:b,y:x},alpha:g}}},On=Math.PI*2;function ch(s,t,e,n){const i=s*n-t*e<0?-1:1;let r=s*e+t*n;return r>1&&(r=1),r<-1&&(r=-1),i*Math.acos(r)}function mg(s,t,e,n,i,r,o,a,c,h){const u=h*(s-e)/2+c*(t-n)/2,l=-c*(s-e)/2+h*(t-n)/2,d=o*o,f=a*a,p=u*u,w=l*l;let b=d*f-d*w-f*p;b<0&&(b=0),b/=d*w+f*p,b=Math.sqrt(b)*(i===r?-1:1);const x=b*o/a*l,g=b*-a/o*u,v=h*x-c*g+(s+e)/2,_=c*x+h*g+(t+n)/2,E=(u-x)/o,C=(l-g)/a,I=(-u-x)/o,F=(-l-g)/a,N=ch(1,0,E,C);let $=ch(E,C,I,F);return r===0&&$>0&&($-=On),r===1&&$<0&&($+=On),[v,_,N,$]}function pg(s,t){const e=1.3333333333333333*Math.tan(t/4),n=Math.cos(s),i=Math.sin(s),r=Math.cos(s+t),o=Math.sin(s+t);return[n,i,n-i*e,i+n*e,r+o*e,o-r*e,r,o]}function hh(s,t,e,n,i,r,o,a,c){const h=Math.sin(c*On/360),u=Math.cos(c*On/360),l=u*(s-e)/2+h*(t-n)/2,d=-h*(s-e)/2+u*(t-n)/2;if(l===0&&d===0)return[];if(o===0||a===0)return[];o=Math.abs(o),a=Math.abs(a);const f=l*l/(o*o)+d*d/(a*a);f>1&&(o*=Math.sqrt(f),a*=Math.sqrt(f));const p=mg(s,t,e,n,i,r,o,a,h,u),w=[];let b=p[2],x=p[3];const g=Math.max(Math.ceil(Math.abs(x)/(On/4)),1);x/=g;for(let v=0;v<g;v++)w.push(pg(b,x)),b+=x;return w.map(v=>{for(let _=0;_<v.length;_+=2){let E=v[_+0],C=v[_+1];E*=o,C*=a;const I=u*E-h*C,F=h*E+u*C;v[_+0]=I+p[0],v[_+1]=F+p[1]}return v})}function kr(s,t,e,n,i,r){return[s/3+.6666666666666666*e,t/3+.6666666666666666*n,i/3+.6666666666666666*e,r/3+.6666666666666666*n,i,r]}function zn(s,t,e,n){return[s,t,e,n,e,n]}const Fn={a:7,c:6,s:4,q:4,t:2,m:2,l:2,h:1,v:1,z:0};class Xe{static createSVGElement(t="path",e){const n=document.createElementNS.call(document,"http://www.w3.org/2000/svg",t);return e&&Ve(n,e),n}static createSvgPath(t,e){return this.createSVGElement("path",{d:t,id:e||rs()})}static downloadFromSVGElement(t,e="shape"){return Xs(Zi(t),`${e}.svg`)}static downloadFromSVGString(t,e="shape"){return Xs(xi(t),`${e}.svg`)}static getSVGRawStringFromElement(t){return Ji(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 Xe.isSVGPath(t)&&t.replace(/([mlhvzaqtcs])([^mlhvzaqtcs]*)/gi,(n,i,r)=>{let o=i.toLowerCase();const a=wi(r);for(o=="m"&&a.length>Fn[o]&&(e.push([i,...a.splice(0,Fn[o])]),o="l",i=i=="m"?"l":"L");a.length;){if(a.length<Fn[o])throw new Error(`parseSVGPath substring:{ ${n} } command:{ ${i} } args:{ ${a} }`);e.push([i,...a.splice(0,Fn[o])])}return o=="z"&&e.push([i]),""}),e}static absolutizeSVGPath(t){let e=0,n=0,i=0,r=0;return t.map(function(o){const a=o[0],c=a.toUpperCase();if(a!=c)switch(o[0]=c,a){case"a":o[6]+=i,o[7]+=r;break;case"v":o[1]+=r;break;case"h":o[1]+=i;break;default:for(let h=1;h<o.length;)o[h++]+=i,o[h++]+=r}switch(c){case"Z":i=e,r=n;break;case"H":i=o[1];break;case"V":r=o[1];break;case"M":i=e=o[1],r=n=o[2];break;default:i=o[o.length-2],r=o[o.length-1]}return o})}static relativeSVGPath(t){let e=0,n=0,i=0,r=0;return t.map(function(o){const a=o[0],c=a.toLowerCase();if(a!=c)switch(o[0]=c,a){case"A":o[6]-=i,o[7]-=r;break;case"V":o[1]-=r;break;case"H":o[1]-=i;break;default:for(let h=1;h<o.length;)o[h++]-=i,o[h++]-=r}switch(c){case"z":i=e,r=n;break;case"h":i+=o[1];break;case"v":r+=o[1];break;case"m":i+=o[1],r+=o[2],e+=o[1],n+=o[2];break;default:i+=o[o.length-2],r+=o[o.length-1]}return o})}static normalizeSVGPath(t){const e=[];let n=0,i=0,r=0,o=0,a=0,c=0,h=0,u=0,l;for(let d=0,f=t.length;d<f;d++){let p=t[d];const w=p[0];switch(w){case"M":n=p[1],i=p[2];break;case"A":const b=hh(r,o,p[6],p[7],p[4],p[5],p[1],p[2],p[3]);if(!b.length)continue;b.forEach((v,_)=>{const[E,C,I,F,N,$,V,W]=v;p=["C",I,F,N,$,V,W],_<b.length-1&&e.push(p)});break;case"S":let x=r,g=o;(l=="C"||l=="S")&&(x+=x-h,g+=g-u),p=["C",x,g,p[1],p[2],p[3],p[4]];break;case"T":l=="Q"||l=="T"?(a=r*2-a,c=o*2-c):(a=r,c=o),p=["C",...kr(r,o,a,c,p[1],p[2])];break;case"Q":a=p[1],c=p[2],p=["C",...kr(r,o,p[1],p[2],p[3],p[4])];break;case"L":p=["C",...zn(r,o,p[1],p[2])];break;case"H":p=["C",...zn(r,o,p[1],o)];break;case"V":p=["C",...zn(r,o,r,p[1])];break;case"Z":p=["C",...zn(r,o,n,i)];break}l=w,r=p[p.length-2],o=p[p.length-1],p.length>4?(h=p[p.length-4],u=p[p.length-3]):(h=r,u=o),e.push(p)}return e}static catmullRom2bezier(t){const e=[];for(let n=0,i=t.length;i-2>n;n+=2){let r;n==0?r=[{x:t[n],y:t[n+1]},{x:t[n],y:t[n+1]},{x:t[n+2],y:t[n+3]},{x:t[n+4],y:t[n+5]}]:i-4==n?r=[{x:t[n-2],y:t[n-1]},{x:t[n],y:t[n+1]},{x:t[n+2],y:t[n+3]},{x:t[n+2],y:t[n+3]}]:r=[{x:t[n-2],y:t[n-1]},{x:t[n],y:t[n+1]},{x:t[n+2],y:t[n+3]},{x:t[n+4],y:t[n+5]}];const o=[{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",o[1].x,o[1].y,o[2].x,o[2].y,o[3].x,o[3].y])}return e}static zvhToLSVGPath(t){const e=[];let n=["L",0,0],i;for(let r=0,o=t.length;r<o;r++){const a=t[r];switch(a[0]){case"M":n=["L",a[1],a[2]],e.push(a);break;case"Z":e.push(n);break;case"H":i=e[e.length-1]||["L",0,0],e.push(["L",a[1],i[i.length-1]]);break;case"V":i=e[e.length-1]||["L",0,0],e.push(["L",i[i.length-2],a[1]]);break;default:e.push(a)}}return e}static longhandSVGPath(t){const e={S:{to:"C",x:3},T:{to:"Q",x:1}};let n,i=0,r=0;for(let o=0,a=t.length;o<a;o++){const c=t[o],h=e[c[0]];h&&(c[0]=h.to,n&&(n[0]===h.to?(i=2*Number(n[h.x+2])-Number(n[h.x]),r=2*Number(n[h.x+3])-Number(n[h.x+1])):(i=Number(n[n.length-2]),r=Number(n[n.length-1]))),c.splice(1,0,i,r)),n=c}return t}}let gg=class xe{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(Xe.parseSVGPath(t),e):t instanceof xe?this.resetFromSVGPathData(t.toSVGPathData(),e):this.resetFromSVGPathData(t||[],e)}resetFromSVGPathData(t,e){this.normalizedLines=[];const n=Xe.normalizeSVGPath(Xe.absolutizeSVGPath(t));this.prevPathX=this.startPathX=0,this.prevPathY=this.startPathY=0;let i=!1;for(let r=0,o=n.length;r<o;r++){const a=n[r];if(a[0]=="M"){i||(i=!0,this.startPathX=a[1],this.startPathY=a[2]),this.prevPathX=a[1],this.prevPathY=a[2];continue}this.appendLine(new Pe({c1x:a[1],c1y:a[2],c2x:a[3],c2y:a[4],toX:a[5],toY:a[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 xe;e.prevPathX=e.startPathX=t[0]||0,e.prevPathY=e.startPathY=t[1]||0;for(let n=2,i=t.length;n+5<i;n+=6)e.appendLine(new Pe({c1x:t[n],c1y:t[n+1],c2x:t[n+2],c2y:t[n+3],toX:t[n+4],toY:t[n+5]}));return e}static fromLines(t){const e=new xe;e.prevPathX=e.startPathX=t[0].x||0,e.prevPathY=e.startPathY=t[0].y||0;for(let n=0,i=t.length;n<i;n++)e.appendLine(t[n]);return e}appendLine(t){if(t instanceof fg){hh(this.prevPathX,this.prevPathY,t.toX,t.toY,t.largeArcFlag,t.sweepFlag,t.rx,t.ry,t.xAxisRotate).forEach(h=>{const[u,l,d,f,p,w,b,x]=h;this.normalizedLines.push(new Pe({x:this.prevPathX,y:this.prevPathY,c1x:d,c1y:f,c2x:p,c2y:w,toX:b,toY:x})),this.prevPathX=b,this.prevPathY=x});return}let e,n,i,r,o,a;t instanceof Pe?(e=t.c1x,n=t.c1y,i=t.c2x,r=t.c2y,o=t.toX,a=t.toY):t instanceof dg?[e,n,i,r,o,a]=kr(this.prevPathX,this.prevPathY,t.cx,t.cy,t.toX,t.toY):[e,n,i,r,o,a]=zn(this.prevPathX,this.prevPathY,t.toX,t.toY),this.normalizedLines.push(new Pe({x:this.prevPathX,y:this.prevPathY,c1x:e,c1y:n,c2x:i,c2y:r,toX:o,toY:a})),this.prevPathX=o,this.prevPathY=a}toSVGPathData(){const{startPathX:t,startPathY:e,normalizedLines:n}=this.updateTransform(),i=[];i.push(["M",t,e]);for(let r=0,o=n.length;r<o;r++)i.push(...n[r].toSVGPathData());return i}toSVGPathD(){return Xe.SVGPathDataToD(this.toSVGPathData())}toCanvasContext(t){const{startPathX:e,startPathY:n,normalizedLines:i}=this.updateTransform();t.beginPath(),t.moveTo(e,n),i.forEach(r=>{r.toCanvasContext(t)})}getBoundingClientRect(){const{normalizedLines:t}=this.updateTransform(),e=[],n=[];if(t.forEach(c=>{const h=c.getBoundingClientRect();e.push(h.x,h.x+h.width),n.push(h.y,h.y+h.height)}),e.length==0||n.length==0)return{x:0,y:0,width:0,height:0};const i=Math.min.apply(0,e),r=Math.min.apply(0,n),o=Math.max.apply(0,e),a=Math.max.apply(0,n);return{x:i,y:r,width:o-i,height:a-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 _t;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,n=this.startPathY;({x:e,y:n}=t.transformPoint({x:e,y:n}));const i=[];return this.normalizedLines.forEach(r=>{let o=r.x,a=r.y,c=r.c1x,h=r.c1y,u=r.c2x,l=r.c2y,d=r.toX,f=r.toY;({x:o,y:a}=t.transformPoint({x:o,y:a})),{x:c,y:h}=t.transformPoint({x:c,y:h}),{x:u,y:l}=t.transformPoint({x:u,y:l}),{x:d,y:f}=t.transformPoint({x:d,y:f}),i.push(new Pe({x:o,y:a,c1x:c,c1y:h,c2x:u,c2y:l,toX:d,toY:f}))}),{startPathX:e,startPathY:n,normalizedLines:i}}}getTotalLength(){const{normalizedLines:t}=this.updateTransform();return t.reduce((e,n)=>e+=n.length(),0)}getPointAtLength(t){const{normalizedLines:e}=this.updateTransform();let n=0;const i=e.length;for(let r=0;r<i;r++){const o=e[r],a=o.length();if(n+a>=t)return o.getPointAtSegmentLength(t-n);n+=a}return e[i-1].getPointAtSegmentLength(1)}interpolate(t){const{startPathX:e,startPathY:n,normalizedLines:i}=this.updateTransform(),r=i.length;if(r===0)return{x:e,y:n};if(r===1)return i[0].interpolate(t);{let o=t*r,a=i[0];if(o--,o>1)for(let c=1;c<r&&(a=i[c],o>1);c++)o-=1;return a.interpolate(o)}}getSubpath(t,e){if(this.getTotalLength()-e<1e-6)return this.getSubpathsAtLength(this,t);{const n=this.getSubpathsAtLength(this,e,1);return t?this.getSubpathsAtLength(n,t):n}}getSubpathsAtLength(t,e,n){const{startPathX:i,startPathY:r,normalizedLines:o}=t.updateTransform();let a=null,c=0;const h=new xe;h.prevPathX=h.startPathX=i,h.prevPathY=h.startPathY=r;for(let u=0,l=o.length;u<l;u++){const d=o[u],f=d.length();if(c+f>e&&!a){const p=d.getPointAtSegmentLength(e-c);if(h.appendLine(new Pe({c1x:p.start.x,c1y:p.start.y,c2x:p.m.x,c2y:p.m.y,toX:p.x,toY:p.y})),n)return h;a=h,h.appendLine(new Pe({c1x:p.n.x,c1y:p.n.y,c2x:p.end.x,c2y:p.end.y,toX:d.x,toY:d.y})),c+=f;continue}c+=f,h.appendLine(d)}return h}closestPoint(t,e){const n=this.getTotalLength();let i={x:t,y:e},r=0,o=1/0,a=8;for(let h=0;h<=n;h+=a){const u=this.getPointAtLength(h),l=Math.pow(Ee(u.x,u.y,t,e),2);l<o&&(i=u,r=h,o=l)}for(a/=2;a>.5;){const h=r-a,u=this.getPointAtLength(h),l=Math.pow(Ee(u.x,u.y,t,e),2),d=r+a,f=this.getPointAtLength(d),p=Math.pow(Ee(f.x,f.y,t,e),2);h>=0&&l<o?(i=u,r=h,o=l):d<=n&&p<o?(i=f,r=d,o=p):a/=2}const c=this.getPointAtLength(r+(r===n?-.1:.1));return{point:i,rotation:r>=n?Qt(c.x,c.y,i.x,i.y):Qt(i.x,i.y,c.x,c.y),distance:Math.sqrt(o)}}get polymorphPoints(){const{startPathX:t,startPathY:e,normalizedLines:n}=this.updateTransform();return[t,e].concat(n.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 n=t[e-2],i=t[e-1],r=0;for(let o=0;o<e;o+=6)r+=Ee(t[o],t[o+1],n,i),n=t[o],i=t[o+1];return Math.floor(r)}expendFill(t){const e=this.polymorphPoints,n=e.length;let i=t-n;const r=Math.ceil(t/n),o=[];o.push(["M",e[0],e[1]]);let a=2;for(;a+5<=n-1;){const c=e[a++],h=e[a++],u=e[a++],l=e[a++],d=e[a++],f=e[a++];o.push(["C",c,h,u,l,d,f]);let p=0;for(;p<r&&i>0;)o.push(["C",d,f,d,f,d,f]),i-=6,p++}return o}static mixPoints(t,e,n){const i=t.length,r=new Array(i);for(let o=0;o<i;o++)r[o]=Q(t[o]+(e[o]-t[o])*n,6);return r}static getPathInterpolator(t,e){return n=>Math.abs(n-0)<Number.EPSILON?t:Math.abs(n-1)<Number.EPSILON?e:xe.fromPolymorphPoints(xe.mixPoints(new xe({d:t}).polymorphPoints,new xe({d:e}).polymorphPoints,n)).toSVGPathData()}},yg=class extends ls{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=rs(),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 n=this.getAttr("stroke-dasharray","4 4");this.setAttr("stroke-dasharray",n),this.strokeDashTotalLength=wi(n).reduce((i,r)=>i+r,0)}return Ma(this)}forceSetCXY(t,e){this.cX=t,this.cY=e,this.forceCXY=!0}shapeInit(){}initPathD(){if(!this.pathd){if(this.pathd=new gg,Wt(()=>{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(n=>{const i=n.originMatrix?n.originMatrix.clone():new _t;i.translate(-t.x+n.x,-t.y+n.y),n.originMatrix=i});const e=this.originMatrix?this.originMatrix.clone():new _t;e.translate(-t.x+this.x,-t.y+this.y),this.originMatrix=e}isPointInPath(t,e,n){if(n instanceof Mr)return n.isPointInPath(new Path2D(this.toSVGPathD()),t,e);let i;try{i=new SVGPoint(t,e)}catch{i=n.createSVGPoint(),i.x=t,i.y=e}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,n){if(n instanceof Mr)return n.isPointInStroke(new Path2D(this.toSVGPathD()),t,e);let i;try{i=new SVGPoint(t,e)}catch{i=n.createSVGPoint(),i.x=t,i.y=e}return this.el instanceof SVGGeometryElement?this.el.isPointInStroke(i):!1}clone(){return la(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(([n,i])=>[xt(n),i]))):e&&(this.attrs[xt(t)]=e)}getAttr(t,e){return this.attrs[t]||this.attrs[xt(t)]||e}getAttrs(){return this.attrs}hasAttr(t){return!!this.attrs[t]||!!this.attrs[xt(t)]}distance(t){return Ee(this.x,this.y,t.x,t.y)}rotateTo(t){this.degree=Pt(Qt(this.x,this.y,t.x,t.y))}followTo(t,e=3){this.rotateTo(t);const{dx:n,dy:i}=hn(J(this.degree),e);this.vx=n,this.vy=i,this.run()}followAccelerationTo(t,e=.05){this.rotateTo(t);const{dx:n,dy:i}=hn(J(this.degree),e);this.ax=n,this.ay=i,this.run()}checkCollision(t){}checkWall(t){}gravitateTo(t){const e=t.x-this.x,n=t.y-this.y,i=e*e+n*n,r=Math.sqrt(i),o=this.mass*t.mass/i,a=o*e/r,c=o*n/r;this.vx+=a/this.mass,this.vy+=c/this.mass,t.vx-=a/t.mass,t.vy-=c/t.mass}run(t){this.vx+=this.ax,this.vy+=this.ay;const e=Ht(t?.gravity,0);this.vy+=e;const n=Ht(t?.friction,1);this.vx*=n,this.vy*=n,this.x+=this.vx,this.y+=this.vy}runEaseTo(t,e){const n=Ht(e?.easing,.05),i=t.x-this.cX-this.x,r=t.y-this.cY-this.y;this.vx=i*n,this.vy=r*n,this.run(e)}runSpringTo(t,e){const n=Ht(e?.spring,.03);(Array.isArray(t)?t:[t]).forEach(i=>{const r=i.x-this.cX-this.x,o=i.y-this.cY-this.y,a=r*n,c=o*n;this.vx+=a,this.vy+=c}),this.run({friction:.9,...e})}springMassTo(t,e){const n=Ht(e?.springLength,100),i=Ht(e?.spring,1e-4),r=t.x-this.x,o=t.y-this.y,a=Math.sqrt(r*r+o*o);if(a<n){const c=r*i,h=o*i;return this.vx+=c/this.mass,this.vy+=h/this.mass,t.vx-=c/t.mass,t.vy-=h/t.mass,1-a/n}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 n=this.getTotalLength();return t.originD=this.initPathD().getSubpath(0,e*n),this.getPointAtLength(e*n)}strokeDashTween(t=1e3,e){const n=this.initPathD(),i=Q(n.getTotalLength(),0);this.setAttr({strokeDasharray:`${i} ${i}`,strokeDashoffset:`${i}`});const r=e?.onUpdate,o=new Rn({frameDuration:t});o.addTween({offset:i},{offset:0},Object.assign(e||{},{onUpdate:(a,c)=>{this.setAttr("strokeDashoffset",""+Q(a.offset,2)),r?.(a,c)}})),o.play()}};class wg extends yg{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,n){this.cX=t,this.cY=e,this.cZ=n}rotateX(t){({x:this.y,y:this.z}=te(J(t),this.y,this.z))}rotateY(t){({x:this.x,y:this.z}=te(J(t),this.x,this.z))}rotateZ(t){({x:this.x,y:this.y}=te(J(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 cn(this.x,this.y,this.z)}distance(t){const e=t.x-this.x,n=t.y-this.y,i=t.z-this.z;return Math.sqrt(e*e+n*n+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 n=t/e;this.scalar(n)}return this}clamp(t){const e=this.length();return e&&e>t&&this.scalar(t/e),this}cross(t){const e=this.x,n=this.y,i=this.z;return{x:n*t.z-i*t.y,y:i*t.x-e*t.z,z:e*t.y-n*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 Fs=wg;class Ir{_x;_y;_z;_w;constructor(t=0,e=0,n=0,i=1){this._x=t,this._y=e,this._z=n,this._w=i}static slerpFlat(t,e,n,i,r,o,a){let c=n[i+0],h=n[i+1],u=n[i+2],l=n[i+3];const d=r[o+0],f=r[o+1],p=r[o+2],w=r[o+3];if(a===0){t[e+0]=c,t[e+1]=h,t[e+2]=u,t[e+3]=l;return}if(a===1){t[e+0]=d,t[e+1]=f,t[e+2]=p,t[e+3]=w;return}if(l!==w||c!==d||h!==f||u!==p){let b=1-a;const x=c*d+h*f+u*p+l*w,g=x>=0?1:-1,v=1-x*x;if(v>Number.EPSILON){const E=Math.sqrt(v),C=Math.atan2(E,x*g);b=Math.sin(b*C)/E,a=Math.sin(a*C)/E}const _=a*g;if(c=c*b+d*_,h=h*b+f*_,u=u*b+p*_,l=l*b+w*_,b===1-a){const E=1/Math.sqrt(c*c+h*h+u*u+l*l);c*=E,h*=E,u*=E,l*=E}}t[e]=c,t[e+1]=h,t[e+2]=u,t[e+3]=l}static multiplyQuaternionsFlat(t,e,n,i,r,o){const a=n[i],c=n[i+1],h=n[i+2],u=n[i+3],l=r[o],d=r[o+1],f=r[o+2],p=r[o+3];return t[e]=a*p+u*l+c*f-h*d,t[e+1]=c*p+u*d+h*l-a*f,t[e+2]=h*p+u*f+a*d-c*l,t[e+3]=u*p-a*l-c*d-h*f,t}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get w(){return this._w}set w(t){this._w=t,this._onChangeCallback()}set(t=this._x,e=this._y,n=this._z,i=this._w){return this._x=t,this._y=e,this._z=n,this._w=i,this._onChangeCallback(),this}clone(){return new Ir(this._x,this._y,this._z,this._w)}copy(t){return this._x=t.x,this._y=t.y,this._z=t.z,this._w=t.w,this._onChangeCallback(),this}setFromEuler(t,e=!0){const n=t.x,i=t.y,r=t.z,o=t.order,a=Math.cos,c=Math.sin,h=a(n/2),u=a(i/2),l=a(r/2),d=c(n/2),f=c(i/2),p=c(r/2);switch(o){case"XYZ":this._x=d*u*l+h*f*p,this._y=h*f*l-d*u*p,this._z=h*u*p+d*f*l,this._w=h*u*l-d*f*p;break;case"YXZ":this._x=d*u*l+h*f*p,this._y=h*f*l-d*u*p,this._z=h*u*p-d*f*l,this._w=h*u*l+d*f*p;break;case"ZXY":this._x=d*u*l-h*f*p,this._y=h*f*l+d*u*p,this._z=h*u*p+d*f*l,this._w=h*u*l-d*f*p;break;case"ZYX":this._x=d*u*l-h*f*p,this._y=h*f*l+d*u*p,this._z=h*u*p-d*f*l,this._w=h*u*l+d*f*p;break;case"YZX":this._x=d*u*l+h*f*p,this._y=h*f*l+d*u*p,this._z=h*u*p-d*f*l,this._w=h*u*l-d*f*p;break;case"XZY":this._x=d*u*l-h*f*p,this._y=h*f*l-d*u*p,this._z=h*u*p+d*f*l,this._w=h*u*l+d*f*p;break;default:console.warn("Quaternion: .setFromEuler() encountered an unknown order: "+o)}return e===!0&&this._onChangeCallback(),this}setFromAxisAngle(t,e){const n=e/2,i=Math.sin(n);return this._x=t.x*i,this._y=t.y*i,this._z=t.z*i,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix4(t){const e=t.value,n=e[0],i=e[4],r=e[8],o=e[1],a=e[5],c=e[9],h=e[2],u=e[6],l=e[10],d=n+a+l;if(d>0){const f=.5/Math.sqrt(d+1);this._w=.25/f,this._x=(u-c)*f,this._y=(r-h)*f,this._z=(o-i)*f}else if(n>a&&n>l){const f=2*Math.sqrt(1+n-a-l);this._w=(u-c)/f,this._x=.25*f,this._y=(i+o)/f,this._z=(r+h)/f}else if(a>l){const f=2*Math.sqrt(1+a-n-l);this._w=(r-h)/f,this._x=(i+o)/f,this._y=.25*f,this._z=(c+u)/f}else{const f=2*Math.sqrt(1+l-n-a);this._w=(o-i)/f,this._x=(r+h)/f,this._y=(c+u)/f,this._z=.25*f}return this._onChangeCallback(),this}setFromUnitVectors(t,e){let n=t.dot(e)+1;return n<Number.EPSILON?(n=0,Math.abs(t.x)>Math.abs(t.z)?(this._x=-t.y,this._y=t.x,this._z=0,this._w=n):(this._x=0,this._y=-t.z,this._z=t.y,this._w=n)):(this._x=t.y*e.z-t.z*e.y,this._y=t.z*e.x-t.x*e.z,this._z=t.x*e.y-t.y*e.x,this._w=n),this.normalize()}angleTo(t){return 2*Math.acos(Math.abs(B(this.dot(t),-1,1)))}rotateTowards(t,e){const n=this.angleTo(t);if(n===0)return this;const i=Math.min(1,e/n);return this.slerp(t,i),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(t){return this._x*t._x+this._y*t._y+this._z*t._z+this._w*t._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let t=this.length();return t===0?(this._x=0,this._y=0,this._z=0,this._w=1):(t=1/t,this._x=this._x*t,this._y=this._y*t,this._z=this._z*t,this._w=this._w*t),this._onChangeCallback(),this}multiply(t){return this.multiplyQuaternions(this,t)}premultiply(t){return this.multiplyQuaternions(t,this)}multiplyQuaternions(t,e){const n=t._x,i=t._y,r=t._z,o=t._w,a=e._x,c=e._y,h=e._z,u=e._w;return this._x=n*u+o*a+i*h-r*c,this._y=i*u+o*c+r*a-n*h,this._z=r*u+o*h+n*c-i*a,this._w=o*u-n*a-i*c-r*h,this._onChangeCallback(),this}slerp(t,e){if(e===0)return this;if(e===1)return this.copy(t);const n=this._x,i=this._y,r=this._z,o=this._w;let a=o*t._w+n*t._x+i*t._y+r*t._z;if(a<0?(this._w=-t._w,this._x=-t._x,this._y=-t._y,this._z=-t._z,a=-a):this.copy(t),a>=1)return this._w=o,this._x=n,this._y=i,this._z=r,this;const c=1-a*a;if(c<=Number.EPSILON){const f=1-e;return this._w=f*o+e*this._w,this._x=f*n+e*this._x,this._y=f*i+e*this._y,this._z=f*r+e*this._z,this.normalize(),this}const h=Math.sqrt(c),u=Math.atan2(h,a),l=Math.sin((1-e)*u)/h,d=Math.sin(e*u)/h;return this._w=o*l+this._w*d,this._x=n*l+this._x*d,this._y=i*l+this._y*d,this._z=r*l+this._z*d,this._onChangeCallback(),this}slerpQuaternions(t,e,n){return this.copy(t).slerp(e,n)}random(){const t=2*Math.PI*Math.random(),e=2*Math.PI*Math.random(),n=Math.random(),i=Math.sqrt(1-n),r=Math.sqrt(n);return this.set(i*Math.sin(t),i*Math.cos(t),r*Math.sin(e),r*Math.cos(e))}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._w===this._w}fromArray(t,e=0){return this._x=t[e],this._y=t[e+1],this._z=t[e+2],this._w=t[e+3],this._onChangeCallback(),this}toArray(t=[],e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._w,t}fromBufferAttribute(t,e){return this._x=t.getX(e),this._y=t.getY(e),this._z=t.getZ(e),this._w=t.getW(e),this._onChangeCallback(),this}toJSON(){return this.toArray()}onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class Bn{x=0;y=0;constructor(t=0,e=0){this.x=t,this.y=e}get width(){return this.x}set width(t){this.x=t}get height(){return this.y}set height(t){this.y=t}set(t=0,e=0){return this.x=t,this.y=e,this}setScalar(t){return this.x=t,this.y=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+t)}}copy(t){return this.x=t.x,this.y=t.y,this}clone(){return new Bn(this.x,this.y)}add(t){return this.x+=t.x,this.y+=t.y,this}addScalar(t){return this.x+=t,this.y+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this}subScalar(t){return this.x-=t,this.y-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this}multiply(t){return this.x*=t.x,this.y*=t.y,this}multiplyScalar(t){return this.x*=t,this.y*=t,this}divide(t){return this.x/=t.x,this.y/=t.y,this}divideScalar(t){return this.multiplyScalar(1/t)}applyMatrix3(t){const e=this.x,n=this.y;return this.x=t.m11*e+t.m21*n+t.m31,this.y=t.m12*e+t.m22*n+t.m32,this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this}clamp(t,e){return this.x=B(this.x,t.x,e.x),this.y=B(this.y,t.y,e.y),this}clampScalar(t,e){return this.x=B(this.x,t,e),this.y=B(this.y,t,e),this}clampLength(t,e){const n=this.length();return this.divideScalar(n||1).multiplyScalar(B(n,t,e))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(t){return this.x*t.x+this.y*t.y}cross(t){return this.x*t.y-this.y*t.x}projectOnVector(t){const e=t.lengthSq();if(e===0)return this.set(0,0);const n=t.dot(this)/e;return this.copy(t).multiplyScalar(n)}perpendOnVector(t){return uh.copy(this).projectOnVector(t),this.sub(uh)}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}lengthSq(){return this.x*this.x+this.y*this.y}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(t){const e=Math.sqrt(this.lengthSq()*t.lengthSq());if(e===0)return Math.PI/2;const n=this.dot(t)/e;return Math.acos(B(n,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,n=this.y-t.y;return e*e+n*n}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this}lerpVectors(t,e,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this}equals(t){return t.x===this.x&&t.y===this.y}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this}rotateAround(t,e){const n=Math.cos(e),i=Math.sin(e),r=this.x-t.x,o=this.y-t.y;return this.x=r*n-o*i+t.x,this.y=r*i+o*n+t.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class Bt{x=0;y=0;z=0;constructor(t=0,e=0,n=0){this.x=t,this.y=e,this.z=n}set(t=0,e=0,n=0){return this.x=t,this.y=e,this.z=n,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+t)}}clone(){return new Bt(this.x,this.y,this.z)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this}multiplyVectors(t,e){return this.x=t.x*e.x,this.y=t.y*e.y,this.z=t.z*e.z,this}applyEuler(t){return this.applyQuaternion(lh.setFromEuler(t))}applyAxisAngle(t,e){return this.applyQuaternion(lh.setFromAxisAngle(t,e))}applyMatrix3(t){const e=this.x,n=this.y,i=this.z,r=t.value;return this.x=r[0]*e+r[3]*n+r[6]*i,this.y=r[1]*e+r[4]*n+r[7]*i,this.z=r[2]*e+r[5]*n+r[8]*i,this}applyNormalMatrix(t){return this.applyMatrix3(t).normalize()}applyMatrix4(t){const e=this.x,n=this.y,i=this.z,r=t.value,o=1/(r[3]*e+r[7]*n+r[11]*i+r[15]);return this.x=(r[0]*e+r[4]*n+r[8]*i+r[12])*o,this.y=(r[1]*e+r[5]*n+r[9]*i+r[13])*o,this.z=(r[2]*e+r[6]*n+r[10]*i+r[14])*o,this}applyQuaternion(t){const e=this.x,n=this.y,i=this.z,r=t.x,o=t.y,a=t.z,c=t.w,h=2*(o*i-a*n),u=2*(a*e-r*i),l=2*(r*n-o*e);return this.x=e+c*h+o*l-a*u,this.y=n+c*u+a*h-r*l,this.z=i+c*l+r*u-o*h,this}transformDirection(t){const e=this.x,n=this.y,i=this.z,r=t.value;return this.x=r[0]*e+r[4]*n+r[8]*i,this.y=r[1]*e+r[5]*n+r[9]*i,this.z=r[2]*e+r[6]*n+r[10]*i,this.normalize()}divide(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this}divideScalar(t){return this.multiplyScalar(1/t)}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this}clamp(t,e){return this.x=B(this.x,t.x,e.x),this.y=B(this.y,t.y,e.y),this.z=B(this.z,t.z,e.z),this}clampScalar(t,e){return this.x=B(this.x,t,e),this.y=B(this.y,t,e),this.z=B(this.z,t,e),this}clampLength(t,e){const n=this.length();return this.divideScalar(n||1).multiplyScalar(B(n,t,e))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this}lerpVectors(t,e,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this.z=t.z+(e.z-t.z)*n,this}cross(t){return this.crossVectors(this,t)}crossVectors(t,e){const n=t.x,i=t.y,r=t.z,o=e.x,a=e.y,c=e.z;return this.x=i*c-r*a,this.y=r*o-n*c,this.z=n*a-i*o,this}projectOnVector(t){const e=t.lengthSq();if(e===0)return this.set(0,0,0);const n=t.dot(this)/e;return this.copy(t).multiplyScalar(n)}perpendOnVector(t){return Rr.copy(this).projectOnVector(t),this.sub(Rr)}projectOnPlane(t){return this.perpendOnVector(t)}reflect(t){return this.sub(Rr.copy(t).multiplyScalar(2*this.dot(t)))}angleTo(t){const e=Math.sqrt(this.lengthSq()*t.lengthSq());if(e===0)return Math.PI/2;const n=this.dot(t)/e;return Math.acos(B(n,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,n=this.y-t.y,i=this.z-t.z;return e*e+n*n+i*i}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)+Math.abs(this.z-t.z)}setFromMatrix4Position(t){const e=t.value;return this.x=e[12],this.y=e[13],this.z=e[14],this}setFromMatrix4Scale(t){const e=this.setFromMatrix4Column(t,0).length(),n=this.setFromMatrix4Column(t,1).length(),i=this.setFromMatrix4Column(t,2).length();return this.x=e,this.y=n,this.z=i,this}setFromMatrix4Column(t,e){return this.fromArray(t.value,e*4)}setFromMatrix3Column(t,e){return this.fromArray(t.value,e*3)}setFromEuler(t){return this.x=t.x,this.y=t.y,this.z=t.z,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const t=Math.random()*Math.PI*2,e=Math.random()*2-1,n=Math.sqrt(1-e*e);return this.x=n*Math.cos(t),this.y=e,this.z=n*Math.sin(t),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}class Dr{x=0;y=0;z=0;w=1;constructor(t=0,e=0,n=0,i=1){this.x=t,this.y=e,this.z=n,this.w=i}get width(){return this.z}set width(t){this.z=t}get height(){return this.w}set height(t){this.w=t}set(t=0,e=0,n=0,i=1){return this.x=t,this.y=e,this.z=n,this.w=i,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this.w=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setW(t){return this.w=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;case 3:this.w=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+t)}}clone(){return new Dr(this.x,this.y,this.z,this.w)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=t.w,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this.w+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this.w=t.w+e.w,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this.w+=t.w*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this.w-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this.w=t.w-e.w,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this.w*=t.w,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this}applyMatrix4(t){const e=this.x,n=this.y,i=this.z,r=this.w,o=t.value;return this.x=o[0]*e+o[4]*n+o[8]*i+o[12]*r,this.y=o[1]*e+o[5]*n+o[9]*i+o[13]*r,this.z=o[2]*e+o[6]*n+o[10]*i+o[14]*r,this.w=o[3]*e+o[7]*n+o[11]*i+o[15]*r,this}divide(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this.w/=t.w,this}divideScalar(t){return this.multiplyScalar(1/t)}setAxisAngleFromQuaternion(t){this.w=2*Math.acos(t.w);const e=Math.sqrt(1-t.w*t.w);return e<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=t.x/e,this.y=t.y/e,this.z=t.z/e),this}setAxisAngleFromRotationMatrix4(t){let e,n,i,r;const c=t.value,h=c[0],u=c[4],l=c[8],d=c[1],f=c[5],p=c[9],w=c[2],b=c[6],x=c[10];if(Math.abs(u-d)<.01&&Math.abs(l-w)<.01&&Math.abs(p-b)<.01){if(Math.abs(u+d)<.1&&Math.abs(l+w)<.1&&Math.abs(p+b)<.1&&Math.abs(h+f+x-3)<.1)return this.set(1,0,0,0),this;e=Math.PI;const v=(h+1)/2,_=(f+1)/2,E=(x+1)/2,C=(u+d)/4,I=(l+w)/4,F=(p+b)/4;return v>_&&v>E?v<.01?(n=0,i=.707106781,r=.707106781):(n=Math.sqrt(v),i=C/n,r=I/n):_>E?_<.01?(n=.707106781,i=0,r=.707106781):(i=Math.sqrt(_),n=C/i,r=F/i):E<.01?(n=.707106781,i=.707106781,r=0):(r=Math.sqrt(E),n=I/r,i=F/r),this.set(n,i,r,e),this}let g=Math.sqrt((b-p)*(b-p)+(l-w)*(l-w)+(d-u)*(d-u));return Math.abs(g)<.001&&(g=1),this.x=(b-p)/g,this.y=(l-w)/g,this.z=(d-u)/g,this.w=Math.acos((h+f+x-1)/2),this}setFromMatrix4Position(t){const e=t.value;return this.x=e[12],this.y=e[13],this.z=e[14],this.w=e[15],this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this.w=Math.min(this.w,t.w),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this.w=Math.max(this.w,t.w),this}clamp(t,e){return this.x=B(this.x,t.x,e.x),this.y=B(this.y,t.y,e.y),this.z=B(this.z,t.z,e.z),this.w=B(this.w,t.w,e.w),this}clampScalar(t,e){return this.x=B(this.x,t,e),this.y=B(this.y,t,e),this.z=B(this.z,t,e),this.w=B(this.w,t,e),this}clampLength(t,e){const n=this.length();return this.divideScalar(n||1).multiplyScalar(B(n,t,e))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}projectOnVector(t){const e=t.lengthSq();if(e===0)return this.set(0,0,0,1);const n=t.dot(this)/e;return this.copy(t).multiplyScalar(n)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this.w+=(t.w-this.w)*e,this}lerpVectors(t,e,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this.z=t.z+(e.z-t.z)*n,this.w=t.w+(e.w-t.w)*n,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z&&t.w===this.w}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this.w=t[e+3],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t[e+3]=this.w,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this.w=t.getW(e),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}const uh=new Bn,Rr=new Bt,lh=new Ir,Nn=2e3,Lr=2001,fh=[1,0,0,1],dh=[1,0,0,1,0,0],mh=[1,0,0,0,1,0,0,0,1],ph=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];class Or{value;constructor(t=fh){this.value=Array.from(t)}get m11(){return this.value[0]}get m12(){return this.value[1]}get m21(){return this.value[2]}get m22(){return this.value[3]}set m11(t){this.value[0]=t}set m12(t){this.value[1]=t}set m21(t){this.value[2]=t}set m22(t){this.value[3]=t}set(t=1,e=0,n=0,i=1){return this.m11=t,this.m21=e,this.m12=n,this.m22=i,this}identity(){return this.value=Array.from(fh),this}get isIdentity(){return this.m11==1&&this.m12==0&&this.m21==0&&this.m22==1}copy(t){return this.m11=t.m11,this.m12=t.m12,this.m21=t.m21,this.m22=t.m22,this}clone(){return new Or(this.value)}fromArray(t,e=0){for(let n=0;n<4;n++)this.value[n]=t[n+e];return this}toArray(t=[],e=0){return t[e]=this.m11,t[e+1]=this.m12,t[e+2]=this.m21,t[e+3]=this.m22,t}multiplyMatrices(t,e){const n=t.value,i=e.value,r=this.value,o=n[0],a=n[2],c=n[1],h=n[3],u=i[0],l=i[2],d=i[1],f=i[3];return r[0]=o*u+a*d,r[2]=o*l+a*f,r[1]=c*u+h*d,r[3]=c*l+h*f,this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyScalar(t){return this.m11*=t,this.m12*=t,this.m21*=t,this.m22*=t,this}determinant(){return this.m11*this.m22-this.m21*this.m12}}class un{value;constructor(t=mh){this.value=Array.from(t)}get m11(){return this.value[0]}get m12(){return this.value[1]}get m13(){return this.value[2]}get m21(){return this.value[3]}get m22(){return this.value[4]}get m23(){return this.value[5]}get m31(){return this.value[6]}get m32(){return this.value[7]}get m33(){return this.value[8]}set m11(t){this.value[0]=t}set m12(t){this.value[1]=t}set m13(t){this.value[2]=t}set m21(t){this.value[3]=t}set m22(t){this.value[4]=t}set m23(t){this.value[5]=t}set m31(t){this.value[6]=t}set m32(t){this.value[7]=t}set m33(t){this.value[8]=t}set(t=1,e=0,n=0,i=0,r=1,o=0,a=0,c=0,h=1){const u=this.value;return u[0]=t,u[1]=i,u[2]=a,u[3]=e,u[4]=r,u[5]=c,u[6]=n,u[7]=o,u[8]=h,this}identity(){return this.value=Array.from(mh),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}copy(t){return this.m11=t.m11,this.m12=t.m12,this.m13=t.m13,this.m21=t.m21,this.m22=t.m22,this.m23=t.m23,this.m31=t.m31,this.m32=t.m32,this.m33=t.m33,this}clone(){return new un(this.value)}fromArray(t,e=0){for(let n=0;n<9;n++)this.value[n]=t[n+e];return this}toArray(t=[],e=0){return t[e]=this.m11,t[e+1]=this.m12,t[e+2]=this.m13,t[e+3]=this.m21,t[e+4]=this.m22,t[e+5]=this.m23,t[e+6]=this.m31,t[e+7]=this.m32,t[e+8]=this.m33,t}extractBasis(t,e,n){return t.setFromMatrix3Column(this,0),e.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}setFromMatrix4(t){return this.set(t.m11,t.m21,t.m31,t.m12,t.m22,t.m32,t.m13,t.m23,t.m33),this}multiplyMatrices(t,e){const n=t.value,i=e.value,r=this.value,o=n[0],a=n[3],c=n[6],h=n[1],u=n[4],l=n[7],d=n[2],f=n[5],p=n[8],w=i[0],b=i[3],x=i[6],g=i[1],v=i[4],_=i[7],E=i[2],C=i[5],I=i[8];return r[0]=o*w+a*g+c*E,r[3]=o*b+a*v+c*C,r[6]=o*x+a*_+c*I,r[1]=h*w+u*g+l*E,r[4]=h*b+u*v+l*C,r[7]=h*x+u*_+l*I,r[2]=d*w+f*g+p*E,r[5]=d*b+f*v+p*C,r[8]=d*x+f*_+p*I,this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyScalar(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}determinant(){const t=this.value,e=t[0],n=t[1],i=t[2],r=t[3],o=t[4],a=t[5],c=t[6],h=t[7],u=t[8];return e*o*u-e*a*h-n*r*u+n*a*c+i*r*h-i*o*c}invert(){const t=this.value,e=t[0],n=t[1],i=t[2],r=t[3],o=t[4],a=t[5],c=t[6],h=t[7],u=t[8],l=u*o-a*h,d=a*c-u*r,f=h*r-o*c,p=e*l+n*d+i*f;if(p===0)return this.set(0,0,0,0,0,0,0,0,0);const w=1/p;return t[0]=l*w,t[1]=(i*h-u*n)*w,t[2]=(a*n-i*o)*w,t[3]=d*w,t[4]=(u*e-i*c)*w,t[5]=(i*r-a*e)*w,t[6]=f*w,t[7]=(n*c-h*e)*w,t[8]=(o*e-n*r)*w,this}transpose(){let t;const e=this.value;return t=e[1],e[1]=e[3],e[3]=t,t=e[2],e[2]=e[6],e[6]=t,t=e[5],e[5]=e[7],e[7]=t,this}getNormalMatrix(t){return this.setFromMatrix4(t).invert().transpose()}transposeIntoArray(t){const e=this.value;return t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],this}setUvTransform(t,e,n,i,r,o,a){const c=Math.cos(r),h=Math.sin(r);return this.set(n*c,n*h,-n*(c*o+h*a)+o+t,-i*h,i*c,-i*(-h*o+c*a)+a+e,0,0,1),this}scale(t,e){return this.premultiply(zr.makeScale(t,e)),this}rotate(t){return this.premultiply(zr.makeRotation(-t)),this}translate(t,e){return this.premultiply(zr.makeTranslation(t,e)),this}makeTranslation(t,e){return typeof t=="number"?this.set(1,0,t,0,1,e,0,0,1):this.set(1,0,t.x,0,1,t.y,0,0,1),this}makeRotation(t){const e=Math.cos(t),n=Math.sin(t);return this.set(e,-n,0,n,e,0,0,0,1),this}makeScale(t,e){return this.set(t,0,0,0,e,0,0,0,1),this}equals(t){for(let e=0;e<9;e++)if(this.value[e]!==t.value[e])return!1;return!0}}class Rt{value;is3dSpecial=!1;constructor(t=ph){this.value=Array.from(t)}get m11(){return this.value[0]}get m12(){return this.value[1]}get m13(){return this.value[2]}get m14(){return this.value[3]}get m21(){return this.value[4]}get m22(){return this.value[5]}get m23(){return this.value[6]}get m24(){return this.value[7]}get m31(){return this.value[8]}get m32(){return this.value[9]}get m33(){return this.value[10]}get m34(){return this.value[11]}get m41(){return this.value[12]}get m42(){return this.value[13]}get m43(){return this.value[14]}get m44(){return this.value[15]}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}set(t=1,e=0,n=0,i=0,r=0,o=1,a=0,c=0,h=0,u=0,l=1,d=0,f=0,p=0,w=0,b=1){const x=this.value;return x[0]=t,x[4]=e,x[8]=n,x[12]=i,x[1]=r,x[5]=o,x[9]=a,x[13]=c,x[2]=h,x[6]=u,x[10]=l,x[14]=d,x[3]=f,x[7]=p,x[11]=w,x[15]=b,this}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(ph),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}copy(t){return this.m11=t.m11,this.m12=t.m12,this.m13=t.m13,this.m14=t.m14,this.m21=t.m21,this.m22=t.m22,this.m23=t.m23,this.m24=t.m24,this.m31=t.m31,this.m32=t.m32,this.m33=t.m33,this.m34=t.m34,this.m41=t.m41,this.m42=t.m42,this.m43=t.m43,this.m44=t.m44,this}clone(){return new Rt(this.value)}static fromString(t){const e=new Rt,n=ia("number",t);return n.length===16&&n.forEach((i,r)=>{i.fullMatch&&(e.value[r]=parseFloat(i.fullMatch))}),e}fromArray(t,e=0){for(let n=0;n<16;n++)this.value[n]=t[n+e];return this}toArray(t=[],e=0){const n=this.value;return t[e]=n[0],t[e+1]=n[1],t[e+2]=n[2],t[e+3]=n[3],t[e+4]=n[4],t[e+5]=n[5],t[e+6]=n[6],t[e+7]=n[7],t[e+8]=n[8],t[e+9]=n[9],t[e+10]=n[10],t[e+11]=n[11],t[e+12]=n[12],t[e+13]=n[13],t[e+14]=n[14],t[e+15]=n[15],t}copyPosition(t){const e=this.value,n=t.value;return e[12]=n[12],e[13]=n[13],e[14]=n[14],this}setFromMatrix3(t){const e=t.value;return this.set(e[0],e[3],e[6],0,e[1],e[4],e[7],0,e[2],e[5],e[8],0,0,0,0,1),this}extractBasis(t,e,n){return t.setFromMatrix4Column(this,0),e.setFromMatrix4Column(this,1),n.setFromMatrix4Column(this,2),this}makeBasis(t,e,n){return this.set(t.x,e.x,n.x,0,t.y,e.y,n.y,0,t.z,e.z,n.z,0,0,0,0,1),this}normalize(){return this.multiplyScalar(1/(this.m44||1e-4))}transformPoint(t){const e=t.z||1,n=t.w||1;return{x:t.x*this.m11+t.y*this.m21+e*this.m31+n*this.m41,y:t.x*this.m12+t.y*this.m22+e*this.m32+n*this.m42,z:t.x*this.m13+t.y*this.m23+e*this.m33+n*this.m43,w:t.x*this.m14+t.y*this.m24+e*this.m34+n*this.m44}}toMatrix(t){const{scalarX:e,scalarY:n,skewX:i,skewY:r,x:o,y:a}=this.split(),c=[e,r,i,n,o,a];return t?(t.value=c,t):new _t(c)}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=>Q(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),n=Math.sqrt(this.m31*this.m31+this.m32*this.m32+this.m33*this.m33),i=Pt(B(Math.asin(-this.m13),-1,1));let r=Pt(Math.atan2(this.m23,this.m33));Math.cos(J(i))===0&&(r=Pt(Math.atan2(-this.m31,this.m22)));let o=Pt(Math.atan2(this.m12,this.m11));return this.m11<0&&this.m22>=0&&(o+=180),{x:this.m41,y:this.m42,z:this.m43,scalarX:t,scalarY:e,scalarZ:n,degreeX:r,degreeY:i,degreeZ:o,skewX:Pt(this.m14),skewY:Pt(this.m24),skewZ:Pt(this.m34),skewW:this.m44,perspective:this.m34?-(1/this.m34):0}}extractRotation(t){const e=this.value,n=t.value,i=1/ln.setFromMatrix4Column(t,0).length(),r=1/ln.setFromMatrix4Column(t,1).length(),o=1/ln.setFromMatrix4Column(t,2).length();return e[0]=n[0]*i,e[1]=n[1]*i,e[2]=n[2]*i,e[3]=0,e[4]=n[4]*r,e[5]=n[5]*r,e[6]=n[6]*r,e[7]=0,e[8]=n[8]*o,e[9]=n[9]*o,e[10]=n[10]*o,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromEuler(t){const e=this.value,n=t.x,i=t.y,r=t.z,o=Math.cos(n),a=Math.sin(n),c=Math.cos(i),h=Math.sin(i),u=Math.cos(r),l=Math.sin(r);if(t.order==="XYZ"){const d=o*u,f=o*l,p=a*u,w=a*l;e[0]=c*u,e[4]=-c*l,e[8]=h,e[1]=f+p*h,e[5]=d-w*h,e[9]=-a*c,e[2]=w-d*h,e[6]=p+f*h,e[10]=o*c}else if(t.order==="YXZ"){const d=c*u,f=c*l,p=h*u,w=h*l;e[0]=d+w*a,e[4]=p*a-f,e[8]=o*h,e[1]=o*l,e[5]=o*u,e[9]=-a,e[2]=f*a-p,e[6]=w+d*a,e[10]=o*c}else if(t.order==="ZXY"){const d=c*u,f=c*l,p=h*u,w=h*l;e[0]=d-w*a,e[4]=-o*l,e[8]=p+f*a,e[1]=f+p*a,e[5]=o*u,e[9]=w-d*a,e[2]=-o*h,e[6]=a,e[10]=o*c}else if(t.order==="ZYX"){const d=o*u,f=o*l,p=a*u,w=a*l;e[0]=c*u,e[4]=p*h-f,e[8]=d*h+w,e[1]=c*l,e[5]=w*h+d,e[9]=f*h-p,e[2]=-h,e[6]=a*c,e[10]=o*c}else if(t.order==="YZX"){const d=o*c,f=o*h,p=a*c,w=a*h;e[0]=c*u,e[4]=w-d*l,e[8]=p*l+f,e[1]=l,e[5]=o*u,e[9]=-a*u,e[2]=-h*u,e[6]=f*l+p,e[10]=d-w*l}else if(t.order==="XZY"){const d=o*c,f=o*h,p=a*c,w=a*h;e[0]=c*u,e[4]=-l,e[8]=h*u,e[1]=d*l+w,e[5]=o*u,e[9]=f*l-p,e[2]=p*l-f,e[6]=a*u,e[10]=w*l+d}return e[3]=0,e[7]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromQuaternion(t){return this.compose(xg,t,bg)}lookAt(t,e,n){const i=this.value;return Nt.subVectors(t,e),Nt.lengthSq()===0&&(Nt.z=1),Nt.normalize(),Me.crossVectors(n,Nt),Me.lengthSq()===0&&(Math.abs(n.z)===1?Nt.x+=1e-4:Nt.z+=1e-4,Nt.normalize(),Me.crossVectors(n,Nt)),Me.normalize(),Bs.crossVectors(Nt,Me),i[0]=Me.x,i[4]=Bs.x,i[8]=Nt.x,i[1]=Me.y,i[5]=Bs.y,i[9]=Nt.y,i[2]=Me.z,i[6]=Bs.z,i[10]=Nt.z,this}multiplyMatrices(t,e){const n=t.value,i=e.value,r=this.value,o=n[0],a=n[4],c=n[8],h=n[12],u=n[1],l=n[5],d=n[9],f=n[13],p=n[2],w=n[6],b=n[10],x=n[14],g=n[3],v=n[7],_=n[11],E=n[15],C=i[0],I=i[4],F=i[8],N=i[12],$=i[1],V=i[5],W=i[9],tt=i[13],Z=i[2],Gt=i[6],mt=i[10],kt=i[14],Ot=i[3],L=i[7],R=i[11],U=i[15];return r[0]=o*C+a*$+c*Z+h*Ot,r[4]=o*I+a*V+c*Gt+h*L,r[8]=o*F+a*W+c*mt+h*R,r[12]=o*N+a*tt+c*kt+h*U,r[1]=u*C+l*$+d*Z+f*Ot,r[5]=u*I+l*V+d*Gt+f*L,r[9]=u*F+l*W+d*mt+f*R,r[13]=u*N+l*tt+d*kt+f*U,r[2]=p*C+w*$+b*Z+x*Ot,r[6]=p*I+w*V+b*Gt+x*L,r[10]=p*F+w*W+b*mt+x*R,r[14]=p*N+w*tt+b*kt+x*U,r[3]=g*C+v*$+_*Z+E*Ot,r[7]=g*I+v*V+_*Gt+E*L,r[11]=g*F+v*W+_*mt+E*R,r[15]=g*N+v*tt+_*kt+E*U,this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyScalar(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}determinant(){const t=this.value,e=t[0],n=t[4],i=t[8],r=t[12],o=t[1],a=t[5],c=t[9],h=t[13],u=t[2],l=t[6],d=t[10],f=t[14],p=t[3],w=t[7],b=t[11],x=t[15];return p*(+r*c*l-i*h*l-r*a*d+n*h*d+i*a*f-n*c*f)+w*(+e*c*f-e*h*d+r*o*d-i*o*f+i*h*u-r*c*u)+b*(+e*h*l-e*a*f-r*o*l+n*o*f+r*a*u-n*h*u)+x*(-i*a*u-e*c*l+e*a*d+i*o*l-n*o*d+n*c*u)}transpose(){const t=this.value;let e;return e=t[1],t[1]=t[4],t[4]=e,e=t[2],t[2]=t[8],t[8]=e,e=t[6],t[6]=t[9],t[9]=e,e=t[3],t[3]=t[12],t[12]=e,e=t[7],t[7]=t[13],t[13]=e,e=t[11],t[11]=t[14],t[14]=e,this}setPosition(t,e,n){const i=this.value;return t instanceof Bt?(i[12]=t.x,i[13]=t.y,i[14]=t.z):typeof t=="number"&&typeof e=="number"&&typeof n=="number"&&(i[12]=t,i[13]=e,i[14]=n),this}invert(){const t=this.value,e=t[0],n=t[1],i=t[2],r=t[3],o=t[4],a=t[5],c=t[6],h=t[7],u=t[8],l=t[9],d=t[10],f=t[11],p=t[12],w=t[13],b=t[14],x=t[15],g=l*b*h-w*d*h+w*c*f-a*b*f-l*c*x+a*d*x,v=p*d*h-u*b*h-p*c*f+o*b*f+u*c*x-o*d*x,_=u*w*h-p*l*h+p*a*f-o*w*f-u*a*x+o*l*x,E=p*l*c-u*w*c-p*a*d+o*w*d+u*a*b-o*l*b,C=e*g+n*v+i*_+r*E;if(C===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const I=1/C;return t[0]=g*I,t[1]=(w*d*r-l*b*r-w*i*f+n*b*f+l*i*x-n*d*x)*I,t[2]=(a*b*r-w*c*r+w*i*h-n*b*h-a*i*x+n*c*x)*I,t[3]=(l*c*r-a*d*r-l*i*h+n*d*h+a*i*f-n*c*f)*I,t[4]=v*I,t[5]=(u*b*r-p*d*r+p*i*f-e*b*f-u*i*x+e*d*x)*I,t[6]=(p*c*r-o*b*r-p*i*h+e*b*h+o*i*x-e*c*x)*I,t[7]=(o*d*r-u*c*r+u*i*h-e*d*h-o*i*f+e*c*f)*I,t[8]=_*I,t[9]=(p*l*r-u*w*r-p*n*f+e*w*f+u*n*x-e*l*x)*I,t[10]=(o*w*r-p*a*r+p*n*h-e*w*h-o*n*x+e*a*x)*I,t[11]=(u*a*r-o*l*r-u*n*h+e*l*h+o*n*f-e*a*f)*I,t[12]=E*I,t[13]=(u*w*i-p*l*i+p*n*d-e*w*d-u*n*b+e*l*b)*I,t[14]=(p*a*i-o*w*i-p*n*c+e*w*c+o*n*b-e*a*b)*I,t[15]=(o*l*i-u*a*i+u*n*c-e*l*c-o*n*d+e*a*d)*I,this}getMaxScaleOnAxis(){const t=this.value,e=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],n=t[4]*t[4]+t[5]*t[5]+t[6]*t[6],i=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(e,n,i))}makeTranslation(t,e,n){return t instanceof Bt?this.set(1,0,0,t.x,0,1,0,t.y,0,0,1,t.z,0,0,0,1):this.set(1,0,0,t,0,1,0,e,0,0,1,n,0,0,0,1),this}makeRotationX(t){const e=Math.cos(t),n=Math.sin(t);return this.set(1,0,0,0,0,e,-n,0,0,n,e,0,0,0,0,1),this}makeRotationY(t){const e=Math.cos(t),n=Math.sin(t);return this.set(e,0,n,0,0,1,0,0,-n,0,e,0,0,0,0,1),this}makeRotationZ(t){const e=Math.cos(t),n=Math.sin(t);return this.set(e,-n,0,0,n,e,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(t,e){const n=Math.cos(e),i=Math.sin(e),r=1-n,o=t.x,a=t.y,c=t.z,h=r*o,u=r*a;return this.set(h*o+n,h*a-i*c,h*c+i*a,0,h*a+i*c,u*a+n,u*c-i*o,0,h*c-i*a,u*c+i*o,r*c*c+n,0,0,0,0,1),this}makeScale(t,e,n){return this.set(t,0,0,0,0,e,0,0,0,0,n,0,0,0,0,1),this}makeShear(t,e,n,i,r,o){return this.set(1,n,r,0,t,1,o,0,e,i,1,0,0,0,0,1),this}makePerspective(t,e,n,i,r,o,a=Nn){const c=this.value,h=2*r/(e-t),u=2*r/(n-i),l=(e+t)/(e-t),d=(n+i)/(n-i);let f,p;if(a===Nn)f=-(o+r)/(o-r),p=-2*o*r/(o-r);else if(a===Lr)f=-o/(o-r),p=-o*r/(o-r);else throw new Error("Matrix4.makePerspective(): Invalid coordinate system: "+a);return c[0]=h,c[4]=0,c[8]=l,c[12]=0,c[1]=0,c[5]=u,c[9]=d,c[13]=0,c[2]=0,c[6]=0,c[10]=f,c[14]=p,c[3]=0,c[7]=0,c[11]=-1,c[15]=0,this}makeOrthographic(t,e,n,i,r,o,a=Nn){const c=this.value,h=1/(e-t),u=1/(n-i),l=1/(o-r),d=(e+t)*h,f=(n+i)*u;let p,w;if(a===Nn)p=(o+r)*l,w=-2*l;else if(a===Lr)p=r*l,w=-1*l;else throw new Error("Matrix4.makeOrthographic(): Invalid coordinate system: "+a);return c[0]=2*h,c[4]=0,c[8]=0,c[12]=-d,c[1]=0,c[5]=2*u,c[9]=0,c[13]=-f,c[2]=0,c[6]=0,c[10]=w,c[14]=-p,c[3]=0,c[7]=0,c[11]=0,c[15]=1,this}compose(t,e,n){const i=this.value,r=e.x,o=e.y,a=e.z,c=e.w,h=r+r,u=o+o,l=a+a,d=r*h,f=r*u,p=r*l,w=o*u,b=o*l,x=a*l,g=c*h,v=c*u,_=c*l,E=n.x,C=n.y,I=n.z;return i[0]=(1-(w+x))*E,i[1]=(f+_)*E,i[2]=(p-v)*E,i[3]=0,i[4]=(f-_)*C,i[5]=(1-(d+x))*C,i[6]=(b+g)*C,i[7]=0,i[8]=(p+v)*I,i[9]=(b-g)*I,i[10]=(1-(d+w))*I,i[11]=0,i[12]=t.x,i[13]=t.y,i[14]=t.z,i[15]=1,this}decompose(t,e,n){const i=this.value;let r=ln.set(i[0],i[1],i[2]).length();const o=ln.set(i[4],i[5],i[6]).length(),a=ln.set(i[8],i[9],i[10]).length();this.determinant()<0&&(r=-r),t.x=i[12],t.y=i[13],t.z=i[14],Kt.copy(this);const h=1/r,u=1/o,l=1/a;return Kt.value[0]*=h,Kt.value[1]*=h,Kt.value[2]*=h,Kt.value[4]*=u,Kt.value[5]*=u,Kt.value[6]*=u,Kt.value[8]*=l,Kt.value[9]*=l,Kt.value[10]*=l,e.setFromRotationMatrix4(Kt),n.x=r,n.y=o,n.z=a,this}equals(t){for(let e=0;e<16;e++)if(this.value[e]!==t.value[e])return!1;return!0}translate(t=0,e=0,n=0){return this.multiply(new Rt([1,0,0,0,0,1,0,0,0,0,1,0,t,e,n,1]))}scale(t=1,e=1,n=1){return this.multiply(new Rt([t,0,0,0,0,e,0,0,0,0,n,0,0,0,0,1]))}scaleVector3(t){const e=this.value,n=t.x,i=t.y,r=t.z;return e[0]*=n,e[4]*=i,e[8]*=r,e[1]*=n,e[5]*=i,e[9]*=r,e[2]*=n,e[6]*=i,e[10]*=r,e[3]*=n,e[7]*=i,e[11]*=r,this}rotateX(t){const e=J(t),n=Math.cos(e),i=Math.sin(e);return this.multiply(new Rt([1,0,0,0,0,n,i,0,0,-i,n,0,0,0,0,1]))}rotateY(t){const e=J(t),n=Math.cos(e),i=Math.sin(e);return this.multiply(new Rt([n,0,-i,0,0,1,0,0,i,0,n,0,0,0,0,1]))}rotateZ(t){this.is3dSpecial=!0;const e=J(t),n=Math.cos(e),i=Math.sin(e);return this.multiply(new Rt([n,i,0,0,-i,n,0,0,0,0,1,0,0,0,0,1]))}skew(t=0,e=0,n=0){return this.multiply(new Rt([1,0,0,J(t),0,1,0,J(e),0,0,1,J(n),0,0,0,1]))}perspective(t){return this.multiply(new Rt([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,n=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,o=e+this.m31,a=n+this.m32,c=i+this.m33,h=r+this.m34;r==0&&(r=1e-4),e/=r,n/=r,i/=r,h==0&&(h=1e-4),o/=h,a/=h,c/=h;const u=c-i;if(u==0)return{x:e,y:n,z:i,mass:r};const l=-i/u;return e+=l*(o-e),n+=l*(a-n),{x:e,y:n,z:i,mass:r}}project(t){const e=t.z;let n=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),n/=r,i/=r,r<0&&(n-=this.m41,i-=this.m42,n*=1/r,i*=1/r,n+=this.m41,i+=this.m42),{x:n,y:i,z:e,mass:r}}bounds(t,e,n,i){const r=new Fs({x:t,y:e}),o=new Fs({x:t+n,y:e}),a=new Fs({x:t+n,y:e+i}),c=new Fs({x:t,y:e+i});({x:r.x,y:r.y,z:r.z,mass:r.mass}=this.project(r)),{x:o.x,y:o.y,z:o.z,mass:o.mass}=this.project(o),{x:a.x,y:a.y,z:a.z,mass:a.mass}=this.project(a),{x:c.x,y:c.y,z:c.z,mass:c.mass}=this.project(c);const h=Math.min(r.x,o.x,a.x,c.x),u=Math.min(r.y,o.y,a.y,c.y),l=Math.max(r.x,o.x,a.x,c.x)-h,d=Math.max(r.y,o.y,a.y,c.y)-u;return{x:h,y:u,width:l,height:d}}}class _t{value;_m13=0;_m23=0;_m33=1;matrix4;constructor(t=dh){this.value=Array.from(t),this.matrix4=this.toMatrix4()}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}static fromString(t){const e=new _t,n=ia("number",t);return n.length===6&&n.forEach((i,r)=>{i.fullMatch&&(e.value[r]=parseFloat(i.fullMatch))}),e}toMatrix4(t=this.matrix4){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 Rt(e)}identity(){return this.value=Array.from(dh),this.m13=0,this.m23=0,this.m33=1,this.matrix4=this.toMatrix4(),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}multiplyScalar(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.multiplyScalar(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 _t(this.value)}multiply(t){const e=this.clone(),n=t instanceof _t?t:new _t(t);return this.m11=n.m11*e.m11+n.m12*e.m21+n.m13*e.m31,this.m12=n.m11*e.m12+n.m12*e.m22+n.m13*e.m32,this.m13=n.m11*e.m13+n.m12*e.m23+n.m13*e.m33,this.m21=n.m21*e.m11+n.m22*e.m21+n.m23*e.m31,this.m22=n.m21*e.m12+n.m22*e.m22+n.m23*e.m32,this.m23=n.m21*e.m13+n.m22*e.m23+n.m23*e.m33,this.m31=n.m31*e.m11+n.m32*e.m21+n.m33*e.m31,this.m32=n.m31*e.m12+n.m32*e.m22+n.m33*e.m32,this.m33=n.m31*e.m13+n.m32*e.m23+n.m33*e.m33,this}append(t){return this.multiply(t)}prepend(t){return t.multiply(this),this}invert(){const t=this.m11,e=this.m12,n=this.m13,i=this.m21,r=this.m22,o=this.m23,a=this.m31,c=this.m32,h=this.m33,u=h*r-o*c,l=-h*i+o*a,d=c*i-r*a;let f=t*u+e*l+n*d;return f?(f=1/f,this.m11=u*f,this.m12=(-h*e+n*c)*f,this.m13=(o*e-n*r)*f,this.m21=l*f,this.m22=(h*t-n*a)*f,this.m23=(-o*t+n*i)*f,this.m31=d*f,this.m32=(-c*t+e*a)*f,this.m33=(r*t-e*i)*f,this):null}adjugate(){const t=new _t;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=Pt(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:Pt(Math.atan2(-this.m21,this.m22)),skewY:Pt(Math.atan2(this.m12,this.m11))}}getGroupCoords(t){const e=this.value[0],n=this.value[1],i=this.value[2],r=this.value[3],o=this.value[4],a=this.value[5],c=t.value[0],h=t.value[1],u=t.value[2],l=t.value[3],d=t.value[4],f=t.value[5],p=c*l,w=h*u,b=(u*n-e*l)/(w-p),x=(c*n-e*h)/(p-w),g=(u*r-i*l)/(w-p),v=(c*r-i*h)/(p-w),_=(u*(a-f)+l*(d-o))/(w-p),E=(c*(a-f)+h*(d-o))/(p-w),C=[b,x,g,v,_,E];return new _t(C)}toString(t=6){return this.matrix4.is2D()?`matrix(${this.value.map(e=>Q(e,t)).join(",")})`:this.matrix4.toString()}translate(t,e){return this.multiply([1,0,0,1,t,e]),this.toMatrix4(),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.matrix4.translate(0,0,t),this.matrix4.toMatrix(this),this}translateZTo(t){return this.translateZ(t-this.matrix4.m43),this}translate3d(t,e,n){return this.matrix4.translate(t,e,n),this.matrix4.toMatrix(this),this}translate3dTo(t,e,n){return this.translate3d(t-this.matrix4.m41,e-this.matrix4.m42,n-this.matrix4.m43),this}rotate(t,e=0,n=0){const i=J(t),r=Math.cos(i),o=Math.sin(i);return this.translate(e,n),this.multiply([r,o,-o,r,0,0]),this.translate(-e,-n),this.toMatrix4(),this}rotateTo(t,e=0,n=0){const{degree:i}=this.split();return this.rotate(t-i,e,n),this}rotateX(t){return this.matrix4.rotateX(t),this.matrix4.toMatrix(this),this}rotateXTo(t){const{degreeX:e}=this.matrix4.split();return this.rotateX(t-e),this}rotateY(t){return this.matrix4.rotateY(t),this.matrix4.toMatrix(this),this}rotateYTo(t){const{degreeY:e}=this.matrix4.split();return this.rotateY(t-e),this}rotateZ(t){return this.matrix4.rotateZ(t),this.matrix4.toMatrix(this),this}rotateZTo(t){const{degreeZ:e}=this.matrix4.split();return this.rotateZ(t-e),this}rotate3d(t,e,n){return this.matrix4.rotateX(t).rotateY(e).rotateZ(n),this.matrix4.toMatrix(this),this}rotate3dTo(t,e,n){const{degreeX:i,degreeY:r,degreeZ:o}=this.matrix4.split();return this.rotate3d(t-i,e-r,n-o),this}scale(t,e=t,n=0,i=0){return this.translate(n,i),this.multiply([t,0,0,e,0,0]),this.translate(-n,-i),this.toMatrix4(),this}scaleTo(t,e=t,n=0,i=0){return this.scale(t/this.m11,e/this.m22,n,i)}scaleX(t){return this.scale(t,1)}scaleXTo(t){return this.scale(t/this.m11,1)}scaleY(t){return this.scale(1,t)}scaleYTo(t){return this.scale(1,t/this.m22)}scaleZ(t){return this.matrix4.scale(1,1,t),this.matrix4.toMatrix(this),this}scaleZTo(t){const{scalarZ:e}=this.matrix4.split();return this.scaleZ(t/e),this}scale3d(t,e=t,n=t){return this.matrix4.scale(t,e,n),this.matrix4.toMatrix(this),this}scale3dTo(t,e=t,n=t){const{scalarX:i,scalarY:r,scalarZ:o}=this.matrix4.split();return this.scale3d(t/i,e/r,n/o),this}skew(t,e=t){return this.multiply([Math.cos(J(e)),Math.sin(J(e)),-Math.sin(J(t)),Math.cos(J(t)),0,0]),this.toMatrix4(),this}skewTo(t,e=t){const{skewX:n,skewY:i}=this.split();return this.skew(t-n,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,n){return this}skew3dTo(t,e,n){return this}perspective(t){return this.matrix4.perspective(t),this.matrix4.toMatrix(this),this}}const xg=new Bt(0,0,0),bg=new Bt(1,1,1),Me=new Bt,Bs=new Bt,Nt=new Bt,ln=new Bt,zr=new un,Kt=new Rt;function Fr(s){const t=new _t;return s.replace(/([a-z0-9]+)\s*\(?\s*((-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)*[a-z%]*\s*,?\s*)+)\)?/gi,function(e,n,i){i.indexOf(",")>=0?i=i.split(/\s*,\s*/):i=i.split(/\s+/);const r=[];for(let o=0,a=i.length;o<a;o++)i[o].trim()&&r.push(parseFloat(""+i[o]));switch(n.toLowerCase()){case"t":case"translate":t.translate(r[0],r[1]);break;case"translatex":t.translateX(r[0]);break;case"translatey":t.translateY(r[0]);break;case"translatez":t.translateZ(r[0]);break;case"translate3d":t.translate3d(r[0],r[1],r[2]);break;case"r":case"rotate":t.rotate(r[0],r[1]??0,r[2]??0);break;case"rotatex":t.rotateX(r[0]);break;case"rotatey":t.rotateY(r[0]);break;case"rotatez":t.rotateZ(r[0]);break;case"rotate3d":t.rotate3d(r[0],r[1],r[2]);break;case"s":case"scale":t.scale(r[0],r[1]??r[0]);break;case"scalex":t.scaleX(r[0]);break;case"scaley":t.scaleY(r[0]);break;case"scalez":t.scaleZ(r[0]);break;case"scale3d":t.scale3d(r[0],r[1],r[2]);break;case"skew":t.skew(r[0],r[1]??0);break;case"skewx":t.skewX(r[0]);break;case"skewy":t.skewY(r[0]);break;case"skewz":t.skewZ(r[0]);break;case"skew3d":t.skew3d(r[0],r[1],r[2]);break;case"m":case"matrix":t.multiply([r[0],r[1],r[2],r[3],r[4],r[5]]),t.toMatrix4();break;case"matrix3d":t.matrix4.multiply(new Rt(r)),t.matrix4.toMatrix(t);break}return""}),t}function te(s,t,e){const n=new _t;return n.rotate(Pt(s)),n.transformPoint({x:t,y:e})}function Br(s){const t=typeof s?.x=="number"?s?.x:0,e=typeof s?.y=="number"?s?.y:0,n=typeof s?.degree=="number"?s?.degree:0,i=typeof s?.scalarX=="number"?s?.scalarX:1,r=typeof s?.scalarY=="number"?s?.scalarY:1,o=J(n),a=Math.cos(o),c=Math.sin(o),h=new DOMMatrix([a*i,c*i,-c*r,a*r,t,e]);return h.multiplySelf(new DOMMatrix(s?.originMatrix||"")),h}function vg(s,t){const e=new Path2D(s),n=new Path2D;return n.addPath(e,Br(t)),n}function $e(s,t,e){const n=Tr(s);return n.props.style=n.props.style||{},t?n.props.style[t]||n.props.style[oa(t)]||n.props.style[xt(t)]||"":n.props.style}function Nr(s,t,e){Er(s,n=>{n.props.style=n.props.style||{},typeof t=="string"&&e?n.props.style[t]=e:t instanceof Object&&Object.keys(t).forEach(i=>{n.props.style[i]=t[i]})},!0)}function Yr(s){const t={};if(getComputedStyle){const e=getComputedStyle(s);for(let n=0,i=e.length;n<i;n++)t[e[n]]=e.getPropertyValue(t[n])}else{const e=s.currentStyle;for(const n in e)t[n]=e[n]}return s.style.cssText&&s.style.cssText.split(";").filter(e=>!!e).forEach(e=>{const[n,i]=e.split(":");n&&i&&(t[n.trim()]=i.trim())}),t}function _g(s,t,e){let n=s.style[t]||"";if(!n&&getComputedStyle){t=xt(t);const i=getComputedStyle(s,e),r=i.getPropertyPriority(t);n=i.getPropertyValue(t).trim()+(r?"!"+r:"")}return n||(n=s.currentStyle[t]||""),n}function Ns(s,t,e){typeof t=="string"&&e?s.style.setProperty(xt(t),e.replace(/!important/i,""),e.toLowerCase().includes("!important")?"important":""):t instanceof Object&&Object.keys(t).forEach(n=>{Ns(s,n,t[n])})}function Ur(s,t){typeof t=="string"?s.style.removeProperty(xt(t)):Object.keys(t).forEach(e=>{Ur(s,e)})}function gh(s,t){let e;if(typeof t=="string"){const n=document.querySelector(t)?.shadowRoot;n?e=n:e=document.querySelector(t)}else e=t||document.getElementsByTagName("head")[0];if(e){const n=document.createElement("style");return n.innerHTML=s,e.appendChild(n),()=>{(e instanceof HTMLElement||e instanceof ShadowRoot)&&e.removeChild(n)}}else{const n=document.styleSheets[0].insertRule(s);return()=>{document.styleSheets[0].deleteRule(n)}}}function Sg(s,t,e={}){Object.prototype.hasOwnProperty.call(e,"transform")||Object.assign(e,{transform:$e(s,"transform")||""});const n=Fr(e.transform),i={};for(const r in t){const o=t[r];switch(r){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(e,r)||(e[r]=$e(s,r)),Object.assign(i,{[r]:`${o}`});break}}return Object.assign(i,{transform:n.toString()}),i}function Ve(s,t,e){if(t===void 0&&e===void 0)return Xr(s);if(typeof t=="string"&&e===void 0)return yh(s,t);let n={};typeof t=="object"?n=t:typeof t=="string"&&typeof e=="string"&&(n[t]=""+e),Er(s,i=>{Object.entries(n).forEach(([r,o])=>{i.props[r]=""+o})})}const Cg=["-o-","-ms-","-moz-","-webkit-",""];function Xr(s){const t={};for(let e=0,n=s.attributes,i=n.length;e<i;e++){const r=n[e];r.nodeName&&r.nodeValue&&(r.nodeName==="style"?t[r.nodeName]=Yr(s):t[r.nodeName]=r.nodeValue)}return t}function yh(s,t){return t==="style"?Yr(s):s.getAttribute(xt(t))}function fn(s,t,e){return s.setAttribute(xt(t),""+e)}function Tg(s,t){t.split(/[,\s]+/i).forEach(e=>{const n=xt(e.trim());n!=""&&s.removeAttribute(n)})}function wh(s,t){for(const e in t){const n=t[e];switch(e){case"fill":n!=="none"&&(s.fillStyle=n);break;case"stroke":n!=="none"&&(s.strokeStyle=n);break;case"stroke-width":case"strokeWidth":s.lineWidth=Number(n);break;case"stroke-linecap":case"strokeLinecap":s.lineCap=n;break;case"stroke-linejoin":case"strokeLinejoin":switch(n){case"round":case"bevel":case"miter":s.lineJoin=n;break;default:s.lineJoin="miter";break}break;case"stroke-miterlimit":case"strokeMiterlimit":s.miterLimit=Number(n);break;case"stroke-opacity":case"strokeOpacity":break;case"stroke-dashoffset":case"strokeDashoffset":s.lineDashOffset=Number(n);break;case"stroke-dasharray":case"strokeDasharray":typeof n=="string"&&s.setLineDash(n.split(/\s+/).map(i=>Number(i)));break;case"cursor":break;case"font":typeof n=="string"&&(s.font=n);break;case"font-size":case"fontSize":s.font+=` ${n}`;break;case"font-family":case"fontFamily":s.font+=` ${n}`;break;case"font-weight":case"fontWeight":break;case"font-style":case"fontStyle":break;case"text-anchor":case"textAnchor":switch(n){case"middle":s.textAlign="center";break;case"end":s.textAlign="end";break;case"start":s.textAlign="start";break}break;case"alignment-baseline":case"alignmentBaseline":switch(n){case"middle":case"bottom":case"top":case"alphabetic":case"hanging":case"ideographic":s.textBaseline=n;break;default:s.textBaseline="alphabetic";break}break}}}function Eg(s,t,e,n,i){const r=t/e;let o=0,a=0;switch(s){case"aspectFit":r>=1?(o=n,a=o/r,a>i&&(a=i,o=a*r)):(a=i,o=a*r,o>n&&(o=n,a=o/r));break;case"aspectFill":r>=1?(a=i,o=a*r):(o=n,a=o/r);break;case"widthFix":o=n,a=o/r;break;case"heightFix":a=i,o=a*r;break;case"scaleToFill":default:o=n,a=i;break}return{width:o,height:a}}function xh(s){try{const t=document.createElement("canvas"),e=t.getContext("2d");return t.width=s.width,t.height=s.height,e.drawImage(s,0,0,t.width,t.height),e.getImageData(0,0,t.width,t.height)}catch{return new ImageData(s.width,s.height)}}const Pg=s=>{const t=s.width,e=s.height,n=t*e*3,i=n+54,r=[66,77,i&255,i>>8&255,i>>16&255,i>>24&255,0,0,0,0,54,0,0,0],o=[40,0,0,0,t&255,t>>8&255,t>>16&255,t>>24&255,e&255,e>>8&255,e>>16&255,e>>24&255,1,0,24,0,0,0,0,0,n&255,n>>8&255,n>>16&255,n>>24&255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],a=(4-t*3%4)%4,c=s.data;let h="";const u=t<<2;let l=e;const d=String.fromCharCode;do{const p=u*(l-1);let w="";for(let b=0;b<t;b++){const x=b<<2;w+=d(c[p+x+2])+d(c[p+x+1])+d(c[p+x])}for(let b=0;b<a;b++)w+=String.fromCharCode(0);h+=w}while(--l);function f(p){if(!window.btoa)throw"btoa undefined";let w="";if(typeof p=="string")w=p;else for(let b=0;b<p.length;b++)w+=String.fromCharCode(p[b]);return btoa(w)}return f(r.concat(o))+f(h)};function Mg(s){const{width:t,height:e}=s,n=document.createElement("canvas"),i=n.getContext("2d");return n.width=t,n.height=e,i.putImageData(s,0,0,0,0,t,e),n.toDataURL("image/png")}const Ag=(s,t,e)=>{const{width:n,height:i}=s,r=document.createElement("canvas"),o=r.getContext("2d");r.width=n,r.height=i,o.putImageData(s,0,0,0,0,n,i);const a=`image/${t?t.toLowerCase():"png"}`;r.toBlob(c=>{e?.(null,c)},a,1)};function kg(s,t){return createImageBitmap(s,t)}function Ig(s){const t=[],e=[],n=[];let i=0;for(let c=0,h=s.data.length;c<h;c+=4)t[i]=s.data[c],e[i]=s.data[c+1],n[i]=s.data[c+2],i+=1;const r=$r(t),o=$r(e),a=$r(n);return"rgb("+r+","+o+","+a+")"}function $r(s){const t={},e=[],n=[];for(let a=0;a<s.length;a++)t[s[a]]?e.push(s[a]):t[s[a]]=1;let i=0;for(let a=0;a<e.length;a++){i=0;for(let c=0;c<e.length;c++)e[a]===e[c]&&(i+=1),n[a]=i}const r=Math.max.apply(null,n);let o=0;for(;o<n.length;o++)if(n[o]===r)return;return e[o]}const Dg=s=>{const{data:t,width:e,height:n}=s,i=new Uint8ClampedArray(t.length);for(let o=0;o<n;o++)for(let a=0;a<e;a++){const c=(o*e+a)*4;i[c]=t[(o*e+e-a-1)*4],i[c+1]=t[(o*e+e-a-1)*4+1],i[c+2]=t[(o*e+e-a-1)*4+2],i[c+3]=t[(o*e+e-a-1)*4+3]}return new ImageData(i,e,n)},Rg=s=>{const{data:t,width:e,height:n}=s,i=new Uint8ClampedArray(t.length);for(let o=0;o<n;o++)for(let a=0;a<e;a++){const c=(o*e+a)*4;i[c]=t[((n-o-1)*e+a)*4],i[c+1]=t[((n-o-1)*e+a)*4+1],i[c+2]=t[((n-o-1)*e+a)*4+2],i[c+3]=t[((n-o-1)*e+a)*4+3]}return new ImageData(i,e,n)},Lg=s=>{const{data:t,width:e,height:n}=s,i=new Uint8ClampedArray(t.length);for(let o=0;o<e;o++)for(let a=0;a<n;a++){const c=(o*n+a)*4;i[c]=t[(a*e+e-o-1)*4],i[c+1]=t[(a*e+e-o-1)*4+1],i[c+2]=t[(a*e+e-o-1)*4+2],i[c+3]=t[(a*e+e-o-1)*4+3]}return new ImageData(i,n,e)},Og=s=>{const{data:t,width:e,height:n}=s,i=new Uint8ClampedArray(t.length);for(let o=0;o<e;o++)for(let a=0;a<n;a++){const c=(o*n+a)*4;i[c]=t[((n-a-1)*e+o)*4],i[c+1]=t[((n-a-1)*e+o)*4+1],i[c+2]=t[((n-a-1)*e+o)*4+2],i[c+3]=t[((n-a-1)*e+o)*4+3]}return new ImageData(i,n,e)},zg=s=>{const{data:t,width:e,height:n}=s,i=new Uint8ClampedArray(t.length);for(let o=0;o<n;o++)for(let a=0;a<e;a++){const c=(o*e+a)*4,h=(t[c]+t[c+1]+t[c+2])/3;i[c]=h,i[c+1]=h,i[c+2]=h,i[c+3]=t[c+3]}return new ImageData(i,e,n)},Fg=s=>{const{data:t,width:e,height:n}=s,i=new Uint8ClampedArray(t.length);for(let o=0;o<n;o++)for(let a=0;a<e;a++){const c=(o*e+a)*4,h=.2126*t[c]+.7152*t[c+1]+.0722*t[c+2];i[c]=h,i[c+1]=h,i[c+2]=h,i[c+3]=t[c+3]}return new ImageData(i,e,n)},Bg=s=>{const{data:t,width:e,height:n}=s,i=new Uint8ClampedArray(t.length);for(let o=0;o<n;o++)for(let a=0;a<e;a++){const c=(o*e+a)*4,u=(t[c]+t[c+1]+t[c+2])/3>127?255:0;i[c]=u,i[c+1]=u,i[c+2]=u,i[c+3]=t[c+3]}return new ImageData(i,e,n)},Ng=s=>{const{data:t,width:e,height:n}=s,i=new Uint8ClampedArray(t.length);for(let o=0;o<n;o++)for(let a=0;a<e;a++){const c=(o*e+a)*4;i[c]=255-t[c],i[c+1]=255-t[c+1],i[c+2]=255-t[c+2],i[c+3]=t[c+3]}return new ImageData(i,e,n)},Yg=s=>{const{data:t,width:e,height:n}=s,i=new Uint8ClampedArray(t.length);for(let o=0;o<n;o++)for(let a=0;a<e;a++){const c=(o*e+a)*4;i[c]=t[c],i[c+1]=0,i[c+2]=0,i[c+3]=t[c+3]}return new ImageData(i,e,n)},Ug=s=>{const{data:t,width:e,height:n}=s,i=new Uint8ClampedArray(t.length);for(let o=0;o<n;o++)for(let a=0;a<e;a++){const c=(o*e+a)*4;i[c]=0,i[c+1]=t[c+1],i[c+2]=0,i[c+3]=t[c+3]}return new ImageData(i,e,n)},Xg=s=>{const{data:t,width:e,height:n}=s,i=new Uint8ClampedArray(t.length);for(let o=0;o<n;o++)for(let a=0;a<e;a++){const c=(o*e+a)*4;i[c]=0,i[c+1]=0,i[c+2]=t[c+2],i[c+3]=t[c+3]}return new ImageData(i,e,n)},$g=s=>{const{data:t,width:e,height:n}=s,i=new Uint8ClampedArray(t.length);for(let o=0;o<n;o++)for(let a=0;a<e;a++){const c=(o*e+a)*4;i[c]=t[c],i[c+1]=t[c+1],i[c+2]=0,i[c+3]=t[c+3]}return new ImageData(i,e,n)},Vg=s=>{const{data:t,width:e,height:n}=s,i=new Uint8ClampedArray(t.length);for(let o=0;o<n;o++)for(let a=0;a<e;a++){const c=(o*e+a)*4;i[c]=t[c],i[c+1]=0,i[c+2]=t[c+1],i[c+3]=t[c+3]}return new ImageData(i,e,n)},Gg=s=>{const{data:t,width:e,height:n}=s,i=new Uint8ClampedArray(t.length);for(let o=0;o<n;o++)for(let a=0;a<e;a++){const c=(o*e+a)*4;i[c]=0,i[c+1]=t[c+1],i[c+2]=t[c+1],i[c+3]=t[c+3]}return new ImageData(i,e,n)},qg=s=>{const{data:t,width:e,height:n}=s,i=new Uint8ClampedArray(t.length);for(let o=0;o<n;o++)for(let a=0;a<e;a++){const c=(o*e+a)*4,h=(t[c+1]+t[c+2])/2;i[c]=t[c],i[c+1]=h,i[c+2]=h,i[c+3]=t[c+3]}return new ImageData(i,e,n)},jg=s=>{const{data:t,width:e,height:n}=s,i=new Uint8ClampedArray(t.length);for(let o=0;o<n;o++)for(let a=0;a<e;a++){const c=(o*e+a)*4,h=(t[c]+t[c+2])/2;i[c]=h,i[c+1]=t[c+1],i[c+2]=h,i[c+3]=t[c+3]}return new ImageData(i,e,n)},Hg=s=>{const{data:t,width:e,height:n}=s,i=new Uint8ClampedArray(t.length);for(let o=0;o<n;o++)for(let a=0;a<e;a++){const c=(o*e+a)*4,h=(t[c]+t[c+1])/2;i[c]=h,i[c+1]=h,i[c+2]=t[c+2],i[c+3]=t[c+3]}return new ImageData(i,e,n)},Wg=s=>bh(s,[-1,-1,-1,-1,9,-1,-1,-1,-1]),Jg=s=>bh(s,[-1,-1,-1,-1,8,-1,-1,-1,-1]),Zg=s=>{const{data:t,width:e,height:n}=s,i=new Uint8ClampedArray(t.length);for(let o=0;o<n;o++)for(let a=0;a<e;a++){const c=(o*e+a)*4;i[c]=t[c],i[c+1]=t[c+1],i[c+2]=t[c+2],i[c+3]=255}return new ImageData(i,e,n)},Qg=s=>{const{data:t,width:e,height:n}=s,i=new Uint8ClampedArray(t.length);for(let o=0;o<n;o++)for(let a=0;a<e;a++){const c=(o*e+a)*4;if(t[c+3]===0)i[c]=255,i[c+1]=255,i[c+2]=255,i[c+3]=255;else{const h=vh([t[c],t[c+1],t[c+2],t[c+3]],[255,255,255,255]);i[c]=h[0],i[c+1]=h[1],i[c+2]=h[2],i[c+3]=h[3]}}return new ImageData(i,e,n)};function Kg(s,t,e,n,i,r=!1,o){const{data:a,width:c,height:h}=s;let u=i,l=n,d=t,f=e;if(u<0?u=0:u>c&&(u=c),l<0?l=0:l>h&&(l=h),d<1?d=1:d>c&&(d=c),f<1?f=1:f>h&&(f=h),u+d>c&&(d=c-u),l+f>h&&(f=h-l),r){const p=new Uint8ClampedArray(a.length);for(let b=0;b<h;b++)for(let x=0;x<c;x++){const g=(b*c+x)*4;x>=u&&x<=u+d&&b>=l&&b<=l+f?(p[g]=a[g],p[g+1]=a[g+1],p[g+2]=a[g+2],p[g+3]=a[g+3]):(p[g]=255,p[g+1]=255,p[g+2]=255,p[g+3]=o&&["JPG","JPEG"].includes(o.toUpperCase())?255:0)}return new ImageData(p,c,h)}else{const p=new Uint8ClampedArray(d*f*4);for(let b=l;b<=l+f;b++)for(let x=u;x<=u+d;x++){const g=((b-l)*d+x-u)*4,v=(b*c+x)*4;p[g]=a[v],p[g+1]=a[v+1],p[g+2]=a[v+2],p[g+3]=a[v+3]}return new ImageData(p,d,f)}}function t0(s,t,e,n){const{data:i,width:r,height:o}=s;let a=t;a>Math.floor(r/2)&&(a=Math.floor(r/2)),a>Math.floor(o/2)&&(a=Math.floor(o/2)),a<0&&(a=0);const c=new Uint8ClampedArray(i.length);for(let u=0;u<o;u++)for(let l=0;l<r;l++){const d=(u*r+l)*4;let f=-1;l<a?u<a?f=Math.sqrt(Math.pow(a-l-1,2)+Math.pow(a-u-1,2)):u>o-a-1&&(f=Math.sqrt(Math.pow(a-l-1,2)+Math.pow(u-(o-a),2))):l>r-a-1&&(u<a?f=Math.sqrt(Math.pow(l-(r-a),2)+Math.pow(a-u-1,2)):u>o-a-1&&(f=Math.sqrt(Math.pow(l-(r-a),2)+Math.pow(u-(o-a),2)))),Math.round(f)>a?(c[d]=255,c[d+1]=255,c[d+2]=255,c[d+3]=n||e.toUpperCase()==="PNG"?0:255):(c[d]=i[d],c[d+1]=i[d+1],c[d+2]=i[d+2],c[d+3]=n||e.toUpperCase()==="PNG"?i[d+3]:255)}return new ImageData(c,r,o)}function e0(s,t,e,n,i,r=1e4){const o=new Image;o.src=s;const a=document.createElement("canvas"),c=a.getContext("2d");return a.width=r,a.height=r,c.drawImage(o,0,0,t,e,0,0,n,i),c.getImageData(0,0,n,i)}function n0(s,t){const{data:e,width:n,height:i}=s,r=new Uint8ClampedArray(e.length);for(let a=0;a<i;a++)for(let c=0;c<n;c++){const h=(a*n+c)*4;r[h]=Math.max(Math.min(e[h]+t,255),0),r[h+1]=Math.max(Math.min(e[h+1]+t,255),0),r[h+2]=Math.max(Math.min(e[h+2]+t,255),0),r[h+3]=e[h+3]}return new ImageData(r,n,i)}function s0(s,t,e=!1){const{data:n,width:i,height:r}=s,o=new Uint8ClampedArray(n.length);for(let c=0;c<r;c++)for(let h=0;h<i;h++){const u=(c*i+h)*4;n[u+3]===0?(o[u]=255,o[u+1]=255,o[u+2]=255):(o[u]=n[u],o[u+1]=n[u+1],o[u+2]=n[u+2]);let l=n[u+3];e?l=Math.max(Math.min(Math.floor(255*t),255),0):l=Math.max(Math.min(Math.floor(l+255*t),255),0),o[u+3]=l}return new ImageData(o,i,r)}function i0(s,t,e,n){const{data:i,width:r,height:o}=s,{data:a,width:c,height:h}=t;let u=e,l=n;e+h>o&&(u=o-h),n+c>r&&(l=r-c);const d=new Uint8ClampedArray(i.length);for(let p=0;p<o;p++)for(let w=0;w<r;w++){const b=(p*r+w)*4;if(w<l||w>l+c||p<=u||p>=u+h)d[b]=i[b],d[b+1]=i[b+1],d[b+2]=i[b+2],d[b+3]=i[b+3];else{const x=(p*r+w-((u+1)*r+(p-(u+1))*(r-c))+c-l-1)*4,g=[a[x],a[x+1],a[x+2],a[x+3]],v=[i[b],i[b+1],i[b+2],i[b+3]],_=vh(g,v);d[b]=_[0],d[b+1]=_[1],d[b+2]=_[2],d[b+3]=_[3]}}return new ImageData(d,r,o)}function r0(s,t,e,n,i,r=10){const{data:o,width:a,height:c}=s;let h=i,u=n,l=t,d=e;h<0?h=0:h>a&&(h=a),u<0?u=0:u>c&&(u=c),l<1?l=1:l>a&&(l=a),d<1?d=1:d>c&&(d=c),h+l>a&&(l=a-h),u+d>c&&(d=c-u);const f=new Uint8ClampedArray(o.length);for(let w=0;w<c;w++)for(let b=0;b<a;b++){const x=(w*a+b)*4;if(b>=h&&b<=h+l&&w>=u&&w<=u+d){const g=Math.floor((b-h)/r),v=Math.floor((w-u)/r);let _=Math.floor(r*(g+1)-r/2+h),E=Math.floor(r*(v+1)-r/2+u);_>a-1&&(_=a-1),E>c-1&&(E=c-1);const C=(E*a+_)*4;f[x]=o[C],f[x+1]=o[C+1],f[x+2]=o[C+2],f[x+3]=o[C+3]}else f[x]=o[x],f[x+1]=o[x+1],f[x+2]=o[x+2],f[x+3]=o[x+3]}return new ImageData(f,a,c)}function o0(s,t,e={backgroundColor:{r:0,g:0,b:0,a:255},changeIntoColor:{r:0,g:0,b:0,a:0}}){if(t&&e){const{data:n,width:i,height:r}=s,{data:o}=t,a=new Uint8ClampedArray(n.length),{backgroundColor:c,changeIntoColor:h}=e;for(let l=0;l<r;l++)for(let d=0;d<i;d++){const f=(l*i+d)*4,p=o[f],w=o[f+1],b=o[f+2],x=o[f+3];p===c.r&&w===c.g&&b===c.b&&x===c.a&&h.a!==0?(a[f]=h.r,a[f+1]=h.g,a[f+2]=h.b,a[f+3]=h.a):(a[f]=n[f],a[f+1]=n[f+1],a[f+2]=n[f+2],a[f+3]=n[f+3])}return new ImageData(a,i,r)}return s}function bh(s,t){const{data:e,width:n,height:i}=s,r=new Uint8ClampedArray(e.length);for(let a=0;a<i;a++)for(let c=0;c<n;c++){const h=(a*n+c)*4;for(let u=0;u<3;u++){const l=h+u;c===0||c===n-1||a===0||a===i-1?r[l]=e[l]:r[l]=t[0]*e[l-n*4-4]+t[1]*e[l-n*4]+t[2]*e[l-n*4+4]+t[3]*e[l-4]+t[4]*e[l]+t[5]*e[l+4]+t[6]*e[l+n*4-4]+t[7]*e[l+n*4]+t[8]*e[l+n*4+4]}r[h+3]=e[h+3]}return new ImageData(r,n,i)}function vh(s,t){if(s&&s.length===4&&t&&t.length===4){const e=s[3],n=t[3];if(e===255||n===0)return s;if(e===0)return t;{const i=e/255,r=n/255,o=Math.max(Math.min(Math.floor(s[0]*i+t[0]*r*(1-i)),255),0),a=Math.max(Math.min(Math.floor(s[1]*i+t[1]*r*(1-i)),255),0),c=Math.max(Math.min(Math.floor(s[2]*i+t[2]*r*(1-i)),255),0),h=Math.max(Math.min(Math.floor((i+r*(1-i))*255),255),0);return[o,a,c,h]}}return[255,255,255,255]}const Vr=function(){const s=[];return{writeByte(t){s.push(t&255)},writeShort(t){this.writeByte(t),this.writeByte(t>>>8)},writeBytes(t,e=0,n=t.length){for(let i=0;i<n;i++)this.writeByte(t[i+e])},writeString(t){for(let e=0,n=t.length;e<n;e++)this.writeByte(t.charCodeAt(e))},toByteArray(){return s},toString(){let t="[";for(let e=0,n=s.length;e<n;e++)e>0&&(t+=","),t+=s[e];return t+="]",t}}},_h=function(){let s=0,t=0,e=0,n="";const i=function(o){if(!(o<0)){if(o<26)return 65+o;if(o<52)return 97+(o-26);if(o<62)return 48+(o-52);if(o==62)return 43;if(o==63)return 47}throw new Error("n:"+o)},r=function(o){n+=String.fromCharCode(i(o&63))};return{writeByte(o){for(s=s<<8|o&255,t+=8,e+=1;t>=6;)r(s>>>t-6),t-=6},flush(){if(t>0&&(r(s<<6-t),s=0,t=0),e%3!=0){const o=3-e%3;for(let a=0;a<o;a++)n+="="}},toString(){return n}}},Sh=function(s,t,e){const n=new Array(s*s),i=function(a){const c=a;let h=0,u=0;return{write(l,d){if(l>>>d)throw new Error("length over");for(;h+d>=8;)c.writeByte(255&(l<<h|u)),d-=8-h,l>>>=8-h,u=0,h=0;u=l<<h|u,h=h+d},flush(){h>0&&c.writeByte(u)}}},r=function(a){const c=1<<a,h=(1<<a)+1;let u=a+1;const l=o();for(let b=0;b<c;b++)l.add(String.fromCharCode(b));l.add(String.fromCharCode(c)),l.add(String.fromCharCode(h));const d=Vr(),f=i(d);f.write(c,u);let p=0,w=String.fromCharCode(n[p]);for(p+=1;p<n.length;){const b=String.fromCharCode(n[p]);p+=1,l.contains(w+b)?w=w+b:(f.write(l.indexOf(w),u),l.size()<4095&&(l.size()==1<<u&&(u+=1),l.add(w+b)),w=b)}return f.write(l.indexOf(w),u),f.write(h,u),f.flush(),d.toByteArray()},o=function(){const a={};let c=0;return{add(h){if(this.contains(h))throw new Error("dup key:"+h);a[h]=c,c+=1},size(){return c},indexOf(h){return a[h]},contains(h){return typeof a[h]<"u"}}};return{setPixel(a,c,h){n[c*s+a]=h},write(a){a.writeString("GIF87a"),a.writeShort(s),a.writeShort(s),a.writeByte(128),a.writeByte(0),a.writeByte(0),a.writeByte(en("0x"+t[1]+t[2])),a.writeByte(en("0x"+t[3]+t[4])),a.writeByte(en("0x"+t[5]+t[6])),a.writeByte(en("0x"+e[1]+e[2])),a.writeByte(en("0x"+e[3]+e[4])),a.writeByte(en("0x"+e[5]+e[6])),a.writeString(","),a.writeShort(0),a.writeShort(0),a.writeShort(s),a.writeShort(s),a.writeByte(0);const c=2,h=r(c);a.writeByte(c);let u=0;for(;h.length-u>255;)a.writeByte(255),a.writeBytes(h,u,255),u+=255;a.writeByte(h.length-u),a.writeBytes(h,u,h.length-u),a.writeByte(0),a.writeString(";")}}},Ch=function(s,t,e,n){const i=Sh(s,t,e);for(let h=0;h<s;h++)for(let u=0;u<s;u++)i.setPixel(u,h,n(u,h));const r=Vr();i.write(r);const o=_h(),a=r.toByteArray();for(let h=0,u=a.length;h<u;h++)o.writeByte(a[h]);o.flush();let c="";return c+="data:image/gif;base64,",c+=o,c},Yt={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},Yn={M:0,L:1,H:2,Q:3},Ae={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},dt={glog:function(s){if(s<1)throw new Error("glog("+s+")");return dt.LOG_TABLE[s]},gexp:function(s){for(;s<0;)s+=255;for(;s>=256;)s-=255;return dt.EXP_TABLE[s]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)};for(let s=0;s<8;s++)dt.EXP_TABLE[s]=1<<s;for(let s=8;s<256;s++)dt.EXP_TABLE[s]=dt.EXP_TABLE[s-4]^dt.EXP_TABLE[s-5]^dt.EXP_TABLE[s-6]^dt.EXP_TABLE[s-8];for(let s=0;s<255;s++)dt.LOG_TABLE[dt.EXP_TABLE[s]]=s;const K={PATTERN_POSITION_TABLE:[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],G15:1335,G18:7973,G15_MASK:21522,getBCHTypeInfo:function(s){let t=s<<10;for(;K.getBCHDigit(t)-K.getBCHDigit(K.G15)>=0;)t^=K.G15<<K.getBCHDigit(t)-K.getBCHDigit(K.G15);return(s<<10|t)^K.G15_MASK},getBCHTypeNumber:function(s){let t=s<<12;for(;K.getBCHDigit(t)-K.getBCHDigit(K.G18)>=0;)t^=K.G18<<K.getBCHDigit(t)-K.getBCHDigit(K.G18);return s<<12|t},getBCHDigit:function(s){let t=0;for(;s!=0;)t++,s>>>=1;return t},getPatternPosition:function(s){return K.PATTERN_POSITION_TABLE[s-1]},getMask:function(s,t,e){switch(s){case Ae.PATTERN000:return(t+e)%2==0;case Ae.PATTERN001:return t%2==0;case Ae.PATTERN010:return e%3==0;case Ae.PATTERN011:return(t+e)%3==0;case Ae.PATTERN100:return(Math.floor(t/2)+Math.floor(e/3))%2==0;case Ae.PATTERN101:return t*e%2+t*e%3==0;case Ae.PATTERN110:return(t*e%2+t*e%3)%2==0;case Ae.PATTERN111:return(t*e%3+(t+e)%2)%2==0;default:throw new Error("bad maskPattern:"+s)}},getErrorCorrectPolynomial:function(s){let t=new dn([1],0);for(let e=0;e<s;e++)t=t.multiply(new dn([1,dt.gexp(e)],0));return t},getLengthInBits:function(s,t){if(1<=t&&t<10)switch(s){case Yt.MODE_NUMBER:return 10;case Yt.MODE_ALPHA_NUM:return 9;case Yt.MODE_8BIT_BYTE:return 8;case Yt.MODE_KANJI:return 8;default:throw new Error("mode:"+s)}else if(t<27)switch(s){case Yt.MODE_NUMBER:return 12;case Yt.MODE_ALPHA_NUM:return 11;case Yt.MODE_8BIT_BYTE:return 16;case Yt.MODE_KANJI:return 10;default:throw new Error("mode:"+s)}else if(t<41)switch(s){case Yt.MODE_NUMBER:return 14;case Yt.MODE_ALPHA_NUM:return 13;case Yt.MODE_8BIT_BYTE:return 16;case Yt.MODE_KANJI:return 12;default:throw new Error("mode:"+s)}else throw new Error("type:"+t)},getLostPoint:function(s){const t=s.getModuleCount();let e=0;for(let r=0;r<t;r++)for(let o=0;o<t;o++){let a=0;const c=s.isDark(r,o);for(let h=-1;h<=1;h++)if(!(r+h<0||t<=r+h))for(let u=-1;u<=1;u++)o+u<0||t<=o+u||h==0&&u==0||c==s.isDark(r+h,o+u)&&a++;a>5&&(e+=3+a-5)}for(let r=0;r<t-1;r++)for(let o=0;o<t-1;o++){let a=0;s.isDark(r,o)&&a++,s.isDark(r+1,o)&&a++,s.isDark(r,o+1)&&a++,s.isDark(r+1,o+1)&&a++,(a==0||a==4)&&(e+=3)}for(let r=0;r<t;r++)for(let o=0;o<t-6;o++)s.isDark(r,o)&&!s.isDark(r,o+1)&&s.isDark(r,o+2)&&s.isDark(r,o+3)&&s.isDark(r,o+4)&&!s.isDark(r,o+5)&&s.isDark(r,o+6)&&(e+=40);for(let r=0;r<t;r++)for(let o=0;o<t-6;o++)s.isDark(o,r)&&!s.isDark(o+1,r)&&s.isDark(o+2,r)&&s.isDark(o+3,r)&&s.isDark(o+4,r)&&!s.isDark(o+5,r)&&s.isDark(o+6,r)&&(e+=40);let n=0;for(let r=0;r<t;r++)for(let o=0;o<t;o++)s.isDark(o,r)&&n++;const i=Math.abs(100*n/t/t-50)/5;return e+=i*10,e}};class dn{num;constructor(t,e){if(t.length==null)throw new Error(t.length+"/"+e);let n=0;for(;n<t.length&&t[n]==0;)n++;this.num=new Array(t.length-n+e);for(let i=0;i<t.length-n;i++)this.num[i]=t[i+n]}get(t){return this.num[t]}getLength(){return this.num.length}multiply(t){const e=new Array(this.getLength()+t.getLength()-1);for(let n=0;n<this.getLength();n++)for(let i=0;i<t.getLength();i++)e[n+i]^=dt.gexp(dt.glog(this.get(n))+dt.glog(t.get(i)));return new dn(e,0)}mod(t){if(this.getLength()-t.getLength()<0)return this;const e=dt.glog(this.get(0))-dt.glog(t.get(0)),n=new Array(this.getLength());for(let i=0;i<this.getLength();i++)n[i]=this.get(i);for(let i=0;i<t.getLength();i++)n[i]^=dt.gexp(dt.glog(t.get(i))+e);return new dn(n,0).mod(t)}}class fe{totalCount;dataCount;constructor(t,e){this.totalCount=t,this.dataCount=e}static RS_BLOCK_TABLE=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]];static getRSBlocks(t,e){const n=fe.getRsBlockTable(t,e);if(n==null)throw new Error("bad rs block @ typeNumber:"+t+"/errorCorrectLevel:"+e);const i=n.length/3,r=[];for(let o=0;o<i;o++){const a=n[o*3+0],c=n[o*3+1],h=n[o*3+2];for(let u=0;u<a;u++)r.push(new fe(c,h))}return r}static getRsBlockTable(t,e){switch(e){case Yn.L:return fe.RS_BLOCK_TABLE[(t-1)*4+0];case Yn.M:return fe.RS_BLOCK_TABLE[(t-1)*4+1];case Yn.Q:return fe.RS_BLOCK_TABLE[(t-1)*4+2];case Yn.H:return fe.RS_BLOCK_TABLE[(t-1)*4+3];default:return}}}class Th{buffer;length;constructor(){this.buffer=[],this.length=0}get(t){const e=Math.floor(t/8);return(this.buffer[e]>>>7-t%8&1)==1}put(t,e){for(let n=0;n<e;n++)this.putBit((t>>>e-n-1&1)==1)}getLengthInBits(){return this.length}putBit(t){const e=Math.floor(this.length/8);this.buffer.length<=e&&this.buffer.push(0),t&&(this.buffer[e]|=128>>>this.length%8),this.length++}}class a0{mode;data;constructor(t){this.mode=Yt.MODE_8BIT_BYTE,this.data=t}getLength(){return this.data.length}write(t){for(let e=0,n=this.data.length;e<n;e++)t.put(this.data.charCodeAt(e),8)}}class ke{static PAD0=236;static PAD1=17;typeNumber;errorCorrectLevel;modules;moduleCount;dataCache;dataList;constructor(t,e){this.typeNumber=t,this.errorCorrectLevel=Yn[e],this.modules=[],this.moduleCount=0,this.dataCache=null,this.dataList=[]}addData(t){const e=new a0(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=fe.getRSBlocks(t,this.errorCorrectLevel),n=new Th;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 o=this.dataList[r];n.put(o.mode,4),n.put(o.getLength(),K.getLengthInBits(o.mode,t)),o.write(n)}if(n.getLengthInBits()<=i*8)break}this.typeNumber=t}this.makeImpl(!1,this.getBestMaskPattern())}makeImpl(t,e){this.moduleCount=this.typeNumber*4+17,this.modules=new Array(this.moduleCount);for(let n=0;n<this.moduleCount;n++){this.modules[n]=new Array(this.moduleCount);for(let i=0;i<this.moduleCount;i++)this.modules[n][i]=null}this.setupPositionProbePattern(0,0),this.setupPositionProbePattern(this.moduleCount-7,0),this.setupPositionProbePattern(0,this.moduleCount-7),this.setupPositionAdjustPattern(),this.setupTimingPattern(),this.setupTypeInfo(t,e),this.typeNumber>=7&&this.setupTypeNumber(t),this.dataCache==null&&(this.dataCache=ke.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,e)}setupPositionProbePattern(t,e){for(let n=-1;n<=7;n++)if(!(t+n<=-1||this.moduleCount<=t+n))for(let i=-1;i<=7;i++)e+i<=-1||this.moduleCount<=e+i||(0<=n&&n<=6&&(i==0||i==6)||0<=i&&i<=6&&(n==0||n==6)||2<=n&&n<=4&&2<=i&&i<=4?this.modules[t+n][e+i]=!0:this.modules[t+n][e+i]=!1)}getBestMaskPattern(){let t=0,e=0;for(let n=0;n<8;n++){this.makeImpl(!0,n);const i=K.getLostPoint(this);(n==0||t>i)&&(t=i,e=n)}return e}createMovieClip(t,e,n){const i=t.createEmptyMovieClip(e,n),r=1;this.make();for(let o=0;o<this.modules.length;o++){const a=o*r;for(let c=0;c<this.modules[o].length;c++){const h=c*r;this.modules[o][c]&&(i.beginFill(0,100),i.moveTo(h,a),i.lineTo(h+r,a),i.lineTo(h+r,a+r),i.lineTo(h,a+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=K.getPatternPosition(this.typeNumber);for(let e=0;e<t.length;e++)for(let n=0;n<t.length;n++){const i=t[e],r=t[n];if(this.modules[i][r]==null)for(let o=-2;o<=2;o++)for(let a=-2;a<=2;a++)o==-2||o==2||a==-2||a==2||o==0&&a==0?this.modules[i+o][r+a]=!0:this.modules[i+o][r+a]=!1}}setupTypeNumber(t){const e=K.getBCHTypeNumber(this.typeNumber);for(let n=0;n<18;n++){const i=!t&&(e>>n&1)==1;this.modules[Math.floor(n/3)][n%3+this.moduleCount-8-3]=i}for(let n=0;n<18;n++){const i=!t&&(e>>n&1)==1;this.modules[n%3+this.moduleCount-8-3][Math.floor(n/3)]=i}}setupTypeInfo(t,e){const n=this.errorCorrectLevel<<3|e,i=K.getBCHTypeInfo(n);for(let r=0;r<15;r++){const o=!t&&(i>>r&1)==1;r<6?this.modules[r][8]=o:r<8?this.modules[r+1][8]=o:this.modules[this.moduleCount-15+r][8]=o}for(let r=0;r<15;r++){const o=!t&&(i>>r&1)==1;r<8?this.modules[8][this.moduleCount-r-1]=o:r<9?this.modules[8][15-r-1+1]=o:this.modules[8][15-r-1]=o}this.modules[this.moduleCount-8][8]=!t}mapData(t,e){let n=-1,i=this.moduleCount-1,r=7,o=0;for(let a=this.moduleCount-1;a>0;a-=2)for(a==6&&a--;;){for(let c=0;c<2;c++)if(this.modules[i][a-c]==null){let h=!1;o<t.length&&(h=(t[o]>>>r&1)==1),K.getMask(e,i,a-c)&&(h=!h),this.modules[i][a-c]=h,r--,r==-1&&(o++,r=7)}if(i+=n,i<0||this.moduleCount<=i){i-=n,n=-n;break}}}static createData(t,e,n){const i=fe.getRSBlocks(t,e),r=new Th;for(let a=0;a<n.length;a++){const c=n[a];r.put(c.mode,4),r.put(c.getLength(),K.getLengthInBits(c.mode,t)),c.write(r)}let o=0;for(let a=0;a<i.length;a++)o+=i[a].dataCount;if(r.getLengthInBits()>o*8)throw new Error("code length overflow. ("+r.getLengthInBits()+">"+o*8+")");for(r.getLengthInBits()+4<=o*8&&r.put(0,4);r.getLengthInBits()%8!=0;)r.putBit(!1);for(;!(r.getLengthInBits()>=o*8||(r.put(ke.PAD0,8),r.getLengthInBits()>=o*8));)r.put(ke.PAD1,8);return ke.createBytes(r,i)}static createBytes(t,e){let n=0,i=0,r=0;const o=new Array(e.length),a=new Array(e.length);for(let l=0;l<e.length;l++){const d=e[l].dataCount,f=e[l].totalCount-d;i=Math.max(i,d),r=Math.max(r,f),o[l]=new Array(d);for(let x=0;x<o[l].length;x++)o[l][x]=255&t.buffer[x+n];n+=d;const p=K.getErrorCorrectPolynomial(f),b=new dn(o[l],p.getLength()-1).mod(p);a[l]=new Array(p.getLength()-1);for(let x=0;x<a[l].length;x++){const g=x+b.getLength()-a[l].length;a[l][x]=g>=0?b.get(g):0}}let c=0;for(let l=0;l<e.length;l++)c+=e[l].totalCount;const h=new Array(c);let u=0;for(let l=0;l<i;l++)for(let d=0;d<e.length;d++)l<o[d].length&&(h[u++]=o[d][l]);for(let l=0;l<r;l++)for(let d=0;d<e.length;d++)l<a[d].length&&(h[u++]=a[d][l]);return h}}const Eh=Math.ceil,Un=Math.floor,Ph=Math.round;function c0(s,t){const e=aa(s),n=t?.ecc||"H",i=t?.size||256,r=-1,o=t?.padding||0,a=t?.color||"#000000",c=t?.background||"#ffffff",h=new ke(r,n);h.addData(e),h.make();const u=h.getModuleCount(),l=(i-o*2)/u,d=o,f=i-o;return Ch(i,a,c,function(p,w){if(d<=p&&p<f&&d<=w&&w<f){const b=Un((p-d)/l),x=Un((w-d)/l);return h.isDark(x,b)?0:1}else return 1})}function h0(s,t){const e=t.x||0,n=t.y||0,i=aa(s),r=t.ctx,o=t.ecc||"H",a=typeof t.size=="number"?Un(t.size):256,c=t.padding||0,h=-1,u=t.color||"#000000",l=t.background||"#ffffff",d=new ke(h,o);d.addData(i),d.make();const f=d.getModuleCount(),p=(a-c*2)/f;r.fillStyle=l,r.fillRect(e,n,a,a);for(let w=0;w<f;w++)for(let b=0;b<f;b++){const x=Eh((b+1)*p)-Un(b*p),g=Eh((w+1)*p)-Un(w*p);r.fillStyle=d.isDark(w,b)?u:l,r.fillRect(e+Ph(b*p)+c,n+Ph(w*p)+c,x,g)}}const Ys=()=>{const s=navigator.userAgent.toLowerCase();let t="Unknown";return/iphone|ipad|ipod/i.test(s)?t="iOS":/android/i.test(s)?t="Android":/BlackBerry/i.test(s)?t="BlackBerry":/mac/i.test(s)?t="macOS":/win/i.test(s)?t="Windows":/linux/i.test(s)?t="Linux":/bsd/i.test(s)&&(t="BSD"),t.toLowerCase()};function u0(s=navigator.userAgent){let t="Unknown";if(/iPhone|iPad|iPod/i.test(s)){const e=s.match(/OS (\d+_\d+)/i);e&&(t=e[1].replace("_","."))}else if(/Android/i.test(s)){const e=s.match(/Android (\d+\.\d+)/i);e&&(t=e[1])}else if(/Mac OS X/i.test(s)){const e=s.match(/Mac OS X (\d+_\d+)/i);e&&(t=e[1].replace("_","."))}else if(/Windows NT/i.test(s)){const e=s.match(/Windows NT (\d+\.\d+)/i);e&&(t=e[1])}return t.toLowerCase()}function l0(s,t){const e=s.split("."),n=t.split(".");for(let i=0,r=e.length;i<r;i++){if(n.length==i)return 1;if(e[i]!=n[i])return e[i]>n[i]?1:-1}return e.length!=n.length?-1:0}function Gr(){const s=navigator.userAgent.toLowerCase();let t="Unknown";return/opr/i.test(s)||/opera/i.test(s)?t="Opera":/chrome/i.test(s)?t="Chrome":/firefox/i.test(s)?t="Firefox":/safari/i.test(s)?t="Safari":/edge/i.test(s)?t="Edge":/msie|trident/i.test(s)?t="IE":/MicroMessenger/i.test(s)?t="Wechat":/alipay/i.test(s)&&(t="Ali"),t.toLowerCase()}const f0=()=>{const s=navigator.userAgent;let t="Unknown";if(/Chrome/.test(s)){const e=s.match(/Chrome\/(\d+\.\d+)/);e&&(t=e[1])}else if(/Firefox/.test(s)){const e=s.match(/Firefox\/(\d+\.\d+)/);e&&(t=e[1])}else if(/Safari/.test(s)){const e=s.match(/Version\/(\d+\.\d+)/);e&&(t=e[1])}else if(/Edge/.test(s)){const e=s.match(/Edge\/(\d+\.\d+)/);e&&(t=e[1])}else if(/MSIE|Trident/.test(s)){const e=s.match(/(?:MSIE|rv:)(\d+\.\d+)/);e&&(t=e[1])}return t};function d0(){return(navigator.browserLanguage||navigator.language).toLowerCase()}function m0(){return Intl.DateTimeFormat().resolvedOptions().timeZone.toLowerCase()}function qr(){return Ys()==="ios"}function Mh(){return Ys()==="macos"}function p0(){return qr()|Mh()}function Ah(){return Ys()==="android"}function g0(){return qr()||Ah()}function kh(){const s=window.navigator.userAgent,t=s.indexOf("MSIE ");if(t>0)return parseInt(s.substring(t+5,s.indexOf(".",t)),10);if(s.indexOf("Trident/")>0){const i=s.indexOf("rv:");return parseInt(s.substring(i+3,s.indexOf(".",i)),10)}const n=s.indexOf("Edge/");return n>0?parseInt(s.substring(n+5,s.indexOf(".",n)),10):-1}const y0=kh()!==-1,w0=document.documentMode?document.documentMode===9:!1,x0=document.documentMode?document.documentMode===10:!1,b0=document.documentMode?document.documentMode===11:!1;function Ih(){return Gr()==="wechat"}function Dh(){return Gr()==="ali"}function v0(){return Ih()&&navigator.userAgent.match(/miniprogram/i)||window.__wxjs_environment==="miniprogram"}function _0(){return Dh()&&navigator.userAgent.match(/miniprogram/i)}const S0=typeof document<"u",Rh=typeof window<"u",C0=typeof history<"u",T0=Rh&&window.File&&window.FileReader&&window.FileList&&window.Blob,Lh=(()=>!!(Tt.Worker&&Tt.Blob&&Tt.Promise&&Tt.OffscreenCanvas&&Tt.OffscreenCanvasRenderingContext2D&&Tt.HTMLCanvasElement&&Tt.HTMLCanvasElement.prototype.transferControlToOffscreen&&Tt.URL&&Tt.URL.createObjectURL))(),E0=typeof Path2D=="function"&&typeof DOMMatrix=="function",Oh=function(){if(!Tt.OffscreenCanvas)return!1;const s=new OffscreenCanvas(1,1),t=s.getContext("2d");t.fillRect(0,0,1,1);const e=s.transferToImageBitmap();try{t.createPattern(e,"no-repeat")}catch{return!1}return!0}(),P0=typeof HTMLElement=="object"?function(t){return t instanceof HTMLElement}:function(t){return t&&typeof t=="object"&&t.nodeType===1&&typeof t.nodeName=="string"},M0="webkit moz ms o".split(" ");function A0(){return"ontouchstart"in window||"ontouchend"in document||navigator.maxTouchPoints>0}const Us=new Bn,ct=new Bt;function Xn(s,t){switch(t.constructor){case Float32Array:return s;case Uint32Array:return s/4294967295;case Uint16Array:return s/65535;case Uint8Array:return s/255;case Int32Array:return Math.max(s/2147483647,-1);case Int16Array:return Math.max(s/32767,-1);case Int8Array:return Math.max(s/127,-1);default:throw new Error("Invalid component type.")}}function Lt(s,t){switch(t.constructor){case Float32Array:return s;case Uint32Array:return Math.round(s*4294967295);case Uint16Array:return Math.round(s*65535);case Uint8Array:return Math.round(s*255);case Int32Array:return Math.round(s*2147483647);case Int16Array:return Math.round(s*32767);case Int8Array:return Math.round(s*127);default:throw new Error("Invalid component type.")}}class de{array;itemSize;count;normalized;updateRanges;version;constructor(t,e,n=!1){if(Array.isArray(t))throw new TypeError("BufferAttribute: array should be a Typed Array.");this.array=t,this.itemSize=e,this.count=t.length/e,this.normalized=n,this.updateRanges=[],this.version=0}_onChangeCallback(){}set needsUpdate(t){t===!0&&this.version++}addUpdateRange(t,e){this.updateRanges.push({start:t,count:e})}clearUpdateRanges(){this.updateRanges.length=0}copy(t){return this.array=Dl(t.array),this.itemSize=t.itemSize,this.count=t.count,this.normalized=t.normalized,this}copyAt(t,e,n){t*=this.itemSize,n*=e.itemSize;for(let i=0,r=this.itemSize;i<r;i++)this.array[t+i]=e.array[n+i];return this}copyArray(t){return this.array.set(t),this}applyMatrix3(t){if(this.itemSize===2)for(let e=0,n=this.count;e<n;e++)Us.fromBufferAttribute(this,e),Us.applyMatrix3(t),this.setXY(e,Us.x,Us.y);else if(this.itemSize===3)for(let e=0,n=this.count;e<n;e++)ct.fromBufferAttribute(this,e),ct.applyMatrix3(t),this.setXYZ(e,ct.x,ct.y,ct.z);return this}applyMatrix4(t){for(let e=0,n=this.count;e<n;e++)ct.fromBufferAttribute(this,e),ct.applyMatrix4(t),this.setXYZ(e,ct.x,ct.y,ct.z);return this}applyNormalMatrix(t){for(let e=0,n=this.count;e<n;e++)ct.fromBufferAttribute(this,e),ct.applyNormalMatrix(t),this.setXYZ(e,ct.x,ct.y,ct.z);return this}transformDirection(t){for(let e=0,n=this.count;e<n;e++)ct.fromBufferAttribute(this,e),ct.transformDirection(t),this.setXYZ(e,ct.x,ct.y,ct.z);return this}set(t,e=0){return this.array.set(t,e),this}getComponent(t,e){let n=this.array[t*this.itemSize+e];return this.normalized&&(n=Xn(n,this.array)),n}setComponent(t,e,n){return this.normalized&&(n=Lt(n,this.array)),this.array[t*this.itemSize+e]=n,this}getX(t){let e=this.array[t*this.itemSize];return this.normalized&&(e=Xn(e,this.array)),e}setX(t,e){return this.normalized&&(e=Lt(e,this.array)),this.array[t*this.itemSize]=e,this}getY(t){let e=this.array[t*this.itemSize+1];return this.normalized&&(e=Xn(e,this.array)),e}setY(t,e){return this.normalized&&(e=Lt(e,this.array)),this.array[t*this.itemSize+1]=e,this}getZ(t){let e=this.array[t*this.itemSize+2];return this.normalized&&(e=Xn(e,this.array)),e}setZ(t,e){return this.normalized&&(e=Lt(e,this.array)),this.array[t*this.itemSize+2]=e,this}getW(t){let e=this.array[t*this.itemSize+3];return this.normalized&&(e=Xn(e,this.array)),e}setW(t,e){return this.normalized&&(e=Lt(e,this.array)),this.array[t*this.itemSize+3]=e,this}setXY(t,e,n){return t*=this.itemSize,this.normalized&&(e=Lt(e,this.array),n=Lt(n,this.array)),this.array[t+0]=e,this.array[t+1]=n,this}setXYZ(t,e,n,i){return t*=this.itemSize,this.normalized&&(e=Lt(e,this.array),n=Lt(n,this.array),i=Lt(i,this.array)),this.array[t+0]=e,this.array[t+1]=n,this.array[t+2]=i,this}setXYZW(t,e,n,i,r){return t*=this.itemSize,this.normalized&&(e=Lt(e,this.array),n=Lt(n,this.array),i=Lt(i,this.array),r=Lt(r,this.array)),this.array[t+0]=e,this.array[t+1]=n,this.array[t+2]=i,this.array[t+3]=r,this}onChange(t){return this._onChangeCallback=t,this}clone(){return la(this,this.array,this.itemSize,this.normalized).copy(this)}toJSON(){return{itemSize:this.itemSize,type:this.array.constructor.name,array:Array.from(this.array),normalized:this.normalized}}}class k0 extends de{constructor(t,e,n=!1){super(new Int8Array(t),e,n)}}class I0 extends de{constructor(t,e,n=!1){super(new Uint8Array(t),e,n)}}class D0 extends de{constructor(t,e,n=!1){super(new Uint8ClampedArray(t),e,n)}}class R0 extends de{constructor(t,e,n=!1){super(new Int16Array(t),e,n)}}class L0 extends de{constructor(t,e,n=!1){super(new Uint16Array(t),e,n)}}class O0 extends de{constructor(t,e,n=!1){super(new Int32Array(t),e,n)}}class z0 extends de{constructor(t,e,n=!1){super(new Uint32Array(t),e,n)}}class F0 extends de{constructor(t,e,n=!1){super(new Float32Array(t),e,n)}}const zh={map:new Map,transform:function(s){if(Oh)return s;if(this.map.has(s))return this.map.get(s);const t=new OffscreenCanvas(s.width,s.height);return t.getContext("2d")?.drawImage(s,0,0),this.map.set(s,t),t},clear:function(){this.map.clear()}};function B0(s,t,e){const n=new OffscreenCanvas(s,t),i=n.getContext("2d");if(i)return e(i),n.transferToImageBitmap()}function N0(s,t,e){const n=s.createPattern(zh.transform(t),"no-repeat");if(n){const i=Br(e);n.setTransform(i),s.fillStyle=n}}function Fh(s){return window.URL.createObjectURL(s)}function Y0(s){return window.URL.revokeObjectURL(s)}function Bh(s){let t=!1,e;function n(){document.readyState==="loading"||t||(s(),e?.(),t=!0)}try{e=j(document,"DOMContentLoaded",n)}catch{e=j(window,"load",n)}return n(),()=>{t||e()}}function Nh(s){return j(window,"beforeunload",t=>{s(t)})}async function U0(s,t=6e4){return new Promise((e,n)=>{const i=document.createElement("script");i.type="text/javascript",i.async=!1,i.onload=o=>{clearTimeout(r),e(o),i.onerror=i.onload=null},i.onerror=o=>{clearTimeout(r),n(o)},i.src=s;const r=setTimeout(()=>{n("Timeout!")},t);document.body.appendChild(i)})}function Xs(s,t){const e=document.createElement("a");e.style.visibility="hidden",e.download=t,typeof s=="string"?e.href=s:e.href=window.URL.createObjectURL(s),e.click()}async function X0(s,t=document.getElementsByTagName("head")[0],e=6e4){return new Promise((n,i)=>{const r=document.createElement("link");r.setAttribute("type","text/css"),r.setAttribute("rel","stylesheet"),r.onload=a=>{clearTimeout(o),n(a),r.onerror=r.onload=null},r.onerror=a=>{clearTimeout(o),i(a)},r.setAttribute("href",s);const o=setTimeout(()=>{i("Timeout!")},e);t.appendChild(r)})}function $0(){return new Promise(s=>{const t=Array.from(document.querySelectorAll("link[rel=stylesheet]"));let e=document.styleSheets.length||0;const n=()=>e>=t.length?(s(),!0):!1;n()||t.forEach(i=>{i.onload=()=>{e+=1,n()}})})}const Yh=new cs;async function Uh(s,t=6e4){return new Promise((e,n)=>{const i=typeof s=="string"?s:Fh(s),r=Yh.get(i);if(r)return e(r);const o=document.createElement("img");o.onload=()=>{clearTimeout(a);const c=o.naturalWidth||o.width,h=o.naturalHeight||o.height,u={width:c,height:h,aspectRatio:c/h,element:o,imageData:xh(o)};Yh.set(i,u),e(u),o.onerror=o.onload=null},o.onerror=c=>{clearTimeout(a),n(c)},o.src=i;const a=setTimeout(()=>{n("Timeout!")},t)})}async function Xh(s=Xt.text,t=["*"]){const n=(await Qi(t))[0],i=await Tn(n,s);return{type:n.type,name:n.name,size:n.size,data:i}}async function V0(s=["image/*"]){const e=(await Qi(s))[0];if(!e.type.match(/image\/*/))return new Error("Not Image Type!");const n=await Tn(e,Xt.arraybuffer),i=xi(n),r=await Uh(i);return{type:e.type,name:e.name,size:e.size,data:n,width:r.width,height:r.height,aspectRatio:r.aspectRatio,imageData:r.imageData}}function G0(){return window.getSelection()?.toString()||""}function q0(s){document.getElementsByTagName("title")[0].innerText=s,document.title=s}function j0(s=200){"vibrate"in navigator?window.navigator.vibrate(s):console.error("Your device is not support vibrate on this browser.")}async function H0(s){if(navigator.clipboard)return await navigator.clipboard.writeText(s);{const t=document.createElement("textarea");return t.value=s,t.style.opacity="0",t.style.position="fixed",t.style.top="0",t.style.left="0",t.focus(),t.select(),document.execCommand("copy")}}function W0(s,t){window.scrollTo(s,t)}function J0(){let s=xa,t=xa;return"scrollRestoration"in window.history&&(window.history.scrollRestoration="manual",s=Nh(()=>{window.history.scrollRestoration="auto"}),t=Bh(()=>{window.history.scrollRestoration="manual"})),()=>{s(),t()}}function Z0(s){return/(html|body)/i.test(s.tagName)||s===document.documentElement}const Q0=s=>s===document.activeElement&&(s.type||s.href),jr=function(){return parseFloat(getComputedStyle(document.documentElement).fontSize)};function K0(s){return s*jr()}function t1(s){return s.parentElement?parseFloat(getComputedStyle(s.parentElement).fontSize):jr()}const e1=s=>{let t=s;for(;t&&t.nodeType!==1&&t.parentElement;)t=t.parentElement;return t},n1=s=>s.parentElement,Hr=(s,t=[])=>!s||s.parentElement===null&&s.parentNode===null?t:Hr(s.parentElement,t.concat([s]));function s1(s){const t=Hr(s);for(let e=0,n=t.length;e<n;e++)if(/(auto|scroll)/.test($e(t[e],"overflow")+$e(t[e],"overflow-y")+$e(t[e],"overflow-x")))return t[e];return document.scrollingElement||document.documentElement}const i1=(s,t)=>s.contains?s!=t&&s.contains(t):!!(s.compareDocumentPosition(t)&16),r1=s=>Array.prototype.slice.call(s.parentElement?.children).filter(t=>t!==s),o1=s=>s.nextElementSibling,a1=s=>s.previousElementSibling,c1=(s,t)=>s.closest(t),h1=s=>s.shadowRoot,$n=s=>s.tagName==="INPUT"||s instanceof HTMLInputElement,Wr=s=>s.tagName==="SELECT"||s instanceof HTMLSelectElement,u1=s=>s.tagName==="TEXTAREA"||s instanceof HTMLTextAreaElement,Jr=s=>$n(s)&&s.getAttribute("type")==="checkbox",Zr=s=>$n(s)&&s.getAttribute("type")==="radio",l1=s=>$n(s)&&s.getAttribute("type")==="text",f1=s=>$n(s)&&s.getAttribute("type")==="number";function d1(s,t){if(Wr(s)){const e=s.options;for(let n=0,i=e.length;n<i;n++)e[n].selected=e[n].value==t}}function m1(s,t){if(Zr(s)){const e=document.getElementsByName(s.name);for(let n=0,i=e.length;n<i;n++){const r=e[n];r.checked=r.value==t}}}function p1(s,t){Jr(s)&&(s.checked=t)}const Vn=(s,t,e="append")=>{typeof t=="string"?s[e](jh(t)):s[e](t)},$h=function(s,t){if(typeof t=="string"){s.innerHTML=t;const e=Wh(s);e!=s&&(s=e)}else Vn(t,"replaceWith")},Vh=function(s){$h(s,"")},g1=(s,t)=>{s.textContent=t},y1=s=>{if(s instanceof SVGElement)return"";let t=s.innerText;if(!t){const e=s.querySelector("slot")?.assignedNodes()||[];let n=0;for(;!t&&n<=e.length-1;)"innerText"in e[n]&&(t=e[n].innerText),n++}return t},w1=s=>s.remove();function x1(s,t){$e(s,"display")=="none"&&t===void 0||t===!0?Gh(s):qh(s)}function Gh(s){Nr(s,"display",s instanceof HTMLTableRowElement?"table-row":s instanceof HTMLTableCellElement?"table-cell":"block")}function qh(s){Nr(s,"display","none")}function Qr(s,t,e="toggle"){const n=t.split(/[,\s]+/);if(s.classList)n.forEach(i=>{const r=i.trim();r!==""&&s.classList[e](r)});else{const i=s.className.split(/ +/);let r=!1;n.forEach(o=>{const a=o.trim();if(a!==""){const c=i.indexOf(a);switch(e){case"add":c===-1&&(i.push(a),r=!0);break;case"remove":c!==-1&&(i.splice(c,1),r=!0);break;case"toggle":c===-1?i.push(a):i.splice(c,1),r=!0;break}}}),r&&Ve(s,"class",i.join(" ").replace(/^\s+/,"").replace(/\s+$/,""))}}function b1(s,t){Qr(s,t,"add")}function v1(s,t){Qr(s,t,"remove")}function _1(s,t){return new RegExp("(?:^|\\s+)"+t+"(?:\\s+|$)").test(s.className)||!1}function jh(s,t=!1){const e=document.createElement("template");return e.innerHTML=s,t&&e.content.childNodes.forEach(n=>{const i=Wh(n);i!=n&&e.content.replaceChild(i,n)}),e.content}function Hh(s){return document.createElement.call(document,s)}function S1(s){return document.createElementNS("http://www.w3.org/1999/xhtml",s)}function C1(s){return document.createTextNode.call(document,s)}function Wh(s){return s.tagName=="SCRIPT"&&(s=Jh(s)),s.querySelectorAll&&s.querySelectorAll("script").forEach(t=>{t.parentNode?.replaceChild(Jh(t),t)}),s}function Jh(s){const t=s.ownerDocument.createElement("script");t.text=s.text;const e=s.attributes;for(let n=0,i=e.length;n<i;n++)t.setAttribute(e[n].name,e[n].value);return t}function T1(s,t="http://test.com/localstorage.html"){const e=document.createElement("iframe");e.src=t,document.body.append(e),setTimeout(function(){e.contentWindow?.postMessage(s,t)},4e3),setTimeout(function(){e.remove()},6e3)}function E1(s){const t=new Proxy(window,{get(e,n,i){if(typeof n=="string"&&["open","location","document"].includes(n))throw new Error(`禁止访问 key: ${n}`);return n==="window"?t:Reflect.get(e,n,i)},set(e,n,i,r){return Reflect.set(e,n,i,r)}});new Function("window",`with(window) { ${s} }`)(t,null)}function Kr(){return{x:0,y:0,isDown:!1}}function Ge(){const s=Kr(),t=Kr();return{start:s,current:t,setStart:function(e,n){s.x=e.x,s.y=e.y,s.isDown=typeof n=="boolean"?n:typeof e.isDown=="boolean"?e.isDown:!1,this.setCurrent(e,n)},setCurrent:(e,n)=>{t.x=e.x,t.y=e.y,t.isDown=typeof n=="boolean"?n:typeof e.isDown=="boolean"?e.isDown:!1}}}function $s(s=document.documentElement,t=!1){return X(s,"mousemove",t)}function Zh(s=document.documentElement,t=!1){return X(s,"mousedown",t)}function Qh(s=document.documentElement,t=!1){return X(s,"mouseup",t)}function P1(s=document.documentElement,t=!1){return X(s,"mouseover",t)}function M1(s=document.documentElement,t=!1){return X(s,"mouseout",t)}function A1(s=document.documentElement,t=!1){return X(s,"mouseenter",t)}function k1(s=document.documentElement,t=!1){return X(s,"mouseleave",t)}function I1(s=document.documentElement,t=!1){return X(s,"click",t)}function D1(s=document.documentElement,t=!1){return X(s,"dblclick",t)}function R1(s=document.documentElement,t=!1){return X(s,"onwheel"in document.createElement("div")?"wheel":document.onmousewheel!==void 0?"mousewheel":"DOMMouseScroll",t)}function L1(s=document.documentElement,t=!1){return X(s,"contextmenu",t)}function Kh(s=document.documentElement,t=!1){return X(s,"touchmove",t)}function tu(s=document.documentElement,t=!1){return X(s,"touchstart",t)}function eu(s=document.documentElement,t=!1){return X(s,"touchend",t)}function nu(s=document.documentElement,t=!1){return X(s,"touchcancel",t)}function to(s=document.documentElement,t=!1){return X(s,"pointermove",t)}function eo(s=document.documentElement,t=!1){return X(s,"pointerdown",t)}function no(s=document.documentElement,t=!1){return X(s,"pointerup",t)}function so(s=document.documentElement,t=!1){return X(s,"pointercancel",t)}function O1(s=document.documentElement){const t=new et(s);return st(e=>{t.on("pan",e)},e=>{t.off("pan",e)})}function z1(s=document.documentElement){const t=new et(s);return st(e=>{t.on("panmove",e)},e=>{t.off("panmove",e)})}function F1(s=document.documentElement){const t=new et(s);return st(e=>{t.on("panstart",e)},e=>{t.off("panstart",e)})}function B1(s=document.documentElement){const t=new et(s);return st(e=>{t.on("panend",e)},e=>{t.off("panend",e)})}function N1(s=document.documentElement){const t=new et(s);return st(e=>{t.on("pancancel",e)},e=>{t.off("pancancel",e)})}function Y1(s=document.documentElement){const t=new et(s);return st(e=>{t.on("panleft",e)},e=>{t.off("panleft",e)})}function U1(s=document.documentElement){const t=new et(s);return st(e=>{t.on("panright",e)},e=>{t.off("panright",e)})}function X1(s=document.documentElement){const t=new et(s);return st(e=>{t.on("panup",e)},e=>{t.off("panup",e)})}function $1(s=document.documentElement){const t=new et(s);return st(e=>{t.on("pandown",e)},e=>{t.off("pandown",e)})}function V1(s=document.documentElement){const t=new et(s);return st(e=>{t.on("pinch",e)},e=>{t.off("pinch",e)})}function G1(s=document.documentElement){const t=new et(s);return st(e=>{t.on("pinchin",e)},e=>{t.off("pinchin",e)})}function q1(s=document.documentElement){const t=new et(s);return st(e=>{t.on("pinchout",e)},e=>{t.off("pinchout",e)})}function j1(s=document.documentElement){const t=new et(s);return st(e=>{t.on("press",e)},e=>{t.off("press",e)})}function H1(s=document.documentElement){const t=new et(s);return st(e=>{t.on("rotate",e)},e=>{t.off("rotate",e)})}function W1(s=document.documentElement){const t=new et(s);return st(e=>{t.on("swipe",e)},e=>{t.off("swipe",e)})}function J1(s=document.documentElement){const t=new et(s);return st(e=>{t.on("swipeleft",e)},e=>{t.off("swipeleft",e)})}function Z1(s=document.documentElement){const t=new et(s);return st(e=>{t.on("swiperight",e)},e=>{t.off("swiperight",e)})}function Q1(s=document.documentElement){const t=new et(s);return st(e=>{t.on("swipeup",e)},e=>{t.off("swipeup",e)})}function K1(s=document.documentElement){const t=new et(s);return st(e=>{t.on("swipedown",e)},e=>{t.off("swipedown",e)})}function ty(s=document.documentElement){const t=new et(s);return st(e=>{t.on("tap",e)},e=>{t.off("tap",e)})}function ey(s=document.documentElement){const t=new et(document.documentElement);return st(e=>{const n=i=>{!i.target||s==i.target||s.contains(i.target)||e(i)};return t.on("tap",n),n},(e,n)=>{t.off("tap",n)})}function ny(s=document.documentElement,t=!1){return X(s,"transitionstart",t)}function sy(s=document.documentElement,t=!1){return X(s,"transitionend",t)}function iy(s=document.documentElement,t=!1){return X(s,"animationstart",t)}function ry(s=document.documentElement,t=!1){return X(s,"animationend",t)}function su(s=document.documentElement,t=!1){return X(s,"drag",t)}function iu(s=document.documentElement,t=!1){return X(s,"dragstart",t)}function ru(s=document.documentElement,t=!1){return X(s,"dragend",t)}function ou(s=document.documentElement,t=!1){return X(s,"drop",t)}function au(s=document.documentElement,t=!1){return X(s,"dragenter",t)}function cu(s=document.documentElement,t=!1){return X(s,"dragleave",t)}function hu(s=document.documentElement,t=!1){return X(s,"dragover",t)}function uu(s=document.documentElement,t=!1){return X(s,"keydown",t)}function lu(s=document.documentElement,t=!1){return X(s,"keyup",t)}function oy(s=document.documentElement,t=!1){return X(s,"keypress",t)}function ay(s=document.documentElement,t){const e=t?.useMousePoint||Ge();return $s(s).pipe(rt(n=>(e.setCurrent(lt(n,s)),e)))}function cy(s=document.documentElement,t){const e=t?.useMousePoint||Ge();return $s(s).pipe(Ap(Zh(s).pipe(Ye(n=>{e.setStart(lt(n,s),!0),t?.start?.(n,e)})),()=>Qh(s).pipe(Ye(n=>{e.setCurrent(lt(n,s),!1),t?.end?.(n,e)}))),Ep(),rt(n=>(e.setCurrent(lt(n,s),!0),e)))}function hy(s=document.documentElement,t){const e=t?.useMousePoint||Ge();return tu(s).pipe(Ye(n=>{const i=n.changedTouches[0];e.setStart(lt(i,s),!0),t?.start?.(i,e)}),ks(()=>Kh(s).pipe(mr(dr(eu(s),nu(s)).pipe(Ye(n=>{const i=n.changedTouches[0];e.setCurrent(lt(i,s),!1),t?.end?.(i,e)}))))),rt(n=>{const i=n.changedTouches[0];return e.setCurrent(lt(i,s),!0),e}))}function fu(s=document.documentElement,t){const e=t?.useMousePoint||Ge();return eo(s).pipe(Ye(n=>{e.setStart(lt(n,s),!0),t?.start?.(n,e)}),ks(()=>to(s).pipe(mr(dr(no(s),so(s)).pipe(Ye(n=>{e.setCurrent(lt(n,s),!1),t?.end?.(n,e)}))))),rt(n=>(e.setCurrent(lt(n,s),!0),e)))}function du(s=document.documentElement,t){const e=t?.useMousePoint||Ge();return vp($s(s),eo(s)).pipe(Gc(n=>n instanceof PointerEvent?(e.setStart(lt(n,s),!0),t?.start?.(n,e),to(s).pipe(mr(dr(no(s),so(s)).pipe(Ye(i=>{e.setCurrent(lt(i,s),!1),t?.end?.(i,e)}))))):n instanceof MouseEvent?Jm(n):Pc),rt(n=>(e.setCurrent(lt(n,s),n instanceof PointerEvent),e)))}function uy(s){return new nt(t=>fu(s,{start:()=>{t.next(0)},end:(n,i)=>{t.next(i.current.x-i.start.x)}}).subscribe(n=>{t.next(n.current.y-n.start.y)}).unsubscribe).pipe(_e())}function ly(s,t){fn(s,"draggable","true");const e=iu(s,!0).subscribe(r=>{Ce(r),qc(r);const o=r.dataTransfer;o&&(o.effectAllowed="move",o.setData("text/plain","some-data")),t?.onStart?.(r)}),n=su(s).subscribe(r=>{Ce(r),t?.onDrag?.(r)}),i=ru(s).subscribe(r=>{Ce(r),t?.onEnd?.(r)});return()=>{e.unsubscribe(),n.unsubscribe(),i.unsubscribe()}}function fy(s,t){const e=au(s).subscribe(o=>{Ce(o),t?.onEnter?.(o)}),n=hu(s).subscribe(o=>{Ce(o);const a=o.dataTransfer;a&&(a.dropEffect="move"),t?.onOver?.(o)}),i=cu(s).subscribe(o=>{Ce(o),t?.onLeave?.(o)}),r=ou(s).subscribe(o=>{Ce(o);const a=o.dataTransfer;if(!a){t?.onDrop?.(o,[]);return}t?.onDrop?.(o,[...a.files])});return()=>{e.unsubscribe(),n.unsubscribe(),i.unsubscribe(),r.unsubscribe()}}function mu(s=100){return X(document,"scroll",!0).pipe(Mp(s))}function dy(){return X(window,"visibilitychange",!0).pipe(rt(()=>!document.hidden),_e())}function my(){return{screenWidth:window.screen.width,screenHeight:window.screen.height,screenX:window.screenX,screenY:window.screenY}}function Gn(){const s=document.documentElement;return{clientWidth:s.clientWidth,clientHeight:s.clientHeight,clientTop:s.clientTop,clientLeft:s.clientLeft,scrollWidth:s.scrollWidth,scrollHeight:s.scrollHeight,scrollTop:s.scrollTop,scrollLeft:s.scrollLeft,offsetWidth:s.offsetWidth,offsetHeight:s.offsetHeight,offsetTop:s.offsetTop,offsetLeft:s.offsetLeft,offsetParent:s.offsetParent}}function py(){const s=document.body;return{clientWidth:s.clientWidth,clientHeight:s.clientHeight,clientTop:s.clientTop,clientLeft:s.clientLeft,scrollWidth:s.scrollWidth,scrollHeight:s.scrollHeight,scrollTop:s.scrollTop,scrollLeft:s.scrollLeft,offsetWidth:s.offsetWidth,offsetHeight:s.offsetHeight,offsetTop:s.offsetTop,offsetLeft:s.offsetLeft,offsetParent:s.offsetParent}}function pu(){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 gy(){const{scrollWidth:s,scrollHeight:t}=Gn();return{width:s,height:t}}function io(s){const{top:t,left:e,width:n,height:i}=s.getBoundingClientRect(),{scrollLeft:r,scrollTop:o}=Gn();return{x:e+r,y:t+o,width:n,height:i}}function yy(s){let t=s,e=0,n=0;for(;t!==null;)e+=t.offsetLeft,n+=t.offsetTop,t.offsetParent instanceof HTMLElement?t=t.offsetParent:t=null;return{x:e,y:n,width:s.offsetWidth,height:s.offsetHeight}}function gu(s){return s.getBoundingClientRect()}function wy(s){const t=s.getBoundingClientRect();return{x:s.offsetLeft,y:s.offsetTop,width:t.width||t.right-t.left,height:t.height||t.bottom-t.top}}function xy(){const{clientHeight:s,scrollTop:t,scrollHeight:e}=Gn(),n=e-s;return n<=0?0:t/n*100}function by(s){if("center"in s){const t=s.center,e=gu(s.target);return{x:t.x-e.x,y:t.y-e.y}}return{x:s.clientX,y:s.clientY}}function ro(s){if("center"in s)return s.center;if(typeof s.pageX=="number"&&typeof s.pageY=="number")return{x:s.pageX,y:s.pageY};const{scrollLeft:t,scrollTop:e}=Gn();return{x:s.clientX+t,y:s.clientY+e}}function lt(s,t){const e={x:0,y:0};if(t){const n=ro(s),i=io(t);e.x=B(n.x-i.x,0,i.width),e.y=B(n.y-i.y,0,i.height)}else{let n=0,i=0;if("currentTarget"in s&&s.currentTarget&&s.target&&s.currentTarget!=s.target){const r=s.currentTarget.getBoundingClientRect(),o=s.target.getBoundingClientRect();n=o.left-r.left,i=o.top-r.top}if("offsetX"in s)e.x=s.offsetX+n,e.y=s.offsetY+i;else{const r=ro(s),o=io(s.target);e.x=B(r.x-o.x+n,0,o.width),e.y=B(r.y-o.y+i,0,o.height)}}return e}function vy(s){if(document.implementation.hasFeature("MouseEvents","2.0"))return s.button;switch(s.button){case 0:case 1:case 3:case 5:case 7:return 0;case 2:case 6:return 2;case 4:return 1}}const _y={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};function Sy(s){if(s.key)return s.key;if(s.keyCode)return s.keyCode;if(s.which)return s.which}function yu(s,t){const e=t.ctrl||!1,n=t.shift||!1,i=t.alt||!1;return(e===s.metaKey||e===s.ctrlKey)&&n===s.shiftKey&&i===s.altKey&&t.keys.map(r=>r.toLowerCase()).includes(s.key.toLowerCase())}function wu(s){return uu(s.target||document||window).pipe(Vc(t=>yu(t,s)),rt(t=>{t.stopPropagation(),t.preventDefault()}))}function Cy(s){return lu(s.target||document||window).pipe(Vc(t=>yu(t,s)),rt(t=>{t.stopPropagation(),t.preventDefault()}))}function xu(s={keys:["o"]},t=Xt.text){return wu(s).pipe(ks(async()=>await Xh(t)))}async function Ty(s={keys:["o"]},t=Xt.text){return Qm(xu(s,t))}async function bu(s,t){return new Promise(e=>{const n=new ResizeObserver(i=>{const o=i[0].contentRect;t(o),e(()=>{n.unobserve(s)})});n.observe(s)})}function oo(s=document.documentElement,t){let e,n,i,r;return new nt(o=>{const a=new ResizeObserver(c=>{const u=c[0].contentRect;(e!=u.x||n!=u.y||i!=u.width||r!=u.height)&&(e=u.x,n=u.y,i=u.width,r=u.height,o.next(u))});return a.observe(s,t),()=>{a.unobserve(s),a.disconnect()}})}function Ey(s){return s(window.innerWidth,window.innerHeight),j(window,"orientationchange"in window?"orientationchange":"resize",t=>{const e=t.target.innerWidth,n=t.target.innerHeight;s(e,n)})}function Py(){return X(window,"orientationchange"in window?"orientationchange":"resize").pipe(rt(s=>({width:s.target.innerWidth,height:s.target.innerHeight})),Se({width:window.innerWidth,height:window.innerHeight}))}function My(){const s={x:0,y:0,dx:0,dy:0,dStartX:0,dStartY:0,isDown:!1},t={x:0,y:0,dx:0,dy:0,dStartX:0,dStartY:0,isDown:!1};return{mousePoint:t,setStartMousePoint:function(e,n){s.x=e.x,s.y=e.y,s.isDown=typeof n=="boolean"?n:!1,this.setCurrentMousePoint(e,n)},setCurrentMousePoint:(e,n)=>{const i=t.x,r=t.y;t.x=e.x,t.y=e.y,t.dx=t.x-i,t.dy=t.y-r,t.dStartX=t.x-s.x,t.dStartY=t.y-s.y,t.isDown=typeof n=="boolean"?n:!1}}}function Ay(s=document.documentElement){const t=new ls,e=new et(s);let n=[];const i=My(),r=i.mousePoint,o=k=>{t.emit("mouseDown",k)},a=k=>{t.emit("mouseUp",k)},c=k=>{r.isDown||i.setCurrentMousePoint(lt(k,s)),t.emit("mouseMove",k)},h=k=>{t.emit("mouseOver",k)},u=k=>{t.emit("mouseOut",k)},l=k=>{t.emit("mouseEnter",k)},d=k=>{t.emit("mouseLeave",k)},f=k=>{t.emit("mouseClick",k)},p=k=>{t.emit("mouseDoubleClick",k)},w=k=>{t.emit("mouseWheel",k)},b=k=>{t.emit("mouseContextMenu",k)},x=k=>{t.emit("touchStart",k)},g=k=>{t.emit("touchEnd",k)},v=k=>{t.emit("touchCancel",k)},_=k=>{const ot=k.changedTouches[0];r.isDown||i.setCurrentMousePoint(lt(ot,s)),t.emit("touchMove",k)},E=k=>{t.emit("pointerDown",k)},C=k=>{t.emit("pointerUp",k)},I=k=>{t.emit("pointerCancel",k)},F=k=>{t.emit("pointerMove",k)},N=k=>{t.emit("pan",k)},$=k=>{t.emit("panStart",k)},V=k=>{t.emit("panMove",k)},W=k=>{t.emit("panEnd",k)},tt=k=>{t.emit("panCancel",k)},Z=k=>{t.emit("panLeft",k)},Gt=k=>{t.emit("panRight",k)},mt=k=>{t.emit("panUp",k)},kt=k=>{t.emit("panDown",k)},Ot=k=>{t.emit("pinch",k)},L=k=>{t.emit("pinchin",k)},R=k=>{t.emit("pinchout",k)},U=k=>{t.emit("press",k)},H=k=>{t.emit("rotate",k)},It=k=>{t.emit("swipe",k)},ee=k=>{t.emit("swipeLeft",k)},ti=k=>{t.emit("swipeRight",k)},ei=k=>{t.emit("swipeUp",k)},pt=k=>{t.emit("swipeDown",k)},re=k=>{t.emit("tap",k)},it=k=>{!k.target||s==k.target||s.contains(k.target)||t.emit("tapOutSide",k)},Ct=k=>{t.emit("transitionstart",k)},yn=k=>{t.emit("transitionend",k)},Ze=k=>{t.emit("animationstart",k)},Qe=k=>{t.emit("animationend",k)};let De={...s.getBoundingClientRect(),width:s.offsetWidth,height:s.offsetHeight};return{el:s,get rect(){return De},mousePoint:r,eb:t,start:async function(){n.push(j(s,"mousedown",o)),n.push(j(s,"mouseup",a)),n.push(j(s,"mousemove",c)),n.push(j(s,"mouseover",h)),n.push(j(s,"mouseout",u)),n.push(j(s,"mouseenter",l)),n.push(j(s,"mouseleave",d)),n.push(j(s,"click",f)),n.push(j(s,"dblclick",p)),n.push(j(s,"onwheel"in document.createElement("div")?"wheel":document.onmousewheel!==void 0?"mousewheel":"DOMMouseScroll",w)),n.push(j(s,"contextmenu",b)),n.push(j(s,"touchstart",x)),n.push(j(s,"touchend",g)),n.push(j(s,"touchcancel",v)),n.push(j(s,"touchmove",_)),n.push(j(s,"pointerdown",E)),n.push(j(s,"pointerup",C)),n.push(j(s,"pointercancel",I)),n.push(j(s,"pointermove",F)),e.on("pan",N),e.on("panstart",$),e.on("panmove",V),e.on("panend",W),e.on("pancancel",tt),e.on("panleft",Z),e.on("panright",Gt),e.on("panup",mt),e.on("pandown",kt),e.on("pinch",Ot),e.on("pinchin",L),e.on("pinchout",R),e.on("press",U),e.on("rotate",H),e.on("swipe",It),e.on("swipeleft",ee),e.on("swiperight",ti),e.on("swipeup",ei),e.on("swipedown",pt),e.on("tap",re),n.push(j(document,"pointerdown",it)),n.push(j(s,"transitionstart",Ct)),n.push(j(s,"transitionend",yn)),n.push(j(s,"animationstart",Ze)),n.push(j(s,"animationend",Qe));const k=await bu(s,ot=>{De=ot,t.emit("resize",ot)});n.push(k),n.push(vu(this,{start:ot=>{i.setStartMousePoint(lt(ot,s),!0)},move:ot=>{i.setCurrentMousePoint(lt(ot,s))},end:ot=>{i.setCurrentMousePoint(lt(ot,s),!1)}}))},end:()=>{t.removeAllListeners(),n.forEach(k=>k()),n=[],e.off("pan",N),e.off("panstart",$),e.off("panmove",V),e.off("panend",W),e.off("pancancel",tt),e.off("panleft",Z),e.off("panright",Gt),e.off("panup",mt),e.off("pandown",kt),e.off("pinch",Ot),e.off("pinchin",L),e.off("pinchout",R),e.off("press",U),e.off("rotate",H),e.off("swipe",It),e.off("swipeleft",ee),e.off("swiperight",ti),e.off("swipeup",ei),e.off("swipedown",pt),e.off("tap",re)}}}function vu(s,t){return _u(s,t)}function _u(s,t){const e=s.eb,n=o=>{e.on("pointerMove",r),e.on("pointerUp",i),e.on("pointerCancel",i),t?.start?.(o)},i=o=>{e.off("pointerMove",r),e.off("pointerUp",i),e.off("pointerCancel",i),t?.end?.(o)},r=o=>{t?.move?.(o)};return e.on("pointerDown",n),()=>e.off("pointerDown",n)}function ky(s,t){const e=s.eb,n=o=>{document.addEventListener("mousemove",r,!1),document.addEventListener("mouseup",i,!1),t?.start?.(o)},i=o=>{document.removeEventListener("mousemove",r,!1),document.removeEventListener("mouseup",i,!1),t?.end?.(o)},r=o=>{t?.move?.(o)};return e.on("mouseDown",n),()=>e.off("mouseDown",n)}function Iy(s,t){const e=s.eb,n=o=>{e.on("touchMove",r),e.on("touchEnd",i),e.on("touchCancel",i);const a=o.changedTouches[0];t?.start?.(a)},i=o=>{e.off("touchMove",r),e.off("touchEnd",i),e.off("touchCancel",i);const a=o.changedTouches[0];t?.end?.(a)},r=o=>{const a=o.changedTouches[0];t?.move?.(a)};return e.on("touchStart",n),()=>e.off("touchStart",n)}let ao=class{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=Qt(this.x,this.y,this.toX,this.toY);if(t===0){const e=Math.min(this.x,this.toX),n=Math.min(this.y,this.toY),i=Math.max(this.x,this.toX),r=Math.max(this.y,this.toY);return{x:e,y:n,width:i-e,height:r-n}}else{const e=Math.sin(t),n=Math.cos(t),i=n*this.x-e*this.y,r=n*this.toX-e*this.toY,o=n*this.y+e*this.x,a=n*this.toY+e*this.toX;return{x:Math.min(i,r),y:Math.min(o,a),width:Math.max(i,r)-Math.min(i,r),height:Math.max(o,a)-Math.min(o,a)}}}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,n=this.y,i=t.toX,r=t.toY,o=this.toX-e,a=t.x-i;if(!o&&!a)return null;const c=(this.toY-n)/o,h=(t.y-r)/a;if(o){if(!a)return{x:i,y:c*(i-e)+n}}else return{x:e,y:h*(e-i)+r};const u=(-h*i+r+c*e-n)/(c-h),l=c*(u-e)+n;return isNaN(u)||isNaN(l)?null:{x:u,y:l}}};class co extends ao{rx;ry;xAxisRotate;largeArcFlag;sweepFlag;constructor(t){super(t),this.rx=t.rx,this.ry=t.ry,this.xAxisRotate=typeof t?.xAxisRotate=="number"?t?.xAxisRotate:0,this.largeArcFlag=typeof t?.largeArcFlag=="number"?t?.largeArcFlag:1,this.sweepFlag=typeof t?.sweepFlag=="number"?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,n,i,r,o,a,c]=this.convert(this.x,this.y,this.toX,this.toY,this.rx,this.ry,this.xAxisRotate,this.largeArcFlag,this.sweepFlag);t.ellipse(e,n,i,r,o,a,c,!this.sweepFlag)}convert(t,e,n,i,r,o,a,c,h){const u=a/180*Math.PI,l=(t-n)/2,d=(e-i)/2,f=Math.cos(u)*l+Math.sin(u)*d,p=-Math.sin(u)*l+Math.cos(u)*d,w=f*f/(r*r)+p*p/(o*o);if(w>1){const V=Math.sqrt(w);throw r=V*r,o=V*o,new Error(`Radii are too small to build an arc. Correcting them to ${r}/${o}.`)}const b=Math.sqrt((r*r*o*o-r*r*p*p-o*o*f*f)/(r*r*p*p+o*o*f*f)),x=c!=h?1:-1,g=x*b*r*p/o,v=x*b*-o*f/r,_=(t+n)/2,E=(e+i)/2,C=Math.cos(u)*g-Math.sin(u)*v+_,I=Math.sin(u)*g+Math.cos(u)*v+E,F=(V,W,tt,Z)=>(V*Z>=W*tt?1:-1)*Math.acos((V*tt+W*Z)/(Math.sqrt(V*V+W*W)*Math.sqrt(tt*tt+Z*Z))),N=F(1,0,t-C,e-I)-u,$=F(t-C,e-I,n-C,i-I);return[C,I,r,o,u,N,N+$]}}class Dy extends ao{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,n=this.cy*2-(this.y+this.toY)/2;t.quadraticCurveTo(e,n,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 n,i,r,o;for(let h=0;h<2;++h)n=h==0?this.x-2*this.cx+this.toX:this.y-2*this.cy+this.toY,i=h==0?-2*this.x+2*this.cx:-2*this.y+2*this.cy,r=h==0?this.x:this.y,Math.abs(n)>1e-12&&(o=-i/(2*n),0<o&&o<1&&[t,e][h].push(n*o*o+i*o+r));const a={x:Math.min(0,...t),y:Math.min(0,...e)},c={x:Math.max(0,...t),y:Math.max(0,...e)};return{x:a.x,y:a.y,width:c.x-a.x,height:c.y-a.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 Ry=Dy;class yt extends ao{c1x;c1y;c2x;c2y;constructor(t){super(t),this.c1x=t.c1x,this.c1y=t.c1y,this.c2x=t.c2x,this.c2y=t.c2y}clone(){return new yt({x:this.x,y:this.y,c1x:this.c1x,c1y:this.c1y,c2x:this.c2x,c2y:this.c2y,toX:this.toX,toY:this.toY})}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),n=this.x-this.c1x,i=(-e+Math.sqrt(e*e-4*t*n))/2/t,r=(-e-Math.sqrt(e*e-4*t*n))/2/t;const o=[this.y,this.toY],a=[this.x,this.toX];let c;const h=[];Math.abs(i)>1e12&&(i=.5),Math.abs(r)>1e12&&(r=.5),i>=0&&i<=1&&(c=this.interpolate(i),a.push(c.x),o.push(c.y),h.push({X:c.x,Y:c.y})),r>=0&&r<=1&&(c=this.interpolate(r),a.push(c.x),o.push(c.y),h.push({X:c.x,Y:c.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),n=this.y-this.c1y,i=(-e+Math.sqrt(e*e-4*t*n))/2/t,r=(-e-Math.sqrt(e*e-4*t*n))/2/t,Math.abs(i)>1e12&&(i=.5),Math.abs(r)>1e12&&(r=.5),i>=0&&i<=1&&(c=this.interpolate(i),a.push(c.x),o.push(c.y),h.push({X:c.x,Y:c.y})),r>=0&&r<=1&&(c=this.interpolate(r),a.push(c.x),o.push(c.y),h.push({X:c.x,Y:c.y}));const u=[],l=h.length;for(let p=0;p<l;p++){for(let w=p+1;w<l;w++)h[p].X===h[w].X&&h[p].Y===h[w].Y&&(w=++p);u.push({X:h[p].X,Y:h[p].Y})}const d={x:Math.min(...a),y:Math.min(...o)},f={x:Math.max(...a),y:Math.max(...o)};return{x:d.x,y:d.y,width:f.x-d.x,height:f.y-d.y,dots:u}}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,n,i,r){const o=-3*e+9*n-9*i+3*r,a=t*o+6*e-12*n+6*i;return t*a-3*e+3*n}static bezlen(t,e,n,i,r,o,a,c,h=1){h=Math.max(0,Math.min(h,1));const u=h/2,l=[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816],d=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472];let f=0;for(let p=0;p<12;p++){const w=u*l[p]+u,b=yt.base3(w,t,n,r,a),x=yt.base3(w,e,i,o,c);f+=d[p]*Math.sqrt(b*b+x*x)}return u*f}length(t=1){return yt.bezlen(this.x,this.y,this.c1x,this.c1y,this.c2x,this.c2y,this.toX,this.toY,t)}getTatLen(t){const e=this.x,n=this.y,i=this.c1x,r=this.c1y,o=this.c2x,a=this.c2y,c=this.toX,h=this.toY;if(t<0||yt.bezlen(e,n,i,r,o,a,c,h)<t)return 0;const u=1;let l=u/2,d=u-l,f=yt.bezlen(e,n,i,r,o,a,c,h,d);for(;Math.abs(f-t)>.01;)l/=2,d+=(f<t?1:-1)*l,f=yt.bezlen(e,n,i,r,o,a,c,h,d);return d}getPointAtSegmentLength(t){const e=this.getTatLen(t),n=1-e,i=Math.pow(n,3),r=Math.pow(n,2),o=e*e,a=o*e,c=i*this.x+r*3*e*this.c1x+n*3*e*e*this.c2x+a*this.toX,h=i*this.y+r*3*e*this.c1y+n*3*e*e*this.c2y+a*this.toY,u=this.x+2*e*(this.c1x-this.x)+o*(this.c2x-2*this.c1x+this.x),l=this.y+2*e*(this.c1y-this.y)+o*(this.c2y-2*this.c1y+this.y),d=this.c1x+2*e*(this.c2x-this.c1x)+o*(this.toX-2*this.c2x+this.c1x),f=this.c1y+2*e*(this.c2y-this.c1y)+o*(this.toY-2*this.c2y+this.c1y),p=n*this.x+e*this.c1x,w=n*this.y+e*this.c1y,b=n*this.c2x+e*this.toX,x=n*this.c2y+e*this.toY,g=90-Math.atan2(u-d,l-f)*180/Math.PI;return{x:c,y:h,m:{x:u,y:l},n:{x:d,y:f},start:{x:p,y:w},end:{x:b,y:x},alpha:g}}}const qn=Math.PI*2;function Su(s,t,e,n){const i=s*n-t*e<0?-1:1;let r=s*e+t*n;return r>1&&(r=1),r<-1&&(r=-1),i*Math.acos(r)}function Ly(s,t,e,n,i,r,o,a,c,h){const u=h*(s-e)/2+c*(t-n)/2,l=-c*(s-e)/2+h*(t-n)/2,d=o*o,f=a*a,p=u*u,w=l*l;let b=d*f-d*w-f*p;b<0&&(b=0),b/=d*w+f*p,b=Math.sqrt(b)*(i===r?-1:1);const x=b*o/a*l,g=b*-a/o*u,v=h*x-c*g+(s+e)/2,_=c*x+h*g+(t+n)/2,E=(u-x)/o,C=(l-g)/a,I=(-u-x)/o,F=(-l-g)/a,N=Su(1,0,E,C);let $=Su(E,C,I,F);return r===0&&$>0&&($-=qn),r===1&&$<0&&($+=qn),[v,_,N,$]}function Oy(s,t){const e=1.3333333333333333*Math.tan(t/4),n=Math.cos(s),i=Math.sin(s),r=Math.cos(s+t),o=Math.sin(s+t);return[n,i,n-i*e,i+n*e,r+o*e,o-r*e,r,o]}function Cu(s,t,e,n,i,r,o,a,c){const h=Math.sin(c*qn/360),u=Math.cos(c*qn/360),l=u*(s-e)/2+h*(t-n)/2,d=-h*(s-e)/2+u*(t-n)/2;if(l===0&&d===0)return[];if(o===0||a===0)return[];o=Math.abs(o),a=Math.abs(a);const f=l*l/(o*o)+d*d/(a*a);f>1&&(o*=Math.sqrt(f),a*=Math.sqrt(f));const p=Ly(s,t,e,n,i,r,o,a,h,u),w=[];let b=p[2],x=p[3];const g=Math.max(Math.ceil(Math.abs(x)/(qn/4)),1);x/=g;for(let v=0;v<g;v++)w.push(Oy(b,x)),b+=x;return w.map(v=>{for(let _=0;_<v.length;_+=2){let E=v[_+0],C=v[_+1];E*=o,C*=a;const I=u*E-h*C,F=h*E+u*C;v[_+0]=I+p[0],v[_+1]=F+p[1]}return v})}function ho(s,t,e,n,i,r){return[s/3+.6666666666666666*e,t/3+.6666666666666666*n,i/3+.6666666666666666*e,r/3+.6666666666666666*n,i,r]}function jn(s,t,e,n){return[s,t,e,n,e,n]}const Vs={a:7,c:6,s:4,q:4,t:2,m:2,l:2,h:1,v:1,z:0};function Tu(s="path",t){const e=document.createElementNS.call(document,"http://www.w3.org/2000/svg",s);return t&&Ve(e,t),e}function zy(s,t){return Tu("path",{d:s,id:t||rs()})}function Fy(s,t="shape"){return Xs(Zi(s),`${t}.svg`)}function Eu(s){return typeof s!="string"?!1:(s=s.trim(),/^[mlhvzaqtcs]\s*[-+.0-9][^mlhvzaqtcs]+/i.test(s)&&/[\dz]$/i.test(s))}function By(s){return s.map(t=>{if(!t[0])return"";switch(t[0].toLowerCase()){case"a":return`${t[0]} ${t[1]},${t[2]} ${t[3]} ${t[4]},${t[5]} ${t[6]},${t[7]}`;case"c":return`${t[0]} ${t[1]},${t[2]} ${t[3]},${t[4]} ${t[5]},${t[6]}`;case"s":case"q":return`${t[0]} ${t[1]},${t[2]} ${t[3]},${t[4]}`;default:return t[0]+" "+t.slice(1).join(",")}}).join(" ")}function Pu(s){const t=[];return Eu(s)&&s.replace(/([mlhvzaqtcs])([^mlhvzaqtcs]*)/gi,(e,n,i)=>{let r=n.toLowerCase();const o=wi(i);for(r=="m"&&o.length>Vs[r]&&(t.push([n,...o.splice(0,Vs[r])]),r="l",n=n=="m"?"l":"L");o.length;){if(o.length<Vs[r])throw new Error(`parseSVGPath substring:{ ${e} } command:{ ${n} } args:{ ${o} }`);t.push([n,...o.splice(0,Vs[r])])}return r=="z"&&t.push([n]),""}),t}function Mu(s){let t=0,e=0,n=0,i=0;return s.map(function(r){const o=r[0],a=o.toUpperCase();if(o!=a)switch(r[0]=a,o){case"a":r[6]+=n,r[7]+=i;break;case"v":r[1]+=i;break;case"h":r[1]+=n;break;default:for(let c=1;c<r.length;)r[c++]+=n,r[c++]+=i}switch(a){case"Z":n=t,i=e;break;case"H":n=r[1];break;case"V":i=r[1];break;case"M":n=t=r[1],i=e=r[2];break;default:n=r[r.length-2],i=r[r.length-1]}return r})}function Ny(s){const t=[];let e=0,n=0,i=0,r=0,o=0,a=0,c=0,h=0,u;for(let l=0,d=s.length;l<d;l++){let f=s[l];const p=f[0];switch(p){case"M":e=f[1],n=f[2];break;case"A":const w=Cu(i,r,f[6],f[7],f[4],f[5],f[1],f[2],f[3]);if(!w.length)continue;w.forEach((g,v)=>{const[_,E,C,I,F,N,$,V]=g;f=["C",C,I,F,N,$,V],v<w.length-1&&t.push(f)});break;case"S":let b=i,x=r;(u=="C"||u=="S")&&(b+=b-c,x+=x-h),f=["C",b,x,f[1],f[2],f[3],f[4]];break;case"T":u=="Q"||u=="T"?(o=i*2-o,a=r*2-a):(o=i,a=r),f=["C",...ho(i,r,o,a,f[1],f[2])];break;case"Q":o=f[1],a=f[2],f=["C",...ho(i,r,f[1],f[2],f[3],f[4])];break;case"L":f=["C",...jn(i,r,f[1],f[2])];break;case"H":f=["C",...jn(i,r,f[1],r)];break;case"V":f=["C",...jn(i,r,i,f[1])];break;case"Z":f=["C",...jn(i,r,e,n)];break}u=p,i=f[f.length-2],r=f[f.length-1],f.length>4?(c=f[f.length-4],h=f[f.length-3]):(c=i,h=r),t.push(f)}return t}class Hn{video;constructor(t){this.video=t}setSrcObject(t){this.video.addEventListener("loadedmetadata",e=>{e.target}),this.video.srcObject=t}captureWebCamera(){navigator.mediaDevices.getUserMedia({video:!0}).then(t=>{this.setSrcObject(t)})}static async videoMediaChangeSupport(){return new Promise(t=>{const e=document.createElement("iframe"),n=document.createElement("video"),i=document.createElement("source"),r=new MediaSource;r.addEventListener("sourceopen",()=>t(!0)),i.src=URL.createObjectURL(r),i.media="(min-width:10px)",n.append(i),e.width="5",e.style.cssText="position: absolute; visibility: hidden;",document.documentElement.append(e),e.contentDocument?.body.append(n),setTimeout(()=>{e.width="15"}),setTimeout(()=>{e.remove(),t(!1)},1e3)})}static tryAutoPlayOrAutoPlayAfterClick(t){return new Promise(e=>{t.play().then(()=>{t.autoplay=!0,e(!0)}).catch(()=>{Hn.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 uo extends ls{source;raw="";mode="text";tagname="";nodename="";textchunk="";entity="";quote="";attrs={};constructor(t){super(),this.source=t}parse(){const t=Ml(this.source);if(t===0){this.emit("finish");return}let e,n,i=ra(this.source,0);for(let r=1;r<t;r++)e=n,n=i,i=ra(this.source,r),this.raw+=n,n&&this.step(n,i,e);i&&this.step(i,void 0,n),this.emit("finish")}step(t,e,n){t==`
|
|
26
|
-
`&&this.emit("newline"),this.act(t,e,n)}act(t,e,n){switch(this.mode){case"text":switch(t){case"<":case"eof":this.nodename="",this.attrs={},this.mode="tag name start",this.raw=this.raw.slice(0,-1),this.textchunk&&this.emit("text",this.textchunk),this.raw+=t,this.textchunk="";break;case"&":this.mode="entity",this.entity="";break;default:this.textchunk+=t;break}break;case"entity":
|
|
27
|
-
`);n=~U?L.length-U:n+L.length}function r(){var L={line:e,column:n};return function(R){return R.position=new o(L),p(),R}}function o(L){this.start=L,this.end={line:e,column:n},this.source=t.source}o.prototype.content=s;var a=[];function c(L){var R=new Error(t.source+":"+e+":"+n+": "+L);if(R.reason=L,R.filename=t.source,R.line=e,R.column=n,R.source=s,t.silent)a.push(R);else throw R}function h(){var L=d();return{type:"stylesheet",stylesheet:{source:t.source,rules:L,parsingErrors:a}}}function u(){return f(/^{\s*/)}function l(){return f(/^}/)}function d(){var L,R=[];for(p(),w(R);s.length&&s.charAt(0)!="}"&&(L=kt()||Ot());)L!==!1&&(R.push(L),w(R));return R}function f(L){var R=L.exec(s);if(R){var U=R[0];return i(U),s=s.slice(U.length),R}}function p(){f(/^\s*/)}function w(L){var R;for(L=L||[];R=b();)R!==!1&&L.push(R);return L}function b(){var L=r();if(!(s.charAt(0)!="/"||s.charAt(1)!="*")){for(var R=2;s.charAt(R)!=""&&(s.charAt(R)!="*"||s.charAt(R+1)!="/");)++R;if(R+=2,s.charAt(R-1)==="")return c("End of comment missing");var U=s.slice(2,R-2);return n+=2,i(U),s=s.slice(R),n+=2,L({type:"comment",comment:U})}}function x(){var L=f(/^([^{]+)/);if(L)return me(L[0]).replace(/\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*\/+/g,"").replace(/"(?:\\"|[^"])*"|'(?:\\'|[^'])*'/g,function(R){return R.replace(/,/g,"")}).split(/\s*(?![^(]*\)),\s*/).map(function(R){return R.replace(/\u200C/g,",")})}function g(){var L=r(),R=f(/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(R){if(R=me(R[0]),!f(/^:\s*/))return c("property missing ':'");var U=f(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/),H=L({type:"declaration",property:R.replace(ku,""),value:U?me(U[0]).replace(ku,""):""});return f(/^[;\s]*/),H}}function v(){var L=[];if(!u())return c("missing '{'");w(L);for(var R;R=g();)R!==!1&&(L.push(R),w(L));return l()?L:c("missing '}'")}function _(){for(var L,R=[],U=r();L=f(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/);)R.push(L[1]),f(/^,\s*/);if(R.length)return U({type:"keyframe",values:R,declarations:v()})}function E(){var L=r(),R=f(/^@([-\w]+)?keyframes\s*/);if(R){var U=R[1];if(R=f(/^([-\w]+)\s*/),!R)return c("@keyframes missing name");var H=R[1];if(!u())return c("@keyframes missing '{'");for(var It,ee=w();It=_();)ee.push(It),ee=ee.concat(w());return l()?L({type:"keyframes",name:H,vendor:U,keyframes:ee}):c("@keyframes missing '}'")}}function C(){var L=r(),R=f(/^@supports *([^{]+)/);if(R){var U=me(R[1]);if(!u())return c("@supports missing '{'");var H=w().concat(d());return l()?L({type:"supports",supports:U,rules:H}):c("@supports missing '}'")}}function I(){var L=r(),R=f(/^@host\s*/);if(R){if(!u())return c("@host missing '{'");var U=w().concat(d());return l()?L({type:"host",rules:U}):c("@host missing '}'")}}function F(){var L=r(),R=f(/^@media *([^{]+)/);if(R){var U=me(R[1]);if(!u())return c("@media missing '{'");var H=w().concat(d());return l()?L({type:"media",media:U,rules:H}):c("@media missing '}'")}}function N(){var L=r(),R=f(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(R)return L({type:"custom-media",name:me(R[1]),media:me(R[2])})}function $(){var L=r(),R=f(/^@page */);if(R){var U=x()||[];if(!u())return c("@page missing '{'");for(var H=w(),It;It=g();)H.push(It),H=H.concat(w());return l()?L({type:"page",selectors:U,declarations:H}):c("@page missing '}'")}}function V(){var L=r(),R=f(/^@([-\w]+)?document *([^{]+)/);if(R){var U=me(R[1]),H=me(R[2]);if(!u())return c("@document missing '{'");var It=w().concat(d());return l()?L({type:"document",document:H,vendor:U,rules:It}):c("@document missing '}'")}}function W(){var L=r(),R=f(/^@font-face\s*/);if(R){if(!u())return c("@font-face missing '{'");for(var U=w(),H;H=g();)U.push(H),U=U.concat(w());return l()?L({type:"font-face",declarations:U}):c("@font-face missing '}'")}}var tt=mt("import"),Z=mt("charset"),Gt=mt("namespace");function mt(L){var R=new RegExp("^@"+L+"\\s*([^;]+);");return function(){var U=r(),H=f(R);if(H){var It={type:L};return It[L]=H[1].trim(),U(It)}}}function kt(){if(s[0]=="@")return E()||F()||N()||C()||tt()||Z()||Gt()||V()||$()||I()||W()}function Ot(){var L=r(),R=x();return R?(w(),L({type:"rule",selectors:R,declarations:v()})):c("selector missing")}return fo(h())}function me(s){return s?s.replace(/^\s+|\s+$/g,""):""}function fo(s,t){var e=s&&typeof s.type=="string",n=e?s:t;for(var i in s){var r=s[i];Array.isArray(r)?r.forEach(function(o){fo(o,n)}):r&&typeof r=="object"&&fo(r,n)}return e&&Object.defineProperty(s,"parent",{configurable:!0,writable:!0,enumerable:!1,value:t||null}),s}let Yy=class extends uo{currentItem={};items=[];groups=[];globalStyles={};grad={};idtops={};text="";constructor(t){super(t),this.on("tag",(e,n)=>{switch(this.text="",this.currentItem={type:e},e){case"g":this.groups.push(this.currentItem);break}this.processAttrs(e,n)}),this.on("text",e=>{if(this.currentItem.type=="style"){try{const n=lo(e);for(const i of n.stylesheet.rules)for(const r of i.declarations)for(const o of i.selectors)this.globalStyles[o]=this.globalStyles[o]||[],this.globalStyles[o].push(`${r.property}:${r.value}`)}catch{console.error("CAN'T parse css text: "+e)}return}this.text+=e}),this.on("/tag",(e,n)=>{let i=this.groups.length;for(;i--;)if(this.groups[i]!=this.currentItem){let r="",o="";for(const a in this.groups[i])a=="transform"?r=this.groups[i].transform:a=="class"&&this.globalStyles["."+this.groups[i][a]]?o=this.globalStyles["."+this.groups[i][a]].join(";")+";"+o:a=="id"&&this.globalStyles["#"+this.groups[i][a]]?o=this.globalStyles["#"+this.groups[i][a]].join(";")+";"+o:typeof this.currentItem[a]>"u"&&(this.currentItem[a]=this.groups[i][a]);typeof this.currentItem.transform>"u"?this.currentItem.transform=r:this.currentItem.transform+=" "+r,typeof this.currentItem.style>"u"?this.currentItem.style=o:this.currentItem.style=o+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),po(this.currentItem.style,this.currentItem,go)}switch(this.processAttrs(e,n),e){case"g":this.groups.pop();break;case"cirlce":this.addToItems();break;case"ellipse":this.addToItems();break;case"polygon":this.addToItems();break;case"path":this.addToItems();break;case"line":this.addToItems();break;case"rect":this.addToItems();break;case"image":this.addToItems();break;case"text":this.currentItem.text=this.text,this.currentItem["text-anchor"]=this.currentItem["text-anchor"]||"start",this.addToItems();break}}),this.on("finish",()=>{this.emit("result",this.items)})}parse(){return super.parse(),this.items}processAttrs(t,e){let n=[],i;switch(t){case"svg":let r="",o="";if(e.width&&e.height)r=e.width,o=e.height;else if(e.viewBox){const a=e.viewBox.split(/\s+/gi);a.length==4&&(r=String(parseFloat(a[2])-parseFloat(a[0])),o=String(parseFloat(a[3])-parseFloat(a[1])))}r&&o&&this.items.push({type:"viewbox",width:r,height:o});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&&po(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+mo(parseFloat(e.x1),parseFloat(e.y1),parseFloat(e.x2),parseFloat(e.y2),parseFloat(e.x1)+100,parseFloat(e.y1))).toFixed(2),n=[this.grad.angle];for(let a=0,c=this.grad.stops.length;a<c;a++)i=this.grad.stops[a],a&&a!=c-1?n.push(i.color+":"+i.offset):n.push(i.color);this.idtops[this.grad.id]=n.join("-"),this.items.forEach(a=>{a.fillid==this.grad.id&&(a.fill=this.idtops[this.grad.id])});break;case"radialGradient":n=[];for(let a=0,c=this.grad.stops.length;a<c;a++)i=this.grad.stops[a],a&&a!=c-1?n.push(i.color+":"+i.offset):n.push(i.color);this.idtops[this.grad.id]=n.join("-"),this.items.forEach(a=>{a.fillid==this.grad.id&&(a.fill=this.idtops[this.grad.id])});break}for(const r in e){const o=e[r];if(go.includes(r)&&(this.currentItem[r]=o),r==="id"&&(this.currentItem.type==="linearGradient"&&(this.grad={id:r,stops:[]}),this.currentItem.type==="radialGradient"&&(this.grad={id:r,stops:[]})),r==="style"&&po(o,this.currentItem,go),r==="transform"&&(this.currentItem.transform=o+(this.currentItem.transform||" ")),r==="fill"){const a=o.match(/url\(#([^)]+)\)/);if(a){const c=a[1];this.currentItem.fillid=c,this.idtops[c]&&(this.currentItem.fill=this.idtops[c])}}r==="points"&&this.currentItem.type=="polygon"&&(this.currentItem.path="M"+o+"z"),r==="d"&&this.currentItem.type=="path"&&(this.currentItem.path=o),r==="xlink:href"&&this.currentItem.type=="image"&&(this.currentItem.src=o)}}addToItems(){this.items.push(this.currentItem)}};function mo(s,t,e,n,i,r){if(typeof i>"u"||typeof r>"u"){const o=s-e,a=t-n;return!o&&!a?0:(180+Math.atan2(-a,-o)*180/Math.PI+360)%360}else return mo(s,t,i,r)-mo(e,n,i,r)}function po(s,t,e){const n=(s+"").split(";"),i=/^\s+|\s+$/g;for(let r=0,o=n.length;r<o;r++){const a=n[r].split(":"),c=a[0].replace(i,"").replace(/[A-Z]/g,function(h){return"-"+h.toLowerCase()});(!e||e.includes(c))&&(t[c]=a[1].replace(i,""))}}const go=["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 St{startPathX=0;startPathY=0;prevPathX=0;prevPathY=0;normalizedLines=[];constructor(t){const e=typeof t=="string"?Pu(t):t||[],n=Ny(Mu(e));let i=!1;for(let r=0,o=n.length;r<o;r++){const a=n[r];a[0]=="M"?(i||(i=!0,this.startPathX=a[1],this.startPathY=a[2]),this.prevPathX=a[1],this.prevPathY=a[2]):this._appendLine(new yt({c1x:a[1],c1y:a[2],c2x:a[3],c2y:a[4],toX:a[5],toY:a[6]}))}}_appendLine(t){if(t instanceof co){Cu(this.prevPathX,this.prevPathY,t.toX,t.toY,t.largeArcFlag,t.sweepFlag,t.rx,t.ry,t.xAxisRotate).forEach(h=>{const[u,l,d,f,p,w,b,x]=h;this.normalizedLines.push(new yt({x:this.prevPathX,y:this.prevPathY,c1x:d,c1y:f,c2x:p,c2y:w,toX:b,toY:x})),this.prevPathX=b,this.prevPathY=x});return}if(t instanceof yt){this.normalizedLines.push(t.clone()),this.prevPathX=t.toX,this.prevPathY=t.toY;return}let e,n,i,r,o,a;t instanceof Ry?[e,n,i,r,o,a]=ho(this.prevPathX,this.prevPathY,t.cx,t.cy,t.toX,t.toY):[e,n,i,r,o,a]=jn(this.prevPathX,this.prevPathY,t.toX,t.toY),this.normalizedLines.push(new yt({x:this.prevPathX,y:this.prevPathY,c1x:e,c1y:n,c2x:i,c2y:r,toX:o,toY:a})),this.prevPathX=o,this.prevPathY=a}static fromPolymorphPoints(t){const e=new St;e.prevPathX=e.startPathX=t[0]||0,e.prevPathY=e.startPathY=t[1]||0;for(let n=2,i=t.length;n+5<i;n+=6)e._appendLine(new yt({c1x:t[n],c1y:t[n+1],c2x:t[n+2],c2y:t[n+3],toX:t[n+4],toY:t[n+5]}));return e}static fromLines(t){const e=new St;e.prevPathX=e.startPathX=t[0].x||0,e.prevPathY=e.startPathY=t[0].y||0;for(let n=0,i=t.length;n<i;n++)e._appendLine(t[n]);return e}clone(){return St.fromLines(this.normalizedLines)}toSVGPathData(){const t=[];t.push(["M",this.startPathX,this.startPathY]);for(let e=0,n=this.normalizedLines.length;e<n;e++)t.push(...this.normalizedLines[e].toSVGPathData());return t}toSVGPathD(){return By(this.toSVGPathData())}toCanvasContext(t){t.beginPath(),t.moveTo(this.startPathX,this.startPathY),this.normalizedLines.forEach(e=>{e.toCanvasContext(t)})}getBoundingClientRect(t=2){const e=[],n=[];if(this.normalizedLines.forEach(c=>{const h=c.getBoundingClientRect();e.push(h.x,h.x+h.width),n.push(h.y,h.y+h.height)}),e.length==0||n.length==0)return{x:0,y:0,width:0,height:0,center:{x:0,y:0}};const i=Math.min(...e),r=Math.min(...n),o=Math.max(...e),a=Math.max(...n);return{x:Q(i,t),y:Q(r,t),width:Q(o-i,t),height:Q(a-r,t)}}getBoundingClientRectCenter(t=2){const e=this.getBoundingClientRect(t);return{x:Q(e.x+e.width*.5,t),y:Q(e.y+e.height*.5,t)}}transform(t,e,n,i,r,o,a){const c=new _t;return c.translate(t,e),c.rotate(r,n,i),c.scale(o,a,n,i),c.isIdentity?this.clone():St.fromLines(this.normalizedLines.map(h=>{let u=h.x,l=h.y,d=h.c1x,f=h.c1y,p=h.c2x,w=h.c2y,b=h.toX,x=h.toY;return{x:u,y:l}=c.transformPoint({x:u,y:l}),{x:d,y:f}=c.transformPoint({x:d,y:f}),{x:p,y:w}=c.transformPoint({x:p,y:w}),{x:b,y:x}=c.transformPoint({x:b,y:x}),new yt({x:u,y:l,c1x:d,c1y:f,c2x:p,c2y:w,toX:b,toY:x})}))}getTotalLength(){return this.normalizedLines.reduce((t,e)=>t+=e.length(),0)}getPointAtLength(t){let e=0,n=0;const i=this.normalizedLines.length;for(let r=0;r<i;r++){const o=this.normalizedLines[r];if(n=o.length(),e+n>=t)return o.getPointAtSegmentLength(t-e);e+=n}return this.normalizedLines[i-1].getPointAtSegmentLength(n)}interpolate(t){const e=this.normalizedLines.length;if(e===0)return{x:0,y:0};if(e===1)return this.normalizedLines[0].interpolate(t);{let n=t*e,i=this.normalizedLines[0];if(n--,n>1)for(let r=1;r<e&&(i=this.normalizedLines[r],n>1);r++)n-=1;return i.interpolate(n)}}getSubPathD(t,e){if(this.getTotalLength()-e<1e-6)return this.getSubPathDAtLength(this,t);{const n=this.getSubPathDAtLength(this,e,1);return t?this.getSubPathDAtLength(n,t):n}}getSubPathDAtLength(t,e,n){let i=null,r=0;const o=new St;o.prevPathX=o.startPathX=t.startPathX,o.prevPathY=o.startPathY=t.startPathY;for(let a=0,c=this.normalizedLines.length;a<c;a++){const h=this.normalizedLines[a],u=h.length();if(r+u>e&&!i){const l=h.getPointAtSegmentLength(e-r);if(o._appendLine(new yt({c1x:l.start.x,c1y:l.start.y,c2x:l.m.x,c2y:l.m.y,toX:l.x,toY:l.y})),n)return o;i=o,o._appendLine(new yt({c1x:l.n.x,c1y:l.n.y,c2x:l.end.x,c2y:l.end.y,toX:h.x,toY:h.y})),r+=u;continue}r+=u,o._appendLine(h)}return o}closestPoint(t,e){const n=this.getTotalLength();let i={x:t,y:e},r=0,o=1/0,a=8;for(let h=0;h<=n;h+=a){const u=this.getPointAtLength(h),l=(t-u.x)*(t-u.x)+(e-u.y)*(e-u.y);l<o&&(i=u,r=h,o=l)}for(a/=2;a>.5;){const h=r-a,u=this.getPointAtLength(h),l=(t-u.x)*(t-u.x)+(e-u.y)*(e-u.y),d=r+a,f=this.getPointAtLength(d),p=(t-f.x)*(t-f.x)+(e-f.y)*(e-f.y);h>=0&&l<o?(i=u,r=h,o=l):d<=n&&p<o?(i=f,r=d,o=p):a/=2}const c=this.getPointAtLength(r+(r===n?-.1:.1));return{point:i,rotation:r>=n?Qt(c.x,c.y,i.x,i.y):Qt(i.x,i.y,c.x,c.y),distance:Math.sqrt(o)}}getPolymorphPoints(){return[this.startPathX,this.startPathY].concat(this.normalizedLines.reduce((t,e)=>t.concat([e.c1x,e.c1y,e.c2x,e.c2y,e.toX,e.toY]),[]))}getPolymorphPointsPerimeter(){const t=this.getPolymorphPoints(),e=t.length;let n=t[e-2],i=t[e-1],r=0;for(let o=0;o<e;o+=6)r+=Ee(t[o],t[o+1],n,i),n=t[o],i=t[o+1];return Math.floor(r)}getExpendedPolymorphPointsPathD(t){const e=this.getPolymorphPoints(),n=e.length;let i=t-n;const r=Math.ceil(t/n),o=[];o.push(["M",e[0],e[1]]);let a=2;for(;a+5<=n-1;){const c=e[a++],h=e[a++],u=e[a++],l=e[a++],d=e[a++],f=e[a++];o.push(["C",c,h,u,l,d,f]);let p=0;for(;p<r&&i>0;)o.push(["C",d,f,d,f,d,f]),i-=6,p++}return new St(o)}static getInterpolator(t,e){return n=>Math.abs(n-0)<Number.EPSILON?new St(t.toSVGPathD()):Math.abs(n-1)<Number.EPSILON?new St(e.toSVGPathD()):St.fromPolymorphPoints(Jl(t.getPolymorphPoints(),e.getPolymorphPoints(),n))}}const Iu=Uy("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 Uy(s,t=10){const e={},n=s.split(",");for(let i=0;i<n.length;i+=2){const r="&"+n[i+1]+";",o=parseInt(n[i],t);e[r]="&#"+o+";"}return e["\\xa0"]=" ",e}function At(s,t){const e=Object.keys(t);for(let n=0;n<e.length;n++)s=s.replace(new RegExp("{"+e[n]+"}","gi"),""+t[e[n]]);return s}function Gs(s){let t,e;if(!s)throw new Error("cannot create a random attribute name for an undefined object");const n="ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz";t="";do for(t="",e=0;e<12;e++)t+=n[Math.floor(Math.random()*n.length)];while(s[t]);return t}function Xy(s){const t={left:"start",right:"end",center:"middle",start:"start",end:"end"};return t[s]||t.start}function $y(s){const t={alphabetic:"alphabetic",hanging:"hanging",top:"text-before-edge",bottom:"text-after-edge",middle:"central"};return t[s]||t.alphabetic}const Wn={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 yo{__root;__ctx;constructor(t,e){this.__root=t,this.__ctx=e}addColorStop(t,e){const n=this.__ctx.__createElement("stop");if(n.setAttribute("offset",""+t),e.indexOf("rgba")!==-1){const r=/rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d?\.?\d*)\s*\)/gi.exec(e);r&&(n.setAttribute("stop-color",At("rgb({r},{g},{b})",{r:r[1],g:r[2],b:r[3]})),n.setAttribute("stop-opacity",r[4]))}else n.setAttribute("stop-color",e);this.__root.appendChild(n)}}class Du{__root;__ctx;constructor(t,e){this.__root=t,this.__ctx=e}}class qs{__document=document;__canvas;__ctx;width;height;__styleStack;__groupStack;__rootSVG;__ids;__SVGdefs;__currentElement;__currentElementsToStyle=null;constructor({canvas:t,width:e=500,height:n=500}){t?(this.__canvas=t,this.__ctx=t.getContext("2d"),this.width=t.width,this.height=t.height):(this.__canvas=this.__document.createElement("canvas"),this.__ctx=this.__canvas.getContext("2d"),this.width=e,this.height=n),this.__setDefaultStyles(),this.__styleStack=[this.__getStyleState()],this.__groupStack=[],this.__rootSVG=this.__document.createElementNS("http://www.w3.org/2000/svg","svg"),this.__rootSVG.setAttribute("version","1.1"),this.__rootSVG.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.__rootSVG.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink","http://www.w3.org/1999/xlink"),this.__rootSVG.setAttribute("width",""+this.width),this.__rootSVG.setAttribute("height",""+this.height),this.__ids={},this.__SVGdefs=this.__document.createElementNS("http://www.w3.org/2000/svg","defs"),this.__rootSVG.appendChild(this.__SVGdefs),this.__currentElement=this.__document.createElementNS("http://www.w3.org/2000/svg","g"),this.__rootSVG.appendChild(this.__currentElement)}__setDefaultStyles(){const t=Object.keys(Wn);for(let e=0,n=t.length;e<n;e++){const i=t[e];this[i]=Wn[i].canvas}}__getStyleState(){const t={},e=Object.keys(Wn);for(let n=0,i=e.length;n<i;n++){const r=e[n];t[r]=this[r]}return t}__applyStyleState(t){const e=Object.keys(t);for(let n=0,i=e.length;n<i;n++){const r=e[n];this[r]=t[r]}}__createElement(t,e={},n=!1){const i=this.__document.createElementNS("http://www.w3.org/2000/svg",t),r=Object.keys(e);n&&(i.setAttribute("fill","none"),i.setAttribute("stroke","none"));for(let o=0;o<r.length;o++){const a=r[o];i.setAttribute(a,e[a])}return i}__applyStyleToCurrentElement(t){let e=this.__currentElement;const n=this.__currentElementsToStyle;n&&(e.setAttribute(t,""),e=n.element,n.children.forEach(r=>{r.setAttribute(t,"")}));const i=Object.keys(Wn);for(let r=0;r<i.length;r++){const o=Wn[i[r]],a=this[i[r]];if(o.apply){if(a instanceof Du){if(a.__ctx)for(;a.__ctx.__SVGdefs.childNodes.length;){const c=a.__ctx.__SVGdefs.childNodes[0].getAttribute("id");this.__ids[c]=c,this.__SVGdefs.appendChild(a.__ctx.__SVGdefs.childNodes[0])}e.setAttribute(o.apply,At("url(#{id})",{id:a.__root.getAttribute("id")}))}else if(a instanceof yo)e.setAttribute(o.apply,At("url(#{id})",{id:a.__root.getAttribute("id")}));else if(o.apply.indexOf(t)!==-1&&o.svg!==a)if((o.svgAttr==="stroke"||o.svgAttr==="fill")&&a.indexOf("rgba")!==-1){const h=/rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d?\.?\d*)\s*\)/gi.exec(a);if(h){e.setAttribute(o.svgAttr,At("rgb({r},{g},{b})",{r:h[1],g:h[2],b:h[3]}));let u=parseFloat(h[4]);const l=this.globalAlpha;l!=null&&(u*=l),e.setAttribute(o.svgAttr+"-opacity",""+u)}}else{let c=o.svgAttr;if(i[r]==="globalAlpha"&&(c=t+"-"+o.svgAttr,e.getAttribute(c)))continue;c&&e.setAttribute(c,a)}}}}__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(Iu);for(let r=0,o=i.length;r<o;r++){const a=i[r],c=Iu[a],h=new RegExp(a,"gi");h.test(e)&&(e=e.replace(h,c))}}return e}getSvg(){return this.__rootSVG}save(){const t=this.__createElement("g"),e=this.__closestGroupOrSvg();this.__groupStack.push(e),e.appendChild(t),this.__currentElement=t,this.__styleStack.push(this.__getStyleState())}restore(){this.__currentElementsToStyle=null;const t=this.__groupStack.pop();t?this.__currentElement=t:this.__currentElement=this.__rootSVG.childNodes[1];const e=this.__styleStack.pop();e&&this.__applyStyleState(e)}__addTransform(t){const e=this.__closestGroupOrSvg();if(e.childNodes.length>0){this.__currentElement.nodeName==="path"&&(this.__currentElementsToStyle||(this.__currentElementsToStyle={element:e,children:[]}),this.__currentElementsToStyle.children.push(this.__currentElement),this.__applyCurrentDefaultPath());const i=this.__createElement("g");e.appendChild(i),this.__currentElement=i}let n=this.__currentElement.getAttribute("transform");n?n+=" ":n="",n+=t,this.__currentElement.setAttribute("transform",n)}scale(t,e){e===void 0&&(e=t),this.__addTransform(At("scale({x},{y})",{x:t,y:e}))}rotate(t){const e=t*180/Math.PI;this.__addTransform(At("rotate({angle},{cx},{cy})",{angle:e,cx:0,cy:0}))}translate(t,e){this.__addTransform(At("translate({x},{y})",{x:t,y:e}))}transform(t,e,n,i,r,o){this.__addTransform(At("matrix({a},{b},{c},{d},{e},{f})",{a:t,b:e,c:n,d:i,e:r,f:o}))}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(At("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(At("L {x} {y}",this.__currentPosition)):this.__addPathCommand(At("M {x} {y}",this.__currentPosition))}bezierCurveTo(t,e,n,i,r,o){this.__currentPosition={x:r,y:o},this.__addPathCommand(At("C {cp1x} {cp1y} {cp2x} {cp2y} {x} {y}",{cp1x:t,cp1y:e,cp2x:n,cp2y:i,x:r,y:o}))}quadraticCurveTo(t,e,n,i){this.__currentPosition={x:n,y:i},this.__addPathCommand(At("Q {cpx} {cpy} {x} {y}",{cpx:t,cpy:e,x:n,y:i}))}normalize(t){const e=Math.sqrt(t[0]*t[0]+t[1]*t[1]);return[t[0]/e,t[1]/e]}arcTo(t,e,n,i,r){const o=this.__currentPosition&&this.__currentPosition.x,a=this.__currentPosition&&this.__currentPosition.y;if(typeof o>"u"||typeof a>"u")return;if(r<0)throw new Error("IndexSizeError: The radius provided ("+r+") is negative.");if(o===t&&a===e||t===n&&e===i||r===0){this.lineTo(t,e);return}const c=this.normalize([o-t,a-e]),h=this.normalize([n-t,i-e]);if(c[0]*h[1]===c[1]*h[0]){this.lineTo(t,e);return}const u=c[0]*h[0]+c[1]*h[1],l=Math.acos(Math.abs(u)),d=this.normalize([c[0]+h[0],c[1]+h[1]]),f=r/Math.sin(l/2),p=t+f*d[0],w=e+f*d[1],b=[-c[1],c[0]],x=[h[1],-h[0]],g=function(E){const C=E[0];return E[1]>=0?Math.acos(C):-Math.acos(C)},v=g(b),_=g(x);this.lineTo(p+b[0]*r,w+b[1]*r),this.arc(p,w,r,v,_)}stroke(){this.__currentElement.nodeName==="path"&&this.__currentElement.setAttribute("paint-order","fill stroke markers"),this.__applyCurrentDefaultPath(),this.__applyStyleToCurrentElement("stroke")}fill(){this.__currentElement.nodeName==="path"&&this.__currentElement.setAttribute("paint-order","stroke fill markers"),this.__applyCurrentDefaultPath(),this.__applyStyleToCurrentElement("fill")}rect(t,e,n,i){this.__currentElement.nodeName!=="path"&&this.beginPath(),this.moveTo(t,e),this.lineTo(t+n,e),this.lineTo(t+n,e+i),this.lineTo(t,e+i),this.lineTo(t,e),this.closePath()}fillRect(t,e,n,i){const r=this.__createElement("rect",{x:t,y:e,width:n,height:i},!0);this.__closestGroupOrSvg().appendChild(r),this.__currentElement=r,this.__applyStyleToCurrentElement("fill")}strokeRect(t,e,n,i){const r=this.__createElement("rect",{x:t,y:e,width:n,height:i},!0);this.__closestGroupOrSvg().appendChild(r),this.__currentElement=r,this.__applyStyleToCurrentElement("stroke")}__clearCanvas(){const e=this.__closestGroupOrSvg().getAttribute("transform"),n=this.__rootSVG.childNodes[1],i=n.childNodes;for(let r=i.length-1;r>=0;r--)i[r]&&n.removeChild(i[r]);this.__currentElement=n,this.__groupStack=[],e&&this.__addTransform(e)}clearRect(t,e,n,i){if(t===0&&e===0&&n===this.width&&i===this.height){this.__clearCanvas();return}const r=this.__closestGroupOrSvg(),o=this.__createElement("rect",{x:t,y:e,width:n,height:i,fill:"#FFFFFF"},!0);r.appendChild(o)}createLinearGradient(t,e,n,i){const r=this.__createElement("linearGradient",{id:Gs(this.__ids),x1:t+"px",x2:n+"px",y1:e+"px",y2:i+"px",gradientUnits:"userSpaceOnUse"},!1);return this.__SVGdefs.appendChild(r),new yo(r,this)}createRadialGradient(t,e,n,i,r,o){const a=this.__createElement("radialGradient",{id:Gs(this.__ids),cx:i+"px",cy:r+"px",r:o+"px",fx:t+"px",fy:e+"px",gradientUnits:"userSpaceOnUse"},!1);return this.__SVGdefs.appendChild(a),new yo(a,this)}__parseFont(){const e=/^\s*(?=(?:(?:[-a-z]+\s*){0,2}(italic|oblique))?)(?=(?:(?:[-a-z]+\s*){0,2}(small-caps))?)(?=(?:(?:[-a-z]+\s*){0,2}(bold(?:er)?|lighter|[1-9]00))?)(?:(?:normal|\1|\2|\3)\s*){0,3}((?:xx?-)?(?:small|large)|medium|smaller|larger|[.\d]+(?:%|in|[cem]m|ex|p[CustomCanvasContext]))(?:\s*\/\s*(normal|[.\d]+(?:%|in|[cem]m|ex|p[CustomCanvasContext])))?\s*([-,'"\sa-z0-9]+?)\s*$/i.exec(this.font),n={style:e[1]||"normal",size:e[4]||"10px",family:e[6]||"sans-serif",weight:e[3]||"normal",decoration:e[2]||"normal",href:null};return this.__fontUnderline==="underline"&&(n.decoration="underline"),this.__fontHref&&(n.href=this.__fontHref),n}__wrapTextLink(t,e){if(t.href){const n=this.__createElement("a");return n.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",t.href),n.appendChild(e),n}return e}__applyText(t,e,n,i){const r=this.__parseFont(),o=this.__closestGroupOrSvg(),a=this.__createElement("text",{"font-family":r.family,"font-size":r.size,"font-style":r.style,"font-weight":r.weight,"text-decoration":r.decoration,x:e,y:n,"text-anchor":Xy(this.textAlign),"dominant-baseline":$y(this.textBaseline)},!0);a.appendChild(this.__document.createTextNode(t)),this.__currentElement=a,this.__applyStyleToCurrentElement(i),o.appendChild(this.__wrapTextLink(r,a))}fillText(t,e,n){this.__applyText(t,e,n,"fill")}strokeText(t,e,n){this.__applyText(t,e,n,"stroke")}measureText(t){return this.__ctx.font=this.font,this.__ctx.measureText(t)}arc(t,e,n,i,r,o){if(i===r)return;i=i%(2*Math.PI),r=r%(2*Math.PI),i===r&&(r=(r+2*Math.PI-.001*(o?-1:1))%(2*Math.PI));const a=t+n*Math.cos(r),c=e+n*Math.sin(r),h=t+n*Math.cos(i),u=e+n*Math.sin(i),l=o?0:1;let d=0,f=r-i;f<0&&(f+=2*Math.PI),o?d=f>Math.PI?0:1:d=f>Math.PI?1:0,this.lineTo(h,u),this.__addPathCommand(At("A {rx} {ry} {xAxisRotation} {largeArcFlag} {sweepFlag} {endX} {endY}",{rx:n,ry:n,xAxisRotation:0,largeArcFlag:d,sweepFlag:l,endX:a,endY:c})),this.__currentPosition={x:a,y:c}}clip(){const t=this.__closestGroupOrSvg(),e=this.__createElement("clipPath"),n=Gs(this.__ids),i=this.__createElement("g");this.__applyCurrentDefaultPath(),t.removeChild(this.__currentElement),e.setAttribute("id",n),e.appendChild(this.__currentElement),this.__SVGdefs.appendChild(e),t.setAttribute("clip-path",At("url(#{id})",{id:n})),t.appendChild(i),this.__currentElement=i}drawImage(...t){let e=t[0],n,i,r,o,a=0,c=0,h,u,l,d,f,p,w,b;if(t.length===3)n=t[1],i=t[2],h=e.width,u=e.height,r=h,o=u;else if(t.length===5)n=t[1],i=t[2],r=t[3],o=t[4],h=e.width,u=e.height;else if(t.length===9)a=t[1],c=t[2],h=t[3],u=t[4],n=t[5],i=t[6],r=t[7],o=t[8];else throw new Error("Invalid number of arguments passed to drawImage: "+arguments.length);const x=this.__closestGroupOrSvg();this.__currentElement;const g="translate("+n+", "+i+")";if(e instanceof qs){if(l=e.getSvg().cloneNode(!0),l.childNodes&&l.childNodes.length>1){for(d=l.childNodes[0];d.childNodes.length;)b=d.childNodes[0].getAttribute("id"),this.__ids[b]=b,this.__SVGdefs.appendChild(d.childNodes[0]);if(f=l.childNodes[1],f){const v=f.getAttribute("transform");let _;v?_=v+" "+g:_=g,f.setAttribute("transform",_),x.appendChild(f)}}}else(e.nodeName==="CANVAS"||e.nodeName==="IMG")&&(p=this.__createElement("image"),p.setAttribute("width",r),p.setAttribute("height",o),p.setAttribute("preserveAspectRatio","none"),(a||c||h!==e.width||u!==e.height)&&(w=this.__document.createElement("canvas"),w.width=r,w.height=o,w.getContext("2d")?.drawImage(e,a,c,h,u,0,0,r,o),e=w),p.setAttribute("transform",g),p.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",e.nodeName==="CANVAS"?e.toDataURL():e.getAttribute("src")),x.appendChild(p))}createPattern(t,e){const n=this.__document.createElementNS("http://www.w3.org/2000/svg","pattern"),i=Gs(this.__ids);let r;return n.setAttribute("id",i),t.nodeName==="CANVAS"||t.nodeName==="IMG"?(r=this.__document.createElementNS("http://www.w3.org/2000/svg","image"),r.setAttribute("width",""+t.width),r.setAttribute("height",""+t.height),r.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",t.nodeName==="CANVAS"?t.toDataURL():t.getAttribute("src")),n.appendChild(r),this.__SVGdefs.appendChild(n)):t instanceof qs&&(n.setAttribute("width",""+t.width),n.setAttribute("height",""+t.height),n.appendChild(t.__rootSVG.childNodes[1]),this.__SVGdefs.appendChild(n)),new Du(n,this)}setLineDash(t){t&&t.length>0?this.lineDash=t.join(","):this.lineDash=null}drawFocusRing(){}createImageData(){}getImageData(){}putImageData(){}globalCompositeOperation(){}setTransform(){}}class wo{canvas;context;customContext;currentPath2D=new Path2D;path2Ds=[];currentMatrix=new DOMMatrix;hasSetCustomStrokeStyle=!1;hasSetCustomFillStyle=!1;constructor(t,e,n,i=!1){this.canvas=t,this.context=t.getContext("2d",{willReadFrequently:!0}),i&&(this.customContext=new qs({canvas:this.canvas,width:e||this.canvas.width,height:n||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,n,i){return this.context.fillRect(t,e,n,i),this.customContext&&this.customContext.fillRect(t,e,n,i),this}fillText(t,e,n,i){return this.hasSetCustomFillStyle=!1,this.context.fillText(t,e,n,i),this.customContext&&this.customContext.fillText(t,e,n),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,n,i){return this.context.strokeText(t,e,n,i),this.customContext&&this.customContext.strokeText(t,e,n),this}strokeRect(t,e,n,i){return this.context.strokeRect(t,e,n,i),this.customContext&&this.customContext.strokeRect(t,e,n,i),this}measureText(t){return this.context.measureText(t)}clearRect(t=0,e=0,n=this.canvas.width,i=this.canvas.height){return this.context.clearRect(t,e,n,i),this.customContext&&this.customContext.clearRect(t,e,n,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 n=new Path2D;n.addPath(t,e),this.currentPath2D=n}isPointInStroke(...t){return t[0]instanceof Path2D?this.context.isPointInStroke(t[0],t[1],t[2]):this.context.isPointInStroke(t[0],t[1])}isPointInPath(...t){return t[0]instanceof Path2D?this.context.isPointInPath(t[0],t[1],t[2]):this.context.isPointInPath(t[0],t[1])}translate(t,e){return this.context.translate(t,e),this.customContext&&this.customContext.translate(t,e),this.currentMatrix.translate(t,e),this.changePath2D(),this}rotate(t,e=0,n=0){return this.translate(e,n),this.context.rotate(t),this.customContext&&this.customContext.rotate(t),this.currentMatrix.rotate(t),this.translate(-e,-n),this.changePath2D(),this}scale(t,e=t,n=0,i=0){return this.translate(n,i),this.context.scale(t,e),this.customContext&&this.customContext.scale(t,e),this.currentMatrix.scale(t,e),this.translate(-n,-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,n,i,r,o){return this.context.arc(t,e,n,i,r,o),this.customContext&&this.customContext.arc(t,e,n,i,r,o?-1:1),this.currentPath2D.arc(t,e,n,i,r,o),this}arcTo(t,e,n,i,r){return this.context.arcTo(t,e,n,i,r),this.customContext&&this.customContext.arcTo(t,e,n,i,r),this.currentPath2D.arcTo(t,e,n,i,r),this}ellipse(t,e,n,i,r,o,a,c){return this.context.ellipse(t,e,n,i,r,o,a,c),this.currentPath2D.ellipse(t,e,n,i,r,o,a,c),this}quadraticCurveTo(t,e,n,i){return this.context.quadraticCurveTo(t,e,n,i),this.customContext&&this.customContext.quadraticCurveTo(t,e,n,i),this.currentPath2D.quadraticCurveTo(t,e,n,i),this}bezierCurveTo(t,e,n,i,r,o){return this.context.bezierCurveTo(t,e,n,i,r,o),this.customContext&&this.customContext.bezierCurveTo(t,e,n,i,r,o),this.currentPath2D.bezierCurveTo(t,e,n,i,r,o),this}rect(t,e,n,i){return this.context.rect(t,e,n,i),this.customContext&&this.customContext.rect(t,e,n,i),this.currentPath2D.rect(t,e,n,i),this}createLinearGradient(t,e,n,i,r){const o=this.context.createLinearGradient(t,e,n,i);return r&&Object.entries(r).forEach(([a,c])=>{o.addColorStop(parseFloat(a),c)}),o}createRadialGradient(t,e,n,i,r,o,a){const c=this.context.createRadialGradient(t,e,n,i,r,o);return a&&Object.entries(a).forEach(([h,u])=>{c.addColorStop(parseFloat(h),u)}),c}drawImage(t,...e){if(e.length===0)this.context.drawImage(t,0,0);else if(e.length===2){const n=e[0],i=e[1];this.context.drawImage(t,n,i)}else if(e.length===4){const n=e[0],i=e[1],r=e[2],o=e[3];this.context.drawImage(t,n,i,r,o)}else if(e.length===8){const n=e[0],i=e[1],r=e[2],o=e[3],a=e[4],c=e[5],h=e[6],u=e[7];this.context.drawImage(t,n,i,r,o,a,c,h,u)}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,n=this.canvas.width,i=this.canvas.height,r){return this.context.getImageData(t,e,n,i,r)}putImageData(t,e=0,n=0){return this.context.putImageData(t,e,n)}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}}}const Jn={1:705234,2:8108026,3:6346665,4:16630114,5:16607842,6:16158139,7:2542847,8:10640125,9:16735870,10:8978266,11:16580418,12:16754221,13:16725759,14:14436630,15:6844849,16:13744437,17:1817755,18:16744272,19:4964291,20:16750848,d:14540253,aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};class Vt{_color={r:0,g:0,b:0,a:1};constructor(t,e){t&&this.setColor(t),this.setAlpha(e)}get color(){return this._color}set color(t){const e=`Color: Unknown color(${t}) type(${typeof t})`;if(typeof t=="number")this.setHEX(t);else if(typeof t=="string"){let n;if(n=/^(\w+)\(([^)]*)\)/.exec(t)){const i=n[2];let r;switch(n[1]){case"rgb":case"rgba":(r=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(i))?(this.r=parseInt(r[1],10),this.g=parseInt(r[2],10),this.b=parseInt(r[3],10),this.a=r[4]?parseFloat(r[4]):1):(r=/^\s*(\d+)%\s*,\s*(\d+)%\s*,\s*(\d+)%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(i))?(this.r=B(parseFloat(r[1]),0,100)*255/100,this.g=B(parseFloat(r[2]),0,100)*255/100,this.b=B(parseFloat(r[3]),0,100)*255/100,this.a=r[4]?parseFloat(r[4]):1):console.warn(e);break;case"hsl":case"hsla":(r=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)%\s*,\s*(\d*\.?\d+)%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(i))?this.setHSL(parseFloat(r[1])/360,parseFloat(r[2])/100,parseFloat(r[3])/100,r[4]?parseFloat(r[4]):1):console.warn(e);break;case"hsv":case"hsva":case"hsb":case"hsba":(r=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)%\s*,\s*(\d*\.?\d+)%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(i))?this.setHSV(parseFloat(r[1])/360,parseFloat(r[2])/100,parseFloat(r[3])/100,r[4]?parseFloat(r[4]):1):console.warn(e);break;default:console.warn(e)}}else if(n=/#([A-Fa-f0-9]+)/.exec(t)){const i=n[1],r=i.length;r===3?this.setRGB(parseInt(i.charAt(0),16),parseInt(i.charAt(1),16),parseInt(i.charAt(2),16),1):r===6||r===8?this.setHEX(parseInt(i,16)):console.warn(e)}else if(t&&t.length>0)try{this.setColorName(t)}catch{console.warn(e)}else console.warn(e)}else t instanceof Vt?this.setRGB(t.r,t.g,t.b,t.a):Object.prototype.hasOwnProperty.call(t,"r")&&Object.prototype.hasOwnProperty.call(t,"g")&&Object.prototype.hasOwnProperty.call(t,"b")?this.setRGB(t.r,t.g,t.b,Object.prototype.hasOwnProperty.call(t,"a")?t.a:1):Object.prototype.hasOwnProperty.call(t,"h")&&Object.prototype.hasOwnProperty.call(t,"s")&&Object.prototype.hasOwnProperty.call(t,"l")?this.setHSL(t.h,t.s,t.l,Object.prototype.hasOwnProperty.call(t,"a")?t.a:1):Object.prototype.hasOwnProperty.call(t,"h")&&Object.prototype.hasOwnProperty.call(t,"s")&&Object.prototype.hasOwnProperty.call(t,"v")?this.setHSV(t.h,t.s,t.v,Object.prototype.hasOwnProperty.call(t,"a")?t.a:1):Object.prototype.hasOwnProperty.call(t,"h")&&Object.prototype.hasOwnProperty.call(t,"s")&&Object.prototype.hasOwnProperty.call(t,"b")?this.setHSV(t.h,t.s,t.b,Object.prototype.hasOwnProperty.call(t,"a")?t.a:1):console.warn(e)}setColor(t){return this.color=t,this}set(t){return this.setColor(t)}get r(){return this._color.r}set r(t){try{this._color.r=B(Math.round(Ht(t)),0,255)}catch{}}get g(){return this._color.g}set g(t){try{this._color.g=B(Math.round(Ht(t)),0,255)}catch{}}get b(){return this._color.b}set b(t){try{this._color.b=B(Math.round(Ht(t)),0,255)}catch{}}get a(){return this._color.a}set a(t){try{this._color.a=B(Ht(t),0,1)}catch{}}setAlpha(t){return this.a=t,this}setFromVector3(t){return this.r=t.x,this.g=t.y,this.b=t.z,this}applyMatrix3(t){const e=this.r,n=this.g,i=this.b,r=t.value;return this.r=r[0]*e+r[3]*n+r[6]*i,this.g=r[1]*e+r[4]*n+r[7]*i,this.b=r[2]*e+r[5]*n+r[8]*i,this}fromBufferAttribute(t,e){return this.r=t.getX(e),this.g=t.getY(e),this.b=t.getZ(e),this}fromArray(t,e=0){return this.r=t[e],this.g=t[e+1],this.b=t[e+2],this.a=t[e+3],this}toArray(t=[],e=0){return t[e]=this.r,t[e+1]=this.g,t[e+2]=this.b,t[e+3]=this.a,t}toRGBString(){return this.a===1?`rgb(${this.r},${this.g},${this.b})`:`rgba(${this.r},${this.g},${this.b},${Q(this.a,6)})`}toHexString(){return this.a===1?("000000"+this.hex.toString(16)).slice(-6):("00000000"+this.hex.toString(16)).slice(-8)}toString(){return this.a===1?"#"+this.toHexString():this.toRGBString()}toColorSpaceString(t=He){vo.fromWorkingColorSpace(pe.copy(this),t);const e=pe.r,n=pe.g,i=pe.b;return t!==He?`color(${t} ${e.toFixed(3)} ${n.toFixed(3)} ${i.toFixed(3)})`:this.toRGBString()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b,yield this.a}clone(){return new Vt(this.color)}copy(t){return this.setColor(t.color),this}copySRGBToLinear(t){return this.r=qe(t.r),this.g=qe(t.g),this.b=qe(t.b),this}copyLinearToSRGB(t){return this.r=je(t.r),this.g=je(t.g),this.b=je(t.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}equals(t){return t.r===this.r&&t.g===this.g&&t.b===this.b&&t.a===this.a}add(t){return this.r=this.r+t.r,this.g=this.g+t.g,this.b=this.b+t.b,this}addColors(t,e){return this.r=t.r+e.r,this.g=t.g+e.g,this.b=t.b+e.b,this}addScalar(t){return this.r=this.r+t,this.g=this.g+t,this.b=this.b+t,this}setScalar(t){return this.r=t,this.g=t,this.b=t,this}sub(t){return this.r=this.r-t.r,this.g=this.g-t.g,this.b=this.b-t.b,this}multiply(t){return this.r=this.r*t.r,this.g=this.g*t.g,this.b=this.b*t.b,this}multiplyScalar(t){return this.r=this.r*t,this.g=this.g*t,this.b=this.b*t,this}opposite(t=!0,e="#000000",n="#ffffff"){if(t)return this.setColor(this.r*.299+this.g*.587+this.b*.114>186?e:n);{const{r:i,g:r,b:o}=this.color;return this.r=255-i,this.g=255-r,this.b=255-o,this}}lighten(t){t=B(t,0,1);const{r:e,g:n,b:i}=this.color;return this.r=e+(255-e)*t,this.g=n+(255-n)*t,this.b=i+(255-i)*t,this}darken(t){t=B(t,0,1);const{r:e,g:n,b:i}=this.color;return this.r=e*(1-t),this.g=n*(1-t),this.b=i*(1-t),this}lerp(t,e){e=B(e,0,1);const{r:n,g:i,b:r}=this.color;return this.r=n+(t.r-n)*e,this.g=i+(t.g-i)*e,this.b=r+(t.b-r)*e,this}lerpColors(t,e,n){return n=B(n,0,1),this.r=t.r+(e.r-t.r)*n,this.g=t.g+(e.g-t.g)*n,this.b=t.b+(e.b-t.b)*n,this}static gradient(t,e,n){try{return pe.lerpColors(new Vt(t),new Vt(e),n).toString()}catch{return e}}static random(){return pe.setHEX(Math.random()*16777215).toString()}static nextIndex=0;static next(t=Vt.nextIndex){Vt.nextIndex=t;const e=Object.keys(Jn),n=e.length;return pe.setHEX(Jn[e[Vt.nextIndex++%n]]).toString()}setColorName(t){const e=Jn[t.toLowerCase()];return e!==void 0?this.setHEX(e):t==="none"?this.a=0:(this.a=1,console.warn("Color.setColorName: Unknown color "+t)),this}static getColors(){return Object.values(Jn).map(t=>pe.setHEX(t).toString())}setRGB(t,e,n,i=1){return this.r=t,this.g=e,this.b=n,this.a=i,this}get rgb(){return{r:this.r,g:this.g,b:this.b,a:this.a}}setHEX(t){return t=Math.floor(t),t<16777216?(this.r=t>>16&255,this.g=t>>8&255,this.b=t&255,this.a=1):(this.r=t>>24&255,this.g=t>>16&255,this.b=t>>8&255,this.a=(t&255)/255),this}get hex(){let t=(this.r<<16)+(this.g<<8)+this.b;return this.a!==1&&(t=t<<8,t+=Math.round(this.a*255)),t}setHSL(t,e,n,i=1){const r=Wl(t,1),o=B(e,0,1),a=B(n,0,1);if(o===0)this.r=a*255,this.g=a*255,this.b=a*255;else{const c=a<=.5?a*(1+o):a+o-a*o,h=2*a-c;this.r=_o(h,c,r+.3333333333333333)*255,this.g=_o(h,c,r)*255,this.b=_o(h,c,r-.3333333333333333)*255}return this.a=i,this}getHSL(t){const e=this.r,n=this.g,i=this.b,r=Math.max(e,n,i)/255,o=Math.min(e,n,i)/255;let a,c;const h=(o+r)/2;if(o===r)a=0,c=0;else{const u=r-o;switch(c=h<=.5?u/(r+o):u/(2-r-o),r){case e:a=(n-i)/u+(n<i?6:0);break;case n:a=(i-e)/u+2;break;case i:default:a=(e-n)/u+4;break}a/=6}return t&&t.setHSL(a,c,h,this.a),{h:a,s:c,l:h,a:this.a}}offsetHSL(t,e,n){const i=this.getHSL();return this.setHSL(i.h+t,i.s+e,i.l+n)}lerpHSL(t,e){const n=this.getHSL(),i=t.getHSL(),r=as(n.h,i.h,e),o=as(n.s,i.s,e),a=as(n.l,i.l,e);return this.setHSL(r,o,a),this}setHSV(t,e,n,i=1){const r=B(t,0,1)*360,o=B(e,0,1),a=B(n,0,1),c=Math.floor(r/60)%6,h=r/60-Math.floor(r/60),u=a*(1-o),l=a*(1-h*o),d=a*(1-(1-h)*o),f=[[a,d,u],[l,a,u],[u,a,d],[u,l,a],[d,u,a],[a,u,l]][c];return this.r=f[0]*255,this.g=f[1]*255,this.b=f[2]*255,this.a=i,this}setHSB(t,e,n,i=1){this.setHSV(t,e,n,i)}getHSV(t){const{r:e,g:n,b:i,a:r}=this.color,o=Math.max(e,n,i),a=Math.min(e,n,i),c=o-a;let h;e===o?h=(n-i)/c:n===o?h=2+(i-e)/c:h=4+(e-n)/c,h/=6,h<0&&(h+=1);const u=c==0?0:h,l=o===0?0:c/o,d=o/255;return t&&t.setHSV(u,l,d,r),{h:u,s:l,v:d,a:r}}getHSB(t){const{h:e,s:n,v:i,a:r}=this.getHSV(t);return{h:e,s:n,b:i,a:r}}}const pe=new Vt;function qe(s){return s<.04045?s*.0773993808:Math.pow(s*.9478672986+.0521327014,2.4)}function je(s){return s<.0031308?s*12.92:1.055*Math.pow(s,.41666)-.055}const Ru="",He="srgb",xo="srgb-linear",bo="linear",js="srgb",Lu=new un().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),Ou=new un().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715),zu=[.64,.33,.3,.6,.15,.06],Fu=[.2126,.7152,.0722],Bu=[.3127,.329],vo={enabled:!0,workingColorSpace:xo,spaces:{},convert:function(s,t,e){return this.enabled===!1||t===e||!t||!e||(this.spaces[t].transfer===js&&(s.r=qe(s.r),s.g=qe(s.g),s.b=qe(s.b)),this.spaces[t].primaries!==this.spaces[e].primaries&&(s.applyMatrix3(this.spaces[t].toXYZ),s.applyMatrix3(this.spaces[e].fromXYZ)),this.spaces[e].transfer===js&&(s.r=je(s.r),s.g=je(s.g),s.b=je(s.b))),s},fromWorkingColorSpace:function(s,t){return this.convert(s,this.workingColorSpace,t)},toWorkingColorSpace:function(s,t){return this.convert(s,t,this.workingColorSpace)},getPrimaries:function(s){return this.spaces[s].primaries},getTransfer:function(s){return s===Ru?bo:this.spaces[s].transfer},getLuminanceCoefficients:function(s,t=this.workingColorSpace){return s.fromArray(this.spaces[t].luminanceCoefficients)},define:function(s){Object.assign(this.spaces,s)},_getMatrix:function(s,t,e){return s.copy(this.spaces[t].toXYZ).multiply(this.spaces[e].fromXYZ)},_getDrawingBufferColorSpace:function(s){return this.spaces[s].outputColorSpaceConfig.drawingBufferColorSpace},_getUnpackColorSpace:function(s=this.workingColorSpace){return this.spaces[s].workingColorSpaceConfig.unpackColorSpace}};vo.define({[xo]:{primaries:zu,whitePoint:Bu,transfer:bo,toXYZ:Lu,fromXYZ:Ou,luminanceCoefficients:Fu,workingColorSpaceConfig:{unpackColorSpace:He},outputColorSpaceConfig:{drawingBufferColorSpace:He}},[He]:{primaries:zu,whitePoint:Bu,transfer:js,toXYZ:Lu,fromXYZ:Ou,luminanceCoefficients:Fu,outputColorSpaceConfig:{drawingBufferColorSpace:He}}});function _o(s,t,e){return e<0&&(e+=1),e>1&&(e-=1),e<.16666666666666666?s+(t-s)*6*e:e<.5?t:e<.6666666666666666?s+(t-s)*6*(.6666666666666666-e):s}class ft{id;d;parent;attrs;_centerX;_centerY;_x;_y;_degree;_scaleX;_scaleY;vx;vy;ax;ay;mass;show;followMouse;drag;transform$=new Mn;isMouseIn=!1;isDragging=!1;el;constructor(t){this.id=rs(),this.d=t?.d,this.attrs={stroke:"none",fill:"none"},t?.attrs&&this.setAttr(t?.attrs),this._centerX=t?.centerX,this._centerY=t?.centerY,this._x=t?.x||0,this._y=t?.y||0,this._degree=t?.degree||0,this._scaleX=1,this._scaleY=1,t?.scale!==void 0&&(this._scaleX=t.scale,this._scaleY=t.scale),t?.scaleX!==void 0&&(this._scaleX=t.scaleX),t?.scaleY!==void 0&&(this._scaleY=t.scaleY),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.show=typeof t?.show=="boolean"?t?.show:!0,this.followMouse=typeof t?.followMouse=="boolean"?t?.followMouse:!1,this.drag=t?.drag}destroy(){}moveTo(t,e){const n=this._x,i=this._y;(n!==t||i!==e)&&(this._x=t,this._y=e,this.transform$.next({dx:t-n,dy:e-i}))}move(t,e=0){this.moveTo(this._x+t,this._y+e)}moveXTo(t){this.moveTo(t,this._y)}moveX(t){this.moveTo(this._x+t,this._y)}moveYTo(t){this.moveTo(this._x,t)}moveY(t){this.moveTo(this._x,this._y+t)}get x(){return this._x}set x(t){this._x=t}get y(){return this._y}set y(t){this._y=t}rotateTo(t){this._degree=t}rotate(t){this.rotateTo(this._degree+t)}get degree(){return this._degree}set degree(t){this._degree=t}scaleTo(t,e){this._scaleX=t,this._scaleY=e||t}scale(t,e){this.scaleTo(this._scaleX*t,this._scaleY*(e||t))}get scaleX(){return this._scaleX}set scaleX(t){this._scaleX=t}get scaleY(){return this._scaleY}set scaleY(t){this._scaleY=t}pathD(){return this.d?(this.d instanceof St||(this.d=new St(this.d)),this.d):new St(this.toSVGPathData())}forcePathD(t){this.d=t}getBaseOptions(){return{d:this.d,attrs:this.getAttrs(),centerX:this._centerX,centerY:this._centerY,x:this._x,y:this._y,degree:this._degree,scaleX:this._scaleX,scaleY:this._scaleY,vx:this.vx,vy:this.vy,ax:this.ax,ay:this.ay,mass:this.mass,followMouse:this.followMouse,drag:this.drag}}clone(){const t=this.cloneShape();return this.parent&&(t.parent={...this.parent}),t}cloneShape(){return new ft(this.getBaseOptions())}toSVGPathData(){return[]}toSVGPathD(){return this.pathD().toSVGPathD()}toCanvasContext(t){this.pathD().toCanvasContext(t)}getBoundingClientRect(t=2){return this.pathD().getBoundingClientRect(t)}getBoundingClientRectCenter(t=2){return this.pathD().getBoundingClientRectCenter(t)}transformOrigin(t=!1,e=2){let n=this._centerX||0,i=this._centerY||0;if(typeof this._centerX>"u"&&typeof this._centerY>"u"){const r=this.getBoundingClientRectCenter(e);if(t||!this.parent)n=r.x,i=r.y;else{const o=this.parent.combo.getBoundingClientRectCenter(e);n=o.x-this.parent.dx,i=o.y-this.parent.dy}}return{x:n,y:i}}isPointInPath(t,e,n){if(t instanceof wo)return t.isPointInPath(new Path2D(this.toSVGPathD()),e,n);if(this.el instanceof SVGGeometryElement){const i=this.el.getCTM();if(i){const r=i.inverse();return this.el.isPointInFill({x:r.a*e+r.c*n+r.e,y:r.b*e+r.d*n+r.f})}}return!1}isPointInStroke(t,e,n){if(t instanceof wo)return t.isPointInStroke(new Path2D(this.toSVGPathD()),e,n);if(this.el instanceof SVGGeometryElement){const i=this.el.getCTM();if(i){const r=i.inverse();return this.el.isPointInStroke({x:r.a*e+r.c*n+r.e,y:r.b*e+r.d*n+r.f})}}return!1}setAttr(t,e){if(typeof t!="string")for(const n in t){const i=t[n];i&&(this.attrs[xt(n)]=i)}else e&&(this.attrs[xt(t)]=e)}getAttr(t,e){return this.attrs[t]||this.attrs[xt(t)]||e}hasAttr(t){return!!this.getAttr(t)}getAttrs(){return{...this.attrs}}animate(t){this.vx+=this.ax,this.vy+=this.ay;const e=t?.gravity||0;this.vy+=e;const n=t?.friction||1;this.vx*=n,this.vy*=n,this.moveTo(this.x+this.vx,this.y+this.vy)}animateEaseTo(t,e){const n=e?.easing||.05,i=t.x-this.x,r=t.y-this.y;this.vx=i*n,this.vy=r*n,this.animate(e)}animateSpringTo(t,e){const n=e?.spring||.03;(Array.isArray(t)?t:[t]).forEach(i=>{const r=i.x-this.x,o=i.y-this.y,a=r*n,c=o*n;this.vx+=a,this.vy+=c}),this.animate({friction:.9,...e})}animateSpringMassTo(t,e){const n=e?.springLength||100,i=e?.spring||1e-4,r=t.x-this.x,o=t.y-this.y,a=Math.sqrt(r*r+o*o);if(a<n){const c=r*i,h=o*i;return this.vx+=c/this.mass,this.vy+=h/this.mass,t.vx-=c/t.mass,t.vy-=h/t.mass,1-a/n}return 0}distance(t){return Ee(this.x,this.y,t.x,t.y)}rotateToTarget(t){this.rotateTo(Pt(Qt(this.x,this.y,t.x,t.y)))}followTo(t,e=3){this.rotateToTarget(t);const{dx:n,dy:i}=hn(J(this.degree),e);this.vx=n,this.vy=i,this.animate()}followAccelerationTo(t,e=.05){this.rotateToTarget(t);const{dx:n,dy:i}=hn(J(this.degree),e);this.ax=n,this.ay=i,this.animate()}gravitateTo(t){const e=t.x-this.x,n=t.y-this.y,i=e*e+n*n,r=Math.sqrt(i),o=this.mass*t.mass/i,a=o*e/r,c=o*n/r;this.vx+=a/this.mass,this.vy+=c/this.mass,t.vx-=a/t.mass,t.vy-=c/t.mass}checkCollision(t){}checkWall(t){}getTotalLength(){return this.pathD().getTotalLength()}interpolate(t){return this.pathD().interpolate(t)}getPointAtLength(t){return this.pathD().getPointAtLength(t)}trailPath(t=0){const e=this.getTotalLength();return{subPathD:this.pathD().getSubPathD(0,t*e),point:this.getPointAtLength(t*e)}}strokeDashTween(t=1e3,e){const n=Q(this.pathD().getTotalLength(),0);this.setAttr({strokeDasharray:`${n} ${n}`,strokeDashoffset:`${n}`});const i=e?.onUpdate,r=new Rn({frameDuration:t});r.addTween({offset:n},{offset:0},Object.assign(e||{},{onUpdate:(o,a)=>{this.setAttr("strokeDashoffset",""+Q(o.offset,2)),i?.(o,a)}})),r.play()}}class Ut{options;commonChildShapeOptions;shapes=[];x=0;y=0;degree=0;scaleX=1;scaleY=1;constructor(t,e){if(this.options=t,this.commonChildShapeOptions=e,t?.svg){let n=0,i=0,r=0,o=0;const a=new Yy(t.svg).parse();for(let c=0,h=a.length;c<h;c++){const u=a[c];if(u.type=="viewbox"&&u.width&&u.height){if(n=parseFloat(u.width),i=parseFloat(u.height),t.forceWidth){const w=n/i;r=t.forceWidth,o=r/w}else r=n,o=i;continue}if(u.type!="path"||!Eu(u.path))continue;const l={};for(const w in u)w==="type"||w==="path"||w==="transform"||(l[w]=u[w]);const d=Mu(Pu(u.path)),f=[];let p=[];for(let w=0,b=d.length;w<b;w++){const x=d[w];p.push(x),x[0].toLowerCase()=="z"&&(f.push(p),p=[])}p.length&&f.push(p),f.forEach(w=>{const b=new ft({...e,d:w,attrs:{...e?.attrs,...l}});if(u.transform){const g=Fr(u.transform).split();b.moveTo(g.x,g.y),b.rotateTo(g.degree),b.scaleTo(g.scaleX,g.scaleY)}r&&n&&o&&i&&b.scaleTo(b.scaleX*(r/n),b.scaleY*(o/i)),this.addShape(b)})}}}destroy(){this.shapes.forEach(t=>t.destroy())}clone(){const t=this.cloneShapeCombo();return t.x=this.x,t.y=this.y,t.degree=this.degree,t.scaleX=this.scaleX,t.scaleY=this.scaleY,t.shapes=this.shapes.map(e=>{const n=e.clone();return n.parent&&(n.parent.combo=t),n}),t}cloneShapeCombo(){return new Ut(this.options,this.commonChildShapeOptions)}addShape(t,e=0,n=0){t.parent={combo:this,dx:e||t.x,dy:n||t.y},this.shapes.push(t)}comboMove(t,e){this.x+=t,this.y+=e,this.shapes.forEach(n=>{n.move(t,e)})}comboRotate(t){this.degree+=t,this.shapes.forEach(e=>{e.rotate(t)})}comboScale(t,e){this.scaleX*=t,this.scaleY*=e||t,this.shapes.forEach(n=>{n.scale(t,e)})}comboTransform(t){(typeof t?.x=="number"||typeof t?.y=="number")&&this.comboMove(t?.x||0,t?.y||0),typeof t?.degree=="number"&&this.comboRotate(t?.degree||0),(typeof t?.scale=="number"||typeof t?.scaleX=="number"||typeof t?.scaleY=="number")&&this.comboScale(t?.scaleX||t?.scale||1,t?.scaleY||t?.scale||1)}getBoundingClientRect(t=2){const e=[],n=[];if(this.shapes.forEach(c=>{const h=c.getBoundingClientRect(t);e.push(h.x,h.x+h.width),n.push(h.y,h.y+h.height)}),e.length==0||n.length==0)return{x:0,y:0,width:0,height:0,center:{x:0,y:0}};const i=Math.min(...e),r=Math.min(...n),o=Math.max(...e),a=Math.max(...n);return{x:Q(i,t),y:Q(r,t),width:Q(o-i,t),height:Q(a-r,t)}}getBoundingClientRectCenter(t=2){const e=this.getBoundingClientRect(t);return{x:Q(e.x+e.width*.5,t),y:Q(e.y+e.height*.5,t)}}setAttr(t,e){typeof t!="string"?this.shapes.forEach(n=>{n.setAttr(t)}):e&&this.shapes.forEach(n=>{n.setAttr(t,e)})}sort(){this.shapes=this.shapes.map(t=>({shape:t,perimeter:t.pathD().getPolymorphPointsPerimeter()})).sort((t,e)=>e.perimeter-t.perimeter).map(t=>t.shape)}expendTo(t){const e=t.shapes.length,n=this.shapes.length;if(e<n)return t.expendTo(this);for(let i=n;i<e;i++)this.addShape(t.shapes[i].clone())}strokeDashTween(t,e){const n=this.shapes.length-1;switch(e?.type){case"sequence":this.shapes.forEach((a,c)=>{a.strokeDashTween(t,{...e,delay:c,onStart:()=>{c==0&&e?.onGroupStart?.()},onUpdate:()=>{e?.onGroupUpdate?.()},onComplete:()=>{c==n&&e?.onGroupComplete?.()}})});break;case"parallel":default:const i=new Rn({frameDuration:t}),r={},o={};this.shapes.forEach((a,c)=>{const h=Q(a.getTotalLength(),0);r[`offset_${c}`]=h,o[`offset_${c}`]=0,a.setAttr({strokeDasharray:`${h} ${h}`,strokeDashoffset:`${h}`})}),i.addTween(r,o,Object.assign(e||{},{onStart:()=>{e?.onGroupStart?.()},onUpdate:(a,c)=>{for(const h in a){const u=Kl(h).number;this.shapes[u].setAttr("strokeDashoffset",""+Q(a[h],2))}e?.onGroupUpdate?.()},onComplete:()=>{e?.onGroupComplete?.()}})),i.play();break}}}function Vy(s,t){s.forEach(n=>{n.animate(),t?.wall&&n.checkWall({wall:t.wall,bounce:t.bounce})});const e=s.length;for(let n=0,i=e-1;n<i;n++)for(let r=n+1;r<e;r++)s[n].checkCollision(s[r])}function Gy(s){const t=s.length;s.forEach((e,n)=>{e.animate();for(let i=n+1;i<t;i++)e.checkCollision(s[i]),e.gravitateTo(s[i])})}function qy(s,t){s.forEach((e,n)=>{n>0&&e.animateSpringTo(s[n-1],t)})}function jy(s,t){const e=t?.springLength||100;s.forEach(n=>{n.isDragging||s.filter(i=>i.id!==n.id).forEach(i=>{const r=Qt(n.x,n.y,i.x,i.y);n.animateSpringTo({x:i.x-Math.cos(r)*e,y:i.y-Math.sin(r)*e},t)})})}function Hy(s,t,e){const n=s.length,i=[];return s.forEach((r,o)=>{r.animate(e),r.x>t.x+t.width?r.moveXTo(t.x):r.x<t.x&&r.moveXTo(t.x+t.width),r.y>t.y+t.height?r.moveYTo(t.y):r.y<t.y&&r.moveYTo(t.y+t.height);for(let a=o+1;a<n;a++)i.push([r.x,r.y,s[a].x,s[a].y,r.animateSpringMassTo(s[a],e)])}),i}function So(s){if(s.length<2)throw new Error("shapes个数必须大于等于2");const t=s.length-1,e=new Array(t);for(let n=0;n<t;n++){const i=s[n].pathD(),r=s[n+1].pathD(),o=Math.max(i.getPolymorphPoints().length,r.getPolymorphPoints().length);e[n]=St.getInterpolator(i.getExpendedPolymorphPointsPathD(o),r.getExpendedPolymorphPointsPathD(o))}return n=>{const i=Q(t*n,6),r=Math.min(Math.floor(i),t-1),o=Q(i-r,6),a=new ft({d:e[r](o)}),c=s[r].getAttr("fill","none"),h=s[r+1].getAttr("fill","none");typeof c=="string"&&typeof h=="string"&&a.setAttr("fill",Vt.gradient(c,h,o).toString());const u=s[r].getAttr("stroke","none"),l=s[r+1].getAttr("stroke","none");return typeof u=="string"&&typeof l=="string"&&a.setAttr("stroke",Vt.gradient(u,l,o).toString()),a}}function Nu(s){if(s.length<2)throw new Error("shapeCombos个数必须大于等于2");let t=0,e;const n=[];s.forEach(o=>{let a;o instanceof Ut?(a=o,a.sort()):(a=new Ut,a.addShape(o)),n.push(a),t<a.shapes.length&&(t=a.shapes.length,e=a)}),n.forEach(o=>{o!==e&&o.expendTo(e)});const i=[];n.forEach((o,a)=>{o.shapes.forEach((c,h)=>{i[h]=i[h]||[],i[h][a]=c})});const r=[];return i.forEach(o=>{r.push(So(o))}),o=>{const a=new Ut;return r.forEach(c=>{a.addShape(c(o))}),a}}function Wy(s,t=6e3,e){const n=s.findIndex(a=>a instanceof Ut)>=0?Nu(s):So(s),i=n(0),r=e?.onUpdate,o=new Rn({frameDuration:t});o.addTween({t:0},{t:1},Object.assign(e||{},{onUpdate:(a,c)=>{n(a.t),r?.(a,c),i instanceof ft?e?.shape?.(i):i instanceof Ut&&i.shapes.forEach(h=>{e?.shape?.(h)})}})),o.play()}function Jy(s,t,e,n,i){if(i==0)throw new Error("no dividing by zero, please");const r=[],o=360/i;for(let c=0;c<i;c+=1){const h=o*c*Math.PI/180,u=s+2*e*Math.cos(h),l=t+2*e*Math.sin(h);r.push(new co({x:s,y:t,rx:e,ry:n,xAxisRotate:o*c,largeArcFlag:1,sweepFlag:1,toX:u,toY:l})),r.push(new co({x:u,y:l,rx:e,ry:n,xAxisRotate:o*c,largeArcFlag:1,sweepFlag:1,toX:s,toY:t}))}return new ft({d:St.fromLines(r)})}function Zy(s=document.documentElement,t="canvas"){Vh(s);let e=null,n=null,i=null;t=="svg"&&(e=Tu("svg"),Vn(s,e)),t=="canvas"&&(n=Hh("canvas"),Vn(s,n));const r={x:0,y:0,width:0,height:0},o=oo(s).subscribe(b=>{r.x=b.x,r.y=b.y,r.width=b.width,r.height=b.height,e&&Ve(e,{viewBox:`0 0 ${r.width} ${r.height}`,width:`${r.width}`,height:`${r.height}`}),n&&(Ve(n,{width:`${r.width}`,height:`${r.height}`}),i=new wo(n,r.width,r.height,!1))}),a=[];let c="",h="",u="default";const l=(b="default")=>{b!=u&&(s.style.cursor=b,u=b)},d=Ge(),f=du(e||n||s,{useMousePoint:d}).subscribe(()=>{}),p=b=>{b.followMouse&&(!pa(b.x,d.current.x,5)||!pa(b.y,d.current.y,5))&&b.followTo(d.current),b.drag&&b.drag.enable&&b.drag.targetToAfterDrop&&(b.isDragging||b.animateEaseTo(b.drag.targetToAfterDrop,{easing:b.drag.easing}))},w=(...b)=>{const x=[];b.forEach(g=>{g instanceof Ut?x.push(...g.shapes):x.push(g)}),e&&a.filter(g=>x.findIndex(v=>v.id==g.id)==-1).forEach(g=>{g.el&&(g.el.remove(),delete g.el)}),i&&i.clearRect(),jl(a,x),c="",d.current.isDown||(h="");for(const g of a){if(!g.show)continue;p(g);const v=g.transformOrigin(),_=v.x,E=v.y;if(e){const C=g.toSVGPathD();g.el||(g.el=zy(C,g.id),Vn(e,g.el));const I=new _t;I.translate(g.x,g.y),I.rotate(g.degree,_,E),I.scale(g.scaleX,g.scaleY,_,E),Ve(g.el,{d:C,transform:I.toString(),...g.getAttrs()})}if(i&&(i.save(),i.translate(g.x,g.y),i.rotate(J(g.degree),_,E),i.scale(g.scaleX,g.scaleY,_,E),g.toCanvasContext(i),wh(i,g.getAttrs()),i.hasSetCustomStrokeStyle&&i.stroke(),i.hasSetCustomFillStyle&&i.fill()),e?g.isMouseIn=g.isPointInPath(e,d.current.x,d.current.y)||g.isPointInStroke(e,d.current.x,d.current.y):i?g.isMouseIn=g.isPointInPath(i,d.current.x,d.current.y)||g.isPointInStroke(i,d.current.x,d.current.y):g.isMouseIn=!1,g.isMouseIn&&(l("pointer"),c=g.id),g.isDragging=g.id==h,d.current.isDown&&(g.isDragging||!h&&g.isMouseIn&&g.drag&&g.drag.enable)){l("grabbing"),g.isDragging=!0,h=g.id;let C=d.current.x-d.start.x,I=d.current.y-d.start.y;if(C||I){if(g.drag&&g.drag.enable&&g.drag.alongPath){const F=g.parent?g.parent.combo.x:g.x,N=g.parent?g.parent.combo.y:g.y,$=_+(g.parent?.dx||0),V=E+(g.parent?.dy||0),W=g.parent?g.parent.combo.degree:g.degree,tt=g.parent?g.parent.combo.scaleX:g.scaleX,Z=g.parent?g.parent.combo.scaleY:g.scaleY,mt=g.drag.alongPath.transform(F,N,$,V,W,tt,Z).closestPoint(d.current.x,d.current.y),kt=g.x,Ot=g.y;console.log(mt.point.x,mt.point.y,kt,Ot),C=mt.point.x-kt,I=mt.point.y-Ot,console.log(C,I)}(C||I)&&(g.move(C,I),g.parent?.combo.shapes.forEach(F=>{F.drag?.followSibling&&F!==g&&F.move(C,I)}))}d.setStart(d.current)}else g.isMouseIn&&g.drag&&g.drag.enable&&l("grab");i&&i.restore()}!c&&!h&&l("default")};return{rect:r,mousePoint:d.current,shapes:a,draw:w,ctx:i,unsubscribe:()=>{o.unsubscribe(),f.unsubscribe()},downloadSVG:()=>{e&&Fy(e)}}}class mn extends ft{dx;dy;constructor(t){if(super(t),t?.lineLength){const e=hn(J(t?.lineDegree||0),t.lineLength);this.dx=e.dx,this.dy=e.dy}else t?.lineDx||t?.lineDy?(this.dx=t?.lineDx||0,this.dy=t?.lineDy||0):(this.dx=0,this.dy=0)}cloneShape(){return new mn({...super.getBaseOptions(),lineDx:this.dx,lineDy:this.dy})}toSVGPathData(){return[["m",0,0],["l",this.dx,this.dy]]}toCanvasContext(t){t.beginPath(),t.moveTo(0,0),t.lineTo(this.dx,this.dy)}lineToAbsolutePoint(t){this.dx=t.x-this.x,this.dy=t.y-this.y}intersection(t){const e=this.transformOrigin(),i=this.pathD().transform(this.x,this.y,e.x,e.y,this.degree,this.scaleX,this.scaleY).normalizedLines[0],r=t.transformOrigin(),a=t.pathD().transform(this.x,this.y,r.x,r.y,t.degree,t.scaleX,t.scaleY).normalizedLines[0];return i.intersection(a)}}class Co extends Ut{constructor(t,e){super(t,e);const n=new mn({...e,drag:{...e?.drag,followSibling:!0},lineLength:100,lineDegree:90});this.addShape(n);const i=new mn({...e,drag:{...e?.drag,followSibling:!0},y:10+Math.random()*30,lineLength:10+Math.random()*30,lineDegree:Math.random()*120-150});this.addShape(i);const r=new mn({...e,drag:{...e?.drag,followSibling:!0},y:10+Math.random()*30,lineLength:10+Math.random()*30,lineDegree:Math.random()*120-150});this.addShape(r)}cloneShapeCombo(){return new Co(this.options,this.commonChildShapeOptions)}}class pn extends ft{radius;constructor(t){super(t),this.radius=t?.ballRadius||0}cloneShape(){return new pn({...super.getBaseOptions(),ballRadius:this.radius})}getBoundingClientRect(){return{x:-this.radius,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 cn(this.x,this.y)}scalar(t){return this.moveTo(this.x*t,this.y*t),this}normalize(t=1){const e=this.length();if(e){const n=t/e;this.scalar(n)}return this}clamp(t){const e=this.length();return e&&e>t&&this.scalar(t/e),this}cross(t){const e=this.x,n=this.y;return{x:n*t.x-e*t.y,y:e*t.y-n*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,n=t.y-this.y;if(Math.sqrt(e*e+n*n)<this.radius+t.radius){const r=Math.atan2(n,e),o={x:0,y:0},a=te(-r,e,n),c=te(-r,this.vx,this.vy),h=te(-r,t.vx,t.vy),u=c.x-h.x;c.x=((this.mass-t.mass)*c.x+2*t.mass*h.x)/(this.mass+t.mass),h.x=u+c.x;const l=Math.abs(c.x)+Math.abs(h.x),d=this.radius+t.radius-Math.abs(o.x-a.x);o.x+=c.x/l*d,a.x+=h.x/l*d;const f=te(r,o.x,o.y),p=te(r,a.x,a.y);t.moveTo(this.x+p.x,this.y+p.y),this.moveTo(this.x+f.x,this.y+f.y);const w=te(r,c.x,c.y),b=te(r,h.x,h.y);this.vx=w.x,this.vy=w.y,t.vx=b.x,t.vy=b.y}}checkWall(t){const e=typeof t?.bounce=="number"?t.bounce:-1,n=t.wall.x,i=t.wall.y,r=t.wall.x+t.wall.width,o=t.wall.y+t.wall.height;this.x+this.radius>r?(this.moveXTo(r-this.radius),this.vx*=e):this.x-this.radius<n&&(this.moveXTo(n+this.radius),this.vx*=e),this.y+this.radius>o?(this.moveYTo(o-this.radius),this.vy*=e):this.y-this.radius<i&&(this.moveYTo(i+this.radius),this.vy*=e)}}class To extends ft{constructor(t){super(t)}cloneShape(){return new To({...super.getBaseOptions()})}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 We extends ft{width;height;borderRadius;constructor(t){super(t),this.width=t.rectWidth,this.height=t.rectHeight,this.borderRadius=t.rectBorderRadius||0}cloneShape(){return new We({...super.getBaseOptions(),rectWidth:this.width,rectHeight:this.height,rectBorderRadius:this.borderRadius})}static fromCubicBezier(t,e,n,i,r,o,a,c){const u=new yt({x:t,y:e,c1x:n,c1y:i,c2x:r,c2y:o,toX:a,toY:c}).getBoundingClientRect();return new We({x:u.x,y:u.y,rectWidth:u.width,rectHeight:u.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){return t.x>=this.x&&t.x<=this.x+this.width&&t.y>=this.y&&t.y<=this.y+this.height}}class Eo extends ft{rx;ry;constructor(t){super(t),this.rx=t?.heartRx||10,this.ry=t?.heartRy||10}cloneShape(){return new Eo({...super.getBaseOptions(),heartRx:this.rx,heartRy:this.ry})}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 Po extends ft{rx;ry;constructor(t){super(t),this.rx=t?.heartRx??50,this.ry=t?.heartRy??50}cloneShape(){return new Po({...super.getBaseOptions(),heartRx:this.rx,heartRy:this.ry})}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 Mo extends ft{r;constructor(t){super(t),this.r=t?.starR||20}cloneShape(){return new Mo({...super.getBaseOptions(),starR:this.r})}toSVGPathData(){const t=[["m",0,-this.r]];for(let e=0;e<6;e+=1){const n=288+e*144,i=this.r*Math.cos(J(n)),r=this.r*Math.sin(J(n));t.push(["l",i,r])}return t}}class Ao extends ft{constructor(t){super(t)}cloneShape(){return new Ao({...super.getBaseOptions()})}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 ko extends ft{constructor(t){super(t)}cloneShape(){return new ko({...super.getBaseOptions()})}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 Io extends ft{constructor(t){super(t),this.d="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"}cloneShape(){return new Io({...super.getBaseOptions()})}}class Do extends Ut{constructor(t,e){super(t,e);const n=new ft({...e,drag:{...e?.drag,followSibling:!0},show:typeof t?.showFlame=="boolean"?t.showFlame:!1,d:[["M",-15,0],["L",-2.5,-5],["L",-2.5,5],["Z"]]});this.addShape(n);const i=new ft({...e,drag:{...e?.drag,followSibling:!0},d:[["M",10,0],["L",-10,10],["L",-5,0],["L",-10,-10],["L",10,0],["Z"]]});this.addShape(i)}cloneShapeCombo(){return new Do({...this.options,showFlame:this.showFlame},this.commonChildShapeOptions)}set showFlame(t){this.shapes[0].show=t}get showFlame(){return this.shapes[0].show}}class Ro extends Ut{width;height;cornerRadius;constructor(t,e){super(t,e),this.width=t.segmentWidth,this.height=t.segmentHeight,this.cornerRadius=typeof t.segmentCornerRadius=="number"?t.segmentCornerRadius:this.height*.5;const n=new We({...e,drag:{...e?.drag,followSibling:!0},x:0-this.cornerRadius,y:0-this.height*.5,rectWidth:this.width+this.cornerRadius*2,rectHeight:this.height,rectBorderRadius:this.cornerRadius});this.addShape(n);const i=new pn({...e,drag:{...e?.drag,followSibling:!0},x:0,y:0,ballRadius:2});this.addShape(i);const r=new pn({...e,drag:{...e?.drag,followSibling:!0},x:0+this.width,y:0,ballRadius:2});this.addShape(r)}cloneShapeCombo(){return new Ro({...this.options,segmentWidth:this.width,segmentHeight:this.height},this.commonChildShapeOptions)}getBoundingClientRectCenter(){return{x:0,y:0}}getPin(){const t=this.shapes[1];return{x:t.x+Math.cos(J(t.degree))*this.width,y:t.y+Math.sin(J(t.degree))*this.width}}}class Lo extends Ut{value$=new Mn;subscription;constructor(t,e){super(t,e);const n=t?.sliderMin||0,i=t?.sliderMax||100,r=t?.sliderStep||1,o=Zl(n,i,r),a=o(typeof t?.sliderDefaultValue=="number"?B(t.sliderDefaultValue,n,i):n);this.value$.next(a);const c=a/(i-n),h=t?.sliderWidth||100,u=t?.sliderHeight||4,l=u*.5,d=u*2.5,f=t?.sliderBackgroundColor||"#f5f5f5",p=t?.sliderForegroundColor||"#5a82f0",w=new We({...e,rectWidth:h,rectHeight:u,rectBorderRadius:l,attrs:{...e?.attrs,fill:f},drag:{...e?.drag,enable:!1}});this.addShape(w);const b=new We({...e,rectWidth:h*c,rectHeight:u,rectBorderRadius:l,attrs:{...e?.attrs,fill:p},drag:{...e?.drag,enable:!1}});this.addShape(b);const x=new pn({...e,x:h*c,y:l,ballRadius:d,attrs:{...e?.attrs,fill:p},drag:{...e?.drag,enable:!0,alongPath:new St([["m",0,0],["l",h,0]])}});this.addShape(x),this.subscription=x.transform$.subscribe(({dx:g})=>{b.width=B(b.width+(g||0),0,h),this.value$.next(o((x.x-w.x)/h*(i-n)+n))})}destroy(){super.destroy(),this.subscription.unsubscribe()}cloneShapeCombo(){return new Lo({...this.options},this.commonChildShapeOptions)}}async function Qy(s,t){return new Promise(e=>{new MutationObserver((i,r)=>{t(i,r),e(()=>{r.disconnect()})}).observe(s,{attributes:!0,childList:!0,subtree:!0})})}function Yu(s,t={attributes:!0,childList:!0,subtree:!0}){return new nt(e=>{const n=new MutationObserver(i=>{e.next(i)});return n.observe(s,t),()=>{n.disconnect()}})}async function Ky(s,t,e={threshold:.5}){return new Promise(n=>{new IntersectionObserver((r,o)=>{t(r,o),n(()=>{o.unobserve(s)})},e).observe(s)})}function Uu(s,t={threshold:.5}){return new nt(e=>{const n=new IntersectionObserver((i,r)=>{e.next(i)},t);return n.observe(s),()=>{n.unobserve(s),n.disconnect()}})}function tw(s,t){return mu().pipe(Se(null),rt(()=>{const{width:e,height:n}=t?.root?.getBoundingClientRect()||pu(),{top:i,left:r,right:o,bottom:a}=s.getBoundingClientRect();return(i>=0&&i<=n||a>=0&&a<=n)&&(r>=0&&r<=e||o>=0&&o<=e)}),_e())}function ew(s,t){const e=typeof t?.threshold=="number"?t.threshold:.5;return Uu(s,{threshold:e,root:t?.root}).pipe(rt(n=>{let i=n[0];if(n.length>1){const r=n.find(o=>o.isIntersecting);r&&(i=r)}return i.isIntersecting&&i.intersectionRatio>=e}),_e())}let Xu=!1;function nw(){Xu||(Xu=!0,gh(`
|
|
25
|
+
`):"",this.name="UnsubscriptionError",this.errors=e}});function An(s,t){if(s){var e=s.indexOf(t);0<=e&&s.splice(e,1)}}var un=function(){function s(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}return s.prototype.unsubscribe=function(){var t,e,n,i,r;if(!this.closed){this.closed=!0;var o=this._parentage;if(o)if(this._parentage=null,Array.isArray(o))try{for(var a=Be(o),h=a.next();!h.done;h=a.next()){var c=h.value;c.remove(this)}}catch(y){t={error:y}}finally{try{h&&!h.done&&(e=a.return)&&e.call(a)}finally{if(t)throw t.error}}else o.remove(this);var u=this.initialTeardown;if(j(u))try{u()}catch(y){r=y instanceof nr?y.errors:[y]}var l=this._finalizers;if(l){this._finalizers=null;try{for(var m=Be(l),f=m.next();!f.done;f=m.next()){var p=f.value;try{_h(p)}catch(y){r=r??[],y instanceof nr?r=Fe(Fe([],ve(r)),ve(y.errors)):r.push(y)}}}catch(y){n={error:y}}finally{try{f&&!f.done&&(i=m.return)&&i.call(m)}finally{if(n)throw n.error}}}if(r)throw new nr(r)}},s.prototype.add=function(t){var e;if(t&&t!==this)if(this.closed)_h(t);else{if(t instanceof s){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=(e=this._finalizers)!==null&&e!==void 0?e:[]).push(t)}},s.prototype._hasParent=function(t){var e=this._parentage;return e===t||Array.isArray(e)&&e.includes(t)},s.prototype._addParent=function(t){var e=this._parentage;this._parentage=Array.isArray(e)?(e.push(t),e):e?[e,t]:t},s.prototype._removeParent=function(t){var e=this._parentage;e===t?this._parentage=null:Array.isArray(e)&&An(e,t)},s.prototype.remove=function(t){var e=this._finalizers;e&&An(e,t),t instanceof s&&t._removeParent(this)},s.EMPTY=function(){var t=new s;return t.closed=!0,t}(),s}(),bh=un.EMPTY;function vh(s){return s instanceof un||s&&"closed"in s&&j(s.remove)&&j(s.add)&&j(s.unsubscribe)}function _h(s){j(s)?s():s.unsubscribe()}var Sh={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},sr={setTimeout:function(s,t){for(var e=[],n=2;n<arguments.length;n++)e[n-2]=arguments[n];var i=sr.delegate;return i?.setTimeout?i.setTimeout.apply(i,Fe([s,t],ve(e))):setTimeout.apply(void 0,Fe([s,t],ve(e)))},clearTimeout:function(s){var t=sr.delegate;return(t?.clearTimeout||clearTimeout)(s)},delegate:void 0};function Ch(s){sr.setTimeout(function(){throw s})}function kn(){}function Ps(s){s()}var ir=function(s){ue(t,s);function t(e){var n=s.call(this)||this;return n.isStopped=!1,e?(n.destination=e,vh(e)&&e.add(n)):n.destination=vm,n}return t.create=function(e,n,i){return new Ms(e,n,i)},t.prototype.next=function(e){this.isStopped||this._next(e)},t.prototype.error=function(e){this.isStopped||(this.isStopped=!0,this._error(e))},t.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,s.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(e){this.destination.next(e)},t.prototype._error=function(e){try{this.destination.error(e)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t}(un),wm=Function.prototype.bind;function rr(s,t){return wm.call(s,t)}var xm=function(){function s(t){this.partialObserver=t}return s.prototype.next=function(t){var e=this.partialObserver;if(e.next)try{e.next(t)}catch(n){As(n)}},s.prototype.error=function(t){var e=this.partialObserver;if(e.error)try{e.error(t)}catch(n){As(n)}else As(t)},s.prototype.complete=function(){var t=this.partialObserver;if(t.complete)try{t.complete()}catch(e){As(e)}},s}(),Ms=function(s){ue(t,s);function t(e,n,i){var r=s.call(this)||this,o;if(j(e)||!e)o={next:e??void 0,error:n??void 0,complete:i??void 0};else{var a;r&&Sh.useDeprecatedNextContext?(a=Object.create(e),a.unsubscribe=function(){return r.unsubscribe()},o={next:e.next&&rr(e.next,a),error:e.error&&rr(e.error,a),complete:e.complete&&rr(e.complete,a)}):o=e}return r.destination=new xm(o),r}return t}(ir);function As(s){Ch(s)}function bm(s){throw s}var vm={closed:!0,next:kn,error:bm,complete:kn},or=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function Ye(s){return s}function _m(s){return s.length===0?Ye:s.length===1?s[0]:function(e){return s.reduce(function(n,i){return i(n)},e)}}var et=function(){function s(t){t&&(this._subscribe=t)}return s.prototype.lift=function(t){var e=new s;return e.source=this,e.operator=t,e},s.prototype.subscribe=function(t,e,n){var i=this,r=Cm(t)?t:new Ms(t,e,n);return Ps(function(){var o=i,a=o.operator,h=o.source;r.add(a?a.call(r,h):h?i._subscribe(r):i._trySubscribe(r))}),r},s.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(e){t.error(e)}},s.prototype.forEach=function(t,e){var n=this;return e=Th(e),new e(function(i,r){var o=new Ms({next:function(a){try{t(a)}catch(h){r(h),o.unsubscribe()}},error:r,complete:i});n.subscribe(o)})},s.prototype._subscribe=function(t){var e;return(e=this.source)===null||e===void 0?void 0:e.subscribe(t)},s.prototype[or]=function(){return this},s.prototype.pipe=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return _m(t)(this)},s.prototype.toPromise=function(t){var e=this;return t=Th(t),new t(function(n,i){var r;e.subscribe(function(o){return r=o},function(o){return i(o)},function(){return n(r)})})},s.create=function(t){return new s(t)},s}();function Th(s){var t;return(t=s??Sh.Promise)!==null&&t!==void 0?t:Promise}function Sm(s){return s&&j(s.next)&&j(s.error)&&j(s.complete)}function Cm(s){return s&&s instanceof ir||Sm(s)&&vh(s)}function Tm(s){return j(s?.lift)}function Ot(s){return function(t){if(Tm(t))return t.lift(function(e){try{return s(e,this)}catch(n){this.error(n)}});throw new TypeError("Unable to lift unknown Observable type")}}function lt(s,t,e,n,i){return new Em(s,t,e,n,i)}var Em=function(s){ue(t,s);function t(e,n,i,r,o,a){var h=s.call(this,e)||this;return h.onFinalize=o,h.shouldUnsubscribe=a,h._next=n?function(c){try{n(c)}catch(u){e.error(u)}}:s.prototype._next,h._error=r?function(c){try{r(c)}catch(u){e.error(u)}finally{this.unsubscribe()}}:s.prototype._error,h._complete=i?function(){try{i()}catch(c){e.error(c)}finally{this.unsubscribe()}}:s.prototype._complete,h}return t.prototype.unsubscribe=function(){var e;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var n=this.closed;s.prototype.unsubscribe.call(this),!n&&((e=this.onFinalize)===null||e===void 0||e.call(this))}},t}(ir),Pm=er(function(s){return function(){s(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),ln=function(s){ue(t,s);function t(){var e=s.call(this)||this;return e.closed=!1,e.currentObservers=null,e.observers=[],e.isStopped=!1,e.hasError=!1,e.thrownError=null,e}return t.prototype.lift=function(e){var n=new Eh(this,this);return n.operator=e,n},t.prototype._throwIfClosed=function(){if(this.closed)throw new Pm},t.prototype.next=function(e){var n=this;Ps(function(){var i,r;if(n._throwIfClosed(),!n.isStopped){n.currentObservers||(n.currentObservers=Array.from(n.observers));try{for(var o=Be(n.currentObservers),a=o.next();!a.done;a=o.next()){var h=a.value;h.next(e)}}catch(c){i={error:c}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}}})},t.prototype.error=function(e){var n=this;Ps(function(){if(n._throwIfClosed(),!n.isStopped){n.hasError=n.isStopped=!0,n.thrownError=e;for(var i=n.observers;i.length;)i.shift().error(e)}})},t.prototype.complete=function(){var e=this;Ps(function(){if(e._throwIfClosed(),!e.isStopped){e.isStopped=!0;for(var n=e.observers;n.length;)n.shift().complete()}})},t.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(t.prototype,"observed",{get:function(){var e;return((e=this.observers)===null||e===void 0?void 0:e.length)>0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(e){return this._throwIfClosed(),s.prototype._trySubscribe.call(this,e)},t.prototype._subscribe=function(e){return this._throwIfClosed(),this._checkFinalizedStatuses(e),this._innerSubscribe(e)},t.prototype._innerSubscribe=function(e){var n=this,i=this,r=i.hasError,o=i.isStopped,a=i.observers;return r||o?bh:(this.currentObservers=null,a.push(e),new un(function(){n.currentObservers=null,An(a,e)}))},t.prototype._checkFinalizedStatuses=function(e){var n=this,i=n.hasError,r=n.thrownError,o=n.isStopped;i?e.error(r):o&&e.complete()},t.prototype.asObservable=function(){var e=new et;return e.source=this,e},t.create=function(e,n){return new Eh(e,n)},t}(et),Eh=function(s){ue(t,s);function t(e,n){var i=s.call(this)||this;return i.destination=e,i.source=n,i}return t.prototype.next=function(e){var n,i;(i=(n=this.destination)===null||n===void 0?void 0:n.next)===null||i===void 0||i.call(n,e)},t.prototype.error=function(e){var n,i;(i=(n=this.destination)===null||n===void 0?void 0:n.error)===null||i===void 0||i.call(n,e)},t.prototype.complete=function(){var e,n;(n=(e=this.destination)===null||e===void 0?void 0:e.complete)===null||n===void 0||n.call(e)},t.prototype._subscribe=function(e){var n,i;return(i=(n=this.source)===null||n===void 0?void 0:n.subscribe(e))!==null&&i!==void 0?i:bh},t}(ln),Mm=function(s){ue(t,s);function t(e){var n=s.call(this)||this;return n._value=e,n}return Object.defineProperty(t.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),t.prototype._subscribe=function(e){var n=s.prototype._subscribe.call(this,e);return!n.closed&&e.next(this._value),n},t.prototype.getValue=function(){var e=this,n=e.hasError,i=e.thrownError,r=e._value;if(n)throw i;return this._throwIfClosed(),r},t.prototype.next=function(e){s.prototype.next.call(this,this._value=e)},t}(ln),Ph={now:function(){return(Ph.delegate||Date).now()},delegate:void 0},Am=function(s){ue(t,s);function t(e,n){return s.call(this)||this}return t.prototype.schedule=function(e,n){return this},t}(un),ks={setInterval:function(s,t){for(var e=[],n=2;n<arguments.length;n++)e[n-2]=arguments[n];var i=ks.delegate;return i?.setInterval?i.setInterval.apply(i,Fe([s,t],ve(e))):setInterval.apply(void 0,Fe([s,t],ve(e)))},clearInterval:function(s){var t=ks.delegate;return(t?.clearInterval||clearInterval)(s)},delegate:void 0},km=function(s){ue(t,s);function t(e,n){var i=s.call(this,e,n)||this;return i.scheduler=e,i.work=n,i.pending=!1,i}return t.prototype.schedule=function(e,n){var i;if(n===void 0&&(n=0),this.closed)return this;this.state=e;var r=this.id,o=this.scheduler;return r!=null&&(this.id=this.recycleAsyncId(o,r,n)),this.pending=!0,this.delay=n,this.id=(i=this.id)!==null&&i!==void 0?i:this.requestAsyncId(o,this.id,n),this},t.prototype.requestAsyncId=function(e,n,i){return i===void 0&&(i=0),ks.setInterval(e.flush.bind(e,this),i)},t.prototype.recycleAsyncId=function(e,n,i){if(i===void 0&&(i=0),i!=null&&this.delay===i&&this.pending===!1)return n;n!=null&&ks.clearInterval(n)},t.prototype.execute=function(e,n){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var i=this._execute(e,n);if(i)return i;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},t.prototype._execute=function(e,n){var i=!1,r;try{this.work(e)}catch(o){i=!0,r=o||new Error("Scheduled action threw falsy error")}if(i)return this.unsubscribe(),r},t.prototype.unsubscribe=function(){if(!this.closed){var e=this,n=e.id,i=e.scheduler,r=i.actions;this.work=this.state=this.scheduler=null,this.pending=!1,An(r,this),n!=null&&(this.id=this.recycleAsyncId(i,n,null)),this.delay=null,s.prototype.unsubscribe.call(this)}},t}(Am),Mh=function(){function s(t,e){e===void 0&&(e=s.now),this.schedulerActionCtor=t,this.now=e}return s.prototype.schedule=function(t,e,n){return e===void 0&&(e=0),new this.schedulerActionCtor(this,t).schedule(n,e)},s.now=Ph.now,s}(),Im=function(s){ue(t,s);function t(e,n){n===void 0&&(n=Mh.now);var i=s.call(this,e,n)||this;return i.actions=[],i._active=!1,i}return t.prototype.flush=function(e){var n=this.actions;if(this._active){n.push(e);return}var i;this._active=!0;do if(i=e.execute(e.state,e.delay))break;while(e=n.shift());if(this._active=!1,i){for(;e=n.shift();)e.unsubscribe();throw i}},t}(Mh),ar=new Im(km),Dm=ar,Ah=new et(function(s){return s.complete()});function kh(s){return s&&j(s.schedule)}function hr(s){return s[s.length-1]}function Lm(s){return j(hr(s))?s.pop():void 0}function In(s){return kh(hr(s))?s.pop():void 0}function Rm(s,t){return typeof hr(s)=="number"?s.pop():t}var cr=function(s){return s&&typeof s.length=="number"&&typeof s!="function"};function Ih(s){return j(s?.then)}function Dh(s){return j(s[or])}function Lh(s){return Symbol.asyncIterator&&j(s?.[Symbol.asyncIterator])}function Rh(s){return new TypeError("You provided "+(s!==null&&typeof s=="object"?"an invalid object":"'"+s+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}function Om(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var Oh=Om();function zh(s){return j(s?.[Oh])}function Nh(s){return gm(this,arguments,function(){var e,n,i,r;return xh(this,function(o){switch(o.label){case 0:e=s.getReader(),o.label=1;case 1:o.trys.push([1,,9,10]),o.label=2;case 2:return[4,cn(e.read())];case 3:return n=o.sent(),i=n.value,r=n.done,r?[4,cn(void 0)]:[3,5];case 4:return[2,o.sent()];case 5:return[4,cn(i)];case 6:return[4,o.sent()];case 7:return o.sent(),[3,2];case 8:return[3,10];case 9:return e.releaseLock(),[7];case 10:return[2]}})})}function Bh(s){return j(s?.getReader)}function bt(s){if(s instanceof et)return s;if(s!=null){if(Dh(s))return zm(s);if(cr(s))return Nm(s);if(Ih(s))return Bm(s);if(Lh(s))return Fh(s);if(zh(s))return Fm(s);if(Bh(s))return Ym(s)}throw Rh(s)}function zm(s){return new et(function(t){var e=s[or]();if(j(e.subscribe))return e.subscribe(t);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function Nm(s){return new et(function(t){for(var e=0;e<s.length&&!t.closed;e++)t.next(s[e]);t.complete()})}function Bm(s){return new et(function(t){s.then(function(e){t.closed||(t.next(e),t.complete())},function(e){return t.error(e)}).then(null,Ch)})}function Fm(s){return new et(function(t){var e,n;try{for(var i=Be(s),r=i.next();!r.done;r=i.next()){var o=r.value;if(t.next(o),t.closed)return}}catch(a){e={error:a}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}t.complete()})}function Fh(s){return new et(function(t){Xm(s,t).catch(function(e){return t.error(e)})})}function Ym(s){return Fh(Nh(s))}function Xm(s,t){var e,n,i,r;return pm(this,void 0,void 0,function(){var o,a;return xh(this,function(h){switch(h.label){case 0:h.trys.push([0,5,6,11]),e=ym(s),h.label=1;case 1:return[4,e.next()];case 2:if(n=h.sent(),!!n.done)return[3,4];if(o=n.value,t.next(o),t.closed)return[2];h.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return a=h.sent(),i={error:a},[3,11];case 6:return h.trys.push([6,,9,10]),n&&!n.done&&(r=e.return)?[4,r.call(e)]:[3,8];case 7:h.sent(),h.label=8;case 8:return[3,10];case 9:if(i)throw i.error;return[7];case 10:return[7];case 11:return t.complete(),[2]}})})}function le(s,t,e,n,i){n===void 0&&(n=0),i===void 0&&(i=!1);var r=t.schedule(function(){e(),i?s.add(this.schedule(null,n)):this.unsubscribe()},n);if(s.add(r),!i)return r}function Yh(s,t){return t===void 0&&(t=0),Ot(function(e,n){e.subscribe(lt(n,function(i){return le(n,s,function(){return n.next(i)},t)},function(){return le(n,s,function(){return n.complete()},t)},function(i){return le(n,s,function(){return n.error(i)},t)}))})}function ur(s,t){return t===void 0&&(t=0),Ot(function(e,n){n.add(s.schedule(function(){return e.subscribe(n)},t))})}function Um(s,t){return bt(s).pipe(ur(t),Yh(t))}function $m(s,t){return bt(s).pipe(ur(t),Yh(t))}function Vm(s,t){return new et(function(e){var n=0;return t.schedule(function(){n===s.length?e.complete():(e.next(s[n++]),e.closed||this.schedule())})})}function Gm(s,t){return new et(function(e){var n;return le(e,t,function(){n=s[Oh](),le(e,t,function(){var i,r,o;try{i=n.next(),r=i.value,o=i.done}catch(a){e.error(a);return}o?e.complete():e.next(r)},0,!0)}),function(){return j(n?.return)&&n.return()}})}function Xh(s,t){if(!s)throw new Error("Iterable cannot be null");return new et(function(e){le(e,t,function(){var n=s[Symbol.asyncIterator]();le(e,t,function(){n.next().then(function(i){i.done?e.complete():e.next(i.value)})},0,!0)})})}function qm(s,t){return Xh(Nh(s),t)}function jm(s,t){if(s!=null){if(Dh(s))return Um(s,t);if(cr(s))return Vm(s,t);if(Ih(s))return $m(s,t);if(Lh(s))return Xh(s,t);if(zh(s))return Gm(s,t);if(Bh(s))return qm(s,t)}throw Rh(s)}function Dn(s,t){return t?jm(s,t):bt(s)}function Hm(){for(var s=[],t=0;t<arguments.length;t++)s[t]=arguments[t];var e=In(s);return Dn(s,e)}var Wm=er(function(s){return function(){s(this),this.name="EmptyError",this.message="no elements in sequence"}});function Jm(s,t){var e=typeof t=="object";return new Promise(function(n,i){var r=new Ms({next:function(o){n(o),r.unsubscribe()},error:i,complete:function(){e?n(t.defaultValue):i(new Wm)}});s.subscribe(r)})}function Zm(s){return s instanceof Date&&!isNaN(s)}function rt(s,t){return Ot(function(e,n){var i=0;e.subscribe(lt(n,function(r){n.next(s.call(t,r,i++))}))})}var Qm=Array.isArray;function Km(s,t){return Qm(t)?s.apply(void 0,Fe([],ve(t))):s(t)}function lr(s){return rt(function(t){return Km(s,t)})}var tp=Array.isArray,ep=Object.getPrototypeOf,np=Object.prototype,sp=Object.keys;function ip(s){if(s.length===1){var t=s[0];if(tp(t))return{args:t,keys:null};if(rp(t)){var e=sp(t);return{args:e.map(function(n){return t[n]}),keys:e}}}return{args:s,keys:null}}function rp(s){return s&&typeof s=="object"&&ep(s)===np}function op(s,t){return s.reduce(function(e,n,i){return e[n]=t[i],e},{})}function hp(){for(var s=[],t=0;t<arguments.length;t++)s[t]=arguments[t];var e=In(s),n=Lm(s),i=ip(s),r=i.args,o=i.keys;if(r.length===0)return Dn([],e);var a=new et(cp(r,e,o?function(h){return op(o,h)}:Ye));return n?a.pipe(lr(n)):a}function cp(s,t,e){return e===void 0&&(e=Ye),function(n){Uh(t,function(){for(var i=s.length,r=new Array(i),o=i,a=i,h=function(u){Uh(t,function(){var l=Dn(s[u],t),m=!1;l.subscribe(lt(n,function(f){r[u]=f,m||(m=!0,a--),a||n.next(e(r.slice()))},function(){--o||n.complete()}))},n)},c=0;c<i;c++)h(c)},n)}}function Uh(s,t,e){s?le(e,s,t):t()}function up(s,t,e,n,i,r,o,a){var h=[],c=0,u=0,l=!1,m=function(){l&&!h.length&&!c&&t.complete()},f=function(y){return c<n?p(y):h.push(y)},p=function(y){r&&t.next(y),c++;var v=!1;bt(e(y,u++)).subscribe(lt(t,function(w){i?.(w),r?f(w):t.next(w)},function(){v=!0},void 0,function(){if(v)try{c--;for(var w=function(){var _=h.shift();o?le(t,o,function(){return p(_)}):p(_)};h.length&&c<n;)w();m()}catch(_){t.error(_)}}))};return s.subscribe(lt(t,f,function(){l=!0,m()})),function(){a?.()}}function fr(s,t,e){return e===void 0&&(e=1/0),j(t)?fr(function(n,i){return rt(function(r,o){return t(n,r,i,o)})(bt(s(n,i)))},e):(typeof t=="number"&&(e=t),Ot(function(n,i){return up(n,i,s,e)}))}function $h(s){return s===void 0&&(s=1/0),fr(Ye,s)}function lp(){return $h(1)}function Vh(){for(var s=[],t=0;t<arguments.length;t++)s[t]=arguments[t];return lp()(Dn(s,In(s)))}var fp=["addListener","removeListener"],dp=["addEventListener","removeEventListener"],mp=["on","off"];function dr(s,t,e,n){if(j(e)&&(n=e,e=void 0),n)return dr(s,t,e).pipe(lr(n));var i=ve(yp(s)?dp.map(function(a){return function(h){return s[a](t,h,e)}}):pp(s)?fp.map(Gh(s,t)):gp(s)?mp.map(Gh(s,t)):[],2),r=i[0],o=i[1];if(!r&&cr(s))return fr(function(a){return dr(a,t,e)})(bt(s));if(!r)throw new TypeError("Invalid event target");return new et(function(a){var h=function(){for(var c=[],u=0;u<arguments.length;u++)c[u]=arguments[u];return a.next(1<c.length?c:c[0])};return r(h),function(){return o(h)}})}function Gh(s,t){return function(e){return function(n){return s[e](t,n)}}}function pp(s){return j(s.addListener)&&j(s.removeListener)}function gp(s){return j(s.on)&&j(s.off)}function yp(s){return j(s.addEventListener)&&j(s.removeEventListener)}function nt(s,t,e){return e?nt(s,t).pipe(lr(e)):new et(function(n){var i=function(){for(var o=[],a=0;a<arguments.length;a++)o[a]=arguments[a];return n.next(o.length===1?o[0]:o)},r=s(i);return j(t)?function(){return t(i,r)}:void 0})}function wp(s,t,e){s===void 0&&(s=0),e===void 0&&(e=Dm);var n=-1;return t!=null&&(kh(t)?e=t:n=t),new et(function(i){var r=Zm(s)?+s-e.now():s;r<0&&(r=0);var o=0;return e.schedule(function(){i.closed||(i.next(o++),0<=n?this.schedule(void 0,n):i.complete())},r)})}function xp(){for(var s=[],t=0;t<arguments.length;t++)s[t]=arguments[t];var e=In(s),n=Rm(s,1/0),i=s;return i.length?i.length===1?bt(i[0]):$h(n)(Dn(i,e)):Ah}var bp=Array.isArray;function vp(s){return s.length===1&&bp(s[0])?s[0]:s}function qh(s,t){return Ot(function(e,n){var i=0;e.subscribe(lt(n,function(r){return s.call(t,r,i++)&&n.next(r)}))})}function mr(){for(var s=[],t=0;t<arguments.length;t++)s[t]=arguments[t];return s=vp(s),s.length===1?bt(s[0]):new et(_p(s))}function _p(s){return function(t){for(var e=[],n=function(r){e.push(bt(s[r]).subscribe(lt(t,function(o){if(e){for(var a=0;a<e.length;a++)a!==r&&e[a].unsubscribe();e=null}t.next(o)})))},i=0;e&&!t.closed&&i<s.length;i++)n(i)}}function _e(s,t){return t===void 0&&(t=Ye),s=s??Sp,Ot(function(e,n){var i,r=!0;e.subscribe(lt(n,function(o){var a=t(o);(r||!s(i,a))&&(r=!1,i=a,n.next(o))}))})}function Sp(s,t){return s===t}function jh(s,t){return t?function(e){return e.pipe(jh(function(n,i){return bt(s(n,i)).pipe(rt(function(r,o){return t(n,r,i,o)}))}))}:Ot(function(e,n){var i=0,r=null,o=!1;e.subscribe(lt(n,function(a){r||(r=lt(n,void 0,function(){r=null,o&&n.complete()}),bt(s(a,i++)).subscribe(r))},function(){o=!0,!r&&n.complete()}))})}function Se(){for(var s=[],t=0;t<arguments.length;t++)s[t]=arguments[t];var e=In(s);return Ot(function(n,i){(e?Vh(s,n,e):Vh(s,n)).subscribe(i)})}function Is(s,t){return Ot(function(e,n){var i=null,r=0,o=!1,a=function(){return o&&!i&&n.complete()};e.subscribe(lt(n,function(h){i?.unsubscribe();var c=0,u=r++;bt(s(h,u)).subscribe(i=lt(n,function(l){return n.next(t?t(h,l,u,c++):l)},function(){i=null,a()}))},function(){o=!0,a()}))})}function Cp(){return Is(Ye)}function pr(s){return Ot(function(t,e){bt(s).subscribe(lt(e,function(){return e.complete()},kn)),!e.closed&&t.subscribe(e)})}function Xe(s,t,e){var n=j(s)||t||e?{next:s,error:t,complete:e}:s;return n?Ot(function(i,r){var o;(o=n.subscribe)===null||o===void 0||o.call(n);var a=!0;i.subscribe(lt(r,function(h){var c;(c=n.next)===null||c===void 0||c.call(n,h),r.next(h)},function(){var h;a=!1,(h=n.complete)===null||h===void 0||h.call(n),r.complete()},function(h){var c;a=!1,(c=n.error)===null||c===void 0||c.call(n,h),r.error(h)},function(){var h,c;a&&((h=n.unsubscribe)===null||h===void 0||h.call(n)),(c=n.finalize)===null||c===void 0||c.call(n)}))}):Ye}function Tp(s,t){return Ot(function(e,n){var i=t??{},r=i.leading,o=r===void 0?!0:r,a=i.trailing,h=a===void 0?!1:a,c=!1,u=null,l=null,m=!1,f=function(){l?.unsubscribe(),l=null,h&&(v(),m&&n.complete())},p=function(){l=null,m&&n.complete()},y=function(w){return l=bt(s(w)).subscribe(lt(n,f,p))},v=function(){if(c){c=!1;var w=u;u=null,n.next(w),!m&&y(w)}};e.subscribe(lt(n,function(w){c=!0,u=w,!(l&&!l.closed)&&(o?v():y(w))},function(){m=!0,!(h&&c&&l&&!l.closed)&&n.complete()}))})}function Ep(s,t,e){t===void 0&&(t=ar);var n=wp(s,t);return Tp(function(){return n},e)}function Pp(s,t){return Ot(function(e,n){var i=[],r=function(o){for(;0<i.length;)i.shift().error(o);n.error(o)};bt(s).subscribe(lt(n,function(o){var a=new ln;i.push(a);var h=new un,c=function(){An(i,a),a.complete(),h.unsubscribe()},u;try{u=bt(t(o))}catch(l){r(l);return}n.next(a.asObservable()),h.add(u.subscribe(lt(n,c,kn,r)))},kn)),e.subscribe(lt(n,function(o){var a,h,c=i.slice();try{for(var u=Be(c),l=u.next();!l.done;l=u.next()){var m=l.value;m.next(o)}}catch(f){a={error:f}}finally{try{l&&!l.done&&(h=u.return)&&h.call(u)}finally{if(a)throw a.error}}},function(){for(;0<i.length;)i.shift().complete();n.complete()},r,function(){for(;0<i.length;)i.shift().unsubscribe()}))})}function W(s,t,e,n=!1){const i=async r=>{await e(r)};try{s.addEventListener(t,i,n)}catch{s.attachEvent("on"+t,i)}return()=>{try{s.removeEventListener(t,i,n)}catch{s.detachEvent("on"+t,i)}}}function U(s,t,e=!1){return dr(s,t,{capture:e})}function Ce(s){if(s.preventDefault){s.preventDefault();return}try{s.returnValue=!1}catch{}}function Hh(s){if(s.stopPropagation){s.stopPropagation();return}try{s.cancelBubble=!0}catch{}}const Mp=["click","dblclick","wheel","contextmenu","mousedown","mouseup","mousemove","mouseover","mouseout","mouseenter","mouseleave"],Ap=["keydown","keyup","keypress"],kp=["touchstart","touchend","touchcancel","touchmove"],Ip=["pointerdown","pointerup","pointercancel","pointermove"],Dp=["dragstart","drag","dragend","dragenter","dragover","dragleave","drop"],Lp=["change"];function Rp(s,t,e={bubbles:!0,detail:{}}){if(!s)return;let n;try{Mp.includes(t)?n=new MouseEvent(t,e):Ap.includes(t)?n=new KeyboardEvent(t,e):kp.includes(t)?n=new TouchEvent(t,e):Ip.includes(t)?n=new PointerEvent(t,e):Dp.includes(t)?n=new DragEvent(t,e):Lp.includes(t)?n=new Event(t,e):n=new CustomEvent(t,e)}catch{document.createEvent?n=document.createEvent("HTMLEvents").initEvent(t,!0,!0):document.createEventObject&&(n=document.createEventObject())}if(s.dispatchEvent)s.dispatchEvent(n);else if(s.fireEvent&&document.createEventObject)s.fireEvent("on"+t,n);else throw new Error(`Can't fire event : ${t}`)}function Op(s,t){const e=s.changedTouches[0];return new MouseEvent(t,{bubbles:!0,cancelable:!0,view:window,detail:1,screenX:e.screenX,screenY:e.screenY,clientX:e.clientX,clientY:e.clientY,ctrlKey:!1,altKey:!1,shiftKey:!1,metaKey:!1,button:0,relatedTarget:null})}function zp(s,t){let e=document.createElement(s);t="on"+t;let n=t in e;return n||(e.setAttribute(t,"return;"),n=typeof e[t]=="function"),e=null,n}(function(){if(!window.requestAnimationFrame){let s=ut();window.requestAnimationFrame=function(t){const e=ut(),n=Math.max(0,16-(e-s)),i=window.setTimeout(function(){t(e+n)},n);return s=e+n,i}}window.cancelAnimationFrame||(window.cancelAnimationFrame=function(s){clearTimeout(s)})})();function gr(s){let t=!1;return window.requestAnimationFrame(function e(n){!t&&s(n)&&window.requestAnimationFrame(e)}),()=>{t=!0}}function yr(s,t=0){if(t==0)return s(ut()),()=>{};{const e=ut();return gr(n=>n-e>=t?(s(n),!1):!0)}}function Np(s,t=0){let e=!1,n=0;const i=ut(),r=o=>{if(e)return;n++;const a=o-i-n*t;s(o,n,t<=a),yr(r,Math.max(0,t-a))};return yr(r,t),()=>{e=!0}}function Bp(s,t=20){const e=1e3/t;let n=0,i;return()=>(ut()-n>=e&&(n=ut(),i=s()),i)}window.requestIdleCallback=window.requestIdleCallback||function(s,t){const e=ut();return setTimeout(()=>{const n=ut()-e;s({didTimeout:!0,timeRemaining:()=>Math.max(0,50-n)})},t?.timeout)},window.cancelIdleCallback=window.cancelIdleCallback||function(s){clearTimeout(s)};function Wh(s,t){window.requestIdleCallback(e=>{e.timeRemaining()>0||e.didTimeout?s():Wh(s,t)},{timeout:t?.timeout})}let Ds=0,wr=0,Ue=33,Te=33,xr,br=-1;const Jh=new MessageChannel,Fp=Jh.port2;Jh.port1.onmessage=s=>{xr&&xr({didTimeout:br==-1?!1:ut()-Ds>br,timeRemaining:()=>Math.max(0,wr-ut())})};function Yp(s,t){return xr=s,br=typeof t?.timeout=="number"?t?.timeout:-1,requestAnimationFrame(e=>{Ds=e;let n=Te+Ds-wr;n<Te&&Ue<Te?(n<8&&(n=8),Te=n<Ue?Ue:n):n>Te&&Ue>Te?Te=n<Ue?Ue:n:Ue=n,wr=Ds+Te,Fp.postMessage(null)})}const Zh=new Lf({concurrency:1,timeRemaining:0});let vr=!1;function Qh(s,t){const e=If({fn:s,name:t?.name,deadline:typeof t?.timeout=="number"?se()+t.timeout:void 0});Zh.addTask(e),!vr&&(vr=!0,Yp(n=>{vr=!1,Zh.idleCallback(n)}))}class Ln{static _nextId=0;static nextId(){return Ln._nextId++}}const O={Linear:{None:function(s){return s}},Ease:{In:function(s){return Math.pow(s,1.7)}},Quadratic:{In:function(s){return s*s},Out:function(s){return s*(2-s)},InOut:function(s){return(s*=2)<1?.5*s*s:-.5*(--s*(s-2)-1)}},Cubic:{In:function(s){return s*s*s},Out:function(s){return--s*s*s+1},InOut:function(s){return(s*=2)<1?.5*s*s*s:.5*((s-=2)*s*s+2)}},Quartic:{In:function(s){return s*s*s*s},Out:function(s){return 1- --s*s*s*s},InOut:function(s){return(s*=2)<1?.5*s*s*s*s:-.5*((s-=2)*s*s*s-2)}},Quintic:{In:function(s){return s*s*s*s*s},Out:function(s){return--s*s*s*s*s+1},InOut:function(s){return(s*=2)<1?.5*s*s*s*s*s:.5*((s-=2)*s*s*s*s+2)}},Sinusoidal:{In:function(s){return 1-Math.sin((1-s)*Math.PI/2)},Out:function(s){return Math.sin(s*Math.PI/2)},InOut:function(s){return .5*(1-Math.sin(Math.PI*(.5-s)))}},Exponential:{In:function(s){return s===0?0:Math.pow(1024,s-1)},Out:function(s){return s===1?1:1-Math.pow(2,-10*s)},InOut:function(s){return s===0?0:s===1?1:(s*=2)<1?.5*Math.pow(1024,s-1):.5*(-Math.pow(2,-10*(s-1))+2)}},Circular:{In:function(s){return 1-Math.sqrt(1-s*s)},Out:function(s){return Math.sqrt(1- --s*s)},InOut:function(s){return(s*=2)<1?-.5*(Math.sqrt(1-s*s)-1):.5*(Math.sqrt(1-(s-=2)*s)+1)}},Elastic:{In:function(s){return s===0?0:s===1?1:-Math.pow(2,10*(s-1))*Math.sin((s-1.1)*5*Math.PI)},Out:function(s){return s===0?0:s===1?1:Math.pow(2,-10*s)*Math.sin((s-.1)*5*Math.PI)+1},InOut:function(s){return s===0?0:s===1?1:(s*=2,s<1?-.5*Math.pow(2,10*(s-1))*Math.sin((s-1.1)*5*Math.PI):.5*Math.pow(2,-10*(s-1))*Math.sin((s-1.1)*5*Math.PI)+1)}},Back:{In:function(s){return s===1?1:s*s*((1.70158+1)*s-1.70158)},Out:function(s){return s===0?0:--s*s*((1.70158+1)*s+1.70158)+1},InOut:function(s){const t=2.5949095;return(s*=2)<1?.5*(s*s*((t+1)*s-t)):.5*((s-=2)*s*((t+1)*s+t)+2)}},Bounce:{In:function(s){return 1-O.Bounce.Out(1-s)},Out:function(s){return s<1/2.75?7.5625*s*s:s<2/2.75?7.5625*(s-=1.5/2.75)*s+.75:s<2.5/2.75?7.5625*(s-=2.25/2.75)*s+.9375:7.5625*(s-=2.625/2.75)*s+.984375},InOut:function(s){return s<.5?O.Bounce.In(s*2)*.5:O.Bounce.Out(s*2-1)*.5+.5}},generatePow:function(s=4){return s=s<Number.EPSILON?Number.EPSILON:s,s=s>1e4?1e4:s,{In:function(t){return t**s},Out:function(t){return 1-(1-t)**s},InOut:function(t){return t<.5?(t*2)**s/2:(1-(2-t*2)**s)/2+.5}}},random:function(s){return Math.random()},createStep:function(s){return function(t){return Math.floor(t*s)/s}},createNoisyEasing:function(s,t=.1){const e=1-t;return function(n){return t*Math.random()+e*s(n)}},swing:function(s){return s+Math.sin(s*Math.PI*2)/2},causeSeizures:function(s){return s+.2*Math.random()-.1}};function Kh(s){switch(s){case O.Quadratic.In:return O.Quadratic.Out;case O.Quadratic.Out:return O.Quadratic.In;case O.Quadratic.InOut:return O.Quadratic.InOut;case O.Cubic.In:return O.Cubic.Out;case O.Cubic.Out:return O.Cubic.In;case O.Cubic.InOut:return O.Cubic.InOut;case O.Quartic.In:return O.Quartic.Out;case O.Quartic.Out:return O.Quartic.In;case O.Quartic.InOut:return O.Quartic.InOut;case O.Quintic.In:return O.Quintic.Out;case O.Quintic.Out:return O.Quintic.In;case O.Quintic.InOut:return O.Quintic.InOut;case O.Sinusoidal.In:return O.Sinusoidal.Out;case O.Sinusoidal.Out:return O.Sinusoidal.In;case O.Sinusoidal.InOut:return O.Sinusoidal.InOut;case O.Exponential.In:return O.Exponential.Out;case O.Exponential.Out:return O.Exponential.In;case O.Exponential.InOut:return O.Exponential.InOut;case O.Circular.In:return O.Circular.Out;case O.Circular.Out:return O.Circular.In;case O.Circular.InOut:return O.Circular.InOut;case O.Elastic.In:return O.Elastic.Out;case O.Elastic.Out:return O.Elastic.In;case O.Elastic.InOut:return O.Elastic.InOut;case O.Back.In:return O.Back.Out;case O.Back.Out:return O.Back.In;case O.Back.InOut:return O.Back.InOut;case O.Bounce.In:return O.Bounce.Out;case O.Bounce.Out:return O.Bounce.In;case O.Bounce.InOut:return O.Bounce.InOut;default:return s}}const Xp=4,Up=.001,$p=1e-7,Vp=10,Rn=11,Ls=1/(Rn-1),Gp=typeof Float32Array=="function";function tc(s,t){return 1-3*t+3*s}function ec(s,t){return 3*t-6*s}function nc(s){return 3*s}function Rs(s,t,e){return((tc(t,e)*s+ec(t,e))*s+nc(t))*s}function sc(s,t,e){return 3*tc(t,e)*s*s+2*ec(t,e)*s+nc(t)}function qp(s,t,e,n,i){let r,o,a=0;do o=t+(e-t)/2,r=Rs(o,n,i)-s,r>0?e=o:t=o;while(Math.abs(r)>$p&&++a<Vp);return o}function jp(s,t,e,n){for(let i=0;i<Xp;++i){const r=sc(t,e,n);if(r===0)return t;const o=Rs(t,e,n)-s;t-=o/r}return t}function Hp(s){return s}function _r(s,t,e,n){if(!(0<=s&&s<=1&&0<=e&&e<=1))throw new Error("bezier x values must be in [0, 1] range");if(s===t&&e===n)return Hp;const i=Gp?new Float32Array(Rn):new Array(Rn);for(let o=0;o<Rn;++o)i[o]=Rs(o*Ls,s,e);function r(o){let a=0,h=1;const c=Rn-1;for(;h!==c&&i[h]<=o;++h)a+=Ls;--h;const u=(o-i[h])/(i[h+1]-i[h]),l=a+u*Ls,m=sc(l,s,e);return m>=Up?jp(o,l,s,e):m===0?l:qp(o,a,a+Ls,s,e)}return o=>o===0||o===1?o:Rs(r(o),t,n)}function Sr(s){switch(s){case"linear":return[0,0,1,1];case"ease":return[.25,.1,.25,1];case"ease-in":return[.42,0,1,1];case"ease-in-out":return[.42,0,.58,1];case"ease-out":return[0,0,.58,1]}}function ic(s){const[t,e,n,i]=Sr(s);return[1-n,1-i,1-t,1-e]}function Wp(s){return _r(...Sr(s))}function Jp(s){return _r(...ic(s))}const fe={Utils:{Linear:function(s,t,e){return(t-s)*e+s},Factorial:function(){const s=[1];return function(t){let e=1;if(s[t])return s[t];for(let n=t;n>1;n--)e*=n;return s[t]=e,e}}(),Bernstein:function(s,t){const e=fe.Utils.Factorial;return e(s)/e(t)/e(s-t)},CatmullRom:function(s,t,e,n,i){const r=(e-s)*.5,o=(n-t)*.5,a=i*i,h=i*a;return(2*t-2*e+r+o)*h+(-3*t+3*e-2*r-o)*a+r*i+t},QuadraticBezier:(s,t,e,n)=>{const i=1-n;return i*i*s+2*i*n*t+n*n*e},CubicBezier:(s,t,e,n,i)=>{const r=1-i;return r*r*r*s+3*r*r*i*t+3*r*i*i*e+i*i*i*n}},Linear:function(s,t){const e=s.length-1,n=e*t,i=Math.floor(n),r=fe.Utils.Linear;return t<0?r(s[0],s[1],n):t>1?r(s[e],s[e-1],e-n):r(s[i],s[i+1>e?e:i+1],n-i)},Bezier:function(s,t){let e=0;const n=s.length-1,i=Math.pow,r=fe.Utils.Bernstein;for(let o=0;o<=n;o++)e+=i(1-t,n-o)*i(t,o)*s[o]*r(n,o);return e},CatmullRom:function(s,t){const e=s.length-1;let n=e*t,i=Math.floor(n);const r=fe.Utils.CatmullRom;return s[0]===s[e]?(t<0&&(i=Math.floor(n=e*(1+t))),r(s[(i-1+e)%e],s[i],s[(i+1)%e],s[(i+2)%e],n-i)):t<0?s[0]-(r(s[0],s[0],s[1],s[1],-n)-s[0]):t>1?s[e]-(r(s[e],s[e],s[e-1],s[e-1],n-e)-s[e]):r(s[i?i-1:0],s[i],s[e<i+1?e:i+1],s[e<i+2?e:i+2],n-i)}};class rc{_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=ut(),e=!1){const n=Object.keys(this._tweens);for(let i=0;i<n.length;i++){const r=this._tweens[n[i]],o=!e;r&&r.update(t,o)===!1&&!e&&delete this._tweens[n[i]]}return!!Object.keys(this._tweens).length}}const Ut=new rc;class Cr{constructor(t,e=Ut){this._object=t,this._group=e}_id=Ln.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=O.Linear.None;_interpolationFunction=fe.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=ut()){if(this._isPlaying)return this;if(this._group&&this._group.add(this),this._repeat=this._initialRepeat,this._reversed){this._reversed=!1;for(const e in this._valuesStartRepeat)this._swapEndStartRepeatValues(e),this._valuesStart[e]=this._valuesStartRepeat[e]}return this._isPlaying=!0,this._isPaused=!1,this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._isChainStopped=!1,this._startTime=t,this._startTime+=this._delayTime,this._setupProperties(this._object,this._valuesStart,this._valuesEnd,this._valuesStartRepeat),this}_setupProperties(t,e,n,i){for(const r in n){const o=t[r],a=Array.isArray(o),h=a?"array":typeof o,c=!a&&Array.isArray(n[r]);if(!(h==="undefined"||h==="function")){if(c){let u=n[r];if(u.length===0)continue;u=u.map(this._handleRelativeValue.bind(this,o)),n[r]=[o].concat(u)}if((h==="object"||a)&&o&&!c){e[r]=a?[]:{};for(const u in o)e[r][u]=o[u];i[r]=a?[]:{},this._setupProperties(o,e[r],n[r],i[r])}else typeof e[r]>"u"&&(e[r]=o),a||(e[r]*=1),c?i[r]=n[r].slice().reverse():i[r]=e[r]||0}}}stop(){return this._isChainStopped||(this._isChainStopped=!0,this.stopChainedTweens()),this._isPlaying?(this._group&&this._group.remove(this),this._isPlaying=!1,this._isPaused=!1,this._onStopCallback&&this._onStopCallback(this._object),this):this}end(){return this._goToEnd=!0,this.update(1/0),this}pause(t=ut()){return this._isPaused||!this._isPlaying?this:(this._isPaused=!0,this._pauseStartTime=t,this._group&&this._group.remove(this),this)}resume(t=ut()){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=Ut){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=O.Linear.None){return this._easingFunction=t,this}interpolation(t=fe.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=ut(),e=!0){if(this._isPaused)return!0;let n,i;const r=this._startTime+this._durationTime;if(!this._goToEnd&&!this._isPlaying){if(t>r)return!1;e&&this.start(t)}if(this._goToEnd=!1,t<this._startTime)return!0;this._onStartCallbackFired===!1&&(this._onStartCallback&&this._onStartCallback(this._object),this._onStartCallbackFired=!0),this._onEveryStartCallbackFired===!1&&(this._onEveryStartCallback&&this._onEveryStartCallback(this._object),this._onEveryStartCallbackFired=!0),i=(t-this._startTime)/this._durationTime,i=this._durationTime===0||i>1?1:i;const o=this._easingFunction(i);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,o),this._onUpdateCallback&&this._onUpdateCallback(this._object,i),i===1)if(this._repeat>0){isFinite(this._repeat)&&this._repeat--;for(n in this._valuesStartRepeat)!this._yoyo&&typeof this._valuesEnd[n]=="string"&&(this._valuesStartRepeat[n]=this._valuesStartRepeat[n]+parseFloat(this._valuesEnd[n])),this._yoyo&&this._swapEndStartRepeatValues(n),this._valuesStart[n]=this._valuesStartRepeat[n];return this._yoyo&&(this._reversed=!this._reversed),this._repeatDelayTime!==void 0?this._startTime=t+this._repeatDelayTime:this._startTime=t+this._delayTime,this._onRepeatCallback&&this._onRepeatCallback(this._object),this._onEveryStartCallbackFired=!1,!0}else{this._onCompleteCallback&&this._onCompleteCallback(this._object);for(let a=0,h=this._chainedTweens.length;a<h;a++)this._chainedTweens[a].start(this._startTime+this._durationTime);return this._isPlaying=!1,!1}return!0}_updateProperties(t,e,n,i){for(const r in n){if(e[r]===void 0)continue;const o=e[r]||0;let a=n[r];const h=Array.isArray(t[r]),c=Array.isArray(a);!h&&c?t[r]=this._interpolationFunction(a,i):typeof a=="object"&&a?this._updateProperties(t[r],o,a,i):(a=this._handleRelativeValue(o,a),typeof a=="number"&&(t[r]=o+(a-o)*i))}}_handleRelativeValue(t,e){return typeof e!="string"?e:e.charAt(0)==="+"||e.charAt(0)==="-"?t+parseFloat(e):parseFloat(e)}_swapEndStartRepeatValues(t){const e=this._valuesStartRepeat[t],n=this._valuesEnd[t];typeof n=="string"?this._valuesStartRepeat[t]=this._valuesStartRepeat[t]+parseFloat(n):this._valuesStartRepeat[t]=n,this._valuesEnd[t]=e}}const Zp=Ln.nextId,Qp=Ut.getAll.bind(Ut),Kp=Ut.removeAll.bind(Ut),tg=Ut.add.bind(Ut),eg=Ut.remove.bind(Ut),ng=Ut.update.bind(Ut),sg={now:ut,Sequence:Ln,Easing:O,Interpolation:fe,Group:rc,Tween:Cr,nextId:Zp,getAll:Qp,removeAll:Kp,add:tg,remove:eg,update:ng};class Tr{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=ut(),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=ut();t=e-this.oldTime,this.oldTime=e,this.elapsedTime+=t}return t}}class On{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){Pl(this.tweens,(e,n)=>t?e.delay>n.delay:e.delay<=n.delay)}cloneTweens(t=this.tweens){const e=[];return t.forEach(n=>{const i={...n};delete i.tween,i.fromValues={...i.fromValues},i.toValues={...i.toValues},e.push(i)}),e}addTween(t,e,n){const i={fromValues:t,toValues:e,frames:typeof n?.frames=="number"?n.frames:1,delay:typeof n?.delay=="number"?n.delay:this.tweens.length,easeFunction:n?.easeFunction||O.Linear.None,interpolationFunction:n?.interpolationFunction||fe.Linear,repeat:typeof n?.repeat=="number"?n.repeat:0,yoyo:n?.yoyo||!1,onStart:n?.onStart||(()=>{}),onUpdate:n?.onUpdate||(()=>{}),onComplete:n?.onComplete||(()=>{})};return this.tweens.push(i),this}cancelRequestAnimationCycle=()=>{};runTweens(t){this.cancelRequestAnimationCycle();const e=new Tr,n=this.frameDuration;return new Promise(i=>{this.onGroupStart?.(),this.cancelRequestAnimationCycle=gr(r=>{if(!this.isPaused){const a=Math.max(0,r-this.pausedDuration),h=Math.max(0,e.getElapsedTime()-this.pausedDuration);t.filter(c=>c.delay*n<=h).forEach(c=>{c.tween||(c.tween=new Cr({...c.fromValues}).to({...c.toValues},c.frames*n).easing(c.easeFunction).interpolation(c.interpolationFunction).repeat(c.repeat).yoyo(c.yoyo).onStart(c.onStart).onUpdate(c.onUpdate).onComplete(c.onComplete),c.tween.start(a)),(c.delay+c.frames*(c.repeat+1))*n>h?c.tween.update(a):(c.tween.isPlaying()&&c.tween.end(),Oe(t,c))})}const o=!!t.length;return o||(this.onGroupComplete?.(),i()),o})})}isPaused=!1;pausedClock=new Tr;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(n=>{e=Math.max(e,n.delay+n.frames),n.easeFunction=Kh(n.easeFunction);const i={...n.toValues};n.toValues={...n.fromValues},n.fromValues={...i}}),t.forEach(n=>{n.delay=e-n.frames}),this.play(t)}pause(){this.pausedClock.start(),this.isPaused=!0}resume(){this.pausedDuration+=this.pausedClock.getElapsedTime(),this.pausedClock.stop(),this.isPaused=!1}}const Os=new rn;function Er(s){const t=Os.getEntry((n,i)=>i.el==s);if(t)return t[1];const e=Qs(s);return Os.set(e.name,e),e}function Pr(s,t){const e=Er(s);e.alternate||(e.alternate=Qs(s)),t(e.alternate)}const oc=()=>{Os.update((s,t)=>{const e=t.alternate;return e?(Ks(t,e),t.alternate=void 0,Os.set(e.name,e),!1):!0})};function ig(){oc()}function Mr(){Qh(oc,{name:"FLUSH_VNODES",timeout:50})}function q(s){return s*Math.PI/180}function Et(s){return s*180/Math.PI}function fn(s,t,e=0){return Math.sqrt(s*s+t*t+e*e)}function Ee(s,t,e,n){return fn(e-s,n-t)}function Jt(s,t,e,n){let i=Math.atan2(n-t,e-s);return i<0&&(i+=Math.PI*2),i}function Pe(s,t){return{dx:Math.cos(s)*t,dy:Math.sin(s)*t}}function rg(s,t,e){if(typeof e=="number"){const n=fn(s,t,e);return{x:s/=n,y:t/=n,z:e/=n}}else{const n=fn(s,t);return{x:s/=n,y:t/=n}}}function og(s,t,e,n,i=10){if(Math.abs(e-s)<i&&Math.abs(n-t)<i)return"no";const r=Et(Jt(s,t,e,n));return r>=-135&&r<=-45?"up":r>45&&r<135?"down":r>=135&&r<=180||r>=-180&&r<-135?"left":"right"}const ac=ag("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 ag(s,t=10){const e={},n=s.split(",");for(let i=0;i<n.length;i+=2){const r="&"+n[i+1]+";",o=parseInt(n[i],t);e[r]="&#"+o+";"}return e["\\xa0"]=" ",e}function Pt(s,t){const e=Object.keys(t);for(let n=0;n<e.length;n++)s=s.replace(new RegExp("{"+e[n]+"}","gi"),""+t[e[n]]);return s}function zs(s){let t,e;if(!s)throw new Error("cannot create a random attribute name for an undefined object");const n="ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz";t="";do for(t="",e=0;e<12;e++)t+=n[Math.floor(Math.random()*n.length)];while(s[t]);return t}function hg(s){const t={left:"start",right:"end",center:"middle",start:"start",end:"end"};return t[s]||t.start}function cg(s){const t={alphabetic:"alphabetic",hanging:"hanging",top:"text-before-edge",bottom:"text-after-edge",middle:"central"};return t[s]||t.alphabetic}const zn={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"}};let Ns=class{__root;__ctx;constructor(t,e){this.__root=t,this.__ctx=e}addColorStop(t,e){const n=this.__ctx.__createElement("stop");if(n.setAttribute("offset",""+t),e.indexOf("rgba")!==-1){const r=/rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d?\.?\d*)\s*\)/gi.exec(e);r&&(n.setAttribute("stop-color",Pt("rgb({r},{g},{b})",{r:r[1],g:r[2],b:r[3]})),n.setAttribute("stop-opacity",r[4]))}else n.setAttribute("stop-color",e);this.__root.appendChild(n)}},Ar=class{__root;__ctx;constructor(t,e){this.__root=t,this.__ctx=e}},hc=class ia{__document=document;__canvas;__ctx;width;height;__styleStack;__groupStack;__rootSVG;__ids;__SVGdefs;__currentElement;__currentElementsToStyle=null;constructor({canvas:t,width:e=500,height:n=500}){t?(this.__canvas=t,this.__ctx=t.getContext("2d"),this.width=t.width,this.height=t.height):(this.__canvas=this.__document.createElement("canvas"),this.__ctx=this.__canvas.getContext("2d"),this.width=e,this.height=n),this.__setDefaultStyles(),this.__styleStack=[this.__getStyleState()],this.__groupStack=[],this.__rootSVG=this.__document.createElementNS("http://www.w3.org/2000/svg","svg"),this.__rootSVG.setAttribute("version","1.1"),this.__rootSVG.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.__rootSVG.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink","http://www.w3.org/1999/xlink"),this.__rootSVG.setAttribute("width",""+this.width),this.__rootSVG.setAttribute("height",""+this.height),this.__ids={},this.__SVGdefs=this.__document.createElementNS("http://www.w3.org/2000/svg","defs"),this.__rootSVG.appendChild(this.__SVGdefs),this.__currentElement=this.__document.createElementNS("http://www.w3.org/2000/svg","g"),this.__rootSVG.appendChild(this.__currentElement)}__setDefaultStyles(){const t=Object.keys(zn);for(let e=0,n=t.length;e<n;e++){const i=t[e];this[i]=zn[i].canvas}}__getStyleState(){const t={},e=Object.keys(zn);for(let n=0,i=e.length;n<i;n++){const r=e[n];t[r]=this[r]}return t}__applyStyleState(t){const e=Object.keys(t);for(let n=0,i=e.length;n<i;n++){const r=e[n];this[r]=t[r]}}__createElement(t,e={},n=!1){const i=this.__document.createElementNS("http://www.w3.org/2000/svg",t),r=Object.keys(e);n&&(i.setAttribute("fill","none"),i.setAttribute("stroke","none"));for(let o=0;o<r.length;o++){const a=r[o];i.setAttribute(a,e[a])}return i}__applyStyleToCurrentElement(t){let e=this.__currentElement;const n=this.__currentElementsToStyle;n&&(e.setAttribute(t,""),e=n.element,n.children.forEach(r=>{r.setAttribute(t,"")}));const i=Object.keys(zn);for(let r=0;r<i.length;r++){const o=zn[i[r]],a=this[i[r]];if(o.apply){if(a instanceof Ar){if(a.__ctx)for(;a.__ctx.__SVGdefs.childNodes.length;){const h=a.__ctx.__SVGdefs.childNodes[0].getAttribute("id");this.__ids[h]=h,this.__SVGdefs.appendChild(a.__ctx.__SVGdefs.childNodes[0])}e.setAttribute(o.apply,Pt("url(#{id})",{id:a.__root.getAttribute("id")}))}else if(a instanceof Ns)e.setAttribute(o.apply,Pt("url(#{id})",{id:a.__root.getAttribute("id")}));else if(o.apply.indexOf(t)!==-1&&o.svg!==a)if((o.svgAttr==="stroke"||o.svgAttr==="fill")&&a.indexOf("rgba")!==-1){const c=/rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d?\.?\d*)\s*\)/gi.exec(a);if(c){e.setAttribute(o.svgAttr,Pt("rgb({r},{g},{b})",{r:c[1],g:c[2],b:c[3]}));let u=parseFloat(c[4]);const l=this.globalAlpha;l!=null&&(u*=l),e.setAttribute(o.svgAttr+"-opacity",""+u)}}else{let h=o.svgAttr;if(i[r]==="globalAlpha"&&(h=t+"-"+o.svgAttr,e.getAttribute(h)))continue;h&&e.setAttribute(h,a)}}}}__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(ac);for(let r=0,o=i.length;r<o;r++){const a=i[r],h=ac[a],c=new RegExp(a,"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 n=this.__currentElement.getAttribute("transform");n?n+=" ":n="",n+=t,this.__currentElement.setAttribute("transform",n)}scale(t,e){e===void 0&&(e=t),this.__addTransform(Pt("scale({x},{y})",{x:t,y:e}))}rotate(t){const e=t*180/Math.PI;this.__addTransform(Pt("rotate({angle},{cx},{cy})",{angle:e,cx:0,cy:0}))}translate(t,e){this.__addTransform(Pt("translate({x},{y})",{x:t,y:e}))}transform(t,e,n,i,r,o){this.__addTransform(Pt("matrix({a},{b},{c},{d},{e},{f})",{a:t,b:e,c:n,d:i,e:r,f:o}))}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(Pt("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(Pt("L {x} {y}",this.__currentPosition)):this.__addPathCommand(Pt("M {x} {y}",this.__currentPosition))}bezierCurveTo(t,e,n,i,r,o){this.__currentPosition={x:r,y:o},this.__addPathCommand(Pt("C {cp1x} {cp1y} {cp2x} {cp2y} {x} {y}",{cp1x:t,cp1y:e,cp2x:n,cp2y:i,x:r,y:o}))}quadraticCurveTo(t,e,n,i){this.__currentPosition={x:n,y:i},this.__addPathCommand(Pt("Q {cpx} {cpy} {x} {y}",{cpx:t,cpy:e,x:n,y:i}))}normalize(t){const e=Math.sqrt(t[0]*t[0]+t[1]*t[1]);return[t[0]/e,t[1]/e]}arcTo(t,e,n,i,r){const o=this.__currentPosition&&this.__currentPosition.x,a=this.__currentPosition&&this.__currentPosition.y;if(typeof o>"u"||typeof a>"u")return;if(r<0)throw new Error("IndexSizeError: The radius provided ("+r+") is negative.");if(o===t&&a===e||t===n&&e===i||r===0){this.lineTo(t,e);return}const h=this.normalize([o-t,a-e]),c=this.normalize([n-t,i-e]);if(h[0]*c[1]===h[1]*c[0]){this.lineTo(t,e);return}const u=h[0]*c[0]+h[1]*c[1],l=Math.acos(Math.abs(u)),m=this.normalize([h[0]+c[0],h[1]+c[1]]),f=r/Math.sin(l/2),p=t+f*m[0],y=e+f*m[1],v=[-h[1],h[0]],w=[c[1],-c[0]],_=function(E){const C=E[0];return E[1]>=0?Math.acos(C):-Math.acos(C)},x=_(v),b=_(w);this.lineTo(p+v[0]*r,y+v[1]*r),this.arc(p,y,r,x,b)}stroke(){this.__currentElement.nodeName==="path"&&this.__currentElement.setAttribute("paint-order","fill stroke markers"),this.__applyCurrentDefaultPath(),this.__applyStyleToCurrentElement("stroke")}fill(){this.__currentElement.nodeName==="path"&&this.__currentElement.setAttribute("paint-order","stroke fill markers"),this.__applyCurrentDefaultPath(),this.__applyStyleToCurrentElement("fill")}rect(t,e,n,i){this.__currentElement.nodeName!=="path"&&this.beginPath(),this.moveTo(t,e),this.lineTo(t+n,e),this.lineTo(t+n,e+i),this.lineTo(t,e+i),this.lineTo(t,e),this.closePath()}fillRect(t,e,n,i){const r=this.__createElement("rect",{x:t,y:e,width:n,height:i},!0);this.__closestGroupOrSvg().appendChild(r),this.__currentElement=r,this.__applyStyleToCurrentElement("fill")}strokeRect(t,e,n,i){const r=this.__createElement("rect",{x:t,y:e,width:n,height:i},!0);this.__closestGroupOrSvg().appendChild(r),this.__currentElement=r,this.__applyStyleToCurrentElement("stroke")}__clearCanvas(){const e=this.__closestGroupOrSvg().getAttribute("transform"),n=this.__rootSVG.childNodes[1],i=n.childNodes;for(let r=i.length-1;r>=0;r--)i[r]&&n.removeChild(i[r]);this.__currentElement=n,this.__groupStack=[],e&&this.__addTransform(e)}clearRect(t,e,n,i){if(t===0&&e===0&&n===this.width&&i===this.height){this.__clearCanvas();return}const r=this.__closestGroupOrSvg(),o=this.__createElement("rect",{x:t,y:e,width:n,height:i,fill:"#FFFFFF"},!0);r.appendChild(o)}createLinearGradient(t,e,n,i){const r=this.__createElement("linearGradient",{id:zs(this.__ids),x1:t+"px",x2:n+"px",y1:e+"px",y2:i+"px",gradientUnits:"userSpaceOnUse"},!1);return this.__SVGdefs.appendChild(r),new Ns(r,this)}createRadialGradient(t,e,n,i,r,o){const a=this.__createElement("radialGradient",{id:zs(this.__ids),cx:i+"px",cy:r+"px",r:o+"px",fx:t+"px",fy:e+"px",gradientUnits:"userSpaceOnUse"},!1);return this.__SVGdefs.appendChild(a),new Ns(a,this)}__parseFont(){const e=/^\s*(?=(?:(?:[-a-z]+\s*){0,2}(italic|oblique))?)(?=(?:(?:[-a-z]+\s*){0,2}(small-caps))?)(?=(?:(?:[-a-z]+\s*){0,2}(bold(?:er)?|lighter|[1-9]00))?)(?:(?:normal|\1|\2|\3)\s*){0,3}((?:xx?-)?(?:small|large)|medium|smaller|larger|[.\d]+(?:%|in|[cem]m|ex|p[CustomCanvasContext]))(?:\s*\/\s*(normal|[.\d]+(?:%|in|[cem]m|ex|p[CustomCanvasContext])))?\s*([-,'"\sa-z0-9]+?)\s*$/i.exec(this.font),n={style:e[1]||"normal",size:e[4]||"10px",family:e[6]||"sans-serif",weight:e[3]||"normal",decoration:e[2]||"normal",href:null};return this.__fontUnderline==="underline"&&(n.decoration="underline"),this.__fontHref&&(n.href=this.__fontHref),n}__wrapTextLink(t,e){if(t.href){const n=this.__createElement("a");return n.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",t.href),n.appendChild(e),n}return e}__applyText(t,e,n,i){const r=this.__parseFont(),o=this.__closestGroupOrSvg(),a=this.__createElement("text",{"font-family":r.family,"font-size":r.size,"font-style":r.style,"font-weight":r.weight,"text-decoration":r.decoration,x:e,y:n,"text-anchor":hg(this.textAlign),"dominant-baseline":cg(this.textBaseline)},!0);a.appendChild(this.__document.createTextNode(t)),this.__currentElement=a,this.__applyStyleToCurrentElement(i),o.appendChild(this.__wrapTextLink(r,a))}fillText(t,e,n){this.__applyText(t,e,n,"fill")}strokeText(t,e,n){this.__applyText(t,e,n,"stroke")}measureText(t){return this.__ctx.font=this.font,this.__ctx.measureText(t)}arc(t,e,n,i,r,o){if(i===r)return;i=i%(2*Math.PI),r=r%(2*Math.PI),i===r&&(r=(r+2*Math.PI-.001*(o?-1:1))%(2*Math.PI));const a=t+n*Math.cos(r),h=e+n*Math.sin(r),c=t+n*Math.cos(i),u=e+n*Math.sin(i),l=o?0:1;let m=0,f=r-i;f<0&&(f+=2*Math.PI),o?m=f>Math.PI?0:1:m=f>Math.PI?1:0,this.lineTo(c,u),this.__addPathCommand(Pt("A {rx} {ry} {xAxisRotation} {largeArcFlag} {sweepFlag} {endX} {endY}",{rx:n,ry:n,xAxisRotation:0,largeArcFlag:m,sweepFlag:l,endX:a,endY:h})),this.__currentPosition={x:a,y:h}}clip(){const t=this.__closestGroupOrSvg(),e=this.__createElement("clipPath"),n=zs(this.__ids),i=this.__createElement("g");this.__applyCurrentDefaultPath(),t.removeChild(this.__currentElement),e.setAttribute("id",n),e.appendChild(this.__currentElement),this.__SVGdefs.appendChild(e),t.setAttribute("clip-path",Pt("url(#{id})",{id:n})),t.appendChild(i),this.__currentElement=i}drawImage(...t){let e=t[0],n,i,r,o,a=0,h=0,c,u,l,m,f,p,y,v;if(t.length===3)n=t[1],i=t[2],c=e.width,u=e.height,r=c,o=u;else if(t.length===5)n=t[1],i=t[2],r=t[3],o=t[4],c=e.width,u=e.height;else if(t.length===9)a=t[1],h=t[2],c=t[3],u=t[4],n=t[5],i=t[6],r=t[7],o=t[8];else throw new Error("Invalid number of arguments passed to drawImage: "+arguments.length);const w=this.__closestGroupOrSvg();this.__currentElement;const _="translate("+n+", "+i+")";if(e instanceof ia){if(l=e.getSvg().cloneNode(!0),l.childNodes&&l.childNodes.length>1){for(m=l.childNodes[0];m.childNodes.length;)v=m.childNodes[0].getAttribute("id"),this.__ids[v]=v,this.__SVGdefs.appendChild(m.childNodes[0]);if(f=l.childNodes[1],f){const x=f.getAttribute("transform");let b;x?b=x+" "+_:b=_,f.setAttribute("transform",b),w.appendChild(f)}}}else(e.nodeName==="CANVAS"||e.nodeName==="IMG")&&(p=this.__createElement("image"),p.setAttribute("width",r),p.setAttribute("height",o),p.setAttribute("preserveAspectRatio","none"),(a||h||c!==e.width||u!==e.height)&&(y=this.__document.createElement("canvas"),y.width=r,y.height=o,y.getContext("2d")?.drawImage(e,a,h,c,u,0,0,r,o),e=y),p.setAttribute("transform",_),p.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",e.nodeName==="CANVAS"?e.toDataURL():e.getAttribute("src")),w.appendChild(p))}createPattern(t,e){const n=this.__document.createElementNS("http://www.w3.org/2000/svg","pattern"),i=zs(this.__ids);let r;return n.setAttribute("id",i),t.nodeName==="CANVAS"||t.nodeName==="IMG"?(r=this.__document.createElementNS("http://www.w3.org/2000/svg","image"),r.setAttribute("width",""+t.width),r.setAttribute("height",""+t.height),r.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",t.nodeName==="CANVAS"?t.toDataURL():t.getAttribute("src")),n.appendChild(r),this.__SVGdefs.appendChild(n)):t instanceof ia&&(n.setAttribute("width",""+t.width),n.setAttribute("height",""+t.height),n.appendChild(t.__rootSVG.childNodes[1]),this.__SVGdefs.appendChild(n)),new Ar(n,this)}setLineDash(t){t&&t.length>0?this.lineDash=t.join(","):this.lineDash=null}drawFocusRing(){}createImageData(){}getImageData(){}putImageData(){}globalCompositeOperation(){}setTransform(){}},kr=class{canvas;context;customContext;currentPath2D=new Path2D;path2Ds=[];currentMatrix=new DOMMatrix;hasSetCustomStrokeStyle=!1;hasSetCustomFillStyle=!1;constructor(t,e,n,i=!1){this.canvas=t,this.context=t.getContext("2d",{willReadFrequently:!0}),i&&(this.customContext=new hc({canvas:this.canvas,width:e||this.canvas.width,height:n||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,n,i){return this.context.fillRect(t,e,n,i),this.customContext&&this.customContext.fillRect(t,e,n,i),this}fillText(t,e,n,i){return this.hasSetCustomFillStyle=!1,this.context.fillText(t,e,n,i),this.customContext&&this.customContext.fillText(t,e,n),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,n,i){return this.context.strokeText(t,e,n,i),this.customContext&&this.customContext.strokeText(t,e,n),this}strokeRect(t,e,n,i){return this.context.strokeRect(t,e,n,i),this.customContext&&this.customContext.strokeRect(t,e,n,i),this}measureText(t){return this.context.measureText(t)}clearRect(t=0,e=0,n=this.canvas.width,i=this.canvas.height){return this.context.clearRect(t,e,n,i),this.customContext&&this.customContext.clearRect(t,e,n,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 n=new Path2D;n.addPath(t,e),this.currentPath2D=n}isPointInStroke(...t){return t[0]instanceof Path2D?this.context.isPointInStroke(t[0],t[1],t[2]):this.context.isPointInStroke(t[0],t[1])}isPointInPath(...t){return t[0]instanceof Path2D?this.context.isPointInPath(t[0],t[1],t[2]):this.context.isPointInPath(t[0],t[1])}translate(t,e){return this.context.translate(t,e),this.customContext&&this.customContext.translate(t,e),this.currentMatrix.translate(t,e),this.changePath2D(),this}rotate(t,e=0,n=0){return this.translate(e,n),this.context.rotate(t),this.customContext&&this.customContext.rotate(t),this.currentMatrix.rotate(t),this.translate(-e,-n),this.changePath2D(),this}scale(t,e=t,n=0,i=0){return this.translate(n,i),this.context.scale(t,e),this.customContext&&this.customContext.scale(t,e),this.currentMatrix.scale(t,e),this.translate(-n,-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,n,i,r,o){return this.context.arc(t,e,n,i,r,o),this.customContext&&this.customContext.arc(t,e,n,i,r,o?-1:1),this.currentPath2D.arc(t,e,n,i,r,o),this}arcTo(t,e,n,i,r){return this.context.arcTo(t,e,n,i,r),this.customContext&&this.customContext.arcTo(t,e,n,i,r),this.currentPath2D.arcTo(t,e,n,i,r),this}ellipse(t,e,n,i,r,o,a,h){return this.context.ellipse(t,e,n,i,r,o,a,h),this.currentPath2D.ellipse(t,e,n,i,r,o,a,h),this}quadraticCurveTo(t,e,n,i){return this.context.quadraticCurveTo(t,e,n,i),this.customContext&&this.customContext.quadraticCurveTo(t,e,n,i),this.currentPath2D.quadraticCurveTo(t,e,n,i),this}bezierCurveTo(t,e,n,i,r,o){return this.context.bezierCurveTo(t,e,n,i,r,o),this.customContext&&this.customContext.bezierCurveTo(t,e,n,i,r,o),this.currentPath2D.bezierCurveTo(t,e,n,i,r,o),this}rect(t,e,n,i){return this.context.rect(t,e,n,i),this.customContext&&this.customContext.rect(t,e,n,i),this.currentPath2D.rect(t,e,n,i),this}createLinearGradient(t,e,n,i,r){const o=this.context.createLinearGradient(t,e,n,i);return r&&Object.entries(r).forEach(([a,h])=>{o.addColorStop(parseFloat(a),h)}),o}createRadialGradient(t,e,n,i,r,o,a){const h=this.context.createRadialGradient(t,e,n,i,r,o);return a&&Object.entries(a).forEach(([c,u])=>{h.addColorStop(parseFloat(c),u)}),h}drawImage(t,...e){if(e.length===0)this.context.drawImage(t,0,0);else if(e.length===2){const n=e[0],i=e[1];this.context.drawImage(t,n,i)}else if(e.length===4){const n=e[0],i=e[1],r=e[2],o=e[3];this.context.drawImage(t,n,i,r,o)}else if(e.length===8){const n=e[0],i=e[1],r=e[2],o=e[3],a=e[4],h=e[5],c=e[6],u=e[7];this.context.drawImage(t,n,i,r,o,a,h,c,u)}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,n=this.canvas.width,i=this.canvas.height,r){return this.context.getImageData(t,e,n,i,r)}putImageData(t,e=0,n=0){return this.context.putImageData(t,e,n)}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}}},Ir=class{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=Jt(this.x,this.y,this.toX,this.toY);if(t===0){const e=Math.min(this.x,this.toX),n=Math.min(this.y,this.toY),i=Math.max(this.x,this.toX),r=Math.max(this.y,this.toY);return{x:e,y:n,width:i-e,height:r-n}}else{const e=Math.sin(t),n=Math.cos(t),i=n*this.x-e*this.y,r=n*this.toX-e*this.toY,o=n*this.y+e*this.x,a=n*this.toY+e*this.toX;return{x:Math.min(i,r),y:Math.min(o,a),width:Math.max(i,r)-Math.min(i,r),height:Math.max(o,a)-Math.min(o,a)}}}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,n=this.y,i=t.toX,r=t.toY,o=this.toX-e,a=t.x-i;if(!o&&!a)return null;const h=(this.toY-n)/o,c=(t.y-r)/a;if(o){if(!a)return{x:i,y:h*(i-e)+n}}else return{x:e,y:c*(e-i)+r};const u=(-c*i+r+h*e-n)/(h-c),l=h*(u-e)+n;return isNaN(u)||isNaN(l)?null:{x:u,y:l}}};const ug=class extends Ir{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,n,i,r,o,a,h]=this.convert(this.x,this.y,this.toX,this.toY,this.rx,this.ry,this.xAxisRotate,this.largeArcFlag,this.sweepFlag);t.ellipse(e,n,i,r,o,a,h,!this.sweepFlag)}convert(t,e,n,i,r,o,a,h,c){const u=a/180*Math.PI,l=(t-n)/2,m=(e-i)/2,f=Math.cos(u)*l+Math.sin(u)*m,p=-Math.sin(u)*l+Math.cos(u)*m,y=f*f/(r*r)+p*p/(o*o);if(y>1){const G=Math.sqrt(y);throw r=G*r,o=G*o,new Error(`Radii are too small to build an arc. Correcting them to ${r}/${o}.`)}const v=Math.sqrt((r*r*o*o-r*r*p*p-o*o*f*f)/(r*r*p*p+o*o*f*f)),w=h!=c?1:-1,_=w*v*r*p/o,x=w*v*-o*f/r,b=(t+n)/2,E=(e+i)/2,C=Math.cos(u)*_-Math.sin(u)*x+b,L=Math.sin(u)*_+Math.cos(u)*x+E,B=(G,J,st,K)=>(G*K>=J*st?1:-1)*Math.acos((G*st+J*K)/(Math.sqrt(G*G+J*J)*Math.sqrt(st*st+K*K))),F=B(1,0,t-C,e-L)-u,$=B(t-C,e-L,n-C,i-L);return[C,L,r,o,u,F,F+$]}},lg=class extends Ir{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,n=this.cy*2-(this.y+this.toY)/2;t.quadraticCurveTo(e,n,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 n,i,r,o;for(let c=0;c<2;++c)n=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(n)>1e-12&&(o=-i/(2*n),0<o&&o<1&&[t,e][c].push(n*o*o+i*o+r));const a={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:a.x,y:a.y,width:h.x-a.x,height:h.y-a.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}}},Me=class is extends Ir{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),n=this.x-this.c1x,i=(-e+Math.sqrt(e*e-4*t*n))/2/t,r=(-e-Math.sqrt(e*e-4*t*n))/2/t;const o=[this.y,this.toY],a=[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),a.push(h.x),o.push(h.y),c.push({X:h.x,Y:h.y})),r>=0&&r<=1&&(h=this.interpolate(r),a.push(h.x),o.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),n=this.y-this.c1y,i=(-e+Math.sqrt(e*e-4*t*n))/2/t,r=(-e-Math.sqrt(e*e-4*t*n))/2/t,Math.abs(i)>1e12&&(i=.5),Math.abs(r)>1e12&&(r=.5),i>=0&&i<=1&&(h=this.interpolate(i),a.push(h.x),o.push(h.y),c.push({X:h.x,Y:h.y})),r>=0&&r<=1&&(h=this.interpolate(r),a.push(h.x),o.push(h.y),c.push({X:h.x,Y:h.y}));const u=[],l=c.length;for(let p=0;p<l;p++){for(let y=p+1;y<l;y++)c[p].X===c[y].X&&c[p].Y===c[y].Y&&(y=++p);u.push({X:c[p].X,Y:c[p].Y})}const m={x:Math.min.apply(Math,a),y:Math.min.apply(Math,o)},f={x:Math.max.apply(Math,a),y:Math.max.apply(Math,o)};return{x:m.x,y:m.y,width:f.x-m.x,height:f.y-m.y,dots:u}}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,n,i,r){const o=-3*e+9*n-9*i+3*r,a=t*o+6*e-12*n+6*i;return t*a-3*e+3*n}static bezlen(t,e,n,i,r,o,a,h,c=1){c=Math.max(0,Math.min(c,1));const u=c/2,l=[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816],m=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472];let f=0;for(let p=0;p<12;p++){const y=u*l[p]+u,v=this.base3(y,t,n,r,a),w=this.base3(y,e,i,o,h);f+=m[p]*Math.sqrt(v*v+w*w)}return u*f}length(t=1){return is.bezlen(this.x,this.y,this.c1x,this.c1y,this.c2x,this.c2y,this.toX,this.toY,t)}getTatLen(t){const e=this.x,n=this.y,i=this.c1x,r=this.c1y,o=this.c2x,a=this.c2y,h=this.toX,c=this.toY;if(t<0||is.bezlen(e,n,i,r,o,a,h,c)<t)return 0;const u=1;let l=u/2,m=u-l,f=is.bezlen(e,n,i,r,o,a,h,c,m);for(;Math.abs(f-t)>.01;)l/=2,m+=(f<t?1:-1)*l,f=is.bezlen(e,n,i,r,o,a,h,c,m);return m}getPointAtSegmentLength(t){const e=this.getTatLen(t),n=1-e,i=Math.pow(n,3),r=Math.pow(n,2),o=e*e,a=o*e,h=i*this.x+r*3*e*this.c1x+n*3*e*e*this.c2x+a*this.toX,c=i*this.y+r*3*e*this.c1y+n*3*e*e*this.c2y+a*this.toY,u=this.x+2*e*(this.c1x-this.x)+o*(this.c2x-2*this.c1x+this.x),l=this.y+2*e*(this.c1y-this.y)+o*(this.c2y-2*this.c1y+this.y),m=this.c1x+2*e*(this.c2x-this.c1x)+o*(this.toX-2*this.c2x+this.c1x),f=this.c1y+2*e*(this.c2y-this.c1y)+o*(this.toY-2*this.c2y+this.c1y),p=n*this.x+e*this.c1x,y=n*this.y+e*this.c1y,v=n*this.c2x+e*this.toX,w=n*this.c2y+e*this.toY,_=90-Math.atan2(u-m,l-f)*180/Math.PI;return{x:h,y:c,m:{x:u,y:l},n:{x:m,y:f},start:{x:p,y},end:{x:v,y:w},alpha:_}}},Nn=Math.PI*2;function cc(s,t,e,n){const i=s*n-t*e<0?-1:1;let r=s*e+t*n;return r>1&&(r=1),r<-1&&(r=-1),i*Math.acos(r)}function fg(s,t,e,n,i,r,o,a,h,c){const u=c*(s-e)/2+h*(t-n)/2,l=-h*(s-e)/2+c*(t-n)/2,m=o*o,f=a*a,p=u*u,y=l*l;let v=m*f-m*y-f*p;v<0&&(v=0),v/=m*y+f*p,v=Math.sqrt(v)*(i===r?-1:1);const w=v*o/a*l,_=v*-a/o*u,x=c*w-h*_+(s+e)/2,b=h*w+c*_+(t+n)/2,E=(u-w)/o,C=(l-_)/a,L=(-u-w)/o,B=(-l-_)/a,F=cc(1,0,E,C);let $=cc(E,C,L,B);return r===0&&$>0&&($-=Nn),r===1&&$<0&&($+=Nn),[x,b,F,$]}function dg(s,t){const e=1.3333333333333333*Math.tan(t/4),n=Math.cos(s),i=Math.sin(s),r=Math.cos(s+t),o=Math.sin(s+t);return[n,i,n-i*e,i+n*e,r+o*e,o-r*e,r,o]}function uc(s,t,e,n,i,r,o,a,h){const c=Math.sin(h*Nn/360),u=Math.cos(h*Nn/360),l=u*(s-e)/2+c*(t-n)/2,m=-c*(s-e)/2+u*(t-n)/2;if(l===0&&m===0)return[];if(o===0||a===0)return[];o=Math.abs(o),a=Math.abs(a);const f=l*l/(o*o)+m*m/(a*a);f>1&&(o*=Math.sqrt(f),a*=Math.sqrt(f));const p=fg(s,t,e,n,i,r,o,a,c,u),y=[];let v=p[2],w=p[3];const _=Math.max(Math.ceil(Math.abs(w)/(Nn/4)),1);w/=_;for(let x=0;x<_;x++)y.push(dg(v,w)),v+=w;return y.map(x=>{for(let b=0;b<x.length;b+=2){let E=x[b+0],C=x[b+1];E*=o,C*=a;const L=u*E-c*C,B=c*E+u*C;x[b+0]=L+p[0],x[b+1]=B+p[1]}return x})}function Dr(s,t,e,n,i,r){return[s/3+.6666666666666666*e,t/3+.6666666666666666*n,i/3+.6666666666666666*e,r/3+.6666666666666666*n,i,r]}function Bn(s,t,e,n){return[s,t,e,n,e,n]}const Fn={a:7,c:6,s:4,q:4,t:2,m:2,l:2,h:1,v:1,z:0};class $e{static createSVGElement(t="path",e){const n=document.createElementNS.call(document,"http://www.w3.org/2000/svg",t);return e&&Ge(n,e),n}static createSvgPath(t,e){return this.createSVGElement("path",{d:t,id:e||hs()})}static downloadFromSVGElement(t,e="shape"){return $s(Qi(t),`${e}.svg`)}static downloadFromSVGString(t,e="shape"){return $s(vi(t),`${e}.svg`)}static getSVGRawStringFromElement(t){return Zi(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 $e.isSVGPath(t)&&t.replace(/([mlhvzaqtcs])([^mlhvzaqtcs]*)/gi,(n,i,r)=>{let o=i.toLowerCase();const a=bi(r);for(o=="m"&&a.length>Fn[o]&&(e.push([i,...a.splice(0,Fn[o])]),o="l",i=i=="m"?"l":"L");a.length;){if(a.length<Fn[o])throw new Error(`parseSVGPath substring:{ ${n} } command:{ ${i} } args:{ ${a} }`);e.push([i,...a.splice(0,Fn[o])])}return o=="z"&&e.push([i]),""}),e}static absolutizeSVGPath(t){let e=0,n=0,i=0,r=0;return t.map(function(o){const a=o[0],h=a.toUpperCase();if(a!=h)switch(o[0]=h,a){case"a":o[6]+=i,o[7]+=r;break;case"v":o[1]+=r;break;case"h":o[1]+=i;break;default:for(let c=1;c<o.length;)o[c++]+=i,o[c++]+=r}switch(h){case"Z":i=e,r=n;break;case"H":i=o[1];break;case"V":r=o[1];break;case"M":i=e=o[1],r=n=o[2];break;default:i=o[o.length-2],r=o[o.length-1]}return o})}static relativeSVGPath(t){let e=0,n=0,i=0,r=0;return t.map(function(o){const a=o[0],h=a.toLowerCase();if(a!=h)switch(o[0]=h,a){case"A":o[6]-=i,o[7]-=r;break;case"V":o[1]-=r;break;case"H":o[1]-=i;break;default:for(let c=1;c<o.length;)o[c++]-=i,o[c++]-=r}switch(h){case"z":i=e,r=n;break;case"h":i+=o[1];break;case"v":r+=o[1];break;case"m":i+=o[1],r+=o[2],e+=o[1],n+=o[2];break;default:i+=o[o.length-2],r+=o[o.length-1]}return o})}static normalizeSVGPath(t){const e=[];let n=0,i=0,r=0,o=0,a=0,h=0,c=0,u=0,l;for(let m=0,f=t.length;m<f;m++){let p=t[m];const y=p[0];switch(y){case"M":n=p[1],i=p[2];break;case"A":const v=uc(r,o,p[6],p[7],p[4],p[5],p[1],p[2],p[3]);if(!v.length)continue;v.forEach((x,b)=>{const[E,C,L,B,F,$,G,J]=x;p=["C",L,B,F,$,G,J],b<v.length-1&&e.push(p)});break;case"S":let w=r,_=o;(l=="C"||l=="S")&&(w+=w-c,_+=_-u),p=["C",w,_,p[1],p[2],p[3],p[4]];break;case"T":l=="Q"||l=="T"?(a=r*2-a,h=o*2-h):(a=r,h=o),p=["C",...Dr(r,o,a,h,p[1],p[2])];break;case"Q":a=p[1],h=p[2],p=["C",...Dr(r,o,p[1],p[2],p[3],p[4])];break;case"L":p=["C",...Bn(r,o,p[1],p[2])];break;case"H":p=["C",...Bn(r,o,p[1],o)];break;case"V":p=["C",...Bn(r,o,r,p[1])];break;case"Z":p=["C",...Bn(r,o,n,i)];break}l=y,r=p[p.length-2],o=p[p.length-1],p.length>4?(c=p[p.length-4],u=p[p.length-3]):(c=r,u=o),e.push(p)}return e}static catmullRom2bezier(t){const e=[];for(let n=0,i=t.length;i-2>n;n+=2){let r;n==0?r=[{x:t[n],y:t[n+1]},{x:t[n],y:t[n+1]},{x:t[n+2],y:t[n+3]},{x:t[n+4],y:t[n+5]}]:i-4==n?r=[{x:t[n-2],y:t[n-1]},{x:t[n],y:t[n+1]},{x:t[n+2],y:t[n+3]},{x:t[n+2],y:t[n+3]}]:r=[{x:t[n-2],y:t[n-1]},{x:t[n],y:t[n+1]},{x:t[n+2],y:t[n+3]},{x:t[n+4],y:t[n+5]}];const o=[{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",o[1].x,o[1].y,o[2].x,o[2].y,o[3].x,o[3].y])}return e}static zvhToLSVGPath(t){const e=[];let n=["L",0,0],i;for(let r=0,o=t.length;r<o;r++){const a=t[r];switch(a[0]){case"M":n=["L",a[1],a[2]],e.push(a);break;case"Z":e.push(n);break;case"H":i=e[e.length-1]||["L",0,0],e.push(["L",a[1],i[i.length-1]]);break;case"V":i=e[e.length-1]||["L",0,0],e.push(["L",i[i.length-2],a[1]]);break;default:e.push(a)}}return e}static longhandSVGPath(t){const e={S:{to:"C",x:3},T:{to:"Q",x:1}};let n,i=0,r=0;for(let o=0,a=t.length;o<a;o++){const h=t[o],c=e[h[0]];c&&(h[0]=c.to,n&&(n[0]===c.to?(i=2*Number(n[c.x+2])-Number(n[c.x]),r=2*Number(n[c.x+3])-Number(n[c.x+1])):(i=Number(n[n.length-2]),r=Number(n[n.length-1]))),h.splice(1,0,i,r)),n=h}return t}}let mg=class be{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($e.parseSVGPath(t),e):t instanceof be?this.resetFromSVGPathData(t.toSVGPathData(),e):this.resetFromSVGPathData(t||[],e)}resetFromSVGPathData(t,e){this.normalizedLines=[];const n=$e.normalizeSVGPath($e.absolutizeSVGPath(t));this.prevPathX=this.startPathX=0,this.prevPathY=this.startPathY=0;let i=!1;for(let r=0,o=n.length;r<o;r++){const a=n[r];if(a[0]=="M"){i||(i=!0,this.startPathX=a[1],this.startPathY=a[2]),this.prevPathX=a[1],this.prevPathY=a[2];continue}this.appendLine(new Me({c1x:a[1],c1y:a[2],c2x:a[3],c2y:a[4],toX:a[5],toY:a[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 be;e.prevPathX=e.startPathX=t[0]||0,e.prevPathY=e.startPathY=t[1]||0;for(let n=2,i=t.length;n+5<i;n+=6)e.appendLine(new Me({c1x:t[n],c1y:t[n+1],c2x:t[n+2],c2y:t[n+3],toX:t[n+4],toY:t[n+5]}));return e}static fromLines(t){const e=new be;e.prevPathX=e.startPathX=t[0].x||0,e.prevPathY=e.startPathY=t[0].y||0;for(let n=0,i=t.length;n<i;n++)e.appendLine(t[n]);return e}appendLine(t){if(t instanceof ug){uc(this.prevPathX,this.prevPathY,t.toX,t.toY,t.largeArcFlag,t.sweepFlag,t.rx,t.ry,t.xAxisRotate).forEach(c=>{const[u,l,m,f,p,y,v,w]=c;this.normalizedLines.push(new Me({x:this.prevPathX,y:this.prevPathY,c1x:m,c1y:f,c2x:p,c2y:y,toX:v,toY:w})),this.prevPathX=v,this.prevPathY=w});return}let e,n,i,r,o,a;t instanceof Me?(e=t.c1x,n=t.c1y,i=t.c2x,r=t.c2y,o=t.toX,a=t.toY):t instanceof lg?[e,n,i,r,o,a]=Dr(this.prevPathX,this.prevPathY,t.cx,t.cy,t.toX,t.toY):[e,n,i,r,o,a]=Bn(this.prevPathX,this.prevPathY,t.toX,t.toY),this.normalizedLines.push(new Me({x:this.prevPathX,y:this.prevPathY,c1x:e,c1y:n,c2x:i,c2y:r,toX:o,toY:a})),this.prevPathX=o,this.prevPathY=a}toSVGPathData(){const{startPathX:t,startPathY:e,normalizedLines:n}=this.updateTransform(),i=[];i.push(["M",t,e]);for(let r=0,o=n.length;r<o;r++)i.push(...n[r].toSVGPathData());return i}toSVGPathD(){return $e.SVGPathDataToD(this.toSVGPathData())}toCanvasContext(t){const{startPathX:e,startPathY:n,normalizedLines:i}=this.updateTransform();t.beginPath(),t.moveTo(e,n),i.forEach(r=>{r.toCanvasContext(t)})}getBoundingClientRect(){const{normalizedLines:t}=this.updateTransform(),e=[],n=[];if(t.forEach(h=>{const c=h.getBoundingClientRect();e.push(c.x,c.x+c.width),n.push(c.y,c.y+c.height)}),e.length==0||n.length==0)return{x:0,y:0,width:0,height:0};const i=Math.min.apply(0,e),r=Math.min.apply(0,n),o=Math.max.apply(0,e),a=Math.max.apply(0,n);return{x:i,y:r,width:o-i,height:a-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 vt;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,n=this.startPathY;({x:e,y:n}=t.transformPoint({x:e,y:n}));const i=[];return this.normalizedLines.forEach(r=>{let o=r.x,a=r.y,h=r.c1x,c=r.c1y,u=r.c2x,l=r.c2y,m=r.toX,f=r.toY;({x:o,y:a}=t.transformPoint({x:o,y:a})),{x:h,y:c}=t.transformPoint({x:h,y:c}),{x:u,y:l}=t.transformPoint({x:u,y:l}),{x:m,y:f}=t.transformPoint({x:m,y:f}),i.push(new Me({x:o,y:a,c1x:h,c1y:c,c2x:u,c2y:l,toX:m,toY:f}))}),{startPathX:e,startPathY:n,normalizedLines:i}}}getTotalLength(){const{normalizedLines:t}=this.updateTransform();return t.reduce((e,n)=>e+=n.length(),0)}getPointAtLength(t){const{normalizedLines:e}=this.updateTransform();let n=0;const i=e.length;for(let r=0;r<i;r++){const o=e[r],a=o.length();if(n+a>=t)return o.getPointAtSegmentLength(t-n);n+=a}return e[i-1].getPointAtSegmentLength(1)}interpolate(t){const{startPathX:e,startPathY:n,normalizedLines:i}=this.updateTransform(),r=i.length;if(r===0)return{x:e,y:n};if(r===1)return i[0].interpolate(t);{let o=t*r,a=i[0];if(o--,o>1)for(let h=1;h<r&&(a=i[h],o>1);h++)o-=1;return a.interpolate(o)}}getSubpath(t,e){if(this.getTotalLength()-e<1e-6)return this.getSubpathsAtLength(this,t);{const n=this.getSubpathsAtLength(this,e,1);return t?this.getSubpathsAtLength(n,t):n}}getSubpathsAtLength(t,e,n){const{startPathX:i,startPathY:r,normalizedLines:o}=t.updateTransform();let a=null,h=0;const c=new be;c.prevPathX=c.startPathX=i,c.prevPathY=c.startPathY=r;for(let u=0,l=o.length;u<l;u++){const m=o[u],f=m.length();if(h+f>e&&!a){const p=m.getPointAtSegmentLength(e-h);if(c.appendLine(new Me({c1x:p.start.x,c1y:p.start.y,c2x:p.m.x,c2y:p.m.y,toX:p.x,toY:p.y})),n)return c;a=c,c.appendLine(new Me({c1x:p.n.x,c1y:p.n.y,c2x:p.end.x,c2y:p.end.y,toX:m.x,toY:m.y})),h+=f;continue}h+=f,c.appendLine(m)}return c}closestPoint(t,e){const n=this.getTotalLength();let i={x:t,y:e},r=0,o=1/0,a=8;for(let c=0;c<=n;c+=a){const u=this.getPointAtLength(c),l=Math.pow(Ee(u.x,u.y,t,e),2);l<o&&(i=u,r=c,o=l)}for(a/=2;a>.5;){const c=r-a,u=this.getPointAtLength(c),l=Math.pow(Ee(u.x,u.y,t,e),2),m=r+a,f=this.getPointAtLength(m),p=Math.pow(Ee(f.x,f.y,t,e),2);c>=0&&l<o?(i=u,r=c,o=l):m<=n&&p<o?(i=f,r=m,o=p):a/=2}const h=this.getPointAtLength(r+(r===n?-.1:.1));return{point:i,rotation:r>=n?Jt(h.x,h.y,i.x,i.y):Jt(i.x,i.y,h.x,h.y),distance:Math.sqrt(o)}}get polymorphPoints(){const{startPathX:t,startPathY:e,normalizedLines:n}=this.updateTransform();return[t,e].concat(n.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 n=t[e-2],i=t[e-1],r=0;for(let o=0;o<e;o+=6)r+=Ee(t[o],t[o+1],n,i),n=t[o],i=t[o+1];return Math.floor(r)}expendFill(t){const e=this.polymorphPoints,n=e.length;let i=t-n;const r=Math.ceil(t/n),o=[];o.push(["M",e[0],e[1]]);let a=2;for(;a+5<=n-1;){const h=e[a++],c=e[a++],u=e[a++],l=e[a++],m=e[a++],f=e[a++];o.push(["C",h,c,u,l,m,f]);let p=0;for(;p<r&&i>0;)o.push(["C",m,f,m,f,m,f]),i-=6,p++}return o}static mixPoints(t,e,n){const i=t.length,r=new Array(i);for(let o=0;o<i;o++)r[o]=Z(t[o]+(e[o]-t[o])*n,6);return r}static getPathInterpolator(t,e){return n=>Math.abs(n-0)<Number.EPSILON?t:Math.abs(n-1)<Number.EPSILON?e:be.fromPolymorphPoints(be.mixPoints(new be({d:t}).polymorphPoints,new be({d:e}).polymorphPoints,n)).toSVGPathData()}},pg=class extends fs{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=hs(),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 n=this.getAttr("stroke-dasharray","4 4");this.setAttr("stroke-dasharray",n),this.strokeDashTotalLength=bi(n).reduce((i,r)=>i+r,0)}return ka(this)}forceSetCXY(t,e){this.cX=t,this.cY=e,this.forceCXY=!0}shapeInit(){}initPathD(){if(!this.pathd){if(this.pathd=new mg,jt(()=>{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(n=>{const i=n.originMatrix?n.originMatrix.clone():new vt;i.translate(-t.x+n.x,-t.y+n.y),n.originMatrix=i});const e=this.originMatrix?this.originMatrix.clone():new vt;e.translate(-t.x+this.x,-t.y+this.y),this.originMatrix=e}isPointInPath(t,e,n){if(n instanceof kr)return n.isPointInPath(new Path2D(this.toSVGPathD()),t,e);let i;try{i=new SVGPoint(t,e)}catch{i=n.createSVGPoint(),i.x=t,i.y=e}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,n){if(n instanceof kr)return n.isPointInStroke(new Path2D(this.toSVGPathD()),t,e);let i;try{i=new SVGPoint(t,e)}catch{i=n.createSVGPoint(),i.x=t,i.y=e}return this.el instanceof SVGGeometryElement?this.el.isPointInStroke(i):!1}clone(){return ma(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(([n,i])=>[wt(n),i]))):e&&(this.attrs[wt(t)]=e)}getAttr(t,e){return this.attrs[t]||this.attrs[wt(t)]||e}getAttrs(){return this.attrs}hasAttr(t){return!!this.attrs[t]||!!this.attrs[wt(t)]}distance(t){return Ee(this.x,this.y,t.x,t.y)}rotateTo(t){this.degree=Et(Jt(this.x,this.y,t.x,t.y))}followTo(t,e=3){this.rotateTo(t);const{dx:n,dy:i}=Pe(q(this.degree),e);this.vx=n,this.vy=i,this.run()}followAccelerationTo(t,e=.05){this.rotateTo(t);const{dx:n,dy:i}=Pe(q(this.degree),e);this.ax=n,this.ay=i,this.run()}checkCollision(t){}checkWall(t){}gravitateTo(t){const e=t.x-this.x,n=t.y-this.y,i=e*e+n*n,r=Math.sqrt(i),o=this.mass*t.mass/i,a=o*e/r,h=o*n/r;this.vx+=a/this.mass,this.vy+=h/this.mass,t.vx-=a/t.mass,t.vy-=h/t.mass}run(t){this.vx+=this.ax,this.vy+=this.ay;const e=qt(t?.gravity,0);this.vy+=e;const n=qt(t?.friction,1);this.vx*=n,this.vy*=n,this.x+=this.vx,this.y+=this.vy}runEaseTo(t,e){const n=qt(e?.easing,.05),i=t.x-this.cX-this.x,r=t.y-this.cY-this.y;this.vx=i*n,this.vy=r*n,this.run(e)}runSpringTo(t,e){const n=qt(e?.spring,.03);(Array.isArray(t)?t:[t]).forEach(i=>{const r=i.x-this.cX-this.x,o=i.y-this.cY-this.y,a=r*n,h=o*n;this.vx+=a,this.vy+=h}),this.run({friction:.9,...e})}springMassTo(t,e){const n=qt(e?.springLength,100),i=qt(e?.spring,1e-4),r=t.x-this.x,o=t.y-this.y,a=Math.sqrt(r*r+o*o);if(a<n){const h=r*i,c=o*i;return this.vx+=h/this.mass,this.vy+=c/this.mass,t.vx-=h/t.mass,t.vy-=c/t.mass,1-a/n}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 n=this.getTotalLength();return t.originD=this.initPathD().getSubpath(0,e*n),this.getPointAtLength(e*n)}strokeDashTween(t=1e3,e){const n=this.initPathD(),i=Z(n.getTotalLength(),0);this.setAttr({strokeDasharray:`${i} ${i}`,strokeDashoffset:`${i}`});const r=e?.onUpdate,o=new On({frameDuration:t});o.addTween({offset:i},{offset:0},Object.assign(e||{},{onUpdate:(a,h)=>{this.setAttr("strokeDashoffset",""+Z(a.offset,2)),r?.(a,h)}})),o.play()}};class gg extends pg{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,n){this.cX=t,this.cY=e,this.cZ=n}rotateX(t){({x:this.y,y:this.z}=Qt(q(t),this.y,this.z))}rotateY(t){({x:this.x,y:this.z}=Qt(q(t),this.x,this.z))}rotateZ(t){({x:this.x,y:this.y}=Qt(q(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 fn(this.x,this.y,this.z)}distance(t){const e=t.x-this.x,n=t.y-this.y,i=t.z-this.z;return Math.sqrt(e*e+n*n+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 n=t/e;this.scalar(n)}return this}clamp(t){const e=this.length();return e&&e>t&&this.scalar(t/e),this}cross(t){const e=this.x,n=this.y,i=this.z;return{x:n*t.z-i*t.y,y:i*t.x-e*t.z,z:e*t.y-n*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 Bs=gg;class Lr{_x;_y;_z;_w;constructor(t=0,e=0,n=0,i=1){this._x=t,this._y=e,this._z=n,this._w=i}static slerpFlat(t,e,n,i,r,o,a){let h=n[i+0],c=n[i+1],u=n[i+2],l=n[i+3];const m=r[o+0],f=r[o+1],p=r[o+2],y=r[o+3];if(a===0){t[e+0]=h,t[e+1]=c,t[e+2]=u,t[e+3]=l;return}if(a===1){t[e+0]=m,t[e+1]=f,t[e+2]=p,t[e+3]=y;return}if(l!==y||h!==m||c!==f||u!==p){let v=1-a;const w=h*m+c*f+u*p+l*y,_=w>=0?1:-1,x=1-w*w;if(x>Number.EPSILON){const E=Math.sqrt(x),C=Math.atan2(E,w*_);v=Math.sin(v*C)/E,a=Math.sin(a*C)/E}const b=a*_;if(h=h*v+m*b,c=c*v+f*b,u=u*v+p*b,l=l*v+y*b,v===1-a){const E=1/Math.sqrt(h*h+c*c+u*u+l*l);h*=E,c*=E,u*=E,l*=E}}t[e]=h,t[e+1]=c,t[e+2]=u,t[e+3]=l}static multiplyQuaternionsFlat(t,e,n,i,r,o){const a=n[i],h=n[i+1],c=n[i+2],u=n[i+3],l=r[o],m=r[o+1],f=r[o+2],p=r[o+3];return t[e]=a*p+u*l+h*f-c*m,t[e+1]=h*p+u*m+c*l-a*f,t[e+2]=c*p+u*f+a*m-h*l,t[e+3]=u*p-a*l-h*m-c*f,t}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get w(){return this._w}set w(t){this._w=t,this._onChangeCallback()}set(t=this._x,e=this._y,n=this._z,i=this._w){return this._x=t,this._y=e,this._z=n,this._w=i,this._onChangeCallback(),this}clone(){return new Lr(this._x,this._y,this._z,this._w)}copy(t){return this._x=t.x,this._y=t.y,this._z=t.z,this._w=t.w,this._onChangeCallback(),this}setFromEuler(t,e=!0){const n=t.x,i=t.y,r=t.z,o=t.order,a=Math.cos,h=Math.sin,c=a(n/2),u=a(i/2),l=a(r/2),m=h(n/2),f=h(i/2),p=h(r/2);switch(o){case"XYZ":this._x=m*u*l+c*f*p,this._y=c*f*l-m*u*p,this._z=c*u*p+m*f*l,this._w=c*u*l-m*f*p;break;case"YXZ":this._x=m*u*l+c*f*p,this._y=c*f*l-m*u*p,this._z=c*u*p-m*f*l,this._w=c*u*l+m*f*p;break;case"ZXY":this._x=m*u*l-c*f*p,this._y=c*f*l+m*u*p,this._z=c*u*p+m*f*l,this._w=c*u*l-m*f*p;break;case"ZYX":this._x=m*u*l-c*f*p,this._y=c*f*l+m*u*p,this._z=c*u*p-m*f*l,this._w=c*u*l+m*f*p;break;case"YZX":this._x=m*u*l+c*f*p,this._y=c*f*l+m*u*p,this._z=c*u*p-m*f*l,this._w=c*u*l-m*f*p;break;case"XZY":this._x=m*u*l-c*f*p,this._y=c*f*l-m*u*p,this._z=c*u*p+m*f*l,this._w=c*u*l+m*f*p;break;default:console.warn("Quaternion: .setFromEuler() encountered an unknown order: "+o)}return e===!0&&this._onChangeCallback(),this}setFromAxisAngle(t,e){const n=e/2,i=Math.sin(n);return this._x=t.x*i,this._y=t.y*i,this._z=t.z*i,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix4(t){const e=t.value,n=e[0],i=e[4],r=e[8],o=e[1],a=e[5],h=e[9],c=e[2],u=e[6],l=e[10],m=n+a+l;if(m>0){const f=.5/Math.sqrt(m+1);this._w=.25/f,this._x=(u-h)*f,this._y=(r-c)*f,this._z=(o-i)*f}else if(n>a&&n>l){const f=2*Math.sqrt(1+n-a-l);this._w=(u-h)/f,this._x=.25*f,this._y=(i+o)/f,this._z=(r+c)/f}else if(a>l){const f=2*Math.sqrt(1+a-n-l);this._w=(r-c)/f,this._x=(i+o)/f,this._y=.25*f,this._z=(h+u)/f}else{const f=2*Math.sqrt(1+l-n-a);this._w=(o-i)/f,this._x=(r+c)/f,this._y=(h+u)/f,this._z=.25*f}return this._onChangeCallback(),this}setFromUnitVectors(t,e){let n=t.dot(e)+1;return n<Number.EPSILON?(n=0,Math.abs(t.x)>Math.abs(t.z)?(this._x=-t.y,this._y=t.x,this._z=0,this._w=n):(this._x=0,this._y=-t.z,this._z=t.y,this._w=n)):(this._x=t.y*e.z-t.z*e.y,this._y=t.z*e.x-t.x*e.z,this._z=t.x*e.y-t.y*e.x,this._w=n),this.normalize()}angleTo(t){return 2*Math.acos(Math.abs(N(this.dot(t),-1,1)))}rotateTowards(t,e){const n=this.angleTo(t);if(n===0)return this;const i=Math.min(1,e/n);return this.slerp(t,i),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(t){return this._x*t._x+this._y*t._y+this._z*t._z+this._w*t._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let t=this.length();return t===0?(this._x=0,this._y=0,this._z=0,this._w=1):(t=1/t,this._x=this._x*t,this._y=this._y*t,this._z=this._z*t,this._w=this._w*t),this._onChangeCallback(),this}multiply(t){return this.multiplyQuaternions(this,t)}premultiply(t){return this.multiplyQuaternions(t,this)}multiplyQuaternions(t,e){const n=t._x,i=t._y,r=t._z,o=t._w,a=e._x,h=e._y,c=e._z,u=e._w;return this._x=n*u+o*a+i*c-r*h,this._y=i*u+o*h+r*a-n*c,this._z=r*u+o*c+n*h-i*a,this._w=o*u-n*a-i*h-r*c,this._onChangeCallback(),this}slerp(t,e){if(e===0)return this;if(e===1)return this.copy(t);const n=this._x,i=this._y,r=this._z,o=this._w;let a=o*t._w+n*t._x+i*t._y+r*t._z;if(a<0?(this._w=-t._w,this._x=-t._x,this._y=-t._y,this._z=-t._z,a=-a):this.copy(t),a>=1)return this._w=o,this._x=n,this._y=i,this._z=r,this;const h=1-a*a;if(h<=Number.EPSILON){const f=1-e;return this._w=f*o+e*this._w,this._x=f*n+e*this._x,this._y=f*i+e*this._y,this._z=f*r+e*this._z,this.normalize(),this}const c=Math.sqrt(h),u=Math.atan2(c,a),l=Math.sin((1-e)*u)/c,m=Math.sin(e*u)/c;return this._w=o*l+this._w*m,this._x=n*l+this._x*m,this._y=i*l+this._y*m,this._z=r*l+this._z*m,this._onChangeCallback(),this}slerpQuaternions(t,e,n){return this.copy(t).slerp(e,n)}random(){const t=2*Math.PI*Math.random(),e=2*Math.PI*Math.random(),n=Math.random(),i=Math.sqrt(1-n),r=Math.sqrt(n);return this.set(i*Math.sin(t),i*Math.cos(t),r*Math.sin(e),r*Math.cos(e))}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._w===this._w}fromArray(t,e=0){return this._x=t[e],this._y=t[e+1],this._z=t[e+2],this._w=t[e+3],this._onChangeCallback(),this}toArray(t=[],e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._w,t}fromBufferAttribute(t,e){return this._x=t.getX(e),this._y=t.getY(e),this._z=t.getZ(e),this._w=t.getW(e),this._onChangeCallback(),this}toJSON(){return this.toArray()}onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class Yn{x=0;y=0;constructor(t=0,e=0){this.x=t,this.y=e}get width(){return this.x}set width(t){this.x=t}get height(){return this.y}set height(t){this.y=t}set(t=0,e=0){return this.x=t,this.y=e,this}setScalar(t){return this.x=t,this.y=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+t)}}copy(t){return this.x=t.x,this.y=t.y,this}clone(){return new Yn(this.x,this.y)}add(t){return this.x+=t.x,this.y+=t.y,this}addScalar(t){return this.x+=t,this.y+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this}subScalar(t){return this.x-=t,this.y-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this}multiply(t){return this.x*=t.x,this.y*=t.y,this}multiplyScalar(t){return this.x*=t,this.y*=t,this}divide(t){return this.x/=t.x,this.y/=t.y,this}divideScalar(t){return this.multiplyScalar(1/t)}applyMatrix3(t){const e=this.x,n=this.y;return this.x=t.m11*e+t.m21*n+t.m31,this.y=t.m12*e+t.m22*n+t.m32,this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this}clamp(t,e){return this.x=N(this.x,t.x,e.x),this.y=N(this.y,t.y,e.y),this}clampScalar(t,e){return this.x=N(this.x,t,e),this.y=N(this.y,t,e),this}clampLength(t,e){const n=this.length();return this.divideScalar(n||1).multiplyScalar(N(n,t,e))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(t){return this.x*t.x+this.y*t.y}cross(t){return this.x*t.y-this.y*t.x}projectOnVector(t){const e=t.lengthSq();if(e===0)return this.set(0,0);const n=t.dot(this)/e;return this.copy(t).multiplyScalar(n)}perpendOnVector(t){return lc.copy(this).projectOnVector(t),this.sub(lc)}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}lengthSq(){return this.x*this.x+this.y*this.y}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(t){const e=Math.sqrt(this.lengthSq()*t.lengthSq());if(e===0)return Math.PI/2;const n=this.dot(t)/e;return Math.acos(N(n,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,n=this.y-t.y;return e*e+n*n}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this}lerpVectors(t,e,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this}equals(t){return t.x===this.x&&t.y===this.y}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this}rotateAround(t,e){const n=Math.cos(e),i=Math.sin(e),r=this.x-t.x,o=this.y-t.y;return this.x=r*n-o*i+t.x,this.y=r*i+o*n+t.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class zt{x=0;y=0;z=0;constructor(t=0,e=0,n=0){this.x=t,this.y=e,this.z=n}set(t=0,e=0,n=0){return this.x=t,this.y=e,this.z=n,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+t)}}clone(){return new zt(this.x,this.y,this.z)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this}multiplyVectors(t,e){return this.x=t.x*e.x,this.y=t.y*e.y,this.z=t.z*e.z,this}applyEuler(t){return this.applyQuaternion(fc.setFromEuler(t))}applyAxisAngle(t,e){return this.applyQuaternion(fc.setFromAxisAngle(t,e))}applyMatrix3(t){const e=this.x,n=this.y,i=this.z,r=t.value;return this.x=r[0]*e+r[3]*n+r[6]*i,this.y=r[1]*e+r[4]*n+r[7]*i,this.z=r[2]*e+r[5]*n+r[8]*i,this}applyNormalMatrix(t){return this.applyMatrix3(t).normalize()}applyMatrix4(t){const e=this.x,n=this.y,i=this.z,r=t.value,o=1/(r[3]*e+r[7]*n+r[11]*i+r[15]);return this.x=(r[0]*e+r[4]*n+r[8]*i+r[12])*o,this.y=(r[1]*e+r[5]*n+r[9]*i+r[13])*o,this.z=(r[2]*e+r[6]*n+r[10]*i+r[14])*o,this}applyQuaternion(t){const e=this.x,n=this.y,i=this.z,r=t.x,o=t.y,a=t.z,h=t.w,c=2*(o*i-a*n),u=2*(a*e-r*i),l=2*(r*n-o*e);return this.x=e+h*c+o*l-a*u,this.y=n+h*u+a*c-r*l,this.z=i+h*l+r*u-o*c,this}transformDirection(t){const e=this.x,n=this.y,i=this.z,r=t.value;return this.x=r[0]*e+r[4]*n+r[8]*i,this.y=r[1]*e+r[5]*n+r[9]*i,this.z=r[2]*e+r[6]*n+r[10]*i,this.normalize()}divide(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this}divideScalar(t){return this.multiplyScalar(1/t)}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this}clamp(t,e){return this.x=N(this.x,t.x,e.x),this.y=N(this.y,t.y,e.y),this.z=N(this.z,t.z,e.z),this}clampScalar(t,e){return this.x=N(this.x,t,e),this.y=N(this.y,t,e),this.z=N(this.z,t,e),this}clampLength(t,e){const n=this.length();return this.divideScalar(n||1).multiplyScalar(N(n,t,e))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this}lerpVectors(t,e,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this.z=t.z+(e.z-t.z)*n,this}cross(t){return this.crossVectors(this,t)}crossVectors(t,e){const n=t.x,i=t.y,r=t.z,o=e.x,a=e.y,h=e.z;return this.x=i*h-r*a,this.y=r*o-n*h,this.z=n*a-i*o,this}projectOnVector(t){const e=t.lengthSq();if(e===0)return this.set(0,0,0);const n=t.dot(this)/e;return this.copy(t).multiplyScalar(n)}perpendOnVector(t){return Or.copy(this).projectOnVector(t),this.sub(Or)}projectOnPlane(t){return this.perpendOnVector(t)}reflect(t){return this.sub(Or.copy(t).multiplyScalar(2*this.dot(t)))}angleTo(t){const e=Math.sqrt(this.lengthSq()*t.lengthSq());if(e===0)return Math.PI/2;const n=this.dot(t)/e;return Math.acos(N(n,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,n=this.y-t.y,i=this.z-t.z;return e*e+n*n+i*i}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)+Math.abs(this.z-t.z)}setFromMatrix4Position(t){const e=t.value;return this.x=e[12],this.y=e[13],this.z=e[14],this}setFromMatrix4Scale(t){const e=this.setFromMatrix4Column(t,0).length(),n=this.setFromMatrix4Column(t,1).length(),i=this.setFromMatrix4Column(t,2).length();return this.x=e,this.y=n,this.z=i,this}setFromMatrix4Column(t,e){return this.fromArray(t.value,e*4)}setFromMatrix3Column(t,e){return this.fromArray(t.value,e*3)}setFromEuler(t){return this.x=t.x,this.y=t.y,this.z=t.z,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const t=Math.random()*Math.PI*2,e=Math.random()*2-1,n=Math.sqrt(1-e*e);return this.x=n*Math.cos(t),this.y=e,this.z=n*Math.sin(t),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}class Rr{x=0;y=0;z=0;w=1;constructor(t=0,e=0,n=0,i=1){this.x=t,this.y=e,this.z=n,this.w=i}get width(){return this.z}set width(t){this.z=t}get height(){return this.w}set height(t){this.w=t}set(t=0,e=0,n=0,i=1){return this.x=t,this.y=e,this.z=n,this.w=i,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this.w=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setW(t){return this.w=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;case 3:this.w=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+t)}}clone(){return new Rr(this.x,this.y,this.z,this.w)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=t.w,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this.w+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this.w=t.w+e.w,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this.w+=t.w*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this.w-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this.w=t.w-e.w,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this.w*=t.w,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this}applyMatrix4(t){const e=this.x,n=this.y,i=this.z,r=this.w,o=t.value;return this.x=o[0]*e+o[4]*n+o[8]*i+o[12]*r,this.y=o[1]*e+o[5]*n+o[9]*i+o[13]*r,this.z=o[2]*e+o[6]*n+o[10]*i+o[14]*r,this.w=o[3]*e+o[7]*n+o[11]*i+o[15]*r,this}divide(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this.w/=t.w,this}divideScalar(t){return this.multiplyScalar(1/t)}setAxisAngleFromQuaternion(t){this.w=2*Math.acos(t.w);const e=Math.sqrt(1-t.w*t.w);return e<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=t.x/e,this.y=t.y/e,this.z=t.z/e),this}setAxisAngleFromRotationMatrix4(t){let e,n,i,r;const h=t.value,c=h[0],u=h[4],l=h[8],m=h[1],f=h[5],p=h[9],y=h[2],v=h[6],w=h[10];if(Math.abs(u-m)<.01&&Math.abs(l-y)<.01&&Math.abs(p-v)<.01){if(Math.abs(u+m)<.1&&Math.abs(l+y)<.1&&Math.abs(p+v)<.1&&Math.abs(c+f+w-3)<.1)return this.set(1,0,0,0),this;e=Math.PI;const x=(c+1)/2,b=(f+1)/2,E=(w+1)/2,C=(u+m)/4,L=(l+y)/4,B=(p+v)/4;return x>b&&x>E?x<.01?(n=0,i=.707106781,r=.707106781):(n=Math.sqrt(x),i=C/n,r=L/n):b>E?b<.01?(n=.707106781,i=0,r=.707106781):(i=Math.sqrt(b),n=C/i,r=B/i):E<.01?(n=.707106781,i=.707106781,r=0):(r=Math.sqrt(E),n=L/r,i=B/r),this.set(n,i,r,e),this}let _=Math.sqrt((v-p)*(v-p)+(l-y)*(l-y)+(m-u)*(m-u));return Math.abs(_)<.001&&(_=1),this.x=(v-p)/_,this.y=(l-y)/_,this.z=(m-u)/_,this.w=Math.acos((c+f+w-1)/2),this}setFromMatrix4Position(t){const e=t.value;return this.x=e[12],this.y=e[13],this.z=e[14],this.w=e[15],this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this.w=Math.min(this.w,t.w),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this.w=Math.max(this.w,t.w),this}clamp(t,e){return this.x=N(this.x,t.x,e.x),this.y=N(this.y,t.y,e.y),this.z=N(this.z,t.z,e.z),this.w=N(this.w,t.w,e.w),this}clampScalar(t,e){return this.x=N(this.x,t,e),this.y=N(this.y,t,e),this.z=N(this.z,t,e),this.w=N(this.w,t,e),this}clampLength(t,e){const n=this.length();return this.divideScalar(n||1).multiplyScalar(N(n,t,e))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}projectOnVector(t){const e=t.lengthSq();if(e===0)return this.set(0,0,0,1);const n=t.dot(this)/e;return this.copy(t).multiplyScalar(n)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this.w+=(t.w-this.w)*e,this}lerpVectors(t,e,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this.z=t.z+(e.z-t.z)*n,this.w=t.w+(e.w-t.w)*n,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z&&t.w===this.w}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this.w=t[e+3],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t[e+3]=this.w,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this.w=t.getW(e),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}const lc=new Yn,Or=new zt,fc=new Lr,Xn=2e3,zr=2001,dc=[1,0,0,1],mc=[1,0,0,1,0,0],pc=[1,0,0,0,1,0,0,0,1],gc=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];class Nr{value;constructor(t=dc){this.value=Array.from(t)}get m11(){return this.value[0]}get m12(){return this.value[1]}get m21(){return this.value[2]}get m22(){return this.value[3]}set m11(t){this.value[0]=t}set m12(t){this.value[1]=t}set m21(t){this.value[2]=t}set m22(t){this.value[3]=t}set(t=1,e=0,n=0,i=1){return this.m11=t,this.m21=e,this.m12=n,this.m22=i,this}identity(){return this.value=Array.from(dc),this}get isIdentity(){return this.m11==1&&this.m12==0&&this.m21==0&&this.m22==1}copy(t){return this.m11=t.m11,this.m12=t.m12,this.m21=t.m21,this.m22=t.m22,this}clone(){return new Nr(this.value)}fromArray(t,e=0){for(let n=0;n<4;n++)this.value[n]=t[n+e];return this}toArray(t=[],e=0){return t[e]=this.m11,t[e+1]=this.m12,t[e+2]=this.m21,t[e+3]=this.m22,t}multiplyMatrices(t,e){const n=t.value,i=e.value,r=this.value,o=n[0],a=n[2],h=n[1],c=n[3],u=i[0],l=i[2],m=i[1],f=i[3];return r[0]=o*u+a*m,r[2]=o*l+a*f,r[1]=h*u+c*m,r[3]=h*l+c*f,this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyScalar(t){return this.m11*=t,this.m12*=t,this.m21*=t,this.m22*=t,this}determinant(){return this.m11*this.m22-this.m21*this.m12}}class dn{value;constructor(t=pc){this.value=Array.from(t)}get m11(){return this.value[0]}get m12(){return this.value[1]}get m13(){return this.value[2]}get m21(){return this.value[3]}get m22(){return this.value[4]}get m23(){return this.value[5]}get m31(){return this.value[6]}get m32(){return this.value[7]}get m33(){return this.value[8]}set m11(t){this.value[0]=t}set m12(t){this.value[1]=t}set m13(t){this.value[2]=t}set m21(t){this.value[3]=t}set m22(t){this.value[4]=t}set m23(t){this.value[5]=t}set m31(t){this.value[6]=t}set m32(t){this.value[7]=t}set m33(t){this.value[8]=t}set(t=1,e=0,n=0,i=0,r=1,o=0,a=0,h=0,c=1){const u=this.value;return u[0]=t,u[1]=i,u[2]=a,u[3]=e,u[4]=r,u[5]=h,u[6]=n,u[7]=o,u[8]=c,this}identity(){return this.value=Array.from(pc),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}copy(t){return this.m11=t.m11,this.m12=t.m12,this.m13=t.m13,this.m21=t.m21,this.m22=t.m22,this.m23=t.m23,this.m31=t.m31,this.m32=t.m32,this.m33=t.m33,this}clone(){return new dn(this.value)}fromArray(t,e=0){for(let n=0;n<9;n++)this.value[n]=t[n+e];return this}toArray(t=[],e=0){return t[e]=this.m11,t[e+1]=this.m12,t[e+2]=this.m13,t[e+3]=this.m21,t[e+4]=this.m22,t[e+5]=this.m23,t[e+6]=this.m31,t[e+7]=this.m32,t[e+8]=this.m33,t}extractBasis(t,e,n){return t.setFromMatrix3Column(this,0),e.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}setFromMatrix4(t){return this.set(t.m11,t.m21,t.m31,t.m12,t.m22,t.m32,t.m13,t.m23,t.m33),this}multiplyMatrices(t,e){const n=t.value,i=e.value,r=this.value,o=n[0],a=n[3],h=n[6],c=n[1],u=n[4],l=n[7],m=n[2],f=n[5],p=n[8],y=i[0],v=i[3],w=i[6],_=i[1],x=i[4],b=i[7],E=i[2],C=i[5],L=i[8];return r[0]=o*y+a*_+h*E,r[3]=o*v+a*x+h*C,r[6]=o*w+a*b+h*L,r[1]=c*y+u*_+l*E,r[4]=c*v+u*x+l*C,r[7]=c*w+u*b+l*L,r[2]=m*y+f*_+p*E,r[5]=m*v+f*x+p*C,r[8]=m*w+f*b+p*L,this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyScalar(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}determinant(){const t=this.value,e=t[0],n=t[1],i=t[2],r=t[3],o=t[4],a=t[5],h=t[6],c=t[7],u=t[8];return e*o*u-e*a*c-n*r*u+n*a*h+i*r*c-i*o*h}invert(){const t=this.value,e=t[0],n=t[1],i=t[2],r=t[3],o=t[4],a=t[5],h=t[6],c=t[7],u=t[8],l=u*o-a*c,m=a*h-u*r,f=c*r-o*h,p=e*l+n*m+i*f;if(p===0)return this.set(0,0,0,0,0,0,0,0,0);const y=1/p;return t[0]=l*y,t[1]=(i*c-u*n)*y,t[2]=(a*n-i*o)*y,t[3]=m*y,t[4]=(u*e-i*h)*y,t[5]=(i*r-a*e)*y,t[6]=f*y,t[7]=(n*h-c*e)*y,t[8]=(o*e-n*r)*y,this}transpose(){let t;const e=this.value;return t=e[1],e[1]=e[3],e[3]=t,t=e[2],e[2]=e[6],e[6]=t,t=e[5],e[5]=e[7],e[7]=t,this}getNormalMatrix(t){return this.setFromMatrix4(t).invert().transpose()}transposeIntoArray(t){const e=this.value;return t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],this}setUvTransform(t,e,n,i,r,o,a){const h=Math.cos(r),c=Math.sin(r);return this.set(n*h,n*c,-n*(h*o+c*a)+o+t,-i*c,i*h,-i*(-c*o+h*a)+a+e,0,0,1),this}scale(t,e){return this.premultiply(Br.makeScale(t,e)),this}rotate(t){return this.premultiply(Br.makeRotation(-t)),this}translate(t,e){return this.premultiply(Br.makeTranslation(t,e)),this}makeTranslation(t,e){return typeof t=="number"?this.set(1,0,t,0,1,e,0,0,1):this.set(1,0,t.x,0,1,t.y,0,0,1),this}makeRotation(t){const e=Math.cos(t),n=Math.sin(t);return this.set(e,-n,0,n,e,0,0,0,1),this}makeScale(t,e){return this.set(t,0,0,0,e,0,0,0,1),this}equals(t){for(let e=0;e<9;e++)if(this.value[e]!==t.value[e])return!1;return!0}}class It{value;is3dSpecial=!1;constructor(t=gc){this.value=Array.from(t)}get m11(){return this.value[0]}get m12(){return this.value[1]}get m13(){return this.value[2]}get m14(){return this.value[3]}get m21(){return this.value[4]}get m22(){return this.value[5]}get m23(){return this.value[6]}get m24(){return this.value[7]}get m31(){return this.value[8]}get m32(){return this.value[9]}get m33(){return this.value[10]}get m34(){return this.value[11]}get m41(){return this.value[12]}get m42(){return this.value[13]}get m43(){return this.value[14]}get m44(){return this.value[15]}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}set(t=1,e=0,n=0,i=0,r=0,o=1,a=0,h=0,c=0,u=0,l=1,m=0,f=0,p=0,y=0,v=1){const w=this.value;return w[0]=t,w[4]=e,w[8]=n,w[12]=i,w[1]=r,w[5]=o,w[9]=a,w[13]=h,w[2]=c,w[6]=u,w[10]=l,w[14]=m,w[3]=f,w[7]=p,w[11]=y,w[15]=v,this}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(gc),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}copy(t){return this.m11=t.m11,this.m12=t.m12,this.m13=t.m13,this.m14=t.m14,this.m21=t.m21,this.m22=t.m22,this.m23=t.m23,this.m24=t.m24,this.m31=t.m31,this.m32=t.m32,this.m33=t.m33,this.m34=t.m34,this.m41=t.m41,this.m42=t.m42,this.m43=t.m43,this.m44=t.m44,this}clone(){return new It(this.value)}static fromString(t){const e=new It,n=ha("number",t);return n.length===16&&n.forEach((i,r)=>{i.fullMatch&&(e.value[r]=parseFloat(i.fullMatch))}),e}fromArray(t,e=0){for(let n=0;n<16;n++)this.value[n]=t[n+e];return this}toArray(t=[],e=0){const n=this.value;return t[e]=n[0],t[e+1]=n[1],t[e+2]=n[2],t[e+3]=n[3],t[e+4]=n[4],t[e+5]=n[5],t[e+6]=n[6],t[e+7]=n[7],t[e+8]=n[8],t[e+9]=n[9],t[e+10]=n[10],t[e+11]=n[11],t[e+12]=n[12],t[e+13]=n[13],t[e+14]=n[14],t[e+15]=n[15],t}copyPosition(t){const e=this.value,n=t.value;return e[12]=n[12],e[13]=n[13],e[14]=n[14],this}setFromMatrix3(t){const e=t.value;return this.set(e[0],e[3],e[6],0,e[1],e[4],e[7],0,e[2],e[5],e[8],0,0,0,0,1),this}extractBasis(t,e,n){return t.setFromMatrix4Column(this,0),e.setFromMatrix4Column(this,1),n.setFromMatrix4Column(this,2),this}makeBasis(t,e,n){return this.set(t.x,e.x,n.x,0,t.y,e.y,n.y,0,t.z,e.z,n.z,0,0,0,0,1),this}normalize(){return this.multiplyScalar(1/(this.m44||1e-4))}transformPoint(t){const e=t.z||1,n=t.w||1;return{x:t.x*this.m11+t.y*this.m21+e*this.m31+n*this.m41,y:t.x*this.m12+t.y*this.m22+e*this.m32+n*this.m42,z:t.x*this.m13+t.y*this.m23+e*this.m33+n*this.m43,w:t.x*this.m14+t.y*this.m24+e*this.m34+n*this.m44}}toMatrix(t){const{scalarX:e,scalarY:n,skewX:i,skewY:r,x:o,y:a}=this.split(),h=[e,r,i,n,o,a];return t?(t.value=h,t):new vt(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=>Z(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),n=Math.sqrt(this.m31*this.m31+this.m32*this.m32+this.m33*this.m33),i=Et(N(Math.asin(-this.m13),-1,1));let r=Et(Math.atan2(this.m23,this.m33));Math.cos(q(i))===0&&(r=Et(Math.atan2(-this.m31,this.m22)));let o=Et(Math.atan2(this.m12,this.m11));return this.m11<0&&this.m22>=0&&(o+=180),{x:this.m41,y:this.m42,z:this.m43,scalarX:t,scalarY:e,scalarZ:n,degreeX:r,degreeY:i,degreeZ:o,skewX:Et(this.m14),skewY:Et(this.m24),skewZ:Et(this.m34),skewW:this.m44,perspective:this.m34?-(1/this.m34):0}}extractRotation(t){const e=this.value,n=t.value,i=1/mn.setFromMatrix4Column(t,0).length(),r=1/mn.setFromMatrix4Column(t,1).length(),o=1/mn.setFromMatrix4Column(t,2).length();return e[0]=n[0]*i,e[1]=n[1]*i,e[2]=n[2]*i,e[3]=0,e[4]=n[4]*r,e[5]=n[5]*r,e[6]=n[6]*r,e[7]=0,e[8]=n[8]*o,e[9]=n[9]*o,e[10]=n[10]*o,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromEuler(t){const e=this.value,n=t.x,i=t.y,r=t.z,o=Math.cos(n),a=Math.sin(n),h=Math.cos(i),c=Math.sin(i),u=Math.cos(r),l=Math.sin(r);if(t.order==="XYZ"){const m=o*u,f=o*l,p=a*u,y=a*l;e[0]=h*u,e[4]=-h*l,e[8]=c,e[1]=f+p*c,e[5]=m-y*c,e[9]=-a*h,e[2]=y-m*c,e[6]=p+f*c,e[10]=o*h}else if(t.order==="YXZ"){const m=h*u,f=h*l,p=c*u,y=c*l;e[0]=m+y*a,e[4]=p*a-f,e[8]=o*c,e[1]=o*l,e[5]=o*u,e[9]=-a,e[2]=f*a-p,e[6]=y+m*a,e[10]=o*h}else if(t.order==="ZXY"){const m=h*u,f=h*l,p=c*u,y=c*l;e[0]=m-y*a,e[4]=-o*l,e[8]=p+f*a,e[1]=f+p*a,e[5]=o*u,e[9]=y-m*a,e[2]=-o*c,e[6]=a,e[10]=o*h}else if(t.order==="ZYX"){const m=o*u,f=o*l,p=a*u,y=a*l;e[0]=h*u,e[4]=p*c-f,e[8]=m*c+y,e[1]=h*l,e[5]=y*c+m,e[9]=f*c-p,e[2]=-c,e[6]=a*h,e[10]=o*h}else if(t.order==="YZX"){const m=o*h,f=o*c,p=a*h,y=a*c;e[0]=h*u,e[4]=y-m*l,e[8]=p*l+f,e[1]=l,e[5]=o*u,e[9]=-a*u,e[2]=-c*u,e[6]=f*l+p,e[10]=m-y*l}else if(t.order==="XZY"){const m=o*h,f=o*c,p=a*h,y=a*c;e[0]=h*u,e[4]=-l,e[8]=c*u,e[1]=m*l+y,e[5]=o*u,e[9]=f*l-p,e[2]=p*l-f,e[6]=a*u,e[10]=y*l+m}return e[3]=0,e[7]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromQuaternion(t){return this.compose(yg,t,wg)}lookAt(t,e,n){const i=this.value;return Nt.subVectors(t,e),Nt.lengthSq()===0&&(Nt.z=1),Nt.normalize(),Ae.crossVectors(n,Nt),Ae.lengthSq()===0&&(Math.abs(n.z)===1?Nt.x+=1e-4:Nt.z+=1e-4,Nt.normalize(),Ae.crossVectors(n,Nt)),Ae.normalize(),Fs.crossVectors(Nt,Ae),i[0]=Ae.x,i[4]=Fs.x,i[8]=Nt.x,i[1]=Ae.y,i[5]=Fs.y,i[9]=Nt.y,i[2]=Ae.z,i[6]=Fs.z,i[10]=Nt.z,this}multiplyMatrices(t,e){const n=t.value,i=e.value,r=this.value,o=n[0],a=n[4],h=n[8],c=n[12],u=n[1],l=n[5],m=n[9],f=n[13],p=n[2],y=n[6],v=n[10],w=n[14],_=n[3],x=n[7],b=n[11],E=n[15],C=i[0],L=i[4],B=i[8],F=i[12],$=i[1],G=i[5],J=i[9],st=i[13],K=i[2],Kt=i[6],Yt=i[10],$t=i[14],te=i[3],R=i[7],D=i[11],X=i[15];return r[0]=o*C+a*$+h*K+c*te,r[4]=o*L+a*G+h*Kt+c*R,r[8]=o*B+a*J+h*Yt+c*D,r[12]=o*F+a*st+h*$t+c*X,r[1]=u*C+l*$+m*K+f*te,r[5]=u*L+l*G+m*Kt+f*R,r[9]=u*B+l*J+m*Yt+f*D,r[13]=u*F+l*st+m*$t+f*X,r[2]=p*C+y*$+v*K+w*te,r[6]=p*L+y*G+v*Kt+w*R,r[10]=p*B+y*J+v*Yt+w*D,r[14]=p*F+y*st+v*$t+w*X,r[3]=_*C+x*$+b*K+E*te,r[7]=_*L+x*G+b*Kt+E*R,r[11]=_*B+x*J+b*Yt+E*D,r[15]=_*F+x*st+b*$t+E*X,this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyScalar(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}determinant(){const t=this.value,e=t[0],n=t[4],i=t[8],r=t[12],o=t[1],a=t[5],h=t[9],c=t[13],u=t[2],l=t[6],m=t[10],f=t[14],p=t[3],y=t[7],v=t[11],w=t[15];return p*(+r*h*l-i*c*l-r*a*m+n*c*m+i*a*f-n*h*f)+y*(+e*h*f-e*c*m+r*o*m-i*o*f+i*c*u-r*h*u)+v*(+e*c*l-e*a*f-r*o*l+n*o*f+r*a*u-n*c*u)+w*(-i*a*u-e*h*l+e*a*m+i*o*l-n*o*m+n*h*u)}transpose(){const t=this.value;let e;return e=t[1],t[1]=t[4],t[4]=e,e=t[2],t[2]=t[8],t[8]=e,e=t[6],t[6]=t[9],t[9]=e,e=t[3],t[3]=t[12],t[12]=e,e=t[7],t[7]=t[13],t[13]=e,e=t[11],t[11]=t[14],t[14]=e,this}setPosition(t,e,n){const i=this.value;return t instanceof zt?(i[12]=t.x,i[13]=t.y,i[14]=t.z):typeof t=="number"&&typeof e=="number"&&typeof n=="number"&&(i[12]=t,i[13]=e,i[14]=n),this}invert(){const t=this.value,e=t[0],n=t[1],i=t[2],r=t[3],o=t[4],a=t[5],h=t[6],c=t[7],u=t[8],l=t[9],m=t[10],f=t[11],p=t[12],y=t[13],v=t[14],w=t[15],_=l*v*c-y*m*c+y*h*f-a*v*f-l*h*w+a*m*w,x=p*m*c-u*v*c-p*h*f+o*v*f+u*h*w-o*m*w,b=u*y*c-p*l*c+p*a*f-o*y*f-u*a*w+o*l*w,E=p*l*h-u*y*h-p*a*m+o*y*m+u*a*v-o*l*v,C=e*_+n*x+i*b+r*E;if(C===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const L=1/C;return t[0]=_*L,t[1]=(y*m*r-l*v*r-y*i*f+n*v*f+l*i*w-n*m*w)*L,t[2]=(a*v*r-y*h*r+y*i*c-n*v*c-a*i*w+n*h*w)*L,t[3]=(l*h*r-a*m*r-l*i*c+n*m*c+a*i*f-n*h*f)*L,t[4]=x*L,t[5]=(u*v*r-p*m*r+p*i*f-e*v*f-u*i*w+e*m*w)*L,t[6]=(p*h*r-o*v*r-p*i*c+e*v*c+o*i*w-e*h*w)*L,t[7]=(o*m*r-u*h*r+u*i*c-e*m*c-o*i*f+e*h*f)*L,t[8]=b*L,t[9]=(p*l*r-u*y*r-p*n*f+e*y*f+u*n*w-e*l*w)*L,t[10]=(o*y*r-p*a*r+p*n*c-e*y*c-o*n*w+e*a*w)*L,t[11]=(u*a*r-o*l*r-u*n*c+e*l*c+o*n*f-e*a*f)*L,t[12]=E*L,t[13]=(u*y*i-p*l*i+p*n*m-e*y*m-u*n*v+e*l*v)*L,t[14]=(p*a*i-o*y*i-p*n*h+e*y*h+o*n*v-e*a*v)*L,t[15]=(o*l*i-u*a*i+u*n*h-e*l*h-o*n*m+e*a*m)*L,this}getMaxScaleOnAxis(){const t=this.value,e=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],n=t[4]*t[4]+t[5]*t[5]+t[6]*t[6],i=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(e,n,i))}makeTranslation(t,e,n){return t instanceof zt?this.set(1,0,0,t.x,0,1,0,t.y,0,0,1,t.z,0,0,0,1):this.set(1,0,0,t,0,1,0,e,0,0,1,n,0,0,0,1),this}makeRotationX(t){const e=Math.cos(t),n=Math.sin(t);return this.set(1,0,0,0,0,e,-n,0,0,n,e,0,0,0,0,1),this}makeRotationY(t){const e=Math.cos(t),n=Math.sin(t);return this.set(e,0,n,0,0,1,0,0,-n,0,e,0,0,0,0,1),this}makeRotationZ(t){const e=Math.cos(t),n=Math.sin(t);return this.set(e,-n,0,0,n,e,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(t,e){const n=Math.cos(e),i=Math.sin(e),r=1-n,o=t.x,a=t.y,h=t.z,c=r*o,u=r*a;return this.set(c*o+n,c*a-i*h,c*h+i*a,0,c*a+i*h,u*a+n,u*h-i*o,0,c*h-i*a,u*h+i*o,r*h*h+n,0,0,0,0,1),this}makeScale(t,e,n){return this.set(t,0,0,0,0,e,0,0,0,0,n,0,0,0,0,1),this}makeShear(t,e,n,i,r,o){return this.set(1,n,r,0,t,1,o,0,e,i,1,0,0,0,0,1),this}makePerspective(t,e,n,i,r,o,a=Xn){const h=this.value,c=2*r/(e-t),u=2*r/(n-i),l=(e+t)/(e-t),m=(n+i)/(n-i);let f,p;if(a===Xn)f=-(o+r)/(o-r),p=-2*o*r/(o-r);else if(a===zr)f=-o/(o-r),p=-o*r/(o-r);else throw new Error("Matrix4.makePerspective(): Invalid coordinate system: "+a);return h[0]=c,h[4]=0,h[8]=l,h[12]=0,h[1]=0,h[5]=u,h[9]=m,h[13]=0,h[2]=0,h[6]=0,h[10]=f,h[14]=p,h[3]=0,h[7]=0,h[11]=-1,h[15]=0,this}makeOrthographic(t,e,n,i,r,o,a=Xn){const h=this.value,c=1/(e-t),u=1/(n-i),l=1/(o-r),m=(e+t)*c,f=(n+i)*u;let p,y;if(a===Xn)p=(o+r)*l,y=-2*l;else if(a===zr)p=r*l,y=-1*l;else throw new Error("Matrix4.makeOrthographic(): Invalid coordinate system: "+a);return h[0]=2*c,h[4]=0,h[8]=0,h[12]=-m,h[1]=0,h[5]=2*u,h[9]=0,h[13]=-f,h[2]=0,h[6]=0,h[10]=y,h[14]=-p,h[3]=0,h[7]=0,h[11]=0,h[15]=1,this}compose(t,e,n){const i=this.value,r=e.x,o=e.y,a=e.z,h=e.w,c=r+r,u=o+o,l=a+a,m=r*c,f=r*u,p=r*l,y=o*u,v=o*l,w=a*l,_=h*c,x=h*u,b=h*l,E=n.x,C=n.y,L=n.z;return i[0]=(1-(y+w))*E,i[1]=(f+b)*E,i[2]=(p-x)*E,i[3]=0,i[4]=(f-b)*C,i[5]=(1-(m+w))*C,i[6]=(v+_)*C,i[7]=0,i[8]=(p+x)*L,i[9]=(v-_)*L,i[10]=(1-(m+y))*L,i[11]=0,i[12]=t.x,i[13]=t.y,i[14]=t.z,i[15]=1,this}decompose(t,e,n){const i=this.value;let r=mn.set(i[0],i[1],i[2]).length();const o=mn.set(i[4],i[5],i[6]).length(),a=mn.set(i[8],i[9],i[10]).length();this.determinant()<0&&(r=-r),t.x=i[12],t.y=i[13],t.z=i[14],Zt.copy(this);const c=1/r,u=1/o,l=1/a;return Zt.value[0]*=c,Zt.value[1]*=c,Zt.value[2]*=c,Zt.value[4]*=u,Zt.value[5]*=u,Zt.value[6]*=u,Zt.value[8]*=l,Zt.value[9]*=l,Zt.value[10]*=l,e.setFromRotationMatrix4(Zt),n.x=r,n.y=o,n.z=a,this}equals(t){for(let e=0;e<16;e++)if(this.value[e]!==t.value[e])return!1;return!0}translate(t=0,e=0,n=0){return this.multiply(new It([1,0,0,0,0,1,0,0,0,0,1,0,t,e,n,1]))}scale(t=1,e=1,n=1){return this.multiply(new It([t,0,0,0,0,e,0,0,0,0,n,0,0,0,0,1]))}scaleVector3(t){const e=this.value,n=t.x,i=t.y,r=t.z;return e[0]*=n,e[4]*=i,e[8]*=r,e[1]*=n,e[5]*=i,e[9]*=r,e[2]*=n,e[6]*=i,e[10]*=r,e[3]*=n,e[7]*=i,e[11]*=r,this}rotateX(t){const e=q(t),n=Math.cos(e),i=Math.sin(e);return this.multiply(new It([1,0,0,0,0,n,i,0,0,-i,n,0,0,0,0,1]))}rotateY(t){const e=q(t),n=Math.cos(e),i=Math.sin(e);return this.multiply(new It([n,0,-i,0,0,1,0,0,i,0,n,0,0,0,0,1]))}rotateZ(t){this.is3dSpecial=!0;const e=q(t),n=Math.cos(e),i=Math.sin(e);return this.multiply(new It([n,i,0,0,-i,n,0,0,0,0,1,0,0,0,0,1]))}skew(t=0,e=0,n=0){return this.multiply(new It([1,0,0,q(t),0,1,0,q(e),0,0,1,q(n),0,0,0,1]))}perspective(t){return this.multiply(new It([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,n=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,o=e+this.m31,a=n+this.m32,h=i+this.m33,c=r+this.m34;r==0&&(r=1e-4),e/=r,n/=r,i/=r,c==0&&(c=1e-4),o/=c,a/=c,h/=c;const u=h-i;if(u==0)return{x:e,y:n,z:i,mass:r};const l=-i/u;return e+=l*(o-e),n+=l*(a-n),{x:e,y:n,z:i,mass:r}}project(t){const e=t.z;let n=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),n/=r,i/=r,r<0&&(n-=this.m41,i-=this.m42,n*=1/r,i*=1/r,n+=this.m41,i+=this.m42),{x:n,y:i,z:e,mass:r}}bounds(t,e,n,i){const r=new Bs({x:t,y:e}),o=new Bs({x:t+n,y:e}),a=new Bs({x:t+n,y:e+i}),h=new Bs({x:t,y:e+i});({x:r.x,y:r.y,z:r.z,mass:r.mass}=this.project(r)),{x:o.x,y:o.y,z:o.z,mass:o.mass}=this.project(o),{x:a.x,y:a.y,z:a.z,mass:a.mass}=this.project(a),{x:h.x,y:h.y,z:h.z,mass:h.mass}=this.project(h);const c=Math.min(r.x,o.x,a.x,h.x),u=Math.min(r.y,o.y,a.y,h.y),l=Math.max(r.x,o.x,a.x,h.x)-c,m=Math.max(r.y,o.y,a.y,h.y)-u;return{x:c,y:u,width:l,height:m}}}class vt{value;_m13=0;_m23=0;_m33=1;matrix4;constructor(t=mc){this.value=Array.from(t),this.matrix4=this.toMatrix4()}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}static fromString(t){const e=new vt,n=ha("number",t);return n.length===6&&n.forEach((i,r)=>{i.fullMatch&&(e.value[r]=parseFloat(i.fullMatch))}),e}toMatrix4(t=this.matrix4){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 It(e)}identity(){return this.value=Array.from(mc),this.m13=0,this.m23=0,this.m33=1,this.matrix4=this.toMatrix4(),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}multiplyScalar(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.multiplyScalar(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 vt(this.value)}multiply(t){const e=this.clone(),n=t instanceof vt?t:new vt(t);return this.m11=n.m11*e.m11+n.m12*e.m21+n.m13*e.m31,this.m12=n.m11*e.m12+n.m12*e.m22+n.m13*e.m32,this.m13=n.m11*e.m13+n.m12*e.m23+n.m13*e.m33,this.m21=n.m21*e.m11+n.m22*e.m21+n.m23*e.m31,this.m22=n.m21*e.m12+n.m22*e.m22+n.m23*e.m32,this.m23=n.m21*e.m13+n.m22*e.m23+n.m23*e.m33,this.m31=n.m31*e.m11+n.m32*e.m21+n.m33*e.m31,this.m32=n.m31*e.m12+n.m32*e.m22+n.m33*e.m32,this.m33=n.m31*e.m13+n.m32*e.m23+n.m33*e.m33,this}append(t){return this.multiply(t)}prepend(t){return t.multiply(this),this}invert(){const t=this.m11,e=this.m12,n=this.m13,i=this.m21,r=this.m22,o=this.m23,a=this.m31,h=this.m32,c=this.m33,u=c*r-o*h,l=-c*i+o*a,m=h*i-r*a;let f=t*u+e*l+n*m;return f?(f=1/f,this.m11=u*f,this.m12=(-c*e+n*h)*f,this.m13=(o*e-n*r)*f,this.m21=l*f,this.m22=(c*t-n*a)*f,this.m23=(-o*t+n*i)*f,this.m31=m*f,this.m32=(-h*t+e*a)*f,this.m33=(r*t-e*i)*f,this):null}adjugate(){const t=new vt;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=Et(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:Et(Math.atan2(-this.m21,this.m22)),skewY:Et(Math.atan2(this.m12,this.m11))}}getGroupCoords(t){const e=this.value[0],n=this.value[1],i=this.value[2],r=this.value[3],o=this.value[4],a=this.value[5],h=t.value[0],c=t.value[1],u=t.value[2],l=t.value[3],m=t.value[4],f=t.value[5],p=h*l,y=c*u,v=(u*n-e*l)/(y-p),w=(h*n-e*c)/(p-y),_=(u*r-i*l)/(y-p),x=(h*r-i*c)/(p-y),b=(u*(a-f)+l*(m-o))/(y-p),E=(h*(a-f)+c*(m-o))/(p-y),C=[v,w,_,x,b,E];return new vt(C)}toString(t=6){return this.matrix4.is2D()?`matrix(${this.value.map(e=>Z(e,t)).join(",")})`:this.matrix4.toString()}translate(t,e){return this.multiply([1,0,0,1,t,e]),this.toMatrix4(),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.matrix4.translate(0,0,t),this.matrix4.toMatrix(this),this}translateZTo(t){return this.translateZ(t-this.matrix4.m43),this}translate3d(t,e,n){return this.matrix4.translate(t,e,n),this.matrix4.toMatrix(this),this}translate3dTo(t,e,n){return this.translate3d(t-this.matrix4.m41,e-this.matrix4.m42,n-this.matrix4.m43),this}rotate(t,e=0,n=0){const i=q(t),r=Math.cos(i),o=Math.sin(i);return this.translate(e,n),this.multiply([r,o,-o,r,0,0]),this.translate(-e,-n),this.toMatrix4(),this}rotateTo(t,e=0,n=0){const{degree:i}=this.split();return this.rotate(t-i,e,n),this}rotateX(t){return this.matrix4.rotateX(t),this.matrix4.toMatrix(this),this}rotateXTo(t){const{degreeX:e}=this.matrix4.split();return this.rotateX(t-e),this}rotateY(t){return this.matrix4.rotateY(t),this.matrix4.toMatrix(this),this}rotateYTo(t){const{degreeY:e}=this.matrix4.split();return this.rotateY(t-e),this}rotateZ(t){return this.matrix4.rotateZ(t),this.matrix4.toMatrix(this),this}rotateZTo(t){const{degreeZ:e}=this.matrix4.split();return this.rotateZ(t-e),this}rotate3d(t,e,n){return this.matrix4.rotateX(t).rotateY(e).rotateZ(n),this.matrix4.toMatrix(this),this}rotate3dTo(t,e,n){const{degreeX:i,degreeY:r,degreeZ:o}=this.matrix4.split();return this.rotate3d(t-i,e-r,n-o),this}scale(t,e=t,n=0,i=0){return this.translate(n,i),this.multiply([t,0,0,e,0,0]),this.translate(-n,-i),this.toMatrix4(),this}scaleTo(t,e=t,n=0,i=0){return this.scale(t/this.m11,e/this.m22,n,i)}scaleX(t){return this.scale(t,1)}scaleXTo(t){return this.scale(t/this.m11,1)}scaleY(t){return this.scale(1,t)}scaleYTo(t){return this.scale(1,t/this.m22)}scaleZ(t){return this.matrix4.scale(1,1,t),this.matrix4.toMatrix(this),this}scaleZTo(t){const{scalarZ:e}=this.matrix4.split();return this.scaleZ(t/e),this}scale3d(t,e=t,n=t){return this.matrix4.scale(t,e,n),this.matrix4.toMatrix(this),this}scale3dTo(t,e=t,n=t){const{scalarX:i,scalarY:r,scalarZ:o}=this.matrix4.split();return this.scale3d(t/i,e/r,n/o),this}skew(t,e=t){return this.multiply([Math.cos(q(e)),Math.sin(q(e)),-Math.sin(q(t)),Math.cos(q(t)),0,0]),this.toMatrix4(),this}skewTo(t,e=t){const{skewX:n,skewY:i}=this.split();return this.skew(t-n,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,n){return this}skew3dTo(t,e,n){return this}perspective(t){return this.matrix4.perspective(t),this.matrix4.toMatrix(this),this}}const yg=new zt(0,0,0),wg=new zt(1,1,1),Ae=new zt,Fs=new zt,Nt=new zt,mn=new zt,Br=new dn,Zt=new It;function Fr(s){const t=new vt;return s.replace(/([a-z0-9]+)\s*\(?\s*((-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)*[a-z%]*\s*,?\s*)+)\)?/gi,function(e,n,i){i.indexOf(",")>=0?i=i.split(/\s*,\s*/):i=i.split(/\s+/);const r=[];for(let o=0,a=i.length;o<a;o++)i[o].trim()&&r.push(parseFloat(""+i[o]));switch(n.toLowerCase()){case"t":case"translate":t.translate(r[0],r[1]);break;case"translatex":t.translateX(r[0]);break;case"translatey":t.translateY(r[0]);break;case"translatez":t.translateZ(r[0]);break;case"translate3d":t.translate3d(r[0],r[1],r[2]);break;case"r":case"rotate":t.rotate(r[0],r[1]??0,r[2]??0);break;case"rotatex":t.rotateX(r[0]);break;case"rotatey":t.rotateY(r[0]);break;case"rotatez":t.rotateZ(r[0]);break;case"rotate3d":t.rotate3d(r[0],r[1],r[2]);break;case"s":case"scale":t.scale(r[0],r[1]??r[0]);break;case"scalex":t.scaleX(r[0]);break;case"scaley":t.scaleY(r[0]);break;case"scalez":t.scaleZ(r[0]);break;case"scale3d":t.scale3d(r[0],r[1],r[2]);break;case"skew":t.skew(r[0],r[1]??0);break;case"skewx":t.skewX(r[0]);break;case"skewy":t.skewY(r[0]);break;case"skewz":t.skewZ(r[0]);break;case"skew3d":t.skew3d(r[0],r[1],r[2]);break;case"m":case"matrix":t.multiply([r[0],r[1],r[2],r[3],r[4],r[5]]),t.toMatrix4();break;case"matrix3d":t.matrix4.multiply(new It(r)),t.matrix4.toMatrix(t);break}return""}),t}function Qt(s,t,e){const n=new vt;return n.rotate(Et(s)),n.transformPoint({x:t,y:e})}function Yr(s){const t=typeof s?.x=="number"?s?.x:0,e=typeof s?.y=="number"?s?.y:0,n=typeof s?.degree=="number"?s?.degree:0,i=typeof s?.scalarX=="number"?s?.scalarX:1,r=typeof s?.scalarY=="number"?s?.scalarY:1,o=q(n),a=Math.cos(o),h=Math.sin(o),c=new DOMMatrix([a*i,h*i,-h*r,a*r,t,e]);return c.multiplySelf(new DOMMatrix(s?.originMatrix||"")),c}function xg(s,t){const e=new Path2D(s),n=new Path2D;return n.addPath(e,Yr(t)),n}function Ve(s,t,e){const n=Er(s);return n.props.style=n.props.style||{},t?n.props.style[t]||n.props.style[ua(t)]||n.props.style[wt(t)]||"":n.props.style}function Xr(s,t,e){Pr(s,n=>{n.props.style=n.props.style||{},typeof t=="string"&&e?n.props.style[t]=e:t instanceof Object&&Object.keys(t).forEach(i=>{n.props.style[i]=t[i]})}),Mr()}function Ur(s){const t={};if(getComputedStyle){const e=getComputedStyle(s);for(let n=0,i=e.length;n<i;n++)t[e[n]]=e.getPropertyValue(t[n])}else{const e=s.currentStyle;for(const n in e)t[n]=e[n]}return s.style.cssText&&s.style.cssText.split(";").filter(e=>!!e).forEach(e=>{const[n,i]=e.split(":");n&&i&&(t[n.trim()]=i.trim())}),t}function bg(s,t,e){let n=s.style[t]||"";if(!n&&getComputedStyle){t=wt(t);const i=getComputedStyle(s,e),r=i.getPropertyPriority(t);n=i.getPropertyValue(t).trim()+(r?"!"+r:"")}return n||(n=s.currentStyle[t]||""),n}function Ys(s,t,e){typeof t=="string"&&e?s.style.setProperty(wt(t),e.replace(/!important/i,""),e.toLowerCase().includes("!important")?"important":""):t instanceof Object&&Object.keys(t).forEach(n=>{Ys(s,n,t[n])})}function $r(s,t){typeof t=="string"?s.style.removeProperty(wt(t)):Object.keys(t).forEach(e=>{$r(s,e)})}function yc(s,t){let e;if(typeof t=="string"){const n=document.querySelector(t)?.shadowRoot;n?e=n:e=document.querySelector(t)}else e=t||document.getElementsByTagName("head")[0];if(e){const n=document.createElement("style");return n.innerHTML=s,e.appendChild(n),()=>{(e instanceof HTMLElement||e instanceof ShadowRoot)&&e.removeChild(n)}}else{const n=document.styleSheets[0].insertRule(s);return()=>{document.styleSheets[0].deleteRule(n)}}}function vg(s,t,e={}){Object.prototype.hasOwnProperty.call(e,"transform")||Object.assign(e,{transform:Ve(s,"transform")||""});const n=Fr(e.transform),i={};for(const r in t){const o=t[r];switch(r){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(e,r)||(e[r]=Ve(s,r)),Object.assign(i,{[r]:`${o}`});break}}return Object.assign(i,{transform:n.toString()}),i}function Ge(s,t,e){if(t===void 0&&e===void 0)return Vr(s);if(typeof t=="string"&&e===void 0)return wc(s,t);let n={};typeof t=="object"?n=t:typeof t=="string"&&typeof e=="string"&&(n[t]=""+e),Pr(s,i=>{Object.entries(n).forEach(([r,o])=>{i.props[r]=""+o})}),Mr()}const _g=["-o-","-ms-","-moz-","-webkit-",""];function Vr(s){const t={};for(let e=0,n=s.attributes,i=n.length;e<i;e++){const r=n[e];r.nodeName&&r.nodeValue&&(r.nodeName==="style"?t[r.nodeName]=Ur(s):t[r.nodeName]=r.nodeValue)}return t}function wc(s,t){return t==="style"?Ur(s):s.getAttribute(wt(t))}function pn(s,t,e){return s.setAttribute(wt(t),""+e)}function Sg(s,t){t.split(/[,\s]+/i).forEach(e=>{const n=wt(e.trim());n!=""&&s.removeAttribute(n)})}function xc(s,t){for(const e in t){const n=t[e];switch(e){case"fill":n!=="none"&&(s.fillStyle=n);break;case"stroke":n!=="none"&&(s.strokeStyle=n);break;case"stroke-width":case"strokeWidth":s.lineWidth=Number(n);break;case"stroke-linecap":case"strokeLinecap":s.lineCap=n;break;case"stroke-linejoin":case"strokeLinejoin":switch(n){case"round":case"bevel":case"miter":s.lineJoin=n;break;default:s.lineJoin="miter";break}break;case"stroke-miterlimit":case"strokeMiterlimit":s.miterLimit=Number(n);break;case"stroke-opacity":case"strokeOpacity":break;case"stroke-dashoffset":case"strokeDashoffset":s.lineDashOffset=Number(n);break;case"stroke-dasharray":case"strokeDasharray":typeof n=="string"&&s.setLineDash(n.split(/\s+/).map(i=>Number(i)));break;case"cursor":break;case"font":typeof n=="string"&&(s.font=n);break;case"font-size":case"fontSize":s.font+=` ${n}`;break;case"font-family":case"fontFamily":s.font+=` ${n}`;break;case"font-weight":case"fontWeight":break;case"font-style":case"fontStyle":break;case"text-anchor":case"textAnchor":switch(n){case"middle":s.textAlign="center";break;case"end":s.textAlign="end";break;case"start":s.textAlign="start";break}break;case"alignment-baseline":case"alignmentBaseline":switch(n){case"middle":case"bottom":case"top":case"alphabetic":case"hanging":case"ideographic":s.textBaseline=n;break;default:s.textBaseline="alphabetic";break}break}}}function Cg(s,t,e,n,i){const r=t/e;let o=0,a=0;switch(s){case"aspectFit":r>=1?(o=n,a=o/r,a>i&&(a=i,o=a*r)):(a=i,o=a*r,o>n&&(o=n,a=o/r));break;case"aspectFill":r>=1?(a=i,o=a*r):(o=n,a=o/r);break;case"widthFix":o=n,a=o/r;break;case"heightFix":a=i,o=a*r;break;case"scaleToFill":default:o=n,a=i;break}return{width:o,height:a}}function bc(s){try{const t=document.createElement("canvas"),e=t.getContext("2d");return t.width=s.width,t.height=s.height,e.drawImage(s,0,0,t.width,t.height),e.getImageData(0,0,t.width,t.height)}catch{return new ImageData(s.width,s.height)}}const Tg=s=>{const t=s.width,e=s.height,n=t*e*3,i=n+54,r=[66,77,i&255,i>>8&255,i>>16&255,i>>24&255,0,0,0,0,54,0,0,0],o=[40,0,0,0,t&255,t>>8&255,t>>16&255,t>>24&255,e&255,e>>8&255,e>>16&255,e>>24&255,1,0,24,0,0,0,0,0,n&255,n>>8&255,n>>16&255,n>>24&255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],a=(4-t*3%4)%4,h=s.data;let c="";const u=t<<2;let l=e;const m=String.fromCharCode;do{const p=u*(l-1);let y="";for(let v=0;v<t;v++){const w=v<<2;y+=m(h[p+w+2])+m(h[p+w+1])+m(h[p+w])}for(let v=0;v<a;v++)y+=String.fromCharCode(0);c+=y}while(--l);function f(p){if(!window.btoa)throw"btoa undefined";let y="";if(typeof p=="string")y=p;else for(let v=0;v<p.length;v++)y+=String.fromCharCode(p[v]);return btoa(y)}return f(r.concat(o))+f(c)};function Eg(s){const{width:t,height:e}=s,n=document.createElement("canvas"),i=n.getContext("2d");return n.width=t,n.height=e,i.putImageData(s,0,0,0,0,t,e),n.toDataURL("image/png")}const Pg=(s,t,e)=>{const{width:n,height:i}=s,r=document.createElement("canvas"),o=r.getContext("2d");r.width=n,r.height=i,o.putImageData(s,0,0,0,0,n,i);const a=`image/${t?t.toLowerCase():"png"}`;r.toBlob(h=>{e?.(null,h)},a,1)};function Mg(s,t){return createImageBitmap(s,t)}function Ag(s){const t=[],e=[],n=[];let i=0;for(let h=0,c=s.data.length;h<c;h+=4)t[i]=s.data[h],e[i]=s.data[h+1],n[i]=s.data[h+2],i+=1;const r=Gr(t),o=Gr(e),a=Gr(n);return"rgb("+r+","+o+","+a+")"}function Gr(s){const t={},e=[],n=[];for(let a=0;a<s.length;a++)t[s[a]]?e.push(s[a]):t[s[a]]=1;let i=0;for(let a=0;a<e.length;a++){i=0;for(let h=0;h<e.length;h++)e[a]===e[h]&&(i+=1),n[a]=i}const r=Math.max.apply(null,n);let o=0;for(;o<n.length;o++)if(n[o]===r)return;return e[o]}const kg=s=>{const{data:t,width:e,height:n}=s,i=new Uint8ClampedArray(t.length);for(let o=0;o<n;o++)for(let a=0;a<e;a++){const h=(o*e+a)*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,e,n)},Ig=s=>{const{data:t,width:e,height:n}=s,i=new Uint8ClampedArray(t.length);for(let o=0;o<n;o++)for(let a=0;a<e;a++){const h=(o*e+a)*4;i[h]=t[((n-o-1)*e+a)*4],i[h+1]=t[((n-o-1)*e+a)*4+1],i[h+2]=t[((n-o-1)*e+a)*4+2],i[h+3]=t[((n-o-1)*e+a)*4+3]}return new ImageData(i,e,n)},Dg=s=>{const{data:t,width:e,height:n}=s,i=new Uint8ClampedArray(t.length);for(let o=0;o<e;o++)for(let a=0;a<n;a++){const h=(o*n+a)*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,n,e)},Lg=s=>{const{data:t,width:e,height:n}=s,i=new Uint8ClampedArray(t.length);for(let o=0;o<e;o++)for(let a=0;a<n;a++){const h=(o*n+a)*4;i[h]=t[((n-a-1)*e+o)*4],i[h+1]=t[((n-a-1)*e+o)*4+1],i[h+2]=t[((n-a-1)*e+o)*4+2],i[h+3]=t[((n-a-1)*e+o)*4+3]}return new ImageData(i,n,e)},Rg=s=>{const{data:t,width:e,height:n}=s,i=new Uint8ClampedArray(t.length);for(let o=0;o<n;o++)for(let a=0;a<e;a++){const h=(o*e+a)*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,n)},Og=s=>{const{data:t,width:e,height:n}=s,i=new Uint8ClampedArray(t.length);for(let o=0;o<n;o++)for(let a=0;a<e;a++){const h=(o*e+a)*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,n)},zg=s=>{const{data:t,width:e,height:n}=s,i=new Uint8ClampedArray(t.length);for(let o=0;o<n;o++)for(let a=0;a<e;a++){const h=(o*e+a)*4,u=(t[h]+t[h+1]+t[h+2])/3>127?255:0;i[h]=u,i[h+1]=u,i[h+2]=u,i[h+3]=t[h+3]}return new ImageData(i,e,n)},Ng=s=>{const{data:t,width:e,height:n}=s,i=new Uint8ClampedArray(t.length);for(let o=0;o<n;o++)for(let a=0;a<e;a++){const h=(o*e+a)*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,n)},Bg=s=>{const{data:t,width:e,height:n}=s,i=new Uint8ClampedArray(t.length);for(let o=0;o<n;o++)for(let a=0;a<e;a++){const h=(o*e+a)*4;i[h]=t[h],i[h+1]=0,i[h+2]=0,i[h+3]=t[h+3]}return new ImageData(i,e,n)},Fg=s=>{const{data:t,width:e,height:n}=s,i=new Uint8ClampedArray(t.length);for(let o=0;o<n;o++)for(let a=0;a<e;a++){const h=(o*e+a)*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,n)},Yg=s=>{const{data:t,width:e,height:n}=s,i=new Uint8ClampedArray(t.length);for(let o=0;o<n;o++)for(let a=0;a<e;a++){const h=(o*e+a)*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,n)},Xg=s=>{const{data:t,width:e,height:n}=s,i=new Uint8ClampedArray(t.length);for(let o=0;o<n;o++)for(let a=0;a<e;a++){const h=(o*e+a)*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,n)},Ug=s=>{const{data:t,width:e,height:n}=s,i=new Uint8ClampedArray(t.length);for(let o=0;o<n;o++)for(let a=0;a<e;a++){const h=(o*e+a)*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,n)},$g=s=>{const{data:t,width:e,height:n}=s,i=new Uint8ClampedArray(t.length);for(let o=0;o<n;o++)for(let a=0;a<e;a++){const h=(o*e+a)*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,n)},Vg=s=>{const{data:t,width:e,height:n}=s,i=new Uint8ClampedArray(t.length);for(let o=0;o<n;o++)for(let a=0;a<e;a++){const h=(o*e+a)*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,n)},Gg=s=>{const{data:t,width:e,height:n}=s,i=new Uint8ClampedArray(t.length);for(let o=0;o<n;o++)for(let a=0;a<e;a++){const h=(o*e+a)*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,n)},qg=s=>{const{data:t,width:e,height:n}=s,i=new Uint8ClampedArray(t.length);for(let o=0;o<n;o++)for(let a=0;a<e;a++){const h=(o*e+a)*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,n)},jg=s=>vc(s,[-1,-1,-1,-1,9,-1,-1,-1,-1]),Hg=s=>vc(s,[-1,-1,-1,-1,8,-1,-1,-1,-1]),Wg=s=>{const{data:t,width:e,height:n}=s,i=new Uint8ClampedArray(t.length);for(let o=0;o<n;o++)for(let a=0;a<e;a++){const h=(o*e+a)*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,n)},Jg=s=>{const{data:t,width:e,height:n}=s,i=new Uint8ClampedArray(t.length);for(let o=0;o<n;o++)for(let a=0;a<e;a++){const h=(o*e+a)*4;if(t[h+3]===0)i[h]=255,i[h+1]=255,i[h+2]=255,i[h+3]=255;else{const c=_c([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,n)};function Zg(s,t,e,n,i,r=!1,o){const{data:a,width:h,height:c}=s;let u=i,l=n,m=t,f=e;if(u<0?u=0:u>h&&(u=h),l<0?l=0:l>c&&(l=c),m<1?m=1:m>h&&(m=h),f<1?f=1:f>c&&(f=c),u+m>h&&(m=h-u),l+f>c&&(f=c-l),r){const p=new Uint8ClampedArray(a.length);for(let v=0;v<c;v++)for(let w=0;w<h;w++){const _=(v*h+w)*4;w>=u&&w<=u+m&&v>=l&&v<=l+f?(p[_]=a[_],p[_+1]=a[_+1],p[_+2]=a[_+2],p[_+3]=a[_+3]):(p[_]=255,p[_+1]=255,p[_+2]=255,p[_+3]=o&&["JPG","JPEG"].includes(o.toUpperCase())?255:0)}return new ImageData(p,h,c)}else{const p=new Uint8ClampedArray(m*f*4);for(let v=l;v<=l+f;v++)for(let w=u;w<=u+m;w++){const _=((v-l)*m+w-u)*4,x=(v*h+w)*4;p[_]=a[x],p[_+1]=a[x+1],p[_+2]=a[x+2],p[_+3]=a[x+3]}return new ImageData(p,m,f)}}function Qg(s,t,e,n){const{data:i,width:r,height:o}=s;let a=t;a>Math.floor(r/2)&&(a=Math.floor(r/2)),a>Math.floor(o/2)&&(a=Math.floor(o/2)),a<0&&(a=0);const h=new Uint8ClampedArray(i.length);for(let u=0;u<o;u++)for(let l=0;l<r;l++){const m=(u*r+l)*4;let f=-1;l<a?u<a?f=Math.sqrt(Math.pow(a-l-1,2)+Math.pow(a-u-1,2)):u>o-a-1&&(f=Math.sqrt(Math.pow(a-l-1,2)+Math.pow(u-(o-a),2))):l>r-a-1&&(u<a?f=Math.sqrt(Math.pow(l-(r-a),2)+Math.pow(a-u-1,2)):u>o-a-1&&(f=Math.sqrt(Math.pow(l-(r-a),2)+Math.pow(u-(o-a),2)))),Math.round(f)>a?(h[m]=255,h[m+1]=255,h[m+2]=255,h[m+3]=n||e.toUpperCase()==="PNG"?0:255):(h[m]=i[m],h[m+1]=i[m+1],h[m+2]=i[m+2],h[m+3]=n||e.toUpperCase()==="PNG"?i[m+3]:255)}return new ImageData(h,r,o)}function Kg(s,t,e,n,i,r=1e4){const o=new Image;o.src=s;const a=document.createElement("canvas"),h=a.getContext("2d");return a.width=r,a.height=r,h.drawImage(o,0,0,t,e,0,0,n,i),h.getImageData(0,0,n,i)}function t0(s,t){const{data:e,width:n,height:i}=s,r=new Uint8ClampedArray(e.length);for(let a=0;a<i;a++)for(let h=0;h<n;h++){const c=(a*n+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,n,i)}function e0(s,t,e=!1){const{data:n,width:i,height:r}=s,o=new Uint8ClampedArray(n.length);for(let h=0;h<r;h++)for(let c=0;c<i;c++){const u=(h*i+c)*4;n[u+3]===0?(o[u]=255,o[u+1]=255,o[u+2]=255):(o[u]=n[u],o[u+1]=n[u+1],o[u+2]=n[u+2]);let l=n[u+3];e?l=Math.max(Math.min(Math.floor(255*t),255),0):l=Math.max(Math.min(Math.floor(l+255*t),255),0),o[u+3]=l}return new ImageData(o,i,r)}function n0(s,t,e,n){const{data:i,width:r,height:o}=s,{data:a,width:h,height:c}=t;let u=e,l=n;e+c>o&&(u=o-c),n+h>r&&(l=r-h);const m=new Uint8ClampedArray(i.length);for(let p=0;p<o;p++)for(let y=0;y<r;y++){const v=(p*r+y)*4;if(y<l||y>l+h||p<=u||p>=u+c)m[v]=i[v],m[v+1]=i[v+1],m[v+2]=i[v+2],m[v+3]=i[v+3];else{const w=(p*r+y-((u+1)*r+(p-(u+1))*(r-h))+h-l-1)*4,_=[a[w],a[w+1],a[w+2],a[w+3]],x=[i[v],i[v+1],i[v+2],i[v+3]],b=_c(_,x);m[v]=b[0],m[v+1]=b[1],m[v+2]=b[2],m[v+3]=b[3]}}return new ImageData(m,r,o)}function s0(s,t,e,n,i,r=10){const{data:o,width:a,height:h}=s;let c=i,u=n,l=t,m=e;c<0?c=0:c>a&&(c=a),u<0?u=0:u>h&&(u=h),l<1?l=1:l>a&&(l=a),m<1?m=1:m>h&&(m=h),c+l>a&&(l=a-c),u+m>h&&(m=h-u);const f=new Uint8ClampedArray(o.length);for(let y=0;y<h;y++)for(let v=0;v<a;v++){const w=(y*a+v)*4;if(v>=c&&v<=c+l&&y>=u&&y<=u+m){const _=Math.floor((v-c)/r),x=Math.floor((y-u)/r);let b=Math.floor(r*(_+1)-r/2+c),E=Math.floor(r*(x+1)-r/2+u);b>a-1&&(b=a-1),E>h-1&&(E=h-1);const C=(E*a+b)*4;f[w]=o[C],f[w+1]=o[C+1],f[w+2]=o[C+2],f[w+3]=o[C+3]}else f[w]=o[w],f[w+1]=o[w+1],f[w+2]=o[w+2],f[w+3]=o[w+3]}return new ImageData(f,a,h)}function i0(s,t,e={backgroundColor:{r:0,g:0,b:0,a:255},changeIntoColor:{r:0,g:0,b:0,a:0}}){if(t&&e){const{data:n,width:i,height:r}=s,{data:o}=t,a=new Uint8ClampedArray(n.length),{backgroundColor:h,changeIntoColor:c}=e;for(let l=0;l<r;l++)for(let m=0;m<i;m++){const f=(l*i+m)*4,p=o[f],y=o[f+1],v=o[f+2],w=o[f+3];p===h.r&&y===h.g&&v===h.b&&w===h.a&&c.a!==0?(a[f]=c.r,a[f+1]=c.g,a[f+2]=c.b,a[f+3]=c.a):(a[f]=n[f],a[f+1]=n[f+1],a[f+2]=n[f+2],a[f+3]=n[f+3])}return new ImageData(a,i,r)}return s}function vc(s,t){const{data:e,width:n,height:i}=s,r=new Uint8ClampedArray(e.length);for(let a=0;a<i;a++)for(let h=0;h<n;h++){const c=(a*n+h)*4;for(let u=0;u<3;u++){const l=c+u;h===0||h===n-1||a===0||a===i-1?r[l]=e[l]:r[l]=t[0]*e[l-n*4-4]+t[1]*e[l-n*4]+t[2]*e[l-n*4+4]+t[3]*e[l-4]+t[4]*e[l]+t[5]*e[l+4]+t[6]*e[l+n*4-4]+t[7]*e[l+n*4]+t[8]*e[l+n*4+4]}r[c+3]=e[c+3]}return new ImageData(r,n,i)}function _c(s,t){if(s&&s.length===4&&t&&t.length===4){const e=s[3],n=t[3];if(e===255||n===0)return s;if(e===0)return t;{const i=e/255,r=n/255,o=Math.max(Math.min(Math.floor(s[0]*i+t[0]*r*(1-i)),255),0),a=Math.max(Math.min(Math.floor(s[1]*i+t[1]*r*(1-i)),255),0),h=Math.max(Math.min(Math.floor(s[2]*i+t[2]*r*(1-i)),255),0),c=Math.max(Math.min(Math.floor((i+r*(1-i))*255),255),0);return[o,a,h,c]}}return[255,255,255,255]}const qr=function(){const s=[];return{writeByte(t){s.push(t&255)},writeShort(t){this.writeByte(t),this.writeByte(t>>>8)},writeBytes(t,e=0,n=t.length){for(let i=0;i<n;i++)this.writeByte(t[i+e])},writeString(t){for(let e=0,n=t.length;e<n;e++)this.writeByte(t.charCodeAt(e))},toByteArray(){return s},toString(){let t="[";for(let e=0,n=s.length;e<n;e++)e>0&&(t+=","),t+=s[e];return t+="]",t}}},Sc=function(){let s=0,t=0,e=0,n="";const i=function(o){if(!(o<0)){if(o<26)return 65+o;if(o<52)return 97+(o-26);if(o<62)return 48+(o-52);if(o==62)return 43;if(o==63)return 47}throw new Error("n:"+o)},r=function(o){n+=String.fromCharCode(i(o&63))};return{writeByte(o){for(s=s<<8|o&255,t+=8,e+=1;t>=6;)r(s>>>t-6),t-=6},flush(){if(t>0&&(r(s<<6-t),s=0,t=0),e%3!=0){const o=3-e%3;for(let a=0;a<o;a++)n+="="}},toString(){return n}}},Cc=function(s,t,e){const n=new Array(s*s),i=function(a){const h=a;let c=0,u=0;return{write(l,m){if(l>>>m)throw new Error("length over");for(;c+m>=8;)h.writeByte(255&(l<<c|u)),m-=8-c,l>>>=8-c,u=0,c=0;u=l<<c|u,c=c+m},flush(){c>0&&h.writeByte(u)}}},r=function(a){const h=1<<a,c=(1<<a)+1;let u=a+1;const l=o();for(let v=0;v<h;v++)l.add(String.fromCharCode(v));l.add(String.fromCharCode(h)),l.add(String.fromCharCode(c));const m=qr(),f=i(m);f.write(h,u);let p=0,y=String.fromCharCode(n[p]);for(p+=1;p<n.length;){const v=String.fromCharCode(n[p]);p+=1,l.contains(y+v)?y=y+v:(f.write(l.indexOf(y),u),l.size()<4095&&(l.size()==1<<u&&(u+=1),l.add(y+v)),y=v)}return f.write(l.indexOf(y),u),f.write(c,u),f.flush(),m.toByteArray()},o=function(){const a={};let h=0;return{add(c){if(this.contains(c))throw new Error("dup key:"+c);a[c]=h,h+=1},size(){return h},indexOf(c){return a[c]},contains(c){return typeof a[c]<"u"}}};return{setPixel(a,h,c){n[h*s+a]=c},write(a){a.writeString("GIF87a"),a.writeShort(s),a.writeShort(s),a.writeByte(128),a.writeByte(0),a.writeByte(0),a.writeByte(sn("0x"+t[1]+t[2])),a.writeByte(sn("0x"+t[3]+t[4])),a.writeByte(sn("0x"+t[5]+t[6])),a.writeByte(sn("0x"+e[1]+e[2])),a.writeByte(sn("0x"+e[3]+e[4])),a.writeByte(sn("0x"+e[5]+e[6])),a.writeString(","),a.writeShort(0),a.writeShort(0),a.writeShort(s),a.writeShort(s),a.writeByte(0);const h=2,c=r(h);a.writeByte(h);let u=0;for(;c.length-u>255;)a.writeByte(255),a.writeBytes(c,u,255),u+=255;a.writeByte(c.length-u),a.writeBytes(c,u,c.length-u),a.writeByte(0),a.writeString(";")}}},Tc=function(s,t,e,n){const i=Cc(s,t,e);for(let c=0;c<s;c++)for(let u=0;u<s;u++)i.setPixel(u,c,n(u,c));const r=qr();i.write(r);const o=Sc(),a=r.toByteArray();for(let c=0,u=a.length;c<u;c++)o.writeByte(a[c]);o.flush();let h="";return h+="data:image/gif;base64,",h+=o,h},Bt={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},Un={M:0,L:1,H:2,Q:3},ke={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},dt={glog:function(s){if(s<1)throw new Error("glog("+s+")");return dt.LOG_TABLE[s]},gexp:function(s){for(;s<0;)s+=255;for(;s>=256;)s-=255;return dt.EXP_TABLE[s]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)};for(let s=0;s<8;s++)dt.EXP_TABLE[s]=1<<s;for(let s=8;s<256;s++)dt.EXP_TABLE[s]=dt.EXP_TABLE[s-4]^dt.EXP_TABLE[s-5]^dt.EXP_TABLE[s-6]^dt.EXP_TABLE[s-8];for(let s=0;s<255;s++)dt.LOG_TABLE[dt.EXP_TABLE[s]]=s;const Q={PATTERN_POSITION_TABLE:[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],G15:1335,G18:7973,G15_MASK:21522,getBCHTypeInfo:function(s){let t=s<<10;for(;Q.getBCHDigit(t)-Q.getBCHDigit(Q.G15)>=0;)t^=Q.G15<<Q.getBCHDigit(t)-Q.getBCHDigit(Q.G15);return(s<<10|t)^Q.G15_MASK},getBCHTypeNumber:function(s){let t=s<<12;for(;Q.getBCHDigit(t)-Q.getBCHDigit(Q.G18)>=0;)t^=Q.G18<<Q.getBCHDigit(t)-Q.getBCHDigit(Q.G18);return s<<12|t},getBCHDigit:function(s){let t=0;for(;s!=0;)t++,s>>>=1;return t},getPatternPosition:function(s){return Q.PATTERN_POSITION_TABLE[s-1]},getMask:function(s,t,e){switch(s){case ke.PATTERN000:return(t+e)%2==0;case ke.PATTERN001:return t%2==0;case ke.PATTERN010:return e%3==0;case ke.PATTERN011:return(t+e)%3==0;case ke.PATTERN100:return(Math.floor(t/2)+Math.floor(e/3))%2==0;case ke.PATTERN101:return t*e%2+t*e%3==0;case ke.PATTERN110:return(t*e%2+t*e%3)%2==0;case ke.PATTERN111:return(t*e%3+(t+e)%2)%2==0;default:throw new Error("bad maskPattern:"+s)}},getErrorCorrectPolynomial:function(s){let t=new gn([1],0);for(let e=0;e<s;e++)t=t.multiply(new gn([1,dt.gexp(e)],0));return t},getLengthInBits:function(s,t){if(1<=t&&t<10)switch(s){case Bt.MODE_NUMBER:return 10;case Bt.MODE_ALPHA_NUM:return 9;case Bt.MODE_8BIT_BYTE:return 8;case Bt.MODE_KANJI:return 8;default:throw new Error("mode:"+s)}else if(t<27)switch(s){case Bt.MODE_NUMBER:return 12;case Bt.MODE_ALPHA_NUM:return 11;case Bt.MODE_8BIT_BYTE:return 16;case Bt.MODE_KANJI:return 10;default:throw new Error("mode:"+s)}else if(t<41)switch(s){case Bt.MODE_NUMBER:return 14;case Bt.MODE_ALPHA_NUM:return 13;case Bt.MODE_8BIT_BYTE:return 16;case Bt.MODE_KANJI:return 12;default:throw new Error("mode:"+s)}else throw new Error("type:"+t)},getLostPoint:function(s){const t=s.getModuleCount();let e=0;for(let r=0;r<t;r++)for(let o=0;o<t;o++){let a=0;const h=s.isDark(r,o);for(let c=-1;c<=1;c++)if(!(r+c<0||t<=r+c))for(let u=-1;u<=1;u++)o+u<0||t<=o+u||c==0&&u==0||h==s.isDark(r+c,o+u)&&a++;a>5&&(e+=3+a-5)}for(let r=0;r<t-1;r++)for(let o=0;o<t-1;o++){let a=0;s.isDark(r,o)&&a++,s.isDark(r+1,o)&&a++,s.isDark(r,o+1)&&a++,s.isDark(r+1,o+1)&&a++,(a==0||a==4)&&(e+=3)}for(let r=0;r<t;r++)for(let o=0;o<t-6;o++)s.isDark(r,o)&&!s.isDark(r,o+1)&&s.isDark(r,o+2)&&s.isDark(r,o+3)&&s.isDark(r,o+4)&&!s.isDark(r,o+5)&&s.isDark(r,o+6)&&(e+=40);for(let r=0;r<t;r++)for(let o=0;o<t-6;o++)s.isDark(o,r)&&!s.isDark(o+1,r)&&s.isDark(o+2,r)&&s.isDark(o+3,r)&&s.isDark(o+4,r)&&!s.isDark(o+5,r)&&s.isDark(o+6,r)&&(e+=40);let n=0;for(let r=0;r<t;r++)for(let o=0;o<t;o++)s.isDark(o,r)&&n++;const i=Math.abs(100*n/t/t-50)/5;return e+=i*10,e}};class gn{num;constructor(t,e){if(t.length==null)throw new Error(t.length+"/"+e);let n=0;for(;n<t.length&&t[n]==0;)n++;this.num=new Array(t.length-n+e);for(let i=0;i<t.length-n;i++)this.num[i]=t[i+n]}get(t){return this.num[t]}getLength(){return this.num.length}multiply(t){const e=new Array(this.getLength()+t.getLength()-1);for(let n=0;n<this.getLength();n++)for(let i=0;i<t.getLength();i++)e[n+i]^=dt.gexp(dt.glog(this.get(n))+dt.glog(t.get(i)));return new gn(e,0)}mod(t){if(this.getLength()-t.getLength()<0)return this;const e=dt.glog(this.get(0))-dt.glog(t.get(0)),n=new Array(this.getLength());for(let i=0;i<this.getLength();i++)n[i]=this.get(i);for(let i=0;i<t.getLength();i++)n[i]^=dt.gexp(dt.glog(t.get(i))+e);return new gn(n,0).mod(t)}}class de{totalCount;dataCount;constructor(t,e){this.totalCount=t,this.dataCount=e}static RS_BLOCK_TABLE=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]];static getRSBlocks(t,e){const n=de.getRsBlockTable(t,e);if(n==null)throw new Error("bad rs block @ typeNumber:"+t+"/errorCorrectLevel:"+e);const i=n.length/3,r=[];for(let o=0;o<i;o++){const a=n[o*3+0],h=n[o*3+1],c=n[o*3+2];for(let u=0;u<a;u++)r.push(new de(h,c))}return r}static getRsBlockTable(t,e){switch(e){case Un.L:return de.RS_BLOCK_TABLE[(t-1)*4+0];case Un.M:return de.RS_BLOCK_TABLE[(t-1)*4+1];case Un.Q:return de.RS_BLOCK_TABLE[(t-1)*4+2];case Un.H:return de.RS_BLOCK_TABLE[(t-1)*4+3];default:return}}}class Ec{buffer;length;constructor(){this.buffer=[],this.length=0}get(t){const e=Math.floor(t/8);return(this.buffer[e]>>>7-t%8&1)==1}put(t,e){for(let n=0;n<e;n++)this.putBit((t>>>e-n-1&1)==1)}getLengthInBits(){return this.length}putBit(t){const e=Math.floor(this.length/8);this.buffer.length<=e&&this.buffer.push(0),t&&(this.buffer[e]|=128>>>this.length%8),this.length++}}class r0{mode;data;constructor(t){this.mode=Bt.MODE_8BIT_BYTE,this.data=t}getLength(){return this.data.length}write(t){for(let e=0,n=this.data.length;e<n;e++)t.put(this.data.charCodeAt(e),8)}}class Ie{static PAD0=236;static PAD1=17;typeNumber;errorCorrectLevel;modules;moduleCount;dataCache;dataList;constructor(t,e){this.typeNumber=t,this.errorCorrectLevel=Un[e],this.modules=[],this.moduleCount=0,this.dataCache=null,this.dataList=[]}addData(t){const e=new r0(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=de.getRSBlocks(t,this.errorCorrectLevel),n=new Ec;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 o=this.dataList[r];n.put(o.mode,4),n.put(o.getLength(),Q.getLengthInBits(o.mode,t)),o.write(n)}if(n.getLengthInBits()<=i*8)break}this.typeNumber=t}this.makeImpl(!1,this.getBestMaskPattern())}makeImpl(t,e){this.moduleCount=this.typeNumber*4+17,this.modules=new Array(this.moduleCount);for(let n=0;n<this.moduleCount;n++){this.modules[n]=new Array(this.moduleCount);for(let i=0;i<this.moduleCount;i++)this.modules[n][i]=null}this.setupPositionProbePattern(0,0),this.setupPositionProbePattern(this.moduleCount-7,0),this.setupPositionProbePattern(0,this.moduleCount-7),this.setupPositionAdjustPattern(),this.setupTimingPattern(),this.setupTypeInfo(t,e),this.typeNumber>=7&&this.setupTypeNumber(t),this.dataCache==null&&(this.dataCache=Ie.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,e)}setupPositionProbePattern(t,e){for(let n=-1;n<=7;n++)if(!(t+n<=-1||this.moduleCount<=t+n))for(let i=-1;i<=7;i++)e+i<=-1||this.moduleCount<=e+i||(0<=n&&n<=6&&(i==0||i==6)||0<=i&&i<=6&&(n==0||n==6)||2<=n&&n<=4&&2<=i&&i<=4?this.modules[t+n][e+i]=!0:this.modules[t+n][e+i]=!1)}getBestMaskPattern(){let t=0,e=0;for(let n=0;n<8;n++){this.makeImpl(!0,n);const i=Q.getLostPoint(this);(n==0||t>i)&&(t=i,e=n)}return e}createMovieClip(t,e,n){const i=t.createEmptyMovieClip(e,n),r=1;this.make();for(let o=0;o<this.modules.length;o++){const a=o*r;for(let h=0;h<this.modules[o].length;h++){const c=h*r;this.modules[o][h]&&(i.beginFill(0,100),i.moveTo(c,a),i.lineTo(c+r,a),i.lineTo(c+r,a+r),i.lineTo(c,a+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=Q.getPatternPosition(this.typeNumber);for(let e=0;e<t.length;e++)for(let n=0;n<t.length;n++){const i=t[e],r=t[n];if(this.modules[i][r]==null)for(let o=-2;o<=2;o++)for(let a=-2;a<=2;a++)o==-2||o==2||a==-2||a==2||o==0&&a==0?this.modules[i+o][r+a]=!0:this.modules[i+o][r+a]=!1}}setupTypeNumber(t){const e=Q.getBCHTypeNumber(this.typeNumber);for(let n=0;n<18;n++){const i=!t&&(e>>n&1)==1;this.modules[Math.floor(n/3)][n%3+this.moduleCount-8-3]=i}for(let n=0;n<18;n++){const i=!t&&(e>>n&1)==1;this.modules[n%3+this.moduleCount-8-3][Math.floor(n/3)]=i}}setupTypeInfo(t,e){const n=this.errorCorrectLevel<<3|e,i=Q.getBCHTypeInfo(n);for(let r=0;r<15;r++){const o=!t&&(i>>r&1)==1;r<6?this.modules[r][8]=o:r<8?this.modules[r+1][8]=o:this.modules[this.moduleCount-15+r][8]=o}for(let r=0;r<15;r++){const o=!t&&(i>>r&1)==1;r<8?this.modules[8][this.moduleCount-r-1]=o:r<9?this.modules[8][15-r-1+1]=o:this.modules[8][15-r-1]=o}this.modules[this.moduleCount-8][8]=!t}mapData(t,e){let n=-1,i=this.moduleCount-1,r=7,o=0;for(let a=this.moduleCount-1;a>0;a-=2)for(a==6&&a--;;){for(let h=0;h<2;h++)if(this.modules[i][a-h]==null){let c=!1;o<t.length&&(c=(t[o]>>>r&1)==1),Q.getMask(e,i,a-h)&&(c=!c),this.modules[i][a-h]=c,r--,r==-1&&(o++,r=7)}if(i+=n,i<0||this.moduleCount<=i){i-=n,n=-n;break}}}static createData(t,e,n){const i=de.getRSBlocks(t,e),r=new Ec;for(let a=0;a<n.length;a++){const h=n[a];r.put(h.mode,4),r.put(h.getLength(),Q.getLengthInBits(h.mode,t)),h.write(r)}let o=0;for(let a=0;a<i.length;a++)o+=i[a].dataCount;if(r.getLengthInBits()>o*8)throw new Error("code length overflow. ("+r.getLengthInBits()+">"+o*8+")");for(r.getLengthInBits()+4<=o*8&&r.put(0,4);r.getLengthInBits()%8!=0;)r.putBit(!1);for(;!(r.getLengthInBits()>=o*8||(r.put(Ie.PAD0,8),r.getLengthInBits()>=o*8));)r.put(Ie.PAD1,8);return Ie.createBytes(r,i)}static createBytes(t,e){let n=0,i=0,r=0;const o=new Array(e.length),a=new Array(e.length);for(let l=0;l<e.length;l++){const m=e[l].dataCount,f=e[l].totalCount-m;i=Math.max(i,m),r=Math.max(r,f),o[l]=new Array(m);for(let w=0;w<o[l].length;w++)o[l][w]=255&t.buffer[w+n];n+=m;const p=Q.getErrorCorrectPolynomial(f),v=new gn(o[l],p.getLength()-1).mod(p);a[l]=new Array(p.getLength()-1);for(let w=0;w<a[l].length;w++){const _=w+v.getLength()-a[l].length;a[l][w]=_>=0?v.get(_):0}}let h=0;for(let l=0;l<e.length;l++)h+=e[l].totalCount;const c=new Array(h);let u=0;for(let l=0;l<i;l++)for(let m=0;m<e.length;m++)l<o[m].length&&(c[u++]=o[m][l]);for(let l=0;l<r;l++)for(let m=0;m<e.length;m++)l<a[m].length&&(c[u++]=a[m][l]);return c}}const Pc=Math.ceil,$n=Math.floor,Mc=Math.round;function o0(s,t){const e=la(s),n=t?.ecc||"H",i=t?.size||256,r=-1,o=t?.padding||0,a=t?.color||"#000000",h=t?.background||"#ffffff",c=new Ie(r,n);c.addData(e),c.make();const u=c.getModuleCount(),l=(i-o*2)/u,m=o,f=i-o;return Tc(i,a,h,function(p,y){if(m<=p&&p<f&&m<=y&&y<f){const v=$n((p-m)/l),w=$n((y-m)/l);return c.isDark(w,v)?0:1}else return 1})}function a0(s,t){const e=t.x||0,n=t.y||0,i=la(s),r=t.ctx,o=t.ecc||"H",a=typeof t.size=="number"?$n(t.size):256,h=t.padding||0,c=-1,u=t.color||"#000000",l=t.background||"#ffffff",m=new Ie(c,o);m.addData(i),m.make();const f=m.getModuleCount(),p=(a-h*2)/f;r.fillStyle=l,r.fillRect(e,n,a,a);for(let y=0;y<f;y++)for(let v=0;v<f;v++){const w=Pc((v+1)*p)-$n(v*p),_=Pc((y+1)*p)-$n(y*p);r.fillStyle=m.isDark(y,v)?u:l,r.fillRect(e+Mc(v*p)+h,n+Mc(y*p)+h,w,_)}}const Xs=()=>{const s=navigator.userAgent.toLowerCase();let t="Unknown";return/iphone|ipad|ipod/i.test(s)?t="iOS":/android/i.test(s)?t="Android":/BlackBerry/i.test(s)?t="BlackBerry":/mac/i.test(s)?t="macOS":/win/i.test(s)?t="Windows":/linux/i.test(s)?t="Linux":/bsd/i.test(s)&&(t="BSD"),t.toLowerCase()};function h0(s=navigator.userAgent){let t="Unknown";if(/iPhone|iPad|iPod/i.test(s)){const e=s.match(/OS (\d+_\d+)/i);e&&(t=e[1].replace("_","."))}else if(/Android/i.test(s)){const e=s.match(/Android (\d+\.\d+)/i);e&&(t=e[1])}else if(/Mac OS X/i.test(s)){const e=s.match(/Mac OS X (\d+_\d+)/i);e&&(t=e[1].replace("_","."))}else if(/Windows NT/i.test(s)){const e=s.match(/Windows NT (\d+\.\d+)/i);e&&(t=e[1])}return t.toLowerCase()}function c0(s,t){const e=s.split("."),n=t.split(".");for(let i=0,r=e.length;i<r;i++){if(n.length==i)return 1;if(e[i]!=n[i])return e[i]>n[i]?1:-1}return e.length!=n.length?-1:0}function jr(){const s=navigator.userAgent.toLowerCase();let t="Unknown";return/opr/i.test(s)||/opera/i.test(s)?t="Opera":/chrome/i.test(s)?t="Chrome":/firefox/i.test(s)?t="Firefox":/safari/i.test(s)?t="Safari":/edge/i.test(s)?t="Edge":/msie|trident/i.test(s)?t="IE":/MicroMessenger/i.test(s)?t="Wechat":/alipay/i.test(s)&&(t="Ali"),t.toLowerCase()}const u0=()=>{const s=navigator.userAgent;let t="Unknown";if(/Chrome/.test(s)){const e=s.match(/Chrome\/(\d+\.\d+)/);e&&(t=e[1])}else if(/Firefox/.test(s)){const e=s.match(/Firefox\/(\d+\.\d+)/);e&&(t=e[1])}else if(/Safari/.test(s)){const e=s.match(/Version\/(\d+\.\d+)/);e&&(t=e[1])}else if(/Edge/.test(s)){const e=s.match(/Edge\/(\d+\.\d+)/);e&&(t=e[1])}else if(/MSIE|Trident/.test(s)){const e=s.match(/(?:MSIE|rv:)(\d+\.\d+)/);e&&(t=e[1])}return t};function l0(){return(navigator.browserLanguage||navigator.language).toLowerCase()}function f0(){return Intl.DateTimeFormat().resolvedOptions().timeZone.toLowerCase()}function Hr(){return Xs()==="ios"}function Ac(){return Xs()==="macos"}function d0(){return Hr()|Ac()}function kc(){return Xs()==="android"}function m0(){return Hr()||kc()}function Ic(){const s=window.navigator.userAgent,t=s.indexOf("MSIE ");if(t>0)return parseInt(s.substring(t+5,s.indexOf(".",t)),10);if(s.indexOf("Trident/")>0){const i=s.indexOf("rv:");return parseInt(s.substring(i+3,s.indexOf(".",i)),10)}const n=s.indexOf("Edge/");return n>0?parseInt(s.substring(n+5,s.indexOf(".",n)),10):-1}const p0=Ic()!==-1,g0=document.documentMode?document.documentMode===9:!1,y0=document.documentMode?document.documentMode===10:!1,w0=document.documentMode?document.documentMode===11:!1;function Dc(){return jr()==="wechat"}function Lc(){return jr()==="ali"}function x0(){return Dc()&&navigator.userAgent.match(/miniprogram/i)||window.__wxjs_environment==="miniprogram"}function b0(){return Lc()&&navigator.userAgent.match(/miniprogram/i)}const v0=typeof document<"u",Rc=typeof window<"u",_0=typeof history<"u",S0=Rc&&window.File&&window.FileReader&&window.FileList&&window.Blob,Oc=(()=>!!(Ct.Worker&&Ct.Blob&&Ct.Promise&&Ct.OffscreenCanvas&&Ct.OffscreenCanvasRenderingContext2D&&Ct.HTMLCanvasElement&&Ct.HTMLCanvasElement.prototype.transferControlToOffscreen&&Ct.URL&&Ct.URL.createObjectURL))(),C0=typeof Path2D=="function"&&typeof DOMMatrix=="function",zc=function(){if(!Ct.OffscreenCanvas)return!1;const s=new OffscreenCanvas(1,1),t=s.getContext("2d");t.fillRect(0,0,1,1);const e=s.transferToImageBitmap();try{t.createPattern(e,"no-repeat")}catch{return!1}return!0}(),T0=typeof HTMLElement=="object"?function(t){return t instanceof HTMLElement}:function(t){return t&&typeof t=="object"&&t.nodeType===1&&typeof t.nodeName=="string"},E0="webkit moz ms o".split(" ");function P0(){return"ontouchstart"in window||"ontouchend"in document||navigator.maxTouchPoints>0}const Us=new Yn,ct=new zt;function Vn(s,t){switch(t.constructor){case Float32Array:return s;case Uint32Array:return s/4294967295;case Uint16Array:return s/65535;case Uint8Array:return s/255;case Int32Array:return Math.max(s/2147483647,-1);case Int16Array:return Math.max(s/32767,-1);case Int8Array:return Math.max(s/127,-1);default:throw new Error("Invalid component type.")}}function Dt(s,t){switch(t.constructor){case Float32Array:return s;case Uint32Array:return Math.round(s*4294967295);case Uint16Array:return Math.round(s*65535);case Uint8Array:return Math.round(s*255);case Int32Array:return Math.round(s*2147483647);case Int16Array:return Math.round(s*32767);case Int8Array:return Math.round(s*127);default:throw new Error("Invalid component type.")}}class me{array;itemSize;count;normalized;updateRanges;version;constructor(t,e,n=!1){if(Array.isArray(t))throw new TypeError("BufferAttribute: array should be a Typed Array.");this.array=t,this.itemSize=e,this.count=t.length/e,this.normalized=n,this.updateRanges=[],this.version=0}_onChangeCallback(){}set needsUpdate(t){t===!0&&this.version++}addUpdateRange(t,e){this.updateRanges.push({start:t,count:e})}clearUpdateRanges(){this.updateRanges.length=0}copy(t){return this.array=Dl(t.array),this.itemSize=t.itemSize,this.count=t.count,this.normalized=t.normalized,this}copyAt(t,e,n){t*=this.itemSize,n*=e.itemSize;for(let i=0,r=this.itemSize;i<r;i++)this.array[t+i]=e.array[n+i];return this}copyArray(t){return this.array.set(t),this}applyMatrix3(t){if(this.itemSize===2)for(let e=0,n=this.count;e<n;e++)Us.fromBufferAttribute(this,e),Us.applyMatrix3(t),this.setXY(e,Us.x,Us.y);else if(this.itemSize===3)for(let e=0,n=this.count;e<n;e++)ct.fromBufferAttribute(this,e),ct.applyMatrix3(t),this.setXYZ(e,ct.x,ct.y,ct.z);return this}applyMatrix4(t){for(let e=0,n=this.count;e<n;e++)ct.fromBufferAttribute(this,e),ct.applyMatrix4(t),this.setXYZ(e,ct.x,ct.y,ct.z);return this}applyNormalMatrix(t){for(let e=0,n=this.count;e<n;e++)ct.fromBufferAttribute(this,e),ct.applyNormalMatrix(t),this.setXYZ(e,ct.x,ct.y,ct.z);return this}transformDirection(t){for(let e=0,n=this.count;e<n;e++)ct.fromBufferAttribute(this,e),ct.transformDirection(t),this.setXYZ(e,ct.x,ct.y,ct.z);return this}set(t,e=0){return this.array.set(t,e),this}getComponent(t,e){let n=this.array[t*this.itemSize+e];return this.normalized&&(n=Vn(n,this.array)),n}setComponent(t,e,n){return this.normalized&&(n=Dt(n,this.array)),this.array[t*this.itemSize+e]=n,this}getX(t){let e=this.array[t*this.itemSize];return this.normalized&&(e=Vn(e,this.array)),e}setX(t,e){return this.normalized&&(e=Dt(e,this.array)),this.array[t*this.itemSize]=e,this}getY(t){let e=this.array[t*this.itemSize+1];return this.normalized&&(e=Vn(e,this.array)),e}setY(t,e){return this.normalized&&(e=Dt(e,this.array)),this.array[t*this.itemSize+1]=e,this}getZ(t){let e=this.array[t*this.itemSize+2];return this.normalized&&(e=Vn(e,this.array)),e}setZ(t,e){return this.normalized&&(e=Dt(e,this.array)),this.array[t*this.itemSize+2]=e,this}getW(t){let e=this.array[t*this.itemSize+3];return this.normalized&&(e=Vn(e,this.array)),e}setW(t,e){return this.normalized&&(e=Dt(e,this.array)),this.array[t*this.itemSize+3]=e,this}setXY(t,e,n){return t*=this.itemSize,this.normalized&&(e=Dt(e,this.array),n=Dt(n,this.array)),this.array[t+0]=e,this.array[t+1]=n,this}setXYZ(t,e,n,i){return t*=this.itemSize,this.normalized&&(e=Dt(e,this.array),n=Dt(n,this.array),i=Dt(i,this.array)),this.array[t+0]=e,this.array[t+1]=n,this.array[t+2]=i,this}setXYZW(t,e,n,i,r){return t*=this.itemSize,this.normalized&&(e=Dt(e,this.array),n=Dt(n,this.array),i=Dt(i,this.array),r=Dt(r,this.array)),this.array[t+0]=e,this.array[t+1]=n,this.array[t+2]=i,this.array[t+3]=r,this}onChange(t){return this._onChangeCallback=t,this}clone(){return ma(this,this.array,this.itemSize,this.normalized).copy(this)}toJSON(){return{itemSize:this.itemSize,type:this.array.constructor.name,array:Array.from(this.array),normalized:this.normalized}}}class M0 extends me{constructor(t,e,n=!1){super(new Int8Array(t),e,n)}}class A0 extends me{constructor(t,e,n=!1){super(new Uint8Array(t),e,n)}}class k0 extends me{constructor(t,e,n=!1){super(new Uint8ClampedArray(t),e,n)}}class I0 extends me{constructor(t,e,n=!1){super(new Int16Array(t),e,n)}}class D0 extends me{constructor(t,e,n=!1){super(new Uint16Array(t),e,n)}}class L0 extends me{constructor(t,e,n=!1){super(new Int32Array(t),e,n)}}class R0 extends me{constructor(t,e,n=!1){super(new Uint32Array(t),e,n)}}class O0 extends me{constructor(t,e,n=!1){super(new Float32Array(t),e,n)}}const Nc={map:new Map,transform:function(s){if(zc)return s;if(this.map.has(s))return this.map.get(s);const t=new OffscreenCanvas(s.width,s.height);return t.getContext("2d")?.drawImage(s,0,0),this.map.set(s,t),t},clear:function(){this.map.clear()}};function z0(s,t,e){const n=new OffscreenCanvas(s,t),i=n.getContext("2d");if(i)return e(i),n.transferToImageBitmap()}function N0(s,t,e){const n=s.createPattern(Nc.transform(t),"no-repeat");if(n){const i=Yr(e);n.setTransform(i),s.fillStyle=n}}function Bc(s){return window.URL.createObjectURL(s)}function B0(s){return window.URL.revokeObjectURL(s)}function Fc(s){let t=!1,e;function n(){document.readyState==="loading"||t||(s(),e?.(),t=!0)}try{e=W(document,"DOMContentLoaded",n)}catch{e=W(window,"load",n)}return n(),()=>{t||e()}}function Yc(s){return W(window,"beforeunload",t=>{s(t)})}async function F0(s,t=6e4){return new Promise((e,n)=>{const i=document.createElement("script");i.type="text/javascript",i.async=!1,i.onload=o=>{clearTimeout(r),e(o),i.onerror=i.onload=null},i.onerror=o=>{clearTimeout(r),n(o)},i.src=s;const r=setTimeout(()=>{n("Timeout!")},t);document.body.appendChild(i)})}function $s(s,t){const e=document.createElement("a");e.style.visibility="hidden",e.download=t,typeof s=="string"?e.href=s:e.href=window.URL.createObjectURL(s),e.click()}async function Y0(s,t=document.getElementsByTagName("head")[0],e=6e4){return new Promise((n,i)=>{const r=document.createElement("link");r.setAttribute("type","text/css"),r.setAttribute("rel","stylesheet"),r.onload=a=>{clearTimeout(o),n(a),r.onerror=r.onload=null},r.onerror=a=>{clearTimeout(o),i(a)},r.setAttribute("href",s);const o=setTimeout(()=>{i("Timeout!")},e);t.appendChild(r)})}function X0(){return new Promise(s=>{const t=Array.from(document.querySelectorAll("link[rel=stylesheet]"));let e=document.styleSheets.length||0;const n=()=>e>=t.length?(s(),!0):!1;n()||t.forEach(i=>{i.onload=()=>{e+=1,n()}})})}const Xc=new rn;async function Uc(s,t=6e4){return new Promise((e,n)=>{const i=typeof s=="string"?s:Bc(s),r=Xc.get(i);if(r)return e(r);const o=setTimeout(()=>{n("Timeout!")},t),a=document.createElement("img");a.onload=()=>{clearTimeout(o),a.onerror=a.onload=null;const h=a.naturalWidth||a.width,c=a.naturalHeight||a.height,u={width:h,height:c,aspectRatio:h/c,element:a,imageData:bc(a)};Xc.set(i,u),e(u)},a.onerror=h=>{clearTimeout(o),n(h)},a.src=i})}async function $c(s=Xt.text,t=["*"]){const n=(await Ki(t))[0],i=await Mn(n,s);return{type:n.type,name:n.name,size:n.size,data:i}}async function U0(s=["image/*"]){const e=(await Ki(s))[0];if(!e.type.match(/image\/*/))return new Error("Not Image Type!");const n=await Mn(e,Xt.arraybuffer),i=vi(n),r=await Uc(i);return{type:e.type,name:e.name,size:e.size,data:n,width:r.width,height:r.height,aspectRatio:r.aspectRatio,imageData:r.imageData}}function $0(){return window.getSelection()?.toString()||""}function V0(s){document.getElementsByTagName("title")[0].innerText=s,document.title=s}function G0(s=200){"vibrate"in navigator?window.navigator.vibrate(s):console.error("Your device is not support vibrate on this browser.")}async function q0(s){if(navigator.clipboard)return await navigator.clipboard.writeText(s);{const t=document.createElement("textarea");return t.value=s,t.style.opacity="0",t.style.position="fixed",t.style.top="0",t.style.left="0",t.focus(),t.select(),document.execCommand("copy")}}function j0(s,t){window.scrollTo(s,t)}function H0(){let s=va,t=va;return"scrollRestoration"in window.history&&(window.history.scrollRestoration="manual",s=Yc(()=>{window.history.scrollRestoration="auto"}),t=Fc(()=>{window.history.scrollRestoration="manual"})),()=>{s(),t()}}function W0(s){return/(html|body)/i.test(s.tagName)||s===document.documentElement}const J0=s=>s===document.activeElement&&(s.type||s.href),Wr=function(){return parseFloat(getComputedStyle(document.documentElement).fontSize)};function Z0(s){return s*Wr()}function Q0(s){return s.parentElement?parseFloat(getComputedStyle(s.parentElement).fontSize):Wr()}const K0=s=>{let t=s;for(;t&&t.nodeType!==1&&t.parentElement;)t=t.parentElement;return t},ty=s=>s.parentElement,Jr=(s,t=[])=>!s||s.parentElement===null&&s.parentNode===null?t:Jr(s.parentElement,t.concat([s]));function ey(s){const t=Jr(s);for(let e=0,n=t.length;e<n;e++)if(/(auto|scroll)/.test(Ve(t[e],"overflow")+Ve(t[e],"overflow-y")+Ve(t[e],"overflow-x")))return t[e];return document.scrollingElement||document.documentElement}const ny=(s,t)=>s.contains?s!=t&&s.contains(t):!!(s.compareDocumentPosition(t)&16),sy=s=>Array.prototype.slice.call(s.parentElement?.children).filter(t=>t!==s),iy=s=>s.nextElementSibling,ry=s=>s.previousElementSibling,oy=(s,t)=>s.closest(t),ay=s=>s.shadowRoot,Gn=s=>s.tagName==="INPUT"||s instanceof HTMLInputElement,Zr=s=>s.tagName==="SELECT"||s instanceof HTMLSelectElement,hy=s=>s.tagName==="TEXTAREA"||s instanceof HTMLTextAreaElement,Qr=s=>Gn(s)&&s.getAttribute("type")==="checkbox",Kr=s=>Gn(s)&&s.getAttribute("type")==="radio",cy=s=>Gn(s)&&s.getAttribute("type")==="text",uy=s=>Gn(s)&&s.getAttribute("type")==="number";function ly(s,t){if(Zr(s)){const e=s.options;for(let n=0,i=e.length;n<i;n++)e[n].selected=e[n].value==t}}function fy(s,t){if(Kr(s)){const e=document.getElementsByName(s.name);for(let n=0,i=e.length;n<i;n++){const r=e[n];r.checked=r.value==t}}}function dy(s,t){Qr(s)&&(s.checked=t)}const qn=(s,t,e="append")=>{typeof t=="string"?s[e](Hc(t)):s[e](t)},Vc=function(s,t){if(typeof t=="string"){s.innerHTML=t;const e=Jc(s);e!=s&&(s=e)}else qn(t,"replaceWith")},Gc=function(s){Vc(s,"")},my=(s,t)=>{s.textContent=t},py=s=>{if(s instanceof SVGElement)return"";let t=s.innerText;if(!t){const e=s.querySelector("slot")?.assignedNodes()||[];let n=0;for(;!t&&n<=e.length-1;)"innerText"in e[n]&&(t=e[n].innerText),n++}return t},gy=s=>s.remove();function yy(s,t){Ve(s,"display")=="none"&&t===void 0||t===!0?qc(s):jc(s)}function qc(s){Xr(s,"display",s instanceof HTMLTableRowElement?"table-row":s instanceof HTMLTableCellElement?"table-cell":"block")}function jc(s){Xr(s,"display","none")}function to(s,t,e="toggle"){const n=t.split(/[,\s]+/);if(s.classList)n.forEach(i=>{const r=i.trim();r!==""&&s.classList[e](r)});else{const i=s.className.split(/ +/);let r=!1;n.forEach(o=>{const a=o.trim();if(a!==""){const h=i.indexOf(a);switch(e){case"add":h===-1&&(i.push(a),r=!0);break;case"remove":h!==-1&&(i.splice(h,1),r=!0);break;case"toggle":h===-1?i.push(a):i.splice(h,1),r=!0;break}}}),r&&Ge(s,"class",i.join(" ").replace(/^\s+/,"").replace(/\s+$/,""))}}function wy(s,t){to(s,t,"add")}function xy(s,t){to(s,t,"remove")}function by(s,t){return new RegExp("(?:^|\\s+)"+t+"(?:\\s+|$)").test(s.className)||!1}function Hc(s,t=!1){const e=document.createElement("template");return e.innerHTML=s,t&&e.content.childNodes.forEach(n=>{const i=Jc(n);i!=n&&e.content.replaceChild(i,n)}),e.content}function Wc(s){return document.createElement.call(document,s)}function vy(s){return document.createElementNS("http://www.w3.org/1999/xhtml",s)}function _y(s){return document.createTextNode.call(document,s)}function Jc(s){return s.tagName=="SCRIPT"&&(s=Zc(s)),s.querySelectorAll&&s.querySelectorAll("script").forEach(t=>{t.parentNode?.replaceChild(Zc(t),t)}),s}function Zc(s){const t=s.ownerDocument.createElement("script");t.text=s.text;const e=s.attributes;for(let n=0,i=e.length;n<i;n++)t.setAttribute(e[n].name,e[n].value);return t}function Sy(s,t="http://test.com/localstorage.html"){const e=document.createElement("iframe");e.src=t,document.body.append(e),setTimeout(function(){e.contentWindow?.postMessage(s,t)},4e3),setTimeout(function(){e.remove()},6e3)}function Cy(s){const t=new Proxy(window,{get(e,n,i){if(typeof n=="string"&&["open","location","document"].includes(n))throw new Error(`禁止访问 key: ${n}`);return n==="window"?t:Reflect.get(e,n,i)},set(e,n,i,r){return Reflect.set(e,n,i,r)}});new Function("window",`with(window) { ${s} }`)(t,null)}function eo(){return{x:0,y:0,isDown:!1}}function qe(){const s=eo(),t=eo();return{start:s,current:t,setStart:function(e,n){s.x=e.x,s.y=e.y,s.isDown=typeof n=="boolean"?n:typeof e.isDown=="boolean"?e.isDown:!1,this.setCurrent(e,n)},setCurrent:(e,n)=>{t.x=e.x,t.y=e.y,t.isDown=typeof n=="boolean"?n:typeof e.isDown=="boolean"?e.isDown:!1}}}function Vs(s=document.documentElement,t=!1){return U(s,"mousemove",t)}function Qc(s=document.documentElement,t=!1){return U(s,"mousedown",t)}function Kc(s=document.documentElement,t=!1){return U(s,"mouseup",t)}function Ty(s=document.documentElement,t=!1){return U(s,"mouseover",t)}function Ey(s=document.documentElement,t=!1){return U(s,"mouseout",t)}function Py(s=document.documentElement,t=!1){return U(s,"mouseenter",t)}function My(s=document.documentElement,t=!1){return U(s,"mouseleave",t)}function Ay(s=document.documentElement,t=!1){return U(s,"click",t)}function ky(s=document.documentElement,t=!1){return U(s,"dblclick",t)}function Iy(s=document.documentElement,t=!1){return U(s,"onwheel"in document.createElement("div")?"wheel":document.onmousewheel!==void 0?"mousewheel":"DOMMouseScroll",t)}function Dy(s=document.documentElement,t=!1){return U(s,"contextmenu",t)}function tu(s=document.documentElement,t=!1){return U(s,"touchmove",t)}function eu(s=document.documentElement,t=!1){return U(s,"touchstart",t)}function nu(s=document.documentElement,t=!1){return U(s,"touchend",t)}function su(s=document.documentElement,t=!1){return U(s,"touchcancel",t)}function no(s=document.documentElement,t=!1){return U(s,"pointermove",t)}function so(s=document.documentElement,t=!1){return U(s,"pointerdown",t)}function io(s=document.documentElement,t=!1){return U(s,"pointerup",t)}function ro(s=document.documentElement,t=!1){return U(s,"pointercancel",t)}function Ly(s=document.documentElement){const t=new tt(s);return nt(e=>{t.on("pan",e)},e=>{t.off("pan",e)})}function Ry(s=document.documentElement){const t=new tt(s);return nt(e=>{t.on("panmove",e)},e=>{t.off("panmove",e)})}function Oy(s=document.documentElement){const t=new tt(s);return nt(e=>{t.on("panstart",e)},e=>{t.off("panstart",e)})}function zy(s=document.documentElement){const t=new tt(s);return nt(e=>{t.on("panend",e)},e=>{t.off("panend",e)})}function Ny(s=document.documentElement){const t=new tt(s);return nt(e=>{t.on("pancancel",e)},e=>{t.off("pancancel",e)})}function By(s=document.documentElement){const t=new tt(s);return nt(e=>{t.on("panleft",e)},e=>{t.off("panleft",e)})}function Fy(s=document.documentElement){const t=new tt(s);return nt(e=>{t.on("panright",e)},e=>{t.off("panright",e)})}function Yy(s=document.documentElement){const t=new tt(s);return nt(e=>{t.on("panup",e)},e=>{t.off("panup",e)})}function Xy(s=document.documentElement){const t=new tt(s);return nt(e=>{t.on("pandown",e)},e=>{t.off("pandown",e)})}function Uy(s=document.documentElement){const t=new tt(s);return nt(e=>{t.on("pinch",e)},e=>{t.off("pinch",e)})}function $y(s=document.documentElement){const t=new tt(s);return nt(e=>{t.on("pinchin",e)},e=>{t.off("pinchin",e)})}function Vy(s=document.documentElement){const t=new tt(s);return nt(e=>{t.on("pinchout",e)},e=>{t.off("pinchout",e)})}function Gy(s=document.documentElement){const t=new tt(s);return nt(e=>{t.on("press",e)},e=>{t.off("press",e)})}function qy(s=document.documentElement){const t=new tt(s);return nt(e=>{t.on("rotate",e)},e=>{t.off("rotate",e)})}function jy(s=document.documentElement){const t=new tt(s);return nt(e=>{t.on("swipe",e)},e=>{t.off("swipe",e)})}function Hy(s=document.documentElement){const t=new tt(s);return nt(e=>{t.on("swipeleft",e)},e=>{t.off("swipeleft",e)})}function Wy(s=document.documentElement){const t=new tt(s);return nt(e=>{t.on("swiperight",e)},e=>{t.off("swiperight",e)})}function Jy(s=document.documentElement){const t=new tt(s);return nt(e=>{t.on("swipeup",e)},e=>{t.off("swipeup",e)})}function Zy(s=document.documentElement){const t=new tt(s);return nt(e=>{t.on("swipedown",e)},e=>{t.off("swipedown",e)})}function Qy(s=document.documentElement){const t=new tt(s);return nt(e=>{t.on("tap",e)},e=>{t.off("tap",e)})}function Ky(s=document.documentElement){const t=new tt(document.documentElement);return nt(e=>{const n=i=>{!i.target||s==i.target||s.contains(i.target)||e(i)};return t.on("tap",n),n},(e,n)=>{t.off("tap",n)})}function t1(s=document.documentElement,t=!1){return U(s,"transitionstart",t)}function e1(s=document.documentElement,t=!1){return U(s,"transitionend",t)}function n1(s=document.documentElement,t=!1){return U(s,"animationstart",t)}function s1(s=document.documentElement,t=!1){return U(s,"animationend",t)}function iu(s=document.documentElement,t=!1){return U(s,"drag",t)}function ru(s=document.documentElement,t=!1){return U(s,"dragstart",t)}function ou(s=document.documentElement,t=!1){return U(s,"dragend",t)}function au(s=document.documentElement,t=!1){return U(s,"drop",t)}function hu(s=document.documentElement,t=!1){return U(s,"dragenter",t)}function cu(s=document.documentElement,t=!1){return U(s,"dragleave",t)}function uu(s=document.documentElement,t=!1){return U(s,"dragover",t)}function lu(s=document.documentElement,t=!1){return U(s,"keydown",t)}function fu(s=document.documentElement,t=!1){return U(s,"keyup",t)}function i1(s=document.documentElement,t=!1){return U(s,"keypress",t)}function r1(s=document.documentElement,t){const e=t?.useMousePoint||qe();return Vs(s).pipe(rt(n=>(e.setCurrent(ft(n,s)),e)))}function o1(s=document.documentElement,t){const e=t?.useMousePoint||qe();return Vs(s).pipe(Pp(Qc(s).pipe(Xe(n=>{e.setStart(ft(n,s),!0),t?.start?.(n,e)})),()=>Kc(s).pipe(Xe(n=>{e.setCurrent(ft(n,s),!1),t?.end?.(n,e)}))),Cp(),rt(n=>(e.setCurrent(ft(n,s),!0),e)))}function a1(s=document.documentElement,t){const e=t?.useMousePoint||qe();return eu(s).pipe(Xe(n=>{const i=n.changedTouches[0];e.setStart(ft(i,s),!0),t?.start?.(i,e)}),Is(()=>tu(s).pipe(pr(mr(nu(s),su(s)).pipe(Xe(n=>{const i=n.changedTouches[0];e.setCurrent(ft(i,s),!1),t?.end?.(i,e)}))))),rt(n=>{const i=n.changedTouches[0];return e.setCurrent(ft(i,s),!0),e}))}function Gs(s=document.documentElement,t){const e=t?.useMousePoint||qe();return so(s).pipe(Xe(n=>{e.setStart(ft(n,s),!0),t?.start?.(n,e)}),Is(()=>no(s).pipe(pr(mr(io(s),ro(s)).pipe(Xe(n=>{e.setCurrent(ft(n,s),!1),t?.end?.(n,e)}))))),rt(n=>(e.setCurrent(ft(n,s),!0),e)))}function du(s=document.documentElement,t){const e=t?.useMousePoint||qe();return xp(Vs(s),so(s)).pipe(jh(n=>n instanceof PointerEvent?(e.setStart(ft(n,s),!0),t?.start?.(n,e),no(s).pipe(pr(mr(io(s),ro(s)).pipe(Xe(i=>{e.setCurrent(ft(i,s),!1),t?.end?.(i,e)}))))):n instanceof MouseEvent?Hm(n):Ah),rt(n=>(e.setCurrent(ft(n,s),n instanceof PointerEvent),e)))}function h1(s){return new et(t=>Gs(s,{start:()=>{t.next(0)},end:(n,i)=>{t.next(i.current.x-i.start.x)}}).subscribe(n=>{t.next(n.current.y-n.start.y)}).unsubscribe).pipe(_e())}function c1(s,t){pn(s,"draggable","true");const e=ru(s,!0).subscribe(r=>{Ce(r),Hh(r);const o=r.dataTransfer;o&&(o.effectAllowed="move",o.setData("text/plain","some-data")),t?.onStart?.(r)}),n=iu(s).subscribe(r=>{Ce(r),t?.onDrag?.(r)}),i=ou(s).subscribe(r=>{Ce(r),t?.onEnd?.(r)});return()=>{e.unsubscribe(),n.unsubscribe(),i.unsubscribe()}}function u1(s,t){const e=hu(s).subscribe(o=>{Ce(o),t?.onEnter?.(o)}),n=uu(s).subscribe(o=>{Ce(o);const a=o.dataTransfer;a&&(a.dropEffect="move"),t?.onOver?.(o)}),i=cu(s).subscribe(o=>{Ce(o),t?.onLeave?.(o)}),r=au(s).subscribe(o=>{Ce(o);const a=o.dataTransfer;if(!a){t?.onDrop?.(o,[]);return}t?.onDrop?.(o,[...a.files])});return()=>{e.unsubscribe(),n.unsubscribe(),i.unsubscribe(),r.unsubscribe()}}function mu(s=10){return U(window,"scroll",!0).pipe(Ep(s))}function l1(){return U(document,"visibilitychange",!0).pipe(rt(()=>document.visibilityState==="visible"),_e())}function f1(){return{screenWidth:window.screen.width,screenHeight:window.screen.height,screenX:window.screenX,screenY:window.screenY}}function jn(){const s=document.documentElement;return{clientWidth:s.clientWidth,clientHeight:s.clientHeight,clientTop:s.clientTop,clientLeft:s.clientLeft,scrollWidth:s.scrollWidth,scrollHeight:s.scrollHeight,scrollTop:s.scrollTop,scrollLeft:s.scrollLeft,offsetWidth:s.offsetWidth,offsetHeight:s.offsetHeight,offsetTop:s.offsetTop,offsetLeft:s.offsetLeft,offsetParent:s.offsetParent}}function d1(){const s=document.body;return{clientWidth:s.clientWidth,clientHeight:s.clientHeight,clientTop:s.clientTop,clientLeft:s.clientLeft,scrollWidth:s.scrollWidth,scrollHeight:s.scrollHeight,scrollTop:s.scrollTop,scrollLeft:s.scrollLeft,offsetWidth:s.offsetWidth,offsetHeight:s.offsetHeight,offsetTop:s.offsetTop,offsetLeft:s.offsetLeft,offsetParent:s.offsetParent}}function pu(){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 m1(){const{scrollWidth:s,scrollHeight:t}=jn();return{width:s,height:t}}function oo(s){const{top:t,left:e,width:n,height:i}=s.getBoundingClientRect(),{scrollLeft:r,scrollTop:o}=jn();return{x:e+r,y:t+o,width:n,height:i}}function p1(s){let t=s,e=0,n=0;for(;t!==null;)e+=t.offsetLeft,n+=t.offsetTop,t.offsetParent instanceof HTMLElement?t=t.offsetParent:t=null;return{x:e,y:n,width:s.offsetWidth,height:s.offsetHeight}}function gu(s){return s.getBoundingClientRect()}function g1(s){const t=s.getBoundingClientRect();return{x:s.offsetLeft,y:s.offsetTop,width:t.width||t.right-t.left,height:t.height||t.bottom-t.top}}function y1(){const{clientHeight:s,scrollTop:t,scrollHeight:e}=jn(),n=e-s;return n<=0?0:t/n*100}function w1(s){if("center"in s){const t=s.center,e=gu(s.target);return{x:t.x-e.x,y:t.y-e.y}}return{x:s.clientX,y:s.clientY}}function ao(s){if("center"in s)return s.center;if(typeof s.pageX=="number"&&typeof s.pageY=="number")return{x:s.pageX,y:s.pageY};const{scrollLeft:t,scrollTop:e}=jn();return{x:s.clientX+t,y:s.clientY+e}}function ft(s,t){const e={x:0,y:0};if(t){const n=ao(s),i=oo(t);e.x=N(n.x-i.x,0,i.width),e.y=N(n.y-i.y,0,i.height)}else{let n=0,i=0;if("currentTarget"in s&&s.currentTarget&&s.target&&s.currentTarget!=s.target){const r=s.currentTarget.getBoundingClientRect(),o=s.target.getBoundingClientRect();n=o.left-r.left,i=o.top-r.top}if("offsetX"in s)e.x=s.offsetX+n,e.y=s.offsetY+i;else{const r=ao(s),o=oo(s.target);e.x=N(r.x-o.x+n,0,o.width),e.y=N(r.y-o.y+i,0,o.height)}}return e}function x1(s){if(document.implementation.hasFeature("MouseEvents","2.0"))return s.button;switch(s.button){case 0:case 1:case 3:case 5:case 7:return 0;case 2:case 6:return 2;case 4:return 1}}const b1={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};function v1(s){if(s.key)return s.key;if(s.keyCode)return s.keyCode;if(s.which)return s.which}function yu(s,t){const e=t.ctrl||!1,n=t.shift||!1,i=t.alt||!1;return(e===s.metaKey||e===s.ctrlKey)&&n===s.shiftKey&&i===s.altKey&&t.keys.map(r=>r.toLowerCase()).includes(s.key.toLowerCase())}function wu(s){return lu(s.target||document||window).pipe(qh(t=>yu(t,s)),rt(t=>{t.stopPropagation(),t.preventDefault()}))}function _1(s){return fu(s.target||document||window).pipe(qh(t=>yu(t,s)),rt(t=>{t.stopPropagation(),t.preventDefault()}))}function xu(s={keys:["o"]},t=Xt.text){return wu(s).pipe(Is(async()=>await $c(t)))}async function S1(s={keys:["o"]},t=Xt.text){return Jm(xu(s,t))}async function bu(s,t){return new Promise(e=>{const n=new ResizeObserver(i=>{const r=s.getBoundingClientRect();t(r),e(()=>{n.unobserve(s)})});n.observe(s)})}function ho(s=document.documentElement,t){return new et(e=>{const n=s.getBoundingClientRect();let i=n.x,r=n.y,o=n.width,a=n.height;e.next(n);const h=new ResizeObserver(c=>{const u=s.getBoundingClientRect();(i!=u.x||r!=u.y||o!=u.width||a!=u.height)&&(i=u.x,r=u.y,o=u.width,a=u.height,e.next(u))});return h.observe(s,t),()=>{h.unobserve(s),h.disconnect()}})}function C1(){return U(window,"orientationchange"in window?"orientationchange":"resize").pipe(rt(s=>({width:s.target.innerWidth,height:s.target.innerHeight})),Se({width:window.innerWidth,height:window.innerHeight}))}function T1(){const s={x:0,y:0,dx:0,dy:0,dStartX:0,dStartY:0,isDown:!1},t={x:0,y:0,dx:0,dy:0,dStartX:0,dStartY:0,isDown:!1};return{mousePoint:t,setStartMousePoint:function(e,n){s.x=e.x,s.y=e.y,s.isDown=typeof n=="boolean"?n:!1,this.setCurrentMousePoint(e,n)},setCurrentMousePoint:(e,n)=>{const i=t.x,r=t.y;t.x=e.x,t.y=e.y,t.dx=t.x-i,t.dy=t.y-r,t.dStartX=t.x-s.x,t.dStartY=t.y-s.y,t.isDown=typeof n=="boolean"?n:!1}}}function E1(s=document.documentElement){const t=new fs,e=new tt(s);let n=[];const i=T1(),r=i.mousePoint,o=k=>{t.emit("mouseDown",k)},a=k=>{t.emit("mouseUp",k)},h=k=>{r.isDown||i.setCurrentMousePoint(ft(k,s)),t.emit("mouseMove",k)},c=k=>{t.emit("mouseOver",k)},u=k=>{t.emit("mouseOut",k)},l=k=>{t.emit("mouseEnter",k)},m=k=>{t.emit("mouseLeave",k)},f=k=>{t.emit("mouseClick",k)},p=k=>{t.emit("mouseDoubleClick",k)},y=k=>{t.emit("mouseWheel",k)},v=k=>{t.emit("mouseContextMenu",k)},w=k=>{t.emit("touchStart",k)},_=k=>{t.emit("touchEnd",k)},x=k=>{t.emit("touchCancel",k)},b=k=>{const at=k.changedTouches[0];r.isDown||i.setCurrentMousePoint(ft(at,s)),t.emit("touchMove",k)},E=k=>{t.emit("pointerDown",k)},C=k=>{t.emit("pointerUp",k)},L=k=>{t.emit("pointerCancel",k)},B=k=>{t.emit("pointerMove",k)},F=k=>{t.emit("pan",k)},$=k=>{t.emit("panStart",k)},G=k=>{t.emit("panMove",k)},J=k=>{t.emit("panEnd",k)},st=k=>{t.emit("panCancel",k)},K=k=>{t.emit("panLeft",k)},Kt=k=>{t.emit("panRight",k)},Yt=k=>{t.emit("panUp",k)},$t=k=>{t.emit("panDown",k)},te=k=>{t.emit("pinch",k)},R=k=>{t.emit("pinchin",k)},D=k=>{t.emit("pinchout",k)},X=k=>{t.emit("press",k)},H=k=>{t.emit("rotate",k)},At=k=>{t.emit("swipe",k)},ee=k=>{t.emit("swipeLeft",k)},ni=k=>{t.emit("swipeRight",k)},si=k=>{t.emit("swipeUp",k)},mt=k=>{t.emit("swipeDown",k)},re=k=>{t.emit("tap",k)},it=k=>{!k.target||s==k.target||s.contains(k.target)||t.emit("tapOutSide",k)},St=k=>{t.emit("transitionstart",k)},xn=k=>{t.emit("transitionend",k)},Ke=k=>{t.emit("animationstart",k)},tn=k=>{t.emit("animationend",k)};let Le={...s.getBoundingClientRect(),width:s.offsetWidth,height:s.offsetHeight};return{el:s,get rect(){return Le},mousePoint:r,eb:t,start:async function(){n.push(W(s,"mousedown",o)),n.push(W(s,"mouseup",a)),n.push(W(s,"mousemove",h)),n.push(W(s,"mouseover",c)),n.push(W(s,"mouseout",u)),n.push(W(s,"mouseenter",l)),n.push(W(s,"mouseleave",m)),n.push(W(s,"click",f)),n.push(W(s,"dblclick",p)),n.push(W(s,"onwheel"in document.createElement("div")?"wheel":document.onmousewheel!==void 0?"mousewheel":"DOMMouseScroll",y)),n.push(W(s,"contextmenu",v)),n.push(W(s,"touchstart",w)),n.push(W(s,"touchend",_)),n.push(W(s,"touchcancel",x)),n.push(W(s,"touchmove",b)),n.push(W(s,"pointerdown",E)),n.push(W(s,"pointerup",C)),n.push(W(s,"pointercancel",L)),n.push(W(s,"pointermove",B)),e.on("pan",F),e.on("panstart",$),e.on("panmove",G),e.on("panend",J),e.on("pancancel",st),e.on("panleft",K),e.on("panright",Kt),e.on("panup",Yt),e.on("pandown",$t),e.on("pinch",te),e.on("pinchin",R),e.on("pinchout",D),e.on("press",X),e.on("rotate",H),e.on("swipe",At),e.on("swipeleft",ee),e.on("swiperight",ni),e.on("swipeup",si),e.on("swipedown",mt),e.on("tap",re),n.push(W(document,"pointerdown",it)),n.push(W(s,"transitionstart",St)),n.push(W(s,"transitionend",xn)),n.push(W(s,"animationstart",Ke)),n.push(W(s,"animationend",tn));const k=await bu(s,at=>{Le=at,t.emit("resize",at)});n.push(k),n.push(vu(this,{start:at=>{i.setStartMousePoint(ft(at,s),!0)},move:at=>{i.setCurrentMousePoint(ft(at,s))},end:at=>{i.setCurrentMousePoint(ft(at,s),!1)}}))},end:()=>{t.removeAllListeners(),n.forEach(k=>k()),n=[],e.off("pan",F),e.off("panstart",$),e.off("panmove",G),e.off("panend",J),e.off("pancancel",st),e.off("panleft",K),e.off("panright",Kt),e.off("panup",Yt),e.off("pandown",$t),e.off("pinch",te),e.off("pinchin",R),e.off("pinchout",D),e.off("press",X),e.off("rotate",H),e.off("swipe",At),e.off("swipeleft",ee),e.off("swiperight",ni),e.off("swipeup",si),e.off("swipedown",mt),e.off("tap",re)}}}function vu(s,t){return _u(s,t)}function _u(s,t){const e=s.eb,n=o=>{e.on("pointerMove",r),e.on("pointerUp",i),e.on("pointerCancel",i),t?.start?.(o)},i=o=>{e.off("pointerMove",r),e.off("pointerUp",i),e.off("pointerCancel",i),t?.end?.(o)},r=o=>{t?.move?.(o)};return e.on("pointerDown",n),()=>e.off("pointerDown",n)}function P1(s,t){const e=s.eb,n=o=>{document.addEventListener("mousemove",r,!1),document.addEventListener("mouseup",i,!1),t?.start?.(o)},i=o=>{document.removeEventListener("mousemove",r,!1),document.removeEventListener("mouseup",i,!1),t?.end?.(o)},r=o=>{t?.move?.(o)};return e.on("mouseDown",n),()=>e.off("mouseDown",n)}function M1(s,t){const e=s.eb,n=o=>{e.on("touchMove",r),e.on("touchEnd",i),e.on("touchCancel",i);const a=o.changedTouches[0];t?.start?.(a)},i=o=>{e.off("touchMove",r),e.off("touchEnd",i),e.off("touchCancel",i);const a=o.changedTouches[0];t?.end?.(a)},r=o=>{const a=o.changedTouches[0];t?.move?.(a)};return e.on("touchStart",n),()=>e.off("touchStart",n)}let co=class{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=Jt(this.x,this.y,this.toX,this.toY);if(t===0){const e=Math.min(this.x,this.toX),n=Math.min(this.y,this.toY),i=Math.max(this.x,this.toX),r=Math.max(this.y,this.toY);return{x:e,y:n,width:i-e,height:r-n}}else{const e=Math.sin(t),n=Math.cos(t),i=n*this.x-e*this.y,r=n*this.toX-e*this.toY,o=n*this.y+e*this.x,a=n*this.toY+e*this.toX;return{x:Math.min(i,r),y:Math.min(o,a),width:Math.max(i,r)-Math.min(i,r),height:Math.max(o,a)-Math.min(o,a)}}}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,n=this.y,i=t.toX,r=t.toY,o=this.toX-e,a=t.x-i;if(!o&&!a)return null;const h=(this.toY-n)/o,c=(t.y-r)/a;if(o){if(!a)return{x:i,y:h*(i-e)+n}}else return{x:e,y:c*(e-i)+r};const u=(-c*i+r+h*e-n)/(h-c),l=h*(u-e)+n;return isNaN(u)||isNaN(l)?null:{x:u,y:l}}};class uo extends co{rx;ry;xAxisRotate;largeArcFlag;sweepFlag;constructor(t){super(t),this.rx=t.rx,this.ry=t.ry,this.xAxisRotate=typeof t?.xAxisRotate=="number"?t?.xAxisRotate:0,this.largeArcFlag=typeof t?.largeArcFlag=="number"?t?.largeArcFlag:1,this.sweepFlag=typeof t?.sweepFlag=="number"?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,n,i,r,o,a,h]=this.convert(this.x,this.y,this.toX,this.toY,this.rx,this.ry,this.xAxisRotate,this.largeArcFlag,this.sweepFlag);t.ellipse(e,n,i,r,o,a,h,!this.sweepFlag)}convert(t,e,n,i,r,o,a,h,c){const u=a/180*Math.PI,l=(t-n)/2,m=(e-i)/2,f=Math.cos(u)*l+Math.sin(u)*m,p=-Math.sin(u)*l+Math.cos(u)*m,y=f*f/(r*r)+p*p/(o*o);if(y>1){const G=Math.sqrt(y);throw r=G*r,o=G*o,new Error(`Radii are too small to build an arc. Correcting them to ${r}/${o}.`)}const v=Math.sqrt((r*r*o*o-r*r*p*p-o*o*f*f)/(r*r*p*p+o*o*f*f)),w=h!=c?1:-1,_=w*v*r*p/o,x=w*v*-o*f/r,b=(t+n)/2,E=(e+i)/2,C=Math.cos(u)*_-Math.sin(u)*x+b,L=Math.sin(u)*_+Math.cos(u)*x+E,B=(G,J,st,K)=>(G*K>=J*st?1:-1)*Math.acos((G*st+J*K)/(Math.sqrt(G*G+J*J)*Math.sqrt(st*st+K*K))),F=B(1,0,t-C,e-L)-u,$=B(t-C,e-L,n-C,i-L);return[C,L,r,o,u,F,F+$]}}class A1 extends co{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,n=this.cy*2-(this.y+this.toY)/2;t.quadraticCurveTo(e,n,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 n,i,r,o;for(let c=0;c<2;++c)n=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(n)>1e-12&&(o=-i/(2*n),0<o&&o<1&&[t,e][c].push(n*o*o+i*o+r));const a={x:Math.min(0,...t),y:Math.min(0,...e)},h={x:Math.max(0,...t),y:Math.max(0,...e)};return{x:a.x,y:a.y,width:h.x-a.x,height:h.y-a.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 k1=A1;class gt extends co{c1x;c1y;c2x;c2y;constructor(t){super(t),this.c1x=t.c1x,this.c1y=t.c1y,this.c2x=t.c2x,this.c2y=t.c2y}clone(){return new gt({x:this.x,y:this.y,c1x:this.c1x,c1y:this.c1y,c2x:this.c2x,c2y:this.c2y,toX:this.toX,toY:this.toY})}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),n=this.x-this.c1x,i=(-e+Math.sqrt(e*e-4*t*n))/2/t,r=(-e-Math.sqrt(e*e-4*t*n))/2/t;const o=[this.y,this.toY],a=[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),a.push(h.x),o.push(h.y),c.push({X:h.x,Y:h.y})),r>=0&&r<=1&&(h=this.interpolate(r),a.push(h.x),o.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),n=this.y-this.c1y,i=(-e+Math.sqrt(e*e-4*t*n))/2/t,r=(-e-Math.sqrt(e*e-4*t*n))/2/t,Math.abs(i)>1e12&&(i=.5),Math.abs(r)>1e12&&(r=.5),i>=0&&i<=1&&(h=this.interpolate(i),a.push(h.x),o.push(h.y),c.push({X:h.x,Y:h.y})),r>=0&&r<=1&&(h=this.interpolate(r),a.push(h.x),o.push(h.y),c.push({X:h.x,Y:h.y}));const u=[],l=c.length;for(let p=0;p<l;p++){for(let y=p+1;y<l;y++)c[p].X===c[y].X&&c[p].Y===c[y].Y&&(y=++p);u.push({X:c[p].X,Y:c[p].Y})}const m={x:Math.min(...a),y:Math.min(...o)},f={x:Math.max(...a),y:Math.max(...o)};return{x:m.x,y:m.y,width:f.x-m.x,height:f.y-m.y,dots:u}}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,n,i,r){const o=-3*e+9*n-9*i+3*r,a=t*o+6*e-12*n+6*i;return t*a-3*e+3*n}static bezlen(t,e,n,i,r,o,a,h,c=1){c=Math.max(0,Math.min(c,1));const u=c/2,l=[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816],m=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472];let f=0;for(let p=0;p<12;p++){const y=u*l[p]+u,v=gt.base3(y,t,n,r,a),w=gt.base3(y,e,i,o,h);f+=m[p]*Math.sqrt(v*v+w*w)}return u*f}length(t=1){return gt.bezlen(this.x,this.y,this.c1x,this.c1y,this.c2x,this.c2y,this.toX,this.toY,t)}getTatLen(t){const e=this.x,n=this.y,i=this.c1x,r=this.c1y,o=this.c2x,a=this.c2y,h=this.toX,c=this.toY;if(t<0||gt.bezlen(e,n,i,r,o,a,h,c)<t)return 0;const u=1;let l=u/2,m=u-l,f=gt.bezlen(e,n,i,r,o,a,h,c,m);for(;Math.abs(f-t)>.01;)l/=2,m+=(f<t?1:-1)*l,f=gt.bezlen(e,n,i,r,o,a,h,c,m);return m}getPointAtSegmentLength(t){const e=this.getTatLen(t),n=1-e,i=Math.pow(n,3),r=Math.pow(n,2),o=e*e,a=o*e,h=i*this.x+r*3*e*this.c1x+n*3*e*e*this.c2x+a*this.toX,c=i*this.y+r*3*e*this.c1y+n*3*e*e*this.c2y+a*this.toY,u=this.x+2*e*(this.c1x-this.x)+o*(this.c2x-2*this.c1x+this.x),l=this.y+2*e*(this.c1y-this.y)+o*(this.c2y-2*this.c1y+this.y),m=this.c1x+2*e*(this.c2x-this.c1x)+o*(this.toX-2*this.c2x+this.c1x),f=this.c1y+2*e*(this.c2y-this.c1y)+o*(this.toY-2*this.c2y+this.c1y),p=n*this.x+e*this.c1x,y=n*this.y+e*this.c1y,v=n*this.c2x+e*this.toX,w=n*this.c2y+e*this.toY,_=90-Math.atan2(u-m,l-f)*180/Math.PI;return{x:h,y:c,m:{x:u,y:l},n:{x:m,y:f},start:{x:p,y},end:{x:v,y:w},alpha:_}}}const Hn=Math.PI*2;function Su(s,t,e,n){const i=s*n-t*e<0?-1:1;let r=s*e+t*n;return r>1&&(r=1),r<-1&&(r=-1),i*Math.acos(r)}function I1(s,t,e,n,i,r,o,a,h,c){const u=c*(s-e)/2+h*(t-n)/2,l=-h*(s-e)/2+c*(t-n)/2,m=o*o,f=a*a,p=u*u,y=l*l;let v=m*f-m*y-f*p;v<0&&(v=0),v/=m*y+f*p,v=Math.sqrt(v)*(i===r?-1:1);const w=v*o/a*l,_=v*-a/o*u,x=c*w-h*_+(s+e)/2,b=h*w+c*_+(t+n)/2,E=(u-w)/o,C=(l-_)/a,L=(-u-w)/o,B=(-l-_)/a,F=Su(1,0,E,C);let $=Su(E,C,L,B);return r===0&&$>0&&($-=Hn),r===1&&$<0&&($+=Hn),[x,b,F,$]}function D1(s,t){const e=1.3333333333333333*Math.tan(t/4),n=Math.cos(s),i=Math.sin(s),r=Math.cos(s+t),o=Math.sin(s+t);return[n,i,n-i*e,i+n*e,r+o*e,o-r*e,r,o]}function Cu(s,t,e,n,i,r,o,a,h){const c=Math.sin(h*Hn/360),u=Math.cos(h*Hn/360),l=u*(s-e)/2+c*(t-n)/2,m=-c*(s-e)/2+u*(t-n)/2;if(l===0&&m===0)return[];if(o===0||a===0)return[];o=Math.abs(o),a=Math.abs(a);const f=l*l/(o*o)+m*m/(a*a);f>1&&(o*=Math.sqrt(f),a*=Math.sqrt(f));const p=I1(s,t,e,n,i,r,o,a,c,u),y=[];let v=p[2],w=p[3];const _=Math.max(Math.ceil(Math.abs(w)/(Hn/4)),1);w/=_;for(let x=0;x<_;x++)y.push(D1(v,w)),v+=w;return y.map(x=>{for(let b=0;b<x.length;b+=2){let E=x[b+0],C=x[b+1];E*=o,C*=a;const L=u*E-c*C,B=c*E+u*C;x[b+0]=L+p[0],x[b+1]=B+p[1]}return x})}function lo(s,t,e,n,i,r){return[s/3+.6666666666666666*e,t/3+.6666666666666666*n,i/3+.6666666666666666*e,r/3+.6666666666666666*n,i,r]}function Wn(s,t,e,n){return[s,t,e,n,e,n]}const qs={a:7,c:6,s:4,q:4,t:2,m:2,l:2,h:1,v:1,z:0};function Tu(s="path",t){const e=document.createElementNS.call(document,"http://www.w3.org/2000/svg",s);return t&&Ge(e,t),e}function L1(s,t){return Tu("path",{d:s,id:t||hs()})}function R1(s,t="shape"){return $s(Qi(s),`${t}.svg`)}function Eu(s){return typeof s!="string"?!1:(s=s.trim(),/^[mlhvzaqtcs]\s*[-+.0-9][^mlhvzaqtcs]+/i.test(s)&&/[\dz]$/i.test(s))}function O1(s){return s.map(t=>{if(!t[0])return"";switch(t[0].toLowerCase()){case"a":return`${t[0]} ${t[1]},${t[2]} ${t[3]} ${t[4]},${t[5]} ${t[6]},${t[7]}`;case"c":return`${t[0]} ${t[1]},${t[2]} ${t[3]},${t[4]} ${t[5]},${t[6]}`;case"s":case"q":return`${t[0]} ${t[1]},${t[2]} ${t[3]},${t[4]}`;default:return t[0]+" "+t.slice(1).join(",")}}).join(" ")}function Pu(s){const t=[];return Eu(s)&&s.replace(/([mlhvzaqtcs])([^mlhvzaqtcs]*)/gi,(e,n,i)=>{let r=n.toLowerCase();const o=bi(i);for(r=="m"&&o.length>qs[r]&&(t.push([n,...o.splice(0,qs[r])]),r="l",n=n=="m"?"l":"L");o.length;){if(o.length<qs[r])throw new Error(`parseSVGPath substring:{ ${e} } command:{ ${n} } args:{ ${o} }`);t.push([n,...o.splice(0,qs[r])])}return r=="z"&&t.push([n]),""}),t}function Mu(s){let t=0,e=0,n=0,i=0;return s.map(function(r){const o=r[0],a=o.toUpperCase();if(o!=a)switch(r[0]=a,o){case"a":r[6]+=n,r[7]+=i;break;case"v":r[1]+=i;break;case"h":r[1]+=n;break;default:for(let h=1;h<r.length;)r[h++]+=n,r[h++]+=i}switch(a){case"Z":n=t,i=e;break;case"H":n=r[1];break;case"V":i=r[1];break;case"M":n=t=r[1],i=e=r[2];break;default:n=r[r.length-2],i=r[r.length-1]}return r})}function z1(s){const t=[];let e=0,n=0,i=0,r=0,o=0,a=0,h=0,c=0,u;for(let l=0,m=s.length;l<m;l++){let f=s[l];const p=f[0];switch(p){case"M":e=f[1],n=f[2];break;case"A":const y=Cu(i,r,f[6],f[7],f[4],f[5],f[1],f[2],f[3]);if(!y.length)continue;y.forEach((_,x)=>{const[b,E,C,L,B,F,$,G]=_;f=["C",C,L,B,F,$,G],x<y.length-1&&t.push(f)});break;case"S":let v=i,w=r;(u=="C"||u=="S")&&(v+=v-h,w+=w-c),f=["C",v,w,f[1],f[2],f[3],f[4]];break;case"T":u=="Q"||u=="T"?(o=i*2-o,a=r*2-a):(o=i,a=r),f=["C",...lo(i,r,o,a,f[1],f[2])];break;case"Q":o=f[1],a=f[2],f=["C",...lo(i,r,f[1],f[2],f[3],f[4])];break;case"L":f=["C",...Wn(i,r,f[1],f[2])];break;case"H":f=["C",...Wn(i,r,f[1],r)];break;case"V":f=["C",...Wn(i,r,i,f[1])];break;case"Z":f=["C",...Wn(i,r,e,n)];break}u=p,i=f[f.length-2],r=f[f.length-1],f.length>4?(h=f[f.length-4],c=f[f.length-3]):(h=i,c=r),t.push(f)}return t}class Jn{video;constructor(t){this.video=t}setSrcObject(t){this.video.addEventListener("loadedmetadata",e=>{e.target}),this.video.srcObject=t}captureWebCamera(){navigator.mediaDevices.getUserMedia({video:!0}).then(t=>{this.setSrcObject(t)})}static async videoMediaChangeSupport(){return new Promise(t=>{const e=document.createElement("iframe"),n=document.createElement("video"),i=document.createElement("source"),r=new MediaSource;r.addEventListener("sourceopen",()=>t(!0)),i.src=URL.createObjectURL(r),i.media="(min-width:10px)",n.append(i),e.width="5",e.style.cssText="position: absolute; visibility: hidden;",document.documentElement.append(e),e.contentDocument?.body.append(n),setTimeout(()=>{e.width="15"}),setTimeout(()=>{e.remove(),t(!1)},1e3)})}static tryAutoPlayOrAutoPlayAfterClick(t){return new Promise(e=>{t.play().then(()=>{t.autoplay=!0,e(!0)}).catch(()=>{Jn.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 fo extends fs{source;raw="";mode="text";tagname="";nodename="";textchunk="";entity="";quote="";attrs={};constructor(t){super(),this.source=t}parse(){const t=Ml(this.source);if(t===0){this.emit("finish");return}let e,n,i=ca(this.source,0);for(let r=1;r<t;r++)e=n,n=i,i=ca(this.source,r),this.raw+=n,n&&this.step(n,i,e);i&&this.step(i,void 0,n),this.emit("finish")}step(t,e,n){t==`
|
|
26
|
+
`&&this.emit("newline"),this.act(t,e,n)}act(t,e,n){switch(this.mode){case"text":switch(t){case"<":case"eof":this.nodename="",this.attrs={},this.mode="tag name start",this.raw=this.raw.slice(0,-1),this.textchunk&&this.emit("text",this.textchunk),this.raw+=t,this.textchunk="";break;case"&":this.mode="entity",this.entity="";break;default:this.textchunk+=t;break}break;case"entity":he("whitespace",t)?(this.textchunk+=Au(this.entity),this.mode="text"):t==";"?(this.textchunk+=Au(this.entity+t),this.mode="text"):this.entity+=t;break;case"special":if(n=="!"&&t=="-"&&e=="-"){this.mode="comment start";break}if(this.textchunk=="[CDATA"&&t=="["){this.mode="cdata",this.textchunk="";break}if(t==">"||t=="eof"){this.emit("special",this.textchunk),this.mode="text",this.textchunk="";break}this.textchunk+=t;break;case"cdata":if(n=="]"&&t=="]"&&e==">"){this.mode="cdata end",this.textchunk=this.textchunk.slice(0,-1);break}t=="eof"&&(this.mode="cdata end",this.act(t,e,n)),this.textchunk+=t;break;case"cdata end":this.emit("cdata",this.textchunk),this.textchunk="",this.mode="text";break;case"comment start":e==">"||t=="eof"?(this.emit("comment",""),this.mode="skip"):this.mode="comment";break;case"skip":this.mode="text";break;case"comment":t=="-"&&n=="-"&&e==">"?(this.mode="comment end",this.textchunk=this.textchunk.slice(0,-1)):t=="eof"?this.emit("comment",this.textchunk):this.textchunk+=t;break;case"comment end":this.emit("comment",this.textchunk),this.textchunk="",this.mode="text";break;case"declaration":if(t=="?"&&e==">"){this.mode="declaration end";break}t=="eof"&&this.emit("comment",this.textchunk),this.textchunk+=t;break;case"declaration end":this.emit("comment",this.textchunk),this.textchunk="",this.mode="text";break;case"tag name start":if(t=="eof"){this.emit("text","<");break}if(!he("whitespace",t)){if(this.mode="tag name",t=="/"){this.mode="close tag name start";break}else if(t=="!"){this.mode="special",this.textchunk="";break}else if(t=="?"){this.mode="declaration";break}this.act(t,e,n)}break;case"close tag name start":he("whitespace",t)||(this.mode="close tag name",this.tagname="",this.nodename="",this.act(t,e,n));break;case"close tag name":if(he("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(he("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":he("whitespace",t)||(this.mode="attr",this.nodename="",this.act(t,e,n));break;case"attr":if(he("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(!he("whitespace",t)){if(this.mode="attr value",this.quote="",t=="'"||t=='"'){this.quote=t;return}this.act(t,e,n)}break;case"attr value":if(he("whitespace",t)&&!this.quote)this.mode="attr start";else if(t==">"&&!this.quote)this.emit("tag",this.tagname,this.attrs),this.mode="text";else switch(t){case'"':case"'":this.quote==t&&n!="\\"&&(this.mode="attr start");break;default:this.attrs[this.nodename]+=t;break}break}}}function Au(s){const t={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 e;return s.charAt(0)=="#"?s.charAt(1).toLowerCase()=="x"?e=parseInt(s.substring(2),16):e=parseInt(s.substring(1),10):e=t[s],e?String.fromCharCode(e):"&"+s}var ku=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function mo(s,t={}){var e=1,n=1;function i(R){var D=R.match(/\n/g);D&&(e+=D.length);var X=R.lastIndexOf(`
|
|
27
|
+
`);n=~X?R.length-X:n+R.length}function r(){var R={line:e,column:n};return function(D){return D.position=new o(R),p(),D}}function o(R){this.start=R,this.end={line:e,column:n},this.source=t.source}o.prototype.content=s;var a=[];function h(R){var D=new Error(t.source+":"+e+":"+n+": "+R);if(D.reason=R,D.filename=t.source,D.line=e,D.column=n,D.source=s,t.silent)a.push(D);else throw D}function c(){var R=m();return{type:"stylesheet",stylesheet:{source:t.source,rules:R,parsingErrors:a}}}function u(){return f(/^{\s*/)}function l(){return f(/^}/)}function m(){var R,D=[];for(p(),y(D);s.length&&s.charAt(0)!="}"&&(R=$t()||te());)R!==!1&&(D.push(R),y(D));return D}function f(R){var D=R.exec(s);if(D){var X=D[0];return i(X),s=s.slice(X.length),D}}function p(){f(/^\s*/)}function y(R){var D;for(R=R||[];D=v();)D!==!1&&R.push(D);return R}function v(){var R=r();if(!(s.charAt(0)!="/"||s.charAt(1)!="*")){for(var D=2;s.charAt(D)!=""&&(s.charAt(D)!="*"||s.charAt(D+1)!="/");)++D;if(D+=2,s.charAt(D-1)==="")return h("End of comment missing");var X=s.slice(2,D-2);return n+=2,i(X),s=s.slice(D),n+=2,R({type:"comment",comment:X})}}function w(){var R=f(/^([^{]+)/);if(R)return pe(R[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 _(){var R=r(),D=f(/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(D){if(D=pe(D[0]),!f(/^:\s*/))return h("property missing ':'");var X=f(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/),H=R({type:"declaration",property:D.replace(ku,""),value:X?pe(X[0]).replace(ku,""):""});return f(/^[;\s]*/),H}}function x(){var R=[];if(!u())return h("missing '{'");y(R);for(var D;D=_();)D!==!1&&(R.push(D),y(R));return l()?R:h("missing '}'")}function b(){for(var R,D=[],X=r();R=f(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/);)D.push(R[1]),f(/^,\s*/);if(D.length)return X({type:"keyframe",values:D,declarations:x()})}function E(){var R=r(),D=f(/^@([-\w]+)?keyframes\s*/);if(D){var X=D[1];if(D=f(/^([-\w]+)\s*/),!D)return h("@keyframes missing name");var H=D[1];if(!u())return h("@keyframes missing '{'");for(var At,ee=y();At=b();)ee.push(At),ee=ee.concat(y());return l()?R({type:"keyframes",name:H,vendor:X,keyframes:ee}):h("@keyframes missing '}'")}}function C(){var R=r(),D=f(/^@supports *([^{]+)/);if(D){var X=pe(D[1]);if(!u())return h("@supports missing '{'");var H=y().concat(m());return l()?R({type:"supports",supports:X,rules:H}):h("@supports missing '}'")}}function L(){var R=r(),D=f(/^@host\s*/);if(D){if(!u())return h("@host missing '{'");var X=y().concat(m());return l()?R({type:"host",rules:X}):h("@host missing '}'")}}function B(){var R=r(),D=f(/^@media *([^{]+)/);if(D){var X=pe(D[1]);if(!u())return h("@media missing '{'");var H=y().concat(m());return l()?R({type:"media",media:X,rules:H}):h("@media missing '}'")}}function F(){var R=r(),D=f(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(D)return R({type:"custom-media",name:pe(D[1]),media:pe(D[2])})}function $(){var R=r(),D=f(/^@page */);if(D){var X=w()||[];if(!u())return h("@page missing '{'");for(var H=y(),At;At=_();)H.push(At),H=H.concat(y());return l()?R({type:"page",selectors:X,declarations:H}):h("@page missing '}'")}}function G(){var R=r(),D=f(/^@([-\w]+)?document *([^{]+)/);if(D){var X=pe(D[1]),H=pe(D[2]);if(!u())return h("@document missing '{'");var At=y().concat(m());return l()?R({type:"document",document:H,vendor:X,rules:At}):h("@document missing '}'")}}function J(){var R=r(),D=f(/^@font-face\s*/);if(D){if(!u())return h("@font-face missing '{'");for(var X=y(),H;H=_();)X.push(H),X=X.concat(y());return l()?R({type:"font-face",declarations:X}):h("@font-face missing '}'")}}var st=Yt("import"),K=Yt("charset"),Kt=Yt("namespace");function Yt(R){var D=new RegExp("^@"+R+"\\s*([^;]+);");return function(){var X=r(),H=f(D);if(H){var At={type:R};return At[R]=H[1].trim(),X(At)}}}function $t(){if(s[0]=="@")return E()||B()||F()||C()||st()||K()||Kt()||G()||$()||L()||J()}function te(){var R=r(),D=w();return D?(y(),R({type:"rule",selectors:D,declarations:x()})):h("selector missing")}return po(c())}function pe(s){return s?s.replace(/^\s+|\s+$/g,""):""}function po(s,t){var e=s&&typeof s.type=="string",n=e?s:t;for(var i in s){var r=s[i];Array.isArray(r)?r.forEach(function(o){po(o,n)}):r&&typeof r=="object"&&po(r,n)}return e&&Object.defineProperty(s,"parent",{configurable:!0,writable:!0,enumerable:!1,value:t||null}),s}let N1=class extends fo{currentItem={};items=[];groups=[];globalStyles={};grad={};idtops={};text="";constructor(t){super(t),this.on("tag",(e,n)=>{switch(this.text="",this.currentItem={type:e},e){case"g":this.groups.push(this.currentItem);break}this.processAttrs(e,n)}),this.on("text",e=>{if(this.currentItem.type=="style"){try{const n=mo(e);for(const i of n.stylesheet.rules)for(const r of i.declarations)for(const o of i.selectors)this.globalStyles[o]=this.globalStyles[o]||[],this.globalStyles[o].push(`${r.property}:${r.value}`)}catch{console.error("CAN'T parse css text: "+e)}return}this.text+=e}),this.on("/tag",(e,n)=>{let i=this.groups.length;for(;i--;)if(this.groups[i]!=this.currentItem){let r="",o="";for(const a in this.groups[i])a=="transform"?r=this.groups[i].transform:a=="class"&&this.globalStyles["."+this.groups[i][a]]?o=this.globalStyles["."+this.groups[i][a]].join(";")+";"+o:a=="id"&&this.globalStyles["#"+this.groups[i][a]]?o=this.globalStyles["#"+this.groups[i][a]].join(";")+";"+o:typeof this.currentItem[a]>"u"&&(this.currentItem[a]=this.groups[i][a]);typeof this.currentItem.transform>"u"?this.currentItem.transform=r:this.currentItem.transform+=" "+r,typeof this.currentItem.style>"u"?this.currentItem.style=o:this.currentItem.style=o+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),yo(this.currentItem.style,this.currentItem,wo)}switch(this.processAttrs(e,n),e){case"g":this.groups.pop();break;case"cirlce":this.addToItems();break;case"ellipse":this.addToItems();break;case"polygon":this.addToItems();break;case"path":this.addToItems();break;case"line":this.addToItems();break;case"rect":this.addToItems();break;case"image":this.addToItems();break;case"text":this.currentItem.text=this.text,this.currentItem["text-anchor"]=this.currentItem["text-anchor"]||"start",this.addToItems();break}}),this.on("finish",()=>{this.emit("result",this.items)})}parse(){return super.parse(),this.items}processAttrs(t,e){let n=[],i;switch(t){case"svg":let r="",o="";if(e.width&&e.height)r=e.width,o=e.height;else if(e.viewBox){const a=e.viewBox.split(/\s+/gi);a.length==4&&(r=String(parseFloat(a[2])-parseFloat(a[0])),o=String(parseFloat(a[3])-parseFloat(a[1])))}r&&o&&this.items.push({type:"viewbox",width:r,height:o});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&&yo(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+go(parseFloat(e.x1),parseFloat(e.y1),parseFloat(e.x2),parseFloat(e.y2),parseFloat(e.x1)+100,parseFloat(e.y1))).toFixed(2),n=[this.grad.angle];for(let a=0,h=this.grad.stops.length;a<h;a++)i=this.grad.stops[a],a&&a!=h-1?n.push(i.color+":"+i.offset):n.push(i.color);this.idtops[this.grad.id]=n.join("-"),this.items.forEach(a=>{a.fillid==this.grad.id&&(a.fill=this.idtops[this.grad.id])});break;case"radialGradient":n=[];for(let a=0,h=this.grad.stops.length;a<h;a++)i=this.grad.stops[a],a&&a!=h-1?n.push(i.color+":"+i.offset):n.push(i.color);this.idtops[this.grad.id]=n.join("-"),this.items.forEach(a=>{a.fillid==this.grad.id&&(a.fill=this.idtops[this.grad.id])});break}for(const r in e){const o=e[r];if(wo.includes(r)&&(this.currentItem[r]=o),r==="id"&&(this.currentItem.type==="linearGradient"&&(this.grad={id:r,stops:[]}),this.currentItem.type==="radialGradient"&&(this.grad={id:r,stops:[]})),r==="style"&&yo(o,this.currentItem,wo),r==="transform"&&(this.currentItem.transform=o+(this.currentItem.transform||" ")),r==="fill"){const a=o.match(/url\(#([^)]+)\)/);if(a){const h=a[1];this.currentItem.fillid=h,this.idtops[h]&&(this.currentItem.fill=this.idtops[h])}}r==="points"&&this.currentItem.type=="polygon"&&(this.currentItem.path="M"+o+"z"),r==="d"&&this.currentItem.type=="path"&&(this.currentItem.path=o),r==="xlink:href"&&this.currentItem.type=="image"&&(this.currentItem.src=o)}}addToItems(){this.items.push(this.currentItem)}};function go(s,t,e,n,i,r){if(typeof i>"u"||typeof r>"u"){const o=s-e,a=t-n;return!o&&!a?0:(180+Math.atan2(-a,-o)*180/Math.PI+360)%360}else return go(s,t,i,r)-go(e,n,i,r)}function yo(s,t,e){const n=(s+"").split(";"),i=/^\s+|\s+$/g;for(let r=0,o=n.length;r<o;r++){const a=n[r].split(":"),h=a[0].replace(i,"").replace(/[A-Z]/g,function(c){return"-"+c.toLowerCase()});(!e||e.includes(h))&&(t[h]=a[1].replace(i,""))}}const wo=["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 _t{startPathX=0;startPathY=0;prevPathX=0;prevPathY=0;normalizedLines=[];constructor(t){const e=typeof t=="string"?Pu(t):t||[],n=z1(Mu(e));let i=!1;for(let r=0,o=n.length;r<o;r++){const a=n[r];a[0]=="M"?(i||(i=!0,this.startPathX=a[1],this.startPathY=a[2]),this.prevPathX=a[1],this.prevPathY=a[2]):this._appendLine(new gt({c1x:a[1],c1y:a[2],c2x:a[3],c2y:a[4],toX:a[5],toY:a[6]}))}}_appendLine(t){if(t instanceof uo){Cu(this.prevPathX,this.prevPathY,t.toX,t.toY,t.largeArcFlag,t.sweepFlag,t.rx,t.ry,t.xAxisRotate).forEach(c=>{const[u,l,m,f,p,y,v,w]=c;this.normalizedLines.push(new gt({x:this.prevPathX,y:this.prevPathY,c1x:m,c1y:f,c2x:p,c2y:y,toX:v,toY:w})),this.prevPathX=v,this.prevPathY=w});return}if(t instanceof gt){this.normalizedLines.push(t.clone()),this.prevPathX=t.toX,this.prevPathY=t.toY;return}let e,n,i,r,o,a;t instanceof k1?[e,n,i,r,o,a]=lo(this.prevPathX,this.prevPathY,t.cx,t.cy,t.toX,t.toY):[e,n,i,r,o,a]=Wn(this.prevPathX,this.prevPathY,t.toX,t.toY),this.normalizedLines.push(new gt({x:this.prevPathX,y:this.prevPathY,c1x:e,c1y:n,c2x:i,c2y:r,toX:o,toY:a})),this.prevPathX=o,this.prevPathY=a}static fromPolymorphPoints(t){const e=new _t;e.prevPathX=e.startPathX=t[0]||0,e.prevPathY=e.startPathY=t[1]||0;for(let n=2,i=t.length;n+5<i;n+=6)e._appendLine(new gt({c1x:t[n],c1y:t[n+1],c2x:t[n+2],c2y:t[n+3],toX:t[n+4],toY:t[n+5]}));return e}static fromLines(t){const e=new _t;e.prevPathX=e.startPathX=t[0].x||0,e.prevPathY=e.startPathY=t[0].y||0;for(let n=0,i=t.length;n<i;n++)e._appendLine(t[n]);return e}clone(){return _t.fromLines(this.normalizedLines)}toSVGPathData(){const t=[];t.push(["M",this.startPathX,this.startPathY]);for(let e=0,n=this.normalizedLines.length;e<n;e++)t.push(...this.normalizedLines[e].toSVGPathData());return t}toSVGPathD(){return O1(this.toSVGPathData())}toCanvasContext(t){t.beginPath(),t.moveTo(this.startPathX,this.startPathY),this.normalizedLines.forEach(e=>{e.toCanvasContext(t)})}getBoundingClientRect(t=2){const e=[],n=[];if(this.normalizedLines.forEach(h=>{const c=h.getBoundingClientRect();e.push(c.x,c.x+c.width),n.push(c.y,c.y+c.height)}),e.length==0||n.length==0)return{x:0,y:0,width:0,height:0,center:{x:0,y:0}};const i=Math.min(...e),r=Math.min(...n),o=Math.max(...e),a=Math.max(...n);return{x:Z(i,t),y:Z(r,t),width:Z(o-i,t),height:Z(a-r,t)}}getBoundingClientRectCenter(t=2){const e=this.getBoundingClientRect(t);return{x:Z(e.x+e.width*.5,t),y:Z(e.y+e.height*.5,t)}}transform(t,e,n,i,r,o,a){const h=new vt;return h.translate(t,e),h.rotate(r,n,i),h.scale(o,a,n,i),h.isIdentity?this.clone():_t.fromLines(this.normalizedLines.map(c=>{let u=c.x,l=c.y,m=c.c1x,f=c.c1y,p=c.c2x,y=c.c2y,v=c.toX,w=c.toY;return{x:u,y:l}=h.transformPoint({x:u,y:l}),{x:m,y:f}=h.transformPoint({x:m,y:f}),{x:p,y}=h.transformPoint({x:p,y}),{x:v,y:w}=h.transformPoint({x:v,y:w}),new gt({x:u,y:l,c1x:m,c1y:f,c2x:p,c2y:y,toX:v,toY:w})}))}getTotalLength(){return this.normalizedLines.reduce((t,e)=>t+=e.length(),0)}getPointAtLength(t){let e=0,n=0;const i=this.normalizedLines.length;for(let r=0;r<i;r++){const o=this.normalizedLines[r];if(n=o.length(),e+n>=t)return o.getPointAtSegmentLength(t-e);e+=n}return this.normalizedLines[i-1].getPointAtSegmentLength(n)}interpolate(t){const e=this.normalizedLines.length;if(e===0)return{x:0,y:0};if(e===1)return this.normalizedLines[0].interpolate(t);{let n=t*e,i=this.normalizedLines[0];if(n--,n>1)for(let r=1;r<e&&(i=this.normalizedLines[r],n>1);r++)n-=1;return i.interpolate(n)}}getSubPathD(t,e){if(this.getTotalLength()-e<1e-6)return this.getSubPathDAtLength(this,t);{const n=this.getSubPathDAtLength(this,e,1);return t?this.getSubPathDAtLength(n,t):n}}getSubPathDAtLength(t,e,n){let i=null,r=0;const o=new _t;o.prevPathX=o.startPathX=t.startPathX,o.prevPathY=o.startPathY=t.startPathY;for(let a=0,h=this.normalizedLines.length;a<h;a++){const c=this.normalizedLines[a],u=c.length();if(r+u>e&&!i){const l=c.getPointAtSegmentLength(e-r);if(o._appendLine(new gt({c1x:l.start.x,c1y:l.start.y,c2x:l.m.x,c2y:l.m.y,toX:l.x,toY:l.y})),n)return o;i=o,o._appendLine(new gt({c1x:l.n.x,c1y:l.n.y,c2x:l.end.x,c2y:l.end.y,toX:c.x,toY:c.y})),r+=u;continue}r+=u,o._appendLine(c)}return o}closestPoint(t,e){const n=this.getTotalLength();let i={x:t,y:e},r=0,o=1/0,a=8;for(let c=0;c<=n;c+=a){const u=this.getPointAtLength(c),l=(t-u.x)*(t-u.x)+(e-u.y)*(e-u.y);l<o&&(i=u,r=c,o=l)}for(a/=2;a>.5;){const c=r-a,u=this.getPointAtLength(c),l=(t-u.x)*(t-u.x)+(e-u.y)*(e-u.y),m=r+a,f=this.getPointAtLength(m),p=(t-f.x)*(t-f.x)+(e-f.y)*(e-f.y);c>=0&&l<o?(i=u,r=c,o=l):m<=n&&p<o?(i=f,r=m,o=p):a/=2}const h=this.getPointAtLength(r+(r===n?-.1:.1));return{point:i,rotation:r>=n?Jt(h.x,h.y,i.x,i.y):Jt(i.x,i.y,h.x,h.y),distance:Math.sqrt(o)}}getPolymorphPoints(){return[this.startPathX,this.startPathY].concat(this.normalizedLines.reduce((t,e)=>t.concat([e.c1x,e.c1y,e.c2x,e.c2y,e.toX,e.toY]),[]))}getPolymorphPointsPerimeter(){const t=this.getPolymorphPoints(),e=t.length;let n=t[e-2],i=t[e-1],r=0;for(let o=0;o<e;o+=6)r+=Ee(t[o],t[o+1],n,i),n=t[o],i=t[o+1];return Math.floor(r)}getExpendedPolymorphPointsPathD(t){const e=this.getPolymorphPoints(),n=e.length;let i=t-n;const r=Math.ceil(t/n),o=[];o.push(["M",e[0],e[1]]);let a=2;for(;a+5<=n-1;){const h=e[a++],c=e[a++],u=e[a++],l=e[a++],m=e[a++],f=e[a++];o.push(["C",h,c,u,l,m,f]);let p=0;for(;p<r&&i>0;)o.push(["C",m,f,m,f,m,f]),i-=6,p++}return new _t(o)}static getInterpolator(t,e){return n=>Math.abs(n-0)<Number.EPSILON?new _t(t.toSVGPathD()):Math.abs(n-1)<Number.EPSILON?new _t(e.toSVGPathD()):_t.fromPolymorphPoints(Wl(t.getPolymorphPoints(),e.getPolymorphPoints(),n))}}const Iu=B1("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 B1(s,t=10){const e={},n=s.split(",");for(let i=0;i<n.length;i+=2){const r="&"+n[i+1]+";",o=parseInt(n[i],t);e[r]="&#"+o+";"}return e["\\xa0"]=" ",e}function Mt(s,t){const e=Object.keys(t);for(let n=0;n<e.length;n++)s=s.replace(new RegExp("{"+e[n]+"}","gi"),""+t[e[n]]);return s}function js(s){let t,e;if(!s)throw new Error("cannot create a random attribute name for an undefined object");const n="ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz";t="";do for(t="",e=0;e<12;e++)t+=n[Math.floor(Math.random()*n.length)];while(s[t]);return t}function F1(s){const t={left:"start",right:"end",center:"middle",start:"start",end:"end"};return t[s]||t.start}function Y1(s){const t={alphabetic:"alphabetic",hanging:"hanging",top:"text-before-edge",bottom:"text-after-edge",middle:"central"};return t[s]||t.alphabetic}const Zn={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 xo{__root;__ctx;constructor(t,e){this.__root=t,this.__ctx=e}addColorStop(t,e){const n=this.__ctx.__createElement("stop");if(n.setAttribute("offset",""+t),e.indexOf("rgba")!==-1){const r=/rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d?\.?\d*)\s*\)/gi.exec(e);r&&(n.setAttribute("stop-color",Mt("rgb({r},{g},{b})",{r:r[1],g:r[2],b:r[3]})),n.setAttribute("stop-opacity",r[4]))}else n.setAttribute("stop-color",e);this.__root.appendChild(n)}}class Du{__root;__ctx;constructor(t,e){this.__root=t,this.__ctx=e}}class Hs{__document=document;__canvas;__ctx;width;height;__styleStack;__groupStack;__rootSVG;__ids;__SVGdefs;__currentElement;__currentElementsToStyle=null;constructor({canvas:t,width:e=500,height:n=500}){t?(this.__canvas=t,this.__ctx=t.getContext("2d")):(this.__canvas=this.__document.createElement("canvas"),this.__ctx=this.__canvas.getContext("2d")),this.width=e||t?.width||0,this.height=n||t?.height||0,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(Zn);for(let e=0,n=t.length;e<n;e++){const i=t[e];this[i]=Zn[i].canvas}}__getStyleState(){const t={},e=Object.keys(Zn);for(let n=0,i=e.length;n<i;n++){const r=e[n];t[r]=this[r]}return t}__applyStyleState(t){const e=Object.keys(t);for(let n=0,i=e.length;n<i;n++){const r=e[n];this[r]=t[r]}}__createElement(t,e={},n=!1){const i=this.__document.createElementNS("http://www.w3.org/2000/svg",t),r=Object.keys(e);n&&(i.setAttribute("fill","none"),i.setAttribute("stroke","none"));for(let o=0;o<r.length;o++){const a=r[o];i.setAttribute(a,e[a])}return i}__applyStyleToCurrentElement(t){let e=this.__currentElement;const n=this.__currentElementsToStyle;n&&(e.setAttribute(t,""),e=n.element,n.children.forEach(r=>{r.setAttribute(t,"")}));const i=Object.keys(Zn);for(let r=0;r<i.length;r++){const o=Zn[i[r]],a=this[i[r]];if(o.apply){if(a instanceof Du){if(a.__ctx)for(;a.__ctx.__SVGdefs.childNodes.length;){const h=a.__ctx.__SVGdefs.childNodes[0].getAttribute("id");this.__ids[h]=h,this.__SVGdefs.appendChild(a.__ctx.__SVGdefs.childNodes[0])}e.setAttribute(o.apply,Mt("url(#{id})",{id:a.__root.getAttribute("id")}))}else if(a instanceof xo)e.setAttribute(o.apply,Mt("url(#{id})",{id:a.__root.getAttribute("id")}));else if(o.apply.indexOf(t)!==-1&&o.svg!==a)if((o.svgAttr==="stroke"||o.svgAttr==="fill")&&a.indexOf("rgba")!==-1){const c=/rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d?\.?\d*)\s*\)/gi.exec(a);if(c){e.setAttribute(o.svgAttr,Mt("rgb({r},{g},{b})",{r:c[1],g:c[2],b:c[3]}));let u=parseFloat(c[4]);const l=this.globalAlpha;l!=null&&(u*=l),e.setAttribute(o.svgAttr+"-opacity",""+u)}}else{let h=o.svgAttr;if(i[r]==="globalAlpha"&&(h=t+"-"+o.svgAttr,e.getAttribute(h)))continue;h&&e.setAttribute(h,a)}}}}__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(Iu);for(let r=0,o=i.length;r<o;r++){const a=i[r],h=Iu[a],c=new RegExp(a,"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 n=this.__currentElement.getAttribute("transform");n?n+=" ":n="",n+=t,this.__currentElement.setAttribute("transform",n)}scale(t,e){e===void 0&&(e=t),this.__addTransform(Mt("scale({x},{y})",{x:t,y:e}))}rotate(t){const e=t*180/Math.PI;this.__addTransform(Mt("rotate({angle},{cx},{cy})",{angle:e,cx:0,cy:0}))}translate(t,e){this.__addTransform(Mt("translate({x},{y})",{x:t,y:e}))}transform(t,e,n,i,r,o){this.__addTransform(Mt("matrix({a},{b},{c},{d},{e},{f})",{a:t,b:e,c:n,d:i,e:r,f:o}))}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(Mt("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(Mt("L {x} {y}",this.__currentPosition)):this.__addPathCommand(Mt("M {x} {y}",this.__currentPosition))}bezierCurveTo(t,e,n,i,r,o){this.__currentPosition={x:r,y:o},this.__addPathCommand(Mt("C {cp1x} {cp1y} {cp2x} {cp2y} {x} {y}",{cp1x:t,cp1y:e,cp2x:n,cp2y:i,x:r,y:o}))}quadraticCurveTo(t,e,n,i){this.__currentPosition={x:n,y:i},this.__addPathCommand(Mt("Q {cpx} {cpy} {x} {y}",{cpx:t,cpy:e,x:n,y:i}))}normalize(t){const e=Math.sqrt(t[0]*t[0]+t[1]*t[1]);return[t[0]/e,t[1]/e]}arcTo(t,e,n,i,r){const o=this.__currentPosition&&this.__currentPosition.x,a=this.__currentPosition&&this.__currentPosition.y;if(typeof o>"u"||typeof a>"u")return;if(r<0)throw new Error("IndexSizeError: The radius provided ("+r+") is negative.");if(o===t&&a===e||t===n&&e===i||r===0){this.lineTo(t,e);return}const h=this.normalize([o-t,a-e]),c=this.normalize([n-t,i-e]);if(h[0]*c[1]===h[1]*c[0]){this.lineTo(t,e);return}const u=h[0]*c[0]+h[1]*c[1],l=Math.acos(Math.abs(u)),m=this.normalize([h[0]+c[0],h[1]+c[1]]),f=r/Math.sin(l/2),p=t+f*m[0],y=e+f*m[1],v=[-h[1],h[0]],w=[c[1],-c[0]],_=function(E){const C=E[0];return E[1]>=0?Math.acos(C):-Math.acos(C)},x=_(v),b=_(w);this.lineTo(p+v[0]*r,y+v[1]*r),this.arc(p,y,r,x,b)}stroke(){this.__currentElement.nodeName==="path"&&this.__currentElement.setAttribute("paint-order","fill stroke markers"),this.__applyCurrentDefaultPath(),this.__applyStyleToCurrentElement("stroke")}fill(){this.__currentElement.nodeName==="path"&&this.__currentElement.setAttribute("paint-order","stroke fill markers"),this.__applyCurrentDefaultPath(),this.__applyStyleToCurrentElement("fill")}rect(t,e,n,i){this.__currentElement.nodeName!=="path"&&this.beginPath(),this.moveTo(t,e),this.lineTo(t+n,e),this.lineTo(t+n,e+i),this.lineTo(t,e+i),this.lineTo(t,e),this.closePath()}fillRect(t,e,n,i){const r=this.__createElement("rect",{x:t,y:e,width:n,height:i},!0);this.__closestGroupOrSvg().appendChild(r),this.__currentElement=r,this.__applyStyleToCurrentElement("fill")}strokeRect(t,e,n,i){const r=this.__createElement("rect",{x:t,y:e,width:n,height:i},!0);this.__closestGroupOrSvg().appendChild(r),this.__currentElement=r,this.__applyStyleToCurrentElement("stroke")}__clearCanvas(){const e=this.__closestGroupOrSvg().getAttribute("transform"),n=this.__rootSVG.childNodes[1],i=n.childNodes;for(let r=i.length-1;r>=0;r--)i[r]&&n.removeChild(i[r]);this.__currentElement=n,this.__groupStack=[],e&&this.__addTransform(e)}clearRect(t,e,n,i){if(t===0&&e===0&&n===this.width&&i===this.height){this.__clearCanvas();return}const r=this.__closestGroupOrSvg(),o=this.__createElement("rect",{x:t,y:e,width:n,height:i,fill:"#FFFFFF"},!0);r.appendChild(o)}createLinearGradient(t,e,n,i){const r=this.__createElement("linearGradient",{id:js(this.__ids),x1:t+"px",x2:n+"px",y1:e+"px",y2:i+"px",gradientUnits:"userSpaceOnUse"},!1);return this.__SVGdefs.appendChild(r),new xo(r,this)}createRadialGradient(t,e,n,i,r,o){const a=this.__createElement("radialGradient",{id:js(this.__ids),cx:i+"px",cy:r+"px",r:o+"px",fx:t+"px",fy:e+"px",gradientUnits:"userSpaceOnUse"},!1);return this.__SVGdefs.appendChild(a),new xo(a,this)}__parseFont(){const e=/^\s*(?=(?:(?:[-a-z]+\s*){0,2}(italic|oblique))?)(?=(?:(?:[-a-z]+\s*){0,2}(small-caps))?)(?=(?:(?:[-a-z]+\s*){0,2}(bold(?:er)?|lighter|[1-9]00))?)(?:(?:normal|\1|\2|\3)\s*){0,3}((?:xx?-)?(?:small|large)|medium|smaller|larger|[.\d]+(?:%|in|[cem]m|ex|p[CustomCanvasContext]))(?:\s*\/\s*(normal|[.\d]+(?:%|in|[cem]m|ex|p[CustomCanvasContext])))?\s*([-,'"\sa-z0-9]+?)\s*$/i.exec(this.font),n={style:e[1]||"normal",size:e[4]||"10px",family:e[6]||"sans-serif",weight:e[3]||"normal",decoration:e[2]||"normal",href:null};return this.__fontUnderline==="underline"&&(n.decoration="underline"),this.__fontHref&&(n.href=this.__fontHref),n}__wrapTextLink(t,e){if(t.href){const n=this.__createElement("a");return n.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",t.href),n.appendChild(e),n}return e}__applyText(t,e,n,i){const r=this.__parseFont(),o=this.__closestGroupOrSvg(),a=this.__createElement("text",{"font-family":r.family,"font-size":r.size,"font-style":r.style,"font-weight":r.weight,"text-decoration":r.decoration,x:e,y:n,"text-anchor":F1(this.textAlign),"dominant-baseline":Y1(this.textBaseline)},!0);a.appendChild(this.__document.createTextNode(t)),this.__currentElement=a,this.__applyStyleToCurrentElement(i),o.appendChild(this.__wrapTextLink(r,a))}fillText(t,e,n){this.__applyText(t,e,n,"fill")}strokeText(t,e,n){this.__applyText(t,e,n,"stroke")}measureText(t){return this.__ctx.font=this.font,this.__ctx.measureText(t)}arc(t,e,n,i,r,o){if(i===r)return;i=i%(2*Math.PI),r=r%(2*Math.PI),i===r&&(r=(r+2*Math.PI-.001*(o?-1:1))%(2*Math.PI));const a=t+n*Math.cos(r),h=e+n*Math.sin(r),c=t+n*Math.cos(i),u=e+n*Math.sin(i),l=o?0:1;let m=0,f=r-i;f<0&&(f+=2*Math.PI),o?m=f>Math.PI?0:1:m=f>Math.PI?1:0,this.lineTo(c,u),this.__addPathCommand(Mt("A {rx} {ry} {xAxisRotation} {largeArcFlag} {sweepFlag} {endX} {endY}",{rx:n,ry:n,xAxisRotation:0,largeArcFlag:m,sweepFlag:l,endX:a,endY:h})),this.__currentPosition={x:a,y:h}}clip(){const t=this.__closestGroupOrSvg(),e=this.__createElement("clipPath"),n=js(this.__ids),i=this.__createElement("g");this.__applyCurrentDefaultPath(),t.removeChild(this.__currentElement),e.setAttribute("id",n),e.appendChild(this.__currentElement),this.__SVGdefs.appendChild(e),t.setAttribute("clip-path",Mt("url(#{id})",{id:n})),t.appendChild(i),this.__currentElement=i}drawImage(...t){let e=t[0],n,i,r,o,a=0,h=0,c,u,l,m,f,p,y,v;if(t.length===3)n=t[1],i=t[2],c=e.width,u=e.height,r=c,o=u;else if(t.length===5)n=t[1],i=t[2],r=t[3],o=t[4],c=e.width,u=e.height;else if(t.length===9)a=t[1],h=t[2],c=t[3],u=t[4],n=t[5],i=t[6],r=t[7],o=t[8];else throw new Error("Invalid number of arguments passed to drawImage: "+arguments.length);const w=this.__closestGroupOrSvg();this.__currentElement;const _="translate("+n+", "+i+")";if(e instanceof Hs){if(l=e.getSvg().cloneNode(!0),l.childNodes&&l.childNodes.length>1){for(m=l.childNodes[0];m.childNodes.length;)v=m.childNodes[0].getAttribute("id"),this.__ids[v]=v,this.__SVGdefs.appendChild(m.childNodes[0]);if(f=l.childNodes[1],f){const x=f.getAttribute("transform");let b;x?b=x+" "+_:b=_,f.setAttribute("transform",b),w.appendChild(f)}}}else(e.nodeName==="CANVAS"||e.nodeName==="IMG")&&(p=this.__createElement("image"),p.setAttribute("width",r),p.setAttribute("height",o),p.setAttribute("preserveAspectRatio","none"),(a||h||c!==e.width||u!==e.height)&&(y=this.__document.createElement("canvas"),y.width=r,y.height=o,y.getContext("2d")?.drawImage(e,a,h,c,u,0,0,r,o),e=y),p.setAttribute("transform",_),p.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",e.nodeName==="CANVAS"?e.toDataURL():e.getAttribute("src")),w.appendChild(p))}createPattern(t,e){const n=this.__document.createElementNS("http://www.w3.org/2000/svg","pattern"),i=js(this.__ids);let r;return n.setAttribute("id",i),t.nodeName==="CANVAS"||t.nodeName==="IMG"?(r=this.__document.createElementNS("http://www.w3.org/2000/svg","image"),r.setAttribute("width",""+t.width),r.setAttribute("height",""+t.height),r.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",t.nodeName==="CANVAS"?t.toDataURL():t.getAttribute("src")),n.appendChild(r),this.__SVGdefs.appendChild(n)):t instanceof Hs&&(n.setAttribute("width",""+t.width),n.setAttribute("height",""+t.height),n.appendChild(t.__rootSVG.childNodes[1]),this.__SVGdefs.appendChild(n)),new Du(n,this)}setLineDash(t){t&&t.length>0?this.lineDash=t.join(","):this.lineDash=null}drawFocusRing(){}createImageData(){}getImageData(){}putImageData(){}globalCompositeOperation(){}setTransform(){}}class bo{canvas;context;customContext;currentPath2D=new Path2D;path2Ds=[];currentMatrix=new DOMMatrix;hasSetCustomStrokeStyle=!1;hasSetCustomFillStyle=!1;constructor(t,e,n,i=!1){this.canvas=t,this.context=t.getContext("2d",{willReadFrequently:!0}),i&&(this.customContext=new Hs({canvas:this.canvas,width:e||this.canvas.width,height:n||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,n,i){return this.context.fillRect(t,e,n,i),this.customContext&&this.customContext.fillRect(t,e,n,i),this}fillText(t,e,n,i){return this.hasSetCustomFillStyle=!1,this.context.fillText(t,e,n,i),this.customContext&&this.customContext.fillText(t,e,n),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,n,i){return this.context.strokeText(t,e,n,i),this.customContext&&this.customContext.strokeText(t,e,n),this}strokeRect(t,e,n,i){return this.context.strokeRect(t,e,n,i),this.customContext&&this.customContext.strokeRect(t,e,n,i),this}measureText(t){return this.context.measureText(t)}clearRect(t=0,e=0,n=this.canvas.width,i=this.canvas.height){return this.context.clearRect(t,e,n,i),this.customContext&&this.customContext.clearRect(t,e,n,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 n=new Path2D;n.addPath(t,e),this.currentPath2D=n}isPointInStroke(...t){return t[0]instanceof Path2D?this.context.isPointInStroke(t[0],t[1],t[2]):this.context.isPointInStroke(t[0],t[1])}isPointInPath(...t){return t[0]instanceof Path2D?this.context.isPointInPath(t[0],t[1],t[2]):this.context.isPointInPath(t[0],t[1])}translate(t,e){return this.context.translate(t,e),this.customContext&&this.customContext.translate(t,e),this.currentMatrix.translate(t,e),this.changePath2D(),this}rotate(t,e=0,n=0){return this.translate(e,n),this.context.rotate(t),this.customContext&&this.customContext.rotate(t),this.currentMatrix.rotate(t),this.translate(-e,-n),this.changePath2D(),this}scale(t,e=t,n=0,i=0){return this.translate(n,i),this.context.scale(t,e),this.customContext&&this.customContext.scale(t,e),this.currentMatrix.scale(t,e),this.translate(-n,-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,n,i,r,o){return this.context.arc(t,e,n,i,r,o),this.customContext&&this.customContext.arc(t,e,n,i,r,o?-1:1),this.currentPath2D.arc(t,e,n,i,r,o),this}arcTo(t,e,n,i,r){return this.context.arcTo(t,e,n,i,r),this.customContext&&this.customContext.arcTo(t,e,n,i,r),this.currentPath2D.arcTo(t,e,n,i,r),this}ellipse(t,e,n,i,r,o,a,h){return this.context.ellipse(t,e,n,i,r,o,a,h),this.currentPath2D.ellipse(t,e,n,i,r,o,a,h),this}quadraticCurveTo(t,e,n,i){return this.context.quadraticCurveTo(t,e,n,i),this.customContext&&this.customContext.quadraticCurveTo(t,e,n,i),this.currentPath2D.quadraticCurveTo(t,e,n,i),this}bezierCurveTo(t,e,n,i,r,o){return this.context.bezierCurveTo(t,e,n,i,r,o),this.customContext&&this.customContext.bezierCurveTo(t,e,n,i,r,o),this.currentPath2D.bezierCurveTo(t,e,n,i,r,o),this}rect(t,e,n,i){return this.context.rect(t,e,n,i),this.customContext&&this.customContext.rect(t,e,n,i),this.currentPath2D.rect(t,e,n,i),this}createLinearGradient(t,e,n,i,r){const o=this.context.createLinearGradient(t,e,n,i);return r&&Object.entries(r).forEach(([a,h])=>{o.addColorStop(parseFloat(a),h)}),o}createRadialGradient(t,e,n,i,r,o,a){const h=this.context.createRadialGradient(t,e,n,i,r,o);return a&&Object.entries(a).forEach(([c,u])=>{h.addColorStop(parseFloat(c),u)}),h}drawImage(t,...e){if(e.length===0)this.context.drawImage(t,0,0);else if(e.length===2){const n=e[0],i=e[1];this.context.drawImage(t,n,i)}else if(e.length===4){const n=e[0],i=e[1],r=e[2],o=e[3];this.context.drawImage(t,n,i,r,o)}else if(e.length===8){const n=e[0],i=e[1],r=e[2],o=e[3],a=e[4],h=e[5],c=e[6],u=e[7];this.context.drawImage(t,n,i,r,o,a,h,c,u)}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,n=this.canvas.width,i=this.canvas.height,r){return this.context.getImageData(t,e,n,i,r)}putImageData(t,e=0,n=0){return this.context.putImageData(t,e,n)}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}}}const Qn={1:705234,2:8108026,3:6346665,4:16630114,5:16607842,6:16158139,7:2542847,8:10640125,9:16735870,10:8978266,11:16580418,12:16754221,13:16725759,14:14436630,15:6844849,16:13744437,17:1817755,18:16744272,19:4964291,20:16750848,d:14540253,aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};class Ft{_color={r:0,g:0,b:0,a:1};constructor(t,e){t&&this.setColor(t),this.setAlpha(e)}get color(){return this._color}set color(t){const e=`Color: Unknown color(${t}) type(${typeof t})`;if(typeof t=="number")this.setHEX(t);else if(typeof t=="string"){let n;if(n=/^(\w+)\(([^)]*)\)/.exec(t)){const i=n[2];let r;switch(n[1]){case"rgb":case"rgba":(r=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(i))?(this.r=parseInt(r[1],10),this.g=parseInt(r[2],10),this.b=parseInt(r[3],10),this.a=r[4]?parseFloat(r[4]):1):(r=/^\s*(\d+)%\s*,\s*(\d+)%\s*,\s*(\d+)%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(i))?(this.r=N(parseFloat(r[1]),0,100)*255/100,this.g=N(parseFloat(r[2]),0,100)*255/100,this.b=N(parseFloat(r[3]),0,100)*255/100,this.a=r[4]?parseFloat(r[4]):1):console.warn(e);break;case"hsl":case"hsla":(r=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)%\s*,\s*(\d*\.?\d+)%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(i))?this.setHSL(parseFloat(r[1])/360,parseFloat(r[2])/100,parseFloat(r[3])/100,r[4]?parseFloat(r[4]):1):console.warn(e);break;case"hsv":case"hsva":case"hsb":case"hsba":(r=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)%\s*,\s*(\d*\.?\d+)%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(i))?this.setHSV(parseFloat(r[1])/360,parseFloat(r[2])/100,parseFloat(r[3])/100,r[4]?parseFloat(r[4]):1):console.warn(e);break;default:console.warn(e)}}else if(n=/#([A-Fa-f0-9]+)/.exec(t)){const i=n[1],r=i.length;r===3?this.setRGB(parseInt(i.charAt(0),16),parseInt(i.charAt(1),16),parseInt(i.charAt(2),16),1):r===6||r===8?this.setHEX(parseInt(i,16)):console.warn(e)}else if(t&&t.length>0)try{this.setColorName(t)}catch{console.warn(e)}else console.warn(e)}else t instanceof Ft?this.setRGB(t.r,t.g,t.b,t.a):Object.prototype.hasOwnProperty.call(t,"r")&&Object.prototype.hasOwnProperty.call(t,"g")&&Object.prototype.hasOwnProperty.call(t,"b")?this.setRGB(t.r,t.g,t.b,Object.prototype.hasOwnProperty.call(t,"a")?t.a:1):Object.prototype.hasOwnProperty.call(t,"h")&&Object.prototype.hasOwnProperty.call(t,"s")&&Object.prototype.hasOwnProperty.call(t,"l")?this.setHSL(t.h,t.s,t.l,Object.prototype.hasOwnProperty.call(t,"a")?t.a:1):Object.prototype.hasOwnProperty.call(t,"h")&&Object.prototype.hasOwnProperty.call(t,"s")&&Object.prototype.hasOwnProperty.call(t,"v")?this.setHSV(t.h,t.s,t.v,Object.prototype.hasOwnProperty.call(t,"a")?t.a:1):Object.prototype.hasOwnProperty.call(t,"h")&&Object.prototype.hasOwnProperty.call(t,"s")&&Object.prototype.hasOwnProperty.call(t,"b")?this.setHSV(t.h,t.s,t.b,Object.prototype.hasOwnProperty.call(t,"a")?t.a:1):console.warn(e)}setColor(t){return this.color=t,this}set(t){return this.setColor(t)}get r(){return this._color.r}set r(t){try{this._color.r=N(Math.round(qt(t)),0,255)}catch{}}get g(){return this._color.g}set g(t){try{this._color.g=N(Math.round(qt(t)),0,255)}catch{}}get b(){return this._color.b}set b(t){try{this._color.b=N(Math.round(qt(t)),0,255)}catch{}}get a(){return this._color.a}set a(t){try{this._color.a=N(qt(t),0,1)}catch{}}setAlpha(t){return this.a=t,this}setFromVector3(t){return this.r=t.x,this.g=t.y,this.b=t.z,this}applyMatrix3(t){const e=this.r,n=this.g,i=this.b,r=t.value;return this.r=r[0]*e+r[3]*n+r[6]*i,this.g=r[1]*e+r[4]*n+r[7]*i,this.b=r[2]*e+r[5]*n+r[8]*i,this}fromBufferAttribute(t,e){return this.r=t.getX(e),this.g=t.getY(e),this.b=t.getZ(e),this}fromArray(t,e=0){return this.r=t[e],this.g=t[e+1],this.b=t[e+2],this.a=t[e+3],this}toArray(t=[],e=0){return t[e]=this.r,t[e+1]=this.g,t[e+2]=this.b,t[e+3]=this.a,t}toRGBString(){return this.a===1?`rgb(${this.r},${this.g},${this.b})`:`rgba(${this.r},${this.g},${this.b},${Z(this.a,6)})`}toHexString(){return this.a===1?("000000"+this.hex.toString(16)).slice(-6):("00000000"+this.hex.toString(16)).slice(-8)}toString(){return this.a===1?"#"+this.toHexString():this.toRGBString()}toColorSpaceString(t=je){So.fromWorkingColorSpace(ge.copy(this),t);const e=ge.r,n=ge.g,i=ge.b;return t!==je?`color(${t} ${e.toFixed(3)} ${n.toFixed(3)} ${i.toFixed(3)})`:this.toRGBString()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b,yield this.a}clone(){return new Ft(this.color)}copy(t){return this.setColor(t.color),this}copySRGBToLinear(t){return this.r=He(t.r),this.g=He(t.g),this.b=He(t.b),this}copyLinearToSRGB(t){return this.r=We(t.r),this.g=We(t.g),this.b=We(t.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}equals(t){return t.r===this.r&&t.g===this.g&&t.b===this.b&&t.a===this.a}add(t){return this.r=this.r+t.r,this.g=this.g+t.g,this.b=this.b+t.b,this}addColors(t,e){return this.r=t.r+e.r,this.g=t.g+e.g,this.b=t.b+e.b,this}addScalar(t){return this.r=this.r+t,this.g=this.g+t,this.b=this.b+t,this}setScalar(t){return this.r=t,this.g=t,this.b=t,this}sub(t){return this.r=this.r-t.r,this.g=this.g-t.g,this.b=this.b-t.b,this}multiply(t){return this.r=this.r*t.r,this.g=this.g*t.g,this.b=this.b*t.b,this}multiplyScalar(t){return this.r=this.r*t,this.g=this.g*t,this.b=this.b*t,this}opposite(t=!0,e="#000000",n="#ffffff"){if(t)return this.setColor(this.r*.299+this.g*.587+this.b*.114>186?e:n);{const{r:i,g:r,b:o}=this.color;return this.r=255-i,this.g=255-r,this.b=255-o,this}}lighten(t){t=N(t,0,1);const{r:e,g:n,b:i}=this.color;return this.r=e+(255-e)*t,this.g=n+(255-n)*t,this.b=i+(255-i)*t,this}darken(t){t=N(t,0,1);const{r:e,g:n,b:i}=this.color;return this.r=e*(1-t),this.g=n*(1-t),this.b=i*(1-t),this}lerp(t,e){e=N(e,0,1);const{r:n,g:i,b:r}=this.color;return this.r=n+(t.r-n)*e,this.g=i+(t.g-i)*e,this.b=r+(t.b-r)*e,this}lerpColors(t,e,n){return n=N(n,0,1),this.r=t.r+(e.r-t.r)*n,this.g=t.g+(e.g-t.g)*n,this.b=t.b+(e.b-t.b)*n,this}static gradient(t,e,n){try{return ge.lerpColors(new Ft(t),new Ft(e),n).toString()}catch{return e}}static random(){return ge.setHEX(Math.random()*16777215).toString()}static nextIndex=0;static next(t=Ft.nextIndex){Ft.nextIndex=t;const e=Object.keys(Qn),n=e.length;return ge.setHEX(Qn[e[Ft.nextIndex++%n]]).toString()}setColorName(t){const e=Qn[t.toLowerCase()];return e!==void 0?this.setHEX(e):t==="none"?this.a=0:(this.a=1,console.warn("Color.setColorName: Unknown color "+t)),this}static getColors(){return Object.values(Qn).map(t=>ge.setHEX(t).toString())}setRGB(t,e,n,i=1){return this.r=t,this.g=e,this.b=n,this.a=i,this}get rgb(){return{r:this.r,g:this.g,b:this.b,a:this.a}}setHEX(t){return t=Math.floor(t),t<16777216?(this.r=t>>16&255,this.g=t>>8&255,this.b=t&255,this.a=1):(this.r=t>>24&255,this.g=t>>16&255,this.b=t>>8&255,this.a=(t&255)/255),this}get hex(){let t=(this.r<<16)+(this.g<<8)+this.b;return this.a!==1&&(t=t<<8,t+=Math.round(this.a*255)),t}setHSL(t,e,n,i=1){const r=Hl(t,1),o=N(e,0,1),a=N(n,0,1);if(o===0)this.r=a*255,this.g=a*255,this.b=a*255;else{const h=a<=.5?a*(1+o):a+o-a*o,c=2*a-h;this.r=Co(c,h,r+.3333333333333333)*255,this.g=Co(c,h,r)*255,this.b=Co(c,h,r-.3333333333333333)*255}return this.a=i,this}getHSL(t){const e=this.r,n=this.g,i=this.b,r=Math.max(e,n,i)/255,o=Math.min(e,n,i)/255;let a,h;const c=(o+r)/2;if(o===r)a=0,h=0;else{const u=r-o;switch(h=c<=.5?u/(r+o):u/(2-r-o),r){case e:a=(n-i)/u+(n<i?6:0);break;case n:a=(i-e)/u+2;break;case i:default:a=(e-n)/u+4;break}a/=6}return t&&t.setHSL(a,h,c,this.a),{h:a,s:h,l:c,a:this.a}}offsetHSL(t,e,n){const i=this.getHSL();return this.setHSL(i.h+t,i.s+e,i.l+n)}lerpHSL(t,e){const n=this.getHSL(),i=t.getHSL(),r=cs(n.h,i.h,e),o=cs(n.s,i.s,e),a=cs(n.l,i.l,e);return this.setHSL(r,o,a),this}setHSV(t,e,n,i=1){const r=N(t,0,1)*360,o=N(e,0,1),a=N(n,0,1),h=Math.floor(r/60)%6,c=r/60-Math.floor(r/60),u=a*(1-o),l=a*(1-c*o),m=a*(1-(1-c)*o),f=[[a,m,u],[l,a,u],[u,a,m],[u,l,a],[m,u,a],[a,u,l]][h];return this.r=f[0]*255,this.g=f[1]*255,this.b=f[2]*255,this.a=i,this}setHSB(t,e,n,i=1){this.setHSV(t,e,n,i)}getHSV(t){const{r:e,g:n,b:i,a:r}=this.color,o=Math.max(e,n,i),a=Math.min(e,n,i),h=o-a;let c;e===o?c=(n-i)/h:n===o?c=2+(i-e)/h:c=4+(e-n)/h,c/=6,c<0&&(c+=1);const u=h==0?0:c,l=o===0?0:h/o,m=o/255;return t&&t.setHSV(u,l,m,r),{h:u,s:l,v:m,a:r}}getHSB(t){const{h:e,s:n,v:i,a:r}=this.getHSV(t);return{h:e,s:n,b:i,a:r}}}const ge=new Ft,Lu="",je="srgb",vo="srgb-linear",_o="linear",Ws="srgb";function He(s){return s<.04045?s*.0773993808:Math.pow(s*.9478672986+.0521327014,2.4)}function We(s){return s<.0031308?s*12.92:1.055*Math.pow(s,.41666)-.055}const Ru=new dn().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),Ou=new dn().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715),zu=[.64,.33,.3,.6,.15,.06],Nu=[.2126,.7152,.0722],Bu=[.3127,.329],So={enabled:!0,workingColorSpace:vo,spaces:{},convert:function(s,t,e){return this.enabled===!1||t===e||!t||!e||(this.spaces[t].transfer===Ws&&(s.r=He(s.r),s.g=He(s.g),s.b=He(s.b)),this.spaces[t].primaries!==this.spaces[e].primaries&&(s.applyMatrix3(this.spaces[t].toXYZ),s.applyMatrix3(this.spaces[e].fromXYZ)),this.spaces[e].transfer===Ws&&(s.r=We(s.r),s.g=We(s.g),s.b=We(s.b))),s},fromWorkingColorSpace:function(s,t){return this.convert(s,this.workingColorSpace,t)},toWorkingColorSpace:function(s,t){return this.convert(s,t,this.workingColorSpace)},getPrimaries:function(s){return this.spaces[s].primaries},getTransfer:function(s){return s===Lu?_o:this.spaces[s].transfer},getLuminanceCoefficients:function(s,t=this.workingColorSpace){return s.fromArray(this.spaces[t].luminanceCoefficients)},define:function(s){Object.assign(this.spaces,s)},_getMatrix:function(s,t,e){return s.copy(this.spaces[t].toXYZ).multiply(this.spaces[e].fromXYZ)},_getDrawingBufferColorSpace:function(s){return this.spaces[s].outputColorSpaceConfig.drawingBufferColorSpace},_getUnpackColorSpace:function(s=this.workingColorSpace){return this.spaces[s].workingColorSpaceConfig.unpackColorSpace}};So.define({[vo]:{primaries:zu,whitePoint:Bu,transfer:_o,toXYZ:Ru,fromXYZ:Ou,luminanceCoefficients:Nu,workingColorSpaceConfig:{unpackColorSpace:je},outputColorSpaceConfig:{drawingBufferColorSpace:je}},[je]:{primaries:zu,whitePoint:Bu,transfer:Ws,toXYZ:Ru,fromXYZ:Ou,luminanceCoefficients:Nu,outputColorSpaceConfig:{drawingBufferColorSpace:je}}});function Co(s,t,e){return e<0&&(e+=1),e>1&&(e-=1),e<.16666666666666666?s+(t-s)*6*e:e<.5?t:e<.6666666666666666?s+(t-s)*6*(.6666666666666666-e):s}class ot{id;d;parent;attrs;_centerX;_centerY;_x;_y;_degree;_scaleX;_scaleY;vx;vy;ax;ay;mass;show;followMouse;drag;transform$=new ln;isMouseIn=!1;isDragging=!1;el;constructor(t){this.id=hs(),this.d=t?.d,this.attrs={stroke:"none",fill:"none"},t?.attrs&&this.setAttr(t?.attrs),this._centerX=t?.centerX,this._centerY=t?.centerY,this._x=t?.x||0,this._y=t?.y||0,this._degree=t?.degree||0,this._scaleX=1,this._scaleY=1,t?.scale!==void 0&&(this._scaleX=t.scale,this._scaleY=t.scale),t?.scaleX!==void 0&&(this._scaleX=t.scaleX),t?.scaleY!==void 0&&(this._scaleY=t.scaleY),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.show=typeof t?.show=="boolean"?t?.show:!0,this.followMouse=typeof t?.followMouse=="boolean"?t?.followMouse:!1,this.drag=t?.drag}destroy(){}moveTo(t,e){const n=this._x,i=this._y;(n!==t||i!==e)&&(this._x=t,this._y=e,this.transform$.next({dx:t-n,dy:e-i}))}move(t,e=0){this.moveTo(this._x+t,this._y+e)}moveXTo(t){this.moveTo(t,this._y)}moveX(t){this.moveTo(this._x+t,this._y)}moveYTo(t){this.moveTo(this._x,t)}moveY(t){this.moveTo(this._x,this._y+t)}get x(){return this._x}set x(t){this._x=t}get y(){return this._y}set y(t){this._y=t}rotateTo(t){this._degree=t}rotate(t){this.rotateTo(this._degree+t)}get degree(){return this._degree}set degree(t){this._degree=t}scaleTo(t,e){this._scaleX=t,this._scaleY=e||t}scale(t,e){this.scaleTo(this._scaleX*t,this._scaleY*(e||t))}get scaleX(){return this._scaleX}set scaleX(t){this._scaleX=t}get scaleY(){return this._scaleY}set scaleY(t){this._scaleY=t}pathD(){return this.d?(this.d instanceof _t||(this.d=new _t(this.d)),this.d):new _t(this.toSVGPathData())}forcePathD(t){this.d=t}getBaseOptions(){return{d:this.d,attrs:this.getAttrs(),centerX:this._centerX,centerY:this._centerY,x:this._x,y:this._y,degree:this._degree,scaleX:this._scaleX,scaleY:this._scaleY,vx:this.vx,vy:this.vy,ax:this.ax,ay:this.ay,mass:this.mass,followMouse:this.followMouse,drag:this.drag}}clone(){const t=this.cloneShape();return this.parent&&(t.parent={...this.parent}),t}cloneShape(){return new ot(this.getBaseOptions())}toSVGPathData(){return[]}toSVGPathD(){return this.pathD().toSVGPathD()}toCanvasContext(t){this.pathD().toCanvasContext(t)}getBoundingClientRect(t=2){return this.pathD().getBoundingClientRect(t)}getBoundingClientRectCenter(t=2){return this.pathD().getBoundingClientRectCenter(t)}transformOrigin(t=!1,e=2){let n=this._centerX||0,i=this._centerY||0;if(typeof this._centerX>"u"&&typeof this._centerY>"u"){const r=this.getBoundingClientRectCenter(e);if(t||!this.parent)n=r.x,i=r.y;else{const o=this.parent.combo.getBoundingClientRectCenter(e);n=o.x-this.parent.dx,i=o.y-this.parent.dy}}return{x:n,y:i}}isPointInPath(t,e,n){if(t instanceof bo)return t.isPointInPath(new Path2D(this.toSVGPathD()),e,n);if(this.el instanceof SVGGeometryElement){const i=this.el.getCTM();if(i){const r=i.inverse();return this.el.isPointInFill({x:r.a*e+r.c*n+r.e,y:r.b*e+r.d*n+r.f})}}return!1}isPointInStroke(t,e,n){if(t instanceof bo)return t.isPointInStroke(new Path2D(this.toSVGPathD()),e,n);if(this.el instanceof SVGGeometryElement){const i=this.el.getCTM();if(i){const r=i.inverse();return this.el.isPointInStroke({x:r.a*e+r.c*n+r.e,y:r.b*e+r.d*n+r.f})}}return!1}setAttr(t,e){if(typeof t!="string")for(const n in t){const i=t[n];i&&(this.attrs[wt(n)]=i)}else e&&(this.attrs[wt(t)]=e)}getAttr(t,e){return this.attrs[t]||this.attrs[wt(t)]||e}hasAttr(t){return!!this.getAttr(t)}getAttrs(){return{...this.attrs}}animate(t){this.vx+=this.ax,this.vy+=this.ay;const e=t?.gravity||0;this.vy+=e;const n=t?.friction||1;this.vx*=n,this.vy*=n,this.moveTo(this.x+this.vx,this.y+this.vy)}animateEaseTo(t,e){const n=e?.easing||.05,i=t.x-this.x,r=t.y-this.y;this.vx=i*n,this.vy=r*n,this.animate(e)}animateSpringTo(t,e){const n=e?.spring||.03;(Array.isArray(t)?t:[t]).forEach(i=>{const r=i.x-this.x,o=i.y-this.y,a=r*n,h=o*n;this.vx+=a,this.vy+=h}),this.animate({friction:.9,...e})}animateSpringMassTo(t,e){const n=e?.springLength||100,i=e?.spring||1e-4,r=t.x-this.x,o=t.y-this.y,a=Math.sqrt(r*r+o*o);if(a<n){const h=r*i,c=o*i;return this.vx+=h/this.mass,this.vy+=c/this.mass,t.vx-=h/t.mass,t.vy-=c/t.mass,1-a/n}return 0}distance(t){return Ee(this.x,this.y,t.x,t.y)}rotateToTarget(t){this.rotateTo(Et(Jt(this.x,this.y,t.x,t.y)))}followTo(t,e=3){this.rotateToTarget(t);const{dx:n,dy:i}=Pe(q(this.degree),e);this.vx=n,this.vy=i,this.animate()}followAccelerationTo(t,e=.05){this.rotateToTarget(t);const{dx:n,dy:i}=Pe(q(this.degree),e);this.ax=n,this.ay=i,this.animate()}gravitateTo(t){const e=t.x-this.x,n=t.y-this.y,i=e*e+n*n,r=Math.sqrt(i),o=this.mass*t.mass/i,a=o*e/r,h=o*n/r;this.vx+=a/this.mass,this.vy+=h/this.mass,t.vx-=a/t.mass,t.vy-=h/t.mass}checkCollision(t){}checkWall(t){}getTotalLength(){return this.pathD().getTotalLength()}interpolate(t){return this.pathD().interpolate(t)}getPointAtLength(t){return this.pathD().getPointAtLength(t)}trailPath(t=0){const e=this.getTotalLength();return{subPathD:this.pathD().getSubPathD(0,t*e),point:this.getPointAtLength(t*e)}}strokeDashTween(t=1e3,e){const n=Z(this.pathD().getTotalLength(),0);this.setAttr({strokeDasharray:`${n} ${n}`,strokeDashoffset:`${n}`});const i=e?.onUpdate,r=new On({frameDuration:t});r.addTween({offset:n},{offset:0},Object.assign(e||{},{onUpdate:(o,a)=>{this.setAttr("strokeDashoffset",""+Z(o.offset,2)),i?.(o,a)}})),r.play()}}class Lt{options;commonChildShapeOptions;shapes=[];x=0;y=0;degree=0;scaleX=1;scaleY=1;constructor(t,e){if(this.options=t,this.commonChildShapeOptions=e,t?.svg){let n=0,i=0,r=0,o=0;const a=new N1(t.svg).parse();for(let h=0,c=a.length;h<c;h++){const u=a[h];if(u.type=="viewbox"&&u.width&&u.height){if(n=parseFloat(u.width),i=parseFloat(u.height),t.forceWidth){const y=n/i;r=t.forceWidth,o=r/y}else r=n,o=i;continue}if(u.type!="path"||!Eu(u.path))continue;const l={};for(const y in u)y==="type"||y==="path"||y==="transform"||(l[y]=u[y]);const m=Mu(Pu(u.path)),f=[];let p=[];for(let y=0,v=m.length;y<v;y++){const w=m[y];p.push(w),w[0].toLowerCase()=="z"&&(f.push(p),p=[])}p.length&&f.push(p),f.forEach(y=>{const v=new ot({...e,d:y,attrs:{...e?.attrs,...l}});if(u.transform){const _=Fr(u.transform).split();v.moveTo(_.x,_.y),v.rotateTo(_.degree),v.scaleTo(_.scaleX,_.scaleY)}r&&n&&o&&i&&v.scaleTo(v.scaleX*(r/n),v.scaleY*(o/i)),this.addShape(v)})}}}destroy(){this.shapes.forEach(t=>t.destroy())}clone(){const t=this.cloneShapeCombo();return t.x=this.x,t.y=this.y,t.degree=this.degree,t.scaleX=this.scaleX,t.scaleY=this.scaleY,t.shapes=this.shapes.map(e=>{const n=e.clone();return n.parent&&(n.parent.combo=t),n}),t}cloneShapeCombo(){return new Lt(this.options,this.commonChildShapeOptions)}addShape(t,e=0,n=0){t.parent={combo:this,dx:e||t.x,dy:n||t.y},this.shapes.push(t)}comboMove(t,e){this.x+=t,this.y+=e,this.shapes.forEach(n=>{n.move(t,e)})}comboRotate(t){this.degree+=t,this.shapes.forEach(e=>{e.rotate(t)})}comboScale(t,e){this.scaleX*=t,this.scaleY*=e||t,this.shapes.forEach(n=>{n.scale(t,e)})}comboTransform(t){(typeof t?.x=="number"||typeof t?.y=="number")&&this.comboMove(t?.x||0,t?.y||0),typeof t?.degree=="number"&&this.comboRotate(t?.degree||0),(typeof t?.scale=="number"||typeof t?.scaleX=="number"||typeof t?.scaleY=="number")&&this.comboScale(t?.scaleX||t?.scale||1,t?.scaleY||t?.scale||1)}getBoundingClientRect(t=2){const e=[],n=[];if(this.shapes.forEach(h=>{const c=h.getBoundingClientRect(t);e.push(c.x,c.x+c.width),n.push(c.y,c.y+c.height)}),e.length==0||n.length==0)return{x:0,y:0,width:0,height:0,center:{x:0,y:0}};const i=Math.min(...e),r=Math.min(...n),o=Math.max(...e),a=Math.max(...n);return{x:Z(i,t),y:Z(r,t),width:Z(o-i,t),height:Z(a-r,t)}}getBoundingClientRectCenter(t=2){const e=this.getBoundingClientRect(t);return{x:Z(e.x+e.width*.5,t),y:Z(e.y+e.height*.5,t)}}setAttr(t,e){typeof t!="string"?this.shapes.forEach(n=>{n.setAttr(t)}):e&&this.shapes.forEach(n=>{n.setAttr(t,e)})}sort(){this.shapes=this.shapes.map(t=>({shape:t,perimeter:t.pathD().getPolymorphPointsPerimeter()})).sort((t,e)=>e.perimeter-t.perimeter).map(t=>t.shape)}expendTo(t){const e=t.shapes.length,n=this.shapes.length;if(e<n)return t.expendTo(this);for(let i=n;i<e;i++)this.addShape(t.shapes[i].clone())}strokeDashTween(t,e){const n=this.shapes.length-1;switch(e?.type){case"sequence":this.shapes.forEach((a,h)=>{a.strokeDashTween(t,{...e,delay:h,onStart:()=>{h==0&&e?.onGroupStart?.()},onUpdate:()=>{e?.onGroupUpdate?.()},onComplete:()=>{h==n&&e?.onGroupComplete?.()}})});break;case"parallel":default:const i=new On({frameDuration:t}),r={},o={};this.shapes.forEach((a,h)=>{const c=Z(a.getTotalLength(),0);r[`offset_${h}`]=c,o[`offset_${h}`]=0,a.setAttr({strokeDasharray:`${c} ${c}`,strokeDashoffset:`${c}`})}),i.addTween(r,o,Object.assign(e||{},{onStart:()=>{e?.onGroupStart?.()},onUpdate:(a,h)=>{for(const c in a){const u=Ql(c).number;this.shapes[u].setAttr("strokeDashoffset",""+Z(a[c],2))}e?.onGroupUpdate?.()},onComplete:()=>{e?.onGroupComplete?.()}})),i.play();break}}}function X1(s,t){s.forEach(n=>{n.animate(),t?.wall&&n.checkWall({wall:t.wall,bounce:t.bounce})});const e=s.length;for(let n=0,i=e-1;n<i;n++)for(let r=n+1;r<e;r++)s[n].checkCollision(s[r])}function U1(s){const t=s.length;s.forEach((e,n)=>{e.animate();for(let i=n+1;i<t;i++)e.checkCollision(s[i]),e.gravitateTo(s[i])})}function $1(s,t){s.forEach((e,n)=>{n>0&&e.animateSpringTo(s[n-1],t)})}function V1(s,t){const e=t?.springLength||100;s.forEach(n=>{n.isDragging||s.filter(i=>i.id!==n.id).forEach(i=>{const r=Jt(n.x,n.y,i.x,i.y);n.animateSpringTo({x:i.x-Math.cos(r)*e,y:i.y-Math.sin(r)*e},t)})})}function G1(s,t,e){const n=s.length,i=[];return s.forEach((r,o)=>{r.animate(e),r.x>t.x+t.width?r.moveXTo(t.x):r.x<t.x&&r.moveXTo(t.x+t.width),r.y>t.y+t.height?r.moveYTo(t.y):r.y<t.y&&r.moveYTo(t.y+t.height);for(let a=o+1;a<n;a++)i.push([r.x,r.y,s[a].x,s[a].y,r.animateSpringMassTo(s[a],e)])}),i}function To(s){if(s.length<2)throw new Error("shapes个数必须大于等于2");const t=s.length-1,e=new Array(t);for(let n=0;n<t;n++){const i=s[n].pathD(),r=s[n+1].pathD(),o=Math.max(i.getPolymorphPoints().length,r.getPolymorphPoints().length);e[n]=_t.getInterpolator(i.getExpendedPolymorphPointsPathD(o),r.getExpendedPolymorphPointsPathD(o))}return n=>{const i=Z(t*n,6),r=Math.min(Math.floor(i),t-1),o=Z(i-r,6),a=new ot({d:e[r](o)}),h=s[r].getAttr("fill","none"),c=s[r+1].getAttr("fill","none");typeof h=="string"&&typeof c=="string"&&a.setAttr("fill",Ft.gradient(h,c,o).toString());const u=s[r].getAttr("stroke","none"),l=s[r+1].getAttr("stroke","none");return typeof u=="string"&&typeof l=="string"&&a.setAttr("stroke",Ft.gradient(u,l,o).toString()),a}}function Fu(s){if(s.length<2)throw new Error("shapeCombos个数必须大于等于2");let t=0,e;const n=[];s.forEach(o=>{let a;o instanceof Lt?(a=o,a.sort()):(a=new Lt,a.addShape(o)),n.push(a),t<a.shapes.length&&(t=a.shapes.length,e=a)}),n.forEach(o=>{o!==e&&o.expendTo(e)});const i=[];n.forEach((o,a)=>{o.shapes.forEach((h,c)=>{i[c]=i[c]||[],i[c][a]=h})});const r=[];return i.forEach(o=>{r.push(To(o))}),o=>{const a=new Lt;return r.forEach(h=>{a.addShape(h(o))}),a}}function q1(s,t=6e3,e){const n=s.findIndex(a=>a instanceof Lt)>=0?Fu(s):To(s),i=n(0),r=e?.onUpdate,o=new On({frameDuration:t});o.addTween({t:0},{t:1},Object.assign(e||{},{onUpdate:(a,h)=>{n(a.t),r?.(a,h),i instanceof ot?e?.shape?.(i):i instanceof Lt&&i.shapes.forEach(c=>{e?.shape?.(c)})}})),o.play()}function j1(s,t,e,n,i){if(i==0)throw new Error("no dividing by zero, please");const r=[],o=360/i;for(let h=0;h<i;h+=1){const c=o*h*Math.PI/180,u=s+2*e*Math.cos(c),l=t+2*e*Math.sin(c);r.push(new uo({x:s,y:t,rx:e,ry:n,xAxisRotate:o*h,largeArcFlag:1,sweepFlag:1,toX:u,toY:l})),r.push(new uo({x:u,y:l,rx:e,ry:n,xAxisRotate:o*h,largeArcFlag:1,sweepFlag:1,toX:s,toY:t}))}return new ot({d:_t.fromLines(r)})}class H1{PARENT_EL;SVG_EL=null;CANVAS_EL=null;ctx=null;rect={x:0,y:0,width:0,height:0};size$=new Mm(null);resizeSubscription;mpg=qe();mouseSubscription;shapes=[];lastMouseInShapeId="";draggingShapeId="";prevCursor="default";constructor(t=document.documentElement,e="canvas",n=!1){this.PARENT_EL=t,(e=="svg"||e=="canvas")&&Gc(this.PARENT_EL),e=="svg"&&(this.SVG_EL=Tu("svg"),qn(this.PARENT_EL,this.SVG_EL)),e=="canvas"&&(this.CANVAS_EL=Wc("canvas"),qn(this.PARENT_EL,this.CANVAS_EL)),this.resizeSubscription=ho(this.PARENT_EL).subscribe(i=>{this.rect.x=i.x,this.rect.y=i.y,this.rect.width=i.width,this.rect.height=i.height,this.SVG_EL&&Ge(this.SVG_EL,{viewBox:`0 0 ${this.rect.width} ${this.rect.height}`,width:`${this.rect.width}`,height:`${this.rect.height}`}),this.CANVAS_EL&&(Ge(this.CANVAS_EL,{width:`${this.rect.width}`,height:`${this.rect.height}`}),this.ctx=new bo(this.CANVAS_EL,this.rect.width,this.rect.height,n)),this.size$.next(i)}),this.mouseSubscription=du(this.SVG_EL||this.CANVAS_EL||this.PARENT_EL,{useMousePoint:this.mpg}).subscribe(()=>{})}destroy(){this.resizeSubscription.unsubscribe(),this.mouseSubscription.unsubscribe()}setCursor(t="default"){t!=this.prevCursor&&(this.PARENT_EL.style.cursor=t,this.prevCursor=t)}animateShape(t){t.followMouse&&(!wa(t.x,this.mpg.current.x,5)||!wa(t.y,this.mpg.current.y,5))&&t.followTo(this.mpg.current),t.drag&&t.drag.enable&&t.drag.targetToAfterDrop&&(t.isDragging||t.animateEaseTo(t.drag.targetToAfterDrop,{easing:t.drag.easing}))}draw(...t){const e=[];t.forEach(n=>{n instanceof Lt?e.push(...n.shapes):e.push(n)}),this.SVG_EL&&this.shapes.filter(n=>e.findIndex(i=>i.id==n.id)==-1).forEach(n=>{n.el&&(n.el.remove(),delete n.el)}),this.ctx&&this.ctx.clearRect(),ql(this.shapes,e),this.lastMouseInShapeId="",this.mpg.current.isDown||(this.draggingShapeId="");for(const n of this.shapes){if(!n.show)continue;this.animateShape(n);const i=n.transformOrigin(),r=i.x,o=i.y;if(this.SVG_EL){const a=n.toSVGPathD();n.el||(n.el=L1(a,n.id),qn(this.SVG_EL,n.el));const h=new vt;h.translate(n.x,n.y),h.rotate(n.degree,r,o),h.scale(n.scaleX,n.scaleY,r,o),Ge(n.el,{d:a,transform:h.toString(),...n.getAttrs()})}if(this.ctx&&(this.ctx.save(),this.ctx.translate(n.x,n.y),this.ctx.rotate(q(n.degree),r,o),this.ctx.scale(n.scaleX,n.scaleY,r,o),n.toCanvasContext(this.ctx),xc(this.ctx,n.getAttrs()),this.ctx.hasSetCustomStrokeStyle&&this.ctx.stroke(),this.ctx.hasSetCustomFillStyle&&this.ctx.fill()),this.SVG_EL?n.isMouseIn=n.isPointInPath(this.SVG_EL,this.mpg.current.x,this.mpg.current.y)||n.isPointInStroke(this.SVG_EL,this.mpg.current.x,this.mpg.current.y):this.ctx?n.isMouseIn=n.isPointInPath(this.ctx,this.mpg.current.x,this.mpg.current.y)||n.isPointInStroke(this.ctx,this.mpg.current.x,this.mpg.current.y):n.isMouseIn=!1,n.isMouseIn&&(this.setCursor("pointer"),this.lastMouseInShapeId=n.id),n.isDragging=n.id==this.draggingShapeId,this.mpg.current.isDown&&(n.isDragging||!this.draggingShapeId&&n.isMouseIn&&n.drag&&n.drag.enable)){this.setCursor("grabbing"),n.isDragging=!0,this.draggingShapeId=n.id;let a=this.mpg.current.x-this.mpg.start.x,h=this.mpg.current.y-this.mpg.start.y;if(a||h){if(n.drag&&n.drag.enable&&n.drag.alongPath){const c=n.parent?n.parent.combo.x:n.x,u=n.parent?n.parent.combo.y:n.y,l=r+(n.parent?.dx||0),m=o+(n.parent?.dy||0),f=n.parent?n.parent.combo.degree:n.degree,p=n.parent?n.parent.combo.scaleX:n.scaleX,y=n.parent?n.parent.combo.scaleY:n.scaleY,w=n.drag.alongPath.transform(c,u,l,m,f,p,y).closestPoint(this.mpg.current.x,this.mpg.current.y),_=n.x,x=n.y;a=w.point.x-_,h=w.point.y-x}(a||h)&&(n.move(a,h),n.parent?.combo.shapes.forEach(c=>{c.drag?.followSibling&&c!==n&&c.move(a,h)}))}this.mpg.setStart(this.mpg.current)}else n.isMouseIn&&n.drag&&n.drag.enable&&this.setCursor("grab");this.ctx&&this.ctx.restore()}!this.lastMouseInShapeId&&!this.draggingShapeId&&this.setCursor("default")}drawMouseMoveLine(t){const e=t?.brushSize||4,n=t?.brushColor||"#000000";let i=!1;const r=Gs(this.SVG_EL||this.CANVAS_EL||this.PARENT_EL,{start:()=>{i=!1,this.ctx&&(this.ctx.save(),this.ctx.lineWidth=e,this.ctx.strokeStyle=n,this.ctx.beginPath())},end:()=>{this.ctx&&this.ctx.restore()}}).subscribe(o=>{this.ctx&&(i?this.ctx.lineTo(o.current.x,o.current.y):(i=!0,this.ctx.moveTo(o.current.x,o.current.y)),this.ctx.stroke())});return()=>{r.unsubscribe()}}drawMouseMoveBrush(t){const e=t?.brushSize||10,n=t?.brushDensity||50,i=t?.brushColor||"#000000",r=new Ft(i),o=r.r,a=r.g,h=r.b,c=Gs(this.SVG_EL||this.CANVAS_EL||this.PARENT_EL).subscribe(u=>{if(this.ctx){const l=this.ctx.getImageData(0,0,this.ctx.canvas.width,this.ctx.canvas.height),m=l.data;for(let f=0;f<n;f++){const p=Math.random()*Math.PI*2,y=Math.random()*e,v=u.current.x+Math.cos(p)*y|0,w=u.current.y+Math.sin(p)*y|0,_=(v+w*l.width)*4;m[_]=o,m[_+1]=a,m[_+2]=h,m[_+3]=255}this.ctx.putImageData(l)}});return()=>{c.unsubscribe()}}downloadSVG=()=>{this.SVG_EL&&R1(this.SVG_EL)}}class Je extends ot{dx;dy;startColor;endColor;constructor(t){if(super(t),t?.lineLength){const e=Pe(q(t?.lineDegree||0),t.lineLength);this.dx=e.dx,this.dy=e.dy}else t?.lineDx||t?.lineDy?(this.dx=t?.lineDx||0,this.dy=t?.lineDy||0):(this.dx=0,this.dy=0);this.startColor=t?.startColor,this.endColor=t?.endColor,this.setAttr({stroke:this.startColor||"#000000"})}cloneShape(){return new Je({...super.getBaseOptions(),lineDx:this.dx,lineDy:this.dy})}enableGradient(t,e){this.startColor=t,this.endColor=e,this.setAttr({stroke:this.startColor})}disableGradient(t){this.startColor=t,this.endColor=void 0,this.setAttr({stroke:this.startColor})}toSVGPathData(){return[["m",0,0],["l",this.dx,this.dy]]}toCanvasContext(t){this.startColor&&this.endColor&&this.setAttr({stroke:t.createLinearGradient(0,0,this.dx,this.dy,{0:this.startColor,1:this.endColor})}),t.beginPath(),t.moveTo(0,0),t.lineTo(this.dx,this.dy)}lineToAbsolutePoint(t){this.dx=t.x-this.x,this.dy=t.y-this.y}intersection(t){const e=this.transformOrigin(),i=this.pathD().transform(this.x,this.y,e.x,e.y,this.degree,this.scaleX,this.scaleY).normalizedLines[0],r=t.transformOrigin(),a=t.pathD().transform(this.x,this.y,r.x,r.y,t.degree,t.scaleX,t.scaleY).normalizedLines[0];return i.intersection(a)}}class Eo extends Lt{constructor(t,e){super(t,e);const n=new Je({...e,drag:{...e?.drag,followSibling:!0},lineLength:100,lineDegree:90});this.addShape(n);const i=new Je({...e,drag:{...e?.drag,followSibling:!0},y:10+Math.random()*30,lineLength:10+Math.random()*30,lineDegree:Math.random()*120-150});this.addShape(i);const r=new Je({...e,drag:{...e?.drag,followSibling:!0},y:10+Math.random()*30,lineLength:10+Math.random()*30,lineDegree:Math.random()*120-150});this.addShape(r)}cloneShapeCombo(){return new Eo(this.options,this.commonChildShapeOptions)}}class yn extends ot{radius;constructor(t){super(t),this.radius=t?.ballRadius||0}cloneShape(){return new yn({...super.getBaseOptions(),ballRadius:this.radius})}getBoundingClientRect(){return{x:-this.radius,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 fn(this.x,this.y)}scalar(t){return this.moveTo(this.x*t,this.y*t),this}normalize(t=1){const e=this.length();if(e){const n=t/e;this.scalar(n)}return this}clamp(t){const e=this.length();return e&&e>t&&this.scalar(t/e),this}cross(t){const e=this.x,n=this.y;return{x:n*t.x-e*t.y,y:e*t.y-n*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,n=t.y-this.y;if(Math.sqrt(e*e+n*n)<this.radius+t.radius){const r=Math.atan2(n,e),o={x:0,y:0},a=Qt(-r,e,n),h=Qt(-r,this.vx,this.vy),c=Qt(-r,t.vx,t.vy),u=h.x-c.x;h.x=((this.mass-t.mass)*h.x+2*t.mass*c.x)/(this.mass+t.mass),c.x=u+h.x;const l=Math.abs(h.x)+Math.abs(c.x),m=this.radius+t.radius-Math.abs(o.x-a.x);o.x+=h.x/l*m,a.x+=c.x/l*m;const f=Qt(r,o.x,o.y),p=Qt(r,a.x,a.y);t.moveTo(this.x+p.x,this.y+p.y),this.moveTo(this.x+f.x,this.y+f.y);const y=Qt(r,h.x,h.y),v=Qt(r,c.x,c.y);this.vx=y.x,this.vy=y.y,t.vx=v.x,t.vy=v.y}}checkWall(t){const e=typeof t?.bounce=="number"?t.bounce:-1,n=t.wall.x,i=t.wall.y,r=t.wall.x+t.wall.width,o=t.wall.y+t.wall.height;this.x+this.radius>r?(this.moveXTo(r-this.radius),this.vx*=e):this.x-this.radius<n&&(this.moveXTo(n+this.radius),this.vx*=e),this.y+this.radius>o?(this.moveYTo(o-this.radius),this.vy*=e):this.y-this.radius<i&&(this.moveYTo(i+this.radius),this.vy*=e)}}class Po extends ot{constructor(t){super(t)}cloneShape(){return new Po({...super.getBaseOptions()})}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 Ze extends ot{width;height;borderRadius;constructor(t){super(t),this.width=t.rectWidth,this.height=t.rectHeight,this.borderRadius=t.rectBorderRadius||0}cloneShape(){return new Ze({...super.getBaseOptions(),rectWidth:this.width,rectHeight:this.height,rectBorderRadius:this.borderRadius})}static fromCubicBezier(t,e,n,i,r,o,a,h){const u=new gt({x:t,y:e,c1x:n,c1y:i,c2x:r,c2y:o,toX:a,toY:h}).getBoundingClientRect();return new Ze({x:u.x,y:u.y,rectWidth:u.width,rectHeight:u.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){return t.x>=this.x&&t.x<=this.x+this.width&&t.y>=this.y&&t.y<=this.y+this.height}}class Mo extends ot{rx;ry;constructor(t){super(t),this.rx=t?.heartRx||10,this.ry=t?.heartRy||10}cloneShape(){return new Mo({...super.getBaseOptions(),heartRx:this.rx,heartRy:this.ry})}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 Ao extends ot{rx;ry;constructor(t){super(t),this.rx=t?.heartRx??50,this.ry=t?.heartRy??50}cloneShape(){return new Ao({...super.getBaseOptions(),heartRx:this.rx,heartRy:this.ry})}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 ko extends ot{r;constructor(t){super(t),this.r=t?.starR||20}cloneShape(){return new ko({...super.getBaseOptions(),starR:this.r})}toSVGPathData(){const t=[["m",0,-this.r]];for(let e=0;e<6;e+=1){const n=288+e*144,i=this.r*Math.cos(q(n)),r=this.r*Math.sin(q(n));t.push(["l",i,r])}return t}}class Io extends ot{constructor(t){super(t)}cloneShape(){return new Io({...super.getBaseOptions()})}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 Do extends ot{constructor(t){super(t)}cloneShape(){return new Do({...super.getBaseOptions()})}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 Lo extends ot{constructor(t){super(t),this.d="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"}cloneShape(){return new Lo({...super.getBaseOptions()})}}class Ro extends ot{rx;ry;constructor(t){super(t),this.rx=t?.rx||0,this.ry=t?.ry||0}cloneShape(){return new Ro({...super.getBaseOptions(),rx:this.rx,ry:this.ry})}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 Oo extends Lt{constructor(t,e){super(t,e);const n=new ot({...e,drag:{...e?.drag,followSibling:!0},show:typeof t?.showFlame=="boolean"?t.showFlame:!1,d:[["M",-15,0],["L",-2.5,-5],["L",-2.5,5],["Z"]]});this.addShape(n);const i=new ot({...e,drag:{...e?.drag,followSibling:!0},d:[["M",10,0],["L",-10,10],["L",-5,0],["L",-10,-10],["L",10,0],["Z"]]});this.addShape(i)}cloneShapeCombo(){return new Oo({...this.options,showFlame:this.showFlame},this.commonChildShapeOptions)}set showFlame(t){this.shapes[0].show=t}get showFlame(){return this.shapes[0].show}}class zo extends Lt{width;height;cornerRadius;constructor(t,e){super(t,e),this.width=t.segmentWidth,this.height=t.segmentHeight,this.cornerRadius=typeof t.segmentCornerRadius=="number"?t.segmentCornerRadius:this.height*.5;const n=new Ze({...e,drag:{...e?.drag,followSibling:!0},x:0-this.cornerRadius,y:0-this.height*.5,rectWidth:this.width+this.cornerRadius*2,rectHeight:this.height,rectBorderRadius:this.cornerRadius});this.addShape(n);const i=new yn({...e,drag:{...e?.drag,followSibling:!0},x:0,y:0,ballRadius:2});this.addShape(i);const r=new yn({...e,drag:{...e?.drag,followSibling:!0},x:0+this.width,y:0,ballRadius:2});this.addShape(r)}cloneShapeCombo(){return new zo({...this.options,segmentWidth:this.width,segmentHeight:this.height},this.commonChildShapeOptions)}getBoundingClientRectCenter(){return{x:0,y:0}}getPin(){const t=this.shapes[1];return{x:t.x+Math.cos(q(t.degree))*this.width,y:t.y+Math.sin(q(t.degree))*this.width}}}class No extends Lt{value$=new ln;subscription;constructor(t,e){super(t,e);const n=t?.sliderMin||0,i=t?.sliderMax||100,r=t?.sliderStep||1,o=Jl(n,i,r),a=o(typeof t?.sliderDefaultValue=="number"?N(t.sliderDefaultValue,n,i):n);this.value$.next(a);const h=a/(i-n),c=t?.sliderWidth||100,u=t?.sliderHeight||4,l=u*.5,m=u*2.5,f=t?.sliderBackgroundColor||"#f5f5f5",p=t?.sliderForegroundColor||"#5a82f0",y=new Ze({...e,rectWidth:c,rectHeight:u,rectBorderRadius:l,attrs:{...e?.attrs,fill:f},drag:{...e?.drag,enable:!1}});this.addShape(y);const v=new Ze({...e,rectWidth:c*h,rectHeight:u,rectBorderRadius:l,attrs:{...e?.attrs,fill:p},drag:{...e?.drag,enable:!1}});this.addShape(v);const w=new yn({...e,x:c*h,y:l,ballRadius:m,attrs:{...e?.attrs,fill:p},drag:{...e?.drag,enable:!0,alongPath:new _t([["m",0,0],["l",c,0]])}});this.addShape(w),this.subscription=w.transform$.subscribe(({dx:_})=>{v.width=N(v.width+(_||0),0,c),this.value$.next(o((w.x-y.x)/c*(i-n)+n))})}destroy(){super.destroy(),this.subscription.unsubscribe()}cloneShapeCombo(){return new No({...this.options},this.commonChildShapeOptions)}}class Kn extends ot{half;lineWidth;radius;startDegree;endDegree;percent=0;percentDegree=0;startColor;endColor;constructor(t){super(t),this.half=typeof t?.half=="boolean"?t?.half:!1,this.lineWidth=t.lineWidth;const e=t.width||0,n=t.height||0,i=(t.endDegree-t.startDegree-180)/2;if(t.radius)this.radius=t.radius;else if(this.half){const r=Math.min(e/2,n)-this.lineWidth;this.radius=Math.max(0,r-r*Math.sin(q(i)))}else this.radius=Math.max(0,Math.min(e/2,n/2)-this.lineWidth);t.x||(this.x=e/2),t.y||(this.half?this.y=n-this.lineWidth-this.radius*Math.sin(q(i)):this.y=n/2),t.forceCoordinate?(this.startDegree=t.startDegree,this.endDegree=t.endDegree):(this.startDegree=-90+t.startDegree,this.endDegree=-90+t.endDegree),this.startColor=t?.startColor,this.endColor=t?.endColor,this.setAttr({"stroke-linecap":"round","stroke-width":String(this.lineWidth),stroke:this.startColor||"#000000"}),this.setPercent(t.percent||1)}cloneShape(){return new Kn({...super.getBaseOptions(),half:this.half,lineWidth:this.lineWidth,radius:this.radius,forceCoordinate:!0,startDegree:this.startDegree,endDegree:this.endDegree,startColor:this.startColor,endColor:this.endColor,percent:this.percent})}setPercent(t){this.percent=Math.max(0,t),this.percentDegree=this.startDegree+(this.endDegree-this.startDegree)*t}enableGradient(t,e){this.startColor=t,this.endColor=e,this.setAttr({stroke:this.startColor})}disableGradient(t){this.startColor=t,this.endColor=void 0,this.setAttr({stroke:this.startColor})}toSVGPathData(){const{dx:t,dy:e}=Pe(q(this.startDegree),this.radius),{dx:n,dy:i}=Pe(q(this.percentDegree),this.radius);return[["m",t,e],["a",this.radius,this.radius,0,Math.abs(this.percentDegree-this.startDegree)>=180?1:0,1,n-t,i-e]]}toCanvasContext(t){if(this.startColor&&this.endColor){let e;if(this.half){const n=this.radius-this.radius*Math.cos(Math.PI*this.percent),i=this.radius*Math.sin(Math.PI*this.percent);e=t.createLinearGradient(-this.radius,0,-this.radius+n,-i,{0:this.startColor,1:this.endColor})}else{const n=this.radius*Math.sin(2*Math.PI*this.percent),i=this.radius*Math.cos(2*Math.PI*this.percent);e=t.createLinearGradient(0,-this.radius,n,-i,{0:this.startColor,1:this.endColor})}this.setAttr({stroke:e})}t.beginPath(),t.arc(0,0,this.radius,q(this.startDegree),q(this.percentDegree),!1)}}class Bo extends Lt{half;lineWidth;width;height;bgColor;startColor;endColor;startDegree;endDegree;percent=0;ringBg;ring;lines=[];indicatorLineCount;constructor(t,e){if(super(t,e),this.half=typeof t?.half=="boolean"?t?.half:!1,this.lineWidth=t?.lineWidth||12,this.width=t.width,this.height=t.height,this.bgColor=t?.bgColor,this.startColor=t?.startColor,this.endColor=t?.endColor,this.half?(this.startDegree=t?.startDegree||-105,this.endDegree=t?.endDegree||105):(this.startDegree=t?.startDegree||0,this.endDegree=t?.endDegree||360),this.percent=t?.percent||0,this.ringBg=new Kn({half:this.half,lineWidth:this.lineWidth,width:t.width,height:t.height,startDegree:this.startDegree,endDegree:this.endDegree,startColor:this.bgColor,percent:1}),this.addShape(this.ringBg),this.ring=new Kn({half:this.half,lineWidth:this.lineWidth,width:t.width,height:t.height,startDegree:this.startDegree,endDegree:this.endDegree,startColor:this.startColor,endColor:this.endColor,percent:0}),this.addShape(this.ring),this.indicatorLineCount=23,this.half){const o=this.ringBg.radius-20-17;for(let a=0;a<this.indicatorLineCount;a++){const h=-90+this.startDegree+(this.endDegree-this.startDegree)/(this.indicatorLineCount-1)*a,c=new Je({x:this.ringBg.x+Math.cos(q(h))*o,y:this.ringBg.y+Math.sin(q(h))*o,lineLength:17,lineDegree:h,attrs:{"stroke-linecap":"round","stroke-width":String(2),stroke:this.bgColor}});this.lines.push(c),this.addShape(c)}}this.setPercent(t.percent||0)}cloneShapeCombo(){return new Bo({half:this.half,lineWidth:this.lineWidth,width:this.width,height:this.height,bgColor:this.bgColor,startColor:this.startColor,endColor:this.endColor,startDegree:this.startDegree,endDegree:this.endDegree,percent:this.percent},this.commonChildShapeOptions)}setPercent(t){if(this.percent=Math.max(0,t),this.ring.setPercent(t),this.half)for(let e=0;e<this.indicatorLineCount;e++)e/(this.indicatorLineCount-1)<=this.percent?this.lines[e].enableGradient(this.startColor,this.endColor):this.lines[e].disableGradient(this.bgColor)}}function Yu(s,t={attributes:!0,childList:!0,subtree:!0}){return new et(e=>{const n=new MutationObserver((i,r)=>{e.next(i)});return n.observe(s,t),()=>{n.disconnect()}})}function Xu(s,t={root:null}){return new et(e=>{const n=new IntersectionObserver((i,r)=>{if(i.length){const o=i[i.length-1];o&&e.next(o)}},t);return n.observe(s),()=>{n.unobserve(s),n.disconnect()}})}function W1(s,t){return mu().pipe(Se(null),rt(()=>{const{width:e,height:n}=t?.root?.getBoundingClientRect()||pu(),{top:i,left:r,right:o,bottom:a}=s.getBoundingClientRect();return(i>=0&&i<=n||a>=0&&a<=n)&&(r>=0&&r<=e||o>=0&&o<=e)}),_e())}function J1(s,t){const e=typeof t?.threshold=="number"?t.threshold:.5;return Xu(s,{threshold:e,root:t?.root}).pipe(rt(n=>n.isIntersecting&&n.intersectionRatio>=e),_e())}let Uu=!1;function Z1(){Uu||(Uu=!0,yc(`
|
|
28
28
|
:root {
|
|
29
29
|
--sat:env(safe-area-inset-top, 0px);
|
|
30
30
|
--sar:env(safe-area-inset-right, 0px);
|
|
@@ -37,15 +37,15 @@ var ZYZGroupCoreWeb=function(m){"use strict";const _l={};function Sl(){return ty
|
|
|
37
37
|
--sab:env(safe-area-inset-bottom, 0px);
|
|
38
38
|
--sal:env(safe-area-inset-left, 0px);
|
|
39
39
|
}
|
|
40
|
-
`))}nw();function sw(){return oo(document.documentElement).pipe(hr(or),rt(()=>{const s=getComputedStyle(document.documentElement);return{bottom:s.getPropertyValue("--sab"),top:s.getPropertyValue("--sat"),right:s.getPropertyValue("--sar"),left:s.getPropertyValue("--sal")}}))}function iw(s={enableHighAccuracy:!0,timeout:5e3,maximumAge:0}){return new nt(t=>{if(!("geolocation"in navigator))return t.error("navigator.geolocation is not available.");let e;return new Promise((n,i)=>{navigator.geolocation.getCurrentPosition(r=>{t.next({longitude:r.coords.longitude,latitude:r.coords.latitude}),n()},r=>{i(r)})}).then(()=>{e=navigator.geolocation.watchPosition(n=>{t.next({longitude:n.coords.longitude,latitude:n.coords.latitude})},n=>{t.error(n)},s)}).catch(n=>{t.error(n)}),()=>{typeof e=="number"&&navigator.geolocation.clearWatch(e)}})}function $u(s="(prefers-color-scheme: dark)"){const t=window.matchMedia(s);return X(t,"change").pipe(rt(e=>e.matches),Se(t.matches),_e())}function Vu(){return Yu(document).pipe(rt(()=>location),Se(location))}function rw(){return Vu().pipe(rt(s=>s.href),Se(location.href),_e())}function ow(){return X(window,"hashchange").pipe(rt(s=>s.target.location.hash.replace("#","")),Se(window.location.hash.replace("#","")),_e())}function aw(){return X(window,"popstate").pipe(rt(s=>s.state),Se(null),_e())}function cw(s,t,e){if(typeof t=="string"&&(t=oa(t)),(typeof t=="string"||t===void 0)&&e===void 0){const n=Object.assign({},s.dataset);return Object.keys(n).forEach(i=>{if(n[i]?.startsWith("[")||n[i]?.startsWith("{"))try{n[i]=JSON.parse(n[i]||"")}catch{}}),typeof t=="string"?n[t]:n}else{let n={};typeof t=="object"?n=t:typeof t=="string"&&(n[t]=e),Object.entries(n).forEach(([i,r])=>{r?s.dataset[i]=r instanceof Object?JSON.stringify(r):r:delete s.dataset[i]})}}function hw(s,t){t.split(/[,\s]+/).forEach(e=>{e.trim()!=""&&delete s.dataset[e.trim()]})}function Oo(s,t){const e=Math.max(t?.aliveInSeconds||0,0),n=Math.max(t?.aliveUntilTimestamp||0,0);function i(o,a=!1){return $l(o)||!El(o,xn)?{v:o,[xn]:se()}:a?o:{...o,[xn]:se()}}let r=i(s,!0);return{get:()=>{let o=r.v;return(e&&se()>r[xn]+e*1e3||n&&se()>n)&&(o=void 0),{value:typeof o<"u"?r:void 0,rawValue:o}},set:o=>r=i(o)}}function Gu(s,t){const e=typeof s=="string"?s:s.toString();let n=t?.initValue;if(typeof n>"u")try{const a=window.localStorage.getItem(e);a&&(n=na(a))}catch{}const{get:i,set:r}=Oo(n,{aliveInSeconds:t?.aliveInSeconds,aliveUntilTimestamp:t?.aliveUntilTimestamp}),o=Di(i().value);return Wt(()=>{if(typeof o.value<"u")try{window.localStorage.setItem(e,gi(o.value))}catch{}else window.localStorage.removeItem(e)}),{get:()=>{const a=i();return o.value=a.value,a.rawValue},set:a=>o.value=r(a)}}function uw(){window.localStorage.clear()}const{get:qu,set:lw}=Gu(ns("theme")),ju=new Mn,fw=ju.pipe(Se(void 0));function Hu(s){switch(lw(s),s){case"dark":document.documentElement.classList.add("dark"),fn(document.documentElement,"data-theme","dark");break;case"light":default:document.documentElement.classList.remove("dark"),fn(document.documentElement,"data-theme","light");break}return ju.next(s),s}function dw(){return Hu(qu()=="dark"?"light":"dark")}function mw(){return up([fw,$u("(prefers-color-scheme: dark)")]).pipe(rt(([s,t])=>{if(s)return s;const e=qu();return e||(t?"dark":"light")}))}function pw(s,t=""){return getComputedStyle(document.documentElement).getPropertyValue(s)||t}function gw(s,t){document.documentElement.style.setProperty(s,t)}function yw(s,t){const e=typeof s=="string"?s:s.toString();let n=t?.initValue;if(typeof n>"u")try{const a=window.sessionStorage.getItem(e);a&&(n=na(a))}catch{}const{get:i,set:r}=Oo(n,{aliveInSeconds:t?.aliveInSeconds,aliveUntilTimestamp:t?.aliveUntilTimestamp}),o=Di(i().value);return Wt(()=>{if(typeof o.value<"u")try{window.sessionStorage.setItem(e,gi(o.value))}catch{}else window.sessionStorage.removeItem(e)}),{get:()=>{const a=i();return o.value=a.value,a.rawValue},set:a=>o.value=r(a)}}function ww(){window.sessionStorage.clear()}function xw(s,t){const e=Di(t?.value||"");if(!e.value){const n=`; ${document.cookie}`.split(`; ${s}=`).pop()?.split(";").shift();n&&(e.value=decodeURIComponent(n))}return Wt(()=>{if(e.value&&t?.days){const n="; expires="+new Date(Date.now()+t.days*864e5).toUTCString(),i=t?.domain?"; domain="+t?.domain:"",r=t?.path?"; path="+t?.path:"",o=t?.secure==!0?"; secure":"";document.cookie=s+"="+encodeURIComponent(e.value)+n+i+r+o}}),{get:()=>e.value,set:n=>e.value=n}}function bw(){const s=document.cookie.split("; ");for(let t=0;t<s.length;t++){const e=window.location.hostname.split(".");for(;e.length>0;){const n=encodeURIComponent(s[t].split(";")[0].split("=")[0])+"=; expires=Thu, 01-Jan-1970 00:00:01 GMT; domain="+e.join(".")+" ;path=",i=location.pathname.split("/");for(document.cookie=n+"/";i.length>0;)document.cookie=n+i.join("/"),i.pop();e.shift()}}}function vw(s,t){let e;return s.objectStoreNames.contains(t)||(e=s.createObjectStore(t,{keyPath:"id"})),e}function _w(s,t=1,e){return new Promise((n,i)=>{let r;const o=window.indexedDB.open(s,t);o.onerror=()=>{i("无法使用IndexDB!")},o.onsuccess=a=>{r=a.target.result,vw(r,e),n(r)}})}function Sw(s,t,e={id:1,name:"xxx"}){return new Promise((n,i)=>{const r=s.transaction([t],"readwrite");r.objectStore(t).add(e),r.oncomplete=a=>{n(a)},r.onerror=a=>{i(a)}})}const zo=new cs;function Fo(s,t){return yi({url:s,...t})}async function Hs(s,t){if(typeof fetch>"u")throw new Error("fetch() not supported!");if(typeof AbortController>"u")throw new Error("AbortController not supported!");const e=Fo(s,t),n=new AbortController;zo.set(e,n);const{responseType:i,onProgress:r,timeout:o}={responseType:"json",timeout:6e4,...t},a=setTimeout(()=>{throw n.abort(),new Error(`${o} ms Timeout!`)},o);let c=await fetch(new Request(s,{...t,signal:n.signal}));if(zo.delete(e),clearTimeout(a),c.status===200||c.status===0){if(c.status===0&&gf("useFetch: HTTP Status 0 received."),typeof ReadableStream<"u"&&c.body&&c.body.getReader&&r){const h=c.body.getReader(),u=c.headers.get("X-File-Size")||c.headers.get("Content-Length"),l=u?parseInt(u):0,d=l!==0;let f=0;const p=new ReadableStream({start(w){function b(){h.read().then(({done:x,value:g})=>{x?w.close():(f+=g.byteLength,r?.(new ProgressEvent("progress",{lengthComputable:d,loaded:f,total:l})),w.enqueue(g),b())}).catch(x=>{w.error(x)})}b()}});c=new Response(p)}switch(i){case"arraybuffer":return await c.arrayBuffer();case"blob":return await c.blob();case"json":return await c.json();case"text":default:return await c.text()}}else return Promise.reject(c)}function Cw(s,t){const e=zo.get(Fo(s,t));e&&e.abort()}function Tw(s=3,t){return vi(Hs,s,t)}function Ew(s=6e4){return _i(Hs,s)}function Pw(s=6e4,t=3,e){return _i(vi(Hs,t,e),s)}const Mw={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:(s,t)=>{switch(t){case"W":return`${s}周`;default:return`${s}日`}},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:(s,t)=>{const e=s*100+t;return e<600?"凌晨":e<900?"早上":e<1100?"上午":e<1300?"中午":e<1800?"下午":"晚上"}},Aw={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:s=>{const t=["th","st","nd","rd"],e=s%100;return`[${s}${t[(e-20)%10]||t[e]||t[0]}]`}},Ie=new cs;let Ws="zh-cn";Bo(Aw),Bo(Mw);function Bo(s,t){if(!s)return Ie.get(Ws);let e;if(typeof s=="string"){const n=s.toLowerCase();if(Ie.get(n))e=n;else if(t)Ie.set(n,t),e=n;else return Ie.get(Ws)}else{const{name:n}=s;Ie.set(n,s),e=n}return e&&(Ws=e),Ie.get(e)||Ie.get(Ws)}function Je(s,t={},e=[],n){return{tag:s,props:t,children:e,el:n}}function Js(s){return Je(s.tagName,Xr(s),Array.from(s.children).map(t=>Js(t)),s)}function gn(s,t=document.documentElement){if(s.el)return s.el;if(s.el=document.createElement(s.tag),s.props)for(const e in s.props){const n=s.props[e];e.startsWith("on")?s.el.addEventListener(e.slice(2).toLowerCase(),n):e==="style"?Ns(s.el,s.props[e]):fn(s.el,e,n)}return s.children&&(typeof s.children=="string"?s.el.appendChild(document.createTextNode(s.children)):s.children.forEach(e=>{gn(e,s.el)})),t.appendChild(s.el),s.el}function Zs(s,t){if(!s.el)return;if(s.tag!==t.tag){(s.el.parentElement||document.body).replaceChild(gn(t),s.el);return}const e=t.el=s.el,n=s.props,i=t.props;for(const a in n)a in i||(a.startsWith("on")?e.removeEventListener(a.slice(2).toLowerCase(),n[a]):e.removeAttribute(a));for(const a in i){const c=n[a],h=i[a];if(h!=c)if(a.startsWith("on")){const u=a.slice(2).toLowerCase();e.removeEventListener(u,c),e.addEventListener(u,h)}else if(a==="style"){for(const u in c)u in h||Ur(e,u);Ns(e,h)}else fn(e,a,h)}const r=s.children||[],o=t.children||[];if(typeof o=="string")e.innerHTML=o;else if(typeof r=="string")e.innerHTML="",o.forEach(a=>{gn(a,e)});else{const a=Math.min(r.length,o.length);for(let c=0;c<a;c++)Zs(r[c],o[c]);o.length>r.length&&o.slice(r.length).forEach(c=>{gn(c,e)}),o.length<r.length&&r.slice(o.length).forEach(c=>{c.el&&e.removeChild(c.el)})}}class kw{state;el;constructor(t,e){this.state=Ma(t,!0),this.el=e,this.compile(this.el)}compile(t){t.childNodes.forEach(e=>{switch(e.nodeType){case 1:const n=e;[...n.attributes].forEach(a=>{const c=a.name,h=a.value;if(c==="v-model")if(Zr(n)){const u=n;Wt(()=>{u.checked=this.getStateValue(h)==u.value}),u.addEventListener("change",l=>{this.setStateValue(h,l.target.value)})}else if(Jr(n)){const u=n;Wt(()=>{u.checked=fa(this.getStateValue(h),u.value)}),u.addEventListener("change",l=>{const d=l.target,f=d.value;d.checked?Hl(this.getStateValue(h),f):Le(this.getStateValue(h),f)})}else if(Wr(n)){const u=n;Wt(()=>{u.value=this.getStateValue(h)}),u.addEventListener("change",l=>{this.setStateValue(h,l.target.value)})}else{const u=n;Wt(()=>{u.value=this.getStateValue(h)});const l=d=>{this.setStateValue(h,d.target.value)};u.addEventListener("input",l)}else c==="v-text"?Wt(()=>{n.innerText=this.getStateValue(h)}):c==="v-html"&&Wt(()=>{n.innerHTML=this.getStateValue(h)})}),n.childNodes.length>0&&this.compile(n);break;case 3:const i=e.textContent||"",r=/\{\{\s*([^{}\s]+)\s*\}\}/g,o=r.exec(i);o&&o[1]&&Wt(()=>{e.textContent=i.replace(r,this.getStateValue(o[1]))});break}})}getStateValue(t){let e=this.state;return t.split(".").forEach(n=>{e=e[n]}),e}setStateValue(t,e){let n=this.state;const i=t.split("."),r=i.length;for(let o=0;o<r-1;o++)n=n[i[o]];n[i[r-1]]=e}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){
|
|
40
|
+
`))}Z1();function Q1(){return ho(document.documentElement).pipe(ur(ar),rt(()=>{const s=getComputedStyle(document.documentElement);return{bottom:s.getPropertyValue("--sab"),top:s.getPropertyValue("--sat"),right:s.getPropertyValue("--sar"),left:s.getPropertyValue("--sal")}}))}function K1(s={enableHighAccuracy:!0,timeout:5e3,maximumAge:0}){return new et(t=>{if(!("geolocation"in navigator))return t.error("navigator.geolocation is not available.");let e;return new Promise((n,i)=>{navigator.geolocation.getCurrentPosition(r=>{t.next({longitude:r.coords.longitude,latitude:r.coords.latitude}),n()},r=>{i(r)})}).then(()=>{e=navigator.geolocation.watchPosition(n=>{t.next({longitude:n.coords.longitude,latitude:n.coords.latitude})},n=>{t.error(n)},s)}).catch(n=>{t.error(n)}),()=>{typeof e=="number"&&navigator.geolocation.clearWatch(e)}})}function $u(s="(prefers-color-scheme: dark)"){const t=window.matchMedia(s);return U(t,"change").pipe(rt(e=>e.matches),Se(t.matches),_e())}function Vu(){return Yu(document).pipe(rt(()=>location),Se(location))}function tw(){return Vu().pipe(rt(s=>s.href),Se(location.href),_e())}function ew(){return U(window,"hashchange").pipe(rt(s=>s.target.location.hash.replace("#","")),Se(window.location.hash.replace("#","")),_e())}function nw(){return U(window,"popstate").pipe(rt(s=>s.state),Se(null),_e())}function sw(s,t,e){if(typeof t=="string"&&(t=ua(t)),(typeof t=="string"||t===void 0)&&e===void 0){const n=Object.assign({},s.dataset);return Object.keys(n).forEach(i=>{if(n[i]?.startsWith("[")||n[i]?.startsWith("{"))try{n[i]=JSON.parse(n[i]||"")}catch{}}),typeof t=="string"?n[t]:n}else{let n={};typeof t=="object"?n=t:typeof t=="string"&&(n[t]=e),Object.entries(n).forEach(([i,r])=>{r?s.dataset[i]=r instanceof Object?JSON.stringify(r):r:delete s.dataset[i]})}}function iw(s,t){t.split(/[,\s]+/).forEach(e=>{e.trim()!=""&&delete s.dataset[e.trim()]})}function Fo(s,t){const e=typeof t?.aliveInSeconds=="number"?Math.max(t.aliveInSeconds,0):-1,n=typeof t?.aliveUntilTimestamp=="number"?Math.max(t.aliveUntilTimestamp,0):-1;function i(o,a=!1){return Ul(o)||!El(o,vn)?{v:o,[vn]:se()}:a?o:{...o,[vn]:se()}}let r=i(s,!0);return{get:()=>{let o=r.v;return(e>=0&&se()>r[vn]+e*1e3||n>=0&&se()>n)&&(o=void 0),{value:typeof o<"u"?r:void 0,rawValue:o}},set:o=>r=i(o)}}function Gu(s,t){const e=typeof s=="string"?s:s.toString();let n=t?.initValue;if(typeof n>"u")try{const a=window.localStorage.getItem(e);a&&(n=oa(a))}catch{}const{get:i,set:r}=Fo(n,{aliveInSeconds:t?.aliveInSeconds,aliveUntilTimestamp:t?.aliveUntilTimestamp}),o=Li(i().value);return jt(()=>{if(typeof o.value<"u")try{window.localStorage.setItem(e,wi(o.value))}catch{}else window.localStorage.removeItem(e)}),{get:()=>{const a=i();return o.value=a.value,a.rawValue},set:a=>o.value=r(a)}}function rw(){window.localStorage.clear()}const{get:qu,set:ow}=Gu(rs("theme")),ju=new ln,aw=ju.pipe(Se(void 0));function Hu(s){switch(ow(s),s){case"dark":document.documentElement.classList.add("dark"),pn(document.documentElement,"data-theme","dark");break;case"light":default:document.documentElement.classList.remove("dark"),pn(document.documentElement,"data-theme","light");break}return ju.next(s),s}function hw(){return Hu(qu()=="dark"?"light":"dark")}function cw(){return hp([aw,$u("(prefers-color-scheme: dark)")]).pipe(rt(([s,t])=>{if(s)return s;const e=qu();return e||(t?"dark":"light")}))}function uw(s,t=""){return getComputedStyle(document.documentElement).getPropertyValue(s)||t}function lw(s,t){document.documentElement.style.setProperty(s,t)}function fw(s,t){const e=typeof s=="string"?s:s.toString();let n=t?.initValue;if(typeof n>"u")try{const a=window.sessionStorage.getItem(e);a&&(n=oa(a))}catch{}const{get:i,set:r}=Fo(n,{aliveInSeconds:t?.aliveInSeconds,aliveUntilTimestamp:t?.aliveUntilTimestamp}),o=Li(i().value);return jt(()=>{if(typeof o.value<"u")try{window.sessionStorage.setItem(e,wi(o.value))}catch{}else window.sessionStorage.removeItem(e)}),{get:()=>{const a=i();return o.value=a.value,a.rawValue},set:a=>o.value=r(a)}}function dw(){window.sessionStorage.clear()}function mw(s,t){const e=Li(t?.value||"");if(!e.value){const n=`; ${document.cookie}`.split(`; ${s}=`).pop()?.split(";").shift();n&&(e.value=decodeURIComponent(n))}return jt(()=>{if(e.value&&t?.days){const n="; expires="+new Date(Date.now()+t.days*864e5).toUTCString(),i=t?.domain?"; domain="+t?.domain:"",r=t?.path?"; path="+t?.path:"",o=t?.secure==!0?"; secure":"";document.cookie=s+"="+encodeURIComponent(e.value)+n+i+r+o}}),{get:()=>e.value,set:n=>e.value=n}}function pw(){const s=document.cookie.split("; ");for(let t=0;t<s.length;t++){const e=window.location.hostname.split(".");for(;e.length>0;){const n=encodeURIComponent(s[t].split(";")[0].split("=")[0])+"=; expires=Thu, 01-Jan-1970 00:00:01 GMT; domain="+e.join(".")+" ;path=",i=location.pathname.split("/");for(document.cookie=n+"/";i.length>0;)document.cookie=n+i.join("/"),i.pop();e.shift()}}}function gw(s,t){let e;return s.objectStoreNames.contains(t)||(e=s.createObjectStore(t,{keyPath:"id"})),e}function yw(s,t=1,e){return new Promise((n,i)=>{let r;const o=window.indexedDB.open(s,t);o.onerror=()=>{i("无法使用IndexDB!")},o.onsuccess=a=>{r=a.target.result,gw(r,e),n(r)}})}function ww(s,t,e={id:1,name:"xxx"}){return new Promise((n,i)=>{const r=s.transaction([t],"readwrite");r.objectStore(t).add(e),r.oncomplete=a=>{n(a)},r.onerror=a=>{i(a)}})}const Yo=new rn;function Xo(s,t){return xi({url:s,...t})}async function Js(s,t){if(typeof fetch>"u")throw new Error("fetch() not supported!");if(typeof AbortController>"u")throw new Error("AbortController not supported!");const e=Xo(s,t),n=new AbortController;Yo.set(e,n);const{responseType:i,onProgress:r,timeout:o}={responseType:"json",timeout:6e4,...t},a=setTimeout(()=>{throw n.abort(),new Error(`${o} ms Timeout!`)},o);let h=await fetch(new Request(s,{...t,signal:n.signal}));if(Yo.delete(e),clearTimeout(a),h.status===200||h.status===0){if(h.status===0&&df("useFetch: HTTP Status 0 received."),typeof ReadableStream<"u"&&h.body&&h.body.getReader&&r){const c=h.body.getReader(),u=h.headers.get("X-File-Size")||h.headers.get("Content-Length"),l=u?parseInt(u):0,m=l!==0;let f=0;const p=new ReadableStream({start(y){function v(){c.read().then(({done:w,value:_})=>{w?y.close():(f+=_.byteLength,r?.(new ProgressEvent("progress",{lengthComputable:m,loaded:f,total:l})),y.enqueue(_),v())}).catch(w=>{y.error(w)})}v()}});h=new Response(p)}switch(i){case"arraybuffer":return await h.arrayBuffer();case"blob":return await h.blob();case"json":return await h.json();case"text":default:return await h.text()}}else return Promise.reject(h)}function xw(s,t){const e=Yo.get(Xo(s,t));e&&e.abort()}function bw(s=3,t){return _i(Js,s,t)}function vw(s=6e4){return Si(Js,s)}function _w(s=6e4,t=3,e){return Si(_i(Js,t,e),s)}const Sw={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:(s,t)=>{switch(t){case"W":return`${s}周`;default:return`${s}日`}},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:(s,t)=>{const e=s*100+t;return e<600?"凌晨":e<900?"早上":e<1100?"上午":e<1300?"中午":e<1800?"下午":"晚上"}},Cw={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:s=>{const t=["th","st","nd","rd"],e=s%100;return`[${s}${t[(e-20)%10]||t[e]||t[0]}]`}},De=new rn;let Zs="zh-cn";Uo(Cw),Uo(Sw);function Uo(s,t){if(!s)return De.get(Zs);let e;if(typeof s=="string"){const n=s.toLowerCase();if(De.get(n))e=n;else if(t)De.set(n,t),e=n;else return De.get(Zs)}else{const{name:n}=s;De.set(n,s),e=n}return e&&(Zs=e),De.get(e)||De.get(Zs)}let Tw=0;function Qe(s,t={},e=[],n){return{name:String(++Tw),tag:s,props:t,children:e,el:n}}function Qs(s){return Qe(s.tagName,Vr(s),Array.from(s.children).map(t=>Qs(t)),s)}function wn(s,t=document.documentElement){if(s.el)return s.el;if(s.el=document.createElement(s.tag),s.props)for(const e in s.props){const n=s.props[e];e.startsWith("on")?s.el.addEventListener(e.slice(2).toLowerCase(),n):e==="style"?Ys(s.el,s.props[e]):pn(s.el,e,n)}return s.children&&(typeof s.children=="string"?s.el.appendChild(document.createTextNode(s.children)):s.children.forEach(e=>{wn(e,s.el)})),t.appendChild(s.el),s.el}function Ks(s,t){if(!s.el)return;if(s.tag!==t.tag){(s.el.parentElement||document.body).replaceChild(wn(t),s.el);return}const e=t.el=s.el,n=s.props,i=t.props;for(const a in n)a in i||(a.startsWith("on")?e.removeEventListener(a.slice(2).toLowerCase(),n[a]):e.removeAttribute(a));for(const a in i){const h=n[a],c=i[a];if(c!=h)if(a.startsWith("on")){const u=a.slice(2).toLowerCase();e.removeEventListener(u,h),e.addEventListener(u,c)}else if(a==="style"){for(const u in h)u in c||$r(e,u);Ys(e,c)}else pn(e,a,c)}const r=s.children||[],o=t.children||[];if(typeof o=="string")e.innerHTML=o;else if(typeof r=="string")e.innerHTML="",o.forEach(a=>{wn(a,e)});else{const a=Math.min(r.length,o.length);for(let h=0;h<a;h++)Ks(r[h],o[h]);o.length>r.length&&o.slice(r.length).forEach(h=>{wn(h,e)}),o.length<r.length&&r.slice(o.length).forEach(h=>{h.el&&e.removeChild(h.el)})}}class Ew{state;el;constructor(t,e){this.state=ka(t,!0),this.el=e,this.compile(this.el)}compile(t){t.childNodes.forEach(e=>{switch(e.nodeType){case 1:const n=e;[...n.attributes].forEach(a=>{const h=a.name,c=a.value;if(h==="v-model")if(Kr(n)){const u=n;jt(()=>{u.checked=this.getStateValue(c)==u.value}),u.addEventListener("change",l=>{this.setStateValue(c,l.target.value)})}else if(Qr(n)){const u=n;jt(()=>{u.checked=pa(this.getStateValue(c),u.value)}),u.addEventListener("change",l=>{const m=l.target,f=m.value;m.checked?jl(this.getStateValue(c),f):Oe(this.getStateValue(c),f)})}else if(Zr(n)){const u=n;jt(()=>{u.value=this.getStateValue(c)}),u.addEventListener("change",l=>{this.setStateValue(c,l.target.value)})}else{const u=n;jt(()=>{u.value=this.getStateValue(c)});const l=m=>{this.setStateValue(c,m.target.value)};u.addEventListener("input",l)}else h==="v-text"?jt(()=>{n.innerText=this.getStateValue(c)}):h==="v-html"&&jt(()=>{n.innerHTML=this.getStateValue(c)})}),n.childNodes.length>0&&this.compile(n);break;case 3:const i=e.textContent||"",r=/\{\{\s*([^{}\s]+)\s*\}\}/g,o=r.exec(i);o&&o[1]&&jt(()=>{e.textContent=i.replace(r,this.getStateValue(o[1]))});break}})}getStateValue(t){let e=this.state;return t.split(".").forEach(n=>{e=e[n]}),e}setStateValue(t,e){let n=this.state;const i=t.split("."),r=i.length;for(let o=0;o<r-1;o++)n=n[i[o]];n[i[r-1]]=e}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){
|
|
41
41
|
let output = "";
|
|
42
42
|
function echo(html){
|
|
43
43
|
output += html;
|
|
44
44
|
}
|
|
45
45
|
${t}
|
|
46
46
|
return output;
|
|
47
|
-
})`}}class
|
|
48
|
-
`)):
|
|
47
|
+
})`}}class Pw{requestid=0;url;socket;waitings={};messageQueue=[];constructor(t){this.url=t,this._connect()}_connect(){this.socket=new WebSocket(this.url),this.socket.onopen=()=>{const t=this.messageQueue.slice();this.messageQueue=[],t.forEach(this._send)},this.socket.onclose=t=>{const{code:e,reason:n,wasClean:i}=t;console.log(`ws(${this.url}) closed : ${e} ${n} ${i}`)},this.socket.onerror=t=>{console.log(`ws(${this.url}) error : ${t.type}`)},this.socket.onmessage=t=>{if(typeof t.data=="string")try{const e=JSON.parse(t.data);if(Object.prototype.hasOwnProperty.call(e,"requestid")){const n=this.waitings[e.requestid];n&&n.resolve?.(e)}}catch{}else t.data instanceof ArrayBuffer||t.data instanceof Blob}}_send(t){this.socket?.readyState===WebSocket.OPEN?this.socket.send(t):(this.messageQueue.push(t),this._connect())}open(){this._connect()}close(){this.socket&&this.socket.close()}async send(t,e=5e3){this.requestid++;const n=this.waitings[this.requestid]={requestid:this.requestid};let i;t instanceof Blob||t instanceof ArrayBuffer||typeof t=="string"?i=t:i=JSON.stringify({...n,...t});const r=await new Promise((o,a)=>{n.resolve=o,this._send(i),setTimeout(()=>{a("Timeout!")},e)});return delete this.waitings[this.requestid],r}}function Mw(s){const t=document.documentElement,e=window.top===window.self?window.devicePixelRatio:1;t.dataset.dpr=e;let n=100;const i=function(){const r=Math.min(t.clientWidth,s);t.dataset.width=r,t.dataset.rem=n=Math.round(100*(r/s)),t.style.fontSize=n+"px"};i(),window.rem2px=function(r){return r=parseFloat(r),r*n},window.px2rem=function(r){return r=parseFloat(r),r/n},window.addEventListener&&window.addEventListener("orientationchange"in window?"orientationchange":"resize",i,!1)}function ti(s=window.location.href){try{return new URL(s)}catch{const e="(?<protocol>https?:)",n="(?<host>(?<hostname>[^/#?:]+)(?::(?<port>\\d+))?)",i="(?<pathname>(?:\\/[^/#?]+)*\\/?)",r="(?<search>(?:\\?[^#]*)?)",o="(?<hash>(?:#.*)?)",h=new RegExp(`^${e}//${n}${i}${r}${o}$`).exec(s);return{href:s,protocol:h?.groups?.protocol??"",host:h?.groups?.host??"",hostname:h?.groups?.hostname??"",port:h?.groups?.port??"",pathname:h?.groups?.pathname??"",search:h?.groups?.search??"",hash:h?.groups?.hash??""}}}function Aw(s){const t=ti(s);return t.protocol==="http:"||t.protocol==="https:"}function Wu(s=window.location.href){const t=ti(s),e=t.href.indexOf(t.hash);return t.hash&&e>=0?t.href.substring(0,e):t.href}function kw(s=ti().search){s=decodeURIComponent(s).replace(/^[#?&]/,"");const t={};if(!s)return t;const e=/(?:^|&)([^&=]*)=?([^&]*?)(?=&|$)/y;let n=e.exec(s);for(;n;)t[n[1]]=n[2],n=e.exec(s);return t}const Iw=(s=window.location.href)=>JSON.parse('{"'+decodeURI(s.split("?")[1]).replace(/"/g,'\\"').replace(/&/g,'","').replace(/=/g,'":"')+'"}');function ei(s){return"?"+Object.entries(s).map(([t,e])=>`${encodeURIComponent(t)}=${encodeURIComponent(e)}`).join("&")}function Ju(s){return"?"+[...s.entries()].map(t=>encodeURIComponent(t[0])+"="+encodeURIComponent(t[1]instanceof File?t[1].name:t[1])).join("&")}function Zu(s,t){return s.replace(/(?:\?.*)?$/,t.replace(/^[&?]/,"?"))}function Dw(s,t){return Zu(s,ei(t))}function $o(s,t){return s+t.replace(/^[&?]/,s.indexOf("?")>=0?"&":"?")}function Lw(s,t){return $o(s,ei(t))}class Rw{worker;cbs={};constructor(t){if(Oc)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(n=>{if(e){const i=Math.random().toString(36).slice(2),r=o=>{o.data.id===i&&(this.worker.removeEventListener("message",r),delete this.cbs[i],e(),n())};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),n()})}}class Ow{port1;port2;port1MessageCbs=[];port2MessageCbs=[];port1MessageErrorCbs=[];port2MessageErrorCbs=[];constructor(){const{port1:t,port2:e}=new MessageChannel;this.port1=t,this.port2=e,this.port1.addEventListener("message",n=>{this.port1MessageCbs.forEach(i=>i(this.port1,n))}),this.port1.addEventListener("messageerror",n=>{this.port1MessageErrorCbs.forEach(i=>i(this.port1,n))}),this.port1.start(),this.port2.addEventListener("message",n=>{this.port2MessageCbs.forEach(i=>i(this.port2,n))}),this.port2.addEventListener("messageerror",n=>{this.port2MessageErrorCbs.forEach(i=>i(this.port2,n))}),this.port2.start()}close(){this.port1.close(),this.port2.close()}onPort1Message(t){this.port1MessageCbs.push(t)}onPort1MessageError(t){this.port1MessageErrorCbs.push(t)}offPort1Message(t){Oe(this.port1MessageCbs,t)}offPort1MessageError(t){Oe(this.port1MessageErrorCbs,t)}onPort2Message(t){this.port2MessageCbs.push(t)}onPort2MessageError(t){this.port2MessageErrorCbs.push(t)}offPort2Message(t){Oe(this.port2MessageCbs,t)}offPort2MessageError(t){Oe(this.port2MessageErrorCbs,t)}}function Qu(){let s=null;if(window.ActiveXObject){const t=["Microsoft.XMLHTTP","MSXML6.XMLHTTP","MSXML5.XMLHTTP","MSXML4.XMLHTTP","MSXML3.XMLHTTP","MSXML2.XMLHTTP","MSXML.XMLHTTP"];for(let e=0,n=t.length;e<n;e++)try{s=new window.ActiveXObject(t[e]);break}catch{continue}}else s=new XMLHttpRequest;return s}function zw(s,t){return new Promise((e,n)=>{const{method:i="GET",data:r={},multipartFormDataString:o="",boundary:a="",headers:h={},withCredentials:c=!1,responseType:u="json",timeout:l=3e4}=t||{},m=Qu();m.timeout=l,m.responseType=u,m.onreadystatechange=function(_){m.readyState===4&&(m.status===200?e(m.response):n(m.statusText))},m.ontimeout=()=>{n(`${s} is timed out for ${l}ms.`)},m.addEventListener("load",_=>t?.load?.(_,m),!1),m.addEventListener("loadstart",_=>t?.loadstart?.(_,m),!1),m.addEventListener("loadend",_=>t?.loadend?.(_,m),!1),m.addEventListener("progress",_=>{if(_.lengthComputable){const x=Math.round(_.loaded*100/_.total);t?.progress?.(_,m,x)}},!1),m.addEventListener("error",_=>t?.error?.(_,m),!1),m.addEventListener("abort",_=>t?.abort?.(_,m),!1);const f=i.toUpperCase();Object.assign(h,{Accept:"*/*"});let p=!1,y=!1,v=!1;function w(){c&&(m.withCredentials=!0);for(const _ in h)wt(_).toLowerCase()=="content-type"&&h[_].toLowerCase()=="multipart/form-data"?(p=!0,m.setRequestHeader("Content-Type","multipart/form-data; boundary="+a)):(wt(_).toLowerCase()=="content-type"&&(h[_].toLowerCase().indexOf("text/plain")>=0?y=!0:h[_].toLowerCase().indexOf("application/json")>=0&&(v=!0)),m.setRequestHeader(_,h[_]))}switch(f){case"GET":let _="";r instanceof FormData?_=Ju(r):_=ei(r),m.open("GET",$o(s,_),!0),w(),m.send(null);break;default:m.open(f,s,!0),w(),p?m.sendAsBinary(o):v?m.send(JSON.stringify(r)):y?m.send(Object.entries(r).map(([x,b])=>`${x}=${b}`).join(`\r
|
|
48
|
+
`)):m.send(Object.entries(r).map(([x,b])=>`${encodeURIComponent(x)}=${encodeURIComponent(b)}`).join("&"));break}})}async function Nw(s){const t={url:s.action||"",data:{},contentType:s.method.toLowerCase()==="post"&&s.enctype?s.enctype:"application/x-www-form-urlencoded",multipartFormDataString:"",boundary:"---------------------------"+Date.now().toString(16)},e=[],n=t.contentType=="multipart/form-data";for(let i=0;i<s.elements.length;i++){const r=s.elements[i];if(!r.hasAttribute("name"))continue;const o=r.getAttribute("type");switch(r.nodeName.toUpperCase()==="INPUT"&&o?o.toUpperCase():""){case"FILE":const h=r;if(n)for(let l=0,m=h.files?.length||0;l<m;l++){const f=h.files?.[l];if(f){const p=await Mn(f,Xt.binaryString);e.push('Content-Disposition: form-data; name="'+h.name+'"; filename="'+f.name+`"\r
|
|
49
49
|
Content-Type: `+f.type+`\r
|
|
50
50
|
\r
|
|
51
51
|
`+p+`\r
|
|
@@ -55,9 +55,9 @@ Content-Type: `+f.type+`\r
|
|
|
55
55
|
`):t.data[u.name]=u.value;break}}return t.multipartFormDataString="--"+t.boundary+`\r
|
|
56
56
|
`+e.join("--"+t.boundary+`\r
|
|
57
57
|
`)+"--"+t.boundary+`--\r
|
|
58
|
-
`,t}class
|
|
58
|
+
`,t}class Bw extends fo{currentItem={};items=[];groups=[];globalStyles={};grad={};idtops={};text="";constructor(t){super(t),this.on("tag",(e,n)=>{switch(this.text="",this.currentItem={type:e},e){case"g":this.groups.push(this.currentItem);break}this.processAttrs(e,n)}),this.on("text",e=>{if(this.currentItem.type=="style"){try{const n=mo(e);for(const i of n.stylesheet.rules)for(const r of i.declarations)for(const o of i.selectors)this.globalStyles[o]=this.globalStyles[o]||[],this.globalStyles[o].push(`${r.property}:${r.value}`)}catch{console.error("CAN'T parse css text: "+e)}return}this.text+=e}),this.on("/tag",(e,n)=>{let i=this.groups.length;for(;i--;)if(this.groups[i]!=this.currentItem){let r="",o="";for(const a in this.groups[i])a=="transform"?r=this.groups[i].transform:a=="class"&&this.globalStyles["."+this.groups[i][a]]?o=this.globalStyles["."+this.groups[i][a]].join(";")+";"+o:a=="id"&&this.globalStyles["#"+this.groups[i][a]]?o=this.globalStyles["#"+this.groups[i][a]].join(";")+";"+o:typeof this.currentItem[a]>"u"&&(this.currentItem[a]=this.groups[i][a]);typeof this.currentItem.transform>"u"?this.currentItem.transform=r:this.currentItem.transform+=" "+r,typeof this.currentItem.style>"u"?this.currentItem.style=o:this.currentItem.style=o+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),Go(this.currentItem.style,this.currentItem,qo)}switch(this.processAttrs(e,n),e){case"g":this.groups.pop();break;case"cirlce":this.addToItems();break;case"ellipse":this.addToItems();break;case"polygon":this.addToItems();break;case"path":this.addToItems();break;case"line":this.addToItems();break;case"rect":this.addToItems();break;case"image":this.addToItems();break;case"text":this.currentItem.text=this.text,this.currentItem["text-anchor"]=this.currentItem["text-anchor"]||"start",this.addToItems();break}}),this.on("finish",()=>{this.emit("result",this.items)})}parse(){return super.parse(),this.items}processAttrs(t,e){let n=[],i;switch(t){case"svg":let r="",o="";if(e.width&&e.height)r=e.width,o=e.height;else if(e.viewBox){const a=e.viewBox.split(/\s+/gi);a.length==4&&(r=String(parseFloat(a[2])-parseFloat(a[0])),o=String(parseFloat(a[3])-parseFloat(a[1])))}r&&o&&this.items.push({type:"viewbox",width:r,height:o});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&&Go(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+Vo(parseFloat(e.x1),parseFloat(e.y1),parseFloat(e.x2),parseFloat(e.y2),parseFloat(e.x1)+100,parseFloat(e.y1))).toFixed(2),n=[this.grad.angle];for(let a=0,h=this.grad.stops.length;a<h;a++)i=this.grad.stops[a],a&&a!=h-1?n.push(i.color+":"+i.offset):n.push(i.color);this.idtops[this.grad.id]=n.join("-"),this.items.forEach(a=>{a.fillid==this.grad.id&&(a.fill=this.idtops[this.grad.id])});break;case"radialGradient":n=[];for(let a=0,h=this.grad.stops.length;a<h;a++)i=this.grad.stops[a],a&&a!=h-1?n.push(i.color+":"+i.offset):n.push(i.color);this.idtops[this.grad.id]=n.join("-"),this.items.forEach(a=>{a.fillid==this.grad.id&&(a.fill=this.idtops[this.grad.id])});break}for(const r in e){const o=e[r];if(qo.includes(r)&&(this.currentItem[r]=o),r==="id"&&(this.currentItem.type==="linearGradient"&&(this.grad={id:r,stops:[]}),this.currentItem.type==="radialGradient"&&(this.grad={id:r,stops:[]})),r==="style"&&Go(o,this.currentItem,qo),r==="transform"&&(this.currentItem.transform=o+(this.currentItem.transform||" ")),r==="fill"){const a=o.match(/url\(#([^)]+)\)/);if(a){const h=a[1];this.currentItem.fillid=h,this.idtops[h]&&(this.currentItem.fill=this.idtops[h])}}r==="points"&&this.currentItem.type=="polygon"&&(this.currentItem.path="M"+o+"z"),r==="d"&&this.currentItem.type=="path"&&(this.currentItem.path=o),r==="xlink:href"&&this.currentItem.type=="image"&&(this.currentItem.src=o)}}addToItems(){this.items.push(this.currentItem)}}function Vo(s,t,e,n,i,r){if(typeof i>"u"||typeof r>"u"){const o=s-e,a=t-n;return!o&&!a?0:(180+Math.atan2(-a,-o)*180/Math.PI+360)%360}else return Vo(s,t,i,r)-Vo(e,n,i,r)}function Go(s,t,e){const n=(s+"").split(";"),i=/^\s+|\s+$/g;for(let r=0,o=n.length;r<o;r++){const a=n[r].split(":"),h=a[0].replace(i,"").replace(/[A-Z]/g,function(c){return"-"+c.toLowerCase()});(!e||e.includes(h))&&(t[h]=a[1].replace(i,""))}}const qo=["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 Fw{localVideoUtil;remoteVideoUtil;localPeerConnection=null;remotePeerConnection=null;constructor(t,e){this.localVideoUtil=new Jn(t),this.remoteVideoUtil=new Jn(e)}start(){this.getLocalMediaStream().then(t=>{this.call(t)})}end(){this.localPeerConnection?.close(),this.remotePeerConnection?.close(),this.localPeerConnection=null,this.remotePeerConnection=null,this.trace("Ending call.")}getLocalMediaStream(){return new Promise((t,e)=>{navigator.mediaDevices.getUserMedia({audio:!0,video:!0}).then(n=>{this.localVideoUtil.setSrcObject(n),t(n)}).catch(n=>{this.trace(`navigator.getUserMedia error: ${n}.`),e(n)})})}gotRemoteMediaStream(t){const e=t.streams[0];this.remoteVideoUtil.setSrcObject(e),this.trace("Remote peer connection received remote stream.")}call(t){const e=t.getVideoTracks(),n=t.getAudioTracks();e.length>0&&this.trace(`Using video device: ${e[0].label}.`),n.length>0&&this.trace(`Using audio device: ${n[0].label}.`);const i=void 0,r=new RTCPeerConnection(i);this.localPeerConnection=r,this.trace("Created local peer connection object localPeerConnection."),r.addEventListener("icecandidate",this.handleConnection),r.addEventListener("iceconnectionstatechange",this.handleConnectionChange);const o=new RTCPeerConnection(i);this.remotePeerConnection=o,this.trace("Created remote peer connection object remotePeerConnection."),o.addEventListener("icecandidate",this.handleConnection),o.addEventListener("iceconnectionstatechange",this.handleConnectionChange),o.addEventListener("track",this.gotRemoteMediaStream),this.trace("Add local localStream to localPeerConnection."),r.addTrack(e[0],t),r.addTrack(n[0],t),this.trace("localPeerConnection createOffer start."),r.createOffer({offerToReceiveVideo:!0}).then(a=>this.createdOffer(a)).catch(a=>this.setSessionDescriptionError(a))}handleConnection(t){const e=t.target,n=t.candidate;if(e&&n){const i=new RTCIceCandidate(n),r=this.getOtherPeer(e);r&&(r.addIceCandidate(i).then(()=>{this.handleConnectionSuccess(e)}).catch(o=>{this.handleConnectionFailure(e,o)}),this.trace(`${this.getPeerName(e)} ICE candidate:
|
|
59
59
|
${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:
|
|
60
60
|
${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:
|
|
61
61
|
${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:
|
|
62
|
-
${t.sdp}.`),this.remotePeerConnection&&(this.trace("remotePeerConnection setLocalDescription start."),this.remotePeerConnection.setLocalDescription(t).then(()=>{this.setLocalDescriptionSuccess(this.remotePeerConnection)}).catch(e=>this.setSessionDescriptionError(e))),this.localPeerConnection&&(this.trace("localPeerConnection setRemoteDescription start."),this.localPeerConnection.setRemoteDescription(t).then(()=>{this.setRemoteDescriptionSuccess(this.localPeerConnection)}).catch(e=>this.setSessionDescriptionError(e)))}setSessionDescriptionError(t){this.trace(`Failed to create session description: ${t.toString()}.`)}setDescriptionSuccess(t,e){const n=this.getPeerName(t);this.trace(`${n} ${e} complete.`)}setLocalDescriptionSuccess(t){this.setDescriptionSuccess(t,"setLocalDescription")}setRemoteDescriptionSuccess(t){this.setDescriptionSuccess(t,"setRemoteDescription")}trace(t){t=t.trim();const e=(window.performance.now()/1e3).toFixed(3);console.log(e,t);const n=document.createElement("div");n.innerHTML=`<div>${e}, ${t}</div>`,document.getElementById("trace")?.appendChild(n)}getOtherPeer(t){return t===this.localPeerConnection?this.remotePeerConnection:this.localPeerConnection}getPeerName(t){return t===this.localPeerConnection?"localPeerConnection":"remotePeerConnection"}}class Vw{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.")}}const Ku=[],tl={};function $o(s){Ku.push(s)}function Gw(s,t=!1){const e=Wu();if(tl[e])return;wx.error(r=>{console.log(r.errMsg||JSON.stringify(r))}),wx.ready(()=>{Ku.forEach(r=>r())});const n=["updateAppMessageShareData","updateTimelineShareData","onMenuShareWeibo","onMenuShareQZone","startRecord","stopRecord","onVoiceRecordEnd","playVoice","pauseVoice","stopVoice","onVoicePlayEnd","uploadVoice","downloadVoice","chooseImage","previewImage","uploadImage","downloadImage","getLocalImgData","translateVoice","getNetworkType","openLocation","getLocation","hideOptionMenu","showOptionMenu","hideMenuItems","showMenuItems","hideAllNonBaseMenuItem","showAllNonBaseMenuItem","closeWindow","scanQRCode","openProductSpecificView","addCard","chooseCard","openCard"],i=["wx-open-launch-app","wx-open-launch-app","wx-open-subscribe","wx-open-audio"];wx.config(Object.assign(s,{debug:t,jsApiList:n,openTagList:i})),tl[e]=!0}function qw(s){return new Promise((t,e)=>{wx.checkJsApi({jsApiList:[s],success:function(n){n.checkResult[s]?t(!0):e(!1)},fail:function(){e(!1)}})})}function jw(s){$o(function(){wx.updateAppMessageShareData(s)})}function Hw(s){$o(function(){wx.updateTimelineShareData(s)})}function Ww(s){wx.chooseImage(s)}function Jw(s){wx.previewImage(s)}function Zw(s){wx.uploadImage(s)}function Qw(s){wx.downloadImage(s)}function Kw(s){wx.getLocalImgData(s)}function t2(){wx.startRecord()}function e2(s){wx.stopRecord(s)}function n2(s){wx.onVoiceRecordEnd(s)}function s2(s){wx.playVoice(s)}function i2(s){wx.pauseVoice(s)}function r2(s){wx.stopVoice(s)}function o2(s){wx.onVoicePlayEnd(s)}function a2(s){wx.uploadVoice(s)}function c2(s){wx.downloadVoice(s)}function h2(s){wx.translateVoice(s)}function u2(s){wx.getNetworkType(s)}function l2(s){wx.openLocation(s)}function f2(s){wx.getLocation(s)}function d2(s){wx.scanQRCode(s)}function m2(s,t,e){function n(){WeixinJSBridge.invoke("getBrandWCPayRequest",s,function(i){i.err_msg=="get_brand_wcpay_request:ok"?t():e(i.err_msg)})}typeof WeixinJSBridge>"u"?document.addEventListener?document.addEventListener("WeixinJSBridgeReady",n,!1):document.attachEvent&&(document.attachEvent("WeixinJSBridgeReady",n),document.attachEvent("onWeixinJSBridgeReady",n)):n()}function p2(s,t,e="snsapi_userinfo",n=""){return`https://open.weixin.qq.com/connect/oauth2/authorize?appid=${s}&redirect_uri=${encodeURIComponent(t)}&response_type=code&scope=${e}&state=${n}#wechat_redirect`}function g2(s){window.AlipayJSBridge?s&&s():document.addEventListener("AlipayJSBridgeReady",s,!1)}function Zn(s,t){let e="未知错误";switch(s.error){case 1:e="接口不存在";break;case 2:e="参数无效";break;case 3:e="发生未知错误";break;case 4:e="接口无权限";break;case 10:e="用户取消";break;case 11:e="操作失败",t==="chooseImage"&&(e="操作失败(权限不够)");break;case 12:e="GPS打开,但定位失败";break;case 13:e="获取地理位置信息失败";break;case 14:e="定位超时";break;case 15:e="网络错误";break;case 16:e="GPS未打开或用户未授权";break}return`${s.error}(${e}): ${s.errorMessage}`}function y2(s,t,e){ap.tradePay(Object.assign(s,{}),function(n){let i="未知错误";switch(n.resultCode){case 9e3:return i="订单支付成功",t?.(i);case 8e3:i="正在处理中";break;case 4e3:i="订单支付失败";break;case 6001:i="用户中途取消";break;case 6002:i="网络连接出错";break;case 99:i="用户点击忘记密码导致快捷界面退出(only iOS)";break}e?.(i)})}function w2(s,t,e){ap.scan(Object.assign(s,{fail:n=>{e?.(Zn(n))}}),function(n){t?.(n.code)})}function x2(s,t,e){ap.getLocation(Object.assign(s,{fail:n=>{e?.(Zn(n))}}),function(n){t?.(n)})}function b2(s,t,e){ap.openLocation(Object.assign(s,{fail:n=>{e?.(Zn(n))}}),function(){t?.()})}function v2(s,t,e){ap.chooseImage(Object.assign(s,{fail:n=>{e?.(Zn(n,"chooseImage"))}}),function(n){t?.(n)})}function _2(s,t,e){ap.previewImage(Object.assign(s,{fail:n=>{e?.(Zn(n))}}),function(){t?.()})}class S2{map;constructor(t,e=120.619585,n=31.299379,i=18){this.map=new T.Map(t),this.map.centerAndZoom(new T.LngLat(e,n),i)}}const el=window.crypto.subtle;el||console.warn("Crypto API not supported");async function nl(s,t="SHA-256"){const e=await el.digest(t,tf(s));return ef(e)}async function C2(s,t="SHA-256"){const e=JSON.stringify(ql(s));return nl(e,t)}class T2{currentPage;itemsPerPage;entriesInterval;entriesEdge;linkTo;prevText;nextText;ellipseText;prevShowAlways;nextShowAlways;callback;totalPages;parentVNode;constructor(t,e,n){this.currentPage=n?.currentPage||0,this.itemsPerPage=n?.itemsPerPage||10,this.entriesInterval=n?.entriesInterval||5,this.entriesEdge=n?.entriesEdge||1,this.linkTo=n?.linkTo||"javascript:;",this.prevText=n?.prevText||"上一页",this.nextText=n?.nextText||"下一页",this.ellipseText=n?.ellipseText||"...",this.prevShowAlways=typeof n?.prevShowAlways=="boolean"?n?.prevShowAlways:!0,this.nextShowAlways=typeof n?.nextShowAlways=="boolean"?n?.nextShowAlways:!0,this.callback=n?.callback||(i=>!1),this.totalPages=Math.ceil(e/this.itemsPerPage),this.parentVNode=this.createParentVNode(),gn(this.parentVNode,t),this.selectPage(this.currentPage)}createParentVNode(){return Je("div",{class:"pagination"},[])}appendVNode(t,e,n){e=e<0?0:e<this.totalPages?e:this.totalPages-1;const i=n?.text||String(e+1),r=n?.classes||"";t.children.push(e==this.currentPage&&r.indexOf("prev")==-1&&r.indexOf("next")==-1?Je("span",{class:`current ${r}`},i):Je("a",{class:r,href:this.linkTo.replace(/__id__/,String(e)),onClick:o=>this.selectPage(e,o)},i))}drawLinks(){const t=this.createParentVNode(),e=Math.ceil(this.entriesInterval/2),n=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"}),n>0&&this.entriesEdge>0){const r=Math.min(this.entriesEdge,n);for(let o=0;o<r;o++)this.appendVNode(t,o);this.entriesEdge<n&&this.ellipseText&&t.children.push(Je("span",{},this.ellipseText))}for(let r=n;r<i;r++)this.appendVNode(t,r);if(i<this.totalPages&&this.entriesEdge>0){this.totalPages-this.entriesEdge>i&&this.ellipseText&&t.children.push(Je("span",{},this.ellipseText));const r=Math.max(this.totalPages-this.entriesEdge,i);for(let o=r;o<this.totalPages;o++)this.appendVNode(t,o)}this.nextText&&(this.currentPage<this.totalPages-1||this.nextShowAlways)&&this.appendVNode(t,this.currentPage+1,{text:this.nextText,classes:"next"}),Zs(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 n=this.callback(t);return e&&(n||(e.stopPropagation?e.stopPropagation():e.cancelBubble=!0)),n}prevPage(){return this.selectPage(this.currentPage-1)}nextPage(){return this.selectPage(this.currentPage+1)}}class E2{config;store;eb;axios;constructor(t={}){this.config=t,this.config.static=this.config.static||{};const e=this.config.store?.state||{};this.store=Aa(this.config.store?.reducer||(()=>e),e,this.config.store?.enhancer),this.eb=new ls,this.axios=new Wi({baseURL:this.config.axios?.baseURL,timeout:this.config.axios?.timeout,headers:this.config.axios?.headers,responseType:this.config.axios?.responseType,responseEncoding:this.config.axios?.responseEncoding,interceptor:this.config.axios?.interceptor,retry:this.config.axios?.retry,cache:this.config.axios?.cache})}}return m.ArrowShape=To,m.BallShape=pn,m.BezierEasing=vr,m.BufferAttribute=de,m.COLOR_NAMES=Jn,m.CSSToJSEasing=Zp,m.Clock=Cr,m.Color=Vt,m.ColorManagement=vo,m.CommonKeyCode=_y,m.Context=E2,m.CrossShape=Io,m.CustomCanvasContext=ah,m.CustomCanvasGradient=zs,m.CustomCanvasPattern=Pr,m.DOMParse=uo,m.DOMSVGUtil=Xe,m.DOMToBlob=Zi,m.DOMToString=Ji,m.DOMVideo=Hn,m.Easing=O,m.FetchWithAxios=Wi,m.FileUpload=gm,m.Float32BufferAttribute=F0,m.FoxShape=Ao,m.HeartShape=Eo,m.HeartVariantShape=Po,m.Int16BufferAttribute=R0,m.Int32BufferAttribute=O0,m.Int8BufferAttribute=k0,m.Interpolation=le,m.LineShape=mn,m.LinearSRGBColorSpace=xo,m.LinearToSRGB=je,m.LinearTransfer=bo,m.Ls=Ie,m.MVVM=kw,m.Matrix=_t,m.Matrix2=Or,m.Matrix3=un,m.Matrix4=Rt,m.NoColorSpace=Ru,m.Pagination=T2,m.QRCode=ke,m.RabbitShape=ko,m.RectShape=We,m.SRGBColorSpace=He,m.SRGBToLinear=qe,m.SRGBTransfer=js,m.SVGParse=Xw,m.SVGParsedPathArgsLength=Fn,m.SegmentShapeCombo=Ro,m.Shape=ft,m.ShapeCombo=Ut,m.ShipShapeCombo=Do,m.SliderShapeCombo=Lo,m.StarShape=Mo,m.TWEEN=rg,m.Timeline=Rn,m.TreeShapeCombo=Co,m.Tween=Sr,m.Uint16BufferAttribute=L0,m.Uint32BufferAttribute=z0,m.Uint8BufferAttribute=I0,m.Uint8ClampedBufferAttribute=D0,m.Vector2=Bn,m.Vector3=Bt,m.Vector4=Dr,m.WebGLCoordinateSystem=Nn,m.WebGLRenderer=Vw,m.WebGPUCoordinateSystem=Lr,m.WebRTCClient=$w,m.WebSocketClient=Iw,m.YZCanvasContext=Mr,m.YZMessageChannel=Nw,m.YZWorker=Bw,m.__color=pe,m.addClass=b1,m.addWatermark=i0,m.addWxJsReadyFnBeforeConfig=$o,m.ajax=Yw,m.aliJsChooseImage=v2,m.aliJsGetLocation=x2,m.aliJsOpenLocation=b2,m.aliJsPreviewImage=_2,m.aliJsReady=g2,m.aliJsScan=w2,m.aliJsTradePay=y2,m.angle=Qt,m.animateShapes=Vy,m.animateSpringChainShapes=qy,m.animateSpringConnectShapes=jy,m.animateSpringMassShapes=Hy,m.animationEnd$=ry,m.animationStart$=iy,m.appendURL=No,m.appendURLRecord=Fw,m.atomReadAttribute=yh,m.atomReadAttributes=Xr,m.atomReadStyle=_g,m.atomReadStyles=Yr,m.atomRemoveAttribute=Tg,m.atomRemoveDataset=hw,m.atomRemoveStyle=Ur,m.atomWriteAttribute=fn,m.atomWriteStyle=Ns,m.base64EncodeOutputStream=_h,m.bitmapMapper=zh,m.blobToImageData=kg,m.byteArrayOutputStream=Vr,m.canDrawBitmap=Oh,m.canUsePaths=E0,m.canUseWorker=Lh,m.cancelBubble=qc,m.cancelFetch=Cw,m.changeBrightness=n0,m.changeCheckboxChecked=p1,m.changeDiaphaneity=s0,m.changeRadioChecked=m1,m.changeSelected=d1,m.changeSize=e0,m.checkWxJsApi=qw,m.clearCookies=bw,m.clearLocalStorage=uw,m.clearSessionStorage=ww,m.closeLog=mf,m.closest=c1,m.combineTransformToMatrix=Sg,m.compareVersion=l0,m.computeImageDisplayRect=Eg,m.containsChild=i1,m.createDefaultMousePoint=Kr,m.createElement=Hh,m.createElementNS=S1,m.createFragment=jh,m.createIndexDB=_w,m.createObjectURL=Fh,m.createRunCycleInMaxRate=Yp,m.createTextNode=C1,m.createXMLHttpRequest=Qu,m.cssAttrsToCanvasAttrs=wh,m.distance=Ee,m.domPrefixes=Cg,m.drag$=su,m.dragEnd$=ru,m.dragEnter$=au,m.dragLeave$=cu,m.dragOver$=hu,m.dragStart$=iu,m.drawBitmapInCanvas=N0,m.drawQRCodeToCanvas=h0,m.drop$=ou,m.easeNameToCubicBezier=_r,m.empty=Vh,m.fireEvent=zp,m.flipSideToSide=Dg,m.flipUpsideDown=Rg,m.flushURL=Zu,m.flushURLRecord=zw,m.formDataToSearch=Ju,m.generateRosettaShape=Jy,m.getBitmapFromCanvas=B0,m.getBodyPosition=py,m.getBrowserClient=Gr,m.getBrowserClientVersion=f0,m.getBrowserLanguage=d0,m.getCSSVar=pw,m.getDOMMatrix=Br,m.getDirection=cg,m.getDocumentElementPosition=Gn,m.getElementPositionInPage=io,m.getElementPositionInPage2=yy,m.getElementPositionInViewport=gu,m.getEmSize=t1,m.getFetchId=Fo,m.getFileExtension=mm,m.getFileMD5Hash=pc,m.getFileTypeFromFile=dm,m.getFormSubmitData=Uw,m.getImageData=xh,m.getImageDataByAIData=o0,m.getImageMainColor=Ig,m.getInnerText=y1,m.getInternetExplorerVersion=kh,m.getKeyCode=Sy,m.getMIME=pm,m.getMouseButton=vy,m.getMousePositionInElement=lt,m.getMousePositionInPage=ro,m.getMousePositionInViewport=by,m.getOperatingSystem=Ys,m.getOperatingSystemVersion=u0,m.getPageSize=gy,m.getParameters=Ow,m.getPolymorphShapeCombosInterpolator=Nu,m.getPolymorphShapesInterpolator=So,m.getRelativeBoundingClientRect=wy,m.getRemSize=jr,m.getScreenPosition=my,m.getSelectedText=G0,m.getStyle=$e,m.getTheme$=mw,m.getTimeZone=m0,m.getURL=Qs,m.getVerticalScrollPercentInPage=xy,m.getViewportSize=pu,m.getVnode=Tr,m.gifImage=Sh,m.gravitateShapes=Gy,m.h=Je,m.hFromEl=Js,m.hasClass=_1,m.hasDocument=S0,m.hasHistory=C0,m.hasWindow=Rh,m.hideEl=qh,m.html=$h,m.iframePostMessage=T1,m.imageDataToBitmap=Pg,m.imageDataToBlob=Ag,m.imageDataToDataURL=Mg,m.immediateVnode=og,m.injectStyle=gh,m.injectWxJsConfig=Gw,m.insert=Vn,m.isActiveEl=Q0,m.isAliBrowser=Dh,m.isAliMiniProgram=_0,m.isAndroid=Ah,m.isAppleDevice=p0,m.isBrowserSupportFileAPI=T0,m.isElement=P0,m.isEventSupported=Bp,m.isIE=y0,m.isIE10=x0,m.isIE11=b0,m.isIE9=w0,m.isIOS=qr,m.isInput=$n,m.isInputCheckbox=Jr,m.isInputNumber=f1,m.isInputRadio=Zr,m.isInputText=l1,m.isMacOS=Mh,m.isMobile=g0,m.isRootEl=Z0,m.isSelect=Wr,m.isTextArea=u1,m.isTouchSupport=A0,m.isURL=Rw,m.isWxBrowser=Ih,m.isWxMiniProgram=v0,m.jpgToPng=Zg,m.keyDown$=uu,m.keyPress$=oy,m.keyUp$=lu,m.leftRotate=Lg,m.length=cn,m.mapTDTJSSDK=S2,m.marginSharpen=Jg,m.mosaic=r0,m.mount=gn,m.mouseClick$=I1,m.mouseContextMenu$=L1,m.mouseDoubleClick$=D1,m.mouseDown$=Zh,m.mouseEnter$=A1,m.mouseLeave$=k1,m.mouseMove$=$s,m.mouseOut$=M1,m.mouseOver$=P1,m.mouseUp$=Qh,m.mouseWheel$=R1,m.nearestElement=e1,m.nextElementSibling=o1,m.normalizePoint=ag,m.objectSignature=C2,m.onBeforeUnload=Nh,m.onDocumentReady=Bh,m.openLog=df,m.outputGifBase64=Ch,m.outputQRCodeBase64=c0,m.pan$=O1,m.panCancel$=N1,m.panDown$=$1,m.panEnd$=B1,m.panLeft$=Y1,m.panMove$=z1,m.panRight$=U1,m.panStart$=F1,m.panUp$=X1,m.parent=n1,m.parents=Hr,m.parseCSS=lo,m.parseTransformToMatrix=Fr,m.patch=Zs,m.pinch$=V1,m.pinchIn$=G1,m.pinchOut$=q1,m.pngToJpg=Qg,m.pointerCancel$=so,m.pointerDown$=eo,m.pointerMove$=to,m.pointerUp$=no,m.polar=hn,m.polymorphShapesTween=Wy,m.prefixes=M0,m.press$=j1,m.preventDefault=Ce,m.previousElementSibling=a1,m.radiusClip=t0,m.readFileInBrowser=Tn,m.recordToSearch=Ks,m.rectClip=Kg,m.rem2px=K0,m.remove=w1,m.removeClass=v1,m.requestAnimationFrameCycle=pr,m.reverseCSSToJSEasing=Qp,m.reverseEaseNameToCubicBezier=nh,m.reverseEasing=Zc,m.revokeObjectURL=Y0,m.rightRotate=Og,m.rotate$=H1,m.rotatePoint=te,m.scheduleIdle=jc,m.scheduleIdleAsap=Jc,m.scheduleVnode=Er,m.scrollParent=s1,m.scrollTo=W0,m.searchToRecord=Lw,m.selectFileInBrowser=Qi,m.setCSSVar=gw,m.setIntervalAccurate=Np,m.setLogUploadFn=pf,m.setManualScroll=J0,m.setRem=Dw,m.setStyle=Nr,m.setTheme=Hu,m.setTimeoutAccurate=gr,m.setWindowTitle=q0,m.shadowRoot=h1,m.sharpen=Wg,m.showEl=Gh,m.siblings=r1,m.signature=nl,m.simulateMouseEventFromTouch=Fp,m.stringToDOM=fm,m.swipe$=W1,m.swipeDown$=K1,m.swipeLeft$=J1,m.swipeRight$=Z1,m.swipeUp$=Q1,m.tap$=ty,m.tapOutSide$=ey,m.text=g1,m.toBlackAndWhite=Bg,m.toBlue=Xg,m.toBlueAndGreen=Gg,m.toBlueAndGrey=Hg,m.toDegree=Pt,m.toGreen=Ug,m.toGreenAndGrey=jg,m.toGrey=zg,m.toGrey2=Fg,m.toOpposite=Ng,m.toRadian=J,m.toRed=Yg,m.toRedAndBlue=Vg,m.toRedAndGreen=$g,m.toRedAndGrey=qg,m.toggleClass=Qr,m.toggleElDisplay=x1,m.toggleTheme=dw,m.touchCancel$=nu,m.touchEnd$=eu,m.touchMove$=Kh,m.touchStart$=tu,m.transformPath2D=vg,m.transitionEnd$=sy,m.transitionStart$=ny,m.trimHash=Wu,m.useAttribute=Ve,m.useClickA=Xs,m.useClipboard=H0,m.useCookie=xw,m.useCoords$=iw,m.useDataset=cw,m.useDraggable=ly,m.useDraw=Zy,m.useDrop=fy,m.useElementEventBus=Ay,m.useEvent$=X,m.useEventListener=j,m.useFetch=Hs,m.useFetchCache=Ew,m.useFetchRetry=Tw,m.useFetchRetryCache=Pw,m.useHashChange$=ow,m.useHotKeyDown$=wu,m.useHotKeyFile=Ty,m.useHotKeyFile$=xu,m.useHotKeyUp$=Cy,m.useIntersection=Ky,m.useIntersection$=Uu,m.useLoadImage=Uh,m.useLoadLink=X0,m.useLoadScript=U0,m.useLocalStorage=Gu,m.useLocale=Bo,m.useLocation$=Vu,m.useMatchMedia$=$u,m.useMouseAndPointerDownMovePoint$=du,m.useMouseDownMovePoint$=cy,m.useMouseMovePoint$=ay,m.useMousePoint=Ge,m.useMutation=Qy,m.useMutation$=Yu,m.usePointerDownMovePoint$=fu,m.usePopStateChange$=aw,m.usePressDownMove=vu,m.usePressDownMoveWithMouse=ky,m.usePressDownMoveWithPointer=_u,m.usePressDownMoveWithTouch=Iy,m.usePull$=uy,m.useResize=bu,m.useResize$=oo,m.useRunInSandbox=E1,m.useSafeArea$=sw,m.useScroll$=mu,m.useSelectFile=Xh,m.useSelectFileImage=V0,m.useSessionStorage=yw,m.useTimestampValue=Oo,m.useTouchDownMovePoint$=hy,m.useUrlChange$=rw,m.useVisible$=ew,m.useVisibleSimple$=tw,m.useWindowResize=Ey,m.useWindowResize$=Py,m.useWindowVisible$=dy,m.vibrate=j0,m.waitForStyleSheetsLoaded=$0,m.writeToIndexDB=Sw,m.wxJsChooseImage=Ww,m.wxJsDownloadImage=Qw,m.wxJsDownloadVoice=c2,m.wxJsGetLocalImgData=Kw,m.wxJsGetLocation=f2,m.wxJsGetNetworkType=u2,m.wxJsLogin=p2,m.wxJsOnVoicePlayEnd=o2,m.wxJsOnVoiceRecordEnd=n2,m.wxJsOpenLocation=l2,m.wxJsPauseVoice=i2,m.wxJsPay=m2,m.wxJsPlayVoice=s2,m.wxJsPreviewImage=Jw,m.wxJsScanQRCode=d2,m.wxJsStartRecord=t2,m.wxJsStopRecord=e2,m.wxJsStopVoice=r2,m.wxJsTranslateVoice=h2,m.wxJsUpdateAppMessageShareData=jw,m.wxJsUpdateTimelineShareData=Hw,m.wxJsUploadImage=Zw,m.wxJsUploadVoice=a2,Object.defineProperty(m,Symbol.toStringTag,{value:"Module"}),m}({});
|
|
62
|
+
${t.sdp}.`),this.remotePeerConnection&&(this.trace("remotePeerConnection setLocalDescription start."),this.remotePeerConnection.setLocalDescription(t).then(()=>{this.setLocalDescriptionSuccess(this.remotePeerConnection)}).catch(e=>this.setSessionDescriptionError(e))),this.localPeerConnection&&(this.trace("localPeerConnection setRemoteDescription start."),this.localPeerConnection.setRemoteDescription(t).then(()=>{this.setRemoteDescriptionSuccess(this.localPeerConnection)}).catch(e=>this.setSessionDescriptionError(e)))}setSessionDescriptionError(t){this.trace(`Failed to create session description: ${t.toString()}.`)}setDescriptionSuccess(t,e){const n=this.getPeerName(t);this.trace(`${n} ${e} complete.`)}setLocalDescriptionSuccess(t){this.setDescriptionSuccess(t,"setLocalDescription")}setRemoteDescriptionSuccess(t){this.setDescriptionSuccess(t,"setRemoteDescription")}trace(t){t=t.trim();const e=(window.performance.now()/1e3).toFixed(3);console.log(e,t);const n=document.createElement("div");n.innerHTML=`<div>${e}, ${t}</div>`,document.getElementById("trace")?.appendChild(n)}getOtherPeer(t){return t===this.localPeerConnection?this.remotePeerConnection:this.localPeerConnection}getPeerName(t){return t===this.localPeerConnection?"localPeerConnection":"remotePeerConnection"}}class Yw{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.")}}const Ku=[],tl={};function jo(s){Ku.push(s)}function Xw(s,t=!1){const e=Wu();if(tl[e])return;wx.error(r=>{console.log(r.errMsg||JSON.stringify(r))}),wx.ready(()=>{Ku.forEach(r=>r())});const n=["updateAppMessageShareData","updateTimelineShareData","onMenuShareWeibo","onMenuShareQZone","startRecord","stopRecord","onVoiceRecordEnd","playVoice","pauseVoice","stopVoice","onVoicePlayEnd","uploadVoice","downloadVoice","chooseImage","previewImage","uploadImage","downloadImage","getLocalImgData","translateVoice","getNetworkType","openLocation","getLocation","hideOptionMenu","showOptionMenu","hideMenuItems","showMenuItems","hideAllNonBaseMenuItem","showAllNonBaseMenuItem","closeWindow","scanQRCode","openProductSpecificView","addCard","chooseCard","openCard"],i=["wx-open-launch-app","wx-open-launch-app","wx-open-subscribe","wx-open-audio"];wx.config(Object.assign(s,{debug:t,jsApiList:n,openTagList:i})),tl[e]=!0}function Uw(s){return new Promise((t,e)=>{wx.checkJsApi({jsApiList:[s],success:function(n){n.checkResult[s]?t(!0):e(!1)},fail:function(){e(!1)}})})}function $w(s){jo(function(){wx.updateAppMessageShareData(s)})}function Vw(s){jo(function(){wx.updateTimelineShareData(s)})}function Gw(s){wx.chooseImage(s)}function qw(s){wx.previewImage(s)}function jw(s){wx.uploadImage(s)}function Hw(s){wx.downloadImage(s)}function Ww(s){wx.getLocalImgData(s)}function Jw(){wx.startRecord()}function Zw(s){wx.stopRecord(s)}function Qw(s){wx.onVoiceRecordEnd(s)}function Kw(s){wx.playVoice(s)}function t2(s){wx.pauseVoice(s)}function e2(s){wx.stopVoice(s)}function n2(s){wx.onVoicePlayEnd(s)}function s2(s){wx.uploadVoice(s)}function i2(s){wx.downloadVoice(s)}function r2(s){wx.translateVoice(s)}function o2(s){wx.getNetworkType(s)}function a2(s){wx.openLocation(s)}function h2(s){wx.getLocation(s)}function c2(s){wx.scanQRCode(s)}function u2(s,t,e){function n(){WeixinJSBridge.invoke("getBrandWCPayRequest",s,function(i){i.err_msg=="get_brand_wcpay_request:ok"?t():e(i.err_msg)})}typeof WeixinJSBridge>"u"?document.addEventListener?document.addEventListener("WeixinJSBridgeReady",n,!1):document.attachEvent&&(document.attachEvent("WeixinJSBridgeReady",n),document.attachEvent("onWeixinJSBridgeReady",n)):n()}function l2(s,t,e="snsapi_userinfo",n=""){return`https://open.weixin.qq.com/connect/oauth2/authorize?appid=${s}&redirect_uri=${encodeURIComponent(t)}&response_type=code&scope=${e}&state=${n}#wechat_redirect`}function f2(s){window.AlipayJSBridge?s&&s():document.addEventListener("AlipayJSBridgeReady",s,!1)}function ts(s,t){let e="未知错误";switch(s.error){case 1:e="接口不存在";break;case 2:e="参数无效";break;case 3:e="发生未知错误";break;case 4:e="接口无权限";break;case 10:e="用户取消";break;case 11:e="操作失败",t==="chooseImage"&&(e="操作失败(权限不够)");break;case 12:e="GPS打开,但定位失败";break;case 13:e="获取地理位置信息失败";break;case 14:e="定位超时";break;case 15:e="网络错误";break;case 16:e="GPS未打开或用户未授权";break}return`${s.error}(${e}): ${s.errorMessage}`}function d2(s,t,e){ap.tradePay(Object.assign(s,{}),function(n){let i="未知错误";switch(n.resultCode){case 9e3:return i="订单支付成功",t?.(i);case 8e3:i="正在处理中";break;case 4e3:i="订单支付失败";break;case 6001:i="用户中途取消";break;case 6002:i="网络连接出错";break;case 99:i="用户点击忘记密码导致快捷界面退出(only iOS)";break}e?.(i)})}function m2(s,t,e){ap.scan(Object.assign(s,{fail:n=>{e?.(ts(n))}}),function(n){t?.(n.code)})}function p2(s,t,e){ap.getLocation(Object.assign(s,{fail:n=>{e?.(ts(n))}}),function(n){t?.(n)})}function g2(s,t,e){ap.openLocation(Object.assign(s,{fail:n=>{e?.(ts(n))}}),function(){t?.()})}function y2(s,t,e){ap.chooseImage(Object.assign(s,{fail:n=>{e?.(ts(n,"chooseImage"))}}),function(n){t?.(n)})}function w2(s,t,e){ap.previewImage(Object.assign(s,{fail:n=>{e?.(ts(n))}}),function(){t?.()})}class x2{map;constructor(t,e=120.619585,n=31.299379,i=18){this.map=new T.Map(t),this.map.centerAndZoom(new T.LngLat(e,n),i)}}const el=window.crypto.subtle;el||console.warn("Crypto API not supported");async function nl(s,t="SHA-256"){const e=await el.digest(t,Kl(s));return tf(e)}async function b2(s,t="SHA-256"){const e=JSON.stringify(Gl(s));return nl(e,t)}class v2{currentPage;itemsPerPage;entriesInterval;entriesEdge;linkTo;prevText;nextText;ellipseText;prevShowAlways;nextShowAlways;callback;totalPages;parentVNode;constructor(t,e,n){this.currentPage=n?.currentPage||0,this.itemsPerPage=n?.itemsPerPage||10,this.entriesInterval=n?.entriesInterval||5,this.entriesEdge=n?.entriesEdge||1,this.linkTo=n?.linkTo||"javascript:;",this.prevText=n?.prevText||"上一页",this.nextText=n?.nextText||"下一页",this.ellipseText=n?.ellipseText||"...",this.prevShowAlways=typeof n?.prevShowAlways=="boolean"?n?.prevShowAlways:!0,this.nextShowAlways=typeof n?.nextShowAlways=="boolean"?n?.nextShowAlways:!0,this.callback=n?.callback||(i=>!1),this.totalPages=Math.ceil(e/this.itemsPerPage),this.parentVNode=this.createParentVNode(),wn(this.parentVNode,t),this.selectPage(this.currentPage)}createParentVNode(){return Qe("div",{class:"pagination"},[])}appendVNode(t,e,n){e=e<0?0:e<this.totalPages?e:this.totalPages-1;const i=n?.text||String(e+1),r=n?.classes||"";t.children.push(e==this.currentPage&&r.indexOf("prev")==-1&&r.indexOf("next")==-1?Qe("span",{class:`current ${r}`},i):Qe("a",{class:r,href:this.linkTo.replace(/__id__/,String(e)),onClick:o=>this.selectPage(e,o)},i))}drawLinks(){const t=this.createParentVNode(),e=Math.ceil(this.entriesInterval/2),n=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"}),n>0&&this.entriesEdge>0){const r=Math.min(this.entriesEdge,n);for(let o=0;o<r;o++)this.appendVNode(t,o);this.entriesEdge<n&&this.ellipseText&&t.children.push(Qe("span",{},this.ellipseText))}for(let r=n;r<i;r++)this.appendVNode(t,r);if(i<this.totalPages&&this.entriesEdge>0){this.totalPages-this.entriesEdge>i&&this.ellipseText&&t.children.push(Qe("span",{},this.ellipseText));const r=Math.max(this.totalPages-this.entriesEdge,i);for(let o=r;o<this.totalPages;o++)this.appendVNode(t,o)}this.nextText&&(this.currentPage<this.totalPages-1||this.nextShowAlways)&&this.appendVNode(t,this.currentPage+1,{text:this.nextText,classes:"next"}),Ks(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 n=this.callback(t);return e&&(n||(e.stopPropagation?e.stopPropagation():e.cancelBubble=!0)),n}prevPage(){return this.selectPage(this.currentPage-1)}nextPage(){return this.selectPage(this.currentPage+1)}}class _2{config;store;eb;axios;constructor(t={}){this.config=t,this.config.static=this.config.static||{};const e=this.config.store?.state||{};this.store=Ia(this.config.store?.reducer||(()=>e),e,this.config.store?.enhancer),this.eb=new fs,this.axios=new Ji({baseURL:this.config.axios?.baseURL,timeout:this.config.axios?.timeout,headers:this.config.axios?.headers,responseType:this.config.axios?.responseType,responseEncoding:this.config.axios?.responseEncoding,interceptor:this.config.axios?.interceptor,retry:this.config.axios?.retry,cache:this.config.axios?.cache})}}return d.ArrowShape=Po,d.BallShape=yn,d.BezierEasing=_r,d.BufferAttribute=me,d.COLOR_NAMES=Qn,d.CSSToJSEasing=Wp,d.Clock=Tr,d.Color=Ft,d.ColorManagement=So,d.CommonKeyCode=b1,d.Context=_2,d.CrossShape=Lo,d.CustomCanvasContext=hc,d.CustomCanvasGradient=Ns,d.CustomCanvasPattern=Ar,d.DOMParse=fo,d.DOMSVGUtil=$e,d.DOMToBlob=Qi,d.DOMToString=Zi,d.DOMVideo=Jn,d.DrawContext=H1,d.Easing=O,d.EllipseShape=Ro,d.FetchWithAxios=Ji,d.FileUpload=dm,d.Float32BufferAttribute=O0,d.FoxShape=Io,d.HeartShape=Mo,d.HeartVariantShape=Ao,d.Int16BufferAttribute=I0,d.Int32BufferAttribute=L0,d.Int8BufferAttribute=M0,d.Interpolation=fe,d.LineShape=Je,d.LinearSRGBColorSpace=vo,d.LinearToSRGB=We,d.LinearTransfer=_o,d.Ls=De,d.MVVM=Ew,d.Matrix=vt,d.Matrix2=Nr,d.Matrix3=dn,d.Matrix4=It,d.NoColorSpace=Lu,d.Pagination=v2,d.QRCode=Ie,d.RabbitShape=Do,d.RectShape=Ze,d.RingIndicatorShapeCombo=Bo,d.RingShape=Kn,d.SRGBColorSpace=je,d.SRGBToLinear=He,d.SRGBTransfer=Ws,d.SVGParse=Bw,d.SVGParsedPathArgsLength=Fn,d.SegmentShapeCombo=zo,d.Shape=ot,d.ShapeCombo=Lt,d.ShipShapeCombo=Oo,d.SliderShapeCombo=No,d.StarShape=ko,d.TWEEN=sg,d.Timeline=On,d.TreeShapeCombo=Eo,d.Tween=Cr,d.Uint16BufferAttribute=D0,d.Uint32BufferAttribute=R0,d.Uint8BufferAttribute=A0,d.Uint8ClampedBufferAttribute=k0,d.Vector2=Yn,d.Vector3=zt,d.Vector4=Rr,d.WebGLCoordinateSystem=Xn,d.WebGLRenderer=Yw,d.WebGPUCoordinateSystem=zr,d.WebRTCClient=Fw,d.WebSocketClient=Pw,d.YZCanvasContext=kr,d.YZMessageChannel=Ow,d.YZWorker=Rw,d.__color=ge,d.addClass=wy,d.addWatermark=n0,d.addWxJsReadyFnBeforeConfig=jo,d.ajax=zw,d.aliJsChooseImage=y2,d.aliJsGetLocation=p2,d.aliJsOpenLocation=g2,d.aliJsPreviewImage=w2,d.aliJsReady=f2,d.aliJsScan=m2,d.aliJsTradePay=d2,d.angle=Jt,d.animateShapes=X1,d.animateSpringChainShapes=$1,d.animateSpringConnectShapes=V1,d.animateSpringMassShapes=G1,d.animationEnd$=s1,d.animationStart$=n1,d.appendURL=$o,d.appendURLRecord=Lw,d.atomReadAttribute=wc,d.atomReadAttributes=Vr,d.atomReadStyle=bg,d.atomReadStyles=Ur,d.atomRemoveAttribute=Sg,d.atomRemoveDataset=iw,d.atomRemoveStyle=$r,d.atomWriteAttribute=pn,d.atomWriteStyle=Ys,d.base64EncodeOutputStream=Sc,d.bitmapMapper=Nc,d.blobToImageData=Mg,d.byteArrayOutputStream=qr,d.canDrawBitmap=zc,d.canUsePaths=C0,d.canUseWorker=Oc,d.cancelBubble=Hh,d.cancelFetch=xw,d.changeBrightness=t0,d.changeCheckboxChecked=dy,d.changeDiaphaneity=e0,d.changeRadioChecked=fy,d.changeSelected=ly,d.changeSize=Kg,d.checkWxJsApi=Uw,d.clearCookies=pw,d.clearLocalStorage=rw,d.clearSessionStorage=dw,d.closeLog=lf,d.closest=oy,d.combineTransformToMatrix=vg,d.compareVersion=c0,d.computeImageDisplayRect=Cg,d.containsChild=ny,d.createDefaultMousePoint=eo,d.createElement=Wc,d.createElementNS=vy,d.createFragment=Hc,d.createIndexDB=yw,d.createObjectURL=Bc,d.createRunCycleInMaxRate=Bp,d.createTextNode=_y,d.createXMLHttpRequest=Qu,d.cssAttrsToCanvasAttrs=xc,d.distance=Ee,d.domPrefixes=_g,d.drag$=iu,d.dragEnd$=ou,d.dragEnter$=hu,d.dragLeave$=cu,d.dragOver$=uu,d.dragStart$=ru,d.drawBitmapInCanvas=N0,d.drawQRCodeToCanvas=a0,d.drop$=au,d.easeNameToCubicBezier=Sr,d.empty=Gc,d.fireEvent=Rp,d.flipSideToSide=kg,d.flipUpsideDown=Ig,d.flushURL=Zu,d.flushURLRecord=Dw,d.formDataToSearch=Ju,d.generateRosettaShape=j1,d.getBitmapFromCanvas=z0,d.getBodyPosition=d1,d.getBrowserClient=jr,d.getBrowserClientVersion=u0,d.getBrowserLanguage=l0,d.getCSSVar=uw,d.getDOMMatrix=Yr,d.getDirection=og,d.getDocumentElementPosition=jn,d.getElementPositionInPage=oo,d.getElementPositionInPage2=p1,d.getElementPositionInViewport=gu,d.getEmSize=Q0,d.getFetchId=Xo,d.getFileExtension=lm,d.getFileMD5Hash=yh,d.getFileTypeFromFile=um,d.getFormSubmitData=Nw,d.getImageData=bc,d.getImageDataByAIData=i0,d.getImageMainColor=Ag,d.getInnerText=py,d.getInternetExplorerVersion=Ic,d.getKeyCode=v1,d.getMIME=fm,d.getMouseButton=x1,d.getMousePositionInElement=ft,d.getMousePositionInPage=ao,d.getMousePositionInViewport=w1,d.getOperatingSystem=Xs,d.getOperatingSystemVersion=h0,d.getPageSize=m1,d.getParameters=Iw,d.getPolymorphShapeCombosInterpolator=Fu,d.getPolymorphShapesInterpolator=To,d.getRelativeBoundingClientRect=g1,d.getRemSize=Wr,d.getScreenPosition=f1,d.getSelectedText=$0,d.getStyle=Ve,d.getTheme$=cw,d.getTimeZone=f0,d.getURL=ti,d.getVerticalScrollTopPercentInPage=y1,d.getViewportSize=pu,d.getVnode=Er,d.gifImage=Cc,d.gravitateShapes=U1,d.h=Qe,d.hFromEl=Qs,d.hasClass=by,d.hasDocument=v0,d.hasHistory=_0,d.hasWindow=Rc,d.hideEl=jc,d.html=Vc,d.iframePostMessage=Sy,d.imageDataToBitmap=Tg,d.imageDataToBlob=Pg,d.imageDataToDataURL=Eg,d.injectStyle=yc,d.injectWxJsConfig=Xw,d.insert=qn,d.isActiveEl=J0,d.isAliBrowser=Lc,d.isAliMiniProgram=b0,d.isAndroid=kc,d.isAppleDevice=d0,d.isBrowserSupportFileAPI=S0,d.isElement=T0,d.isEventSupported=zp,d.isIE=p0,d.isIE10=y0,d.isIE11=w0,d.isIE9=g0,d.isIOS=Hr,d.isInput=Gn,d.isInputCheckbox=Qr,d.isInputNumber=uy,d.isInputRadio=Kr,d.isInputText=cy,d.isMacOS=Ac,d.isMobile=m0,d.isRootEl=W0,d.isSelect=Zr,d.isTextArea=hy,d.isTouchSupport=P0,d.isURL=Aw,d.isWxBrowser=Dc,d.isWxMiniProgram=x0,d.jpgToPng=Wg,d.keyDown$=lu,d.keyPress$=i1,d.keyUp$=fu,d.leftRotate=Dg,d.length=fn,d.mapTDTJSSDK=x2,d.marginSharpen=Hg,d.mosaic=s0,d.mount=wn,d.mouseClick$=Ay,d.mouseContextMenu$=Dy,d.mouseDoubleClick$=ky,d.mouseDown$=Qc,d.mouseEnter$=Py,d.mouseLeave$=My,d.mouseMove$=Vs,d.mouseOut$=Ey,d.mouseOver$=Ty,d.mouseUp$=Kc,d.mouseWheel$=Iy,d.nearestElement=K0,d.nextElementSibling=iy,d.normalizePoint=rg,d.objectSignature=b2,d.onBeforeUnload=Yc,d.onDocumentReady=Fc,d.openLog=uf,d.outputGifBase64=Tc,d.outputQRCodeBase64=o0,d.pan$=Ly,d.panCancel$=Ny,d.panDown$=Xy,d.panEnd$=zy,d.panLeft$=By,d.panMove$=Ry,d.panRight$=Fy,d.panStart$=Oy,d.panUp$=Yy,d.parent=ty,d.parents=Jr,d.parseCSS=mo,d.parseTransformToMatrix=Fr,d.patch=Ks,d.pinch$=Uy,d.pinchIn$=$y,d.pinchOut$=Vy,d.pngToJpg=Jg,d.pointerCancel$=ro,d.pointerDown$=so,d.pointerMove$=no,d.pointerUp$=io,d.polar=Pe,d.polymorphShapesTween=q1,d.prefixes=E0,d.press$=Gy,d.preventDefault=Ce,d.previousElementSibling=ry,d.radiusClip=Qg,d.readFileInBrowser=Mn,d.recordToSearch=ei,d.rectClip=Zg,d.rem2px=Z0,d.remove=gy,d.removeClass=xy,d.requestAnimationFrameCycle=gr,d.reverseCSSToJSEasing=Jp,d.reverseEaseNameToCubicBezier=ic,d.reverseEasing=Kh,d.revokeObjectURL=B0,d.rightRotate=Lg,d.rotate$=qy,d.rotatePoint=Qt,d.scheduleIdle=Wh,d.scheduleIdleAsap=Qh,d.scheduleVnodeAsap=Mr,d.scheduleVnodeImmediately=ig,d.scrollParent=ey,d.scrollTo=j0,d.searchToRecord=kw,d.selectFileInBrowser=Ki,d.setCSSVar=lw,d.setIntervalAccurate=Np,d.setLogUploadFn=ff,d.setManualScroll=H0,d.setRem=Mw,d.setStyle=Xr,d.setTheme=Hu,d.setTimeoutAccurate=yr,d.setWindowTitle=V0,d.shadowRoot=ay,d.sharpen=jg,d.showEl=qc,d.siblings=sy,d.signature=nl,d.simulateMouseEventFromTouch=Op,d.stringToDOM=cm,d.swipe$=jy,d.swipeDown$=Zy,d.swipeLeft$=Hy,d.swipeRight$=Wy,d.swipeUp$=Jy,d.tap$=Qy,d.tapOutSide$=Ky,d.text=my,d.toBlackAndWhite=zg,d.toBlue=Yg,d.toBlueAndGreen=$g,d.toBlueAndGrey=qg,d.toDegree=Et,d.toGreen=Fg,d.toGreenAndGrey=Gg,d.toGrey=Rg,d.toGrey2=Og,d.toOpposite=Ng,d.toRadian=q,d.toRed=Bg,d.toRedAndBlue=Ug,d.toRedAndGreen=Xg,d.toRedAndGrey=Vg,d.toggleClass=to,d.toggleElDisplay=yy,d.toggleTheme=hw,d.touchCancel$=su,d.touchEnd$=nu,d.touchMove$=tu,d.touchStart$=eu,d.transformPath2D=xg,d.transitionEnd$=e1,d.transitionStart$=t1,d.trimHash=Wu,d.updateVnode=Pr,d.useAttribute=Ge,d.useClickA=$s,d.useClipboard=q0,d.useCookie=mw,d.useCoords$=K1,d.useDataset=sw,d.useDocumentVisible$=l1,d.useDraggable=c1,d.useDrop=u1,d.useElementEventBus=E1,d.useEvent$=U,d.useEventListener=W,d.useFetch=Js,d.useFetchCache=vw,d.useFetchRetry=bw,d.useFetchRetryCache=_w,d.useHashChange$=ew,d.useHotKeyDown$=wu,d.useHotKeyFile=S1,d.useHotKeyFile$=xu,d.useHotKeyUp$=_1,d.useIntersection$=Xu,d.useLoadImage=Uc,d.useLoadLink=Y0,d.useLoadScript=F0,d.useLocalStorage=Gu,d.useLocale=Uo,d.useLocation$=Vu,d.useMatchMedia$=$u,d.useMouseAndPointerDownMovePoint$=du,d.useMouseDownMovePoint$=o1,d.useMouseMovePoint$=r1,d.useMousePoint=qe,d.useMutation$=Yu,d.usePointerDownMovePoint$=Gs,d.usePopStateChange$=nw,d.usePressDownMove=vu,d.usePressDownMoveWithMouse=P1,d.usePressDownMoveWithPointer=_u,d.usePressDownMoveWithTouch=M1,d.usePull$=h1,d.useResize=bu,d.useResize$=ho,d.useRunInSandbox=Cy,d.useSafeArea$=Q1,d.useScroll$=mu,d.useSelectFile=$c,d.useSelectFileImage=U0,d.useSessionStorage=fw,d.useTimestampValue=Fo,d.useTouchDownMovePoint$=a1,d.useUrlChange$=tw,d.useVisible$=J1,d.useVisibleSimple$=W1,d.useWindowResize$=C1,d.vibrate=G0,d.waitForStyleSheetsLoaded=X0,d.writeToIndexDB=ww,d.wxJsChooseImage=Gw,d.wxJsDownloadImage=Hw,d.wxJsDownloadVoice=i2,d.wxJsGetLocalImgData=Ww,d.wxJsGetLocation=h2,d.wxJsGetNetworkType=o2,d.wxJsLogin=l2,d.wxJsOnVoicePlayEnd=n2,d.wxJsOnVoiceRecordEnd=Qw,d.wxJsOpenLocation=a2,d.wxJsPauseVoice=t2,d.wxJsPay=u2,d.wxJsPlayVoice=Kw,d.wxJsPreviewImage=qw,d.wxJsScanQRCode=c2,d.wxJsStartRecord=Jw,d.wxJsStopRecord=Zw,d.wxJsStopVoice=e2,d.wxJsTranslateVoice=r2,d.wxJsUpdateAppMessageShareData=$w,d.wxJsUpdateTimelineShareData=Vw,d.wxJsUploadImage=jw,d.wxJsUploadVoice=s2,Object.defineProperty(d,Symbol.toStringTag,{value:"Module"}),d}({});
|
|
63
63
|
//# sourceMappingURL=zyzgroup_core_web.iife.js.map
|