@zyzgroup/core-web 0.1.86 → 0.1.88
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/css/better.css +349 -0
- package/dist/{font.css → css/font.css} +42 -35
- package/dist/css/media.css +65 -0
- package/dist/css/theme.css +224 -0
- package/dist/fonts/D-DINExp/D-DINExp-Bold-number.ttf +0 -0
- package/dist/fonts/D-DINExp/D-DINExp-Bold.ttf +0 -0
- package/dist/fonts/D-DINExp/D-DINExp-number-with-money.ttf +0 -0
- package/dist/fonts/D-DINExp/D-DINExp-number.ttf +0 -0
- package/dist/fonts/HYYouYuan/HYYouYuan-55W.ttf +0 -0
- package/dist/fonts/HYYouYuan/HYYouYuan-75W.ttf +0 -0
- package/dist/fonts/IosevkaCurly/iosevka-curly-bold.woff2 +0 -0
- package/dist/fonts/IosevkaCurly/iosevka-curly-medium.woff2 +0 -0
- package/dist/zyzgroup_core_web.iife.js +33 -33
- package/dist/zyzgroup_core_web.iife.js.map +1 -1
- package/dist/zyzgroup_core_web.js +10318 -9824
- package/dist/zyzgroup_core_web.js.map +1 -1
- package/dist/zyzgroup_core_web.umd.cjs +33 -33
- package/dist/zyzgroup_core_web.umd.cjs.map +1 -1
- package/package.json +7 -6
- package/types/Context.d.ts +4 -4
- package/types/Context.d.ts.map +1 -1
- package/types/DeviceFingerprint.d.ts +4 -0
- package/types/DeviceFingerprint.d.ts.map +1 -0
- package/types/Pagination.d.ts.map +1 -1
- package/types/WebMonitor.d.ts +15 -0
- package/types/WebMonitor.d.ts.map +1 -0
- package/types/WebSocketClient.d.ts.map +1 -1
- package/types/ajax.d.ts.map +1 -1
- package/types/animate/schedule.d.ts +3 -0
- package/types/animate/schedule.d.ts.map +1 -1
- package/types/animate/tween/Easing.d.ts +42 -39
- package/types/animate/tween/Easing.d.ts.map +1 -1
- package/types/animate/tween/index.d.ts +41 -38
- package/types/animate/tween/index.d.ts.map +1 -1
- package/types/color.d.ts +1 -0
- package/types/color.d.ts.map +1 -1
- package/types/env.d.ts +4 -10
- package/types/env.d.ts.map +1 -1
- package/types/file.d.ts +12 -4
- package/types/file.d.ts.map +1 -1
- package/types/hooks/useAttribute.d.ts +0 -1
- package/types/hooks/useAttribute.d.ts.map +1 -1
- package/types/hooks/useCookie.d.ts +3 -3
- package/types/hooks/useCookie.d.ts.map +1 -1
- package/types/hooks/useDraw/DrawContext.d.ts.map +1 -1
- package/types/hooks/useDraw/Shape.d.ts.map +1 -1
- package/types/hooks/useDraw/canvas/YZCanvasContext.d.ts +1 -0
- package/types/hooks/useDraw/canvas/YZCanvasContext.d.ts.map +1 -1
- package/types/hooks/useDraw/line/PathD.d.ts.map +1 -1
- package/types/hooks/useElement.d.ts +19 -4
- package/types/hooks/useElement.d.ts.map +1 -1
- package/types/hooks/useElementEventBus.d.ts.map +1 -1
- package/types/hooks/useElementEvents.d.ts +87 -23
- package/types/hooks/useElementEvents.d.ts.map +1 -1
- package/types/hooks/useEventListener.d.ts +21 -8
- package/types/hooks/useEventListener.d.ts.map +1 -1
- package/types/hooks/useFeRouteChange.d.ts +23 -1
- package/types/hooks/useFeRouteChange.d.ts.map +1 -1
- package/types/hooks/useFetch.d.ts.map +1 -1
- package/types/hooks/useLocalStorage.d.ts +3 -6
- package/types/hooks/useLocalStorage.d.ts.map +1 -1
- package/types/hooks/useSessionStorage.d.ts +3 -6
- package/types/hooks/useSessionStorage.d.ts.map +1 -1
- package/types/hooks/useStyle.d.ts +19 -1
- package/types/hooks/useStyle.d.ts.map +1 -1
- package/types/hooks/useTheme.d.ts +2 -1
- package/types/hooks/useTheme.d.ts.map +1 -1
- package/types/hooks/useVnode.d.ts.map +1 -1
- package/types/index.d.ts +1 -1
- package/types/index.d.ts.map +1 -1
- package/types/math/Matrix.d.ts.map +1 -1
- package/types/signature.d.ts.map +1 -1
- package/types/threejs.d.ts +2 -0
- package/types/threejs.d.ts.map +1 -0
- package/types/vnode.d.ts.map +1 -1
- package/dist/better.css +0 -425
- package/dist/theme.css +0 -28
- package/types/axios.d.ts +0 -35
- package/types/axios.d.ts.map +0 -1
- /package/dist/{animate.css → css/animate.css} +0 -0
- /package/dist/{animate.min.css → css/animate.min.css} +0 -0
- /package/dist/{animate_ce.css → css/animate_ce.css} +0 -0
- /package/dist/{effects.css → css/effects.css} +0 -0
- /package/dist/{flex.css → css/flex.css} +0 -0
- /package/dist/{grid.css → css/grid.css} +0 -0
- /package/dist/{rem_1080.css → css/rem_1080.css} +0 -0
- /package/dist/{rem_1920.css → css/rem_1920.css} +0 -0
- /package/dist/{rem_640.css → css/rem_640.css} +0 -0
- /package/dist/{rem_720.css → css/rem_720.css} +0 -0
- /package/dist/{rem_750.css → css/rem_750.css} +0 -0
- /package/dist/{tailwind.css → css/tailwind.css} +0 -0
- /package/dist/{D-DINCondensed-number.ttf → fonts/D-DINExp/D-DINCondensed-number.ttf} +0 -0
- /package/dist/{D-DINExp.ttf → fonts/D-DINExp/D-DINExp.ttf} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var ZYZGroupCoreWeb=function(
|
|
1
|
+
var ZYZGroupCoreWeb=function(m){"use strict";const Ku={};function Qu(){return typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:this||Ku}const St=Qu(),tf="@YZ/";function Ti(s,t=tf){return s.startsWith(t)?s:`${t}${s}`}function Mi(s){return typeof s=="string"&&s.startsWith("Symbol(")&&s.endsWith(")")}function Ai(s){return Mi(s)&&(s=s.slice(7,-1)),s}function gs(s){return s=Ai(s),s=Ti(s),typeof Symbol=="function"?Symbol(s):`Symbol(${s})`}const Mn=gs("TIMESTAMP"),ef=gs("META");function nf(s,t){const e=t.toString();if(!Mi(e))return!1;if(s&&typeof s=="object"){if(Ai(e)=="")return t in s;for(const n of Reflect.ownKeys(s))if(n.toString()==e)return!0;return!1}return!1}function Ea(s){if(!Mi(s))return s;switch(s=Ai(s),s){case Ti("TIMESTAMP"):return Mn;case Ti("META"):return ef;default:return gs(s)}}function Ii(s){if(Array.isArray(s))return s.map(Ii);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():Ii(n)}return t}return typeof s=="symbol"?s.toString():s}function ki(s){if(Array.isArray(s))return s.map(ki);if(s&&typeof s=="object"){const t={};for(const e of Object.keys(s))t[Ea(e)]=ki(s[e]);return t}return Ea(s)}function Di(s){return JSON.stringify(Ii(s))}const Li=Di;function Pa(s){return ki(JSON.parse(s))}var Et=(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))(Et||{}),ys=(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))(ys||{}),Ut=(s=>(s.text="text",s.dataURL="dataURL",s.binaryString="binaryString",s.arraybuffer="arraybuffer",s))(Ut||{}),An=(s=>(s.md5="md5",s.sha1="sha1",s.sha256="sha256",s.SHA256="SHA-256",s.sha512="sha512",s.SHA512="SHA-512",s.AESGCM="AES-GCM",s.ECDSA="ECDSA",s))(An||{});const ws=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(ws("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,27 +7,38 @@ var ZYZGroupCoreWeb=function(d){"use strict";const Ou={};function zu(){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},ue=(
|
|
11
|
-
`,e=6,s=1){if(sf(n))return`"${n}"`;if(Ca(n))return""+n;if(nf(n))return"[Fn]";if(s>e)return Ii(n)?"[...]":"{...}";let i="",r="";for(let o=0;o<s;o++)i+=" ",o>0&&(r+=" ");return Ii(n)?`[${n.map(o=>t+i+Ye(o,t,e,s+1)).join(", ")}${t}${r}]`:`{${of(n).map(o=>`${t}${i}${o}: ${Ye(n[o],t,e,s+1)}`).join(", ")}${t}${r}}`}function af(n,t="",e=["","sign","key"]){return wn(n)?Object.keys(n).filter(s=>{for(let i=0,r=e.length;i<r;i++)if(n[s]==e[i])return!1;return!0}).sort().map(s=>`${s}=${n[s]}`).join("&")+t:String(n)}function hf(n=[],t=[]){const e=n.length,s=t.length;for(let r=0;r<s;r++)n[r]=t[r];let i=Math.max(0,e-s);for(;i>0;)n.pop(),i--;return n}function ki(n,t){const e=n.findIndex(s=>s===t);return e>=0&&n.splice(e,1),n}function Ea(n,t){return n.findIndex(e=>e==t)>=0}function cf(n,...t){return t.forEach(e=>{Ea(n,e)||n.push(e)}),n}function lf(n){if(n<=1)return!1;for(let t=2;t<=Math.sqrt(n);t++)if(n%t===0)return!1;return!0}function uf(n){for(;!lf(n);)n++;return n}function jt(n,t){const e=parseFloat(n);if(Number.isNaN(e)){if(typeof t=="number")return t;throw new Error(`"${n}" is NaN!`)}return e}function As(n,t,e=1e-6){return Math.abs(n-t)<e}function N(n,t,e){const s=Math.min(t,e),i=Math.max(t,e);return n<s?s:n>i?i:n}function ff(n,t){return(n%t+t)%t}function xn(n,t,e){return typeof n=="number"&&typeof t=="number"?(1-e)*n+e*t:typeof n=="number"?n:typeof t=="number"?t:0}function df(n,t,e){const s=Math.max(n.length,t.length),i=new Array(s);for(let r=0;r<s;r++)i[r]=xn(n[r],t[r],e);return i}function mf(n,t,e){return s=>{const i=N(s,n,t);return e==0?i:t-i<e?t:Math.round(i/e)*e}}function pf(n,t=12){return jt(n,0).toFixed(t)}function F(n,t=12){return+pf(n,t)}function Di(n,t){const e=wa("number-single",String(n));return{hasNumber:!!e,number:e&&!Array.isArray(e)&&e.fullMatch?parseFloat(e.fullMatch):ef(t)?t:NaN,prefix:e&&!Array.isArray(e)&&e.fullMatch?n.substring(0,e.matchIndex):"",suffix:e&&!Array.isArray(e)&&e.fullMatch?n.substring(e.matchIndex+e.fullMatch.length):""}}function Li(n){const t=wa("number",n);return t?Array.isArray(t)?t.map(e=>Number(e.fullMatch)):[Number(t.fullMatch)]:[]}function ut(){return(performance||Date).now()}function ne(n=new Date){return n.getTime()}function gf(n,t=3){const e=Math.max(n.length,6);let s="";for(let r=0;r<e-4;r++)s+=n[r]||"0";const i=[s,""+(n[e-4]||"0")+(n[e-3]||"0"),""+(n[e-2]||"0")+(n[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 yf(n){const t=Math.max(n.length,6);let e=0;e+=(n[t-2]||0)*10+(n[t-1]||0),e+=((n[t-4]||0)*10+(n[t-3]||0))*60;let s=0;for(let i=0;i<t-4;i++)s=s*10+(n[i]||0);return e+=s*60*60,Math.floor(Math.max(0,e))}function wf(n,t=!1){let e=0;typeof n=="number"?e=n:e=yf(n);const s=[],i=e%60;s.unshift(i%10),s.unshift(Math.floor(i/10)),e=Math.floor(e/60);const r=e%60;if(s.unshift(r%10),s.unshift(Math.floor(r/10)),e=Math.floor(e/60),t){const o=e%100;for(s.unshift(o%10),s.unshift(Math.floor(o/10)),e=Math.floor(e/100);e;)s.unshift(e%10),e=Math.floor(e/10)}else{const o=e%24;s.unshift(o%10),s.unshift(Math.floor(o/10))}return s}function xf(n,t=1,e=!1){return n[n.length-1]+=t,wf(n,e)}function Ma(n,t){const e=typeof t?.aliveInSeconds=="number"?Math.max(t.aliveInSeconds,0):-1,s=typeof t?.aliveUntilTimestamp=="number"?Math.max(t.aliveUntilTimestamp,0):-1;function i(o,a=!1){return Ca(o)||!Fu(o,Ps)?{v:o,[Ps]:ne()}:a?o:{...o,[Ps]:ne()}}let r=i(n,!0);return{get:()=>{let o=!1;return(e>=0&&ne()>r[Ps]+e*1e3||s>=0&&ne()>s)&&(o=!0),o&&(r.v=void 0),r},set:o=>r=i(o)}}const bf=typeof window<"u";!!(vt.Worker&&vt.Blob&&vt.Promise&&vt.OffscreenCanvas&&vt.OffscreenCanvasRenderingContext2D&&vt.HTMLCanvasElement&&vt.HTMLCanvasElement.prototype.transferControlToOffscreen&&vt.URL&&vt.URL.createObjectURL);const vf=(()=>{if(!vt.OffscreenCanvas)return!1;const n=new OffscreenCanvas(1,1),t=n.getContext("2d");if(!t)return!1;t.fillRect(0,0,1,1);const e=n.transferToImageBitmap();try{t.createPattern(e,"no-repeat")}catch{return!1}return!0})();let Aa;try{Aa=Map}catch{Aa=function(){}}let Ia;try{Ia=Set}catch{Ia=function(){}}const hs=(n,t=16)=>{let e=n.toLowerCase();const s=e.indexOf("0b")==0,i=e.indexOf("0o")==0,r=e.indexOf("0x")==0;(s||i||r)&&(e=e.slice(2)),s&&(t=2),i&&(t=8),r&&(t=16);const o=parseInt(e,t);if(isNaN(o))throw new Error(`radixStringToNumber(${n}, ${t}) 无法解析!`);return o};function Ri(n){return new TextEncoder().encode(n)}function ka(n){return String.fromCharCode.apply(null,new Uint16Array(n))}const Oi=(n,t,e)=>t?e===pn.base64?new Blob([n],{type:`${t};${e}`}):e===pn.utf8?new Blob([n],{type:`${t};charset=${e}`}):new Blob([n],{type:`${t}`}):new Blob([n]),Sf=n=>{let t=Tt.UNKNOWN;switch(new DataView(n).getUint32(0,_f()).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 _f(){const n=Uint32Array.of(305419896),t=new Uint8Array(n.buffer);switch(t[0]*16777216+t[1]*65536+t[2]*256+t[3]){case 305419896:return!1;case 2018915346:return!0}}const Is={THROW:1,DROP:2,SLIDE:3,EXPAND:4};class Cf{queue;limit;overflow;constructor(t=10,e=Is.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 Is.EXPAND:this.limit*=2,this.queue.push(t);break;case Is.SLIDE:this.deleteIndex(0),this.queue.push(t);break;case Is.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 Tf=n=>new Cf(n,Is.EXPAND),Da={SLIDE:1,EXPAND:2};class Pf{size;table;objectSignature;overflow;ttl;constructor(t){this.table=new Array(t?.size||137),this.size=this.table.length,this.objectSignature=t?.objectSignature||(e=>String(e)),this.overflow=t?.overflow||Da.EXPAND,this.ttl=t?.ttl||6e4}hash(t){if(t==null||t==null)throw new Error("HashTable can't put undefined or null");const e=this.objectSignature(t),s=31;let i=0;for(let r=0,o=e.length;r<o;r++)i+=s*i+e.charCodeAt(r);return i%this.size}resize(){const t=this.size,e=uf(this.size*2),s=new Array(e),i=this.table;this.table=s,this.size=e;for(let r=0,o=t;r<o;r++)if(i[r]!==void 0&&!this.isOutdated(i[r])){let a=this.hash(i[r].value);for(;s[a]!==void 0;)a=(a+1)%e;s[a]=i[r]}i.length=0}put(t){this.size>200&&Math.random()<.1&&this.clean();let e=this.hash(t);const s=e;for(;this.table[e]!==void 0&&!this.isOutdated(this.table[e]);)if(e=(e+1)%this.size,s==e){if(this.overflow==Da.EXPAND)return this.resize(),this.put(t);break}return this.table[e]={value:t,timestamp:Date.now()},e}traverse(t){for(let e=0,s=this.size;e<s;e++)if(this.table[e]!==void 0&&!t(this.table[e].value,e))return e;return-1}update(t){this.traverse((e,s)=>(t(e)===!1&&this.deleteIndex(s),!0))}getIndex(t){let e=this.hash(t);const s=e;for(;this.table[e]?.value!==t;)if(this.table[e]===void 0||(this.isOutdated(this.table[e])&&(this.table[e]=void 0),e=(e+1)%this.size,s==e))return-1;return this.isOutdated(this.table[e])?(this.table[e]=void 0,-1):e}has(t){return this.getIndex(t)>=0}find(t){const e=this.traverse(s=>!t(s));return e>=0?this.table[e]?.value:void 0}deleteIndex(t){return t>=0&&t<this.size&&this.table[t]!==void 0?(this.table[t]=void 0,!0):!1}delete(t){return this.deleteIndex(this.getIndex(t))}clear(){this.table=[]}isOutdated(t){return Date.now()-t.timestamp>this.ttl}clean(){for(let t=0,e=this.size;t<e;t++)this.table[t]!==void 0&&this.isOutdated(this.table[t])&&(this.table[t]=void 0)}}class ks{maps=new Map;constructor(){}entries(){return[...this.maps.entries()]}keys(){return[...this.maps.keys()]}values(){return[...this.maps.values()]}json(){const t={};for(const e of this.maps)t[e[0]]=e[1];return t}get length(){return this.maps.size}set(t,e){this.maps.set(t,e)}get(t){return this.maps.get(t)}has(t){return this.maps.has(t)}getEntryFromIndex(t){let e=-1;for(const s of this.maps)if(++e==t)return s}getEntry(t){for(const e of this.maps)if(t(e[0],e[1]))return e}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 s=0,i=e.length;s<i;s++){const[r,o]=e[s];t(r,o)===!1&&this.delete(r)}}}function Ef(){vt.OPEN_LOG=!0}function Mf(){vt.OPEN_LOG=!1}function Af(n){vt.LOG_UPLOAD_FN=n}function La(){return!!vt.OPEN_LOG}function Ra(n){vt.LOG_UPLOAD_FN&&vt.LOG_UPLOAD_FN(n)}function ie(n){Ra({level:"info",msg:n}),La()&&(!console||typeof console!="object"||typeof console.log!="function"||console.log(n))}function bn(n){Ra({level:"warn",msg:n}),La()&&(!console||typeof console!="object"||typeof console.warn!="function"||console.warn(n))}const Oa=()=>{};function za(n=0,t){const e=t?.min||300,s=t?.max||6e4,i=t?.exponent||2,r=t?.factor||.5;let o=e*Math.pow(i,n);if(r){const a=Math.random(),h=Math.floor(a*r*o);o=Math.floor(a*10)&1?o+h:o-h}return Math.min(o,s)|0}function zi(n,t=3,e,s){return async function(...i){const r=`retry(${n.name})(${i.map(a=>Ye(a))})`;let o;for(let a=0;a<t;a++)try{return await n.call(s||this,...i)}catch(h){ie(`(${r}) 第 ${a+1} 次尝试失败, retrying...`),o=h,await new Promise(c=>setTimeout(c,typeof e=="number"?e:za(a)))}throw ie(`(${r}) 已 ${t} 次失败,不再重试。 Last error: ${Ye(o)}`),o}}function Bi(n,t=60,e=new ks,s){return async function(...i){const r=`cache(${n.name})(${i.map(c=>Ye(c))})`,o=Date.now();t&&e.update((c,l)=>o-l.timestamp<t*1e3);const a=Ai(i),h=e.get(a);if(h){if(!t||o-h.timestamp<t*1e3)return ie(`${r} 击中缓存`),h.value;e.delete(a)}try{ie(`${r} 没有缓存, 尝试立即执行...`);const c=await n.call(s||this,...i);return ie(`${r} 缓存设置成功`),e.set(a,{value:c,timestamp:Date.now()}),c}catch(c){throw ie(`${r} 执行失败 : ${Ye(c)}`),c}}}var Ni=function(n,t){return Ni=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,s){e.__proto__=s}||function(e,s){for(var i in s)Object.prototype.hasOwnProperty.call(s,i)&&(e[i]=s[i])},Ni(n,t)};function Fi(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");Ni(n,t);function e(){this.constructor=n}n.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}function Ba(n){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&n[t],s=0;if(e)return e.call(n);if(n&&typeof n.length=="number")return{next:function(){return n&&s>=n.length&&(n=void 0),{value:n&&n[s++],done:!n}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function Yi(n,t){var e=typeof Symbol=="function"&&n[Symbol.iterator];if(!e)return n;var s=e.call(n),i,r=[],o;try{for(;(t===void 0||t-- >0)&&!(i=s.next()).done;)r.push(i.value)}catch(a){o={error:a}}finally{try{i&&!i.done&&(e=s.return)&&e.call(s)}finally{if(o)throw o.error}}return r}function Xi(n,t,e){if(e||arguments.length===2)for(var s=0,i=t.length,r;s<i;s++)(r||!(s in t))&&(r||(r=Array.prototype.slice.call(t,0,s)),r[s]=t[s]);return n.concat(r||Array.prototype.slice.call(t))}function fe(n){return typeof n=="function"}function If(n){var t=function(s){Error.call(s),s.stack=new Error().stack},e=n(t);return e.prototype=Object.create(Error.prototype),e.prototype.constructor=e,e}var Ui=If(function(n){return function(t){n(this),this.message=t?t.length+` errors occurred during unsubscription:
|
|
12
|
-
`+t.map(function(e,
|
|
13
|
-
`):"",this.name="UnsubscriptionError",this.errors=t}});function Na(n,t){if(n){var e=n.indexOf(t);0<=e&&n.splice(e,1)}}var $i=function(){function n(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}return n.prototype.unsubscribe=function(){var t,e,s,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),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 l=this.initialTeardown;if(fe(l))try{l()}catch(y){r=y instanceof Ui?y.errors:[y]}var u=this._finalizers;if(u){this._finalizers=null;try{for(var m=Ba(u),f=m.next();!f.done;f=m.next()){var p=f.value;try{Ya(p)}catch(y){r=r??[],y instanceof Ui?r=Xi(Xi([],Yi(r)),Yi(y.errors)):r.push(y)}}}catch(y){s={error:y}}finally{try{f&&!f.done&&(i=m.return)&&i.call(m)}finally{if(s)throw s.error}}}if(r)throw new Ui(r)}},n.prototype.add=function(t){var e;if(t&&t!==this)if(this.closed)Ya(t);else{if(t instanceof n){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=(e=this._finalizers)!==null&&e!==void 0?e:[]).push(t)}},n.prototype._hasParent=function(t){var e=this._parentage;return e===t||Array.isArray(e)&&e.includes(t)},n.prototype._addParent=function(t){var e=this._parentage;this._parentage=Array.isArray(e)?(e.push(t),e):e?[e,t]:t},n.prototype._removeParent=function(t){var e=this._parentage;e===t?this._parentage=null:Array.isArray(e)&&Na(e,t)},n.prototype.remove=function(t){var e=this._finalizers;e&&Na(e,t),t instanceof n&&t._removeParent(this)},n.EMPTY=function(){var t=new n;return t.closed=!0,t}(),n}();$i.EMPTY;function Fa(n){return n instanceof $i||n&&"closed"in n&&fe(n.remove)&&fe(n.add)&&fe(n.unsubscribe)}function Ya(n){fe(n)?n():n.unsubscribe()}var Xa={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},kf={setTimeout:function(n,t){for(var e=[],s=2;s<arguments.length;s++)e[s-2]=arguments[s];return setTimeout.apply(void 0,Xi([n,t],Yi(e)))},clearTimeout:function(n){return clearTimeout(n)},delegate:void 0};function Df(n){kf.setTimeout(function(){throw n})}function Ua(){}function Lf(n){n()}var Vi=function(n){Fi(t,n);function t(e){var s=n.call(this)||this;return s.isStopped=!1,e?(s.destination=e,Fa(e)&&e.add(s)):s.destination=Bf,s}return t.create=function(e,s,i){return new qi(e,s,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,n.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}($i),Rf=Function.prototype.bind;function Gi(n,t){return Rf.call(n,t)}var Of=function(){function n(t){this.partialObserver=t}return n.prototype.next=function(t){var e=this.partialObserver;if(e.next)try{e.next(t)}catch(s){vn(s)}},n.prototype.error=function(t){var e=this.partialObserver;if(e.error)try{e.error(t)}catch(s){vn(s)}else vn(t)},n.prototype.complete=function(){var t=this.partialObserver;if(t.complete)try{t.complete()}catch(e){vn(e)}},n}(),qi=function(n){Fi(t,n);function t(e,s,i){var r=n.call(this)||this,o;if(fe(e)||!e)o={next:e??void 0,error:s??void 0,complete:i??void 0};else{var a;r&&Xa.useDeprecatedNextContext?(a=Object.create(e),a.unsubscribe=function(){return r.unsubscribe()},o={next:e.next&&Gi(e.next,a),error:e.error&&Gi(e.error,a),complete:e.complete&&Gi(e.complete,a)}):o=e}return r.destination=new Of(o),r}return t}(Vi);function vn(n){Df(n)}function zf(n){throw n}var Bf={closed:!0,next:Ua,error:zf,complete:Ua},Nf=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function Ff(n){return n}function Yf(n){return n.length===0?Ff:n.length===1?n[0]:function(t){return n.reduce(function(e,s){return s(e)},t)}}(function(){function n(t){t&&(this._subscribe=t)}return n.prototype.lift=function(t){var e=new n;return e.source=this,e.operator=t,e},n.prototype.subscribe=function(t,e,s){var i=this,r=Uf(t)?t:new qi(t,e,s);return Lf(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},n.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(e){t.error(e)}},n.prototype.forEach=function(t,e){var s=this;return e=$a(e),new e(function(i,r){var o=new qi({next:function(a){try{t(a)}catch(h){r(h),o.unsubscribe()}},error:r,complete:i});s.subscribe(o)})},n.prototype._subscribe=function(t){var e;return(e=this.source)===null||e===void 0?void 0:e.subscribe(t)},n.prototype[Nf]=function(){return this},n.prototype.pipe=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Yf(t)(this)},n.prototype.toPromise=function(t){var e=this;return t=$a(t),new t(function(s,i){var r;e.subscribe(function(o){return r=o},function(o){return i(o)},function(){return s(r)})})},n.create=function(t){return new n(t)},n})();function $a(n){var t;return(t=n??Xa.Promise)!==null&&t!==void 0?t:Promise}function Xf(n){return n&&fe(n.next)&&fe(n.error)&&fe(n.complete)}function Uf(n){return n&&n instanceof Vi||Xf(n)&&Fa(n)}(function(n){Fi(t,n);function t(e,s,i,r,o,a){var h=n.call(this,e)||this;return h.onFinalize=o,h.shouldUnsubscribe=a,h._next=s?function(c){try{s(c)}catch(l){e.error(l)}}:n.prototype._next,h._error=r?function(c){try{r(c)}catch(l){e.error(l)}finally{this.unsubscribe()}}:n.prototype._error,h._complete=i?function(){try{i()}catch(c){e.error(c)}finally{this.unsubscribe()}}:n.prototype._complete,h}return t.prototype.unsubscribe=function(){var e;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var s=this.closed;n.prototype.unsubscribe.call(this),!s&&((e=this.onFinalize)===null||e===void 0||e.call(this))}},t})(Vi);let Ds;function Ht(n){Ds=n,n(),Ds=null}class $f{subscribers=new Set;add(){Ds&&!this.subscribers.has(Ds)&&this.subscribers.add(Ds)}notify(){this.subscribers.forEach(t=>t())}}const Va=new WeakMap;function Sn(n,t){let e=Va.get(n);e||(e=new Map,Va.set(n,e));let s=e.get(t);return s||(s=new $f,e.set(t,s)),s}function Vf(n,t=!1){return Object.keys(n).forEach(e=>{let s=n[e];if(t&&typeof s=="object"&&s!==null)n[e]=Hi(s,t);else{const i=Sn(n,e);Object.defineProperty(n,e,{configurable:!0,enumerable:!0,get(){return i.add(),s},set(r){s!=r&&(s=r,i.notify())}})}}),n}function ji(n,t=!1){return Vf({value:n},t)}function Hi(n,t=!1){const e={get(s,i,r){const o=Reflect.get(s,i,r);if(t&&typeof o=="object"&&o!==null&&!("isYZReactiveProxy"in o)){const a=Hi(o,t);a.YZReactiveProxyParentTarget=s,a.YZReactiveProxyParentKey=i,Reflect.set(r,i,a)}return Sn(s,i).add(),Reflect.get(s,i,r)},set(s,i,r,o){const a=Reflect.get(s,i,o),h=Reflect.set(s,i,r,o);return Array.isArray(s)?Sn(s.YZReactiveProxyParentTarget,s.YZReactiveProxyParentKey).notify():a!=r&&Sn(s,i).notify(),h},has(s,i){return i==="isYZReactiveProxy"||i in s}};return new Proxy(n,e)}const Ga=Hi;class _n{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,s){return this.events[t]||(this.events[t]=[]),this.events[t].unshift(s?e.bind(s):e),this}addListener(t,e,s){return this.events[t]||(this.events[t]=[]),this.events[t].push(s?e.bind(s):e),this}on(t,e,s){return this.addListener(t,e,s),this}removeListener(t,e){return this.events[t]&&(this.events[t]=this.events[t].filter(s=>s!==e)),this}off(t,e){return this.removeListener(t,e),this}removeAllListeners(t){return t?this.events[t]=[]:this.events={},this}emit(t,...e){return this.events[t]&&this.events[t].slice(0).forEach(s=>{s(...e)}),this}once(t,e,s){const i=(...r)=>{s?e.apply(s,r):e(...r),this.off(t,i)};return this.on(t,i),this}}function Gf(){const n={};return n.promise=new Promise((t,e)=>{n.resolve=t,n.reject=e}),n}let qf=0;function qa(n){const t=Gf();let e=!1;return{name:n.name||String(++qf),deadline:typeof n.deadline=="number"?Math.max(n.deadline,0):-1,run:async()=>{if(!e){e=!0;try{let s;const i=n.args||[];n.thisArg?s=await n.fn.call(n.thisArg,...i):s=await n.fn(...i),t.resolve(s)}catch(s){t.reject(s)}}},result:()=>t.promise}}class jf{queue;suspend=!1;semaphore=0;concurrency=1;timeRemaining=-1;timeoutId;constructor(t){this.queue=t?.queue||Tf(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 s=ne();try{this.semaphore++,t.run()}finally{this.semaphore--,e&&(this.decreaseTimeRemaining(ne()-s),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 s=0;s<this.queue.length();){const i=this.queue.index(s);if(!i)break;i.deadline!=-1&&i.deadline<=ne()?(this._exec(i,!1),this.queue.deleteIndex(s)):s++}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 ja extends jf{lastResult;constructor(t){super(t)}_exec(t,e=!0){const s=ne();try{this.semaphore++,t.run()}finally{t.result().then(i=>{this.lastResult=i}).finally(()=>{this.semaphore--,e&&(this.decreaseTimeRemaining(ne()-s),this._flush())})}}}class Hf{schedule;closeLastDialog;constructor(t){this.schedule=new ja(t)}asap(t,e){const s=qa({fn:i=>new Promise(r=>{this.closeLastDialog=t({...i,onClose:()=>{this.closeLastDialog=void 0,i?.onClose?.(),r()}})}),args:[e]});return this.schedule.asap(s),s}immediately(t,e){return this.clear(),this.asap(t,e)}closeLast(){this.closeLastDialog&&this.closeLastDialog()}clear(){this.schedule.clear(),this.closeLast()}}function Ha(n,t={},e){if(typeof t=="function"&&(e=t,t={}),e)return e(Ha)(n,t);let s=t;const i=[],r=c=>(i.push(c),()=>{ki(i,c)}),o=c=>{s=n(s,c),i.forEach(l=>l())},a=()=>s,h=c=>{n=c,o({type:"INIT"})};return o({type:"INIT"}),{getState:a,dispatch:o,subscribe:r,replaceReducer:h}}function Wf(n=window.location.href){try{return new URL(n)}catch{const t="(?<protocol>https?:)",e="(?<host>(?<hostname>[^/#?:]+)(?::(?<port>\\d+))?)",s="(?<pathname>(?:\\/[^/#?]+)*\\/?)",i="(?<search>(?:\\?[^#]*)?)",r="(?<hash>(?:#.*)?)",o=new RegExp(`^${t}//${e}${s}${i}${r}$`).exec(n);return{href:n,protocol:o?.groups?.protocol||"",host:o?.groups?.host||"",hostname:o?.groups?.hostname||"",port:o?.groups?.port||"",pathname:o?.groups?.pathname||"",search:o?.groups?.search||"",hash:o?.groups?.hash||""}}}function Jf(n=window.location.href){const t=Wf(n),e=t.href.indexOf(t.hash);return t.hash&&e>=0?t.href.substring(0,e):t.href}function Zf(n,t){return n+t.replace(/^[&?]/,n.indexOf("?")>=0?"&":"?")}function Qf(n){return"?"+Object.entries(n).map(([t,e])=>`${encodeURIComponent(t)}=${encodeURIComponent(e)}`).join("&")}function Kf(n){return"?"+[...n.entries()].map(t=>encodeURIComponent(t[0])+"="+encodeURIComponent(t[1]instanceof File?t[1].name:t[1])).join("&")}function Wa(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Ja={exports:{}};(function(n,t){(function(e){n.exports=e()})(function(e){var s=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"];function i(w,v){var x=w[0],b=w[1],P=w[2],C=w[3];x+=(b&P|~b&C)+v[0]-680876936|0,x=(x<<7|x>>>25)+b|0,C+=(x&b|~x&P)+v[1]-389564586|0,C=(C<<12|C>>>20)+x|0,P+=(C&x|~C&b)+v[2]+606105819|0,P=(P<<17|P>>>15)+C|0,b+=(P&C|~P&x)+v[3]-1044525330|0,b=(b<<22|b>>>10)+P|0,x+=(b&P|~b&C)+v[4]-176418897|0,x=(x<<7|x>>>25)+b|0,C+=(x&b|~x&P)+v[5]+1200080426|0,C=(C<<12|C>>>20)+x|0,P+=(C&x|~C&b)+v[6]-1473231341|0,P=(P<<17|P>>>15)+C|0,b+=(P&C|~P&x)+v[7]-45705983|0,b=(b<<22|b>>>10)+P|0,x+=(b&P|~b&C)+v[8]+1770035416|0,x=(x<<7|x>>>25)+b|0,C+=(x&b|~x&P)+v[9]-1958414417|0,C=(C<<12|C>>>20)+x|0,P+=(C&x|~C&b)+v[10]-42063|0,P=(P<<17|P>>>15)+C|0,b+=(P&C|~P&x)+v[11]-1990404162|0,b=(b<<22|b>>>10)+P|0,x+=(b&P|~b&C)+v[12]+1804603682|0,x=(x<<7|x>>>25)+b|0,C+=(x&b|~x&P)+v[13]-40341101|0,C=(C<<12|C>>>20)+x|0,P+=(C&x|~C&b)+v[14]-1502002290|0,P=(P<<17|P>>>15)+C|0,b+=(P&C|~P&x)+v[15]+1236535329|0,b=(b<<22|b>>>10)+P|0,x+=(b&C|P&~C)+v[1]-165796510|0,x=(x<<5|x>>>27)+b|0,C+=(x&P|b&~P)+v[6]-1069501632|0,C=(C<<9|C>>>23)+x|0,P+=(C&b|x&~b)+v[11]+643717713|0,P=(P<<14|P>>>18)+C|0,b+=(P&x|C&~x)+v[0]-373897302|0,b=(b<<20|b>>>12)+P|0,x+=(b&C|P&~C)+v[5]-701558691|0,x=(x<<5|x>>>27)+b|0,C+=(x&P|b&~P)+v[10]+38016083|0,C=(C<<9|C>>>23)+x|0,P+=(C&b|x&~b)+v[15]-660478335|0,P=(P<<14|P>>>18)+C|0,b+=(P&x|C&~x)+v[4]-405537848|0,b=(b<<20|b>>>12)+P|0,x+=(b&C|P&~C)+v[9]+568446438|0,x=(x<<5|x>>>27)+b|0,C+=(x&P|b&~P)+v[14]-1019803690|0,C=(C<<9|C>>>23)+x|0,P+=(C&b|x&~b)+v[3]-187363961|0,P=(P<<14|P>>>18)+C|0,b+=(P&x|C&~x)+v[8]+1163531501|0,b=(b<<20|b>>>12)+P|0,x+=(b&C|P&~C)+v[13]-1444681467|0,x=(x<<5|x>>>27)+b|0,C+=(x&P|b&~P)+v[2]-51403784|0,C=(C<<9|C>>>23)+x|0,P+=(C&b|x&~b)+v[7]+1735328473|0,P=(P<<14|P>>>18)+C|0,b+=(P&x|C&~x)+v[12]-1926607734|0,b=(b<<20|b>>>12)+P|0,x+=(b^P^C)+v[5]-378558|0,x=(x<<4|x>>>28)+b|0,C+=(x^b^P)+v[8]-2022574463|0,C=(C<<11|C>>>21)+x|0,P+=(C^x^b)+v[11]+1839030562|0,P=(P<<16|P>>>16)+C|0,b+=(P^C^x)+v[14]-35309556|0,b=(b<<23|b>>>9)+P|0,x+=(b^P^C)+v[1]-1530992060|0,x=(x<<4|x>>>28)+b|0,C+=(x^b^P)+v[4]+1272893353|0,C=(C<<11|C>>>21)+x|0,P+=(C^x^b)+v[7]-155497632|0,P=(P<<16|P>>>16)+C|0,b+=(P^C^x)+v[10]-1094730640|0,b=(b<<23|b>>>9)+P|0,x+=(b^P^C)+v[13]+681279174|0,x=(x<<4|x>>>28)+b|0,C+=(x^b^P)+v[0]-358537222|0,C=(C<<11|C>>>21)+x|0,P+=(C^x^b)+v[3]-722521979|0,P=(P<<16|P>>>16)+C|0,b+=(P^C^x)+v[6]+76029189|0,b=(b<<23|b>>>9)+P|0,x+=(b^P^C)+v[9]-640364487|0,x=(x<<4|x>>>28)+b|0,C+=(x^b^P)+v[12]-421815835|0,C=(C<<11|C>>>21)+x|0,P+=(C^x^b)+v[15]+530742520|0,P=(P<<16|P>>>16)+C|0,b+=(P^C^x)+v[2]-995338651|0,b=(b<<23|b>>>9)+P|0,x+=(P^(b|~C))+v[0]-198630844|0,x=(x<<6|x>>>26)+b|0,C+=(b^(x|~P))+v[7]+1126891415|0,C=(C<<10|C>>>22)+x|0,P+=(x^(C|~b))+v[14]-1416354905|0,P=(P<<15|P>>>17)+C|0,b+=(C^(P|~x))+v[5]-57434055|0,b=(b<<21|b>>>11)+P|0,x+=(P^(b|~C))+v[12]+1700485571|0,x=(x<<6|x>>>26)+b|0,C+=(b^(x|~P))+v[3]-1894986606|0,C=(C<<10|C>>>22)+x|0,P+=(x^(C|~b))+v[10]-1051523|0,P=(P<<15|P>>>17)+C|0,b+=(C^(P|~x))+v[1]-2054922799|0,b=(b<<21|b>>>11)+P|0,x+=(P^(b|~C))+v[8]+1873313359|0,x=(x<<6|x>>>26)+b|0,C+=(b^(x|~P))+v[15]-30611744|0,C=(C<<10|C>>>22)+x|0,P+=(x^(C|~b))+v[6]-1560198380|0,P=(P<<15|P>>>17)+C|0,b+=(C^(P|~x))+v[13]+1309151649|0,b=(b<<21|b>>>11)+P|0,x+=(P^(b|~C))+v[4]-145523070|0,x=(x<<6|x>>>26)+b|0,C+=(b^(x|~P))+v[11]-1120210379|0,C=(C<<10|C>>>22)+x|0,P+=(x^(C|~b))+v[2]+718787259|0,P=(P<<15|P>>>17)+C|0,b+=(C^(P|~x))+v[9]-343485551|0,b=(b<<21|b>>>11)+P|0,w[0]=x+w[0]|0,w[1]=b+w[1]|0,w[2]=P+w[2]|0,w[3]=C+w[3]|0}function r(w){var v=[],x;for(x=0;x<64;x+=4)v[x>>2]=w.charCodeAt(x)+(w.charCodeAt(x+1)<<8)+(w.charCodeAt(x+2)<<16)+(w.charCodeAt(x+3)<<24);return v}function o(w){var v=[],x;for(x=0;x<64;x+=4)v[x>>2]=w[x]+(w[x+1]<<8)+(w[x+2]<<16)+(w[x+3]<<24);return v}function a(w){var v=w.length,x=[1732584193,-271733879,-1732584194,271733878],b,P,C,D,B,Y;for(b=64;b<=v;b+=64)i(x,r(w.substring(b-64,b)));for(w=w.substring(b-64),P=w.length,C=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],b=0;b<P;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 D=v*8,D=D.toString(16).match(/(.*?)(.{0,8})$/),B=parseInt(D[2],16),Y=parseInt(D[1],16)||0,C[14]=B,C[15]=Y,i(x,C),x}function h(w){var v=w.length,x=[1732584193,-271733879,-1732584194,271733878],b,P,C,D,B,Y;for(b=64;b<=v;b+=64)i(x,o(w.subarray(b-64,b)));for(w=b-64<v?w.subarray(b-64):new Uint8Array(0),P=w.length,C=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],b=0;b<P;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 D=v*8,D=D.toString(16).match(/(.*?)(.{0,8})$/),B=parseInt(D[2],16),Y=parseInt(D[1],16)||0,C[14]=B,C[15]=Y,i(x,C),x}function c(w){var v="",x;for(x=0;x<4;x+=1)v+=s[w>>x*8+4&15]+s[w>>x*8&15];return v}function l(w){var v;for(v=0;v<w.length;v+=1)w[v]=c(w[v]);return w.join("")}l(a("hello")),typeof ArrayBuffer<"u"&&!ArrayBuffer.prototype.slice&&function(){function w(v,x){return v=v|0||0,v<0?Math.max(v+x,0):Math.min(v,x)}ArrayBuffer.prototype.slice=function(v,x){var b=this.byteLength,P=w(v,b),C=b,D,B,Y,V;return x!==e&&(C=w(x,b)),P>C?new ArrayBuffer(0):(D=C-P,B=new ArrayBuffer(D),Y=new Uint8Array(B),V=new Uint8Array(this,P,D),Y.set(V),B)}}();function u(w){return/[\u0080-\uFFFF]/.test(w)&&(w=unescape(encodeURIComponent(w))),w}function m(w,v){var x=w.length,b=new ArrayBuffer(x),P=new Uint8Array(b),C;for(C=0;C<x;C+=1)P[C]=w.charCodeAt(C);return v?P:b}function f(w){return String.fromCharCode.apply(null,new Uint8Array(w))}function p(w,v,x){var b=new Uint8Array(w.byteLength+v.byteLength);return b.set(new Uint8Array(w)),b.set(new Uint8Array(v),w.byteLength),x?b:b.buffer}function y(w){var v=[],x=w.length,b;for(b=0;b<x-1;b+=2)v.push(parseInt(w.substr(b,2),16));return String.fromCharCode.apply(String,v)}function S(){this.reset()}return S.prototype.append=function(w){return this.appendBinary(u(w)),this},S.prototype.appendBinary=function(w){this._buff+=w,this._length+=w.length;var v=this._buff.length,x;for(x=64;x<=v;x+=64)i(this._hash,r(this._buff.substring(x-64,x)));return this._buff=this._buff.substring(x-64),this},S.prototype.end=function(w){var v=this._buff,x=v.length,b,P=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],C;for(b=0;b<x;b+=1)P[b>>2]|=v.charCodeAt(b)<<(b%4<<3);return this._finish(P,x),C=l(this._hash),w&&(C=y(C)),this.reset(),C},S.prototype.reset=function(){return this._buff="",this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},S.prototype.getState=function(){return{buff:this._buff,length:this._length,hash:this._hash.slice()}},S.prototype.setState=function(w){return this._buff=w.buff,this._length=w.length,this._hash=w.hash,this},S.prototype.destroy=function(){delete this._hash,delete this._buff,delete this._length},S.prototype._finish=function(w,v){var x=v,b,P,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})$/),P=parseInt(b[2],16),C=parseInt(b[1],16)||0,w[14]=P,w[15]=C,i(this._hash,w)},S.hash=function(w,v){return S.hashBinary(u(w),v)},S.hashBinary=function(w,v){var x=a(w),b=l(x);return v?y(b):b},S.ArrayBuffer=function(){this.reset()},S.ArrayBuffer.prototype.append=function(w){var v=p(this._buff.buffer,w,!0),x=v.length,b;for(this._length+=w.byteLength,b=64;b<=x;b+=64)i(this._hash,o(v.subarray(b-64,b)));return this._buff=b-64<x?new Uint8Array(v.buffer.slice(b-64)):new Uint8Array(0),this},S.ArrayBuffer.prototype.end=function(w){var v=this._buff,x=v.length,b=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],P,C;for(P=0;P<x;P+=1)b[P>>2]|=v[P]<<(P%4<<3);return this._finish(b,x),C=l(this._hash),w&&(C=y(C)),this.reset(),C},S.ArrayBuffer.prototype.reset=function(){return this._buff=new Uint8Array(0),this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},S.ArrayBuffer.prototype.getState=function(){var w=S.prototype.getState.call(this);return w.buff=f(w.buff),w},S.ArrayBuffer.prototype.setState=function(w){return w.buff=m(w.buff,!0),S.prototype.setState.call(this,w)},S.ArrayBuffer.prototype.destroy=S.prototype.destroy,S.ArrayBuffer.prototype._finish=S.prototype._finish,S.ArrayBuffer.hash=function(w,v){var x=h(new Uint8Array(w)),b=l(x);return v?y(b):b},S})})(Ja);var td=Ja.exports;const ed=Wa(td);function Za(n,t){return function(){return n.apply(t,arguments)}}const{toString:sd}=Object.prototype,{getPrototypeOf:Wi}=Object,Cn=(n=>t=>{const e=sd.call(t);return n[e]||(n[e]=e.slice(8,-1).toLowerCase())})(Object.create(null)),Wt=n=>(n=n.toLowerCase(),t=>Cn(t)===n),Tn=n=>t=>typeof t===n,{isArray:cs}=Array,Ls=Tn("undefined");function nd(n){return n!==null&&!Ls(n)&&n.constructor!==null&&!Ls(n.constructor)&&Rt(n.constructor.isBuffer)&&n.constructor.isBuffer(n)}const Qa=Wt("ArrayBuffer");function id(n){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(n):t=n&&n.buffer&&Qa(n.buffer),t}const rd=Tn("string"),Rt=Tn("function"),Ka=Tn("number"),Pn=n=>n!==null&&typeof n=="object",od=n=>n===!0||n===!1,En=n=>{if(Cn(n)!=="object")return!1;const t=Wi(n);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in n)&&!(Symbol.iterator in n)},ad=Wt("Date"),hd=Wt("File"),cd=Wt("Blob"),ld=Wt("FileList"),ud=n=>Pn(n)&&Rt(n.pipe),fd=n=>{let t;return n&&(typeof FormData=="function"&&n instanceof FormData||Rt(n.append)&&((t=Cn(n))==="formdata"||t==="object"&&Rt(n.toString)&&n.toString()==="[object FormData]"))},dd=Wt("URLSearchParams"),[md,pd,gd,yd]=["ReadableStream","Request","Response","Headers"].map(Wt),wd=n=>n.trim?n.trim():n.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Rs(n,t,{allOwnKeys:e=!1}={}){if(n===null||typeof n>"u")return;let s,i;if(typeof n!="object"&&(n=[n]),cs(n))for(s=0,i=n.length;s<i;s++)t.call(null,n[s],s,n);else{const r=e?Object.getOwnPropertyNames(n):Object.keys(n),o=r.length;let a;for(s=0;s<o;s++)a=r[s],t.call(null,n[a],a,n)}}function th(n,t){t=t.toLowerCase();const e=Object.keys(n);let s=e.length,i;for(;s-- >0;)if(i=e[s],t===i.toLowerCase())return i;return null}const Xe=(()=>typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global)(),eh=n=>!Ls(n)&&n!==Xe;function Ji(){const{caseless:n}=eh(this)&&this||{},t={},e=(s,i)=>{const r=n&&th(t,i)||i;En(t[r])&&En(s)?t[r]=Ji(t[r],s):En(s)?t[r]=Ji({},s):cs(s)?t[r]=s.slice():t[r]=s};for(let s=0,i=arguments.length;s<i;s++)arguments[s]&&Rs(arguments[s],e);return t}const xd=(n,t,e,{allOwnKeys:s}={})=>(Rs(t,(i,r)=>{e&&Rt(i)?n[r]=Za(i,e):n[r]=i},{allOwnKeys:s}),n),bd=n=>(n.charCodeAt(0)===65279&&(n=n.slice(1)),n),vd=(n,t,e,s)=>{n.prototype=Object.create(t.prototype,s),n.prototype.constructor=n,Object.defineProperty(n,"super",{value:t.prototype}),e&&Object.assign(n.prototype,e)},Sd=(n,t,e,s)=>{let i,r,o;const a={};if(t=t||{},n==null)return t;do{for(i=Object.getOwnPropertyNames(n),r=i.length;r-- >0;)o=i[r],(!s||s(o,n,t))&&!a[o]&&(t[o]=n[o],a[o]=!0);n=e!==!1&&Wi(n)}while(n&&(!e||e(n,t))&&n!==Object.prototype);return t},_d=(n,t,e)=>{n=String(n),(e===void 0||e>n.length)&&(e=n.length),e-=t.length;const s=n.indexOf(t,e);return s!==-1&&s===e},Cd=n=>{if(!n)return null;if(cs(n))return n;let t=n.length;if(!Ka(t))return null;const e=new Array(t);for(;t-- >0;)e[t]=n[t];return e},Td=(n=>t=>n&&t instanceof n)(typeof Uint8Array<"u"&&Wi(Uint8Array)),Pd=(n,t)=>{const s=(n&&n[Symbol.iterator]).call(n);let i;for(;(i=s.next())&&!i.done;){const r=i.value;t.call(n,r[0],r[1])}},Ed=(n,t)=>{let e;const s=[];for(;(e=n.exec(t))!==null;)s.push(e);return s},Md=Wt("HTMLFormElement"),Ad=n=>n.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,s,i){return s.toUpperCase()+i}),sh=(({hasOwnProperty:n})=>(t,e)=>n.call(t,e))(Object.prototype),Id=Wt("RegExp"),nh=(n,t)=>{const e=Object.getOwnPropertyDescriptors(n),s={};Rs(e,(i,r)=>{let o;(o=t(i,r,n))!==!1&&(s[r]=o||i)}),Object.defineProperties(n,s)},kd=n=>{nh(n,(t,e)=>{if(Rt(n)&&["arguments","caller","callee"].indexOf(e)!==-1)return!1;const s=n[e];if(Rt(s)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+e+"'")})}})},Dd=(n,t)=>{const e={},s=i=>{i.forEach(r=>{e[r]=!0})};return cs(n)?s(n):s(String(n).split(t)),e},Ld=()=>{},Rd=(n,t)=>n!=null&&Number.isFinite(n=+n)?n:t;function Od(n){return!!(n&&Rt(n.append)&&n[Symbol.toStringTag]==="FormData"&&n[Symbol.iterator])}const zd=n=>{const t=new Array(10),e=(s,i)=>{if(Pn(s)){if(t.indexOf(s)>=0)return;if(!("toJSON"in s)){t[i]=s;const r=cs(s)?[]:{};return Rs(s,(o,a)=>{const h=e(o,i+1);!Ls(h)&&(r[a]=h)}),t[i]=void 0,r}}return s};return e(n,0)},Bd=Wt("AsyncFunction"),Nd=n=>n&&(Pn(n)||Rt(n))&&Rt(n.then)&&Rt(n.catch),ih=((n,t)=>n?setImmediate:t?((e,s)=>(Xe.addEventListener("message",({source:i,data:r})=>{i===Xe&&r===e&&s.length&&s.shift()()},!1),i=>{s.push(i),Xe.postMessage(e,"*")}))(`axios@${Math.random()}`,[]):e=>setTimeout(e))(typeof setImmediate=="function",Rt(Xe.postMessage)),Fd=typeof queueMicrotask<"u"?queueMicrotask.bind(Xe):typeof process<"u"&&process.nextTick||ih,A={isArray:cs,isArrayBuffer:Qa,isBuffer:nd,isFormData:fd,isArrayBufferView:id,isString:rd,isNumber:Ka,isBoolean:od,isObject:Pn,isPlainObject:En,isReadableStream:md,isRequest:pd,isResponse:gd,isHeaders:yd,isUndefined:Ls,isDate:ad,isFile:hd,isBlob:cd,isRegExp:Id,isFunction:Rt,isStream:ud,isURLSearchParams:dd,isTypedArray:Td,isFileList:ld,forEach:Rs,merge:Ji,extend:xd,trim:wd,stripBOM:bd,inherits:vd,toFlatObject:Sd,kindOf:Cn,kindOfTest:Wt,endsWith:_d,toArray:Cd,forEachEntry:Pd,matchAll:Ed,isHTMLForm:Md,hasOwnProperty:sh,hasOwnProp:sh,reduceDescriptors:nh,freezeMethods:kd,toObjectSet:Dd,toCamelCase:Ad,noop:Ld,toFiniteNumber:Rd,findKey:th,global:Xe,isContextDefined:eh,isSpecCompliantForm:Od,toJSONObject:zd,isAsyncFn:Bd,isThenable:Nd,setImmediate:ih,asap:Fd};function X(n,t,e,s,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=n,this.name="AxiosError",t&&(this.code=t),e&&(this.config=e),s&&(this.request=s),i&&(this.response=i,this.status=i.status?i.status:null)}A.inherits(X,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 rh=X.prototype,oh={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(n=>{oh[n]={value:n}}),Object.defineProperties(X,oh),Object.defineProperty(rh,"isAxiosError",{value:!0}),X.from=(n,t,e,s,i,r)=>{const o=Object.create(rh);return A.toFlatObject(n,o,function(h){return h!==Error.prototype},a=>a!=="isAxiosError"),X.call(o,n.message,t,e,s,i),o.cause=n,o.name=n.name,r&&Object.assign(o,r),o};const Yd=null;function Zi(n){return A.isPlainObject(n)||A.isArray(n)}function ah(n){return A.endsWith(n,"[]")?n.slice(0,-2):n}function hh(n,t,e){return n?n.concat(t).map(function(i,r){return i=ah(i),!e&&r?"["+i+"]":i}).join(e?".":""):t}function Xd(n){return A.isArray(n)&&!n.some(Zi)}const Ud=A.toFlatObject(A,{},null,function(t){return/^is[A-Z]/.test(t)});function Mn(n,t,e){if(!A.isObject(n))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,S){return!A.isUndefined(S[y])});const s=e.metaTokens,i=e.visitor||l,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 X("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 l(p,y,S){let w=p;if(p&&!S&&typeof p=="object"){if(A.endsWith(y,"{}"))y=s?y:y.slice(0,-2),p=JSON.stringify(p);else if(A.isArray(p)&&Xd(p)||(A.isFileList(p)||A.endsWith(y,"[]"))&&(w=A.toArray(p)))return y=ah(y),w.forEach(function(x,b){!(A.isUndefined(x)||x===null)&&t.append(o===!0?hh([y],b,r):o===null?y:y+"[]",c(x))}),!1}return Zi(p)?!0:(t.append(hh(S,y,r),c(p)),!1)}const u=[],m=Object.assign(Ud,{defaultVisitor:l,convertValue:c,isVisitable:Zi});function f(p,y){if(!A.isUndefined(p)){if(u.indexOf(p)!==-1)throw Error("Circular reference detected in "+y.join("."));u.push(p),A.forEach(p,function(w,v){(!(A.isUndefined(w)||w===null)&&i.call(t,w,A.isString(v)?v.trim():v,y,m))===!0&&f(w,y?y.concat(v):[v])}),u.pop()}}if(!A.isObject(n))throw new TypeError("data must be an object");return f(n),t}function ch(n){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(n).replace(/[!'()~]|%20|%00/g,function(s){return t[s]})}function Qi(n,t){this._pairs=[],n&&Mn(n,this,t)}const lh=Qi.prototype;lh.append=function(t,e){this._pairs.push([t,e])},lh.toString=function(t){const e=t?function(s){return t.call(this,s,ch)}:ch;return this._pairs.map(function(i){return e(i[0])+"="+e(i[1])},"").join("&")};function $d(n){return encodeURIComponent(n).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function uh(n,t,e){if(!t)return n;const s=e&&e.encode||$d;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 Qi(t,e).toString(s),r){const o=n.indexOf("#");o!==-1&&(n=n.slice(0,o)),n+=(n.indexOf("?")===-1?"?":"&")+r}return n}class Vd{constructor(){this.handlers=[]}use(t,e,s){return this.handlers.push({fulfilled:t,rejected:e,synchronous:s?s.synchronous:!1,runWhen:s?s.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){A.forEach(this.handlers,function(s){s!==null&&t(s)})}}const fh=Vd,dh={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Gd={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:Qi,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},Ki=typeof window<"u"&&typeof document<"u",tr=typeof navigator=="object"&&navigator||void 0,qd=Ki&&(!tr||["ReactNative","NativeScript","NS"].indexOf(tr.product)<0),jd=(()=>typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function")(),Hd=Ki&&window.location.href||"http://localhost",St={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Ki,hasStandardBrowserEnv:qd,hasStandardBrowserWebWorkerEnv:jd,navigator:tr,origin:Hd},Symbol.toStringTag,{value:"Module"})),...Gd};function Wd(n,t){return Mn(n,new St.classes.URLSearchParams,Object.assign({visitor:function(e,s,i,r){return St.isNode&&A.isBuffer(e)?(this.append(s,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)}},t))}function Jd(n){return A.matchAll(/\w+|\[(\w*)]/g,n).map(t=>t[0]==="[]"?"":t[1]||t[0])}function Zd(n){const t={},e=Object.keys(n);let s;const i=e.length;let r;for(s=0;s<i;s++)r=e[s],t[r]=n[r];return t}function mh(n){function t(e,s,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],s]:i[o]=s,!a):((!i[o]||!A.isObject(i[o]))&&(i[o]=[]),t(e,s,i[o],r)&&A.isArray(i[o])&&(i[o]=Zd(i[o])),!a)}if(A.isFormData(n)&&A.isFunction(n.entries)){const e={};return A.forEachEntry(n,(s,i)=>{t(Jd(s),i,e,0)}),e}return null}function Qd(n,t,e){if(A.isString(n))try{return(t||JSON.parse)(n),A.trim(n)}catch(s){if(s.name!=="SyntaxError")throw s}return(e||JSON.stringify)(n)}const er={transitional:dh,adapter:["xhr","http","fetch"],transformRequest:[function(t,e){const s=e.getContentType()||"",i=s.indexOf("application/json")>-1,r=A.isObject(t);if(r&&A.isHTMLForm(t)&&(t=new FormData(t)),A.isFormData(t))return i?JSON.stringify(mh(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(s.indexOf("application/x-www-form-urlencoded")>-1)return Wd(t,this.formSerializer).toString();if((a=A.isFileList(t))||s.indexOf("multipart/form-data")>-1){const h=this.env&&this.env.FormData;return Mn(a?{"files[]":t}:t,h&&new h,this.formSerializer)}}return r||i?(e.setContentType("application/json",!1),Qd(t)):t}],transformResponse:[function(t){const e=this.transitional||er.transitional,s=e&&e.forcedJSONParsing,i=this.responseType==="json";if(A.isResponse(t)||A.isReadableStream(t))return t;if(t&&A.isString(t)&&(s&&!this.responseType||i)){const o=!(e&&e.silentJSONParsing)&&i;try{return JSON.parse(t)}catch(a){if(o)throw a.name==="SyntaxError"?X.from(a,X.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:St.classes.FormData,Blob:St.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"],n=>{er.headers[n]={}});const sr=er,Kd=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"]),tm=n=>{const t={};let e,s,i;return n&&n.split(`
|
|
14
|
-
`).forEach(function(
|
|
15
|
-
`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...e){const s=new this(t);return e.forEach(i=>s.set(i)),s}static accessor(t){const s=(this[ph]=this[ph]={accessors:{}}).accessors,i=this.prototype;function r(o){const a=Os(o);s[a]||(im(i,o),s[a]=!0)}return A.isArray(t)?t.forEach(r):r(t),this}}In.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),A.reduceDescriptors(In.prototype,({value:n},t)=>{let e=t[0].toUpperCase()+t.slice(1);return{get:()=>n,set(s){this[e]=s}}}),A.freezeMethods(In);const Jt=In;function ir(n,t){const e=this||sr,s=t||e,i=Jt.from(s.headers);let r=s.data;return A.forEach(n,function(a){r=a.call(e,r,i.normalize(),t?t.status:void 0)}),i.normalize(),r}function gh(n){return!!(n&&n.__CANCEL__)}function ls(n,t,e){X.call(this,n??"canceled",X.ERR_CANCELED,t,e),this.name="CanceledError"}A.inherits(ls,X,{__CANCEL__:!0});function yh(n,t,e){const s=e.config.validateStatus;!e.status||!s||s(e.status)?n(e):t(new X("Request failed with status code "+e.status,[X.ERR_BAD_REQUEST,X.ERR_BAD_RESPONSE][Math.floor(e.status/100)-4],e.config,e.request,e))}function rm(n){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(n);return t&&t[1]||""}function om(n,t){n=n||10;const e=new Array(n),s=new Array(n);let i=0,r=0,o;return t=t!==void 0?t:1e3,function(h){const c=Date.now(),l=s[r];o||(o=c),e[i]=h,s[i]=c;let u=r,m=0;for(;u!==i;)m+=e[u++],u=u%n;if(i=(i+1)%n,i===r&&(r=(r+1)%n),c-o<t)return;const f=l&&c-l;return f?Math.round(m*1e3/f):void 0}}function am(n,t){let e=0,s=1e3/t,i,r;const o=(c,l=Date.now())=>{e=l,i=null,r&&(clearTimeout(r),r=null),n.apply(null,c)};return[(...c)=>{const l=Date.now(),u=l-e;u>=s?o(c,l):(i=c,r||(r=setTimeout(()=>{r=null,o(i)},s-u)))},()=>i&&o(i)]}const kn=(n,t,e=3)=>{let s=0;const i=om(50,250);return am(r=>{const o=r.loaded,a=r.lengthComputable?r.total:void 0,h=o-s,c=i(h),l=o<=a;s=o;const u={loaded:o,total:a,progress:a?o/a:void 0,bytes:h,rate:c||void 0,estimated:c&&a&&l?(a-o)/c:void 0,event:r,lengthComputable:a!=null,[t?"download":"upload"]:!0};n(u)},e)},wh=(n,t)=>{const e=n!=null;return[s=>t[0]({lengthComputable:e,total:n,loaded:s}),t[1]]},xh=n=>(...t)=>A.asap(()=>n(...t)),hm=St.hasStandardBrowserEnv?((n,t)=>e=>(e=new URL(e,St.origin),n.protocol===e.protocol&&n.host===e.host&&(t||n.port===e.port)))(new URL(St.origin),St.navigator&&/(msie|trident)/i.test(St.navigator.userAgent)):()=>!0,cm=St.hasStandardBrowserEnv?{write(n,t,e,s,i,r){const o=[n+"="+encodeURIComponent(t)];A.isNumber(e)&&o.push("expires="+new Date(e).toGMTString()),A.isString(s)&&o.push("path="+s),A.isString(i)&&o.push("domain="+i),r===!0&&o.push("secure"),document.cookie=o.join("; ")},read(n){const t=document.cookie.match(new RegExp("(^|;\\s*)("+n+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(n){this.write(n,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function lm(n){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(n)}function um(n,t){return t?n.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):n}function bh(n,t,e){let s=!lm(t);return n&&(s||e==!1)?um(n,t):t}const vh=n=>n instanceof Jt?{...n}:n;function Ue(n,t){t=t||{};const e={};function s(c,l,u,m){return A.isPlainObject(c)&&A.isPlainObject(l)?A.merge.call({caseless:m},c,l):A.isPlainObject(l)?A.merge({},l):A.isArray(l)?l.slice():l}function i(c,l,u,m){if(A.isUndefined(l)){if(!A.isUndefined(c))return s(void 0,c,u,m)}else return s(c,l,u,m)}function r(c,l){if(!A.isUndefined(l))return s(void 0,l)}function o(c,l){if(A.isUndefined(l)){if(!A.isUndefined(c))return s(void 0,c)}else return s(void 0,l)}function a(c,l,u){if(u in t)return s(c,l);if(u in n)return s(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,l,u)=>i(vh(c),vh(l),u,!0)};return A.forEach(Object.keys(Object.assign({},n,t)),function(l){const u=h[l]||i,m=u(n[l],t[l],l);A.isUndefined(m)&&u!==a||(e[l]=m)}),e}const Sh=n=>{const t=Ue({},n);let{data:e,withXSRFToken:s,xsrfHeaderName:i,xsrfCookieName:r,headers:o,auth:a}=t;t.headers=o=Jt.from(o),t.url=uh(bh(t.baseURL,t.url,t.allowAbsoluteUrls),n.params,n.paramsSerializer),a&&o.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):"")));let h;if(A.isFormData(e)){if(St.hasStandardBrowserEnv||St.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if((h=o.getContentType())!==!1){const[c,...l]=h?h.split(";").map(u=>u.trim()).filter(Boolean):[];o.setContentType([c||"multipart/form-data",...l].join("; "))}}if(St.hasStandardBrowserEnv&&(s&&A.isFunction(s)&&(s=s(t)),s||s!==!1&&hm(t.url))){const c=i&&r&&cm.read(r);c&&o.set(i,c)}return t},fm=typeof XMLHttpRequest<"u"&&function(n){return new Promise(function(e,s){const i=Sh(n);let r=i.data;const o=Jt.from(i.headers).normalize();let{responseType:a,onUploadProgress:h,onDownloadProgress:c}=i,l,u,m,f,p;function y(){f&&f(),p&&p(),i.cancelToken&&i.cancelToken.unsubscribe(l),i.signal&&i.signal.removeEventListener("abort",l)}let S=new XMLHttpRequest;S.open(i.method.toUpperCase(),i.url,!0),S.timeout=i.timeout;function w(){if(!S)return;const x=Jt.from("getAllResponseHeaders"in S&&S.getAllResponseHeaders()),P={data:!a||a==="text"||a==="json"?S.responseText:S.response,status:S.status,statusText:S.statusText,headers:x,config:n,request:S};yh(function(D){e(D),y()},function(D){s(D),y()},P),S=null}"onloadend"in S?S.onloadend=w:S.onreadystatechange=function(){!S||S.readyState!==4||S.status===0&&!(S.responseURL&&S.responseURL.indexOf("file:")===0)||setTimeout(w)},S.onabort=function(){S&&(s(new X("Request aborted",X.ECONNABORTED,n,S)),S=null)},S.onerror=function(){s(new X("Network Error",X.ERR_NETWORK,n,S)),S=null},S.ontimeout=function(){let b=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded";const P=i.transitional||dh;i.timeoutErrorMessage&&(b=i.timeoutErrorMessage),s(new X(b,P.clarifyTimeoutError?X.ETIMEDOUT:X.ECONNABORTED,n,S)),S=null},r===void 0&&o.setContentType(null),"setRequestHeader"in S&&A.forEach(o.toJSON(),function(b,P){S.setRequestHeader(P,b)}),A.isUndefined(i.withCredentials)||(S.withCredentials=!!i.withCredentials),a&&a!=="json"&&(S.responseType=i.responseType),c&&([m,p]=kn(c,!0),S.addEventListener("progress",m)),h&&S.upload&&([u,f]=kn(h),S.upload.addEventListener("progress",u),S.upload.addEventListener("loadend",f)),(i.cancelToken||i.signal)&&(l=x=>{S&&(s(!x||x.type?new ls(null,n,S):x),S.abort(),S=null)},i.cancelToken&&i.cancelToken.subscribe(l),i.signal&&(i.signal.aborted?l():i.signal.addEventListener("abort",l)));const v=rm(i.url);if(v&&St.protocols.indexOf(v)===-1){s(new X("Unsupported protocol "+v+":",X.ERR_BAD_REQUEST,n));return}S.send(r||null)})},dm=(n,t)=>{const{length:e}=n=n?n.filter(Boolean):[];if(t||e){let s=new AbortController,i;const r=function(c){if(!i){i=!0,a();const l=c instanceof Error?c:this.reason;s.abort(l instanceof X?l:new ls(l instanceof Error?l.message:l))}};let o=t&&setTimeout(()=>{o=null,r(new X(`timeout ${t} of ms exceeded`,X.ETIMEDOUT))},t);const a=()=>{n&&(o&&clearTimeout(o),o=null,n.forEach(c=>{c.unsubscribe?c.unsubscribe(r):c.removeEventListener("abort",r)}),n=null)};n.forEach(c=>c.addEventListener("abort",r));const{signal:h}=s;return h.unsubscribe=()=>A.asap(a),h}},mm=function*(n,t){let e=n.byteLength;if(!t||e<t){yield n;return}let s=0,i;for(;s<e;)i=s+t,yield n.slice(s,i),s=i},pm=async function*(n,t){for await(const e of gm(n))yield*mm(e,t)},gm=async function*(n){if(n[Symbol.asyncIterator]){yield*n;return}const t=n.getReader();try{for(;;){const{done:e,value:s}=await t.read();if(e)break;yield s}}finally{await t.cancel()}},_h=(n,t,e,s)=>{const i=pm(n,t);let r=0,o,a=h=>{o||(o=!0,s&&s(h))};return new ReadableStream({async pull(h){try{const{done:c,value:l}=await i.next();if(c){a(),h.close();return}let u=l.byteLength;if(e){let m=r+=u;e(m)}h.enqueue(new Uint8Array(l))}catch(c){throw a(c),c}},cancel(h){return a(h),i.return()}},{highWaterMark:2})},Dn=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",Ch=Dn&&typeof ReadableStream=="function",ym=Dn&&(typeof TextEncoder=="function"?(n=>t=>n.encode(t))(new TextEncoder):async n=>new Uint8Array(await new Response(n).arrayBuffer())),Th=(n,...t)=>{try{return!!n(...t)}catch{return!1}},wm=Ch&&Th(()=>{let n=!1;const t=new Request(St.origin,{body:new ReadableStream,method:"POST",get duplex(){return n=!0,"half"}}).headers.has("Content-Type");return n&&!t}),Ph=64*1024,rr=Ch&&Th(()=>A.isReadableStream(new Response("").body)),Ln={stream:rr&&(n=>n.body)};Dn&&(n=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!Ln[t]&&(Ln[t]=A.isFunction(n[t])?e=>e[t]():(e,s)=>{throw new X(`Response type '${t}' is not supported`,X.ERR_NOT_SUPPORT,s)})})})(new Response);const xm=async n=>{if(n==null)return 0;if(A.isBlob(n))return n.size;if(A.isSpecCompliantForm(n))return(await new Request(St.origin,{method:"POST",body:n}).arrayBuffer()).byteLength;if(A.isArrayBufferView(n)||A.isArrayBuffer(n))return n.byteLength;if(A.isURLSearchParams(n)&&(n=n+""),A.isString(n))return(await ym(n)).byteLength},bm=async(n,t)=>{const e=A.toFiniteNumber(n.getContentLength());return e??xm(t)},or={http:Yd,xhr:fm,fetch:Dn&&(async n=>{let{url:t,method:e,data:s,signal:i,cancelToken:r,timeout:o,onDownloadProgress:a,onUploadProgress:h,responseType:c,headers:l,withCredentials:u="same-origin",fetchOptions:m}=Sh(n);c=c?(c+"").toLowerCase():"text";let f=dm([i,r&&r.toAbortSignal()],o),p;const y=f&&f.unsubscribe&&(()=>{f.unsubscribe()});let S;try{if(h&&wm&&e!=="get"&&e!=="head"&&(S=await bm(l,s))!==0){let P=new Request(t,{method:"POST",body:s,duplex:"half"}),C;if(A.isFormData(s)&&(C=P.headers.get("content-type"))&&l.setContentType(C),P.body){const[D,B]=wh(S,kn(xh(h)));s=_h(P.body,Ph,D,B)}}A.isString(u)||(u=u?"include":"omit");const w="credentials"in Request.prototype;p=new Request(t,{...m,signal:f,method:e.toUpperCase(),headers:l.normalize().toJSON(),body:s,duplex:"half",credentials:w?u:void 0});let v=await fetch(p);const x=rr&&(c==="stream"||c==="response");if(rr&&(a||x&&y)){const P={};["status","statusText","headers"].forEach(Y=>{P[Y]=v[Y]});const C=A.toFiniteNumber(v.headers.get("content-length")),[D,B]=a&&wh(C,kn(xh(a),!0))||[];v=new Response(_h(v.body,Ph,D,()=>{B&&B(),y&&y()}),P)}c=c||"text";let b=await Ln[A.findKey(Ln,c)||"text"](v,n);return!x&&y&&y(),await new Promise((P,C)=>{yh(P,C,{data:b,headers:Jt.from(v.headers),status:v.status,statusText:v.statusText,config:n,request:p})})}catch(w){throw y&&y(),w&&w.name==="TypeError"&&/fetch/i.test(w.message)?Object.assign(new X("Network Error",X.ERR_NETWORK,n,p),{cause:w.cause||w}):X.from(w,w&&w.code,n,p)}})};A.forEach(or,(n,t)=>{if(n){try{Object.defineProperty(n,"name",{value:t})}catch{}Object.defineProperty(n,"adapterName",{value:t})}});const Eh=n=>`- ${n}`,vm=n=>A.isFunction(n)||n===null||n===!1,Mh={getAdapter:n=>{n=A.isArray(n)?n:[n];const{length:t}=n;let e,s;const i={};for(let r=0;r<t;r++){e=n[r];let o;if(s=e,!vm(e)&&(s=or[(o=String(e)).toLowerCase()],s===void 0))throw new X(`Unknown adapter '${o}'`);if(s)break;i[o||"#"+r]=s}if(!s){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 :
|
|
16
|
-
`+r.map(
|
|
17
|
-
`):" "+
|
|
18
|
-
`+r):s.stack=r}catch{}}throw s}}_request(t,e){typeof t=="string"?(e=e||{},e.url=t):e=t||{},e=Ue(this.defaults,e);const{transitional:s,paramsSerializer:i,headers:r}=e;s!==void 0&&On.assertOptions(s,{silentJSONParsing:re.transitional(re.boolean),forcedJSONParsing:re.transitional(re.boolean),clarifyTimeoutError:re.transitional(re.boolean)},!1),i!=null&&(A.isFunction(i)?e.paramsSerializer={serialize:i}:On.assertOptions(i,{encode:re.function,serialize:re.function},!0)),e.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?e.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:e.allowAbsoluteUrls=!0),On.assertOptions(e,{baseUrl:re.spelling("baseURL"),withXsrfToken:re.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=Jt.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 l,u=0,m;if(!h){const p=[Ah.bind(this),void 0];for(p.unshift.apply(p,a),p.push.apply(p,c),m=p.length,l=Promise.resolve(e);u<m;)l=l.then(p[u++],p[u++]);return l}m=a.length;let f=e;for(u=0;u<m;){const p=a[u++],y=a[u++];try{f=p(f)}catch(S){y.call(this,S);break}}try{l=Ah.call(this,f)}catch(p){return Promise.reject(p)}for(u=0,m=c.length;u<m;)l=l.then(c[u++],c[u++]);return l}getUri(t){t=Ue(this.defaults,t);const e=bh(t.baseURL,t.url,t.allowAbsoluteUrls);return uh(e,t.params,t.paramsSerializer)}}A.forEach(["delete","get","head","options"],function(t){zn.prototype[t]=function(e,s){return this.request(Ue(s||{},{method:t,url:e,data:(s||{}).data}))}}),A.forEach(["post","put","patch"],function(t){function e(s){return function(r,o,a){return this.request(Ue(a||{},{method:t,headers:s?{"Content-Type":"multipart/form-data"}:{},url:r,data:o}))}}zn.prototype[t]=e(),zn.prototype[t+"Form"]=e(!0)});const Bn=zn;class hr{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let e;this.promise=new Promise(function(r){e=r});const s=this;this.promise.then(i=>{if(!s._listeners)return;let r=s._listeners.length;for(;r-- >0;)s._listeners[r](i);s._listeners=null}),this.promise.then=i=>{let r;const o=new Promise(a=>{s.subscribe(a),r=a}).then(i);return o.cancel=function(){s.unsubscribe(r)},o},t(function(r,o,a){s.reason||(s.reason=new ls(r,o,a),e(s.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const e=this._listeners.indexOf(t);e!==-1&&this._listeners.splice(e,1)}toAbortSignal(){const t=new AbortController,e=s=>{t.abort(s)};return this.subscribe(e),t.signal.unsubscribe=()=>this.unsubscribe(e),t.signal}static source(){let t;return{token:new hr(function(i){t=i}),cancel:t}}}const _m=hr;function Cm(n){return function(e){return n.apply(null,e)}}function Tm(n){return A.isObject(n)&&n.isAxiosError===!0}const cr={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(cr).forEach(([n,t])=>{cr[t]=n});const Pm=cr;function Dh(n){const t=new Bn(n),e=Za(Bn.prototype.request,t);return A.extend(e,Bn.prototype,t,{allOwnKeys:!0}),A.extend(e,t,null,{allOwnKeys:!0}),e.create=function(i){return Dh(Ue(n,i))},e}const ht=Dh(sr);ht.Axios=Bn,ht.CanceledError=ls,ht.CancelToken=_m,ht.isCancel=gh,ht.VERSION=Ih,ht.toFormData=Mn,ht.AxiosError=X,ht.Cancel=ht.CanceledError,ht.all=function(t){return Promise.all(t)},ht.spread=Cm,ht.isAxiosError=Tm,ht.mergeConfig=Ue,ht.AxiosHeaders=Jt,ht.formToJSON=n=>mh(A.isHTMLForm(n)?new FormData(n):n),ht.getAdapter=Mh.getAdapter,ht.HttpStatusCode=Pm,ht.default=ht;const Em=ht;class lr{instance;canceler;retryCount=0;cacheTime=0;caches=new ks;constructor(t){this.instance=Em.create(t),this.canceler=new Mm,this.retryCount=t?.retry||0,this.cacheTime=t?.cache||0,this.instance.interceptors.request.use(e=>(t?.interceptor?.start?.(),this.canceler.pendingRequest(e),t?.interceptor?.request?.(e),e),e=>(t?.interceptor?.end?.(),this.canceler.cancelRequest(e.config),t?.interceptor?.requestError?.(e),e)),this.instance.interceptors.response.use(e=>(t?.interceptor?.end?.(),this.canceler.confirmRequest(e.config),t?.interceptor?.response?.(e),e.status==200?Promise.resolve(e):Promise.reject(e)),e=>(t?.interceptor?.end?.(),this.canceler.cancelRequest(e.config),t?.interceptor?.responseError?.(e),Promise.reject(e.response)))}request(t){let e=this.instance.request;const s=t.retry||this.retryCount;s&&(e=zi(e,s));const i=t.cache||this.cacheTime;return i&&(e=Bi(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,s){return this.request({...s,method:"post",url:t,data:e})}postBlob(t,e,s){return s={...s,headers:{...s?.headers,"Content-Type":"multipart/form-data"}},this.request({...s,method:"post",url:t,data:e})}postForm(t,e,s){return this.instance.postForm(t,e,{...s})}put(t,e,s){return this.request({...s,method:"put",url:t,data:e})}patch(t,e,s){return this.request({...s,method:"patch",url:t,data:e})}getUri(t){return this.instance.getUri(t)}}class Mm{pendingRequestMap;constructor(){this.pendingRequestMap=new Map}getRequestId(t){const{method:e,url:s,params:i,data:r}=t;return Ai({method:e,url:s,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 s=new AbortController;t.signal=s.signal,this.pendingRequestMap.set(e,s)}}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 ur=n=>new XMLSerializer().serializeToString(n),Am=(n,t="text/html")=>new DOMParser().parseFromString(n,t),fr=(n,t=Tt.SVG,e=pn.utf8)=>Oi(ur(n),t,e);async function dr(n=["*"],t){let e=[];const s=document.createElement("input");return s.setAttribute("type","file"),s.setAttribute("visibility","hidden"),s.setAttribute("accept",n.join(",")),t&&s.setAttribute("multiple","true"),s.addEventListener("click",i=>{s.value=""},!1),new Promise((i,r)=>{s.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}),s.click()}).then(i=>(s.remove(),i)).catch(i=>{throw s.remove(),i})}function zs(n,t=Ut.text,e){return new Promise((s,i)=>{const r=new FileReader;switch(r.addEventListener("progress",o=>{e?.(o.loaded,o.total)}),r.addEventListener("load",o=>{s(o.target?.result)}),r.addEventListener("error",o=>{i(o)}),t){case Ut.dataURL:r.readAsDataURL(n);break;case Ut.binaryString:r.readAsBinaryString(n);break;case Ut.arraybuffer:r.readAsArrayBuffer(n);break;case Ut.text:default:r.readAsText(n)}})}async function Im(n){const t=await zs(n,Ut.arraybuffer);return Sf(t)}const km=n=>{let t;return n instanceof File?t=n.name:t=n,t.match(/\.([0-9a-z]+)(?:[\\?#]|$)/i)?.[1]||""};function Dm(n){switch(n.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 Lh(n,t,e,s,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<s.size)Lh(n,t,e,s,i,o,Math.min(o+i,s.size));else return n(e.end())}),a.addEventListener("error",h=>t(h)),a.readAsArrayBuffer(s.slice(r,o))}async function Rh(n,t=1048576){return await new Promise((e,s)=>Lh(e,s,new ed.ArrayBuffer,n,t,0,Math.min(t,n.size)))}class Lm{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 lr({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 Rh(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(()=>{xf(this.time,1),this.onTime?.(gf(this.time))},1e3)}stopTimeCount(){this.timer&&(clearInterval(this.timer),this.timer=void 0)}}var Oh={exports:{}};/*! Hammer.JS - v2.0.7 - 2016-04-22
|
|
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},ue=(s,t)=>(typeof s=="string"&&(s=ws(s)||new RegExp(s)),s.test(t)),Ta=(s,t)=>{typeof s=="string"&&(s=ws(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},Ma=(s,t)=>{typeof s=="string"&&(s=ws(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 sf(s){const t=s.match(/[\s\S]/gu);return t?t.length:0}function Aa(s,t){const e=s.codePointAt(t);return e?String.fromCodePoint(e):void 0}function In(s=12,t="all"){let e="ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghijklmnopqrstuvwxyz0123456789";t=="number"&&(e="0123456789");const n=e.length;let i="";for(let r=0;r<s;r++)i+=e[Math.floor(Math.random()*n)];return i}function rf(s){return s.replace(/(^\w)/g,t=>t.toLowerCase())}const dt=(s,t="-")=>{let e=s.replace(new RegExp("[_-]?([A-Z])","g"),t+"$1").toLowerCase();const n=new RegExp(`^${t}`);return n.test(s)||(e=e.replace(n,"")),e};function of(s){return s.replace(/(^\w|[_-]\w)/g,t=>t.slice(-1).toUpperCase())}function Ia(s){return rf(of(s))}function ka(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 af(s){return s.slice(0)}function hf(s,t=!0){const e=t?af(s.buffer):s.buffer;return new s.constructor(e,s.byteOffset,s.length)}const cf="[object Undefined]",lf="[object Null]",uf="[object Boolean]",ff="[object Number]",df="[object BigInt]",Da="[object String]",mf="[object Symbol]",pf="[object Function]",gf="[object Array]",yf="[object GeneratorFunction]";function bs(s){return Object.prototype.toString.call(s)}function wf(s){return s!=null}function bf(s){return bs(s)===Da}function La(s){const t=bs(s);return t===cf||t===lf||t===uf||t===ff||t===Da||t===mf||t===df}function xf(s){const t=bs(s);return t==pf||t==yf}function xs(s){return bs(s)===gf}function vs(s){return!!s&&typeof s=="object"}function kn(s){return vs(s)&&!xs(s)}const Ra=s=>{for(const t in s)if(Object.prototype.hasOwnProperty.call(s,t))return!1;return!0};function Oa(s){const t=[];for(const e in s)Object.prototype.hasOwnProperty.call(s,e)&&t.push(e);return t}function cn(s,t,e=!0){if(kn(s)&&kn(t))for(const n of Oa(t))(e||typeof s[n]>"u")&&(kn(s[n])&&kn(t[n])?cn(s[n],t[n],e):s[n]=t[n]);return s}function za(s,...t){return new s.constructor(...t)}function Xe(s,t=`\r
|
|
11
|
+
`,e=6,n=1){if(bf(s))return`"${s}"`;if(La(s))return""+s;if(xf(s))return"[Fn]";if(n>e)return xs(s)?"[...]":"{...}";let i="",r="";for(let o=0;o<n;o++)i+=" ",o>0&&(r+=" ");return xs(s)?`[${s.map(o=>t+i+Xe(o,t,e,n+1)).join(", ")}${t}${r}]`:`{${Oa(s).map(o=>`${t}${i}${o}: ${Xe(s[o],t,e,n+1)}`).join(", ")}${t}${r}}`}function vf(s,t="",e=["","sign","key"]){return kn(s)?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:String(s)}function Na(s,t,e=""){let n=[];return s===t?n:typeof s!="object"||typeof t!="object"||!s||!t?(n.push({path:e,newValue:t,oldValue:s}),n):(new Set([...Object.keys(s),...Object.keys(t)]).forEach(i=>{const r=e?`${e}.${i}`:i;n=n.concat(Na(s[i],t[i],r))}),n)}function Sf(s){return Number.isNaN(s)}function _f(s){if(s<=1)return!1;for(let t=2;t<=Math.sqrt(s);t++)if(s%t===0)return!1;return!0}function Cf(s){for(;!_f(s);)s++;return s}function Wt(s,t){const e=parseFloat(s);return Number.isNaN(e)?typeof t=="number"?t:NaN:e}function Ri(s=1e-6){return function(t,e){return Math.abs(t-e)<s}}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 Ef(s,t){return(s%t+t)%t}function Ss(s,t,e){return typeof s=="number"&&typeof t=="number"?(1-e)*s+e*t:typeof s=="number"?s:typeof t=="number"?t:0}function Pf(s,t,e){const n=Math.max(s.length,t.length),i=new Array(n);for(let r=0;r<n;r++)i[r]=Ss(s[r],t[r],e);return i}function Tf(s,t,e){return n=>{const i=B(n,s,t);return e==0?i:t-i<e?t:Math.round(i/e)*e}}function Mf(s,t=12){return Wt(s,0).toFixed(t)}function F(s,t=12){return+Mf(s,t)}function Oi(s,t){const e=Ta("number-single",String(s));return{hasNumber:!!e,number:e&&!Array.isArray(e)&&e.fullMatch?parseFloat(e.fullMatch):wf(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 zi(s){const t=Ta("number",s);return t?Array.isArray(t)?t.map(e=>Number(e.fullMatch)):[Number(t.fullMatch)]:[]}function Af(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 Ba(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 If(s,...t){return t.forEach(e=>{Fa(s,e)||s.push(e)}),s}function lt(){return(performance||Date).now()}function $t(s=new Date){return s.getTime()}function kf(s=new Date,t="yyyy-mm-dd hh:ii:ss.SSS"){return Nf(s,t)}function Df(s){return!Sf(s.valueOf())}function Lf(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 zf(s,t=1,e=!1){return s[s.length-1]+=t,Of(s,e)}function Nf(s,t="yyyy-mm-dd hh:ii:ss"){if(!Df(s))return"";const e=/(y+)/.exec(t);if(e&&e[1]){const i=e[1];t=t.replace(i,(s.getFullYear()+"").substring(4-i.length))}const n={"m+":s.getMonth()+1,"d+":s.getDate(),"h+":s.getHours(),"i+":s.getMinutes(),"s+":s.getSeconds(),"q+":Math.floor((s.getMonth()+3)/3),"S+":s.getMilliseconds()};for(const i in n){const r=new RegExp("("+i+")").exec(t);if(r&&r[1]){const o=r[1];t=t.replace(o,o.length===1?""+n[i]:("00"+n[i]).slice(-o.length))}}return t}function _s(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 La(o)||xs(o)?{v:o,[Mn]:$t()}:a&&nf(o,Mn)?o:{...o,[Mn]:$t()}}let r=i(s,!0);return{get:()=>{let o=!1;return(e>=0&&$t()>r[Mn]+e*1e3||n>=0&&$t()>n)&&(o=!0),o&&(r.v=void 0),r},set:o=>r=i(o)}}const Bf=typeof window<"u";!!(St.Worker&&St.Blob&&St.Promise&&St.OffscreenCanvas&&St.OffscreenCanvasRenderingContext2D&&St.HTMLCanvasElement&&St.HTMLCanvasElement.prototype.transferControlToOffscreen&&St.URL&&St.URL.createObjectURL);const Ff=(()=>{if(!St.OffscreenCanvas)return!1;const s=new OffscreenCanvas(1,1),t=s.getContext("2d");if(!t)return!1;t.fillRect(0,0,1,1);const e=s.transferToImageBitmap();try{t.createPattern(e,"no-repeat")}catch{return!1}return!0})();let Ya;try{Ya=Map}catch{Ya=function(){}}let Xa;try{Xa=Set}catch{Xa=function(){}}const ln=(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 Ni(s){return new TextEncoder().encode(s)}function Ua(s){return String.fromCharCode.apply(null,new Uint16Array(s))}function Bi(s,t){const e=t?.mime,n=t?.encode,i=t?.type;return i?new Blob([s],{type:i}):e?n===ys.base64?new Blob([s],{type:`${e};${n}`}):n===ys.utf8?new Blob([s],{type:`${e};charset=${n}`}):new Blob([s],{type:`${e}`}):new Blob([s])}const Yf=s=>{let t=Et.UNKNOWN;switch(new DataView(s).getUint32(0,Xf()).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 Xf(){const s=Uint32Array.of(305419896),t=new Uint8Array(s.buffer);switch(t[0]*16777216+t[1]*65536+t[2]*256+t[3]){case 305419896:return!1;case 2018915346:return!0}}const Dn={THROW:1,DROP:2,SLIDE:3,EXPAND:4};class Uf{queue;limit;overflow;constructor(t=10,e=Dn.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 Dn.EXPAND:this.limit*=2,this.queue.push(t);break;case Dn.SLIDE:this.deleteIndex(0),this.queue.push(t);break;case Dn.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 $f=s=>new Uf(s,Dn.EXPAND),$a={SLIDE:1,EXPAND:2};class Gf{size;table;objectSignature;overflow;ttl;constructor(t){this.table=new Array(t?.size||137),this.size=this.table.length,this.objectSignature=t?.objectSignature||(e=>String(e)),this.overflow=t?.overflow||$a.EXPAND,this.ttl=t?.ttl||6e4}hash(t){if(t==null||t==null)throw new Error("HashTable can't put undefined or null");const e=this.objectSignature(t),n=31;let i=0;for(let r=0,o=e.length;r<o;r++)i+=n*i+e.charCodeAt(r);return i%this.size}resize(){const t=this.size,e=Cf(this.size*2),n=new Array(e),i=this.table;this.table=n,this.size=e;for(let r=0,o=t;r<o;r++)if(i[r]!==void 0&&!this.isOutdated(i[r])){let a=this.hash(i[r].value);for(;n[a]!==void 0;)a=(a+1)%e;n[a]=i[r]}i.length=0}put(t){this.size>200&&Math.random()<.1&&this.clean();let e=this.hash(t);const n=e;for(;this.table[e]!==void 0&&!this.isOutdated(this.table[e]);)if(e=(e+1)%this.size,n==e){if(this.overflow==$a.EXPAND)return this.resize(),this.put(t);break}return this.table[e]={value:t,timestamp:Date.now()},e}traverse(t){for(let e=0,n=this.size;e<n;e++)if(this.table[e]!==void 0&&!t(this.table[e].value,e))return e;return-1}update(t){this.traverse((e,n)=>(t(e)===!1&&this.deleteIndex(n),!0))}getIndex(t){let e=this.hash(t);const n=e;for(;this.table[e]?.value!==t;)if(this.table[e]===void 0||(this.isOutdated(this.table[e])&&(this.table[e]=void 0),e=(e+1)%this.size,n==e))return-1;return this.isOutdated(this.table[e])?(this.table[e]=void 0,-1):e}has(t){return this.getIndex(t)>=0}find(t){const e=this.traverse(n=>!t(n));return e>=0?this.table[e]?.value:void 0}deleteIndex(t){return t>=0&&t<this.size&&this.table[t]!==void 0?(this.table[t]=void 0,!0):!1}delete(t){return this.deleteIndex(this.getIndex(t))}clear(){this.table=[]}isOutdated(t){return Date.now()-t.timestamp>this.ttl}clean(){for(let t=0,e=this.size;t<e;t++)this.table[t]!==void 0&&this.isOutdated(this.table[t])&&(this.table[t]=void 0)}}class Ln{maps=new Map;constructor(){}entries(){return[...this.maps.entries()]}keys(){return[...this.maps.keys()]}values(){return[...this.maps.values()]}json(){const t={};for(const e of this.maps)t[e[0]]=e[1];return t}get length(){return this.maps.size}set(t,e){this.maps.set(t,e)}get(t){return this.maps.get(t)}has(t){return this.maps.has(t)}getEntryFromIndex(t){let e=-1;for(const n of this.maps)if(++e==t)return n}getEntry(t){for(const e of this.maps)if(t(e[0],e[1]))return e}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 Vf(){St.OPEN_LOG=!0}function qf(){St.OPEN_LOG=!1}function jf(s){St.LOG_UPLOAD_FN=s}function Ga(){return!!St.OPEN_LOG}function Va(s){St.LOG_UPLOAD_FN&&St.LOG_UPLOAD_FN(s)}function ie(s){Va({level:"info",msg:s}),Ga()&&(!console||typeof console!="object"||typeof console.log!="function"||console.log(s))}function Cs(s){Va({level:"warn",msg:s}),Ga()&&(!console||typeof console!="object"||typeof console.warn!="function"||console.warn(s))}const qa=()=>{};function ja(s=0,t){const e=t?.min||300,n=t?.max||6e4,i=t?.exponent||2,r=t?.factor||.5;let o=e*Math.pow(i,s);if(r){const a=Math.random(),h=Math.floor(a*r*o);o=Math.floor(a*10)&1?o+h:o-h}return Math.min(o,n)|0}function Fi(s,t=3,e,n){return async function(...i){const r=`retry(${s.name})(${i.map(a=>Xe(a))})`;let o;for(let a=0;a<t;a++)try{return await s.call(n||this,...i)}catch(h){ie(`(${r}) 第 ${a+1} 次尝试失败, retrying...`),o=h,await new Promise(c=>setTimeout(c,typeof e=="number"?e:ja(a)))}throw ie(`(${r}) 已 ${t} 次失败,不再重试。 Last error: ${Xe(o)}`),o}}function Yi(s,t=60,e=new Ln,n){return async function(...i){const r=`cache(${s.name})(${i.map(c=>Xe(c))})`,o=Date.now();t&&e.update((c,l)=>o-l.timestamp<t*1e3);const a=Li(i),h=e.get(a);if(h){if(!t||o-h.timestamp<t*1e3)return ie(`${r} 击中缓存`),h.value;e.delete(a)}try{ie(`${r} 没有缓存, 尝试立即执行...`);const c=await s.call(n||this,...i);return ie(`${r} 缓存设置成功`),e.set(a,{value:c,timestamp:Date.now()}),c}catch(c){throw ie(`${r} 执行失败 : ${Xe(c)}`),c}}}var Xi=function(s,t){return Xi=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])},Xi(s,t)};function Ui(s,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");Xi(s,t);function e(){this.constructor=s}s.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}function Ha(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 $i(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 Gi(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 fe(s){return typeof s=="function"}function Hf(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 Vi=Hf(function(s){return function(t){s(this),this.message=t?t.length+` errors occurred during unsubscription:
|
|
12
|
+
`+t.map(function(e,n){return n+1+") "+e.toString()}).join(`
|
|
13
|
+
`):"",this.name="UnsubscriptionError",this.errors=t}});function Wa(s,t){if(s){var e=s.indexOf(t);0<=e&&s.splice(e,1)}}var qi=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=Ha(o),h=a.next();!h.done;h=a.next()){var c=h.value;c.remove(this)}}catch(g){t={error:g}}finally{try{h&&!h.done&&(e=a.return)&&e.call(a)}finally{if(t)throw t.error}}else o.remove(this);var l=this.initialTeardown;if(fe(l))try{l()}catch(g){r=g instanceof Vi?g.errors:[g]}var u=this._finalizers;if(u){this._finalizers=null;try{for(var d=Ha(u),f=d.next();!f.done;f=d.next()){var p=f.value;try{Za(p)}catch(g){r=r??[],g instanceof Vi?r=Gi(Gi([],$i(r)),$i(g.errors)):r.push(g)}}}catch(g){n={error:g}}finally{try{f&&!f.done&&(i=d.return)&&i.call(d)}finally{if(n)throw n.error}}}if(r)throw new Vi(r)}},s.prototype.add=function(t){var e;if(t&&t!==this)if(this.closed)Za(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)&&Wa(e,t)},s.prototype.remove=function(t){var e=this._finalizers;e&&Wa(e,t),t instanceof s&&t._removeParent(this)},s.EMPTY=function(){var t=new s;return t.closed=!0,t}(),s}();qi.EMPTY;function Ja(s){return s instanceof qi||s&&"closed"in s&&fe(s.remove)&&fe(s.add)&&fe(s.unsubscribe)}function Za(s){fe(s)?s():s.unsubscribe()}var Ka={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,Gi([s,t],$i(e)))},clearTimeout:function(s){return clearTimeout(s)},delegate:void 0};function Jf(s){Wf.setTimeout(function(){throw s})}function Qa(){}function Zf(s){s()}var ji=function(s){Ui(t,s);function t(e){var n=s.call(this)||this;return n.isStopped=!1,e?(n.destination=e,Ja(e)&&e.add(n)):n.destination=ed,n}return t.create=function(e,n,i){return new Wi(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}(qi),Kf=Function.prototype.bind;function Hi(s,t){return Kf.call(s,t)}var Qf=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){Es(n)}},s.prototype.error=function(t){var e=this.partialObserver;if(e.error)try{e.error(t)}catch(n){Es(n)}else Es(t)},s.prototype.complete=function(){var t=this.partialObserver;if(t.complete)try{t.complete()}catch(e){Es(e)}},s}(),Wi=function(s){Ui(t,s);function t(e,n,i){var r=s.call(this)||this,o;if(fe(e)||!e)o={next:e??void 0,error:n??void 0,complete:i??void 0};else{var a;r&&Ka.useDeprecatedNextContext?(a=Object.create(e),a.unsubscribe=function(){return r.unsubscribe()},o={next:e.next&&Hi(e.next,a),error:e.error&&Hi(e.error,a),complete:e.complete&&Hi(e.complete,a)}):o=e}return r.destination=new Qf(o),r}return t}(ji);function Es(s){Jf(s)}function td(s){throw s}var ed={closed:!0,next:Qa,error:td,complete:Qa},nd=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function sd(s){return s}function id(s){return s.length===0?sd: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=od(t)?t:new Wi(t,e,n);return Zf(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 Wi({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[nd]=function(){return this},s.prototype.pipe=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return id(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??Ka.Promise)!==null&&t!==void 0?t:Promise}function rd(s){return s&&fe(s.next)&&fe(s.error)&&fe(s.complete)}function od(s){return s&&s instanceof ji||rd(s)&&Ja(s)}(function(s){Ui(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(l){e.error(l)}}:s.prototype._next,h._error=r?function(c){try{r(c)}catch(l){e.error(l)}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})(ji);class ad extends Error{name;response;statusCode;constructor(t,e){super(t),this.name="HttpError",this.response=e,this.statusCode=e.status}toJSON(){return{name:this.name,message:this.message,stack:this.stack,response:this.response,statusCode:this.statusCode}}}let Rn;function Ee(s){Rn=s,s(),Rn=null}class hd{subscribers=new Set;add(){Rn&&!this.subscribers.has(Rn)&&this.subscribers.add(Rn)}notify(t){this.subscribers.forEach(e=>e(t))}}const eh=new WeakMap;function Ji(s,t){let e=eh.get(s);e||(e=new Map,eh.set(s,e));let n=e.get(t);return n||(n=new hd,e.set(t,n)),n}const Zi=nh;function nh(s,t){if(!vs(s))return s;const e=typeof t?.deep=="boolean"?t?.deep:!0,n=t?.path||"",i=t?.callback,r={get(o,a,h){const c=n?`${n}.${String(a)}`:String(a);let l=Reflect.get(o,a,h);const u=Ji(o,a);if(e&&vs(l)&&!("isYZProxy"in l)){const d=nh(l,{deep:!0,path:c,callback:i});Array.isArray(l)&&(d.YZProxyArrayDep=u),l=d}return u.add(),l},set(o,a,h,c){const l=Reflect.get(o,a,c),u=Reflect.set(o,a,h,c);if(a=="YZProxyArrayDep")return u;if(l!==h){let d;Array.isArray(o)?d=o.YZProxyArrayDep:d=Ji(o,a);const f={path:n?`${n}.${String(a)}`:String(a),newValue:h,oldValue:l};d.notify(f),i&&i(f)}return u},deleteProperty(o,a){if(!(a in o))return!1;let h=typeof a=="symbol"?void 0:o[a];vs(h)&&(h=Array.isArray(h)?[...h]:{...h});const c=Reflect.deleteProperty(o,a);if(c){let l;Array.isArray(o)?l=o.YZProxyArrayDep:l=Ji(o,a);const u={path:n?`${n}.${String(a)}`:String(a),newValue:void 0,oldValue:h};l.notify(u),i&&i(u)}return c},has(o,a){return a==="isYZProxy"||a in o}};return new Proxy(s,r)}class Ps{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 cd(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)}}function ld(){const s={};return s.promise=new Promise((t,e)=>{s.resolve=t,s.reject=e}),s}let ud=0;function sh(s){const t=ld();let e=!1;return{name:s.name||String(++ud),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 fd{queue;suspend=!1;semaphore=0;concurrency=1;timeRemaining=-1;timeoutId;constructor(t){this.queue=t?.queue||$f(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=$t();try{this.semaphore++,t.run()}finally{this.semaphore--,e&&(this.decreaseTimeRemaining($t()-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<=$t()?(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 ih extends fd{lastResult;constructor(t){super(t)}_exec(t,e=!0){const n=$t();try{this.semaphore++,t.run()}finally{t.result().then(i=>{this.lastResult=i}).finally(()=>{this.semaphore--,e&&(this.decreaseTimeRemaining($t()-n),this._flush())})}}}class dd{schedule;closeLastDialog;constructor(t){this.schedule=new ih(t)}asap(t,e){const n=sh({fn:i=>new Promise(r=>{this.closeLastDialog=t({...i,onClose:()=>{this.closeLastDialog=void 0,i?.onClose?.(),r()}})}),args:[e]});return this.schedule.asap(n),n}immediately(t,e){return this.clear(),this.asap(t,e)}closeLast(){this.closeLastDialog&&this.closeLastDialog()}clear(){this.schedule.clear(),this.closeLast()}}function rh(s){const t=typeof s.immutable=="boolean"?s.immutable:!0,e=s.initState||{};let n=s.reducer;if(s.enhancer)return s.enhancer(rh)({reducer:n,initState:e,immutable:t});const i=[],r=c=>(i.push(c),()=>{const l=i.indexOf(c);l>-1&&i.splice(l,1)});let o=e;t||(o=Zi(o,{callback:c=>{i.forEach(l=>l(c))}}));const a=c=>{if(t){const l=o;o=n(o,c);const u=Na(l,o);for(const d of u)i.forEach(f=>f(d))}else n(o,c)},h=c=>{n=c,a({type:"INIT"})};return a({type:"INIT"}),{getState:()=>o,dispatch:a,subscribe:r,replaceReducer:h}}function md(s=window.location.href){try{return new URL(s)}catch{const t="(?<protocol>https?:)",e="(?<host>(?<hostname>[^/#?:]+)(?::(?<port>\\d+))?)",n="(?<pathname>(?:\\/[^/#?]+)*\\/?)",i="(?<search>(?:\\?[^#]*)?)",r="(?<hash>(?:#.*)?)",o=new RegExp(`^${t}//${e}${n}${i}${r}$`).exec(s);return{href:s,protocol:o?.groups?.protocol||"",host:o?.groups?.host||"",hostname:o?.groups?.hostname||"",port:o?.groups?.port||"",pathname:o?.groups?.pathname||"",search:o?.groups?.search||"",hash:o?.groups?.hash||""}}}function pd(s=window.location.href){const t=md(s),e=t.href.indexOf(t.hash);return t.hash&&e>=0?t.href.substring(0,e):t.href}function gd(s,t){return s+t.replace(/^[&?]/,s.indexOf("?")>=0?"&":"?")}function yd(s){return"?"+Object.entries(s).map(([t,e])=>`${encodeURIComponent(t)}=${encodeURIComponent(e)}`).join("&")}function wd(s){return"?"+[...s.entries()].map(t=>encodeURIComponent(t[0])+"="+encodeURIComponent(t[1]instanceof File?t[1].name:t[1])).join("&")}function oh(s,t){return function(){return s.apply(t,arguments)}}const{toString:bd}=Object.prototype,{getPrototypeOf:Ki}=Object,Ts=(s=>t=>{const e=bd.call(t);return s[e]||(s[e]=e.slice(8,-1).toLowerCase())})(Object.create(null)),Jt=s=>(s=s.toLowerCase(),t=>Ts(t)===s),Ms=s=>t=>typeof t===s,{isArray:un}=Array,On=Ms("undefined");function xd(s){return s!==null&&!On(s)&&s.constructor!==null&&!On(s.constructor)&&Ot(s.constructor.isBuffer)&&s.constructor.isBuffer(s)}const ah=Jt("ArrayBuffer");function vd(s){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(s):t=s&&s.buffer&&ah(s.buffer),t}const Sd=Ms("string"),Ot=Ms("function"),hh=Ms("number"),As=s=>s!==null&&typeof s=="object",_d=s=>s===!0||s===!1,Is=s=>{if(Ts(s)!=="object")return!1;const t=Ki(s);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in s)&&!(Symbol.iterator in s)},Cd=Jt("Date"),Ed=Jt("File"),Pd=Jt("Blob"),Td=Jt("FileList"),Md=s=>As(s)&&Ot(s.pipe),Ad=s=>{let t;return s&&(typeof FormData=="function"&&s instanceof FormData||Ot(s.append)&&((t=Ts(s))==="formdata"||t==="object"&&Ot(s.toString)&&s.toString()==="[object FormData]"))},Id=Jt("URLSearchParams"),[kd,Dd,Ld,Rd]=["ReadableStream","Request","Response","Headers"].map(Jt),Od=s=>s.trim?s.trim():s.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function zn(s,t,{allOwnKeys:e=!1}={}){if(s===null||typeof s>"u")return;let n,i;if(typeof s!="object"&&(s=[s]),un(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 ch(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 Ue=(()=>typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global)(),lh=s=>!On(s)&&s!==Ue;function Qi(){const{caseless:s}=lh(this)&&this||{},t={},e=(n,i)=>{const r=s&&ch(t,i)||i;Is(t[r])&&Is(n)?t[r]=Qi(t[r],n):Is(n)?t[r]=Qi({},n):un(n)?t[r]=n.slice():t[r]=n};for(let n=0,i=arguments.length;n<i;n++)arguments[n]&&zn(arguments[n],e);return t}const zd=(s,t,e,{allOwnKeys:n}={})=>(zn(t,(i,r)=>{e&&Ot(i)?s[r]=oh(i,e):s[r]=i},{allOwnKeys:n}),s),Nd=s=>(s.charCodeAt(0)===65279&&(s=s.slice(1)),s),Bd=(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)},Fd=(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&&Ki(s)}while(s&&(!e||e(s,t))&&s!==Object.prototype);return t},Yd=(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},Xd=s=>{if(!s)return null;if(un(s))return s;let t=s.length;if(!hh(t))return null;const e=new Array(t);for(;t-- >0;)e[t]=s[t];return e},Ud=(s=>t=>s&&t instanceof s)(typeof Uint8Array<"u"&&Ki(Uint8Array)),$d=(s,t)=>{const e=(s&&s[Symbol.iterator]).call(s);let n;for(;(n=e.next())&&!n.done;){const i=n.value;t.call(s,i[0],i[1])}},Gd=(s,t)=>{let e;const n=[];for(;(e=s.exec(t))!==null;)n.push(e);return n},Vd=Jt("HTMLFormElement"),qd=s=>s.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(t,e,n){return e.toUpperCase()+n}),uh=(({hasOwnProperty:s})=>(t,e)=>s.call(t,e))(Object.prototype),jd=Jt("RegExp"),fh=(s,t)=>{const e=Object.getOwnPropertyDescriptors(s),n={};zn(e,(i,r)=>{let o;(o=t(i,r,s))!==!1&&(n[r]=o||i)}),Object.defineProperties(s,n)},Hd=s=>{fh(s,(t,e)=>{if(Ot(s)&&["arguments","caller","callee"].indexOf(e)!==-1)return!1;const n=s[e];if(Ot(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+"'")})}})},Wd=(s,t)=>{const e={},n=i=>{i.forEach(r=>{e[r]=!0})};return un(s)?n(s):n(String(s).split(t)),e},Jd=()=>{},Zd=(s,t)=>s!=null&&Number.isFinite(s=+s)?s:t;function Kd(s){return!!(s&&Ot(s.append)&&s[Symbol.toStringTag]==="FormData"&&s[Symbol.iterator])}const Qd=s=>{const t=new Array(10),e=(n,i)=>{if(As(n)){if(t.indexOf(n)>=0)return;if(!("toJSON"in n)){t[i]=n;const r=un(n)?[]:{};return zn(n,(o,a)=>{const h=e(o,i+1);!On(h)&&(r[a]=h)}),t[i]=void 0,r}}return n};return e(s,0)},tm=Jt("AsyncFunction"),em=s=>s&&(As(s)||Ot(s))&&Ot(s.then)&&Ot(s.catch),dh=((s,t)=>s?setImmediate:t?((e,n)=>(Ue.addEventListener("message",({source:i,data:r})=>{i===Ue&&r===e&&n.length&&n.shift()()},!1),i=>{n.push(i),Ue.postMessage(e,"*")}))(`axios@${Math.random()}`,[]):e=>setTimeout(e))(typeof setImmediate=="function",Ot(Ue.postMessage)),nm=typeof queueMicrotask<"u"?queueMicrotask.bind(Ue):typeof process<"u"&&process.nextTick||dh,A={isArray:un,isArrayBuffer:ah,isBuffer:xd,isFormData:Ad,isArrayBufferView:vd,isString:Sd,isNumber:hh,isBoolean:_d,isObject:As,isPlainObject:Is,isReadableStream:kd,isRequest:Dd,isResponse:Ld,isHeaders:Rd,isUndefined:On,isDate:Cd,isFile:Ed,isBlob:Pd,isRegExp:jd,isFunction:Ot,isStream:Md,isURLSearchParams:Id,isTypedArray:Ud,isFileList:Td,forEach:zn,merge:Qi,extend:zd,trim:Od,stripBOM:Nd,inherits:Bd,toFlatObject:Fd,kindOf:Ts,kindOfTest:Jt,endsWith:Yd,toArray:Xd,forEachEntry:$d,matchAll:Gd,isHTMLForm:Vd,hasOwnProperty:uh,hasOwnProp:uh,reduceDescriptors:fh,freezeMethods:Hd,toObjectSet:Wd,toCamelCase:qd,noop:Jd,toFiniteNumber:Zd,findKey:ch,global:Ue,isContextDefined:lh,isSpecCompliantForm:Kd,toJSONObject:Qd,isAsyncFn:tm,isThenable:em,setImmediate:dh,asap:nm};function U(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(U,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 mh=U.prototype,ph={};["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=>{ph[s]={value:s}}),Object.defineProperties(U,ph),Object.defineProperty(mh,"isAxiosError",{value:!0}),U.from=(s,t,e,n,i,r)=>{const o=Object.create(mh);return A.toFlatObject(s,o,function(a){return a!==Error.prototype},a=>a!=="isAxiosError"),U.call(o,s.message,t,e,n,i),o.cause=s,o.name=s.name,r&&Object.assign(o,r),o};const sm=null;function tr(s){return A.isPlainObject(s)||A.isArray(s)}function gh(s){return A.endsWith(s,"[]")?s.slice(0,-2):s}function yh(s,t,e){return s?s.concat(t).map(function(n,i){return n=gh(n),!e&&i?"["+n+"]":n}).join(e?".":""):t}function im(s){return A.isArray(s)&&!s.some(tr)}const rm=A.toFlatObject(A,{},null,function(s){return/^is[A-Z]/.test(s)});function ks(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(f,p){return!A.isUndefined(p[f])});const n=e.metaTokens,i=e.visitor||c,r=e.dots,o=e.indexes,a=(e.Blob||typeof Blob<"u"&&Blob)&&A.isSpecCompliantForm(t);if(!A.isFunction(i))throw new TypeError("visitor must be a function");function h(f){if(f===null)return"";if(A.isDate(f))return f.toISOString();if(!a&&A.isBlob(f))throw new U("Blob is not supported. Use a Buffer instead.");return A.isArrayBuffer(f)||A.isTypedArray(f)?a&&typeof Blob=="function"?new Blob([f]):Buffer.from(f):f}function c(f,p,g){let C=f;if(f&&!g&&typeof f=="object"){if(A.endsWith(p,"{}"))p=n?p:p.slice(0,-2),f=JSON.stringify(f);else if(A.isArray(f)&&im(f)||(A.isFileList(f)||A.endsWith(p,"[]"))&&(C=A.toArray(f)))return p=gh(p),C.forEach(function(y,v){!(A.isUndefined(y)||y===null)&&t.append(o===!0?yh([p],v,r):o===null?p:p+"[]",h(y))}),!1}return tr(f)?!0:(t.append(yh(g,p,r),h(f)),!1)}const l=[],u=Object.assign(rm,{defaultVisitor:c,convertValue:h,isVisitable:tr});function d(f,p){if(!A.isUndefined(f)){if(l.indexOf(f)!==-1)throw Error("Circular reference detected in "+p.join("."));l.push(f),A.forEach(f,function(g,C){(!(A.isUndefined(g)||g===null)&&i.call(t,g,A.isString(C)?C.trim():C,p,u))===!0&&d(g,p?p.concat(C):[C])}),l.pop()}}if(!A.isObject(s))throw new TypeError("data must be an object");return d(s),t}function wh(s){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(s).replace(/[!'()~]|%20|%00/g,function(e){return t[e]})}function er(s,t){this._pairs=[],s&&ks(s,this,t)}const bh=er.prototype;bh.append=function(s,t){this._pairs.push([s,t])},bh.toString=function(s){const t=s?function(e){return s.call(this,e,wh)}:wh;return this._pairs.map(function(e){return t(e[0])+"="+t(e[1])},"").join("&")};function om(s){return encodeURIComponent(s).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function xh(s,t,e){if(!t)return s;const n=e&&e.encode||om;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 er(t,e).toString(n),r){const o=s.indexOf("#");o!==-1&&(s=s.slice(0,o)),s+=(s.indexOf("?")===-1?"?":"&")+r}return s}class am{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(e){e!==null&&t(e)})}}const vh=am,Sh={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},hm=typeof URLSearchParams<"u"?URLSearchParams:er,cm=typeof FormData<"u"?FormData:null,lm=typeof Blob<"u"?Blob:null,um={isBrowser:!0,classes:{URLSearchParams:hm,FormData:cm,Blob:lm},protocols:["http","https","file","blob","url","data"]},nr=typeof window<"u"&&typeof document<"u",sr=typeof navigator=="object"&&navigator||void 0,fm=nr&&(!sr||["ReactNative","NativeScript","NS"].indexOf(sr.product)<0),dm=(()=>typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function")(),mm=nr&&window.location.href||"http://localhost",pm=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:nr,hasStandardBrowserEnv:fm,hasStandardBrowserWebWorkerEnv:dm,navigator:sr,origin:mm},Symbol.toStringTag,{value:"Module"})),_t={...pm,...um};function gm(s,t){return ks(s,new _t.classes.URLSearchParams,Object.assign({visitor:function(e,n,i,r){return _t.isNode&&A.isBuffer(e)?(this.append(n,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)}},t))}function ym(s){return A.matchAll(/\w+|\[(\w*)]/g,s).map(t=>t[0]==="[]"?"":t[1]||t[0])}function wm(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 _h(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]=wm(i[o])),!a)}if(A.isFormData(s)&&A.isFunction(s.entries)){const e={};return A.forEachEntry(s,(n,i)=>{t(ym(n),i,e,0)}),e}return null}function bm(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 ir={transitional:Sh,adapter:["xhr","http","fetch"],transformRequest:[function(s,t){const e=t.getContentType()||"",n=e.indexOf("application/json")>-1,i=A.isObject(s);if(i&&A.isHTMLForm(s)&&(s=new FormData(s)),A.isFormData(s))return n?JSON.stringify(_h(s)):s;if(A.isArrayBuffer(s)||A.isBuffer(s)||A.isStream(s)||A.isFile(s)||A.isBlob(s)||A.isReadableStream(s))return s;if(A.isArrayBufferView(s))return s.buffer;if(A.isURLSearchParams(s))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),s.toString();let r;if(i){if(e.indexOf("application/x-www-form-urlencoded")>-1)return gm(s,this.formSerializer).toString();if((r=A.isFileList(s))||e.indexOf("multipart/form-data")>-1){const o=this.env&&this.env.FormData;return ks(r?{"files[]":s}:s,o&&new o,this.formSerializer)}}return i||n?(t.setContentType("application/json",!1),bm(s)):s}],transformResponse:[function(s){const t=this.transitional||ir.transitional,e=t&&t.forcedJSONParsing,n=this.responseType==="json";if(A.isResponse(s)||A.isReadableStream(s))return s;if(s&&A.isString(s)&&(e&&!this.responseType||n)){const i=!(t&&t.silentJSONParsing)&&n;try{return JSON.parse(s)}catch(r){if(i)throw r.name==="SyntaxError"?U.from(r,U.ERR_BAD_RESPONSE,this,null,this.response):r}}return s}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:_t.classes.FormData,Blob:_t.classes.Blob},validateStatus:function(s){return s>=200&&s<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};A.forEach(["delete","get","head","post","put","patch"],s=>{ir.headers[s]={}});const rr=ir,xm=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"]),vm=s=>{const t={};let e,n,i;return s&&s.split(`
|
|
14
|
+
`).forEach(function(r){i=r.indexOf(":"),e=r.substring(0,i).trim().toLowerCase(),n=r.substring(i+1).trim(),!(!e||t[e]&&xm[e])&&(e==="set-cookie"?t[e]?t[e].push(n):t[e]=[n]:t[e]=t[e]?t[e]+", "+n:n)}),t},Ch=Symbol("internals");function Nn(s){return s&&String(s).trim().toLowerCase()}function Ds(s){return s===!1||s==null?s:A.isArray(s)?s.map(Ds):String(s)}function Sm(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 _m=s=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(s.trim());function or(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 Cm(s){return s.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,e,n)=>e.toUpperCase()+n)}function Em(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 Ls{constructor(t){t&&this.set(t)}set(t,e,n){const i=this;function r(a,h,c){const l=Nn(h);if(!l)throw new Error("header name must be a non-empty string");const u=A.findKey(i,l);(!u||i[u]===void 0||c===!0||c===void 0&&i[u]!==!1)&&(i[u||h]=Ds(a))}const o=(a,h)=>A.forEach(a,(c,l)=>r(c,l,h));if(A.isPlainObject(t)||t instanceof this.constructor)o(t,e);else if(A.isString(t)&&(t=t.trim())&&!_m(t))o(vm(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=Nn(t),t){const n=A.findKey(this,t);if(n){const i=this[n];if(!e)return i;if(e===!0)return Sm(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=Nn(t),t){const n=A.findKey(this,t);return!!(n&&this[n]!==void 0&&(!e||or(this,this[n],n,e)))}return!1}delete(t,e){const n=this;let i=!1;function r(o){if(o=Nn(o),o){const a=A.findKey(n,o);a&&(!e||or(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||or(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]=Ds(i),delete e[r];return}const a=t?Cm(r):String(r).trim();a!==r&&delete e[r],e[a]=Ds(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(`
|
|
15
|
+
`)}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 e=(this[Ch]=this[Ch]={accessors:{}}).accessors,n=this.prototype;function i(r){const o=Nn(r);e[o]||(Em(n,r),e[o]=!0)}return A.isArray(t)?t.forEach(i):i(t),this}}Ls.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),A.reduceDescriptors(Ls.prototype,({value:s},t)=>{let e=t[0].toUpperCase()+t.slice(1);return{get:()=>s,set(n){this[e]=n}}}),A.freezeMethods(Ls);const Zt=Ls;function ar(s,t){const e=this||rr,n=t||e,i=Zt.from(n.headers);let r=n.data;return A.forEach(s,function(o){r=o.call(e,r,i.normalize(),t?t.status:void 0)}),i.normalize(),r}function Eh(s){return!!(s&&s.__CANCEL__)}function fn(s,t,e){U.call(this,s??"canceled",U.ERR_CANCELED,t,e),this.name="CanceledError"}A.inherits(fn,U,{__CANCEL__:!0});function Ph(s,t,e){const n=e.config.validateStatus;!e.status||!n||n(e.status)?s(e):t(new U("Request failed with status code "+e.status,[U.ERR_BAD_REQUEST,U.ERR_BAD_RESPONSE][Math.floor(e.status/100)-4],e.config,e.request,e))}function Pm(s){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(s);return t&&t[1]||""}function Tm(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(a){const h=Date.now(),c=n[r];o||(o=h),e[i]=a,n[i]=h;let l=r,u=0;for(;l!==i;)u+=e[l++],l=l%s;if(i=(i+1)%s,i===r&&(r=(r+1)%s),h-o<t)return;const d=c&&h-c;return d?Math.round(u*1e3/d):void 0}}function Mm(s,t){let e=0,n=1e3/t,i,r;const o=(a,h=Date.now())=>{e=h,i=null,r&&(clearTimeout(r),r=null),s.apply(null,a)};return[(...a)=>{const h=Date.now(),c=h-e;c>=n?o(a,h):(i=a,r||(r=setTimeout(()=>{r=null,o(i)},n-c)))},()=>i&&o(i)]}const Rs=(s,t,e=3)=>{let n=0;const i=Tm(50,250);return Mm(r=>{const o=r.loaded,a=r.lengthComputable?r.total:void 0,h=o-n,c=i(h),l=o<=a;n=o;const u={loaded:o,total:a,progress:a?o/a:void 0,bytes:h,rate:c||void 0,estimated:c&&a&&l?(a-o)/c:void 0,event:r,lengthComputable:a!=null,[t?"download":"upload"]:!0};s(u)},e)},Th=(s,t)=>{const e=s!=null;return[n=>t[0]({lengthComputable:e,total:s,loaded:n}),t[1]]},Mh=s=>(...t)=>A.asap(()=>s(...t)),Am=_t.hasStandardBrowserEnv?((s,t)=>e=>(e=new URL(e,_t.origin),s.protocol===e.protocol&&s.host===e.host&&(t||s.port===e.port)))(new URL(_t.origin),_t.navigator&&/(msie|trident)/i.test(_t.navigator.userAgent)):()=>!0,Im=_t.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 km(s){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(s)}function Dm(s,t){return t?s.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):s}function Ah(s,t,e){let n=!km(t);return s&&(n||e==!1)?Dm(s,t):t}const Ih=s=>s instanceof Zt?{...s}:s;function $e(s,t){t=t||{};const e={};function n(c,l,u,d){return A.isPlainObject(c)&&A.isPlainObject(l)?A.merge.call({caseless:d},c,l):A.isPlainObject(l)?A.merge({},l):A.isArray(l)?l.slice():l}function i(c,l,u,d){if(A.isUndefined(l)){if(!A.isUndefined(c))return n(void 0,c,u,d)}else return n(c,l,u,d)}function r(c,l){if(!A.isUndefined(l))return n(void 0,l)}function o(c,l){if(A.isUndefined(l)){if(!A.isUndefined(c))return n(void 0,c)}else return n(void 0,l)}function a(c,l,u){if(u in t)return n(c,l);if(u 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,l,u)=>i(Ih(c),Ih(l),u,!0)};return A.forEach(Object.keys(Object.assign({},s,t)),function(c){const l=h[c]||i,u=l(s[c],t[c],c);A.isUndefined(u)&&l!==a||(e[c]=u)}),e}const kh=s=>{const t=$e({},s);let{data:e,withXSRFToken:n,xsrfHeaderName:i,xsrfCookieName:r,headers:o,auth:a}=t;t.headers=o=Zt.from(o),t.url=xh(Ah(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(_t.hasStandardBrowserEnv||_t.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if((h=o.getContentType())!==!1){const[c,...l]=h?h.split(";").map(u=>u.trim()).filter(Boolean):[];o.setContentType([c||"multipart/form-data",...l].join("; "))}}if(_t.hasStandardBrowserEnv&&(n&&A.isFunction(n)&&(n=n(t)),n||n!==!1&&Am(t.url))){const c=i&&r&&Im.read(r);c&&o.set(i,c)}return t},Lm=typeof XMLHttpRequest<"u",Rm=Lm&&function(s){return new Promise(function(t,e){const n=kh(s);let i=n.data;const r=Zt.from(n.headers).normalize();let{responseType:o,onUploadProgress:a,onDownloadProgress:h}=n,c,l,u,d,f;function p(){d&&d(),f&&f(),n.cancelToken&&n.cancelToken.unsubscribe(c),n.signal&&n.signal.removeEventListener("abort",c)}let g=new XMLHttpRequest;g.open(n.method.toUpperCase(),n.url,!0),g.timeout=n.timeout;function C(){if(!g)return;const v=Zt.from("getAllResponseHeaders"in g&&g.getAllResponseHeaders()),b={data:!o||o==="text"||o==="json"?g.responseText:g.response,status:g.status,statusText:g.statusText,headers:v,config:s,request:g};Ph(function(x){t(x),p()},function(x){e(x),p()},b),g=null}"onloadend"in g?g.onloadend=C:g.onreadystatechange=function(){!g||g.readyState!==4||g.status===0&&!(g.responseURL&&g.responseURL.indexOf("file:")===0)||setTimeout(C)},g.onabort=function(){g&&(e(new U("Request aborted",U.ECONNABORTED,s,g)),g=null)},g.onerror=function(){e(new U("Network Error",U.ERR_NETWORK,s,g)),g=null},g.ontimeout=function(){let v=n.timeout?"timeout of "+n.timeout+"ms exceeded":"timeout exceeded";const b=n.transitional||Sh;n.timeoutErrorMessage&&(v=n.timeoutErrorMessage),e(new U(v,b.clarifyTimeoutError?U.ETIMEDOUT:U.ECONNABORTED,s,g)),g=null},i===void 0&&r.setContentType(null),"setRequestHeader"in g&&A.forEach(r.toJSON(),function(v,b){g.setRequestHeader(b,v)}),A.isUndefined(n.withCredentials)||(g.withCredentials=!!n.withCredentials),o&&o!=="json"&&(g.responseType=n.responseType),h&&([u,f]=Rs(h,!0),g.addEventListener("progress",u)),a&&g.upload&&([l,d]=Rs(a),g.upload.addEventListener("progress",l),g.upload.addEventListener("loadend",d)),(n.cancelToken||n.signal)&&(c=v=>{g&&(e(!v||v.type?new fn(null,s,g):v),g.abort(),g=null)},n.cancelToken&&n.cancelToken.subscribe(c),n.signal&&(n.signal.aborted?c():n.signal.addEventListener("abort",c)));const y=Pm(n.url);if(y&&_t.protocols.indexOf(y)===-1){e(new U("Unsupported protocol "+y+":",U.ERR_BAD_REQUEST,s));return}g.send(i||null)})},Om=(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 l=c instanceof Error?c:this.reason;n.abort(l instanceof U?l:new fn(l instanceof Error?l.message:l))}};let o=t&&setTimeout(()=>{o=null,r(new U(`timeout ${t} of ms exceeded`,U.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}},zm=Om,Nm=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},Bm=async function*(s,t){for await(const e of Fm(s))yield*Nm(e,t)},Fm=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()}},Dh=(s,t,e,n)=>{const i=Bm(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:l}=await i.next();if(c){a(),h.close();return}let u=l.byteLength;if(e){let d=r+=u;e(d)}h.enqueue(new Uint8Array(l))}catch(c){throw a(c),c}},cancel(h){return a(h),i.return()}},{highWaterMark:2})},Os=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",Lh=Os&&typeof ReadableStream=="function",Ym=Os&&(typeof TextEncoder=="function"?(s=>t=>s.encode(t))(new TextEncoder):async s=>new Uint8Array(await new Response(s).arrayBuffer())),Rh=(s,...t)=>{try{return!!s(...t)}catch{return!1}},Xm=Lh&&Rh(()=>{let s=!1;const t=new Request(_t.origin,{body:new ReadableStream,method:"POST",get duplex(){return s=!0,"half"}}).headers.has("Content-Type");return s&&!t}),Oh=64*1024,hr=Lh&&Rh(()=>A.isReadableStream(new Response("").body)),zs={stream:hr&&(s=>s.body)};Os&&(s=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!zs[t]&&(zs[t]=A.isFunction(s[t])?e=>e[t]():(e,n)=>{throw new U(`Response type '${t}' is not supported`,U.ERR_NOT_SUPPORT,n)})})})(new Response);const Um=async s=>{if(s==null)return 0;if(A.isBlob(s))return s.size;if(A.isSpecCompliantForm(s))return(await new Request(_t.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 Ym(s)).byteLength},$m=async(s,t)=>A.toFiniteNumber(s.getContentLength())??Um(t),Gm=Os&&(async s=>{let{url:t,method:e,data:n,signal:i,cancelToken:r,timeout:o,onDownloadProgress:a,onUploadProgress:h,responseType:c,headers:l,withCredentials:u="same-origin",fetchOptions:d}=kh(s);c=c?(c+"").toLowerCase():"text";let f=zm([i,r&&r.toAbortSignal()],o),p;const g=f&&f.unsubscribe&&(()=>{f.unsubscribe()});let C;try{if(h&&Xm&&e!=="get"&&e!=="head"&&(C=await $m(l,n))!==0){let E=new Request(t,{method:"POST",body:n,duplex:"half"}),_;if(A.isFormData(n)&&(_=E.headers.get("content-type"))&&l.setContentType(_),E.body){const[L,N]=Th(C,Rs(Mh(h)));n=Dh(E.body,Oh,L,N)}}A.isString(u)||(u=u?"include":"omit");const y="credentials"in Request.prototype;p=new Request(t,{...d,signal:f,method:e.toUpperCase(),headers:l.normalize().toJSON(),body:n,duplex:"half",credentials:y?u:void 0});let v=await fetch(p);const b=hr&&(c==="stream"||c==="response");if(hr&&(a||b&&g)){const E={};["status","statusText","headers"].forEach(Y=>{E[Y]=v[Y]});const _=A.toFiniteNumber(v.headers.get("content-length")),[L,N]=a&&Th(_,Rs(Mh(a),!0))||[];v=new Response(Dh(v.body,Oh,L,()=>{N&&N(),g&&g()}),E)}c=c||"text";let x=await zs[A.findKey(zs,c)||"text"](v,s);return!b&&g&&g(),await new Promise((E,_)=>{Ph(E,_,{data:x,headers:Zt.from(v.headers),status:v.status,statusText:v.statusText,config:s,request:p})})}catch(y){throw g&&g(),y&&y.name==="TypeError"&&/fetch/i.test(y.message)?Object.assign(new U("Network Error",U.ERR_NETWORK,s,p),{cause:y.cause||y}):U.from(y,y&&y.code,s,p)}}),cr={http:sm,xhr:Rm,fetch:Gm};A.forEach(cr,(s,t)=>{if(s){try{Object.defineProperty(s,"name",{value:t})}catch{}Object.defineProperty(s,"adapterName",{value:t})}});const zh=s=>`- ${s}`,Vm=s=>A.isFunction(s)||s===null||s===!1,Nh={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,!Vm(e)&&(n=cr[(o=String(e)).toLowerCase()],n===void 0))throw new U(`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 :
|
|
16
|
+
`+r.map(zh).join(`
|
|
17
|
+
`):" "+zh(r[0]):"as no adapter specified";throw new U("There is no suitable adapter to dispatch the request "+o,"ERR_NOT_SUPPORT")}return n},adapters:cr};function lr(s){if(s.cancelToken&&s.cancelToken.throwIfRequested(),s.signal&&s.signal.aborted)throw new fn(null,s)}function Bh(s){return lr(s),s.headers=Zt.from(s.headers),s.data=ar.call(s,s.transformRequest),["post","put","patch"].indexOf(s.method)!==-1&&s.headers.setContentType("application/x-www-form-urlencoded",!1),Nh.getAdapter(s.adapter||rr.adapter)(s).then(function(t){return lr(s),t.data=ar.call(s,s.transformResponse,t),t.headers=Zt.from(t.headers),t},function(t){return Eh(t)||(lr(s),t&&t.response&&(t.response.data=ar.call(s,s.transformResponse,t.response),t.response.headers=Zt.from(t.response.headers))),Promise.reject(t)})}const Fh="1.8.4",Ns={};["object","boolean","number","function","string","symbol"].forEach((s,t)=>{Ns[s]=function(e){return typeof e===s||"a"+(t<1?"n ":" ")+s}});const Yh={};Ns.transitional=function(s,t,e){function n(i,r){return"[Axios v"+Fh+"] Transitional option '"+i+"'"+r+(e?". "+e:"")}return(i,r,o)=>{if(s===!1)throw new U(n(r," has been removed"+(t?" in "+t:"")),U.ERR_DEPRECATED);return t&&!Yh[r]&&(Yh[r]=!0,console.warn(n(r," has been deprecated since v"+t+" and will be removed in the near future"))),s?s(i,r,o):!0}},Ns.spelling=function(s){return(t,e)=>(console.warn(`${e} is likely a misspelling of ${s}`),!0)};function qm(s,t,e){if(typeof s!="object")throw new U("options must be an object",U.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 U("option "+r+" must be "+h,U.ERR_BAD_OPTION_VALUE);continue}if(e!==!0)throw new U("Unknown option "+r,U.ERR_BAD_OPTION)}}const Bs={assertOptions:qm,validators:Ns},re=Bs.validators;class Fs{constructor(t){this.defaults=t,this.interceptors={request:new vh,response:new vh}}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+=`
|
|
18
|
+
`+r):n.stack=r}catch{}}throw n}}_request(t,e){typeof t=="string"?(e=e||{},e.url=t):e=t||{},e=$e(this.defaults,e);const{transitional:n,paramsSerializer:i,headers:r}=e;n!==void 0&&Bs.assertOptions(n,{silentJSONParsing:re.transitional(re.boolean),forcedJSONParsing:re.transitional(re.boolean),clarifyTimeoutError:re.transitional(re.boolean)},!1),i!=null&&(A.isFunction(i)?e.paramsSerializer={serialize:i}:Bs.assertOptions(i,{encode:re.function,serialize:re.function},!0)),e.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?e.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:e.allowAbsoluteUrls=!0),Bs.assertOptions(e,{baseUrl:re.spelling("baseURL"),withXsrfToken:re.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 h=!0;this.interceptors.request.forEach(function(p){typeof p.runWhen=="function"&&p.runWhen(e)===!1||(h=h&&p.synchronous,a.unshift(p.fulfilled,p.rejected))});const c=[];this.interceptors.response.forEach(function(p){c.push(p.fulfilled,p.rejected)});let l,u=0,d;if(!h){const p=[Bh.bind(this),void 0];for(p.unshift.apply(p,a),p.push.apply(p,c),d=p.length,l=Promise.resolve(e);u<d;)l=l.then(p[u++],p[u++]);return l}d=a.length;let f=e;for(u=0;u<d;){const p=a[u++],g=a[u++];try{f=p(f)}catch(C){g.call(this,C);break}}try{l=Bh.call(this,f)}catch(p){return Promise.reject(p)}for(u=0,d=c.length;u<d;)l=l.then(c[u++],c[u++]);return l}getUri(t){t=$e(this.defaults,t);const e=Ah(t.baseURL,t.url,t.allowAbsoluteUrls);return xh(e,t.params,t.paramsSerializer)}}A.forEach(["delete","get","head","options"],function(s){Fs.prototype[s]=function(t,e){return this.request($e(e||{},{method:s,url:t,data:(e||{}).data}))}}),A.forEach(["post","put","patch"],function(s){function t(e){return function(n,i,r){return this.request($e(r||{},{method:s,headers:e?{"Content-Type":"multipart/form-data"}:{},url:n,data:i}))}}Fs.prototype[s]=t(),Fs.prototype[s+"Form"]=t(!0)});const Ys=Fs;class ur{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let e;this.promise=new Promise(function(i){e=i});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(i,r,o){n.reason||(n.reason=new fn(i,r,o),e(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const e=this._listeners.indexOf(t);e!==-1&&this._listeners.splice(e,1)}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 ur(function(e){t=e}),cancel:t}}}const jm=ur;function Hm(s){return function(t){return s.apply(null,t)}}function Wm(s){return A.isObject(s)&&s.isAxiosError===!0}const fr={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(fr).forEach(([s,t])=>{fr[t]=s});const Jm=fr;function Xh(s){const t=new Ys(s),e=oh(Ys.prototype.request,t);return A.extend(e,Ys.prototype,t,{allOwnKeys:!0}),A.extend(e,t,null,{allOwnKeys:!0}),e.create=function(n){return Xh($e(s,n))},e}const ht=Xh(rr);ht.Axios=Ys,ht.CanceledError=fn,ht.CancelToken=jm,ht.isCancel=Eh,ht.VERSION=Fh,ht.toFormData=ks,ht.AxiosError=U,ht.Cancel=ht.CanceledError,ht.all=function(s){return Promise.all(s)},ht.spread=Hm,ht.isAxiosError=Wm,ht.mergeConfig=$e,ht.AxiosHeaders=Zt,ht.formToJSON=s=>_h(A.isHTMLForm(s)?new FormData(s):s),ht.getAdapter=Nh.getAdapter,ht.HttpStatusCode=Jm,ht.default=ht;const Zm=ht;class Uh{instance;canceler;retryCount=0;cacheTime=0;caches=new Ln;constructor(t){this.instance=Zm.create(t),this.canceler=new Km,this.retryCount=t?.retry||0,this.cacheTime=t?.cache||0,this.instance.interceptors.request.use(e=>(t?.interceptor?.start?.(),this.canceler.pendingRequest(e),t?.interceptor?.request?.(e),e),e=>(t?.interceptor?.end?.(),this.canceler.cancelRequest(e.config),t?.interceptor?.requestError?.(e),Promise.reject(e))),this.instance.interceptors.response.use(e=>(t?.interceptor?.end?.(),this.canceler.confirmRequest(e.config),t?.interceptor?.response?.(e),e.status==200?Promise.resolve(e):Promise.reject(e)),e=>(t?.interceptor?.end?.(),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=Fi(e,n));const i=t.cache||this.cacheTime;return i&&(e=Yi(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 Km{pendingRequestMap;constructor(){this.pendingRequestMap=new Map}getRequestId(t){const{method:e,url:n,params:i,data:r}=t;return Li({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()}}function $h(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}var Gh={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(y,v){var b=y[0],x=y[1],E=y[2],_=y[3];b+=(x&E|~x&_)+v[0]-680876936|0,b=(b<<7|b>>>25)+x|0,_+=(b&x|~b&E)+v[1]-389564586|0,_=(_<<12|_>>>20)+b|0,E+=(_&b|~_&x)+v[2]+606105819|0,E=(E<<17|E>>>15)+_|0,x+=(E&_|~E&b)+v[3]-1044525330|0,x=(x<<22|x>>>10)+E|0,b+=(x&E|~x&_)+v[4]-176418897|0,b=(b<<7|b>>>25)+x|0,_+=(b&x|~b&E)+v[5]+1200080426|0,_=(_<<12|_>>>20)+b|0,E+=(_&b|~_&x)+v[6]-1473231341|0,E=(E<<17|E>>>15)+_|0,x+=(E&_|~E&b)+v[7]-45705983|0,x=(x<<22|x>>>10)+E|0,b+=(x&E|~x&_)+v[8]+1770035416|0,b=(b<<7|b>>>25)+x|0,_+=(b&x|~b&E)+v[9]-1958414417|0,_=(_<<12|_>>>20)+b|0,E+=(_&b|~_&x)+v[10]-42063|0,E=(E<<17|E>>>15)+_|0,x+=(E&_|~E&b)+v[11]-1990404162|0,x=(x<<22|x>>>10)+E|0,b+=(x&E|~x&_)+v[12]+1804603682|0,b=(b<<7|b>>>25)+x|0,_+=(b&x|~b&E)+v[13]-40341101|0,_=(_<<12|_>>>20)+b|0,E+=(_&b|~_&x)+v[14]-1502002290|0,E=(E<<17|E>>>15)+_|0,x+=(E&_|~E&b)+v[15]+1236535329|0,x=(x<<22|x>>>10)+E|0,b+=(x&_|E&~_)+v[1]-165796510|0,b=(b<<5|b>>>27)+x|0,_+=(b&E|x&~E)+v[6]-1069501632|0,_=(_<<9|_>>>23)+b|0,E+=(_&x|b&~x)+v[11]+643717713|0,E=(E<<14|E>>>18)+_|0,x+=(E&b|_&~b)+v[0]-373897302|0,x=(x<<20|x>>>12)+E|0,b+=(x&_|E&~_)+v[5]-701558691|0,b=(b<<5|b>>>27)+x|0,_+=(b&E|x&~E)+v[10]+38016083|0,_=(_<<9|_>>>23)+b|0,E+=(_&x|b&~x)+v[15]-660478335|0,E=(E<<14|E>>>18)+_|0,x+=(E&b|_&~b)+v[4]-405537848|0,x=(x<<20|x>>>12)+E|0,b+=(x&_|E&~_)+v[9]+568446438|0,b=(b<<5|b>>>27)+x|0,_+=(b&E|x&~E)+v[14]-1019803690|0,_=(_<<9|_>>>23)+b|0,E+=(_&x|b&~x)+v[3]-187363961|0,E=(E<<14|E>>>18)+_|0,x+=(E&b|_&~b)+v[8]+1163531501|0,x=(x<<20|x>>>12)+E|0,b+=(x&_|E&~_)+v[13]-1444681467|0,b=(b<<5|b>>>27)+x|0,_+=(b&E|x&~E)+v[2]-51403784|0,_=(_<<9|_>>>23)+b|0,E+=(_&x|b&~x)+v[7]+1735328473|0,E=(E<<14|E>>>18)+_|0,x+=(E&b|_&~b)+v[12]-1926607734|0,x=(x<<20|x>>>12)+E|0,b+=(x^E^_)+v[5]-378558|0,b=(b<<4|b>>>28)+x|0,_+=(b^x^E)+v[8]-2022574463|0,_=(_<<11|_>>>21)+b|0,E+=(_^b^x)+v[11]+1839030562|0,E=(E<<16|E>>>16)+_|0,x+=(E^_^b)+v[14]-35309556|0,x=(x<<23|x>>>9)+E|0,b+=(x^E^_)+v[1]-1530992060|0,b=(b<<4|b>>>28)+x|0,_+=(b^x^E)+v[4]+1272893353|0,_=(_<<11|_>>>21)+b|0,E+=(_^b^x)+v[7]-155497632|0,E=(E<<16|E>>>16)+_|0,x+=(E^_^b)+v[10]-1094730640|0,x=(x<<23|x>>>9)+E|0,b+=(x^E^_)+v[13]+681279174|0,b=(b<<4|b>>>28)+x|0,_+=(b^x^E)+v[0]-358537222|0,_=(_<<11|_>>>21)+b|0,E+=(_^b^x)+v[3]-722521979|0,E=(E<<16|E>>>16)+_|0,x+=(E^_^b)+v[6]+76029189|0,x=(x<<23|x>>>9)+E|0,b+=(x^E^_)+v[9]-640364487|0,b=(b<<4|b>>>28)+x|0,_+=(b^x^E)+v[12]-421815835|0,_=(_<<11|_>>>21)+b|0,E+=(_^b^x)+v[15]+530742520|0,E=(E<<16|E>>>16)+_|0,x+=(E^_^b)+v[2]-995338651|0,x=(x<<23|x>>>9)+E|0,b+=(E^(x|~_))+v[0]-198630844|0,b=(b<<6|b>>>26)+x|0,_+=(x^(b|~E))+v[7]+1126891415|0,_=(_<<10|_>>>22)+b|0,E+=(b^(_|~x))+v[14]-1416354905|0,E=(E<<15|E>>>17)+_|0,x+=(_^(E|~b))+v[5]-57434055|0,x=(x<<21|x>>>11)+E|0,b+=(E^(x|~_))+v[12]+1700485571|0,b=(b<<6|b>>>26)+x|0,_+=(x^(b|~E))+v[3]-1894986606|0,_=(_<<10|_>>>22)+b|0,E+=(b^(_|~x))+v[10]-1051523|0,E=(E<<15|E>>>17)+_|0,x+=(_^(E|~b))+v[1]-2054922799|0,x=(x<<21|x>>>11)+E|0,b+=(E^(x|~_))+v[8]+1873313359|0,b=(b<<6|b>>>26)+x|0,_+=(x^(b|~E))+v[15]-30611744|0,_=(_<<10|_>>>22)+b|0,E+=(b^(_|~x))+v[6]-1560198380|0,E=(E<<15|E>>>17)+_|0,x+=(_^(E|~b))+v[13]+1309151649|0,x=(x<<21|x>>>11)+E|0,b+=(E^(x|~_))+v[4]-145523070|0,b=(b<<6|b>>>26)+x|0,_+=(x^(b|~E))+v[11]-1120210379|0,_=(_<<10|_>>>22)+b|0,E+=(b^(_|~x))+v[2]+718787259|0,E=(E<<15|E>>>17)+_|0,x+=(_^(E|~b))+v[9]-343485551|0,x=(x<<21|x>>>11)+E|0,y[0]=b+y[0]|0,y[1]=x+y[1]|0,y[2]=E+y[2]|0,y[3]=_+y[3]|0}function r(y){var v=[],b;for(b=0;b<64;b+=4)v[b>>2]=y.charCodeAt(b)+(y.charCodeAt(b+1)<<8)+(y.charCodeAt(b+2)<<16)+(y.charCodeAt(b+3)<<24);return v}function o(y){var v=[],b;for(b=0;b<64;b+=4)v[b>>2]=y[b]+(y[b+1]<<8)+(y[b+2]<<16)+(y[b+3]<<24);return v}function a(y){var v=y.length,b=[1732584193,-271733879,-1732584194,271733878],x,E,_,L,N,Y;for(x=64;x<=v;x+=64)i(b,r(y.substring(x-64,x)));for(y=y.substring(x-64),E=y.length,_=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],x=0;x<E;x+=1)_[x>>2]|=y.charCodeAt(x)<<(x%4<<3);if(_[x>>2]|=128<<(x%4<<3),x>55)for(i(b,_),x=0;x<16;x+=1)_[x]=0;return L=v*8,L=L.toString(16).match(/(.*?)(.{0,8})$/),N=parseInt(L[2],16),Y=parseInt(L[1],16)||0,_[14]=N,_[15]=Y,i(b,_),b}function h(y){var v=y.length,b=[1732584193,-271733879,-1732584194,271733878],x,E,_,L,N,Y;for(x=64;x<=v;x+=64)i(b,o(y.subarray(x-64,x)));for(y=x-64<v?y.subarray(x-64):new Uint8Array(0),E=y.length,_=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],x=0;x<E;x+=1)_[x>>2]|=y[x]<<(x%4<<3);if(_[x>>2]|=128<<(x%4<<3),x>55)for(i(b,_),x=0;x<16;x+=1)_[x]=0;return L=v*8,L=L.toString(16).match(/(.*?)(.{0,8})$/),N=parseInt(L[2],16),Y=parseInt(L[1],16)||0,_[14]=N,_[15]=Y,i(b,_),b}function c(y){var v="",b;for(b=0;b<4;b+=1)v+=n[y>>b*8+4&15]+n[y>>b*8&15];return v}function l(y){var v;for(v=0;v<y.length;v+=1)y[v]=c(y[v]);return y.join("")}l(a("hello")),typeof ArrayBuffer<"u"&&!ArrayBuffer.prototype.slice&&function(){function y(v,b){return v=v|0||0,v<0?Math.max(v+b,0):Math.min(v,b)}ArrayBuffer.prototype.slice=function(v,b){var x=this.byteLength,E=y(v,x),_=x,L,N,Y,G;return b!==e&&(_=y(b,x)),E>_?new ArrayBuffer(0):(L=_-E,N=new ArrayBuffer(L),Y=new Uint8Array(N),G=new Uint8Array(this,E,L),Y.set(G),N)}}();function u(y){return/[\u0080-\uFFFF]/.test(y)&&(y=unescape(encodeURIComponent(y))),y}function d(y,v){var b=y.length,x=new ArrayBuffer(b),E=new Uint8Array(x),_;for(_=0;_<b;_+=1)E[_]=y.charCodeAt(_);return v?E:x}function f(y){return String.fromCharCode.apply(null,new Uint8Array(y))}function p(y,v,b){var x=new Uint8Array(y.byteLength+v.byteLength);return x.set(new Uint8Array(y)),x.set(new Uint8Array(v),y.byteLength),b?x:x.buffer}function g(y){var v=[],b=y.length,x;for(x=0;x<b-1;x+=2)v.push(parseInt(y.substr(x,2),16));return String.fromCharCode.apply(String,v)}function C(){this.reset()}return C.prototype.append=function(y){return this.appendBinary(u(y)),this},C.prototype.appendBinary=function(y){this._buff+=y,this._length+=y.length;var v=this._buff.length,b;for(b=64;b<=v;b+=64)i(this._hash,r(this._buff.substring(b-64,b)));return this._buff=this._buff.substring(b-64),this},C.prototype.end=function(y){var v=this._buff,b=v.length,x,E=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],_;for(x=0;x<b;x+=1)E[x>>2]|=v.charCodeAt(x)<<(x%4<<3);return this._finish(E,b),_=l(this._hash),y&&(_=g(_)),this.reset(),_},C.prototype.reset=function(){return this._buff="",this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},C.prototype.getState=function(){return{buff:this._buff,length:this._length,hash:this._hash.slice()}},C.prototype.setState=function(y){return this._buff=y.buff,this._length=y.length,this._hash=y.hash,this},C.prototype.destroy=function(){delete this._hash,delete this._buff,delete this._length},C.prototype._finish=function(y,v){var b=v,x,E,_;if(y[b>>2]|=128<<(b%4<<3),b>55)for(i(this._hash,y),b=0;b<16;b+=1)y[b]=0;x=this._length*8,x=x.toString(16).match(/(.*?)(.{0,8})$/),E=parseInt(x[2],16),_=parseInt(x[1],16)||0,y[14]=E,y[15]=_,i(this._hash,y)},C.hash=function(y,v){return C.hashBinary(u(y),v)},C.hashBinary=function(y,v){var b=a(y),x=l(b);return v?g(x):x},C.ArrayBuffer=function(){this.reset()},C.ArrayBuffer.prototype.append=function(y){var v=p(this._buff.buffer,y,!0),b=v.length,x;for(this._length+=y.byteLength,x=64;x<=b;x+=64)i(this._hash,o(v.subarray(x-64,x)));return this._buff=x-64<b?new Uint8Array(v.buffer.slice(x-64)):new Uint8Array(0),this},C.ArrayBuffer.prototype.end=function(y){var v=this._buff,b=v.length,x=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],E,_;for(E=0;E<b;E+=1)x[E>>2]|=v[E]<<(E%4<<3);return this._finish(x,b),_=l(this._hash),y&&(_=g(_)),this.reset(),_},C.ArrayBuffer.prototype.reset=function(){return this._buff=new Uint8Array(0),this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},C.ArrayBuffer.prototype.getState=function(){var y=C.prototype.getState.call(this);return y.buff=f(y.buff),y},C.ArrayBuffer.prototype.setState=function(y){return y.buff=d(y.buff,!0),C.prototype.setState.call(this,y)},C.ArrayBuffer.prototype.destroy=C.prototype.destroy,C.ArrayBuffer.prototype._finish=C.prototype._finish,C.ArrayBuffer.hash=function(y,v){var b=h(new Uint8Array(y)),x=l(b);return v?g(x):x},C})})(Gh);var Qm=Gh.exports;const tp=$h(Qm),ep=Bf&&window.File&&window.FileReader&&window.FileList&&window.Blob;function np(s='script[type="text/js-worker"]'){return Array.prototype.map.call(document.querySelectorAll(s),t=>t.textContent)}const dr=s=>new XMLSerializer().serializeToString(s),sp=(s,t="text/html")=>new DOMParser().parseFromString(s,t),mr=(s,t={mime:Et.SVG,encode:ys.utf8})=>Bi(dr(s),t);async function pr(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 Bn(s,t=Ut.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 Ut.dataURL:r.readAsDataURL(s);break;case Ut.binaryString:r.readAsBinaryString(s);break;case Ut.arraybuffer:r.readAsArrayBuffer(s);break;case Ut.text:default:r.readAsText(s)}})}async function ip(s){const t=await Bn(s,Ut.arraybuffer);return Yf(t)}const rp=s=>{let t;return s instanceof File?t=s.name:t=s,t.match(/\.([0-9a-z]+)(?:[\\?#]|$)/i)?.[1]||""};function op(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 Vh(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)Vh(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 qh(s,t=1048576){return await new Promise((e,n)=>Vh(e,n,new tp.ArrayBuffer,s,t,0,Math.min(t,s.size)))}class hp{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 Uh({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 qh(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(()=>{zf(this.time,1),this.onTime?.(Lf(this.time))},1e3)}stopTimeCount(){this.timer&&(clearInterval(this.timer),this.timer=void 0)}}var jh={exports:{}};/*! Hammer.JS - v2.0.7 - 2016-04-22
|
|
19
19
|
* http://hammerjs.github.io/
|
|
20
20
|
*
|
|
21
21
|
* Copyright (c) 2016 Jorik Tangelder;
|
|
22
|
-
* Licensed under the MIT license */(function(
|
|
23
|
-
`+
|
|
24
|
-
`;return function(){var k=new Error("get-stack-trace"),z=k&&k.stack?k.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",j=t.console&&(t.console.warn||t.console.log);return j&&j.call(t.console,M,z),g.apply(this,arguments)}}var y;typeof Object.assign!="function"?y=function(_){if(_===i||_===null)throw new TypeError("Cannot convert undefined or null to object");for(var E=Object(_),M=1;M<arguments.length;M++){var k=arguments[M];if(k!==i&&k!==null)for(var z in k)k.hasOwnProperty(z)&&(E[z]=k[z])}return E}:y=Object.assign;var S=p(function(_,E,M){for(var k=Object.keys(E),z=0;z<k.length;)(!M||M&&_[k[z]]===i)&&(_[k[z]]=E[k[z]]),z++;return _},"extend","Use `assign`."),w=p(function(_,E){return S(_,E,!0)},"merge","Use `assign`.");function v(g,_,E){var M=_.prototype,k;k=g.prototype=Object.create(M),k.constructor=g,k._super=M,E&&y(k,E)}function x(g,_){return function(){return g.apply(_,arguments)}}function b(g,_){return typeof g==a?g.apply(_&&_[0]||i,_):g}function P(g,_){return g===i?_:g}function C(g,_,E){f(V(_),function(M){g.addEventListener(M,E,!1)})}function D(g,_,E){f(V(_),function(M){g.removeEventListener(M,E,!1)})}function B(g,_){for(;g;){if(g==_)return!0;g=g.parentNode}return!1}function Y(g,_){return g.indexOf(_)>-1}function V(g){return g.trim().split(/\s+/g)}function G(g,_,E){if(g.indexOf&&!E)return g.indexOf(_);for(var M=0;M<g.length;){if(E&&g[M][E]==_||!E&&g[M]===_)return M;M++}return-1}function J(g){return Array.prototype.slice.call(g,0)}function it(g,_,E){for(var M=[],k=[],z=0;z<g.length;){var j=_?g[z][_]:g[z];G(k,j)<0&&M.push(g[z]),k[z]=j,z++}return E&&(_?M=M.sort(function(bt,It){return bt[_]>It[_]}):M=M.sort()),M}function tt(g,_){for(var E,M,k=_[0].toUpperCase()+_.slice(1),z=0;z<r.length;){if(E=r[z],M=E?E+k:_,M in g)return M;z++}return i}var Kt=1;function Xt(){return Kt++}function Vt(g){var _=g.ownerDocument||g;return _.defaultView||_.parentWindow||t}var te=/mobile|tablet|ip(ad|hone|od)|android/i,R="ontouchstart"in t,L=tt(t,"PointerEvent")!==i,U=R&&te.test(navigator.userAgent),Z="touch",At="pen",ee="mouse",fi="kinect",di=25,gt=1,he=2,rt=4,Ct=8,Cs=1,ns=2,is=4,Ne=8,I=16,at=ns|is,rs=Ne|I,gu=at|rs,yu=["x","y"],mi=["clientX","clientY"];function Gt(g,_){var E=this;this.manager=g,this.callback=_,this.element=g.element,this.target=g.options.inputTarget,this.domHandler=function(M){b(g.options.enable,[g])&&E.handler(M)},this.init()}Gt.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(Vt(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&D(this.element,this.evEl,this.domHandler),this.evTarget&&D(this.target,this.evTarget,this.domHandler),this.evWin&&D(Vt(this.element),this.evWin,this.domHandler)}};function Bx(g){var _,E=g.options.inputClass;return E?_=E:L?_=oa:U?_=yi:R?_=aa:_=gi,new _(g,Nx)}function Nx(g,_,E){var M=E.pointers.length,k=E.changedPointers.length,z=_>&&M-k===0,j=_&(rt|Ct)&&M-k===0;E.isFirst=!!z,E.isFinal=!!j,z&&(g.session={}),E.eventType=_,Fx(g,E),g.emit("hammer.input",E),g.recognize(E),g.session.prevInput=E}function Fx(g,_){var E=g.session,M=_.pointers,k=M.length;E.firstInput||(E.firstInput=wu(_)),k>1&&!E.firstMultiple?E.firstMultiple=wu(_):k===1&&(E.firstMultiple=!1);var z=E.firstInput,j=E.firstMultiple,yt=j?j.center:z.center,bt=_.center=xu(M);_.timeStamp=l(),_.deltaTime=_.timeStamp-z.timeStamp,_.angle=ra(yt,bt),_.distance=pi(yt,bt),Yx(E,_),_.offsetDirection=vu(_.deltaX,_.deltaY);var It=bu(_.deltaTime,_.deltaX,_.deltaY);_.overallVelocityX=It.x,_.overallVelocityY=It.y,_.overallVelocity=c(It.x)>c(It.y)?It.x:It.y,_.scale=j?$x(j.pointers,M):1,_.rotation=j?Ux(j.pointers,M):0,_.maxPointers=E.prevInput?_.pointers.length>E.prevInput.maxPointers?_.pointers.length:E.prevInput.maxPointers:_.pointers.length,Xx(E,_);var le=g.element;B(_.srcEvent.target,le)&&(le=_.srcEvent.target),_.target=le}function Yx(g,_){var E=_.center,M=g.offsetDelta||{},k=g.prevDelta||{},z=g.prevInput||{};(_.eventType===gt||z.eventType===rt)&&(k=g.prevDelta={x:z.deltaX||0,y:z.deltaY||0},M=g.offsetDelta={x:E.x,y:E.y}),_.deltaX=k.x+(E.x-M.x),_.deltaY=k.y+(E.y-M.y)}function Xx(g,_){var E=g.lastInterval||_,M=_.timeStamp-E.timeStamp,k,z,j,yt;if(_.eventType!=Ct&&(M>di||E.velocity===i)){var bt=_.deltaX-E.deltaX,It=_.deltaY-E.deltaY,le=bu(M,bt,It);z=le.x,j=le.y,k=c(le.x)>c(le.y)?le.x:le.y,yt=vu(bt,It),g.lastInterval=_}else k=E.velocity,z=E.velocityX,j=E.velocityY,yt=E.direction;_.velocity=k,_.velocityX=z,_.velocityY=j,_.direction=yt}function wu(g){for(var _=[],E=0;E<g.pointers.length;)_[E]={clientX:h(g.pointers[E].clientX),clientY:h(g.pointers[E].clientY)},E++;return{timeStamp:l(),pointers:_,center:xu(_),deltaX:g.deltaX,deltaY:g.deltaY}}function xu(g){var _=g.length;if(_===1)return{x:h(g[0].clientX),y:h(g[0].clientY)};for(var E=0,M=0,k=0;k<_;)E+=g[k].clientX,M+=g[k].clientY,k++;return{x:h(E/_),y:h(M/_)}}function bu(g,_,E){return{x:_/g||0,y:E/g||0}}function vu(g,_){return g===_?Cs:c(g)>=c(_)?g<0?ns:is:_<0?Ne:I}function pi(g,_,E){E||(E=yu);var M=_[E[0]]-g[E[0]],k=_[E[1]]-g[E[1]];return Math.sqrt(M*M+k*k)}function ra(g,_,E){E||(E=yu);var M=_[E[0]]-g[E[0]],k=_[E[1]]-g[E[1]];return Math.atan2(k,M)*180/Math.PI}function Ux(g,_){return ra(_[1],_[0],mi)+ra(g[1],g[0],mi)}function $x(g,_){return pi(_[0],_[1],mi)/pi(g[0],g[1],mi)}var Vx={mousedown:gt,mousemove:he,mouseup:rt},Gx="mousedown",qx="mousemove mouseup";function gi(){this.evEl=Gx,this.evWin=qx,this.pressed=!1,Gt.apply(this,arguments)}v(gi,Gt,{handler:function(_){var E=Vx[_.type];E>&&_.button===0&&(this.pressed=!0),E&he&&_.which!==1&&(E=rt),this.pressed&&(E&rt&&(this.pressed=!1),this.callback(this.manager,E,{pointers:[_],changedPointers:[_],pointerType:ee,srcEvent:_}))}});var jx={pointerdown:gt,pointermove:he,pointerup:rt,pointercancel:Ct,pointerout:Ct},Hx={2:Z,3:At,4:ee,5:fi},Su="pointerdown",_u="pointermove pointerup pointercancel";t.MSPointerEvent&&!t.PointerEvent&&(Su="MSPointerDown",_u="MSPointerMove MSPointerUp MSPointerCancel");function oa(){this.evEl=Su,this.evWin=_u,Gt.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}v(oa,Gt,{handler:function(_){var E=this.store,M=!1,k=_.type.toLowerCase().replace("ms",""),z=jx[k],j=Hx[_.pointerType]||_.pointerType,yt=j==Z,bt=G(E,_.pointerId,"pointerId");z>&&(_.button===0||yt)?bt<0&&(E.push(_),bt=E.length-1):z&(rt|Ct)&&(M=!0),!(bt<0)&&(E[bt]=_,this.callback(this.manager,z,{pointers:E,changedPointers:[_],pointerType:j,srcEvent:_}),M&&E.splice(bt,1))}});var Wx={touchstart:gt,touchmove:he,touchend:rt,touchcancel:Ct},Jx="touchstart",Zx="touchstart touchmove touchend touchcancel";function Cu(){this.evTarget=Jx,this.evWin=Zx,this.started=!1,Gt.apply(this,arguments)}v(Cu,Gt,{handler:function(_){var E=Wx[_.type];if(E===gt&&(this.started=!0),!!this.started){var M=Qx.call(this,_,E);E&(rt|Ct)&&M[0].length-M[1].length===0&&(this.started=!1),this.callback(this.manager,E,{pointers:M[0],changedPointers:M[1],pointerType:Z,srcEvent:_})}}});function Qx(g,_){var E=J(g.touches),M=J(g.changedTouches);return _&(rt|Ct)&&(E=it(E.concat(M),"identifier",!0)),[E,M]}var Kx={touchstart:gt,touchmove:he,touchend:rt,touchcancel:Ct},tb="touchstart touchmove touchend touchcancel";function yi(){this.evTarget=tb,this.targetIds={},Gt.apply(this,arguments)}v(yi,Gt,{handler:function(_){var E=Kx[_.type],M=eb.call(this,_,E);M&&this.callback(this.manager,E,{pointers:M[0],changedPointers:M[1],pointerType:Z,srcEvent:_})}});function eb(g,_){var E=J(g.touches),M=this.targetIds;if(_&(gt|he)&&E.length===1)return M[E[0].identifier]=!0,[E,E];var k,z,j=J(g.changedTouches),yt=[],bt=this.target;if(z=E.filter(function(It){return B(It.target,bt)}),_===gt)for(k=0;k<z.length;)M[z[k].identifier]=!0,k++;for(k=0;k<j.length;)M[j[k].identifier]&&yt.push(j[k]),_&(rt|Ct)&&delete M[j[k].identifier],k++;if(yt.length)return[it(z.concat(yt),"identifier",!0),yt]}var sb=2500,Tu=25;function aa(){Gt.apply(this,arguments);var g=x(this.handler,this);this.touch=new yi(this.manager,g),this.mouse=new gi(this.manager,g),this.primaryTouch=null,this.lastTouches=[]}v(aa,Gt,{handler:function(_,E,M){var k=M.pointerType==Z,z=M.pointerType==ee;if(!(z&&M.sourceCapabilities&&M.sourceCapabilities.firesTouchEvents)){if(k)nb.call(this,E,M);else if(z&&ib.call(this,M))return;this.callback(_,E,M)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});function nb(g,_){g>?(this.primaryTouch=_.changedPointers[0].identifier,Pu.call(this,_)):g&(rt|Ct)&&Pu.call(this,_)}function Pu(g){var _=g.changedPointers[0];if(_.identifier===this.primaryTouch){var E={x:_.clientX,y:_.clientY};this.lastTouches.push(E);var M=this.lastTouches,k=function(){var z=M.indexOf(E);z>-1&&M.splice(z,1)};setTimeout(k,sb)}}function ib(g){for(var _=g.srcEvent.clientX,E=g.srcEvent.clientY,M=0;M<this.lastTouches.length;M++){var k=this.lastTouches[M],z=Math.abs(_-k.x),j=Math.abs(E-k.y);if(z<=Tu&&j<=Tu)return!0}return!1}var Eu=tt(o.style,"touchAction"),Mu=Eu!==i,Au="compute",Iu="auto",ha="manipulation",os="none",ln="pan-x",un="pan-y",wi=ob();function ca(g,_){this.manager=g,this.set(_)}ca.prototype={set:function(g){g==Au&&(g=this.compute()),Mu&&this.manager.element.style&&wi[g]&&(this.manager.element.style[Eu]=g),this.actions=g.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var g=[];return f(this.manager.recognizers,function(_){b(_.options.enable,[_])&&(g=g.concat(_.getTouchAction()))}),rb(g.join(" "))},preventDefaults:function(g){var _=g.srcEvent,E=g.offsetDirection;if(this.manager.session.prevented){_.preventDefault();return}var M=this.actions,k=Y(M,os)&&!wi[os],z=Y(M,un)&&!wi[un],j=Y(M,ln)&&!wi[ln];if(k){var yt=g.pointers.length===1,bt=g.distance<2,It=g.deltaTime<250;if(yt&&bt&&It)return}if(!(j&&z)&&(k||z&&E&at||j&&E&rs))return this.preventSrc(_)},preventSrc:function(g){this.manager.session.prevented=!0,g.preventDefault()}};function rb(g){if(Y(g,os))return os;var _=Y(g,ln),E=Y(g,un);return _&&E?os:_||E?_?ln:un:Y(g,ha)?ha:Iu}function ob(){if(!Mu)return!1;var g={},_=t.CSS&&t.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(E){g[E]=_?t.CSS.supports("touch-action",E):!0}),g}var xi=1,qt=2,Ts=4,Fe=8,be=Fe,fn=16,ce=32;function ve(g){this.options=y({},this.defaults,g||{}),this.id=Xt(),this.manager=null,this.options.enable=P(this.options.enable,!0),this.state=xi,this.simultaneous={},this.requireFail=[]}ve.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 _=this.simultaneous;return g=bi(g,this),_[g.id]||(_[g.id]=g,g.recognizeWith(this)),this},dropRecognizeWith:function(g){return m(g,"dropRecognizeWith",this)?this:(g=bi(g,this),delete this.simultaneous[g.id],this)},requireFailure:function(g){if(m(g,"requireFailure",this))return this;var _=this.requireFail;return g=bi(g,this),G(_,g)===-1&&(_.push(g),g.requireFailure(this)),this},dropRequireFailure:function(g){if(m(g,"dropRequireFailure",this))return this;g=bi(g,this);var _=G(this.requireFail,g);return _>-1&&this.requireFail.splice(_,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(g){return!!this.simultaneous[g.id]},emit:function(g){var _=this,E=this.state;function M(k){_.manager.emit(k,g)}E<Fe&&M(_.options.event+ku(E)),M(_.options.event),g.additionalEvent&&M(g.additionalEvent),E>=Fe&&M(_.options.event+ku(E))},tryEmit:function(g){if(this.canEmit())return this.emit(g);this.state=ce},canEmit:function(){for(var g=0;g<this.requireFail.length;){if(!(this.requireFail[g].state&(ce|xi)))return!1;g++}return!0},recognize:function(g){var _=y({},g);if(!b(this.options.enable,[this,_])){this.reset(),this.state=ce;return}this.state&(be|fn|ce)&&(this.state=xi),this.state=this.process(_),this.state&(qt|Ts|Fe|fn)&&this.tryEmit(_)},process:function(g){},getTouchAction:function(){},reset:function(){}};function ku(g){return g&fn?"cancel":g&Fe?"end":g&Ts?"move":g&qt?"start":""}function Du(g){return g==I?"down":g==Ne?"up":g==ns?"left":g==is?"right":""}function bi(g,_){var E=_.manager;return E?E.get(g):g}function se(){ve.apply(this,arguments)}v(se,ve,{defaults:{pointers:1},attrTest:function(g){var _=this.options.pointers;return _===0||g.pointers.length===_},process:function(g){var _=this.state,E=g.eventType,M=_&(qt|Ts),k=this.attrTest(g);return M&&(E&Ct||!k)?_|fn:M||k?E&rt?_|Fe:_&qt?_|Ts:qt:ce}});function vi(){se.apply(this,arguments),this.pX=null,this.pY=null}v(vi,se,{defaults:{event:"pan",threshold:10,pointers:1,direction:gu},getTouchAction:function(){var g=this.options.direction,_=[];return g&at&&_.push(un),g&rs&&_.push(ln),_},directionTest:function(g){var _=this.options,E=!0,M=g.distance,k=g.direction,z=g.deltaX,j=g.deltaY;return k&_.direction||(_.direction&at?(k=z===0?Cs:z<0?ns:is,E=z!=this.pX,M=Math.abs(g.deltaX)):(k=j===0?Cs:j<0?Ne:I,E=j!=this.pY,M=Math.abs(g.deltaY))),g.direction=k,E&&M>_.threshold&&k&_.direction},attrTest:function(g){return se.prototype.attrTest.call(this,g)&&(this.state&qt||!(this.state&qt)&&this.directionTest(g))},emit:function(g){this.pX=g.deltaX,this.pY=g.deltaY;var _=Du(g.direction);_&&(g.additionalEvent=this.options.event+_),this._super.emit.call(this,g)}});function la(){se.apply(this,arguments)}v(la,se,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[os]},attrTest:function(g){return this._super.attrTest.call(this,g)&&(Math.abs(g.scale-1)>this.options.threshold||this.state&qt)},emit:function(g){if(g.scale!==1){var _=g.scale<1?"in":"out";g.additionalEvent=this.options.event+_}this._super.emit.call(this,g)}});function ua(){ve.apply(this,arguments),this._timer=null,this._input=null}v(ua,ve,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[Iu]},process:function(g){var _=this.options,E=g.pointers.length===_.pointers,M=g.distance<_.threshold,k=g.deltaTime>_.time;if(this._input=g,!M||!E||g.eventType&(rt|Ct)&&!k)this.reset();else if(g.eventType>)this.reset(),this._timer=u(function(){this.state=be,this.tryEmit()},_.time,this);else if(g.eventType&rt)return be;return ce},reset:function(){clearTimeout(this._timer)},emit:function(g){this.state===be&&(g&&g.eventType&rt?this.manager.emit(this.options.event+"up",g):(this._input.timeStamp=l(),this.manager.emit(this.options.event,this._input)))}});function fa(){se.apply(this,arguments)}v(fa,se,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[os]},attrTest:function(g){return this._super.attrTest.call(this,g)&&(Math.abs(g.rotation)>this.options.threshold||this.state&qt)}});function da(){se.apply(this,arguments)}v(da,se,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:at|rs,pointers:1},getTouchAction:function(){return vi.prototype.getTouchAction.call(this)},attrTest:function(g){var _=this.options.direction,E;return _&(at|rs)?E=g.overallVelocity:_&at?E=g.overallVelocityX:_&rs&&(E=g.overallVelocityY),this._super.attrTest.call(this,g)&&_&g.offsetDirection&&g.distance>this.options.threshold&&g.maxPointers==this.options.pointers&&c(E)>this.options.velocity&&g.eventType&rt},emit:function(g){var _=Du(g.offsetDirection);_&&this.manager.emit(this.options.event+_,g),this.manager.emit(this.options.event,g)}});function Si(){ve.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}v(Si,ve,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[ha]},process:function(g){var _=this.options,E=g.pointers.length===_.pointers,M=g.distance<_.threshold,k=g.deltaTime<_.time;if(this.reset(),g.eventType>&&this.count===0)return this.failTimeout();if(M&&k&&E){if(g.eventType!=rt)return this.failTimeout();var z=this.pTime?g.timeStamp-this.pTime<_.interval:!0,j=!this.pCenter||pi(this.pCenter,g.center)<_.posThreshold;this.pTime=g.timeStamp,this.pCenter=g.center,!j||!z?this.count=1:this.count+=1,this._input=g;var yt=this.count%_.taps;if(yt===0)return this.hasRequireFailures()?(this._timer=u(function(){this.state=be,this.tryEmit()},_.interval,this),qt):be}return ce},failTimeout:function(){return this._timer=u(function(){this.state=ce},this.options.interval,this),ce},reset:function(){clearTimeout(this._timer)},emit:function(){this.state==be&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}});function Se(g,_){return _=_||{},_.recognizers=P(_.recognizers,Se.defaults.preset),new ma(g,_)}Se.VERSION="2.0.7",Se.defaults={domEvents:!1,touchAction:Au,enable:!0,inputTarget:null,inputClass:null,preset:[[fa,{enable:!1}],[la,{enable:!1},["rotate"]],[da,{direction:at}],[vi,{direction:at},["swipe"]],[Si],[Si,{event:"doubletap",taps:2},["tap"]],[ua]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};var ab=1,Lu=2;function ma(g,_){this.options=y({},Se.defaults,_||{}),this.options.inputTarget=this.options.inputTarget||g,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=g,this.input=Bx(this),this.touchAction=new ca(this,this.options.touchAction),Ru(this,!0),f(this.options.recognizers,function(E){var M=this.add(new E[0](E[1]));E[2]&&M.recognizeWith(E[2]),E[3]&&M.requireFailure(E[3])},this)}ma.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?Lu:ab},recognize:function(g){var _=this.session;if(!_.stopped){this.touchAction.preventDefaults(g);var E,M=this.recognizers,k=_.curRecognizer;(!k||k&&k.state&be)&&(k=_.curRecognizer=null);for(var z=0;z<M.length;)E=M[z],_.stopped!==Lu&&(!k||E==k||E.canRecognizeWith(k))?E.recognize(g):E.reset(),!k&&E.state&(qt|Ts|Fe)&&(k=_.curRecognizer=E),z++}},get:function(g){if(g instanceof ve)return g;for(var _=this.recognizers,E=0;E<_.length;E++)if(_[E].options.event==g)return _[E];return null},add:function(g){if(m(g,"add",this))return this;var _=this.get(g.options.event);return _&&this.remove(_),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 _=this.recognizers,E=G(_,g);E!==-1&&(_.splice(E,1),this.touchAction.update())}return this},on:function(g,_){if(g!==i&&_!==i){var E=this.handlers;return f(V(g),function(M){E[M]=E[M]||[],E[M].push(_)}),this}},off:function(g,_){if(g!==i){var E=this.handlers;return f(V(g),function(M){_?E[M]&&E[M].splice(G(E[M],_),1):delete E[M]}),this}},emit:function(g,_){this.options.domEvents&&hb(g,_);var E=this.handlers[g]&&this.handlers[g].slice();if(!(!E||!E.length)){_.type=g,_.preventDefault=function(){_.srcEvent.preventDefault()};for(var M=0;M<E.length;)E[M](_),M++}},destroy:function(){this.element&&Ru(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}};function Ru(g,_){var E=g.element;if(E.style){var M;f(g.options.cssProps,function(k,z){M=tt(E.style,z),_?(g.oldCssProps[M]=E.style[M],E.style[M]=k):E.style[M]=g.oldCssProps[M]||""}),_||(g.oldCssProps={})}}function hb(g,_){var E=e.createEvent("Event");E.initEvent(g,!0,!0),E.gesture=_,_.target.dispatchEvent(E)}y(Se,{INPUT_START:gt,INPUT_MOVE:he,INPUT_END:rt,INPUT_CANCEL:Ct,STATE_POSSIBLE:xi,STATE_BEGAN:qt,STATE_CHANGED:Ts,STATE_ENDED:Fe,STATE_RECOGNIZED:be,STATE_CANCELLED:fn,STATE_FAILED:ce,DIRECTION_NONE:Cs,DIRECTION_LEFT:ns,DIRECTION_RIGHT:is,DIRECTION_UP:Ne,DIRECTION_DOWN:I,DIRECTION_HORIZONTAL:at,DIRECTION_VERTICAL:rs,DIRECTION_ALL:gu,Manager:ma,Input:Gt,TouchAction:ca,TouchInput:yi,MouseInput:gi,PointerEventInput:oa,TouchMouseInput:aa,SingleTouchInput:Cu,Recognizer:ve,AttrRecognizer:se,Tap:Si,Pan:vi,Swipe:da,Pinch:la,Rotate:fa,Press:ua,on:C,off:D,each:f,merge:w,extend:S,assign:y,inherit:v,bindFn:x,prefixed:tt});var cb=typeof t<"u"?t:typeof self<"u"?self:{};cb.Hammer=Se,typeof i=="function"&&i.amd?i(function(){return Se}):n.exports?n.exports=Se:t[s]=Se})(window,document,"Hammer")})(Oh);var Rm=Oh.exports;const et=Wa(Rm);var mr=function(n,t){return mr=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,s){e.__proto__=s}||function(e,s){for(var i in s)Object.prototype.hasOwnProperty.call(s,i)&&(e[i]=s[i])},mr(n,t)};function de(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");mr(n,t);function e(){this.constructor=n}n.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}function Om(n,t,e,s){function i(r){return r instanceof e?r:new e(function(o){o(r)})}return new(e||(e=Promise))(function(r,o){function a(l){try{c(s.next(l))}catch(u){o(u)}}function h(l){try{c(s.throw(l))}catch(u){o(u)}}function c(l){l.done?r(l.value):i(l.value).then(a,h)}c((s=s.apply(n,t||[])).next())})}function zh(n,t){var e={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},s,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(l){return h([c,l])}}function h(c){if(s)throw new TypeError("Generator is already executing.");for(;o&&(o=0,c[0]&&(e=0)),e;)try{if(s=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(n,e)}catch(l){c=[6,l],i=0}finally{s=r=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}function $e(n){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&n[t],s=0;if(e)return e.call(n);if(n&&typeof n.length=="number")return{next:function(){return n&&s>=n.length&&(n=void 0),{value:n&&n[s++],done:!n}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function Ce(n,t){var e=typeof Symbol=="function"&&n[Symbol.iterator];if(!e)return n;var s=e.call(n),i,r=[],o;try{for(;(t===void 0||t-- >0)&&!(i=s.next()).done;)r.push(i.value)}catch(a){o={error:a}}finally{try{i&&!i.done&&(e=s.return)&&e.call(s)}finally{if(o)throw o.error}}return r}function Ve(n,t,e){if(e||arguments.length===2)for(var s=0,i=t.length,r;s<i;s++)(r||!(s in t))&&(r||(r=Array.prototype.slice.call(t,0,s)),r[s]=t[s]);return n.concat(r||Array.prototype.slice.call(t))}function us(n){return this instanceof us?(this.v=n,this):new us(n)}function zm(n,t,e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var s=e.apply(n,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,u)}}function a(f,p){s[f]&&(i[f]=function(y){return new Promise(function(S,w){r.push([f,y,S,w])>1||h(f,y)})},p&&(i[f]=p(i[f])))}function h(f,p){try{c(s[f](p))}catch(y){m(r[0][3],y)}}function c(f){f.value instanceof us?Promise.resolve(f.value.v).then(l,u):m(r[0][2],f)}function l(f){h("next",f)}function u(f){h("throw",f)}function m(f,p){f(p),r.shift(),r.length&&h(r[0][0],r[0][1])}}function Bm(n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=n[Symbol.asyncIterator],e;return t?t.call(n):(n=typeof $e=="function"?$e(n):n[Symbol.iterator](),e={},s("next"),s("throw"),s("return"),e[Symbol.asyncIterator]=function(){return this},e);function s(r){e[r]=n[r]&&function(o){return new Promise(function(a,h){o=n[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 H(n){return typeof n=="function"}function pr(n){var t=function(s){Error.call(s),s.stack=new Error().stack},e=n(t);return e.prototype=Object.create(Error.prototype),e.prototype.constructor=e,e}var gr=pr(function(n){return function(e){n(this),this.message=e?e.length+` errors occurred during unsubscription:
|
|
25
|
-
`+e.map(function(
|
|
26
|
-
`):"",this.name="UnsubscriptionError",this.errors=e}});function Bs(n,t){if(n){var e=n.indexOf(t);0<=e&&n.splice(e,1)}}var fs=function(){function n(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}return n.prototype.unsubscribe=function(){var t,e,s,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=$e(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 l=this.initialTeardown;if(H(l))try{l()}catch(y){r=y instanceof gr?y.errors:[y]}var u=this._finalizers;if(u){this._finalizers=null;try{for(var m=$e(u),f=m.next();!f.done;f=m.next()){var p=f.value;try{Fh(p)}catch(y){r=r??[],y instanceof gr?r=Ve(Ve([],Ce(r)),Ce(y.errors)):r.push(y)}}}catch(y){s={error:y}}finally{try{f&&!f.done&&(i=m.return)&&i.call(m)}finally{if(s)throw s.error}}}if(r)throw new gr(r)}},n.prototype.add=function(t){var e;if(t&&t!==this)if(this.closed)Fh(t);else{if(t instanceof n){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=(e=this._finalizers)!==null&&e!==void 0?e:[]).push(t)}},n.prototype._hasParent=function(t){var e=this._parentage;return e===t||Array.isArray(e)&&e.includes(t)},n.prototype._addParent=function(t){var e=this._parentage;this._parentage=Array.isArray(e)?(e.push(t),e):e?[e,t]:t},n.prototype._removeParent=function(t){var e=this._parentage;e===t?this._parentage=null:Array.isArray(e)&&Bs(e,t)},n.prototype.remove=function(t){var e=this._finalizers;e&&Bs(e,t),t instanceof n&&t._removeParent(this)},n.EMPTY=function(){var t=new n;return t.closed=!0,t}(),n}(),Bh=fs.EMPTY;function Nh(n){return n instanceof fs||n&&"closed"in n&&H(n.remove)&&H(n.add)&&H(n.unsubscribe)}function Fh(n){H(n)?n():n.unsubscribe()}var Yh={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},yr={setTimeout:function(n,t){for(var e=[],s=2;s<arguments.length;s++)e[s-2]=arguments[s];var i=yr.delegate;return i?.setTimeout?i.setTimeout.apply(i,Ve([n,t],Ce(e))):setTimeout.apply(void 0,Ve([n,t],Ce(e)))},clearTimeout:function(n){var t=yr.delegate;return(t?.clearTimeout||clearTimeout)(n)},delegate:void 0};function Xh(n){yr.setTimeout(function(){throw n})}function Ns(){}function Nn(n){n()}var wr=function(n){de(t,n);function t(e){var s=n.call(this)||this;return s.isStopped=!1,e?(s.destination=e,Nh(e)&&e.add(s)):s.destination=Xm,s}return t.create=function(e,s,i){return new Fn(e,s,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,n.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}(fs),Nm=Function.prototype.bind;function xr(n,t){return Nm.call(n,t)}var Fm=function(){function n(t){this.partialObserver=t}return n.prototype.next=function(t){var e=this.partialObserver;if(e.next)try{e.next(t)}catch(s){Yn(s)}},n.prototype.error=function(t){var e=this.partialObserver;if(e.error)try{e.error(t)}catch(s){Yn(s)}else Yn(t)},n.prototype.complete=function(){var t=this.partialObserver;if(t.complete)try{t.complete()}catch(e){Yn(e)}},n}(),Fn=function(n){de(t,n);function t(e,s,i){var r=n.call(this)||this,o;if(H(e)||!e)o={next:e??void 0,error:s??void 0,complete:i??void 0};else{var a;r&&Yh.useDeprecatedNextContext?(a=Object.create(e),a.unsubscribe=function(){return r.unsubscribe()},o={next:e.next&&xr(e.next,a),error:e.error&&xr(e.error,a),complete:e.complete&&xr(e.complete,a)}):o=e}return r.destination=new Fm(o),r}return t}(wr);function Yn(n){Xh(n)}function Ym(n){throw n}var Xm={closed:!0,next:Ns,error:Ym,complete:Ns},br=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function Ge(n){return n}function Um(n){return n.length===0?Ge:n.length===1?n[0]:function(e){return n.reduce(function(s,i){return i(s)},e)}}var st=function(){function n(t){t&&(this._subscribe=t)}return n.prototype.lift=function(t){var e=new n;return e.source=this,e.operator=t,e},n.prototype.subscribe=function(t,e,s){var i=this,r=Vm(t)?t:new Fn(t,e,s);return Nn(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},n.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(e){t.error(e)}},n.prototype.forEach=function(t,e){var s=this;return e=Uh(e),new e(function(i,r){var o=new Fn({next:function(a){try{t(a)}catch(h){r(h),o.unsubscribe()}},error:r,complete:i});s.subscribe(o)})},n.prototype._subscribe=function(t){var e;return(e=this.source)===null||e===void 0?void 0:e.subscribe(t)},n.prototype[br]=function(){return this},n.prototype.pipe=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Um(t)(this)},n.prototype.toPromise=function(t){var e=this;return t=Uh(t),new t(function(s,i){var r;e.subscribe(function(o){return r=o},function(o){return i(o)},function(){return s(r)})})},n.create=function(t){return new n(t)},n}();function Uh(n){var t;return(t=n??Yh.Promise)!==null&&t!==void 0?t:Promise}function $m(n){return n&&H(n.next)&&H(n.error)&&H(n.complete)}function Vm(n){return n&&n instanceof wr||$m(n)&&Nh(n)}function Gm(n){return H(n?.lift)}function Ot(n){return function(t){if(Gm(t))return t.lift(function(e){try{return n(e,this)}catch(s){this.error(s)}});throw new TypeError("Unable to lift unknown Observable type")}}function ft(n,t,e,s,i){return new qm(n,t,e,s,i)}var qm=function(n){de(t,n);function t(e,s,i,r,o,a){var h=n.call(this,e)||this;return h.onFinalize=o,h.shouldUnsubscribe=a,h._next=s?function(c){try{s(c)}catch(l){e.error(l)}}:n.prototype._next,h._error=r?function(c){try{r(c)}catch(l){e.error(l)}finally{this.unsubscribe()}}:n.prototype._error,h._complete=i?function(){try{i()}catch(c){e.error(c)}finally{this.unsubscribe()}}:n.prototype._complete,h}return t.prototype.unsubscribe=function(){var e;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var s=this.closed;n.prototype.unsubscribe.call(this),!s&&((e=this.onFinalize)===null||e===void 0||e.call(this))}},t}(wr),jm=pr(function(n){return function(){n(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),ds=function(n){de(t,n);function t(){var e=n.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 s=new $h(this,this);return s.operator=e,s},t.prototype._throwIfClosed=function(){if(this.closed)throw new jm},t.prototype.next=function(e){var s=this;Nn(function(){var i,r;if(s._throwIfClosed(),!s.isStopped){s.currentObservers||(s.currentObservers=Array.from(s.observers));try{for(var o=$e(s.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 s=this;Nn(function(){if(s._throwIfClosed(),!s.isStopped){s.hasError=s.isStopped=!0,s.thrownError=e;for(var i=s.observers;i.length;)i.shift().error(e)}})},t.prototype.complete=function(){var e=this;Nn(function(){if(e._throwIfClosed(),!e.isStopped){e.isStopped=!0;for(var s=e.observers;s.length;)s.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(),n.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 s=this,i=this,r=i.hasError,o=i.isStopped,a=i.observers;return r||o?Bh:(this.currentObservers=null,a.push(e),new fs(function(){s.currentObservers=null,Bs(a,e)}))},t.prototype._checkFinalizedStatuses=function(e){var s=this,i=s.hasError,r=s.thrownError,o=s.isStopped;i?e.error(r):o&&e.complete()},t.prototype.asObservable=function(){var e=new st;return e.source=this,e},t.create=function(e,s){return new $h(e,s)},t}(st),$h=function(n){de(t,n);function t(e,s){var i=n.call(this)||this;return i.destination=e,i.source=s,i}return t.prototype.next=function(e){var s,i;(i=(s=this.destination)===null||s===void 0?void 0:s.next)===null||i===void 0||i.call(s,e)},t.prototype.error=function(e){var s,i;(i=(s=this.destination)===null||s===void 0?void 0:s.error)===null||i===void 0||i.call(s,e)},t.prototype.complete=function(){var e,s;(s=(e=this.destination)===null||e===void 0?void 0:e.complete)===null||s===void 0||s.call(e)},t.prototype._subscribe=function(e){var s,i;return(i=(s=this.source)===null||s===void 0?void 0:s.subscribe(e))!==null&&i!==void 0?i:Bh},t}(ds),Vh=function(n){de(t,n);function t(e){var s=n.call(this)||this;return s._value=e,s}return Object.defineProperty(t.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),t.prototype._subscribe=function(e){var s=n.prototype._subscribe.call(this,e);return!s.closed&&e.next(this._value),s},t.prototype.getValue=function(){var e=this,s=e.hasError,i=e.thrownError,r=e._value;if(s)throw i;return this._throwIfClosed(),r},t.prototype.next=function(e){n.prototype.next.call(this,this._value=e)},t}(ds),Gh={now:function(){return(Gh.delegate||Date).now()},delegate:void 0},Hm=function(n){de(t,n);function t(e,s){return n.call(this)||this}return t.prototype.schedule=function(e,s){return this},t}(fs),Xn={setInterval:function(n,t){for(var e=[],s=2;s<arguments.length;s++)e[s-2]=arguments[s];var i=Xn.delegate;return i?.setInterval?i.setInterval.apply(i,Ve([n,t],Ce(e))):setInterval.apply(void 0,Ve([n,t],Ce(e)))},clearInterval:function(n){var t=Xn.delegate;return(t?.clearInterval||clearInterval)(n)},delegate:void 0},Wm=function(n){de(t,n);function t(e,s){var i=n.call(this,e,s)||this;return i.scheduler=e,i.work=s,i.pending=!1,i}return t.prototype.schedule=function(e,s){var i;if(s===void 0&&(s=0),this.closed)return this;this.state=e;var r=this.id,o=this.scheduler;return r!=null&&(this.id=this.recycleAsyncId(o,r,s)),this.pending=!0,this.delay=s,this.id=(i=this.id)!==null&&i!==void 0?i:this.requestAsyncId(o,this.id,s),this},t.prototype.requestAsyncId=function(e,s,i){return i===void 0&&(i=0),Xn.setInterval(e.flush.bind(e,this),i)},t.prototype.recycleAsyncId=function(e,s,i){if(i===void 0&&(i=0),i!=null&&this.delay===i&&this.pending===!1)return s;s!=null&&Xn.clearInterval(s)},t.prototype.execute=function(e,s){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var i=this._execute(e,s);if(i)return i;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},t.prototype._execute=function(e,s){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,s=e.id,i=e.scheduler,r=i.actions;this.work=this.state=this.scheduler=null,this.pending=!1,Bs(r,this),s!=null&&(this.id=this.recycleAsyncId(i,s,null)),this.delay=null,n.prototype.unsubscribe.call(this)}},t}(Hm),qh=function(){function n(t,e){e===void 0&&(e=n.now),this.schedulerActionCtor=t,this.now=e}return n.prototype.schedule=function(t,e,s){return e===void 0&&(e=0),new this.schedulerActionCtor(this,t).schedule(s,e)},n.now=Gh.now,n}(),Jm=function(n){de(t,n);function t(e,s){s===void 0&&(s=qh.now);var i=n.call(this,e,s)||this;return i.actions=[],i._active=!1,i}return t.prototype.flush=function(e){var s=this.actions;if(this._active){s.push(e);return}var i;this._active=!0;do if(i=e.execute(e.state,e.delay))break;while(e=s.shift());if(this._active=!1,i){for(;e=s.shift();)e.unsubscribe();throw i}},t}(qh),vr=new Jm(Wm),Zm=vr,jh=new st(function(n){return n.complete()});function Hh(n){return n&&H(n.schedule)}function Sr(n){return n[n.length-1]}function Qm(n){return H(Sr(n))?n.pop():void 0}function Fs(n){return Hh(Sr(n))?n.pop():void 0}function Km(n,t){return typeof Sr(n)=="number"?n.pop():t}var _r=function(n){return n&&typeof n.length=="number"&&typeof n!="function"};function Wh(n){return H(n?.then)}function Jh(n){return H(n[br])}function Zh(n){return Symbol.asyncIterator&&H(n?.[Symbol.asyncIterator])}function Qh(n){return new TypeError("You provided "+(n!==null&&typeof n=="object"?"an invalid object":"'"+n+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}function tp(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var Kh=tp();function tc(n){return H(n?.[Kh])}function ec(n){return zm(this,arguments,function(){var e,s,i,r;return zh(this,function(o){switch(o.label){case 0:e=n.getReader(),o.label=1;case 1:o.trys.push([1,,9,10]),o.label=2;case 2:return[4,us(e.read())];case 3:return s=o.sent(),i=s.value,r=s.done,r?[4,us(void 0)]:[3,5];case 4:return[2,o.sent()];case 5:return[4,us(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 sc(n){return H(n?.getReader)}function _t(n){if(n instanceof st)return n;if(n!=null){if(Jh(n))return ep(n);if(_r(n))return sp(n);if(Wh(n))return np(n);if(Zh(n))return nc(n);if(tc(n))return ip(n);if(sc(n))return rp(n)}throw Qh(n)}function ep(n){return new st(function(t){var e=n[br]();if(H(e.subscribe))return e.subscribe(t);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function sp(n){return new st(function(t){for(var e=0;e<n.length&&!t.closed;e++)t.next(n[e]);t.complete()})}function np(n){return new st(function(t){n.then(function(e){t.closed||(t.next(e),t.complete())},function(e){return t.error(e)}).then(null,Xh)})}function ip(n){return new st(function(t){var e,s;try{for(var i=$e(n),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&&(s=i.return)&&s.call(i)}finally{if(e)throw e.error}}t.complete()})}function nc(n){return new st(function(t){op(n,t).catch(function(e){return t.error(e)})})}function rp(n){return nc(ec(n))}function op(n,t){var e,s,i,r;return Om(this,void 0,void 0,function(){var o,a;return zh(this,function(h){switch(h.label){case 0:h.trys.push([0,5,6,11]),e=Bm(n),h.label=1;case 1:return[4,e.next()];case 2:if(s=h.sent(),!!s.done)return[3,4];if(o=s.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]),s&&!s.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 me(n,t,e,s,i){s===void 0&&(s=0),i===void 0&&(i=!1);var r=t.schedule(function(){e(),i?n.add(this.schedule(null,s)):this.unsubscribe()},s);if(n.add(r),!i)return r}function ic(n,t){return t===void 0&&(t=0),Ot(function(e,s){e.subscribe(ft(s,function(i){return me(s,n,function(){return s.next(i)},t)},function(){return me(s,n,function(){return s.complete()},t)},function(i){return me(s,n,function(){return s.error(i)},t)}))})}function Cr(n,t){return t===void 0&&(t=0),Ot(function(e,s){s.add(n.schedule(function(){return e.subscribe(s)},t))})}function hp(n,t){return _t(n).pipe(Cr(t),ic(t))}function cp(n,t){return _t(n).pipe(Cr(t),ic(t))}function lp(n,t){return new st(function(e){var s=0;return t.schedule(function(){s===n.length?e.complete():(e.next(n[s++]),e.closed||this.schedule())})})}function up(n,t){return new st(function(e){var s;return me(e,t,function(){s=n[Kh](),me(e,t,function(){var i,r,o;try{i=s.next(),r=i.value,o=i.done}catch(a){e.error(a);return}o?e.complete():e.next(r)},0,!0)}),function(){return H(s?.return)&&s.return()}})}function rc(n,t){if(!n)throw new Error("Iterable cannot be null");return new st(function(e){me(e,t,function(){var s=n[Symbol.asyncIterator]();me(e,t,function(){s.next().then(function(i){i.done?e.complete():e.next(i.value)})},0,!0)})})}function fp(n,t){return rc(ec(n),t)}function dp(n,t){if(n!=null){if(Jh(n))return hp(n,t);if(_r(n))return lp(n,t);if(Wh(n))return cp(n,t);if(Zh(n))return rc(n,t);if(tc(n))return up(n,t);if(sc(n))return fp(n,t)}throw Qh(n)}function Ys(n,t){return t?dp(n,t):_t(n)}function mp(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];var e=Fs(n);return Ys(n,e)}var pp=pr(function(n){return function(){n(this),this.name="EmptyError",this.message="no elements in sequence"}});function gp(n,t){var e=typeof t=="object";return new Promise(function(s,i){var r=new Fn({next:function(o){s(o),r.unsubscribe()},error:i,complete:function(){e?s(t.defaultValue):i(new pp)}});n.subscribe(r)})}function yp(n){return n instanceof Date&&!isNaN(n)}function ot(n,t){return Ot(function(e,s){var i=0;e.subscribe(ft(s,function(r){s.next(n.call(t,r,i++))}))})}var wp=Array.isArray;function xp(n,t){return wp(t)?n.apply(void 0,Ve([],Ce(t))):n(t)}function Tr(n){return ot(function(t){return xp(n,t)})}var bp=Array.isArray,vp=Object.getPrototypeOf,Sp=Object.prototype,_p=Object.keys;function Cp(n){if(n.length===1){var t=n[0];if(bp(t))return{args:t,keys:null};if(Tp(t)){var e=_p(t);return{args:e.map(function(s){return t[s]}),keys:e}}}return{args:n,keys:null}}function Tp(n){return n&&typeof n=="object"&&vp(n)===Sp}function Pp(n,t){return n.reduce(function(e,s,i){return e[s]=t[i],e},{})}function Ep(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];var e=Fs(n),s=Qm(n),i=Cp(n),r=i.args,o=i.keys;if(r.length===0)return Ys([],e);var a=new st(Mp(r,e,o?function(h){return Pp(o,h)}:Ge));return s?a.pipe(Tr(s)):a}function Mp(n,t,e){return e===void 0&&(e=Ge),function(s){oc(t,function(){for(var i=n.length,r=new Array(i),o=i,a=i,h=function(l){oc(t,function(){var u=Ys(n[l],t),m=!1;u.subscribe(ft(s,function(f){r[l]=f,m||(m=!0,a--),a||s.next(e(r.slice()))},function(){--o||s.complete()}))},s)},c=0;c<i;c++)h(c)},s)}}function oc(n,t,e){n?me(e,n,t):t()}function Ap(n,t,e,s,i,r,o,a){var h=[],c=0,l=0,u=!1,m=function(){u&&!h.length&&!c&&t.complete()},f=function(y){return c<s?p(y):h.push(y)},p=function(y){r&&t.next(y),c++;var S=!1;_t(e(y,l++)).subscribe(ft(t,function(w){i?.(w),r?f(w):t.next(w)},function(){S=!0},void 0,function(){if(S)try{c--;for(var w=function(){var v=h.shift();o?me(t,o,function(){return p(v)}):p(v)};h.length&&c<s;)w();m()}catch(v){t.error(v)}}))};return n.subscribe(ft(t,f,function(){u=!0,m()})),function(){a?.()}}function Pr(n,t,e){return e===void 0&&(e=1/0),H(t)?Pr(function(s,i){return ot(function(r,o){return t(s,r,i,o)})(_t(n(s,i)))},e):(typeof t=="number"&&(e=t),Ot(function(s,i){return Ap(s,i,n,e)}))}function ac(n){return n===void 0&&(n=1/0),Pr(Ge,n)}function Ip(){return ac(1)}function hc(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];return Ip()(Ys(n,Fs(n)))}var kp=["addListener","removeListener"],Dp=["addEventListener","removeEventListener"],Lp=["on","off"];function Er(n,t,e,s){if(H(e)&&(s=e,e=void 0),s)return Er(n,t,e).pipe(Tr(s));var i=Ce(zp(n)?Dp.map(function(a){return function(h){return n[a](t,h,e)}}):Rp(n)?kp.map(cc(n,t)):Op(n)?Lp.map(cc(n,t)):[],2),r=i[0],o=i[1];if(!r&&_r(n))return Pr(function(a){return Er(a,t,e)})(_t(n));if(!r)throw new TypeError("Invalid event target");return new st(function(a){var h=function(){for(var c=[],l=0;l<arguments.length;l++)c[l]=arguments[l];return a.next(1<c.length?c:c[0])};return r(h),function(){return o(h)}})}function cc(n,t){return function(e){return function(s){return n[e](t,s)}}}function Rp(n){return H(n.addListener)&&H(n.removeListener)}function Op(n){return H(n.on)&&H(n.off)}function zp(n){return H(n.addEventListener)&&H(n.removeEventListener)}function nt(n,t,e){return e?nt(n,t).pipe(Tr(e)):new st(function(s){var i=function(){for(var o=[],a=0;a<arguments.length;a++)o[a]=arguments[a];return s.next(o.length===1?o[0]:o)},r=n(i);return H(t)?function(){return t(i,r)}:void 0})}function Bp(n,t,e){n===void 0&&(n=0),e===void 0&&(e=Zm);var s=-1;return t!=null&&(Hh(t)?e=t:s=t),new st(function(i){var r=yp(n)?+n-e.now():n;r<0&&(r=0);var o=0;return e.schedule(function(){i.closed||(i.next(o++),0<=s?this.schedule(void 0,s):i.complete())},r)})}function Np(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];var e=Fs(n),s=Km(n,1/0),i=n;return i.length?i.length===1?_t(i[0]):ac(s)(Ys(i,e)):jh}var Fp=Array.isArray;function Yp(n){return n.length===1&&Fp(n[0])?n[0]:n}function lc(n,t){return Ot(function(e,s){var i=0;e.subscribe(ft(s,function(r){return n.call(t,r,i++)&&s.next(r)}))})}function Mr(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];return n=Yp(n),n.length===1?_t(n[0]):new st(Xp(n))}function Xp(n){return function(t){for(var e=[],s=function(r){e.push(_t(n[r]).subscribe(ft(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<n.length;i++)s(i)}}function Te(n,t){return t===void 0&&(t=Ge),n=n??Up,Ot(function(e,s){var i,r=!0;e.subscribe(ft(s,function(o){var a=t(o);(r||!n(i,a))&&(r=!1,i=a,s.next(o))}))})}function Up(n,t){return n===t}function uc(n,t){return t?function(e){return e.pipe(uc(function(s,i){return _t(n(s,i)).pipe(ot(function(r,o){return t(s,r,i,o)}))}))}:Ot(function(e,s){var i=0,r=null,o=!1;e.subscribe(ft(s,function(a){r||(r=ft(s,void 0,function(){r=null,o&&s.complete()}),_t(n(a,i++)).subscribe(r))},function(){o=!0,!r&&s.complete()}))})}function Pe(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];var e=Fs(n);return Ot(function(s,i){(e?hc(n,s,e):hc(n,s)).subscribe(i)})}function Un(n,t){return Ot(function(e,s){var i=null,r=0,o=!1,a=function(){return o&&!i&&s.complete()};e.subscribe(ft(s,function(h){i?.unsubscribe();var c=0,l=r++;_t(n(h,l)).subscribe(i=ft(s,function(u){return s.next(t?t(h,u,l,c++):u)},function(){i=null,a()}))},function(){o=!0,a()}))})}function $p(){return Un(Ge)}function Ar(n){return Ot(function(t,e){_t(n).subscribe(ft(e,function(){return e.complete()},Ns)),!e.closed&&t.subscribe(e)})}function qe(n,t,e){var s=H(n)||t||e?{next:n,error:t,complete:e}:n;return s?Ot(function(i,r){var o;(o=s.subscribe)===null||o===void 0||o.call(s);var a=!0;i.subscribe(ft(r,function(h){var c;(c=s.next)===null||c===void 0||c.call(s,h),r.next(h)},function(){var h;a=!1,(h=s.complete)===null||h===void 0||h.call(s),r.complete()},function(h){var c;a=!1,(c=s.error)===null||c===void 0||c.call(s,h),r.error(h)},function(){var h,c;a&&((h=s.unsubscribe)===null||h===void 0||h.call(s)),(c=s.finalize)===null||c===void 0||c.call(s)}))}):Ge}function Vp(n,t){return Ot(function(e,s){var i=t??{},r=i.leading,o=r===void 0?!0:r,a=i.trailing,h=a===void 0?!1:a,c=!1,l=null,u=null,m=!1,f=function(){u?.unsubscribe(),u=null,h&&(S(),m&&s.complete())},p=function(){u=null,m&&s.complete()},y=function(w){return u=_t(n(w)).subscribe(ft(s,f,p))},S=function(){if(c){c=!1;var w=l;l=null,s.next(w),!m&&y(w)}};e.subscribe(ft(s,function(w){c=!0,l=w,!(u&&!u.closed)&&(o?S():y(w))},function(){m=!0,!(h&&c&&u&&!u.closed)&&s.complete()}))})}function Gp(n,t,e){t===void 0&&(t=vr);var s=Bp(n,t);return Vp(function(){return s},e)}function qp(n,t){return Ot(function(e,s){var i=[],r=function(o){for(;0<i.length;)i.shift().error(o);s.error(o)};_t(n).subscribe(ft(s,function(o){var a=new ds;i.push(a);var h=new fs,c=function(){Bs(i,a),a.complete(),h.unsubscribe()},l;try{l=_t(t(o))}catch(u){r(u);return}s.next(a.asObservable()),h.add(l.subscribe(ft(s,c,Ns,r)))},Ns)),e.subscribe(ft(s,function(o){var a,h,c=i.slice();try{for(var l=$e(c),u=l.next();!u.done;u=l.next()){var m=u.value;m.next(o)}}catch(f){a={error:f}}finally{try{u&&!u.done&&(h=l.return)&&h.call(l)}finally{if(a)throw a.error}}},function(){for(;0<i.length;)i.shift().complete();s.complete()},r,function(){for(;0<i.length;)i.shift().unsubscribe()}))})}function W(n,t,e,s=!1){const i=async r=>{await e(r)};try{n.addEventListener(t,i,s)}catch{n.attachEvent("on"+t,i)}return()=>{try{n.removeEventListener(t,i,s)}catch{n.detachEvent("on"+t,i)}}}function jp(n,t,e,s,i=!1){return W(n||document.body,e,r=>{r.target===t&&s(r)},i)}function Hp(n){n.replaceWith(n.cloneNode(!0))}function $(n,t,e=!1){return Er(n,t,{capture:e})}function Ee(n){if(n.preventDefault){n.preventDefault();return}try{n.returnValue=!1}catch{}}function fc(n){if(n.stopPropagation){n.stopPropagation();return}try{n.cancelBubble=!0}catch{}}const Wp=["click","dblclick","wheel","contextmenu","mousedown","mouseup","mousemove","mouseover","mouseout","mouseenter","mouseleave"],Jp=["keydown","keyup","keypress"],Zp=["touchstart","touchend","touchcancel","touchmove"],Qp=["pointerdown","pointerup","pointercancel","pointermove"],Kp=["dragstart","drag","dragend","dragenter","dragover","dragleave","drop"],tg=["change"];function eg(n,t,e={bubbles:!0,detail:{}}){if(!n)return;let s;try{Wp.includes(t)?s=new MouseEvent(t,e):Jp.includes(t)?s=new KeyboardEvent(t,e):Zp.includes(t)?s=new TouchEvent(t,e):Qp.includes(t)?s=new PointerEvent(t,e):Kp.includes(t)?s=new DragEvent(t,e):tg.includes(t)?s=new Event(t,e):s=new CustomEvent(t,e)}catch{document.createEvent?s=document.createEvent("HTMLEvents").initEvent(t,!0,!0):document.createEventObject&&(s=document.createEventObject())}if(n.dispatchEvent)n.dispatchEvent(s);else if(n.fireEvent&&document.createEventObject)n.fireEvent("on"+t,s);else throw new Error(`Can't fire event : ${t}`)}function sg(n,t){const e=n.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 ng(n,t){let e=document.createElement(n);t="on"+t;let s=t in e;return s||(e.setAttribute(t,"return;"),s=typeof e[t]=="function"),e=null,s}(function(){if(!window.requestAnimationFrame){let n=ut();window.requestAnimationFrame=function(t){const e=ut(),s=Math.max(0,16-(e-n)),i=window.setTimeout(function(){t(e+s)},s);return n=e+s,i}}window.cancelAnimationFrame||(window.cancelAnimationFrame=function(n){clearTimeout(n)})})();function Ir(n){let t=!1;return window.requestAnimationFrame(function e(s){!t&&n(s)&&window.requestAnimationFrame(e)}),()=>{t=!0}}function kr(n,t=0){if(t==0)return n(ut()),()=>{};{const e=ut();return Ir(s=>s-e>=t?(n(s),!1):!0)}}function ig(n,t=0){let e=!1,s=0;const i=ut(),r=o=>{if(e)return;s++;const a=o-i-s*t;n(o,s,t<=a),kr(r,Math.max(0,t-a))};return kr(r,t),()=>{e=!0}}function rg(n,t=20){const e=1e3/t;let s=0,i;return()=>(ut()-s>=e&&(s=ut(),i=n()),i)}window.requestIdleCallback=window.requestIdleCallback||function(n,t){const e=ut();return setTimeout(()=>{const s=ut()-e;n({didTimeout:!0,timeRemaining:()=>Math.max(0,50-s)})},t?.timeout)},window.cancelIdleCallback=window.cancelIdleCallback||function(n){clearTimeout(n)};function dc(n,t){window.requestIdleCallback(e=>{e.timeRemaining()>0||e.didTimeout?n():dc(n,t)},{timeout:t?.timeout})}let $n=0,Dr=0,je=33,Me=33,Lr,Rr=-1;const mc=new MessageChannel,og=mc.port2;mc.port1.onmessage=n=>{Lr&&Lr({didTimeout:Rr==-1?!1:ut()-$n>Rr,timeRemaining:()=>Math.max(0,Dr-ut())})};function ag(n,t){return Lr=n,Rr=typeof t?.timeout=="number"?t?.timeout:-1,requestAnimationFrame(e=>{$n=e;let s=Me+$n-Dr;s<Me&&je<Me?(s<8&&(s=8),Me=s<je?je:s):s>Me&&je>Me?Me=s<je?je:s:je=s,Dr=$n+Me,og.postMessage(null)})}const pc=new ja({concurrency:1,timeRemaining:0});let Or=!1;function gc(n,t){const e=qa({fn:n,name:t?.name,deadline:typeof t?.timeout=="number"?ne()+t.timeout:void 0});pc.addTask(e),!Or&&(Or=!0,ag(s=>{Or=!1,pc.idleCallback(s)}))}class Xs{static _nextId=0;static nextId(){return Xs._nextId++}}const O={Linear:{None:function(n){return n}},Ease:{In:function(n){return Math.pow(n,1.7)}},Quadratic:{In:function(n){return n*n},Out:function(n){return n*(2-n)},InOut:function(n){return(n*=2)<1?.5*n*n:-.5*(--n*(n-2)-1)}},Cubic:{In:function(n){return n*n*n},Out:function(n){return--n*n*n+1},InOut:function(n){return(n*=2)<1?.5*n*n*n:.5*((n-=2)*n*n+2)}},Quartic:{In:function(n){return n*n*n*n},Out:function(n){return 1- --n*n*n*n},InOut:function(n){return(n*=2)<1?.5*n*n*n*n:-.5*((n-=2)*n*n*n-2)}},Quintic:{In:function(n){return n*n*n*n*n},Out:function(n){return--n*n*n*n*n+1},InOut:function(n){return(n*=2)<1?.5*n*n*n*n*n:.5*((n-=2)*n*n*n*n+2)}},Sinusoidal:{In:function(n){return 1-Math.sin((1-n)*Math.PI/2)},Out:function(n){return Math.sin(n*Math.PI/2)},InOut:function(n){return .5*(1-Math.sin(Math.PI*(.5-n)))}},Exponential:{In:function(n){return n===0?0:Math.pow(1024,n-1)},Out:function(n){return n===1?1:1-Math.pow(2,-10*n)},InOut:function(n){return n===0?0:n===1?1:(n*=2)<1?.5*Math.pow(1024,n-1):.5*(-Math.pow(2,-10*(n-1))+2)}},Circular:{In:function(n){return 1-Math.sqrt(1-n*n)},Out:function(n){return Math.sqrt(1- --n*n)},InOut:function(n){return(n*=2)<1?-.5*(Math.sqrt(1-n*n)-1):.5*(Math.sqrt(1-(n-=2)*n)+1)}},Elastic:{In:function(n){return n===0?0:n===1?1:-Math.pow(2,10*(n-1))*Math.sin((n-1.1)*5*Math.PI)},Out:function(n){return n===0?0:n===1?1:Math.pow(2,-10*n)*Math.sin((n-.1)*5*Math.PI)+1},InOut:function(n){return n===0?0:n===1?1:(n*=2,n<1?-.5*Math.pow(2,10*(n-1))*Math.sin((n-1.1)*5*Math.PI):.5*Math.pow(2,-10*(n-1))*Math.sin((n-1.1)*5*Math.PI)+1)}},Back:{In:function(n){return n===1?1:n*n*((1.70158+1)*n-1.70158)},Out:function(n){return n===0?0:--n*n*((1.70158+1)*n+1.70158)+1},InOut:function(n){const t=2.5949095;return(n*=2)<1?.5*(n*n*((t+1)*n-t)):.5*((n-=2)*n*((t+1)*n+t)+2)}},Bounce:{In:function(n){return 1-O.Bounce.Out(1-n)},Out:function(n){return n<1/2.75?7.5625*n*n:n<2/2.75?7.5625*(n-=1.5/2.75)*n+.75:n<2.5/2.75?7.5625*(n-=2.25/2.75)*n+.9375:7.5625*(n-=2.625/2.75)*n+.984375},InOut:function(n){return n<.5?O.Bounce.In(n*2)*.5:O.Bounce.Out(n*2-1)*.5+.5}},generatePow:function(n=4){return n=n<Number.EPSILON?Number.EPSILON:n,n=n>1e4?1e4:n,{In:function(t){return t**n},Out:function(t){return 1-(1-t)**n},InOut:function(t){return t<.5?(t*2)**n/2:(1-(2-t*2)**n)/2+.5}}},random:function(n){return Math.random()},createStep:function(n){return function(t){return Math.floor(t*n)/n}},createNoisyEasing:function(n,t=.1){const e=1-t;return function(s){return t*Math.random()+e*n(s)}},swing:function(n){return n+Math.sin(n*Math.PI*2)/2},causeSeizures:function(n){return n+.2*Math.random()-.1}};function yc(n){switch(n){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 n}}const hg=4,cg=.001,lg=1e-7,ug=10,Us=11,Vn=1/(Us-1),fg=typeof Float32Array=="function";function wc(n,t){return 1-3*t+3*n}function xc(n,t){return 3*t-6*n}function bc(n){return 3*n}function Gn(n,t,e){return((wc(t,e)*n+xc(t,e))*n+bc(t))*n}function vc(n,t,e){return 3*wc(t,e)*n*n+2*xc(t,e)*n+bc(t)}function dg(n,t,e,s,i){let r,o,a=0;do o=t+(e-t)/2,r=Gn(o,s,i)-n,r>0?e=o:t=o;while(Math.abs(r)>lg&&++a<ug);return o}function mg(n,t,e,s){for(let i=0;i<hg;++i){const r=vc(t,e,s);if(r===0)return t;const o=Gn(t,e,s)-n;t-=o/r}return t}function pg(n){return n}function zr(n,t,e,s){if(!(0<=n&&n<=1&&0<=e&&e<=1))throw new Error("bezier x values must be in [0, 1] range");if(n===t&&e===s)return pg;const i=fg?new Float32Array(Us):new Array(Us);for(let o=0;o<Us;++o)i[o]=Gn(o*Vn,n,e);function r(o){let a=0,h=1;const c=Us-1;for(;h!==c&&i[h]<=o;++h)a+=Vn;--h;const l=(o-i[h])/(i[h+1]-i[h]),u=a+l*Vn,m=vc(u,n,e);return m>=cg?mg(o,u,n,e):m===0?u:dg(o,a,a+Vn,n,e)}return o=>o===0||o===1?o:Gn(r(o),t,s)}function Br(n){switch(n){case"linear":return[0,0,1,1];case"ease":return[.25,.1,.25,1];case"ease-in":return[.42,0,1,1];case"ease-in-out":return[.42,0,.58,1];case"ease-out":return[0,0,.58,1]}}function Sc(n){const[t,e,s,i]=Br(n);return[1-s,1-i,1-t,1-e]}function gg(n){return zr(...Br(n))}function yg(n){return zr(...Sc(n))}const pe={Utils:{Linear:function(n,t,e){return(t-n)*e+n},Factorial:function(){const n=[1];return function(t){let e=1;if(n[t])return n[t];for(let s=t;s>1;s--)e*=s;return n[t]=e,e}}(),Bernstein:function(n,t){const e=pe.Utils.Factorial;return e(n)/e(t)/e(n-t)},CatmullRom:function(n,t,e,s,i){const r=(e-n)*.5,o=(s-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:(n,t,e,s)=>{const i=1-s;return i*i*n+2*i*s*t+s*s*e},CubicBezier:(n,t,e,s,i)=>{const r=1-i;return r*r*r*n+3*r*r*i*t+3*r*i*i*e+i*i*i*s}},Linear:function(n,t){const e=n.length-1,s=e*t,i=Math.floor(s),r=pe.Utils.Linear;return t<0?r(n[0],n[1],s):t>1?r(n[e],n[e-1],e-s):r(n[i],n[i+1>e?e:i+1],s-i)},Bezier:function(n,t){let e=0;const s=n.length-1,i=Math.pow,r=pe.Utils.Bernstein;for(let o=0;o<=s;o++)e+=i(1-t,s-o)*i(t,o)*n[o]*r(s,o);return e},CatmullRom:function(n,t){const e=n.length-1;let s=e*t,i=Math.floor(s);const r=pe.Utils.CatmullRom;return n[0]===n[e]?(t<0&&(i=Math.floor(s=e*(1+t))),r(n[(i-1+e)%e],n[i],n[(i+1)%e],n[(i+2)%e],s-i)):t<0?n[0]-(r(n[0],n[0],n[1],n[1],-s)-n[0]):t>1?n[e]-(r(n[e],n[e],n[e-1],n[e-1],s-e)-n[e]):r(n[i?i-1:0],n[i],n[e<i+1?e:i+1],n[e<i+2?e:i+2],s-i)}};class _c{_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 s=Object.keys(this._tweens);for(let i=0;i<s.length;i++){const r=this._tweens[s[i]],o=!e;r&&r.update(t,o)===!1&&!e&&delete this._tweens[s[i]]}return!!Object.keys(this._tweens).length}}const $t=new _c;class Nr{constructor(t,e=$t){this._object=t,this._group=e}_id=Xs.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=pe.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,s,i){for(const r in s){const o=t[r],a=Array.isArray(o),h=a?"array":typeof o,c=!a&&Array.isArray(s[r]);if(!(h==="undefined"||h==="function")){if(c){let l=s[r];if(l.length===0)continue;l=l.map(this._handleRelativeValue.bind(this,o)),s[r]=[o].concat(l)}if((h==="object"||a)&&o&&!c){e[r]=a?[]:{};for(const l in o)e[r][l]=o[l];i[r]=a?[]:{},this._setupProperties(o,e[r],s[r],i[r])}else typeof e[r]>"u"&&(e[r]=o),a||(e[r]*=1),c?i[r]=s[r].slice().reverse():i[r]=e[r]||0}}}stop(){return this._isChainStopped||(this._isChainStopped=!0,this.stopChainedTweens()),this._isPlaying?(this._group&&this._group.remove(this),this._isPlaying=!1,this._isPaused=!1,this._onStopCallback&&this._onStopCallback(this._object),this):this}end(){return this._goToEnd=!0,this.update(1/0),this}pause(t=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=$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=pe.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 s,i;const r=this._startTime+this._durationTime;if(!this._goToEnd&&!this._isPlaying){if(t>r)return!1;e&&this.start(t)}if(this._goToEnd=!1,t<this._startTime)return!0;this._onStartCallbackFired===!1&&(this._onStartCallback&&this._onStartCallback(this._object),this._onStartCallbackFired=!0),this._onEveryStartCallbackFired===!1&&(this._onEveryStartCallback&&this._onEveryStartCallback(this._object),this._onEveryStartCallbackFired=!0),i=(t-this._startTime)/this._durationTime,i=this._durationTime===0||i>1?1:i;const 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(s in this._valuesStartRepeat)!this._yoyo&&typeof this._valuesEnd[s]=="string"&&(this._valuesStartRepeat[s]=this._valuesStartRepeat[s]+parseFloat(this._valuesEnd[s])),this._yoyo&&this._swapEndStartRepeatValues(s),this._valuesStart[s]=this._valuesStartRepeat[s];return this._yoyo&&(this._reversed=!this._reversed),this._repeatDelayTime!==void 0?this._startTime=t+this._repeatDelayTime:this._startTime=t+this._delayTime,this._onRepeatCallback&&this._onRepeatCallback(this._object),this._onEveryStartCallbackFired=!1,!0}else{this._onCompleteCallback&&this._onCompleteCallback(this._object);for(let 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,s,i){for(const r in s){if(e[r]===void 0)continue;const o=e[r]||0;let a=s[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],s=this._valuesEnd[t];typeof s=="string"?this._valuesStartRepeat[t]=this._valuesStartRepeat[t]+parseFloat(s):this._valuesStartRepeat[t]=s,this._valuesEnd[t]=e}}const wg=Xs.nextId,xg=$t.getAll.bind($t),bg=$t.removeAll.bind($t),vg=$t.add.bind($t),Sg=$t.remove.bind($t),_g=$t.update.bind($t),Cg={now:ut,Sequence:Xs,Easing:O,Interpolation:pe,Group:_c,Tween:Nr,nextId:wg,getAll:xg,removeAll:bg,add:vg,remove:Sg,update:_g};class Fr{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 $s{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){Yu(this.tweens,(e,s)=>t?e.delay>s.delay:e.delay<=s.delay)}cloneTweens(t=this.tweens){const e=[];return t.forEach(s=>{const i={...s};delete i.tween,i.fromValues={...i.fromValues},i.toValues={...i.toValues},e.push(i)}),e}addTween(t,e,s){const i={fromValues:t,toValues:e,frames:typeof s?.frames=="number"?s.frames:1,delay:typeof s?.delay=="number"?s.delay:this.tweens.length,easeFunction:s?.easeFunction||O.Linear.None,interpolationFunction:s?.interpolationFunction||pe.Linear,repeat:typeof s?.repeat=="number"?s.repeat:0,yoyo:s?.yoyo||!1,onStart:s?.onStart||(()=>{}),onUpdate:s?.onUpdate||(()=>{}),onComplete:s?.onComplete||(()=>{})};return this.tweens.push(i),this}cancelRequestAnimationCycle=()=>{};runTweens(t){this.cancelRequestAnimationCycle();const e=new Fr,s=this.frameDuration;return new Promise(i=>{this.onGroupStart?.(),this.cancelRequestAnimationCycle=Ir(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*s<=h).forEach(c=>{c.tween||(c.tween=new Nr({...c.fromValues}).to({...c.toValues},c.frames*s).easing(c.easeFunction).interpolation(c.interpolationFunction).repeat(c.repeat).yoyo(c.yoyo).onStart(c.onStart).onUpdate(c.onUpdate).onComplete(c.onComplete),c.tween.start(a)),(c.delay+c.frames*(c.repeat+1))*s>h?c.tween.update(a):(c.tween.isPlaying()&&c.tween.end(),ki(t,c))})}const o=!!t.length;return o||(this.onGroupComplete?.(),i()),o})})}isPaused=!1;pausedClock=new Fr;pausedDuration=0;play(t=this.cloneTweens(this.tweens)){this.isPaused=!1,this.pausedDuration=0,this.runTweens(t)}reverse(){const t=this.cloneTweens(this.tweens);let e=0;t.forEach(s=>{e=Math.max(e,s.delay+s.frames),s.easeFunction=yc(s.easeFunction);const i={...s.toValues};s.toValues={...s.fromValues},s.fromValues={...i}}),t.forEach(s=>{s.delay=e-s.frames}),this.play(t)}pause(){this.pausedClock.start(),this.isPaused=!0}resume(){this.pausedDuration+=this.pausedClock.getElapsedTime(),this.pausedClock.stop(),this.isPaused=!1}}const Vs=new Pf({objectSignature:n=>n.name});function Yr(n,t=Vs){let e=t?.find(s=>s.el==n);return e||(e=ci(n),t.put(e),e)}function qn(n,t,e=Vs){const s=Yr(n,e);s.alternate||(s.alternate=ci(n),as(s.alternate.props,s.props,!0)),t(s.alternate)}function Cc(n=Vs){n.update(t=>{const e=t.alternate;return e&&(li(t,e),t.props=e.props,t.alternate=void 0),!0})}function Tg(n=Vs){Cc(n)}function Xr(n=Vs){gc(()=>Cc(n),{name:"PATCH_VNODES",timeout:50})}function q(n){return n*Math.PI/180}function mt(n){return n*180/Math.PI}function ms(n,t,e=0){return Math.sqrt(n*n+t*t+e*e)}function Ae(n,t,e,s){return ms(e-n,s-t)}function zt(n,t,e,s){let i=Math.atan2(s-t,e-n);return i<0&&(i+=Math.PI*2),i}function Ie(n,t){return{dx:Math.cos(n)*t,dy:Math.sin(n)*t}}function Pg(n,t,e){if(typeof e=="number"){const s=ms(n,t,e);return{x:n/=s,y:t/=s,z:e/=s}}else{const s=ms(n,t);return{x:n/=s,y:t/=s}}}function Eg(n,t,e,s,i=10){if(Math.abs(e-n)<i&&Math.abs(s-t)<i)return"no";const r=mt(zt(n,t,e,s));return r>=-135&&r<=-45?"up":r>45&&r<135?"down":r>=135&&r<=180||r>=-180&&r<-135?"left":"right"}const Tc=Mg("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 Mg(n,t=10){const e={},s=n.split(",");for(let i=0;i<s.length;i+=2){const r="&"+s[i+1]+";",o=parseInt(s[i],t);e[r]="&#"+o+";"}return e["\\xa0"]=" ",e}function Pt(n,t){const e=Object.keys(t);for(let s=0;s<e.length;s++)n=n.replace(new RegExp("{"+e[s]+"}","gi"),""+t[e[s]]);return n}function jn(n){let t,e;if(!n)throw new Error("cannot create a random attribute name for an undefined object");const s="ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz";t="";do for(t="",e=0;e<12;e++)t+=s[Math.floor(Math.random()*s.length)];while(n[t]);return t}function Ag(n){const t={left:"start",right:"end",center:"middle",start:"start",end:"end"};return t[n]||t.start}function Ig(n){const t={alphabetic:"alphabetic",hanging:"hanging",top:"text-before-edge",bottom:"text-after-edge",middle:"central"};return t[n]||t.alphabetic}const Gs={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 Hn=class{__root;__ctx;constructor(t,e){this.__root=t,this.__ctx=e}addColorStop(t,e){const s=this.__ctx.__createElement("stop");if(s.setAttribute("offset",""+t),e.indexOf("rgba")!==-1){const r=/rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d?\.?\d*)\s*\)/gi.exec(e);r&&(s.setAttribute("stop-color",Pt("rgb({r},{g},{b})",{r:r[1],g:r[2],b:r[3]})),s.setAttribute("stop-opacity",r[4]))}else s.setAttribute("stop-color",e);this.__root.appendChild(s)}},Ur=class{__root;__ctx;constructor(t,e){this.__root=t,this.__ctx=e}},Pc=class pa{__document=document;__canvas;__ctx;width;height;__styleStack;__groupStack;__rootSVG;__ids;__SVGdefs;__currentElement;__currentElementsToStyle=null;constructor({canvas:t,width:e=500,height:s=500}){t?(this.__canvas=t,this.__ctx=t.getContext("2d"),this.width=t.width,this.height=t.height):(this.__canvas=this.__document.createElement("canvas"),this.__ctx=this.__canvas.getContext("2d"),this.width=e,this.height=s),this.__setDefaultStyles(),this.__styleStack=[this.__getStyleState()],this.__groupStack=[],this.__rootSVG=this.__document.createElementNS("http://www.w3.org/2000/svg","svg"),this.__rootSVG.setAttribute("version","1.1"),this.__rootSVG.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.__rootSVG.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink","http://www.w3.org/1999/xlink"),this.__rootSVG.setAttribute("width",""+this.width),this.__rootSVG.setAttribute("height",""+this.height),this.__ids={},this.__SVGdefs=this.__document.createElementNS("http://www.w3.org/2000/svg","defs"),this.__rootSVG.appendChild(this.__SVGdefs),this.__currentElement=this.__document.createElementNS("http://www.w3.org/2000/svg","g"),this.__rootSVG.appendChild(this.__currentElement)}__setDefaultStyles(){const t=Object.keys(Gs);for(let e=0,s=t.length;e<s;e++){const i=t[e];this[i]=Gs[i].canvas}}__getStyleState(){const t={},e=Object.keys(Gs);for(let s=0,i=e.length;s<i;s++){const r=e[s];t[r]=this[r]}return t}__applyStyleState(t){const e=Object.keys(t);for(let s=0,i=e.length;s<i;s++){const r=e[s];this[r]=t[r]}}__createElement(t,e={},s=!1){const i=this.__document.createElementNS("http://www.w3.org/2000/svg",t),r=Object.keys(e);s&&(i.setAttribute("fill","none"),i.setAttribute("stroke","none"));for(let o=0;o<r.length;o++){const a=r[o];i.setAttribute(a,e[a])}return i}__applyStyleToCurrentElement(t){let e=this.__currentElement;const s=this.__currentElementsToStyle;s&&(e.setAttribute(t,""),e=s.element,s.children.forEach(r=>{r.setAttribute(t,"")}));const i=Object.keys(Gs);for(let r=0;r<i.length;r++){const o=Gs[i[r]],a=this[i[r]];if(o.apply){if(a instanceof Ur){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 Hn)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 l=parseFloat(c[4]);const u=this.globalAlpha;u!=null&&(l*=u),e.setAttribute(o.svgAttr+"-opacity",""+l)}}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(Tc);for(let r=0,o=i.length;r<o;r++){const a=i[r],h=Tc[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 s=this.__currentElement.getAttribute("transform");s?s+=" ":s="",s+=t,this.__currentElement.setAttribute("transform",s)}scale(t,e){e===void 0&&(e=t),this.__addTransform(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,s,i,r,o){this.__addTransform(Pt("matrix({a},{b},{c},{d},{e},{f})",{a:t,b:e,c:s,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,s,i,r,o){this.__currentPosition={x:r,y:o},this.__addPathCommand(Pt("C {cp1x} {cp1y} {cp2x} {cp2y} {x} {y}",{cp1x:t,cp1y:e,cp2x:s,cp2y:i,x:r,y:o}))}quadraticCurveTo(t,e,s,i){this.__currentPosition={x:s,y:i},this.__addPathCommand(Pt("Q {cpx} {cpy} {x} {y}",{cpx:t,cpy:e,x:s,y:i}))}normalize(t){const e=Math.sqrt(t[0]*t[0]+t[1]*t[1]);return[t[0]/e,t[1]/e]}arcTo(t,e,s,i,r){const 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===s&&e===i||r===0){this.lineTo(t,e);return}const h=this.normalize([o-t,a-e]),c=this.normalize([s-t,i-e]);if(h[0]*c[1]===h[1]*c[0]){this.lineTo(t,e);return}const l=h[0]*c[0]+h[1]*c[1],u=Math.acos(Math.abs(l)),m=this.normalize([h[0]+c[0],h[1]+c[1]]),f=r/Math.sin(u/2),p=t+f*m[0],y=e+f*m[1],S=[-h[1],h[0]],w=[c[1],-c[0]],v=function(P){const C=P[0];return P[1]>=0?Math.acos(C):-Math.acos(C)},x=v(S),b=v(w);this.lineTo(p+S[0]*r,y+S[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,s,i){this.__currentElement.nodeName!=="path"&&this.beginPath(),this.moveTo(t,e),this.lineTo(t+s,e),this.lineTo(t+s,e+i),this.lineTo(t,e+i),this.lineTo(t,e),this.closePath()}fillRect(t,e,s,i){const r=this.__createElement("rect",{x:t,y:e,width:s,height:i},!0);this.__closestGroupOrSvg().appendChild(r),this.__currentElement=r,this.__applyStyleToCurrentElement("fill")}strokeRect(t,e,s,i){const r=this.__createElement("rect",{x:t,y:e,width:s,height:i},!0);this.__closestGroupOrSvg().appendChild(r),this.__currentElement=r,this.__applyStyleToCurrentElement("stroke")}__clearCanvas(){const e=this.__closestGroupOrSvg().getAttribute("transform"),s=this.__rootSVG.childNodes[1],i=s.childNodes;for(let r=i.length-1;r>=0;r--)i[r]&&s.removeChild(i[r]);this.__currentElement=s,this.__groupStack=[],e&&this.__addTransform(e)}clearRect(t,e,s,i){if(t===0&&e===0&&s===this.width&&i===this.height){this.__clearCanvas();return}const r=this.__closestGroupOrSvg(),o=this.__createElement("rect",{x:t,y:e,width:s,height:i,fill:"#FFFFFF"},!0);r.appendChild(o)}createLinearGradient(t,e,s,i){const r=this.__createElement("linearGradient",{id:jn(this.__ids),x1:t+"px",x2:s+"px",y1:e+"px",y2:i+"px",gradientUnits:"userSpaceOnUse"},!1);return this.__SVGdefs.appendChild(r),new Hn(r,this)}createRadialGradient(t,e,s,i,r,o){const a=this.__createElement("radialGradient",{id:jn(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 Hn(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),s={style:e[1]||"normal",size:e[4]||"10px",family:e[6]||"sans-serif",weight:e[3]||"normal",decoration:e[2]||"normal",href:null};return this.__fontUnderline==="underline"&&(s.decoration="underline"),this.__fontHref&&(s.href=this.__fontHref),s}__wrapTextLink(t,e){if(t.href){const s=this.__createElement("a");return s.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",t.href),s.appendChild(e),s}return e}__applyText(t,e,s,i){const r=this.__parseFont(),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:s,"text-anchor":Ag(this.textAlign),"dominant-baseline":Ig(this.textBaseline)},!0);a.appendChild(this.__document.createTextNode(t)),this.__currentElement=a,this.__applyStyleToCurrentElement(i),o.appendChild(this.__wrapTextLink(r,a))}fillText(t,e,s){this.__applyText(t,e,s,"fill")}strokeText(t,e,s){this.__applyText(t,e,s,"stroke")}measureText(t){return this.__ctx.font=this.font,this.__ctx.measureText(t)}arc(t,e,s,i,r,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+s*Math.cos(r),h=e+s*Math.sin(r),c=t+s*Math.cos(i),l=e+s*Math.sin(i),u=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,l),this.__addPathCommand(Pt("A {rx} {ry} {xAxisRotation} {largeArcFlag} {sweepFlag} {endX} {endY}",{rx:s,ry:s,xAxisRotation:0,largeArcFlag:m,sweepFlag:u,endX:a,endY:h})),this.__currentPosition={x:a,y:h}}clip(){const t=this.__closestGroupOrSvg(),e=this.__createElement("clipPath"),s=jn(this.__ids),i=this.__createElement("g");this.__applyCurrentDefaultPath(),t.removeChild(this.__currentElement),e.setAttribute("id",s),e.appendChild(this.__currentElement),this.__SVGdefs.appendChild(e),t.setAttribute("clip-path",Pt("url(#{id})",{id:s})),t.appendChild(i),this.__currentElement=i}drawImage(...t){let e=t[0],s,i,r,o,a=0,h=0,c,l,u,m,f,p,y,S;if(t.length===3)s=t[1],i=t[2],c=e.width,l=e.height,r=c,o=l;else if(t.length===5)s=t[1],i=t[2],r=t[3],o=t[4],c=e.width,l=e.height;else if(t.length===9)a=t[1],h=t[2],c=t[3],l=t[4],s=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 v="translate("+s+", "+i+")";if(e instanceof pa){if(u=e.getSvg().cloneNode(!0),u.childNodes&&u.childNodes.length>1){for(m=u.childNodes[0];m.childNodes.length;)S=m.childNodes[0].getAttribute("id"),this.__ids[S]=S,this.__SVGdefs.appendChild(m.childNodes[0]);if(f=u.childNodes[1],f){const x=f.getAttribute("transform");let b;x?b=x+" "+v:b=v,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||l!==e.height)&&(y=this.__document.createElement("canvas"),y.width=r,y.height=o,y.getContext("2d")?.drawImage(e,a,h,c,l,0,0,r,o),e=y),p.setAttribute("transform",v),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 s=this.__document.createElementNS("http://www.w3.org/2000/svg","pattern"),i=jn(this.__ids);let r;return s.setAttribute("id",i),t.nodeName==="CANVAS"||t.nodeName==="IMG"?(r=this.__document.createElementNS("http://www.w3.org/2000/svg","image"),r.setAttribute("width",""+t.width),r.setAttribute("height",""+t.height),r.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",t.nodeName==="CANVAS"?t.toDataURL():t.getAttribute("src")),s.appendChild(r),this.__SVGdefs.appendChild(s)):t instanceof pa&&(s.setAttribute("width",""+t.width),s.setAttribute("height",""+t.height),s.appendChild(t.__rootSVG.childNodes[1]),this.__SVGdefs.appendChild(s)),new Ur(s,this)}setLineDash(t){t&&t.length>0?this.lineDash=t.join(","):this.lineDash=null}drawFocusRing(){}createImageData(){}getImageData(){}putImageData(){}globalCompositeOperation(){}setTransform(){}},$r=class{canvas;context;customContext;currentPath2D=new Path2D;path2Ds=[];currentMatrix=new DOMMatrix;hasSetCustomStrokeStyle=!1;hasSetCustomFillStyle=!1;constructor(t,e,s,i=!1){this.canvas=t,this.context=t.getContext("2d",{willReadFrequently:!0}),i&&(this.customContext=new Pc({canvas:this.canvas,width:e||this.canvas.width,height:s||this.canvas.height}))}set lineWidth(t){this.hasSetCustomStrokeStyle=!0,this.context.lineWidth=t,this.customContext&&(this.customContext.lineWidth=t)}get lineWidth(){return this.context.lineWidth}set lineCap(t){this.hasSetCustomStrokeStyle=!0,this.context.lineCap=t,this.customContext&&(this.customContext.lineCap=t)}get lineCap(){return this.context.lineCap}set lineJoin(t){this.hasSetCustomStrokeStyle=!0,this.context.lineJoin=t,this.customContext&&(this.customContext.lineCap=t)}get lineJoin(){return this.context.lineJoin}set lineDashOffset(t){this.hasSetCustomStrokeStyle=!0,this.context.lineDashOffset=t,this.customContext&&(this.customContext.lineDashOffset=t)}get lineDashOffset(){return this.context.lineDashOffset}set miterLimit(t){this.hasSetCustomStrokeStyle=!0,this.context.miterLimit=t,this.customContext&&(this.customContext.miterLimit=t)}get miterLimit(){return this.context.miterLimit}set globalAlpha(t){this.context.globalAlpha=t,this.customContext&&(this.customContext.globalAlpha=t)}get globalAlpha(){return this.context.globalAlpha}set fillStyle(t){this.hasSetCustomFillStyle=!0,typeof t=="string"||t instanceof CanvasGradient||t instanceof CanvasPattern?(this.context.fillStyle=t,this.customContext&&(this.customContext.fillStyle=t)):(this.context.fillStyle=t.gradient,this.customContext&&(this.customContext.fillStyle=t.gradientCustom))}get fillStyle(){return this.context.fillStyle}set strokeStyle(t){this.hasSetCustomStrokeStyle=!0,typeof t=="string"||t instanceof CanvasGradient||t instanceof CanvasPattern?(this.context.strokeStyle=t,this.customContext&&(this.customContext.strokeStyle=t)):(this.context.strokeStyle=t.gradient,this.customContext&&(this.customContext.strokeStyle=t.gradientCustom))}get strokeStyle(){return this.context.strokeStyle}set font(t){this.context.font=t,this.customContext&&(this.customContext.font=t)}get font(){return this.context.font}set textBaseline(t){this.context.textBaseline=t,this.customContext&&(this.customContext.textBaseline=t)}get textBaseline(){return this.context.textBaseline}set textAlign(t){this.context.textAlign=t,this.customContext&&(this.customContext.textAlign=t)}get textAlign(){return this.context.textAlign}fill(t){return t?this.context.fill(t):(this.context.fill(),this.customContext&&this.customContext.fill()),this}fillRect(t,e,s,i){return this.context.fillRect(t,e,s,i),this.customContext&&this.customContext.fillRect(t,e,s,i),this}fillText(t,e,s,i){return this.hasSetCustomFillStyle=!1,this.context.fillText(t,e,s,i),this.customContext&&this.customContext.fillText(t,e,s),this}setLineDash(t){return this.context.setLineDash(t),this.customContext&&this.customContext.setLineDash(t),this}stroke(t){return t?this.context.stroke(t):(this.context.stroke(),this.customContext&&this.customContext.stroke()),this}strokeText(t,e,s,i){return this.context.strokeText(t,e,s,i),this.customContext&&this.customContext.strokeText(t,e,s),this}strokeRect(t,e,s,i){return this.context.strokeRect(t,e,s,i),this.customContext&&this.customContext.strokeRect(t,e,s,i),this}measureText(t){return this.context.measureText(t)}clearRect(t=0,e=0,s=this.canvas.width,i=this.canvas.height){return this.context.clearRect(t,e,s,i),this.customContext&&this.customContext.clearRect(t,e,s,i),this}save(){return this.context.save(),this.customContext&&this.customContext.save(),this.currentMatrix=new DOMMatrix,this.path2Ds.push(this.currentPath2D),this.currentPath2D=new Path2D,this}restore(){return this.context.restore(),this.customContext&&this.customContext.restore(),this.hasSetCustomStrokeStyle=!1,this.hasSetCustomFillStyle=!1,this.currentMatrix=new DOMMatrix,this.currentPath2D=this.path2Ds.pop()||new Path2D,this}beginPath(){return this.context.beginPath(),this.customContext&&this.customContext.beginPath(),this}closePath(){return this.context.closePath(),this.customContext&&this.customContext.closePath(),this.currentPath2D.closePath(),this}changePath2D(t=this.currentPath2D,e=this.currentMatrix){const s=new Path2D;s.addPath(t,e),this.currentPath2D=s}isPointInStroke(...t){return t[0]instanceof Path2D?this.context.isPointInStroke(t[0],t[1],t[2]):this.context.isPointInStroke(t[0],t[1])}isPointInPath(...t){return t[0]instanceof Path2D?this.context.isPointInPath(t[0],t[1],t[2]):this.context.isPointInPath(t[0],t[1])}translate(t,e){return this.context.translate(t,e),this.customContext&&this.customContext.translate(t,e),this.currentMatrix.translate(t,e),this.changePath2D(),this}rotate(t,e=0,s=0){return this.translate(e,s),this.context.rotate(t),this.customContext&&this.customContext.rotate(t),this.currentMatrix.rotate(t),this.translate(-e,-s),this.changePath2D(),this}scale(t,e=t,s=0,i=0){return this.translate(s,i),this.context.scale(t,e),this.customContext&&this.customContext.scale(t,e),this.currentMatrix.scale(t,e),this.translate(-s,-i),this.changePath2D(),this}moveTo(t,e){return this.context.moveTo(t,e),this.customContext&&this.customContext.moveTo(t,e),this.currentPath2D.moveTo(t,e),this}lineTo(t,e){return this.context.lineTo(t,e),this.customContext&&this.customContext.lineTo(t,e),this.currentPath2D.lineTo(t,e),this}arc(t,e,s,i,r,o){return this.context.arc(t,e,s,i,r,o),this.customContext&&this.customContext.arc(t,e,s,i,r,o?-1:1),this.currentPath2D.arc(t,e,s,i,r,o),this}arcTo(t,e,s,i,r){return this.context.arcTo(t,e,s,i,r),this.customContext&&this.customContext.arcTo(t,e,s,i,r),this.currentPath2D.arcTo(t,e,s,i,r),this}ellipse(t,e,s,i,r,o,a,h){return this.context.ellipse(t,e,s,i,r,o,a,h),this.currentPath2D.ellipse(t,e,s,i,r,o,a,h),this}quadraticCurveTo(t,e,s,i){return this.context.quadraticCurveTo(t,e,s,i),this.customContext&&this.customContext.quadraticCurveTo(t,e,s,i),this.currentPath2D.quadraticCurveTo(t,e,s,i),this}bezierCurveTo(t,e,s,i,r,o){return this.context.bezierCurveTo(t,e,s,i,r,o),this.customContext&&this.customContext.bezierCurveTo(t,e,s,i,r,o),this.currentPath2D.bezierCurveTo(t,e,s,i,r,o),this}rect(t,e,s,i){return this.context.rect(t,e,s,i),this.customContext&&this.customContext.rect(t,e,s,i),this.currentPath2D.rect(t,e,s,i),this}createLinearGradient(t,e,s,i,r){const o=this.context.createLinearGradient(t,e,s,i);return r&&Object.entries(r).forEach(([a,h])=>{o.addColorStop(parseFloat(a),h)}),o}createRadialGradient(t,e,s,i,r,o,a){const h=this.context.createRadialGradient(t,e,s,i,r,o);return a&&Object.entries(a).forEach(([c,l])=>{h.addColorStop(parseFloat(c),l)}),h}drawImage(t,...e){if(e.length===0)this.context.drawImage(t,0,0);else if(e.length===2){const s=e[0],i=e[1];this.context.drawImage(t,s,i)}else if(e.length===4){const s=e[0],i=e[1],r=e[2],o=e[3];this.context.drawImage(t,s,i,r,o)}else if(e.length===8){const s=e[0],i=e[1],r=e[2],o=e[3],a=e[4],h=e[5],c=e[6],l=e[7];this.context.drawImage(t,s,i,r,o,a,h,c,l)}else throw new Error("Invalid number of arguments passed to drawImage: "+e.length);return this.customContext&&this.customContext.drawImage(t,...e),this}getImageData(t=0,e=0,s=this.canvas.width,i=this.canvas.height,r){return this.context.getImageData(t,e,s,i,r)}putImageData(t,e=0,s=0){return this.context.putImageData(t,e,s)}createPattern(t,e){return this.context.createPattern(t,e)}toRawSVG(){if(this.customContext){const t=this.customContext.getSerializedSvg(!0),e=this.customContext.getSvg();return{raw:t,element:e}}else return{raw:"",element:null}}},Vr=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=zt(this.x,this.y,this.toX,this.toY);if(t===0){const e=Math.min(this.x,this.toX),s=Math.min(this.y,this.toY),i=Math.max(this.x,this.toX),r=Math.max(this.y,this.toY);return{x:e,y:s,width:i-e,height:r-s}}else{const e=Math.sin(t),s=Math.cos(t),i=s*this.x-e*this.y,r=s*this.toX-e*this.toY,o=s*this.y+e*this.x,a=s*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,s=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-s)/o,c=(t.y-r)/a;if(o){if(!a)return{x:i,y:h*(i-e)+s}}else return{x:e,y:c*(e-i)+r};const l=(-c*i+r+h*e-s)/(h-c),u=h*(l-e)+s;return isNaN(l)||isNaN(u)?null:{x:l,y:u}}};const kg=class extends Vr{rx;ry;xAxisRotate;largeArcFlag;sweepFlag;constructor(t){super(t),this.rx=t.rx,this.ry=t.ry,this.xAxisRotate=t?.xAxisRotate??0,this.largeArcFlag=t?.largeArcFlag??1,this.sweepFlag=t?.sweepFlag??1,this.toX=t.toX,this.toY=t.toY}toSVGPathData(){return[["A",this.rx,this.ry,this.xAxisRotate,this.largeArcFlag,this.sweepFlag,this.toX,this.toY]]}toCanvasContext(t){const[e,s,i,r,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,s,i,r,o,a,h,!this.sweepFlag)}convert(t,e,s,i,r,o,a,h,c){const l=a/180*Math.PI,u=(t-s)/2,m=(e-i)/2,f=Math.cos(l)*u+Math.sin(l)*m,p=-Math.sin(l)*u+Math.cos(l)*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 S=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,v=w*S*r*p/o,x=w*S*-o*f/r,b=(t+s)/2,P=(e+i)/2,C=Math.cos(l)*v-Math.sin(l)*x+b,D=Math.sin(l)*v+Math.cos(l)*x+P,B=(G,J,it,tt)=>(G*tt>=J*it?1:-1)*Math.acos((G*it+J*tt)/(Math.sqrt(G*G+J*J)*Math.sqrt(it*it+tt*tt))),Y=B(1,0,t-C,e-D)-l,V=B(t-C,e-D,s-C,i-D);return[C,D,r,o,l,Y,Y+V]}},Dg=class extends Vr{cx;cy;isLineThrough;constructor(t){super(t),this.cx=t.cx,this.cy=t.cy,this.isLineThrough=typeof t.isLineThrough=="boolean"?t.isLineThrough:!1}toSVGPathData(){if(this.isLineThrough){const t=this.cx*2-(this.x+this.toX)/2,e=this.cy*2-(this.y+this.toY)/2;return[["Q",t,e,this.toX,this.toY]]}else return[["Q",this.cx,this.cy,this.toX,this.toY]]}toCanvasContext(t){if(this.isLineThrough){const e=this.cx*2-(this.x+this.toX)/2,s=this.cy*2-(this.y+this.toY)/2;t.quadraticCurveTo(e,s,this.toX,this.toY)}else t.quadraticCurveTo(this.cx,this.cy,this.toX,this.toY)}getBoundingClientRect(){const t=[this.x,this.toX],e=[this.y,this.toY];let s,i,r,o;for(let c=0;c<2;++c)s=c==0?this.x-2*this.cx+this.toX:this.y-2*this.cy+this.toY,i=c==0?-2*this.x+2*this.cx:-2*this.y+2*this.cy,r=c==0?this.x:this.y,Math.abs(s)>1e-12&&(o=-i/(2*s),0<o&&o<1&&[t,e][c].push(s*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}}},ke=class dn extends Vr{c1x;c1y;c2x;c2y;constructor(t){super(t),this.c1x=t.c1x,this.c1y=t.c1y,this.c2x=t.c2x,this.c2y=t.c2y}toSVGPathData(){return[["C",this.c1x,this.c1y,this.c2x,this.c2y,this.toX,this.toY]]}toCanvasContext(t){t.bezierCurveTo(this.c1x,this.c1y,this.c2x,this.c2y,this.toX,this.toY)}getBoundingClientRect(){let t=this.c2x-2*this.c1x+this.x-(this.toX-2*this.c2x+this.c1x),e=2*(this.c1x-this.x)-2*(this.c2x-this.c1x),s=this.x-this.c1x,i=(-e+Math.sqrt(e*e-4*t*s))/2/t,r=(-e-Math.sqrt(e*e-4*t*s))/2/t;const 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),s=this.y-this.c1y,i=(-e+Math.sqrt(e*e-4*t*s))/2/t,r=(-e-Math.sqrt(e*e-4*t*s))/2/t,Math.abs(i)>1e12&&(i=.5),Math.abs(r)>1e12&&(r=.5),i>=0&&i<=1&&(h=this.interpolate(i),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 l=[],u=c.length;for(let p=0;p<u;p++){for(let y=p+1;y<u;y++)c[p].X===c[y].X&&c[p].Y===c[y].Y&&(y=++p);l.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:l}}interpolate(t){return{x:Math.pow(1-t,3)*this.x+3*Math.pow(1-t,2)*t*this.c1x+3*Math.pow(1-t,1)*Math.pow(t,2)*this.c2x+Math.pow(t,3)*this.toX,y:Math.pow(1-t,3)*this.y+3*Math.pow(1-t,2)*t*this.c1y+3*Math.pow(1-t,1)*Math.pow(t,2)*this.c2y+Math.pow(t,3)*this.toY}}static base3(t,e,s,i,r){const o=-3*e+9*s-9*i+3*r,a=t*o+6*e-12*s+6*i;return t*a-3*e+3*s}static bezlen(t,e,s,i,r,o,a,h,c=1){c=Math.max(0,Math.min(c,1));const l=c/2,u=[-.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=l*u[p]+l,S=this.base3(y,t,s,r,a),w=this.base3(y,e,i,o,h);f+=m[p]*Math.sqrt(S*S+w*w)}return l*f}length(t=1){return dn.bezlen(this.x,this.y,this.c1x,this.c1y,this.c2x,this.c2y,this.toX,this.toY,t)}getTatLen(t){const e=this.x,s=this.y,i=this.c1x,r=this.c1y,o=this.c2x,a=this.c2y,h=this.toX,c=this.toY;if(t<0||dn.bezlen(e,s,i,r,o,a,h,c)<t)return 0;const l=1;let u=l/2,m=l-u,f=dn.bezlen(e,s,i,r,o,a,h,c,m);for(;Math.abs(f-t)>.01;)u/=2,m+=(f<t?1:-1)*u,f=dn.bezlen(e,s,i,r,o,a,h,c,m);return m}getPointAtSegmentLength(t){const e=this.getTatLen(t),s=1-e,i=Math.pow(s,3),r=Math.pow(s,2),o=e*e,a=o*e,h=i*this.x+r*3*e*this.c1x+s*3*e*e*this.c2x+a*this.toX,c=i*this.y+r*3*e*this.c1y+s*3*e*e*this.c2y+a*this.toY,l=this.x+2*e*(this.c1x-this.x)+o*(this.c2x-2*this.c1x+this.x),u=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=s*this.x+e*this.c1x,y=s*this.y+e*this.c1y,S=s*this.c2x+e*this.toX,w=s*this.c2y+e*this.toY,v=90-Math.atan2(l-m,u-f)*180/Math.PI;return{x:h,y:c,m:{x:l,y:u},n:{x:m,y:f},start:{x:p,y},end:{x:S,y:w},alpha:v}}},qs=Math.PI*2;function Ec(n,t,e,s){const i=n*s-t*e<0?-1:1;let r=n*e+t*s;return r>1&&(r=1),r<-1&&(r=-1),i*Math.acos(r)}function Lg(n,t,e,s,i,r,o,a,h,c){const l=c*(n-e)/2+h*(t-s)/2,u=-h*(n-e)/2+c*(t-s)/2,m=o*o,f=a*a,p=l*l,y=u*u;let S=m*f-m*y-f*p;S<0&&(S=0),S/=m*y+f*p,S=Math.sqrt(S)*(i===r?-1:1);const w=S*o/a*u,v=S*-a/o*l,x=c*w-h*v+(n+e)/2,b=h*w+c*v+(t+s)/2,P=(l-w)/o,C=(u-v)/a,D=(-l-w)/o,B=(-u-v)/a,Y=Ec(1,0,P,C);let V=Ec(P,C,D,B);return r===0&&V>0&&(V-=qs),r===1&&V<0&&(V+=qs),[x,b,Y,V]}function Rg(n,t){const e=1.3333333333333333*Math.tan(t/4),s=Math.cos(n),i=Math.sin(n),r=Math.cos(n+t),o=Math.sin(n+t);return[s,i,s-i*e,i+s*e,r+o*e,o-r*e,r,o]}function Mc(n,t,e,s,i,r,o,a,h){const c=Math.sin(h*qs/360),l=Math.cos(h*qs/360),u=l*(n-e)/2+c*(t-s)/2,m=-c*(n-e)/2+l*(t-s)/2;if(u===0&&m===0)return[];if(o===0||a===0)return[];o=Math.abs(o),a=Math.abs(a);const f=u*u/(o*o)+m*m/(a*a);f>1&&(o*=Math.sqrt(f),a*=Math.sqrt(f));const p=Lg(n,t,e,s,i,r,o,a,c,l),y=[];let S=p[2],w=p[3];const v=Math.max(Math.ceil(Math.abs(w)/(qs/4)),1);w/=v;for(let x=0;x<v;x++)y.push(Rg(S,w)),S+=w;return y.map(x=>{for(let b=0;b<x.length;b+=2){let P=x[b+0],C=x[b+1];P*=o,C*=a;const D=l*P-c*C,B=c*P+l*C;x[b+0]=D+p[0],x[b+1]=B+p[1]}return x})}function Gr(n,t,e,s,i,r){return[n/3+.6666666666666666*e,t/3+.6666666666666666*s,i/3+.6666666666666666*e,r/3+.6666666666666666*s,i,r]}function js(n,t,e,s){return[n,t,e,s,e,s]}const Hs={a:7,c:6,s:4,q:4,t:2,m:2,l:2,h:1,v:1,z:0};class He{static createSVGElement(t="path",e){const s=document.createElementNS.call(document,"http://www.w3.org/2000/svg",t);return e&&oe(s,e),s}static createSvgPath(t,e){return this.createSVGElement("path",{d:t,id:e||Ms()})}static downloadFromSVGElement(t,e="shape"){return Kn(fr(t),`${e}.svg`)}static downloadFromSVGString(t,e="shape"){return Kn(Oi(t),`${e}.svg`)}static getSVGRawStringFromElement(t){return ur(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 He.isSVGPath(t)&&t.replace(/([mlhvzaqtcs])([^mlhvzaqtcs]*)/gi,(s,i,r)=>{let o=i.toLowerCase();const a=Li(r);for(o=="m"&&a.length>Hs[o]&&(e.push([i,...a.splice(0,Hs[o])]),o="l",i=i=="m"?"l":"L");a.length;){if(a.length<Hs[o])throw new Error(`parseSVGPath substring:{ ${s} } command:{ ${i} } args:{ ${a} }`);e.push([i,...a.splice(0,Hs[o])])}return o=="z"&&e.push([i]),""}),e}static absolutizeSVGPath(t){let e=0,s=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=s;break;case"H":i=o[1];break;case"V":r=o[1];break;case"M":i=e=o[1],r=s=o[2];break;default:i=o[o.length-2],r=o[o.length-1]}return o})}static relativeSVGPath(t){let e=0,s=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=s;break;case"h":i+=o[1];break;case"v":r+=o[1];break;case"m":i+=o[1],r+=o[2],e+=o[1],s+=o[2];break;default:i+=o[o.length-2],r+=o[o.length-1]}return o})}static normalizeSVGPath(t){const e=[];let s=0,i=0,r=0,o=0,a=0,h=0,c=0,l=0,u;for(let m=0,f=t.length;m<f;m++){let p=t[m];const y=p[0];switch(y){case"M":s=p[1],i=p[2];break;case"A":const S=Mc(r,o,p[6],p[7],p[4],p[5],p[1],p[2],p[3]);if(!S.length)continue;S.forEach((x,b)=>{const[P,C,D,B,Y,V,G,J]=x;p=["C",D,B,Y,V,G,J],b<S.length-1&&e.push(p)});break;case"S":let w=r,v=o;(u=="C"||u=="S")&&(w+=w-c,v+=v-l),p=["C",w,v,p[1],p[2],p[3],p[4]];break;case"T":u=="Q"||u=="T"?(a=r*2-a,h=o*2-h):(a=r,h=o),p=["C",...Gr(r,o,a,h,p[1],p[2])];break;case"Q":a=p[1],h=p[2],p=["C",...Gr(r,o,p[1],p[2],p[3],p[4])];break;case"L":p=["C",...js(r,o,p[1],p[2])];break;case"H":p=["C",...js(r,o,p[1],o)];break;case"V":p=["C",...js(r,o,r,p[1])];break;case"Z":p=["C",...js(r,o,s,i)];break}u=y,r=p[p.length-2],o=p[p.length-1],p.length>4?(c=p[p.length-4],l=p[p.length-3]):(c=r,l=o),e.push(p)}return e}static catmullRom2bezier(t){const e=[];for(let s=0,i=t.length;i-2>s;s+=2){let r;s==0?r=[{x:t[s],y:t[s+1]},{x:t[s],y:t[s+1]},{x:t[s+2],y:t[s+3]},{x:t[s+4],y:t[s+5]}]:i-4==s?r=[{x:t[s-2],y:t[s-1]},{x:t[s],y:t[s+1]},{x:t[s+2],y:t[s+3]},{x:t[s+2],y:t[s+3]}]:r=[{x:t[s-2],y:t[s-1]},{x:t[s],y:t[s+1]},{x:t[s+2],y:t[s+3]},{x:t[s+4],y:t[s+5]}];const 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 s=["L",0,0],i;for(let r=0,o=t.length;r<o;r++){const a=t[r];switch(a[0]){case"M":s=["L",a[1],a[2]],e.push(a);break;case"Z":e.push(s);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 s,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,s&&(s[0]===c.to?(i=2*Number(s[c.x+2])-Number(s[c.x]),r=2*Number(s[c.x+3])-Number(s[c.x+1])):(i=Number(s[s.length-2]),r=Number(s[s.length-1]))),h.splice(1,0,i,r)),s=h}return t}}let Og=class _e{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(He.parseSVGPath(t),e):t instanceof _e?this.resetFromSVGPathData(t.toSVGPathData(),e):this.resetFromSVGPathData(t||[],e)}resetFromSVGPathData(t,e){this.normalizedLines=[];const s=He.normalizeSVGPath(He.absolutizeSVGPath(t));this.prevPathX=this.startPathX=0,this.prevPathY=this.startPathY=0;let i=!1;for(let r=0,o=s.length;r<o;r++){const a=s[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 ke({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 _e;e.prevPathX=e.startPathX=t[0]||0,e.prevPathY=e.startPathY=t[1]||0;for(let s=2,i=t.length;s+5<i;s+=6)e.appendLine(new ke({c1x:t[s],c1y:t[s+1],c2x:t[s+2],c2y:t[s+3],toX:t[s+4],toY:t[s+5]}));return e}static fromLines(t){const e=new _e;e.prevPathX=e.startPathX=t[0].x||0,e.prevPathY=e.startPathY=t[0].y||0;for(let s=0,i=t.length;s<i;s++)e.appendLine(t[s]);return e}appendLine(t){if(t instanceof kg){Mc(this.prevPathX,this.prevPathY,t.toX,t.toY,t.largeArcFlag,t.sweepFlag,t.rx,t.ry,t.xAxisRotate).forEach(c=>{const[l,u,m,f,p,y,S,w]=c;this.normalizedLines.push(new ke({x:this.prevPathX,y:this.prevPathY,c1x:m,c1y:f,c2x:p,c2y:y,toX:S,toY:w})),this.prevPathX=S,this.prevPathY=w});return}let e,s,i,r,o,a;t instanceof ke?(e=t.c1x,s=t.c1y,i=t.c2x,r=t.c2y,o=t.toX,a=t.toY):t instanceof Dg?[e,s,i,r,o,a]=Gr(this.prevPathX,this.prevPathY,t.cx,t.cy,t.toX,t.toY):[e,s,i,r,o,a]=js(this.prevPathX,this.prevPathY,t.toX,t.toY),this.normalizedLines.push(new ke({x:this.prevPathX,y:this.prevPathY,c1x:e,c1y:s,c2x:i,c2y:r,toX:o,toY:a})),this.prevPathX=o,this.prevPathY=a}toSVGPathData(){const{startPathX:t,startPathY:e,normalizedLines:s}=this.updateTransform(),i=[];i.push(["M",t,e]);for(let r=0,o=s.length;r<o;r++)i.push(...s[r].toSVGPathData());return i}toSVGPathD(){return He.SVGPathDataToD(this.toSVGPathData())}toCanvasContext(t){const{startPathX:e,startPathY:s,normalizedLines:i}=this.updateTransform();t.beginPath(),t.moveTo(e,s),i.forEach(r=>{r.toCanvasContext(t)})}getBoundingClientRect(){const{normalizedLines:t}=this.updateTransform(),e=[],s=[];if(t.forEach(h=>{const c=h.getBoundingClientRect();e.push(c.x,c.x+c.width),s.push(c.y,c.y+c.height)}),e.length==0||s.length==0)return{x:0,y:0,width:0,height:0};const i=Math.min.apply(0,e),r=Math.min.apply(0,s),o=Math.max.apply(0,e),a=Math.max.apply(0,s);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 wt;if(t.translate(this.x+this.cX,this.y+this.cY),t.rotate(this.degree),t.scale(this.scalarX,this.scalarY),t.translate(-this.cX,-this.cY),t.isIdentity)return{startPathX:this.startPathX,startPathY:this.startPathY,normalizedLines:this.normalizedLines};{let e=this.startPathX,s=this.startPathY;({x:e,y:s}=t.transformPoint({x:e,y:s}));const i=[];return this.normalizedLines.forEach(r=>{let o=r.x,a=r.y,h=r.c1x,c=r.c1y,l=r.c2x,u=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:l,y:u}=t.transformPoint({x:l,y:u}),{x:m,y:f}=t.transformPoint({x:m,y:f}),i.push(new ke({x:o,y:a,c1x:h,c1y:c,c2x:l,c2y:u,toX:m,toY:f}))}),{startPathX:e,startPathY:s,normalizedLines:i}}}getTotalLength(){const{normalizedLines:t}=this.updateTransform();return t.reduce((e,s)=>e+=s.length(),0)}getPointAtLength(t){const{normalizedLines:e}=this.updateTransform();let s=0;const i=e.length;for(let r=0;r<i;r++){const o=e[r],a=o.length();if(s+a>=t)return o.getPointAtSegmentLength(t-s);s+=a}return e[i-1].getPointAtSegmentLength(1)}interpolate(t){const{startPathX:e,startPathY:s,normalizedLines:i}=this.updateTransform(),r=i.length;if(r===0)return{x:e,y:s};if(r===1)return i[0].interpolate(t);{let 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 s=this.getSubpathsAtLength(this,e,1);return t?this.getSubpathsAtLength(s,t):s}}getSubpathsAtLength(t,e,s){const{startPathX:i,startPathY:r,normalizedLines:o}=t.updateTransform();let a=null,h=0;const c=new _e;c.prevPathX=c.startPathX=i,c.prevPathY=c.startPathY=r;for(let l=0,u=o.length;l<u;l++){const m=o[l],f=m.length();if(h+f>e&&!a){const p=m.getPointAtSegmentLength(e-h);if(c.appendLine(new ke({c1x:p.start.x,c1y:p.start.y,c2x:p.m.x,c2y:p.m.y,toX:p.x,toY:p.y})),s)return c;a=c,c.appendLine(new ke({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 s=this.getTotalLength();let i={x:t,y:e},r=0,o=1/0,a=8;for(let c=0;c<=s;c+=a){const l=this.getPointAtLength(c),u=Math.pow(Ae(l.x,l.y,t,e),2);u<o&&(i=l,r=c,o=u)}for(a/=2;a>.5;){const c=r-a,l=this.getPointAtLength(c),u=Math.pow(Ae(l.x,l.y,t,e),2),m=r+a,f=this.getPointAtLength(m),p=Math.pow(Ae(f.x,f.y,t,e),2);c>=0&&u<o?(i=l,r=c,o=u):m<=s&&p<o?(i=f,r=m,o=p):a/=2}const h=this.getPointAtLength(r+(r===s?-.1:.1));return{point:i,rotation:r>=s?zt(h.x,h.y,i.x,i.y):zt(i.x,i.y,h.x,h.y),distance:Math.sqrt(o)}}get polymorphPoints(){const{startPathX:t,startPathY:e,normalizedLines:s}=this.updateTransform();return[t,e].concat(s.reduce((i,r)=>i.concat([r.c1x,r.c1y,r.c2x,r.c2y,r.toX,r.toY]),[]))}perimeterPoints(){const t=this.polymorphPoints,e=t.length;let s=t[e-2],i=t[e-1],r=0;for(let o=0;o<e;o+=6)r+=Ae(t[o],t[o+1],s,i),s=t[o],i=t[o+1];return Math.floor(r)}expendFill(t){const e=this.polymorphPoints,s=e.length;let i=t-s;const r=Math.ceil(t/s),o=[];o.push(["M",e[0],e[1]]);let a=2;for(;a+5<=s-1;){const h=e[a++],c=e[a++],l=e[a++],u=e[a++],m=e[a++],f=e[a++];o.push(["C",h,c,l,u,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,s){const i=t.length,r=new Array(i);for(let o=0;o<i;o++)r[o]=F(t[o]+(e[o]-t[o])*s,6);return r}static getPathInterpolator(t,e){return s=>Math.abs(s-0)<Number.EPSILON?t:Math.abs(s-1)<Number.EPSILON?e:_e.fromPolymorphPoints(_e.mixPoints(new _e({d:t}).polymorphPoints,new _e({d:e}).polymorphPoints,s)).toSVGPathData()}},zg=class extends _n{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=Ms(),t?.d&&(this.originD=t?.d),t?.originMatrix&&(this.originMatrix=t.originMatrix),this.independentTransformInGroup=typeof t?.independentTransformInGroup=="boolean"?t.independentTransformInGroup:!1,this.x=t?.x||0,this.y=t?.y||0,this.cX=0,this.cY=0,typeof t?.centerX=="number"&&typeof t?.centerY=="number"&&this.forceSetCXY(t.centerX-this.x,t.centerY-this.y),this.degree=t?.degree||0,this.scalarX=1,this.scalarY=1,t?.scalar!==void 0&&(this.scalarX=t.scalar,this.scalarY=t.scalar),t?.scalarX!==void 0&&(this.scalarX=t.scalarX),t?.scalarY!==void 0&&(this.scalarY=t.scalarY),this.diffXInGroup=t?.diffXInGroup||0,this.diffYInGroup=t?.diffYInGroup||0,this.diffDegreeInGroup=t?.diffDegreeInGroup||0,this.diffScalarXInGroup=t?.diffScalarXInGroup||1,this.diffScalarYInGroup=t?.diffScalarYInGroup||1,this.vx=t?.vx||0,this.vy=t?.vy||0,this.ax=t?.ax||0,this.ay=t?.ay||0,this.mass=t?.mass||1,this.attrs={stroke:"none",fill:"none"},t?.attrs&&this.setAttr(t?.attrs),this.enableDrag=t?.enableDrag||!1,this.alongPath=t?.alongPath,this.targetToAfterDragFree=t?.targetToAfterDragFree,this.followMouse=t?.followMouse||!1,this.isShow=typeof t?.isShow=="boolean"?t?.isShow:!0,this.strokeArmyAnts=t?.strokeArmyAnts||!1,this.strokeArmyAnts){const s=this.getAttr("stroke-dasharray","4 4");this.setAttr("stroke-dasharray",s),this.strokeDashTotalLength=Li(s).reduce((i,r)=>i+r,0)}return Ga(this)}forceSetCXY(t,e){this.cX=t,this.cY=e,this.forceCXY=!0}shapeInit(){}initPathD(){if(!this.pathd){if(this.pathd=new Og,Ht(()=>{this.pathd?.reset(this.originD||this.toSVGPathData(),this.originMatrix)}),this.pathd&&!this.forceCXY){const t=this.shapes.length==0?this.pathd.getBoundingClientRect():this.getBoundingClientRect();t&&(this.pathd.cX=this.cX=t.x+t.width/2-this.pathd.x,this.pathd.cY=this.cY=t.y+t.height/2-this.pathd.y)}this.shapeInit()}return this.pathd}frameStart(t){}frameUpdate(t,e){this.pathd=this.initPathD(),this.pathd.update(this),this.strokeArmyAnts&&(this.isMouseIn||(this.setAttr("stroke-dashoffset",String(this.strokeArmyAntsOffset++)),this.strokeArmyAntsOffset>this.strokeDashTotalLength&&(this.strokeArmyAntsOffset=0)))}frameEnd(t){}toSVGPathData(){return[]}toSVGPathD(){return this.pathd?.toSVGPathD()||""}toCanvasContext(t){this.usePathDtoCanvasContext=!0,this.pathd?.toCanvasContext(t)}getBoundingClientRect(){return this.pathd?.getBoundingClientRect()||null}get center(){const t=this.getBoundingClientRect(),e={x:this.x,y:this.y};return t&&(e.x=t.x+t.width/2,e.y=t.y+t.height/2),e}trim(){if(this.parent)return;const t=this.getBoundingClientRect();if(!t)return;this.shapes.forEach(s=>{const i=s.originMatrix?s.originMatrix.clone():new wt;i.translate(-t.x+s.x,-t.y+s.y),s.originMatrix=i});const e=this.originMatrix?this.originMatrix.clone():new wt;e.translate(-t.x+this.x,-t.y+this.y),this.originMatrix=e}isPointInPath(t,e,s){if(s instanceof $r)return s.isPointInPath(new Path2D(this.toSVGPathD()),t,e);let i;try{i=new SVGPoint(t,e)}catch{i=s.createSVGPoint(),i.x=t,i.y=e}if(this.el instanceof SVGGeometryElement)return this.el.isPointInFill(i);{const r=this.getBoundingClientRect();if(r)return t>=r.x&&t<=r.x+r.width&&e>=r.y&&e<=r.y+r.height}return!1}isPointInStroke(t,e,s){if(s instanceof $r)return s.isPointInStroke(new Path2D(this.toSVGPathD()),t,e);let i;try{i=new SVGPoint(t,e)}catch{i=s.createSVGPoint(),i.x=t,i.y=e}return this.el instanceof SVGGeometryElement?this.el.isPointInStroke(i):!1}clone(){return Pa(this).copy(this)}copy(t){return this.id=t.id,this.originD=t.originD,this.originMatrix=t.originMatrix,this.independentTransformInGroup=t.independentTransformInGroup,this.x=t.x,this.y=t.y,this.cX=t.cX,this.cY=t.cY,this.degree=t.degree,this.scalarX=t.scalarX,this.scalarY=t.scalarY,this.diffXInGroup=t.diffXInGroup,this.diffYInGroup=t.diffYInGroup,this.diffDegreeInGroup=t.diffDegreeInGroup,this.diffScalarXInGroup=t.diffScalarXInGroup,this.diffScalarYInGroup=t.diffScalarYInGroup,this.vx=t.vx,this.vy=t.vy,this.ax=t.ax,this.ay=t.ay,this.mass=t.mass,this.attrs={...t.attrs},this.enableDrag=t.enableDrag,this.alongPath=t.alongPath,this.targetToAfterDragFree=t.targetToAfterDragFree,this.followMouse=t.followMouse,this.isShow=t.isShow,this.strokeArmyAnts=t.strokeArmyAnts,this.strokeDashTotalLength=t.strokeDashTotalLength,this}save(){}restore(){}setAttr(t,e){typeof t!="string"?Object.assign(this.attrs,Object.fromEntries(Object.entries(t).map(([s,i])=>[lt(s),i]))):e&&(this.attrs[lt(t)]=e)}getAttr(t,e){return this.attrs[t]||this.attrs[lt(t)]||e}getAttrs(){return this.attrs}hasAttr(t){return!!this.attrs[t]||!!this.attrs[lt(t)]}distance(t){return Ae(this.x,this.y,t.x,t.y)}rotateTo(t){this.degree=mt(zt(this.x,this.y,t.x,t.y))}followTo(t,e=3){this.rotateTo(t);const{dx:s,dy:i}=Ie(q(this.degree),e);this.vx=s,this.vy=i,this.run()}followAccelerationTo(t,e=.05){this.rotateTo(t);const{dx:s,dy:i}=Ie(q(this.degree),e);this.ax=s,this.ay=i,this.run()}checkCollision(t){}checkWall(t){}gravitateTo(t){const e=t.x-this.x,s=t.y-this.y,i=e*e+s*s,r=Math.sqrt(i),o=this.mass*t.mass/i,a=o*e/r,h=o*s/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=jt(t?.gravity,0);this.vy+=e;const s=jt(t?.friction,1);this.vx*=s,this.vy*=s,this.x+=this.vx,this.y+=this.vy}runEaseTo(t,e){const s=jt(e?.easing,.05),i=t.x-this.cX-this.x,r=t.y-this.cY-this.y;this.vx=i*s,this.vy=r*s,this.run(e)}runSpringTo(t,e){const s=jt(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*s,h=o*s;this.vx+=a,this.vy+=h}),this.run({friction:.9,...e})}springMassTo(t,e){const s=jt(e?.springLength,100),i=jt(e?.spring,1e-4),r=t.x-this.x,o=t.y-this.y,a=Math.sqrt(r*r+o*o);if(a<s){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/s}return 0}getTotalLength(){return this.initPathD().getTotalLength()}interpolate(t){return this.initPathD().interpolate(t)}getPointAtLength(t){return this.initPathD().getPointAtLength(t)}trailPath(t,e=0){const s=this.getTotalLength();return t.originD=this.initPathD().getSubpath(0,e*s),this.getPointAtLength(e*s)}strokeDashTween(t=1e3,e){const s=this.initPathD(),i=F(s.getTotalLength(),0);this.setAttr({strokeDasharray:`${i} ${i}`,strokeDashoffset:`${i}`});const r=e?.onUpdate,o=new $s({frameDuration:t});o.addTween({offset:i},{offset:0},Object.assign(e||{},{onUpdate:(a,h)=>{this.setAttr("strokeDashoffset",""+F(a.offset,2)),r?.(a,h)}})),o.play()}};class Bg extends zg{x;y;z;fl;vpX;vpY;cX;cY;cZ;radius;constructor(t){super(t),this.x=t?.x||0,this.y=t?.y||0,this.z=t?.z||0,this.fl=t?.fl||250,this.vpX=t?.vpX||0,this.vpY=t?.vpY||0,this.cX=t?.cX||0,this.cY=t?.cY||0,this.cZ=t?.cZ||0,this.radius=t?.radius||0}toSVGPathData(){return this.radius?[["M",this.getScreenX(),this.getScreenY()-this.radius],["a",this.radius,this.radius,0,1,1,0,2*this.radius],["a",this.radius,this.radius,0,1,1,0,-2*this.radius],["z"]]:[["M",this.getScreenX(),this.getScreenY()]]}toCanvasContext(t){t.beginPath(),t.arc(0,0,this.radius,0,Math.PI*2,!0),t.closePath()}setVanishingPoint(t,e){this.vpX=t,this.vpY=e}setCenter(t,e,s){this.cX=t,this.cY=e,this.cZ=s}rotateX(t){({x:this.y,y:this.z}=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 ms(this.x,this.y,this.z)}distance(t){const e=t.x-this.x,s=t.y-this.y,i=t.z-this.z;return Math.sqrt(e*e+s*s+i*i)}scalar(t){return this.x*=t,this.y*=t,this.z*=t,this}normalize(t=1){const e=this.length();if(e){const s=t/e;this.scalar(s)}return this}clamp(t){const e=this.length();return e&&e>t&&this.scalar(t/e),this}cross(t){const e=this.x,s=this.y,i=this.z;return{x:s*t.z-i*t.y,y:i*t.x-e*t.z,z:e*t.y-s*t.x}}multiply(t){return{x:this.x*t.x,y:this.y*t.y,z:this.z*t.z}}div(t){return{x:this.x/t.x,y:this.y/t.y,z:this.z/t.z}}add(t){return{x:this.x+t.x,y:this.y+t.y,z:this.z+t.z}}sub(t){return{x:this.x-t.x,y:this.y-t.y,z:this.z-t.z}}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z}reflect(t){const e=this.dot(t);return{x:this.x-2*e*t.x,y:this.y-2*e*t.y,z:this.z-2*e*t.z}}}const Wn=Bg;class qr{_x;_y;_z;_w;constructor(t=0,e=0,s=0,i=1){this._x=t,this._y=e,this._z=s,this._w=i}static slerpFlat(t,e,s,i,r,o,a){let h=s[i+0],c=s[i+1],l=s[i+2],u=s[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]=l,t[e+3]=u;return}if(a===1){t[e+0]=m,t[e+1]=f,t[e+2]=p,t[e+3]=y;return}if(u!==y||h!==m||c!==f||l!==p){let S=1-a;const w=h*m+c*f+l*p+u*y,v=w>=0?1:-1,x=1-w*w;if(x>Number.EPSILON){const P=Math.sqrt(x),C=Math.atan2(P,w*v);S=Math.sin(S*C)/P,a=Math.sin(a*C)/P}const b=a*v;if(h=h*S+m*b,c=c*S+f*b,l=l*S+p*b,u=u*S+y*b,S===1-a){const P=1/Math.sqrt(h*h+c*c+l*l+u*u);h*=P,c*=P,l*=P,u*=P}}t[e]=h,t[e+1]=c,t[e+2]=l,t[e+3]=u}static multiplyQuaternionsFlat(t,e,s,i,r,o){const a=s[i],h=s[i+1],c=s[i+2],l=s[i+3],u=r[o],m=r[o+1],f=r[o+2],p=r[o+3];return t[e]=a*p+l*u+h*f-c*m,t[e+1]=h*p+l*m+c*u-a*f,t[e+2]=c*p+l*f+a*m-h*u,t[e+3]=l*p-a*u-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,s=this._z,i=this._w){return this._x=t,this._y=e,this._z=s,this._w=i,this._onChangeCallback(),this}clone(){return new qr(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 s=t.x,i=t.y,r=t.z,o=t.order,a=Math.cos,h=Math.sin,c=a(s/2),l=a(i/2),u=a(r/2),m=h(s/2),f=h(i/2),p=h(r/2);switch(o){case"XYZ":this._x=m*l*u+c*f*p,this._y=c*f*u-m*l*p,this._z=c*l*p+m*f*u,this._w=c*l*u-m*f*p;break;case"YXZ":this._x=m*l*u+c*f*p,this._y=c*f*u-m*l*p,this._z=c*l*p-m*f*u,this._w=c*l*u+m*f*p;break;case"ZXY":this._x=m*l*u-c*f*p,this._y=c*f*u+m*l*p,this._z=c*l*p+m*f*u,this._w=c*l*u-m*f*p;break;case"ZYX":this._x=m*l*u-c*f*p,this._y=c*f*u+m*l*p,this._z=c*l*p-m*f*u,this._w=c*l*u+m*f*p;break;case"YZX":this._x=m*l*u+c*f*p,this._y=c*f*u+m*l*p,this._z=c*l*p-m*f*u,this._w=c*l*u-m*f*p;break;case"XZY":this._x=m*l*u-c*f*p,this._y=c*f*u-m*l*p,this._z=c*l*p+m*f*u,this._w=c*l*u+m*f*p;break;default:console.warn("Quaternion: .setFromEuler() encountered an unknown order: "+o)}return e===!0&&this._onChangeCallback(),this}setFromAxisAngle(t,e){const s=e/2,i=Math.sin(s);return this._x=t.x*i,this._y=t.y*i,this._z=t.z*i,this._w=Math.cos(s),this._onChangeCallback(),this}setFromRotationMatrix4(t){const e=t.value,s=e[0],i=e[4],r=e[8],o=e[1],a=e[5],h=e[9],c=e[2],l=e[6],u=e[10],m=s+a+u;if(m>0){const f=.5/Math.sqrt(m+1);this._w=.25/f,this._x=(l-h)*f,this._y=(r-c)*f,this._z=(o-i)*f}else if(s>a&&s>u){const f=2*Math.sqrt(1+s-a-u);this._w=(l-h)/f,this._x=.25*f,this._y=(i+o)/f,this._z=(r+c)/f}else if(a>u){const f=2*Math.sqrt(1+a-s-u);this._w=(r-c)/f,this._x=(i+o)/f,this._y=.25*f,this._z=(h+l)/f}else{const f=2*Math.sqrt(1+u-s-a);this._w=(o-i)/f,this._x=(r+c)/f,this._y=(h+l)/f,this._z=.25*f}return this._onChangeCallback(),this}setFromUnitVectors(t,e){let s=t.dot(e)+1;return s<Number.EPSILON?(s=0,Math.abs(t.x)>Math.abs(t.z)?(this._x=-t.y,this._y=t.x,this._z=0,this._w=s):(this._x=0,this._y=-t.z,this._z=t.y,this._w=s)):(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=s),this.normalize()}angleTo(t){return 2*Math.acos(Math.abs(N(this.dot(t),-1,1)))}rotateTowards(t,e){const s=this.angleTo(t);if(s===0)return this;const i=Math.min(1,e/s);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 s=t._x,i=t._y,r=t._z,o=t._w,a=e._x,h=e._y,c=e._z,l=e._w;return this._x=s*l+o*a+i*c-r*h,this._y=i*l+o*h+r*a-s*c,this._z=r*l+o*c+s*h-i*a,this._w=o*l-s*a-i*h-r*c,this._onChangeCallback(),this}slerp(t,e){if(e===0)return this;if(e===1)return this.copy(t);const s=this._x,i=this._y,r=this._z,o=this._w;let a=o*t._w+s*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=s,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*s+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),l=Math.atan2(c,a),u=Math.sin((1-e)*l)/c,m=Math.sin(e*l)/c;return this._w=o*u+this._w*m,this._x=s*u+this._x*m,this._y=i*u+this._y*m,this._z=r*u+this._z*m,this._onChangeCallback(),this}slerpQuaternions(t,e,s){return this.copy(t).slerp(e,s)}random(){const t=2*Math.PI*Math.random(),e=2*Math.PI*Math.random(),s=Math.random(),i=Math.sqrt(1-s),r=Math.sqrt(s);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 Ws{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 Ws(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,s=this.y;return this.x=t.m11*e+t.m21*s+t.m31,this.y=t.m12*e+t.m22*s+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 s=this.length();return this.divideScalar(s||1).multiplyScalar(N(s,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 s=t.dot(this)/e;return this.copy(t).multiplyScalar(s)}perpendOnVector(t){return Ac.copy(this).projectOnVector(t),this.sub(Ac)}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 s=this.dot(t)/e;return Math.acos(N(s,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,s=this.y-t.y;return e*e+s*s}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,s){return this.x=t.x+(e.x-t.x)*s,this.y=t.y+(e.y-t.y)*s,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 s=Math.cos(e),i=Math.sin(e),r=this.x-t.x,o=this.y-t.y;return this.x=r*s-o*i+t.x,this.y=r*i+o*s+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,s=0){this.x=t,this.y=e,this.z=s}set(t=0,e=0,s=0){return this.x=t,this.y=e,this.z=s,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(Ic.setFromEuler(t))}applyAxisAngle(t,e){return this.applyQuaternion(Ic.setFromAxisAngle(t,e))}applyMatrix3(t){const e=this.x,s=this.y,i=this.z,r=t.value;return this.x=r[0]*e+r[3]*s+r[6]*i,this.y=r[1]*e+r[4]*s+r[7]*i,this.z=r[2]*e+r[5]*s+r[8]*i,this}applyNormalMatrix(t){return this.applyMatrix3(t).normalize()}applyMatrix4(t){const e=this.x,s=this.y,i=this.z,r=t.value,o=1/(r[3]*e+r[7]*s+r[11]*i+r[15]);return this.x=(r[0]*e+r[4]*s+r[8]*i+r[12])*o,this.y=(r[1]*e+r[5]*s+r[9]*i+r[13])*o,this.z=(r[2]*e+r[6]*s+r[10]*i+r[14])*o,this}applyQuaternion(t){const e=this.x,s=this.y,i=this.z,r=t.x,o=t.y,a=t.z,h=t.w,c=2*(o*i-a*s),l=2*(a*e-r*i),u=2*(r*s-o*e);return this.x=e+h*c+o*u-a*l,this.y=s+h*l+a*c-r*u,this.z=i+h*u+r*l-o*c,this}transformDirection(t){const e=this.x,s=this.y,i=this.z,r=t.value;return this.x=r[0]*e+r[4]*s+r[8]*i,this.y=r[1]*e+r[5]*s+r[9]*i,this.z=r[2]*e+r[6]*s+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 s=this.length();return this.divideScalar(s||1).multiplyScalar(N(s,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,s){return this.x=t.x+(e.x-t.x)*s,this.y=t.y+(e.y-t.y)*s,this.z=t.z+(e.z-t.z)*s,this}cross(t){return this.crossVectors(this,t)}crossVectors(t,e){const s=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-s*h,this.z=s*a-i*o,this}projectOnVector(t){const e=t.lengthSq();if(e===0)return this.set(0,0,0);const s=t.dot(this)/e;return this.copy(t).multiplyScalar(s)}perpendOnVector(t){return Hr.copy(this).projectOnVector(t),this.sub(Hr)}projectOnPlane(t){return this.perpendOnVector(t)}reflect(t){return this.sub(Hr.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 s=this.dot(t)/e;return Math.acos(N(s,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,s=this.y-t.y,i=this.z-t.z;return e*e+s*s+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(),s=this.setFromMatrix4Column(t,1).length(),i=this.setFromMatrix4Column(t,2).length();return this.x=e,this.y=s,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,s=Math.sqrt(1-e*e);return this.x=s*Math.cos(t),this.y=e,this.z=s*Math.sin(t),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}class jr{x=0;y=0;z=0;w=1;constructor(t=0,e=0,s=0,i=1){this.x=t,this.y=e,this.z=s,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,s=0,i=1){return this.x=t,this.y=e,this.z=s,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 jr(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,s=this.y,i=this.z,r=this.w,o=t.value;return this.x=o[0]*e+o[4]*s+o[8]*i+o[12]*r,this.y=o[1]*e+o[5]*s+o[9]*i+o[13]*r,this.z=o[2]*e+o[6]*s+o[10]*i+o[14]*r,this.w=o[3]*e+o[7]*s+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,s,i,r;const h=t.value,c=h[0],l=h[4],u=h[8],m=h[1],f=h[5],p=h[9],y=h[2],S=h[6],w=h[10];if(Math.abs(l-m)<.01&&Math.abs(u-y)<.01&&Math.abs(p-S)<.01){if(Math.abs(l+m)<.1&&Math.abs(u+y)<.1&&Math.abs(p+S)<.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,P=(w+1)/2,C=(l+m)/4,D=(u+y)/4,B=(p+S)/4;return x>b&&x>P?x<.01?(s=0,i=.707106781,r=.707106781):(s=Math.sqrt(x),i=C/s,r=D/s):b>P?b<.01?(s=.707106781,i=0,r=.707106781):(i=Math.sqrt(b),s=C/i,r=B/i):P<.01?(s=.707106781,i=.707106781,r=0):(r=Math.sqrt(P),s=D/r,i=B/r),this.set(s,i,r,e),this}let v=Math.sqrt((S-p)*(S-p)+(u-y)*(u-y)+(m-l)*(m-l));return Math.abs(v)<.001&&(v=1),this.x=(S-p)/v,this.y=(u-y)/v,this.z=(m-l)/v,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 s=this.length();return this.divideScalar(s||1).multiplyScalar(N(s,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 s=t.dot(this)/e;return this.copy(t).multiplyScalar(s)}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,s){return this.x=t.x+(e.x-t.x)*s,this.y=t.y+(e.y-t.y)*s,this.z=t.z+(e.z-t.z)*s,this.w=t.w+(e.w-t.w)*s,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 Ac=new Ws,Hr=new Bt,Ic=new qr,Js=2e3,Wr=2001,kc=[1,0,0,1],Dc=[1,0,0,1,0,0],Lc=[1,0,0,0,1,0,0,0,1],Rc=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];class Jr{value;constructor(t=kc){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,s=0,i=1){return this.m11=t,this.m21=e,this.m12=s,this.m22=i,this}identity(){return this.value=Array.from(kc),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 Jr(this.value)}fromArray(t,e=0){for(let s=0;s<4;s++)this.value[s]=t[s+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 s=t.value,i=e.value,r=this.value,o=s[0],a=s[2],h=s[1],c=s[3],l=i[0],u=i[2],m=i[1],f=i[3];return r[0]=o*l+a*m,r[2]=o*u+a*f,r[1]=h*l+c*m,r[3]=h*u+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 ps{value;constructor(t=Lc){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,s=0,i=0,r=1,o=0,a=0,h=0,c=1){const l=this.value;return l[0]=t,l[1]=i,l[2]=a,l[3]=e,l[4]=r,l[5]=h,l[6]=s,l[7]=o,l[8]=c,this}identity(){return this.value=Array.from(Lc),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 ps(this.value)}fromArray(t,e=0){for(let s=0;s<9;s++)this.value[s]=t[s+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,s){return t.setFromMatrix3Column(this,0),e.setFromMatrix3Column(this,1),s.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 s=t.value,i=e.value,r=this.value,o=s[0],a=s[3],h=s[6],c=s[1],l=s[4],u=s[7],m=s[2],f=s[5],p=s[8],y=i[0],S=i[3],w=i[6],v=i[1],x=i[4],b=i[7],P=i[2],C=i[5],D=i[8];return r[0]=o*y+a*v+h*P,r[3]=o*S+a*x+h*C,r[6]=o*w+a*b+h*D,r[1]=c*y+l*v+u*P,r[4]=c*S+l*x+u*C,r[7]=c*w+l*b+u*D,r[2]=m*y+f*v+p*P,r[5]=m*S+f*x+p*C,r[8]=m*w+f*b+p*D,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],s=t[1],i=t[2],r=t[3],o=t[4],a=t[5],h=t[6],c=t[7],l=t[8];return e*o*l-e*a*c-s*r*l+s*a*h+i*r*c-i*o*h}inverse(){const t=this.value,e=t[0],s=t[1],i=t[2],r=t[3],o=t[4],a=t[5],h=t[6],c=t[7],l=t[8],u=l*o-a*c,m=a*h-l*r,f=c*r-o*h,p=e*u+s*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]=u*y,t[1]=(i*c-l*s)*y,t[2]=(a*s-i*o)*y,t[3]=m*y,t[4]=(l*e-i*h)*y,t[5]=(i*r-a*e)*y,t[6]=f*y,t[7]=(s*h-c*e)*y,t[8]=(o*e-s*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).inverse().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,s,i,r,o,a){const h=Math.cos(r),c=Math.sin(r);return this.set(s*h,s*c,-s*(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(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),s=Math.sin(t);return this.set(e,-s,0,s,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 kt{value;is3dSpecial=!1;constructor(t=Rc){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,s=0,i=0,r=0,o=1,a=0,h=0,c=0,l=0,u=1,m=0,f=0,p=0,y=0,S=1){const w=this.value;return w[0]=t,w[4]=e,w[8]=s,w[12]=i,w[1]=r,w[5]=o,w[9]=a,w[13]=h,w[2]=c,w[6]=l,w[10]=u,w[14]=m,w[3]=f,w[7]=p,w[11]=y,w[15]=S,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(Rc),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 kt(this.value)}static fromString(t){const e=new kt,s=xa("number",t);return s.length===16&&s.forEach((i,r)=>{i.fullMatch&&(e.value[r]=parseFloat(i.fullMatch))}),e}fromArray(t,e=0){for(let s=0;s<16;s++)this.value[s]=t[s+e];return this}toArray(t=[],e=0){const s=this.value;return t[e]=s[0],t[e+1]=s[1],t[e+2]=s[2],t[e+3]=s[3],t[e+4]=s[4],t[e+5]=s[5],t[e+6]=s[6],t[e+7]=s[7],t[e+8]=s[8],t[e+9]=s[9],t[e+10]=s[10],t[e+11]=s[11],t[e+12]=s[12],t[e+13]=s[13],t[e+14]=s[14],t[e+15]=s[15],t}copyPosition(t){const e=this.value,s=t.value;return e[12]=s[12],e[13]=s[13],e[14]=s[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,s){return t.setFromMatrix4Column(this,0),e.setFromMatrix4Column(this,1),s.setFromMatrix4Column(this,2),this}makeBasis(t,e,s){return this.set(t.x,e.x,s.x,0,t.y,e.y,s.y,0,t.z,e.z,s.z,0,0,0,0,1),this}normalize(){return this.multiplyScalar(1/(this.m44||1e-4))}transformPoint(t){const e=t.z||1,s=t.w||1;return{x:t.x*this.m11+t.y*this.m21+e*this.m31+s*this.m41,y:t.x*this.m12+t.y*this.m22+e*this.m32+s*this.m42,z:t.x*this.m13+t.y*this.m23+e*this.m33+s*this.m43,w:t.x*this.m14+t.y*this.m24+e*this.m34+s*this.m44}}toMatrix(t){const{scalarX:e,scalarY:s,skewX:i,skewY:r,x:o,y:a}=this.split(),h=[e,r,i,s,o,a];return t?(t.value=h,t):new wt(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=>F(e,t)).join(",")})`}split(){const t=Math.sqrt(this.m11*this.m11+this.m12*this.m12+this.m13*this.m13),e=Math.sqrt(this.m21*this.m21+this.m22*this.m22+this.m23*this.m23),s=Math.sqrt(this.m31*this.m31+this.m32*this.m32+this.m33*this.m33),i=mt(N(Math.asin(-this.m13),-1,1));let r=mt(Math.atan2(this.m23,this.m33));Math.cos(q(i))===0&&(r=mt(Math.atan2(-this.m31,this.m22)));let o=mt(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:s,degreeX:r,degreeY:i,degreeZ:o,skewX:mt(this.m14),skewY:mt(this.m24),skewZ:mt(this.m34),skewW:this.m44,perspective:this.m34?-(1/this.m34):0}}extractRotation(t){const e=this.value,s=t.value,i=1/gs.setFromMatrix4Column(t,0).length(),r=1/gs.setFromMatrix4Column(t,1).length(),o=1/gs.setFromMatrix4Column(t,2).length();return e[0]=s[0]*i,e[1]=s[1]*i,e[2]=s[2]*i,e[3]=0,e[4]=s[4]*r,e[5]=s[5]*r,e[6]=s[6]*r,e[7]=0,e[8]=s[8]*o,e[9]=s[9]*o,e[10]=s[10]*o,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromEuler(t){const e=this.value,s=t.x,i=t.y,r=t.z,o=Math.cos(s),a=Math.sin(s),h=Math.cos(i),c=Math.sin(i),l=Math.cos(r),u=Math.sin(r);if(t.order==="XYZ"){const m=o*l,f=o*u,p=a*l,y=a*u;e[0]=h*l,e[4]=-h*u,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*l,f=h*u,p=c*l,y=c*u;e[0]=m+y*a,e[4]=p*a-f,e[8]=o*c,e[1]=o*u,e[5]=o*l,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*l,f=h*u,p=c*l,y=c*u;e[0]=m-y*a,e[4]=-o*u,e[8]=p+f*a,e[1]=f+p*a,e[5]=o*l,e[9]=y-m*a,e[2]=-o*c,e[6]=a,e[10]=o*h}else if(t.order==="ZYX"){const m=o*l,f=o*u,p=a*l,y=a*u;e[0]=h*l,e[4]=p*c-f,e[8]=m*c+y,e[1]=h*u,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*l,e[4]=y-m*u,e[8]=p*u+f,e[1]=u,e[5]=o*l,e[9]=-a*l,e[2]=-c*l,e[6]=f*u+p,e[10]=m-y*u}else if(t.order==="XZY"){const m=o*h,f=o*c,p=a*h,y=a*c;e[0]=h*l,e[4]=-u,e[8]=c*l,e[1]=m*u+y,e[5]=o*l,e[9]=f*u-p,e[2]=p*u-f,e[6]=a*l,e[10]=y*u+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(Ng,t,Fg)}lookAt(t,e,s){const i=this.value;return Nt.subVectors(t,e),Nt.lengthSq()===0&&(Nt.z=1),Nt.normalize(),De.crossVectors(s,Nt),De.lengthSq()===0&&(Math.abs(s.z)===1?Nt.x+=1e-4:Nt.z+=1e-4,Nt.normalize(),De.crossVectors(s,Nt)),De.normalize(),Jn.crossVectors(Nt,De),i[0]=De.x,i[4]=Jn.x,i[8]=Nt.x,i[1]=De.y,i[5]=Jn.y,i[9]=Nt.y,i[2]=De.z,i[6]=Jn.z,i[10]=Nt.z,this}multiplyMatrices(t,e){const s=t.value,i=e.value,r=this.value,o=s[0],a=s[4],h=s[8],c=s[12],l=s[1],u=s[5],m=s[9],f=s[13],p=s[2],y=s[6],S=s[10],w=s[14],v=s[3],x=s[7],b=s[11],P=s[15],C=i[0],D=i[4],B=i[8],Y=i[12],V=i[1],G=i[5],J=i[9],it=i[13],tt=i[2],Kt=i[6],Xt=i[10],Vt=i[14],te=i[3],R=i[7],L=i[11],U=i[15];return r[0]=o*C+a*V+h*tt+c*te,r[4]=o*D+a*G+h*Kt+c*R,r[8]=o*B+a*J+h*Xt+c*L,r[12]=o*Y+a*it+h*Vt+c*U,r[1]=l*C+u*V+m*tt+f*te,r[5]=l*D+u*G+m*Kt+f*R,r[9]=l*B+u*J+m*Xt+f*L,r[13]=l*Y+u*it+m*Vt+f*U,r[2]=p*C+y*V+S*tt+w*te,r[6]=p*D+y*G+S*Kt+w*R,r[10]=p*B+y*J+S*Xt+w*L,r[14]=p*Y+y*it+S*Vt+w*U,r[3]=v*C+x*V+b*tt+P*te,r[7]=v*D+x*G+b*Kt+P*R,r[11]=v*B+x*J+b*Xt+P*L,r[15]=v*Y+x*it+b*Vt+P*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],s=t[4],i=t[8],r=t[12],o=t[1],a=t[5],h=t[9],c=t[13],l=t[2],u=t[6],m=t[10],f=t[14],p=t[3],y=t[7],S=t[11],w=t[15];return p*(+r*h*u-i*c*u-r*a*m+s*c*m+i*a*f-s*h*f)+y*(+e*h*f-e*c*m+r*o*m-i*o*f+i*c*l-r*h*l)+S*(+e*c*u-e*a*f-r*o*u+s*o*f+r*a*l-s*c*l)+w*(-i*a*l-e*h*u+e*a*m+i*o*u-s*o*m+s*h*l)}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,s){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 s=="number"&&(i[12]=t,i[13]=e,i[14]=s),this}inverse(){const t=this.value,e=t[0],s=t[1],i=t[2],r=t[3],o=t[4],a=t[5],h=t[6],c=t[7],l=t[8],u=t[9],m=t[10],f=t[11],p=t[12],y=t[13],S=t[14],w=t[15],v=u*S*c-y*m*c+y*h*f-a*S*f-u*h*w+a*m*w,x=p*m*c-l*S*c-p*h*f+o*S*f+l*h*w-o*m*w,b=l*y*c-p*u*c+p*a*f-o*y*f-l*a*w+o*u*w,P=p*u*h-l*y*h-p*a*m+o*y*m+l*a*S-o*u*S,C=e*v+s*x+i*b+r*P;if(C===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const D=1/C;return t[0]=v*D,t[1]=(y*m*r-u*S*r-y*i*f+s*S*f+u*i*w-s*m*w)*D,t[2]=(a*S*r-y*h*r+y*i*c-s*S*c-a*i*w+s*h*w)*D,t[3]=(u*h*r-a*m*r-u*i*c+s*m*c+a*i*f-s*h*f)*D,t[4]=x*D,t[5]=(l*S*r-p*m*r+p*i*f-e*S*f-l*i*w+e*m*w)*D,t[6]=(p*h*r-o*S*r-p*i*c+e*S*c+o*i*w-e*h*w)*D,t[7]=(o*m*r-l*h*r+l*i*c-e*m*c-o*i*f+e*h*f)*D,t[8]=b*D,t[9]=(p*u*r-l*y*r-p*s*f+e*y*f+l*s*w-e*u*w)*D,t[10]=(o*y*r-p*a*r+p*s*c-e*y*c-o*s*w+e*a*w)*D,t[11]=(l*a*r-o*u*r-l*s*c+e*u*c+o*s*f-e*a*f)*D,t[12]=P*D,t[13]=(l*y*i-p*u*i+p*s*m-e*y*m-l*s*S+e*u*S)*D,t[14]=(p*a*i-o*y*i-p*s*h+e*y*h+o*s*S-e*a*S)*D,t[15]=(o*u*i-l*a*i+l*s*h-e*u*h-o*s*m+e*a*m)*D,this}getMaxScaleOnAxis(){const t=this.value,e=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],s=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,s,i))}makeTranslation(t,e,s){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,s,0,0,0,1),this}makeRotationX(t){const e=Math.cos(t),s=Math.sin(t);return this.set(1,0,0,0,0,e,-s,0,0,s,e,0,0,0,0,1),this}makeRotationY(t){const e=Math.cos(t),s=Math.sin(t);return this.set(e,0,s,0,0,1,0,0,-s,0,e,0,0,0,0,1),this}makeRotationZ(t){const e=Math.cos(t),s=Math.sin(t);return this.set(e,-s,0,0,s,e,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(t,e){const s=Math.cos(e),i=Math.sin(e),r=1-s,o=t.x,a=t.y,h=t.z,c=r*o,l=r*a;return this.set(c*o+s,c*a-i*h,c*h+i*a,0,c*a+i*h,l*a+s,l*h-i*o,0,c*h-i*a,l*h+i*o,r*h*h+s,0,0,0,0,1),this}makeScale(t,e,s){return this.set(t,0,0,0,0,e,0,0,0,0,s,0,0,0,0,1),this}makeShear(t,e,s,i,r,o){return this.set(1,s,r,0,t,1,o,0,e,i,1,0,0,0,0,1),this}makePerspective(t,e,s,i,r,o,a=Js){const h=this.value,c=2*r/(e-t),l=2*r/(s-i),u=(e+t)/(e-t),m=(s+i)/(s-i);let f,p;if(a===Js)f=-(o+r)/(o-r),p=-2*o*r/(o-r);else if(a===Wr)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]=u,h[12]=0,h[1]=0,h[5]=l,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,s,i,r,o,a=Js){const h=this.value,c=1/(e-t),l=1/(s-i),u=1/(o-r),m=(e+t)*c,f=(s+i)*l;let p,y;if(a===Js)p=(o+r)*u,y=-2*u;else if(a===Wr)p=r*u,y=-1*u;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*l,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,s){const i=this.value,r=e.x,o=e.y,a=e.z,h=e.w,c=r+r,l=o+o,u=a+a,m=r*c,f=r*l,p=r*u,y=o*l,S=o*u,w=a*u,v=h*c,x=h*l,b=h*u,P=s.x,C=s.y,D=s.z;return i[0]=(1-(y+w))*P,i[1]=(f+b)*P,i[2]=(p-x)*P,i[3]=0,i[4]=(f-b)*C,i[5]=(1-(m+w))*C,i[6]=(S+v)*C,i[7]=0,i[8]=(p+x)*D,i[9]=(S-v)*D,i[10]=(1-(m+y))*D,i[11]=0,i[12]=t.x,i[13]=t.y,i[14]=t.z,i[15]=1,this}decompose(t,e,s){const i=this.value;let r=gs.set(i[0],i[1],i[2]).length();const o=gs.set(i[4],i[5],i[6]).length(),a=gs.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,l=1/o,u=1/a;return Zt.value[0]*=c,Zt.value[1]*=c,Zt.value[2]*=c,Zt.value[4]*=l,Zt.value[5]*=l,Zt.value[6]*=l,Zt.value[8]*=u,Zt.value[9]*=u,Zt.value[10]*=u,e.setFromRotationMatrix4(Zt),s.x=r,s.y=o,s.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,s=0){return this.multiply(new kt([1,0,0,0,0,1,0,0,0,0,1,0,t,e,s,1]))}scale(t=1,e=1,s=1){return this.multiply(new kt([t,0,0,0,0,e,0,0,0,0,s,0,0,0,0,1]))}scaleVector3(t){const e=this.value,s=t.x,i=t.y,r=t.z;return e[0]*=s,e[4]*=i,e[8]*=r,e[1]*=s,e[5]*=i,e[9]*=r,e[2]*=s,e[6]*=i,e[10]*=r,e[3]*=s,e[7]*=i,e[11]*=r,this}rotateX(t){const e=q(t),s=Math.cos(e),i=Math.sin(e);return this.multiply(new kt([1,0,0,0,0,s,i,0,0,-i,s,0,0,0,0,1]))}rotateY(t){const e=q(t),s=Math.cos(e),i=Math.sin(e);return this.multiply(new kt([s,0,-i,0,0,1,0,0,i,0,s,0,0,0,0,1]))}rotateZ(t){this.is3dSpecial=!0;const e=q(t),s=Math.cos(e),i=Math.sin(e);return this.multiply(new kt([s,i,0,0,-i,s,0,0,0,0,1,0,0,0,0,1]))}skew(t=0,e=0,s=0){return this.multiply(new kt([1,0,0,q(t),0,1,0,q(e),0,0,1,q(s),0,0,0,1]))}perspective(t){return this.multiply(new kt([1,0,0,0,0,1,0,0,0,0,1,t?-(1/t):0,0,0,0,1]))}unproject(t){let e=t.x*this.m11+t.y*this.m21+this.m41,s=t.x*this.m12+t.y*this.m22+this.m42,i=t.x*this.m13+t.y*this.m23+this.m43,r=t.x*this.m14+t.y*this.m24+this.m44,o=e+this.m31,a=s+this.m32,h=i+this.m33,c=r+this.m34;r==0&&(r=1e-4),e/=r,s/=r,i/=r,c==0&&(c=1e-4),o/=c,a/=c,h/=c;const l=h-i;if(l==0)return{x:e,y:s,z:i,mass:r};const u=-i/l;return e+=u*(o-e),s+=u*(a-s),{x:e,y:s,z:i,mass:r}}project(t){const e=t.z;let s=t.x*this.m11+t.y*this.m21+e*this.m31+this.m41,i=t.x*this.m12+t.y*this.m22+e*this.m32+this.m42,r=t.x*this.m14+t.y*this.m24+e*this.m34+this.m44;return r==0&&(r=1e-4),s/=r,i/=r,r<0&&(s-=this.m41,i-=this.m42,s*=1/r,i*=1/r,s+=this.m41,i+=this.m42),{x:s,y:i,z:e,mass:r}}bounds(t,e,s,i){const r=new Wn({x:t,y:e}),o=new Wn({x:t+s,y:e}),a=new Wn({x:t+s,y:e+i}),h=new Wn({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),l=Math.min(r.y,o.y,a.y,h.y),u=Math.max(r.x,o.x,a.x,h.x)-c,m=Math.max(r.y,o.y,a.y,h.y)-l;return{x:c,y:l,width:u,height:m}}}class wt{value;_m13=0;_m23=0;_m33=1;matrix4;constructor(t=Dc){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 wt,s=xa("number",t);return s.length===6&&s.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 kt(e)}identity(){return this.value=Array.from(Dc),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 wt(this.value)}multiply(t){const e=this.clone(),s=t instanceof wt?t:new wt(t);return this.m11=s.m11*e.m11+s.m12*e.m21+s.m13*e.m31,this.m12=s.m11*e.m12+s.m12*e.m22+s.m13*e.m32,this.m13=s.m11*e.m13+s.m12*e.m23+s.m13*e.m33,this.m21=s.m21*e.m11+s.m22*e.m21+s.m23*e.m31,this.m22=s.m21*e.m12+s.m22*e.m22+s.m23*e.m32,this.m23=s.m21*e.m13+s.m22*e.m23+s.m23*e.m33,this.m31=s.m31*e.m11+s.m32*e.m21+s.m33*e.m31,this.m32=s.m31*e.m12+s.m32*e.m22+s.m33*e.m32,this.m33=s.m31*e.m13+s.m32*e.m23+s.m33*e.m33,this}append(t){return this.multiply(t)}prepend(t){return t.multiply(this),this}inverse(){const t=this.m11,e=this.m12,s=this.m13,i=this.m21,r=this.m22,o=this.m23,a=this.m31,h=this.m32,c=this.m33,l=c*r-o*h,u=-c*i+o*a,m=h*i-r*a;let f=t*l+e*u+s*m;return f?(f=1/f,this.m11=l*f,this.m12=(-c*e+s*h)*f,this.m13=(o*e-s*r)*f,this.m21=u*f,this.m22=(c*t-s*a)*f,this.m23=(-o*t+s*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 wt;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=mt(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:mt(Math.atan2(-this.m21,this.m22)),skewY:mt(Math.atan2(this.m12,this.m11))}}getGroupCoords(t){const e=this.value[0],s=this.value[1],i=this.value[2],r=this.value[3],o=this.value[4],a=this.value[5],h=t.value[0],c=t.value[1],l=t.value[2],u=t.value[3],m=t.value[4],f=t.value[5],p=h*u,y=c*l,S=(l*s-e*u)/(y-p),w=(h*s-e*c)/(p-y),v=(l*r-i*u)/(y-p),x=(h*r-i*c)/(p-y),b=(l*(a-f)+u*(m-o))/(y-p),P=(h*(a-f)+c*(m-o))/(p-y),C=[S,w,v,x,b,P];return new wt(C)}toString(t=6){return this.matrix4.is2D()?`matrix(${this.value.map(e=>F(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,s){return this.matrix4.translate(t,e,s),this.matrix4.toMatrix(this),this}translate3dTo(t,e,s){return this.translate3d(t-this.matrix4.m41,e-this.matrix4.m42,s-this.matrix4.m43),this}rotate(t,e=0,s=0){const i=q(t),r=Math.cos(i),o=Math.sin(i);return this.translate(e,s),this.multiply([r,o,-o,r,0,0]),this.translate(-e,-s),this.toMatrix4(),this}rotateTo(t,e=0,s=0){const{degree:i}=this.split();return this.rotate(t-i,e,s),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,s){return this.matrix4.rotateX(t).rotateY(e).rotateZ(s),this.matrix4.toMatrix(this),this}rotate3dTo(t,e,s){const{degreeX:i,degreeY:r,degreeZ:o}=this.matrix4.split();return this.rotate3d(t-i,e-r,s-o),this}scale(t,e=t,s=0,i=0){return this.translate(s,i),this.multiply([t,0,0,e,0,0]),this.translate(-s,-i),this.toMatrix4(),this}scaleTo(t,e=t,s=0,i=0){return this.scale(t/this.m11,e/this.m22,s,i)}scaleX(t){return this.scale(t,1)}scaleXTo(t){return this.scale(t/this.m11,1)}scaleY(t){return this.scale(1,t)}scaleYTo(t){return this.scale(1,t/this.m22)}scaleZ(t){return this.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,s=t){return this.matrix4.scale(t,e,s),this.matrix4.toMatrix(this),this}scale3dTo(t,e=t,s=t){const{scalarX:i,scalarY:r,scalarZ:o}=this.matrix4.split();return this.scale3d(t/i,e/r,s/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:s,skewY:i}=this.split();return this.skew(t-s,e-i)}skewX(t){const{skewY:e}=this.split();return this.skew(t,e)}skewXTo(t){const{skewY:e}=this.split();return this.skewTo(t,e)}skewY(t){const{skewX:e}=this.split();return this.skew(e,t)}skewYTo(t){const{skewX:e}=this.split();return this.skewTo(e,t)}skewZ(t){return this}skewZTo(t){return this}skew3d(t,e,s){return this}skew3dTo(t,e,s){return this}perspective(t){return this.matrix4.perspective(t),this.matrix4.toMatrix(this),this}}const Ng=new Bt(0,0,0),Fg=new Bt(1,1,1),De=new Bt,Jn=new Bt,Nt=new Bt,gs=new Bt,Zr=new ps,Zt=new kt;function Qr(n){const t=new wt;return n.replace(/([a-z0-9]+)\s*\(?\s*((-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)*[a-z%]*\s*,?\s*)+)\)?/gi,function(e,s,i){i.indexOf(",")>=0?i=i.split(/\s*,\s*/):i=i.split(/\s+/);const r=[];for(let o=0,a=i.length;o<a;o++)i[o].trim()&&r.push(parseFloat(""+i[o]));switch(s.toLowerCase()){case"t":case"translate":t.translate(r[0],r[1]);break;case"translatex":t.translateX(r[0]);break;case"translatey":t.translateY(r[0]);break;case"translatez":t.translateZ(r[0]);break;case"translate3d":t.translate3d(r[0],r[1],r[2]);break;case"r":case"rotate":t.rotate(r[0],r[1]??0,r[2]??0);break;case"rotatex":t.rotateX(r[0]);break;case"rotatey":t.rotateY(r[0]);break;case"rotatez":t.rotateZ(r[0]);break;case"rotate3d":t.rotate3d(r[0],r[1],r[2]);break;case"s":case"scale":t.scale(r[0],r[1]??r[0]);break;case"scalex":t.scaleX(r[0]);break;case"scaley":t.scaleY(r[0]);break;case"scalez":t.scaleZ(r[0]);break;case"scale3d":t.scale3d(r[0],r[1],r[2]);break;case"skew":t.skew(r[0],r[1]??0);break;case"skewx":t.skewX(r[0]);break;case"skewy":t.skewY(r[0]);break;case"skewz":t.skewZ(r[0]);break;case"skew3d":t.skew3d(r[0],r[1],r[2]);break;case"m":case"matrix":t.multiply([r[0],r[1],r[2],r[3],r[4],r[5]]),t.toMatrix4();break;case"matrix3d":t.matrix4.multiply(new kt(r)),t.matrix4.toMatrix(t);break}return""}),t}function Qt(n,t,e){const s=new wt;return s.rotate(mt(n)),s.transformPoint({x:t,y:e})}function Kr(n){const t=typeof n?.x=="number"?n?.x:0,e=typeof n?.y=="number"?n?.y:0,s=typeof n?.degree=="number"?n?.degree:0,i=typeof n?.scalarX=="number"?n?.scalarX:1,r=typeof n?.scalarY=="number"?n?.scalarY:1,o=q(s),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(n?.originMatrix||"")),c}function Yg(n,t){const e=new Path2D(n),s=new Path2D;return s.addPath(e,Kr(t)),s}function We(n,t,e){const s=Yr(n);return s.props.style=s.props.style||{},t?s.props.style[t]||s.props.style[va(t)]||s.props.style[lt(t)]||"":s.props.style}function ys(n,t,e){qn(n,s=>{s.props.style=s.props.style||{},typeof t=="string"&&e?s.props.style[t]=e:t instanceof Object&&Object.keys(t).forEach(i=>{s.props.style[i]=t[i]})}),Xr()}function to(n,t=!1){const e={};if(!t)if(getComputedStyle){const s=getComputedStyle(n);for(let i=0,r=s.length;i<r;i++){const o=s[i];e[o]=s.getPropertyValue(o)}}else{const s=n.currentStyle;for(const i in s)Object.prototype.hasOwnProperty.call(s,i)&&(e[i]=s[i])}return n.style.cssText&&n.style.cssText.split(";").forEach(s=>{const[i,r]=s.split(":").map(o=>o.trim());i&&r&&(e[i]=r)}),e}function Xg(n,t,e){let s=n.style[t]||"";if(!s&&getComputedStyle){t=lt(t);const i=getComputedStyle(n,e),r=i.getPropertyPriority(t);s=i.getPropertyValue(t).trim()+(r?"!"+r:"")}return s||(s=n.currentStyle[t]||""),s}function Zn(n,t,e){typeof t=="string"&&e?n.style.setProperty(lt(t),e.replace(/!important/i,""),e.toLowerCase().includes("!important")?"important":""):t instanceof Object&&Object.keys(t).forEach(s=>{Zn(n,s,t[s])})}function eo(n,t){typeof t=="string"?n.style.removeProperty(lt(t)):Object.keys(t).forEach(e=>{eo(n,e)})}function Oc(n,t){let e;if(typeof t=="string"){const s=document.querySelector(t)?.shadowRoot;s?e=s:e=document.querySelector(t)}else e=t||document.getElementsByTagName("head")[0];if(e){const s=document.createElement("style");return s.innerHTML=n,e.appendChild(s),()=>{(e instanceof HTMLElement||e instanceof ShadowRoot)&&e.removeChild(s)}}else{const s=document.styleSheets[0].insertRule(n);return()=>{document.styleSheets[0].deleteRule(s)}}}function Ug(n,t,e={}){Object.prototype.hasOwnProperty.call(e,"transform")||Object.assign(e,{transform:We(n,"transform")||""});const s=Qr(e.transform),i={};for(const r in t){const o=t[r];switch(r){case"transform":break;case"translate":s.translate(o[0]||0,o[1]||0);break;case"translateTo":s.translateTo(o[0]||0,o[1]||0);break;case"translateX":s.translateX(o||0);break;case"translateXTo":s.translateXTo(o||0);break;case"translateY":s.translateY(o||0);break;case"translateYTo":s.translateYTo(o||0);break;case"translateZ":s.translateZ(o||0);break;case"translateZTo":s.translateZTo(o||0);break;case"translate3d":s.translate3d(o[0]||0,o[1]||0,o[2]||0);break;case"translate3dTo":s.translate3dTo(o[0]||0,o[1]||0,o[2]||0);break;case"rotate":typeof o=="number"?s.rotate(o||0):s.rotate(o[0]||0,o[1]||0,o[2]||0);break;case"rotateTo":typeof o=="number"?s.rotateTo(o||0):s.rotateTo(o[0]||0,o[1]||0,o[2]||0);break;case"rotateX":s.rotateX(o||0);break;case"rotateXTo":s.rotateXTo(o||0);break;case"rotateY":s.rotateY(o||0);break;case"rotateYTo":s.rotateYTo(o||0);break;case"rotateZ":s.rotateZ(o||0);break;case"rotateZTo":s.rotateZTo(o||0);break;case"rotate3d":s.rotate3d(o[0]||0,o[1]||0,o[2]||0);break;case"rotate3dTo":s.rotate3dTo(o[0]||0,o[1]||0,o[2]||0);break;case"scale":typeof o=="number"?s.scale(o||1):s.scale(o[0]||1,o[1]||1,o[2]||0,o[3]||0);break;case"scaleTo":typeof o=="number"?s.scaleTo(o||1):s.scaleTo(o[0]||1,o[1]||1,o[2]||0,o[3]||0);break;case"scaleX":s.scaleX(o||1);break;case"scaleXTo":s.scaleXTo(o||1);break;case"scaleY":s.scaleY(o||1);break;case"scaleYTo":s.scaleYTo(o||1);break;case"scaleZ":s.scaleZ(o||1);break;case"scaleZTo":s.scaleZTo(o||1);break;case"scale3d":typeof o=="number"?s.scale3d(o||1):s.scale3d(o[0]||1,o[1]||1,o[2]||1);break;case"scale3dTo":typeof o=="number"?s.scale3dTo(o||1):s.scale3dTo(o[0]||1,o[1]||1,o[2]||1);break;case"skew":typeof o=="number"?s.skew(o||0):s.skew(o[0]||0,o[1]||0);break;case"skewTo":typeof o=="number"?s.skewTo(o||0):s.skewTo(o[0]||0,o[1]||0);break;case"skewX":s.skewX(o||0);break;case"skewXTo":s.skewXTo(o||0);break;case"skewY":s.skewY(o||0);break;case"skewYTo":s.skewYTo(o||0);break;case"skewZ":break;case"skewZTo":break;case"skew3d":break;case"skew3dTo":break;case"perspective":s.perspective(o||0);break;default:Object.prototype.hasOwnProperty.call(e,r)||(e[r]=We(n,r)),Object.assign(i,{[r]:`${o}`});break}}return Object.assign(i,{transform:s.toString()}),i}function oe(n,t,e){if(t===void 0&&e===void 0)return so(n);if(typeof t=="string"&&e===void 0)return zc(n,t);typeof t=="object"?qn(n,s=>{for(const i in t)i=="style"?ys(n,i,t[i]):Object.prototype.hasOwnProperty.call(t,i)&&(s.props[i]=""+t[i])}):typeof t=="string"&&typeof e=="string"&&(t=="style"?ys(n,t,e):qn(n,s=>{s.props[t]=""+e})),Xr()}const $g=["-o-","-ms-","-moz-","-webkit-",""];function so(n){const t={};for(let e=0,s=n.attributes,i=s.length;e<i;e++){const r=s[e];r.nodeName&&r.nodeValue&&(r.nodeName==="style"?t[r.nodeName]=to(n,!0):t[r.nodeName]=r.nodeValue)}return t}function zc(n,t){return t==="style"?to(n,!0):n.getAttribute(lt(t))}function ws(n,t,e){return n.setAttribute(lt(t),""+e)}function Vg(n,t){t.split(/[,\s]+/i).forEach(e=>{const s=lt(e.trim());s!=""&&n.removeAttribute(s)})}function Bc(n,t){for(const e in t){const s=t[e];switch(e){case"fill":s!=="none"&&(n.fillStyle=s);break;case"stroke":s!=="none"&&(n.strokeStyle=s);break;case"stroke-width":case"strokeWidth":n.lineWidth=Number(s);break;case"stroke-linecap":case"strokeLinecap":n.lineCap=s;break;case"stroke-linejoin":case"strokeLinejoin":switch(s){case"round":case"bevel":case"miter":n.lineJoin=s;break;default:n.lineJoin="miter";break}break;case"stroke-miterlimit":case"strokeMiterlimit":n.miterLimit=Number(s);break;case"stroke-opacity":case"strokeOpacity":break;case"stroke-dashoffset":case"strokeDashoffset":n.lineDashOffset=Number(s);break;case"stroke-dasharray":case"strokeDasharray":typeof s=="string"&&n.setLineDash(s.split(/\s+/).map(i=>Number(i)));break;case"cursor":break;case"font":typeof s=="string"&&(n.font=s);break;case"font-size":case"fontSize":n.font+=` ${s}`;break;case"font-family":case"fontFamily":n.font+=` ${s}`;break;case"font-weight":case"fontWeight":break;case"font-style":case"fontStyle":break;case"text-anchor":case"textAnchor":switch(s){case"middle":n.textAlign="center";break;case"end":n.textAlign="end";break;case"start":n.textAlign="start";break}break;case"alignment-baseline":case"alignmentBaseline":switch(s){case"middle":case"bottom":case"top":case"alphabetic":case"hanging":case"ideographic":n.textBaseline=s;break;default:n.textBaseline="alphabetic";break}break}}}function Gg(n,t,e,s,i){const r=t/e;let o=0,a=0;switch(n){case"aspectFit":r>=1?(o=s,a=o/r,a>i&&(a=i,o=a*r)):(a=i,o=a*r,o>s&&(o=s,a=o/r));break;case"aspectFill":r>=1?(a=i,o=a*r):(o=s,a=o/r);break;case"widthFix":o=s,a=o/r;break;case"heightFix":a=i,o=a*r;break;case"scaleToFill":default:o=s,a=i;break}return{width:o,height:a}}function Nc(n){try{const t=document.createElement("canvas"),e=t.getContext("2d");return t.width=n.width,t.height=n.height,e.drawImage(n,0,0,t.width,t.height),e.getImageData(0,0,t.width,t.height)}catch{return new ImageData(n.width,n.height)}}const qg=n=>{const t=n.width,e=n.height,s=t*e*3,i=s+54,r=[66,77,i&255,i>>8&255,i>>16&255,i>>24&255,0,0,0,0,54,0,0,0],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,s&255,s>>8&255,s>>16&255,s>>24&255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],a=(4-t*3%4)%4,h=n.data;let c="";const l=t<<2;let u=e;const m=String.fromCharCode;do{const p=l*(u-1);let y="";for(let S=0;S<t;S++){const w=S<<2;y+=m(h[p+w+2])+m(h[p+w+1])+m(h[p+w])}for(let S=0;S<a;S++)y+=String.fromCharCode(0);c+=y}while(--u);function f(p){if(!window.btoa)throw"btoa undefined";let y="";if(typeof p=="string")y=p;else for(let S=0;S<p.length;S++)y+=String.fromCharCode(p[S]);return btoa(y)}return f(r.concat(o))+f(c)};function jg(n){const{width:t,height:e}=n,s=document.createElement("canvas"),i=s.getContext("2d");return s.width=t,s.height=e,i.putImageData(n,0,0,0,0,t,e),s.toDataURL("image/png")}const Hg=(n,t,e)=>{const{width:s,height:i}=n,r=document.createElement("canvas"),o=r.getContext("2d");r.width=s,r.height=i,o.putImageData(n,0,0,0,0,s,i);const a=`image/${t?t.toLowerCase():"png"}`;r.toBlob(h=>{e?.(null,h)},a,1)};function Wg(n,t){return createImageBitmap(n,t)}function Jg(n){const t=[],e=[],s=[];let i=0;for(let h=0,c=n.data.length;h<c;h+=4)t[i]=n.data[h],e[i]=n.data[h+1],s[i]=n.data[h+2],i+=1;const r=no(t),o=no(e),a=no(s);return"rgb("+r+","+o+","+a+")"}function no(n){const t={},e=[],s=[];for(let a=0;a<n.length;a++)t[n[a]]?e.push(n[a]):t[n[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),s[a]=i}const r=Math.max.apply(null,s);let o=0;for(;o<s.length;o++)if(s[o]===r)return;return e[o]}const Zg=n=>{const{data:t,width:e,height:s}=n,i=new Uint8ClampedArray(t.length);for(let o=0;o<s;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,s)},Qg=n=>{const{data:t,width:e,height:s}=n,i=new Uint8ClampedArray(t.length);for(let o=0;o<s;o++)for(let a=0;a<e;a++){const h=(o*e+a)*4;i[h]=t[((s-o-1)*e+a)*4],i[h+1]=t[((s-o-1)*e+a)*4+1],i[h+2]=t[((s-o-1)*e+a)*4+2],i[h+3]=t[((s-o-1)*e+a)*4+3]}return new ImageData(i,e,s)},Kg=n=>{const{data:t,width:e,height:s}=n,i=new Uint8ClampedArray(t.length);for(let o=0;o<e;o++)for(let a=0;a<s;a++){const h=(o*s+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,s,e)},t0=n=>{const{data:t,width:e,height:s}=n,i=new Uint8ClampedArray(t.length);for(let o=0;o<e;o++)for(let a=0;a<s;a++){const h=(o*s+a)*4;i[h]=t[((s-a-1)*e+o)*4],i[h+1]=t[((s-a-1)*e+o)*4+1],i[h+2]=t[((s-a-1)*e+o)*4+2],i[h+3]=t[((s-a-1)*e+o)*4+3]}return new ImageData(i,s,e)},e0=n=>{const{data:t,width:e,height:s}=n,i=new Uint8ClampedArray(t.length);for(let o=0;o<s;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,s)},s0=n=>{const{data:t,width:e,height:s}=n,i=new Uint8ClampedArray(t.length);for(let o=0;o<s;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,s)},n0=n=>{const{data:t,width:e,height:s}=n,i=new Uint8ClampedArray(t.length);for(let o=0;o<s;o++)for(let a=0;a<e;a++){const h=(o*e+a)*4,l=(t[h]+t[h+1]+t[h+2])/3>127?255:0;i[h]=l,i[h+1]=l,i[h+2]=l,i[h+3]=t[h+3]}return new ImageData(i,e,s)},i0=n=>{const{data:t,width:e,height:s}=n,i=new Uint8ClampedArray(t.length);for(let o=0;o<s;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,s)},r0=n=>{const{data:t,width:e,height:s}=n,i=new Uint8ClampedArray(t.length);for(let o=0;o<s;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,s)},o0=n=>{const{data:t,width:e,height:s}=n,i=new Uint8ClampedArray(t.length);for(let o=0;o<s;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,s)},a0=n=>{const{data:t,width:e,height:s}=n,i=new Uint8ClampedArray(t.length);for(let o=0;o<s;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,s)},h0=n=>{const{data:t,width:e,height:s}=n,i=new Uint8ClampedArray(t.length);for(let o=0;o<s;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,s)},c0=n=>{const{data:t,width:e,height:s}=n,i=new Uint8ClampedArray(t.length);for(let o=0;o<s;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,s)},l0=n=>{const{data:t,width:e,height:s}=n,i=new Uint8ClampedArray(t.length);for(let o=0;o<s;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,s)},u0=n=>{const{data:t,width:e,height:s}=n,i=new Uint8ClampedArray(t.length);for(let o=0;o<s;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,s)},f0=n=>{const{data:t,width:e,height:s}=n,i=new Uint8ClampedArray(t.length);for(let o=0;o<s;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,s)},d0=n=>{const{data:t,width:e,height:s}=n,i=new Uint8ClampedArray(t.length);for(let o=0;o<s;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,s)},m0=n=>Fc(n,[-1,-1,-1,-1,9,-1,-1,-1,-1]),p0=n=>Fc(n,[-1,-1,-1,-1,8,-1,-1,-1,-1]),g0=n=>{const{data:t,width:e,height:s}=n,i=new Uint8ClampedArray(t.length);for(let o=0;o<s;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,s)},y0=n=>{const{data:t,width:e,height:s}=n,i=new Uint8ClampedArray(t.length);for(let o=0;o<s;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=Yc([t[h],t[h+1],t[h+2],t[h+3]],[255,255,255,255]);i[h]=c[0],i[h+1]=c[1],i[h+2]=c[2],i[h+3]=c[3]}}return new ImageData(i,e,s)};function w0(n,t,e,s,i,r=!1,o){const{data:a,width:h,height:c}=n;let l=i,u=s,m=t,f=e;if(l<0?l=0:l>h&&(l=h),u<0?u=0:u>c&&(u=c),m<1?m=1:m>h&&(m=h),f<1?f=1:f>c&&(f=c),l+m>h&&(m=h-l),u+f>c&&(f=c-u),r){const p=new Uint8ClampedArray(a.length);for(let S=0;S<c;S++)for(let w=0;w<h;w++){const v=(S*h+w)*4;w>=l&&w<=l+m&&S>=u&&S<=u+f?(p[v]=a[v],p[v+1]=a[v+1],p[v+2]=a[v+2],p[v+3]=a[v+3]):(p[v]=255,p[v+1]=255,p[v+2]=255,p[v+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 S=u;S<=u+f;S++)for(let w=l;w<=l+m;w++){const v=((S-u)*m+w-l)*4,x=(S*h+w)*4;p[v]=a[x],p[v+1]=a[x+1],p[v+2]=a[x+2],p[v+3]=a[x+3]}return new ImageData(p,m,f)}}function x0(n,t,e,s){const{data:i,width:r,height:o}=n;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 l=0;l<o;l++)for(let u=0;u<r;u++){const m=(l*r+u)*4;let f=-1;u<a?l<a?f=Math.sqrt(Math.pow(a-u-1,2)+Math.pow(a-l-1,2)):l>o-a-1&&(f=Math.sqrt(Math.pow(a-u-1,2)+Math.pow(l-(o-a),2))):u>r-a-1&&(l<a?f=Math.sqrt(Math.pow(u-(r-a),2)+Math.pow(a-l-1,2)):l>o-a-1&&(f=Math.sqrt(Math.pow(u-(r-a),2)+Math.pow(l-(o-a),2)))),Math.round(f)>a?(h[m]=255,h[m+1]=255,h[m+2]=255,h[m+3]=s||e.toUpperCase()==="PNG"?0:255):(h[m]=i[m],h[m+1]=i[m+1],h[m+2]=i[m+2],h[m+3]=s||e.toUpperCase()==="PNG"?i[m+3]:255)}return new ImageData(h,r,o)}function b0(n,t,e,s,i,r=1e4){const o=new Image;o.src=n;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,s,i),h.getImageData(0,0,s,i)}function v0(n,t){const{data:e,width:s,height:i}=n,r=new Uint8ClampedArray(e.length);for(let a=0;a<i;a++)for(let h=0;h<s;h++){const c=(a*s+h)*4;r[c]=Math.max(Math.min(e[c]+t,255),0),r[c+1]=Math.max(Math.min(e[c+1]+t,255),0),r[c+2]=Math.max(Math.min(e[c+2]+t,255),0),r[c+3]=e[c+3]}return new ImageData(r,s,i)}function S0(n,t,e=!1){const{data:s,width:i,height:r}=n,o=new Uint8ClampedArray(s.length);for(let h=0;h<r;h++)for(let c=0;c<i;c++){const l=(h*i+c)*4;s[l+3]===0?(o[l]=255,o[l+1]=255,o[l+2]=255):(o[l]=s[l],o[l+1]=s[l+1],o[l+2]=s[l+2]);let u=s[l+3];e?u=Math.max(Math.min(Math.floor(255*t),255),0):u=Math.max(Math.min(Math.floor(u+255*t),255),0),o[l+3]=u}return new ImageData(o,i,r)}function _0(n,t,e,s){const{data:i,width:r,height:o}=n,{data:a,width:h,height:c}=t;let l=e,u=s;e+c>o&&(l=o-c),s+h>r&&(u=r-h);const m=new Uint8ClampedArray(i.length);for(let p=0;p<o;p++)for(let y=0;y<r;y++){const S=(p*r+y)*4;if(y<u||y>u+h||p<=l||p>=l+c)m[S]=i[S],m[S+1]=i[S+1],m[S+2]=i[S+2],m[S+3]=i[S+3];else{const w=(p*r+y-((l+1)*r+(p-(l+1))*(r-h))+h-u-1)*4,v=[a[w],a[w+1],a[w+2],a[w+3]],x=[i[S],i[S+1],i[S+2],i[S+3]],b=Yc(v,x);m[S]=b[0],m[S+1]=b[1],m[S+2]=b[2],m[S+3]=b[3]}}return new ImageData(m,r,o)}function C0(n,t,e,s,i,r=10){const{data:o,width:a,height:h}=n;let c=i,l=s,u=t,m=e;c<0?c=0:c>a&&(c=a),l<0?l=0:l>h&&(l=h),u<1?u=1:u>a&&(u=a),m<1?m=1:m>h&&(m=h),c+u>a&&(u=a-c),l+m>h&&(m=h-l);const f=new Uint8ClampedArray(o.length);for(let y=0;y<h;y++)for(let S=0;S<a;S++){const w=(y*a+S)*4;if(S>=c&&S<=c+u&&y>=l&&y<=l+m){const v=Math.floor((S-c)/r),x=Math.floor((y-l)/r);let b=Math.floor(r*(v+1)-r/2+c),P=Math.floor(r*(x+1)-r/2+l);b>a-1&&(b=a-1),P>h-1&&(P=h-1);const C=(P*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 T0(n,t,e={backgroundColor:{r:0,g:0,b:0,a:255},changeIntoColor:{r:0,g:0,b:0,a:0}}){if(t&&e){const{data:s,width:i,height:r}=n,{data:o}=t,a=new Uint8ClampedArray(s.length),{backgroundColor:h,changeIntoColor:c}=e;for(let u=0;u<r;u++)for(let m=0;m<i;m++){const f=(u*i+m)*4,p=o[f],y=o[f+1],S=o[f+2],w=o[f+3];p===h.r&&y===h.g&&S===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]=s[f],a[f+1]=s[f+1],a[f+2]=s[f+2],a[f+3]=s[f+3])}return new ImageData(a,i,r)}return n}function Fc(n,t){const{data:e,width:s,height:i}=n,r=new Uint8ClampedArray(e.length);for(let a=0;a<i;a++)for(let h=0;h<s;h++){const c=(a*s+h)*4;for(let l=0;l<3;l++){const u=c+l;h===0||h===s-1||a===0||a===i-1?r[u]=e[u]:r[u]=t[0]*e[u-s*4-4]+t[1]*e[u-s*4]+t[2]*e[u-s*4+4]+t[3]*e[u-4]+t[4]*e[u]+t[5]*e[u+4]+t[6]*e[u+s*4-4]+t[7]*e[u+s*4]+t[8]*e[u+s*4+4]}r[c+3]=e[c+3]}return new ImageData(r,s,i)}function Yc(n,t){if(n&&n.length===4&&t&&t.length===4){const e=n[3],s=t[3];if(e===255||s===0)return n;if(e===0)return t;{const i=e/255,r=s/255,o=Math.max(Math.min(Math.floor(n[0]*i+t[0]*r*(1-i)),255),0),a=Math.max(Math.min(Math.floor(n[1]*i+t[1]*r*(1-i)),255),0),h=Math.max(Math.min(Math.floor(n[2]*i+t[2]*r*(1-i)),255),0),c=Math.max(Math.min(Math.floor((i+r*(1-i))*255),255),0);return[o,a,h,c]}}return[255,255,255,255]}const io=function(){const n=[];return{writeByte(t){n.push(t&255)},writeShort(t){this.writeByte(t),this.writeByte(t>>>8)},writeBytes(t,e=0,s=t.length){for(let i=0;i<s;i++)this.writeByte(t[i+e])},writeString(t){for(let e=0,s=t.length;e<s;e++)this.writeByte(t.charCodeAt(e))},toByteArray(){return n},toString(){let t="[";for(let e=0,s=n.length;e<s;e++)e>0&&(t+=","),t+=n[e];return t+="]",t}}},Xc=function(){let n=0,t=0,e=0,s="";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){s+=String.fromCharCode(i(o&63))};return{writeByte(o){for(n=n<<8|o&255,t+=8,e+=1;t>=6;)r(n>>>t-6),t-=6},flush(){if(t>0&&(r(n<<6-t),n=0,t=0),e%3!=0){const o=3-e%3;for(let a=0;a<o;a++)s+="="}},toString(){return s}}},Uc=function(n,t,e){const s=new Array(n*n),i=function(a){const h=a;let c=0,l=0;return{write(u,m){if(u>>>m)throw new Error("length over");for(;c+m>=8;)h.writeByte(255&(u<<c|l)),m-=8-c,u>>>=8-c,l=0,c=0;l=u<<c|l,c=c+m},flush(){c>0&&h.writeByte(l)}}},r=function(a){const h=1<<a,c=(1<<a)+1;let l=a+1;const u=o();for(let S=0;S<h;S++)u.add(String.fromCharCode(S));u.add(String.fromCharCode(h)),u.add(String.fromCharCode(c));const m=io(),f=i(m);f.write(h,l);let p=0,y=String.fromCharCode(s[p]);for(p+=1;p<s.length;){const S=String.fromCharCode(s[p]);p+=1,u.contains(y+S)?y=y+S:(f.write(u.indexOf(y),l),u.size()<4095&&(u.size()==1<<l&&(l+=1),u.add(y+S)),y=S)}return f.write(u.indexOf(y),l),f.write(c,l),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){s[h*n+a]=c},write(a){a.writeString("GIF87a"),a.writeShort(n),a.writeShort(n),a.writeByte(128),a.writeByte(0),a.writeByte(0),a.writeByte(hs("0x"+t[1]+t[2])),a.writeByte(hs("0x"+t[3]+t[4])),a.writeByte(hs("0x"+t[5]+t[6])),a.writeByte(hs("0x"+e[1]+e[2])),a.writeByte(hs("0x"+e[3]+e[4])),a.writeByte(hs("0x"+e[5]+e[6])),a.writeString(","),a.writeShort(0),a.writeShort(0),a.writeShort(n),a.writeShort(n),a.writeByte(0);const h=2,c=r(h);a.writeByte(h);let l=0;for(;c.length-l>255;)a.writeByte(255),a.writeBytes(c,l,255),l+=255;a.writeByte(c.length-l),a.writeBytes(c,l,c.length-l),a.writeByte(0),a.writeString(";")}}},$c=function(n,t,e,s){const i=Uc(n,t,e);for(let c=0;c<n;c++)for(let l=0;l<n;l++)i.setPixel(l,c,s(l,c));const r=io();i.write(r);const o=Xc(),a=r.toByteArray();for(let c=0,l=a.length;c<l;c++)o.writeByte(a[c]);o.flush();let h="";return h+="data:image/gif;base64,",h+=o,h},Ft={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},Zs={M:0,L:1,H:2,Q:3},Le={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},pt={glog:function(n){if(n<1)throw new Error("glog("+n+")");return pt.LOG_TABLE[n]},gexp:function(n){for(;n<0;)n+=255;for(;n>=256;)n-=255;return pt.EXP_TABLE[n]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)};for(let n=0;n<8;n++)pt.EXP_TABLE[n]=1<<n;for(let n=8;n<256;n++)pt.EXP_TABLE[n]=pt.EXP_TABLE[n-4]^pt.EXP_TABLE[n-5]^pt.EXP_TABLE[n-6]^pt.EXP_TABLE[n-8];for(let n=0;n<255;n++)pt.LOG_TABLE[pt.EXP_TABLE[n]]=n;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(n){let t=n<<10;for(;Q.getBCHDigit(t)-Q.getBCHDigit(Q.G15)>=0;)t^=Q.G15<<Q.getBCHDigit(t)-Q.getBCHDigit(Q.G15);return(n<<10|t)^Q.G15_MASK},getBCHTypeNumber:function(n){let t=n<<12;for(;Q.getBCHDigit(t)-Q.getBCHDigit(Q.G18)>=0;)t^=Q.G18<<Q.getBCHDigit(t)-Q.getBCHDigit(Q.G18);return n<<12|t},getBCHDigit:function(n){let t=0;for(;n!=0;)t++,n>>>=1;return t},getPatternPosition:function(n){return Q.PATTERN_POSITION_TABLE[n-1]},getMask:function(n,t,e){switch(n){case Le.PATTERN000:return(t+e)%2==0;case Le.PATTERN001:return t%2==0;case Le.PATTERN010:return e%3==0;case Le.PATTERN011:return(t+e)%3==0;case Le.PATTERN100:return(Math.floor(t/2)+Math.floor(e/3))%2==0;case Le.PATTERN101:return t*e%2+t*e%3==0;case Le.PATTERN110:return(t*e%2+t*e%3)%2==0;case Le.PATTERN111:return(t*e%3+(t+e)%2)%2==0;default:throw new Error("bad maskPattern:"+n)}},getErrorCorrectPolynomial:function(n){let t=new xs([1],0);for(let e=0;e<n;e++)t=t.multiply(new xs([1,pt.gexp(e)],0));return t},getLengthInBits:function(n,t){if(1<=t&&t<10)switch(n){case Ft.MODE_NUMBER:return 10;case Ft.MODE_ALPHA_NUM:return 9;case Ft.MODE_8BIT_BYTE:return 8;case Ft.MODE_KANJI:return 8;default:throw new Error("mode:"+n)}else if(t<27)switch(n){case Ft.MODE_NUMBER:return 12;case Ft.MODE_ALPHA_NUM:return 11;case Ft.MODE_8BIT_BYTE:return 16;case Ft.MODE_KANJI:return 10;default:throw new Error("mode:"+n)}else if(t<41)switch(n){case Ft.MODE_NUMBER:return 14;case Ft.MODE_ALPHA_NUM:return 13;case Ft.MODE_8BIT_BYTE:return 16;case Ft.MODE_KANJI:return 12;default:throw new Error("mode:"+n)}else throw new Error("type:"+t)},getLostPoint:function(n){const t=n.getModuleCount();let e=0;for(let r=0;r<t;r++)for(let o=0;o<t;o++){let a=0;const h=n.isDark(r,o);for(let c=-1;c<=1;c++)if(!(r+c<0||t<=r+c))for(let l=-1;l<=1;l++)o+l<0||t<=o+l||c==0&&l==0||h==n.isDark(r+c,o+l)&&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;n.isDark(r,o)&&a++,n.isDark(r+1,o)&&a++,n.isDark(r,o+1)&&a++,n.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++)n.isDark(r,o)&&!n.isDark(r,o+1)&&n.isDark(r,o+2)&&n.isDark(r,o+3)&&n.isDark(r,o+4)&&!n.isDark(r,o+5)&&n.isDark(r,o+6)&&(e+=40);for(let r=0;r<t;r++)for(let o=0;o<t-6;o++)n.isDark(o,r)&&!n.isDark(o+1,r)&&n.isDark(o+2,r)&&n.isDark(o+3,r)&&n.isDark(o+4,r)&&!n.isDark(o+5,r)&&n.isDark(o+6,r)&&(e+=40);let s=0;for(let r=0;r<t;r++)for(let o=0;o<t;o++)n.isDark(o,r)&&s++;const i=Math.abs(100*s/t/t-50)/5;return e+=i*10,e}};class xs{num;constructor(t,e){if(t.length==null)throw new Error(t.length+"/"+e);let s=0;for(;s<t.length&&t[s]==0;)s++;this.num=new Array(t.length-s+e);for(let i=0;i<t.length-s;i++)this.num[i]=t[i+s]}get(t){return this.num[t]}getLength(){return this.num.length}multiply(t){const e=new Array(this.getLength()+t.getLength()-1);for(let s=0;s<this.getLength();s++)for(let i=0;i<t.getLength();i++)e[s+i]^=pt.gexp(pt.glog(this.get(s))+pt.glog(t.get(i)));return new xs(e,0)}mod(t){if(this.getLength()-t.getLength()<0)return this;const e=pt.glog(this.get(0))-pt.glog(t.get(0)),s=new Array(this.getLength());for(let i=0;i<this.getLength();i++)s[i]=this.get(i);for(let i=0;i<t.getLength();i++)s[i]^=pt.gexp(pt.glog(t.get(i))+e);return new xs(s,0).mod(t)}}class ge{totalCount;dataCount;constructor(t,e){this.totalCount=t,this.dataCount=e}static RS_BLOCK_TABLE=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]];static getRSBlocks(t,e){const s=ge.getRsBlockTable(t,e);if(s==null)throw new Error("bad rs block @ typeNumber:"+t+"/errorCorrectLevel:"+e);const i=s.length/3,r=[];for(let o=0;o<i;o++){const a=s[o*3+0],h=s[o*3+1],c=s[o*3+2];for(let l=0;l<a;l++)r.push(new ge(h,c))}return r}static getRsBlockTable(t,e){switch(e){case Zs.L:return ge.RS_BLOCK_TABLE[(t-1)*4+0];case Zs.M:return ge.RS_BLOCK_TABLE[(t-1)*4+1];case Zs.Q:return ge.RS_BLOCK_TABLE[(t-1)*4+2];case Zs.H:return ge.RS_BLOCK_TABLE[(t-1)*4+3];default:return}}}class Vc{buffer;length;constructor(){this.buffer=[],this.length=0}get(t){const e=Math.floor(t/8);return(this.buffer[e]>>>7-t%8&1)==1}put(t,e){for(let s=0;s<e;s++)this.putBit((t>>>e-s-1&1)==1)}getLengthInBits(){return this.length}putBit(t){const e=Math.floor(this.length/8);this.buffer.length<=e&&this.buffer.push(0),t&&(this.buffer[e]|=128>>>this.length%8),this.length++}}class P0{mode;data;constructor(t){this.mode=Ft.MODE_8BIT_BYTE,this.data=t}getLength(){return this.data.length}write(t){for(let e=0,s=this.data.length;e<s;e++)t.put(this.data.charCodeAt(e),8)}}class Re{static PAD0=236;static PAD1=17;typeNumber;errorCorrectLevel;modules;moduleCount;dataCache;dataList;constructor(t,e){this.typeNumber=t,this.errorCorrectLevel=Zs[e],this.modules=[],this.moduleCount=0,this.dataCache=null,this.dataList=[]}addData(t){const e=new P0(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=ge.getRSBlocks(t,this.errorCorrectLevel),s=new Vc;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];s.put(o.mode,4),s.put(o.getLength(),Q.getLengthInBits(o.mode,t)),o.write(s)}if(s.getLengthInBits()<=i*8)break}this.typeNumber=t}this.makeImpl(!1,this.getBestMaskPattern())}makeImpl(t,e){this.moduleCount=this.typeNumber*4+17,this.modules=new Array(this.moduleCount);for(let s=0;s<this.moduleCount;s++){this.modules[s]=new Array(this.moduleCount);for(let i=0;i<this.moduleCount;i++)this.modules[s][i]=null}this.setupPositionProbePattern(0,0),this.setupPositionProbePattern(this.moduleCount-7,0),this.setupPositionProbePattern(0,this.moduleCount-7),this.setupPositionAdjustPattern(),this.setupTimingPattern(),this.setupTypeInfo(t,e),this.typeNumber>=7&&this.setupTypeNumber(t),this.dataCache==null&&(this.dataCache=Re.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,e)}setupPositionProbePattern(t,e){for(let s=-1;s<=7;s++)if(!(t+s<=-1||this.moduleCount<=t+s))for(let i=-1;i<=7;i++)e+i<=-1||this.moduleCount<=e+i||(0<=s&&s<=6&&(i==0||i==6)||0<=i&&i<=6&&(s==0||s==6)||2<=s&&s<=4&&2<=i&&i<=4?this.modules[t+s][e+i]=!0:this.modules[t+s][e+i]=!1)}getBestMaskPattern(){let t=0,e=0;for(let s=0;s<8;s++){this.makeImpl(!0,s);const i=Q.getLostPoint(this);(s==0||t>i)&&(t=i,e=s)}return e}createMovieClip(t,e,s){const i=t.createEmptyMovieClip(e,s),r=1;this.make();for(let 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 s=0;s<t.length;s++){const i=t[e],r=t[s];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 s=0;s<18;s++){const i=!t&&(e>>s&1)==1;this.modules[Math.floor(s/3)][s%3+this.moduleCount-8-3]=i}for(let s=0;s<18;s++){const i=!t&&(e>>s&1)==1;this.modules[s%3+this.moduleCount-8-3][Math.floor(s/3)]=i}}setupTypeInfo(t,e){const s=this.errorCorrectLevel<<3|e,i=Q.getBCHTypeInfo(s);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 s=-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+=s,i<0||this.moduleCount<=i){i-=s,s=-s;break}}}static createData(t,e,s){const i=ge.getRSBlocks(t,e),r=new Vc;for(let a=0;a<s.length;a++){const h=s[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(Re.PAD0,8),r.getLengthInBits()>=o*8));)r.put(Re.PAD1,8);return Re.createBytes(r,i)}static createBytes(t,e){let s=0,i=0,r=0;const o=new Array(e.length),a=new Array(e.length);for(let u=0;u<e.length;u++){const m=e[u].dataCount,f=e[u].totalCount-m;i=Math.max(i,m),r=Math.max(r,f),o[u]=new Array(m);for(let w=0;w<o[u].length;w++)o[u][w]=255&t.buffer[w+s];s+=m;const p=Q.getErrorCorrectPolynomial(f),S=new xs(o[u],p.getLength()-1).mod(p);a[u]=new Array(p.getLength()-1);for(let w=0;w<a[u].length;w++){const v=w+S.getLength()-a[u].length;a[u][w]=v>=0?S.get(v):0}}let h=0;for(let u=0;u<e.length;u++)h+=e[u].totalCount;const c=new Array(h);let l=0;for(let u=0;u<i;u++)for(let m=0;m<e.length;m++)u<o[m].length&&(c[l++]=o[m][u]);for(let u=0;u<r;u++)for(let m=0;m<e.length;m++)u<a[m].length&&(c[l++]=a[m][u]);return c}}const Gc=Math.ceil,Qs=Math.floor,qc=Math.round;function E0(n,t){const e=Sa(n),s=t?.ecc||"H",i=t?.size||256,r=-1,o=t?.padding||0,a=t?.color||"#000000",h=t?.background||"#ffffff",c=new Re(r,s);c.addData(e),c.make();const l=c.getModuleCount(),u=(i-o*2)/l,m=o,f=i-o;return $c(i,a,h,function(p,y){if(m<=p&&p<f&&m<=y&&y<f){const S=Qs((p-m)/u),w=Qs((y-m)/u);return c.isDark(w,S)?0:1}else return 1})}function M0(n,t){const e=t.x||0,s=t.y||0,i=Sa(n),r=t.ctx,o=t.ecc||"H",a=typeof t.size=="number"?Qs(t.size):256,h=t.padding||0,c=-1,l=t.color||"#000000",u=t.background||"#ffffff",m=new Re(c,o);m.addData(i),m.make();const f=m.getModuleCount(),p=(a-h*2)/f;r.fillStyle=u,r.fillRect(e,s,a,a);for(let y=0;y<f;y++)for(let S=0;S<f;S++){const w=Gc((S+1)*p)-Qs(S*p),v=Gc((y+1)*p)-Qs(y*p);r.fillStyle=m.isDark(y,S)?l:u,r.fillRect(e+qc(S*p)+h,s+qc(y*p)+h,w,v)}}const Qn=new Ws,ct=new Bt;function Ks(n,t){switch(t.constructor){case Float32Array:return n;case Uint32Array:return n/4294967295;case Uint16Array:return n/65535;case Uint8Array:return n/255;case Int32Array:return Math.max(n/2147483647,-1);case Int16Array:return Math.max(n/32767,-1);case Int8Array:return Math.max(n/127,-1);default:throw new Error("Invalid component type.")}}function Dt(n,t){switch(t.constructor){case Float32Array:return n;case Uint32Array:return Math.round(n*4294967295);case Uint16Array:return Math.round(n*65535);case Uint8Array:return Math.round(n*255);case Int32Array:return Math.round(n*2147483647);case Int16Array:return Math.round(n*32767);case Int8Array:return Math.round(n*127);default:throw new Error("Invalid component type.")}}class ye{array;itemSize;count;normalized;updateRanges;version;constructor(t,e,s=!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=s,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=Gu(t.array),this.itemSize=t.itemSize,this.count=t.count,this.normalized=t.normalized,this}copyAt(t,e,s){t*=this.itemSize,s*=e.itemSize;for(let i=0,r=this.itemSize;i<r;i++)this.array[t+i]=e.array[s+i];return this}copyArray(t){return this.array.set(t),this}applyMatrix3(t){if(this.itemSize===2)for(let e=0,s=this.count;e<s;e++)Qn.fromBufferAttribute(this,e),Qn.applyMatrix3(t),this.setXY(e,Qn.x,Qn.y);else if(this.itemSize===3)for(let e=0,s=this.count;e<s;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,s=this.count;e<s;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,s=this.count;e<s;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,s=this.count;e<s;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 s=this.array[t*this.itemSize+e];return this.normalized&&(s=Ks(s,this.array)),s}setComponent(t,e,s){return this.normalized&&(s=Dt(s,this.array)),this.array[t*this.itemSize+e]=s,this}getX(t){let e=this.array[t*this.itemSize];return this.normalized&&(e=Ks(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=Ks(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=Ks(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=Ks(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,s){return t*=this.itemSize,this.normalized&&(e=Dt(e,this.array),s=Dt(s,this.array)),this.array[t+0]=e,this.array[t+1]=s,this}setXYZ(t,e,s,i){return t*=this.itemSize,this.normalized&&(e=Dt(e,this.array),s=Dt(s,this.array),i=Dt(i,this.array)),this.array[t+0]=e,this.array[t+1]=s,this.array[t+2]=i,this}setXYZW(t,e,s,i,r){return t*=this.itemSize,this.normalized&&(e=Dt(e,this.array),s=Dt(s,this.array),i=Dt(i,this.array),r=Dt(r,this.array)),this.array[t+0]=e,this.array[t+1]=s,this.array[t+2]=i,this.array[t+3]=r,this}onChange(t){return this._onChangeCallback=t,this}clone(){return Pa(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 A0 extends ye{constructor(t,e,s=!1){super(new Int8Array(t),e,s)}}class I0 extends ye{constructor(t,e,s=!1){super(new Uint8Array(t),e,s)}}class k0 extends ye{constructor(t,e,s=!1){super(new Uint8ClampedArray(t),e,s)}}class D0 extends ye{constructor(t,e,s=!1){super(new Int16Array(t),e,s)}}class L0 extends ye{constructor(t,e,s=!1){super(new Uint16Array(t),e,s)}}class R0 extends ye{constructor(t,e,s=!1){super(new Int32Array(t),e,s)}}class O0 extends ye{constructor(t,e,s=!1){super(new Uint32Array(t),e,s)}}class z0 extends ye{constructor(t,e,s=!1){super(new Float32Array(t),e,s)}}const jc={map:new Map,transform:function(n){if(vf)return n;if(this.map.has(n))return this.map.get(n);const t=new OffscreenCanvas(n.width,n.height);return t.getContext("2d")?.drawImage(n,0,0),this.map.set(n,t),t},clear:function(){this.map.clear()}};function B0(n,t,e){const s=new OffscreenCanvas(n,t),i=s.getContext("2d");if(i)return e(i),s.transferToImageBitmap()}function N0(n,t,e){const s=n.createPattern(jc.transform(t),"no-repeat");if(s){const i=Kr(e);s.setTransform(i),n.fillStyle=s}}function Hc(n){return window.URL.createObjectURL(n)}function F0(n){return window.URL.revokeObjectURL(n)}function Wc(n){let t=!1,e;function s(){document.readyState==="loading"||t||(n(),e?.(),t=!0)}try{e=W(document,"DOMContentLoaded",s)}catch{e=W(window,"load",s)}return s(),()=>{t||e()}}function Jc(n){return W(window,"beforeunload",t=>{n(t)})}async function Y0(n,t=6e4){return new Promise((e,s)=>{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),s(o)},i.src=n;const r=setTimeout(()=>{s("Timeout!")},t);document.body.appendChild(i)})}function Kn(n,t){const e=document.createElement("a");e.style.visibility="hidden",e.download=t,typeof n=="string"?e.href=n:e.href=window.URL.createObjectURL(n),e.click()}async function X0(n,t=document.getElementsByTagName("head")[0],e=6e4){return new Promise((s,i)=>{const r=document.createElement("link");r.setAttribute("type","text/css"),r.setAttribute("rel","stylesheet"),r.onload=a=>{clearTimeout(o),s(a),r.onerror=r.onload=null},r.onerror=a=>{clearTimeout(o),i(a)},r.setAttribute("href",n);const o=setTimeout(()=>{i("Timeout!")},e);t.appendChild(r)})}function U0(){return new Promise(n=>{const t=Array.from(document.querySelectorAll("link[rel=stylesheet]"));let e=document.styleSheets.length||0;const s=()=>e>=t.length?(n(),!0):!1;s()||t.forEach(i=>{i.onload=()=>{e+=1,s()}})})}const Zc=new ks;async function Qc(n,t=6e4){return new Promise((e,s)=>{const i=typeof n=="string"?n:Hc(n),r=Zc.get(i);if(r)return e(r);const o=setTimeout(()=>{s("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,l={width:h,height:c,aspectRatio:h/c,element:a,imageData:Nc(a)};Zc.set(i,l),e(l)},a.onerror=h=>{clearTimeout(o),s(h)},a.src=i})}async function Kc(n=Ut.text,t=["*"]){const s=(await dr(t))[0],i=await zs(s,n);return{type:s.type,name:s.name,size:s.size,data:i}}async function $0(n=["image/*"]){const e=(await dr(n))[0];if(!e.type.match(/image\/*/))return new Error("Not Image Type!");const s=await zs(e,Ut.arraybuffer),i=Oi(s),r=await Qc(i);return{type:e.type,name:e.name,size:e.size,data:s,width:r.width,height:r.height,aspectRatio:r.aspectRatio,imageData:r.imageData}}function V0(){return window.getSelection()?.toString()||""}function G0(n){document.getElementsByTagName("title")[0].innerText=n,document.title=n}function q0(n=200){"vibrate"in navigator?window.navigator.vibrate(n):console.error("Your device is not support vibrate on this browser.")}async function j0(n){if(navigator.clipboard)return await navigator.clipboard.writeText(n);{const t=document.createElement("textarea");return t.value=n,t.style.opacity="0",t.style.position="fixed",t.style.top="0",t.style.left="0",t.focus(),t.select(),document.execCommand("copy")}}function H0(n,t){window.scrollTo(n,t)}function W0(){let n=Oa,t=Oa;return"scrollRestoration"in window.history&&(window.history.scrollRestoration="manual",n=Jc(()=>{window.history.scrollRestoration="auto"}),t=Wc(()=>{window.history.scrollRestoration="manual"})),()=>{n(),t()}}function J0(n){return/(html|body)/i.test(n.tagName)||n===document.documentElement}const Z0=n=>n===document.activeElement&&(n.type||n.href),ro=function(){return parseFloat(getComputedStyle(document.documentElement).fontSize)};function Q0(n){return n*ro()}function K0(n){return n.parentElement?parseFloat(getComputedStyle(n.parentElement).fontSize):ro()}const ty=n=>{let t=n;for(;t&&t.nodeType!==1&&t.parentElement;)t=t.parentElement;return t},ey=n=>n.parentElement,oo=(n,t=[])=>!n||n.parentElement===null&&n.parentNode===null?t:oo(n.parentElement,t.concat([n]));function sy(n){const t=oo(n);for(let e=0,s=t.length;e<s;e++)if(/(auto|scroll)/.test(We(t[e],"overflow")+We(t[e],"overflow-y")+We(t[e],"overflow-x")))return t[e];return document.scrollingElement||document.documentElement}const ny=(n,t)=>n.contains?n!=t&&n.contains(t):!!(n.compareDocumentPosition(t)&16),iy=n=>Array.prototype.slice.call(n.parentElement?.children).filter(t=>t!==n),ry=n=>n.nextElementSibling,oy=n=>n.previousElementSibling,ay=(n,t)=>n.closest(t),hy=n=>n.shadowRoot,tn=n=>n.tagName==="INPUT"||n instanceof HTMLInputElement,ao=n=>n.tagName==="SELECT"||n instanceof HTMLSelectElement,cy=n=>n.tagName==="TEXTAREA"||n instanceof HTMLTextAreaElement,ho=n=>tn(n)&&n.getAttribute("type")==="checkbox",co=n=>tn(n)&&n.getAttribute("type")==="radio",ly=n=>tn(n)&&n.getAttribute("type")==="text",uy=n=>tn(n)&&n.getAttribute("type")==="number";function fy(n,t){if(ao(n)){const e=n.options;for(let s=0,i=e.length;s<i;s++)e[s].selected=e[s].value==t}}function dy(n,t){if(co(n)){const e=document.getElementsByName(n.name);for(let s=0,i=e.length;s<i;s++){const r=e[s];r.checked=r.value==t}}}function my(n,t){ho(n)&&(n.checked=t)}function bs(n,t,e="append"){typeof t=="string"?n[e](il(t)):n[e](t)}function tl(n,t){if(typeof t=="string"){n.innerHTML=t;const e=ol(n);e!=n&&(n=e)}else bs(t,"replaceWith")}const el=function(n){tl(n,"")},py=(n,t)=>{n.textContent=t},gy=n=>{if(n instanceof SVGElement)return"";let t=n.innerText;if(!t){const e=n.querySelector("slot")?.assignedNodes()||[];let s=0;for(;!t&&s<=e.length-1;)"innerText"in e[s]&&(t=e[s].innerText),s++}return t},yy=n=>n.remove();function wy(n,t){We(n,"display")=="none"&&t===void 0||t===!0?sl(n):nl(n)}function sl(n){ys(n,"display",n instanceof HTMLTableRowElement?"table-row":n instanceof HTMLTableCellElement?"table-cell":"block")}function nl(n){ys(n,"display","none")}function lo(n,t,e="toggle"){const s=t.split(/[,\s]+/);if(n.classList)s.forEach(i=>{const r=i.trim();r!==""&&n.classList[e](r)});else{const i=n.className.split(/ +/);let r=!1;s.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&&oe(n,"class",i.join(" ").replace(/^\s+/,"").replace(/\s+$/,""))}}function xy(n,t){lo(n,t,"add")}function by(n,t){lo(n,t,"remove")}function vy(n,t){return new RegExp("(?:^|\\s+)"+t+"(?:\\s+|$)").test(n.className)||!1}function il(n,t=!1){const e=document.createElement("template");return e.innerHTML=n,t&&e.content.childNodes.forEach(s=>{const i=ol(s);i!=s&&e.content.replaceChild(i,s)}),e.content}function rl(n){return document.createElement.call(document,n)}function Sy(n){return document.createElementNS("http://www.w3.org/1999/xhtml",n)}function _y(n){return document.createTextNode.call(document,n)}function ol(n){return n.tagName=="SCRIPT"&&(n=al(n)),n.querySelectorAll&&n.querySelectorAll("script").forEach(t=>{t.parentNode?.replaceChild(al(t),t)}),n}function al(n){const t=n.ownerDocument.createElement("script");t.text=n.text;const e=n.attributes;for(let s=0,i=e.length;s<i;s++)t.setAttribute(e[s].name,e[s].value);return t}function Cy(n,t="http://test.com/localstorage.html"){const e=document.createElement("iframe");e.src=t,document.body.append(e),setTimeout(function(){e.contentWindow?.postMessage(n,t)},4e3),setTimeout(function(){e.remove()},6e3)}function Ty(n){const t=new Proxy(window,{get(e,s,i){if(typeof s=="string"&&["open","location","document"].includes(s))throw new Error(`禁止访问 key: ${s}`);return s==="window"?t:Reflect.get(e,s,i)},set(e,s,i,r){return Reflect.set(e,s,i,r)}});new Function("window",`with(window) { ${n} }`)(t,null)}function uo(){return{x:0,y:0,isDown:!1}}function Je(){const n=uo(),t=uo();return{start:n,current:t,setStart:function(e,s){n.x=e.x,n.y=e.y,n.isDown=typeof s=="boolean"?s:typeof e.isDown=="boolean"?e.isDown:!1,this.setCurrent(e,s)},setCurrent:(e,s)=>{t.x=e.x,t.y=e.y,t.isDown=typeof s=="boolean"?s:typeof e.isDown=="boolean"?e.isDown:!1}}}function ti(n=document.documentElement,t=!1){return $(n,"mousemove",t)}function hl(n=document.documentElement,t=!1){return $(n,"mousedown",t)}function cl(n=document.documentElement,t=!1){return $(n,"mouseup",t)}function Py(n=document.documentElement,t=!1){return $(n,"mouseover",t)}function Ey(n=document.documentElement,t=!1){return $(n,"mouseout",t)}function My(n=document.documentElement,t=!1){return $(n,"mouseenter",t)}function Ay(n=document.documentElement,t=!1){return $(n,"mouseleave",t)}function Iy(n=document.documentElement,t=!1){return $(n,"click",t)}function ky(n=document.documentElement,t=!1){return $(n,"dblclick",t)}function Dy(n=document.documentElement,t=!1){return $(n,"onwheel"in document.createElement("div")?"wheel":document.onmousewheel!==void 0?"mousewheel":"DOMMouseScroll",t)}function Ly(n=document.documentElement,t=!1){return $(n,"contextmenu",t)}function ll(n=document.documentElement,t=!1){return $(n,"touchmove",t)}function ul(n=document.documentElement,t=!1){return $(n,"touchstart",t)}function fl(n=document.documentElement,t=!1){return $(n,"touchend",t)}function dl(n=document.documentElement,t=!1){return $(n,"touchcancel",t)}function fo(n=document.documentElement,t=!1){return $(n,"pointermove",t)}function mo(n=document.documentElement,t=!1){return $(n,"pointerdown",t)}function po(n=document.documentElement,t=!1){return $(n,"pointerup",t)}function go(n=document.documentElement,t=!1){return $(n,"pointercancel",t)}function Ry(n=document.documentElement){const t=new et(n);return nt(e=>{t.on("pan",e)},e=>{t.off("pan",e)})}function Oy(n=document.documentElement){const t=new et(n);return nt(e=>{t.on("panmove",e)},e=>{t.off("panmove",e)})}function zy(n=document.documentElement){const t=new et(n);return nt(e=>{t.on("panstart",e)},e=>{t.off("panstart",e)})}function By(n=document.documentElement){const t=new et(n);return nt(e=>{t.on("panend",e)},e=>{t.off("panend",e)})}function Ny(n=document.documentElement){const t=new et(n);return nt(e=>{t.on("pancancel",e)},e=>{t.off("pancancel",e)})}function Fy(n=document.documentElement){const t=new et(n);return nt(e=>{t.on("panleft",e)},e=>{t.off("panleft",e)})}function Yy(n=document.documentElement){const t=new et(n);return nt(e=>{t.on("panright",e)},e=>{t.off("panright",e)})}function Xy(n=document.documentElement){const t=new et(n);return nt(e=>{t.on("panup",e)},e=>{t.off("panup",e)})}function Uy(n=document.documentElement){const t=new et(n);return nt(e=>{t.on("pandown",e)},e=>{t.off("pandown",e)})}function $y(n=document.documentElement){const t=new et(n);return nt(e=>{t.on("pinch",e)},e=>{t.off("pinch",e)})}function Vy(n=document.documentElement){const t=new et(n);return nt(e=>{t.on("pinchin",e)},e=>{t.off("pinchin",e)})}function Gy(n=document.documentElement){const t=new et(n);return nt(e=>{t.on("pinchout",e)},e=>{t.off("pinchout",e)})}function qy(n=document.documentElement){const t=new et(n);return nt(e=>{t.on("press",e)},e=>{t.off("press",e)})}function jy(n=document.documentElement){const t=new et(n);return nt(e=>{t.on("rotate",e)},e=>{t.off("rotate",e)})}function Hy(n=document.documentElement){const t=new et(n);return nt(e=>{t.on("swipe",e)},e=>{t.off("swipe",e)})}function Wy(n=document.documentElement){const t=new et(n);return nt(e=>{t.on("swipeleft",e)},e=>{t.off("swipeleft",e)})}function Jy(n=document.documentElement){const t=new et(n);return nt(e=>{t.on("swiperight",e)},e=>{t.off("swiperight",e)})}function Zy(n=document.documentElement){const t=new et(n);return nt(e=>{t.on("swipeup",e)},e=>{t.off("swipeup",e)})}function Qy(n=document.documentElement){const t=new et(n);return nt(e=>{t.on("swipedown",e)},e=>{t.off("swipedown",e)})}function ml(n=document.documentElement){const t=new et(n);return nt(e=>{t.on("tap",e)},e=>{t.off("tap",e)})}function Ky(n=document.documentElement){const t=new et(document.documentElement);return nt(e=>{const s=i=>{!i.target||n==i.target||n.contains(i.target)||e(i)};return t.on("tap",s),s},(e,s)=>{t.off("tap",s)})}function t1(n=document.documentElement,t=!1){return $(n,"transitionstart",t)}function e1(n=document.documentElement,t=!1){return $(n,"transitionend",t)}function s1(n=document.documentElement,t=!1){return $(n,"animationstart",t)}function n1(n=document.documentElement,t=!1){return $(n,"animationend",t)}function pl(n=document.documentElement,t=!1){return $(n,"drag",t)}function gl(n=document.documentElement,t=!1){return $(n,"dragstart",t)}function yl(n=document.documentElement,t=!1){return $(n,"dragend",t)}function wl(n=document.documentElement,t=!1){return $(n,"drop",t)}function xl(n=document.documentElement,t=!1){return $(n,"dragenter",t)}function bl(n=document.documentElement,t=!1){return $(n,"dragleave",t)}function vl(n=document.documentElement,t=!1){return $(n,"dragover",t)}function Sl(n=document.documentElement,t=!1){return $(n,"keydown",t)}function _l(n=document.documentElement,t=!1){return $(n,"keyup",t)}function i1(n=document.documentElement,t=!1){return $(n,"keypress",t)}function r1(n=document.documentElement,t){const e=t?.useMousePoint||Je();return ti(n).pipe(ot(s=>(e.setCurrent(dt(s,n)),e)))}function o1(n=document.documentElement,t){const e=t?.useMousePoint||Je();return ti(n).pipe(qp(hl(n).pipe(qe(s=>{e.setStart(dt(s,n),!0),t?.start?.(s,e)})),()=>cl(n).pipe(qe(s=>{e.setCurrent(dt(s,n),!1),t?.end?.(s,e)}))),$p(),ot(s=>(e.setCurrent(dt(s,n),!0),e)))}function a1(n=document.documentElement,t){const e=t?.useMousePoint||Je();return ul(n).pipe(qe(s=>{const i=s.changedTouches[0];e.setStart(dt(i,n),!0),t?.start?.(i,e)}),Un(()=>ll(n).pipe(Ar(Mr(fl(n),dl(n)).pipe(qe(s=>{const i=s.changedTouches[0];e.setCurrent(dt(i,n),!1),t?.end?.(i,e)}))))),ot(s=>{const i=s.changedTouches[0];return e.setCurrent(dt(i,n),!0),e}))}function ei(n=document.documentElement,t){const e=t?.useMousePoint||Je();return mo(n).pipe(qe(s=>{e.setStart(dt(s,n),!0),t?.start?.(s,e)}),Un(()=>fo(n).pipe(Ar(Mr(po(n),go(n)).pipe(qe(s=>{e.setCurrent(dt(s,n),!1),t?.end?.(s,e)}))))),ot(s=>(e.setCurrent(dt(s,n),!0),e)))}function Cl(n=document.documentElement,t){const e=t?.useMousePoint||Je();return Np(ti(n),mo(n)).pipe(uc(s=>s instanceof PointerEvent?(e.setStart(dt(s,n),!0),t?.start?.(s,e),fo(n).pipe(Ar(Mr(po(n),go(n)).pipe(qe(i=>{e.setCurrent(dt(i,n),!1),t?.end?.(i,e)}))))):s instanceof MouseEvent?mp(s):jh),ot(s=>(e.setCurrent(dt(s,n),s instanceof PointerEvent),e)))}function h1(n){return new st(t=>ei(n,{start:()=>{t.next(0)},end:(s,i)=>{t.next(i.current.x-i.start.x)}}).subscribe(s=>{t.next(s.current.y-s.start.y)}).unsubscribe).pipe(Te())}function c1(n,t){ws(n,"draggable","true");const e=gl(n,!0).subscribe(r=>{Ee(r),fc(r);const o=r.dataTransfer;o&&(o.effectAllowed="move",o.setData("text/plain","some-data")),t?.onStart?.(r)}),s=pl(n).subscribe(r=>{Ee(r),t?.onDrag?.(r)}),i=yl(n).subscribe(r=>{Ee(r),t?.onEnd?.(r)});return()=>{e.unsubscribe(),s.unsubscribe(),i.unsubscribe()}}function l1(n,t){const e=xl(n).subscribe(o=>{Ee(o),t?.onEnter?.(o)}),s=vl(n).subscribe(o=>{Ee(o);const a=o.dataTransfer;a&&(a.dropEffect="move"),t?.onOver?.(o)}),i=bl(n).subscribe(o=>{Ee(o),t?.onLeave?.(o)}),r=wl(n).subscribe(o=>{Ee(o);const a=o.dataTransfer;if(!a){t?.onDrop?.(o,[]);return}t?.onDrop?.(o,[...a.files])});return()=>{e.unsubscribe(),s.unsubscribe(),i.unsubscribe(),r.unsubscribe()}}function Tl(n=10){return $(window,"scroll",!0).pipe(Gp(n))}function u1(){return $(document,"visibilitychange",!0).pipe(ot(()=>document.visibilityState==="visible"),Te())}function f1(){return{screenWidth:window.screen.width,screenHeight:window.screen.height,screenX:window.screenX,screenY:window.screenY}}function en(){const n=document.documentElement;return{clientWidth:n.clientWidth,clientHeight:n.clientHeight,clientTop:n.clientTop,clientLeft:n.clientLeft,scrollWidth:n.scrollWidth,scrollHeight:n.scrollHeight,scrollTop:n.scrollTop,scrollLeft:n.scrollLeft,offsetWidth:n.offsetWidth,offsetHeight:n.offsetHeight,offsetTop:n.offsetTop,offsetLeft:n.offsetLeft,offsetParent:n.offsetParent}}function d1(){const n=document.body;return{clientWidth:n.clientWidth,clientHeight:n.clientHeight,clientTop:n.clientTop,clientLeft:n.clientLeft,scrollWidth:n.scrollWidth,scrollHeight:n.scrollHeight,scrollTop:n.scrollTop,scrollLeft:n.scrollLeft,offsetWidth:n.offsetWidth,offsetHeight:n.offsetHeight,offsetTop:n.offsetTop,offsetLeft:n.offsetLeft,offsetParent:n.offsetParent}}function Pl(){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:n,scrollHeight:t}=en();return{width:n,height:t}}function yo(n){const{top:t,left:e,width:s,height:i}=n.getBoundingClientRect(),{scrollLeft:r,scrollTop:o}=en();return{x:e+r,y:t+o,width:s,height:i}}function p1(n){let t=n,e=0,s=0;for(;t!==null;)e+=t.offsetLeft,s+=t.offsetTop,t.offsetParent instanceof HTMLElement?t=t.offsetParent:t=null;return{x:e,y:s,width:n.offsetWidth,height:n.offsetHeight}}function El(n){return n.getBoundingClientRect()}function g1(n){const t=n.getBoundingClientRect();return{x:n.offsetLeft,y:n.offsetTop,width:t.width||t.right-t.left,height:t.height||t.bottom-t.top}}function y1(){const{clientHeight:n,scrollTop:t,scrollHeight:e}=en(),s=e-n;return s<=0?0:t/s*100}function w1(n){if("center"in n){const t=n.center,e=El(n.target);return{x:t.x-e.x,y:t.y-e.y}}return{x:n.clientX,y:n.clientY}}function wo(n){if("center"in n)return n.center;if(typeof n.pageX=="number"&&typeof n.pageY=="number")return{x:n.pageX,y:n.pageY};const{scrollLeft:t,scrollTop:e}=en();return{x:n.clientX+t,y:n.clientY+e}}function dt(n,t){const e={x:0,y:0};if(t){const s=wo(n),i=yo(t);e.x=N(s.x-i.x,0,i.width),e.y=N(s.y-i.y,0,i.height)}else{let s=0,i=0;if("currentTarget"in n&&n.currentTarget&&n.target&&n.currentTarget!=n.target){const r=n.currentTarget.getBoundingClientRect(),o=n.target.getBoundingClientRect();s=o.left-r.left,i=o.top-r.top}if("offsetX"in n)e.x=n.offsetX+s,e.y=n.offsetY+i;else{const r=wo(n),o=yo(n.target);e.x=N(r.x-o.x+s,0,o.width),e.y=N(r.y-o.y+i,0,o.height)}}return e}function x1(n){if(document.implementation.hasFeature("MouseEvents","2.0"))return n.button;switch(n.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(n){if(n.key)return n.key;if(n.keyCode)return n.keyCode;if(n.which)return n.which}function Ml(n,t){const e=t.ctrl||!1,s=t.shift||!1,i=t.alt||!1;return(e===n.metaKey||e===n.ctrlKey)&&s===n.shiftKey&&i===n.altKey&&t.keys.map(r=>r.toLowerCase()).includes(n.key.toLowerCase())}function Al(n){return Sl(n.target||document||window).pipe(lc(t=>Ml(t,n)),ot(t=>{t.stopPropagation(),t.preventDefault()}))}function S1(n){return _l(n.target||document||window).pipe(lc(t=>Ml(t,n)),ot(t=>{t.stopPropagation(),t.preventDefault()}))}function Il(n={keys:["o"]},t=Ut.text){return Al(n).pipe(Un(async()=>await Kc(t)))}async function _1(n={keys:["o"]},t=Ut.text){return gp(Il(n,t))}async function kl(n,t){return new Promise(e=>{const s=new ResizeObserver(i=>{const r=n.getBoundingClientRect();t(r),e(()=>{s.unobserve(n)})});s.observe(n)})}function xo(n=document.documentElement,t){return new st(e=>{const s=n.getBoundingClientRect();let i=s.x,r=s.y,o=s.width,a=s.height;e.next(s);const h=new ResizeObserver(c=>{const l=n.getBoundingClientRect();(i!=l.x||r!=l.y||o!=l.width||a!=l.height)&&(i=l.x,r=l.y,o=l.width,a=l.height,e.next(l))});return h.observe(n,t),()=>{h.unobserve(n),h.disconnect()}})}function C1(){return $(window,"orientationchange"in window?"orientationchange":"resize").pipe(ot(n=>({width:n.target.innerWidth,height:n.target.innerHeight})),Pe({width:window.innerWidth,height:window.innerHeight}))}function T1(){const n={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,s){n.x=e.x,n.y=e.y,n.isDown=typeof s=="boolean"?s:!1,this.setCurrentMousePoint(e,s)},setCurrentMousePoint:(e,s)=>{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-n.x,t.dStartY=t.y-n.y,t.isDown=typeof s=="boolean"?s:!1}}}function P1(n=document.documentElement){const t=new _n,e=new et(n);let s=[];const i=T1(),r=i.mousePoint,o=I=>{t.emit("mouseDown",I)},a=I=>{t.emit("mouseUp",I)},h=I=>{r.isDown||i.setCurrentMousePoint(dt(I,n)),t.emit("mouseMove",I)},c=I=>{t.emit("mouseOver",I)},l=I=>{t.emit("mouseOut",I)},u=I=>{t.emit("mouseEnter",I)},m=I=>{t.emit("mouseLeave",I)},f=I=>{t.emit("mouseClick",I)},p=I=>{t.emit("mouseDoubleClick",I)},y=I=>{t.emit("mouseWheel",I)},S=I=>{t.emit("mouseContextMenu",I)},w=I=>{t.emit("touchStart",I)},v=I=>{t.emit("touchEnd",I)},x=I=>{t.emit("touchCancel",I)},b=I=>{const at=I.changedTouches[0];r.isDown||i.setCurrentMousePoint(dt(at,n)),t.emit("touchMove",I)},P=I=>{t.emit("pointerDown",I)},C=I=>{t.emit("pointerUp",I)},D=I=>{t.emit("pointerCancel",I)},B=I=>{t.emit("pointerMove",I)},Y=I=>{t.emit("pan",I)},V=I=>{t.emit("panStart",I)},G=I=>{t.emit("panMove",I)},J=I=>{t.emit("panEnd",I)},it=I=>{t.emit("panCancel",I)},tt=I=>{t.emit("panLeft",I)},Kt=I=>{t.emit("panRight",I)},Xt=I=>{t.emit("panUp",I)},Vt=I=>{t.emit("panDown",I)},te=I=>{t.emit("pinch",I)},R=I=>{t.emit("pinchin",I)},L=I=>{t.emit("pinchout",I)},U=I=>{t.emit("press",I)},Z=I=>{t.emit("rotate",I)},At=I=>{t.emit("swipe",I)},ee=I=>{t.emit("swipeLeft",I)},fi=I=>{t.emit("swipeRight",I)},di=I=>{t.emit("swipeUp",I)},gt=I=>{t.emit("swipeDown",I)},he=I=>{t.emit("tap",I)},rt=I=>{!I.target||n==I.target||n.contains(I.target)||t.emit("tapOutSide",I)},Ct=I=>{t.emit("transitionstart",I)},Cs=I=>{t.emit("transitionend",I)},ns=I=>{t.emit("animationstart",I)},is=I=>{t.emit("animationend",I)};let Ne={...n.getBoundingClientRect(),width:n.offsetWidth,height:n.offsetHeight};return{el:n,get rect(){return Ne},mousePoint:r,eb:t,start:async function(){s.push(W(n,"mousedown",o)),s.push(W(n,"mouseup",a)),s.push(W(n,"mousemove",h)),s.push(W(n,"mouseover",c)),s.push(W(n,"mouseout",l)),s.push(W(n,"mouseenter",u)),s.push(W(n,"mouseleave",m)),s.push(W(n,"click",f)),s.push(W(n,"dblclick",p)),s.push(W(n,"onwheel"in document.createElement("div")?"wheel":document.onmousewheel!==void 0?"mousewheel":"DOMMouseScroll",y)),s.push(W(n,"contextmenu",S)),s.push(W(n,"touchstart",w)),s.push(W(n,"touchend",v)),s.push(W(n,"touchcancel",x)),s.push(W(n,"touchmove",b)),s.push(W(n,"pointerdown",P)),s.push(W(n,"pointerup",C)),s.push(W(n,"pointercancel",D)),s.push(W(n,"pointermove",B)),e.on("pan",Y),e.on("panstart",V),e.on("panmove",G),e.on("panend",J),e.on("pancancel",it),e.on("panleft",tt),e.on("panright",Kt),e.on("panup",Xt),e.on("pandown",Vt),e.on("pinch",te),e.on("pinchin",R),e.on("pinchout",L),e.on("press",U),e.on("rotate",Z),e.on("swipe",At),e.on("swipeleft",ee),e.on("swiperight",fi),e.on("swipeup",di),e.on("swipedown",gt),e.on("tap",he),s.push(W(document,"pointerdown",rt)),s.push(W(n,"transitionstart",Ct)),s.push(W(n,"transitionend",Cs)),s.push(W(n,"animationstart",ns)),s.push(W(n,"animationend",is));const I=await kl(n,at=>{Ne=at,t.emit("resize",at)});s.push(I),s.push(Dl(this,{start:at=>{i.setStartMousePoint(dt(at,n),!0)},move:at=>{i.setCurrentMousePoint(dt(at,n))},end:at=>{i.setCurrentMousePoint(dt(at,n),!1)}}))},end:()=>{t.removeAllListeners(),s.forEach(I=>I()),s=[],e.off("pan",Y),e.off("panstart",V),e.off("panmove",G),e.off("panend",J),e.off("pancancel",it),e.off("panleft",tt),e.off("panright",Kt),e.off("panup",Xt),e.off("pandown",Vt),e.off("pinch",te),e.off("pinchin",R),e.off("pinchout",L),e.off("press",U),e.off("rotate",Z),e.off("swipe",At),e.off("swipeleft",ee),e.off("swiperight",fi),e.off("swipeup",di),e.off("swipedown",gt),e.off("tap",he)}}}function Dl(n,t){return Ll(n,t)}function Ll(n,t){const e=n.eb,s=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",s),()=>e.off("pointerDown",s)}function E1(n,t){const e=n.eb,s=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",s),()=>e.off("mouseDown",s)}function M1(n,t){const e=n.eb,s=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",s),()=>e.off("touchStart",s)}let bo=class{x;y;toX;toY;constructor(t){this.x=F(t?.x||0,2),this.y=F(t?.y||0,2),this.toX=F(t?.toX||0,2),this.toY=F(t?.toY||0,2)}toSVGPathData(){return[["L",this.toX,this.toY]]}toCanvasContext(t){t.lineTo(this.toX,this.toY)}getBoundingClientRect(t=2){const e=zt(this.x,this.y,this.toX,this.toY);if(e===0){const s=Math.min(this.x,this.toX),i=Math.min(this.y,this.toY),r=Math.max(this.x,this.toX),o=Math.max(this.y,this.toY);return{x:s,y:i,width:r-s,height:o-i}}else{const s=Math.sin(e),i=Math.cos(e),r=i*this.x-s*this.y,o=i*this.toX-s*this.toY,a=i*this.y+s*this.x,h=i*this.toY+s*this.toX;return{x:F(Math.min(r,o),t),y:F(Math.min(a,h),t),width:F(Math.max(r,o)-Math.min(r,o),t),height:F(Math.max(a,h)-Math.min(a,h),t)}}}interpolate(t){return{x:this.x+t*(this.toX-this.x),y:this.y+t*(this.toY-this.y)}}intersection(t){const e=this.x,s=this.y,i=t.toX,r=t.toY,o=this.toX-e,a=t.x-i;if(!o&&!a)return null;const h=(this.toY-s)/o,c=(t.y-r)/a;if(o){if(!a)return{x:i,y:h*(i-e)+s}}else return{x:e,y:c*(e-i)+r};const l=(-c*i+r+h*e-s)/(h-c),u=h*(l-e)+s;return isNaN(l)||isNaN(u)?null:{x:l,y:u}}};class vo extends bo{rx;ry;xAxisRotate;largeArcFlag;sweepFlag;constructor(t){super(t),this.rx=F(t.rx,2),this.ry=F(t.ry,2),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}toSVGPathData(){return[["A",this.rx,this.ry,this.xAxisRotate,this.largeArcFlag,this.sweepFlag,this.toX,this.toY]]}toCanvasContext(t){const[e,s,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,s,i,r,o,a,h,!this.sweepFlag)}convert(t,e,s,i,r,o,a,h,c){const l=a/180*Math.PI,u=(t-s)/2,m=(e-i)/2,f=Math.cos(l)*u+Math.sin(l)*m,p=-Math.sin(l)*u+Math.cos(l)*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 S=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,v=w*S*r*p/o,x=w*S*-o*f/r,b=(t+s)/2,P=(e+i)/2,C=Math.cos(l)*v-Math.sin(l)*x+b,D=Math.sin(l)*v+Math.cos(l)*x+P,B=(G,J,it,tt)=>(G*tt>=J*it?1:-1)*Math.acos((G*it+J*tt)/(Math.sqrt(G*G+J*J)*Math.sqrt(it*it+tt*tt))),Y=B(1,0,t-C,e-D)-l,V=B(t-C,e-D,s-C,i-D);return[C,D,r,o,l,Y,Y+V]}}class A1 extends bo{cx;cy;isLineThrough;constructor(t){super(t),this.cx=F(t.cx,2),this.cy=F(t.cy,2),this.isLineThrough=typeof t.isLineThrough=="boolean"?t.isLineThrough:!1}toSVGPathData(){if(this.isLineThrough){const t=this.cx*2-(this.x+this.toX)/2,e=this.cy*2-(this.y+this.toY)/2;return[["Q",t,e,this.toX,this.toY]]}else return[["Q",this.cx,this.cy,this.toX,this.toY]]}toCanvasContext(t){if(this.isLineThrough){const e=this.cx*2-(this.x+this.toX)/2,s=this.cy*2-(this.y+this.toY)/2;t.quadraticCurveTo(e,s,this.toX,this.toY)}else t.quadraticCurveTo(this.cx,this.cy,this.toX,this.toY)}getBoundingClientRect(t=2){const e=[this.x,this.toX],s=[this.y,this.toY];let i,r,o,a;for(let l=0;l<2;++l)i=l==0?this.x-2*this.cx+this.toX:this.y-2*this.cy+this.toY,r=l==0?-2*this.x+2*this.cx:-2*this.y+2*this.cy,o=l==0?this.x:this.y,Math.abs(i)>1e-12&&(a=-r/(2*i),0<a&&a<1&&[e,s][l].push(i*a*a+r*a+o));const h={x:Math.min(0,...e),y:Math.min(0,...s)},c={x:Math.max(0,...e),y:Math.max(0,...s)};return{x:F(h.x,t),y:F(h.y,t),width:F(c.x-h.x,t),height:F(c.y-h.y,t)}}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 I1=A1;class xt extends bo{c1x;c1y;c2x;c2y;constructor(t){super(t),this.c1x=F(t.c1x,2),this.c1y=F(t.c1y,2),this.c2x=F(t.c2x,2),this.c2y=F(t.c2y,2)}clone(){return new xt({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(t=2){let e=this.c2x-2*this.c1x+this.x-(this.toX-2*this.c2x+this.c1x),s=2*(this.c1x-this.x)-2*(this.c2x-this.c1x),i=this.x-this.c1x,r=(-s+Math.sqrt(s*s-4*e*i))/2/e,o=(-s-Math.sqrt(s*s-4*e*i))/2/e;const a=[this.y,this.toY],h=[this.x,this.toX];let c;const l=[];Math.abs(r)>1e12&&(r=.5),Math.abs(o)>1e12&&(o=.5),r>=0&&r<=1&&(c=this.interpolate(r),h.push(c.x),a.push(c.y),l.push({X:c.x,Y:c.y})),o>=0&&o<=1&&(c=this.interpolate(o),h.push(c.x),a.push(c.y),l.push({X:c.x,Y:c.y})),e=this.c2y-2*this.c1y+this.y-(this.toY-2*this.c2y+this.c1y),s=2*(this.c1y-this.y)-2*(this.c2y-this.c1y),i=this.y-this.c1y,r=(-s+Math.sqrt(s*s-4*e*i))/2/e,o=(-s-Math.sqrt(s*s-4*e*i))/2/e,Math.abs(r)>1e12&&(r=.5),Math.abs(o)>1e12&&(o=.5),r>=0&&r<=1&&(c=this.interpolate(r),h.push(c.x),a.push(c.y),l.push({X:c.x,Y:c.y})),o>=0&&o<=1&&(c=this.interpolate(o),h.push(c.x),a.push(c.y),l.push({X:c.x,Y:c.y}));const u=[],m=l.length;for(let y=0;y<m;y++){for(let S=y+1;S<m;S++)l[y].X===l[S].X&&l[y].Y===l[S].Y&&(S=++y);u.push({X:l[y].X,Y:l[y].Y})}const f={x:Math.min(...h),y:Math.min(...a)},p={x:Math.max(...h),y:Math.max(...a)};return{x:F(f.x,t),y:F(f.y,t),width:F(p.x-f.x,t),height:F(p.y-f.y,t),dots:u}}static base3(t,e,s,i,r){const o=-3*e+9*s-9*i+3*r,a=t*o+6*e-12*s+6*i;return t*a-3*e+3*s}static bezlen(t,e,s,i,r,o,a,h,c=1){c=Math.max(0,Math.min(c,1));const l=c/2,u=[-.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=l*u[p]+l,S=xt.base3(y,t,s,r,a),w=xt.base3(y,e,i,o,h);f+=m[p]*Math.sqrt(S*S+w*w)}return l*f}length(t=1){return xt.bezlen(this.x,this.y,this.c1x,this.c1y,this.c2x,this.c2y,this.toX,this.toY,t)}getPointAtSegmentLength(t){const e=this.getTatLen(t),s=1-e,i=Math.pow(s,3),r=Math.pow(s,2),o=e*e,a=o*e,h=i*this.x+r*3*e*this.c1x+s*3*e*e*this.c2x+a*this.toX,c=i*this.y+r*3*e*this.c1y+s*3*e*e*this.c2y+a*this.toY,l=this.x+2*e*(this.c1x-this.x)+o*(this.c2x-2*this.c1x+this.x),u=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=s*this.x+e*this.c1x,y=s*this.y+e*this.c1y,S=s*this.c2x+e*this.toX,w=s*this.c2y+e*this.toY,v=90-Math.atan2(l-m,u-f)*180/Math.PI;return{x:h,y:c,m:{x:l,y:u},n:{x:m,y:f},start:{x:p,y},end:{x:S,y:w},alpha:v}}getTatLen(t){const e=this.x,s=this.y,i=this.c1x,r=this.c1y,o=this.c2x,a=this.c2y,h=this.toX,c=this.toY;if(t<0||xt.bezlen(e,s,i,r,o,a,h,c)<t)return 0;const l=1;let u=l/2,m=l-u,f=xt.bezlen(e,s,i,r,o,a,h,c,m);for(;Math.abs(f-t)>.01;)u/=2,m+=(f<t?1:-1)*u,f=xt.bezlen(e,s,i,r,o,a,h,c,m);return m}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}}}const sn=Math.PI*2;function Rl(n,t,e,s){const i=n*s-t*e<0?-1:1;let r=n*e+t*s;return r>1&&(r=1),r<-1&&(r=-1),i*Math.acos(r)}function k1(n,t,e,s,i,r,o,a,h,c){const l=c*(n-e)/2+h*(t-s)/2,u=-h*(n-e)/2+c*(t-s)/2,m=o*o,f=a*a,p=l*l,y=u*u;let S=m*f-m*y-f*p;S<0&&(S=0),S/=m*y+f*p,S=Math.sqrt(S)*(i===r?-1:1);const w=S*o/a*u,v=S*-a/o*l,x=c*w-h*v+(n+e)/2,b=h*w+c*v+(t+s)/2,P=(l-w)/o,C=(u-v)/a,D=(-l-w)/o,B=(-u-v)/a,Y=Rl(1,0,P,C);let V=Rl(P,C,D,B);return r===0&&V>0&&(V-=sn),r===1&&V<0&&(V+=sn),[x,b,Y,V]}function D1(n,t){const e=1.3333333333333333*Math.tan(t/4),s=Math.cos(n),i=Math.sin(n),r=Math.cos(n+t),o=Math.sin(n+t);return[s,i,s-i*e,i+s*e,r+o*e,o-r*e,r,o]}function Ol(n,t,e,s,i,r,o,a,h){const c=Math.sin(h*sn/360),l=Math.cos(h*sn/360),u=l*(n-e)/2+c*(t-s)/2,m=-c*(n-e)/2+l*(t-s)/2;if(u===0&&m===0)return[];if(o===0||a===0)return[];o=Math.abs(o),a=Math.abs(a);const f=u*u/(o*o)+m*m/(a*a);f>1&&(o*=Math.sqrt(f),a*=Math.sqrt(f));const p=k1(n,t,e,s,i,r,o,a,c,l),y=[];let S=p[2],w=p[3];const v=Math.max(Math.ceil(Math.abs(w)/(sn/4)),1);w/=v;for(let x=0;x<v;x++)y.push(D1(S,w)),S+=w;return y.map(x=>{for(let b=0;b<x.length;b+=2){let P=x[b+0],C=x[b+1];P*=o,C*=a;const D=l*P-c*C,B=c*P+l*C;x[b+0]=D+p[0],x[b+1]=B+p[1]}return x})}function So(n,t,e,s,i,r){return[n/3+.6666666666666666*e,t/3+.6666666666666666*s,i/3+.6666666666666666*e,r/3+.6666666666666666*s,i,r]}function nn(n,t,e,s){return[n,t,e,s,e,s]}const si={a:7,c:6,s:4,q:4,t:2,m:2,l:2,h:1,v:1,z:0};function Ze(n="path"){return document.createElementNS.call(document,"http://www.w3.org/2000/svg",n)}function zl(){return Ze("path")}const L1=n=>n instanceof SVGElement&&n.tagName==="path";function R1(n,t="shape"){return Kn(fr(n),`${t}.svg`)}function Bl(n){return typeof n!="string"?!1:(n=n.trim(),/^[mlhvzaqtcs]\s*[-+.0-9][^mlhvzaqtcs]+/i.test(n)&&/[\dz]$/i.test(n))}function O1(n){return n.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 Nl(n){const t=[];return Bl(n)&&n.replace(/([mlhvzaqtcs])([^mlhvzaqtcs]*)/gi,(e,s,i)=>{let r=s.toLowerCase();const o=Li(i);for(r=="m"&&o.length>si[r]&&(t.push([s,...o.splice(0,si[r])]),r="l",s=s=="m"?"l":"L");o.length;){if(o.length<si[r])throw new Error(`parseSVGPath substring:{ ${e} } command:{ ${s} } args:{ ${o} }`);t.push([s,...o.splice(0,si[r])])}return r=="z"&&t.push([s]),""}),t}function Fl(n){let t=0,e=0,s=0,i=0;return n.map(function(r){const o=r[0],a=o.toUpperCase();if(o!=a)switch(r[0]=a,o){case"a":r[6]+=s,r[7]+=i;break;case"v":r[1]+=i;break;case"h":r[1]+=s;break;default:for(let h=1;h<r.length;)r[h++]+=s,r[h++]+=i}switch(a){case"Z":s=t,i=e;break;case"H":s=r[1];break;case"V":i=r[1];break;case"M":s=t=r[1],i=e=r[2];break;default:s=r[r.length-2],i=r[r.length-1]}return r})}function z1(n){const t=[];let e=0,s=0,i=0,r=0,o=0,a=0,h=0,c=0,l;for(let u=0,m=n.length;u<m;u++){let f=n[u];const p=f[0];switch(p){case"M":e=f[1],s=f[2];break;case"A":const y=Ol(i,r,f[6],f[7],f[4],f[5],f[1],f[2],f[3]);if(!y.length)continue;y.forEach((v,x)=>{const[b,P,C,D,B,Y,V,G]=v;f=["C",C,D,B,Y,V,G],x<y.length-1&&t.push(f)});break;case"S":let S=i,w=r;(l=="C"||l=="S")&&(S+=S-h,w+=w-c),f=["C",S,w,f[1],f[2],f[3],f[4]];break;case"T":l=="Q"||l=="T"?(o=i*2-o,a=r*2-a):(o=i,a=r),f=["C",...So(i,r,o,a,f[1],f[2])];break;case"Q":o=f[1],a=f[2],f=["C",...So(i,r,f[1],f[2],f[3],f[4])];break;case"L":f=["C",...nn(i,r,f[1],f[2])];break;case"H":f=["C",...nn(i,r,f[1],r)];break;case"V":f=["C",...nn(i,r,i,f[1])];break;case"Z":f=["C",...nn(i,r,e,s)];break}l=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 rn{video;constructor(t){this.video=t}setSrcObject(t){this.video.addEventListener("loadedmetadata",e=>{e.target}),this.video.srcObject=t}captureWebCamera(){navigator.mediaDevices.getUserMedia({video:!0}).then(t=>{this.setSrcObject(t)})}static async videoMediaChangeSupport(){return new Promise(t=>{const e=document.createElement("iframe"),s=document.createElement("video"),i=document.createElement("source"),r=new MediaSource;r.addEventListener("sourceopen",()=>t(!0)),i.src=URL.createObjectURL(r),i.media="(min-width:10px)",s.append(i),e.width="5",e.style.cssText="position: absolute; visibility: hidden;",document.documentElement.append(e),e.contentDocument?.body.append(s),setTimeout(()=>{e.width="15"}),setTimeout(()=>{e.remove(),t(!1)},1e3)})}static tryAutoPlayOrAutoPlayAfterClick(t){return new Promise(e=>{t.play().then(()=>{t.autoplay=!0,e(!0)}).catch(()=>{rn.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 _o extends _n{source;raw="";mode="text";tagname="";nodename="";textchunk="";entity="";quote="";attrs={};constructor(t){super(),this.source=t}parse(){const t=Xu(this.source);if(t===0){this.emit("finish");return}let e,s,i=ba(this.source,0);for(let r=1;r<t;r++)e=s,s=i,i=ba(this.source,r),this.raw+=s,s&&this.step(s,i,e);i&&this.step(i,void 0,s),this.emit("finish")}step(t,e,s){t==`
|
|
27
|
-
|
|
28
|
-
`);s=~U?R.length-U:s+R.length}function r(){var R={line:e,column:s};return function(L){return L.position=new o(R),p(),L}}function o(R){this.start=R,this.end={line:e,column:s},this.source=t.source}o.prototype.content=n;var a=[];function h(R){var L=new Error(t.source+":"+e+":"+s+": "+R);if(L.reason=R,L.filename=t.source,L.line=e,L.column=s,L.source=n,t.silent)a.push(L);else throw L}function c(){var R=m();return{type:"stylesheet",stylesheet:{source:t.source,rules:R,parsingErrors:a}}}function l(){return f(/^{\s*/)}function u(){return f(/^}/)}function m(){var R,L=[];for(p(),y(L);n.length&&n.charAt(0)!="}"&&(R=Vt()||te());)R!==!1&&(L.push(R),y(L));return L}function f(R){var L=R.exec(n);if(L){var U=L[0];return i(U),n=n.slice(U.length),L}}function p(){f(/^\s*/)}function y(R){var L;for(R=R||[];L=S();)L!==!1&&R.push(L);return R}function S(){var R=r();if(!(n.charAt(0)!="/"||n.charAt(1)!="*")){for(var L=2;n.charAt(L)!=""&&(n.charAt(L)!="*"||n.charAt(L+1)!="/");)++L;if(L+=2,n.charAt(L-1)==="")return h("End of comment missing");var U=n.slice(2,L-2);return s+=2,i(U),n=n.slice(L),s+=2,R({type:"comment",comment:U})}}function w(){var R=f(/^([^{]+)/);if(R)return we(R[0]).replace(/\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*\/+/g,"").replace(/"(?:\\"|[^"])*"|'(?:\\'|[^'])*'/g,function(L){return L.replace(/,/g,"")}).split(/\s*(?![^(]*\)),\s*/).map(function(L){return L.replace(/\u200C/g,",")})}function v(){var R=r(),L=f(/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(L){if(L=we(L[0]),!f(/^:\s*/))return h("property missing ':'");var U=f(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/),Z=R({type:"declaration",property:L.replace(Xl,""),value:U?we(U[0]).replace(Xl,""):""});return f(/^[;\s]*/),Z}}function x(){var R=[];if(!l())return h("missing '{'");y(R);for(var L;L=v();)L!==!1&&(R.push(L),y(R));return u()?R:h("missing '}'")}function b(){for(var R,L=[],U=r();R=f(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/);)L.push(R[1]),f(/^,\s*/);if(L.length)return U({type:"keyframe",values:L,declarations:x()})}function P(){var R=r(),L=f(/^@([-\w]+)?keyframes\s*/);if(L){var U=L[1];if(L=f(/^([-\w]+)\s*/),!L)return h("@keyframes missing name");var Z=L[1];if(!l())return h("@keyframes missing '{'");for(var At,ee=y();At=b();)ee.push(At),ee=ee.concat(y());return u()?R({type:"keyframes",name:Z,vendor:U,keyframes:ee}):h("@keyframes missing '}'")}}function C(){var R=r(),L=f(/^@supports *([^{]+)/);if(L){var U=we(L[1]);if(!l())return h("@supports missing '{'");var Z=y().concat(m());return u()?R({type:"supports",supports:U,rules:Z}):h("@supports missing '}'")}}function D(){var R=r(),L=f(/^@host\s*/);if(L){if(!l())return h("@host missing '{'");var U=y().concat(m());return u()?R({type:"host",rules:U}):h("@host missing '}'")}}function B(){var R=r(),L=f(/^@media *([^{]+)/);if(L){var U=we(L[1]);if(!l())return h("@media missing '{'");var Z=y().concat(m());return u()?R({type:"media",media:U,rules:Z}):h("@media missing '}'")}}function Y(){var R=r(),L=f(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(L)return R({type:"custom-media",name:we(L[1]),media:we(L[2])})}function V(){var R=r(),L=f(/^@page */);if(L){var U=w()||[];if(!l())return h("@page missing '{'");for(var Z=y(),At;At=v();)Z.push(At),Z=Z.concat(y());return u()?R({type:"page",selectors:U,declarations:Z}):h("@page missing '}'")}}function G(){var R=r(),L=f(/^@([-\w]+)?document *([^{]+)/);if(L){var U=we(L[1]),Z=we(L[2]);if(!l())return h("@document missing '{'");var At=y().concat(m());return u()?R({type:"document",document:Z,vendor:U,rules:At}):h("@document missing '}'")}}function J(){var R=r(),L=f(/^@font-face\s*/);if(L){if(!l())return h("@font-face missing '{'");for(var U=y(),Z;Z=v();)U.push(Z),U=U.concat(y());return u()?R({type:"font-face",declarations:U}):h("@font-face missing '}'")}}var it=Xt("import"),tt=Xt("charset"),Kt=Xt("namespace");function Xt(R){var L=new RegExp("^@"+R+"\\s*([^;]+);");return function(){var U=r(),Z=f(L);if(Z){var At={type:R};return At[R]=Z[1].trim(),U(At)}}}function Vt(){if(n[0]=="@")return P()||B()||Y()||C()||it()||tt()||Kt()||G()||V()||D()||J()}function te(){var R=r(),L=w();return L?(y(),R({type:"rule",selectors:L,declarations:x()})):h("selector missing")}return To(c())}function we(n){return n?n.replace(/^\s+|\s+$/g,""):""}function To(n,t){var e=n&&typeof n.type=="string",s=e?n:t;for(var i in n){var r=n[i];Array.isArray(r)?r.forEach(function(o){To(o,s)}):r&&typeof r=="object"&&To(r,s)}return e&&Object.defineProperty(n,"parent",{configurable:!0,writable:!0,enumerable:!1,value:t||null}),n}let B1=class extends _o{currentItem={};items=[];groups=[];globalStyles={};grad={};idtops={};text="";constructor(t){super(t),this.on("tag",(e,s)=>{switch(this.text="",this.currentItem={type:e},e){case"g":this.groups.push(this.currentItem);break}this.processAttrs(e,s)}),this.on("text",e=>{if(this.currentItem.type=="style"){try{const s=Co(e);for(const i of s.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,s)=>{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),Eo(this.currentItem.style,this.currentItem,Mo)}switch(this.processAttrs(e,s),e){case"g":this.groups.pop();break;case"cirlce":this.addToItems();break;case"ellipse":this.addToItems();break;case"polygon":this.addToItems();break;case"path":this.addToItems();break;case"line":this.addToItems();break;case"rect":this.addToItems();break;case"image":this.addToItems();break;case"text":this.currentItem.text=this.text,this.currentItem["text-anchor"]=this.currentItem["text-anchor"]||"start",this.addToItems();break}}),this.on("finish",()=>{this.emit("result",this.items)})}parse(){return super.parse(),this.items}processAttrs(t,e){let s=[],i;switch(t){case"svg":let r="",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&&Eo(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+Po(parseFloat(e.x1),parseFloat(e.y1),parseFloat(e.x2),parseFloat(e.y2),parseFloat(e.x1)+100,parseFloat(e.y1))).toFixed(2),s=[this.grad.angle];for(let a=0,h=this.grad.stops.length;a<h;a++)i=this.grad.stops[a],a&&a!=h-1?s.push(i.color+":"+i.offset):s.push(i.color);this.idtops[this.grad.id]=s.join("-"),this.items.forEach(a=>{a.fillid==this.grad.id&&(a.fill=this.idtops[this.grad.id])});break;case"radialGradient":s=[];for(let a=0,h=this.grad.stops.length;a<h;a++)i=this.grad.stops[a],a&&a!=h-1?s.push(i.color+":"+i.offset):s.push(i.color);this.idtops[this.grad.id]=s.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(Mo.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"&&Eo(o,this.currentItem,Mo),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 Po(n,t,e,s,i,r){if(typeof i>"u"||typeof r>"u"){const o=n-e,a=t-s;return!o&&!a?0:(180+Math.atan2(-a,-o)*180/Math.PI+360)%360}else return Po(n,t,i,r)-Po(e,s,i,r)}function Eo(n,t,e){const s=(n+"").split(";"),i=/^\s+|\s+$/g;for(let r=0,o=s.length;r<o;r++){const a=s[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 Mo=["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 Et{prevPathX=0;prevPathY=0;isUpdatedSVGPathData=!0;isUpdatedSVGPathD=!0;isUpdatedBoundingClientRect=!0;isUpdatedPolymorphPoints=!0;isUpdatedTotalLength=!0;normalizedLines=[];constructor(t){const e=typeof t=="string"?Nl(t):t||[],s=z1(Fl(e));for(let i=0,r=s.length;i<r;i++){const o=s[i];o[0]=="M"?(this.prevPathX=o[1],this.prevPathY=o[2]):this._appendLine(new xt({x:this.prevPathX,y:this.prevPathY,c1x:o[1],c1y:o[2],c2x:o[3],c2y:o[4],toX:o[5],toY:o[6]}))}}_appendLine(t){if(this.isUpdatedSVGPathData=!0,this.isUpdatedSVGPathD=!0,this.isUpdatedBoundingClientRect=!0,this.isUpdatedPolymorphPoints=!0,this.isUpdatedTotalLength=!0,t instanceof vo){Ol(this.prevPathX,this.prevPathY,t.toX,t.toY,t.largeArcFlag,t.sweepFlag,t.rx,t.ry,t.xAxisRotate).forEach(c=>{const[l,u,m,f,p,y,S,w]=c;this.normalizedLines.push(new xt({x:this.prevPathX,y:this.prevPathY,c1x:m,c1y:f,c2x:p,c2y:y,toX:S,toY:w})),this.prevPathX=S,this.prevPathY=w});return}if(t instanceof xt){this.normalizedLines.push(t.clone()),this.prevPathX=t.toX,this.prevPathY=t.toY;return}let e,s,i,r,o,a;t instanceof I1?[e,s,i,r,o,a]=So(this.prevPathX,this.prevPathY,t.cx,t.cy,t.toX,t.toY):[e,s,i,r,o,a]=nn(this.prevPathX,this.prevPathY,t.toX,t.toY),this.normalizedLines.push(new xt({x:this.prevPathX,y:this.prevPathY,c1x:e,c1y:s,c2x:i,c2y:r,toX:o,toY:a})),this.prevPathX=o,this.prevPathY=a}static fromPolymorphPoints(t){const e=new Et,s=t.length;if(s){e.prevPathX=t[0],e.prevPathY=t[1];for(let i=2;i+5<s;i+=6)e._appendLine(new xt({x:e.prevPathX,y:e.prevPathY,c1x:t[i],c1y:t[i+1],c2x:t[i+2],c2y:t[i+3],toX:t[i+4],toY:t[i+5]}))}return e}static fromLines(t){const e=new Et,s=t.length;if(s){e.prevPathX=t[0].x,e.prevPathY=t[0].y;for(let i=0;i<s;i++)e._appendLine(t[i])}return e}clone(){return Et.fromLines(this.normalizedLines)}cachedSVGPathData=[];toSVGPathData(){if(this.isUpdatedSVGPathData){const t=[];for(let e=0,s=this.normalizedLines.length;e<s;e++){const i=this.normalizedLines[e];e==0&&t.push(["M",i.x,i.y]),t.push(...i.toSVGPathData())}this.cachedSVGPathData=t,this.isUpdatedSVGPathData=!1}return this.cachedSVGPathData}cachedSVGPathD="";toSVGPathD(){return this.isUpdatedSVGPathD&&(this.cachedSVGPathD=O1(this.toSVGPathData()),this.isUpdatedSVGPathD=!1),this.cachedSVGPathD}toCanvasContext(t){t.beginPath();for(let e=0,s=this.normalizedLines.length;e<s;e++){const i=this.normalizedLines[e];e==0&&t.moveTo(i.x,i.y),i.toCanvasContext(t)}}cachedBoundingClientRect={x:0,y:0,width:0,height:0};getBoundingClientRect(t=2){if(this.isUpdatedBoundingClientRect){const e=[],s=[];if(this.normalizedLines.forEach(i=>{const r=i.getBoundingClientRect(t);e.push(r.x,r.x+r.width),s.push(r.y,r.y+r.height)}),e.length==0||s.length==0)this.cachedBoundingClientRect={x:0,y:0,width:0,height:0};else{const i=Math.min(...e),r=Math.min(...s),o=Math.max(...e),a=Math.max(...s);this.cachedBoundingClientRect={x:F(i,t),y:F(r,t),width:F(o-i,t),height:F(a-r,t)}}this.isUpdatedBoundingClientRect=!1}return this.cachedBoundingClientRect}getBoundingClientRectCenter(t=2){const e=this.getBoundingClientRect(t);return{x:F(e.x+e.width*.5,t),y:F(e.y+e.height*.5,t)}}transform(t){let e;return t.m?e=t.m:(e=new wt,e.translate(t.x||0,t.y||0),e.rotate(t.degree||0,t.centerX,t.centerY),e.scale(t.scaleX||1,t.scaleY||1,t.centerX,t.centerY)),e.isIdentity?this.clone():Et.fromLines(this.normalizedLines.map(s=>{let i=s.x,r=s.y,o=s.c1x,a=s.c1y,h=s.c2x,c=s.c2y,l=s.toX,u=s.toY;return{x:i,y:r}=e.transformPoint({x:i,y:r}),{x:o,y:a}=e.transformPoint({x:o,y:a}),{x:h,y:c}=e.transformPoint({x:h,y:c}),{x:l,y:u}=e.transformPoint({x:l,y:u}),new xt({x:i,y:r,c1x:o,c1y:a,c2x:h,c2y:c,toX:l,toY:u})}))}cachedTotalLength;getTotalLength(){return(typeof this.cachedTotalLength!="number"||this.isUpdatedTotalLength)&&(this.cachedTotalLength=Math.round(this.normalizedLines.reduce((t,e)=>t+=e.length(),0)),this.isUpdatedTotalLength=!1),this.cachedTotalLength}getPointAtLength(t){let e=0,s=0;const i=this.normalizedLines.length;for(let r=0;r<i;r++){const o=this.normalizedLines[r];if(s=o.length(),e+s>=t)return o.getPointAtSegmentLength(t-e);e+=s}return this.normalizedLines[i-1].getPointAtSegmentLength(s)}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 s=t*e,i=this.normalizedLines[0];if(s--,s>1)for(let r=1;r<e&&(i=this.normalizedLines[r],s>1);r++)s-=1;return i.interpolate(s)}}getSubPathD(t,e,s=1e-6){const i=this.getSubPathDAtLength(e,!0);return As(t,0,s)?i:i.getSubPathDAtLength(t,!1)}getSubPathDAtLength(t,e=!1){const s=new Et;let i=0,r=!1;for(let o=0,a=this.normalizedLines.length;o<a;o++){const h=this.normalizedLines[o];o==0&&(s.prevPathX=h.x,s.prevPathY=h.y);const c=h.length();if(i+c>t&&!r){r=!0;const l=h.getPointAtSegmentLength(t-i);if(s._appendLine(new xt({x:s.prevPathX,y:s.prevPathY,c1x:l.start.x,c1y:l.start.y,c2x:l.m.x,c2y:l.m.y,toX:l.x,toY:l.y})),e)return s;s.normalizedLines=[],s._appendLine(new xt({x:s.prevPathX,y:s.prevPathY,c1x:l.n.x,c1y:l.n.y,c2x:l.end.x,c2y:l.end.y,toX:h.toX,toY:h.toY})),i+=c;continue}s._appendLine(h),i+=c}return s}closestPoint(t,e){const s=this.getTotalLength();let i={x:t,y:e},r=0,o=1/0,a=8;for(let c=0;c<=s;c+=a){const l=this.getPointAtLength(c),u=(t-l.x)*(t-l.x)+(e-l.y)*(e-l.y);u<o&&(i=l,r=c,o=u)}for(a/=2;a>.5;){const c=r-a,l=this.getPointAtLength(c),u=(t-l.x)*(t-l.x)+(e-l.y)*(e-l.y),m=r+a,f=this.getPointAtLength(m),p=(t-f.x)*(t-f.x)+(e-f.y)*(e-f.y);c>=0&&u<o?(i=l,r=c,o=u):m<=s&&p<o?(i=f,r=m,o=p):a/=2}const h=this.getPointAtLength(r+(r===s?-.1:.1));return{point:i,rotation:r>=s?zt(h.x,h.y,i.x,i.y):zt(i.x,i.y,h.x,h.y),distance:Math.sqrt(o)}}cachedPolymorphPoints=[];getPolymorphPoints(){if(this.isUpdatedPolymorphPoints){if(this.normalizedLines.length){const t=this.normalizedLines[0];this.cachedPolymorphPoints=[t.x,t.y].concat(this.normalizedLines.reduce((e,s)=>e.concat([s.c1x,s.c1y,s.c2x,s.c2y,s.toX,s.toY]),[]))}this.isUpdatedPolymorphPoints=!1}return[...this.cachedPolymorphPoints]}getPolymorphPointsPerimeter(){let t=0;const e=this.getPolymorphPoints(),s=e.length;if(s){let i=e[s-2],r=e[s-1];for(let o=0;o<s;o+=6)t+=Ae(e[o],e[o+1],i,r),i=e[o],r=e[o+1]}return Math.floor(t)}expendToPolymorphPoints(t){const e=t.length,s=this.getPolymorphPoints(),i=s.length;if(i){const r=[];let o=e-i;const a=Math.ceil(e/i);r.push(["M",s[0],s[1]]);let h=2;for(;h+5<=i-1;){const c=s[h++],l=s[h++],u=s[h++],m=s[h++],f=s[h++],p=s[h++];r.push(["C",c,l,u,m,f,p]);let y=0;for(;y<a&&o>0;)r.push(["C",f,p,f,p,f,p]),o-=6,y++}return new Et(r)}else return Et.fromPolymorphPoints(t)}static getInterpolator(t,e){return s=>As(s,0,Number.EPSILON)?t.clone():As(s,1,Number.EPSILON)?e.clone():Et.fromPolymorphPoints(df(t.getPolymorphPoints(),e.getPolymorphPoints(),s).map(i=>F(i,2)))}}const Ul=N1("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 N1(n,t=10){const e={},s=n.split(",");for(let i=0;i<s.length;i+=2){const r="&"+s[i+1]+";",o=parseInt(s[i],t);e[r]="&#"+o+";"}return e["\\xa0"]=" ",e}function Mt(n,t){const e=Object.keys(t);for(let s=0;s<e.length;s++)n=n.replace(new RegExp("{"+e[s]+"}","gi"),""+t[e[s]]);return n}function ni(n){let t,e;if(!n)throw new Error("cannot create a random attribute name for an undefined object");const s="ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz";t="";do for(t="",e=0;e<12;e++)t+=s[Math.floor(Math.random()*s.length)];while(n[t]);return t}function F1(n){const t={left:"start",right:"end",center:"middle",start:"start",end:"end"};return t[n]||t.start}function Y1(n){const t={alphabetic:"alphabetic",hanging:"hanging",top:"text-before-edge",bottom:"text-after-edge",middle:"central"};return t[n]||t.alphabetic}const on={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 Ao{__root;__ctx;constructor(t,e){this.__root=t,this.__ctx=e}addColorStop(t,e){const s=this.__ctx.__createElement("stop");if(s.setAttribute("offset",""+t),e.indexOf("rgba")!==-1){const r=/rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d?\.?\d*)\s*\)/gi.exec(e);r&&(s.setAttribute("stop-color",Mt("rgb({r},{g},{b})",{r:r[1],g:r[2],b:r[3]})),s.setAttribute("stop-opacity",r[4]))}else s.setAttribute("stop-color",e);this.__root.appendChild(s)}}class $l{__root;__ctx;constructor(t,e){this.__root=t,this.__ctx=e}}class ii{__document=document;__canvas;__ctx;width;height;__styleStack;__groupStack;__rootSVG;__ids;__SVGdefs;__currentElement;__currentElementsToStyle=null;constructor({canvas:t,width:e=500,height:s=500}){t?(this.__canvas=t,this.__ctx=t.getContext("2d")):(this.__canvas=this.__document.createElement("canvas"),this.__ctx=this.__canvas.getContext("2d")),this.width=e||t?.width||0,this.height=s||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(on);for(let e=0,s=t.length;e<s;e++){const i=t[e];this[i]=on[i].canvas}}__getStyleState(){const t={},e=Object.keys(on);for(let s=0,i=e.length;s<i;s++){const r=e[s];t[r]=this[r]}return t}__applyStyleState(t){const e=Object.keys(t);for(let s=0,i=e.length;s<i;s++){const r=e[s];this[r]=t[r]}}__createElement(t,e={},s=!1){const i=this.__document.createElementNS("http://www.w3.org/2000/svg",t),r=Object.keys(e);s&&(i.setAttribute("fill","none"),i.setAttribute("stroke","none"));for(let o=0;o<r.length;o++){const a=r[o];i.setAttribute(a,e[a])}return i}__applyStyleToCurrentElement(t){let e=this.__currentElement;const s=this.__currentElementsToStyle;s&&(e.setAttribute(t,""),e=s.element,s.children.forEach(r=>{r.setAttribute(t,"")}));const i=Object.keys(on);for(let r=0;r<i.length;r++){const o=on[i[r]],a=this[i[r]];if(o.apply){if(a instanceof $l){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 Ao)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 l=parseFloat(c[4]);const u=this.globalAlpha;u!=null&&(l*=u),e.setAttribute(o.svgAttr+"-opacity",""+l)}}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(Ul);for(let r=0,o=i.length;r<o;r++){const a=i[r],h=Ul[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 s=this.__currentElement.getAttribute("transform");s?s+=" ":s="",s+=t,this.__currentElement.setAttribute("transform",s)}scale(t,e){e===void 0&&(e=t),this.__addTransform(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,s,i,r,o){this.__addTransform(Mt("matrix({a},{b},{c},{d},{e},{f})",{a:t,b:e,c:s,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,s,i,r,o){this.__currentPosition={x:r,y:o},this.__addPathCommand(Mt("C {cp1x} {cp1y} {cp2x} {cp2y} {x} {y}",{cp1x:t,cp1y:e,cp2x:s,cp2y:i,x:r,y:o}))}quadraticCurveTo(t,e,s,i){this.__currentPosition={x:s,y:i},this.__addPathCommand(Mt("Q {cpx} {cpy} {x} {y}",{cpx:t,cpy:e,x:s,y:i}))}normalize(t){const e=Math.sqrt(t[0]*t[0]+t[1]*t[1]);return[t[0]/e,t[1]/e]}arcTo(t,e,s,i,r){const 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===s&&e===i||r===0){this.lineTo(t,e);return}const h=this.normalize([o-t,a-e]),c=this.normalize([s-t,i-e]);if(h[0]*c[1]===h[1]*c[0]){this.lineTo(t,e);return}const l=h[0]*c[0]+h[1]*c[1],u=Math.acos(Math.abs(l)),m=this.normalize([h[0]+c[0],h[1]+c[1]]),f=r/Math.sin(u/2),p=t+f*m[0],y=e+f*m[1],S=[-h[1],h[0]],w=[c[1],-c[0]],v=function(P){const C=P[0];return P[1]>=0?Math.acos(C):-Math.acos(C)},x=v(S),b=v(w);this.lineTo(p+S[0]*r,y+S[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,s,i){this.__currentElement.nodeName!=="path"&&this.beginPath(),this.moveTo(t,e),this.lineTo(t+s,e),this.lineTo(t+s,e+i),this.lineTo(t,e+i),this.lineTo(t,e),this.closePath()}fillRect(t,e,s,i){const r=this.__createElement("rect",{x:t,y:e,width:s,height:i},!0);this.__closestGroupOrSvg().appendChild(r),this.__currentElement=r,this.__applyStyleToCurrentElement("fill")}strokeRect(t,e,s,i){const r=this.__createElement("rect",{x:t,y:e,width:s,height:i},!0);this.__closestGroupOrSvg().appendChild(r),this.__currentElement=r,this.__applyStyleToCurrentElement("stroke")}__clearCanvas(){const e=this.__closestGroupOrSvg().getAttribute("transform"),s=this.__rootSVG.childNodes[1],i=s.childNodes;for(let r=i.length-1;r>=0;r--)i[r]&&s.removeChild(i[r]);this.__currentElement=s,this.__groupStack=[],e&&this.__addTransform(e)}clearRect(t,e,s,i){if(t===0&&e===0&&s===this.width&&i===this.height){this.__clearCanvas();return}const r=this.__closestGroupOrSvg(),o=this.__createElement("rect",{x:t,y:e,width:s,height:i,fill:"#FFFFFF"},!0);r.appendChild(o)}createLinearGradient(t,e,s,i){const r=this.__createElement("linearGradient",{id:ni(this.__ids),x1:t+"px",x2:s+"px",y1:e+"px",y2:i+"px",gradientUnits:"userSpaceOnUse"},!1);return this.__SVGdefs.appendChild(r),new Ao(r,this)}createRadialGradient(t,e,s,i,r,o){const a=this.__createElement("radialGradient",{id:ni(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 Ao(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),s={style:e[1]||"normal",size:e[4]||"10px",family:e[6]||"sans-serif",weight:e[3]||"normal",decoration:e[2]||"normal",href:null};return this.__fontUnderline==="underline"&&(s.decoration="underline"),this.__fontHref&&(s.href=this.__fontHref),s}__wrapTextLink(t,e){if(t.href){const s=this.__createElement("a");return s.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",t.href),s.appendChild(e),s}return e}__applyText(t,e,s,i){const r=this.__parseFont(),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:s,"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,s){this.__applyText(t,e,s,"fill")}strokeText(t,e,s){this.__applyText(t,e,s,"stroke")}measureText(t){return this.__ctx.font=this.font,this.__ctx.measureText(t)}arc(t,e,s,i,r,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+s*Math.cos(r),h=e+s*Math.sin(r),c=t+s*Math.cos(i),l=e+s*Math.sin(i),u=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,l),this.__addPathCommand(Mt("A {rx} {ry} {xAxisRotation} {largeArcFlag} {sweepFlag} {endX} {endY}",{rx:s,ry:s,xAxisRotation:0,largeArcFlag:m,sweepFlag:u,endX:a,endY:h})),this.__currentPosition={x:a,y:h}}clip(){const t=this.__closestGroupOrSvg(),e=this.__createElement("clipPath"),s=ni(this.__ids),i=this.__createElement("g");this.__applyCurrentDefaultPath(),t.removeChild(this.__currentElement),e.setAttribute("id",s),e.appendChild(this.__currentElement),this.__SVGdefs.appendChild(e),t.setAttribute("clip-path",Mt("url(#{id})",{id:s})),t.appendChild(i),this.__currentElement=i}drawImage(...t){let e=t[0],s,i,r,o,a=0,h=0,c,l,u,m,f,p,y,S;if(t.length===3)s=t[1],i=t[2],c=e.width,l=e.height,r=c,o=l;else if(t.length===5)s=t[1],i=t[2],r=t[3],o=t[4],c=e.width,l=e.height;else if(t.length===9)a=t[1],h=t[2],c=t[3],l=t[4],s=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 v="translate("+s+", "+i+")";if(e instanceof ii){if(u=e.getSvg().cloneNode(!0),u.childNodes&&u.childNodes.length>1){for(m=u.childNodes[0];m.childNodes.length;)S=m.childNodes[0].getAttribute("id"),this.__ids[S]=S,this.__SVGdefs.appendChild(m.childNodes[0]);if(f=u.childNodes[1],f){const x=f.getAttribute("transform");let b;x?b=x+" "+v:b=v,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||l!==e.height)&&(y=this.__document.createElement("canvas"),y.width=r,y.height=o,y.getContext("2d")?.drawImage(e,a,h,c,l,0,0,r,o),e=y),p.setAttribute("transform",v),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 s=this.__document.createElementNS("http://www.w3.org/2000/svg","pattern"),i=ni(this.__ids);let r;return s.setAttribute("id",i),t.nodeName==="CANVAS"||t.nodeName==="IMG"?(r=this.__document.createElementNS("http://www.w3.org/2000/svg","image"),r.setAttribute("width",""+t.width),r.setAttribute("height",""+t.height),r.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",t.nodeName==="CANVAS"?t.toDataURL():t.getAttribute("src")),s.appendChild(r),this.__SVGdefs.appendChild(s)):t instanceof ii&&(s.setAttribute("width",""+t.width),s.setAttribute("height",""+t.height),s.appendChild(t.__rootSVG.childNodes[1]),this.__SVGdefs.appendChild(s)),new $l(s,this)}setLineDash(t){t&&t.length>0?this.lineDash=t.join(","):this.lineDash=null}drawFocusRing(){}createImageData(){}getImageData(){}putImageData(){}globalCompositeOperation(){}setTransform(){}}class Io{canvas;context;customContext;enablePath2D=!1;currentPath2D=new Path2D;path2Ds=[];currentMatrix=new DOMMatrix;hasSetCustomStrokeStyle=!1;hasSetCustomFillStyle=!1;constructor(t,e,s,i=!1,r=!1){this.canvas=t,this.context=t.getContext("2d",{willReadFrequently:!0}),i&&(this.customContext=new ii({canvas:this.canvas,width:e||this.canvas.width,height:s||this.canvas.height})),this.enablePath2D=typeof r=="boolean"?r:!1}set lineWidth(t){this.hasSetCustomStrokeStyle=!0,this.context.lineWidth=t,this.customContext&&(this.customContext.lineWidth=t)}get lineWidth(){return this.context.lineWidth}set lineCap(t){this.hasSetCustomStrokeStyle=!0,this.context.lineCap=t,this.customContext&&(this.customContext.lineCap=t)}get lineCap(){return this.context.lineCap}set lineJoin(t){this.hasSetCustomStrokeStyle=!0,this.context.lineJoin=t,this.customContext&&(this.customContext.lineCap=t)}get lineJoin(){return this.context.lineJoin}set lineDashOffset(t){this.hasSetCustomStrokeStyle=!0,this.context.lineDashOffset=t,this.customContext&&(this.customContext.lineDashOffset=t)}get lineDashOffset(){return this.context.lineDashOffset}set miterLimit(t){this.hasSetCustomStrokeStyle=!0,this.context.miterLimit=t,this.customContext&&(this.customContext.miterLimit=t)}get miterLimit(){return this.context.miterLimit}set globalAlpha(t){this.context.globalAlpha=t,this.customContext&&(this.customContext.globalAlpha=t)}get globalAlpha(){return this.context.globalAlpha}set fillStyle(t){this.hasSetCustomFillStyle=!0,typeof t=="string"||t instanceof CanvasGradient||t instanceof CanvasPattern?(this.context.fillStyle=t,this.customContext&&(this.customContext.fillStyle=t)):(this.context.fillStyle=t.gradient,this.customContext&&(this.customContext.fillStyle=t.gradientCustom))}get fillStyle(){return this.context.fillStyle}set strokeStyle(t){this.hasSetCustomStrokeStyle=!0,typeof t=="string"||t instanceof CanvasGradient||t instanceof CanvasPattern?(this.context.strokeStyle=t,this.customContext&&(this.customContext.strokeStyle=t)):(this.context.strokeStyle=t.gradient,this.customContext&&(this.customContext.strokeStyle=t.gradientCustom))}get strokeStyle(){return this.context.strokeStyle}set font(t){this.context.font=t,this.customContext&&(this.customContext.font=t)}get font(){return this.context.font}set textBaseline(t){this.context.textBaseline=t,this.customContext&&(this.customContext.textBaseline=t)}get textBaseline(){return this.context.textBaseline}set textAlign(t){this.context.textAlign=t,this.customContext&&(this.customContext.textAlign=t)}get textAlign(){return this.context.textAlign}fill(t){return t?this.context.fill(t):(this.context.fill(),this.customContext&&this.customContext.fill()),this}fillRect(t,e,s,i){return this.context.fillRect(t,e,s,i),this.customContext&&this.customContext.fillRect(t,e,s,i),this}fillText(t,e,s,i){return this.hasSetCustomFillStyle=!1,this.context.fillText(t,e,s,i),this.customContext&&this.customContext.fillText(t,e,s),this}setLineDash(t){return this.context.setLineDash(t),this.customContext&&this.customContext.setLineDash(t),this}stroke(t){return t?this.context.stroke(t):(this.context.stroke(),this.customContext&&this.customContext.stroke()),this}strokeText(t,e,s,i){return this.context.strokeText(t,e,s,i),this.customContext&&this.customContext.strokeText(t,e,s),this}strokeRect(t,e,s,i){return this.context.strokeRect(t,e,s,i),this.customContext&&this.customContext.strokeRect(t,e,s,i),this}measureText(t){return this.context.measureText(t)}clearRect(t=0,e=0,s=this.canvas.width,i=this.canvas.height){return this.context.clearRect(t,e,s,i),this.customContext&&this.customContext.clearRect(t,e,s,i),this}save(){return this.context.save(),this.customContext&&this.customContext.save(),this.currentMatrix=new DOMMatrix,this.enablePath2D&&(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.enablePath2D&&(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.enablePath2D&&this.currentPath2D.closePath(),this}changePath2D(t=this.currentPath2D,e=this.currentMatrix){if(this.enablePath2D){const s=new Path2D;s.addPath(t,e),this.currentPath2D=s}}isPointInStroke(...t){return t[0]instanceof Path2D?this.context.isPointInStroke(t[0],t[1],t[2]):this.context.isPointInStroke(t[0],t[1])}isPointInPath(...t){return t[0]instanceof Path2D?this.context.isPointInPath(t[0],t[1],t[2]):this.context.isPointInPath(t[0],t[1])}translate(t,e){return this.context.translate(t,e),this.customContext&&this.customContext.translate(t,e),this.currentMatrix=this.currentMatrix.translate(t,e),this.changePath2D(),this}rotate(t,e=0,s=0){return this.translate(e,s),this.context.rotate(t),this.customContext&&this.customContext.rotate(t),this.currentMatrix=this.currentMatrix.rotate(t),this.translate(-e,-s),this.changePath2D(),this}scale(t,e=t,s=0,i=0){return this.translate(s,i),this.context.scale(t,e),this.customContext&&this.customContext.scale(t,e),this.currentMatrix=this.currentMatrix.scale(t,e),this.translate(-s,-i),this.changePath2D(),this}moveTo(t,e){return this.context.moveTo(t,e),this.customContext&&this.customContext.moveTo(t,e),this.enablePath2D&&this.currentPath2D.moveTo(t,e),this}lineTo(t,e){return this.context.lineTo(t,e),this.customContext&&this.customContext.lineTo(t,e),this.enablePath2D&&this.currentPath2D.lineTo(t,e),this}arc(t,e,s,i,r,o){return this.context.arc(t,e,s,i,r,o),this.customContext&&this.customContext.arc(t,e,s,i,r,o?-1:1),this.enablePath2D&&this.currentPath2D.arc(t,e,s,i,r,o),this}arcTo(t,e,s,i,r){return this.context.arcTo(t,e,s,i,r),this.customContext&&this.customContext.arcTo(t,e,s,i,r),this.enablePath2D&&this.currentPath2D.arcTo(t,e,s,i,r),this}ellipse(t,e,s,i,r,o,a,h){return this.context.ellipse(t,e,s,i,r,o,a,h),this.enablePath2D&&this.currentPath2D.ellipse(t,e,s,i,r,o,a,h),this}quadraticCurveTo(t,e,s,i){return this.context.quadraticCurveTo(t,e,s,i),this.customContext&&this.customContext.quadraticCurveTo(t,e,s,i),this.enablePath2D&&this.currentPath2D.quadraticCurveTo(t,e,s,i),this}bezierCurveTo(t,e,s,i,r,o){return this.context.bezierCurveTo(t,e,s,i,r,o),this.customContext&&this.customContext.bezierCurveTo(t,e,s,i,r,o),this.enablePath2D&&this.currentPath2D.bezierCurveTo(t,e,s,i,r,o),this}rect(t,e,s,i){return this.context.rect(t,e,s,i),this.customContext&&this.customContext.rect(t,e,s,i),this.enablePath2D&&this.currentPath2D.rect(t,e,s,i),this}createLinearGradient(t,e,s,i,r){const o=this.context.createLinearGradient(t,e,s,i);return r&&Object.entries(r).forEach(([a,h])=>{o.addColorStop(parseFloat(a),h)}),o}createRadialGradient(t,e,s,i,r,o,a){const h=this.context.createRadialGradient(t,e,s,i,r,o);return a&&Object.entries(a).forEach(([c,l])=>{h.addColorStop(parseFloat(c),l)}),h}drawImage(t,...e){if(e.length===0)this.context.drawImage(t,0,0);else if(e.length===2){const s=e[0],i=e[1];this.context.drawImage(t,s,i)}else if(e.length===4){const s=e[0],i=e[1],r=e[2],o=e[3];this.context.drawImage(t,s,i,r,o)}else if(e.length===8){const s=e[0],i=e[1],r=e[2],o=e[3],a=e[4],h=e[5],c=e[6],l=e[7];this.context.drawImage(t,s,i,r,o,a,h,c,l)}else throw new Error("Invalid number of arguments passed to drawImage: "+e.length);return this.customContext&&this.customContext.drawImage(t,...e),this}getImageData(t=0,e=0,s=this.canvas.width,i=this.canvas.height,r){return this.context.getImageData(t,e,s,i,r)}putImageData(t,e=0,s=0){return this.context.putImageData(t,e,s)}createPattern(t,e){return this.context.createPattern(t,e)}toRawSVG(){if(this.customContext){const t=this.customContext.getSerializedSvg(!0),e=this.customContext.getSvg();return{raw:t,element:e}}else return{raw:"",element:null}}}class K{shouldUpdatePathD=!1;shouldUpdateTransformPathD=!1;shouldUpdateSVGElInDraw=!1;shouldUpdateMInDraw=!0;shouldUpdateAttrsInDraw=!0;shouldUpdateStyleInDraw=!0;id;initD;d;parent;attrs={};style={};initCenterX;initCenterY;_x;_y;_degree;_scaleX;_scaleY;vx;vy;ax;ay;mass;interactive;drag;transform$=new ds;transformSubscription;isMouseIn=!1;isDragging=!1;m;el;constructor(t){this.id=Ms(4),this.initD=t?.initD,this.setAttr({stroke:"none",fill:"none"}),t?.attrs&&this.setAttr(t.attrs),t?.style&&this.setStyle(t.style),this.initCenterX=t?.centerX,this.initCenterY=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.interactive=typeof t?.interactive=="boolean"?t?.interactive:!0,this.drag=t?.drag,this.transformSubscription=this.transform$.subscribe(()=>{this.shouldUpdateTransformPathD=!0,this.shouldUpdateMInDraw=!0})}destroy(){this.transformSubscription.unsubscribe()}moveTo(t,e){const s=this._x,i=this._y;(s!==t||i!==e)&&(this._x=t,this._y=e,this.transform$.next({dX:t-s,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&&(this.transform$.next({dX:t-this._x}),this._x=t)}get y(){return this._y}set y(t){this._y!==t&&(this.transform$.next({dY:t-this._y}),this._y=t)}rotateTo(t){this._degree!==t&&(this.transform$.next({dDegree:t-this._degree}),this._degree=t)}rotate(t){this.rotateTo(this._degree+t)}get degree(){return this._degree}set degree(t){this._degree!==t&&(this.transform$.next({dDegree:t-this._degree}),this._degree=t)}scaleTo(t,e){const s=this._scaleX,i=this._scaleY;(this._scaleX!==t||this._scaleY!==(e||t))&&(this._scaleX=t,this._scaleY=e||t,this.transform$.next({dScaleX:this._scaleX/s,dScaleY:this._scaleY/i}))}scale(t,e){this.scaleTo(this._scaleX*t,this._scaleY*(e||t))}get scaleX(){return this._scaleX}set scaleX(t){this._scaleX!==t&&(this.transform$.next({dScaleX:t/this._scaleX}),this._scaleX=t)}get scaleY(){return this._scaleY}set scaleY(t){this._scaleY!==t&&(this.transform$.next({dScaleY:t/this._scaleY}),this._scaleY=t)}pathD(t){return t?(this.d=t,this.shouldUpdateTransformPathD=!0,this.shouldUpdateSVGElInDraw=!0):this.initD?this.d||(this.d=this.initD instanceof Et?this.initD:new Et(this.initD)):(!this.d||this.shouldUpdatePathD)&&(this.d=new Et(this.toSVGPathData()),this.shouldUpdatePathD=!1,this.shouldUpdateTransformPathD=!0,this.shouldUpdateSVGElInDraw=!0),this.d}cachedTransformedPathD;transformPathD(){if(!this.m){const{x:t,y:e}=this.transformOrigin();let s=0,i=0;if(this.parent?.dDegree||this.parent?.dScaleX!==1||this.parent?.dScaleY!==1){const o=this.transformOrigin(!0);s=o.x,i=o.y}const r=new wt;r.translate(this.x+(this.parent?.dX||0),this.y+(this.parent?.dY||0)),r.rotate(this.degree,t,e),r.scale(this.scaleX,this.scaleY,t,e),this.parent?.dDegree&&r.rotate(this.parent.dDegree,s,i),(this.parent?.dScaleX!==1||this.parent?.dScaleY!==1)&&r.scale(this.parent?.dScaleX||1,this.parent?.dScaleY||1,s,i),this.m=r}return(this.shouldUpdateTransformPathD||!this.cachedTransformedPathD)&&(this.cachedTransformedPathD=this.pathD().transform({m:this.m}),this.shouldUpdateTransformPathD=!1),this.cachedTransformedPathD}getBaseOptions(){return{initD:this.initD,attrs:{...this.attrs},style:{...this.style},centerX:this.initCenterX,centerY:this.initCenterY,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,interactive:this.interactive,drag:{...this.drag}}}clone(){return this.cloneShape()}cloneShape(){return new K(this.getBaseOptions())}update(t){this.shouldUpdatePathD=!0}toSVGEl(){return null}toSVGPathData(){return[]}toSVGPathD(){return this.pathD().toSVGPathD()}toCanvasContext(t){this.pathD().toCanvasContext(t)}getBoundingClientRect(t=2){return this.pathD().getBoundingClientRect(t)}getRealBoundingClientRect(t=2){return this.transformPathD().getBoundingClientRect(t)}getBoundingClientRectCenter(t=2){return this.pathD().getBoundingClientRectCenter(t)}getRealBoundingClientRectCenter(t=2){return this.transformPathD().getBoundingClientRectCenter(t)}transformOrigin(t=!1,e=2){let s=0,i=0;if(this.parent&&!t){const r=this.parent.combo.getBoundingClientRectCenter(e);s=r.x-this.parent.dX,i=r.y-this.parent.dY}else if(typeof this.initCenterX>"u"&&typeof this.initCenterY>"u"){const r=this.getBoundingClientRectCenter(e);s=r.x,i=r.y}else s=this.initCenterX||0,i=this.initCenterY||0;return{x:s,y:i}}isPointInPath(t,e,s){if(t instanceof Io)return t.isPointInPath(new Path2D(this.toSVGPathD()),e,s);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*s+r.e,y:r.b*e+r.d*s+r.f})}}return!1}isPointInStroke(t,e,s){if(t instanceof Io)return t.isPointInStroke(new Path2D(this.toSVGPathD()),e,s);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*s+r.e,y:r.b*e+r.d*s+r.f})}}return!1}setStyle(t){Object.assign(this.style,t),this.shouldUpdateStyleInDraw=!0}setAttr(t,e){if(typeof t!="string")for(const s in t){const i=t[s];i&&i!=this.getAttr(s)&&(this.attrs[lt(s)]=i,this.shouldUpdateAttrsInDraw=!0)}else e&&e!=this.getAttr(t)&&(this.attrs[lt(t)]=e,this.shouldUpdateAttrsInDraw=!0)}getAttr(t,e){return this.attrs[t]||this.attrs[lt(t)]||e}hasAttr(t){return!!this.getAttr(t)}animate(t){this.vx+=this.ax,this.vy+=this.ay;const e=t?.gravity||0;this.vy+=e;const s=t?.friction||1;this.vx*=s,this.vy*=s,this.move(this.vx,this.vy)}animateEaseTo(t,e){const s=e?.easing||.05,i=t.x-this.x,r=t.y-this.y;this.vx=i*s,this.vy=r*s,this.animate(e)}animateSpringTo(t,e){const s=e?.spring||.03;(Array.isArray(t)?t:[t]).forEach(i=>{const r=i.x-this.x,o=i.y-this.y,a=r*s,h=o*s;this.vx+=a,this.vy+=h}),this.animate({friction:.9,...e})}getSpringMassAlphaTo(t,e){const s=e?.springLength||100,i=e?.spring||5e-4,r=t.x-this.x,o=t.y-this.y,a=Math.sqrt(r*r+o*o);if(a<s){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/s}return 0}followTo(t,e=3){this.rotateTo(mt(zt(this.x,this.y,t.x,t.y)));const{dx:s,dy:i}=Ie(q(this.degree),e);this.vx=s,this.vy=i,this.animate()}followAccelerationTo(t,e=.05){this.rotateTo(mt(zt(this.x,this.y,t.x,t.y)));const{dx:s,dy:i}=Ie(q(this.degree),e);this.ax=s,this.ay=i,this.animate()}gravitateTo(t){const e=t.x-this.x,s=t.y-this.y,i=e*e+s*s,r=Math.sqrt(i),o=this.mass*t.mass/i,a=o*e/r,h=o*s/r;this.vx+=a/this.mass,this.vy+=h/this.mass,t.vx-=a/t.mass,t.vy-=h/t.mass}checkCollision(t){const e=t.x-this.x,s=t.y-this.y,i=Math.sqrt(e*e+s*s),{x:r,y:o,width:a,height:h}=t.getBoundingClientRect(),{x:c,y:l}=t.getBoundingClientRectCenter(),{x:u,y:m,width:f,height:p}=this.getBoundingClientRect(),{x:y,y:S}=this.getBoundingClientRectCenter();if(i<Math.abs(c-r)+Math.abs(y-u)||i<Math.abs(l-o)+Math.abs(S-m)){const w=Math.atan2(s,e),v={x:0,y:0},x=Qt(-w,e,s),b=Qt(-w,this.vx,this.vy),P=Qt(-w,t.vx,t.vy),C=b.x-P.x;b.x=((this.mass-t.mass)*b.x+2*t.mass*P.x)/(this.mass+t.mass),P.x=C+b.x;const D=Math.abs(b.x)+Math.abs(P.x),B=this.ballRadius+t.ballRadius-Math.abs(v.x-x.x);v.x+=b.x/D*B,x.x+=P.x/D*B;const Y=Qt(w,v.x,v.y),V=Qt(w,x.x,x.y);t.moveTo(this.x+V.x,this.y+V.y),this.moveTo(this.x+Y.x,this.y+Y.y);const G=Qt(w,b.x,b.y),J=Qt(w,P.x,P.y);this.vx=G.x,this.vy=G.y,t.vx=J.x,t.vy=J.y}}checkWall(t){if(!t?.wall)return;const e=typeof t.wall.bounce=="number"?t.wall.bounce:-1,s=t.wall.x,i=t.wall.y,r=t.wall.x+t.wall.width,o=t.wall.y+t.wall.height,{x:a,y:h,width:c,height:l}=this.getBoundingClientRect();t.wall.cycle||!1?(this.x+a>r?this.moveXTo(s-(a+c)):this.x+a+c<s&&this.moveXTo(r-a),this.y+h>o?this.moveYTo(i-(h+l)):this.y+h+l<i&&this.moveYTo(o-h)):(this.x+a+c>r?(this.moveXTo(r-(a+c)),this.vx*=e):this.x+a<s&&(this.moveXTo(s+(a+c)),this.vx*=e),this.y+h+l>o?(this.moveYTo(o-(h+l)),this.vy*=e):this.y+h<i&&(this.moveYTo(i+(h+l)),this.vy*=e))}getTotalLength(){return this.transformPathD().getTotalLength()}getPointAtLength(t){return this.transformPathD().getPointAtLength(t)}interpolate(t){return this.transformPathD().interpolate(t)}trailPath(t=0,e=1){const s=this.getTotalLength(),i=t*s,r=e*s;return{subPathD:this.transformPathD().getSubPathD(i,r),point:this.getPointAtLength(r)}}strokeDashTween(t=1e3,e){const s=this.pathD().getTotalLength();this.setAttr({strokeDasharray:`${s} ${s}`,strokeDashoffset:`${s}`});const i=e?.onUpdate,r=new $s({frameDuration:t});r.addTween({offset:s},{offset:0},Object.assign(e||{},{onUpdate:(o,a)=>{this.setAttr("strokeDashoffset",""+F(o.offset,2)),i?.(o,a)}})),r.play()}static generateRosetta(t,e,s,i,r){if(r==0)throw new Error("no dividing by zero, please");const o=[],a=360/r;for(let h=0;h<r;h+=1){const c=a*h*Math.PI/180,l=t+2*s*Math.cos(c),u=e+2*s*Math.sin(c);o.push(new vo({x:t,y:e,rx:s,ry:i,xAxisRotate:a*h,largeArcFlag:1,sweepFlag:1,toX:l,toY:u})),o.push(new vo({x:l,y:u,rx:s,ry:i,xAxisRotate:a*h,largeArcFlag:1,sweepFlag:1,toX:t,toY:e}))}return new K({initD:Et.fromLines(o)})}}class Lt{shapes=[];svg;forceWidth;attrs={};style={};initCenterX;initCenterY;x;y;degree;scaleX;scaleY;interactive;drag;constructor(t){if(this.initCenterX=t?.centerX,this.initCenterY=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),t?.attrs&&this.setAttr(t.attrs),t?.style&&this.setStyle(t.style),this.interactive=typeof t?.interactive=="boolean"?t?.interactive:!0,this.drag=t?.drag,this.svg=t?.svg,this.forceWidth=t?.forceWidth,t?.svg){this.initCenterX=0,this.initCenterY=0;let e=0,s=0,i=0,r=0;const o=new B1(t.svg).parse();for(let a=0,h=o.length;a<h;a++){const c=o[a];if(c.type=="viewbox"&&c.width&&c.height){if(e=parseFloat(c.width),s=parseFloat(c.height),t.forceWidth){const p=e/s;i=t.forceWidth,r=i/p}else i=e,r=s;continue}if(c.type!="path"||!Bl(c.path))continue;const l={};for(const p in c)p==="type"||p==="path"||p==="transform"||(l[p]=c[p]);const u=Fl(Nl(c.path)),m=[];let f=[];for(let p=0,y=u.length;p<y;p++){const S=u[p];f.push(S),S[0].toLowerCase()=="z"&&(m.push(f),f=[])}f.length&&m.push(f),m.forEach(p=>{const y=new K({attrs:l,initD:p});if(c.transform){const w=Qr(c.transform).split();y.moveTo(w.x,w.y),y.rotateTo(w.degree),y.scaleTo(w.scaleX,w.scaleY)}this.addShape(y)})}i&&e&&r&&s&&this.comboScale(i/e,r/s,!0)}}destroy(){this.shapes.forEach(t=>t.destroy())}getBaseOptions(){return{svg:this.svg,forceWidth:this.forceWidth,attrs:{...this.attrs},style:{...this.style},centerX:this.initCenterX,centerY:this.initCenterY,x:this.x,y:this.y,degree:this.degree,scaleX:this.scaleX,scaleY:this.scaleY,interactive:this.interactive,drag:{...this.drag}}}clone(){const t=this.cloneShapeCombo();return t.shapes=this.shapes.map(e=>{const s=e.clone();return e.parent&&(s.parent={...e.parent,combo:t}),s}),t}cloneShapeCombo(){return new Lt(this.getBaseOptions())}update(t){this.shapes.forEach(e=>e.update(t))}addShape(t,e){e?.notCopyFromCombo!==!0&&(t.setAttr(this.attrs),t.setStyle(this.style),t.interactive=t.interactive||this.interactive,t.drag={...this.drag,...t.drag}),t.parent={combo:this,dX:e?.dX||0,dY:e?.dY||0,dDegree:e?.dDegree||0,dScaleX:e?.dScaleX||1,dScaleY:e?.dScaleY||1},this.shapes.push(t)}comboMove(t,e,s=!1){s||(this.x+=t,this.y+=e),this.shapes.forEach(i=>{i.move(t,e)})}comboRotate(t,e=!1){e||(this.degree+=t),this.shapes.forEach(s=>{s.rotate(t)})}comboScale(t,e,s=!1){s||(this.scaleX*=t,this.scaleY*=e||t),this.shapes.forEach(i=>{i.scale(t,e)})}comboTransform(t,e=!1){(typeof t?.x=="number"||typeof t?.y=="number")&&this.comboMove(t?.x||0,t?.y||0,e),typeof t?.degree=="number"&&this.comboRotate(t?.degree||0,e),(typeof t?.scale=="number"||typeof t?.scaleX=="number"||typeof t?.scaleY=="number")&&this.comboScale(t?.scaleX||t?.scale||1,t?.scaleY||t?.scale||1,e)}getBoundingClientRect(t=2){const e=[],s=[];if(this.shapes.forEach(h=>{const c=h.getBoundingClientRect(t);e.push(c.x,c.x+c.width),s.push(c.y,c.y+c.height)}),e.length==0||s.length==0)return{x:0,y:0,width:0,height:0};const i=Math.min(...e),r=Math.min(...s),o=Math.max(...e),a=Math.max(...s);return{x:F(i,t),y:F(r,t),width:F(o-i,t),height:F(a-r,t)}}getBoundingClientRectCenter(t=2){if(typeof this.initCenterX=="number"&&typeof this.initCenterY=="number")return{x:this.initCenterX,y:this.initCenterY};const e=this.getBoundingClientRect(t);return{x:F(e.x+e.width*.5,t),y:F(e.y+e.height*.5,t)}}setStyle(t){Object.assign(this.style,t),this.shapes.forEach(e=>{e.setStyle(t)})}setAttr(t,e){if(typeof t!="string"){for(const s in t){const i=t[s];i&&i!=this.getAttr(s)&&(this.attrs[lt(s)]=i)}this.shapes.forEach(s=>{s.setAttr(t)})}else e&&e!=this.getAttr(t)&&(this.attrs[lt(t)]=e,this.shapes.forEach(s=>{s.setAttr(t,e)}))}getAttr(t,e){return this.attrs[t]||this.attrs[lt(t)]||e}hasAttr(t){return!!this.getAttr(t)}sort(){this.shapes.map(t=>({shape:t,perimeter:t.transformPathD().getPolymorphPointsPerimeter()})).sort((t,e)=>e.perimeter-t.perimeter).map(t=>t.shape)}expendTo(t){const e=t.shapes.length,s=this.shapes.length;if(e<s)return t.expendTo(this);for(let i=s;i<e;i++){const r=t.shapes[i];this.addShape(new K({initD:r.pathD().clone()}),{dX:r.x-this.x,dY:r.y-this.y,dDegree:r.degree-this.degree,dScaleX:r.scaleX/this.scaleX,dScaleY:r.scaleY/this.scaleY,notCopyFromCombo:!0})}}strokeDashTween(t,e){switch(e?.type){case"sequence":this.shapes.forEach((o,a)=>{o.strokeDashTween(t,{...e,delay:a,onStart:()=>{a==0&&e?.onGroupStart?.()},onUpdate:()=>{e?.onGroupUpdate?.()},onComplete:()=>{a==this.shapes.length-1&&e?.onGroupComplete?.()}})});break;case"parallel":default:const s=new $s({frameDuration:t}),i={},r={};this.shapes.forEach((o,a)=>{const h=o.pathD().getTotalLength();i[`offset_${a}`]=h,r[`offset_${a}`]=0,o.setAttr({strokeDasharray:`${h} ${h}`,strokeDashoffset:`${h}`})}),s.addTween(i,r,Object.assign(e||{},{onStart:()=>{e?.onGroupStart?.()},onUpdate:(o,a)=>{for(const h in o){const c=Di(h).number;this.shapes[c].setAttr("strokeDashoffset",""+F(o[h],2))}e?.onGroupUpdate?.()},onComplete:()=>{e?.onGroupComplete?.()}})),s.play();break}}}function X1(n,t,e=5){(!As(n.x,t.current.x,e)||!As(n.y,t.current.y,e))&&n.followTo(t.current)}function U1(n,t,e){n.drag&&n.drag.enable&&!n.isDragging&&n.animateEaseTo(t,e)}function $1(n,t){const e=[],s=n.length;for(let i=0;i<s;i++){const r=n[i];if(t?.springLength){const o=t?.springLength||100;r.isDragging||n.filter(a=>a.id!==r.id).forEach(a=>{const h=zt(r.x,r.y,a.x,a.y);r.animateSpringTo({x:a.x-Math.cos(h)*o,y:a.y-Math.sin(h)*o},t)})}else t?.spring?i>0&&r.animateSpringTo(n[i-1],t):r.animate(t);if(t?.wall&&r.checkWall(t),t?.enableCollision||t?.enableGravityBetweenObjects||t?.enableSpringMassAlpha)for(let o=i+1;o<s;o++)t?.enableCollision&&r.checkCollision(n[o]),t?.enableGravityBetweenObjects&&r.gravitateTo(n[o]),t?.enableSpringMassAlpha&&e.push([r.x,r.y,n[o].x,n[o].y,r.getSpringMassAlphaTo(n[o],t)])}return e}function Vl(n){if(n.length<2)throw new Error("shapes个数必须大于等于2");const t=n.length-1,e=new Array(t);for(let i=0;i<t;i++){const r=n[i].transformPathD(),o=n[i+1].transformPathD(),a=r.getPolymorphPoints(),h=o.getPolymorphPoints(),c=a.length>=h.length?a:h;e[i]=Et.getInterpolator(r.expendToPolymorphPoints(c),o.expendToPolymorphPoints(c))}const s=new K({initD:""});return i=>{const r=F(t*i,6),o=Math.min(Math.floor(r),t-1),a=F(r-o,6);return s.pathD(e[o](a)),s.setAttr(n[o+1].attrs),s}}function V1(n){if(n.length<2)throw new Error("shapeCombos个数必须大于等于2");let t;const e=[];n.forEach(o=>{let a;o instanceof Lt?(a=o,a.sort()):(a=new Lt,a.addShape(o)),e.push(a),(!t||t.shapes.length<a.shapes.length)&&(t=a)});const s=[];e.forEach((o,a)=>{o!==t&&o.expendTo(t),o.shapes.forEach((h,c)=>{s[c]=s[c]||[],s[c][a]=h})});const i=[];s.forEach(o=>{i.push(Vl(o))});const r=new Lt;return i.forEach(o=>{r.addShape(o(0))}),o=>(i.forEach(a=>{a(o)}),r)}function G1(n,t=6e3,e){const s=n.findIndex(a=>a instanceof Lt)>=0?V1(n):Vl(n),i=s(0),r=e?.onUpdate,o=new $s({frameDuration:t});return o.addTween({t:0},{t:1},Object.assign(e||{},{onUpdate:(a,h)=>{r?.(a,h),s(a.t),e?.shapeOrCombo?.(i,a.t)}})),o.play(),i}const an={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 Yt{_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 s;if(s=/^(\w+)\(([^)]*)\)/.exec(t)){const i=s[2];let r;switch(s[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(s=/#([A-Fa-f0-9]+)/.exec(t)){const i=s[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 Yt?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(jt(t)),0,255)}catch{}}get g(){return this._color.g}set g(t){try{this._color.g=N(Math.round(jt(t)),0,255)}catch{}}get b(){return this._color.b}set b(t){try{this._color.b=N(Math.round(jt(t)),0,255)}catch{}}get a(){return this._color.a}set a(t){try{this._color.a=N(jt(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,s=this.g,i=this.b,r=t.value;return this.r=r[0]*e+r[3]*s+r[6]*i,this.g=r[1]*e+r[4]*s+r[7]*i,this.b=r[2]*e+r[5]*s+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},${F(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=Qe){Lo.fromWorkingColorSpace(xe.copy(this),t);const e=xe.r,s=xe.g,i=xe.b;return t!==Qe?`color(${t} ${e.toFixed(3)} ${s.toFixed(3)} ${i.toFixed(3)})`:this.toRGBString()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b,yield this.a}clone(){return new Yt(this.color)}copy(t){return this.setColor(t.color),this}copySRGBToLinear(t){return this.r=Ke(t.r),this.g=Ke(t.g),this.b=Ke(t.b),this}copyLinearToSRGB(t){return this.r=ts(t.r),this.g=ts(t.g),this.b=ts(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",s="#ffffff"){if(t)return this.setColor(this.r*.299+this.g*.587+this.b*.114>186?e:s);{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:s,b:i}=this.color;return this.r=e+(255-e)*t,this.g=s+(255-s)*t,this.b=i+(255-i)*t,this}darken(t){t=N(t,0,1);const{r:e,g:s,b:i}=this.color;return this.r=e*(1-t),this.g=s*(1-t),this.b=i*(1-t),this}lerp(t,e){e=N(e,0,1);const{r:s,g:i,b:r}=this.color;return this.r=s+(t.r-s)*e,this.g=i+(t.g-i)*e,this.b=r+(t.b-r)*e,this}lerpColors(t,e,s){return s=N(s,0,1),this.r=t.r+(e.r-t.r)*s,this.g=t.g+(e.g-t.g)*s,this.b=t.b+(e.b-t.b)*s,this}static gradient(t,e,s){try{return xe.lerpColors(new Yt(t),new Yt(e),s).toString()}catch{return e}}static random(){return xe.setHEX(Math.random()*16777215).toString()}static nextIndex=0;static next(t=Yt.nextIndex){Yt.nextIndex=t;const e=Object.keys(an),s=e.length;return xe.setHEX(an[e[Yt.nextIndex++%s]]).toString()}setColorName(t){const e=an[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(an).map(t=>xe.setHEX(t).toString())}setRGB(t,e,s,i=1){return this.r=t,this.g=e,this.b=s,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,s,i=1){const r=ff(t,1),o=N(e,0,1),a=N(s,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=Ro(c,h,r+.3333333333333333)*255,this.g=Ro(c,h,r)*255,this.b=Ro(c,h,r-.3333333333333333)*255}return this.a=i,this}getHSL(t){const e=this.r,s=this.g,i=this.b,r=Math.max(e,s,i)/255,o=Math.min(e,s,i)/255;let a,h;const c=(o+r)/2;if(o===r)a=0,h=0;else{const l=r-o;switch(h=c<=.5?l/(r+o):l/(2-r-o),r){case e:a=(s-i)/l+(s<i?6:0);break;case s:a=(i-e)/l+2;break;case i:default:a=(e-s)/l+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,s){const i=this.getHSL();return this.setHSL(i.h+t,i.s+e,i.l+s)}lerpHSL(t,e){const s=this.getHSL(),i=t.getHSL(),r=xn(s.h,i.h,e),o=xn(s.s,i.s,e),a=xn(s.l,i.l,e);return this.setHSL(r,o,a),this}setHSV(t,e,s,i=1){const r=N(t,0,1)*360,o=N(e,0,1),a=N(s,0,1),h=Math.floor(r/60)%6,c=r/60-Math.floor(r/60),l=a*(1-o),u=a*(1-c*o),m=a*(1-(1-c)*o),f=[[a,m,l],[u,a,l],[l,a,m],[l,u,a],[m,l,a],[a,l,u]][h];return this.r=f[0]*255,this.g=f[1]*255,this.b=f[2]*255,this.a=i,this}setHSB(t,e,s,i=1){this.setHSV(t,e,s,i)}getHSV(t){const{r:e,g:s,b:i,a:r}=this.color,o=Math.max(e,s,i),a=Math.min(e,s,i),h=o-a;let c;e===o?c=(s-i)/h:s===o?c=2+(i-e)/h:c=4+(e-s)/h,c/=6,c<0&&(c+=1);const l=h==0?0:c,u=o===0?0:h/o,m=o/255;return t&&t.setHSV(l,u,m,r),{h:l,s:u,v:m,a:r}}getHSB(t){const{h:e,s,v:i,a:r}=this.getHSV(t);return{h:e,s,b:i,a:r}}}const xe=new Yt,Gl="",Qe="srgb",ko="srgb-linear",Do="linear",ri="srgb";function Ke(n){return n<.04045?n*.0773993808:Math.pow(n*.9478672986+.0521327014,2.4)}function ts(n){return n<.0031308?n*12.92:1.055*Math.pow(n,.41666)-.055}const ql=new ps().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),jl=new ps().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715),Hl=[.64,.33,.3,.6,.15,.06],Wl=[.2126,.7152,.0722],Jl=[.3127,.329],Lo={enabled:!0,workingColorSpace:ko,spaces:{},convert:function(n,t,e){return this.enabled===!1||t===e||!t||!e||(this.spaces[t].transfer===ri&&(n.r=Ke(n.r),n.g=Ke(n.g),n.b=Ke(n.b)),this.spaces[t].primaries!==this.spaces[e].primaries&&(n.applyMatrix3(this.spaces[t].toXYZ),n.applyMatrix3(this.spaces[e].fromXYZ)),this.spaces[e].transfer===ri&&(n.r=ts(n.r),n.g=ts(n.g),n.b=ts(n.b))),n},fromWorkingColorSpace:function(n,t){return this.convert(n,this.workingColorSpace,t)},toWorkingColorSpace:function(n,t){return this.convert(n,t,this.workingColorSpace)},getPrimaries:function(n){return this.spaces[n].primaries},getTransfer:function(n){return n===Gl?Do:this.spaces[n].transfer},getLuminanceCoefficients:function(n,t=this.workingColorSpace){return n.fromArray(this.spaces[t].luminanceCoefficients)},define:function(n){Object.assign(this.spaces,n)},_getMatrix:function(n,t,e){return n.copy(this.spaces[t].toXYZ).multiply(this.spaces[e].fromXYZ)},_getDrawingBufferColorSpace:function(n){return this.spaces[n].outputColorSpaceConfig.drawingBufferColorSpace},_getUnpackColorSpace:function(n=this.workingColorSpace){return this.spaces[n].workingColorSpaceConfig.unpackColorSpace}};Lo.define({[ko]:{primaries:Hl,whitePoint:Jl,transfer:Do,toXYZ:ql,fromXYZ:jl,luminanceCoefficients:Wl,workingColorSpaceConfig:{unpackColorSpace:Qe},outputColorSpaceConfig:{drawingBufferColorSpace:Qe}},[Qe]:{primaries:Hl,whitePoint:Jl,transfer:ri,toXYZ:ql,fromXYZ:jl,luminanceCoefficients:Wl,outputColorSpaceConfig:{drawingBufferColorSpace:Qe}}});function Ro(n,t,e){return e<0&&(e+=1),e>1&&(e-=1),e<.16666666666666666?n+(t-n)*6*e:e<.5?t:e<.6666666666666666?n+(t-n)*6*(.6666666666666666-e):n}class q1{PARENT_EL;SVG_EL=null;CANVAS_EL=null;ctx=null;rect={x:0,y:0,width:0,height:0};size$=new Vh(null);resizeSubscription;mpg=Je();mouseSubscription;shapes=[];shapeTap$=new Vh(null);tapSubscription;lastMouseInShapeId="";draggingShapeId="";prevCursor="default";constructor(t=document.documentElement,e="canvas",s=!1){this.PARENT_EL=t,(e=="svg"||e=="canvas")&&el(this.PARENT_EL),e=="svg"&&(this.SVG_EL=Ze("svg"),bs(this.PARENT_EL,this.SVG_EL)),e=="canvas"&&(this.CANVAS_EL=rl("canvas"),bs(this.PARENT_EL,this.CANVAS_EL)),this.resizeSubscription=xo(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&&oe(this.SVG_EL,{viewBox:`0 0 ${this.rect.width} ${this.rect.height}`,width:`${this.rect.width}`,height:`${this.rect.height}`}),this.CANVAS_EL&&(oe(this.CANVAS_EL,{width:`${this.rect.width}`,height:`${this.rect.height}`}),this.ctx=new Io(this.CANVAS_EL,this.rect.width,this.rect.height,s)),this.size$.next(i)}),this.mouseSubscription=Cl(this.SVG_EL||this.CANVAS_EL||this.PARENT_EL,{useMousePoint:this.mpg}).subscribe(()=>{}),this.tapSubscription=ml(this.PARENT_EL).subscribe(i=>{for(const r of this.shapes)if(r.isMouseIn){this.shapeTap$.next(r);break}})}destroy(){this.resizeSubscription.unsubscribe(),this.mouseSubscription.unsubscribe(),this.tapSubscription.unsubscribe()}setCursor(t="default"){t!=this.prevCursor&&(this.PARENT_EL.style.cursor=t,this.prevCursor=t)}draw(...t){if(t.length){const e=[];t.forEach(s=>{s instanceof Lt?e.push(...s.shapes):e.push(s)}),this.SVG_EL&&this.shapes.filter(s=>e.findIndex(i=>i.id==s.id)==-1).forEach(s=>{s.el&&(s.el.remove(),delete s.el)}),hf(this.shapes,e)}this.ctx&&this.ctx.clearRect(),this.lastMouseInShapeId="",this.mpg.current.isDown||(this.draggingShapeId="");for(const e of this.shapes){const{x:s,y:i}=e.transformOrigin();let r=0,o=0;if(e.parent?.dDegree||e.parent?.dScaleX!==1||e.parent?.dScaleY!==1){const a=e.transformOrigin(!0);r=a.x,o=a.y}if(e.shouldUpdatePathD&&e.pathD(),this.SVG_EL){if(!e.el||e.shouldUpdateSVGElInDraw){const a=e.toSVGEl();e.el?a&&(e.el.remove(),e.el=a,bs(this.SVG_EL,e.el),oe(e.el,{id:e.id})):(e.el=a||zl(),bs(this.SVG_EL,e.el),oe(e.el,{id:e.id})),L1(e.el)&&oe(e.el,{d:e.toSVGPathD()}),e.shouldUpdateSVGElInDraw=!1,e.shouldUpdateAttrsInDraw=!0,e.shouldUpdateStyleInDraw=!0,e.shouldUpdateMInDraw=!0}if(e.shouldUpdateAttrsInDraw&&(Ta(e.attrs)||oe(e.el,e.attrs),e.shouldUpdateAttrsInDraw=!1),e.shouldUpdateStyleInDraw&&(Ta(e.style)||ys(e.el,e.style),e.shouldUpdateStyleInDraw=!1),e.shouldUpdateMInDraw||!e.m){const a=new wt;a.translate(e.x+(e.parent?.dX||0),e.y+(e.parent?.dY||0)),a.rotate(e.degree,s,i),a.scale(e.scaleX,e.scaleY,s,i),e.parent?.dDegree&&a.rotate(e.parent.dDegree,r,o),(e.parent?.dScaleX!==1||e.parent?.dScaleY!==1)&&a.scale(e.parent?.dScaleX||1,e.parent?.dScaleY||1,r,o),oe(e.el,{transform:a.toString()}),e.m=a,e.shouldUpdateMInDraw=!1}}if(this.ctx&&(this.ctx.save(),this.ctx.translate(e.x+(e.parent?.dX||0),e.y+(e.parent?.dY||0)),this.ctx.rotate(q(e.degree),s,i),this.ctx.scale(e.scaleX,e.scaleY,s,i),e.parent?.dDegree&&this.ctx.rotate(q(e.parent.dDegree),r,o),(e.parent?.dScaleX!==1||e.parent?.dScaleY!==1)&&this.ctx.scale(e.parent?.dScaleX||1,e.parent?.dScaleY||1,r,o),e.m=this.ctx.currentMatrix,Bc(this.ctx,e.attrs),e.toCanvasContext(this.ctx),this.ctx.hasSetCustomStrokeStyle&&this.ctx.stroke(),this.ctx.hasSetCustomFillStyle&&this.ctx.fill()),e.interactive?this.SVG_EL?e.isMouseIn=e.isPointInPath(this.SVG_EL,this.mpg.current.x,this.mpg.current.y)||e.isPointInStroke(this.SVG_EL,this.mpg.current.x,this.mpg.current.y):this.ctx?e.isMouseIn=e.isPointInPath(this.ctx,this.mpg.current.x,this.mpg.current.y)||e.isPointInStroke(this.ctx,this.mpg.current.x,this.mpg.current.y):e.isMouseIn=!1:e.isMouseIn=!1,e.isMouseIn&&(this.setCursor("pointer"),this.lastMouseInShapeId=e.id),e.isDragging=e.id==this.draggingShapeId,this.mpg.current.isDown&&(e.isDragging||!this.draggingShapeId&&e.isMouseIn&&e.drag&&e.drag.enable)){this.setCursor("grabbing"),e.isDragging=!0,this.draggingShapeId=e.id;let a=this.mpg.current.x-this.mpg.start.x,h=this.mpg.current.y-this.mpg.start.y;if(a||h){if(e.drag&&e.drag.enable&&e.drag.alongPath){const c=e.drag.alongPath.transform({m:e.m}).closestPoint(this.mpg.current.x,this.mpg.current.y);a=c.point.x-e.x,h=c.point.y-e.y}(a||h)&&(e.move(a,h),e.parent?.combo.shapes.forEach(c=>{c.drag?.followSibling&&c!==e&&c.move(a,h)}))}this.mpg.setStart(this.mpg.current)}else e.isMouseIn&&e.drag&&e.drag.enable&&this.setCursor("grab");this.ctx&&this.ctx.restore()}!this.lastMouseInShapeId&&!this.draggingShapeId&&this.setCursor("default")}clear(){this.shapes.forEach(t=>{t.el&&(t.el.remove(),delete t.el)}),this.shapes=[]}drawMouseMoveLine(t){const e=t?.brushSize||4,s=t?.brushColor||"#000000";let i=!1;const r=ei(this.SVG_EL||this.CANVAS_EL||this.PARENT_EL,{start:()=>{i=!1,this.ctx&&(this.ctx.save(),this.ctx.lineWidth=e,this.ctx.strokeStyle=s,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,s=t?.brushDensity||50,i=t?.brushColor||"#000000",r=new Yt(i),o=r.r,a=r.g,h=r.b,c=ei(this.SVG_EL||this.CANVAS_EL||this.PARENT_EL).subscribe(l=>{if(this.ctx){const u=this.ctx.getImageData(0,0,this.ctx.canvas.width,this.ctx.canvas.height),m=u.data;for(let f=0;f<s;f++){const p=Math.random()*Math.PI*2,y=Math.random()*e,S=l.current.x+Math.cos(p)*y|0,w=l.current.y+Math.sin(p)*y|0,v=(S+w*u.width)*4;m[v]=o,m[v+1]=a,m[v+2]=h,m[v+3]=255}this.ctx.putImageData(u)}});return()=>{c.unsubscribe()}}downloadSVG=()=>{this.SVG_EL&&R1(this.SVG_EL)}}class es extends K{lineLength;startColor;endColor;constructor(t){super({...t,centerX:0,centerY:0}),this.lineLength=t?.lineLength||0,this.startColor=t?.startColor,this.endColor=t?.endColor,this.setAttr({strokeWidth:this.getAttr("strokeWidth")||"1",stroke:this.startColor||this.getAttr("stroke")||"#000000"})}cloneShape(){return new es({...super.getBaseOptions(),lineLength:this.lineLength,startColor:this.startColor,endColor:this.endColor})}lineToAbsolutePoint(t){const e=mt(zt(this.x,this.y,t.x,t.y)),s=Ae(this.x,this.y,t.x,t.y);(e!=this.degree||s!=this.lineLength)&&(e!=this.degree&&this.rotateTo(e),s!=this.lineLength&&(this.lineLength=s),this.shouldUpdatePathD=!0)}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})}getBoundingClientRect(){return{x:0,y:0,width:this.lineLength,height:parseFloat(this.getAttr("strokeWidth"))}}toSVGPathData(){return[["m",0,0],["l",this.lineLength,0]]}toCanvasContext(t){this.startColor&&this.endColor&&this.setAttr({stroke:t.createLinearGradient(0,0,this.lineLength,0,{0:this.startColor,1:this.endColor})}),t.beginPath(),t.moveTo(0,0),t.lineTo(this.lineLength,0)}intersection(t){const e=this.transformPathD().normalizedLines[0],s=t.transformPathD().normalizedLines[0];return e.intersection(s)}}class Oo extends K{cx;cy;toX;toY;isLineThrough;constructor(t){super(t),this.cx=t?.cx||0,this.cy=t?.cy||0,this.toX=t?.toX||0,this.toY=t?.toY||0,this.isLineThrough=typeof t?.isLineThrough=="boolean"?t.isLineThrough:!1,this.setAttr({strokeWidth:this.getAttr("strokeWidth")||"1",stroke:this.getAttr("stroke")||"#000000"})}cloneShape(){return new Oo({...super.getBaseOptions(),cx:this.cx,cy:this.cy,toX:this.toX,toY:this.toY,isLineThrough:this.isLineThrough})}update(t){typeof t.cx=="number"&&(this.cx=t.cx,this.shouldUpdatePathD=!0),typeof t.cy=="number"&&(this.cy=t.cy,this.shouldUpdatePathD=!0),typeof t.toX=="number"&&(this.toX=t.toX,this.shouldUpdatePathD=!0),typeof t.toY=="number"&&(this.toY=t.toY,this.shouldUpdatePathD=!0),typeof t.isLineThrough=="boolean"&&(this.isLineThrough=t.isLineThrough,this.shouldUpdatePathD=!0)}toSVGPathData(){if(this.isLineThrough){const t=this.cx*2-(0+this.toX)/2,e=this.cy*2-(0+this.toY)/2;return[["m",0,0],["q",t,e,this.toX,this.toY]]}else return[["m",0,0],["q",this.cx,this.cy,this.toX,this.toY]]}toCanvasContext(t){if(t.beginPath(),t.moveTo(0,0),this.isLineThrough){const e=this.cx*2-(0+this.toX)/2,s=this.cy*2-(0+this.toY)/2;t.quadraticCurveTo(e,s,this.toX,this.toY)}else t.quadraticCurveTo(this.cx,this.cy,this.toX,this.toY)}}class oi extends K{points;isStraight;constructor(t){super(t),this.points=t?.points||[],this.isStraight=typeof t?.isStraight=="boolean"?t.isStraight:!0,this.setAttr({strokeWidth:this.getAttr("strokeWidth")||"1",stroke:this.getAttr("stroke")||"#000000"})}cloneShape(){return new oi({...super.getBaseOptions(),points:[...this.points],isStraight:this.isStraight})}update(t){"points"in t&&(this.points=[...t.points||this.points],this.shouldUpdatePathD=!0),typeof t.isStraight=="boolean"&&(this.isStraight=t.isStraight,this.shouldUpdatePathD=!0)}toSVGPathData(){const t=[];if(this.points.length<3)return t;const e=this.points.length;if(this.isStraight){t.push(["m",this.points[0].x,this.points[0].y]);for(let s=1;s<=e-1;s++)t.push(["l",this.points[s].x-this.points[s-1].x,this.points[s].y-this.points[s-1].y]);t.push(["z"])}else{const s=(this.points[0].x+this.points[e-1].x)/2,i=(this.points[0].y+this.points[e-1].y)/2;let r=s,o=i;t.push(["m",r,o]);for(let a=0;a<e-1;a++){const h=(this.points[a].x+this.points[a+1].x)/2,c=(this.points[a].y+this.points[a+1].y)/2;t.push(["q",this.points[a].x-r,this.points[a].y-o,h-r,c-o]),r=h,o=c}t.push(["q",this.points[e-1].x-r,this.points[e-1].y-o,s-r,i-o])}return t}toCanvasContext(t){if(this.points.length<3)return;t.beginPath();const e=this.points.length;if(this.isStraight){t.moveTo(this.points[0].x,this.points[0].y);for(let s=1;s<=e-1;s++)t.lineTo(this.points[s].x,this.points[s].y);t.closePath()}else{const s=(this.points[0].x+this.points[e-1].x)/2,i=(this.points[0].y+this.points[e-1].y)/2;t.moveTo(s,i);for(let r=0;r<e-1;r++){const o=(this.points[r].x+this.points[r+1].x)/2,a=(this.points[r].y+this.points[r+1].y)/2;t.quadraticCurveTo(this.points[r].x,this.points[r].y,o,a)}t.quadraticCurveTo(this.points[e-1].x,this.points[e-1].y,s,i)}}isPointInShape(t){const e=this.points.length;let s=!1;const i=2e-10;for(let r=0,o=e-1;r<e;o=r,r++){const a=this.points[r].x,h=this.points[r].y,c=this.points[o].x,l=this.points[o].y;if(a===t.x&&h===t.y||c===t.x&&l===t.y||t.y===h&&t.y===l)return!0;if(t.y>=h&&t.y<l||t.y<h&&t.y>=l){const u=(c-a)/(l-h),m=a+u*(t.y-h);if(m===t.x||Math.abs(m-t.x)<i)return!0;m>t.x&&(s=!s)}}return s}[Symbol.iterator](){let t=-1;return{next:()=>({value:t<=this.points.length-1?this.points[++t]:void 0,done:t>=this.points.length})}}static generate(t,e,s,i){const r=[];for(let o=0;o<i;o++){const a=o/i*2*Math.PI,{dx:h,dy:c}=Ie(a,s);r.push({x:t+h,y:e+c})}return new oi({points:r})}}class zo extends Lt{length=100;constructor(t){super(t);const e=new es({drag:{followSibling:!0},lineLength:this.length});this.addShape(e);const s=new es({drag:{followSibling:!0},lineLength:20+Math.random()*20});this.addShape(s,{dX:90-Math.random()*40,dDegree:Math.random()*70});const i=new es({drag:{followSibling:!0},lineLength:20+Math.random()*20});this.addShape(i,{dX:90-Math.random()*40,dDegree:-Math.random()*70}),this.comboRotate(-90,!0)}cloneShapeCombo(){return new zo(super.getBaseOptions())}}class vs extends K{ballRadius;constructor(t){super(t),this.ballRadius=t?.ballRadius||0}cloneShape(){return new vs({...super.getBaseOptions(),ballRadius:this.ballRadius})}update(t){typeof t.ballRadius=="number"&&(this.ballRadius=t.ballRadius,this.shouldUpdatePathD=!0)}getBoundingClientRect(){return{x:-this.ballRadius,y:-this.ballRadius,width:this.ballRadius*2,height:this.ballRadius*2}}toSVGEl(){const t=Ze("circle");return this.setAttr({cx:"0",cy:"0",r:String(this.ballRadius)}),t}toSVGPathData(){return this.ballRadius?[["m",0,-this.ballRadius],["a",this.ballRadius,this.ballRadius,0,1,1,0,2*this.ballRadius],["a",this.ballRadius,this.ballRadius,0,1,1,0,-2*this.ballRadius],["z"]]:[["m",0,0]]}toCanvasContext(t){t.beginPath(),t.arc(0,0,this.ballRadius,0,Math.PI*2,!0),t.closePath()}eq(t){return this.x===t.x&&this.y===t.y&&this.ballRadius===t.ballRadius&&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 ms(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 s=t/e;this.scalar(s)}return this}clamp(t){const e=this.length();return e&&e>t&&this.scalar(t/e),this}cross(t){const e=this.x,s=this.y;return{x:s*t.x-e*t.y,y:e*t.y-s*t.x}}multiply(t){return{x:this.x*t.x,y:this.y*t.y}}div(t){return{x:this.x/t.x,y:this.y/t.y}}add(t){return{x:this.x+t.x,y:this.y+t.y}}sub(t){return{x:this.x-t.x,y:this.y-t.y}}dot(t){return this.x*t.x+this.y*t.y}reflect(t){const e=this.dot(t);return{x:this.x-2*e*t.x,y:this.y-2*e*t.y}}}class Bo extends K{constructor(t){super(t)}cloneShape(){return new Bo({...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 Oe extends K{rectWidth;rectHeight;rectBorderRadius;constructor(t){super(t),this.rectWidth=t.rectWidth||0,this.rectHeight=t.rectHeight||0,this.rectBorderRadius=t.rectBorderRadius||0}cloneShape(){return new Oe({...super.getBaseOptions(),rectWidth:this.rectWidth,rectHeight:this.rectHeight,rectBorderRadius:this.rectBorderRadius})}update(t){typeof t.rectWidth=="number"&&(this.rectWidth=t.rectWidth,this.shouldUpdatePathD=!0),typeof t.rectHeight=="number"&&(this.rectHeight=t.rectHeight,this.shouldUpdatePathD=!0),typeof t.rectBorderRadius=="number"&&(this.rectBorderRadius=t.rectBorderRadius,this.shouldUpdatePathD=!0)}getBoundingClientRect(){return{x:0,y:0,width:this.rectWidth,height:this.rectHeight}}toSVGEl(){const t=Ze("rect");return this.setAttr({x:"0",y:"0",width:String(this.rectWidth),height:String(this.rectHeight),rx:String(this.rectBorderRadius),ry:String(this.rectBorderRadius)}),t}toSVGPathData(){return this.rectBorderRadius?[["m",this.rectBorderRadius,0],["l",this.rectWidth-this.rectBorderRadius*2,0],["a",this.rectBorderRadius,this.rectBorderRadius,0,0,1,this.rectBorderRadius,this.rectBorderRadius],["l",0,this.rectHeight-this.rectBorderRadius*2],["a",this.rectBorderRadius,this.rectBorderRadius,0,0,1,-this.rectBorderRadius,this.rectBorderRadius],["l",this.rectBorderRadius*2-this.rectWidth,0],["a",this.rectBorderRadius,this.rectBorderRadius,0,0,1,-this.rectBorderRadius,-this.rectBorderRadius],["l",0,this.rectBorderRadius*2-this.rectHeight],["a",this.rectBorderRadius,this.rectBorderRadius,0,0,1,this.rectBorderRadius,-this.rectBorderRadius],["z"]]:[["m",0,0],["l",this.rectWidth,0],["l",0,this.rectHeight],["l",-this.rectWidth,0],["z"]]}toCanvasContext(t){t.beginPath(),this.rectBorderRadius<=0?t.rect(0,0,this.rectWidth,this.rectHeight):(t.moveTo(0,this.rectBorderRadius),t.lineTo(0,this.rectHeight-this.rectBorderRadius),t.quadraticCurveTo(0,this.rectHeight,this.rectBorderRadius,this.rectHeight),t.lineTo(this.rectWidth-this.rectBorderRadius,this.rectHeight),t.quadraticCurveTo(this.rectWidth,this.rectHeight,this.rectWidth,this.rectHeight-this.rectBorderRadius),t.lineTo(this.rectWidth,this.rectBorderRadius),t.quadraticCurveTo(this.rectWidth,0,this.rectWidth-this.rectBorderRadius,0),t.lineTo(this.rectBorderRadius,0),t.quadraticCurveTo(0,0,0,this.rectBorderRadius)),t.closePath()}static fromCubicBezier(t,e,s,i,r,o,a,h){const l=new xt({x:t,y:e,c1x:s,c1y:i,c2x:r,c2y:o,toX:a,toY:h}).getBoundingClientRect();return new Oe({x:l.x,y:l.y,rectWidth:l.width,rectHeight:l.height})}eq(t){return this.x===t.x&&this.y===t.y&&this.rectWidth===t.rectWidth&&this.rectHeight===t.rectHeight&&this.rectBorderRadius===t.rectBorderRadius}intersection(t){return!(this.x+this.rectWidth<t.x||t.x+t.rectWidth<this.x||this.y+this.rectHeight<t.y||t.y+t.rectHeight<this.y)}isPointInShape(t){return t.x>=this.x&&t.x<=this.x+this.rectWidth&&t.y>=this.y&&t.y<=this.y+this.rectHeight}}class No extends K{rx;ry;constructor(t){super(t),this.rx=t?.heartRx||10,this.ry=t?.heartRy||10}cloneShape(){return new No({...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 Fo extends K{rx;ry;constructor(t){super(t),this.rx=t?.heartRx||50,this.ry=t?.heartRy||50}cloneShape(){return new Fo({...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 Yo extends K{r;constructor(t){super(t),this.r=t?.starR||20}cloneShape(){return new Yo({...super.getBaseOptions(),starR:this.r})}toSVGPathData(){const t=[["m",0,-this.r]];for(let e=0;e<6;e+=1){const s=288+e*144,i=this.r*Math.cos(q(s)),r=this.r*Math.sin(q(s));t.push(["l",i,r])}return t}}class Xo extends K{constructor(t){super(t)}cloneShape(){return new Xo({...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 Uo extends K{constructor(t){super(t)}cloneShape(){return new Uo({...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 $o extends K{constructor(t){super({...t,initD:"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 $o({...super.getBaseOptions()})}}class Vo extends K{rx;ry;constructor(t){super(t),this.rx=t?.rx||0,this.ry=t?.ry||0}cloneShape(){return new Vo({...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}}toSVGEl(){const t=Ze("ellipse");return this.setAttr({cx:"0",cy:"0",rx:String(this.rx),ry:String(this.ry)}),t}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 Go extends Lt{showFlame;flame;ship;constructor(t){super(t),this.showFlame=typeof t?.showFlame=="boolean"?t?.showFlame:!0,this.flame=new K({initD:[["M",-15,0],["L",-2.5,-5],["L",-2.5,5],["Z"]],drag:{followSibling:!0}}),this.showFlame&&this.addShape(this.flame),this.ship=new K({initD:[["M",10,0],["L",-10,10],["L",-5,0],["L",-10,-10],["L",10,0],["Z"]],drag:{followSibling:!0}}),this.addShape(this.ship)}cloneShapeCombo(){return new Go({...super.getBaseOptions(),showFlame:this.showFlame})}update(t){typeof t?.showFlame=="boolean"&&(this.shapes=[],this.showFlame=t?.showFlame,this.showFlame&&this.addShape(this.flame),this.addShape(this.ship))}}class qo extends Lt{width;height;cornerRadius;constructor(t){super(t),this.width=t.segmentWidth,this.height=t.segmentHeight,this.cornerRadius=typeof t.segmentCornerRadius=="number"?t.segmentCornerRadius:this.height*.5;const e=new Oe({drag:{followSibling:!0},rectWidth:this.width+this.cornerRadius*2,rectHeight:this.height,rectBorderRadius:this.cornerRadius});this.addShape(e,{dX:0-this.cornerRadius,dY:0-this.height*.5});const s=new vs({drag:{followSibling:!0},ballRadius:2});this.addShape(s);const i=new vs({drag:{followSibling:!0},ballRadius:2});this.addShape(i,{dX:0+this.width})}cloneShapeCombo(){return new qo({...super.getBaseOptions(),segmentWidth:this.width,segmentHeight:this.height,segmentCornerRadius:this.cornerRadius})}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 jo extends Lt{options;value$=new ds;subscription;constructor(t){super(t),this.options=t;const e=t?.sliderMin||0,s=t?.sliderMax||100,i=t?.sliderStep||1,r=mf(e,s,i),o=r(typeof t?.sliderDefaultValue=="number"?N(t.sliderDefaultValue,e,s):e);this.value$.next(o);const a=o/(s-e),h=t?.sliderWidth||100,c=t?.sliderHeight||4,l=c*.5,u=c*2.5,m=t?.sliderBackgroundColor||"#f5f5f5",f=t?.sliderForegroundColor||"#5a82f0",p=new Oe({rectWidth:h,rectHeight:c,rectBorderRadius:l,attrs:{fill:m},drag:{enable:!1}});this.addShape(p);const y=new Oe({rectWidth:h*a,rectHeight:c,rectBorderRadius:l,attrs:{fill:f},drag:{enable:!1}});this.addShape(y);const S=new vs({x:h*a,y:l,ballRadius:u,attrs:{fill:f},drag:{enable:!0,alongPath:new Et([["m",0,0],["l",h,0]])}});this.addShape(S),this.subscription=S.transform$.subscribe(({dX:w})=>{console.log(w);const v=(S.x-p.x)/h;y.update({rectWidth:h*v}),this.value$.next(r(v*(s-e)+e))})}destroy(){super.destroy(),this.subscription.unsubscribe()}cloneShapeCombo(){return new jo({...super.getBaseOptions(),...this.options})}}class hn extends K{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,s=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,s)-this.lineWidth;this.radius=Math.max(0,r-r*Math.sin(q(i)))}else this.radius=Math.max(0,Math.min(e/2,s/2)-this.lineWidth);t.x||(this.x=e/2),t.y||(this.half?this.y=s-this.lineWidth-this.radius*Math.sin(q(i)):this.y=s/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 hn({...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}=Ie(q(this.startDegree),this.radius),{dx:s,dy:i}=Ie(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,s-t,i-e]]}toCanvasContext(t){if(this.startColor&&this.endColor){let e;if(this.half){const s=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+s,-i,{0:this.startColor,1:this.endColor})}else{const s=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,s,-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 Ho extends Lt{half;lineWidth;width;height;bgColor;startColor;endColor;startDegree;endDegree;percent=0;ringBg;ring;lines=[];indicatorLineCount;constructor(t){if(super(t),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 hn({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 hn({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 r=this.ringBg.radius-20-17;for(let o=0;o<this.indicatorLineCount;o++){const a=new es({lineLength:17,startColor:this.startColor,endColor:this.endColor,attrs:{"stroke-linecap":"round","stroke-width":String(2),stroke:this.bgColor}});this.lines.push(a);const h=-90+this.startDegree+(this.endDegree-this.startDegree)/(this.indicatorLineCount-1)*o;this.addShape(a,{dX:this.ringBg.x+Math.cos(q(h))*r,dY:this.ringBg.y+Math.sin(q(h))*r,dDegree:h})}}this.setPercent(t.percent||0)}cloneShapeCombo(){return new Ho({...super.getBaseOptions(),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})}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)}}class Ss extends K{text;width=0;height=0;constructor(t){super(t),this.text=t.text,this.setAttr({fontSize:"10px",fontFamily:'system-ui, Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", Roboto, Oxygen, Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif',emojiFontFamily:'"Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji", "EmojiOne Color", "Android Emoji", "Twemoji Mozilla", "system emoji", sans-serif',fill:"#666666",stroke:"none","alignment-baseline":"middle",textAnchor:"start",...this.attrs});const e=Di(this.getAttr("fontSize"),10).number,s=Di(this.getAttr("fontWeight"),400).number,i=Ss.measureText(this.text,e,s);this.width=i.width,this.height=i.height}cloneShape(){return new Ss({...super.getBaseOptions(),text:this.text})}toSVGEl(){const t=Ze("text");t.setAttribute("x","0"),t.setAttribute("y","0"),t.style.alignmentBaseline="middle";const e=this.text.split(`
|
|
29
|
-
|
|
30
|
-
|
|
22
|
+
* 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,l=Date.now;function u(w,S,P){return setTimeout(b(w,P),S)}function d(w,S,P){return Array.isArray(w)?(f(w,P[S],P),!0):!1}function f(w,S,P){var M;if(w)if(w.forEach)w.forEach(S,P);else if(w.length!==i)for(M=0;M<w.length;)S.call(P,w[M],M,w),M++;else for(M in w)w.hasOwnProperty(M)&&S.call(P,w[M],M,w)}function p(w,S,P){var M="DEPRECATED METHOD: "+S+`
|
|
23
|
+
`+P+` AT
|
|
24
|
+
`;return function(){var k=new Error("get-stack-trace"),z=k&&k.stack?k.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",j=t.console&&(t.console.warn||t.console.log);return j&&j.call(t.console,M,z),w.apply(this,arguments)}}var g;typeof Object.assign!="function"?g=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 k=arguments[M];if(k!==i&&k!==null)for(var z in k)k.hasOwnProperty(z)&&(P[z]=k[z])}return P}:g=Object.assign;var C=p(function(S,P,M){for(var k=Object.keys(P),z=0;z<k.length;)(!M||M&&S[k[z]]===i)&&(S[k[z]]=P[k[z]]),z++;return S},"extend","Use `assign`."),y=p(function(S,P){return C(S,P,!0)},"merge","Use `assign`.");function v(w,S,P){var M=S.prototype,k;k=w.prototype=Object.create(M),k.constructor=w,k._super=M,P&&g(k,P)}function b(w,S){return function(){return w.apply(S,arguments)}}function x(w,S){return typeof w==a?w.apply(S&&S[0]||i,S):w}function E(w,S){return w===i?S:w}function _(w,S,P){f(G(S),function(M){w.addEventListener(M,P,!1)})}function L(w,S,P){f(G(S),function(M){w.removeEventListener(M,P,!1)})}function N(w,S){for(;w;){if(w==S)return!0;w=w.parentNode}return!1}function Y(w,S){return w.indexOf(S)>-1}function G(w){return w.trim().split(/\s+/g)}function V(w,S,P){if(w.indexOf&&!P)return w.indexOf(S);for(var M=0;M<w.length;){if(P&&w[M][P]==S||!P&&w[M]===S)return M;M++}return-1}function J(w){return Array.prototype.slice.call(w,0)}function rt(w,S,P){for(var M=[],k=[],z=0;z<w.length;){var j=S?w[z][S]:w[z];V(k,j)<0&&M.push(w[z]),k[z]=j,z++}return P&&(S?M=M.sort(function(vt,It){return vt[S]>It[S]}):M=M.sort()),M}function tt(w,S){for(var P,M,k=S[0].toUpperCase()+S.slice(1),z=0;z<r.length;){if(P=r[z],M=P?P+k:S,M in w)return M;z++}return i}var te=1;function Xt(){return te++}function qt(w){var S=w.ownerDocument||w;return S.defaultView||S.parentWindow||t}var ee=/mobile|tablet|ip(ad|hone|od)|android/i,R="ontouchstart"in t,D=tt(t,"PointerEvent")!==i,$=R&&ee.test(navigator.userAgent),Z="touch",At="pen",ne="mouse",gi="kinect",yi=25,yt=1,he=2,ot=4,Ct=8,Pn=1,rn=2,on=4,Fe=8,I=16,at=rn|on,an=Fe|I,Lu=at|an,Ru=["x","y"],wi=["clientX","clientY"];function jt(w,S){var P=this;this.manager=w,this.callback=S,this.element=w.element,this.target=w.options.inputTarget,this.domHandler=function(M){x(w.options.enable,[w])&&P.handler(M)},this.init()}jt.prototype={handler:function(){},init:function(){this.evEl&&_(this.element,this.evEl,this.domHandler),this.evTarget&&_(this.target,this.evTarget,this.domHandler),this.evWin&&_(qt(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(qt(this.element),this.evWin,this.domHandler)}};function bx(w){var S,P=w.options.inputClass;return P?S=P:D?S=pa:$?S=vi:R?S=ga:S=xi,new S(w,xx)}function xx(w,S,P){var M=P.pointers.length,k=P.changedPointers.length,z=S&yt&&M-k===0,j=S&(ot|Ct)&&M-k===0;P.isFirst=!!z,P.isFinal=!!j,z&&(w.session={}),P.eventType=S,vx(w,P),w.emit("hammer.input",P),w.recognize(P),w.session.prevInput=P}function vx(w,S){var P=w.session,M=S.pointers,k=M.length;P.firstInput||(P.firstInput=Ou(S)),k>1&&!P.firstMultiple?P.firstMultiple=Ou(S):k===1&&(P.firstMultiple=!1);var z=P.firstInput,j=P.firstMultiple,wt=j?j.center:z.center,vt=S.center=zu(M);S.timeStamp=l(),S.deltaTime=S.timeStamp-z.timeStamp,S.angle=ma(wt,vt),S.distance=bi(wt,vt),Sx(P,S),S.offsetDirection=Bu(S.deltaX,S.deltaY);var It=Nu(S.deltaTime,S.deltaX,S.deltaY);S.overallVelocityX=It.x,S.overallVelocityY=It.y,S.overallVelocity=c(It.x)>c(It.y)?It.x:It.y,S.scale=j?Ex(j.pointers,M):1,S.rotation=j?Cx(j.pointers,M):0,S.maxPointers=P.prevInput?S.pointers.length>P.prevInput.maxPointers?S.pointers.length:P.prevInput.maxPointers:S.pointers.length,_x(P,S);var le=w.element;N(S.srcEvent.target,le)&&(le=S.srcEvent.target),S.target=le}function Sx(w,S){var P=S.center,M=w.offsetDelta||{},k=w.prevDelta||{},z=w.prevInput||{};(S.eventType===yt||z.eventType===ot)&&(k=w.prevDelta={x:z.deltaX||0,y:z.deltaY||0},M=w.offsetDelta={x:P.x,y:P.y}),S.deltaX=k.x+(P.x-M.x),S.deltaY=k.y+(P.y-M.y)}function _x(w,S){var P=w.lastInterval||S,M=S.timeStamp-P.timeStamp,k,z,j,wt;if(S.eventType!=Ct&&(M>yi||P.velocity===i)){var vt=S.deltaX-P.deltaX,It=S.deltaY-P.deltaY,le=Nu(M,vt,It);z=le.x,j=le.y,k=c(le.x)>c(le.y)?le.x:le.y,wt=Bu(vt,It),w.lastInterval=S}else k=P.velocity,z=P.velocityX,j=P.velocityY,wt=P.direction;S.velocity=k,S.velocityX=z,S.velocityY=j,S.direction=wt}function Ou(w){for(var S=[],P=0;P<w.pointers.length;)S[P]={clientX:h(w.pointers[P].clientX),clientY:h(w.pointers[P].clientY)},P++;return{timeStamp:l(),pointers:S,center:zu(S),deltaX:w.deltaX,deltaY:w.deltaY}}function zu(w){var S=w.length;if(S===1)return{x:h(w[0].clientX),y:h(w[0].clientY)};for(var P=0,M=0,k=0;k<S;)P+=w[k].clientX,M+=w[k].clientY,k++;return{x:h(P/S),y:h(M/S)}}function Nu(w,S,P){return{x:S/w||0,y:P/w||0}}function Bu(w,S){return w===S?Pn:c(w)>=c(S)?w<0?rn:on:S<0?Fe:I}function bi(w,S,P){P||(P=Ru);var M=S[P[0]]-w[P[0]],k=S[P[1]]-w[P[1]];return Math.sqrt(M*M+k*k)}function ma(w,S,P){P||(P=Ru);var M=S[P[0]]-w[P[0]],k=S[P[1]]-w[P[1]];return Math.atan2(k,M)*180/Math.PI}function Cx(w,S){return ma(S[1],S[0],wi)+ma(w[1],w[0],wi)}function Ex(w,S){return bi(S[0],S[1],wi)/bi(w[0],w[1],wi)}var Px={mousedown:yt,mousemove:he,mouseup:ot},Tx="mousedown",Mx="mousemove mouseup";function xi(){this.evEl=Tx,this.evWin=Mx,this.pressed=!1,jt.apply(this,arguments)}v(xi,jt,{handler:function(S){var P=Px[S.type];P&yt&&S.button===0&&(this.pressed=!0),P&he&&S.which!==1&&(P=ot),this.pressed&&(P&ot&&(this.pressed=!1),this.callback(this.manager,P,{pointers:[S],changedPointers:[S],pointerType:ne,srcEvent:S}))}});var Ax={pointerdown:yt,pointermove:he,pointerup:ot,pointercancel:Ct,pointerout:Ct},Ix={2:Z,3:At,4:ne,5:gi},Fu="pointerdown",Yu="pointermove pointerup pointercancel";t.MSPointerEvent&&!t.PointerEvent&&(Fu="MSPointerDown",Yu="MSPointerMove MSPointerUp MSPointerCancel");function pa(){this.evEl=Fu,this.evWin=Yu,jt.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}v(pa,jt,{handler:function(S){var P=this.store,M=!1,k=S.type.toLowerCase().replace("ms",""),z=Ax[k],j=Ix[S.pointerType]||S.pointerType,wt=j==Z,vt=V(P,S.pointerId,"pointerId");z&yt&&(S.button===0||wt)?vt<0&&(P.push(S),vt=P.length-1):z&(ot|Ct)&&(M=!0),!(vt<0)&&(P[vt]=S,this.callback(this.manager,z,{pointers:P,changedPointers:[S],pointerType:j,srcEvent:S}),M&&P.splice(vt,1))}});var kx={touchstart:yt,touchmove:he,touchend:ot,touchcancel:Ct},Dx="touchstart",Lx="touchstart touchmove touchend touchcancel";function Xu(){this.evTarget=Dx,this.evWin=Lx,this.started=!1,jt.apply(this,arguments)}v(Xu,jt,{handler:function(S){var P=kx[S.type];if(P===yt&&(this.started=!0),!!this.started){var M=Rx.call(this,S,P);P&(ot|Ct)&&M[0].length-M[1].length===0&&(this.started=!1),this.callback(this.manager,P,{pointers:M[0],changedPointers:M[1],pointerType:Z,srcEvent:S})}}});function Rx(w,S){var P=J(w.touches),M=J(w.changedTouches);return S&(ot|Ct)&&(P=rt(P.concat(M),"identifier",!0)),[P,M]}var Ox={touchstart:yt,touchmove:he,touchend:ot,touchcancel:Ct},zx="touchstart touchmove touchend touchcancel";function vi(){this.evTarget=zx,this.targetIds={},jt.apply(this,arguments)}v(vi,jt,{handler:function(S){var P=Ox[S.type],M=Nx.call(this,S,P);M&&this.callback(this.manager,P,{pointers:M[0],changedPointers:M[1],pointerType:Z,srcEvent:S})}});function Nx(w,S){var P=J(w.touches),M=this.targetIds;if(S&(yt|he)&&P.length===1)return M[P[0].identifier]=!0,[P,P];var k,z,j=J(w.changedTouches),wt=[],vt=this.target;if(z=P.filter(function(It){return N(It.target,vt)}),S===yt)for(k=0;k<z.length;)M[z[k].identifier]=!0,k++;for(k=0;k<j.length;)M[j[k].identifier]&&wt.push(j[k]),S&(ot|Ct)&&delete M[j[k].identifier],k++;if(wt.length)return[rt(z.concat(wt),"identifier",!0),wt]}var Bx=2500,Uu=25;function ga(){jt.apply(this,arguments);var w=b(this.handler,this);this.touch=new vi(this.manager,w),this.mouse=new xi(this.manager,w),this.primaryTouch=null,this.lastTouches=[]}v(ga,jt,{handler:function(S,P,M){var k=M.pointerType==Z,z=M.pointerType==ne;if(!(z&&M.sourceCapabilities&&M.sourceCapabilities.firesTouchEvents)){if(k)Fx.call(this,P,M);else if(z&&Yx.call(this,M))return;this.callback(S,P,M)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});function Fx(w,S){w&yt?(this.primaryTouch=S.changedPointers[0].identifier,$u.call(this,S)):w&(ot|Ct)&&$u.call(this,S)}function $u(w){var S=w.changedPointers[0];if(S.identifier===this.primaryTouch){var P={x:S.clientX,y:S.clientY};this.lastTouches.push(P);var M=this.lastTouches,k=function(){var z=M.indexOf(P);z>-1&&M.splice(z,1)};setTimeout(k,Bx)}}function Yx(w){for(var S=w.srcEvent.clientX,P=w.srcEvent.clientY,M=0;M<this.lastTouches.length;M++){var k=this.lastTouches[M],z=Math.abs(S-k.x),j=Math.abs(P-k.y);if(z<=Uu&&j<=Uu)return!0}return!1}var Gu=tt(o.style,"touchAction"),Vu=Gu!==i,qu="compute",ju="auto",ya="manipulation",hn="none",fs="pan-x",ds="pan-y",Si=Ux();function wa(w,S){this.manager=w,this.set(S)}wa.prototype={set:function(w){w==qu&&(w=this.compute()),Vu&&this.manager.element.style&&Si[w]&&(this.manager.element.style[Gu]=w),this.actions=w.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var w=[];return f(this.manager.recognizers,function(S){x(S.options.enable,[S])&&(w=w.concat(S.getTouchAction()))}),Xx(w.join(" "))},preventDefaults:function(w){var S=w.srcEvent,P=w.offsetDirection;if(this.manager.session.prevented){S.preventDefault();return}var M=this.actions,k=Y(M,hn)&&!Si[hn],z=Y(M,ds)&&!Si[ds],j=Y(M,fs)&&!Si[fs];if(k){var wt=w.pointers.length===1,vt=w.distance<2,It=w.deltaTime<250;if(wt&&vt&&It)return}if(!(j&&z)&&(k||z&&P&at||j&&P&an))return this.preventSrc(S)},preventSrc:function(w){this.manager.session.prevented=!0,w.preventDefault()}};function Xx(w){if(Y(w,hn))return hn;var S=Y(w,fs),P=Y(w,ds);return S&&P?hn:S||P?S?fs:ds:Y(w,ya)?ya:ju}function Ux(){if(!Vu)return!1;var w={},S=t.CSS&&t.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(P){w[P]=S?t.CSS.supports("touch-action",P):!0}),w}var _i=1,Ht=2,Tn=4,Ye=8,ve=Ye,ms=16,ce=32;function Se(w){this.options=g({},this.defaults,w||{}),this.id=Xt(),this.manager=null,this.options.enable=E(this.options.enable,!0),this.state=_i,this.simultaneous={},this.requireFail=[]}Se.prototype={defaults:{},set:function(w){return g(this.options,w),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(w){if(d(w,"recognizeWith",this))return this;var S=this.simultaneous;return w=Ci(w,this),S[w.id]||(S[w.id]=w,w.recognizeWith(this)),this},dropRecognizeWith:function(w){return d(w,"dropRecognizeWith",this)?this:(w=Ci(w,this),delete this.simultaneous[w.id],this)},requireFailure:function(w){if(d(w,"requireFailure",this))return this;var S=this.requireFail;return w=Ci(w,this),V(S,w)===-1&&(S.push(w),w.requireFailure(this)),this},dropRequireFailure:function(w){if(d(w,"dropRequireFailure",this))return this;w=Ci(w,this);var S=V(this.requireFail,w);return S>-1&&this.requireFail.splice(S,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(w){return!!this.simultaneous[w.id]},emit:function(w){var S=this,P=this.state;function M(k){S.manager.emit(k,w)}P<Ye&&M(S.options.event+Hu(P)),M(S.options.event),w.additionalEvent&&M(w.additionalEvent),P>=Ye&&M(S.options.event+Hu(P))},tryEmit:function(w){if(this.canEmit())return this.emit(w);this.state=ce},canEmit:function(){for(var w=0;w<this.requireFail.length;){if(!(this.requireFail[w].state&(ce|_i)))return!1;w++}return!0},recognize:function(w){var S=g({},w);if(!x(this.options.enable,[this,S])){this.reset(),this.state=ce;return}this.state&(ve|ms|ce)&&(this.state=_i),this.state=this.process(S),this.state&(Ht|Tn|Ye|ms)&&this.tryEmit(S)},process:function(w){},getTouchAction:function(){},reset:function(){}};function Hu(w){return w&ms?"cancel":w&Ye?"end":w&Tn?"move":w&Ht?"start":""}function Wu(w){return w==I?"down":w==Fe?"up":w==rn?"left":w==on?"right":""}function Ci(w,S){var P=S.manager;return P?P.get(w):w}function se(){Se.apply(this,arguments)}v(se,Se,{defaults:{pointers:1},attrTest:function(w){var S=this.options.pointers;return S===0||w.pointers.length===S},process:function(w){var S=this.state,P=w.eventType,M=S&(Ht|Tn),k=this.attrTest(w);return M&&(P&Ct||!k)?S|ms:M||k?P&ot?S|Ye:S&Ht?S|Tn:Ht:ce}});function Ei(){se.apply(this,arguments),this.pX=null,this.pY=null}v(Ei,se,{defaults:{event:"pan",threshold:10,pointers:1,direction:Lu},getTouchAction:function(){var w=this.options.direction,S=[];return w&at&&S.push(ds),w&an&&S.push(fs),S},directionTest:function(w){var S=this.options,P=!0,M=w.distance,k=w.direction,z=w.deltaX,j=w.deltaY;return k&S.direction||(S.direction&at?(k=z===0?Pn:z<0?rn:on,P=z!=this.pX,M=Math.abs(w.deltaX)):(k=j===0?Pn:j<0?Fe:I,P=j!=this.pY,M=Math.abs(w.deltaY))),w.direction=k,P&&M>S.threshold&&k&S.direction},attrTest:function(w){return se.prototype.attrTest.call(this,w)&&(this.state&Ht||!(this.state&Ht)&&this.directionTest(w))},emit:function(w){this.pX=w.deltaX,this.pY=w.deltaY;var S=Wu(w.direction);S&&(w.additionalEvent=this.options.event+S),this._super.emit.call(this,w)}});function ba(){se.apply(this,arguments)}v(ba,se,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[hn]},attrTest:function(w){return this._super.attrTest.call(this,w)&&(Math.abs(w.scale-1)>this.options.threshold||this.state&Ht)},emit:function(w){if(w.scale!==1){var S=w.scale<1?"in":"out";w.additionalEvent=this.options.event+S}this._super.emit.call(this,w)}});function xa(){Se.apply(this,arguments),this._timer=null,this._input=null}v(xa,Se,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[ju]},process:function(w){var S=this.options,P=w.pointers.length===S.pointers,M=w.distance<S.threshold,k=w.deltaTime>S.time;if(this._input=w,!M||!P||w.eventType&(ot|Ct)&&!k)this.reset();else if(w.eventType&yt)this.reset(),this._timer=u(function(){this.state=ve,this.tryEmit()},S.time,this);else if(w.eventType&ot)return ve;return ce},reset:function(){clearTimeout(this._timer)},emit:function(w){this.state===ve&&(w&&w.eventType&ot?this.manager.emit(this.options.event+"up",w):(this._input.timeStamp=l(),this.manager.emit(this.options.event,this._input)))}});function va(){se.apply(this,arguments)}v(va,se,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[hn]},attrTest:function(w){return this._super.attrTest.call(this,w)&&(Math.abs(w.rotation)>this.options.threshold||this.state&Ht)}});function Sa(){se.apply(this,arguments)}v(Sa,se,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:at|an,pointers:1},getTouchAction:function(){return Ei.prototype.getTouchAction.call(this)},attrTest:function(w){var S=this.options.direction,P;return S&(at|an)?P=w.overallVelocity:S&at?P=w.overallVelocityX:S&an&&(P=w.overallVelocityY),this._super.attrTest.call(this,w)&&S&w.offsetDirection&&w.distance>this.options.threshold&&w.maxPointers==this.options.pointers&&c(P)>this.options.velocity&&w.eventType&ot},emit:function(w){var S=Wu(w.offsetDirection);S&&this.manager.emit(this.options.event+S,w),this.manager.emit(this.options.event,w)}});function Pi(){Se.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}v(Pi,Se,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[ya]},process:function(w){var S=this.options,P=w.pointers.length===S.pointers,M=w.distance<S.threshold,k=w.deltaTime<S.time;if(this.reset(),w.eventType&yt&&this.count===0)return this.failTimeout();if(M&&k&&P){if(w.eventType!=ot)return this.failTimeout();var z=this.pTime?w.timeStamp-this.pTime<S.interval:!0,j=!this.pCenter||bi(this.pCenter,w.center)<S.posThreshold;this.pTime=w.timeStamp,this.pCenter=w.center,!j||!z?this.count=1:this.count+=1,this._input=w;var wt=this.count%S.taps;if(wt===0)return this.hasRequireFailures()?(this._timer=u(function(){this.state=ve,this.tryEmit()},S.interval,this),Ht):ve}return ce},failTimeout:function(){return this._timer=u(function(){this.state=ce},this.options.interval,this),ce},reset:function(){clearTimeout(this._timer)},emit:function(){this.state==ve&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}});function _e(w,S){return S=S||{},S.recognizers=E(S.recognizers,_e.defaults.preset),new _a(w,S)}_e.VERSION="2.0.7",_e.defaults={domEvents:!1,touchAction:qu,enable:!0,inputTarget:null,inputClass:null,preset:[[va,{enable:!1}],[ba,{enable:!1},["rotate"]],[Sa,{direction:at}],[Ei,{direction:at},["swipe"]],[Pi],[Pi,{event:"doubletap",taps:2},["tap"]],[xa]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};var $x=1,Ju=2;function _a(w,S){this.options=g({},_e.defaults,S||{}),this.options.inputTarget=this.options.inputTarget||w,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=w,this.input=bx(this),this.touchAction=new wa(this,this.options.touchAction),Zu(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)}_a.prototype={set:function(w){return g(this.options,w),w.touchAction&&this.touchAction.update(),w.inputTarget&&(this.input.destroy(),this.input.target=w.inputTarget,this.input.init()),this},stop:function(w){this.session.stopped=w?Ju:$x},recognize:function(w){var S=this.session;if(!S.stopped){this.touchAction.preventDefaults(w);var P,M=this.recognizers,k=S.curRecognizer;(!k||k&&k.state&ve)&&(k=S.curRecognizer=null);for(var z=0;z<M.length;)P=M[z],S.stopped!==Ju&&(!k||P==k||P.canRecognizeWith(k))?P.recognize(w):P.reset(),!k&&P.state&(Ht|Tn|Ye)&&(k=S.curRecognizer=P),z++}},get:function(w){if(w instanceof Se)return w;for(var S=this.recognizers,P=0;P<S.length;P++)if(S[P].options.event==w)return S[P];return null},add:function(w){if(d(w,"add",this))return this;var S=this.get(w.options.event);return S&&this.remove(S),this.recognizers.push(w),w.manager=this,this.touchAction.update(),w},remove:function(w){if(d(w,"remove",this))return this;if(w=this.get(w),w){var S=this.recognizers,P=V(S,w);P!==-1&&(S.splice(P,1),this.touchAction.update())}return this},on:function(w,S){if(w!==i&&S!==i){var P=this.handlers;return f(G(w),function(M){P[M]=P[M]||[],P[M].push(S)}),this}},off:function(w,S){if(w!==i){var P=this.handlers;return f(G(w),function(M){S?P[M]&&P[M].splice(V(P[M],S),1):delete P[M]}),this}},emit:function(w,S){this.options.domEvents&&Gx(w,S);var P=this.handlers[w]&&this.handlers[w].slice();if(!(!P||!P.length)){S.type=w,S.preventDefault=function(){S.srcEvent.preventDefault()};for(var M=0;M<P.length;)P[M](S),M++}},destroy:function(){this.element&&Zu(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}};function Zu(w,S){var P=w.element;if(P.style){var M;f(w.options.cssProps,function(k,z){M=tt(P.style,z),S?(w.oldCssProps[M]=P.style[M],P.style[M]=k):P.style[M]=w.oldCssProps[M]||""}),S||(w.oldCssProps={})}}function Gx(w,S){var P=e.createEvent("Event");P.initEvent(w,!0,!0),P.gesture=S,S.target.dispatchEvent(P)}g(_e,{INPUT_START:yt,INPUT_MOVE:he,INPUT_END:ot,INPUT_CANCEL:Ct,STATE_POSSIBLE:_i,STATE_BEGAN:Ht,STATE_CHANGED:Tn,STATE_ENDED:Ye,STATE_RECOGNIZED:ve,STATE_CANCELLED:ms,STATE_FAILED:ce,DIRECTION_NONE:Pn,DIRECTION_LEFT:rn,DIRECTION_RIGHT:on,DIRECTION_UP:Fe,DIRECTION_DOWN:I,DIRECTION_HORIZONTAL:at,DIRECTION_VERTICAL:an,DIRECTION_ALL:Lu,Manager:_a,Input:jt,TouchAction:wa,TouchInput:vi,MouseInput:xi,PointerEventInput:pa,TouchMouseInput:ga,SingleTouchInput:Xu,Recognizer:Se,AttrRecognizer:se,Tap:Pi,Pan:Ei,Swipe:Sa,Pinch:ba,Rotate:va,Press:xa,on:_,off:L,each:f,merge:y,extend:C,assign:g,inherit:v,bindFn:b,prefixed:tt});var Vx=typeof t<"u"?t:typeof self<"u"?self:{};Vx.Hammer=_e,typeof i=="function"&&i.amd?i(function(){return _e}):s.exports?s.exports=_e:t[n]=_e})(window,document,"Hammer")})(jh);var cp=jh.exports;const nt=$h(cp);var gr=function(s,t){return gr=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])},gr(s,t)};function oe(s,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");gr(s,t);function e(){this.constructor=s}s.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}function lp(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(l){try{c(n.next(l))}catch(u){o(u)}}function h(l){try{c(n.throw(l))}catch(u){o(u)}}function c(l){l.done?r(l.value):i(l.value).then(a,h)}c((n=n.apply(s,t||[])).next())})}function Hh(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(l){return h([c,l])}}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(l){c=[6,l],i=0}finally{n=r=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}function Ge(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 de(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 Pe(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 dn(s){return this instanceof dn?(this.v=s,this):new dn(s)}function up(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,u)}}function a(f,p){n[f]&&(i[f]=function(g){return new Promise(function(C,y){r.push([f,g,C,y])>1||h(f,g)})},p&&(i[f]=p(i[f])))}function h(f,p){try{c(n[f](p))}catch(g){d(r[0][3],g)}}function c(f){f.value instanceof dn?Promise.resolve(f.value.v).then(l,u):d(r[0][2],f)}function l(f){h("next",f)}function u(f){h("throw",f)}function d(f,p){f(p),r.shift(),r.length&&h(r[0][0],r[0][1])}}function fp(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 Ge=="function"?Ge(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 H(s){return typeof s=="function"}function yr(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 wr=yr(function(s){return function(e){s(this),this.message=e?e.length+` errors occurred during unsubscription:
|
|
25
|
+
`+e.map(function(n,i){return i+1+") "+n.toString()}).join(`
|
|
26
|
+
`):"",this.name="UnsubscriptionError",this.errors=e}});function Fn(s,t){if(s){var e=s.indexOf(t);0<=e&&s.splice(e,1)}}var mn=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=Ge(o),h=a.next();!h.done;h=a.next()){var c=h.value;c.remove(this)}}catch(g){t={error:g}}finally{try{h&&!h.done&&(e=a.return)&&e.call(a)}finally{if(t)throw t.error}}else o.remove(this);var l=this.initialTeardown;if(H(l))try{l()}catch(g){r=g instanceof wr?g.errors:[g]}var u=this._finalizers;if(u){this._finalizers=null;try{for(var d=Ge(u),f=d.next();!f.done;f=d.next()){var p=f.value;try{Zh(p)}catch(g){r=r??[],g instanceof wr?r=Pe(Pe([],de(r)),de(g.errors)):r.push(g)}}}catch(g){n={error:g}}finally{try{f&&!f.done&&(i=d.return)&&i.call(d)}finally{if(n)throw n.error}}}if(r)throw new wr(r)}},s.prototype.add=function(t){var e;if(t&&t!==this)if(this.closed)Zh(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)&&Fn(e,t)},s.prototype.remove=function(t){var e=this._finalizers;e&&Fn(e,t),t instanceof s&&t._removeParent(this)},s.EMPTY=function(){var t=new s;return t.closed=!0,t}(),s}(),Wh=mn.EMPTY;function Jh(s){return s instanceof mn||s&&"closed"in s&&H(s.remove)&&H(s.add)&&H(s.unsubscribe)}function Zh(s){H(s)?s():s.unsubscribe()}var Kh={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},br={setTimeout:function(s,t){for(var e=[],n=2;n<arguments.length;n++)e[n-2]=arguments[n];var i=br.delegate;return i?.setTimeout?i.setTimeout.apply(i,Pe([s,t],de(e))):setTimeout.apply(void 0,Pe([s,t],de(e)))},clearTimeout:function(s){var t=br.delegate;return(t?.clearTimeout||clearTimeout)(s)},delegate:void 0};function Qh(s){br.setTimeout(function(){throw s})}function Yn(){}function Xs(s){s()}var xr=function(s){oe(t,s);function t(e){var n=s.call(this)||this;return n.isStopped=!1,e?(n.destination=e,Jh(e)&&e.add(n)):n.destination=gp,n}return t.create=function(e,n,i){return new pn(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}(mn),dp=Function.prototype.bind;function vr(s,t){return dp.call(s,t)}var mp=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}(),pn=function(s){oe(t,s);function t(e,n,i){var r=s.call(this)||this,o;if(H(e)||!e)o={next:e??void 0,error:n??void 0,complete:i??void 0};else{var a;r&&Kh.useDeprecatedNextContext?(a=Object.create(e),a.unsubscribe=function(){return r.unsubscribe()},o={next:e.next&&vr(e.next,a),error:e.error&&vr(e.error,a),complete:e.complete&&vr(e.complete,a)}):o=e}return r.destination=new mp(o),r}return t}(xr);function Us(s){Qh(s)}function pp(s){throw s}var gp={closed:!0,next:Yn,error:pp,complete:Yn},Sr=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function Ve(s){return s}function yp(s){return s.length===0?Ve:s.length===1?s[0]:function(e){return s.reduce(function(n,i){return i(n)},e)}}var st=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=bp(t)?t:new pn(t,e,n);return Xs(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=tc(e),new e(function(i,r){var o=new pn({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[Sr]=function(){return this},s.prototype.pipe=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return yp(t)(this)},s.prototype.toPromise=function(t){var e=this;return t=tc(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 tc(s){var t;return(t=s??Kh.Promise)!==null&&t!==void 0?t:Promise}function wp(s){return s&&H(s.next)&&H(s.error)&&H(s.complete)}function bp(s){return s&&s instanceof xr||wp(s)&&Jh(s)}function xp(s){return H(s?.lift)}function kt(s){return function(t){if(xp(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 vp(s,t,e,n,i)}var vp=function(s){oe(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(l){e.error(l)}}:s.prototype._next,h._error=r?function(c){try{r(c)}catch(l){e.error(l)}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}(xr),Sp=yr(function(s){return function(){s(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),Te=function(s){oe(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 ec(this,this);return n.operator=e,n},t.prototype._throwIfClosed=function(){if(this.closed)throw new Sp},t.prototype.next=function(e){var n=this;Xs(function(){var i,r;if(n._throwIfClosed(),!n.isStopped){n.currentObservers||(n.currentObservers=Array.from(n.observers));try{for(var o=Ge(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;Xs(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;Xs(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?Wh:(this.currentObservers=null,a.push(e),new mn(function(){n.currentObservers=null,Fn(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 st;return e.source=this,e},t.create=function(e,n){return new ec(e,n)},t}(st),ec=function(s){oe(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:Wh},t}(Te),nc=function(s){oe(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}(Te),_r={now:function(){return(_r.delegate||Date).now()},delegate:void 0},_p=function(s){oe(t,s);function t(e,n,i){e===void 0&&(e=1/0),n===void 0&&(n=1/0),i===void 0&&(i=_r);var r=s.call(this)||this;return r._bufferSize=e,r._windowTime=n,r._timestampProvider=i,r._buffer=[],r._infiniteTimeWindow=!0,r._infiniteTimeWindow=n===1/0,r._bufferSize=Math.max(1,e),r._windowTime=Math.max(1,n),r}return t.prototype.next=function(e){var n=this,i=n.isStopped,r=n._buffer,o=n._infiniteTimeWindow,a=n._timestampProvider,h=n._windowTime;i||(r.push(e),!o&&r.push(a.now()+h)),this._trimBuffer(),s.prototype.next.call(this,e)},t.prototype._subscribe=function(e){this._throwIfClosed(),this._trimBuffer();for(var n=this._innerSubscribe(e),i=this,r=i._infiniteTimeWindow,o=i._buffer,a=o.slice(),h=0;h<a.length&&!e.closed;h+=r?1:2)e.next(a[h]);return this._checkFinalizedStatuses(e),n},t.prototype._trimBuffer=function(){var e=this,n=e._bufferSize,i=e._timestampProvider,r=e._buffer,o=e._infiniteTimeWindow,a=(o?1:2)*n;if(n<1/0&&a<r.length&&r.splice(0,r.length-a),!o){for(var h=i.now(),c=0,l=1;l<r.length&&r[l]<=h;l+=2)c=l;c&&r.splice(0,c+1)}},t}(Te),Cp=function(s){oe(t,s);function t(e,n){return s.call(this)||this}return t.prototype.schedule=function(e,n){return this},t}(mn),$s={setInterval:function(s,t){for(var e=[],n=2;n<arguments.length;n++)e[n-2]=arguments[n];var i=$s.delegate;return i?.setInterval?i.setInterval.apply(i,Pe([s,t],de(e))):setInterval.apply(void 0,Pe([s,t],de(e)))},clearInterval:function(s){var t=$s.delegate;return(t?.clearInterval||clearInterval)(s)},delegate:void 0},Ep=function(s){oe(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),$s.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&&$s.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,Fn(r,this),n!=null&&(this.id=this.recycleAsyncId(i,n,null)),this.delay=null,s.prototype.unsubscribe.call(this)}},t}(Cp),sc=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=_r.now,s}(),Pp=function(s){oe(t,s);function t(e,n){n===void 0&&(n=sc.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}(sc),Cr=new Pp(Ep),Tp=Cr,ic=new st(function(s){return s.complete()});function rc(s){return s&&H(s.schedule)}function Er(s){return s[s.length-1]}function Mp(s){return H(Er(s))?s.pop():void 0}function Xn(s){return rc(Er(s))?s.pop():void 0}function Ap(s,t){return typeof Er(s)=="number"?s.pop():t}var Pr=function(s){return s&&typeof s.length=="number"&&typeof s!="function"};function oc(s){return H(s?.then)}function ac(s){return H(s[Sr])}function hc(s){return Symbol.asyncIterator&&H(s?.[Symbol.asyncIterator])}function cc(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 Ip(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var lc=Ip();function uc(s){return H(s?.[lc])}function fc(s){return up(this,arguments,function(){var e,n,i,r;return Hh(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,dn(e.read())];case 3:return n=o.sent(),i=n.value,r=n.done,r?[4,dn(void 0)]:[3,5];case 4:return[2,o.sent()];case 5:return[4,dn(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 dc(s){return H(s?.getReader)}function mt(s){if(s instanceof st)return s;if(s!=null){if(ac(s))return kp(s);if(Pr(s))return Dp(s);if(oc(s))return Lp(s);if(hc(s))return mc(s);if(uc(s))return Rp(s);if(dc(s))return Op(s)}throw cc(s)}function kp(s){return new st(function(t){var e=s[Sr]();if(H(e.subscribe))return e.subscribe(t);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function Dp(s){return new st(function(t){for(var e=0;e<s.length&&!t.closed;e++)t.next(s[e]);t.complete()})}function Lp(s){return new st(function(t){s.then(function(e){t.closed||(t.next(e),t.complete())},function(e){return t.error(e)}).then(null,Qh)})}function Rp(s){return new st(function(t){var e,n;try{for(var i=Ge(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 mc(s){return new st(function(t){zp(s,t).catch(function(e){return t.error(e)})})}function Op(s){return mc(fc(s))}function zp(s,t){var e,n,i,r;return lp(this,void 0,void 0,function(){var o,a;return Hh(this,function(h){switch(h.label){case 0:h.trys.push([0,5,6,11]),e=fp(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 me(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 pc(s,t){return t===void 0&&(t=0),kt(function(e,n){e.subscribe(ut(n,function(i){return me(n,s,function(){return n.next(i)},t)},function(){return me(n,s,function(){return n.complete()},t)},function(i){return me(n,s,function(){return n.error(i)},t)}))})}function Tr(s,t){return t===void 0&&(t=0),kt(function(e,n){n.add(s.schedule(function(){return e.subscribe(n)},t))})}function Np(s,t){return mt(s).pipe(Tr(t),pc(t))}function Bp(s,t){return mt(s).pipe(Tr(t),pc(t))}function Fp(s,t){return new st(function(e){var n=0;return t.schedule(function(){n===s.length?e.complete():(e.next(s[n++]),e.closed||this.schedule())})})}function Yp(s,t){return new st(function(e){var n;return me(e,t,function(){n=s[lc](),me(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 H(n?.return)&&n.return()}})}function gc(s,t){if(!s)throw new Error("Iterable cannot be null");return new st(function(e){me(e,t,function(){var n=s[Symbol.asyncIterator]();me(e,t,function(){n.next().then(function(i){i.done?e.complete():e.next(i.value)})},0,!0)})})}function Xp(s,t){return gc(fc(s),t)}function Up(s,t){if(s!=null){if(ac(s))return Np(s,t);if(Pr(s))return Fp(s,t);if(oc(s))return Bp(s,t);if(hc(s))return gc(s,t);if(uc(s))return Yp(s,t);if(dc(s))return Xp(s,t)}throw cc(s)}function Un(s,t){return t?Up(s,t):mt(s)}function $p(){for(var s=[],t=0;t<arguments.length;t++)s[t]=arguments[t];var e=Xn(s);return Un(s,e)}var Gp=yr(function(s){return function(){s(this),this.name="EmptyError",this.message="no elements in sequence"}});function Vp(s,t){var e=typeof t=="object";return new Promise(function(n,i){var r=new pn({next:function(o){n(o),r.unsubscribe()},error:i,complete:function(){e?n(t.defaultValue):i(new Gp)}});s.subscribe(r)})}function qp(s){return s instanceof Date&&!isNaN(s)}function it(s,t){return kt(function(e,n){var i=0;e.subscribe(ut(n,function(r){n.next(s.call(t,r,i++))}))})}var jp=Array.isArray;function Hp(s,t){return jp(t)?s.apply(void 0,Pe([],de(t))):s(t)}function Mr(s){return it(function(t){return Hp(s,t)})}var Wp=Array.isArray,Jp=Object.getPrototypeOf,Zp=Object.prototype,Kp=Object.keys;function Qp(s){if(s.length===1){var t=s[0];if(Wp(t))return{args:t,keys:null};if(tg(t)){var e=Kp(t);return{args:e.map(function(n){return t[n]}),keys:e}}}return{args:s,keys:null}}function tg(s){return s&&typeof s=="object"&&Jp(s)===Zp}function eg(s,t){return s.reduce(function(e,n,i){return e[n]=t[i],e},{})}function ng(){for(var s=[],t=0;t<arguments.length;t++)s[t]=arguments[t];var e=Xn(s),n=Mp(s),i=Qp(s),r=i.args,o=i.keys;if(r.length===0)return Un([],e);var a=new st(sg(r,e,o?function(h){return eg(o,h)}:Ve));return n?a.pipe(Mr(n)):a}function sg(s,t,e){return e===void 0&&(e=Ve),function(n){yc(t,function(){for(var i=s.length,r=new Array(i),o=i,a=i,h=function(l){yc(t,function(){var u=Un(s[l],t),d=!1;u.subscribe(ut(n,function(f){r[l]=f,d||(d=!0,a--),a||n.next(e(r.slice()))},function(){--o||n.complete()}))},n)},c=0;c<i;c++)h(c)},n)}}function yc(s,t,e){s?me(e,s,t):t()}function ig(s,t,e,n,i,r,o,a){var h=[],c=0,l=0,u=!1,d=function(){u&&!h.length&&!c&&t.complete()},f=function(g){return c<n?p(g):h.push(g)},p=function(g){r&&t.next(g),c++;var C=!1;mt(e(g,l++)).subscribe(ut(t,function(y){i?.(y),r?f(y):t.next(y)},function(){C=!0},void 0,function(){if(C)try{c--;for(var y=function(){var v=h.shift();o?me(t,o,function(){return p(v)}):p(v)};h.length&&c<n;)y();d()}catch(v){t.error(v)}}))};return s.subscribe(ut(t,f,function(){u=!0,d()})),function(){a?.()}}function Ar(s,t,e){return e===void 0&&(e=1/0),H(t)?Ar(function(n,i){return it(function(r,o){return t(n,r,i,o)})(mt(s(n,i)))},e):(typeof t=="number"&&(e=t),kt(function(n,i){return ig(n,i,s,e)}))}function wc(s){return s===void 0&&(s=1/0),Ar(Ve,s)}function rg(){return wc(1)}function bc(){for(var s=[],t=0;t<arguments.length;t++)s[t]=arguments[t];return rg()(Un(s,Xn(s)))}var og=["addListener","removeListener"],ag=["addEventListener","removeEventListener"],hg=["on","off"];function Ir(s,t,e,n){if(H(e)&&(n=e,e=void 0),n)return Ir(s,t,e).pipe(Mr(n));var i=de(ug(s)?ag.map(function(a){return function(h){return s[a](t,h,e)}}):cg(s)?og.map(xc(s,t)):lg(s)?hg.map(xc(s,t)):[],2),r=i[0],o=i[1];if(!r&&Pr(s))return Ar(function(a){return Ir(a,t,e)})(mt(s));if(!r)throw new TypeError("Invalid event target");return new st(function(a){var h=function(){for(var c=[],l=0;l<arguments.length;l++)c[l]=arguments[l];return a.next(1<c.length?c:c[0])};return r(h),function(){return o(h)}})}function xc(s,t){return function(e){return function(n){return s[e](t,n)}}}function cg(s){return H(s.addListener)&&H(s.removeListener)}function lg(s){return H(s.on)&&H(s.off)}function ug(s){return H(s.addEventListener)&&H(s.removeEventListener)}function et(s,t,e){return e?et(s,t).pipe(Mr(e)):new st(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 H(t)?function(){return t(i,r)}:void 0})}function fg(s,t,e){s===void 0&&(s=0),e===void 0&&(e=Tp);var n=-1;return t!=null&&(rc(t)?e=t:n=t),new st(function(i){var r=qp(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 vc(){for(var s=[],t=0;t<arguments.length;t++)s[t]=arguments[t];var e=Xn(s),n=Ap(s,1/0),i=s;return i.length?i.length===1?mt(i[0]):wc(n)(Un(i,e)):ic}var dg=Array.isArray;function mg(s){return s.length===1&&dg(s[0])?s[0]:s}function Sc(s,t){return kt(function(e,n){var i=0;e.subscribe(ut(n,function(r){return s.call(t,r,i++)&&n.next(r)}))})}function Gs(){for(var s=[],t=0;t<arguments.length;t++)s[t]=arguments[t];return s=mg(s),s.length===1?mt(s[0]):new st(pg(s))}function pg(s){return function(t){for(var e=[],n=function(r){e.push(mt(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 Me(s,t){return t===void 0&&(t=Ve),s=s??gg,kt(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 gg(s,t){return s===t}function _c(s,t){return t?function(e){return e.pipe(_c(function(n,i){return mt(s(n,i)).pipe(it(function(r,o){return t(n,r,i,o)}))}))}:kt(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()}),mt(s(a,i++)).subscribe(r))},function(){o=!0,!r&&n.complete()}))})}function yg(s){s===void 0&&(s={});var t=s.connector,e=t===void 0?function(){return new Te}:t,n=s.resetOnError,i=n===void 0?!0:n,r=s.resetOnComplete,o=r===void 0?!0:r,a=s.resetOnRefCountZero,h=a===void 0?!0:a;return function(c){var l,u,d,f=0,p=!1,g=!1,C=function(){u?.unsubscribe(),u=void 0},y=function(){C(),l=d=void 0,p=g=!1},v=function(){var b=l;y(),b?.unsubscribe()};return kt(function(b,x){f++,!g&&!p&&C();var E=d=d??e();x.add(function(){f--,f===0&&!g&&!p&&(u=kr(v,h))}),E.subscribe(x),!l&&f>0&&(l=new pn({next:function(_){return E.next(_)},error:function(_){g=!0,C(),u=kr(y,i,_),E.error(_)},complete:function(){p=!0,C(),u=kr(y,o),E.complete()}}),mt(b).subscribe(l))})(c)}}function kr(s,t){for(var e=[],n=2;n<arguments.length;n++)e[n-2]=arguments[n];if(t===!0){s();return}if(t!==!1){var i=new pn({next:function(){i.unsubscribe(),s()}});return mt(t.apply(void 0,Pe([],de(e)))).subscribe(i)}}function wg(s,t,e){var n,i,r,o,a=!1;return s&&typeof s=="object"?(n=s.bufferSize,o=n===void 0?1/0:n,i=s.windowTime,t=i===void 0?1/0:i,r=s.refCount,a=r===void 0?!1:r,e=s.scheduler):o=s??1/0,yg({connector:function(){return new _p(o,t,e)},resetOnError:!0,resetOnComplete:!1,resetOnRefCountZero:a})}function qe(){for(var s=[],t=0;t<arguments.length;t++)s[t]=arguments[t];var e=Xn(s);return kt(function(n,i){(e?bc(s,n,e):bc(s,n)).subscribe(i)})}function Vs(s,t){return kt(function(e,n){var i=null,r=0,o=!1,a=function(){return o&&!i&&n.complete()};e.subscribe(ut(n,function(h){i?.unsubscribe();var c=0,l=r++;mt(s(h,l)).subscribe(i=ut(n,function(u){return n.next(t?t(h,u,l,c++):u)},function(){i=null,a()}))},function(){o=!0,a()}))})}function bg(){return Vs(Ve)}function Dr(s){return kt(function(t,e){mt(s).subscribe(ut(e,function(){return e.complete()},Yn)),!e.closed&&t.subscribe(e)})}function je(s,t,e){var n=H(s)||t||e?{next:s,error:t,complete:e}:s;return n?kt(function(i,r){var o;(o=n.subscribe)===null||o===void 0||o.call(n);var a=!0;i.subscribe(ut(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)}))}):Ve}function xg(s,t){return kt(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,l=null,u=null,d=!1,f=function(){u?.unsubscribe(),u=null,h&&(C(),d&&n.complete())},p=function(){u=null,d&&n.complete()},g=function(y){return u=mt(s(y)).subscribe(ut(n,f,p))},C=function(){if(c){c=!1;var y=l;l=null,n.next(y),!d&&g(y)}};e.subscribe(ut(n,function(y){c=!0,l=y,!(u&&!u.closed)&&(o?C():g(y))},function(){d=!0,!(h&&c&&u&&!u.closed)&&n.complete()}))})}function vg(s,t,e){t===void 0&&(t=Cr);var n=fg(s,t);return xg(function(){return n},e)}function Sg(s,t){return kt(function(e,n){var i=[],r=function(o){for(;0<i.length;)i.shift().error(o);n.error(o)};mt(s).subscribe(ut(n,function(o){var a=new Te;i.push(a);var h=new mn,c=function(){Fn(i,a),a.complete(),h.unsubscribe()},l;try{l=mt(t(o))}catch(u){r(u);return}n.next(a.asObservable()),h.add(l.subscribe(ut(n,c,Yn,r)))},Yn)),e.subscribe(ut(n,function(o){var a,h,c=i.slice();try{for(var l=Ge(c),u=l.next();!u.done;u=l.next()){var d=u.value;d.next(o)}}catch(f){a={error:f}}finally{try{u&&!u.done&&(h=l.return)&&h.call(l)}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 _g(s){return s.toElement?s.toElement:s.currentTarget?s.currentTarget:s.srcElement?s.srcElement:null}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 Cg(s,t,e,n,i=!1){return W(s||document.body,e,r=>{r.target===t&&n(r)},i)}function Eg(s){s.replaceWith(s.cloneNode(!0))}function X(s,t,e=!1){return Ir(s,t,{capture:e})}function Pg(s){const t=et(e=>s.register(e),(e,n)=>{s.unregister?.(e,...n||[])},(...e)=>[...e]);return s.share?t.pipe(wg({bufferSize:s.bufferSize||1,refCount:!0})):t}function Ae(s){if(s.preventDefault){s.preventDefault();return}try{s.returnValue=!1}catch{}}function Lr(s){if(s.stopPropagation){s.stopPropagation();return}try{s.cancelBubble=!0}catch{}}const Tg=["click","dblclick","wheel","contextmenu","mousedown","mouseup","mousemove","mouseover","mouseout","mouseenter","mouseleave"],Mg=["keydown","keyup","keypress"],Ag=["touchstart","touchend","touchcancel","touchmove"],Ig=["pointerdown","pointerup","pointercancel","pointermove"],kg=["dragstart","drag","dragend","dragenter","dragover","dragleave","drop"],Dg=["change"];function qs(s,t={bubbles:!0,detail:{}}){let e;try{const n=Object.assign({bubbles:!0,cancelable:!0,view:window,detail:1,ctrlKey:!1,altKey:!1,shiftKey:!1,metaKey:!1,button:0,relatedTarget:null},t);Tg.includes(s)?e=new MouseEvent(s,n):Mg.includes(s)?e=new KeyboardEvent(s,n):Ag.includes(s)?e=new TouchEvent(s,n):Ig.includes(s)?e=new PointerEvent(s,n):kg.includes(s)?e=new DragEvent(s,n):Dg.includes(s)?e=new Event(s,n):e=new CustomEvent(s,n)}catch{document.createEvent?e=document.createEvent("Event").initEvent(s,!0,!0):document.createEventObject&&(e=document.createEventObject())}return e}function Rr(s,t,e){if(s)if(s.dispatchEvent)s.dispatchEvent(e);else if(s.fireEvent&&document.createEventObject)s.fireEvent("on"+t,e);else throw new Error(`Can't dispatch event : ${t}`)}function Lg(s,t){const e=s.target,n=qs(t);Rr(e,t,n)}function Rg(s){const t=s.target,e="click";if(!/(SELECT|INPUT|TEXTAREA)/i.test(t.tagName)){const n=qs(e);n.view=s.view||window,n.detail=1,n.screenX=t.screenX||0,n.screenY=t.screenY||0,n.clientX=t.clientX||0,n.clientY=t.clientY||0,n.pageX=s.pageX,n.pageY=s.pageY,n.ctrlKey=!!s.ctrlKey,n.altKey=!!s.altKey,n.shiftKey=!!s.shiftKey,n.metaKey=!!s.metaKey,n.button=0,n.relatedTarget=null,n._constructed=!0,Rr(t,e,n)}}function Og(s,t){const e=s.changedTouches[0];return qs(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})}if(m.rAF=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame,m.cAF=window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||window.oCancelAnimationFrame||window.msCancelAnimationFrame,!m.rAF){let s=lt();m.rAF=t=>{const e=lt(),n=Math.max(0,16-(e-s)),i=window.setTimeout(()=>{t(e+n)},n);return s=e+n,i}}m.cAF||(m.cAF=s=>{window.clearTimeout(s)});function Or(s){let t=!1,e=m.rAF(function n(i){!t&&s(i)&&(e=m.rAF(n))});return()=>{m.cAF(e),t=!0}}function zr(s,t=0){if(t==0)return s(lt()),()=>{};{const e=lt();return Or(n=>n-e>=t?(s(n),!1):!0)}}function zg(s,t=0){let e=!1,n=0;const i=lt();let r=zr(function o(a){if(e)return;n++;const h=a-i-n*t;s(a,n,t<=h),r=zr(o,Math.max(0,t-h))},t);return()=>{r(),e=!0}}function Ng(s,t=20){const e=1e3/t;let n=0,i;return()=>(lt()-n>=e&&(n=lt(),i=s()),i)}window.requestIdleCallback=window.requestIdleCallback||function(s,t){const e=lt();return setTimeout(()=>{const n=lt()-e;s({didTimeout:!0,timeRemaining:()=>Math.max(0,50-n)})},t?.timeout)},window.cancelIdleCallback=window.cancelIdleCallback||function(s){clearTimeout(s)};function Cc(s,t){window.requestIdleCallback(e=>{e.timeRemaining()>0||e.didTimeout?s():Cc(s,t)},{timeout:t?.timeout})}let js=0,Nr=0,He=33,Ie=33,Br,Fr=-1;const Ec=new MessageChannel,Bg=Ec.port2;Ec.port1.onmessage=s=>{Br&&Br({didTimeout:Fr==-1?!1:lt()-js>Fr,timeRemaining:()=>Math.max(0,Nr-lt())})};function Fg(s,t){return Br=s,Fr=typeof t?.timeout=="number"?t?.timeout:-1,requestAnimationFrame(e=>{js=e;let n=Ie+js-Nr;n<Ie&&He<Ie?(n<8&&(n=8),Ie=n<He?He:n):n>Ie&&He>Ie?Ie=n<He?He:n:He=n,Nr=js+Ie,Bg.postMessage(null)})}const Pc=new ih({concurrency:1,timeRemaining:0});let Yr=!1;function Tc(s,t){const e=sh({fn:s,name:t?.name,deadline:typeof t?.timeout=="number"?$t()+t.timeout:void 0});Pc.addTask(e),!Yr&&(Yr=!0,Fg(n=>{Yr=!1,Pc.idleCallback(n)}))}class $n{static _nextId=0;static nextId(){return $n._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)},style:"cubic-bezier(0.25, 0.46, 0.45, 0.94)"},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)},style:"cubic-bezier(0.1, 0.57, 0.1, 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)},style:"cubic-bezier(0.175, 0.885, 0.32, 1.275)"},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 Mc(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 Yg=4,Xg=.001,Ug=1e-7,$g=10,Gn=11,Hs=1/(Gn-1),Gg=typeof Float32Array=="function";function Ac(s,t){return 1-3*t+3*s}function Ic(s,t){return 3*t-6*s}function kc(s){return 3*s}function Ws(s,t,e){return((Ac(t,e)*s+Ic(t,e))*s+kc(t))*s}function Dc(s,t,e){return 3*Ac(t,e)*s*s+2*Ic(t,e)*s+kc(t)}function Vg(s,t,e,n,i){let r,o,a=0;do o=t+(e-t)/2,r=Ws(o,n,i)-s,r>0?e=o:t=o;while(Math.abs(r)>Ug&&++a<$g);return o}function qg(s,t,e,n){for(let i=0;i<Yg;++i){const r=Dc(t,e,n);if(r===0)return t;const o=Ws(t,e,n)-s;t-=o/r}return t}function jg(s){return s}function Xr(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 jg;const i=Gg?new Float32Array(Gn):new Array(Gn);for(let o=0;o<Gn;++o)i[o]=Ws(o*Hs,s,e);function r(o){let a=0,h=1;const c=Gn-1;for(;h!==c&&i[h]<=o;++h)a+=Hs;--h;const l=(o-i[h])/(i[h+1]-i[h]),u=a+l*Hs,d=Dc(u,s,e);return d>=Xg?qg(o,u,s,e):d===0?u:Vg(o,a,a+Hs,s,e)}return o=>o===0||o===1?o:Ws(r(o),t,n)}function Ur(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 Lc(s){const[t,e,n,i]=Ur(s);return[1-n,1-i,1-t,1-e]}function Hg(s){return Xr(...Ur(s))}function Wg(s){return Xr(...Lc(s))}const pe={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=pe.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=pe.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=pe.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=pe.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=lt(),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 Gt=new Rc;class $r{constructor(t,e=Gt){this._object=t,this._group=e}_id=$n.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=pe.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=lt()){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 l=n[r];if(l.length===0)continue;l=l.map(this._handleRelativeValue.bind(this,o)),n[r]=[o].concat(l)}if((h==="object"||a)&&o&&!c){e[r]=a?[]:{};for(const l in o)e[r][l]=o[l];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=lt()){return this._isPaused||!this._isPlaying?this:(this._isPaused=!0,this._pauseStartTime=t,this._group&&this._group.remove(this),this)}resume(t=lt()){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=Gt){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=pe.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=lt(),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 Jg=$n.nextId,Zg=Gt.getAll.bind(Gt),Kg=Gt.removeAll.bind(Gt),Qg=Gt.add.bind(Gt),t0=Gt.remove.bind(Gt),e0=Gt.update.bind(Gt),n0={now:lt,Sequence:$n,Easing:O,Interpolation:pe,Group:Rc,Tween:$r,nextId:Jg,getAll:Zg,removeAll:Kg,add:Qg,remove:t0,update:e0};class Gr{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=lt(),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=lt();t=e-this.oldTime,this.oldTime=e,this.elapsedTime+=t}return t}}class Vn{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){cd(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||pe.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 Gr,n=this.frameDuration;return new Promise(i=>{this.onGroupStart?.(),this.cancelRequestAnimationCycle=Or(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 $r({...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(),Ba(t,c))})}const o=!!t.length;return o||(this.onGroupComplete?.(),i()),o})})}isPaused=!1;pausedClock=new Gr;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=Mc(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 qn=new Gf({objectSignature:s=>s.name});function Vr(s,t=qn){let e=t?.find(n=>n.el==s);return e||(e=fi(s),t.put(e),e)}function Js(s,t,e=qn){const n=Vr(s,e);n.alternate||(n.alternate=fi(s),cn(n.alternate.props,n.props,!0)),t(n.alternate)}function Oc(s=qn){s.update(t=>{const e=t.alternate;return e&&(di(t,e),t.props=e.props,t.alternate=void 0),!0})}function s0(s=qn){Oc(s)}function qr(s=qn){Tc(()=>Oc(s),{name:"PATCH_VNODES",timeout:50})}function i0(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 zc(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 r0=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 l=t<<2;let u=e;const d=String.fromCharCode;do{const p=l*(u-1);let g="";for(let C=0;C<t;C++){const y=C<<2;g+=d(h[p+y+2])+d(h[p+y+1])+d(h[p+y])}for(let C=0;C<a;C++)g+=String.fromCharCode(0);c+=g}while(--u);function f(p){if(!window.btoa)throw"btoa undefined";let g="";if(typeof p=="string")g=p;else for(let C=0;C<p.length;C++)g+=String.fromCharCode(p[C]);return btoa(g)}return f(r.concat(o))+f(c)};function o0(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 a0=(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 h0(s,t){return createImageBitmap(s,t)}function c0(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=jr(t),o=jr(e),a=jr(n);return"rgb("+r+","+o+","+a+")"}function jr(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 l0=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)},u0=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)},f0=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)},d0=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)},m0=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)},p0=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)},g0=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,l=(t[h]+t[h+1]+t[h+2])/3>127?255:0;i[h]=l,i[h+1]=l,i[h+2]=l,i[h+3]=t[h+3]}return new ImageData(i,e,n)},y0=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)},w0=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)},b0=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)},x0=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)},v0=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)},S0=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)},_0=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)},C0=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)},E0=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)},P0=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)},T0=s=>Nc(s,[-1,-1,-1,-1,9,-1,-1,-1,-1]),M0=s=>Nc(s,[-1,-1,-1,-1,8,-1,-1,-1,-1]),A0=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)},I0=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=Bc([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 k0(s,t,e,n,i,r=!1,o){const{data:a,width:h,height:c}=s;let l=i,u=n,d=t,f=e;if(l<0?l=0:l>h&&(l=h),u<0?u=0:u>c&&(u=c),d<1?d=1:d>h&&(d=h),f<1?f=1:f>c&&(f=c),l+d>h&&(d=h-l),u+f>c&&(f=c-u),r){const p=new Uint8ClampedArray(a.length);for(let C=0;C<c;C++)for(let y=0;y<h;y++){const v=(C*h+y)*4;y>=l&&y<=l+d&&C>=u&&C<=u+f?(p[v]=a[v],p[v+1]=a[v+1],p[v+2]=a[v+2],p[v+3]=a[v+3]):(p[v]=255,p[v+1]=255,p[v+2]=255,p[v+3]=o&&["JPG","JPEG"].includes(o.toUpperCase())?255:0)}return new ImageData(p,h,c)}else{const p=new Uint8ClampedArray(d*f*4);for(let C=u;C<=u+f;C++)for(let y=l;y<=l+d;y++){const v=((C-u)*d+y-l)*4,b=(C*h+y)*4;p[v]=a[b],p[v+1]=a[b+1],p[v+2]=a[b+2],p[v+3]=a[b+3]}return new ImageData(p,d,f)}}function D0(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 l=0;l<o;l++)for(let u=0;u<r;u++){const d=(l*r+u)*4;let f=-1;u<a?l<a?f=Math.sqrt(Math.pow(a-u-1,2)+Math.pow(a-l-1,2)):l>o-a-1&&(f=Math.sqrt(Math.pow(a-u-1,2)+Math.pow(l-(o-a),2))):u>r-a-1&&(l<a?f=Math.sqrt(Math.pow(u-(r-a),2)+Math.pow(a-l-1,2)):l>o-a-1&&(f=Math.sqrt(Math.pow(u-(r-a),2)+Math.pow(l-(o-a),2)))),Math.round(f)>a?(h[d]=255,h[d+1]=255,h[d+2]=255,h[d+3]=n||e.toUpperCase()==="PNG"?0:255):(h[d]=i[d],h[d+1]=i[d+1],h[d+2]=i[d+2],h[d+3]=n||e.toUpperCase()==="PNG"?i[d+3]:255)}return new ImageData(h,r,o)}function L0(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 R0(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 O0(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 l=(h*i+c)*4;n[l+3]===0?(o[l]=255,o[l+1]=255,o[l+2]=255):(o[l]=n[l],o[l+1]=n[l+1],o[l+2]=n[l+2]);let u=n[l+3];e?u=Math.max(Math.min(Math.floor(255*t),255),0):u=Math.max(Math.min(Math.floor(u+255*t),255),0),o[l+3]=u}return new ImageData(o,i,r)}function z0(s,t,e,n){const{data:i,width:r,height:o}=s,{data:a,width:h,height:c}=t;let l=e,u=n;e+c>o&&(l=o-c),n+h>r&&(u=r-h);const d=new Uint8ClampedArray(i.length);for(let p=0;p<o;p++)for(let g=0;g<r;g++){const C=(p*r+g)*4;if(g<u||g>u+h||p<=l||p>=l+c)d[C]=i[C],d[C+1]=i[C+1],d[C+2]=i[C+2],d[C+3]=i[C+3];else{const y=(p*r+g-((l+1)*r+(p-(l+1))*(r-h))+h-u-1)*4,v=[a[y],a[y+1],a[y+2],a[y+3]],b=[i[C],i[C+1],i[C+2],i[C+3]],x=Bc(v,b);d[C]=x[0],d[C+1]=x[1],d[C+2]=x[2],d[C+3]=x[3]}}return new ImageData(d,r,o)}function N0(s,t,e,n,i,r=10){const{data:o,width:a,height:h}=s;let c=i,l=n,u=t,d=e;c<0?c=0:c>a&&(c=a),l<0?l=0:l>h&&(l=h),u<1?u=1:u>a&&(u=a),d<1?d=1:d>h&&(d=h),c+u>a&&(u=a-c),l+d>h&&(d=h-l);const f=new Uint8ClampedArray(o.length);for(let g=0;g<h;g++)for(let C=0;C<a;C++){const y=(g*a+C)*4;if(C>=c&&C<=c+u&&g>=l&&g<=l+d){const v=Math.floor((C-c)/r),b=Math.floor((g-l)/r);let x=Math.floor(r*(v+1)-r/2+c),E=Math.floor(r*(b+1)-r/2+l);x>a-1&&(x=a-1),E>h-1&&(E=h-1);const _=(E*a+x)*4;f[y]=o[_],f[y+1]=o[_+1],f[y+2]=o[_+2],f[y+3]=o[_+3]}else f[y]=o[y],f[y+1]=o[y+1],f[y+2]=o[y+2],f[y+3]=o[y+3]}return new ImageData(f,a,h)}function B0(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 u=0;u<r;u++)for(let d=0;d<i;d++){const f=(u*i+d)*4,p=o[f],g=o[f+1],C=o[f+2],y=o[f+3];p===h.r&&g===h.g&&C===h.b&&y===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 Nc(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 l=0;l<3;l++){const u=c+l;h===0||h===n-1||a===0||a===i-1?r[u]=e[u]:r[u]=t[0]*e[u-n*4-4]+t[1]*e[u-n*4]+t[2]*e[u-n*4+4]+t[3]*e[u-4]+t[4]*e[u]+t[5]*e[u+4]+t[6]*e[u+n*4-4]+t[7]*e[u+n*4]+t[8]*e[u+n*4+4]}r[c+3]=e[c+3]}return new ImageData(r,n,i)}function Bc(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 Hr=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}}},Fc=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}}},Yc=function(s,t,e){const n=new Array(s*s),i=function(a){const h=a;let c=0,l=0;return{write(u,d){if(u>>>d)throw new Error("length over");for(;c+d>=8;)h.writeByte(255&(u<<c|l)),d-=8-c,u>>>=8-c,l=0,c=0;l=u<<c|l,c=c+d},flush(){c>0&&h.writeByte(l)}}},r=function(a){const h=1<<a,c=(1<<a)+1;let l=a+1;const u=o();for(let C=0;C<h;C++)u.add(String.fromCharCode(C));u.add(String.fromCharCode(h)),u.add(String.fromCharCode(c));const d=Hr(),f=i(d);f.write(h,l);let p=0,g=String.fromCharCode(n[p]);for(p+=1;p<n.length;){const C=String.fromCharCode(n[p]);p+=1,u.contains(g+C)?g=g+C:(f.write(u.indexOf(g),l),u.size()<4095&&(u.size()==1<<l&&(l+=1),u.add(g+C)),g=C)}return f.write(u.indexOf(g),l),f.write(c,l),f.flush(),d.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(ln("0x"+t[1]+t[2])),a.writeByte(ln("0x"+t[3]+t[4])),a.writeByte(ln("0x"+t[5]+t[6])),a.writeByte(ln("0x"+e[1]+e[2])),a.writeByte(ln("0x"+e[3]+e[4])),a.writeByte(ln("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 l=0;for(;c.length-l>255;)a.writeByte(255),a.writeBytes(c,l,255),l+=255;a.writeByte(c.length-l),a.writeBytes(c,l,c.length-l),a.writeByte(0),a.writeString(";")}}},Xc=function(s,t,e,n){const i=Yc(s,t,e);for(let c=0;c<s;c++)for(let l=0;l<s;l++)i.setPixel(l,c,n(l,c));const r=Hr();i.write(r);const o=Fc(),a=r.toByteArray();for(let c=0,l=a.length;c<l;c++)o.writeByte(a[c]);o.flush();let h="";return h+="data:image/gif;base64,",h+=o,h},zt={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},jn={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},pt={glog:function(s){if(s<1)throw new Error("glog("+s+")");return pt.LOG_TABLE[s]},gexp:function(s){for(;s<0;)s+=255;for(;s>=256;)s-=255;return pt.EXP_TABLE[s]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)};for(let s=0;s<8;s++)pt.EXP_TABLE[s]=1<<s;for(let s=8;s<256;s++)pt.EXP_TABLE[s]=pt.EXP_TABLE[s-4]^pt.EXP_TABLE[s-5]^pt.EXP_TABLE[s-6]^pt.EXP_TABLE[s-8];for(let s=0;s<255;s++)pt.LOG_TABLE[pt.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 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,pt.gexp(e)],0));return t},getLengthInBits:function(s,t){if(1<=t&&t<10)switch(s){case zt.MODE_NUMBER:return 10;case zt.MODE_ALPHA_NUM:return 9;case zt.MODE_8BIT_BYTE:return 8;case zt.MODE_KANJI:return 8;default:throw new Error("mode:"+s)}else if(t<27)switch(s){case zt.MODE_NUMBER:return 12;case zt.MODE_ALPHA_NUM:return 11;case zt.MODE_8BIT_BYTE:return 16;case zt.MODE_KANJI:return 10;default:throw new Error("mode:"+s)}else if(t<41)switch(s){case zt.MODE_NUMBER:return 14;case zt.MODE_ALPHA_NUM:return 13;case zt.MODE_8BIT_BYTE:return 16;case zt.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 l=-1;l<=1;l++)o+l<0||t<=o+l||c==0&&l==0||h==s.isDark(r+c,o+l)&&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]^=pt.gexp(pt.glog(this.get(n))+pt.glog(t.get(i)));return new gn(e,0)}mod(t){if(this.getLength()-t.getLength()<0)return this;const e=pt.glog(this.get(0))-pt.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]^=pt.gexp(pt.glog(t.get(i))+e);return new gn(n,0).mod(t)}}class ge{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=ge.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 l=0;l<a;l++)r.push(new ge(h,c))}return r}static getRsBlockTable(t,e){switch(e){case jn.L:return ge.RS_BLOCK_TABLE[(t-1)*4+0];case jn.M:return ge.RS_BLOCK_TABLE[(t-1)*4+1];case jn.Q:return ge.RS_BLOCK_TABLE[(t-1)*4+2];case jn.H:return ge.RS_BLOCK_TABLE[(t-1)*4+3];default:return}}}class Uc{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 F0{mode;data;constructor(t){this.mode=zt.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 De{static PAD0=236;static PAD1=17;typeNumber;errorCorrectLevel;modules;moduleCount;dataCache;dataList;constructor(t,e){this.typeNumber=t,this.errorCorrectLevel=jn[e],this.modules=[],this.moduleCount=0,this.dataCache=null,this.dataList=[]}addData(t){const e=new F0(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=ge.getRSBlocks(t,this.errorCorrectLevel),n=new Uc;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=De.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 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=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 h=0;h<2;h++)if(this.modules[i][a-h]==null){let c=!1;o<t.length&&(c=(t[o]>>>r&1)==1),K.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=ge.getRSBlocks(t,e),r=new Uc;for(let a=0;a<n.length;a++){const h=n[a];r.put(h.mode,4),r.put(h.getLength(),K.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(De.PAD0,8),r.getLengthInBits()>=o*8));)r.put(De.PAD1,8);return De.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 u=0;u<e.length;u++){const d=e[u].dataCount,f=e[u].totalCount-d;i=Math.max(i,d),r=Math.max(r,f),o[u]=new Array(d);for(let y=0;y<o[u].length;y++)o[u][y]=255&t.buffer[y+n];n+=d;const p=K.getErrorCorrectPolynomial(f),C=new gn(o[u],p.getLength()-1).mod(p);a[u]=new Array(p.getLength()-1);for(let y=0;y<a[u].length;y++){const v=y+C.getLength()-a[u].length;a[u][y]=v>=0?C.get(v):0}}let h=0;for(let u=0;u<e.length;u++)h+=e[u].totalCount;const c=new Array(h);let l=0;for(let u=0;u<i;u++)for(let d=0;d<e.length;d++)u<o[d].length&&(c[l++]=o[d][u]);for(let u=0;u<r;u++)for(let d=0;d<e.length;d++)u<a[d].length&&(c[l++]=a[d][u]);return c}}const $c=Math.ceil,Hn=Math.floor,Gc=Math.round;function Y0(s,t){const e=ka(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 De(r,n);c.addData(e),c.make();const l=c.getModuleCount(),u=(i-o*2)/l,d=o,f=i-o;return Xc(i,a,h,function(p,g){if(d<=p&&p<f&&d<=g&&g<f){const C=Hn((p-d)/u),y=Hn((g-d)/u);return c.isDark(y,C)?0:1}else return 1})}function X0(s,t){const e=t.x||0,n=t.y||0,i=ka(s),r=t.ctx,o=t.ecc||"H",a=typeof t.size=="number"?Hn(t.size):256,h=t.padding||0,c=-1,l=t.color||"#000000",u=t.background||"#ffffff",d=new De(c,o);d.addData(i),d.make();const f=d.getModuleCount(),p=(a-h*2)/f;r.fillStyle=u,r.fillRect(e,n,a,a);for(let g=0;g<f;g++)for(let C=0;C<f;C++){const y=$c((C+1)*p)-Hn(C*p),v=$c((g+1)*p)-Hn(g*p);r.fillStyle=d.isDark(g,C)?l:u,r.fillRect(e+Gc(C*p)+h,n+Gc(g*p)+h,y,v)}}function q(s){return s*Math.PI/180}function gt(s){return s*180/Math.PI}function yn(s,t,e=0){return Math.sqrt(s*s+t*t+e*e)}function Le(s,t,e,n){return yn(e-s,n-t)}function Nt(s,t,e,n){let i=Math.atan2(n-t,e-s);return i<0&&(i+=Math.PI*2),i}function Re(s,t){return{dx:Math.cos(s)*t,dy:Math.sin(s)*t}}function U0(s,t,e){if(typeof e=="number"){const n=yn(s,t,e);return{x:s/=n,y:t/=n,z:e/=n}}else{const n=yn(s,t);return{x:s/=n,y:t/=n}}}function $0(s,t,e,n,i=10){if(Math.abs(e-s)<i&&Math.abs(n-t)<i)return"no";const r=gt(Nt(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"}class Wr{_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],l=n[i+2],u=n[i+3];const d=r[o+0],f=r[o+1],p=r[o+2],g=r[o+3];if(a===0){t[e+0]=h,t[e+1]=c,t[e+2]=l,t[e+3]=u;return}if(a===1){t[e+0]=d,t[e+1]=f,t[e+2]=p,t[e+3]=g;return}if(u!==g||h!==d||c!==f||l!==p){let C=1-a;const y=h*d+c*f+l*p+u*g,v=y>=0?1:-1,b=1-y*y;if(b>Number.EPSILON){const E=Math.sqrt(b),_=Math.atan2(E,y*v);C=Math.sin(C*_)/E,a=Math.sin(a*_)/E}const x=a*v;if(h=h*C+d*x,c=c*C+f*x,l=l*C+p*x,u=u*C+g*x,C===1-a){const E=1/Math.sqrt(h*h+c*c+l*l+u*u);h*=E,c*=E,l*=E,u*=E}}t[e]=h,t[e+1]=c,t[e+2]=l,t[e+3]=u}static multiplyQuaternionsFlat(t,e,n,i,r,o){const a=n[i],h=n[i+1],c=n[i+2],l=n[i+3],u=r[o],d=r[o+1],f=r[o+2],p=r[o+3];return t[e]=a*p+l*u+h*f-c*d,t[e+1]=h*p+l*d+c*u-a*f,t[e+2]=c*p+l*f+a*d-h*u,t[e+3]=l*p-a*u-h*d-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 Wr(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),l=a(i/2),u=a(r/2),d=h(n/2),f=h(i/2),p=h(r/2);switch(o){case"XYZ":this._x=d*l*u+c*f*p,this._y=c*f*u-d*l*p,this._z=c*l*p+d*f*u,this._w=c*l*u-d*f*p;break;case"YXZ":this._x=d*l*u+c*f*p,this._y=c*f*u-d*l*p,this._z=c*l*p-d*f*u,this._w=c*l*u+d*f*p;break;case"ZXY":this._x=d*l*u-c*f*p,this._y=c*f*u+d*l*p,this._z=c*l*p+d*f*u,this._w=c*l*u-d*f*p;break;case"ZYX":this._x=d*l*u-c*f*p,this._y=c*f*u+d*l*p,this._z=c*l*p-d*f*u,this._w=c*l*u+d*f*p;break;case"YZX":this._x=d*l*u+c*f*p,this._y=c*f*u+d*l*p,this._z=c*l*p-d*f*u,this._w=c*l*u-d*f*p;break;case"XZY":this._x=d*l*u-c*f*p,this._y=c*f*u-d*l*p,this._z=c*l*p+d*f*u,this._w=c*l*u+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],h=e[9],c=e[2],l=e[6],u=e[10],d=n+a+u;if(d>0){const f=.5/Math.sqrt(d+1);this._w=.25/f,this._x=(l-h)*f,this._y=(r-c)*f,this._z=(o-i)*f}else if(n>a&&n>u){const f=2*Math.sqrt(1+n-a-u);this._w=(l-h)/f,this._x=.25*f,this._y=(i+o)/f,this._z=(r+c)/f}else if(a>u){const f=2*Math.sqrt(1+a-n-u);this._w=(r-c)/f,this._x=(i+o)/f,this._y=.25*f,this._z=(h+l)/f}else{const f=2*Math.sqrt(1+u-n-a);this._w=(o-i)/f,this._x=(r+c)/f,this._y=(h+l)/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,h=e._y,c=e._z,l=e._w;return this._x=n*l+o*a+i*c-r*h,this._y=i*l+o*h+r*a-n*c,this._z=r*l+o*c+n*h-i*a,this._w=o*l-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),l=Math.atan2(c,a),u=Math.sin((1-e)*l)/c,d=Math.sin(e*l)/c;return this._w=o*u+this._w*d,this._x=n*u+this._x*d,this._y=i*u+this._y*d,this._z=r*u+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 Wn{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 Wn(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 Vc.copy(this).projectOnVector(t),this.sub(Vc)}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(qc.setFromEuler(t))}applyAxisAngle(t,e){return this.applyQuaternion(qc.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),l=2*(a*e-r*i),u=2*(r*n-o*e);return this.x=e+h*c+o*u-a*l,this.y=n+h*l+a*c-r*u,this.z=i+h*u+r*l-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=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,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 Zr.copy(this).projectOnVector(t),this.sub(Zr)}projectOnPlane(t){return this.perpendOnVector(t)}reflect(t){return this.sub(Zr.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 Jr{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 Jr(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],l=h[4],u=h[8],d=h[1],f=h[5],p=h[9],g=h[2],C=h[6],y=h[10];if(Math.abs(l-d)<.01&&Math.abs(u-g)<.01&&Math.abs(p-C)<.01){if(Math.abs(l+d)<.1&&Math.abs(u+g)<.1&&Math.abs(p+C)<.1&&Math.abs(c+f+y-3)<.1)return this.set(1,0,0,0),this;e=Math.PI;const b=(c+1)/2,x=(f+1)/2,E=(y+1)/2,_=(l+d)/4,L=(u+g)/4,N=(p+C)/4;return b>x&&b>E?b<.01?(n=0,i=.707106781,r=.707106781):(n=Math.sqrt(b),i=_/n,r=L/n):x>E?x<.01?(n=.707106781,i=0,r=.707106781):(i=Math.sqrt(x),n=_/i,r=N/i):E<.01?(n=.707106781,i=.707106781,r=0):(r=Math.sqrt(E),n=L/r,i=N/r),this.set(n,i,r,e),this}let v=Math.sqrt((C-p)*(C-p)+(u-g)*(u-g)+(d-l)*(d-l));return Math.abs(v)<.001&&(v=1),this.x=(C-p)/v,this.y=(u-g)/v,this.z=(d-l)/v,this.w=Math.acos((c+f+y-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 Vc=new Wn,Zr=new Bt,qc=new Wr,jc=G0("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 G0(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 V0(s){const t={left:"start",right:"end",center:"middle",start:"start",end:"end"};return t[s]||t.start}function q0(s){const t={alphabetic:"alphabetic",hanging:"hanging",top:"text-before-edge",bottom:"text-after-edge",middle:"central"};return t[s]||t.alphabetic}const Jn={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 Ks=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)}},Kr=class{__root;__ctx;constructor(t,e){this.__root=t,this.__ctx=e}},Hc=class Ca{__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(Jn);for(let e=0,n=t.length;e<n;e++){const i=t[e];this[i]=Jn[i].canvas}}__getStyleState(){const t={},e=Object.keys(Jn);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(Jn);for(let r=0;r<i.length;r++){const o=Jn[i[r]],a=this[i[r]];if(o.apply){if(a instanceof Kr){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 Ks)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 l=parseFloat(c[4]);const u=this.globalAlpha;u!=null&&(l*=u),e.setAttribute(o.svgAttr+"-opacity",""+l)}}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(jc);for(let r=0,o=i.length;r<o;r++){const a=i[r],h=jc[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 l=h[0]*c[0]+h[1]*c[1],u=Math.acos(Math.abs(l)),d=this.normalize([h[0]+c[0],h[1]+c[1]]),f=r/Math.sin(u/2),p=t+f*d[0],g=e+f*d[1],C=[-h[1],h[0]],y=[c[1],-c[0]],v=function(E){const _=E[0];return E[1]>=0?Math.acos(_):-Math.acos(_)},b=v(C),x=v(y);this.lineTo(p+C[0]*r,g+C[1]*r),this.arc(p,g,r,b,x)}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 Ks(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 Ks(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":V0(this.textAlign),"dominant-baseline":q0(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),l=e+n*Math.sin(i),u=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(c,l),this.__addPathCommand(Pt("A {rx} {ry} {xAxisRotation} {largeArcFlag} {sweepFlag} {endX} {endY}",{rx:n,ry:n,xAxisRotation:0,largeArcFlag:d,sweepFlag:u,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,l,u,d,f,p,g,C;if(t.length===3)n=t[1],i=t[2],c=e.width,l=e.height,r=c,o=l;else if(t.length===5)n=t[1],i=t[2],r=t[3],o=t[4],c=e.width,l=e.height;else if(t.length===9)a=t[1],h=t[2],c=t[3],l=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 y=this.__closestGroupOrSvg();this.__currentElement;const v="translate("+n+", "+i+")";if(e instanceof Ca){if(u=e.getSvg().cloneNode(!0),u.childNodes&&u.childNodes.length>1){for(d=u.childNodes[0];d.childNodes.length;)C=d.childNodes[0].getAttribute("id"),this.__ids[C]=C,this.__SVGdefs.appendChild(d.childNodes[0]);if(f=u.childNodes[1],f){const b=f.getAttribute("transform");let x;b?x=b+" "+v:x=v,f.setAttribute("transform",x),y.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||l!==e.height)&&(g=this.__document.createElement("canvas"),g.width=r,g.height=o,g.getContext("2d")?.drawImage(e,a,h,c,l,0,0,r,o),e=g),p.setAttribute("transform",v),p.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",e.nodeName==="CANVAS"?e.toDataURL():e.getAttribute("src")),y.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 Ca&&(n.setAttribute("width",""+t.width),n.setAttribute("height",""+t.height),n.appendChild(t.__rootSVG.childNodes[1]),this.__SVGdefs.appendChild(n)),new Kr(n,this)}setLineDash(t){t&&t.length>0?this.lineDash=t.join(","):this.lineDash=null}drawFocusRing(){}createImageData(){}getImageData(){}putImageData(){}globalCompositeOperation(){}setTransform(){}},Qr=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,l])=>{h.addColorStop(parseFloat(c),l)}),h}drawImage(t,...e){if(e.length===0)this.context.drawImage(t,0,0);else if(e.length===2){const 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],l=e[7];this.context.drawImage(t,n,i,r,o,a,h,c,l)}else throw new Error("Invalid number of arguments passed to drawImage: "+e.length);return this.customContext&&this.customContext.drawImage(t,...e),this}getImageData(t=0,e=0,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}}},to=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=Nt(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 l=(-c*i+r+h*e-n)/(h-c),u=h*(l-e)+n;return isNaN(l)||isNaN(u)?null:{x:l,y:u}}};const j0=class extends to{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 l=a/180*Math.PI,u=(t-n)/2,d=(e-i)/2,f=Math.cos(l)*u+Math.sin(l)*d,p=-Math.sin(l)*u+Math.cos(l)*d,g=f*f/(r*r)+p*p/(o*o);if(g>1){const V=Math.sqrt(g);throw r=V*r,o=V*o,new Error(`Radii are too small to build an arc. Correcting them to ${r}/${o}.`)}const C=Math.sqrt((r*r*o*o-r*r*p*p-o*o*f*f)/(r*r*p*p+o*o*f*f)),y=h!=c?1:-1,v=y*C*r*p/o,b=y*C*-o*f/r,x=(t+n)/2,E=(e+i)/2,_=Math.cos(l)*v-Math.sin(l)*b+x,L=Math.sin(l)*v+Math.cos(l)*b+E,N=(V,J,rt,tt)=>(V*tt>=J*rt?1:-1)*Math.acos((V*rt+J*tt)/(Math.sqrt(V*V+J*J)*Math.sqrt(rt*rt+tt*tt))),Y=N(1,0,t-_,e-L)-l,G=N(t-_,e-L,n-_,i-L);return[_,L,r,o,l,Y,Y+G]}},H0=class extends to{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}}},Oe=class ps extends to{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 l=[],u=c.length;for(let p=0;p<u;p++){for(let g=p+1;g<u;g++)c[p].X===c[g].X&&c[p].Y===c[g].Y&&(g=++p);l.push({X:c[p].X,Y:c[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:l}}interpolate(t){return{x:Math.pow(1-t,3)*this.x+3*Math.pow(1-t,2)*t*this.c1x+3*Math.pow(1-t,1)*Math.pow(t,2)*this.c2x+Math.pow(t,3)*this.toX,y:Math.pow(1-t,3)*this.y+3*Math.pow(1-t,2)*t*this.c1y+3*Math.pow(1-t,1)*Math.pow(t,2)*this.c2y+Math.pow(t,3)*this.toY}}static base3(t,e,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 l=c/2,u=[-.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 g=l*u[p]+l,C=this.base3(g,t,n,r,a),y=this.base3(g,e,i,o,h);f+=d[p]*Math.sqrt(C*C+y*y)}return l*f}length(t=1){return ps.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||ps.bezlen(e,n,i,r,o,a,h,c)<t)return 0;const l=1;let u=l/2,d=l-u,f=ps.bezlen(e,n,i,r,o,a,h,c,d);for(;Math.abs(f-t)>.01;)u/=2,d+=(f<t?1:-1)*u,f=ps.bezlen(e,n,i,r,o,a,h,c,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,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,l=this.x+2*e*(this.c1x-this.x)+o*(this.c2x-2*this.c1x+this.x),u=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,g=n*this.y+e*this.c1y,C=n*this.c2x+e*this.toX,y=n*this.c2y+e*this.toY,v=90-Math.atan2(l-d,u-f)*180/Math.PI;return{x:h,y:c,m:{x:l,y:u},n:{x:d,y:f},start:{x:p,y:g},end:{x:C,y},alpha:v}}},Zn=Math.PI*2;function Wc(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 W0(s,t,e,n,i,r,o,a,h,c){const l=c*(s-e)/2+h*(t-n)/2,u=-h*(s-e)/2+c*(t-n)/2,d=o*o,f=a*a,p=l*l,g=u*u;let C=d*f-d*g-f*p;C<0&&(C=0),C/=d*g+f*p,C=Math.sqrt(C)*(i===r?-1:1);const y=C*o/a*u,v=C*-a/o*l,b=c*y-h*v+(s+e)/2,x=h*y+c*v+(t+n)/2,E=(l-y)/o,_=(u-v)/a,L=(-l-y)/o,N=(-u-v)/a,Y=Wc(1,0,E,_);let G=Wc(E,_,L,N);return r===0&&G>0&&(G-=Zn),r===1&&G<0&&(G+=Zn),[b,x,Y,G]}function J0(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 Jc(s,t,e,n,i,r,o,a,h){const c=Math.sin(h*Zn/360),l=Math.cos(h*Zn/360),u=l*(s-e)/2+c*(t-n)/2,d=-c*(s-e)/2+l*(t-n)/2;if(u===0&&d===0)return[];if(o===0||a===0)return[];o=Math.abs(o),a=Math.abs(a);const f=u*u/(o*o)+d*d/(a*a);f>1&&(o*=Math.sqrt(f),a*=Math.sqrt(f));const p=W0(s,t,e,n,i,r,o,a,c,l),g=[];let C=p[2],y=p[3];const v=Math.max(Math.ceil(Math.abs(y)/(Zn/4)),1);y/=v;for(let b=0;b<v;b++)g.push(J0(C,y)),C+=y;return g.map(b=>{for(let x=0;x<b.length;x+=2){let E=b[x+0],_=b[x+1];E*=o,_*=a;const L=l*E-c*_,N=c*E+l*_;b[x+0]=L+p[0],b[x+1]=N+p[1]}return b})}function eo(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 Kn(s,t,e,n){return[s,t,e,n,e,n]}const Qn={a:7,c:6,s:4,q:4,t:2,m:2,l:2,h:1,v:1,z:0};class We{static createSVGElement(t="path",e){const n=document.createElementNS.call(document,"http://www.w3.org/2000/svg",t);return e&&we(n,e),n}static createSvgPath(t,e){return this.createSVGElement("path",{d:t,id:e||In()})}static downloadFromSVGElement(t,e="shape"){return ni(mr(t),`${e}.svg`)}static downloadFromSVGString(t,e="shape"){return ni(Bi(t),`${e}.svg`)}static getSVGRawStringFromElement(t){return dr(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 We.isSVGPath(t)&&t.replace(/([mlhvzaqtcs])([^mlhvzaqtcs]*)/gi,(n,i,r)=>{let o=i.toLowerCase();const a=zi(r);for(o=="m"&&a.length>Qn[o]&&(e.push([i,...a.splice(0,Qn[o])]),o="l",i=i=="m"?"l":"L");a.length;){if(a.length<Qn[o])throw new Error(`parseSVGPath substring:{ ${n} } command:{ ${i} } args:{ ${a} }`);e.push([i,...a.splice(0,Qn[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,l=0,u;for(let d=0,f=t.length;d<f;d++){let p=t[d];const g=p[0];switch(g){case"M":n=p[1],i=p[2];break;case"A":const C=Jc(r,o,p[6],p[7],p[4],p[5],p[1],p[2],p[3]);if(!C.length)continue;C.forEach((b,x)=>{const[E,_,L,N,Y,G,V,J]=b;p=["C",L,N,Y,G,V,J],x<C.length-1&&e.push(p)});break;case"S":let y=r,v=o;(u=="C"||u=="S")&&(y+=y-c,v+=v-l),p=["C",y,v,p[1],p[2],p[3],p[4]];break;case"T":u=="Q"||u=="T"?(a=r*2-a,h=o*2-h):(a=r,h=o),p=["C",...eo(r,o,a,h,p[1],p[2])];break;case"Q":a=p[1],h=p[2],p=["C",...eo(r,o,p[1],p[2],p[3],p[4])];break;case"L":p=["C",...Kn(r,o,p[1],p[2])];break;case"H":p=["C",...Kn(r,o,p[1],o)];break;case"V":p=["C",...Kn(r,o,r,p[1])];break;case"Z":p=["C",...Kn(r,o,n,i)];break}u=g,r=p[p.length-2],o=p[p.length-1],p.length>4?(c=p[p.length-4],l=p[p.length-3]):(c=r,l=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 Z0=class Ce{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(We.parseSVGPath(t),e):t instanceof Ce?this.resetFromSVGPathData(t.toSVGPathData(),e):this.resetFromSVGPathData(t||[],e)}resetFromSVGPathData(t,e){this.normalizedLines=[];const n=We.normalizeSVGPath(We.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 Oe({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 Ce;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 Oe({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 Ce;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 j0){Jc(this.prevPathX,this.prevPathY,t.toX,t.toY,t.largeArcFlag,t.sweepFlag,t.rx,t.ry,t.xAxisRotate).forEach(c=>{const[l,u,d,f,p,g,C,y]=c;this.normalizedLines.push(new Oe({x:this.prevPathX,y:this.prevPathY,c1x:d,c1y:f,c2x:p,c2y:g,toX:C,toY:y})),this.prevPathX=C,this.prevPathY=y});return}let e,n,i,r,o,a;t instanceof Oe?(e=t.c1x,n=t.c1y,i=t.c2x,r=t.c2y,o=t.toX,a=t.toY):t instanceof H0?[e,n,i,r,o,a]=eo(this.prevPathX,this.prevPathY,t.cx,t.cy,t.toX,t.toY):[e,n,i,r,o,a]=Kn(this.prevPathX,this.prevPathY,t.toX,t.toY),this.normalizedLines.push(new Oe({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 We.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 bt;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,l=r.c2x,u=r.c2y,d=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:l,y:u}=t.transformPoint({x:l,y:u}),{x:d,y:f}=t.transformPoint({x:d,y:f}),i.push(new Oe({x:o,y:a,c1x:h,c1y:c,c2x:l,c2y:u,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 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 Ce;c.prevPathX=c.startPathX=i,c.prevPathY=c.startPathY=r;for(let l=0,u=o.length;l<u;l++){const d=o[l],f=d.length();if(h+f>e&&!a){const p=d.getPointAtSegmentLength(e-h);if(c.appendLine(new Oe({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 Oe({c1x:p.n.x,c1y:p.n.y,c2x:p.end.x,c2y:p.end.y,toX:d.x,toY:d.y})),h+=f;continue}h+=f,c.appendLine(d)}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 l=this.getPointAtLength(c),u=Math.pow(Le(l.x,l.y,t,e),2);u<o&&(i=l,r=c,o=u)}for(a/=2;a>.5;){const c=r-a,l=this.getPointAtLength(c),u=Math.pow(Le(l.x,l.y,t,e),2),d=r+a,f=this.getPointAtLength(d),p=Math.pow(Le(f.x,f.y,t,e),2);c>=0&&u<o?(i=l,r=c,o=u):d<=n&&p<o?(i=f,r=d,o=p):a/=2}const h=this.getPointAtLength(r+(r===n?-.1:.1));return{point:i,rotation:r>=n?Nt(h.x,h.y,i.x,i.y):Nt(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+=Le(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++],l=e[a++],u=e[a++],d=e[a++],f=e[a++];o.push(["C",h,c,l,u,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]=F(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:Ce.fromPolymorphPoints(Ce.mixPoints(new Ce({d:t}).polymorphPoints,new Ce({d:e}).polymorphPoints,n)).toSVGPathData()}},K0=class extends Ps{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=In(),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=zi(n).reduce((i,r)=>i+r,0)}return Zi(this)}forceSetCXY(t,e){this.cX=t,this.cY=e,this.forceCXY=!0}shapeInit(){}initPathD(){if(!this.pathd){if(this.pathd=new Z0,Ee(()=>{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 bt;i.translate(-t.x+n.x,-t.y+n.y),n.originMatrix=i});const e=this.originMatrix?this.originMatrix.clone():new bt;e.translate(-t.x+this.x,-t.y+this.y),this.originMatrix=e}isPointInPath(t,e,n){if(n instanceof Qr)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 Qr)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 za(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])=>[dt(n),i]))):e&&(this.attrs[dt(t)]=e)}getAttr(t,e){return this.attrs[t]||this.attrs[dt(t)]||e}getAttrs(){return this.attrs}hasAttr(t){return!!this.attrs[t]||!!this.attrs[dt(t)]}distance(t){return Le(this.x,this.y,t.x,t.y)}rotateTo(t){this.degree=gt(Nt(this.x,this.y,t.x,t.y))}followTo(t,e=3){this.rotateTo(t);const{dx:n,dy:i}=Re(q(this.degree),e);this.vx=n,this.vy=i,this.run()}followAccelerationTo(t,e=.05){this.rotateTo(t);const{dx:n,dy:i}=Re(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=Wt(t?.gravity,0);this.vy+=e;const n=Wt(t?.friction,1);this.vx*=n,this.vy*=n,this.x+=this.vx,this.y+=this.vy}runEaseTo(t,e){const n=Wt(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=Wt(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=Wt(e?.springLength,100),i=Wt(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=F(n.getTotalLength(),0);this.setAttr({strokeDasharray:`${i} ${i}`,strokeDashoffset:`${i}`});const r=e?.onUpdate,o=new Vn({frameDuration:t});o.addTween({offset:i},{offset:0},Object.assign(e||{},{onUpdate:(a,h)=>{this.setAttr("strokeDashoffset",""+F(a.offset,2)),r?.(a,h)}})),o.play()}};class Q0 extends K0{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 yn(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 Qs=Q0,ts=2e3,no=2001,Zc=[1,0,0,1],Kc=[1,0,0,1,0,0],Qc=[1,0,0,0,1,0,0,0,1],tl=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];class so{value;constructor(t=Zc){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(Zc),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 so(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],l=i[0],u=i[2],d=i[1],f=i[3];return r[0]=o*l+a*d,r[2]=o*u+a*f,r[1]=h*l+c*d,r[3]=h*u+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 wn{value;constructor(t=Qc){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 l=this.value;return l[0]=t,l[1]=i,l[2]=a,l[3]=e,l[4]=r,l[5]=h,l[6]=n,l[7]=o,l[8]=c,this}identity(){return this.value=Array.from(Qc),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 wn(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],l=n[4],u=n[7],d=n[2],f=n[5],p=n[8],g=i[0],C=i[3],y=i[6],v=i[1],b=i[4],x=i[7],E=i[2],_=i[5],L=i[8];return r[0]=o*g+a*v+h*E,r[3]=o*C+a*b+h*_,r[6]=o*y+a*x+h*L,r[1]=c*g+l*v+u*E,r[4]=c*C+l*b+u*_,r[7]=c*y+l*x+u*L,r[2]=d*g+f*v+p*E,r[5]=d*C+f*b+p*_,r[8]=d*y+f*x+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],l=t[8];return e*o*l-e*a*c-n*r*l+n*a*h+i*r*c-i*o*h}inverse(){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],l=t[8],u=l*o-a*c,d=a*h-l*r,f=c*r-o*h,p=e*u+n*d+i*f;if(p===0)return this.set(0,0,0,0,0,0,0,0,0);const g=1/p;return t[0]=u*g,t[1]=(i*c-l*n)*g,t[2]=(a*n-i*o)*g,t[3]=d*g,t[4]=(l*e-i*h)*g,t[5]=(i*r-a*e)*g,t[6]=f*g,t[7]=(n*h-c*e)*g,t[8]=(o*e-n*r)*g,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).inverse().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(io.makeScale(t,e)),this}rotate(t){return this.premultiply(io.makeRotation(-t)),this}translate(t,e){return this.premultiply(io.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 Dt{value;is3dSpecial=!1;constructor(t=tl){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,l=0,u=1,d=0,f=0,p=0,g=0,C=1){const y=this.value;return y[0]=t,y[4]=e,y[8]=n,y[12]=i,y[1]=r,y[5]=o,y[9]=a,y[13]=h,y[2]=c,y[6]=l,y[10]=u,y[14]=d,y[3]=f,y[7]=p,y[11]=g,y[15]=C,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(tl),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 Dt(this.value)}static fromString(t){const e=new Dt,n=Ma("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 bt(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=>F(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=gt(B(Math.asin(-this.m13),-1,1));let r=gt(Math.atan2(this.m23,this.m33));Math.cos(q(i))===0&&(r=gt(Math.atan2(-this.m31,this.m22)));let o=gt(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:gt(this.m14),skewY:gt(this.m24),skewZ:gt(this.m34),skewW:this.m44,perspective:this.m34?-(1/this.m34):0}}extractRotation(t){const e=this.value,n=t.value,i=1/bn.setFromMatrix4Column(t,0).length(),r=1/bn.setFromMatrix4Column(t,1).length(),o=1/bn.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),l=Math.cos(r),u=Math.sin(r);if(t.order==="XYZ"){const d=o*l,f=o*u,p=a*l,g=a*u;e[0]=h*l,e[4]=-h*u,e[8]=c,e[1]=f+p*c,e[5]=d-g*c,e[9]=-a*h,e[2]=g-d*c,e[6]=p+f*c,e[10]=o*h}else if(t.order==="YXZ"){const d=h*l,f=h*u,p=c*l,g=c*u;e[0]=d+g*a,e[4]=p*a-f,e[8]=o*c,e[1]=o*u,e[5]=o*l,e[9]=-a,e[2]=f*a-p,e[6]=g+d*a,e[10]=o*h}else if(t.order==="ZXY"){const d=h*l,f=h*u,p=c*l,g=c*u;e[0]=d-g*a,e[4]=-o*u,e[8]=p+f*a,e[1]=f+p*a,e[5]=o*l,e[9]=g-d*a,e[2]=-o*c,e[6]=a,e[10]=o*h}else if(t.order==="ZYX"){const d=o*l,f=o*u,p=a*l,g=a*u;e[0]=h*l,e[4]=p*c-f,e[8]=d*c+g,e[1]=h*u,e[5]=g*c+d,e[9]=f*c-p,e[2]=-c,e[6]=a*h,e[10]=o*h}else if(t.order==="YZX"){const d=o*h,f=o*c,p=a*h,g=a*c;e[0]=h*l,e[4]=g-d*u,e[8]=p*u+f,e[1]=u,e[5]=o*l,e[9]=-a*l,e[2]=-c*l,e[6]=f*u+p,e[10]=d-g*u}else if(t.order==="XZY"){const d=o*h,f=o*c,p=a*h,g=a*c;e[0]=h*l,e[4]=-u,e[8]=c*l,e[1]=d*u+g,e[5]=o*l,e[9]=f*u-p,e[2]=p*u-f,e[6]=a*l,e[10]=g*u+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(ty,t,ey)}lookAt(t,e,n){const i=this.value;return Ft.subVectors(t,e),Ft.lengthSq()===0&&(Ft.z=1),Ft.normalize(),ze.crossVectors(n,Ft),ze.lengthSq()===0&&(Math.abs(n.z)===1?Ft.x+=1e-4:Ft.z+=1e-4,Ft.normalize(),ze.crossVectors(n,Ft)),ze.normalize(),ti.crossVectors(Ft,ze),i[0]=ze.x,i[4]=ti.x,i[8]=Ft.x,i[1]=ze.y,i[5]=ti.y,i[9]=Ft.y,i[2]=ze.z,i[6]=ti.z,i[10]=Ft.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],l=n[1],u=n[5],d=n[9],f=n[13],p=n[2],g=n[6],C=n[10],y=n[14],v=n[3],b=n[7],x=n[11],E=n[15],_=i[0],L=i[4],N=i[8],Y=i[12],G=i[1],V=i[5],J=i[9],rt=i[13],tt=i[2],te=i[6],Xt=i[10],qt=i[14],ee=i[3],R=i[7],D=i[11],$=i[15];return r[0]=o*_+a*G+h*tt+c*ee,r[4]=o*L+a*V+h*te+c*R,r[8]=o*N+a*J+h*Xt+c*D,r[12]=o*Y+a*rt+h*qt+c*$,r[1]=l*_+u*G+d*tt+f*ee,r[5]=l*L+u*V+d*te+f*R,r[9]=l*N+u*J+d*Xt+f*D,r[13]=l*Y+u*rt+d*qt+f*$,r[2]=p*_+g*G+C*tt+y*ee,r[6]=p*L+g*V+C*te+y*R,r[10]=p*N+g*J+C*Xt+y*D,r[14]=p*Y+g*rt+C*qt+y*$,r[3]=v*_+b*G+x*tt+E*ee,r[7]=v*L+b*V+x*te+E*R,r[11]=v*N+b*J+x*Xt+E*D,r[15]=v*Y+b*rt+x*qt+E*$,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],l=t[2],u=t[6],d=t[10],f=t[14],p=t[3],g=t[7],C=t[11],y=t[15];return p*(+r*h*u-i*c*u-r*a*d+n*c*d+i*a*f-n*h*f)+g*(+e*h*f-e*c*d+r*o*d-i*o*f+i*c*l-r*h*l)+C*(+e*c*u-e*a*f-r*o*u+n*o*f+r*a*l-n*c*l)+y*(-i*a*l-e*h*u+e*a*d+i*o*u-n*o*d+n*h*l)}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}inverse(){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],l=t[8],u=t[9],d=t[10],f=t[11],p=t[12],g=t[13],C=t[14],y=t[15],v=u*C*c-g*d*c+g*h*f-a*C*f-u*h*y+a*d*y,b=p*d*c-l*C*c-p*h*f+o*C*f+l*h*y-o*d*y,x=l*g*c-p*u*c+p*a*f-o*g*f-l*a*y+o*u*y,E=p*u*h-l*g*h-p*a*d+o*g*d+l*a*C-o*u*C,_=e*v+n*b+i*x+r*E;if(_===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const L=1/_;return t[0]=v*L,t[1]=(g*d*r-u*C*r-g*i*f+n*C*f+u*i*y-n*d*y)*L,t[2]=(a*C*r-g*h*r+g*i*c-n*C*c-a*i*y+n*h*y)*L,t[3]=(u*h*r-a*d*r-u*i*c+n*d*c+a*i*f-n*h*f)*L,t[4]=b*L,t[5]=(l*C*r-p*d*r+p*i*f-e*C*f-l*i*y+e*d*y)*L,t[6]=(p*h*r-o*C*r-p*i*c+e*C*c+o*i*y-e*h*y)*L,t[7]=(o*d*r-l*h*r+l*i*c-e*d*c-o*i*f+e*h*f)*L,t[8]=x*L,t[9]=(p*u*r-l*g*r-p*n*f+e*g*f+l*n*y-e*u*y)*L,t[10]=(o*g*r-p*a*r+p*n*c-e*g*c-o*n*y+e*a*y)*L,t[11]=(l*a*r-o*u*r-l*n*c+e*u*c+o*n*f-e*a*f)*L,t[12]=E*L,t[13]=(l*g*i-p*u*i+p*n*d-e*g*d-l*n*C+e*u*C)*L,t[14]=(p*a*i-o*g*i-p*n*h+e*g*h+o*n*C-e*a*C)*L,t[15]=(o*u*i-l*a*i+l*n*h-e*u*h-o*n*d+e*a*d)*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 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,h=t.z,c=r*o,l=r*a;return this.set(c*o+n,c*a-i*h,c*h+i*a,0,c*a+i*h,l*a+n,l*h-i*o,0,c*h-i*a,l*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=ts){const h=this.value,c=2*r/(e-t),l=2*r/(n-i),u=(e+t)/(e-t),d=(n+i)/(n-i);let f,p;if(a===ts)f=-(o+r)/(o-r),p=-2*o*r/(o-r);else if(a===no)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]=u,h[12]=0,h[1]=0,h[5]=l,h[9]=d,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=ts){const h=this.value,c=1/(e-t),l=1/(n-i),u=1/(o-r),d=(e+t)*c,f=(n+i)*l;let p,g;if(a===ts)p=(o+r)*u,g=-2*u;else if(a===no)p=r*u,g=-1*u;else throw new Error("Matrix4.makeOrthographic(): Invalid coordinate system: "+a);return h[0]=2*c,h[4]=0,h[8]=0,h[12]=-d,h[1]=0,h[5]=2*l,h[9]=0,h[13]=-f,h[2]=0,h[6]=0,h[10]=g,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,l=o+o,u=a+a,d=r*c,f=r*l,p=r*u,g=o*l,C=o*u,y=a*u,v=h*c,b=h*l,x=h*u,E=n.x,_=n.y,L=n.z;return i[0]=(1-(g+y))*E,i[1]=(f+x)*E,i[2]=(p-b)*E,i[3]=0,i[4]=(f-x)*_,i[5]=(1-(d+y))*_,i[6]=(C+v)*_,i[7]=0,i[8]=(p+b)*L,i[9]=(C-v)*L,i[10]=(1-(d+g))*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=bn.set(i[0],i[1],i[2]).length();const o=bn.set(i[4],i[5],i[6]).length(),a=bn.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 c=1/r,l=1/o,u=1/a;return Kt.value[0]*=c,Kt.value[1]*=c,Kt.value[2]*=c,Kt.value[4]*=l,Kt.value[5]*=l,Kt.value[6]*=l,Kt.value[8]*=u,Kt.value[9]*=u,Kt.value[10]*=u,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 Dt([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 Dt([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 Dt([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 Dt([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 Dt([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 Dt([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 Dt([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 l=h-i;if(l==0)return{x:e,y:n,z:i,mass:r};const u=-i/l;return e+=u*(o-e),n+=u*(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 Qs({x:t,y:e}),o=new Qs({x:t+n,y:e}),a=new Qs({x:t+n,y:e+i}),h=new Qs({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),l=Math.min(r.y,o.y,a.y,h.y),u=Math.max(r.x,o.x,a.x,h.x)-c,d=Math.max(r.y,o.y,a.y,h.y)-l;return{x:c,y:l,width:u,height:d}}}class bt{value;_m13=0;_m23=0;_m33=1;matrix4;constructor(t=Kc){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 bt,n=Ma("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 Dt(e)}identity(){return this.value=Array.from(Kc),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 bt(this.value)}multiply(t){const e=this.clone(),n=t instanceof bt?t:new bt(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}inverse(){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,l=c*r-o*h,u=-c*i+o*a,d=h*i-r*a;let f=t*l+e*u+n*d;return f?(f=1/f,this.m11=l*f,this.m12=(-c*e+n*h)*f,this.m13=(o*e-n*r)*f,this.m21=u*f,this.m22=(c*t-n*a)*f,this.m23=(-o*t+n*i)*f,this.m31=d*f,this.m32=(-h*t+e*a)*f,this.m33=(r*t-e*i)*f,this):null}adjugate(){const t=new bt;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=gt(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:gt(Math.atan2(-this.m21,this.m22)),skewY:gt(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],l=t.value[2],u=t.value[3],d=t.value[4],f=t.value[5],p=h*u,g=c*l,C=(l*n-e*u)/(g-p),y=(h*n-e*c)/(p-g),v=(l*r-i*u)/(g-p),b=(h*r-i*c)/(p-g),x=(l*(a-f)+u*(d-o))/(g-p),E=(h*(a-f)+c*(d-o))/(p-g),_=[C,y,v,b,x,E];return new bt(_)}toString(t=6){return this.matrix4.is2D()?`matrix(${this.value.map(e=>F(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 ty=new Bt(0,0,0),ey=new Bt(1,1,1),ze=new Bt,ti=new Bt,Ft=new Bt,bn=new Bt,io=new wn,Kt=new Dt;function el(s){const t=new bt;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 Dt(r)),t.matrix4.toMatrix(t);break}return""}),t}function Qt(s,t,e){const n=new bt;return n.rotate(gt(s)),n.transformPoint({x:t,y:e})}function ro(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 ny(s,t){const e=new Path2D(s),n=new Path2D;return n.addPath(e,ro(t)),n}const ei=new Wn,ct=new Bt;function es(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 ye{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=hf(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++)ei.fromBufferAttribute(this,e),ei.applyMatrix3(t),this.setXY(e,ei.x,ei.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=es(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=es(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=es(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=es(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=es(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 za(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 sy extends ye{constructor(t,e,n=!1){super(new Int8Array(t),e,n)}}class iy extends ye{constructor(t,e,n=!1){super(new Uint8Array(t),e,n)}}class ry extends ye{constructor(t,e,n=!1){super(new Uint8ClampedArray(t),e,n)}}class oy extends ye{constructor(t,e,n=!1){super(new Int16Array(t),e,n)}}class ay extends ye{constructor(t,e,n=!1){super(new Uint16Array(t),e,n)}}class hy extends ye{constructor(t,e,n=!1){super(new Int32Array(t),e,n)}}class cy extends ye{constructor(t,e,n=!1){super(new Uint32Array(t),e,n)}}class ly extends ye{constructor(t,e,n=!1){super(new Float32Array(t),e,n)}}const nl={map:new Map,transform:function(s){if(Ff)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 uy(s,t,e){const n=new OffscreenCanvas(s,t),i=n.getContext("2d");if(i)return e(i),n.transferToImageBitmap()}function fy(s,t,e){const n=s.createPattern(nl.transform(t),"no-repeat");if(n){const i=ro(e);n.setTransform(i),s.fillStyle=n}}const oo=["","-webkit-","-moz-","-o-","-ms-"];function ao(s,t){const e=t.x||0,n=t.y||0,i=t.z||0;is(s,"transform",`translate(${e}px, ${n}px) translateZ(${i}px)`)}function dy(s,t){const e=t?.easingFn||O.Linear.None,n=t?.duration||0,i=t?.delay||0,r=$t(),o=r+n;let a=0,h=0;const c=t.deltaX,l=t.deltaY;function u(){const d=$t();if(d>=o){ao(s,{x:c-a,y:l-h});return}const f=(d-r)/n,p=e(f),g=c*p,C=l*p;ao(s,{x:g-a,y:C-h}),a=g,h=C,m.rAF(u)}setTimeout(()=>{u()},i)}const my=typeof HTMLElement=="object"?function(t){return t instanceof HTMLElement}:function(t){return t&&typeof t=="object"&&t.nodeType===1&&typeof t.nodeName=="string"};function sl(s){return window.URL.createObjectURL(s)}function py(s){return window.URL.revokeObjectURL(s)}function ho(s){let t=!1;function e(){/loaded|complete/.test(document.readyState)&&!t&&(o(),s(),t=!0)}const n=W(document,"DOMContentLoaded",e),i=W(window,"load",e),r=setInterval(e,100),o=()=>{clearInterval(r),n?.(),i?.()};return o}function il(s){return W(window,"beforeunload",t=>{s(t)})}async function gy(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 ni(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 yy(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 wy(){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 rl=new Ln;async function ol(s,t=6e4){return new Promise((e,n)=>{const i=typeof s=="string"?s:sl(s),r=rl.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,l={width:h,height:c,aspectRatio:h/c,element:a,imageData:zc(a)};rl.set(i,l),e(l)},a.onerror=h=>{clearTimeout(o),n(h)},a.src=i})}async function al(s=Ut.text,t=["*"]){const n=(await pr(t))[0],i=await Bn(n,s);return{type:n.type,name:n.name,size:n.size,data:i}}async function by(s=["image/*"]){const e=(await pr(s))[0];if(!e.type.match(/image\/*/))return new Error("Not Image Type!");const n=await Bn(e,Ut.arraybuffer),i=Bi(n),r=await ol(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 xy(){return window.getSelection()?.toString()||""}function vy(s){document.getElementsByTagName("title")[0].innerText=s,document.title=s}function Sy(s=200){"vibrate"in navigator?window.navigator.vibrate(s):console.error("Your device is not support vibrate on this browser.")}async function _y(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 Cy(s=0,t=0){window.scrollTo(s,t)}function Ey(){let s=qa,t=qa;return"scrollRestoration"in window.history&&(window.history.scrollRestoration="manual",s=il(()=>{window.history.scrollRestoration="auto"}),t=ho(()=>{window.history.scrollRestoration="manual"})),()=>{s(),t()}}function Py(s){return/(html|body)/i.test(s.tagName)||s===document.documentElement}const Ty=s=>s===document.activeElement&&(s.type||s.href);function co(){return parseFloat(getComputedStyle(document.documentElement).fontSize)}function My(s){return s*co()}function Ay(s){return s.parentElement?parseFloat(getComputedStyle(s.parentElement).fontSize):co()}const Iy=s=>{let t=s;for(;t&&t.nodeType!==1;){const e=t.parentElement||s.parentNode;if(!e)break;t=e}return t},ky=s=>s.parentElement,lo=(s,t=[])=>!s||s.parentElement===null&&s.parentNode===null?t:lo(s.parentElement,t.concat([s]));function Dy(s){const t=lo(s);for(let e=0,n=t.length;e<n;e++)if(/(auto|scroll)/.test(ss(t[e],"overflow")+ss(t[e],"overflow-y")+ss(t[e],"overflow-x")))return t[e];return document.scrollingElement||document.documentElement}const Ly=(s,t)=>s.contains?s!=t&&s.contains(t):!!(s.compareDocumentPosition(t)&16),Ry=s=>Array.prototype.slice.call(s.parentElement?.children).filter(t=>t!==s),Oy=s=>s.nextElementSibling,zy=s=>s.previousElementSibling,Ny=(s,t)=>s.closest(t),By=s=>s.shadowRoot,ns=s=>s.tagName==="INPUT"||s instanceof HTMLInputElement,uo=s=>s.tagName==="SELECT"||s instanceof HTMLSelectElement,Fy=s=>s.tagName==="TEXTAREA"||s instanceof HTMLTextAreaElement,fo=s=>ns(s)&&s.getAttribute("type")==="checkbox",mo=s=>ns(s)&&s.getAttribute("type")==="radio",Yy=s=>ns(s)&&s.getAttribute("type")==="text",Xy=s=>ns(s)&&s.getAttribute("type")==="number";function Uy(s,t){if(uo(s)){const e=s.options;for(let n=0,i=e.length;n<i;n++)e[n].selected=e[n].value==t}}function $y(s,t){if(mo(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 Gy(s,t){fo(s)&&(s.checked=t)}function xn(s,t,e="append"){typeof t=="string"?s[e](fl(t)):s[e](t)}function hl(s,t){if(typeof t=="string"){s.innerHTML=t;const e=ml(s);e!=s&&(s=e)}else xn(t,"replaceWith")}const cl=function(s){hl(s,"")},Vy=(s,t)=>{s.textContent=t},qy=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},jy=s=>s.remove();function Hy(s,t){ss(s,"display")=="none"&&t===void 0||t===!0?ll(s):ul(s)}function ll(s){vn(s,"display",s instanceof HTMLTableRowElement?"table-row":s instanceof HTMLTableCellElement?"table-cell":"block")}function ul(s){vn(s,"display","none")}function po(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&&Je(s,"class",i.join(" ").replace(/^\s+/,"").replace(/\s+$/,""))}}function Wy(s,t){po(s,t,"add")}function Jy(s,t){po(s,t,"remove")}function Zy(s,t){return new RegExp("(?:^|\\s+)"+t+"(?:\\s+|$)").test(s.className)}function fl(s,t=!1){const e=document.createElement("template");return e.innerHTML=s,t&&e.content.childNodes.forEach(n=>{const i=ml(n);i!=n&&e.content.replaceChild(i,n)}),e.content}function dl(s){return document.createElement.call(document,s)}function Ky(s){return document.createElementNS("http://www.w3.org/1999/xhtml",s)}function Qy(s){return document.createTextNode.call(document,s)}function ml(s){return s.tagName=="SCRIPT"&&(s=pl(s)),s.querySelectorAll&&s.querySelectorAll("script").forEach(t=>{t.parentNode?.replaceChild(pl(t),t)}),s}function pl(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 gl(){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 yl(s,t){return new Promise((e,n)=>{const{method:i="GET",data:r={},multipartFormDataString:o="",boundary:a="",headers:h={},withCredentials:c=!1,responseType:l="json",timeout:u=3e4}=t||{},d=gl();d.timeout=u,d.responseType=l,d.onreadystatechange=function(v){d.readyState===4&&(d.status===200?e(d.response):n(d.statusText))},d.ontimeout=()=>{n(`${s} is timed out for ${u}ms.`)},d.addEventListener("load",v=>t?.load?.(v,d),!1),d.addEventListener("loadstart",v=>t?.loadstart?.(v,d),!1),d.addEventListener("loadend",v=>t?.loadend?.(v,d),!1),d.addEventListener("progress",v=>{if(v.lengthComputable){const b=Math.round(v.loaded*100/v.total);t?.progress?.(v,d,b)}},!1),d.addEventListener("error",v=>t?.error?.(v,d),!1),d.addEventListener("abort",v=>t?.abort?.(v,d),!1);const f=i.toUpperCase();Object.assign(h,{Accept:"*/*"});let p=!1,g=!1,C=!1;function y(){d.setRequestHeader("If-Modified-Since","Sat, 1 Jan 2000 00:00:00 GMT"),c&&(d.withCredentials=!0);for(const v in h)dt(v).toLowerCase()=="content-type"&&h[v].toLowerCase()=="multipart/form-data"?(p=!0,d.setRequestHeader("Content-Type","multipart/form-data; boundary="+a)):(dt(v).toLowerCase()=="content-type"&&(h[v].toLowerCase().indexOf("text/plain")>=0?g=!0:h[v].toLowerCase().indexOf("application/json")>=0&&(C=!0)),d.setRequestHeader(v,h[v]))}switch(f){case"GET":let v="";r instanceof FormData?v=wd(r):v=yd(r),d.open("GET",gd(s,v),!0),y(),d.send(null);break;default:d.open(f,s,!0),y(),p?d.sendAsBinary(o):C?d.send(JSON.stringify(r)):g?d.send(Object.entries(r).map(([b,x])=>`${b}=${x}`).join(`\r
|
|
27
|
+
`)):d.send(Object.entries(r).map(([b,x])=>`${encodeURIComponent(b)}=${encodeURIComponent(x)}`).join("&"));break}})}async function n1(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 u=0,d=h.files?.length||0;u<d;u++){const f=h.files?.[u];if(f){const p=await Bn(f,Ut.binaryString);e.push('Content-Disposition: form-data; name="'+h.name+'"; filename="'+f.name+`"\r
|
|
28
|
+
Content-Type: `+f.type+`\r
|
|
29
|
+
\r
|
|
30
|
+
`+p+`\r
|
|
31
|
+
`)}}break;case"RADIO":case"CHECKBOX":if(!r.checked)break;default:const l=r;n?e.push('Content-Disposition: form-data; name="'+l.name+`"\r
|
|
32
|
+
\r
|
|
33
|
+
`+l.value+`\r
|
|
34
|
+
`):t.data[l.name]=l.value;break}}return t.multipartFormDataString="--"+t.boundary+`\r
|
|
35
|
+
`+e.join("--"+t.boundary+`\r
|
|
36
|
+
`)+"--"+t.boundary+`--\r
|
|
37
|
+
`,t}function wl(s){const t=[];for(let e=0,n=oo.length;e<n;e++){const i=dt(oo[e]+s);t.push(i)}return t}function ss(s,t,e){const n=Vr(s);return n.props.style=n.props.style||{},t?n.props.style[t]||n.props.style[Ia(t)]||n.props.style[dt(t)]||"":n.props.style}function vn(s,t,e){Js(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]})}),qr()}function go(s,t=!1){const e={};if(!t)if(getComputedStyle){const n=getComputedStyle(s);for(let i=0,r=n.length;i<r;i++){const o=n[i];e[o]=n.getPropertyValue(o)}}else{const n=s.style||s.currentStyle;for(const i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return s.style.cssText&&s.style.cssText.split(";").filter(n=>!!n).forEach(n=>{const[i,r]=n.split(":").map(o=>o.trim());i&&r&&(e[i]=r)}),e}function s1(s,t){const e=wl(t),n=e.length;let i="";for(let r=0;r<n;r++){const o=e[r];if(i=s[o]||"",i)return i}return i}function i1(s,t,e){const n=wl(t),i=n.length;let r="";for(let o=0;o<i;o++){const a=n[o];if(r="style"in s&&s.style[a]||"currentStyle"in s&&s.currentStyle[a]||"",r)return r}if(getComputedStyle){const o=getComputedStyle(s,e);for(let a=0;a<i;a++){const h=n[a];if(r=o.getPropertyValue(h).trim(),r)return r}}return r}function is(s,t,e){if(t)if(typeof t=="string"&&e)try{s.style.setProperty(t,e.replace(/!important/i,""),e.toLowerCase().includes("!important")?"important":"")}catch{s.style[t]=e}else t instanceof Object&&Object.keys(t).forEach(n=>{is(s,n,t[n])})}function yo(s,t){typeof t=="string"?s.style.removeProperty(dt(t)):Object.keys(t).forEach(e=>{yo(s,e)})}function bl(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)}}}class r1{selector;name;value;constructor(t,e,n){this.selector=t,this.name=e,this.value=n}toString(){return`${this.selector} { ${this.name}: ${this.value} }`}}class o1{propertyName;values=[];constructor(t){this.propertyName=t}add(t,e){this.values.push(new r1(t,this.propertyName,e))}}async function xl(){const s=[],t=document.querySelectorAll("style, link");for(let e=0,n=t.length;e<n;e++){const i=t[e];let r=i.innerHTML;switch(i.nodeName.toLowerCase()){case"style":break;case"link":r=await yl(i.href,{method:"GET",responseType:"text"});break}r=r.replace(/\/\/.+?(?=\n|\r|$)|\/\*[\s\S]+?\*\//g,"").replace(/@[^{};]*;|@[^{};]*\{[^}]*\}/g,"").replace(/[\\n\n]+(?<=[\\n\n]+)\s+/g,""),s.push(r)}return s}async function a1(){const s={},t=await xl();for(let e=0,n=t.length;e<n;e++){const r=t[e].match(/[^{]*{[^}]*}/g);if(r)for(let o=0,a=r.length;o<a;o++){const h=r[o].split(/[{}]/g),c=h[0].trim(),u=h[1].split(";");for(let d=0;d<u.length;d++)if(u[d].trim()!=""){const f=u[d].split(":"),p=f[0].trim().toLowerCase(),g=f[1];s[p]||(s[p]=new o1(p)),g&&s[p].add(c,g.trim())}}}return s}function we(s,t,e){if(t===void 0&&e===void 0)return wo(s);if(typeof t=="string"&&e===void 0)return vl(s,t);typeof t=="object"?Js(s,n=>{for(const i in t)i=="style"?vn(s,i,t[i]):Object.prototype.hasOwnProperty.call(t,i)&&(n.props[i]=""+t[i])}):typeof t=="string"&&typeof e=="string"&&(t=="style"?vn(s,t,e):Js(s,n=>{n.props[t]=""+e})),qr()}function wo(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]=go(s,!0):t[r.nodeName]=r.nodeValue)}return t}function vl(s,t){return t==="style"?go(s,!0):s.getAttribute(dt(t))}function Je(s,t,e){return s.setAttribute(dt(t),""+e)}function h1(s,t){t.split(/[,\s]+/i).forEach(e=>{const n=dt(e.trim());n!=""&&s.removeAttribute(n)})}function Sl(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 c1(){return"ontouchstart"in window||"ontouchend"in document||navigator.maxTouchPoints>0}function l1(){return!!window.PointerEvent}function u1(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 bo(){return{x:0,y:0,isDown:!1}}function Ze(){const s=bo(),t=bo();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 si(s=document.documentElement,t=!1){return X(s,"mousemove",t)}function _l(s=document.documentElement,t=!1){return X(s,"mousedown",t)}function Cl(s=document.documentElement,t=!1){return X(s,"mouseup",t)}function f1(s=document.documentElement,t=!1){return X(s,"mouseover",t)}function d1(s=document.documentElement,t=!1){return X(s,"mouseout",t)}function m1(s=document.documentElement,t=!1){return X(s,"mouseenter",t)}function p1(s=document.documentElement,t=!1){return X(s,"mouseleave",t)}function g1(s=document.documentElement,t=!1){return X(s,"click",t)}function y1(s=document.documentElement,t=!1){return X(s,"dblclick",t)}function w1(s=document.documentElement,t=!1){return X(s,"onwheel"in document.createElement("div")?"wheel":document.onmousewheel!==void 0?"mousewheel":"DOMMouseScroll",t)}function b1(s=document.documentElement,t=!1){return X(s,"contextmenu",t)}function El(s=document.documentElement,t=!1){return X(s,"touchmove",t)}function Pl(s=document.documentElement,t=!1){return X(s,"touchstart",t)}function Tl(s=document.documentElement,t=!1){return X(s,"touchend",t)}function Ml(s=document.documentElement,t=!1){return X(s,"touchcancel",t)}function xo(s=document.documentElement,t=!1){return X(s,"pointermove",t)}function vo(s=document.documentElement,t=!1){return X(s,"pointerdown",t)}function So(s=document.documentElement,t=!1){return X(s,"pointerup",t)}function _o(s=document.documentElement,t=!1){return X(s,"pointercancel",t)}function x1(s=document.documentElement){const t=new nt(s);return et(e=>{t.on("pan",e)},e=>{t.off("pan",e)})}function v1(s=document.documentElement){const t=new nt(s);return et(e=>{t.on("panmove",e)},e=>{t.off("panmove",e)})}function S1(s=document.documentElement){const t=new nt(s);return et(e=>{t.on("panstart",e)},e=>{t.off("panstart",e)})}function _1(s=document.documentElement){const t=new nt(s);return et(e=>{t.on("panend",e)},e=>{t.off("panend",e)})}function C1(s=document.documentElement){const t=new nt(s);return et(e=>{t.on("pancancel",e)},e=>{t.off("pancancel",e)})}function E1(s=document.documentElement){const t=new nt(s);return et(e=>{t.on("panleft",e)},e=>{t.off("panleft",e)})}function P1(s=document.documentElement){const t=new nt(s);return et(e=>{t.on("panright",e)},e=>{t.off("panright",e)})}function T1(s=document.documentElement){const t=new nt(s);return et(e=>{t.on("panup",e)},e=>{t.off("panup",e)})}function M1(s=document.documentElement){const t=new nt(s);return et(e=>{t.on("pandown",e)},e=>{t.off("pandown",e)})}function A1(s=document.documentElement){const t=new nt(s);return et(e=>{t.on("pinch",e)},e=>{t.off("pinch",e)})}function I1(s=document.documentElement){const t=new nt(s);return et(e=>{t.on("pinchin",e)},e=>{t.off("pinchin",e)})}function k1(s=document.documentElement){const t=new nt(s);return et(e=>{t.on("pinchout",e)},e=>{t.off("pinchout",e)})}function D1(s=document.documentElement){const t=new nt(s);return et(e=>{t.on("press",e)},e=>{t.off("press",e)})}function L1(s=document.documentElement){const t=new nt(s);return et(e=>{t.on("rotate",e)},e=>{t.off("rotate",e)})}function R1(s=document.documentElement){const t=new nt(s);return et(e=>{t.on("swipe",e)},e=>{t.off("swipe",e)})}function O1(s=document.documentElement){const t=new nt(s);return et(e=>{t.on("swipeleft",e)},e=>{t.off("swipeleft",e)})}function z1(s=document.documentElement){const t=new nt(s);return et(e=>{t.on("swiperight",e)},e=>{t.off("swiperight",e)})}function N1(s=document.documentElement){const t=new nt(s);return et(e=>{t.on("swipeup",e)},e=>{t.off("swipeup",e)})}function B1(s=document.documentElement){const t=new nt(s);return et(e=>{t.on("swipedown",e)},e=>{t.off("swipedown",e)})}function Al(s=document.documentElement){const t=new nt(s);return et(e=>{t.on("tap",e)},e=>{t.off("tap",e)})}function F1(s=document.documentElement){const t=new nt(document.documentElement);return et(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 Y1(s=document.documentElement,t=!1){return X(s,"transitionstart",t)}function X1(s=document.documentElement,t=!1){return vc(X(s,"transitionend",t),X(s,"webkitTransitionEnd",t),X(s,"oTransitionEnd",t),X(s,"MSTransitionEnd",t))}function U1(s=document.documentElement,t=!1){return X(s,"animationstart",t)}function $1(s=document.documentElement,t=!1){return X(s,"animationend",t)}function Il(s=document.documentElement,t=!1){return X(s,"drag",t)}function kl(s=document.documentElement,t=!1){return X(s,"dragstart",t)}function Dl(s=document.documentElement,t=!1){return X(s,"dragend",t)}function Ll(s=document.documentElement,t=!1){return X(s,"drop",t)}function Rl(s=document.documentElement,t=!1){return X(s,"dragenter",t)}function Ol(s=document.documentElement,t=!1){return X(s,"dragleave",t)}function zl(s=document.documentElement,t=!1){return X(s,"dragover",t)}function Nl(s=document.documentElement,t=!1){return X(s,"keydown",t)}function Bl(s=document.documentElement,t=!1){return X(s,"keyup",t)}function G1(s=document.documentElement,t=!1){return X(s,"keypress",t)}function V1(s=document.documentElement,t){const e=t?.useMousePoint||Ze();return si(s).pipe(it(n=>(e.setCurrent(ft(n,s)),e)))}function Fl(s=document.documentElement,t){const e=t?.useMousePoint||Ze();return si(s).pipe(Sg(_l(s).pipe(je(n=>{e.setStart(ft(n,s),!0),t?.start?.(n,e)})),()=>Cl(s).pipe(je(n=>{e.setCurrent(ft(n,s),!1),t?.end?.(n,e)}))),bg(),it(n=>(e.setCurrent(ft(n,s),!0),e)))}function Yl(s=document.documentElement,t){const e=t?.useMousePoint||Ze();return Pl(s).pipe(je(n=>{const i=n.changedTouches[0];e.setStart(ft(i,s),!0),t?.start?.(i,e)}),Vs(()=>El(s).pipe(Dr(Gs(Tl(s),Ml(s)).pipe(je(n=>{const i=n.changedTouches[0];e.setCurrent(ft(i,s),!1),t?.end?.(i,e)}))))),it(n=>{const i=n.changedTouches[0];return e.setCurrent(ft(i,s),!0),e}))}function ii(s=document.documentElement,t){const e=t?.useMousePoint||Ze();return vo(s).pipe(je(n=>{e.setStart(ft(n,s),!0),t?.start?.(n,e)}),Vs(()=>xo(s).pipe(Dr(Gs(So(s),_o(s)).pipe(je(n=>{e.setCurrent(ft(n,s),!1),t?.end?.(n,e)}))))),it(n=>(e.setCurrent(ft(n,s),!0),e)))}function q1(s=document.documentElement,t){return Gs(Fl(s,t),Yl(s,t))}function Xl(s=document.documentElement,t){const e=t?.useMousePoint||Ze();return vc(si(s),vo(s)).pipe(_c(n=>n instanceof PointerEvent?(e.setStart(ft(n,s),!0),t?.start?.(n,e),xo(s).pipe(Dr(Gs(So(s),_o(s)).pipe(je(i=>{e.setCurrent(ft(i,s),!1),t?.end?.(i,e)}))))):n instanceof MouseEvent?$p(n):ic),it(n=>(e.setCurrent(ft(n,s),n instanceof PointerEvent),e)))}function j1(s){return new st(t=>ii(s,{start:()=>{t.next(0)}}).subscribe(n=>{t.next(n.current.y-n.start.y)}).unsubscribe).pipe(Me())}function H1(s,t){Je(s,"draggable","true");const e=kl(s,!0).subscribe(r=>{Ae(r),Lr(r);const o=r.dataTransfer;o&&(o.effectAllowed="move",o.setData("text/plain","some-data")),t?.onStart?.(r)}),n=Il(s).subscribe(r=>{Ae(r),t?.onDrag?.(r)}),i=Dl(s).subscribe(r=>{Ae(r),t?.onEnd?.(r)});return()=>{e.unsubscribe(),n.unsubscribe(),i.unsubscribe()}}function W1(s,t){const e=Rl(s).subscribe(o=>{Ae(o),t?.onEnter?.(o)}),n=zl(s).subscribe(o=>{Ae(o);const a=o.dataTransfer;a&&(a.dropEffect="move"),t?.onOver?.(o)}),i=Ol(s).subscribe(o=>{Ae(o),t?.onLeave?.(o)}),r=Ll(s).subscribe(o=>{Ae(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 Ul(s=10){return X(window,"scroll",!0).pipe(vg(s))}function J1(){return X(document,"visibilitychange",!0).pipe(it(()=>document.visibilityState==="visible"),Me())}function Z1(){return X(window,"storage",!1)}function K1(){return{screenWidth:window.screen.width,screenHeight:window.screen.height,innerWidth:window.innerWidth,innerHeight:window.innerHeight,screenX:window.screenX,screenY:window.screenY,pageXOffset:window.pageXOffset,pageYOffset:window.pageYOffset}}function Sn(){const s=document.documentElement||document.body;return{el:s,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 Co(){const{clientWidth:s,clientHeight:t,scrollLeft:e,scrollTop:n}=Sn();return{width:window.innerWidth||s,height:window.innerHeight||t,x:window.pageXOffset||e,y:window.pageYOffset||n}}function Q1(){const{scrollWidth:s,scrollHeight:t,scrollLeft:e,scrollTop:n}=Sn();return{width:s,height:t,scrollX:window.pageXOffset||e,scrollY:window.pageYOffset||n}}function Eo(s){return s.getBoundingClientRect()}function tw(s){return{x:s.offsetLeft,y:s.offsetTop,width:s.offsetWidth,height:s.offsetHeight}}function Po(s){const{top:t,left:e,width:n,height:i}=s.getBoundingClientRect(),{scrollLeft:r,scrollTop:o}=Sn();return{x:e+r,y:t+o,width:n,height:i}}function ew(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 nw(){const{clientHeight:s,scrollTop:t,scrollHeight:e}=Sn(),n=e-s;return n<=0?0:t/n*100}function sw(s){const t=Co(),e=Eo(s);return e.bottom>=0&&e.top<=t.height&&e.right>=0&&e.left<=t.width}function iw(s){if("center"in s){const t=s.center,e=Eo(s.target);return{x:t.x-e.x,y:t.y-e.y}}return{x:s.clientX,y:s.clientY}}function To(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}=Sn();return{x:s.clientX+t,y:s.clientY+e}}function ft(s,t){const e={x:0,y:0};if(t){const n=To(s),i=Po(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=To(s),o=Po(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 rw(s){let t=0;return s||(s=window.event),s.wheelDelta?(t=s.wheelDelta/120,window.opera&&(t=-t)):s.detail&&(t=-s.detail/3),t}function ow(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 aw={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},hw={NULL:"",CANCEL:"",HELP:"",BACK_SPACE:"",TAB:"",CLEAR:"",RETURN:"",ENTER:"",SHIFT:"",CONTROL:"",ALT:"",PAUSE:"",ESCAPE:"",SPACE:"",PAGE_UP:"",PAGE_DOWN:"",END:"",HOME:"",ARROW_LEFT:"",LEFT:"",ARROW_UP:"",UP:"",ARROW_RIGHT:"",RIGHT:"",ARROW_DOWN:"",DOWN:"",INSERT:"",DELETE:"",SEMICOLON:"",EQUALS:"",NUMPAD0:"",NUMPAD1:"",NUMPAD2:"",NUMPAD3:"",NUMPAD4:"",NUMPAD5:"",NUMPAD6:"",NUMPAD7:"",NUMPAD8:"",NUMPAD9:"",MULTIPLY:"",ADD:"",SEPARATOR:"",SUBTRACT:"",DECIMAL:"",DIVIDE:"",F1:"",F2:"",F3:"",F4:"",F5:"",F6:"",F7:"",F8:"",F9:"",F10:"",F11:"",F12:"",COMMAND:"",META:"",ZENKAKU_HANKAKU:""};function cw(s){if(s.key)return s.key;if(s.keyCode)return s.keyCode;if(s.which)return s.which}function $l(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 Gl(s){return Nl(s.target||document||window).pipe(Sc(t=>$l(t,s)),it(t=>{t.stopPropagation(),t.preventDefault()}))}function lw(s){return Bl(s.target||document||window).pipe(Sc(t=>$l(t,s)),it(t=>{t.stopPropagation(),t.preventDefault()}))}function Vl(s={keys:["o"]},t=Ut.text){return Gl(s).pipe(Vs(async()=>await al(t)))}async function uw(s={keys:["o"]},t=Ut.text){return Vp(Vl(s,t))}async function ql(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 Mo(s=document.documentElement,t){return new st(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 l=s.getBoundingClientRect();(i!=l.x||r!=l.y||o!=l.width||a!=l.height)&&(i=l.x,r=l.y,o=l.width,a=l.height,e.next(l))});return h.observe(s,t),()=>{h.unobserve(s),h.disconnect()}})}function fw(){return X(window,"orientationchange"in window?"orientationchange":"resize").pipe(it(s=>({width:s.target.innerWidth,height:s.target.innerHeight})),qe({width:window.innerWidth,height:window.innerHeight}))}function dw(){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 mw(s=document.documentElement){const t=new Ps,e=new nt(s);let n=[];const i=dw(),r=i.mousePoint,o=I=>{t.emit("mouseDown",I)},a=I=>{t.emit("mouseUp",I)},h=I=>{r.isDown||i.setCurrentMousePoint(ft(I,s)),t.emit("mouseMove",I)},c=I=>{t.emit("mouseOver",I)},l=I=>{t.emit("mouseOut",I)},u=I=>{t.emit("mouseEnter",I)},d=I=>{t.emit("mouseLeave",I)},f=I=>{t.emit("mouseClick",I)},p=I=>{t.emit("mouseDoubleClick",I)},g=I=>{t.emit("mouseWheel",I)},C=I=>{t.emit("mouseContextMenu",I)},y=I=>{t.emit("touchStart",I)},v=I=>{t.emit("touchEnd",I)},b=I=>{t.emit("touchCancel",I)},x=I=>{const at=I.changedTouches[0];r.isDown||i.setCurrentMousePoint(ft(at,s)),t.emit("touchMove",I)},E=I=>{t.emit("pointerDown",I)},_=I=>{t.emit("pointerUp",I)},L=I=>{t.emit("pointerCancel",I)},N=I=>{t.emit("pointerMove",I)},Y=I=>{t.emit("pan",I)},G=I=>{t.emit("panStart",I)},V=I=>{t.emit("panMove",I)},J=I=>{t.emit("panEnd",I)},rt=I=>{t.emit("panCancel",I)},tt=I=>{t.emit("panLeft",I)},te=I=>{t.emit("panRight",I)},Xt=I=>{t.emit("panUp",I)},qt=I=>{t.emit("panDown",I)},ee=I=>{t.emit("pinch",I)},R=I=>{t.emit("pinchin",I)},D=I=>{t.emit("pinchout",I)},$=I=>{t.emit("press",I)},Z=I=>{t.emit("rotate",I)},At=I=>{t.emit("swipe",I)},ne=I=>{t.emit("swipeLeft",I)},gi=I=>{t.emit("swipeRight",I)},yi=I=>{t.emit("swipeUp",I)},yt=I=>{t.emit("swipeDown",I)},he=I=>{t.emit("tap",I)},ot=I=>{!I.target||s==I.target||s.contains(I.target)||t.emit("tapOutSide",I)},Ct=I=>{t.emit("transitionstart",I)},Pn=I=>{t.emit("transitionend",I)},rn=I=>{t.emit("animationstart",I)},on=I=>{t.emit("animationend",I)};let Fe={...s.getBoundingClientRect(),width:s.offsetWidth,height:s.offsetHeight};return{el:s,get rect(){return Fe},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",l)),n.push(W(s,"mouseenter",u)),n.push(W(s,"mouseleave",d)),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",g)),n.push(W(s,"contextmenu",C)),n.push(W(s,"touchstart",y)),n.push(W(s,"touchend",v)),n.push(W(s,"touchcancel",b)),n.push(W(s,"touchmove",x)),n.push(W(s,"pointerdown",E)),n.push(W(s,"pointerup",_)),n.push(W(s,"pointercancel",L)),n.push(W(s,"pointermove",N)),e.on("pan",Y),e.on("panstart",G),e.on("panmove",V),e.on("panend",J),e.on("pancancel",rt),e.on("panleft",tt),e.on("panright",te),e.on("panup",Xt),e.on("pandown",qt),e.on("pinch",ee),e.on("pinchin",R),e.on("pinchout",D),e.on("press",$),e.on("rotate",Z),e.on("swipe",At),e.on("swipeleft",ne),e.on("swiperight",gi),e.on("swipeup",yi),e.on("swipedown",yt),e.on("tap",he),n.push(W(document,"pointerdown",ot)),n.push(W(s,"transitionstart",Ct)),n.push(W(s,"transitionend",Pn)),n.push(W(s,"animationstart",rn)),n.push(W(s,"animationend",on));const I=await ql(s,at=>{Fe=at,t.emit("resize",at)});n.push(I),n.push(jl(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(I=>I()),n=[],e.off("pan",Y),e.off("panstart",G),e.off("panmove",V),e.off("panend",J),e.off("pancancel",rt),e.off("panleft",tt),e.off("panright",te),e.off("panup",Xt),e.off("pandown",qt),e.off("pinch",ee),e.off("pinchin",R),e.off("pinchout",D),e.off("press",$),e.off("rotate",Z),e.off("swipe",At),e.off("swipeleft",ne),e.off("swiperight",gi),e.off("swipeup",yi),e.off("swipedown",yt),e.off("tap",he)}}}function jl(s,t){return Hl(s,t)}function Hl(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 pw(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 gw(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=F(t?.x||0,2),this.y=F(t?.y||0,2),this.toX=F(t?.toX||0,2),this.toY=F(t?.toY||0,2)}toSVGPathData(){return[["L",this.toX,this.toY]]}toCanvasContext(t){t.lineTo(this.toX,this.toY)}getBoundingClientRect(t=2){const e=Nt(this.x,this.y,this.toX,this.toY);if(e===0){const n=Math.min(this.x,this.toX),i=Math.min(this.y,this.toY),r=Math.max(this.x,this.toX),o=Math.max(this.y,this.toY);return{x:n,y:i,width:r-n,height:o-i}}else{const n=Math.sin(e),i=Math.cos(e),r=i*this.x-n*this.y,o=i*this.toX-n*this.toY,a=i*this.y+n*this.x,h=i*this.toY+n*this.toX;return{x:F(Math.min(r,o),t),y:F(Math.min(a,h),t),width:F(Math.max(r,o)-Math.min(r,o),t),height:F(Math.max(a,h)-Math.min(a,h),t)}}}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 l=(-c*i+r+h*e-n)/(h-c),u=h*(l-e)+n;return isNaN(l)||isNaN(u)?null:{x:l,y:u}}};class Io extends Ao{rx;ry;xAxisRotate;largeArcFlag;sweepFlag;constructor(t){super(t),this.rx=F(t.rx,2),this.ry=F(t.ry,2),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}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 l=a/180*Math.PI,u=(t-n)/2,d=(e-i)/2,f=Math.cos(l)*u+Math.sin(l)*d,p=-Math.sin(l)*u+Math.cos(l)*d,g=f*f/(r*r)+p*p/(o*o);if(g>1){const V=Math.sqrt(g);throw r=V*r,o=V*o,new Error(`Radii are too small to build an arc. Correcting them to ${r}/${o}.`)}const C=Math.sqrt((r*r*o*o-r*r*p*p-o*o*f*f)/(r*r*p*p+o*o*f*f)),y=h!=c?1:-1,v=y*C*r*p/o,b=y*C*-o*f/r,x=(t+n)/2,E=(e+i)/2,_=Math.cos(l)*v-Math.sin(l)*b+x,L=Math.sin(l)*v+Math.cos(l)*b+E,N=(V,J,rt,tt)=>(V*tt>=J*rt?1:-1)*Math.acos((V*rt+J*tt)/(Math.sqrt(V*V+J*J)*Math.sqrt(rt*rt+tt*tt))),Y=N(1,0,t-_,e-L)-l,G=N(t-_,e-L,n-_,i-L);return[_,L,r,o,l,Y,Y+G]}}class yw extends Ao{cx;cy;isLineThrough;constructor(t){super(t),this.cx=F(t.cx,2),this.cy=F(t.cy,2),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(t=2){const e=[this.x,this.toX],n=[this.y,this.toY];let i,r,o,a;for(let l=0;l<2;++l)i=l==0?this.x-2*this.cx+this.toX:this.y-2*this.cy+this.toY,r=l==0?-2*this.x+2*this.cx:-2*this.y+2*this.cy,o=l==0?this.x:this.y,Math.abs(i)>1e-12&&(a=-r/(2*i),0<a&&a<1&&[e,n][l].push(i*a*a+r*a+o));const h={x:Math.min(0,...e),y:Math.min(0,...n)},c={x:Math.max(0,...e),y:Math.max(0,...n)};return{x:F(h.x,t),y:F(h.y,t),width:F(c.x-h.x,t),height:F(c.y-h.y,t)}}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 ww=yw;class xt extends Ao{c1x;c1y;c2x;c2y;constructor(t){super(t),this.c1x=F(t.c1x,2),this.c1y=F(t.c1y,2),this.c2x=F(t.c2x,2),this.c2y=F(t.c2y,2)}clone(){return new xt({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(t=2){let e=this.c2x-2*this.c1x+this.x-(this.toX-2*this.c2x+this.c1x),n=2*(this.c1x-this.x)-2*(this.c2x-this.c1x),i=this.x-this.c1x,r=(-n+Math.sqrt(n*n-4*e*i))/2/e,o=(-n-Math.sqrt(n*n-4*e*i))/2/e;const a=[this.y,this.toY],h=[this.x,this.toX];let c;const l=[];Math.abs(r)>1e12&&(r=.5),Math.abs(o)>1e12&&(o=.5),r>=0&&r<=1&&(c=this.interpolate(r),h.push(c.x),a.push(c.y),l.push({X:c.x,Y:c.y})),o>=0&&o<=1&&(c=this.interpolate(o),h.push(c.x),a.push(c.y),l.push({X:c.x,Y:c.y})),e=this.c2y-2*this.c1y+this.y-(this.toY-2*this.c2y+this.c1y),n=2*(this.c1y-this.y)-2*(this.c2y-this.c1y),i=this.y-this.c1y,r=(-n+Math.sqrt(n*n-4*e*i))/2/e,o=(-n-Math.sqrt(n*n-4*e*i))/2/e,Math.abs(r)>1e12&&(r=.5),Math.abs(o)>1e12&&(o=.5),r>=0&&r<=1&&(c=this.interpolate(r),h.push(c.x),a.push(c.y),l.push({X:c.x,Y:c.y})),o>=0&&o<=1&&(c=this.interpolate(o),h.push(c.x),a.push(c.y),l.push({X:c.x,Y:c.y}));const u=[],d=l.length;for(let g=0;g<d;g++){for(let C=g+1;C<d;C++)l[g].X===l[C].X&&l[g].Y===l[C].Y&&(C=++g);u.push({X:l[g].X,Y:l[g].Y})}const f={x:Math.min(...h),y:Math.min(...a)},p={x:Math.max(...h),y:Math.max(...a)};return{x:F(f.x,t),y:F(f.y,t),width:F(p.x-f.x,t),height:F(p.y-f.y,t),dots:u}}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 l=c/2,u=[-.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 g=l*u[p]+l,C=xt.base3(g,t,n,r,a),y=xt.base3(g,e,i,o,h);f+=d[p]*Math.sqrt(C*C+y*y)}return l*f}length(t=1){return xt.bezlen(this.x,this.y,this.c1x,this.c1y,this.c2x,this.c2y,this.toX,this.toY,t)}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,l=this.x+2*e*(this.c1x-this.x)+o*(this.c2x-2*this.c1x+this.x),u=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,g=n*this.y+e*this.c1y,C=n*this.c2x+e*this.toX,y=n*this.c2y+e*this.toY,v=90-Math.atan2(l-d,u-f)*180/Math.PI;return{x:h,y:c,m:{x:l,y:u},n:{x:d,y:f},start:{x:p,y:g},end:{x:C,y},alpha:v}}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||xt.bezlen(e,n,i,r,o,a,h,c)<t)return 0;const l=1;let u=l/2,d=l-u,f=xt.bezlen(e,n,i,r,o,a,h,c,d);for(;Math.abs(f-t)>.01;)u/=2,d+=(f<t?1:-1)*u,f=xt.bezlen(e,n,i,r,o,a,h,c,d);return d}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}}}const rs=Math.PI*2;function Wl(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 bw(s,t,e,n,i,r,o,a,h,c){const l=c*(s-e)/2+h*(t-n)/2,u=-h*(s-e)/2+c*(t-n)/2,d=o*o,f=a*a,p=l*l,g=u*u;let C=d*f-d*g-f*p;C<0&&(C=0),C/=d*g+f*p,C=Math.sqrt(C)*(i===r?-1:1);const y=C*o/a*u,v=C*-a/o*l,b=c*y-h*v+(s+e)/2,x=h*y+c*v+(t+n)/2,E=(l-y)/o,_=(u-v)/a,L=(-l-y)/o,N=(-u-v)/a,Y=Wl(1,0,E,_);let G=Wl(E,_,L,N);return r===0&&G>0&&(G-=rs),r===1&&G<0&&(G+=rs),[b,x,Y,G]}function xw(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 Jl(s,t,e,n,i,r,o,a,h){const c=Math.sin(h*rs/360),l=Math.cos(h*rs/360),u=l*(s-e)/2+c*(t-n)/2,d=-c*(s-e)/2+l*(t-n)/2;if(u===0&&d===0)return[];if(o===0||a===0)return[];o=Math.abs(o),a=Math.abs(a);const f=u*u/(o*o)+d*d/(a*a);f>1&&(o*=Math.sqrt(f),a*=Math.sqrt(f));const p=bw(s,t,e,n,i,r,o,a,c,l),g=[];let C=p[2],y=p[3];const v=Math.max(Math.ceil(Math.abs(y)/(rs/4)),1);y/=v;for(let b=0;b<v;b++)g.push(xw(C,y)),C+=y;return g.map(b=>{for(let x=0;x<b.length;x+=2){let E=b[x+0],_=b[x+1];E*=o,_*=a;const L=l*E-c*_,N=c*E+l*_;b[x+0]=L+p[0],b[x+1]=N+p[1]}return b})}function ko(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 os(s,t,e,n){return[s,t,e,n,e,n]}const ri={a:7,c:6,s:4,q:4,t:2,m:2,l:2,h:1,v:1,z:0};function Ke(s="path"){return document.createElementNS.call(document,"http://www.w3.org/2000/svg",s)}function Zl(){return Ke("path")}const vw=s=>s instanceof SVGElement&&s.tagName==="path";function Sw(s,t="shape"){return ni(mr(s),`${t}.svg`)}function Kl(s){return typeof s!="string"?!1:(s=s.trim(),/^[mlhvzaqtcs]\s*[-+.0-9][^mlhvzaqtcs]+/i.test(s)&&/[\dz]$/i.test(s))}function _w(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 Ql(s){const t=[];return Kl(s)&&s.replace(/([mlhvzaqtcs])([^mlhvzaqtcs]*)/gi,(e,n,i)=>{let r=n.toLowerCase();const o=zi(i);for(r=="m"&&o.length>ri[r]&&(t.push([n,...o.splice(0,ri[r])]),r="l",n=n=="m"?"l":"L");o.length;){if(o.length<ri[r])throw new Error(`parseSVGPath substring:{ ${e} } command:{ ${n} } args:{ ${o} }`);t.push([n,...o.splice(0,ri[r])])}return r=="z"&&t.push([n]),""}),t}function tu(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 Cw(s){const t=[];let e=0,n=0,i=0,r=0,o=0,a=0,h=0,c=0,l;for(let u=0,d=s.length;u<d;u++){let f=s[u];const p=f[0];switch(p){case"M":e=f[1],n=f[2];break;case"A":const g=Jl(i,r,f[6],f[7],f[4],f[5],f[1],f[2],f[3]);if(!g.length)continue;g.forEach((v,b)=>{const[x,E,_,L,N,Y,G,V]=v;f=["C",_,L,N,Y,G,V],b<g.length-1&&t.push(f)});break;case"S":let C=i,y=r;(l=="C"||l=="S")&&(C+=C-h,y+=y-c),f=["C",C,y,f[1],f[2],f[3],f[4]];break;case"T":l=="Q"||l=="T"?(o=i*2-o,a=r*2-a):(o=i,a=r),f=["C",...ko(i,r,o,a,f[1],f[2])];break;case"Q":o=f[1],a=f[2],f=["C",...ko(i,r,f[1],f[2],f[3],f[4])];break;case"L":f=["C",...os(i,r,f[1],f[2])];break;case"H":f=["C",...os(i,r,f[1],r)];break;case"V":f=["C",...os(i,r,i,f[1])];break;case"Z":f=["C",...os(i,r,e,n)];break}l=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 as{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(()=>{as.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 Do extends Ps{source;raw="";mode="text";tagname="";nodename="";textchunk="";entity="";quote="";attrs={};constructor(t){super(),this.source=t}parse(){const t=sf(this.source);if(t===0){this.emit("finish");return}let e,n,i=Aa(this.source,0);for(let r=1;r<t;r++)e=n,n=i,i=Aa(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==`
|
|
38
|
+
`&&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":ue("whitespace",t)?(this.textchunk+=eu(this.entity),this.mode="text"):t==";"?(this.textchunk+=eu(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(!ue("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":ue("whitespace",t)||(this.mode="close tag name",this.tagname="",this.nodename="",this.act(t,e,n));break;case"close tag name":if(ue("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(ue("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":ue("whitespace",t)||(this.mode="attr",this.nodename="",this.act(t,e,n));break;case"attr":if(ue("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(!ue("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(ue("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 eu(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 nu=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function Lo(s,t={}){var e=1,n=1;function i(R){var D=R.match(/\n/g);D&&(e+=D.length);var $=R.lastIndexOf(`
|
|
39
|
+
`);n=~$?R.length-$: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=d();return{type:"stylesheet",stylesheet:{source:t.source,rules:R,parsingErrors:a}}}function l(){return f(/^{\s*/)}function u(){return f(/^}/)}function d(){var R,D=[];for(p(),g(D);s.length&&s.charAt(0)!="}"&&(R=qt()||ee());)R!==!1&&(D.push(R),g(D));return D}function f(R){var D=R.exec(s);if(D){var $=D[0];return i($),s=s.slice($.length),D}}function p(){f(/^\s*/)}function g(R){var D;for(R=R||[];D=C();)D!==!1&&R.push(D);return R}function C(){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 $=s.slice(2,D-2);return n+=2,i($),s=s.slice(D),n+=2,R({type:"comment",comment:$})}}function y(){var R=f(/^([^{]+)/);if(R)return be(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 v(){var R=r(),D=f(/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(D){if(D=be(D[0]),!f(/^:\s*/))return h("property missing ':'");var $=f(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/),Z=R({type:"declaration",property:D.replace(nu,""),value:$?be($[0]).replace(nu,""):""});return f(/^[;\s]*/),Z}}function b(){var R=[];if(!l())return h("missing '{'");g(R);for(var D;D=v();)D!==!1&&(R.push(D),g(R));return u()?R:h("missing '}'")}function x(){for(var R,D=[],$=r();R=f(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/);)D.push(R[1]),f(/^,\s*/);if(D.length)return $({type:"keyframe",values:D,declarations:b()})}function E(){var R=r(),D=f(/^@([-\w]+)?keyframes\s*/);if(D){var $=D[1];if(D=f(/^([-\w]+)\s*/),!D)return h("@keyframes missing name");var Z=D[1];if(!l())return h("@keyframes missing '{'");for(var At,ne=g();At=x();)ne.push(At),ne=ne.concat(g());return u()?R({type:"keyframes",name:Z,vendor:$,keyframes:ne}):h("@keyframes missing '}'")}}function _(){var R=r(),D=f(/^@supports *([^{]+)/);if(D){var $=be(D[1]);if(!l())return h("@supports missing '{'");var Z=g().concat(d());return u()?R({type:"supports",supports:$,rules:Z}):h("@supports missing '}'")}}function L(){var R=r(),D=f(/^@host\s*/);if(D){if(!l())return h("@host missing '{'");var $=g().concat(d());return u()?R({type:"host",rules:$}):h("@host missing '}'")}}function N(){var R=r(),D=f(/^@media *([^{]+)/);if(D){var $=be(D[1]);if(!l())return h("@media missing '{'");var Z=g().concat(d());return u()?R({type:"media",media:$,rules:Z}):h("@media missing '}'")}}function Y(){var R=r(),D=f(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(D)return R({type:"custom-media",name:be(D[1]),media:be(D[2])})}function G(){var R=r(),D=f(/^@page */);if(D){var $=y()||[];if(!l())return h("@page missing '{'");for(var Z=g(),At;At=v();)Z.push(At),Z=Z.concat(g());return u()?R({type:"page",selectors:$,declarations:Z}):h("@page missing '}'")}}function V(){var R=r(),D=f(/^@([-\w]+)?document *([^{]+)/);if(D){var $=be(D[1]),Z=be(D[2]);if(!l())return h("@document missing '{'");var At=g().concat(d());return u()?R({type:"document",document:Z,vendor:$,rules:At}):h("@document missing '}'")}}function J(){var R=r(),D=f(/^@font-face\s*/);if(D){if(!l())return h("@font-face missing '{'");for(var $=g(),Z;Z=v();)$.push(Z),$=$.concat(g());return u()?R({type:"font-face",declarations:$}):h("@font-face missing '}'")}}var rt=Xt("import"),tt=Xt("charset"),te=Xt("namespace");function Xt(R){var D=new RegExp("^@"+R+"\\s*([^;]+);");return function(){var $=r(),Z=f(D);if(Z){var At={type:R};return At[R]=Z[1].trim(),$(At)}}}function qt(){if(s[0]=="@")return E()||N()||Y()||_()||rt()||tt()||te()||V()||G()||L()||J()}function ee(){var R=r(),D=y();return D?(g(),R({type:"rule",selectors:D,declarations:b()})):h("selector missing")}return Ro(c())}function be(s){return s?s.replace(/^\s+|\s+$/g,""):""}function Ro(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){Ro(o,n)}):r&&typeof r=="object"&&Ro(r,n)}return e&&Object.defineProperty(s,"parent",{configurable:!0,writable:!0,enumerable:!1,value:t||null}),s}let Ew=class extends Do{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),zo(this.currentItem.style,this.currentItem,No)}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&&zo(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+Oo(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(No.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"&&zo(o,this.currentItem,No),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 Oo(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 Oo(s,t,i,r)-Oo(e,n,i,r)}function zo(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 No=["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 Tt{prevPathX=0;prevPathY=0;isUpdatedSVGPathData=!0;isUpdatedSVGPathD=!0;isUpdatedBoundingClientRect=!0;isUpdatedPolymorphPoints=!0;isUpdatedTotalLength=!0;normalizedLines=[];constructor(t){const e=typeof t=="string"?Ql(t):t||[],n=Cw(tu(e));for(let i=0,r=n.length;i<r;i++){const o=n[i];o[0]=="M"?(this.prevPathX=o[1],this.prevPathY=o[2]):this._appendLine(new xt({x:this.prevPathX,y:this.prevPathY,c1x:o[1],c1y:o[2],c2x:o[3],c2y:o[4],toX:o[5],toY:o[6]}))}}_appendLine(t){if(this.isUpdatedSVGPathData=!0,this.isUpdatedSVGPathD=!0,this.isUpdatedBoundingClientRect=!0,this.isUpdatedPolymorphPoints=!0,this.isUpdatedTotalLength=!0,t instanceof Io){Jl(this.prevPathX,this.prevPathY,t.toX,t.toY,t.largeArcFlag,t.sweepFlag,t.rx,t.ry,t.xAxisRotate).forEach(c=>{const[l,u,d,f,p,g,C,y]=c;this.normalizedLines.push(new xt({x:this.prevPathX,y:this.prevPathY,c1x:d,c1y:f,c2x:p,c2y:g,toX:C,toY:y})),this.prevPathX=C,this.prevPathY=y});return}if(t instanceof xt){this.normalizedLines.push(t.clone()),this.prevPathX=t.toX,this.prevPathY=t.toY;return}let e,n,i,r,o,a;t instanceof ww?[e,n,i,r,o,a]=ko(this.prevPathX,this.prevPathY,t.cx,t.cy,t.toX,t.toY):[e,n,i,r,o,a]=os(this.prevPathX,this.prevPathY,t.toX,t.toY),this.normalizedLines.push(new xt({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 Tt,n=t.length;if(n){e.prevPathX=t[0],e.prevPathY=t[1];for(let i=2;i+5<n;i+=6)e._appendLine(new xt({x:e.prevPathX,y:e.prevPathY,c1x:t[i],c1y:t[i+1],c2x:t[i+2],c2y:t[i+3],toX:t[i+4],toY:t[i+5]}))}return e}static fromLines(t){const e=new Tt,n=t.length;if(n){e.prevPathX=t[0].x,e.prevPathY=t[0].y;for(let i=0;i<n;i++)e._appendLine(t[i])}return e}clone(){return Tt.fromLines(this.normalizedLines)}cachedSVGPathData=[];toSVGPathData(){if(this.isUpdatedSVGPathData){const t=[];for(let e=0,n=this.normalizedLines.length;e<n;e++){const i=this.normalizedLines[e];e==0&&t.push(["M",i.x,i.y]),t.push(...i.toSVGPathData())}this.cachedSVGPathData=t,this.isUpdatedSVGPathData=!1}return this.cachedSVGPathData}cachedSVGPathD="";toSVGPathD(){return this.isUpdatedSVGPathD&&(this.cachedSVGPathD=_w(this.toSVGPathData()),this.isUpdatedSVGPathD=!1),this.cachedSVGPathD}toCanvasContext(t){t.beginPath();for(let e=0,n=this.normalizedLines.length;e<n;e++){const i=this.normalizedLines[e];e==0&&t.moveTo(i.x,i.y),i.toCanvasContext(t)}}cachedBoundingClientRect={x:0,y:0,width:0,height:0};getBoundingClientRect(t=2){if(this.isUpdatedBoundingClientRect){const e=[],n=[];if(this.normalizedLines.forEach(i=>{const r=i.getBoundingClientRect(t);e.push(r.x,r.x+r.width),n.push(r.y,r.y+r.height)}),e.length==0||n.length==0)this.cachedBoundingClientRect={x:0,y:0,width:0,height:0};else{const i=Math.min(...e),r=Math.min(...n),o=Math.max(...e),a=Math.max(...n);this.cachedBoundingClientRect={x:F(i,t),y:F(r,t),width:F(o-i,t),height:F(a-r,t)}}this.isUpdatedBoundingClientRect=!1}return this.cachedBoundingClientRect}getBoundingClientRectCenter(t=2){const e=this.getBoundingClientRect(t);return{x:F(e.x+e.width*.5,t),y:F(e.y+e.height*.5,t)}}transform(t){let e;return t.m?e=t.m:(e=new bt,e.translate(t.x||0,t.y||0),e.rotate(t.degree||0,t.centerX,t.centerY),e.scale(t.scaleX||1,t.scaleY||1,t.centerX,t.centerY)),e.isIdentity?this.clone():Tt.fromLines(this.normalizedLines.map(n=>{let i=n.x,r=n.y,o=n.c1x,a=n.c1y,h=n.c2x,c=n.c2y,l=n.toX,u=n.toY;return{x:i,y:r}=e.transformPoint({x:i,y:r}),{x:o,y:a}=e.transformPoint({x:o,y:a}),{x:h,y:c}=e.transformPoint({x:h,y:c}),{x:l,y:u}=e.transformPoint({x:l,y:u}),new xt({x:i,y:r,c1x:o,c1y:a,c2x:h,c2y:c,toX:l,toY:u})}))}cachedTotalLength;getTotalLength(){return(typeof this.cachedTotalLength!="number"||this.isUpdatedTotalLength)&&(this.cachedTotalLength=Math.round(this.normalizedLines.reduce((t,e)=>t+=e.length(),0)),this.isUpdatedTotalLength=!1),this.cachedTotalLength}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,n=1e-6){const i=this.getSubPathDAtLength(e,!0);return Ri(n)(t,0)?i:i.getSubPathDAtLength(t,!1)}getSubPathDAtLength(t,e=!1){const n=new Tt;let i=0,r=!1;for(let o=0,a=this.normalizedLines.length;o<a;o++){const h=this.normalizedLines[o];o==0&&(n.prevPathX=h.x,n.prevPathY=h.y);const c=h.length();if(i+c>t&&!r){r=!0;const l=h.getPointAtSegmentLength(t-i);if(n._appendLine(new xt({x:n.prevPathX,y:n.prevPathY,c1x:l.start.x,c1y:l.start.y,c2x:l.m.x,c2y:l.m.y,toX:l.x,toY:l.y})),e)return n;n.normalizedLines=[],n._appendLine(new xt({x:n.prevPathX,y:n.prevPathY,c1x:l.n.x,c1y:l.n.y,c2x:l.end.x,c2y:l.end.y,toX:h.toX,toY:h.toY})),i+=c;continue}n._appendLine(h),i+=c}return n}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 l=this.getPointAtLength(c),u=(t-l.x)*(t-l.x)+(e-l.y)*(e-l.y);u<o&&(i=l,r=c,o=u)}for(a/=2;a>.5;){const c=r-a,l=this.getPointAtLength(c),u=(t-l.x)*(t-l.x)+(e-l.y)*(e-l.y),d=r+a,f=this.getPointAtLength(d),p=(t-f.x)*(t-f.x)+(e-f.y)*(e-f.y);c>=0&&u<o?(i=l,r=c,o=u):d<=n&&p<o?(i=f,r=d,o=p):a/=2}const h=this.getPointAtLength(r+(r===n?-.1:.1));return{point:i,rotation:r>=n?Nt(h.x,h.y,i.x,i.y):Nt(i.x,i.y,h.x,h.y),distance:Math.sqrt(o)}}cachedPolymorphPoints=[];getPolymorphPoints(){if(this.isUpdatedPolymorphPoints){if(this.normalizedLines.length){const t=this.normalizedLines[0];this.cachedPolymorphPoints=[t.x,t.y].concat(this.normalizedLines.reduce((e,n)=>e.concat([n.c1x,n.c1y,n.c2x,n.c2y,n.toX,n.toY]),[]))}this.isUpdatedPolymorphPoints=!1}return[...this.cachedPolymorphPoints]}getPolymorphPointsPerimeter(){let t=0;const e=this.getPolymorphPoints(),n=e.length;if(n){let i=e[n-2],r=e[n-1];for(let o=0;o<n;o+=6)t+=Le(e[o],e[o+1],i,r),i=e[o],r=e[o+1]}return Math.floor(t)}expendToPolymorphPoints(t){const e=t.length,n=this.getPolymorphPoints(),i=n.length;if(i){const r=[];let o=e-i;const a=Math.ceil(e/i);r.push(["M",n[0],n[1]]);let h=2;for(;h+5<=i-1;){const c=n[h++],l=n[h++],u=n[h++],d=n[h++],f=n[h++],p=n[h++];r.push(["C",c,l,u,d,f,p]);let g=0;for(;g<a&&o>0;)r.push(["C",f,p,f,p,f,p]),o-=6,g++}return new Tt(r)}else return Tt.fromPolymorphPoints(t)}static getInterpolator(t,e){return n=>{const i=Ri(Number.EPSILON);return i(n,0)?t.clone():i(n,1)?e.clone():Tt.fromPolymorphPoints(Pf(t.getPolymorphPoints(),e.getPolymorphPoints(),n).map(r=>F(r,2)))}}}const su=Pw("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 Pw(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 oi(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 Tw(s){const t={left:"start",right:"end",center:"middle",start:"start",end:"end"};return t[s]||t.start}function Mw(s){const t={alphabetic:"alphabetic",hanging:"hanging",top:"text-before-edge",bottom:"text-after-edge",middle:"central"};return t[s]||t.alphabetic}const hs={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 Bo{__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 iu{__root;__ctx;constructor(t,e){this.__root=t,this.__ctx=e}}class ai{__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(hs);for(let e=0,n=t.length;e<n;e++){const i=t[e];this[i]=hs[i].canvas}}__getStyleState(){const t={},e=Object.keys(hs);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(hs);for(let r=0;r<i.length;r++){const o=hs[i[r]],a=this[i[r]];if(o.apply){if(a instanceof iu){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 Bo)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 l=parseFloat(c[4]);const u=this.globalAlpha;u!=null&&(l*=u),e.setAttribute(o.svgAttr+"-opacity",""+l)}}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(su);for(let r=0,o=i.length;r<o;r++){const a=i[r],h=su[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 l=h[0]*c[0]+h[1]*c[1],u=Math.acos(Math.abs(l)),d=this.normalize([h[0]+c[0],h[1]+c[1]]),f=r/Math.sin(u/2),p=t+f*d[0],g=e+f*d[1],C=[-h[1],h[0]],y=[c[1],-c[0]],v=function(E){const _=E[0];return E[1]>=0?Math.acos(_):-Math.acos(_)},b=v(C),x=v(y);this.lineTo(p+C[0]*r,g+C[1]*r),this.arc(p,g,r,b,x)}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:oi(this.__ids),x1:t+"px",x2:n+"px",y1:e+"px",y2:i+"px",gradientUnits:"userSpaceOnUse"},!1);return this.__SVGdefs.appendChild(r),new Bo(r,this)}createRadialGradient(t,e,n,i,r,o){const a=this.__createElement("radialGradient",{id:oi(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 Bo(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":Tw(this.textAlign),"dominant-baseline":Mw(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),l=e+n*Math.sin(i),u=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(c,l),this.__addPathCommand(Mt("A {rx} {ry} {xAxisRotation} {largeArcFlag} {sweepFlag} {endX} {endY}",{rx:n,ry:n,xAxisRotation:0,largeArcFlag:d,sweepFlag:u,endX:a,endY:h})),this.__currentPosition={x:a,y:h}}clip(){const t=this.__closestGroupOrSvg(),e=this.__createElement("clipPath"),n=oi(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,l,u,d,f,p,g,C;if(t.length===3)n=t[1],i=t[2],c=e.width,l=e.height,r=c,o=l;else if(t.length===5)n=t[1],i=t[2],r=t[3],o=t[4],c=e.width,l=e.height;else if(t.length===9)a=t[1],h=t[2],c=t[3],l=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 y=this.__closestGroupOrSvg();this.__currentElement;const v="translate("+n+", "+i+")";if(e instanceof ai){if(u=e.getSvg().cloneNode(!0),u.childNodes&&u.childNodes.length>1){for(d=u.childNodes[0];d.childNodes.length;)C=d.childNodes[0].getAttribute("id"),this.__ids[C]=C,this.__SVGdefs.appendChild(d.childNodes[0]);if(f=u.childNodes[1],f){const b=f.getAttribute("transform");let x;b?x=b+" "+v:x=v,f.setAttribute("transform",x),y.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||l!==e.height)&&(g=this.__document.createElement("canvas"),g.width=r,g.height=o,g.getContext("2d")?.drawImage(e,a,h,c,l,0,0,r,o),e=g),p.setAttribute("transform",v),p.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",e.nodeName==="CANVAS"?e.toDataURL():e.getAttribute("src")),y.appendChild(p))}createPattern(t,e){const n=this.__document.createElementNS("http://www.w3.org/2000/svg","pattern"),i=oi(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 ai&&(n.setAttribute("width",""+t.width),n.setAttribute("height",""+t.height),n.appendChild(t.__rootSVG.childNodes[1]),this.__SVGdefs.appendChild(n)),new iu(n,this)}setLineDash(t){t&&t.length>0?this.lineDash=t.join(","):this.lineDash=null}drawFocusRing(){}createImageData(){}getImageData(){}putImageData(){}globalCompositeOperation(){}setTransform(){}}class Fo{canvas;context;customContext;enablePath2D=!1;currentPath2D=new Path2D;path2Ds=[];currentMatrix=new DOMMatrix;hasSetCustomStrokeStyle=!1;hasSetCustomFillStyle=!1;constructor(t,e,n,i=!1,r=!1){this.canvas=t,this.context=t.getContext("2d",{willReadFrequently:!0}),i&&(this.customContext=new ai({canvas:this.canvas,width:e||this.canvas.width,height:n||this.canvas.height})),this.enablePath2D=typeof r=="boolean"?r:!1}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.enablePath2D&&(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.enablePath2D&&(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.enablePath2D&&this.currentPath2D.closePath(),this}changePath2D(t=this.currentPath2D,e=this.currentMatrix){if(this.enablePath2D){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=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=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=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.enablePath2D&&this.currentPath2D.moveTo(t,e),this}lineTo(t,e){return this.context.lineTo(t,e),this.customContext&&this.customContext.lineTo(t,e),this.enablePath2D&&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.enablePath2D&&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.enablePath2D&&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.enablePath2D&&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.enablePath2D&&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.enablePath2D&&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.enablePath2D&&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,l])=>{h.addColorStop(parseFloat(c),l)}),h}drawImage(t,...e){if(e.length===0)this.context.drawImage(t,0,0);else if(e.length===2){const 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],l=e[7];this.context.drawImage(t,n,i,r,o,a,h,c,l)}else throw new Error("Invalid number of arguments passed to drawImage: "+e.length);return this.customContext&&this.customContext.drawImage(t,...e),this}getImageData(t=0,e=0,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}}}class Q{shouldUpdatePathD=!1;shouldUpdateTransformPathD=!1;shouldUpdateSVGElInDraw=!1;shouldUpdateMInDraw=!0;shouldUpdateAttrsInDraw=!0;shouldUpdateStyleInDraw=!0;id;initD;d;parent;attrs={};style={};initCenterX;initCenterY;_x;_y;_degree;_scaleX;_scaleY;vx;vy;ax;ay;mass;interactive;drag;transform$=new Te;transformSubscription;isMouseIn=!1;isDragging=!1;m;el;constructor(t){this.id=In(4),this.initD=t?.initD,this.setAttr({stroke:"none",fill:"none"}),t?.attrs&&this.setAttr(t.attrs),t?.style&&this.setStyle(t.style),this.initCenterX=t?.centerX,this.initCenterY=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.interactive=typeof t?.interactive=="boolean"?t?.interactive:!0,this.drag=t?.drag,this.transformSubscription=this.transform$.subscribe(()=>{this.shouldUpdateTransformPathD=!0,this.shouldUpdateMInDraw=!0})}destroy(){this.transformSubscription.unsubscribe()}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&&(this.transform$.next({dX:t-this._x}),this._x=t)}get y(){return this._y}set y(t){this._y!==t&&(this.transform$.next({dY:t-this._y}),this._y=t)}rotateTo(t){this._degree!==t&&(this.transform$.next({dDegree:t-this._degree}),this._degree=t)}rotate(t){this.rotateTo(this._degree+t)}get degree(){return this._degree}set degree(t){this._degree!==t&&(this.transform$.next({dDegree:t-this._degree}),this._degree=t)}scaleTo(t,e){const n=this._scaleX,i=this._scaleY;(this._scaleX!==t||this._scaleY!==(e||t))&&(this._scaleX=t,this._scaleY=e||t,this.transform$.next({dScaleX:this._scaleX/n,dScaleY:this._scaleY/i}))}scale(t,e){this.scaleTo(this._scaleX*t,this._scaleY*(e||t))}get scaleX(){return this._scaleX}set scaleX(t){this._scaleX!==t&&(this.transform$.next({dScaleX:t/this._scaleX}),this._scaleX=t)}get scaleY(){return this._scaleY}set scaleY(t){this._scaleY!==t&&(this.transform$.next({dScaleY:t/this._scaleY}),this._scaleY=t)}pathD(t){return t?(this.d=t,this.shouldUpdateTransformPathD=!0,this.shouldUpdateSVGElInDraw=!0):this.initD?this.d||(this.d=this.initD instanceof Tt?this.initD:new Tt(this.initD)):(!this.d||this.shouldUpdatePathD)&&(this.d=new Tt(this.toSVGPathData()),this.shouldUpdatePathD=!1,this.shouldUpdateTransformPathD=!0,this.shouldUpdateSVGElInDraw=!0),this.d}cachedTransformedPathD;transformPathD(){if(!this.m){const{x:t,y:e}=this.transformOrigin();let n=0,i=0;if(this.parent?.dDegree||this.parent?.dScaleX!==1||this.parent?.dScaleY!==1){const o=this.transformOrigin(!0);n=o.x,i=o.y}const r=new bt;r.translate(this.x+(this.parent?.dX||0),this.y+(this.parent?.dY||0)),r.rotate(this.degree,t,e),r.scale(this.scaleX,this.scaleY,t,e),this.parent?.dDegree&&r.rotate(this.parent.dDegree,n,i),(this.parent?.dScaleX!==1||this.parent?.dScaleY!==1)&&r.scale(this.parent?.dScaleX||1,this.parent?.dScaleY||1,n,i),this.m=r}return(this.shouldUpdateTransformPathD||!this.cachedTransformedPathD)&&(this.cachedTransformedPathD=this.pathD().transform({m:this.m}),this.shouldUpdateTransformPathD=!1),this.cachedTransformedPathD}getBaseOptions(){return{initD:this.initD,attrs:{...this.attrs},style:{...this.style},centerX:this.initCenterX,centerY:this.initCenterY,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,interactive:this.interactive,drag:{...this.drag}}}clone(){return this.cloneShape()}cloneShape(){return new Q(this.getBaseOptions())}update(t){this.shouldUpdatePathD=!0}toSVGEl(){return null}toSVGPathData(){return[]}toSVGPathD(){return this.pathD().toSVGPathD()}toCanvasContext(t){this.pathD().toCanvasContext(t)}getBoundingClientRect(t=2){return this.pathD().getBoundingClientRect(t)}getRealBoundingClientRect(t=2){return this.transformPathD().getBoundingClientRect(t)}getBoundingClientRectCenter(t=2){return this.pathD().getBoundingClientRectCenter(t)}getRealBoundingClientRectCenter(t=2){return this.transformPathD().getBoundingClientRectCenter(t)}transformOrigin(t=!1,e=2){let n=0,i=0;if(this.parent&&!t){const r=this.parent.combo.getBoundingClientRectCenter(e);n=r.x-this.parent.dX,i=r.y-this.parent.dY}else if(typeof this.initCenterX>"u"&&typeof this.initCenterY>"u"){const r=this.getBoundingClientRectCenter(e);n=r.x,i=r.y}else n=this.initCenterX||0,i=this.initCenterY||0;return{x:n,y:i}}isPointInPath(t,e,n){if(t instanceof Fo)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 Fo)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}setStyle(t){Object.assign(this.style,t),this.shouldUpdateStyleInDraw=!0}setAttr(t,e){if(typeof t!="string")for(const n in t){const i=t[n];i&&i!=this.getAttr(n)&&(this.attrs[dt(n)]=i,this.shouldUpdateAttrsInDraw=!0)}else e&&e!=this.getAttr(t)&&(this.attrs[dt(t)]=e,this.shouldUpdateAttrsInDraw=!0)}getAttr(t,e){return this.attrs[t]||this.attrs[dt(t)]||e}hasAttr(t){return!!this.getAttr(t)}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.move(this.vx,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})}getSpringMassAlphaTo(t,e){const n=e?.springLength||100,i=e?.spring||5e-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}followTo(t,e=3){this.rotateTo(gt(Nt(this.x,this.y,t.x,t.y)));const{dx:n,dy:i}=Re(q(this.degree),e);this.vx=n,this.vy=i,this.animate()}followAccelerationTo(t,e=.05){this.rotateTo(gt(Nt(this.x,this.y,t.x,t.y)));const{dx:n,dy:i}=Re(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){const e=t.x-this.x,n=t.y-this.y,i=Math.sqrt(e*e+n*n),{x:r,y:o,width:a,height:h}=t.getBoundingClientRect(),{x:c,y:l}=t.getBoundingClientRectCenter(),{x:u,y:d,width:f,height:p}=this.getBoundingClientRect(),{x:g,y:C}=this.getBoundingClientRectCenter();if(i<Math.abs(c-r)+Math.abs(g-u)||i<Math.abs(l-o)+Math.abs(C-d)){const y=Math.atan2(n,e),v={x:0,y:0},b=Qt(-y,e,n),x=Qt(-y,this.vx,this.vy),E=Qt(-y,t.vx,t.vy),_=x.x-E.x;x.x=((this.mass-t.mass)*x.x+2*t.mass*E.x)/(this.mass+t.mass),E.x=_+x.x;const L=Math.abs(x.x)+Math.abs(E.x),N=this.ballRadius+t.ballRadius-Math.abs(v.x-b.x);v.x+=x.x/L*N,b.x+=E.x/L*N;const Y=Qt(y,v.x,v.y),G=Qt(y,b.x,b.y);t.moveTo(this.x+G.x,this.y+G.y),this.moveTo(this.x+Y.x,this.y+Y.y);const V=Qt(y,x.x,x.y),J=Qt(y,E.x,E.y);this.vx=V.x,this.vy=V.y,t.vx=J.x,t.vy=J.y}}checkWall(t){if(!t?.wall)return;const e=typeof t.wall.bounce=="number"?t.wall.bounce:-1,n=t.wall.x,i=t.wall.y,r=t.wall.x+t.wall.width,o=t.wall.y+t.wall.height,{x:a,y:h,width:c,height:l}=this.getBoundingClientRect();t.wall.cycle||!1?(this.x+a>r?this.moveXTo(n-(a+c)):this.x+a+c<n&&this.moveXTo(r-a),this.y+h>o?this.moveYTo(i-(h+l)):this.y+h+l<i&&this.moveYTo(o-h)):(this.x+a+c>r?(this.moveXTo(r-(a+c)),this.vx*=e):this.x+a<n&&(this.moveXTo(n+(a+c)),this.vx*=e),this.y+h+l>o?(this.moveYTo(o-(h+l)),this.vy*=e):this.y+h<i&&(this.moveYTo(i+(h+l)),this.vy*=e))}getTotalLength(){return this.transformPathD().getTotalLength()}getPointAtLength(t){return this.transformPathD().getPointAtLength(t)}interpolate(t){return this.transformPathD().interpolate(t)}trailPath(t=0,e=1){const n=this.getTotalLength(),i=t*n,r=e*n;return{subPathD:this.transformPathD().getSubPathD(i,r),point:this.getPointAtLength(r)}}strokeDashTween(t=1e3,e){const n=this.pathD().getTotalLength();this.setAttr({strokeDasharray:`${n} ${n}`,strokeDashoffset:`${n}`});const i=e?.onUpdate,r=new Vn({frameDuration:t});r.addTween({offset:n},{offset:0},Object.assign(e||{},{onUpdate:(o,a)=>{this.setAttr("strokeDashoffset",""+F(o.offset,2)),i?.(o,a)}})),r.play()}static generateRosetta(t,e,n,i,r){if(r==0)throw new Error("no dividing by zero, please");const o=[],a=360/r;for(let h=0;h<r;h+=1){const c=a*h*Math.PI/180,l=t+2*n*Math.cos(c),u=e+2*n*Math.sin(c);o.push(new Io({x:t,y:e,rx:n,ry:i,xAxisRotate:a*h,largeArcFlag:1,sweepFlag:1,toX:l,toY:u})),o.push(new Io({x:l,y:u,rx:n,ry:i,xAxisRotate:a*h,largeArcFlag:1,sweepFlag:1,toX:t,toY:e}))}return new Q({initD:Tt.fromLines(o)})}}class Rt{shapes=[];svg;forceWidth;attrs={};style={};initCenterX;initCenterY;x;y;degree;scaleX;scaleY;interactive;drag;constructor(t){if(this.initCenterX=t?.centerX,this.initCenterY=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),t?.attrs&&this.setAttr(t.attrs),t?.style&&this.setStyle(t.style),this.interactive=typeof t?.interactive=="boolean"?t?.interactive:!0,this.drag=t?.drag,this.svg=t?.svg,this.forceWidth=t?.forceWidth,t?.svg){this.initCenterX=0,this.initCenterY=0;let e=0,n=0,i=0,r=0;const o=new Ew(t.svg).parse();for(let a=0,h=o.length;a<h;a++){const c=o[a];if(c.type=="viewbox"&&c.width&&c.height){if(e=parseFloat(c.width),n=parseFloat(c.height),t.forceWidth){const p=e/n;i=t.forceWidth,r=i/p}else i=e,r=n;continue}if(c.type!="path"||!Kl(c.path))continue;const l={};for(const p in c)p==="type"||p==="path"||p==="transform"||(l[p]=c[p]);const u=tu(Ql(c.path)),d=[];let f=[];for(let p=0,g=u.length;p<g;p++){const C=u[p];f.push(C),C[0].toLowerCase()=="z"&&(d.push(f),f=[])}f.length&&d.push(f),d.forEach(p=>{const g=new Q({attrs:l,initD:p});if(c.transform){const y=el(c.transform).split();g.moveTo(y.x,y.y),g.rotateTo(y.degree),g.scaleTo(y.scaleX,y.scaleY)}this.addShape(g)})}i&&e&&r&&n&&this.comboScale(i/e,r/n,!0)}}destroy(){this.shapes.forEach(t=>t.destroy())}getBaseOptions(){return{svg:this.svg,forceWidth:this.forceWidth,attrs:{...this.attrs},style:{...this.style},centerX:this.initCenterX,centerY:this.initCenterY,x:this.x,y:this.y,degree:this.degree,scaleX:this.scaleX,scaleY:this.scaleY,interactive:this.interactive,drag:{...this.drag}}}clone(){const t=this.cloneShapeCombo();return t.shapes=this.shapes.map(e=>{const n=e.clone();return e.parent&&(n.parent={...e.parent,combo:t}),n}),t}cloneShapeCombo(){return new Rt(this.getBaseOptions())}update(t){this.shapes.forEach(e=>e.update(t))}addShape(t,e){e?.notCopyFromCombo!==!0&&(t.setAttr(this.attrs),t.setStyle(this.style),t.interactive=t.interactive||this.interactive,t.drag={...this.drag,...t.drag}),t.parent={combo:this,dX:e?.dX||0,dY:e?.dY||0,dDegree:e?.dDegree||0,dScaleX:e?.dScaleX||1,dScaleY:e?.dScaleY||1},this.shapes.push(t)}comboMove(t,e,n=!1){n||(this.x+=t,this.y+=e),this.shapes.forEach(i=>{i.move(t,e)})}comboRotate(t,e=!1){e||(this.degree+=t),this.shapes.forEach(n=>{n.rotate(t)})}comboScale(t,e,n=!1){n||(this.scaleX*=t,this.scaleY*=e||t),this.shapes.forEach(i=>{i.scale(t,e)})}comboTransform(t,e=!1){(typeof t?.x=="number"||typeof t?.y=="number")&&this.comboMove(t?.x||0,t?.y||0,e),typeof t?.degree=="number"&&this.comboRotate(t?.degree||0,e),(typeof t?.scale=="number"||typeof t?.scaleX=="number"||typeof t?.scaleY=="number")&&this.comboScale(t?.scaleX||t?.scale||1,t?.scaleY||t?.scale||1,e)}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};const i=Math.min(...e),r=Math.min(...n),o=Math.max(...e),a=Math.max(...n);return{x:F(i,t),y:F(r,t),width:F(o-i,t),height:F(a-r,t)}}getBoundingClientRectCenter(t=2){if(typeof this.initCenterX=="number"&&typeof this.initCenterY=="number")return{x:this.initCenterX,y:this.initCenterY};const e=this.getBoundingClientRect(t);return{x:F(e.x+e.width*.5,t),y:F(e.y+e.height*.5,t)}}setStyle(t){Object.assign(this.style,t),this.shapes.forEach(e=>{e.setStyle(t)})}setAttr(t,e){if(typeof t!="string"){for(const n in t){const i=t[n];i&&i!=this.getAttr(n)&&(this.attrs[dt(n)]=i)}this.shapes.forEach(n=>{n.setAttr(t)})}else e&&e!=this.getAttr(t)&&(this.attrs[dt(t)]=e,this.shapes.forEach(n=>{n.setAttr(t,e)}))}getAttr(t,e){return this.attrs[t]||this.attrs[dt(t)]||e}hasAttr(t){return!!this.getAttr(t)}sort(){this.shapes.map(t=>({shape:t,perimeter:t.transformPathD().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++){const r=t.shapes[i];this.addShape(new Q({initD:r.pathD().clone()}),{dX:r.x-this.x,dY:r.y-this.y,dDegree:r.degree-this.degree,dScaleX:r.scaleX/this.scaleX,dScaleY:r.scaleY/this.scaleY,notCopyFromCombo:!0})}}strokeDashTween(t,e){switch(e?.type){case"sequence":this.shapes.forEach((o,a)=>{o.strokeDashTween(t,{...e,delay:a,onStart:()=>{a==0&&e?.onGroupStart?.()},onUpdate:()=>{e?.onGroupUpdate?.()},onComplete:()=>{a==this.shapes.length-1&&e?.onGroupComplete?.()}})});break;case"parallel":default:const n=new Vn({frameDuration:t}),i={},r={};this.shapes.forEach((o,a)=>{const h=o.pathD().getTotalLength();i[`offset_${a}`]=h,r[`offset_${a}`]=0,o.setAttr({strokeDasharray:`${h} ${h}`,strokeDashoffset:`${h}`})}),n.addTween(i,r,Object.assign(e||{},{onStart:()=>{e?.onGroupStart?.()},onUpdate:(o,a)=>{for(const h in o){const c=Oi(h).number;this.shapes[c].setAttr("strokeDashoffset",""+F(o[h],2))}e?.onGroupUpdate?.()},onComplete:()=>{e?.onGroupComplete?.()}})),n.play();break}}}function Aw(s,t,e=5){const n=Ri(e);(!n(s.x,t.current.x)||!n(s.y,t.current.y))&&s.followTo(t.current)}function Iw(s,t,e){s.drag&&s.drag.enable&&!s.isDragging&&s.animateEaseTo(t,e)}function kw(s,t){const e=[],n=s.length;for(let i=0;i<n;i++){const r=s[i];if(t?.springLength){const o=t?.springLength||100;r.isDragging||s.filter(a=>a.id!==r.id).forEach(a=>{const h=Nt(r.x,r.y,a.x,a.y);r.animateSpringTo({x:a.x-Math.cos(h)*o,y:a.y-Math.sin(h)*o},t)})}else t?.spring?i>0&&r.animateSpringTo(s[i-1],t):r.animate(t);if(t?.wall&&r.checkWall(t),t?.enableCollision||t?.enableGravityBetweenObjects||t?.enableSpringMassAlpha)for(let o=i+1;o<n;o++)t?.enableCollision&&r.checkCollision(s[o]),t?.enableGravityBetweenObjects&&r.gravitateTo(s[o]),t?.enableSpringMassAlpha&&e.push([r.x,r.y,s[o].x,s[o].y,r.getSpringMassAlphaTo(s[o],t)])}return e}function ru(s){if(s.length<2)throw new Error("shapes个数必须大于等于2");const t=s.length-1,e=new Array(t);for(let i=0;i<t;i++){const r=s[i].transformPathD(),o=s[i+1].transformPathD(),a=r.getPolymorphPoints(),h=o.getPolymorphPoints(),c=a.length>=h.length?a:h;e[i]=Tt.getInterpolator(r.expendToPolymorphPoints(c),o.expendToPolymorphPoints(c))}const n=new Q({initD:""});return i=>{const r=F(t*i,6),o=Math.min(Math.floor(r),t-1),a=F(r-o,6);return n.pathD(e[o](a)),n.setAttr(s[o+1].attrs),n}}function Dw(s){if(s.length<2)throw new Error("shapeCombos个数必须大于等于2");let t;const e=[];s.forEach(o=>{let a;o instanceof Rt?(a=o,a.sort()):(a=new Rt,a.addShape(o)),e.push(a),(!t||t.shapes.length<a.shapes.length)&&(t=a)});const n=[];e.forEach((o,a)=>{o!==t&&o.expendTo(t),o.shapes.forEach((h,c)=>{n[c]=n[c]||[],n[c][a]=h})});const i=[];n.forEach(o=>{i.push(ru(o))});const r=new Rt;return i.forEach(o=>{r.addShape(o(0))}),o=>(i.forEach(a=>{a(o)}),r)}function Lw(s,t=6e3,e){const n=s.findIndex(a=>a instanceof Rt)>=0?Dw(s):ru(s),i=n(0),r=e?.onUpdate,o=new Vn({frameDuration:t});return o.addTween({t:0},{t:1},Object.assign(e||{},{onUpdate:(a,h)=>{r?.(a,h),n(a.t),e?.shapeOrCombo?.(i,a.t)}})),o.play(),i}const cs={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 Yt{_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 Yt?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){this._color.r=B(Math.round(Wt(t,this.r)),0,255)}get g(){return this._color.g}set g(t){this._color.g=B(Math.round(Wt(t,this.g)),0,255)}get b(){return this._color.b}set b(t){this._color.b=B(Math.round(Wt(t,this.b)),0,255)}get a(){return this._color.a}set a(t){this._color.a=B(Wt(t,this.a),0,1)}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},${F(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=Qe){Uo.fromWorkingColorSpace(xe.copy(this),t);const e=xe.r,n=xe.g,i=xe.b;return t!==Qe?`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 Yt(this.color)}copy(t){return this.setColor(t.color),this}copySRGBToLinear(t){return this.r=tn(t.r),this.g=tn(t.g),this.b=tn(t.b),this}copyLinearToSRGB(t){return this.r=en(t.r),this.g=en(t.g),this.b=en(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}}closet(t="#000000",e="#ffffff"){return this.opposite(!0,t,e).opposite(!0,t,e)}lighten(t){t=B(t,0,1);const{r:e,g:n,b:i,a:r}=this.color;return r==0?this.a=t:(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,a:r}=this.color;return r==0?this.a=t:(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 xe.lerpColors(new Yt(t),new Yt(e),n).toString()}catch{return e}}static random(){return xe.setHEX(Math.random()*16777215).toString()}static nextIndex=0;static next(t=Yt.nextIndex){Yt.nextIndex=t;const e=Object.keys(cs),n=e.length;return xe.setHEX(cs[e[Yt.nextIndex++%n]]).toString()}setColorName(t){const e=cs[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(cs).map(t=>xe.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=Ef(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 h=a<=.5?a*(1+o):a+o-a*o,c=2*a-h;this.r=$o(c,h,r+.3333333333333333)*255,this.g=$o(c,h,r)*255,this.b=$o(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 l=r-o;switch(h=c<=.5?l/(r+o):l/(2-r-o),r){case e:a=(n-i)/l+(n<i?6:0);break;case n:a=(i-e)/l+2;break;case i:default:a=(e-n)/l+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=Ss(n.h,i.h,e),o=Ss(n.s,i.s,e),a=Ss(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),h=Math.floor(r/60)%6,c=r/60-Math.floor(r/60),l=a*(1-o),u=a*(1-c*o),d=a*(1-(1-c)*o),f=[[a,d,l],[u,a,l],[l,a,d],[l,u,a],[d,l,a],[a,l,u]][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 l=h==0?0:c,u=o===0?0:h/o,d=o/255;return t&&t.setHSV(l,u,d,r),{h:l,s:u,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 xe=new Yt,ou="",Qe="srgb",Yo="srgb-linear",Xo="linear",hi="srgb";function tn(s){return s<.04045?s*.0773993808:Math.pow(s*.9478672986+.0521327014,2.4)}function en(s){return s<.0031308?s*12.92:1.055*Math.pow(s,.41666)-.055}const au=new wn().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),hu=new wn().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715),cu=[.64,.33,.3,.6,.15,.06],lu=[.2126,.7152,.0722],uu=[.3127,.329],Uo={enabled:!0,workingColorSpace:Yo,spaces:{},convert:function(s,t,e){return this.enabled===!1||t===e||!t||!e||(this.spaces[t].transfer===hi&&(s.r=tn(s.r),s.g=tn(s.g),s.b=tn(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===hi&&(s.r=en(s.r),s.g=en(s.g),s.b=en(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===ou?Xo: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}};Uo.define({[Yo]:{primaries:cu,whitePoint:uu,transfer:Xo,toXYZ:au,fromXYZ:hu,luminanceCoefficients:lu,workingColorSpaceConfig:{unpackColorSpace:Qe},outputColorSpaceConfig:{drawingBufferColorSpace:Qe}},[Qe]:{primaries:cu,whitePoint:uu,transfer:hi,toXYZ:au,fromXYZ:hu,luminanceCoefficients:lu,outputColorSpaceConfig:{drawingBufferColorSpace:Qe}}});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 Rw{PARENT_EL;SVG_EL=null;CANVAS_EL=null;ctx=null;rect={x:0,y:0,width:0,height:0};size$=new nc(null);resizeSubscription;mpg=Ze();mouseSubscription;shapes=[];shapeTap$=new nc(null);tapSubscription;lastMouseInShapeId="";draggingShapeId="";prevCursor="default";constructor(t=document.documentElement,e="canvas",n=!1){this.PARENT_EL=t,(e=="svg"||e=="canvas")&&cl(this.PARENT_EL),e=="svg"&&(this.SVG_EL=Ke("svg"),xn(this.PARENT_EL,this.SVG_EL)),e=="canvas"&&(this.CANVAS_EL=dl("canvas"),xn(this.PARENT_EL,this.CANVAS_EL)),this.resizeSubscription=Mo(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&&we(this.SVG_EL,{viewBox:`0 0 ${this.rect.width} ${this.rect.height}`,width:`${this.rect.width}`,height:`${this.rect.height}`}),this.CANVAS_EL&&(we(this.CANVAS_EL,{width:`${this.rect.width}`,height:`${this.rect.height}`}),this.ctx=new Fo(this.CANVAS_EL,this.rect.width,this.rect.height,n)),this.size$.next(i)}),this.mouseSubscription=Xl(this.SVG_EL||this.CANVAS_EL||this.PARENT_EL,{useMousePoint:this.mpg}).subscribe(()=>{}),this.tapSubscription=Al(this.PARENT_EL).subscribe(i=>{for(const r of this.shapes)if(r.isMouseIn){this.shapeTap$.next(r);break}})}destroy(){this.resizeSubscription.unsubscribe(),this.mouseSubscription.unsubscribe(),this.tapSubscription.unsubscribe()}setCursor(t="default"){t!=this.prevCursor&&(this.PARENT_EL.style.cursor=t,this.prevCursor=t)}draw(...t){if(t.length){const e=[];t.forEach(n=>{n instanceof Rt?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)}),Af(this.shapes,e)}this.ctx&&this.ctx.clearRect(),this.lastMouseInShapeId="",this.mpg.current.isDown||(this.draggingShapeId="");for(const e of this.shapes){const{x:n,y:i}=e.transformOrigin();let r=0,o=0;if(e.parent?.dDegree||e.parent?.dScaleX!==1||e.parent?.dScaleY!==1){const a=e.transformOrigin(!0);r=a.x,o=a.y}if(e.shouldUpdatePathD&&e.pathD(),this.SVG_EL){if(!e.el||e.shouldUpdateSVGElInDraw){const a=e.toSVGEl();e.el?a&&(e.el.remove(),e.el=a,xn(this.SVG_EL,e.el),we(e.el,{id:e.id})):(e.el=a||Zl(),xn(this.SVG_EL,e.el),we(e.el,{id:e.id})),vw(e.el)&&we(e.el,{d:e.toSVGPathD()}),e.shouldUpdateSVGElInDraw=!1,e.shouldUpdateAttrsInDraw=!0,e.shouldUpdateStyleInDraw=!0,e.shouldUpdateMInDraw=!0}if(e.shouldUpdateAttrsInDraw&&(Ra(e.attrs)||we(e.el,e.attrs),e.shouldUpdateAttrsInDraw=!1),e.shouldUpdateStyleInDraw&&(Ra(e.style)||vn(e.el,e.style),e.shouldUpdateStyleInDraw=!1),e.shouldUpdateMInDraw||!e.m){const a=new bt;a.translate(e.x+(e.parent?.dX||0),e.y+(e.parent?.dY||0)),a.rotate(e.degree,n,i),a.scale(e.scaleX,e.scaleY,n,i),e.parent?.dDegree&&a.rotate(e.parent.dDegree,r,o),(e.parent?.dScaleX!==1||e.parent?.dScaleY!==1)&&a.scale(e.parent?.dScaleX||1,e.parent?.dScaleY||1,r,o),we(e.el,{transform:a.toString()}),e.m=a,e.shouldUpdateMInDraw=!1}}if(this.ctx&&(this.ctx.save(),this.ctx.translate(e.x+(e.parent?.dX||0),e.y+(e.parent?.dY||0)),this.ctx.rotate(q(e.degree),n,i),this.ctx.scale(e.scaleX,e.scaleY,n,i),e.parent?.dDegree&&this.ctx.rotate(q(e.parent.dDegree),r,o),(e.parent?.dScaleX!==1||e.parent?.dScaleY!==1)&&this.ctx.scale(e.parent?.dScaleX||1,e.parent?.dScaleY||1,r,o),e.m=this.ctx.currentMatrix,Sl(this.ctx,e.attrs),e.toCanvasContext(this.ctx),this.ctx.hasSetCustomStrokeStyle&&this.ctx.stroke(),this.ctx.hasSetCustomFillStyle&&this.ctx.fill()),e.interactive?this.SVG_EL?e.isMouseIn=e.isPointInPath(this.SVG_EL,this.mpg.current.x,this.mpg.current.y)||e.isPointInStroke(this.SVG_EL,this.mpg.current.x,this.mpg.current.y):this.ctx?e.isMouseIn=e.isPointInPath(this.ctx,this.mpg.current.x,this.mpg.current.y)||e.isPointInStroke(this.ctx,this.mpg.current.x,this.mpg.current.y):e.isMouseIn=!1:e.isMouseIn=!1,e.isMouseIn&&(this.setCursor("pointer"),this.lastMouseInShapeId=e.id),e.isDragging=e.id==this.draggingShapeId,this.mpg.current.isDown&&(e.isDragging||!this.draggingShapeId&&e.isMouseIn&&e.drag&&e.drag.enable)){this.setCursor("grabbing"),e.isDragging=!0,this.draggingShapeId=e.id;let a=this.mpg.current.x-this.mpg.start.x,h=this.mpg.current.y-this.mpg.start.y;if(a||h){if(e.drag&&e.drag.enable&&e.drag.alongPath){const c=e.drag.alongPath.transform({m:e.m}).closestPoint(this.mpg.current.x,this.mpg.current.y);a=c.point.x-e.x,h=c.point.y-e.y}(a||h)&&(e.move(a,h),e.parent?.combo.shapes.forEach(c=>{c.drag?.followSibling&&c!==e&&c.move(a,h)}))}this.mpg.setStart(this.mpg.current)}else e.isMouseIn&&e.drag&&e.drag.enable&&this.setCursor("grab");this.ctx&&this.ctx.restore()}!this.lastMouseInShapeId&&!this.draggingShapeId&&this.setCursor("default")}clear(){this.shapes.forEach(t=>{t.el&&(t.el.remove(),delete t.el)}),this.ctx&&this.ctx.clearRect(),this.shapes=[]}drawMouseMoveLine(t){const e=t?.brushSize||4,n=t?.brushColor||"#000000";let i=!1;const r=ii(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 Yt(i),o=r.r,a=r.g,h=r.b,c=ii(this.SVG_EL||this.CANVAS_EL||this.PARENT_EL).subscribe(l=>{if(this.ctx){const u=this.ctx.getImageData(0,0,this.ctx.canvas.width,this.ctx.canvas.height),d=u.data;for(let f=0;f<n;f++){const p=Math.random()*Math.PI*2,g=Math.random()*e,C=l.current.x+Math.cos(p)*g|0,y=l.current.y+Math.sin(p)*g|0,v=(C+y*u.width)*4;d[v]=o,d[v+1]=a,d[v+2]=h,d[v+3]=255}this.ctx.putImageData(u)}});return()=>{c.unsubscribe()}}downloadSVG=()=>{this.SVG_EL&&Sw(this.SVG_EL)}}class nn extends Q{lineLength;startColor;endColor;constructor(t){super({...t,centerX:0,centerY:0}),this.lineLength=t?.lineLength||0,this.startColor=t?.startColor,this.endColor=t?.endColor,this.setAttr({strokeWidth:this.getAttr("strokeWidth")||"1",stroke:this.startColor||this.getAttr("stroke")||"#000000"})}cloneShape(){return new nn({...super.getBaseOptions(),lineLength:this.lineLength,startColor:this.startColor,endColor:this.endColor})}lineToAbsolutePoint(t){const e=gt(Nt(this.x,this.y,t.x,t.y)),n=Le(this.x,this.y,t.x,t.y);(e!=this.degree||n!=this.lineLength)&&(e!=this.degree&&this.rotateTo(e),n!=this.lineLength&&(this.lineLength=n),this.shouldUpdatePathD=!0)}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})}getBoundingClientRect(){return{x:0,y:0,width:this.lineLength,height:parseFloat(this.getAttr("strokeWidth"))}}toSVGPathData(){return[["m",0,0],["l",this.lineLength,0]]}toCanvasContext(t){this.startColor&&this.endColor&&this.setAttr({stroke:t.createLinearGradient(0,0,this.lineLength,0,{0:this.startColor,1:this.endColor})}),t.beginPath(),t.moveTo(0,0),t.lineTo(this.lineLength,0)}intersection(t){const e=this.transformPathD().normalizedLines[0],n=t.transformPathD().normalizedLines[0];return e.intersection(n)}}class Go extends Q{cx;cy;toX;toY;isLineThrough;constructor(t){super(t),this.cx=t?.cx||0,this.cy=t?.cy||0,this.toX=t?.toX||0,this.toY=t?.toY||0,this.isLineThrough=typeof t?.isLineThrough=="boolean"?t.isLineThrough:!1,this.setAttr({strokeWidth:this.getAttr("strokeWidth")||"1",stroke:this.getAttr("stroke")||"#000000"})}cloneShape(){return new Go({...super.getBaseOptions(),cx:this.cx,cy:this.cy,toX:this.toX,toY:this.toY,isLineThrough:this.isLineThrough})}update(t){typeof t.cx=="number"&&(this.cx=t.cx,this.shouldUpdatePathD=!0),typeof t.cy=="number"&&(this.cy=t.cy,this.shouldUpdatePathD=!0),typeof t.toX=="number"&&(this.toX=t.toX,this.shouldUpdatePathD=!0),typeof t.toY=="number"&&(this.toY=t.toY,this.shouldUpdatePathD=!0),typeof t.isLineThrough=="boolean"&&(this.isLineThrough=t.isLineThrough,this.shouldUpdatePathD=!0)}toSVGPathData(){if(this.isLineThrough){const t=this.cx*2-(0+this.toX)/2,e=this.cy*2-(0+this.toY)/2;return[["m",0,0],["q",t,e,this.toX,this.toY]]}else return[["m",0,0],["q",this.cx,this.cy,this.toX,this.toY]]}toCanvasContext(t){if(t.beginPath(),t.moveTo(0,0),this.isLineThrough){const e=this.cx*2-(0+this.toX)/2,n=this.cy*2-(0+this.toY)/2;t.quadraticCurveTo(e,n,this.toX,this.toY)}else t.quadraticCurveTo(this.cx,this.cy,this.toX,this.toY)}}class ci extends Q{points;isStraight;constructor(t){super(t),this.points=t?.points||[],this.isStraight=typeof t?.isStraight=="boolean"?t.isStraight:!0,this.setAttr({strokeWidth:this.getAttr("strokeWidth")||"1",stroke:this.getAttr("stroke")||"#000000"})}cloneShape(){return new ci({...super.getBaseOptions(),points:[...this.points],isStraight:this.isStraight})}update(t){"points"in t&&(this.points=[...t.points||this.points],this.shouldUpdatePathD=!0),typeof t.isStraight=="boolean"&&(this.isStraight=t.isStraight,this.shouldUpdatePathD=!0)}toSVGPathData(){const t=[];if(this.points.length<3)return t;const e=this.points.length;if(this.isStraight){t.push(["m",this.points[0].x,this.points[0].y]);for(let n=1;n<=e-1;n++)t.push(["l",this.points[n].x-this.points[n-1].x,this.points[n].y-this.points[n-1].y]);t.push(["z"])}else{const n=(this.points[0].x+this.points[e-1].x)/2,i=(this.points[0].y+this.points[e-1].y)/2;let r=n,o=i;t.push(["m",r,o]);for(let a=0;a<e-1;a++){const h=(this.points[a].x+this.points[a+1].x)/2,c=(this.points[a].y+this.points[a+1].y)/2;t.push(["q",this.points[a].x-r,this.points[a].y-o,h-r,c-o]),r=h,o=c}t.push(["q",this.points[e-1].x-r,this.points[e-1].y-o,n-r,i-o])}return t}toCanvasContext(t){if(this.points.length<3)return;t.beginPath();const e=this.points.length;if(this.isStraight){t.moveTo(this.points[0].x,this.points[0].y);for(let n=1;n<=e-1;n++)t.lineTo(this.points[n].x,this.points[n].y);t.closePath()}else{const n=(this.points[0].x+this.points[e-1].x)/2,i=(this.points[0].y+this.points[e-1].y)/2;t.moveTo(n,i);for(let r=0;r<e-1;r++){const o=(this.points[r].x+this.points[r+1].x)/2,a=(this.points[r].y+this.points[r+1].y)/2;t.quadraticCurveTo(this.points[r].x,this.points[r].y,o,a)}t.quadraticCurveTo(this.points[e-1].x,this.points[e-1].y,n,i)}}isPointInShape(t){const e=this.points.length;let n=!1;const i=2e-10;for(let r=0,o=e-1;r<e;o=r,r++){const a=this.points[r].x,h=this.points[r].y,c=this.points[o].x,l=this.points[o].y;if(a===t.x&&h===t.y||c===t.x&&l===t.y||t.y===h&&t.y===l)return!0;if(t.y>=h&&t.y<l||t.y<h&&t.y>=l){const u=(c-a)/(l-h),d=a+u*(t.y-h);if(d===t.x||Math.abs(d-t.x)<i)return!0;d>t.x&&(n=!n)}}return n}[Symbol.iterator](){let t=-1;return{next:()=>({value:t<=this.points.length-1?this.points[++t]:void 0,done:t>=this.points.length})}}static generate(t,e,n,i){const r=[];for(let o=0;o<i;o++){const a=o/i*2*Math.PI,{dx:h,dy:c}=Re(a,n);r.push({x:t+h,y:e+c})}return new ci({points:r})}}class Vo extends Rt{length=100;constructor(t){super(t);const e=new nn({drag:{followSibling:!0},lineLength:this.length});this.addShape(e);const n=new nn({drag:{followSibling:!0},lineLength:20+Math.random()*20});this.addShape(n,{dX:90-Math.random()*40,dDegree:Math.random()*70});const i=new nn({drag:{followSibling:!0},lineLength:20+Math.random()*20});this.addShape(i,{dX:90-Math.random()*40,dDegree:-Math.random()*70}),this.comboRotate(-90,!0)}cloneShapeCombo(){return new Vo(super.getBaseOptions())}}class _n extends Q{ballRadius;constructor(t){super(t),this.ballRadius=t?.ballRadius||0}cloneShape(){return new _n({...super.getBaseOptions(),ballRadius:this.ballRadius})}update(t){typeof t.ballRadius=="number"&&(this.ballRadius=t.ballRadius,this.shouldUpdatePathD=!0)}getBoundingClientRect(){return{x:-this.ballRadius,y:-this.ballRadius,width:this.ballRadius*2,height:this.ballRadius*2}}toSVGEl(){const t=Ke("circle");return this.setAttr({cx:"0",cy:"0",r:String(this.ballRadius)}),t}toSVGPathData(){return this.ballRadius?[["m",0,-this.ballRadius],["a",this.ballRadius,this.ballRadius,0,1,1,0,2*this.ballRadius],["a",this.ballRadius,this.ballRadius,0,1,1,0,-2*this.ballRadius],["z"]]:[["m",0,0]]}toCanvasContext(t){t.beginPath(),t.arc(0,0,this.ballRadius,0,Math.PI*2,!0),t.closePath()}eq(t){return this.x===t.x&&this.y===t.y&&this.ballRadius===t.ballRadius&&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 yn(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}}}class qo extends Q{constructor(t){super(t)}cloneShape(){return new qo({...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 Ne extends Q{rectWidth;rectHeight;rectBorderRadius;constructor(t){super(t),this.rectWidth=t.rectWidth||0,this.rectHeight=t.rectHeight||0,this.rectBorderRadius=t.rectBorderRadius||0}cloneShape(){return new Ne({...super.getBaseOptions(),rectWidth:this.rectWidth,rectHeight:this.rectHeight,rectBorderRadius:this.rectBorderRadius})}update(t){typeof t.rectWidth=="number"&&(this.rectWidth=t.rectWidth,this.shouldUpdatePathD=!0),typeof t.rectHeight=="number"&&(this.rectHeight=t.rectHeight,this.shouldUpdatePathD=!0),typeof t.rectBorderRadius=="number"&&(this.rectBorderRadius=t.rectBorderRadius,this.shouldUpdatePathD=!0)}getBoundingClientRect(){return{x:0,y:0,width:this.rectWidth,height:this.rectHeight}}toSVGEl(){const t=Ke("rect");return this.setAttr({x:"0",y:"0",width:String(this.rectWidth),height:String(this.rectHeight),rx:String(this.rectBorderRadius),ry:String(this.rectBorderRadius)}),t}toSVGPathData(){return this.rectBorderRadius?[["m",this.rectBorderRadius,0],["l",this.rectWidth-this.rectBorderRadius*2,0],["a",this.rectBorderRadius,this.rectBorderRadius,0,0,1,this.rectBorderRadius,this.rectBorderRadius],["l",0,this.rectHeight-this.rectBorderRadius*2],["a",this.rectBorderRadius,this.rectBorderRadius,0,0,1,-this.rectBorderRadius,this.rectBorderRadius],["l",this.rectBorderRadius*2-this.rectWidth,0],["a",this.rectBorderRadius,this.rectBorderRadius,0,0,1,-this.rectBorderRadius,-this.rectBorderRadius],["l",0,this.rectBorderRadius*2-this.rectHeight],["a",this.rectBorderRadius,this.rectBorderRadius,0,0,1,this.rectBorderRadius,-this.rectBorderRadius],["z"]]:[["m",0,0],["l",this.rectWidth,0],["l",0,this.rectHeight],["l",-this.rectWidth,0],["z"]]}toCanvasContext(t){t.beginPath(),this.rectBorderRadius<=0?t.rect(0,0,this.rectWidth,this.rectHeight):(t.moveTo(0,this.rectBorderRadius),t.lineTo(0,this.rectHeight-this.rectBorderRadius),t.quadraticCurveTo(0,this.rectHeight,this.rectBorderRadius,this.rectHeight),t.lineTo(this.rectWidth-this.rectBorderRadius,this.rectHeight),t.quadraticCurveTo(this.rectWidth,this.rectHeight,this.rectWidth,this.rectHeight-this.rectBorderRadius),t.lineTo(this.rectWidth,this.rectBorderRadius),t.quadraticCurveTo(this.rectWidth,0,this.rectWidth-this.rectBorderRadius,0),t.lineTo(this.rectBorderRadius,0),t.quadraticCurveTo(0,0,0,this.rectBorderRadius)),t.closePath()}static fromCubicBezier(t,e,n,i,r,o,a,h){const l=new xt({x:t,y:e,c1x:n,c1y:i,c2x:r,c2y:o,toX:a,toY:h}).getBoundingClientRect();return new Ne({x:l.x,y:l.y,rectWidth:l.width,rectHeight:l.height})}eq(t){return this.x===t.x&&this.y===t.y&&this.rectWidth===t.rectWidth&&this.rectHeight===t.rectHeight&&this.rectBorderRadius===t.rectBorderRadius}intersection(t){return!(this.x+this.rectWidth<t.x||t.x+t.rectWidth<this.x||this.y+this.rectHeight<t.y||t.y+t.rectHeight<this.y)}isPointInShape(t){return t.x>=this.x&&t.x<=this.x+this.rectWidth&&t.y>=this.y&&t.y<=this.y+this.rectHeight}}class jo extends Q{rx;ry;constructor(t){super(t),this.rx=t?.heartRx||10,this.ry=t?.heartRy||10}cloneShape(){return new jo({...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 Ho extends Q{rx;ry;constructor(t){super(t),this.rx=t?.heartRx||50,this.ry=t?.heartRy||50}cloneShape(){return new Ho({...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 Wo extends Q{r;constructor(t){super(t),this.r=t?.starR||20}cloneShape(){return new Wo({...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 Jo extends Q{constructor(t){super(t)}cloneShape(){return new Jo({...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 Zo extends Q{constructor(t){super(t)}cloneShape(){return new Zo({...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 Ko extends Q{constructor(t){super({...t,initD:"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 Ko({...super.getBaseOptions()})}}class Qo extends Q{rx;ry;constructor(t){super(t),this.rx=t?.rx||0,this.ry=t?.ry||0}cloneShape(){return new Qo({...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}}toSVGEl(){const t=Ke("ellipse");return this.setAttr({cx:"0",cy:"0",rx:String(this.rx),ry:String(this.ry)}),t}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 ta extends Rt{showFlame;flame;ship;constructor(t){super(t),this.showFlame=typeof t?.showFlame=="boolean"?t?.showFlame:!0,this.flame=new Q({initD:[["M",-15,0],["L",-2.5,-5],["L",-2.5,5],["Z"]],drag:{followSibling:!0}}),this.showFlame&&this.addShape(this.flame),this.ship=new Q({initD:[["M",10,0],["L",-10,10],["L",-5,0],["L",-10,-10],["L",10,0],["Z"]],drag:{followSibling:!0}}),this.addShape(this.ship)}cloneShapeCombo(){return new ta({...super.getBaseOptions(),showFlame:this.showFlame})}update(t){typeof t?.showFlame=="boolean"&&(this.shapes=[],this.showFlame=t?.showFlame,this.showFlame&&this.addShape(this.flame),this.addShape(this.ship))}}class ea extends Rt{width;height;cornerRadius;constructor(t){super(t),this.width=t.segmentWidth,this.height=t.segmentHeight,this.cornerRadius=typeof t.segmentCornerRadius=="number"?t.segmentCornerRadius:this.height*.5;const e=new Ne({drag:{followSibling:!0},rectWidth:this.width+this.cornerRadius*2,rectHeight:this.height,rectBorderRadius:this.cornerRadius});this.addShape(e,{dX:0-this.cornerRadius,dY:0-this.height*.5});const n=new _n({drag:{followSibling:!0},ballRadius:2});this.addShape(n);const i=new _n({drag:{followSibling:!0},ballRadius:2});this.addShape(i,{dX:0+this.width})}cloneShapeCombo(){return new ea({...super.getBaseOptions(),segmentWidth:this.width,segmentHeight:this.height,segmentCornerRadius:this.cornerRadius})}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 na extends Rt{options;value$=new Te;subscription;constructor(t){super(t),this.options=t;const e=t?.sliderMin||0,n=t?.sliderMax||100,i=t?.sliderStep||1,r=Tf(e,n,i),o=r(typeof t?.sliderDefaultValue=="number"?B(t.sliderDefaultValue,e,n):e);this.value$.next(o);const a=o/(n-e),h=t?.sliderWidth||100,c=t?.sliderHeight||4,l=c*.5,u=c*2.5,d=t?.sliderBackgroundColor||"#f5f5f5",f=t?.sliderForegroundColor||"#5a82f0",p=new Ne({rectWidth:h,rectHeight:c,rectBorderRadius:l,attrs:{fill:d},drag:{enable:!1}});this.addShape(p);const g=new Ne({rectWidth:h*a,rectHeight:c,rectBorderRadius:l,attrs:{fill:f},drag:{enable:!1}});this.addShape(g);const C=new _n({x:h*a,y:l,ballRadius:u,attrs:{fill:f},drag:{enable:!0,alongPath:new Tt([["m",0,0],["l",h,0]])}});this.addShape(C),this.subscription=C.transform$.subscribe(({dX:y})=>{console.log(y);const v=(C.x-p.x)/h;g.update({rectWidth:h*v}),this.value$.next(r(v*(n-e)+e))})}destroy(){super.destroy(),this.subscription.unsubscribe()}cloneShapeCombo(){return new na({...super.getBaseOptions(),...this.options})}}class ls extends Q{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 ls({...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}=Re(q(this.startDegree),this.radius),{dx:n,dy:i}=Re(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 sa extends Rt{half;lineWidth;width;height;bgColor;startColor;endColor;startDegree;endDegree;percent=0;ringBg;ring;lines=[];indicatorLineCount;constructor(t){if(super(t),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 ls({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 ls({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 r=this.ringBg.radius-20-17;for(let o=0;o<this.indicatorLineCount;o++){const a=new nn({lineLength:17,startColor:this.startColor,endColor:this.endColor,attrs:{"stroke-linecap":"round","stroke-width":String(2),stroke:this.bgColor}});this.lines.push(a);const h=-90+this.startDegree+(this.endDegree-this.startDegree)/(this.indicatorLineCount-1)*o;this.addShape(a,{dX:this.ringBg.x+Math.cos(q(h))*r,dY:this.ringBg.y+Math.sin(q(h))*r,dDegree:h})}}this.setPercent(t.percent||0)}cloneShapeCombo(){return new sa({...super.getBaseOptions(),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})}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)}}class Cn extends Q{text;width=0;height=0;constructor(t){super(t),this.text=t.text,this.setAttr({fontSize:"10px",fontFamily:'system-ui, Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", Roboto, Oxygen, Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif',emojiFontFamily:'"Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji", "EmojiOne Color", "Android Emoji", "Twemoji Mozilla", "system emoji", sans-serif',fill:"#666666",stroke:"none","alignment-baseline":"middle",textAnchor:"start",...this.attrs});const e=Oi(this.getAttr("fontSize"),10).number,n=Oi(this.getAttr("fontWeight"),400).number,i=Cn.measureText(this.text,e,n);this.width=i.width,this.height=i.height}cloneShape(){return new Cn({...super.getBaseOptions(),text:this.text})}toSVGEl(){const t=Ke("text");t.setAttribute("x","0"),t.setAttribute("y","0"),t.style.alignmentBaseline="middle";const e=this.text.split(`
|
|
40
|
+
`);if(e.length<=1)t.innerHTML=this.text;else{const n=this.getAttr("line-height","1.2em");e.forEach((i,r)=>{if(i.trim()){const o=Ke("tspan");o.setAttribute("x","0"),o.setAttribute("dy",r>0?n:"0"),o.innerHTML=i.trim(),o.style.alignmentBaseline="middle",t.append(o)}})}return t}toSVGPathData(){return[]}toCanvasContext(t){const e=this.text.split(`
|
|
41
|
+
`);if(e.length<=1)t.fillText(this.text,0,0);else{const n=t.measureText(this.text),r=(n.actualBoundingBoxAscent+n.actualBoundingBoxDescent)*parseFloat(this.getAttr("line-height","1.2em"));let o=0;e.forEach((a,h)=>{a.trim()&&(o+=h>0?r:0,t.fillText(a.trim(),0,o))})}}static measureText(t,e=12,n=400){const i=document.createElement("span");i.style.visibility="hidden",i.style.margin="0",i.style.padding="0",i.style.inset="0",i.style.whiteSpace="nowrap",i.style.overflow="visible",i.style.fontSize=e+"px",i.style.fontWeight=n.toString(),i.innerText=t,document.body.appendChild(i);const r=i.offsetWidth,o=i.offsetHeight;return document.body.removeChild(i),{width:r,height:o}}static getFixedWidthText(t,e,n=12,i=400,r="..."){let o="";if(!t||e<n)return o;const a=t.split("");let h=r?Cn.measureText(r,n,i).width:0;for(let c=0,l=a.length;c<l;c++)if(h+=Cn.measureText(a[c],n,i).width,h>e){r&&(o+=r);break}else o+=a[c];return o}}class ia extends Rt{options;constructor(t){super(t),this.options=t;const{shapeCreator:e,width:n,height:i,x:r,y:o,particleCount:a,angle:h,spread:c,startVelocity:l,decay:u,gravity:d,drift:f,ticks:p,colors:g,scalar:C,flat:y}=Object.assign({shapeCreator:()=>new Ne({rectWidth:10,rectHeight:10}),width:100,height:100,x:.5,y:.6,particleCount:100,angle:90,spread:70,startVelocity:45,decay:.9,gravity:1,drift:0,ticks:200,colors:Yt.getColors(),scalar:1,flat:!1},t||{}),v=(_,L)=>{_.x=n*r,_.y=i*o,_.scaleX=C,_.scaleY=C;const N=g[L%g.length];_.setAttr({fill:N}),_.interactive=!1,_.wobble=Math.random()*10,_.wobbleSpeed=Math.min(.11,Math.random()*.1+.05),_.velocity=l*.5+Math.random()*l,_.angle2D=-b+(.5*x-Math.random()*x),_.tiltAngle=(Math.random()*(.75-.25)+.25)*Math.PI,_.tick=0,_.totalTicks=p,_.decay=u,_.drift=f,_.random=Math.random()+2,_.tiltSin=0,_.tiltCos=0,_.wobbleX=0,_.wobbleY=0,_.gravity=d*3,_.scalar=C,_.flat=y,_.color=new Yt(N)},b=q(h),x=q(c);let E=a;for(;E;){const _=e();v(_,E),_.clone=(L=>()=>{const N=e();return v(N,L),N})(E),this.addShape(_),E--}}cloneShapeCombo(){return new ia(this.options)}update(){return this.shapes=this.shapes.filter(t=>{t.x+=Math.cos(t.angle2D)*t.velocity+t.drift,t.y+=Math.sin(t.angle2D)*t.velocity+t.gravity,t.velocity*=t.decay,t.flat?(t.wobble=0,t.wobbleX=t.x+10*t.scalar,t.wobbleY=t.y+10*t.scalar,t.tiltSin=0,t.tiltCos=0,t.random=1):(t.wobble+=t.wobbleSpeed,t.wobbleX=t.x+10*t.scalar*Math.cos(t.wobble),t.wobbleY=t.y+10*t.scalar*Math.sin(t.wobble),t.tiltAngle+=.1,t.tiltSin=Math.sin(t.tiltAngle),t.tiltCos=Math.cos(t.tiltAngle),t.random=Math.random()+2);const e=t.tick++/t.totalTicks,n=t.x+t.random*t.tiltCos,i=t.y+t.random*t.tiltSin,r=t.wobbleX+t.random*t.tiltCos,o=t.wobbleY+t.random*t.tiltSin;return t.setAttr("fill",t.color.setAlpha(1-e).toString()),t.degree=gt(Math.PI/10*t.wobble),t.scaleX=Math.abs(r-n)*.1,t.scaleY=Math.abs(o-i)*.1,t.tick<t.totalTicks}),this.shapes.length>0}}function fu(s,t={attributes:!0,childList:!0,subtree:!0}){return new st(e=>{const n=new MutationObserver((i,r)=>{e.next(i)});return n.observe(s,t),()=>{n.disconnect()}})}function Ow(s,t){return new Promise(e=>{new MutationObserver((i,r)=>{for(const o of i)o.type==="childList"&&o.addedNodes.forEach(a=>{a.isEqualNode(t)&&(r.disconnect(),e(!0))})}).observe(s,{childList:!0})})}function du(s,t={root:null}){return new st(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 zw(s,t){return Ul().pipe(qe(null),it(()=>{const{width:e,height:n}=t?.root?.getBoundingClientRect()||Co(),{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)}),Me())}function Nw(s,t){const e=typeof t?.threshold=="number"?t.threshold:.5;return du(s,{threshold:e,root:t?.root}).pipe(it(n=>n.isIntersecting&&n.intersectionRatio>=e),Me())}let mu=!1;function Bw(){mu||(mu=!0,bl(`
|
|
31
42
|
:root {
|
|
32
43
|
--sat:env(safe-area-inset-top, 0px);
|
|
33
44
|
--sar:env(safe-area-inset-right, 0px);
|
|
@@ -40,27 +51,16 @@ var ZYZGroupCoreWeb=function(d){"use strict";const Ou={};function zu(){return ty
|
|
|
40
51
|
--sab:env(safe-area-inset-bottom, 0px);
|
|
41
52
|
--sal:env(safe-area-inset-left, 0px);
|
|
42
53
|
}
|
|
43
|
-
`))}J1();function Z1(){return xo(document.documentElement).pipe(Cr(vr),ot(()=>{const n=getComputedStyle(document.documentElement);return{bottom:n.getPropertyValue("--sab"),top:n.getPropertyValue("--sat"),right:n.getPropertyValue("--sar"),left:n.getPropertyValue("--sal")}}))}function Q1(n={enableHighAccuracy:!0,timeout:5e3,maximumAge:0}){return new st(t=>{if(!("geolocation"in navigator))return t.error("navigator.geolocation is not available.");let e;return new Promise((s,i)=>{navigator.geolocation.getCurrentPosition(r=>{t.next({longitude:r.coords.longitude,latitude:r.coords.latitude}),s()},r=>{i(r)})}).then(()=>{e=navigator.geolocation.watchPosition(s=>{t.next({longitude:s.coords.longitude,latitude:s.coords.latitude})},s=>{t.error(s)},n)}).catch(s=>{t.error(s)}),()=>{typeof e=="number"&&navigator.geolocation.clearWatch(e)}})}function tu(n="(prefers-color-scheme: dark)"){const t=window.matchMedia(n);return $(t,"change").pipe(ot(e=>e.matches),Pe(t.matches),Te())}function eu(){return Zl(document).pipe(ot(()=>location),Pe(location))}function K1(){return eu().pipe(ot(n=>n.href),Pe(location.href),Te())}function tw(){return $(window,"hashchange").pipe(ot(n=>n.target.location.hash.replace("#","")),Pe(window.location.hash.replace("#","")),Te())}function ew(){return $(window,"popstate").pipe(ot(n=>n.state),Pe(null),Te())}function sw(n,t,e){if(typeof t=="string"&&(t=va(t)),(typeof t=="string"||t===void 0)&&e===void 0){const s=Object.assign({},n.dataset);return Object.keys(s).forEach(i=>{if(s[i]?.startsWith("[")||s[i]?.startsWith("{"))try{s[i]=JSON.parse(s[i]||"")}catch{}}),typeof t=="string"?s[t]:s}else{let s={};typeof t=="object"?s=t:typeof t=="string"&&(s[t]=e),Object.entries(s).forEach(([i,r])=>{r?n.dataset[i]=r instanceof Object?JSON.stringify(r):r:delete n.dataset[i]})}}function nw(n,t){t.split(/[,\s]+/).forEach(e=>{e.trim()!=""&&delete n.dataset[e.trim()]})}function su(n,t){const e=typeof n=="string"?n:n.toString();let s=t?.initValue;if(typeof s>"u")try{const a=window.localStorage.getItem(e);a&&(s=ya(a))}catch{}const{get:i,set:r}=Ma(s,{aliveInSeconds:t?.aliveInSeconds,aliveUntilTimestamp:t?.aliveUntilTimestamp}),o=ji(i());return Ht(()=>{if(typeof o.value<"u")try{window.localStorage.setItem(e,Mi(o.value))}catch{}else window.localStorage.removeItem(e)}),{get:()=>(o.value=i(),o.value.v),set:a=>o.value=r(a)}}function iw(){window.localStorage.clear()}const{get:nu,set:rw}=su(mn("theme")),iu=new ds,ow=iu.pipe(Pe(void 0));function ru(n){switch(rw(n),n){case"dark":document.documentElement.classList.add("dark"),ws(document.documentElement,"data-theme","dark");break;case"light":default:document.documentElement.classList.remove("dark"),ws(document.documentElement,"data-theme","light");break}return iu.next(n),n}function aw(){return ru(nu()=="dark"?"light":"dark")}function hw(){return Ep([ow,tu("(prefers-color-scheme: dark)")]).pipe(ot(([n,t])=>{if(n)return n;const e=nu();return e||(t?"dark":"light")}))}function cw(n,t=""){return getComputedStyle(document.documentElement).getPropertyValue(n)||t}function lw(n,t){document.documentElement.style.setProperty(n,t)}function uw(n,t){const e=typeof n=="string"?n:n.toString();let s=t?.initValue;if(typeof s>"u")try{const a=window.sessionStorage.getItem(e);a&&(s=ya(a))}catch{}const{get:i,set:r}=Ma(s,{aliveInSeconds:t?.aliveInSeconds,aliveUntilTimestamp:t?.aliveUntilTimestamp}),o=ji(i());return Ht(()=>{if(typeof o.value<"u")try{window.sessionStorage.setItem(e,Mi(o.value))}catch{}else window.sessionStorage.removeItem(e)}),{get:()=>(o.value=i(),o.value.v),set:a=>o.value=r(a)}}function fw(){window.sessionStorage.clear()}function dw(n,t){const e=ji(t?.value||"");if(!e.value){const s=`; ${document.cookie}`.split(`; ${n}=`).pop()?.split(";").shift();s&&(e.value=decodeURIComponent(s))}return Ht(()=>{if(e.value&&t?.days){const s="; 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=n+"="+encodeURIComponent(e.value)+s+i+r+o}}),{get:()=>e.value,set:s=>e.value=s}}function mw(){const n=document.cookie.split("; ");for(let t=0;t<n.length;t++){const e=window.location.hostname.split(".");for(;e.length>0;){const s=encodeURIComponent(n[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=s+"/";i.length>0;)document.cookie=s+i.join("/"),i.pop();e.shift()}}}function pw(n,t){let e;return n.objectStoreNames.contains(t)||(e=n.createObjectStore(t,{keyPath:"id"})),e}function gw(n,t=1,e){return new Promise((s,i)=>{let r;const o=window.indexedDB.open(n,t);o.onerror=()=>{i("无法使用IndexDB!")},o.onsuccess=a=>{r=a.target.result,pw(r,e),s(r)}})}function yw(n,t,e={id:1,name:"xxx"}){return new Promise((s,i)=>{const r=n.transaction([t],"readwrite");r.objectStore(t).add(e),r.oncomplete=a=>{s(a)},r.onerror=a=>{i(a)}})}const Jo=new ks;function Zo(n,t){return Ai({url:n,...t})}async function ai(n,t){if(typeof fetch>"u")throw new Error("fetch() not supported!");if(typeof AbortController>"u")throw new Error("AbortController not supported!");const e=Zo(n,t),s=new AbortController;Jo.set(e,s);const{responseType:i,onProgress:r,timeout:o}={responseType:"json",timeout:6e4,...t},a=setTimeout(()=>{throw s.abort(),new Error(`${o} ms Timeout!`)},o);let h=await fetch(new Request(n,{...t,signal:s.signal}));if(Jo.delete(e),clearTimeout(a),h.status===200||h.status===0){if(h.status===0&&bn("useFetch: HTTP Status 0 received."),typeof ReadableStream<"u"&&h.body&&h.body.getReader&&r){const c=h.body.getReader(),l=h.headers.get("X-File-Size")||h.headers.get("Content-Length"),u=l?parseInt(l):0,m=u!==0;let f=0;const p=new ReadableStream({start(y){function S(){c.read().then(({done:w,value:v})=>{w?y.close():(f+=v.byteLength,r?.(new ProgressEvent("progress",{lengthComputable:m,loaded:f,total:u})),y.enqueue(v),S())}).catch(w=>{y.error(w)})}S()}});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 ww(n,t){const e=Jo.get(Zo(n,t));e&&e.abort()}function xw(n=3,t){return zi(ai,n,t)}function bw(n=6e4){return Bi(ai,n)}function vw(n=6e4,t=3,e){return Bi(zi(ai,t,e),n)}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:(n,t)=>{switch(t){case"W":return`${n}周`;default:return`${n}日`}},weekStart:1,yearStart:4,formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日Ah点mm分",LLLL:"YYYY年M月D日ddddAh点mm分",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},relativeTime:{future:"%s内",past:"%s前",s:"几秒",m:"1 分钟",mm:"%d 分钟",h:"1 小时",hh:"%d 小时",d:"1 天",dd:"%d 天",M:"1 个月",MM:"%d 个月",y:"1 年",yy:"%d 年"},meridiem:(n,t)=>{const e=n*100+t;return e<600?"凌晨":e<900?"早上":e<1100?"上午":e<1300?"中午":e<1800?"下午":"晚上"}},_w={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:n=>{const t=["th","st","nd","rd"],e=n%100;return`[${n}${t[(e-20)%10]||t[e]||t[0]}]`}},ze=new ks;let hi="zh-cn";Qo(_w),Qo(Sw);function Qo(n,t){if(!n)return ze.get(hi);let e;if(typeof n=="string"){const s=n.toLowerCase();if(ze.get(s))e=s;else if(t)ze.set(s,t),e=s;else return ze.get(hi)}else{const{name:s}=n;ze.set(s,n),e=s}return e&&(hi=e),ze.get(e)||ze.get(hi)}let Cw=0;function ss(n,t={},e=[],s){return{name:String(++Cw),tag:n,props:t,children:e,el:s}}function ci(n){return ss(n.tagName,so(n),Array.from(n.children).map(t=>ci(t)),n)}function _s(n,t=document.documentElement){if(n.el)return n.el;if(n.el=n.tag=="path"?zl():document.createElement(n.tag),n.props)for(const e in n.props){const s=n.props[e];e.startsWith("on")?n.el.addEventListener(e.slice(2).toLowerCase(),s):e==="style"?Zn(n.el,n.props[e]):ws(n.el,e,s)}return n.children&&(typeof n.children=="string"?n.el.appendChild(document.createTextNode(n.children)):n.children.forEach(e=>{_s(e,n.el)})),t.appendChild(n.el),n.el}function li(n,t){if(!n.el)return;if(n.tag!==t.tag){(n.el.parentElement||document.body).replaceChild(_s(t),n.el);return}const e=t.el=n.el,s=n.props,i=t.props;for(const a in s)a in i||(a.startsWith("on")?e.removeEventListener(a.slice(2).toLowerCase(),s[a]):e.removeAttribute(a));for(const a in i){const h=s[a],c=i[a];if(c!=h)if(a.startsWith("on")){const l=a.slice(2).toLowerCase();e.removeEventListener(l,h),e.addEventListener(l,c)}else if(a==="style"){for(const l in h)l in c||eo(e,l);Zn(e,c)}else ws(e,a,c)}const r=n.children||[],o=t.children||[];if(typeof o=="string")e.innerHTML=o;else if(typeof r=="string")e.innerHTML="",o.forEach(a=>{_s(a,e)});else{const a=Math.min(r.length,o.length);for(let h=0;h<a;h++)li(r[h],o[h]);o.length>r.length&&o.slice(r.length).forEach(h=>{_s(h,e)}),o.length<r.length&&r.slice(o.length).forEach(h=>{h.el&&e.removeChild(h.el)})}}class Tw{state;el;constructor(t,e){this.state=Ga(t,!0),this.el=e,this.compile(this.el)}compile(t){t.childNodes.forEach(e=>{switch(e.nodeType){case 1:const s=e;[...s.attributes].forEach(a=>{const h=a.name,c=a.value;if(h==="v-model")if(co(s)){const l=s;Ht(()=>{l.checked=this.getStateValue(c)==l.value}),l.addEventListener("change",u=>{this.setStateValue(c,u.target.value)})}else if(ho(s)){const l=s;Ht(()=>{l.checked=Ea(this.getStateValue(c),l.value)}),l.addEventListener("change",u=>{const m=u.target,f=m.value;m.checked?cf(this.getStateValue(c),f):ki(this.getStateValue(c),f)})}else if(ao(s)){const l=s;Ht(()=>{l.value=this.getStateValue(c)}),l.addEventListener("change",u=>{this.setStateValue(c,u.target.value)})}else{const l=s;Ht(()=>{l.value=this.getStateValue(c)});const u=m=>{this.setStateValue(c,m.target.value)};l.addEventListener("input",u)}else h==="v-text"?Ht(()=>{s.innerText=this.getStateValue(c)}):h==="v-html"&&Ht(()=>{s.innerHTML=this.getStateValue(c)})}),s.childNodes.length>0&&this.compile(s);break;case 3:const i=e.textContent||"",r=/\{\{\s*([^{}\s]+)\s*\}\}/g,o=r.exec(i);o&&o[1]&&Ht(()=>{e.textContent=i.replace(r,this.getStateValue(o[1]))});break}})}getStateValue(t){let e=this.state;return t.split(".").forEach(s=>{e=e[s]}),e}setStateValue(t,e){let s=this.state;const i=t.split("."),r=i.length;for(let o=0;o<r-1;o++)s=s[i[o]];s[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){
|
|
54
|
+
`))}Bw();function Fw(){return Mo(document.documentElement).pipe(Tr(Cr),it(()=>{const s=getComputedStyle(document.documentElement);return{bottom:s.getPropertyValue("--sab"),top:s.getPropertyValue("--sat"),right:s.getPropertyValue("--sar"),left:s.getPropertyValue("--sal")}}))}function Yw(s={enableHighAccuracy:!0,timeout:5e3,maximumAge:0}){return new st(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 pu(s="(prefers-color-scheme: dark)"){const t=window.matchMedia(s);return X(t,"change").pipe(it(e=>e.matches),qe(t.matches),Me())}function ra(s,t){const e=typeof s=="string"?s:s.toString(),n=()=>{try{const a=window.sessionStorage.getItem(e);if(a)return Pa(a)}catch{}},i=a=>{try{typeof a.v<"u"?window.sessionStorage.setItem(e,Di(a)):window.sessionStorage.removeItem(e)}catch{}};return{get:()=>{const{get:a}=_s(n(),t);return a().v},set:a=>{const{set:h}=_s(n(),t),c=h(a);i(c)}}}function Xw(){window.sessionStorage.clear()}function gu(){return fu(document).pipe(it(()=>location),qe(location))}function Uw(){return gu().pipe(it(s=>s.href),qe(location.href),Me())}function $w(){return X(window,"hashchange").pipe(it(s=>s.target.location.hash.replace("#","")),qe(window.location.hash.replace("#","")),Me())}function yu(s="current"){return X(window,"popstate").pipe(it(t=>t.state||{}),it(t=>({...t,[s]:t[s]||window.location.pathname+window.location.search+window.location.hash})),Me((t,e)=>t[s]===e[s]))}function Gw(s={nameInState:"current",alreadyPushState:!0}){const t=s.nameInState,e=typeof s.alreadyPushState=="boolean"?s.alreadyPushState:!0,{get:n,set:i}=ra("fe-route-history"),r=n()||[],{get:o,set:a}=ra("fe-route-history-index"),h=o();let c=typeof h=="number"?h:r.length-1;function l(y){return r.findIndex(b=>b[t]===y[t])}const u={currentIndex:c};function d(y){y=B(y,-1,r.length-1),c<0?(u.direction="keep",u.delta=0):(y<c?u.direction="backward":y>c?u.direction="forward":u.direction="keep",u.delta=y-c),u.from=u.to,u.to=r[y]?.[t],c=y,u.currentIndex=c,a(c)}d(c);function f(y){r.push(y),i(r),d(r.length-1)}function p(y,v){const b={...v,[t]:y};window.history.pushState(b,"",y),f(b)}function g(y,v=e){const b=l(y);if(b<0){c>=0&&(r.splice(c+1),i(r)),v?f(y):p(y[t],y);return}b!=c&&d(b)}const C=yu().subscribe(y=>{g(y,!0)});return{history:r,route:u,navigate:(y,v)=>{g({...v,[t]:y},e)},go(y){window.history.go(y)},back(){window.history.back()},forward(){window.history.forward()},destroy:()=>{C.unsubscribe()}}}function Vw(s,t,e){if(typeof t=="string"&&(t=Ia(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 qw(s,t){t.split(/[,\s]+/).forEach(e=>{e.trim()!=""&&delete s.dataset[e.trim()]})}function wu(s,t){const e=typeof s=="string"?s:s.toString(),n=()=>{try{const a=window.localStorage.getItem(e);if(a)return Pa(a)}catch{}},i=a=>{try{typeof a.v<"u"?window.localStorage.setItem(e,Di(a)):window.localStorage.removeItem(e)}catch{}};return{get:()=>{const{get:a}=_s(n(),t);return a().v},set:a=>{const{set:h}=_s(n(),t),c=h(a);i(c)}}}function jw(){window.localStorage.clear()}const{get:bu,set:xu}=wu(gs("theme")),vu=new Te,Hw=vu.pipe(qe(void 0));function Su(s){switch(s){case"dark":document.documentElement.classList.add("dark"),Je(document.documentElement,"data-theme","dark");break;case"light":default:document.documentElement.classList.remove("dark"),Je(document.documentElement,"data-theme","light");break}}function _u(s){return xu(s),Su(s),vu.next(s),s}function Ww(){return _u(bu()=="dark"?"light":"dark")}function Jw(){return ng([Hw,pu("(prefers-color-scheme: dark)")]).pipe(it(([s,t])=>s||(s=bu(),s||(s=t?"dark":"light"),xu(s),Su(s),s)))}function Zw(s,t=""){return getComputedStyle(document.documentElement).getPropertyValue(s)||t}function Kw(s,t){document.documentElement.style.setProperty(s,t)}function Qw(s,t){let e=t?.value||"";if(!e){const r=`; ${document.cookie}`.split(`; ${s}=`).pop()?.split(";").shift();r&&(e=decodeURIComponent(r))}const n=()=>e,i=r=>{if(e=r,e){const o=t?.domain?"; domain="+t.domain:"",a=t?.path?"; path="+t.path:"",h=t?.secure==!0?"; secure":"";let c=s+"="+encodeURIComponent(e)+o+a+h;if(t?.days){const l="; expires="+new Date(Date.now()+t.days*864e5).toUTCString();c+=l}document.cookie=c}};return i(e),{get:n,set:i}}function tb(){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 eb(s,t){let e;return s.objectStoreNames.contains(t)||(e=s.createObjectStore(t,{keyPath:"id"})),e}function nb(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,eb(r,e),n(r)}})}function sb(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 oa=new Ln;function aa(s,t){return Li({url:s,...t})}async function li(s,t){if(typeof fetch>"u")throw new Error("fetch() not supported!");if(typeof AbortController>"u")throw new Error("AbortController not supported!");try{const e=aa(s,t),n=new AbortController;oa.set(e,n);const{responseType:i,onProgress:r,timeout:o}={responseType:"json",timeout:6e4,...t},a=setTimeout(()=>{n.abort()},o);let h=await fetch(new Request(s,{...t,signal:n.signal}));if(oa.delete(e),clearTimeout(a),h.status===200||h.status===0){if(h.status===0&&Cs("useFetch: HTTP Status 0 received."),typeof ReadableStream<"u"&&h.body&&h.body.getReader&&r){const c=h.body.getReader(),l=h.headers.get("X-File-Size")||h.headers.get("Content-Length"),u=l?parseInt(l):0,d=u!==0;let f=0;const p=new ReadableStream({start(g){function C(){c.read().then(({done:y,value:v})=>{y?g.close():(f+=v.byteLength,r?.(new ProgressEvent("progress",{lengthComputable:d,loaded:f,total:u})),g.enqueue(v),C())}).catch(y=>{g.error(y)})}C()}});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 throw new ad(`useFetch for "${h.url}" responded with ${h.status}: ${h.statusText}`,h)}catch(e){throw e.name==="AbortError"?new Error("Request timed out"):e.name==="TimeoutError"?new Error("Request timed out"):e}}function ib(s,t){const e=oa.get(aa(s,t));e&&e.abort()}function rb(s=3,t){return Fi(li,s,t)}function ob(s=6e4){return Yi(li,s)}function ab(s=6e4,t=3,e){return Yi(Fi(li,t,e),s)}const hb={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?"下午":"晚上"}},cb={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]}]`}},Be=new Ln;let ui="zh-cn";ha(cb),ha(hb);function ha(s,t){if(!s)return Be.get(ui);let e;if(typeof s=="string"){const n=s.toLowerCase();if(Be.get(n))e=n;else if(t)Be.set(n,t),e=n;else return Be.get(ui)}else{const{name:n}=s;Be.set(n,s),e=n}return e&&(ui=e),Be.get(e)||Be.get(ui)}let lb=0;function sn(s,t={},e=[],n){return{name:String(++lb),tag:s,props:t,children:e,el:n}}function fi(s){return sn(s.tagName,wo(s),Array.from(s.children).map(t=>fi(t)),s)}function En(s,t=document.documentElement){if(s.el)return s.el;if(s.el=s.tag=="path"?Zl():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"?is(s.el,s.props[e]):Je(s.el,e,n)}return s.children&&(typeof s.children=="string"?s.el.appendChild(document.createTextNode(s.children)):s.children.forEach(e=>{En(e,s.el)})),t.appendChild(s.el),s.el}function di(s,t){if(!s.el)return;if(s.tag!==t.tag){(s.el.parentElement||document.body).replaceChild(En(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 l=a.slice(2).toLowerCase();e.removeEventListener(l,h),e.addEventListener(l,c)}else if(a==="style"){for(const l in h)l in c||yo(e,l);is(e,c)}else Je(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=>{En(a,e)});else{const a=Math.min(r.length,o.length);for(let h=0;h<a;h++)di(r[h],o[h]);o.length>r.length&&o.slice(r.length).forEach(h=>{En(h,e)}),o.length<r.length&&r.slice(o.length).forEach(h=>{h.el&&e.removeChild(h.el)})}}class ub{state;el;constructor(t,e){this.state=Zi(t,{deep:!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(mo(n)){const l=n;Ee(()=>{l.checked=this.getStateValue(c)==l.value}),l.addEventListener("change",u=>{this.setStateValue(c,u.target.value)})}else if(fo(n)){const l=n;Ee(()=>{l.checked=Fa(this.getStateValue(c),l.value)}),l.addEventListener("change",u=>{const d=u.target,f=d.value;d.checked?If(this.getStateValue(c),f):Ba(this.getStateValue(c),f)})}else if(uo(n)){const l=n;Ee(()=>{l.value=this.getStateValue(c)}),l.addEventListener("change",u=>{this.setStateValue(c,u.target.value)})}else{const l=n;Ee(()=>{l.value=this.getStateValue(c)});const u=d=>{this.setStateValue(c,d.target.value)};l.addEventListener("input",u)}else h==="v-text"?Ee(()=>{n.innerText=this.getStateValue(c)}):h==="v-html"&&Ee(()=>{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]&&Ee(()=>{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){
|
|
44
55
|
let output = "";
|
|
45
56
|
function echo(html){
|
|
46
57
|
output += html;
|
|
47
58
|
}
|
|
48
59
|
${t}
|
|
49
60
|
return output;
|
|
50
|
-
})`}}function ou(n,t,e){return new WebSocket(n)}function Pw(n){return`${n}eventbus/${Ms(3,"number")}/${Ms(8)}/websocket`}class ae{static CONNECTING=WebSocket.CONNECTING;static OPEN=WebSocket.OPEN;static CLOSING=WebSocket.CLOSING;static CLOSED=WebSocket.CLOSED;url;socketCreatorProtocols;socketCreatorOptions;socketCreator;socket;state=ae.CONNECTING;messageQueue=[];pingInterval;pingTimerID;reconnect;reconnectAttempts=0;maxReconnectAttempts;reconnectTimerID;onopen;onclose;onerror;requestid=0;waitings={};listeners={};constructor(t="",e){this.url=t,this.socketCreatorProtocols=e?.socketCreatorProtocols,this.socketCreatorOptions=e?.socketCreatorOptions||{},this.socketCreator=e?.socketCreator||ou,this.pingInterval=e?.pingInterval||5e3,this.onopen=e?.onopen,this.onclose=e?.onclose,this.onerror=e?.onerror,this.reconnect=typeof e?.reconnect=="boolean"?e.reconnect:!0,this.maxReconnectAttempts=typeof e?.maxReconnectAttempts=="number"?e.maxReconnectAttempts:1/0,this._connect()}open(){this.reconnectAttempts=0,this._connect()}close(){this.state=ae.CLOSING,this.socket?.close()}_connect(){this.socket?.readyState===ae.CONNECTING||this.socket?.readyState===ae.OPEN||(this.state=ae.CONNECTING,this.socket=this.socketCreator(this.url,this.socketCreatorProtocols,this.socketCreatorOptions),this.socket.onopen=()=>{ie(`(${this.url}) onopen`),this.state=ae.OPEN,this.reconnectTimerID&&(clearTimeout(this.reconnectTimerID),this.reconnectTimerID=void 0);const t=this.messageQueue.slice();this.messageQueue=[],t.forEach(this._send.bind(this)),this.ping(),this.pingTimerID=setInterval(this.ping.bind(this),this.pingInterval),this.onopen?.()},this.socket.onclose=t=>{const{code:e,reason:s,wasClean:i}=t;ie(`(${this.url}) onclose: code(${e}) reason(${s}) wasClean(${i})`),this.state=ae.CLOSED,this.socket=void 0,this.pingTimerID&&(clearInterval(this.pingTimerID),this.pingTimerID=void 0),this.onclose?.(t),this.reconnect&&this.reconnectAttempts<this.maxReconnectAttempts&&(this.reconnectTimerID=setTimeout(this._connect.bind(this),za(this.reconnectAttempts++)))},this.socket.onerror=t=>{ie(`(${this.url}) onerror: ${t}`),this.onerror?.(t)},this.socket.onmessage=t=>{if(ie(`(${this.url}) onmessage: { type: ${t.type}, data: ${t.data} }`),typeof t.data=="string"){let e;const s=t.data.substring(1);try{e=JSON.parse(s)}catch(i){e=[JSON.stringify({type:"err",failureCode:"fe-json-parse-error",failureType:i.toString(),message:s})]}e.forEach(i=>{const r=JSON.parse(i);if(r.body&&Object.prototype.hasOwnProperty.call(r.body,"requestid")){const o=this.waitings[r.body.requestid];o?o.resolve?.(r.body):bn(`(${this.url}) onmessage: found no associated request, already timed out`)}else if(this.listeners[r.address]){const o=this.listeners[r.address];for(let a=0;a<o.length;a++)r.type==="err"?o[a]({failureCode:r.failureCode,failureType:r.failureType,message:r.message}):o[a](null,r.body)}else this.onunhandled(r)})}else t.data instanceof ArrayBuffer?bn(`(${this.url}) onmessage: unhandle ArrayBuffer`):t.data instanceof Blob&&bn(`(${this.url}) onmessage: unhandle Blob`)})}onunhandled(t){try{t.type==="err"?this.onerror?.(t):t.event?console.warn("No handler found for event: %o. Message: %O",t.event,t):console.warn("No handler found for message: ",t)}catch{}}_send(t){this.socket?.readyState===ae.OPEN?this.socket.send(JSON.stringify([JSON.stringify(t)])):(this.messageQueue.push(t),this._connect())}ping(){this._send({type:"ping"})}register(t,e,s={}){this.listeners[t]||(this.listeners[t]=[],this._send({type:"register",address:t,headers:as(s,this.socketCreatorOptions.headers)})),this.listeners[t].push(e)}unregister(t,e,s={}){const i=this.listeners[t];if(i){const r=i.indexOf(e);r!=-1&&(i.splice(r,1),i.length===0&&(this._send({type:"unregister",address:t,headers:as(s,this.socketCreatorOptions.headers)}),delete this.listeners[t]))}}publish(t,e,s={}){this._send({type:"publish",address:t,headers:as(s,this.socketCreatorOptions.headers),body:e})}async send(t,e,s={},i=3e4){this.requestid++;const r=this.waitings[this.requestid]={requestid:this.requestid},o=await new Promise((a,h)=>{r.resolve=a,this._send({type:"send",address:t,headers:as(s,this.socketCreatorOptions.headers),body:{requestid:r.requestid,...e}}),setTimeout(()=>{h(`(${this.url}) send(${r.requestid}: ${Ye(e)}) Timeout!`)},i)});return delete this.waitings[r.requestid],o}}const ui=()=>{const n=navigator.userAgent.toLowerCase();let t="Unknown";return/iphone|ipad|ipod/i.test(n)?t="iOS":/android/i.test(n)?t="Android":/BlackBerry/i.test(n)?t="BlackBerry":/mac/i.test(n)?t="macOS":/win/i.test(n)?t="Windows":/linux/i.test(n)?t="Linux":/bsd/i.test(n)&&(t="BSD"),t.toLowerCase()};function Ew(n=navigator.userAgent){let t="Unknown";if(/iPhone|iPad|iPod/i.test(n)){const e=n.match(/OS (\d+_\d+)/i);e&&(t=e[1].replace("_","."))}else if(/Android/i.test(n)){const e=n.match(/Android (\d+\.\d+)/i);e&&(t=e[1])}else if(/Mac OS X/i.test(n)){const e=n.match(/Mac OS X (\d+_\d+)/i);e&&(t=e[1].replace("_","."))}else if(/Windows NT/i.test(n)){const e=n.match(/Windows NT (\d+\.\d+)/i);e&&(t=e[1])}return t.toLowerCase()}function Ko(){const n=navigator.userAgent.toLowerCase();let t="Unknown";return/opr/i.test(n)||/opera/i.test(n)?t="Opera":/chrome/i.test(n)?t="Chrome":/firefox/i.test(n)?t="Firefox":/safari/i.test(n)?t="Safari":/edge/i.test(n)?t="Edge":/msie|trident/i.test(n)?t="IE":/MicroMessenger/i.test(n)?t="Wechat":/alipay/i.test(n)&&(t="Ali"),t.toLowerCase()}const Mw=()=>{const n=navigator.userAgent;let t="Unknown";if(/Chrome/.test(n)){const e=n.match(/Chrome\/(\d+\.\d+)/);e&&(t=e[1])}else if(/Firefox/.test(n)){const e=n.match(/Firefox\/(\d+\.\d+)/);e&&(t=e[1])}else if(/Safari/.test(n)){const e=n.match(/Version\/(\d+\.\d+)/);e&&(t=e[1])}else if(/Edge/.test(n)){const e=n.match(/Edge\/(\d+\.\d+)/);e&&(t=e[1])}else if(/MSIE|Trident/.test(n)){const e=n.match(/(?:MSIE|rv:)(\d+\.\d+)/);e&&(t=e[1])}return t};function Aw(){return(navigator.browserLanguage||navigator.language).toLowerCase()}function Iw(){return Intl.DateTimeFormat().resolvedOptions().timeZone.toLowerCase()}function ta(){return ui()==="ios"}function au(){return ui()==="macos"}function kw(){return ta()|au()}function hu(){return ui()==="android"}function Dw(){return ta()||hu()}function cu(){const n=window.navigator.userAgent,t=n.indexOf("MSIE ");if(t>0)return parseInt(n.substring(t+5,n.indexOf(".",t)),10);if(n.indexOf("Trident/")>0){const i=n.indexOf("rv:");return parseInt(n.substring(i+3,n.indexOf(".",i)),10)}const s=n.indexOf("Edge/");return s>0?parseInt(n.substring(s+5,n.indexOf(".",s)),10):-1}const Lw=cu()!==-1,Rw=document.documentMode?document.documentMode===9:!1,Ow=document.documentMode?document.documentMode===10:!1,zw=document.documentMode?document.documentMode===11:!1;function lu(){return Ko()==="wechat"}function uu(){return Ko()==="ali"}function Bw(){return lu()&&navigator.userAgent.match(/miniprogram/i)||window.__wxjs_environment==="miniprogram"}function Nw(){return uu()&&navigator.userAgent.match(/miniprogram/i)}const Fw=bf&&window.File&&window.FileReader&&window.FileList&&window.Blob,Yw=typeof Path2D=="function"&&typeof DOMMatrix=="function",Xw=typeof HTMLElement=="object"?function(t){return t instanceof HTMLElement}:function(t){return t&&typeof t=="object"&&t.nodeType===1&&typeof t.nodeName=="string"},Uw="webkit moz ms o".split(" ");function $w(){return"ontouchstart"in window||"ontouchend"in document||navigator.maxTouchPoints>0}function Vw(n=750){const t=document.documentElement,e=window.top===window.self?window.devicePixelRatio:1;t.dataset.dpr=e;let s=100;const i=function(){t.style.height=window.innerHeight+"px";const r=t.clientWidth;t.dataset.width=r,t.dataset.layout=r>n?"pc":"mobile",t.dataset.rem=s=Math.min(100,Math.round(100*(r/n))),t.style.fontSize=s+"px"};i(),window.rem2px=function(r){return parseFloat(r)*s},window.px2rem=function(r){return parseFloat(r)/s},window.addEventListener&&window.addEventListener("orientationchange"in window?"orientationchange":"resize",i,!1)}function fu(){let n=null;if(window.ActiveXObject){const t=["Microsoft.XMLHTTP","MSXML6.XMLHTTP","MSXML5.XMLHTTP","MSXML4.XMLHTTP","MSXML3.XMLHTTP","MSXML2.XMLHTTP","MSXML.XMLHTTP"];for(let e=0,s=t.length;e<s;e++)try{n=new window.ActiveXObject(t[e]);break}catch{continue}}else n=new XMLHttpRequest;return n}function Gw(n,t){return new Promise((e,s)=>{const{method:i="GET",data:r={},multipartFormDataString:o="",boundary:a="",headers:h={},withCredentials:c=!1,responseType:l="json",timeout:u=3e4}=t||{},m=fu();m.timeout=u,m.responseType=l,m.onreadystatechange=function(v){m.readyState===4&&(m.status===200?e(m.response):s(m.statusText))},m.ontimeout=()=>{s(`${n} is timed out for ${u}ms.`)},m.addEventListener("load",v=>t?.load?.(v,m),!1),m.addEventListener("loadstart",v=>t?.loadstart?.(v,m),!1),m.addEventListener("loadend",v=>t?.loadend?.(v,m),!1),m.addEventListener("progress",v=>{if(v.lengthComputable){const x=Math.round(v.loaded*100/v.total);t?.progress?.(v,m,x)}},!1),m.addEventListener("error",v=>t?.error?.(v,m),!1),m.addEventListener("abort",v=>t?.abort?.(v,m),!1);const f=i.toUpperCase();Object.assign(h,{Accept:"*/*"});let p=!1,y=!1,S=!1;function w(){c&&(m.withCredentials=!0);for(const v in h)lt(v).toLowerCase()=="content-type"&&h[v].toLowerCase()=="multipart/form-data"?(p=!0,m.setRequestHeader("Content-Type","multipart/form-data; boundary="+a)):(lt(v).toLowerCase()=="content-type"&&(h[v].toLowerCase().indexOf("text/plain")>=0?y=!0:h[v].toLowerCase().indexOf("application/json")>=0&&(S=!0)),m.setRequestHeader(v,h[v]))}switch(f){case"GET":let v="";r instanceof FormData?v=Kf(r):v=Qf(r),m.open("GET",Zf(n,v),!0),w(),m.send(null);break;default:m.open(f,n,!0),w(),p?m.sendAsBinary(o):S?m.send(JSON.stringify(r)):y?m.send(Object.entries(r).map(([x,b])=>`${x}=${b}`).join(`\r
|
|
51
|
-
`)):m.send(Object.entries(r).map(([x,b])=>`${encodeURIComponent(x)}=${encodeURIComponent(b)}`).join("&"));break}})}async function qw(n){const t={url:n.action||"",data:{},contentType:n.method.toLowerCase()==="post"&&n.enctype?n.enctype:"application/x-www-form-urlencoded",multipartFormDataString:"",boundary:"---------------------------"+Date.now().toString(16)},e=[],s=t.contentType=="multipart/form-data";for(let i=0;i<n.elements.length;i++){const r=n.elements[i];if(!r.hasAttribute("name"))continue;const o=r.getAttribute("type");switch(r.nodeName.toUpperCase()==="INPUT"&&o?o.toUpperCase():""){case"FILE":const h=r;if(s)for(let u=0,m=h.files?.length||0;u<m;u++){const f=h.files?.[u];if(f){const p=await zs(f,Ut.binaryString);e.push('Content-Disposition: form-data; name="'+h.name+'"; filename="'+f.name+`"\r
|
|
52
|
-
Content-Type: `+f.type+`\r
|
|
53
|
-
\r
|
|
54
|
-
`+p+`\r
|
|
55
|
-
`)}}break;case"RADIO":case"CHECKBOX":if(!r.checked)break;default:const l=r;s?e.push('Content-Disposition: form-data; name="'+l.name+`"\r
|
|
56
|
-
\r
|
|
57
|
-
`+l.value+`\r
|
|
58
|
-
`):t.data[l.name]=l.value;break}}return t.multipartFormDataString="--"+t.boundary+`\r
|
|
59
|
-
`+e.join("--"+t.boundary+`\r
|
|
60
|
-
`)+"--"+t.boundary+`--\r
|
|
61
|
-
`,t}class jw extends _o{currentItem={};items=[];groups=[];globalStyles={};grad={};idtops={};text="";constructor(t){super(t),this.on("tag",(e,s)=>{switch(this.text="",this.currentItem={type:e},e){case"g":this.groups.push(this.currentItem);break}this.processAttrs(e,s)}),this.on("text",e=>{if(this.currentItem.type=="style"){try{const s=Co(e);for(const i of s.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,s)=>{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),sa(this.currentItem.style,this.currentItem,na)}switch(this.processAttrs(e,s),e){case"g":this.groups.pop();break;case"cirlce":this.addToItems();break;case"ellipse":this.addToItems();break;case"polygon":this.addToItems();break;case"path":this.addToItems();break;case"line":this.addToItems();break;case"rect":this.addToItems();break;case"image":this.addToItems();break;case"text":this.currentItem.text=this.text,this.currentItem["text-anchor"]=this.currentItem["text-anchor"]||"start",this.addToItems();break}}),this.on("finish",()=>{this.emit("result",this.items)})}parse(){return super.parse(),this.items}processAttrs(t,e){let s=[],i;switch(t){case"svg":let r="",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&&sa(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+ea(parseFloat(e.x1),parseFloat(e.y1),parseFloat(e.x2),parseFloat(e.y2),parseFloat(e.x1)+100,parseFloat(e.y1))).toFixed(2),s=[this.grad.angle];for(let a=0,h=this.grad.stops.length;a<h;a++)i=this.grad.stops[a],a&&a!=h-1?s.push(i.color+":"+i.offset):s.push(i.color);this.idtops[this.grad.id]=s.join("-"),this.items.forEach(a=>{a.fillid==this.grad.id&&(a.fill=this.idtops[this.grad.id])});break;case"radialGradient":s=[];for(let a=0,h=this.grad.stops.length;a<h;a++)i=this.grad.stops[a],a&&a!=h-1?s.push(i.color+":"+i.offset):s.push(i.color);this.idtops[this.grad.id]=s.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(na.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"&&sa(o,this.currentItem,na),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 ea(n,t,e,s,i,r){if(typeof i>"u"||typeof r>"u"){const o=n-e,a=t-s;return!o&&!a?0:(180+Math.atan2(-a,-o)*180/Math.PI+360)%360}else return ea(n,t,i,r)-ea(e,s,i,r)}function sa(n,t,e){const s=(n+"").split(";"),i=/^\s+|\s+$/g;for(let r=0,o=s.length;r<o;r++){const a=s[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 na=["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 Hw{localVideoUtil;remoteVideoUtil;localPeerConnection=null;remotePeerConnection=null;constructor(t,e){this.localVideoUtil=new rn(t),this.remoteVideoUtil=new rn(e)}start(){this.getLocalMediaStream().then(t=>{this.call(t)})}end(){this.localPeerConnection?.close(),this.remotePeerConnection?.close(),this.localPeerConnection=null,this.remotePeerConnection=null,this.trace("Ending call.")}getLocalMediaStream(){return new Promise((t,e)=>{navigator.mediaDevices.getUserMedia({audio:!0,video:!0}).then(s=>{this.localVideoUtil.setSrcObject(s),t(s)}).catch(s=>{this.trace(`navigator.getUserMedia error: ${s}.`),e(s)})})}gotRemoteMediaStream(t){const e=t.streams[0];this.remoteVideoUtil.setSrcObject(e),this.trace("Remote peer connection received remote stream.")}call(t){const e=t.getVideoTracks(),s=t.getAudioTracks();e.length>0&&this.trace(`Using video device: ${e[0].label}.`),s.length>0&&this.trace(`Using audio device: ${s[0].label}.`);const i=void 0,r=new RTCPeerConnection(i);this.localPeerConnection=r,this.trace("Created local peer connection object localPeerConnection."),r.addEventListener("icecandidate",this.handleConnection),r.addEventListener("iceconnectionstatechange",this.handleConnectionChange);const 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(s[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,s=t.candidate;if(e&&s){const i=new RTCIceCandidate(s),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:
|
|
61
|
+
})`}}function Cu(s,t,e){return new WebSocket(s)}function fb(s){return`${s}eventbus/${In(3,"number")}/${In(8)}/websocket`}class ae{static CONNECTING=WebSocket.CONNECTING;static OPEN=WebSocket.OPEN;static CLOSING=WebSocket.CLOSING;static CLOSED=WebSocket.CLOSED;url;socketCreatorProtocols;socketCreatorOptions;socketCreator;socket;state=ae.CONNECTING;messageQueue=[];pingInterval;pingTimerID;reconnect;reconnectAttempts=0;maxReconnectAttempts;reconnectTimerID;onopen;onclose;onerror;requestid=0;waitings={};listeners={};constructor(t="",e){this.url=t,this.socketCreatorProtocols=e?.socketCreatorProtocols,this.socketCreatorOptions=e?.socketCreatorOptions||{},this.socketCreator=e?.socketCreator||Cu,this.pingInterval=e?.pingInterval||5e3,this.onopen=e?.onopen,this.onclose=e?.onclose,this.onerror=e?.onerror,this.reconnect=typeof e?.reconnect=="boolean"?e.reconnect:!0,this.maxReconnectAttempts=typeof e?.maxReconnectAttempts=="number"?e.maxReconnectAttempts:1/0,this._connect()}open(){this.reconnectAttempts=0,this._connect()}close(){this.state=ae.CLOSING,this.socket?.close()}_connect(){this.socket?.readyState===ae.CONNECTING||this.socket?.readyState===ae.OPEN||(this.state=ae.CONNECTING,this.socket=this.socketCreator(this.url,this.socketCreatorProtocols,this.socketCreatorOptions),this.socket.onopen=()=>{ie(`(${this.url}) onopen`),this.state=ae.OPEN,this.reconnectTimerID&&(clearTimeout(this.reconnectTimerID),this.reconnectTimerID=void 0);const t=this.messageQueue.slice();this.messageQueue=[],t.forEach(this._send.bind(this)),this.ping(),this.pingTimerID=setInterval(this.ping.bind(this),this.pingInterval),this.onopen?.()},this.socket.onclose=t=>{const{code:e,reason:n,wasClean:i}=t;ie(`(${this.url}) onclose: code(${e}) reason(${n}) wasClean(${i})`),this.state=ae.CLOSED,this.socket=void 0,this.pingTimerID&&(clearInterval(this.pingTimerID),this.pingTimerID=void 0),this.onclose?.(t),this.reconnect&&this.reconnectAttempts<this.maxReconnectAttempts&&(this.reconnectTimerID=setTimeout(this._connect.bind(this),ja(this.reconnectAttempts++)))},this.socket.onerror=t=>{ie(`(${this.url}) onerror: ${t}`),this.onerror?.(t)},this.socket.onmessage=t=>{if(ie(`(${this.url}) onmessage: { type: ${t.type}, data: ${t.data} }`),typeof t.data=="string"){let e;const n=t.data.substring(1);try{e=JSON.parse(n)}catch(i){e=[JSON.stringify({type:"err",failureCode:"fe-json-parse-error",failureType:i.toString(),message:n})]}e.forEach(i=>{const r=JSON.parse(i);if(r.body&&Object.prototype.hasOwnProperty.call(r.body,"requestid")){const o=this.waitings[r.body.requestid];o?o.resolve?.(r.body):Cs(`(${this.url}) onmessage: found no associated request, already timed out`)}else if(this.listeners[r.address]){const o=this.listeners[r.address];for(let a=0;a<o.length;a++)r.type==="err"?o[a]({failureCode:r.failureCode,failureType:r.failureType,message:r.message}):o[a](null,r.body)}else this.onunhandled(r)})}else t.data instanceof ArrayBuffer?Cs(`(${this.url}) onmessage: unhandle ArrayBuffer`):t.data instanceof Blob&&Cs(`(${this.url}) onmessage: unhandle Blob`)})}onunhandled(t){try{t.type==="err"?this.onerror?.(t):t.event?console.warn("No handler found for event: %o. Message: %O",t.event,t):console.warn("No handler found for message: ",t)}catch{}}_send(t){this.socket?.readyState===ae.OPEN?this.socket.send(JSON.stringify([JSON.stringify(t)])):(this.messageQueue.push(t),this._connect())}ping(){this._send({type:"ping"})}register(t,e,n={}){this.listeners[t]||(this.listeners[t]=[],this._send({type:"register",address:t,headers:cn(n,this.socketCreatorOptions.headers,!1)})),this.listeners[t].push(e)}unregister(t,e,n={}){const i=this.listeners[t];if(i){const r=i.indexOf(e);r!=-1&&(i.splice(r,1),i.length===0&&(this._send({type:"unregister",address:t,headers:cn(n,this.socketCreatorOptions.headers,!1)}),delete this.listeners[t]))}}publish(t,e,n={}){this._send({type:"publish",address:t,headers:cn(n,this.socketCreatorOptions.headers,!1),body:e})}async send(t,e,n={},i=3e4){this.requestid++;const r=this.waitings[this.requestid]={requestid:this.requestid},o=await new Promise((a,h)=>{r.resolve=a,this._send({type:"send",address:t,headers:cn(n,this.socketCreatorOptions.headers,!1),body:{requestid:r.requestid,...e}}),setTimeout(()=>{h(`(${this.url}) send(${r.requestid}: ${Xe(e)}) Timeout!`)},i)});return delete this.waitings[r.requestid],o}}function mi(){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 db(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 pi(){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()}function mb(){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 pb(){return(navigator.browserLanguage||navigator.language).toLowerCase()}function gb(){return Intl.DateTimeFormat().resolvedOptions().timeZone.toLowerCase()}function yb(){return pi()=="safari"}function ca(){return mi()==="ios"}function Eu(){return mi()==="macos"}function wb(){return ca()|Eu()}function Pu(){return mi()==="android"}function bb(){const s=window.navigator.appVersion;if(/Android/.test(s)&&!/Chrome\/\d/.test(s)){const t=s.match(/Safari\/(\d+.\d)/);return t&&typeof t=="object"&&t.length>=2?parseFloat(t[1])<535.19:!0}else return!1}function xb(){return ca()||Pu()}function Tu(){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 vb=Tu()!==-1,Sb=document.documentMode?document.documentMode===9:!1,_b=document.documentMode?document.documentMode===10:!1,Cb=document.documentMode?document.documentMode===11:!1;function Mu(){return pi()==="wechat"}function Au(){return pi()==="ali"}function Eb(){return Mu()&&navigator.userAgent.match(/miniprogram/i)||window.__wxjs_environment==="miniprogram"}function Pb(){return Au()&&navigator.userAgent.match(/miniprogram/i)}function Tb(s=750){const t=document.documentElement,e=window.top===window.self?window.devicePixelRatio:1;t.dataset.dpr=e;let n=100;const i=function(){t.style.height=window.innerHeight+"px";const r=t.clientWidth;t.dataset.width=r,t.dataset.layout=r>s?"pc":"mobile",t.dataset.rem=n=Math.min(100,Math.round(100*(r/s))),t.style.fontSize=n+"px"};i(),window.rem2px=function(r){return parseFloat(r)*n},window.px2rem=function(r){return parseFloat(r)/n},window.addEventListener&&window.addEventListener("orientationchange"in window?"orientationchange":"resize",i,!1)}class Mb extends Do{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),ua(this.currentItem.style,this.currentItem,fa)}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&&ua(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+la(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(fa.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"&&ua(o,this.currentItem,fa),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 la(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 la(s,t,i,r)-la(e,n,i,r)}function ua(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 fa=["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 Ab{localVideoUtil;remoteVideoUtil;localPeerConnection=null;remotePeerConnection=null;constructor(t,e){this.localVideoUtil=new as(t),this.remoteVideoUtil=new as(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:
|
|
62
62
|
${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:
|
|
63
63
|
${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:
|
|
64
64
|
${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:
|
|
65
|
-
${t.sdp}.`),this.remotePeerConnection&&(this.trace("remotePeerConnection setLocalDescription start."),this.remotePeerConnection.setLocalDescription(t).then(()=>{this.setLocalDescriptionSuccess(this.remotePeerConnection)}).catch(e=>this.setSessionDescriptionError(e))),this.localPeerConnection&&(this.trace("localPeerConnection setRemoteDescription start."),this.localPeerConnection.setRemoteDescription(t).then(()=>{this.setRemoteDescriptionSuccess(this.localPeerConnection)}).catch(e=>this.setSessionDescriptionError(e)))}setSessionDescriptionError(t){this.trace(`Failed to create session description: ${t.toString()}.`)}setDescriptionSuccess(t,e){const s=this.getPeerName(t);this.trace(`${s} ${e} complete.`)}setLocalDescriptionSuccess(t){this.setDescriptionSuccess(t,"setLocalDescription")}setRemoteDescriptionSuccess(t){this.setDescriptionSuccess(t,"setRemoteDescription")}trace(t){t=t.trim();const e=(window.performance.now()/1e3).toFixed(3);console.log(e,t);const s=document.createElement("div");s.innerHTML=`<div>${e}, ${t}</div>`,document.getElementById("trace")?.appendChild(s)}getOtherPeer(t){return t===this.localPeerConnection?this.remotePeerConnection:this.localPeerConnection}getPeerName(t){return t===this.localPeerConnection?"localPeerConnection":"remotePeerConnection"}}class Ww{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 du=[],mu={};function ia(n){du.push(n)}function Jw(n,t=!1){const e=Jf();if(mu[e])return;wx.error(r=>{console.log(r.errMsg||JSON.stringify(r))}),wx.ready(()=>{du.forEach(r=>r())});const s=["updateAppMessageShareData","updateTimelineShareData","onMenuShareWeibo","onMenuShareQZone","startRecord","stopRecord","onVoiceRecordEnd","playVoice","pauseVoice","stopVoice","onVoicePlayEnd","uploadVoice","downloadVoice","chooseImage","previewImage","uploadImage","downloadImage","getLocalImgData","translateVoice","getNetworkType","openLocation","getLocation","hideOptionMenu","showOptionMenu","hideMenuItems","showMenuItems","hideAllNonBaseMenuItem","showAllNonBaseMenuItem","closeWindow","scanQRCode","openProductSpecificView","addCard","chooseCard","openCard"],i=["wx-open-launch-app","wx-open-launch-app","wx-open-subscribe","wx-open-audio"];wx.config(Object.assign(n,{debug:t,jsApiList:s,openTagList:i})),mu[e]=!0}function Zw(n){return new Promise((t,e)=>{wx.checkJsApi({jsApiList:[n],success:function(s){s.checkResult[n]?t(!0):e(!1)},fail:function(){e(!1)}})})}function Qw(n){ia(function(){wx.updateAppMessageShareData(n)})}function Kw(n){ia(function(){wx.updateTimelineShareData(n)})}function tx(n){wx.chooseImage(n)}function ex(n){wx.previewImage(n)}function sx(n){wx.uploadImage(n)}function nx(n){wx.downloadImage(n)}function ix(n){wx.getLocalImgData(n)}function rx(){wx.startRecord()}function ox(n){wx.stopRecord(n)}function ax(n){wx.onVoiceRecordEnd(n)}function hx(n){wx.playVoice(n)}function cx(n){wx.pauseVoice(n)}function lx(n){wx.stopVoice(n)}function ux(n){wx.onVoicePlayEnd(n)}function fx(n){wx.uploadVoice(n)}function dx(n){wx.downloadVoice(n)}function mx(n){wx.translateVoice(n)}function px(n){wx.getNetworkType(n)}function gx(n){wx.openLocation(n)}function yx(n){wx.getLocation(n)}function xx(n){wx.scanQRCode(n)}function bx(n,t,e){function s(){WeixinJSBridge.invoke("getBrandWCPayRequest",n,function(i){i.err_msg=="get_brand_wcpay_request:ok"?t():e(i.err_msg)})}typeof WeixinJSBridge>"u"?document.addEventListener?document.addEventListener("WeixinJSBridgeReady",s,!1):document.attachEvent&&(document.attachEvent("WeixinJSBridgeReady",s),document.attachEvent("onWeixinJSBridgeReady",s)):s()}function vx(n,t,e="snsapi_userinfo",s=""){return`https://open.weixin.qq.com/connect/oauth2/authorize?appid=${n}&redirect_uri=${encodeURIComponent(t)}&response_type=code&scope=${e}&state=${s}#wechat_redirect`}function Sx(n){window.AlipayJSBridge?n&&n():document.addEventListener("AlipayJSBridgeReady",n,!1)}function cn(n,t){let e="未知错误";switch(n.error){case 1:e="接口不存在";break;case 2:e="参数无效";break;case 3:e="发生未知错误";break;case 4:e="接口无权限";break;case 10:e="用户取消";break;case 11:e="操作失败",t==="chooseImage"&&(e="操作失败(权限不够)");break;case 12:e="GPS打开,但定位失败";break;case 13:e="获取地理位置信息失败";break;case 14:e="定位超时";break;case 15:e="网络错误";break;case 16:e="GPS未打开或用户未授权";break}return`${n.error}(${e}): ${n.errorMessage}`}function _x(n,t,e){ap.tradePay(Object.assign(n,{}),function(s){let i="未知错误";switch(s.resultCode){case 9e3:return i="订单支付成功",t?.(i);case 8e3:i="正在处理中";break;case 4e3:i="订单支付失败";break;case 6001:i="用户中途取消";break;case 6002:i="网络连接出错";break;case 99:i="用户点击忘记密码导致快捷界面退出(only iOS)";break}e?.(i)})}function Cx(n,t,e){ap.scan(Object.assign(n,{fail:s=>{e?.(cn(s))}}),function(s){t?.(s.code)})}function Tx(n,t,e){ap.getLocation(Object.assign(n,{fail:s=>{e?.(cn(s))}}),function(s){t?.(s)})}function Px(n,t,e){ap.openLocation(Object.assign(n,{fail:s=>{e?.(cn(s))}}),function(){t?.()})}function Ex(n,t,e){ap.chooseImage(Object.assign(n,{fail:s=>{e?.(cn(s,"chooseImage"))}}),function(s){t?.(s)})}function Mx(n,t,e){ap.previewImage(Object.assign(n,{fail:s=>{e?.(cn(s))}}),function(){t?.()})}class Ax{map;constructor(t,e=120.619585,s=31.299379,i=18){this.map=new T.Map(t),this.map.centerAndZoom(new T.LngLat(e,s),i)}}const Be=window.crypto.subtle;Be||console.warn("Crypto API not supported");async function pu(n,t=Es.SHA256){const e=await Be.digest(t,Ri(n));return ka(e)}async function Ix(n,t=Es.SHA256){return pu(JSON.stringify(af(n)),t)}async function kx(n,t=Es.AESGCM){const e=crypto.getRandomValues(new Uint8Array(12)),s=await Be.generateKey({name:t,length:256},!1,["encrypt","decrypt"]),i=await Be.encrypt({name:t,iv:e},s,Ri(n));return{algorithm:t,iv:e,key:s,encryptedData:i}}async function Dx(n){const t=await Be.decrypt({name:n.algorithm,iv:n.iv},n.key,n.encryptedData);return ka(t)}async function Lx(n,t=Es.ECDSA,e="SHA-384"){const{privateKey:s,publicKey:i}=await Be.generateKey({name:t,namedCurve:"P-384"},!1,["sign","verify"]),r=Ri(JSON.stringify(n)),o=await Be.sign({name:t,hash:{name:e}},s,r);return{algorithm:t,hash:e,publicKey:i,signature:o,encodedData:r}}async function Rx(n){return await Be.verify({name:n.algorithm,hash:{name:n.hash}},n.publicKey,n.signature,n.encodedData)}class Ox{currentPage;itemsPerPage;entriesInterval;entriesEdge;linkTo;prevText;nextText;ellipseText;prevShowAlways;nextShowAlways;callback;totalPages;parentVNode;constructor(t,e,s){this.currentPage=s?.currentPage||0,this.itemsPerPage=s?.itemsPerPage||10,this.entriesInterval=s?.entriesInterval||5,this.entriesEdge=s?.entriesEdge||1,this.linkTo=s?.linkTo||"javascript:;",this.prevText=s?.prevText||"上一页",this.nextText=s?.nextText||"下一页",this.ellipseText=s?.ellipseText||"...",this.prevShowAlways=typeof s?.prevShowAlways=="boolean"?s?.prevShowAlways:!0,this.nextShowAlways=typeof s?.nextShowAlways=="boolean"?s?.nextShowAlways:!0,this.callback=s?.callback||(i=>!1),this.totalPages=Math.ceil(e/this.itemsPerPage),this.parentVNode=this.createParentVNode(),_s(this.parentVNode,t),this.selectPage(this.currentPage)}createParentVNode(){return ss("div",{class:"pagination"},[])}appendVNode(t,e,s){e=e<0?0:e<this.totalPages?e:this.totalPages-1;const i=s?.text||String(e+1),r=s?.classes||"";t.children.push(e==this.currentPage&&r.indexOf("prev")==-1&&r.indexOf("next")==-1?ss("span",{class:`current ${r}`},i):ss("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),s=this.currentPage>e?Math.max(Math.min(this.currentPage-e,this.totalPages-this.entriesInterval),0):0,i=this.currentPage>e?Math.min(this.currentPage+e,this.totalPages):Math.min(this.entriesInterval,this.totalPages);if(this.prevText&&(this.currentPage>0||this.prevShowAlways)&&this.appendVNode(t,this.currentPage-1,{text:this.prevText,classes:"prev"}),s>0&&this.entriesEdge>0){const r=Math.min(this.entriesEdge,s);for(let o=0;o<r;o++)this.appendVNode(t,o);this.entriesEdge<s&&this.ellipseText&&t.children.push(ss("span",{},this.ellipseText))}for(let r=s;r<i;r++)this.appendVNode(t,r);if(i<this.totalPages&&this.entriesEdge>0){this.totalPages-this.entriesEdge>i&&this.ellipseText&&t.children.push(ss("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"}),li(this.parentVNode,t),this.parentVNode=t}selectPage(t,e){this.currentPage=t=t<0?0:t<this.totalPages?t:this.totalPages-1,this.drawLinks();const s=this.callback(t);return e&&(s||(e.stopPropagation?e.stopPropagation():e.cancelBubble=!0)),s}prevPage(){return this.selectPage(this.currentPage-1)}nextPage(){return this.selectPage(this.currentPage+1)}}class zx{static;store;eb;axios;ds;constructor(t={}){this.static=t.static||{};const e=t.store?.state||{};this.store=Ha(t.store?.reducer||(()=>e),e,t.store?.enhancer),this.eb=new _n,this.axios=new lr({baseURL:t.axios?.baseURL,timeout:t.axios?.timeout,headers:t.axios?.headers,responseType:t.axios?.responseType,responseEncoding:t.axios?.responseEncoding,interceptor:t.axios?.interceptor,retry:t.axios?.retry,cache:t.axios?.cache}),this.ds=new Hf({concurrency:1})}}return d.ArrowShape=Bo,d.BallShape=vs,d.BezierEasing=zr,d.BufferAttribute=ye,d.COLOR_NAMES=an,d.CSSToJSEasing=gg,d.Clock=Fr,d.Color=Yt,d.ColorManagement=Lo,d.CommonKeyCode=b1,d.ConfettiShapeCombo=Wo,d.Context=zx,d.CrossShape=$o,d.CurveShape=Oo,d.CustomCanvasContext=Pc,d.CustomCanvasGradient=Hn,d.CustomCanvasPattern=Ur,d.DOMParse=_o,d.DOMSVGUtil=He,d.DOMToBlob=fr,d.DOMToString=ur,d.DOMVideo=rn,d.DrawContext=q1,d.Easing=O,d.EllipseShape=Vo,d.FetchWithAxios=lr,d.FileUpload=Lm,d.Float32BufferAttribute=z0,d.FoxShape=Xo,d.HeartShape=No,d.HeartVariantShape=Fo,d.Int16BufferAttribute=D0,d.Int32BufferAttribute=R0,d.Int8BufferAttribute=A0,d.Interpolation=pe,d.LineShape=es,d.LinearSRGBColorSpace=ko,d.LinearToSRGB=ts,d.LinearTransfer=Do,d.Ls=ze,d.MVVM=Tw,d.Matrix=wt,d.Matrix2=Jr,d.Matrix3=ps,d.Matrix4=kt,d.NoColorSpace=Gl,d.Pagination=Ox,d.PointsShape=oi,d.QRCode=Re,d.RabbitShape=Uo,d.RectShape=Oe,d.RingIndicatorShapeCombo=Ho,d.RingShape=hn,d.SRGBColorSpace=Qe,d.SRGBToLinear=Ke,d.SRGBTransfer=ri,d.SVGParse=jw,d.SVGParsedPathArgsLength=Hs,d.SegmentShapeCombo=qo,d.Shape=K,d.ShapeCombo=Lt,d.ShipShapeCombo=Go,d.SliderShapeCombo=jo,d.StarShape=Yo,d.TWEEN=Cg,d.TextShape=Ss,d.Timeline=$s,d.TreeShapeCombo=zo,d.Tween=Nr,d.Uint16BufferAttribute=L0,d.Uint32BufferAttribute=O0,d.Uint8BufferAttribute=I0,d.Uint8ClampedBufferAttribute=k0,d.Vector2=Ws,d.Vector3=Bt,d.Vector4=jr,d.WebGLCoordinateSystem=Js,d.WebGLRenderer=Ww,d.WebGPUCoordinateSystem=Wr,d.WebRTCClient=Hw,d.WebSocketClient=ae,d.YZCanvasContext=$r,d.__color=xe,d.addClass=xy,d.addWatermark=_0,d.addWxJsReadyFnBeforeConfig=ia,d.ajax=Gw,d.aliJsChooseImage=Ex,d.aliJsGetLocation=Tx,d.aliJsOpenLocation=Px,d.aliJsPreviewImage=Mx,d.aliJsReady=Sx,d.aliJsScan=Cx,d.aliJsTradePay=_x,d.angle=zt,d.animateShapes=$1,d.animationEnd$=n1,d.animationStart$=s1,d.atomReadAttribute=zc,d.atomReadAttributes=so,d.atomReadStyle=Xg,d.atomReadStyles=to,d.atomRemoveAttribute=Vg,d.atomRemoveDataset=nw,d.atomRemoveStyle=eo,d.atomWriteAttribute=ws,d.atomWriteStyle=Zn,d.base64EncodeOutputStream=Xc,d.bitmapMapper=jc,d.blobToImageData=Wg,d.byteArrayOutputStream=io,d.canUsePaths=Yw,d.cancelBubble=fc,d.cancelFetch=ww,d.changeBrightness=v0,d.changeCheckboxChecked=my,d.changeDiaphaneity=S0,d.changeRadioChecked=dy,d.changeSelected=fy,d.changeSize=b0,d.checkWxJsApi=Zw,d.clearCookies=mw,d.clearLocalStorage=iw,d.clearSessionStorage=fw,d.closeLog=Mf,d.closest=ay,d.combineTransformToMatrix=Ug,d.computeImageDisplayRect=Gg,d.containsChild=ny,d.createDefaultMousePoint=uo,d.createElement=rl,d.createElementNS=Sy,d.createFragment=il,d.createIndexDB=gw,d.createObjectURL=Hc,d.createRunCycleInMaxRate=rg,d.createTextNode=_y,d.createWebSocket=ou,d.createXMLHttpRequest=fu,d.cssAttrsToCanvasAttrs=Bc,d.decrypt=Dx,d.distance=Ae,d.domPrefixes=$g,d.drag$=pl,d.dragEnd$=yl,d.dragEnter$=xl,d.dragLeave$=bl,d.dragOver$=vl,d.dragStart$=gl,d.drawBitmapInCanvas=N0,d.drawQRCodeToCanvas=M0,d.drop$=wl,d.easeNameToCubicBezier=Br,d.empty=el,d.encrypt=kx,d.fireEvent=eg,d.flipSideToSide=Zg,d.flipUpsideDown=Qg,d.followMouseShape=X1,d.getBitmapFromCanvas=B0,d.getBodyPosition=d1,d.getBrowserClient=Ko,d.getBrowserClientVersion=Mw,d.getBrowserLanguage=Aw,d.getCSSVar=cw,d.getDOMMatrix=Kr,d.getDirection=Eg,d.getDocumentElementPosition=en,d.getElementPositionInPage=yo,d.getElementPositionInPage2=p1,d.getElementPositionInViewport=El,d.getEmSize=K0,d.getFetchId=Zo,d.getFileExtension=km,d.getFileMD5Hash=Rh,d.getFileTypeFromFile=Im,d.getFormSubmitData=qw,d.getImageData=Nc,d.getImageDataByAIData=T0,d.getImageMainColor=Jg,d.getInnerText=gy,d.getInternetExplorerVersion=cu,d.getKeyCode=v1,d.getMIME=Dm,d.getMouseButton=x1,d.getMousePositionInElement=dt,d.getMousePositionInPage=wo,d.getMousePositionInViewport=w1,d.getOperatingSystem=ui,d.getOperatingSystemVersion=Ew,d.getPageSize=m1,d.getRelativeBoundingClientRect=g1,d.getRemSize=ro,d.getScreenPosition=f1,d.getSelectedText=V0,d.getStyle=We,d.getTheme$=hw,d.getTimeZone=Iw,d.getVerticalScrollTopPercentInPage=y1,d.getVertxRegisterBaseUrl=Pw,d.getViewportSize=Pl,d.getVnode=Yr,d.gifImage=Uc,d.h=ss,d.hFromEl=ci,d.hasClass=vy,d.hideEl=nl,d.html=tl,d.iframePostMessage=Cy,d.imageDataToBitmap=qg,d.imageDataToBlob=Hg,d.imageDataToDataURL=jg,d.injectStyle=Oc,d.injectWxJsConfig=Jw,d.insert=bs,d.isActiveEl=Z0,d.isAliBrowser=uu,d.isAliMiniProgram=Nw,d.isAndroid=hu,d.isAppleDevice=kw,d.isBrowserSupportFileAPI=Fw,d.isElement=Xw,d.isEventSupported=ng,d.isIE=Lw,d.isIE10=Ow,d.isIE11=zw,d.isIE9=Rw,d.isIOS=ta,d.isInput=tn,d.isInputCheckbox=ho,d.isInputNumber=uy,d.isInputRadio=co,d.isInputText=ly,d.isMacOS=au,d.isMobile=Dw,d.isRootEl=J0,d.isSelect=ao,d.isTextArea=cy,d.isTouchSupport=$w,d.isWxBrowser=lu,d.isWxMiniProgram=Bw,d.jpgToPng=g0,d.keyDown$=Sl,d.keyPress$=i1,d.keyUp$=_l,d.leftRotate=Kg,d.length=ms,d.mapTDTJSSDK=Ax,d.marginSharpen=p0,d.mosaic=C0,d.mount=_s,d.mouseClick$=Iy,d.mouseContextMenu$=Ly,d.mouseDoubleClick$=ky,d.mouseDown$=hl,d.mouseEnter$=My,d.mouseLeave$=Ay,d.mouseMove$=ti,d.mouseOut$=Ey,d.mouseOver$=Py,d.mouseUp$=cl,d.mouseWheel$=Dy,d.nearestElement=ty,d.nextElementSibling=ry,d.normalizePoint=Pg,d.objectSignature=Ix,d.onBeforeUnload=Jc,d.onDocumentReady=Wc,d.openLog=Ef,d.outputGifBase64=$c,d.outputQRCodeBase64=E0,d.pan$=Ry,d.panCancel$=Ny,d.panDown$=Uy,d.panEnd$=By,d.panLeft$=Fy,d.panMove$=Oy,d.panRight$=Yy,d.panStart$=zy,d.panUp$=Xy,d.parent=ey,d.parents=oo,d.parseCSS=Co,d.parseTransformToMatrix=Qr,d.patch=li,d.pinch$=$y,d.pinchIn$=Vy,d.pinchOut$=Gy,d.pngToJpg=y0,d.pointerCancel$=go,d.pointerDown$=mo,d.pointerMove$=fo,d.pointerUp$=po,d.polar=Ie,d.polymorphTween=G1,d.prefixes=Uw,d.press$=qy,d.preventDefault=Ee,d.previousElementSibling=oy,d.radiusClip=x0,d.readFileInBrowser=zs,d.rectClip=w0,d.rem2px=Q0,d.remove=yy,d.removeAllEventListeners=Hp,d.removeClass=by,d.requestAnimationFrameCycle=Ir,d.reverseCSSToJSEasing=yg,d.reverseEaseNameToCubicBezier=Sc,d.reverseEasing=yc,d.revokeObjectURL=F0,d.rightRotate=t0,d.rotate$=jy,d.rotatePoint=Qt,d.scheduleIdle=dc,d.scheduleIdleAsap=gc,d.scheduleVnodeAsap=Xr,d.scheduleVnodeImmediately=Tg,d.scrollParent=sy,d.scrollTo=H0,d.selectFileInBrowser=dr,d.setCSSVar=lw,d.setIntervalAccurate=ig,d.setLogUploadFn=Af,d.setManualScroll=W0,d.setRem=Vw,d.setStyle=ys,d.setTheme=ru,d.setTimeoutAccurate=kr,d.setWindowTitle=G0,d.shadowRoot=hy,d.sharpen=m0,d.showEl=sl,d.siblings=iy,d.signEncrypt=Lx,d.signature=pu,d.simulateMouseEventFromTouch=sg,d.stringToDOM=Am,d.swipe$=Hy,d.swipeDown$=Qy,d.swipeLeft$=Wy,d.swipeRight$=Jy,d.swipeUp$=Zy,d.tap$=ml,d.tapOutSide$=Ky,d.targetToAfterDropShape=U1,d.text=py,d.toBlackAndWhite=n0,d.toBlue=a0,d.toBlueAndGreen=l0,d.toBlueAndGrey=d0,d.toDegree=mt,d.toGreen=o0,d.toGreenAndGrey=f0,d.toGrey=e0,d.toGrey2=s0,d.toOpposite=i0,d.toRadian=q,d.toRed=r0,d.toRedAndBlue=c0,d.toRedAndGreen=h0,d.toRedAndGrey=u0,d.toggleClass=lo,d.toggleElDisplay=wy,d.toggleTheme=aw,d.touchCancel$=dl,d.touchEnd$=fl,d.touchMove$=ll,d.touchStart$=ul,d.transformPath2D=Yg,d.transitionEnd$=e1,d.transitionStart$=t1,d.updateVnode=qn,d.useAttribute=oe,d.useClickA=Kn,d.useClipboard=j0,d.useCookie=dw,d.useCoords$=Q1,d.useDataset=sw,d.useDocumentVisible$=u1,d.useDraggable=c1,d.useDrop=l1,d.useElementEventBus=P1,d.useEvent$=$,d.useEventListener=W,d.useFetch=ai,d.useFetchCache=bw,d.useFetchRetry=xw,d.useFetchRetryCache=vw,d.useHashChange$=tw,d.useHotKeyDown$=Al,d.useHotKeyFile=_1,d.useHotKeyFile$=Il,d.useHotKeyUp$=S1,d.useIntersection$=Ql,d.useLoadImage=Qc,d.useLoadLink=X0,d.useLoadScript=Y0,d.useLocalStorage=su,d.useLocale=Qo,d.useLocation$=eu,d.useMatchMedia$=tu,d.useMouseAndPointerDownMovePoint$=Cl,d.useMouseDownMovePoint$=o1,d.useMouseMovePoint$=r1,d.useMousePoint=Je,d.useMutation$=Zl,d.useParentEventListener=jp,d.usePointerDownMovePoint$=ei,d.usePopStateChange$=ew,d.usePressDownMove=Dl,d.usePressDownMoveWithMouse=E1,d.usePressDownMoveWithPointer=Ll,d.usePressDownMoveWithTouch=M1,d.usePull$=h1,d.useResize=kl,d.useResize$=xo,d.useRunInSandbox=Ty,d.useSafeArea$=Z1,d.useScroll$=Tl,d.useSelectFile=Kc,d.useSelectFileImage=$0,d.useSessionStorage=uw,d.useTouchDownMovePoint$=a1,d.useUrlChange$=K1,d.useVisible$=W1,d.useVisibleSimple$=H1,d.useWindowResize$=C1,d.verifyDecrypt=Rx,d.vibrate=q0,d.waitElementAddedInDOM=j1,d.waitForStyleSheetsLoaded=U0,d.writeToIndexDB=yw,d.wxJsChooseImage=tx,d.wxJsDownloadImage=nx,d.wxJsDownloadVoice=dx,d.wxJsGetLocalImgData=ix,d.wxJsGetLocation=yx,d.wxJsGetNetworkType=px,d.wxJsLogin=vx,d.wxJsOnVoicePlayEnd=ux,d.wxJsOnVoiceRecordEnd=ax,d.wxJsOpenLocation=gx,d.wxJsPauseVoice=cx,d.wxJsPay=bx,d.wxJsPlayVoice=hx,d.wxJsPreviewImage=ex,d.wxJsScanQRCode=xx,d.wxJsStartRecord=rx,d.wxJsStopRecord=ox,d.wxJsStopVoice=lx,d.wxJsTranslateVoice=mx,d.wxJsUpdateAppMessageShareData=Qw,d.wxJsUpdateTimelineShareData=Kw,d.wxJsUploadImage=sx,d.wxJsUploadVoice=fx,Object.defineProperty(d,Symbol.toStringTag,{value:"Module"}),d}({});
|
|
65
|
+
${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 Ib{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 Iu=[],ku={};function da(s){Iu.push(s)}function kb(s,t=!1){const e=pd();if(ku[e])return;wx.error(r=>{console.log(r.errMsg||JSON.stringify(r))}),wx.ready(()=>{Iu.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})),ku[e]=!0}function Db(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 Lb(s){da(function(){wx.updateAppMessageShareData(s)})}function Rb(s){da(function(){wx.updateTimelineShareData(s)})}function Ob(s){wx.chooseImage(s)}function zb(s){wx.previewImage(s)}function Nb(s){wx.uploadImage(s)}function Bb(s){wx.downloadImage(s)}function Fb(s){wx.getLocalImgData(s)}function Yb(){wx.startRecord()}function Xb(s){wx.stopRecord(s)}function Ub(s){wx.onVoiceRecordEnd(s)}function $b(s){wx.playVoice(s)}function Gb(s){wx.pauseVoice(s)}function Vb(s){wx.stopVoice(s)}function qb(s){wx.onVoicePlayEnd(s)}function jb(s){wx.uploadVoice(s)}function Hb(s){wx.downloadVoice(s)}function Wb(s){wx.translateVoice(s)}function Jb(s){wx.getNetworkType(s)}function Zb(s){wx.openLocation(s)}function Kb(s){wx.getLocation(s)}function Qb(s){wx.scanQRCode(s)}function tx(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 ex(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 nx(s){window.AlipayJSBridge?s&&s():document.addEventListener("AlipayJSBridgeReady",s,!1)}function us(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 sx(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 ix(s,t,e){ap.scan(Object.assign(s,{fail:n=>{e?.(us(n))}}),function(n){t?.(n.code)})}function rx(s,t,e){ap.getLocation(Object.assign(s,{fail:n=>{e?.(us(n))}}),function(n){t?.(n)})}function ox(s,t,e){ap.openLocation(Object.assign(s,{fail:n=>{e?.(us(n))}}),function(){t?.()})}function ax(s,t,e){ap.chooseImage(Object.assign(s,{fail:n=>{e?.(us(n,"chooseImage"))}}),function(n){t?.(n)})}function hx(s,t,e){ap.previewImage(Object.assign(s,{fail:n=>{e?.(us(n))}}),function(){t?.()})}class cx{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 Vt=window.crypto.subtle;async function Du(s,t=An.SHA256){if(!Vt)throw new Error("Crypto API not supported");const e=await Vt.digest(t,Ni(s));return Ua(e)}async function lx(s,t=An.SHA256){return Du(JSON.stringify(vf(s)),t)}async function ux(s,t=An.AESGCM){if(!Vt)throw new Error("Crypto API not supported");const e=crypto.getRandomValues(new Uint8Array(12)),n=await Vt.generateKey({name:t,length:256},!1,["encrypt","decrypt"]),i=await Vt.encrypt({name:t,iv:e},n,Ni(s));return{algorithm:t,iv:e,key:n,encryptedData:i}}async function fx(s){if(!Vt)throw new Error("Crypto API not supported");const t=await Vt.decrypt({name:s.algorithm,iv:s.iv},s.key,s.encryptedData);return Ua(t)}async function dx(s,t=An.ECDSA,e="SHA-384"){if(!Vt)throw new Error("Crypto API not supported");const{privateKey:n,publicKey:i}=await Vt.generateKey({name:t,namedCurve:"P-384"},!1,["sign","verify"]),r=Ni(JSON.stringify(s)),o=await Vt.sign({name:t,hash:{name:e}},n,r);return{algorithm:t,hash:e,publicKey:i,signature:o,encodedData:r}}async function mx(s){if(!Vt)throw new Error("Crypto API not supported");return await Vt.verify({name:s.algorithm,hash:{name:s.hash}},s.publicKey,s.signature,s.encodedData)}class px{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(),En(this.parentVNode,t),this.selectPage(this.currentPage)}createParentVNode(){return sn("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?sn("span",{class:`current ${r}`},i):sn("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(sn("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(sn("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"}),di(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||Lr(e)),n}prevPage(){return this.selectPage(this.currentPage-1)}nextPage(){return this.selectPage(this.currentPage+1)}}class gx{static;store;eb;axios;ds;constructor(t={}){this.static=t.static||{};const e=t.store?.state||{};this.store=rh({reducer:t.store?.reducer||(()=>e),initState:e,enhancer:t.store?.enhancer,immutable:typeof t.store?.immutable=="boolean"?t.store?.immutable:!0}),this.eb=new Ps,this.axios=new Uh({baseURL:t.axios?.baseURL,timeout:t.axios?.timeout,headers:t.axios?.headers,responseType:t.axios?.responseType,responseEncoding:t.axios?.responseEncoding,interceptor:t.axios?.interceptor,retry:t.axios?.retry,cache:t.axios?.cache}),this.ds=new dd({concurrency:1})}}class yx{appId;reportUrl;constructor(t){this.appId=t.appId,this.reportUrl=t.reportUrl,this.listenJSError(),this.listenAssetsError(),this.listenPromiseError(),t.checkWhiteScreen&&this.listenWhiteScreenError()}listenJSError(){window.onerror=(t,e,n,i,r)=>{const o={type:"js_error",msg:t,file:e,row:n,col:i,stack:r?.stack};this.report(o)}}listenAssetsError(){window.addEventListener("error",t=>{const e=t.target;if(e instanceof HTMLScriptElement||e instanceof HTMLStyleElement||e instanceof HTMLImageElement){const n={type:"resource_error",filename:e.src||e.href,tagName:e.tagName};this.report(n)}},!0)}listenPromiseError(){window.addEventListener("unhandledrejection",t=>{const e={type:"promise_error",reason:t.reason};this.report(e)})}listenWhiteScreenError(){ho(()=>{setTimeout(()=>{const t=[[window.innerWidth/2,window.innerHeight/2],[window.innerWidth/2,window.innerHeight*.2],[window.innerWidth/2,window.innerHeight*.8],[window.innerWidth*.2,window.innerHeight/2],[window.innerWidth*.8,window.innerHeight/2]];let e=0;if(t.forEach(n=>{const[i,r]=n,a=document.elementsFromPoint(i,r)[0];(a?.tagName==="BODY"||a?.tagName==="HTML")&&e++}),e>=t.length*.8){const n={type:"whitescreen_error",reason:"检测到白屏!"};this.report(n)}},3e3)})}report(t){const e=JSON.stringify({...t,appId:this.appId,time:kf()});console.error(e),this.reportUrl&&navigator.sendBeacon(this.reportUrl,e)}}return m.ArrowShape=qo,m.BallShape=_n,m.BezierEasing=Xr,m.BufferAttribute=ye,m.COLOR_NAMES=cs,m.CSSToJSEasing=Hg,m.Clock=Gr,m.Color=Yt,m.ColorManagement=Uo,m.CommonKeyCode=aw,m.ConfettiShapeCombo=ia,m.Context=gx,m.CrossShape=Ko,m.CurveShape=Go,m.CustomCanvasContext=Hc,m.CustomCanvasGradient=Ks,m.CustomCanvasPattern=Kr,m.DOMParse=Do,m.DOMSVGUtil=We,m.DOMToBlob=mr,m.DOMToString=dr,m.DOMVideo=as,m.DrawContext=Rw,m.Easing=O,m.EllipseShape=Qo,m.FileUpload=hp,m.Float32BufferAttribute=ly,m.FoxShape=Jo,m.HeartShape=jo,m.HeartVariantShape=Ho,m.Int16BufferAttribute=oy,m.Int32BufferAttribute=hy,m.Int8BufferAttribute=sy,m.Interpolation=pe,m.Key=hw,m.LineShape=nn,m.LinearSRGBColorSpace=Yo,m.LinearToSRGB=en,m.LinearTransfer=Xo,m.Ls=Be,m.MVVM=ub,m.Matrix=bt,m.Matrix2=so,m.Matrix3=wn,m.Matrix4=Dt,m.NoColorSpace=ou,m.Pagination=px,m.PointsShape=ci,m.QRCode=De,m.RabbitShape=Zo,m.RectShape=Ne,m.RingIndicatorShapeCombo=sa,m.RingShape=ls,m.SRGBColorSpace=Qe,m.SRGBToLinear=tn,m.SRGBTransfer=hi,m.SVGParse=Mb,m.SVGParsedPathArgsLength=Qn,m.SegmentShapeCombo=ea,m.Shape=Q,m.ShapeCombo=Rt,m.ShipShapeCombo=ta,m.SliderShapeCombo=na,m.StarShape=Wo,m.TWEEN=n0,m.TextShape=Cn,m.Timeline=Vn,m.TreeShapeCombo=Vo,m.Tween=$r,m.Uint16BufferAttribute=ay,m.Uint32BufferAttribute=cy,m.Uint8BufferAttribute=iy,m.Uint8ClampedBufferAttribute=ry,m.Vector2=Wn,m.Vector3=Bt,m.Vector4=Jr,m.WebGLCoordinateSystem=ts,m.WebGLRenderer=Ib,m.WebGPUCoordinateSystem=no,m.WebMonitor=yx,m.WebRTCClient=Ab,m.WebSocketClient=ae,m.YZCanvasContext=Qr,m.__color=xe,m.addClass=Wy,m.addWatermark=z0,m.addWxJsReadyFnBeforeConfig=da,m.ajax=yl,m.aliJsChooseImage=ax,m.aliJsGetLocation=rx,m.aliJsOpenLocation=ox,m.aliJsPreviewImage=hx,m.aliJsReady=nx,m.aliJsScan=ix,m.aliJsTradePay=sx,m.angle=Nt,m.animate=dy,m.animateShapes=kw,m.animationEnd$=$1,m.animationStart$=U1,m.atomReadAttribute=vl,m.atomReadAttributes=wo,m.atomReadStyle=i1,m.atomReadStyles=go,m.atomRemoveAttribute=h1,m.atomRemoveDataset=qw,m.atomRemoveStyle=yo,m.atomWriteAttribute=Je,m.atomWriteStyle=is,m.base64EncodeOutputStream=Fc,m.bitmapMapper=nl,m.blobToImageData=h0,m.byteArrayOutputStream=Hr,m.cancelFetch=ib,m.changeBrightness=R0,m.changeCheckboxChecked=Gy,m.changeDiaphaneity=O0,m.changeRadioChecked=$y,m.changeSelected=Uy,m.changeSize=L0,m.checkWxJsApi=Db,m.clearCookies=tb,m.clearLocalStorage=jw,m.clearSessionStorage=Xw,m.closeLog=qf,m.closest=Ny,m.computeImageDisplayRect=i0,m.containsChild=Ly,m.createDefaultMousePoint=bo,m.createElement=dl,m.createElementNS=Ky,m.createEvent=qs,m.createFragment=fl,m.createFromEventPattern=Pg,m.createIndexDB=nb,m.createObjectURL=sl,m.createRunCycleInMaxRate=Ng,m.createTextNode=Qy,m.createWebSocket=Cu,m.createXMLHttpRequest=gl,m.cssAttrsToCanvasAttrs=Sl,m.decrypt=fx,m.dispatchClickFromEvent=Rg,m.dispatchEvent=Rr,m.dispatchEventFromEvent=Lg,m.distance=Le,m.domPrefixes=oo,m.drag$=Il,m.dragEnd$=Dl,m.dragEnter$=Rl,m.dragLeave$=Ol,m.dragOver$=zl,m.dragStart$=kl,m.drawBitmapInCanvas=fy,m.drawQRCodeToCanvas=X0,m.drop$=Ll,m.easeNameToCubicBezier=Ur,m.empty=cl,m.encrypt=ux,m.flipSideToSide=l0,m.flipUpsideDown=u0,m.followMouseShape=Aw,m.getBitmapFromCanvas=uy,m.getBrowserClient=pi,m.getBrowserClientVersion=mb,m.getBrowserLanguage=pb,m.getCSSVar=Zw,m.getDOMMatrix=ro,m.getDirection=$0,m.getDocumentElement=Sn,m.getElementPositionInPage=Po,m.getElementPositionInPage2=ew,m.getElementPositionInViewport=Eo,m.getEmSize=Ay,m.getEventCurrentTarget=_g,m.getFetchId=aa,m.getFileExtension=rp,m.getFileMD5Hash=qh,m.getFileTypeFromFile=ip,m.getFormSubmitData=n1,m.getImageData=zc,m.getImageDataByAIData=B0,m.getImageMainColor=c0,m.getInnerText=qy,m.getInternetExplorerVersion=Tu,m.getKeyCode=cw,m.getMIME=op,m.getMouseButton=ow,m.getMousePositionInElement=ft,m.getMousePositionInPage=To,m.getMousePositionInViewport=iw,m.getOperatingSystem=mi,m.getOperatingSystemVersion=db,m.getPage=Q1,m.getRelativeBoundingClientRect=tw,m.getRemSize=co,m.getRules=a1,m.getScrollWheelDelta=rw,m.getSelectedText=xy,m.getStyle=ss,m.getStyleSheets=xl,m.getTheme$=Jw,m.getTimeZone=gb,m.getVerticalScrollTopPercentInPage=nw,m.getVertxRegisterBaseUrl=fb,m.getViewport=Co,m.getVnode=Vr,m.getWindow=K1,m.gifImage=Yc,m.h=sn,m.hFromEl=fi,m.hasClass=Zy,m.hideEl=ul,m.html=hl,m.iframePostMessage=t1,m.imageDataToBitmap=r0,m.imageDataToBlob=a0,m.imageDataToDataURL=o0,m.injectStyle=bl,m.injectWxJsConfig=kb,m.insert=xn,m.isActiveEl=Ty,m.isAliBrowser=Au,m.isAliMiniProgram=Pb,m.isAndroid=Pu,m.isAppleDevice=wb,m.isBadAndroid=bb,m.isBrowserSupportFileAPI=ep,m.isElement=my,m.isIE=vb,m.isIE10=_b,m.isIE11=Cb,m.isIE9=Sb,m.isIOS=ca,m.isInViewport=sw,m.isInput=ns,m.isInputCheckbox=fo,m.isInputNumber=Xy,m.isInputRadio=mo,m.isInputText=Yy,m.isMacOS=Eu,m.isMobile=xb,m.isRootEl=Py,m.isSafari=yb,m.isSelect=uo,m.isSupportEvent=u1,m.isSupportPointer=l1,m.isSupportTouch=c1,m.isTextArea=Fy,m.isWxBrowser=Mu,m.isWxMiniProgram=Eb,m.jpgToPng=A0,m.keyDown$=Nl,m.keyPress$=G1,m.keyUp$=Bl,m.leftRotate=f0,m.length=yn,m.mapTDTJSSDK=cx,m.marginSharpen=M0,m.mosaic=N0,m.mount=En,m.mouseClick$=g1,m.mouseContextMenu$=b1,m.mouseDoubleClick$=y1,m.mouseDown$=_l,m.mouseEnter$=m1,m.mouseLeave$=p1,m.mouseMove$=si,m.mouseOut$=d1,m.mouseOver$=f1,m.mouseUp$=Cl,m.mouseWheel$=w1,m.nearestElement=Iy,m.nextElementSibling=Oy,m.normalizePoint=U0,m.objectSignature=lx,m.onBeforeUnload=il,m.onDocumentReady=ho,m.openLog=Vf,m.outputGifBase64=Xc,m.outputQRCodeBase64=Y0,m.pan$=x1,m.panCancel$=C1,m.panDown$=M1,m.panEnd$=_1,m.panLeft$=E1,m.panMove$=v1,m.panRight$=P1,m.panStart$=S1,m.panUp$=T1,m.parent=ky,m.parents=lo,m.parseCSS=Lo,m.parseTransformToMatrix=el,m.patch=di,m.pinch$=A1,m.pinchIn$=I1,m.pinchOut$=k1,m.pngToJpg=I0,m.pointerCancel$=_o,m.pointerDown$=vo,m.pointerMove$=xo,m.pointerUp$=So,m.polar=Re,m.polymorphTween=Lw,m.press$=D1,m.preventDefault=Ae,m.previousElementSibling=zy,m.querySelectorAllToStringArray=np,m.radiusClip=D0,m.readFileInBrowser=Bn,m.readStyleFromStyles=s1,m.rectClip=k0,m.rem2px=My,m.remove=jy,m.removeAllEventListeners=Eg,m.removeClass=Jy,m.requestAnimationFrameCycle=Or,m.reverseCSSToJSEasing=Wg,m.reverseEaseNameToCubicBezier=Lc,m.reverseEasing=Mc,m.revokeObjectURL=py,m.rightRotate=d0,m.rotate$=L1,m.rotatePoint=Qt,m.runInSandbox=e1,m.scheduleIdle=Cc,m.scheduleIdleAsap=Tc,m.scheduleVnodeAsap=qr,m.scheduleVnodeImmediately=s0,m.scrollParent=Dy,m.scrollTo=Cy,m.selectFileInBrowser=pr,m.setCSSVar=Kw,m.setIntervalAccurate=zg,m.setLogUploadFn=jf,m.setManualScroll=Ey,m.setRem=Tb,m.setStyle=vn,m.setTheme=_u,m.setTimeoutAccurate=zr,m.setWindowTitle=vy,m.shadowRoot=By,m.sharpen=T0,m.showEl=ll,m.siblings=Ry,m.signEncrypt=dx,m.signature=Du,m.simulateEventFromTouch=Og,m.stopPropagation=Lr,m.storage$=Z1,m.stringToDOM=sp,m.swipe$=R1,m.swipeDown$=B1,m.swipeLeft$=O1,m.swipeRight$=z1,m.swipeUp$=N1,m.tap$=Al,m.tapOutSide$=F1,m.targetToAfterDropShape=Iw,m.text=Vy,m.toBlackAndWhite=g0,m.toBlue=x0,m.toBlueAndGreen=_0,m.toBlueAndGrey=P0,m.toDegree=gt,m.toGreen=b0,m.toGreenAndGrey=E0,m.toGrey=m0,m.toGrey2=p0,m.toOpposite=y0,m.toRadian=q,m.toRed=w0,m.toRedAndBlue=S0,m.toRedAndGreen=v0,m.toRedAndGrey=C0,m.toggleClass=po,m.toggleElDisplay=Hy,m.toggleTheme=Ww,m.touchCancel$=Ml,m.touchEnd$=Tl,m.touchMove$=El,m.touchStart$=Pl,m.transform=ao,m.transformPath2D=ny,m.transitionEnd$=X1,m.transitionStart$=Y1,m.updateVnode=Js,m.useAttribute=we,m.useClickA=ni,m.useClipboard=_y,m.useCompatableDownMovePoint$=q1,m.useCookie=Qw,m.useCoords$=Yw,m.useDataset=Vw,m.useDocumentVisible$=J1,m.useDraggable=H1,m.useDrop=W1,m.useElementEventBus=mw,m.useEvent$=X,m.useEventListener=W,m.useFeRoute=Gw,m.useFetch=li,m.useFetchCache=ob,m.useFetchRetry=rb,m.useFetchRetryCache=ab,m.useHashChange$=$w,m.useHotKeyDown$=Gl,m.useHotKeyFile=uw,m.useHotKeyFile$=Vl,m.useHotKeyUp$=lw,m.useIntersection$=du,m.useLoadImage=ol,m.useLoadLink=yy,m.useLoadScript=gy,m.useLocalStorage=wu,m.useLocale=ha,m.useLocation$=gu,m.useMatchMedia$=pu,m.useMouseAndPointerDownMovePoint$=Xl,m.useMouseDownMovePoint$=Fl,m.useMouseMovePoint$=V1,m.useMousePoint=Ze,m.useMutation$=fu,m.useParentEventListener=Cg,m.usePointerDownMovePoint$=ii,m.usePopStateChange$=yu,m.usePressDownMove=jl,m.usePressDownMoveWithMouse=pw,m.usePressDownMoveWithPointer=Hl,m.usePressDownMoveWithTouch=gw,m.usePull$=j1,m.useResize=ql,m.useResize$=Mo,m.useSafeArea$=Fw,m.useScroll$=Ul,m.useSelectFile=al,m.useSelectFileImage=by,m.useSessionStorage=ra,m.useTouchDownMovePoint$=Yl,m.useUrlChange$=Uw,m.useVisible$=Nw,m.useVisibleSimple$=zw,m.useWindowResize$=fw,m.verifyDecrypt=mx,m.vibrate=Sy,m.waitElementAddedInDOM=Ow,m.waitForStyleSheetsLoaded=wy,m.writeToIndexDB=sb,m.wxJsChooseImage=Ob,m.wxJsDownloadImage=Bb,m.wxJsDownloadVoice=Hb,m.wxJsGetLocalImgData=Fb,m.wxJsGetLocation=Kb,m.wxJsGetNetworkType=Jb,m.wxJsLogin=ex,m.wxJsOnVoicePlayEnd=qb,m.wxJsOnVoiceRecordEnd=Ub,m.wxJsOpenLocation=Zb,m.wxJsPauseVoice=Gb,m.wxJsPay=tx,m.wxJsPlayVoice=$b,m.wxJsPreviewImage=zb,m.wxJsScanQRCode=Qb,m.wxJsStartRecord=Yb,m.wxJsStopRecord=Xb,m.wxJsStopVoice=Vb,m.wxJsTranslateVoice=Wb,m.wxJsUpdateAppMessageShareData=Lb,m.wxJsUpdateTimelineShareData=Rb,m.wxJsUploadImage=Nb,m.wxJsUploadVoice=jb,Object.defineProperty(m,Symbol.toStringTag,{value:"Module"}),m}({});
|
|
66
66
|
//# sourceMappingURL=zyzgroup_core_web.iife.js.map
|