@zyzgroup/core-web 0.0.63 → 0.0.64
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/effects.css +20 -0
- package/dist/theme.css +4 -4
- package/dist/zyzgroup_core_web.iife.js +19 -23
- package/dist/zyzgroup_core_web.iife.js.map +1 -1
- package/dist/zyzgroup_core_web.js +9033 -11631
- package/dist/zyzgroup_core_web.js.map +1 -1
- package/dist/zyzgroup_core_web.umd.cjs +19 -23
- package/dist/zyzgroup_core_web.umd.cjs.map +1 -1
- package/package.json +1 -1
- package/types/animate/AnimateOperation.d.ts +35 -30
- package/types/animate/AnimateOperation.d.ts.map +1 -1
- package/types/animate/animateInWeb.d.ts +1 -0
- package/types/animate/animateInWeb.d.ts.map +1 -1
- package/types/canvas/Canvas.d.ts +35 -0
- package/types/canvas/Canvas.d.ts.map +1 -0
- package/types/canvas/CanvasOperation.d.ts +17 -8
- package/types/canvas/CanvasOperation.d.ts.map +1 -1
- package/types/canvas/index.d.ts +1 -0
- package/types/canvas/index.d.ts.map +1 -1
- package/types/dom/DOMEventBus.d.ts +12 -14
- package/types/dom/DOMEventBus.d.ts.map +1 -1
- package/types/dom/DOMParse.d.ts +28 -0
- package/types/dom/DOMParse.d.ts.map +1 -0
- package/types/dom/DOMUtil.d.ts +56 -15
- package/types/dom/DOMUtil.d.ts.map +1 -1
- package/types/dom/index.d.ts +2 -2
- package/types/dom/index.d.ts.map +1 -1
- package/types/env.d.ts +1 -0
- package/types/env.d.ts.map +1 -1
- package/types/fetch.d.ts +1 -0
- package/types/fetch.d.ts.map +1 -1
- package/types/file.d.ts.map +1 -1
- package/types/index.d.ts +1 -1
- package/types/index.d.ts.map +1 -1
- package/types/math/Arc.d.ts +24 -0
- package/types/math/Arc.d.ts.map +1 -0
- package/types/math/CubicBezier.d.ts +28 -0
- package/types/math/CubicBezier.d.ts.map +1 -0
- package/types/math/Ellipse.d.ts +18 -0
- package/types/math/Ellipse.d.ts.map +1 -0
- package/types/math/Line.d.ts +20 -0
- package/types/math/Line.d.ts.map +1 -0
- package/types/math/Matrix.d.ts +1 -1
- package/types/math/Matrix.d.ts.map +1 -1
- package/types/{shape → math}/PathGroup.d.ts +18 -25
- package/types/math/PathGroup.d.ts.map +1 -0
- package/types/math/Point.d.ts +27 -0
- package/types/math/Point.d.ts.map +1 -0
- package/types/math/Points.d.ts +23 -0
- package/types/math/Points.d.ts.map +1 -0
- package/types/math/QuadraticBezier.d.ts +22 -0
- package/types/math/QuadraticBezier.d.ts.map +1 -0
- package/types/math/Rect.d.ts +29 -0
- package/types/math/Rect.d.ts.map +1 -0
- package/types/math/Shape.d.ts +68 -0
- package/types/math/Shape.d.ts.map +1 -0
- package/types/math/ShapeFromSVG.d.ts +30 -0
- package/types/math/ShapeFromSVG.d.ts.map +1 -0
- package/types/math/index.d.ts +13 -1
- package/types/math/index.d.ts.map +1 -1
- package/types/math/math.d.ts +3 -2
- package/types/math/math.d.ts.map +1 -1
- package/types/math/shapes/Arrow.d.ts +10 -0
- package/types/math/shapes/Arrow.d.ts.map +1 -0
- package/types/math/shapes/Fox.d.ts +10 -0
- package/types/math/shapes/Fox.d.ts.map +1 -0
- package/types/math/shapes/index.d.ts +3 -0
- package/types/math/shapes/index.d.ts.map +1 -0
- package/types/{shape/shapes → shapes}/ShapeArmyAnts.d.ts +1 -1
- package/types/shapes/ShapeArmyAnts.d.ts.map +1 -0
- package/types/{shape/shapes → shapes}/ShapeBase.d.ts +2 -2
- package/types/shapes/ShapeBase.d.ts.map +1 -0
- package/types/{shape/shapes → shapes}/ShapeHeart.d.ts +1 -1
- package/types/shapes/ShapeHeart.d.ts.map +1 -0
- package/types/shapes/ShapeLight.d.ts.map +1 -0
- package/types/shapes/ShapePoint3d.d.ts.map +1 -0
- package/types/{shape/shapes → shapes}/ShapeRabbit.d.ts +1 -1
- package/types/shapes/ShapeRabbit.d.ts.map +1 -0
- package/types/{shape/shapes → shapes}/ShapeShip.d.ts +1 -1
- package/types/shapes/ShapeShip.d.ts.map +1 -0
- package/types/{shape/shapes → shapes}/ShapeSlider.d.ts +1 -1
- package/types/shapes/ShapeSlider.d.ts.map +1 -0
- package/types/{shape/shapes → shapes}/ShapeSpirograph.d.ts +1 -1
- package/types/shapes/ShapeSpirograph.d.ts.map +1 -0
- package/types/{shape/shapes → shapes}/ShapeStar.d.ts +1 -1
- package/types/shapes/ShapeStar.d.ts.map +1 -0
- package/types/{shape/shapes → shapes}/ShapeTiger.d.ts +1 -1
- package/types/shapes/ShapeTiger.d.ts.map +1 -0
- package/types/{shape/shapes → shapes}/ShapeTree.d.ts +1 -1
- package/types/shapes/ShapeTree.d.ts.map +1 -0
- package/types/{shape/shapes → shapes}/ShapeTriangle.d.ts +1 -1
- package/types/shapes/ShapeTriangle.d.ts.map +1 -0
- package/types/{shape/shapes → shapes}/ShapeTriangleLight.d.ts +1 -1
- package/types/shapes/ShapeTriangleLight.d.ts.map +1 -0
- package/types/{shape/shapes → shapes}/index.d.ts +0 -7
- package/types/shapes/index.d.ts.map +1 -0
- package/types/svg/DOMSVGUtil.d.ts +61 -0
- package/types/svg/DOMSVGUtil.d.ts.map +1 -0
- package/types/svg/SVGParse.d.ts +16 -0
- package/types/svg/SVGParse.d.ts.map +1 -0
- package/types/svg/YZRaphael.d.ts +1 -0
- package/types/svg/YZRaphael.d.ts.map +1 -0
- package/types/svg/index.d.ts +2 -2
- package/types/svg/index.d.ts.map +1 -1
- package/types/svg/lib/point-in-path.d.ts.map +1 -1
- package/types/svg/line2c.d.ts +4 -0
- package/types/svg/line2c.d.ts.map +1 -0
- package/types/theme.d.ts +33 -11
- package/types/theme.d.ts.map +1 -1
- package/dist/example.css +0 -41
- package/types/dom/DOMDetect.d.ts +0 -19
- package/types/dom/DOMDetect.d.ts.map +0 -1
- package/types/dom/DOMQuery.d.ts +0 -82
- package/types/dom/DOMQuery.d.ts.map +0 -1
- package/types/shape/Arc.d.ts +0 -22
- package/types/shape/Arc.d.ts.map +0 -1
- package/types/shape/CubicBezier.d.ts +0 -18
- package/types/shape/CubicBezier.d.ts.map +0 -1
- package/types/shape/Line.d.ts +0 -13
- package/types/shape/Line.d.ts.map +0 -1
- package/types/shape/PathGroup.d.ts.map +0 -1
- package/types/shape/Point.d.ts +0 -25
- package/types/shape/Point.d.ts.map +0 -1
- package/types/shape/Polygon.d.ts +0 -20
- package/types/shape/Polygon.d.ts.map +0 -1
- package/types/shape/QuadraticBezier.d.ts +0 -16
- package/types/shape/QuadraticBezier.d.ts.map +0 -1
- package/types/shape/Rect.d.ts +0 -18
- package/types/shape/Rect.d.ts.map +0 -1
- package/types/shape/SportBase.d.ts +0 -49
- package/types/shape/SportBase.d.ts.map +0 -1
- package/types/shape/YZRaphael.d.ts +0 -4
- package/types/shape/YZRaphael.d.ts.map +0 -1
- package/types/shape/index.d.ts +0 -7
- package/types/shape/index.d.ts.map +0 -1
- package/types/shape/shapes/ShapeArmyAnts.d.ts.map +0 -1
- package/types/shape/shapes/ShapeArrow.d.ts +0 -8
- package/types/shape/shapes/ShapeArrow.d.ts.map +0 -1
- package/types/shape/shapes/ShapeBall.d.ts +0 -9
- package/types/shape/shapes/ShapeBall.d.ts.map +0 -1
- package/types/shape/shapes/ShapeBase.d.ts.map +0 -1
- package/types/shape/shapes/ShapeFox.d.ts +0 -8
- package/types/shape/shapes/ShapeFox.d.ts.map +0 -1
- package/types/shape/shapes/ShapeHeart.d.ts.map +0 -1
- package/types/shape/shapes/ShapeLight.d.ts.map +0 -1
- package/types/shape/shapes/ShapeLine.d.ts +0 -32
- package/types/shape/shapes/ShapeLine.d.ts.map +0 -1
- package/types/shape/shapes/ShapePoint3d.d.ts.map +0 -1
- package/types/shape/shapes/ShapeRabbit.d.ts.map +0 -1
- package/types/shape/shapes/ShapeRect.d.ts +0 -18
- package/types/shape/shapes/ShapeRect.d.ts.map +0 -1
- package/types/shape/shapes/ShapeSegment.d.ts +0 -19
- package/types/shape/shapes/ShapeSegment.d.ts.map +0 -1
- package/types/shape/shapes/ShapeShip.d.ts.map +0 -1
- package/types/shape/shapes/ShapeSlider.d.ts.map +0 -1
- package/types/shape/shapes/ShapeSmileFace.d.ts +0 -6
- package/types/shape/shapes/ShapeSmileFace.d.ts.map +0 -1
- package/types/shape/shapes/ShapeSpirograph.d.ts.map +0 -1
- package/types/shape/shapes/ShapeStar.d.ts.map +0 -1
- package/types/shape/shapes/ShapeTiger.d.ts.map +0 -1
- package/types/shape/shapes/ShapeTree.d.ts.map +0 -1
- package/types/shape/shapes/ShapeTriangle.d.ts.map +0 -1
- package/types/shape/shapes/ShapeTriangleLight.d.ts.map +0 -1
- package/types/shape/shapes/index.d.ts.map +0 -1
- package/types/svg/SVGOperation.d.ts +0 -75
- package/types/svg/SVGOperation.d.ts.map +0 -1
- package/types/svg/lib/a2c.d.ts +0 -3
- package/types/svg/lib/a2c.d.ts.map +0 -1
- package/types/svg/lib/abs-svg-path.d.ts +0 -3
- package/types/svg/lib/abs-svg-path.d.ts.map +0 -1
- package/types/svg/lib/index.d.ts +0 -8
- package/types/svg/lib/index.d.ts.map +0 -1
- package/types/svg/lib/is-svg-path.d.ts +0 -3
- package/types/svg/lib/is-svg-path.d.ts.map +0 -1
- package/types/svg/lib/normalize-svg-path.d.ts +0 -3
- package/types/svg/lib/normalize-svg-path.d.ts.map +0 -1
- package/types/svg/lib/parse-svg-path.d.ts +0 -3
- package/types/svg/lib/parse-svg-path.d.ts.map +0 -1
- package/types/svg/lib/point-at-length.d.ts +0 -13
- package/types/svg/lib/point-at-length.d.ts.map +0 -1
- package/types/svg/lib/point-svg-path.d.ts +0 -12
- package/types/svg/lib/point-svg-path.d.ts.map +0 -1
- package/types/svg/lib/rel-svg-path.d.ts +0 -3
- package/types/svg/lib/rel-svg-path.d.ts.map +0 -1
- package/types/svg/rappar.d.ts +0 -3
- package/types/svg/rappar.d.ts.map +0 -1
- /package/types/{shape/shapes → shapes}/ShapeLight.d.ts +0 -0
- /package/types/{shape/shapes → shapes}/ShapePoint3d.d.ts +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(d,Ft){typeof exports=="object"&&typeof module<"u"?Ft(exports):typeof define=="function"&&define.amd?define(["exports"],Ft):(d=typeof globalThis<"u"?globalThis:d||self,Ft(d.ZYZGroupCoreWeb={}))})(this,function(d){"use strict";const Ft=typeof window=="object"&&typeof document=="object";typeof process<"u"&&process.versions!=null&&process.versions.node!=null;const Ue=s=>{let t=null;switch(s){case"any-character":t=/[^]/;break;case"bin":t=/^(0b)?[0-1]+$/;break;case"oct":t=/^(0o)?[0-7]+$/i;break;case"hex":t=/^(0x)?[0-9a-fA-F]+$/i;break;case"int":t=/^[-+]?[0-9]+$/;break;case"number":t=/[-+]?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/gi;break;case"number-single":t=/[-+]?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/i;break;case"split":t=/\s*,\s*/gi;break;case"svg-segment":t=/([mlhvzaqtcs])([^mlhvzaqtcs]*)/gi;break;case"mobile-china":t=/^\+[1-9]{1}[0-9]{10}$/g;break;case"phone-number":t=/^[+]?[(]?[0-9]{3}[)]?[-\s.]?[0-9]{3}[-\s.]?[0-9]{4,6}$/gi;break;case"email":t=/^[A-Za-z0-9_!#$%&'*+/=?`{|}~^.-]+@[A-Za-z0-9._-]+$/gm;break;case"ip":t=/^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/;break;case"whitespace":t=/[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u2028\u2029\u202f\u205f\u3000]/g;break;case"commaSpaces":t=/[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*,[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*/;break;case"trim":t=/^\s+|\s+$/g;break;case"base64-data":t=/^\s*data:(?:[a-z]+\/[a-z0-9-+.]+(?:;[a-z-]+=[a-z0-9-]+)?)?(?:;base64)?,([a-z0-9!$&',()*+;=\-._~:@/?%\s]*?)\s*$/i;break;case"var-name":t=/^[a-zA-Z_$][a-zA-Z0-9_$]*$/;break;case"element-url":t=/^url\(['"]?(.+?)['"]?\)$/i;break;case"hex-color":t=/^#([0-9A-F]{3}|[0-9A-F]{4}|[0-9A-F]{6}|[0-9A-F]{8})$/i;break;case"color":t=/^\s*((#[a-f\d]{6})|(#[a-f\d]{3})|rgba?\(\s*([\d\.]+%?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+%?)?)\s*\)|hsba?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+(?:%?\s*,\s*[\d\.]+)?)%?\s*\)|hsla?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+(?:%?\s*,\s*[\d\.]+)?)%?\s*\))\s*$/i;break;case"bezier":t=/^(?:cubic-)?bezier\(([^,]+),([^,]+),([^,]+),([^\)]+)\)/;break;case"chinese-name":t=/^(?:[\u4e00-\u9fa5·]{2,16})$/;break;case"chinese":t=new RegExp(String.raw`
|
|
2
2
|
[\u{FA0E}\u{FA0F}\u{FA11}\u{FA13}\u{FA14}\u{FA1F}\u{FA21}\u{FA23}\u{FA24}\u{FA27}-\u{FA29}]
|
|
3
3
|
|[\u{4E00}-\u{9FCC}]
|
|
4
4
|
|[\u{3400}-\u{4DB5}]
|
|
@@ -7,38 +7,34 @@
|
|
|
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};function ea(i){const t={matchIndex:-1,fullMatch:null,groupMatchs:[]};if(i){t.matchIndex=typeof i.index=="number"?i.index:-1;for(let e=0,n=i.length;e<n;e++)e==0?t.fullMatch=i[e]:t.groupMatchs.push(i[e])}return t}const dr=(i,t)=>{typeof i=="string"&&(i=ta(i)||new RegExp(i));const e=[],n=t.matchAll(i);for(const r of n)e.push(ea(r));return e};function pr(i){return i.replace(/(^\w|[_-]\w)/g,function(t){return t.slice(-1).toUpperCase()})}function mr(i){let t="";for(let e=0,n=i.length;e<n;e++){const r=i.charCodeAt(e);r>=1&&r<=127?t+=i.charAt(e):r>2047?(t+=String.fromCharCode(224|r>>12&15),t+=String.fromCharCode(128|r>>6&63),t+=String.fromCharCode(128|r>>0&63)):(t+=String.fromCharCode(192|r>>6&31),t+=String.fromCharCode(128|r>>0&63))}return t}var Ce=(i=>(i.UNKNOWN="",i.HTML="text/html",i.CSS="text/css",i.XML="text/xml",i.TEXT="text/plain",i.MD="text/plain",i.JPEG="image/jpeg",i.PNG="image/png",i.GIF="image/gif",i.WEBP="image/webp",i.SVG="image/svg+xml",i.ICO="image/x-icon",i.MPEG="audio/mpeg",i.MP3="audio/mpeg",i.OGG="audio/ogg",i.WAV="audio/wav",i.MP4="video/mp4",i.WEBM="video/webm",i.JSON="application/json",i.JAVASCRIPT="application/javascript",i.ECMASCRIPT="application/ecmascript",i.EXCEL="application/vnb.ms-excel",i.XWWW="application/x-www-form-urlencoded",i.DOC="application/msword",i.CSV="application/x-csv",i.PDF="application/pdf",i.ZIP="application/zip",i.TGZ="application/x-gtar",i.TAR_GZ="application/x-gzip",i.EOT="appliaction/vnd.ms-fontobject",i.TTF="aplication/font-sfnt",i))(Ce||{});const on=(i,t=16)=>(i=i.toLowerCase(),(i.indexOf("0b")==0||i.indexOf("0o")==0||i.indexOf("0x")==0)&&(i=i.slice(2)),parseInt(i,t));function na(){const i=Uint32Array.of(305419896),t=new Uint8Array(i.buffer);switch(t[0]*16777216+t[1]*65536+t[2]*256+t[3]){case 305419896:return!1;case 2018915346:return!0}}const gr=i=>{let t=Ce.UNKNOWN;switch(new DataView(i).getUint32(0,na()).toString(16).toUpperCase()){case"FFD8FFDB":t=Ce.JPEG;break;case"FFD8FFE0":case"FFD8FFE1":case"FFD8FFE2":case"FFD8FFE3":t=Ce.JPEG;break;case"89504E47":t=Ce.PNG;break;case"47494638":t=Ce.GIF;break;case"52494646":t=Ce.WEBP;break;case"25504446":t=Ce.PDF;break;case"504B0304":t=Ce.ZIP;break}return t},vr=function(){const i=[];return{writeByte(t){i.push(t&255)},writeShort(t){this.writeByte(t),this.writeByte(t>>>8)},writeBytes(t,e=0,n=t.length){for(let r=0;r<n;r++)this.writeByte(t[r+e])},writeString(t){for(let e=0,n=t.length;e<n;e++)this.writeByte(t.charCodeAt(e))},toByteArray(){return i},toString(){let t="[";for(let e=0,n=i.length;e<n;e++)e>0&&(t+=","),t+=i[e];return t+="]",t}}},ia=function(){let i=0,t=0,e=0,n="";const r=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)},s=function(o){n+=String.fromCharCode(r(o&63))};return{writeByte(o){for(i=i<<8|o&255,t+=8,e+=1;t>=6;)s(i>>>t-6),t-=6},flush(){if(t>0&&(s(i<<6-t),i=0,t=0),e%3!=0){const o=3-e%3;for(let a=0;a<o;a++)n+="="}},toString(){return n}}};function ra(i){const t=typeof i;return t!=="object"?t:Object.prototype.toString.call(i).replace(/^\[object (\S+)\]$/,"$1").toLowerCase()}function Ti(i){return ra(i)==="object"}function yr(i,t=new WeakMap){if(i==null)return i;if(i.constructor===Date)return new Date(i);if(i.constructor===RegExp)return new RegExp(i);if(typeof i!="object")return i;if(t.has(i))return t.get(i);const e=Object.getOwnPropertyDescriptors(i),n=Object.create(Object.getPrototypeOf(i),e);t.set(i,n);for(const r of Reflect.ownKeys(i))n[r]=Ti(i[r])?yr(i[r],t):i[r];return n}function Si(i,t,e=Number.EPSILON*Math.pow(2,2)){return Math.abs(i-t)<e}function wr(i,t=12){return+i.toPrecision(t)}var sa=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ei(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}var xr={exports:{}},hn=typeof Reflect=="object"?Reflect:null,br=hn&&typeof hn.apply=="function"?hn.apply:function(t,e,n){return Function.prototype.apply.call(t,e,n)},jn;hn&&typeof hn.ownKeys=="function"?jn=hn.ownKeys:Object.getOwnPropertySymbols?jn=function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:jn=function(t){return Object.getOwnPropertyNames(t)};function aa(i){console&&console.warn&&console.warn(i)}var _r=Number.isNaN||function(t){return t!==t};function Ot(){Ot.init.call(this)}xr.exports=Ot,xr.exports.once=la,Ot.EventEmitter=Ot,Ot.prototype._events=void 0,Ot.prototype._eventsCount=0,Ot.prototype._maxListeners=void 0;var Cr=10;function Xn(i){if(typeof i!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof i)}Object.defineProperty(Ot,"defaultMaxListeners",{enumerable:!0,get:function(){return Cr},set:function(i){if(typeof i!="number"||i<0||_r(i))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+i+".");Cr=i}}),Ot.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},Ot.prototype.setMaxListeners=function(t){if(typeof t!="number"||t<0||_r(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this};function Tr(i){return i._maxListeners===void 0?Ot.defaultMaxListeners:i._maxListeners}Ot.prototype.getMaxListeners=function(){return Tr(this)},Ot.prototype.emit=function(t){for(var e=[],n=1;n<arguments.length;n++)e.push(arguments[n]);var r=t==="error",s=this._events;if(s!==void 0)r=r&&s.error===void 0;else if(!r)return!1;if(r){var o;if(e.length>0&&(o=e[0]),o instanceof Error)throw o;var a=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw a.context=o,a}var h=s[t];if(h===void 0)return!1;if(typeof h=="function")br(h,this,e);else for(var m=h.length,g=Ar(h,m),n=0;n<m;++n)br(g[n],this,e);return!0};function Sr(i,t,e,n){var r,s,o;if(Xn(e),s=i._events,s===void 0?(s=i._events=Object.create(null),i._eventsCount=0):(s.newListener!==void 0&&(i.emit("newListener",t,e.listener?e.listener:e),s=i._events),o=s[t]),o===void 0)o=s[t]=e,++i._eventsCount;else if(typeof o=="function"?o=s[t]=n?[e,o]:[o,e]:n?o.unshift(e):o.push(e),r=Tr(i),r>0&&o.length>r&&!o.warned){o.warned=!0;var a=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");a.name="MaxListenersExceededWarning",a.emitter=i,a.type=t,a.count=o.length,aa(a)}return i}Ot.prototype.addListener=function(t,e){return Sr(this,t,e,!1)},Ot.prototype.on=Ot.prototype.addListener,Ot.prototype.prependListener=function(t,e){return Sr(this,t,e,!0)};function oa(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function Er(i,t,e){var n={fired:!1,wrapFn:void 0,target:i,type:t,listener:e},r=oa.bind(n);return r.listener=e,n.wrapFn=r,r}Ot.prototype.once=function(t,e){return Xn(e),this.on(t,Er(this,t,e)),this},Ot.prototype.prependOnceListener=function(t,e){return Xn(e),this.prependListener(t,Er(this,t,e)),this},Ot.prototype.removeListener=function(t,e){var n,r,s,o,a;if(Xn(e),r=this._events,r===void 0)return this;if(n=r[t],n===void 0)return this;if(n===e||n.listener===e)--this._eventsCount===0?this._events=Object.create(null):(delete r[t],r.removeListener&&this.emit("removeListener",t,n.listener||e));else if(typeof n!="function"){for(s=-1,o=n.length-1;o>=0;o--)if(n[o]===e||n[o].listener===e){a=n[o].listener,s=o;break}if(s<0)return this;s===0?n.shift():ha(n,s),n.length===1&&(r[t]=n[0]),r.removeListener!==void 0&&this.emit("removeListener",t,a||e)}return this},Ot.prototype.off=Ot.prototype.removeListener,Ot.prototype.removeAllListeners=function(t){var e,n,r;if(n=this._events,n===void 0)return this;if(n.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):n[t]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete n[t]),this;if(arguments.length===0){var s=Object.keys(n),o;for(r=0;r<s.length;++r)o=s[r],o!=="removeListener"&&this.removeAllListeners(o);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(e=n[t],typeof e=="function")this.removeListener(t,e);else if(e!==void 0)for(r=e.length-1;r>=0;r--)this.removeListener(t,e[r]);return this};function Pr(i,t,e){var n=i._events;if(n===void 0)return[];var r=n[t];return r===void 0?[]:typeof r=="function"?e?[r.listener||r]:[r]:e?ca(r):Ar(r,r.length)}Ot.prototype.listeners=function(t){return Pr(this,t,!0)},Ot.prototype.rawListeners=function(t){return Pr(this,t,!1)},Ot.listenerCount=function(i,t){return typeof i.listenerCount=="function"?i.listenerCount(t):kr.call(i,t)},Ot.prototype.listenerCount=kr;function kr(i){var t=this._events;if(t!==void 0){var e=t[i];if(typeof e=="function")return 1;if(e!==void 0)return e.length}return 0}Ot.prototype.eventNames=function(){return this._eventsCount>0?jn(this._events):[]};function Ar(i,t){for(var e=new Array(t),n=0;n<t;++n)e[n]=i[n];return e}function ha(i,t){for(;t+1<i.length;t++)i[t]=i[t+1];i.pop()}function ca(i){for(var t=new Array(i.length),e=0;e<t.length;++e)t[e]=i[e].listener||i[e];return t}function la(i,t){return new Promise(function(e,n){function r(o){i.removeListener(t,s),n(o)}function s(){typeof i.removeListener=="function"&&i.removeListener("error",r),e([].slice.call(arguments))}Mr(i,t,s,{once:!0}),t!=="error"&&ua(i,r,{once:!0})})}function ua(i,t,e){typeof i.on=="function"&&Mr(i,"error",t,e)}function Mr(i,t,e,n){if(typeof i.on=="function")n.once?i.once(t,e):i.on(t,e);else if(typeof i.addEventListener=="function")i.addEventListener(t,function r(s){n.once&&i.removeEventListener(t,r),e(s)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof i)}class fa{events;constructor(){this.events={}}on(t,e){return this.events[t]||(this.events[t]=[]),this.events[t].push(e),this}addListener(t,e){return this.on(t,e),this}prependListener(t,e){return this.events[t]||(this.events[t]=[]),this.events[t].unshift(e),this}removeListener(t,e){if(this.events[t])return this.events[t]=this.events[t].filter(n=>n!==e),this}off(t,e){return this.removeListener(t,e),this}removeAllListeners(t){return t?this.events[t]=[]:this.events={},this}emit(t,...e){return this.events[t]&&this.events[t].forEach(n=>{Reflect.apply(n,this,e)}),this}once(t,e){const r=(()=>{let s=!1;return(...o)=>{s||(s=!0,Reflect.apply(e,this,o),this.off(t,r))}})();return this.on(t,r),this}}var Ir=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function da(i,t={}){var e=1,n=1;function r(it){var st=it.match(/\n/g);st&&(e+=st.length);var E=it.lastIndexOf(`
|
|
11
|
-
`);n=~E?it.length-E:n+it.length}function s(){var it={line:e,column:n};return function(st){return st.position=new o(it),k(),st}}function o(it){this.start=it,this.end={line:e,column:n},this.source=t.source}o.prototype.content=i;var a=[];function h(it){var st=new Error(t.source+":"+e+":"+n+": "+it);if(st.reason=it,st.filename=t.source,st.line=e,st.column=n,st.source=i,t.silent)a.push(st);else throw st}function m(){var it=y();return{type:"stylesheet",stylesheet:{source:t.source,rules:it,parsingErrors:a}}}function g(){return w(/^{\s*/)}function x(){return w(/^}/)}function y(){var it,st=[];for(k(),P(st);i.length&&i.charAt(0)!="}"&&(it=Dt()||K());)it!==!1&&(st.push(it),P(st));return st}function w(it){var st=it.exec(i);if(st){var E=st[0];return r(E),i=i.slice(E.length),st}}function k(){w(/^\s*/)}function P(it){var st;for(it=it||[];st=D();)st!==!1&&it.push(st);return it}function D(){var it=s();if(!(i.charAt(0)!="/"||i.charAt(1)!="*")){for(var st=2;i.charAt(st)!=""&&(i.charAt(st)!="*"||i.charAt(st+1)!="/");)++st;if(st+=2,i.charAt(st-1)==="")return h("End of comment missing");var E=i.slice(2,st-2);return n+=2,r(E),i=i.slice(st),n+=2,it({type:"comment",comment:E})}}function N(){var it=w(/^([^{]+)/);if(it)return Te(it[0]).replace(/\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*\/+/g,"").replace(/"(?:\\"|[^"])*"|'(?:\\'|[^'])*'/g,function(st){return st.replace(/,/g,"")}).split(/\s*(?![^(]*\)),\s*/).map(function(st){return st.replace(/\u200C/g,",")})}function R(){var it=s(),st=w(/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(st){if(st=Te(st[0]),!w(/^:\s*/))return h("property missing ':'");var E=w(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/),C=it({type:"declaration",property:st.replace(Ir,""),value:E?Te(E[0]).replace(Ir,""):""});return w(/^[;\s]*/),C}}function O(){var it=[];if(!g())return h("missing '{'");P(it);for(var st;st=R();)st!==!1&&(it.push(st),P(it));return x()?it:h("missing '}'")}function X(){for(var it,st=[],E=s();it=w(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/);)st.push(it[1]),w(/^,\s*/);if(st.length)return E({type:"keyframe",values:st,declarations:O()})}function Y(){var it=s(),st=w(/^@([-\w]+)?keyframes\s*/);if(st){var E=st[1];if(st=w(/^([-\w]+)\s*/),!st)return h("@keyframes missing name");var C=st[1];if(!g())return h("@keyframes missing '{'");for(var b,A=P();b=X();)A.push(b),A=A.concat(P());return x()?it({type:"keyframes",name:C,vendor:E,keyframes:A}):h("@keyframes missing '}'")}}function nt(){var it=s(),st=w(/^@supports *([^{]+)/);if(st){var E=Te(st[1]);if(!g())return h("@supports missing '{'");var C=P().concat(y());return x()?it({type:"supports",supports:E,rules:C}):h("@supports missing '}'")}}function V(){var it=s(),st=w(/^@host\s*/);if(st){if(!g())return h("@host missing '{'");var E=P().concat(y());return x()?it({type:"host",rules:E}):h("@host missing '}'")}}function ot(){var it=s(),st=w(/^@media *([^{]+)/);if(st){var E=Te(st[1]);if(!g())return h("@media missing '{'");var C=P().concat(y());return x()?it({type:"media",media:E,rules:C}):h("@media missing '}'")}}function ct(){var it=s(),st=w(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(st)return it({type:"custom-media",name:Te(st[1]),media:Te(st[2])})}function vt(){var it=s(),st=w(/^@page */);if(st){var E=N()||[];if(!g())return h("@page missing '{'");for(var C=P(),b;b=R();)C.push(b),C=C.concat(P());return x()?it({type:"page",selectors:E,declarations:C}):h("@page missing '}'")}}function dt(){var it=s(),st=w(/^@([-\w]+)?document *([^{]+)/);if(st){var E=Te(st[1]),C=Te(st[2]);if(!g())return h("@document missing '{'");var b=P().concat(y());return x()?it({type:"document",document:C,vendor:E,rules:b}):h("@document missing '}'")}}function ht(){var it=s(),st=w(/^@font-face\s*/);if(st){if(!g())return h("@font-face missing '{'");for(var E=P(),C;C=R();)E.push(C),E=E.concat(P());return x()?it({type:"font-face",declarations:E}):h("@font-face missing '}'")}}var pt=kt("import"),ut=kt("charset"),Pt=kt("namespace");function kt(it){var st=new RegExp("^@"+it+"\\s*([^;]+);");return function(){var E=s(),C=w(st);if(C){var b={type:it};return b[it]=C[1].trim(),E(b)}}}function Dt(){if(i[0]=="@")return Y()||ot()||ct()||nt()||pt()||ut()||Pt()||dt()||vt()||V()||ht()}function K(){var it=s(),st=N();return st?(P(),it({type:"rule",selectors:st,declarations:O()})):h("selector missing")}return Pi(m())}function Te(i){return i?i.replace(/^\s+|\s+$/g,""):""}function Pi(i,t){var e=i&&typeof i.type=="string",n=e?i:t;for(var r in i){var s=i[r];Array.isArray(s)?s.forEach(function(o){Pi(o,n)}):s&&typeof s=="object"&&Pi(s,n)}return e&&Object.defineProperty(i,"parent",{configurable:!0,writable:!0,enumerable:!1,value:t||null}),i}const ki=(i,t="image/svg+xml",e="utf-8")=>new Blob([i],{type:`${t};charset=${e}`}),Lr=i=>new XMLSerializer().serializeToString(i),pa=(i,t="text/html")=>new DOMParser().parseFromString(i,t),Dr=(i,t="image/svg+xml",e="utf-8")=>ki(Lr(i),t,e),Ai=(i,t)=>{const e=document.createElement("a");e.style.visibility="hidden",document.body.appendChild(e),e.download=t,typeof i=="string"?e.href=i:e.href=window.URL.createObjectURL(i),e.click(),document.body.removeChild(e),window.URL.revokeObjectURL(e.href)};function Rr(i=["*"],t){return new Promise((e,n)=>{if(!globalThis.document||!(globalThis.document instanceof Document))return n(new Error("This is not a browser environment"));const r=globalThis.document.createElement("input");r.setAttribute("type","file"),r.setAttribute("visibility","hidden"),Array.isArray(i)&&i.length>0&&r.setAttribute("accept",i.join(",")),t&&r.setAttribute("multiple","true"),globalThis.addEventListener("focus",()=>{setTimeout(()=>{(!r.files||r.files?.length===0)&&n(new Error("Cancel select"))},1e3)},{once:!0});const s=()=>{if(r.removeEventListener("change",s),!r.files||r.files?.length===0)n(new Error("Cancel select"));else{const o=Array.from(r.files);!i.includes("*")&&o.some(a=>!i.includes(`.${Nr(a)}`))&&n(new Error(`Please select files in ${i} format`)),r.remove(),e(o)}};r.addEventListener("change",s),r.click()})}function Mi(i,t="text",e){return new Promise((n,r)=>{const s=new FileReader;switch(s.addEventListener("progress",o=>{e?.(o.loaded,o.total)}),s.addEventListener("load",o=>{n(o.target?.result)}),s.addEventListener("error",o=>{r(o)}),t){case"dataURL":s.readAsDataURL(i);break;case"binaryString":s.readAsBinaryString(i);break;case"arrayBuffer":s.readAsArrayBuffer(i);break;default:s.readAsText(i)}})}function Or(i,t,e){return Mi(i.slice(t,e),"arrayBuffer")}async function ma(i){const t=await Or(i,0,4);return gr(t)}const Nr=i=>{let t;return i instanceof File?t=i.name:t=i,t.match(/\.([0-9a-z]+)(?:[\\?#]|$)/i)?.[1]??""};function ga(i,t){i.addEventListener("change",function(){t(i.files)},!1)}function va(i,t){i.addEventListener("dragover",function(e){e.stopPropagation(),e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect="copy")},!1),i.addEventListener("drop",function(e){e.stopPropagation(),e.preventDefault(),e.dataTransfer&&t(e.dataTransfer.files)},!1)}function ya(i){typeof queueMicrotask=="function"?queueMicrotask(i):Promise.resolve().then(i).catch(t=>setTimeout(()=>{throw t}))}function wa(i,t={},e=[]){return{tag:i,props:t,children:e}}function kn(i,t){if(i.el)return;const e=i.el=document.createElement(i.tag);if(i.props)for(const n in i.props){const r=i.props[n];n.startsWith("on")?e.addEventListener(n.slice(2).toLowerCase(),r):e.setAttribute(n,r)}i.children&&(typeof i.children=="string"?e.textContent=i.children:i.children.forEach(n=>{kn(n,e)})),t.appendChild(e)}function Br(i,t){if(i.tag!==t.tag){if(!i.el)return;const e=i.el.parentElement||document.body;e.removeChild(i.el),kn(t,e)}else{const e=t.el=i.el;if(!e)return;const n=i.props,r=t.props;for(const a in n)a in r||(a.startsWith("on")?e.removeEventListener(a.slice(2).toLowerCase(),n[a]):e.removeAttribute(a));for(const a in r){const h=n[a],m=r[a];m!=h&&(a.startsWith("on")?e.addEventListener(a.slice(2).toLowerCase(),m):e.setAttribute(a,m))}const s=i.children||[],o=t.children||[];if(typeof o=="string")e.innerHTML=o;else if(typeof s=="string")e.innerHTML="",o.forEach(a=>{kn(a,e)});else{const a=Math.min(s.length,o.length);for(let h=0;h<a;h++)Br(s[h],o[h]);o.length>s.length&&o.slice(s.length).forEach(h=>{kn(h,e)}),o.length<s.length&&s.slice(o.length).forEach(h=>{h.el&&e.removeChild(h.el)})}}}function Fr(i,t,e){if(!i){e&&t&&e.appendChild(t);return}if(!i.isEqualNode(t)){if(i.nodeName!==t.nodeName){e.replaceChild(t,i);return}if(i.nodeType===Node.TEXT_NODE){i.textContent!==t.textContent&&(i.textContent=t.textContent);return}for(let n=i.attributes.length-1;n>=0;n--){const r=i.attributes[n].name;!t.hasAttribute(r)&&r!=="open"&&i.removeAttribute(r)}for(let n=0;n<t.attributes.length;n++){const r=t.attributes[n].name,s=t.attributes[n].value;i.setAttribute(r,s)}for(let n=0;n<t.childNodes.length;n++)i.childNodes[n]?Fr(i.childNodes[n],t.childNodes[n],i):i.appendChild(t.childNodes[n].cloneNode(!0));for(;i.childNodes.length>t.childNodes.length;)i.lastChild&&i.removeChild(i.lastChild)}}class xa{url;socket;waitingResponse={};sendMessageQueue=[];constructor(t){this.url=t,this.createSocket()}createSocket(){console.log("Socket Create Attempted"),this.socket=new WebSocket(this.url),this.socket.onopen=()=>{this.sendMessageQueue.forEach(t=>this.socket?.send(t)),this.sendMessageQueue=[]},this.socket.onclose=t=>{const{code:e,reason:n,wasClean:r}=t;console.log(`ws closed : ${e} ${n} ${r}`)},this.socket.onerror=t=>{console.log(`ws error : ${t.type}`)},this.socket.onmessage=t=>{this.processMessage(t)}}recreateSocket(t){console.log("Socket Recreate Attempted"),this.sendMessageQueue.push(t),this.createSocket()}closeSocket(){this.socket&&(this.socket.close(),console.log("Socket closed"))}openSocket(){this.createSocket(),console.log("Socket opened manually")}sendWithRetry(t){this.socket?.readyState===WebSocket.OPEN?this.socket.send(t):this.recreateSocket(t)}async processMessage(t){if(typeof t.data=="string")try{const e=JSON.parse(t.data);if(Object.prototype.hasOwnProperty.call(e,"requestid")){const n=this.waitingResponse[e.requestid];n?n.resolve?.(e):console.warn("Got data but found no associated request, already timed out?",e)}else console.warn("Got data without request id",e)}catch{console.log(`Received String : ${t.data}`)}else t.data instanceof ArrayBuffer?console.log(`Received ArrayBuffer : ${t.data}`):t.data instanceof Blob&&console.log(`Received Blob : ${t.data}`)}async sendPayload(t){const e=+new Date,n=this.waitingResponse[e]={requestid:e};try{let r;t instanceof Blob||t instanceof ArrayBuffer||typeof t=="string"?r=t:r=JSON.stringify({...n,...t});const s=await new Promise((o,a)=>{n.resolve=o,this.sendWithRetry(r),setTimeout(()=>{a("Timeout")},5e3)});return console.info("Time took",(+new Date-n.requestid)/1e3),s}catch(r){return Promise.reject(r)}finally{delete this.waitingResponse[e]}}async send(t,e,n=r=>{console.log(r)}){this.sendPayload(t).then(e,n)}}function ba(){const i=window.screen;return{screenWidth:i.width,screenHeight:i.height,screenX:window.screenX,screenY:window.screenY}}function _a(){const i=document.body;return{clientWidth:i.clientWidth,clientHeight:i.clientHeight,clientTop:i.clientTop,clientLeft:i.clientLeft,scrollWidth:i.scrollWidth,scrollHeight:i.scrollHeight,scrollTop:i.scrollTop,scrollLeft:i.scrollLeft,pageX:i.getBoundingClientRect().x,pageY:i.getBoundingClientRect().y}}function cn(){const i=document.documentElement;return{clientWidth:i.clientWidth,clientHeight:i.clientHeight,clientTop:i.clientTop,clientLeft:i.clientLeft,scrollWidth:i.scrollWidth,scrollHeight:i.scrollHeight,scrollTop:i.scrollTop,scrollLeft:i.scrollLeft,offsetWidth:i.offsetWidth,offsetHeight:i.offsetHeight,offsetTop:i.offsetTop,offsetLeft:i.offsetLeft,offsetParent:i.offsetParent,clientX:i.getBoundingClientRect().x,clientY:i.getBoundingClientRect().y}}function zr(){const{clientWidth:i,clientHeight:t}=cn();return{width:i||window.innerWidth,height:t||window.innerHeight}}function Ca(){const{scrollWidth:i,scrollHeight:t}=cn();return{width:i,height:t}}function Ur(i){const{top:t,left:e}=i.getBoundingClientRect(),{scrollLeft:n,scrollTop:r}=cn();return{x:e+n,y:t+r}}function Ta(i){return{x:Gr(i),y:Vr(i)}}function Gr(i){let t=0;for(;i!==null;)t+=i.offsetLeft,i=i.offsetParent;return t}function Vr(i){let t=0;for(;i!==null;)t+=i.offsetTop,i=i.offsetParent;return t}function Sa(i){const t=i.getBoundingClientRect();return{x:t.left,y:t.top}}function Ea(i,t){const e=i.getBoundingClientRect(),n=t.getBoundingClientRect();return{x:n.x-e.x,y:n.y-e.y,width:n.width||n.right-n.left,height:n.height||n.bottom-n.top}}function Pa(){const{clientHeight:i,scrollTop:t,scrollHeight:e}=cn(),n=e-i;return n<=0?0:t/n*100}function ka(i){return{x:i.clientX,y:i.clientY}}function jr(i){if("center"in i)return i.center;if(i.pageX&&i.pageY)return{x:i.pageX,y:i.pageY};const{scrollLeft:t,scrollTop:e}=cn();return{x:i.clientX+t,y:i.clientY+e}}function Hn(i,t){const e=jr(t),n=Ur(i);return{x:e.x-n.x,y:e.y-n.y}}function Ii(){return typeof window<"u"?window:typeof self<"u"?self:this||{}}const Wn=()=>{const i=navigator.userAgent.toLowerCase();let t="Unknown";return/mac/i.test(i)?t="macOS":/win/i.test(i)?t="Windows":/android/i.test(i)?t="Android":/iphone|ipad|ipod/i.test(i)?t="iOS":/linux/i.test(i)?t="Linux":/bsd/i.test(i)&&(t="BSD"),t.toLowerCase()},Aa=()=>{const i=navigator.userAgent;let t="Unknown";if(/Windows NT/.test(i)){const e=i.match(/Windows NT (\d+\.\d+)/);e&&(t=e[1])}else if(/Mac OS X/.test(i)){const e=i.match(/Mac OS X (\d+_\d+)/);e&&(t=e[1].replace("_","."))}else if(/Android/.test(i)){const e=i.match(/Android (\d+\.\d+)/);e&&(t=e[1])}else if(/iPhone|iPad|iPod/.test(i)){const e=i.match(/OS (\d+_\d+)/);e&&(t=e[1].replace("_","."))}return t.toLowerCase()},Li=()=>{const i=navigator.userAgent.toLowerCase();let t="Unknown";return/chrome/i.test(i)?t="Chrome":/firefox/i.test(i)?t="Firefox":/safari/i.test(i)?t="Safari":/edge/i.test(i)?t="Edge":/msie|trident/i.test(i)?t="IE":/MicroMessenger/i.test(i)?t="Wechat":/alipay/i.test(i)&&(t="Ali"),t.toLowerCase()},Ma=()=>{const i=navigator.userAgent;let t="Unknown";if(/Chrome/.test(i)){const e=i.match(/Chrome\/(\d+\.\d+)/);e&&(t=e[1])}else if(/Firefox/.test(i)){const e=i.match(/Firefox\/(\d+\.\d+)/);e&&(t=e[1])}else if(/Safari/.test(i)){const e=i.match(/Version\/(\d+\.\d+)/);e&&(t=e[1])}else if(/Edge/.test(i)){const e=i.match(/Edge\/(\d+\.\d+)/);e&&(t=e[1])}else if(/MSIE|Trident/.test(i)){const e=i.match(/(?:MSIE|rv:)(\d+\.\d+)/);e&&(t=e[1])}return t},Ia=()=>"geolocation"in navigator?new Promise((i,t)=>{navigator.geolocation.getCurrentPosition(e=>{const n=e.coords.latitude,r=e.coords.longitude;i({latitude:n,longitude:r})},e=>{t(e)})}):Promise.reject("Geolocation is not available.");function La(){return(navigator.browserLanguage||navigator.language).toLowerCase()}function Da(){return Intl.DateTimeFormat().resolvedOptions().timeZone.toLowerCase()}function Di(){return Wn()==="ios"}function Ri(){return Wn()==="macos"}function Ra(){return Di()|Ri()}function Xr(){return Wn()==="android"}function Oa(){return Di()||Xr()}function Na(){return typeof window=="object"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches}function Hr(){const i=window.navigator.userAgent,t=i.indexOf("MSIE ");if(t>0)return parseInt(i.substring(t+5,i.indexOf(".",t)),10);if(i.indexOf("Trident/")>0){const r=i.indexOf("rv:");return parseInt(i.substring(r+3,i.indexOf(".",r)),10)}const n=i.indexOf("Edge/");return n>0?parseInt(i.substring(n+5,i.indexOf(".",n)),10):-1}function Wr(){return Li()==="wechat"}function Yr(){return Li()==="ali"}function Ba(){return Wr()&&navigator.userAgent.match(/miniprogram/i)||window.__wxjs_environment==="miniprogram"}function Fa(){return Yr()&&navigator.userAgent.match(/miniprogram/i)}const za=Hr()!==-1,Ua=typeof document<"u",qr=typeof window<"u",Ga=typeof history<"u",Va=qr&&window.File&&window.FileReader&&window.FileList&&window.Blob,$r=(()=>{const i=Ii();return!!(i.Worker&&i.Blob&&i.Promise&&i.OffscreenCanvas&&i.OffscreenCanvasRenderingContext2D&&i.HTMLCanvasElement&&i.HTMLCanvasElement.prototype.transferControlToOffscreen&&i.URL&&i.URL.createObjectURL)})(),ja=typeof Path2D=="function"&&typeof DOMMatrix=="function",Xa=function(){if(!Ii().OffscreenCanvas)return!1;var t=new OffscreenCanvas(1,1),e=t.getContext("2d");e.fillRect(0,0,1,1);var n=t.transferToImageBitmap();try{e.createPattern(n,"no-repeat")}catch{return!1}return!0}();function Ha(i,t){let e=i[t];Object.defineProperty(i,"prop",{get:()=>e,set:n=>{e=n;debugger}})}function Wa(i){return new Proxy(i,{get(t,e,n){return Reflect.get(t,e,n)},set(t,e,n,r){debugger;return Reflect.set(t,e,n,r)}})}function Ya(i){const t=document.documentElement,e=window.top===window.self?window.devicePixelRatio:1;t.dataset.dpr=e;let n=100;const r=function(){const s=Math.min(t.clientWidth,i);t.dataset.width=s,t.dataset.rem=n=Math.round(100*(s/i)),t.style.fontSize=n+"px"};r(),window.rem2px=function(s){return s=parseFloat(s),s*n},window.px2rem=function(s){return s=parseFloat(s),s/n},window.addEventListener&&window.addEventListener("orientationchange"in window?"orientationchange":"resize",r,!1)}var Jr={exports:{}};/*! Hammer.JS - v2.0.7 - 2016-04-22
|
|
12
|
-
* http://hammerjs.github.io/
|
|
13
|
-
*
|
|
14
|
-
* Copyright (c) 2016 Jorik Tangelder;
|
|
15
|
-
* Licensed under the MIT license */(function(i){(function(t,e,n,r){var s=["","webkit","Moz","MS","ms","o"],o=e.createElement("div"),a="function",h=Math.round,m=Math.abs,g=Date.now;function x(c,u,p){return setTimeout(O(c,p),u)}function y(c,u,p){return Array.isArray(c)?(w(c,p[u],p),!0):!1}function w(c,u,p){var v;if(c)if(c.forEach)c.forEach(u,p);else if(c.length!==r)for(v=0;v<c.length;)u.call(p,c[v],v,c),v++;else for(v in c)c.hasOwnProperty(v)&&u.call(p,c[v],v,c)}function k(c,u,p){var v="DEPRECATED METHOD: "+u+`
|
|
16
|
-
`+p+` AT
|
|
17
|
-
`;return function(){var _=new Error("get-stack-trace"),S=_&&_.stack?_.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",I=t.console&&(t.console.warn||t.console.log);return I&&I.call(t.console,v,S),c.apply(this,arguments)}}var P;typeof Object.assign!="function"?P=function(u){if(u===r||u===null)throw new TypeError("Cannot convert undefined or null to object");for(var p=Object(u),v=1;v<arguments.length;v++){var _=arguments[v];if(_!==r&&_!==null)for(var S in _)_.hasOwnProperty(S)&&(p[S]=_[S])}return p}:P=Object.assign;var D=k(function(u,p,v){for(var _=Object.keys(p),S=0;S<_.length;)(!v||v&&u[_[S]]===r)&&(u[_[S]]=p[_[S]]),S++;return u},"extend","Use `assign`."),N=k(function(u,p){return D(u,p,!0)},"merge","Use `assign`.");function R(c,u,p){var v=u.prototype,_;_=c.prototype=Object.create(v),_.constructor=c,_._super=v,p&&P(_,p)}function O(c,u){return function(){return c.apply(u,arguments)}}function X(c,u){return typeof c==a?c.apply(u&&u[0]||r,u):c}function Y(c,u){return c===r?u:c}function nt(c,u,p){w(vt(u),function(v){c.addEventListener(v,p,!1)})}function V(c,u,p){w(vt(u),function(v){c.removeEventListener(v,p,!1)})}function ot(c,u){for(;c;){if(c==u)return!0;c=c.parentNode}return!1}function ct(c,u){return c.indexOf(u)>-1}function vt(c){return c.trim().split(/\s+/g)}function dt(c,u,p){if(c.indexOf&&!p)return c.indexOf(u);for(var v=0;v<c.length;){if(p&&c[v][p]==u||!p&&c[v]===u)return v;v++}return-1}function ht(c){return Array.prototype.slice.call(c,0)}function pt(c,u,p){for(var v=[],_=[],S=0;S<c.length;){var I=u?c[S][u]:c[S];dt(_,I)<0&&v.push(c[S]),_[S]=I,S++}return p&&(u?v=v.sort(function(W,j){return W[u]>j[u]}):v=v.sort()),v}function ut(c,u){for(var p,v,_=u[0].toUpperCase()+u.slice(1),S=0;S<s.length;){if(p=s[S],v=p?p+_:u,v in c)return v;S++}return r}var Pt=1;function kt(){return Pt++}function Dt(c){var u=c.ownerDocument||c;return u.defaultView||u.parentWindow||t}var K=/mobile|tablet|ip(ad|hone|od)|android/i,it="ontouchstart"in t,st=ut(t,"PointerEvent")!==r,E=it&&K.test(navigator.userAgent),C="touch",b="pen",A="mouse",L="kinect",F=25,B=1,q=2,z=4,J=8,at=1,ft=2,yt=4,Tt=8,wt=16,Et=ft|yt,At=Tt|wt,Mt=Et|At,mt=["x","y"],Nt=["clientX","clientY"];function It(c,u){var p=this;this.manager=c,this.callback=u,this.element=c.element,this.target=c.options.inputTarget,this.domHandler=function(v){X(c.options.enable,[c])&&p.handler(v)},this.init()}It.prototype={handler:function(){},init:function(){this.evEl&&nt(this.element,this.evEl,this.domHandler),this.evTarget&&nt(this.target,this.evTarget,this.domHandler),this.evWin&&nt(Dt(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&V(this.element,this.evEl,this.domHandler),this.evTarget&&V(this.target,this.evTarget,this.domHandler),this.evWin&&V(Dt(this.element),this.evWin,this.domHandler)}};function Ut(c){var u,p=c.options.inputClass;return p?u=p:st?u=he:E?u=Ie:it?u=yn:u=pe,new u(c,Rt)}function Rt(c,u,p){var v=p.pointers.length,_=p.changedPointers.length,S=u&B&&v-_===0,I=u&(z|J)&&v-_===0;p.isFirst=!!S,p.isFinal=!!I,S&&(c.session={}),p.eventType=u,Zt(c,p),c.emit("hammer.input",p),c.recognize(p),c.session.prevInput=p}function Zt(c,u){var p=c.session,v=u.pointers,_=v.length;p.firstInput||(p.firstInput=je(u)),_>1&&!p.firstMultiple?p.firstMultiple=je(u):_===1&&(p.firstMultiple=!1);var S=p.firstInput,I=p.firstMultiple,U=I?I.center:S.center,W=u.center=de(v);u.timeStamp=g(),u.deltaTime=u.timeStamp-S.timeStamp,u.angle=ye(U,W),u.distance=ve(U,W),Wt(p,u),u.offsetDirection=Pe(u.deltaX,u.deltaY);var j=Ee(u.deltaTime,u.deltaX,u.deltaY);u.overallVelocityX=j.x,u.overallVelocityY=j.y,u.overallVelocity=m(j.x)>m(j.y)?j.x:j.y,u.scale=I?Xt(I.pointers,v):1,u.rotation=I?mn(I.pointers,v):0,u.maxPointers=p.prevInput?u.pointers.length>p.prevInput.maxPointers?u.pointers.length:p.prevInput.maxPointers:u.pointers.length,ge(p,u);var G=c.element;ot(u.srcEvent.target,G)&&(G=u.srcEvent.target),u.target=G}function Wt(c,u){var p=u.center,v=c.offsetDelta||{},_=c.prevDelta||{},S=c.prevInput||{};(u.eventType===B||S.eventType===z)&&(_=c.prevDelta={x:S.deltaX||0,y:S.deltaY||0},v=c.offsetDelta={x:p.x,y:p.y}),u.deltaX=_.x+(p.x-v.x),u.deltaY=_.y+(p.y-v.y)}function ge(c,u){var p=c.lastInterval||u,v=u.timeStamp-p.timeStamp,_,S,I,U;if(u.eventType!=J&&(v>F||p.velocity===r)){var W=u.deltaX-p.deltaX,j=u.deltaY-p.deltaY,G=Ee(v,W,j);S=G.x,I=G.y,_=m(G.x)>m(G.y)?G.x:G.y,U=Pe(W,j),c.lastInterval=u}else _=p.velocity,S=p.velocityX,I=p.velocityY,U=p.direction;u.velocity=_,u.velocityX=S,u.velocityY=I,u.direction=U}function je(c){for(var u=[],p=0;p<c.pointers.length;)u[p]={clientX:h(c.pointers[p].clientX),clientY:h(c.pointers[p].clientY)},p++;return{timeStamp:g(),pointers:u,center:de(u),deltaX:c.deltaX,deltaY:c.deltaY}}function de(c){var u=c.length;if(u===1)return{x:h(c[0].clientX),y:h(c[0].clientY)};for(var p=0,v=0,_=0;_<u;)p+=c[_].clientX,v+=c[_].clientY,_++;return{x:h(p/u),y:h(v/u)}}function Ee(c,u,p){return{x:u/c||0,y:p/c||0}}function Pe(c,u){return c===u?at:m(c)>=m(u)?c<0?ft:yt:u<0?Tt:wt}function ve(c,u,p){p||(p=mt);var v=u[p[0]]-c[p[0]],_=u[p[1]]-c[p[1]];return Math.sqrt(v*v+_*_)}function ye(c,u,p){p||(p=mt);var v=u[p[0]]-c[p[0]],_=u[p[1]]-c[p[1]];return Math.atan2(_,v)*180/Math.PI}function mn(c,u){return ye(u[1],u[0],Nt)+ye(c[1],c[0],Nt)}function Xt(c,u){return ve(u[0],u[1],Nt)/ve(c[0],c[1],Nt)}var we={mousedown:B,mousemove:q,mouseup:z},Xe="mousedown",Qt="mousemove mouseup";function pe(){this.evEl=Xe,this.evWin=Qt,this.pressed=!1,It.apply(this,arguments)}R(pe,It,{handler:function(u){var p=we[u.type];p&B&&u.button===0&&(this.pressed=!0),p&q&&u.which!==1&&(p=z),this.pressed&&(p&z&&(this.pressed=!1),this.callback(this.manager,p,{pointers:[u],changedPointers:[u],pointerType:A,srcEvent:u}))}});var re={pointerdown:B,pointermove:q,pointerup:z,pointercancel:J,pointerout:J},tn={2:C,3:b,4:A,5:L},ke="pointerdown",He="pointermove pointerup pointercancel";t.MSPointerEvent&&!t.PointerEvent&&(ke="MSPointerDown",He="MSPointerMove MSPointerUp MSPointerCancel");function he(){this.evEl=ke,this.evWin=He,It.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}R(he,It,{handler:function(u){var p=this.store,v=!1,_=u.type.toLowerCase().replace("ms",""),S=re[_],I=tn[u.pointerType]||u.pointerType,U=I==C,W=dt(p,u.pointerId,"pointerId");S&B&&(u.button===0||U)?W<0&&(p.push(u),W=p.length-1):S&(z|J)&&(v=!0),!(W<0)&&(p[W]=u,this.callback(this.manager,S,{pointers:p,changedPointers:[u],pointerType:I,srcEvent:u}),v&&p.splice(W,1))}});var qt={touchstart:B,touchmove:q,touchend:z,touchcancel:J},fi="touchstart",We="touchstart touchmove touchend touchcancel";function Ae(){this.evTarget=fi,this.evWin=We,this.started=!1,It.apply(this,arguments)}R(Ae,It,{handler:function(u){var p=qt[u.type];if(p===B&&(this.started=!0),!!this.started){var v=xe.call(this,u,p);p&(z|J)&&v[0].length-v[1].length===0&&(this.started=!1),this.callback(this.manager,p,{pointers:v[0],changedPointers:v[1],pointerType:C,srcEvent:u})}}});function xe(c,u){var p=ht(c.touches),v=ht(c.changedTouches);return u&(z|J)&&(p=pt(p.concat(v),"identifier",!0)),[p,v]}var gn={touchstart:B,touchmove:q,touchend:z,touchcancel:J},Me="touchstart touchmove touchend touchcancel";function Ie(){this.evTarget=Me,this.targetIds={},It.apply(this,arguments)}R(Ie,It,{handler:function(u){var p=gn[u.type],v=en.call(this,u,p);v&&this.callback(this.manager,p,{pointers:v[0],changedPointers:v[1],pointerType:C,srcEvent:u})}});function en(c,u){var p=ht(c.touches),v=this.targetIds;if(u&(B|q)&&p.length===1)return v[p[0].identifier]=!0,[p,p];var _,S,I=ht(c.changedTouches),U=[],W=this.target;if(S=p.filter(function(j){return ot(j.target,W)}),u===B)for(_=0;_<S.length;)v[S[_].identifier]=!0,_++;for(_=0;_<I.length;)v[I[_].identifier]&&U.push(I[_]),u&(z|J)&&delete v[I[_].identifier],_++;if(U.length)return[pt(S.concat(U),"identifier",!0),U]}var vn=2500,di=25;function yn(){It.apply(this,arguments);var c=O(this.handler,this);this.touch=new Ie(this.manager,c),this.mouse=new pe(this.manager,c),this.primaryTouch=null,this.lastTouches=[]}R(yn,It,{handler:function(u,p,v){var _=v.pointerType==C,S=v.pointerType==A;if(!(S&&v.sourceCapabilities&&v.sourceCapabilities.firesTouchEvents)){if(_)pi.call(this,p,v);else if(S&&Le.call(this,v))return;this.callback(u,p,v)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});function pi(c,u){c&B?(this.primaryTouch=u.changedPointers[0].identifier,mi.call(this,u)):c&(z|J)&&mi.call(this,u)}function mi(c){var u=c.changedPointers[0];if(u.identifier===this.primaryTouch){var p={x:u.clientX,y:u.clientY};this.lastTouches.push(p);var v=this.lastTouches,_=function(){var S=v.indexOf(p);S>-1&&v.splice(S,1)};setTimeout(_,vn)}}function Le(c){for(var u=c.srcEvent.clientX,p=c.srcEvent.clientY,v=0;v<this.lastTouches.length;v++){var _=this.lastTouches[v],S=Math.abs(u-_.x),I=Math.abs(p-_.y);if(S<=di&&I<=di)return!0}return!1}var gi=ut(o.style,"touchAction"),vi=gi!==r,yi="compute",wi="auto",wn="manipulation",De="none",te="pan-x",Re="pan-y",Ye=qe();function Lt(c,u){this.manager=c,this.set(u)}Lt.prototype={set:function(c){c==yi&&(c=this.compute()),vi&&this.manager.element.style&&Ye[c]&&(this.manager.element.style[gi]=c),this.actions=c.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var c=[];return w(this.manager.recognizers,function(u){X(u.options.enable,[u])&&(c=c.concat(u.getTouchAction()))}),xi(c.join(" "))},preventDefaults:function(c){var u=c.srcEvent,p=c.offsetDirection;if(this.manager.session.prevented){u.preventDefault();return}var v=this.actions,_=ct(v,De)&&!Ye[De],S=ct(v,Re)&&!Ye[Re],I=ct(v,te)&&!Ye[te];if(_){var U=c.pointers.length===1,W=c.distance<2,j=c.deltaTime<250;if(U&&W&&j)return}if(!(I&&S)&&(_||S&&p&Et||I&&p&At))return this.preventSrc(u)},preventSrc:function(c){this.manager.session.prevented=!0,c.preventDefault()}};function xi(c){if(ct(c,De))return De;var u=ct(c,te),p=ct(c,Re);return u&&p?De:u||p?u?te:Re:ct(c,wn)?wn:wi}function qe(){if(!vi)return!1;var c={},u=t.CSS&&t.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(p){c[p]=u?t.CSS.supports("touch-action",p):!0}),c}var nn=1,$t=2,be=4,me=8,ce=me,Oe=16,Ft=32;function xt(c){this.options=P({},this.defaults,c||{}),this.id=kt(),this.manager=null,this.options.enable=Y(this.options.enable,!0),this.state=nn,this.simultaneous={},this.requireFail=[]}xt.prototype={defaults:{},set:function(c){return P(this.options,c),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(c){if(y(c,"recognizeWith",this))return this;var u=this.simultaneous;return c=$e(c,this),u[c.id]||(u[c.id]=c,c.recognizeWith(this)),this},dropRecognizeWith:function(c){return y(c,"dropRecognizeWith",this)?this:(c=$e(c,this),delete this.simultaneous[c.id],this)},requireFailure:function(c){if(y(c,"requireFailure",this))return this;var u=this.requireFail;return c=$e(c,this),dt(u,c)===-1&&(u.push(c),c.requireFailure(this)),this},dropRequireFailure:function(c){if(y(c,"dropRequireFailure",this))return this;c=$e(c,this);var u=dt(this.requireFail,c);return u>-1&&this.requireFail.splice(u,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(c){return!!this.simultaneous[c.id]},emit:function(c){var u=this,p=this.state;function v(_){u.manager.emit(_,c)}p<me&&v(u.options.event+Gn(p)),v(u.options.event),c.additionalEvent&&v(c.additionalEvent),p>=me&&v(u.options.event+Gn(p))},tryEmit:function(c){if(this.canEmit())return this.emit(c);this.state=Ft},canEmit:function(){for(var c=0;c<this.requireFail.length;){if(!(this.requireFail[c].state&(Ft|nn)))return!1;c++}return!0},recognize:function(c){var u=P({},c);if(!X(this.options.enable,[this,u])){this.reset(),this.state=Ft;return}this.state&(ce|Oe|Ft)&&(this.state=nn),this.state=this.process(u),this.state&($t|be|me|Oe)&&this.tryEmit(u)},process:function(c){},getTouchAction:function(){},reset:function(){}};function Gn(c){return c&Oe?"cancel":c&me?"end":c&be?"move":c&$t?"start":""}function xn(c){return c==wt?"down":c==Tt?"up":c==ft?"left":c==yt?"right":""}function $e(c,u){var p=u.manager;return p?p.get(c):c}function se(){xt.apply(this,arguments)}R(se,xt,{defaults:{pointers:1},attrTest:function(c){var u=this.options.pointers;return u===0||c.pointers.length===u},process:function(c){var u=this.state,p=c.eventType,v=u&($t|be),_=this.attrTest(c);return v&&(p&J||!_)?u|Oe:v||_?p&z?u|me:u&$t?u|be:$t:Ft}});function ee(){se.apply(this,arguments),this.pX=null,this.pY=null}R(ee,se,{defaults:{event:"pan",threshold:10,pointers:1,direction:Mt},getTouchAction:function(){var c=this.options.direction,u=[];return c&Et&&u.push(Re),c&At&&u.push(te),u},directionTest:function(c){var u=this.options,p=!0,v=c.distance,_=c.direction,S=c.deltaX,I=c.deltaY;return _&u.direction||(u.direction&Et?(_=S===0?at:S<0?ft:yt,p=S!=this.pX,v=Math.abs(c.deltaX)):(_=I===0?at:I<0?Tt:wt,p=I!=this.pY,v=Math.abs(c.deltaY))),c.direction=_,p&&v>u.threshold&&_&u.direction},attrTest:function(c){return se.prototype.attrTest.call(this,c)&&(this.state&$t||!(this.state&$t)&&this.directionTest(c))},emit:function(c){this.pX=c.deltaX,this.pY=c.deltaY;var u=xn(c.direction);u&&(c.additionalEvent=this.options.event+u),this._super.emit.call(this,c)}});function Ne(){se.apply(this,arguments)}R(Ne,se,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[De]},attrTest:function(c){return this._super.attrTest.call(this,c)&&(Math.abs(c.scale-1)>this.options.threshold||this.state&$t)},emit:function(c){if(c.scale!==1){var u=c.scale<1?"in":"out";c.additionalEvent=this.options.event+u}this._super.emit.call(this,c)}});function bn(){xt.apply(this,arguments),this._timer=null,this._input=null}R(bn,xt,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[wi]},process:function(c){var u=this.options,p=c.pointers.length===u.pointers,v=c.distance<u.threshold,_=c.deltaTime>u.time;if(this._input=c,!v||!p||c.eventType&(z|J)&&!_)this.reset();else if(c.eventType&B)this.reset(),this._timer=x(function(){this.state=ce,this.tryEmit()},u.time,this);else if(c.eventType&z)return ce;return Ft},reset:function(){clearTimeout(this._timer)},emit:function(c){this.state===ce&&(c&&c.eventType&z?this.manager.emit(this.options.event+"up",c):(this._input.timeStamp=g(),this.manager.emit(this.options.event,this._input)))}});function _n(){se.apply(this,arguments)}R(_n,se,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[De]},attrTest:function(c){return this._super.attrTest.call(this,c)&&(Math.abs(c.rotation)>this.options.threshold||this.state&$t)}});function Cn(){se.apply(this,arguments)}R(Cn,se,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:Et|At,pointers:1},getTouchAction:function(){return ee.prototype.getTouchAction.call(this)},attrTest:function(c){var u=this.options.direction,p;return u&(Et|At)?p=c.overallVelocity:u&Et?p=c.overallVelocityX:u&At&&(p=c.overallVelocityY),this._super.attrTest.call(this,c)&&u&c.offsetDirection&&c.distance>this.options.threshold&&c.maxPointers==this.options.pointers&&m(p)>this.options.velocity&&c.eventType&z},emit:function(c){var u=xn(c.offsetDirection);u&&this.manager.emit(this.options.event+u,c),this.manager.emit(this.options.event,c)}});function le(){xt.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}R(le,xt,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[wn]},process:function(c){var u=this.options,p=c.pointers.length===u.pointers,v=c.distance<u.threshold,_=c.deltaTime<u.time;if(this.reset(),c.eventType&B&&this.count===0)return this.failTimeout();if(v&&_&&p){if(c.eventType!=z)return this.failTimeout();var S=this.pTime?c.timeStamp-this.pTime<u.interval:!0,I=!this.pCenter||ve(this.pCenter,c.center)<u.posThreshold;this.pTime=c.timeStamp,this.pCenter=c.center,!I||!S?this.count=1:this.count+=1,this._input=c;var U=this.count%u.taps;if(U===0)return this.hasRequireFailures()?(this._timer=x(function(){this.state=ce,this.tryEmit()},u.interval,this),$t):ce}return Ft},failTimeout:function(){return this._timer=x(function(){this.state=Ft},this.options.interval,this),Ft},reset:function(){clearTimeout(this._timer)},emit:function(){this.state==ce&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}});function ue(c,u){return u=u||{},u.recognizers=Y(u.recognizers,ue.defaults.preset),new sn(c,u)}ue.VERSION="2.0.7",ue.defaults={domEvents:!1,touchAction:yi,enable:!0,inputTarget:null,inputClass:null,preset:[[_n,{enable:!1}],[Ne,{enable:!1},["rotate"]],[Cn,{direction:Et}],[ee,{direction:Et},["swipe"]],[le],[le,{event:"doubletap",taps:2},["tap"]],[bn]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};var rn=1,Vt=2;function sn(c,u){this.options=P({},ue.defaults,u||{}),this.options.inputTarget=this.options.inputTarget||c,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=c,this.input=Ut(this),this.touchAction=new Lt(this,this.options.touchAction),l(this,!0),w(this.options.recognizers,function(p){var v=this.add(new p[0](p[1]));p[2]&&v.recognizeWith(p[2]),p[3]&&v.requireFailure(p[3])},this)}sn.prototype={set:function(c){return P(this.options,c),c.touchAction&&this.touchAction.update(),c.inputTarget&&(this.input.destroy(),this.input.target=c.inputTarget,this.input.init()),this},stop:function(c){this.session.stopped=c?Vt:rn},recognize:function(c){var u=this.session;if(!u.stopped){this.touchAction.preventDefaults(c);var p,v=this.recognizers,_=u.curRecognizer;(!_||_&&_.state&ce)&&(_=u.curRecognizer=null);for(var S=0;S<v.length;)p=v[S],u.stopped!==Vt&&(!_||p==_||p.canRecognizeWith(_))?p.recognize(c):p.reset(),!_&&p.state&($t|be|me)&&(_=u.curRecognizer=p),S++}},get:function(c){if(c instanceof xt)return c;for(var u=this.recognizers,p=0;p<u.length;p++)if(u[p].options.event==c)return u[p];return null},add:function(c){if(y(c,"add",this))return this;var u=this.get(c.options.event);return u&&this.remove(u),this.recognizers.push(c),c.manager=this,this.touchAction.update(),c},remove:function(c){if(y(c,"remove",this))return this;if(c=this.get(c),c){var u=this.recognizers,p=dt(u,c);p!==-1&&(u.splice(p,1),this.touchAction.update())}return this},on:function(c,u){if(c!==r&&u!==r){var p=this.handlers;return w(vt(c),function(v){p[v]=p[v]||[],p[v].push(u)}),this}},off:function(c,u){if(c!==r){var p=this.handlers;return w(vt(c),function(v){u?p[v]&&p[v].splice(dt(p[v],u),1):delete p[v]}),this}},emit:function(c,u){this.options.domEvents&&f(c,u);var p=this.handlers[c]&&this.handlers[c].slice();if(!(!p||!p.length)){u.type=c,u.preventDefault=function(){u.srcEvent.preventDefault()};for(var v=0;v<p.length;)p[v](u),v++}},destroy:function(){this.element&&l(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}};function l(c,u){var p=c.element;if(p.style){var v;w(c.options.cssProps,function(_,S){v=ut(p.style,S),u?(c.oldCssProps[v]=p.style[v],p.style[v]=_):p.style[v]=c.oldCssProps[v]||""}),u||(c.oldCssProps={})}}function f(c,u){var p=e.createEvent("Event");p.initEvent(c,!0,!0),p.gesture=u,u.target.dispatchEvent(p)}P(ue,{INPUT_START:B,INPUT_MOVE:q,INPUT_END:z,INPUT_CANCEL:J,STATE_POSSIBLE:nn,STATE_BEGAN:$t,STATE_CHANGED:be,STATE_ENDED:me,STATE_RECOGNIZED:ce,STATE_CANCELLED:Oe,STATE_FAILED:Ft,DIRECTION_NONE:at,DIRECTION_LEFT:ft,DIRECTION_RIGHT:yt,DIRECTION_UP:Tt,DIRECTION_DOWN:wt,DIRECTION_HORIZONTAL:Et,DIRECTION_VERTICAL:At,DIRECTION_ALL:Mt,Manager:sn,Input:It,TouchAction:Lt,TouchInput:Ie,MouseInput:pe,PointerEventInput:he,TouchMouseInput:yn,SingleTouchInput:Ae,Recognizer:xt,AttrRecognizer:se,Tap:le,Pan:ee,Swipe:Cn,Pinch:Ne,Rotate:_n,Press:bn,on:nt,off:V,each:w,merge:N,extend:D,assign:P,inherit:R,bindFn:O,prefixed:ut});var d=typeof t<"u"?t:typeof self<"u"?self:{};d.Hammer=ue,typeof r=="function"&&r.amd?r(function(){return ue}):i.exports?i.exports=ue:t[n]=ue})(window,document,"Hammer")})(Jr);var qa=Jr.exports;const $a=Ei(qa);function Yn(i){return i*Math.PI/180}function Oi(i){return i*180/Math.PI}function Zr(i,t,e,n){const r=i-e,s=t-n;return Math.sqrt(r*r+s*s)}function Ni(i,t,e,n){const r=e-i,s=n-t;return Math.atan2(s,r)}function Bi(i,t){return{x:Math.cos(i)*t,y:Math.sin(i)*t}}function Fi(i,t){const e=Math.sqrt(Math.pow(i,2)+Math.pow(t,2));return{x:i/=e,y:t/=e}}function Ja(i,t,e,n,r=10){if(Math.abs(e-i)<r&&Math.abs(n-t)<r)return"no";const s=Oi(Ni(i,t,e,n));return s>=-135&&s<=-45?"up":s>45&&s<135?"down":s>=135&&s<=180||s>=-180&&s<-135?"left":s>=-45&&s<=45?"right":"no"}class qn{x;y;vx;vy;ax;ay;mass;constructor(t){this.x=t.x,this.y=t.y,this.vx=t?.vx||0,this.vy=t?.vy||0,this.ax=t?.ax||0,this.ay=t?.ay||0,this.mass=t?.mass||0}distanceTo(t){return Zr(this.x,this.y,t.x,t.y)}angleTo(t){return Ni(this.x,this.y,t.x,t.y)}velocityTo(t){return{vx:t.x-this.x,vy:t.y-this.y}}followTo(t,e=3){const n=this.angleTo(t),{x:r,y:s}=Bi(n,e);this.vx=r,this.vy=s,this.nextFrame()}followAccelerationTo(t,e=.05){const n=this.angleTo(t),{x:r,y:s}=Bi(n,e);this.ax=r,this.ay=s,this.nextFrame()}nextFrame(t){const e=t?.gravity??0,n=t?.friction??0;if(this.vx+=this.ax,this.vy+=this.ay,this.vy+=e,n>0){const r=Math.atan2(this.vy,this.vx);let s=Math.sqrt(this.vx*this.vx+this.vy*this.vy);s>n?s-=n:s=0,this.vx=Math.cos(r)*s,this.vy=Math.sin(r)*s}this.x+=this.vx,this.y+=this.vy}nextFrameEaseTo(t,e){const n=e?.gravity??0,r=e?.friction??1,s=e?.easing??.05,o=t.x-this.x,a=t.y-this.y;this.vx=o*s,this.vy=a*s,this.vy+=n,this.vx*=r,this.vy*=r,this.x+=this.vx,this.y+=this.vy}nextFrameSpringTo(t,e){const n=e?.gravity??0,r=e?.friction??.95,s=e?.spring??.03;(Array.isArray(t)?t:[t]).forEach(a=>{const h=a.x-this.x,m=a.y-this.y,g=h*s,x=m*s;this.vx+=g,this.vy+=x}),this.vy+=n,this.vx*=r,this.vy*=r,this.x+=this.vx,this.y+=this.vy}nextFrameSpringConnect(t,e){const n=e?.gravity??0,r=e?.friction??.95,s=e?.spring??.03,o=e?.springLength??100,a=this.angleTo(t);this.nextFrameSpringTo(new qn({x:t.x-Math.cos(a)*o,y:t.y-Math.sin(a)*o}),{spring:s,friction:r,gravity:n})}}class ln extends qn{width;height;constructor(t){super(t),this.width=t.width,this.height=t.height}eq(t){return this.x===t.x&&this.y===t.y&&this.width===t.width&&this.height===t.height}isIntersectRect(t){return!(this.x+this.width<t.x||t.x+t.width<this.x||this.y+this.height<t.y||t.y+t.height<this.y)}isContainPoint(t){return!(t.x<this.x||t.x>this.x+this.width||t.y<this.y||t.y>this.y+this.height)}toArray(){return[this.x,this.y,this.width,this.height]}clone(t){this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height}}class fe extends qn{radius;constructor(t){super(t),this.radius=t?.radius??0}toSVGPathData(){return[this.x,this.y]}toSVGPathD(){return`${this.x},${this.y}`}setX(t){this.x=t}setY(t){this.y=t}setXY(t,e){this.x=t,this.y=e}eq(t){return this.x===t.x&&this.y===t.y}midPointBtw(t){return new fe({x:this.x+(t.x-this.x)/2,y:this.y+(t.y-this.y)/2})}toArray(){return[this.x,this.y]}clone(t){this.setXY(t.x,t.y)}getBoundRect(){return new ln({x:this.x-this.radius,y:this.y-this.radius,width:this.radius*2,height:this.radius*2})}nextFrameCollisionTo(t){const e=t.x-this.x,n=t.y-this.y;if(Math.sqrt(e*e+n*n)<this.radius+t.radius){const o=Math.atan2(n,e),a=Math.sin(o),h=Math.cos(o),m={x:0,y:0},g=s(e,n,a,h,!0),x=s(this.vx,this.vy,a,h,!0),y=s(t.vx,t.vy,a,h,!0),w=x.x-y.x;x.x=((this.mass-t.mass)*x.x+2*t.mass*y.x)/(this.mass+t.mass),y.x=w+x.x;const k=Math.abs(x.x)+Math.abs(y.x),P=this.radius+t.radius-Math.abs(m.x-g.x);m.x+=x.x/k*P,g.x+=y.x/k*P;const D=s(m.x,m.y,a,h,!1),N=s(g.x,g.y,a,h,!1);t.x=this.x+N.x,t.y=this.y+N.y,this.x=this.x+D.x,this.y=this.y+D.y;const R=s(x.x,x.y,a,h,!1),O=s(y.x,y.y,a,h,!1);this.vx=R.x,this.vy=R.y,t.vx=O.x,t.vy=O.y}function s(o,a,h,m,g=!1){return{x:g?o*m+a*h:o*m-a*h,y:g?a*m-o*h:a*m+o*h}}}nextFrameBounce(t,e){const n=t.x,r=t.y,s=t.x+t.width,o=t.y+t.height,a=e?.bounce??-1;this.x+this.radius>s?(this.x=s-this.radius,this.vx*=a):this.x-this.radius<n&&(this.x=n+this.radius,this.vx*=a),this.y+this.radius>o?(this.y=o-this.radius,this.vy*=a):this.y-this.radius<r&&(this.y=r+this.radius,this.vy*=a)}}class Kr{constructor(){}static getFormatKeyNames(t){const e=Ri(),n=[];return t.ctrl&&n.push(e?"Cmd":"Ctrl"),t.shift&&n.push("Shift"),t.alt&&n.push("Alt"),typeof t.key=="string"?n.push(pr(t.key)):Array.isArray(t.key)&&(t.key.map(r=>pr(r)),n.push(...t.key)),n}static matchKeyScheme(t,e){const n=t.ctrl??!1,r=t.shift??!1,s=t.alt??!1;if(t.exact)return(n===e.metaKey||n===e.ctrlKey)&&r===e.shiftKey&&s===e.altKey;const o=[];return n&&o.push(n===e.metaKey||n===e.ctrlKey),r&&o.push(r===e.shiftKey),s&&o.push(s===e.altKey),o.every(a=>a)}static on(t,e){if(t?.key===void 0||t?.key===null)return e;const n=t?.target??window;let r=!1;const s=this.getFormatKeyNames(t),o=a=>{if(a.stopPropagation(),!r&&a.key!=="Control"&&a.key!=="Meta"&&a.key!=="Shift"&&a.key!=="Option"&&a.key!=="Alt"&&s.find(h=>h.toLowerCase()===a.key.toLowerCase())&&this.matchKeyScheme(t,a)){a.preventDefault();const h=e(a);if(typeof h!="function")return;const m=g=>{g.preventDefault(),h(g),n.removeEventListener("keyup",m)};n.addEventListener("keyup",m)}};return e.title=t?.title??"",e.formatedKeyNames=s,e.pause=()=>r=!0,e.restart=()=>r=!1,e.removeListener=()=>n.removeEventListener("keydown",o),n.addEventListener("keydown",o),e}}const Qr=Za("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 Za(i,t=10){const e={},n=i.split(",");for(let r=0;r<n.length;r+=2){const s="&"+n[r+1]+";",o=parseInt(n[r],t);e[s]="&#"+o+";"}return e["\\xa0"]=" ",e}function Jt(i,t){const e=Object.keys(t);for(let n=0;n<e.length;n++)i=i.replace(new RegExp("{"+e[n]+"}","gi"),""+t[e[n]]);return i}function $n(i){let t,e;if(!i)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(i[t]);return t}function Ka(i){const t={left:"start",right:"end",center:"middle",start:"start",end:"end"};return t[i]||t.start}function Qa(i){const t={alphabetic:"alphabetic",hanging:"hanging",top:"text-before-edge",bottom:"text-after-edge",middle:"central"};return t[i]||t.alphabetic}const An={strokeStyle:{svgAttr:"stroke",canvas:"#000000",svg:"none",apply:"stroke"},fillStyle:{svgAttr:"fill",canvas:"#000000",svg:null,apply:"fill"},lineCap:{svgAttr:"stroke-linecap",canvas:"butt",svg:"butt",apply:"stroke"},lineJoin:{svgAttr:"stroke-linejoin",canvas:"miter",svg:"miter",apply:"stroke"},miterLimit:{svgAttr:"stroke-miterlimit",canvas:10,svg:4,apply:"stroke"},lineWidth:{svgAttr:"stroke-width",canvas:1,svg:1,apply:"stroke"},globalAlpha:{svgAttr:"opacity",canvas:1,svg:1,apply:"fill stroke"},font:{canvas:"10px sans-serif"},shadowColor:{canvas:"#000000"},shadowOffsetX:{canvas:0},shadowOffsetY:{canvas:0},shadowBlur:{canvas:0},textAlign:{canvas:"start"},textBaseline:{canvas:"alphabetic"},lineDash:{svgAttr:"stroke-dasharray",canvas:[],svg:null,apply:"stroke"}};class Jn{__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 s=/rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d?\.?\d*)\s*\)/gi.exec(e);s&&(n.setAttribute("stop-color",Jt("rgb({r},{g},{b})",{r:s[1],g:s[2],b:s[3]})),n.setAttribute("stop-opacity",s[4]))}else n.setAttribute("stop-color",e);this.__root.appendChild(n)}}class zi{__root;__ctx;constructor(t,e){this.__root=t,this.__ctx=e}}class Mn{__document=document;__canvas;__ctx;width;height;__styleStack;__groupStack;__rootSVG;__ids;__SVGdefs;__currentElement;__currentElementsToStyle=null;constructor({canvas:t,width:e=500,height:n=500,enableMirroring:r=!1}){this.enableMirroring=r,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(An);for(let e=0,n=t.length;e<n;e++){const r=t[e];this[r]=An[r].canvas}}__getStyleState(){const t={},e=Object.keys(An);for(let n=0,r=e.length;n<r;n++){const s=e[n];t[s]=this[s]}return t}__applyStyleState(t){const e=Object.keys(t);for(let n=0,r=e.length;n<r;n++){const s=e[n];this[s]=t[s]}}__createElement(t,e={},n=!1){const r=this.__document.createElementNS("http://www.w3.org/2000/svg",t),s=Object.keys(e);n&&(r.setAttribute("fill","none"),r.setAttribute("stroke","none"));for(let o=0;o<s.length;o++){const a=s[o];r.setAttribute(a,e[a])}return r}__applyStyleToCurrentElement(t){let e=this.__currentElement;const n=this.__currentElementsToStyle;n&&(e.setAttribute(t,""),e=n.element,n.children.forEach(s=>{s.setAttribute(t,"")}));const r=Object.keys(An);for(let s=0;s<r.length;s++){const o=An[r[s]],a=this[r[s]];if(o.apply){if(a instanceof zi){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,Jt("url(#{id})",{id:a.__root.getAttribute("id")}))}else if(a instanceof Jn)e.setAttribute(o.apply,Jt("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 m=/rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d?\.?\d*)\s*\)/gi.exec(a);e.setAttribute(o.svgAttr,Jt("rgb({r},{g},{b})",{r:m[1],g:m[2],b:m[3]}));let g=parseFloat(m[4]);const x=this.globalAlpha;x!=null&&(g*=x),e.setAttribute(o.svgAttr+"-opacity",""+g)}else{let h=o.svgAttr;if(r[s]==="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 r=Object.keys(Qr);for(let s=0,o=r.length;s<o;s++){const a=r[s],h=Qr[a],m=new RegExp(a,"gi");m.test(e)&&(e=e.replace(m,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 r=this.__createElement("g");e.appendChild(r),this.__currentElement=r}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(Jt("scale({x},{y})",{x:t,y:e}))}rotate(t){const e=t*180/Math.PI;this.__addTransform(Jt("rotate({angle},{cx},{cy})",{angle:e,cx:0,cy:0}))}translate(t,e){this.__addTransform(Jt("translate({x},{y})",{x:t,y:e}))}transform(t,e,n,r,s,o){this.__addTransform(Jt("matrix({a},{b},{c},{d},{e},{f})",{a:t,b:e,c:n,d:r,e:s,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):console.error("Attempted to apply path command to node",t.nodeName)}__addPathCommand(t){this.__currentDefaultPath+=" ",this.__currentDefaultPath+=t}moveTo(t,e){this.__currentElement.nodeName!=="path"&&this.beginPath(),this.__currentPosition={x:t,y:e},this.__addPathCommand(Jt("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(Jt("L {x} {y}",this.__currentPosition)):this.__addPathCommand(Jt("M {x} {y}",this.__currentPosition))}bezierCurveTo(t,e,n,r,s,o){this.__currentPosition={x:s,y:o},this.__addPathCommand(Jt("C {cp1x} {cp1y} {cp2x} {cp2y} {x} {y}",{cp1x:t,cp1y:e,cp2x:n,cp2y:r,x:s,y:o}))}quadraticCurveTo(t,e,n,r){this.__currentPosition={x:n,y:r},this.__addPathCommand(Jt("Q {cpx} {cpy} {x} {y}",{cpx:t,cpy:e,x:n,y:r}))}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,r,s){const o=this.__currentPosition&&this.__currentPosition.x,a=this.__currentPosition&&this.__currentPosition.y;if(typeof o>"u"||typeof a>"u")return;if(s<0)throw new Error("IndexSizeError: The radius provided ("+s+") is negative.");if(o===t&&a===e||t===n&&e===r||s===0){this.lineTo(t,e);return}const h=this.normalize([o-t,a-e]),m=this.normalize([n-t,r-e]);if(h[0]*m[1]===h[1]*m[0]){this.lineTo(t,e);return}const g=h[0]*m[0]+h[1]*m[1],x=Math.acos(Math.abs(g)),y=this.normalize([h[0]+m[0],h[1]+m[1]]),w=s/Math.sin(x/2),k=t+w*y[0],P=e+w*y[1],D=[-h[1],h[0]],N=[m[1],-m[0]],R=function(Y){const nt=Y[0];return Y[1]>=0?Math.acos(nt):-Math.acos(nt)},O=R(D),X=R(N);this.lineTo(k+D[0]*s,P+D[1]*s),this.arc(k,P,s,O,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,r){this.__currentElement.nodeName!=="path"&&this.beginPath(),this.moveTo(t,e),this.lineTo(t+n,e),this.lineTo(t+n,e+r),this.lineTo(t,e+r),this.lineTo(t,e),this.closePath()}fillRect(t,e,n,r){const s=this.__createElement("rect",{x:t,y:e,width:n,height:r},!0);this.__closestGroupOrSvg().appendChild(s),this.__currentElement=s,this.__applyStyleToCurrentElement("fill")}strokeRect(t,e,n,r){const s=this.__createElement("rect",{x:t,y:e,width:n,height:r},!0);this.__closestGroupOrSvg().appendChild(s),this.__currentElement=s,this.__applyStyleToCurrentElement("stroke")}__clearCanvas(){const e=this.__closestGroupOrSvg().getAttribute("transform"),n=this.__rootSVG.childNodes[1],r=n.childNodes;for(let s=r.length-1;s>=0;s--)r[s]&&n.removeChild(r[s]);this.__currentElement=n,this.__groupStack=[],e&&this.__addTransform(e)}clearRect(t,e,n,r){if(t===0&&e===0&&n===this.width&&r===this.height){this.__clearCanvas();return}const s=this.__closestGroupOrSvg(),o=this.__createElement("rect",{x:t,y:e,width:n,height:r,fill:"#FFFFFF"},!0);s.appendChild(o)}createLinearGradient(t,e,n,r){const s=this.__createElement("linearGradient",{id:$n(this.__ids),x1:t+"px",x2:n+"px",y1:e+"px",y2:r+"px",gradientUnits:"userSpaceOnUse"},!1);return this.__SVGdefs.appendChild(s),new Jn(s,this)}createRadialGradient(t,e,n,r,s,o){const a=this.__createElement("radialGradient",{id:$n(this.__ids),cx:r+"px",cy:s+"px",r:o+"px",fx:t+"px",fy:e+"px",gradientUnits:"userSpaceOnUse"},!1);return this.__SVGdefs.appendChild(a),new Jn(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,r){const s=this.__parseFont(),o=this.__closestGroupOrSvg(),a=this.__createElement("text",{"font-family":s.family,"font-size":s.size,"font-style":s.style,"font-weight":s.weight,"text-decoration":s.decoration,x:e,y:n,"text-anchor":Ka(this.textAlign),"dominant-baseline":Qa(this.textBaseline)},!0);a.appendChild(this.__document.createTextNode(t)),this.__currentElement=a,this.__applyStyleToCurrentElement(r),o.appendChild(this.__wrapTextLink(s,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,r,s,o){if(r===s)return;r=r%(2*Math.PI),s=s%(2*Math.PI),r===s&&(s=(s+2*Math.PI-.001*(o?-1:1))%(2*Math.PI));const a=t+n*Math.cos(s),h=e+n*Math.sin(s),m=t+n*Math.cos(r),g=e+n*Math.sin(r),x=o?0:1;let y=0,w=s-r;w<0&&(w+=2*Math.PI),o?y=w>Math.PI?0:1:y=w>Math.PI?1:0,this.lineTo(m,g),this.__addPathCommand(Jt("A {rx} {ry} {xAxisRotation} {largeArcFlag} {sweepFlag} {endX} {endY}",{rx:n,ry:n,xAxisRotation:0,largeArcFlag:y,sweepFlag:x,endX:a,endY:h})),this.__currentPosition={x:a,y:h}}clip(){const t=this.__closestGroupOrSvg(),e=this.__createElement("clipPath"),n=$n(this.__ids),r=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",Jt("url(#{id})",{id:n})),t.appendChild(r),this.__currentElement=r}drawImage(...t){let e=t[0],n,r,s,o,a=0,h=0,m,g,x,y,w,k,P,D;if(t.length===3)n=t[1],r=t[2],m=e.width,g=e.height,s=m,o=g;else if(t.length===5)n=t[1],r=t[2],s=t[3],o=t[4],m=e.width,g=e.height;else if(t.length===9)a=t[1],h=t[2],m=t[3],g=t[4],n=t[5],r=t[6],s=t[7],o=t[8];else throw new Error("Invalid number of arguments passed to drawImage: "+arguments.length);const N=this.__closestGroupOrSvg();this.__currentElement;const R="translate("+n+", "+r+")";if(e instanceof Mn){if(x=e.getSvg().cloneNode(!0),x.childNodes&&x.childNodes.length>1){for(y=x.childNodes[0];y.childNodes.length;)D=y.childNodes[0].getAttribute("id"),this.__ids[D]=D,this.__SVGdefs.appendChild(y.childNodes[0]);if(w=x.childNodes[1],w){const O=w.getAttribute("transform");let X;O?X=O+" "+R:X=R,w.setAttribute("transform",X),N.appendChild(w)}}}else(e.nodeName==="CANVAS"||e.nodeName==="IMG")&&(k=this.__createElement("image"),k.setAttribute("width",s),k.setAttribute("height",o),k.setAttribute("preserveAspectRatio","none"),(a||h||m!==e.width||g!==e.height)&&(P=this.__document.createElement("canvas"),P.width=s,P.height=o,P.getContext("2d")?.drawImage(e,a,h,m,g,0,0,s,o),e=P),k.setAttribute("transform",R),k.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",e.nodeName==="CANVAS"?e.toDataURL():e.getAttribute("src")),N.appendChild(k))}createPattern(t,e){const n=this.__document.createElementNS("http://www.w3.org/2000/svg","pattern"),r=$n(this.__ids);let s;return n.setAttribute("id",r),t.nodeName==="CANVAS"||t.nodeName==="IMG"?(s=this.__document.createElementNS("http://www.w3.org/2000/svg","image"),s.setAttribute("width",""+t.width),s.setAttribute("height",""+t.height),s.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",t.nodeName==="CANVAS"?t.toDataURL():t.getAttribute("src")),n.appendChild(s),this.__SVGdefs.appendChild(n)):t instanceof Mn&&(n.setAttribute("width",""+t.width),n.setAttribute("height",""+t.height),n.appendChild(t.__rootSVG.childNodes[1]),this.__SVGdefs.appendChild(n)),new zi(n,this)}setLineDash(t){t&&t.length>0?this.lineDash=t.join(","):this.lineDash=null}drawFocusRing(){}createImageData(){}getImageData(){}putImageData(){}globalCompositeOperation(){}setTransform(){}}function to(i){throw new Error('Could not dynamically require "'+i+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var ts={},Ui={exports:{}},es;function eo(){return es||(es=1,function(i){(function(t){var e="0.4.0",n="hasOwnProperty",r=/[\.\/]/,s="*",o=function(){},a=function(y,w){return y-w},h,m,g={n:{}},x=function(y,w){var k=m,P=Array.prototype.slice.call(arguments,2),D=x.listeners(y),N=0,R,O=[],X={},Y=[];h=y,m=0;for(var nt=0,V=D.length;nt<V;nt++)"zIndex"in D[nt]&&(O.push(D[nt].zIndex),D[nt].zIndex<0&&(X[D[nt].zIndex]=D[nt]));for(O.sort(a);O[N]<0;)if(R=X[O[N++]],Y.push(R.apply(w,P)),m)return m=k,Y;for(nt=0;nt<V;nt++)if(R=D[nt],"zIndex"in R)if(R.zIndex==O[N]){if(Y.push(R.apply(w,P)),m)return m=k,Y;do if(N++,R=X[O[N]],R&&Y.push(R.apply(w,P)),m)return m=k,Y;while(R)}else X[R.zIndex]=R;else if(Y.push(R.apply(w,P)),m)return m=k,Y;return m=k,Y.length?Y:null};x.listeners=function(y){var w=y.split(r),k=g,P,D,N,R,O,X,Y,nt,V=[k],ot=[];for(R=0,O=w.length;R<O;R++){for(nt=[],X=0,Y=V.length;X<Y;X++)for(k=V[X].n,D=[k[w[R]],k[s]],N=2;N--;)P=D[N],P&&(nt.push(P),ot=ot.concat(P.f||[]));V=nt}return ot},x.on=function(y,w){for(var k=y.split(r),P=g,D=0,N=k.length;D<N;D++)P=P.n,!P[k[D]]&&(P[k[D]]={n:{}}),P=P[k[D]];for(P.f=P.f||[],D=0,N=P.f.length;D<N;D++)if(P.f[D]==w)return o;return P.f.push(w),function(R){+R==+R&&(w.zIndex=+R)}},x.stop=function(){m=1},x.nt=function(y){return y?new RegExp("(?:\\.|\\/|^)"+y+"(?:\\.|\\/|$)").test(h):h},x.unbind=function(y,w){var k=y.split(r),P,D,N,R,O,X,Y,nt=[g];for(R=0,O=k.length;R<O;R++)for(X=0;X<nt.length;X+=N.length-2){if(N=[X,1],P=nt[X].n,k[R]!=s)P[k[R]]&&N.push(P[k[R]]);else for(D in P)P[n](D)&&N.push(P[D]);nt.splice.apply(nt,N)}for(R=0,O=nt.length;R<O;R++)for(P=nt[R];P.n;){if(w){if(P.f){for(X=0,Y=P.f.length;X<Y;X++)if(P.f[X]==w){P.f.splice(X,1);break}!P.f.length&&delete P.f}for(D in P.n)if(P.n[n](D)&&P.n[D].f){var V=P.n[D].f;for(X=0,Y=V.length;X<Y;X++)if(V[X]==w){V.splice(X,1);break}!V.length&&delete P.n[D].f}}else{delete P.f;for(D in P.n)P.n[n](D)&&P.n[D].f&&delete P.n[D].f}P=P.n}},x.once=function(y,w){var k=function(){w.apply(this,arguments),x.unbind(y,k)};return x.on(y,k)},x.version=e,x.toString=function(){return"You are running Eve "+e},i.exports?i.exports=x:t.eve=x})(sa)}(Ui)),Ui.exports}(function(i){if(typeof to=="function")var t=eo();(function(){function e(y){var w=function(k){w.parse(k)};return w.mode="text",w.type=String(y||"html").toLowerCase(),w.textchunk="",w.raw="",w.parse=h,w.on=o,w.event=s,w.end=r,w}function n(y,w,k){y==`
|
|
18
|
-
`&&this.event("newline"),x[this.mode].call(this,y,w,k)}function r(){n.call(this,"eof"),this.event("eof")}function s(y,w,k){typeof t=="function"&&t("elemental."+y+"."+w,null,w,k||"",this.raw);for(var P=this.events&&this.events[y],D=P&&P.length;D--;)try{this.events[y][D](w,k||"",this.raw)}catch{}this.raw=""}function o(y,w){this.events=this.events||{},this.events[y]=this.events[y]||[],this.events[y].push(w)}function a(y,w){return y&&(y.charAt?y.charAt(w):y[w])}function h(y){y=y||Object(y);for(var w=1,k=y.length+1,P,D,N=a(y,0);w<k;w++)P=D,D=N,N=a(y,w),this.raw+=D,n.call(this,D,N,P);this._beforeEnd=function(){n.call(this,"","",D)}}var m=/[\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=function(){for(var y in this.attr)this.attr.hasOwnProperty(y)&&this.event("attr",y,{value:this.attr[y],tagname:this.tagname,attr:this.attr})},x={text:function(y,w,k){switch(y){case"<":case"eof":this.nodename="",this.attr={},this.mode="tag name start",this.raw=this.raw.slice(0,-1),this.textchunk&&this.event("text",this.textchunk),this.raw+=y,this.textchunk="";break;default:this.textchunk+=y}},special:function(y,w,k){if(k=="!"&&y=="-"&&w=="-")this.mode="comment start";else{if(this.textchunk=="[CDATA"&&y=="["){this.mode="cdata",this.textchunk="";return}if(y==">"||y=="eof"){this.event("special",this.textchunk),this.mode="text",this.textchunk="";return}this.textchunk+=y}},cdata:function(y,w,k){k=="]"&&y=="]"&&w==">"?(this.mode="cdata end",this.textchunk=this.textchunk.slice(0,-1)):(y=="eof"&&x["cdata end"].call(this),this.textchunk+=y)},"cdata end":function(y,w,k){this.event("cdata",this.textchunk),this.textchunk="",this.mode="text"},"comment start":function(y,w,k){w==">"||y=="eof"?(this.event("comment",""),this.mode="comment instant end"):this.mode="comment"},"comment instant end":function(y,w,k){this.mode="text"},comment:function(y,w,k){y=="-"&&k=="-"&&w==">"?(this.mode="comment end",this.textchunk=this.textchunk.slice(0,-1)):y=="eof"?this.event("comment",this.textchunk):this.textchunk+=y},"comment end":function(y,w,k){this.event("comment",this.textchunk),this.textchunk="",this.mode="text"},declaration:function(y,w,k){y=="?"&&w==">"?this.mode="declaration end":(y=="eof"&&this.event("comment",this.textchunk),this.textchunk+=y)},"declaration end":function(y,w,k){this.event("comment",this.textchunk),this.textchunk="",this.mode="text"},"tag name start":function(y,w,k){if(y=="eof")this.event("text","<");else if(!m.test(y)){if(this.mode="tag name",y=="/"){this.mode="close tag name start";return}if(y=="!"){this.mode="special",this.textchunk="";return}if(y=="?"){this.mode="declaration";return}x[this.mode].call(this,y,w,k)}},"close tag name start":function(y,w,k){m.test(y)||(this.mode="close tag name",this.tagname="",this.nodename="",x[this.mode].call(this,y,w,k))},"close tag name":function(y,w,k){if(m.test(y))this.tagname=this.nodename;else switch(y){case">":this.event("/tag",this.tagname||this.nodename),this.mode="text";break;default:!this.tagname&&(this.nodename+=y)}},"tag name":function(y,w,k){if(m.test(y))this.tagname=this.nodename,this.nodename="",this.mode="attr start";else switch(y){case">":this.event("tag",this.nodename),this.mode="text";break;default:this.nodename+=y}},"attr start":function(y,w,k){m.test(y)||(this.mode="attr",this.nodename="",x[this.mode].call(this,y,w,k))},attr:function(y,w,k){if(m.test(y)||y=="=")this.attr[this.nodename]="",this.mode="attr value start";else switch(y){case">":this.nodename=="/"?(delete this.attr["/"],this.event("tag",this.tagname,this.attr),g.call(this),this.event("/tag",this.tagname,!0)):(this.nodename&&(this.attr[this.nodename]=""),this.event("tag",this.tagname,this.attr),g.call(this)),this.mode="text";break;default:this.nodename+=y}},"attr value start":function(y,w,k){if(!m.test(y)){if(this.mode="attr value",this.quote=!1,y=="'"||y=='"'){this.quote=y;return}x[this.mode].call(this,y,w,k)}},"attr value":function(y,w,k){if(m.test(y)&&!this.quote)this.mode="attr start";else if(y==">"&&!this.quote)this.event("tag",this.tagname,this.attr),this.mode="text";else switch(y){case'"':case"'":this.quote==y&&k!="\\"&&(this.mode="attr start");break;default:this.attr[this.nodename]+=y}}};e.version="0.2.1",i.elemental=e,i.eve=t})()})(ts);const ns=Ei(ts),is=[1,0,0,1,0,0],rs=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];class Ht{value;matrix3d;isEverTo3d=!1;_prev_translate_z=0;_prev_rotate=0;_prev_rotate_x=0;_prev_rotate_y=0;_prev_rotate_z=0;_prev_scale_z=1;constructor(t=is){this.value=Array.from(t),this.matrix3d=this.toMatrix3D()}unit(){return this.value=Array.from(is),this.matrix3d=this.toMatrix3D(),this}transformPoint(t,e,n=0,r=0){const s=t-n,o=e-r;return t=s*this.value[0]+o*this.value[2]+this.value[4],e=s*this.value[1]+o*this.value[3]+this.value[5],[t+n,e+r]}fromString(t){const e=dr("number",t);return e.length===6?e.forEach((n,r)=>{n.fullMatch&&(this.value[r]=parseFloat(n.fullMatch))}):this.unit(),this}toMatrix3D(t=this.matrix3d){const e=[this.value[0],this.value[1],0,0,this.value[2],this.value[3],0,0,0,0,1,0,this.value[4],this.value[5],0,1];return t?(t.value=e,t):new Ze(e)}offset(t=0,e=0){return[t-this.value[4],e-this.value[5]]}clone(){return new Ht(this.value)}multiply(t){const e=this.value;let n;t instanceof Ht?n=t.value:n=t;const r=e[0]*n[0]+e[2]*n[1],s=e[1]*n[0]+e[3]*n[1],o=e[0]*n[2]+e[2]*n[3],a=e[1]*n[2]+e[3]*n[3],h=e[0]*n[4]+e[2]*n[5]+e[4],m=e[1]*n[4]+e[3]*n[5]+e[5];return e[0]=r,e[1]=s,e[2]=o,e[3]=a,e[4]=h,e[5]=m,this}inverse(){const t=new Ht(this.value),e=t.value,n=1/(e[0]*e[3]-e[1]*e[2]),r=e[3]*n,s=-e[1]*n,o=-e[2]*n,a=e[0]*n,h=n*(e[2]*e[5]-e[3]*e[4]),m=n*(e[1]*e[4]-e[0]*e[5]);return e[0]=r,e[1]=s,e[2]=o,e[3]=a,e[4]=h,e[5]=m,t}translate(t,e){return this.matrix3d.translate(t,e,0),this.multiply([1,0,0,1,t,e])}translateTo(t,e){const n=this.offset(t,e);return this.translate(n[0],n[1])}translateX(t){return this.translate(t,0)}translateXTo(t){return this.translateTo(t,this.value[5])}translateY(t){return this.translate(0,t)}translateYTo(t){return this.translateTo(this.value[4],t)}translateZ(t){return this.isEverTo3d=!0,this.matrix3d.translate(0,0,t)}translateZTo(t){return this.translateZ(t-this._prev_translate_z),this._prev_translate_z=t,this}translate3d(t,e,n){return this.isEverTo3d=!0,this.matrix3d.translate(t,e,n)}translate3dTo(t,e,n){return this.translate3d(t-this.matrix3d.value[12],t-this.matrix3d.value[13],n-this._prev_translate_z),this._prev_translate_z=n,this}rotate(t,e=0,n=0){const r=Yn(t),s=+Math.cos(r).toFixed(9),o=+Math.sin(r).toFixed(9);return this.multiply([s,o,-o,s,e,n]),this.translate(-e,-n),this}rotateTo(t,e=0,n=0){return this.rotate(t-this._prev_rotate,e,n),this._prev_rotate=t,this}rotateX(t){return this.isEverTo3d=!0,this.matrix3d.rotate("x",t)}rotateXTo(t){return this.rotateX(t-this._prev_rotate_x),this._prev_rotate_x=t,this}rotateY(t){return this.isEverTo3d=!0,this.matrix3d.rotate("y",t)}rotateYTo(t){return this.rotateY(t-this._prev_rotate_y),this._prev_rotate_y=t,this}rotateZ(t){return this.isEverTo3d=!0,this.matrix3d.rotate("z",t)}rotateZTo(t){return this.rotateZ(t-this._prev_rotate_z),this._prev_rotate_z=t,this}rotate3d(t,e,n){return this.isEverTo3d=!0,this.matrix3d.rotate("x",t).rotate("y",e).rotate("z",n)}rotate3dTo(t,e,n){return this.rotate3d(t-this._prev_rotate_x,e-this._prev_rotate_y,n-this._prev_rotate_z),this._prev_rotate_x=t,this._prev_rotate_y=e,this._prev_rotate_z=n,this}scale(t,e=t,n=0,r=0){return this.matrix3d.scale(t,e,1),this.translate(n,r),this.multiply([t,0,0,e,0,0]),this.translate(-n,-r),this}scaleTo(t,e=t,n=0,r=0){return this.scale(t/this.value[0],e/this.value[3],n,r),this}scaleX(t){return this.scale(t,1)}scaleXTo(t){return this.scale(t/this.value[0],1)}scaleY(t){return this.scale(1,t)}scaleYTo(t){return this.scale(1,t/this.value[3])}scaleZ(t){return this.isEverTo3d=!0,this.matrix3d.scale(1,1,t)}scaleZTo(t){return this.scaleZ(t/this._prev_scale_z),this._prev_scale_z=t,this}scale3d(t,e,n){return this.isEverTo3d=!0,this.matrix3d.scale(t,e,n)}scale3dTo(t,e,n){return this.scale3d(t/this.matrix3d.value[0],e/this.matrix3d.value[5],n/this._prev_scale_z),this._prev_scale_z=n,this}skew(t,e=t){const n=t*Math.PI/180,r=e*Math.PI/180,s=Math.tan(n),o=Math.tan(r);return this.multiply([1,o,s,1,0,0])}skewTo(t,e=t){return this.skew(t-this.value[2],e-this.value[1])}skewX(t){return this.skew(t,this.value[1])}skewXTo(t){return this.skewTo(t,this.value[1])}skewY(t){return this.skew(this.value[2],t)}skewYTo(t){return this.skewTo(this.value[2],t)}skewZ(t){return this}skewZTo(t){return this}skew3d(t,e,n){return this}skew3dTo(t,e,n){return this}split(){const t={dx:0,dy:0,scalex:1,scaley:1,shear:1,rotate:0,isSimple:!0,isSuperSimple:!0,noRotation:!1};t.dx=this.value[4],t.dy=this.value[5];const e=[[this.value[0],this.value[2]],[this.value[1],this.value[3]]];t.scalex=Math.sqrt(Math.pow(e[0][0],2)+Math.pow(e[0][1],2));let n=Fi(e[0][0],e[0][1]);e[0][0]=n.x,e[0][1]=n.y,t.shear=e[0][0]*e[1][0]+e[0][1]*e[1][1],e[1]=[e[1][0]-e[0][0]*t.shear,e[1][1]-e[0][1]*t.shear],t.scaley=Math.sqrt(Math.pow(e[1][0],2)+Math.pow(e[1][1],2)),n=Fi(e[1][0],e[1][1]),e[1][0]=n.x,e[1][1]=n.y,t.shear/=t.scaley;const r=-e[0][1],s=e[1][1];return s<0?(t.rotate=Oi(Math.acos(s)),r<0&&(t.rotate=360-t.rotate)):t.rotate=Yn(Math.asin(r)),t.isSimple=!+t.shear.toFixed(9)&&(t.scalex.toFixed(9)==t.scaley.toFixed(9)||!t.rotate),t.isSuperSimple=!+t.shear.toFixed(9)&&t.scalex.toFixed(9)==t.scaley.toFixed(9)&&!t.rotate,t.noRotation=!+t.shear.toFixed(9)&&!t.rotate,t}static split2(t){const e=Math.atan2(t[1],t[0]),n=Math.pow(t[0],2)+Math.pow(t[1],2),r=Math.sqrt(n),s=(t[0]*t[3]-t[2]*t[1])/r;return{rotation:e/(Math.PI/180),scaleX:r,scaleY:s,x:t[4],y:t[5]}}static getGroupCoords(t,e){const n=t[0],r=t[1],s=t[2],o=t[3],a=t[4],h=t[5],m=e[0],g=e[1],x=e[2],y=e[3],w=e[4],k=e[5],P=m*y,D=g*x,N=(x*r-n*y)/(D-P),R=(m*r-n*g)/(P-D),O=(x*o-s*y)/(D-P),X=(m*o-s*g)/(P-D),Y=(x*(h-k)+y*(w-a))/(D-P),nt=(m*(h-k)+g*(w-a))/(P-D),V=[N,R,O,X,Y,nt];return Ht.split2(V)}toTransformString(){const t=this.split();return t.isSimple?(t.scalex=+t.scalex.toFixed(4),t.scaley=+t.scaley.toFixed(4),t.rotate=+t.rotate.toFixed(4),(t.dx&&t.dy?"t"+[t.dx,t.dy]:"")+(t.scalex!=1||t.scaley!=1?"s"+[t.scalex,t.scaley,0,0]:"")+(t.rotate?"r"+[t.rotate,0,0]:"")):"matrix"+[this.value[0],this.value[1],this.value[2],this.value[3],this.value[4],this.value[5]]}toString(){return this.isEverTo3d?this.toMatrix3DString():`matrix(${this.value.map(t=>wr(t,6)).join(",")})`}toMatrix3DString(){return this.matrix3d.toString()}toFilter(){return"progid:DXImageTransform.Microsoft.Matrix(M11="+this.value[0]+", M12="+this.value[2]+", M21="+this.value[1]+", M22="+this.value[3]+", Dx="+this.value[4]+", Dy="+this.value[5]+", sizingmethod='auto expand')"}}class Ze{value;constructor(t=rs){this.value=Array.from(t)}unit(){return this.value=Array.from(rs),this}fromString(t){const e=dr("number",t);return e.length===16?e.forEach((n,r)=>{n.fullMatch&&(this.value[r]=parseFloat(n.fullMatch))}):this.unit(),this}toMatrix(t){const e=[this.value[0],this.value[1],this.value[4],this.value[5],this.value[12],this.value[13]];return t?(t.value=e,t):new Ht(e)}multiplyMatrix(t){const e=this.value[0],n=this.value[1],r=this.value[2],s=this.value[3],o=this.value[4],a=this.value[5],h=this.value[6],m=this.value[7],g=this.value[8],x=this.value[9],y=this.value[10],w=this.value[11],k=this.value[12],P=this.value[13],D=this.value[14],N=this.value[15],R=t.value[0],O=t.value[1],X=t.value[2],Y=t.value[3],nt=R*e+O*o+X*g+Y*k,V=R*n+O*a+X*x+Y*P,ot=R*r+O*h+X*y+Y*D,ct=R*s+O*m+X*w+Y*N;return new Ht([nt,V,ot,ct,0,0])}multiply(t){const e=new Ht([t.value[0],t.value[1],t.value[2],t.value[3],0,0]),n=new Ht([t.value[4],t.value[5],t.value[6],t.value[7],0,0]),r=new Ht([t.value[8],t.value[9],t.value[10],t.value[11],0,0]),s=new Ht([t.value[12],t.value[13],t.value[14],t.value[15],0,0]),o=this.multiplyMatrix(e),a=this.multiplyMatrix(n),h=this.multiplyMatrix(r),m=this.multiplyMatrix(s);return this.value[0]=o.value[0],this.value[1]=o.value[1],this.value[2]=o.value[2],this.value[3]=o.value[3],this.value[4]=a.value[0],this.value[5]=a.value[1],this.value[6]=a.value[2],this.value[7]=a.value[3],this.value[8]=h.value[0],this.value[9]=h.value[1],this.value[10]=h.value[2],this.value[11]=h.value[3],this.value[12]=m.value[0],this.value[13]=m.value[1],this.value[14]=m.value[2],this.value[15]=m.value[3],this}translate(t=0,e=0,n=0){return this.multiply(new Ze([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 Ze([t,0,0,0,0,e,0,0,0,0,n,0,0,0,0,1]))}rotate(t,e){const n=Yn(e),r=Math.sin,s=Math.cos;let o;switch(t){case"x":o=[1,0,0,0,0,s(n),r(n),0,0,-r(n),s(n),0,0,0,0,1];break;case"y":o=[s(n),0,-r(n),0,0,1,0,0,r(n),0,s(n),0,0,0,0,1];break;case"z":o=[s(n),r(n),0,0,-r(n),s(n),0,0,0,0,1,0,0,0,0,1];break}return this.multiply(new Ze(o))}toString(){return`matrix3d(${this.value.map(t=>wr(t,6)).join(",")})`}}function un(i){const t=new Ht;return i.replace(/([a-z0-9]+)\s*\(?\s*((-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)*[a-z%]*\s*,?\s*)+)\)?/gi,function(e,n,r){r.indexOf(",")>=0?r=r.split(/\s*,\s*/):r=r.split(/\s+/);const s=[];for(let o=0,a=r.length;o<a;o++)r[o].trim()&&s.push(parseFloat(""+r[o]));switch(n.toLowerCase()){case"t":case"translate":t.translate(s[0],s[1]);break;case"translatex":t.translateX(s[0]);break;case"translatey":t.translateY(s[0]);break;case"translatez":t.translateZ(s[0]);break;case"translate3d":t.translate3d(s[0],s[1],s[2]);break;case"r":case"rotate":t.rotate(s[0],s[1]??0,s[2]??0);break;case"rotatex":t.rotateX(s[0]);break;case"rotatey":t.rotateY(s[0]);break;case"rotatez":t.rotateZ(s[0]);break;case"rotate3d":t.rotate3d(s[0],s[1],s[2]);break;case"s":case"scale":t.scale(s[0],s[1]??s[0]);break;case"scalex":t.scaleX(s[0]);break;case"scaley":t.scaleY(s[0]);break;case"scalez":t.scaleZ(s[0]);break;case"scale3d":t.scale3d(s[0],s[1],s[2]);break;case"skew":t.skew(s[0],s[1]??0);break;case"skewx":t.skewX(s[0]);break;case"skewy":t.skewY(s[0]);break;case"skewz":t.skewZ(s[0]);break;case"skew3d":t.skew3d(s[0],s[1],s[2]);break;case"m":case"matrix":t.multiply([s[0],s[1],s[2],s[3],s[4],s[5]]);break;case"matrix3d":t.matrix3d.multiply(new Ze(s));break}return""}),t}function Gi(i,t,e,n,r,s){if(typeof r>"u"||typeof s>"u"){const o=i-e,a=t-n;return!o&&!a?0:(180+Math.atan2(-a,-o)*180/Math.PI+360)%360}else return Gi(i,t,r,s)-Gi(e,n,r,s)}const Ct=ns.eve,no=ns.elemental,Zn={cursor:1,cx:0,cy:0,fill:1,"fill-opacity":0,font:1,"font-family":1,"font-size":0,"font-style":1,"font-weight":1,height:0,"letter-spacing":0,opacity:0,r:0,rx:0,ry:0,src:1,stroke:1,"stroke-linecap":1,"stroke-linejoin":1,"stroke-miterlimit":0,"stroke-opacity":0,"stroke-width":0,"text-anchor":1,width:0,x:0,y:0};function Vi(i,t,e){for(var n=(i+"").split(";"),r=/^\s+|\s+$/g,s,o=0,a=n.length;o<a;o++){var h=n[o].split(":");s=h[0].replace(r,"").replace(/[A-Z]/g,function(m){return"-"+m.toLowerCase()}),(!e||s in e)&&(t[s]=h[1].replace(r,""),e&&!e[s]&&(t[s]=parseFloat(t[s])))}}function ss(i){const t=no(),e=[],n=[],r={};let s,o,a;const h={};function m(g,x){return function(y,w){const k={type:x||g};e.push(k);for(let P in w)Object.prototype.hasOwnProperty.call(w,P)&&Ct("rappar."+g+".attr."+P,k,w[P],P);Ct("rappar."+g+".attrend",k,w)}}return Ct.on("rappar.polygon.attr.points",function(g){this.path="M"+g+"z",Ct.stop()}),Ct.on("rappar.image.attr.xlink:href",function(g){this.src=g,Ct.stop()}),Ct.on("rappar.path.attr.d",function(g){this.path=g,Ct.stop()}),Ct.on("rappar.*.attr.transform",function(g){this.transform=un(g).toTransformString(),Ct.stop()}),Ct.on("rappar.*.attr.fill",function(g){var x=g.match(/url\(#([^)]+)\)/),y=this;x&&(x=x[1],r[x]?this.fill=r[x]:Ct.on("rappar.found."+x,function(w){y.fill=w}),Ct.stop())}),Ct.on("rappar.line.attrend",function(g){this.path="M"+[g.x1,g.y1,g.x2,g.y2]}),Ct.on("rappar.*.attrend",function(){for(var g=n.length;g--;)if(n[g]!=this){let y="",w="";for(var x in n[g])x=="transform"?y=n[g].transform:x=="class"&&h["."+n[g][x]]?w=h["."+n[g][x]].join(";")+";"+w:x=="id"&&h["#"+n[g][x]]?w=h["#"+n[g][x]].join(";")+";"+w:typeof this[x]>"u"&&(this[x]=n[g][x]);this.type&&(typeof this.transform>"u"?this.transform=y:this.transform+=y,typeof this.style>"u"?this.style=w:this.style=w+this.style,Vi(this.style,this,Zn))}}),Ct.on("rappar.*.attr.style",function(g){var x=function(){Vi(g,this,Zn),Ct.unbind("rappar.*.attrend",x)};Ct.on("rappar.*.attrend",x),Ct.stop()}),Ct.on("rappar.*.attr.*",function(g,x){x in Zn&&(this[x]=Zn[x]?g:parseFloat(g))}),Ct.on("elemental.tag.circle",m("circle")),Ct.on("elemental.tag.ellipse",m("ellipse")),Ct.on("elemental.tag.polygon",m("polygon","path")),Ct.on("elemental.tag.path",m("path")),Ct.on("elemental.tag.line",m("line","path")),Ct.on("elemental.tag.rect",m("rect")),Ct.on("elemental.tag.image",m("image")),Ct.on("elemental.tag.text",m("text")),Ct.on("elemental.text",function(g){try{const x=da(g);for(let y of x.stylesheet.rules){for(let w of y.selectors)h[w]=[];for(let w of y.declarations)for(let k of y.selectors)h[k].push(`${w.property}:${w.value}`)}}catch{}}),Ct.on("elemental.tag.svg",function(g,x){let y=x.width||0,w=x.height||0;if(!y||!w){const k=x.viewBox.split(/\s+/gi);y=parseFloat(k[2])-parseFloat(k[0]),w=parseFloat(k[3])-parseFloat(k[1])}e.push({type:"viewbox",width:y,height:w})}),Ct.on("rappar.text.attrend",function(){s="",o=this,this["text-anchor"]=this["text-anchor"]||"start"}),Ct.on("elemental.text",function(g,x,y){o&&(s+=y)}),Ct.on("elemental./tag.text",function(){o.text=s,o=null}),Ct.on("elemental.tag.g",function(g,x){var y={};n.push(y);for(var w in x)Object.prototype.hasOwnProperty.call(x,w)&&(y[w]=x[w],Ct("rappar.g.attr."+w,y,x[w],w));Ct("rappar.g.attrend",y)}),Ct.on("elemental./tag.g",function(g,x){n.pop()}),Ct.on("elemental.tag.linearGradient",function(g,x){a={id:x.id,angle:+(360+Gi(x.x1,x.y1,x.x2,x.y2,x.x1+100,x.y1)).toFixed(2),stops:[]}}),Ct.on("elemental./tag.linearGradient",function(){for(var g=[a.angle],x,y=0,w=a.stops.length;y<w;y++)x=a.stops[y],y&&y!=w-1?g.push(x.color+":"+x.offset):g.push(x.color);r[a.id]=g.join("-"),Ct("rappar.found."+a.id,null,r[a.id])}),Ct.on("elemental.tag.radialGradient",function(g,x){a={id:x.id,stops:[]}}),Ct.on("elemental./tag.radialGradient",function(){for(var g=[],x,y=0,w=a.stops.length;y<w;y++)x=a.stops[y],y&&y!=w-1?g.push(x.color+":"+x.offset):g.push(x.color);r[a.id]="r"+g.join("-"),Ct("rappar.found."+a.id,null,r[a.id])}),Ct.on("elemental.tag.stop",function(g,x){var y={};x.style&&Vi(x.style,y),y.offset=y.offset||x.offset,y.color=y["stop-color"]||x["stop-color"],y.opacity=y["stop-opacity"]||x["stop-opacity"],~(y.offset+"").indexOf("%")?y.offset=parseFloat(y.offset):y.offset=parseFloat(y.offset)*100,y.offset=+y.offset.toFixed(2),a.stops.push(y)}),t(i),t.end(),e}function as(i){return typeof i!="string"?!1:(i=i.trim(),/^[mzlhvcsqta]\s*[-+.0-9][^mlhvzcsqta]+/i.test(i)&&/[\dz]$/i.test(i)&&i.length>4)}const ji={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},io=/([astvzqmhlc])([^astvzqmhlc]*)/gi,ro=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/gi;function so(i){const t=i.match(ro);return t?t.map(Number):[]}function Kn(i){const t=[];return i.replace(io,function(e,n,r){let s=n.toLowerCase();for(r=so(r),s=="m"&&r.length>2&&(t.push([n].concat(r.splice(0,2))),s="l",n=n=="m"?"l":"L");;){if(r.length==ji[s])return r.unshift(n),t.push(r);if(r.length<ji[s])throw new Error("malformed path data");t.push([n].concat(r.splice(0,ji[s])))}}),t}function Qn(i){var t=0,e=0,n=0,r=0;return i.map(function(s){s=s.slice();var o=s[0],a=o.toUpperCase();if(o!=a)switch(s[0]=a,o){case"a":s[6]+=n,s[7]+=r;break;case"v":s[1]+=r;break;case"h":s[1]+=n;break;default:for(var h=1;h<s.length;)s[h++]+=n,s[h++]+=r}switch(a){case"Z":n=t,r=e;break;case"H":n=s[1];break;case"V":r=s[1];break;case"M":n=t=s[1],r=e=s[2];break;default:n=s[s.length-2],r=s[s.length-1]}return s})}function ao(i){var t=0,e=0,n=0,r=0;return i.map(function(s){s=s.slice();var o=s[0],a=o.toLowerCase();if(o!=a)switch(s[0]=a,o){case"A":s[6]-=n,s[7]-=r;break;case"V":s[1]-=r;break;case"H":s[1]-=n;break;default:for(var h=1;h<s.length;)s[h++]-=n,s[h++]-=r}switch(a){case"z":n=t,r=e;break;case"h":n+=s[1];break;case"v":r+=s[1];break;case"m":n+=s[1],r+=s[2],t+=s[1],e+=s[2];break;default:n+=s[s.length-2],r+=s[s.length-1]}return s})}const In=Math.PI*2;function os(i,t,e,n){const r=i*n-t*e<0?-1:1;let s=i*e+t*n;return s>1&&(s=1),s<-1&&(s=-1),r*Math.acos(s)}function oo(i,t,e,n,r,s,o,a,h,m){const g=m*(i-e)/2+h*(t-n)/2,x=-h*(i-e)/2+m*(t-n)/2,y=o*o,w=a*a,k=g*g,P=x*x;let D=y*w-y*P-w*k;D<0&&(D=0),D/=y*P+w*k,D=Math.sqrt(D)*(r===s?-1:1);const N=D*o/a*x,R=D*-a/o*g,O=m*N-h*R+(i+e)/2,X=h*N+m*R+(t+n)/2,Y=(g-N)/o,nt=(x-R)/a,V=(-g-N)/o,ot=(-x-R)/a,ct=os(1,0,Y,nt);let vt=os(Y,nt,V,ot);return s===0&&vt>0&&(vt-=In),s===1&&vt<0&&(vt+=In),[O,X,ct,vt]}function ho(i,t){const e=1.3333333333333333*Math.tan(t/4),n=Math.cos(i),r=Math.sin(i),s=Math.cos(i+t),o=Math.sin(i+t);return[n,r,n-r*e,r+n*e,s+o*e,o-s*e,s,o]}function co(i,t,e,n,r,s,o,a,h){const m=Math.sin(h*In/360),g=Math.cos(h*In/360),x=g*(i-e)/2+m*(t-n)/2,y=-m*(i-e)/2+g*(t-n)/2;if(x===0&&y===0)return[];if(o===0||a===0)return[];o=Math.abs(o),a=Math.abs(a);const w=x*x/(o*o)+y*y/(a*a);w>1&&(o*=Math.sqrt(w),a*=Math.sqrt(w));const k=oo(i,t,e,n,r,s,o,a,m,g),P=[];let D=k[2],N=k[3];const R=Math.max(Math.ceil(Math.abs(N)/(In/4)),1);N/=R;for(let O=0;O<R;O++)P.push(ho(D,N)),D+=N;return P.map(O=>{for(let X=0;X<O.length;X+=2){let Y=O[X+0],nt=O[X+1];Y*=o,nt*=a;const V=g*Y-m*nt,ot=m*Y+g*nt;O[X+0]=V+k[0],O[X+1]=ot+k[1]}return O})}function ti(i){for(var t,e=[],n=0,r=0,s=0,o=0,a=null,h=null,m=0,g=0,x=0,y=i.length;x<y;x++){var w=i[x],k=w[0];switch(k){case"M":s=w[1],o=w[2];break;case"A":var P=co(m,g,w[6],w[7],w[4],w[5],w[1],w[2],w[3]);if(!P.length)continue;P=P.map(X=>{const[Y,nt,V,ot,ct,vt,dt,ht]=X;return{x1:V,y1:ot,x2:ct,y2:vt,x:dt,y:ht}});for(var D=0,N;D<P.length;D++)N=P[D],w=["C",N.x1,N.y1,N.x2,N.y2,N.x,N.y],D<P.length-1&&e.push(w);break;case"S":var R=m,O=g;(t=="C"||t=="S")&&(R+=R-n,O+=O-r),w=["C",R,O,w[1],w[2],w[3],w[4]];break;case"T":t=="Q"||t=="T"?(a=m*2-a,h=g*2-h):(a=m,h=g),w=hs(m,g,a,h,w[1],w[2]);break;case"Q":a=w[1],h=w[2],w=hs(m,g,w[1],w[2],w[3],w[4]);break;case"L":w=ei(m,g,w[1],w[2]);break;case"H":w=ei(m,g,w[1],g);break;case"V":w=ei(m,g,m,w[1]);break;case"Z":w=ei(m,g,s,o);break}t=k,m=w[w.length-2],g=w[w.length-1],w.length>4?(n=w[w.length-4],r=w[w.length-3]):(n=m,r=g),e.push(w)}return e}function ei(i,t,e,n){return["C",i,t,e,n,e,n]}function hs(i,t,e,n,r,s){return["C",i/3+2/3*e,t/3+2/3*n,r/3+2/3*e,s/3+2/3*n,r,s]}const lo=i=>Array.isArray(i);function fn(i){if(!(this instanceof fn))return new fn(i);this._path=lo(i)?i:Kn(i),this._path=Qn(this._path),this._path=fo(this._path),this._path=uo(this._path)}fn.prototype.at=function(i,t){return this._walk(i,t).pos},fn.prototype.length=function(){return this._walk(null).length},fn.prototype._walk=function(i,t){let e=[0,0],n=[0,0,0],r=[0,0],s=0;for(let g=0;g<this._path.length;g++){let x=this._path[g];if(x[0]==="M"){if(e[0]=x[1],e[1]=x[2],i===0)return{length:s,pos:e}}else if(x[0]==="C"){n[0]=r[0]=e[0],n[1]=r[1]=e[1],n[2]=s;let y=100;for(let w=0;w<=y;w++){let k=w/y,P=o(x,k),D=a(x,k);if(s+=Xi(e[0],e[1],P,D),e[0]=P,e[1]=D,typeof i=="number"&&s>=i){let N=(s-i)/(s-n[2]),R=[e[0]*(1-N)+n[0]*N,e[1]*(1-N)+n[1]*N];return{length:s,pos:R}}n[0]=e[0],n[1]=e[1],n[2]=s}}else if(x[0]==="Q"){n[0]=r[0]=e[0],n[1]=r[1]=e[1],n[2]=s;let y=100;for(let w=0;w<=y;w++){let k=w/y,P=h(x,k),D=m(x,k);if(s+=Xi(e[0],e[1],P,D),e[0]=P,e[1]=D,typeof i=="number"&&s>=i){let N=(s-i)/(s-n[2]),R=[e[0]*(1-N)+n[0]*N,e[1]*(1-N)+n[1]*N];return{length:s,pos:R}}n[0]=e[0],n[1]=e[1],n[2]=s}}else if(x[0]==="L"){if(n[0]=e[0],n[1]=e[1],n[2]=s,s+=Xi(e[0],e[1],x[1],x[2]),e[0]=x[1],e[1]=x[2],typeof i=="number"&&s>=i){let y=(s-i)/(s-n[2]),w=[e[0]*(1-y)+n[0]*y,e[1]*(1-y)+n[1]*y];return{length:s,pos:w}}n[0]=e[0],n[1]=e[1],n[2]=s}}return{length:s,pos:e};function o(g,x){return Math.pow(1-x,3)*r[0]+3*Math.pow(1-x,2)*x*g[1]+3*(1-x)*Math.pow(x,2)*g[3]+Math.pow(x,3)*g[5]}function a(g,x){return Math.pow(1-x,3)*r[1]+3*Math.pow(1-x,2)*x*g[2]+3*(1-x)*Math.pow(x,2)*g[4]+Math.pow(x,3)*g[6]}function h(g,x){return Math.pow(1-x,2)*r[0]+2*(1-x)*x*g[1]+Math.pow(x,2)*g[3]}function m(g,x){return Math.pow(1-x,2)*r[1]+2*(1-x)*x*g[2]+Math.pow(x,2)*g[4]}};function Xi(i,t,e,n){let r=i-e,s=t-n;return Math.sqrt(r*r+s*s)}function uo(i){let t,e=0,n=0,r={S:{to:"C",x:3},T:{to:"Q",x:1}};for(let s=0,o=i.length;s<o;s++){let a=i[s],h=r[a[0]];h&&(a[0]=h.to,t&&(t[0]===h.to?(e=2*t[h.x+2]-t[h.x],n=2*t[h.x+3]-t[h.x+1]):(e=t[t.length-2],n=t[t.length-1])),a.splice(1,0,e,n)),t=a}return i}function fo(i){let t=[],e=["L",0,0],n;for(let r=0,s=i.length;r<s;r++){let o=i[r];switch(o[0]){case"M":e=["L",o[1],o[2]],t.push(o);break;case"Z":t.push(e);break;case"H":n=t[t.length-1]||["L",0,0],t.push(["L",o[1],n[n.length-1]]);break;case"V":n=t[t.length-1]||["L",0,0],t.push(["L",n[n.length-2],o[1]]);break;default:t.push(o)}}return t}const Hi=i=>{if(typeof i=="function"||Object(i)!==i)return i;const t=new i.constructor;for(const e in i)Object.prototype.hasOwnProperty.call(i,e)&&(t[e]=Hi(i[e]));return t};function Wi(i){const t=Wi.ps=Wi.ps||{};return t[i]?t[i].sleep=100:t[i]={sleep:100},setTimeout(()=>{for(const e in t)Object.prototype.hasOwnProperty.call(t,e)&&e!==i&&(t[e].sleep--,t[e].sleep||delete t[e])}),t[i]}function Ln(i,t,e,n){return i==null&&(i=t=e=n=0),t==null&&(t=i.y,e=i.width,n=i.height,i=i.x),{x:i,y:t,width:e,w:e,height:n,h:n,x2:i+e,y2:t+n,cx:i+e/2,cy:t+n/2,r1:Math.min(e,n)/2,r2:Math.max(e,n)/2,r0:Math.sqrt(e*e+n*n)/2,path:xo(i,t,e,n),vb:[i,t,e,n].join(" ")}}function cs(i,t,e,n,r,s,o,a,h){const m=1-h,g=m**3,x=m**2,y=h*h,w=y*h,k=g*i+x*3*h*e+m*3*h*h*r+w*o,P=g*t+x*3*h*n+m*3*h*h*s+w*a,D=i+2*h*(e-i)+y*(r-2*e+i),N=t+2*h*(n-t)+y*(s-2*n+t),R=e+2*h*(r-e)+y*(o-2*r+e),O=n+2*h*(s-n)+y*(a-2*s+n),X=m*i+h*e,Y=m*t+h*n,nt=m*r+h*o,V=m*s+h*a,ot=90-Math.atan2(D-R,N-O)*180/Math.PI;return{x:k,y:P,m:{x:D,y:N},n:{x:R,y:O},start:{x:X,y:Y},end:{x:nt,y:V},alpha:ot}}function ls(i,t,e,n,r,s,o,a){Array.isArray(i)||(i=[i,t,e,n,r,s,o,a]);const h=ds(...i);return Ln(h.min.x,h.min.y,h.max.x-h.min.x,h.max.y-h.min.y)}function po(i,t,e){return t>=i.x&&t<=i.x+i.width&&e>=i.y&&e<=i.y+i.height}function mo(i,t){i=Ln(i),t=Ln(t);const{x:e,y:n,width:r,height:s}=i,{x:o,y:a,width:h,height:m}=t,g=e+r/2,x=n+s/2,y=o+h/2,w=a+m/2;return Math.abs(g-y)<=(r+h)/2||Math.abs(x-w)<=(s+m)/2}function us(i,t,e,n,r){const s=-3*t+9*e-9*n+3*r,o=i*s+6*t-12*e+6*n;return i*o-3*t+3*e}function fs(i,t,e,n,r,s,o,a,h){h==null&&(h=1),h=Math.max(0,Math.min(h,1));const m=h/2,g=12,x=[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816],y=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472];let w=0;for(let k=0;k<g;k++){const P=m*x[k]+m,D=us(P,i,e,r,o),N=us(P,t,n,s,a),R=D*D+N*N;w+=y[k]*Math.sqrt(R)}return m*w}function go(i,t,e,n,r,s,o,a){if(Math.max(i,e)<Math.min(r,o)||Math.min(i,e)>Math.max(r,o)||Math.max(t,n)<Math.min(s,a)||Math.min(t,n)>Math.max(s,a))return;const h=(i*n-t*e)*(r-o)-(i-e)*(r*a-s*o),m=(i*n-t*e)*(s-a)-(t-n)*(r*a-s*o),g=(i-e)*(s-a)-(t-n)*(r-o);if(!g)return;const x=h/g,y=m/g,w=Number(x.toFixed(2)),k=Number(y.toFixed(2));if(!(w<Number(Math.min(i,e).toFixed(2))||w>Number(Math.max(i,e).toFixed(2))||w<Number(Math.min(r,o).toFixed(2))||w>Number(Math.max(r,o).toFixed(2))||k<Number(Math.min(t,n).toFixed(2))||k>Number(Math.max(t,n).toFixed(2))||k<Number(Math.min(s,a).toFixed(2))||k>Number(Math.max(s,a).toFixed(2))))return{x,y}}function vo(i,t,e){const n=ls(i),r=ls(t);if(!mo(n,r))return e?0:[];const s=fs.apply(0,i),o=fs.apply(0,t),a=Math.ceil(s/8),h=Math.ceil(o/8),m=[],g=[],x={};let y=e?0:[];for(let w=0;w<a+1;w++){const k=cs.apply(0,i.concat(w/a));m.push({x:k.x,y:k.y,t:w/a})}for(let w=0;w<h+1;w++){const k=cs.apply(0,t.concat(w/h));g.push({x:k.x,y:k.y,t:w/h})}for(let w=0;w<a;w++)for(let k=0;k<h;k++){const P=m[w],D=m[w+1],N=g[k],R=g[k+1],O=Math.abs(D.x-P.x)<.001?"y":"x",X=Math.abs(R.x-N.x)<.001?"y":"x",Y=go(P.x,P.y,D.x,D.y,N.x,N.y,R.x,R.y);if(Y&&x[Y.x.toFixed(4)]!==Y.y.toFixed(4)){x[Y.x.toFixed(4)]=Y.y.toFixed(4);const nt=P.t+Math.abs((Y[O]-P[O])/(D[O]-P[O]))*(D.t-P.t),V=N.t+Math.abs((Y[X]-N[X])/(R[X]-N[X]))*(R.t-N.t);nt>=0&&nt<=1&&V>=0&&V<=1&&(e?y++:y.push({x:Y.x,y:Y.y,t1:nt,t2:V}))}}return y}function yo(i,t,e){let n,r,s,o,a,h,m,g,x,y,w=e?0:[];for(let k=0,P=i.length;k<P;k++){const D=i[k];if(D[0]==="M")n=a=D[1],r=h=D[2];else{D[0]==="C"?(x=[n,r].concat(D.slice(1)),n=x[6],r=x[7]):(x=[n,r,n,r,a,h,a,h],n=a,r=h);for(let N=0,R=t.length;N<R;N++){const O=t[N];if(O[0]==="M")s=m=O[1],o=g=O[2];else{O[0]==="C"?(y=[s,o].concat(O.slice(1)),s=y[6],o=y[7]):(y=[s,o,s,o,m,g,m,g],s=m,o=g);const X=vo(x,y,e);if(e)w+=X;else{for(let Y=0,nt=X.length;Y<nt;Y++)X[Y].segment1=k,X[Y].segment2=N,X[Y].bez1=x,X[Y].bez2=y;w=w.concat(X)}}}}}return w}function wo(i){const t=Wi(i);if(t.bbox)return Hi(t.bbox);if(!i)return Ln();let e=0,n=0,r=[],s=[],o=[];for(let y=0,w=i.length;y<w;y++)if(o=i[y],o[0]==="M")e=o[1],n=o[2],r.push(e),s.push(n);else{const k=ds(e,n,o[1],o[2],o[3],o[4],o[5],o[6]);r=r.concat(k.min.x,k.max.x),s=s.concat(k.min.y,k.max.y),e=o[5],n=o[6]}const a=Math.min.apply(0,r),h=Math.min.apply(0,s),m=Math.max.apply(0,r),g=Math.max.apply(0,s),x=Ln(a,h,m-a,g-h);return t.bbox=Hi(x),x}function xo(i,t,e,n,r){return r?[["M",Number(i)+Number(r),t],["l",e-r*2,0],["a",r,r,0,0,1,r,r],["l",0,n-r*2],["a",r,r,0,0,1,-r,r],["l",r*2-e,0],["a",r,r,0,0,1,-r,-r],["l",0,r*2-n],["a",r,r,0,0,1,r,-r],["z"]]:[["M",i,t],["l",e,0],["l",0,n],["l",-e,0],["z"]]}function ds(i,t,e,n,r,s,o,a){const h=[],m=[[],[]];let g,x,y,w,k,P,D,N;for(let Y=0;Y<2;++Y){if(Y===0?(x=6*i-12*e+6*r,g=-3*i+9*e-9*r+3*o,y=3*e-3*i):(x=6*t-12*n+6*s,g=-3*t+9*n-9*s+3*a,y=3*n-3*t),Math.abs(g)<1e-12){if(Math.abs(x)<1e-12)continue;w=-y/x,w>0&&w<1&&h.push(w);continue}D=x*x-4*y*g,N=Math.sqrt(D),!(D<0)&&(k=(-x+N)/(2*g),k>0&&k<1&&h.push(k),P=(-x-N)/(2*g),P>0&&P<1&&h.push(P))}let R=h.length,O;const X=R;for(;R--;)w=h[R],O=1-w,m[0][R]=O*O*O*i+3*O*O*w*e+3*O*w*w*r+w*w*w*o,m[1][R]=O*O*O*t+3*O*O*w*n+3*O*w*w*s+w*w*w*a;return m[0][X]=i,m[1][X]=t,m[0][X+1]=o,m[1][X+1]=a,m[0].length=m[1].length=X+2,{min:{x:Math.min.apply(0,m[0]),y:Math.min.apply(0,m[1])},max:{x:Math.max.apply(0,m[0]),y:Math.max.apply(0,m[1])}}}function bo(i,t,e){const n=wo(i);return!(!po(n,t,e)||yo(i,ti([["M",t,e],["H",n.x2+10]]),1)%2!==1)}const Yi=new Map;function ps(i){if(Yi.has(i))return Yi.get(i);const t=fn(i);return Yi.set(i,t),t}function ms(i){const t=document.createElementNS("http://www.w3.org/2000/svg","path");return t.setAttribute("d",i),t}function gs(i,t){return Fe?ms(i).getTotalLength(t):ps(i).length()}function vs(i,t){if(Fe)return ms(i).getPointAtLength(t);{const e=ps(i),[n,r]=e.at(t);return{x:n,y:r}}}let ae=null;function ys(i,t,e){if(Fe){ae||(ae=document.createElement("canvas").getContext("2d"));const n=new Path2D(i);return ae.isPointInPath(n,t,e)}else return bo(i,t,e)}function ws(i,t,e,{lineWidth:n=1,lineCap:r="butt",lineJoin:s="miter"}){if(Fe){if(ae||(ae=document.createElement("canvas").getContext("2d")),ae.isPointInStroke){ae.save(),ae.lineWidth=n,ae.lineCap=r,ae.lineJoin=s;const o=new Path2D(i),a=ae.isPointInStroke(o,t,e);return ae.restore(),a}}else return null}class qi{point;constructor(t){this.point=new fe(t)}static fromSVGPathData(t){if(t.length<3)throw new Error("Line 参数个数错误");if(t[0].toUpperCase()!=="L")throw new Error("Line command 错误");return new qi({x:t[1],y:t[2]})}toSVGPathData(){return["L",this.point.x,this.point.y]}toSVGPathD(){return"L "+this.point.toSVGPathD()}}const xs=qi;class $i extends xs{rx;ry;xAxisRotate;largeArcFlag;sweepFlag;constructor(t){super(t),this.rx=t.rx,this.ry=t.ry,this.xAxisRotate=t?.xAxisRotate??0,this.largeArcFlag=t?.largeArcFlag??1,this.sweepFlag=t?.sweepFlag??1}static fromSVGPathData(t){if(t.length<8)throw new Error("Arc 参数个数错误");if(t[0].toUpperCase()!=="A")throw new Error("Arc command 错误");return new $i({x:t[6],y:t[7],rx:t[1],ry:t[2],xAxisRotate:t[3],largeArcFlag:t[4],sweepFlag:t[5]})}toSVGPathData(){return["A",this.rx,this.ry,this.xAxisRotate,this.largeArcFlag,this.sweepFlag,this.point.x,this.point.y]}toSVGPathD(){return`A ${this.rx},${this.ry} ${this.xAxisRotate} ${this.largeArcFlag},${this.sweepFlag} ${this.point.toSVGPathD()}`}}const bs=$i;class Ji extends xs{ctrlPoints=[];constructor(t){super(t),this.ctrlPoints.push(new fe({x:t.c1x,y:t.c1y})),this.ctrlPoints.push(new fe({x:t.c2x,y:t.c2y}))}static fromSVGPathData(t){if(t.length<7)throw new Error("CubicBezier 参数个数错误");if(t[0].toUpperCase()!=="C")throw new Error("CubicBezier command 错误");return new Ji({c1x:t[1],c1y:t[2],c2x:t[3],c2y:t[4],x:t[5],y:t[6]})}toSVGPathData(){return["C",this.ctrlPoints[0].x,this.ctrlPoints[0].y,this.ctrlPoints[1].x,this.ctrlPoints[1].y,this.point.x,this.point.y]}toSVGPathD(){return`C ${this.ctrlPoints.map(t=>t.toSVGPathD()).join(" ")} ${this.point.toSVGPathD()}`}}const Zi=Ji;class Ke{startPoint;isClosed=!1;lines=[];normalizedLines=[];constructor(t){this.startPoint=t?.startPoint??null,this.isClosed=t?.isClosed??!1,t?.lines?.forEach(this.addLine),this.normalize()}setStartPoint(t,e){return this.startPoint=new fe({x:t,y:e}),this}addLine(t){return this.lines.push(t),this}normalize(){let t=this.lines.reduce((n,r)=>(n+=r.toSVGPathD(),n),"");this.startPoint&&(t="M "+this.startPoint.toSVGPathD()+t),this.isClosed&&(t+="Z"),this.normalizedLines=[];const e=ti(Qn(Kn(t)));for(let n=0,r=e.length;n<r;n++){const s=e[n];if(n==0&&s[0]=="M"){this.setStartPoint(s[1],s[2]);continue}if(n==r-1&&s[0]=="Z"){this.isClosed=!0;continue}this.normalizedLines.push(Zi.fromSVGPathData(s))}return this}static fromSVGPathD(t,e){if(!as(t))throw new Error("Not an SVG path!");const n=ti(Qn(Kn(t)));return Ke.fromSVGPathData(n,e)}static fromSVGPathData(t,e){const n=new Ke;for(let s=0,o=t.length;s<o;s++){const a=t[s],h=a[0];if(s==0&&h=="M"){n.setStartPoint(a[1],a[2]);continue}if(s==o-1&&h=="Z"){n.isClosed=!0;continue}n.addLine(new Zi({c1x:a[1],c1y:a[2],c2x:a[3],c2y:a[4],x:a[5],y:a[6]}))}n.normalize();const r=un(e??"");return n.transform(r)}toSVGPathD(){let t="";this.startPoint&&(t+="M "+this.startPoint.toSVGPathD());for(let e=0,n=this.normalizedLines.length;e<n;e++)t+=this.normalizedLines[e].toSVGPathD();return this.isClosed&&(t+="Z"),t}toSVGPathData(){const t=[];this.startPoint&&t.push(["M",...this.startPoint.toSVGPathData()]);for(let e=0,n=this.normalizedLines.length;e<n;e++)t.push(this.normalizedLines[e].toSVGPathData());return this.isClosed&&t.push(["Z"]),t}toCanvas(t){const e=this.normalizedLines;e.length&&(this.startPoint&&(t.beginPath(),t.moveTo(this.startPoint.x,this.startPoint.y)),e.forEach(n=>{const[r,...s]=n.toSVGPathData();r==="M"?t.moveTo(s[0],s[1]):r==="Z"?t.closePath():t.bezierCurveTo(s[0],s[1],s[2],s[3],s[4],s[5])}),this.isClosed&&t.closePath())}get bounds(){let t=[0,0,0,0];if(this.normalizedLines.length){t=[1/0,1/0,-1/0,-1/0];for(let e=0,n=this.normalizedLines.length;e<n;e++){const r=this.normalizedLines[e],s=[...r.ctrlPoints,r.point];for(let o=0;o<s.length;o++){const a=s[o].x,h=s[o].y;a<t[0]&&(t[0]=a),h<t[1]&&(t[1]=h),a>t[2]&&(t[2]=a),h>t[3]&&(t[3]=h)}}}return t}get size(){const t=this.bounds;return[t[2]-t[0],t[3]-t[1]]}get center(){const[t,e,n,r]=this.bounds;return[(t+n)/2,(e+r)/2]}getTotalLength(){return gs(this.toSVGPathD())}getPointAtLength(t){return vs(this.toSVGPathD(),t)}isPointInPath(t,e){return ys(this.toSVGPathD(),t,e)}isPointInStroke(t,e,n={lineWidth:1,lineCap:"butt",lineJoin:"miter"}){return ws(this.toSVGPathD(),t,e,n)}transform(t){if(this.startPoint){const[e,n]=t.transformPoint(this.startPoint.x,this.startPoint.y);this.setStartPoint(e,n)}return this.normalizedLines=this.normalizedLines.map(e=>{const[n,...r]=e.toSVGPathData(),s=[n];for(let o=0,a=r.length;o<a;o+=2){const h=r[o],m=r[o+1],[g,x]=t.transformPoint(h,m);s.push(g,x)}return Zi.fromSVGPathData(s)}),this}translate(t,e){const n=new Ht().translate(t,e);return this.transform(n)}rotate(t,e=0,n=0){const r=new Ht().rotate(t,e,n);return this.transform(r)}scale(t,e=t,n=0,r=0){const s=new Ht().scale(t,e,n,r);return this.transform(s)}skew(t,e=0){const n=new Ht().skew(t,e);return this.transform(n)}trim(){const[t,e]=this.bounds;return this.translate(-t,-e),this}static generateRosetta(t,e,n,r,s){if(s==0)throw new Error("no dividing by zero, please");const o=new Ke;o.setStartPoint(t,e);const a=360/s;for(let h=0;h<s;h+=1){const m=a*h*Math.PI/180,g=t+2*n*Math.cos(m),x=e+2*n*Math.sin(m);o.addLine(new bs({x:g,y:x,rx:n,ry:r,xAxisRotate:a*h,largeArcFlag:1,sweepFlag:1})),o.addLine(new bs({x:t,y:e,rx:n,ry:r,xAxisRotate:a*h,largeArcFlag:1,sweepFlag:1}))}return o.normalize(),o}}var _s={exports:{}};(function(i,t){(function(e,n){i.exports=n()})(window,function(){return function(e){var n={};function r(s){if(n[s])return n[s].exports;var o=n[s]={i:s,l:!1,exports:{}};return e[s].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=n,r.d=function(s,o,a){r.o(s,o)||Object.defineProperty(s,o,{enumerable:!0,get:a})},r.r=function(s){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(s,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(s,"__esModule",{value:!0})},r.t=function(s,o){if(1&o&&(s=r(s)),8&o||4&o&&typeof s=="object"&&s&&s.__esModule)return s;var a=Object.create(null);if(r.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:s}),2&o&&typeof s!="string")for(var h in s)r.d(a,h,function(m){return s[m]}.bind(null,h));return a},r.n=function(s){var o=s&&s.__esModule?function(){return s.default}:function(){return s};return r.d(o,"a",o),o},r.o=function(s,o){return Object.prototype.hasOwnProperty.call(s,o)},r.p="",r(r.s=1)}([function(e,n,r){var s,o;s=[r(2)],(o=function(a){function h(l){if(h.is(l,"function"))return m?l():a.on("raphael.DOMload",l);if(h.is(l,it))return h._engine.create[R](h,l.splice(0,3+h.is(l[0],K))).add(l);var f=Array.prototype.slice.call(arguments,0);if(h.is(f[f.length-1],"function")){var d=f.pop();return m?d.call(h._engine.create[R](h,f)):a.on("raphael.DOMload",function(){d.call(h._engine.create[R](h,f))})}return h._engine.create[R](h,arguments)}h.version="2.3.0",h.eve=a;var m,g,x=/[, ]+/,y={circle:1,rect:1,path:1,ellipse:1,text:1,image:1},w=/\{(\d+)\}/g,k="hasOwnProperty",P={doc:document,win:window},D={was:Object.prototype[k].call(P.win,"Raphael"),is:P.win.Raphael},N=function(){this.ca=this.customAttributes={}},R="apply",O="concat",X="ontouchstart"in window||window.TouchEvent||window.DocumentTouch&&document instanceof DocumentTouch,Y="",nt=" ",V=String,ot="split",ct="click dblclick mousedown mousemove mouseout mouseover mouseup touchstart touchmove touchend touchcancel"[ot](nt),vt={mousedown:"touchstart",mousemove:"touchmove",mouseup:"touchend"},dt=V.prototype.toLowerCase,ht=Math,pt=ht.max,ut=ht.min,Pt=ht.abs,kt=ht.pow,Dt=ht.PI,K="number",it="array",st=Object.prototype.toString,E=(h._ISURL=/^url\(['"]?(.+?)['"]?\)$/i,/^\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),C={NaN:1,Infinity:1,"-Infinity":1},b=/^(?:cubic-)?bezier\(([^,]+),([^,]+),([^,]+),([^\)]+)\)/,A=ht.round,L=parseFloat,F=parseInt,B=V.prototype.toUpperCase,q=h._availableAttrs={"arrow-end":"none","arrow-start":"none",blur:0,"clip-rect":"0 0 1e9 1e9",cursor:"default",cx:0,cy:0,fill:"#fff","fill-opacity":1,font:'10px "Arial"',"font-family":'"Arial"',"font-size":"10","font-style":"normal","font-weight":400,gradient:0,height:0,href:"http://raphaeljs.com/","letter-spacing":0,opacity:1,path:"M0,0",r:0,rx:0,ry:0,src:"",stroke:"#000","stroke-dasharray":"","stroke-linecap":"butt","stroke-linejoin":"butt","stroke-miterlimit":0,"stroke-opacity":1,"stroke-width":1,target:"_blank","text-anchor":"middle",title:"Raphael",transform:"",width:0,x:0,y:0,class:""},z=h._availableAnimAttrs={blur:K,"clip-rect":"csv",cx:K,cy:K,fill:"colour","fill-opacity":K,"font-size":K,height:K,opacity:K,path:"path",r:K,rx:K,ry:K,stroke:"colour","stroke-opacity":K,"stroke-width":K,transform:"transform",width:K,x:K,y:K},J=/[\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]*/,at={hs:1,rg:1},ft=/,?([achlmqrstvxz]),?/gi,yt=/([achlmrqstvz])[\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,]*((-?\d*\.?\d*(?:e[\-+]?\d+)?[\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]*)+)/gi,Tt=/([rstm])[\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,]*((-?\d*\.?\d*(?:e[\-+]?\d+)?[\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]*)+)/gi,wt=/(-?\d*\.?\d*(?:e[\-+]?\d+)?)[\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]*/gi,Et=(h._radial_gradient=/^r(?:\(([^,]+?)[\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]*([^\)]+?)\))?/,{}),At=function(l,f){return L(l)-L(f)},Mt=function(l){return l},mt=h._rectPath=function(l,f,d,c,u){return u?[["M",l+u,f],["l",d-2*u,0],["a",u,u,0,0,1,u,u],["l",0,c-2*u],["a",u,u,0,0,1,-u,u],["l",2*u-d,0],["a",u,u,0,0,1,-u,-u],["l",0,2*u-c],["a",u,u,0,0,1,u,-u],["z"]]:[["M",l,f],["l",d,0],["l",0,c],["l",-d,0],["z"]]},Nt=function(l,f,d,c){return c==null&&(c=d),[["M",l,f],["m",0,-c],["a",d,c,0,1,1,0,2*c],["a",d,c,0,1,1,0,-2*c],["z"]]},It=h._getPath={path:function(l){return l.attr("path")},circle:function(l){var f=l.attrs;return Nt(f.cx,f.cy,f.r)},ellipse:function(l){var f=l.attrs;return Nt(f.cx,f.cy,f.rx,f.ry)},rect:function(l){var f=l.attrs;return mt(f.x,f.y,f.width,f.height,f.r)},image:function(l){var f=l.attrs;return mt(f.x,f.y,f.width,f.height)},text:function(l){var f=l._getBBox();return mt(f.x,f.y,f.width,f.height)},set:function(l){var f=l._getBBox();return mt(f.x,f.y,f.width,f.height)}},Ut=h.mapPath=function(l,f){if(!f)return l;var d,c,u,p,v,_,S;for(u=0,v=(l=en(l)).length;u<v;u++)for(p=1,_=(S=l[u]).length;p<_;p+=2)d=f.x(S[p],S[p+1]),c=f.y(S[p],S[p+1]),S[p]=d,S[p+1]=c;return l};if(h._g=P,h.type=P.win.SVGAngle||P.doc.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")?"SVG":"VML",h.type=="VML"){var Rt,Zt=P.doc.createElement("div");if(Zt.innerHTML='<v:shape adj="1"/>',(Rt=Zt.firstChild).style.behavior="url(#default#VML)",!Rt||typeof Rt.adj!="object")return h.type=Y;Zt=null}function Wt(l){if(typeof l=="function"||Object(l)!==l)return l;var f=new l.constructor;for(var d in l)l[k](d)&&(f[d]=Wt(l[d]));return f}h.svg=!(h.vml=h.type=="VML"),h._Paper=N,h.fn=g=N.prototype=h.prototype,h._id=0,h.is=function(l,f){return(f=dt.call(f))=="finite"?!C[k](+l):f=="array"?l instanceof Array:f=="null"&&l===null||f==typeof l&&l!==null||f=="object"&&l===Object(l)||f=="array"&&Array.isArray&&Array.isArray(l)||st.call(l).slice(8,-1).toLowerCase()==f},h.angle=function(l,f,d,c,u,p){if(u==null){var v=l-d,_=f-c;return v||_?(180+180*ht.atan2(-_,-v)/Dt+360)%360:0}return h.angle(l,f,u,p)-h.angle(d,c,u,p)},h.rad=function(l){return l%360*Dt/180},h.deg=function(l){return Math.round(180*l/Dt%360*1e3)/1e3},h.snapTo=function(l,f,d){if(d=h.is(d,"finite")?d:10,h.is(l,it)){for(var c=l.length;c--;)if(Pt(l[c]-f)<=d)return l[c]}else{var u=f%(l=+l);if(u<d)return f-u;if(u>l-d)return f-u+l}return f};var ge,je;h.createUUID=(ge=/[xy]/g,je=function(l){var f=16*ht.random()|0;return(l=="x"?f:3&f|8).toString(16)},function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(ge,je).toUpperCase()}),h.setWindow=function(l){a("raphael.setWindow",h,P.win,l),P.win=l,P.doc=P.win.document,h._engine.initWin&&h._engine.initWin(P.win)};var de=function(l){if(h.vml){var f,d=/^\s+|\s+$/g;try{var c=new ActiveXObject("htmlfile");c.write("<body>"),c.close(),f=c.body}catch{f=createPopup().document.body}var u=f.createTextRange();de=Xt(function(v){try{f.style.color=V(v).replace(d,Y);var _=u.queryCommandValue("ForeColor");return"#"+("000000"+(_=(255&_)<<16|65280&_|(16711680&_)>>>16).toString(16)).slice(-6)}catch{return"none"}})}else{var p=P.doc.createElement("i");p.title="Raphaël Colour Picker",p.style.display="none",P.doc.body.appendChild(p),de=Xt(function(v){return p.style.color=v,P.doc.defaultView.getComputedStyle(p,Y).getPropertyValue("color")})}return de(l)},Ee=function(){return"hsb("+[this.h,this.s,this.b]+")"},Pe=function(){return"hsl("+[this.h,this.s,this.l]+")"},ve=function(){return this.hex},ye=function(l,f,d){if(f==null&&h.is(l,"object")&&"r"in l&&"g"in l&&"b"in l&&(d=l.b,f=l.g,l=l.r),f==null&&h.is(l,"string")){var c=h.getRGB(l);l=c.r,f=c.g,d=c.b}return(l>1||f>1||d>1)&&(l/=255,f/=255,d/=255),[l,f,d]},mn=function(l,f,d,c){var u={r:l*=255,g:f*=255,b:d*=255,hex:h.rgb(l,f,d),toString:ve};return h.is(c,"finite")&&(u.opacity=c),u};function Xt(l,f,d){return function c(){var u=Array.prototype.slice.call(arguments,0),p=u.join("␀"),v=c.cache=c.cache||{},_=c.count=c.count||[];return v[k](p)?(function(S,I){for(var U=0,W=S.length;U<W;U++)if(S[U]===I)return S.push(S.splice(U,1)[0])}(_,p),d?d(v[p]):v[p]):(_.length>=1e3&&delete v[_.shift()],_.push(p),v[p]=l[R](f,u),d?d(v[p]):v[p])}}h.color=function(l){var f;return h.is(l,"object")&&"h"in l&&"s"in l&&"b"in l?(f=h.hsb2rgb(l),l.r=f.r,l.g=f.g,l.b=f.b,l.hex=f.hex):h.is(l,"object")&&"h"in l&&"s"in l&&"l"in l?(f=h.hsl2rgb(l),l.r=f.r,l.g=f.g,l.b=f.b,l.hex=f.hex):(h.is(l,"string")&&(l=h.getRGB(l)),h.is(l,"object")&&"r"in l&&"g"in l&&"b"in l?(f=h.rgb2hsl(l),l.h=f.h,l.s=f.s,l.l=f.l,f=h.rgb2hsb(l),l.v=f.b):(l={hex:"none"}).r=l.g=l.b=l.h=l.s=l.v=l.l=-1),l.toString=ve,l},h.hsb2rgb=function(l,f,d,c){var u,p,v,_,S;return this.is(l,"object")&&"h"in l&&"s"in l&&"b"in l&&(d=l.b,f=l.s,c=l.o,l=l.h),_=(S=d*f)*(1-Pt((l=(l*=360)%360/60)%2-1)),u=p=v=d-S,mn(u+=[S,_,0,0,_,S][l=~~l],p+=[_,S,S,_,0,0][l],v+=[0,0,_,S,S,_][l],c)},h.hsl2rgb=function(l,f,d,c){var u,p,v,_,S;return this.is(l,"object")&&"h"in l&&"s"in l&&"l"in l&&(d=l.l,f=l.s,l=l.h),(l>1||f>1||d>1)&&(l/=360,f/=100,d/=100),_=(S=2*f*(d<.5?d:1-d))*(1-Pt((l=(l*=360)%360/60)%2-1)),u=p=v=d-S/2,mn(u+=[S,_,0,0,_,S][l=~~l],p+=[_,S,S,_,0,0][l],v+=[0,0,_,S,S,_][l],c)},h.rgb2hsb=function(l,f,d){var c,u;return l=(d=ye(l,f,d))[0],f=d[1],d=d[2],{h:(((u=(c=pt(l,f,d))-ut(l,f,d))==0?null:c==l?(f-d)/u:c==f?(d-l)/u+2:(l-f)/u+4)+360)%6*60/360,s:u==0?0:u/c,b:c,toString:Ee}},h.rgb2hsl=function(l,f,d){var c,u,p,v;return l=(d=ye(l,f,d))[0],f=d[1],d=d[2],c=((u=pt(l,f,d))+(p=ut(l,f,d)))/2,{h:(((v=u-p)==0?null:u==l?(f-d)/v:u==f?(d-l)/v+2:(l-f)/v+4)+360)%6*60/360,s:v==0?0:c<.5?v/(2*c):v/(2-2*c),l:c,toString:Pe}},h._path2string=function(){return this.join(",").replace(ft,"$1")},h._preload=function(l,f){var d=P.doc.createElement("img");d.style.cssText="position:absolute;left:-9999em;top:-9999em",d.onload=function(){f.call(this),this.onload=null,P.doc.body.removeChild(this)},d.onerror=function(){P.doc.body.removeChild(this)},P.doc.body.appendChild(d),d.src=l};function we(){return this.hex}function Xe(l,f){for(var d=[],c=0,u=l.length;u-2*!f>c;c+=2){var p=[{x:+l[c-2],y:+l[c-1]},{x:+l[c],y:+l[c+1]},{x:+l[c+2],y:+l[c+3]},{x:+l[c+4],y:+l[c+5]}];f?c?u-4==c?p[3]={x:+l[0],y:+l[1]}:u-2==c&&(p[2]={x:+l[0],y:+l[1]},p[3]={x:+l[2],y:+l[3]}):p[0]={x:+l[u-2],y:+l[u-1]}:u-4==c?p[3]=p[2]:c||(p[0]={x:+l[c],y:+l[c+1]}),d.push(["C",(-p[0].x+6*p[1].x+p[2].x)/6,(-p[0].y+6*p[1].y+p[2].y)/6,(p[1].x+6*p[2].x-p[3].x)/6,(p[1].y+6*p[2].y-p[3].y)/6,p[2].x,p[2].y])}return d}h.getRGB=Xt(function(l){if(!l||(l=V(l)).indexOf("-")+1)return{r:-1,g:-1,b:-1,hex:"none",error:1,toString:we};if(l=="none")return{r:-1,g:-1,b:-1,hex:"none",toString:we};!at[k](l.toLowerCase().substring(0,2))&&l.charAt()!="#"&&(l=de(l));var f,d,c,u,p,v,_=l.match(E);return _?(_[2]&&(c=F(_[2].substring(5),16),d=F(_[2].substring(3,5),16),f=F(_[2].substring(1,3),16)),_[3]&&(c=F((p=_[3].charAt(3))+p,16),d=F((p=_[3].charAt(2))+p,16),f=F((p=_[3].charAt(1))+p,16)),_[4]&&(v=_[4][ot](J),f=L(v[0]),v[0].slice(-1)=="%"&&(f*=2.55),d=L(v[1]),v[1].slice(-1)=="%"&&(d*=2.55),c=L(v[2]),v[2].slice(-1)=="%"&&(c*=2.55),_[1].toLowerCase().slice(0,4)=="rgba"&&(u=L(v[3])),v[3]&&v[3].slice(-1)=="%"&&(u/=100)),_[5]?(v=_[5][ot](J),f=L(v[0]),v[0].slice(-1)=="%"&&(f*=2.55),d=L(v[1]),v[1].slice(-1)=="%"&&(d*=2.55),c=L(v[2]),v[2].slice(-1)=="%"&&(c*=2.55),(v[0].slice(-3)=="deg"||v[0].slice(-1)=="°")&&(f/=360),_[1].toLowerCase().slice(0,4)=="hsba"&&(u=L(v[3])),v[3]&&v[3].slice(-1)=="%"&&(u/=100),h.hsb2rgb(f,d,c,u)):_[6]?(v=_[6][ot](J),f=L(v[0]),v[0].slice(-1)=="%"&&(f*=2.55),d=L(v[1]),v[1].slice(-1)=="%"&&(d*=2.55),c=L(v[2]),v[2].slice(-1)=="%"&&(c*=2.55),(v[0].slice(-3)=="deg"||v[0].slice(-1)=="°")&&(f/=360),_[1].toLowerCase().slice(0,4)=="hsla"&&(u=L(v[3])),v[3]&&v[3].slice(-1)=="%"&&(u/=100),h.hsl2rgb(f,d,c,u)):((_={r:f,g:d,b:c,toString:we}).hex="#"+(16777216|c|d<<8|f<<16).toString(16).slice(1),h.is(u,"finite")&&(_.opacity=u),_)):{r:-1,g:-1,b:-1,hex:"none",error:1,toString:we}},h),h.hsb=Xt(function(l,f,d){return h.hsb2rgb(l,f,d).hex}),h.hsl=Xt(function(l,f,d){return h.hsl2rgb(l,f,d).hex}),h.rgb=Xt(function(l,f,d){function c(u){return u+.5|0}return"#"+(16777216|c(d)|c(f)<<8|c(l)<<16).toString(16).slice(1)}),h.getColor=function(l){var f=this.getColor.start=this.getColor.start||{h:0,s:1,b:l||.75},d=this.hsb2rgb(f.h,f.s,f.b);return f.h+=.075,f.h>1&&(f.h=0,f.s-=.2,f.s<=0&&(this.getColor.start={h:0,s:1,b:f.b})),d.hex},h.getColor.reset=function(){delete this.start},h.parsePathString=function(l){if(!l)return null;var f=Qt(l);if(f.arr)return qt(f.arr);var d={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0},c=[];return h.is(l,it)&&h.is(l[0],it)&&(c=qt(l)),c.length||V(l).replace(yt,function(u,p,v){var _=[],S=p.toLowerCase();if(v.replace(wt,function(I,U){U&&_.push(+U)}),S=="m"&&_.length>2&&(c.push([p][O](_.splice(0,2))),S="l",p=p=="m"?"l":"L"),S=="r")c.push([p][O](_));else for(;_.length>=d[S]&&(c.push([p][O](_.splice(0,d[S]))),d[S]););}),c.toString=h._path2string,f.arr=qt(c),c},h.parseTransformString=Xt(function(l){if(!l)return null;var f=[];return h.is(l,it)&&h.is(l[0],it)&&(f=qt(l)),f.length||V(l).replace(Tt,function(d,c,u){var p=[];dt.call(c),u.replace(wt,function(v,_){_&&p.push(+_)}),f.push([c][O](p))}),f.toString=h._path2string,f},this,function(l){if(!l)return l;for(var f=[],d=0;d<l.length;d++){for(var c=[],u=0;u<l[d].length;u++)c.push(l[d][u]);f.push(c)}return f});var Qt=function(l){var f=Qt.ps=Qt.ps||{};return f[l]?f[l].sleep=100:f[l]={sleep:100},setTimeout(function(){for(var d in f)f[k](d)&&d!=l&&(f[d].sleep--,!f[d].sleep&&delete f[d])}),f[l]};function pe(l,f,d,c,u){return l*(l*(-3*f+9*d-9*c+3*u)+6*f-12*d+6*c)-3*f+3*d}function re(l,f,d,c,u,p,v,_,S){S==null&&(S=1);for(var I=(S=S>1?1:S<0?0:S)/2,U=[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816],W=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472],j=0,G=0;G<12;G++){var $=I*U[G]+I,Q=pe($,l,d,u,v),Z=pe($,f,c,p,_),H=Q*Q+Z*Z;j+=W[G]*ht.sqrt(H)}return I*j}function tn(l,f,d,c,u,p,v,_){if(!(pt(l,d)<ut(u,v)||ut(l,d)>pt(u,v)||pt(f,c)<ut(p,_)||ut(f,c)>pt(p,_))){var S=(l-d)*(p-_)-(f-c)*(u-v);if(S){var I=((l*c-f*d)*(u-v)-(l-d)*(u*_-p*v))/S,U=((l*c-f*d)*(p-_)-(f-c)*(u*_-p*v))/S,W=+I.toFixed(2),j=+U.toFixed(2);if(!(W<+ut(l,d).toFixed(2)||W>+pt(l,d).toFixed(2)||W<+ut(u,v).toFixed(2)||W>+pt(u,v).toFixed(2)||j<+ut(f,c).toFixed(2)||j>+pt(f,c).toFixed(2)||j<+ut(p,_).toFixed(2)||j>+pt(p,_).toFixed(2)))return{x:I,y:U}}}}function ke(l,f,d){var c=h.bezierBBox(l),u=h.bezierBBox(f);if(!h.isBBoxIntersect(c,u))return d?0:[];for(var p=re.apply(0,l),v=re.apply(0,f),_=pt(~~(p/5),1),S=pt(~~(v/5),1),I=[],U=[],W={},j=d?0:[],G=0;G<_+1;G++){var $=h.findDotsAtSegment.apply(h,l.concat(G/_));I.push({x:$.x,y:$.y,t:G/_})}for(G=0;G<S+1;G++)$=h.findDotsAtSegment.apply(h,f.concat(G/S)),U.push({x:$.x,y:$.y,t:G/S});for(G=0;G<_;G++)for(var Q=0;Q<S;Q++){var Z=I[G],H=I[G+1],lt=U[Q],tt=U[Q+1],rt=Pt(H.x-Z.x)<.001?"y":"x",et=Pt(tt.x-lt.x)<.001?"y":"x",bt=tn(Z.x,Z.y,H.x,H.y,lt.x,lt.y,tt.x,tt.y);if(bt){if(W[bt.x.toFixed(4)]==bt.y.toFixed(4))continue;W[bt.x.toFixed(4)]=bt.y.toFixed(4);var gt=Z.t+Pt((bt[rt]-Z[rt])/(H[rt]-Z[rt]))*(H.t-Z.t),_t=lt.t+Pt((bt[et]-lt[et])/(tt[et]-lt[et]))*(tt.t-lt.t);gt>=0&><=1.001&&_t>=0&&_t<=1.001&&(d?j++:j.push({x:bt.x,y:bt.y,t1:ut(gt,1),t2:ut(_t,1)}))}}return j}function He(l,f,d){l=h._path2curve(l),f=h._path2curve(f);for(var c,u,p,v,_,S,I,U,W,j,G=d?0:[],$=0,Q=l.length;$<Q;$++){var Z=l[$];if(Z[0]=="M")c=_=Z[1],u=S=Z[2];else{Z[0]=="C"?(W=[c,u].concat(Z.slice(1)),c=W[6],u=W[7]):(W=[c,u,c,u,_,S,_,S],c=_,u=S);for(var H=0,lt=f.length;H<lt;H++){var tt=f[H];if(tt[0]=="M")p=I=tt[1],v=U=tt[2];else{tt[0]=="C"?(j=[p,v].concat(tt.slice(1)),p=j[6],v=j[7]):(j=[p,v,p,v,I,U,I,U],p=I,v=U);var rt=ke(W,j,d);if(d)G+=rt;else{for(var et=0,bt=rt.length;et<bt;et++)rt[et].segment1=$,rt[et].segment2=H,rt[et].bez1=W,rt[et].bez2=j;G=G.concat(rt)}}}}}return G}h.findDotsAtSegment=function(l,f,d,c,u,p,v,_,S){var I=1-S,U=kt(I,3),W=kt(I,2),j=S*S,G=j*S,$=U*l+3*W*S*d+3*I*S*S*u+G*v,Q=U*f+3*W*S*c+3*I*S*S*p+G*_,Z=l+2*S*(d-l)+j*(u-2*d+l),H=f+2*S*(c-f)+j*(p-2*c+f),lt=d+2*S*(u-d)+j*(v-2*u+d),tt=c+2*S*(p-c)+j*(_-2*p+c),rt=I*l+S*d,et=I*f+S*c,bt=I*u+S*v,gt=I*p+S*_,_t=90-180*ht.atan2(Z-lt,H-tt)/Dt;return(Z>lt||H<tt)&&(_t+=180),{x:$,y:Q,m:{x:Z,y:H},n:{x:lt,y:tt},start:{x:rt,y:et},end:{x:bt,y:gt},alpha:_t}},h.bezierBBox=function(l,f,d,c,u,p,v,_){h.is(l,"array")||(l=[l,f,d,c,u,p,v,_]);var S=Ie.apply(null,l);return{x:S.min.x,y:S.min.y,x2:S.max.x,y2:S.max.y,width:S.max.x-S.min.x,height:S.max.y-S.min.y}},h.isPointInsideBBox=function(l,f,d){return f>=l.x&&f<=l.x2&&d>=l.y&&d<=l.y2},h.isBBoxIntersect=function(l,f){var d=h.isPointInsideBBox;return d(f,l.x,l.y)||d(f,l.x2,l.y)||d(f,l.x,l.y2)||d(f,l.x2,l.y2)||d(l,f.x,f.y)||d(l,f.x2,f.y)||d(l,f.x,f.y2)||d(l,f.x2,f.y2)||(l.x<f.x2&&l.x>f.x||f.x<l.x2&&f.x>l.x)&&(l.y<f.y2&&l.y>f.y||f.y<l.y2&&f.y>l.y)},h.pathIntersection=function(l,f){return He(l,f)},h.pathIntersectionNumber=function(l,f){return He(l,f,1)},h.isPointInsidePath=function(l,f,d){var c=h.pathBBox(l);return h.isPointInsideBBox(c,f,d)&&He(l,[["M",f,d],["H",c.x2+10]],1)%2==1},h._removedFactory=function(l){return function(){a("raphael.log",null,"Raphaël: you are calling to method “"+l+"” of removed object",l)}};var he=h.pathBBox=function(l){var f=Qt(l);if(f.bbox)return Wt(f.bbox);if(!l)return{x:0,y:0,width:0,height:0,x2:0,y2:0};for(var d,c=0,u=0,p=[],v=[],_=0,S=(l=en(l)).length;_<S;_++)if((d=l[_])[0]=="M")c=d[1],u=d[2],p.push(c),v.push(u);else{var I=Ie(c,u,d[1],d[2],d[3],d[4],d[5],d[6]);p=p[O](I.min.x,I.max.x),v=v[O](I.min.y,I.max.y),c=d[5],u=d[6]}var U=ut[R](0,p),W=ut[R](0,v),j=pt[R](0,p),G=pt[R](0,v),$=j-U,Q=G-W,Z={x:U,y:W,x2:j,y2:G,width:$,height:Q,cx:U+$/2,cy:W+Q/2};return f.bbox=Wt(Z),Z},qt=function(l){var f=Wt(l);return f.toString=h._path2string,f},fi=h._pathToRelative=function(l){var f=Qt(l);if(f.rel)return qt(f.rel);h.is(l,it)&&h.is(l&&l[0],it)||(l=h.parsePathString(l));var d=[],c=0,u=0,p=0,v=0,_=0;l[0][0]=="M"&&(p=c=l[0][1],v=u=l[0][2],_++,d.push(["M",c,u]));for(var S=_,I=l.length;S<I;S++){var U=d[S]=[],W=l[S];if(W[0]!=dt.call(W[0]))switch(U[0]=dt.call(W[0]),U[0]){case"a":U[1]=W[1],U[2]=W[2],U[3]=W[3],U[4]=W[4],U[5]=W[5],U[6]=+(W[6]-c).toFixed(3),U[7]=+(W[7]-u).toFixed(3);break;case"v":U[1]=+(W[1]-u).toFixed(3);break;case"m":p=W[1],v=W[2];default:for(var j=1,G=W.length;j<G;j++)U[j]=+(W[j]-(j%2?c:u)).toFixed(3)}else{U=d[S]=[],W[0]=="m"&&(p=W[1]+c,v=W[2]+u);for(var $=0,Q=W.length;$<Q;$++)d[S][$]=W[$]}var Z=d[S].length;switch(d[S][0]){case"z":c=p,u=v;break;case"h":c+=+d[S][Z-1];break;case"v":u+=+d[S][Z-1];break;default:c+=+d[S][Z-2],u+=+d[S][Z-1]}}return d.toString=h._path2string,f.rel=qt(d),d},We=h._pathToAbsolute=function(l){var f=Qt(l);if(f.abs)return qt(f.abs);if(h.is(l,it)&&h.is(l&&l[0],it)||(l=h.parsePathString(l)),!l||!l.length)return[["M",0,0]];var d=[],c=0,u=0,p=0,v=0,_=0;l[0][0]=="M"&&(p=c=+l[0][1],v=u=+l[0][2],_++,d[0]=["M",c,u]);for(var S,I,U=l.length==3&&l[0][0]=="M"&&l[1][0].toUpperCase()=="R"&&l[2][0].toUpperCase()=="Z",W=_,j=l.length;W<j;W++){if(d.push(S=[]),(I=l[W])[0]!=B.call(I[0]))switch(S[0]=B.call(I[0]),S[0]){case"A":S[1]=I[1],S[2]=I[2],S[3]=I[3],S[4]=I[4],S[5]=I[5],S[6]=+(I[6]+c),S[7]=+(I[7]+u);break;case"V":S[1]=+I[1]+u;break;case"H":S[1]=+I[1]+c;break;case"R":for(var G=[c,u][O](I.slice(1)),$=2,Q=G.length;$<Q;$++)G[$]=+G[$]+c,G[++$]=+G[$]+u;d.pop(),d=d[O](Xe(G,U));break;case"M":p=+I[1]+c,v=+I[2]+u;default:for($=1,Q=I.length;$<Q;$++)S[$]=+I[$]+($%2?c:u)}else if(I[0]=="R")G=[c,u][O](I.slice(1)),d.pop(),d=d[O](Xe(G,U)),S=["R"][O](I.slice(-2));else for(var Z=0,H=I.length;Z<H;Z++)S[Z]=I[Z];switch(S[0]){case"Z":c=p,u=v;break;case"H":c=S[1];break;case"V":u=S[1];break;case"M":p=S[S.length-2],v=S[S.length-1];default:c=S[S.length-2],u=S[S.length-1]}}return d.toString=h._path2string,f.abs=qt(d),d},Ae=function(l,f,d,c){return[l,f,d,c,d,c]},xe=function(l,f,d,c,u,p){return[1/3*l+2/3*d,1/3*f+2/3*c,1/3*u+2/3*d,1/3*p+2/3*c,u,p]},gn=function(l,f,d,c,u,p,v,_,S,I){var U,W=120*Dt/180,j=Dt/180*(+u||0),G=[],$=Xt(function(Ks,Qs,Ci){return{x:Ks*ht.cos(Ci)-Qs*ht.sin(Ci),y:Ks*ht.sin(Ci)+Qs*ht.cos(Ci)}});if(I)gt=I[0],_t=I[1],et=I[2],bt=I[3];else{l=(U=$(l,f,-j)).x,f=U.y,_=(U=$(_,S,-j)).x,S=U.y;var Q=(l-_)/2,Z=(f-S)/2,H=Q*Q/(d*d)+Z*Z/(c*c);H>1&&(d*=H=ht.sqrt(H),c*=H);var lt=d*d,tt=c*c,rt=(p==v?-1:1)*ht.sqrt(Pt((lt*tt-lt*Z*Z-tt*Q*Q)/(lt*Z*Z+tt*Q*Q))),et=rt*d*Z/c+(l+_)/2,bt=rt*-c*Q/d+(f+S)/2,gt=ht.asin(((f-bt)/c).toFixed(9)),_t=ht.asin(((S-bt)/c).toFixed(9));(gt=l<et?Dt-gt:gt)<0&&(gt=2*Dt+gt),(_t=_<et?Dt-_t:_t)<0&&(_t=2*Dt+_t),v&>>_t&&(gt-=2*Dt),!v&&_t>gt&&(_t-=2*Dt)}var Tn=_t-gt;if(Pt(Tn)>W){var Vn=_t,ne=_,_e=S;_t=gt+W*(v&&_t>gt?1:-1),_=et+d*ht.cos(_t),S=bt+c*ht.sin(_t),G=gn(_,S,d,c,u,0,v,ne,_e,[_t,Vn,et,bt])}Tn=_t-gt;var Sn=ht.cos(gt),En=ht.sin(gt),bi=ht.cos(_t),Be=ht.sin(_t),an=ht.tan(Tn/4),_i=4/3*d*an,Ys=4/3*c*an,qs=[l,f],Pn=[l+_i*En,f-Ys*Sn],$s=[_+_i*Be,S-Ys*bi],Js=[_,S];if(Pn[0]=2*qs[0]-Pn[0],Pn[1]=2*qs[1]-Pn[1],I)return[Pn,$s,Js][O](G);for(var Zs=[],Je=0,$c=(G=[Pn,$s,Js][O](G).join()[ot](",")).length;Je<$c;Je++)Zs[Je]=Je%2?$(G[Je-1],G[Je],j).y:$(G[Je],G[Je+1],j).x;return Zs},Me=function(l,f,d,c,u,p,v,_,S){var I=1-S;return{x:kt(I,3)*l+3*kt(I,2)*S*d+3*I*S*S*u+kt(S,3)*v,y:kt(I,3)*f+3*kt(I,2)*S*c+3*I*S*S*p+kt(S,3)*_}},Ie=Xt(function(l,f,d,c,u,p,v,_){var S,I=u-2*d+l-(v-2*u+d),U=2*(d-l)-2*(u-d),W=l-d,j=(-U+ht.sqrt(U*U-4*I*W))/2/I,G=(-U-ht.sqrt(U*U-4*I*W))/2/I,$=[f,_],Q=[l,v];return Pt(j)>"1e12"&&(j=.5),Pt(G)>"1e12"&&(G=.5),j>0&&j<1&&(S=Me(l,f,d,c,u,p,v,_,j),Q.push(S.x),$.push(S.y)),G>0&&G<1&&(S=Me(l,f,d,c,u,p,v,_,G),Q.push(S.x),$.push(S.y)),I=p-2*c+f-(_-2*p+c),W=f-c,j=(-(U=2*(c-f)-2*(p-c))+ht.sqrt(U*U-4*I*W))/2/I,G=(-U-ht.sqrt(U*U-4*I*W))/2/I,Pt(j)>"1e12"&&(j=.5),Pt(G)>"1e12"&&(G=.5),j>0&&j<1&&(S=Me(l,f,d,c,u,p,v,_,j),Q.push(S.x),$.push(S.y)),G>0&&G<1&&(S=Me(l,f,d,c,u,p,v,_,G),Q.push(S.x),$.push(S.y)),{min:{x:ut[R](0,Q),y:ut[R](0,$)},max:{x:pt[R](0,Q),y:pt[R](0,$)}}}),en=h._path2curve=Xt(function(l,f){var d=!f&&Qt(l);if(!f&&d.curve)return qt(d.curve);for(var c=We(l),u=f&&We(f),p={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},v={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},_=function(rt,et,bt){var gt,_t;if(!rt)return["C",et.x,et.y,et.x,et.y,et.x,et.y];switch(!(rt[0]in{T:1,Q:1})&&(et.qx=et.qy=null),rt[0]){case"M":et.X=rt[1],et.Y=rt[2];break;case"A":rt=["C"][O](gn[R](0,[et.x,et.y][O](rt.slice(1))));break;case"S":bt=="C"||bt=="S"?(gt=2*et.x-et.bx,_t=2*et.y-et.by):(gt=et.x,_t=et.y),rt=["C",gt,_t][O](rt.slice(1));break;case"T":bt=="Q"||bt=="T"?(et.qx=2*et.x-et.qx,et.qy=2*et.y-et.qy):(et.qx=et.x,et.qy=et.y),rt=["C"][O](xe(et.x,et.y,et.qx,et.qy,rt[1],rt[2]));break;case"Q":et.qx=rt[1],et.qy=rt[2],rt=["C"][O](xe(et.x,et.y,rt[1],rt[2],rt[3],rt[4]));break;case"L":rt=["C"][O](Ae(et.x,et.y,rt[1],rt[2]));break;case"H":rt=["C"][O](Ae(et.x,et.y,rt[1],et.y));break;case"V":rt=["C"][O](Ae(et.x,et.y,et.x,rt[1]));break;case"Z":rt=["C"][O](Ae(et.x,et.y,et.X,et.Y))}return rt},S=function(rt,et){if(rt[et].length>7){rt[et].shift();for(var bt=rt[et];bt.length;)U[et]="A",u&&(W[et]="A"),rt.splice(et++,0,["C"][O](bt.splice(0,6)));rt.splice(et,1),Q=pt(c.length,u&&u.length||0)}},I=function(rt,et,bt,gt,_t){rt&&et&&rt[_t][0]=="M"&&et[_t][0]!="M"&&(et.splice(_t,0,["M",gt.x,gt.y]),bt.bx=0,bt.by=0,bt.x=rt[_t][1],bt.y=rt[_t][2],Q=pt(c.length,u&&u.length||0))},U=[],W=[],j="",G="",$=0,Q=pt(c.length,u&&u.length||0);$<Q;$++){c[$]&&(j=c[$][0]),j!="C"&&(U[$]=j,$&&(G=U[$-1])),c[$]=_(c[$],p,G),U[$]!="A"&&j=="C"&&(U[$]="C"),S(c,$),u&&(u[$]&&(j=u[$][0]),j!="C"&&(W[$]=j,$&&(G=W[$-1])),u[$]=_(u[$],v,G),W[$]!="A"&&j=="C"&&(W[$]="C"),S(u,$)),I(c,u,p,v,$),I(u,c,v,p,$);var Z=c[$],H=u&&u[$],lt=Z.length,tt=u&&H.length;p.x=Z[lt-2],p.y=Z[lt-1],p.bx=L(Z[lt-4])||p.x,p.by=L(Z[lt-3])||p.y,v.bx=u&&(L(H[tt-4])||v.x),v.by=u&&(L(H[tt-3])||v.y),v.x=u&&H[tt-2],v.y=u&&H[tt-1]}return u||(d.curve=qt(c)),u?[c,u]:c},null,qt),vn=(h._parseDots=Xt(function(l){for(var f=[],d=0,c=l.length;d<c;d++){var u={},p=l[d].match(/^([^:]*):?([\d\.]*)/);if(u.color=h.getRGB(p[1]),u.color.error)return null;u.opacity=u.color.opacity,u.color=u.color.hex,p[2]&&(u.offset=p[2]+"%"),f.push(u)}for(d=1,c=f.length-1;d<c;d++)if(!f[d].offset){for(var v=L(f[d-1].offset||0),_=0,S=d+1;S<c;S++)if(f[S].offset){_=f[S].offset;break}_||(_=100,S=c);for(var I=((_=L(_))-v)/(S-d+1);d<S;d++)v+=I,f[d].offset=v+"%"}return f}),h._tear=function(l,f){l==f.top&&(f.top=l.prev),l==f.bottom&&(f.bottom=l.next),l.next&&(l.next.prev=l.prev),l.prev&&(l.prev.next=l.next)}),di=(h._tofront=function(l,f){f.top!==l&&(vn(l,f),l.next=null,l.prev=f.top,f.top.next=l,f.top=l)},h._toback=function(l,f){f.bottom!==l&&(vn(l,f),l.next=f.bottom,l.prev=null,f.bottom.prev=l,f.bottom=l)},h._insertafter=function(l,f,d){vn(l,d),f==d.top&&(d.top=l),f.next&&(f.next.prev=l),l.next=f.next,l.prev=f,f.next=l},h._insertbefore=function(l,f,d){vn(l,d),f==d.bottom&&(d.bottom=l),f.prev&&(f.prev.next=l),l.prev=f.prev,f.prev=l,l.next=f},h.toMatrix=function(l,f){var d=he(l),c={_:{transform:Y},getBBox:function(){return d}};return yn(c,f),c.matrix}),yn=(h.transformPath=function(l,f){return Ut(l,di(l,f))},h._extractTransform=function(l,f){if(f==null)return l._.transform;f=V(f).replace(/\.{3}|\u2026/g,l._.transform||Y);var d,c,u=h.parseTransformString(f),p=0,v=1,_=1,S=l._,I=new Le;if(S.transform=u||[],u)for(var U=0,W=u.length;U<W;U++){var j,G,$,Q,Z,H=u[U],lt=H.length,tt=V(H[0]).toLowerCase(),rt=H[0]!=tt,et=rt?I.invert():0;tt=="t"&<==3?rt?(j=et.x(0,0),G=et.y(0,0),$=et.x(H[1],H[2]),Q=et.y(H[1],H[2]),I.translate($-j,Q-G)):I.translate(H[1],H[2]):tt=="r"?lt==2?(Z=Z||l.getBBox(1),I.rotate(H[1],Z.x+Z.width/2,Z.y+Z.height/2),p+=H[1]):lt==4&&(rt?($=et.x(H[2],H[3]),Q=et.y(H[2],H[3]),I.rotate(H[1],$,Q)):I.rotate(H[1],H[2],H[3]),p+=H[1]):tt=="s"?lt==2||lt==3?(Z=Z||l.getBBox(1),I.scale(H[1],H[lt-1],Z.x+Z.width/2,Z.y+Z.height/2),v*=H[1],_*=H[lt-1]):lt==5&&(rt?($=et.x(H[3],H[4]),Q=et.y(H[3],H[4]),I.scale(H[1],H[2],$,Q)):I.scale(H[1],H[2],H[3],H[4]),v*=H[1],_*=H[2]):tt=="m"&<==7&&I.add(H[1],H[2],H[3],H[4],H[5],H[6]),S.dirtyT=1,l.matrix=I}l.matrix=I,S.sx=v,S.sy=_,S.deg=p,S.dx=d=I.e,S.dy=c=I.f,v==1&&_==1&&!p&&S.bbox?(S.bbox.x+=+d,S.bbox.y+=+c):S.dirtyT=1}),pi=function(l){var f=l[0];switch(f.toLowerCase()){case"t":return[f,0,0];case"m":return[f,1,0,0,1,0,0];case"r":return l.length==4?[f,0,l[2],l[3]]:[f,0];case"s":return l.length==5?[f,1,1,l[3],l[4]]:l.length==3?[f,1,1]:[f,1]}},mi=h._equaliseTransform=function(l,f){f=V(f).replace(/\.{3}|\u2026/g,l),l=h.parseTransformString(l)||[],f=h.parseTransformString(f)||[];for(var d,c,u,p,v=pt(l.length,f.length),_=[],S=[],I=0;I<v;I++){if(u=l[I]||pi(f[I]),p=f[I]||pi(u),u[0]!=p[0]||u[0].toLowerCase()=="r"&&(u[2]!=p[2]||u[3]!=p[3])||u[0].toLowerCase()=="s"&&(u[3]!=p[3]||u[4]!=p[4]))return;for(_[I]=[],S[I]=[],d=0,c=pt(u.length,p.length);d<c;d++)d in u&&(_[I][d]=u[d]),d in p&&(S[I][d]=p[d])}return{from:_,to:S}};function Le(l,f,d,c,u,p){l!=null?(this.a=+l,this.b=+f,this.c=+d,this.d=+c,this.e=+u,this.f=+p):(this.a=1,this.b=0,this.c=0,this.d=1,this.e=0,this.f=0)}h._getContainer=function(l,f,d,c){var u;if((u=c!=null||h.is(l,"object")?l:P.doc.getElementById(l))!=null)return u.tagName?f==null?{container:u,width:u.style.pixelWidth||u.offsetWidth,height:u.style.pixelHeight||u.offsetHeight}:{container:u,width:f,height:d}:{container:1,x:l,y:f,width:d,height:c}},h.pathToRelative=fi,h._engine={},h.path2curve=en,h.matrix=function(l,f,d,c,u,p){return new Le(l,f,d,c,u,p)},function(l){function f(c){return c[0]*c[0]+c[1]*c[1]}function d(c){var u=ht.sqrt(f(c));c[0]&&(c[0]/=u),c[1]&&(c[1]/=u)}l.add=function(c,u,p,v,_,S){var I,U,W,j,G=[[],[],[]],$=[[this.a,this.c,this.e],[this.b,this.d,this.f],[0,0,1]],Q=[[c,p,_],[u,v,S],[0,0,1]];for(c&&c instanceof Le&&(Q=[[c.a,c.c,c.e],[c.b,c.d,c.f],[0,0,1]]),I=0;I<3;I++)for(U=0;U<3;U++){for(j=0,W=0;W<3;W++)j+=$[I][W]*Q[W][U];G[I][U]=j}this.a=G[0][0],this.b=G[1][0],this.c=G[0][1],this.d=G[1][1],this.e=G[0][2],this.f=G[1][2]},l.invert=function(){var c=this,u=c.a*c.d-c.b*c.c;return new Le(c.d/u,-c.b/u,-c.c/u,c.a/u,(c.c*c.f-c.d*c.e)/u,(c.b*c.e-c.a*c.f)/u)},l.clone=function(){return new Le(this.a,this.b,this.c,this.d,this.e,this.f)},l.translate=function(c,u){this.add(1,0,0,1,c,u)},l.scale=function(c,u,p,v){u==null&&(u=c),(p||v)&&this.add(1,0,0,1,p,v),this.add(c,0,0,u,0,0),(p||v)&&this.add(1,0,0,1,-p,-v)},l.rotate=function(c,u,p){c=h.rad(c),u=u||0,p=p||0;var v=+ht.cos(c).toFixed(9),_=+ht.sin(c).toFixed(9);this.add(v,_,-_,v,u,p),this.add(1,0,0,1,-u,-p)},l.x=function(c,u){return c*this.a+u*this.c+this.e},l.y=function(c,u){return c*this.b+u*this.d+this.f},l.get=function(c){return+this[V.fromCharCode(97+c)].toFixed(4)},l.toString=function(){return h.svg?"matrix("+[this.get(0),this.get(1),this.get(2),this.get(3),this.get(4),this.get(5)].join()+")":[this.get(0),this.get(2),this.get(1),this.get(3),0,0].join()},l.toFilter=function(){return"progid:DXImageTransform.Microsoft.Matrix(M11="+this.get(0)+", M12="+this.get(2)+", M21="+this.get(1)+", M22="+this.get(3)+", Dx="+this.get(4)+", Dy="+this.get(5)+", sizingmethod='auto expand')"},l.offset=function(){return[this.e.toFixed(4),this.f.toFixed(4)]},l.split=function(){var c={};c.dx=this.e,c.dy=this.f;var u=[[this.a,this.c],[this.b,this.d]];c.scalex=ht.sqrt(f(u[0])),d(u[0]),c.shear=u[0][0]*u[1][0]+u[0][1]*u[1][1],u[1]=[u[1][0]-u[0][0]*c.shear,u[1][1]-u[0][1]*c.shear],c.scaley=ht.sqrt(f(u[1])),d(u[1]),c.shear/=c.scaley;var p=-u[0][1],v=u[1][1];return v<0?(c.rotate=h.deg(ht.acos(v)),p<0&&(c.rotate=360-c.rotate)):c.rotate=h.deg(ht.asin(p)),c.isSimple=!(+c.shear.toFixed(9)||c.scalex.toFixed(9)!=c.scaley.toFixed(9)&&c.rotate),c.isSuperSimple=!+c.shear.toFixed(9)&&c.scalex.toFixed(9)==c.scaley.toFixed(9)&&!c.rotate,c.noRotation=!+c.shear.toFixed(9)&&!c.rotate,c},l.toTransformString=function(c){var u=c||this[ot]();return u.isSimple?(u.scalex=+u.scalex.toFixed(4),u.scaley=+u.scaley.toFixed(4),u.rotate=+u.rotate.toFixed(4),(u.dx||u.dy?"t"+[u.dx,u.dy]:Y)+(u.scalex!=1||u.scaley!=1?"s"+[u.scalex,u.scaley,0,0]:Y)+(u.rotate?"r"+[u.rotate,0,0]:Y)):"m"+[this.get(0),this.get(1),this.get(2),this.get(3),this.get(4),this.get(5)]}}(Le.prototype);for(var gi=function(){this.returnValue=!1},vi=function(){return this.originalEvent.preventDefault()},yi=function(){this.cancelBubble=!0},wi=function(){return this.originalEvent.stopPropagation()},wn=function(l){var f=P.doc.documentElement.scrollTop||P.doc.body.scrollTop,d=P.doc.documentElement.scrollLeft||P.doc.body.scrollLeft;return{x:l.clientX+d,y:l.clientY+f}},De=P.doc.addEventListener?function(l,f,d,c){var u=function(v){var _=wn(v);return d.call(c,v,_.x,_.y)};if(l.addEventListener(f,u,!1),X&&vt[f]){var p=function(v){for(var _=wn(v),S=v,I=0,U=v.targetTouches&&v.targetTouches.length;I<U;I++)if(v.targetTouches[I].target==l){(v=v.targetTouches[I]).originalEvent=S,v.preventDefault=vi,v.stopPropagation=wi;break}return d.call(c,v,_.x,_.y)};l.addEventListener(vt[f],p,!1)}return function(){return l.removeEventListener(f,u,!1),X&&vt[f]&&l.removeEventListener(vt[f],p,!1),!0}}:P.doc.attachEvent?function(l,f,d,c){var u=function(p){p=p||P.win.event;var v=P.doc.documentElement.scrollTop||P.doc.body.scrollTop,_=P.doc.documentElement.scrollLeft||P.doc.body.scrollLeft,S=p.clientX+_,I=p.clientY+v;return p.preventDefault=p.preventDefault||gi,p.stopPropagation=p.stopPropagation||yi,d.call(c,p,S,I)};return l.attachEvent("on"+f,u),function(){return l.detachEvent("on"+f,u),!0}}:void 0,te=[],Re=function(l){for(var f,d=l.clientX,c=l.clientY,u=P.doc.documentElement.scrollTop||P.doc.body.scrollTop,p=P.doc.documentElement.scrollLeft||P.doc.body.scrollLeft,v=te.length;v--;){if(f=te[v],X&&l.touches){for(var _,S=l.touches.length;S--;)if((_=l.touches[S]).identifier==f.el._drag.id){d=_.clientX,c=_.clientY,(l.originalEvent?l.originalEvent:l).preventDefault();break}}else l.preventDefault();var I,U=f.el.node,W=U.nextSibling,j=U.parentNode,G=U.style.display;P.win.opera&&j.removeChild(U),U.style.display="none",I=f.el.paper.getElementByPoint(d,c),U.style.display=G,P.win.opera&&(W?j.insertBefore(U,W):j.appendChild(U)),I&&a("raphael.drag.over."+f.el.id,f.el,I),d+=p,c+=u,a("raphael.drag.move."+f.el.id,f.move_scope||f.el,d-f.el._drag.x,c-f.el._drag.y,d,c,l)}},Ye=function(l){h.unmousemove(Re).unmouseup(Ye);for(var f,d=te.length;d--;)(f=te[d]).el._drag={},a("raphael.drag.end."+f.el.id,f.end_scope||f.start_scope||f.move_scope||f.el,l);te=[]},Lt=h.el={},xi=ct.length;xi--;)(function(l){h[l]=Lt[l]=function(f,d){return h.is(f,"function")&&(this.events=this.events||[],this.events.push({name:l,f,unbind:De(this.shape||this.node||P.doc,l,f,d||this)})),this},h["un"+l]=Lt["un"+l]=function(f){for(var d=this.events||[],c=d.length;c--;)d[c].name!=l||!h.is(f,"undefined")&&d[c].f!=f||(d[c].unbind(),d.splice(c,1),!d.length&&delete this.events);return this}})(ct[xi]);Lt.data=function(l,f){var d=Et[this.id]=Et[this.id]||{};if(arguments.length==0)return d;if(arguments.length==1){if(h.is(l,"object")){for(var c in l)l[k](c)&&this.data(c,l[c]);return this}return a("raphael.data.get."+this.id,this,d[l],l),d[l]}return d[l]=f,a("raphael.data.set."+this.id,this,f,l),this},Lt.removeData=function(l){return l==null?delete Et[this.id]:Et[this.id]&&delete Et[this.id][l],this},Lt.getData=function(){return Wt(Et[this.id]||{})},Lt.hover=function(l,f,d,c){return this.mouseover(l,d).mouseout(f,c||d)},Lt.unhover=function(l,f){return this.unmouseover(l).unmouseout(f)};var qe=[];Lt.drag=function(l,f,d,c,u,p){function v(_){(_.originalEvent||_).preventDefault();var S=_.clientX,I=_.clientY,U=P.doc.documentElement.scrollTop||P.doc.body.scrollTop,W=P.doc.documentElement.scrollLeft||P.doc.body.scrollLeft;if(this._drag.id=_.identifier,X&&_.touches){for(var j,G=_.touches.length;G--;)if(j=_.touches[G],this._drag.id=j.identifier,j.identifier==this._drag.id){S=j.clientX,I=j.clientY;break}}this._drag.x=S+W,this._drag.y=I+U,!te.length&&h.mousemove(Re).mouseup(Ye),te.push({el:this,move_scope:c,start_scope:u,end_scope:p}),f&&a.on("raphael.drag.start."+this.id,f),l&&a.on("raphael.drag.move."+this.id,l),d&&a.on("raphael.drag.end."+this.id,d),a("raphael.drag.start."+this.id,u||c||this,this._drag.x,this._drag.y,_)}return this._drag={},qe.push({el:this,start:v}),this.mousedown(v),this},Lt.onDragOver=function(l){l?a.on("raphael.drag.over."+this.id,l):a.unbind("raphael.drag.over."+this.id)},Lt.undrag=function(){for(var l=qe.length;l--;)qe[l].el==this&&(this.unmousedown(qe[l].start),qe.splice(l,1),a.unbind("raphael.drag.*."+this.id));!qe.length&&h.unmousemove(Re).unmouseup(Ye),te=[]},g.circle=function(l,f,d){var c=h._engine.circle(this,l||0,f||0,d||0);return this.__set__&&this.__set__.push(c),c},g.rect=function(l,f,d,c,u){var p=h._engine.rect(this,l||0,f||0,d||0,c||0,u||0);return this.__set__&&this.__set__.push(p),p},g.ellipse=function(l,f,d,c){var u=h._engine.ellipse(this,l||0,f||0,d||0,c||0);return this.__set__&&this.__set__.push(u),u},g.path=function(l){l&&!h.is(l,"string")&&!h.is(l[0],it)&&(l+=Y);var f=h._engine.path(h.format[R](h,arguments),this);return this.__set__&&this.__set__.push(f),f},g.image=function(l,f,d,c,u){var p=h._engine.image(this,l||"about:blank",f||0,d||0,c||0,u||0);return this.__set__&&this.__set__.push(p),p},g.text=function(l,f,d){var c=h._engine.text(this,l||0,f||0,V(d));return this.__set__&&this.__set__.push(c),c},g.set=function(l){!h.is(l,"array")&&(l=Array.prototype.splice.call(arguments,0,arguments.length));var f=new rn(l);return this.__set__&&this.__set__.push(f),f.paper=this,f.type="set",f},g.setStart=function(l){this.__set__=l||this.set()},g.setFinish=function(l){var f=this.__set__;return delete this.__set__,f},g.getSize=function(){var l=this.canvas.parentNode;return{width:l.offsetWidth,height:l.offsetHeight}},g.setSize=function(l,f){return h._engine.setSize.call(this,l,f)},g.setViewBox=function(l,f,d,c,u){return h._engine.setViewBox.call(this,l,f,d,c,u)},g.top=g.bottom=null,g.raphael=h;function nn(){return this.x+nt+this.y+nt+this.width+" × "+this.height}g.getElementByPoint=function(l,f){var d,c,u,p,v,_,S,I=this.canvas,U=P.doc.elementFromPoint(l,f);if(P.win.opera&&U.tagName=="svg"){var W=(c=(d=I).getBoundingClientRect(),u=d.ownerDocument,p=u.body,v=u.documentElement,_=v.clientTop||p.clientTop||0,S=v.clientLeft||p.clientLeft||0,{y:c.top+(P.win.pageYOffset||v.scrollTop||p.scrollTop)-_,x:c.left+(P.win.pageXOffset||v.scrollLeft||p.scrollLeft)-S}),j=I.createSVGRect();j.x=l-W.x,j.y=f-W.y,j.width=j.height=1;var G=I.getIntersectionList(j,null);G.length&&(U=G[G.length-1])}if(!U)return null;for(;U.parentNode&&U!=I.parentNode&&!U.raphael;)U=U.parentNode;return U==this.canvas.parentNode&&(U=I),U=U&&U.raphael?this.getById(U.raphaelid):null},g.getElementsByBBox=function(l){var f=this.set();return this.forEach(function(d){h.isBBoxIntersect(d.getBBox(),l)&&f.push(d)}),f},g.getById=function(l){for(var f=this.bottom;f;){if(f.id==l)return f;f=f.next}return null},g.forEach=function(l,f){for(var d=this.bottom;d;){if(l.call(f,d)===!1)return this;d=d.next}return this},g.getElementsByPoint=function(l,f){var d=this.set();return this.forEach(function(c){c.isPointInside(l,f)&&d.push(c)}),d},Lt.isPointInside=function(l,f){var d=this.realPath=It[this.type](this);return this.attr("transform")&&this.attr("transform").length&&(d=h.transformPath(d,this.attr("transform"))),h.isPointInsidePath(d,l,f)},Lt.getBBox=function(l){if(this.removed)return{};var f=this._;return l?(!f.dirty&&f.bboxwt||(this.realPath=It[this.type](this),f.bboxwt=he(this.realPath),f.bboxwt.toString=nn,f.dirty=0),f.bboxwt):((f.dirty||f.dirtyT||!f.bbox)&&(!f.dirty&&this.realPath||(f.bboxwt=0,this.realPath=It[this.type](this)),f.bbox=he(Ut(this.realPath,this.matrix)),f.bbox.toString=nn,f.dirty=f.dirtyT=0),f.bbox)},Lt.clone=function(){if(this.removed)return null;var l=this.paper[this.type]().attr(this.attr());return this.__set__&&this.__set__.push(l),l},Lt.glow=function(l){if(this.type=="text")return null;var f={width:((l=l||{}).width||10)+(+this.attr("stroke-width")||1),fill:l.fill||!1,opacity:l.opacity==null?.5:l.opacity,offsetx:l.offsetx||0,offsety:l.offsety||0,color:l.color||"#000"},d=f.width/2,c=this.paper,u=c.set(),p=this.realPath||It[this.type](this);p=this.matrix?Ut(p,this.matrix):p;for(var v=1;v<d+1;v++)u.push(c.path(p).attr({stroke:f.color,fill:f.fill?f.color:"none","stroke-linejoin":"round","stroke-linecap":"round","stroke-width":+(f.width/d*v).toFixed(3),opacity:+(f.opacity/d).toFixed(3)}));return u.insertBefore(this).translate(f.offsetx,f.offsety)};var $t=function(l,f,d,c,u,p,v,_,S){return S==null?re(l,f,d,c,u,p,v,_):h.findDotsAtSegment(l,f,d,c,u,p,v,_,function(I,U,W,j,G,$,Q,Z,H){if(!(H<0||re(I,U,W,j,G,$,Q,Z)<H)){var lt,tt=.5,rt=1-tt;for(lt=re(I,U,W,j,G,$,Q,Z,rt);Pt(lt-H)>.01;)lt=re(I,U,W,j,G,$,Q,Z,rt+=(lt<H?1:-1)*(tt/=2));return rt}}(l,f,d,c,u,p,v,_,S))},be=function(l,f){return function(d,c,u){for(var p,v,_,S,I,U="",W={},j=0,G=0,$=(d=en(d)).length;G<$;G++){if((_=d[G])[0]=="M")p=+_[1],v=+_[2];else{if(j+(S=$t(p,v,_[1],_[2],_[3],_[4],_[5],_[6]))>c){if(f&&!W.start){if(U+=["C"+(I=$t(p,v,_[1],_[2],_[3],_[4],_[5],_[6],c-j)).start.x,I.start.y,I.m.x,I.m.y,I.x,I.y],u)return U;W.start=U,U=["M"+I.x,I.y+"C"+I.n.x,I.n.y,I.end.x,I.end.y,_[5],_[6]].join(),j+=S,p=+_[5],v=+_[6];continue}if(!l&&!f)return{x:(I=$t(p,v,_[1],_[2],_[3],_[4],_[5],_[6],c-j)).x,y:I.y,alpha:I.alpha}}j+=S,p=+_[5],v=+_[6]}U+=_.shift()+_}return W.end=U,(I=l?j:f?W:h.findDotsAtSegment(p,v,_[0],_[1],_[2],_[3],_[4],_[5],1)).alpha&&(I={x:I.x,y:I.y,alpha:I.alpha}),I}},me=be(1),ce=be(),Oe=be(0,1);h.getTotalLength=me,h.getPointAtLength=ce,h.getSubpath=function(l,f,d){if(this.getTotalLength(l)-d<1e-6)return Oe(l,f).end;var c=Oe(l,d,1);return f?Oe(c,f).end:c},Lt.getTotalLength=function(){var l=this.getPath();if(l)return this.node.getTotalLength?this.node.getTotalLength():me(l)},Lt.getPointAtLength=function(l){var f=this.getPath();if(f)return ce(f,l)},Lt.getPath=function(){var l,f=h._getPath[this.type];if(this.type!="text"&&this.type!="set")return f&&(l=f(this)),l},Lt.getSubpath=function(l,f){var d=this.getPath();if(d)return h.getSubpath(d,l,f)};var Ft=h.easing_formulas={linear:function(l){return l},"<":function(l){return kt(l,1.7)},">":function(l){return kt(l,.48)},"<>":function(l){var f=.48-l/1.04,d=ht.sqrt(.1734+f*f),c=d-f,u=-d-f,p=kt(Pt(c),1/3)*(c<0?-1:1)+kt(Pt(u),1/3)*(u<0?-1:1)+.5;return 3*(1-p)*p*p+p*p*p},backIn:function(l){var f=1.70158;return l*l*((f+1)*l-f)},backOut:function(l){var f=1.70158;return(l-=1)*l*((f+1)*l+f)+1},elastic:function(l){return l==!!l?l:kt(2,-10*l)*ht.sin(2*Dt*(l-.075)/.3)+1},bounce:function(l){var f=7.5625,d=2.75;return l<1/d?f*l*l:l<2/d?f*(l-=1.5/d)*l+.75:l<2.5/d?f*(l-=2.25/d)*l+.9375:f*(l-=2.625/d)*l+.984375}};Ft.easeIn=Ft["ease-in"]=Ft["<"],Ft.easeOut=Ft["ease-out"]=Ft[">"],Ft.easeInOut=Ft["ease-in-out"]=Ft["<>"],Ft["back-in"]=Ft.backIn,Ft["back-out"]=Ft.backOut;var xt=[],Gn=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(l){setTimeout(l,16)},xn=function(){for(var l=+new Date,f=0;f<xt.length;f++){var d=xt[f];if(!d.el.removed&&!d.paused){var c,u,p=l-d.start,v=d.ms,_=d.easing,S=d.from,I=d.diff,U=d.to,W=(d.t,d.el),j={},G={};if(d.initstatus?(p=(d.initstatus*d.anim.top-d.prev)/(d.percent-d.prev)*v,d.status=d.initstatus,delete d.initstatus,d.stop&&xt.splice(f--,1)):d.status=(d.prev+(d.percent-d.prev)*(p/v))/d.anim.top,!(p<0))if(p<v){var $=_(p/v);for(var Q in S)if(S[k](Q)){switch(z[Q]){case K:c=+S[Q]+$*v*I[Q];break;case"colour":c="rgb("+[$e(A(S[Q].r+$*v*I[Q].r)),$e(A(S[Q].g+$*v*I[Q].g)),$e(A(S[Q].b+$*v*I[Q].b))].join(",")+")";break;case"path":c=[];for(var Z=0,H=S[Q].length;Z<H;Z++){c[Z]=[S[Q][Z][0]];for(var lt=1,tt=S[Q][Z].length;lt<tt;lt++)c[Z][lt]=+S[Q][Z][lt]+$*v*I[Q][Z][lt];c[Z]=c[Z].join(nt)}c=c.join(nt);break;case"transform":if(I[Q].real)for(c=[],Z=0,H=S[Q].length;Z<H;Z++)for(c[Z]=[S[Q][Z][0]],lt=1,tt=S[Q][Z].length;lt<tt;lt++)c[Z][lt]=S[Q][Z][lt]+$*v*I[Q][Z][lt];else{var rt=function(bt){return+S[Q][bt]+$*v*I[Q][bt]};c=[["m",rt(0),rt(1),rt(2),rt(3),rt(4),rt(5)]]}break;case"csv":if(Q=="clip-rect")for(c=[],Z=4;Z--;)c[Z]=+S[Q][Z]+$*v*I[Q][Z];break;default:var et=[][O](S[Q]);for(c=[],Z=W.paper.customAttributes[Q].length;Z--;)c[Z]=+et[Z]+$*v*I[Q][Z]}j[Q]=c}W.attr(j),function(bt,gt,_t){setTimeout(function(){a("raphael.anim.frame."+bt,gt,_t)})}(W.id,W,d.anim)}else{if(function(bt,gt,_t){setTimeout(function(){a("raphael.anim.frame."+gt.id,gt,_t),a("raphael.anim.finish."+gt.id,gt,_t),h.is(bt,"function")&&bt.call(gt)})}(d.callback,W,d.anim),W.attr(U),xt.splice(f--,1),d.repeat>1&&!d.next){for(u in U)U[k](u)&&(G[u]=d.totalOrigin[u]);d.el.attr(G),Ne(d.anim,d.el,d.anim.percents[0],null,d.totalOrigin,d.repeat-1)}d.next&&!d.stop&&Ne(d.anim,d.el,d.next,null,d.totalOrigin,d.repeat)}}}xt.length&&Gn(xn)},$e=function(l){return l>255?255:l<0?0:l};function se(l,f,d,c,u,p){var v=3*f,_=3*(c-f)-v,S=1-v-_,I=3*d,U=3*(u-d)-I,W=1-I-U;function j(G){return((S*G+_)*G+v)*G}return function(G,$){var Q=function(Z,H){var lt,tt,rt,et,bt,gt;for(rt=Z,gt=0;gt<8;gt++){if(et=j(rt)-Z,Pt(et)<H)return rt;if(Pt(bt=(3*S*rt+2*_)*rt+v)<1e-6)break;rt-=et/bt}if(tt=1,(rt=Z)<(lt=0))return lt;if(rt>tt)return tt;for(;lt<tt;){if(et=j(rt),Pt(et-Z)<H)return rt;Z>et?lt=rt:tt=rt,rt=(tt-lt)/2+lt}return rt}(G,$);return((W*Q+U)*Q+I)*Q}(l,1/(200*p))}function ee(l,f){var d=[],c={};if(this.ms=f,this.times=1,l){for(var u in l)l[k](u)&&(c[L(u)]=l[u],d.push(L(u)));d.sort(At)}this.anim=c,this.top=d[d.length-1],this.percents=d}function Ne(l,f,d,c,u,p){d=L(d);var v,_,S,I,U,W,j=l.ms,G={},$={},Q={};if(c)for(H=0,lt=xt.length;H<lt;H++){var Z=xt[H];if(Z.el.id==f.id&&Z.anim==l){Z.percent!=d?(xt.splice(H,1),S=1):_=Z,f.attr(Z.totalOrigin);break}}else c=+$;for(var H=0,lt=l.percents.length;H<lt;H++){if(l.percents[H]==d||l.percents[H]>c*l.top){d=l.percents[H],U=l.percents[H-1]||0,j=j/l.top*(d-U),I=l.percents[H+1],v=l.anim[d];break}c&&f.attr(l.anim[l.percents[H]])}if(v){if(_)_.initstatus=c,_.start=new Date-_.ms*c;else{for(var tt in v)if(v[k](tt)&&(z[k](tt)||f.paper.customAttributes[k](tt)))switch(G[tt]=f.attr(tt),G[tt]==null&&(G[tt]=q[tt]),$[tt]=v[tt],z[tt]){case K:Q[tt]=($[tt]-G[tt])/j;break;case"colour":G[tt]=h.getRGB(G[tt]);var rt=h.getRGB($[tt]);Q[tt]={r:(rt.r-G[tt].r)/j,g:(rt.g-G[tt].g)/j,b:(rt.b-G[tt].b)/j};break;case"path":var et=en(G[tt],$[tt]),bt=et[1];for(G[tt]=et[0],Q[tt]=[],H=0,lt=G[tt].length;H<lt;H++){Q[tt][H]=[0];for(var gt=1,_t=G[tt][H].length;gt<_t;gt++)Q[tt][H][gt]=(bt[H][gt]-G[tt][H][gt])/j}break;case"transform":var Tn=f._,Vn=mi(Tn[tt],$[tt]);if(Vn)for(G[tt]=Vn.from,$[tt]=Vn.to,Q[tt]=[],Q[tt].real=!0,H=0,lt=G[tt].length;H<lt;H++)for(Q[tt][H]=[G[tt][H][0]],gt=1,_t=G[tt][H].length;gt<_t;gt++)Q[tt][H][gt]=($[tt][H][gt]-G[tt][H][gt])/j;else{var ne=f.matrix||new Le,_e={_:{transform:Tn.transform},getBBox:function(){return f.getBBox(1)}};G[tt]=[ne.a,ne.b,ne.c,ne.d,ne.e,ne.f],yn(_e,$[tt]),$[tt]=_e._.transform,Q[tt]=[(_e.matrix.a-ne.a)/j,(_e.matrix.b-ne.b)/j,(_e.matrix.c-ne.c)/j,(_e.matrix.d-ne.d)/j,(_e.matrix.e-ne.e)/j,(_e.matrix.f-ne.f)/j]}break;case"csv":var Sn=V(v[tt])[ot](x),En=V(G[tt])[ot](x);if(tt=="clip-rect")for(G[tt]=En,Q[tt]=[],H=En.length;H--;)Q[tt][H]=(Sn[H]-G[tt][H])/j;$[tt]=Sn;break;default:for(Sn=[][O](v[tt]),En=[][O](G[tt]),Q[tt]=[],H=f.paper.customAttributes[tt].length;H--;)Q[tt][H]=((Sn[H]||0)-(En[H]||0))/j}var bi=v.easing,Be=h.easing_formulas[bi];if(!Be)if((Be=V(bi).match(b))&&Be.length==5){var an=Be;Be=function(_i){return se(_i,+an[1],+an[2],+an[3],+an[4],j)}}else Be=Mt;if(Z={anim:l,percent:d,timestamp:W=v.start||l.start||+new Date,start:W+(l.del||0),status:0,initstatus:c||0,stop:!1,ms:j,easing:Be,from:G,diff:Q,to:$,el:f,callback:v.callback,prev:U,next:I,repeat:p||l.times,origin:f.attr(),totalOrigin:u},xt.push(Z),c&&!_&&!S&&(Z.stop=!0,Z.start=new Date-j*c,xt.length==1))return xn();S&&(Z.start=new Date-Z.ms*c),xt.length==1&&Gn(xn)}a("raphael.anim.start."+f.id,f,l)}}function bn(l){for(var f=0;f<xt.length;f++)xt[f].el.paper==l&&xt.splice(f--,1)}Lt.animateWith=function(l,f,d,c,u,p){if(this.removed)return p&&p.call(this),this;var v=d instanceof ee?d:h.animation(d,c,u,p);Ne(v,this,v.percents[0],null,this.attr());for(var _=0,S=xt.length;_<S;_++)if(xt[_].anim==f&&xt[_].el==l){xt[S-1].start=xt[_].start;break}return this},Lt.onAnimation=function(l){return l?a.on("raphael.anim.frame."+this.id,l):a.unbind("raphael.anim.frame."+this.id),this},ee.prototype.delay=function(l){var f=new ee(this.anim,this.ms);return f.times=this.times,f.del=+l||0,f},ee.prototype.repeat=function(l){var f=new ee(this.anim,this.ms);return f.del=this.del,f.times=ht.floor(pt(l,0))||1,f},h.animation=function(l,f,d,c){if(l instanceof ee)return l;!h.is(d,"function")&&d||(c=c||d||null,d=null),l=Object(l),f=+f||0;var u,p,v={};for(p in l)l[k](p)&&L(p)!=p&&L(p)+"%"!=p&&(u=!0,v[p]=l[p]);if(u)return d&&(v.easing=d),c&&(v.callback=c),new ee({100:v},f);if(c){var _=0;for(var S in l){var I=F(S);l[k](S)&&I>_&&(_=I)}!l[_+="%"].callback&&(l[_].callback=c)}return new ee(l,f)},Lt.animate=function(l,f,d,c){if(this.removed)return c&&c.call(this),this;var u=l instanceof ee?l:h.animation(l,f,d,c);return Ne(u,this,u.percents[0],null,this.attr()),this},Lt.setTime=function(l,f){return l&&f!=null&&this.status(l,ut(f,l.ms)/l.ms),this},Lt.status=function(l,f){var d,c,u=[],p=0;if(f!=null)return Ne(l,this,-1,ut(f,1)),this;for(d=xt.length;p<d;p++)if((c=xt[p]).el.id==this.id&&(!l||c.anim==l)){if(l)return c.status;u.push({anim:c.anim,status:c.status})}return l?0:u},Lt.pause=function(l){for(var f=0;f<xt.length;f++)xt[f].el.id!=this.id||l&&xt[f].anim!=l||a("raphael.anim.pause."+this.id,this,xt[f].anim)!==!1&&(xt[f].paused=!0);return this},Lt.resume=function(l){for(var f=0;f<xt.length;f++)if(xt[f].el.id==this.id&&(!l||xt[f].anim==l)){var d=xt[f];a("raphael.anim.resume."+this.id,this,d.anim)!==!1&&(delete d.paused,this.status(d.anim,d.status))}return this},Lt.stop=function(l){for(var f=0;f<xt.length;f++)xt[f].el.id!=this.id||l&&xt[f].anim!=l||a("raphael.anim.stop."+this.id,this,xt[f].anim)!==!1&&xt.splice(f--,1);return this},a.on("raphael.remove",bn),a.on("raphael.clear",bn),Lt.toString=function(){return"Raphaël’s object"};var _n,Cn,le,ue,rn=function(l){if(this.items=[],this.length=0,this.type="set",l)for(var f=0,d=l.length;f<d;f++)!l[f]||l[f].constructor!=Lt.constructor&&l[f].constructor!=rn||(this[this.items.length]=this.items[this.items.length]=l[f],this.length++)},Vt=rn.prototype;for(var sn in Vt.push=function(){for(var l,f,d=0,c=arguments.length;d<c;d++)!(l=arguments[d])||l.constructor!=Lt.constructor&&l.constructor!=rn||(this[f=this.items.length]=this.items[f]=l,this.length++);return this},Vt.pop=function(){return this.length&&delete this[this.length--],this.items.pop()},Vt.forEach=function(l,f){for(var d=0,c=this.items.length;d<c;d++)if(l.call(f,this.items[d],d)===!1)return this;return this},Lt)Lt[k](sn)&&(Vt[sn]=function(l){return function(){var f=arguments;return this.forEach(function(d){d[l][R](d,f)})}}(sn));return Vt.attr=function(l,f){if(l&&h.is(l,it)&&h.is(l[0],"object"))for(var d=0,c=l.length;d<c;d++)this.items[d].attr(l[d]);else for(var u=0,p=this.items.length;u<p;u++)this.items[u].attr(l,f);return this},Vt.clear=function(){for(;this.length;)this.pop()},Vt.splice=function(l,f,d){l=l<0?pt(this.length+l,0):l,f=pt(0,ut(this.length-l,f));var c,u=[],p=[],v=[];for(c=2;c<arguments.length;c++)v.push(arguments[c]);for(c=0;c<f;c++)p.push(this[l+c]);for(;c<this.length-l;c++)u.push(this[l+c]);var _=v.length;for(c=0;c<_+u.length;c++)this.items[l+c]=this[l+c]=c<_?v[c]:u[c-_];for(c=this.items.length=this.length-=f-_;this[c];)delete this[c++];return new rn(p)},Vt.exclude=function(l){for(var f=0,d=this.length;f<d;f++)if(this[f]==l)return this.splice(f,1),!0},Vt.animate=function(l,f,d,c){(h.is(d,"function")||!d)&&(c=d||null);var u,p,v=this.items.length,_=v,S=this;if(!v)return this;c&&(p=function(){!--v&&c.call(S)}),d=h.is(d,"string")?d:p;var I=h.animation(l,f,d,p);for(u=this.items[--_].animate(I);_--;)this.items[_]&&!this.items[_].removed&&this.items[_].animateWith(u,I,I),this.items[_]&&!this.items[_].removed||v--;return this},Vt.insertAfter=function(l){for(var f=this.items.length;f--;)this.items[f].insertAfter(l);return this},Vt.getBBox=function(){for(var l=[],f=[],d=[],c=[],u=this.items.length;u--;)if(!this.items[u].removed){var p=this.items[u].getBBox();l.push(p.x),f.push(p.y),d.push(p.x+p.width),c.push(p.y+p.height)}return{x:l=ut[R](0,l),y:f=ut[R](0,f),x2:d=pt[R](0,d),y2:c=pt[R](0,c),width:d-l,height:c-f}},Vt.clone=function(l){l=this.paper.set();for(var f=0,d=this.items.length;f<d;f++)l.push(this.items[f].clone());return l},Vt.toString=function(){return"Raphaël‘s set"},Vt.glow=function(l){var f=this.paper.set();return this.forEach(function(d,c){var u=d.glow(l);u?.forEach(function(p,v){f.push(p)})}),f},Vt.isPointInside=function(l,f){var d=!1;return this.forEach(function(c){if(c.isPointInside(l,f))return d=!0,!1}),d},h.registerFont=function(l){if(!l.face)return l;this.fonts=this.fonts||{};var f={w:l.w,face:{},glyphs:{}},d=l.face["font-family"];for(var c in l.face)l.face[k](c)&&(f.face[c]=l.face[c]);if(this.fonts[d]?this.fonts[d].push(f):this.fonts[d]=[f],!l.svg){for(var u in f.face["units-per-em"]=F(l.face["units-per-em"],10),l.glyphs)if(l.glyphs[k](u)){var p=l.glyphs[u];if(f.glyphs[u]={w:p.w,k:{},d:p.d&&"M"+p.d.replace(/[mlcxtrv]/g,function(_){return{l:"L",c:"C",x:"z",t:"m",r:"l",v:"c"}[_]||"M"})+"z"},p.k)for(var v in p.k)p[k](v)&&(f.glyphs[u].k[v]=p.k[v])}}return l},g.getFont=function(l,f,d,c){if(c=c||"normal",d=d||"normal",f=+f||{normal:400,bold:700,lighter:300,bolder:800}[f]||400,h.fonts){var u,p=h.fonts[l];if(!p){var v=new RegExp("(^|\\s)"+l.replace(/[^\w\d\s+!~.:_-]/g,Y)+"(\\s|$)","i");for(var _ in h.fonts)if(h.fonts[k](_)&&v.test(_)){p=h.fonts[_];break}}if(p)for(var S=0,I=p.length;S<I&&((u=p[S]).face["font-weight"]!=f||u.face["font-style"]!=d&&u.face["font-style"]||u.face["font-stretch"]!=c);S++);return u}},g.print=function(l,f,d,c,u,p,v,_){p=p||"middle",v=pt(ut(v||0,1),-1),_=pt(ut(_||1,3),1);var S,I=V(d)[ot](Y),U=0,W=0,j=Y;if(h.is(c,"string")&&(c=this.getFont(c)),c){S=(u||16)/c.face["units-per-em"];for(var G=c.face.bbox[ot](x),$=+G[0],Q=G[3]-G[1],Z=0,H=+G[1]+(p=="baseline"?Q+ +c.face.descent:Q/2),lt=0,tt=I.length;lt<tt;lt++){if(I[lt]==`
|
|
19
|
-
`)U=0,et=0,W=0,Z+=Q*_;else{var rt=W&&c.glyphs[I[lt-1]]||{},et=c.glyphs[I[lt]];U+=W?(rt.w||c.w)+(rt.k&&rt.k[I[lt]]||0)+c.w*v:0,W=1}et&&et.d&&(j+=h.transformPath(et.d,["t",U*S,Z*S,"s",S,S,$,H,"t",(l-$)/S,(f-H)/S]))}}return this.path(j).attr({fill:"#000",stroke:"none"})},g.add=function(l){if(h.is(l,"array"))for(var f,d=this.set(),c=0,u=l.length;c<u;c++)f=l[c]||{},y[k](f.type)&&d.push(this[f.type]().attr(f));return d},h.format=function(l,f){var d=h.is(f,it)?[0][O](f):arguments;return l&&h.is(l,"string")&&d.length-1&&(l=l.replace(w,function(c,u){return d[++u]==null?Y:d[u]})),l||Y},h.fullfill=(_n=/\{([^\}]+)\}/g,Cn=/(?:(?:^|\.)(.+?)(?=\[|\.|$|\()|\[('|")(.+?)\2\])(\(\))?/g,function(l,f){return String(l).replace(_n,function(d,c){return function(u,p,v){var _=v;return p.replace(Cn,function(S,I,U,W,j){I=I||W,_&&(I in _&&(_=_[I]),typeof _=="function"&&j&&(_=_()))}),_=(_==null||_==v?u:_)+""}(d,c,f)})}),h.ninja=function(){if(D.was)P.win.Raphael=D.is;else{window.Raphael=void 0;try{delete window.Raphael}catch{}}return h},h.st=Vt,a.on("raphael.DOMload",function(){m=!0}),(le=document).readyState==null&&le.addEventListener&&(le.addEventListener("DOMContentLoaded",ue=function(){le.removeEventListener("DOMContentLoaded",ue,!1),le.readyState="complete"},!1),le.readyState="loading"),function l(){/in/.test(le.readyState)?setTimeout(l,9):h.eve("raphael.DOMload")}(),h}.apply(n,s))===void 0||(e.exports=o)},function(e,n,r){var s,o;s=[r(0),r(3),r(4)],(o=function(a){return a}.apply(n,s))===void 0||(e.exports=o)},function(e,n,r){var s,o,a,h,m,g,x,y,w,k,P,D,N,R;h="hasOwnProperty",m=/[\.\/]/,g=/\s*,\s*/,x=function(O,X){return O-X},y={n:{}},w=function(){for(var O=0,X=this.length;O<X;O++)if(this[O]!==void 0)return this[O]},k=function(){for(var O=this.length;--O;)if(this[O]!==void 0)return this[O]},P=Object.prototype.toString,D=String,N=Array.isArray||function(O){return O instanceof Array||P.call(O)=="[object Array]"},(R=function(O,X){var Y,nt=a,V=Array.prototype.slice.call(arguments,2),ot=R.listeners(O),ct=0,vt=[],dt={},ht=[],pt=o;ht.firstDefined=w,ht.lastDefined=k,o=O,a=0;for(var ut=0,Pt=ot.length;ut<Pt;ut++)"zIndex"in ot[ut]&&(vt.push(ot[ut].zIndex),ot[ut].zIndex<0&&(dt[ot[ut].zIndex]=ot[ut]));for(vt.sort(x);vt[ct]<0;)if(Y=dt[vt[ct++]],ht.push(Y.apply(X,V)),a)return a=nt,ht;for(ut=0;ut<Pt;ut++)if("zIndex"in(Y=ot[ut]))if(Y.zIndex==vt[ct]){if(ht.push(Y.apply(X,V)),a)break;do if((Y=dt[vt[++ct]])&&ht.push(Y.apply(X,V)),a)break;while(Y)}else dt[Y.zIndex]=Y;else if(ht.push(Y.apply(X,V)),a)break;return a=nt,o=pt,ht})._events=y,R.listeners=function(O){var X,Y,nt,V,ot,ct,vt,dt,ht=N(O)?O:O.split(m),pt=y,ut=[pt],Pt=[];for(V=0,ot=ht.length;V<ot;V++){for(dt=[],ct=0,vt=ut.length;ct<vt;ct++)for(Y=[(pt=ut[ct].n)[ht[V]],pt["*"]],nt=2;nt--;)(X=Y[nt])&&(dt.push(X),Pt=Pt.concat(X.f||[]));ut=dt}return Pt},R.separator=function(O){O?(O="["+(O=D(O).replace(/(?=[\.\^\]\[\-])/g,"\\"))+"]",m=new RegExp(O)):m=/[\.\/]/},R.on=function(O,X){if(typeof X!="function")return function(){};for(var Y=N(O)?N(O[0])?O:[O]:D(O).split(g),nt=0,V=Y.length;nt<V;nt++)(function(ot){for(var ct,vt=N(ot)?ot:D(ot).split(m),dt=y,ht=0,pt=vt.length;ht<pt;ht++)dt=(dt=dt.n).hasOwnProperty(vt[ht])&&dt[vt[ht]]||(dt[vt[ht]]={n:{}});for(dt.f=dt.f||[],ht=0,pt=dt.f.length;ht<pt;ht++)if(dt.f[ht]==X){ct=!0;break}!ct&&dt.f.push(X)})(Y[nt]);return function(ot){+ot==+ot&&(X.zIndex=+ot)}},R.f=function(O){var X=[].slice.call(arguments,1);return function(){R.apply(null,[O,null].concat(X).concat([].slice.call(arguments,0)))}},R.stop=function(){a=1},R.nt=function(O){var X=N(o)?o.join("."):o;return O?new RegExp("(?:\\.|\\/|^)"+O+"(?:\\.|\\/|$)").test(X):X},R.nts=function(){return N(o)?o:o.split(m)},R.off=R.unbind=function(O,X){if(O){var Y=N(O)?N(O[0])?O:[O]:D(O).split(g);if(Y.length>1)for(var nt=0,V=Y.length;nt<V;nt++)R.off(Y[nt],X);else{Y=N(O)?O:D(O).split(m);var ot,ct,vt,dt,ht,pt=[y];for(nt=0,V=Y.length;nt<V;nt++)for(dt=0;dt<pt.length;dt+=vt.length-2){if(vt=[dt,1],ot=pt[dt].n,Y[nt]!="*")ot[Y[nt]]&&vt.push(ot[Y[nt]]);else for(ct in ot)ot[h](ct)&&vt.push(ot[ct]);pt.splice.apply(pt,vt)}for(nt=0,V=pt.length;nt<V;nt++)for(ot=pt[nt];ot.n;){if(X){if(ot.f){for(dt=0,ht=ot.f.length;dt<ht;dt++)if(ot.f[dt]==X){ot.f.splice(dt,1);break}!ot.f.length&&delete ot.f}for(ct in ot.n)if(ot.n[h](ct)&&ot.n[ct].f){var ut=ot.n[ct].f;for(dt=0,ht=ut.length;dt<ht;dt++)if(ut[dt]==X){ut.splice(dt,1);break}!ut.length&&delete ot.n[ct].f}}else for(ct in delete ot.f,ot.n)ot.n[h](ct)&&ot.n[ct].f&&delete ot.n[ct].f;ot=ot.n}}}else R._events=y={n:{}}},R.once=function(O,X){var Y=function(){return R.off(O,Y),X.apply(this,arguments)};return R.on(O,Y)},R.version="0.5.0",R.toString=function(){return"You are running Eve 0.5.0"},e.exports?e.exports=R:(s=function(){return R}.apply(n,[]))===void 0||(e.exports=s)},function(e,n,r){var s,o;s=[r(0)],(o=function(a){if(!a||a.svg){var h="hasOwnProperty",m=String,g=parseFloat,x=parseInt,y=Math,w=y.max,k=y.abs,P=y.pow,D=/[, ]+/,N=a.eve,R="",O=" ",X="http://www.w3.org/1999/xlink",Y={block:"M5,0 0,2.5 5,5z",classic:"M5,0 0,2.5 5,5 3.5,3 3.5,2z",diamond:"M2.5,0 5,2.5 2.5,5 0,2.5z",open:"M6,1 1,3.5 6,6",oval:"M2.5,0A2.5,2.5,0,0,1,2.5,5 2.5,2.5,0,0,1,2.5,0z"},nt={};a.toString=function(){return`Your browser supports SVG.
|
|
20
|
-
You are running Raphaël `+this.version};var V=function(E,C){if(C)for(var b in typeof E=="string"&&(E=V(E)),C)C[h](b)&&(b.substring(0,6)=="xlink:"?E.setAttributeNS(X,b.substring(6),m(C[b])):E.setAttribute(b,m(C[b])));else(E=a._g.doc.createElementNS("http://www.w3.org/2000/svg",E)).style&&(E.style.webkitTapHighlightColor="rgba(0,0,0,0)");return E},ot=function(E,C){var b="linear",A=E.id+C,L=.5,F=.5,B=E.node,q=E.paper,z=B.style,J=a._g.doc.getElementById(A);if(!J){if(C=(C=m(C).replace(a._radial_gradient,function(At,Mt,mt){if(b="radial",Mt&&mt){L=g(Mt);var Nt=2*((F=g(mt))>.5)-1;P(L-.5,2)+P(F-.5,2)>.25&&(F=y.sqrt(.25-P(L-.5,2))*Nt+.5)&&F!=.5&&(F=F.toFixed(5)-1e-5*Nt)}return R})).split(/\s*\-\s*/),b=="linear"){var at=C.shift();if(at=-g(at),isNaN(at))return null;var ft=[0,0,y.cos(a.rad(at)),y.sin(a.rad(at))],yt=1/(w(k(ft[2]),k(ft[3]))||1);ft[2]*=yt,ft[3]*=yt,ft[2]<0&&(ft[0]=-ft[2],ft[2]=0),ft[3]<0&&(ft[1]=-ft[3],ft[3]=0)}var Tt=a._parseDots(C);if(!Tt)return null;if(A=A.replace(/[\(\)\s,\xb0#]/g,"_"),E.gradient&&A!=E.gradient.id&&(q.defs.removeChild(E.gradient),delete E.gradient),!E.gradient){J=V(b+"Gradient",{id:A}),E.gradient=J,V(J,b=="radial"?{fx:L,fy:F}:{x1:ft[0],y1:ft[1],x2:ft[2],y2:ft[3],gradientTransform:E.matrix.invert()}),q.defs.appendChild(J);for(var wt=0,Et=Tt.length;wt<Et;wt++)J.appendChild(V("stop",{offset:Tt[wt].offset?Tt[wt].offset:wt?"100%":"0%","stop-color":Tt[wt].color||"#fff","stop-opacity":isFinite(Tt[wt].opacity)?Tt[wt].opacity:1}))}}return V(B,{fill:ct(A),opacity:1,"fill-opacity":1}),z.fill=R,z.opacity=1,z.fillOpacity=1,1},ct=function(E){if((C=document.documentMode)&&(C===9||C===10))return"url('#"+E+"')";var C,b=document.location;return"url('"+(b.protocol+"//"+b.host+b.pathname+b.search)+"#"+E+"')"},vt=function(E){var C=E.getBBox(1);V(E.pattern,{patternTransform:E.matrix.invert()+" translate("+C.x+","+C.y+")"})},dt=function(E,C,b){if(E.type=="path"){for(var A,L,F,B,q,z=m(C).toLowerCase().split("-"),J=E.paper,at=b?"end":"start",ft=E.node,yt=E.attrs,Tt=yt["stroke-width"],wt=z.length,Et="classic",At=3,Mt=3,mt=5;wt--;)switch(z[wt]){case"block":case"classic":case"oval":case"diamond":case"open":case"none":Et=z[wt];break;case"wide":Mt=5;break;case"narrow":Mt=2;break;case"long":At=5;break;case"short":At=2}if(Et=="open"?(At+=2,Mt+=2,mt+=2,F=1,B=b?4:1,q={fill:"none",stroke:yt.stroke}):(B=F=At/2,q={fill:yt.stroke,stroke:"none"}),E._.arrows?b?(E._.arrows.endPath&&nt[E._.arrows.endPath]--,E._.arrows.endMarker&&nt[E._.arrows.endMarker]--):(E._.arrows.startPath&&nt[E._.arrows.startPath]--,E._.arrows.startMarker&&nt[E._.arrows.startMarker]--):E._.arrows={},Et!="none"){var Nt="raphael-marker-"+Et,It="raphael-marker-"+at+Et+At+Mt+"-obj"+E.id;a._g.doc.getElementById(Nt)?nt[Nt]++:(J.defs.appendChild(V(V("path"),{"stroke-linecap":"round",d:Y[Et],id:Nt})),nt[Nt]=1);var Ut,Rt=a._g.doc.getElementById(It);Rt?(nt[It]++,Ut=Rt.getElementsByTagName("use")[0]):(Rt=V(V("marker"),{id:It,markerHeight:Mt,markerWidth:At,orient:"auto",refX:B,refY:Mt/2}),Ut=V(V("use"),{"xlink:href":"#"+Nt,transform:(b?"rotate(180 "+At/2+" "+Mt/2+") ":R)+"scale("+At/mt+","+Mt/mt+")","stroke-width":(1/((At/mt+Mt/mt)/2)).toFixed(4)}),Rt.appendChild(Ut),J.defs.appendChild(Rt),nt[It]=1),V(Ut,q);var Zt=F*(Et!="diamond"&&Et!="oval");b?(A=E._.arrows.startdx*Tt||0,L=a.getTotalLength(yt.path)-Zt*Tt):(A=Zt*Tt,L=a.getTotalLength(yt.path)-(E._.arrows.enddx*Tt||0)),(q={})["marker-"+at]="url(#"+It+")",(L||A)&&(q.d=a.getSubpath(yt.path,A,L)),V(ft,q),E._.arrows[at+"Path"]=Nt,E._.arrows[at+"Marker"]=It,E._.arrows[at+"dx"]=Zt,E._.arrows[at+"Type"]=Et,E._.arrows[at+"String"]=C}else b?(A=E._.arrows.startdx*Tt||0,L=a.getTotalLength(yt.path)-A):(A=0,L=a.getTotalLength(yt.path)-(E._.arrows.enddx*Tt||0)),E._.arrows[at+"Path"]&&V(ft,{d:a.getSubpath(yt.path,A,L)}),delete E._.arrows[at+"Path"],delete E._.arrows[at+"Marker"],delete E._.arrows[at+"dx"],delete E._.arrows[at+"Type"],delete E._.arrows[at+"String"];for(q in nt)if(nt[h](q)&&!nt[q]){var Wt=a._g.doc.getElementById(q);Wt&&Wt.parentNode.removeChild(Wt)}}},ht={"-":[3,1],".":[1,1],"-.":[3,1,1,1],"-..":[3,1,1,1,1,1],". ":[1,3],"- ":[4,3],"--":[8,3],"- .":[4,3,1,3],"--.":[8,3,1,3],"--..":[8,3,1,3,1,3]},pt=function(E,C,b){if(C=ht[m(C).toLowerCase()]){for(var A=E.attrs["stroke-width"]||"1",L={round:A,square:A,butt:0}[E.attrs["stroke-linecap"]||b["stroke-linecap"]]||0,F=[],B=C.length;B--;)F[B]=C[B]*A+(B%2?1:-1)*L;V(E.node,{"stroke-dasharray":F.join(",")})}else V(E.node,{"stroke-dasharray":"none"})},ut=function(E,C){var b=E.node,A=E.attrs,L=b.style.visibility;for(var F in b.style.visibility="hidden",C)if(C[h](F)){if(!a._availableAttrs[h](F))continue;var B=C[F];switch(A[F]=B,F){case"blur":E.blur(B);break;case"title":var q=b.getElementsByTagName("title");if(q.length&&(q=q[0]))q.firstChild.nodeValue=B;else{q=V("title");var z=a._g.doc.createTextNode(B);q.appendChild(z),b.appendChild(q)}break;case"href":case"target":var J=b.parentNode;if(J.tagName.toLowerCase()!="a"){var at=V("a");J.insertBefore(at,b),at.appendChild(b),J=at}F=="target"?J.setAttributeNS(X,"show",B=="blank"?"new":B):J.setAttributeNS(X,F,B);break;case"cursor":b.style.cursor=B;break;case"transform":E.transform(B);break;case"arrow-start":dt(E,B);break;case"arrow-end":dt(E,B,1);break;case"clip-rect":var ft=m(B).split(D);if(ft.length==4){E.clip&&E.clip.parentNode.parentNode.removeChild(E.clip.parentNode);var yt=V("clipPath"),Tt=V("rect");yt.id=a.createUUID(),V(Tt,{x:ft[0],y:ft[1],width:ft[2],height:ft[3]}),yt.appendChild(Tt),E.paper.defs.appendChild(yt),V(b,{"clip-path":"url(#"+yt.id+")"}),E.clip=Tt}if(!B){var wt=b.getAttribute("clip-path");if(wt){var Et=a._g.doc.getElementById(wt.replace(/(^url\(#|\)$)/g,R));Et&&Et.parentNode.removeChild(Et),V(b,{"clip-path":R}),delete E.clip}}break;case"path":E.type=="path"&&(V(b,{d:B?A.path=a._pathToAbsolute(B):"M0,0"}),E._.dirty=1,E._.arrows&&("startString"in E._.arrows&&dt(E,E._.arrows.startString),"endString"in E._.arrows&&dt(E,E._.arrows.endString,1)));break;case"width":if(b.setAttribute(F,B),E._.dirty=1,!A.fx)break;F="x",B=A.x;case"x":A.fx&&(B=-A.x-(A.width||0));case"rx":if(F=="rx"&&E.type=="rect")break;case"cx":b.setAttribute(F,B),E.pattern&&vt(E),E._.dirty=1;break;case"height":if(b.setAttribute(F,B),E._.dirty=1,!A.fy)break;F="y",B=A.y;case"y":A.fy&&(B=-A.y-(A.height||0));case"ry":if(F=="ry"&&E.type=="rect")break;case"cy":b.setAttribute(F,B),E.pattern&&vt(E),E._.dirty=1;break;case"r":E.type=="rect"?V(b,{rx:B,ry:B}):b.setAttribute(F,B),E._.dirty=1;break;case"src":E.type=="image"&&b.setAttributeNS(X,"href",B);break;case"stroke-width":E._.sx==1&&E._.sy==1||(B/=w(k(E._.sx),k(E._.sy))||1),b.setAttribute(F,B),A["stroke-dasharray"]&&pt(E,A["stroke-dasharray"],C),E._.arrows&&("startString"in E._.arrows&&dt(E,E._.arrows.startString),"endString"in E._.arrows&&dt(E,E._.arrows.endString,1));break;case"stroke-dasharray":pt(E,B,C);break;case"fill":var At=m(B).match(a._ISURL);if(At){yt=V("pattern");var Mt=V("image");yt.id=a.createUUID(),V(yt,{x:0,y:0,patternUnits:"userSpaceOnUse",height:1,width:1}),V(Mt,{x:0,y:0,"xlink:href":At[1]}),yt.appendChild(Mt),function(Rt){a._preload(At[1],function(){var Zt=this.offsetWidth,Wt=this.offsetHeight;V(Rt,{width:Zt,height:Wt}),V(Mt,{width:Zt,height:Wt})})}(yt),E.paper.defs.appendChild(yt),V(b,{fill:"url(#"+yt.id+")"}),E.pattern=yt,E.pattern&&vt(E);break}var mt=a.getRGB(B);if(mt.error){if((E.type=="circle"||E.type=="ellipse"||m(B).charAt()!="r")&&ot(E,B)){if("opacity"in A||"fill-opacity"in A){var Nt=a._g.doc.getElementById(b.getAttribute("fill").replace(/^url\(#|\)$/g,R));if(Nt){var It=Nt.getElementsByTagName("stop");V(It[It.length-1],{"stop-opacity":("opacity"in A?A.opacity:1)*("fill-opacity"in A?A["fill-opacity"]:1)})}}A.gradient=B,A.fill="none";break}}else delete C.gradient,delete A.gradient,!a.is(A.opacity,"undefined")&&a.is(C.opacity,"undefined")&&V(b,{opacity:A.opacity}),!a.is(A["fill-opacity"],"undefined")&&a.is(C["fill-opacity"],"undefined")&&V(b,{"fill-opacity":A["fill-opacity"]});mt[h]("opacity")&&V(b,{"fill-opacity":mt.opacity>1?mt.opacity/100:mt.opacity});case"stroke":mt=a.getRGB(B),b.setAttribute(F,mt.hex),F=="stroke"&&mt[h]("opacity")&&V(b,{"stroke-opacity":mt.opacity>1?mt.opacity/100:mt.opacity}),F=="stroke"&&E._.arrows&&("startString"in E._.arrows&&dt(E,E._.arrows.startString),"endString"in E._.arrows&&dt(E,E._.arrows.endString,1));break;case"gradient":(E.type=="circle"||E.type=="ellipse"||m(B).charAt()!="r")&&ot(E,B);break;case"opacity":A.gradient&&!A[h]("stroke-opacity")&&V(b,{"stroke-opacity":B>1?B/100:B});case"fill-opacity":if(A.gradient){(Nt=a._g.doc.getElementById(b.getAttribute("fill").replace(/^url\(#|\)$/g,R)))&&(It=Nt.getElementsByTagName("stop"),V(It[It.length-1],{"stop-opacity":B}));break}default:F=="font-size"&&(B=x(B,10)+"px");var Ut=F.replace(/(\-.)/g,function(Rt){return Rt.substring(1).toUpperCase()});b.style[Ut]=B,E._.dirty=1,b.setAttribute(F,B)}}Pt(E,C),b.style.visibility=L},Pt=function(E,C){if(E.type=="text"&&(C[h]("text")||C[h]("font")||C[h]("font-size")||C[h]("x")||C[h]("y"))){var b=E.attrs,A=E.node,L=A.firstChild?x(a._g.doc.defaultView.getComputedStyle(A.firstChild,R).getPropertyValue("font-size"),10):10;if(C[h]("text")){for(b.text=C.text;A.firstChild;)A.removeChild(A.firstChild);for(var F,B=m(C.text).split(`
|
|
21
|
-
`),q=[],z=0,J=B.length;z<J;z++)F=V("tspan"),z&&V(F,{dy:1.2*L,x:b.x}),F.appendChild(a._g.doc.createTextNode(B[z])),A.appendChild(F),q[z]=F}else for(z=0,J=(q=A.getElementsByTagName("tspan")).length;z<J;z++)z?V(q[z],{dy:1.2*L,x:b.x}):V(q[0],{dy:0});V(A,{x:b.x,y:b.y}),E._.dirty=1;var at=E._getBBox(),ft=b.y-(at.y+at.height/2);ft&&a.is(ft,"finite")&&V(q[0],{dy:ft})}},kt=function(E){return E.parentNode&&E.parentNode.tagName.toLowerCase()==="a"?E.parentNode:E},Dt=function(E,C){this[0]=this.node=E,E.raphael=!0,this.id=("0000"+(Math.random()*Math.pow(36,5)<<0).toString(36)).slice(-5),E.raphaelid=this.id,this.matrix=a.matrix(),this.realPath=null,this.paper=C,this.attrs=this.attrs||{},this._={transform:[],sx:1,sy:1,deg:0,dx:0,dy:0,dirty:1},!C.bottom&&(C.bottom=this),this.prev=C.top,C.top&&(C.top.next=this),C.top=this,this.next=null},K=a.el;Dt.prototype=K,K.constructor=Dt,a._engine.path=function(E,C){var b=V("path");C.canvas&&C.canvas.appendChild(b);var A=new Dt(b,C);return A.type="path",ut(A,{fill:"none",stroke:"#000",path:E}),A},K.rotate=function(E,C,b){if(this.removed)return this;if((E=m(E).split(D)).length-1&&(C=g(E[1]),b=g(E[2])),E=g(E[0]),b==null&&(C=b),C==null||b==null){var A=this.getBBox(1);C=A.x+A.width/2,b=A.y+A.height/2}return this.transform(this._.transform.concat([["r",E,C,b]])),this},K.scale=function(E,C,b,A){if(this.removed)return this;if((E=m(E).split(D)).length-1&&(C=g(E[1]),b=g(E[2]),A=g(E[3])),E=g(E[0]),C==null&&(C=E),A==null&&(b=A),b==null||A==null)var L=this.getBBox(1);return b=b??L.x+L.width/2,A=A??L.y+L.height/2,this.transform(this._.transform.concat([["s",E,C,b,A]])),this},K.translate=function(E,C){return this.removed?this:((E=m(E).split(D)).length-1&&(C=g(E[1])),E=g(E[0])||0,C=+C||0,this.transform(this._.transform.concat([["t",E,C]])),this)},K.transform=function(E){var C=this._;if(E==null)return C.transform;if(a._extractTransform(this,E),this.clip&&V(this.clip,{transform:this.matrix.invert()}),this.pattern&&vt(this),this.node&&V(this.node,{transform:this.matrix}),C.sx!=1||C.sy!=1){var b=this.attrs[h]("stroke-width")?this.attrs["stroke-width"]:1;this.attr({"stroke-width":b})}return this},K.hide=function(){return this.removed||(this.node.style.display="none"),this},K.show=function(){return this.removed||(this.node.style.display=""),this},K.remove=function(){var E=kt(this.node);if(!this.removed&&E.parentNode){var C=this.paper;for(var b in C.__set__&&C.__set__.exclude(this),N.unbind("raphael.*.*."+this.id),this.gradient&&C.defs.removeChild(this.gradient),a._tear(this,C),E.parentNode.removeChild(E),this.removeData(),this)this[b]=typeof this[b]=="function"?a._removedFactory(b):null;this.removed=!0}},K._getBBox=function(){if(this.node.style.display=="none"){this.show();var E=!0}var C,b=!1;this.paper.canvas.parentElement?C=this.paper.canvas.parentElement.style:this.paper.canvas.parentNode&&(C=this.paper.canvas.parentNode.style),C&&C.display=="none"&&(b=!0,C.display="");var A={};try{A=this.node.getBBox()}catch{A={x:this.node.clientLeft,y:this.node.clientTop,width:this.node.clientWidth,height:this.node.clientHeight}}finally{A=A||{},b&&(C.display="none")}return E&&this.hide(),A},K.attr=function(E,C){if(this.removed)return this;if(E==null){var b={};for(var A in this.attrs)this.attrs[h](A)&&(b[A]=this.attrs[A]);return b.gradient&&b.fill=="none"&&(b.fill=b.gradient)&&delete b.gradient,b.transform=this._.transform,b}if(C==null&&a.is(E,"string")){if(E=="fill"&&this.attrs.fill=="none"&&this.attrs.gradient)return this.attrs.gradient;if(E=="transform")return this._.transform;for(var L=E.split(D),F={},B=0,q=L.length;B<q;B++)(E=L[B])in this.attrs?F[E]=this.attrs[E]:a.is(this.paper.customAttributes[E],"function")?F[E]=this.paper.customAttributes[E].def:F[E]=a._availableAttrs[E];return q-1?F:F[L[0]]}if(C==null&&a.is(E,"array")){for(F={},B=0,q=E.length;B<q;B++)F[E[B]]=this.attr(E[B]);return F}if(C!=null){var z={};z[E]=C}else E!=null&&a.is(E,"object")&&(z=E);for(var J in z)N("raphael.attr."+J+"."+this.id,this,z[J]);for(J in this.paper.customAttributes)if(this.paper.customAttributes[h](J)&&z[h](J)&&a.is(this.paper.customAttributes[J],"function")){var at=this.paper.customAttributes[J].apply(this,[].concat(z[J]));for(var ft in this.attrs[J]=z[J],at)at[h](ft)&&(z[ft]=at[ft])}return ut(this,z),this},K.toFront=function(){if(this.removed)return this;var E=kt(this.node);E.parentNode.appendChild(E);var C=this.paper;return C.top!=this&&a._tofront(this,C),this},K.toBack=function(){if(this.removed)return this;var E=kt(this.node),C=E.parentNode;return C.insertBefore(E,C.firstChild),a._toback(this,this.paper),this.paper,this},K.insertAfter=function(E){if(this.removed||!E)return this;var C=kt(this.node),b=kt(E.node||E[E.length-1].node);return b.nextSibling?b.parentNode.insertBefore(C,b.nextSibling):b.parentNode.appendChild(C),a._insertafter(this,E,this.paper),this},K.insertBefore=function(E){if(this.removed||!E)return this;var C=kt(this.node),b=kt(E.node||E[0].node);return b.parentNode.insertBefore(C,b),a._insertbefore(this,E,this.paper),this},K.blur=function(E){var C=this;if(+E!=0){var b=V("filter"),A=V("feGaussianBlur");C.attrs.blur=E,b.id=a.createUUID(),V(A,{stdDeviation:+E||1.5}),b.appendChild(A),C.paper.defs.appendChild(b),C._blur=b,V(C.node,{filter:"url(#"+b.id+")"})}else C._blur&&(C._blur.parentNode.removeChild(C._blur),delete C._blur,delete C.attrs.blur),C.node.removeAttribute("filter");return C},a._engine.circle=function(E,C,b,A){var L=V("circle");E.canvas&&E.canvas.appendChild(L);var F=new Dt(L,E);return F.attrs={cx:C,cy:b,r:A,fill:"none",stroke:"#000"},F.type="circle",V(L,F.attrs),F},a._engine.rect=function(E,C,b,A,L,F){var B=V("rect");E.canvas&&E.canvas.appendChild(B);var q=new Dt(B,E);return q.attrs={x:C,y:b,width:A,height:L,rx:F||0,ry:F||0,fill:"none",stroke:"#000"},q.type="rect",V(B,q.attrs),q},a._engine.ellipse=function(E,C,b,A,L){var F=V("ellipse");E.canvas&&E.canvas.appendChild(F);var B=new Dt(F,E);return B.attrs={cx:C,cy:b,rx:A,ry:L,fill:"none",stroke:"#000"},B.type="ellipse",V(F,B.attrs),B},a._engine.image=function(E,C,b,A,L,F){var B=V("image");V(B,{x:b,y:A,width:L,height:F,preserveAspectRatio:"none"}),B.setAttributeNS(X,"href",C),E.canvas&&E.canvas.appendChild(B);var q=new Dt(B,E);return q.attrs={x:b,y:A,width:L,height:F,src:C},q.type="image",q},a._engine.text=function(E,C,b,A){var L=V("text");E.canvas&&E.canvas.appendChild(L);var F=new Dt(L,E);return F.attrs={x:C,y:b,"text-anchor":"middle",text:A,"font-family":a._availableAttrs["font-family"],"font-size":a._availableAttrs["font-size"],stroke:"none",fill:"#000"},F.type="text",ut(F,F.attrs),F},a._engine.setSize=function(E,C){return this.width=E||this.width,this.height=C||this.height,this.canvas.setAttribute("width",this.width),this.canvas.setAttribute("height",this.height),this._viewBox&&this.setViewBox.apply(this,this._viewBox),this},a._engine.create=function(){var E=a._getContainer.apply(0,arguments),C=E&&E.container;if(!C)throw new Error("SVG container not found.");var b,A=E.x,L=E.y,F=E.width,B=E.height,q=V("svg"),z="overflow:hidden;";return A=A||0,L=L||0,V(q,{height:B=B||342,version:1.1,width:F=F||512,xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink"}),C==1?(q.style.cssText=z+"position:absolute;left:"+A+"px;top:"+L+"px",a._g.doc.body.appendChild(q),b=1):(q.style.cssText=z+"position:relative",C.firstChild?C.insertBefore(q,C.firstChild):C.appendChild(q)),(C=new a._Paper).width=F,C.height=B,C.canvas=q,C.clear(),C._left=C._top=0,b&&(C.renderfix=function(){}),C.renderfix(),C},a._engine.setViewBox=function(E,C,b,A,L){N("raphael.setViewBox",this,this._viewBox,[E,C,b,A,L]);var F,B,q=this.getSize(),z=w(b/q.width,A/q.height),J=this.top,at=L?"xMidYMid meet":"xMinYMin";for(E==null?(this._vbSize&&(z=1),delete this._vbSize,F="0 0 "+this.width+O+this.height):(this._vbSize=z,F=E+O+C+O+b+O+A),V(this.canvas,{viewBox:F,preserveAspectRatio:at});z&&J;)B="stroke-width"in J.attrs?J.attrs["stroke-width"]:1,J.attr({"stroke-width":B}),J._.dirty=1,J._.dirtyT=1,J=J.prev;return this._viewBox=[E,C,b,A,!!L],this},a.prototype.renderfix=function(){var E,C=this.canvas,b=C.style;try{E=C.getScreenCTM()||C.createSVGMatrix()}catch{E=C.createSVGMatrix()}var A=-E.e%1,L=-E.f%1;(A||L)&&(A&&(this._left=(this._left+A)%1,b.left=this._left+"px"),L&&(this._top=(this._top+L)%1,b.top=this._top+"px"))},a.prototype.clear=function(){a.eve("raphael.clear",this);for(var E=this.canvas;E.firstChild;)E.removeChild(E.firstChild);this.bottom=this.top=null,(this.desc=V("desc")).appendChild(a._g.doc.createTextNode("Created with Raphaël "+a.version)),E.appendChild(this.desc),E.appendChild(this.defs=V("defs"))},a.prototype.remove=function(){for(var E in N("raphael.remove",this),this.canvas.parentNode&&this.canvas.parentNode.removeChild(this.canvas),this)this[E]=typeof this[E]=="function"?a._removedFactory(E):null};var it=a.st;for(var st in K)K[h](st)&&!it[h](st)&&(it[st]=function(E){return function(){var C=arguments;return this.forEach(function(b){b[E].apply(b,C)})}}(st))}}.apply(n,s))===void 0||(e.exports=o)},function(e,n,r){var s,o;s=[r(0)],(o=function(a){if(!a||a.vml){var h="hasOwnProperty",m=String,g=parseFloat,x=Math,y=x.round,w=x.max,k=x.min,P=x.abs,D=/[, ]+/,N=a.eve,R=" ",O="",X={M:"m",L:"l",C:"c",Z:"x",m:"t",l:"r",c:"v",z:"x"},Y=/([clmz]),?([^clmz]*)/gi,nt=/ progid:\S+Blur\([^\)]+\)/g,V=/-?[^,\s-]+/g,ot="position:absolute;left:0;top:0;width:1px;height:1px;behavior:url(#default#VML)",ct=21600,vt={path:1,rect:1,image:1},dt={circle:1,ellipse:1},ht=function(C,b,A){var L=a.matrix();return L.rotate(-C,.5,.5),{dx:L.x(b,A),dy:L.y(b,A)}},pt=function(C,b,A,L,F,B){var q=C._,z=C.matrix,J=q.fillpos,at=C.node,ft=at.style,yt=1,Tt="",wt=ct/b,Et=ct/A;if(ft.visibility="hidden",b&&A){if(at.coordsize=P(wt)+R+P(Et),ft.rotation=B*(b*A<0?-1:1),B){var At=ht(B,L,F);L=At.dx,F=At.dy}if(b<0&&(Tt+="x"),A<0&&(Tt+=" y")&&(yt=-1),ft.flip=Tt,at.coordorigin=L*-wt+R+F*-Et,J||q.fillsize){var Mt=at.getElementsByTagName("fill");Mt=Mt&&Mt[0],at.removeChild(Mt),J&&(At=ht(B,z.x(J[0],J[1]),z.y(J[0],J[1])),Mt.position=At.dx*yt+R+At.dy*yt),q.fillsize&&(Mt.size=q.fillsize[0]*P(b)+R+q.fillsize[1]*P(A)),at.appendChild(Mt)}ft.visibility="visible"}};a.toString=function(){return`Your browser doesn’t support SVG. Falling down to VML.
|
|
22
|
-
You are running Raphaël `+this.version};var ut,Pt=function(C,b,A){for(var L=m(b).toLowerCase().split("-"),F=A?"end":"start",B=L.length,q="classic",z="medium",J="medium";B--;)switch(L[B]){case"block":case"classic":case"oval":case"diamond":case"open":case"none":q=L[B];break;case"wide":case"narrow":J=L[B];break;case"long":case"short":z=L[B]}var at=C.node.getElementsByTagName("stroke")[0];at[F+"arrow"]=q,at[F+"arrowlength"]=z,at[F+"arrowwidth"]=J},kt=function(C,b){C.attrs=C.attrs||{};var A=C.node,L=C.attrs,F=A.style,B=vt[C.type]&&(b.x!=L.x||b.y!=L.y||b.width!=L.width||b.height!=L.height||b.cx!=L.cx||b.cy!=L.cy||b.rx!=L.rx||b.ry!=L.ry||b.r!=L.r),q=dt[C.type]&&(L.cx!=b.cx||L.cy!=b.cy||L.r!=b.r||L.rx!=b.rx||L.ry!=b.ry),z=C;for(var J in b)b[h](J)&&(L[J]=b[J]);if(B&&(L.path=a._getPath[C.type](C),C._.dirty=1),b.href&&(A.href=b.href),b.title&&(A.title=b.title),b.target&&(A.target=b.target),b.cursor&&(F.cursor=b.cursor),"blur"in b&&C.blur(b.blur),(b.path&&C.type=="path"||B)&&(A.path=function(Xt){var we=/[ahqstv]/gi,Xe=a._pathToAbsolute;if(m(Xt).match(we)&&(Xe=a._path2curve),we=/[clmz]/g,Xe==a._pathToAbsolute&&!m(Xt).match(we)){var Qt=m(Xt).replace(Y,function(fi,We,Ae){var xe=[],gn=We.toLowerCase()=="m",Me=X[We];return Ae.replace(V,function(Ie){gn&&xe.length==2&&(Me+=xe+X[We=="m"?"l":"L"],xe=[]),xe.push(y(Ie*ct))}),Me+xe});return Qt}var pe,re,tn=Xe(Xt);Qt=[];for(var ke=0,He=tn.length;ke<He;ke++){pe=tn[ke],(re=tn[ke][0].toLowerCase())=="z"&&(re="x");for(var he=1,qt=pe.length;he<qt;he++)re+=y(pe[he]*ct)+(he!=qt-1?",":O);Qt.push(re)}return Qt.join(R)}(~m(L.path).toLowerCase().indexOf("r")?a._pathToAbsolute(L.path):L.path),C._.dirty=1,C.type=="image"&&(C._.fillpos=[L.x,L.y],C._.fillsize=[L.width,L.height],pt(C,1,1,0,0,0))),"transform"in b&&C.transform(b.transform),q){var at=+L.cx,ft=+L.cy,yt=+L.rx||+L.r||0,Tt=+L.ry||+L.r||0;A.path=a.format("ar{0},{1},{2},{3},{4},{1},{4},{1}x",y((at-yt)*ct),y((ft-Tt)*ct),y((at+yt)*ct),y((ft+Tt)*ct),y(at*ct)),C._.dirty=1}if("clip-rect"in b){var wt=m(b["clip-rect"]).split(D);if(wt.length==4){wt[2]=+wt[2]+ +wt[0],wt[3]=+wt[3]+ +wt[1];var Et=A.clipRect||a._g.doc.createElement("div"),At=Et.style;At.clip=a.format("rect({1}px {2}px {3}px {0}px)",wt),A.clipRect||(At.position="absolute",At.top=0,At.left=0,At.width=C.paper.width+"px",At.height=C.paper.height+"px",A.parentNode.insertBefore(Et,A),Et.appendChild(A),A.clipRect=Et)}b["clip-rect"]||A.clipRect&&(A.clipRect.style.clip="auto")}if(C.textpath){var Mt=C.textpath.style;b.font&&(Mt.font=b.font),b["font-family"]&&(Mt.fontFamily='"'+b["font-family"].split(",")[0].replace(/^['"]+|['"]+$/g,O)+'"'),b["font-size"]&&(Mt.fontSize=b["font-size"]),b["font-weight"]&&(Mt.fontWeight=b["font-weight"]),b["font-style"]&&(Mt.fontStyle=b["font-style"])}if("arrow-start"in b&&Pt(z,b["arrow-start"]),"arrow-end"in b&&Pt(z,b["arrow-end"],1),b.opacity!=null||b.fill!=null||b.src!=null||b.stroke!=null||b["stroke-width"]!=null||b["stroke-opacity"]!=null||b["fill-opacity"]!=null||b["stroke-dasharray"]!=null||b["stroke-miterlimit"]!=null||b["stroke-linejoin"]!=null||b["stroke-linecap"]!=null){var mt=A.getElementsByTagName("fill");if(!(mt=mt&&mt[0])&&(mt=ut("fill")),C.type=="image"&&b.src&&(mt.src=b.src),b.fill&&(mt.on=!0),mt.on!=null&&b.fill!="none"&&b.fill!==null||(mt.on=!1),mt.on&&b.fill){var Nt=m(b.fill).match(a._ISURL);if(Nt){mt.parentNode==A&&A.removeChild(mt),mt.rotate=!0,mt.src=Nt[1],mt.type="tile";var It=C.getBBox(1);mt.position=It.x+R+It.y,C._.fillpos=[It.x,It.y],a._preload(Nt[1],function(){C._.fillsize=[this.offsetWidth,this.offsetHeight]})}else mt.color=a.getRGB(b.fill).hex,mt.src=O,mt.type="solid",a.getRGB(b.fill).error&&(z.type in{circle:1,ellipse:1}||m(b.fill).charAt()!="r")&&Dt(z,b.fill,mt)&&(L.fill="none",L.gradient=b.fill,mt.rotate=!1)}if("fill-opacity"in b||"opacity"in b){var Ut=((+L["fill-opacity"]+1||2)-1)*((+L.opacity+1||2)-1)*((+a.getRGB(b.fill).o+1||2)-1);Ut=k(w(Ut,0),1),mt.opacity=Ut,mt.src&&(mt.color="none")}A.appendChild(mt);var Rt=A.getElementsByTagName("stroke")&&A.getElementsByTagName("stroke")[0],Zt=!1;!Rt&&(Zt=Rt=ut("stroke")),(b.stroke&&b.stroke!="none"||b["stroke-width"]||b["stroke-opacity"]!=null||b["stroke-dasharray"]||b["stroke-miterlimit"]||b["stroke-linejoin"]||b["stroke-linecap"])&&(Rt.on=!0),(b.stroke=="none"||b.stroke===null||Rt.on==null||b.stroke==0||b["stroke-width"]==0)&&(Rt.on=!1);var Wt=a.getRGB(b.stroke);Rt.on&&b.stroke&&(Rt.color=Wt.hex),Ut=((+L["stroke-opacity"]+1||2)-1)*((+L.opacity+1||2)-1)*((+Wt.o+1||2)-1);var ge=.75*(g(b["stroke-width"])||1);if(Ut=k(w(Ut,0),1),b["stroke-width"]==null&&(ge=L["stroke-width"]),b["stroke-width"]&&(Rt.weight=ge),ge&&ge<1&&(Ut*=ge)&&(Rt.weight=1),Rt.opacity=Ut,b["stroke-linejoin"]&&(Rt.joinstyle=b["stroke-linejoin"]||"miter"),Rt.miterlimit=b["stroke-miterlimit"]||8,b["stroke-linecap"]&&(Rt.endcap=b["stroke-linecap"]=="butt"?"flat":b["stroke-linecap"]=="square"?"square":"round"),"stroke-dasharray"in b){var je={"-":"shortdash",".":"shortdot","-.":"shortdashdot","-..":"shortdashdotdot",". ":"dot","- ":"dash","--":"longdash","- .":"dashdot","--.":"longdashdot","--..":"longdashdotdot"};Rt.dashstyle=je[h](b["stroke-dasharray"])?je[b["stroke-dasharray"]]:O}Zt&&A.appendChild(Rt)}if(z.type=="text"){z.paper.canvas.style.display=O;var de=z.paper.span,Ee=L.font&&L.font.match(/\d+(?:\.\d*)?(?=px)/);F=de.style,L.font&&(F.font=L.font),L["font-family"]&&(F.fontFamily=L["font-family"]),L["font-weight"]&&(F.fontWeight=L["font-weight"]),L["font-style"]&&(F.fontStyle=L["font-style"]),Ee=g(L["font-size"]||Ee&&Ee[0])||10,F.fontSize=100*Ee+"px",z.textpath.string&&(de.innerHTML=m(z.textpath.string).replace(/</g,"<").replace(/&/g,"&").replace(/\n/g,"<br>"));var Pe=de.getBoundingClientRect();z.W=L.w=(Pe.right-Pe.left)/100,z.H=L.h=(Pe.bottom-Pe.top)/100,z.X=L.x,z.Y=L.y+z.H/2,("x"in b||"y"in b)&&(z.path.v=a.format("m{0},{1}l{2},{1}",y(L.x*ct),y(L.y*ct),y(L.x*ct)+1));for(var ve=["x","y","text","font","font-family","font-weight","font-style","font-size"],ye=0,mn=ve.length;ye<mn;ye++)if(ve[ye]in b){z._.dirty=1;break}switch(L["text-anchor"]){case"start":z.textpath.style["v-text-align"]="left",z.bbx=z.W/2;break;case"end":z.textpath.style["v-text-align"]="right",z.bbx=-z.W/2;break;default:z.textpath.style["v-text-align"]="center",z.bbx=0}z.textpath.style["v-text-kern"]=!0}},Dt=function(C,b,A){C.attrs=C.attrs||{},C.attrs;var L=Math.pow,F="linear",B=".5 .5";if(C.attrs.gradient=b,b=(b=m(b).replace(a._radial_gradient,function(yt,Tt,wt){return F="radial",Tt&&wt&&(Tt=g(Tt),wt=g(wt),L(Tt-.5,2)+L(wt-.5,2)>.25&&(wt=x.sqrt(.25-L(Tt-.5,2))*(2*(wt>.5)-1)+.5),B=Tt+R+wt),O})).split(/\s*\-\s*/),F=="linear"){var q=b.shift();if(q=-g(q),isNaN(q))return null}var z=a._parseDots(b);if(!z)return null;if(C=C.shape||C.node,z.length){C.removeChild(A),A.on=!0,A.method="none",A.color=z[0].color,A.color2=z[z.length-1].color;for(var J=[],at=0,ft=z.length;at<ft;at++)z[at].offset&&J.push(z[at].offset+R+z[at].color);A.colors=J.length?J.join():"0% "+A.color,F=="radial"?(A.type="gradientTitle",A.focus="100%",A.focussize="0 0",A.focusposition=B,A.angle=0):(A.type="gradient",A.angle=(270-q)%360),C.appendChild(A)}return 1},K=function(C,b){this[0]=this.node=C,C.raphael=!0,this.id=a._oid++,C.raphaelid=this.id,this.X=0,this.Y=0,this.attrs={},this.paper=b,this.matrix=a.matrix(),this._={transform:[],sx:1,sy:1,dx:0,dy:0,deg:0,dirty:1,dirtyT:1},!b.bottom&&(b.bottom=this),this.prev=b.top,b.top&&(b.top.next=this),b.top=this,this.next=null},it=a.el;K.prototype=it,it.constructor=K,it.transform=function(C){if(C==null)return this._.transform;var b,A=this.paper._viewBoxShift,L=A?"s"+[A.scale,A.scale]+"-1-1t"+[A.dx,A.dy]:O;A&&(b=C=m(C).replace(/\.{3}|\u2026/g,this._.transform||O)),a._extractTransform(this,L+C);var F,B=this.matrix.clone(),q=this.skew,z=this.node,J=~m(this.attrs.fill).indexOf("-"),at=!m(this.attrs.fill).indexOf("url(");if(B.translate(1,1),at||J||this.type=="image")if(q.matrix="1 0 0 1",q.offset="0 0",F=B.split(),J&&F.noRotation||!F.isSimple){z.style.filter=B.toFilter();var ft=this.getBBox(),yt=this.getBBox(1),Tt=ft.x-yt.x,wt=ft.y-yt.y;z.coordorigin=Tt*-ct+R+wt*-ct,pt(this,1,1,Tt,wt,0)}else z.style.filter=O,pt(this,F.scalex,F.scaley,F.dx,F.dy,F.rotate);else z.style.filter=O,q.matrix=m(B),q.offset=B.offset();return b!==null&&(this._.transform=b,a._extractTransform(this,b)),this},it.rotate=function(C,b,A){if(this.removed)return this;if(C!=null){if((C=m(C).split(D)).length-1&&(b=g(C[1]),A=g(C[2])),C=g(C[0]),A==null&&(b=A),b==null||A==null){var L=this.getBBox(1);b=L.x+L.width/2,A=L.y+L.height/2}return this._.dirtyT=1,this.transform(this._.transform.concat([["r",C,b,A]])),this}},it.translate=function(C,b){return this.removed?this:((C=m(C).split(D)).length-1&&(b=g(C[1])),C=g(C[0])||0,b=+b||0,this._.bbox&&(this._.bbox.x+=C,this._.bbox.y+=b),this.transform(this._.transform.concat([["t",C,b]])),this)},it.scale=function(C,b,A,L){if(this.removed)return this;if((C=m(C).split(D)).length-1&&(b=g(C[1]),A=g(C[2]),L=g(C[3]),isNaN(A)&&(A=null),isNaN(L)&&(L=null)),C=g(C[0]),b==null&&(b=C),L==null&&(A=L),A==null||L==null)var F=this.getBBox(1);return A=A??F.x+F.width/2,L=L??F.y+F.height/2,this.transform(this._.transform.concat([["s",C,b,A,L]])),this._.dirtyT=1,this},it.hide=function(){return!this.removed&&(this.node.style.display="none"),this},it.show=function(){return!this.removed&&(this.node.style.display=O),this},it.auxGetBBox=a.el.getBBox,it.getBBox=function(){var C=this.auxGetBBox();if(this.paper&&this.paper._viewBoxShift){var b={},A=1/this.paper._viewBoxShift.scale;return b.x=C.x-this.paper._viewBoxShift.dx,b.x*=A,b.y=C.y-this.paper._viewBoxShift.dy,b.y*=A,b.width=C.width*A,b.height=C.height*A,b.x2=b.x+b.width,b.y2=b.y+b.height,b}return C},it._getBBox=function(){return this.removed?{}:{x:this.X+(this.bbx||0)-this.W/2,y:this.Y-this.H,width:this.W,height:this.H}},it.remove=function(){if(!this.removed&&this.node.parentNode){for(var C in this.paper.__set__&&this.paper.__set__.exclude(this),a.eve.unbind("raphael.*.*."+this.id),a._tear(this,this.paper),this.node.parentNode.removeChild(this.node),this.shape&&this.shape.parentNode.removeChild(this.shape),this)this[C]=typeof this[C]=="function"?a._removedFactory(C):null;this.removed=!0}},it.attr=function(C,b){if(this.removed)return this;if(C==null){var A={};for(var L in this.attrs)this.attrs[h](L)&&(A[L]=this.attrs[L]);return A.gradient&&A.fill=="none"&&(A.fill=A.gradient)&&delete A.gradient,A.transform=this._.transform,A}if(b==null&&a.is(C,"string")){if(C=="fill"&&this.attrs.fill=="none"&&this.attrs.gradient)return this.attrs.gradient;for(var F=C.split(D),B={},q=0,z=F.length;q<z;q++)(C=F[q])in this.attrs?B[C]=this.attrs[C]:a.is(this.paper.customAttributes[C],"function")?B[C]=this.paper.customAttributes[C].def:B[C]=a._availableAttrs[C];return z-1?B:B[F[0]]}if(this.attrs&&b==null&&a.is(C,"array")){for(B={},q=0,z=C.length;q<z;q++)B[C[q]]=this.attr(C[q]);return B}var J;for(var at in b!=null&&((J={})[C]=b),b==null&&a.is(C,"object")&&(J=C),J)N("raphael.attr."+at+"."+this.id,this,J[at]);if(J){for(at in this.paper.customAttributes)if(this.paper.customAttributes[h](at)&&J[h](at)&&a.is(this.paper.customAttributes[at],"function")){var ft=this.paper.customAttributes[at].apply(this,[].concat(J[at]));for(var yt in this.attrs[at]=J[at],ft)ft[h](yt)&&(J[yt]=ft[yt])}J.text&&this.type=="text"&&(this.textpath.string=J.text),kt(this,J)}return this},it.toFront=function(){return!this.removed&&this.node.parentNode.appendChild(this.node),this.paper&&this.paper.top!=this&&a._tofront(this,this.paper),this},it.toBack=function(){return this.removed?this:(this.node.parentNode.firstChild!=this.node&&(this.node.parentNode.insertBefore(this.node,this.node.parentNode.firstChild),a._toback(this,this.paper)),this)},it.insertAfter=function(C){return this.removed?this:(C.constructor==a.st.constructor&&(C=C[C.length-1]),C.node.nextSibling?C.node.parentNode.insertBefore(this.node,C.node.nextSibling):C.node.parentNode.appendChild(this.node),a._insertafter(this,C,this.paper),this)},it.insertBefore=function(C){return this.removed?this:(C.constructor==a.st.constructor&&(C=C[0]),C.node.parentNode.insertBefore(this.node,C.node),a._insertbefore(this,C,this.paper),this)},it.blur=function(C){var b=this.node.runtimeStyle,A=b.filter;return A=A.replace(nt,O),+C!=0?(this.attrs.blur=C,b.filter=A+R+" progid:DXImageTransform.Microsoft.Blur(pixelradius="+(+C||1.5)+")",b.margin=a.format("-{0}px 0 0 -{0}px",y(+C||1.5))):(b.filter=A,b.margin=0,delete this.attrs.blur),this},a._engine.path=function(C,b){var A=ut("shape");A.style.cssText=ot,A.coordsize=ct+R+ct,A.coordorigin=b.coordorigin;var L=new K(A,b),F={fill:"none",stroke:"#000"};C&&(F.path=C),L.type="path",L.path=[],L.Path=O,kt(L,F),b.canvas&&b.canvas.appendChild(A);var B=ut("skew");return B.on=!0,A.appendChild(B),L.skew=B,L.transform(O),L},a._engine.rect=function(C,b,A,L,F,B){var q=a._rectPath(b,A,L,F,B),z=C.path(q),J=z.attrs;return z.X=J.x=b,z.Y=J.y=A,z.W=J.width=L,z.H=J.height=F,J.r=B,J.path=q,z.type="rect",z},a._engine.ellipse=function(C,b,A,L,F){var B=C.path();return B.attrs,B.X=b-L,B.Y=A-F,B.W=2*L,B.H=2*F,B.type="ellipse",kt(B,{cx:b,cy:A,rx:L,ry:F}),B},a._engine.circle=function(C,b,A,L){var F=C.path();return F.attrs,F.X=b-L,F.Y=A-L,F.W=F.H=2*L,F.type="circle",kt(F,{cx:b,cy:A,r:L}),F},a._engine.image=function(C,b,A,L,F,B){var q=a._rectPath(A,L,F,B),z=C.path(q).attr({stroke:"none"}),J=z.attrs,at=z.node,ft=at.getElementsByTagName("fill")[0];return J.src=b,z.X=J.x=A,z.Y=J.y=L,z.W=J.width=F,z.H=J.height=B,J.path=q,z.type="image",ft.parentNode==at&&at.removeChild(ft),ft.rotate=!0,ft.src=b,ft.type="tile",z._.fillpos=[A,L],z._.fillsize=[F,B],at.appendChild(ft),pt(z,1,1,0,0,0),z},a._engine.text=function(C,b,A,L){var F=ut("shape"),B=ut("path"),q=ut("textpath");b=b||0,A=A||0,L=L||"",B.v=a.format("m{0},{1}l{2},{1}",y(b*ct),y(A*ct),y(b*ct)+1),B.textpathok=!0,q.string=m(L),q.on=!0,F.style.cssText=ot,F.coordsize=ct+R+ct,F.coordorigin="0 0";var z=new K(F,C),J={fill:"#000",stroke:"none",font:a._availableAttrs.font,text:L};z.shape=F,z.path=B,z.textpath=q,z.type="text",z.attrs.text=m(L),z.attrs.x=b,z.attrs.y=A,z.attrs.w=1,z.attrs.h=1,kt(z,J),F.appendChild(q),F.appendChild(B),C.canvas.appendChild(F);var at=ut("skew");return at.on=!0,F.appendChild(at),z.skew=at,z.transform(O),z},a._engine.setSize=function(C,b){var A=this.canvas.style;return this.width=C,this.height=b,C==+C&&(C+="px"),b==+b&&(b+="px"),A.width=C,A.height=b,A.clip="rect(0 "+C+" "+b+" 0)",this._viewBox&&a._engine.setViewBox.apply(this,this._viewBox),this},a._engine.setViewBox=function(C,b,A,L,F){a.eve("raphael.setViewBox",this,this._viewBox,[C,b,A,L,F]);var B,q,z=this.getSize(),J=z.width,at=z.height;return F&&(A*(B=at/L)<J&&(C-=(J-A*B)/2/B),L*(q=J/A)<at&&(b-=(at-L*q)/2/q)),this._viewBox=[C,b,A,L,!!F],this._viewBoxShift={dx:-C,dy:-b,scale:z},this.forEach(function(ft){ft.transform("...")}),this},a._engine.initWin=function(C){var b=C.document;b.styleSheets.length<31?b.createStyleSheet().addRule(".rvml","behavior:url(#default#VML)"):b.styleSheets[0].addRule(".rvml","behavior:url(#default#VML)");try{!b.namespaces.rvml&&b.namespaces.add("rvml","urn:schemas-microsoft-com:vml"),ut=function(A){return b.createElement("<rvml:"+A+' class="rvml">')}}catch{ut=function(L){return b.createElement("<"+L+' xmlns="urn:schemas-microsoft.com:vml" class="rvml">')}}},a._engine.initWin(a._g.win),a._engine.create=function(){var C=a._getContainer.apply(0,arguments),b=C.container,A=C.height,L=C.width,F=C.x,B=C.y;if(!b)throw new Error("VML container not found.");var q=new a._Paper,z=q.canvas=a._g.doc.createElement("div"),J=z.style;return F=F||0,B=B||0,L=L||512,A=A||342,q.width=L,q.height=A,L==+L&&(L+="px"),A==+A&&(A+="px"),q.coordsize=216e5+R+216e5,q.coordorigin="0 0",q.span=a._g.doc.createElement("span"),q.span.style.cssText="position:absolute;left:-9999em;top:-9999em;padding:0;margin:0;line-height:1;",z.appendChild(q.span),J.cssText=a.format("top:0;left:0;width:{0};height:{1};display:inline-block;position:relative;clip:rect(0 {0} {1} 0);overflow:hidden",L,A),b==1?(a._g.doc.body.appendChild(z),J.left=F+"px",J.top=B+"px",J.position="absolute"):b.firstChild?b.insertBefore(z,b.firstChild):b.appendChild(z),q.renderfix=function(){},q},a.prototype.clear=function(){a.eve("raphael.clear",this),this.canvas.innerHTML=O,this.span=a._g.doc.createElement("span"),this.span.style.cssText="position:absolute;left:-9999em;top:-9999em;padding:0;margin:0;line-height:1;display:inline;",this.canvas.appendChild(this.span),this.bottom=this.top=null},a.prototype.remove=function(){for(var C in a.eve("raphael.remove",this),this.canvas.parentNode.removeChild(this.canvas),this)this[C]=typeof this[C]=="function"?a._removedFactory(C):null;return!0};var st=a.st;for(var E in it)it[h](E)&&!st[h](E)&&(st[E]=function(C){return function(){var b=arguments;return this.forEach(function(A){A[C].apply(A,b)})}}(E))}}.apply(n,s))===void 0||(e.exports=o)}])})})(_s);var _o=_s.exports;const Yt=Ei(_o);class Dn{points;constructor(t=[]){this.points=t}toSVGPathData(){const t=[];for(let e=0,n=this.length;e<n;e++)t.push([e===0?"M":"L",this.points[e].x,this.points[e].y]);return t}toSVGPathD(){let t="";for(let e=0,n=this.length;e<n;e++)t+=(e===0?"M":"L")+this.points[e].x+","+this.points[e].y;return t}get length(){return this.points.length}addPoint(t){this.points.push(t)}getPoint(t){return this.points[t]}isContainPoint(t){const e=t.x,n=t.y,r=this.length;let s=!1;const o=2e-10;for(let a=0,h=r-1;a<r;h=a,a++){const m=this.points[a].x,g=this.points[a].y,x=this.points[h].x,y=this.points[h].y;if(m===e&&g===n||x===e&&y===n||n===g&&n===y)return!0;if(n>=g&&n<y||n<g&&n>=y){const w=(x-m)/(y-g),k=m+w*(n-g);if(k===e||Math.abs(k-e)<o)return!0;k>e&&(s=!s)}}return s}[Symbol.iterator](){let t=0;return{next:()=>({value:t>=this.length-1?this.points[++t]:void 0,done:t>=this.length})}}static generateInMultiplePoint(t,e,n,r,s=1){const o=new Dn;for(let a=0;a<=s*n;a+=1){const h=Math.floor(a/s)/n*2*Math.PI,m=t+Math.cos(h)*r,g=e+Math.sin(h)*r;o.addPoint(new fe({x:m,y:g}))}return o}}Yt.easing_formulas.swing=function(i){return i+Math.sin(i*Math.PI*2)/2},Yt.easing_formulas.may_cause_seizures=function(i){return i+.2*Math.random()-.1};function Co(i,t,e){let n;return i&&typeof i=="object"&&i.canvas?n=i:i&&(typeof i=="string"||i instanceof HTMLElement)?n=Yt(i,t,e):n=Yt(0,0,t,e),n}Yt.fn.importSVG=function(i,t){const e=To.fromRawSVG(i);return e.toRaphael(this,(n,r)=>{e.save(),t&&t(n),r(),e.restore()}),this},Yt.fn.NPolygonPath=function(i,t,e,n,r=2){return{shape:this.path(Dn.generateInMultiplePoint(i,t,e,n,r).toSVGPathD()),afterPath:Dn.generateInMultiplePoint(i,t,e*r,n,1).toSVGPathD()}},Yt.fn.zoom=function(i=1){return this.setViewBox(0,0,this.width/i,this.height/i),this},Yt.fn.brickwall=function(i,t,e,n,r){for(var s=n/r,o=e/3,a={fill:"firebrick",stroke:"#CCC"},h=0;h<r;h+=1){var m=this.rect(0,0,o,s).attr(a),g=this.rect(0,0,2*o,s).attr(a);h%2?(m.transform("T"+i+","+(t+h*s)),g.transform("T"+(i+o)+","+(t+h*s))):(g.transform("T"+i+","+(t+h*s)),m.transform("T"+(i+2*o)+","+(t+h*s)))}},Yt.fn.rosetta=function(i,t,e,n,r){const s=Ke.generateRosetta(i,t,e,n,r);return s.center,this.path(s.toSVGPathD())},Yt.fn.moon=function(i){i=i||{},i.r=typeof i.r=="number"?i.r:100,i.phase=typeof i.phase=="number"?i.phase:.25,i.x=typeof i.x=="number"?i.x:0,i.y=typeof i.y=="number"?i.y:0,this.circle(i.r+i.x,i.r+i.y,i.r).attr({"stroke-width":0,fill:"#999"});function t(n){n=typeof n=="number"?n:.25,n=Math.max(0,Math.min(1,n)),n=(n-.5)*2;let r="M"+i.r+",0";r+="a"+i.r+","+i.r+" 0 0,0 0,"+i.r*2;let s=n>0?0:1;return n=Math.abs(n),n=n||1e-4,i.inner_r=i.r/Math.pow(n,.5),r+="M"+i.r+","+i.r*2,r+="a"+i.inner_r+","+i.inner_r+" 0 0,"+s+" 0,"+i.r*-2,r}var e=this.path(t(i.phase)).attr({"stroke-width":0,stroke:"#999",fill:"#FF9"}).transform("T"+i.x+","+i.y);return{setPhase:function(n){e.attr("path",t(n))}}},Yt.fn.star=function(i,t,e){let n="M"+i+","+(t-e);for(var r=0;r<6;r+=1){const s=270+r*144,o=i+e*Math.cos(s*Math.PI/180),a=t+e*Math.sin(s*Math.PI/180);n+="L"+o+","+a}return this.path(n).attr("stroke-width",0).attr("fill","red")},Yt.fn.heart=function(i=150,t=300){let e="M"+i+","+t;return e+="l120,-175a50,50 0 0,0 -120,-75a50,50 0 0,0 -120,75l120,175",this.path(e).attr("stroke","red").attr("fill","pink")},Yt.el.redder=function(){const i=Yt.getRGB(this.attr("fill"));i.r+=51,this.attr("fill","rgb("+i.r+","+i.g+","+i.b+")")},Yt.installCustomAttributes=function(i){i.customAttributes.redness=function(t){const e=255*(1-t/100);return{fill:"rgb(255,"+e+", "+e+")"}},i.customAttributes.progress=function(t){const e=this.data("progresspath"),n=this.attr(),r={x:0,y:0},s=this.data("progresstrail");if(!e)return{transform:"t0,0"};Object.prototype.hasOwnProperty.call(n,"width")&&(r.x=-this.attr("width")/2,r.y=-this.attr("height")/2);const o=e.getTotalLength(),a=e.getPointAtLength(t*o);return s&&s.attr("path",e.getSubpath(0,t*o)),{transform:"t"+(a.x+r.x)+","+(a.y+r.y)+"r"+a.alpha}}};const Ki=Yt;class ze{pgs=[];history=[];save(){this.history.push(yr(this.pgs))}restore(){const t=this.history.pop();t&&(this.pgs=t)}get size(){let t=0,e=0;return this.pgs.forEach(n=>{const r=n.pg;if(r){const[s,o,a,h]=r.bounds,[m,g]=r.size;t=Math.max(t,s,s+m,a),e=Math.max(e,o,o+g,h)}}),[Math.ceil(t),Math.ceil(e)]}static fromRawSVG(t){return ze.fromRawSVGUseRappar(t)}static fromRawSVGUseRappar(t){const e=new ze,n=ss(t);for(let r=0,s=n.length;r<s;r++){const o=n[r];if(o.type=="viewbox"&&o.width&&o.height)continue;const a={attrs:{}};for(const h in o)h==="type"||h==="path"||h==="transform"||(a.attrs[h]=o[h]);switch(o.type){case"path":a.d=o.path,a.pg=Ke.fromSVGPathD(o.path,o.transform);break}e.pgs.push(a)}return e}toRaphael(t,e){let n;t instanceof HTMLElement?n=Ki(HTMLElement):typeof t=="string"?n=Ki(document.getElementById(t)):n=t;const[r,s]=this.size;n.setSize(r,s);const o=(a=!1)=>{for(let h=0,m=this.pgs.length;h<m;h++){const g=this.pgs[h];if(g.pg&&(g.raphaelPath?g.raphaelPath.attr("path",g.pg.toSVGPathD()):g.raphaelPath=n.path(g.pg.toSVGPathD()),g.raphaelPath.attr(g.attrs)),a&&e){const x=y=>{const{x:w,y:k}=Hn(n.canvas,y),P=this.pgs.find(D=>D.raphaelPath?.isPointInside(w,k));P&&e?.(P,o)};g.raphaelPath?.unclick(x),g.raphaelPath?.click(x)}}};return o(!0),n}toCanvasOperation(t,e){let n;typeof t=="string"?n=document.getElementById(t):n=t;const[r,s]=this.size;n.width=r,n.height=s;const o=new Qi(n),a=()=>{o.clearRect(0,0,r,s);for(let m=0,g=this.pgs.length;m<g;m++){const x=this.pgs[m];x.pg&&(o.save(),this.toCanvasAttrs(o,x.attrs),x.pg.toCanvas(o),x.attrs.stroke!=="none"&&o.stroke(),x.attrs.fill!=="none"&&o.fill(),o.restore())}};a();const h=m=>{const{x:g,y:x}=Hn(o.canvas,m),y=this.pgs.find(w=>w.pg?.isPointInPath(g,x));y&&e?.(y,a)};return n.removeEventListener("click",h),n.addEventListener("click",h),o}toCanvasAttrs(t,e){for(const n in e){const r=e[n];switch(n){case"fill":t.fillStyle=String(r);break;case"stroke":t.strokeStyle=String(r);break;case"stroke-width":t.lineWidth=Number(r);break;case"stroke-linecap":t.lineCap=r;break;case"stroke-linejoin":t.lineJoin=r;break}}}static toDownloadSVGElement(t,e="shape"){Ai(Dr(t),`${e}.svg`)}toDownloadSVGElement(t,e="shape"){return ze.toDownloadSVGElement(t,e),this}static toDownloadSVGString(t,e="shape"){Ai(ki(t),`${e}.svg`)}toDownloadSVGString(t,e="shape"){return ze.toDownloadSVGString(t,e),this}static getSVGDOM(t){if(t instanceof HTMLObjectElement||t instanceof HTMLIFrameElement)return t.contentDocument;if(t instanceof HTMLEmbedElement)return t.getSVGDocument()}}const To=ze;class Qi{canvas;context;customContext;constructor(t){this.canvas=t,this.context=t.getContext("2d",{willReadFrequently:!0}),this.customContext=new Mn({canvas:this.canvas,width:this.canvas.width,height:this.canvas.height})}set lineWidth(t){this.context.lineWidth=t,this.customContext.lineWidth=t}get lineWidth(){return this.context.lineWidth}set lineCap(t){this.context.lineCap=t,this.customContext.lineCap=t}get lineCap(){return this.context.lineCap}set lineJoin(t){this.context.lineJoin=t,this.customContext.lineCap=t}get lineJoin(){return this.context.lineJoin}set lineDashOffset(t){this.context.lineDashOffset=t,this.customContext.lineDashOffset=t}get lineDashOffset(){return this.context.lineDashOffset}set miterLimit(t){this.context.miterLimit=t,this.customContext.miterLimit=t}get miterLimit(){return this.context.miterLimit}set globalAlpha(t){this.context.globalAlpha=t,this.customContext.globalAlpha=t}get globalAlpha(){return this.context.globalAlpha}set fillStyle(t){typeof t=="string"||t instanceof CanvasGradient||t instanceof CanvasPattern?(this.context.fillStyle=t,this.customContext.fillStyle=t):(this.context.fillStyle=t.gradient,this.customContext.fillStyle=t.gradientCustom)}get fillStyle(){return this.context.fillStyle}set strokeStyle(t){typeof t=="string"||t instanceof CanvasGradient||t instanceof CanvasPattern?(this.context.strokeStyle=t,this.customContext.strokeStyle=t):(this.context.strokeStyle=t.gradient,this.customContext.strokeStyle=t.gradientCustom)}get strokeStyle(){return this.context.strokeStyle}set font(t){this.context.font=t,this.customContext.font=t}get font(){return this.context.font}fill(){return this.context.fill(),this.customContext.fill(),this}fillRect(t,e,n,r){return this.context.fillRect(t,e,n,r),this.customContext.fillRect(t,e,n,r),this}fillText(t,e,n,r){return this.context.fillText(t,e,n,r),this.customContext.fillText(t,e,n),this}setLineDash(t){return this.context.setLineDash(t),this.customContext.setLineDash(t),this}stroke(){return this.context.stroke(),this.customContext.stroke(),this}strokeText(t,e,n,r){return this.context.strokeText(t,e,n,r),this.customContext.strokeText(t,e,n),this}strokeRect(t,e,n,r){return this.context.strokeRect(t,e,n,r),this.customContext.strokeRect(t,e,n,r),this}clearRect(t=0,e=0,n=this.canvas.width,r=this.canvas.height){return this.context.clearRect(t,e,n,r),this.customContext.clearRect(t,e,n,r),this}save(){return this.context.save(),this.customContext.save(),this}restore(){return this.context.restore(),this.customContext.restore(),this}beginPath(){return this.context.beginPath(),this.customContext.beginPath(),this}closePath(){return this.context.closePath(),this.customContext.closePath(),this}isPointInPath(t,e){return this.context.isPointInPath(t,e)}moveTo(t,e){return this.context.moveTo(t,e),this.customContext.moveTo(t,e),this}lineTo(t,e){return this.context.lineTo(t,e),this.customContext.lineTo(t,e),this}arc(t,e,n,r,s,o){return this.context.arc(t,e,n,r,s,o),this.customContext.arc(t,e,n,r,s,o?-1:1),this}arcTo(t,e,n,r,s){return this.context.arcTo(t,e,n,r,s),this.customContext.arcTo(t,e,n,r,s),this}quadraticCurveTo(t,e,n,r){return this.context.quadraticCurveTo(t,e,n,r),this.customContext.quadraticCurveTo(t,e,n,r),this}bezierCurveTo(t,e,n,r,s,o){return this.context.bezierCurveTo(t,e,n,r,s,o),this.customContext.bezierCurveTo(t,e,n,r,s,o),this}rect(t,e,n,r){return this.context.rect(t,e,n,r),this.customContext.rect(t,e,n,r),this}translate(t,e){return this.context.translate(t,e),this.customContext.translate(t,e),this}rotate(t){return this.context.rotate(t),this.customContext.rotate(t),this}scale(t,e){return this.context.scale(t,e),this.customContext.scale(t,e),this}createLinearGradient(t,e,n,r,s){const o=this.context.createLinearGradient(t,e,n,r),a=this.customContext.createLinearGradient(t,e,n,r);return s&&Object.keys(s).forEach(h=>{const m=parseFloat(h);o.addColorStop(m,s[m]),a.addColorStop(m,s[m])}),{gradient:o,gradientCustom:a}}createRadialGradient(t,e,n,r,s,o,a){const h=this.context.createRadialGradient(t,e,n,r,s,o),m=this.customContext.createRadialGradient(t,e,n,r,s,o);return a&&Object.keys(a).forEach(g=>{const x=parseFloat(g);h.addColorStop(x,a[x]),m.addColorStop(x,a[x])}),{gradient:h,gradientCustom:m}}drawImage(t,...e){if(e.length===0)this.context.drawImage(t,0,0);else if(e.length===2){const n=e[0],r=e[1];this.context.drawImage(t,n,r)}else if(e.length===4){const n=e[0],r=e[1],s=e[2],o=e[3];this.context.drawImage(t,n,r,s,o)}else if(e.length===8){const n=e[0],r=e[1],s=e[2],o=e[3],a=e[4],h=e[5],m=e[6],g=e[7];this.context.drawImage(t,n,r,s,o,a,h,m,g)}else throw new Error("Invalid number of arguments passed to drawImage: "+e.length);return this.customContext.drawImage(t,...e),this}getImageData(t,e,n,r,s){return this.context.getImageData(t,e,n,r,s)}putImageData(t,e=0,n=0){return this.context.putImageData(t,e,n)}toRawSVG(){const t=this.customContext.getSerializedSvg(!0),e=this.customContext.getSvg();return{raw:t,element:e}}toSVGOperation(){const{raw:t}=this.toRawSVG();return ze.fromRawSVG(t)}}class Gt extends fa{container;mousePoint;ctx;hammer;domEventRemoveListeners=[];constructor(t=document.documentElement,e=!0){super(),this.container=t,this.hammer=new $a(this.container),this.mousePoint=new fe({x:0,y:0}),this.container instanceof HTMLCanvasElement&&(this.ctx=new Qi(this.container)),e&&this.start()}static singleton;static globalScrollChangeCallbacks=[];static get page(){if(!Gt.singleton){Gt.singleton=new Gt,Gt.singleton.registerKeyDown({title:"打开",key:"o",ctrl:!0,exact:!0},()=>{Rr().then(e=>Mi(e[0])).then(e=>{Gt.singleton.emit("openFile",e)}).catch(e=>{Gt.singleton.emit("openFileError",e)})}),Gt.singleton.registerMatchMediaChange("(prefers-color-scheme: dark)");const t=()=>Gt.globalScrollChangeCallbacks.forEach(e=>e());Gt.singleton.registerGlobalScrollChange=e=>{Gt.globalScrollChangeCallbacks.push(e),Gt.globalScrollChangeCallbacks.length==1&&document.addEventListener("scroll",t)},Gt.singleton.removeGlobalScrollChange=e=>{const n=Gt.globalScrollChangeCallbacks.findIndex(r=>r==e);n>=0&&(Gt.globalScrollChangeCallbacks.splice(n,1),Gt.globalScrollChangeCallbacks.length==0&&document.removeEventListener("scroll",t))}}return Gt.singleton}start(){this.initMouseEventListeners(),this.on("pointerMove",this.setMousePoint),this.addDOMEventRemoveListeners(()=>{this.off("pointerMove",this.setMousePoint)}),this.registerResizeObserver()}restart(){this.destroy(),this.start()}destroy(){this.domEventRemoveListeners.forEach(t=>t()),this.removeAllListeners()}addDOMEventRemoveListeners(t){this.domEventRemoveListeners.push(t)}setMousePoint(t){const e=Hn(this.container,t);return this.mousePoint.x=e.x,this.mousePoint.y=e.y,e}initMouseEventListeners(){const t=K=>{this.emit("mouseDown",K),this.container.style.userSelect="none"},e=K=>{this.emit("mouseUp",K),this.container.style.userSelect=""},n=K=>{this.emit("mouseMove",K)},r=K=>{this.emit("mouseOver",K)},s=K=>{this.emit("mouseOut",K),this.container.style.userSelect=""},o=K=>{this.emit("mouseClick",K)},a=K=>{this.emit("mouseDoubleClick",K)},h=K=>{this.emit("mouseWheel",K)},m=K=>{this.emit("mouseContextMenu",K)},g=K=>{this.emit("touchStart",K),this.container.style.userSelect="none"},x=K=>{this.emit("touchEnd",K),this.container.style.userSelect=""},y=K=>{this.emit("touchCancel",K),this.container.style.userSelect=""},w=K=>{this.emit("touchMove",K)},k=K=>{this.emit("pointerDown",K),this.container.style.userSelect="none"},P=K=>{this.emit("pointerUp",K),this.container.style.userSelect=""},D=K=>{this.emit("pointerCancel",K),this.container.style.userSelect=""},N=K=>{this.emit("pointerMove",K)},R=K=>{this.emit("pan",K)},O=K=>{this.emit("panStart",K),this.container.style.userSelect="none"},X=K=>{this.emit("panMove",K)},Y=K=>{this.emit("panEnd",K),this.container.style.userSelect=""},nt=K=>{this.emit("panCancel",K),this.container.style.userSelect=""},V=K=>{this.emit("panLeft",K)},ot=K=>{this.emit("panRight",K)},ct=K=>{this.emit("panUp",K),this.container.style.userSelect=""},vt=K=>{this.emit("panDown",K),this.container.style.userSelect="none"},dt=K=>{this.emit("pinch",K)},ht=K=>{this.emit("press",K)},pt=K=>{this.emit("rotate",K)},ut=K=>{this.emit("swipe",K)},Pt=K=>{this.emit("tap",K)},kt=K=>{!K.target||this.container==K.target||this.container.contains(K.target)||this.emit("tapOutSide",K)};this.container.addEventListener("mousedown",t),this.container.addEventListener("mouseup",e),this.container.addEventListener("mousemove",n),this.container.addEventListener("mouseover",r),this.container.addEventListener("mouseout",s),this.container.addEventListener("click",o),this.container.addEventListener("dblclick",a),this.container.addEventListener("wheel",h),this.container.addEventListener("contextmenu",m),this.container.addEventListener("touchstart",g),this.container.addEventListener("touchend",x),this.container.addEventListener("touchcancel",y),this.container.addEventListener("touchmove",w),this.container.addEventListener("pointerdown",k),this.container.addEventListener("pointerup",P),this.container.addEventListener("pointercancel",D),this.container.addEventListener("pointermove",N),this.hammer.on("pan",R),this.hammer.on("panstart",O),this.hammer.on("panmove",X),this.hammer.on("panend",Y),this.hammer.on("pancancel",nt),this.hammer.on("panleft",V),this.hammer.on("panright",ot),this.hammer.on("panup",ct),this.hammer.on("pandown",vt),this.hammer.on("pinch",dt),this.hammer.on("press",ht),this.hammer.on("rotate",pt),this.hammer.on("swipe",ut),this.hammer.on("tap",Pt),document.addEventListener("pointerdown",kt,!1);const Dt=()=>{this.container.removeEventListener("mousedown",t),this.container.removeEventListener("mouseup",e),this.container.removeEventListener("mousemove",n),this.container.removeEventListener("mouseover",r),this.container.removeEventListener("mouseout",s),this.container.removeEventListener("click",o),this.container.removeEventListener("dblclick",a),this.container.removeEventListener("wheel",h),this.container.removeEventListener("contextmenu",m),this.container.removeEventListener("touchstart",g),this.container.removeEventListener("touchend",x),this.container.removeEventListener("touchcancel",y),this.container.removeEventListener("touchmove",w),this.container.removeEventListener("pointerdown",k),this.container.removeEventListener("pointerup",P),this.container.removeEventListener("pointercancel",D),this.container.removeEventListener("pointermove",N),this.hammer.off("pan",R),this.hammer.off("panstart",O),this.hammer.off("panmove",X),this.hammer.off("panend",Y),this.hammer.off("pancancel",nt),this.hammer.off("panleft",V),this.hammer.off("panright",ot),this.hammer.off("panup",ct),this.hammer.off("pandown",vt),this.hammer.off("pinch",dt),this.hammer.off("press",ht),this.hammer.off("rotate",pt),this.hammer.off("swipe",ut),this.hammer.off("tap",Pt),document.removeEventListener("pointerdown",kt,!1),document.removeEventListener("touchstart",kt,!1),document.removeEventListener("mousedown",kt,!1)};return this.addDOMEventRemoveListeners(Dt),Dt}registerKeyDown(t,e,n){const r=Kr.on(t,o=>(e(o,r.formatedKeyNames,r.pause,r.restart),n)),s=()=>{r.removeListener?.()};return this.addDOMEventRemoveListeners(s),s}registerResizeObserver(){const t=new ResizeObserver(n=>{const{width:r,height:s}=n[0].contentRect;this.emit("resize",r,s)});t.observe(this.container);const e=()=>{t.unobserve(this.container)};return this.addDOMEventRemoveListeners(e),e}registerMatchMediaChange(t){let e="";switch(t){case"(prefers-color-scheme: dark)":e="matchMediaChangePrefersColorSchemeDark";break;default:e=t;break}const n=s=>{this.emit(e,s.matches)};window.matchMedia(t).addEventListener("change",n);const r=()=>{window.matchMedia(t).removeEventListener("change",n)};return this.addDOMEventRemoveListeners(r),r}registerElementDisplayInParentWhenScrollChange(t){const e={threshold:t?.threshold||.5,root:t?.parentElement},n=new IntersectionObserver((s,o)=>{let a=s[0];if(s.length>1){const m=s.find(g=>g.isIntersecting);m&&(a=m)}a.isIntersecting&&a.intersectionRatio>=e.threshold?this.emit("showInParent"):this.emit("showOffParent")},e);n.observe(this.container);const r=()=>{n.unobserve(this.container)};return this.addDOMEventRemoveListeners(r),r}registerPullDownRefresh(t){const e=t?.distance||50;let n=0,r=0;return this.captureMove({start:s=>{n=this.setMousePoint(s).y},move:()=>{r=this.mousePoint.y-n,r>0&&r<e&&this.emit("pullDownIng",r)},end:()=>{r>=e&&this.emit("pullDown")}})}registerPullUpLoading(t){const e=t?.distance||50;let n=0,r=0;return this.captureMove({start:s=>{n=this.setMousePoint(s).y},move:()=>{r=n-this.mousePoint.y,r>0&&r<e&&this.emit("pullUpIng",r)},end:()=>{r>=e&&this.emit("pullUp")}})}static isTouchEnabled(){return"ontouchstart"in window||navigator.maxTouchPoints>0}captureMove(t){return this.captureMoveUsePointer(t)}captureMoveUseMouse(t){const e=o=>{document.addEventListener("mousemove",r,!1),document.addEventListener("mouseup",n,!1),this.container.style.userSelect="none",t?.start?.(o)},n=o=>{document.removeEventListener("mousemove",r,!1),document.removeEventListener("mouseup",n,!1),this.container.style.userSelect="",t?.end?.(o)},r=o=>{t?.move?.(o)};this.on("mouseDown",e);const s=()=>{this.off("mouseDown",e)};return this.addDOMEventRemoveListeners(s),s}captureMoveUseTouch(t){const e=o=>{o.preventDefault(),t?.start?.(o)},n=o=>{t?.end?.(o)},r=o=>{t?.move?.(o)};this.on("touchStart",e),this.on("touchEnd",n),this.on("touchCancel",n),this.on("touchMove",r);const s=()=>{this.off("touchStart",e),this.off("touchEnd",n),this.off("touchCancel",n),this.off("touchMove",r)};return this.addDOMEventRemoveListeners(s),s}captureMoveUsePointer(t){const e=o=>{this.container.setPointerCapture(o.pointerId),this.container.style.userSelect="none",t?.start?.(o)},n=o=>{this.container.style.userSelect="",t?.end?.(o)},r=o=>{t?.move?.(o)};this.on("pointerDown",e),this.on("pointerUp",n),this.on("pointerCancel",n),this.on("pointerMove",r);const s=()=>{this.off("pointerDown",e),this.off("pointerUp",n),this.off("pointerCancel",n),this.off("pointerMove",r)};return this.addDOMEventRemoveListeners(s),s}drawMouseMoveLine(t,e){if(!this.ctx)return;let n=!1;switch(t){case"brush":const r=(e&&e.brushSize)??10,s=(e&&e.brushDensity)??50,o=(e&&e.brushColor)??"#000000",a=this.ctx.getImageData(0,0,this.ctx.canvas.width,this.ctx.canvas.height),h=a.data,m=ii(o);this.captureMove({start:()=>{n=!0},end:()=>{n=!1},move:()=>{if(n){for(let g=0;g<s;g++){const x=Math.random()*Math.PI*2,y=Math.random()*r,w=this.mousePoint.x+Math.cos(x)*y|0,k=this.mousePoint.y+Math.sin(x)*y|0,P=(w+k*a.width)*4;h[P]=m>>16&255,h[P+1]=m>>8&255,h[P+2]=m&255,h[P+3]=255}this.ctx.putImageData(a)}}});break;case"line":default:this.captureMove({start:g=>{n=!0,this.ctx.beginPath(),this.setMousePoint(g),this.ctx.moveTo(this.mousePoint.x,this.mousePoint.y)},end:()=>{n=!1,this.ctx.closePath()},move:()=>{n&&(this.ctx.lineTo(this.mousePoint.x,this.mousePoint.y),this.ctx.stroke())}})}}static getMouseButton(t){if(document.implementation.hasFeature("MouseEvents","2.0"))return t.button;switch(t.button){case 0:case 1:case 3:case 5:case 7:return 0;case 2:case 6:return 2;case 4:return 1}}}class St{static onDocumentReady(t){function e(){document.readyState!=="loading"&&(t(),document.removeEventListener("DOMContentLoaded",e))}typeof document<"u"&&(document.addEventListener("DOMContentLoaded",e),e())}static onBeforeUnload(t){function e(){t(),document.removeEventListener("beforeunload",e)}typeof document<"u"&&document.addEventListener("beforeunload",e)}static getCSSVar(t){return getComputedStyle(document.documentElement).getPropertyValue(t)}static setCSSVar(t,e){document.documentElement.style.setProperty(t,e)}static scrollTo=(t,e)=>window.scrollTo(t,e);static setScrollRestoration(t){try{window.history.scrollRestoration=t}catch{}}static safeExec(t){const e=new Proxy(window,{get(n,r,s){if(typeof r=="string"&&["open","location","document"].includes(r))throw new Error(`禁止访问 key: ${r}`);return r==="window"?e:Reflect.get(n,r,s)},set(n,r,s,o){return Reflect.set(n,r,s,o)}});new Function("window",`with(window) { ${t} }`)(e,null)}static dom=new Proxy({},{get(t,e){return function(n={},...r){const s=document.createElement(e);for(const o of Object.keys(n))s.setAttribute(o,n[o]);for(const o of r)typeof o=="string"?s.appendChild(document.createTextNode(o)):s.appendChild(o);return s}}});static compileTemplate(t){return t=t.replace(/<%=(.+?)%>/g,"`); \n echo( $1 ); \n echo(`").replace(/<%([\s\S]+?)%>/g,"`); \n $1 \n echo(`"),t="echo(`"+t+"`);",`(function parse(data){
|
|
10
|
+
`.replace(/\s+/g,""),"u");break;case"mime-image":t=/^image\//;break;case"mime-video":t=/^video\//;break;case"mime-audio":t=/^audio\//;break;case"mime-document-word":t=/^application\/(?:vnd\.openxmlformats-officedocument\.wordprocessingml\.document|msword|vnd\.ms-word\.document\.macroenabled\.12|vnd\.openxmlformats-officedocument\.wordprocessingml\.template|vnd\.ms-word\.template\.macroenabled\.12)$/;break;case"mime-document-excel":t=/^application\/(?:vnd\.openxmlformats-officedocument\.spreadsheetml\.sheet|vnd\.ms-excel|vnd\.ms-excel\.sheet\.macroenabled\.12|vnd\.openxmlformats-officedocument\.spreadsheetml\.template|vnd\.ms-excel\.template\.macroenabled\.12)$/;break;case"mime-document-ppt":t=/^application\/(?:vnd\.ms-powerpoint|vnd\.openxmlformats-officedocument\.presentationml\.presentation|vnd\.ms-powerpoint\.presentation\.macroenabled\.12|vnd\.openxmlformats-officedocument\.presentationml\.template|vnd\.ms-powerpoint\.template\.macroenabled\.12)$/;break;case"mime-document-json":t=/^application\/json$/;break;case"mime-document-xml":t=/^(?:application|text)\/(?:xml|xhtml\+xml)$/;break}return t},mt=(s,t)=>(typeof s=="string"&&(s=Ue(s)||new RegExp(s)),s.test(t)),hn=(s,t)=>{typeof s=="string"&&(s=Ue(s)||new RegExp(s));const e=t.match(s);return e?s.flags.toLowerCase().indexOf("g")>=0?e.map(i=>({matchIndex:-1,fullMatch:i,groupMatchs:[]})):{matchIndex:typeof e.index=="number"?e.index:-1,fullMatch:e[0],groupMatchs:e.slice(1)}:null},Ai=(s,t)=>{typeof s=="string"&&(s=Ue(s)||new RegExp(s));const e=[],i=t.matchAll(s);for(const n of i)e.push({matchIndex:typeof n.index=="number"?n.index:-1,fullMatch:n[0],groupMatchs:n.slice(1)});return e};function cn(s){const t=s.match(/[\s\S]/gu);return t?t.length:0}function Li(s,t){const e=s.codePointAt(t);return e?String.fromCodePoint(e):void 0}function ln(){let s=new Date().getTime();return"xxxxxxxx_xxxx_xxxx_yxxx_xxxxxxxxxxxx".replace(/[xy]/g,function(e){const i=(s+Math.random()*16)%16|0;return s=Math.floor(s/16),(e=="x"?i:i&3|8).toString(16)})}function un(s){return s.replace(/(^\w)/g,function(t){return t.toLowerCase()})}const fn=(s,t="-")=>(s=s.replace(/([A-Z])/g,t+"$1").toLowerCase(),s.indexOf(t)==0?s.slice(1):s);function ze(s){return s.replace(/(^\w|[_-]\w)/g,function(t){return t.slice(-1).toUpperCase()})}function Ri(s){return un(ze(s))}function Oi(s){let t="";for(let e=0,i=s.length;e<i;e++){const n=s.charCodeAt(e);n>=1&&n<=127?t+=s.charAt(e):n>2047?(t+=String.fromCharCode(224|n>>12&15),t+=String.fromCharCode(128|n>>6&63),t+=String.fromCharCode(128|n>>0&63)):(t+=String.fromCharCode(192|n>>6&31),t+=String.fromCharCode(128|n>>0&63))}return t}var gt=(s=>(s.UNKNOWN="",s.HTML="text/html",s.CSS="text/css",s.XML="text/xml",s.TEXT="text/plain",s.MD="text/plain",s.JPEG="image/jpeg",s.PNG="image/png",s.GIF="image/gif",s.WEBP="image/webp",s.SVG="image/svg+xml",s.ICO="image/x-icon",s.MPEG="audio/mpeg",s.MP3="audio/mpeg",s.OGG="audio/ogg",s.WAV="audio/wav",s.MP4="video/mp4",s.WEBM="video/webm",s.JSON="application/json",s.JAVASCRIPT="application/javascript",s.ECMASCRIPT="application/ecmascript",s.EXCEL="application/vnb.ms-excel",s.XWWW="application/x-www-form-urlencoded",s.DOC="application/msword",s.CSV="application/x-csv",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))(gt||{});const Gt=(s,t=16)=>(s=s.toLowerCase(),(s.indexOf("0b")==0||s.indexOf("0o")==0||s.indexOf("0x")==0)&&(s=s.slice(2)),parseInt(s,t));function dn(){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 Ni=s=>{let t=gt.UNKNOWN;switch(new DataView(s).getUint32(0,dn()).toString(16).toUpperCase()){case"FFD8FFDB":t=gt.JPEG;break;case"FFD8FFE0":case"FFD8FFE1":case"FFD8FFE2":case"FFD8FFE3":t=gt.JPEG;break;case"89504E47":t=gt.PNG;break;case"47494638":t=gt.GIF;break;case"52494646":t=gt.WEBP;break;case"25504446":t=gt.PDF;break;case"504B0304":t=gt.ZIP;break}return t},Fi=function(){const s=[];return{writeByte(t){s.push(t&255)},writeShort(t){this.writeByte(t),this.writeByte(t>>>8)},writeBytes(t,e=0,i=t.length){for(let n=0;n<i;n++)this.writeByte(t[n+e])},writeString(t){for(let e=0,i=t.length;e<i;e++)this.writeByte(t.charCodeAt(e))},toByteArray(){return s},toString(){let t="[";for(let e=0,i=s.length;e<i;e++)e>0&&(t+=","),t+=s[e];return t+="]",t}}},mn=function(){let s=0,t=0,e=0,i="";const n=function(a){if(!(a<0)){if(a<26)return 65+a;if(a<52)return 97+(a-26);if(a<62)return 48+(a-52);if(a==62)return 43;if(a==63)return 47}throw new Error("n:"+a)},r=function(a){i+=String.fromCharCode(n(a&63))};return{writeByte(a){for(s=s<<8|a&255,t+=8,e+=1;t>=6;)r(s>>>t-6),t-=6},flush(){if(t>0&&(r(s<<6-t),s=0,t=0),e%3!=0){const a=3-e%3;for(let o=0;o<a;o++)i+="="}},toString(){return i}}};function Gi(s){const t=typeof s;return t!=="object"?t:Object.prototype.toString.call(s).replace(/^\[object (\S+)\]$/,"$1").toLowerCase()}function gn(s){return Gi(s)==="array"}function Ve(s){return Gi(s)==="object"}function Xe(s,t=new WeakMap){if(s==null)return s;if(s.constructor===Date)return new Date(s);if(s.constructor===RegExp)return new RegExp(s);if(typeof s!="object")return s;if(t.has(s))return t.get(s);const e=Object.create(Object.getPrototypeOf(s),Object.getOwnPropertyDescriptors(s));t.set(s,e);for(const i of Reflect.ownKeys(s))e[i]=Ve(s[i])?Xe(s[i],t):s[i];return e}function Yt(s,t,e=Number.EPSILON*Math.pow(2,2)){return Math.abs(s-t)<e}const We=(s,t,e)=>s<t?t:s>e?e:s;function Bi(s,t=12){return s.toPrecision(t)}function pn(s){const t=hn("number",s);return t?Array.isArray(t)?t.map(e=>Number(e.fullMatch)):[Number(t.fullMatch)]:[]}function wn(s,t){let e;return function(...i){clearTimeout(e),e=setTimeout(()=>{s.apply(this,i)},t)}}class Ui{events;constructor(){this.events={}}on(t,e){return this.events[t]||(this.events[t]=[]),this.events[t].push(e),this}addListener(t,e){return this.on(t,e),this}prependListener(t,e){return this.events[t]||(this.events[t]=[]),this.events[t].unshift(e),this}removeListener(t,e){if(this.events[t])return this.events[t]=this.events[t].filter(i=>i!==e),this}off(t,e){return this.removeListener(t,e),this}removeAllListeners(t){return t?this.events[t]=[]:this.events={},this}emit(t,...e){return this.events[t]&&this.events[t].forEach(i=>{Reflect.apply(i,this,e)}),this}once(t,e){const n=(()=>{let r=!1;return(...a)=>{r||(r=!0,Reflect.apply(e,this,a),this.off(t,n))}})();return this.on(t,n),this}}var zi=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function yn(s,t={}){var e=1,i=1;function n(D){var P=D.match(/\n/g);P&&(e+=P.length);var N=D.lastIndexOf(`
|
|
11
|
+
`);i=~N?D.length-N:i+D.length}function r(){var D={line:e,column:i};return function(P){return P.position=new a(D),y(),P}}function a(D){this.start=D,this.end={line:e,column:i},this.source=t.source}a.prototype.content=s;var o=[];function h(D){var P=new Error(t.source+":"+e+":"+i+": "+D);if(P.reason=D,P.filename=t.source,P.line=e,P.column=i,P.source=s,t.silent)o.push(P);else throw P}function c(){var D=w();return{type:"stylesheet",stylesheet:{source:t.source,rules:D,parsingErrors:o}}}function f(){return p(/^{\s*/)}function m(){return p(/^}/)}function w(){var D,P=[];for(y(),x(P);s.length&&s.charAt(0)!="}"&&(D=Lt()||k());)D!==!1&&(P.push(D),x(P));return P}function p(D){var P=D.exec(s);if(P){var N=P[0];return n(N),s=s.slice(N.length),P}}function y(){p(/^\s*/)}function x(D){var P;for(D=D||[];P=b();)P!==!1&&D.push(P);return D}function b(){var D=r();if(!(s.charAt(0)!="/"||s.charAt(1)!="*")){for(var P=2;s.charAt(P)!=""&&(s.charAt(P)!="*"||s.charAt(P+1)!="/");)++P;if(P+=2,s.charAt(P-1)==="")return h("End of comment missing");var N=s.slice(2,P-2);return i+=2,n(N),s=s.slice(P),i+=2,D({type:"comment",comment:N})}}function C(){var D=p(/^([^{]+)/);if(D)return pt(D[0]).replace(/\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*\/+/g,"").replace(/"(?:\\"|[^"])*"|'(?:\\'|[^'])*'/g,function(P){return P.replace(/,/g,"")}).split(/\s*(?![^(]*\)),\s*/).map(function(P){return P.replace(/\u200C/g,",")})}function _(){var D=r(),P=p(/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(P){if(P=pt(P[0]),!p(/^:\s*/))return h("property missing ':'");var N=p(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/),F=D({type:"declaration",property:P.replace(zi,""),value:N?pt(N[0]).replace(zi,""):""});return p(/^[;\s]*/),F}}function I(){var D=[];if(!f())return h("missing '{'");x(D);for(var P;P=_();)P!==!1&&(D.push(P),x(D));return m()?D:h("missing '}'")}function E(){for(var D,P=[],N=r();D=p(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/);)P.push(D[1]),p(/^,\s*/);if(P.length)return N({type:"keyframe",values:P,declarations:I()})}function L(){var D=r(),P=p(/^@([-\w]+)?keyframes\s*/);if(P){var N=P[1];if(P=p(/^([-\w]+)\s*/),!P)return h("@keyframes missing name");var F=P[1];if(!f())return h("@keyframes missing '{'");for(var nt,kt=x();nt=E();)kt.push(nt),kt=kt.concat(x());return m()?D({type:"keyframes",name:F,vendor:N,keyframes:kt}):h("@keyframes missing '}'")}}function O(){var D=r(),P=p(/^@supports *([^{]+)/);if(P){var N=pt(P[1]);if(!f())return h("@supports missing '{'");var F=x().concat(w());return m()?D({type:"supports",supports:N,rules:F}):h("@supports missing '}'")}}function B(){var D=r(),P=p(/^@host\s*/);if(P){if(!f())return h("@host missing '{'");var N=x().concat(w());return m()?D({type:"host",rules:N}):h("@host missing '}'")}}function H(){var D=r(),P=p(/^@media *([^{]+)/);if(P){var N=pt(P[1]);if(!f())return h("@media missing '{'");var F=x().concat(w());return m()?D({type:"media",media:N,rules:F}):h("@media missing '}'")}}function z(){var D=r(),P=p(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(P)return D({type:"custom-media",name:pt(P[1]),media:pt(P[2])})}function j(){var D=r(),P=p(/^@page */);if(P){var N=C()||[];if(!f())return h("@page missing '{'");for(var F=x(),nt;nt=_();)F.push(nt),F=F.concat(x());return m()?D({type:"page",selectors:N,declarations:F}):h("@page missing '}'")}}function it(){var D=r(),P=p(/^@([-\w]+)?document *([^{]+)/);if(P){var N=pt(P[1]),F=pt(P[2]);if(!f())return h("@document missing '{'");var nt=x().concat(w());return m()?D({type:"document",document:F,vendor:N,rules:nt}):h("@document missing '}'")}}function ht(){var D=r(),P=p(/^@font-face\s*/);if(P){if(!f())return h("@font-face missing '{'");for(var N=x(),F;F=_();)N.push(F),N=N.concat(x());return m()?D({type:"font-face",declarations:N}):h("@font-face missing '}'")}}var At=lt("import"),bt=lt("charset"),Xt=lt("namespace");function lt(D){var P=new RegExp("^@"+D+"\\s*([^;]+);");return function(){var N=r(),F=p(P);if(F){var nt={type:D};return nt[D]=F[1].trim(),N(nt)}}}function Lt(){if(s[0]=="@")return L()||H()||z()||O()||At()||bt()||Xt()||it()||j()||B()||ht()}function k(){var D=r(),P=C();return P?(x(),D({type:"rule",selectors:P,declarations:I()})):h("selector missing")}return Ye(c())}function pt(s){return s?s.replace(/^\s+|\s+$/g,""):""}function Ye(s,t){var e=s&&typeof s.type=="string",i=e?s:t;for(var n in s){var r=s[n];Array.isArray(r)?r.forEach(function(a){Ye(a,i)}):r&&typeof r=="object"&&Ye(r,i)}return e&&Object.defineProperty(s,"parent",{configurable:!0,writable:!0,enumerable:!1,value:t||null}),s}const He=(s,t="image/svg+xml",e="utf-8")=>new Blob([s],{type:`${t};charset=${e}`}),Vi=s=>new XMLSerializer().serializeToString(s),vn=(s,t="text/html")=>new DOMParser().parseFromString(s,t),Xi=(s,t="image/svg+xml",e="utf-8")=>He(Vi(s),t,e),je=(s,t)=>{const e=document.createElement("a");e.style.visibility="hidden",document.body.appendChild(e),e.download=t,typeof s=="string"?e.href=s:e.href=window.URL.createObjectURL(s),e.click(),document.body.removeChild(e),window.URL.revokeObjectURL(e.href)};function Wi(s=["*"],t){return new Promise((e,i)=>{if(!globalThis.document||!(globalThis.document instanceof Document))return i(new Error("This is not a browser environment"));const n=globalThis.document.createElement("input");n.setAttribute("type","file"),n.setAttribute("visibility","hidden"),Array.isArray(s)&&s.length>0&&n.setAttribute("accept",s.join(",")),t&&n.setAttribute("multiple","true"),globalThis.addEventListener("focus",()=>{setTimeout(()=>{(!n.files||n.files?.length===0)&&i(new Error("Cancel select"))},1e3)},{once:!0});const r=()=>{if(n.removeEventListener("change",r),!n.files||n.files?.length===0)i(new Error("Cancel select"));else{const a=Array.from(n.files);!s.includes("*")&&a.some(o=>!s.includes(`.${Hi(o)}`))&&i(new Error(`Please select files in ${s} format`)),n.remove(),e(a)}};n.addEventListener("change",r),n.click()})}function qe(s,t="text",e){return new Promise((i,n)=>{const r=new FileReader;switch(r.addEventListener("progress",a=>{e?.(a.loaded,a.total)}),r.addEventListener("load",a=>{i(a.target?.result)}),r.addEventListener("error",a=>{n(a)}),t){case"dataURL":r.readAsDataURL(s);break;case"binaryString":r.readAsBinaryString(s);break;case"arrayBuffer":r.readAsArrayBuffer(s);break;default:r.readAsText(s)}})}function Yi(s,t,e){return qe(s.slice(t,e),"arrayBuffer")}async function bn(s){const t=await Yi(s,0,4);return Ni(t)}const Hi=s=>{let t;return s instanceof File?t=s.name:t=s,t.match(/\.([0-9a-z]+)(?:[\\?#]|$)/i)?.[1]??""};function xn(s,t){s.addEventListener("change",function(){t(s.files)},!1)}function Cn(s,t){s.addEventListener("dragover",function(e){e.stopPropagation(),e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect="copy")},!1),s.addEventListener("drop",function(e){e.stopPropagation(),e.preventDefault(),e.dataTransfer&&t(e.dataTransfer.files)},!1)}function Tn(s){typeof queueMicrotask=="function"?queueMicrotask(s):Promise.resolve().then(s).catch(t=>setTimeout(()=>{throw t}))}function _n(s,t={},e=[]){return{tag:s,props:t,children:e}}function Ht(s,t){if(s.el)return;const e=s.el=document.createElement(s.tag);if(s.props)for(const i in s.props){const n=s.props[i];i.startsWith("on")?e.addEventListener(i.slice(2).toLowerCase(),n):e.setAttribute(i,n)}s.children&&(typeof s.children=="string"?e.textContent=s.children:s.children.forEach(i=>{Ht(i,e)})),t.appendChild(e)}function ji(s,t){if(s.tag!==t.tag){if(!s.el)return;const e=s.el.parentElement||document.body;e.removeChild(s.el),Ht(t,e)}else{const e=t.el=s.el;if(!e)return;const i=s.props,n=t.props;for(const o in i)o in n||(o.startsWith("on")?e.removeEventListener(o.slice(2).toLowerCase(),i[o]):e.removeAttribute(o));for(const o in n){const h=i[o],c=n[o];c!=h&&(o.startsWith("on")?e.addEventListener(o.slice(2).toLowerCase(),c):e.setAttribute(o,c))}const r=s.children||[],a=t.children||[];if(typeof a=="string")e.innerHTML=a;else if(typeof r=="string")e.innerHTML="",a.forEach(o=>{Ht(o,e)});else{const o=Math.min(r.length,a.length);for(let h=0;h<o;h++)ji(r[h],a[h]);a.length>r.length&&a.slice(r.length).forEach(h=>{Ht(h,e)}),a.length<r.length&&r.slice(a.length).forEach(h=>{h.el&&e.removeChild(h.el)})}}}function qi(s,t,e){if(!s){e&&t&&e.appendChild(t);return}if(!s.isEqualNode(t)){if(s.nodeName!==t.nodeName){e.replaceChild(t,s);return}if(s.nodeType===Node.TEXT_NODE){s.textContent!==t.textContent&&(s.textContent=t.textContent);return}for(let i=s.attributes.length-1;i>=0;i--){const n=s.attributes[i].name;!t.hasAttribute(n)&&n!=="open"&&s.removeAttribute(n)}for(let i=0;i<t.attributes.length;i++){const n=t.attributes[i].name,r=t.attributes[i].value;s.setAttribute(n,r)}for(let i=0;i<t.childNodes.length;i++)s.childNodes[i]?qi(s.childNodes[i],t.childNodes[i],s):s.appendChild(t.childNodes[i].cloneNode(!0));for(;s.childNodes.length>t.childNodes.length;)s.lastChild&&s.removeChild(s.lastChild)}}class Sn{url;socket;waitingResponse={};sendMessageQueue=[];constructor(t){this.url=t,this.createSocket()}createSocket(){console.log("Socket Create Attempted"),this.socket=new WebSocket(this.url),this.socket.onopen=()=>{this.sendMessageQueue.forEach(t=>this.socket?.send(t)),this.sendMessageQueue=[]},this.socket.onclose=t=>{const{code:e,reason:i,wasClean:n}=t;console.log(`ws closed : ${e} ${i} ${n}`)},this.socket.onerror=t=>{console.log(`ws error : ${t.type}`)},this.socket.onmessage=t=>{this.processMessage(t)}}recreateSocket(t){console.log("Socket Recreate Attempted"),this.sendMessageQueue.push(t),this.createSocket()}closeSocket(){this.socket&&(this.socket.close(),console.log("Socket closed"))}openSocket(){this.createSocket(),console.log("Socket opened manually")}sendWithRetry(t){this.socket?.readyState===WebSocket.OPEN?this.socket.send(t):this.recreateSocket(t)}async processMessage(t){if(typeof t.data=="string")try{const e=JSON.parse(t.data);if(Object.prototype.hasOwnProperty.call(e,"requestid")){const i=this.waitingResponse[e.requestid];i?i.resolve?.(e):console.warn("Got data but found no associated request, already timed out?",e)}else console.warn("Got data without request id",e)}catch{console.log(`Received String : ${t.data}`)}else t.data instanceof ArrayBuffer?console.log(`Received ArrayBuffer : ${t.data}`):t.data instanceof Blob&&console.log(`Received Blob : ${t.data}`)}async sendPayload(t){const e=+new Date,i=this.waitingResponse[e]={requestid:e};try{let n;t instanceof Blob||t instanceof ArrayBuffer||typeof t=="string"?n=t:n=JSON.stringify({...i,...t});const r=await new Promise((a,o)=>{i.resolve=a,this.sendWithRetry(n),setTimeout(()=>{o("Timeout")},5e3)});return console.info("Time took",(+new Date-i.requestid)/1e3),r}catch(n){return Promise.reject(n)}finally{delete this.waitingResponse[e]}}async send(t,e,i=n=>{console.log(n)}){this.sendPayload(t).then(e,i)}}function Pn(){const s=window.screen;return{screenWidth:s.width,screenHeight:s.height,screenX:window.screenX,screenY:window.screenY}}function En(){const s=document.body;return{clientWidth:s.clientWidth,clientHeight:s.clientHeight,clientTop:s.clientTop,clientLeft:s.clientLeft,scrollWidth:s.scrollWidth,scrollHeight:s.scrollHeight,scrollTop:s.scrollTop,scrollLeft:s.scrollLeft,pageX:s.getBoundingClientRect().x,pageY:s.getBoundingClientRect().y}}function Bt(){const s=document.documentElement;return{clientWidth:s.clientWidth,clientHeight:s.clientHeight,clientTop:s.clientTop,clientLeft:s.clientLeft,scrollWidth:s.scrollWidth,scrollHeight:s.scrollHeight,scrollTop:s.scrollTop,scrollLeft:s.scrollLeft,offsetWidth:s.offsetWidth,offsetHeight:s.offsetHeight,offsetTop:s.offsetTop,offsetLeft:s.offsetLeft,offsetParent:s.offsetParent,clientX:s.getBoundingClientRect().x,clientY:s.getBoundingClientRect().y}}function kn(){const{clientWidth:s,clientHeight:t}=Bt();return{width:s||window.innerWidth,height:t||window.innerHeight}}function In(){const{scrollWidth:s,scrollHeight:t}=Bt();return{width:s,height:t}}function $i(s){const{top:t,left:e}=s.getBoundingClientRect(),{scrollLeft:i,scrollTop:n}=Bt();return{x:e+i,y:t+n}}function Mn(s){return{x:Ji(s),y:Zi(s)}}function Ji(s){let t=0;for(;s!==null;)t+=s.offsetLeft,s=s.offsetParent;return t}function Zi(s){let t=0;for(;s!==null;)t+=s.offsetTop,s=s.offsetParent;return t}function Dn(s){const t=s.getBoundingClientRect();return{x:t.left,y:t.top}}function An(s,t){const e=s.getBoundingClientRect(),i=t.getBoundingClientRect();return{x:i.x-e.x,y:i.y-e.y,width:i.width||i.right-i.left,height:i.height||i.bottom-i.top}}function Ln(){const{clientHeight:s,scrollTop:t,scrollHeight:e}=Bt(),i=e-s;return i<=0?0:t/i*100}function Rn(s){return{x:s.clientX,y:s.clientY}}function Ki(s){if("center"in s)return s.center;if(s.pageX&&s.pageY)return{x:s.pageX,y:s.pageY};const{scrollLeft:t,scrollTop:e}=Bt();return{x:s.clientX+t,y:s.clientY+e}}function Qi(s,t){const e=Ki(t),i=$i(s);return{x:e.x-i.x,y:e.y-i.y}}function $e(){return typeof window<"u"?window:typeof self<"u"?self:this||{}}const we=()=>{const s=navigator.userAgent.toLowerCase();let t="Unknown";return/mac/i.test(s)?t="macOS":/win/i.test(s)?t="Windows":/android/i.test(s)?t="Android":/iphone|ipad|ipod/i.test(s)?t="iOS":/linux/i.test(s)?t="Linux":/bsd/i.test(s)&&(t="BSD"),t.toLowerCase()},On=()=>{const s=navigator.userAgent;let t="Unknown";if(/Windows NT/.test(s)){const e=s.match(/Windows NT (\d+\.\d+)/);e&&(t=e[1])}else if(/Mac OS X/.test(s)){const e=s.match(/Mac OS X (\d+_\d+)/);e&&(t=e[1].replace("_","."))}else if(/Android/.test(s)){const e=s.match(/Android (\d+\.\d+)/);e&&(t=e[1])}else if(/iPhone|iPad|iPod/.test(s)){const e=s.match(/OS (\d+_\d+)/);e&&(t=e[1].replace("_","."))}return t.toLowerCase()},Je=()=>{const s=navigator.userAgent.toLowerCase();let t="Unknown";return/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()},Nn=()=>{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},Fn=()=>"geolocation"in navigator?new Promise((s,t)=>{navigator.geolocation.getCurrentPosition(e=>{const i=e.coords.latitude,n=e.coords.longitude;s({latitude:i,longitude:n})},e=>{t(e)})}):Promise.reject("Geolocation is not available.");function Gn(){return(navigator.browserLanguage||navigator.language).toLowerCase()}function Bn(){return Intl.DateTimeFormat().resolvedOptions().timeZone.toLowerCase()}function Ze(){return we()==="ios"}function Ke(){return we()==="macos"}function Un(){return Ze()|Ke()}function ts(){return we()==="android"}function zn(){return Ze()||ts()}function Vn(){return typeof window=="object"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches}function es(){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 n=s.indexOf("rv:");return parseInt(s.substring(n+3,s.indexOf(".",n)),10)}const i=s.indexOf("Edge/");return i>0?parseInt(s.substring(i+5,s.indexOf(".",i)),10):-1}const Xn=es()!==-1;function Wn(){const s=document.documentMode;return s&&(s===9||s===10)}function is(){return Je()==="wechat"}function ss(){return Je()==="ali"}function Yn(){return is()&&navigator.userAgent.match(/miniprogram/i)||window.__wxjs_environment==="miniprogram"}function Hn(){return ss()&&navigator.userAgent.match(/miniprogram/i)}const jn=typeof document<"u",ns=typeof window<"u",qn=typeof history<"u",$n=ns&&window.File&&window.FileReader&&window.FileList&&window.Blob,rs=(()=>{const s=$e();return!!(s.Worker&&s.Blob&&s.Promise&&s.OffscreenCanvas&&s.OffscreenCanvasRenderingContext2D&&s.HTMLCanvasElement&&s.HTMLCanvasElement.prototype.transferControlToOffscreen&&s.URL&&s.URL.createObjectURL)})(),Jn=typeof Path2D=="function"&&typeof DOMMatrix=="function",Zn=function(){if(!$e().OffscreenCanvas)return!1;var t=new OffscreenCanvas(1,1),e=t.getContext("2d");e.fillRect(0,0,1,1);var i=t.transferToImageBitmap();try{e.createPattern(i,"no-repeat")}catch{return!1}return!0}();function Kn(s,t){let e=s[t];Object.defineProperty(s,"prop",{get:()=>e,set:i=>{e=i;debugger}})}function Qn(s){return new Proxy(s,{get(t,e,i){return Reflect.get(t,e,i)},set(t,e,i,n){debugger;return Reflect.set(t,e,i,n)}})}function tr(s){const t=document.documentElement,e=window.top===window.self?window.devicePixelRatio:1;t.dataset.dpr=e;let i=100;const n=function(){const r=Math.min(t.clientWidth,s);t.dataset.width=r,t.dataset.rem=i=Math.round(100*(r/s)),t.style.fontSize=i+"px"};n(),window.rem2px=function(r){return r=parseFloat(r),r*i},window.px2rem=function(r){return r=parseFloat(r),r/i},window.addEventListener&&window.addEventListener("orientationchange"in window?"orientationchange":"resize",n,!1)}class A{static onDocumentReady(t){let e=!1;function i(){document.readyState==="loading"||e||(e=!0,t(),document.removeEventListener("DOMContentLoaded",i))}typeof document<"u"&&(document.addEventListener("DOMContentLoaded",i),i())}static onBeforeUnload(t){function e(){t(),document.removeEventListener("beforeunload",e)}typeof document<"u"&&document.addEventListener("beforeunload",e)}static getCSSVar(t){return getComputedStyle(document.documentElement).getPropertyValue(t)}static setCSSVar(t,e){document.documentElement.style.setProperty(t,e)}static getStyle(t,e,i){const n=t;if(getComputedStyle)if(e){e=fn(e);const r=getComputedStyle(n,i).getPropertyPriority(e);return getComputedStyle(n,i).getPropertyValue(e).trim()+(r?"!"+r:"")}else{const r=[],a=getComputedStyle(n,"");for(let o=0;o<a.length;o++)r.push(a[o]+":"+a.getPropertyValue(a[o]));return r.push(...(n.style.cssText||"").split(";")),Object.fromEntries(r.filter(o=>!!o).map(o=>o.split(":").map(h=>h.trim()))||[])}else if(t.currentStyle){if(e)return e=Ri(e),t.currentStyle[e];{const r=[],a=n.currentStyle;for(let o in a)r.push(o+":"+a[o]);return r.push(...(n.style.cssText||"").split(";")),Object.fromEntries(r.filter(o=>!!o).map(o=>o.split(":").map(h=>h.trim()))||[])}}}static setStyle(t,e,i){if(typeof e=="string"&&i){const n=String(i).toLowerCase().includes("!important")?"important":"";t.style.setProperty(e,i.replace(/!important/i,""),n)}else e instanceof Object&&Object.keys(e).forEach(n=>{const r=String(e[n]).toLowerCase().includes("!important")?"important":"";t.style.setProperty(n,String(e[n]).replace(/!important/i,""),r)})}static setStyleSheet(t,e){let i;if(typeof e=="string"){const r=document.querySelector(e)?.shadowRoot;r?i=r:i=document.querySelector(e)}else i=e;const n=document.createElement("style");if(n.innerHTML=t,i)return i.appendChild(n),()=>{(i instanceof HTMLElement||i instanceof ShadowRoot)&&i.removeChild(n)};{const r=document.styleSheets[0].insertRule(t);return()=>{document.styleSheets[0].deleteRule(r)}}}static toggleClass(t,e,i="toggle"){e.split(/[,\s]+/).forEach(n=>{n.trim()!==""&&t.classList[i](n.trim())})}static addClass(t,e){this.toggleClass(t,e,"add")}static removeClass(t,e){this.toggleClass(t,e,"remove")}static hasClass(t,e){return e.split(/[,\s]+/).every(i=>i.trim()!==""?Array.from(t.classList||[]).includes(i.trim()):!0)}static toggleDisplay(t,e){this.getStyle(t,"display")=="none"&&e===void 0||e===!0?t.style.setProperty("display",t instanceof HTMLTableRowElement?"table-row":t instanceof HTMLTableCellElement?"table-cell":"block"):t.style.setProperty("display","none")}static show(t){this.toggleDisplay(t,!0)}static hide(t){this.toggleDisplay(t,!1)}static attribute(t,e,i){if(i===void 0&&typeof e=="string")return t.getAttribute(e);let n={};typeof e=="object"?n=e:i!==void 0&&(n[e]=i),Object.entries(n).forEach(([r,a])=>{t.setAttribute(r,a)})}static removeAttribute(t,e){e.split(/[,\s]+/).forEach(i=>{i.trim()!=""&&t.removeAttribute(i.trim())})}static fixProp(t){const e={cellpadding:"cellPadding",cellspacing:"cellSpacing",class:"className",colspan:"colSpan",contenteditable:"contentEditable",for:"htmlFor",frameborder:"frameBorder",maxlength:"maxLength",readonly:"readOnly",rowspan:"rowSpan",tabindex:"tabIndex",usemap:"useMap"};return e[t]?e[t]:t}static prop(t,e,i){if(i===void 0&&typeof e=="string")return t[e];{let n={};typeof e=="object"?n=e:typeof e=="string"&&i!==void 0&&(n[e]=i),Object.entries(n).forEach(([r,a])=>{const o=this.fixProp(r);t[o]=a,o=="innerHTML"&&this.scriptConvert(t)})}}static removeProp(t,e){e.split(/[,\s]+/).forEach(i=>{i.trim()!=""&&delete t[this.fixProp(i.trim())]})}static data(t,e,i){if(typeof e=="string"&&(e=Ri(e)),(typeof e=="string"||e===void 0)&&i===void 0){const n=Object.assign({},t.dataset);return Object.keys(n).forEach(r=>{if(n[r]?.startsWith("[")||n[r]?.startsWith("{"))try{n[r]=JSON.parse(n[r]??"")}catch{}}),typeof e=="string"?n[e]:n}else{let n={};typeof e=="object"?n=e:typeof e=="string"&&(n[e]=i),Object.entries(n).forEach(([r,a])=>{a!=null?t.dataset[r]=a instanceof Object?JSON.stringify(a):a:delete t.dataset[r]})}}static removeData(t,e){e.split(/[,\s]+/).forEach(i=>{i.trim()!=""&&delete t.dataset[i.trim()]})}static empty(t){this.html(t,"")}static html(t,e){e instanceof HTMLElement?this.insert(t,e,"replaceWith"):this.prop(t,"innerHTML",e)}static text(t,e){return this.prop(t,"textContent",e)}static value(t,e){return this.prop(t,"value",e)}static dispatchEvent(t,e,i){let n;const r=["click","dblclick","mousedown","mouseup","mousemove"],a=["keydown","keyup","keypress"];typeof e=="string"?r.includes(e)?n=new MouseEvent(e,i):a.includes(e)?n=new KeyboardEvent(e,i):n=new Event(e,i):n=e,t.dispatchEvent(n)}static scriptConvert(t){const e=i=>{const r=i.ownerDocument.createElement("script");r.text=i.text;const a=i.attributes;for(let o=0;o<a.length;o++)r.setAttribute(a[o].name,a[o].value);return r};return t.tagName=="SCRIPT"&&(t=e(t)),t.querySelectorAll&&t.querySelectorAll("script").forEach(i=>{i.parentNode?.replaceChild(e(i),i)}),t}static fragment(t){const e=document.createElement("template");return e.innerHTML=t,e.content.childNodes.forEach(i=>{const n=this.scriptConvert(i);n!=i&&e.content.replaceChild(n,i)}),e.content}static insert(t,e,i="replaceWith"){return typeof e=="string"?t[i](this.fragment(e)):e instanceof HTMLElement&&t[i](e),this}static createElement(t){return document.createElement.call(document,t)}static createTextNode(t){return document.createTextNode.call(document,t)}static createDocumentFragment(){return document.createDocumentFragment.call(document)}static remove(t){return t.remove()}static siblings=t=>Array.prototype.slice.call(t.parentElement?.children).filter(e=>e!==t);static nextElementSibling(t){return t.nextElementSibling}static previousElementSibling(t){return t.previousElementSibling}static closest(t,e){return t.closest(e)}static shadowRoot(t){return t.shadowRoot}static parentElement=t=>t.parentElement;static changeSelectSelected(t,e){if(t instanceof HTMLSelectElement){const i=t.options;for(let n=0,r=i.length;n<r;n++)i[n].value==e?i[n].selected=!0:i[n].selected=!1}}static changeRadioChecked(t,e){t instanceof HTMLInputElement&&(t.value==e?t.checked=!0:t.checked=!1)}static entity2text(t){const e={lt:60,"lt;":60,"AMP;":38,AMP:38,"GT;":62,GT:62,"QUOT;":34,QUOT:34,"apos;":39,"bull;":8226,"bullet;":8226,"copy;":169,copy:169,"deg;":176,deg:176};let i;return t.charAt(0)=="#"?t.charAt(1).toLowerCase()=="x"?i=parseInt(t.substring(2),16):i=parseInt(t.substring(1),10):i=e[t],i?String.fromCharCode(i):"&"+t}static waitForStyleSheetsLoaded=()=>new Promise(t=>{const e=Array.from(document.querySelectorAll("link[rel=stylesheet]"));let i=document.styleSheets.length??0;const n=()=>i>=e.length?(t(),!0):!1;n()||e.forEach(r=>{r.onload=()=>{i+=1,n()}})});static loadScript(t,e=()=>{},i=(n,r,a,o,h)=>{}){const n=document.createElement("script");n.type="text/javascript",n.src=t,n.async=!1,n.onload=e,n.onerror=i,document.body.appendChild(n)}static runInSafe(t){const e=new Proxy(window,{get(i,n,r){if(typeof n=="string"&&["open","location","document"].includes(n))throw new Error(`禁止访问 key: ${n}`);return n==="window"?e:Reflect.get(i,n,r)},set(i,n,r,a){return Reflect.set(i,n,r,a)}});new Function("window",`with(window) { ${t} }`)(e,null)}static dom=new Proxy({},{get(t,e){return function(i={},...n){const r=document.createElement(e);for(const a of Object.keys(i))r.setAttribute(a,i[a]);for(const a of n)typeof a=="string"?r.appendChild(document.createTextNode(a)):r.appendChild(a);return r}}});static compileTemplate(t){return t=t.replace(/<%=(.+?)%>/g,"`); \n echo( $1 ); \n echo(`").replace(/<%([\s\S]+?)%>/g,"`); \n $1 \n echo(`"),t="echo(`"+t+"`);",`(function parse(data){
|
|
23
12
|
let output = "";
|
|
24
13
|
function echo(html){
|
|
25
14
|
output += html;
|
|
26
15
|
}
|
|
27
16
|
${t}
|
|
28
17
|
return output;
|
|
29
|
-
})`}static safeHtml(t,e="encode"){const n={"&":"&","<":"<",">":">",""":'"',"'":"'"};for(const r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t=t.replace(new RegExp(e=="decode"?r:n[r],"g"),e=="decode"?n[r]:r));return t}static loadScript(t,e=()=>{},n=(r,s,o,a,h)=>{}){const r=document.createElement("script");r.type="text/javascript",r.src=t,r.async=!1,document.body.appendChild(r),r.onload=e,r.onerror=n}static loadStyle(t){const e=document.createElement("link");e.rel="stylesheet",e.href=t,document.head.insertBefore(e,document.head.childNodes[document.head.childNodes.length-1].nextSibling)}static waitForStyleSheetsLoaded=()=>new Promise(t=>{const e=Array.from(document.querySelectorAll("link[rel=stylesheet]"));let n=document.styleSheets.length??0;const r=()=>n>=e.length?(t(),!0):!1;r()||e.forEach(s=>{s.onload=()=>{n+=1,r()}})});static lazyloadImages(){const t=document.getElementsByTagName("img"),e=zr().height;let n=0;return()=>{for(let r=n;r<t.length;r++)t[r].getBoundingClientRect().top<e&&(t[r].src=t[r].getAttribute("data-src")??"",n=r+1)}}static iframePostMessage(t,e="http://test.com/localstorage.html"){const n=document.createElement("iframe");n.src=e,document.body.append(n),setTimeout(function(){n.contentWindow?.postMessage(t,e)},4e3),setTimeout(function(){n.remove()},6e3)}static getTextWidth=(t,e,n=400)=>{const r=document.createElement("span");r.style.visibility="hidden",r.style.padding="0",r.style.whiteSpace="nowrap",r.style.overflow="visible",r.style.fontSize=e>12?e+"px":"12px",r.style.fontWeight=n.toString(),r.innerText=t,document.body.appendChild(r);const s=r.offsetWidth;return document.body.removeChild(r),s};static getFixedWidthText=(t,e,n=12,r=400,s=!0)=>{let o="",a="",h="";if(!t||e<n||typeof t!="string")return o;const m=t.split(""),g=document.createElement("span");g.style.visibility="hidden",g.style.padding="0",g.style.whiteSpace="nowrap",g.style.overflow="visible",g.style.fontSize=n>12?n+"px":"12px",g.style.fontWeight=r.toString(),document.body.appendChild(g);for(let x=0,y=m.length;x<y;x++){const w=m[x];if(a=h,h+=w,o=h,g.innerText=h,g.offsetWidth>e){s?o=a+"...":o=a;break}}return document.body.removeChild(g),o};static getLocation(){return new Promise((t,e)=>{navigator.geolocation?navigator.geolocation.getCurrentPosition(n=>{t(n.coords)}):e("Geolocation is not supported by this browser")})}static vibrate(t=200){"vibrate"in navigator?window.navigator.vibrate(t):console.error("Your device is not support vibrate on this browser.")}static copyToClipboard=t=>new Promise((e,n)=>{if(navigator.clipboard)navigator.clipboard.writeText(t).then(e).catch(n);else{const r=document.createElement("textarea");r.value=t,r.style.opacity="0",r.style.top="0",r.style.left="0",r.style.position="fixed",document.body.appendChild(r),r.focus(),r.select();try{document.execCommand("copy")?e():n()}catch(s){n(s)}document.body.removeChild(r)}});static getInnerText=t=>{let e=t.innerText;if(!e){const n=t.querySelector("slot")?.assignedNodes()||[];let r=0;for(;!e&&r<=n.length-1;)"innerText"in n[r]&&(e=n[r].innerText),r++}return e};static getSelectedText=()=>window.getSelection()?.toString();static siblings=t=>Array.prototype.slice.call(t.parentNode?.children).filter(e=>e!==t);static isElementFocus=t=>t===document.activeElement;static isTabInView=()=>!document.hidden;static navigateBack=()=>history.back();static navigateBack2=()=>history.go(-1);static addDebuggerOnBeforeUnload=()=>{window.addEventListener("beforeunload",()=>{debugger})}}function tr(i,t=document){return new zt(i,t)}class zt{context;nodes;prefixs=["moz","o","ms","webkit"];constructor(t,e=document){if(this.context=e,typeof t=="string"?this.nodes=Array.from(this.context.querySelectorAll(t)):t instanceof HTMLElement?this.nodes=[t]:this.nodes=t,this.nodes.length===0)throw new Error(`can not find ${t}`);this.each((n,r)=>{n instanceof HTMLInputElement&&n.addEventListener("change",s=>{this.changeRadioChecked(s.currentTarget.value)}),n instanceof HTMLSelectElement&&n.addEventListener("change",s=>{this.changeSelectSelected(s.currentTarget.value)})})}get(t){return t<0&&(t=this.nodes.length+t),this.nodes[t]}concat(t){return new zt(this.nodes.concat(t.nodes),this.context)}then(t){return t(this)??this}each(t){return this.nodes.forEach((e,n)=>{t(e,n)}),this}_save(t,e,n){t._mQuery||(t._mQuery={}),Array.isArray(n)?(t._mQuery[e]=t._mQuery[e]??[],t._mQuery[e].push(...n)):n!=null?t._mQuery[e]=n:delete t._mQuery[e]}on(t,e,n){return this.nodes.forEach(r=>{this._save(r,"events",[{event:t,callback:e,options:n}]),r.addEventListener(t,e,n)}),this}off(t,e,n){return this.nodes.forEach(r=>{r.removeEventListener(t,e,n)}),this}dispatchEvent(t,e){let n;const r=["click","dblclick","mousedown","mouseup","mousemove"],s=["keydown","keyup","keypress"];return typeof t=="string"?r.includes(t)?n=new MouseEvent(t,e):s.includes(t)?n=new KeyboardEvent(t,e):n=new Event(t,e):n=t,this.nodes.forEach(o=>{o.dispatchEvent(n)}),this}change(){return this.dispatchEvent("change")}click(){return this.dispatchEvent("click")}static hasEvent(t,e){return"on"+e in t}static _fragment(t){const e=document.createElement("template");return e.innerHTML=t,e.content.childNodes.forEach(n=>{const r=zt._scriptConvert(n);r!=n&&e.content.replaceChild(r,n)}),e.content}static _scriptConvert(t){const e=n=>{const s=n.ownerDocument.createElement("script");s.text=n.text;const o=n.attributes;for(let a=0;a<o.length;a++)s.setAttribute(o[a].name,o[a].value);return s};return t.tagName=="SCRIPT"&&(t=e(t)),t.querySelectorAll&&t.querySelectorAll("script").forEach(n=>{n.parentNode?.replaceChild(e(n),n)}),t}static _fixProp(t){const e={cellpadding:"cellPadding",cellspacing:"cellSpacing",class:"className",colspan:"colSpan",contenteditable:"contentEditable",for:"htmlFor",frameborder:"frameBorder",maxlength:"maxLength",readonly:"readOnly",rowspan:"rowSpan",tabindex:"tabIndex",usemap:"useMap"};return e[t]?e[t]:t}static isSVG(t){return(t||document.documentElement).nodeName.toLowerCase()==="svg"}static createElement(t){return zt.isSVG()?document.createElementNS.call(document,"http://www.w3.org/2000/svg",t):document.createElement.call(document,t)}static createTextNode(t){return document.createTextNode.call(document,t)}static createDocumentFragment(){return document.createDocumentFragment.call(document)}_insert(t,e){const n=this.nodes.length;if(n<1)return this;const r=[];if(typeof e=="string")this.nodes.forEach(s=>{const o=zt._fragment(e);r.push(...o.children),s[t](o)});else if(e instanceof HTMLElement)this.each(s=>{const o=n===1?e:zt._fragment(e.outerHTML);r.push(...n===1?[e]:o.children),s[t](o)}),n>1&&e.remove();else if(e instanceof zt){const s=n==1;e.each(o=>{this.each(a=>{const h=s?o:o.cloneNode(!0);r.push(h),a[t](h),zt._scriptConvert(h)})}),s||e.remove()}return t=="replaceWith"&&(this.nodes=r),this}append(t){return this._insert("append",t)}prepend(t){return this._insert("prepend",t)}after(t){return this._insert("after",t)}before(t){return this._insert("before",t)}replace(t){return this._insert("replaceWith",t)}remove(){return this.nodes.forEach(t=>{t.remove()}),this}static removeChild(t){t.parentElement?.removeChild(t)}find(t){const e=[];return this.nodes.forEach(n=>{e.push(...Array.from(n.querySelectorAll(t)))}),new zt(e,this.context)}filter(t){const e=[];return this.nodes.forEach(n=>{(n===t||typeof t=="string"&&n.matches&&n.matches(t))&&e.push(n)}),new zt(e,this.context)}next(){const t=[];return this.nodes.forEach(e=>{const n=e.nextElementSibling;n&&t.push(n)}),new zt(t,this.context)}prev(){const t=[];return this.nodes.forEach(e=>{const n=e.previousElementSibling;n&&t.push(n)}),new zt(t,this.context)}closest(t){const e=[];return this.nodes.forEach(n=>{const r=n.closest(t);r&&e.push(r)}),new zt(e,this.context)}shadow(t){const e=[];this.nodes.forEach(r=>{r.shadowRoot&&e.push(r.shadowRoot)});const n=new zt(e,this.context);return t!==void 0?n.find(t):n}parent(t){return this.parents(t,!0)}parents(t,e=!1){const n=[],r=o=>{if(n.indexOf(o)==-1&&n.push(o),!e&&o.parentElement)return r(o.parentElement)};this.nodes.forEach(o=>{o.parentElement&&r(o.parentElement)});const s=new zt(n,this.context);return t!==void 0?s.filter(t):s}static getComputedStyle(t,e,n){let r;const s=t.style.getPropertyPriority(e);return"getComputedStyle"in window?(r=getComputedStyle.call(window,t,n),r=r.getPropertyValue(e)):r=t.style.getPropertyValue(e),r+(s?"!"+s:"")}css(t,e){if((t===void 0||typeof t=="string")&&e===void 0){const n=this.nodes[0].style;if(typeof t=="string"){const r=n.getPropertyPriority(t),s=n.getPropertyValue(t).trim();return s?s+(r?"!"+r:""):zt.getComputedStyle(this.nodes[0],t)}else{const r=Object.fromEntries(this.nodes[0].style.cssText.split(";").filter(s=>!!s).map(s=>s.split(":").map(o=>o.trim())));return Object.assign(r,getComputedStyle.call(window,this.nodes[0])),r}}else{let n={};return typeof t=="string"&&e!==void 0?n[t]=e:typeof t=="object"&&(n=t),this.nodes.forEach(r=>{Object.keys(n).forEach(s=>{const o=String(n[s]).toLowerCase().includes("!important")?"important":"";r.style.setProperty(s,String(n[s]).replace(/!important/i,""),o)})}),this}}addClass(t){return this.toggleClass(t,!0)}removeClass(t){return this.toggleClass(t,!1)}toggleClass(t,e){const n=t.split(/[,\s]+/);return this.nodes.forEach(r=>{n.forEach(s=>{if(s.trim()!==""){let o="toggle";e!==void 0&&(o=e?"add":"remove"),r.classList[o](s.trim())}})}),this}hasClass(t){const e=t.split(/[,\s]+/);let n=!1;return this.nodes.forEach(r=>{n=n||e.every(s=>Array.from(r.classList??[]).includes(s.trim()))}),n}attr(t,e){if(e===void 0&&typeof t=="string")return this.nodes[0].getAttribute(t);let n={};return typeof t=="object"?n=t:e!==void 0&&(n[t]=e),this.nodes.forEach(r=>{Object.entries(n).forEach(([s,o])=>{r.setAttribute(s,o)})}),this}removeAttr(t){const e=t.split(/[,\s]+/);return this.nodes.forEach(n=>{e.forEach(r=>{n.removeAttribute(r)})}),this}prop(t,e){if(e===void 0&&typeof t=="string")return this.nodes[0][t];{let n={};return typeof t=="object"?n=t:typeof t=="string"&&e!==void 0&&(n[t]=e),this.nodes.forEach(r=>{Object.entries(n).forEach(([s,o])=>{const a=zt._fixProp(s);r[a]=o,a=="innerHTML"&&zt._scriptConvert(r)})}),this}}removeProp(t){const e=t.split(/[,\s]+/);return this.nodes.forEach(n=>{e.forEach(r=>{delete n[zt._fixProp(r)]})}),this}changeSelectSelected(t){this.nodes.forEach(e=>{if(e instanceof HTMLSelectElement){const n=e.options;for(let r=0,s=n.length;r<s;r++)n[r].value==t?n[r].selected=!0:n[r].selected=!1}})}changeRadioChecked(t){this.nodes.forEach(e=>{e instanceof HTMLInputElement&&(e.value==t?e.checked=!0:e.checked=!1)})}data(t,e){if(typeof t=="string"&&t.indexOf("-")!=-1)throw new Error(`Key "${t}" contains "-" (dash). Dashes are not allowed in property names. Use camelCase instead.`);if((typeof t=="string"||t===void 0)&&e===void 0){const n=Object.assign({},this.nodes[0].dataset);return Object.keys(n).forEach(r=>{if(n[r]?.startsWith("[")||n[r]?.startsWith("{"))try{n[r]=JSON.parse(n[r]??"")}catch{}}),typeof t=="string"?n[t]:n}else{let n={};return typeof t=="object"?n=t:typeof t=="string"&&(n[t]=e),this.nodes.forEach(r=>{Object.entries(n).forEach(([s,o])=>{o!=null?r.dataset[s]=o instanceof Object?JSON.stringify(o):o:delete r.dataset[s]})}),this}}removeData(t){const e=t.split(/[,\s]+/);return this.nodes.forEach(n=>{e.forEach(r=>{delete n.dataset[r]})}),this}show(){return this.toggle(!0)}hide(){return this.toggle(!1)}toggle(t){return this.nodes.forEach(e=>{const n=e.style.display,r=getComputedStyle(e).display,s=n=="none"||r=="none";if(s&&(t===void 0||t===!0)){const o=e instanceof HTMLTableRowElement?"table-row":e instanceof HTMLTableCellElement?"table-cell":"block";e.style.display=e._mQuery?.prevDisplay??(n==r&&r!="none"?"":o),this._save(e,"prevDisplay",null)}!s&&(t==null||t===!1)&&(r!="none"&&this._save(e,"prevDisplay",r),e.style.setProperty("display","none"))})}empty(){return this.html("")}html(t){return t instanceof HTMLElement?this.empty().append(t.innerHTML):this.prop("innerHTML",t)}text(t){return this.prop("textContent",t)}val(t){return this.prop("value",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"),n=document.createElement("video"),r=document.createElement("source"),s=new MediaSource;s.addEventListener("sourceopen",()=>t(!0)),r.src=URL.createObjectURL(s),r.media="(min-width:10px)",n.append(r),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(()=>{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)}}function er(i,t){if(typeof t<"u")window.localStorage.setItem(i,t);else return window.localStorage.getItem(i)??void 0}function So(i,t,e){const n=new Date;n.setTime(n.getTime()+e*24*60*60*1e3);const r="expires="+n.toUTCString();document.cookie=i+"="+t+"; "+r}function Eo(i){const t=i+"=",e=document.cookie.split(";");for(let n=0,r=e.length;n<r;n++){const s=e[n].trim();if(s.indexOf(t)==0)return s.substring(t.length,s.length)}return""}const Po=()=>document.cookie.split(";").map(i=>i.split("=")).reduce((i,[t,e])=>(i[t.trim().replace('"',"")]=e,i),{}),ko=()=>document.cookie.split(";").forEach(i=>document.cookie=i.replace(/^ +/,"").replace(/=.*/,`=;expires=${new Date().toUTCString()};path=/`));Gt.page.on("matchMediaChangePrefersColorSchemeDark",i=>{ni(i?"dark":"light")}),Cs();function ni(i){er("colorScheme",i),document.documentElement.classList.toggle("dark",i=="dark")}function Cs(){const i=er("colorScheme");if(i)return ni(i),i;{const t=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";return ni(t),t}}const Ao={safeAreaTop:St.getCSSVar("--safe-area-inset-top"),safeAreaRight:St.getCSSVar("--safe-area-inset-right"),safeAreaBottom:St.getCSSVar("--safe-area-inset-bottom"),safeAreaLeft:St.getCSSVar("--safe-area-inset-left"),colorPrimary:St.getCSSVar("--color-primary")||"#5078f0",colorRed:St.getCSSVar("--color-red")||"#ff5050",colorOrange:St.getCSSVar("--color-orange")||"#fa8c00",colorYellow:St.getCSSVar("--color-yellow")||"#fadc32",colorGreen:St.getCSSVar("--color-green")||"#00c878",colorBlue:St.getCSSVar("--color-blue")||"#00b4fa",colorPurple:St.getCSSVar("--color-purple")||"#6464fa",colorBlack:St.getCSSVar("--color-black")||"#001428",colorGray0:St.getCSSVar("--color-gray-0")||"#000000",colorGray3:St.getCSSVar("--color-gray-3")||"#333333",colorGray6:St.getCSSVar("--color-gray-6")||"#666666",colorGray9:St.getCSSVar("--color-gray-9")||"#999999",colorGrayCC:St.getCSSVar("--color-gray-cc")||"#cccccc",colorGrayDD:St.getCSSVar("--color-gray-dd")||"#dddddd",colorGrayE6:St.getCSSVar("--color-gray-e6")||"#e6e6e6",colorGrayEE:St.getCSSVar("--color-gray-ee")||"#eeeeee",colorGrayEF:St.getCSSVar("--color-gray-ef")||"#efefef",colorGrayF5:St.getCSSVar("--color-gray-f5")||"#f5f5f5",colorGrayFF:St.getCSSVar("--color-gray-ff")||"#ffffff",fontLineHeight:St.getCSSVar("--font-line-height")||"1,4",fontSize32:St.getCSSVar("--font-size-32")||"32px",fontSize24:St.getCSSVar("--font-size-24")||"24px",fontSize20:St.getCSSVar("--font-size-20")||"20px",fontSize18:St.getCSSVar("--font-size-18")||"18px",fontSize16:St.getCSSVar("--font-size-16")||"16px",fontSize14:St.getCSSVar("--font-size-14")||"14px",fontSize12:St.getCSSVar("--font-size-12")||"12px",fontSize11:St.getCSSVar("--font-size-11")||"11px",gap4:St.getCSSVar("--gap-4")||"4px",gap8:St.getCSSVar("--gap-8")||"8px",gap12:St.getCSSVar("--gap-12")||"12px",gap16:St.getCSSVar("--gap-16")||"16px",gap20:St.getCSSVar("--gap-20")||"20px",gap40:St.getCSSVar("--gap-40")||"40px",height44:St.getCSSVar("--height-44")||"44px",height32:St.getCSSVar("--height-32")||"32px",borderRadius:St.getCSSVar("--border-radius")||"4px"},Mo=()=>Math.random()*16777215,Io=()=>`#${Math.random().toString(16).slice(2,8).padEnd(6,"0")}`,Lo=()=>`#${(~~(Math.random()*(1<<24))).toString(16)}`,ii=function(i){return i[0]==="#"&&(i=i.slice(1)),parseInt(i,16)},Ts=function(i){let t="00000"+(i|0).toString(16);return t="#"+t.substring(t.length-6),t},Ss=function(i,t=1){const e=i>>16&255,n=i>>8&255,r=i&255,s=t<0?0:t>1?1:t;return s===1?"rgb("+e+","+n+","+r+")":"rgba("+e+","+n+","+r+","+s+")"},nr=function(i,t=1){const e=ii(i);return Ss(e,t)},Do=i=>{const e=/rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d?\.?\d*)\s*\)/gi.exec(i);return e?"#"+((1<<24)+(parseInt(e[1])<<16)+(parseInt(e[2])<<8)+parseInt(e[3])).toString(16).slice(1):""};function Ro(i,t){let e=parseInt(i.substring(1,3),16),n=parseInt(i.substring(3,5),16),r=parseInt(i.substring(5,7),16);e==0&&(e=32),n==0&&(n=32),r==0&&(r=32),e=e*(100+t)/100,n=n*(100+t)/100,r=r*(100+t)/100,e=e<255?e:255,n=n<255?n:255,r=r<255?r:255,e=Math.round(e),n=Math.round(n),r=Math.round(r);const s=e.toString(16).length==1?"0"+e.toString(16):e.toString(16),o=n.toString(16).length==1?"0"+n.toString(16):n.toString(16),a=r.toString(16).length==1?"0"+r.toString(16):r.toString(16);return"#"+s+o+a}function Oo(i,t,e,n){let r,s,o;i=i/360,t=t/100,e=e/100;const a=Math.floor(i*6),h=i*6-a,m=e*(1-t),g=e*(1-h*t),x=e*(1-(1-h)*t);switch(a%6){case 0:r=e,s=x,o=m;break;case 1:r=g,s=e,o=m;break;case 2:r=m,s=e,o=x;break;case 3:r=m,s=g,o=e;break;case 4:r=x,s=m,o=e;break;case 5:default:r=e,s=m,o=g;break}return{r:Math.round(r*255),g:Math.round(s*255),b:Math.round(o*255),a:n??1}}function No(i,t,e,n){const r=Math.max(i,t,e),s=Math.min(i,t,e),o=r-s,a=r===0?0:o/r,h=r/255;let m;switch(r){case s:m=0;break;case i:m=t-e+o*(t<e?6:0),m/=6*o;break;case t:m=e-i+o*2,m/=6*o;break;case e:default:m=i-t+o*4,m/=6*o;break}return{h:Math.round(m*360),s:Math.round(a*100),v:Math.round(h*100),a:n??1}}function Bo(i){return btoa(encodeURIComponent(i)).replaceAll("+","*").replaceAll("/","-").replaceAll("=","")}function Fo(i){let t=i.replaceAll("*","+").replaceAll("-","/");const e=t.length%4;return e&&(t=t.padEnd(t.length+(4-e),"=")),decodeURIComponent(atob(t))}function ir(i=window.location.href){return Ti(URL)?new URL(i):Es(i)}function Es(i=window.location.href){const t="(?<protocol>https?:)",e="(?<host>(?<hostname>[^/#?:]+)(?::(?<port>\\d+))?)",n="(?<pathname>(?:\\/[^/#?]+)*\\/?)",r="(?<search>(?:\\?[^#]*)?)",s="(?<hash>(?:#.*)?)",a=new RegExp(`^${t}//${e}${n}${r}${s}$`).exec(i);return{href:i,protocol:a?.groups?.protocol??"",host:a?.groups?.host??"",hostname:a?.groups?.hostname??"",port:a?.groups?.port??"",pathname:a?.groups?.pathname??"",search:a?.groups?.search??"",hash:a?.groups?.hash??""}}function zo(i){const t=ir(i);return t.protocol==="http:"||t.protocol==="https:"}function Ps(i=window.location.href){const t=ir(i),e=t.href.indexOf(t.hash);return t.hash&&e>=0?t.href.substring(0,e):t.href}function Uo(i=location.search){i=decodeURIComponent(i).replace(/^[#?&]/,"");const t={};if(!i)return t;const e=/(?:^|&)([^&=]*)=?([^&]*?)(?=&|$)/y;let n=e.exec(i);for(;n;)t[n[1]]=n[2],n=e.exec(i);return t}function Go(i){return Array.from(new URLSearchParams(i)).reduce((t,[e,n])=>Object.assign({},t,{[e]:t[e]?(Array.isArray(t[e])?t[e]:[t[e]]).concat(n):n}),{})}function ks(i){let t="";for(const e in i)t&&(t+="&"),t+=`${e}=${i[e]}`;return t}function Vo(i){return new URLSearchParams(i).toString()}function rr(i){return"?"+[...i.entries()].map(t=>encodeURIComponent(t[0])+"="+encodeURIComponent(t[1]instanceof File?t[1].name:t[1])).join("&")}function ri(i,t){return i.indexOf("?")>=0?i+t.replace(/^\?/,"&"):i.replace(/(?:\?.*)?$/,t.replace(/^[&?]/,"?"))}function jo(i){let t="";new MutationObserver(function(n){window.location.href!==t&&(t=window.location.href,i&&i(location.href))}).observe(document,{attributes:!0,childList:!0,subtree:!0})}function Xo(i){window.addEventListener("hashchange",()=>{i(location.hash)})}function Ho(i){window.addEventListener("popstate",i,!1)}function Wo(i){let t=null;if($r)try{t=new Worker(URL.createObjectURL(new Blob([i])))}catch(e){return typeof console!==void 0&&typeof console.warn=="function"&&console.warn("🎊 Could not load worker",e),null}return t}const si=new Map;async function Yo(i){return new Promise((t,e)=>{ai(i,(n,r)=>n?e(n):t({width:r.width,height:r.height,aspectRatio:r.width/r.height}))})}const ai=(i,t)=>{if(si.has(i))return t(null,si.get(i));const e=new Image;e.onload=function(){si.set(i,{width:e.width,height:e.height,element:e}),t(null,si.get(i))},e.onerror=function(n){t(n,null)},e.src=i},qo=(i,t)=>{for(let e=0,n=i.length;e<n;e++){const r=i[e],{type:s}=r;if(s.split("/")[0]!=="image")return;const a=new FileReader;a.onload=function(h){if(!h.target)return t("no reader target",null);const m=h.target.result,g=gr(m),x=new Blob([m]);sr(x,(y,w)=>{if(!w)return t(y,null);ai(w,(k,P)=>{if(!P)return t(k,null);As(w,(D,N)=>{if(!N)return t(D,null);const R={name:r.name,fileType:g,size:r.size,width:P.width,height:P.height,imgUrl:w,imageData:N,blob:x};return t(null,R)})})})},a.readAsArrayBuffer(r)}},As=(i,t)=>{ai(i,(e,n)=>{if(!n)return t(e,null);const r=document.createElement("canvas"),s=r.getContext("2d");r.width=n.width,r.height=n.height,s.drawImage(n.element,0,0,r.width,r.height);const o=s.getImageData(0,0,r.width,r.height);return t(null,o)})},$o=(i,t=0,e=0)=>{const n=document.createElement("canvas"),r=n.getContext("2d");return n.width=t,n.height=e,r.drawImage(i,0,0,t,e),r.getImageData(0,0,t,e)},Jo=(i,t=0,e=0)=>{const n=document.createElement("canvas"),r=n.getContext("2d");return n.width=t,n.height=e,r.drawImage(i,0,0,t,e),r.getImageData(0,0,t,e)},Zo=i=>{const t=i.width,e=i.height,n=t*e*3,r=n+54,s=[66,77,r&255,r>>8&255,r>>16&255,r>>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=i.data;let m="";const g=t<<2;let x=e;const y=String.fromCharCode;do{const k=g*(x-1);let P="";for(let D=0;D<t;D++){const N=D<<2;P+=y(h[k+N+2])+y(h[k+N+1])+y(h[k+N])}for(let D=0;D<a;D++)P+=String.fromCharCode(0);m+=P}while(--x);function w(k){if(!window.btoa)throw"btoa undefined";let P="";if(typeof k=="string")P=k;else for(let D=0;D<k.length;D++)P+=String.fromCharCode(k[D]);return btoa(P)}return w(s.concat(o))+w(m)},Ko=i=>{const{width:t,height:e}=i,n=document.createElement("canvas"),r=n.getContext("2d");return n.width=t,n.height=e,r.putImageData(i,0,0,0,0,t,e),n.toDataURL("image/png")},Qo=(i,t,e)=>{const{width:n,height:r}=i,s=document.createElement("canvas"),o=s.getContext("2d");s.width=n,s.height=r,o.putImageData(i,0,0,0,0,n,r);const a=`image/${t?t.toLowerCase():"png"}`;s.toBlob(h=>{e?.(null,h)},a,1)},sr=(i,t)=>{const e=new FileReader;e.onload=function(n){n.target?t(null,n.target.result):t("can't readAsDataURL",null)},e.readAsDataURL(i)},th=(i,t)=>{sr(i,function(e,n){if(n){const r=new Image;r.src=n}else t(e)})};function eh(i){const t=[],e=[],n=[];let r=0;for(let h=0,m=i.data.length;h<m;h+=4)t[r]=i.data[h],e[r]=i.data[h+1],n[r]=i.data[h+2],r+=1;const s=ar(t),o=ar(e),a=ar(n);return"rgb("+s+","+o+","+a+")"}function ar(i){const t={},e=[],n=[];for(let a=0;a<i.length;a++)t[i[a]]?e.push(i[a]):t[i[a]]=1;let r=0;for(let a=0;a<e.length;a++){r=0;for(let h=0;h<e.length;h++)e[a]===e[h]&&(r+=1),n[a]=r}const s=Math.max.apply(null,n);let o=0;for(;o<n.length;o++)if(n[o]===s)return;return e[o]}const nh=i=>{const{data:t,width:e,height:n}=i,r=new Uint8ClampedArray(t.length);for(let o=0;o<n;o++)for(let a=0;a<e;a++){const h=(o*e+a)*4;r[h]=t[(o*e+e-a-1)*4],r[h+1]=t[(o*e+e-a-1)*4+1],r[h+2]=t[(o*e+e-a-1)*4+2],r[h+3]=t[(o*e+e-a-1)*4+3]}return new ImageData(r,e,n)},ih=i=>{const{data:t,width:e,height:n}=i,r=new Uint8ClampedArray(t.length);for(let o=0;o<n;o++)for(let a=0;a<e;a++){const h=(o*e+a)*4;r[h]=t[((n-o-1)*e+a)*4],r[h+1]=t[((n-o-1)*e+a)*4+1],r[h+2]=t[((n-o-1)*e+a)*4+2],r[h+3]=t[((n-o-1)*e+a)*4+3]}return new ImageData(r,e,n)},rh=i=>{const{data:t,width:e,height:n}=i,r=new Uint8ClampedArray(t.length);for(let o=0;o<e;o++)for(let a=0;a<n;a++){const h=(o*n+a)*4;r[h]=t[(a*e+e-o-1)*4],r[h+1]=t[(a*e+e-o-1)*4+1],r[h+2]=t[(a*e+e-o-1)*4+2],r[h+3]=t[(a*e+e-o-1)*4+3]}return new ImageData(r,n,e)},sh=i=>{const{data:t,width:e,height:n}=i,r=new Uint8ClampedArray(t.length);for(let o=0;o<e;o++)for(let a=0;a<n;a++){const h=(o*n+a)*4;r[h]=t[((n-a-1)*e+o)*4],r[h+1]=t[((n-a-1)*e+o)*4+1],r[h+2]=t[((n-a-1)*e+o)*4+2],r[h+3]=t[((n-a-1)*e+o)*4+3]}return new ImageData(r,n,e)},ah=i=>{const{data:t,width:e,height:n}=i,r=new Uint8ClampedArray(t.length);for(let o=0;o<n;o++)for(let a=0;a<e;a++){const h=(o*e+a)*4,m=(t[h]+t[h+1]+t[h+2])/3;r[h]=m,r[h+1]=m,r[h+2]=m,r[h+3]=t[h+3]}return new ImageData(r,e,n)},oh=i=>{const{data:t,width:e,height:n}=i,r=new Uint8ClampedArray(t.length);for(let o=0;o<n;o++)for(let a=0;a<e;a++){const h=(o*e+a)*4,m=.2126*t[h]+.7152*t[h+1]+.0722*t[h+2];r[h]=m,r[h+1]=m,r[h+2]=m,r[h+3]=t[h+3]}return new ImageData(r,e,n)},hh=i=>{const{data:t,width:e,height:n}=i,r=new Uint8ClampedArray(t.length);for(let o=0;o<n;o++)for(let a=0;a<e;a++){const h=(o*e+a)*4,g=(t[h]+t[h+1]+t[h+2])/3>127?255:0;r[h]=g,r[h+1]=g,r[h+2]=g,r[h+3]=t[h+3]}return new ImageData(r,e,n)},ch=i=>{const{data:t,width:e,height:n}=i,r=new Uint8ClampedArray(t.length);for(let o=0;o<n;o++)for(let a=0;a<e;a++){const h=(o*e+a)*4;r[h]=255-t[h],r[h+1]=255-t[h+1],r[h+2]=255-t[h+2],r[h+3]=t[h+3]}return new ImageData(r,e,n)},lh=i=>{const{data:t,width:e,height:n}=i,r=new Uint8ClampedArray(t.length);for(let o=0;o<n;o++)for(let a=0;a<e;a++){const h=(o*e+a)*4;r[h]=t[h],r[h+1]=0,r[h+2]=0,r[h+3]=t[h+3]}return new ImageData(r,e,n)},uh=i=>{const{data:t,width:e,height:n}=i,r=new Uint8ClampedArray(t.length);for(let o=0;o<n;o++)for(let a=0;a<e;a++){const h=(o*e+a)*4;r[h]=0,r[h+1]=t[h+1],r[h+2]=0,r[h+3]=t[h+3]}return new ImageData(r,e,n)},fh=i=>{const{data:t,width:e,height:n}=i,r=new Uint8ClampedArray(t.length);for(let o=0;o<n;o++)for(let a=0;a<e;a++){const h=(o*e+a)*4;r[h]=0,r[h+1]=0,r[h+2]=t[h+2],r[h+3]=t[h+3]}return new ImageData(r,e,n)},dh=i=>{const{data:t,width:e,height:n}=i,r=new Uint8ClampedArray(t.length);for(let o=0;o<n;o++)for(let a=0;a<e;a++){const h=(o*e+a)*4;r[h]=t[h],r[h+1]=t[h+1],r[h+2]=0,r[h+3]=t[h+3]}return new ImageData(r,e,n)},ph=i=>{const{data:t,width:e,height:n}=i,r=new Uint8ClampedArray(t.length);for(let o=0;o<n;o++)for(let a=0;a<e;a++){const h=(o*e+a)*4;r[h]=t[h],r[h+1]=0,r[h+2]=t[h+1],r[h+3]=t[h+3]}return new ImageData(r,e,n)},mh=i=>{const{data:t,width:e,height:n}=i,r=new Uint8ClampedArray(t.length);for(let o=0;o<n;o++)for(let a=0;a<e;a++){const h=(o*e+a)*4;r[h]=0,r[h+1]=t[h+1],r[h+2]=t[h+1],r[h+3]=t[h+3]}return new ImageData(r,e,n)},gh=i=>{const{data:t,width:e,height:n}=i,r=new Uint8ClampedArray(t.length);for(let o=0;o<n;o++)for(let a=0;a<e;a++){const h=(o*e+a)*4,m=(t[h+1]+t[h+2])/2;r[h]=t[h],r[h+1]=m,r[h+2]=m,r[h+3]=t[h+3]}return new ImageData(r,e,n)},vh=i=>{const{data:t,width:e,height:n}=i,r=new Uint8ClampedArray(t.length);for(let o=0;o<n;o++)for(let a=0;a<e;a++){const h=(o*e+a)*4,m=(t[h]+t[h+2])/2;r[h]=m,r[h+1]=t[h+1],r[h+2]=m,r[h+3]=t[h+3]}return new ImageData(r,e,n)},yh=i=>{const{data:t,width:e,height:n}=i,r=new Uint8ClampedArray(t.length);for(let o=0;o<n;o++)for(let a=0;a<e;a++){const h=(o*e+a)*4,m=(t[h]+t[h+1])/2;r[h]=m,r[h+1]=m,r[h+2]=t[h+2],r[h+3]=t[h+3]}return new ImageData(r,e,n)},wh=i=>Ms(i,[-1,-1,-1,-1,9,-1,-1,-1,-1]),xh=i=>Ms(i,[-1,-1,-1,-1,8,-1,-1,-1,-1]),bh=i=>{const{data:t,width:e,height:n}=i,r=new Uint8ClampedArray(t.length);for(let o=0;o<n;o++)for(let a=0;a<e;a++){const h=(o*e+a)*4;r[h]=t[h],r[h+1]=t[h+1],r[h+2]=t[h+2],r[h+3]=255}return new ImageData(r,e,n)},_h=i=>{const{data:t,width:e,height:n}=i,r=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)r[h]=255,r[h+1]=255,r[h+2]=255,r[h+3]=255;else{const m=Is([t[h],t[h+1],t[h+2],t[h+3]],[255,255,255,255]);r[h]=m[0],r[h+1]=m[1],r[h+2]=m[2],r[h+3]=m[3]}}return new ImageData(r,e,n)},Ch=(i,t,e,n,r,s=!1,o)=>{const{data:a,width:h,height:m}=i;let g=r,x=n,y=t,w=e;if(g<0?g=0:g>h&&(g=h),x<0?x=0:x>m&&(x=m),y<1?y=1:y>h&&(y=h),w<1?w=1:w>m&&(w=m),g+y>h&&(y=h-g),x+w>m&&(w=m-x),s){const k=new Uint8ClampedArray(a.length);for(let D=0;D<m;D++)for(let N=0;N<h;N++){const R=(D*h+N)*4;N>=g&&N<=g+y&&D>=x&&D<=x+w?(k[R]=a[R],k[R+1]=a[R+1],k[R+2]=a[R+2],k[R+3]=a[R+3]):(k[R]=255,k[R+1]=255,k[R+2]=255,k[R+3]=o&&["JPG","JPEG"].includes(o.toUpperCase())?255:0)}return new ImageData(k,h,m)}else{const k=new Uint8ClampedArray(y*w*4);for(let D=x;D<=x+w;D++)for(let N=g;N<=g+y;N++){const R=((D-x)*y+N-g)*4,O=(D*h+N)*4;k[R]=a[O],k[R+1]=a[O+1],k[R+2]=a[O+2],k[R+3]=a[O+3]}return new ImageData(k,y,w)}},Th=(i,t,e,n)=>{const{data:r,width:s,height:o}=i;let a=t;a>Math.floor(s/2)&&(a=Math.floor(s/2)),a>Math.floor(o/2)&&(a=Math.floor(o/2)),a<0&&(a=0);const h=new Uint8ClampedArray(r.length);for(let g=0;g<o;g++)for(let x=0;x<s;x++){const y=(g*s+x)*4;let w=-1;x<a?g<a?w=Math.sqrt(Math.pow(a-x-1,2)+Math.pow(a-g-1,2)):g>o-a-1&&(w=Math.sqrt(Math.pow(a-x-1,2)+Math.pow(g-(o-a),2))):x>s-a-1&&(g<a?w=Math.sqrt(Math.pow(x-(s-a),2)+Math.pow(a-g-1,2)):g>o-a-1&&(w=Math.sqrt(Math.pow(x-(s-a),2)+Math.pow(g-(o-a),2)))),Math.round(w)>a?(h[y]=255,h[y+1]=255,h[y+2]=255,h[y+3]=n||e.toUpperCase()==="PNG"?0:255):(h[y]=r[y],h[y+1]=r[y+1],h[y+2]=r[y+2],h[y+3]=n||e.toUpperCase()==="PNG"?r[y+3]:255)}return new ImageData(h,s,o)},Sh=(i,t,e,n,r,s=1e4)=>{const o=new Image;o.src=i;const a=document.createElement("canvas"),h=a.getContext("2d");return a.width=s,a.height=s,h.drawImage(o,0,0,t,e,0,0,n,r),h.getImageData(0,0,n,r)},Eh=(i,t)=>{const{data:e,width:n,height:r}=i,s=new Uint8ClampedArray(e.length);for(let a=0;a<r;a++)for(let h=0;h<n;h++){const m=(a*n+h)*4;s[m]=Math.max(Math.min(e[m]+t,255),0),s[m+1]=Math.max(Math.min(e[m+1]+t,255),0),s[m+2]=Math.max(Math.min(e[m+2]+t,255),0),s[m+3]=e[m+3]}return new ImageData(s,n,r)},Ph=(i,t,e=!1)=>{const{data:n,width:r,height:s}=i,o=new Uint8ClampedArray(n.length);for(let h=0;h<s;h++)for(let m=0;m<r;m++){const g=(h*r+m)*4;n[g+3]===0?(o[g]=255,o[g+1]=255,o[g+2]=255):(o[g]=n[g],o[g+1]=n[g+1],o[g+2]=n[g+2]);let x=n[g+3];e?x=Math.max(Math.min(Math.floor(255*t),255),0):x=Math.max(Math.min(Math.floor(x+255*t),255),0),o[g+3]=x}return new ImageData(o,r,s)},kh=(i,t,e,n)=>{const{data:r,width:s,height:o}=i,{data:a,width:h,height:m}=t;let g=e,x=n;e+m>o&&(g=o-m),n+h>s&&(x=s-h);const y=new Uint8ClampedArray(r.length);for(let k=0;k<o;k++)for(let P=0;P<s;P++){const D=(k*s+P)*4;if(P<x||P>x+h||k<=g||k>=g+m)y[D]=r[D],y[D+1]=r[D+1],y[D+2]=r[D+2],y[D+3]=r[D+3];else{const N=(k*s+P-((g+1)*s+(k-(g+1))*(s-h))+h-x-1)*4,R=[a[N],a[N+1],a[N+2],a[N+3]],O=[r[D],r[D+1],r[D+2],r[D+3]],X=Is(R,O);y[D]=X[0],y[D+1]=X[1],y[D+2]=X[2],y[D+3]=X[3]}}return new ImageData(y,s,o)},Ah=(i,t,e,n,r,s=10)=>{const{data:o,width:a,height:h}=i;let m=r,g=n,x=t,y=e;m<0?m=0:m>a&&(m=a),g<0?g=0:g>h&&(g=h),x<1?x=1:x>a&&(x=a),y<1?y=1:y>h&&(y=h),m+x>a&&(x=a-m),g+y>h&&(y=h-g);const w=new Uint8ClampedArray(o.length);for(let P=0;P<h;P++)for(let D=0;D<a;D++){const N=(P*a+D)*4;if(D>=m&&D<=m+x&&P>=g&&P<=g+y){const R=Math.floor((D-m)/s),O=Math.floor((P-g)/s);let X=Math.floor(s*(R+1)-s/2+m),Y=Math.floor(s*(O+1)-s/2+g);X>a-1&&(X=a-1),Y>h-1&&(Y=h-1);const nt=(Y*a+X)*4;w[N]=o[nt],w[N+1]=o[nt+1],w[N+2]=o[nt+2],w[N+3]=o[nt+3]}else w[N]=o[N],w[N+1]=o[N+1],w[N+2]=o[N+2],w[N+3]=o[N+3]}return new ImageData(w,a,h)},Mh=(i,t,e={backgroundColor:{r:0,g:0,b:0,a:255},changeIntoColor:{r:0,g:0,b:0,a:0}})=>{if(t&&e){const{data:n,width:r,height:s}=i,{data:o}=t,a=new Uint8ClampedArray(n.length),{backgroundColor:h,changeIntoColor:m}=e;for(let x=0;x<s;x++)for(let y=0;y<r;y++){const w=(x*r+y)*4,k=o[w],P=o[w+1],D=o[w+2],N=o[w+3];k===h.r&&P===h.g&&D===h.b&&N===h.a&&m.a!==0?(a[w]=m.r,a[w+1]=m.g,a[w+2]=m.b,a[w+3]=m.a):(a[w]=n[w],a[w+1]=n[w+1],a[w+2]=n[w+2],a[w+3]=n[w+3])}return new ImageData(a,r,s)}return i},Ms=(i,t)=>{const{data:e,width:n,height:r}=i,s=new Uint8ClampedArray(e.length);for(let a=0;a<r;a++)for(let h=0;h<n;h++){const m=(a*n+h)*4;for(let g=0;g<3;g++){const x=m+g;h===0||h===n-1||a===0||a===r-1?s[x]=e[x]:s[x]=t[0]*e[x-n*4-4]+t[1]*e[x-n*4]+t[2]*e[x-n*4+4]+t[3]*e[x-4]+t[4]*e[x]+t[5]*e[x+4]+t[6]*e[x+n*4-4]+t[7]*e[x+n*4]+t[8]*e[x+n*4+4]}s[m+3]=e[m+3]}return new ImageData(s,n,r)},Is=(i,t)=>{if(i&&i.length===4&&t&&t.length===4){const e=i[3],n=t[3];if(e===255||n===0)return i;if(e===0)return t;{const r=e/255,s=n/255,o=Math.max(Math.min(Math.floor(i[0]*r+t[0]*s*(1-r)),255),0),a=Math.max(Math.min(Math.floor(i[1]*r+t[1]*s*(1-r)),255),0),h=Math.max(Math.min(Math.floor(i[2]*r+t[2]*s*(1-r)),255),0),m=Math.max(Math.min(Math.floor((r+s*(1-r))*255),255),0);return[o,a,h,m]}}return[255,255,255,255]},Ls=function(i,t,e){const n=new Array(i*i),r=function(a){const h=a;let m=0,g=0;return{write(x,y){if(x>>>y)throw new Error("length over");for(;m+y>=8;)h.writeByte(255&(x<<m|g)),y-=8-m,x>>>=8-m,g=0,m=0;g=x<<m|g,m=m+y},flush(){m>0&&h.writeByte(g)}}},s=function(a){const h=1<<a,m=(1<<a)+1;let g=a+1;const x=o();for(let D=0;D<h;D++)x.add(String.fromCharCode(D));x.add(String.fromCharCode(h)),x.add(String.fromCharCode(m));const y=vr(),w=r(y);w.write(h,g);let k=0,P=String.fromCharCode(n[k]);for(k+=1;k<n.length;){const D=String.fromCharCode(n[k]);k+=1,x.contains(P+D)?P=P+D:(w.write(x.indexOf(P),g),x.size()<4095&&(x.size()==1<<g&&(g+=1),x.add(P+D)),P=D)}return w.write(x.indexOf(P),g),w.write(m,g),w.flush(),y.toByteArray()},o=function(){const a={};let h=0;return{add(m){if(this.contains(m))throw new Error("dup key:"+m);a[m]=h,h+=1},size(){return h},indexOf(m){return a[m]},contains(m){return typeof a[m]<"u"}}};return{setPixel(a,h,m){n[h*i+a]=m},write(a){a.writeString("GIF87a"),a.writeShort(i),a.writeShort(i),a.writeByte(128),a.writeByte(0),a.writeByte(0),a.writeByte(on("0x"+t[1]+t[2])),a.writeByte(on("0x"+t[3]+t[4])),a.writeByte(on("0x"+t[5]+t[6])),a.writeByte(on("0x"+e[1]+e[2])),a.writeByte(on("0x"+e[3]+e[4])),a.writeByte(on("0x"+e[5]+e[6])),a.writeString(","),a.writeShort(0),a.writeShort(0),a.writeShort(i),a.writeShort(i),a.writeByte(0);const h=2,m=s(h);a.writeByte(h);let g=0;for(;m.length-g>255;)a.writeByte(255),a.writeBytes(m,g,255),g+=255;a.writeByte(m.length-g),a.writeBytes(m,g,m.length-g),a.writeByte(0),a.writeString(";")}}},Ds=function(i,t,e,n){const r=Ls(i,t,e);for(let m=0;m<i;m++)for(let g=0;g<i;g++)r.setPixel(g,m,n(g,m));const s=vr();r.write(s);const o=ia(),a=s.toByteArray();for(let m=0,g=a.length;m<g;m++)o.writeByte(a[m]);o.flush();let h="";return h+="data:image/gif;base64,",h+=o,h},ie={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},On={M:0,L:1,H:2,Q:3},Ue={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},jt={glog:function(i){if(i<1)throw new Error("glog("+i+")");return jt.LOG_TABLE[i]},gexp:function(i){for(;i<0;)i+=255;for(;i>=256;)i-=255;return jt.EXP_TABLE[i]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)};for(let i=0;i<8;i++)jt.EXP_TABLE[i]=1<<i;for(let i=8;i<256;i++)jt.EXP_TABLE[i]=jt.EXP_TABLE[i-4]^jt.EXP_TABLE[i-5]^jt.EXP_TABLE[i-6]^jt.EXP_TABLE[i-8];for(let i=0;i<255;i++)jt.LOG_TABLE[jt.EXP_TABLE[i]]=i;const Bt={PATTERN_POSITION_TABLE:[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],G15:1335,G18:7973,G15_MASK:21522,getBCHTypeInfo:function(i){let t=i<<10;for(;Bt.getBCHDigit(t)-Bt.getBCHDigit(Bt.G15)>=0;)t^=Bt.G15<<Bt.getBCHDigit(t)-Bt.getBCHDigit(Bt.G15);return(i<<10|t)^Bt.G15_MASK},getBCHTypeNumber:function(i){let t=i<<12;for(;Bt.getBCHDigit(t)-Bt.getBCHDigit(Bt.G18)>=0;)t^=Bt.G18<<Bt.getBCHDigit(t)-Bt.getBCHDigit(Bt.G18);return i<<12|t},getBCHDigit:function(i){let t=0;for(;i!=0;)t++,i>>>=1;return t},getPatternPosition:function(i){return Bt.PATTERN_POSITION_TABLE[i-1]},getMask:function(i,t,e){switch(i){case Ue.PATTERN000:return(t+e)%2==0;case Ue.PATTERN001:return t%2==0;case Ue.PATTERN010:return e%3==0;case Ue.PATTERN011:return(t+e)%3==0;case Ue.PATTERN100:return(Math.floor(t/2)+Math.floor(e/3))%2==0;case Ue.PATTERN101:return t*e%2+t*e%3==0;case Ue.PATTERN110:return(t*e%2+t*e%3)%2==0;case Ue.PATTERN111:return(t*e%3+(t+e)%2)%2==0;default:throw new Error("bad maskPattern:"+i)}},getErrorCorrectPolynomial:function(i){let t=new dn([1],0);for(let e=0;e<i;e++)t=t.multiply(new dn([1,jt.gexp(e)],0));return t},getLengthInBits:function(i,t){if(1<=t&&t<10)switch(i){case ie.MODE_NUMBER:return 10;case ie.MODE_ALPHA_NUM:return 9;case ie.MODE_8BIT_BYTE:return 8;case ie.MODE_KANJI:return 8;default:throw new Error("mode:"+i)}else if(t<27)switch(i){case ie.MODE_NUMBER:return 12;case ie.MODE_ALPHA_NUM:return 11;case ie.MODE_8BIT_BYTE:return 16;case ie.MODE_KANJI:return 10;default:throw new Error("mode:"+i)}else if(t<41)switch(i){case ie.MODE_NUMBER:return 14;case ie.MODE_ALPHA_NUM:return 13;case ie.MODE_8BIT_BYTE:return 16;case ie.MODE_KANJI:return 12;default:throw new Error("mode:"+i)}else throw new Error("type:"+t)},getLostPoint:function(i){const t=i.getModuleCount();let e=0;for(let s=0;s<t;s++)for(let o=0;o<t;o++){let a=0;const h=i.isDark(s,o);for(let m=-1;m<=1;m++)if(!(s+m<0||t<=s+m))for(let g=-1;g<=1;g++)o+g<0||t<=o+g||m==0&&g==0||h==i.isDark(s+m,o+g)&&a++;a>5&&(e+=3+a-5)}for(let s=0;s<t-1;s++)for(let o=0;o<t-1;o++){let a=0;i.isDark(s,o)&&a++,i.isDark(s+1,o)&&a++,i.isDark(s,o+1)&&a++,i.isDark(s+1,o+1)&&a++,(a==0||a==4)&&(e+=3)}for(let s=0;s<t;s++)for(let o=0;o<t-6;o++)i.isDark(s,o)&&!i.isDark(s,o+1)&&i.isDark(s,o+2)&&i.isDark(s,o+3)&&i.isDark(s,o+4)&&!i.isDark(s,o+5)&&i.isDark(s,o+6)&&(e+=40);for(let s=0;s<t;s++)for(let o=0;o<t-6;o++)i.isDark(o,s)&&!i.isDark(o+1,s)&&i.isDark(o+2,s)&&i.isDark(o+3,s)&&i.isDark(o+4,s)&&!i.isDark(o+5,s)&&i.isDark(o+6,s)&&(e+=40);let n=0;for(let s=0;s<t;s++)for(let o=0;o<t;o++)i.isDark(o,s)&&n++;const r=Math.abs(100*n/t/t-50)/5;return e+=r*10,e}};class dn{num;constructor(t,e){if(t.length==null)throw new Error(t.length+"/"+e);let n=0;for(;n<t.length&&t[n]==0;)n++;this.num=new Array(t.length-n+e);for(let r=0;r<t.length-n;r++)this.num[r]=t[r+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 r=0;r<t.getLength();r++)e[n+r]^=jt.gexp(jt.glog(this.get(n))+jt.glog(t.get(r)));return new dn(e,0)}mod(t){if(this.getLength()-t.getLength()<0)return this;const e=jt.glog(this.get(0))-jt.glog(t.get(0)),n=new Array(this.getLength());for(let r=0;r<this.getLength();r++)n[r]=this.get(r);for(let r=0;r<t.getLength();r++)n[r]^=jt.gexp(jt.glog(t.get(r))+e);return new dn(n,0).mod(t)}}class Se{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=Se.getRsBlockTable(t,e);if(n==null)throw new Error("bad rs block @ typeNumber:"+t+"/errorCorrectLevel:"+e);const r=n.length/3,s=[];for(let o=0;o<r;o++){const a=n[o*3+0],h=n[o*3+1],m=n[o*3+2];for(let g=0;g<a;g++)s.push(new Se(h,m))}return s}static getRsBlockTable(t,e){switch(e){case On.L:return Se.RS_BLOCK_TABLE[(t-1)*4+0];case On.M:return Se.RS_BLOCK_TABLE[(t-1)*4+1];case On.Q:return Se.RS_BLOCK_TABLE[(t-1)*4+2];case On.H:return Se.RS_BLOCK_TABLE[(t-1)*4+3];default:return}}}class Rs{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 Ih{mode;data;constructor(t){this.mode=ie.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 Ge{static PAD0=236;static PAD1=17;typeNumber;errorCorrectLevel;modules;moduleCount;dataCache;dataList;constructor(t,e){this.typeNumber=t,this.errorCorrectLevel=On[e],this.modules=[],this.moduleCount=0,this.dataCache=null,this.dataList=[]}addData(t){const e=new Ih(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=Se.getRSBlocks(t,this.errorCorrectLevel),n=new Rs;let r=0;for(let s=0;s<e.length;s++)r+=e[s].dataCount;for(let s=0;s<this.dataList.length;s++){const o=this.dataList[s];n.put(o.mode,4),n.put(o.getLength(),Bt.getLengthInBits(o.mode,t)),o.write(n)}if(n.getLengthInBits()<=r*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 r=0;r<this.moduleCount;r++)this.modules[n][r]=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=Ge.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 r=-1;r<=7;r++)e+r<=-1||this.moduleCount<=e+r||(0<=n&&n<=6&&(r==0||r==6)||0<=r&&r<=6&&(n==0||n==6)||2<=n&&n<=4&&2<=r&&r<=4?this.modules[t+n][e+r]=!0:this.modules[t+n][e+r]=!1)}getBestMaskPattern(){let t=0,e=0;for(let n=0;n<8;n++){this.makeImpl(!0,n);const r=Bt.getLostPoint(this);(n==0||t>r)&&(t=r,e=n)}return e}createMovieClip(t,e,n){const r=t.createEmptyMovieClip(e,n),s=1;this.make();for(let o=0;o<this.modules.length;o++){const a=o*s;for(let h=0;h<this.modules[o].length;h++){const m=h*s;this.modules[o][h]&&(r.beginFill(0,100),r.moveTo(m,a),r.lineTo(m+s,a),r.lineTo(m+s,a+s),r.lineTo(m,a+s),r.endFill())}}return r}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=Bt.getPatternPosition(this.typeNumber);for(let e=0;e<t.length;e++)for(let n=0;n<t.length;n++){const r=t[e],s=t[n];if(this.modules[r][s]==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[r+o][s+a]=!0:this.modules[r+o][s+a]=!1}}setupTypeNumber(t){const e=Bt.getBCHTypeNumber(this.typeNumber);for(let n=0;n<18;n++){const r=!t&&(e>>n&1)==1;this.modules[Math.floor(n/3)][n%3+this.moduleCount-8-3]=r}for(let n=0;n<18;n++){const r=!t&&(e>>n&1)==1;this.modules[n%3+this.moduleCount-8-3][Math.floor(n/3)]=r}}setupTypeInfo(t,e){const n=this.errorCorrectLevel<<3|e,r=Bt.getBCHTypeInfo(n);for(let s=0;s<15;s++){const o=!t&&(r>>s&1)==1;s<6?this.modules[s][8]=o:s<8?this.modules[s+1][8]=o:this.modules[this.moduleCount-15+s][8]=o}for(let s=0;s<15;s++){const o=!t&&(r>>s&1)==1;s<8?this.modules[8][this.moduleCount-s-1]=o:s<9?this.modules[8][15-s-1+1]=o:this.modules[8][15-s-1]=o}this.modules[this.moduleCount-8][8]=!t}mapData(t,e){let n=-1,r=this.moduleCount-1,s=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[r][a-h]==null){let m=!1;o<t.length&&(m=(t[o]>>>s&1)==1),Bt.getMask(e,r,a-h)&&(m=!m),this.modules[r][a-h]=m,s--,s==-1&&(o++,s=7)}if(r+=n,r<0||this.moduleCount<=r){r-=n,n=-n;break}}}static createData(t,e,n){const r=Se.getRSBlocks(t,e),s=new Rs;for(let a=0;a<n.length;a++){const h=n[a];s.put(h.mode,4),s.put(h.getLength(),Bt.getLengthInBits(h.mode,t)),h.write(s)}let o=0;for(let a=0;a<r.length;a++)o+=r[a].dataCount;if(s.getLengthInBits()>o*8)throw new Error("code length overflow. ("+s.getLengthInBits()+">"+o*8+")");for(s.getLengthInBits()+4<=o*8&&s.put(0,4);s.getLengthInBits()%8!=0;)s.putBit(!1);for(;!(s.getLengthInBits()>=o*8||(s.put(Ge.PAD0,8),s.getLengthInBits()>=o*8));)s.put(Ge.PAD1,8);return Ge.createBytes(s,r)}static createBytes(t,e){let n=0,r=0,s=0;const o=new Array(e.length),a=new Array(e.length);for(let x=0;x<e.length;x++){const y=e[x].dataCount,w=e[x].totalCount-y;r=Math.max(r,y),s=Math.max(s,w),o[x]=new Array(y);for(let N=0;N<o[x].length;N++)o[x][N]=255&t.buffer[N+n];n+=y;const k=Bt.getErrorCorrectPolynomial(w),D=new dn(o[x],k.getLength()-1).mod(k);a[x]=new Array(k.getLength()-1);for(let N=0;N<a[x].length;N++){const R=N+D.getLength()-a[x].length;a[x][N]=R>=0?D.get(R):0}}let h=0;for(let x=0;x<e.length;x++)h+=e[x].totalCount;const m=new Array(h);let g=0;for(let x=0;x<r;x++)for(let y=0;y<e.length;y++)x<o[y].length&&(m[g++]=o[y][x]);for(let x=0;x<s;x++)for(let y=0;y<e.length;y++)x<a[y].length&&(m[g++]=a[y][x]);return m}}const Os=Math.ceil,Nn=Math.floor,Ns=Math.round;function Lh(i,t){const e=mr(i),n=t?.ecc||"H",r=t?.size||256,s=-1,o=t?.padding||0,a=t?.color||"#000000",h=t?.background||"#ffffff",m=new Ge(s,n);m.addData(e),m.make();const g=m.getModuleCount(),x=(r-o*2)/g,y=o,w=r-o;return Ds(r,a,h,function(k,P){if(y<=k&&k<w&&y<=P&&P<w){const D=Nn((k-y)/x),N=Nn((P-y)/x);return m.isDark(N,D)?0:1}else return 1})}function Dh(i,t){const e=t.x||0,n=t.y||0,r=mr(i),s=t.ctx,o=t.ecc||"H",a=typeof t.size=="number"?Nn(t.size):256,h=t.padding||0,m=-1,g=t.color||"#000000",x=t.background||"#ffffff",y=new Ge(m,o);y.addData(r),y.make();const w=y.getModuleCount(),k=(a-h*2)/w;s.fillStyle=x,s.fillRect(e,n,a,a);for(let P=0;P<w;P++)for(let D=0;D<w;D++){const N=Os((D+1)*k)-Nn(D*k),R=Os((P+1)*k)-Nn(P*k);s.fillStyle=y.isDark(P,D)?g:x,s.fillRect(e+Ns(D*k)+h,n+Ns(P*k)+h,N,R)}}function or(){let i=null;if(window.ActiveXObject){const t=["Microsoft.XMLHTTP","MSXML6.XMLHTTP","MSXML5.XMLHTTP","MSXML4.XMLHTTP","MSXML3.XMLHTTP","MSXML2.XMLHTTP","MSXML.XMLHTTP"];for(let e=0;e<t.length;e++)try{i=new window.ActiveXObject(t[e]);break}catch{continue}}else i=new XMLHttpRequest;return i}function Rh(i){if(!i.action)return{url:"",data:"",boundary:""};const t=i.method.toLowerCase()==="get",e=i.method.toLowerCase()==="post";let n=i.action,r="";const s="---------------------------"+Date.now().toString(16);if(window.FormData)r=new FormData(i),t&&(n=ri(n,rr(r)));else if(t){let o="";for(let a=0;a<i.elements.length;a++){const h=i.elements[a];if(!h.hasAttribute("name"))continue;const m=h.nodeName.toUpperCase()==="INPUT"?h.getAttribute("type")?.toUpperCase():"TEXT";if(m==="FILE")for(let g=0,x=h.files?.length??0;g<x;o+="&"+encodeURIComponent(h.name)+"="+encodeURIComponent(h.files?.[g++].name??""));else(m!=="RADIO"&&m!=="CHECKBOX"||h.checked)&&(o+="&"+encodeURIComponent(h.name)+"="+encodeURIComponent(h.value))}n=ri(n,o)}else if(e){const o=[];if(i.enctype==="application/x-www-form-urlencoded"){for(let a=0;a<i.elements.length;a++){const h=i.elements[a];h.hasAttribute("name")&&o.push(encodeURIComponent(h.name)+"="+encodeURIComponent(h.value))}r=o.join("&")}else if(i.enctype==="text/plain"){for(let a=0;a<i.elements.length;a++){const h=i.elements[a];h.hasAttribute("name")&&o.push(h.name+"="+h.value)}r=o.join(`\r
|
|
30
|
-
|
|
31
|
-
|
|
18
|
+
})`}static encodeHTML(t,e="encode"){const i={"&":"&","<":"<",">":">",""":'"',"'":"'"};for(const n in i)Object.prototype.hasOwnProperty.call(i,n)&&(t=t.replace(new RegExp(e=="decode"?n:i[n],"g"),e=="decode"?i[n]:n));return t}static getInnerText=t=>{let e=t.innerText;if(!e){const i=t.querySelector("slot")?.assignedNodes()||[];let n=0;for(;!e&&n<=i.length-1;)"innerText"in i[n]&&(e=i[n].innerText),n++}return e};static copyToClipboard=t=>new Promise((e,i)=>{if(navigator.clipboard)navigator.clipboard.writeText(t).then(e).catch(i);else{const n=document.createElement("textarea");n.value=t,n.style.opacity="0",n.style.top="0",n.style.left="0",n.style.position="fixed",document.body.appendChild(n),n.focus(),n.select();try{document.execCommand("copy")?e():i()}catch(r){i(r)}document.body.removeChild(n)}});static scrollTo=(t,e)=>window.scrollTo(t,e);static setScrollRestoration(t){try{window.history.scrollRestoration=t}catch{}}static getLocation(){return new Promise((t,e)=>{navigator.geolocation?navigator.geolocation.getCurrentPosition(i=>{t(i.coords)}):e("Geolocation is not supported by this browser")})}static vibrate(t=200){"vibrate"in navigator?window.navigator.vibrate(t):console.error("Your device is not support vibrate on this browser.")}static getSelectedText=()=>window.getSelection()?.toString();static isElementFocus=t=>t===document.activeElement;static isTabInView=()=>!document.hidden;static navigateBack=()=>history.back();static navigateBack2=()=>history.go(-1);static iframePostMessage(t,e="http://test.com/localstorage.html"){const i=document.createElement("iframe");i.src=e,document.body.append(i),setTimeout(function(){i.contentWindow?.postMessage(t,e)},4e3),setTimeout(function(){i.remove()},6e3)}static getTextWidth=(t,e=12,i=400)=>{const n=document.createElement("span");n.style.visibility="hidden",n.style.padding="0",n.style.whiteSpace="nowrap",n.style.overflow="visible",n.style.fontSize=e>12?e+"px":"12px",n.style.fontWeight=i.toString(),n.innerText=t,document.body.appendChild(n);const r=n.offsetWidth;return document.body.removeChild(n),r};static getFixedWidthText=(t,e,i=12,n=400,r=!0)=>{let a="";if(!t||e<i)return a;const o=t.split(""),h="...";let c=r?A.getTextWidth(h,i,n):0;for(let f=0,m=o.length;f<m;f++)if(c+=A.getTextWidth(o[f],i,n),c>e){r&&(a+=h);break}else a+=o[f];return a}}function er(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}var as={exports:{}};/*! Hammer.JS - v2.0.7 - 2016-04-22
|
|
19
|
+
* http://hammerjs.github.io/
|
|
20
|
+
*
|
|
21
|
+
* Copyright (c) 2016 Jorik Tangelder;
|
|
22
|
+
* Licensed under the MIT license */(function(s){(function(t,e,i,n){var r=["","webkit","Moz","MS","ms","o"],a=e.createElement("div"),o="function",h=Math.round,c=Math.abs,f=Date.now;function m(l,u,g){return setTimeout(I(l,g),u)}function w(l,u,g){return Array.isArray(l)?(p(l,g[u],g),!0):!1}function p(l,u,g){var v;if(l)if(l.forEach)l.forEach(u,g);else if(l.length!==n)for(v=0;v<l.length;)u.call(g,l[v],v,l),v++;else for(v in l)l.hasOwnProperty(v)&&u.call(g,l[v],v,l)}function y(l,u,g){var v="DEPRECATED METHOD: "+u+`
|
|
23
|
+
`+g+` AT
|
|
24
|
+
`;return function(){var S=new Error("get-stack-trace"),M=S&&S.stack?S.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",R=t.console&&(t.console.warn||t.console.log);return R&&R.call(t.console,v,M),l.apply(this,arguments)}}var x;typeof Object.assign!="function"?x=function(u){if(u===n||u===null)throw new TypeError("Cannot convert undefined or null to object");for(var g=Object(u),v=1;v<arguments.length;v++){var S=arguments[v];if(S!==n&&S!==null)for(var M in S)S.hasOwnProperty(M)&&(g[M]=S[M])}return g}:x=Object.assign;var b=y(function(u,g,v){for(var S=Object.keys(g),M=0;M<S.length;)(!v||v&&u[S[M]]===n)&&(u[S[M]]=g[S[M]]),M++;return u},"extend","Use `assign`."),C=y(function(u,g){return b(u,g,!0)},"merge","Use `assign`.");function _(l,u,g){var v=u.prototype,S;S=l.prototype=Object.create(v),S.constructor=l,S._super=v,g&&x(S,g)}function I(l,u){return function(){return l.apply(u,arguments)}}function E(l,u){return typeof l==o?l.apply(u&&u[0]||n,u):l}function L(l,u){return l===n?u:l}function O(l,u,g){p(j(u),function(v){l.addEventListener(v,g,!1)})}function B(l,u,g){p(j(u),function(v){l.removeEventListener(v,g,!1)})}function H(l,u){for(;l;){if(l==u)return!0;l=l.parentNode}return!1}function z(l,u){return l.indexOf(u)>-1}function j(l){return l.trim().split(/\s+/g)}function it(l,u,g){if(l.indexOf&&!g)return l.indexOf(u);for(var v=0;v<l.length;){if(g&&l[v][g]==u||!g&&l[v]===u)return v;v++}return-1}function ht(l){return Array.prototype.slice.call(l,0)}function At(l,u,g){for(var v=[],S=[],M=0;M<l.length;){var R=u?l[M][u]:l[M];it(S,R)<0&&v.push(l[M]),S[M]=R,M++}return g&&(u?v=v.sort(function(q,Z){return q[u]>Z[u]}):v=v.sort()),v}function bt(l,u){for(var g,v,S=u[0].toUpperCase()+u.slice(1),M=0;M<r.length;){if(g=r[M],v=g?g+S:u,v in l)return v;M++}return n}var Xt=1;function lt(){return Xt++}function Lt(l){var u=l.ownerDocument||l;return u.defaultView||u.parentWindow||t}var k=/mobile|tablet|ip(ad|hone|od)|android/i,D="ontouchstart"in t,P=bt(t,"PointerEvent")!==n,N=D&&k.test(navigator.userAgent),F="touch",nt="pen",kt="mouse",Go="kinect",Bo=25,J=1,Rt=2,V=4,tt=8,Me=1,le=2,ue=4,fe=8,de=16,ut=le|ue,Ot=fe|de,Vs=ut|Ot,Xs=["x","y"],De=["clientX","clientY"];function rt(l,u){var g=this;this.manager=l,this.callback=u,this.element=l.element,this.target=l.options.inputTarget,this.domHandler=function(v){E(l.options.enable,[l])&&g.handler(v)},this.init()}rt.prototype={handler:function(){},init:function(){this.evEl&&O(this.element,this.evEl,this.domHandler),this.evTarget&&O(this.target,this.evTarget,this.domHandler),this.evWin&&O(Lt(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&B(this.element,this.evEl,this.domHandler),this.evTarget&&B(this.target,this.evTarget,this.domHandler),this.evWin&&B(Lt(this.element),this.evWin,this.domHandler)}};function Uo(l){var u,g=l.options.inputClass;return g?u=g:P?u=Ti:N?u=Re:D?u=_i:u=Le,new u(l,zo)}function zo(l,u,g){var v=g.pointers.length,S=g.changedPointers.length,M=u&J&&v-S===0,R=u&(V|tt)&&v-S===0;g.isFirst=!!M,g.isFinal=!!R,M&&(l.session={}),g.eventType=u,Vo(l,g),l.emit("hammer.input",g),l.recognize(g),l.session.prevInput=g}function Vo(l,u){var g=l.session,v=u.pointers,S=v.length;g.firstInput||(g.firstInput=Ws(u)),S>1&&!g.firstMultiple?g.firstMultiple=Ws(u):S===1&&(g.firstMultiple=!1);var M=g.firstInput,R=g.firstMultiple,W=R?R.center:M.center,q=u.center=Ys(v);u.timeStamp=f(),u.deltaTime=u.timeStamp-M.timeStamp,u.angle=Ci(W,q),u.distance=Ae(W,q),Xo(g,u),u.offsetDirection=js(u.deltaX,u.deltaY);var Z=Hs(u.deltaTime,u.deltaX,u.deltaY);u.overallVelocityX=Z.x,u.overallVelocityY=Z.y,u.overallVelocity=c(Z.x)>c(Z.y)?Z.x:Z.y,u.scale=R?Ho(R.pointers,v):1,u.rotation=R?Yo(R.pointers,v):0,u.maxPointers=g.prevInput?u.pointers.length>g.prevInput.maxPointers?u.pointers.length:g.prevInput.maxPointers:u.pointers.length,Wo(g,u);var dt=l.element;H(u.srcEvent.target,dt)&&(dt=u.srcEvent.target),u.target=dt}function Xo(l,u){var g=u.center,v=l.offsetDelta||{},S=l.prevDelta||{},M=l.prevInput||{};(u.eventType===J||M.eventType===V)&&(S=l.prevDelta={x:M.deltaX||0,y:M.deltaY||0},v=l.offsetDelta={x:g.x,y:g.y}),u.deltaX=S.x+(g.x-v.x),u.deltaY=S.y+(g.y-v.y)}function Wo(l,u){var g=l.lastInterval||u,v=u.timeStamp-g.timeStamp,S,M,R,W;if(u.eventType!=tt&&(v>Bo||g.velocity===n)){var q=u.deltaX-g.deltaX,Z=u.deltaY-g.deltaY,dt=Hs(v,q,Z);M=dt.x,R=dt.y,S=c(dt.x)>c(dt.y)?dt.x:dt.y,W=js(q,Z),l.lastInterval=u}else S=g.velocity,M=g.velocityX,R=g.velocityY,W=g.direction;u.velocity=S,u.velocityX=M,u.velocityY=R,u.direction=W}function Ws(l){for(var u=[],g=0;g<l.pointers.length;)u[g]={clientX:h(l.pointers[g].clientX),clientY:h(l.pointers[g].clientY)},g++;return{timeStamp:f(),pointers:u,center:Ys(u),deltaX:l.deltaX,deltaY:l.deltaY}}function Ys(l){var u=l.length;if(u===1)return{x:h(l[0].clientX),y:h(l[0].clientY)};for(var g=0,v=0,S=0;S<u;)g+=l[S].clientX,v+=l[S].clientY,S++;return{x:h(g/u),y:h(v/u)}}function Hs(l,u,g){return{x:u/l||0,y:g/l||0}}function js(l,u){return l===u?Me:c(l)>=c(u)?l<0?le:ue:u<0?fe:de}function Ae(l,u,g){g||(g=Xs);var v=u[g[0]]-l[g[0]],S=u[g[1]]-l[g[1]];return Math.sqrt(v*v+S*S)}function Ci(l,u,g){g||(g=Xs);var v=u[g[0]]-l[g[0]],S=u[g[1]]-l[g[1]];return Math.atan2(S,v)*180/Math.PI}function Yo(l,u){return Ci(u[1],u[0],De)+Ci(l[1],l[0],De)}function Ho(l,u){return Ae(u[0],u[1],De)/Ae(l[0],l[1],De)}var jo={mousedown:J,mousemove:Rt,mouseup:V},qo="mousedown",$o="mousemove mouseup";function Le(){this.evEl=qo,this.evWin=$o,this.pressed=!1,rt.apply(this,arguments)}_(Le,rt,{handler:function(u){var g=jo[u.type];g&J&&u.button===0&&(this.pressed=!0),g&Rt&&u.which!==1&&(g=V),this.pressed&&(g&V&&(this.pressed=!1),this.callback(this.manager,g,{pointers:[u],changedPointers:[u],pointerType:kt,srcEvent:u}))}});var Jo={pointerdown:J,pointermove:Rt,pointerup:V,pointercancel:tt,pointerout:tt},Zo={2:F,3:nt,4:kt,5:Go},qs="pointerdown",$s="pointermove pointerup pointercancel";t.MSPointerEvent&&!t.PointerEvent&&(qs="MSPointerDown",$s="MSPointerMove MSPointerUp MSPointerCancel");function Ti(){this.evEl=qs,this.evWin=$s,rt.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}_(Ti,rt,{handler:function(u){var g=this.store,v=!1,S=u.type.toLowerCase().replace("ms",""),M=Jo[S],R=Zo[u.pointerType]||u.pointerType,W=R==F,q=it(g,u.pointerId,"pointerId");M&J&&(u.button===0||W)?q<0&&(g.push(u),q=g.length-1):M&(V|tt)&&(v=!0),!(q<0)&&(g[q]=u,this.callback(this.manager,M,{pointers:g,changedPointers:[u],pointerType:R,srcEvent:u}),v&&g.splice(q,1))}});var Ko={touchstart:J,touchmove:Rt,touchend:V,touchcancel:tt},Qo="touchstart",th="touchstart touchmove touchend touchcancel";function Js(){this.evTarget=Qo,this.evWin=th,this.started=!1,rt.apply(this,arguments)}_(Js,rt,{handler:function(u){var g=Ko[u.type];if(g===J&&(this.started=!0),!!this.started){var v=eh.call(this,u,g);g&(V|tt)&&v[0].length-v[1].length===0&&(this.started=!1),this.callback(this.manager,g,{pointers:v[0],changedPointers:v[1],pointerType:F,srcEvent:u})}}});function eh(l,u){var g=ht(l.touches),v=ht(l.changedTouches);return u&(V|tt)&&(g=At(g.concat(v),"identifier",!0)),[g,v]}var ih={touchstart:J,touchmove:Rt,touchend:V,touchcancel:tt},sh="touchstart touchmove touchend touchcancel";function Re(){this.evTarget=sh,this.targetIds={},rt.apply(this,arguments)}_(Re,rt,{handler:function(u){var g=ih[u.type],v=nh.call(this,u,g);v&&this.callback(this.manager,g,{pointers:v[0],changedPointers:v[1],pointerType:F,srcEvent:u})}});function nh(l,u){var g=ht(l.touches),v=this.targetIds;if(u&(J|Rt)&&g.length===1)return v[g[0].identifier]=!0,[g,g];var S,M,R=ht(l.changedTouches),W=[],q=this.target;if(M=g.filter(function(Z){return H(Z.target,q)}),u===J)for(S=0;S<M.length;)v[M[S].identifier]=!0,S++;for(S=0;S<R.length;)v[R[S].identifier]&&W.push(R[S]),u&(V|tt)&&delete v[R[S].identifier],S++;if(W.length)return[At(M.concat(W),"identifier",!0),W]}var rh=2500,Zs=25;function _i(){rt.apply(this,arguments);var l=I(this.handler,this);this.touch=new Re(this.manager,l),this.mouse=new Le(this.manager,l),this.primaryTouch=null,this.lastTouches=[]}_(_i,rt,{handler:function(u,g,v){var S=v.pointerType==F,M=v.pointerType==kt;if(!(M&&v.sourceCapabilities&&v.sourceCapabilities.firesTouchEvents)){if(S)ah.call(this,g,v);else if(M&&oh.call(this,v))return;this.callback(u,g,v)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});function ah(l,u){l&J?(this.primaryTouch=u.changedPointers[0].identifier,Ks.call(this,u)):l&(V|tt)&&Ks.call(this,u)}function Ks(l){var u=l.changedPointers[0];if(u.identifier===this.primaryTouch){var g={x:u.clientX,y:u.clientY};this.lastTouches.push(g);var v=this.lastTouches,S=function(){var M=v.indexOf(g);M>-1&&v.splice(M,1)};setTimeout(S,rh)}}function oh(l){for(var u=l.srcEvent.clientX,g=l.srcEvent.clientY,v=0;v<this.lastTouches.length;v++){var S=this.lastTouches[v],M=Math.abs(u-S.x),R=Math.abs(g-S.y);if(M<=Zs&&R<=Zs)return!0}return!1}var Qs=bt(a.style,"touchAction"),tn=Qs!==n,en="compute",sn="auto",Si="manipulation",Nt="none",me="pan-x",ge="pan-y",Oe=ch();function Pi(l,u){this.manager=l,this.set(u)}Pi.prototype={set:function(l){l==en&&(l=this.compute()),tn&&this.manager.element.style&&Oe[l]&&(this.manager.element.style[Qs]=l),this.actions=l.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var l=[];return p(this.manager.recognizers,function(u){E(u.options.enable,[u])&&(l=l.concat(u.getTouchAction()))}),hh(l.join(" "))},preventDefaults:function(l){var u=l.srcEvent,g=l.offsetDirection;if(this.manager.session.prevented){u.preventDefault();return}var v=this.actions,S=z(v,Nt)&&!Oe[Nt],M=z(v,ge)&&!Oe[ge],R=z(v,me)&&!Oe[me];if(S){var W=l.pointers.length===1,q=l.distance<2,Z=l.deltaTime<250;if(W&&q&&Z)return}if(!(R&&M)&&(S||M&&g&ut||R&&g&Ot))return this.preventSrc(u)},preventSrc:function(l){this.manager.session.prevented=!0,l.preventDefault()}};function hh(l){if(z(l,Nt))return Nt;var u=z(l,me),g=z(l,ge);return u&&g?Nt:u||g?u?me:ge:z(l,Si)?Si:sn}function ch(){if(!tn)return!1;var l={},u=t.CSS&&t.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(g){l[g]=u?t.CSS.supports("touch-action",g):!0}),l}var Ne=1,at=2,Wt=4,It=8,xt=It,pe=16,ft=32;function Ct(l){this.options=x({},this.defaults,l||{}),this.id=lt(),this.manager=null,this.options.enable=L(this.options.enable,!0),this.state=Ne,this.simultaneous={},this.requireFail=[]}Ct.prototype={defaults:{},set:function(l){return x(this.options,l),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(l){if(w(l,"recognizeWith",this))return this;var u=this.simultaneous;return l=Fe(l,this),u[l.id]||(u[l.id]=l,l.recognizeWith(this)),this},dropRecognizeWith:function(l){return w(l,"dropRecognizeWith",this)?this:(l=Fe(l,this),delete this.simultaneous[l.id],this)},requireFailure:function(l){if(w(l,"requireFailure",this))return this;var u=this.requireFail;return l=Fe(l,this),it(u,l)===-1&&(u.push(l),l.requireFailure(this)),this},dropRequireFailure:function(l){if(w(l,"dropRequireFailure",this))return this;l=Fe(l,this);var u=it(this.requireFail,l);return u>-1&&this.requireFail.splice(u,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(l){return!!this.simultaneous[l.id]},emit:function(l){var u=this,g=this.state;function v(S){u.manager.emit(S,l)}g<It&&v(u.options.event+nn(g)),v(u.options.event),l.additionalEvent&&v(l.additionalEvent),g>=It&&v(u.options.event+nn(g))},tryEmit:function(l){if(this.canEmit())return this.emit(l);this.state=ft},canEmit:function(){for(var l=0;l<this.requireFail.length;){if(!(this.requireFail[l].state&(ft|Ne)))return!1;l++}return!0},recognize:function(l){var u=x({},l);if(!E(this.options.enable,[this,u])){this.reset(),this.state=ft;return}this.state&(xt|pe|ft)&&(this.state=Ne),this.state=this.process(u),this.state&(at|Wt|It|pe)&&this.tryEmit(u)},process:function(l){},getTouchAction:function(){},reset:function(){}};function nn(l){return l&pe?"cancel":l&It?"end":l&Wt?"move":l&at?"start":""}function rn(l){return l==de?"down":l==fe?"up":l==le?"left":l==ue?"right":""}function Fe(l,u){var g=u.manager;return g?g.get(l):l}function ct(){Ct.apply(this,arguments)}_(ct,Ct,{defaults:{pointers:1},attrTest:function(l){var u=this.options.pointers;return u===0||l.pointers.length===u},process:function(l){var u=this.state,g=l.eventType,v=u&(at|Wt),S=this.attrTest(l);return v&&(g&tt||!S)?u|pe:v||S?g&V?u|It:u&at?u|Wt:at:ft}});function Ge(){ct.apply(this,arguments),this.pX=null,this.pY=null}_(Ge,ct,{defaults:{event:"pan",threshold:10,pointers:1,direction:Vs},getTouchAction:function(){var l=this.options.direction,u=[];return l&ut&&u.push(ge),l&Ot&&u.push(me),u},directionTest:function(l){var u=this.options,g=!0,v=l.distance,S=l.direction,M=l.deltaX,R=l.deltaY;return S&u.direction||(u.direction&ut?(S=M===0?Me:M<0?le:ue,g=M!=this.pX,v=Math.abs(l.deltaX)):(S=R===0?Me:R<0?fe:de,g=R!=this.pY,v=Math.abs(l.deltaY))),l.direction=S,g&&v>u.threshold&&S&u.direction},attrTest:function(l){return ct.prototype.attrTest.call(this,l)&&(this.state&at||!(this.state&at)&&this.directionTest(l))},emit:function(l){this.pX=l.deltaX,this.pY=l.deltaY;var u=rn(l.direction);u&&(l.additionalEvent=this.options.event+u),this._super.emit.call(this,l)}});function Ei(){ct.apply(this,arguments)}_(Ei,ct,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[Nt]},attrTest:function(l){return this._super.attrTest.call(this,l)&&(Math.abs(l.scale-1)>this.options.threshold||this.state&at)},emit:function(l){if(l.scale!==1){var u=l.scale<1?"in":"out";l.additionalEvent=this.options.event+u}this._super.emit.call(this,l)}});function ki(){Ct.apply(this,arguments),this._timer=null,this._input=null}_(ki,Ct,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[sn]},process:function(l){var u=this.options,g=l.pointers.length===u.pointers,v=l.distance<u.threshold,S=l.deltaTime>u.time;if(this._input=l,!v||!g||l.eventType&(V|tt)&&!S)this.reset();else if(l.eventType&J)this.reset(),this._timer=m(function(){this.state=xt,this.tryEmit()},u.time,this);else if(l.eventType&V)return xt;return ft},reset:function(){clearTimeout(this._timer)},emit:function(l){this.state===xt&&(l&&l.eventType&V?this.manager.emit(this.options.event+"up",l):(this._input.timeStamp=f(),this.manager.emit(this.options.event,this._input)))}});function Ii(){ct.apply(this,arguments)}_(Ii,ct,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[Nt]},attrTest:function(l){return this._super.attrTest.call(this,l)&&(Math.abs(l.rotation)>this.options.threshold||this.state&at)}});function Mi(){ct.apply(this,arguments)}_(Mi,ct,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:ut|Ot,pointers:1},getTouchAction:function(){return Ge.prototype.getTouchAction.call(this)},attrTest:function(l){var u=this.options.direction,g;return u&(ut|Ot)?g=l.overallVelocity:u&ut?g=l.overallVelocityX:u&Ot&&(g=l.overallVelocityY),this._super.attrTest.call(this,l)&&u&l.offsetDirection&&l.distance>this.options.threshold&&l.maxPointers==this.options.pointers&&c(g)>this.options.velocity&&l.eventType&V},emit:function(l){var u=rn(l.offsetDirection);u&&this.manager.emit(this.options.event+u,l),this.manager.emit(this.options.event,l)}});function Be(){Ct.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}_(Be,Ct,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[Si]},process:function(l){var u=this.options,g=l.pointers.length===u.pointers,v=l.distance<u.threshold,S=l.deltaTime<u.time;if(this.reset(),l.eventType&J&&this.count===0)return this.failTimeout();if(v&&S&&g){if(l.eventType!=V)return this.failTimeout();var M=this.pTime?l.timeStamp-this.pTime<u.interval:!0,R=!this.pCenter||Ae(this.pCenter,l.center)<u.posThreshold;this.pTime=l.timeStamp,this.pCenter=l.center,!R||!M?this.count=1:this.count+=1,this._input=l;var W=this.count%u.taps;if(W===0)return this.hasRequireFailures()?(this._timer=m(function(){this.state=xt,this.tryEmit()},u.interval,this),at):xt}return ft},failTimeout:function(){return this._timer=m(function(){this.state=ft},this.options.interval,this),ft},reset:function(){clearTimeout(this._timer)},emit:function(){this.state==xt&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}});function Tt(l,u){return u=u||{},u.recognizers=L(u.recognizers,Tt.defaults.preset),new Di(l,u)}Tt.VERSION="2.0.7",Tt.defaults={domEvents:!1,touchAction:en,enable:!0,inputTarget:null,inputClass:null,preset:[[Ii,{enable:!1}],[Ei,{enable:!1},["rotate"]],[Mi,{direction:ut}],[Ge,{direction:ut},["swipe"]],[Be],[Be,{event:"doubletap",taps:2},["tap"]],[ki]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};var lh=1,an=2;function Di(l,u){this.options=x({},Tt.defaults,u||{}),this.options.inputTarget=this.options.inputTarget||l,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=l,this.input=Uo(this),this.touchAction=new Pi(this,this.options.touchAction),on(this,!0),p(this.options.recognizers,function(g){var v=this.add(new g[0](g[1]));g[2]&&v.recognizeWith(g[2]),g[3]&&v.requireFailure(g[3])},this)}Di.prototype={set:function(l){return x(this.options,l),l.touchAction&&this.touchAction.update(),l.inputTarget&&(this.input.destroy(),this.input.target=l.inputTarget,this.input.init()),this},stop:function(l){this.session.stopped=l?an:lh},recognize:function(l){var u=this.session;if(!u.stopped){this.touchAction.preventDefaults(l);var g,v=this.recognizers,S=u.curRecognizer;(!S||S&&S.state&xt)&&(S=u.curRecognizer=null);for(var M=0;M<v.length;)g=v[M],u.stopped!==an&&(!S||g==S||g.canRecognizeWith(S))?g.recognize(l):g.reset(),!S&&g.state&(at|Wt|It)&&(S=u.curRecognizer=g),M++}},get:function(l){if(l instanceof Ct)return l;for(var u=this.recognizers,g=0;g<u.length;g++)if(u[g].options.event==l)return u[g];return null},add:function(l){if(w(l,"add",this))return this;var u=this.get(l.options.event);return u&&this.remove(u),this.recognizers.push(l),l.manager=this,this.touchAction.update(),l},remove:function(l){if(w(l,"remove",this))return this;if(l=this.get(l),l){var u=this.recognizers,g=it(u,l);g!==-1&&(u.splice(g,1),this.touchAction.update())}return this},on:function(l,u){if(l!==n&&u!==n){var g=this.handlers;return p(j(l),function(v){g[v]=g[v]||[],g[v].push(u)}),this}},off:function(l,u){if(l!==n){var g=this.handlers;return p(j(l),function(v){u?g[v]&&g[v].splice(it(g[v],u),1):delete g[v]}),this}},emit:function(l,u){this.options.domEvents&&uh(l,u);var g=this.handlers[l]&&this.handlers[l].slice();if(!(!g||!g.length)){u.type=l,u.preventDefault=function(){u.srcEvent.preventDefault()};for(var v=0;v<g.length;)g[v](u),v++}},destroy:function(){this.element&&on(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}};function on(l,u){var g=l.element;if(g.style){var v;p(l.options.cssProps,function(S,M){v=bt(g.style,M),u?(l.oldCssProps[v]=g.style[v],g.style[v]=S):g.style[v]=l.oldCssProps[v]||""}),u||(l.oldCssProps={})}}function uh(l,u){var g=e.createEvent("Event");g.initEvent(l,!0,!0),g.gesture=u,u.target.dispatchEvent(g)}x(Tt,{INPUT_START:J,INPUT_MOVE:Rt,INPUT_END:V,INPUT_CANCEL:tt,STATE_POSSIBLE:Ne,STATE_BEGAN:at,STATE_CHANGED:Wt,STATE_ENDED:It,STATE_RECOGNIZED:xt,STATE_CANCELLED:pe,STATE_FAILED:ft,DIRECTION_NONE:Me,DIRECTION_LEFT:le,DIRECTION_RIGHT:ue,DIRECTION_UP:fe,DIRECTION_DOWN:de,DIRECTION_HORIZONTAL:ut,DIRECTION_VERTICAL:Ot,DIRECTION_ALL:Vs,Manager:Di,Input:rt,TouchAction:Pi,TouchInput:Re,MouseInput:Le,PointerEventInput:Ti,TouchMouseInput:_i,SingleTouchInput:Js,Recognizer:Ct,AttrRecognizer:ct,Tap:Be,Pan:Ge,Swipe:Mi,Pinch:Ei,Rotate:Ii,Press:ki,on:O,off:B,each:p,merge:C,extend:b,assign:x,inherit:_,bindFn:I,prefixed:bt});var fh=typeof t<"u"?t:typeof self<"u"?self:{};fh.Hammer=Tt,typeof n=="function"&&n.amd?n(function(){return Tt}):s.exports?s.exports=Tt:t[i]=Tt})(window,document,"Hammer")})(as);var ir=as.exports;const sr=er(ir);function Qe(s){return s*Math.PI/180}function jt(s){return s*180/Math.PI}function qt(s,t,e,i){const n=s-e,r=t-i;return Math.sqrt(n*n+r*r)}function $t(s,t,e,i){const n=e-s,r=i-t;return Math.atan2(r,n)}function ti(s,t,e,i,n,r){if(!n||!r){const a=e-s,o=i-t;return!a&&!o?0:jt(($t(s,t,e,i)+Math.PI)%(2*Math.PI))}else return ti(s,t,n,r)-ti(e,i,n,r)}function ei(s,t){return{x:Math.cos(s)*t,y:Math.sin(s)*t}}function ii(s,t){const e=Math.sqrt(Math.pow(s,2)+Math.pow(t,2));return{x:s/=e,y:t/=e}}function nr(s,t,e,i,n=10){if(Math.abs(e-s)<n&&Math.abs(i-t)<n)return"no";const r=jt($t(s,t,e,i));return r>=-135&&r<=-45?"up":r>45&&r<135?"down":r>=135&&r<=180||r>=-180&&r<-135?"left":r>=-45&&r<=45?"right":"no"}const Jt=Math.PI*2;function os(s,t,e,i){const n=s*i-t*e<0?-1:1;let r=s*e+t*i;return r>1&&(r=1),r<-1&&(r=-1),n*Math.acos(r)}function rr(s,t,e,i,n,r,a,o,h,c){const f=c*(s-e)/2+h*(t-i)/2,m=-h*(s-e)/2+c*(t-i)/2,w=a*a,p=o*o,y=f*f,x=m*m;let b=w*p-w*x-p*y;b<0&&(b=0),b/=w*x+p*y,b=Math.sqrt(b)*(n===r?-1:1);const C=b*a/o*m,_=b*-o/a*f,I=c*C-h*_+(s+e)/2,E=h*C+c*_+(t+i)/2,L=(f-C)/a,O=(m-_)/o,B=(-f-C)/a,H=(-m-_)/o,z=os(1,0,L,O);let j=os(L,O,B,H);return r===0&&j>0&&(j-=Jt),r===1&&j<0&&(j+=Jt),[I,E,z,j]}function ar(s,t){const e=1.3333333333333333*Math.tan(t/4),i=Math.cos(s),n=Math.sin(s),r=Math.cos(s+t),a=Math.sin(s+t);return[i,n,i-n*e,n+i*e,r+a*e,a-r*e,r,a]}function or(s,t,e,i,n,r,a,o,h){const c=Math.sin(h*Jt/360),f=Math.cos(h*Jt/360),m=f*(s-e)/2+c*(t-i)/2,w=-c*(s-e)/2+f*(t-i)/2;if(m===0&&w===0)return[];if(a===0||o===0)return[];a=Math.abs(a),o=Math.abs(o);const p=m*m/(a*a)+w*w/(o*o);p>1&&(a*=Math.sqrt(p),o*=Math.sqrt(p));const y=rr(s,t,e,i,n,r,a,o,c,f),x=[];let b=y[2],C=y[3];const _=Math.max(Math.ceil(Math.abs(C)/(Jt/4)),1);C/=_;for(let I=0;I<_;I++)x.push(ar(b,C)),b+=C;return x.map(I=>{for(let E=0;E<I.length;E+=2){let L=I[E+0],O=I[E+1];L*=a,O*=o;const B=f*L-c*O,H=c*L+f*O;I[E+0]=B+y[0],I[E+1]=H+y[1]}return I})}function hs(s,t,e,i,n,r){return[s/3+2/3*e,t/3+2/3*i,n/3+2/3*e,r/3+2/3*i,n,r]}function ye(s,t,e,i){return[s,t,e,i,e,i]}class cs{static createSVGElement(t="path"){return document.createElementNS.call(document,"http://www.w3.org/2000/svg",t)}static createSvgPath(t){const e=this.createSVGElement("path");return e.setAttribute("d",t),e}static downloadFromSVGElement(t,e="shape"){je(Xi(t),`${e}.svg`)}static downloadFromSVGString(t,e="shape"){je(He(t),`${e}.svg`)}static SVGParsedPathArgsLength={a:7,c:6,s:4,q:4,t:2,m:2,l:2,h:1,v:1,z:0};static isSVGPath(t){return typeof t!="string"?!1:(t=t.trim(),/^[mlhvzaqtcs]\s*[-+.0-9][^mlhvzaqtcs]+/i.test(t)&&/[\dz]$/i.test(t)&&t.length>4)}static parseSVGPath(t){const e=[];return t.replace(/([mlhvzaqtcs])([^mlhvzaqtcs]*)/gi,(i,n,r)=>{let a=n.toLowerCase();const o=pn(r);for(a=="m"&&o.length>this.SVGParsedPathArgsLength[a]&&(e.push([n,...o.splice(0,this.SVGParsedPathArgsLength[a])]),a="l",n=n=="m"?"l":"L");o.length;){if(o.length<this.SVGParsedPathArgsLength[a])throw new Error(`SVGPathD ! : ${i}`);e.push([n,...o.splice(0,this.SVGParsedPathArgsLength[a])])}return a=="z"&&e.push([n]),""}),e}static absolutizeSVGPath(t){let e=0,i=0,n=0,r=0;return t.map(function(a){const o=a[0],h=o.toUpperCase();if(o!=h)switch(a[0]=h,o){case"a":a[6]+=n,a[7]+=r;break;case"v":a[1]+=r;break;case"h":a[1]+=n;break;default:for(let c=1;c<a.length;)a[c++]+=n,a[c++]+=r}switch(h){case"Z":n=e,r=i;break;case"H":n=a[1];break;case"V":r=a[1];break;case"M":n=e=a[1],r=i=a[2];break;default:n=a[a.length-2],r=a[a.length-1]}return a})}static relativeSVGPath(t){let e=0,i=0,n=0,r=0;return t.map(function(a){const o=a[0],h=o.toLowerCase();if(o!=h)switch(a[0]=h,o){case"A":a[6]-=n,a[7]-=r;break;case"V":a[1]-=r;break;case"H":a[1]-=n;break;default:for(let c=1;c<a.length;)a[c++]-=n,a[c++]-=r}switch(h){case"z":n=e,r=i;break;case"h":n+=a[1];break;case"v":r+=a[1];break;case"m":n+=a[1],r+=a[2],e+=a[1],i+=a[2];break;default:n+=a[a.length-2],r+=a[a.length-1]}return a})}static normalizeSVGPath(t){let e=[],i=0,n=0,r=0,a=0,o=0,h=0,c=0,f=0,m;for(let w=0,p=t.length;w<p;w++){let y=t[w];const x=y[0];switch(x){case"M":i=y[1],n=y[2];break;case"A":const b=or(r,a,y[6],y[7],y[4],y[5],y[1],y[2],y[3]);if(!b.length)continue;b.forEach((I,E)=>{const[L,O,B,H,z,j,it,ht]=I;y=["C",B,H,z,j,it,ht],E<b.length-1&&e.push(y)});break;case"S":let C=r,_=a;(m=="C"||m=="S")&&(C+=C-c,_+=_-f),y=["C",C,_,y[1],y[2],y[3],y[4]];break;case"T":m=="Q"||m=="T"?(o=r*2-o,h=a*2-h):(o=r,h=a),y=["C",...hs(r,a,o,h,y[1],y[2])];break;case"Q":o=y[1],h=y[2],y=["C",...hs(r,a,y[1],y[2],y[3],y[4])];break;case"L":y=["C",...ye(r,a,y[1],y[2])];break;case"H":y=["C",...ye(r,a,y[1],a)];break;case"V":y=["C",...ye(r,a,r,y[1])];break;case"Z":y=["C",...ye(r,a,i,n)];break}m=x,r=y[y.length-2],a=y[y.length-1],y.length>4?(c=y[y.length-4],f=y[y.length-3]):(c=r,f=a),e.push(y)}return e}static zvhToLSVGPath(t){let e=[],i=["L",0,0],n;for(let r=0,a=t.length;r<a;r++){let o=t[r];switch(o[0]){case"M":i=["L",o[1],o[2]],e.push(o);break;case"Z":e.push(i);break;case"H":n=e[e.length-1]||["L",0,0],e.push(["L",o[1],n[n.length-1]]);break;case"V":n=e[e.length-1]||["L",0,0],e.push(["L",n[n.length-2],o[1]]);break;default:e.push(o)}}return e}static longhandSVGPath(t){const e={S:{to:"C",x:3},T:{to:"Q",x:1}};let i,n=0,r=0;for(let a=0,o=t.length;a<o;a++){const h=t[a],c=e[h[0]];c&&(h[0]=c.to,i&&(i[0]===c.to?(n=2*Number(i[c.x+2])-Number(i[c.x]),r=2*Number(i[c.x+3])-Number(i[c.x+1])):(n=Number(i[i.length-2]),r=Number(i[i.length-1]))),h.splice(1,0,n,r)),i=h}return t}static SVGPathDataToD(t){return t.map(e=>{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 absoluteSVGPathD(t){return this.SVGPathDataToD(this.absolutizeSVGPath(this.parseSVGPath(t)))}static walkSVGPathDCacheMap=new Map;static getWalkSVGPathD(t){if(this.walkSVGPathDCacheMap.has(t))return this.walkSVGPathDCacheMap.get(t);const e={at:i=>this.walkSVGPathD(t,i).pos,length:()=>this.walkSVGPathD(t).length};return this.walkSVGPathDCacheMap.set(t,e),e}static walkSVGPathD(t,e){const i=this.longhandSVGPath(this.zvhToLSVGPath(this.absolutizeSVGPath(this.parseSVGPath(t))));function n(w,p){return Math.pow(1-p,3)*f[0]+3*Math.pow(1-p,2)*p*w[1]+3*(1-p)*Math.pow(p,2)*w[3]+Math.pow(p,3)*w[5]}function r(w,p){return Math.pow(1-p,3)*f[1]+3*Math.pow(1-p,2)*p*w[2]+3*(1-p)*Math.pow(p,2)*w[4]+Math.pow(p,3)*w[6]}function a(w,p){return Math.pow(1-p,2)*f[0]+2*(1-p)*p*w[1]+Math.pow(p,2)*w[3]}function o(w,p){return Math.pow(1-p,2)*f[1]+2*(1-p)*p*w[2]+Math.pow(p,2)*w[4]}let h=[0,0],c=[0,0,0],f=[0,0],m=0;for(let w=0,p=i.length;w<p;w++){let y=i[w];if(y[0]==="M"){if(h[0]=y[1],h[1]=y[2],e===0)return{length:m,pos:h}}else if(y[0]==="C"){c[0]=f[0]=h[0],c[1]=f[1]=h[1],c[2]=m;let x=100;for(let b=0;b<=x;b++){let C=b/x,_=n(y,C),I=r(y,C);if(m+=qt(h[0],h[1],_,I),h[0]=_,h[1]=I,typeof e=="number"&&m>=e){let E=(m-e)/(m-c[2]),L=[h[0]*(1-E)+c[0]*E,h[1]*(1-E)+c[1]*E];return{length:m,pos:L}}c[0]=h[0],c[1]=h[1],c[2]=m}}else if(y[0]==="Q"){c[0]=f[0]=h[0],c[1]=f[1]=h[1],c[2]=m;let x=100;for(let b=0;b<=x;b++){let C=b/x,_=a(y,C),I=o(y,C);if(m+=qt(h[0],h[1],_,I),h[0]=_,h[1]=I,typeof e=="number"&&m>=e){let E=(m-e)/(m-c[2]),L=[h[0]*(1-E)+c[0]*E,h[1]*(1-E)+c[1]*E];return{length:m,pos:L}}c[0]=h[0],c[1]=h[1],c[2]=m}}else if(y[0]==="L"){if(c[0]=h[0],c[1]=h[1],c[2]=m,m+=qt(h[0],h[1],y[1],y[2]),h[0]=y[1],h[1]=y[2],typeof e=="number"&&m>=e){let x=(m-e)/(m-c[2]),b=[h[0]*(1-x)+c[0]*x,h[1]*(1-x)+c[1]*x];return{length:m,pos:b}}c[0]=h[0],c[1]=h[1],c[2]=m}}return{length:m,pos:h}}static catmullRom2bezier(t){let e=[];for(let i=0,n=t.length;n-2>i;i+=2){let r;i==0?r=[{x:t[i],y:t[i+1]},{x:t[i],y:t[i+1]},{x:t[i+2],y:t[i+3]},{x:t[i+4],y:t[i+5]}]:n-4==i?r=[{x:t[i-2],y:t[i-1]},{x:t[i],y:t[i+1]},{x:t[i+2],y:t[i+3]},{x:t[i+2],y:t[i+3]}]:r=[{x:t[i-2],y:t[i-1]},{x:t[i],y:t[i+1]},{x:t[i+2],y:t[i+3]},{x:t[i+4],y:t[i+5]}];const a=[{x:r[1].x,y:r[1].y},{x:(-r[0].x+6*r[1].x+r[2].x)/6,y:(-r[0].y+6*r[1].y+r[2].y)/6},{x:(r[1].x+6*r[2].x-r[3].x)/6,y:(r[1].y+6*r[2].y-r[3].y)/6},{x:r[2].x,y:r[2].y}];e.push(["C",a[1].x,a[1].y,a[2].x,a[2].y,a[3].x,a[3].y])}return e}static findDotsAtSegment(t,e,i,n,r,a,o,h,c){let f=1-c,m=Math.pow(f,3),w=Math.pow(f,2),p=c*c,y=p*c,x=m*t+w*3*c*i+f*3*c*c*r+y*o,b=m*e+w*3*c*n+f*3*c*c*a+y*h,C=t+2*c*(i-t)+p*(r-2*i+t),_=e+2*c*(n-e)+p*(a-2*n+e),I=i+2*c*(r-i)+p*(o-2*r+i),E=n+2*c*(a-n)+p*(h-2*a+n),L=f*t+c*i,O=f*e+c*n,B=f*r+c*o,H=f*a+c*h,z=90-Math.atan2(C-I,_-E)*180/Math.PI;return(C>I||_<E)&&(z+=180),{x,y:b,m:{x:C,y:_},n:{x:I,y:E},start:{x:L,y:O},end:{x:B,y:H},alpha:z}}static findDotAtSegment(t,e,i,n,r,a,o,h,c){const f=1-c;return{x:Math.pow(f,3)*t+Math.pow(f,2)*3*c*i+f*3*c*c*r+Math.pow(c,3)*o,y:Math.pow(f,3)*e+Math.pow(f,2)*3*c*n+f*3*c*c*a+Math.pow(c,3)*h}}static curveDim(t,e,i,n,r,a,o,h){const c=[],f=[[],[]];let m,w,p,y,x,b,C,_;for(let O=0;O<2;++O){if(O===0?(w=6*t-12*i+6*r,m=-3*t+9*i-9*r+3*o,p=3*i-3*t):(w=6*e-12*n+6*a,m=-3*e+9*n-9*a+3*h,p=3*n-3*e),Math.abs(m)<1e-12){if(Math.abs(w)<1e-12)continue;y=-p/w,y>0&&y<1&&c.push(y);continue}C=w*w-4*p*m,_=Math.sqrt(C),!(C<0)&&(x=(-w+_)/(2*m),x>0&&x<1&&c.push(x),b=(-w-_)/(2*m),b>0&&b<1&&c.push(b))}let I=c.length,E;const L=I;for(;I--;)y=c[I],E=1-y,f[0][I]=E*E*E*t+3*E*E*y*i+3*E*y*y*r+y*y*y*o,f[1][I]=E*E*E*e+3*E*E*y*n+3*E*y*y*a+y*y*y*h;return f[0][L]=t,f[1][L]=e,f[0][L+1]=o,f[1][L+1]=h,f[0].length=f[1].length=L+2,{min:{x:Math.min.apply(0,f[0]),y:Math.min.apply(0,f[1])},max:{x:Math.max.apply(0,f[0]),y:Math.max.apply(0,f[1])}}}}const K=cs;class wt{id;x;y;rotate;scale;vx;vy;ax;ay;mass;XYIsShapeCenter=!1;path2d=new Path2D;isMouseInShape=!1;isDragging=!1;constructor(t){this.id=ln(),this.x=t?.x||0,this.y=t?.y||0,this.rotate=t?.rotate||0,this.scale=t?.scale||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||0}getBoundingClientRect(){return null}toSVGPathD(){const t=[],e=this.toSVGPathData();return e[0]&&Array.isArray(e[0])?t.push(...e):t.push(e),K.SVGPathDataToD(t)}distanceTo(t){return qt(this.x,this.y,t.x,t.y)}angleTo(t){return this.rotate=$t(this.x,this.y,t.x,t.y),this.rotate}velocityTo(t){return{vx:t.x-this.x,vy:t.y-this.y}}followTo(t,e=3){const i=this.angleTo(t),{x:n,y:r}=ei(i,e);this.vx=n,this.vy=r,this.nextFrame()}followAccelerationTo(t,e=.05){const i=this.angleTo(t),{x:n,y:r}=ei(i,e);this.ax=n,this.ay=r,this.nextFrame()}nextFrame(t){const e=t?.gravity??0,i=t?.friction??0;if(this.vx+=this.ax,this.vy+=this.ay,this.vy+=e,i>0){const n=Math.atan2(this.vy,this.vx);let r=Math.sqrt(this.vx*this.vx+this.vy*this.vy);r>i?r-=i:r=0,this.vx=Math.cos(n)*r,this.vy=Math.sin(n)*r}this.x+=this.vx,this.y+=this.vy}nextFrameEaseTo(t,e){const i=e?.gravity??0,n=e?.friction??1,r=e?.easing??.05,a=t.x-this.x,o=t.y-this.y;this.vx=a*r,this.vy=o*r,this.vy+=i,this.vx*=n,this.vy*=n,this.x+=this.vx,this.y+=this.vy}nextFrameSpringTo(t,e){const i=e?.gravity??0,n=e?.friction??.95,r=e?.spring??.03;(Array.isArray(t)?t:[t]).forEach(o=>{const h=o.x-this.x,c=o.y-this.y,f=h*r,m=c*r;this.vx+=f,this.vy+=m}),this.vy+=i,this.vx*=n,this.vy*=n,this.x+=this.vx,this.y+=this.vy}nextFrameSpringConnect(t,e){const i=e?.gravity??0,n=e?.friction??.95,r=e?.spring??.03,a=e?.springLength??100,o=this.angleTo(t);this.nextFrameSpringTo(new Zt({x:t.x-Math.cos(o)*a,y:t.y-Math.sin(o)*a}),{spring:r,friction:n,gravity:i})}}class ot extends wt{width;height;borderRadius;centerX;centerY;rMin;rMax;r;constructor(t){super(t),this.width=t.width,this.height=t.height,this.borderRadius=t.borderRadius||0,this.centerX=this.x+this.width/2,this.centerY=this.y+this.height/2,this.rMin=Math.min(this.width,this.height)/2,this.rMax=Math.max(this.width,this.height)/2,this.r=Math.sqrt(this.width*this.width+this.height*this.height)/2}getBoundingClientRect(){return this}toSVGPathData(){return this.borderRadius?[["M",this.x+this.borderRadius,this.y],["l",this.width-this.borderRadius*2,0],["a",this.borderRadius,this.borderRadius,0,0,1,this.borderRadius,this.borderRadius],["l",0,this.height-this.borderRadius*2],["a",this.borderRadius,this.borderRadius,0,0,1,-this.borderRadius,this.borderRadius],["l",this.borderRadius*2-this.width,0],["a",this.borderRadius,this.borderRadius,0,0,1,-this.borderRadius,-this.borderRadius],["l",0,this.borderRadius*2-this.height],["a",this.borderRadius,this.borderRadius,0,0,1,this.borderRadius,-this.borderRadius],["z"]]:[["M",this.x,this.y],["l",this.width,0],["l",0,this.height],["l",-this.width,0],["z"]]}toCanvasContext(t){t.beginPath(),this.borderRadius<=0?t.rect(0,0,this.width,this.height):(t.moveTo(0,this.borderRadius),t.lineTo(0,this.height-this.borderRadius),t.quadraticCurveTo(0,this.height,this.borderRadius,this.height),t.lineTo(this.width-this.borderRadius,this.height),t.quadraticCurveTo(this.width,this.height,this.width,this.height-this.borderRadius),t.lineTo(this.width,this.borderRadius),t.quadraticCurveTo(this.width,0,this.width-this.borderRadius,0),t.lineTo(this.borderRadius,0),t.quadraticCurveTo(0,0,0,this.borderRadius)),t.closePath()}eq(t){return this.x===t.x&&this.y===t.y&&this.width===t.width&&this.height===t.height}isIntersectRect(t){return!(this.x+this.width<t.x||t.x+t.width<this.x||this.y+this.height<t.y||t.y+t.height<this.y)}isContainPoint(t,e){return t>=this.x&&t<=this.x+this.width&&e>=this.y&&e<=this.y+this.height}clone(t){return new ot({x:t.x,y:t.y,width:t.width,height:t.height,borderRadius:t.borderRadius})}toArray(){return[this.x,this.y,this.width,this.height,this.borderRadius]}}class _t extends wt{radius;constructor(t){super(t),this.XYIsShapeCenter=!0,this.radius=t?.radius||0}getBoundingClientRect(){return new ot({x:this.x-this.radius,y:this.y-this.radius,width:this.radius*2,height:this.radius*2})}toSVGPathData(){return["M",this.x,this.y]}toCanvasContext(t){t.beginPath(),t.arc(0,0,this.radius,0,Math.PI*2,!0),t.closePath()}toArray(){return[this.x,this.y]}setX(t){this.x=t}setY(t){this.y=t}setXY(t,e){this.x=t,this.y=e}eq(t){return this.x===t.x&&this.y===t.y}midPointBtw(t){return new _t({x:this.x+(t.x-this.x)/2,y:this.y+(t.y-this.y)/2})}clone(t){return new _t({x:t.x,y:t.y,radius:t.radius})}nextFrameCollisionTo(t){const e=t.x-this.x,i=t.y-this.y;if(Math.sqrt(e*e+i*i)<this.radius+t.radius){const a=Math.atan2(i,e),o=Math.sin(a),h=Math.cos(a),c={x:0,y:0},f=r(e,i,o,h,!0),m=r(this.vx,this.vy,o,h,!0),w=r(t.vx,t.vy,o,h,!0),p=m.x-w.x;m.x=((this.mass-t.mass)*m.x+2*t.mass*w.x)/(this.mass+t.mass),w.x=p+m.x;const y=Math.abs(m.x)+Math.abs(w.x),x=this.radius+t.radius-Math.abs(c.x-f.x);c.x+=m.x/y*x,f.x+=w.x/y*x;const b=r(c.x,c.y,o,h,!1),C=r(f.x,f.y,o,h,!1);t.x=this.x+C.x,t.y=this.y+C.y,this.x=this.x+b.x,this.y=this.y+b.y;const _=r(m.x,m.y,o,h,!1),I=r(w.x,w.y,o,h,!1);this.vx=_.x,this.vy=_.y,t.vx=I.x,t.vy=I.y}function r(a,o,h,c,f=!1){return{x:f?a*c+o*h:a*c-o*h,y:f?o*c-a*h:o*c+a*h}}}nextFrameBounce(t,e){const i=t.x,n=t.y,r=t.x+t.width,a=t.y+t.height,o=e?.bounce??-1;this.x+this.radius>r?(this.x=r-this.radius,this.vx*=o):this.x-this.radius<i&&(this.x=i+this.radius,this.vx*=o),this.y+this.radius>a?(this.y=a-this.radius,this.vy*=o):this.y-this.radius<n&&(this.y=n+this.radius,this.vy*=o)}}const Zt=_t;class ls{constructor(){}static getFormatKeyNames(t){const e=Ke(),i=[];return t.ctrl&&i.push(e?"Cmd":"Ctrl"),t.shift&&i.push("Shift"),t.alt&&i.push("Alt"),typeof t.key=="string"?i.push(ze(t.key)):Array.isArray(t.key)&&(t.key.map(n=>ze(n)),i.push(...t.key)),i}static matchKeyScheme(t,e){const i=t.ctrl??!1,n=t.shift??!1,r=t.alt??!1;if(t.exact)return(i===e.metaKey||i===e.ctrlKey)&&n===e.shiftKey&&r===e.altKey;const a=[];return i&&a.push(i===e.metaKey||i===e.ctrlKey),n&&a.push(n===e.shiftKey),r&&a.push(r===e.altKey),a.every(o=>o)}static on(t,e){if(t?.key===void 0||t?.key===null)return e;const i=t?.target??window;let n=!1;const r=this.getFormatKeyNames(t),a=o=>{if(o.stopPropagation(),!n&&o.key!=="Control"&&o.key!=="Meta"&&o.key!=="Shift"&&o.key!=="Option"&&o.key!=="Alt"&&r.find(h=>h.toLowerCase()===o.key.toLowerCase())&&this.matchKeyScheme(t,o)){o.preventDefault();const h=e(o);if(typeof h!="function")return;const c=f=>{f.preventDefault(),h(f),i.removeEventListener("keyup",c)};i.addEventListener("keyup",c)}};return e.title=t?.title??"",e.formatedKeyNames=r,e.pause=()=>n=!0,e.restart=()=>n=!1,e.removeListener=()=>i.removeEventListener("keydown",a),i.addEventListener("keydown",a),e}}class U extends Ui{container;mousePoint;hammer;domEventRemoveListeners=[];constructor(t=document.documentElement,e=!0){super(),this.container=t,this.hammer=new sr(this.container),this.mousePoint=new _t({x:0,y:0}),e&&this.start()}_emitDebounce=wn((t,...e)=>super.emit(t,...e),50);emit(t,...e){switch(t){case"panLeft":case"panRight":this._emitDebounce(t,...e);break;default:super.emit(t,...e);break}return this}static singleton;static globalScrollChangeCallbacks=[];static get page(){if(U.singleton)return U.singleton;U.singleton=new U,U.singleton.registerKeyDown({title:"打开",key:"o",ctrl:!0,exact:!0},()=>{Wi().then(e=>qe(e[0])).then(e=>{U.singleton.emit("openFile",e)}).catch(e=>{U.singleton.emit("openFileError",e)})}),U.singleton.registerMatchMediaChange("(prefers-color-scheme: dark)");const t=()=>U.globalScrollChangeCallbacks.forEach(e=>e());return U.singleton.registerGlobalScrollChange=e=>{U.globalScrollChangeCallbacks.push(e),U.globalScrollChangeCallbacks.length==1&&document.addEventListener("scroll",t)},U.singleton.removeGlobalScrollChange=e=>{const i=U.globalScrollChangeCallbacks.findIndex(n=>n==e);i>=0&&(U.globalScrollChangeCallbacks.splice(i,1),U.globalScrollChangeCallbacks.length==0&&document.removeEventListener("scroll",t))},U.singleton}start(){this.initMouseEventListeners(),this.on("pointerMove",this.setMousePoint),this.addDOMEventRemoveListeners(()=>{this.off("pointerMove",this.setMousePoint)}),this.registerResizeObserver(),this.registerElementDisplayInParentWhenScrollChange()}restart(){this.destroy(),this.start()}destroy(){this.domEventRemoveListeners.forEach(t=>t()),this.removeAllListeners()}addDOMEventRemoveListeners(t){this.domEventRemoveListeners.push(t)}setMousePoint(t){const e=Qi(this.container,t);return this.mousePoint.x=e.x,this.mousePoint.y=e.y,e}initMouseEventListeners(){const t=k=>{this.emit("mouseDown",k),this.container.style.userSelect="none"},e=k=>{this.emit("mouseUp",k),this.container.style.userSelect=""},i=k=>{this.emit("mouseMove",k)},n=k=>{this.emit("mouseOver",k)},r=k=>{this.emit("mouseOut",k),this.container.style.userSelect=""},a=k=>{this.emit("mouseClick",k)},o=k=>{this.emit("mouseDoubleClick",k)},h=k=>{this.emit("mouseWheel",k)},c=k=>{this.emit("mouseContextMenu",k)},f=k=>{this.emit("touchStart",k),this.container.style.userSelect="none"},m=k=>{this.emit("touchEnd",k),this.container.style.userSelect=""},w=k=>{this.emit("touchCancel",k),this.container.style.userSelect=""},p=k=>{this.emit("touchMove",k)},y=k=>{this.emit("pointerDown",k),this.container.style.userSelect="none"},x=k=>{this.emit("pointerUp",k),this.container.style.userSelect=""},b=k=>{this.emit("pointerCancel",k),this.container.style.userSelect=""},C=k=>{this.emit("pointerMove",k)},_=k=>{this.emit("pan",k)},I=k=>{this.emit("panStart",k),this.container.style.userSelect="none"},E=k=>{this.emit("panMove",k)},L=k=>{this.emit("panEnd",k),this.container.style.userSelect=""},O=k=>{this.emit("panCancel",k),this.container.style.userSelect=""},B=k=>{this.emit("panLeft",k)},H=k=>{this.emit("panRight",k)},z=k=>{this.emit("panUp",k),this.container.style.userSelect=""},j=k=>{this.emit("panDown",k),this.container.style.userSelect="none"},it=k=>{this.emit("pinch",k)},ht=k=>{this.emit("press",k)},At=k=>{this.emit("rotate",k)},bt=k=>{this.emit("swipe",k)},Xt=k=>{this.emit("tap",k)},lt=k=>{!k.target||this.container==k.target||this.container.contains(k.target)||this.emit("tapOutSide",k)};this.container.addEventListener("mousedown",t),this.container.addEventListener("mouseup",e),this.container.addEventListener("mousemove",i),this.container.addEventListener("mouseover",n),this.container.addEventListener("mouseout",r),this.container.addEventListener("click",a),this.container.addEventListener("dblclick",o),this.container.addEventListener("wheel",h),this.container.addEventListener("contextmenu",c),this.container.addEventListener("touchstart",f),this.container.addEventListener("touchend",m),this.container.addEventListener("touchcancel",w),this.container.addEventListener("touchmove",p),this.container.addEventListener("pointerdown",y),this.container.addEventListener("pointerup",x),this.container.addEventListener("pointercancel",b),this.container.addEventListener("pointermove",C),this.hammer.on("pan",_),this.hammer.on("panstart",I),this.hammer.on("panmove",E),this.hammer.on("panend",L),this.hammer.on("pancancel",O),this.hammer.on("panleft",B),this.hammer.on("panright",H),this.hammer.on("panup",z),this.hammer.on("pandown",j),this.hammer.on("pinch",it),this.hammer.on("press",ht),this.hammer.on("rotate",At),this.hammer.on("swipe",bt),this.hammer.on("tap",Xt),document.addEventListener("pointerdown",lt,!1);const Lt=()=>{this.container.removeEventListener("mousedown",t),this.container.removeEventListener("mouseup",e),this.container.removeEventListener("mousemove",i),this.container.removeEventListener("mouseover",n),this.container.removeEventListener("mouseout",r),this.container.removeEventListener("click",a),this.container.removeEventListener("dblclick",o),this.container.removeEventListener("wheel",h),this.container.removeEventListener("contextmenu",c),this.container.removeEventListener("touchstart",f),this.container.removeEventListener("touchend",m),this.container.removeEventListener("touchcancel",w),this.container.removeEventListener("touchmove",p),this.container.removeEventListener("pointerdown",y),this.container.removeEventListener("pointerup",x),this.container.removeEventListener("pointercancel",b),this.container.removeEventListener("pointermove",C),this.hammer.off("pan",_),this.hammer.off("panstart",I),this.hammer.off("panmove",E),this.hammer.off("panend",L),this.hammer.off("pancancel",O),this.hammer.off("panleft",B),this.hammer.off("panright",H),this.hammer.off("panup",z),this.hammer.off("pandown",j),this.hammer.off("pinch",it),this.hammer.off("press",ht),this.hammer.off("rotate",At),this.hammer.off("swipe",bt),this.hammer.off("tap",Xt),document.removeEventListener("pointerdown",lt,!1),document.removeEventListener("touchstart",lt,!1),document.removeEventListener("mousedown",lt,!1)};return this.addDOMEventRemoveListeners(Lt),Lt}registerKeyDown(t,e,i){const n=ls.on(t,a=>(e(a,n.formatedKeyNames,n.pause,n.restart),i)),r=()=>{n.removeListener?.()};return this.addDOMEventRemoveListeners(r),r}registerResizeObserver(){const t=new ResizeObserver(i=>{const{width:n,height:r}=i[0].contentRect;this.emit("resize",n,r)});t.observe(this.container);const e=()=>{t.unobserve(this.container)};return this.addDOMEventRemoveListeners(e),e}registerMatchMediaChange(t){let e="";switch(t){case"(prefers-color-scheme: dark)":e="matchMediaChangePrefersColorSchemeDark";break;default:e=t;break}const i=r=>{this.emit(e,r.matches)};window.matchMedia(t).addEventListener("change",i);const n=()=>{window.matchMedia(t).removeEventListener("change",i)};return this.addDOMEventRemoveListeners(n),n}registerElementDisplayInParentWhenScrollChange(t){const e={threshold:t?.threshold||.5,root:t?.parentElement},i=new IntersectionObserver((r,a)=>{let o=r[0];if(r.length>1){const c=r.find(f=>f.isIntersecting);c&&(o=c)}o.isIntersecting&&o.intersectionRatio>=e.threshold?this.emit("showInParent"):this.emit("showOffParent")},e);i.observe(this.container);const n=()=>{i.unobserve(this.container)};return this.addDOMEventRemoveListeners(n),n}registerPullDownRefresh(t){const e=t?.distance||50;let i=0,n=0;return this.captureMove({start:r=>{i=this.setMousePoint(r).y},move:()=>{n=this.mousePoint.y-i,n>0&&n<e&&this.emit("pullDownIng",n)},end:()=>{n>=e&&this.emit("pullDown")}})}registerPullUpLoading(t){const e=t?.distance||50;let i=0,n=0;return this.captureMove({start:r=>{i=this.setMousePoint(r).y},move:()=>{n=i-this.mousePoint.y,n>0&&n<e&&this.emit("pullUpIng",n)},end:()=>{n>=e&&this.emit("pullUp")}})}static isTouchEnabled(){return"ontouchstart"in window||navigator.maxTouchPoints>0}captureMove(t){return this.captureMoveUsePointer(t)}captureMoveUsePointer(t){const e=a=>{this.container.setPointerCapture(a.pointerId),this.container.style.userSelect="none",t?.start?.(a)},i=a=>{this.container.style.userSelect="",t?.end?.(a)},n=a=>{t?.move?.(a)};this.on("pointerDown",e),this.on("pointerUp",i),this.on("pointerCancel",i),this.on("pointerMove",n);const r=()=>{this.off("pointerDown",e),this.off("pointerUp",i),this.off("pointerCancel",i),this.off("pointerMove",n)};return this.addDOMEventRemoveListeners(r),r}captureMoveUseMouse(t){const e=a=>{document.addEventListener("mousemove",n,!1),document.addEventListener("mouseup",i,!1),this.container.style.userSelect="none",t?.start?.(a)},i=a=>{document.removeEventListener("mousemove",n,!1),document.removeEventListener("mouseup",i,!1),this.container.style.userSelect="",t?.end?.(a)},n=a=>{t?.move?.(a)};this.on("mouseDown",e);const r=()=>{this.off("mouseDown",e)};return this.addDOMEventRemoveListeners(r),r}captureMoveUseTouch(t){const e=a=>{a.preventDefault(),t?.start?.(a)},i=a=>{t?.end?.(a)},n=a=>{t?.move?.(a)};this.on("touchStart",e),this.on("touchEnd",i),this.on("touchCancel",i),this.on("touchMove",n);const r=()=>{this.off("touchStart",e),this.off("touchEnd",i),this.off("touchCancel",i),this.off("touchMove",n)};return this.addDOMEventRemoveListeners(r),r}static getMouseButton(t){if(document.implementation.hasFeature("MouseEvents","2.0"))return t.button;switch(t.button){case 0:case 1:case 3:case 5:case 7:return 0;case 2:case 6:return 2;case 4:return 1}}}class Kt{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"),i=document.createElement("video"),n=document.createElement("source"),r=new MediaSource;r.addEventListener("sourceopen",()=>t(!0)),n.src=URL.createObjectURL(r),n.media="(min-width:10px)",i.append(n),e.width="5",e.style.cssText="position: absolute; visibility: hidden;",document.documentElement.append(e),e.contentDocument?.body.append(i),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(()=>{Kt.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 us extends Ui{source;raw="";mode="text";tagname="";nodename="";textchunk="";entity="";quote="";attrs={};constructor(t){super(),this.source=t}parse(){const t=cn(this.source);if(t===0){this.emit("finish");return}let e,i,n=Li(this.source,0);for(let r=1;r<t;r++)e=i,i=n,n=Li(this.source,r),this.raw+=i,i&&this.step(i,n,e);n&&this.step(n,void 0,i),this.emit("finish")}step(t,e,i){t==`
|
|
25
|
+
`&&this.emit("newline"),this.act(t,e,i)}act(t,e,i){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":mt("whitespace",t)?(this.textchunk+=A.entity2text(this.entity),this.mode="text"):t==";"?(this.textchunk+=A.entity2text(this.entity+t),this.mode="text"):this.entity+=t;break;case"special":if(i=="!"&&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(i=="]"&&t=="]"&&e==">"){this.mode="cdata end",this.textchunk=this.textchunk.slice(0,-1);break}t=="eof"&&(this.mode="cdata end",this.act(t,e,i)),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=="-"&&i=="-"&&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(!mt("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,i)}break;case"close tag name start":mt("whitespace",t)||(this.mode="close tag name",this.tagname="",this.nodename="",this.act(t,e,i));break;case"close tag name":if(mt("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(mt("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":mt("whitespace",t)||(this.mode="attr",this.nodename="",this.act(t,e,i));break;case"attr":if(mt("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(!mt("whitespace",t)){if(this.mode="attr value",this.quote="",t=="'"||t=='"'){this.quote=t;return}this.act(t,e,i)}break;case"attr value":if(mt("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&&i!="\\"&&(this.mode="attr start");break;default:this.attrs[this.nodename]+=t;break}break}}}function si(s,t){if(typeof t<"u")window.localStorage.setItem(s,t);else return window.localStorage.getItem(s)??void 0}function hr(s,t,e){const i=new Date;i.setTime(i.getTime()+e*24*60*60*1e3);const n="expires="+i.toUTCString();document.cookie=s+"="+t+"; "+n}function cr(s){const t=s+"=",e=document.cookie.split(";");for(let i=0,n=e.length;i<n;i++){const r=e[i].trim();if(r.indexOf(t)==0)return r.substring(t.length,r.length)}return""}const lr=()=>document.cookie.split(";").map(s=>s.split("=")).reduce((s,[t,e])=>(s[t.trim().replace('"',"")]=e,s),{}),ur=()=>document.cookie.split(";").forEach(s=>document.cookie=s.replace(/^ +/,"").replace(/=.*/,`=;expires=${new Date().toUTCString()};path=/`));U.page.on("matchMediaChangePrefersColorSchemeDark",s=>{ve(s?"dark":"light")}),fs();function ve(s){si("colorScheme",s),document.documentElement.classList.toggle("dark",s=="dark")}function fs(){const s=si("colorScheme");if(s=="dark"||s=="light")return ve(s),s;{const t=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";return ve(t),t}}const fr={safeAreaTop:A.getCSSVar("--safe-area-inset-top"),safeAreaRight:A.getCSSVar("--safe-area-inset-right"),safeAreaBottom:A.getCSSVar("--safe-area-inset-bottom"),safeAreaLeft:A.getCSSVar("--safe-area-inset-left"),colorPrimary:A.getCSSVar("--color-primary")||"#5078f0",colorRed:A.getCSSVar("--color-red")||"#ff5050",colorOrange:A.getCSSVar("--color-orange")||"#fa8c00",colorYellow:A.getCSSVar("--color-yellow")||"#fadc32",colorGreen:A.getCSSVar("--color-green")||"#00c878",colorBlue:A.getCSSVar("--color-blue")||"#00b4fa",colorPurple:A.getCSSVar("--color-purple")||"#6464fa",colorBlack:A.getCSSVar("--color-black")||"#001428",colorGray00:A.getCSSVar("--color-gray-00")||"#000000",colorGray33:A.getCSSVar("--color-gray-33")||"#333333",colorGray66:A.getCSSVar("--color-gray-66")||"#666666",colorGray99:A.getCSSVar("--color-gray-99")||"#999999",colorGrayCC:A.getCSSVar("--color-gray-cc")||"#cccccc",colorGrayDD:A.getCSSVar("--color-gray-dd")||"#dddddd",colorGrayE6:A.getCSSVar("--color-gray-e6")||"#e6e6e6",colorGrayEE:A.getCSSVar("--color-gray-ee")||"#eeeeee",colorGrayEF:A.getCSSVar("--color-gray-ef")||"#efefef",colorGrayF5:A.getCSSVar("--color-gray-f5")||"#f5f5f5",colorGrayFF:A.getCSSVar("--color-gray-ff")||"#ffffff",fontLineHeight:A.getCSSVar("--font-line-height")||"1,4",fontSize32:A.getCSSVar("--font-size-32")||"32px",fontSize24:A.getCSSVar("--font-size-24")||"24px",fontSize20:A.getCSSVar("--font-size-20")||"20px",fontSize18:A.getCSSVar("--font-size-18")||"18px",fontSize16:A.getCSSVar("--font-size-16")||"16px",fontSize14:A.getCSSVar("--font-size-14")||"14px",fontSize12:A.getCSSVar("--font-size-12")||"12px",fontSize11:A.getCSSVar("--font-size-11")||"11px",gap4:A.getCSSVar("--gap-4")||"4px",gap8:A.getCSSVar("--gap-8")||"8px",gap12:A.getCSSVar("--gap-12")||"12px",gap16:A.getCSSVar("--gap-16")||"16px",gap20:A.getCSSVar("--gap-20")||"20px",gap40:A.getCSSVar("--gap-40")||"40px",height44:A.getCSSVar("--height-44")||"44px",height32:A.getCSSVar("--height-32")||"32px",borderRadius:A.getCSSVar("--border-radius")||"4px"},dr=()=>Math.random()*16777215,mr=()=>`#${Math.random().toString(16).slice(2,8).padEnd(6,"0")}`,gr=()=>`#${(~~(Math.random()*(1<<24))).toString(16)}`,ds=function(s){let t="00000"+(s|0).toString(16);return t="#"+t.substring(t.length-6),t},ms=function(s,t=1){const e=s>>16&255,i=s>>8&255,n=s&255,r=t<0?0:t>1?1:t;return r===1?"rgb("+e+","+i+","+n+")":"rgba("+e+","+i+","+n+","+r+")"},be=function(s){return s[0]==="#"&&(s=s.slice(1)),parseInt(s,16)},ni=function(s,t=1){const e=be(s);return ms(e,t)},pr=s=>{const e=/rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d?\.?\d*)\s*\)/gi.exec(s);return e?"#"+((1<<24)+(parseInt(e[1])<<16)+(parseInt(e[2])<<8)+parseInt(e[3])).toString(16).slice(1):""};function wr(s,t){let e=parseInt(s.substring(1,3),16),i=parseInt(s.substring(3,5),16),n=parseInt(s.substring(5,7),16);e==0&&(e=32),i==0&&(i=32),n==0&&(n=32),e=e*(100+t)/100,i=i*(100+t)/100,n=n*(100+t)/100,e=e<255?e:255,i=i<255?i:255,n=n<255?n:255,e=Math.round(e),i=Math.round(i),n=Math.round(n);const r=e.toString(16).length==1?"0"+e.toString(16):e.toString(16),a=i.toString(16).length==1?"0"+i.toString(16):i.toString(16),o=n.toString(16).length==1?"0"+n.toString(16):n.toString(16);return"#"+r+a+o}function yr(s,t,e,i){let n,r,a;s=s/360,t=t/100,e=e/100;const o=Math.floor(s*6),h=s*6-o,c=e*(1-t),f=e*(1-h*t),m=e*(1-(1-h)*t);switch(o%6){case 0:n=e,r=m,a=c;break;case 1:n=f,r=e,a=c;break;case 2:n=c,r=e,a=m;break;case 3:n=c,r=f,a=e;break;case 4:n=m,r=c,a=e;break;case 5:default:n=e,r=c,a=f;break}return{r:Math.round(n*255),g:Math.round(r*255),b:Math.round(a*255),opacity:i??1}}function vr(s,t,e,i){s*=360;let n,r,a,o,h;return s=s%360/60,h=e*t,o=h*(1-Math.abs(s%2-1)),n=r=a=e-h,s=~~s,n+=[h,o,0,0,o,h][s],r+=[o,h,h,o,0,0][s],a+=[0,0,o,h,h,o][s],{r:n,g:r,b:a,opacity:i??1}}function br(s,t,e,i){(s>1||t>1||e>1)&&(s/=360,t/=100,e/=100),s*=360;var n,r,a,o,h;return s=s%360/60,h=2*t*(e<.5?e:1-e),o=h*(1-Math.abs(s%2-1)),n=r=a=e-h/2,s=~~s,n+=[h,o,0,0,o,h][s],r+=[o,h,h,o,0,0][s],a+=[0,0,o,h,h,o][s],{r:n,g:r,b:a,opacity:i??1}}function xr(s,t,e,i){const n=Math.max(s,t,e),r=Math.min(s,t,e),a=n-r,o=n===0?0:a/n,h=n/255;let c;switch(n){case r:c=0;break;case s:c=t-e+a*(t<e?6:0),c/=6*a;break;case t:c=e-s+a*2,c/=6*a;break;case e:default:c=s-t+a*4,c/=6*a;break}return{h:Math.round(c*360),s:Math.round(o*100),v:Math.round(h*100),opacity:i??1}}function Cr(s,t,e){let i,n,r,a;return r=Math.max(s,t,e),a=r-Math.min(s,t,e),i=a==0?0:r==s?(t-e)/a:r==t?(e-s)/a+2:(s-t)/a+4,i=(i+360)%6*60/360,n=a==0?0:a/r,{h:i,s:n,b:r}}function Tr(s,t,e){let i,n,r,a,o,h;return a=Math.max(s,t,e),o=Math.min(s,t,e),h=a-o,i=h==0?0:a==s?(t-e)/h:a==t?(e-s)/h+2:(s-t)/h+4,i=(i+360)%6*60/360,r=(a+o)/2,n=h==0?0:r<.5?h/(2*r):h/(2-2*r),{h:i,s:n,l:r}}function _r(s){return btoa(encodeURIComponent(s)).replaceAll("+","*").replaceAll("/","-").replaceAll("=","")}function Sr(s){let t=s.replaceAll("*","+").replaceAll("-","/");const e=t.length%4;return e&&(t=t.padEnd(t.length+(4-e),"=")),decodeURIComponent(atob(t))}function ri(s=window.location.href){return Ve(URL)?new URL(s):gs(s)}function gs(s=window.location.href){const t="(?<protocol>https?:)",e="(?<host>(?<hostname>[^/#?:]+)(?::(?<port>\\d+))?)",i="(?<pathname>(?:\\/[^/#?]+)*\\/?)",n="(?<search>(?:\\?[^#]*)?)",r="(?<hash>(?:#.*)?)",o=new RegExp(`^${t}//${e}${i}${n}${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 Pr(s){const t=ri(s);return t.protocol==="http:"||t.protocol==="https:"}function ps(s=window.location.href){const t=ri(s),e=t.href.indexOf(t.hash);return t.hash&&e>=0?t.href.substring(0,e):t.href}function Er(s=location.search){s=decodeURIComponent(s).replace(/^[#?&]/,"");const t={};if(!s)return t;const e=/(?:^|&)([^&=]*)=?([^&]*?)(?=&|$)/y;let i=e.exec(s);for(;i;)t[i[1]]=i[2],i=e.exec(s);return t}function kr(s){return Array.from(new URLSearchParams(s)).reduce((t,[e,i])=>Object.assign({},t,{[e]:t[e]?(Array.isArray(t[e])?t[e]:[t[e]]).concat(i):i}),{})}function ws(s){let t="";for(const e in s)t&&(t+="&"),t+=`${e}=${s[e]}`;return t}function Ir(s){return new URLSearchParams(s).toString()}function ai(s){return"?"+[...s.entries()].map(t=>encodeURIComponent(t[0])+"="+encodeURIComponent(t[1]instanceof File?t[1].name:t[1])).join("&")}function xe(s,t){return s.indexOf("?")>=0?s+t.replace(/^\?/,"&"):s.replace(/(?:\?.*)?$/,t.replace(/^[&?]/,"?"))}function Mr(s){let t="";new MutationObserver(function(i){window.location.href!==t&&(t=window.location.href,s&&s(location.href))}).observe(document,{attributes:!0,childList:!0,subtree:!0})}function Dr(s){window.addEventListener("hashchange",()=>{s(location.hash)})}function Ar(s){window.addEventListener("popstate",s,!1)}function Lr(s){let t=null;if(rs)try{t=new Worker(URL.createObjectURL(new Blob([s])))}catch(e){return typeof console!==void 0&&typeof console.warn=="function"&&console.warn("🎊 Could not load worker",e),null}return t}const Ce=new Map;async function Rr(s){return new Promise((t,e)=>{Te(s,(i,n)=>i?e(i):t({width:n.width,height:n.height,aspectRatio:n.width/n.height}))})}const Te=(s,t)=>{if(Ce.has(s))return t(null,Ce.get(s));const e=new Image;e.onload=function(){Ce.set(s,{width:e.naturalWidth||e.width,height:e.naturalHeight||e.height,element:e}),t(null,Ce.get(s))},e.onerror=function(i){t(i,null)},e.src=s},Or=(s,t)=>{for(let e=0,i=s.length;e<i;e++){const n=s[e],{type:r}=n;if(r.split("/")[0]!=="image")return;const o=new FileReader;o.onload=function(h){if(!h.target)return t("no reader target",null);const c=h.target.result,f=Ni(c),m=new Blob([c]);oi(m,(w,p)=>{if(!p)return t(w,null);Te(p,(y,x)=>{if(!x)return t(y,null);ys(p,(b,C)=>{if(!C)return t(b,null);const _={name:n.name,fileType:f,size:n.size,width:x.width,height:x.height,imgUrl:p,imageData:C,blob:m};return t(null,_)})})})},o.readAsArrayBuffer(n)}},ys=(s,t)=>{Te(s,(e,i)=>{if(!i)return t(e,null);const n=document.createElement("canvas"),r=n.getContext("2d");n.width=i.width,n.height=i.height,r.drawImage(i.element,0,0,n.width,n.height);const a=r.getImageData(0,0,n.width,n.height);return t(null,a)})},Nr=(s,t=0,e=0)=>{const i=document.createElement("canvas"),n=i.getContext("2d");return i.width=t,i.height=e,n.drawImage(s,0,0,t,e),n.getImageData(0,0,t,e)},Fr=(s,t=0,e=0)=>{const i=document.createElement("canvas"),n=i.getContext("2d");return i.width=t,i.height=e,n.drawImage(s,0,0,t,e),n.getImageData(0,0,t,e)},Gr=s=>{const t=s.width,e=s.height,i=t*e*3,n=i+54,r=[66,77,n&255,n>>8&255,n>>16&255,n>>24&255,0,0,0,0,54,0,0,0],a=[40,0,0,0,t&255,t>>8&255,t>>16&255,t>>24&255,e&255,e>>8&255,e>>16&255,e>>24&255,1,0,24,0,0,0,0,0,i&255,i>>8&255,i>>16&255,i>>24&255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],o=(4-t*3%4)%4,h=s.data;let c="";const f=t<<2;let m=e;const w=String.fromCharCode;do{const y=f*(m-1);let x="";for(let b=0;b<t;b++){const C=b<<2;x+=w(h[y+C+2])+w(h[y+C+1])+w(h[y+C])}for(let b=0;b<o;b++)x+=String.fromCharCode(0);c+=x}while(--m);function p(y){if(!window.btoa)throw"btoa undefined";let x="";if(typeof y=="string")x=y;else for(let b=0;b<y.length;b++)x+=String.fromCharCode(y[b]);return btoa(x)}return p(r.concat(a))+p(c)},Br=s=>{const{width:t,height:e}=s,i=document.createElement("canvas"),n=i.getContext("2d");return i.width=t,i.height=e,n.putImageData(s,0,0,0,0,t,e),i.toDataURL("image/png")},Ur=(s,t,e)=>{const{width:i,height:n}=s,r=document.createElement("canvas"),a=r.getContext("2d");r.width=i,r.height=n,a.putImageData(s,0,0,0,0,i,n);const o=`image/${t?t.toLowerCase():"png"}`;r.toBlob(h=>{e?.(null,h)},o,1)},oi=(s,t)=>{const e=new FileReader;e.onload=function(i){i.target?t(null,i.target.result):t("can't readAsDataURL",null)},e.readAsDataURL(s)},zr=(s,t)=>{oi(s,function(e,i){if(i){const n=new Image;n.src=i}else t(e)})};function Vr(s){const t=[],e=[],i=[];let n=0;for(let h=0,c=s.data.length;h<c;h+=4)t[n]=s.data[h],e[n]=s.data[h+1],i[n]=s.data[h+2],n+=1;const r=hi(t),a=hi(e),o=hi(i);return"rgb("+r+","+a+","+o+")"}function hi(s){const t={},e=[],i=[];for(let o=0;o<s.length;o++)t[s[o]]?e.push(s[o]):t[s[o]]=1;let n=0;for(let o=0;o<e.length;o++){n=0;for(let h=0;h<e.length;h++)e[o]===e[h]&&(n+=1),i[o]=n}const r=Math.max.apply(null,i);let a=0;for(;a<i.length;a++)if(i[a]===r)return;return e[a]}const Xr=s=>{const{data:t,width:e,height:i}=s,n=new Uint8ClampedArray(t.length);for(let a=0;a<i;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4;n[h]=t[(a*e+e-o-1)*4],n[h+1]=t[(a*e+e-o-1)*4+1],n[h+2]=t[(a*e+e-o-1)*4+2],n[h+3]=t[(a*e+e-o-1)*4+3]}return new ImageData(n,e,i)},Wr=s=>{const{data:t,width:e,height:i}=s,n=new Uint8ClampedArray(t.length);for(let a=0;a<i;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4;n[h]=t[((i-a-1)*e+o)*4],n[h+1]=t[((i-a-1)*e+o)*4+1],n[h+2]=t[((i-a-1)*e+o)*4+2],n[h+3]=t[((i-a-1)*e+o)*4+3]}return new ImageData(n,e,i)},Yr=s=>{const{data:t,width:e,height:i}=s,n=new Uint8ClampedArray(t.length);for(let a=0;a<e;a++)for(let o=0;o<i;o++){const h=(a*i+o)*4;n[h]=t[(o*e+e-a-1)*4],n[h+1]=t[(o*e+e-a-1)*4+1],n[h+2]=t[(o*e+e-a-1)*4+2],n[h+3]=t[(o*e+e-a-1)*4+3]}return new ImageData(n,i,e)},Hr=s=>{const{data:t,width:e,height:i}=s,n=new Uint8ClampedArray(t.length);for(let a=0;a<e;a++)for(let o=0;o<i;o++){const h=(a*i+o)*4;n[h]=t[((i-o-1)*e+a)*4],n[h+1]=t[((i-o-1)*e+a)*4+1],n[h+2]=t[((i-o-1)*e+a)*4+2],n[h+3]=t[((i-o-1)*e+a)*4+3]}return new ImageData(n,i,e)},jr=s=>{const{data:t,width:e,height:i}=s,n=new Uint8ClampedArray(t.length);for(let a=0;a<i;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4,c=(t[h]+t[h+1]+t[h+2])/3;n[h]=c,n[h+1]=c,n[h+2]=c,n[h+3]=t[h+3]}return new ImageData(n,e,i)},qr=s=>{const{data:t,width:e,height:i}=s,n=new Uint8ClampedArray(t.length);for(let a=0;a<i;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4,c=.2126*t[h]+.7152*t[h+1]+.0722*t[h+2];n[h]=c,n[h+1]=c,n[h+2]=c,n[h+3]=t[h+3]}return new ImageData(n,e,i)},$r=s=>{const{data:t,width:e,height:i}=s,n=new Uint8ClampedArray(t.length);for(let a=0;a<i;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4,f=(t[h]+t[h+1]+t[h+2])/3>127?255:0;n[h]=f,n[h+1]=f,n[h+2]=f,n[h+3]=t[h+3]}return new ImageData(n,e,i)},Jr=s=>{const{data:t,width:e,height:i}=s,n=new Uint8ClampedArray(t.length);for(let a=0;a<i;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4;n[h]=255-t[h],n[h+1]=255-t[h+1],n[h+2]=255-t[h+2],n[h+3]=t[h+3]}return new ImageData(n,e,i)},Zr=s=>{const{data:t,width:e,height:i}=s,n=new Uint8ClampedArray(t.length);for(let a=0;a<i;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4;n[h]=t[h],n[h+1]=0,n[h+2]=0,n[h+3]=t[h+3]}return new ImageData(n,e,i)},Kr=s=>{const{data:t,width:e,height:i}=s,n=new Uint8ClampedArray(t.length);for(let a=0;a<i;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4;n[h]=0,n[h+1]=t[h+1],n[h+2]=0,n[h+3]=t[h+3]}return new ImageData(n,e,i)},Qr=s=>{const{data:t,width:e,height:i}=s,n=new Uint8ClampedArray(t.length);for(let a=0;a<i;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4;n[h]=0,n[h+1]=0,n[h+2]=t[h+2],n[h+3]=t[h+3]}return new ImageData(n,e,i)},ta=s=>{const{data:t,width:e,height:i}=s,n=new Uint8ClampedArray(t.length);for(let a=0;a<i;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4;n[h]=t[h],n[h+1]=t[h+1],n[h+2]=0,n[h+3]=t[h+3]}return new ImageData(n,e,i)},ea=s=>{const{data:t,width:e,height:i}=s,n=new Uint8ClampedArray(t.length);for(let a=0;a<i;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4;n[h]=t[h],n[h+1]=0,n[h+2]=t[h+1],n[h+3]=t[h+3]}return new ImageData(n,e,i)},ia=s=>{const{data:t,width:e,height:i}=s,n=new Uint8ClampedArray(t.length);for(let a=0;a<i;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4;n[h]=0,n[h+1]=t[h+1],n[h+2]=t[h+1],n[h+3]=t[h+3]}return new ImageData(n,e,i)},sa=s=>{const{data:t,width:e,height:i}=s,n=new Uint8ClampedArray(t.length);for(let a=0;a<i;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4,c=(t[h+1]+t[h+2])/2;n[h]=t[h],n[h+1]=c,n[h+2]=c,n[h+3]=t[h+3]}return new ImageData(n,e,i)},na=s=>{const{data:t,width:e,height:i}=s,n=new Uint8ClampedArray(t.length);for(let a=0;a<i;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4,c=(t[h]+t[h+2])/2;n[h]=c,n[h+1]=t[h+1],n[h+2]=c,n[h+3]=t[h+3]}return new ImageData(n,e,i)},ra=s=>{const{data:t,width:e,height:i}=s,n=new Uint8ClampedArray(t.length);for(let a=0;a<i;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4,c=(t[h]+t[h+1])/2;n[h]=c,n[h+1]=c,n[h+2]=t[h+2],n[h+3]=t[h+3]}return new ImageData(n,e,i)},aa=s=>vs(s,[-1,-1,-1,-1,9,-1,-1,-1,-1]),oa=s=>vs(s,[-1,-1,-1,-1,8,-1,-1,-1,-1]),ha=s=>{const{data:t,width:e,height:i}=s,n=new Uint8ClampedArray(t.length);for(let a=0;a<i;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4;n[h]=t[h],n[h+1]=t[h+1],n[h+2]=t[h+2],n[h+3]=255}return new ImageData(n,e,i)},ca=s=>{const{data:t,width:e,height:i}=s,n=new Uint8ClampedArray(t.length);for(let a=0;a<i;a++)for(let o=0;o<e;o++){const h=(a*e+o)*4;if(t[h+3]===0)n[h]=255,n[h+1]=255,n[h+2]=255,n[h+3]=255;else{const c=bs([t[h],t[h+1],t[h+2],t[h+3]],[255,255,255,255]);n[h]=c[0],n[h+1]=c[1],n[h+2]=c[2],n[h+3]=c[3]}}return new ImageData(n,e,i)},la=(s,t,e,i,n,r=!1,a)=>{const{data:o,width:h,height:c}=s;let f=n,m=i,w=t,p=e;if(f<0?f=0:f>h&&(f=h),m<0?m=0:m>c&&(m=c),w<1?w=1:w>h&&(w=h),p<1?p=1:p>c&&(p=c),f+w>h&&(w=h-f),m+p>c&&(p=c-m),r){const y=new Uint8ClampedArray(o.length);for(let b=0;b<c;b++)for(let C=0;C<h;C++){const _=(b*h+C)*4;C>=f&&C<=f+w&&b>=m&&b<=m+p?(y[_]=o[_],y[_+1]=o[_+1],y[_+2]=o[_+2],y[_+3]=o[_+3]):(y[_]=255,y[_+1]=255,y[_+2]=255,y[_+3]=a&&["JPG","JPEG"].includes(a.toUpperCase())?255:0)}return new ImageData(y,h,c)}else{const y=new Uint8ClampedArray(w*p*4);for(let b=m;b<=m+p;b++)for(let C=f;C<=f+w;C++){const _=((b-m)*w+C-f)*4,I=(b*h+C)*4;y[_]=o[I],y[_+1]=o[I+1],y[_+2]=o[I+2],y[_+3]=o[I+3]}return new ImageData(y,w,p)}},ua=(s,t,e,i)=>{const{data:n,width:r,height:a}=s;let o=t;o>Math.floor(r/2)&&(o=Math.floor(r/2)),o>Math.floor(a/2)&&(o=Math.floor(a/2)),o<0&&(o=0);const h=new Uint8ClampedArray(n.length);for(let f=0;f<a;f++)for(let m=0;m<r;m++){const w=(f*r+m)*4;let p=-1;m<o?f<o?p=Math.sqrt(Math.pow(o-m-1,2)+Math.pow(o-f-1,2)):f>a-o-1&&(p=Math.sqrt(Math.pow(o-m-1,2)+Math.pow(f-(a-o),2))):m>r-o-1&&(f<o?p=Math.sqrt(Math.pow(m-(r-o),2)+Math.pow(o-f-1,2)):f>a-o-1&&(p=Math.sqrt(Math.pow(m-(r-o),2)+Math.pow(f-(a-o),2)))),Math.round(p)>o?(h[w]=255,h[w+1]=255,h[w+2]=255,h[w+3]=i||e.toUpperCase()==="PNG"?0:255):(h[w]=n[w],h[w+1]=n[w+1],h[w+2]=n[w+2],h[w+3]=i||e.toUpperCase()==="PNG"?n[w+3]:255)}return new ImageData(h,r,a)},fa=(s,t,e,i,n,r=1e4)=>{const a=new Image;a.src=s;const o=document.createElement("canvas"),h=o.getContext("2d");return o.width=r,o.height=r,h.drawImage(a,0,0,t,e,0,0,i,n),h.getImageData(0,0,i,n)},da=(s,t)=>{const{data:e,width:i,height:n}=s,r=new Uint8ClampedArray(e.length);for(let o=0;o<n;o++)for(let h=0;h<i;h++){const c=(o*i+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,i,n)},ma=(s,t,e=!1)=>{const{data:i,width:n,height:r}=s,a=new Uint8ClampedArray(i.length);for(let h=0;h<r;h++)for(let c=0;c<n;c++){const f=(h*n+c)*4;i[f+3]===0?(a[f]=255,a[f+1]=255,a[f+2]=255):(a[f]=i[f],a[f+1]=i[f+1],a[f+2]=i[f+2]);let m=i[f+3];e?m=Math.max(Math.min(Math.floor(255*t),255),0):m=Math.max(Math.min(Math.floor(m+255*t),255),0),a[f+3]=m}return new ImageData(a,n,r)},ga=(s,t,e,i)=>{const{data:n,width:r,height:a}=s,{data:o,width:h,height:c}=t;let f=e,m=i;e+c>a&&(f=a-c),i+h>r&&(m=r-h);const w=new Uint8ClampedArray(n.length);for(let y=0;y<a;y++)for(let x=0;x<r;x++){const b=(y*r+x)*4;if(x<m||x>m+h||y<=f||y>=f+c)w[b]=n[b],w[b+1]=n[b+1],w[b+2]=n[b+2],w[b+3]=n[b+3];else{const C=(y*r+x-((f+1)*r+(y-(f+1))*(r-h))+h-m-1)*4,_=[o[C],o[C+1],o[C+2],o[C+3]],I=[n[b],n[b+1],n[b+2],n[b+3]],E=bs(_,I);w[b]=E[0],w[b+1]=E[1],w[b+2]=E[2],w[b+3]=E[3]}}return new ImageData(w,r,a)},pa=(s,t,e,i,n,r=10)=>{const{data:a,width:o,height:h}=s;let c=n,f=i,m=t,w=e;c<0?c=0:c>o&&(c=o),f<0?f=0:f>h&&(f=h),m<1?m=1:m>o&&(m=o),w<1?w=1:w>h&&(w=h),c+m>o&&(m=o-c),f+w>h&&(w=h-f);const p=new Uint8ClampedArray(a.length);for(let x=0;x<h;x++)for(let b=0;b<o;b++){const C=(x*o+b)*4;if(b>=c&&b<=c+m&&x>=f&&x<=f+w){const _=Math.floor((b-c)/r),I=Math.floor((x-f)/r);let E=Math.floor(r*(_+1)-r/2+c),L=Math.floor(r*(I+1)-r/2+f);E>o-1&&(E=o-1),L>h-1&&(L=h-1);const O=(L*o+E)*4;p[C]=a[O],p[C+1]=a[O+1],p[C+2]=a[O+2],p[C+3]=a[O+3]}else p[C]=a[C],p[C+1]=a[C+1],p[C+2]=a[C+2],p[C+3]=a[C+3]}return new ImageData(p,o,h)},wa=(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:i,width:n,height:r}=s,{data:a}=t,o=new Uint8ClampedArray(i.length),{backgroundColor:h,changeIntoColor:c}=e;for(let m=0;m<r;m++)for(let w=0;w<n;w++){const p=(m*n+w)*4,y=a[p],x=a[p+1],b=a[p+2],C=a[p+3];y===h.r&&x===h.g&&b===h.b&&C===h.a&&c.a!==0?(o[p]=c.r,o[p+1]=c.g,o[p+2]=c.b,o[p+3]=c.a):(o[p]=i[p],o[p+1]=i[p+1],o[p+2]=i[p+2],o[p+3]=i[p+3])}return new ImageData(o,n,r)}return s},vs=(s,t)=>{const{data:e,width:i,height:n}=s,r=new Uint8ClampedArray(e.length);for(let o=0;o<n;o++)for(let h=0;h<i;h++){const c=(o*i+h)*4;for(let f=0;f<3;f++){const m=c+f;h===0||h===i-1||o===0||o===n-1?r[m]=e[m]:r[m]=t[0]*e[m-i*4-4]+t[1]*e[m-i*4]+t[2]*e[m-i*4+4]+t[3]*e[m-4]+t[4]*e[m]+t[5]*e[m+4]+t[6]*e[m+i*4-4]+t[7]*e[m+i*4]+t[8]*e[m+i*4+4]}r[c+3]=e[c+3]}return new ImageData(r,i,n)},bs=(s,t)=>{if(s&&s.length===4&&t&&t.length===4){const e=s[3],i=t[3];if(e===255||i===0)return s;if(e===0)return t;{const n=e/255,r=i/255,a=Math.max(Math.min(Math.floor(s[0]*n+t[0]*r*(1-n)),255),0),o=Math.max(Math.min(Math.floor(s[1]*n+t[1]*r*(1-n)),255),0),h=Math.max(Math.min(Math.floor(s[2]*n+t[2]*r*(1-n)),255),0),c=Math.max(Math.min(Math.floor((n+r*(1-n))*255),255),0);return[a,o,h,c]}}return[255,255,255,255]},xs=function(s,t,e){const i=new Array(s*s),n=function(o){const h=o;let c=0,f=0;return{write(m,w){if(m>>>w)throw new Error("length over");for(;c+w>=8;)h.writeByte(255&(m<<c|f)),w-=8-c,m>>>=8-c,f=0,c=0;f=m<<c|f,c=c+w},flush(){c>0&&h.writeByte(f)}}},r=function(o){const h=1<<o,c=(1<<o)+1;let f=o+1;const m=a();for(let b=0;b<h;b++)m.add(String.fromCharCode(b));m.add(String.fromCharCode(h)),m.add(String.fromCharCode(c));const w=Fi(),p=n(w);p.write(h,f);let y=0,x=String.fromCharCode(i[y]);for(y+=1;y<i.length;){const b=String.fromCharCode(i[y]);y+=1,m.contains(x+b)?x=x+b:(p.write(m.indexOf(x),f),m.size()<4095&&(m.size()==1<<f&&(f+=1),m.add(x+b)),x=b)}return p.write(m.indexOf(x),f),p.write(c,f),p.flush(),w.toByteArray()},a=function(){const o={};let h=0;return{add(c){if(this.contains(c))throw new Error("dup key:"+c);o[c]=h,h+=1},size(){return h},indexOf(c){return o[c]},contains(c){return typeof o[c]<"u"}}};return{setPixel(o,h,c){i[h*s+o]=c},write(o){o.writeString("GIF87a"),o.writeShort(s),o.writeShort(s),o.writeByte(128),o.writeByte(0),o.writeByte(0),o.writeByte(Gt("0x"+t[1]+t[2])),o.writeByte(Gt("0x"+t[3]+t[4])),o.writeByte(Gt("0x"+t[5]+t[6])),o.writeByte(Gt("0x"+e[1]+e[2])),o.writeByte(Gt("0x"+e[3]+e[4])),o.writeByte(Gt("0x"+e[5]+e[6])),o.writeString(","),o.writeShort(0),o.writeShort(0),o.writeShort(s),o.writeShort(s),o.writeByte(0);const h=2,c=r(h);o.writeByte(h);let f=0;for(;c.length-f>255;)o.writeByte(255),o.writeBytes(c,f,255),f+=255;o.writeByte(c.length-f),o.writeBytes(c,f,c.length-f),o.writeByte(0),o.writeString(";")}}},Cs=function(s,t,e,i){const n=xs(s,t,e);for(let c=0;c<s;c++)for(let f=0;f<s;f++)n.setPixel(f,c,i(f,c));const r=Fi();n.write(r);const a=mn(),o=r.toByteArray();for(let c=0,f=o.length;c<f;c++)a.writeByte(o[c]);a.flush();let h="";return h+="data:image/gif;base64,",h+=a,h},et={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},Qt={M:0,L:1,H:2,Q:3},St={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},X={glog:function(s){if(s<1)throw new Error("glog("+s+")");return X.LOG_TABLE[s]},gexp:function(s){for(;s<0;)s+=255;for(;s>=256;)s-=255;return X.EXP_TABLE[s]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)};for(let s=0;s<8;s++)X.EXP_TABLE[s]=1<<s;for(let s=8;s<256;s++)X.EXP_TABLE[s]=X.EXP_TABLE[s-4]^X.EXP_TABLE[s-5]^X.EXP_TABLE[s-6]^X.EXP_TABLE[s-8];for(let s=0;s<255;s++)X.LOG_TABLE[X.EXP_TABLE[s]]=s;const G={PATTERN_POSITION_TABLE:[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],G15:1335,G18:7973,G15_MASK:21522,getBCHTypeInfo:function(s){let t=s<<10;for(;G.getBCHDigit(t)-G.getBCHDigit(G.G15)>=0;)t^=G.G15<<G.getBCHDigit(t)-G.getBCHDigit(G.G15);return(s<<10|t)^G.G15_MASK},getBCHTypeNumber:function(s){let t=s<<12;for(;G.getBCHDigit(t)-G.getBCHDigit(G.G18)>=0;)t^=G.G18<<G.getBCHDigit(t)-G.getBCHDigit(G.G18);return s<<12|t},getBCHDigit:function(s){let t=0;for(;s!=0;)t++,s>>>=1;return t},getPatternPosition:function(s){return G.PATTERN_POSITION_TABLE[s-1]},getMask:function(s,t,e){switch(s){case St.PATTERN000:return(t+e)%2==0;case St.PATTERN001:return t%2==0;case St.PATTERN010:return e%3==0;case St.PATTERN011:return(t+e)%3==0;case St.PATTERN100:return(Math.floor(t/2)+Math.floor(e/3))%2==0;case St.PATTERN101:return t*e%2+t*e%3==0;case St.PATTERN110:return(t*e%2+t*e%3)%2==0;case St.PATTERN111:return(t*e%3+(t+e)%2)%2==0;default:throw new Error("bad maskPattern:"+s)}},getErrorCorrectPolynomial:function(s){let t=new Ut([1],0);for(let e=0;e<s;e++)t=t.multiply(new Ut([1,X.gexp(e)],0));return t},getLengthInBits:function(s,t){if(1<=t&&t<10)switch(s){case et.MODE_NUMBER:return 10;case et.MODE_ALPHA_NUM:return 9;case et.MODE_8BIT_BYTE:return 8;case et.MODE_KANJI:return 8;default:throw new Error("mode:"+s)}else if(t<27)switch(s){case et.MODE_NUMBER:return 12;case et.MODE_ALPHA_NUM:return 11;case et.MODE_8BIT_BYTE:return 16;case et.MODE_KANJI:return 10;default:throw new Error("mode:"+s)}else if(t<41)switch(s){case et.MODE_NUMBER:return 14;case et.MODE_ALPHA_NUM:return 13;case et.MODE_8BIT_BYTE:return 16;case et.MODE_KANJI:return 12;default:throw new Error("mode:"+s)}else throw new Error("type:"+t)},getLostPoint:function(s){const t=s.getModuleCount();let e=0;for(let r=0;r<t;r++)for(let a=0;a<t;a++){let o=0;const h=s.isDark(r,a);for(let c=-1;c<=1;c++)if(!(r+c<0||t<=r+c))for(let f=-1;f<=1;f++)a+f<0||t<=a+f||c==0&&f==0||h==s.isDark(r+c,a+f)&&o++;o>5&&(e+=3+o-5)}for(let r=0;r<t-1;r++)for(let a=0;a<t-1;a++){let o=0;s.isDark(r,a)&&o++,s.isDark(r+1,a)&&o++,s.isDark(r,a+1)&&o++,s.isDark(r+1,a+1)&&o++,(o==0||o==4)&&(e+=3)}for(let r=0;r<t;r++)for(let a=0;a<t-6;a++)s.isDark(r,a)&&!s.isDark(r,a+1)&&s.isDark(r,a+2)&&s.isDark(r,a+3)&&s.isDark(r,a+4)&&!s.isDark(r,a+5)&&s.isDark(r,a+6)&&(e+=40);for(let r=0;r<t;r++)for(let a=0;a<t-6;a++)s.isDark(a,r)&&!s.isDark(a+1,r)&&s.isDark(a+2,r)&&s.isDark(a+3,r)&&s.isDark(a+4,r)&&!s.isDark(a+5,r)&&s.isDark(a+6,r)&&(e+=40);let i=0;for(let r=0;r<t;r++)for(let a=0;a<t;a++)s.isDark(a,r)&&i++;const n=Math.abs(100*i/t/t-50)/5;return e+=n*10,e}};class Ut{num;constructor(t,e){if(t.length==null)throw new Error(t.length+"/"+e);let i=0;for(;i<t.length&&t[i]==0;)i++;this.num=new Array(t.length-i+e);for(let n=0;n<t.length-i;n++)this.num[n]=t[n+i]}get(t){return this.num[t]}getLength(){return this.num.length}multiply(t){const e=new Array(this.getLength()+t.getLength()-1);for(let i=0;i<this.getLength();i++)for(let n=0;n<t.getLength();n++)e[i+n]^=X.gexp(X.glog(this.get(i))+X.glog(t.get(n)));return new Ut(e,0)}mod(t){if(this.getLength()-t.getLength()<0)return this;const e=X.glog(this.get(0))-X.glog(t.get(0)),i=new Array(this.getLength());for(let n=0;n<this.getLength();n++)i[n]=this.get(n);for(let n=0;n<t.getLength();n++)i[n]^=X.gexp(X.glog(t.get(n))+e);return new Ut(i,0).mod(t)}}class yt{totalCount;dataCount;constructor(t,e){this.totalCount=t,this.dataCount=e}static RS_BLOCK_TABLE=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]];static getRSBlocks(t,e){const i=yt.getRsBlockTable(t,e);if(i==null)throw new Error("bad rs block @ typeNumber:"+t+"/errorCorrectLevel:"+e);const n=i.length/3,r=[];for(let a=0;a<n;a++){const o=i[a*3+0],h=i[a*3+1],c=i[a*3+2];for(let f=0;f<o;f++)r.push(new yt(h,c))}return r}static getRsBlockTable(t,e){switch(e){case Qt.L:return yt.RS_BLOCK_TABLE[(t-1)*4+0];case Qt.M:return yt.RS_BLOCK_TABLE[(t-1)*4+1];case Qt.Q:return yt.RS_BLOCK_TABLE[(t-1)*4+2];case Qt.H:return yt.RS_BLOCK_TABLE[(t-1)*4+3];default:return}}}class Ts{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 i=0;i<e;i++)this.putBit((t>>>e-i-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 ya{mode;data;constructor(t){this.mode=et.MODE_8BIT_BYTE,this.data=t}getLength(){return this.data.length}write(t){for(let e=0,i=this.data.length;e<i;e++)t.put(this.data.charCodeAt(e),8)}}class Pt{static PAD0=236;static PAD1=17;typeNumber;errorCorrectLevel;modules;moduleCount;dataCache;dataList;constructor(t,e){this.typeNumber=t,this.errorCorrectLevel=Qt[e],this.modules=[],this.moduleCount=0,this.dataCache=null,this.dataList=[]}addData(t){const e=new ya(t);this.dataList.push(e),this.dataCache=null}isDark(t,e){if(t<0||this.moduleCount<=t||e<0||this.moduleCount<=e)throw new Error(t+","+e);return this.modules[t][e]}getModuleCount(){return this.moduleCount}make(){if(this.typeNumber<1){let t=1;for(t=1;t<40;t++){const e=yt.getRSBlocks(t,this.errorCorrectLevel),i=new Ts;let n=0;for(let r=0;r<e.length;r++)n+=e[r].dataCount;for(let r=0;r<this.dataList.length;r++){const a=this.dataList[r];i.put(a.mode,4),i.put(a.getLength(),G.getLengthInBits(a.mode,t)),a.write(i)}if(i.getLengthInBits()<=n*8)break}this.typeNumber=t}this.makeImpl(!1,this.getBestMaskPattern())}makeImpl(t,e){this.moduleCount=this.typeNumber*4+17,this.modules=new Array(this.moduleCount);for(let i=0;i<this.moduleCount;i++){this.modules[i]=new Array(this.moduleCount);for(let n=0;n<this.moduleCount;n++)this.modules[i][n]=null}this.setupPositionProbePattern(0,0),this.setupPositionProbePattern(this.moduleCount-7,0),this.setupPositionProbePattern(0,this.moduleCount-7),this.setupPositionAdjustPattern(),this.setupTimingPattern(),this.setupTypeInfo(t,e),this.typeNumber>=7&&this.setupTypeNumber(t),this.dataCache==null&&(this.dataCache=Pt.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,e)}setupPositionProbePattern(t,e){for(let i=-1;i<=7;i++)if(!(t+i<=-1||this.moduleCount<=t+i))for(let n=-1;n<=7;n++)e+n<=-1||this.moduleCount<=e+n||(0<=i&&i<=6&&(n==0||n==6)||0<=n&&n<=6&&(i==0||i==6)||2<=i&&i<=4&&2<=n&&n<=4?this.modules[t+i][e+n]=!0:this.modules[t+i][e+n]=!1)}getBestMaskPattern(){let t=0,e=0;for(let i=0;i<8;i++){this.makeImpl(!0,i);const n=G.getLostPoint(this);(i==0||t>n)&&(t=n,e=i)}return e}createMovieClip(t,e,i){const n=t.createEmptyMovieClip(e,i),r=1;this.make();for(let a=0;a<this.modules.length;a++){const o=a*r;for(let h=0;h<this.modules[a].length;h++){const c=h*r;this.modules[a][h]&&(n.beginFill(0,100),n.moveTo(c,o),n.lineTo(c+r,o),n.lineTo(c+r,o+r),n.lineTo(c,o+r),n.endFill())}}return n}setupTimingPattern(){for(let t=8;t<this.moduleCount-8;t++)this.modules[t][6]==null&&(this.modules[t][6]=t%2==0);for(let t=8;t<this.moduleCount-8;t++)this.modules[6][t]==null&&(this.modules[6][t]=t%2==0)}setupPositionAdjustPattern(){const t=G.getPatternPosition(this.typeNumber);for(let e=0;e<t.length;e++)for(let i=0;i<t.length;i++){const n=t[e],r=t[i];if(this.modules[n][r]==null)for(let a=-2;a<=2;a++)for(let o=-2;o<=2;o++)a==-2||a==2||o==-2||o==2||a==0&&o==0?this.modules[n+a][r+o]=!0:this.modules[n+a][r+o]=!1}}setupTypeNumber(t){const e=G.getBCHTypeNumber(this.typeNumber);for(let i=0;i<18;i++){const n=!t&&(e>>i&1)==1;this.modules[Math.floor(i/3)][i%3+this.moduleCount-8-3]=n}for(let i=0;i<18;i++){const n=!t&&(e>>i&1)==1;this.modules[i%3+this.moduleCount-8-3][Math.floor(i/3)]=n}}setupTypeInfo(t,e){const i=this.errorCorrectLevel<<3|e,n=G.getBCHTypeInfo(i);for(let r=0;r<15;r++){const a=!t&&(n>>r&1)==1;r<6?this.modules[r][8]=a:r<8?this.modules[r+1][8]=a:this.modules[this.moduleCount-15+r][8]=a}for(let r=0;r<15;r++){const a=!t&&(n>>r&1)==1;r<8?this.modules[8][this.moduleCount-r-1]=a:r<9?this.modules[8][15-r-1+1]=a:this.modules[8][15-r-1]=a}this.modules[this.moduleCount-8][8]=!t}mapData(t,e){let i=-1,n=this.moduleCount-1,r=7,a=0;for(let o=this.moduleCount-1;o>0;o-=2)for(o==6&&o--;;){for(let h=0;h<2;h++)if(this.modules[n][o-h]==null){let c=!1;a<t.length&&(c=(t[a]>>>r&1)==1),G.getMask(e,n,o-h)&&(c=!c),this.modules[n][o-h]=c,r--,r==-1&&(a++,r=7)}if(n+=i,n<0||this.moduleCount<=n){n-=i,i=-i;break}}}static createData(t,e,i){const n=yt.getRSBlocks(t,e),r=new Ts;for(let o=0;o<i.length;o++){const h=i[o];r.put(h.mode,4),r.put(h.getLength(),G.getLengthInBits(h.mode,t)),h.write(r)}let a=0;for(let o=0;o<n.length;o++)a+=n[o].dataCount;if(r.getLengthInBits()>a*8)throw new Error("code length overflow. ("+r.getLengthInBits()+">"+a*8+")");for(r.getLengthInBits()+4<=a*8&&r.put(0,4);r.getLengthInBits()%8!=0;)r.putBit(!1);for(;!(r.getLengthInBits()>=a*8||(r.put(Pt.PAD0,8),r.getLengthInBits()>=a*8));)r.put(Pt.PAD1,8);return Pt.createBytes(r,n)}static createBytes(t,e){let i=0,n=0,r=0;const a=new Array(e.length),o=new Array(e.length);for(let m=0;m<e.length;m++){const w=e[m].dataCount,p=e[m].totalCount-w;n=Math.max(n,w),r=Math.max(r,p),a[m]=new Array(w);for(let C=0;C<a[m].length;C++)a[m][C]=255&t.buffer[C+i];i+=w;const y=G.getErrorCorrectPolynomial(p),b=new Ut(a[m],y.getLength()-1).mod(y);o[m]=new Array(y.getLength()-1);for(let C=0;C<o[m].length;C++){const _=C+b.getLength()-o[m].length;o[m][C]=_>=0?b.get(_):0}}let h=0;for(let m=0;m<e.length;m++)h+=e[m].totalCount;const c=new Array(h);let f=0;for(let m=0;m<n;m++)for(let w=0;w<e.length;w++)m<a[w].length&&(c[f++]=a[w][m]);for(let m=0;m<r;m++)for(let w=0;w<e.length;w++)m<o[w].length&&(c[f++]=o[w][m]);return c}}const _s=Math.ceil,te=Math.floor,Ss=Math.round;function va(s,t){const e=Oi(s),i=t?.ecc||"H",n=t?.size||256,r=-1,a=t?.padding||0,o=t?.color||"#000000",h=t?.background||"#ffffff",c=new Pt(r,i);c.addData(e),c.make();const f=c.getModuleCount(),m=(n-a*2)/f,w=a,p=n-a;return Cs(n,o,h,function(y,x){if(w<=y&&y<p&&w<=x&&x<p){const b=te((y-w)/m),C=te((x-w)/m);return c.isDark(C,b)?0:1}else return 1})}function ba(s,t){const e=t.x||0,i=t.y||0,n=Oi(s),r=t.ctx,a=t.ecc||"H",o=typeof t.size=="number"?te(t.size):256,h=t.padding||0,c=-1,f=t.color||"#000000",m=t.background||"#ffffff",w=new Pt(c,a);w.addData(n),w.make();const p=w.getModuleCount(),y=(o-h*2)/p;r.fillStyle=m,r.fillRect(e,i,o,o);for(let x=0;x<p;x++)for(let b=0;b<p;b++){const C=_s((b+1)*y)-te(b*y),_=_s((x+1)*y)-te(x*y);r.fillStyle=w.isDark(x,b)?f:m,r.fillRect(e+Ss(b*y)+h,i+Ss(x*y)+h,C,_)}}function xa(s){return new Promise((t,e)=>{fetch(s).then(i=>i.text()).then(i=>{t(i)}).catch(i=>{e(i)})})}function ci(){let s=null;if(window.ActiveXObject){const t=["Microsoft.XMLHTTP","MSXML6.XMLHTTP","MSXML5.XMLHTTP","MSXML4.XMLHTTP","MSXML3.XMLHTTP","MSXML2.XMLHTTP","MSXML.XMLHTTP"];for(let e=0;e<t.length;e++)try{s=new window.ActiveXObject(t[e]);break}catch{continue}}else s=new XMLHttpRequest;return s}function Ca(s){if(!s.action)return{url:"",data:"",boundary:""};const t=s.method.toLowerCase()==="get",e=s.method.toLowerCase()==="post";let i=s.action,n="";const r="---------------------------"+Date.now().toString(16);if(window.FormData)n=new FormData(s),t&&(i=xe(i,ai(n)));else if(t){let a="";for(let o=0;o<s.elements.length;o++){const h=s.elements[o];if(!h.hasAttribute("name"))continue;const c=h.nodeName.toUpperCase()==="INPUT"?h.getAttribute("type")?.toUpperCase():"TEXT";if(c==="FILE")for(let f=0,m=h.files?.length??0;f<m;a+="&"+encodeURIComponent(h.name)+"="+encodeURIComponent(h.files?.[f++].name??""));else(c!=="RADIO"&&c!=="CHECKBOX"||h.checked)&&(a+="&"+encodeURIComponent(h.name)+"="+encodeURIComponent(h.value))}i=xe(i,a)}else if(e){const a=[];if(s.enctype==="application/x-www-form-urlencoded"){for(let o=0;o<s.elements.length;o++){const h=s.elements[o];h.hasAttribute("name")&&a.push(encodeURIComponent(h.name)+"="+encodeURIComponent(h.value))}n=a.join("&")}else if(s.enctype==="text/plain"){for(let o=0;o<s.elements.length;o++){const h=s.elements[o];h.hasAttribute("name")&&a.push(h.name+"="+h.value)}n=a.join(`\r
|
|
26
|
+
`)}else if(s.enctype==="multipart/form-data"){for(let o=0;o<s.elements.length;o++){const h=s.elements[o];if(!h.hasAttribute("name"))continue;if((h.nodeName.toUpperCase()==="INPUT"?h.getAttribute("type")?.toUpperCase():"TEXT")==="FILE")for(let f=0,m=h.files?.length??0;f<m;f++){const w=h.files?.[f];a.push('Content-Disposition: form-data; name="'+h.name+'"; filename="'+w?.name+`"\r
|
|
27
|
+
Content-Type: `+w?.type+`\r
|
|
32
28
|
\r
|
|
33
|
-
`)}else
|
|
29
|
+
`)}else a.push('Content-Disposition: form-data; name="'+h.name+`"\r
|
|
34
30
|
\r
|
|
35
31
|
`+h.value+`\r
|
|
36
|
-
`)}
|
|
37
|
-
`)}}return{url:
|
|
38
|
-
`+
|
|
39
|
-
`):g.send(JSON.stringify(s))):(g.open(x,r,!0),y(),g.send(JSON.stringify(s)))})}function Nh(i,t){const e=or();e.open("HEAD",i),e.filepath=i,e.callback=t,e.onload=function(){const n=parseFloat(window.localStorage.getItem("lm_"+this.filepath)??""),r=Date.parse(this.getResponseHeader("Last-Modified"));(isNaN(n)||r>n)&&(window.localStorage.setItem("lm_"+this.filepath,String(Date.now())),isFinite(n)&&this.callback(r,n))},e.send()}let oi;const Bs=new WeakMap;function hr(i,t){let e=Bs.get(i);e||(e=new Map,Bs.set(i,e));let n=e.get(t);return n||(n=new Fs,e.set(t,n)),n}class Fs{subscribers;constructor(){this.subscribers=new Set}depend(){oi&&this.subscribers.add(oi)}notify(){this.subscribers.forEach(t=>t())}}function Bh(i){oi=i,i(),oi=null}function Fh(i){return Object.keys(i).forEach(t=>{let e=i[t];const n=hr(i,t);Object.defineProperty(i,t,{get(){return n.depend(),e},set(r){r!=e&&(e=r,n.notify())}})}),i}function zh(i){return new Proxy(i,{get(t,e,n){return hr(i,e).depend(),Reflect.get(t,e,n)},set(t,e,n,r){const s=hr(i,e);return i[e]!=n&&(i[e]=n,s.notify()),Reflect.set(t,e,n,r)}})}class hi{x;y;z;constructor(t=[0,0,0],e=[0,0,0]){const[n,r,s]=t,[o,a,h]=e;this.x=n-o,this.y=r-a,this.z=s-h}get length(){const{x:t,y:e,z:n}=this;return Math.sqrt(t*t+e*e+n*n)}unit(){const t=this.length;return new hi([this.x/t,this.y/t,this.z/t])}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z}cross(t){const e=this.x,n=this.y,r=this.z,s=t.x,o=t.y,a=t.z;return new hi([n*a-r*o,r*s-e*a,e*o-s*n])}}(function(){let i=0;window.requestAnimationFrame||(window.requestAnimationFrame=function(t){const e=new Date().getTime(),n=Math.max(0,16-(e-i)),r=window.setTimeout(function(){t(e+n)},n);return i=e+n,r}),window.cancelAnimationFrame||(window.cancelAnimationFrame=function(t){clearTimeout(t)})})();const zs=i=>{let t=window.requestAnimationFrame(function e(n){t=window.requestAnimationFrame(e),i(n,t)});return()=>window.cancelAnimationFrame(t)};class Uh{id=0;renders={};cancelFn;constructor(){}get length(){let t=0;for(let e in this.renders)t++;return t}register(t){const e=this.id++;this.renders[e]=t,this.run()}run(){this.cancelFn||(this.cancelFn=zs((t,e)=>{const n=[];for(let r in this.renders)this.renders[r](t)===!1&&n.push(parseInt(r));for(let r of n)delete this.renders[r];!this.length&&this.cancelFn&&(this.cancelFn(),this.cancelFn=void 0)}))}}const ci=new Uh;let Bn;typeof self>"u"&&typeof process<"u"&&process.hrtime?Bn=function(){const i=process.hrtime();return i[0]*1e3+i[1]/1e6}:typeof self<"u"&&self.performance!==void 0&&self.performance.now!==void 0?Bn=self.performance.now.bind(self.performance):Date.now!==void 0?Bn=Date.now:Bn=function(){return new Date().getTime()};const pn=Bn;class Fn{static _nextId=0;static nextId(){return Fn._nextId++}}const li={Linear:{None:function(i){return i}},Ease:{In:function(i){return Math.pow(i,1.7)}},Quadratic:{In:function(i){return i*i},Out:function(i){return i*(2-i)},InOut:function(i){return(i*=2)<1?.5*i*i:-.5*(--i*(i-2)-1)}},Cubic:{In:function(i){return i*i*i},Out:function(i){return--i*i*i+1},InOut:function(i){return(i*=2)<1?.5*i*i*i:.5*((i-=2)*i*i+2)}},Quartic:{In:function(i){return i*i*i*i},Out:function(i){return 1- --i*i*i*i},InOut:function(i){return(i*=2)<1?.5*i*i*i*i:-.5*((i-=2)*i*i*i-2)}},Quintic:{In:function(i){return i*i*i*i*i},Out:function(i){return--i*i*i*i*i+1},InOut:function(i){return(i*=2)<1?.5*i*i*i*i*i:.5*((i-=2)*i*i*i*i+2)}},Sinusoidal:{In:function(i){return 1-Math.sin((1-i)*Math.PI/2)},Out:function(i){return Math.sin(i*Math.PI/2)},InOut:function(i){return .5*(1-Math.sin(Math.PI*(.5-i)))}},Exponential:{In:function(i){return i===0?0:Math.pow(1024,i-1)},Out:function(i){return i===1?1:1-Math.pow(2,-10*i)},InOut:function(i){return i===0?0:i===1?1:(i*=2)<1?.5*Math.pow(1024,i-1):.5*(-Math.pow(2,-10*(i-1))+2)}},Circular:{In:function(i){return 1-Math.sqrt(1-i*i)},Out:function(i){return Math.sqrt(1- --i*i)},InOut:function(i){return(i*=2)<1?-.5*(Math.sqrt(1-i*i)-1):.5*(Math.sqrt(1-(i-=2)*i)+1)}},Elastic:{In:function(i){return i===0?0:i===1?1:-Math.pow(2,10*(i-1))*Math.sin((i-1.1)*5*Math.PI)},Out:function(i){return i===0?0:i===1?1:Math.pow(2,-10*i)*Math.sin((i-.1)*5*Math.PI)+1},InOut:function(i){return i===0?0:i===1?1:(i*=2,i<1?-.5*Math.pow(2,10*(i-1))*Math.sin((i-1.1)*5*Math.PI):.5*Math.pow(2,-10*(i-1))*Math.sin((i-1.1)*5*Math.PI)+1)}},Back:{In:function(i){return i===1?1:i*i*((1.70158+1)*i-1.70158)},Out:function(i){return i===0?0:--i*i*((1.70158+1)*i+1.70158)+1},InOut:function(i){const t=2.5949095;return(i*=2)<1?.5*(i*i*((t+1)*i-t)):.5*((i-=2)*i*((t+1)*i+t)+2)}},Bounce:{In:function(i){return 1-li.Bounce.Out(1-i)},Out:function(i){return i<1/2.75?7.5625*i*i:i<2/2.75?7.5625*(i-=1.5/2.75)*i+.75:i<2.5/2.75?7.5625*(i-=2.25/2.75)*i+.9375:7.5625*(i-=2.625/2.75)*i+.984375},InOut:function(i){return i<.5?li.Bounce.In(i*2)*.5:li.Bounce.Out(i*2-1)*.5+.5}},generatePow:function(i=4){return i=i<Number.EPSILON?Number.EPSILON:i,i=i>1e4?1e4:i,{In:function(t){return t**i},Out:function(t){return 1-(1-t)**i},InOut:function(t){return t<.5?(t*2)**i/2:(1-(2-t*2)**i)/2+.5}}},random:function(i){return Math.random()},createStep:function(i){return function(t){return Math.floor(t*i)/i}},createNoisyEasing:function(i,t=.1){const e=1-t;return function(n){return t*Math.random()+e*i(n)}}},cr=li,zn={Utils:{Linear:function(i,t,e){return(t-i)*e+i},Factorial:function(){const i=[1];return function(t){let e=1;if(i[t])return i[t];for(let n=t;n>1;n--)e*=n;return i[t]=e,e}}(),Bernstein:function(i,t){const e=zn.Utils.Factorial;return e(i)/e(t)/e(i-t)},CatmullRom:function(i,t,e,n,r){const s=(e-i)*.5,o=(n-t)*.5,a=r*r,h=r*a;return(2*t-2*e+s+o)*h+(-3*t+3*e-2*s-o)*a+s*r+t}},Linear:function(i,t){const e=i.length-1,n=e*t,r=Math.floor(n),s=zn.Utils.Linear;return t<0?s(i[0],i[1],n):t>1?s(i[e],i[e-1],e-n):s(i[r],i[r+1>e?e:r+1],n-r)},Bezier:function(i,t){let e=0;const n=i.length-1,r=Math.pow,s=zn.Utils.Bernstein;for(let o=0;o<=n;o++)e+=r(1-t,n-o)*r(t,o)*i[o]*s(n,o);return e},CatmullRom:function(i,t){const e=i.length-1;let n=e*t,r=Math.floor(n);const s=zn.Utils.CatmullRom;return i[0]===i[e]?(t<0&&(r=Math.floor(n=e*(1+t))),s(i[(r-1+e)%e],i[r],i[(r+1)%e],i[(r+2)%e],n-r)):t<0?i[0]-(s(i[0],i[0],i[1],i[1],-n)-i[0]):t>1?i[e]-(s(i[e],i[e],i[e-1],i[e-1],n-e)-i[e]):s(i[r?r-1:0],i[r],i[e<r+1?e:r+1],i[e<r+2?e:r+2],n-r)}},lr=zn;class Us{_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=pn(),e=!1){let n=Object.keys(this._tweens);if(n.length===0)return!1;for(;n.length>0;){this._tweensAddedDuringUpdate={};for(let r=0;r<n.length;r++){const s=this._tweens[n[r]],o=!e;s&&s.update(t,o)===!1&&!e&&delete this._tweens[n[r]]}n=Object.keys(this._tweensAddedDuringUpdate)}return!0}}const oe=new Us;class Gs{constructor(t,e=oe){this._object=t,this._group=e}_id=Fn.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=cr.Linear.None;_interpolationFunction=lr.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=pn()){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,r){for(const s in n){const o=t[s],a=Array.isArray(o),h=a?"array":typeof o,m=!a&&Array.isArray(n[s]);if(!(h==="undefined"||h==="function")){if(m){let g=n[s];if(g.length===0)continue;g=g.map(this._handleRelativeValue.bind(this,o)),n[s]=[o].concat(g)}if((h==="object"||a)&&o&&!m){e[s]=a?[]:{};for(const g in o)e[s][g]=o[g];r[s]=a?[]:{},this._setupProperties(o,e[s],n[s],r[s])}else typeof e[s]>"u"&&(e[s]=o),a||(e[s]*=1),m?r[s]=n[s].slice().reverse():r[s]=e[s]||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=pn()){return this._isPaused||!this._isPlaying?this:(this._isPaused=!0,this._pauseStartTime=t,this._group&&this._group.remove(this),this)}resume(t=pn()){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=oe){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=cr.Linear.None){return this._easingFunction=t,this}interpolation(t=lr.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=pn(),e=!0){if(this._isPaused)return!0;let n,r;const s=this._startTime+this._durationTime;if(!this._goToEnd&&!this._isPlaying){if(t>s)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),r=(t-this._startTime)/this._durationTime,r=this._durationTime===0||r>1?1:r;const o=this._easingFunction(r);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,o),this._onUpdateCallback&&this._onUpdateCallback(this._object,r),r===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,r){for(const s in n){if(e[s]===void 0)continue;const o=e[s]||0;let a=n[s];const h=Array.isArray(t[s]),m=Array.isArray(a);!h&&m?t[s]=this._interpolationFunction(a,r):typeof a=="object"&&a?this._updateProperties(t[s],o,a,r):(a=this._handleRelativeValue(o,a),typeof a=="number"&&(t[s]=o+(a-o)*r))}}_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 Gh=Fn.nextId,Vh=oe.getAll.bind(oe),jh=oe.removeAll.bind(oe),Xh=oe.add.bind(oe),Hh=oe.remove.bind(oe),Wh=oe.update.bind(oe),ui={now:pn,Sequence:Fn,Easing:cr,Interpolation:lr,Group:Us,Tween:Gs,nextId:Gh,getAll:Vh,removeAll:jh,add:Xh,remove:Hh,update:Wh};function Vs(i){switch(i){case"linear":return[0,0,1,1];case"ease":return[.25,.1,.25,1];case"ease-in":return[.42,0,1,1];case"ease-in-out":return[.42,0,.58,1];case"ease-out":return[0,0,.58,1]}}const Yh={attributeName:["display"],values:[["block","block"]]},Kt={easeName:"linear",begin:0,dur:300,repeatCount:1,direction:"normal",fill:"freeze",keyTimes:[0,1]};class Ve{currentAnimateName;objects=[];actions=[];constructor(){}hasObjects(){return this.objects.length>0}fromDOM(t){return Array.isArray(t)||(t=[t]),this.objects=[],t.forEach(e=>{const n=tr(e);this.objects.push({width:parseFloat(n.css("width")),height:parseFloat(n.css("height")),dom:n,el:e,originCSSObject:n.css()})}),this}toCSS(t,...e){if(!this.hasObjects())return;switch(this.currentAnimateName=t,this[t](...e),this.objects[0].dom?.parent().css({position:"relative",perspective:"1000px",overflow:"hidden"}),t){default:this.objects.forEach((s,o)=>{s.dom?.css({position:"absolute","z-index":String(1e3+o),"transform-style":"preserve-3d","backface-visibility":"hidden"})});break}let n=0;const r=()=>{this.actions.forEach((s,o)=>{const a=this.objects[s.objectIndex];let h=[],m=[];Array.isArray(s.attributeName)?(h=s.attributeName,m=s.values):s.attributeName&&(h=[s.attributeName],m=[s.values]);const g=s.keyTimes.length,x=un(a.dom?.css("transform")??"");let y=s.begin;s.keyTimes.forEach((w,k)=>{const P={_matrix:x};h.forEach((D,N)=>{const R=m[N][s.direction=="reverse"?g-k-1:k];Ve.setCSSObjectTransformUseMatrix(D,R,P)}),k==0?a.dom?.css(Object.assign(P,{transition:""})):(setTimeout(()=>{a.dom?.css(Object.assign(P,{transition:`all ${s.realKeyTimes[k]}ms cubic-bezier(${s.keySplines[k-1].join(",")})`}))},y),y+=s.realKeyTimes[k])}),setTimeout(()=>{s.fill==="remove"&&a.dom?.css(a.originCSSObject??{}),o==this.actions.length-1&&(typeof s.repeatCount=="number"&&++n<s.repeatCount||s.repeatCount=="infinite")&&requestAnimationFrame(()=>{this.currentAnimateName===t&&r()})},s.begin+s.dur)})};r()}static isRunningGlobalTween=!1;static runGlobalTween(t){Ve.isRunningGlobalTween||ci.register(()=>(Ve.isRunningGlobalTween=ui.update(t?.()),Ve.isRunningGlobalTween))}static toTween(t,e,n){const r=n?.onUpdate??(()=>{}),s=n?.onStart??(()=>{}),o=n?.onComplete??(()=>{}),a=n?.duration??1e3,h=n?.delay??0,m=n?.easeFunction??ui.Easing.Linear.None,g=n?.repeat??0,x=n?.yoyo??!1,y=new ui.Tween(t).to(e,a).delay(h).easing(m).repeat(g).yoyo(x).onStart(s).onUpdate(function(w,k){r(w,k)}).onComplete(o);return n?.interpolationFunction&&y.interpolation(n.interpolationFunction),{tween:y,startAuto:w=>{y.start(w?.()),ci.register(()=>{const k=y.update(w?.());if(n?.precision){let P=!0;for(let D in t)Si(t[D],e[D],n.precision)||(P=!1);return P?!1:k}return k})}}}static toTweenCSS(t,e,n,r){const s=tr(t);s?.parent().css({overflow:"hidden","transform-style":"preserve-3d",perspective:"1000px","backface-visibility":"hidden"});const o={_matrix:un(s?.css("transform")??"")},a=r?.onUpdate??(()=>{});return Ve.toTween(e,n,Object.assign(r??{},{onUpdate:(h,m)=>{for(let g in h)Ve.setCSSObjectTransformUseMatrix(g,h[g],o);t.style.transform=o.transform,a(h,m)}}))}static setCSSObjectTransformUseMatrix(t,e,n={}){switch(t){case"translate":n._matrix.translate(e[0]??0,e[1]??0);break;case"translateTo":n._matrix.translateTo(e[0]??0,e[1]??0);break;case"translateX":n._matrix.translateX(e??0);break;case"translateXTo":n._matrix.translateXTo(e??0);break;case"translateY":n._matrix.translateY(e??0);break;case"translateYTo":n._matrix.translateYTo(e??0);break;case"translateZ":n._matrix.translateZ(e??0);break;case"translateZTo":n._matrix.translateZTo(e??0);break;case"translate3d":n._matrix.translate3d(e[0]??0,e[1]??0,e[2]??0);break;case"translate3dTo":n._matrix.translate3dTo(e[0]??0,e[1]??0,e[2]??0);break;case"rotate":typeof e=="number"?n._matrix.rotate(e??0):n._matrix.rotate(e[0]??0,e[1]??0,e[2]??0);break;case"rotateTo":typeof e=="number"?n._matrix.rotateTo(e??0):n._matrix.rotateTo(e[0]??0,e[1]??0,e[2]??0);break;case"rotateX":n._matrix.rotateX(e??0);break;case"rotateXTo":n._matrix.rotateXTo(e??0);break;case"rotateY":n._matrix.rotateY(e??0);break;case"rotateYTo":n._matrix.rotateYTo(e??0);break;case"rotateZ":n._matrix.rotateZ(e??0);break;case"rotateZTo":n._matrix.rotateZTo(e??0);break;case"rotate3d":n._matrix.rotate3d(e[0]??0,e[1]??0,e[2]??0);break;case"rotate3dTo":n._matrix.rotate3dTo(e[0]??0,e[1]??0,e[2]??0);break;case"scale":typeof e=="number"?n._matrix.scale(e??1):n._matrix.scale(e[0]??1,e[1]??1,e[2]??0,e[3]??0);break;case"scaleTo":typeof e=="number"?n._matrix.scaleTo(e??1):n._matrix.scaleTo(e[0]??1,e[1]??1,e[2]??0,e[3]??0);break;case"scaleX":n._matrix.scaleX(e??1);break;case"scaleXTo":n._matrix.scaleXTo(e??1);break;case"scaleY":n._matrix.scaleY(e??1);break;case"scaleYTo":n._matrix.scaleYTo(e??1);break;case"scaleZ":n._matrix.scaleZ(e??1);break;case"scaleZTo":n._matrix.scaleZTo(e??1);break;case"scale3d":n._matrix.scale3d(e??1);break;case"scale3dTo":n._matrix.scale3dTo(e??1);break;case"skew":typeof e=="number"?n._matrix.skew(e??0):n._matrix.skew(e[0]??0,e[1]??0);break;case"skewTo":typeof e=="number"?n._matrix.skewTo(e??0):n._matrix.skewTo(e[0]??0,e[1]??0);break;case"skewX":n._matrix.skewX(e??0);break;case"skewXTo":n._matrix.skewXTo(e??1);break;case"skewY":n._matrix.skewY(e??0);break;case"skewYTo":n._matrix.skewYTo(e??1);break;case"skewZ":case"skewZTo":case"skew3d":case"skew3dTo":break;default:Object.assign(n,{[t]:`${e??""}`});break}return Object.assign(n,{transform:n._matrix.toString()}),n}_addAction(t,e=!1){return this.actions=e?[]:this.actions,Array.isArray(t)||(t=[t]),t.forEach(n=>{this.actions.push(Object.assign(n,{realKeyTimes:n.keyTimes.map(r=>n.dur*r)}))}),this}_addAnimate(t=Yh,e=Kt,n=0,r=!1){const s=e.keyTimes??[0,1],o=[];return s.forEach((a,h)=>{h>0&&o.push(Vs(e.easeName??"linear"))}),this._addAction({objectIndex:n,attributeName:t.attributeName,values:t.values,begin:e.begin??0,dur:e.dur??300,keyTimes:s,keySplines:o,repeatCount:e.repeatCount??1,direction:e.direction??"normal",fill:e.fill??"freeze"},r),this}_predefinedAnimate(t,e,n,r,s=Kt,o=this.objects.length-1){let a=!0,h=!1,m=!1,g=!1;const x=this.objects.length;o=(o+x)%x;const y=(o-1+x)%x,w=(o+1+x)%x,k=this.objects[o],P=this.objects[y],D=this.objects[w];if(P&&y!==o){const N=t(P);N&&(this._addAnimate(N,s,y,a),a=!1,h=!0)}if(k){const N=e(k);N&&(this._addAnimate(N,s,o,a),a=!1,m=!0)}if(D&&w!==o){const N=n(D);N&&(this._addAnimate(N,s,w,a),a=!1,g=!0)}this.objects.forEach((N,R)=>{if(!(R==y&&h||R==o&&m||R==w&&g)){const O=r(N);O&&(this._addAnimate(O,s,R,a),a=!1)}})}flip(t=Kt,e=this.objects.length-1){const n=e-1,r=this.objects[n],s=this.objects[e],o=un(s.dom?.css("transform")??""),a=o.clone();r.dom?.show(),r.dom?.css("opacity","1");const h=r.el?.getBoundingClientRect();r.dom?.css("opacity","0"),s.dom?.show(),s.dom?.css("opacity","1");const m=s.el?.getBoundingClientRect(),g=r.dom?.css("background-color"),x=s.dom?.css("background-color");a.translate((h?.left??0)-(m?.left??0),(h?.top??0)-(m?.top??0)),a.scale((h?.width??1)/(m?.width??1),(h?.height??1)/(m?.height??1));const y={transform:a.toString(),transition:""};g&&Object.assign(y,{"background-color":g}),s.dom?.css(y);const w={transform:o.toString(),transition:`all ${t.dur}ms cubic-bezier(${Vs(t.easeName??"linear").join(",")})`};x&&Object.assign(w,{"background-color":x}),setTimeout(()=>{s.dom?.css(w)},t.begin)}slideLeft(t=Kt,e=this.objects.length-1){this._predefinedAnimate(n=>({attributeName:["translateTo"],values:[[[0,0],[-n.width,0]]]}),n=>({attributeName:["opacity","translateTo"],values:[[1,1],[[n.width,0],[0,0]]]}),n=>{},n=>({attributeName:["translateTo"],values:[[[-n.width,0],[-n.width,0]]]}),t,e)}slideRight(t=Kt,e=this.objects.length-1){this._predefinedAnimate(n=>{},n=>({attributeName:["opacity","translateTo"],values:[[1,1],[[-n.width,0],[0,0]]]}),n=>({attributeName:["translateTo"],values:[[[0,0],[n.width,0]]]}),n=>({attributeName:["translateTo"],values:[[[n.width,0],[n.width,0]]]}),t,e)}slideDown(t=Kt,e=this.objects.length-1){this._predefinedAnimate(n=>({attributeName:["translateTo"],values:[[[0,0],[0,n.height]]]}),n=>({attributeName:["opacity","translateTo"],values:[[1,1],[[0,-n.height],[0,0]]]}),n=>{},n=>({attributeName:["translateTo"],values:[[[0,n.height],[0,n.height]]]}),t,e)}slideUp(t=Kt,e=this.objects.length-1){this._predefinedAnimate(n=>({attributeName:["translateTo"],values:[[[0,0],[0,-n.height]]]}),n=>({attributeName:["opacity","translateTo"],values:[[1,1],[[0,n.height],[0,0]]]}),n=>{},n=>({attributeName:["translateTo"],values:[[[0,-n.height],[0,-n.height]]]}),t,e)}flipLeft(t=Kt,e=this.objects.length-1){this._predefinedAnimate(n=>({attributeName:["opacity","rotateYTo"],values:[[1,1],[0,180]]}),n=>({attributeName:["opacity","rotateYTo"],values:[[1,1],[-180,0]]}),n=>{},n=>({attributeName:["opacity"],values:[[0,0]]}),t,e)}flipRight(t=Kt,e=this.objects.length-1){this._predefinedAnimate(n=>({attributeName:["opacity","rotateYTo"],values:[[1,1],[0,-180]]}),n=>({attributeName:["opacity","rotateYTo"],values:[[1,1],[180,0]]}),n=>{},n=>({attributeName:["opacity"],values:[[0,0]]}),t,e)}flipDown(t=Kt,e=this.objects.length-1){this._predefinedAnimate(n=>({attributeName:["opacity","rotateXTo"],values:[[1,1],[0,-180]]}),n=>({attributeName:["opacity","rotateXTo"],values:[[1,1],[180,0]]}),n=>{},n=>({attributeName:["opacity"],values:[[0,0]]}),t,e)}flipUp(t=Kt,e=this.objects.length-1){this._predefinedAnimate(n=>({attributeName:["opacity","rotateXTo"],values:[[1,1],[0,180]]}),n=>({attributeName:["opacity","rotateXTo"],values:[[1,1],[-180,0]]}),n=>{},n=>({attributeName:["opacity"],values:[[0,0]]}),t,e)}popIn(t=Kt,e=this.objects.length-1){this._predefinedAnimate(n=>{},n=>({attributeName:["translateTo","scaleTo","opacity"],values:[[[0,0],[0,0]],[.8,1],[0,1]]}),n=>{},n=>({attributeName:["opacity"],values:[[0,0]]}),t,e)}popOut(t=Kt,e=this.objects.length-1){this._predefinedAnimate(n=>{},n=>({attributeName:["translateTo","scaleTo","opacity"],values:[[[0,0],[0,0]],[1,1.2],[1,0]]}),n=>{},n=>({attributeName:["opacity"],values:[[0,0]]}),t,e)}rotate(t=Kt,e=this.objects.length-1){Object.assign(t,{keyTimes:[0,1]});const n=t.degree??360;this._predefinedAnimate(r=>{},r=>({attributeName:["opacity","rotate"],values:[[1,1],[0,n]]}),r=>{},r=>({attributeName:["opacity"],values:[[0,0]]}),t,e)}}class Qe extends fe{app;rotate;scale;isMouseDownInBounds=!1;removeCaptureMove;constructor(t,e){super({x:0,y:0,...e}),this.rotate=e?.rotate??0,this.scale=e?.scale??1,this.app=t,this.removeCaptureMove=this.app.captureMove({start:n=>{this.isMouseDownInBounds=this.app.ctx?.isPointInPath(this.app.mousePoint.x,this.app.mousePoint.y)||this.getBoundRect().isContainPoint(this.app.mousePoint)},end:n=>{this.isMouseDownInBounds=!1},move:n=>{}})}destroy(){this.removeCaptureMove()}draw(t){if(this.app.ctx){if(this.app.ctx.save(),t?.followMouseMove&&(!Si(this.x,this.app.mousePoint.x,5)||!Si(this.y,this.app.mousePoint.y,5))&&(this.rotate=this.angleTo(this.app.mousePoint),this.followTo(this.app.mousePoint)),t?.dragMouseMove){if(this.app.container.style.cursor="grab",this.isMouseDownInBounds){this.app.container.style.cursor="grabbing",this.x=this.app.mousePoint.x,this.y=this.app.mousePoint.y;const e=this.getBoundRect();e.width&&e.height&&!this.radius&&(this.x-=this.getBoundRect().width/2,this.y-=this.getBoundRect().height/2)}}else this.app.container.style.cursor="default";t?.dragFreeEaseTo&&(this.isMouseDownInBounds||this.nextFrameEaseTo(new fe({x:t.dragFreeEaseTo.targetX,y:t.dragFreeEaseTo.targetY}),{easing:t.dragFreeEaseTo?.easing??.05})),t?.extra?.(),this.app.ctx?.translate(this.x,this.y),this.app.ctx?.rotate(this.rotate),this.app.ctx?.scale(this.scale,this.scale),t?.shape(),this.app.ctx.lineWidth>0&&this.app.ctx.stroke(),this.app.ctx?.restore()}}}class qh extends Qe{constructor(t,e){super(t,e)}draw(t){super.draw({...t,extra:()=>{this.app.ctx&&(this.app.ctx.lineWidth=2,this.app.ctx.fillStyle="#ffff00",t?.extra?.())},shape:()=>{this.app.ctx&&(this.app.ctx.beginPath(),this.app.ctx.moveTo(-50,-25),this.app.ctx.lineTo(0,-25),this.app.ctx.lineTo(0,-50),this.app.ctx.lineTo(50,0),this.app.ctx.lineTo(0,50),this.app.ctx.lineTo(0,25),this.app.ctx.lineTo(-50,25),this.app.ctx.lineTo(-50,-25),this.app.ctx.closePath(),this.app.ctx.fill())}})}}class $h extends Qe{radius;constructor(t,e){super(t,e),this.radius=e?.radius??40}draw(t){super.draw({...t,extra:()=>{this.app.ctx&&(this.app.ctx.lineWidth=1,this.app.ctx.fillStyle="#ff0000",t?.extra?.())},shape:()=>{this.app.ctx&&(this.app.ctx.beginPath(),this.app.ctx.arc(0,0,this.radius,0,Math.PI*2,!0),this.app.ctx.closePath(),this.app.ctx.fill())}})}}class Jh extends Qe{toX;toY;c1x;c1y;c2x;c2y;constructor(t,e){super(t,e),this.toX=e?.toX??0,this.toY=e?.toY??0,this.c1x=e?.c1x??0,this.c1y=e?.c1y??0,this.c2x=e?.c2x??0,this.c2y=e?.c2y??0}getBoundRect(){if(this.rotate===0){const t=Math.min(this.x,this.toX),e=Math.min(this.y,this.toY),n=Math.max(this.x,this.toX),r=Math.max(this.y,this.toY);return new ln({x:t,y:e,width:n-t,height:r-e})}else{const t=Math.sin(this.rotate),e=Math.cos(this.rotate),n=e*this.x-t*this.y,r=e*this.toX-t*this.toY,s=e*this.y+t*this.x,o=e*this.toY+t*this.toX;return new ln({x:Math.min(n,r),y:Math.min(s,o),width:Math.max(n,r)-Math.min(n,r),height:Math.max(s,o)-Math.min(s,o)})}}draw(t){super.draw({...t,extra:()=>{this.app.ctx&&(this.app.ctx.lineWidth=1,this.app.ctx.strokeStyle="#eeeeee",t?.extra?.())},shape:()=>{this.app.ctx&&(this.app.ctx.beginPath(),this.app.ctx.moveTo(0,0),this.app.ctx.lineTo(this.toX-this.x,this.toY-this.y))}})}drawQuadratic(t){super.draw({...t,extra:()=>{this.app.ctx&&(this.app.ctx.lineWidth=1,this.app.ctx.strokeStyle="#eeeeee",t?.extra?.())},shape:()=>{this.app.ctx&&(this.app.ctx.beginPath(),this.app.ctx.moveTo(0,0),this.app.ctx.quadraticCurveTo(this.c1x-this.x,this.c1y-this.y,this.toX-this.x,this.toY-this.y))}})}drawQuadraticThrough(t){super.draw({...t,extra:()=>{this.app.ctx&&(this.app.ctx.lineWidth=1,this.app.ctx.strokeStyle="#eeeeee",t?.extra?.())},shape:()=>{if(!this.app.ctx)return;this.app.ctx.beginPath(),this.app.ctx.moveTo(0,0);const e=this.c1x*2-(this.x+this.toX)/2,n=this.c1y*2-(this.y+this.toY)/2;this.app.ctx.quadraticCurveTo(e-this.x,n-this.y,this.toX-this.x,this.toY-this.y)}})}drawQuadraticThroughCurve(t,e){super.draw({...e,extra:()=>{this.app.ctx&&(this.app.ctx.lineWidth=1,this.app.ctx.strokeStyle="#eeeeee",e?.extra?.())},shape:()=>{if(!this.app.ctx)return;const n=t.length;if(n<3)return new Error("points length must >= 3");const r=(t[0].x+t[n-1].x)/2,s=(t[0].y+t[n-1].y)/2;this.app.ctx.beginPath(),this.app.ctx.moveTo(r,s);let o=0;for(;o<n-1;o++){const a=(t[o].x+t[o+1].x)/2,h=(t[o].y+t[o+1].y)/2;this.app.ctx.quadraticCurveTo(t[o].x-this.x,t[o].y-this.y,a-this.x,h-this.y)}this.app.ctx.quadraticCurveTo(t[o].x-this.x,t[o].y-this.y,r-this.x,s-this.y)}})}drawQuadraticThroughCurveNotGood(t,e){super.draw({...e,extra:()=>{this.app.ctx&&(this.app.ctx.lineWidth=1,this.app.ctx.strokeStyle="#eeeeee",e?.extra?.())},shape:()=>{if(!this.app.ctx)return;const n=t.length;if(n<3)return new Error("points length must >= 3");this.app.ctx.beginPath(),this.app.ctx.moveTo(t[0].x,t[0].y);let r=1;for(;r<n-2;r++){const s=(t[r].x+t[r+1].x)/2,o=(t[r].y+t[r+1].y)/2;this.app.ctx.quadraticCurveTo(t[r].x-this.x,t[r].y-this.y,s-this.x,o-this.y)}this.app.ctx.quadraticCurveTo(t[r].x-this.x,t[r].y-this.y,t[r+1].x-this.x,t[r+1].y-this.y)}})}}class Zh extends Qe{width;height;borderRadius;rect;constructor(t,e){return super(t,e),this.width=e?.width??50,this.height=e?.height??50,this.borderRadius=e?.borderRadius??0,this.rect=new ln({x:this.x,y:this.y,width:this.width,height:this.height}),new Proxy(this,{get:(r,s,o)=>Reflect.get(r,s,o),set:(r,s,o,a)=>{switch(s){case"x":case"y":case"width":case"height":this.rect[s]=o;break}return Reflect.set(r,s,o,a)}})}getBoundRect(){return this.rect}draw(t){super.draw({...t,extra:()=>{this.app.ctx&&(this.app.ctx.lineWidth=1,this.app.ctx.fillStyle="#ff0000",t?.extra?.())},shape:()=>{this.app.ctx&&(this.app.ctx.beginPath(),this.borderRadius<=0?this.app.ctx.rect(0,0,this.width,this.height):(this.app.ctx.moveTo(0,0+this.borderRadius),this.app.ctx.lineTo(0,0+this.height-this.borderRadius),this.app.ctx.quadraticCurveTo(0,0+this.height,0+this.borderRadius,0+this.height),this.app.ctx.lineTo(0+this.width-this.borderRadius,0+this.height),this.app.ctx.quadraticCurveTo(0+this.width,0+this.height,0+this.width,0+this.height-this.borderRadius),this.app.ctx.lineTo(0+this.width,0+this.borderRadius),this.app.ctx.quadraticCurveTo(0+this.width,0,0+this.width-this.borderRadius,0),this.app.ctx.lineTo(0+this.borderRadius,0),this.app.ctx.quadraticCurveTo(0,0,0,0+this.borderRadius)),this.app.ctx.closePath(),this.app.ctx.fill())}})}}class Kh extends Qe{constructor(t,e){super(t,e)}draw(t){super.draw({...t,extra:()=>{this.app.ctx&&(this.app.ctx.lineWidth=0,this.app.ctx.fillStyle="rgb(200,80,80)",t?.extra?.())},shape:()=>{this.app.ctx&&(this.app.ctx.beginPath(),this.app.ctx.moveTo(4,24),this.app.ctx.lineTo(8,16),this.app.ctx.lineTo(14,10),this.app.ctx.lineTo(15,0),this.app.ctx.lineTo(9,-10),this.app.ctx.lineTo(2,0),this.app.ctx.lineTo(-2,0),this.app.ctx.lineTo(-9,-10),this.app.ctx.lineTo(-15,0),this.app.ctx.lineTo(-14,10),this.app.ctx.lineTo(-8,16),this.app.ctx.lineTo(-4,24),this.app.ctx.closePath(),this.app.ctx.fill())}})}}class Qh extends Qe{constructor(t,e){super(t,e)}draw(t){super.draw({...t,extra:()=>{this.app.ctx&&(this.app.ctx.lineWidth=0,this.app.ctx.fillStyle="rgb(150,150,150)",t?.extra?.())},shape:()=>{this.app.ctx&&(this.app.ctx.beginPath(),this.app.ctx.moveTo(0,0),this.app.ctx.bezierCurveTo(15,0,15,-40,5,-30),this.app.ctx.lineTo(0,0),this.app.ctx.bezierCurveTo(-15,0,-15,-40,-5,-30),this.app.ctx.lineTo(0,0),this.app.ctx.fill(),this.app.ctx.beginPath(),this.app.ctx.arc(0,0,15,0,Math.PI*2,!0),this.app.ctx.fill())}})}}class tc extends Qe{width;height;fillColor;constructor(t,e){super(t,e),this.width=e?.width??50,this.height=e?.height??50,this.fillColor=e?.fillColor??"#ff0000"}draw(t){super.draw({...t,extra:()=>{this.app.ctx&&(this.app.ctx.lineWidth=0,this.app.ctx.fillStyle=this.fillColor,t?.extra?.())},shape:()=>{if(!this.app.ctx)return;this.app.ctx.beginPath();let e=this.height*.3;this.app.ctx.moveTo(this.x,this.y+e),this.app.ctx.bezierCurveTo(this.x,this.y,this.x-this.width/2,this.y,this.x-this.width/2,this.y+e),this.app.ctx.bezierCurveTo(this.x-this.width/2,this.y+(this.height+e)/2,this.x,this.y+(this.height+e)/1.4,this.x,this.y+this.height),this.app.ctx.bezierCurveTo(this.x,this.y+(this.height+e)/1.8,this.x+this.width/2,this.y+(this.height+e)/2,this.x+this.width/2,this.y+e),this.app.ctx.bezierCurveTo(this.x+this.width/2,this.y,this.x,this.y,this.x,this.y+e),this.app.ctx.closePath(),this.app.ctx.fill()}})}}class js{x;y;z;brightness;constructor(t,e,n,r){this.x=t,this.y=e,this.z=n,this.brightness=r}setBrightness(t){this.brightness=Math.min(Math.max(t,0),1)}}class ec{x;y;width;height;rotation;showFlame;constructor(){this.x=0,this.y=0,this.width=25,this.height=20,this.rotation=0,this.showFlame=!1}draw(t,e){t.save(),t.translate(this.x,this.y),t.rotate(this.rotation),t.lineWidth=1,t.strokeStyle="#ffffff",e?.(t),t.beginPath(),t.moveTo(10,0),t.lineTo(-10,10),t.lineTo(-5,0),t.lineTo(-10,-10),t.lineTo(10,0),t.closePath(),t.stroke(),this.showFlame&&(t.beginPath(),t.moveTo(-7.5,-5),t.lineTo(-15,0),t.lineTo(-7.5,5),t.closePath(),t.stroke()),t.restore()}}class nc{x;y;scaleX;scaleY;color;alpha;lineWidth;branch;constructor(){this.x=0,this.y=0,this.scaleX=1,this.scaleY=1,this.color="#ffffff",this.alpha=1,this.lineWidth=1,this.branch=[],this.branch[0]=-140-Math.random()*20,this.branch[1]=-30-Math.random()*30,this.branch[2]=Math.random()*80-40,this.branch[3]=-100-Math.random()*40,this.branch[4]=-60-Math.random()*40,this.branch[5]=Math.random()*60-30,this.branch[6]=-110-Math.random()*20}draw(t,e){t.save(),t.translate(this.x,this.y),t.scale(this.scaleX,this.scaleY),t.lineWidth=this.lineWidth,t.strokeStyle=nr(this.color,this.alpha),e?.(t),t.beginPath(),t.moveTo(0,0),t.lineTo(0,this.branch[0]),t.moveTo(0,this.branch[1]),t.lineTo(this.branch[2],this.branch[3]),t.moveTo(0,this.branch[4]),t.lineTo(this.branch[5],this.branch[6]),t.stroke(),t.restore()}}class ic{x;y;z;fl;vpX;vpY;cX;cY;cZ;constructor(t,e,n){this.x=t,this.y=e,this.z=n,this.fl=250,this.vpX=0,this.vpY=0,this.cX=0,this.cY=0,this.cZ=0}setVanishingPoint(t,e){this.vpX=t,this.vpY=e}setCenter(t,e,n){this.cX=t,this.cY=e,this.cZ=n}rotateX(t){const e=Math.cos(t),n=Math.sin(t),r=this.y*e-this.z*n,s=this.z*e+this.y*n;this.y=r,this.z=s}rotateY(t){const e=Math.cos(t),n=Math.sin(t),r=this.x*e-this.z*n,s=this.z*e+this.x*n;this.x=r,this.z=s}rotateZ(t){const e=Math.cos(t),n=Math.sin(t),r=this.x*e-this.y*n,s=this.y*e+this.x*n;this.x=r,this.y=s}getScreenX(){const t=this.fl/(this.fl+this.z+this.cZ);return this.vpX+(this.cX+this.x)*t}getScreenY(){const t=this.fl/(this.fl+this.z+this.cZ);return this.vpY+(this.cY+this.y)*t}}class rc{pointA;pointB;pointC;color;lineWidth;alpha;constructor(t,e,n,r="#ff0000"){this.pointA=t,this.pointB=e,this.pointC=n,this.color=r,this.lineWidth=1,this.alpha=1}draw(t,e){this.isBackface()||(t.save(),t.lineWidth=this.lineWidth,t.fillStyle=t.strokeStyle=nr(this.color,this.alpha),e?.(t),t.beginPath(),t.moveTo(this.pointA.getScreenX(),this.pointA.getScreenY()),t.lineTo(this.pointB.getScreenX(),this.pointB.getScreenY()),t.lineTo(this.pointC.getScreenX(),this.pointC.getScreenY()),t.closePath(),t.fill(),this.lineWidth>0&&t.stroke(),t.restore())}getDepth(){return Math.min(this.pointA.z,this.pointB.z,this.pointC.z)}isBackface(){const t=this.pointC.getScreenX()-this.pointA.getScreenX(),e=this.pointC.getScreenY()-this.pointA.getScreenY(),n=this.pointB.getScreenX()-this.pointC.getScreenX(),r=this.pointB.getScreenY()-this.pointC.getScreenY();return t*r>e*n}}class sc{pointA;pointB;pointC;color;lineWidth;alpha;light;constructor(t,e,n,r="#ff0000"){this.pointA=t,this.pointB=e,this.pointC=n,this.color=r,this.lineWidth=1,this.alpha=1,this.light=new js(0,0,0,1)}draw(t,e){this.isBackface()||(t.save(),t.lineWidth=this.lineWidth,t.fillStyle=t.strokeStyle=this.getAdjustedColor(),e?.(t),t.beginPath(),t.moveTo(this.pointA.getScreenX(),this.pointA.getScreenY()),t.lineTo(this.pointB.getScreenX(),this.pointB.getScreenY()),t.lineTo(this.pointC.getScreenX(),this.pointC.getScreenY()),t.closePath(),t.fill(),this.lineWidth>0&&t.stroke(),t.restore())}getDepth(){return Math.min(this.pointA.z,this.pointB.z,this.pointC.z)}isBackface(){const t=this.pointC.getScreenX()-this.pointA.getScreenX(),e=this.pointC.getScreenY()-this.pointA.getScreenY(),n=this.pointB.getScreenX()-this.pointC.getScreenX(),r=this.pointB.getScreenY()-this.pointC.getScreenY();return t*r>e*n}getAdjustedColor(){const t=ii(this.color);let e=t>>16,n=t>>8&255,r=t&255;const s=this.getLightFactor();return e*=s,n*=s,r*=s,Ts(e<<16|n<<8|r)}getLightFactor(){const t={x:this.pointA.x-this.pointB.x,y:this.pointA.y-this.pointB.y,z:this.pointA.z-this.pointB.z},e={x:this.pointB.x-this.pointC.x,y:this.pointB.y-this.pointC.y,z:this.pointB.z-this.pointC.z},n={x:t.y*e.z-t.z*e.y,y:-(t.x*e.z-t.z*e.x),z:t.x*e.y-t.y*e.x},r=n.x*this.light.x+n.y*this.light.y+n.z*this.light.z,s=Math.sqrt(n.x*n.x+n.y*n.y+n.z*n.z),o=Math.sqrt(this.light.x*this.light.x+this.light.y*this.light.y+this.light.z*this.light.z);return Math.acos(r/(s*o))/Math.PI*this.light.brightness}}class ac{min;max;value;x;y;width;height;backColor;backBorderColor;backWidth;handleColor;handleBorderColor;handleHeight;handleY;onchange;prevCanvas;currentContext;animatedID=0;constructor(t=0,e=100,n=0,r){this.min=t,this.max=e,this.value=n,this.onchange=r,this.x=0,this.y=0,this.width=16,this.height=100,this.backColor="#cccccc",this.backBorderColor="#999999",this.backWidth=4,this.handleColor="#eeeeee",this.handleBorderColor="#cccccc",this.handleHeight=6,this.handleY=0,this.updatePosition()}draw(t,e){this.currentContext=t,t.save(),t.translate(this.x,this.y),e?.(t),t.clearRect(this.x,this.y,this.width,this.height),t.fillStyle=this.backColor,t.beginPath(),t.fillRect(this.width/2-this.backWidth/2,0,this.backWidth,this.height),t.closePath(),t.strokeStyle=this.handleBorderColor,t.fillStyle=this.handleColor,t.beginPath(),t.rect(0,this.handleY,this.width,this.handleHeight),t.closePath(),t.fill(),t.stroke(),t.restore(),(!this.prevCanvas||this.prevCanvas!=t.canvas)&&(this.captureMouse(t.canvas),this.prevCanvas=t.canvas)}updateValue(){const t=this.value,e=this.height-this.handleHeight,n=this.max-this.min;this.value=(e-this.handleY)/e*n+this.min,this.value!==t&&(this.onchange?.(this.value),ci.register(()=>this.currentContext?(this.draw(this.currentContext),!0):!1))}updatePosition(){const t=this.height-this.handleHeight,e=this.max-this.min;this.handleY=t-(this.value-this.min)/e*t}captureMouse(t){const e=new ln({x:0,y:0,width:0,height:0}),n=()=>{e.x=this.x,e.y=this.y+this.handleY,e.width=this.width,e.height=this.handleHeight};n();let r=!1;const s=new Gt(t);s.captureMove({move:()=>{if(r){const o=s.mousePoint.y-this.y;this.handleY=Math.min(this.height-this.handleHeight,Math.max(o,0)),this.updateValue()}},start:()=>{r=e.isContainPoint(s.mousePoint)},end:()=>{n()}})}}class oc{x;y;width;height;rotation;scaleX;scaleY;color;lineWidth;constructor(t,e,n="#ffffff"){this.x=0,this.y=0,this.width=t,this.height=e,this.rotation=0,this.scaleX=1,this.scaleY=1,this.color=n,this.lineWidth=1}draw(t,e){const n=this.height,r=this.width+n,s=n/2;t.save(),t.translate(this.x,this.y),t.rotate(this.rotation),t.scale(this.scaleX,this.scaleY),t.lineWidth=this.lineWidth,t.fillStyle=this.color,e?.(t),t.beginPath(),t.moveTo(0,-s),t.lineTo(r-2*s,-s),t.quadraticCurveTo(-s+r,-s,-s+r,0),t.lineTo(-s+r,n-2*s),t.quadraticCurveTo(-s+r,-s+n,r-2*s,-s+n),t.lineTo(0,-s+n),t.quadraticCurveTo(-s,-s+n,-s,n-2*s),t.lineTo(-s,0),t.quadraticCurveTo(-s,-s,0,-s),t.closePath(),t.fill(),this.lineWidth>0&&t.stroke(),t.beginPath(),t.arc(0,0,2,0,Math.PI*2,!0),t.closePath(),t.stroke(),t.beginPath(),t.arc(this.width,0,2,0,Math.PI*2,!0),t.closePath(),t.stroke(),t.restore()}getPin(){return{x:this.x+Math.cos(this.rotation)*this.width,y:this.y+Math.sin(this.rotation)*this.width}}}class hc{R;r;O;constructor(t,e,n){this.R=t,this.r=e,this.O=n}draw(t,e){t.save(),e?.(t);let n=this.R-this.O,r=0,s=1;t.beginPath(),t.moveTo(n,r);let o,a;do{if(s>2e4)break;o=(this.R+this.r)*Math.cos(s*Math.PI/72)-(this.r+this.O)*Math.cos((this.R+this.r)/this.r*(s*Math.PI/72)),a=(this.R+this.r)*Math.sin(s*Math.PI/72)-(this.r+this.O)*Math.sin((this.R+this.r)/this.r*(s*Math.PI/72)),t.lineTo(o,a),n=o,r=a,s++}while(o!=this.R-this.O&&a!=0);t.stroke(),t.restore()}}class cc{r;constructor(t){this.r=t}draw(t,e){t.save(),e?.(t),t.beginPath(),t.moveTo(this.r,0);for(let n=0;n<9;n++)t.rotate(Math.PI/5),n%2==0?t.lineTo(this.r/.525731*.200811,0):t.lineTo(this.r,0);t.closePath(),t.fill(),t.restore()}}class lc{startX;startY;width;height;constructor(t,e,n,r){this.startX=t,this.startY=e,this.width=n,this.height=r}draw(t,e){t.save(),e?.(t);let n=0;const r=()=>{t.clearRect(this.startX,this.startY,this.width,this.height),t.setLineDash([4,2]),t.lineDashOffset=-n,t.strokeRect(this.startX,this.startY,this.width,this.height)};function s(){n++,n>16&&(n=0),r(),setTimeout(s,40)}s(),t.restore()}}class uc{constructor(){}draw(t,e){t.save(),e?.(t),t.beginPath(),t.arc(75,75,50,0,Math.PI*2,!0),t.moveTo(110,75),t.arc(75,75,35,0,Math.PI,!1),t.moveTo(65,65),t.arc(60,65,5,0,Math.PI*2,!0),t.moveTo(95,65),t.arc(90,65,5,0,Math.PI*2,!0),t.stroke(),t.restore()}}class fc{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(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 r=void 0,s=new RTCPeerConnection(r);this.localPeerConnection=s,this.trace("Created local peer connection object localPeerConnection."),s.addEventListener("icecandidate",this.handleConnection),s.addEventListener("iceconnectionstatechange",this.handleConnectionChange);const o=new RTCPeerConnection(r);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."),s.addTrack(e[0],t),s.addTrack(n[0],t),this.trace("localPeerConnection createOffer start."),s.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 r=new RTCIceCandidate(n),s=this.getOtherPeer(e);s&&(s.addIceCandidate(r).then(()=>{this.handleConnectionSuccess(e)}).catch(o=>{this.handleConnectionFailure(e,o)}),this.trace(`${this.getPeerName(e)} ICE candidate:
|
|
32
|
+
`)}n=a.join(r+`\r
|
|
33
|
+
`)}}return{url:i,data:n,boundary:r}}function Ta(s){return new Promise((t,e)=>{const{method:i="GET",url:n="",data:r="",headers:a={},responseType:o="json",timeout:h=3e4,boundary:c=""}=s;Object.assign(a,{Accept:"*/*"});const f=ci();f.onreadystatechange=function(p){f.readyState===4&&(f.status===200?t(f.response):e(f.statusText))},f.ontimeout=function(){e(`${n} is timed out for ${h}ms.`)},f.addEventListener("error",function(p){e(p)},!1),f.addEventListener("progress",function(p){if(p.lengthComputable){const y=Math.round(p.loaded*100/p.total);s.progress?.(y)}},!1),f.addEventListener("load",function(p){s.load?.(p)},!1),f.addEventListener("loadstart",function(p){s.loadstart?.(p)},!1),f.addEventListener("loadend",function(p){s.loadend?.(p)},!1),f.addEventListener("abort",function(p){s.abort?.(p)},!1),f.timeout=h,f.responseType=o;const m=i.toUpperCase();function w(){for(const p in a)f.setRequestHeader(p,a[p]);c&&f.setRequestHeader("Content-Type","multipart/form-data; boundary="+c)}if(m==="GET"){let p="";typeof r=="string"?p=r:r instanceof FormData?p=ai(r):Ve(r)&&(p=ws(r)),f.open("GET",xe(n,p),!0),w(),f.send(null)}else m==="POST"?(f.open("POST",n,!0),w(),c?f.sendAsBinary(c+`\r
|
|
34
|
+
`+r+c+`--\r
|
|
35
|
+
`):f.send(JSON.stringify(r))):(f.open(m,n,!0),w(),f.send(JSON.stringify(r)))})}function _a(s,t){const e=ci();e.open("HEAD",s),e.filepath=s,e.callback=t,e.onload=function(){const i=parseFloat(window.localStorage.getItem("lm_"+this.filepath)??""),n=Date.parse(this.getResponseHeader("Last-Modified"));(isNaN(i)||n>i)&&(window.localStorage.setItem("lm_"+this.filepath,String(Date.now())),isFinite(i)&&this.callback(n,i))},e.send()}let _e;const Ps=new WeakMap;function li(s,t){let e=Ps.get(s);e||(e=new Map,Ps.set(s,e));let i=e.get(t);return i||(i=new Es,e.set(t,i)),i}class Es{subscribers;constructor(){this.subscribers=new Set}depend(){_e&&this.subscribers.add(_e)}notify(){this.subscribers.forEach(t=>t())}}function Sa(s){_e=s,s(),_e=null}function Pa(s){return Object.keys(s).forEach(t=>{let e=s[t];const i=li(s,t);Object.defineProperty(s,t,{get(){return i.depend(),e},set(n){n!=e&&(e=n,i.notify())}})}),s}function Ea(s){return new Proxy(s,{get(t,e,i){return li(s,e).depend(),Reflect.get(t,e,i)},set(t,e,i,n){const r=li(s,e);return s[e]!=i&&(s[e]=i,r.notify()),Reflect.set(t,e,i,n)}})}const ks=[1,0,0,1,0,0],Is=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];class Y{value;matrix3d;isEverTo3d=!1;_prev_translate_z=0;_prev_rotate=0;_prev_rotate_x=0;_prev_rotate_y=0;_prev_rotate_z=0;_prev_scale_z=1;constructor(t=ks){this.value=Array.from(t),this.matrix3d=this.toMatrix3D()}unit(){return this.value=Array.from(ks),this.matrix3d=this.toMatrix3D(),this}transformPoint(t,e,i=0,n=0){const r=t-i,a=e-n;return t=r*this.value[0]+a*this.value[2]+this.value[4],e=r*this.value[1]+a*this.value[3]+this.value[5],[t+i,e+n]}fromString(t){const e=Ai("number",t);return e.length===6?e.forEach((i,n)=>{i.fullMatch&&(this.value[n]=parseFloat(i.fullMatch))}):this.unit(),this}toMatrix3D(t=this.matrix3d){const e=[this.value[0],this.value[1],0,0,this.value[2],this.value[3],0,0,0,0,1,0,this.value[4],this.value[5],0,1];return t?(t.value=e,t):new Mt(e)}clone(){return new Y(this.value)}multiply(t){const e=this.value;let i;t instanceof Y?i=t.value:i=t;const n=e[0]*i[0]+e[2]*i[1],r=e[1]*i[0]+e[3]*i[1],a=e[0]*i[2]+e[2]*i[3],o=e[1]*i[2]+e[3]*i[3],h=e[0]*i[4]+e[2]*i[5]+e[4],c=e[1]*i[4]+e[3]*i[5]+e[5];return e[0]=n,e[1]=r,e[2]=a,e[3]=o,e[4]=h,e[5]=c,this}inverse(){const t=new Y(this.value),e=t.value,i=1/(e[0]*e[3]-e[1]*e[2]),n=e[3]*i,r=-e[1]*i,a=-e[2]*i,o=e[0]*i,h=i*(e[2]*e[5]-e[3]*e[4]),c=i*(e[1]*e[4]-e[0]*e[5]);return e[0]=n,e[1]=r,e[2]=a,e[3]=o,e[4]=h,e[5]=c,t}offset(t=0,e=0){return[t-this.value[4],e-this.value[5]]}translate(t,e){return this.matrix3d.translate(t,e,0),this.multiply([1,0,0,1,t,e])}translateTo(t,e){const i=this.offset(t,e);return this.translate(i[0],i[1])}translateX(t){return this.translate(t,0)}translateXTo(t){return this.translateTo(t,this.value[5])}translateY(t){return this.translate(0,t)}translateYTo(t){return this.translateTo(this.value[4],t)}translateZ(t){return this.isEverTo3d=!0,this.matrix3d.translate(0,0,t)}translateZTo(t){return this.translateZ(t-this._prev_translate_z),this._prev_translate_z=t,this}translate3d(t,e,i){return this.isEverTo3d=!0,this.matrix3d.translate(t,e,i)}translate3dTo(t,e,i){return this.translate3d(t-this.matrix3d.value[12],t-this.matrix3d.value[13],i-this._prev_translate_z),this._prev_translate_z=i,this}rotate(t,e=0,i=0){const n=Qe(t),r=+Math.cos(n).toFixed(9),a=+Math.sin(n).toFixed(9);return this.multiply([r,a,-a,r,e,i]),this.translate(-e,-i),this}rotateTo(t,e=0,i=0){return this.rotate(t-this._prev_rotate,e,i),this._prev_rotate=t,this}rotateX(t){return this.isEverTo3d=!0,this.matrix3d.rotate("x",t)}rotateXTo(t){return this.rotateX(t-this._prev_rotate_x),this._prev_rotate_x=t,this}rotateY(t){return this.isEverTo3d=!0,this.matrix3d.rotate("y",t)}rotateYTo(t){return this.rotateY(t-this._prev_rotate_y),this._prev_rotate_y=t,this}rotateZ(t){return this.isEverTo3d=!0,this.matrix3d.rotate("z",t)}rotateZTo(t){return this.rotateZ(t-this._prev_rotate_z),this._prev_rotate_z=t,this}rotate3d(t,e,i){return this.isEverTo3d=!0,this.matrix3d.rotate("x",t).rotate("y",e).rotate("z",i)}rotate3dTo(t,e,i){return this.rotate3d(t-this._prev_rotate_x,e-this._prev_rotate_y,i-this._prev_rotate_z),this._prev_rotate_x=t,this._prev_rotate_y=e,this._prev_rotate_z=i,this}scale(t,e=t,i=0,n=0){return this.matrix3d.scale(t,e,1),this.translate(i,n),this.multiply([t,0,0,e,0,0]),this.translate(-i,-n),this}scaleTo(t,e=t,i=0,n=0){return this.scale(t/this.value[0],e/this.value[3],i,n),this}scaleX(t){return this.scale(t,1)}scaleXTo(t){return this.scale(t/this.value[0],1)}scaleY(t){return this.scale(1,t)}scaleYTo(t){return this.scale(1,t/this.value[3])}scaleZ(t){return this.isEverTo3d=!0,this.matrix3d.scale(1,1,t)}scaleZTo(t){return this.scaleZ(t/this._prev_scale_z),this._prev_scale_z=t,this}scale3d(t,e,i){return this.isEverTo3d=!0,this.matrix3d.scale(t,e,i)}scale3dTo(t,e,i){return this.scale3d(t/this.matrix3d.value[0],e/this.matrix3d.value[5],i/this._prev_scale_z),this._prev_scale_z=i,this}skew(t,e=t){const i=t*Math.PI/180,n=e*Math.PI/180,r=Math.tan(i),a=Math.tan(n);return this.multiply([1,a,r,1,0,0])}skewTo(t,e=t){return this.skew(t-this.value[2],e-this.value[1])}skewX(t){return this.skew(t,this.value[1])}skewXTo(t){return this.skewTo(t,this.value[1])}skewY(t){return this.skew(this.value[2],t)}skewYTo(t){return this.skewTo(this.value[2],t)}skewZ(t){return this}skewZTo(t){return this}skew3d(t,e,i){return this}skew3dTo(t,e,i){return this}split(){const t={dx:0,dy:0,scalex:1,scaley:1,shear:1,rotate:0,isSimple:!0,isSuperSimple:!0,noRotation:!1};t.dx=this.value[4],t.dy=this.value[5];const e=[[this.value[0],this.value[2]],[this.value[1],this.value[3]]];t.scalex=Math.sqrt(Math.pow(e[0][0],2)+Math.pow(e[0][1],2));let i=ii(e[0][0],e[0][1]);e[0][0]=i.x,e[0][1]=i.y,t.shear=e[0][0]*e[1][0]+e[0][1]*e[1][1],e[1]=[e[1][0]-e[0][0]*t.shear,e[1][1]-e[0][1]*t.shear],t.scaley=Math.sqrt(Math.pow(e[1][0],2)+Math.pow(e[1][1],2)),i=ii(e[1][0],e[1][1]),e[1][0]=i.x,e[1][1]=i.y,t.shear/=t.scaley;const n=-e[0][1],r=e[1][1];return r<0?(t.rotate=jt(Math.acos(r)),n<0&&(t.rotate=360-t.rotate)):t.rotate=jt(Math.asin(n)),t.isSimple=!+t.shear.toFixed(9)&&(t.scalex.toFixed(9)==t.scaley.toFixed(9)||!t.rotate),t.isSuperSimple=!+t.shear.toFixed(9)&&t.scalex.toFixed(9)==t.scaley.toFixed(9)&&!t.rotate,t.noRotation=!+t.shear.toFixed(9)&&!t.rotate,t}static split2(t){const e=Math.atan2(t[1],t[0]),i=Math.pow(t[0],2)+Math.pow(t[1],2),n=Math.sqrt(i),r=(t[0]*t[3]-t[2]*t[1])/n;return{rotation:e/(Math.PI/180),scaleX:n,scaleY:r,x:t[4],y:t[5]}}static getGroupCoords(t,e){const i=t[0],n=t[1],r=t[2],a=t[3],o=t[4],h=t[5],c=e[0],f=e[1],m=e[2],w=e[3],p=e[4],y=e[5],x=c*w,b=f*m,C=(m*n-i*w)/(b-x),_=(c*n-i*f)/(x-b),I=(m*a-r*w)/(b-x),E=(c*a-r*f)/(x-b),L=(m*(h-y)+w*(p-o))/(b-x),O=(c*(h-y)+f*(p-o))/(x-b),B=[C,_,I,E,L,O];return Y.split2(B)}toTransformString(){const t=this.split();return t.isSimple?(t.scalex=+t.scalex.toFixed(4),t.scaley=+t.scaley.toFixed(4),t.rotate=+t.rotate.toFixed(4),(t.dx&&t.dy?"t"+[t.dx,t.dy]:"")+(t.scalex!=1||t.scaley!=1?"s"+[t.scalex,t.scaley,0,0]:"")+(t.rotate?"r"+[t.rotate,0,0]:"")):"matrix"+[this.value[0],this.value[1],this.value[2],this.value[3],this.value[4],this.value[5]]}toString(){return this.isEverTo3d?this.toMatrix3DString():`matrix(${this.value.map(t=>Bi(t,6)).join(",")})`}toMatrix3DString(){return this.matrix3d.toString()}toFilter(){return"progid:DXImageTransform.Microsoft.Matrix(M11="+this.value[0]+", M12="+this.value[2]+", M21="+this.value[1]+", M22="+this.value[3]+", Dx="+this.value[4]+", Dy="+this.value[5]+", sizingmethod='auto expand')"}}class Mt{value;constructor(t=Is){this.value=Array.from(t)}unit(){return this.value=Array.from(Is),this}fromString(t){const e=Ai("number",t);return e.length===16?e.forEach((i,n)=>{i.fullMatch&&(this.value[n]=parseFloat(i.fullMatch))}):this.unit(),this}toMatrix(t){const e=[this.value[0],this.value[1],this.value[4],this.value[5],this.value[12],this.value[13]];return t?(t.value=e,t):new Y(e)}multiplyMatrix(t){const e=this.value[0],i=this.value[1],n=this.value[2],r=this.value[3],a=this.value[4],o=this.value[5],h=this.value[6],c=this.value[7],f=this.value[8],m=this.value[9],w=this.value[10],p=this.value[11],y=this.value[12],x=this.value[13],b=this.value[14],C=this.value[15],_=t.value[0],I=t.value[1],E=t.value[2],L=t.value[3],O=_*e+I*a+E*f+L*y,B=_*i+I*o+E*m+L*x,H=_*n+I*h+E*w+L*b,z=_*r+I*c+E*p+L*C;return new Y([O,B,H,z,0,0])}multiply(t){const e=new Y([t.value[0],t.value[1],t.value[2],t.value[3],0,0]),i=new Y([t.value[4],t.value[5],t.value[6],t.value[7],0,0]),n=new Y([t.value[8],t.value[9],t.value[10],t.value[11],0,0]),r=new Y([t.value[12],t.value[13],t.value[14],t.value[15],0,0]),a=this.multiplyMatrix(e),o=this.multiplyMatrix(i),h=this.multiplyMatrix(n),c=this.multiplyMatrix(r);return this.value[0]=a.value[0],this.value[1]=a.value[1],this.value[2]=a.value[2],this.value[3]=a.value[3],this.value[4]=o.value[0],this.value[5]=o.value[1],this.value[6]=o.value[2],this.value[7]=o.value[3],this.value[8]=h.value[0],this.value[9]=h.value[1],this.value[10]=h.value[2],this.value[11]=h.value[3],this.value[12]=c.value[0],this.value[13]=c.value[1],this.value[14]=c.value[2],this.value[15]=c.value[3],this}translate(t=0,e=0,i=0){return this.multiply(new Mt([1,0,0,0,0,1,0,0,0,0,1,0,t,e,i,1]))}scale(t=1,e=1,i=1){return this.multiply(new Mt([t,0,0,0,0,e,0,0,0,0,i,0,0,0,0,1]))}rotate(t,e){const i=Qe(e),n=Math.sin,r=Math.cos;let a;switch(t){case"x":a=[1,0,0,0,0,r(i),n(i),0,0,-n(i),r(i),0,0,0,0,1];break;case"y":a=[r(i),0,-n(i),0,0,1,0,0,n(i),0,r(i),0,0,0,0,1];break;case"z":a=[r(i),n(i),0,0,-n(i),r(i),0,0,0,0,1,0,0,0,0,1];break}return this.multiply(new Mt(a))}toString(){return`matrix3d(${this.value.map(t=>Bi(t,6)).join(",")})`}}function ee(s){const t=new Y;return s.replace(/([a-z0-9]+)\s*\(?\s*((-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)*[a-z%]*\s*,?\s*)+)\)?/gi,function(e,i,n){n.indexOf(",")>=0?n=n.split(/\s*,\s*/):n=n.split(/\s+/);const r=[];for(let a=0,o=n.length;a<o;a++)n[a].trim()&&r.push(parseFloat(""+n[a]));switch(i.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]]);break;case"matrix3d":t.matrix3d.multiply(new Mt(r));break}return""}),t}class Se{x;y;z;constructor(t=[0,0,0],e=[0,0,0]){const[i,n,r]=t,[a,o,h]=e;this.x=i-a,this.y=n-o,this.z=r-h}get length(){const{x:t,y:e,z:i}=this;return Math.sqrt(t*t+e*e+i*i)}unit(){const t=this.length;return new Se([this.x/t,this.y/t,this.z/t])}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z}cross(t){const e=this.x,i=this.y,n=this.z,r=t.x,a=t.y,o=t.z;return new Se([i*o-n*a,n*r-e*o,e*a-r*i])}}class Ms extends us{currentItem={};items=[];groups=[];globalStyles={};grad={};idtops={};text="";constructor(t){super(t),this.on("tag",(e,i)=>{switch(this.text="",this.currentItem={type:e},e){case"g":this.groups.push(this.currentItem);break}this.processAttrs(e,i)}),this.on("text",e=>{if(this.currentItem.type=="style"){try{const i=yn(e);for(let n of i.stylesheet.rules)for(let r of n.declarations)for(let a of n.selectors)this.globalStyles[a]=this.globalStyles[a]||[],this.globalStyles[a].push(`${r.property}:${r.value}`)}catch{console.error("CAN'T parse css text: "+e)}return}this.text+=e}),this.on("/tag",(e,i)=>{let n=this.groups.length;for(;n--;)if(this.groups[n]!=this.currentItem){let r="",a="";for(let o in this.groups[n])o=="transform"?r=this.groups[n].transform:o=="class"&&this.globalStyles["."+this.groups[n][o]]?a=this.globalStyles["."+this.groups[n][o]].join(";")+";"+a:o=="id"&&this.globalStyles["#"+this.groups[n][o]]?a=this.globalStyles["#"+this.groups[n][o]].join(";")+";"+a:typeof this.currentItem[o]>"u"&&(this.currentItem[o]=this.groups[n][o]);typeof this.currentItem.transform>"u"?this.currentItem.transform=r:this.currentItem.transform+=" "+r,typeof this.currentItem.style>"u"?this.currentItem.style=a:this.currentItem.style=a+this.currentItem.style,this.currentItem.class&&this.globalStyles["."+this.currentItem.class]?this.currentItem.style=this.globalStyles["."+this.currentItem.class].join(";")+";"+this.currentItem.style:this.currentItem.id&&this.globalStyles["#"+this.currentItem.id]&&(this.currentItem.style=this.globalStyles["#"+this.currentItem.id].join(";")+";"+this.currentItem.style),fi(this.currentItem.style,this.currentItem,di)}switch(this.processAttrs(e,i),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 i=[],n;switch(t){case"svg":let r="",a="";if(e.width&&e.height)r=e.width,a=e.height;else if(e.viewBox){const o=e.viewBox.split(/\s+/gi);o.length==4&&(r=String(parseFloat(o[2])-parseFloat(o[0])),a=String(parseFloat(o[3])-parseFloat(o[1])))}r&&a&&this.items.push({type:"viewbox",width:r,height:a});break;case"line":typeof e.x1=="number"&&typeof e.y1=="number"&&typeof e.x2=="number"&&typeof e.y2=="number"&&(this.currentItem.path="M"+[e.x1,e.y1,e.x2,e.y2]);break;case"stop":n={},e.style&&fi(e.style,n),n.offset=n.offset||e.offset,n.color=n["stop-color"]||e["stop-color"],n.opacity=n["stop-opacity"]||e["stop-opacity"],~(n.offset+"").indexOf("%")?n.offset=parseFloat(n.offset):n.offset=parseFloat(n.offset)*100,n.offset=+n.offset.toFixed(2),this.grad.stops.push(n);break;case"linearGradient":this.grad.angle=(360+ui(parseFloat(e.x1),parseFloat(e.y1),parseFloat(e.x2),parseFloat(e.y2),parseFloat(e.x1)+100,parseFloat(e.y1))).toFixed(2),i=[this.grad.angle];for(let o=0,h=this.grad.stops.length;o<h;o++)n=this.grad.stops[o],o&&o!=h-1?i.push(n.color+":"+n.offset):i.push(n.color);this.idtops[this.grad.id]=i.join("-"),this.items.forEach(o=>{o.fillid==this.grad.id&&(o.fill=this.idtops[this.grad.id])});break;case"radialGradient":i=[];for(let o=0,h=this.grad.stops.length;o<h;o++)n=this.grad.stops[o],o&&o!=h-1?i.push(n.color+":"+n.offset):i.push(n.color);this.idtops[this.grad.id]=i.join("-"),this.items.forEach(o=>{o.fillid==this.grad.id&&(o.fill=this.idtops[this.grad.id])});break}for(let r in e){const a=e[r];if(di.includes(r)&&(this.currentItem[r]=a),r==="id"&&(this.currentItem.type==="linearGradient"&&(this.grad={id:r,stops:[]}),this.currentItem.type==="radialGradient"&&(this.grad={id:r,stops:[]})),r==="style"&&fi(a,this.currentItem,di),r==="transform"&&(this.currentItem.transform=a+(this.currentItem.transform||" ")),r==="fill"){const o=a.match(/url\(#([^)]+)\)/);if(o){const h=o[1];this.currentItem.fillid=h,this.idtops[h]&&(this.currentItem.fill=this.idtops[h])}}r==="points"&&this.currentItem.type=="polygon"&&(this.currentItem.path="M"+a+"z"),r==="d"&&this.currentItem.type=="path"&&(this.currentItem.path=a),r==="xlink:href"&&this.currentItem.type=="image"&&(this.currentItem.src=a)}}addToItems(){this.items.push(this.currentItem)}}function ui(s,t,e,i,n,r){if(typeof n>"u"||typeof r>"u"){const a=s-e,o=t-i;return!a&&!o?0:(180+Math.atan2(-o,-a)*180/Math.PI+360)%360}else return ui(s,t,n,r)-ui(e,i,n,r)}function fi(s,t,e){const i=(s+"").split(";"),n=/^\s+|\s+$/g;for(let r=0,a=i.length;r<a;r++){let o=i[r].split(":"),h=o[0].replace(n,"").replace(/[A-Z]/g,function(c){return"-"+c.toLowerCase()});(!e||e.includes(h))&&(t[h]=o[1].replace(n,""))}}const di=["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 extends wt{fromX;fromY;constructor(t){super(t),this.fromX=t?.fromX||0,this.fromY=t?.fromY||0}static fromSVGPathData(t,e){if(t.length<3)throw new Error("Line 参数个数错误");if(t[0].toUpperCase()!=="L")throw new Error("Line command 错误");return new Et({x:t[1],y:t[2],fromX:e?.x,fromY:e?.y})}toSVGPathData(){return["L",this.x,this.y]}toCanvasContext(t){t.beginPath(),t.moveTo(this.fromX,this.fromY),t.lineTo(this.x,this.y)}getBoundingClientRect(){const t=$t(this.fromX,this.fromY,this.x,this.y);if(t===0){const e=Math.min(this.x,this.fromX),i=Math.min(this.y,this.fromY),n=Math.max(this.x,this.fromX),r=Math.max(this.y,this.fromY);return new ot({x:e,y:i,width:n-e,height:r-i})}else{const e=Math.sin(t),i=Math.cos(t),n=i*this.fromX-e*this.fromY,r=i*this.x-e*this.y,a=i*this.fromY+e*this.fromX,o=i*this.y+e*this.x;return new ot({x:Math.min(n,r),y:Math.min(a,o),width:Math.max(n,r)-Math.min(n,r),height:Math.max(a,o)-Math.min(a,o)})}}}class zt extends Et{c1x;c1y;c2x;c2y;constructor(t){super(t),this.c1x=t.c1x,this.c1y=t.c1y,this.c2x=t.c2x,this.c2y=t.c2y}static fromSVGPathData(t,e){if(t.length<7)throw new Error("CubicBezier 参数个数错误");if(t[0].toUpperCase()!=="C")throw new Error("CubicBezier command 错误");return new zt({c1x:t[1],c1y:t[2],c2x:t[3],c2y:t[4],x:t[5],y:t[6],fromX:e?.x,fromY:e?.y})}toSVGPathData(){return["C",this.c1x,this.c1y,this.c2x,this.c2y,this.x,this.y]}toCanvasContext(t){t.beginPath(),t.moveTo(this.fromX,this.fromY),t.bezierCurveTo(this.c1x,this.c1y,this.c2x,this.c2y,this.x,this.y)}getBoundingClientRect(){const t=K.curveDim(this.fromX,this.fromY,this.c1x,this.c1y,this.c2x,this.c2y,this.x,this.y);return new ot({x:t.min.x,y:t.min.y,width:t.max.x-t.min.x,height:t.max.y-t.min.y})}base3(t,e,i,n,r){const a=-3*e+9*i-9*n+3*r,o=t*a+6*e-12*i+6*n;return t*o-3*e+3*i}length(t=1){t=Math.max(0,Math.min(t,1));const e=t/2,i=12,n=[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816],r=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472];let a=0;for(let o=0;o<i;o++){const h=e*n[o]+e,c=this.base3(h,this.fromX,this.c1x,this.c2x,this.x),f=this.base3(h,this.fromY,this.c1y,this.c2y,this.y),m=c*c+f*f;a+=r[o]*Math.sqrt(m)}return e*a}}class ie extends Et{rx;ry;xAxisRotate;largeArcFlag;sweepFlag;constructor(t){super(t),this.rx=t.rx,this.ry=t.ry,this.xAxisRotate=t?.xAxisRotate??0,this.largeArcFlag=t?.largeArcFlag??1,this.sweepFlag=t?.sweepFlag??1}static fromSVGPathData(t,e){if(t.length<8)throw new Error("Arc 参数个数错误");if(t[0].toUpperCase()!=="A")throw new Error("Arc command 错误");return new ie({rx:t[1],ry:t[2],xAxisRotate:t[3],largeArcFlag:t[4],sweepFlag:t[5],x:t[6],y:t[7],fromX:e?.x,fromY:e?.y})}toSVGPathData(){return["A",this.rx,this.ry,this.xAxisRotate,this.largeArcFlag,this.sweepFlag,this.x,this.y]}}class se{prevPoint;startPoint;isClosed=!1;lines=[];normalizedLines=[];constructor(){}setStartPoint(t,e){return this.startPoint=new Zt({x:t,y:e}),this.prevPoint=this.startPoint,this}addLine(t){return this.lines.push(t),this}static fromSVGPathD(t,e){if(!K.isSVGPath(t))throw new Error("Not an SVG path!");return this.fromSVGPathData(K.parseSVGPath(t),e)}static fromSVGPathData(t,e){const i=new se,n=K.normalizeSVGPath(K.absolutizeSVGPath(t));for(let a=0,o=n.length;a<o;a++){const h=n[a],c=h[0];if(a==0&&c=="M"){i.setStartPoint(h[1],h[2]);continue}if(a==o-1&&c=="Z"){i.isClosed=!0;continue}i.addLine(new zt({c1x:h[1],c1y:h[2],c2x:h[3],c2y:h[4],x:h[5],y:h[6]}))}i.normalize();const r=ee(e??"");return i.transform(r)}normalize(){this.normalizedLines=[];const t=K.normalizeSVGPath(K.absolutizeSVGPath(this.lines.map(e=>e.toSVGPathData())));for(let e=0,i=t.length;e<i;e++){const n=t[e];this.normalizedLines.push(zt.fromSVGPathData(n,this.prevPoint)),this.prevPoint=new Zt({x:n[n.length-2],y:n[n.length-1]})}return this}toSVGPathData(){const t=[];this.startPoint&&t.push(this.startPoint.toSVGPathData());for(let e=0,i=this.normalizedLines.length;e<i;e++)t.push(this.normalizedLines[e].toSVGPathData());return this.isClosed&&t.push(["Z"]),t}toSVGPathD(){return K.SVGPathDataToD(this.toSVGPathData())}transform(t){if(this.startPoint){const[e,i]=t.transformPoint(this.startPoint.x,this.startPoint.y);this.setStartPoint(e,i)}return this.normalizedLines=this.normalizedLines.map(e=>{const[i,...n]=e.toSVGPathData(),r=[i];for(let a=0,o=n.length;a<o;a+=2){const[h,c]=t.transformPoint(n[a],n[a+1]);r.push(h,c)}return zt.fromSVGPathData(r)}),this}translate(t,e){const i=new Y().translate(t,e);return this.transform(i)}rotate(t,e=0,i=0){const n=new Y().rotate(t,e,i);return this.transform(n)}scale(t,e=t,i=0,n=0){const r=new Y().scale(t,e,i,n);return this.transform(r)}skew(t,e=0){const i=new Y().skew(t,e);return this.transform(i)}trim(){const t=this.getBoundingClientRect();return this.translate(-t.x,-t.y),this}toCanvasContext(t){this.normalizedLines.length&&(this.startPoint&&(t.beginPath(),t.moveTo(this.startPoint.x,this.startPoint.y)),this.normalizedLines.forEach(e=>{const[i,...n]=e.toSVGPathData();t.bezierCurveTo(n[0],n[1],n[2],n[3],n[4],n[5])}),this.isClosed&&t.closePath())}getBoundingClientRect(){let t=0,e=0,i=[],n=[];this.startPoint&&(t=this.startPoint.x,e=this.startPoint.y,i.push(t),n.push(e)),this.normalizedLines.forEach(c=>{const f=K.curveDim(t,e,c.c1x,c.c1y,c.c2x,c.c2y,c.x,c.y);i=i.concat(f.min.x,f.max.x),n=n.concat(f.min.y,f.max.y),t=c.x,e=c.y});const r=Math.min.apply(0,i),a=Math.min.apply(0,n),o=Math.max.apply(0,i),h=Math.max.apply(0,n);return new ot({x:r,y:a,width:o-r,height:h-a})}getTotalLength(){return Ft?K.createSvgPath(this.toSVGPathD()).getTotalLength():K.getWalkSVGPathD(this.toSVGPathD()).length()}getPointAtLength(t){if(Ft)return K.createSvgPath(this.toSVGPathD()).getPointAtLength(t);{const e=K.getWalkSVGPathD(this.toSVGPathD()),[i,n]=e.at(t);return{x:i,y:n}}}isPointInPath(t,e,i){return t.isPointInPath(new Path2D(this.toSVGPathD()),e,i)}isPointInStroke(t,e,i){return t.isPointInStroke(new Path2D(this.toSVGPathD()),e,i)}static generateRosetta(t,e,i,n,r){if(r==0)throw new Error("no dividing by zero, please");const a=new se;a.setStartPoint(t,e);const o=360/r;for(let h=0;h<r;h+=1){const c=o*h*Math.PI/180,f=t+2*i*Math.cos(c),m=e+2*i*Math.sin(c);a.addLine(new ie({x:f,y:m,rx:i,ry:n,xAxisRotate:o*h,largeArcFlag:1,sweepFlag:1})),a.addLine(new ie({x:t,y:e,rx:i,ry:n,xAxisRotate:o*h,largeArcFlag:1,sweepFlag:1}))}return a.normalize(),a}}class mi extends wt{svgWidth=0;svgHeight=0;width=0;height=0;pgas=[];history=[];save(){this.history.push(Xe(this.pgas))}restore(){const t=this.history.pop();t&&(this.pgas=t)}current(){return Xe(this.pgas)}constructor(t){super(t),this.width=t.width;const e=new Ms(t.svg).parse();for(let i=0,n=e.length;i<n;i++){const r=e[i];if(r.type=="viewbox"&&r.width&&r.height){this.svgWidth=parseFloat(r.width),this.svgHeight=parseFloat(r.height);const h=this.svgWidth/this.svgHeight;this.height=this.width/h;continue}if(r.type!="path")continue;const a={};for(const h in r)h==="type"||h==="path"||h==="transform"||(a[h]=r[h]);const o=se.fromSVGPathD(r.path,r.transform);this.width&&this.svgWidth&&o.scale(this.width/this.svgWidth),this.pgas.push({pg:o,attrs:a})}}getBoundingClientRect(){return new ot({x:this.x,y:this.y,width:this.width,height:this.height})}toSVGPathData(){return this.pgas.map(t=>t.pg.toSVGPathData()).reduce((t,e)=>t.concat(e),[])}toCanvasContext(t){for(let e=0,i=this.pgas.length;e<i;e++){t.save();const n=this.pgas[e];this.SVGAttrsToCanvasAttrs(t,n.attrs),n.pg.toCanvasContext(t),n.attrs.stroke!=="none"&&t.stroke(),n.attrs.fill!=="none"&&t.fill(),t.restore()}}SVGAttrsToCanvasAttrs(t,e){for(const i in e){const n=e[i];switch(i){case"fill":t.fillStyle=n;break;case"stroke":t.strokeStyle=n;break;case"stroke-width":t.lineWidth=Number(n);break;case"stroke-linecap":t.lineCap=n;break;case"stroke-linejoin":t.lineJoin=n;break}}}}class ka extends wt{rx;ry;constructor(t){super(t),this.XYIsShapeCenter=!0,this.rx=t?.rx||0,this.ry=t?.ry||0}getBoundingClientRect(){return new ot({x:this.x-this.rx,y:this.y-this.ry,width:this.rx*2,height:this.ry*2})}toSVGPathData(){return[["M",this.x,this.y],["m",0,-this.ry],["a",this.rx,this.ry,0,1,1,0,2*this.ry],["a",this.rx,this.ry,0,1,1,0,-2*this.ry],["z"]]}toCanvasContext(t){t.beginPath(),t.ellipse(this.x,this.y,this.rx,this.ry,0,0,2*Math.PI,!0),t.closePath()}}class gi extends wt{points;constructor(t=[]){if(!t.length)throw new Error("points can't be null");super(t[0]),this.points=t}toSVGPathData(){const t=[];for(let e=0,i=this.length;e<i;e++)t.push([e===0?"M":"L",this.points[e].x,this.points[e].y]);return t}toCanvasContext(t){const e=this.points.length;if(e<3)throw new Error("points length must >= 3");t.beginPath();const i=(this.points[0].x+this.points[e-1].x)/2,n=(this.points[0].y+this.points[e-1].y)/2;t.moveTo(i,n);let r=0;for(;r<e-1;r++){const a=(this.points[r].x+this.points[r+1].x)/2,o=(this.points[r].y+this.points[r+1].y)/2;t.quadraticCurveTo(this.points[r].x-this.x,this.points[r].y-this.y,a-this.x,o-this.y)}t.quadraticCurveTo(this.points[r].x-this.x,this.points[r].y-this.y,i-this.x,n-this.y)}get length(){return this.points.length}addPoint(t){this.points.push(t)}getPoint(t){return this.points[t]}isContainPoint(t,e){const i=this.length;let n=!1;const r=2e-10;for(let a=0,o=i-1;a<i;o=a,a++){const h=this.points[a].x,c=this.points[a].y,f=this.points[o].x,m=this.points[o].y;if(h===t&&c===e||f===t&&m===e||e===c&&e===m)return!0;if(e>=c&&e<m||e<c&&e>=m){const w=(f-h)/(m-c),p=h+w*(e-c);if(p===t||Math.abs(p-t)<r)return!0;p>t&&(n=!n)}}return n}[Symbol.iterator](){let t=0;return{next:()=>({value:t>=this.length-1?this.points[++t]:void 0,done:t>=this.length})}}static generateInMultiplePoint(t,e,i,n,r=1){const a=new gi;for(let o=0;o<=r*i;o+=1){const h=Math.floor(o/r)/i*2*Math.PI,c=t+Math.cos(h)*n,f=e+Math.sin(h)*n;a.addPoint(new Zt({x:c,y:f}))}return a}}class pi extends Et{cx;cy;constructor(t){super(t),this.cx=t.cx,this.cy=t.cy}static fromSVGPathData(t,e){if(t.length<5)throw new Error("QuadraticBezier 参数个数错误");if(t[0].toUpperCase()!=="Q")throw new Error("QuadraticBezier command 错误");return new pi({cx:t[1],cy:t[2],x:t[3],y:t[4],fromX:e?.x,fromY:e?.y})}toSVGPathData(){return["Q",this.cx,this.cy,this.x,this.y]}toCanvasContext(t,e){const i=typeof e?.isLineThrough=="boolean"?e?.isLineThrough:!0;if(t.beginPath(),t.moveTo(this.fromX,this.fromY),i){const n=this.cx*2-(this.fromX+this.x)/2,r=this.cy*2-(this.fromY+this.y)/2;t.quadraticCurveTo(n,r,this.x,this.y)}else t.quadraticCurveTo(this.cx,this.cy,this.x,this.y)}}class Ia extends wt{constructor(t){super(t)}toSVGPathData(){return[["M",this.x,this.y],["m",-50,-25],["l",0,-25],["l",0,-50],["l",50,0],["l",0,50],["l",0,25],["l",-50,25],["l",-50,-25],["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 Ma extends wt{constructor(t){super(t)}toSVGPathData(){return[["M",this.x,this.y],["m",4,24],["l",8,16],["l",14,10],["l",15,0],["l",9,-10],["l",2,0],["l",-2,0],["l",-9,-10],["l",-15,0],["l",-14,10],["l",-8,16],["l",-4,24],["z"]]}toCanvasContext(t){t.beginPath(),t.moveTo(4,24),t.lineTo(8,16),t.lineTo(14,10),t.lineTo(15,0),t.lineTo(9,-10),t.lineTo(2,0),t.lineTo(-2,0),t.lineTo(-9,-10),t.lineTo(-15,0),t.lineTo(-14,10),t.lineTo(-8,16),t.lineTo(-4,24),t.closePath()}}(function(){let s=0;window.requestAnimationFrame||(window.requestAnimationFrame=function(t){const e=new Date().getTime(),i=Math.max(0,16-(e-s)),n=window.setTimeout(function(){t(e+i)},i);return s=e+i,n}),window.cancelAnimationFrame||(window.cancelAnimationFrame=function(t){clearTimeout(t)})})();const Ds=s=>{let t=window.requestAnimationFrame(function e(i){t=window.requestAnimationFrame(e),s(i,t)});return()=>window.cancelAnimationFrame(t)};class Da{id=0;renders={};cancelFn;constructor(){}get length(){let t=0;for(let e in this.renders)t++;return t}register(t){const e=this.id++;this.renders[e]=t,this.run()}registerAccurateSetTimeout(t,e=0){let i;this.register(n=>(i||(i=n),n-i>=e?(t(),!1):!0))}run(){this.cancelFn||(this.cancelFn=Ds((t,e)=>{const i=[];for(let n in this.renders)this.renders[n](t)===!1&&i.push(parseInt(n));for(let n of i)delete this.renders[n];!this.length&&this.cancelFn&&(this.cancelFn(),this.cancelFn=void 0)}))}}const Dt=new Da;let ne;typeof self>"u"&&typeof process<"u"&&process.hrtime?ne=function(){const s=process.hrtime();return s[0]*1e3+s[1]/1e6}:typeof self<"u"&&self.performance!==void 0&&self.performance.now!==void 0?ne=self.performance.now.bind(self.performance):Date.now!==void 0?ne=Date.now:ne=function(){return new Date().getTime()};const Vt=ne;class re{static _nextId=0;static nextId(){return re._nextId++}}const Pe={Linear:{None:function(s){return s}},Ease:{In:function(s){return Math.pow(s,1.7)}},Quadratic:{In:function(s){return s*s},Out:function(s){return s*(2-s)},InOut:function(s){return(s*=2)<1?.5*s*s:-.5*(--s*(s-2)-1)}},Cubic:{In:function(s){return s*s*s},Out:function(s){return--s*s*s+1},InOut:function(s){return(s*=2)<1?.5*s*s*s:.5*((s-=2)*s*s+2)}},Quartic:{In:function(s){return s*s*s*s},Out:function(s){return 1- --s*s*s*s},InOut:function(s){return(s*=2)<1?.5*s*s*s*s:-.5*((s-=2)*s*s*s-2)}},Quintic:{In:function(s){return s*s*s*s*s},Out:function(s){return--s*s*s*s*s+1},InOut:function(s){return(s*=2)<1?.5*s*s*s*s*s:.5*((s-=2)*s*s*s*s+2)}},Sinusoidal:{In:function(s){return 1-Math.sin((1-s)*Math.PI/2)},Out:function(s){return Math.sin(s*Math.PI/2)},InOut:function(s){return .5*(1-Math.sin(Math.PI*(.5-s)))}},Exponential:{In:function(s){return s===0?0:Math.pow(1024,s-1)},Out:function(s){return s===1?1:1-Math.pow(2,-10*s)},InOut:function(s){return s===0?0:s===1?1:(s*=2)<1?.5*Math.pow(1024,s-1):.5*(-Math.pow(2,-10*(s-1))+2)}},Circular:{In:function(s){return 1-Math.sqrt(1-s*s)},Out:function(s){return Math.sqrt(1- --s*s)},InOut:function(s){return(s*=2)<1?-.5*(Math.sqrt(1-s*s)-1):.5*(Math.sqrt(1-(s-=2)*s)+1)}},Elastic:{In:function(s){return s===0?0:s===1?1:-Math.pow(2,10*(s-1))*Math.sin((s-1.1)*5*Math.PI)},Out:function(s){return s===0?0:s===1?1:Math.pow(2,-10*s)*Math.sin((s-.1)*5*Math.PI)+1},InOut:function(s){return s===0?0:s===1?1:(s*=2,s<1?-.5*Math.pow(2,10*(s-1))*Math.sin((s-1.1)*5*Math.PI):.5*Math.pow(2,-10*(s-1))*Math.sin((s-1.1)*5*Math.PI)+1)}},Back:{In:function(s){return s===1?1:s*s*((1.70158+1)*s-1.70158)},Out:function(s){return s===0?0:--s*s*((1.70158+1)*s+1.70158)+1},InOut:function(s){const t=2.5949095;return(s*=2)<1?.5*(s*s*((t+1)*s-t)):.5*((s-=2)*s*((t+1)*s+t)+2)}},Bounce:{In:function(s){return 1-Pe.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?Pe.Bounce.In(s*2)*.5:Pe.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(i){return t*Math.random()+e*s(i)}}},wi=Pe,ae={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 i=t;i>1;i--)e*=i;return s[t]=e,e}}(),Bernstein:function(s,t){const e=ae.Utils.Factorial;return e(s)/e(t)/e(s-t)},CatmullRom:function(s,t,e,i,n){const r=(e-s)*.5,a=(i-t)*.5,o=n*n,h=n*o;return(2*t-2*e+r+a)*h+(-3*t+3*e-2*r-a)*o+r*n+t}},Linear:function(s,t){const e=s.length-1,i=e*t,n=Math.floor(i),r=ae.Utils.Linear;return t<0?r(s[0],s[1],i):t>1?r(s[e],s[e-1],e-i):r(s[n],s[n+1>e?e:n+1],i-n)},Bezier:function(s,t){let e=0;const i=s.length-1,n=Math.pow,r=ae.Utils.Bernstein;for(let a=0;a<=i;a++)e+=n(1-t,i-a)*n(t,a)*s[a]*r(i,a);return e},CatmullRom:function(s,t){const e=s.length-1;let i=e*t,n=Math.floor(i);const r=ae.Utils.CatmullRom;return s[0]===s[e]?(t<0&&(n=Math.floor(i=e*(1+t))),r(s[(n-1+e)%e],s[n],s[(n+1)%e],s[(n+2)%e],i-n)):t<0?s[0]-(r(s[0],s[0],s[1],s[1],-i)-s[0]):t>1?s[e]-(r(s[e],s[e],s[e-1],s[e-1],i-e)-s[e]):r(s[n?n-1:0],s[n],s[e<n+1?e:n+1],s[e<n+2?e:n+2],i-n)}},yi=ae;class As{_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=Vt(),e=!1){let i=Object.keys(this._tweens);if(i.length===0)return!1;for(;i.length>0;){this._tweensAddedDuringUpdate={};for(let n=0;n<i.length;n++){const r=this._tweens[i[n]],a=!e;r&&r.update(t,a)===!1&&!e&&delete this._tweens[i[n]]}i=Object.keys(this._tweensAddedDuringUpdate)}return!0}}const st=new As;class Ls{constructor(t,e=st){this._object=t,this._group=e}_id=re.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=wi.Linear.None;_interpolationFunction=yi.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=Vt()){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,i,n){for(const r in i){const a=t[r],o=Array.isArray(a),h=o?"array":typeof a,c=!o&&Array.isArray(i[r]);if(!(h==="undefined"||h==="function")){if(c){let f=i[r];if(f.length===0)continue;f=f.map(this._handleRelativeValue.bind(this,a)),i[r]=[a].concat(f)}if((h==="object"||o)&&a&&!c){e[r]=o?[]:{};for(const f in a)e[r][f]=a[f];n[r]=o?[]:{},this._setupProperties(a,e[r],i[r],n[r])}else typeof e[r]>"u"&&(e[r]=a),o||(e[r]*=1),c?n[r]=i[r].slice().reverse():n[r]=e[r]||0}}}stop(){return this._isChainStopped||(this._isChainStopped=!0,this.stopChainedTweens()),this._isPlaying?(this._group&&this._group.remove(this),this._isPlaying=!1,this._isPaused=!1,this._onStopCallback&&this._onStopCallback(this._object),this):this}end(){return this._goToEnd=!0,this.update(1/0),this}pause(t=Vt()){return this._isPaused||!this._isPlaying?this:(this._isPaused=!0,this._pauseStartTime=t,this._group&&this._group.remove(this),this)}resume(t=Vt()){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=st){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=wi.Linear.None){return this._easingFunction=t,this}interpolation(t=yi.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=Vt(),e=!0){if(this._isPaused)return!0;let i,n;const r=this._startTime+this._durationTime;if(!this._goToEnd&&!this._isPlaying){if(t>r)return!1;e&&this.start(t)}if(this._goToEnd=!1,t<this._startTime)return!0;this._onStartCallbackFired===!1&&(this._onStartCallback&&this._onStartCallback(this._object),this._onStartCallbackFired=!0),this._onEveryStartCallbackFired===!1&&(this._onEveryStartCallback&&this._onEveryStartCallback(this._object),this._onEveryStartCallbackFired=!0),n=(t-this._startTime)/this._durationTime,n=this._durationTime===0||n>1?1:n;const a=this._easingFunction(n);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,a),this._onUpdateCallback&&this._onUpdateCallback(this._object,n),n===1)if(this._repeat>0){isFinite(this._repeat)&&this._repeat--;for(i in this._valuesStartRepeat)!this._yoyo&&typeof this._valuesEnd[i]=="string"&&(this._valuesStartRepeat[i]=this._valuesStartRepeat[i]+parseFloat(this._valuesEnd[i])),this._yoyo&&this._swapEndStartRepeatValues(i),this._valuesStart[i]=this._valuesStartRepeat[i];return this._yoyo&&(this._reversed=!this._reversed),this._repeatDelayTime!==void 0?this._startTime=t+this._repeatDelayTime:this._startTime=t+this._delayTime,this._onRepeatCallback&&this._onRepeatCallback(this._object),this._onEveryStartCallbackFired=!1,!0}else{this._onCompleteCallback&&this._onCompleteCallback(this._object);for(let o=0,h=this._chainedTweens.length;o<h;o++)this._chainedTweens[o].start(this._startTime+this._durationTime);return this._isPlaying=!1,!1}return!0}_updateProperties(t,e,i,n){for(const r in i){if(e[r]===void 0)continue;const a=e[r]||0;let o=i[r];const h=Array.isArray(t[r]),c=Array.isArray(o);!h&&c?t[r]=this._interpolationFunction(o,n):typeof o=="object"&&o?this._updateProperties(t[r],a,o,n):(o=this._handleRelativeValue(a,o),typeof o=="number"&&(t[r]=a+(o-a)*n))}}_handleRelativeValue(t,e){return typeof e!="string"?e:e.charAt(0)==="+"||e.charAt(0)==="-"?t+parseFloat(e):parseFloat(e)}_swapEndStartRepeatValues(t){const e=this._valuesStartRepeat[t],i=this._valuesEnd[t];typeof i=="string"?this._valuesStartRepeat[t]=this._valuesStartRepeat[t]+parseFloat(i):this._valuesStartRepeat[t]=i,this._valuesEnd[t]=e}}const Aa=re.nextId,La=st.getAll.bind(st),Ra=st.removeAll.bind(st),Oa=st.add.bind(st),Na=st.remove.bind(st),Fa=st.update.bind(st),Ee={now:Vt,Sequence:re,Easing:wi,Interpolation:yi,Group:As,Tween:Ls,nextId:Aa,getAll:La,removeAll:Ra,add:Oa,remove:Na,update:Fa};function Rs(s){switch(s){case"linear":return[0,0,1,1];case"ease":return[.25,.1,.25,1];case"ease-in":return[.42,0,1,1];case"ease-in-out":return[.42,0,.58,1];case"ease-out":return[0,0,.58,1]}}const Ga={attributeName:["display"],values:[["block","block"]]},Q={easeName:"linear",begin:0,dur:300,repeatCount:1,direction:"normal",fill:"freeze",keyTimes:[0,1]};class vt{currentPredefinedAnimateName;currentPredefinedAnimateArgs;objects=[];currentObjects=[];isRunning=!1;constructor(){}destroy(){}hasObjects(){return this.objects.length>0}fromDOM(t){return Array.isArray(t)||(t=[t]),this.objects=[],t.forEach(e=>{this.objects.push({width:parseFloat(A.getStyle(e,"width")),height:parseFloat(A.getStyle(e,"height")),el:e,originCSSObject:{}})}),this}static isRunningGlobalTween=!1;static runGlobalTween(t){vt.isRunningGlobalTween||Dt.register(()=>(vt.isRunningGlobalTween=Ee.update(t?.()),vt.isRunningGlobalTween))}static toTween(t,e,i){const n=i?.onUpdate??(()=>{}),r=i?.onStart??(()=>{}),a=i?.onComplete??(()=>{}),o=i?.duration??1e3,h=i?.delay??0,c=i?.easeFunction??Ee.Easing.Linear.None,f=i?.repeat??0,m=i?.yoyo??!1,w=new Ee.Tween(t).to(e,o).delay(h).easing(c).repeat(f).yoyo(m).onStart(r).onUpdate(function(p,y){n(p,y)}).onComplete(a);return i?.interpolationFunction&&w.interpolation(i.interpolationFunction),{tween:w,startAuto:p=>{w.start(p?.()),Dt.register(()=>{const y=w.update(p?.());if(i?.precision){let x=!0;for(let b in t)Yt(t[b],e[b],i.precision)||(x=!1);return x?!1:y}return y})}}}static toTweenCSS(t,e,i,n){const r={_matrix:ee(A.getStyle(t,"transform")??"")},a=n?.onUpdate??(()=>{});return vt.toTween(e,i,Object.assign(n??{},{onUpdate:(o,h)=>{for(let c in o)vt.setCSSObjectTransformUseMatrix(c,o[c],r);t.style.transform=r.transform,a(o,h)}}))}static setCSSObjectTransformUseMatrix(t,e,i={},n){switch(t){case"translate":i._matrix.translate(e[0]??0,e[1]??0);break;case"translateTo":i._matrix.translateTo(e[0]??0,e[1]??0);break;case"translateX":i._matrix.translateX(e??0);break;case"translateXTo":i._matrix.translateXTo(e??0);break;case"translateY":i._matrix.translateY(e??0);break;case"translateYTo":i._matrix.translateYTo(e??0);break;case"translateZ":i._matrix.translateZ(e??0);break;case"translateZTo":i._matrix.translateZTo(e??0);break;case"translate3d":i._matrix.translate3d(e[0]??0,e[1]??0,e[2]??0);break;case"translate3dTo":i._matrix.translate3dTo(e[0]??0,e[1]??0,e[2]??0);break;case"rotate":typeof e=="number"?i._matrix.rotate(e??0):i._matrix.rotate(e[0]??0,e[1]??0,e[2]??0);break;case"rotateTo":typeof e=="number"?i._matrix.rotateTo(e??0):i._matrix.rotateTo(e[0]??0,e[1]??0,e[2]??0);break;case"rotateX":i._matrix.rotateX(e??0);break;case"rotateXTo":i._matrix.rotateXTo(e??0);break;case"rotateY":i._matrix.rotateY(e??0);break;case"rotateYTo":i._matrix.rotateYTo(e??0);break;case"rotateZ":i._matrix.rotateZ(e??0);break;case"rotateZTo":i._matrix.rotateZTo(e??0);break;case"rotate3d":i._matrix.rotate3d(e[0]??0,e[1]??0,e[2]??0);break;case"rotate3dTo":i._matrix.rotate3dTo(e[0]??0,e[1]??0,e[2]??0);break;case"scale":typeof e=="number"?i._matrix.scale(e??1):i._matrix.scale(e[0]??1,e[1]??1,e[2]??0,e[3]??0);break;case"scaleTo":typeof e=="number"?i._matrix.scaleTo(e??1):i._matrix.scaleTo(e[0]??1,e[1]??1,e[2]??0,e[3]??0);break;case"scaleX":i._matrix.scaleX(e??1);break;case"scaleXTo":i._matrix.scaleXTo(e??1);break;case"scaleY":i._matrix.scaleY(e??1);break;case"scaleYTo":i._matrix.scaleYTo(e??1);break;case"scaleZ":i._matrix.scaleZ(e??1);break;case"scaleZTo":i._matrix.scaleZTo(e??1);break;case"scale3d":i._matrix.scale3d(e??1);break;case"scale3dTo":i._matrix.scale3dTo(e??1);break;case"skew":typeof e=="number"?i._matrix.skew(e??0):i._matrix.skew(e[0]??0,e[1]??0);break;case"skewTo":typeof e=="number"?i._matrix.skewTo(e??0):i._matrix.skewTo(e[0]??0,e[1]??0);break;case"skewX":i._matrix.skewX(e??0);break;case"skewXTo":i._matrix.skewXTo(e??1);break;case"skewY":i._matrix.skewY(e??0);break;case"skewYTo":i._matrix.skewYTo(e??1);break;case"skewZ":case"skewZTo":case"skew3d":case"skew3dTo":break;default:n&&!Object.prototype.hasOwnProperty.call(n.originCSSObject,t)&&(n.originCSSObject[t]=A.getStyle(n.el,t)),Object.assign(i,{[t]:`${e??""}`});break}return Object.assign(i,{transform:i._matrix.toString()}),i}_addCurrentObject(t=Ga,e=Q,i=0,n,r=!1){const a=e.keyTimes??[0,1],o=[];a.forEach((c,f)=>{f>0&&o.push(Rs(e.easeName??"linear"))});const h=e.dur??300;return this.currentObjects=r?[]:this.currentObjects,this.currentObjects.push({objectIndex:i,sequenceType:n,attributeName:t.attributeName,values:t.values,immediate:t.immediate||!1,begin:e.begin??0,dur:h,keyTimes:a,realKeyTimes:a.map(c=>h*c),keySplines:o,repeatCount:e.repeatCount??1,direction:e.direction??"normal",fill:e.fill??"freeze",onComplete:e.onComplete}),this}_resetGroupCurrentObjects(t,e,i,n,r=Q,a=this.objects.length-1){let o=!0,h=!1,c=!1,f=!1;const m=this.objects.length-1;a=We(a,0,m);let w=a-1;w=We(w,0,m);let p=a+1;p=We(p,0,m);const y=this.objects[a],x=this.objects[w],b=this.objects[p];if(x&&w!==a){const C=t(x);C&&(this._addCurrentObject(C,r,w,"prev",o),o=!1,h=!0)}if(y){const C=e(y);C&&(this._addCurrentObject(C,r,a,"current",o),o=!1,c=!0)}if(b&&p!==a){const C=i(b);C&&(this._addCurrentObject(C,r,p,"next",o),o=!1,f=!0)}this.objects.forEach((C,_)=>{if(!(_==w&&h||_==a&&c||_==p&&f)){const I=n(C);I&&(this._addCurrentObject(I,r,_,"other",o),o=!1)}})}toCSS(t,...e){if(!this.hasObjects()||this.isRunning)return;switch(this.currentPredefinedAnimateName=t,this.currentPredefinedAnimateArgs=e,this[t](...e),this.objects[0].el&&this.objects[0].el.parentElement&&(this.objects[0].el.parentElement.style.position=A.getStyle(this.objects[0].el.parentElement,"transform")||"relative",this.objects[0].el.parentElement.style.perspective=A.getStyle(this.objects[0].el.parentElement,"perspective")||"1000px"),t){default:this.objects.forEach((r,a)=>{A.setStyle(r.el,Object.assign(r?.originCSSObject??{},{position:"absolute","z-index":String(2e3+a),"transform-style":"preserve-3d","backface-visibility":"hidden"}))});break}let i=0;const n=()=>{this.isRunning=!0,this.currentObjects.forEach((r,a)=>{const o=this.objects[r.objectIndex];let h=[],c=[];Array.isArray(r.attributeName)?(h=r.attributeName,c=r.values):r.attributeName&&(h=[r.attributeName],c=[r.values]);const f=r.keyTimes.length;let m=r.begin;r.keyTimes.forEach((w,p)=>{if(p==0||r.immediate){const y={_matrix:ee("")};h.forEach((x,b)=>{const C=c[b][r.direction=="reverse"?f-1-p:p];vt.setCSSObjectTransformUseMatrix(x,C,y,o)}),A.setStyle(o.el,Object.assign(y,{transition:"all 0ms!important"}))}else Dt.registerAccurateSetTimeout(((y,x,b)=>()=>{const C={_matrix:ee("")};h.forEach((_,I)=>{const E=c[I][x.direction=="reverse"?f-1-y:y];vt.setCSSObjectTransformUseMatrix(_,E,C,b)}),A.setStyle(b.el,Object.assign(C,{transition:`all ${x.realKeyTimes[y]}ms cubic-bezier(${x.keySplines[y-1].join(",")})`}))})(p,r,o),m+1),m+=r.realKeyTimes[p]}),Dt.registerAccurateSetTimeout(((w,p)=>()=>{w.fill==="remove"&&A.setStyle(o.el,o.originCSSObject??{}),p==this.currentObjects.length-1&&(w.onComplete?.(),this.isRunning=!1,(typeof w.repeatCount=="number"&&++i<w.repeatCount||w.repeatCount=="infinite")&&requestAnimationFrame(()=>{this.currentPredefinedAnimateName===t&&n()}))})(r,a),r.begin+r.dur)})};n()}slideLeft(t=Q,e=this.objects.length-1){this._resetGroupCurrentObjects(i=>({attributeName:["opacity","translateTo"],values:[[1,1],[[0,0],[-i.width,0]]]}),i=>({attributeName:["opacity","translateTo"],values:[[1,1],[[i.width,0],[0,0]]]}),i=>{},i=>({attributeName:["opacity","translateTo"],values:[[0,0],[[i.width,0],[i.width,0]]],immediate:!0}),t,e)}slideRight(t=Q,e=this.objects.length-1){this._resetGroupCurrentObjects(i=>{},i=>({attributeName:["opacity","translateTo"],values:[[1,1],[[-i.width,0],[0,0]]]}),i=>({attributeName:["opacity","translateTo"],values:[[1,1],[[0,0],[i.width,0]]]}),i=>({attributeName:["opacity","translateTo"],values:[[0,0],[[-i.width,0],[-i.width,0]]],immediate:!0}),t,e)}slideDown(t=Q,e=this.objects.length-1){this._resetGroupCurrentObjects(i=>({attributeName:["opacity","translateTo"],values:[[1,1],[[0,0],[0,i.height]]]}),i=>({attributeName:["opacity","translateTo"],values:[[1,1],[[0,-i.height],[0,0]]]}),i=>{},i=>({attributeName:["opacity","translateTo"],values:[[0,0],[[0,-i.height],[0,-i.height]]],immediate:!0}),t,e)}slideUp(t=Q,e=this.objects.length-1){this._resetGroupCurrentObjects(i=>({attributeName:["opacity","translateTo"],values:[[1,1],[[0,0],[0,-i.height]]]}),i=>({attributeName:["opacity","translateTo"],values:[[1,1],[[0,i.height],[0,0]]]}),i=>{},i=>({attributeName:["opacity","translateTo"],values:[[0,0],[[0,i.height],[0,i.height]]],immediate:!0}),t,e)}flipLeft(t=Q,e=this.objects.length-1){this._resetGroupCurrentObjects(i=>({attributeName:["opacity","rotateYTo"],values:[[1,1],[0,180]]}),i=>({attributeName:["opacity","rotateYTo"],values:[[1,1],[-180,0]]}),i=>{},i=>({attributeName:["opacity"],values:[[0,0]],immediate:!0}),t,e)}flipRight(t=Q,e=this.objects.length-1){this._resetGroupCurrentObjects(i=>({attributeName:["opacity","rotateYTo"],values:[[1,1],[0,-180]]}),i=>({attributeName:["opacity","rotateYTo"],values:[[1,1],[180,0]]}),i=>{},i=>({attributeName:["opacity"],values:[[0,0]],immediate:!0}),t,e)}flipDown(t=Q,e=this.objects.length-1){this._resetGroupCurrentObjects(i=>({attributeName:["opacity","rotateXTo"],values:[[1,1],[0,-180]]}),i=>({attributeName:["opacity","rotateXTo"],values:[[1,1],[180,0]]}),i=>{},i=>({attributeName:["opacity"],values:[[0,0]],immediate:!0}),t,e)}flipUp(t=Q,e=this.objects.length-1){this._resetGroupCurrentObjects(i=>({attributeName:["opacity","rotateXTo"],values:[[1,1],[0,180]]}),i=>({attributeName:["opacity","rotateXTo"],values:[[1,1],[-180,0]]}),i=>{},i=>({attributeName:["opacity"],values:[[0,0]],immediate:!0}),t,e)}popIn(t=Q,e=this.objects.length-1){this._resetGroupCurrentObjects(i=>{},i=>({attributeName:["translateTo","scaleTo","opacity"],values:[[[0,0],[0,0]],[.8,1],[0,1]]}),i=>{},i=>({attributeName:["opacity"],values:[[0,0]],immediate:!0}),t,e)}popOut(t=Q,e=this.objects.length-1){this._resetGroupCurrentObjects(i=>{},i=>({attributeName:["translateTo","scaleTo","opacity"],values:[[[0,0],[0,0]],[1,1.2],[1,0]]}),i=>{},i=>({attributeName:["opacity"],values:[[0,0]],immediate:!0}),t,e)}rotate(t=Q,e=this.objects.length-1){Object.assign(t,{keyTimes:[0,1]});const i=t.degree??360;this._resetGroupCurrentObjects(n=>{},n=>({attributeName:["opacity","rotate"],values:[[1,1],[0,i]]}),n=>{},n=>({attributeName:["opacity"],values:[[0,0]],immediate:!0}),t,e)}static flipCSS(t,e,i=Q){const n=t.getBoundingClientRect(),r=e.getBoundingClientRect(),a=A.getStyle(t,"backgroundColor"),o=A.getStyle(e,"backgroundColor");e.style.transition="none",e.style.left=""+n.left,e.style.top=""+n.top,e.style.width=n.width+"px",e.style.height=n.height+"px",a&&(e.style.backgroundColor=a),Dt.registerAccurateSetTimeout(()=>{e.style.transition=`all ${i.dur}ms cubic-bezier(${Rs(i.easeName??"linear").join(",")})`,e.style.left=""+r.left,e.style.top=""+r.top,e.style.width=r.width+"px",e.style.height=r.height+"px",o&&(e.style.backgroundColor=o)},i.begin)}}const Os=Ba("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 Ba(s,t=10){const e={},i=s.split(",");for(let n=0;n<i.length;n+=2){const r="&"+i[n+1]+";",a=parseInt(i[n],t);e[r]="&#"+a+";"}return e["\\xa0"]=" ",e}function $(s,t){const e=Object.keys(t);for(let i=0;i<e.length;i++)s=s.replace(new RegExp("{"+e[i]+"}","gi"),""+t[e[i]]);return s}function ke(s){let t,e;if(!s)throw new Error("cannot create a random attribute name for an undefined object");const i="ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz";t="";do for(t="",e=0;e<12;e++)t+=i[Math.floor(Math.random()*i.length)];while(s[t]);return t}function Ua(s){const t={left:"start",right:"end",center:"middle",start:"start",end:"end"};return t[s]||t.start}function za(s){const t={alphabetic:"alphabetic",hanging:"hanging",top:"text-before-edge",bottom:"text-after-edge",middle:"central"};return t[s]||t.alphabetic}const oe={strokeStyle:{svgAttr:"stroke",canvas:"#000000",svg:"none",apply:"stroke"},fillStyle:{svgAttr:"fill",canvas:"#000000",svg:null,apply:"fill"},lineCap:{svgAttr:"stroke-linecap",canvas:"butt",svg:"butt",apply:"stroke"},lineJoin:{svgAttr:"stroke-linejoin",canvas:"miter",svg:"miter",apply:"stroke"},miterLimit:{svgAttr:"stroke-miterlimit",canvas:10,svg:4,apply:"stroke"},lineWidth:{svgAttr:"stroke-width",canvas:1,svg:1,apply:"stroke"},globalAlpha:{svgAttr:"opacity",canvas:1,svg:1,apply:"fill stroke"},font:{canvas:"10px sans-serif"},shadowColor:{canvas:"#000000"},shadowOffsetX:{canvas:0},shadowOffsetY:{canvas:0},shadowBlur:{canvas:0},textAlign:{canvas:"start"},textBaseline:{canvas:"alphabetic"},lineDash:{svgAttr:"stroke-dasharray",canvas:[],svg:null,apply:"stroke"}};class Ie{__root;__ctx;constructor(t,e){this.__root=t,this.__ctx=e}addColorStop(t,e){const i=this.__ctx.__createElement("stop");if(i.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&&(i.setAttribute("stop-color",$("rgb({r},{g},{b})",{r:r[1],g:r[2],b:r[3]})),i.setAttribute("stop-opacity",r[4]))}else i.setAttribute("stop-color",e);this.__root.appendChild(i)}}class vi{__root;__ctx;constructor(t,e){this.__root=t,this.__ctx=e}}class he{__document=document;__canvas;__ctx;width;height;__styleStack;__groupStack;__rootSVG;__ids;__SVGdefs;__currentElement;__currentElementsToStyle=null;constructor({canvas:t,width:e=500,height:i=500,enableMirroring:n=!1}){this.enableMirroring=n,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=i),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(oe);for(let e=0,i=t.length;e<i;e++){const n=t[e];this[n]=oe[n].canvas}}__getStyleState(){const t={},e=Object.keys(oe);for(let i=0,n=e.length;i<n;i++){const r=e[i];t[r]=this[r]}return t}__applyStyleState(t){const e=Object.keys(t);for(let i=0,n=e.length;i<n;i++){const r=e[i];this[r]=t[r]}}__createElement(t,e={},i=!1){const n=this.__document.createElementNS("http://www.w3.org/2000/svg",t),r=Object.keys(e);i&&(n.setAttribute("fill","none"),n.setAttribute("stroke","none"));for(let a=0;a<r.length;a++){const o=r[a];n.setAttribute(o,e[o])}return n}__applyStyleToCurrentElement(t){let e=this.__currentElement;const i=this.__currentElementsToStyle;i&&(e.setAttribute(t,""),e=i.element,i.children.forEach(r=>{r.setAttribute(t,"")}));const n=Object.keys(oe);for(let r=0;r<n.length;r++){const a=oe[n[r]],o=this[n[r]];if(a.apply){if(o instanceof vi){if(o.__ctx)for(;o.__ctx.__SVGdefs.childNodes.length;){const h=o.__ctx.__SVGdefs.childNodes[0].getAttribute("id");this.__ids[h]=h,this.__SVGdefs.appendChild(o.__ctx.__SVGdefs.childNodes[0])}e.setAttribute(a.apply,$("url(#{id})",{id:o.__root.getAttribute("id")}))}else if(o instanceof Ie)e.setAttribute(a.apply,$("url(#{id})",{id:o.__root.getAttribute("id")}));else if(a.apply.indexOf(t)!==-1&&a.svg!==o)if((a.svgAttr==="stroke"||a.svgAttr==="fill")&&o.indexOf("rgba")!==-1){const c=/rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d?\.?\d*)\s*\)/gi.exec(o);e.setAttribute(a.svgAttr,$("rgb({r},{g},{b})",{r:c[1],g:c[2],b:c[3]}));let f=parseFloat(c[4]);const m=this.globalAlpha;m!=null&&(f*=m),e.setAttribute(a.svgAttr+"-opacity",""+f)}else{let h=a.svgAttr;if(n[r]==="globalAlpha"&&(h=t+"-"+a.svgAttr,e.getAttribute(h)))continue;h&&e.setAttribute(h,o)}}}}__closestGroupOrSvg(t){return t=t||this.__currentElement,t.nodeName==="g"||t.nodeName==="svg"?t:this.__closestGroupOrSvg(t.parentNode)}getSerializedSvg(t){let e=new XMLSerializer().serializeToString(this.__rootSVG);if(/xmlns="http:\/\/www\.w3\.org\/2000\/svg".+xmlns="http:\/\/www\.w3\.org\/2000\/svg/gi.test(e)&&(e=e.replace('xmlns="http://www.w3.org/2000/svg','xmlns:xlink="http://www.w3.org/1999/xlink')),t){const n=Object.keys(Os);for(let r=0,a=n.length;r<a;r++){const o=n[r],h=Os[o],c=new RegExp(o,"gi");c.test(e)&&(e=e.replace(c,h))}}return e}getSvg(){return this.__rootSVG}save(){const t=this.__createElement("g"),e=this.__closestGroupOrSvg();this.__groupStack.push(e),e.appendChild(t),this.__currentElement=t,this.__styleStack.push(this.__getStyleState())}restore(){this.__currentElementsToStyle=null;const t=this.__groupStack.pop();t?this.__currentElement=t:this.__currentElement=this.__rootSVG.childNodes[1];const e=this.__styleStack.pop();e&&this.__applyStyleState(e)}__addTransform(t){const e=this.__closestGroupOrSvg();if(e.childNodes.length>0){this.__currentElement.nodeName==="path"&&(this.__currentElementsToStyle||(this.__currentElementsToStyle={element:e,children:[]}),this.__currentElementsToStyle.children.push(this.__currentElement),this.__applyCurrentDefaultPath());const n=this.__createElement("g");e.appendChild(n),this.__currentElement=n}let i=this.__currentElement.getAttribute("transform");i?i+=" ":i="",i+=t,this.__currentElement.setAttribute("transform",i)}scale(t,e){e===void 0&&(e=t),this.__addTransform($("scale({x},{y})",{x:t,y:e}))}rotate(t){const e=t*180/Math.PI;this.__addTransform($("rotate({angle},{cx},{cy})",{angle:e,cx:0,cy:0}))}translate(t,e){this.__addTransform($("translate({x},{y})",{x:t,y:e}))}transform(t,e,i,n,r,a){this.__addTransform($("matrix({a},{b},{c},{d},{e},{f})",{a:t,b:e,c:i,d:n,e:r,f:a}))}beginPath(){this.__currentDefaultPath="",this.__currentPosition={};const t=this.__createElement("path",{},!0);this.__closestGroupOrSvg().appendChild(t),this.__currentElement=t}__applyCurrentDefaultPath(){const t=this.__currentElement;t.nodeName==="path"&&t.setAttribute("d",this.__currentDefaultPath)}__addPathCommand(t){this.__currentDefaultPath+=" ",this.__currentDefaultPath+=t}moveTo(t,e){this.__currentElement.nodeName!=="path"&&this.beginPath(),this.__currentPosition={x:t,y:e},this.__addPathCommand($("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($("L {x} {y}",this.__currentPosition)):this.__addPathCommand($("M {x} {y}",this.__currentPosition))}bezierCurveTo(t,e,i,n,r,a){this.__currentPosition={x:r,y:a},this.__addPathCommand($("C {cp1x} {cp1y} {cp2x} {cp2y} {x} {y}",{cp1x:t,cp1y:e,cp2x:i,cp2y:n,x:r,y:a}))}quadraticCurveTo(t,e,i,n){this.__currentPosition={x:i,y:n},this.__addPathCommand($("Q {cpx} {cpy} {x} {y}",{cpx:t,cpy:e,x:i,y:n}))}normalize(t){const e=Math.sqrt(t[0]*t[0]+t[1]*t[1]);return[t[0]/e,t[1]/e]}arcTo(t,e,i,n,r){const a=this.__currentPosition&&this.__currentPosition.x,o=this.__currentPosition&&this.__currentPosition.y;if(typeof a>"u"||typeof o>"u")return;if(r<0)throw new Error("IndexSizeError: The radius provided ("+r+") is negative.");if(a===t&&o===e||t===i&&e===n||r===0){this.lineTo(t,e);return}const h=this.normalize([a-t,o-e]),c=this.normalize([i-t,n-e]);if(h[0]*c[1]===h[1]*c[0]){this.lineTo(t,e);return}const f=h[0]*c[0]+h[1]*c[1],m=Math.acos(Math.abs(f)),w=this.normalize([h[0]+c[0],h[1]+c[1]]),p=r/Math.sin(m/2),y=t+p*w[0],x=e+p*w[1],b=[-h[1],h[0]],C=[c[1],-c[0]],_=function(L){const O=L[0];return L[1]>=0?Math.acos(O):-Math.acos(O)},I=_(b),E=_(C);this.lineTo(y+b[0]*r,x+b[1]*r),this.arc(y,x,r,I,E)}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,i,n){this.__currentElement.nodeName!=="path"&&this.beginPath(),this.moveTo(t,e),this.lineTo(t+i,e),this.lineTo(t+i,e+n),this.lineTo(t,e+n),this.lineTo(t,e),this.closePath()}fillRect(t,e,i,n){const r=this.__createElement("rect",{x:t,y:e,width:i,height:n},!0);this.__closestGroupOrSvg().appendChild(r),this.__currentElement=r,this.__applyStyleToCurrentElement("fill")}strokeRect(t,e,i,n){const r=this.__createElement("rect",{x:t,y:e,width:i,height:n},!0);this.__closestGroupOrSvg().appendChild(r),this.__currentElement=r,this.__applyStyleToCurrentElement("stroke")}__clearCanvas(){const e=this.__closestGroupOrSvg().getAttribute("transform"),i=this.__rootSVG.childNodes[1],n=i.childNodes;for(let r=n.length-1;r>=0;r--)n[r]&&i.removeChild(n[r]);this.__currentElement=i,this.__groupStack=[],e&&this.__addTransform(e)}clearRect(t,e,i,n){if(t===0&&e===0&&i===this.width&&n===this.height){this.__clearCanvas();return}const r=this.__closestGroupOrSvg(),a=this.__createElement("rect",{x:t,y:e,width:i,height:n,fill:"#FFFFFF"},!0);r.appendChild(a)}createLinearGradient(t,e,i,n){const r=this.__createElement("linearGradient",{id:ke(this.__ids),x1:t+"px",x2:i+"px",y1:e+"px",y2:n+"px",gradientUnits:"userSpaceOnUse"},!1);return this.__SVGdefs.appendChild(r),new Ie(r,this)}createRadialGradient(t,e,i,n,r,a){const o=this.__createElement("radialGradient",{id:ke(this.__ids),cx:n+"px",cy:r+"px",r:a+"px",fx:t+"px",fy:e+"px",gradientUnits:"userSpaceOnUse"},!1);return this.__SVGdefs.appendChild(o),new Ie(o,this)}__parseFont(){const e=/^\s*(?=(?:(?:[-a-z]+\s*){0,2}(italic|oblique))?)(?=(?:(?:[-a-z]+\s*){0,2}(small-caps))?)(?=(?:(?:[-a-z]+\s*){0,2}(bold(?:er)?|lighter|[1-9]00))?)(?:(?:normal|\1|\2|\3)\s*){0,3}((?:xx?-)?(?:small|large)|medium|smaller|larger|[.\d]+(?:%|in|[cem]m|ex|p[CustomCanvasContext]))(?:\s*\/\s*(normal|[.\d]+(?:%|in|[cem]m|ex|p[CustomCanvasContext])))?\s*([-,'"\sa-z0-9]+?)\s*$/i.exec(this.font),i={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"&&(i.decoration="underline"),this.__fontHref&&(i.href=this.__fontHref),i}__wrapTextLink(t,e){if(t.href){const i=this.__createElement("a");return i.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",t.href),i.appendChild(e),i}return e}__applyText(t,e,i,n){const r=this.__parseFont(),a=this.__closestGroupOrSvg(),o=this.__createElement("text",{"font-family":r.family,"font-size":r.size,"font-style":r.style,"font-weight":r.weight,"text-decoration":r.decoration,x:e,y:i,"text-anchor":Ua(this.textAlign),"dominant-baseline":za(this.textBaseline)},!0);o.appendChild(this.__document.createTextNode(t)),this.__currentElement=o,this.__applyStyleToCurrentElement(n),a.appendChild(this.__wrapTextLink(r,o))}fillText(t,e,i){this.__applyText(t,e,i,"fill")}strokeText(t,e,i){this.__applyText(t,e,i,"stroke")}measureText(t){return this.__ctx.font=this.font,this.__ctx.measureText(t)}arc(t,e,i,n,r,a){if(n===r)return;n=n%(2*Math.PI),r=r%(2*Math.PI),n===r&&(r=(r+2*Math.PI-.001*(a?-1:1))%(2*Math.PI));const o=t+i*Math.cos(r),h=e+i*Math.sin(r),c=t+i*Math.cos(n),f=e+i*Math.sin(n),m=a?0:1;let w=0,p=r-n;p<0&&(p+=2*Math.PI),a?w=p>Math.PI?0:1:w=p>Math.PI?1:0,this.lineTo(c,f),this.__addPathCommand($("A {rx} {ry} {xAxisRotation} {largeArcFlag} {sweepFlag} {endX} {endY}",{rx:i,ry:i,xAxisRotation:0,largeArcFlag:w,sweepFlag:m,endX:o,endY:h})),this.__currentPosition={x:o,y:h}}clip(){const t=this.__closestGroupOrSvg(),e=this.__createElement("clipPath"),i=ke(this.__ids),n=this.__createElement("g");this.__applyCurrentDefaultPath(),t.removeChild(this.__currentElement),e.setAttribute("id",i),e.appendChild(this.__currentElement),this.__SVGdefs.appendChild(e),t.setAttribute("clip-path",$("url(#{id})",{id:i})),t.appendChild(n),this.__currentElement=n}drawImage(...t){let e=t[0],i,n,r,a,o=0,h=0,c,f,m,w,p,y,x,b;if(t.length===3)i=t[1],n=t[2],c=e.width,f=e.height,r=c,a=f;else if(t.length===5)i=t[1],n=t[2],r=t[3],a=t[4],c=e.width,f=e.height;else if(t.length===9)o=t[1],h=t[2],c=t[3],f=t[4],i=t[5],n=t[6],r=t[7],a=t[8];else throw new Error("Invalid number of arguments passed to drawImage: "+arguments.length);const C=this.__closestGroupOrSvg();this.__currentElement;const _="translate("+i+", "+n+")";if(e instanceof he){if(m=e.getSvg().cloneNode(!0),m.childNodes&&m.childNodes.length>1){for(w=m.childNodes[0];w.childNodes.length;)b=w.childNodes[0].getAttribute("id"),this.__ids[b]=b,this.__SVGdefs.appendChild(w.childNodes[0]);if(p=m.childNodes[1],p){const I=p.getAttribute("transform");let E;I?E=I+" "+_:E=_,p.setAttribute("transform",E),C.appendChild(p)}}}else(e.nodeName==="CANVAS"||e.nodeName==="IMG")&&(y=this.__createElement("image"),y.setAttribute("width",r),y.setAttribute("height",a),y.setAttribute("preserveAspectRatio","none"),(o||h||c!==e.width||f!==e.height)&&(x=this.__document.createElement("canvas"),x.width=r,x.height=a,x.getContext("2d")?.drawImage(e,o,h,c,f,0,0,r,a),e=x),y.setAttribute("transform",_),y.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",e.nodeName==="CANVAS"?e.toDataURL():e.getAttribute("src")),C.appendChild(y))}createPattern(t,e){const i=this.__document.createElementNS("http://www.w3.org/2000/svg","pattern"),n=ke(this.__ids);let r;return i.setAttribute("id",n),t.nodeName==="CANVAS"||t.nodeName==="IMG"?(r=this.__document.createElementNS("http://www.w3.org/2000/svg","image"),r.setAttribute("width",""+t.width),r.setAttribute("height",""+t.height),r.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",t.nodeName==="CANVAS"?t.toDataURL():t.getAttribute("src")),i.appendChild(r),this.__SVGdefs.appendChild(i)):t instanceof he&&(i.setAttribute("width",""+t.width),i.setAttribute("height",""+t.height),i.appendChild(t.__rootSVG.childNodes[1]),this.__SVGdefs.appendChild(i)),new vi(i,this)}setLineDash(t){t&&t.length>0?this.lineDash=t.join(","):this.lineDash=null}drawFocusRing(){}createImageData(){}getImageData(){}putImageData(){}globalCompositeOperation(){}setTransform(){}}class Ns{canvas;context;customContext;currentPath2D=new Path2D;path2Ds=[];currentMatrix=new DOMMatrix;matrixs=[];hasSetCustomLineWidth=!1;hasSetCustomFillStyle=!1;constructor(t){this.canvas=t,this.context=t.getContext("2d",{willReadFrequently:!0}),this.customContext=new he({canvas:this.canvas,width:this.canvas.width,height:this.canvas.height})}set lineWidth(t){this.hasSetCustomLineWidth=!0,this.context.lineWidth=t,this.customContext.lineWidth=t}get lineWidth(){return this.context.lineWidth}set lineCap(t){this.context.lineCap=t,this.customContext.lineCap=t}get lineCap(){return this.context.lineCap}set lineJoin(t){this.context.lineJoin=t,this.customContext.lineCap=t}get lineJoin(){return this.context.lineJoin}set lineDashOffset(t){this.context.lineDashOffset=t,this.customContext.lineDashOffset=t}get lineDashOffset(){return this.context.lineDashOffset}set miterLimit(t){this.context.miterLimit=t,this.customContext.miterLimit=t}get miterLimit(){return this.context.miterLimit}set globalAlpha(t){this.context.globalAlpha=t,this.customContext.globalAlpha=t}get globalAlpha(){return this.context.globalAlpha}set fillStyle(t){this.hasSetCustomFillStyle=!0,typeof t=="string"||t instanceof CanvasGradient||t instanceof CanvasPattern?(this.context.fillStyle=t,this.customContext.fillStyle=t):(this.context.fillStyle=t.gradient,this.customContext.fillStyle=t.gradientCustom)}get fillStyle(){return this.context.fillStyle}set strokeStyle(t){typeof t=="string"||t instanceof CanvasGradient||t instanceof CanvasPattern?(this.context.strokeStyle=t,this.customContext.strokeStyle=t):(this.context.strokeStyle=t.gradient,this.customContext.strokeStyle=t.gradientCustom)}get strokeStyle(){return this.context.strokeStyle}set font(t){this.context.font=t,this.customContext.font=t}get font(){return this.context.font}fill(t){return t?this.context.fill(t):(this.context.fill(),this.customContext.fill()),this}fillRect(t,e,i,n){return this.context.fillRect(t,e,i,n),this.customContext.fillRect(t,e,i,n),this}fillText(t,e,i,n){return this.context.fillText(t,e,i,n),this.customContext.fillText(t,e,i),this}setLineDash(t){return this.context.setLineDash(t),this.customContext.setLineDash(t),this}stroke(t){return t?this.context.stroke(t):(this.context.stroke(),this.customContext.stroke()),this}strokeText(t,e,i,n){return this.context.strokeText(t,e,i,n),this.customContext.strokeText(t,e,i),this}strokeRect(t,e,i,n){return this.context.strokeRect(t,e,i,n),this.customContext.strokeRect(t,e,i,n),this}clearRect(t=0,e=0,i=this.canvas.width,n=this.canvas.height){return this.context.clearRect(t,e,i,n),this.customContext.clearRect(t,e,i,n),this}save(){return this.context.save(),this.customContext.save(),this.path2Ds.push(this.currentPath2D),this.matrixs.push(this.currentMatrix),this.currentPath2D=new Path2D,this.currentMatrix=new DOMMatrix,this}restore(){return this.context.restore(),this.customContext.restore(),this.hasSetCustomLineWidth=!1,this.hasSetCustomFillStyle=!1,this.currentPath2D=this.path2Ds.pop()||new Path2D,this.currentMatrix=this.matrixs.pop()||new DOMMatrix,this}beginPath(){return this.context.beginPath(),this.customContext.beginPath(),this}closePath(){return this.context.closePath(),this.customContext.closePath(),this.currentPath2D.closePath(),this}addPath(t=this.currentPath2D,e=this.currentMatrix){const i=new Path2D;i.addPath(t,e),this.currentPath2D=i}isPointInStroke(...t){return t[0]instanceof Path2D?this.context.isPointInStroke(t[0],t[1],t[2]):this.context.isPointInStroke(t[0],t[1])}isPointInPath(...t){return t[0]instanceof Path2D?this.context.isPointInPath(t[0],t[1],t[2]):this.context.isPointInPath(t[0],t[1])}translate(t,e){return this.context.translate(t,e),this.customContext.translate(t,e),this.currentMatrix.translate(t,e),this.addPath(),this}rotate(t){return this.context.rotate(t),this.customContext.rotate(t),this.currentMatrix.rotate(t),this.addPath(),this}scale(t,e=t){return this.context.scale(t,e),this.customContext.scale(t,e),this.currentMatrix.scale(t,e),this.addPath(),this}moveTo(t,e){return this.context.moveTo(t,e),this.customContext.moveTo(t,e),this.currentPath2D.moveTo(t,e),this}lineTo(t,e){return this.context.lineTo(t,e),this.customContext.lineTo(t,e),this.currentPath2D.lineTo(t,e),this}arc(t,e,i,n,r,a){return this.context.arc(t,e,i,n,r,a),this.customContext.arc(t,e,i,n,r,a?-1:1),this.currentPath2D.arc(t,e,i,n,r,a),this}arcTo(t,e,i,n,r){return this.context.arcTo(t,e,i,n,r),this.customContext.arcTo(t,e,i,n,r),this.currentPath2D.arcTo(t,e,i,n,r),this}ellipse(t,e,i,n,r,a,o,h){return this.context.ellipse(t,e,i,n,r,a,o,h),this.currentPath2D.ellipse(t,e,i,n,r,a,o,h),this}quadraticCurveTo(t,e,i,n){return this.context.quadraticCurveTo(t,e,i,n),this.customContext.quadraticCurveTo(t,e,i,n),this.currentPath2D.quadraticCurveTo(t,e,i,n),this}bezierCurveTo(t,e,i,n,r,a){return this.context.bezierCurveTo(t,e,i,n,r,a),this.customContext.bezierCurveTo(t,e,i,n,r,a),this.currentPath2D.bezierCurveTo(t,e,i,n,r,a),this}rect(t,e,i,n){return this.context.rect(t,e,i,n),this.customContext.rect(t,e,i,n),this.currentPath2D.rect(t,e,i,n),this}createLinearGradient(t,e,i,n,r){const a=this.context.createLinearGradient(t,e,i,n),o=this.customContext.createLinearGradient(t,e,i,n);return r&&Object.keys(r).forEach(h=>{const c=parseFloat(h);a.addColorStop(c,r[c]),o.addColorStop(c,r[c])}),{gradient:a,gradientCustom:o}}createRadialGradient(t,e,i,n,r,a,o){const h=this.context.createRadialGradient(t,e,i,n,r,a),c=this.customContext.createRadialGradient(t,e,i,n,r,a);return o&&Object.keys(o).forEach(f=>{const m=parseFloat(f);h.addColorStop(m,o[m]),c.addColorStop(m,o[m])}),{gradient:h,gradientCustom:c}}drawImage(t,...e){if(e.length===0)this.context.drawImage(t,0,0);else if(e.length===2){const i=e[0],n=e[1];this.context.drawImage(t,i,n)}else if(e.length===4){const i=e[0],n=e[1],r=e[2],a=e[3];this.context.drawImage(t,i,n,r,a)}else if(e.length===8){const i=e[0],n=e[1],r=e[2],a=e[3],o=e[4],h=e[5],c=e[6],f=e[7];this.context.drawImage(t,i,n,r,a,o,h,c,f)}else throw new Error("Invalid number of arguments passed to drawImage: "+e.length);return this.customContext.drawImage(t,...e),this}getImageData(t=0,e=0,i=this.canvas.width,n=this.canvas.height,r){return this.context.getImageData(t,e,i,n,r)}putImageData(t,e=0,i=0){return this.context.putImageData(t,e,i)}toRawSVG(){const t=this.customContext.getSerializedSvg(!0),e=this.customContext.getSvg();return{raw:t,element:e}}}class Va{app;ctx;shapes=[];isMouseDown=!1;draggingShapeID="";removes=[];constructor(t){this.app=t,this.ctx=new Ns(this.app.container),this.app.captureMove({start:()=>{this.isMouseDown=!0,this.setCursor()},end:()=>{this.isMouseDown=!1,this.draggingShapeID="",this.setCursor()},move:()=>{this.setCursor()}})}setCursor(){this.draggingShapeID?this.app.container.style.cursor="grabbing":this.shapes.filter(t=>t.shape.isMouseInShape&&t.dragMouseMove).length?this.app.container.style.cursor="grab":this.app.container.style.cursor="default"}flushShapes(t=[]){return this.shapes=[],gn(t)?this.shapes.push(...t):this.shapes.push(t),this}draw(){return this.removes.forEach(t=>t()),this.shapes.forEach(t=>{if(this.ctx.save(),t.followMouseMove&&(!Yt(t.shape.x,this.app.mousePoint.x,5)||!Yt(t.shape.y,this.app.mousePoint.y,5))&&(t.shape.angleTo(this.app.mousePoint),t.shape.followTo(this.app.mousePoint)),t.dragFreeEaseTo&&(this.isMouseDown||t.shape.nextFrameEaseTo(new Zt({x:t.dragFreeEaseTo.targetX,y:t.dragFreeEaseTo.targetY}),{easing:t.dragFreeEaseTo?.easing??.05})),t.clickInPath&&t.shape instanceof mi){const e=()=>{if(!(t.shape instanceof mi))return;const i=t.shape.pgas.findIndex(n=>n.pg.isPointInPath(this.ctx,this.app.mousePoint.x,this.app.mousePoint.y));i>=0&&t.clickInPath?.(i)};this.app.on("tap",e),this.removes.push(()=>{this.app.off("tap",e)})}if(t.extra?.(this.ctx),t.shape instanceof Et||this.ctx.translate(t.shape.x,t.shape.y),this.ctx.rotate(t.shape.rotate),this.ctx.scale(t.shape.scale,t.shape.scale),t.shape.toCanvasContext(this.ctx,{isLineThrough:t.isLineThrough}),t.shape.path2d=this.ctx.currentPath2D,t.shape.isMouseInShape=t.shape.getBoundingClientRect()?.isContainPoint(this.app.mousePoint.x,this.app.mousePoint.y)||this.ctx.isPointInPath(t.shape.path2d,this.app.mousePoint.x,this.app.mousePoint.y)||!1,this.ctx.hasSetCustomLineWidth&&this.ctx.stroke(),this.ctx.hasSetCustomFillStyle&&this.ctx.fill(),t.dragMouseMove&&!this.draggingShapeID&&this.isMouseDown&&t.shape.isMouseInShape&&(this.draggingShapeID=t.shape.id,t.shape.isDragging=!0,this.shapes.filter(e=>e.shape.id!=t.shape.id).forEach(e=>e.shape.isDragging=!1)),this.draggingShapeID==t.shape.id){t.shape.x=this.app.mousePoint.x,t.shape.y=this.app.mousePoint.y;const e=t.shape.getBoundingClientRect();e&&e.width&&e.height&&!t.shape.XYIsShapeCenter&&(t.shape.x-=e.width/2,t.shape.y-=e.height/2),t.shape instanceof Et||this.ctx.translate(t.shape.x,t.shape.y),t.shape.path2d=this.ctx.currentPath2D}this.ctx.restore()}),this}drawMouseMoveLine(t="line",e){switch(t){case"brush":const i=(e&&e.brushSize)??10,n=(e&&e.brushDensity)??50,r=(e&&e.brushColor)??"#000000",a=this.ctx.getImageData(0,0,this.ctx.canvas.width,this.ctx.canvas.height),o=a.data,h=be(r);return this.app.captureMove({move:()=>{if(this.isMouseDown){for(let c=0;c<n;c++){const f=Math.random()*Math.PI*2,m=Math.random()*i,w=this.app.mousePoint.x+Math.cos(f)*m|0,p=this.app.mousePoint.y+Math.sin(f)*m|0,y=(w+p*a.width)*4;o[y]=h>>16&255,o[y+1]=h>>8&255,o[y+2]=h&255,o[y+3]=255}this.ctx.putImageData(a)}}});case"line":default:return this.app.captureMove({start:c=>{this.ctx.beginPath(),this.app.setMousePoint(c),this.ctx.moveTo(this.app.mousePoint.x,this.app.mousePoint.y)},end:()=>{this.ctx.closePath()},move:()=>{this.isMouseDown&&(this.ctx.lineTo(this.app.mousePoint.x,this.app.mousePoint.y),this.ctx.stroke())}})}}}class Fs extends _t{app;rotate;scale;isMouseDownInBounds=!1;removeCaptureMove;constructor(t,e){super({x:0,y:0,...e}),this.rotate=e?.rotate??0,this.scale=e?.scale??1,this.app=t,this.removeCaptureMove=this.app.captureMove({start:i=>{this.isMouseDownInBounds=this.app.ctx?.isPointInPath(this.app.mousePoint.x,this.app.mousePoint.y)||this.getBoundingClientRect().isContainPoint(this.app.mousePoint.x,this.app.mousePoint.y)},end:i=>{this.isMouseDownInBounds=!1},move:i=>{}})}destroy(){this.removeCaptureMove()}draw(t){if(this.app.ctx){if(this.app.ctx.save(),t?.followMouseMove&&(!Yt(this.x,this.app.mousePoint.x,5)||!Yt(this.y,this.app.mousePoint.y,5))&&(this.rotate=this.angleTo(this.app.mousePoint),this.followTo(this.app.mousePoint)),t?.dragMouseMove){if(this.app.container.style.cursor="grab",this.isMouseDownInBounds){this.app.container.style.cursor="grabbing",this.x=this.app.mousePoint.x,this.y=this.app.mousePoint.y;const e=this.getBoundingClientRect();e.width&&e.height&&!this.radius&&(this.x-=this.getBoundingClientRect().width/2,this.y-=this.getBoundingClientRect().height/2)}}else this.app.container.style.cursor="default";t?.dragFreeEaseTo&&(this.isMouseDownInBounds||this.nextFrameEaseTo(new _t({x:t.dragFreeEaseTo.targetX,y:t.dragFreeEaseTo.targetY}),{easing:t.dragFreeEaseTo?.easing??.05})),t?.extra?.(),this.app.ctx?.translate(this.x,this.y),this.app.ctx?.rotate(this.rotate),this.app.ctx?.scale(this.scale,this.scale),t?.shape(),this.app.ctx.lineWidth>0&&this.app.ctx.stroke(),this.app.ctx?.restore()}}}class Xa extends Fs{constructor(t,e){super(t,e)}draw(t){super.draw({...t,extra:()=>{this.app.ctx&&(this.app.ctx.lineWidth=0,this.app.ctx.fillStyle="rgb(150,150,150)",t?.extra?.())},shape:()=>{this.app.ctx&&(this.app.ctx.beginPath(),this.app.ctx.moveTo(0,0),this.app.ctx.bezierCurveTo(15,0,15,-40,5,-30),this.app.ctx.lineTo(0,0),this.app.ctx.bezierCurveTo(-15,0,-15,-40,-5,-30),this.app.ctx.lineTo(0,0),this.app.ctx.fill(),this.app.ctx.beginPath(),this.app.ctx.arc(0,0,15,0,Math.PI*2,!0),this.app.ctx.fill())}})}}class Wa extends Fs{width;height;fillColor;constructor(t,e){super(t,e),this.width=e?.width??50,this.height=e?.height??50,this.fillColor=e?.fillColor??"#ff0000"}draw(t){super.draw({...t,extra:()=>{this.app.ctx&&(this.app.ctx.lineWidth=0,this.app.ctx.fillStyle=this.fillColor,t?.extra?.())},shape:()=>{if(!this.app.ctx)return;this.app.ctx.beginPath();let e=this.height*.3;this.app.ctx.moveTo(this.x,this.y+e),this.app.ctx.bezierCurveTo(this.x,this.y,this.x-this.width/2,this.y,this.x-this.width/2,this.y+e),this.app.ctx.bezierCurveTo(this.x-this.width/2,this.y+(this.height+e)/2,this.x,this.y+(this.height+e)/1.4,this.x,this.y+this.height),this.app.ctx.bezierCurveTo(this.x,this.y+(this.height+e)/1.8,this.x+this.width/2,this.y+(this.height+e)/2,this.x+this.width/2,this.y+e),this.app.ctx.bezierCurveTo(this.x+this.width/2,this.y,this.x,this.y,this.x,this.y+e),this.app.ctx.closePath(),this.app.ctx.fill()}})}}class Gs{x;y;z;brightness;constructor(t,e,i,n){this.x=t,this.y=e,this.z=i,this.brightness=n}setBrightness(t){this.brightness=Math.min(Math.max(t,0),1)}}class Ya{x;y;width;height;rotation;showFlame;constructor(){this.x=0,this.y=0,this.width=25,this.height=20,this.rotation=0,this.showFlame=!1}draw(t,e){t.save(),t.translate(this.x,this.y),t.rotate(this.rotation),t.lineWidth=1,t.strokeStyle="#ffffff",e?.(t),t.beginPath(),t.moveTo(10,0),t.lineTo(-10,10),t.lineTo(-5,0),t.lineTo(-10,-10),t.lineTo(10,0),t.closePath(),t.stroke(),this.showFlame&&(t.beginPath(),t.moveTo(-7.5,-5),t.lineTo(-15,0),t.lineTo(-7.5,5),t.closePath(),t.stroke()),t.restore()}}class Ha{x;y;scaleX;scaleY;color;alpha;lineWidth;branch;constructor(){this.x=0,this.y=0,this.scaleX=1,this.scaleY=1,this.color="#ffffff",this.alpha=1,this.lineWidth=1,this.branch=[],this.branch[0]=-140-Math.random()*20,this.branch[1]=-30-Math.random()*30,this.branch[2]=Math.random()*80-40,this.branch[3]=-100-Math.random()*40,this.branch[4]=-60-Math.random()*40,this.branch[5]=Math.random()*60-30,this.branch[6]=-110-Math.random()*20}draw(t,e){t.save(),t.translate(this.x,this.y),t.scale(this.scaleX,this.scaleY),t.lineWidth=this.lineWidth,t.strokeStyle=ni(this.color,this.alpha),e?.(t),t.beginPath(),t.moveTo(0,0),t.lineTo(0,this.branch[0]),t.moveTo(0,this.branch[1]),t.lineTo(this.branch[2],this.branch[3]),t.moveTo(0,this.branch[4]),t.lineTo(this.branch[5],this.branch[6]),t.stroke(),t.restore()}}class ja{x;y;z;fl;vpX;vpY;cX;cY;cZ;constructor(t,e,i){this.x=t,this.y=e,this.z=i,this.fl=250,this.vpX=0,this.vpY=0,this.cX=0,this.cY=0,this.cZ=0}setVanishingPoint(t,e){this.vpX=t,this.vpY=e}setCenter(t,e,i){this.cX=t,this.cY=e,this.cZ=i}rotateX(t){const e=Math.cos(t),i=Math.sin(t),n=this.y*e-this.z*i,r=this.z*e+this.y*i;this.y=n,this.z=r}rotateY(t){const e=Math.cos(t),i=Math.sin(t),n=this.x*e-this.z*i,r=this.z*e+this.x*i;this.x=n,this.z=r}rotateZ(t){const e=Math.cos(t),i=Math.sin(t),n=this.x*e-this.y*i,r=this.y*e+this.x*i;this.x=n,this.y=r}getScreenX(){const t=this.fl/(this.fl+this.z+this.cZ);return this.vpX+(this.cX+this.x)*t}getScreenY(){const t=this.fl/(this.fl+this.z+this.cZ);return this.vpY+(this.cY+this.y)*t}}class qa{pointA;pointB;pointC;color;lineWidth;alpha;constructor(t,e,i,n="#ff0000"){this.pointA=t,this.pointB=e,this.pointC=i,this.color=n,this.lineWidth=1,this.alpha=1}draw(t,e){this.isBackface()||(t.save(),t.lineWidth=this.lineWidth,t.fillStyle=t.strokeStyle=ni(this.color,this.alpha),e?.(t),t.beginPath(),t.moveTo(this.pointA.getScreenX(),this.pointA.getScreenY()),t.lineTo(this.pointB.getScreenX(),this.pointB.getScreenY()),t.lineTo(this.pointC.getScreenX(),this.pointC.getScreenY()),t.closePath(),t.fill(),this.lineWidth>0&&t.stroke(),t.restore())}getDepth(){return Math.min(this.pointA.z,this.pointB.z,this.pointC.z)}isBackface(){const t=this.pointC.getScreenX()-this.pointA.getScreenX(),e=this.pointC.getScreenY()-this.pointA.getScreenY(),i=this.pointB.getScreenX()-this.pointC.getScreenX(),n=this.pointB.getScreenY()-this.pointC.getScreenY();return t*n>e*i}}class $a{pointA;pointB;pointC;color;lineWidth;alpha;light;constructor(t,e,i,n="#ff0000"){this.pointA=t,this.pointB=e,this.pointC=i,this.color=n,this.lineWidth=1,this.alpha=1,this.light=new Gs(0,0,0,1)}draw(t,e){this.isBackface()||(t.save(),t.lineWidth=this.lineWidth,t.fillStyle=t.strokeStyle=this.getAdjustedColor(),e?.(t),t.beginPath(),t.moveTo(this.pointA.getScreenX(),this.pointA.getScreenY()),t.lineTo(this.pointB.getScreenX(),this.pointB.getScreenY()),t.lineTo(this.pointC.getScreenX(),this.pointC.getScreenY()),t.closePath(),t.fill(),this.lineWidth>0&&t.stroke(),t.restore())}getDepth(){return Math.min(this.pointA.z,this.pointB.z,this.pointC.z)}isBackface(){const t=this.pointC.getScreenX()-this.pointA.getScreenX(),e=this.pointC.getScreenY()-this.pointA.getScreenY(),i=this.pointB.getScreenX()-this.pointC.getScreenX(),n=this.pointB.getScreenY()-this.pointC.getScreenY();return t*n>e*i}getAdjustedColor(){const t=be(this.color);let e=t>>16,i=t>>8&255,n=t&255;const r=this.getLightFactor();return e*=r,i*=r,n*=r,ds(e<<16|i<<8|n)}getLightFactor(){const t={x:this.pointA.x-this.pointB.x,y:this.pointA.y-this.pointB.y,z:this.pointA.z-this.pointB.z},e={x:this.pointB.x-this.pointC.x,y:this.pointB.y-this.pointC.y,z:this.pointB.z-this.pointC.z},i={x:t.y*e.z-t.z*e.y,y:-(t.x*e.z-t.z*e.x),z:t.x*e.y-t.y*e.x},n=i.x*this.light.x+i.y*this.light.y+i.z*this.light.z,r=Math.sqrt(i.x*i.x+i.y*i.y+i.z*i.z),a=Math.sqrt(this.light.x*this.light.x+this.light.y*this.light.y+this.light.z*this.light.z);return Math.acos(n/(r*a))/Math.PI*this.light.brightness}}class Ja{min;max;value;x;y;width;height;backColor;backBorderColor;backWidth;handleColor;handleBorderColor;handleHeight;handleY;onchange;prevCanvas;currentContext;animatedID=0;constructor(t=0,e=100,i=0,n){this.min=t,this.max=e,this.value=i,this.onchange=n,this.x=0,this.y=0,this.width=16,this.height=100,this.backColor="#cccccc",this.backBorderColor="#999999",this.backWidth=4,this.handleColor="#eeeeee",this.handleBorderColor="#cccccc",this.handleHeight=6,this.handleY=0,this.updatePosition()}draw(t,e){this.currentContext=t,t.save(),t.translate(this.x,this.y),e?.(t),t.clearRect(this.x,this.y,this.width,this.height),t.fillStyle=this.backColor,t.beginPath(),t.fillRect(this.width/2-this.backWidth/2,0,this.backWidth,this.height),t.closePath(),t.strokeStyle=this.handleBorderColor,t.fillStyle=this.handleColor,t.beginPath(),t.rect(0,this.handleY,this.width,this.handleHeight),t.closePath(),t.fill(),t.stroke(),t.restore(),(!this.prevCanvas||this.prevCanvas!=t.canvas)&&(this.captureMouse(t.canvas),this.prevCanvas=t.canvas)}updateValue(){const t=this.value,e=this.height-this.handleHeight,i=this.max-this.min;this.value=(e-this.handleY)/e*i+this.min,this.value!==t&&(this.onchange?.(this.value),Dt.register(()=>this.currentContext?(this.draw(this.currentContext),!0):!1))}updatePosition(){const t=this.height-this.handleHeight,e=this.max-this.min;this.handleY=t-(this.value-this.min)/e*t}captureMouse(t){const e=new ot({x:0,y:0,width:0,height:0}),i=()=>{e.x=this.x,e.y=this.y+this.handleY,e.width=this.width,e.height=this.handleHeight};i();let n=!1;const r=new U(t);r.captureMove({move:()=>{if(n){const a=r.mousePoint.y-this.y;this.handleY=Math.min(this.height-this.handleHeight,Math.max(a,0)),this.updateValue()}},start:()=>{n=e.isContainPoint(r.mousePoint.x,r.mousePoint.y)},end:()=>{i()}})}}class Za{R;r;O;constructor(t,e,i){this.R=t,this.r=e,this.O=i}draw(t,e){t.save(),e?.(t);let i=this.R-this.O,n=0,r=1;t.beginPath(),t.moveTo(i,n);let a,o;do{if(r>2e4)break;a=(this.R+this.r)*Math.cos(r*Math.PI/72)-(this.r+this.O)*Math.cos((this.R+this.r)/this.r*(r*Math.PI/72)),o=(this.R+this.r)*Math.sin(r*Math.PI/72)-(this.r+this.O)*Math.sin((this.R+this.r)/this.r*(r*Math.PI/72)),t.lineTo(a,o),i=a,n=o,r++}while(a!=this.R-this.O&&o!=0);t.stroke(),t.restore()}}class Ka{r;constructor(t){this.r=t}draw(t,e){t.save(),e?.(t),t.beginPath(),t.moveTo(this.r,0);for(let i=0;i<9;i++)t.rotate(Math.PI/5),i%2==0?t.lineTo(this.r/.525731*.200811,0):t.lineTo(this.r,0);t.closePath(),t.fill(),t.restore()}}class Qa{startX;startY;width;height;constructor(t,e,i,n){this.startX=t,this.startY=e,this.width=i,this.height=n}draw(t,e){t.save(),e?.(t);let i=0;const n=()=>{t.clearRect(this.startX,this.startY,this.width,this.height),t.setLineDash([4,2]),t.lineDashOffset=-i,t.strokeRect(this.startX,this.startY,this.width,this.height)};function r(){i++,i>16&&(i=0),n(),setTimeout(r,40)}r(),t.restore()}}class to{localVideoUtil;remoteVideoUtil;localPeerConnection=null;remotePeerConnection=null;constructor(t,e){this.localVideoUtil=new Kt(t),this.remoteVideoUtil=new Kt(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(i=>{this.localVideoUtil.setSrcObject(i),t(i)}).catch(i=>{this.trace(`navigator.getUserMedia error: ${i}.`),e(i)})})}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(),i=t.getAudioTracks();e.length>0&&this.trace(`Using video device: ${e[0].label}.`),i.length>0&&this.trace(`Using audio device: ${i[0].label}.`);const n=void 0,r=new RTCPeerConnection(n);this.localPeerConnection=r,this.trace("Created local peer connection object localPeerConnection."),r.addEventListener("icecandidate",this.handleConnection),r.addEventListener("iceconnectionstatechange",this.handleConnectionChange);const a=new RTCPeerConnection(n);this.remotePeerConnection=a,this.trace("Created remote peer connection object remotePeerConnection."),a.addEventListener("icecandidate",this.handleConnection),a.addEventListener("iceconnectionstatechange",this.handleConnectionChange),a.addEventListener("track",this.gotRemoteMediaStream),this.trace("Add local localStream to localPeerConnection."),r.addTrack(e[0],t),r.addTrack(i[0],t),this.trace("localPeerConnection createOffer start."),r.createOffer({offerToReceiveVideo:!0}).then(o=>this.createdOffer(o)).catch(o=>this.setSessionDescriptionError(o))}handleConnection(t){const e=t.target,i=t.candidate;if(e&&i){const n=new RTCIceCandidate(i),r=this.getOtherPeer(e);r&&(r.addIceCandidate(n).then(()=>{this.handleConnectionSuccess(e)}).catch(a=>{this.handleConnectionFailure(e,a)}),this.trace(`${this.getPeerName(e)} ICE candidate:
|
|
40
36
|
${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:
|
|
41
37
|
${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:
|
|
42
38
|
${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:
|
|
43
|
-
${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 dc{canvas;gl;constructor(t){this.canvas=t;const e={alpha:!0,premultipliedAlpha:!1};if(this.gl=this.canvas.getContext("webgl",e),!this.gl)throw new Error("WebGL failed to initialize.")}}function Xs(i,t){return!i||i.parentElement===null?t:Xs(i.parentElement,t.concat([i]))}const ur=function(i,t){return getComputedStyle(i,null).getPropertyValue(t)},pc=function(i){return ur(i,"overflow")+ur(i,"overflow-y")+ur(i,"overflow-x")},mc=function(i){return/(auto|scroll)/.test(pc(i))};function gc(i){if(!(i instanceof HTMLElement||i instanceof SVGElement))return;const t=Xs(i.parentElement,[]);for(let e=0;e<t.length;e+=1)if(mc(t[e]))return t[e];return document.scrollingElement||document.documentElement}const Hs=[],Ws={};function fr(i){Hs.push(i)}function vc(i,t=!1){const e=Ps();if(Ws[e])return;wx.error(s=>{console.log(s.errMsg??JSON.stringify(s))}),wx.ready(()=>{Hs.forEach(s=>s())});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"],r=["wx-open-launch-app","wx-open-launch-app","wx-open-subscribe","wx-open-audio"];wx.config(Object.assign(i,{debug:t,jsApiList:n,openTagList:r})),Ws[e]=!0}function yc(i){return new Promise((t,e)=>{wx.checkJsApi({jsApiList:[i],success:function(n){n.checkResult[i]?t(!0):e(!1)},fail:function(){e(!1)}})})}function wc(i){fr(function(){wx.updateAppMessageShareData(i)})}function xc(i){fr(function(){wx.updateTimelineShareData(i)})}function bc(i){wx.chooseImage(i)}function _c(i){wx.previewImage(i)}function Cc(i){wx.uploadImage(i)}function Tc(i){wx.downloadImage(i)}function Sc(i){wx.getLocalImgData(i)}function Ec(){wx.startRecord()}function Pc(i){wx.stopRecord(i)}function kc(i){wx.onVoiceRecordEnd(i)}function Ac(i){wx.playVoice(i)}function Mc(i){wx.pauseVoice(i)}function Ic(i){wx.stopVoice(i)}function Lc(i){wx.onVoicePlayEnd(i)}function Dc(i){wx.uploadVoice(i)}function Rc(i){wx.downloadVoice(i)}function Oc(i){wx.translateVoice(i)}function Nc(i){wx.getNetworkType(i)}function Bc(i){wx.openLocation(i)}function Fc(i){wx.getLocation(i)}function zc(i){wx.scanQRCode(i)}function Uc(i,t,e){function n(){WeixinJSBridge.invoke("getBrandWCPayRequest",i,function(r){r.err_msg=="get_brand_wcpay_request:ok"?t():e(r.err_msg)})}typeof WeixinJSBridge>"u"?document.addEventListener?document.addEventListener("WeixinJSBridgeReady",n,!1):document.attachEvent&&(document.attachEvent("WeixinJSBridgeReady",n),document.attachEvent("onWeixinJSBridgeReady",n)):n()}function Gc(i){window.AlipayJSBridge?i&&i():document.addEventListener("AlipayJSBridgeReady",i,!1)}function Un(i,t){let e="未知错误";switch(i.error){case 1:e="接口不存在";break;case 2:e="参数无效";break;case 3:e="发生未知错误";break;case 4:e="接口无权限";break;case 10:e="用户取消";break;case 11:e="操作失败",t==="chooseImage"&&(e="操作失败(权限不够)");break;case 12:e="GPS打开,但定位失败";break;case 13:e="获取地理位置信息失败";break;case 14:e="定位超时";break;case 15:e="网络错误";break;case 16:e="GPS未打开或用户未授权";break}return`${i.error}(${e}): ${i.errorMessage}`}function Vc(i,t,e){ap.tradePay(Object.assign(i,{}),function(n){let r="未知错误";switch(n.resultCode){case 9e3:return r="订单支付成功",t?.(r);case 8e3:r="正在处理中";break;case 4e3:r="订单支付失败";break;case 6001:r="用户中途取消";break;case 6002:r="网络连接出错";break;case 99:r="用户点击忘记密码导致快捷界面退出(only iOS)";break}e?.(r)})}function jc(i,t,e){ap.scan(Object.assign(i,{fail:n=>{e?.(Un(n))}}),function(n){t?.(n.code)})}function Xc(i,t,e){ap.getLocation(Object.assign(i,{fail:n=>{e?.(Un(n))}}),function(n){t?.(n)})}function Hc(i,t,e){ap.openLocation(Object.assign(i,{fail:n=>{e?.(Un(n))}}),function(){t?.()})}function Wc(i,t,e){ap.chooseImage(Object.assign(i,{fail:n=>{e?.(Un(n,"chooseImage"))}}),function(n){t?.(n)})}function Yc(i,t,e){ap.previewImage(Object.assign(i,{fail:n=>{e?.(Un(n))}}),function(){t?.()})}class qc{map;constructor(t,e=120.619585,n=31.299379,r=18){this.map=new T.Map(t),this.map.centerAndZoom(new T.LngLat(e,n),r)}}M.AnimateOperation=Ve,M.CanvasOperation=Qi,M.CustomCanvasContext=Mn,M.CustomCanvasGradient=Jn,M.CustomCanvasPattern=zi,M.DOMEventBus=Gt,M.DOMKey=Kr,M.DOMQuery=zt,M.DOMToBlob=Dr,M.DOMToString=Lr,M.DOMUtil=St,M.DOMVideo=Rn,M.Dep=Fs,M.HSVToRGBObject=Oo,M.Matrix=Ht,M.Matrix3D=Ze,M.PathGroup=Ke,M.Point=fe,M.Polygon=Dn,M.QRCode=Ge,M.RGBStringToHexString=Do,M.RGBToHSVObject=No,M.Rect=ln,M.SVGOperation=ze,M.ShapeArmyAnts=lc,M.ShapeArrow=qh,M.ShapeBall=$h,M.ShapeFox=Kh,M.ShapeHeart=tc,M.ShapeLight=js,M.ShapeLine=Jh,M.ShapePoint3d=ic,M.ShapeRabbit=Qh,M.ShapeRect=Zh,M.ShapeSegment=oc,M.ShapeShip=ec,M.ShapeSlider=ac,M.ShapeSmileFace=uc,M.ShapeSpirograph=hc,M.ShapeStar=cc,M.ShapeTree=nc,M.ShapeTriangle=rc,M.ShapeTriangleLight=sc,M.TWEEN=ui,M.Tween=Gs,M.Vector=hi,M.WebGLRenderer=dc,M.WebRTCClient=fc,M.WebSocketClient=xa,M.YZRaphael=Ki,M.absolutize=Qn,M.addWatermark=kh,M.addWxJsReadyFnBeforeConfig=fr,M.ajax=Oh,M.aliJsChooseImage=Wc,M.aliJsGetLocation=Xc,M.aliJsOpenLocation=Hc,M.aliJsPreviewImage=Yc,M.aliJsReady=Gc,M.aliJsScan=jc,M.aliJsTradePay=Vc,M.angle=Ni,M.animateInWeb=zs,M.appendURLSearchString=ri,M.base64URLDecode=Fo,M.base64URLEncode=Bo,M.blobToRawImage=th,M.canDrawBitmap=Xa,M.canUsePaths=ja,M.canUseWorker=$r,M.changeBrightness=Eh,M.changeDiaphaneity=Ph,M.changeSize=Sh,M.checkWxJsApi=yc,M.clearCookies=ko,M.colorNumberToHexString=Ts,M.colorNumberToRGBString=Ss,M.createXMLHttpRequest=or,M.debugObject=Wa,M.debugObjectProperty=Ha,M.distance=Zr,M.dquery=tr,M.drawQRCodeToCanvas=Dh,M.fileOrBlobToDataURL=sr,M.fileToArrayBufferPromise=Or,M.flipSideToSide=nh,M.flipUpsideDown=ih,M.formDataToSearchString=rr,M.fromAngleAndLength=Bi,M.getBrowserClient=Li,M.getBrowserClientVersion=Ma,M.getBrowserLanguage=La,M.getColorScheme=Cs,M.getCookie=Eo,M.getCookieObject=Po,M.getDirection=Ja,M.getElementLeftPositionInPage2=Gr,M.getElementPositionInPage=Ur,M.getElementPositionInPage2=Ta,M.getElementPositionInViewport=Sa,M.getElementTopPositionInPage2=Vr,M.getFileExtensionFromFile=Nr,M.getFileTypeFromFile=ma,M.getFilesImageInfo=qo,M.getFormSubmitData=Rh,M.getGlobal=Ii,M.getImageAspectRatio=Yo,M.getImageDataByAIData=Mh,M.getImageDataFromBitmap=Jo,M.getImageDataFromUrl=As,M.getImageDataFromVideo=$o,M.getImageMainColor=eh,M.getInternetExplorerVersion=Hr,M.getMousePositionInElement=Hn,M.getMousePositionInPage=jr,M.getMousePositionInViewport=ka,M.getOperatingSystem=Wn,M.getOperatingSystemVersion=Aa,M.getPageBodyElement=_a,M.getPageDocumentElement=cn,M.getPageSize=Ca,M.getPointAtLength=vs,M.getRaphael=Co,M.getRawImageInfo=ai,M.getRelativeBoundingClientRect=Ea,M.getScreenElement=ba,M.getScrollParent=gc,M.getTimeZone=Da,M.getTotalLength=gs,M.getURL=ir,M.getUserGeolocationPromise=Ia,M.getVerticalScrollPercentInPage=Pa,M.getViewportSize=zr,M.getWorker=Wo,M.gifImage=Ls,M.h=wa,M.handleDragAndDropFiles=va,M.handleInputFiles=ga,M.hasDocument=Ua,M.hasHistory=Ga,M.hasWindow=qr,M.hexStringToColorNumber=ii,M.hexStringToRGBString=nr,M.ifWebFileHasChanged=Nh,M.imageDataToBitmap=Zo,M.imageDataToBlob=Qo,M.imageDataToDataURL=Ko,M.injectWxJsConfig=vc,M.isAliBrowser=Yr,M.isAliMiniProgram=Fa,M.isAndroid=Xr,M.isAppleDevice=Ra,M.isBrowserSupportFileAPI=Va,M.isDarkMode=Na,M.isIE=za,M.isIOS=Di,M.isMacOS=Ri,M.isMobile=Oa,M.isPointInPath=ys,M.isPointInStroke=ws,M.isSvgPath=as,M.isURL=zo,M.isWxBrowser=Wr,M.isWxMiniProgram=Ba,M.jpgToPng=bh,M.leftRotate=rh,M.linkExport=Ai,M.localstorage=er,M.mapTDTJSSDK=qc,M.marginSharpen=xh,M.microTask=ya,M.mosaic=Ah,M.mount=kn,M.normalize=ti,M.normalizePoint=Fi,M.onHashChange=Xo,M.onHistoryChange=Ho,M.onURLChange=jo,M.outputGifBase64=Ds,M.outputQRCodeBase64=Lh,M.parse=Kn,M.parseTransformToMatrix=un,M.parseURL=Es,M.patch=Br,M.patchDOM=Fr,M.pngToJpg=_h,M.radiusClip=Th,M.randomColorHexString=Io,M.randomColorHexString2=Lo,M.randomColorNumber=Mo,M.rappar=ss,M.reactiveVue2=Fh,M.reactiveVue3=zh,M.readFileInBrowser=Mi,M.recordToSearchString=ks,M.recordToSearchString2=Vo,M.rectClip=Ch,M.relative=ao,M.rightRotate=sh,M.searchStringToRecord=Uo,M.searchStringToRecord2=Go,M.selectFileInBrowser=Rr,M.setColorScheme=ni,M.setCookie=So,M.setRem=Ya,M.shadeColor=Ro,M.sharpen=wh,M.singletonGlobalAnimateInWeb=ci,M.stringToBlob=ki,M.stringToDOM=pa,M.theme=Ao,M.toBlackAndWhite=hh,M.toBlue=fh,M.toBlueAndGreen=mh,M.toBlueAndGrey=yh,M.toDegree=Oi,M.toGreen=uh,M.toGreenAndGrey=vh,M.toGrey=ah,M.toGrey2=oh,M.toOpposite=ch,M.toRadian=Yn,M.toRed=lh,M.toRedAndBlue=ph,M.toRedAndGreen=dh,M.toRedAndGrey=gh,M.trimURLHash=Ps,M.watchEffect=Bh,M.wxJsChooseImage=bc,M.wxJsDownloadImage=Tc,M.wxJsDownloadVoice=Rc,M.wxJsGetLocalImgData=Sc,M.wxJsGetLocation=Fc,M.wxJsGetNetworkType=Nc,M.wxJsOnVoicePlayEnd=Lc,M.wxJsOnVoiceRecordEnd=kc,M.wxJsOpenLocation=Bc,M.wxJsPauseVoice=Mc,M.wxJsPay=Uc,M.wxJsPlayVoice=Ac,M.wxJsPreviewImage=_c,M.wxJsScanQRCode=zc,M.wxJsStartRecord=Ec,M.wxJsStopRecord=Pc,M.wxJsStopVoice=Ic,M.wxJsTranslateVoice=Oc,M.wxJsUpdateAppMessageShareData=wc,M.wxJsUpdateTimelineShareData=xc,M.wxJsUploadImage=Cc,M.wxJsUploadVoice=Dc,Object.defineProperty(M,Symbol.toStringTag,{value:"Module"})});
|
|
39
|
+
${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 i=this.getPeerName(t);this.trace(`${i} ${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 i=document.createElement("div");i.innerHTML=`<div>${e}, ${t}</div>`,document.getElementById("trace")?.appendChild(i)}getOtherPeer(t){return t===this.localPeerConnection?this.remotePeerConnection:this.localPeerConnection}getPeerName(t){return t===this.localPeerConnection?"localPeerConnection":"remotePeerConnection"}}class eo{canvas;gl;constructor(t){this.canvas=t;const e={alpha:!0,premultipliedAlpha:!1};if(this.gl=this.canvas.getContext("webgl",e),!this.gl)throw new Error("WebGL failed to initialize.")}}function Bs(s,t){return!s||s.parentElement===null?t:Bs(s.parentElement,t.concat([s]))}const bi=function(s,t){return getComputedStyle(s,null).getPropertyValue(t)},io=function(s){return bi(s,"overflow")+bi(s,"overflow-y")+bi(s,"overflow-x")},so=function(s){return/(auto|scroll)/.test(io(s))};function no(s){if(!(s instanceof HTMLElement||s instanceof SVGElement))return;const t=Bs(s.parentElement,[]);for(let e=0;e<t.length;e+=1)if(so(t[e]))return t[e];return document.scrollingElement||document.documentElement}const Us=[],zs={};function xi(s){Us.push(s)}function ro(s,t=!1){const e=ps();if(zs[e])return;wx.error(r=>{console.log(r.errMsg??JSON.stringify(r))}),wx.ready(()=>{Us.forEach(r=>r())});const i=["updateAppMessageShareData","updateTimelineShareData","onMenuShareWeibo","onMenuShareQZone","startRecord","stopRecord","onVoiceRecordEnd","playVoice","pauseVoice","stopVoice","onVoicePlayEnd","uploadVoice","downloadVoice","chooseImage","previewImage","uploadImage","downloadImage","getLocalImgData","translateVoice","getNetworkType","openLocation","getLocation","hideOptionMenu","showOptionMenu","hideMenuItems","showMenuItems","hideAllNonBaseMenuItem","showAllNonBaseMenuItem","closeWindow","scanQRCode","openProductSpecificView","addCard","chooseCard","openCard"],n=["wx-open-launch-app","wx-open-launch-app","wx-open-subscribe","wx-open-audio"];wx.config(Object.assign(s,{debug:t,jsApiList:i,openTagList:n})),zs[e]=!0}function ao(s){return new Promise((t,e)=>{wx.checkJsApi({jsApiList:[s],success:function(i){i.checkResult[s]?t(!0):e(!1)},fail:function(){e(!1)}})})}function oo(s){xi(function(){wx.updateAppMessageShareData(s)})}function ho(s){xi(function(){wx.updateTimelineShareData(s)})}function co(s){wx.chooseImage(s)}function lo(s){wx.previewImage(s)}function uo(s){wx.uploadImage(s)}function fo(s){wx.downloadImage(s)}function mo(s){wx.getLocalImgData(s)}function go(){wx.startRecord()}function po(s){wx.stopRecord(s)}function wo(s){wx.onVoiceRecordEnd(s)}function yo(s){wx.playVoice(s)}function vo(s){wx.pauseVoice(s)}function bo(s){wx.stopVoice(s)}function xo(s){wx.onVoicePlayEnd(s)}function Co(s){wx.uploadVoice(s)}function To(s){wx.downloadVoice(s)}function _o(s){wx.translateVoice(s)}function So(s){wx.getNetworkType(s)}function Po(s){wx.openLocation(s)}function Eo(s){wx.getLocation(s)}function ko(s){wx.scanQRCode(s)}function Io(s,t,e){function i(){WeixinJSBridge.invoke("getBrandWCPayRequest",s,function(n){n.err_msg=="get_brand_wcpay_request:ok"?t():e(n.err_msg)})}typeof WeixinJSBridge>"u"?document.addEventListener?document.addEventListener("WeixinJSBridgeReady",i,!1):document.attachEvent&&(document.attachEvent("WeixinJSBridgeReady",i),document.attachEvent("onWeixinJSBridgeReady",i)):i()}function Mo(s){window.AlipayJSBridge?s&&s():document.addEventListener("AlipayJSBridgeReady",s,!1)}function ce(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 Do(s,t,e){ap.tradePay(Object.assign(s,{}),function(i){let n="未知错误";switch(i.resultCode){case 9e3:return n="订单支付成功",t?.(n);case 8e3:n="正在处理中";break;case 4e3:n="订单支付失败";break;case 6001:n="用户中途取消";break;case 6002:n="网络连接出错";break;case 99:n="用户点击忘记密码导致快捷界面退出(only iOS)";break}e?.(n)})}function Ao(s,t,e){ap.scan(Object.assign(s,{fail:i=>{e?.(ce(i))}}),function(i){t?.(i.code)})}function Lo(s,t,e){ap.getLocation(Object.assign(s,{fail:i=>{e?.(ce(i))}}),function(i){t?.(i)})}function Ro(s,t,e){ap.openLocation(Object.assign(s,{fail:i=>{e?.(ce(i))}}),function(){t?.()})}function Oo(s,t,e){ap.chooseImage(Object.assign(s,{fail:i=>{e?.(ce(i,"chooseImage"))}}),function(i){t?.(i)})}function No(s,t,e){ap.previewImage(Object.assign(s,{fail:i=>{e?.(ce(i))}}),function(){t?.()})}class Fo{map;constructor(t,e=120.619585,i=31.299379,n=18){this.map=new T.Map(t),this.map.centerAndZoom(new T.LngLat(e,i),n)}}d.AnimateOperation=vt,d.Arc=ie,d.Arrow=Ia,d.Canvas=Va,d.CanvasOperation=Ns,d.CubicBezier=zt,d.CustomCanvasContext=he,d.CustomCanvasGradient=Ie,d.CustomCanvasPattern=vi,d.DOMEventBus=U,d.DOMKey=ls,d.DOMParse=us,d.DOMSVGUtil=cs,d.DOMToBlob=Xi,d.DOMToString=Vi,d.DOMUtil=A,d.DOMVideo=Kt,d.Dep=Es,d.Ellipse=ka,d.Fox=Ma,d.Line=Et,d.Matrix=Y,d.Matrix3D=Mt,d.PathGroup=se,d.Point=_t,d.Points=gi,d.QRCode=Pt,d.QuadraticBezier=pi,d.RGBToHex=pr,d.Rect=ot,d.SVGParse=Ms,d.Shape=wt,d.ShapeArmyAnts=Qa,d.ShapeFromSVG=mi,d.ShapeHeart=Wa,d.ShapeLight=Gs,d.ShapePoint3d=ja,d.ShapeRabbit=Xa,d.ShapeShip=Ya,d.ShapeSlider=Ja,d.ShapeSpirograph=Za,d.ShapeStar=Ka,d.ShapeTree=Ha,d.ShapeTriangle=qa,d.ShapeTriangleLight=$a,d.TWEEN=Ee,d.Tween=Ls,d.Vector=Se,d.WebGLRenderer=eo,d.WebRTCClient=to,d.WebSocketClient=Sn,d.addWatermark=ga,d.addWxJsReadyFnBeforeConfig=xi,d.ajax=Ta,d.aliJsChooseImage=Oo,d.aliJsGetLocation=Lo,d.aliJsOpenLocation=Ro,d.aliJsPreviewImage=No,d.aliJsReady=Mo,d.aliJsScan=Ao,d.aliJsTradePay=Do,d.angle=$t,d.angleInSVG=ti,d.animateInWeb=Ds,d.appendURLSearchString=xe,d.base64URLDecode=Sr,d.base64URLEncode=_r,d.blobToRawImage=zr,d.canDrawBitmap=Zn,d.canUsePaths=Jn,d.canUseWorker=rs,d.changeBrightness=da,d.changeDiaphaneity=ma,d.changeSize=fa,d.checkWxJsApi=ao,d.clearCookies=ur,d.createXMLHttpRequest=ci,d.debugObject=Qn,d.debugObjectProperty=Kn,d.distance=qt,d.drawQRCodeToCanvas=ba,d.fileOrBlobToDataURL=oi,d.fileToArrayBufferPromise=Yi,d.flipSideToSide=Xr,d.flipUpsideDown=Wr,d.formDataToSearchString=ai,d.fromRadianAndLength=ei,d.getBrowserClient=Je,d.getBrowserClientVersion=Nn,d.getBrowserLanguage=Gn,d.getColorScheme=fs,d.getCookie=cr,d.getCookieObject=lr,d.getDirection=nr,d.getElementLeftPositionInPage2=Ji,d.getElementPositionInPage=$i,d.getElementPositionInPage2=Mn,d.getElementPositionInViewport=Dn,d.getElementTopPositionInPage2=Zi,d.getFileExtensionFromFile=Hi,d.getFileString=xa,d.getFileTypeFromFile=bn,d.getFilesImageInfo=Or,d.getFormSubmitData=Ca,d.getGlobal=$e,d.getImageAspectRatio=Rr,d.getImageDataByAIData=wa,d.getImageDataFromBitmap=Fr,d.getImageDataFromUrl=ys,d.getImageDataFromVideo=Nr,d.getImageMainColor=Vr,d.getInternetExplorerVersion=es,d.getMousePositionInElement=Qi,d.getMousePositionInPage=Ki,d.getMousePositionInViewport=Rn,d.getOperatingSystem=we,d.getOperatingSystemVersion=On,d.getPageBodyElement=En,d.getPageDocumentElement=Bt,d.getPageSize=In,d.getRawImageInfo=Te,d.getRelativeBoundingClientRect=An,d.getScreenElement=Pn,d.getScrollParent=no,d.getTimeZone=Bn,d.getURL=ri,d.getUserGeolocationPromise=Fn,d.getVerticalScrollPercentInPage=Ln,d.getViewportSize=kn,d.getWorker=Lr,d.gifImage=xs,d.h=_n,d.handleDragAndDropFiles=Cn,d.handleInputFiles=xn,d.hasDocument=jn,d.hasHistory=qn,d.hasWindow=ns,d.hexToNumber=be,d.hexToRGB=ni,d.hsb2rgb=vr,d.hsl2rgb=br,d.hsv2rgb=yr,d.ifWebFileHasChanged=_a,d.imageDataToBitmap=Gr,d.imageDataToBlob=Ur,d.imageDataToDataURL=Br,d.injectWxJsConfig=ro,d.isAliBrowser=ss,d.isAliMiniProgram=Hn,d.isAndroid=ts,d.isAppleDevice=Un,d.isBrowserSupportFileAPI=$n,d.isDarkMode=Vn,d.isIE=Xn,d.isIE9or10=Wn,d.isIOS=Ze,d.isMacOS=Ke,d.isMobile=zn,d.isURL=Pr,d.isWxBrowser=is,d.isWxMiniProgram=Yn,d.jpgToPng=ha,d.leftRotate=Yr,d.linkExport=je,d.localstorage=si,d.mapTDTJSSDK=Fo,d.marginSharpen=oa,d.microTask=Tn,d.mosaic=pa,d.mount=Ht,d.normalizePoint=ii,d.numberToHex=ds,d.numberToRGB=ms,d.onHashChange=Dr,d.onHistoryChange=Ar,d.onURLChange=Mr,d.outputGifBase64=Cs,d.outputQRCodeBase64=va,d.parseTransformToMatrix=ee,d.parseURL=gs,d.patch=ji,d.patchDOM=qi,d.pngToJpg=ca,d.radiusClip=ua,d.randomColorHex=mr,d.randomColorHex2=gr,d.randomColorNumber=dr,d.reactiveVue2=Pa,d.reactiveVue3=Ea,d.readFileInBrowser=qe,d.recordToSearchString=ws,d.recordToSearchString2=Ir,d.rectClip=la,d.rgb2hsb=Cr,d.rgb2hsl=Tr,d.rgb2hsv=xr,d.rightRotate=Hr,d.searchStringToRecord=Er,d.searchStringToRecord2=kr,d.selectFileInBrowser=Wi,d.setColorScheme=ve,d.setCookie=hr,d.setRem=tr,d.shadeColor=wr,d.sharpen=aa,d.singletonGlobalAnimateInWeb=Dt,d.stringToBlob=He,d.stringToDOM=vn,d.theme=fr,d.toBlackAndWhite=$r,d.toBlue=Qr,d.toBlueAndGreen=ia,d.toBlueAndGrey=ra,d.toDegree=jt,d.toGreen=Kr,d.toGreenAndGrey=na,d.toGrey=jr,d.toGrey2=qr,d.toOpposite=Jr,d.toRadian=Qe,d.toRed=Zr,d.toRedAndBlue=ea,d.toRedAndGreen=ta,d.toRedAndGrey=sa,d.trimURLHash=ps,d.watchEffect=Sa,d.wxJsChooseImage=co,d.wxJsDownloadImage=fo,d.wxJsDownloadVoice=To,d.wxJsGetLocalImgData=mo,d.wxJsGetLocation=Eo,d.wxJsGetNetworkType=So,d.wxJsOnVoicePlayEnd=xo,d.wxJsOnVoiceRecordEnd=wo,d.wxJsOpenLocation=Po,d.wxJsPauseVoice=vo,d.wxJsPay=Io,d.wxJsPlayVoice=yo,d.wxJsPreviewImage=lo,d.wxJsScanQRCode=ko,d.wxJsStartRecord=go,d.wxJsStopRecord=po,d.wxJsStopVoice=bo,d.wxJsTranslateVoice=_o,d.wxJsUpdateAppMessageShareData=oo,d.wxJsUpdateTimelineShareData=ho,d.wxJsUploadImage=uo,d.wxJsUploadVoice=Co,Object.defineProperty(d,Symbol.toStringTag,{value:"Module"})});
|
|
44
40
|
//# sourceMappingURL=zyzgroup_core_web.umd.cjs.map
|