@zyzgroup/core-web 0.1.84 → 0.1.86

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.
Files changed (174) hide show
  1. package/dist/animate_ce.css +0 -18
  2. package/dist/zyzgroup_core_web.iife.js +27 -24
  3. package/dist/zyzgroup_core_web.iife.js.map +1 -1
  4. package/dist/zyzgroup_core_web.js +8644 -7989
  5. package/dist/zyzgroup_core_web.js.map +1 -1
  6. package/dist/zyzgroup_core_web.umd.cjs +27 -24
  7. package/dist/zyzgroup_core_web.umd.cjs.map +1 -1
  8. package/package.json +1 -1
  9. package/types/Context.d.ts +4 -3
  10. package/types/Context.d.ts.map +1 -1
  11. package/types/WebSocketClient.d.ts +3 -3
  12. package/types/WebSocketClient.d.ts.map +1 -1
  13. package/types/ajax.d.ts.map +1 -1
  14. package/types/axios.d.ts +2 -0
  15. package/types/axios.d.ts.map +1 -1
  16. package/types/env.d.ts +0 -6
  17. package/types/env.d.ts.map +1 -1
  18. package/types/hooks/index.d.ts +0 -1
  19. package/types/hooks/index.d.ts.map +1 -1
  20. package/types/hooks/useAttribute.d.ts +1 -1
  21. package/types/hooks/useAttribute.d.ts.map +1 -1
  22. package/types/hooks/useDraw/DrawContext.d.ts +3 -1
  23. package/types/hooks/useDraw/DrawContext.d.ts.map +1 -1
  24. package/types/hooks/useDraw/Shape.d.ts +134 -105
  25. package/types/hooks/useDraw/Shape.d.ts.map +1 -1
  26. package/types/hooks/useDraw/canvas/YZCanvasContext.d.ts +2 -1
  27. package/types/hooks/useDraw/canvas/YZCanvasContext.d.ts.map +1 -1
  28. package/types/hooks/useDraw/line/Arc.d.ts.map +1 -1
  29. package/types/hooks/useDraw/line/CubicBezier.d.ts +6 -6
  30. package/types/hooks/useDraw/line/CubicBezier.d.ts.map +1 -1
  31. package/types/hooks/useDraw/line/L.d.ts +1 -1
  32. package/types/hooks/useDraw/line/L.d.ts.map +1 -1
  33. package/types/hooks/useDraw/line/PathD.d.ts +23 -15
  34. package/types/hooks/useDraw/line/PathD.d.ts.map +1 -1
  35. package/types/hooks/useDraw/line/QuadraticBezier.d.ts +1 -1
  36. package/types/hooks/useDraw/line/QuadraticBezier.d.ts.map +1 -1
  37. package/types/hooks/useDraw/shapes/BallShape.d.ts +3 -11
  38. package/types/hooks/useDraw/shapes/BallShape.d.ts.map +1 -1
  39. package/types/hooks/useDraw/shapes/ConfettiShapeCombo.d.ts +27 -0
  40. package/types/hooks/useDraw/shapes/ConfettiShapeCombo.d.ts.map +1 -0
  41. package/types/hooks/useDraw/shapes/CrossShape.d.ts.map +1 -1
  42. package/types/hooks/useDraw/shapes/CurveShape.d.ts +24 -0
  43. package/types/hooks/useDraw/shapes/CurveShape.d.ts.map +1 -0
  44. package/types/hooks/useDraw/shapes/EllipseShape.d.ts +1 -0
  45. package/types/hooks/useDraw/shapes/EllipseShape.d.ts.map +1 -1
  46. package/types/hooks/useDraw/shapes/LineShape.d.ts +11 -9
  47. package/types/hooks/useDraw/shapes/LineShape.d.ts.map +1 -1
  48. package/types/hooks/useDraw/shapes/PointsShape.d.ts +35 -0
  49. package/types/hooks/useDraw/shapes/PointsShape.d.ts.map +1 -0
  50. package/types/hooks/useDraw/shapes/RectShape.d.ts +15 -12
  51. package/types/hooks/useDraw/shapes/RectShape.d.ts.map +1 -1
  52. package/types/hooks/useDraw/shapes/RingIndicatorShapeCombo.d.ts +2 -2
  53. package/types/hooks/useDraw/shapes/RingIndicatorShapeCombo.d.ts.map +1 -1
  54. package/types/hooks/useDraw/shapes/SegmentShapeCombo.d.ts +2 -2
  55. package/types/hooks/useDraw/shapes/SegmentShapeCombo.d.ts.map +1 -1
  56. package/types/hooks/useDraw/shapes/ShipShapeCombo.d.ts +6 -4
  57. package/types/hooks/useDraw/shapes/ShipShapeCombo.d.ts.map +1 -1
  58. package/types/hooks/useDraw/shapes/SliderShapeCombo.d.ts +3 -2
  59. package/types/hooks/useDraw/shapes/SliderShapeCombo.d.ts.map +1 -1
  60. package/types/hooks/useDraw/shapes/TextShape.d.ts +23 -0
  61. package/types/hooks/useDraw/shapes/TextShape.d.ts.map +1 -0
  62. package/types/hooks/useDraw/shapes/TreeShapeCombo.d.ts +3 -2
  63. package/types/hooks/useDraw/shapes/TreeShapeCombo.d.ts.map +1 -1
  64. package/types/hooks/useDraw/shapes/index.d.ts +4 -0
  65. package/types/hooks/useDraw/shapes/index.d.ts.map +1 -1
  66. package/types/hooks/useDraw/svg/SVGUtil.d.ts +3 -2
  67. package/types/hooks/useDraw/svg/SVGUtil.d.ts.map +1 -1
  68. package/types/hooks/useElement.d.ts +2 -2
  69. package/types/hooks/useElement.d.ts.map +1 -1
  70. package/types/hooks/useEventListener.d.ts +2 -0
  71. package/types/hooks/useEventListener.d.ts.map +1 -1
  72. package/types/hooks/useLocalStorage.d.ts +1 -1
  73. package/types/hooks/useLocalStorage.d.ts.map +1 -1
  74. package/types/hooks/useMutation.d.ts +1 -0
  75. package/types/hooks/useMutation.d.ts.map +1 -1
  76. package/types/hooks/useSafeArea.d.ts.map +1 -1
  77. package/types/hooks/useSessionStorage.d.ts +1 -1
  78. package/types/hooks/useSessionStorage.d.ts.map +1 -1
  79. package/types/hooks/useStyle.d.ts +1 -1
  80. package/types/hooks/useStyle.d.ts.map +1 -1
  81. package/types/hooks/useTheme.d.ts.map +1 -1
  82. package/types/hooks/useVnode.d.ts +5 -5
  83. package/types/hooks/useVnode.d.ts.map +1 -1
  84. package/types/index.d.ts +0 -3
  85. package/types/index.d.ts.map +1 -1
  86. package/types/math/Matrix.d.ts +3 -3
  87. package/types/math/Matrix.d.ts.map +1 -1
  88. package/types/math/ShapeGroup.d.ts +0 -34
  89. package/types/math/ShapeGroup.d.ts.map +1 -1
  90. package/types/math/shapes/Sector.d.ts +0 -65
  91. package/types/math/shapes/Sector.d.ts.map +1 -1
  92. package/types/math/shapes/Tip.d.ts +0 -21
  93. package/types/math/shapes/Tip.d.ts.map +1 -1
  94. package/types/rem.d.ts +1 -1
  95. package/types/rem.d.ts.map +1 -1
  96. package/types/signature.d.ts +29 -2
  97. package/types/signature.d.ts.map +1 -1
  98. package/types/vnode.d.ts.map +1 -1
  99. package/types/YZMessageChannel.d.ts +0 -21
  100. package/types/YZMessageChannel.d.ts.map +0 -1
  101. package/types/YZWorker.d.ts +0 -16
  102. package/types/YZWorker.d.ts.map +0 -1
  103. package/types/canvas/YZCanvas.d.ts +0 -1
  104. package/types/canvas/YZCanvas.d.ts.map +0 -1
  105. package/types/hooks/useTimestampValue.d.ts +0 -11
  106. package/types/hooks/useTimestampValue.d.ts.map +0 -1
  107. package/types/math/ShapeCombo.d.ts +0 -38
  108. package/types/math/ShapeCombo.d.ts.map +0 -1
  109. package/types/math/math/cameras/Camera.d.ts +0 -1
  110. package/types/math/math/cameras/Camera.d.ts.map +0 -1
  111. package/types/math/math/controls/Controls.d.ts +0 -1
  112. package/types/math/math/controls/Controls.d.ts.map +0 -1
  113. package/types/math/math/controls/OrbitControls.d.ts +0 -1
  114. package/types/math/math/controls/OrbitControls.d.ts.map +0 -1
  115. package/types/math/math/core/BufferGeometry.d.ts +0 -1
  116. package/types/math/math/core/BufferGeometry.d.ts.map +0 -1
  117. package/types/math/math/core/GLBufferAttribute.d.ts +0 -1
  118. package/types/math/math/core/GLBufferAttribute.d.ts.map +0 -1
  119. package/types/math/math/interpolants/Interpolant.d.ts +0 -14
  120. package/types/math/math/interpolants/Interpolant.d.ts.map +0 -1
  121. package/types/math/shapes/Arrow.d.ts +0 -10
  122. package/types/math/shapes/Arrow.d.ts.map +0 -1
  123. package/types/math/shapes/Confetti.d.ts +0 -27
  124. package/types/math/shapes/Confetti.d.ts.map +0 -1
  125. package/types/math/shapes/Cross.d.ts +0 -6
  126. package/types/math/shapes/Cross.d.ts.map +0 -1
  127. package/types/math/shapes/Ellipse.d.ts +0 -22
  128. package/types/math/shapes/Ellipse.d.ts.map +0 -1
  129. package/types/math/shapes/Fox.d.ts +0 -10
  130. package/types/math/shapes/Fox.d.ts.map +0 -1
  131. package/types/math/shapes/HalfRing.d.ts +0 -27
  132. package/types/math/shapes/HalfRing.d.ts.map +0 -1
  133. package/types/math/shapes/HalfRingIndicator.d.ts +0 -34
  134. package/types/math/shapes/HalfRingIndicator.d.ts.map +0 -1
  135. package/types/math/shapes/Heart.d.ts +0 -13
  136. package/types/math/shapes/Heart.d.ts.map +0 -1
  137. package/types/math/shapes/HeartVariant.d.ts +0 -13
  138. package/types/math/shapes/HeartVariant.d.ts.map +0 -1
  139. package/types/math/shapes/Line.d.ts +0 -19
  140. package/types/math/shapes/Line.d.ts.map +0 -1
  141. package/types/math/shapes/LinePicture.d.ts +0 -15
  142. package/types/math/shapes/LinePicture.d.ts.map +0 -1
  143. package/types/math/shapes/LineQuadraticBezier.d.ts +0 -21
  144. package/types/math/shapes/LineQuadraticBezier.d.ts.map +0 -1
  145. package/types/math/shapes/Point.d.ts +0 -85
  146. package/types/math/shapes/Point.d.ts.map +0 -1
  147. package/types/math/shapes/Points.d.ts +0 -28
  148. package/types/math/shapes/Points.d.ts.map +0 -1
  149. package/types/math/shapes/Rabbit.d.ts +0 -8
  150. package/types/math/shapes/Rabbit.d.ts.map +0 -1
  151. package/types/math/shapes/Rect.d.ts +0 -33
  152. package/types/math/shapes/Rect.d.ts.map +0 -1
  153. package/types/math/shapes/Ring.d.ts +0 -24
  154. package/types/math/shapes/Ring.d.ts.map +0 -1
  155. package/types/math/shapes/RingIndicator.d.ts +0 -28
  156. package/types/math/shapes/RingIndicator.d.ts.map +0 -1
  157. package/types/math/shapes/Segment.d.ts +0 -22
  158. package/types/math/shapes/Segment.d.ts.map +0 -1
  159. package/types/math/shapes/Ship.d.ts +0 -13
  160. package/types/math/shapes/Ship.d.ts.map +0 -1
  161. package/types/math/shapes/Slider.d.ts +0 -23
  162. package/types/math/shapes/Slider.d.ts.map +0 -1
  163. package/types/math/shapes/Star.d.ts +0 -11
  164. package/types/math/shapes/Star.d.ts.map +0 -1
  165. package/types/math/shapes/Text.d.ts +0 -21
  166. package/types/math/shapes/Text.d.ts.map +0 -1
  167. package/types/math/shapes/Tree.d.ts +0 -7
  168. package/types/math/shapes/Tree.d.ts.map +0 -1
  169. package/types/math/shapes/index.d.ts +0 -29
  170. package/types/math/shapes/index.d.ts.map +0 -1
  171. package/types/svg/YZSVG.d.ts +0 -1
  172. package/types/svg/YZSVG.d.ts.map +0 -1
  173. package/types/url.d.ts +0 -21
  174. package/types/url.d.ts.map +0 -1
@@ -1,4 +1,4 @@
1
- var ZYZGroupCoreWeb=function(d){"use strict";const Pl={};function Ml(){return typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:this||Pl}const wt=Ml(),Al="@YZ/";function yi(s,t=Al){return s.startsWith(t)?s:`${t}${s}`}function wi(s){return typeof s=="string"&&s.startsWith("Symbol(")&&s.endsWith(")")}function xi(s){return wi(s)&&(s=s.slice(7,-1)),s}function cs(s){return s=xi(s),s=yi(s),typeof Symbol=="function"?Symbol(s):`Symbol(${s})`}const Cn=cs("TIMESTAMP"),kl=cs("META");function Il(s,t){const e=t.toString();if(!wi(e))return!1;if(s&&typeof s=="object"){if(xi(e)=="")return t in s;for(const n of Reflect.ownKeys(s))if(n.toString()==e)return!0;return!1}return!1}function ca(s){if(!wi(s))return s;switch(s=xi(s),s){case yi("TIMESTAMP"):return Cn;case yi("META"):return kl;default:return cs(s)}}function bi(s){if(Array.isArray(s))return s.map(bi);if(s&&typeof s=="object"){const t={};for(const e of Reflect.ownKeys(s)){const n=s[e];t[typeof e=="symbol"?e.toString():e]=typeof n=="symbol"?n.toString():bi(n)}return t}return typeof s=="symbol"?s.toString():s}function vi(s){if(Array.isArray(s))return s.map(vi);if(s&&typeof s=="object"){const t={};for(const e of Object.keys(s))t[ca(e)]=vi(s[e]);return t}return ca(s)}function _i(s){return JSON.stringify(bi(s))}const Si=_i;function ua(s){return vi(JSON.parse(s))}var Tt=(s=>(s.UNKNOWN="",s.TEXT="text/plain",s.MD="text/plain",s.HTML="text/html",s.XML_TEXT="text/xml",s.CSS="text/css",s.JPEG="image/jpeg",s.PNG="image/png",s.GIF="image/gif",s.BMP="image/bmp",s.WEBP="image/webp",s.SVG="image/svg+xml",s.ICON="image/x-icon",s.MICROSOFT_ICON="image/vnd.microsoft.icon",s.MPEG="audio/mpeg",s.MP3="audio/mpeg",s.MP4="video/mp4",s.OGG="audio/ogg",s.WAV="audio/wav",s.MIDI="audio/midi",s.WEBM="video/webm",s.VIDEO_OGG="video/ogg",s.OCTET_STREAM="application/octet-stream",s.JAVASCRIPT="application/javascript",s.ECMASCRIPT="application/ecmascript",s.JSON="application/json",s.XML="application/xml",s.XHTML="application/xhtml+xml",s.XWWW="application/x-www-form-urlencoded",s.DOC="application/msword",s.CSV="application/x-csv",s.EXCEL="application/vnb.ms-excel",s.PPT="application/vnb.mspowerpoint",s.PDF="application/pdf",s.ZIP="application/zip",s.TGZ="application/x-gtar",s.TAR_GZ="application/x-gzip",s.EOT="appliaction/vnd.ms-fontobject",s.TTF="aplication/font-sfnt",s.PKCS12="aplication/pkcs12",s))(Tt||{}),us=(s=>(s.ascii="ascii",s.utf8="utf8",s.utf16le="utf16le",s.ucs2="ucs2",s.base64="base64",s.base64url="base64url",s.latin1="latin1",s.binary="binary",s.hex="hex",s))(us||{}),$t=(s=>(s.text="text",s.dataURL="dataURL",s.binaryString="binaryString",s.arraybuffer="arraybuffer",s))($t||{});function Dl(s,t=(e,n)=>e<=n){const e=s.length;let n=Math.floor(e/2);for(;n>0;){for(let i=n;i<e;i++){const r=s[i];let o=i;for(;o>=n&&!t(s[o-n],r);)s[o]=s[o-n],o-=n;s[o]=r}n=Math.floor(n/2)}}const ls=s=>{let t=null;switch(s){case"any-character":t=/[^]/;break;case"bin":t=/^(0b)?[0-1]+$/i;break;case"oct":t=/^(0o)?[0-7]+$/i;break;case"hex":t=/^(0x)?[0-9a-fA-F]+$/i;break;case"ascii":t=/^[\x00-\xFF]+$/i;break;case"int":t=/^[-+]?[0-9]+$/;break;case"number":t=/[-+]?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/gi;break;case"number-single":t=/[-+]?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/i;break;case"split":t=/\s*,\s*/gi;break;case"trim":t=/^\s+|\s+$/g;break;case"regexp":t=/[\\^$.*+?()[\]{}|]/g;break;case"regexp-flags":t=/\w*$/;break;case"native-method":t=RegExp("^"+Function.prototype.toString.call(Object.prototype.hasOwnProperty).replace(ls("regexp"),"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");break;case"svg-segment":t=/([mlhvzaqtcs])([^mlhvzaqtcs]*)/gi;break;case"mobile-china":t=/^[1]{1}[0-9]{10}$/;break;case"email":t=/^[A-Za-z0-9_!#$%&'*+/=?`{|}~^.-]+\@[A-Za-z0-9._-]+\.[A-Za-z0-9]+$/gm;break;case"ip":t=/^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/;break;case"url":t=/^http[s]?:\/\/([\w-]+\.)+[\w-]+([\w-./?%&=]*)?$/;break;case"element-url":t=/^url\(['"]?(.+?)['"]?\)$/i;break;case"date":t=/^\d{4}(\-|\/|\.)(\d{1,2})(\-|\/|\.)(\d{1,2})$/;break;case"time":t=/^(\d{1,2}):(\d{1,2}):(\d{1,2})$/;break;case"datetime":t=/^\d{4}(\-|\/|\.)(\d{1,2})(\-|\/|\.)(\d{1,2})\s+(\d{1,2}):(\d{1,2}):(\d{1,2})$/;break;case"base64-data":t=/^\s*data:(?:[a-z]+\/[a-z0-9-+.]+(?:;[a-z-]+=[a-z0-9-]+)?)?(?:;base64)?,([a-z0-9!$&',()*+;=\-._~:@/?%\s]*?)\s*$/i;break;case"hex-color":t=/^#([0-9A-F]{3}|[0-9A-F]{4}|[0-9A-F]{6}|[0-9A-F]{8})$/i;break;case"color":t=/^\s*((#[a-f\d]{6})|(#[a-f\d]{3})|rgba?\(\s*([\d\.]+%?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+%?)?)\s*\)|hsba?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+(?:%?\s*,\s*[\d\.]+)?)%?\s*\)|hsla?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+(?:%?\s*,\s*[\d\.]+)?)%?\s*\))\s*$/i;break;case"whitespace":t=/[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u2028\u2029\u202f\u205f\u3000]/g;break;case"commaSpaces":t=/[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*,[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*/;break;case"var-name":t=/^[a-zA-Z_$][a-zA-Z0-9_$]*$/;break;case"bezier":t=/^(?:cubic-)?bezier\(([^,]+),([^,]+),([^,]+),([^\)]+)\)/;break;case"chinese-name":t=/^(?:[\u4e00-\u9fa5·]{2,16})$/;break;case"chinese":t=new RegExp(String.raw`
1
+ var ZYZGroupCoreWeb=function(d){"use strict";const Ou={};function zu(){return typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:this||Ou}const vt=zu(),Bu="@YZ/";function _i(n,t=Bu){return n.startsWith(t)?n:`${t}${n}`}function Ci(n){return typeof n=="string"&&n.startsWith("Symbol(")&&n.endsWith(")")}function Ti(n){return Ci(n)&&(n=n.slice(7,-1)),n}function mn(n){return n=Ti(n),n=_i(n),typeof Symbol=="function"?Symbol(n):`Symbol(${n})`}const Ps=mn("TIMESTAMP"),Nu=mn("META");function Fu(n,t){const e=t.toString();if(!Ci(e))return!1;if(n&&typeof n=="object"){if(Ti(e)=="")return t in n;for(const s of Reflect.ownKeys(n))if(s.toString()==e)return!0;return!1}return!1}function ga(n){if(!Ci(n))return n;switch(n=Ti(n),n){case _i("TIMESTAMP"):return Ps;case _i("META"):return Nu;default:return mn(n)}}function Pi(n){if(Array.isArray(n))return n.map(Pi);if(n&&typeof n=="object"){const t={};for(const e of Reflect.ownKeys(n)){const s=n[e];t[typeof e=="symbol"?e.toString():e]=typeof s=="symbol"?s.toString():Pi(s)}return t}return typeof n=="symbol"?n.toString():n}function Ei(n){if(Array.isArray(n))return n.map(Ei);if(n&&typeof n=="object"){const t={};for(const e of Object.keys(n))t[ga(e)]=Ei(n[e]);return t}return ga(n)}function Mi(n){return JSON.stringify(Pi(n))}const Ai=Mi;function ya(n){return Ei(JSON.parse(n))}var Tt=(n=>(n.UNKNOWN="",n.TEXT="text/plain",n.MD="text/plain",n.HTML="text/html",n.XML_TEXT="text/xml",n.CSS="text/css",n.JPEG="image/jpeg",n.PNG="image/png",n.GIF="image/gif",n.BMP="image/bmp",n.WEBP="image/webp",n.SVG="image/svg+xml",n.ICON="image/x-icon",n.MICROSOFT_ICON="image/vnd.microsoft.icon",n.MPEG="audio/mpeg",n.MP3="audio/mpeg",n.MP4="video/mp4",n.OGG="audio/ogg",n.WAV="audio/wav",n.MIDI="audio/midi",n.WEBM="video/webm",n.VIDEO_OGG="video/ogg",n.OCTET_STREAM="application/octet-stream",n.JAVASCRIPT="application/javascript",n.ECMASCRIPT="application/ecmascript",n.JSON="application/json",n.XML="application/xml",n.XHTML="application/xhtml+xml",n.XWWW="application/x-www-form-urlencoded",n.DOC="application/msword",n.CSV="application/x-csv",n.EXCEL="application/vnb.ms-excel",n.PPT="application/vnb.mspowerpoint",n.PDF="application/pdf",n.ZIP="application/zip",n.TGZ="application/x-gtar",n.TAR_GZ="application/x-gzip",n.EOT="appliaction/vnd.ms-fontobject",n.TTF="aplication/font-sfnt",n.PKCS12="aplication/pkcs12",n))(Tt||{}),pn=(n=>(n.ascii="ascii",n.utf8="utf8",n.utf16le="utf16le",n.ucs2="ucs2",n.base64="base64",n.base64url="base64url",n.latin1="latin1",n.binary="binary",n.hex="hex",n))(pn||{}),Ut=(n=>(n.text="text",n.dataURL="dataURL",n.binaryString="binaryString",n.arraybuffer="arraybuffer",n))(Ut||{}),Es=(n=>(n.md5="md5",n.sha1="sha1",n.sha256="sha256",n.SHA256="SHA-256",n.sha512="sha512",n.SHA512="SHA-512",n.AESGCM="AES-GCM",n.ECDSA="ECDSA",n))(Es||{});function Yu(n,t=(e,s)=>e<=s){const e=n.length;let s=Math.floor(e/2);for(;s>0;){for(let i=s;i<e;i++){const r=n[i];let o=i;for(;o>=s&&!t(n[o-s],r);)n[o]=n[o-s],o-=s;n[o]=r}s=Math.floor(s/2)}}const gn=n=>{let t=null;switch(n){case"any-character":t=/[^]/;break;case"bin":t=/^(0b)?[0-1]+$/i;break;case"oct":t=/^(0o)?[0-7]+$/i;break;case"hex":t=/^(0x)?[0-9a-fA-F]+$/i;break;case"ascii":t=/^[\x00-\xFF]+$/i;break;case"int":t=/^[-+]?[0-9]+$/;break;case"number":t=/[-+]?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/gi;break;case"number-single":t=/[-+]?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/i;break;case"split":t=/\s*,\s*/gi;break;case"trim":t=/^\s+|\s+$/g;break;case"regexp":t=/[\\^$.*+?()[\]{}|]/g;break;case"regexp-flags":t=/\w*$/;break;case"native-method":t=RegExp("^"+Function.prototype.toString.call(Object.prototype.hasOwnProperty).replace(gn("regexp"),"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");break;case"svg-segment":t=/([mlhvzaqtcs])([^mlhvzaqtcs]*)/gi;break;case"mobile-china":t=/^[1]{1}[0-9]{10}$/;break;case"email":t=/^[A-Za-z0-9_!#$%&'*+/=?`{|}~^.-]+\@[A-Za-z0-9._-]+\.[A-Za-z0-9]+$/gm;break;case"ip":t=/^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/;break;case"url":t=/^http[s]?:\/\/([\w-]+\.)+[\w-]+([\w-./?%&=]*)?$/;break;case"element-url":t=/^url\(['"]?(.+?)['"]?\)$/i;break;case"date":t=/^\d{4}(\-|\/|\.)(\d{1,2})(\-|\/|\.)(\d{1,2})$/;break;case"time":t=/^(\d{1,2}):(\d{1,2}):(\d{1,2})$/;break;case"datetime":t=/^\d{4}(\-|\/|\.)(\d{1,2})(\-|\/|\.)(\d{1,2})\s+(\d{1,2}):(\d{1,2}):(\d{1,2})$/;break;case"base64-data":t=/^\s*data:(?:[a-z]+\/[a-z0-9-+.]+(?:;[a-z-]+=[a-z0-9-]+)?)?(?:;base64)?,([a-z0-9!$&',()*+;=\-._~:@/?%\s]*?)\s*$/i;break;case"hex-color":t=/^#([0-9A-F]{3}|[0-9A-F]{4}|[0-9A-F]{6}|[0-9A-F]{8})$/i;break;case"color":t=/^\s*((#[a-f\d]{6})|(#[a-f\d]{3})|rgba?\(\s*([\d\.]+%?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+%?)?)\s*\)|hsba?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+(?:%?\s*,\s*[\d\.]+)?)%?\s*\)|hsla?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+(?:%?\s*,\s*[\d\.]+)?)%?\s*\))\s*$/i;break;case"whitespace":t=/[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u2028\u2029\u202f\u205f\u3000]/g;break;case"commaSpaces":t=/[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*,[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*/;break;case"var-name":t=/^[a-zA-Z_$][a-zA-Z0-9_$]*$/;break;case"bezier":t=/^(?:cubic-)?bezier\(([^,]+),([^,]+),([^,]+),([^\)]+)\)/;break;case"chinese-name":t=/^(?:[\u4e00-\u9fa5·]{2,16})$/;break;case"chinese":t=new RegExp(String.raw`
2
2
  [\u{FA0E}\u{FA0F}\u{FA11}\u{FA13}\u{FA14}\u{FA1F}\u{FA21}\u{FA23}\u{FA24}\u{FA27}-\u{FA29}]
3
3
  |[\u{4E00}-\u{9FCC}]
4
4
  |[\u{3400}-\u{4DB5}]
@@ -7,24 +7,27 @@ var ZYZGroupCoreWeb=function(d){"use strict";const Pl={};function Ml(){return ty
7
7
  |[\u{2B740}-\u{2B81D}]
8
8
  |[\u{2B820}-\u{2CEAF}]
9
9
  |[\u{2CEB0}-\u{2EBEF}]
10
- `.replace(/\s+/g,""),"u");break;case"mime-image":t=/^image\//;break;case"mime-video":t=/^video\//;break;case"mime-audio":t=/^audio\//;break;case"mime-document-word":t=/^application\/(?:vnd\.openxmlformats-officedocument\.wordprocessingml\.document|msword|vnd\.ms-word\.document\.macroenabled\.12|vnd\.openxmlformats-officedocument\.wordprocessingml\.template|vnd\.ms-word\.template\.macroenabled\.12)$/;break;case"mime-document-excel":t=/^application\/(?:vnd\.openxmlformats-officedocument\.spreadsheetml\.sheet|vnd\.ms-excel|vnd\.ms-excel\.sheet\.macroenabled\.12|vnd\.openxmlformats-officedocument\.spreadsheetml\.template|vnd\.ms-excel\.template\.macroenabled\.12)$/;break;case"mime-document-ppt":t=/^application\/(?:vnd\.ms-powerpoint|vnd\.openxmlformats-officedocument\.presentationml\.presentation|vnd\.ms-powerpoint\.presentation\.macroenabled\.12|vnd\.openxmlformats-officedocument\.presentationml\.template|vnd\.ms-powerpoint\.template\.macroenabled\.12)$/;break;case"mime-document-json":t=/^application\/json$/;break;case"mime-document-xml":t=/^(?:application|text)\/(?:xml|xhtml\+xml)$/;break}return t},ue=(s,t)=>(typeof s=="string"&&(s=ls(s)||new RegExp(s)),s.test(t)),la=(s,t)=>{typeof s=="string"&&(s=ls(s)||new RegExp(s));const e=t.match(s);return e?s.flags.toLowerCase().indexOf("g")>=0?e.map(n=>({matchIndex:-1,fullMatch:n,groupMatchs:[]})):{matchIndex:typeof e.index=="number"?e.index:-1,fullMatch:e[0],groupMatchs:e.slice(1)}:null},fa=(s,t)=>{typeof s=="string"&&(s=ls(s)||new RegExp(s));const e=[],n=t.matchAll(s);for(const i of n)e.push({matchIndex:typeof i.index=="number"?i.index:-1,fullMatch:i[0],groupMatchs:i.slice(1)});return e};function Ll(s){const t=s.match(/[\s\S]/gu);return t?t.length:0}function da(s,t){const e=s.codePointAt(t);return e?String.fromCodePoint(e):void 0}function on(s=12,t="all"){let e="ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghijklmnopqrstuvwxyz0123456789";t=="number"&&(e="0123456789");const n=e.length;let i="";for(let r=0;r<s;r++)i+=e[Math.floor(Math.random()*n)];return i}function Rl(s){return s.replace(/(^\w)/g,t=>t.toLowerCase())}const xt=(s,t="-")=>{let e=s.replace(new RegExp(`${t}?([A-Z])`,"g"),t+"$1").toLowerCase();return e=e.replace(new RegExp(`^${t}`),""),e};function Ol(s){return s.replace(/(^\w|[_-]\w)/g,t=>t.slice(-1).toUpperCase())}function ma(s){return Rl(Ol(s))}function pa(s){let t="";for(let e=0,n=s.length;e<n;e++){const i=s.charCodeAt(e);i>=1&&i<=127?t+=s.charAt(e):i>2047?(t+=String.fromCharCode(224|i>>12&15),t+=String.fromCharCode(128|i>>6&63),t+=String.fromCharCode(128|i>>0&63)):(t+=String.fromCharCode(192|i>>6&31),t+=String.fromCharCode(128|i>>0&63))}return t}function zl(s){return s.slice(0)}function Nl(s,t=!0){const e=t?zl(s.buffer):s.buffer;return new s.constructor(e,s.byteOffset,s.length)}const Bl="[object Undefined]",Fl="[object Null]",Yl="[object Boolean]",$l="[object Number]",Xl="[object BigInt]",Ul="[object String]",Vl="[object Symbol]",Gl="[object Array]";function ga(s){return Object.prototype.toString.call(s)}function ql(s){return s!=null}function jl(s){const t=ga(s);return t===Bl||t===Fl||t===Yl||t===$l||t===Ul||t===Vl||t===Xl}function Hl(s){return ga(s)===Gl}function Wl(s){return!!s&&typeof s=="object"}function Tn(s){return Wl(s)&&!Hl(s)}function Jl(s){const t=[];for(const e in s)Object.prototype.hasOwnProperty.call(s,e)&&t.push(e);return t}function En(s,t,e=!1){if(Tn(s)&&Tn(t))for(const n in t)Tn(t[n])?(typeof s[n]>"u"&&Object.assign(s,{[n]:{}}),En(s[n],t[n],e)):(e||typeof s[n]>"u")&&Object.assign(s,{[n]:t[n]});return s}function ya(s,...t){return new s.constructor(...t)}function an(s){if(!Tn(s))return""+s;const t=[];return Jl(s).forEach(e=>{Tn(s[e])?t.push(an(s[e])):t.push(`${e}: ${s[e]}`)}),`{ ${t.join(", ")} }`}function Zl(s,t="",e=["","sign","key"]){return Object.keys(s).filter(n=>{for(let i=0,r=e.length;i<r;i++)if(s[n]==e[i])return!1;return!0}).sort().map(n=>`${n}=${s[n]}`).join("&")+t}function Ql(s=[],t=[]){const e=s.length,n=t.length;for(let r=0;r<n;r++)s[r]=t[r];let i=Math.max(0,e-n);for(;i>0;)s.pop(),i--;return s}function Ne(s,t){const e=s.findIndex(n=>n===t);return e>=0&&s.splice(e,1),s}function wa(s,t){return s.findIndex(e=>e==t)>=0}function Kl(s,...t){return t.forEach(e=>{wa(s,e)||s.push(e)}),s}let xa;try{xa=Map}catch{xa=function(){}}let ba;try{ba=Set}catch{ba=function(){}}function qt(s,t){const e=parseFloat(s);if(Number.isNaN(e)){if(typeof t=="number")return t;throw new Error(`"${s}" is NaN!`)}return e}function va(s,t,e=Number.EPSILON*Math.pow(2,2)){return Math.abs(s-t)<e}function N(s,t,e){const n=Math.min(t,e),i=Math.max(t,e);return s<n?n:s>i?i:s}function tf(s,t){return(s%t+t)%t}function fs(s,t,e){return(1-e)*s+e*t}function ef(s,t,e){const n=s.length,i=new Array(n);for(let r=0;r<n;r++)i[r]=Z(fs(s[r],t[r],e),6);return i}const nf=(s,t,e)=>n=>{const i=N(n,s,t);return e==0?i:t-i<e?t:Math.round(i/e)*e};function sf(s,t=12){return qt(s,0).toFixed(t)}function Z(s,t=12){return+sf(s,t)}function rf(s,t){const e=la("number-single",String(s));return{hasNumber:!!e,number:e&&!Array.isArray(e)&&e.fullMatch?parseFloat(e.fullMatch):ql(t)?t:NaN,prefix:e&&!Array.isArray(e)&&e.fullMatch?s.substring(0,e.matchIndex):"",suffix:e&&!Array.isArray(e)&&e.fullMatch?s.substring(e.matchIndex+e.fullMatch.length):""}}function Ci(s){const t=la("number",s);return t?Array.isArray(t)?t.map(e=>Number(e.fullMatch)):[Number(t.fullMatch)]:[]}const hn=(s,t=16)=>{let e=s.toLowerCase();const n=e.indexOf("0b")==0,i=e.indexOf("0o")==0,r=e.indexOf("0x")==0;(n||i||r)&&(e=e.slice(2)),n&&(t=2),i&&(t=8),r&&(t=16);const o=parseInt(e,t);if(isNaN(o))throw new Error(`radixStringToNumber(${s}, ${t}) 无法解析!`);return o};function of(s){return new TextEncoder().encode(s)}function af(s){return String.fromCharCode.apply(null,new Uint16Array(s))}const Ti=(s,t,e)=>t?e===us.base64?new Blob([s],{type:`${t};${e}`}):e===us.utf8?new Blob([s],{type:`${t};charset=${e}`}):new Blob([s],{type:`${t}`}):new Blob([s]),hf=s=>{let t=Tt.UNKNOWN;switch(new DataView(s).getUint32(0,cf()).toString(16).toUpperCase()){case"FFD8FFDB":t=Tt.JPEG;break;case"FFD8FFE0":case"FFD8FFE1":case"FFD8FFE2":case"FFD8FFE3":t=Tt.JPEG;break;case"89504E47":t=Tt.PNG;break;case"47494638":t=Tt.GIF;break;case"52494646":t=Tt.WEBP;break;case"25504446":t=Tt.PDF;break;case"504B0304":t=Tt.ZIP;break}return t};function cf(){const s=Uint32Array.of(305419896),t=new Uint8Array(s.buffer);switch(t[0]*16777216+t[1]*65536+t[2]*256+t[3]){case 305419896:return!1;case 2018915346:return!0}}function ut(){return(performance||Date).now()}function se(s=new Date){return s.getTime()}function uf(s,t=3){const e=Math.max(s.length,6);let n="";for(let r=0;r<e-4;r++)n+=s[r]||"0";const i=[n,""+(s[e-4]||"0")+(s[e-3]||"0"),""+(s[e-2]||"0")+(s[e-1]||"0")];switch(t){case 1:return i[0];case 2:return i[0]+":"+i[1];case 3:return i[0]+":"+i[1]+":"+i[2]}}function lf(s){const t=Math.max(s.length,6);let e=0;e+=(s[t-2]||0)*10+(s[t-1]||0),e+=((s[t-4]||0)*10+(s[t-3]||0))*60;let n=0;for(let i=0;i<t-4;i++)n=n*10+(s[i]||0);return e+=n*60*60,Math.floor(Math.max(0,e))}function ff(s,t=!1){let e=0;typeof s=="number"?e=s:e=lf(s);const n=[],i=e%60;n.unshift(i%10),n.unshift(Math.floor(i/10)),e=Math.floor(e/60);const r=e%60;if(n.unshift(r%10),n.unshift(Math.floor(r/10)),e=Math.floor(e/60),t){const o=e%100;for(n.unshift(o%10),n.unshift(Math.floor(o/10)),e=Math.floor(e/100);e;)n.unshift(e%10),e=Math.floor(e/10)}else{const o=e%24;n.unshift(o%10),n.unshift(Math.floor(o/10))}return n}function df(s,t=1,e=!1){return s[s.length-1]+=t,ff(s,e)}const Pn={THROW:1,DROP:2,SLIDE:3,EXPAND:4};class mf{queue;limit;overflow;constructor(t=10,e=Pn.EXPAND){this.queue=[],this.limit=t,this.overflow=e}length(){return this.queue.length}isEmpty(){return this.length()===0}findIndex(t){return this.queue.findIndex(t)}deleteIndex(t){return!!this.queue.splice(t,1).length}delete(t){const e=this.findIndex(t);return e>-1?this.deleteIndex(e):!1}enqueue(t){if(this.length()<this.limit){this.queue.push(t);return}switch(this.overflow){case Pn.EXPAND:this.limit*=2,this.queue.push(t);break;case Pn.SLIDE:this.deleteIndex(0),this.queue.push(t);break;case Pn.THROW:throw new Error(`Queue limit(${this.limit}) overflow!`)}}push(t){this.enqueue(t)}put(t){this.enqueue(t)}dequeue(){return this.queue.shift()}pop(){return this.dequeue()}take(){return this.dequeue()}peek(){return this.queue[0]}index(t){return this.queue[t]}clear(){this.queue=[]}flush(){const t=[];let e;for(;e=this.dequeue();)t.push(e);return t}}const pf=s=>new mf(s,Pn.EXPAND);class cn{maps=new Map;constructor(){}entries(){return Array.from(this.maps.entries())}keys(){return Array.from(this.maps.keys())}values(){return Array.from(this.maps.values())}json(){return this.entries().reduce((t,[e,n])=>(t[e]=n,t),{})}get length(){return this.entries().length}set(t,e){this.maps.set(t,e)}get(t){return this.maps.get(t)}has(t){return this.maps.has(t)}getEntryFromIndex(t){return this.entries()[t]}getEntry(t){const e=this.entries();for(let n=0,i=e.length;n<i;n++){const r=e[n];if(t(r[0],r[1]))return r}}firstEntry(){return this.getEntryFromIndex(0)}shift(){const t=this.firstEntry();if(t){const[e]=t;this.delete(e)}return t}delete(t){return this.maps.delete(t)}clear(){this.maps.clear()}update(t){const e=this.entries();for(let n=0,i=e.length;n<i;n++){const[r,o]=e[n];t(r,o)===!1&&this.delete(r)}}}function gf(){wt.OPEN_LOG=!0}function yf(){wt.OPEN_LOG=!1}function wf(s){wt.LOG_UPLOAD_FN=s}function _a(){return!!wt.OPEN_LOG}function Sa(s){wt.LOG_UPLOAD_FN&&wt.LOG_UPLOAD_FN(s)}function ie(s){Sa({level:"info",msg:s}),_a()&&(!console||typeof console!="object"||typeof console.log!="function"||console.log(s))}function ds(s){Sa({level:"warn",msg:s}),_a()&&(!console||typeof console!="object"||typeof console.warn!="function"||console.warn(s))}const Ca=()=>{};function Ta(s=0,t){const e=t?.min||300,n=t?.max||6e4,i=t?.exponent||2,r=t?.factor||.5;let o=e*Math.pow(i,s);if(r){const a=Math.random(),h=Math.floor(a*r*o);o=Math.floor(a*10)&1?o+h:o-h}return Math.min(o,n)|0}function Ei(s,t=3,e,n){return async function(...i){const r=`retry(${s.name})(${i.map(an)})`;let o;for(let a=0;a<t;a++)try{return await s.call(n||this,...i)}catch(h){ie(`(${r}) 第 ${a+1} 次尝试失败, retrying...`),o=h,await new Promise(c=>setTimeout(c,typeof e=="number"?e:Ta(a)))}throw ie(`(${r}) 已 ${t} 次失败,不再重试。 Last error: ${an(o)}`),o}}function Pi(s,t=60,e=new cn,n){return async function(...i){const r=`cache(${s.name})(${i.map(an)})`,o=Date.now();t&&e.update((c,u)=>o-u.timestamp<t*1e3);const a=Si(i),h=e.get(a);if(h){if(!t||o-h.timestamp<t*1e3)return ie(`${r} 击中缓存`),h.value;e.delete(a)}try{ie(`${r} 没有缓存, 尝试立即执行...`);const c=await s.call(n||this,...i);return ie(`${r} 缓存设置成功`),e.set(a,{value:c,timestamp:Date.now()}),c}catch(c){throw ie(`${r} 执行失败 : ${an(c)}`),c}}}var Mi=function(s,t){return Mi=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])},Mi(s,t)};function Ai(s,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");Mi(s,t);function e(){this.constructor=s}s.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}function Ea(s){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&s[t],n=0;if(e)return e.call(s);if(s&&typeof s.length=="number")return{next:function(){return s&&n>=s.length&&(s=void 0),{value:s&&s[n++],done:!s}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function ki(s,t){var e=typeof Symbol=="function"&&s[Symbol.iterator];if(!e)return s;var n=e.call(s),i,r=[],o;try{for(;(t===void 0||t-- >0)&&!(i=n.next()).done;)r.push(i.value)}catch(a){o={error:a}}finally{try{i&&!i.done&&(e=n.return)&&e.call(n)}finally{if(o)throw o.error}}return r}function Ii(s,t,e){if(e||arguments.length===2)for(var n=0,i=t.length,r;n<i;n++)(r||!(n in t))&&(r||(r=Array.prototype.slice.call(t,0,n)),r[n]=t[n]);return s.concat(r||Array.prototype.slice.call(t))}function le(s){return typeof s=="function"}function xf(s){var t=function(n){Error.call(n),n.stack=new Error().stack},e=s(t);return e.prototype=Object.create(Error.prototype),e.prototype.constructor=e,e}var Di=xf(function(s){return function(t){s(this),this.message=t?t.length+` errors occurred during unsubscription:
11
- `+t.map(function(e,n){return n+1+") "+e.toString()}).join(`
12
- `):"",this.name="UnsubscriptionError",this.errors=t}});function Pa(s,t){if(s){var e=s.indexOf(t);0<=e&&s.splice(e,1)}}var Li=function(){function s(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}return s.prototype.unsubscribe=function(){var t,e,n,i,r;if(!this.closed){this.closed=!0;var o=this._parentage;if(o)if(this._parentage=null,Array.isArray(o))try{for(var a=Ea(o),h=a.next();!h.done;h=a.next()){var c=h.value;c.remove(this)}}catch(y){t={error:y}}finally{try{h&&!h.done&&(e=a.return)&&e.call(a)}finally{if(t)throw t.error}}else o.remove(this);var u=this.initialTeardown;if(le(u))try{u()}catch(y){r=y instanceof Di?y.errors:[y]}var l=this._finalizers;if(l){this._finalizers=null;try{for(var m=Ea(l),f=m.next();!f.done;f=m.next()){var p=f.value;try{Aa(p)}catch(y){r=r??[],y instanceof Di?r=Ii(Ii([],ki(r)),ki(y.errors)):r.push(y)}}}catch(y){n={error:y}}finally{try{f&&!f.done&&(i=m.return)&&i.call(m)}finally{if(n)throw n.error}}}if(r)throw new Di(r)}},s.prototype.add=function(t){var e;if(t&&t!==this)if(this.closed)Aa(t);else{if(t instanceof s){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=(e=this._finalizers)!==null&&e!==void 0?e:[]).push(t)}},s.prototype._hasParent=function(t){var e=this._parentage;return e===t||Array.isArray(e)&&e.includes(t)},s.prototype._addParent=function(t){var e=this._parentage;this._parentage=Array.isArray(e)?(e.push(t),e):e?[e,t]:t},s.prototype._removeParent=function(t){var e=this._parentage;e===t?this._parentage=null:Array.isArray(e)&&Pa(e,t)},s.prototype.remove=function(t){var e=this._finalizers;e&&Pa(e,t),t instanceof s&&t._removeParent(this)},s.EMPTY=function(){var t=new s;return t.closed=!0,t}(),s}();Li.EMPTY;function Ma(s){return s instanceof Li||s&&"closed"in s&&le(s.remove)&&le(s.add)&&le(s.unsubscribe)}function Aa(s){le(s)?s():s.unsubscribe()}var ka={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},bf={setTimeout:function(s,t){for(var e=[],n=2;n<arguments.length;n++)e[n-2]=arguments[n];return setTimeout.apply(void 0,Ii([s,t],ki(e)))},clearTimeout:function(s){return clearTimeout(s)},delegate:void 0};function vf(s){bf.setTimeout(function(){throw s})}function Ia(){}function _f(s){s()}var Ri=function(s){Ai(t,s);function t(e){var n=s.call(this)||this;return n.isStopped=!1,e?(n.destination=e,Ma(e)&&e.add(n)):n.destination=Ef,n}return t.create=function(e,n,i){return new zi(e,n,i)},t.prototype.next=function(e){this.isStopped||this._next(e)},t.prototype.error=function(e){this.isStopped||(this.isStopped=!0,this._error(e))},t.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,s.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(e){this.destination.next(e)},t.prototype._error=function(e){try{this.destination.error(e)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t}(Li),Sf=Function.prototype.bind;function Oi(s,t){return Sf.call(s,t)}var Cf=function(){function s(t){this.partialObserver=t}return s.prototype.next=function(t){var e=this.partialObserver;if(e.next)try{e.next(t)}catch(n){ms(n)}},s.prototype.error=function(t){var e=this.partialObserver;if(e.error)try{e.error(t)}catch(n){ms(n)}else ms(t)},s.prototype.complete=function(){var t=this.partialObserver;if(t.complete)try{t.complete()}catch(e){ms(e)}},s}(),zi=function(s){Ai(t,s);function t(e,n,i){var r=s.call(this)||this,o;if(le(e)||!e)o={next:e??void 0,error:n??void 0,complete:i??void 0};else{var a;r&&ka.useDeprecatedNextContext?(a=Object.create(e),a.unsubscribe=function(){return r.unsubscribe()},o={next:e.next&&Oi(e.next,a),error:e.error&&Oi(e.error,a),complete:e.complete&&Oi(e.complete,a)}):o=e}return r.destination=new Cf(o),r}return t}(Ri);function ms(s){vf(s)}function Tf(s){throw s}var Ef={closed:!0,next:Ia,error:Tf,complete:Ia},Pf=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function Mf(s){return s}function Af(s){return s.length===0?Mf:s.length===1?s[0]:function(t){return s.reduce(function(e,n){return n(e)},t)}}(function(){function s(t){t&&(this._subscribe=t)}return s.prototype.lift=function(t){var e=new s;return e.source=this,e.operator=t,e},s.prototype.subscribe=function(t,e,n){var i=this,r=If(t)?t:new zi(t,e,n);return _f(function(){var o=i,a=o.operator,h=o.source;r.add(a?a.call(r,h):h?i._subscribe(r):i._trySubscribe(r))}),r},s.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(e){t.error(e)}},s.prototype.forEach=function(t,e){var n=this;return e=Da(e),new e(function(i,r){var o=new zi({next:function(a){try{t(a)}catch(h){r(h),o.unsubscribe()}},error:r,complete:i});n.subscribe(o)})},s.prototype._subscribe=function(t){var e;return(e=this.source)===null||e===void 0?void 0:e.subscribe(t)},s.prototype[Pf]=function(){return this},s.prototype.pipe=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Af(t)(this)},s.prototype.toPromise=function(t){var e=this;return t=Da(t),new t(function(n,i){var r;e.subscribe(function(o){return r=o},function(o){return i(o)},function(){return n(r)})})},s.create=function(t){return new s(t)},s})();function Da(s){var t;return(t=s??ka.Promise)!==null&&t!==void 0?t:Promise}function kf(s){return s&&le(s.next)&&le(s.error)&&le(s.complete)}function If(s){return s&&s instanceof Ri||kf(s)&&Ma(s)}(function(s){Ai(t,s);function t(e,n,i,r,o,a){var h=s.call(this,e)||this;return h.onFinalize=o,h.shouldUnsubscribe=a,h._next=n?function(c){try{n(c)}catch(u){e.error(u)}}:s.prototype._next,h._error=r?function(c){try{r(c)}catch(u){e.error(u)}finally{this.unsubscribe()}}:s.prototype._error,h._complete=i?function(){try{i()}catch(c){e.error(c)}finally{this.unsubscribe()}}:s.prototype._complete,h}return t.prototype.unsubscribe=function(){var e;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var n=this.closed;s.prototype.unsubscribe.call(this),!n&&((e=this.onFinalize)===null||e===void 0||e.call(this))}},t})(Ri);let Mn;function jt(s){Mn=s,s(),Mn=null}class Df{subscribers=new Set;add(){Mn&&!this.subscribers.has(Mn)&&this.subscribers.add(Mn)}notify(){this.subscribers.forEach(t=>t())}}const La=new WeakMap;function ps(s,t){let e=La.get(s);e||(e=new Map,La.set(s,e));let n=e.get(t);return n||(n=new Df,e.set(t,n)),n}function Lf(s,t=!1){return Object.keys(s).forEach(e=>{let n=s[e];if(t&&typeof n=="object"&&n!==null)s[e]=Bi(n,t);else{const i=ps(s,e);Object.defineProperty(s,e,{configurable:!0,enumerable:!0,get(){return i.add(),n},set(r){n!=r&&(n=r,i.notify())}})}}),s}function Ni(s,t=!1){return Lf({value:s},t)}function Bi(s,t=!1){const e={get(n,i,r){const o=Reflect.get(n,i,r);if(t&&typeof o=="object"&&o!==null&&!("isYZReactiveProxy"in o)){const a=Bi(o,t);a.YZReactiveProxyParentTarget=n,a.YZReactiveProxyParentKey=i,Reflect.set(r,i,a)}return ps(n,i).add(),Reflect.get(n,i,r)},set(n,i,r,o){const a=Reflect.get(n,i,o),h=Reflect.set(n,i,r,o);return Array.isArray(n)?ps(n.YZReactiveProxyParentTarget,n.YZReactiveProxyParentKey).notify():a!=r&&ps(n,i).notify(),h},has(n,i){return i==="isYZReactiveProxy"||i in n}};return new Proxy(s,e)}const Ra=Bi;class gs{events;constructor(){this.events={}}isEmpty(t){return this.events[t]==null||this.events[t].length==0}has(t,e){return this.events[t]!==void 0&&this.events[t].indexOf(e)!==-1}prependListener(t,e,n){return this.events[t]||(this.events[t]=[]),this.events[t].unshift(n?e.bind(n):e),this}addListener(t,e,n){return this.events[t]||(this.events[t]=[]),this.events[t].push(n?e.bind(n):e),this}on(t,e,n){return this.addListener(t,e,n),this}removeListener(t,e){return this.events[t]&&(this.events[t]=this.events[t].filter(n=>n!==e)),this}off(t,e){return this.removeListener(t,e),this}removeAllListeners(t){return t?this.events[t]=[]:this.events={},this}emit(t,...e){return this.events[t]&&this.events[t].slice(0).forEach(n=>{n(...e)}),this}once(t,e,n){const i=(...r)=>{n?e.apply(n,r):e(...r),this.off(t,i)};return this.on(t,i),this}}function Rf(){const s={};return s.promise=new Promise((t,e)=>{s.resolve=t,s.reject=e}),s}let Of=0;function zf(s){const t=Rf();let e=!1;return{name:s.name||String(++Of),deadline:typeof s.deadline=="number"?Math.max(s.deadline,0):-1,run:async()=>{if(!e){e=!0;try{let n;const i=s.args||[];s.thisArg?n=await s.fn.call(s.thisArg,...i):n=await s.fn(...i),t.resolve(n)}catch(n){t.reject(n)}}},result:()=>t.promise}}class Nf{queue;suspend=!1;semaphore=0;concurrency=1;timeRemaining=-1;timeoutId;constructor(t){this.queue=t?.queue||pf(10),typeof t?.concurrency=="number"&&(this.concurrency=Math.max(t?.concurrency,1)),typeof t?.timeRemaining=="number"&&this.setTimeRemaining(t.timeRemaining)}setTimeRemaining(t){this.timeRemaining=Math.max(0,t)}increaseTimeRemaining(t,e=!1){this.timeRemaining!==-1?this.setTimeRemaining(this.timeRemaining+t):e&&this.setTimeRemaining(t)}decreaseTimeRemaining(t){this.timeRemaining!==-1&&this.setTimeRemaining(this.timeRemaining-t)}_exec(t,e=!0){const n=se();try{this.semaphore++,t.run()}finally{this.semaphore--,e&&(this.decreaseTimeRemaining(se()-n),this._flush())}}_flush(){for(;!this.suspend&&this.semaphore<this.concurrency&&(this.timeRemaining==-1||this.timeRemaining>0);){const t=this.queue.dequeue();if(!t)break;this._exec(t)}this._timeout()}_timeout(t=0,e=0){clearTimeout(this.timeoutId),this.timeoutId=setTimeout(()=>{if(!(this.suspend||this.semaphore>0||!this.queue.length)){for(let n=0;n<this.queue.length();){const i=this.queue.index(n);if(!i)break;i.deadline!=-1&&i.deadline<=se()?(this._exec(i,!1),this.queue.deleteIndex(n)):n++}this.queue.length()&&(this.timeoutId=setTimeout(()=>{this._timeout(t,++e)},300*Math.pow(2,e)))}},t)}pause(){this.suspend=!0}resume(){this.suspend=!1,this._flush()}addTask(t){this.queue.delete(e=>e.name==t.name),this.queue.enqueue(t)}immediately(t){this._exec(t),this._flush()}asap(t){this.addTask(t),this._flush()}idleCallback(t){this.setTimeRemaining(t.timeRemaining()),this._flush()}clear(){this.queue.clear()}}class Bf extends Nf{constructor(t){super(t)}_exec(t,e=!0){const n=se();try{this.semaphore++,t.run()}finally{t.result().finally(()=>{this.semaphore--,e&&(this.decreaseTimeRemaining(se()-n),this._flush())})}}}function Oa(s,t={},e){if(typeof t=="function"&&(e=t,t={}),e)return e(Oa)(s,t);let n=t;const i=[],r=c=>(i.push(c),()=>{Ne(i,c)}),o=c=>{n=s(n,c),i.forEach(u=>u())},a=()=>n,h=c=>{s=c,o({type:Symbol()})};return o({type:Symbol()}),{getState:a,dispatch:o,subscribe:r,replaceReducer:h}}function za(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}var Na={exports:{}};(function(s,t){(function(e){s.exports=e()})(function(e){var n=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"];function i(w,_){var x=w[0],b=w[1],E=w[2],C=w[3];x+=(b&E|~b&C)+_[0]-680876936|0,x=(x<<7|x>>>25)+b|0,C+=(x&b|~x&E)+_[1]-389564586|0,C=(C<<12|C>>>20)+x|0,E+=(C&x|~C&b)+_[2]+606105819|0,E=(E<<17|E>>>15)+C|0,b+=(E&C|~E&x)+_[3]-1044525330|0,b=(b<<22|b>>>10)+E|0,x+=(b&E|~b&C)+_[4]-176418897|0,x=(x<<7|x>>>25)+b|0,C+=(x&b|~x&E)+_[5]+1200080426|0,C=(C<<12|C>>>20)+x|0,E+=(C&x|~C&b)+_[6]-1473231341|0,E=(E<<17|E>>>15)+C|0,b+=(E&C|~E&x)+_[7]-45705983|0,b=(b<<22|b>>>10)+E|0,x+=(b&E|~b&C)+_[8]+1770035416|0,x=(x<<7|x>>>25)+b|0,C+=(x&b|~x&E)+_[9]-1958414417|0,C=(C<<12|C>>>20)+x|0,E+=(C&x|~C&b)+_[10]-42063|0,E=(E<<17|E>>>15)+C|0,b+=(E&C|~E&x)+_[11]-1990404162|0,b=(b<<22|b>>>10)+E|0,x+=(b&E|~b&C)+_[12]+1804603682|0,x=(x<<7|x>>>25)+b|0,C+=(x&b|~x&E)+_[13]-40341101|0,C=(C<<12|C>>>20)+x|0,E+=(C&x|~C&b)+_[14]-1502002290|0,E=(E<<17|E>>>15)+C|0,b+=(E&C|~E&x)+_[15]+1236535329|0,b=(b<<22|b>>>10)+E|0,x+=(b&C|E&~C)+_[1]-165796510|0,x=(x<<5|x>>>27)+b|0,C+=(x&E|b&~E)+_[6]-1069501632|0,C=(C<<9|C>>>23)+x|0,E+=(C&b|x&~b)+_[11]+643717713|0,E=(E<<14|E>>>18)+C|0,b+=(E&x|C&~x)+_[0]-373897302|0,b=(b<<20|b>>>12)+E|0,x+=(b&C|E&~C)+_[5]-701558691|0,x=(x<<5|x>>>27)+b|0,C+=(x&E|b&~E)+_[10]+38016083|0,C=(C<<9|C>>>23)+x|0,E+=(C&b|x&~b)+_[15]-660478335|0,E=(E<<14|E>>>18)+C|0,b+=(E&x|C&~x)+_[4]-405537848|0,b=(b<<20|b>>>12)+E|0,x+=(b&C|E&~C)+_[9]+568446438|0,x=(x<<5|x>>>27)+b|0,C+=(x&E|b&~E)+_[14]-1019803690|0,C=(C<<9|C>>>23)+x|0,E+=(C&b|x&~b)+_[3]-187363961|0,E=(E<<14|E>>>18)+C|0,b+=(E&x|C&~x)+_[8]+1163531501|0,b=(b<<20|b>>>12)+E|0,x+=(b&C|E&~C)+_[13]-1444681467|0,x=(x<<5|x>>>27)+b|0,C+=(x&E|b&~E)+_[2]-51403784|0,C=(C<<9|C>>>23)+x|0,E+=(C&b|x&~b)+_[7]+1735328473|0,E=(E<<14|E>>>18)+C|0,b+=(E&x|C&~x)+_[12]-1926607734|0,b=(b<<20|b>>>12)+E|0,x+=(b^E^C)+_[5]-378558|0,x=(x<<4|x>>>28)+b|0,C+=(x^b^E)+_[8]-2022574463|0,C=(C<<11|C>>>21)+x|0,E+=(C^x^b)+_[11]+1839030562|0,E=(E<<16|E>>>16)+C|0,b+=(E^C^x)+_[14]-35309556|0,b=(b<<23|b>>>9)+E|0,x+=(b^E^C)+_[1]-1530992060|0,x=(x<<4|x>>>28)+b|0,C+=(x^b^E)+_[4]+1272893353|0,C=(C<<11|C>>>21)+x|0,E+=(C^x^b)+_[7]-155497632|0,E=(E<<16|E>>>16)+C|0,b+=(E^C^x)+_[10]-1094730640|0,b=(b<<23|b>>>9)+E|0,x+=(b^E^C)+_[13]+681279174|0,x=(x<<4|x>>>28)+b|0,C+=(x^b^E)+_[0]-358537222|0,C=(C<<11|C>>>21)+x|0,E+=(C^x^b)+_[3]-722521979|0,E=(E<<16|E>>>16)+C|0,b+=(E^C^x)+_[6]+76029189|0,b=(b<<23|b>>>9)+E|0,x+=(b^E^C)+_[9]-640364487|0,x=(x<<4|x>>>28)+b|0,C+=(x^b^E)+_[12]-421815835|0,C=(C<<11|C>>>21)+x|0,E+=(C^x^b)+_[15]+530742520|0,E=(E<<16|E>>>16)+C|0,b+=(E^C^x)+_[2]-995338651|0,b=(b<<23|b>>>9)+E|0,x+=(E^(b|~C))+_[0]-198630844|0,x=(x<<6|x>>>26)+b|0,C+=(b^(x|~E))+_[7]+1126891415|0,C=(C<<10|C>>>22)+x|0,E+=(x^(C|~b))+_[14]-1416354905|0,E=(E<<15|E>>>17)+C|0,b+=(C^(E|~x))+_[5]-57434055|0,b=(b<<21|b>>>11)+E|0,x+=(E^(b|~C))+_[12]+1700485571|0,x=(x<<6|x>>>26)+b|0,C+=(b^(x|~E))+_[3]-1894986606|0,C=(C<<10|C>>>22)+x|0,E+=(x^(C|~b))+_[10]-1051523|0,E=(E<<15|E>>>17)+C|0,b+=(C^(E|~x))+_[1]-2054922799|0,b=(b<<21|b>>>11)+E|0,x+=(E^(b|~C))+_[8]+1873313359|0,x=(x<<6|x>>>26)+b|0,C+=(b^(x|~E))+_[15]-30611744|0,C=(C<<10|C>>>22)+x|0,E+=(x^(C|~b))+_[6]-1560198380|0,E=(E<<15|E>>>17)+C|0,b+=(C^(E|~x))+_[13]+1309151649|0,b=(b<<21|b>>>11)+E|0,x+=(E^(b|~C))+_[4]-145523070|0,x=(x<<6|x>>>26)+b|0,C+=(b^(x|~E))+_[11]-1120210379|0,C=(C<<10|C>>>22)+x|0,E+=(x^(C|~b))+_[2]+718787259|0,E=(E<<15|E>>>17)+C|0,b+=(C^(E|~x))+_[9]-343485551|0,b=(b<<21|b>>>11)+E|0,w[0]=x+w[0]|0,w[1]=b+w[1]|0,w[2]=E+w[2]|0,w[3]=C+w[3]|0}function r(w){var _=[],x;for(x=0;x<64;x+=4)_[x>>2]=w.charCodeAt(x)+(w.charCodeAt(x+1)<<8)+(w.charCodeAt(x+2)<<16)+(w.charCodeAt(x+3)<<24);return _}function o(w){var _=[],x;for(x=0;x<64;x+=4)_[x>>2]=w[x]+(w[x+1]<<8)+(w[x+2]<<16)+(w[x+3]<<24);return _}function a(w){var _=w.length,x=[1732584193,-271733879,-1732584194,271733878],b,E,C,L,B,F;for(b=64;b<=_;b+=64)i(x,r(w.substring(b-64,b)));for(w=w.substring(b-64),E=w.length,C=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],b=0;b<E;b+=1)C[b>>2]|=w.charCodeAt(b)<<(b%4<<3);if(C[b>>2]|=128<<(b%4<<3),b>55)for(i(x,C),b=0;b<16;b+=1)C[b]=0;return L=_*8,L=L.toString(16).match(/(.*?)(.{0,8})$/),B=parseInt(L[2],16),F=parseInt(L[1],16)||0,C[14]=B,C[15]=F,i(x,C),x}function h(w){var _=w.length,x=[1732584193,-271733879,-1732584194,271733878],b,E,C,L,B,F;for(b=64;b<=_;b+=64)i(x,o(w.subarray(b-64,b)));for(w=b-64<_?w.subarray(b-64):new Uint8Array(0),E=w.length,C=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],b=0;b<E;b+=1)C[b>>2]|=w[b]<<(b%4<<3);if(C[b>>2]|=128<<(b%4<<3),b>55)for(i(x,C),b=0;b<16;b+=1)C[b]=0;return L=_*8,L=L.toString(16).match(/(.*?)(.{0,8})$/),B=parseInt(L[2],16),F=parseInt(L[1],16)||0,C[14]=B,C[15]=F,i(x,C),x}function c(w){var _="",x;for(x=0;x<4;x+=1)_+=n[w>>x*8+4&15]+n[w>>x*8&15];return _}function u(w){var _;for(_=0;_<w.length;_+=1)w[_]=c(w[_]);return w.join("")}u(a("hello")),typeof ArrayBuffer<"u"&&!ArrayBuffer.prototype.slice&&function(){function w(_,x){return _=_|0||0,_<0?Math.max(_+x,0):Math.min(_,x)}ArrayBuffer.prototype.slice=function(_,x){var b=this.byteLength,E=w(_,b),C=b,L,B,F,U;return x!==e&&(C=w(x,b)),E>C?new ArrayBuffer(0):(L=C-E,B=new ArrayBuffer(L),F=new Uint8Array(B),U=new Uint8Array(this,E,L),F.set(U),B)}}();function l(w){return/[\u0080-\uFFFF]/.test(w)&&(w=unescape(encodeURIComponent(w))),w}function m(w,_){var x=w.length,b=new ArrayBuffer(x),E=new Uint8Array(b),C;for(C=0;C<x;C+=1)E[C]=w.charCodeAt(C);return _?E:b}function f(w){return String.fromCharCode.apply(null,new Uint8Array(w))}function p(w,_,x){var b=new Uint8Array(w.byteLength+_.byteLength);return b.set(new Uint8Array(w)),b.set(new Uint8Array(_),w.byteLength),x?b:b.buffer}function y(w){var _=[],x=w.length,b;for(b=0;b<x-1;b+=2)_.push(parseInt(w.substr(b,2),16));return String.fromCharCode.apply(String,_)}function v(){this.reset()}return v.prototype.append=function(w){return this.appendBinary(l(w)),this},v.prototype.appendBinary=function(w){this._buff+=w,this._length+=w.length;var _=this._buff.length,x;for(x=64;x<=_;x+=64)i(this._hash,r(this._buff.substring(x-64,x)));return this._buff=this._buff.substring(x-64),this},v.prototype.end=function(w){var _=this._buff,x=_.length,b,E=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],C;for(b=0;b<x;b+=1)E[b>>2]|=_.charCodeAt(b)<<(b%4<<3);return this._finish(E,x),C=u(this._hash),w&&(C=y(C)),this.reset(),C},v.prototype.reset=function(){return this._buff="",this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},v.prototype.getState=function(){return{buff:this._buff,length:this._length,hash:this._hash.slice()}},v.prototype.setState=function(w){return this._buff=w.buff,this._length=w.length,this._hash=w.hash,this},v.prototype.destroy=function(){delete this._hash,delete this._buff,delete this._length},v.prototype._finish=function(w,_){var x=_,b,E,C;if(w[x>>2]|=128<<(x%4<<3),x>55)for(i(this._hash,w),x=0;x<16;x+=1)w[x]=0;b=this._length*8,b=b.toString(16).match(/(.*?)(.{0,8})$/),E=parseInt(b[2],16),C=parseInt(b[1],16)||0,w[14]=E,w[15]=C,i(this._hash,w)},v.hash=function(w,_){return v.hashBinary(l(w),_)},v.hashBinary=function(w,_){var x=a(w),b=u(x);return _?y(b):b},v.ArrayBuffer=function(){this.reset()},v.ArrayBuffer.prototype.append=function(w){var _=p(this._buff.buffer,w,!0),x=_.length,b;for(this._length+=w.byteLength,b=64;b<=x;b+=64)i(this._hash,o(_.subarray(b-64,b)));return this._buff=b-64<x?new Uint8Array(_.buffer.slice(b-64)):new Uint8Array(0),this},v.ArrayBuffer.prototype.end=function(w){var _=this._buff,x=_.length,b=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],E,C;for(E=0;E<x;E+=1)b[E>>2]|=_[E]<<(E%4<<3);return this._finish(b,x),C=u(this._hash),w&&(C=y(C)),this.reset(),C},v.ArrayBuffer.prototype.reset=function(){return this._buff=new Uint8Array(0),this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},v.ArrayBuffer.prototype.getState=function(){var w=v.prototype.getState.call(this);return w.buff=f(w.buff),w},v.ArrayBuffer.prototype.setState=function(w){return w.buff=m(w.buff,!0),v.prototype.setState.call(this,w)},v.ArrayBuffer.prototype.destroy=v.prototype.destroy,v.ArrayBuffer.prototype._finish=v.prototype._finish,v.ArrayBuffer.hash=function(w,_){var x=h(new Uint8Array(w)),b=u(x);return _?y(b):b},v})})(Na);var Ff=Na.exports;const Yf=za(Ff);function Ba(s,t){return function(){return s.apply(t,arguments)}}const{toString:$f}=Object.prototype,{getPrototypeOf:Fi}=Object,ys=(s=>t=>{const e=$f.call(t);return s[e]||(s[e]=e.slice(8,-1).toLowerCase())})(Object.create(null)),Ht=s=>(s=s.toLowerCase(),t=>ys(t)===s),ws=s=>t=>typeof t===s,{isArray:un}=Array,An=ws("undefined");function Xf(s){return s!==null&&!An(s)&&s.constructor!==null&&!An(s.constructor)&&Rt(s.constructor.isBuffer)&&s.constructor.isBuffer(s)}const Fa=Ht("ArrayBuffer");function Uf(s){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(s):t=s&&s.buffer&&Fa(s.buffer),t}const Vf=ws("string"),Rt=ws("function"),Ya=ws("number"),xs=s=>s!==null&&typeof s=="object",Gf=s=>s===!0||s===!1,bs=s=>{if(ys(s)!=="object")return!1;const t=Fi(s);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in s)&&!(Symbol.iterator in s)},qf=Ht("Date"),jf=Ht("File"),Hf=Ht("Blob"),Wf=Ht("FileList"),Jf=s=>xs(s)&&Rt(s.pipe),Zf=s=>{let t;return s&&(typeof FormData=="function"&&s instanceof FormData||Rt(s.append)&&((t=ys(s))==="formdata"||t==="object"&&Rt(s.toString)&&s.toString()==="[object FormData]"))},Qf=Ht("URLSearchParams"),[Kf,td,ed,nd]=["ReadableStream","Request","Response","Headers"].map(Ht),sd=s=>s.trim?s.trim():s.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function kn(s,t,{allOwnKeys:e=!1}={}){if(s===null||typeof s>"u")return;let n,i;if(typeof s!="object"&&(s=[s]),un(s))for(n=0,i=s.length;n<i;n++)t.call(null,s[n],n,s);else{const r=e?Object.getOwnPropertyNames(s):Object.keys(s),o=r.length;let a;for(n=0;n<o;n++)a=r[n],t.call(null,s[a],a,s)}}function $a(s,t){t=t.toLowerCase();const e=Object.keys(s);let n=e.length,i;for(;n-- >0;)if(i=e[n],t===i.toLowerCase())return i;return null}const Be=(()=>typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global)(),Xa=s=>!An(s)&&s!==Be;function Yi(){const{caseless:s}=Xa(this)&&this||{},t={},e=(n,i)=>{const r=s&&$a(t,i)||i;bs(t[r])&&bs(n)?t[r]=Yi(t[r],n):bs(n)?t[r]=Yi({},n):un(n)?t[r]=n.slice():t[r]=n};for(let n=0,i=arguments.length;n<i;n++)arguments[n]&&kn(arguments[n],e);return t}const id=(s,t,e,{allOwnKeys:n}={})=>(kn(t,(i,r)=>{e&&Rt(i)?s[r]=Ba(i,e):s[r]=i},{allOwnKeys:n}),s),rd=s=>(s.charCodeAt(0)===65279&&(s=s.slice(1)),s),od=(s,t,e,n)=>{s.prototype=Object.create(t.prototype,n),s.prototype.constructor=s,Object.defineProperty(s,"super",{value:t.prototype}),e&&Object.assign(s.prototype,e)},ad=(s,t,e,n)=>{let i,r,o;const a={};if(t=t||{},s==null)return t;do{for(i=Object.getOwnPropertyNames(s),r=i.length;r-- >0;)o=i[r],(!n||n(o,s,t))&&!a[o]&&(t[o]=s[o],a[o]=!0);s=e!==!1&&Fi(s)}while(s&&(!e||e(s,t))&&s!==Object.prototype);return t},hd=(s,t,e)=>{s=String(s),(e===void 0||e>s.length)&&(e=s.length),e-=t.length;const n=s.indexOf(t,e);return n!==-1&&n===e},cd=s=>{if(!s)return null;if(un(s))return s;let t=s.length;if(!Ya(t))return null;const e=new Array(t);for(;t-- >0;)e[t]=s[t];return e},ud=(s=>t=>s&&t instanceof s)(typeof Uint8Array<"u"&&Fi(Uint8Array)),ld=(s,t)=>{const n=(s&&s[Symbol.iterator]).call(s);let i;for(;(i=n.next())&&!i.done;){const r=i.value;t.call(s,r[0],r[1])}},fd=(s,t)=>{let e;const n=[];for(;(e=s.exec(t))!==null;)n.push(e);return n},dd=Ht("HTMLFormElement"),md=s=>s.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,n,i){return n.toUpperCase()+i}),Ua=(({hasOwnProperty:s})=>(t,e)=>s.call(t,e))(Object.prototype),pd=Ht("RegExp"),Va=(s,t)=>{const e=Object.getOwnPropertyDescriptors(s),n={};kn(e,(i,r)=>{let o;(o=t(i,r,s))!==!1&&(n[r]=o||i)}),Object.defineProperties(s,n)},gd=s=>{Va(s,(t,e)=>{if(Rt(s)&&["arguments","caller","callee"].indexOf(e)!==-1)return!1;const n=s[e];if(Rt(n)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+e+"'")})}})},yd=(s,t)=>{const e={},n=i=>{i.forEach(r=>{e[r]=!0})};return un(s)?n(s):n(String(s).split(t)),e},wd=()=>{},xd=(s,t)=>s!=null&&Number.isFinite(s=+s)?s:t;function bd(s){return!!(s&&Rt(s.append)&&s[Symbol.toStringTag]==="FormData"&&s[Symbol.iterator])}const vd=s=>{const t=new Array(10),e=(n,i)=>{if(xs(n)){if(t.indexOf(n)>=0)return;if(!("toJSON"in n)){t[i]=n;const r=un(n)?[]:{};return kn(n,(o,a)=>{const h=e(o,i+1);!An(h)&&(r[a]=h)}),t[i]=void 0,r}}return n};return e(s,0)},_d=Ht("AsyncFunction"),Sd=s=>s&&(xs(s)||Rt(s))&&Rt(s.then)&&Rt(s.catch),Ga=((s,t)=>s?setImmediate:t?((e,n)=>(Be.addEventListener("message",({source:i,data:r})=>{i===Be&&r===e&&n.length&&n.shift()()},!1),i=>{n.push(i),Be.postMessage(e,"*")}))(`axios@${Math.random()}`,[]):e=>setTimeout(e))(typeof setImmediate=="function",Rt(Be.postMessage)),Cd=typeof queueMicrotask<"u"?queueMicrotask.bind(Be):typeof process<"u"&&process.nextTick||Ga,A={isArray:un,isArrayBuffer:Fa,isBuffer:Xf,isFormData:Zf,isArrayBufferView:Uf,isString:Vf,isNumber:Ya,isBoolean:Gf,isObject:xs,isPlainObject:bs,isReadableStream:Kf,isRequest:td,isResponse:ed,isHeaders:nd,isUndefined:An,isDate:qf,isFile:jf,isBlob:Hf,isRegExp:pd,isFunction:Rt,isStream:Jf,isURLSearchParams:Qf,isTypedArray:ud,isFileList:Wf,forEach:kn,merge:Yi,extend:id,trim:sd,stripBOM:rd,inherits:od,toFlatObject:ad,kindOf:ys,kindOfTest:Ht,endsWith:hd,toArray:cd,forEachEntry:ld,matchAll:fd,isHTMLForm:dd,hasOwnProperty:Ua,hasOwnProp:Ua,reduceDescriptors:Va,freezeMethods:gd,toObjectSet:yd,toCamelCase:md,noop:wd,toFiniteNumber:xd,findKey:$a,global:Be,isContextDefined:Xa,isSpecCompliantForm:bd,toJSONObject:vd,isAsyncFn:_d,isThenable:Sd,setImmediate:Ga,asap:Cd};function Y(s,t,e,n,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=s,this.name="AxiosError",t&&(this.code=t),e&&(this.config=e),n&&(this.request=n),i&&(this.response=i,this.status=i.status?i.status:null)}A.inherits(Y,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:A.toJSONObject(this.config),code:this.code,status:this.status}}});const qa=Y.prototype,ja={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(s=>{ja[s]={value:s}}),Object.defineProperties(Y,ja),Object.defineProperty(qa,"isAxiosError",{value:!0}),Y.from=(s,t,e,n,i,r)=>{const o=Object.create(qa);return A.toFlatObject(s,o,function(h){return h!==Error.prototype},a=>a!=="isAxiosError"),Y.call(o,s.message,t,e,n,i),o.cause=s,o.name=s.name,r&&Object.assign(o,r),o};const Td=null;function $i(s){return A.isPlainObject(s)||A.isArray(s)}function Ha(s){return A.endsWith(s,"[]")?s.slice(0,-2):s}function Wa(s,t,e){return s?s.concat(t).map(function(i,r){return i=Ha(i),!e&&r?"["+i+"]":i}).join(e?".":""):t}function Ed(s){return A.isArray(s)&&!s.some($i)}const Pd=A.toFlatObject(A,{},null,function(t){return/^is[A-Z]/.test(t)});function vs(s,t,e){if(!A.isObject(s))throw new TypeError("target must be an object");t=t||new FormData,e=A.toFlatObject(e,{metaTokens:!0,dots:!1,indexes:!1},!1,function(y,v){return!A.isUndefined(v[y])});const n=e.metaTokens,i=e.visitor||u,r=e.dots,o=e.indexes,h=(e.Blob||typeof Blob<"u"&&Blob)&&A.isSpecCompliantForm(t);if(!A.isFunction(i))throw new TypeError("visitor must be a function");function c(p){if(p===null)return"";if(A.isDate(p))return p.toISOString();if(!h&&A.isBlob(p))throw new Y("Blob is not supported. Use a Buffer instead.");return A.isArrayBuffer(p)||A.isTypedArray(p)?h&&typeof Blob=="function"?new Blob([p]):Buffer.from(p):p}function u(p,y,v){let w=p;if(p&&!v&&typeof p=="object"){if(A.endsWith(y,"{}"))y=n?y:y.slice(0,-2),p=JSON.stringify(p);else if(A.isArray(p)&&Ed(p)||(A.isFileList(p)||A.endsWith(y,"[]"))&&(w=A.toArray(p)))return y=Ha(y),w.forEach(function(x,b){!(A.isUndefined(x)||x===null)&&t.append(o===!0?Wa([y],b,r):o===null?y:y+"[]",c(x))}),!1}return $i(p)?!0:(t.append(Wa(v,y,r),c(p)),!1)}const l=[],m=Object.assign(Pd,{defaultVisitor:u,convertValue:c,isVisitable:$i});function f(p,y){if(!A.isUndefined(p)){if(l.indexOf(p)!==-1)throw Error("Circular reference detected in "+y.join("."));l.push(p),A.forEach(p,function(w,_){(!(A.isUndefined(w)||w===null)&&i.call(t,w,A.isString(_)?_.trim():_,y,m))===!0&&f(w,y?y.concat(_):[_])}),l.pop()}}if(!A.isObject(s))throw new TypeError("data must be an object");return f(s),t}function Ja(s){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(s).replace(/[!'()~]|%20|%00/g,function(n){return t[n]})}function Xi(s,t){this._pairs=[],s&&vs(s,this,t)}const Za=Xi.prototype;Za.append=function(t,e){this._pairs.push([t,e])},Za.toString=function(t){const e=t?function(n){return t.call(this,n,Ja)}:Ja;return this._pairs.map(function(i){return e(i[0])+"="+e(i[1])},"").join("&")};function Md(s){return encodeURIComponent(s).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Qa(s,t,e){if(!t)return s;const n=e&&e.encode||Md;A.isFunction(e)&&(e={serialize:e});const i=e&&e.serialize;let r;if(i?r=i(t,e):r=A.isURLSearchParams(t)?t.toString():new Xi(t,e).toString(n),r){const o=s.indexOf("#");o!==-1&&(s=s.slice(0,o)),s+=(s.indexOf("?")===-1?"?":"&")+r}return s}class Ad{constructor(){this.handlers=[]}use(t,e,n){return this.handlers.push({fulfilled:t,rejected:e,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){A.forEach(this.handlers,function(n){n!==null&&t(n)})}}const Ka=Ad,th={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},kd={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:Xi,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},Ui=typeof window<"u"&&typeof document<"u",Vi=typeof navigator=="object"&&navigator||void 0,Id=Ui&&(!Vi||["ReactNative","NativeScript","NS"].indexOf(Vi.product)<0),Dd=(()=>typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function")(),Ld=Ui&&window.location.href||"http://localhost",bt={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Ui,hasStandardBrowserEnv:Id,hasStandardBrowserWebWorkerEnv:Dd,navigator:Vi,origin:Ld},Symbol.toStringTag,{value:"Module"})),...kd};function Rd(s,t){return vs(s,new bt.classes.URLSearchParams,Object.assign({visitor:function(e,n,i,r){return bt.isNode&&A.isBuffer(e)?(this.append(n,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)}},t))}function Od(s){return A.matchAll(/\w+|\[(\w*)]/g,s).map(t=>t[0]==="[]"?"":t[1]||t[0])}function zd(s){const t={},e=Object.keys(s);let n;const i=e.length;let r;for(n=0;n<i;n++)r=e[n],t[r]=s[r];return t}function eh(s){function t(e,n,i,r){let o=e[r++];if(o==="__proto__")return!0;const a=Number.isFinite(+o),h=r>=e.length;return o=!o&&A.isArray(i)?i.length:o,h?(A.hasOwnProp(i,o)?i[o]=[i[o],n]:i[o]=n,!a):((!i[o]||!A.isObject(i[o]))&&(i[o]=[]),t(e,n,i[o],r)&&A.isArray(i[o])&&(i[o]=zd(i[o])),!a)}if(A.isFormData(s)&&A.isFunction(s.entries)){const e={};return A.forEachEntry(s,(n,i)=>{t(Od(n),i,e,0)}),e}return null}function Nd(s,t,e){if(A.isString(s))try{return(t||JSON.parse)(s),A.trim(s)}catch(n){if(n.name!=="SyntaxError")throw n}return(e||JSON.stringify)(s)}const Gi={transitional:th,adapter:["xhr","http","fetch"],transformRequest:[function(t,e){const n=e.getContentType()||"",i=n.indexOf("application/json")>-1,r=A.isObject(t);if(r&&A.isHTMLForm(t)&&(t=new FormData(t)),A.isFormData(t))return i?JSON.stringify(eh(t)):t;if(A.isArrayBuffer(t)||A.isBuffer(t)||A.isStream(t)||A.isFile(t)||A.isBlob(t)||A.isReadableStream(t))return t;if(A.isArrayBufferView(t))return t.buffer;if(A.isURLSearchParams(t))return e.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let a;if(r){if(n.indexOf("application/x-www-form-urlencoded")>-1)return Rd(t,this.formSerializer).toString();if((a=A.isFileList(t))||n.indexOf("multipart/form-data")>-1){const h=this.env&&this.env.FormData;return vs(a?{"files[]":t}:t,h&&new h,this.formSerializer)}}return r||i?(e.setContentType("application/json",!1),Nd(t)):t}],transformResponse:[function(t){const e=this.transitional||Gi.transitional,n=e&&e.forcedJSONParsing,i=this.responseType==="json";if(A.isResponse(t)||A.isReadableStream(t))return t;if(t&&A.isString(t)&&(n&&!this.responseType||i)){const o=!(e&&e.silentJSONParsing)&&i;try{return JSON.parse(t)}catch(a){if(o)throw a.name==="SyntaxError"?Y.from(a,Y.ERR_BAD_RESPONSE,this,null,this.response):a}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:bt.classes.FormData,Blob:bt.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};A.forEach(["delete","get","head","post","put","patch"],s=>{Gi.headers[s]={}});const qi=Gi,Bd=A.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Fd=s=>{const t={};let e,n,i;return s&&s.split(`
13
- `).forEach(function(o){i=o.indexOf(":"),e=o.substring(0,i).trim().toLowerCase(),n=o.substring(i+1).trim(),!(!e||t[e]&&Bd[e])&&(e==="set-cookie"?t[e]?t[e].push(n):t[e]=[n]:t[e]=t[e]?t[e]+", "+n:n)}),t},nh=Symbol("internals");function In(s){return s&&String(s).trim().toLowerCase()}function _s(s){return s===!1||s==null?s:A.isArray(s)?s.map(_s):String(s)}function Yd(s){const t=Object.create(null),e=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=e.exec(s);)t[n[1]]=n[2];return t}const $d=s=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(s.trim());function ji(s,t,e,n,i){if(A.isFunction(n))return n.call(this,t,e);if(i&&(t=e),!!A.isString(t)){if(A.isString(n))return t.indexOf(n)!==-1;if(A.isRegExp(n))return n.test(t)}}function Xd(s){return s.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,e,n)=>e.toUpperCase()+n)}function Ud(s,t){const e=A.toCamelCase(" "+t);["get","set","has"].forEach(n=>{Object.defineProperty(s,n+e,{value:function(i,r,o){return this[n].call(this,t,i,r,o)},configurable:!0})})}class Ss{constructor(t){t&&this.set(t)}set(t,e,n){const i=this;function r(a,h,c){const u=In(h);if(!u)throw new Error("header name must be a non-empty string");const l=A.findKey(i,u);(!l||i[l]===void 0||c===!0||c===void 0&&i[l]!==!1)&&(i[l||h]=_s(a))}const o=(a,h)=>A.forEach(a,(c,u)=>r(c,u,h));if(A.isPlainObject(t)||t instanceof this.constructor)o(t,e);else if(A.isString(t)&&(t=t.trim())&&!$d(t))o(Fd(t),e);else if(A.isHeaders(t))for(const[a,h]of t.entries())r(h,a,n);else t!=null&&r(e,t,n);return this}get(t,e){if(t=In(t),t){const n=A.findKey(this,t);if(n){const i=this[n];if(!e)return i;if(e===!0)return Yd(i);if(A.isFunction(e))return e.call(this,i,n);if(A.isRegExp(e))return e.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,e){if(t=In(t),t){const n=A.findKey(this,t);return!!(n&&this[n]!==void 0&&(!e||ji(this,this[n],n,e)))}return!1}delete(t,e){const n=this;let i=!1;function r(o){if(o=In(o),o){const a=A.findKey(n,o);a&&(!e||ji(n,n[a],a,e))&&(delete n[a],i=!0)}}return A.isArray(t)?t.forEach(r):r(t),i}clear(t){const e=Object.keys(this);let n=e.length,i=!1;for(;n--;){const r=e[n];(!t||ji(this,this[r],r,t,!0))&&(delete this[r],i=!0)}return i}normalize(t){const e=this,n={};return A.forEach(this,(i,r)=>{const o=A.findKey(n,r);if(o){e[o]=_s(i),delete e[r];return}const a=t?Xd(r):String(r).trim();a!==r&&delete e[r],e[a]=_s(i),n[a]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const e=Object.create(null);return A.forEach(this,(n,i)=>{n!=null&&n!==!1&&(e[i]=t&&A.isArray(n)?n.join(", "):n)}),e}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,e])=>t+": "+e).join(`
14
- `)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...e){const n=new this(t);return e.forEach(i=>n.set(i)),n}static accessor(t){const n=(this[nh]=this[nh]={accessors:{}}).accessors,i=this.prototype;function r(o){const a=In(o);n[a]||(Ud(i,o),n[a]=!0)}return A.isArray(t)?t.forEach(r):r(t),this}}Ss.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),A.reduceDescriptors(Ss.prototype,({value:s},t)=>{let e=t[0].toUpperCase()+t.slice(1);return{get:()=>s,set(n){this[e]=n}}}),A.freezeMethods(Ss);const Wt=Ss;function Hi(s,t){const e=this||qi,n=t||e,i=Wt.from(n.headers);let r=n.data;return A.forEach(s,function(a){r=a.call(e,r,i.normalize(),t?t.status:void 0)}),i.normalize(),r}function sh(s){return!!(s&&s.__CANCEL__)}function ln(s,t,e){Y.call(this,s??"canceled",Y.ERR_CANCELED,t,e),this.name="CanceledError"}A.inherits(ln,Y,{__CANCEL__:!0});function ih(s,t,e){const n=e.config.validateStatus;!e.status||!n||n(e.status)?s(e):t(new Y("Request failed with status code "+e.status,[Y.ERR_BAD_REQUEST,Y.ERR_BAD_RESPONSE][Math.floor(e.status/100)-4],e.config,e.request,e))}function Vd(s){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(s);return t&&t[1]||""}function Gd(s,t){s=s||10;const e=new Array(s),n=new Array(s);let i=0,r=0,o;return t=t!==void 0?t:1e3,function(h){const c=Date.now(),u=n[r];o||(o=c),e[i]=h,n[i]=c;let l=r,m=0;for(;l!==i;)m+=e[l++],l=l%s;if(i=(i+1)%s,i===r&&(r=(r+1)%s),c-o<t)return;const f=u&&c-u;return f?Math.round(m*1e3/f):void 0}}function qd(s,t){let e=0,n=1e3/t,i,r;const o=(c,u=Date.now())=>{e=u,i=null,r&&(clearTimeout(r),r=null),s.apply(null,c)};return[(...c)=>{const u=Date.now(),l=u-e;l>=n?o(c,u):(i=c,r||(r=setTimeout(()=>{r=null,o(i)},n-l)))},()=>i&&o(i)]}const Cs=(s,t,e=3)=>{let n=0;const i=Gd(50,250);return qd(r=>{const o=r.loaded,a=r.lengthComputable?r.total:void 0,h=o-n,c=i(h),u=o<=a;n=o;const l={loaded:o,total:a,progress:a?o/a:void 0,bytes:h,rate:c||void 0,estimated:c&&a&&u?(a-o)/c:void 0,event:r,lengthComputable:a!=null,[t?"download":"upload"]:!0};s(l)},e)},rh=(s,t)=>{const e=s!=null;return[n=>t[0]({lengthComputable:e,total:s,loaded:n}),t[1]]},oh=s=>(...t)=>A.asap(()=>s(...t)),jd=bt.hasStandardBrowserEnv?((s,t)=>e=>(e=new URL(e,bt.origin),s.protocol===e.protocol&&s.host===e.host&&(t||s.port===e.port)))(new URL(bt.origin),bt.navigator&&/(msie|trident)/i.test(bt.navigator.userAgent)):()=>!0,Hd=bt.hasStandardBrowserEnv?{write(s,t,e,n,i,r){const o=[s+"="+encodeURIComponent(t)];A.isNumber(e)&&o.push("expires="+new Date(e).toGMTString()),A.isString(n)&&o.push("path="+n),A.isString(i)&&o.push("domain="+i),r===!0&&o.push("secure"),document.cookie=o.join("; ")},read(s){const t=document.cookie.match(new RegExp("(^|;\\s*)("+s+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(s){this.write(s,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function Wd(s){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(s)}function Jd(s,t){return t?s.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):s}function ah(s,t,e){let n=!Wd(t);return s&&(n||e==!1)?Jd(s,t):t}const hh=s=>s instanceof Wt?{...s}:s;function Fe(s,t){t=t||{};const e={};function n(c,u,l,m){return A.isPlainObject(c)&&A.isPlainObject(u)?A.merge.call({caseless:m},c,u):A.isPlainObject(u)?A.merge({},u):A.isArray(u)?u.slice():u}function i(c,u,l,m){if(A.isUndefined(u)){if(!A.isUndefined(c))return n(void 0,c,l,m)}else return n(c,u,l,m)}function r(c,u){if(!A.isUndefined(u))return n(void 0,u)}function o(c,u){if(A.isUndefined(u)){if(!A.isUndefined(c))return n(void 0,c)}else return n(void 0,u)}function a(c,u,l){if(l in t)return n(c,u);if(l in s)return n(void 0,c)}const h={url:r,method:r,data:r,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:a,headers:(c,u,l)=>i(hh(c),hh(u),l,!0)};return A.forEach(Object.keys(Object.assign({},s,t)),function(u){const l=h[u]||i,m=l(s[u],t[u],u);A.isUndefined(m)&&l!==a||(e[u]=m)}),e}const ch=s=>{const t=Fe({},s);let{data:e,withXSRFToken:n,xsrfHeaderName:i,xsrfCookieName:r,headers:o,auth:a}=t;t.headers=o=Wt.from(o),t.url=Qa(ah(t.baseURL,t.url,t.allowAbsoluteUrls),s.params,s.paramsSerializer),a&&o.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):"")));let h;if(A.isFormData(e)){if(bt.hasStandardBrowserEnv||bt.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if((h=o.getContentType())!==!1){const[c,...u]=h?h.split(";").map(l=>l.trim()).filter(Boolean):[];o.setContentType([c||"multipart/form-data",...u].join("; "))}}if(bt.hasStandardBrowserEnv&&(n&&A.isFunction(n)&&(n=n(t)),n||n!==!1&&jd(t.url))){const c=i&&r&&Hd.read(r);c&&o.set(i,c)}return t},Zd=typeof XMLHttpRequest<"u"&&function(s){return new Promise(function(e,n){const i=ch(s);let r=i.data;const o=Wt.from(i.headers).normalize();let{responseType:a,onUploadProgress:h,onDownloadProgress:c}=i,u,l,m,f,p;function y(){f&&f(),p&&p(),i.cancelToken&&i.cancelToken.unsubscribe(u),i.signal&&i.signal.removeEventListener("abort",u)}let v=new XMLHttpRequest;v.open(i.method.toUpperCase(),i.url,!0),v.timeout=i.timeout;function w(){if(!v)return;const x=Wt.from("getAllResponseHeaders"in v&&v.getAllResponseHeaders()),E={data:!a||a==="text"||a==="json"?v.responseText:v.response,status:v.status,statusText:v.statusText,headers:x,config:s,request:v};ih(function(L){e(L),y()},function(L){n(L),y()},E),v=null}"onloadend"in v?v.onloadend=w:v.onreadystatechange=function(){!v||v.readyState!==4||v.status===0&&!(v.responseURL&&v.responseURL.indexOf("file:")===0)||setTimeout(w)},v.onabort=function(){v&&(n(new Y("Request aborted",Y.ECONNABORTED,s,v)),v=null)},v.onerror=function(){n(new Y("Network Error",Y.ERR_NETWORK,s,v)),v=null},v.ontimeout=function(){let b=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded";const E=i.transitional||th;i.timeoutErrorMessage&&(b=i.timeoutErrorMessage),n(new Y(b,E.clarifyTimeoutError?Y.ETIMEDOUT:Y.ECONNABORTED,s,v)),v=null},r===void 0&&o.setContentType(null),"setRequestHeader"in v&&A.forEach(o.toJSON(),function(b,E){v.setRequestHeader(E,b)}),A.isUndefined(i.withCredentials)||(v.withCredentials=!!i.withCredentials),a&&a!=="json"&&(v.responseType=i.responseType),c&&([m,p]=Cs(c,!0),v.addEventListener("progress",m)),h&&v.upload&&([l,f]=Cs(h),v.upload.addEventListener("progress",l),v.upload.addEventListener("loadend",f)),(i.cancelToken||i.signal)&&(u=x=>{v&&(n(!x||x.type?new ln(null,s,v):x),v.abort(),v=null)},i.cancelToken&&i.cancelToken.subscribe(u),i.signal&&(i.signal.aborted?u():i.signal.addEventListener("abort",u)));const _=Vd(i.url);if(_&&bt.protocols.indexOf(_)===-1){n(new Y("Unsupported protocol "+_+":",Y.ERR_BAD_REQUEST,s));return}v.send(r||null)})},Qd=(s,t)=>{const{length:e}=s=s?s.filter(Boolean):[];if(t||e){let n=new AbortController,i;const r=function(c){if(!i){i=!0,a();const u=c instanceof Error?c:this.reason;n.abort(u instanceof Y?u:new ln(u instanceof Error?u.message:u))}};let o=t&&setTimeout(()=>{o=null,r(new Y(`timeout ${t} of ms exceeded`,Y.ETIMEDOUT))},t);const a=()=>{s&&(o&&clearTimeout(o),o=null,s.forEach(c=>{c.unsubscribe?c.unsubscribe(r):c.removeEventListener("abort",r)}),s=null)};s.forEach(c=>c.addEventListener("abort",r));const{signal:h}=n;return h.unsubscribe=()=>A.asap(a),h}},Kd=function*(s,t){let e=s.byteLength;if(!t||e<t){yield s;return}let n=0,i;for(;n<e;)i=n+t,yield s.slice(n,i),n=i},tm=async function*(s,t){for await(const e of em(s))yield*Kd(e,t)},em=async function*(s){if(s[Symbol.asyncIterator]){yield*s;return}const t=s.getReader();try{for(;;){const{done:e,value:n}=await t.read();if(e)break;yield n}}finally{await t.cancel()}},uh=(s,t,e,n)=>{const i=tm(s,t);let r=0,o,a=h=>{o||(o=!0,n&&n(h))};return new ReadableStream({async pull(h){try{const{done:c,value:u}=await i.next();if(c){a(),h.close();return}let l=u.byteLength;if(e){let m=r+=l;e(m)}h.enqueue(new Uint8Array(u))}catch(c){throw a(c),c}},cancel(h){return a(h),i.return()}},{highWaterMark:2})},Ts=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",lh=Ts&&typeof ReadableStream=="function",nm=Ts&&(typeof TextEncoder=="function"?(s=>t=>s.encode(t))(new TextEncoder):async s=>new Uint8Array(await new Response(s).arrayBuffer())),fh=(s,...t)=>{try{return!!s(...t)}catch{return!1}},sm=lh&&fh(()=>{let s=!1;const t=new Request(bt.origin,{body:new ReadableStream,method:"POST",get duplex(){return s=!0,"half"}}).headers.has("Content-Type");return s&&!t}),dh=64*1024,Wi=lh&&fh(()=>A.isReadableStream(new Response("").body)),Es={stream:Wi&&(s=>s.body)};Ts&&(s=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!Es[t]&&(Es[t]=A.isFunction(s[t])?e=>e[t]():(e,n)=>{throw new Y(`Response type '${t}' is not supported`,Y.ERR_NOT_SUPPORT,n)})})})(new Response);const im=async s=>{if(s==null)return 0;if(A.isBlob(s))return s.size;if(A.isSpecCompliantForm(s))return(await new Request(bt.origin,{method:"POST",body:s}).arrayBuffer()).byteLength;if(A.isArrayBufferView(s)||A.isArrayBuffer(s))return s.byteLength;if(A.isURLSearchParams(s)&&(s=s+""),A.isString(s))return(await nm(s)).byteLength},rm=async(s,t)=>{const e=A.toFiniteNumber(s.getContentLength());return e??im(t)},Ji={http:Td,xhr:Zd,fetch:Ts&&(async s=>{let{url:t,method:e,data:n,signal:i,cancelToken:r,timeout:o,onDownloadProgress:a,onUploadProgress:h,responseType:c,headers:u,withCredentials:l="same-origin",fetchOptions:m}=ch(s);c=c?(c+"").toLowerCase():"text";let f=Qd([i,r&&r.toAbortSignal()],o),p;const y=f&&f.unsubscribe&&(()=>{f.unsubscribe()});let v;try{if(h&&sm&&e!=="get"&&e!=="head"&&(v=await rm(u,n))!==0){let E=new Request(t,{method:"POST",body:n,duplex:"half"}),C;if(A.isFormData(n)&&(C=E.headers.get("content-type"))&&u.setContentType(C),E.body){const[L,B]=rh(v,Cs(oh(h)));n=uh(E.body,dh,L,B)}}A.isString(l)||(l=l?"include":"omit");const w="credentials"in Request.prototype;p=new Request(t,{...m,signal:f,method:e.toUpperCase(),headers:u.normalize().toJSON(),body:n,duplex:"half",credentials:w?l:void 0});let _=await fetch(p);const x=Wi&&(c==="stream"||c==="response");if(Wi&&(a||x&&y)){const E={};["status","statusText","headers"].forEach(F=>{E[F]=_[F]});const C=A.toFiniteNumber(_.headers.get("content-length")),[L,B]=a&&rh(C,Cs(oh(a),!0))||[];_=new Response(uh(_.body,dh,L,()=>{B&&B(),y&&y()}),E)}c=c||"text";let b=await Es[A.findKey(Es,c)||"text"](_,s);return!x&&y&&y(),await new Promise((E,C)=>{ih(E,C,{data:b,headers:Wt.from(_.headers),status:_.status,statusText:_.statusText,config:s,request:p})})}catch(w){throw y&&y(),w&&w.name==="TypeError"&&/fetch/i.test(w.message)?Object.assign(new Y("Network Error",Y.ERR_NETWORK,s,p),{cause:w.cause||w}):Y.from(w,w&&w.code,s,p)}})};A.forEach(Ji,(s,t)=>{if(s){try{Object.defineProperty(s,"name",{value:t})}catch{}Object.defineProperty(s,"adapterName",{value:t})}});const mh=s=>`- ${s}`,om=s=>A.isFunction(s)||s===null||s===!1,ph={getAdapter:s=>{s=A.isArray(s)?s:[s];const{length:t}=s;let e,n;const i={};for(let r=0;r<t;r++){e=s[r];let o;if(n=e,!om(e)&&(n=Ji[(o=String(e)).toLowerCase()],n===void 0))throw new Y(`Unknown adapter '${o}'`);if(n)break;i[o||"#"+r]=n}if(!n){const r=Object.entries(i).map(([a,h])=>`adapter ${a} `+(h===!1?"is not supported by the environment":"is not available in the build"));let o=t?r.length>1?`since :
15
- `+r.map(mh).join(`
16
- `):" "+mh(r[0]):"as no adapter specified";throw new Y("There is no suitable adapter to dispatch the request "+o,"ERR_NOT_SUPPORT")}return n},adapters:Ji};function Zi(s){if(s.cancelToken&&s.cancelToken.throwIfRequested(),s.signal&&s.signal.aborted)throw new ln(null,s)}function gh(s){return Zi(s),s.headers=Wt.from(s.headers),s.data=Hi.call(s,s.transformRequest),["post","put","patch"].indexOf(s.method)!==-1&&s.headers.setContentType("application/x-www-form-urlencoded",!1),ph.getAdapter(s.adapter||qi.adapter)(s).then(function(n){return Zi(s),n.data=Hi.call(s,s.transformResponse,n),n.headers=Wt.from(n.headers),n},function(n){return sh(n)||(Zi(s),n&&n.response&&(n.response.data=Hi.call(s,s.transformResponse,n.response),n.response.headers=Wt.from(n.response.headers))),Promise.reject(n)})}const yh="1.8.4",Ps={};["object","boolean","number","function","string","symbol"].forEach((s,t)=>{Ps[s]=function(n){return typeof n===s||"a"+(t<1?"n ":" ")+s}});const wh={};Ps.transitional=function(t,e,n){function i(r,o){return"[Axios v"+yh+"] Transitional option '"+r+"'"+o+(n?". "+n:"")}return(r,o,a)=>{if(t===!1)throw new Y(i(o," has been removed"+(e?" in "+e:"")),Y.ERR_DEPRECATED);return e&&!wh[o]&&(wh[o]=!0,console.warn(i(o," has been deprecated since v"+e+" and will be removed in the near future"))),t?t(r,o,a):!0}},Ps.spelling=function(t){return(e,n)=>(console.warn(`${n} is likely a misspelling of ${t}`),!0)};function am(s,t,e){if(typeof s!="object")throw new Y("options must be an object",Y.ERR_BAD_OPTION_VALUE);const n=Object.keys(s);let i=n.length;for(;i-- >0;){const r=n[i],o=t[r];if(o){const a=s[r],h=a===void 0||o(a,r,s);if(h!==!0)throw new Y("option "+r+" must be "+h,Y.ERR_BAD_OPTION_VALUE);continue}if(e!==!0)throw new Y("Unknown option "+r,Y.ERR_BAD_OPTION)}}const Ms={assertOptions:am,validators:Ps},re=Ms.validators;class As{constructor(t){this.defaults=t,this.interceptors={request:new Ka,response:new Ka}}async request(t,e){try{return await this._request(t,e)}catch(n){if(n instanceof Error){let i={};Error.captureStackTrace?Error.captureStackTrace(i):i=new Error;const r=i.stack?i.stack.replace(/^.+\n/,""):"";try{n.stack?r&&!String(n.stack).endsWith(r.replace(/^.+\n.+\n/,""))&&(n.stack+=`
17
- `+r):n.stack=r}catch{}}throw n}}_request(t,e){typeof t=="string"?(e=e||{},e.url=t):e=t||{},e=Fe(this.defaults,e);const{transitional:n,paramsSerializer:i,headers:r}=e;n!==void 0&&Ms.assertOptions(n,{silentJSONParsing:re.transitional(re.boolean),forcedJSONParsing:re.transitional(re.boolean),clarifyTimeoutError:re.transitional(re.boolean)},!1),i!=null&&(A.isFunction(i)?e.paramsSerializer={serialize:i}:Ms.assertOptions(i,{encode:re.function,serialize:re.function},!0)),e.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?e.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:e.allowAbsoluteUrls=!0),Ms.assertOptions(e,{baseUrl:re.spelling("baseURL"),withXsrfToken:re.spelling("withXSRFToken")},!0),e.method=(e.method||this.defaults.method||"get").toLowerCase();let o=r&&A.merge(r.common,r[e.method]);r&&A.forEach(["delete","get","head","post","put","patch","common"],p=>{delete r[p]}),e.headers=Wt.concat(o,r);const a=[];let h=!0;this.interceptors.request.forEach(function(y){typeof y.runWhen=="function"&&y.runWhen(e)===!1||(h=h&&y.synchronous,a.unshift(y.fulfilled,y.rejected))});const c=[];this.interceptors.response.forEach(function(y){c.push(y.fulfilled,y.rejected)});let u,l=0,m;if(!h){const p=[gh.bind(this),void 0];for(p.unshift.apply(p,a),p.push.apply(p,c),m=p.length,u=Promise.resolve(e);l<m;)u=u.then(p[l++],p[l++]);return u}m=a.length;let f=e;for(l=0;l<m;){const p=a[l++],y=a[l++];try{f=p(f)}catch(v){y.call(this,v);break}}try{u=gh.call(this,f)}catch(p){return Promise.reject(p)}for(l=0,m=c.length;l<m;)u=u.then(c[l++],c[l++]);return u}getUri(t){t=Fe(this.defaults,t);const e=ah(t.baseURL,t.url,t.allowAbsoluteUrls);return Qa(e,t.params,t.paramsSerializer)}}A.forEach(["delete","get","head","options"],function(t){As.prototype[t]=function(e,n){return this.request(Fe(n||{},{method:t,url:e,data:(n||{}).data}))}}),A.forEach(["post","put","patch"],function(t){function e(n){return function(r,o,a){return this.request(Fe(a||{},{method:t,headers:n?{"Content-Type":"multipart/form-data"}:{},url:r,data:o}))}}As.prototype[t]=e(),As.prototype[t+"Form"]=e(!0)});const ks=As;class Qi{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let e;this.promise=new Promise(function(r){e=r});const n=this;this.promise.then(i=>{if(!n._listeners)return;let r=n._listeners.length;for(;r-- >0;)n._listeners[r](i);n._listeners=null}),this.promise.then=i=>{let r;const o=new Promise(a=>{n.subscribe(a),r=a}).then(i);return o.cancel=function(){n.unsubscribe(r)},o},t(function(r,o,a){n.reason||(n.reason=new ln(r,o,a),e(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const e=this._listeners.indexOf(t);e!==-1&&this._listeners.splice(e,1)}toAbortSignal(){const t=new AbortController,e=n=>{t.abort(n)};return this.subscribe(e),t.signal.unsubscribe=()=>this.unsubscribe(e),t.signal}static source(){let t;return{token:new Qi(function(i){t=i}),cancel:t}}}const hm=Qi;function cm(s){return function(e){return s.apply(null,e)}}function um(s){return A.isObject(s)&&s.isAxiosError===!0}const Ki={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Ki).forEach(([s,t])=>{Ki[t]=s});const lm=Ki;function xh(s){const t=new ks(s),e=Ba(ks.prototype.request,t);return A.extend(e,ks.prototype,t,{allOwnKeys:!0}),A.extend(e,t,null,{allOwnKeys:!0}),e.create=function(i){return xh(Fe(s,i))},e}const ht=xh(qi);ht.Axios=ks,ht.CanceledError=ln,ht.CancelToken=hm,ht.isCancel=sh,ht.VERSION=yh,ht.toFormData=vs,ht.AxiosError=Y,ht.Cancel=ht.CanceledError,ht.all=function(t){return Promise.all(t)},ht.spread=cm,ht.isAxiosError=um,ht.mergeConfig=Fe,ht.AxiosHeaders=Wt,ht.formToJSON=s=>eh(A.isHTMLForm(s)?new FormData(s):s),ht.getAdapter=ph.getAdapter,ht.HttpStatusCode=lm,ht.default=ht;const fm=ht;class tr{instance;canceler;retryCount=0;cacheTime=0;caches=new cn;constructor(t){this.instance=fm.create(t),this.canceler=new dm,this.retryCount=t?.retry||0,this.cacheTime=t?.cache||0,this.instance.interceptors.request.use(e=>(this.canceler.pendingRequest(e),t?.interceptor?.request?.(e),e),e=>(this.canceler.cancelRequest(e.config),t?.interceptor?.requestError?.(e),e)),this.instance.interceptors.response.use(e=>(this.canceler.confirmRequest(e.config),t?.interceptor?.response?.(e),e.status==200?Promise.resolve(e):Promise.reject(e)),e=>(this.canceler.cancelRequest(e.config),t?.interceptor?.responseError?.(e),Promise.reject(e.response)))}request(t){let e=this.instance.request;const n=t.retry||this.retryCount;n&&(e=Ei(e,n));const i=t.cache||this.cacheTime;return i&&(e=Pi(e,i,this.caches)),e(t)}cancel(t){this.canceler.cancelRequest(t)}get(t,e){return this.request({...e,method:"get",url:t})}delete(t,e){return this.request({...e,method:"delete",url:t})}head(t,e){return this.request({...e,method:"head",url:t})}options(t,e){return this.request({...e,method:"options",url:t})}post(t,e,n){return this.request({...n,method:"post",url:t,data:e})}postBlob(t,e,n){return n={...n,headers:{...n?.headers,"Content-Type":"multipart/form-data"}},this.request({...n,method:"post",url:t,data:e})}postForm(t,e,n){return this.instance.postForm(t,e,{...n})}put(t,e,n){return this.request({...n,method:"put",url:t,data:e})}patch(t,e,n){return this.request({...n,method:"patch",url:t,data:e})}getUri(t){return this.instance.getUri(t)}}class dm{pendingRequestMap;constructor(){this.pendingRequestMap=new Map}getRequestId(t){const{method:e,url:n,params:i,data:r}=t;return Si({method:e,url:n,params:i,data:r})}pendingRequest(t){const e=this.getRequestId(t);if(this.pendingRequestMap.has(e))t.signal=this.pendingRequestMap.get(e)?.signal;else{const n=new AbortController;t.signal=n.signal,this.pendingRequestMap.set(e,n)}}confirmRequest(t){if(this.pendingRequestMap.size===0)return;const e=this.getRequestId(t);this.pendingRequestMap.has(e)&&this.pendingRequestMap.delete(e)}cancelRequest(t){if(this.pendingRequestMap.size===0)return;const e=this.getRequestId(t);this.pendingRequestMap.has(e)&&(this.pendingRequestMap.get(e)?.abort(),this.pendingRequestMap.delete(e))}cancelAllRequest(){const t=this.pendingRequestMap.values();for(const e of t)e.abort();this.pendingRequestMap.clear()}}const er=s=>new XMLSerializer().serializeToString(s),mm=(s,t="text/html")=>new DOMParser().parseFromString(s,t),nr=(s,t=Tt.SVG,e=us.utf8)=>Ti(er(s),t,e);async function sr(s=["*"],t){let e=[];const n=document.createElement("input");return n.setAttribute("type","file"),n.setAttribute("visibility","hidden"),n.setAttribute("accept",s.join(",")),t&&n.setAttribute("multiple","true"),n.addEventListener("click",i=>{n.value=""},!1),new Promise((i,r)=>{n.addEventListener("change",o=>{e=Array.from(o.target.files||[]),e.length===0?r(new Error("Cancel")):i(e)},!1),window.addEventListener("focus",()=>{setTimeout(()=>{e.length===0&&r(new Error("Cancel"))},1e3)},{once:!0}),n.click()}).then(i=>(n.remove(),i)).catch(i=>{throw n.remove(),i})}function Dn(s,t=$t.text,e){return new Promise((n,i)=>{const r=new FileReader;switch(r.addEventListener("progress",o=>{e?.(o.loaded,o.total)}),r.addEventListener("load",o=>{n(o.target?.result)}),r.addEventListener("error",o=>{i(o)}),t){case $t.dataURL:r.readAsDataURL(s);break;case $t.binaryString:r.readAsBinaryString(s);break;case $t.arraybuffer:r.readAsArrayBuffer(s);break;case $t.text:default:r.readAsText(s)}})}async function pm(s){const t=await Dn(s,$t.arraybuffer);return hf(t)}const gm=s=>{let t;return s instanceof File?t=s.name:t=s,t.match(/\.([0-9a-z]+)(?:[\\?#]|$)/i)?.[1]||""};function ym(s){switch(s.toLowerCase()){case"jpg":case"jpeg":return Tt.JPEG;case"gif":return Tt.GIF;case"svg":return Tt.SVG;case"pdf":return Tt.PDF;case"png":default:return Tt.PNG}}function bh(s,t,e,n,i,r,o){const a=new FileReader;a.addEventListener("load",h=>{if(!h.target||!h.target.result)return t(h);if(e.append(h.target.result),o<n.size)bh(s,t,e,n,i,o,Math.min(o+i,n.size));else return s(e.end())}),a.addEventListener("error",h=>t(h)),a.readAsArrayBuffer(n.slice(r,o))}async function vh(s,t=1048576){return await new Promise((e,n)=>bh(e,n,new Yf.ArrayBuffer,s,t,0,Math.min(t,s.size)))}class wm{axios;checkURL;uploadURL;file;fileHash;chunkSize;chunks;currentChunk=0;isUploading=!1;begin=0;end=0;timer;time=[0,0,0,0,0,0];onExist;onStart;onProgress;onComplete;onTime;constructor(t){this.axios=new tr({baseURL:t.baseURL,interceptor:{response:e=>{e.config.url==this.uploadURL&&e.status==200&&(this.onProgress?.(this.currentChunk++,this.chunks),this.end==this.file.size?(this.isUploading=!1,this.stopTimeCount(),this.onComplete?.()):this.isUploading&&this.uploadChunk())}}}),this.checkURL=t.checkURL,this.uploadURL=t.uploadURL,this.file=t.file,this.chunkSize=t.chunkSize||1048576,this.chunks=Math.ceil(this.file.size/this.chunkSize),this.onExist=t.onExist,this.onStart=t.onStart,this.onProgress=t.onProgress,this.onComplete=t.onComplete,this.onTime=t.onTime}async start(){this.fileHash||(this.fileHash=await vh(this.file,this.chunkSize)),(await this.axios.post(this.checkURL,{fileName:this.file.name,fileHash:this.fileHash})).data.isExist?(this.isUploading=!1,this.onExist?.()):this.isUploading||(this.onStart?.(),this.startTimeCount(),await this.uploadChunk())}pause(){this.isUploading&&(this.isUploading=!1,this.stopTimeCount())}async uploadChunk(){this.isUploading=!0,this.begin=this.currentChunk*this.chunkSize,this.end=Math.min(this.begin+this.chunkSize,this.file.size);const t=this.file.slice(this.begin,this.end),e=new FormData;e.append("fileData",t),e.append("fileName",this.file.name),e.append("fileHash",this.fileHash),e.append("chunkIndex",String(this.currentChunk)),e.append("chunks",String(this.chunks)),await this.axios.postBlob(this.uploadURL,e)}startTimeCount(){this.stopTimeCount(),this.timer=setInterval(()=>{df(this.time,1),this.onTime?.(uf(this.time))},1e3)}stopTimeCount(){this.timer&&(clearInterval(this.timer),this.timer=void 0)}}var _h={exports:{}};/*! Hammer.JS - v2.0.7 - 2016-04-22
10
+ `.replace(/\s+/g,""),"u");break;case"mime-image":t=/^image\//;break;case"mime-video":t=/^video\//;break;case"mime-audio":t=/^audio\//;break;case"mime-document-word":t=/^application\/(?:vnd\.openxmlformats-officedocument\.wordprocessingml\.document|msword|vnd\.ms-word\.document\.macroenabled\.12|vnd\.openxmlformats-officedocument\.wordprocessingml\.template|vnd\.ms-word\.template\.macroenabled\.12)$/;break;case"mime-document-excel":t=/^application\/(?:vnd\.openxmlformats-officedocument\.spreadsheetml\.sheet|vnd\.ms-excel|vnd\.ms-excel\.sheet\.macroenabled\.12|vnd\.openxmlformats-officedocument\.spreadsheetml\.template|vnd\.ms-excel\.template\.macroenabled\.12)$/;break;case"mime-document-ppt":t=/^application\/(?:vnd\.ms-powerpoint|vnd\.openxmlformats-officedocument\.presentationml\.presentation|vnd\.ms-powerpoint\.presentation\.macroenabled\.12|vnd\.openxmlformats-officedocument\.presentationml\.template|vnd\.ms-powerpoint\.template\.macroenabled\.12)$/;break;case"mime-document-json":t=/^application\/json$/;break;case"mime-document-xml":t=/^(?:application|text)\/(?:xml|xhtml\+xml)$/;break}return t},ue=(n,t)=>(typeof n=="string"&&(n=gn(n)||new RegExp(n)),n.test(t)),wa=(n,t)=>{typeof n=="string"&&(n=gn(n)||new RegExp(n));const e=t.match(n);return e?n.flags.toLowerCase().indexOf("g")>=0?e.map(s=>({matchIndex:-1,fullMatch:s,groupMatchs:[]})):{matchIndex:typeof e.index=="number"?e.index:-1,fullMatch:e[0],groupMatchs:e.slice(1)}:null},xa=(n,t)=>{typeof n=="string"&&(n=gn(n)||new RegExp(n));const e=[],s=t.matchAll(n);for(const i of s)e.push({matchIndex:typeof i.index=="number"?i.index:-1,fullMatch:i[0],groupMatchs:i.slice(1)});return e};function Xu(n){const t=n.match(/[\s\S]/gu);return t?t.length:0}function ba(n,t){const e=n.codePointAt(t);return e?String.fromCodePoint(e):void 0}function Ms(n=12,t="all"){let e="ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghijklmnopqrstuvwxyz0123456789";t=="number"&&(e="0123456789");const s=e.length;let i="";for(let r=0;r<n;r++)i+=e[Math.floor(Math.random()*s)];return i}function Uu(n){return n.replace(/(^\w)/g,t=>t.toLowerCase())}const lt=(n,t="-")=>{let e=n.replace(new RegExp(`${t}?([A-Z])`,"g"),t+"$1").toLowerCase();return e=e.replace(new RegExp(`^${t}`),""),e};function $u(n){return n.replace(/(^\w|[_-]\w)/g,t=>t.slice(-1).toUpperCase())}function va(n){return Uu($u(n))}function Sa(n){let t="";for(let e=0,s=n.length;e<s;e++){const i=n.charCodeAt(e);i>=1&&i<=127?t+=n.charAt(e):i>2047?(t+=String.fromCharCode(224|i>>12&15),t+=String.fromCharCode(128|i>>6&63),t+=String.fromCharCode(128|i>>0&63)):(t+=String.fromCharCode(192|i>>6&31),t+=String.fromCharCode(128|i>>0&63))}return t}function Vu(n){return n.slice(0)}function Gu(n,t=!0){const e=t?Vu(n.buffer):n.buffer;return new n.constructor(e,n.byteOffset,n.length)}const qu="[object Undefined]",ju="[object Null]",Hu="[object Boolean]",Wu="[object Number]",Ju="[object BigInt]",_a="[object String]",Zu="[object Symbol]",Qu="[object Function]",Ku="[object Array]",tf="[object GeneratorFunction]";function yn(n){return Object.prototype.toString.call(n)}function ef(n){return n!=null}function sf(n){return yn(n)===_a}function Ca(n){const t=yn(n);return t===qu||t===ju||t===Hu||t===Wu||t===_a||t===Zu||t===Ju}function nf(n){const t=yn(n);return t==Qu||t==tf}function Ii(n){return yn(n)===Ku}function rf(n){return!!n&&typeof n=="object"}function wn(n){return rf(n)&&!Ii(n)}const Ta=n=>{for(const t in n)if(Object.prototype.hasOwnProperty.call(n,t))return!1;return!0};function of(n){const t=[];for(const e in n)Object.prototype.hasOwnProperty.call(n,e)&&t.push(e);return t}function as(n,t,e=!1){if(wn(n)&&wn(t))for(const s in t)wn(t[s])?(typeof n[s]>"u"&&Object.assign(n,{[s]:{}}),as(n[s],t[s],e)):(e||typeof n[s]>"u")&&(n[s]=t[s]);return n}function Pa(n,...t){return new n.constructor(...t)}function Ye(n,t=`\r
11
+ `,e=6,s=1){if(sf(n))return`"${n}"`;if(Ca(n))return""+n;if(nf(n))return"[Fn]";if(s>e)return Ii(n)?"[...]":"{...}";let i="",r="";for(let o=0;o<s;o++)i+=" ",o>0&&(r+=" ");return Ii(n)?`[${n.map(o=>t+i+Ye(o,t,e,s+1)).join(", ")}${t}${r}]`:`{${of(n).map(o=>`${t}${i}${o}: ${Ye(n[o],t,e,s+1)}`).join(", ")}${t}${r}}`}function af(n,t="",e=["","sign","key"]){return wn(n)?Object.keys(n).filter(s=>{for(let i=0,r=e.length;i<r;i++)if(n[s]==e[i])return!1;return!0}).sort().map(s=>`${s}=${n[s]}`).join("&")+t:String(n)}function hf(n=[],t=[]){const e=n.length,s=t.length;for(let r=0;r<s;r++)n[r]=t[r];let i=Math.max(0,e-s);for(;i>0;)n.pop(),i--;return n}function ki(n,t){const e=n.findIndex(s=>s===t);return e>=0&&n.splice(e,1),n}function Ea(n,t){return n.findIndex(e=>e==t)>=0}function cf(n,...t){return t.forEach(e=>{Ea(n,e)||n.push(e)}),n}function lf(n){if(n<=1)return!1;for(let t=2;t<=Math.sqrt(n);t++)if(n%t===0)return!1;return!0}function uf(n){for(;!lf(n);)n++;return n}function jt(n,t){const e=parseFloat(n);if(Number.isNaN(e)){if(typeof t=="number")return t;throw new Error(`"${n}" is NaN!`)}return e}function As(n,t,e=1e-6){return Math.abs(n-t)<e}function N(n,t,e){const s=Math.min(t,e),i=Math.max(t,e);return n<s?s:n>i?i:n}function ff(n,t){return(n%t+t)%t}function xn(n,t,e){return typeof n=="number"&&typeof t=="number"?(1-e)*n+e*t:typeof n=="number"?n:typeof t=="number"?t:0}function df(n,t,e){const s=Math.max(n.length,t.length),i=new Array(s);for(let r=0;r<s;r++)i[r]=xn(n[r],t[r],e);return i}function mf(n,t,e){return s=>{const i=N(s,n,t);return e==0?i:t-i<e?t:Math.round(i/e)*e}}function pf(n,t=12){return jt(n,0).toFixed(t)}function F(n,t=12){return+pf(n,t)}function Di(n,t){const e=wa("number-single",String(n));return{hasNumber:!!e,number:e&&!Array.isArray(e)&&e.fullMatch?parseFloat(e.fullMatch):ef(t)?t:NaN,prefix:e&&!Array.isArray(e)&&e.fullMatch?n.substring(0,e.matchIndex):"",suffix:e&&!Array.isArray(e)&&e.fullMatch?n.substring(e.matchIndex+e.fullMatch.length):""}}function Li(n){const t=wa("number",n);return t?Array.isArray(t)?t.map(e=>Number(e.fullMatch)):[Number(t.fullMatch)]:[]}function ut(){return(performance||Date).now()}function ne(n=new Date){return n.getTime()}function gf(n,t=3){const e=Math.max(n.length,6);let s="";for(let r=0;r<e-4;r++)s+=n[r]||"0";const i=[s,""+(n[e-4]||"0")+(n[e-3]||"0"),""+(n[e-2]||"0")+(n[e-1]||"0")];switch(t){case 1:return i[0];case 2:return i[0]+":"+i[1];case 3:return i[0]+":"+i[1]+":"+i[2]}}function yf(n){const t=Math.max(n.length,6);let e=0;e+=(n[t-2]||0)*10+(n[t-1]||0),e+=((n[t-4]||0)*10+(n[t-3]||0))*60;let s=0;for(let i=0;i<t-4;i++)s=s*10+(n[i]||0);return e+=s*60*60,Math.floor(Math.max(0,e))}function wf(n,t=!1){let e=0;typeof n=="number"?e=n:e=yf(n);const s=[],i=e%60;s.unshift(i%10),s.unshift(Math.floor(i/10)),e=Math.floor(e/60);const r=e%60;if(s.unshift(r%10),s.unshift(Math.floor(r/10)),e=Math.floor(e/60),t){const o=e%100;for(s.unshift(o%10),s.unshift(Math.floor(o/10)),e=Math.floor(e/100);e;)s.unshift(e%10),e=Math.floor(e/10)}else{const o=e%24;s.unshift(o%10),s.unshift(Math.floor(o/10))}return s}function xf(n,t=1,e=!1){return n[n.length-1]+=t,wf(n,e)}function Ma(n,t){const e=typeof t?.aliveInSeconds=="number"?Math.max(t.aliveInSeconds,0):-1,s=typeof t?.aliveUntilTimestamp=="number"?Math.max(t.aliveUntilTimestamp,0):-1;function i(o,a=!1){return Ca(o)||!Fu(o,Ps)?{v:o,[Ps]:ne()}:a?o:{...o,[Ps]:ne()}}let r=i(n,!0);return{get:()=>{let o=!1;return(e>=0&&ne()>r[Ps]+e*1e3||s>=0&&ne()>s)&&(o=!0),o&&(r.v=void 0),r},set:o=>r=i(o)}}const bf=typeof window<"u";!!(vt.Worker&&vt.Blob&&vt.Promise&&vt.OffscreenCanvas&&vt.OffscreenCanvasRenderingContext2D&&vt.HTMLCanvasElement&&vt.HTMLCanvasElement.prototype.transferControlToOffscreen&&vt.URL&&vt.URL.createObjectURL);const vf=(()=>{if(!vt.OffscreenCanvas)return!1;const n=new OffscreenCanvas(1,1),t=n.getContext("2d");if(!t)return!1;t.fillRect(0,0,1,1);const e=n.transferToImageBitmap();try{t.createPattern(e,"no-repeat")}catch{return!1}return!0})();let Aa;try{Aa=Map}catch{Aa=function(){}}let Ia;try{Ia=Set}catch{Ia=function(){}}const hs=(n,t=16)=>{let e=n.toLowerCase();const s=e.indexOf("0b")==0,i=e.indexOf("0o")==0,r=e.indexOf("0x")==0;(s||i||r)&&(e=e.slice(2)),s&&(t=2),i&&(t=8),r&&(t=16);const o=parseInt(e,t);if(isNaN(o))throw new Error(`radixStringToNumber(${n}, ${t}) 无法解析!`);return o};function Ri(n){return new TextEncoder().encode(n)}function ka(n){return String.fromCharCode.apply(null,new Uint16Array(n))}const Oi=(n,t,e)=>t?e===pn.base64?new Blob([n],{type:`${t};${e}`}):e===pn.utf8?new Blob([n],{type:`${t};charset=${e}`}):new Blob([n],{type:`${t}`}):new Blob([n]),Sf=n=>{let t=Tt.UNKNOWN;switch(new DataView(n).getUint32(0,_f()).toString(16).toUpperCase()){case"FFD8FFDB":t=Tt.JPEG;break;case"FFD8FFE0":case"FFD8FFE1":case"FFD8FFE2":case"FFD8FFE3":t=Tt.JPEG;break;case"89504E47":t=Tt.PNG;break;case"47494638":t=Tt.GIF;break;case"52494646":t=Tt.WEBP;break;case"25504446":t=Tt.PDF;break;case"504B0304":t=Tt.ZIP;break}return t};function _f(){const n=Uint32Array.of(305419896),t=new Uint8Array(n.buffer);switch(t[0]*16777216+t[1]*65536+t[2]*256+t[3]){case 305419896:return!1;case 2018915346:return!0}}const Is={THROW:1,DROP:2,SLIDE:3,EXPAND:4};class Cf{queue;limit;overflow;constructor(t=10,e=Is.EXPAND){this.queue=[],this.limit=t,this.overflow=e}length(){return this.queue.length}isEmpty(){return this.length()===0}findIndex(t){return this.queue.findIndex(t)}deleteIndex(t){return!!this.queue.splice(t,1).length}delete(t){const e=this.findIndex(t);return e>-1?this.deleteIndex(e):!1}enqueue(t){if(this.length()<this.limit){this.queue.push(t);return}switch(this.overflow){case Is.EXPAND:this.limit*=2,this.queue.push(t);break;case Is.SLIDE:this.deleteIndex(0),this.queue.push(t);break;case Is.THROW:throw new Error(`Queue limit(${this.limit}) overflow!`)}}push(t){this.enqueue(t)}put(t){this.enqueue(t)}dequeue(){return this.queue.shift()}pop(){return this.dequeue()}take(){return this.dequeue()}peek(){return this.queue[0]}index(t){return this.queue[t]}clear(){this.queue=[]}flush(){const t=[];let e;for(;e=this.dequeue();)t.push(e);return t}}const Tf=n=>new Cf(n,Is.EXPAND),Da={SLIDE:1,EXPAND:2};class Pf{size;table;objectSignature;overflow;ttl;constructor(t){this.table=new Array(t?.size||137),this.size=this.table.length,this.objectSignature=t?.objectSignature||(e=>String(e)),this.overflow=t?.overflow||Da.EXPAND,this.ttl=t?.ttl||6e4}hash(t){if(t==null||t==null)throw new Error("HashTable can't put undefined or null");const e=this.objectSignature(t),s=31;let i=0;for(let r=0,o=e.length;r<o;r++)i+=s*i+e.charCodeAt(r);return i%this.size}resize(){const t=this.size,e=uf(this.size*2),s=new Array(e),i=this.table;this.table=s,this.size=e;for(let r=0,o=t;r<o;r++)if(i[r]!==void 0&&!this.isOutdated(i[r])){let a=this.hash(i[r].value);for(;s[a]!==void 0;)a=(a+1)%e;s[a]=i[r]}i.length=0}put(t){this.size>200&&Math.random()<.1&&this.clean();let e=this.hash(t);const s=e;for(;this.table[e]!==void 0&&!this.isOutdated(this.table[e]);)if(e=(e+1)%this.size,s==e){if(this.overflow==Da.EXPAND)return this.resize(),this.put(t);break}return this.table[e]={value:t,timestamp:Date.now()},e}traverse(t){for(let e=0,s=this.size;e<s;e++)if(this.table[e]!==void 0&&!t(this.table[e].value,e))return e;return-1}update(t){this.traverse((e,s)=>(t(e)===!1&&this.deleteIndex(s),!0))}getIndex(t){let e=this.hash(t);const s=e;for(;this.table[e]?.value!==t;)if(this.table[e]===void 0||(this.isOutdated(this.table[e])&&(this.table[e]=void 0),e=(e+1)%this.size,s==e))return-1;return this.isOutdated(this.table[e])?(this.table[e]=void 0,-1):e}has(t){return this.getIndex(t)>=0}find(t){const e=this.traverse(s=>!t(s));return e>=0?this.table[e]?.value:void 0}deleteIndex(t){return t>=0&&t<this.size&&this.table[t]!==void 0?(this.table[t]=void 0,!0):!1}delete(t){return this.deleteIndex(this.getIndex(t))}clear(){this.table=[]}isOutdated(t){return Date.now()-t.timestamp>this.ttl}clean(){for(let t=0,e=this.size;t<e;t++)this.table[t]!==void 0&&this.isOutdated(this.table[t])&&(this.table[t]=void 0)}}class ks{maps=new Map;constructor(){}entries(){return[...this.maps.entries()]}keys(){return[...this.maps.keys()]}values(){return[...this.maps.values()]}json(){const t={};for(const e of this.maps)t[e[0]]=e[1];return t}get length(){return this.maps.size}set(t,e){this.maps.set(t,e)}get(t){return this.maps.get(t)}has(t){return this.maps.has(t)}getEntryFromIndex(t){let e=-1;for(const s of this.maps)if(++e==t)return s}getEntry(t){for(const e of this.maps)if(t(e[0],e[1]))return e}firstEntry(){return this.getEntryFromIndex(0)}shift(){const t=this.firstEntry();if(t){const[e]=t;this.delete(e)}return t}delete(t){return this.maps.delete(t)}clear(){this.maps.clear()}update(t){const e=this.entries();for(let s=0,i=e.length;s<i;s++){const[r,o]=e[s];t(r,o)===!1&&this.delete(r)}}}function Ef(){vt.OPEN_LOG=!0}function Mf(){vt.OPEN_LOG=!1}function Af(n){vt.LOG_UPLOAD_FN=n}function La(){return!!vt.OPEN_LOG}function Ra(n){vt.LOG_UPLOAD_FN&&vt.LOG_UPLOAD_FN(n)}function ie(n){Ra({level:"info",msg:n}),La()&&(!console||typeof console!="object"||typeof console.log!="function"||console.log(n))}function bn(n){Ra({level:"warn",msg:n}),La()&&(!console||typeof console!="object"||typeof console.warn!="function"||console.warn(n))}const Oa=()=>{};function za(n=0,t){const e=t?.min||300,s=t?.max||6e4,i=t?.exponent||2,r=t?.factor||.5;let o=e*Math.pow(i,n);if(r){const a=Math.random(),h=Math.floor(a*r*o);o=Math.floor(a*10)&1?o+h:o-h}return Math.min(o,s)|0}function zi(n,t=3,e,s){return async function(...i){const r=`retry(${n.name})(${i.map(a=>Ye(a))})`;let o;for(let a=0;a<t;a++)try{return await n.call(s||this,...i)}catch(h){ie(`(${r}) 第 ${a+1} 次尝试失败, retrying...`),o=h,await new Promise(c=>setTimeout(c,typeof e=="number"?e:za(a)))}throw ie(`(${r}) 已 ${t} 次失败,不再重试。 Last error: ${Ye(o)}`),o}}function Bi(n,t=60,e=new ks,s){return async function(...i){const r=`cache(${n.name})(${i.map(c=>Ye(c))})`,o=Date.now();t&&e.update((c,l)=>o-l.timestamp<t*1e3);const a=Ai(i),h=e.get(a);if(h){if(!t||o-h.timestamp<t*1e3)return ie(`${r} 击中缓存`),h.value;e.delete(a)}try{ie(`${r} 没有缓存, 尝试立即执行...`);const c=await n.call(s||this,...i);return ie(`${r} 缓存设置成功`),e.set(a,{value:c,timestamp:Date.now()}),c}catch(c){throw ie(`${r} 执行失败 : ${Ye(c)}`),c}}}var Ni=function(n,t){return Ni=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,s){e.__proto__=s}||function(e,s){for(var i in s)Object.prototype.hasOwnProperty.call(s,i)&&(e[i]=s[i])},Ni(n,t)};function Fi(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");Ni(n,t);function e(){this.constructor=n}n.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}function Ba(n){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&n[t],s=0;if(e)return e.call(n);if(n&&typeof n.length=="number")return{next:function(){return n&&s>=n.length&&(n=void 0),{value:n&&n[s++],done:!n}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function Yi(n,t){var e=typeof Symbol=="function"&&n[Symbol.iterator];if(!e)return n;var s=e.call(n),i,r=[],o;try{for(;(t===void 0||t-- >0)&&!(i=s.next()).done;)r.push(i.value)}catch(a){o={error:a}}finally{try{i&&!i.done&&(e=s.return)&&e.call(s)}finally{if(o)throw o.error}}return r}function Xi(n,t,e){if(e||arguments.length===2)for(var s=0,i=t.length,r;s<i;s++)(r||!(s in t))&&(r||(r=Array.prototype.slice.call(t,0,s)),r[s]=t[s]);return n.concat(r||Array.prototype.slice.call(t))}function fe(n){return typeof n=="function"}function If(n){var t=function(s){Error.call(s),s.stack=new Error().stack},e=n(t);return e.prototype=Object.create(Error.prototype),e.prototype.constructor=e,e}var Ui=If(function(n){return function(t){n(this),this.message=t?t.length+` errors occurred during unsubscription:
12
+ `+t.map(function(e,s){return s+1+") "+e.toString()}).join(`
13
+ `):"",this.name="UnsubscriptionError",this.errors=t}});function Na(n,t){if(n){var e=n.indexOf(t);0<=e&&n.splice(e,1)}}var $i=function(){function n(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}return n.prototype.unsubscribe=function(){var t,e,s,i,r;if(!this.closed){this.closed=!0;var o=this._parentage;if(o)if(this._parentage=null,Array.isArray(o))try{for(var a=Ba(o),h=a.next();!h.done;h=a.next()){var c=h.value;c.remove(this)}}catch(y){t={error:y}}finally{try{h&&!h.done&&(e=a.return)&&e.call(a)}finally{if(t)throw t.error}}else o.remove(this);var l=this.initialTeardown;if(fe(l))try{l()}catch(y){r=y instanceof Ui?y.errors:[y]}var u=this._finalizers;if(u){this._finalizers=null;try{for(var m=Ba(u),f=m.next();!f.done;f=m.next()){var p=f.value;try{Ya(p)}catch(y){r=r??[],y instanceof Ui?r=Xi(Xi([],Yi(r)),Yi(y.errors)):r.push(y)}}}catch(y){s={error:y}}finally{try{f&&!f.done&&(i=m.return)&&i.call(m)}finally{if(s)throw s.error}}}if(r)throw new Ui(r)}},n.prototype.add=function(t){var e;if(t&&t!==this)if(this.closed)Ya(t);else{if(t instanceof n){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=(e=this._finalizers)!==null&&e!==void 0?e:[]).push(t)}},n.prototype._hasParent=function(t){var e=this._parentage;return e===t||Array.isArray(e)&&e.includes(t)},n.prototype._addParent=function(t){var e=this._parentage;this._parentage=Array.isArray(e)?(e.push(t),e):e?[e,t]:t},n.prototype._removeParent=function(t){var e=this._parentage;e===t?this._parentage=null:Array.isArray(e)&&Na(e,t)},n.prototype.remove=function(t){var e=this._finalizers;e&&Na(e,t),t instanceof n&&t._removeParent(this)},n.EMPTY=function(){var t=new n;return t.closed=!0,t}(),n}();$i.EMPTY;function Fa(n){return n instanceof $i||n&&"closed"in n&&fe(n.remove)&&fe(n.add)&&fe(n.unsubscribe)}function Ya(n){fe(n)?n():n.unsubscribe()}var Xa={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},kf={setTimeout:function(n,t){for(var e=[],s=2;s<arguments.length;s++)e[s-2]=arguments[s];return setTimeout.apply(void 0,Xi([n,t],Yi(e)))},clearTimeout:function(n){return clearTimeout(n)},delegate:void 0};function Df(n){kf.setTimeout(function(){throw n})}function Ua(){}function Lf(n){n()}var Vi=function(n){Fi(t,n);function t(e){var s=n.call(this)||this;return s.isStopped=!1,e?(s.destination=e,Fa(e)&&e.add(s)):s.destination=Bf,s}return t.create=function(e,s,i){return new qi(e,s,i)},t.prototype.next=function(e){this.isStopped||this._next(e)},t.prototype.error=function(e){this.isStopped||(this.isStopped=!0,this._error(e))},t.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,n.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(e){this.destination.next(e)},t.prototype._error=function(e){try{this.destination.error(e)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t}($i),Rf=Function.prototype.bind;function Gi(n,t){return Rf.call(n,t)}var Of=function(){function n(t){this.partialObserver=t}return n.prototype.next=function(t){var e=this.partialObserver;if(e.next)try{e.next(t)}catch(s){vn(s)}},n.prototype.error=function(t){var e=this.partialObserver;if(e.error)try{e.error(t)}catch(s){vn(s)}else vn(t)},n.prototype.complete=function(){var t=this.partialObserver;if(t.complete)try{t.complete()}catch(e){vn(e)}},n}(),qi=function(n){Fi(t,n);function t(e,s,i){var r=n.call(this)||this,o;if(fe(e)||!e)o={next:e??void 0,error:s??void 0,complete:i??void 0};else{var a;r&&Xa.useDeprecatedNextContext?(a=Object.create(e),a.unsubscribe=function(){return r.unsubscribe()},o={next:e.next&&Gi(e.next,a),error:e.error&&Gi(e.error,a),complete:e.complete&&Gi(e.complete,a)}):o=e}return r.destination=new Of(o),r}return t}(Vi);function vn(n){Df(n)}function zf(n){throw n}var Bf={closed:!0,next:Ua,error:zf,complete:Ua},Nf=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function Ff(n){return n}function Yf(n){return n.length===0?Ff:n.length===1?n[0]:function(t){return n.reduce(function(e,s){return s(e)},t)}}(function(){function n(t){t&&(this._subscribe=t)}return n.prototype.lift=function(t){var e=new n;return e.source=this,e.operator=t,e},n.prototype.subscribe=function(t,e,s){var i=this,r=Uf(t)?t:new qi(t,e,s);return Lf(function(){var o=i,a=o.operator,h=o.source;r.add(a?a.call(r,h):h?i._subscribe(r):i._trySubscribe(r))}),r},n.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(e){t.error(e)}},n.prototype.forEach=function(t,e){var s=this;return e=$a(e),new e(function(i,r){var o=new qi({next:function(a){try{t(a)}catch(h){r(h),o.unsubscribe()}},error:r,complete:i});s.subscribe(o)})},n.prototype._subscribe=function(t){var e;return(e=this.source)===null||e===void 0?void 0:e.subscribe(t)},n.prototype[Nf]=function(){return this},n.prototype.pipe=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Yf(t)(this)},n.prototype.toPromise=function(t){var e=this;return t=$a(t),new t(function(s,i){var r;e.subscribe(function(o){return r=o},function(o){return i(o)},function(){return s(r)})})},n.create=function(t){return new n(t)},n})();function $a(n){var t;return(t=n??Xa.Promise)!==null&&t!==void 0?t:Promise}function Xf(n){return n&&fe(n.next)&&fe(n.error)&&fe(n.complete)}function Uf(n){return n&&n instanceof Vi||Xf(n)&&Fa(n)}(function(n){Fi(t,n);function t(e,s,i,r,o,a){var h=n.call(this,e)||this;return h.onFinalize=o,h.shouldUnsubscribe=a,h._next=s?function(c){try{s(c)}catch(l){e.error(l)}}:n.prototype._next,h._error=r?function(c){try{r(c)}catch(l){e.error(l)}finally{this.unsubscribe()}}:n.prototype._error,h._complete=i?function(){try{i()}catch(c){e.error(c)}finally{this.unsubscribe()}}:n.prototype._complete,h}return t.prototype.unsubscribe=function(){var e;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var s=this.closed;n.prototype.unsubscribe.call(this),!s&&((e=this.onFinalize)===null||e===void 0||e.call(this))}},t})(Vi);let Ds;function Ht(n){Ds=n,n(),Ds=null}class $f{subscribers=new Set;add(){Ds&&!this.subscribers.has(Ds)&&this.subscribers.add(Ds)}notify(){this.subscribers.forEach(t=>t())}}const Va=new WeakMap;function Sn(n,t){let e=Va.get(n);e||(e=new Map,Va.set(n,e));let s=e.get(t);return s||(s=new $f,e.set(t,s)),s}function Vf(n,t=!1){return Object.keys(n).forEach(e=>{let s=n[e];if(t&&typeof s=="object"&&s!==null)n[e]=Hi(s,t);else{const i=Sn(n,e);Object.defineProperty(n,e,{configurable:!0,enumerable:!0,get(){return i.add(),s},set(r){s!=r&&(s=r,i.notify())}})}}),n}function ji(n,t=!1){return Vf({value:n},t)}function Hi(n,t=!1){const e={get(s,i,r){const o=Reflect.get(s,i,r);if(t&&typeof o=="object"&&o!==null&&!("isYZReactiveProxy"in o)){const a=Hi(o,t);a.YZReactiveProxyParentTarget=s,a.YZReactiveProxyParentKey=i,Reflect.set(r,i,a)}return Sn(s,i).add(),Reflect.get(s,i,r)},set(s,i,r,o){const a=Reflect.get(s,i,o),h=Reflect.set(s,i,r,o);return Array.isArray(s)?Sn(s.YZReactiveProxyParentTarget,s.YZReactiveProxyParentKey).notify():a!=r&&Sn(s,i).notify(),h},has(s,i){return i==="isYZReactiveProxy"||i in s}};return new Proxy(n,e)}const Ga=Hi;class _n{events;constructor(){this.events={}}isEmpty(t){return this.events[t]==null||this.events[t].length==0}has(t,e){return this.events[t]!==void 0&&this.events[t].indexOf(e)!==-1}prependListener(t,e,s){return this.events[t]||(this.events[t]=[]),this.events[t].unshift(s?e.bind(s):e),this}addListener(t,e,s){return this.events[t]||(this.events[t]=[]),this.events[t].push(s?e.bind(s):e),this}on(t,e,s){return this.addListener(t,e,s),this}removeListener(t,e){return this.events[t]&&(this.events[t]=this.events[t].filter(s=>s!==e)),this}off(t,e){return this.removeListener(t,e),this}removeAllListeners(t){return t?this.events[t]=[]:this.events={},this}emit(t,...e){return this.events[t]&&this.events[t].slice(0).forEach(s=>{s(...e)}),this}once(t,e,s){const i=(...r)=>{s?e.apply(s,r):e(...r),this.off(t,i)};return this.on(t,i),this}}function Gf(){const n={};return n.promise=new Promise((t,e)=>{n.resolve=t,n.reject=e}),n}let qf=0;function qa(n){const t=Gf();let e=!1;return{name:n.name||String(++qf),deadline:typeof n.deadline=="number"?Math.max(n.deadline,0):-1,run:async()=>{if(!e){e=!0;try{let s;const i=n.args||[];n.thisArg?s=await n.fn.call(n.thisArg,...i):s=await n.fn(...i),t.resolve(s)}catch(s){t.reject(s)}}},result:()=>t.promise}}class jf{queue;suspend=!1;semaphore=0;concurrency=1;timeRemaining=-1;timeoutId;constructor(t){this.queue=t?.queue||Tf(10),typeof t?.concurrency=="number"&&(this.concurrency=Math.max(t?.concurrency,1)),typeof t?.timeRemaining=="number"&&this.setTimeRemaining(t.timeRemaining)}setTimeRemaining(t){this.timeRemaining=Math.max(0,t)}increaseTimeRemaining(t,e=!1){this.timeRemaining!==-1?this.setTimeRemaining(this.timeRemaining+t):e&&this.setTimeRemaining(t)}decreaseTimeRemaining(t){this.timeRemaining!==-1&&this.setTimeRemaining(this.timeRemaining-t)}_exec(t,e=!0){const s=ne();try{this.semaphore++,t.run()}finally{this.semaphore--,e&&(this.decreaseTimeRemaining(ne()-s),this._flush())}}_flush(){for(;!this.suspend&&this.semaphore<this.concurrency&&(this.timeRemaining==-1||this.timeRemaining>0);){const t=this.queue.dequeue();if(!t)break;this._exec(t)}this._timeout()}_timeout(t=0,e=0){clearTimeout(this.timeoutId),this.timeoutId=setTimeout(()=>{if(!(this.suspend||this.semaphore>0||!this.queue.length)){for(let s=0;s<this.queue.length();){const i=this.queue.index(s);if(!i)break;i.deadline!=-1&&i.deadline<=ne()?(this._exec(i,!1),this.queue.deleteIndex(s)):s++}this.queue.length()&&(this.timeoutId=setTimeout(()=>{this._timeout(t,++e)},300*Math.pow(2,e)))}},t)}pause(){this.suspend=!0}resume(){this.suspend=!1,this._flush()}addTask(t){this.queue.delete(e=>e.name==t.name),this.queue.enqueue(t)}immediately(t){this._exec(t),this._flush()}asap(t){this.addTask(t),this._flush()}idleCallback(t){this.setTimeRemaining(t.timeRemaining()),this._flush()}clear(){this.queue.clear()}}class ja extends jf{lastResult;constructor(t){super(t)}_exec(t,e=!0){const s=ne();try{this.semaphore++,t.run()}finally{t.result().then(i=>{this.lastResult=i}).finally(()=>{this.semaphore--,e&&(this.decreaseTimeRemaining(ne()-s),this._flush())})}}}class Hf{schedule;closeLastDialog;constructor(t){this.schedule=new ja(t)}asap(t,e){const s=qa({fn:i=>new Promise(r=>{this.closeLastDialog=t({...i,onClose:()=>{this.closeLastDialog=void 0,i?.onClose?.(),r()}})}),args:[e]});return this.schedule.asap(s),s}immediately(t,e){return this.clear(),this.asap(t,e)}closeLast(){this.closeLastDialog&&this.closeLastDialog()}clear(){this.schedule.clear(),this.closeLast()}}function Ha(n,t={},e){if(typeof t=="function"&&(e=t,t={}),e)return e(Ha)(n,t);let s=t;const i=[],r=c=>(i.push(c),()=>{ki(i,c)}),o=c=>{s=n(s,c),i.forEach(l=>l())},a=()=>s,h=c=>{n=c,o({type:"INIT"})};return o({type:"INIT"}),{getState:a,dispatch:o,subscribe:r,replaceReducer:h}}function Wf(n=window.location.href){try{return new URL(n)}catch{const t="(?<protocol>https?:)",e="(?<host>(?<hostname>[^/#?:]+)(?::(?<port>\\d+))?)",s="(?<pathname>(?:\\/[^/#?]+)*\\/?)",i="(?<search>(?:\\?[^#]*)?)",r="(?<hash>(?:#.*)?)",o=new RegExp(`^${t}//${e}${s}${i}${r}$`).exec(n);return{href:n,protocol:o?.groups?.protocol||"",host:o?.groups?.host||"",hostname:o?.groups?.hostname||"",port:o?.groups?.port||"",pathname:o?.groups?.pathname||"",search:o?.groups?.search||"",hash:o?.groups?.hash||""}}}function Jf(n=window.location.href){const t=Wf(n),e=t.href.indexOf(t.hash);return t.hash&&e>=0?t.href.substring(0,e):t.href}function Zf(n,t){return n+t.replace(/^[&?]/,n.indexOf("?")>=0?"&":"?")}function Qf(n){return"?"+Object.entries(n).map(([t,e])=>`${encodeURIComponent(t)}=${encodeURIComponent(e)}`).join("&")}function Kf(n){return"?"+[...n.entries()].map(t=>encodeURIComponent(t[0])+"="+encodeURIComponent(t[1]instanceof File?t[1].name:t[1])).join("&")}function Wa(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Ja={exports:{}};(function(n,t){(function(e){n.exports=e()})(function(e){var s=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"];function i(w,v){var x=w[0],b=w[1],P=w[2],C=w[3];x+=(b&P|~b&C)+v[0]-680876936|0,x=(x<<7|x>>>25)+b|0,C+=(x&b|~x&P)+v[1]-389564586|0,C=(C<<12|C>>>20)+x|0,P+=(C&x|~C&b)+v[2]+606105819|0,P=(P<<17|P>>>15)+C|0,b+=(P&C|~P&x)+v[3]-1044525330|0,b=(b<<22|b>>>10)+P|0,x+=(b&P|~b&C)+v[4]-176418897|0,x=(x<<7|x>>>25)+b|0,C+=(x&b|~x&P)+v[5]+1200080426|0,C=(C<<12|C>>>20)+x|0,P+=(C&x|~C&b)+v[6]-1473231341|0,P=(P<<17|P>>>15)+C|0,b+=(P&C|~P&x)+v[7]-45705983|0,b=(b<<22|b>>>10)+P|0,x+=(b&P|~b&C)+v[8]+1770035416|0,x=(x<<7|x>>>25)+b|0,C+=(x&b|~x&P)+v[9]-1958414417|0,C=(C<<12|C>>>20)+x|0,P+=(C&x|~C&b)+v[10]-42063|0,P=(P<<17|P>>>15)+C|0,b+=(P&C|~P&x)+v[11]-1990404162|0,b=(b<<22|b>>>10)+P|0,x+=(b&P|~b&C)+v[12]+1804603682|0,x=(x<<7|x>>>25)+b|0,C+=(x&b|~x&P)+v[13]-40341101|0,C=(C<<12|C>>>20)+x|0,P+=(C&x|~C&b)+v[14]-1502002290|0,P=(P<<17|P>>>15)+C|0,b+=(P&C|~P&x)+v[15]+1236535329|0,b=(b<<22|b>>>10)+P|0,x+=(b&C|P&~C)+v[1]-165796510|0,x=(x<<5|x>>>27)+b|0,C+=(x&P|b&~P)+v[6]-1069501632|0,C=(C<<9|C>>>23)+x|0,P+=(C&b|x&~b)+v[11]+643717713|0,P=(P<<14|P>>>18)+C|0,b+=(P&x|C&~x)+v[0]-373897302|0,b=(b<<20|b>>>12)+P|0,x+=(b&C|P&~C)+v[5]-701558691|0,x=(x<<5|x>>>27)+b|0,C+=(x&P|b&~P)+v[10]+38016083|0,C=(C<<9|C>>>23)+x|0,P+=(C&b|x&~b)+v[15]-660478335|0,P=(P<<14|P>>>18)+C|0,b+=(P&x|C&~x)+v[4]-405537848|0,b=(b<<20|b>>>12)+P|0,x+=(b&C|P&~C)+v[9]+568446438|0,x=(x<<5|x>>>27)+b|0,C+=(x&P|b&~P)+v[14]-1019803690|0,C=(C<<9|C>>>23)+x|0,P+=(C&b|x&~b)+v[3]-187363961|0,P=(P<<14|P>>>18)+C|0,b+=(P&x|C&~x)+v[8]+1163531501|0,b=(b<<20|b>>>12)+P|0,x+=(b&C|P&~C)+v[13]-1444681467|0,x=(x<<5|x>>>27)+b|0,C+=(x&P|b&~P)+v[2]-51403784|0,C=(C<<9|C>>>23)+x|0,P+=(C&b|x&~b)+v[7]+1735328473|0,P=(P<<14|P>>>18)+C|0,b+=(P&x|C&~x)+v[12]-1926607734|0,b=(b<<20|b>>>12)+P|0,x+=(b^P^C)+v[5]-378558|0,x=(x<<4|x>>>28)+b|0,C+=(x^b^P)+v[8]-2022574463|0,C=(C<<11|C>>>21)+x|0,P+=(C^x^b)+v[11]+1839030562|0,P=(P<<16|P>>>16)+C|0,b+=(P^C^x)+v[14]-35309556|0,b=(b<<23|b>>>9)+P|0,x+=(b^P^C)+v[1]-1530992060|0,x=(x<<4|x>>>28)+b|0,C+=(x^b^P)+v[4]+1272893353|0,C=(C<<11|C>>>21)+x|0,P+=(C^x^b)+v[7]-155497632|0,P=(P<<16|P>>>16)+C|0,b+=(P^C^x)+v[10]-1094730640|0,b=(b<<23|b>>>9)+P|0,x+=(b^P^C)+v[13]+681279174|0,x=(x<<4|x>>>28)+b|0,C+=(x^b^P)+v[0]-358537222|0,C=(C<<11|C>>>21)+x|0,P+=(C^x^b)+v[3]-722521979|0,P=(P<<16|P>>>16)+C|0,b+=(P^C^x)+v[6]+76029189|0,b=(b<<23|b>>>9)+P|0,x+=(b^P^C)+v[9]-640364487|0,x=(x<<4|x>>>28)+b|0,C+=(x^b^P)+v[12]-421815835|0,C=(C<<11|C>>>21)+x|0,P+=(C^x^b)+v[15]+530742520|0,P=(P<<16|P>>>16)+C|0,b+=(P^C^x)+v[2]-995338651|0,b=(b<<23|b>>>9)+P|0,x+=(P^(b|~C))+v[0]-198630844|0,x=(x<<6|x>>>26)+b|0,C+=(b^(x|~P))+v[7]+1126891415|0,C=(C<<10|C>>>22)+x|0,P+=(x^(C|~b))+v[14]-1416354905|0,P=(P<<15|P>>>17)+C|0,b+=(C^(P|~x))+v[5]-57434055|0,b=(b<<21|b>>>11)+P|0,x+=(P^(b|~C))+v[12]+1700485571|0,x=(x<<6|x>>>26)+b|0,C+=(b^(x|~P))+v[3]-1894986606|0,C=(C<<10|C>>>22)+x|0,P+=(x^(C|~b))+v[10]-1051523|0,P=(P<<15|P>>>17)+C|0,b+=(C^(P|~x))+v[1]-2054922799|0,b=(b<<21|b>>>11)+P|0,x+=(P^(b|~C))+v[8]+1873313359|0,x=(x<<6|x>>>26)+b|0,C+=(b^(x|~P))+v[15]-30611744|0,C=(C<<10|C>>>22)+x|0,P+=(x^(C|~b))+v[6]-1560198380|0,P=(P<<15|P>>>17)+C|0,b+=(C^(P|~x))+v[13]+1309151649|0,b=(b<<21|b>>>11)+P|0,x+=(P^(b|~C))+v[4]-145523070|0,x=(x<<6|x>>>26)+b|0,C+=(b^(x|~P))+v[11]-1120210379|0,C=(C<<10|C>>>22)+x|0,P+=(x^(C|~b))+v[2]+718787259|0,P=(P<<15|P>>>17)+C|0,b+=(C^(P|~x))+v[9]-343485551|0,b=(b<<21|b>>>11)+P|0,w[0]=x+w[0]|0,w[1]=b+w[1]|0,w[2]=P+w[2]|0,w[3]=C+w[3]|0}function r(w){var v=[],x;for(x=0;x<64;x+=4)v[x>>2]=w.charCodeAt(x)+(w.charCodeAt(x+1)<<8)+(w.charCodeAt(x+2)<<16)+(w.charCodeAt(x+3)<<24);return v}function o(w){var v=[],x;for(x=0;x<64;x+=4)v[x>>2]=w[x]+(w[x+1]<<8)+(w[x+2]<<16)+(w[x+3]<<24);return v}function a(w){var v=w.length,x=[1732584193,-271733879,-1732584194,271733878],b,P,C,D,B,Y;for(b=64;b<=v;b+=64)i(x,r(w.substring(b-64,b)));for(w=w.substring(b-64),P=w.length,C=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],b=0;b<P;b+=1)C[b>>2]|=w.charCodeAt(b)<<(b%4<<3);if(C[b>>2]|=128<<(b%4<<3),b>55)for(i(x,C),b=0;b<16;b+=1)C[b]=0;return D=v*8,D=D.toString(16).match(/(.*?)(.{0,8})$/),B=parseInt(D[2],16),Y=parseInt(D[1],16)||0,C[14]=B,C[15]=Y,i(x,C),x}function h(w){var v=w.length,x=[1732584193,-271733879,-1732584194,271733878],b,P,C,D,B,Y;for(b=64;b<=v;b+=64)i(x,o(w.subarray(b-64,b)));for(w=b-64<v?w.subarray(b-64):new Uint8Array(0),P=w.length,C=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],b=0;b<P;b+=1)C[b>>2]|=w[b]<<(b%4<<3);if(C[b>>2]|=128<<(b%4<<3),b>55)for(i(x,C),b=0;b<16;b+=1)C[b]=0;return D=v*8,D=D.toString(16).match(/(.*?)(.{0,8})$/),B=parseInt(D[2],16),Y=parseInt(D[1],16)||0,C[14]=B,C[15]=Y,i(x,C),x}function c(w){var v="",x;for(x=0;x<4;x+=1)v+=s[w>>x*8+4&15]+s[w>>x*8&15];return v}function l(w){var v;for(v=0;v<w.length;v+=1)w[v]=c(w[v]);return w.join("")}l(a("hello")),typeof ArrayBuffer<"u"&&!ArrayBuffer.prototype.slice&&function(){function w(v,x){return v=v|0||0,v<0?Math.max(v+x,0):Math.min(v,x)}ArrayBuffer.prototype.slice=function(v,x){var b=this.byteLength,P=w(v,b),C=b,D,B,Y,V;return x!==e&&(C=w(x,b)),P>C?new ArrayBuffer(0):(D=C-P,B=new ArrayBuffer(D),Y=new Uint8Array(B),V=new Uint8Array(this,P,D),Y.set(V),B)}}();function u(w){return/[\u0080-\uFFFF]/.test(w)&&(w=unescape(encodeURIComponent(w))),w}function m(w,v){var x=w.length,b=new ArrayBuffer(x),P=new Uint8Array(b),C;for(C=0;C<x;C+=1)P[C]=w.charCodeAt(C);return v?P:b}function f(w){return String.fromCharCode.apply(null,new Uint8Array(w))}function p(w,v,x){var b=new Uint8Array(w.byteLength+v.byteLength);return b.set(new Uint8Array(w)),b.set(new Uint8Array(v),w.byteLength),x?b:b.buffer}function y(w){var v=[],x=w.length,b;for(b=0;b<x-1;b+=2)v.push(parseInt(w.substr(b,2),16));return String.fromCharCode.apply(String,v)}function S(){this.reset()}return S.prototype.append=function(w){return this.appendBinary(u(w)),this},S.prototype.appendBinary=function(w){this._buff+=w,this._length+=w.length;var v=this._buff.length,x;for(x=64;x<=v;x+=64)i(this._hash,r(this._buff.substring(x-64,x)));return this._buff=this._buff.substring(x-64),this},S.prototype.end=function(w){var v=this._buff,x=v.length,b,P=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],C;for(b=0;b<x;b+=1)P[b>>2]|=v.charCodeAt(b)<<(b%4<<3);return this._finish(P,x),C=l(this._hash),w&&(C=y(C)),this.reset(),C},S.prototype.reset=function(){return this._buff="",this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},S.prototype.getState=function(){return{buff:this._buff,length:this._length,hash:this._hash.slice()}},S.prototype.setState=function(w){return this._buff=w.buff,this._length=w.length,this._hash=w.hash,this},S.prototype.destroy=function(){delete this._hash,delete this._buff,delete this._length},S.prototype._finish=function(w,v){var x=v,b,P,C;if(w[x>>2]|=128<<(x%4<<3),x>55)for(i(this._hash,w),x=0;x<16;x+=1)w[x]=0;b=this._length*8,b=b.toString(16).match(/(.*?)(.{0,8})$/),P=parseInt(b[2],16),C=parseInt(b[1],16)||0,w[14]=P,w[15]=C,i(this._hash,w)},S.hash=function(w,v){return S.hashBinary(u(w),v)},S.hashBinary=function(w,v){var x=a(w),b=l(x);return v?y(b):b},S.ArrayBuffer=function(){this.reset()},S.ArrayBuffer.prototype.append=function(w){var v=p(this._buff.buffer,w,!0),x=v.length,b;for(this._length+=w.byteLength,b=64;b<=x;b+=64)i(this._hash,o(v.subarray(b-64,b)));return this._buff=b-64<x?new Uint8Array(v.buffer.slice(b-64)):new Uint8Array(0),this},S.ArrayBuffer.prototype.end=function(w){var v=this._buff,x=v.length,b=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],P,C;for(P=0;P<x;P+=1)b[P>>2]|=v[P]<<(P%4<<3);return this._finish(b,x),C=l(this._hash),w&&(C=y(C)),this.reset(),C},S.ArrayBuffer.prototype.reset=function(){return this._buff=new Uint8Array(0),this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},S.ArrayBuffer.prototype.getState=function(){var w=S.prototype.getState.call(this);return w.buff=f(w.buff),w},S.ArrayBuffer.prototype.setState=function(w){return w.buff=m(w.buff,!0),S.prototype.setState.call(this,w)},S.ArrayBuffer.prototype.destroy=S.prototype.destroy,S.ArrayBuffer.prototype._finish=S.prototype._finish,S.ArrayBuffer.hash=function(w,v){var x=h(new Uint8Array(w)),b=l(x);return v?y(b):b},S})})(Ja);var td=Ja.exports;const ed=Wa(td);function Za(n,t){return function(){return n.apply(t,arguments)}}const{toString:sd}=Object.prototype,{getPrototypeOf:Wi}=Object,Cn=(n=>t=>{const e=sd.call(t);return n[e]||(n[e]=e.slice(8,-1).toLowerCase())})(Object.create(null)),Wt=n=>(n=n.toLowerCase(),t=>Cn(t)===n),Tn=n=>t=>typeof t===n,{isArray:cs}=Array,Ls=Tn("undefined");function nd(n){return n!==null&&!Ls(n)&&n.constructor!==null&&!Ls(n.constructor)&&Rt(n.constructor.isBuffer)&&n.constructor.isBuffer(n)}const Qa=Wt("ArrayBuffer");function id(n){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(n):t=n&&n.buffer&&Qa(n.buffer),t}const rd=Tn("string"),Rt=Tn("function"),Ka=Tn("number"),Pn=n=>n!==null&&typeof n=="object",od=n=>n===!0||n===!1,En=n=>{if(Cn(n)!=="object")return!1;const t=Wi(n);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in n)&&!(Symbol.iterator in n)},ad=Wt("Date"),hd=Wt("File"),cd=Wt("Blob"),ld=Wt("FileList"),ud=n=>Pn(n)&&Rt(n.pipe),fd=n=>{let t;return n&&(typeof FormData=="function"&&n instanceof FormData||Rt(n.append)&&((t=Cn(n))==="formdata"||t==="object"&&Rt(n.toString)&&n.toString()==="[object FormData]"))},dd=Wt("URLSearchParams"),[md,pd,gd,yd]=["ReadableStream","Request","Response","Headers"].map(Wt),wd=n=>n.trim?n.trim():n.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Rs(n,t,{allOwnKeys:e=!1}={}){if(n===null||typeof n>"u")return;let s,i;if(typeof n!="object"&&(n=[n]),cs(n))for(s=0,i=n.length;s<i;s++)t.call(null,n[s],s,n);else{const r=e?Object.getOwnPropertyNames(n):Object.keys(n),o=r.length;let a;for(s=0;s<o;s++)a=r[s],t.call(null,n[a],a,n)}}function th(n,t){t=t.toLowerCase();const e=Object.keys(n);let s=e.length,i;for(;s-- >0;)if(i=e[s],t===i.toLowerCase())return i;return null}const Xe=(()=>typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global)(),eh=n=>!Ls(n)&&n!==Xe;function Ji(){const{caseless:n}=eh(this)&&this||{},t={},e=(s,i)=>{const r=n&&th(t,i)||i;En(t[r])&&En(s)?t[r]=Ji(t[r],s):En(s)?t[r]=Ji({},s):cs(s)?t[r]=s.slice():t[r]=s};for(let s=0,i=arguments.length;s<i;s++)arguments[s]&&Rs(arguments[s],e);return t}const xd=(n,t,e,{allOwnKeys:s}={})=>(Rs(t,(i,r)=>{e&&Rt(i)?n[r]=Za(i,e):n[r]=i},{allOwnKeys:s}),n),bd=n=>(n.charCodeAt(0)===65279&&(n=n.slice(1)),n),vd=(n,t,e,s)=>{n.prototype=Object.create(t.prototype,s),n.prototype.constructor=n,Object.defineProperty(n,"super",{value:t.prototype}),e&&Object.assign(n.prototype,e)},Sd=(n,t,e,s)=>{let i,r,o;const a={};if(t=t||{},n==null)return t;do{for(i=Object.getOwnPropertyNames(n),r=i.length;r-- >0;)o=i[r],(!s||s(o,n,t))&&!a[o]&&(t[o]=n[o],a[o]=!0);n=e!==!1&&Wi(n)}while(n&&(!e||e(n,t))&&n!==Object.prototype);return t},_d=(n,t,e)=>{n=String(n),(e===void 0||e>n.length)&&(e=n.length),e-=t.length;const s=n.indexOf(t,e);return s!==-1&&s===e},Cd=n=>{if(!n)return null;if(cs(n))return n;let t=n.length;if(!Ka(t))return null;const e=new Array(t);for(;t-- >0;)e[t]=n[t];return e},Td=(n=>t=>n&&t instanceof n)(typeof Uint8Array<"u"&&Wi(Uint8Array)),Pd=(n,t)=>{const s=(n&&n[Symbol.iterator]).call(n);let i;for(;(i=s.next())&&!i.done;){const r=i.value;t.call(n,r[0],r[1])}},Ed=(n,t)=>{let e;const s=[];for(;(e=n.exec(t))!==null;)s.push(e);return s},Md=Wt("HTMLFormElement"),Ad=n=>n.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,s,i){return s.toUpperCase()+i}),sh=(({hasOwnProperty:n})=>(t,e)=>n.call(t,e))(Object.prototype),Id=Wt("RegExp"),nh=(n,t)=>{const e=Object.getOwnPropertyDescriptors(n),s={};Rs(e,(i,r)=>{let o;(o=t(i,r,n))!==!1&&(s[r]=o||i)}),Object.defineProperties(n,s)},kd=n=>{nh(n,(t,e)=>{if(Rt(n)&&["arguments","caller","callee"].indexOf(e)!==-1)return!1;const s=n[e];if(Rt(s)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+e+"'")})}})},Dd=(n,t)=>{const e={},s=i=>{i.forEach(r=>{e[r]=!0})};return cs(n)?s(n):s(String(n).split(t)),e},Ld=()=>{},Rd=(n,t)=>n!=null&&Number.isFinite(n=+n)?n:t;function Od(n){return!!(n&&Rt(n.append)&&n[Symbol.toStringTag]==="FormData"&&n[Symbol.iterator])}const zd=n=>{const t=new Array(10),e=(s,i)=>{if(Pn(s)){if(t.indexOf(s)>=0)return;if(!("toJSON"in s)){t[i]=s;const r=cs(s)?[]:{};return Rs(s,(o,a)=>{const h=e(o,i+1);!Ls(h)&&(r[a]=h)}),t[i]=void 0,r}}return s};return e(n,0)},Bd=Wt("AsyncFunction"),Nd=n=>n&&(Pn(n)||Rt(n))&&Rt(n.then)&&Rt(n.catch),ih=((n,t)=>n?setImmediate:t?((e,s)=>(Xe.addEventListener("message",({source:i,data:r})=>{i===Xe&&r===e&&s.length&&s.shift()()},!1),i=>{s.push(i),Xe.postMessage(e,"*")}))(`axios@${Math.random()}`,[]):e=>setTimeout(e))(typeof setImmediate=="function",Rt(Xe.postMessage)),Fd=typeof queueMicrotask<"u"?queueMicrotask.bind(Xe):typeof process<"u"&&process.nextTick||ih,A={isArray:cs,isArrayBuffer:Qa,isBuffer:nd,isFormData:fd,isArrayBufferView:id,isString:rd,isNumber:Ka,isBoolean:od,isObject:Pn,isPlainObject:En,isReadableStream:md,isRequest:pd,isResponse:gd,isHeaders:yd,isUndefined:Ls,isDate:ad,isFile:hd,isBlob:cd,isRegExp:Id,isFunction:Rt,isStream:ud,isURLSearchParams:dd,isTypedArray:Td,isFileList:ld,forEach:Rs,merge:Ji,extend:xd,trim:wd,stripBOM:bd,inherits:vd,toFlatObject:Sd,kindOf:Cn,kindOfTest:Wt,endsWith:_d,toArray:Cd,forEachEntry:Pd,matchAll:Ed,isHTMLForm:Md,hasOwnProperty:sh,hasOwnProp:sh,reduceDescriptors:nh,freezeMethods:kd,toObjectSet:Dd,toCamelCase:Ad,noop:Ld,toFiniteNumber:Rd,findKey:th,global:Xe,isContextDefined:eh,isSpecCompliantForm:Od,toJSONObject:zd,isAsyncFn:Bd,isThenable:Nd,setImmediate:ih,asap:Fd};function X(n,t,e,s,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=n,this.name="AxiosError",t&&(this.code=t),e&&(this.config=e),s&&(this.request=s),i&&(this.response=i,this.status=i.status?i.status:null)}A.inherits(X,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:A.toJSONObject(this.config),code:this.code,status:this.status}}});const rh=X.prototype,oh={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(n=>{oh[n]={value:n}}),Object.defineProperties(X,oh),Object.defineProperty(rh,"isAxiosError",{value:!0}),X.from=(n,t,e,s,i,r)=>{const o=Object.create(rh);return A.toFlatObject(n,o,function(h){return h!==Error.prototype},a=>a!=="isAxiosError"),X.call(o,n.message,t,e,s,i),o.cause=n,o.name=n.name,r&&Object.assign(o,r),o};const Yd=null;function Zi(n){return A.isPlainObject(n)||A.isArray(n)}function ah(n){return A.endsWith(n,"[]")?n.slice(0,-2):n}function hh(n,t,e){return n?n.concat(t).map(function(i,r){return i=ah(i),!e&&r?"["+i+"]":i}).join(e?".":""):t}function Xd(n){return A.isArray(n)&&!n.some(Zi)}const Ud=A.toFlatObject(A,{},null,function(t){return/^is[A-Z]/.test(t)});function Mn(n,t,e){if(!A.isObject(n))throw new TypeError("target must be an object");t=t||new FormData,e=A.toFlatObject(e,{metaTokens:!0,dots:!1,indexes:!1},!1,function(y,S){return!A.isUndefined(S[y])});const s=e.metaTokens,i=e.visitor||l,r=e.dots,o=e.indexes,h=(e.Blob||typeof Blob<"u"&&Blob)&&A.isSpecCompliantForm(t);if(!A.isFunction(i))throw new TypeError("visitor must be a function");function c(p){if(p===null)return"";if(A.isDate(p))return p.toISOString();if(!h&&A.isBlob(p))throw new X("Blob is not supported. Use a Buffer instead.");return A.isArrayBuffer(p)||A.isTypedArray(p)?h&&typeof Blob=="function"?new Blob([p]):Buffer.from(p):p}function l(p,y,S){let w=p;if(p&&!S&&typeof p=="object"){if(A.endsWith(y,"{}"))y=s?y:y.slice(0,-2),p=JSON.stringify(p);else if(A.isArray(p)&&Xd(p)||(A.isFileList(p)||A.endsWith(y,"[]"))&&(w=A.toArray(p)))return y=ah(y),w.forEach(function(x,b){!(A.isUndefined(x)||x===null)&&t.append(o===!0?hh([y],b,r):o===null?y:y+"[]",c(x))}),!1}return Zi(p)?!0:(t.append(hh(S,y,r),c(p)),!1)}const u=[],m=Object.assign(Ud,{defaultVisitor:l,convertValue:c,isVisitable:Zi});function f(p,y){if(!A.isUndefined(p)){if(u.indexOf(p)!==-1)throw Error("Circular reference detected in "+y.join("."));u.push(p),A.forEach(p,function(w,v){(!(A.isUndefined(w)||w===null)&&i.call(t,w,A.isString(v)?v.trim():v,y,m))===!0&&f(w,y?y.concat(v):[v])}),u.pop()}}if(!A.isObject(n))throw new TypeError("data must be an object");return f(n),t}function ch(n){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(n).replace(/[!'()~]|%20|%00/g,function(s){return t[s]})}function Qi(n,t){this._pairs=[],n&&Mn(n,this,t)}const lh=Qi.prototype;lh.append=function(t,e){this._pairs.push([t,e])},lh.toString=function(t){const e=t?function(s){return t.call(this,s,ch)}:ch;return this._pairs.map(function(i){return e(i[0])+"="+e(i[1])},"").join("&")};function $d(n){return encodeURIComponent(n).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function uh(n,t,e){if(!t)return n;const s=e&&e.encode||$d;A.isFunction(e)&&(e={serialize:e});const i=e&&e.serialize;let r;if(i?r=i(t,e):r=A.isURLSearchParams(t)?t.toString():new Qi(t,e).toString(s),r){const o=n.indexOf("#");o!==-1&&(n=n.slice(0,o)),n+=(n.indexOf("?")===-1?"?":"&")+r}return n}class Vd{constructor(){this.handlers=[]}use(t,e,s){return this.handlers.push({fulfilled:t,rejected:e,synchronous:s?s.synchronous:!1,runWhen:s?s.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){A.forEach(this.handlers,function(s){s!==null&&t(s)})}}const fh=Vd,dh={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Gd={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:Qi,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},Ki=typeof window<"u"&&typeof document<"u",tr=typeof navigator=="object"&&navigator||void 0,qd=Ki&&(!tr||["ReactNative","NativeScript","NS"].indexOf(tr.product)<0),jd=(()=>typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function")(),Hd=Ki&&window.location.href||"http://localhost",St={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Ki,hasStandardBrowserEnv:qd,hasStandardBrowserWebWorkerEnv:jd,navigator:tr,origin:Hd},Symbol.toStringTag,{value:"Module"})),...Gd};function Wd(n,t){return Mn(n,new St.classes.URLSearchParams,Object.assign({visitor:function(e,s,i,r){return St.isNode&&A.isBuffer(e)?(this.append(s,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)}},t))}function Jd(n){return A.matchAll(/\w+|\[(\w*)]/g,n).map(t=>t[0]==="[]"?"":t[1]||t[0])}function Zd(n){const t={},e=Object.keys(n);let s;const i=e.length;let r;for(s=0;s<i;s++)r=e[s],t[r]=n[r];return t}function mh(n){function t(e,s,i,r){let o=e[r++];if(o==="__proto__")return!0;const a=Number.isFinite(+o),h=r>=e.length;return o=!o&&A.isArray(i)?i.length:o,h?(A.hasOwnProp(i,o)?i[o]=[i[o],s]:i[o]=s,!a):((!i[o]||!A.isObject(i[o]))&&(i[o]=[]),t(e,s,i[o],r)&&A.isArray(i[o])&&(i[o]=Zd(i[o])),!a)}if(A.isFormData(n)&&A.isFunction(n.entries)){const e={};return A.forEachEntry(n,(s,i)=>{t(Jd(s),i,e,0)}),e}return null}function Qd(n,t,e){if(A.isString(n))try{return(t||JSON.parse)(n),A.trim(n)}catch(s){if(s.name!=="SyntaxError")throw s}return(e||JSON.stringify)(n)}const er={transitional:dh,adapter:["xhr","http","fetch"],transformRequest:[function(t,e){const s=e.getContentType()||"",i=s.indexOf("application/json")>-1,r=A.isObject(t);if(r&&A.isHTMLForm(t)&&(t=new FormData(t)),A.isFormData(t))return i?JSON.stringify(mh(t)):t;if(A.isArrayBuffer(t)||A.isBuffer(t)||A.isStream(t)||A.isFile(t)||A.isBlob(t)||A.isReadableStream(t))return t;if(A.isArrayBufferView(t))return t.buffer;if(A.isURLSearchParams(t))return e.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let a;if(r){if(s.indexOf("application/x-www-form-urlencoded")>-1)return Wd(t,this.formSerializer).toString();if((a=A.isFileList(t))||s.indexOf("multipart/form-data")>-1){const h=this.env&&this.env.FormData;return Mn(a?{"files[]":t}:t,h&&new h,this.formSerializer)}}return r||i?(e.setContentType("application/json",!1),Qd(t)):t}],transformResponse:[function(t){const e=this.transitional||er.transitional,s=e&&e.forcedJSONParsing,i=this.responseType==="json";if(A.isResponse(t)||A.isReadableStream(t))return t;if(t&&A.isString(t)&&(s&&!this.responseType||i)){const o=!(e&&e.silentJSONParsing)&&i;try{return JSON.parse(t)}catch(a){if(o)throw a.name==="SyntaxError"?X.from(a,X.ERR_BAD_RESPONSE,this,null,this.response):a}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:St.classes.FormData,Blob:St.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};A.forEach(["delete","get","head","post","put","patch"],n=>{er.headers[n]={}});const sr=er,Kd=A.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),tm=n=>{const t={};let e,s,i;return n&&n.split(`
14
+ `).forEach(function(o){i=o.indexOf(":"),e=o.substring(0,i).trim().toLowerCase(),s=o.substring(i+1).trim(),!(!e||t[e]&&Kd[e])&&(e==="set-cookie"?t[e]?t[e].push(s):t[e]=[s]:t[e]=t[e]?t[e]+", "+s:s)}),t},ph=Symbol("internals");function Os(n){return n&&String(n).trim().toLowerCase()}function An(n){return n===!1||n==null?n:A.isArray(n)?n.map(An):String(n)}function em(n){const t=Object.create(null),e=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let s;for(;s=e.exec(n);)t[s[1]]=s[2];return t}const sm=n=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(n.trim());function nr(n,t,e,s,i){if(A.isFunction(s))return s.call(this,t,e);if(i&&(t=e),!!A.isString(t)){if(A.isString(s))return t.indexOf(s)!==-1;if(A.isRegExp(s))return s.test(t)}}function nm(n){return n.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,e,s)=>e.toUpperCase()+s)}function im(n,t){const e=A.toCamelCase(" "+t);["get","set","has"].forEach(s=>{Object.defineProperty(n,s+e,{value:function(i,r,o){return this[s].call(this,t,i,r,o)},configurable:!0})})}class In{constructor(t){t&&this.set(t)}set(t,e,s){const i=this;function r(a,h,c){const l=Os(h);if(!l)throw new Error("header name must be a non-empty string");const u=A.findKey(i,l);(!u||i[u]===void 0||c===!0||c===void 0&&i[u]!==!1)&&(i[u||h]=An(a))}const o=(a,h)=>A.forEach(a,(c,l)=>r(c,l,h));if(A.isPlainObject(t)||t instanceof this.constructor)o(t,e);else if(A.isString(t)&&(t=t.trim())&&!sm(t))o(tm(t),e);else if(A.isHeaders(t))for(const[a,h]of t.entries())r(h,a,s);else t!=null&&r(e,t,s);return this}get(t,e){if(t=Os(t),t){const s=A.findKey(this,t);if(s){const i=this[s];if(!e)return i;if(e===!0)return em(i);if(A.isFunction(e))return e.call(this,i,s);if(A.isRegExp(e))return e.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,e){if(t=Os(t),t){const s=A.findKey(this,t);return!!(s&&this[s]!==void 0&&(!e||nr(this,this[s],s,e)))}return!1}delete(t,e){const s=this;let i=!1;function r(o){if(o=Os(o),o){const a=A.findKey(s,o);a&&(!e||nr(s,s[a],a,e))&&(delete s[a],i=!0)}}return A.isArray(t)?t.forEach(r):r(t),i}clear(t){const e=Object.keys(this);let s=e.length,i=!1;for(;s--;){const r=e[s];(!t||nr(this,this[r],r,t,!0))&&(delete this[r],i=!0)}return i}normalize(t){const e=this,s={};return A.forEach(this,(i,r)=>{const o=A.findKey(s,r);if(o){e[o]=An(i),delete e[r];return}const a=t?nm(r):String(r).trim();a!==r&&delete e[r],e[a]=An(i),s[a]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const e=Object.create(null);return A.forEach(this,(s,i)=>{s!=null&&s!==!1&&(e[i]=t&&A.isArray(s)?s.join(", "):s)}),e}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,e])=>t+": "+e).join(`
15
+ `)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...e){const s=new this(t);return e.forEach(i=>s.set(i)),s}static accessor(t){const s=(this[ph]=this[ph]={accessors:{}}).accessors,i=this.prototype;function r(o){const a=Os(o);s[a]||(im(i,o),s[a]=!0)}return A.isArray(t)?t.forEach(r):r(t),this}}In.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),A.reduceDescriptors(In.prototype,({value:n},t)=>{let e=t[0].toUpperCase()+t.slice(1);return{get:()=>n,set(s){this[e]=s}}}),A.freezeMethods(In);const Jt=In;function ir(n,t){const e=this||sr,s=t||e,i=Jt.from(s.headers);let r=s.data;return A.forEach(n,function(a){r=a.call(e,r,i.normalize(),t?t.status:void 0)}),i.normalize(),r}function gh(n){return!!(n&&n.__CANCEL__)}function ls(n,t,e){X.call(this,n??"canceled",X.ERR_CANCELED,t,e),this.name="CanceledError"}A.inherits(ls,X,{__CANCEL__:!0});function yh(n,t,e){const s=e.config.validateStatus;!e.status||!s||s(e.status)?n(e):t(new X("Request failed with status code "+e.status,[X.ERR_BAD_REQUEST,X.ERR_BAD_RESPONSE][Math.floor(e.status/100)-4],e.config,e.request,e))}function rm(n){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(n);return t&&t[1]||""}function om(n,t){n=n||10;const e=new Array(n),s=new Array(n);let i=0,r=0,o;return t=t!==void 0?t:1e3,function(h){const c=Date.now(),l=s[r];o||(o=c),e[i]=h,s[i]=c;let u=r,m=0;for(;u!==i;)m+=e[u++],u=u%n;if(i=(i+1)%n,i===r&&(r=(r+1)%n),c-o<t)return;const f=l&&c-l;return f?Math.round(m*1e3/f):void 0}}function am(n,t){let e=0,s=1e3/t,i,r;const o=(c,l=Date.now())=>{e=l,i=null,r&&(clearTimeout(r),r=null),n.apply(null,c)};return[(...c)=>{const l=Date.now(),u=l-e;u>=s?o(c,l):(i=c,r||(r=setTimeout(()=>{r=null,o(i)},s-u)))},()=>i&&o(i)]}const kn=(n,t,e=3)=>{let s=0;const i=om(50,250);return am(r=>{const o=r.loaded,a=r.lengthComputable?r.total:void 0,h=o-s,c=i(h),l=o<=a;s=o;const u={loaded:o,total:a,progress:a?o/a:void 0,bytes:h,rate:c||void 0,estimated:c&&a&&l?(a-o)/c:void 0,event:r,lengthComputable:a!=null,[t?"download":"upload"]:!0};n(u)},e)},wh=(n,t)=>{const e=n!=null;return[s=>t[0]({lengthComputable:e,total:n,loaded:s}),t[1]]},xh=n=>(...t)=>A.asap(()=>n(...t)),hm=St.hasStandardBrowserEnv?((n,t)=>e=>(e=new URL(e,St.origin),n.protocol===e.protocol&&n.host===e.host&&(t||n.port===e.port)))(new URL(St.origin),St.navigator&&/(msie|trident)/i.test(St.navigator.userAgent)):()=>!0,cm=St.hasStandardBrowserEnv?{write(n,t,e,s,i,r){const o=[n+"="+encodeURIComponent(t)];A.isNumber(e)&&o.push("expires="+new Date(e).toGMTString()),A.isString(s)&&o.push("path="+s),A.isString(i)&&o.push("domain="+i),r===!0&&o.push("secure"),document.cookie=o.join("; ")},read(n){const t=document.cookie.match(new RegExp("(^|;\\s*)("+n+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(n){this.write(n,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function lm(n){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(n)}function um(n,t){return t?n.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):n}function bh(n,t,e){let s=!lm(t);return n&&(s||e==!1)?um(n,t):t}const vh=n=>n instanceof Jt?{...n}:n;function Ue(n,t){t=t||{};const e={};function s(c,l,u,m){return A.isPlainObject(c)&&A.isPlainObject(l)?A.merge.call({caseless:m},c,l):A.isPlainObject(l)?A.merge({},l):A.isArray(l)?l.slice():l}function i(c,l,u,m){if(A.isUndefined(l)){if(!A.isUndefined(c))return s(void 0,c,u,m)}else return s(c,l,u,m)}function r(c,l){if(!A.isUndefined(l))return s(void 0,l)}function o(c,l){if(A.isUndefined(l)){if(!A.isUndefined(c))return s(void 0,c)}else return s(void 0,l)}function a(c,l,u){if(u in t)return s(c,l);if(u in n)return s(void 0,c)}const h={url:r,method:r,data:r,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:a,headers:(c,l,u)=>i(vh(c),vh(l),u,!0)};return A.forEach(Object.keys(Object.assign({},n,t)),function(l){const u=h[l]||i,m=u(n[l],t[l],l);A.isUndefined(m)&&u!==a||(e[l]=m)}),e}const Sh=n=>{const t=Ue({},n);let{data:e,withXSRFToken:s,xsrfHeaderName:i,xsrfCookieName:r,headers:o,auth:a}=t;t.headers=o=Jt.from(o),t.url=uh(bh(t.baseURL,t.url,t.allowAbsoluteUrls),n.params,n.paramsSerializer),a&&o.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):"")));let h;if(A.isFormData(e)){if(St.hasStandardBrowserEnv||St.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if((h=o.getContentType())!==!1){const[c,...l]=h?h.split(";").map(u=>u.trim()).filter(Boolean):[];o.setContentType([c||"multipart/form-data",...l].join("; "))}}if(St.hasStandardBrowserEnv&&(s&&A.isFunction(s)&&(s=s(t)),s||s!==!1&&hm(t.url))){const c=i&&r&&cm.read(r);c&&o.set(i,c)}return t},fm=typeof XMLHttpRequest<"u"&&function(n){return new Promise(function(e,s){const i=Sh(n);let r=i.data;const o=Jt.from(i.headers).normalize();let{responseType:a,onUploadProgress:h,onDownloadProgress:c}=i,l,u,m,f,p;function y(){f&&f(),p&&p(),i.cancelToken&&i.cancelToken.unsubscribe(l),i.signal&&i.signal.removeEventListener("abort",l)}let S=new XMLHttpRequest;S.open(i.method.toUpperCase(),i.url,!0),S.timeout=i.timeout;function w(){if(!S)return;const x=Jt.from("getAllResponseHeaders"in S&&S.getAllResponseHeaders()),P={data:!a||a==="text"||a==="json"?S.responseText:S.response,status:S.status,statusText:S.statusText,headers:x,config:n,request:S};yh(function(D){e(D),y()},function(D){s(D),y()},P),S=null}"onloadend"in S?S.onloadend=w:S.onreadystatechange=function(){!S||S.readyState!==4||S.status===0&&!(S.responseURL&&S.responseURL.indexOf("file:")===0)||setTimeout(w)},S.onabort=function(){S&&(s(new X("Request aborted",X.ECONNABORTED,n,S)),S=null)},S.onerror=function(){s(new X("Network Error",X.ERR_NETWORK,n,S)),S=null},S.ontimeout=function(){let b=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded";const P=i.transitional||dh;i.timeoutErrorMessage&&(b=i.timeoutErrorMessage),s(new X(b,P.clarifyTimeoutError?X.ETIMEDOUT:X.ECONNABORTED,n,S)),S=null},r===void 0&&o.setContentType(null),"setRequestHeader"in S&&A.forEach(o.toJSON(),function(b,P){S.setRequestHeader(P,b)}),A.isUndefined(i.withCredentials)||(S.withCredentials=!!i.withCredentials),a&&a!=="json"&&(S.responseType=i.responseType),c&&([m,p]=kn(c,!0),S.addEventListener("progress",m)),h&&S.upload&&([u,f]=kn(h),S.upload.addEventListener("progress",u),S.upload.addEventListener("loadend",f)),(i.cancelToken||i.signal)&&(l=x=>{S&&(s(!x||x.type?new ls(null,n,S):x),S.abort(),S=null)},i.cancelToken&&i.cancelToken.subscribe(l),i.signal&&(i.signal.aborted?l():i.signal.addEventListener("abort",l)));const v=rm(i.url);if(v&&St.protocols.indexOf(v)===-1){s(new X("Unsupported protocol "+v+":",X.ERR_BAD_REQUEST,n));return}S.send(r||null)})},dm=(n,t)=>{const{length:e}=n=n?n.filter(Boolean):[];if(t||e){let s=new AbortController,i;const r=function(c){if(!i){i=!0,a();const l=c instanceof Error?c:this.reason;s.abort(l instanceof X?l:new ls(l instanceof Error?l.message:l))}};let o=t&&setTimeout(()=>{o=null,r(new X(`timeout ${t} of ms exceeded`,X.ETIMEDOUT))},t);const a=()=>{n&&(o&&clearTimeout(o),o=null,n.forEach(c=>{c.unsubscribe?c.unsubscribe(r):c.removeEventListener("abort",r)}),n=null)};n.forEach(c=>c.addEventListener("abort",r));const{signal:h}=s;return h.unsubscribe=()=>A.asap(a),h}},mm=function*(n,t){let e=n.byteLength;if(!t||e<t){yield n;return}let s=0,i;for(;s<e;)i=s+t,yield n.slice(s,i),s=i},pm=async function*(n,t){for await(const e of gm(n))yield*mm(e,t)},gm=async function*(n){if(n[Symbol.asyncIterator]){yield*n;return}const t=n.getReader();try{for(;;){const{done:e,value:s}=await t.read();if(e)break;yield s}}finally{await t.cancel()}},_h=(n,t,e,s)=>{const i=pm(n,t);let r=0,o,a=h=>{o||(o=!0,s&&s(h))};return new ReadableStream({async pull(h){try{const{done:c,value:l}=await i.next();if(c){a(),h.close();return}let u=l.byteLength;if(e){let m=r+=u;e(m)}h.enqueue(new Uint8Array(l))}catch(c){throw a(c),c}},cancel(h){return a(h),i.return()}},{highWaterMark:2})},Dn=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",Ch=Dn&&typeof ReadableStream=="function",ym=Dn&&(typeof TextEncoder=="function"?(n=>t=>n.encode(t))(new TextEncoder):async n=>new Uint8Array(await new Response(n).arrayBuffer())),Th=(n,...t)=>{try{return!!n(...t)}catch{return!1}},wm=Ch&&Th(()=>{let n=!1;const t=new Request(St.origin,{body:new ReadableStream,method:"POST",get duplex(){return n=!0,"half"}}).headers.has("Content-Type");return n&&!t}),Ph=64*1024,rr=Ch&&Th(()=>A.isReadableStream(new Response("").body)),Ln={stream:rr&&(n=>n.body)};Dn&&(n=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!Ln[t]&&(Ln[t]=A.isFunction(n[t])?e=>e[t]():(e,s)=>{throw new X(`Response type '${t}' is not supported`,X.ERR_NOT_SUPPORT,s)})})})(new Response);const xm=async n=>{if(n==null)return 0;if(A.isBlob(n))return n.size;if(A.isSpecCompliantForm(n))return(await new Request(St.origin,{method:"POST",body:n}).arrayBuffer()).byteLength;if(A.isArrayBufferView(n)||A.isArrayBuffer(n))return n.byteLength;if(A.isURLSearchParams(n)&&(n=n+""),A.isString(n))return(await ym(n)).byteLength},bm=async(n,t)=>{const e=A.toFiniteNumber(n.getContentLength());return e??xm(t)},or={http:Yd,xhr:fm,fetch:Dn&&(async n=>{let{url:t,method:e,data:s,signal:i,cancelToken:r,timeout:o,onDownloadProgress:a,onUploadProgress:h,responseType:c,headers:l,withCredentials:u="same-origin",fetchOptions:m}=Sh(n);c=c?(c+"").toLowerCase():"text";let f=dm([i,r&&r.toAbortSignal()],o),p;const y=f&&f.unsubscribe&&(()=>{f.unsubscribe()});let S;try{if(h&&wm&&e!=="get"&&e!=="head"&&(S=await bm(l,s))!==0){let P=new Request(t,{method:"POST",body:s,duplex:"half"}),C;if(A.isFormData(s)&&(C=P.headers.get("content-type"))&&l.setContentType(C),P.body){const[D,B]=wh(S,kn(xh(h)));s=_h(P.body,Ph,D,B)}}A.isString(u)||(u=u?"include":"omit");const w="credentials"in Request.prototype;p=new Request(t,{...m,signal:f,method:e.toUpperCase(),headers:l.normalize().toJSON(),body:s,duplex:"half",credentials:w?u:void 0});let v=await fetch(p);const x=rr&&(c==="stream"||c==="response");if(rr&&(a||x&&y)){const P={};["status","statusText","headers"].forEach(Y=>{P[Y]=v[Y]});const C=A.toFiniteNumber(v.headers.get("content-length")),[D,B]=a&&wh(C,kn(xh(a),!0))||[];v=new Response(_h(v.body,Ph,D,()=>{B&&B(),y&&y()}),P)}c=c||"text";let b=await Ln[A.findKey(Ln,c)||"text"](v,n);return!x&&y&&y(),await new Promise((P,C)=>{yh(P,C,{data:b,headers:Jt.from(v.headers),status:v.status,statusText:v.statusText,config:n,request:p})})}catch(w){throw y&&y(),w&&w.name==="TypeError"&&/fetch/i.test(w.message)?Object.assign(new X("Network Error",X.ERR_NETWORK,n,p),{cause:w.cause||w}):X.from(w,w&&w.code,n,p)}})};A.forEach(or,(n,t)=>{if(n){try{Object.defineProperty(n,"name",{value:t})}catch{}Object.defineProperty(n,"adapterName",{value:t})}});const Eh=n=>`- ${n}`,vm=n=>A.isFunction(n)||n===null||n===!1,Mh={getAdapter:n=>{n=A.isArray(n)?n:[n];const{length:t}=n;let e,s;const i={};for(let r=0;r<t;r++){e=n[r];let o;if(s=e,!vm(e)&&(s=or[(o=String(e)).toLowerCase()],s===void 0))throw new X(`Unknown adapter '${o}'`);if(s)break;i[o||"#"+r]=s}if(!s){const r=Object.entries(i).map(([a,h])=>`adapter ${a} `+(h===!1?"is not supported by the environment":"is not available in the build"));let o=t?r.length>1?`since :
16
+ `+r.map(Eh).join(`
17
+ `):" "+Eh(r[0]):"as no adapter specified";throw new X("There is no suitable adapter to dispatch the request "+o,"ERR_NOT_SUPPORT")}return s},adapters:or};function ar(n){if(n.cancelToken&&n.cancelToken.throwIfRequested(),n.signal&&n.signal.aborted)throw new ls(null,n)}function Ah(n){return ar(n),n.headers=Jt.from(n.headers),n.data=ir.call(n,n.transformRequest),["post","put","patch"].indexOf(n.method)!==-1&&n.headers.setContentType("application/x-www-form-urlencoded",!1),Mh.getAdapter(n.adapter||sr.adapter)(n).then(function(s){return ar(n),s.data=ir.call(n,n.transformResponse,s),s.headers=Jt.from(s.headers),s},function(s){return gh(s)||(ar(n),s&&s.response&&(s.response.data=ir.call(n,n.transformResponse,s.response),s.response.headers=Jt.from(s.response.headers))),Promise.reject(s)})}const Ih="1.8.4",Rn={};["object","boolean","number","function","string","symbol"].forEach((n,t)=>{Rn[n]=function(s){return typeof s===n||"a"+(t<1?"n ":" ")+n}});const kh={};Rn.transitional=function(t,e,s){function i(r,o){return"[Axios v"+Ih+"] Transitional option '"+r+"'"+o+(s?". "+s:"")}return(r,o,a)=>{if(t===!1)throw new X(i(o," has been removed"+(e?" in "+e:"")),X.ERR_DEPRECATED);return e&&!kh[o]&&(kh[o]=!0,console.warn(i(o," has been deprecated since v"+e+" and will be removed in the near future"))),t?t(r,o,a):!0}},Rn.spelling=function(t){return(e,s)=>(console.warn(`${s} is likely a misspelling of ${t}`),!0)};function Sm(n,t,e){if(typeof n!="object")throw new X("options must be an object",X.ERR_BAD_OPTION_VALUE);const s=Object.keys(n);let i=s.length;for(;i-- >0;){const r=s[i],o=t[r];if(o){const a=n[r],h=a===void 0||o(a,r,n);if(h!==!0)throw new X("option "+r+" must be "+h,X.ERR_BAD_OPTION_VALUE);continue}if(e!==!0)throw new X("Unknown option "+r,X.ERR_BAD_OPTION)}}const On={assertOptions:Sm,validators:Rn},re=On.validators;class zn{constructor(t){this.defaults=t,this.interceptors={request:new fh,response:new fh}}async request(t,e){try{return await this._request(t,e)}catch(s){if(s instanceof Error){let i={};Error.captureStackTrace?Error.captureStackTrace(i):i=new Error;const r=i.stack?i.stack.replace(/^.+\n/,""):"";try{s.stack?r&&!String(s.stack).endsWith(r.replace(/^.+\n.+\n/,""))&&(s.stack+=`
18
+ `+r):s.stack=r}catch{}}throw s}}_request(t,e){typeof t=="string"?(e=e||{},e.url=t):e=t||{},e=Ue(this.defaults,e);const{transitional:s,paramsSerializer:i,headers:r}=e;s!==void 0&&On.assertOptions(s,{silentJSONParsing:re.transitional(re.boolean),forcedJSONParsing:re.transitional(re.boolean),clarifyTimeoutError:re.transitional(re.boolean)},!1),i!=null&&(A.isFunction(i)?e.paramsSerializer={serialize:i}:On.assertOptions(i,{encode:re.function,serialize:re.function},!0)),e.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?e.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:e.allowAbsoluteUrls=!0),On.assertOptions(e,{baseUrl:re.spelling("baseURL"),withXsrfToken:re.spelling("withXSRFToken")},!0),e.method=(e.method||this.defaults.method||"get").toLowerCase();let o=r&&A.merge(r.common,r[e.method]);r&&A.forEach(["delete","get","head","post","put","patch","common"],p=>{delete r[p]}),e.headers=Jt.concat(o,r);const a=[];let h=!0;this.interceptors.request.forEach(function(y){typeof y.runWhen=="function"&&y.runWhen(e)===!1||(h=h&&y.synchronous,a.unshift(y.fulfilled,y.rejected))});const c=[];this.interceptors.response.forEach(function(y){c.push(y.fulfilled,y.rejected)});let l,u=0,m;if(!h){const p=[Ah.bind(this),void 0];for(p.unshift.apply(p,a),p.push.apply(p,c),m=p.length,l=Promise.resolve(e);u<m;)l=l.then(p[u++],p[u++]);return l}m=a.length;let f=e;for(u=0;u<m;){const p=a[u++],y=a[u++];try{f=p(f)}catch(S){y.call(this,S);break}}try{l=Ah.call(this,f)}catch(p){return Promise.reject(p)}for(u=0,m=c.length;u<m;)l=l.then(c[u++],c[u++]);return l}getUri(t){t=Ue(this.defaults,t);const e=bh(t.baseURL,t.url,t.allowAbsoluteUrls);return uh(e,t.params,t.paramsSerializer)}}A.forEach(["delete","get","head","options"],function(t){zn.prototype[t]=function(e,s){return this.request(Ue(s||{},{method:t,url:e,data:(s||{}).data}))}}),A.forEach(["post","put","patch"],function(t){function e(s){return function(r,o,a){return this.request(Ue(a||{},{method:t,headers:s?{"Content-Type":"multipart/form-data"}:{},url:r,data:o}))}}zn.prototype[t]=e(),zn.prototype[t+"Form"]=e(!0)});const Bn=zn;class hr{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let e;this.promise=new Promise(function(r){e=r});const s=this;this.promise.then(i=>{if(!s._listeners)return;let r=s._listeners.length;for(;r-- >0;)s._listeners[r](i);s._listeners=null}),this.promise.then=i=>{let r;const o=new Promise(a=>{s.subscribe(a),r=a}).then(i);return o.cancel=function(){s.unsubscribe(r)},o},t(function(r,o,a){s.reason||(s.reason=new ls(r,o,a),e(s.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const e=this._listeners.indexOf(t);e!==-1&&this._listeners.splice(e,1)}toAbortSignal(){const t=new AbortController,e=s=>{t.abort(s)};return this.subscribe(e),t.signal.unsubscribe=()=>this.unsubscribe(e),t.signal}static source(){let t;return{token:new hr(function(i){t=i}),cancel:t}}}const _m=hr;function Cm(n){return function(e){return n.apply(null,e)}}function Tm(n){return A.isObject(n)&&n.isAxiosError===!0}const cr={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(cr).forEach(([n,t])=>{cr[t]=n});const Pm=cr;function Dh(n){const t=new Bn(n),e=Za(Bn.prototype.request,t);return A.extend(e,Bn.prototype,t,{allOwnKeys:!0}),A.extend(e,t,null,{allOwnKeys:!0}),e.create=function(i){return Dh(Ue(n,i))},e}const ht=Dh(sr);ht.Axios=Bn,ht.CanceledError=ls,ht.CancelToken=_m,ht.isCancel=gh,ht.VERSION=Ih,ht.toFormData=Mn,ht.AxiosError=X,ht.Cancel=ht.CanceledError,ht.all=function(t){return Promise.all(t)},ht.spread=Cm,ht.isAxiosError=Tm,ht.mergeConfig=Ue,ht.AxiosHeaders=Jt,ht.formToJSON=n=>mh(A.isHTMLForm(n)?new FormData(n):n),ht.getAdapter=Mh.getAdapter,ht.HttpStatusCode=Pm,ht.default=ht;const Em=ht;class lr{instance;canceler;retryCount=0;cacheTime=0;caches=new ks;constructor(t){this.instance=Em.create(t),this.canceler=new Mm,this.retryCount=t?.retry||0,this.cacheTime=t?.cache||0,this.instance.interceptors.request.use(e=>(t?.interceptor?.start?.(),this.canceler.pendingRequest(e),t?.interceptor?.request?.(e),e),e=>(t?.interceptor?.end?.(),this.canceler.cancelRequest(e.config),t?.interceptor?.requestError?.(e),e)),this.instance.interceptors.response.use(e=>(t?.interceptor?.end?.(),this.canceler.confirmRequest(e.config),t?.interceptor?.response?.(e),e.status==200?Promise.resolve(e):Promise.reject(e)),e=>(t?.interceptor?.end?.(),this.canceler.cancelRequest(e.config),t?.interceptor?.responseError?.(e),Promise.reject(e.response)))}request(t){let e=this.instance.request;const s=t.retry||this.retryCount;s&&(e=zi(e,s));const i=t.cache||this.cacheTime;return i&&(e=Bi(e,i,this.caches)),e(t)}cancel(t){this.canceler.cancelRequest(t)}get(t,e){return this.request({...e,method:"get",url:t})}delete(t,e){return this.request({...e,method:"delete",url:t})}head(t,e){return this.request({...e,method:"head",url:t})}options(t,e){return this.request({...e,method:"options",url:t})}post(t,e,s){return this.request({...s,method:"post",url:t,data:e})}postBlob(t,e,s){return s={...s,headers:{...s?.headers,"Content-Type":"multipart/form-data"}},this.request({...s,method:"post",url:t,data:e})}postForm(t,e,s){return this.instance.postForm(t,e,{...s})}put(t,e,s){return this.request({...s,method:"put",url:t,data:e})}patch(t,e,s){return this.request({...s,method:"patch",url:t,data:e})}getUri(t){return this.instance.getUri(t)}}class Mm{pendingRequestMap;constructor(){this.pendingRequestMap=new Map}getRequestId(t){const{method:e,url:s,params:i,data:r}=t;return Ai({method:e,url:s,params:i,data:r})}pendingRequest(t){const e=this.getRequestId(t);if(this.pendingRequestMap.has(e))t.signal=this.pendingRequestMap.get(e)?.signal;else{const s=new AbortController;t.signal=s.signal,this.pendingRequestMap.set(e,s)}}confirmRequest(t){if(this.pendingRequestMap.size===0)return;const e=this.getRequestId(t);this.pendingRequestMap.has(e)&&this.pendingRequestMap.delete(e)}cancelRequest(t){if(this.pendingRequestMap.size===0)return;const e=this.getRequestId(t);this.pendingRequestMap.has(e)&&(this.pendingRequestMap.get(e)?.abort(),this.pendingRequestMap.delete(e))}cancelAllRequest(){const t=this.pendingRequestMap.values();for(const e of t)e.abort();this.pendingRequestMap.clear()}}const ur=n=>new XMLSerializer().serializeToString(n),Am=(n,t="text/html")=>new DOMParser().parseFromString(n,t),fr=(n,t=Tt.SVG,e=pn.utf8)=>Oi(ur(n),t,e);async function dr(n=["*"],t){let e=[];const s=document.createElement("input");return s.setAttribute("type","file"),s.setAttribute("visibility","hidden"),s.setAttribute("accept",n.join(",")),t&&s.setAttribute("multiple","true"),s.addEventListener("click",i=>{s.value=""},!1),new Promise((i,r)=>{s.addEventListener("change",o=>{e=Array.from(o.target.files||[]),e.length===0?r(new Error("Cancel")):i(e)},!1),window.addEventListener("focus",()=>{setTimeout(()=>{e.length===0&&r(new Error("Cancel"))},1e3)},{once:!0}),s.click()}).then(i=>(s.remove(),i)).catch(i=>{throw s.remove(),i})}function zs(n,t=Ut.text,e){return new Promise((s,i)=>{const r=new FileReader;switch(r.addEventListener("progress",o=>{e?.(o.loaded,o.total)}),r.addEventListener("load",o=>{s(o.target?.result)}),r.addEventListener("error",o=>{i(o)}),t){case Ut.dataURL:r.readAsDataURL(n);break;case Ut.binaryString:r.readAsBinaryString(n);break;case Ut.arraybuffer:r.readAsArrayBuffer(n);break;case Ut.text:default:r.readAsText(n)}})}async function Im(n){const t=await zs(n,Ut.arraybuffer);return Sf(t)}const km=n=>{let t;return n instanceof File?t=n.name:t=n,t.match(/\.([0-9a-z]+)(?:[\\?#]|$)/i)?.[1]||""};function Dm(n){switch(n.toLowerCase()){case"jpg":case"jpeg":return Tt.JPEG;case"gif":return Tt.GIF;case"svg":return Tt.SVG;case"pdf":return Tt.PDF;case"png":default:return Tt.PNG}}function Lh(n,t,e,s,i,r,o){const a=new FileReader;a.addEventListener("load",h=>{if(!h.target||!h.target.result)return t(h);if(e.append(h.target.result),o<s.size)Lh(n,t,e,s,i,o,Math.min(o+i,s.size));else return n(e.end())}),a.addEventListener("error",h=>t(h)),a.readAsArrayBuffer(s.slice(r,o))}async function Rh(n,t=1048576){return await new Promise((e,s)=>Lh(e,s,new ed.ArrayBuffer,n,t,0,Math.min(t,n.size)))}class Lm{axios;checkURL;uploadURL;file;fileHash;chunkSize;chunks;currentChunk=0;isUploading=!1;begin=0;end=0;timer;time=[0,0,0,0,0,0];onExist;onStart;onProgress;onComplete;onTime;constructor(t){this.axios=new lr({baseURL:t.baseURL,interceptor:{response:e=>{e.config.url==this.uploadURL&&e.status==200&&(this.onProgress?.(this.currentChunk++,this.chunks),this.end==this.file.size?(this.isUploading=!1,this.stopTimeCount(),this.onComplete?.()):this.isUploading&&this.uploadChunk())}}}),this.checkURL=t.checkURL,this.uploadURL=t.uploadURL,this.file=t.file,this.chunkSize=t.chunkSize||1048576,this.chunks=Math.ceil(this.file.size/this.chunkSize),this.onExist=t.onExist,this.onStart=t.onStart,this.onProgress=t.onProgress,this.onComplete=t.onComplete,this.onTime=t.onTime}async start(){this.fileHash||(this.fileHash=await Rh(this.file,this.chunkSize)),(await this.axios.post(this.checkURL,{fileName:this.file.name,fileHash:this.fileHash})).data.isExist?(this.isUploading=!1,this.onExist?.()):this.isUploading||(this.onStart?.(),this.startTimeCount(),await this.uploadChunk())}pause(){this.isUploading&&(this.isUploading=!1,this.stopTimeCount())}async uploadChunk(){this.isUploading=!0,this.begin=this.currentChunk*this.chunkSize,this.end=Math.min(this.begin+this.chunkSize,this.file.size);const t=this.file.slice(this.begin,this.end),e=new FormData;e.append("fileData",t),e.append("fileName",this.file.name),e.append("fileHash",this.fileHash),e.append("chunkIndex",String(this.currentChunk)),e.append("chunks",String(this.chunks)),await this.axios.postBlob(this.uploadURL,e)}startTimeCount(){this.stopTimeCount(),this.timer=setInterval(()=>{xf(this.time,1),this.onTime?.(gf(this.time))},1e3)}stopTimeCount(){this.timer&&(clearInterval(this.timer),this.timer=void 0)}}var Oh={exports:{}};/*! Hammer.JS - v2.0.7 - 2016-04-22
18
19
  * http://hammerjs.github.io/
19
20
  *
20
21
  * Copyright (c) 2016 Jorik Tangelder;
21
- * Licensed under the MIT license */(function(s){(function(t,e,n,i){var r=["","webkit","Moz","MS","ms","o"],o=e.createElement("div"),a="function",h=Math.round,c=Math.abs,u=Date.now;function l(g,S,P){return setTimeout(x(g,P),S)}function m(g,S,P){return Array.isArray(g)?(f(g,P[S],P),!0):!1}function f(g,S,P){var M;if(g)if(g.forEach)g.forEach(S,P);else if(g.length!==i)for(M=0;M<g.length;)S.call(P,g[M],M,g),M++;else for(M in g)g.hasOwnProperty(M)&&S.call(P,g[M],M,g)}function p(g,S,P){var M="DEPRECATED METHOD: "+S+`
22
- `+P+` AT
23
- `;return function(){var I=new Error("get-stack-trace"),z=I&&I.stack?I.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",V=t.console&&(t.console.warn||t.console.log);return V&&V.call(t.console,M,z),g.apply(this,arguments)}}var y;typeof Object.assign!="function"?y=function(S){if(S===i||S===null)throw new TypeError("Cannot convert undefined or null to object");for(var P=Object(S),M=1;M<arguments.length;M++){var I=arguments[M];if(I!==i&&I!==null)for(var z in I)I.hasOwnProperty(z)&&(P[z]=I[z])}return P}:y=Object.assign;var v=p(function(S,P,M){for(var I=Object.keys(P),z=0;z<I.length;)(!M||M&&S[I[z]]===i)&&(S[I[z]]=P[I[z]]),z++;return S},"extend","Use `assign`."),w=p(function(S,P){return v(S,P,!0)},"merge","Use `assign`.");function _(g,S,P){var M=S.prototype,I;I=g.prototype=Object.create(M),I.constructor=g,I._super=M,P&&y(I,P)}function x(g,S){return function(){return g.apply(S,arguments)}}function b(g,S){return typeof g==a?g.apply(S&&S[0]||i,S):g}function E(g,S){return g===i?S:g}function C(g,S,P){f(U(S),function(M){g.addEventListener(M,P,!1)})}function L(g,S,P){f(U(S),function(M){g.removeEventListener(M,P,!1)})}function B(g,S){for(;g;){if(g==S)return!0;g=g.parentNode}return!1}function F(g,S){return g.indexOf(S)>-1}function U(g){return g.trim().split(/\s+/g)}function G(g,S,P){if(g.indexOf&&!P)return g.indexOf(S);for(var M=0;M<g.length;){if(P&&g[M][P]==S||!P&&g[M]===S)return M;M++}return-1}function J(g){return Array.prototype.slice.call(g,0)}function st(g,S,P){for(var M=[],I=[],z=0;z<g.length;){var V=S?g[z][S]:g[z];G(I,V)<0&&M.push(g[z]),I[z]=V,z++}return P&&(S?M=M.sort(function(yt,kt){return yt[S]>kt[S]}):M=M.sort()),M}function K(g,S){for(var P,M,I=S[0].toUpperCase()+S.slice(1),z=0;z<r.length;){if(P=r[z],M=P?P+I:S,M in g)return M;z++}return i}var Kt=1;function Yt(){return Kt++}function Ut(g){var S=g.ownerDocument||g;return S.defaultView||S.parentWindow||t}var te=/mobile|tablet|ip(ad|hone|od)|android/i,R="ontouchstart"in t,D=K(t,"PointerEvent")!==i,$=R&&te.test(navigator.userAgent),H="touch",At="pen",ee="mouse",oi="kinect",ai=25,mt=1,ae=2,it=4,Ct=8,_n=1,en=2,nn=4,Oe=8,k=16,at=en|nn,sn=Oe|k,hl=at|sn,cl=["x","y"],hi=["clientX","clientY"];function Vt(g,S){var P=this;this.manager=g,this.callback=S,this.element=g.element,this.target=g.options.inputTarget,this.domHandler=function(M){b(g.options.enable,[g])&&P.handler(M)},this.init()}Vt.prototype={handler:function(){},init:function(){this.evEl&&C(this.element,this.evEl,this.domHandler),this.evTarget&&C(this.target,this.evTarget,this.domHandler),this.evWin&&C(Ut(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&L(this.element,this.evEl,this.domHandler),this.evTarget&&L(this.target,this.evTarget,this.domHandler),this.evWin&&L(Ut(this.element),this.evWin,this.domHandler)}};function M2(g){var S,P=g.options.inputClass;return P?S=P:D?S=Ko:$?S=li:R?S=ta:S=ui,new S(g,A2)}function A2(g,S,P){var M=P.pointers.length,I=P.changedPointers.length,z=S&mt&&M-I===0,V=S&(it|Ct)&&M-I===0;P.isFirst=!!z,P.isFinal=!!V,z&&(g.session={}),P.eventType=S,k2(g,P),g.emit("hammer.input",P),g.recognize(P),g.session.prevInput=P}function k2(g,S){var P=g.session,M=S.pointers,I=M.length;P.firstInput||(P.firstInput=ul(S)),I>1&&!P.firstMultiple?P.firstMultiple=ul(S):I===1&&(P.firstMultiple=!1);var z=P.firstInput,V=P.firstMultiple,pt=V?V.center:z.center,yt=S.center=ll(M);S.timeStamp=u(),S.deltaTime=S.timeStamp-z.timeStamp,S.angle=Qo(pt,yt),S.distance=ci(pt,yt),I2(P,S),S.offsetDirection=dl(S.deltaX,S.deltaY);var kt=fl(S.deltaTime,S.deltaX,S.deltaY);S.overallVelocityX=kt.x,S.overallVelocityY=kt.y,S.overallVelocity=c(kt.x)>c(kt.y)?kt.x:kt.y,S.scale=V?R2(V.pointers,M):1,S.rotation=V?L2(V.pointers,M):0,S.maxPointers=P.prevInput?S.pointers.length>P.prevInput.maxPointers?S.pointers.length:P.prevInput.maxPointers:S.pointers.length,D2(P,S);var ce=g.element;B(S.srcEvent.target,ce)&&(ce=S.srcEvent.target),S.target=ce}function I2(g,S){var P=S.center,M=g.offsetDelta||{},I=g.prevDelta||{},z=g.prevInput||{};(S.eventType===mt||z.eventType===it)&&(I=g.prevDelta={x:z.deltaX||0,y:z.deltaY||0},M=g.offsetDelta={x:P.x,y:P.y}),S.deltaX=I.x+(P.x-M.x),S.deltaY=I.y+(P.y-M.y)}function D2(g,S){var P=g.lastInterval||S,M=S.timeStamp-P.timeStamp,I,z,V,pt;if(S.eventType!=Ct&&(M>ai||P.velocity===i)){var yt=S.deltaX-P.deltaX,kt=S.deltaY-P.deltaY,ce=fl(M,yt,kt);z=ce.x,V=ce.y,I=c(ce.x)>c(ce.y)?ce.x:ce.y,pt=dl(yt,kt),g.lastInterval=S}else I=P.velocity,z=P.velocityX,V=P.velocityY,pt=P.direction;S.velocity=I,S.velocityX=z,S.velocityY=V,S.direction=pt}function ul(g){for(var S=[],P=0;P<g.pointers.length;)S[P]={clientX:h(g.pointers[P].clientX),clientY:h(g.pointers[P].clientY)},P++;return{timeStamp:u(),pointers:S,center:ll(S),deltaX:g.deltaX,deltaY:g.deltaY}}function ll(g){var S=g.length;if(S===1)return{x:h(g[0].clientX),y:h(g[0].clientY)};for(var P=0,M=0,I=0;I<S;)P+=g[I].clientX,M+=g[I].clientY,I++;return{x:h(P/S),y:h(M/S)}}function fl(g,S,P){return{x:S/g||0,y:P/g||0}}function dl(g,S){return g===S?_n:c(g)>=c(S)?g<0?en:nn:S<0?Oe:k}function ci(g,S,P){P||(P=cl);var M=S[P[0]]-g[P[0]],I=S[P[1]]-g[P[1]];return Math.sqrt(M*M+I*I)}function Qo(g,S,P){P||(P=cl);var M=S[P[0]]-g[P[0]],I=S[P[1]]-g[P[1]];return Math.atan2(I,M)*180/Math.PI}function L2(g,S){return Qo(S[1],S[0],hi)+Qo(g[1],g[0],hi)}function R2(g,S){return ci(S[0],S[1],hi)/ci(g[0],g[1],hi)}var O2={mousedown:mt,mousemove:ae,mouseup:it},z2="mousedown",N2="mousemove mouseup";function ui(){this.evEl=z2,this.evWin=N2,this.pressed=!1,Vt.apply(this,arguments)}_(ui,Vt,{handler:function(S){var P=O2[S.type];P&mt&&S.button===0&&(this.pressed=!0),P&ae&&S.which!==1&&(P=it),this.pressed&&(P&it&&(this.pressed=!1),this.callback(this.manager,P,{pointers:[S],changedPointers:[S],pointerType:ee,srcEvent:S}))}});var B2={pointerdown:mt,pointermove:ae,pointerup:it,pointercancel:Ct,pointerout:Ct},F2={2:H,3:At,4:ee,5:oi},ml="pointerdown",pl="pointermove pointerup pointercancel";t.MSPointerEvent&&!t.PointerEvent&&(ml="MSPointerDown",pl="MSPointerMove MSPointerUp MSPointerCancel");function Ko(){this.evEl=ml,this.evWin=pl,Vt.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}_(Ko,Vt,{handler:function(S){var P=this.store,M=!1,I=S.type.toLowerCase().replace("ms",""),z=B2[I],V=F2[S.pointerType]||S.pointerType,pt=V==H,yt=G(P,S.pointerId,"pointerId");z&mt&&(S.button===0||pt)?yt<0&&(P.push(S),yt=P.length-1):z&(it|Ct)&&(M=!0),!(yt<0)&&(P[yt]=S,this.callback(this.manager,z,{pointers:P,changedPointers:[S],pointerType:V,srcEvent:S}),M&&P.splice(yt,1))}});var Y2={touchstart:mt,touchmove:ae,touchend:it,touchcancel:Ct},$2="touchstart",X2="touchstart touchmove touchend touchcancel";function gl(){this.evTarget=$2,this.evWin=X2,this.started=!1,Vt.apply(this,arguments)}_(gl,Vt,{handler:function(S){var P=Y2[S.type];if(P===mt&&(this.started=!0),!!this.started){var M=U2.call(this,S,P);P&(it|Ct)&&M[0].length-M[1].length===0&&(this.started=!1),this.callback(this.manager,P,{pointers:M[0],changedPointers:M[1],pointerType:H,srcEvent:S})}}});function U2(g,S){var P=J(g.touches),M=J(g.changedTouches);return S&(it|Ct)&&(P=st(P.concat(M),"identifier",!0)),[P,M]}var V2={touchstart:mt,touchmove:ae,touchend:it,touchcancel:Ct},G2="touchstart touchmove touchend touchcancel";function li(){this.evTarget=G2,this.targetIds={},Vt.apply(this,arguments)}_(li,Vt,{handler:function(S){var P=V2[S.type],M=q2.call(this,S,P);M&&this.callback(this.manager,P,{pointers:M[0],changedPointers:M[1],pointerType:H,srcEvent:S})}});function q2(g,S){var P=J(g.touches),M=this.targetIds;if(S&(mt|ae)&&P.length===1)return M[P[0].identifier]=!0,[P,P];var I,z,V=J(g.changedTouches),pt=[],yt=this.target;if(z=P.filter(function(kt){return B(kt.target,yt)}),S===mt)for(I=0;I<z.length;)M[z[I].identifier]=!0,I++;for(I=0;I<V.length;)M[V[I].identifier]&&pt.push(V[I]),S&(it|Ct)&&delete M[V[I].identifier],I++;if(pt.length)return[st(z.concat(pt),"identifier",!0),pt]}var j2=2500,yl=25;function ta(){Vt.apply(this,arguments);var g=x(this.handler,this);this.touch=new li(this.manager,g),this.mouse=new ui(this.manager,g),this.primaryTouch=null,this.lastTouches=[]}_(ta,Vt,{handler:function(S,P,M){var I=M.pointerType==H,z=M.pointerType==ee;if(!(z&&M.sourceCapabilities&&M.sourceCapabilities.firesTouchEvents)){if(I)H2.call(this,P,M);else if(z&&W2.call(this,M))return;this.callback(S,P,M)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});function H2(g,S){g&mt?(this.primaryTouch=S.changedPointers[0].identifier,wl.call(this,S)):g&(it|Ct)&&wl.call(this,S)}function wl(g){var S=g.changedPointers[0];if(S.identifier===this.primaryTouch){var P={x:S.clientX,y:S.clientY};this.lastTouches.push(P);var M=this.lastTouches,I=function(){var z=M.indexOf(P);z>-1&&M.splice(z,1)};setTimeout(I,j2)}}function W2(g){for(var S=g.srcEvent.clientX,P=g.srcEvent.clientY,M=0;M<this.lastTouches.length;M++){var I=this.lastTouches[M],z=Math.abs(S-I.x),V=Math.abs(P-I.y);if(z<=yl&&V<=yl)return!0}return!1}var xl=K(o.style,"touchAction"),bl=xl!==i,vl="compute",_l="auto",ea="manipulation",rn="none",rs="pan-x",os="pan-y",fi=Z2();function na(g,S){this.manager=g,this.set(S)}na.prototype={set:function(g){g==vl&&(g=this.compute()),bl&&this.manager.element.style&&fi[g]&&(this.manager.element.style[xl]=g),this.actions=g.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var g=[];return f(this.manager.recognizers,function(S){b(S.options.enable,[S])&&(g=g.concat(S.getTouchAction()))}),J2(g.join(" "))},preventDefaults:function(g){var S=g.srcEvent,P=g.offsetDirection;if(this.manager.session.prevented){S.preventDefault();return}var M=this.actions,I=F(M,rn)&&!fi[rn],z=F(M,os)&&!fi[os],V=F(M,rs)&&!fi[rs];if(I){var pt=g.pointers.length===1,yt=g.distance<2,kt=g.deltaTime<250;if(pt&&yt&&kt)return}if(!(V&&z)&&(I||z&&P&at||V&&P&sn))return this.preventSrc(S)},preventSrc:function(g){this.manager.session.prevented=!0,g.preventDefault()}};function J2(g){if(F(g,rn))return rn;var S=F(g,rs),P=F(g,os);return S&&P?rn:S||P?S?rs:os:F(g,ea)?ea:_l}function Z2(){if(!bl)return!1;var g={},S=t.CSS&&t.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(P){g[P]=S?t.CSS.supports("touch-action",P):!0}),g}var di=1,Gt=2,Sn=4,ze=8,xe=ze,as=16,he=32;function be(g){this.options=y({},this.defaults,g||{}),this.id=Yt(),this.manager=null,this.options.enable=E(this.options.enable,!0),this.state=di,this.simultaneous={},this.requireFail=[]}be.prototype={defaults:{},set:function(g){return y(this.options,g),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(g){if(m(g,"recognizeWith",this))return this;var S=this.simultaneous;return g=mi(g,this),S[g.id]||(S[g.id]=g,g.recognizeWith(this)),this},dropRecognizeWith:function(g){return m(g,"dropRecognizeWith",this)?this:(g=mi(g,this),delete this.simultaneous[g.id],this)},requireFailure:function(g){if(m(g,"requireFailure",this))return this;var S=this.requireFail;return g=mi(g,this),G(S,g)===-1&&(S.push(g),g.requireFailure(this)),this},dropRequireFailure:function(g){if(m(g,"dropRequireFailure",this))return this;g=mi(g,this);var S=G(this.requireFail,g);return S>-1&&this.requireFail.splice(S,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(g){return!!this.simultaneous[g.id]},emit:function(g){var S=this,P=this.state;function M(I){S.manager.emit(I,g)}P<ze&&M(S.options.event+Sl(P)),M(S.options.event),g.additionalEvent&&M(g.additionalEvent),P>=ze&&M(S.options.event+Sl(P))},tryEmit:function(g){if(this.canEmit())return this.emit(g);this.state=he},canEmit:function(){for(var g=0;g<this.requireFail.length;){if(!(this.requireFail[g].state&(he|di)))return!1;g++}return!0},recognize:function(g){var S=y({},g);if(!b(this.options.enable,[this,S])){this.reset(),this.state=he;return}this.state&(xe|as|he)&&(this.state=di),this.state=this.process(S),this.state&(Gt|Sn|ze|as)&&this.tryEmit(S)},process:function(g){},getTouchAction:function(){},reset:function(){}};function Sl(g){return g&as?"cancel":g&ze?"end":g&Sn?"move":g&Gt?"start":""}function Cl(g){return g==k?"down":g==Oe?"up":g==en?"left":g==nn?"right":""}function mi(g,S){var P=S.manager;return P?P.get(g):g}function ne(){be.apply(this,arguments)}_(ne,be,{defaults:{pointers:1},attrTest:function(g){var S=this.options.pointers;return S===0||g.pointers.length===S},process:function(g){var S=this.state,P=g.eventType,M=S&(Gt|Sn),I=this.attrTest(g);return M&&(P&Ct||!I)?S|as:M||I?P&it?S|ze:S&Gt?S|Sn:Gt:he}});function pi(){ne.apply(this,arguments),this.pX=null,this.pY=null}_(pi,ne,{defaults:{event:"pan",threshold:10,pointers:1,direction:hl},getTouchAction:function(){var g=this.options.direction,S=[];return g&at&&S.push(os),g&sn&&S.push(rs),S},directionTest:function(g){var S=this.options,P=!0,M=g.distance,I=g.direction,z=g.deltaX,V=g.deltaY;return I&S.direction||(S.direction&at?(I=z===0?_n:z<0?en:nn,P=z!=this.pX,M=Math.abs(g.deltaX)):(I=V===0?_n:V<0?Oe:k,P=V!=this.pY,M=Math.abs(g.deltaY))),g.direction=I,P&&M>S.threshold&&I&S.direction},attrTest:function(g){return ne.prototype.attrTest.call(this,g)&&(this.state&Gt||!(this.state&Gt)&&this.directionTest(g))},emit:function(g){this.pX=g.deltaX,this.pY=g.deltaY;var S=Cl(g.direction);S&&(g.additionalEvent=this.options.event+S),this._super.emit.call(this,g)}});function sa(){ne.apply(this,arguments)}_(sa,ne,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[rn]},attrTest:function(g){return this._super.attrTest.call(this,g)&&(Math.abs(g.scale-1)>this.options.threshold||this.state&Gt)},emit:function(g){if(g.scale!==1){var S=g.scale<1?"in":"out";g.additionalEvent=this.options.event+S}this._super.emit.call(this,g)}});function ia(){be.apply(this,arguments),this._timer=null,this._input=null}_(ia,be,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[_l]},process:function(g){var S=this.options,P=g.pointers.length===S.pointers,M=g.distance<S.threshold,I=g.deltaTime>S.time;if(this._input=g,!M||!P||g.eventType&(it|Ct)&&!I)this.reset();else if(g.eventType&mt)this.reset(),this._timer=l(function(){this.state=xe,this.tryEmit()},S.time,this);else if(g.eventType&it)return xe;return he},reset:function(){clearTimeout(this._timer)},emit:function(g){this.state===xe&&(g&&g.eventType&it?this.manager.emit(this.options.event+"up",g):(this._input.timeStamp=u(),this.manager.emit(this.options.event,this._input)))}});function ra(){ne.apply(this,arguments)}_(ra,ne,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[rn]},attrTest:function(g){return this._super.attrTest.call(this,g)&&(Math.abs(g.rotation)>this.options.threshold||this.state&Gt)}});function oa(){ne.apply(this,arguments)}_(oa,ne,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:at|sn,pointers:1},getTouchAction:function(){return pi.prototype.getTouchAction.call(this)},attrTest:function(g){var S=this.options.direction,P;return S&(at|sn)?P=g.overallVelocity:S&at?P=g.overallVelocityX:S&sn&&(P=g.overallVelocityY),this._super.attrTest.call(this,g)&&S&g.offsetDirection&&g.distance>this.options.threshold&&g.maxPointers==this.options.pointers&&c(P)>this.options.velocity&&g.eventType&it},emit:function(g){var S=Cl(g.offsetDirection);S&&this.manager.emit(this.options.event+S,g),this.manager.emit(this.options.event,g)}});function gi(){be.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}_(gi,be,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[ea]},process:function(g){var S=this.options,P=g.pointers.length===S.pointers,M=g.distance<S.threshold,I=g.deltaTime<S.time;if(this.reset(),g.eventType&mt&&this.count===0)return this.failTimeout();if(M&&I&&P){if(g.eventType!=it)return this.failTimeout();var z=this.pTime?g.timeStamp-this.pTime<S.interval:!0,V=!this.pCenter||ci(this.pCenter,g.center)<S.posThreshold;this.pTime=g.timeStamp,this.pCenter=g.center,!V||!z?this.count=1:this.count+=1,this._input=g;var pt=this.count%S.taps;if(pt===0)return this.hasRequireFailures()?(this._timer=l(function(){this.state=xe,this.tryEmit()},S.interval,this),Gt):xe}return he},failTimeout:function(){return this._timer=l(function(){this.state=he},this.options.interval,this),he},reset:function(){clearTimeout(this._timer)},emit:function(){this.state==xe&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}});function ve(g,S){return S=S||{},S.recognizers=E(S.recognizers,ve.defaults.preset),new aa(g,S)}ve.VERSION="2.0.7",ve.defaults={domEvents:!1,touchAction:vl,enable:!0,inputTarget:null,inputClass:null,preset:[[ra,{enable:!1}],[sa,{enable:!1},["rotate"]],[oa,{direction:at}],[pi,{direction:at},["swipe"]],[gi],[gi,{event:"doubletap",taps:2},["tap"]],[ia]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};var Q2=1,Tl=2;function aa(g,S){this.options=y({},ve.defaults,S||{}),this.options.inputTarget=this.options.inputTarget||g,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=g,this.input=M2(this),this.touchAction=new na(this,this.options.touchAction),El(this,!0),f(this.options.recognizers,function(P){var M=this.add(new P[0](P[1]));P[2]&&M.recognizeWith(P[2]),P[3]&&M.requireFailure(P[3])},this)}aa.prototype={set:function(g){return y(this.options,g),g.touchAction&&this.touchAction.update(),g.inputTarget&&(this.input.destroy(),this.input.target=g.inputTarget,this.input.init()),this},stop:function(g){this.session.stopped=g?Tl:Q2},recognize:function(g){var S=this.session;if(!S.stopped){this.touchAction.preventDefaults(g);var P,M=this.recognizers,I=S.curRecognizer;(!I||I&&I.state&xe)&&(I=S.curRecognizer=null);for(var z=0;z<M.length;)P=M[z],S.stopped!==Tl&&(!I||P==I||P.canRecognizeWith(I))?P.recognize(g):P.reset(),!I&&P.state&(Gt|Sn|ze)&&(I=S.curRecognizer=P),z++}},get:function(g){if(g instanceof be)return g;for(var S=this.recognizers,P=0;P<S.length;P++)if(S[P].options.event==g)return S[P];return null},add:function(g){if(m(g,"add",this))return this;var S=this.get(g.options.event);return S&&this.remove(S),this.recognizers.push(g),g.manager=this,this.touchAction.update(),g},remove:function(g){if(m(g,"remove",this))return this;if(g=this.get(g),g){var S=this.recognizers,P=G(S,g);P!==-1&&(S.splice(P,1),this.touchAction.update())}return this},on:function(g,S){if(g!==i&&S!==i){var P=this.handlers;return f(U(g),function(M){P[M]=P[M]||[],P[M].push(S)}),this}},off:function(g,S){if(g!==i){var P=this.handlers;return f(U(g),function(M){S?P[M]&&P[M].splice(G(P[M],S),1):delete P[M]}),this}},emit:function(g,S){this.options.domEvents&&K2(g,S);var P=this.handlers[g]&&this.handlers[g].slice();if(!(!P||!P.length)){S.type=g,S.preventDefault=function(){S.srcEvent.preventDefault()};for(var M=0;M<P.length;)P[M](S),M++}},destroy:function(){this.element&&El(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}};function El(g,S){var P=g.element;if(P.style){var M;f(g.options.cssProps,function(I,z){M=K(P.style,z),S?(g.oldCssProps[M]=P.style[M],P.style[M]=I):P.style[M]=g.oldCssProps[M]||""}),S||(g.oldCssProps={})}}function K2(g,S){var P=e.createEvent("Event");P.initEvent(g,!0,!0),P.gesture=S,S.target.dispatchEvent(P)}y(ve,{INPUT_START:mt,INPUT_MOVE:ae,INPUT_END:it,INPUT_CANCEL:Ct,STATE_POSSIBLE:di,STATE_BEGAN:Gt,STATE_CHANGED:Sn,STATE_ENDED:ze,STATE_RECOGNIZED:xe,STATE_CANCELLED:as,STATE_FAILED:he,DIRECTION_NONE:_n,DIRECTION_LEFT:en,DIRECTION_RIGHT:nn,DIRECTION_UP:Oe,DIRECTION_DOWN:k,DIRECTION_HORIZONTAL:at,DIRECTION_VERTICAL:sn,DIRECTION_ALL:hl,Manager:aa,Input:Vt,TouchAction:na,TouchInput:li,MouseInput:ui,PointerEventInput:Ko,TouchMouseInput:ta,SingleTouchInput:gl,Recognizer:be,AttrRecognizer:ne,Tap:gi,Pan:pi,Swipe:oa,Pinch:sa,Rotate:ra,Press:ia,on:C,off:L,each:f,merge:w,extend:v,assign:y,inherit:_,bindFn:x,prefixed:K});var tx=typeof t<"u"?t:typeof self<"u"?self:{};tx.Hammer=ve,typeof i=="function"&&i.amd?i(function(){return ve}):s.exports?s.exports=ve:t[n]=ve})(window,document,"Hammer")})(_h);var xm=_h.exports;const tt=za(xm);var ir=function(s,t){return ir=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])},ir(s,t)};function fe(s,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");ir(s,t);function e(){this.constructor=s}s.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}function bm(s,t,e,n){function i(r){return r instanceof e?r:new e(function(o){o(r)})}return new(e||(e=Promise))(function(r,o){function a(u){try{c(n.next(u))}catch(l){o(l)}}function h(u){try{c(n.throw(u))}catch(l){o(l)}}function c(u){u.done?r(u.value):i(u.value).then(a,h)}c((n=n.apply(s,t||[])).next())})}function Sh(s,t){var e={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},n,i,r,o=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return o.next=a(0),o.throw=a(1),o.return=a(2),typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(c){return function(u){return h([c,u])}}function h(c){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,c[0]&&(e=0)),e;)try{if(n=1,i&&(r=c[0]&2?i.return:c[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,c[1])).done)return r;switch(i=0,r&&(c=[c[0]&2,r.value]),c[0]){case 0:case 1:r=c;break;case 4:return e.label++,{value:c[1],done:!1};case 5:e.label++,i=c[1],c=[0];continue;case 7:c=e.ops.pop(),e.trys.pop();continue;default:if(r=e.trys,!(r=r.length>0&&r[r.length-1])&&(c[0]===6||c[0]===2)){e=0;continue}if(c[0]===3&&(!r||c[1]>r[0]&&c[1]<r[3])){e.label=c[1];break}if(c[0]===6&&e.label<r[1]){e.label=r[1],r=c;break}if(r&&e.label<r[2]){e.label=r[2],e.ops.push(c);break}r[2]&&e.ops.pop(),e.trys.pop();continue}c=t.call(s,e)}catch(u){c=[6,u],i=0}finally{n=r=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}function Ye(s){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&s[t],n=0;if(e)return e.call(s);if(s&&typeof s.length=="number")return{next:function(){return s&&n>=s.length&&(s=void 0),{value:s&&s[n++],done:!s}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function Se(s,t){var e=typeof Symbol=="function"&&s[Symbol.iterator];if(!e)return s;var n=e.call(s),i,r=[],o;try{for(;(t===void 0||t-- >0)&&!(i=n.next()).done;)r.push(i.value)}catch(a){o={error:a}}finally{try{i&&!i.done&&(e=n.return)&&e.call(n)}finally{if(o)throw o.error}}return r}function $e(s,t,e){if(e||arguments.length===2)for(var n=0,i=t.length,r;n<i;n++)(r||!(n in t))&&(r||(r=Array.prototype.slice.call(t,0,n)),r[n]=t[n]);return s.concat(r||Array.prototype.slice.call(t))}function fn(s){return this instanceof fn?(this.v=s,this):new fn(s)}function vm(s,t,e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=e.apply(s,t||[]),i,r=[];return i=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),a("next"),a("throw"),a("return",o),i[Symbol.asyncIterator]=function(){return this},i;function o(f){return function(p){return Promise.resolve(p).then(f,l)}}function a(f,p){n[f]&&(i[f]=function(y){return new Promise(function(v,w){r.push([f,y,v,w])>1||h(f,y)})},p&&(i[f]=p(i[f])))}function h(f,p){try{c(n[f](p))}catch(y){m(r[0][3],y)}}function c(f){f.value instanceof fn?Promise.resolve(f.value.v).then(u,l):m(r[0][2],f)}function u(f){h("next",f)}function l(f){h("throw",f)}function m(f,p){f(p),r.shift(),r.length&&h(r[0][0],r[0][1])}}function _m(s){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=s[Symbol.asyncIterator],e;return t?t.call(s):(s=typeof Ye=="function"?Ye(s):s[Symbol.iterator](),e={},n("next"),n("throw"),n("return"),e[Symbol.asyncIterator]=function(){return this},e);function n(r){e[r]=s[r]&&function(o){return new Promise(function(a,h){o=s[r](o),i(a,h,o.done,o.value)})}}function i(r,o,a,h){Promise.resolve(h).then(function(c){r({value:c,done:a})},o)}}typeof SuppressedError=="function"&&SuppressedError;function j(s){return typeof s=="function"}function rr(s){var t=function(n){Error.call(n),n.stack=new Error().stack},e=s(t);return e.prototype=Object.create(Error.prototype),e.prototype.constructor=e,e}var or=rr(function(s){return function(e){s(this),this.message=e?e.length+` errors occurred during unsubscription:
24
- `+e.map(function(n,i){return i+1+") "+n.toString()}).join(`
25
- `):"",this.name="UnsubscriptionError",this.errors=e}});function Ln(s,t){if(s){var e=s.indexOf(t);0<=e&&s.splice(e,1)}}var dn=function(){function s(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}return s.prototype.unsubscribe=function(){var t,e,n,i,r;if(!this.closed){this.closed=!0;var o=this._parentage;if(o)if(this._parentage=null,Array.isArray(o))try{for(var a=Ye(o),h=a.next();!h.done;h=a.next()){var c=h.value;c.remove(this)}}catch(y){t={error:y}}finally{try{h&&!h.done&&(e=a.return)&&e.call(a)}finally{if(t)throw t.error}}else o.remove(this);var u=this.initialTeardown;if(j(u))try{u()}catch(y){r=y instanceof or?y.errors:[y]}var l=this._finalizers;if(l){this._finalizers=null;try{for(var m=Ye(l),f=m.next();!f.done;f=m.next()){var p=f.value;try{Eh(p)}catch(y){r=r??[],y instanceof or?r=$e($e([],Se(r)),Se(y.errors)):r.push(y)}}}catch(y){n={error:y}}finally{try{f&&!f.done&&(i=m.return)&&i.call(m)}finally{if(n)throw n.error}}}if(r)throw new or(r)}},s.prototype.add=function(t){var e;if(t&&t!==this)if(this.closed)Eh(t);else{if(t instanceof s){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=(e=this._finalizers)!==null&&e!==void 0?e:[]).push(t)}},s.prototype._hasParent=function(t){var e=this._parentage;return e===t||Array.isArray(e)&&e.includes(t)},s.prototype._addParent=function(t){var e=this._parentage;this._parentage=Array.isArray(e)?(e.push(t),e):e?[e,t]:t},s.prototype._removeParent=function(t){var e=this._parentage;e===t?this._parentage=null:Array.isArray(e)&&Ln(e,t)},s.prototype.remove=function(t){var e=this._finalizers;e&&Ln(e,t),t instanceof s&&t._removeParent(this)},s.EMPTY=function(){var t=new s;return t.closed=!0,t}(),s}(),Ch=dn.EMPTY;function Th(s){return s instanceof dn||s&&"closed"in s&&j(s.remove)&&j(s.add)&&j(s.unsubscribe)}function Eh(s){j(s)?s():s.unsubscribe()}var Ph={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},ar={setTimeout:function(s,t){for(var e=[],n=2;n<arguments.length;n++)e[n-2]=arguments[n];var i=ar.delegate;return i?.setTimeout?i.setTimeout.apply(i,$e([s,t],Se(e))):setTimeout.apply(void 0,$e([s,t],Se(e)))},clearTimeout:function(s){var t=ar.delegate;return(t?.clearTimeout||clearTimeout)(s)},delegate:void 0};function Mh(s){ar.setTimeout(function(){throw s})}function Rn(){}function Is(s){s()}var hr=function(s){fe(t,s);function t(e){var n=s.call(this)||this;return n.isStopped=!1,e?(n.destination=e,Th(e)&&e.add(n)):n.destination=Em,n}return t.create=function(e,n,i){return new Ds(e,n,i)},t.prototype.next=function(e){this.isStopped||this._next(e)},t.prototype.error=function(e){this.isStopped||(this.isStopped=!0,this._error(e))},t.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,s.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(e){this.destination.next(e)},t.prototype._error=function(e){try{this.destination.error(e)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t}(dn),Sm=Function.prototype.bind;function cr(s,t){return Sm.call(s,t)}var Cm=function(){function s(t){this.partialObserver=t}return s.prototype.next=function(t){var e=this.partialObserver;if(e.next)try{e.next(t)}catch(n){Ls(n)}},s.prototype.error=function(t){var e=this.partialObserver;if(e.error)try{e.error(t)}catch(n){Ls(n)}else Ls(t)},s.prototype.complete=function(){var t=this.partialObserver;if(t.complete)try{t.complete()}catch(e){Ls(e)}},s}(),Ds=function(s){fe(t,s);function t(e,n,i){var r=s.call(this)||this,o;if(j(e)||!e)o={next:e??void 0,error:n??void 0,complete:i??void 0};else{var a;r&&Ph.useDeprecatedNextContext?(a=Object.create(e),a.unsubscribe=function(){return r.unsubscribe()},o={next:e.next&&cr(e.next,a),error:e.error&&cr(e.error,a),complete:e.complete&&cr(e.complete,a)}):o=e}return r.destination=new Cm(o),r}return t}(hr);function Ls(s){Mh(s)}function Tm(s){throw s}var Em={closed:!0,next:Rn,error:Tm,complete:Rn},ur=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function Xe(s){return s}function Pm(s){return s.length===0?Xe:s.length===1?s[0]:function(e){return s.reduce(function(n,i){return i(n)},e)}}var et=function(){function s(t){t&&(this._subscribe=t)}return s.prototype.lift=function(t){var e=new s;return e.source=this,e.operator=t,e},s.prototype.subscribe=function(t,e,n){var i=this,r=Am(t)?t:new Ds(t,e,n);return Is(function(){var o=i,a=o.operator,h=o.source;r.add(a?a.call(r,h):h?i._subscribe(r):i._trySubscribe(r))}),r},s.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(e){t.error(e)}},s.prototype.forEach=function(t,e){var n=this;return e=Ah(e),new e(function(i,r){var o=new Ds({next:function(a){try{t(a)}catch(h){r(h),o.unsubscribe()}},error:r,complete:i});n.subscribe(o)})},s.prototype._subscribe=function(t){var e;return(e=this.source)===null||e===void 0?void 0:e.subscribe(t)},s.prototype[ur]=function(){return this},s.prototype.pipe=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Pm(t)(this)},s.prototype.toPromise=function(t){var e=this;return t=Ah(t),new t(function(n,i){var r;e.subscribe(function(o){return r=o},function(o){return i(o)},function(){return n(r)})})},s.create=function(t){return new s(t)},s}();function Ah(s){var t;return(t=s??Ph.Promise)!==null&&t!==void 0?t:Promise}function Mm(s){return s&&j(s.next)&&j(s.error)&&j(s.complete)}function Am(s){return s&&s instanceof hr||Mm(s)&&Th(s)}function km(s){return j(s?.lift)}function Ot(s){return function(t){if(km(t))return t.lift(function(e){try{return s(e,this)}catch(n){this.error(n)}});throw new TypeError("Unable to lift unknown Observable type")}}function lt(s,t,e,n,i){return new Im(s,t,e,n,i)}var Im=function(s){fe(t,s);function t(e,n,i,r,o,a){var h=s.call(this,e)||this;return h.onFinalize=o,h.shouldUnsubscribe=a,h._next=n?function(c){try{n(c)}catch(u){e.error(u)}}:s.prototype._next,h._error=r?function(c){try{r(c)}catch(u){e.error(u)}finally{this.unsubscribe()}}:s.prototype._error,h._complete=i?function(){try{i()}catch(c){e.error(c)}finally{this.unsubscribe()}}:s.prototype._complete,h}return t.prototype.unsubscribe=function(){var e;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var n=this.closed;s.prototype.unsubscribe.call(this),!n&&((e=this.onFinalize)===null||e===void 0||e.call(this))}},t}(hr),Dm=rr(function(s){return function(){s(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),mn=function(s){fe(t,s);function t(){var e=s.call(this)||this;return e.closed=!1,e.currentObservers=null,e.observers=[],e.isStopped=!1,e.hasError=!1,e.thrownError=null,e}return t.prototype.lift=function(e){var n=new kh(this,this);return n.operator=e,n},t.prototype._throwIfClosed=function(){if(this.closed)throw new Dm},t.prototype.next=function(e){var n=this;Is(function(){var i,r;if(n._throwIfClosed(),!n.isStopped){n.currentObservers||(n.currentObservers=Array.from(n.observers));try{for(var o=Ye(n.currentObservers),a=o.next();!a.done;a=o.next()){var h=a.value;h.next(e)}}catch(c){i={error:c}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}}})},t.prototype.error=function(e){var n=this;Is(function(){if(n._throwIfClosed(),!n.isStopped){n.hasError=n.isStopped=!0,n.thrownError=e;for(var i=n.observers;i.length;)i.shift().error(e)}})},t.prototype.complete=function(){var e=this;Is(function(){if(e._throwIfClosed(),!e.isStopped){e.isStopped=!0;for(var n=e.observers;n.length;)n.shift().complete()}})},t.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(t.prototype,"observed",{get:function(){var e;return((e=this.observers)===null||e===void 0?void 0:e.length)>0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(e){return this._throwIfClosed(),s.prototype._trySubscribe.call(this,e)},t.prototype._subscribe=function(e){return this._throwIfClosed(),this._checkFinalizedStatuses(e),this._innerSubscribe(e)},t.prototype._innerSubscribe=function(e){var n=this,i=this,r=i.hasError,o=i.isStopped,a=i.observers;return r||o?Ch:(this.currentObservers=null,a.push(e),new dn(function(){n.currentObservers=null,Ln(a,e)}))},t.prototype._checkFinalizedStatuses=function(e){var n=this,i=n.hasError,r=n.thrownError,o=n.isStopped;i?e.error(r):o&&e.complete()},t.prototype.asObservable=function(){var e=new et;return e.source=this,e},t.create=function(e,n){return new kh(e,n)},t}(et),kh=function(s){fe(t,s);function t(e,n){var i=s.call(this)||this;return i.destination=e,i.source=n,i}return t.prototype.next=function(e){var n,i;(i=(n=this.destination)===null||n===void 0?void 0:n.next)===null||i===void 0||i.call(n,e)},t.prototype.error=function(e){var n,i;(i=(n=this.destination)===null||n===void 0?void 0:n.error)===null||i===void 0||i.call(n,e)},t.prototype.complete=function(){var e,n;(n=(e=this.destination)===null||e===void 0?void 0:e.complete)===null||n===void 0||n.call(e)},t.prototype._subscribe=function(e){var n,i;return(i=(n=this.source)===null||n===void 0?void 0:n.subscribe(e))!==null&&i!==void 0?i:Ch},t}(mn),Lm=function(s){fe(t,s);function t(e){var n=s.call(this)||this;return n._value=e,n}return Object.defineProperty(t.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),t.prototype._subscribe=function(e){var n=s.prototype._subscribe.call(this,e);return!n.closed&&e.next(this._value),n},t.prototype.getValue=function(){var e=this,n=e.hasError,i=e.thrownError,r=e._value;if(n)throw i;return this._throwIfClosed(),r},t.prototype.next=function(e){s.prototype.next.call(this,this._value=e)},t}(mn),Ih={now:function(){return(Ih.delegate||Date).now()},delegate:void 0},Rm=function(s){fe(t,s);function t(e,n){return s.call(this)||this}return t.prototype.schedule=function(e,n){return this},t}(dn),Rs={setInterval:function(s,t){for(var e=[],n=2;n<arguments.length;n++)e[n-2]=arguments[n];var i=Rs.delegate;return i?.setInterval?i.setInterval.apply(i,$e([s,t],Se(e))):setInterval.apply(void 0,$e([s,t],Se(e)))},clearInterval:function(s){var t=Rs.delegate;return(t?.clearInterval||clearInterval)(s)},delegate:void 0},Om=function(s){fe(t,s);function t(e,n){var i=s.call(this,e,n)||this;return i.scheduler=e,i.work=n,i.pending=!1,i}return t.prototype.schedule=function(e,n){var i;if(n===void 0&&(n=0),this.closed)return this;this.state=e;var r=this.id,o=this.scheduler;return r!=null&&(this.id=this.recycleAsyncId(o,r,n)),this.pending=!0,this.delay=n,this.id=(i=this.id)!==null&&i!==void 0?i:this.requestAsyncId(o,this.id,n),this},t.prototype.requestAsyncId=function(e,n,i){return i===void 0&&(i=0),Rs.setInterval(e.flush.bind(e,this),i)},t.prototype.recycleAsyncId=function(e,n,i){if(i===void 0&&(i=0),i!=null&&this.delay===i&&this.pending===!1)return n;n!=null&&Rs.clearInterval(n)},t.prototype.execute=function(e,n){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var i=this._execute(e,n);if(i)return i;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},t.prototype._execute=function(e,n){var i=!1,r;try{this.work(e)}catch(o){i=!0,r=o||new Error("Scheduled action threw falsy error")}if(i)return this.unsubscribe(),r},t.prototype.unsubscribe=function(){if(!this.closed){var e=this,n=e.id,i=e.scheduler,r=i.actions;this.work=this.state=this.scheduler=null,this.pending=!1,Ln(r,this),n!=null&&(this.id=this.recycleAsyncId(i,n,null)),this.delay=null,s.prototype.unsubscribe.call(this)}},t}(Rm),Dh=function(){function s(t,e){e===void 0&&(e=s.now),this.schedulerActionCtor=t,this.now=e}return s.prototype.schedule=function(t,e,n){return e===void 0&&(e=0),new this.schedulerActionCtor(this,t).schedule(n,e)},s.now=Ih.now,s}(),zm=function(s){fe(t,s);function t(e,n){n===void 0&&(n=Dh.now);var i=s.call(this,e,n)||this;return i.actions=[],i._active=!1,i}return t.prototype.flush=function(e){var n=this.actions;if(this._active){n.push(e);return}var i;this._active=!0;do if(i=e.execute(e.state,e.delay))break;while(e=n.shift());if(this._active=!1,i){for(;e=n.shift();)e.unsubscribe();throw i}},t}(Dh),lr=new zm(Om),Nm=lr,Lh=new et(function(s){return s.complete()});function Rh(s){return s&&j(s.schedule)}function fr(s){return s[s.length-1]}function Bm(s){return j(fr(s))?s.pop():void 0}function On(s){return Rh(fr(s))?s.pop():void 0}function Fm(s,t){return typeof fr(s)=="number"?s.pop():t}var dr=function(s){return s&&typeof s.length=="number"&&typeof s!="function"};function Oh(s){return j(s?.then)}function zh(s){return j(s[ur])}function Nh(s){return Symbol.asyncIterator&&j(s?.[Symbol.asyncIterator])}function Bh(s){return new TypeError("You provided "+(s!==null&&typeof s=="object"?"an invalid object":"'"+s+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}function Ym(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var Fh=Ym();function Yh(s){return j(s?.[Fh])}function $h(s){return vm(this,arguments,function(){var e,n,i,r;return Sh(this,function(o){switch(o.label){case 0:e=s.getReader(),o.label=1;case 1:o.trys.push([1,,9,10]),o.label=2;case 2:return[4,fn(e.read())];case 3:return n=o.sent(),i=n.value,r=n.done,r?[4,fn(void 0)]:[3,5];case 4:return[2,o.sent()];case 5:return[4,fn(i)];case 6:return[4,o.sent()];case 7:return o.sent(),[3,2];case 8:return[3,10];case 9:return e.releaseLock(),[7];case 10:return[2]}})})}function Xh(s){return j(s?.getReader)}function vt(s){if(s instanceof et)return s;if(s!=null){if(zh(s))return $m(s);if(dr(s))return Xm(s);if(Oh(s))return Um(s);if(Nh(s))return Uh(s);if(Yh(s))return Vm(s);if(Xh(s))return Gm(s)}throw Bh(s)}function $m(s){return new et(function(t){var e=s[ur]();if(j(e.subscribe))return e.subscribe(t);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function Xm(s){return new et(function(t){for(var e=0;e<s.length&&!t.closed;e++)t.next(s[e]);t.complete()})}function Um(s){return new et(function(t){s.then(function(e){t.closed||(t.next(e),t.complete())},function(e){return t.error(e)}).then(null,Mh)})}function Vm(s){return new et(function(t){var e,n;try{for(var i=Ye(s),r=i.next();!r.done;r=i.next()){var o=r.value;if(t.next(o),t.closed)return}}catch(a){e={error:a}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}t.complete()})}function Uh(s){return new et(function(t){qm(s,t).catch(function(e){return t.error(e)})})}function Gm(s){return Uh($h(s))}function qm(s,t){var e,n,i,r;return bm(this,void 0,void 0,function(){var o,a;return Sh(this,function(h){switch(h.label){case 0:h.trys.push([0,5,6,11]),e=_m(s),h.label=1;case 1:return[4,e.next()];case 2:if(n=h.sent(),!!n.done)return[3,4];if(o=n.value,t.next(o),t.closed)return[2];h.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return a=h.sent(),i={error:a},[3,11];case 6:return h.trys.push([6,,9,10]),n&&!n.done&&(r=e.return)?[4,r.call(e)]:[3,8];case 7:h.sent(),h.label=8;case 8:return[3,10];case 9:if(i)throw i.error;return[7];case 10:return[7];case 11:return t.complete(),[2]}})})}function de(s,t,e,n,i){n===void 0&&(n=0),i===void 0&&(i=!1);var r=t.schedule(function(){e(),i?s.add(this.schedule(null,n)):this.unsubscribe()},n);if(s.add(r),!i)return r}function Vh(s,t){return t===void 0&&(t=0),Ot(function(e,n){e.subscribe(lt(n,function(i){return de(n,s,function(){return n.next(i)},t)},function(){return de(n,s,function(){return n.complete()},t)},function(i){return de(n,s,function(){return n.error(i)},t)}))})}function mr(s,t){return t===void 0&&(t=0),Ot(function(e,n){n.add(s.schedule(function(){return e.subscribe(n)},t))})}function jm(s,t){return vt(s).pipe(mr(t),Vh(t))}function Hm(s,t){return vt(s).pipe(mr(t),Vh(t))}function Wm(s,t){return new et(function(e){var n=0;return t.schedule(function(){n===s.length?e.complete():(e.next(s[n++]),e.closed||this.schedule())})})}function Jm(s,t){return new et(function(e){var n;return de(e,t,function(){n=s[Fh](),de(e,t,function(){var i,r,o;try{i=n.next(),r=i.value,o=i.done}catch(a){e.error(a);return}o?e.complete():e.next(r)},0,!0)}),function(){return j(n?.return)&&n.return()}})}function Gh(s,t){if(!s)throw new Error("Iterable cannot be null");return new et(function(e){de(e,t,function(){var n=s[Symbol.asyncIterator]();de(e,t,function(){n.next().then(function(i){i.done?e.complete():e.next(i.value)})},0,!0)})})}function Zm(s,t){return Gh($h(s),t)}function Qm(s,t){if(s!=null){if(zh(s))return jm(s,t);if(dr(s))return Wm(s,t);if(Oh(s))return Hm(s,t);if(Nh(s))return Gh(s,t);if(Yh(s))return Jm(s,t);if(Xh(s))return Zm(s,t)}throw Bh(s)}function zn(s,t){return t?Qm(s,t):vt(s)}function Km(){for(var s=[],t=0;t<arguments.length;t++)s[t]=arguments[t];var e=On(s);return zn(s,e)}var tp=rr(function(s){return function(){s(this),this.name="EmptyError",this.message="no elements in sequence"}});function ep(s,t){var e=typeof t=="object";return new Promise(function(n,i){var r=new Ds({next:function(o){n(o),r.unsubscribe()},error:i,complete:function(){e?n(t.defaultValue):i(new tp)}});s.subscribe(r)})}function np(s){return s instanceof Date&&!isNaN(s)}function rt(s,t){return Ot(function(e,n){var i=0;e.subscribe(lt(n,function(r){n.next(s.call(t,r,i++))}))})}var sp=Array.isArray;function ip(s,t){return sp(t)?s.apply(void 0,$e([],Se(t))):s(t)}function pr(s){return rt(function(t){return ip(s,t)})}var rp=Array.isArray,op=Object.getPrototypeOf,hp=Object.prototype,cp=Object.keys;function up(s){if(s.length===1){var t=s[0];if(rp(t))return{args:t,keys:null};if(lp(t)){var e=cp(t);return{args:e.map(function(n){return t[n]}),keys:e}}}return{args:s,keys:null}}function lp(s){return s&&typeof s=="object"&&op(s)===hp}function fp(s,t){return s.reduce(function(e,n,i){return e[n]=t[i],e},{})}function dp(){for(var s=[],t=0;t<arguments.length;t++)s[t]=arguments[t];var e=On(s),n=Bm(s),i=up(s),r=i.args,o=i.keys;if(r.length===0)return zn([],e);var a=new et(mp(r,e,o?function(h){return fp(o,h)}:Xe));return n?a.pipe(pr(n)):a}function mp(s,t,e){return e===void 0&&(e=Xe),function(n){qh(t,function(){for(var i=s.length,r=new Array(i),o=i,a=i,h=function(u){qh(t,function(){var l=zn(s[u],t),m=!1;l.subscribe(lt(n,function(f){r[u]=f,m||(m=!0,a--),a||n.next(e(r.slice()))},function(){--o||n.complete()}))},n)},c=0;c<i;c++)h(c)},n)}}function qh(s,t,e){s?de(e,s,t):t()}function pp(s,t,e,n,i,r,o,a){var h=[],c=0,u=0,l=!1,m=function(){l&&!h.length&&!c&&t.complete()},f=function(y){return c<n?p(y):h.push(y)},p=function(y){r&&t.next(y),c++;var v=!1;vt(e(y,u++)).subscribe(lt(t,function(w){i?.(w),r?f(w):t.next(w)},function(){v=!0},void 0,function(){if(v)try{c--;for(var w=function(){var _=h.shift();o?de(t,o,function(){return p(_)}):p(_)};h.length&&c<n;)w();m()}catch(_){t.error(_)}}))};return s.subscribe(lt(t,f,function(){l=!0,m()})),function(){a?.()}}function gr(s,t,e){return e===void 0&&(e=1/0),j(t)?gr(function(n,i){return rt(function(r,o){return t(n,r,i,o)})(vt(s(n,i)))},e):(typeof t=="number"&&(e=t),Ot(function(n,i){return pp(n,i,s,e)}))}function jh(s){return s===void 0&&(s=1/0),gr(Xe,s)}function gp(){return jh(1)}function Hh(){for(var s=[],t=0;t<arguments.length;t++)s[t]=arguments[t];return gp()(zn(s,On(s)))}var yp=["addListener","removeListener"],wp=["addEventListener","removeEventListener"],xp=["on","off"];function yr(s,t,e,n){if(j(e)&&(n=e,e=void 0),n)return yr(s,t,e).pipe(pr(n));var i=Se(_p(s)?wp.map(function(a){return function(h){return s[a](t,h,e)}}):bp(s)?yp.map(Wh(s,t)):vp(s)?xp.map(Wh(s,t)):[],2),r=i[0],o=i[1];if(!r&&dr(s))return gr(function(a){return yr(a,t,e)})(vt(s));if(!r)throw new TypeError("Invalid event target");return new et(function(a){var h=function(){for(var c=[],u=0;u<arguments.length;u++)c[u]=arguments[u];return a.next(1<c.length?c:c[0])};return r(h),function(){return o(h)}})}function Wh(s,t){return function(e){return function(n){return s[e](t,n)}}}function bp(s){return j(s.addListener)&&j(s.removeListener)}function vp(s){return j(s.on)&&j(s.off)}function _p(s){return j(s.addEventListener)&&j(s.removeEventListener)}function nt(s,t,e){return e?nt(s,t).pipe(pr(e)):new et(function(n){var i=function(){for(var o=[],a=0;a<arguments.length;a++)o[a]=arguments[a];return n.next(o.length===1?o[0]:o)},r=s(i);return j(t)?function(){return t(i,r)}:void 0})}function Sp(s,t,e){s===void 0&&(s=0),e===void 0&&(e=Nm);var n=-1;return t!=null&&(Rh(t)?e=t:n=t),new et(function(i){var r=np(s)?+s-e.now():s;r<0&&(r=0);var o=0;return e.schedule(function(){i.closed||(i.next(o++),0<=n?this.schedule(void 0,n):i.complete())},r)})}function Cp(){for(var s=[],t=0;t<arguments.length;t++)s[t]=arguments[t];var e=On(s),n=Fm(s,1/0),i=s;return i.length?i.length===1?vt(i[0]):jh(n)(zn(i,e)):Lh}var Tp=Array.isArray;function Ep(s){return s.length===1&&Tp(s[0])?s[0]:s}function Jh(s,t){return Ot(function(e,n){var i=0;e.subscribe(lt(n,function(r){return s.call(t,r,i++)&&n.next(r)}))})}function wr(){for(var s=[],t=0;t<arguments.length;t++)s[t]=arguments[t];return s=Ep(s),s.length===1?vt(s[0]):new et(Pp(s))}function Pp(s){return function(t){for(var e=[],n=function(r){e.push(vt(s[r]).subscribe(lt(t,function(o){if(e){for(var a=0;a<e.length;a++)a!==r&&e[a].unsubscribe();e=null}t.next(o)})))},i=0;e&&!t.closed&&i<s.length;i++)n(i)}}function Ce(s,t){return t===void 0&&(t=Xe),s=s??Mp,Ot(function(e,n){var i,r=!0;e.subscribe(lt(n,function(o){var a=t(o);(r||!s(i,a))&&(r=!1,i=a,n.next(o))}))})}function Mp(s,t){return s===t}function Zh(s,t){return t?function(e){return e.pipe(Zh(function(n,i){return vt(s(n,i)).pipe(rt(function(r,o){return t(n,r,i,o)}))}))}:Ot(function(e,n){var i=0,r=null,o=!1;e.subscribe(lt(n,function(a){r||(r=lt(n,void 0,function(){r=null,o&&n.complete()}),vt(s(a,i++)).subscribe(r))},function(){o=!0,!r&&n.complete()}))})}function Te(){for(var s=[],t=0;t<arguments.length;t++)s[t]=arguments[t];var e=On(s);return Ot(function(n,i){(e?Hh(s,n,e):Hh(s,n)).subscribe(i)})}function Os(s,t){return Ot(function(e,n){var i=null,r=0,o=!1,a=function(){return o&&!i&&n.complete()};e.subscribe(lt(n,function(h){i?.unsubscribe();var c=0,u=r++;vt(s(h,u)).subscribe(i=lt(n,function(l){return n.next(t?t(h,l,u,c++):l)},function(){i=null,a()}))},function(){o=!0,a()}))})}function Ap(){return Os(Xe)}function xr(s){return Ot(function(t,e){vt(s).subscribe(lt(e,function(){return e.complete()},Rn)),!e.closed&&t.subscribe(e)})}function Ue(s,t,e){var n=j(s)||t||e?{next:s,error:t,complete:e}:s;return n?Ot(function(i,r){var o;(o=n.subscribe)===null||o===void 0||o.call(n);var a=!0;i.subscribe(lt(r,function(h){var c;(c=n.next)===null||c===void 0||c.call(n,h),r.next(h)},function(){var h;a=!1,(h=n.complete)===null||h===void 0||h.call(n),r.complete()},function(h){var c;a=!1,(c=n.error)===null||c===void 0||c.call(n,h),r.error(h)},function(){var h,c;a&&((h=n.unsubscribe)===null||h===void 0||h.call(n)),(c=n.finalize)===null||c===void 0||c.call(n)}))}):Xe}function kp(s,t){return Ot(function(e,n){var i=t??{},r=i.leading,o=r===void 0?!0:r,a=i.trailing,h=a===void 0?!1:a,c=!1,u=null,l=null,m=!1,f=function(){l?.unsubscribe(),l=null,h&&(v(),m&&n.complete())},p=function(){l=null,m&&n.complete()},y=function(w){return l=vt(s(w)).subscribe(lt(n,f,p))},v=function(){if(c){c=!1;var w=u;u=null,n.next(w),!m&&y(w)}};e.subscribe(lt(n,function(w){c=!0,u=w,!(l&&!l.closed)&&(o?v():y(w))},function(){m=!0,!(h&&c&&l&&!l.closed)&&n.complete()}))})}function Ip(s,t,e){t===void 0&&(t=lr);var n=Sp(s,t);return kp(function(){return n},e)}function Dp(s,t){return Ot(function(e,n){var i=[],r=function(o){for(;0<i.length;)i.shift().error(o);n.error(o)};vt(s).subscribe(lt(n,function(o){var a=new mn;i.push(a);var h=new dn,c=function(){Ln(i,a),a.complete(),h.unsubscribe()},u;try{u=vt(t(o))}catch(l){r(l);return}n.next(a.asObservable()),h.add(u.subscribe(lt(n,c,Rn,r)))},Rn)),e.subscribe(lt(n,function(o){var a,h,c=i.slice();try{for(var u=Ye(c),l=u.next();!l.done;l=u.next()){var m=l.value;m.next(o)}}catch(f){a={error:f}}finally{try{l&&!l.done&&(h=u.return)&&h.call(u)}finally{if(a)throw a.error}}},function(){for(;0<i.length;)i.shift().complete();n.complete()},r,function(){for(;0<i.length;)i.shift().unsubscribe()}))})}function W(s,t,e,n=!1){const i=async r=>{await e(r)};try{s.addEventListener(t,i,n)}catch{s.attachEvent("on"+t,i)}return()=>{try{s.removeEventListener(t,i,n)}catch{s.detachEvent("on"+t,i)}}}function X(s,t,e=!1){return yr(s,t,{capture:e})}function Ee(s){if(s.preventDefault){s.preventDefault();return}try{s.returnValue=!1}catch{}}function Qh(s){if(s.stopPropagation){s.stopPropagation();return}try{s.cancelBubble=!0}catch{}}const Lp=["click","dblclick","wheel","contextmenu","mousedown","mouseup","mousemove","mouseover","mouseout","mouseenter","mouseleave"],Rp=["keydown","keyup","keypress"],Op=["touchstart","touchend","touchcancel","touchmove"],zp=["pointerdown","pointerup","pointercancel","pointermove"],Np=["dragstart","drag","dragend","dragenter","dragover","dragleave","drop"],Bp=["change"];function Fp(s,t,e={bubbles:!0,detail:{}}){if(!s)return;let n;try{Lp.includes(t)?n=new MouseEvent(t,e):Rp.includes(t)?n=new KeyboardEvent(t,e):Op.includes(t)?n=new TouchEvent(t,e):zp.includes(t)?n=new PointerEvent(t,e):Np.includes(t)?n=new DragEvent(t,e):Bp.includes(t)?n=new Event(t,e):n=new CustomEvent(t,e)}catch{document.createEvent?n=document.createEvent("HTMLEvents").initEvent(t,!0,!0):document.createEventObject&&(n=document.createEventObject())}if(s.dispatchEvent)s.dispatchEvent(n);else if(s.fireEvent&&document.createEventObject)s.fireEvent("on"+t,n);else throw new Error(`Can't fire event : ${t}`)}function Yp(s,t){const e=s.changedTouches[0];return new MouseEvent(t,{bubbles:!0,cancelable:!0,view:window,detail:1,screenX:e.screenX,screenY:e.screenY,clientX:e.clientX,clientY:e.clientY,ctrlKey:!1,altKey:!1,shiftKey:!1,metaKey:!1,button:0,relatedTarget:null})}function $p(s,t){let e=document.createElement(s);t="on"+t;let n=t in e;return n||(e.setAttribute(t,"return;"),n=typeof e[t]=="function"),e=null,n}(function(){if(!window.requestAnimationFrame){let s=ut();window.requestAnimationFrame=function(t){const e=ut(),n=Math.max(0,16-(e-s)),i=window.setTimeout(function(){t(e+n)},n);return s=e+n,i}}window.cancelAnimationFrame||(window.cancelAnimationFrame=function(s){clearTimeout(s)})})();function br(s){let t=!1;return window.requestAnimationFrame(function e(n){!t&&s(n)&&window.requestAnimationFrame(e)}),()=>{t=!0}}function vr(s,t=0){if(t==0)return s(ut()),()=>{};{const e=ut();return br(n=>n-e>=t?(s(n),!1):!0)}}function Xp(s,t=0){let e=!1,n=0;const i=ut(),r=o=>{if(e)return;n++;const a=o-i-n*t;s(o,n,t<=a),vr(r,Math.max(0,t-a))};return vr(r,t),()=>{e=!0}}function Up(s,t=20){const e=1e3/t;let n=0,i;return()=>(ut()-n>=e&&(n=ut(),i=s()),i)}window.requestIdleCallback=window.requestIdleCallback||function(s,t){const e=ut();return setTimeout(()=>{const n=ut()-e;s({didTimeout:!0,timeRemaining:()=>Math.max(0,50-n)})},t?.timeout)},window.cancelIdleCallback=window.cancelIdleCallback||function(s){clearTimeout(s)};function Kh(s,t){window.requestIdleCallback(e=>{e.timeRemaining()>0||e.didTimeout?s():Kh(s,t)},{timeout:t?.timeout})}let zs=0,_r=0,Ve=33,Pe=33,Sr,Cr=-1;const tc=new MessageChannel,Vp=tc.port2;tc.port1.onmessage=s=>{Sr&&Sr({didTimeout:Cr==-1?!1:ut()-zs>Cr,timeRemaining:()=>Math.max(0,_r-ut())})};function Gp(s,t){return Sr=s,Cr=typeof t?.timeout=="number"?t?.timeout:-1,requestAnimationFrame(e=>{zs=e;let n=Pe+zs-_r;n<Pe&&Ve<Pe?(n<8&&(n=8),Pe=n<Ve?Ve:n):n>Pe&&Ve>Pe?Pe=n<Ve?Ve:n:Ve=n,_r=zs+Pe,Vp.postMessage(null)})}const ec=new Bf({concurrency:1,timeRemaining:0});let Tr=!1;function nc(s,t){const e=zf({fn:s,name:t?.name,deadline:typeof t?.timeout=="number"?se()+t.timeout:void 0});ec.addTask(e),!Tr&&(Tr=!0,Gp(n=>{Tr=!1,ec.idleCallback(n)}))}class Nn{static _nextId=0;static nextId(){return Nn._nextId++}}const O={Linear:{None:function(s){return s}},Ease:{In:function(s){return Math.pow(s,1.7)}},Quadratic:{In:function(s){return s*s},Out:function(s){return s*(2-s)},InOut:function(s){return(s*=2)<1?.5*s*s:-.5*(--s*(s-2)-1)}},Cubic:{In:function(s){return s*s*s},Out:function(s){return--s*s*s+1},InOut:function(s){return(s*=2)<1?.5*s*s*s:.5*((s-=2)*s*s+2)}},Quartic:{In:function(s){return s*s*s*s},Out:function(s){return 1- --s*s*s*s},InOut:function(s){return(s*=2)<1?.5*s*s*s*s:-.5*((s-=2)*s*s*s-2)}},Quintic:{In:function(s){return s*s*s*s*s},Out:function(s){return--s*s*s*s*s+1},InOut:function(s){return(s*=2)<1?.5*s*s*s*s*s:.5*((s-=2)*s*s*s*s+2)}},Sinusoidal:{In:function(s){return 1-Math.sin((1-s)*Math.PI/2)},Out:function(s){return Math.sin(s*Math.PI/2)},InOut:function(s){return .5*(1-Math.sin(Math.PI*(.5-s)))}},Exponential:{In:function(s){return s===0?0:Math.pow(1024,s-1)},Out:function(s){return s===1?1:1-Math.pow(2,-10*s)},InOut:function(s){return s===0?0:s===1?1:(s*=2)<1?.5*Math.pow(1024,s-1):.5*(-Math.pow(2,-10*(s-1))+2)}},Circular:{In:function(s){return 1-Math.sqrt(1-s*s)},Out:function(s){return Math.sqrt(1- --s*s)},InOut:function(s){return(s*=2)<1?-.5*(Math.sqrt(1-s*s)-1):.5*(Math.sqrt(1-(s-=2)*s)+1)}},Elastic:{In:function(s){return s===0?0:s===1?1:-Math.pow(2,10*(s-1))*Math.sin((s-1.1)*5*Math.PI)},Out:function(s){return s===0?0:s===1?1:Math.pow(2,-10*s)*Math.sin((s-.1)*5*Math.PI)+1},InOut:function(s){return s===0?0:s===1?1:(s*=2,s<1?-.5*Math.pow(2,10*(s-1))*Math.sin((s-1.1)*5*Math.PI):.5*Math.pow(2,-10*(s-1))*Math.sin((s-1.1)*5*Math.PI)+1)}},Back:{In:function(s){return s===1?1:s*s*((1.70158+1)*s-1.70158)},Out:function(s){return s===0?0:--s*s*((1.70158+1)*s+1.70158)+1},InOut:function(s){const t=2.5949095;return(s*=2)<1?.5*(s*s*((t+1)*s-t)):.5*((s-=2)*s*((t+1)*s+t)+2)}},Bounce:{In:function(s){return 1-O.Bounce.Out(1-s)},Out:function(s){return s<1/2.75?7.5625*s*s:s<2/2.75?7.5625*(s-=1.5/2.75)*s+.75:s<2.5/2.75?7.5625*(s-=2.25/2.75)*s+.9375:7.5625*(s-=2.625/2.75)*s+.984375},InOut:function(s){return s<.5?O.Bounce.In(s*2)*.5:O.Bounce.Out(s*2-1)*.5+.5}},generatePow:function(s=4){return s=s<Number.EPSILON?Number.EPSILON:s,s=s>1e4?1e4:s,{In:function(t){return t**s},Out:function(t){return 1-(1-t)**s},InOut:function(t){return t<.5?(t*2)**s/2:(1-(2-t*2)**s)/2+.5}}},random:function(s){return Math.random()},createStep:function(s){return function(t){return Math.floor(t*s)/s}},createNoisyEasing:function(s,t=.1){const e=1-t;return function(n){return t*Math.random()+e*s(n)}},swing:function(s){return s+Math.sin(s*Math.PI*2)/2},causeSeizures:function(s){return s+.2*Math.random()-.1}};function sc(s){switch(s){case O.Quadratic.In:return O.Quadratic.Out;case O.Quadratic.Out:return O.Quadratic.In;case O.Quadratic.InOut:return O.Quadratic.InOut;case O.Cubic.In:return O.Cubic.Out;case O.Cubic.Out:return O.Cubic.In;case O.Cubic.InOut:return O.Cubic.InOut;case O.Quartic.In:return O.Quartic.Out;case O.Quartic.Out:return O.Quartic.In;case O.Quartic.InOut:return O.Quartic.InOut;case O.Quintic.In:return O.Quintic.Out;case O.Quintic.Out:return O.Quintic.In;case O.Quintic.InOut:return O.Quintic.InOut;case O.Sinusoidal.In:return O.Sinusoidal.Out;case O.Sinusoidal.Out:return O.Sinusoidal.In;case O.Sinusoidal.InOut:return O.Sinusoidal.InOut;case O.Exponential.In:return O.Exponential.Out;case O.Exponential.Out:return O.Exponential.In;case O.Exponential.InOut:return O.Exponential.InOut;case O.Circular.In:return O.Circular.Out;case O.Circular.Out:return O.Circular.In;case O.Circular.InOut:return O.Circular.InOut;case O.Elastic.In:return O.Elastic.Out;case O.Elastic.Out:return O.Elastic.In;case O.Elastic.InOut:return O.Elastic.InOut;case O.Back.In:return O.Back.Out;case O.Back.Out:return O.Back.In;case O.Back.InOut:return O.Back.InOut;case O.Bounce.In:return O.Bounce.Out;case O.Bounce.Out:return O.Bounce.In;case O.Bounce.InOut:return O.Bounce.InOut;default:return s}}const qp=4,jp=.001,Hp=1e-7,Wp=10,Bn=11,Ns=1/(Bn-1),Jp=typeof Float32Array=="function";function ic(s,t){return 1-3*t+3*s}function rc(s,t){return 3*t-6*s}function oc(s){return 3*s}function Bs(s,t,e){return((ic(t,e)*s+rc(t,e))*s+oc(t))*s}function ac(s,t,e){return 3*ic(t,e)*s*s+2*rc(t,e)*s+oc(t)}function Zp(s,t,e,n,i){let r,o,a=0;do o=t+(e-t)/2,r=Bs(o,n,i)-s,r>0?e=o:t=o;while(Math.abs(r)>Hp&&++a<Wp);return o}function Qp(s,t,e,n){for(let i=0;i<qp;++i){const r=ac(t,e,n);if(r===0)return t;const o=Bs(t,e,n)-s;t-=o/r}return t}function Kp(s){return s}function Er(s,t,e,n){if(!(0<=s&&s<=1&&0<=e&&e<=1))throw new Error("bezier x values must be in [0, 1] range");if(s===t&&e===n)return Kp;const i=Jp?new Float32Array(Bn):new Array(Bn);for(let o=0;o<Bn;++o)i[o]=Bs(o*Ns,s,e);function r(o){let a=0,h=1;const c=Bn-1;for(;h!==c&&i[h]<=o;++h)a+=Ns;--h;const u=(o-i[h])/(i[h+1]-i[h]),l=a+u*Ns,m=ac(l,s,e);return m>=jp?Qp(o,l,s,e):m===0?l:Zp(o,a,a+Ns,s,e)}return o=>o===0||o===1?o:Bs(r(o),t,n)}function Pr(s){switch(s){case"linear":return[0,0,1,1];case"ease":return[.25,.1,.25,1];case"ease-in":return[.42,0,1,1];case"ease-in-out":return[.42,0,.58,1];case"ease-out":return[0,0,.58,1]}}function hc(s){const[t,e,n,i]=Pr(s);return[1-n,1-i,1-t,1-e]}function tg(s){return Er(...Pr(s))}function eg(s){return Er(...hc(s))}const me={Utils:{Linear:function(s,t,e){return(t-s)*e+s},Factorial:function(){const s=[1];return function(t){let e=1;if(s[t])return s[t];for(let n=t;n>1;n--)e*=n;return s[t]=e,e}}(),Bernstein:function(s,t){const e=me.Utils.Factorial;return e(s)/e(t)/e(s-t)},CatmullRom:function(s,t,e,n,i){const r=(e-s)*.5,o=(n-t)*.5,a=i*i,h=i*a;return(2*t-2*e+r+o)*h+(-3*t+3*e-2*r-o)*a+r*i+t},QuadraticBezier:(s,t,e,n)=>{const i=1-n;return i*i*s+2*i*n*t+n*n*e},CubicBezier:(s,t,e,n,i)=>{const r=1-i;return r*r*r*s+3*r*r*i*t+3*r*i*i*e+i*i*i*n}},Linear:function(s,t){const e=s.length-1,n=e*t,i=Math.floor(n),r=me.Utils.Linear;return t<0?r(s[0],s[1],n):t>1?r(s[e],s[e-1],e-n):r(s[i],s[i+1>e?e:i+1],n-i)},Bezier:function(s,t){let e=0;const n=s.length-1,i=Math.pow,r=me.Utils.Bernstein;for(let o=0;o<=n;o++)e+=i(1-t,n-o)*i(t,o)*s[o]*r(n,o);return e},CatmullRom:function(s,t){const e=s.length-1;let n=e*t,i=Math.floor(n);const r=me.Utils.CatmullRom;return s[0]===s[e]?(t<0&&(i=Math.floor(n=e*(1+t))),r(s[(i-1+e)%e],s[i],s[(i+1)%e],s[(i+2)%e],n-i)):t<0?s[0]-(r(s[0],s[0],s[1],s[1],-n)-s[0]):t>1?s[e]-(r(s[e],s[e],s[e-1],s[e-1],n-e)-s[e]):r(s[i?i-1:0],s[i],s[e<i+1?e:i+1],s[e<i+2?e:i+2],n-i)}};class cc{_tweens={};_tweensAddedDuringUpdate={};getAll(){return Object.keys(this._tweens).map(t=>this._tweens[t])}removeAll(){this._tweens={}}add(t){this._tweens[t.getId()]=t,this._tweensAddedDuringUpdate[t.getId()]=t}remove(t){delete this._tweens[t.getId()],delete this._tweensAddedDuringUpdate[t.getId()]}update(t=ut(),e=!1){const n=Object.keys(this._tweens);for(let i=0;i<n.length;i++){const r=this._tweens[n[i]],o=!e;r&&r.update(t,o)===!1&&!e&&delete this._tweens[n[i]]}return!!Object.keys(this._tweens).length}}const Xt=new cc;class Mr{constructor(t,e=Xt){this._object=t,this._group=e}_id=Nn.nextId();_isPlaying=!1;_startTime=0;_delayTime=0;_durationTime=1e3;_isPaused=!1;_pauseStartTime=0;_initialRepeat=0;_repeat=0;_repeatDelayTime;_yoyo=!1;_reversed=!1;_valuesStart={};_valuesEnd={};_valuesStartRepeat={};_easingFunction=O.Linear.None;_interpolationFunction=me.Linear;_chainedTweens=[];_isChainStopped=!1;_onStartCallback;_onStartCallbackFired=!1;_onEveryStartCallback;_onEveryStartCallbackFired=!1;_onUpdateCallback;_onRepeatCallback;_onCompleteCallback;_onStopCallback;_goToEnd=!1;getId(){return this._id}isPlaying(){return this._isPlaying}isPaused(){return this._isPaused}to(t,e){return this._valuesEnd=Object.create(t),e!==void 0&&(this._durationTime=e),this}duration(t=1e3){return this._durationTime=t,this}start(t=ut()){if(this._isPlaying)return this;if(this._group&&this._group.add(this),this._repeat=this._initialRepeat,this._reversed){this._reversed=!1;for(const e in this._valuesStartRepeat)this._swapEndStartRepeatValues(e),this._valuesStart[e]=this._valuesStartRepeat[e]}return this._isPlaying=!0,this._isPaused=!1,this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._isChainStopped=!1,this._startTime=t,this._startTime+=this._delayTime,this._setupProperties(this._object,this._valuesStart,this._valuesEnd,this._valuesStartRepeat),this}_setupProperties(t,e,n,i){for(const r in n){const o=t[r],a=Array.isArray(o),h=a?"array":typeof o,c=!a&&Array.isArray(n[r]);if(!(h==="undefined"||h==="function")){if(c){let u=n[r];if(u.length===0)continue;u=u.map(this._handleRelativeValue.bind(this,o)),n[r]=[o].concat(u)}if((h==="object"||a)&&o&&!c){e[r]=a?[]:{};for(const u in o)e[r][u]=o[u];i[r]=a?[]:{},this._setupProperties(o,e[r],n[r],i[r])}else typeof e[r]>"u"&&(e[r]=o),a||(e[r]*=1),c?i[r]=n[r].slice().reverse():i[r]=e[r]||0}}}stop(){return this._isChainStopped||(this._isChainStopped=!0,this.stopChainedTweens()),this._isPlaying?(this._group&&this._group.remove(this),this._isPlaying=!1,this._isPaused=!1,this._onStopCallback&&this._onStopCallback(this._object),this):this}end(){return this._goToEnd=!0,this.update(1/0),this}pause(t=ut()){return this._isPaused||!this._isPlaying?this:(this._isPaused=!0,this._pauseStartTime=t,this._group&&this._group.remove(this),this)}resume(t=ut()){return!this._isPaused||!this._isPlaying?this:(this._isPaused=!1,this._startTime+=t-this._pauseStartTime,this._pauseStartTime=0,this._group&&this._group.add(this),this)}stopChainedTweens(){for(let t=0,e=this._chainedTweens.length;t<e;t++)this._chainedTweens[t].stop();return this}group(t=Xt){return this._group=t,this}delay(t=0){return this._delayTime=t,this}repeat(t=0){return this._initialRepeat=t,this._repeat=t,this}repeatDelay(t){return this._repeatDelayTime=t,this}yoyo(t=!1){return this._yoyo=t,this}easing(t=O.Linear.None){return this._easingFunction=t,this}interpolation(t=me.Linear){return this._interpolationFunction=t,this}chain(...t){return this._chainedTweens=t,this}onStart(t){return this._onStartCallback=t,this}onEveryStart(t){return this._onEveryStartCallback=t,this}onUpdate(t){return this._onUpdateCallback=t,this}onRepeat(t){return this._onRepeatCallback=t,this}onComplete(t){return this._onCompleteCallback=t,this}onStop(t){return this._onStopCallback=t,this}update(t=ut(),e=!0){if(this._isPaused)return!0;let n,i;const r=this._startTime+this._durationTime;if(!this._goToEnd&&!this._isPlaying){if(t>r)return!1;e&&this.start(t)}if(this._goToEnd=!1,t<this._startTime)return!0;this._onStartCallbackFired===!1&&(this._onStartCallback&&this._onStartCallback(this._object),this._onStartCallbackFired=!0),this._onEveryStartCallbackFired===!1&&(this._onEveryStartCallback&&this._onEveryStartCallback(this._object),this._onEveryStartCallbackFired=!0),i=(t-this._startTime)/this._durationTime,i=this._durationTime===0||i>1?1:i;const o=this._easingFunction(i);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,o),this._onUpdateCallback&&this._onUpdateCallback(this._object,i),i===1)if(this._repeat>0){isFinite(this._repeat)&&this._repeat--;for(n in this._valuesStartRepeat)!this._yoyo&&typeof this._valuesEnd[n]=="string"&&(this._valuesStartRepeat[n]=this._valuesStartRepeat[n]+parseFloat(this._valuesEnd[n])),this._yoyo&&this._swapEndStartRepeatValues(n),this._valuesStart[n]=this._valuesStartRepeat[n];return this._yoyo&&(this._reversed=!this._reversed),this._repeatDelayTime!==void 0?this._startTime=t+this._repeatDelayTime:this._startTime=t+this._delayTime,this._onRepeatCallback&&this._onRepeatCallback(this._object),this._onEveryStartCallbackFired=!1,!0}else{this._onCompleteCallback&&this._onCompleteCallback(this._object);for(let a=0,h=this._chainedTweens.length;a<h;a++)this._chainedTweens[a].start(this._startTime+this._durationTime);return this._isPlaying=!1,!1}return!0}_updateProperties(t,e,n,i){for(const r in n){if(e[r]===void 0)continue;const o=e[r]||0;let a=n[r];const h=Array.isArray(t[r]),c=Array.isArray(a);!h&&c?t[r]=this._interpolationFunction(a,i):typeof a=="object"&&a?this._updateProperties(t[r],o,a,i):(a=this._handleRelativeValue(o,a),typeof a=="number"&&(t[r]=o+(a-o)*i))}}_handleRelativeValue(t,e){return typeof e!="string"?e:e.charAt(0)==="+"||e.charAt(0)==="-"?t+parseFloat(e):parseFloat(e)}_swapEndStartRepeatValues(t){const e=this._valuesStartRepeat[t],n=this._valuesEnd[t];typeof n=="string"?this._valuesStartRepeat[t]=this._valuesStartRepeat[t]+parseFloat(n):this._valuesStartRepeat[t]=n,this._valuesEnd[t]=e}}const ng=Nn.nextId,sg=Xt.getAll.bind(Xt),ig=Xt.removeAll.bind(Xt),rg=Xt.add.bind(Xt),og=Xt.remove.bind(Xt),ag=Xt.update.bind(Xt),hg={now:ut,Sequence:Nn,Easing:O,Interpolation:me,Group:cc,Tween:Mr,nextId:ng,getAll:sg,removeAll:ig,add:rg,remove:og,update:ag};class Ar{autoStart;startTime;oldTime;elapsedTime;running;constructor(t=!0){this.autoStart=t,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=ut(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0}stop(){this.getElapsedTime(),this.running=!1,this.autoStart=!1}getElapsedTime(){return this.getDelta(),this.elapsedTime}getDelta(){let t=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){const e=ut();t=e-this.oldTime,this.oldTime=e,this.elapsedTime+=t}return t}}class Fn{tweens=[];frameDuration;onGroupStart;onGroupComplete;constructor(t){this.frameDuration=t?.frameDuration||1e3,this.onGroupStart=t?.onGroupStart,this.onGroupComplete=t?.onGroupComplete}get count(){return this.tweens.length}clear(){this.tweens=[]}sort(t=!1){Dl(this.tweens,(e,n)=>t?e.delay>n.delay:e.delay<=n.delay)}cloneTweens(t=this.tweens){const e=[];return t.forEach(n=>{const i={...n};delete i.tween,i.fromValues={...i.fromValues},i.toValues={...i.toValues},e.push(i)}),e}addTween(t,e,n){const i={fromValues:t,toValues:e,frames:typeof n?.frames=="number"?n.frames:1,delay:typeof n?.delay=="number"?n.delay:this.tweens.length,easeFunction:n?.easeFunction||O.Linear.None,interpolationFunction:n?.interpolationFunction||me.Linear,repeat:typeof n?.repeat=="number"?n.repeat:0,yoyo:n?.yoyo||!1,onStart:n?.onStart||(()=>{}),onUpdate:n?.onUpdate||(()=>{}),onComplete:n?.onComplete||(()=>{})};return this.tweens.push(i),this}cancelRequestAnimationCycle=()=>{};runTweens(t){this.cancelRequestAnimationCycle();const e=new Ar,n=this.frameDuration;return new Promise(i=>{this.onGroupStart?.(),this.cancelRequestAnimationCycle=br(r=>{if(!this.isPaused){const a=Math.max(0,r-this.pausedDuration),h=Math.max(0,e.getElapsedTime()-this.pausedDuration);t.filter(c=>c.delay*n<=h).forEach(c=>{c.tween||(c.tween=new Mr({...c.fromValues}).to({...c.toValues},c.frames*n).easing(c.easeFunction).interpolation(c.interpolationFunction).repeat(c.repeat).yoyo(c.yoyo).onStart(c.onStart).onUpdate(c.onUpdate).onComplete(c.onComplete),c.tween.start(a)),(c.delay+c.frames*(c.repeat+1))*n>h?c.tween.update(a):(c.tween.isPlaying()&&c.tween.end(),Ne(t,c))})}const o=!!t.length;return o||(this.onGroupComplete?.(),i()),o})})}isPaused=!1;pausedClock=new Ar;pausedDuration=0;play(t=this.cloneTweens(this.tweens)){this.isPaused=!1,this.pausedDuration=0,this.runTweens(t)}reverse(){const t=this.cloneTweens(this.tweens);let e=0;t.forEach(n=>{e=Math.max(e,n.delay+n.frames),n.easeFunction=sc(n.easeFunction);const i={...n.toValues};n.toValues={...n.fromValues},n.fromValues={...i}}),t.forEach(n=>{n.delay=e-n.frames}),this.play(t)}pause(){this.pausedClock.start(),this.isPaused=!0}resume(){this.pausedDuration+=this.pausedClock.getElapsedTime(),this.pausedClock.stop(),this.isPaused=!1}}const Fs=new cn;function kr(s){const t=Fs.getEntry((n,i)=>i.el==s);if(t)return t[1];const e=ni(s);return Fs.set(e.name,e),e}function Ir(s,t){const e=kr(s);e.alternate||(e.alternate=ni(s)),t(e.alternate)}const uc=()=>{Fs.update((s,t)=>{const e=t.alternate;return e?(si(t,e),t.alternate=void 0,Fs.set(e.name,e),!1):!0})};function cg(){uc()}function Dr(){nc(uc,{name:"FLUSH_VNODES",timeout:50})}function q(s){return s*Math.PI/180}function Et(s){return s*180/Math.PI}function pn(s,t,e=0){return Math.sqrt(s*s+t*t+e*e)}function Me(s,t,e,n){return pn(e-s,n-t)}function Jt(s,t,e,n){let i=Math.atan2(n-t,e-s);return i<0&&(i+=Math.PI*2),i}function Ae(s,t){return{dx:Math.cos(s)*t,dy:Math.sin(s)*t}}function ug(s,t,e){if(typeof e=="number"){const n=pn(s,t,e);return{x:s/=n,y:t/=n,z:e/=n}}else{const n=pn(s,t);return{x:s/=n,y:t/=n}}}function lg(s,t,e,n,i=10){if(Math.abs(e-s)<i&&Math.abs(n-t)<i)return"no";const r=Et(Jt(s,t,e,n));return r>=-135&&r<=-45?"up":r>45&&r<135?"down":r>=135&&r<=180||r>=-180&&r<-135?"left":"right"}const lc=fg("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 fg(s,t=10){const e={},n=s.split(",");for(let i=0;i<n.length;i+=2){const r="&"+n[i+1]+";",o=parseInt(n[i],t);e[r]="&#"+o+";"}return e["\\xa0"]="&#160;",e}function Pt(s,t){const e=Object.keys(t);for(let n=0;n<e.length;n++)s=s.replace(new RegExp("{"+e[n]+"}","gi"),""+t[e[n]]);return s}function Ys(s){let t,e;if(!s)throw new Error("cannot create a random attribute name for an undefined object");const n="ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz";t="";do for(t="",e=0;e<12;e++)t+=n[Math.floor(Math.random()*n.length)];while(s[t]);return t}function dg(s){const t={left:"start",right:"end",center:"middle",start:"start",end:"end"};return t[s]||t.start}function mg(s){const t={alphabetic:"alphabetic",hanging:"hanging",top:"text-before-edge",bottom:"text-after-edge",middle:"central"};return t[s]||t.alphabetic}const Yn={strokeStyle:{svgAttr:"stroke",canvas:"#000000",svg:"none",apply:"stroke"},fillStyle:{svgAttr:"fill",canvas:"#000000",svg:null,apply:"fill"},lineCap:{svgAttr:"stroke-linecap",canvas:"butt",svg:"butt",apply:"stroke"},lineJoin:{svgAttr:"stroke-linejoin",canvas:"miter",svg:"miter",apply:"stroke"},miterLimit:{svgAttr:"stroke-miterlimit",canvas:10,svg:4,apply:"stroke"},lineWidth:{svgAttr:"stroke-width",canvas:1,svg:1,apply:"stroke"},globalAlpha:{svgAttr:"opacity",canvas:1,svg:1,apply:"fill stroke"},font:{canvas:"10px sans-serif"},shadowColor:{canvas:"#000000"},shadowOffsetX:{canvas:0},shadowOffsetY:{canvas:0},shadowBlur:{canvas:0},textAlign:{canvas:"start"},textBaseline:{canvas:"alphabetic"},lineDash:{svgAttr:"stroke-dasharray",canvas:[],svg:null,apply:"stroke"},lineDashOffset:{svgAttr:"stroke-dashoffset",canvas:0,svg:0,apply:"stroke"}};let $s=class{__root;__ctx;constructor(t,e){this.__root=t,this.__ctx=e}addColorStop(t,e){const n=this.__ctx.__createElement("stop");if(n.setAttribute("offset",""+t),e.indexOf("rgba")!==-1){const r=/rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d?\.?\d*)\s*\)/gi.exec(e);r&&(n.setAttribute("stop-color",Pt("rgb({r},{g},{b})",{r:r[1],g:r[2],b:r[3]})),n.setAttribute("stop-opacity",r[4]))}else n.setAttribute("stop-color",e);this.__root.appendChild(n)}},Lr=class{__root;__ctx;constructor(t,e){this.__root=t,this.__ctx=e}},fc=class ha{__document=document;__canvas;__ctx;width;height;__styleStack;__groupStack;__rootSVG;__ids;__SVGdefs;__currentElement;__currentElementsToStyle=null;constructor({canvas:t,width:e=500,height:n=500}){t?(this.__canvas=t,this.__ctx=t.getContext("2d"),this.width=t.width,this.height=t.height):(this.__canvas=this.__document.createElement("canvas"),this.__ctx=this.__canvas.getContext("2d"),this.width=e,this.height=n),this.__setDefaultStyles(),this.__styleStack=[this.__getStyleState()],this.__groupStack=[],this.__rootSVG=this.__document.createElementNS("http://www.w3.org/2000/svg","svg"),this.__rootSVG.setAttribute("version","1.1"),this.__rootSVG.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.__rootSVG.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink","http://www.w3.org/1999/xlink"),this.__rootSVG.setAttribute("width",""+this.width),this.__rootSVG.setAttribute("height",""+this.height),this.__ids={},this.__SVGdefs=this.__document.createElementNS("http://www.w3.org/2000/svg","defs"),this.__rootSVG.appendChild(this.__SVGdefs),this.__currentElement=this.__document.createElementNS("http://www.w3.org/2000/svg","g"),this.__rootSVG.appendChild(this.__currentElement)}__setDefaultStyles(){const t=Object.keys(Yn);for(let e=0,n=t.length;e<n;e++){const i=t[e];this[i]=Yn[i].canvas}}__getStyleState(){const t={},e=Object.keys(Yn);for(let n=0,i=e.length;n<i;n++){const r=e[n];t[r]=this[r]}return t}__applyStyleState(t){const e=Object.keys(t);for(let n=0,i=e.length;n<i;n++){const r=e[n];this[r]=t[r]}}__createElement(t,e={},n=!1){const i=this.__document.createElementNS("http://www.w3.org/2000/svg",t),r=Object.keys(e);n&&(i.setAttribute("fill","none"),i.setAttribute("stroke","none"));for(let o=0;o<r.length;o++){const a=r[o];i.setAttribute(a,e[a])}return i}__applyStyleToCurrentElement(t){let e=this.__currentElement;const n=this.__currentElementsToStyle;n&&(e.setAttribute(t,""),e=n.element,n.children.forEach(r=>{r.setAttribute(t,"")}));const i=Object.keys(Yn);for(let r=0;r<i.length;r++){const o=Yn[i[r]],a=this[i[r]];if(o.apply){if(a instanceof Lr){if(a.__ctx)for(;a.__ctx.__SVGdefs.childNodes.length;){const h=a.__ctx.__SVGdefs.childNodes[0].getAttribute("id");this.__ids[h]=h,this.__SVGdefs.appendChild(a.__ctx.__SVGdefs.childNodes[0])}e.setAttribute(o.apply,Pt("url(#{id})",{id:a.__root.getAttribute("id")}))}else if(a instanceof $s)e.setAttribute(o.apply,Pt("url(#{id})",{id:a.__root.getAttribute("id")}));else if(o.apply.indexOf(t)!==-1&&o.svg!==a)if((o.svgAttr==="stroke"||o.svgAttr==="fill")&&a.indexOf("rgba")!==-1){const c=/rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d?\.?\d*)\s*\)/gi.exec(a);if(c){e.setAttribute(o.svgAttr,Pt("rgb({r},{g},{b})",{r:c[1],g:c[2],b:c[3]}));let u=parseFloat(c[4]);const l=this.globalAlpha;l!=null&&(u*=l),e.setAttribute(o.svgAttr+"-opacity",""+u)}}else{let h=o.svgAttr;if(i[r]==="globalAlpha"&&(h=t+"-"+o.svgAttr,e.getAttribute(h)))continue;h&&e.setAttribute(h,a)}}}}__closestGroupOrSvg(t){return t=t||this.__currentElement,t.nodeName==="g"||t.nodeName==="svg"?t:this.__closestGroupOrSvg(t.parentNode)}getSerializedSvg(t){let e=new XMLSerializer().serializeToString(this.__rootSVG);if(/xmlns="http:\/\/www\.w3\.org\/2000\/svg".+xmlns="http:\/\/www\.w3\.org\/2000\/svg/gi.test(e)&&(e=e.replace('xmlns="http://www.w3.org/2000/svg','xmlns:xlink="http://www.w3.org/1999/xlink')),t){const i=Object.keys(lc);for(let r=0,o=i.length;r<o;r++){const a=i[r],h=lc[a],c=new RegExp(a,"gi");c.test(e)&&(e=e.replace(c,h))}}return e}getSvg(){return this.__rootSVG}save(){const t=this.__createElement("g"),e=this.__closestGroupOrSvg();this.__groupStack.push(e),e.appendChild(t),this.__currentElement=t,this.__styleStack.push(this.__getStyleState())}restore(){this.__currentElementsToStyle=null;const t=this.__groupStack.pop();t?this.__currentElement=t:this.__currentElement=this.__rootSVG.childNodes[1];const e=this.__styleStack.pop();e&&this.__applyStyleState(e)}__addTransform(t){const e=this.__closestGroupOrSvg();if(e.childNodes.length>0){this.__currentElement.nodeName==="path"&&(this.__currentElementsToStyle||(this.__currentElementsToStyle={element:e,children:[]}),this.__currentElementsToStyle.children.push(this.__currentElement),this.__applyCurrentDefaultPath());const i=this.__createElement("g");e.appendChild(i),this.__currentElement=i}let n=this.__currentElement.getAttribute("transform");n?n+=" ":n="",n+=t,this.__currentElement.setAttribute("transform",n)}scale(t,e){e===void 0&&(e=t),this.__addTransform(Pt("scale({x},{y})",{x:t,y:e}))}rotate(t){const e=t*180/Math.PI;this.__addTransform(Pt("rotate({angle},{cx},{cy})",{angle:e,cx:0,cy:0}))}translate(t,e){this.__addTransform(Pt("translate({x},{y})",{x:t,y:e}))}transform(t,e,n,i,r,o){this.__addTransform(Pt("matrix({a},{b},{c},{d},{e},{f})",{a:t,b:e,c:n,d:i,e:r,f:o}))}beginPath(){this.__currentDefaultPath="",this.__currentPosition={};const t=this.__createElement("path",{},!0);this.__closestGroupOrSvg().appendChild(t),this.__currentElement=t}__applyCurrentDefaultPath(){const t=this.__currentElement;t.nodeName==="path"&&t.setAttribute("d",this.__currentDefaultPath)}__addPathCommand(t){this.__currentDefaultPath+=" ",this.__currentDefaultPath+=t}moveTo(t,e){this.__currentElement.nodeName!=="path"&&this.beginPath(),this.__currentPosition={x:t,y:e},this.__addPathCommand(Pt("M {x} {y}",this.__currentPosition))}closePath(){this.__currentDefaultPath&&this.__addPathCommand("Z")}lineTo(t,e){this.__currentPosition={x:t,y:e},this.__currentDefaultPath.indexOf("M")>-1?this.__addPathCommand(Pt("L {x} {y}",this.__currentPosition)):this.__addPathCommand(Pt("M {x} {y}",this.__currentPosition))}bezierCurveTo(t,e,n,i,r,o){this.__currentPosition={x:r,y:o},this.__addPathCommand(Pt("C {cp1x} {cp1y} {cp2x} {cp2y} {x} {y}",{cp1x:t,cp1y:e,cp2x:n,cp2y:i,x:r,y:o}))}quadraticCurveTo(t,e,n,i){this.__currentPosition={x:n,y:i},this.__addPathCommand(Pt("Q {cpx} {cpy} {x} {y}",{cpx:t,cpy:e,x:n,y:i}))}normalize(t){const e=Math.sqrt(t[0]*t[0]+t[1]*t[1]);return[t[0]/e,t[1]/e]}arcTo(t,e,n,i,r){const o=this.__currentPosition&&this.__currentPosition.x,a=this.__currentPosition&&this.__currentPosition.y;if(typeof o>"u"||typeof a>"u")return;if(r<0)throw new Error("IndexSizeError: The radius provided ("+r+") is negative.");if(o===t&&a===e||t===n&&e===i||r===0){this.lineTo(t,e);return}const h=this.normalize([o-t,a-e]),c=this.normalize([n-t,i-e]);if(h[0]*c[1]===h[1]*c[0]){this.lineTo(t,e);return}const u=h[0]*c[0]+h[1]*c[1],l=Math.acos(Math.abs(u)),m=this.normalize([h[0]+c[0],h[1]+c[1]]),f=r/Math.sin(l/2),p=t+f*m[0],y=e+f*m[1],v=[-h[1],h[0]],w=[c[1],-c[0]],_=function(E){const C=E[0];return E[1]>=0?Math.acos(C):-Math.acos(C)},x=_(v),b=_(w);this.lineTo(p+v[0]*r,y+v[1]*r),this.arc(p,y,r,x,b)}stroke(){this.__currentElement.nodeName==="path"&&this.__currentElement.setAttribute("paint-order","fill stroke markers"),this.__applyCurrentDefaultPath(),this.__applyStyleToCurrentElement("stroke")}fill(){this.__currentElement.nodeName==="path"&&this.__currentElement.setAttribute("paint-order","stroke fill markers"),this.__applyCurrentDefaultPath(),this.__applyStyleToCurrentElement("fill")}rect(t,e,n,i){this.__currentElement.nodeName!=="path"&&this.beginPath(),this.moveTo(t,e),this.lineTo(t+n,e),this.lineTo(t+n,e+i),this.lineTo(t,e+i),this.lineTo(t,e),this.closePath()}fillRect(t,e,n,i){const r=this.__createElement("rect",{x:t,y:e,width:n,height:i},!0);this.__closestGroupOrSvg().appendChild(r),this.__currentElement=r,this.__applyStyleToCurrentElement("fill")}strokeRect(t,e,n,i){const r=this.__createElement("rect",{x:t,y:e,width:n,height:i},!0);this.__closestGroupOrSvg().appendChild(r),this.__currentElement=r,this.__applyStyleToCurrentElement("stroke")}__clearCanvas(){const e=this.__closestGroupOrSvg().getAttribute("transform"),n=this.__rootSVG.childNodes[1],i=n.childNodes;for(let r=i.length-1;r>=0;r--)i[r]&&n.removeChild(i[r]);this.__currentElement=n,this.__groupStack=[],e&&this.__addTransform(e)}clearRect(t,e,n,i){if(t===0&&e===0&&n===this.width&&i===this.height){this.__clearCanvas();return}const r=this.__closestGroupOrSvg(),o=this.__createElement("rect",{x:t,y:e,width:n,height:i,fill:"#FFFFFF"},!0);r.appendChild(o)}createLinearGradient(t,e,n,i){const r=this.__createElement("linearGradient",{id:Ys(this.__ids),x1:t+"px",x2:n+"px",y1:e+"px",y2:i+"px",gradientUnits:"userSpaceOnUse"},!1);return this.__SVGdefs.appendChild(r),new $s(r,this)}createRadialGradient(t,e,n,i,r,o){const a=this.__createElement("radialGradient",{id:Ys(this.__ids),cx:i+"px",cy:r+"px",r:o+"px",fx:t+"px",fy:e+"px",gradientUnits:"userSpaceOnUse"},!1);return this.__SVGdefs.appendChild(a),new $s(a,this)}__parseFont(){const e=/^\s*(?=(?:(?:[-a-z]+\s*){0,2}(italic|oblique))?)(?=(?:(?:[-a-z]+\s*){0,2}(small-caps))?)(?=(?:(?:[-a-z]+\s*){0,2}(bold(?:er)?|lighter|[1-9]00))?)(?:(?:normal|\1|\2|\3)\s*){0,3}((?:xx?-)?(?:small|large)|medium|smaller|larger|[.\d]+(?:%|in|[cem]m|ex|p[CustomCanvasContext]))(?:\s*\/\s*(normal|[.\d]+(?:%|in|[cem]m|ex|p[CustomCanvasContext])))?\s*([-,'"\sa-z0-9]+?)\s*$/i.exec(this.font),n={style:e[1]||"normal",size:e[4]||"10px",family:e[6]||"sans-serif",weight:e[3]||"normal",decoration:e[2]||"normal",href:null};return this.__fontUnderline==="underline"&&(n.decoration="underline"),this.__fontHref&&(n.href=this.__fontHref),n}__wrapTextLink(t,e){if(t.href){const n=this.__createElement("a");return n.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",t.href),n.appendChild(e),n}return e}__applyText(t,e,n,i){const r=this.__parseFont(),o=this.__closestGroupOrSvg(),a=this.__createElement("text",{"font-family":r.family,"font-size":r.size,"font-style":r.style,"font-weight":r.weight,"text-decoration":r.decoration,x:e,y:n,"text-anchor":dg(this.textAlign),"dominant-baseline":mg(this.textBaseline)},!0);a.appendChild(this.__document.createTextNode(t)),this.__currentElement=a,this.__applyStyleToCurrentElement(i),o.appendChild(this.__wrapTextLink(r,a))}fillText(t,e,n){this.__applyText(t,e,n,"fill")}strokeText(t,e,n){this.__applyText(t,e,n,"stroke")}measureText(t){return this.__ctx.font=this.font,this.__ctx.measureText(t)}arc(t,e,n,i,r,o){if(i===r)return;i=i%(2*Math.PI),r=r%(2*Math.PI),i===r&&(r=(r+2*Math.PI-.001*(o?-1:1))%(2*Math.PI));const a=t+n*Math.cos(r),h=e+n*Math.sin(r),c=t+n*Math.cos(i),u=e+n*Math.sin(i),l=o?0:1;let m=0,f=r-i;f<0&&(f+=2*Math.PI),o?m=f>Math.PI?0:1:m=f>Math.PI?1:0,this.lineTo(c,u),this.__addPathCommand(Pt("A {rx} {ry} {xAxisRotation} {largeArcFlag} {sweepFlag} {endX} {endY}",{rx:n,ry:n,xAxisRotation:0,largeArcFlag:m,sweepFlag:l,endX:a,endY:h})),this.__currentPosition={x:a,y:h}}clip(){const t=this.__closestGroupOrSvg(),e=this.__createElement("clipPath"),n=Ys(this.__ids),i=this.__createElement("g");this.__applyCurrentDefaultPath(),t.removeChild(this.__currentElement),e.setAttribute("id",n),e.appendChild(this.__currentElement),this.__SVGdefs.appendChild(e),t.setAttribute("clip-path",Pt("url(#{id})",{id:n})),t.appendChild(i),this.__currentElement=i}drawImage(...t){let e=t[0],n,i,r,o,a=0,h=0,c,u,l,m,f,p,y,v;if(t.length===3)n=t[1],i=t[2],c=e.width,u=e.height,r=c,o=u;else if(t.length===5)n=t[1],i=t[2],r=t[3],o=t[4],c=e.width,u=e.height;else if(t.length===9)a=t[1],h=t[2],c=t[3],u=t[4],n=t[5],i=t[6],r=t[7],o=t[8];else throw new Error("Invalid number of arguments passed to drawImage: "+arguments.length);const w=this.__closestGroupOrSvg();this.__currentElement;const _="translate("+n+", "+i+")";if(e instanceof ha){if(l=e.getSvg().cloneNode(!0),l.childNodes&&l.childNodes.length>1){for(m=l.childNodes[0];m.childNodes.length;)v=m.childNodes[0].getAttribute("id"),this.__ids[v]=v,this.__SVGdefs.appendChild(m.childNodes[0]);if(f=l.childNodes[1],f){const x=f.getAttribute("transform");let b;x?b=x+" "+_:b=_,f.setAttribute("transform",b),w.appendChild(f)}}}else(e.nodeName==="CANVAS"||e.nodeName==="IMG")&&(p=this.__createElement("image"),p.setAttribute("width",r),p.setAttribute("height",o),p.setAttribute("preserveAspectRatio","none"),(a||h||c!==e.width||u!==e.height)&&(y=this.__document.createElement("canvas"),y.width=r,y.height=o,y.getContext("2d")?.drawImage(e,a,h,c,u,0,0,r,o),e=y),p.setAttribute("transform",_),p.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",e.nodeName==="CANVAS"?e.toDataURL():e.getAttribute("src")),w.appendChild(p))}createPattern(t,e){const n=this.__document.createElementNS("http://www.w3.org/2000/svg","pattern"),i=Ys(this.__ids);let r;return n.setAttribute("id",i),t.nodeName==="CANVAS"||t.nodeName==="IMG"?(r=this.__document.createElementNS("http://www.w3.org/2000/svg","image"),r.setAttribute("width",""+t.width),r.setAttribute("height",""+t.height),r.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",t.nodeName==="CANVAS"?t.toDataURL():t.getAttribute("src")),n.appendChild(r),this.__SVGdefs.appendChild(n)):t instanceof ha&&(n.setAttribute("width",""+t.width),n.setAttribute("height",""+t.height),n.appendChild(t.__rootSVG.childNodes[1]),this.__SVGdefs.appendChild(n)),new Lr(n,this)}setLineDash(t){t&&t.length>0?this.lineDash=t.join(","):this.lineDash=null}drawFocusRing(){}createImageData(){}getImageData(){}putImageData(){}globalCompositeOperation(){}setTransform(){}},Rr=class{canvas;context;customContext;currentPath2D=new Path2D;path2Ds=[];currentMatrix=new DOMMatrix;hasSetCustomStrokeStyle=!1;hasSetCustomFillStyle=!1;constructor(t,e,n,i=!1){this.canvas=t,this.context=t.getContext("2d",{willReadFrequently:!0}),i&&(this.customContext=new fc({canvas:this.canvas,width:e||this.canvas.width,height:n||this.canvas.height}))}set lineWidth(t){this.hasSetCustomStrokeStyle=!0,this.context.lineWidth=t,this.customContext&&(this.customContext.lineWidth=t)}get lineWidth(){return this.context.lineWidth}set lineCap(t){this.hasSetCustomStrokeStyle=!0,this.context.lineCap=t,this.customContext&&(this.customContext.lineCap=t)}get lineCap(){return this.context.lineCap}set lineJoin(t){this.hasSetCustomStrokeStyle=!0,this.context.lineJoin=t,this.customContext&&(this.customContext.lineCap=t)}get lineJoin(){return this.context.lineJoin}set lineDashOffset(t){this.hasSetCustomStrokeStyle=!0,this.context.lineDashOffset=t,this.customContext&&(this.customContext.lineDashOffset=t)}get lineDashOffset(){return this.context.lineDashOffset}set miterLimit(t){this.hasSetCustomStrokeStyle=!0,this.context.miterLimit=t,this.customContext&&(this.customContext.miterLimit=t)}get miterLimit(){return this.context.miterLimit}set globalAlpha(t){this.context.globalAlpha=t,this.customContext&&(this.customContext.globalAlpha=t)}get globalAlpha(){return this.context.globalAlpha}set fillStyle(t){this.hasSetCustomFillStyle=!0,typeof t=="string"||t instanceof CanvasGradient||t instanceof CanvasPattern?(this.context.fillStyle=t,this.customContext&&(this.customContext.fillStyle=t)):(this.context.fillStyle=t.gradient,this.customContext&&(this.customContext.fillStyle=t.gradientCustom))}get fillStyle(){return this.context.fillStyle}set strokeStyle(t){this.hasSetCustomStrokeStyle=!0,typeof t=="string"||t instanceof CanvasGradient||t instanceof CanvasPattern?(this.context.strokeStyle=t,this.customContext&&(this.customContext.strokeStyle=t)):(this.context.strokeStyle=t.gradient,this.customContext&&(this.customContext.strokeStyle=t.gradientCustom))}get strokeStyle(){return this.context.strokeStyle}set font(t){this.context.font=t,this.customContext&&(this.customContext.font=t)}get font(){return this.context.font}set textBaseline(t){this.context.textBaseline=t,this.customContext&&(this.customContext.textBaseline=t)}get textBaseline(){return this.context.textBaseline}set textAlign(t){this.context.textAlign=t,this.customContext&&(this.customContext.textAlign=t)}get textAlign(){return this.context.textAlign}fill(t){return t?this.context.fill(t):(this.context.fill(),this.customContext&&this.customContext.fill()),this}fillRect(t,e,n,i){return this.context.fillRect(t,e,n,i),this.customContext&&this.customContext.fillRect(t,e,n,i),this}fillText(t,e,n,i){return this.hasSetCustomFillStyle=!1,this.context.fillText(t,e,n,i),this.customContext&&this.customContext.fillText(t,e,n),this}setLineDash(t){return this.context.setLineDash(t),this.customContext&&this.customContext.setLineDash(t),this}stroke(t){return t?this.context.stroke(t):(this.context.stroke(),this.customContext&&this.customContext.stroke()),this}strokeText(t,e,n,i){return this.context.strokeText(t,e,n,i),this.customContext&&this.customContext.strokeText(t,e,n),this}strokeRect(t,e,n,i){return this.context.strokeRect(t,e,n,i),this.customContext&&this.customContext.strokeRect(t,e,n,i),this}measureText(t){return this.context.measureText(t)}clearRect(t=0,e=0,n=this.canvas.width,i=this.canvas.height){return this.context.clearRect(t,e,n,i),this.customContext&&this.customContext.clearRect(t,e,n,i),this}save(){return this.context.save(),this.customContext&&this.customContext.save(),this.currentMatrix=new DOMMatrix,this.path2Ds.push(this.currentPath2D),this.currentPath2D=new Path2D,this}restore(){return this.context.restore(),this.customContext&&this.customContext.restore(),this.hasSetCustomStrokeStyle=!1,this.hasSetCustomFillStyle=!1,this.currentMatrix=new DOMMatrix,this.currentPath2D=this.path2Ds.pop()||new Path2D,this}beginPath(){return this.context.beginPath(),this.customContext&&this.customContext.beginPath(),this}closePath(){return this.context.closePath(),this.customContext&&this.customContext.closePath(),this.currentPath2D.closePath(),this}changePath2D(t=this.currentPath2D,e=this.currentMatrix){const n=new Path2D;n.addPath(t,e),this.currentPath2D=n}isPointInStroke(...t){return t[0]instanceof Path2D?this.context.isPointInStroke(t[0],t[1],t[2]):this.context.isPointInStroke(t[0],t[1])}isPointInPath(...t){return t[0]instanceof Path2D?this.context.isPointInPath(t[0],t[1],t[2]):this.context.isPointInPath(t[0],t[1])}translate(t,e){return this.context.translate(t,e),this.customContext&&this.customContext.translate(t,e),this.currentMatrix.translate(t,e),this.changePath2D(),this}rotate(t,e=0,n=0){return this.translate(e,n),this.context.rotate(t),this.customContext&&this.customContext.rotate(t),this.currentMatrix.rotate(t),this.translate(-e,-n),this.changePath2D(),this}scale(t,e=t,n=0,i=0){return this.translate(n,i),this.context.scale(t,e),this.customContext&&this.customContext.scale(t,e),this.currentMatrix.scale(t,e),this.translate(-n,-i),this.changePath2D(),this}moveTo(t,e){return this.context.moveTo(t,e),this.customContext&&this.customContext.moveTo(t,e),this.currentPath2D.moveTo(t,e),this}lineTo(t,e){return this.context.lineTo(t,e),this.customContext&&this.customContext.lineTo(t,e),this.currentPath2D.lineTo(t,e),this}arc(t,e,n,i,r,o){return this.context.arc(t,e,n,i,r,o),this.customContext&&this.customContext.arc(t,e,n,i,r,o?-1:1),this.currentPath2D.arc(t,e,n,i,r,o),this}arcTo(t,e,n,i,r){return this.context.arcTo(t,e,n,i,r),this.customContext&&this.customContext.arcTo(t,e,n,i,r),this.currentPath2D.arcTo(t,e,n,i,r),this}ellipse(t,e,n,i,r,o,a,h){return this.context.ellipse(t,e,n,i,r,o,a,h),this.currentPath2D.ellipse(t,e,n,i,r,o,a,h),this}quadraticCurveTo(t,e,n,i){return this.context.quadraticCurveTo(t,e,n,i),this.customContext&&this.customContext.quadraticCurveTo(t,e,n,i),this.currentPath2D.quadraticCurveTo(t,e,n,i),this}bezierCurveTo(t,e,n,i,r,o){return this.context.bezierCurveTo(t,e,n,i,r,o),this.customContext&&this.customContext.bezierCurveTo(t,e,n,i,r,o),this.currentPath2D.bezierCurveTo(t,e,n,i,r,o),this}rect(t,e,n,i){return this.context.rect(t,e,n,i),this.customContext&&this.customContext.rect(t,e,n,i),this.currentPath2D.rect(t,e,n,i),this}createLinearGradient(t,e,n,i,r){const o=this.context.createLinearGradient(t,e,n,i);return r&&Object.entries(r).forEach(([a,h])=>{o.addColorStop(parseFloat(a),h)}),o}createRadialGradient(t,e,n,i,r,o,a){const h=this.context.createRadialGradient(t,e,n,i,r,o);return a&&Object.entries(a).forEach(([c,u])=>{h.addColorStop(parseFloat(c),u)}),h}drawImage(t,...e){if(e.length===0)this.context.drawImage(t,0,0);else if(e.length===2){const n=e[0],i=e[1];this.context.drawImage(t,n,i)}else if(e.length===4){const n=e[0],i=e[1],r=e[2],o=e[3];this.context.drawImage(t,n,i,r,o)}else if(e.length===8){const n=e[0],i=e[1],r=e[2],o=e[3],a=e[4],h=e[5],c=e[6],u=e[7];this.context.drawImage(t,n,i,r,o,a,h,c,u)}else throw new Error("Invalid number of arguments passed to drawImage: "+e.length);return this.customContext&&this.customContext.drawImage(t,...e),this}getImageData(t=0,e=0,n=this.canvas.width,i=this.canvas.height,r){return this.context.getImageData(t,e,n,i,r)}putImageData(t,e=0,n=0){return this.context.putImageData(t,e,n)}createPattern(t,e){return this.context.createPattern(t,e)}toRawSVG(){if(this.customContext){const t=this.customContext.getSerializedSvg(!0),e=this.customContext.getSvg();return{raw:t,element:e}}else return{raw:"",element:null}}},Or=class{x;y;toX;toY;constructor(t){this.x=t?.x||0,this.y=t?.y||0,this.toX=t?.toX||0,this.toY=t?.toY||0}toSVGPathData(){return[["L",this.toX,this.toY]]}toCanvasContext(t){t.lineTo(this.toX,this.toY)}getBoundingClientRect(){const t=Jt(this.x,this.y,this.toX,this.toY);if(t===0){const e=Math.min(this.x,this.toX),n=Math.min(this.y,this.toY),i=Math.max(this.x,this.toX),r=Math.max(this.y,this.toY);return{x:e,y:n,width:i-e,height:r-n}}else{const e=Math.sin(t),n=Math.cos(t),i=n*this.x-e*this.y,r=n*this.toX-e*this.toY,o=n*this.y+e*this.x,a=n*this.toY+e*this.toX;return{x:Math.min(i,r),y:Math.min(o,a),width:Math.max(i,r)-Math.min(i,r),height:Math.max(o,a)-Math.min(o,a)}}}interpolate(t){return{x:this.x+t*(this.toX-this.x),y:this.y+t*(this.toY-this.y)}}intersection(t){const e=this.x,n=this.y,i=t.toX,r=t.toY,o=this.toX-e,a=t.x-i;if(!o&&!a)return null;const h=(this.toY-n)/o,c=(t.y-r)/a;if(o){if(!a)return{x:i,y:h*(i-e)+n}}else return{x:e,y:c*(e-i)+r};const u=(-c*i+r+h*e-n)/(h-c),l=h*(u-e)+n;return isNaN(u)||isNaN(l)?null:{x:u,y:l}}};const pg=class extends Or{rx;ry;xAxisRotate;largeArcFlag;sweepFlag;constructor(t){super(t),this.rx=t.rx,this.ry=t.ry,this.xAxisRotate=t?.xAxisRotate??0,this.largeArcFlag=t?.largeArcFlag??1,this.sweepFlag=t?.sweepFlag??1,this.toX=t.toX,this.toY=t.toY}toSVGPathData(){return[["A",this.rx,this.ry,this.xAxisRotate,this.largeArcFlag,this.sweepFlag,this.toX,this.toY]]}toCanvasContext(t){const[e,n,i,r,o,a,h]=this.convert(this.x,this.y,this.toX,this.toY,this.rx,this.ry,this.xAxisRotate,this.largeArcFlag,this.sweepFlag);t.ellipse(e,n,i,r,o,a,h,!this.sweepFlag)}convert(t,e,n,i,r,o,a,h,c){const u=a/180*Math.PI,l=(t-n)/2,m=(e-i)/2,f=Math.cos(u)*l+Math.sin(u)*m,p=-Math.sin(u)*l+Math.cos(u)*m,y=f*f/(r*r)+p*p/(o*o);if(y>1){const G=Math.sqrt(y);throw r=G*r,o=G*o,new Error(`Radii are too small to build an arc. Correcting them to ${r}/${o}.`)}const v=Math.sqrt((r*r*o*o-r*r*p*p-o*o*f*f)/(r*r*p*p+o*o*f*f)),w=h!=c?1:-1,_=w*v*r*p/o,x=w*v*-o*f/r,b=(t+n)/2,E=(e+i)/2,C=Math.cos(u)*_-Math.sin(u)*x+b,L=Math.sin(u)*_+Math.cos(u)*x+E,B=(G,J,st,K)=>(G*K>=J*st?1:-1)*Math.acos((G*st+J*K)/(Math.sqrt(G*G+J*J)*Math.sqrt(st*st+K*K))),F=B(1,0,t-C,e-L)-u,U=B(t-C,e-L,n-C,i-L);return[C,L,r,o,u,F,F+U]}},gg=class extends Or{cx;cy;isLineThrough;constructor(t){super(t),this.cx=t.cx,this.cy=t.cy,this.isLineThrough=typeof t.isLineThrough=="boolean"?t.isLineThrough:!1}toSVGPathData(){if(this.isLineThrough){const t=this.cx*2-(this.x+this.toX)/2,e=this.cy*2-(this.y+this.toY)/2;return[["Q",t,e,this.toX,this.toY]]}else return[["Q",this.cx,this.cy,this.toX,this.toY]]}toCanvasContext(t){if(this.isLineThrough){const e=this.cx*2-(this.x+this.toX)/2,n=this.cy*2-(this.y+this.toY)/2;t.quadraticCurveTo(e,n,this.toX,this.toY)}else t.quadraticCurveTo(this.cx,this.cy,this.toX,this.toY)}getBoundingClientRect(){const t=[this.x,this.toX],e=[this.y,this.toY];let n,i,r,o;for(let c=0;c<2;++c)n=c==0?this.x-2*this.cx+this.toX:this.y-2*this.cy+this.toY,i=c==0?-2*this.x+2*this.cx:-2*this.y+2*this.cy,r=c==0?this.x:this.y,Math.abs(n)>1e-12&&(o=-i/(2*n),0<o&&o<1&&[t,e][c].push(n*o*o+i*o+r));const a={x:Math.min.apply(0,t),y:Math.min.apply(0,e)},h={x:Math.max.apply(0,t),y:Math.max.apply(0,e)};return{x:a.x,y:a.y,width:h.x-a.x,height:h.y-a.y}}interpolate(t){return{x:(1-t)*(1-t)*this.x+2*(1-t)*t*this.cx+t*t*this.toX,y:(1-t)*(1-t)*this.y+2*(1-t)*t*this.cy+t*t*this.toY}}},ke=class hs extends Or{c1x;c1y;c2x;c2y;constructor(t){super(t),this.c1x=t.c1x,this.c1y=t.c1y,this.c2x=t.c2x,this.c2y=t.c2y}toSVGPathData(){return[["C",this.c1x,this.c1y,this.c2x,this.c2y,this.toX,this.toY]]}toCanvasContext(t){t.bezierCurveTo(this.c1x,this.c1y,this.c2x,this.c2y,this.toX,this.toY)}getBoundingClientRect(){let t=this.c2x-2*this.c1x+this.x-(this.toX-2*this.c2x+this.c1x),e=2*(this.c1x-this.x)-2*(this.c2x-this.c1x),n=this.x-this.c1x,i=(-e+Math.sqrt(e*e-4*t*n))/2/t,r=(-e-Math.sqrt(e*e-4*t*n))/2/t;const o=[this.y,this.toY],a=[this.x,this.toX];let h;const c=[];Math.abs(i)>1e12&&(i=.5),Math.abs(r)>1e12&&(r=.5),i>=0&&i<=1&&(h=this.interpolate(i),a.push(h.x),o.push(h.y),c.push({X:h.x,Y:h.y})),r>=0&&r<=1&&(h=this.interpolate(r),a.push(h.x),o.push(h.y),c.push({X:h.x,Y:h.y})),t=this.c2y-2*this.c1y+this.y-(this.toY-2*this.c2y+this.c1y),e=2*(this.c1y-this.y)-2*(this.c2y-this.c1y),n=this.y-this.c1y,i=(-e+Math.sqrt(e*e-4*t*n))/2/t,r=(-e-Math.sqrt(e*e-4*t*n))/2/t,Math.abs(i)>1e12&&(i=.5),Math.abs(r)>1e12&&(r=.5),i>=0&&i<=1&&(h=this.interpolate(i),a.push(h.x),o.push(h.y),c.push({X:h.x,Y:h.y})),r>=0&&r<=1&&(h=this.interpolate(r),a.push(h.x),o.push(h.y),c.push({X:h.x,Y:h.y}));const u=[],l=c.length;for(let p=0;p<l;p++){for(let y=p+1;y<l;y++)c[p].X===c[y].X&&c[p].Y===c[y].Y&&(y=++p);u.push({X:c[p].X,Y:c[p].Y})}const m={x:Math.min.apply(Math,a),y:Math.min.apply(Math,o)},f={x:Math.max.apply(Math,a),y:Math.max.apply(Math,o)};return{x:m.x,y:m.y,width:f.x-m.x,height:f.y-m.y,dots:u}}interpolate(t){return{x:Math.pow(1-t,3)*this.x+3*Math.pow(1-t,2)*t*this.c1x+3*Math.pow(1-t,1)*Math.pow(t,2)*this.c2x+Math.pow(t,3)*this.toX,y:Math.pow(1-t,3)*this.y+3*Math.pow(1-t,2)*t*this.c1y+3*Math.pow(1-t,1)*Math.pow(t,2)*this.c2y+Math.pow(t,3)*this.toY}}static base3(t,e,n,i,r){const o=-3*e+9*n-9*i+3*r,a=t*o+6*e-12*n+6*i;return t*a-3*e+3*n}static bezlen(t,e,n,i,r,o,a,h,c=1){c=Math.max(0,Math.min(c,1));const u=c/2,l=[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816],m=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472];let f=0;for(let p=0;p<12;p++){const y=u*l[p]+u,v=this.base3(y,t,n,r,a),w=this.base3(y,e,i,o,h);f+=m[p]*Math.sqrt(v*v+w*w)}return u*f}length(t=1){return hs.bezlen(this.x,this.y,this.c1x,this.c1y,this.c2x,this.c2y,this.toX,this.toY,t)}getTatLen(t){const e=this.x,n=this.y,i=this.c1x,r=this.c1y,o=this.c2x,a=this.c2y,h=this.toX,c=this.toY;if(t<0||hs.bezlen(e,n,i,r,o,a,h,c)<t)return 0;const u=1;let l=u/2,m=u-l,f=hs.bezlen(e,n,i,r,o,a,h,c,m);for(;Math.abs(f-t)>.01;)l/=2,m+=(f<t?1:-1)*l,f=hs.bezlen(e,n,i,r,o,a,h,c,m);return m}getPointAtSegmentLength(t){const e=this.getTatLen(t),n=1-e,i=Math.pow(n,3),r=Math.pow(n,2),o=e*e,a=o*e,h=i*this.x+r*3*e*this.c1x+n*3*e*e*this.c2x+a*this.toX,c=i*this.y+r*3*e*this.c1y+n*3*e*e*this.c2y+a*this.toY,u=this.x+2*e*(this.c1x-this.x)+o*(this.c2x-2*this.c1x+this.x),l=this.y+2*e*(this.c1y-this.y)+o*(this.c2y-2*this.c1y+this.y),m=this.c1x+2*e*(this.c2x-this.c1x)+o*(this.toX-2*this.c2x+this.c1x),f=this.c1y+2*e*(this.c2y-this.c1y)+o*(this.toY-2*this.c2y+this.c1y),p=n*this.x+e*this.c1x,y=n*this.y+e*this.c1y,v=n*this.c2x+e*this.toX,w=n*this.c2y+e*this.toY,_=90-Math.atan2(u-m,l-f)*180/Math.PI;return{x:h,y:c,m:{x:u,y:l},n:{x:m,y:f},start:{x:p,y},end:{x:v,y:w},alpha:_}}},$n=Math.PI*2;function dc(s,t,e,n){const i=s*n-t*e<0?-1:1;let r=s*e+t*n;return r>1&&(r=1),r<-1&&(r=-1),i*Math.acos(r)}function yg(s,t,e,n,i,r,o,a,h,c){const u=c*(s-e)/2+h*(t-n)/2,l=-h*(s-e)/2+c*(t-n)/2,m=o*o,f=a*a,p=u*u,y=l*l;let v=m*f-m*y-f*p;v<0&&(v=0),v/=m*y+f*p,v=Math.sqrt(v)*(i===r?-1:1);const w=v*o/a*l,_=v*-a/o*u,x=c*w-h*_+(s+e)/2,b=h*w+c*_+(t+n)/2,E=(u-w)/o,C=(l-_)/a,L=(-u-w)/o,B=(-l-_)/a,F=dc(1,0,E,C);let U=dc(E,C,L,B);return r===0&&U>0&&(U-=$n),r===1&&U<0&&(U+=$n),[x,b,F,U]}function wg(s,t){const e=1.3333333333333333*Math.tan(t/4),n=Math.cos(s),i=Math.sin(s),r=Math.cos(s+t),o=Math.sin(s+t);return[n,i,n-i*e,i+n*e,r+o*e,o-r*e,r,o]}function mc(s,t,e,n,i,r,o,a,h){const c=Math.sin(h*$n/360),u=Math.cos(h*$n/360),l=u*(s-e)/2+c*(t-n)/2,m=-c*(s-e)/2+u*(t-n)/2;if(l===0&&m===0)return[];if(o===0||a===0)return[];o=Math.abs(o),a=Math.abs(a);const f=l*l/(o*o)+m*m/(a*a);f>1&&(o*=Math.sqrt(f),a*=Math.sqrt(f));const p=yg(s,t,e,n,i,r,o,a,c,u),y=[];let v=p[2],w=p[3];const _=Math.max(Math.ceil(Math.abs(w)/($n/4)),1);w/=_;for(let x=0;x<_;x++)y.push(wg(v,w)),v+=w;return y.map(x=>{for(let b=0;b<x.length;b+=2){let E=x[b+0],C=x[b+1];E*=o,C*=a;const L=u*E-c*C,B=c*E+u*C;x[b+0]=L+p[0],x[b+1]=B+p[1]}return x})}function zr(s,t,e,n,i,r){return[s/3+.6666666666666666*e,t/3+.6666666666666666*n,i/3+.6666666666666666*e,r/3+.6666666666666666*n,i,r]}function Xn(s,t,e,n){return[s,t,e,n,e,n]}const Un={a:7,c:6,s:4,q:4,t:2,m:2,l:2,h:1,v:1,z:0};class Ge{static createSVGElement(t="path",e){const n=document.createElementNS.call(document,"http://www.w3.org/2000/svg",t);return e&&je(n,e),n}static createSvgPath(t,e){return this.createSVGElement("path",{d:t,id:e||on()})}static downloadFromSVGElement(t,e="shape"){return js(nr(t),`${e}.svg`)}static downloadFromSVGString(t,e="shape"){return js(Ti(t),`${e}.svg`)}static getSVGRawStringFromElement(t){return er(t)}static isSVGPath(t){return typeof t!="string"?!1:(t=t.trim(),/^[mlhvzaqtcs]\s*[-+.0-9][^mlhvzaqtcs]+/i.test(t)&&/[\dz]$/i.test(t))}static SVGPathDataToD(t){return t.map(e=>{if(!e[0])return"";switch(e[0].toLowerCase()){case"a":return`${e[0]} ${e[1]},${e[2]} ${e[3]} ${e[4]},${e[5]} ${e[6]},${e[7]}`;case"c":return`${e[0]} ${e[1]},${e[2]} ${e[3]},${e[4]} ${e[5]},${e[6]}`;case"s":case"q":return`${e[0]} ${e[1]},${e[2]} ${e[3]},${e[4]}`;default:return e[0]+" "+e.slice(1).join(",")}}).join(" ")}static parseSVGPath(t){const e=[];return Ge.isSVGPath(t)&&t.replace(/([mlhvzaqtcs])([^mlhvzaqtcs]*)/gi,(n,i,r)=>{let o=i.toLowerCase();const a=Ci(r);for(o=="m"&&a.length>Un[o]&&(e.push([i,...a.splice(0,Un[o])]),o="l",i=i=="m"?"l":"L");a.length;){if(a.length<Un[o])throw new Error(`parseSVGPath substring:{ ${n} } command:{ ${i} } args:{ ${a} }`);e.push([i,...a.splice(0,Un[o])])}return o=="z"&&e.push([i]),""}),e}static absolutizeSVGPath(t){let e=0,n=0,i=0,r=0;return t.map(function(o){const a=o[0],h=a.toUpperCase();if(a!=h)switch(o[0]=h,a){case"a":o[6]+=i,o[7]+=r;break;case"v":o[1]+=r;break;case"h":o[1]+=i;break;default:for(let c=1;c<o.length;)o[c++]+=i,o[c++]+=r}switch(h){case"Z":i=e,r=n;break;case"H":i=o[1];break;case"V":r=o[1];break;case"M":i=e=o[1],r=n=o[2];break;default:i=o[o.length-2],r=o[o.length-1]}return o})}static relativeSVGPath(t){let e=0,n=0,i=0,r=0;return t.map(function(o){const a=o[0],h=a.toLowerCase();if(a!=h)switch(o[0]=h,a){case"A":o[6]-=i,o[7]-=r;break;case"V":o[1]-=r;break;case"H":o[1]-=i;break;default:for(let c=1;c<o.length;)o[c++]-=i,o[c++]-=r}switch(h){case"z":i=e,r=n;break;case"h":i+=o[1];break;case"v":r+=o[1];break;case"m":i+=o[1],r+=o[2],e+=o[1],n+=o[2];break;default:i+=o[o.length-2],r+=o[o.length-1]}return o})}static normalizeSVGPath(t){const e=[];let n=0,i=0,r=0,o=0,a=0,h=0,c=0,u=0,l;for(let m=0,f=t.length;m<f;m++){let p=t[m];const y=p[0];switch(y){case"M":n=p[1],i=p[2];break;case"A":const v=mc(r,o,p[6],p[7],p[4],p[5],p[1],p[2],p[3]);if(!v.length)continue;v.forEach((x,b)=>{const[E,C,L,B,F,U,G,J]=x;p=["C",L,B,F,U,G,J],b<v.length-1&&e.push(p)});break;case"S":let w=r,_=o;(l=="C"||l=="S")&&(w+=w-c,_+=_-u),p=["C",w,_,p[1],p[2],p[3],p[4]];break;case"T":l=="Q"||l=="T"?(a=r*2-a,h=o*2-h):(a=r,h=o),p=["C",...zr(r,o,a,h,p[1],p[2])];break;case"Q":a=p[1],h=p[2],p=["C",...zr(r,o,p[1],p[2],p[3],p[4])];break;case"L":p=["C",...Xn(r,o,p[1],p[2])];break;case"H":p=["C",...Xn(r,o,p[1],o)];break;case"V":p=["C",...Xn(r,o,r,p[1])];break;case"Z":p=["C",...Xn(r,o,n,i)];break}l=y,r=p[p.length-2],o=p[p.length-1],p.length>4?(c=p[p.length-4],u=p[p.length-3]):(c=r,u=o),e.push(p)}return e}static catmullRom2bezier(t){const e=[];for(let n=0,i=t.length;i-2>n;n+=2){let r;n==0?r=[{x:t[n],y:t[n+1]},{x:t[n],y:t[n+1]},{x:t[n+2],y:t[n+3]},{x:t[n+4],y:t[n+5]}]:i-4==n?r=[{x:t[n-2],y:t[n-1]},{x:t[n],y:t[n+1]},{x:t[n+2],y:t[n+3]},{x:t[n+2],y:t[n+3]}]:r=[{x:t[n-2],y:t[n-1]},{x:t[n],y:t[n+1]},{x:t[n+2],y:t[n+3]},{x:t[n+4],y:t[n+5]}];const o=[{x:r[1].x,y:r[1].y},{x:(-r[0].x+6*r[1].x+r[2].x)/6,y:(-r[0].y+6*r[1].y+r[2].y)/6},{x:(r[1].x+6*r[2].x-r[3].x)/6,y:(r[1].y+6*r[2].y-r[3].y)/6},{x:r[2].x,y:r[2].y}];e.push(["C",o[1].x,o[1].y,o[2].x,o[2].y,o[3].x,o[3].y])}return e}static zvhToLSVGPath(t){const e=[];let n=["L",0,0],i;for(let r=0,o=t.length;r<o;r++){const a=t[r];switch(a[0]){case"M":n=["L",a[1],a[2]],e.push(a);break;case"Z":e.push(n);break;case"H":i=e[e.length-1]||["L",0,0],e.push(["L",a[1],i[i.length-1]]);break;case"V":i=e[e.length-1]||["L",0,0],e.push(["L",i[i.length-2],a[1]]);break;default:e.push(a)}}return e}static longhandSVGPath(t){const e={S:{to:"C",x:3},T:{to:"Q",x:1}};let n,i=0,r=0;for(let o=0,a=t.length;o<a;o++){const h=t[o],c=e[h[0]];c&&(h[0]=c.to,n&&(n[0]===c.to?(i=2*Number(n[c.x+2])-Number(n[c.x]),r=2*Number(n[c.x+3])-Number(n[c.x+1])):(i=Number(n[n.length-2]),r=Number(n[n.length-1]))),h.splice(1,0,i,r)),n=h}return t}}let xg=class _e{cX;cY;x;y;degree;scalarX;scalarY;startPathX=0;startPathY=0;prevPathX=0;prevPathY=0;normalizedLines=[];constructor(t){this.cX=0,this.cY=0,this.x=t?.x||0,this.y=t?.y||0,typeof t?.centerX=="number"&&typeof t?.centerY=="number"&&(this.cX=t.centerX-this.x,this.cY=t.centerY-this.y),this.degree=t?.degree||0,this.scalarX=1,this.scalarY=1,t?.scalar!==void 0&&(this.scalarX=t.scalar,this.scalarY=t.scalar),t?.scalarX!==void 0&&(this.scalarX=t.scalarX),t?.scalarY!==void 0&&(this.scalarY=t.scalarY),this.reset(t?.d,t?.originMatrix)}reset(t,e){typeof t=="string"?this.resetFromSVGPathData(Ge.parseSVGPath(t),e):t instanceof _e?this.resetFromSVGPathData(t.toSVGPathData(),e):this.resetFromSVGPathData(t||[],e)}resetFromSVGPathData(t,e){this.normalizedLines=[];const n=Ge.normalizeSVGPath(Ge.absolutizeSVGPath(t));this.prevPathX=this.startPathX=0,this.prevPathY=this.startPathY=0;let i=!1;for(let r=0,o=n.length;r<o;r++){const a=n[r];if(a[0]=="M"){i||(i=!0,this.startPathX=a[1],this.startPathY=a[2]),this.prevPathX=a[1],this.prevPathY=a[2];continue}this.appendLine(new ke({c1x:a[1],c1y:a[2],c2x:a[3],c2y:a[4],toX:a[5],toY:a[6]}))}e&&({x:this.startPathX,y:this.startPathY}=e.transformPoint({x:this.startPathX,y:this.startPathY}),{x:this.prevPathX,y:this.prevPathY}=e.transformPoint({x:this.prevPathX,y:this.prevPathY}),this.normalizedLines.forEach(r=>{({x:r.x,y:r.y}=e.transformPoint({x:r.x,y:r.y})),{x:r.c1x,y:r.c1y}=e.transformPoint({x:r.c1x,y:r.c1y}),{x:r.c2x,y:r.c2y}=e.transformPoint({x:r.c2x,y:r.c2y}),{x:r.toX,y:r.toY}=e.transformPoint({x:r.toX,y:r.toY})}))}static fromPolymorphPoints(t){const e=new _e;e.prevPathX=e.startPathX=t[0]||0,e.prevPathY=e.startPathY=t[1]||0;for(let n=2,i=t.length;n+5<i;n+=6)e.appendLine(new ke({c1x:t[n],c1y:t[n+1],c2x:t[n+2],c2y:t[n+3],toX:t[n+4],toY:t[n+5]}));return e}static fromLines(t){const e=new _e;e.prevPathX=e.startPathX=t[0].x||0,e.prevPathY=e.startPathY=t[0].y||0;for(let n=0,i=t.length;n<i;n++)e.appendLine(t[n]);return e}appendLine(t){if(t instanceof pg){mc(this.prevPathX,this.prevPathY,t.toX,t.toY,t.largeArcFlag,t.sweepFlag,t.rx,t.ry,t.xAxisRotate).forEach(c=>{const[u,l,m,f,p,y,v,w]=c;this.normalizedLines.push(new ke({x:this.prevPathX,y:this.prevPathY,c1x:m,c1y:f,c2x:p,c2y:y,toX:v,toY:w})),this.prevPathX=v,this.prevPathY=w});return}let e,n,i,r,o,a;t instanceof ke?(e=t.c1x,n=t.c1y,i=t.c2x,r=t.c2y,o=t.toX,a=t.toY):t instanceof gg?[e,n,i,r,o,a]=zr(this.prevPathX,this.prevPathY,t.cx,t.cy,t.toX,t.toY):[e,n,i,r,o,a]=Xn(this.prevPathX,this.prevPathY,t.toX,t.toY),this.normalizedLines.push(new ke({x:this.prevPathX,y:this.prevPathY,c1x:e,c1y:n,c2x:i,c2y:r,toX:o,toY:a})),this.prevPathX=o,this.prevPathY=a}toSVGPathData(){const{startPathX:t,startPathY:e,normalizedLines:n}=this.updateTransform(),i=[];i.push(["M",t,e]);for(let r=0,o=n.length;r<o;r++)i.push(...n[r].toSVGPathData());return i}toSVGPathD(){return Ge.SVGPathDataToD(this.toSVGPathData())}toCanvasContext(t){const{startPathX:e,startPathY:n,normalizedLines:i}=this.updateTransform();t.beginPath(),t.moveTo(e,n),i.forEach(r=>{r.toCanvasContext(t)})}getBoundingClientRect(){const{normalizedLines:t}=this.updateTransform(),e=[],n=[];if(t.forEach(h=>{const c=h.getBoundingClientRect();e.push(c.x,c.x+c.width),n.push(c.y,c.y+c.height)}),e.length==0||n.length==0)return{x:0,y:0,width:0,height:0};const i=Math.min.apply(0,e),r=Math.min.apply(0,n),o=Math.max.apply(0,e),a=Math.max.apply(0,n);return{x:i,y:r,width:o-i,height:a-r}}update(t){this.cX=typeof t.cX=="number"?t.cX:this.cX,this.cY=typeof t.cY=="number"?t.cY:this.cY,this.x=t.x,this.y=t.y,this.degree=t.degree,this.scalarX=t.scalarX,this.scalarY=t.scalarY}updateTransform(){const t=new _t;if(t.translate(this.x+this.cX,this.y+this.cY),t.rotate(this.degree),t.scale(this.scalarX,this.scalarY),t.translate(-this.cX,-this.cY),t.isIdentity)return{startPathX:this.startPathX,startPathY:this.startPathY,normalizedLines:this.normalizedLines};{let e=this.startPathX,n=this.startPathY;({x:e,y:n}=t.transformPoint({x:e,y:n}));const i=[];return this.normalizedLines.forEach(r=>{let o=r.x,a=r.y,h=r.c1x,c=r.c1y,u=r.c2x,l=r.c2y,m=r.toX,f=r.toY;({x:o,y:a}=t.transformPoint({x:o,y:a})),{x:h,y:c}=t.transformPoint({x:h,y:c}),{x:u,y:l}=t.transformPoint({x:u,y:l}),{x:m,y:f}=t.transformPoint({x:m,y:f}),i.push(new ke({x:o,y:a,c1x:h,c1y:c,c2x:u,c2y:l,toX:m,toY:f}))}),{startPathX:e,startPathY:n,normalizedLines:i}}}getTotalLength(){const{normalizedLines:t}=this.updateTransform();return t.reduce((e,n)=>e+=n.length(),0)}getPointAtLength(t){const{normalizedLines:e}=this.updateTransform();let n=0;const i=e.length;for(let r=0;r<i;r++){const o=e[r],a=o.length();if(n+a>=t)return o.getPointAtSegmentLength(t-n);n+=a}return e[i-1].getPointAtSegmentLength(1)}interpolate(t){const{startPathX:e,startPathY:n,normalizedLines:i}=this.updateTransform(),r=i.length;if(r===0)return{x:e,y:n};if(r===1)return i[0].interpolate(t);{let o=t*r,a=i[0];if(o--,o>1)for(let h=1;h<r&&(a=i[h],o>1);h++)o-=1;return a.interpolate(o)}}getSubpath(t,e){if(this.getTotalLength()-e<1e-6)return this.getSubpathsAtLength(this,t);{const n=this.getSubpathsAtLength(this,e,1);return t?this.getSubpathsAtLength(n,t):n}}getSubpathsAtLength(t,e,n){const{startPathX:i,startPathY:r,normalizedLines:o}=t.updateTransform();let a=null,h=0;const c=new _e;c.prevPathX=c.startPathX=i,c.prevPathY=c.startPathY=r;for(let u=0,l=o.length;u<l;u++){const m=o[u],f=m.length();if(h+f>e&&!a){const p=m.getPointAtSegmentLength(e-h);if(c.appendLine(new ke({c1x:p.start.x,c1y:p.start.y,c2x:p.m.x,c2y:p.m.y,toX:p.x,toY:p.y})),n)return c;a=c,c.appendLine(new ke({c1x:p.n.x,c1y:p.n.y,c2x:p.end.x,c2y:p.end.y,toX:m.x,toY:m.y})),h+=f;continue}h+=f,c.appendLine(m)}return c}closestPoint(t,e){const n=this.getTotalLength();let i={x:t,y:e},r=0,o=1/0,a=8;for(let c=0;c<=n;c+=a){const u=this.getPointAtLength(c),l=Math.pow(Me(u.x,u.y,t,e),2);l<o&&(i=u,r=c,o=l)}for(a/=2;a>.5;){const c=r-a,u=this.getPointAtLength(c),l=Math.pow(Me(u.x,u.y,t,e),2),m=r+a,f=this.getPointAtLength(m),p=Math.pow(Me(f.x,f.y,t,e),2);c>=0&&l<o?(i=u,r=c,o=l):m<=n&&p<o?(i=f,r=m,o=p):a/=2}const h=this.getPointAtLength(r+(r===n?-.1:.1));return{point:i,rotation:r>=n?Jt(h.x,h.y,i.x,i.y):Jt(i.x,i.y,h.x,h.y),distance:Math.sqrt(o)}}get polymorphPoints(){const{startPathX:t,startPathY:e,normalizedLines:n}=this.updateTransform();return[t,e].concat(n.reduce((i,r)=>i.concat([r.c1x,r.c1y,r.c2x,r.c2y,r.toX,r.toY]),[]))}perimeterPoints(){const t=this.polymorphPoints,e=t.length;let n=t[e-2],i=t[e-1],r=0;for(let o=0;o<e;o+=6)r+=Me(t[o],t[o+1],n,i),n=t[o],i=t[o+1];return Math.floor(r)}expendFill(t){const e=this.polymorphPoints,n=e.length;let i=t-n;const r=Math.ceil(t/n),o=[];o.push(["M",e[0],e[1]]);let a=2;for(;a+5<=n-1;){const h=e[a++],c=e[a++],u=e[a++],l=e[a++],m=e[a++],f=e[a++];o.push(["C",h,c,u,l,m,f]);let p=0;for(;p<r&&i>0;)o.push(["C",m,f,m,f,m,f]),i-=6,p++}return o}static mixPoints(t,e,n){const i=t.length,r=new Array(i);for(let o=0;o<i;o++)r[o]=Z(t[o]+(e[o]-t[o])*n,6);return r}static getPathInterpolator(t,e){return n=>Math.abs(n-0)<Number.EPSILON?t:Math.abs(n-1)<Number.EPSILON?e:_e.fromPolymorphPoints(_e.mixPoints(new _e({d:t}).polymorphPoints,new _e({d:e}).polymorphPoints,n)).toSVGPathData()}},bg=class extends gs{id;originD;originMatrix;independentTransformInGroup;forceCXY=!1;cX;cY;x;y;degree;scalarX;scalarY;diffXInGroup;diffYInGroup;diffDegreeInGroup;diffScalarXInGroup;diffScalarYInGroup;vx;vy;ax;ay;mass;attrs;enableDrag;alongPath;isDragging=!1;isMouseIn=!1;targetToAfterDragFree;followMouse;strokeArmyAnts;strokeArmyAntsOffset=0;strokeDashTotalLength=0;isShow=!0;el;pathd;usePathDtoCanvasContext=!1;parent;shapes=[];constructor(t){if(super(),this.id=on(),t?.d&&(this.originD=t?.d),t?.originMatrix&&(this.originMatrix=t.originMatrix),this.independentTransformInGroup=typeof t?.independentTransformInGroup=="boolean"?t.independentTransformInGroup:!1,this.x=t?.x||0,this.y=t?.y||0,this.cX=0,this.cY=0,typeof t?.centerX=="number"&&typeof t?.centerY=="number"&&this.forceSetCXY(t.centerX-this.x,t.centerY-this.y),this.degree=t?.degree||0,this.scalarX=1,this.scalarY=1,t?.scalar!==void 0&&(this.scalarX=t.scalar,this.scalarY=t.scalar),t?.scalarX!==void 0&&(this.scalarX=t.scalarX),t?.scalarY!==void 0&&(this.scalarY=t.scalarY),this.diffXInGroup=t?.diffXInGroup||0,this.diffYInGroup=t?.diffYInGroup||0,this.diffDegreeInGroup=t?.diffDegreeInGroup||0,this.diffScalarXInGroup=t?.diffScalarXInGroup||1,this.diffScalarYInGroup=t?.diffScalarYInGroup||1,this.vx=t?.vx||0,this.vy=t?.vy||0,this.ax=t?.ax||0,this.ay=t?.ay||0,this.mass=t?.mass||1,this.attrs={stroke:"none",fill:"none"},t?.attrs&&this.setAttr(t?.attrs),this.enableDrag=t?.enableDrag||!1,this.alongPath=t?.alongPath,this.targetToAfterDragFree=t?.targetToAfterDragFree,this.followMouse=t?.followMouse||!1,this.isShow=typeof t?.isShow=="boolean"?t?.isShow:!0,this.strokeArmyAnts=t?.strokeArmyAnts||!1,this.strokeArmyAnts){const n=this.getAttr("stroke-dasharray","4 4");this.setAttr("stroke-dasharray",n),this.strokeDashTotalLength=Ci(n).reduce((i,r)=>i+r,0)}return Ra(this)}forceSetCXY(t,e){this.cX=t,this.cY=e,this.forceCXY=!0}shapeInit(){}initPathD(){if(!this.pathd){if(this.pathd=new xg,jt(()=>{this.pathd?.reset(this.originD||this.toSVGPathData(),this.originMatrix)}),this.pathd&&!this.forceCXY){const t=this.shapes.length==0?this.pathd.getBoundingClientRect():this.getBoundingClientRect();t&&(this.pathd.cX=this.cX=t.x+t.width/2-this.pathd.x,this.pathd.cY=this.cY=t.y+t.height/2-this.pathd.y)}this.shapeInit()}return this.pathd}frameStart(t){}frameUpdate(t,e){this.pathd=this.initPathD(),this.pathd.update(this),this.strokeArmyAnts&&(this.isMouseIn||(this.setAttr("stroke-dashoffset",String(this.strokeArmyAntsOffset++)),this.strokeArmyAntsOffset>this.strokeDashTotalLength&&(this.strokeArmyAntsOffset=0)))}frameEnd(t){}toSVGPathData(){return[]}toSVGPathD(){return this.pathd?.toSVGPathD()||""}toCanvasContext(t){this.usePathDtoCanvasContext=!0,this.pathd?.toCanvasContext(t)}getBoundingClientRect(){return this.pathd?.getBoundingClientRect()||null}get center(){const t=this.getBoundingClientRect(),e={x:this.x,y:this.y};return t&&(e.x=t.x+t.width/2,e.y=t.y+t.height/2),e}trim(){if(this.parent)return;const t=this.getBoundingClientRect();if(!t)return;this.shapes.forEach(n=>{const i=n.originMatrix?n.originMatrix.clone():new _t;i.translate(-t.x+n.x,-t.y+n.y),n.originMatrix=i});const e=this.originMatrix?this.originMatrix.clone():new _t;e.translate(-t.x+this.x,-t.y+this.y),this.originMatrix=e}isPointInPath(t,e,n){if(n instanceof Rr)return n.isPointInPath(new Path2D(this.toSVGPathD()),t,e);let i;try{i=new SVGPoint(t,e)}catch{i=n.createSVGPoint(),i.x=t,i.y=e}if(this.el instanceof SVGGeometryElement)return this.el.isPointInFill(i);{const r=this.getBoundingClientRect();if(r)return t>=r.x&&t<=r.x+r.width&&e>=r.y&&e<=r.y+r.height}return!1}isPointInStroke(t,e,n){if(n instanceof Rr)return n.isPointInStroke(new Path2D(this.toSVGPathD()),t,e);let i;try{i=new SVGPoint(t,e)}catch{i=n.createSVGPoint(),i.x=t,i.y=e}return this.el instanceof SVGGeometryElement?this.el.isPointInStroke(i):!1}clone(){return ya(this).copy(this)}copy(t){return this.id=t.id,this.originD=t.originD,this.originMatrix=t.originMatrix,this.independentTransformInGroup=t.independentTransformInGroup,this.x=t.x,this.y=t.y,this.cX=t.cX,this.cY=t.cY,this.degree=t.degree,this.scalarX=t.scalarX,this.scalarY=t.scalarY,this.diffXInGroup=t.diffXInGroup,this.diffYInGroup=t.diffYInGroup,this.diffDegreeInGroup=t.diffDegreeInGroup,this.diffScalarXInGroup=t.diffScalarXInGroup,this.diffScalarYInGroup=t.diffScalarYInGroup,this.vx=t.vx,this.vy=t.vy,this.ax=t.ax,this.ay=t.ay,this.mass=t.mass,this.attrs={...t.attrs},this.enableDrag=t.enableDrag,this.alongPath=t.alongPath,this.targetToAfterDragFree=t.targetToAfterDragFree,this.followMouse=t.followMouse,this.isShow=t.isShow,this.strokeArmyAnts=t.strokeArmyAnts,this.strokeDashTotalLength=t.strokeDashTotalLength,this}save(){}restore(){}setAttr(t,e){typeof t!="string"?Object.assign(this.attrs,Object.fromEntries(Object.entries(t).map(([n,i])=>[xt(n),i]))):e&&(this.attrs[xt(t)]=e)}getAttr(t,e){return this.attrs[t]||this.attrs[xt(t)]||e}getAttrs(){return this.attrs}hasAttr(t){return!!this.attrs[t]||!!this.attrs[xt(t)]}distance(t){return Me(this.x,this.y,t.x,t.y)}rotateTo(t){this.degree=Et(Jt(this.x,this.y,t.x,t.y))}followTo(t,e=3){this.rotateTo(t);const{dx:n,dy:i}=Ae(q(this.degree),e);this.vx=n,this.vy=i,this.run()}followAccelerationTo(t,e=.05){this.rotateTo(t);const{dx:n,dy:i}=Ae(q(this.degree),e);this.ax=n,this.ay=i,this.run()}checkCollision(t){}checkWall(t){}gravitateTo(t){const e=t.x-this.x,n=t.y-this.y,i=e*e+n*n,r=Math.sqrt(i),o=this.mass*t.mass/i,a=o*e/r,h=o*n/r;this.vx+=a/this.mass,this.vy+=h/this.mass,t.vx-=a/t.mass,t.vy-=h/t.mass}run(t){this.vx+=this.ax,this.vy+=this.ay;const e=qt(t?.gravity,0);this.vy+=e;const n=qt(t?.friction,1);this.vx*=n,this.vy*=n,this.x+=this.vx,this.y+=this.vy}runEaseTo(t,e){const n=qt(e?.easing,.05),i=t.x-this.cX-this.x,r=t.y-this.cY-this.y;this.vx=i*n,this.vy=r*n,this.run(e)}runSpringTo(t,e){const n=qt(e?.spring,.03);(Array.isArray(t)?t:[t]).forEach(i=>{const r=i.x-this.cX-this.x,o=i.y-this.cY-this.y,a=r*n,h=o*n;this.vx+=a,this.vy+=h}),this.run({friction:.9,...e})}springMassTo(t,e){const n=qt(e?.springLength,100),i=qt(e?.spring,1e-4),r=t.x-this.x,o=t.y-this.y,a=Math.sqrt(r*r+o*o);if(a<n){const h=r*i,c=o*i;return this.vx+=h/this.mass,this.vy+=c/this.mass,t.vx-=h/t.mass,t.vy-=c/t.mass,1-a/n}return 0}getTotalLength(){return this.initPathD().getTotalLength()}interpolate(t){return this.initPathD().interpolate(t)}getPointAtLength(t){return this.initPathD().getPointAtLength(t)}trailPath(t,e=0){const n=this.getTotalLength();return t.originD=this.initPathD().getSubpath(0,e*n),this.getPointAtLength(e*n)}strokeDashTween(t=1e3,e){const n=this.initPathD(),i=Z(n.getTotalLength(),0);this.setAttr({strokeDasharray:`${i} ${i}`,strokeDashoffset:`${i}`});const r=e?.onUpdate,o=new Fn({frameDuration:t});o.addTween({offset:i},{offset:0},Object.assign(e||{},{onUpdate:(a,h)=>{this.setAttr("strokeDashoffset",""+Z(a.offset,2)),r?.(a,h)}})),o.play()}};class vg extends bg{x;y;z;fl;vpX;vpY;cX;cY;cZ;radius;constructor(t){super(t),this.x=t?.x||0,this.y=t?.y||0,this.z=t?.z||0,this.fl=t?.fl||250,this.vpX=t?.vpX||0,this.vpY=t?.vpY||0,this.cX=t?.cX||0,this.cY=t?.cY||0,this.cZ=t?.cZ||0,this.radius=t?.radius||0}toSVGPathData(){return this.radius?[["M",this.getScreenX(),this.getScreenY()-this.radius],["a",this.radius,this.radius,0,1,1,0,2*this.radius],["a",this.radius,this.radius,0,1,1,0,-2*this.radius],["z"]]:[["M",this.getScreenX(),this.getScreenY()]]}toCanvasContext(t){t.beginPath(),t.arc(0,0,this.radius,0,Math.PI*2,!0),t.closePath()}setVanishingPoint(t,e){this.vpX=t,this.vpY=e}setCenter(t,e,n){this.cX=t,this.cY=e,this.cZ=n}rotateX(t){({x:this.y,y:this.z}=Qt(q(t),this.y,this.z))}rotateY(t){({x:this.x,y:this.z}=Qt(q(t),this.x,this.z))}rotateZ(t){({x:this.x,y:this.y}=Qt(q(t),this.x,this.y))}getScreenX(){const t=this.fl/(this.fl+this.z+this.cZ);return this.vpX+(this.cX+this.x)*t}getScreenY(){const t=this.fl/(this.fl+this.z+this.cZ);return this.vpY+(this.cY+this.y)*t}eq(t){return this.x===t.x&&this.y===t.y&&this.z===t.z&&this.radius===t.radius&&this.mass===t.mass}length(){return pn(this.x,this.y,this.z)}distance(t){const e=t.x-this.x,n=t.y-this.y,i=t.z-this.z;return Math.sqrt(e*e+n*n+i*i)}scalar(t){return this.x*=t,this.y*=t,this.z*=t,this}normalize(t=1){const e=this.length();if(e){const n=t/e;this.scalar(n)}return this}clamp(t){const e=this.length();return e&&e>t&&this.scalar(t/e),this}cross(t){const e=this.x,n=this.y,i=this.z;return{x:n*t.z-i*t.y,y:i*t.x-e*t.z,z:e*t.y-n*t.x}}multiply(t){return{x:this.x*t.x,y:this.y*t.y,z:this.z*t.z}}div(t){return{x:this.x/t.x,y:this.y/t.y,z:this.z/t.z}}add(t){return{x:this.x+t.x,y:this.y+t.y,z:this.z+t.z}}sub(t){return{x:this.x-t.x,y:this.y-t.y,z:this.z-t.z}}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z}reflect(t){const e=this.dot(t);return{x:this.x-2*e*t.x,y:this.y-2*e*t.y,z:this.z-2*e*t.z}}}const Xs=vg;class Nr{_x;_y;_z;_w;constructor(t=0,e=0,n=0,i=1){this._x=t,this._y=e,this._z=n,this._w=i}static slerpFlat(t,e,n,i,r,o,a){let h=n[i+0],c=n[i+1],u=n[i+2],l=n[i+3];const m=r[o+0],f=r[o+1],p=r[o+2],y=r[o+3];if(a===0){t[e+0]=h,t[e+1]=c,t[e+2]=u,t[e+3]=l;return}if(a===1){t[e+0]=m,t[e+1]=f,t[e+2]=p,t[e+3]=y;return}if(l!==y||h!==m||c!==f||u!==p){let v=1-a;const w=h*m+c*f+u*p+l*y,_=w>=0?1:-1,x=1-w*w;if(x>Number.EPSILON){const E=Math.sqrt(x),C=Math.atan2(E,w*_);v=Math.sin(v*C)/E,a=Math.sin(a*C)/E}const b=a*_;if(h=h*v+m*b,c=c*v+f*b,u=u*v+p*b,l=l*v+y*b,v===1-a){const E=1/Math.sqrt(h*h+c*c+u*u+l*l);h*=E,c*=E,u*=E,l*=E}}t[e]=h,t[e+1]=c,t[e+2]=u,t[e+3]=l}static multiplyQuaternionsFlat(t,e,n,i,r,o){const a=n[i],h=n[i+1],c=n[i+2],u=n[i+3],l=r[o],m=r[o+1],f=r[o+2],p=r[o+3];return t[e]=a*p+u*l+h*f-c*m,t[e+1]=h*p+u*m+c*l-a*f,t[e+2]=c*p+u*f+a*m-h*l,t[e+3]=u*p-a*l-h*m-c*f,t}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get w(){return this._w}set w(t){this._w=t,this._onChangeCallback()}set(t=this._x,e=this._y,n=this._z,i=this._w){return this._x=t,this._y=e,this._z=n,this._w=i,this._onChangeCallback(),this}clone(){return new Nr(this._x,this._y,this._z,this._w)}copy(t){return this._x=t.x,this._y=t.y,this._z=t.z,this._w=t.w,this._onChangeCallback(),this}setFromEuler(t,e=!0){const n=t.x,i=t.y,r=t.z,o=t.order,a=Math.cos,h=Math.sin,c=a(n/2),u=a(i/2),l=a(r/2),m=h(n/2),f=h(i/2),p=h(r/2);switch(o){case"XYZ":this._x=m*u*l+c*f*p,this._y=c*f*l-m*u*p,this._z=c*u*p+m*f*l,this._w=c*u*l-m*f*p;break;case"YXZ":this._x=m*u*l+c*f*p,this._y=c*f*l-m*u*p,this._z=c*u*p-m*f*l,this._w=c*u*l+m*f*p;break;case"ZXY":this._x=m*u*l-c*f*p,this._y=c*f*l+m*u*p,this._z=c*u*p+m*f*l,this._w=c*u*l-m*f*p;break;case"ZYX":this._x=m*u*l-c*f*p,this._y=c*f*l+m*u*p,this._z=c*u*p-m*f*l,this._w=c*u*l+m*f*p;break;case"YZX":this._x=m*u*l+c*f*p,this._y=c*f*l+m*u*p,this._z=c*u*p-m*f*l,this._w=c*u*l-m*f*p;break;case"XZY":this._x=m*u*l-c*f*p,this._y=c*f*l-m*u*p,this._z=c*u*p+m*f*l,this._w=c*u*l+m*f*p;break;default:console.warn("Quaternion: .setFromEuler() encountered an unknown order: "+o)}return e===!0&&this._onChangeCallback(),this}setFromAxisAngle(t,e){const n=e/2,i=Math.sin(n);return this._x=t.x*i,this._y=t.y*i,this._z=t.z*i,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix4(t){const e=t.value,n=e[0],i=e[4],r=e[8],o=e[1],a=e[5],h=e[9],c=e[2],u=e[6],l=e[10],m=n+a+l;if(m>0){const f=.5/Math.sqrt(m+1);this._w=.25/f,this._x=(u-h)*f,this._y=(r-c)*f,this._z=(o-i)*f}else if(n>a&&n>l){const f=2*Math.sqrt(1+n-a-l);this._w=(u-h)/f,this._x=.25*f,this._y=(i+o)/f,this._z=(r+c)/f}else if(a>l){const f=2*Math.sqrt(1+a-n-l);this._w=(r-c)/f,this._x=(i+o)/f,this._y=.25*f,this._z=(h+u)/f}else{const f=2*Math.sqrt(1+l-n-a);this._w=(o-i)/f,this._x=(r+c)/f,this._y=(h+u)/f,this._z=.25*f}return this._onChangeCallback(),this}setFromUnitVectors(t,e){let n=t.dot(e)+1;return n<Number.EPSILON?(n=0,Math.abs(t.x)>Math.abs(t.z)?(this._x=-t.y,this._y=t.x,this._z=0,this._w=n):(this._x=0,this._y=-t.z,this._z=t.y,this._w=n)):(this._x=t.y*e.z-t.z*e.y,this._y=t.z*e.x-t.x*e.z,this._z=t.x*e.y-t.y*e.x,this._w=n),this.normalize()}angleTo(t){return 2*Math.acos(Math.abs(N(this.dot(t),-1,1)))}rotateTowards(t,e){const n=this.angleTo(t);if(n===0)return this;const i=Math.min(1,e/n);return this.slerp(t,i),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(t){return this._x*t._x+this._y*t._y+this._z*t._z+this._w*t._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let t=this.length();return t===0?(this._x=0,this._y=0,this._z=0,this._w=1):(t=1/t,this._x=this._x*t,this._y=this._y*t,this._z=this._z*t,this._w=this._w*t),this._onChangeCallback(),this}multiply(t){return this.multiplyQuaternions(this,t)}premultiply(t){return this.multiplyQuaternions(t,this)}multiplyQuaternions(t,e){const n=t._x,i=t._y,r=t._z,o=t._w,a=e._x,h=e._y,c=e._z,u=e._w;return this._x=n*u+o*a+i*c-r*h,this._y=i*u+o*h+r*a-n*c,this._z=r*u+o*c+n*h-i*a,this._w=o*u-n*a-i*h-r*c,this._onChangeCallback(),this}slerp(t,e){if(e===0)return this;if(e===1)return this.copy(t);const n=this._x,i=this._y,r=this._z,o=this._w;let a=o*t._w+n*t._x+i*t._y+r*t._z;if(a<0?(this._w=-t._w,this._x=-t._x,this._y=-t._y,this._z=-t._z,a=-a):this.copy(t),a>=1)return this._w=o,this._x=n,this._y=i,this._z=r,this;const h=1-a*a;if(h<=Number.EPSILON){const f=1-e;return this._w=f*o+e*this._w,this._x=f*n+e*this._x,this._y=f*i+e*this._y,this._z=f*r+e*this._z,this.normalize(),this}const c=Math.sqrt(h),u=Math.atan2(c,a),l=Math.sin((1-e)*u)/c,m=Math.sin(e*u)/c;return this._w=o*l+this._w*m,this._x=n*l+this._x*m,this._y=i*l+this._y*m,this._z=r*l+this._z*m,this._onChangeCallback(),this}slerpQuaternions(t,e,n){return this.copy(t).slerp(e,n)}random(){const t=2*Math.PI*Math.random(),e=2*Math.PI*Math.random(),n=Math.random(),i=Math.sqrt(1-n),r=Math.sqrt(n);return this.set(i*Math.sin(t),i*Math.cos(t),r*Math.sin(e),r*Math.cos(e))}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._w===this._w}fromArray(t,e=0){return this._x=t[e],this._y=t[e+1],this._z=t[e+2],this._w=t[e+3],this._onChangeCallback(),this}toArray(t=[],e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._w,t}fromBufferAttribute(t,e){return this._x=t.getX(e),this._y=t.getY(e),this._z=t.getZ(e),this._w=t.getW(e),this._onChangeCallback(),this}toJSON(){return this.toArray()}onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class Vn{x=0;y=0;constructor(t=0,e=0){this.x=t,this.y=e}get width(){return this.x}set width(t){this.x=t}get height(){return this.y}set height(t){this.y=t}set(t=0,e=0){return this.x=t,this.y=e,this}setScalar(t){return this.x=t,this.y=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+t)}}copy(t){return this.x=t.x,this.y=t.y,this}clone(){return new Vn(this.x,this.y)}add(t){return this.x+=t.x,this.y+=t.y,this}addScalar(t){return this.x+=t,this.y+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this}subScalar(t){return this.x-=t,this.y-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this}multiply(t){return this.x*=t.x,this.y*=t.y,this}multiplyScalar(t){return this.x*=t,this.y*=t,this}divide(t){return this.x/=t.x,this.y/=t.y,this}divideScalar(t){return this.multiplyScalar(1/t)}applyMatrix3(t){const e=this.x,n=this.y;return this.x=t.m11*e+t.m21*n+t.m31,this.y=t.m12*e+t.m22*n+t.m32,this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this}clamp(t,e){return this.x=N(this.x,t.x,e.x),this.y=N(this.y,t.y,e.y),this}clampScalar(t,e){return this.x=N(this.x,t,e),this.y=N(this.y,t,e),this}clampLength(t,e){const n=this.length();return this.divideScalar(n||1).multiplyScalar(N(n,t,e))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(t){return this.x*t.x+this.y*t.y}cross(t){return this.x*t.y-this.y*t.x}projectOnVector(t){const e=t.lengthSq();if(e===0)return this.set(0,0);const n=t.dot(this)/e;return this.copy(t).multiplyScalar(n)}perpendOnVector(t){return pc.copy(this).projectOnVector(t),this.sub(pc)}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}lengthSq(){return this.x*this.x+this.y*this.y}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(t){const e=Math.sqrt(this.lengthSq()*t.lengthSq());if(e===0)return Math.PI/2;const n=this.dot(t)/e;return Math.acos(N(n,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,n=this.y-t.y;return e*e+n*n}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this}lerpVectors(t,e,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this}equals(t){return t.x===this.x&&t.y===this.y}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this}rotateAround(t,e){const n=Math.cos(e),i=Math.sin(e),r=this.x-t.x,o=this.y-t.y;return this.x=r*n-o*i+t.x,this.y=r*i+o*n+t.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class zt{x=0;y=0;z=0;constructor(t=0,e=0,n=0){this.x=t,this.y=e,this.z=n}set(t=0,e=0,n=0){return this.x=t,this.y=e,this.z=n,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+t)}}clone(){return new zt(this.x,this.y,this.z)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this}multiplyVectors(t,e){return this.x=t.x*e.x,this.y=t.y*e.y,this.z=t.z*e.z,this}applyEuler(t){return this.applyQuaternion(gc.setFromEuler(t))}applyAxisAngle(t,e){return this.applyQuaternion(gc.setFromAxisAngle(t,e))}applyMatrix3(t){const e=this.x,n=this.y,i=this.z,r=t.value;return this.x=r[0]*e+r[3]*n+r[6]*i,this.y=r[1]*e+r[4]*n+r[7]*i,this.z=r[2]*e+r[5]*n+r[8]*i,this}applyNormalMatrix(t){return this.applyMatrix3(t).normalize()}applyMatrix4(t){const e=this.x,n=this.y,i=this.z,r=t.value,o=1/(r[3]*e+r[7]*n+r[11]*i+r[15]);return this.x=(r[0]*e+r[4]*n+r[8]*i+r[12])*o,this.y=(r[1]*e+r[5]*n+r[9]*i+r[13])*o,this.z=(r[2]*e+r[6]*n+r[10]*i+r[14])*o,this}applyQuaternion(t){const e=this.x,n=this.y,i=this.z,r=t.x,o=t.y,a=t.z,h=t.w,c=2*(o*i-a*n),u=2*(a*e-r*i),l=2*(r*n-o*e);return this.x=e+h*c+o*l-a*u,this.y=n+h*u+a*c-r*l,this.z=i+h*l+r*u-o*c,this}transformDirection(t){const e=this.x,n=this.y,i=this.z,r=t.value;return this.x=r[0]*e+r[4]*n+r[8]*i,this.y=r[1]*e+r[5]*n+r[9]*i,this.z=r[2]*e+r[6]*n+r[10]*i,this.normalize()}divide(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this}divideScalar(t){return this.multiplyScalar(1/t)}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this}clamp(t,e){return this.x=N(this.x,t.x,e.x),this.y=N(this.y,t.y,e.y),this.z=N(this.z,t.z,e.z),this}clampScalar(t,e){return this.x=N(this.x,t,e),this.y=N(this.y,t,e),this.z=N(this.z,t,e),this}clampLength(t,e){const n=this.length();return this.divideScalar(n||1).multiplyScalar(N(n,t,e))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this}lerpVectors(t,e,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this.z=t.z+(e.z-t.z)*n,this}cross(t){return this.crossVectors(this,t)}crossVectors(t,e){const n=t.x,i=t.y,r=t.z,o=e.x,a=e.y,h=e.z;return this.x=i*h-r*a,this.y=r*o-n*h,this.z=n*a-i*o,this}projectOnVector(t){const e=t.lengthSq();if(e===0)return this.set(0,0,0);const n=t.dot(this)/e;return this.copy(t).multiplyScalar(n)}perpendOnVector(t){return Fr.copy(this).projectOnVector(t),this.sub(Fr)}projectOnPlane(t){return this.perpendOnVector(t)}reflect(t){return this.sub(Fr.copy(t).multiplyScalar(2*this.dot(t)))}angleTo(t){const e=Math.sqrt(this.lengthSq()*t.lengthSq());if(e===0)return Math.PI/2;const n=this.dot(t)/e;return Math.acos(N(n,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,n=this.y-t.y,i=this.z-t.z;return e*e+n*n+i*i}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)+Math.abs(this.z-t.z)}setFromMatrix4Position(t){const e=t.value;return this.x=e[12],this.y=e[13],this.z=e[14],this}setFromMatrix4Scale(t){const e=this.setFromMatrix4Column(t,0).length(),n=this.setFromMatrix4Column(t,1).length(),i=this.setFromMatrix4Column(t,2).length();return this.x=e,this.y=n,this.z=i,this}setFromMatrix4Column(t,e){return this.fromArray(t.value,e*4)}setFromMatrix3Column(t,e){return this.fromArray(t.value,e*3)}setFromEuler(t){return this.x=t.x,this.y=t.y,this.z=t.z,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const t=Math.random()*Math.PI*2,e=Math.random()*2-1,n=Math.sqrt(1-e*e);return this.x=n*Math.cos(t),this.y=e,this.z=n*Math.sin(t),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}class Br{x=0;y=0;z=0;w=1;constructor(t=0,e=0,n=0,i=1){this.x=t,this.y=e,this.z=n,this.w=i}get width(){return this.z}set width(t){this.z=t}get height(){return this.w}set height(t){this.w=t}set(t=0,e=0,n=0,i=1){return this.x=t,this.y=e,this.z=n,this.w=i,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this.w=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setW(t){return this.w=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;case 3:this.w=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+t)}}clone(){return new Br(this.x,this.y,this.z,this.w)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=t.w,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this.w+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this.w=t.w+e.w,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this.w+=t.w*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this.w-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this.w=t.w-e.w,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this.w*=t.w,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this}applyMatrix4(t){const e=this.x,n=this.y,i=this.z,r=this.w,o=t.value;return this.x=o[0]*e+o[4]*n+o[8]*i+o[12]*r,this.y=o[1]*e+o[5]*n+o[9]*i+o[13]*r,this.z=o[2]*e+o[6]*n+o[10]*i+o[14]*r,this.w=o[3]*e+o[7]*n+o[11]*i+o[15]*r,this}divide(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this.w/=t.w,this}divideScalar(t){return this.multiplyScalar(1/t)}setAxisAngleFromQuaternion(t){this.w=2*Math.acos(t.w);const e=Math.sqrt(1-t.w*t.w);return e<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=t.x/e,this.y=t.y/e,this.z=t.z/e),this}setAxisAngleFromRotationMatrix4(t){let e,n,i,r;const h=t.value,c=h[0],u=h[4],l=h[8],m=h[1],f=h[5],p=h[9],y=h[2],v=h[6],w=h[10];if(Math.abs(u-m)<.01&&Math.abs(l-y)<.01&&Math.abs(p-v)<.01){if(Math.abs(u+m)<.1&&Math.abs(l+y)<.1&&Math.abs(p+v)<.1&&Math.abs(c+f+w-3)<.1)return this.set(1,0,0,0),this;e=Math.PI;const x=(c+1)/2,b=(f+1)/2,E=(w+1)/2,C=(u+m)/4,L=(l+y)/4,B=(p+v)/4;return x>b&&x>E?x<.01?(n=0,i=.707106781,r=.707106781):(n=Math.sqrt(x),i=C/n,r=L/n):b>E?b<.01?(n=.707106781,i=0,r=.707106781):(i=Math.sqrt(b),n=C/i,r=B/i):E<.01?(n=.707106781,i=.707106781,r=0):(r=Math.sqrt(E),n=L/r,i=B/r),this.set(n,i,r,e),this}let _=Math.sqrt((v-p)*(v-p)+(l-y)*(l-y)+(m-u)*(m-u));return Math.abs(_)<.001&&(_=1),this.x=(v-p)/_,this.y=(l-y)/_,this.z=(m-u)/_,this.w=Math.acos((c+f+w-1)/2),this}setFromMatrix4Position(t){const e=t.value;return this.x=e[12],this.y=e[13],this.z=e[14],this.w=e[15],this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this.w=Math.min(this.w,t.w),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this.w=Math.max(this.w,t.w),this}clamp(t,e){return this.x=N(this.x,t.x,e.x),this.y=N(this.y,t.y,e.y),this.z=N(this.z,t.z,e.z),this.w=N(this.w,t.w,e.w),this}clampScalar(t,e){return this.x=N(this.x,t,e),this.y=N(this.y,t,e),this.z=N(this.z,t,e),this.w=N(this.w,t,e),this}clampLength(t,e){const n=this.length();return this.divideScalar(n||1).multiplyScalar(N(n,t,e))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}projectOnVector(t){const e=t.lengthSq();if(e===0)return this.set(0,0,0,1);const n=t.dot(this)/e;return this.copy(t).multiplyScalar(n)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this.w+=(t.w-this.w)*e,this}lerpVectors(t,e,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this.z=t.z+(e.z-t.z)*n,this.w=t.w+(e.w-t.w)*n,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z&&t.w===this.w}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this.w=t[e+3],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t[e+3]=this.w,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this.w=t.getW(e),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}const pc=new Vn,Fr=new zt,gc=new Nr,Gn=2e3,Yr=2001,yc=[1,0,0,1],wc=[1,0,0,1,0,0],xc=[1,0,0,0,1,0,0,0,1],bc=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];class $r{value;constructor(t=yc){this.value=Array.from(t)}get m11(){return this.value[0]}get m12(){return this.value[1]}get m21(){return this.value[2]}get m22(){return this.value[3]}set m11(t){this.value[0]=t}set m12(t){this.value[1]=t}set m21(t){this.value[2]=t}set m22(t){this.value[3]=t}set(t=1,e=0,n=0,i=1){return this.m11=t,this.m21=e,this.m12=n,this.m22=i,this}identity(){return this.value=Array.from(yc),this}get isIdentity(){return this.m11==1&&this.m12==0&&this.m21==0&&this.m22==1}copy(t){return this.m11=t.m11,this.m12=t.m12,this.m21=t.m21,this.m22=t.m22,this}clone(){return new $r(this.value)}fromArray(t,e=0){for(let n=0;n<4;n++)this.value[n]=t[n+e];return this}toArray(t=[],e=0){return t[e]=this.m11,t[e+1]=this.m12,t[e+2]=this.m21,t[e+3]=this.m22,t}multiplyMatrices(t,e){const n=t.value,i=e.value,r=this.value,o=n[0],a=n[2],h=n[1],c=n[3],u=i[0],l=i[2],m=i[1],f=i[3];return r[0]=o*u+a*m,r[2]=o*l+a*f,r[1]=h*u+c*m,r[3]=h*l+c*f,this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyScalar(t){return this.m11*=t,this.m12*=t,this.m21*=t,this.m22*=t,this}determinant(){return this.m11*this.m22-this.m21*this.m12}}class gn{value;constructor(t=xc){this.value=Array.from(t)}get m11(){return this.value[0]}get m12(){return this.value[1]}get m13(){return this.value[2]}get m21(){return this.value[3]}get m22(){return this.value[4]}get m23(){return this.value[5]}get m31(){return this.value[6]}get m32(){return this.value[7]}get m33(){return this.value[8]}set m11(t){this.value[0]=t}set m12(t){this.value[1]=t}set m13(t){this.value[2]=t}set m21(t){this.value[3]=t}set m22(t){this.value[4]=t}set m23(t){this.value[5]=t}set m31(t){this.value[6]=t}set m32(t){this.value[7]=t}set m33(t){this.value[8]=t}set(t=1,e=0,n=0,i=0,r=1,o=0,a=0,h=0,c=1){const u=this.value;return u[0]=t,u[1]=i,u[2]=a,u[3]=e,u[4]=r,u[5]=h,u[6]=n,u[7]=o,u[8]=c,this}identity(){return this.value=Array.from(xc),this}get isIdentity(){return this.m11==1&&this.m12==0&&this.m13==0&&this.m21==0&&this.m22==1&&this.m23==0&&this.m31==0&&this.m32==0&&this.m33==1}copy(t){return this.m11=t.m11,this.m12=t.m12,this.m13=t.m13,this.m21=t.m21,this.m22=t.m22,this.m23=t.m23,this.m31=t.m31,this.m32=t.m32,this.m33=t.m33,this}clone(){return new gn(this.value)}fromArray(t,e=0){for(let n=0;n<9;n++)this.value[n]=t[n+e];return this}toArray(t=[],e=0){return t[e]=this.m11,t[e+1]=this.m12,t[e+2]=this.m13,t[e+3]=this.m21,t[e+4]=this.m22,t[e+5]=this.m23,t[e+6]=this.m31,t[e+7]=this.m32,t[e+8]=this.m33,t}extractBasis(t,e,n){return t.setFromMatrix3Column(this,0),e.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}setFromMatrix4(t){return this.set(t.m11,t.m21,t.m31,t.m12,t.m22,t.m32,t.m13,t.m23,t.m33),this}multiplyMatrices(t,e){const n=t.value,i=e.value,r=this.value,o=n[0],a=n[3],h=n[6],c=n[1],u=n[4],l=n[7],m=n[2],f=n[5],p=n[8],y=i[0],v=i[3],w=i[6],_=i[1],x=i[4],b=i[7],E=i[2],C=i[5],L=i[8];return r[0]=o*y+a*_+h*E,r[3]=o*v+a*x+h*C,r[6]=o*w+a*b+h*L,r[1]=c*y+u*_+l*E,r[4]=c*v+u*x+l*C,r[7]=c*w+u*b+l*L,r[2]=m*y+f*_+p*E,r[5]=m*v+f*x+p*C,r[8]=m*w+f*b+p*L,this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyScalar(t){return this.m11*=t,this.m12*=t,this.m13*=t,this.m21*=t,this.m22*=t,this.m23*=t,this.m31*=t,this.m32*=t,this.m33*=t,this}determinant(){const t=this.value,e=t[0],n=t[1],i=t[2],r=t[3],o=t[4],a=t[5],h=t[6],c=t[7],u=t[8];return e*o*u-e*a*c-n*r*u+n*a*h+i*r*c-i*o*h}invert(){const t=this.value,e=t[0],n=t[1],i=t[2],r=t[3],o=t[4],a=t[5],h=t[6],c=t[7],u=t[8],l=u*o-a*c,m=a*h-u*r,f=c*r-o*h,p=e*l+n*m+i*f;if(p===0)return this.set(0,0,0,0,0,0,0,0,0);const y=1/p;return t[0]=l*y,t[1]=(i*c-u*n)*y,t[2]=(a*n-i*o)*y,t[3]=m*y,t[4]=(u*e-i*h)*y,t[5]=(i*r-a*e)*y,t[6]=f*y,t[7]=(n*h-c*e)*y,t[8]=(o*e-n*r)*y,this}transpose(){let t;const e=this.value;return t=e[1],e[1]=e[3],e[3]=t,t=e[2],e[2]=e[6],e[6]=t,t=e[5],e[5]=e[7],e[7]=t,this}getNormalMatrix(t){return this.setFromMatrix4(t).invert().transpose()}transposeIntoArray(t){const e=this.value;return t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],this}setUvTransform(t,e,n,i,r,o,a){const h=Math.cos(r),c=Math.sin(r);return this.set(n*h,n*c,-n*(h*o+c*a)+o+t,-i*c,i*h,-i*(-c*o+h*a)+a+e,0,0,1),this}scale(t,e){return this.premultiply(Xr.makeScale(t,e)),this}rotate(t){return this.premultiply(Xr.makeRotation(-t)),this}translate(t,e){return this.premultiply(Xr.makeTranslation(t,e)),this}makeTranslation(t,e){return typeof t=="number"?this.set(1,0,t,0,1,e,0,0,1):this.set(1,0,t.x,0,1,t.y,0,0,1),this}makeRotation(t){const e=Math.cos(t),n=Math.sin(t);return this.set(e,-n,0,n,e,0,0,0,1),this}makeScale(t,e){return this.set(t,0,0,0,e,0,0,0,1),this}equals(t){for(let e=0;e<9;e++)if(this.value[e]!==t.value[e])return!1;return!0}}class It{value;is3dSpecial=!1;constructor(t=bc){this.value=Array.from(t)}get m11(){return this.value[0]}get m12(){return this.value[1]}get m13(){return this.value[2]}get m14(){return this.value[3]}get m21(){return this.value[4]}get m22(){return this.value[5]}get m23(){return this.value[6]}get m24(){return this.value[7]}get m31(){return this.value[8]}get m32(){return this.value[9]}get m33(){return this.value[10]}get m34(){return this.value[11]}get m41(){return this.value[12]}get m42(){return this.value[13]}get m43(){return this.value[14]}get m44(){return this.value[15]}set m11(t){this.value[0]=t}set m12(t){this.value[1]=t}set m13(t){this.value[2]=t}set m14(t){this.value[3]=t}set m21(t){this.value[4]=t}set m22(t){this.value[5]=t}set m23(t){this.value[6]=t}set m24(t){this.value[7]=t}set m31(t){this.value[8]=t}set m32(t){this.value[9]=t}set m33(t){this.value[10]=t}set m34(t){this.value[11]=t}set m41(t){this.value[12]=t}set m42(t){this.value[13]=t}set m43(t){this.value[14]=t}set m44(t){this.value[15]=t}set(t=1,e=0,n=0,i=0,r=0,o=1,a=0,h=0,c=0,u=0,l=1,m=0,f=0,p=0,y=0,v=1){const w=this.value;return w[0]=t,w[4]=e,w[8]=n,w[12]=i,w[1]=r,w[5]=o,w[9]=a,w[13]=h,w[2]=c,w[6]=u,w[10]=l,w[14]=m,w[3]=f,w[7]=p,w[11]=y,w[15]=v,this}is2D(){return!this.is3dSpecial&&this.m31==0&&this.m32==0&&this.m33==1&&this.m34==0&&this.m43==0&&this.m44==1}is3D(){return!this.is2D()}identity(){return this.value=Array.from(bc),this}get isIdentity(){return this.m11==1&&this.m12==0&&this.m13==0&&this.m14==0&&this.m21==0&&this.m22==1&&this.m23==0&&this.m24==0&&this.m31==0&&this.m32==0&&this.m33==1&&this.m34==0&&this.m41==0&&this.m42==0&&this.m43==0&&this.m44==1}copy(t){return this.m11=t.m11,this.m12=t.m12,this.m13=t.m13,this.m14=t.m14,this.m21=t.m21,this.m22=t.m22,this.m23=t.m23,this.m24=t.m24,this.m31=t.m31,this.m32=t.m32,this.m33=t.m33,this.m34=t.m34,this.m41=t.m41,this.m42=t.m42,this.m43=t.m43,this.m44=t.m44,this}clone(){return new It(this.value)}static fromString(t){const e=new It,n=fa("number",t);return n.length===16&&n.forEach((i,r)=>{i.fullMatch&&(e.value[r]=parseFloat(i.fullMatch))}),e}fromArray(t,e=0){for(let n=0;n<16;n++)this.value[n]=t[n+e];return this}toArray(t=[],e=0){const n=this.value;return t[e]=n[0],t[e+1]=n[1],t[e+2]=n[2],t[e+3]=n[3],t[e+4]=n[4],t[e+5]=n[5],t[e+6]=n[6],t[e+7]=n[7],t[e+8]=n[8],t[e+9]=n[9],t[e+10]=n[10],t[e+11]=n[11],t[e+12]=n[12],t[e+13]=n[13],t[e+14]=n[14],t[e+15]=n[15],t}copyPosition(t){const e=this.value,n=t.value;return e[12]=n[12],e[13]=n[13],e[14]=n[14],this}setFromMatrix3(t){const e=t.value;return this.set(e[0],e[3],e[6],0,e[1],e[4],e[7],0,e[2],e[5],e[8],0,0,0,0,1),this}extractBasis(t,e,n){return t.setFromMatrix4Column(this,0),e.setFromMatrix4Column(this,1),n.setFromMatrix4Column(this,2),this}makeBasis(t,e,n){return this.set(t.x,e.x,n.x,0,t.y,e.y,n.y,0,t.z,e.z,n.z,0,0,0,0,1),this}normalize(){return this.multiplyScalar(1/(this.m44||1e-4))}transformPoint(t){const e=t.z||1,n=t.w||1;return{x:t.x*this.m11+t.y*this.m21+e*this.m31+n*this.m41,y:t.x*this.m12+t.y*this.m22+e*this.m32+n*this.m42,z:t.x*this.m13+t.y*this.m23+e*this.m33+n*this.m43,w:t.x*this.m14+t.y*this.m24+e*this.m34+n*this.m44}}toMatrix(t){const{scalarX:e,scalarY:n,skewX:i,skewY:r,x:o,y:a}=this.split(),h=[e,r,i,n,o,a];return t?(t.value=h,t):new _t(h)}flatten(){return this.m31=0,this.m32=0,this.m33=1,this.m34=0,this.m14=0,this.m24=0,this.m43=0,this.m44=1,this}toString(t=6){return`matrix3d(${this.value.map(e=>Z(e,t)).join(",")})`}split(){const t=Math.sqrt(this.m11*this.m11+this.m12*this.m12+this.m13*this.m13),e=Math.sqrt(this.m21*this.m21+this.m22*this.m22+this.m23*this.m23),n=Math.sqrt(this.m31*this.m31+this.m32*this.m32+this.m33*this.m33),i=Et(N(Math.asin(-this.m13),-1,1));let r=Et(Math.atan2(this.m23,this.m33));Math.cos(q(i))===0&&(r=Et(Math.atan2(-this.m31,this.m22)));let o=Et(Math.atan2(this.m12,this.m11));return this.m11<0&&this.m22>=0&&(o+=180),{x:this.m41,y:this.m42,z:this.m43,scalarX:t,scalarY:e,scalarZ:n,degreeX:r,degreeY:i,degreeZ:o,skewX:Et(this.m14),skewY:Et(this.m24),skewZ:Et(this.m34),skewW:this.m44,perspective:this.m34?-(1/this.m34):0}}extractRotation(t){const e=this.value,n=t.value,i=1/yn.setFromMatrix4Column(t,0).length(),r=1/yn.setFromMatrix4Column(t,1).length(),o=1/yn.setFromMatrix4Column(t,2).length();return e[0]=n[0]*i,e[1]=n[1]*i,e[2]=n[2]*i,e[3]=0,e[4]=n[4]*r,e[5]=n[5]*r,e[6]=n[6]*r,e[7]=0,e[8]=n[8]*o,e[9]=n[9]*o,e[10]=n[10]*o,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromEuler(t){const e=this.value,n=t.x,i=t.y,r=t.z,o=Math.cos(n),a=Math.sin(n),h=Math.cos(i),c=Math.sin(i),u=Math.cos(r),l=Math.sin(r);if(t.order==="XYZ"){const m=o*u,f=o*l,p=a*u,y=a*l;e[0]=h*u,e[4]=-h*l,e[8]=c,e[1]=f+p*c,e[5]=m-y*c,e[9]=-a*h,e[2]=y-m*c,e[6]=p+f*c,e[10]=o*h}else if(t.order==="YXZ"){const m=h*u,f=h*l,p=c*u,y=c*l;e[0]=m+y*a,e[4]=p*a-f,e[8]=o*c,e[1]=o*l,e[5]=o*u,e[9]=-a,e[2]=f*a-p,e[6]=y+m*a,e[10]=o*h}else if(t.order==="ZXY"){const m=h*u,f=h*l,p=c*u,y=c*l;e[0]=m-y*a,e[4]=-o*l,e[8]=p+f*a,e[1]=f+p*a,e[5]=o*u,e[9]=y-m*a,e[2]=-o*c,e[6]=a,e[10]=o*h}else if(t.order==="ZYX"){const m=o*u,f=o*l,p=a*u,y=a*l;e[0]=h*u,e[4]=p*c-f,e[8]=m*c+y,e[1]=h*l,e[5]=y*c+m,e[9]=f*c-p,e[2]=-c,e[6]=a*h,e[10]=o*h}else if(t.order==="YZX"){const m=o*h,f=o*c,p=a*h,y=a*c;e[0]=h*u,e[4]=y-m*l,e[8]=p*l+f,e[1]=l,e[5]=o*u,e[9]=-a*u,e[2]=-c*u,e[6]=f*l+p,e[10]=m-y*l}else if(t.order==="XZY"){const m=o*h,f=o*c,p=a*h,y=a*c;e[0]=h*u,e[4]=-l,e[8]=c*u,e[1]=m*l+y,e[5]=o*u,e[9]=f*l-p,e[2]=p*l-f,e[6]=a*u,e[10]=y*l+m}return e[3]=0,e[7]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromQuaternion(t){return this.compose(_g,t,Sg)}lookAt(t,e,n){const i=this.value;return Nt.subVectors(t,e),Nt.lengthSq()===0&&(Nt.z=1),Nt.normalize(),Ie.crossVectors(n,Nt),Ie.lengthSq()===0&&(Math.abs(n.z)===1?Nt.x+=1e-4:Nt.z+=1e-4,Nt.normalize(),Ie.crossVectors(n,Nt)),Ie.normalize(),Us.crossVectors(Nt,Ie),i[0]=Ie.x,i[4]=Us.x,i[8]=Nt.x,i[1]=Ie.y,i[5]=Us.y,i[9]=Nt.y,i[2]=Ie.z,i[6]=Us.z,i[10]=Nt.z,this}multiplyMatrices(t,e){const n=t.value,i=e.value,r=this.value,o=n[0],a=n[4],h=n[8],c=n[12],u=n[1],l=n[5],m=n[9],f=n[13],p=n[2],y=n[6],v=n[10],w=n[14],_=n[3],x=n[7],b=n[11],E=n[15],C=i[0],L=i[4],B=i[8],F=i[12],U=i[1],G=i[5],J=i[9],st=i[13],K=i[2],Kt=i[6],Yt=i[10],Ut=i[14],te=i[3],R=i[7],D=i[11],$=i[15];return r[0]=o*C+a*U+h*K+c*te,r[4]=o*L+a*G+h*Kt+c*R,r[8]=o*B+a*J+h*Yt+c*D,r[12]=o*F+a*st+h*Ut+c*$,r[1]=u*C+l*U+m*K+f*te,r[5]=u*L+l*G+m*Kt+f*R,r[9]=u*B+l*J+m*Yt+f*D,r[13]=u*F+l*st+m*Ut+f*$,r[2]=p*C+y*U+v*K+w*te,r[6]=p*L+y*G+v*Kt+w*R,r[10]=p*B+y*J+v*Yt+w*D,r[14]=p*F+y*st+v*Ut+w*$,r[3]=_*C+x*U+b*K+E*te,r[7]=_*L+x*G+b*Kt+E*R,r[11]=_*B+x*J+b*Yt+E*D,r[15]=_*F+x*st+b*Ut+E*$,this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyScalar(t){return this.m11*=t,this.m12*=t,this.m13*=t,this.m14*=t,this.m21*=t,this.m22*=t,this.m23*=t,this.m24*=t,this.m31*=t,this.m32*=t,this.m33*=t,this.m34*=t,this}determinant(){const t=this.value,e=t[0],n=t[4],i=t[8],r=t[12],o=t[1],a=t[5],h=t[9],c=t[13],u=t[2],l=t[6],m=t[10],f=t[14],p=t[3],y=t[7],v=t[11],w=t[15];return p*(+r*h*l-i*c*l-r*a*m+n*c*m+i*a*f-n*h*f)+y*(+e*h*f-e*c*m+r*o*m-i*o*f+i*c*u-r*h*u)+v*(+e*c*l-e*a*f-r*o*l+n*o*f+r*a*u-n*c*u)+w*(-i*a*u-e*h*l+e*a*m+i*o*l-n*o*m+n*h*u)}transpose(){const t=this.value;let e;return e=t[1],t[1]=t[4],t[4]=e,e=t[2],t[2]=t[8],t[8]=e,e=t[6],t[6]=t[9],t[9]=e,e=t[3],t[3]=t[12],t[12]=e,e=t[7],t[7]=t[13],t[13]=e,e=t[11],t[11]=t[14],t[14]=e,this}setPosition(t,e,n){const i=this.value;return t instanceof zt?(i[12]=t.x,i[13]=t.y,i[14]=t.z):typeof t=="number"&&typeof e=="number"&&typeof n=="number"&&(i[12]=t,i[13]=e,i[14]=n),this}invert(){const t=this.value,e=t[0],n=t[1],i=t[2],r=t[3],o=t[4],a=t[5],h=t[6],c=t[7],u=t[8],l=t[9],m=t[10],f=t[11],p=t[12],y=t[13],v=t[14],w=t[15],_=l*v*c-y*m*c+y*h*f-a*v*f-l*h*w+a*m*w,x=p*m*c-u*v*c-p*h*f+o*v*f+u*h*w-o*m*w,b=u*y*c-p*l*c+p*a*f-o*y*f-u*a*w+o*l*w,E=p*l*h-u*y*h-p*a*m+o*y*m+u*a*v-o*l*v,C=e*_+n*x+i*b+r*E;if(C===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const L=1/C;return t[0]=_*L,t[1]=(y*m*r-l*v*r-y*i*f+n*v*f+l*i*w-n*m*w)*L,t[2]=(a*v*r-y*h*r+y*i*c-n*v*c-a*i*w+n*h*w)*L,t[3]=(l*h*r-a*m*r-l*i*c+n*m*c+a*i*f-n*h*f)*L,t[4]=x*L,t[5]=(u*v*r-p*m*r+p*i*f-e*v*f-u*i*w+e*m*w)*L,t[6]=(p*h*r-o*v*r-p*i*c+e*v*c+o*i*w-e*h*w)*L,t[7]=(o*m*r-u*h*r+u*i*c-e*m*c-o*i*f+e*h*f)*L,t[8]=b*L,t[9]=(p*l*r-u*y*r-p*n*f+e*y*f+u*n*w-e*l*w)*L,t[10]=(o*y*r-p*a*r+p*n*c-e*y*c-o*n*w+e*a*w)*L,t[11]=(u*a*r-o*l*r-u*n*c+e*l*c+o*n*f-e*a*f)*L,t[12]=E*L,t[13]=(u*y*i-p*l*i+p*n*m-e*y*m-u*n*v+e*l*v)*L,t[14]=(p*a*i-o*y*i-p*n*h+e*y*h+o*n*v-e*a*v)*L,t[15]=(o*l*i-u*a*i+u*n*h-e*l*h-o*n*m+e*a*m)*L,this}getMaxScaleOnAxis(){const t=this.value,e=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],n=t[4]*t[4]+t[5]*t[5]+t[6]*t[6],i=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(e,n,i))}makeTranslation(t,e,n){return t instanceof zt?this.set(1,0,0,t.x,0,1,0,t.y,0,0,1,t.z,0,0,0,1):this.set(1,0,0,t,0,1,0,e,0,0,1,n,0,0,0,1),this}makeRotationX(t){const e=Math.cos(t),n=Math.sin(t);return this.set(1,0,0,0,0,e,-n,0,0,n,e,0,0,0,0,1),this}makeRotationY(t){const e=Math.cos(t),n=Math.sin(t);return this.set(e,0,n,0,0,1,0,0,-n,0,e,0,0,0,0,1),this}makeRotationZ(t){const e=Math.cos(t),n=Math.sin(t);return this.set(e,-n,0,0,n,e,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(t,e){const n=Math.cos(e),i=Math.sin(e),r=1-n,o=t.x,a=t.y,h=t.z,c=r*o,u=r*a;return this.set(c*o+n,c*a-i*h,c*h+i*a,0,c*a+i*h,u*a+n,u*h-i*o,0,c*h-i*a,u*h+i*o,r*h*h+n,0,0,0,0,1),this}makeScale(t,e,n){return this.set(t,0,0,0,0,e,0,0,0,0,n,0,0,0,0,1),this}makeShear(t,e,n,i,r,o){return this.set(1,n,r,0,t,1,o,0,e,i,1,0,0,0,0,1),this}makePerspective(t,e,n,i,r,o,a=Gn){const h=this.value,c=2*r/(e-t),u=2*r/(n-i),l=(e+t)/(e-t),m=(n+i)/(n-i);let f,p;if(a===Gn)f=-(o+r)/(o-r),p=-2*o*r/(o-r);else if(a===Yr)f=-o/(o-r),p=-o*r/(o-r);else throw new Error("Matrix4.makePerspective(): Invalid coordinate system: "+a);return h[0]=c,h[4]=0,h[8]=l,h[12]=0,h[1]=0,h[5]=u,h[9]=m,h[13]=0,h[2]=0,h[6]=0,h[10]=f,h[14]=p,h[3]=0,h[7]=0,h[11]=-1,h[15]=0,this}makeOrthographic(t,e,n,i,r,o,a=Gn){const h=this.value,c=1/(e-t),u=1/(n-i),l=1/(o-r),m=(e+t)*c,f=(n+i)*u;let p,y;if(a===Gn)p=(o+r)*l,y=-2*l;else if(a===Yr)p=r*l,y=-1*l;else throw new Error("Matrix4.makeOrthographic(): Invalid coordinate system: "+a);return h[0]=2*c,h[4]=0,h[8]=0,h[12]=-m,h[1]=0,h[5]=2*u,h[9]=0,h[13]=-f,h[2]=0,h[6]=0,h[10]=y,h[14]=-p,h[3]=0,h[7]=0,h[11]=0,h[15]=1,this}compose(t,e,n){const i=this.value,r=e.x,o=e.y,a=e.z,h=e.w,c=r+r,u=o+o,l=a+a,m=r*c,f=r*u,p=r*l,y=o*u,v=o*l,w=a*l,_=h*c,x=h*u,b=h*l,E=n.x,C=n.y,L=n.z;return i[0]=(1-(y+w))*E,i[1]=(f+b)*E,i[2]=(p-x)*E,i[3]=0,i[4]=(f-b)*C,i[5]=(1-(m+w))*C,i[6]=(v+_)*C,i[7]=0,i[8]=(p+x)*L,i[9]=(v-_)*L,i[10]=(1-(m+y))*L,i[11]=0,i[12]=t.x,i[13]=t.y,i[14]=t.z,i[15]=1,this}decompose(t,e,n){const i=this.value;let r=yn.set(i[0],i[1],i[2]).length();const o=yn.set(i[4],i[5],i[6]).length(),a=yn.set(i[8],i[9],i[10]).length();this.determinant()<0&&(r=-r),t.x=i[12],t.y=i[13],t.z=i[14],Zt.copy(this);const c=1/r,u=1/o,l=1/a;return Zt.value[0]*=c,Zt.value[1]*=c,Zt.value[2]*=c,Zt.value[4]*=u,Zt.value[5]*=u,Zt.value[6]*=u,Zt.value[8]*=l,Zt.value[9]*=l,Zt.value[10]*=l,e.setFromRotationMatrix4(Zt),n.x=r,n.y=o,n.z=a,this}equals(t){for(let e=0;e<16;e++)if(this.value[e]!==t.value[e])return!1;return!0}translate(t=0,e=0,n=0){return this.multiply(new It([1,0,0,0,0,1,0,0,0,0,1,0,t,e,n,1]))}scale(t=1,e=1,n=1){return this.multiply(new It([t,0,0,0,0,e,0,0,0,0,n,0,0,0,0,1]))}scaleVector3(t){const e=this.value,n=t.x,i=t.y,r=t.z;return e[0]*=n,e[4]*=i,e[8]*=r,e[1]*=n,e[5]*=i,e[9]*=r,e[2]*=n,e[6]*=i,e[10]*=r,e[3]*=n,e[7]*=i,e[11]*=r,this}rotateX(t){const e=q(t),n=Math.cos(e),i=Math.sin(e);return this.multiply(new It([1,0,0,0,0,n,i,0,0,-i,n,0,0,0,0,1]))}rotateY(t){const e=q(t),n=Math.cos(e),i=Math.sin(e);return this.multiply(new It([n,0,-i,0,0,1,0,0,i,0,n,0,0,0,0,1]))}rotateZ(t){this.is3dSpecial=!0;const e=q(t),n=Math.cos(e),i=Math.sin(e);return this.multiply(new It([n,i,0,0,-i,n,0,0,0,0,1,0,0,0,0,1]))}skew(t=0,e=0,n=0){return this.multiply(new It([1,0,0,q(t),0,1,0,q(e),0,0,1,q(n),0,0,0,1]))}perspective(t){return this.multiply(new It([1,0,0,0,0,1,0,0,0,0,1,t?-(1/t):0,0,0,0,1]))}unproject(t){let e=t.x*this.m11+t.y*this.m21+this.m41,n=t.x*this.m12+t.y*this.m22+this.m42,i=t.x*this.m13+t.y*this.m23+this.m43,r=t.x*this.m14+t.y*this.m24+this.m44,o=e+this.m31,a=n+this.m32,h=i+this.m33,c=r+this.m34;r==0&&(r=1e-4),e/=r,n/=r,i/=r,c==0&&(c=1e-4),o/=c,a/=c,h/=c;const u=h-i;if(u==0)return{x:e,y:n,z:i,mass:r};const l=-i/u;return e+=l*(o-e),n+=l*(a-n),{x:e,y:n,z:i,mass:r}}project(t){const e=t.z;let n=t.x*this.m11+t.y*this.m21+e*this.m31+this.m41,i=t.x*this.m12+t.y*this.m22+e*this.m32+this.m42,r=t.x*this.m14+t.y*this.m24+e*this.m34+this.m44;return r==0&&(r=1e-4),n/=r,i/=r,r<0&&(n-=this.m41,i-=this.m42,n*=1/r,i*=1/r,n+=this.m41,i+=this.m42),{x:n,y:i,z:e,mass:r}}bounds(t,e,n,i){const r=new Xs({x:t,y:e}),o=new Xs({x:t+n,y:e}),a=new Xs({x:t+n,y:e+i}),h=new Xs({x:t,y:e+i});({x:r.x,y:r.y,z:r.z,mass:r.mass}=this.project(r)),{x:o.x,y:o.y,z:o.z,mass:o.mass}=this.project(o),{x:a.x,y:a.y,z:a.z,mass:a.mass}=this.project(a),{x:h.x,y:h.y,z:h.z,mass:h.mass}=this.project(h);const c=Math.min(r.x,o.x,a.x,h.x),u=Math.min(r.y,o.y,a.y,h.y),l=Math.max(r.x,o.x,a.x,h.x)-c,m=Math.max(r.y,o.y,a.y,h.y)-u;return{x:c,y:u,width:l,height:m}}}class _t{value;_m13=0;_m23=0;_m33=1;matrix4;constructor(t=wc){this.value=Array.from(t),this.matrix4=this.toMatrix4()}get m11(){return this.value[0]}get m12(){return this.value[1]}get m13(){return this._m13}get m21(){return this.value[2]}get m22(){return this.value[3]}get m23(){return this._m23}get m31(){return this.value[4]}get m32(){return this.value[5]}get m33(){return this._m33}set m11(t){this.value[0]=t}set m12(t){this.value[1]=t}set m13(t){this._m13=t}set m21(t){this.value[2]=t}set m22(t){this.value[3]=t}set m23(t){this._m23=t}set m31(t){this.value[4]=t}set m32(t){this.value[5]=t}set m33(t){this._m33=t}static fromString(t){const e=new _t,n=fa("number",t);return n.length===6&&n.forEach((i,r)=>{i.fullMatch&&(e.value[r]=parseFloat(i.fullMatch))}),e}toMatrix4(t=this.matrix4){const e=[this.m11,this.m12,0,this.m13,this.m21,this.m22,0,this.m23,0,0,1,0,this.m31,this.m32,0,this.m33];return t?(t.value=e,t):new It(e)}identity(){return this.value=Array.from(wc),this.m13=0,this.m23=0,this.m33=1,this.matrix4=this.toMatrix4(),this}get isIdentity(){return this.m11==1&&this.m12==0&&this.m13==0&&this.m21==0&&this.m22==1&&this.m23==0&&this.m31==0&&this.m32==0&&this.m33==1}multiplyScalar(t){return this.m11*=t,this.m12*=t,this.m13*=t,this.m21*=t,this.m22*=t,this.m23*=t,this.m31*=t,this.m32*=t,this.m33*=t,this}normalize(){const t=this.m33||1e-4;return this.multiplyScalar(1/t)}transformPoint(t){const e=t.z||1;return{x:t.x*this.m11+t.y*this.m21+e*this.m31,y:t.x*this.m12+t.y*this.m22+e*this.m32,z:t.x*this.m13+t.y*this.m23+e*this.m33}}clone(){return new _t(this.value)}multiply(t){const e=this.clone(),n=t instanceof _t?t:new _t(t);return this.m11=n.m11*e.m11+n.m12*e.m21+n.m13*e.m31,this.m12=n.m11*e.m12+n.m12*e.m22+n.m13*e.m32,this.m13=n.m11*e.m13+n.m12*e.m23+n.m13*e.m33,this.m21=n.m21*e.m11+n.m22*e.m21+n.m23*e.m31,this.m22=n.m21*e.m12+n.m22*e.m22+n.m23*e.m32,this.m23=n.m21*e.m13+n.m22*e.m23+n.m23*e.m33,this.m31=n.m31*e.m11+n.m32*e.m21+n.m33*e.m31,this.m32=n.m31*e.m12+n.m32*e.m22+n.m33*e.m32,this.m33=n.m31*e.m13+n.m32*e.m23+n.m33*e.m33,this}append(t){return this.multiply(t)}prepend(t){return t.multiply(this),this}invert(){const t=this.m11,e=this.m12,n=this.m13,i=this.m21,r=this.m22,o=this.m23,a=this.m31,h=this.m32,c=this.m33,u=c*r-o*h,l=-c*i+o*a,m=h*i-r*a;let f=t*u+e*l+n*m;return f?(f=1/f,this.m11=u*f,this.m12=(-c*e+n*h)*f,this.m13=(o*e-n*r)*f,this.m21=l*f,this.m22=(c*t-n*a)*f,this.m23=(-o*t+n*i)*f,this.m31=m*f,this.m32=(-h*t+e*a)*f,this.m33=(r*t-e*i)*f,this):null}adjugate(){const t=new _t;return t.m11=this.m22*this.m33-this.m32*this.m23,t.m12=this.m32*this.m13-this.m12*this.m33,t.m13=this.m12*this.m23-this.m22*this.m13,t.m21=this.m31*this.m23-this.m21*this.m33,t.m22=this.m11*this.m33-this.m31*this.m13,t.m23=this.m21*this.m13-this.m11*this.m23,t.m31=this.m21*this.m32-this.m31*this.m22,t.m32=this.m31*this.m12-this.m11*this.m32,t.m33=this.m11*this.m22-this.m21*this.m12,t}split(){let t=Et(Math.atan2(this.m12,this.m11));return this.m11<0&&this.m22>=0&&(t+=180),{x:this.m31,y:this.m32,degree:t,scaleX:Math.sqrt(this.m11*this.m11+this.m12*this.m12),scaleY:Math.sqrt(this.m21*this.m21+this.m22*this.m22),skewX:Et(Math.atan2(-this.m21,this.m22)),skewY:Et(Math.atan2(this.m12,this.m11))}}getGroupCoords(t){const e=this.value[0],n=this.value[1],i=this.value[2],r=this.value[3],o=this.value[4],a=this.value[5],h=t.value[0],c=t.value[1],u=t.value[2],l=t.value[3],m=t.value[4],f=t.value[5],p=h*l,y=c*u,v=(u*n-e*l)/(y-p),w=(h*n-e*c)/(p-y),_=(u*r-i*l)/(y-p),x=(h*r-i*c)/(p-y),b=(u*(a-f)+l*(m-o))/(y-p),E=(h*(a-f)+c*(m-o))/(p-y),C=[v,w,_,x,b,E];return new _t(C)}toString(t=6){return this.matrix4.is2D()?`matrix(${this.value.map(e=>Z(e,t)).join(",")})`:this.matrix4.toString()}translate(t,e){return this.multiply([1,0,0,1,t,e]),this.toMatrix4(),this}translateTo(t,e){return this.translate(t-this.m31,e-this.m32)}translateX(t){return this.translate(t,0)}translateXTo(t){return this.translateTo(t,this.m32)}translateY(t){return this.translate(0,t)}translateYTo(t){return this.translateTo(this.m31,t)}translateZ(t){return this.matrix4.translate(0,0,t),this.matrix4.toMatrix(this),this}translateZTo(t){return this.translateZ(t-this.matrix4.m43),this}translate3d(t,e,n){return this.matrix4.translate(t,e,n),this.matrix4.toMatrix(this),this}translate3dTo(t,e,n){return this.translate3d(t-this.matrix4.m41,e-this.matrix4.m42,n-this.matrix4.m43),this}rotate(t,e=0,n=0){const i=q(t),r=Math.cos(i),o=Math.sin(i);return this.translate(e,n),this.multiply([r,o,-o,r,0,0]),this.translate(-e,-n),this.toMatrix4(),this}rotateTo(t,e=0,n=0){const{degree:i}=this.split();return this.rotate(t-i,e,n),this}rotateX(t){return this.matrix4.rotateX(t),this.matrix4.toMatrix(this),this}rotateXTo(t){const{degreeX:e}=this.matrix4.split();return this.rotateX(t-e),this}rotateY(t){return this.matrix4.rotateY(t),this.matrix4.toMatrix(this),this}rotateYTo(t){const{degreeY:e}=this.matrix4.split();return this.rotateY(t-e),this}rotateZ(t){return this.matrix4.rotateZ(t),this.matrix4.toMatrix(this),this}rotateZTo(t){const{degreeZ:e}=this.matrix4.split();return this.rotateZ(t-e),this}rotate3d(t,e,n){return this.matrix4.rotateX(t).rotateY(e).rotateZ(n),this.matrix4.toMatrix(this),this}rotate3dTo(t,e,n){const{degreeX:i,degreeY:r,degreeZ:o}=this.matrix4.split();return this.rotate3d(t-i,e-r,n-o),this}scale(t,e=t,n=0,i=0){return this.translate(n,i),this.multiply([t,0,0,e,0,0]),this.translate(-n,-i),this.toMatrix4(),this}scaleTo(t,e=t,n=0,i=0){return this.scale(t/this.m11,e/this.m22,n,i)}scaleX(t){return this.scale(t,1)}scaleXTo(t){return this.scale(t/this.m11,1)}scaleY(t){return this.scale(1,t)}scaleYTo(t){return this.scale(1,t/this.m22)}scaleZ(t){return this.matrix4.scale(1,1,t),this.matrix4.toMatrix(this),this}scaleZTo(t){const{scalarZ:e}=this.matrix4.split();return this.scaleZ(t/e),this}scale3d(t,e=t,n=t){return this.matrix4.scale(t,e,n),this.matrix4.toMatrix(this),this}scale3dTo(t,e=t,n=t){const{scalarX:i,scalarY:r,scalarZ:o}=this.matrix4.split();return this.scale3d(t/i,e/r,n/o),this}skew(t,e=t){return this.multiply([Math.cos(q(e)),Math.sin(q(e)),-Math.sin(q(t)),Math.cos(q(t)),0,0]),this.toMatrix4(),this}skewTo(t,e=t){const{skewX:n,skewY:i}=this.split();return this.skew(t-n,e-i)}skewX(t){const{skewY:e}=this.split();return this.skew(t,e)}skewXTo(t){const{skewY:e}=this.split();return this.skewTo(t,e)}skewY(t){const{skewX:e}=this.split();return this.skew(e,t)}skewYTo(t){const{skewX:e}=this.split();return this.skewTo(e,t)}skewZ(t){return this}skewZTo(t){return this}skew3d(t,e,n){return this}skew3dTo(t,e,n){return this}perspective(t){return this.matrix4.perspective(t),this.matrix4.toMatrix(this),this}}const _g=new zt(0,0,0),Sg=new zt(1,1,1),Ie=new zt,Us=new zt,Nt=new zt,yn=new zt,Xr=new gn,Zt=new It;function Ur(s){const t=new _t;return s.replace(/([a-z0-9]+)\s*\(?\s*((-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)*[a-z%]*\s*,?\s*)+)\)?/gi,function(e,n,i){i.indexOf(",")>=0?i=i.split(/\s*,\s*/):i=i.split(/\s+/);const r=[];for(let o=0,a=i.length;o<a;o++)i[o].trim()&&r.push(parseFloat(""+i[o]));switch(n.toLowerCase()){case"t":case"translate":t.translate(r[0],r[1]);break;case"translatex":t.translateX(r[0]);break;case"translatey":t.translateY(r[0]);break;case"translatez":t.translateZ(r[0]);break;case"translate3d":t.translate3d(r[0],r[1],r[2]);break;case"r":case"rotate":t.rotate(r[0],r[1]??0,r[2]??0);break;case"rotatex":t.rotateX(r[0]);break;case"rotatey":t.rotateY(r[0]);break;case"rotatez":t.rotateZ(r[0]);break;case"rotate3d":t.rotate3d(r[0],r[1],r[2]);break;case"s":case"scale":t.scale(r[0],r[1]??r[0]);break;case"scalex":t.scaleX(r[0]);break;case"scaley":t.scaleY(r[0]);break;case"scalez":t.scaleZ(r[0]);break;case"scale3d":t.scale3d(r[0],r[1],r[2]);break;case"skew":t.skew(r[0],r[1]??0);break;case"skewx":t.skewX(r[0]);break;case"skewy":t.skewY(r[0]);break;case"skewz":t.skewZ(r[0]);break;case"skew3d":t.skew3d(r[0],r[1],r[2]);break;case"m":case"matrix":t.multiply([r[0],r[1],r[2],r[3],r[4],r[5]]),t.toMatrix4();break;case"matrix3d":t.matrix4.multiply(new It(r)),t.matrix4.toMatrix(t);break}return""}),t}function Qt(s,t,e){const n=new _t;return n.rotate(Et(s)),n.transformPoint({x:t,y:e})}function Vr(s){const t=typeof s?.x=="number"?s?.x:0,e=typeof s?.y=="number"?s?.y:0,n=typeof s?.degree=="number"?s?.degree:0,i=typeof s?.scalarX=="number"?s?.scalarX:1,r=typeof s?.scalarY=="number"?s?.scalarY:1,o=q(n),a=Math.cos(o),h=Math.sin(o),c=new DOMMatrix([a*i,h*i,-h*r,a*r,t,e]);return c.multiplySelf(new DOMMatrix(s?.originMatrix||"")),c}function Cg(s,t){const e=new Path2D(s),n=new Path2D;return n.addPath(e,Vr(t)),n}function qe(s,t,e){const n=kr(s);return n.props.style=n.props.style||{},t?n.props.style[t]||n.props.style[ma(t)]||n.props.style[xt(t)]||"":n.props.style}function Gr(s,t,e){Ir(s,n=>{n.props.style=n.props.style||{},typeof t=="string"&&e?n.props.style[t]=e:t instanceof Object&&Object.keys(t).forEach(i=>{n.props.style[i]=t[i]})}),Dr()}function qr(s){const t={};if(getComputedStyle){const e=getComputedStyle(s);for(let n=0,i=e.length;n<i;n++)t[e[n]]=e.getPropertyValue(t[n])}else{const e=s.currentStyle;for(const n in e)t[n]=e[n]}return s.style.cssText&&s.style.cssText.split(";").filter(e=>!!e).forEach(e=>{const[n,i]=e.split(":");n&&i&&(t[n.trim()]=i.trim())}),t}function Tg(s,t,e){let n=s.style[t]||"";if(!n&&getComputedStyle){t=xt(t);const i=getComputedStyle(s,e),r=i.getPropertyPriority(t);n=i.getPropertyValue(t).trim()+(r?"!"+r:"")}return n||(n=s.currentStyle[t]||""),n}function Vs(s,t,e){typeof t=="string"&&e?s.style.setProperty(xt(t),e.replace(/!important/i,""),e.toLowerCase().includes("!important")?"important":""):t instanceof Object&&Object.keys(t).forEach(n=>{Vs(s,n,t[n])})}function jr(s,t){typeof t=="string"?s.style.removeProperty(xt(t)):Object.keys(t).forEach(e=>{jr(s,e)})}function vc(s,t){let e;if(typeof t=="string"){const n=document.querySelector(t)?.shadowRoot;n?e=n:e=document.querySelector(t)}else e=t||document.getElementsByTagName("head")[0];if(e){const n=document.createElement("style");return n.innerHTML=s,e.appendChild(n),()=>{(e instanceof HTMLElement||e instanceof ShadowRoot)&&e.removeChild(n)}}else{const n=document.styleSheets[0].insertRule(s);return()=>{document.styleSheets[0].deleteRule(n)}}}function Eg(s,t,e={}){Object.prototype.hasOwnProperty.call(e,"transform")||Object.assign(e,{transform:qe(s,"transform")||""});const n=Ur(e.transform),i={};for(const r in t){const o=t[r];switch(r){case"transform":break;case"translate":n.translate(o[0]||0,o[1]||0);break;case"translateTo":n.translateTo(o[0]||0,o[1]||0);break;case"translateX":n.translateX(o||0);break;case"translateXTo":n.translateXTo(o||0);break;case"translateY":n.translateY(o||0);break;case"translateYTo":n.translateYTo(o||0);break;case"translateZ":n.translateZ(o||0);break;case"translateZTo":n.translateZTo(o||0);break;case"translate3d":n.translate3d(o[0]||0,o[1]||0,o[2]||0);break;case"translate3dTo":n.translate3dTo(o[0]||0,o[1]||0,o[2]||0);break;case"rotate":typeof o=="number"?n.rotate(o||0):n.rotate(o[0]||0,o[1]||0,o[2]||0);break;case"rotateTo":typeof o=="number"?n.rotateTo(o||0):n.rotateTo(o[0]||0,o[1]||0,o[2]||0);break;case"rotateX":n.rotateX(o||0);break;case"rotateXTo":n.rotateXTo(o||0);break;case"rotateY":n.rotateY(o||0);break;case"rotateYTo":n.rotateYTo(o||0);break;case"rotateZ":n.rotateZ(o||0);break;case"rotateZTo":n.rotateZTo(o||0);break;case"rotate3d":n.rotate3d(o[0]||0,o[1]||0,o[2]||0);break;case"rotate3dTo":n.rotate3dTo(o[0]||0,o[1]||0,o[2]||0);break;case"scale":typeof o=="number"?n.scale(o||1):n.scale(o[0]||1,o[1]||1,o[2]||0,o[3]||0);break;case"scaleTo":typeof o=="number"?n.scaleTo(o||1):n.scaleTo(o[0]||1,o[1]||1,o[2]||0,o[3]||0);break;case"scaleX":n.scaleX(o||1);break;case"scaleXTo":n.scaleXTo(o||1);break;case"scaleY":n.scaleY(o||1);break;case"scaleYTo":n.scaleYTo(o||1);break;case"scaleZ":n.scaleZ(o||1);break;case"scaleZTo":n.scaleZTo(o||1);break;case"scale3d":typeof o=="number"?n.scale3d(o||1):n.scale3d(o[0]||1,o[1]||1,o[2]||1);break;case"scale3dTo":typeof o=="number"?n.scale3dTo(o||1):n.scale3dTo(o[0]||1,o[1]||1,o[2]||1);break;case"skew":typeof o=="number"?n.skew(o||0):n.skew(o[0]||0,o[1]||0);break;case"skewTo":typeof o=="number"?n.skewTo(o||0):n.skewTo(o[0]||0,o[1]||0);break;case"skewX":n.skewX(o||0);break;case"skewXTo":n.skewXTo(o||0);break;case"skewY":n.skewY(o||0);break;case"skewYTo":n.skewYTo(o||0);break;case"skewZ":break;case"skewZTo":break;case"skew3d":break;case"skew3dTo":break;case"perspective":n.perspective(o||0);break;default:Object.prototype.hasOwnProperty.call(e,r)||(e[r]=qe(s,r)),Object.assign(i,{[r]:`${o}`});break}}return Object.assign(i,{transform:n.toString()}),i}function je(s,t,e){if(t===void 0&&e===void 0)return Hr(s);if(typeof t=="string"&&e===void 0)return _c(s,t);let n={};typeof t=="object"?n=t:typeof t=="string"&&typeof e=="string"&&(n[t]=""+e),Ir(s,i=>{Object.entries(n).forEach(([r,o])=>{i.props[r]=""+o})}),Dr()}const Pg=["-o-","-ms-","-moz-","-webkit-",""];function Hr(s){const t={};for(let e=0,n=s.attributes,i=n.length;e<i;e++){const r=n[e];r.nodeName&&r.nodeValue&&(r.nodeName==="style"?t[r.nodeName]=qr(s):t[r.nodeName]=r.nodeValue)}return t}function _c(s,t){return t==="style"?qr(s):s.getAttribute(xt(t))}function wn(s,t,e){return s.setAttribute(xt(t),""+e)}function Mg(s,t){t.split(/[,\s]+/i).forEach(e=>{const n=xt(e.trim());n!=""&&s.removeAttribute(n)})}function Sc(s,t){for(const e in t){const n=t[e];switch(e){case"fill":n!=="none"&&(s.fillStyle=n);break;case"stroke":n!=="none"&&(s.strokeStyle=n);break;case"stroke-width":case"strokeWidth":s.lineWidth=Number(n);break;case"stroke-linecap":case"strokeLinecap":s.lineCap=n;break;case"stroke-linejoin":case"strokeLinejoin":switch(n){case"round":case"bevel":case"miter":s.lineJoin=n;break;default:s.lineJoin="miter";break}break;case"stroke-miterlimit":case"strokeMiterlimit":s.miterLimit=Number(n);break;case"stroke-opacity":case"strokeOpacity":break;case"stroke-dashoffset":case"strokeDashoffset":s.lineDashOffset=Number(n);break;case"stroke-dasharray":case"strokeDasharray":typeof n=="string"&&s.setLineDash(n.split(/\s+/).map(i=>Number(i)));break;case"cursor":break;case"font":typeof n=="string"&&(s.font=n);break;case"font-size":case"fontSize":s.font+=` ${n}`;break;case"font-family":case"fontFamily":s.font+=` ${n}`;break;case"font-weight":case"fontWeight":break;case"font-style":case"fontStyle":break;case"text-anchor":case"textAnchor":switch(n){case"middle":s.textAlign="center";break;case"end":s.textAlign="end";break;case"start":s.textAlign="start";break}break;case"alignment-baseline":case"alignmentBaseline":switch(n){case"middle":case"bottom":case"top":case"alphabetic":case"hanging":case"ideographic":s.textBaseline=n;break;default:s.textBaseline="alphabetic";break}break}}}function Ag(s,t,e,n,i){const r=t/e;let o=0,a=0;switch(s){case"aspectFit":r>=1?(o=n,a=o/r,a>i&&(a=i,o=a*r)):(a=i,o=a*r,o>n&&(o=n,a=o/r));break;case"aspectFill":r>=1?(a=i,o=a*r):(o=n,a=o/r);break;case"widthFix":o=n,a=o/r;break;case"heightFix":a=i,o=a*r;break;case"scaleToFill":default:o=n,a=i;break}return{width:o,height:a}}function Cc(s){try{const t=document.createElement("canvas"),e=t.getContext("2d");return t.width=s.width,t.height=s.height,e.drawImage(s,0,0,t.width,t.height),e.getImageData(0,0,t.width,t.height)}catch{return new ImageData(s.width,s.height)}}const kg=s=>{const t=s.width,e=s.height,n=t*e*3,i=n+54,r=[66,77,i&255,i>>8&255,i>>16&255,i>>24&255,0,0,0,0,54,0,0,0],o=[40,0,0,0,t&255,t>>8&255,t>>16&255,t>>24&255,e&255,e>>8&255,e>>16&255,e>>24&255,1,0,24,0,0,0,0,0,n&255,n>>8&255,n>>16&255,n>>24&255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],a=(4-t*3%4)%4,h=s.data;let c="";const u=t<<2;let l=e;const m=String.fromCharCode;do{const p=u*(l-1);let y="";for(let v=0;v<t;v++){const w=v<<2;y+=m(h[p+w+2])+m(h[p+w+1])+m(h[p+w])}for(let v=0;v<a;v++)y+=String.fromCharCode(0);c+=y}while(--l);function f(p){if(!window.btoa)throw"btoa undefined";let y="";if(typeof p=="string")y=p;else for(let v=0;v<p.length;v++)y+=String.fromCharCode(p[v]);return btoa(y)}return f(r.concat(o))+f(c)};function Ig(s){const{width:t,height:e}=s,n=document.createElement("canvas"),i=n.getContext("2d");return n.width=t,n.height=e,i.putImageData(s,0,0,0,0,t,e),n.toDataURL("image/png")}const Dg=(s,t,e)=>{const{width:n,height:i}=s,r=document.createElement("canvas"),o=r.getContext("2d");r.width=n,r.height=i,o.putImageData(s,0,0,0,0,n,i);const a=`image/${t?t.toLowerCase():"png"}`;r.toBlob(h=>{e?.(null,h)},a,1)};function Lg(s,t){return createImageBitmap(s,t)}function Rg(s){const t=[],e=[],n=[];let i=0;for(let h=0,c=s.data.length;h<c;h+=4)t[i]=s.data[h],e[i]=s.data[h+1],n[i]=s.data[h+2],i+=1;const r=Wr(t),o=Wr(e),a=Wr(n);return"rgb("+r+","+o+","+a+")"}function Wr(s){const t={},e=[],n=[];for(let a=0;a<s.length;a++)t[s[a]]?e.push(s[a]):t[s[a]]=1;let i=0;for(let a=0;a<e.length;a++){i=0;for(let h=0;h<e.length;h++)e[a]===e[h]&&(i+=1),n[a]=i}const r=Math.max.apply(null,n);let o=0;for(;o<n.length;o++)if(n[o]===r)return;return e[o]}const Og=s=>{const{data:t,width:e,height:n}=s,i=new Uint8ClampedArray(t.length);for(let o=0;o<n;o++)for(let a=0;a<e;a++){const h=(o*e+a)*4;i[h]=t[(o*e+e-a-1)*4],i[h+1]=t[(o*e+e-a-1)*4+1],i[h+2]=t[(o*e+e-a-1)*4+2],i[h+3]=t[(o*e+e-a-1)*4+3]}return new ImageData(i,e,n)},zg=s=>{const{data:t,width:e,height:n}=s,i=new Uint8ClampedArray(t.length);for(let o=0;o<n;o++)for(let a=0;a<e;a++){const h=(o*e+a)*4;i[h]=t[((n-o-1)*e+a)*4],i[h+1]=t[((n-o-1)*e+a)*4+1],i[h+2]=t[((n-o-1)*e+a)*4+2],i[h+3]=t[((n-o-1)*e+a)*4+3]}return new ImageData(i,e,n)},Ng=s=>{const{data:t,width:e,height:n}=s,i=new Uint8ClampedArray(t.length);for(let o=0;o<e;o++)for(let a=0;a<n;a++){const h=(o*n+a)*4;i[h]=t[(a*e+e-o-1)*4],i[h+1]=t[(a*e+e-o-1)*4+1],i[h+2]=t[(a*e+e-o-1)*4+2],i[h+3]=t[(a*e+e-o-1)*4+3]}return new ImageData(i,n,e)},Bg=s=>{const{data:t,width:e,height:n}=s,i=new Uint8ClampedArray(t.length);for(let o=0;o<e;o++)for(let a=0;a<n;a++){const h=(o*n+a)*4;i[h]=t[((n-a-1)*e+o)*4],i[h+1]=t[((n-a-1)*e+o)*4+1],i[h+2]=t[((n-a-1)*e+o)*4+2],i[h+3]=t[((n-a-1)*e+o)*4+3]}return new ImageData(i,n,e)},Fg=s=>{const{data:t,width:e,height:n}=s,i=new Uint8ClampedArray(t.length);for(let o=0;o<n;o++)for(let a=0;a<e;a++){const h=(o*e+a)*4,c=(t[h]+t[h+1]+t[h+2])/3;i[h]=c,i[h+1]=c,i[h+2]=c,i[h+3]=t[h+3]}return new ImageData(i,e,n)},Yg=s=>{const{data:t,width:e,height:n}=s,i=new Uint8ClampedArray(t.length);for(let o=0;o<n;o++)for(let a=0;a<e;a++){const h=(o*e+a)*4,c=.2126*t[h]+.7152*t[h+1]+.0722*t[h+2];i[h]=c,i[h+1]=c,i[h+2]=c,i[h+3]=t[h+3]}return new ImageData(i,e,n)},$g=s=>{const{data:t,width:e,height:n}=s,i=new Uint8ClampedArray(t.length);for(let o=0;o<n;o++)for(let a=0;a<e;a++){const h=(o*e+a)*4,u=(t[h]+t[h+1]+t[h+2])/3>127?255:0;i[h]=u,i[h+1]=u,i[h+2]=u,i[h+3]=t[h+3]}return new ImageData(i,e,n)},Xg=s=>{const{data:t,width:e,height:n}=s,i=new Uint8ClampedArray(t.length);for(let o=0;o<n;o++)for(let a=0;a<e;a++){const h=(o*e+a)*4;i[h]=255-t[h],i[h+1]=255-t[h+1],i[h+2]=255-t[h+2],i[h+3]=t[h+3]}return new ImageData(i,e,n)},Ug=s=>{const{data:t,width:e,height:n}=s,i=new Uint8ClampedArray(t.length);for(let o=0;o<n;o++)for(let a=0;a<e;a++){const h=(o*e+a)*4;i[h]=t[h],i[h+1]=0,i[h+2]=0,i[h+3]=t[h+3]}return new ImageData(i,e,n)},Vg=s=>{const{data:t,width:e,height:n}=s,i=new Uint8ClampedArray(t.length);for(let o=0;o<n;o++)for(let a=0;a<e;a++){const h=(o*e+a)*4;i[h]=0,i[h+1]=t[h+1],i[h+2]=0,i[h+3]=t[h+3]}return new ImageData(i,e,n)},Gg=s=>{const{data:t,width:e,height:n}=s,i=new Uint8ClampedArray(t.length);for(let o=0;o<n;o++)for(let a=0;a<e;a++){const h=(o*e+a)*4;i[h]=0,i[h+1]=0,i[h+2]=t[h+2],i[h+3]=t[h+3]}return new ImageData(i,e,n)},qg=s=>{const{data:t,width:e,height:n}=s,i=new Uint8ClampedArray(t.length);for(let o=0;o<n;o++)for(let a=0;a<e;a++){const h=(o*e+a)*4;i[h]=t[h],i[h+1]=t[h+1],i[h+2]=0,i[h+3]=t[h+3]}return new ImageData(i,e,n)},jg=s=>{const{data:t,width:e,height:n}=s,i=new Uint8ClampedArray(t.length);for(let o=0;o<n;o++)for(let a=0;a<e;a++){const h=(o*e+a)*4;i[h]=t[h],i[h+1]=0,i[h+2]=t[h+1],i[h+3]=t[h+3]}return new ImageData(i,e,n)},Hg=s=>{const{data:t,width:e,height:n}=s,i=new Uint8ClampedArray(t.length);for(let o=0;o<n;o++)for(let a=0;a<e;a++){const h=(o*e+a)*4;i[h]=0,i[h+1]=t[h+1],i[h+2]=t[h+1],i[h+3]=t[h+3]}return new ImageData(i,e,n)},Wg=s=>{const{data:t,width:e,height:n}=s,i=new Uint8ClampedArray(t.length);for(let o=0;o<n;o++)for(let a=0;a<e;a++){const h=(o*e+a)*4,c=(t[h+1]+t[h+2])/2;i[h]=t[h],i[h+1]=c,i[h+2]=c,i[h+3]=t[h+3]}return new ImageData(i,e,n)},Jg=s=>{const{data:t,width:e,height:n}=s,i=new Uint8ClampedArray(t.length);for(let o=0;o<n;o++)for(let a=0;a<e;a++){const h=(o*e+a)*4,c=(t[h]+t[h+2])/2;i[h]=c,i[h+1]=t[h+1],i[h+2]=c,i[h+3]=t[h+3]}return new ImageData(i,e,n)},Zg=s=>{const{data:t,width:e,height:n}=s,i=new Uint8ClampedArray(t.length);for(let o=0;o<n;o++)for(let a=0;a<e;a++){const h=(o*e+a)*4,c=(t[h]+t[h+1])/2;i[h]=c,i[h+1]=c,i[h+2]=t[h+2],i[h+3]=t[h+3]}return new ImageData(i,e,n)},Qg=s=>Tc(s,[-1,-1,-1,-1,9,-1,-1,-1,-1]),Kg=s=>Tc(s,[-1,-1,-1,-1,8,-1,-1,-1,-1]),t0=s=>{const{data:t,width:e,height:n}=s,i=new Uint8ClampedArray(t.length);for(let o=0;o<n;o++)for(let a=0;a<e;a++){const h=(o*e+a)*4;i[h]=t[h],i[h+1]=t[h+1],i[h+2]=t[h+2],i[h+3]=255}return new ImageData(i,e,n)},e0=s=>{const{data:t,width:e,height:n}=s,i=new Uint8ClampedArray(t.length);for(let o=0;o<n;o++)for(let a=0;a<e;a++){const h=(o*e+a)*4;if(t[h+3]===0)i[h]=255,i[h+1]=255,i[h+2]=255,i[h+3]=255;else{const c=Ec([t[h],t[h+1],t[h+2],t[h+3]],[255,255,255,255]);i[h]=c[0],i[h+1]=c[1],i[h+2]=c[2],i[h+3]=c[3]}}return new ImageData(i,e,n)};function n0(s,t,e,n,i,r=!1,o){const{data:a,width:h,height:c}=s;let u=i,l=n,m=t,f=e;if(u<0?u=0:u>h&&(u=h),l<0?l=0:l>c&&(l=c),m<1?m=1:m>h&&(m=h),f<1?f=1:f>c&&(f=c),u+m>h&&(m=h-u),l+f>c&&(f=c-l),r){const p=new Uint8ClampedArray(a.length);for(let v=0;v<c;v++)for(let w=0;w<h;w++){const _=(v*h+w)*4;w>=u&&w<=u+m&&v>=l&&v<=l+f?(p[_]=a[_],p[_+1]=a[_+1],p[_+2]=a[_+2],p[_+3]=a[_+3]):(p[_]=255,p[_+1]=255,p[_+2]=255,p[_+3]=o&&["JPG","JPEG"].includes(o.toUpperCase())?255:0)}return new ImageData(p,h,c)}else{const p=new Uint8ClampedArray(m*f*4);for(let v=l;v<=l+f;v++)for(let w=u;w<=u+m;w++){const _=((v-l)*m+w-u)*4,x=(v*h+w)*4;p[_]=a[x],p[_+1]=a[x+1],p[_+2]=a[x+2],p[_+3]=a[x+3]}return new ImageData(p,m,f)}}function s0(s,t,e,n){const{data:i,width:r,height:o}=s;let a=t;a>Math.floor(r/2)&&(a=Math.floor(r/2)),a>Math.floor(o/2)&&(a=Math.floor(o/2)),a<0&&(a=0);const h=new Uint8ClampedArray(i.length);for(let u=0;u<o;u++)for(let l=0;l<r;l++){const m=(u*r+l)*4;let f=-1;l<a?u<a?f=Math.sqrt(Math.pow(a-l-1,2)+Math.pow(a-u-1,2)):u>o-a-1&&(f=Math.sqrt(Math.pow(a-l-1,2)+Math.pow(u-(o-a),2))):l>r-a-1&&(u<a?f=Math.sqrt(Math.pow(l-(r-a),2)+Math.pow(a-u-1,2)):u>o-a-1&&(f=Math.sqrt(Math.pow(l-(r-a),2)+Math.pow(u-(o-a),2)))),Math.round(f)>a?(h[m]=255,h[m+1]=255,h[m+2]=255,h[m+3]=n||e.toUpperCase()==="PNG"?0:255):(h[m]=i[m],h[m+1]=i[m+1],h[m+2]=i[m+2],h[m+3]=n||e.toUpperCase()==="PNG"?i[m+3]:255)}return new ImageData(h,r,o)}function i0(s,t,e,n,i,r=1e4){const o=new Image;o.src=s;const a=document.createElement("canvas"),h=a.getContext("2d");return a.width=r,a.height=r,h.drawImage(o,0,0,t,e,0,0,n,i),h.getImageData(0,0,n,i)}function r0(s,t){const{data:e,width:n,height:i}=s,r=new Uint8ClampedArray(e.length);for(let a=0;a<i;a++)for(let h=0;h<n;h++){const c=(a*n+h)*4;r[c]=Math.max(Math.min(e[c]+t,255),0),r[c+1]=Math.max(Math.min(e[c+1]+t,255),0),r[c+2]=Math.max(Math.min(e[c+2]+t,255),0),r[c+3]=e[c+3]}return new ImageData(r,n,i)}function o0(s,t,e=!1){const{data:n,width:i,height:r}=s,o=new Uint8ClampedArray(n.length);for(let h=0;h<r;h++)for(let c=0;c<i;c++){const u=(h*i+c)*4;n[u+3]===0?(o[u]=255,o[u+1]=255,o[u+2]=255):(o[u]=n[u],o[u+1]=n[u+1],o[u+2]=n[u+2]);let l=n[u+3];e?l=Math.max(Math.min(Math.floor(255*t),255),0):l=Math.max(Math.min(Math.floor(l+255*t),255),0),o[u+3]=l}return new ImageData(o,i,r)}function a0(s,t,e,n){const{data:i,width:r,height:o}=s,{data:a,width:h,height:c}=t;let u=e,l=n;e+c>o&&(u=o-c),n+h>r&&(l=r-h);const m=new Uint8ClampedArray(i.length);for(let p=0;p<o;p++)for(let y=0;y<r;y++){const v=(p*r+y)*4;if(y<l||y>l+h||p<=u||p>=u+c)m[v]=i[v],m[v+1]=i[v+1],m[v+2]=i[v+2],m[v+3]=i[v+3];else{const w=(p*r+y-((u+1)*r+(p-(u+1))*(r-h))+h-l-1)*4,_=[a[w],a[w+1],a[w+2],a[w+3]],x=[i[v],i[v+1],i[v+2],i[v+3]],b=Ec(_,x);m[v]=b[0],m[v+1]=b[1],m[v+2]=b[2],m[v+3]=b[3]}}return new ImageData(m,r,o)}function h0(s,t,e,n,i,r=10){const{data:o,width:a,height:h}=s;let c=i,u=n,l=t,m=e;c<0?c=0:c>a&&(c=a),u<0?u=0:u>h&&(u=h),l<1?l=1:l>a&&(l=a),m<1?m=1:m>h&&(m=h),c+l>a&&(l=a-c),u+m>h&&(m=h-u);const f=new Uint8ClampedArray(o.length);for(let y=0;y<h;y++)for(let v=0;v<a;v++){const w=(y*a+v)*4;if(v>=c&&v<=c+l&&y>=u&&y<=u+m){const _=Math.floor((v-c)/r),x=Math.floor((y-u)/r);let b=Math.floor(r*(_+1)-r/2+c),E=Math.floor(r*(x+1)-r/2+u);b>a-1&&(b=a-1),E>h-1&&(E=h-1);const C=(E*a+b)*4;f[w]=o[C],f[w+1]=o[C+1],f[w+2]=o[C+2],f[w+3]=o[C+3]}else f[w]=o[w],f[w+1]=o[w+1],f[w+2]=o[w+2],f[w+3]=o[w+3]}return new ImageData(f,a,h)}function c0(s,t,e={backgroundColor:{r:0,g:0,b:0,a:255},changeIntoColor:{r:0,g:0,b:0,a:0}}){if(t&&e){const{data:n,width:i,height:r}=s,{data:o}=t,a=new Uint8ClampedArray(n.length),{backgroundColor:h,changeIntoColor:c}=e;for(let l=0;l<r;l++)for(let m=0;m<i;m++){const f=(l*i+m)*4,p=o[f],y=o[f+1],v=o[f+2],w=o[f+3];p===h.r&&y===h.g&&v===h.b&&w===h.a&&c.a!==0?(a[f]=c.r,a[f+1]=c.g,a[f+2]=c.b,a[f+3]=c.a):(a[f]=n[f],a[f+1]=n[f+1],a[f+2]=n[f+2],a[f+3]=n[f+3])}return new ImageData(a,i,r)}return s}function Tc(s,t){const{data:e,width:n,height:i}=s,r=new Uint8ClampedArray(e.length);for(let a=0;a<i;a++)for(let h=0;h<n;h++){const c=(a*n+h)*4;for(let u=0;u<3;u++){const l=c+u;h===0||h===n-1||a===0||a===i-1?r[l]=e[l]:r[l]=t[0]*e[l-n*4-4]+t[1]*e[l-n*4]+t[2]*e[l-n*4+4]+t[3]*e[l-4]+t[4]*e[l]+t[5]*e[l+4]+t[6]*e[l+n*4-4]+t[7]*e[l+n*4]+t[8]*e[l+n*4+4]}r[c+3]=e[c+3]}return new ImageData(r,n,i)}function Ec(s,t){if(s&&s.length===4&&t&&t.length===4){const e=s[3],n=t[3];if(e===255||n===0)return s;if(e===0)return t;{const i=e/255,r=n/255,o=Math.max(Math.min(Math.floor(s[0]*i+t[0]*r*(1-i)),255),0),a=Math.max(Math.min(Math.floor(s[1]*i+t[1]*r*(1-i)),255),0),h=Math.max(Math.min(Math.floor(s[2]*i+t[2]*r*(1-i)),255),0),c=Math.max(Math.min(Math.floor((i+r*(1-i))*255),255),0);return[o,a,h,c]}}return[255,255,255,255]}const Jr=function(){const s=[];return{writeByte(t){s.push(t&255)},writeShort(t){this.writeByte(t),this.writeByte(t>>>8)},writeBytes(t,e=0,n=t.length){for(let i=0;i<n;i++)this.writeByte(t[i+e])},writeString(t){for(let e=0,n=t.length;e<n;e++)this.writeByte(t.charCodeAt(e))},toByteArray(){return s},toString(){let t="[";for(let e=0,n=s.length;e<n;e++)e>0&&(t+=","),t+=s[e];return t+="]",t}}},Pc=function(){let s=0,t=0,e=0,n="";const i=function(o){if(!(o<0)){if(o<26)return 65+o;if(o<52)return 97+(o-26);if(o<62)return 48+(o-52);if(o==62)return 43;if(o==63)return 47}throw new Error("n:"+o)},r=function(o){n+=String.fromCharCode(i(o&63))};return{writeByte(o){for(s=s<<8|o&255,t+=8,e+=1;t>=6;)r(s>>>t-6),t-=6},flush(){if(t>0&&(r(s<<6-t),s=0,t=0),e%3!=0){const o=3-e%3;for(let a=0;a<o;a++)n+="="}},toString(){return n}}},Mc=function(s,t,e){const n=new Array(s*s),i=function(a){const h=a;let c=0,u=0;return{write(l,m){if(l>>>m)throw new Error("length over");for(;c+m>=8;)h.writeByte(255&(l<<c|u)),m-=8-c,l>>>=8-c,u=0,c=0;u=l<<c|u,c=c+m},flush(){c>0&&h.writeByte(u)}}},r=function(a){const h=1<<a,c=(1<<a)+1;let u=a+1;const l=o();for(let v=0;v<h;v++)l.add(String.fromCharCode(v));l.add(String.fromCharCode(h)),l.add(String.fromCharCode(c));const m=Jr(),f=i(m);f.write(h,u);let p=0,y=String.fromCharCode(n[p]);for(p+=1;p<n.length;){const v=String.fromCharCode(n[p]);p+=1,l.contains(y+v)?y=y+v:(f.write(l.indexOf(y),u),l.size()<4095&&(l.size()==1<<u&&(u+=1),l.add(y+v)),y=v)}return f.write(l.indexOf(y),u),f.write(c,u),f.flush(),m.toByteArray()},o=function(){const a={};let h=0;return{add(c){if(this.contains(c))throw new Error("dup key:"+c);a[c]=h,h+=1},size(){return h},indexOf(c){return a[c]},contains(c){return typeof a[c]<"u"}}};return{setPixel(a,h,c){n[h*s+a]=c},write(a){a.writeString("GIF87a"),a.writeShort(s),a.writeShort(s),a.writeByte(128),a.writeByte(0),a.writeByte(0),a.writeByte(hn("0x"+t[1]+t[2])),a.writeByte(hn("0x"+t[3]+t[4])),a.writeByte(hn("0x"+t[5]+t[6])),a.writeByte(hn("0x"+e[1]+e[2])),a.writeByte(hn("0x"+e[3]+e[4])),a.writeByte(hn("0x"+e[5]+e[6])),a.writeString(","),a.writeShort(0),a.writeShort(0),a.writeShort(s),a.writeShort(s),a.writeByte(0);const h=2,c=r(h);a.writeByte(h);let u=0;for(;c.length-u>255;)a.writeByte(255),a.writeBytes(c,u,255),u+=255;a.writeByte(c.length-u),a.writeBytes(c,u,c.length-u),a.writeByte(0),a.writeString(";")}}},Ac=function(s,t,e,n){const i=Mc(s,t,e);for(let c=0;c<s;c++)for(let u=0;u<s;u++)i.setPixel(u,c,n(u,c));const r=Jr();i.write(r);const o=Pc(),a=r.toByteArray();for(let c=0,u=a.length;c<u;c++)o.writeByte(a[c]);o.flush();let h="";return h+="data:image/gif;base64,",h+=o,h},Bt={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},qn={M:0,L:1,H:2,Q:3},De={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},dt={glog:function(s){if(s<1)throw new Error("glog("+s+")");return dt.LOG_TABLE[s]},gexp:function(s){for(;s<0;)s+=255;for(;s>=256;)s-=255;return dt.EXP_TABLE[s]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)};for(let s=0;s<8;s++)dt.EXP_TABLE[s]=1<<s;for(let s=8;s<256;s++)dt.EXP_TABLE[s]=dt.EXP_TABLE[s-4]^dt.EXP_TABLE[s-5]^dt.EXP_TABLE[s-6]^dt.EXP_TABLE[s-8];for(let s=0;s<255;s++)dt.LOG_TABLE[dt.EXP_TABLE[s]]=s;const Q={PATTERN_POSITION_TABLE:[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],G15:1335,G18:7973,G15_MASK:21522,getBCHTypeInfo:function(s){let t=s<<10;for(;Q.getBCHDigit(t)-Q.getBCHDigit(Q.G15)>=0;)t^=Q.G15<<Q.getBCHDigit(t)-Q.getBCHDigit(Q.G15);return(s<<10|t)^Q.G15_MASK},getBCHTypeNumber:function(s){let t=s<<12;for(;Q.getBCHDigit(t)-Q.getBCHDigit(Q.G18)>=0;)t^=Q.G18<<Q.getBCHDigit(t)-Q.getBCHDigit(Q.G18);return s<<12|t},getBCHDigit:function(s){let t=0;for(;s!=0;)t++,s>>>=1;return t},getPatternPosition:function(s){return Q.PATTERN_POSITION_TABLE[s-1]},getMask:function(s,t,e){switch(s){case De.PATTERN000:return(t+e)%2==0;case De.PATTERN001:return t%2==0;case De.PATTERN010:return e%3==0;case De.PATTERN011:return(t+e)%3==0;case De.PATTERN100:return(Math.floor(t/2)+Math.floor(e/3))%2==0;case De.PATTERN101:return t*e%2+t*e%3==0;case De.PATTERN110:return(t*e%2+t*e%3)%2==0;case De.PATTERN111:return(t*e%3+(t+e)%2)%2==0;default:throw new Error("bad maskPattern:"+s)}},getErrorCorrectPolynomial:function(s){let t=new xn([1],0);for(let e=0;e<s;e++)t=t.multiply(new xn([1,dt.gexp(e)],0));return t},getLengthInBits:function(s,t){if(1<=t&&t<10)switch(s){case Bt.MODE_NUMBER:return 10;case Bt.MODE_ALPHA_NUM:return 9;case Bt.MODE_8BIT_BYTE:return 8;case Bt.MODE_KANJI:return 8;default:throw new Error("mode:"+s)}else if(t<27)switch(s){case Bt.MODE_NUMBER:return 12;case Bt.MODE_ALPHA_NUM:return 11;case Bt.MODE_8BIT_BYTE:return 16;case Bt.MODE_KANJI:return 10;default:throw new Error("mode:"+s)}else if(t<41)switch(s){case Bt.MODE_NUMBER:return 14;case Bt.MODE_ALPHA_NUM:return 13;case Bt.MODE_8BIT_BYTE:return 16;case Bt.MODE_KANJI:return 12;default:throw new Error("mode:"+s)}else throw new Error("type:"+t)},getLostPoint:function(s){const t=s.getModuleCount();let e=0;for(let r=0;r<t;r++)for(let o=0;o<t;o++){let a=0;const h=s.isDark(r,o);for(let c=-1;c<=1;c++)if(!(r+c<0||t<=r+c))for(let u=-1;u<=1;u++)o+u<0||t<=o+u||c==0&&u==0||h==s.isDark(r+c,o+u)&&a++;a>5&&(e+=3+a-5)}for(let r=0;r<t-1;r++)for(let o=0;o<t-1;o++){let a=0;s.isDark(r,o)&&a++,s.isDark(r+1,o)&&a++,s.isDark(r,o+1)&&a++,s.isDark(r+1,o+1)&&a++,(a==0||a==4)&&(e+=3)}for(let r=0;r<t;r++)for(let o=0;o<t-6;o++)s.isDark(r,o)&&!s.isDark(r,o+1)&&s.isDark(r,o+2)&&s.isDark(r,o+3)&&s.isDark(r,o+4)&&!s.isDark(r,o+5)&&s.isDark(r,o+6)&&(e+=40);for(let r=0;r<t;r++)for(let o=0;o<t-6;o++)s.isDark(o,r)&&!s.isDark(o+1,r)&&s.isDark(o+2,r)&&s.isDark(o+3,r)&&s.isDark(o+4,r)&&!s.isDark(o+5,r)&&s.isDark(o+6,r)&&(e+=40);let n=0;for(let r=0;r<t;r++)for(let o=0;o<t;o++)s.isDark(o,r)&&n++;const i=Math.abs(100*n/t/t-50)/5;return e+=i*10,e}};class xn{num;constructor(t,e){if(t.length==null)throw new Error(t.length+"/"+e);let n=0;for(;n<t.length&&t[n]==0;)n++;this.num=new Array(t.length-n+e);for(let i=0;i<t.length-n;i++)this.num[i]=t[i+n]}get(t){return this.num[t]}getLength(){return this.num.length}multiply(t){const e=new Array(this.getLength()+t.getLength()-1);for(let n=0;n<this.getLength();n++)for(let i=0;i<t.getLength();i++)e[n+i]^=dt.gexp(dt.glog(this.get(n))+dt.glog(t.get(i)));return new xn(e,0)}mod(t){if(this.getLength()-t.getLength()<0)return this;const e=dt.glog(this.get(0))-dt.glog(t.get(0)),n=new Array(this.getLength());for(let i=0;i<this.getLength();i++)n[i]=this.get(i);for(let i=0;i<t.getLength();i++)n[i]^=dt.gexp(dt.glog(t.get(i))+e);return new xn(n,0).mod(t)}}class pe{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=pe.getRsBlockTable(t,e);if(n==null)throw new Error("bad rs block @ typeNumber:"+t+"/errorCorrectLevel:"+e);const i=n.length/3,r=[];for(let o=0;o<i;o++){const a=n[o*3+0],h=n[o*3+1],c=n[o*3+2];for(let u=0;u<a;u++)r.push(new pe(h,c))}return r}static getRsBlockTable(t,e){switch(e){case qn.L:return pe.RS_BLOCK_TABLE[(t-1)*4+0];case qn.M:return pe.RS_BLOCK_TABLE[(t-1)*4+1];case qn.Q:return pe.RS_BLOCK_TABLE[(t-1)*4+2];case qn.H:return pe.RS_BLOCK_TABLE[(t-1)*4+3];default:return}}}class kc{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 u0{mode;data;constructor(t){this.mode=Bt.MODE_8BIT_BYTE,this.data=t}getLength(){return this.data.length}write(t){for(let e=0,n=this.data.length;e<n;e++)t.put(this.data.charCodeAt(e),8)}}class Le{static PAD0=236;static PAD1=17;typeNumber;errorCorrectLevel;modules;moduleCount;dataCache;dataList;constructor(t,e){this.typeNumber=t,this.errorCorrectLevel=qn[e],this.modules=[],this.moduleCount=0,this.dataCache=null,this.dataList=[]}addData(t){const e=new u0(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=pe.getRSBlocks(t,this.errorCorrectLevel),n=new kc;let i=0;for(let r=0;r<e.length;r++)i+=e[r].dataCount;for(let r=0;r<this.dataList.length;r++){const o=this.dataList[r];n.put(o.mode,4),n.put(o.getLength(),Q.getLengthInBits(o.mode,t)),o.write(n)}if(n.getLengthInBits()<=i*8)break}this.typeNumber=t}this.makeImpl(!1,this.getBestMaskPattern())}makeImpl(t,e){this.moduleCount=this.typeNumber*4+17,this.modules=new Array(this.moduleCount);for(let n=0;n<this.moduleCount;n++){this.modules[n]=new Array(this.moduleCount);for(let i=0;i<this.moduleCount;i++)this.modules[n][i]=null}this.setupPositionProbePattern(0,0),this.setupPositionProbePattern(this.moduleCount-7,0),this.setupPositionProbePattern(0,this.moduleCount-7),this.setupPositionAdjustPattern(),this.setupTimingPattern(),this.setupTypeInfo(t,e),this.typeNumber>=7&&this.setupTypeNumber(t),this.dataCache==null&&(this.dataCache=Le.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,e)}setupPositionProbePattern(t,e){for(let n=-1;n<=7;n++)if(!(t+n<=-1||this.moduleCount<=t+n))for(let i=-1;i<=7;i++)e+i<=-1||this.moduleCount<=e+i||(0<=n&&n<=6&&(i==0||i==6)||0<=i&&i<=6&&(n==0||n==6)||2<=n&&n<=4&&2<=i&&i<=4?this.modules[t+n][e+i]=!0:this.modules[t+n][e+i]=!1)}getBestMaskPattern(){let t=0,e=0;for(let n=0;n<8;n++){this.makeImpl(!0,n);const i=Q.getLostPoint(this);(n==0||t>i)&&(t=i,e=n)}return e}createMovieClip(t,e,n){const i=t.createEmptyMovieClip(e,n),r=1;this.make();for(let o=0;o<this.modules.length;o++){const a=o*r;for(let h=0;h<this.modules[o].length;h++){const c=h*r;this.modules[o][h]&&(i.beginFill(0,100),i.moveTo(c,a),i.lineTo(c+r,a),i.lineTo(c+r,a+r),i.lineTo(c,a+r),i.endFill())}}return i}setupTimingPattern(){for(let t=8;t<this.moduleCount-8;t++)this.modules[t][6]==null&&(this.modules[t][6]=t%2==0);for(let t=8;t<this.moduleCount-8;t++)this.modules[6][t]==null&&(this.modules[6][t]=t%2==0)}setupPositionAdjustPattern(){const t=Q.getPatternPosition(this.typeNumber);for(let e=0;e<t.length;e++)for(let n=0;n<t.length;n++){const i=t[e],r=t[n];if(this.modules[i][r]==null)for(let o=-2;o<=2;o++)for(let a=-2;a<=2;a++)o==-2||o==2||a==-2||a==2||o==0&&a==0?this.modules[i+o][r+a]=!0:this.modules[i+o][r+a]=!1}}setupTypeNumber(t){const e=Q.getBCHTypeNumber(this.typeNumber);for(let n=0;n<18;n++){const i=!t&&(e>>n&1)==1;this.modules[Math.floor(n/3)][n%3+this.moduleCount-8-3]=i}for(let n=0;n<18;n++){const i=!t&&(e>>n&1)==1;this.modules[n%3+this.moduleCount-8-3][Math.floor(n/3)]=i}}setupTypeInfo(t,e){const n=this.errorCorrectLevel<<3|e,i=Q.getBCHTypeInfo(n);for(let r=0;r<15;r++){const o=!t&&(i>>r&1)==1;r<6?this.modules[r][8]=o:r<8?this.modules[r+1][8]=o:this.modules[this.moduleCount-15+r][8]=o}for(let r=0;r<15;r++){const o=!t&&(i>>r&1)==1;r<8?this.modules[8][this.moduleCount-r-1]=o:r<9?this.modules[8][15-r-1+1]=o:this.modules[8][15-r-1]=o}this.modules[this.moduleCount-8][8]=!t}mapData(t,e){let n=-1,i=this.moduleCount-1,r=7,o=0;for(let a=this.moduleCount-1;a>0;a-=2)for(a==6&&a--;;){for(let h=0;h<2;h++)if(this.modules[i][a-h]==null){let c=!1;o<t.length&&(c=(t[o]>>>r&1)==1),Q.getMask(e,i,a-h)&&(c=!c),this.modules[i][a-h]=c,r--,r==-1&&(o++,r=7)}if(i+=n,i<0||this.moduleCount<=i){i-=n,n=-n;break}}}static createData(t,e,n){const i=pe.getRSBlocks(t,e),r=new kc;for(let a=0;a<n.length;a++){const h=n[a];r.put(h.mode,4),r.put(h.getLength(),Q.getLengthInBits(h.mode,t)),h.write(r)}let o=0;for(let a=0;a<i.length;a++)o+=i[a].dataCount;if(r.getLengthInBits()>o*8)throw new Error("code length overflow. ("+r.getLengthInBits()+">"+o*8+")");for(r.getLengthInBits()+4<=o*8&&r.put(0,4);r.getLengthInBits()%8!=0;)r.putBit(!1);for(;!(r.getLengthInBits()>=o*8||(r.put(Le.PAD0,8),r.getLengthInBits()>=o*8));)r.put(Le.PAD1,8);return Le.createBytes(r,i)}static createBytes(t,e){let n=0,i=0,r=0;const o=new Array(e.length),a=new Array(e.length);for(let l=0;l<e.length;l++){const m=e[l].dataCount,f=e[l].totalCount-m;i=Math.max(i,m),r=Math.max(r,f),o[l]=new Array(m);for(let w=0;w<o[l].length;w++)o[l][w]=255&t.buffer[w+n];n+=m;const p=Q.getErrorCorrectPolynomial(f),v=new xn(o[l],p.getLength()-1).mod(p);a[l]=new Array(p.getLength()-1);for(let w=0;w<a[l].length;w++){const _=w+v.getLength()-a[l].length;a[l][w]=_>=0?v.get(_):0}}let h=0;for(let l=0;l<e.length;l++)h+=e[l].totalCount;const c=new Array(h);let u=0;for(let l=0;l<i;l++)for(let m=0;m<e.length;m++)l<o[m].length&&(c[u++]=o[m][l]);for(let l=0;l<r;l++)for(let m=0;m<e.length;m++)l<a[m].length&&(c[u++]=a[m][l]);return c}}const Ic=Math.ceil,jn=Math.floor,Dc=Math.round;function l0(s,t){const e=pa(s),n=t?.ecc||"H",i=t?.size||256,r=-1,o=t?.padding||0,a=t?.color||"#000000",h=t?.background||"#ffffff",c=new Le(r,n);c.addData(e),c.make();const u=c.getModuleCount(),l=(i-o*2)/u,m=o,f=i-o;return Ac(i,a,h,function(p,y){if(m<=p&&p<f&&m<=y&&y<f){const v=jn((p-m)/l),w=jn((y-m)/l);return c.isDark(w,v)?0:1}else return 1})}function f0(s,t){const e=t.x||0,n=t.y||0,i=pa(s),r=t.ctx,o=t.ecc||"H",a=typeof t.size=="number"?jn(t.size):256,h=t.padding||0,c=-1,u=t.color||"#000000",l=t.background||"#ffffff",m=new Le(c,o);m.addData(i),m.make();const f=m.getModuleCount(),p=(a-h*2)/f;r.fillStyle=l,r.fillRect(e,n,a,a);for(let y=0;y<f;y++)for(let v=0;v<f;v++){const w=Ic((v+1)*p)-jn(v*p),_=Ic((y+1)*p)-jn(y*p);r.fillStyle=m.isDark(y,v)?u:l,r.fillRect(e+Dc(v*p)+h,n+Dc(y*p)+h,w,_)}}const Gs=()=>{const s=navigator.userAgent.toLowerCase();let t="Unknown";return/iphone|ipad|ipod/i.test(s)?t="iOS":/android/i.test(s)?t="Android":/BlackBerry/i.test(s)?t="BlackBerry":/mac/i.test(s)?t="macOS":/win/i.test(s)?t="Windows":/linux/i.test(s)?t="Linux":/bsd/i.test(s)&&(t="BSD"),t.toLowerCase()};function d0(s=navigator.userAgent){let t="Unknown";if(/iPhone|iPad|iPod/i.test(s)){const e=s.match(/OS (\d+_\d+)/i);e&&(t=e[1].replace("_","."))}else if(/Android/i.test(s)){const e=s.match(/Android (\d+\.\d+)/i);e&&(t=e[1])}else if(/Mac OS X/i.test(s)){const e=s.match(/Mac OS X (\d+_\d+)/i);e&&(t=e[1].replace("_","."))}else if(/Windows NT/i.test(s)){const e=s.match(/Windows NT (\d+\.\d+)/i);e&&(t=e[1])}return t.toLowerCase()}function m0(s,t){const e=s.split("."),n=t.split(".");for(let i=0,r=e.length;i<r;i++){if(n.length==i)return 1;if(e[i]!=n[i])return e[i]>n[i]?1:-1}return e.length!=n.length?-1:0}function Zr(){const s=navigator.userAgent.toLowerCase();let t="Unknown";return/opr/i.test(s)||/opera/i.test(s)?t="Opera":/chrome/i.test(s)?t="Chrome":/firefox/i.test(s)?t="Firefox":/safari/i.test(s)?t="Safari":/edge/i.test(s)?t="Edge":/msie|trident/i.test(s)?t="IE":/MicroMessenger/i.test(s)?t="Wechat":/alipay/i.test(s)&&(t="Ali"),t.toLowerCase()}const p0=()=>{const s=navigator.userAgent;let t="Unknown";if(/Chrome/.test(s)){const e=s.match(/Chrome\/(\d+\.\d+)/);e&&(t=e[1])}else if(/Firefox/.test(s)){const e=s.match(/Firefox\/(\d+\.\d+)/);e&&(t=e[1])}else if(/Safari/.test(s)){const e=s.match(/Version\/(\d+\.\d+)/);e&&(t=e[1])}else if(/Edge/.test(s)){const e=s.match(/Edge\/(\d+\.\d+)/);e&&(t=e[1])}else if(/MSIE|Trident/.test(s)){const e=s.match(/(?:MSIE|rv:)(\d+\.\d+)/);e&&(t=e[1])}return t};function g0(){return(navigator.browserLanguage||navigator.language).toLowerCase()}function y0(){return Intl.DateTimeFormat().resolvedOptions().timeZone.toLowerCase()}function Qr(){return Gs()==="ios"}function Lc(){return Gs()==="macos"}function w0(){return Qr()|Lc()}function Rc(){return Gs()==="android"}function x0(){return Qr()||Rc()}function Oc(){const s=window.navigator.userAgent,t=s.indexOf("MSIE ");if(t>0)return parseInt(s.substring(t+5,s.indexOf(".",t)),10);if(s.indexOf("Trident/")>0){const i=s.indexOf("rv:");return parseInt(s.substring(i+3,s.indexOf(".",i)),10)}const n=s.indexOf("Edge/");return n>0?parseInt(s.substring(n+5,s.indexOf(".",n)),10):-1}const b0=Oc()!==-1,v0=document.documentMode?document.documentMode===9:!1,_0=document.documentMode?document.documentMode===10:!1,S0=document.documentMode?document.documentMode===11:!1;function zc(){return Zr()==="wechat"}function Nc(){return Zr()==="ali"}function C0(){return zc()&&navigator.userAgent.match(/miniprogram/i)||window.__wxjs_environment==="miniprogram"}function T0(){return Nc()&&navigator.userAgent.match(/miniprogram/i)}const E0=typeof document<"u",Bc=typeof window<"u",P0=typeof history<"u",M0=Bc&&window.File&&window.FileReader&&window.FileList&&window.Blob,Fc=(()=>!!(wt.Worker&&wt.Blob&&wt.Promise&&wt.OffscreenCanvas&&wt.OffscreenCanvasRenderingContext2D&&wt.HTMLCanvasElement&&wt.HTMLCanvasElement.prototype.transferControlToOffscreen&&wt.URL&&wt.URL.createObjectURL))(),A0=typeof Path2D=="function"&&typeof DOMMatrix=="function",Yc=function(){if(!wt.OffscreenCanvas)return!1;const s=new OffscreenCanvas(1,1),t=s.getContext("2d");t.fillRect(0,0,1,1);const e=s.transferToImageBitmap();try{t.createPattern(e,"no-repeat")}catch{return!1}return!0}(),k0=typeof HTMLElement=="object"?function(t){return t instanceof HTMLElement}:function(t){return t&&typeof t=="object"&&t.nodeType===1&&typeof t.nodeName=="string"},I0="webkit moz ms o".split(" ");function D0(){return"ontouchstart"in window||"ontouchend"in document||navigator.maxTouchPoints>0}const qs=new Vn,ct=new zt;function Hn(s,t){switch(t.constructor){case Float32Array:return s;case Uint32Array:return s/4294967295;case Uint16Array:return s/65535;case Uint8Array:return s/255;case Int32Array:return Math.max(s/2147483647,-1);case Int16Array:return Math.max(s/32767,-1);case Int8Array:return Math.max(s/127,-1);default:throw new Error("Invalid component type.")}}function Dt(s,t){switch(t.constructor){case Float32Array:return s;case Uint32Array:return Math.round(s*4294967295);case Uint16Array:return Math.round(s*65535);case Uint8Array:return Math.round(s*255);case Int32Array:return Math.round(s*2147483647);case Int16Array:return Math.round(s*32767);case Int8Array:return Math.round(s*127);default:throw new Error("Invalid component type.")}}class ge{array;itemSize;count;normalized;updateRanges;version;constructor(t,e,n=!1){if(Array.isArray(t))throw new TypeError("BufferAttribute: array should be a Typed Array.");this.array=t,this.itemSize=e,this.count=t.length/e,this.normalized=n,this.updateRanges=[],this.version=0}_onChangeCallback(){}set needsUpdate(t){t===!0&&this.version++}addUpdateRange(t,e){this.updateRanges.push({start:t,count:e})}clearUpdateRanges(){this.updateRanges.length=0}copy(t){return this.array=Nl(t.array),this.itemSize=t.itemSize,this.count=t.count,this.normalized=t.normalized,this}copyAt(t,e,n){t*=this.itemSize,n*=e.itemSize;for(let i=0,r=this.itemSize;i<r;i++)this.array[t+i]=e.array[n+i];return this}copyArray(t){return this.array.set(t),this}applyMatrix3(t){if(this.itemSize===2)for(let e=0,n=this.count;e<n;e++)qs.fromBufferAttribute(this,e),qs.applyMatrix3(t),this.setXY(e,qs.x,qs.y);else if(this.itemSize===3)for(let e=0,n=this.count;e<n;e++)ct.fromBufferAttribute(this,e),ct.applyMatrix3(t),this.setXYZ(e,ct.x,ct.y,ct.z);return this}applyMatrix4(t){for(let e=0,n=this.count;e<n;e++)ct.fromBufferAttribute(this,e),ct.applyMatrix4(t),this.setXYZ(e,ct.x,ct.y,ct.z);return this}applyNormalMatrix(t){for(let e=0,n=this.count;e<n;e++)ct.fromBufferAttribute(this,e),ct.applyNormalMatrix(t),this.setXYZ(e,ct.x,ct.y,ct.z);return this}transformDirection(t){for(let e=0,n=this.count;e<n;e++)ct.fromBufferAttribute(this,e),ct.transformDirection(t),this.setXYZ(e,ct.x,ct.y,ct.z);return this}set(t,e=0){return this.array.set(t,e),this}getComponent(t,e){let n=this.array[t*this.itemSize+e];return this.normalized&&(n=Hn(n,this.array)),n}setComponent(t,e,n){return this.normalized&&(n=Dt(n,this.array)),this.array[t*this.itemSize+e]=n,this}getX(t){let e=this.array[t*this.itemSize];return this.normalized&&(e=Hn(e,this.array)),e}setX(t,e){return this.normalized&&(e=Dt(e,this.array)),this.array[t*this.itemSize]=e,this}getY(t){let e=this.array[t*this.itemSize+1];return this.normalized&&(e=Hn(e,this.array)),e}setY(t,e){return this.normalized&&(e=Dt(e,this.array)),this.array[t*this.itemSize+1]=e,this}getZ(t){let e=this.array[t*this.itemSize+2];return this.normalized&&(e=Hn(e,this.array)),e}setZ(t,e){return this.normalized&&(e=Dt(e,this.array)),this.array[t*this.itemSize+2]=e,this}getW(t){let e=this.array[t*this.itemSize+3];return this.normalized&&(e=Hn(e,this.array)),e}setW(t,e){return this.normalized&&(e=Dt(e,this.array)),this.array[t*this.itemSize+3]=e,this}setXY(t,e,n){return t*=this.itemSize,this.normalized&&(e=Dt(e,this.array),n=Dt(n,this.array)),this.array[t+0]=e,this.array[t+1]=n,this}setXYZ(t,e,n,i){return t*=this.itemSize,this.normalized&&(e=Dt(e,this.array),n=Dt(n,this.array),i=Dt(i,this.array)),this.array[t+0]=e,this.array[t+1]=n,this.array[t+2]=i,this}setXYZW(t,e,n,i,r){return t*=this.itemSize,this.normalized&&(e=Dt(e,this.array),n=Dt(n,this.array),i=Dt(i,this.array),r=Dt(r,this.array)),this.array[t+0]=e,this.array[t+1]=n,this.array[t+2]=i,this.array[t+3]=r,this}onChange(t){return this._onChangeCallback=t,this}clone(){return ya(this,this.array,this.itemSize,this.normalized).copy(this)}toJSON(){return{itemSize:this.itemSize,type:this.array.constructor.name,array:Array.from(this.array),normalized:this.normalized}}}class L0 extends ge{constructor(t,e,n=!1){super(new Int8Array(t),e,n)}}class R0 extends ge{constructor(t,e,n=!1){super(new Uint8Array(t),e,n)}}class O0 extends ge{constructor(t,e,n=!1){super(new Uint8ClampedArray(t),e,n)}}class z0 extends ge{constructor(t,e,n=!1){super(new Int16Array(t),e,n)}}class N0 extends ge{constructor(t,e,n=!1){super(new Uint16Array(t),e,n)}}class B0 extends ge{constructor(t,e,n=!1){super(new Int32Array(t),e,n)}}class F0 extends ge{constructor(t,e,n=!1){super(new Uint32Array(t),e,n)}}class Y0 extends ge{constructor(t,e,n=!1){super(new Float32Array(t),e,n)}}const $c={map:new Map,transform:function(s){if(Yc)return s;if(this.map.has(s))return this.map.get(s);const t=new OffscreenCanvas(s.width,s.height);return t.getContext("2d")?.drawImage(s,0,0),this.map.set(s,t),t},clear:function(){this.map.clear()}};function $0(s,t,e){const n=new OffscreenCanvas(s,t),i=n.getContext("2d");if(i)return e(i),n.transferToImageBitmap()}function X0(s,t,e){const n=s.createPattern($c.transform(t),"no-repeat");if(n){const i=Vr(e);n.setTransform(i),s.fillStyle=n}}function Xc(s){return window.URL.createObjectURL(s)}function U0(s){return window.URL.revokeObjectURL(s)}function Uc(s){let t=!1,e;function n(){document.readyState==="loading"||t||(s(),e?.(),t=!0)}try{e=W(document,"DOMContentLoaded",n)}catch{e=W(window,"load",n)}return n(),()=>{t||e()}}function Vc(s){return W(window,"beforeunload",t=>{s(t)})}async function V0(s,t=6e4){return new Promise((e,n)=>{const i=document.createElement("script");i.type="text/javascript",i.async=!1,i.onload=o=>{clearTimeout(r),e(o),i.onerror=i.onload=null},i.onerror=o=>{clearTimeout(r),n(o)},i.src=s;const r=setTimeout(()=>{n("Timeout!")},t);document.body.appendChild(i)})}function js(s,t){const e=document.createElement("a");e.style.visibility="hidden",e.download=t,typeof s=="string"?e.href=s:e.href=window.URL.createObjectURL(s),e.click()}async function G0(s,t=document.getElementsByTagName("head")[0],e=6e4){return new Promise((n,i)=>{const r=document.createElement("link");r.setAttribute("type","text/css"),r.setAttribute("rel","stylesheet"),r.onload=a=>{clearTimeout(o),n(a),r.onerror=r.onload=null},r.onerror=a=>{clearTimeout(o),i(a)},r.setAttribute("href",s);const o=setTimeout(()=>{i("Timeout!")},e);t.appendChild(r)})}function q0(){return new Promise(s=>{const t=Array.from(document.querySelectorAll("link[rel=stylesheet]"));let e=document.styleSheets.length||0;const n=()=>e>=t.length?(s(),!0):!1;n()||t.forEach(i=>{i.onload=()=>{e+=1,n()}})})}const Gc=new cn;async function qc(s,t=6e4){return new Promise((e,n)=>{const i=typeof s=="string"?s:Xc(s),r=Gc.get(i);if(r)return e(r);const o=setTimeout(()=>{n("Timeout!")},t),a=document.createElement("img");a.onload=()=>{clearTimeout(o),a.onerror=a.onload=null;const h=a.naturalWidth||a.width,c=a.naturalHeight||a.height,u={width:h,height:c,aspectRatio:h/c,element:a,imageData:Cc(a)};Gc.set(i,u),e(u)},a.onerror=h=>{clearTimeout(o),n(h)},a.src=i})}async function jc(s=$t.text,t=["*"]){const n=(await sr(t))[0],i=await Dn(n,s);return{type:n.type,name:n.name,size:n.size,data:i}}async function j0(s=["image/*"]){const e=(await sr(s))[0];if(!e.type.match(/image\/*/))return new Error("Not Image Type!");const n=await Dn(e,$t.arraybuffer),i=Ti(n),r=await qc(i);return{type:e.type,name:e.name,size:e.size,data:n,width:r.width,height:r.height,aspectRatio:r.aspectRatio,imageData:r.imageData}}function H0(){return window.getSelection()?.toString()||""}function W0(s){document.getElementsByTagName("title")[0].innerText=s,document.title=s}function J0(s=200){"vibrate"in navigator?window.navigator.vibrate(s):console.error("Your device is not support vibrate on this browser.")}async function Z0(s){if(navigator.clipboard)return await navigator.clipboard.writeText(s);{const t=document.createElement("textarea");return t.value=s,t.style.opacity="0",t.style.position="fixed",t.style.top="0",t.style.left="0",t.focus(),t.select(),document.execCommand("copy")}}function Q0(s,t){window.scrollTo(s,t)}function K0(){let s=Ca,t=Ca;return"scrollRestoration"in window.history&&(window.history.scrollRestoration="manual",s=Vc(()=>{window.history.scrollRestoration="auto"}),t=Uc(()=>{window.history.scrollRestoration="manual"})),()=>{s(),t()}}function ty(s){return/(html|body)/i.test(s.tagName)||s===document.documentElement}const ey=s=>s===document.activeElement&&(s.type||s.href),Kr=function(){return parseFloat(getComputedStyle(document.documentElement).fontSize)};function ny(s){return s*Kr()}function sy(s){return s.parentElement?parseFloat(getComputedStyle(s.parentElement).fontSize):Kr()}const iy=s=>{let t=s;for(;t&&t.nodeType!==1&&t.parentElement;)t=t.parentElement;return t},ry=s=>s.parentElement,to=(s,t=[])=>!s||s.parentElement===null&&s.parentNode===null?t:to(s.parentElement,t.concat([s]));function oy(s){const t=to(s);for(let e=0,n=t.length;e<n;e++)if(/(auto|scroll)/.test(qe(t[e],"overflow")+qe(t[e],"overflow-y")+qe(t[e],"overflow-x")))return t[e];return document.scrollingElement||document.documentElement}const ay=(s,t)=>s.contains?s!=t&&s.contains(t):!!(s.compareDocumentPosition(t)&16),hy=s=>Array.prototype.slice.call(s.parentElement?.children).filter(t=>t!==s),cy=s=>s.nextElementSibling,uy=s=>s.previousElementSibling,ly=(s,t)=>s.closest(t),fy=s=>s.shadowRoot,Wn=s=>s.tagName==="INPUT"||s instanceof HTMLInputElement,eo=s=>s.tagName==="SELECT"||s instanceof HTMLSelectElement,dy=s=>s.tagName==="TEXTAREA"||s instanceof HTMLTextAreaElement,no=s=>Wn(s)&&s.getAttribute("type")==="checkbox",so=s=>Wn(s)&&s.getAttribute("type")==="radio",my=s=>Wn(s)&&s.getAttribute("type")==="text",py=s=>Wn(s)&&s.getAttribute("type")==="number";function gy(s,t){if(eo(s)){const e=s.options;for(let n=0,i=e.length;n<i;n++)e[n].selected=e[n].value==t}}function yy(s,t){if(so(s)){const e=document.getElementsByName(s.name);for(let n=0,i=e.length;n<i;n++){const r=e[n];r.checked=r.value==t}}}function wy(s,t){no(s)&&(s.checked=t)}const Jn=(s,t,e="append")=>{typeof t=="string"?s[e](Qc(t)):s[e](t)},Hc=function(s,t){if(typeof t=="string"){s.innerHTML=t;const e=tu(s);e!=s&&(s=e)}else Jn(t,"replaceWith")},Wc=function(s){Hc(s,"")},xy=(s,t)=>{s.textContent=t},by=s=>{if(s instanceof SVGElement)return"";let t=s.innerText;if(!t){const e=s.querySelector("slot")?.assignedNodes()||[];let n=0;for(;!t&&n<=e.length-1;)"innerText"in e[n]&&(t=e[n].innerText),n++}return t},vy=s=>s.remove();function _y(s,t){qe(s,"display")=="none"&&t===void 0||t===!0?Jc(s):Zc(s)}function Jc(s){Gr(s,"display",s instanceof HTMLTableRowElement?"table-row":s instanceof HTMLTableCellElement?"table-cell":"block")}function Zc(s){Gr(s,"display","none")}function io(s,t,e="toggle"){const n=t.split(/[,\s]+/);if(s.classList)n.forEach(i=>{const r=i.trim();r!==""&&s.classList[e](r)});else{const i=s.className.split(/ +/);let r=!1;n.forEach(o=>{const a=o.trim();if(a!==""){const h=i.indexOf(a);switch(e){case"add":h===-1&&(i.push(a),r=!0);break;case"remove":h!==-1&&(i.splice(h,1),r=!0);break;case"toggle":h===-1?i.push(a):i.splice(h,1),r=!0;break}}}),r&&je(s,"class",i.join(" ").replace(/^\s+/,"").replace(/\s+$/,""))}}function Sy(s,t){io(s,t,"add")}function Cy(s,t){io(s,t,"remove")}function Ty(s,t){return new RegExp("(?:^|\\s+)"+t+"(?:\\s+|$)").test(s.className)||!1}function Qc(s,t=!1){const e=document.createElement("template");return e.innerHTML=s,t&&e.content.childNodes.forEach(n=>{const i=tu(n);i!=n&&e.content.replaceChild(i,n)}),e.content}function Kc(s){return document.createElement.call(document,s)}function Ey(s){return document.createElementNS("http://www.w3.org/1999/xhtml",s)}function Py(s){return document.createTextNode.call(document,s)}function tu(s){return s.tagName=="SCRIPT"&&(s=eu(s)),s.querySelectorAll&&s.querySelectorAll("script").forEach(t=>{t.parentNode?.replaceChild(eu(t),t)}),s}function eu(s){const t=s.ownerDocument.createElement("script");t.text=s.text;const e=s.attributes;for(let n=0,i=e.length;n<i;n++)t.setAttribute(e[n].name,e[n].value);return t}function My(s,t="http://test.com/localstorage.html"){const e=document.createElement("iframe");e.src=t,document.body.append(e),setTimeout(function(){e.contentWindow?.postMessage(s,t)},4e3),setTimeout(function(){e.remove()},6e3)}function Ay(s){const t=new Proxy(window,{get(e,n,i){if(typeof n=="string"&&["open","location","document"].includes(n))throw new Error(`禁止访问 key: ${n}`);return n==="window"?t:Reflect.get(e,n,i)},set(e,n,i,r){return Reflect.set(e,n,i,r)}});new Function("window",`with(window) { ${s} }`)(t,null)}function ro(){return{x:0,y:0,isDown:!1}}function He(){const s=ro(),t=ro();return{start:s,current:t,setStart:function(e,n){s.x=e.x,s.y=e.y,s.isDown=typeof n=="boolean"?n:typeof e.isDown=="boolean"?e.isDown:!1,this.setCurrent(e,n)},setCurrent:(e,n)=>{t.x=e.x,t.y=e.y,t.isDown=typeof n=="boolean"?n:typeof e.isDown=="boolean"?e.isDown:!1}}}function Hs(s=document.documentElement,t=!1){return X(s,"mousemove",t)}function nu(s=document.documentElement,t=!1){return X(s,"mousedown",t)}function su(s=document.documentElement,t=!1){return X(s,"mouseup",t)}function ky(s=document.documentElement,t=!1){return X(s,"mouseover",t)}function Iy(s=document.documentElement,t=!1){return X(s,"mouseout",t)}function Dy(s=document.documentElement,t=!1){return X(s,"mouseenter",t)}function Ly(s=document.documentElement,t=!1){return X(s,"mouseleave",t)}function Ry(s=document.documentElement,t=!1){return X(s,"click",t)}function Oy(s=document.documentElement,t=!1){return X(s,"dblclick",t)}function zy(s=document.documentElement,t=!1){return X(s,"onwheel"in document.createElement("div")?"wheel":document.onmousewheel!==void 0?"mousewheel":"DOMMouseScroll",t)}function Ny(s=document.documentElement,t=!1){return X(s,"contextmenu",t)}function iu(s=document.documentElement,t=!1){return X(s,"touchmove",t)}function ru(s=document.documentElement,t=!1){return X(s,"touchstart",t)}function ou(s=document.documentElement,t=!1){return X(s,"touchend",t)}function au(s=document.documentElement,t=!1){return X(s,"touchcancel",t)}function oo(s=document.documentElement,t=!1){return X(s,"pointermove",t)}function ao(s=document.documentElement,t=!1){return X(s,"pointerdown",t)}function ho(s=document.documentElement,t=!1){return X(s,"pointerup",t)}function co(s=document.documentElement,t=!1){return X(s,"pointercancel",t)}function By(s=document.documentElement){const t=new tt(s);return nt(e=>{t.on("pan",e)},e=>{t.off("pan",e)})}function Fy(s=document.documentElement){const t=new tt(s);return nt(e=>{t.on("panmove",e)},e=>{t.off("panmove",e)})}function Yy(s=document.documentElement){const t=new tt(s);return nt(e=>{t.on("panstart",e)},e=>{t.off("panstart",e)})}function $y(s=document.documentElement){const t=new tt(s);return nt(e=>{t.on("panend",e)},e=>{t.off("panend",e)})}function Xy(s=document.documentElement){const t=new tt(s);return nt(e=>{t.on("pancancel",e)},e=>{t.off("pancancel",e)})}function Uy(s=document.documentElement){const t=new tt(s);return nt(e=>{t.on("panleft",e)},e=>{t.off("panleft",e)})}function Vy(s=document.documentElement){const t=new tt(s);return nt(e=>{t.on("panright",e)},e=>{t.off("panright",e)})}function Gy(s=document.documentElement){const t=new tt(s);return nt(e=>{t.on("panup",e)},e=>{t.off("panup",e)})}function qy(s=document.documentElement){const t=new tt(s);return nt(e=>{t.on("pandown",e)},e=>{t.off("pandown",e)})}function jy(s=document.documentElement){const t=new tt(s);return nt(e=>{t.on("pinch",e)},e=>{t.off("pinch",e)})}function Hy(s=document.documentElement){const t=new tt(s);return nt(e=>{t.on("pinchin",e)},e=>{t.off("pinchin",e)})}function Wy(s=document.documentElement){const t=new tt(s);return nt(e=>{t.on("pinchout",e)},e=>{t.off("pinchout",e)})}function Jy(s=document.documentElement){const t=new tt(s);return nt(e=>{t.on("press",e)},e=>{t.off("press",e)})}function Zy(s=document.documentElement){const t=new tt(s);return nt(e=>{t.on("rotate",e)},e=>{t.off("rotate",e)})}function Qy(s=document.documentElement){const t=new tt(s);return nt(e=>{t.on("swipe",e)},e=>{t.off("swipe",e)})}function Ky(s=document.documentElement){const t=new tt(s);return nt(e=>{t.on("swipeleft",e)},e=>{t.off("swipeleft",e)})}function t1(s=document.documentElement){const t=new tt(s);return nt(e=>{t.on("swiperight",e)},e=>{t.off("swiperight",e)})}function e1(s=document.documentElement){const t=new tt(s);return nt(e=>{t.on("swipeup",e)},e=>{t.off("swipeup",e)})}function n1(s=document.documentElement){const t=new tt(s);return nt(e=>{t.on("swipedown",e)},e=>{t.off("swipedown",e)})}function s1(s=document.documentElement){const t=new tt(s);return nt(e=>{t.on("tap",e)},e=>{t.off("tap",e)})}function i1(s=document.documentElement){const t=new tt(document.documentElement);return nt(e=>{const n=i=>{!i.target||s==i.target||s.contains(i.target)||e(i)};return t.on("tap",n),n},(e,n)=>{t.off("tap",n)})}function r1(s=document.documentElement,t=!1){return X(s,"transitionstart",t)}function o1(s=document.documentElement,t=!1){return X(s,"transitionend",t)}function a1(s=document.documentElement,t=!1){return X(s,"animationstart",t)}function h1(s=document.documentElement,t=!1){return X(s,"animationend",t)}function hu(s=document.documentElement,t=!1){return X(s,"drag",t)}function cu(s=document.documentElement,t=!1){return X(s,"dragstart",t)}function uu(s=document.documentElement,t=!1){return X(s,"dragend",t)}function lu(s=document.documentElement,t=!1){return X(s,"drop",t)}function fu(s=document.documentElement,t=!1){return X(s,"dragenter",t)}function du(s=document.documentElement,t=!1){return X(s,"dragleave",t)}function mu(s=document.documentElement,t=!1){return X(s,"dragover",t)}function pu(s=document.documentElement,t=!1){return X(s,"keydown",t)}function gu(s=document.documentElement,t=!1){return X(s,"keyup",t)}function c1(s=document.documentElement,t=!1){return X(s,"keypress",t)}function u1(s=document.documentElement,t){const e=t?.useMousePoint||He();return Hs(s).pipe(rt(n=>(e.setCurrent(ft(n,s)),e)))}function l1(s=document.documentElement,t){const e=t?.useMousePoint||He();return Hs(s).pipe(Dp(nu(s).pipe(Ue(n=>{e.setStart(ft(n,s),!0),t?.start?.(n,e)})),()=>su(s).pipe(Ue(n=>{e.setCurrent(ft(n,s),!1),t?.end?.(n,e)}))),Ap(),rt(n=>(e.setCurrent(ft(n,s),!0),e)))}function f1(s=document.documentElement,t){const e=t?.useMousePoint||He();return ru(s).pipe(Ue(n=>{const i=n.changedTouches[0];e.setStart(ft(i,s),!0),t?.start?.(i,e)}),Os(()=>iu(s).pipe(xr(wr(ou(s),au(s)).pipe(Ue(n=>{const i=n.changedTouches[0];e.setCurrent(ft(i,s),!1),t?.end?.(i,e)}))))),rt(n=>{const i=n.changedTouches[0];return e.setCurrent(ft(i,s),!0),e}))}function Ws(s=document.documentElement,t){const e=t?.useMousePoint||He();return ao(s).pipe(Ue(n=>{e.setStart(ft(n,s),!0),t?.start?.(n,e)}),Os(()=>oo(s).pipe(xr(wr(ho(s),co(s)).pipe(Ue(n=>{e.setCurrent(ft(n,s),!1),t?.end?.(n,e)}))))),rt(n=>(e.setCurrent(ft(n,s),!0),e)))}function yu(s=document.documentElement,t){const e=t?.useMousePoint||He();return Cp(Hs(s),ao(s)).pipe(Zh(n=>n instanceof PointerEvent?(e.setStart(ft(n,s),!0),t?.start?.(n,e),oo(s).pipe(xr(wr(ho(s),co(s)).pipe(Ue(i=>{e.setCurrent(ft(i,s),!1),t?.end?.(i,e)}))))):n instanceof MouseEvent?Km(n):Lh),rt(n=>(e.setCurrent(ft(n,s),n instanceof PointerEvent),e)))}function d1(s){return new et(t=>Ws(s,{start:()=>{t.next(0)},end:(n,i)=>{t.next(i.current.x-i.start.x)}}).subscribe(n=>{t.next(n.current.y-n.start.y)}).unsubscribe).pipe(Ce())}function m1(s,t){wn(s,"draggable","true");const e=cu(s,!0).subscribe(r=>{Ee(r),Qh(r);const o=r.dataTransfer;o&&(o.effectAllowed="move",o.setData("text/plain","some-data")),t?.onStart?.(r)}),n=hu(s).subscribe(r=>{Ee(r),t?.onDrag?.(r)}),i=uu(s).subscribe(r=>{Ee(r),t?.onEnd?.(r)});return()=>{e.unsubscribe(),n.unsubscribe(),i.unsubscribe()}}function p1(s,t){const e=fu(s).subscribe(o=>{Ee(o),t?.onEnter?.(o)}),n=mu(s).subscribe(o=>{Ee(o);const a=o.dataTransfer;a&&(a.dropEffect="move"),t?.onOver?.(o)}),i=du(s).subscribe(o=>{Ee(o),t?.onLeave?.(o)}),r=lu(s).subscribe(o=>{Ee(o);const a=o.dataTransfer;if(!a){t?.onDrop?.(o,[]);return}t?.onDrop?.(o,[...a.files])});return()=>{e.unsubscribe(),n.unsubscribe(),i.unsubscribe(),r.unsubscribe()}}function wu(s=10){return X(window,"scroll",!0).pipe(Ip(s))}function g1(){return X(document,"visibilitychange",!0).pipe(rt(()=>document.visibilityState==="visible"),Ce())}function y1(){return{screenWidth:window.screen.width,screenHeight:window.screen.height,screenX:window.screenX,screenY:window.screenY}}function Zn(){const s=document.documentElement;return{clientWidth:s.clientWidth,clientHeight:s.clientHeight,clientTop:s.clientTop,clientLeft:s.clientLeft,scrollWidth:s.scrollWidth,scrollHeight:s.scrollHeight,scrollTop:s.scrollTop,scrollLeft:s.scrollLeft,offsetWidth:s.offsetWidth,offsetHeight:s.offsetHeight,offsetTop:s.offsetTop,offsetLeft:s.offsetLeft,offsetParent:s.offsetParent}}function w1(){const s=document.body;return{clientWidth:s.clientWidth,clientHeight:s.clientHeight,clientTop:s.clientTop,clientLeft:s.clientLeft,scrollWidth:s.scrollWidth,scrollHeight:s.scrollHeight,scrollTop:s.scrollTop,scrollLeft:s.scrollLeft,offsetWidth:s.offsetWidth,offsetHeight:s.offsetHeight,offsetTop:s.offsetTop,offsetLeft:s.offsetLeft,offsetParent:s.offsetParent}}function xu(){return typeof window.innerWidth=="number"?{width:window.innerWidth,height:window.innerHeight}:document.compatMode==="CSS1Compat"?{width:document.documentElement.clientWidth,height:document.documentElement.clientHeight}:{width:document.body.clientWidth,height:document.body.clientHeight}}function x1(){const{scrollWidth:s,scrollHeight:t}=Zn();return{width:s,height:t}}function uo(s){const{top:t,left:e,width:n,height:i}=s.getBoundingClientRect(),{scrollLeft:r,scrollTop:o}=Zn();return{x:e+r,y:t+o,width:n,height:i}}function b1(s){let t=s,e=0,n=0;for(;t!==null;)e+=t.offsetLeft,n+=t.offsetTop,t.offsetParent instanceof HTMLElement?t=t.offsetParent:t=null;return{x:e,y:n,width:s.offsetWidth,height:s.offsetHeight}}function bu(s){return s.getBoundingClientRect()}function v1(s){const t=s.getBoundingClientRect();return{x:s.offsetLeft,y:s.offsetTop,width:t.width||t.right-t.left,height:t.height||t.bottom-t.top}}function _1(){const{clientHeight:s,scrollTop:t,scrollHeight:e}=Zn(),n=e-s;return n<=0?0:t/n*100}function S1(s){if("center"in s){const t=s.center,e=bu(s.target);return{x:t.x-e.x,y:t.y-e.y}}return{x:s.clientX,y:s.clientY}}function lo(s){if("center"in s)return s.center;if(typeof s.pageX=="number"&&typeof s.pageY=="number")return{x:s.pageX,y:s.pageY};const{scrollLeft:t,scrollTop:e}=Zn();return{x:s.clientX+t,y:s.clientY+e}}function ft(s,t){const e={x:0,y:0};if(t){const n=lo(s),i=uo(t);e.x=N(n.x-i.x,0,i.width),e.y=N(n.y-i.y,0,i.height)}else{let n=0,i=0;if("currentTarget"in s&&s.currentTarget&&s.target&&s.currentTarget!=s.target){const r=s.currentTarget.getBoundingClientRect(),o=s.target.getBoundingClientRect();n=o.left-r.left,i=o.top-r.top}if("offsetX"in s)e.x=s.offsetX+n,e.y=s.offsetY+i;else{const r=lo(s),o=uo(s.target);e.x=N(r.x-o.x+n,0,o.width),e.y=N(r.y-o.y+i,0,o.height)}}return e}function C1(s){if(document.implementation.hasFeature("MouseEvents","2.0"))return s.button;switch(s.button){case 0:case 1:case 3:case 5:case 7:return 0;case 2:case 6:return 2;case 4:return 1}}const T1={BACKSPACE:8,TAB:9,COMMA:188,DELETE:46,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,UP:38,DOWN:40,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32};function E1(s){if(s.key)return s.key;if(s.keyCode)return s.keyCode;if(s.which)return s.which}function vu(s,t){const e=t.ctrl||!1,n=t.shift||!1,i=t.alt||!1;return(e===s.metaKey||e===s.ctrlKey)&&n===s.shiftKey&&i===s.altKey&&t.keys.map(r=>r.toLowerCase()).includes(s.key.toLowerCase())}function _u(s){return pu(s.target||document||window).pipe(Jh(t=>vu(t,s)),rt(t=>{t.stopPropagation(),t.preventDefault()}))}function P1(s){return gu(s.target||document||window).pipe(Jh(t=>vu(t,s)),rt(t=>{t.stopPropagation(),t.preventDefault()}))}function Su(s={keys:["o"]},t=$t.text){return _u(s).pipe(Os(async()=>await jc(t)))}async function M1(s={keys:["o"]},t=$t.text){return ep(Su(s,t))}async function Cu(s,t){return new Promise(e=>{const n=new ResizeObserver(i=>{const r=s.getBoundingClientRect();t(r),e(()=>{n.unobserve(s)})});n.observe(s)})}function fo(s=document.documentElement,t){return new et(e=>{const n=s.getBoundingClientRect();let i=n.x,r=n.y,o=n.width,a=n.height;e.next(n);const h=new ResizeObserver(c=>{const u=s.getBoundingClientRect();(i!=u.x||r!=u.y||o!=u.width||a!=u.height)&&(i=u.x,r=u.y,o=u.width,a=u.height,e.next(u))});return h.observe(s,t),()=>{h.unobserve(s),h.disconnect()}})}function A1(){return X(window,"orientationchange"in window?"orientationchange":"resize").pipe(rt(s=>({width:s.target.innerWidth,height:s.target.innerHeight})),Te({width:window.innerWidth,height:window.innerHeight}))}function k1(){const s={x:0,y:0,dx:0,dy:0,dStartX:0,dStartY:0,isDown:!1},t={x:0,y:0,dx:0,dy:0,dStartX:0,dStartY:0,isDown:!1};return{mousePoint:t,setStartMousePoint:function(e,n){s.x=e.x,s.y=e.y,s.isDown=typeof n=="boolean"?n:!1,this.setCurrentMousePoint(e,n)},setCurrentMousePoint:(e,n)=>{const i=t.x,r=t.y;t.x=e.x,t.y=e.y,t.dx=t.x-i,t.dy=t.y-r,t.dStartX=t.x-s.x,t.dStartY=t.y-s.y,t.isDown=typeof n=="boolean"?n:!1}}}function I1(s=document.documentElement){const t=new gs,e=new tt(s);let n=[];const i=k1(),r=i.mousePoint,o=k=>{t.emit("mouseDown",k)},a=k=>{t.emit("mouseUp",k)},h=k=>{r.isDown||i.setCurrentMousePoint(ft(k,s)),t.emit("mouseMove",k)},c=k=>{t.emit("mouseOver",k)},u=k=>{t.emit("mouseOut",k)},l=k=>{t.emit("mouseEnter",k)},m=k=>{t.emit("mouseLeave",k)},f=k=>{t.emit("mouseClick",k)},p=k=>{t.emit("mouseDoubleClick",k)},y=k=>{t.emit("mouseWheel",k)},v=k=>{t.emit("mouseContextMenu",k)},w=k=>{t.emit("touchStart",k)},_=k=>{t.emit("touchEnd",k)},x=k=>{t.emit("touchCancel",k)},b=k=>{const at=k.changedTouches[0];r.isDown||i.setCurrentMousePoint(ft(at,s)),t.emit("touchMove",k)},E=k=>{t.emit("pointerDown",k)},C=k=>{t.emit("pointerUp",k)},L=k=>{t.emit("pointerCancel",k)},B=k=>{t.emit("pointerMove",k)},F=k=>{t.emit("pan",k)},U=k=>{t.emit("panStart",k)},G=k=>{t.emit("panMove",k)},J=k=>{t.emit("panEnd",k)},st=k=>{t.emit("panCancel",k)},K=k=>{t.emit("panLeft",k)},Kt=k=>{t.emit("panRight",k)},Yt=k=>{t.emit("panUp",k)},Ut=k=>{t.emit("panDown",k)},te=k=>{t.emit("pinch",k)},R=k=>{t.emit("pinchin",k)},D=k=>{t.emit("pinchout",k)},$=k=>{t.emit("press",k)},H=k=>{t.emit("rotate",k)},At=k=>{t.emit("swipe",k)},ee=k=>{t.emit("swipeLeft",k)},oi=k=>{t.emit("swipeRight",k)},ai=k=>{t.emit("swipeUp",k)},mt=k=>{t.emit("swipeDown",k)},ae=k=>{t.emit("tap",k)},it=k=>{!k.target||s==k.target||s.contains(k.target)||t.emit("tapOutSide",k)},Ct=k=>{t.emit("transitionstart",k)},_n=k=>{t.emit("transitionend",k)},en=k=>{t.emit("animationstart",k)},nn=k=>{t.emit("animationend",k)};let Oe={...s.getBoundingClientRect(),width:s.offsetWidth,height:s.offsetHeight};return{el:s,get rect(){return Oe},mousePoint:r,eb:t,start:async function(){n.push(W(s,"mousedown",o)),n.push(W(s,"mouseup",a)),n.push(W(s,"mousemove",h)),n.push(W(s,"mouseover",c)),n.push(W(s,"mouseout",u)),n.push(W(s,"mouseenter",l)),n.push(W(s,"mouseleave",m)),n.push(W(s,"click",f)),n.push(W(s,"dblclick",p)),n.push(W(s,"onwheel"in document.createElement("div")?"wheel":document.onmousewheel!==void 0?"mousewheel":"DOMMouseScroll",y)),n.push(W(s,"contextmenu",v)),n.push(W(s,"touchstart",w)),n.push(W(s,"touchend",_)),n.push(W(s,"touchcancel",x)),n.push(W(s,"touchmove",b)),n.push(W(s,"pointerdown",E)),n.push(W(s,"pointerup",C)),n.push(W(s,"pointercancel",L)),n.push(W(s,"pointermove",B)),e.on("pan",F),e.on("panstart",U),e.on("panmove",G),e.on("panend",J),e.on("pancancel",st),e.on("panleft",K),e.on("panright",Kt),e.on("panup",Yt),e.on("pandown",Ut),e.on("pinch",te),e.on("pinchin",R),e.on("pinchout",D),e.on("press",$),e.on("rotate",H),e.on("swipe",At),e.on("swipeleft",ee),e.on("swiperight",oi),e.on("swipeup",ai),e.on("swipedown",mt),e.on("tap",ae),n.push(W(document,"pointerdown",it)),n.push(W(s,"transitionstart",Ct)),n.push(W(s,"transitionend",_n)),n.push(W(s,"animationstart",en)),n.push(W(s,"animationend",nn));const k=await Cu(s,at=>{Oe=at,t.emit("resize",at)});n.push(k),n.push(Tu(this,{start:at=>{i.setStartMousePoint(ft(at,s),!0)},move:at=>{i.setCurrentMousePoint(ft(at,s))},end:at=>{i.setCurrentMousePoint(ft(at,s),!1)}}))},end:()=>{t.removeAllListeners(),n.forEach(k=>k()),n=[],e.off("pan",F),e.off("panstart",U),e.off("panmove",G),e.off("panend",J),e.off("pancancel",st),e.off("panleft",K),e.off("panright",Kt),e.off("panup",Yt),e.off("pandown",Ut),e.off("pinch",te),e.off("pinchin",R),e.off("pinchout",D),e.off("press",$),e.off("rotate",H),e.off("swipe",At),e.off("swipeleft",ee),e.off("swiperight",oi),e.off("swipeup",ai),e.off("swipedown",mt),e.off("tap",ae)}}}function Tu(s,t){return Eu(s,t)}function Eu(s,t){const e=s.eb,n=o=>{e.on("pointerMove",r),e.on("pointerUp",i),e.on("pointerCancel",i),t?.start?.(o)},i=o=>{e.off("pointerMove",r),e.off("pointerUp",i),e.off("pointerCancel",i),t?.end?.(o)},r=o=>{t?.move?.(o)};return e.on("pointerDown",n),()=>e.off("pointerDown",n)}function D1(s,t){const e=s.eb,n=o=>{document.addEventListener("mousemove",r,!1),document.addEventListener("mouseup",i,!1),t?.start?.(o)},i=o=>{document.removeEventListener("mousemove",r,!1),document.removeEventListener("mouseup",i,!1),t?.end?.(o)},r=o=>{t?.move?.(o)};return e.on("mouseDown",n),()=>e.off("mouseDown",n)}function L1(s,t){const e=s.eb,n=o=>{e.on("touchMove",r),e.on("touchEnd",i),e.on("touchCancel",i);const a=o.changedTouches[0];t?.start?.(a)},i=o=>{e.off("touchMove",r),e.off("touchEnd",i),e.off("touchCancel",i);const a=o.changedTouches[0];t?.end?.(a)},r=o=>{const a=o.changedTouches[0];t?.move?.(a)};return e.on("touchStart",n),()=>e.off("touchStart",n)}let mo=class{x;y;toX;toY;constructor(t){this.x=t?.x||0,this.y=t?.y||0,this.toX=t?.toX||0,this.toY=t?.toY||0}toSVGPathData(){return[["L",this.toX,this.toY]]}toCanvasContext(t){t.lineTo(this.toX,this.toY)}getBoundingClientRect(){const t=Jt(this.x,this.y,this.toX,this.toY);if(t===0){const e=Math.min(this.x,this.toX),n=Math.min(this.y,this.toY),i=Math.max(this.x,this.toX),r=Math.max(this.y,this.toY);return{x:e,y:n,width:i-e,height:r-n}}else{const e=Math.sin(t),n=Math.cos(t),i=n*this.x-e*this.y,r=n*this.toX-e*this.toY,o=n*this.y+e*this.x,a=n*this.toY+e*this.toX;return{x:Math.min(i,r),y:Math.min(o,a),width:Math.max(i,r)-Math.min(i,r),height:Math.max(o,a)-Math.min(o,a)}}}interpolate(t){return{x:this.x+t*(this.toX-this.x),y:this.y+t*(this.toY-this.y)}}intersection(t){const e=this.x,n=this.y,i=t.toX,r=t.toY,o=this.toX-e,a=t.x-i;if(!o&&!a)return null;const h=(this.toY-n)/o,c=(t.y-r)/a;if(o){if(!a)return{x:i,y:h*(i-e)+n}}else return{x:e,y:c*(e-i)+r};const u=(-c*i+r+h*e-n)/(h-c),l=h*(u-e)+n;return isNaN(u)||isNaN(l)?null:{x:u,y:l}}};class po extends mo{rx;ry;xAxisRotate;largeArcFlag;sweepFlag;constructor(t){super(t),this.rx=t.rx,this.ry=t.ry,this.xAxisRotate=typeof t?.xAxisRotate=="number"?t?.xAxisRotate:0,this.largeArcFlag=typeof t?.largeArcFlag=="number"?t?.largeArcFlag:1,this.sweepFlag=typeof t?.sweepFlag=="number"?t?.sweepFlag:1,this.toX=t.toX,this.toY=t.toY}toSVGPathData(){return[["A",this.rx,this.ry,this.xAxisRotate,this.largeArcFlag,this.sweepFlag,this.toX,this.toY]]}toCanvasContext(t){const[e,n,i,r,o,a,h]=this.convert(this.x,this.y,this.toX,this.toY,this.rx,this.ry,this.xAxisRotate,this.largeArcFlag,this.sweepFlag);t.ellipse(e,n,i,r,o,a,h,!this.sweepFlag)}convert(t,e,n,i,r,o,a,h,c){const u=a/180*Math.PI,l=(t-n)/2,m=(e-i)/2,f=Math.cos(u)*l+Math.sin(u)*m,p=-Math.sin(u)*l+Math.cos(u)*m,y=f*f/(r*r)+p*p/(o*o);if(y>1){const G=Math.sqrt(y);throw r=G*r,o=G*o,new Error(`Radii are too small to build an arc. Correcting them to ${r}/${o}.`)}const v=Math.sqrt((r*r*o*o-r*r*p*p-o*o*f*f)/(r*r*p*p+o*o*f*f)),w=h!=c?1:-1,_=w*v*r*p/o,x=w*v*-o*f/r,b=(t+n)/2,E=(e+i)/2,C=Math.cos(u)*_-Math.sin(u)*x+b,L=Math.sin(u)*_+Math.cos(u)*x+E,B=(G,J,st,K)=>(G*K>=J*st?1:-1)*Math.acos((G*st+J*K)/(Math.sqrt(G*G+J*J)*Math.sqrt(st*st+K*K))),F=B(1,0,t-C,e-L)-u,U=B(t-C,e-L,n-C,i-L);return[C,L,r,o,u,F,F+U]}}class R1 extends mo{cx;cy;isLineThrough;constructor(t){super(t),this.cx=t.cx,this.cy=t.cy,this.isLineThrough=typeof t.isLineThrough=="boolean"?t.isLineThrough:!1}toSVGPathData(){if(this.isLineThrough){const t=this.cx*2-(this.x+this.toX)/2,e=this.cy*2-(this.y+this.toY)/2;return[["Q",t,e,this.toX,this.toY]]}else return[["Q",this.cx,this.cy,this.toX,this.toY]]}toCanvasContext(t){if(this.isLineThrough){const e=this.cx*2-(this.x+this.toX)/2,n=this.cy*2-(this.y+this.toY)/2;t.quadraticCurveTo(e,n,this.toX,this.toY)}else t.quadraticCurveTo(this.cx,this.cy,this.toX,this.toY)}getBoundingClientRect(){const t=[this.x,this.toX],e=[this.y,this.toY];let n,i,r,o;for(let c=0;c<2;++c)n=c==0?this.x-2*this.cx+this.toX:this.y-2*this.cy+this.toY,i=c==0?-2*this.x+2*this.cx:-2*this.y+2*this.cy,r=c==0?this.x:this.y,Math.abs(n)>1e-12&&(o=-i/(2*n),0<o&&o<1&&[t,e][c].push(n*o*o+i*o+r));const a={x:Math.min(0,...t),y:Math.min(0,...e)},h={x:Math.max(0,...t),y:Math.max(0,...e)};return{x:a.x,y:a.y,width:h.x-a.x,height:h.y-a.y}}interpolate(t){return{x:(1-t)*(1-t)*this.x+2*(1-t)*t*this.cx+t*t*this.toX,y:(1-t)*(1-t)*this.y+2*(1-t)*t*this.cy+t*t*this.toY}}}const O1=R1;class gt extends mo{c1x;c1y;c2x;c2y;constructor(t){super(t),this.c1x=t.c1x,this.c1y=t.c1y,this.c2x=t.c2x,this.c2y=t.c2y}clone(){return new gt({x:this.x,y:this.y,c1x:this.c1x,c1y:this.c1y,c2x:this.c2x,c2y:this.c2y,toX:this.toX,toY:this.toY})}toSVGPathData(){return[["C",this.c1x,this.c1y,this.c2x,this.c2y,this.toX,this.toY]]}toCanvasContext(t){t.bezierCurveTo(this.c1x,this.c1y,this.c2x,this.c2y,this.toX,this.toY)}getBoundingClientRect(){let t=this.c2x-2*this.c1x+this.x-(this.toX-2*this.c2x+this.c1x),e=2*(this.c1x-this.x)-2*(this.c2x-this.c1x),n=this.x-this.c1x,i=(-e+Math.sqrt(e*e-4*t*n))/2/t,r=(-e-Math.sqrt(e*e-4*t*n))/2/t;const o=[this.y,this.toY],a=[this.x,this.toX];let h;const c=[];Math.abs(i)>1e12&&(i=.5),Math.abs(r)>1e12&&(r=.5),i>=0&&i<=1&&(h=this.interpolate(i),a.push(h.x),o.push(h.y),c.push({X:h.x,Y:h.y})),r>=0&&r<=1&&(h=this.interpolate(r),a.push(h.x),o.push(h.y),c.push({X:h.x,Y:h.y})),t=this.c2y-2*this.c1y+this.y-(this.toY-2*this.c2y+this.c1y),e=2*(this.c1y-this.y)-2*(this.c2y-this.c1y),n=this.y-this.c1y,i=(-e+Math.sqrt(e*e-4*t*n))/2/t,r=(-e-Math.sqrt(e*e-4*t*n))/2/t,Math.abs(i)>1e12&&(i=.5),Math.abs(r)>1e12&&(r=.5),i>=0&&i<=1&&(h=this.interpolate(i),a.push(h.x),o.push(h.y),c.push({X:h.x,Y:h.y})),r>=0&&r<=1&&(h=this.interpolate(r),a.push(h.x),o.push(h.y),c.push({X:h.x,Y:h.y}));const u=[],l=c.length;for(let p=0;p<l;p++){for(let y=p+1;y<l;y++)c[p].X===c[y].X&&c[p].Y===c[y].Y&&(y=++p);u.push({X:c[p].X,Y:c[p].Y})}const m={x:Math.min(...a),y:Math.min(...o)},f={x:Math.max(...a),y:Math.max(...o)};return{x:m.x,y:m.y,width:f.x-m.x,height:f.y-m.y,dots:u}}interpolate(t){return{x:Math.pow(1-t,3)*this.x+3*Math.pow(1-t,2)*t*this.c1x+3*Math.pow(1-t,1)*Math.pow(t,2)*this.c2x+Math.pow(t,3)*this.toX,y:Math.pow(1-t,3)*this.y+3*Math.pow(1-t,2)*t*this.c1y+3*Math.pow(1-t,1)*Math.pow(t,2)*this.c2y+Math.pow(t,3)*this.toY}}static base3(t,e,n,i,r){const o=-3*e+9*n-9*i+3*r,a=t*o+6*e-12*n+6*i;return t*a-3*e+3*n}static bezlen(t,e,n,i,r,o,a,h,c=1){c=Math.max(0,Math.min(c,1));const u=c/2,l=[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816],m=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472];let f=0;for(let p=0;p<12;p++){const y=u*l[p]+u,v=gt.base3(y,t,n,r,a),w=gt.base3(y,e,i,o,h);f+=m[p]*Math.sqrt(v*v+w*w)}return u*f}length(t=1){return gt.bezlen(this.x,this.y,this.c1x,this.c1y,this.c2x,this.c2y,this.toX,this.toY,t)}getTatLen(t){const e=this.x,n=this.y,i=this.c1x,r=this.c1y,o=this.c2x,a=this.c2y,h=this.toX,c=this.toY;if(t<0||gt.bezlen(e,n,i,r,o,a,h,c)<t)return 0;const u=1;let l=u/2,m=u-l,f=gt.bezlen(e,n,i,r,o,a,h,c,m);for(;Math.abs(f-t)>.01;)l/=2,m+=(f<t?1:-1)*l,f=gt.bezlen(e,n,i,r,o,a,h,c,m);return m}getPointAtSegmentLength(t){const e=this.getTatLen(t),n=1-e,i=Math.pow(n,3),r=Math.pow(n,2),o=e*e,a=o*e,h=i*this.x+r*3*e*this.c1x+n*3*e*e*this.c2x+a*this.toX,c=i*this.y+r*3*e*this.c1y+n*3*e*e*this.c2y+a*this.toY,u=this.x+2*e*(this.c1x-this.x)+o*(this.c2x-2*this.c1x+this.x),l=this.y+2*e*(this.c1y-this.y)+o*(this.c2y-2*this.c1y+this.y),m=this.c1x+2*e*(this.c2x-this.c1x)+o*(this.toX-2*this.c2x+this.c1x),f=this.c1y+2*e*(this.c2y-this.c1y)+o*(this.toY-2*this.c2y+this.c1y),p=n*this.x+e*this.c1x,y=n*this.y+e*this.c1y,v=n*this.c2x+e*this.toX,w=n*this.c2y+e*this.toY,_=90-Math.atan2(u-m,l-f)*180/Math.PI;return{x:h,y:c,m:{x:u,y:l},n:{x:m,y:f},start:{x:p,y},end:{x:v,y:w},alpha:_}}}const Qn=Math.PI*2;function Pu(s,t,e,n){const i=s*n-t*e<0?-1:1;let r=s*e+t*n;return r>1&&(r=1),r<-1&&(r=-1),i*Math.acos(r)}function z1(s,t,e,n,i,r,o,a,h,c){const u=c*(s-e)/2+h*(t-n)/2,l=-h*(s-e)/2+c*(t-n)/2,m=o*o,f=a*a,p=u*u,y=l*l;let v=m*f-m*y-f*p;v<0&&(v=0),v/=m*y+f*p,v=Math.sqrt(v)*(i===r?-1:1);const w=v*o/a*l,_=v*-a/o*u,x=c*w-h*_+(s+e)/2,b=h*w+c*_+(t+n)/2,E=(u-w)/o,C=(l-_)/a,L=(-u-w)/o,B=(-l-_)/a,F=Pu(1,0,E,C);let U=Pu(E,C,L,B);return r===0&&U>0&&(U-=Qn),r===1&&U<0&&(U+=Qn),[x,b,F,U]}function N1(s,t){const e=1.3333333333333333*Math.tan(t/4),n=Math.cos(s),i=Math.sin(s),r=Math.cos(s+t),o=Math.sin(s+t);return[n,i,n-i*e,i+n*e,r+o*e,o-r*e,r,o]}function Mu(s,t,e,n,i,r,o,a,h){const c=Math.sin(h*Qn/360),u=Math.cos(h*Qn/360),l=u*(s-e)/2+c*(t-n)/2,m=-c*(s-e)/2+u*(t-n)/2;if(l===0&&m===0)return[];if(o===0||a===0)return[];o=Math.abs(o),a=Math.abs(a);const f=l*l/(o*o)+m*m/(a*a);f>1&&(o*=Math.sqrt(f),a*=Math.sqrt(f));const p=z1(s,t,e,n,i,r,o,a,c,u),y=[];let v=p[2],w=p[3];const _=Math.max(Math.ceil(Math.abs(w)/(Qn/4)),1);w/=_;for(let x=0;x<_;x++)y.push(N1(v,w)),v+=w;return y.map(x=>{for(let b=0;b<x.length;b+=2){let E=x[b+0],C=x[b+1];E*=o,C*=a;const L=u*E-c*C,B=c*E+u*C;x[b+0]=L+p[0],x[b+1]=B+p[1]}return x})}function go(s,t,e,n,i,r){return[s/3+.6666666666666666*e,t/3+.6666666666666666*n,i/3+.6666666666666666*e,r/3+.6666666666666666*n,i,r]}function Kn(s,t,e,n){return[s,t,e,n,e,n]}const Js={a:7,c:6,s:4,q:4,t:2,m:2,l:2,h:1,v:1,z:0};function Au(s="path",t){const e=document.createElementNS.call(document,"http://www.w3.org/2000/svg",s);return t&&je(e,t),e}function B1(s,t){return Au("path",{d:s,id:t||on()})}function F1(s,t="shape"){return js(nr(s),`${t}.svg`)}function ku(s){return typeof s!="string"?!1:(s=s.trim(),/^[mlhvzaqtcs]\s*[-+.0-9][^mlhvzaqtcs]+/i.test(s)&&/[\dz]$/i.test(s))}function Y1(s){return s.map(t=>{if(!t[0])return"";switch(t[0].toLowerCase()){case"a":return`${t[0]} ${t[1]},${t[2]} ${t[3]} ${t[4]},${t[5]} ${t[6]},${t[7]}`;case"c":return`${t[0]} ${t[1]},${t[2]} ${t[3]},${t[4]} ${t[5]},${t[6]}`;case"s":case"q":return`${t[0]} ${t[1]},${t[2]} ${t[3]},${t[4]}`;default:return t[0]+" "+t.slice(1).join(",")}}).join(" ")}function Iu(s){const t=[];return ku(s)&&s.replace(/([mlhvzaqtcs])([^mlhvzaqtcs]*)/gi,(e,n,i)=>{let r=n.toLowerCase();const o=Ci(i);for(r=="m"&&o.length>Js[r]&&(t.push([n,...o.splice(0,Js[r])]),r="l",n=n=="m"?"l":"L");o.length;){if(o.length<Js[r])throw new Error(`parseSVGPath substring:{ ${e} } command:{ ${n} } args:{ ${o} }`);t.push([n,...o.splice(0,Js[r])])}return r=="z"&&t.push([n]),""}),t}function Du(s){let t=0,e=0,n=0,i=0;return s.map(function(r){const o=r[0],a=o.toUpperCase();if(o!=a)switch(r[0]=a,o){case"a":r[6]+=n,r[7]+=i;break;case"v":r[1]+=i;break;case"h":r[1]+=n;break;default:for(let h=1;h<r.length;)r[h++]+=n,r[h++]+=i}switch(a){case"Z":n=t,i=e;break;case"H":n=r[1];break;case"V":i=r[1];break;case"M":n=t=r[1],i=e=r[2];break;default:n=r[r.length-2],i=r[r.length-1]}return r})}function $1(s){const t=[];let e=0,n=0,i=0,r=0,o=0,a=0,h=0,c=0,u;for(let l=0,m=s.length;l<m;l++){let f=s[l];const p=f[0];switch(p){case"M":e=f[1],n=f[2];break;case"A":const y=Mu(i,r,f[6],f[7],f[4],f[5],f[1],f[2],f[3]);if(!y.length)continue;y.forEach((_,x)=>{const[b,E,C,L,B,F,U,G]=_;f=["C",C,L,B,F,U,G],x<y.length-1&&t.push(f)});break;case"S":let v=i,w=r;(u=="C"||u=="S")&&(v+=v-h,w+=w-c),f=["C",v,w,f[1],f[2],f[3],f[4]];break;case"T":u=="Q"||u=="T"?(o=i*2-o,a=r*2-a):(o=i,a=r),f=["C",...go(i,r,o,a,f[1],f[2])];break;case"Q":o=f[1],a=f[2],f=["C",...go(i,r,f[1],f[2],f[3],f[4])];break;case"L":f=["C",...Kn(i,r,f[1],f[2])];break;case"H":f=["C",...Kn(i,r,f[1],r)];break;case"V":f=["C",...Kn(i,r,i,f[1])];break;case"Z":f=["C",...Kn(i,r,e,n)];break}u=p,i=f[f.length-2],r=f[f.length-1],f.length>4?(h=f[f.length-4],c=f[f.length-3]):(h=i,c=r),t.push(f)}return t}class ts{video;constructor(t){this.video=t}setSrcObject(t){this.video.addEventListener("loadedmetadata",e=>{e.target}),this.video.srcObject=t}captureWebCamera(){navigator.mediaDevices.getUserMedia({video:!0}).then(t=>{this.setSrcObject(t)})}static async videoMediaChangeSupport(){return new Promise(t=>{const e=document.createElement("iframe"),n=document.createElement("video"),i=document.createElement("source"),r=new MediaSource;r.addEventListener("sourceopen",()=>t(!0)),i.src=URL.createObjectURL(r),i.media="(min-width:10px)",n.append(i),e.width="5",e.style.cssText="position: absolute; visibility: hidden;",document.documentElement.append(e),e.contentDocument?.body.append(n),setTimeout(()=>{e.width="15"}),setTimeout(()=>{e.remove(),t(!1)},1e3)})}static tryAutoPlayOrAutoPlayAfterClick(t){return new Promise(e=>{t.play().then(()=>{t.autoplay=!0,e(!0)}).catch(()=>{ts.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 yo extends gs{source;raw="";mode="text";tagname="";nodename="";textchunk="";entity="";quote="";attrs={};constructor(t){super(),this.source=t}parse(){const t=Ll(this.source);if(t===0){this.emit("finish");return}let e,n,i=da(this.source,0);for(let r=1;r<t;r++)e=n,n=i,i=da(this.source,r),this.raw+=n,n&&this.step(n,i,e);i&&this.step(i,void 0,n),this.emit("finish")}step(t,e,n){t==`
26
- `&&this.emit("newline"),this.act(t,e,n)}act(t,e,n){switch(this.mode){case"text":switch(t){case"<":case"eof":this.nodename="",this.attrs={},this.mode="tag name start",this.raw=this.raw.slice(0,-1),this.textchunk&&this.emit("text",this.textchunk),this.raw+=t,this.textchunk="";break;case"&":this.mode="entity",this.entity="";break;default:this.textchunk+=t;break}break;case"entity":ue("whitespace",t)?(this.textchunk+=Lu(this.entity),this.mode="text"):t==";"?(this.textchunk+=Lu(this.entity+t),this.mode="text"):this.entity+=t;break;case"special":if(n=="!"&&t=="-"&&e=="-"){this.mode="comment start";break}if(this.textchunk=="[CDATA"&&t=="["){this.mode="cdata",this.textchunk="";break}if(t==">"||t=="eof"){this.emit("special",this.textchunk),this.mode="text",this.textchunk="";break}this.textchunk+=t;break;case"cdata":if(n=="]"&&t=="]"&&e==">"){this.mode="cdata end",this.textchunk=this.textchunk.slice(0,-1);break}t=="eof"&&(this.mode="cdata end",this.act(t,e,n)),this.textchunk+=t;break;case"cdata end":this.emit("cdata",this.textchunk),this.textchunk="",this.mode="text";break;case"comment start":e==">"||t=="eof"?(this.emit("comment",""),this.mode="skip"):this.mode="comment";break;case"skip":this.mode="text";break;case"comment":t=="-"&&n=="-"&&e==">"?(this.mode="comment end",this.textchunk=this.textchunk.slice(0,-1)):t=="eof"?this.emit("comment",this.textchunk):this.textchunk+=t;break;case"comment end":this.emit("comment",this.textchunk),this.textchunk="",this.mode="text";break;case"declaration":if(t=="?"&&e==">"){this.mode="declaration end";break}t=="eof"&&this.emit("comment",this.textchunk),this.textchunk+=t;break;case"declaration end":this.emit("comment",this.textchunk),this.textchunk="",this.mode="text";break;case"tag name start":if(t=="eof"){this.emit("text","<");break}if(!ue("whitespace",t)){if(this.mode="tag name",t=="/"){this.mode="close tag name start";break}else if(t=="!"){this.mode="special",this.textchunk="";break}else if(t=="?"){this.mode="declaration";break}this.act(t,e,n)}break;case"close tag name start":ue("whitespace",t)||(this.mode="close tag name",this.tagname="",this.nodename="",this.act(t,e,n));break;case"close tag name":if(ue("whitespace",t))this.tagname=this.nodename;else switch(t){case">":this.emit("/tag",this.tagname||this.nodename,this.attrs),this.mode="text";break;default:!this.tagname&&(this.nodename+=t);break}break;case"tag name":if(ue("whitespace",t))this.tagname=this.nodename,this.nodename="",this.mode="attr start";else switch(t){case">":this.emit("tag",this.nodename,this.attrs),this.mode="text";break;case"/":this.raw+=e,this.emit("tag",this.nodename,this.attrs),this.emit("/tag",this.nodename,this.attrs),this.mode="skip";break;default:this.nodename+=t;break}break;case"attr start":ue("whitespace",t)||(this.mode="attr",this.nodename="",this.act(t,e,n));break;case"attr":if(ue("whitespace",t)||t=="=")this.attrs[this.nodename]="",this.mode="attr value start";else switch(t){case">":this.nodename=="/"?(delete this.attrs["/"],this.emit("tag",this.tagname,this.attrs),this.emit("/tag",this.tagname,this.attrs)):(this.nodename&&(this.attrs[this.nodename]=""),this.emit("tag",this.tagname,this.attrs)),this.mode="text";break;default:this.nodename+=t;break}break;case"attr value start":if(!ue("whitespace",t)){if(this.mode="attr value",this.quote="",t=="'"||t=='"'){this.quote=t;return}this.act(t,e,n)}break;case"attr value":if(ue("whitespace",t)&&!this.quote)this.mode="attr start";else if(t==">"&&!this.quote)this.emit("tag",this.tagname,this.attrs),this.mode="text";else switch(t){case'"':case"'":this.quote==t&&n!="\\"&&(this.mode="attr start");break;default:this.attrs[this.nodename]+=t;break}break}}}function Lu(s){const t={lt:60,"lt;":60,"AMP;":38,AMP:38,"GT;":62,GT:62,"QUOT;":34,QUOT:34,"apos;":39,"bull;":8226,"bullet;":8226,"copy;":169,copy:169,"deg;":176,deg:176};let e;return s.charAt(0)=="#"?s.charAt(1).toLowerCase()=="x"?e=parseInt(s.substring(2),16):e=parseInt(s.substring(1),10):e=t[s],e?String.fromCharCode(e):"&"+s}var Ru=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function wo(s,t={}){var e=1,n=1;function i(R){var D=R.match(/\n/g);D&&(e+=D.length);var $=R.lastIndexOf(`
27
- `);n=~$?R.length-$:n+R.length}function r(){var R={line:e,column:n};return function(D){return D.position=new o(R),p(),D}}function o(R){this.start=R,this.end={line:e,column:n},this.source=t.source}o.prototype.content=s;var a=[];function h(R){var D=new Error(t.source+":"+e+":"+n+": "+R);if(D.reason=R,D.filename=t.source,D.line=e,D.column=n,D.source=s,t.silent)a.push(D);else throw D}function c(){var R=m();return{type:"stylesheet",stylesheet:{source:t.source,rules:R,parsingErrors:a}}}function u(){return f(/^{\s*/)}function l(){return f(/^}/)}function m(){var R,D=[];for(p(),y(D);s.length&&s.charAt(0)!="}"&&(R=Ut()||te());)R!==!1&&(D.push(R),y(D));return D}function f(R){var D=R.exec(s);if(D){var $=D[0];return i($),s=s.slice($.length),D}}function p(){f(/^\s*/)}function y(R){var D;for(R=R||[];D=v();)D!==!1&&R.push(D);return R}function v(){var R=r();if(!(s.charAt(0)!="/"||s.charAt(1)!="*")){for(var D=2;s.charAt(D)!=""&&(s.charAt(D)!="*"||s.charAt(D+1)!="/");)++D;if(D+=2,s.charAt(D-1)==="")return h("End of comment missing");var $=s.slice(2,D-2);return n+=2,i($),s=s.slice(D),n+=2,R({type:"comment",comment:$})}}function w(){var R=f(/^([^{]+)/);if(R)return ye(R[0]).replace(/\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*\/+/g,"").replace(/"(?:\\"|[^"])*"|'(?:\\'|[^'])*'/g,function(D){return D.replace(/,/g,"‌")}).split(/\s*(?![^(]*\)),\s*/).map(function(D){return D.replace(/\u200C/g,",")})}function _(){var R=r(),D=f(/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(D){if(D=ye(D[0]),!f(/^:\s*/))return h("property missing ':'");var $=f(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/),H=R({type:"declaration",property:D.replace(Ru,""),value:$?ye($[0]).replace(Ru,""):""});return f(/^[;\s]*/),H}}function x(){var R=[];if(!u())return h("missing '{'");y(R);for(var D;D=_();)D!==!1&&(R.push(D),y(R));return l()?R:h("missing '}'")}function b(){for(var R,D=[],$=r();R=f(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/);)D.push(R[1]),f(/^,\s*/);if(D.length)return $({type:"keyframe",values:D,declarations:x()})}function E(){var R=r(),D=f(/^@([-\w]+)?keyframes\s*/);if(D){var $=D[1];if(D=f(/^([-\w]+)\s*/),!D)return h("@keyframes missing name");var H=D[1];if(!u())return h("@keyframes missing '{'");for(var At,ee=y();At=b();)ee.push(At),ee=ee.concat(y());return l()?R({type:"keyframes",name:H,vendor:$,keyframes:ee}):h("@keyframes missing '}'")}}function C(){var R=r(),D=f(/^@supports *([^{]+)/);if(D){var $=ye(D[1]);if(!u())return h("@supports missing '{'");var H=y().concat(m());return l()?R({type:"supports",supports:$,rules:H}):h("@supports missing '}'")}}function L(){var R=r(),D=f(/^@host\s*/);if(D){if(!u())return h("@host missing '{'");var $=y().concat(m());return l()?R({type:"host",rules:$}):h("@host missing '}'")}}function B(){var R=r(),D=f(/^@media *([^{]+)/);if(D){var $=ye(D[1]);if(!u())return h("@media missing '{'");var H=y().concat(m());return l()?R({type:"media",media:$,rules:H}):h("@media missing '}'")}}function F(){var R=r(),D=f(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(D)return R({type:"custom-media",name:ye(D[1]),media:ye(D[2])})}function U(){var R=r(),D=f(/^@page */);if(D){var $=w()||[];if(!u())return h("@page missing '{'");for(var H=y(),At;At=_();)H.push(At),H=H.concat(y());return l()?R({type:"page",selectors:$,declarations:H}):h("@page missing '}'")}}function G(){var R=r(),D=f(/^@([-\w]+)?document *([^{]+)/);if(D){var $=ye(D[1]),H=ye(D[2]);if(!u())return h("@document missing '{'");var At=y().concat(m());return l()?R({type:"document",document:H,vendor:$,rules:At}):h("@document missing '}'")}}function J(){var R=r(),D=f(/^@font-face\s*/);if(D){if(!u())return h("@font-face missing '{'");for(var $=y(),H;H=_();)$.push(H),$=$.concat(y());return l()?R({type:"font-face",declarations:$}):h("@font-face missing '}'")}}var st=Yt("import"),K=Yt("charset"),Kt=Yt("namespace");function Yt(R){var D=new RegExp("^@"+R+"\\s*([^;]+);");return function(){var $=r(),H=f(D);if(H){var At={type:R};return At[R]=H[1].trim(),$(At)}}}function Ut(){if(s[0]=="@")return E()||B()||F()||C()||st()||K()||Kt()||G()||U()||L()||J()}function te(){var R=r(),D=w();return D?(y(),R({type:"rule",selectors:D,declarations:x()})):h("selector missing")}return xo(c())}function ye(s){return s?s.replace(/^\s+|\s+$/g,""):""}function xo(s,t){var e=s&&typeof s.type=="string",n=e?s:t;for(var i in s){var r=s[i];Array.isArray(r)?r.forEach(function(o){xo(o,n)}):r&&typeof r=="object"&&xo(r,n)}return e&&Object.defineProperty(s,"parent",{configurable:!0,writable:!0,enumerable:!1,value:t||null}),s}let X1=class extends yo{currentItem={};items=[];groups=[];globalStyles={};grad={};idtops={};text="";constructor(t){super(t),this.on("tag",(e,n)=>{switch(this.text="",this.currentItem={type:e},e){case"g":this.groups.push(this.currentItem);break}this.processAttrs(e,n)}),this.on("text",e=>{if(this.currentItem.type=="style"){try{const n=wo(e);for(const i of n.stylesheet.rules)for(const r of i.declarations)for(const o of i.selectors)this.globalStyles[o]=this.globalStyles[o]||[],this.globalStyles[o].push(`${r.property}:${r.value}`)}catch{console.error("CAN'T parse css text: "+e)}return}this.text+=e}),this.on("/tag",(e,n)=>{let i=this.groups.length;for(;i--;)if(this.groups[i]!=this.currentItem){let r="",o="";for(const a in this.groups[i])a=="transform"?r=this.groups[i].transform:a=="class"&&this.globalStyles["."+this.groups[i][a]]?o=this.globalStyles["."+this.groups[i][a]].join(";")+";"+o:a=="id"&&this.globalStyles["#"+this.groups[i][a]]?o=this.globalStyles["#"+this.groups[i][a]].join(";")+";"+o:typeof this.currentItem[a]>"u"&&(this.currentItem[a]=this.groups[i][a]);typeof this.currentItem.transform>"u"?this.currentItem.transform=r:this.currentItem.transform+=" "+r,typeof this.currentItem.style>"u"?this.currentItem.style=o:this.currentItem.style=o+this.currentItem.style,this.currentItem.class&&this.globalStyles["."+this.currentItem.class]?this.currentItem.style=this.globalStyles["."+this.currentItem.class].join(";")+";"+this.currentItem.style:this.currentItem.id&&this.globalStyles["#"+this.currentItem.id]&&(this.currentItem.style=this.globalStyles["#"+this.currentItem.id].join(";")+";"+this.currentItem.style),vo(this.currentItem.style,this.currentItem,_o)}switch(this.processAttrs(e,n),e){case"g":this.groups.pop();break;case"cirlce":this.addToItems();break;case"ellipse":this.addToItems();break;case"polygon":this.addToItems();break;case"path":this.addToItems();break;case"line":this.addToItems();break;case"rect":this.addToItems();break;case"image":this.addToItems();break;case"text":this.currentItem.text=this.text,this.currentItem["text-anchor"]=this.currentItem["text-anchor"]||"start",this.addToItems();break}}),this.on("finish",()=>{this.emit("result",this.items)})}parse(){return super.parse(),this.items}processAttrs(t,e){let n=[],i;switch(t){case"svg":let r="",o="";if(e.width&&e.height)r=e.width,o=e.height;else if(e.viewBox){const a=e.viewBox.split(/\s+/gi);a.length==4&&(r=String(parseFloat(a[2])-parseFloat(a[0])),o=String(parseFloat(a[3])-parseFloat(a[1])))}r&&o&&this.items.push({type:"viewbox",width:r,height:o});break;case"line":typeof e.x1=="number"&&typeof e.y1=="number"&&typeof e.x2=="number"&&typeof e.y2=="number"&&(this.currentItem.path="M"+[e.x1,e.y1,e.x2,e.y2]);break;case"stop":i={},e.style&&vo(e.style,i),i.offset=i.offset||e.offset,i.color=i["stop-color"]||e["stop-color"],i.opacity=i["stop-opacity"]||e["stop-opacity"],~(i.offset+"").indexOf("%")?i.offset=parseFloat(i.offset):i.offset=parseFloat(i.offset)*100,i.offset=+i.offset.toFixed(2),this.grad.stops.push(i);break;case"linearGradient":this.grad.angle=(360+bo(parseFloat(e.x1),parseFloat(e.y1),parseFloat(e.x2),parseFloat(e.y2),parseFloat(e.x1)+100,parseFloat(e.y1))).toFixed(2),n=[this.grad.angle];for(let a=0,h=this.grad.stops.length;a<h;a++)i=this.grad.stops[a],a&&a!=h-1?n.push(i.color+":"+i.offset):n.push(i.color);this.idtops[this.grad.id]=n.join("-"),this.items.forEach(a=>{a.fillid==this.grad.id&&(a.fill=this.idtops[this.grad.id])});break;case"radialGradient":n=[];for(let a=0,h=this.grad.stops.length;a<h;a++)i=this.grad.stops[a],a&&a!=h-1?n.push(i.color+":"+i.offset):n.push(i.color);this.idtops[this.grad.id]=n.join("-"),this.items.forEach(a=>{a.fillid==this.grad.id&&(a.fill=this.idtops[this.grad.id])});break}for(const r in e){const o=e[r];if(_o.includes(r)&&(this.currentItem[r]=o),r==="id"&&(this.currentItem.type==="linearGradient"&&(this.grad={id:r,stops:[]}),this.currentItem.type==="radialGradient"&&(this.grad={id:r,stops:[]})),r==="style"&&vo(o,this.currentItem,_o),r==="transform"&&(this.currentItem.transform=o+(this.currentItem.transform||" ")),r==="fill"){const a=o.match(/url\(#([^)]+)\)/);if(a){const h=a[1];this.currentItem.fillid=h,this.idtops[h]&&(this.currentItem.fill=this.idtops[h])}}r==="points"&&this.currentItem.type=="polygon"&&(this.currentItem.path="M"+o+"z"),r==="d"&&this.currentItem.type=="path"&&(this.currentItem.path=o),r==="xlink:href"&&this.currentItem.type=="image"&&(this.currentItem.src=o)}}addToItems(){this.items.push(this.currentItem)}};function bo(s,t,e,n,i,r){if(typeof i>"u"||typeof r>"u"){const o=s-e,a=t-n;return!o&&!a?0:(180+Math.atan2(-a,-o)*180/Math.PI+360)%360}else return bo(s,t,i,r)-bo(e,n,i,r)}function vo(s,t,e){const n=(s+"").split(";"),i=/^\s+|\s+$/g;for(let r=0,o=n.length;r<o;r++){const a=n[r].split(":"),h=a[0].replace(i,"").replace(/[A-Z]/g,function(c){return"-"+c.toLowerCase()});(!e||e.includes(h))&&(t[h]=a[1].replace(i,""))}}const _o=["id","class","viewBox","width","height","x","y","cx","cy","r","rx","ry","cursor","opacity","src","fill","fill-opacity","stroke","stroke-dasharray","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-anchor","font","font-family","font-size","font-style","font-weight","letter-spacing"];class St{startPathX=0;startPathY=0;prevPathX=0;prevPathY=0;normalizedLines=[];constructor(t){const e=typeof t=="string"?Iu(t):t||[],n=$1(Du(e));let i=!1;for(let r=0,o=n.length;r<o;r++){const a=n[r];a[0]=="M"?(i||(i=!0,this.startPathX=a[1],this.startPathY=a[2]),this.prevPathX=a[1],this.prevPathY=a[2]):this._appendLine(new gt({c1x:a[1],c1y:a[2],c2x:a[3],c2y:a[4],toX:a[5],toY:a[6]}))}}_appendLine(t){if(t instanceof po){Mu(this.prevPathX,this.prevPathY,t.toX,t.toY,t.largeArcFlag,t.sweepFlag,t.rx,t.ry,t.xAxisRotate).forEach(c=>{const[u,l,m,f,p,y,v,w]=c;this.normalizedLines.push(new gt({x:this.prevPathX,y:this.prevPathY,c1x:m,c1y:f,c2x:p,c2y:y,toX:v,toY:w})),this.prevPathX=v,this.prevPathY=w});return}if(t instanceof gt){this.normalizedLines.push(t.clone()),this.prevPathX=t.toX,this.prevPathY=t.toY;return}let e,n,i,r,o,a;t instanceof O1?[e,n,i,r,o,a]=go(this.prevPathX,this.prevPathY,t.cx,t.cy,t.toX,t.toY):[e,n,i,r,o,a]=Kn(this.prevPathX,this.prevPathY,t.toX,t.toY),this.normalizedLines.push(new gt({x:this.prevPathX,y:this.prevPathY,c1x:e,c1y:n,c2x:i,c2y:r,toX:o,toY:a})),this.prevPathX=o,this.prevPathY=a}static fromPolymorphPoints(t){const e=new St;e.prevPathX=e.startPathX=t[0]||0,e.prevPathY=e.startPathY=t[1]||0;for(let n=2,i=t.length;n+5<i;n+=6)e._appendLine(new gt({c1x:t[n],c1y:t[n+1],c2x:t[n+2],c2y:t[n+3],toX:t[n+4],toY:t[n+5]}));return e}static fromLines(t){const e=new St;e.prevPathX=e.startPathX=t[0].x||0,e.prevPathY=e.startPathY=t[0].y||0;for(let n=0,i=t.length;n<i;n++)e._appendLine(t[n]);return e}clone(){return St.fromLines(this.normalizedLines)}toSVGPathData(){const t=[];t.push(["M",this.startPathX,this.startPathY]);for(let e=0,n=this.normalizedLines.length;e<n;e++)t.push(...this.normalizedLines[e].toSVGPathData());return t}toSVGPathD(){return Y1(this.toSVGPathData())}toCanvasContext(t){t.beginPath(),t.moveTo(this.startPathX,this.startPathY),this.normalizedLines.forEach(e=>{e.toCanvasContext(t)})}getBoundingClientRect(t=2){const e=[],n=[];if(this.normalizedLines.forEach(h=>{const c=h.getBoundingClientRect();e.push(c.x,c.x+c.width),n.push(c.y,c.y+c.height)}),e.length==0||n.length==0)return{x:0,y:0,width:0,height:0,center:{x:0,y:0}};const i=Math.min(...e),r=Math.min(...n),o=Math.max(...e),a=Math.max(...n);return{x:Z(i,t),y:Z(r,t),width:Z(o-i,t),height:Z(a-r,t)}}getBoundingClientRectCenter(t=2){const e=this.getBoundingClientRect(t);return{x:Z(e.x+e.width*.5,t),y:Z(e.y+e.height*.5,t)}}transform(t,e,n,i,r,o,a){const h=new _t;return h.translate(t,e),h.rotate(r,n,i),h.scale(o,a,n,i),h.isIdentity?this.clone():St.fromLines(this.normalizedLines.map(c=>{let u=c.x,l=c.y,m=c.c1x,f=c.c1y,p=c.c2x,y=c.c2y,v=c.toX,w=c.toY;return{x:u,y:l}=h.transformPoint({x:u,y:l}),{x:m,y:f}=h.transformPoint({x:m,y:f}),{x:p,y}=h.transformPoint({x:p,y}),{x:v,y:w}=h.transformPoint({x:v,y:w}),new gt({x:u,y:l,c1x:m,c1y:f,c2x:p,c2y:y,toX:v,toY:w})}))}getTotalLength(){return this.normalizedLines.reduce((t,e)=>t+=e.length(),0)}getPointAtLength(t){let e=0,n=0;const i=this.normalizedLines.length;for(let r=0;r<i;r++){const o=this.normalizedLines[r];if(n=o.length(),e+n>=t)return o.getPointAtSegmentLength(t-e);e+=n}return this.normalizedLines[i-1].getPointAtSegmentLength(n)}interpolate(t){const e=this.normalizedLines.length;if(e===0)return{x:0,y:0};if(e===1)return this.normalizedLines[0].interpolate(t);{let n=t*e,i=this.normalizedLines[0];if(n--,n>1)for(let r=1;r<e&&(i=this.normalizedLines[r],n>1);r++)n-=1;return i.interpolate(n)}}getSubPathD(t,e){if(this.getTotalLength()-e<1e-6)return this.getSubPathDAtLength(this,t);{const n=this.getSubPathDAtLength(this,e,1);return t?this.getSubPathDAtLength(n,t):n}}getSubPathDAtLength(t,e,n){let i=null,r=0;const o=new St;o.prevPathX=o.startPathX=t.startPathX,o.prevPathY=o.startPathY=t.startPathY;for(let a=0,h=this.normalizedLines.length;a<h;a++){const c=this.normalizedLines[a],u=c.length();if(r+u>e&&!i){const l=c.getPointAtSegmentLength(e-r);if(o._appendLine(new gt({c1x:l.start.x,c1y:l.start.y,c2x:l.m.x,c2y:l.m.y,toX:l.x,toY:l.y})),n)return o;i=o,o._appendLine(new gt({c1x:l.n.x,c1y:l.n.y,c2x:l.end.x,c2y:l.end.y,toX:c.x,toY:c.y})),r+=u;continue}r+=u,o._appendLine(c)}return o}closestPoint(t,e){const n=this.getTotalLength();let i={x:t,y:e},r=0,o=1/0,a=8;for(let c=0;c<=n;c+=a){const u=this.getPointAtLength(c),l=(t-u.x)*(t-u.x)+(e-u.y)*(e-u.y);l<o&&(i=u,r=c,o=l)}for(a/=2;a>.5;){const c=r-a,u=this.getPointAtLength(c),l=(t-u.x)*(t-u.x)+(e-u.y)*(e-u.y),m=r+a,f=this.getPointAtLength(m),p=(t-f.x)*(t-f.x)+(e-f.y)*(e-f.y);c>=0&&l<o?(i=u,r=c,o=l):m<=n&&p<o?(i=f,r=m,o=p):a/=2}const h=this.getPointAtLength(r+(r===n?-.1:.1));return{point:i,rotation:r>=n?Jt(h.x,h.y,i.x,i.y):Jt(i.x,i.y,h.x,h.y),distance:Math.sqrt(o)}}getPolymorphPoints(){return[this.startPathX,this.startPathY].concat(this.normalizedLines.reduce((t,e)=>t.concat([e.c1x,e.c1y,e.c2x,e.c2y,e.toX,e.toY]),[]))}getPolymorphPointsPerimeter(){const t=this.getPolymorphPoints(),e=t.length;let n=t[e-2],i=t[e-1],r=0;for(let o=0;o<e;o+=6)r+=Me(t[o],t[o+1],n,i),n=t[o],i=t[o+1];return Math.floor(r)}getExpendedPolymorphPointsPathD(t){const e=this.getPolymorphPoints(),n=e.length;let i=t-n;const r=Math.ceil(t/n),o=[];o.push(["M",e[0],e[1]]);let a=2;for(;a+5<=n-1;){const h=e[a++],c=e[a++],u=e[a++],l=e[a++],m=e[a++],f=e[a++];o.push(["C",h,c,u,l,m,f]);let p=0;for(;p<r&&i>0;)o.push(["C",m,f,m,f,m,f]),i-=6,p++}return new St(o)}static getInterpolator(t,e){return n=>Math.abs(n-0)<Number.EPSILON?new St(t.toSVGPathD()):Math.abs(n-1)<Number.EPSILON?new St(e.toSVGPathD()):St.fromPolymorphPoints(ef(t.getPolymorphPoints(),e.getPolymorphPoints(),n))}}const Ou=U1("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 U1(s,t=10){const e={},n=s.split(",");for(let i=0;i<n.length;i+=2){const r="&"+n[i+1]+";",o=parseInt(n[i],t);e[r]="&#"+o+";"}return e["\\xa0"]="&#160;",e}function Mt(s,t){const e=Object.keys(t);for(let n=0;n<e.length;n++)s=s.replace(new RegExp("{"+e[n]+"}","gi"),""+t[e[n]]);return s}function Zs(s){let t,e;if(!s)throw new Error("cannot create a random attribute name for an undefined object");const n="ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz";t="";do for(t="",e=0;e<12;e++)t+=n[Math.floor(Math.random()*n.length)];while(s[t]);return t}function V1(s){const t={left:"start",right:"end",center:"middle",start:"start",end:"end"};return t[s]||t.start}function G1(s){const t={alphabetic:"alphabetic",hanging:"hanging",top:"text-before-edge",bottom:"text-after-edge",middle:"central"};return t[s]||t.alphabetic}const es={strokeStyle:{svgAttr:"stroke",canvas:"#000000",svg:"none",apply:"stroke"},fillStyle:{svgAttr:"fill",canvas:"#000000",svg:null,apply:"fill"},lineCap:{svgAttr:"stroke-linecap",canvas:"butt",svg:"butt",apply:"stroke"},lineJoin:{svgAttr:"stroke-linejoin",canvas:"miter",svg:"miter",apply:"stroke"},miterLimit:{svgAttr:"stroke-miterlimit",canvas:10,svg:4,apply:"stroke"},lineWidth:{svgAttr:"stroke-width",canvas:1,svg:1,apply:"stroke"},globalAlpha:{svgAttr:"opacity",canvas:1,svg:1,apply:"fill stroke"},font:{canvas:"10px sans-serif"},shadowColor:{canvas:"#000000"},shadowOffsetX:{canvas:0},shadowOffsetY:{canvas:0},shadowBlur:{canvas:0},textAlign:{canvas:"start"},textBaseline:{canvas:"alphabetic"},lineDash:{svgAttr:"stroke-dasharray",canvas:[],svg:null,apply:"stroke"},lineDashOffset:{svgAttr:"stroke-dashoffset",canvas:0,svg:0,apply:"stroke"}};class So{__root;__ctx;constructor(t,e){this.__root=t,this.__ctx=e}addColorStop(t,e){const n=this.__ctx.__createElement("stop");if(n.setAttribute("offset",""+t),e.indexOf("rgba")!==-1){const r=/rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d?\.?\d*)\s*\)/gi.exec(e);r&&(n.setAttribute("stop-color",Mt("rgb({r},{g},{b})",{r:r[1],g:r[2],b:r[3]})),n.setAttribute("stop-opacity",r[4]))}else n.setAttribute("stop-color",e);this.__root.appendChild(n)}}class zu{__root;__ctx;constructor(t,e){this.__root=t,this.__ctx=e}}class Qs{__document=document;__canvas;__ctx;width;height;__styleStack;__groupStack;__rootSVG;__ids;__SVGdefs;__currentElement;__currentElementsToStyle=null;constructor({canvas:t,width:e=500,height:n=500}){t?(this.__canvas=t,this.__ctx=t.getContext("2d")):(this.__canvas=this.__document.createElement("canvas"),this.__ctx=this.__canvas.getContext("2d")),this.width=e||t?.width||0,this.height=n||t?.height||0,this.__setDefaultStyles(),this.__styleStack=[this.__getStyleState()],this.__groupStack=[],this.__rootSVG=this.__document.createElementNS("http://www.w3.org/2000/svg","svg"),this.__rootSVG.setAttribute("version","1.1"),this.__rootSVG.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.__rootSVG.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink","http://www.w3.org/1999/xlink"),this.__rootSVG.setAttribute("width",""+this.width),this.__rootSVG.setAttribute("height",""+this.height),this.__ids={},this.__SVGdefs=this.__document.createElementNS("http://www.w3.org/2000/svg","defs"),this.__rootSVG.appendChild(this.__SVGdefs),this.__currentElement=this.__document.createElementNS("http://www.w3.org/2000/svg","g"),this.__rootSVG.appendChild(this.__currentElement)}__setDefaultStyles(){const t=Object.keys(es);for(let e=0,n=t.length;e<n;e++){const i=t[e];this[i]=es[i].canvas}}__getStyleState(){const t={},e=Object.keys(es);for(let n=0,i=e.length;n<i;n++){const r=e[n];t[r]=this[r]}return t}__applyStyleState(t){const e=Object.keys(t);for(let n=0,i=e.length;n<i;n++){const r=e[n];this[r]=t[r]}}__createElement(t,e={},n=!1){const i=this.__document.createElementNS("http://www.w3.org/2000/svg",t),r=Object.keys(e);n&&(i.setAttribute("fill","none"),i.setAttribute("stroke","none"));for(let o=0;o<r.length;o++){const a=r[o];i.setAttribute(a,e[a])}return i}__applyStyleToCurrentElement(t){let e=this.__currentElement;const n=this.__currentElementsToStyle;n&&(e.setAttribute(t,""),e=n.element,n.children.forEach(r=>{r.setAttribute(t,"")}));const i=Object.keys(es);for(let r=0;r<i.length;r++){const o=es[i[r]],a=this[i[r]];if(o.apply){if(a instanceof zu){if(a.__ctx)for(;a.__ctx.__SVGdefs.childNodes.length;){const h=a.__ctx.__SVGdefs.childNodes[0].getAttribute("id");this.__ids[h]=h,this.__SVGdefs.appendChild(a.__ctx.__SVGdefs.childNodes[0])}e.setAttribute(o.apply,Mt("url(#{id})",{id:a.__root.getAttribute("id")}))}else if(a instanceof So)e.setAttribute(o.apply,Mt("url(#{id})",{id:a.__root.getAttribute("id")}));else if(o.apply.indexOf(t)!==-1&&o.svg!==a)if((o.svgAttr==="stroke"||o.svgAttr==="fill")&&a.indexOf("rgba")!==-1){const c=/rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d?\.?\d*)\s*\)/gi.exec(a);if(c){e.setAttribute(o.svgAttr,Mt("rgb({r},{g},{b})",{r:c[1],g:c[2],b:c[3]}));let u=parseFloat(c[4]);const l=this.globalAlpha;l!=null&&(u*=l),e.setAttribute(o.svgAttr+"-opacity",""+u)}}else{let h=o.svgAttr;if(i[r]==="globalAlpha"&&(h=t+"-"+o.svgAttr,e.getAttribute(h)))continue;h&&e.setAttribute(h,a)}}}}__closestGroupOrSvg(t){return t=t||this.__currentElement,t.nodeName==="g"||t.nodeName==="svg"?t:this.__closestGroupOrSvg(t.parentNode)}getSerializedSvg(t){let e=new XMLSerializer().serializeToString(this.__rootSVG);if(/xmlns="http:\/\/www\.w3\.org\/2000\/svg".+xmlns="http:\/\/www\.w3\.org\/2000\/svg/gi.test(e)&&(e=e.replace('xmlns="http://www.w3.org/2000/svg','xmlns:xlink="http://www.w3.org/1999/xlink')),t){const i=Object.keys(Ou);for(let r=0,o=i.length;r<o;r++){const a=i[r],h=Ou[a],c=new RegExp(a,"gi");c.test(e)&&(e=e.replace(c,h))}}return e}getSvg(){return this.__rootSVG}save(){const t=this.__createElement("g"),e=this.__closestGroupOrSvg();this.__groupStack.push(e),e.appendChild(t),this.__currentElement=t,this.__styleStack.push(this.__getStyleState())}restore(){this.__currentElementsToStyle=null;const t=this.__groupStack.pop();t?this.__currentElement=t:this.__currentElement=this.__rootSVG.childNodes[1];const e=this.__styleStack.pop();e&&this.__applyStyleState(e)}__addTransform(t){const e=this.__closestGroupOrSvg();if(e.childNodes.length>0){this.__currentElement.nodeName==="path"&&(this.__currentElementsToStyle||(this.__currentElementsToStyle={element:e,children:[]}),this.__currentElementsToStyle.children.push(this.__currentElement),this.__applyCurrentDefaultPath());const i=this.__createElement("g");e.appendChild(i),this.__currentElement=i}let n=this.__currentElement.getAttribute("transform");n?n+=" ":n="",n+=t,this.__currentElement.setAttribute("transform",n)}scale(t,e){e===void 0&&(e=t),this.__addTransform(Mt("scale({x},{y})",{x:t,y:e}))}rotate(t){const e=t*180/Math.PI;this.__addTransform(Mt("rotate({angle},{cx},{cy})",{angle:e,cx:0,cy:0}))}translate(t,e){this.__addTransform(Mt("translate({x},{y})",{x:t,y:e}))}transform(t,e,n,i,r,o){this.__addTransform(Mt("matrix({a},{b},{c},{d},{e},{f})",{a:t,b:e,c:n,d:i,e:r,f:o}))}beginPath(){this.__currentDefaultPath="",this.__currentPosition={};const t=this.__createElement("path",{},!0);this.__closestGroupOrSvg().appendChild(t),this.__currentElement=t}__applyCurrentDefaultPath(){const t=this.__currentElement;t.nodeName==="path"&&t.setAttribute("d",this.__currentDefaultPath)}__addPathCommand(t){this.__currentDefaultPath+=" ",this.__currentDefaultPath+=t}moveTo(t,e){this.__currentElement.nodeName!=="path"&&this.beginPath(),this.__currentPosition={x:t,y:e},this.__addPathCommand(Mt("M {x} {y}",this.__currentPosition))}closePath(){this.__currentDefaultPath&&this.__addPathCommand("Z")}lineTo(t,e){this.__currentPosition={x:t,y:e},this.__currentDefaultPath.indexOf("M")>-1?this.__addPathCommand(Mt("L {x} {y}",this.__currentPosition)):this.__addPathCommand(Mt("M {x} {y}",this.__currentPosition))}bezierCurveTo(t,e,n,i,r,o){this.__currentPosition={x:r,y:o},this.__addPathCommand(Mt("C {cp1x} {cp1y} {cp2x} {cp2y} {x} {y}",{cp1x:t,cp1y:e,cp2x:n,cp2y:i,x:r,y:o}))}quadraticCurveTo(t,e,n,i){this.__currentPosition={x:n,y:i},this.__addPathCommand(Mt("Q {cpx} {cpy} {x} {y}",{cpx:t,cpy:e,x:n,y:i}))}normalize(t){const e=Math.sqrt(t[0]*t[0]+t[1]*t[1]);return[t[0]/e,t[1]/e]}arcTo(t,e,n,i,r){const o=this.__currentPosition&&this.__currentPosition.x,a=this.__currentPosition&&this.__currentPosition.y;if(typeof o>"u"||typeof a>"u")return;if(r<0)throw new Error("IndexSizeError: The radius provided ("+r+") is negative.");if(o===t&&a===e||t===n&&e===i||r===0){this.lineTo(t,e);return}const h=this.normalize([o-t,a-e]),c=this.normalize([n-t,i-e]);if(h[0]*c[1]===h[1]*c[0]){this.lineTo(t,e);return}const u=h[0]*c[0]+h[1]*c[1],l=Math.acos(Math.abs(u)),m=this.normalize([h[0]+c[0],h[1]+c[1]]),f=r/Math.sin(l/2),p=t+f*m[0],y=e+f*m[1],v=[-h[1],h[0]],w=[c[1],-c[0]],_=function(E){const C=E[0];return E[1]>=0?Math.acos(C):-Math.acos(C)},x=_(v),b=_(w);this.lineTo(p+v[0]*r,y+v[1]*r),this.arc(p,y,r,x,b)}stroke(){this.__currentElement.nodeName==="path"&&this.__currentElement.setAttribute("paint-order","fill stroke markers"),this.__applyCurrentDefaultPath(),this.__applyStyleToCurrentElement("stroke")}fill(){this.__currentElement.nodeName==="path"&&this.__currentElement.setAttribute("paint-order","stroke fill markers"),this.__applyCurrentDefaultPath(),this.__applyStyleToCurrentElement("fill")}rect(t,e,n,i){this.__currentElement.nodeName!=="path"&&this.beginPath(),this.moveTo(t,e),this.lineTo(t+n,e),this.lineTo(t+n,e+i),this.lineTo(t,e+i),this.lineTo(t,e),this.closePath()}fillRect(t,e,n,i){const r=this.__createElement("rect",{x:t,y:e,width:n,height:i},!0);this.__closestGroupOrSvg().appendChild(r),this.__currentElement=r,this.__applyStyleToCurrentElement("fill")}strokeRect(t,e,n,i){const r=this.__createElement("rect",{x:t,y:e,width:n,height:i},!0);this.__closestGroupOrSvg().appendChild(r),this.__currentElement=r,this.__applyStyleToCurrentElement("stroke")}__clearCanvas(){const e=this.__closestGroupOrSvg().getAttribute("transform"),n=this.__rootSVG.childNodes[1],i=n.childNodes;for(let r=i.length-1;r>=0;r--)i[r]&&n.removeChild(i[r]);this.__currentElement=n,this.__groupStack=[],e&&this.__addTransform(e)}clearRect(t,e,n,i){if(t===0&&e===0&&n===this.width&&i===this.height){this.__clearCanvas();return}const r=this.__closestGroupOrSvg(),o=this.__createElement("rect",{x:t,y:e,width:n,height:i,fill:"#FFFFFF"},!0);r.appendChild(o)}createLinearGradient(t,e,n,i){const r=this.__createElement("linearGradient",{id:Zs(this.__ids),x1:t+"px",x2:n+"px",y1:e+"px",y2:i+"px",gradientUnits:"userSpaceOnUse"},!1);return this.__SVGdefs.appendChild(r),new So(r,this)}createRadialGradient(t,e,n,i,r,o){const a=this.__createElement("radialGradient",{id:Zs(this.__ids),cx:i+"px",cy:r+"px",r:o+"px",fx:t+"px",fy:e+"px",gradientUnits:"userSpaceOnUse"},!1);return this.__SVGdefs.appendChild(a),new So(a,this)}__parseFont(){const e=/^\s*(?=(?:(?:[-a-z]+\s*){0,2}(italic|oblique))?)(?=(?:(?:[-a-z]+\s*){0,2}(small-caps))?)(?=(?:(?:[-a-z]+\s*){0,2}(bold(?:er)?|lighter|[1-9]00))?)(?:(?:normal|\1|\2|\3)\s*){0,3}((?:xx?-)?(?:small|large)|medium|smaller|larger|[.\d]+(?:%|in|[cem]m|ex|p[CustomCanvasContext]))(?:\s*\/\s*(normal|[.\d]+(?:%|in|[cem]m|ex|p[CustomCanvasContext])))?\s*([-,'"\sa-z0-9]+?)\s*$/i.exec(this.font),n={style:e[1]||"normal",size:e[4]||"10px",family:e[6]||"sans-serif",weight:e[3]||"normal",decoration:e[2]||"normal",href:null};return this.__fontUnderline==="underline"&&(n.decoration="underline"),this.__fontHref&&(n.href=this.__fontHref),n}__wrapTextLink(t,e){if(t.href){const n=this.__createElement("a");return n.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",t.href),n.appendChild(e),n}return e}__applyText(t,e,n,i){const r=this.__parseFont(),o=this.__closestGroupOrSvg(),a=this.__createElement("text",{"font-family":r.family,"font-size":r.size,"font-style":r.style,"font-weight":r.weight,"text-decoration":r.decoration,x:e,y:n,"text-anchor":V1(this.textAlign),"dominant-baseline":G1(this.textBaseline)},!0);a.appendChild(this.__document.createTextNode(t)),this.__currentElement=a,this.__applyStyleToCurrentElement(i),o.appendChild(this.__wrapTextLink(r,a))}fillText(t,e,n){this.__applyText(t,e,n,"fill")}strokeText(t,e,n){this.__applyText(t,e,n,"stroke")}measureText(t){return this.__ctx.font=this.font,this.__ctx.measureText(t)}arc(t,e,n,i,r,o){if(i===r)return;i=i%(2*Math.PI),r=r%(2*Math.PI),i===r&&(r=(r+2*Math.PI-.001*(o?-1:1))%(2*Math.PI));const a=t+n*Math.cos(r),h=e+n*Math.sin(r),c=t+n*Math.cos(i),u=e+n*Math.sin(i),l=o?0:1;let m=0,f=r-i;f<0&&(f+=2*Math.PI),o?m=f>Math.PI?0:1:m=f>Math.PI?1:0,this.lineTo(c,u),this.__addPathCommand(Mt("A {rx} {ry} {xAxisRotation} {largeArcFlag} {sweepFlag} {endX} {endY}",{rx:n,ry:n,xAxisRotation:0,largeArcFlag:m,sweepFlag:l,endX:a,endY:h})),this.__currentPosition={x:a,y:h}}clip(){const t=this.__closestGroupOrSvg(),e=this.__createElement("clipPath"),n=Zs(this.__ids),i=this.__createElement("g");this.__applyCurrentDefaultPath(),t.removeChild(this.__currentElement),e.setAttribute("id",n),e.appendChild(this.__currentElement),this.__SVGdefs.appendChild(e),t.setAttribute("clip-path",Mt("url(#{id})",{id:n})),t.appendChild(i),this.__currentElement=i}drawImage(...t){let e=t[0],n,i,r,o,a=0,h=0,c,u,l,m,f,p,y,v;if(t.length===3)n=t[1],i=t[2],c=e.width,u=e.height,r=c,o=u;else if(t.length===5)n=t[1],i=t[2],r=t[3],o=t[4],c=e.width,u=e.height;else if(t.length===9)a=t[1],h=t[2],c=t[3],u=t[4],n=t[5],i=t[6],r=t[7],o=t[8];else throw new Error("Invalid number of arguments passed to drawImage: "+arguments.length);const w=this.__closestGroupOrSvg();this.__currentElement;const _="translate("+n+", "+i+")";if(e instanceof Qs){if(l=e.getSvg().cloneNode(!0),l.childNodes&&l.childNodes.length>1){for(m=l.childNodes[0];m.childNodes.length;)v=m.childNodes[0].getAttribute("id"),this.__ids[v]=v,this.__SVGdefs.appendChild(m.childNodes[0]);if(f=l.childNodes[1],f){const x=f.getAttribute("transform");let b;x?b=x+" "+_:b=_,f.setAttribute("transform",b),w.appendChild(f)}}}else(e.nodeName==="CANVAS"||e.nodeName==="IMG")&&(p=this.__createElement("image"),p.setAttribute("width",r),p.setAttribute("height",o),p.setAttribute("preserveAspectRatio","none"),(a||h||c!==e.width||u!==e.height)&&(y=this.__document.createElement("canvas"),y.width=r,y.height=o,y.getContext("2d")?.drawImage(e,a,h,c,u,0,0,r,o),e=y),p.setAttribute("transform",_),p.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",e.nodeName==="CANVAS"?e.toDataURL():e.getAttribute("src")),w.appendChild(p))}createPattern(t,e){const n=this.__document.createElementNS("http://www.w3.org/2000/svg","pattern"),i=Zs(this.__ids);let r;return n.setAttribute("id",i),t.nodeName==="CANVAS"||t.nodeName==="IMG"?(r=this.__document.createElementNS("http://www.w3.org/2000/svg","image"),r.setAttribute("width",""+t.width),r.setAttribute("height",""+t.height),r.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",t.nodeName==="CANVAS"?t.toDataURL():t.getAttribute("src")),n.appendChild(r),this.__SVGdefs.appendChild(n)):t instanceof Qs&&(n.setAttribute("width",""+t.width),n.setAttribute("height",""+t.height),n.appendChild(t.__rootSVG.childNodes[1]),this.__SVGdefs.appendChild(n)),new zu(n,this)}setLineDash(t){t&&t.length>0?this.lineDash=t.join(","):this.lineDash=null}drawFocusRing(){}createImageData(){}getImageData(){}putImageData(){}globalCompositeOperation(){}setTransform(){}}class Co{canvas;context;customContext;currentPath2D=new Path2D;path2Ds=[];currentMatrix=new DOMMatrix;hasSetCustomStrokeStyle=!1;hasSetCustomFillStyle=!1;constructor(t,e,n,i=!1){this.canvas=t,this.context=t.getContext("2d",{willReadFrequently:!0}),i&&(this.customContext=new Qs({canvas:this.canvas,width:e||this.canvas.width,height:n||this.canvas.height}))}set lineWidth(t){this.hasSetCustomStrokeStyle=!0,this.context.lineWidth=t,this.customContext&&(this.customContext.lineWidth=t)}get lineWidth(){return this.context.lineWidth}set lineCap(t){this.hasSetCustomStrokeStyle=!0,this.context.lineCap=t,this.customContext&&(this.customContext.lineCap=t)}get lineCap(){return this.context.lineCap}set lineJoin(t){this.hasSetCustomStrokeStyle=!0,this.context.lineJoin=t,this.customContext&&(this.customContext.lineCap=t)}get lineJoin(){return this.context.lineJoin}set lineDashOffset(t){this.hasSetCustomStrokeStyle=!0,this.context.lineDashOffset=t,this.customContext&&(this.customContext.lineDashOffset=t)}get lineDashOffset(){return this.context.lineDashOffset}set miterLimit(t){this.hasSetCustomStrokeStyle=!0,this.context.miterLimit=t,this.customContext&&(this.customContext.miterLimit=t)}get miterLimit(){return this.context.miterLimit}set globalAlpha(t){this.context.globalAlpha=t,this.customContext&&(this.customContext.globalAlpha=t)}get globalAlpha(){return this.context.globalAlpha}set fillStyle(t){this.hasSetCustomFillStyle=!0,typeof t=="string"||t instanceof CanvasGradient||t instanceof CanvasPattern?(this.context.fillStyle=t,this.customContext&&(this.customContext.fillStyle=t)):(this.context.fillStyle=t.gradient,this.customContext&&(this.customContext.fillStyle=t.gradientCustom))}get fillStyle(){return this.context.fillStyle}set strokeStyle(t){this.hasSetCustomStrokeStyle=!0,typeof t=="string"||t instanceof CanvasGradient||t instanceof CanvasPattern?(this.context.strokeStyle=t,this.customContext&&(this.customContext.strokeStyle=t)):(this.context.strokeStyle=t.gradient,this.customContext&&(this.customContext.strokeStyle=t.gradientCustom))}get strokeStyle(){return this.context.strokeStyle}set font(t){this.context.font=t,this.customContext&&(this.customContext.font=t)}get font(){return this.context.font}set textBaseline(t){this.context.textBaseline=t,this.customContext&&(this.customContext.textBaseline=t)}get textBaseline(){return this.context.textBaseline}set textAlign(t){this.context.textAlign=t,this.customContext&&(this.customContext.textAlign=t)}get textAlign(){return this.context.textAlign}fill(t){return t?this.context.fill(t):(this.context.fill(),this.customContext&&this.customContext.fill()),this}fillRect(t,e,n,i){return this.context.fillRect(t,e,n,i),this.customContext&&this.customContext.fillRect(t,e,n,i),this}fillText(t,e,n,i){return this.hasSetCustomFillStyle=!1,this.context.fillText(t,e,n,i),this.customContext&&this.customContext.fillText(t,e,n),this}setLineDash(t){return this.context.setLineDash(t),this.customContext&&this.customContext.setLineDash(t),this}stroke(t){return t?this.context.stroke(t):(this.context.stroke(),this.customContext&&this.customContext.stroke()),this}strokeText(t,e,n,i){return this.context.strokeText(t,e,n,i),this.customContext&&this.customContext.strokeText(t,e,n),this}strokeRect(t,e,n,i){return this.context.strokeRect(t,e,n,i),this.customContext&&this.customContext.strokeRect(t,e,n,i),this}measureText(t){return this.context.measureText(t)}clearRect(t=0,e=0,n=this.canvas.width,i=this.canvas.height){return this.context.clearRect(t,e,n,i),this.customContext&&this.customContext.clearRect(t,e,n,i),this}save(){return this.context.save(),this.customContext&&this.customContext.save(),this.currentMatrix=new DOMMatrix,this.path2Ds.push(this.currentPath2D),this.currentPath2D=new Path2D,this}restore(){return this.context.restore(),this.customContext&&this.customContext.restore(),this.hasSetCustomStrokeStyle=!1,this.hasSetCustomFillStyle=!1,this.currentMatrix=new DOMMatrix,this.currentPath2D=this.path2Ds.pop()||new Path2D,this}beginPath(){return this.context.beginPath(),this.customContext&&this.customContext.beginPath(),this}closePath(){return this.context.closePath(),this.customContext&&this.customContext.closePath(),this.currentPath2D.closePath(),this}changePath2D(t=this.currentPath2D,e=this.currentMatrix){const n=new Path2D;n.addPath(t,e),this.currentPath2D=n}isPointInStroke(...t){return t[0]instanceof Path2D?this.context.isPointInStroke(t[0],t[1],t[2]):this.context.isPointInStroke(t[0],t[1])}isPointInPath(...t){return t[0]instanceof Path2D?this.context.isPointInPath(t[0],t[1],t[2]):this.context.isPointInPath(t[0],t[1])}translate(t,e){return this.context.translate(t,e),this.customContext&&this.customContext.translate(t,e),this.currentMatrix.translate(t,e),this.changePath2D(),this}rotate(t,e=0,n=0){return this.translate(e,n),this.context.rotate(t),this.customContext&&this.customContext.rotate(t),this.currentMatrix.rotate(t),this.translate(-e,-n),this.changePath2D(),this}scale(t,e=t,n=0,i=0){return this.translate(n,i),this.context.scale(t,e),this.customContext&&this.customContext.scale(t,e),this.currentMatrix.scale(t,e),this.translate(-n,-i),this.changePath2D(),this}moveTo(t,e){return this.context.moveTo(t,e),this.customContext&&this.customContext.moveTo(t,e),this.currentPath2D.moveTo(t,e),this}lineTo(t,e){return this.context.lineTo(t,e),this.customContext&&this.customContext.lineTo(t,e),this.currentPath2D.lineTo(t,e),this}arc(t,e,n,i,r,o){return this.context.arc(t,e,n,i,r,o),this.customContext&&this.customContext.arc(t,e,n,i,r,o?-1:1),this.currentPath2D.arc(t,e,n,i,r,o),this}arcTo(t,e,n,i,r){return this.context.arcTo(t,e,n,i,r),this.customContext&&this.customContext.arcTo(t,e,n,i,r),this.currentPath2D.arcTo(t,e,n,i,r),this}ellipse(t,e,n,i,r,o,a,h){return this.context.ellipse(t,e,n,i,r,o,a,h),this.currentPath2D.ellipse(t,e,n,i,r,o,a,h),this}quadraticCurveTo(t,e,n,i){return this.context.quadraticCurveTo(t,e,n,i),this.customContext&&this.customContext.quadraticCurveTo(t,e,n,i),this.currentPath2D.quadraticCurveTo(t,e,n,i),this}bezierCurveTo(t,e,n,i,r,o){return this.context.bezierCurveTo(t,e,n,i,r,o),this.customContext&&this.customContext.bezierCurveTo(t,e,n,i,r,o),this.currentPath2D.bezierCurveTo(t,e,n,i,r,o),this}rect(t,e,n,i){return this.context.rect(t,e,n,i),this.customContext&&this.customContext.rect(t,e,n,i),this.currentPath2D.rect(t,e,n,i),this}createLinearGradient(t,e,n,i,r){const o=this.context.createLinearGradient(t,e,n,i);return r&&Object.entries(r).forEach(([a,h])=>{o.addColorStop(parseFloat(a),h)}),o}createRadialGradient(t,e,n,i,r,o,a){const h=this.context.createRadialGradient(t,e,n,i,r,o);return a&&Object.entries(a).forEach(([c,u])=>{h.addColorStop(parseFloat(c),u)}),h}drawImage(t,...e){if(e.length===0)this.context.drawImage(t,0,0);else if(e.length===2){const n=e[0],i=e[1];this.context.drawImage(t,n,i)}else if(e.length===4){const n=e[0],i=e[1],r=e[2],o=e[3];this.context.drawImage(t,n,i,r,o)}else if(e.length===8){const n=e[0],i=e[1],r=e[2],o=e[3],a=e[4],h=e[5],c=e[6],u=e[7];this.context.drawImage(t,n,i,r,o,a,h,c,u)}else throw new Error("Invalid number of arguments passed to drawImage: "+e.length);return this.customContext&&this.customContext.drawImage(t,...e),this}getImageData(t=0,e=0,n=this.canvas.width,i=this.canvas.height,r){return this.context.getImageData(t,e,n,i,r)}putImageData(t,e=0,n=0){return this.context.putImageData(t,e,n)}createPattern(t,e){return this.context.createPattern(t,e)}toRawSVG(){if(this.customContext){const t=this.customContext.getSerializedSvg(!0),e=this.customContext.getSvg();return{raw:t,element:e}}else return{raw:"",element:null}}}const ns={1:705234,2:8108026,3:6346665,4:16630114,5:16607842,6:16158139,7:2542847,8:10640125,9:16735870,10:8978266,11:16580418,12:16754221,13:16725759,14:14436630,15:6844849,16:13744437,17:1817755,18:16744272,19:4964291,20:16750848,d:14540253,aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};class Ft{_color={r:0,g:0,b:0,a:1};constructor(t,e){t&&this.setColor(t),this.setAlpha(e)}get color(){return this._color}set color(t){const e=`Color: Unknown color(${t}) type(${typeof t})`;if(typeof t=="number")this.setHEX(t);else if(typeof t=="string"){let n;if(n=/^(\w+)\(([^)]*)\)/.exec(t)){const i=n[2];let r;switch(n[1]){case"rgb":case"rgba":(r=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(i))?(this.r=parseInt(r[1],10),this.g=parseInt(r[2],10),this.b=parseInt(r[3],10),this.a=r[4]?parseFloat(r[4]):1):(r=/^\s*(\d+)%\s*,\s*(\d+)%\s*,\s*(\d+)%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(i))?(this.r=N(parseFloat(r[1]),0,100)*255/100,this.g=N(parseFloat(r[2]),0,100)*255/100,this.b=N(parseFloat(r[3]),0,100)*255/100,this.a=r[4]?parseFloat(r[4]):1):console.warn(e);break;case"hsl":case"hsla":(r=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)%\s*,\s*(\d*\.?\d+)%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(i))?this.setHSL(parseFloat(r[1])/360,parseFloat(r[2])/100,parseFloat(r[3])/100,r[4]?parseFloat(r[4]):1):console.warn(e);break;case"hsv":case"hsva":case"hsb":case"hsba":(r=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)%\s*,\s*(\d*\.?\d+)%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(i))?this.setHSV(parseFloat(r[1])/360,parseFloat(r[2])/100,parseFloat(r[3])/100,r[4]?parseFloat(r[4]):1):console.warn(e);break;default:console.warn(e)}}else if(n=/#([A-Fa-f0-9]+)/.exec(t)){const i=n[1],r=i.length;r===3?this.setRGB(parseInt(i.charAt(0),16),parseInt(i.charAt(1),16),parseInt(i.charAt(2),16),1):r===6||r===8?this.setHEX(parseInt(i,16)):console.warn(e)}else if(t&&t.length>0)try{this.setColorName(t)}catch{console.warn(e)}else console.warn(e)}else t instanceof Ft?this.setRGB(t.r,t.g,t.b,t.a):Object.prototype.hasOwnProperty.call(t,"r")&&Object.prototype.hasOwnProperty.call(t,"g")&&Object.prototype.hasOwnProperty.call(t,"b")?this.setRGB(t.r,t.g,t.b,Object.prototype.hasOwnProperty.call(t,"a")?t.a:1):Object.prototype.hasOwnProperty.call(t,"h")&&Object.prototype.hasOwnProperty.call(t,"s")&&Object.prototype.hasOwnProperty.call(t,"l")?this.setHSL(t.h,t.s,t.l,Object.prototype.hasOwnProperty.call(t,"a")?t.a:1):Object.prototype.hasOwnProperty.call(t,"h")&&Object.prototype.hasOwnProperty.call(t,"s")&&Object.prototype.hasOwnProperty.call(t,"v")?this.setHSV(t.h,t.s,t.v,Object.prototype.hasOwnProperty.call(t,"a")?t.a:1):Object.prototype.hasOwnProperty.call(t,"h")&&Object.prototype.hasOwnProperty.call(t,"s")&&Object.prototype.hasOwnProperty.call(t,"b")?this.setHSV(t.h,t.s,t.b,Object.prototype.hasOwnProperty.call(t,"a")?t.a:1):console.warn(e)}setColor(t){return this.color=t,this}set(t){return this.setColor(t)}get r(){return this._color.r}set r(t){try{this._color.r=N(Math.round(qt(t)),0,255)}catch{}}get g(){return this._color.g}set g(t){try{this._color.g=N(Math.round(qt(t)),0,255)}catch{}}get b(){return this._color.b}set b(t){try{this._color.b=N(Math.round(qt(t)),0,255)}catch{}}get a(){return this._color.a}set a(t){try{this._color.a=N(qt(t),0,1)}catch{}}setAlpha(t){return this.a=t,this}setFromVector3(t){return this.r=t.x,this.g=t.y,this.b=t.z,this}applyMatrix3(t){const e=this.r,n=this.g,i=this.b,r=t.value;return this.r=r[0]*e+r[3]*n+r[6]*i,this.g=r[1]*e+r[4]*n+r[7]*i,this.b=r[2]*e+r[5]*n+r[8]*i,this}fromBufferAttribute(t,e){return this.r=t.getX(e),this.g=t.getY(e),this.b=t.getZ(e),this}fromArray(t,e=0){return this.r=t[e],this.g=t[e+1],this.b=t[e+2],this.a=t[e+3],this}toArray(t=[],e=0){return t[e]=this.r,t[e+1]=this.g,t[e+2]=this.b,t[e+3]=this.a,t}toRGBString(){return this.a===1?`rgb(${this.r},${this.g},${this.b})`:`rgba(${this.r},${this.g},${this.b},${Z(this.a,6)})`}toHexString(){return this.a===1?("000000"+this.hex.toString(16)).slice(-6):("00000000"+this.hex.toString(16)).slice(-8)}toString(){return this.a===1?"#"+this.toHexString():this.toRGBString()}toColorSpaceString(t=We){Po.fromWorkingColorSpace(we.copy(this),t);const e=we.r,n=we.g,i=we.b;return t!==We?`color(${t} ${e.toFixed(3)} ${n.toFixed(3)} ${i.toFixed(3)})`:this.toRGBString()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b,yield this.a}clone(){return new Ft(this.color)}copy(t){return this.setColor(t.color),this}copySRGBToLinear(t){return this.r=Je(t.r),this.g=Je(t.g),this.b=Je(t.b),this}copyLinearToSRGB(t){return this.r=Ze(t.r),this.g=Ze(t.g),this.b=Ze(t.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}equals(t){return t.r===this.r&&t.g===this.g&&t.b===this.b&&t.a===this.a}add(t){return this.r=this.r+t.r,this.g=this.g+t.g,this.b=this.b+t.b,this}addColors(t,e){return this.r=t.r+e.r,this.g=t.g+e.g,this.b=t.b+e.b,this}addScalar(t){return this.r=this.r+t,this.g=this.g+t,this.b=this.b+t,this}setScalar(t){return this.r=t,this.g=t,this.b=t,this}sub(t){return this.r=this.r-t.r,this.g=this.g-t.g,this.b=this.b-t.b,this}multiply(t){return this.r=this.r*t.r,this.g=this.g*t.g,this.b=this.b*t.b,this}multiplyScalar(t){return this.r=this.r*t,this.g=this.g*t,this.b=this.b*t,this}opposite(t=!0,e="#000000",n="#ffffff"){if(t)return this.setColor(this.r*.299+this.g*.587+this.b*.114>186?e:n);{const{r:i,g:r,b:o}=this.color;return this.r=255-i,this.g=255-r,this.b=255-o,this}}lighten(t){t=N(t,0,1);const{r:e,g:n,b:i}=this.color;return this.r=e+(255-e)*t,this.g=n+(255-n)*t,this.b=i+(255-i)*t,this}darken(t){t=N(t,0,1);const{r:e,g:n,b:i}=this.color;return this.r=e*(1-t),this.g=n*(1-t),this.b=i*(1-t),this}lerp(t,e){e=N(e,0,1);const{r:n,g:i,b:r}=this.color;return this.r=n+(t.r-n)*e,this.g=i+(t.g-i)*e,this.b=r+(t.b-r)*e,this}lerpColors(t,e,n){return n=N(n,0,1),this.r=t.r+(e.r-t.r)*n,this.g=t.g+(e.g-t.g)*n,this.b=t.b+(e.b-t.b)*n,this}static gradient(t,e,n){try{return we.lerpColors(new Ft(t),new Ft(e),n).toString()}catch{return e}}static random(){return we.setHEX(Math.random()*16777215).toString()}static nextIndex=0;static next(t=Ft.nextIndex){Ft.nextIndex=t;const e=Object.keys(ns),n=e.length;return we.setHEX(ns[e[Ft.nextIndex++%n]]).toString()}setColorName(t){const e=ns[t.toLowerCase()];return e!==void 0?this.setHEX(e):t==="none"?this.a=0:(this.a=1,console.warn("Color.setColorName: Unknown color "+t)),this}static getColors(){return Object.values(ns).map(t=>we.setHEX(t).toString())}setRGB(t,e,n,i=1){return this.r=t,this.g=e,this.b=n,this.a=i,this}get rgb(){return{r:this.r,g:this.g,b:this.b,a:this.a}}setHEX(t){return t=Math.floor(t),t<16777216?(this.r=t>>16&255,this.g=t>>8&255,this.b=t&255,this.a=1):(this.r=t>>24&255,this.g=t>>16&255,this.b=t>>8&255,this.a=(t&255)/255),this}get hex(){let t=(this.r<<16)+(this.g<<8)+this.b;return this.a!==1&&(t=t<<8,t+=Math.round(this.a*255)),t}setHSL(t,e,n,i=1){const r=tf(t,1),o=N(e,0,1),a=N(n,0,1);if(o===0)this.r=a*255,this.g=a*255,this.b=a*255;else{const h=a<=.5?a*(1+o):a+o-a*o,c=2*a-h;this.r=Mo(c,h,r+.3333333333333333)*255,this.g=Mo(c,h,r)*255,this.b=Mo(c,h,r-.3333333333333333)*255}return this.a=i,this}getHSL(t){const e=this.r,n=this.g,i=this.b,r=Math.max(e,n,i)/255,o=Math.min(e,n,i)/255;let a,h;const c=(o+r)/2;if(o===r)a=0,h=0;else{const u=r-o;switch(h=c<=.5?u/(r+o):u/(2-r-o),r){case e:a=(n-i)/u+(n<i?6:0);break;case n:a=(i-e)/u+2;break;case i:default:a=(e-n)/u+4;break}a/=6}return t&&t.setHSL(a,h,c,this.a),{h:a,s:h,l:c,a:this.a}}offsetHSL(t,e,n){const i=this.getHSL();return this.setHSL(i.h+t,i.s+e,i.l+n)}lerpHSL(t,e){const n=this.getHSL(),i=t.getHSL(),r=fs(n.h,i.h,e),o=fs(n.s,i.s,e),a=fs(n.l,i.l,e);return this.setHSL(r,o,a),this}setHSV(t,e,n,i=1){const r=N(t,0,1)*360,o=N(e,0,1),a=N(n,0,1),h=Math.floor(r/60)%6,c=r/60-Math.floor(r/60),u=a*(1-o),l=a*(1-c*o),m=a*(1-(1-c)*o),f=[[a,m,u],[l,a,u],[u,a,m],[u,l,a],[m,u,a],[a,u,l]][h];return this.r=f[0]*255,this.g=f[1]*255,this.b=f[2]*255,this.a=i,this}setHSB(t,e,n,i=1){this.setHSV(t,e,n,i)}getHSV(t){const{r:e,g:n,b:i,a:r}=this.color,o=Math.max(e,n,i),a=Math.min(e,n,i),h=o-a;let c;e===o?c=(n-i)/h:n===o?c=2+(i-e)/h:c=4+(e-n)/h,c/=6,c<0&&(c+=1);const u=h==0?0:c,l=o===0?0:h/o,m=o/255;return t&&t.setHSV(u,l,m,r),{h:u,s:l,v:m,a:r}}getHSB(t){const{h:e,s:n,v:i,a:r}=this.getHSV(t);return{h:e,s:n,b:i,a:r}}}const we=new Ft,Nu="",We="srgb",To="srgb-linear",Eo="linear",Ks="srgb";function Je(s){return s<.04045?s*.0773993808:Math.pow(s*.9478672986+.0521327014,2.4)}function Ze(s){return s<.0031308?s*12.92:1.055*Math.pow(s,.41666)-.055}const Bu=new gn().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),Fu=new gn().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715),Yu=[.64,.33,.3,.6,.15,.06],$u=[.2126,.7152,.0722],Xu=[.3127,.329],Po={enabled:!0,workingColorSpace:To,spaces:{},convert:function(s,t,e){return this.enabled===!1||t===e||!t||!e||(this.spaces[t].transfer===Ks&&(s.r=Je(s.r),s.g=Je(s.g),s.b=Je(s.b)),this.spaces[t].primaries!==this.spaces[e].primaries&&(s.applyMatrix3(this.spaces[t].toXYZ),s.applyMatrix3(this.spaces[e].fromXYZ)),this.spaces[e].transfer===Ks&&(s.r=Ze(s.r),s.g=Ze(s.g),s.b=Ze(s.b))),s},fromWorkingColorSpace:function(s,t){return this.convert(s,this.workingColorSpace,t)},toWorkingColorSpace:function(s,t){return this.convert(s,t,this.workingColorSpace)},getPrimaries:function(s){return this.spaces[s].primaries},getTransfer:function(s){return s===Nu?Eo:this.spaces[s].transfer},getLuminanceCoefficients:function(s,t=this.workingColorSpace){return s.fromArray(this.spaces[t].luminanceCoefficients)},define:function(s){Object.assign(this.spaces,s)},_getMatrix:function(s,t,e){return s.copy(this.spaces[t].toXYZ).multiply(this.spaces[e].fromXYZ)},_getDrawingBufferColorSpace:function(s){return this.spaces[s].outputColorSpaceConfig.drawingBufferColorSpace},_getUnpackColorSpace:function(s=this.workingColorSpace){return this.spaces[s].workingColorSpaceConfig.unpackColorSpace}};Po.define({[To]:{primaries:Yu,whitePoint:Xu,transfer:Eo,toXYZ:Bu,fromXYZ:Fu,luminanceCoefficients:$u,workingColorSpaceConfig:{unpackColorSpace:We},outputColorSpaceConfig:{drawingBufferColorSpace:We}},[We]:{primaries:Yu,whitePoint:Xu,transfer:Ks,toXYZ:Bu,fromXYZ:Fu,luminanceCoefficients:$u,outputColorSpaceConfig:{drawingBufferColorSpace:We}}});function Mo(s,t,e){return e<0&&(e+=1),e>1&&(e-=1),e<.16666666666666666?s+(t-s)*6*e:e<.5?t:e<.6666666666666666?s+(t-s)*6*(.6666666666666666-e):s}class ot{id;d;parent;attrs;_centerX;_centerY;_x;_y;_degree;_scaleX;_scaleY;vx;vy;ax;ay;mass;show;followMouse;drag;transform$=new mn;isMouseIn=!1;isDragging=!1;el;constructor(t){this.id=on(),this.d=t?.d,this.attrs={stroke:"none",fill:"none"},t?.attrs&&this.setAttr(t?.attrs),this._centerX=t?.centerX,this._centerY=t?.centerY,this._x=t?.x||0,this._y=t?.y||0,this._degree=t?.degree||0,this._scaleX=1,this._scaleY=1,t?.scale!==void 0&&(this._scaleX=t.scale,this._scaleY=t.scale),t?.scaleX!==void 0&&(this._scaleX=t.scaleX),t?.scaleY!==void 0&&(this._scaleY=t.scaleY),this.vx=t?.vx||0,this.vy=t?.vy||0,this.ax=t?.ax||0,this.ay=t?.ay||0,this.mass=t?.mass||1,this.show=typeof t?.show=="boolean"?t?.show:!0,this.followMouse=typeof t?.followMouse=="boolean"?t?.followMouse:!1,this.drag=t?.drag}destroy(){}moveTo(t,e){const n=this._x,i=this._y;(n!==t||i!==e)&&(this._x=t,this._y=e,this.transform$.next({dx:t-n,dy:e-i}))}move(t,e=0){this.moveTo(this._x+t,this._y+e)}moveXTo(t){this.moveTo(t,this._y)}moveX(t){this.moveTo(this._x+t,this._y)}moveYTo(t){this.moveTo(this._x,t)}moveY(t){this.moveTo(this._x,this._y+t)}get x(){return this._x}set x(t){this._x=t}get y(){return this._y}set y(t){this._y=t}rotateTo(t){this._degree=t}rotate(t){this.rotateTo(this._degree+t)}get degree(){return this._degree}set degree(t){this._degree=t}scaleTo(t,e){this._scaleX=t,this._scaleY=e||t}scale(t,e){this.scaleTo(this._scaleX*t,this._scaleY*(e||t))}get scaleX(){return this._scaleX}set scaleX(t){this._scaleX=t}get scaleY(){return this._scaleY}set scaleY(t){this._scaleY=t}pathD(){return this.d?(this.d instanceof St||(this.d=new St(this.d)),this.d):new St(this.toSVGPathData())}forcePathD(t){this.d=t}getBaseOptions(){return{d:this.d,attrs:this.getAttrs(),centerX:this._centerX,centerY:this._centerY,x:this._x,y:this._y,degree:this._degree,scaleX:this._scaleX,scaleY:this._scaleY,vx:this.vx,vy:this.vy,ax:this.ax,ay:this.ay,mass:this.mass,followMouse:this.followMouse,drag:this.drag}}clone(){const t=this.cloneShape();return this.parent&&(t.parent={...this.parent}),t}cloneShape(){return new ot(this.getBaseOptions())}toSVGPathData(){return[]}toSVGPathD(){return this.pathD().toSVGPathD()}toCanvasContext(t){this.pathD().toCanvasContext(t)}getBoundingClientRect(t=2){return this.pathD().getBoundingClientRect(t)}getBoundingClientRectCenter(t=2){return this.pathD().getBoundingClientRectCenter(t)}transformOrigin(t=!1,e=2){let n=this._centerX||0,i=this._centerY||0;if(typeof this._centerX>"u"&&typeof this._centerY>"u"){const r=this.getBoundingClientRectCenter(e);if(t||!this.parent)n=r.x,i=r.y;else{const o=this.parent.combo.getBoundingClientRectCenter(e);n=o.x-this.parent.dx,i=o.y-this.parent.dy}}return{x:n,y:i}}isPointInPath(t,e,n){if(t instanceof Co)return t.isPointInPath(new Path2D(this.toSVGPathD()),e,n);if(this.el instanceof SVGGeometryElement){const i=this.el.getCTM();if(i){const r=i.inverse();return this.el.isPointInFill({x:r.a*e+r.c*n+r.e,y:r.b*e+r.d*n+r.f})}}return!1}isPointInStroke(t,e,n){if(t instanceof Co)return t.isPointInStroke(new Path2D(this.toSVGPathD()),e,n);if(this.el instanceof SVGGeometryElement){const i=this.el.getCTM();if(i){const r=i.inverse();return this.el.isPointInStroke({x:r.a*e+r.c*n+r.e,y:r.b*e+r.d*n+r.f})}}return!1}setAttr(t,e){if(typeof t!="string")for(const n in t){const i=t[n];i&&(this.attrs[xt(n)]=i)}else e&&(this.attrs[xt(t)]=e)}getAttr(t,e){return this.attrs[t]||this.attrs[xt(t)]||e}hasAttr(t){return!!this.getAttr(t)}getAttrs(){return{...this.attrs}}animate(t){this.vx+=this.ax,this.vy+=this.ay;const e=t?.gravity||0;this.vy+=e;const n=t?.friction||1;this.vx*=n,this.vy*=n,this.moveTo(this.x+this.vx,this.y+this.vy)}animateEaseTo(t,e){const n=e?.easing||.05,i=t.x-this.x,r=t.y-this.y;this.vx=i*n,this.vy=r*n,this.animate(e)}animateSpringTo(t,e){const n=e?.spring||.03;(Array.isArray(t)?t:[t]).forEach(i=>{const r=i.x-this.x,o=i.y-this.y,a=r*n,h=o*n;this.vx+=a,this.vy+=h}),this.animate({friction:.9,...e})}animateSpringMassTo(t,e){const n=e?.springLength||100,i=e?.spring||1e-4,r=t.x-this.x,o=t.y-this.y,a=Math.sqrt(r*r+o*o);if(a<n){const h=r*i,c=o*i;return this.vx+=h/this.mass,this.vy+=c/this.mass,t.vx-=h/t.mass,t.vy-=c/t.mass,1-a/n}return 0}distance(t){return Me(this.x,this.y,t.x,t.y)}rotateToTarget(t){this.rotateTo(Et(Jt(this.x,this.y,t.x,t.y)))}followTo(t,e=3){this.rotateToTarget(t);const{dx:n,dy:i}=Ae(q(this.degree),e);this.vx=n,this.vy=i,this.animate()}followAccelerationTo(t,e=.05){this.rotateToTarget(t);const{dx:n,dy:i}=Ae(q(this.degree),e);this.ax=n,this.ay=i,this.animate()}gravitateTo(t){const e=t.x-this.x,n=t.y-this.y,i=e*e+n*n,r=Math.sqrt(i),o=this.mass*t.mass/i,a=o*e/r,h=o*n/r;this.vx+=a/this.mass,this.vy+=h/this.mass,t.vx-=a/t.mass,t.vy-=h/t.mass}checkCollision(t){}checkWall(t){}getTotalLength(){return this.pathD().getTotalLength()}interpolate(t){return this.pathD().interpolate(t)}getPointAtLength(t){return this.pathD().getPointAtLength(t)}trailPath(t=0){const e=this.getTotalLength();return{subPathD:this.pathD().getSubPathD(0,t*e),point:this.getPointAtLength(t*e)}}strokeDashTween(t=1e3,e){const n=Z(this.pathD().getTotalLength(),0);this.setAttr({strokeDasharray:`${n} ${n}`,strokeDashoffset:`${n}`});const i=e?.onUpdate,r=new Fn({frameDuration:t});r.addTween({offset:n},{offset:0},Object.assign(e||{},{onUpdate:(o,a)=>{this.setAttr("strokeDashoffset",""+Z(o.offset,2)),i?.(o,a)}})),r.play()}}class Lt{options;commonChildShapeOptions;shapes=[];x=0;y=0;degree=0;scaleX=1;scaleY=1;constructor(t,e){if(this.options=t,this.commonChildShapeOptions=e,t?.svg){let n=0,i=0,r=0,o=0;const a=new X1(t.svg).parse();for(let h=0,c=a.length;h<c;h++){const u=a[h];if(u.type=="viewbox"&&u.width&&u.height){if(n=parseFloat(u.width),i=parseFloat(u.height),t.forceWidth){const y=n/i;r=t.forceWidth,o=r/y}else r=n,o=i;continue}if(u.type!="path"||!ku(u.path))continue;const l={};for(const y in u)y==="type"||y==="path"||y==="transform"||(l[y]=u[y]);const m=Du(Iu(u.path)),f=[];let p=[];for(let y=0,v=m.length;y<v;y++){const w=m[y];p.push(w),w[0].toLowerCase()=="z"&&(f.push(p),p=[])}p.length&&f.push(p),f.forEach(y=>{const v=new ot({...e,d:y,attrs:{...e?.attrs,...l}});if(u.transform){const _=Ur(u.transform).split();v.moveTo(_.x,_.y),v.rotateTo(_.degree),v.scaleTo(_.scaleX,_.scaleY)}r&&n&&o&&i&&v.scaleTo(v.scaleX*(r/n),v.scaleY*(o/i)),this.addShape(v)})}}}destroy(){this.shapes.forEach(t=>t.destroy())}clone(){const t=this.cloneShapeCombo();return t.x=this.x,t.y=this.y,t.degree=this.degree,t.scaleX=this.scaleX,t.scaleY=this.scaleY,t.shapes=this.shapes.map(e=>{const n=e.clone();return n.parent&&(n.parent.combo=t),n}),t}cloneShapeCombo(){return new Lt(this.options,this.commonChildShapeOptions)}addShape(t,e=0,n=0){t.parent={combo:this,dx:e||t.x,dy:n||t.y},this.shapes.push(t)}comboMove(t,e){this.x+=t,this.y+=e,this.shapes.forEach(n=>{n.move(t,e)})}comboRotate(t){this.degree+=t,this.shapes.forEach(e=>{e.rotate(t)})}comboScale(t,e){this.scaleX*=t,this.scaleY*=e||t,this.shapes.forEach(n=>{n.scale(t,e)})}comboTransform(t){(typeof t?.x=="number"||typeof t?.y=="number")&&this.comboMove(t?.x||0,t?.y||0),typeof t?.degree=="number"&&this.comboRotate(t?.degree||0),(typeof t?.scale=="number"||typeof t?.scaleX=="number"||typeof t?.scaleY=="number")&&this.comboScale(t?.scaleX||t?.scale||1,t?.scaleY||t?.scale||1)}getBoundingClientRect(t=2){const e=[],n=[];if(this.shapes.forEach(h=>{const c=h.getBoundingClientRect(t);e.push(c.x,c.x+c.width),n.push(c.y,c.y+c.height)}),e.length==0||n.length==0)return{x:0,y:0,width:0,height:0,center:{x:0,y:0}};const i=Math.min(...e),r=Math.min(...n),o=Math.max(...e),a=Math.max(...n);return{x:Z(i,t),y:Z(r,t),width:Z(o-i,t),height:Z(a-r,t)}}getBoundingClientRectCenter(t=2){const e=this.getBoundingClientRect(t);return{x:Z(e.x+e.width*.5,t),y:Z(e.y+e.height*.5,t)}}setAttr(t,e){typeof t!="string"?this.shapes.forEach(n=>{n.setAttr(t)}):e&&this.shapes.forEach(n=>{n.setAttr(t,e)})}sort(){this.shapes=this.shapes.map(t=>({shape:t,perimeter:t.pathD().getPolymorphPointsPerimeter()})).sort((t,e)=>e.perimeter-t.perimeter).map(t=>t.shape)}expendTo(t){const e=t.shapes.length,n=this.shapes.length;if(e<n)return t.expendTo(this);for(let i=n;i<e;i++)this.addShape(t.shapes[i].clone())}strokeDashTween(t,e){const n=this.shapes.length-1;switch(e?.type){case"sequence":this.shapes.forEach((a,h)=>{a.strokeDashTween(t,{...e,delay:h,onStart:()=>{h==0&&e?.onGroupStart?.()},onUpdate:()=>{e?.onGroupUpdate?.()},onComplete:()=>{h==n&&e?.onGroupComplete?.()}})});break;case"parallel":default:const i=new Fn({frameDuration:t}),r={},o={};this.shapes.forEach((a,h)=>{const c=Z(a.getTotalLength(),0);r[`offset_${h}`]=c,o[`offset_${h}`]=0,a.setAttr({strokeDasharray:`${c} ${c}`,strokeDashoffset:`${c}`})}),i.addTween(r,o,Object.assign(e||{},{onStart:()=>{e?.onGroupStart?.()},onUpdate:(a,h)=>{for(const c in a){const u=rf(c).number;this.shapes[u].setAttr("strokeDashoffset",""+Z(a[c],2))}e?.onGroupUpdate?.()},onComplete:()=>{e?.onGroupComplete?.()}})),i.play();break}}}function q1(s,t){s.forEach(n=>{n.animate(),t?.wall&&n.checkWall({wall:t.wall,bounce:t.bounce})});const e=s.length;for(let n=0,i=e-1;n<i;n++)for(let r=n+1;r<e;r++)s[n].checkCollision(s[r])}function j1(s){const t=s.length;s.forEach((e,n)=>{e.animate();for(let i=n+1;i<t;i++)e.checkCollision(s[i]),e.gravitateTo(s[i])})}function H1(s,t){s.forEach((e,n)=>{n>0&&e.animateSpringTo(s[n-1],t)})}function W1(s,t){const e=t?.springLength||100;s.forEach(n=>{n.isDragging||s.filter(i=>i.id!==n.id).forEach(i=>{const r=Jt(n.x,n.y,i.x,i.y);n.animateSpringTo({x:i.x-Math.cos(r)*e,y:i.y-Math.sin(r)*e},t)})})}function J1(s,t,e){const n=s.length,i=[];return s.forEach((r,o)=>{r.animate(e),r.x>t.x+t.width?r.moveXTo(t.x):r.x<t.x&&r.moveXTo(t.x+t.width),r.y>t.y+t.height?r.moveYTo(t.y):r.y<t.y&&r.moveYTo(t.y+t.height);for(let a=o+1;a<n;a++)i.push([r.x,r.y,s[a].x,s[a].y,r.animateSpringMassTo(s[a],e)])}),i}function Ao(s){if(s.length<2)throw new Error("shapes个数必须大于等于2");const t=s.length-1,e=new Array(t);for(let n=0;n<t;n++){const i=s[n].pathD(),r=s[n+1].pathD(),o=Math.max(i.getPolymorphPoints().length,r.getPolymorphPoints().length);e[n]=St.getInterpolator(i.getExpendedPolymorphPointsPathD(o),r.getExpendedPolymorphPointsPathD(o))}return n=>{const i=Z(t*n,6),r=Math.min(Math.floor(i),t-1),o=Z(i-r,6),a=new ot({d:e[r](o)}),h=s[r].getAttr("fill","none"),c=s[r+1].getAttr("fill","none");typeof h=="string"&&typeof c=="string"&&a.setAttr("fill",Ft.gradient(h,c,o).toString());const u=s[r].getAttr("stroke","none"),l=s[r+1].getAttr("stroke","none");return typeof u=="string"&&typeof l=="string"&&a.setAttr("stroke",Ft.gradient(u,l,o).toString()),a}}function Uu(s){if(s.length<2)throw new Error("shapeCombos个数必须大于等于2");let t=0,e;const n=[];s.forEach(o=>{let a;o instanceof Lt?(a=o,a.sort()):(a=new Lt,a.addShape(o)),n.push(a),t<a.shapes.length&&(t=a.shapes.length,e=a)}),n.forEach(o=>{o!==e&&o.expendTo(e)});const i=[];n.forEach((o,a)=>{o.shapes.forEach((h,c)=>{i[c]=i[c]||[],i[c][a]=h})});const r=[];return i.forEach(o=>{r.push(Ao(o))}),o=>{const a=new Lt;return r.forEach(h=>{a.addShape(h(o))}),a}}function Z1(s,t=6e3,e){const n=s.findIndex(a=>a instanceof Lt)>=0?Uu(s):Ao(s),i=n(0),r=e?.onUpdate,o=new Fn({frameDuration:t});o.addTween({t:0},{t:1},Object.assign(e||{},{onUpdate:(a,h)=>{n(a.t),r?.(a,h),i instanceof ot?e?.shape?.(i):i instanceof Lt&&i.shapes.forEach(c=>{e?.shape?.(c)})}})),o.play()}function Q1(s,t,e,n,i){if(i==0)throw new Error("no dividing by zero, please");const r=[],o=360/i;for(let h=0;h<i;h+=1){const c=o*h*Math.PI/180,u=s+2*e*Math.cos(c),l=t+2*e*Math.sin(c);r.push(new po({x:s,y:t,rx:e,ry:n,xAxisRotate:o*h,largeArcFlag:1,sweepFlag:1,toX:u,toY:l})),r.push(new po({x:u,y:l,rx:e,ry:n,xAxisRotate:o*h,largeArcFlag:1,sweepFlag:1,toX:s,toY:t}))}return new ot({d:St.fromLines(r)})}class K1{PARENT_EL;SVG_EL=null;CANVAS_EL=null;ctx=null;rect={x:0,y:0,width:0,height:0};size$=new Lm(null);resizeSubscription;mpg=He();mouseSubscription;shapes=[];lastMouseInShapeId="";draggingShapeId="";prevCursor="default";constructor(t=document.documentElement,e="canvas",n=!1){this.PARENT_EL=t,(e=="svg"||e=="canvas")&&Wc(this.PARENT_EL),e=="svg"&&(this.SVG_EL=Au("svg"),Jn(this.PARENT_EL,this.SVG_EL)),e=="canvas"&&(this.CANVAS_EL=Kc("canvas"),Jn(this.PARENT_EL,this.CANVAS_EL)),this.resizeSubscription=fo(this.PARENT_EL).subscribe(i=>{this.rect.x=i.x,this.rect.y=i.y,this.rect.width=i.width,this.rect.height=i.height,this.SVG_EL&&je(this.SVG_EL,{viewBox:`0 0 ${this.rect.width} ${this.rect.height}`,width:`${this.rect.width}`,height:`${this.rect.height}`}),this.CANVAS_EL&&(je(this.CANVAS_EL,{width:`${this.rect.width}`,height:`${this.rect.height}`}),this.ctx=new Co(this.CANVAS_EL,this.rect.width,this.rect.height,n)),this.size$.next(i)}),this.mouseSubscription=yu(this.SVG_EL||this.CANVAS_EL||this.PARENT_EL,{useMousePoint:this.mpg}).subscribe(()=>{})}destroy(){this.resizeSubscription.unsubscribe(),this.mouseSubscription.unsubscribe()}setCursor(t="default"){t!=this.prevCursor&&(this.PARENT_EL.style.cursor=t,this.prevCursor=t)}animateShape(t){t.followMouse&&(!va(t.x,this.mpg.current.x,5)||!va(t.y,this.mpg.current.y,5))&&t.followTo(this.mpg.current),t.drag&&t.drag.enable&&t.drag.targetToAfterDrop&&(t.isDragging||t.animateEaseTo(t.drag.targetToAfterDrop,{easing:t.drag.easing}))}draw(...t){const e=[];t.forEach(n=>{n instanceof Lt?e.push(...n.shapes):e.push(n)}),this.SVG_EL&&this.shapes.filter(n=>e.findIndex(i=>i.id==n.id)==-1).forEach(n=>{n.el&&(n.el.remove(),delete n.el)}),this.ctx&&this.ctx.clearRect(),Ql(this.shapes,e),this.lastMouseInShapeId="",this.mpg.current.isDown||(this.draggingShapeId="");for(const n of this.shapes){if(!n.show)continue;this.animateShape(n);const i=n.transformOrigin(),r=i.x,o=i.y;if(this.SVG_EL){const a=n.toSVGPathD();n.el||(n.el=B1(a,n.id),Jn(this.SVG_EL,n.el));const h=new _t;h.translate(n.x,n.y),h.rotate(n.degree,r,o),h.scale(n.scaleX,n.scaleY,r,o),je(n.el,{d:a,transform:h.toString(),...n.getAttrs()})}if(this.ctx&&(this.ctx.save(),this.ctx.translate(n.x,n.y),this.ctx.rotate(q(n.degree),r,o),this.ctx.scale(n.scaleX,n.scaleY,r,o),n.toCanvasContext(this.ctx),Sc(this.ctx,n.getAttrs()),this.ctx.hasSetCustomStrokeStyle&&this.ctx.stroke(),this.ctx.hasSetCustomFillStyle&&this.ctx.fill()),this.SVG_EL?n.isMouseIn=n.isPointInPath(this.SVG_EL,this.mpg.current.x,this.mpg.current.y)||n.isPointInStroke(this.SVG_EL,this.mpg.current.x,this.mpg.current.y):this.ctx?n.isMouseIn=n.isPointInPath(this.ctx,this.mpg.current.x,this.mpg.current.y)||n.isPointInStroke(this.ctx,this.mpg.current.x,this.mpg.current.y):n.isMouseIn=!1,n.isMouseIn&&(this.setCursor("pointer"),this.lastMouseInShapeId=n.id),n.isDragging=n.id==this.draggingShapeId,this.mpg.current.isDown&&(n.isDragging||!this.draggingShapeId&&n.isMouseIn&&n.drag&&n.drag.enable)){this.setCursor("grabbing"),n.isDragging=!0,this.draggingShapeId=n.id;let a=this.mpg.current.x-this.mpg.start.x,h=this.mpg.current.y-this.mpg.start.y;if(a||h){if(n.drag&&n.drag.enable&&n.drag.alongPath){const c=n.parent?n.parent.combo.x:n.x,u=n.parent?n.parent.combo.y:n.y,l=r+(n.parent?.dx||0),m=o+(n.parent?.dy||0),f=n.parent?n.parent.combo.degree:n.degree,p=n.parent?n.parent.combo.scaleX:n.scaleX,y=n.parent?n.parent.combo.scaleY:n.scaleY,w=n.drag.alongPath.transform(c,u,l,m,f,p,y).closestPoint(this.mpg.current.x,this.mpg.current.y),_=n.x,x=n.y;a=w.point.x-_,h=w.point.y-x}(a||h)&&(n.move(a,h),n.parent?.combo.shapes.forEach(c=>{c.drag?.followSibling&&c!==n&&c.move(a,h)}))}this.mpg.setStart(this.mpg.current)}else n.isMouseIn&&n.drag&&n.drag.enable&&this.setCursor("grab");this.ctx&&this.ctx.restore()}!this.lastMouseInShapeId&&!this.draggingShapeId&&this.setCursor("default")}drawMouseMoveLine(t){const e=t?.brushSize||4,n=t?.brushColor||"#000000";let i=!1;const r=Ws(this.SVG_EL||this.CANVAS_EL||this.PARENT_EL,{start:()=>{i=!1,this.ctx&&(this.ctx.save(),this.ctx.lineWidth=e,this.ctx.strokeStyle=n,this.ctx.beginPath())},end:()=>{this.ctx&&this.ctx.restore()}}).subscribe(o=>{this.ctx&&(i?this.ctx.lineTo(o.current.x,o.current.y):(i=!0,this.ctx.moveTo(o.current.x,o.current.y)),this.ctx.stroke())});return()=>{r.unsubscribe()}}drawMouseMoveBrush(t){const e=t?.brushSize||10,n=t?.brushDensity||50,i=t?.brushColor||"#000000",r=new Ft(i),o=r.r,a=r.g,h=r.b,c=Ws(this.SVG_EL||this.CANVAS_EL||this.PARENT_EL).subscribe(u=>{if(this.ctx){const l=this.ctx.getImageData(0,0,this.ctx.canvas.width,this.ctx.canvas.height),m=l.data;for(let f=0;f<n;f++){const p=Math.random()*Math.PI*2,y=Math.random()*e,v=u.current.x+Math.cos(p)*y|0,w=u.current.y+Math.sin(p)*y|0,_=(v+w*l.width)*4;m[_]=o,m[_+1]=a,m[_+2]=h,m[_+3]=255}this.ctx.putImageData(l)}});return()=>{c.unsubscribe()}}downloadSVG=()=>{this.SVG_EL&&F1(this.SVG_EL)}}class Qe extends ot{dx;dy;startColor;endColor;constructor(t){if(super(t),t?.lineLength){const e=Ae(q(t?.lineDegree||0),t.lineLength);this.dx=e.dx,this.dy=e.dy}else t?.lineDx||t?.lineDy?(this.dx=t?.lineDx||0,this.dy=t?.lineDy||0):(this.dx=0,this.dy=0);this.startColor=t?.startColor,this.endColor=t?.endColor,this.setAttr({stroke:this.startColor||"#000000"})}cloneShape(){return new Qe({...super.getBaseOptions(),lineDx:this.dx,lineDy:this.dy})}enableGradient(t,e){this.startColor=t,this.endColor=e,this.setAttr({stroke:this.startColor})}disableGradient(t){this.startColor=t,this.endColor=void 0,this.setAttr({stroke:this.startColor})}toSVGPathData(){return[["m",0,0],["l",this.dx,this.dy]]}toCanvasContext(t){this.startColor&&this.endColor&&this.setAttr({stroke:t.createLinearGradient(0,0,this.dx,this.dy,{0:this.startColor,1:this.endColor})}),t.beginPath(),t.moveTo(0,0),t.lineTo(this.dx,this.dy)}lineToAbsolutePoint(t){this.dx=t.x-this.x,this.dy=t.y-this.y}intersection(t){const e=this.transformOrigin(),i=this.pathD().transform(this.x,this.y,e.x,e.y,this.degree,this.scaleX,this.scaleY).normalizedLines[0],r=t.transformOrigin(),a=t.pathD().transform(this.x,this.y,r.x,r.y,t.degree,t.scaleX,t.scaleY).normalizedLines[0];return i.intersection(a)}}class ko extends Lt{constructor(t,e){super(t,e);const n=new Qe({...e,drag:{...e?.drag,followSibling:!0},lineLength:100,lineDegree:90});this.addShape(n);const i=new Qe({...e,drag:{...e?.drag,followSibling:!0},y:10+Math.random()*30,lineLength:10+Math.random()*30,lineDegree:Math.random()*120-150});this.addShape(i);const r=new Qe({...e,drag:{...e?.drag,followSibling:!0},y:10+Math.random()*30,lineLength:10+Math.random()*30,lineDegree:Math.random()*120-150});this.addShape(r)}cloneShapeCombo(){return new ko(this.options,this.commonChildShapeOptions)}}class bn extends ot{radius;constructor(t){super(t),this.radius=t?.ballRadius||0}cloneShape(){return new bn({...super.getBaseOptions(),ballRadius:this.radius})}getBoundingClientRect(){return{x:-this.radius,y:-this.radius,width:this.radius*2,height:this.radius*2}}toSVGPathData(){return this.radius?[["m",0,-this.radius],["a",this.radius,this.radius,0,1,1,0,2*this.radius],["a",this.radius,this.radius,0,1,1,0,-2*this.radius],["z"]]:[["m",0,0]]}toCanvasContext(t){t.beginPath(),t.arc(0,0,this.radius,0,Math.PI*2,!0),t.closePath()}eq(t){return this.x===t.x&&this.y===t.y&&this.radius===t.radius&&this.mass===t.mass}midPointBtw(t){return{x:this.x+(t.x-this.x)/2,y:this.y+(t.y-this.y)/2}}length(){return pn(this.x,this.y)}scalar(t){return this.moveTo(this.x*t,this.y*t),this}normalize(t=1){const e=this.length();if(e){const n=t/e;this.scalar(n)}return this}clamp(t){const e=this.length();return e&&e>t&&this.scalar(t/e),this}cross(t){const e=this.x,n=this.y;return{x:n*t.x-e*t.y,y:e*t.y-n*t.x}}multiply(t){return{x:this.x*t.x,y:this.y*t.y}}div(t){return{x:this.x/t.x,y:this.y/t.y}}add(t){return{x:this.x+t.x,y:this.y+t.y}}sub(t){return{x:this.x-t.x,y:this.y-t.y}}dot(t){return this.x*t.x+this.y*t.y}reflect(t){const e=this.dot(t);return{x:this.x-2*e*t.x,y:this.y-2*e*t.y}}checkCollision(t){const e=t.x-this.x,n=t.y-this.y;if(Math.sqrt(e*e+n*n)<this.radius+t.radius){const r=Math.atan2(n,e),o={x:0,y:0},a=Qt(-r,e,n),h=Qt(-r,this.vx,this.vy),c=Qt(-r,t.vx,t.vy),u=h.x-c.x;h.x=((this.mass-t.mass)*h.x+2*t.mass*c.x)/(this.mass+t.mass),c.x=u+h.x;const l=Math.abs(h.x)+Math.abs(c.x),m=this.radius+t.radius-Math.abs(o.x-a.x);o.x+=h.x/l*m,a.x+=c.x/l*m;const f=Qt(r,o.x,o.y),p=Qt(r,a.x,a.y);t.moveTo(this.x+p.x,this.y+p.y),this.moveTo(this.x+f.x,this.y+f.y);const y=Qt(r,h.x,h.y),v=Qt(r,c.x,c.y);this.vx=y.x,this.vy=y.y,t.vx=v.x,t.vy=v.y}}checkWall(t){const e=typeof t?.bounce=="number"?t.bounce:-1,n=t.wall.x,i=t.wall.y,r=t.wall.x+t.wall.width,o=t.wall.y+t.wall.height;this.x+this.radius>r?(this.moveXTo(r-this.radius),this.vx*=e):this.x-this.radius<n&&(this.moveXTo(n+this.radius),this.vx*=e),this.y+this.radius>o?(this.moveYTo(o-this.radius),this.vy*=e):this.y-this.radius<i&&(this.moveYTo(i+this.radius),this.vy*=e)}}class Io extends ot{constructor(t){super(t)}cloneShape(){return new Io({...super.getBaseOptions()})}toSVGPathData(){return[["m",-50,-25],["l",50,0],["l",0,-25],["l",50,50],["l",-50,50],["l",0,-25],["l",-50,0],["l",0,-50],["z"]]}toCanvasContext(t){t.beginPath(),t.moveTo(-50,-25),t.lineTo(0,-25),t.lineTo(0,-50),t.lineTo(50,0),t.lineTo(0,50),t.lineTo(0,25),t.lineTo(-50,25),t.lineTo(-50,-25),t.closePath()}}class Ke extends ot{width;height;borderRadius;constructor(t){super(t),this.width=t.rectWidth,this.height=t.rectHeight,this.borderRadius=t.rectBorderRadius||0}cloneShape(){return new Ke({...super.getBaseOptions(),rectWidth:this.width,rectHeight:this.height,rectBorderRadius:this.borderRadius})}static fromCubicBezier(t,e,n,i,r,o,a,h){const u=new gt({x:t,y:e,c1x:n,c1y:i,c2x:r,c2y:o,toX:a,toY:h}).getBoundingClientRect();return new Ke({x:u.x,y:u.y,rectWidth:u.width,rectHeight:u.height})}toSVGPathData(){return this.borderRadius?[["m",this.borderRadius,0],["l",this.width-this.borderRadius*2,0],["a",this.borderRadius,this.borderRadius,0,0,1,this.borderRadius,this.borderRadius],["l",0,this.height-this.borderRadius*2],["a",this.borderRadius,this.borderRadius,0,0,1,-this.borderRadius,this.borderRadius],["l",this.borderRadius*2-this.width,0],["a",this.borderRadius,this.borderRadius,0,0,1,-this.borderRadius,-this.borderRadius],["l",0,this.borderRadius*2-this.height],["a",this.borderRadius,this.borderRadius,0,0,1,this.borderRadius,-this.borderRadius],["z"]]:[["m",0,0],["l",this.width,0],["l",0,this.height],["l",-this.width,0],["z"]]}toCanvasContext(t){t.beginPath(),this.borderRadius<=0?t.rect(0,0,this.width,this.height):(t.moveTo(0,this.borderRadius),t.lineTo(0,this.height-this.borderRadius),t.quadraticCurveTo(0,this.height,this.borderRadius,this.height),t.lineTo(this.width-this.borderRadius,this.height),t.quadraticCurveTo(this.width,this.height,this.width,this.height-this.borderRadius),t.lineTo(this.width,this.borderRadius),t.quadraticCurveTo(this.width,0,this.width-this.borderRadius,0),t.lineTo(this.borderRadius,0),t.quadraticCurveTo(0,0,0,this.borderRadius)),t.closePath()}eq(t){return this.x===t.x&&this.y===t.y&&this.width===t.width&&this.height===t.height&&this.borderRadius===t.borderRadius}isIntersectRect(t){return!(this.x+this.width<t.x||t.x+t.width<this.x||this.y+this.height<t.y||t.y+t.height<this.y)}isContainPoint(t){return t.x>=this.x&&t.x<=this.x+this.width&&t.y>=this.y&&t.y<=this.y+this.height}}class Do extends ot{rx;ry;constructor(t){super(t),this.rx=t?.heartRx||10,this.ry=t?.heartRy||10}cloneShape(){return new Do({...super.getBaseOptions(),heartRx:this.rx,heartRy:this.ry})}toSVGPathData(){return[["m",0,0],["l",this.rx*2.4,-this.ry*3.14],["a",this.rx/2,this.ry/2,0,0,0,-this.rx*2.4,-this.ry*1.5],["a",this.rx/2,this.ry/2,0,0,0,-this.rx*2.4,this.ry*1.5],["l",this.rx*2.4,this.ry*3.14],["z"]]}}class Lo extends ot{rx;ry;constructor(t){super(t),this.rx=t?.heartRx??50,this.ry=t?.heartRy??50}cloneShape(){return new Lo({...super.getBaseOptions(),heartRx:this.rx,heartRy:this.ry})}toSVGPathData(){return[["m",0,0+this.ry*.3],["C",0,0,0-this.rx/2,0,0-this.rx/2,0+this.ry*.3],["C",0-this.rx/2,0+(this.ry+this.ry*.3)/2,0,0+(this.ry+this.ry*.3)/1.4,0,0+this.ry],["C",0,0+(this.ry+this.ry*.3)/1.8,0+this.rx/2,0+(this.ry+this.ry*.3)/2,0+this.rx/2,0+this.ry*.3],["C",0+this.rx/2,0,0,0,0,0+this.ry*.3],["z"]]}}class Ro extends ot{r;constructor(t){super(t),this.r=t?.starR||20}cloneShape(){return new Ro({...super.getBaseOptions(),starR:this.r})}toSVGPathData(){const t=[["m",0,-this.r]];for(let e=0;e<6;e+=1){const n=288+e*144,i=this.r*Math.cos(q(n)),r=this.r*Math.sin(q(n));t.push(["l",i,r])}return t}}class Oo extends ot{constructor(t){super(t)}cloneShape(){return new Oo({...super.getBaseOptions()})}toSVGPathData(){return[["m",4,24],["l",4,-8],["l",6,-6],["l",1,-10],["l",-6,-10],["l",-7,10],["l",-4,0],["l",-7,-10],["l",-6,10],["l",1,10],["l",6,6],["l",4,8],["z"]]}toCanvasContext(t){t.beginPath(),t.moveTo(4,24),t.lineTo(8,16),t.lineTo(14,10),t.lineTo(15,0),t.lineTo(9,-10),t.lineTo(2,0),t.lineTo(-2,0),t.lineTo(-9,-10),t.lineTo(-15,0),t.lineTo(-14,10),t.lineTo(-8,16),t.lineTo(-4,24),t.closePath()}}class zo extends ot{constructor(t){super(t)}cloneShape(){return new zo({...super.getBaseOptions()})}toSVGPathData(){return[["M",0,0],["C",15,0,15,-40,5,-30],["L",0,0],["C",-15,0,-15,-40,-5,-30],["L",0,0],["a",15,15,0,1,1,0,30],["a",15,15,0,1,1,0,-30]]}}class No extends ot{constructor(t){super(t),this.d="m5.068 9.267-3.08-.77a.512.512 0 0 1 0-.994l3.08-.77a2.289 2.289 0 0 0 1.665-1.665l.77-3.08a.512.512 0 0 1 .994 0l.77 3.08c.205.82.845 1.46 1.665 1.665l3.08.77a.512.512 0 0 1 0 .994l-3.08.77a2.29 2.29 0 0 0-1.665 1.665l-.77 3.08a.512.512 0 0 1-.994 0l-.77-3.08a2.289 2.289 0 0 0-1.665-1.665Z"}cloneShape(){return new No({...super.getBaseOptions()})}}class Bo extends ot{rx;ry;constructor(t){super(t),this.rx=t?.rx||0,this.ry=t?.ry||0}cloneShape(){return new Bo({...super.getBaseOptions(),rx:this.rx,ry:this.ry})}getBoundingClientRect(){return{x:this.x-this.rx,y:this.y-this.ry,width:this.rx*2,height:this.ry*2}}toSVGPathData(){return[["m",0,-this.ry],["a",this.rx,this.ry,0,1,1,0,2*this.ry],["a",this.rx,this.ry,0,1,1,0,-2*this.ry],["z"]]}toCanvasContext(t){t.beginPath(),t.ellipse(0,0,this.rx,this.ry,0,0,2*Math.PI,!0),t.closePath()}}class Fo extends Lt{constructor(t,e){super(t,e);const n=new ot({...e,drag:{...e?.drag,followSibling:!0},show:typeof t?.showFlame=="boolean"?t.showFlame:!1,d:[["M",-15,0],["L",-2.5,-5],["L",-2.5,5],["Z"]]});this.addShape(n);const i=new ot({...e,drag:{...e?.drag,followSibling:!0},d:[["M",10,0],["L",-10,10],["L",-5,0],["L",-10,-10],["L",10,0],["Z"]]});this.addShape(i)}cloneShapeCombo(){return new Fo({...this.options,showFlame:this.showFlame},this.commonChildShapeOptions)}set showFlame(t){this.shapes[0].show=t}get showFlame(){return this.shapes[0].show}}class Yo extends Lt{width;height;cornerRadius;constructor(t,e){super(t,e),this.width=t.segmentWidth,this.height=t.segmentHeight,this.cornerRadius=typeof t.segmentCornerRadius=="number"?t.segmentCornerRadius:this.height*.5;const n=new Ke({...e,drag:{...e?.drag,followSibling:!0},x:0-this.cornerRadius,y:0-this.height*.5,rectWidth:this.width+this.cornerRadius*2,rectHeight:this.height,rectBorderRadius:this.cornerRadius});this.addShape(n);const i=new bn({...e,drag:{...e?.drag,followSibling:!0},x:0,y:0,ballRadius:2});this.addShape(i);const r=new bn({...e,drag:{...e?.drag,followSibling:!0},x:0+this.width,y:0,ballRadius:2});this.addShape(r)}cloneShapeCombo(){return new Yo({...this.options,segmentWidth:this.width,segmentHeight:this.height},this.commonChildShapeOptions)}getBoundingClientRectCenter(){return{x:0,y:0}}getPin(){const t=this.shapes[1];return{x:t.x+Math.cos(q(t.degree))*this.width,y:t.y+Math.sin(q(t.degree))*this.width}}}class $o extends Lt{value$=new mn;subscription;constructor(t,e){super(t,e);const n=t?.sliderMin||0,i=t?.sliderMax||100,r=t?.sliderStep||1,o=nf(n,i,r),a=o(typeof t?.sliderDefaultValue=="number"?N(t.sliderDefaultValue,n,i):n);this.value$.next(a);const h=a/(i-n),c=t?.sliderWidth||100,u=t?.sliderHeight||4,l=u*.5,m=u*2.5,f=t?.sliderBackgroundColor||"#f5f5f5",p=t?.sliderForegroundColor||"#5a82f0",y=new Ke({...e,rectWidth:c,rectHeight:u,rectBorderRadius:l,attrs:{...e?.attrs,fill:f},drag:{...e?.drag,enable:!1}});this.addShape(y);const v=new Ke({...e,rectWidth:c*h,rectHeight:u,rectBorderRadius:l,attrs:{...e?.attrs,fill:p},drag:{...e?.drag,enable:!1}});this.addShape(v);const w=new bn({...e,x:c*h,y:l,ballRadius:m,attrs:{...e?.attrs,fill:p},drag:{...e?.drag,enable:!0,alongPath:new St([["m",0,0],["l",c,0]])}});this.addShape(w),this.subscription=w.transform$.subscribe(({dx:_})=>{v.width=N(v.width+(_||0),0,c),this.value$.next(o((w.x-y.x)/c*(i-n)+n))})}destroy(){super.destroy(),this.subscription.unsubscribe()}cloneShapeCombo(){return new $o({...this.options},this.commonChildShapeOptions)}}class ss extends ot{half;lineWidth;radius;startDegree;endDegree;percent=0;percentDegree=0;startColor;endColor;constructor(t){super(t),this.half=typeof t?.half=="boolean"?t?.half:!1,this.lineWidth=t.lineWidth;const e=t.width||0,n=t.height||0,i=(t.endDegree-t.startDegree-180)/2;if(t.radius)this.radius=t.radius;else if(this.half){const r=Math.min(e/2,n)-this.lineWidth;this.radius=Math.max(0,r-r*Math.sin(q(i)))}else this.radius=Math.max(0,Math.min(e/2,n/2)-this.lineWidth);t.x||(this.x=e/2),t.y||(this.half?this.y=n-this.lineWidth-this.radius*Math.sin(q(i)):this.y=n/2),t.forceCoordinate?(this.startDegree=t.startDegree,this.endDegree=t.endDegree):(this.startDegree=-90+t.startDegree,this.endDegree=-90+t.endDegree),this.startColor=t?.startColor,this.endColor=t?.endColor,this.setAttr({"stroke-linecap":"round","stroke-width":String(this.lineWidth),stroke:this.startColor||"#000000"}),this.setPercent(t.percent||1)}cloneShape(){return new ss({...super.getBaseOptions(),half:this.half,lineWidth:this.lineWidth,radius:this.radius,forceCoordinate:!0,startDegree:this.startDegree,endDegree:this.endDegree,startColor:this.startColor,endColor:this.endColor,percent:this.percent})}setPercent(t){this.percent=Math.max(0,t),this.percentDegree=this.startDegree+(this.endDegree-this.startDegree)*t}enableGradient(t,e){this.startColor=t,this.endColor=e,this.setAttr({stroke:this.startColor})}disableGradient(t){this.startColor=t,this.endColor=void 0,this.setAttr({stroke:this.startColor})}toSVGPathData(){const{dx:t,dy:e}=Ae(q(this.startDegree),this.radius),{dx:n,dy:i}=Ae(q(this.percentDegree),this.radius);return[["m",t,e],["a",this.radius,this.radius,0,Math.abs(this.percentDegree-this.startDegree)>=180?1:0,1,n-t,i-e]]}toCanvasContext(t){if(this.startColor&&this.endColor){let e;if(this.half){const n=this.radius-this.radius*Math.cos(Math.PI*this.percent),i=this.radius*Math.sin(Math.PI*this.percent);e=t.createLinearGradient(-this.radius,0,-this.radius+n,-i,{0:this.startColor,1:this.endColor})}else{const n=this.radius*Math.sin(2*Math.PI*this.percent),i=this.radius*Math.cos(2*Math.PI*this.percent);e=t.createLinearGradient(0,-this.radius,n,-i,{0:this.startColor,1:this.endColor})}this.setAttr({stroke:e})}t.beginPath(),t.arc(0,0,this.radius,q(this.startDegree),q(this.percentDegree),!1)}}class Xo extends Lt{half;lineWidth;width;height;bgColor;startColor;endColor;startDegree;endDegree;percent=0;ringBg;ring;lines=[];indicatorLineCount;constructor(t,e){if(super(t,e),this.half=typeof t?.half=="boolean"?t?.half:!1,this.lineWidth=t?.lineWidth||12,this.width=t.width,this.height=t.height,this.bgColor=t?.bgColor,this.startColor=t?.startColor,this.endColor=t?.endColor,this.half?(this.startDegree=t?.startDegree||-105,this.endDegree=t?.endDegree||105):(this.startDegree=t?.startDegree||0,this.endDegree=t?.endDegree||360),this.percent=t?.percent||0,this.ringBg=new ss({half:this.half,lineWidth:this.lineWidth,width:t.width,height:t.height,startDegree:this.startDegree,endDegree:this.endDegree,startColor:this.bgColor,percent:1}),this.addShape(this.ringBg),this.ring=new ss({half:this.half,lineWidth:this.lineWidth,width:t.width,height:t.height,startDegree:this.startDegree,endDegree:this.endDegree,startColor:this.startColor,endColor:this.endColor,percent:0}),this.addShape(this.ring),this.indicatorLineCount=23,this.half){const o=this.ringBg.radius-20-17;for(let a=0;a<this.indicatorLineCount;a++){const h=-90+this.startDegree+(this.endDegree-this.startDegree)/(this.indicatorLineCount-1)*a,c=new Qe({x:this.ringBg.x+Math.cos(q(h))*o,y:this.ringBg.y+Math.sin(q(h))*o,lineLength:17,lineDegree:h,attrs:{"stroke-linecap":"round","stroke-width":String(2),stroke:this.bgColor}});this.lines.push(c),this.addShape(c)}}this.setPercent(t.percent||0)}cloneShapeCombo(){return new Xo({half:this.half,lineWidth:this.lineWidth,width:this.width,height:this.height,bgColor:this.bgColor,startColor:this.startColor,endColor:this.endColor,startDegree:this.startDegree,endDegree:this.endDegree,percent:this.percent},this.commonChildShapeOptions)}setPercent(t){if(this.percent=Math.max(0,t),this.ring.setPercent(t),this.half)for(let e=0;e<this.indicatorLineCount;e++)e/(this.indicatorLineCount-1)<=this.percent?this.lines[e].enableGradient(this.startColor,this.endColor):this.lines[e].disableGradient(this.bgColor)}}function Vu(s,t={attributes:!0,childList:!0,subtree:!0}){return new et(e=>{const n=new MutationObserver((i,r)=>{e.next(i)});return n.observe(s,t),()=>{n.disconnect()}})}function Gu(s,t={root:null}){return new et(e=>{const n=new IntersectionObserver((i,r)=>{if(i.length){const o=i[i.length-1];o&&e.next(o)}},t);return n.observe(s),()=>{n.unobserve(s),n.disconnect()}})}function tw(s,t){return wu().pipe(Te(null),rt(()=>{const{width:e,height:n}=t?.root?.getBoundingClientRect()||xu(),{top:i,left:r,right:o,bottom:a}=s.getBoundingClientRect();return(i>=0&&i<=n||a>=0&&a<=n)&&(r>=0&&r<=e||o>=0&&o<=e)}),Ce())}function ew(s,t){const e=typeof t?.threshold=="number"?t.threshold:.5;return Gu(s,{threshold:e,root:t?.root}).pipe(rt(n=>n.isIntersecting&&n.intersectionRatio>=e),Ce())}let qu=!1;function nw(){qu||(qu=!0,vc(`
22
+ * Licensed under the MIT license */(function(n){(function(t,e,s,i){var r=["","webkit","Moz","MS","ms","o"],o=e.createElement("div"),a="function",h=Math.round,c=Math.abs,l=Date.now;function u(g,_,E){return setTimeout(x(g,E),_)}function m(g,_,E){return Array.isArray(g)?(f(g,E[_],E),!0):!1}function f(g,_,E){var M;if(g)if(g.forEach)g.forEach(_,E);else if(g.length!==i)for(M=0;M<g.length;)_.call(E,g[M],M,g),M++;else for(M in g)g.hasOwnProperty(M)&&_.call(E,g[M],M,g)}function p(g,_,E){var M="DEPRECATED METHOD: "+_+`
23
+ `+E+` AT
24
+ `;return function(){var k=new Error("get-stack-trace"),z=k&&k.stack?k.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",j=t.console&&(t.console.warn||t.console.log);return j&&j.call(t.console,M,z),g.apply(this,arguments)}}var y;typeof Object.assign!="function"?y=function(_){if(_===i||_===null)throw new TypeError("Cannot convert undefined or null to object");for(var E=Object(_),M=1;M<arguments.length;M++){var k=arguments[M];if(k!==i&&k!==null)for(var z in k)k.hasOwnProperty(z)&&(E[z]=k[z])}return E}:y=Object.assign;var S=p(function(_,E,M){for(var k=Object.keys(E),z=0;z<k.length;)(!M||M&&_[k[z]]===i)&&(_[k[z]]=E[k[z]]),z++;return _},"extend","Use `assign`."),w=p(function(_,E){return S(_,E,!0)},"merge","Use `assign`.");function v(g,_,E){var M=_.prototype,k;k=g.prototype=Object.create(M),k.constructor=g,k._super=M,E&&y(k,E)}function x(g,_){return function(){return g.apply(_,arguments)}}function b(g,_){return typeof g==a?g.apply(_&&_[0]||i,_):g}function P(g,_){return g===i?_:g}function C(g,_,E){f(V(_),function(M){g.addEventListener(M,E,!1)})}function D(g,_,E){f(V(_),function(M){g.removeEventListener(M,E,!1)})}function B(g,_){for(;g;){if(g==_)return!0;g=g.parentNode}return!1}function Y(g,_){return g.indexOf(_)>-1}function V(g){return g.trim().split(/\s+/g)}function G(g,_,E){if(g.indexOf&&!E)return g.indexOf(_);for(var M=0;M<g.length;){if(E&&g[M][E]==_||!E&&g[M]===_)return M;M++}return-1}function J(g){return Array.prototype.slice.call(g,0)}function it(g,_,E){for(var M=[],k=[],z=0;z<g.length;){var j=_?g[z][_]:g[z];G(k,j)<0&&M.push(g[z]),k[z]=j,z++}return E&&(_?M=M.sort(function(bt,It){return bt[_]>It[_]}):M=M.sort()),M}function tt(g,_){for(var E,M,k=_[0].toUpperCase()+_.slice(1),z=0;z<r.length;){if(E=r[z],M=E?E+k:_,M in g)return M;z++}return i}var Kt=1;function Xt(){return Kt++}function Vt(g){var _=g.ownerDocument||g;return _.defaultView||_.parentWindow||t}var te=/mobile|tablet|ip(ad|hone|od)|android/i,R="ontouchstart"in t,L=tt(t,"PointerEvent")!==i,U=R&&te.test(navigator.userAgent),Z="touch",At="pen",ee="mouse",fi="kinect",di=25,gt=1,he=2,rt=4,Ct=8,Cs=1,ns=2,is=4,Ne=8,I=16,at=ns|is,rs=Ne|I,gu=at|rs,yu=["x","y"],mi=["clientX","clientY"];function Gt(g,_){var E=this;this.manager=g,this.callback=_,this.element=g.element,this.target=g.options.inputTarget,this.domHandler=function(M){b(g.options.enable,[g])&&E.handler(M)},this.init()}Gt.prototype={handler:function(){},init:function(){this.evEl&&C(this.element,this.evEl,this.domHandler),this.evTarget&&C(this.target,this.evTarget,this.domHandler),this.evWin&&C(Vt(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&D(this.element,this.evEl,this.domHandler),this.evTarget&&D(this.target,this.evTarget,this.domHandler),this.evWin&&D(Vt(this.element),this.evWin,this.domHandler)}};function Bx(g){var _,E=g.options.inputClass;return E?_=E:L?_=oa:U?_=yi:R?_=aa:_=gi,new _(g,Nx)}function Nx(g,_,E){var M=E.pointers.length,k=E.changedPointers.length,z=_&gt&&M-k===0,j=_&(rt|Ct)&&M-k===0;E.isFirst=!!z,E.isFinal=!!j,z&&(g.session={}),E.eventType=_,Fx(g,E),g.emit("hammer.input",E),g.recognize(E),g.session.prevInput=E}function Fx(g,_){var E=g.session,M=_.pointers,k=M.length;E.firstInput||(E.firstInput=wu(_)),k>1&&!E.firstMultiple?E.firstMultiple=wu(_):k===1&&(E.firstMultiple=!1);var z=E.firstInput,j=E.firstMultiple,yt=j?j.center:z.center,bt=_.center=xu(M);_.timeStamp=l(),_.deltaTime=_.timeStamp-z.timeStamp,_.angle=ra(yt,bt),_.distance=pi(yt,bt),Yx(E,_),_.offsetDirection=vu(_.deltaX,_.deltaY);var It=bu(_.deltaTime,_.deltaX,_.deltaY);_.overallVelocityX=It.x,_.overallVelocityY=It.y,_.overallVelocity=c(It.x)>c(It.y)?It.x:It.y,_.scale=j?$x(j.pointers,M):1,_.rotation=j?Ux(j.pointers,M):0,_.maxPointers=E.prevInput?_.pointers.length>E.prevInput.maxPointers?_.pointers.length:E.prevInput.maxPointers:_.pointers.length,Xx(E,_);var le=g.element;B(_.srcEvent.target,le)&&(le=_.srcEvent.target),_.target=le}function Yx(g,_){var E=_.center,M=g.offsetDelta||{},k=g.prevDelta||{},z=g.prevInput||{};(_.eventType===gt||z.eventType===rt)&&(k=g.prevDelta={x:z.deltaX||0,y:z.deltaY||0},M=g.offsetDelta={x:E.x,y:E.y}),_.deltaX=k.x+(E.x-M.x),_.deltaY=k.y+(E.y-M.y)}function Xx(g,_){var E=g.lastInterval||_,M=_.timeStamp-E.timeStamp,k,z,j,yt;if(_.eventType!=Ct&&(M>di||E.velocity===i)){var bt=_.deltaX-E.deltaX,It=_.deltaY-E.deltaY,le=bu(M,bt,It);z=le.x,j=le.y,k=c(le.x)>c(le.y)?le.x:le.y,yt=vu(bt,It),g.lastInterval=_}else k=E.velocity,z=E.velocityX,j=E.velocityY,yt=E.direction;_.velocity=k,_.velocityX=z,_.velocityY=j,_.direction=yt}function wu(g){for(var _=[],E=0;E<g.pointers.length;)_[E]={clientX:h(g.pointers[E].clientX),clientY:h(g.pointers[E].clientY)},E++;return{timeStamp:l(),pointers:_,center:xu(_),deltaX:g.deltaX,deltaY:g.deltaY}}function xu(g){var _=g.length;if(_===1)return{x:h(g[0].clientX),y:h(g[0].clientY)};for(var E=0,M=0,k=0;k<_;)E+=g[k].clientX,M+=g[k].clientY,k++;return{x:h(E/_),y:h(M/_)}}function bu(g,_,E){return{x:_/g||0,y:E/g||0}}function vu(g,_){return g===_?Cs:c(g)>=c(_)?g<0?ns:is:_<0?Ne:I}function pi(g,_,E){E||(E=yu);var M=_[E[0]]-g[E[0]],k=_[E[1]]-g[E[1]];return Math.sqrt(M*M+k*k)}function ra(g,_,E){E||(E=yu);var M=_[E[0]]-g[E[0]],k=_[E[1]]-g[E[1]];return Math.atan2(k,M)*180/Math.PI}function Ux(g,_){return ra(_[1],_[0],mi)+ra(g[1],g[0],mi)}function $x(g,_){return pi(_[0],_[1],mi)/pi(g[0],g[1],mi)}var Vx={mousedown:gt,mousemove:he,mouseup:rt},Gx="mousedown",qx="mousemove mouseup";function gi(){this.evEl=Gx,this.evWin=qx,this.pressed=!1,Gt.apply(this,arguments)}v(gi,Gt,{handler:function(_){var E=Vx[_.type];E&gt&&_.button===0&&(this.pressed=!0),E&he&&_.which!==1&&(E=rt),this.pressed&&(E&rt&&(this.pressed=!1),this.callback(this.manager,E,{pointers:[_],changedPointers:[_],pointerType:ee,srcEvent:_}))}});var jx={pointerdown:gt,pointermove:he,pointerup:rt,pointercancel:Ct,pointerout:Ct},Hx={2:Z,3:At,4:ee,5:fi},Su="pointerdown",_u="pointermove pointerup pointercancel";t.MSPointerEvent&&!t.PointerEvent&&(Su="MSPointerDown",_u="MSPointerMove MSPointerUp MSPointerCancel");function oa(){this.evEl=Su,this.evWin=_u,Gt.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}v(oa,Gt,{handler:function(_){var E=this.store,M=!1,k=_.type.toLowerCase().replace("ms",""),z=jx[k],j=Hx[_.pointerType]||_.pointerType,yt=j==Z,bt=G(E,_.pointerId,"pointerId");z&gt&&(_.button===0||yt)?bt<0&&(E.push(_),bt=E.length-1):z&(rt|Ct)&&(M=!0),!(bt<0)&&(E[bt]=_,this.callback(this.manager,z,{pointers:E,changedPointers:[_],pointerType:j,srcEvent:_}),M&&E.splice(bt,1))}});var Wx={touchstart:gt,touchmove:he,touchend:rt,touchcancel:Ct},Jx="touchstart",Zx="touchstart touchmove touchend touchcancel";function Cu(){this.evTarget=Jx,this.evWin=Zx,this.started=!1,Gt.apply(this,arguments)}v(Cu,Gt,{handler:function(_){var E=Wx[_.type];if(E===gt&&(this.started=!0),!!this.started){var M=Qx.call(this,_,E);E&(rt|Ct)&&M[0].length-M[1].length===0&&(this.started=!1),this.callback(this.manager,E,{pointers:M[0],changedPointers:M[1],pointerType:Z,srcEvent:_})}}});function Qx(g,_){var E=J(g.touches),M=J(g.changedTouches);return _&(rt|Ct)&&(E=it(E.concat(M),"identifier",!0)),[E,M]}var Kx={touchstart:gt,touchmove:he,touchend:rt,touchcancel:Ct},tb="touchstart touchmove touchend touchcancel";function yi(){this.evTarget=tb,this.targetIds={},Gt.apply(this,arguments)}v(yi,Gt,{handler:function(_){var E=Kx[_.type],M=eb.call(this,_,E);M&&this.callback(this.manager,E,{pointers:M[0],changedPointers:M[1],pointerType:Z,srcEvent:_})}});function eb(g,_){var E=J(g.touches),M=this.targetIds;if(_&(gt|he)&&E.length===1)return M[E[0].identifier]=!0,[E,E];var k,z,j=J(g.changedTouches),yt=[],bt=this.target;if(z=E.filter(function(It){return B(It.target,bt)}),_===gt)for(k=0;k<z.length;)M[z[k].identifier]=!0,k++;for(k=0;k<j.length;)M[j[k].identifier]&&yt.push(j[k]),_&(rt|Ct)&&delete M[j[k].identifier],k++;if(yt.length)return[it(z.concat(yt),"identifier",!0),yt]}var sb=2500,Tu=25;function aa(){Gt.apply(this,arguments);var g=x(this.handler,this);this.touch=new yi(this.manager,g),this.mouse=new gi(this.manager,g),this.primaryTouch=null,this.lastTouches=[]}v(aa,Gt,{handler:function(_,E,M){var k=M.pointerType==Z,z=M.pointerType==ee;if(!(z&&M.sourceCapabilities&&M.sourceCapabilities.firesTouchEvents)){if(k)nb.call(this,E,M);else if(z&&ib.call(this,M))return;this.callback(_,E,M)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});function nb(g,_){g&gt?(this.primaryTouch=_.changedPointers[0].identifier,Pu.call(this,_)):g&(rt|Ct)&&Pu.call(this,_)}function Pu(g){var _=g.changedPointers[0];if(_.identifier===this.primaryTouch){var E={x:_.clientX,y:_.clientY};this.lastTouches.push(E);var M=this.lastTouches,k=function(){var z=M.indexOf(E);z>-1&&M.splice(z,1)};setTimeout(k,sb)}}function ib(g){for(var _=g.srcEvent.clientX,E=g.srcEvent.clientY,M=0;M<this.lastTouches.length;M++){var k=this.lastTouches[M],z=Math.abs(_-k.x),j=Math.abs(E-k.y);if(z<=Tu&&j<=Tu)return!0}return!1}var Eu=tt(o.style,"touchAction"),Mu=Eu!==i,Au="compute",Iu="auto",ha="manipulation",os="none",ln="pan-x",un="pan-y",wi=ob();function ca(g,_){this.manager=g,this.set(_)}ca.prototype={set:function(g){g==Au&&(g=this.compute()),Mu&&this.manager.element.style&&wi[g]&&(this.manager.element.style[Eu]=g),this.actions=g.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var g=[];return f(this.manager.recognizers,function(_){b(_.options.enable,[_])&&(g=g.concat(_.getTouchAction()))}),rb(g.join(" "))},preventDefaults:function(g){var _=g.srcEvent,E=g.offsetDirection;if(this.manager.session.prevented){_.preventDefault();return}var M=this.actions,k=Y(M,os)&&!wi[os],z=Y(M,un)&&!wi[un],j=Y(M,ln)&&!wi[ln];if(k){var yt=g.pointers.length===1,bt=g.distance<2,It=g.deltaTime<250;if(yt&&bt&&It)return}if(!(j&&z)&&(k||z&&E&at||j&&E&rs))return this.preventSrc(_)},preventSrc:function(g){this.manager.session.prevented=!0,g.preventDefault()}};function rb(g){if(Y(g,os))return os;var _=Y(g,ln),E=Y(g,un);return _&&E?os:_||E?_?ln:un:Y(g,ha)?ha:Iu}function ob(){if(!Mu)return!1;var g={},_=t.CSS&&t.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(E){g[E]=_?t.CSS.supports("touch-action",E):!0}),g}var xi=1,qt=2,Ts=4,Fe=8,be=Fe,fn=16,ce=32;function ve(g){this.options=y({},this.defaults,g||{}),this.id=Xt(),this.manager=null,this.options.enable=P(this.options.enable,!0),this.state=xi,this.simultaneous={},this.requireFail=[]}ve.prototype={defaults:{},set:function(g){return y(this.options,g),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(g){if(m(g,"recognizeWith",this))return this;var _=this.simultaneous;return g=bi(g,this),_[g.id]||(_[g.id]=g,g.recognizeWith(this)),this},dropRecognizeWith:function(g){return m(g,"dropRecognizeWith",this)?this:(g=bi(g,this),delete this.simultaneous[g.id],this)},requireFailure:function(g){if(m(g,"requireFailure",this))return this;var _=this.requireFail;return g=bi(g,this),G(_,g)===-1&&(_.push(g),g.requireFailure(this)),this},dropRequireFailure:function(g){if(m(g,"dropRequireFailure",this))return this;g=bi(g,this);var _=G(this.requireFail,g);return _>-1&&this.requireFail.splice(_,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(g){return!!this.simultaneous[g.id]},emit:function(g){var _=this,E=this.state;function M(k){_.manager.emit(k,g)}E<Fe&&M(_.options.event+ku(E)),M(_.options.event),g.additionalEvent&&M(g.additionalEvent),E>=Fe&&M(_.options.event+ku(E))},tryEmit:function(g){if(this.canEmit())return this.emit(g);this.state=ce},canEmit:function(){for(var g=0;g<this.requireFail.length;){if(!(this.requireFail[g].state&(ce|xi)))return!1;g++}return!0},recognize:function(g){var _=y({},g);if(!b(this.options.enable,[this,_])){this.reset(),this.state=ce;return}this.state&(be|fn|ce)&&(this.state=xi),this.state=this.process(_),this.state&(qt|Ts|Fe|fn)&&this.tryEmit(_)},process:function(g){},getTouchAction:function(){},reset:function(){}};function ku(g){return g&fn?"cancel":g&Fe?"end":g&Ts?"move":g&qt?"start":""}function Du(g){return g==I?"down":g==Ne?"up":g==ns?"left":g==is?"right":""}function bi(g,_){var E=_.manager;return E?E.get(g):g}function se(){ve.apply(this,arguments)}v(se,ve,{defaults:{pointers:1},attrTest:function(g){var _=this.options.pointers;return _===0||g.pointers.length===_},process:function(g){var _=this.state,E=g.eventType,M=_&(qt|Ts),k=this.attrTest(g);return M&&(E&Ct||!k)?_|fn:M||k?E&rt?_|Fe:_&qt?_|Ts:qt:ce}});function vi(){se.apply(this,arguments),this.pX=null,this.pY=null}v(vi,se,{defaults:{event:"pan",threshold:10,pointers:1,direction:gu},getTouchAction:function(){var g=this.options.direction,_=[];return g&at&&_.push(un),g&rs&&_.push(ln),_},directionTest:function(g){var _=this.options,E=!0,M=g.distance,k=g.direction,z=g.deltaX,j=g.deltaY;return k&_.direction||(_.direction&at?(k=z===0?Cs:z<0?ns:is,E=z!=this.pX,M=Math.abs(g.deltaX)):(k=j===0?Cs:j<0?Ne:I,E=j!=this.pY,M=Math.abs(g.deltaY))),g.direction=k,E&&M>_.threshold&&k&_.direction},attrTest:function(g){return se.prototype.attrTest.call(this,g)&&(this.state&qt||!(this.state&qt)&&this.directionTest(g))},emit:function(g){this.pX=g.deltaX,this.pY=g.deltaY;var _=Du(g.direction);_&&(g.additionalEvent=this.options.event+_),this._super.emit.call(this,g)}});function la(){se.apply(this,arguments)}v(la,se,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[os]},attrTest:function(g){return this._super.attrTest.call(this,g)&&(Math.abs(g.scale-1)>this.options.threshold||this.state&qt)},emit:function(g){if(g.scale!==1){var _=g.scale<1?"in":"out";g.additionalEvent=this.options.event+_}this._super.emit.call(this,g)}});function ua(){ve.apply(this,arguments),this._timer=null,this._input=null}v(ua,ve,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[Iu]},process:function(g){var _=this.options,E=g.pointers.length===_.pointers,M=g.distance<_.threshold,k=g.deltaTime>_.time;if(this._input=g,!M||!E||g.eventType&(rt|Ct)&&!k)this.reset();else if(g.eventType&gt)this.reset(),this._timer=u(function(){this.state=be,this.tryEmit()},_.time,this);else if(g.eventType&rt)return be;return ce},reset:function(){clearTimeout(this._timer)},emit:function(g){this.state===be&&(g&&g.eventType&rt?this.manager.emit(this.options.event+"up",g):(this._input.timeStamp=l(),this.manager.emit(this.options.event,this._input)))}});function fa(){se.apply(this,arguments)}v(fa,se,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[os]},attrTest:function(g){return this._super.attrTest.call(this,g)&&(Math.abs(g.rotation)>this.options.threshold||this.state&qt)}});function da(){se.apply(this,arguments)}v(da,se,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:at|rs,pointers:1},getTouchAction:function(){return vi.prototype.getTouchAction.call(this)},attrTest:function(g){var _=this.options.direction,E;return _&(at|rs)?E=g.overallVelocity:_&at?E=g.overallVelocityX:_&rs&&(E=g.overallVelocityY),this._super.attrTest.call(this,g)&&_&g.offsetDirection&&g.distance>this.options.threshold&&g.maxPointers==this.options.pointers&&c(E)>this.options.velocity&&g.eventType&rt},emit:function(g){var _=Du(g.offsetDirection);_&&this.manager.emit(this.options.event+_,g),this.manager.emit(this.options.event,g)}});function Si(){ve.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}v(Si,ve,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[ha]},process:function(g){var _=this.options,E=g.pointers.length===_.pointers,M=g.distance<_.threshold,k=g.deltaTime<_.time;if(this.reset(),g.eventType&gt&&this.count===0)return this.failTimeout();if(M&&k&&E){if(g.eventType!=rt)return this.failTimeout();var z=this.pTime?g.timeStamp-this.pTime<_.interval:!0,j=!this.pCenter||pi(this.pCenter,g.center)<_.posThreshold;this.pTime=g.timeStamp,this.pCenter=g.center,!j||!z?this.count=1:this.count+=1,this._input=g;var yt=this.count%_.taps;if(yt===0)return this.hasRequireFailures()?(this._timer=u(function(){this.state=be,this.tryEmit()},_.interval,this),qt):be}return ce},failTimeout:function(){return this._timer=u(function(){this.state=ce},this.options.interval,this),ce},reset:function(){clearTimeout(this._timer)},emit:function(){this.state==be&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}});function Se(g,_){return _=_||{},_.recognizers=P(_.recognizers,Se.defaults.preset),new ma(g,_)}Se.VERSION="2.0.7",Se.defaults={domEvents:!1,touchAction:Au,enable:!0,inputTarget:null,inputClass:null,preset:[[fa,{enable:!1}],[la,{enable:!1},["rotate"]],[da,{direction:at}],[vi,{direction:at},["swipe"]],[Si],[Si,{event:"doubletap",taps:2},["tap"]],[ua]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};var ab=1,Lu=2;function ma(g,_){this.options=y({},Se.defaults,_||{}),this.options.inputTarget=this.options.inputTarget||g,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=g,this.input=Bx(this),this.touchAction=new ca(this,this.options.touchAction),Ru(this,!0),f(this.options.recognizers,function(E){var M=this.add(new E[0](E[1]));E[2]&&M.recognizeWith(E[2]),E[3]&&M.requireFailure(E[3])},this)}ma.prototype={set:function(g){return y(this.options,g),g.touchAction&&this.touchAction.update(),g.inputTarget&&(this.input.destroy(),this.input.target=g.inputTarget,this.input.init()),this},stop:function(g){this.session.stopped=g?Lu:ab},recognize:function(g){var _=this.session;if(!_.stopped){this.touchAction.preventDefaults(g);var E,M=this.recognizers,k=_.curRecognizer;(!k||k&&k.state&be)&&(k=_.curRecognizer=null);for(var z=0;z<M.length;)E=M[z],_.stopped!==Lu&&(!k||E==k||E.canRecognizeWith(k))?E.recognize(g):E.reset(),!k&&E.state&(qt|Ts|Fe)&&(k=_.curRecognizer=E),z++}},get:function(g){if(g instanceof ve)return g;for(var _=this.recognizers,E=0;E<_.length;E++)if(_[E].options.event==g)return _[E];return null},add:function(g){if(m(g,"add",this))return this;var _=this.get(g.options.event);return _&&this.remove(_),this.recognizers.push(g),g.manager=this,this.touchAction.update(),g},remove:function(g){if(m(g,"remove",this))return this;if(g=this.get(g),g){var _=this.recognizers,E=G(_,g);E!==-1&&(_.splice(E,1),this.touchAction.update())}return this},on:function(g,_){if(g!==i&&_!==i){var E=this.handlers;return f(V(g),function(M){E[M]=E[M]||[],E[M].push(_)}),this}},off:function(g,_){if(g!==i){var E=this.handlers;return f(V(g),function(M){_?E[M]&&E[M].splice(G(E[M],_),1):delete E[M]}),this}},emit:function(g,_){this.options.domEvents&&hb(g,_);var E=this.handlers[g]&&this.handlers[g].slice();if(!(!E||!E.length)){_.type=g,_.preventDefault=function(){_.srcEvent.preventDefault()};for(var M=0;M<E.length;)E[M](_),M++}},destroy:function(){this.element&&Ru(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}};function Ru(g,_){var E=g.element;if(E.style){var M;f(g.options.cssProps,function(k,z){M=tt(E.style,z),_?(g.oldCssProps[M]=E.style[M],E.style[M]=k):E.style[M]=g.oldCssProps[M]||""}),_||(g.oldCssProps={})}}function hb(g,_){var E=e.createEvent("Event");E.initEvent(g,!0,!0),E.gesture=_,_.target.dispatchEvent(E)}y(Se,{INPUT_START:gt,INPUT_MOVE:he,INPUT_END:rt,INPUT_CANCEL:Ct,STATE_POSSIBLE:xi,STATE_BEGAN:qt,STATE_CHANGED:Ts,STATE_ENDED:Fe,STATE_RECOGNIZED:be,STATE_CANCELLED:fn,STATE_FAILED:ce,DIRECTION_NONE:Cs,DIRECTION_LEFT:ns,DIRECTION_RIGHT:is,DIRECTION_UP:Ne,DIRECTION_DOWN:I,DIRECTION_HORIZONTAL:at,DIRECTION_VERTICAL:rs,DIRECTION_ALL:gu,Manager:ma,Input:Gt,TouchAction:ca,TouchInput:yi,MouseInput:gi,PointerEventInput:oa,TouchMouseInput:aa,SingleTouchInput:Cu,Recognizer:ve,AttrRecognizer:se,Tap:Si,Pan:vi,Swipe:da,Pinch:la,Rotate:fa,Press:ua,on:C,off:D,each:f,merge:w,extend:S,assign:y,inherit:v,bindFn:x,prefixed:tt});var cb=typeof t<"u"?t:typeof self<"u"?self:{};cb.Hammer=Se,typeof i=="function"&&i.amd?i(function(){return Se}):n.exports?n.exports=Se:t[s]=Se})(window,document,"Hammer")})(Oh);var Rm=Oh.exports;const et=Wa(Rm);var mr=function(n,t){return mr=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,s){e.__proto__=s}||function(e,s){for(var i in s)Object.prototype.hasOwnProperty.call(s,i)&&(e[i]=s[i])},mr(n,t)};function de(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");mr(n,t);function e(){this.constructor=n}n.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}function Om(n,t,e,s){function i(r){return r instanceof e?r:new e(function(o){o(r)})}return new(e||(e=Promise))(function(r,o){function a(l){try{c(s.next(l))}catch(u){o(u)}}function h(l){try{c(s.throw(l))}catch(u){o(u)}}function c(l){l.done?r(l.value):i(l.value).then(a,h)}c((s=s.apply(n,t||[])).next())})}function zh(n,t){var e={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},s,i,r,o=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return o.next=a(0),o.throw=a(1),o.return=a(2),typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(c){return function(l){return h([c,l])}}function h(c){if(s)throw new TypeError("Generator is already executing.");for(;o&&(o=0,c[0]&&(e=0)),e;)try{if(s=1,i&&(r=c[0]&2?i.return:c[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,c[1])).done)return r;switch(i=0,r&&(c=[c[0]&2,r.value]),c[0]){case 0:case 1:r=c;break;case 4:return e.label++,{value:c[1],done:!1};case 5:e.label++,i=c[1],c=[0];continue;case 7:c=e.ops.pop(),e.trys.pop();continue;default:if(r=e.trys,!(r=r.length>0&&r[r.length-1])&&(c[0]===6||c[0]===2)){e=0;continue}if(c[0]===3&&(!r||c[1]>r[0]&&c[1]<r[3])){e.label=c[1];break}if(c[0]===6&&e.label<r[1]){e.label=r[1],r=c;break}if(r&&e.label<r[2]){e.label=r[2],e.ops.push(c);break}r[2]&&e.ops.pop(),e.trys.pop();continue}c=t.call(n,e)}catch(l){c=[6,l],i=0}finally{s=r=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}function $e(n){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&n[t],s=0;if(e)return e.call(n);if(n&&typeof n.length=="number")return{next:function(){return n&&s>=n.length&&(n=void 0),{value:n&&n[s++],done:!n}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function Ce(n,t){var e=typeof Symbol=="function"&&n[Symbol.iterator];if(!e)return n;var s=e.call(n),i,r=[],o;try{for(;(t===void 0||t-- >0)&&!(i=s.next()).done;)r.push(i.value)}catch(a){o={error:a}}finally{try{i&&!i.done&&(e=s.return)&&e.call(s)}finally{if(o)throw o.error}}return r}function Ve(n,t,e){if(e||arguments.length===2)for(var s=0,i=t.length,r;s<i;s++)(r||!(s in t))&&(r||(r=Array.prototype.slice.call(t,0,s)),r[s]=t[s]);return n.concat(r||Array.prototype.slice.call(t))}function us(n){return this instanceof us?(this.v=n,this):new us(n)}function zm(n,t,e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var s=e.apply(n,t||[]),i,r=[];return i=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),a("next"),a("throw"),a("return",o),i[Symbol.asyncIterator]=function(){return this},i;function o(f){return function(p){return Promise.resolve(p).then(f,u)}}function a(f,p){s[f]&&(i[f]=function(y){return new Promise(function(S,w){r.push([f,y,S,w])>1||h(f,y)})},p&&(i[f]=p(i[f])))}function h(f,p){try{c(s[f](p))}catch(y){m(r[0][3],y)}}function c(f){f.value instanceof us?Promise.resolve(f.value.v).then(l,u):m(r[0][2],f)}function l(f){h("next",f)}function u(f){h("throw",f)}function m(f,p){f(p),r.shift(),r.length&&h(r[0][0],r[0][1])}}function Bm(n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=n[Symbol.asyncIterator],e;return t?t.call(n):(n=typeof $e=="function"?$e(n):n[Symbol.iterator](),e={},s("next"),s("throw"),s("return"),e[Symbol.asyncIterator]=function(){return this},e);function s(r){e[r]=n[r]&&function(o){return new Promise(function(a,h){o=n[r](o),i(a,h,o.done,o.value)})}}function i(r,o,a,h){Promise.resolve(h).then(function(c){r({value:c,done:a})},o)}}typeof SuppressedError=="function"&&SuppressedError;function H(n){return typeof n=="function"}function pr(n){var t=function(s){Error.call(s),s.stack=new Error().stack},e=n(t);return e.prototype=Object.create(Error.prototype),e.prototype.constructor=e,e}var gr=pr(function(n){return function(e){n(this),this.message=e?e.length+` errors occurred during unsubscription:
25
+ `+e.map(function(s,i){return i+1+") "+s.toString()}).join(`
26
+ `):"",this.name="UnsubscriptionError",this.errors=e}});function Bs(n,t){if(n){var e=n.indexOf(t);0<=e&&n.splice(e,1)}}var fs=function(){function n(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}return n.prototype.unsubscribe=function(){var t,e,s,i,r;if(!this.closed){this.closed=!0;var o=this._parentage;if(o)if(this._parentage=null,Array.isArray(o))try{for(var a=$e(o),h=a.next();!h.done;h=a.next()){var c=h.value;c.remove(this)}}catch(y){t={error:y}}finally{try{h&&!h.done&&(e=a.return)&&e.call(a)}finally{if(t)throw t.error}}else o.remove(this);var l=this.initialTeardown;if(H(l))try{l()}catch(y){r=y instanceof gr?y.errors:[y]}var u=this._finalizers;if(u){this._finalizers=null;try{for(var m=$e(u),f=m.next();!f.done;f=m.next()){var p=f.value;try{Fh(p)}catch(y){r=r??[],y instanceof gr?r=Ve(Ve([],Ce(r)),Ce(y.errors)):r.push(y)}}}catch(y){s={error:y}}finally{try{f&&!f.done&&(i=m.return)&&i.call(m)}finally{if(s)throw s.error}}}if(r)throw new gr(r)}},n.prototype.add=function(t){var e;if(t&&t!==this)if(this.closed)Fh(t);else{if(t instanceof n){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=(e=this._finalizers)!==null&&e!==void 0?e:[]).push(t)}},n.prototype._hasParent=function(t){var e=this._parentage;return e===t||Array.isArray(e)&&e.includes(t)},n.prototype._addParent=function(t){var e=this._parentage;this._parentage=Array.isArray(e)?(e.push(t),e):e?[e,t]:t},n.prototype._removeParent=function(t){var e=this._parentage;e===t?this._parentage=null:Array.isArray(e)&&Bs(e,t)},n.prototype.remove=function(t){var e=this._finalizers;e&&Bs(e,t),t instanceof n&&t._removeParent(this)},n.EMPTY=function(){var t=new n;return t.closed=!0,t}(),n}(),Bh=fs.EMPTY;function Nh(n){return n instanceof fs||n&&"closed"in n&&H(n.remove)&&H(n.add)&&H(n.unsubscribe)}function Fh(n){H(n)?n():n.unsubscribe()}var Yh={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},yr={setTimeout:function(n,t){for(var e=[],s=2;s<arguments.length;s++)e[s-2]=arguments[s];var i=yr.delegate;return i?.setTimeout?i.setTimeout.apply(i,Ve([n,t],Ce(e))):setTimeout.apply(void 0,Ve([n,t],Ce(e)))},clearTimeout:function(n){var t=yr.delegate;return(t?.clearTimeout||clearTimeout)(n)},delegate:void 0};function Xh(n){yr.setTimeout(function(){throw n})}function Ns(){}function Nn(n){n()}var wr=function(n){de(t,n);function t(e){var s=n.call(this)||this;return s.isStopped=!1,e?(s.destination=e,Nh(e)&&e.add(s)):s.destination=Xm,s}return t.create=function(e,s,i){return new Fn(e,s,i)},t.prototype.next=function(e){this.isStopped||this._next(e)},t.prototype.error=function(e){this.isStopped||(this.isStopped=!0,this._error(e))},t.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,n.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(e){this.destination.next(e)},t.prototype._error=function(e){try{this.destination.error(e)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t}(fs),Nm=Function.prototype.bind;function xr(n,t){return Nm.call(n,t)}var Fm=function(){function n(t){this.partialObserver=t}return n.prototype.next=function(t){var e=this.partialObserver;if(e.next)try{e.next(t)}catch(s){Yn(s)}},n.prototype.error=function(t){var e=this.partialObserver;if(e.error)try{e.error(t)}catch(s){Yn(s)}else Yn(t)},n.prototype.complete=function(){var t=this.partialObserver;if(t.complete)try{t.complete()}catch(e){Yn(e)}},n}(),Fn=function(n){de(t,n);function t(e,s,i){var r=n.call(this)||this,o;if(H(e)||!e)o={next:e??void 0,error:s??void 0,complete:i??void 0};else{var a;r&&Yh.useDeprecatedNextContext?(a=Object.create(e),a.unsubscribe=function(){return r.unsubscribe()},o={next:e.next&&xr(e.next,a),error:e.error&&xr(e.error,a),complete:e.complete&&xr(e.complete,a)}):o=e}return r.destination=new Fm(o),r}return t}(wr);function Yn(n){Xh(n)}function Ym(n){throw n}var Xm={closed:!0,next:Ns,error:Ym,complete:Ns},br=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function Ge(n){return n}function Um(n){return n.length===0?Ge:n.length===1?n[0]:function(e){return n.reduce(function(s,i){return i(s)},e)}}var st=function(){function n(t){t&&(this._subscribe=t)}return n.prototype.lift=function(t){var e=new n;return e.source=this,e.operator=t,e},n.prototype.subscribe=function(t,e,s){var i=this,r=Vm(t)?t:new Fn(t,e,s);return Nn(function(){var o=i,a=o.operator,h=o.source;r.add(a?a.call(r,h):h?i._subscribe(r):i._trySubscribe(r))}),r},n.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(e){t.error(e)}},n.prototype.forEach=function(t,e){var s=this;return e=Uh(e),new e(function(i,r){var o=new Fn({next:function(a){try{t(a)}catch(h){r(h),o.unsubscribe()}},error:r,complete:i});s.subscribe(o)})},n.prototype._subscribe=function(t){var e;return(e=this.source)===null||e===void 0?void 0:e.subscribe(t)},n.prototype[br]=function(){return this},n.prototype.pipe=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Um(t)(this)},n.prototype.toPromise=function(t){var e=this;return t=Uh(t),new t(function(s,i){var r;e.subscribe(function(o){return r=o},function(o){return i(o)},function(){return s(r)})})},n.create=function(t){return new n(t)},n}();function Uh(n){var t;return(t=n??Yh.Promise)!==null&&t!==void 0?t:Promise}function $m(n){return n&&H(n.next)&&H(n.error)&&H(n.complete)}function Vm(n){return n&&n instanceof wr||$m(n)&&Nh(n)}function Gm(n){return H(n?.lift)}function Ot(n){return function(t){if(Gm(t))return t.lift(function(e){try{return n(e,this)}catch(s){this.error(s)}});throw new TypeError("Unable to lift unknown Observable type")}}function ft(n,t,e,s,i){return new qm(n,t,e,s,i)}var qm=function(n){de(t,n);function t(e,s,i,r,o,a){var h=n.call(this,e)||this;return h.onFinalize=o,h.shouldUnsubscribe=a,h._next=s?function(c){try{s(c)}catch(l){e.error(l)}}:n.prototype._next,h._error=r?function(c){try{r(c)}catch(l){e.error(l)}finally{this.unsubscribe()}}:n.prototype._error,h._complete=i?function(){try{i()}catch(c){e.error(c)}finally{this.unsubscribe()}}:n.prototype._complete,h}return t.prototype.unsubscribe=function(){var e;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var s=this.closed;n.prototype.unsubscribe.call(this),!s&&((e=this.onFinalize)===null||e===void 0||e.call(this))}},t}(wr),jm=pr(function(n){return function(){n(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),ds=function(n){de(t,n);function t(){var e=n.call(this)||this;return e.closed=!1,e.currentObservers=null,e.observers=[],e.isStopped=!1,e.hasError=!1,e.thrownError=null,e}return t.prototype.lift=function(e){var s=new $h(this,this);return s.operator=e,s},t.prototype._throwIfClosed=function(){if(this.closed)throw new jm},t.prototype.next=function(e){var s=this;Nn(function(){var i,r;if(s._throwIfClosed(),!s.isStopped){s.currentObservers||(s.currentObservers=Array.from(s.observers));try{for(var o=$e(s.currentObservers),a=o.next();!a.done;a=o.next()){var h=a.value;h.next(e)}}catch(c){i={error:c}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}}})},t.prototype.error=function(e){var s=this;Nn(function(){if(s._throwIfClosed(),!s.isStopped){s.hasError=s.isStopped=!0,s.thrownError=e;for(var i=s.observers;i.length;)i.shift().error(e)}})},t.prototype.complete=function(){var e=this;Nn(function(){if(e._throwIfClosed(),!e.isStopped){e.isStopped=!0;for(var s=e.observers;s.length;)s.shift().complete()}})},t.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(t.prototype,"observed",{get:function(){var e;return((e=this.observers)===null||e===void 0?void 0:e.length)>0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(e){return this._throwIfClosed(),n.prototype._trySubscribe.call(this,e)},t.prototype._subscribe=function(e){return this._throwIfClosed(),this._checkFinalizedStatuses(e),this._innerSubscribe(e)},t.prototype._innerSubscribe=function(e){var s=this,i=this,r=i.hasError,o=i.isStopped,a=i.observers;return r||o?Bh:(this.currentObservers=null,a.push(e),new fs(function(){s.currentObservers=null,Bs(a,e)}))},t.prototype._checkFinalizedStatuses=function(e){var s=this,i=s.hasError,r=s.thrownError,o=s.isStopped;i?e.error(r):o&&e.complete()},t.prototype.asObservable=function(){var e=new st;return e.source=this,e},t.create=function(e,s){return new $h(e,s)},t}(st),$h=function(n){de(t,n);function t(e,s){var i=n.call(this)||this;return i.destination=e,i.source=s,i}return t.prototype.next=function(e){var s,i;(i=(s=this.destination)===null||s===void 0?void 0:s.next)===null||i===void 0||i.call(s,e)},t.prototype.error=function(e){var s,i;(i=(s=this.destination)===null||s===void 0?void 0:s.error)===null||i===void 0||i.call(s,e)},t.prototype.complete=function(){var e,s;(s=(e=this.destination)===null||e===void 0?void 0:e.complete)===null||s===void 0||s.call(e)},t.prototype._subscribe=function(e){var s,i;return(i=(s=this.source)===null||s===void 0?void 0:s.subscribe(e))!==null&&i!==void 0?i:Bh},t}(ds),Vh=function(n){de(t,n);function t(e){var s=n.call(this)||this;return s._value=e,s}return Object.defineProperty(t.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),t.prototype._subscribe=function(e){var s=n.prototype._subscribe.call(this,e);return!s.closed&&e.next(this._value),s},t.prototype.getValue=function(){var e=this,s=e.hasError,i=e.thrownError,r=e._value;if(s)throw i;return this._throwIfClosed(),r},t.prototype.next=function(e){n.prototype.next.call(this,this._value=e)},t}(ds),Gh={now:function(){return(Gh.delegate||Date).now()},delegate:void 0},Hm=function(n){de(t,n);function t(e,s){return n.call(this)||this}return t.prototype.schedule=function(e,s){return this},t}(fs),Xn={setInterval:function(n,t){for(var e=[],s=2;s<arguments.length;s++)e[s-2]=arguments[s];var i=Xn.delegate;return i?.setInterval?i.setInterval.apply(i,Ve([n,t],Ce(e))):setInterval.apply(void 0,Ve([n,t],Ce(e)))},clearInterval:function(n){var t=Xn.delegate;return(t?.clearInterval||clearInterval)(n)},delegate:void 0},Wm=function(n){de(t,n);function t(e,s){var i=n.call(this,e,s)||this;return i.scheduler=e,i.work=s,i.pending=!1,i}return t.prototype.schedule=function(e,s){var i;if(s===void 0&&(s=0),this.closed)return this;this.state=e;var r=this.id,o=this.scheduler;return r!=null&&(this.id=this.recycleAsyncId(o,r,s)),this.pending=!0,this.delay=s,this.id=(i=this.id)!==null&&i!==void 0?i:this.requestAsyncId(o,this.id,s),this},t.prototype.requestAsyncId=function(e,s,i){return i===void 0&&(i=0),Xn.setInterval(e.flush.bind(e,this),i)},t.prototype.recycleAsyncId=function(e,s,i){if(i===void 0&&(i=0),i!=null&&this.delay===i&&this.pending===!1)return s;s!=null&&Xn.clearInterval(s)},t.prototype.execute=function(e,s){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var i=this._execute(e,s);if(i)return i;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},t.prototype._execute=function(e,s){var i=!1,r;try{this.work(e)}catch(o){i=!0,r=o||new Error("Scheduled action threw falsy error")}if(i)return this.unsubscribe(),r},t.prototype.unsubscribe=function(){if(!this.closed){var e=this,s=e.id,i=e.scheduler,r=i.actions;this.work=this.state=this.scheduler=null,this.pending=!1,Bs(r,this),s!=null&&(this.id=this.recycleAsyncId(i,s,null)),this.delay=null,n.prototype.unsubscribe.call(this)}},t}(Hm),qh=function(){function n(t,e){e===void 0&&(e=n.now),this.schedulerActionCtor=t,this.now=e}return n.prototype.schedule=function(t,e,s){return e===void 0&&(e=0),new this.schedulerActionCtor(this,t).schedule(s,e)},n.now=Gh.now,n}(),Jm=function(n){de(t,n);function t(e,s){s===void 0&&(s=qh.now);var i=n.call(this,e,s)||this;return i.actions=[],i._active=!1,i}return t.prototype.flush=function(e){var s=this.actions;if(this._active){s.push(e);return}var i;this._active=!0;do if(i=e.execute(e.state,e.delay))break;while(e=s.shift());if(this._active=!1,i){for(;e=s.shift();)e.unsubscribe();throw i}},t}(qh),vr=new Jm(Wm),Zm=vr,jh=new st(function(n){return n.complete()});function Hh(n){return n&&H(n.schedule)}function Sr(n){return n[n.length-1]}function Qm(n){return H(Sr(n))?n.pop():void 0}function Fs(n){return Hh(Sr(n))?n.pop():void 0}function Km(n,t){return typeof Sr(n)=="number"?n.pop():t}var _r=function(n){return n&&typeof n.length=="number"&&typeof n!="function"};function Wh(n){return H(n?.then)}function Jh(n){return H(n[br])}function Zh(n){return Symbol.asyncIterator&&H(n?.[Symbol.asyncIterator])}function Qh(n){return new TypeError("You provided "+(n!==null&&typeof n=="object"?"an invalid object":"'"+n+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}function tp(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var Kh=tp();function tc(n){return H(n?.[Kh])}function ec(n){return zm(this,arguments,function(){var e,s,i,r;return zh(this,function(o){switch(o.label){case 0:e=n.getReader(),o.label=1;case 1:o.trys.push([1,,9,10]),o.label=2;case 2:return[4,us(e.read())];case 3:return s=o.sent(),i=s.value,r=s.done,r?[4,us(void 0)]:[3,5];case 4:return[2,o.sent()];case 5:return[4,us(i)];case 6:return[4,o.sent()];case 7:return o.sent(),[3,2];case 8:return[3,10];case 9:return e.releaseLock(),[7];case 10:return[2]}})})}function sc(n){return H(n?.getReader)}function _t(n){if(n instanceof st)return n;if(n!=null){if(Jh(n))return ep(n);if(_r(n))return sp(n);if(Wh(n))return np(n);if(Zh(n))return nc(n);if(tc(n))return ip(n);if(sc(n))return rp(n)}throw Qh(n)}function ep(n){return new st(function(t){var e=n[br]();if(H(e.subscribe))return e.subscribe(t);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function sp(n){return new st(function(t){for(var e=0;e<n.length&&!t.closed;e++)t.next(n[e]);t.complete()})}function np(n){return new st(function(t){n.then(function(e){t.closed||(t.next(e),t.complete())},function(e){return t.error(e)}).then(null,Xh)})}function ip(n){return new st(function(t){var e,s;try{for(var i=$e(n),r=i.next();!r.done;r=i.next()){var o=r.value;if(t.next(o),t.closed)return}}catch(a){e={error:a}}finally{try{r&&!r.done&&(s=i.return)&&s.call(i)}finally{if(e)throw e.error}}t.complete()})}function nc(n){return new st(function(t){op(n,t).catch(function(e){return t.error(e)})})}function rp(n){return nc(ec(n))}function op(n,t){var e,s,i,r;return Om(this,void 0,void 0,function(){var o,a;return zh(this,function(h){switch(h.label){case 0:h.trys.push([0,5,6,11]),e=Bm(n),h.label=1;case 1:return[4,e.next()];case 2:if(s=h.sent(),!!s.done)return[3,4];if(o=s.value,t.next(o),t.closed)return[2];h.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return a=h.sent(),i={error:a},[3,11];case 6:return h.trys.push([6,,9,10]),s&&!s.done&&(r=e.return)?[4,r.call(e)]:[3,8];case 7:h.sent(),h.label=8;case 8:return[3,10];case 9:if(i)throw i.error;return[7];case 10:return[7];case 11:return t.complete(),[2]}})})}function me(n,t,e,s,i){s===void 0&&(s=0),i===void 0&&(i=!1);var r=t.schedule(function(){e(),i?n.add(this.schedule(null,s)):this.unsubscribe()},s);if(n.add(r),!i)return r}function ic(n,t){return t===void 0&&(t=0),Ot(function(e,s){e.subscribe(ft(s,function(i){return me(s,n,function(){return s.next(i)},t)},function(){return me(s,n,function(){return s.complete()},t)},function(i){return me(s,n,function(){return s.error(i)},t)}))})}function Cr(n,t){return t===void 0&&(t=0),Ot(function(e,s){s.add(n.schedule(function(){return e.subscribe(s)},t))})}function hp(n,t){return _t(n).pipe(Cr(t),ic(t))}function cp(n,t){return _t(n).pipe(Cr(t),ic(t))}function lp(n,t){return new st(function(e){var s=0;return t.schedule(function(){s===n.length?e.complete():(e.next(n[s++]),e.closed||this.schedule())})})}function up(n,t){return new st(function(e){var s;return me(e,t,function(){s=n[Kh](),me(e,t,function(){var i,r,o;try{i=s.next(),r=i.value,o=i.done}catch(a){e.error(a);return}o?e.complete():e.next(r)},0,!0)}),function(){return H(s?.return)&&s.return()}})}function rc(n,t){if(!n)throw new Error("Iterable cannot be null");return new st(function(e){me(e,t,function(){var s=n[Symbol.asyncIterator]();me(e,t,function(){s.next().then(function(i){i.done?e.complete():e.next(i.value)})},0,!0)})})}function fp(n,t){return rc(ec(n),t)}function dp(n,t){if(n!=null){if(Jh(n))return hp(n,t);if(_r(n))return lp(n,t);if(Wh(n))return cp(n,t);if(Zh(n))return rc(n,t);if(tc(n))return up(n,t);if(sc(n))return fp(n,t)}throw Qh(n)}function Ys(n,t){return t?dp(n,t):_t(n)}function mp(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];var e=Fs(n);return Ys(n,e)}var pp=pr(function(n){return function(){n(this),this.name="EmptyError",this.message="no elements in sequence"}});function gp(n,t){var e=typeof t=="object";return new Promise(function(s,i){var r=new Fn({next:function(o){s(o),r.unsubscribe()},error:i,complete:function(){e?s(t.defaultValue):i(new pp)}});n.subscribe(r)})}function yp(n){return n instanceof Date&&!isNaN(n)}function ot(n,t){return Ot(function(e,s){var i=0;e.subscribe(ft(s,function(r){s.next(n.call(t,r,i++))}))})}var wp=Array.isArray;function xp(n,t){return wp(t)?n.apply(void 0,Ve([],Ce(t))):n(t)}function Tr(n){return ot(function(t){return xp(n,t)})}var bp=Array.isArray,vp=Object.getPrototypeOf,Sp=Object.prototype,_p=Object.keys;function Cp(n){if(n.length===1){var t=n[0];if(bp(t))return{args:t,keys:null};if(Tp(t)){var e=_p(t);return{args:e.map(function(s){return t[s]}),keys:e}}}return{args:n,keys:null}}function Tp(n){return n&&typeof n=="object"&&vp(n)===Sp}function Pp(n,t){return n.reduce(function(e,s,i){return e[s]=t[i],e},{})}function Ep(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];var e=Fs(n),s=Qm(n),i=Cp(n),r=i.args,o=i.keys;if(r.length===0)return Ys([],e);var a=new st(Mp(r,e,o?function(h){return Pp(o,h)}:Ge));return s?a.pipe(Tr(s)):a}function Mp(n,t,e){return e===void 0&&(e=Ge),function(s){oc(t,function(){for(var i=n.length,r=new Array(i),o=i,a=i,h=function(l){oc(t,function(){var u=Ys(n[l],t),m=!1;u.subscribe(ft(s,function(f){r[l]=f,m||(m=!0,a--),a||s.next(e(r.slice()))},function(){--o||s.complete()}))},s)},c=0;c<i;c++)h(c)},s)}}function oc(n,t,e){n?me(e,n,t):t()}function Ap(n,t,e,s,i,r,o,a){var h=[],c=0,l=0,u=!1,m=function(){u&&!h.length&&!c&&t.complete()},f=function(y){return c<s?p(y):h.push(y)},p=function(y){r&&t.next(y),c++;var S=!1;_t(e(y,l++)).subscribe(ft(t,function(w){i?.(w),r?f(w):t.next(w)},function(){S=!0},void 0,function(){if(S)try{c--;for(var w=function(){var v=h.shift();o?me(t,o,function(){return p(v)}):p(v)};h.length&&c<s;)w();m()}catch(v){t.error(v)}}))};return n.subscribe(ft(t,f,function(){u=!0,m()})),function(){a?.()}}function Pr(n,t,e){return e===void 0&&(e=1/0),H(t)?Pr(function(s,i){return ot(function(r,o){return t(s,r,i,o)})(_t(n(s,i)))},e):(typeof t=="number"&&(e=t),Ot(function(s,i){return Ap(s,i,n,e)}))}function ac(n){return n===void 0&&(n=1/0),Pr(Ge,n)}function Ip(){return ac(1)}function hc(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];return Ip()(Ys(n,Fs(n)))}var kp=["addListener","removeListener"],Dp=["addEventListener","removeEventListener"],Lp=["on","off"];function Er(n,t,e,s){if(H(e)&&(s=e,e=void 0),s)return Er(n,t,e).pipe(Tr(s));var i=Ce(zp(n)?Dp.map(function(a){return function(h){return n[a](t,h,e)}}):Rp(n)?kp.map(cc(n,t)):Op(n)?Lp.map(cc(n,t)):[],2),r=i[0],o=i[1];if(!r&&_r(n))return Pr(function(a){return Er(a,t,e)})(_t(n));if(!r)throw new TypeError("Invalid event target");return new st(function(a){var h=function(){for(var c=[],l=0;l<arguments.length;l++)c[l]=arguments[l];return a.next(1<c.length?c:c[0])};return r(h),function(){return o(h)}})}function cc(n,t){return function(e){return function(s){return n[e](t,s)}}}function Rp(n){return H(n.addListener)&&H(n.removeListener)}function Op(n){return H(n.on)&&H(n.off)}function zp(n){return H(n.addEventListener)&&H(n.removeEventListener)}function nt(n,t,e){return e?nt(n,t).pipe(Tr(e)):new st(function(s){var i=function(){for(var o=[],a=0;a<arguments.length;a++)o[a]=arguments[a];return s.next(o.length===1?o[0]:o)},r=n(i);return H(t)?function(){return t(i,r)}:void 0})}function Bp(n,t,e){n===void 0&&(n=0),e===void 0&&(e=Zm);var s=-1;return t!=null&&(Hh(t)?e=t:s=t),new st(function(i){var r=yp(n)?+n-e.now():n;r<0&&(r=0);var o=0;return e.schedule(function(){i.closed||(i.next(o++),0<=s?this.schedule(void 0,s):i.complete())},r)})}function Np(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];var e=Fs(n),s=Km(n,1/0),i=n;return i.length?i.length===1?_t(i[0]):ac(s)(Ys(i,e)):jh}var Fp=Array.isArray;function Yp(n){return n.length===1&&Fp(n[0])?n[0]:n}function lc(n,t){return Ot(function(e,s){var i=0;e.subscribe(ft(s,function(r){return n.call(t,r,i++)&&s.next(r)}))})}function Mr(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];return n=Yp(n),n.length===1?_t(n[0]):new st(Xp(n))}function Xp(n){return function(t){for(var e=[],s=function(r){e.push(_t(n[r]).subscribe(ft(t,function(o){if(e){for(var a=0;a<e.length;a++)a!==r&&e[a].unsubscribe();e=null}t.next(o)})))},i=0;e&&!t.closed&&i<n.length;i++)s(i)}}function Te(n,t){return t===void 0&&(t=Ge),n=n??Up,Ot(function(e,s){var i,r=!0;e.subscribe(ft(s,function(o){var a=t(o);(r||!n(i,a))&&(r=!1,i=a,s.next(o))}))})}function Up(n,t){return n===t}function uc(n,t){return t?function(e){return e.pipe(uc(function(s,i){return _t(n(s,i)).pipe(ot(function(r,o){return t(s,r,i,o)}))}))}:Ot(function(e,s){var i=0,r=null,o=!1;e.subscribe(ft(s,function(a){r||(r=ft(s,void 0,function(){r=null,o&&s.complete()}),_t(n(a,i++)).subscribe(r))},function(){o=!0,!r&&s.complete()}))})}function Pe(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];var e=Fs(n);return Ot(function(s,i){(e?hc(n,s,e):hc(n,s)).subscribe(i)})}function Un(n,t){return Ot(function(e,s){var i=null,r=0,o=!1,a=function(){return o&&!i&&s.complete()};e.subscribe(ft(s,function(h){i?.unsubscribe();var c=0,l=r++;_t(n(h,l)).subscribe(i=ft(s,function(u){return s.next(t?t(h,u,l,c++):u)},function(){i=null,a()}))},function(){o=!0,a()}))})}function $p(){return Un(Ge)}function Ar(n){return Ot(function(t,e){_t(n).subscribe(ft(e,function(){return e.complete()},Ns)),!e.closed&&t.subscribe(e)})}function qe(n,t,e){var s=H(n)||t||e?{next:n,error:t,complete:e}:n;return s?Ot(function(i,r){var o;(o=s.subscribe)===null||o===void 0||o.call(s);var a=!0;i.subscribe(ft(r,function(h){var c;(c=s.next)===null||c===void 0||c.call(s,h),r.next(h)},function(){var h;a=!1,(h=s.complete)===null||h===void 0||h.call(s),r.complete()},function(h){var c;a=!1,(c=s.error)===null||c===void 0||c.call(s,h),r.error(h)},function(){var h,c;a&&((h=s.unsubscribe)===null||h===void 0||h.call(s)),(c=s.finalize)===null||c===void 0||c.call(s)}))}):Ge}function Vp(n,t){return Ot(function(e,s){var i=t??{},r=i.leading,o=r===void 0?!0:r,a=i.trailing,h=a===void 0?!1:a,c=!1,l=null,u=null,m=!1,f=function(){u?.unsubscribe(),u=null,h&&(S(),m&&s.complete())},p=function(){u=null,m&&s.complete()},y=function(w){return u=_t(n(w)).subscribe(ft(s,f,p))},S=function(){if(c){c=!1;var w=l;l=null,s.next(w),!m&&y(w)}};e.subscribe(ft(s,function(w){c=!0,l=w,!(u&&!u.closed)&&(o?S():y(w))},function(){m=!0,!(h&&c&&u&&!u.closed)&&s.complete()}))})}function Gp(n,t,e){t===void 0&&(t=vr);var s=Bp(n,t);return Vp(function(){return s},e)}function qp(n,t){return Ot(function(e,s){var i=[],r=function(o){for(;0<i.length;)i.shift().error(o);s.error(o)};_t(n).subscribe(ft(s,function(o){var a=new ds;i.push(a);var h=new fs,c=function(){Bs(i,a),a.complete(),h.unsubscribe()},l;try{l=_t(t(o))}catch(u){r(u);return}s.next(a.asObservable()),h.add(l.subscribe(ft(s,c,Ns,r)))},Ns)),e.subscribe(ft(s,function(o){var a,h,c=i.slice();try{for(var l=$e(c),u=l.next();!u.done;u=l.next()){var m=u.value;m.next(o)}}catch(f){a={error:f}}finally{try{u&&!u.done&&(h=l.return)&&h.call(l)}finally{if(a)throw a.error}}},function(){for(;0<i.length;)i.shift().complete();s.complete()},r,function(){for(;0<i.length;)i.shift().unsubscribe()}))})}function W(n,t,e,s=!1){const i=async r=>{await e(r)};try{n.addEventListener(t,i,s)}catch{n.attachEvent("on"+t,i)}return()=>{try{n.removeEventListener(t,i,s)}catch{n.detachEvent("on"+t,i)}}}function jp(n,t,e,s,i=!1){return W(n||document.body,e,r=>{r.target===t&&s(r)},i)}function Hp(n){n.replaceWith(n.cloneNode(!0))}function $(n,t,e=!1){return Er(n,t,{capture:e})}function Ee(n){if(n.preventDefault){n.preventDefault();return}try{n.returnValue=!1}catch{}}function fc(n){if(n.stopPropagation){n.stopPropagation();return}try{n.cancelBubble=!0}catch{}}const Wp=["click","dblclick","wheel","contextmenu","mousedown","mouseup","mousemove","mouseover","mouseout","mouseenter","mouseleave"],Jp=["keydown","keyup","keypress"],Zp=["touchstart","touchend","touchcancel","touchmove"],Qp=["pointerdown","pointerup","pointercancel","pointermove"],Kp=["dragstart","drag","dragend","dragenter","dragover","dragleave","drop"],tg=["change"];function eg(n,t,e={bubbles:!0,detail:{}}){if(!n)return;let s;try{Wp.includes(t)?s=new MouseEvent(t,e):Jp.includes(t)?s=new KeyboardEvent(t,e):Zp.includes(t)?s=new TouchEvent(t,e):Qp.includes(t)?s=new PointerEvent(t,e):Kp.includes(t)?s=new DragEvent(t,e):tg.includes(t)?s=new Event(t,e):s=new CustomEvent(t,e)}catch{document.createEvent?s=document.createEvent("HTMLEvents").initEvent(t,!0,!0):document.createEventObject&&(s=document.createEventObject())}if(n.dispatchEvent)n.dispatchEvent(s);else if(n.fireEvent&&document.createEventObject)n.fireEvent("on"+t,s);else throw new Error(`Can't fire event : ${t}`)}function sg(n,t){const e=n.changedTouches[0];return new MouseEvent(t,{bubbles:!0,cancelable:!0,view:window,detail:1,screenX:e.screenX,screenY:e.screenY,clientX:e.clientX,clientY:e.clientY,ctrlKey:!1,altKey:!1,shiftKey:!1,metaKey:!1,button:0,relatedTarget:null})}function ng(n,t){let e=document.createElement(n);t="on"+t;let s=t in e;return s||(e.setAttribute(t,"return;"),s=typeof e[t]=="function"),e=null,s}(function(){if(!window.requestAnimationFrame){let n=ut();window.requestAnimationFrame=function(t){const e=ut(),s=Math.max(0,16-(e-n)),i=window.setTimeout(function(){t(e+s)},s);return n=e+s,i}}window.cancelAnimationFrame||(window.cancelAnimationFrame=function(n){clearTimeout(n)})})();function Ir(n){let t=!1;return window.requestAnimationFrame(function e(s){!t&&n(s)&&window.requestAnimationFrame(e)}),()=>{t=!0}}function kr(n,t=0){if(t==0)return n(ut()),()=>{};{const e=ut();return Ir(s=>s-e>=t?(n(s),!1):!0)}}function ig(n,t=0){let e=!1,s=0;const i=ut(),r=o=>{if(e)return;s++;const a=o-i-s*t;n(o,s,t<=a),kr(r,Math.max(0,t-a))};return kr(r,t),()=>{e=!0}}function rg(n,t=20){const e=1e3/t;let s=0,i;return()=>(ut()-s>=e&&(s=ut(),i=n()),i)}window.requestIdleCallback=window.requestIdleCallback||function(n,t){const e=ut();return setTimeout(()=>{const s=ut()-e;n({didTimeout:!0,timeRemaining:()=>Math.max(0,50-s)})},t?.timeout)},window.cancelIdleCallback=window.cancelIdleCallback||function(n){clearTimeout(n)};function dc(n,t){window.requestIdleCallback(e=>{e.timeRemaining()>0||e.didTimeout?n():dc(n,t)},{timeout:t?.timeout})}let $n=0,Dr=0,je=33,Me=33,Lr,Rr=-1;const mc=new MessageChannel,og=mc.port2;mc.port1.onmessage=n=>{Lr&&Lr({didTimeout:Rr==-1?!1:ut()-$n>Rr,timeRemaining:()=>Math.max(0,Dr-ut())})};function ag(n,t){return Lr=n,Rr=typeof t?.timeout=="number"?t?.timeout:-1,requestAnimationFrame(e=>{$n=e;let s=Me+$n-Dr;s<Me&&je<Me?(s<8&&(s=8),Me=s<je?je:s):s>Me&&je>Me?Me=s<je?je:s:je=s,Dr=$n+Me,og.postMessage(null)})}const pc=new ja({concurrency:1,timeRemaining:0});let Or=!1;function gc(n,t){const e=qa({fn:n,name:t?.name,deadline:typeof t?.timeout=="number"?ne()+t.timeout:void 0});pc.addTask(e),!Or&&(Or=!0,ag(s=>{Or=!1,pc.idleCallback(s)}))}class Xs{static _nextId=0;static nextId(){return Xs._nextId++}}const O={Linear:{None:function(n){return n}},Ease:{In:function(n){return Math.pow(n,1.7)}},Quadratic:{In:function(n){return n*n},Out:function(n){return n*(2-n)},InOut:function(n){return(n*=2)<1?.5*n*n:-.5*(--n*(n-2)-1)}},Cubic:{In:function(n){return n*n*n},Out:function(n){return--n*n*n+1},InOut:function(n){return(n*=2)<1?.5*n*n*n:.5*((n-=2)*n*n+2)}},Quartic:{In:function(n){return n*n*n*n},Out:function(n){return 1- --n*n*n*n},InOut:function(n){return(n*=2)<1?.5*n*n*n*n:-.5*((n-=2)*n*n*n-2)}},Quintic:{In:function(n){return n*n*n*n*n},Out:function(n){return--n*n*n*n*n+1},InOut:function(n){return(n*=2)<1?.5*n*n*n*n*n:.5*((n-=2)*n*n*n*n+2)}},Sinusoidal:{In:function(n){return 1-Math.sin((1-n)*Math.PI/2)},Out:function(n){return Math.sin(n*Math.PI/2)},InOut:function(n){return .5*(1-Math.sin(Math.PI*(.5-n)))}},Exponential:{In:function(n){return n===0?0:Math.pow(1024,n-1)},Out:function(n){return n===1?1:1-Math.pow(2,-10*n)},InOut:function(n){return n===0?0:n===1?1:(n*=2)<1?.5*Math.pow(1024,n-1):.5*(-Math.pow(2,-10*(n-1))+2)}},Circular:{In:function(n){return 1-Math.sqrt(1-n*n)},Out:function(n){return Math.sqrt(1- --n*n)},InOut:function(n){return(n*=2)<1?-.5*(Math.sqrt(1-n*n)-1):.5*(Math.sqrt(1-(n-=2)*n)+1)}},Elastic:{In:function(n){return n===0?0:n===1?1:-Math.pow(2,10*(n-1))*Math.sin((n-1.1)*5*Math.PI)},Out:function(n){return n===0?0:n===1?1:Math.pow(2,-10*n)*Math.sin((n-.1)*5*Math.PI)+1},InOut:function(n){return n===0?0:n===1?1:(n*=2,n<1?-.5*Math.pow(2,10*(n-1))*Math.sin((n-1.1)*5*Math.PI):.5*Math.pow(2,-10*(n-1))*Math.sin((n-1.1)*5*Math.PI)+1)}},Back:{In:function(n){return n===1?1:n*n*((1.70158+1)*n-1.70158)},Out:function(n){return n===0?0:--n*n*((1.70158+1)*n+1.70158)+1},InOut:function(n){const t=2.5949095;return(n*=2)<1?.5*(n*n*((t+1)*n-t)):.5*((n-=2)*n*((t+1)*n+t)+2)}},Bounce:{In:function(n){return 1-O.Bounce.Out(1-n)},Out:function(n){return n<1/2.75?7.5625*n*n:n<2/2.75?7.5625*(n-=1.5/2.75)*n+.75:n<2.5/2.75?7.5625*(n-=2.25/2.75)*n+.9375:7.5625*(n-=2.625/2.75)*n+.984375},InOut:function(n){return n<.5?O.Bounce.In(n*2)*.5:O.Bounce.Out(n*2-1)*.5+.5}},generatePow:function(n=4){return n=n<Number.EPSILON?Number.EPSILON:n,n=n>1e4?1e4:n,{In:function(t){return t**n},Out:function(t){return 1-(1-t)**n},InOut:function(t){return t<.5?(t*2)**n/2:(1-(2-t*2)**n)/2+.5}}},random:function(n){return Math.random()},createStep:function(n){return function(t){return Math.floor(t*n)/n}},createNoisyEasing:function(n,t=.1){const e=1-t;return function(s){return t*Math.random()+e*n(s)}},swing:function(n){return n+Math.sin(n*Math.PI*2)/2},causeSeizures:function(n){return n+.2*Math.random()-.1}};function yc(n){switch(n){case O.Quadratic.In:return O.Quadratic.Out;case O.Quadratic.Out:return O.Quadratic.In;case O.Quadratic.InOut:return O.Quadratic.InOut;case O.Cubic.In:return O.Cubic.Out;case O.Cubic.Out:return O.Cubic.In;case O.Cubic.InOut:return O.Cubic.InOut;case O.Quartic.In:return O.Quartic.Out;case O.Quartic.Out:return O.Quartic.In;case O.Quartic.InOut:return O.Quartic.InOut;case O.Quintic.In:return O.Quintic.Out;case O.Quintic.Out:return O.Quintic.In;case O.Quintic.InOut:return O.Quintic.InOut;case O.Sinusoidal.In:return O.Sinusoidal.Out;case O.Sinusoidal.Out:return O.Sinusoidal.In;case O.Sinusoidal.InOut:return O.Sinusoidal.InOut;case O.Exponential.In:return O.Exponential.Out;case O.Exponential.Out:return O.Exponential.In;case O.Exponential.InOut:return O.Exponential.InOut;case O.Circular.In:return O.Circular.Out;case O.Circular.Out:return O.Circular.In;case O.Circular.InOut:return O.Circular.InOut;case O.Elastic.In:return O.Elastic.Out;case O.Elastic.Out:return O.Elastic.In;case O.Elastic.InOut:return O.Elastic.InOut;case O.Back.In:return O.Back.Out;case O.Back.Out:return O.Back.In;case O.Back.InOut:return O.Back.InOut;case O.Bounce.In:return O.Bounce.Out;case O.Bounce.Out:return O.Bounce.In;case O.Bounce.InOut:return O.Bounce.InOut;default:return n}}const hg=4,cg=.001,lg=1e-7,ug=10,Us=11,Vn=1/(Us-1),fg=typeof Float32Array=="function";function wc(n,t){return 1-3*t+3*n}function xc(n,t){return 3*t-6*n}function bc(n){return 3*n}function Gn(n,t,e){return((wc(t,e)*n+xc(t,e))*n+bc(t))*n}function vc(n,t,e){return 3*wc(t,e)*n*n+2*xc(t,e)*n+bc(t)}function dg(n,t,e,s,i){let r,o,a=0;do o=t+(e-t)/2,r=Gn(o,s,i)-n,r>0?e=o:t=o;while(Math.abs(r)>lg&&++a<ug);return o}function mg(n,t,e,s){for(let i=0;i<hg;++i){const r=vc(t,e,s);if(r===0)return t;const o=Gn(t,e,s)-n;t-=o/r}return t}function pg(n){return n}function zr(n,t,e,s){if(!(0<=n&&n<=1&&0<=e&&e<=1))throw new Error("bezier x values must be in [0, 1] range");if(n===t&&e===s)return pg;const i=fg?new Float32Array(Us):new Array(Us);for(let o=0;o<Us;++o)i[o]=Gn(o*Vn,n,e);function r(o){let a=0,h=1;const c=Us-1;for(;h!==c&&i[h]<=o;++h)a+=Vn;--h;const l=(o-i[h])/(i[h+1]-i[h]),u=a+l*Vn,m=vc(u,n,e);return m>=cg?mg(o,u,n,e):m===0?u:dg(o,a,a+Vn,n,e)}return o=>o===0||o===1?o:Gn(r(o),t,s)}function Br(n){switch(n){case"linear":return[0,0,1,1];case"ease":return[.25,.1,.25,1];case"ease-in":return[.42,0,1,1];case"ease-in-out":return[.42,0,.58,1];case"ease-out":return[0,0,.58,1]}}function Sc(n){const[t,e,s,i]=Br(n);return[1-s,1-i,1-t,1-e]}function gg(n){return zr(...Br(n))}function yg(n){return zr(...Sc(n))}const pe={Utils:{Linear:function(n,t,e){return(t-n)*e+n},Factorial:function(){const n=[1];return function(t){let e=1;if(n[t])return n[t];for(let s=t;s>1;s--)e*=s;return n[t]=e,e}}(),Bernstein:function(n,t){const e=pe.Utils.Factorial;return e(n)/e(t)/e(n-t)},CatmullRom:function(n,t,e,s,i){const r=(e-n)*.5,o=(s-t)*.5,a=i*i,h=i*a;return(2*t-2*e+r+o)*h+(-3*t+3*e-2*r-o)*a+r*i+t},QuadraticBezier:(n,t,e,s)=>{const i=1-s;return i*i*n+2*i*s*t+s*s*e},CubicBezier:(n,t,e,s,i)=>{const r=1-i;return r*r*r*n+3*r*r*i*t+3*r*i*i*e+i*i*i*s}},Linear:function(n,t){const e=n.length-1,s=e*t,i=Math.floor(s),r=pe.Utils.Linear;return t<0?r(n[0],n[1],s):t>1?r(n[e],n[e-1],e-s):r(n[i],n[i+1>e?e:i+1],s-i)},Bezier:function(n,t){let e=0;const s=n.length-1,i=Math.pow,r=pe.Utils.Bernstein;for(let o=0;o<=s;o++)e+=i(1-t,s-o)*i(t,o)*n[o]*r(s,o);return e},CatmullRom:function(n,t){const e=n.length-1;let s=e*t,i=Math.floor(s);const r=pe.Utils.CatmullRom;return n[0]===n[e]?(t<0&&(i=Math.floor(s=e*(1+t))),r(n[(i-1+e)%e],n[i],n[(i+1)%e],n[(i+2)%e],s-i)):t<0?n[0]-(r(n[0],n[0],n[1],n[1],-s)-n[0]):t>1?n[e]-(r(n[e],n[e],n[e-1],n[e-1],s-e)-n[e]):r(n[i?i-1:0],n[i],n[e<i+1?e:i+1],n[e<i+2?e:i+2],s-i)}};class _c{_tweens={};_tweensAddedDuringUpdate={};getAll(){return Object.keys(this._tweens).map(t=>this._tweens[t])}removeAll(){this._tweens={}}add(t){this._tweens[t.getId()]=t,this._tweensAddedDuringUpdate[t.getId()]=t}remove(t){delete this._tweens[t.getId()],delete this._tweensAddedDuringUpdate[t.getId()]}update(t=ut(),e=!1){const s=Object.keys(this._tweens);for(let i=0;i<s.length;i++){const r=this._tweens[s[i]],o=!e;r&&r.update(t,o)===!1&&!e&&delete this._tweens[s[i]]}return!!Object.keys(this._tweens).length}}const $t=new _c;class Nr{constructor(t,e=$t){this._object=t,this._group=e}_id=Xs.nextId();_isPlaying=!1;_startTime=0;_delayTime=0;_durationTime=1e3;_isPaused=!1;_pauseStartTime=0;_initialRepeat=0;_repeat=0;_repeatDelayTime;_yoyo=!1;_reversed=!1;_valuesStart={};_valuesEnd={};_valuesStartRepeat={};_easingFunction=O.Linear.None;_interpolationFunction=pe.Linear;_chainedTweens=[];_isChainStopped=!1;_onStartCallback;_onStartCallbackFired=!1;_onEveryStartCallback;_onEveryStartCallbackFired=!1;_onUpdateCallback;_onRepeatCallback;_onCompleteCallback;_onStopCallback;_goToEnd=!1;getId(){return this._id}isPlaying(){return this._isPlaying}isPaused(){return this._isPaused}to(t,e){return this._valuesEnd=Object.create(t),e!==void 0&&(this._durationTime=e),this}duration(t=1e3){return this._durationTime=t,this}start(t=ut()){if(this._isPlaying)return this;if(this._group&&this._group.add(this),this._repeat=this._initialRepeat,this._reversed){this._reversed=!1;for(const e in this._valuesStartRepeat)this._swapEndStartRepeatValues(e),this._valuesStart[e]=this._valuesStartRepeat[e]}return this._isPlaying=!0,this._isPaused=!1,this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._isChainStopped=!1,this._startTime=t,this._startTime+=this._delayTime,this._setupProperties(this._object,this._valuesStart,this._valuesEnd,this._valuesStartRepeat),this}_setupProperties(t,e,s,i){for(const r in s){const o=t[r],a=Array.isArray(o),h=a?"array":typeof o,c=!a&&Array.isArray(s[r]);if(!(h==="undefined"||h==="function")){if(c){let l=s[r];if(l.length===0)continue;l=l.map(this._handleRelativeValue.bind(this,o)),s[r]=[o].concat(l)}if((h==="object"||a)&&o&&!c){e[r]=a?[]:{};for(const l in o)e[r][l]=o[l];i[r]=a?[]:{},this._setupProperties(o,e[r],s[r],i[r])}else typeof e[r]>"u"&&(e[r]=o),a||(e[r]*=1),c?i[r]=s[r].slice().reverse():i[r]=e[r]||0}}}stop(){return this._isChainStopped||(this._isChainStopped=!0,this.stopChainedTweens()),this._isPlaying?(this._group&&this._group.remove(this),this._isPlaying=!1,this._isPaused=!1,this._onStopCallback&&this._onStopCallback(this._object),this):this}end(){return this._goToEnd=!0,this.update(1/0),this}pause(t=ut()){return this._isPaused||!this._isPlaying?this:(this._isPaused=!0,this._pauseStartTime=t,this._group&&this._group.remove(this),this)}resume(t=ut()){return!this._isPaused||!this._isPlaying?this:(this._isPaused=!1,this._startTime+=t-this._pauseStartTime,this._pauseStartTime=0,this._group&&this._group.add(this),this)}stopChainedTweens(){for(let t=0,e=this._chainedTweens.length;t<e;t++)this._chainedTweens[t].stop();return this}group(t=$t){return this._group=t,this}delay(t=0){return this._delayTime=t,this}repeat(t=0){return this._initialRepeat=t,this._repeat=t,this}repeatDelay(t){return this._repeatDelayTime=t,this}yoyo(t=!1){return this._yoyo=t,this}easing(t=O.Linear.None){return this._easingFunction=t,this}interpolation(t=pe.Linear){return this._interpolationFunction=t,this}chain(...t){return this._chainedTweens=t,this}onStart(t){return this._onStartCallback=t,this}onEveryStart(t){return this._onEveryStartCallback=t,this}onUpdate(t){return this._onUpdateCallback=t,this}onRepeat(t){return this._onRepeatCallback=t,this}onComplete(t){return this._onCompleteCallback=t,this}onStop(t){return this._onStopCallback=t,this}update(t=ut(),e=!0){if(this._isPaused)return!0;let s,i;const r=this._startTime+this._durationTime;if(!this._goToEnd&&!this._isPlaying){if(t>r)return!1;e&&this.start(t)}if(this._goToEnd=!1,t<this._startTime)return!0;this._onStartCallbackFired===!1&&(this._onStartCallback&&this._onStartCallback(this._object),this._onStartCallbackFired=!0),this._onEveryStartCallbackFired===!1&&(this._onEveryStartCallback&&this._onEveryStartCallback(this._object),this._onEveryStartCallbackFired=!0),i=(t-this._startTime)/this._durationTime,i=this._durationTime===0||i>1?1:i;const o=this._easingFunction(i);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,o),this._onUpdateCallback&&this._onUpdateCallback(this._object,i),i===1)if(this._repeat>0){isFinite(this._repeat)&&this._repeat--;for(s in this._valuesStartRepeat)!this._yoyo&&typeof this._valuesEnd[s]=="string"&&(this._valuesStartRepeat[s]=this._valuesStartRepeat[s]+parseFloat(this._valuesEnd[s])),this._yoyo&&this._swapEndStartRepeatValues(s),this._valuesStart[s]=this._valuesStartRepeat[s];return this._yoyo&&(this._reversed=!this._reversed),this._repeatDelayTime!==void 0?this._startTime=t+this._repeatDelayTime:this._startTime=t+this._delayTime,this._onRepeatCallback&&this._onRepeatCallback(this._object),this._onEveryStartCallbackFired=!1,!0}else{this._onCompleteCallback&&this._onCompleteCallback(this._object);for(let a=0,h=this._chainedTweens.length;a<h;a++)this._chainedTweens[a].start(this._startTime+this._durationTime);return this._isPlaying=!1,!1}return!0}_updateProperties(t,e,s,i){for(const r in s){if(e[r]===void 0)continue;const o=e[r]||0;let a=s[r];const h=Array.isArray(t[r]),c=Array.isArray(a);!h&&c?t[r]=this._interpolationFunction(a,i):typeof a=="object"&&a?this._updateProperties(t[r],o,a,i):(a=this._handleRelativeValue(o,a),typeof a=="number"&&(t[r]=o+(a-o)*i))}}_handleRelativeValue(t,e){return typeof e!="string"?e:e.charAt(0)==="+"||e.charAt(0)==="-"?t+parseFloat(e):parseFloat(e)}_swapEndStartRepeatValues(t){const e=this._valuesStartRepeat[t],s=this._valuesEnd[t];typeof s=="string"?this._valuesStartRepeat[t]=this._valuesStartRepeat[t]+parseFloat(s):this._valuesStartRepeat[t]=s,this._valuesEnd[t]=e}}const wg=Xs.nextId,xg=$t.getAll.bind($t),bg=$t.removeAll.bind($t),vg=$t.add.bind($t),Sg=$t.remove.bind($t),_g=$t.update.bind($t),Cg={now:ut,Sequence:Xs,Easing:O,Interpolation:pe,Group:_c,Tween:Nr,nextId:wg,getAll:xg,removeAll:bg,add:vg,remove:Sg,update:_g};class Fr{autoStart;startTime;oldTime;elapsedTime;running;constructor(t=!0){this.autoStart=t,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=ut(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0}stop(){this.getElapsedTime(),this.running=!1,this.autoStart=!1}getElapsedTime(){return this.getDelta(),this.elapsedTime}getDelta(){let t=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){const e=ut();t=e-this.oldTime,this.oldTime=e,this.elapsedTime+=t}return t}}class $s{tweens=[];frameDuration;onGroupStart;onGroupComplete;constructor(t){this.frameDuration=t?.frameDuration||1e3,this.onGroupStart=t?.onGroupStart,this.onGroupComplete=t?.onGroupComplete}get count(){return this.tweens.length}clear(){this.tweens=[]}sort(t=!1){Yu(this.tweens,(e,s)=>t?e.delay>s.delay:e.delay<=s.delay)}cloneTweens(t=this.tweens){const e=[];return t.forEach(s=>{const i={...s};delete i.tween,i.fromValues={...i.fromValues},i.toValues={...i.toValues},e.push(i)}),e}addTween(t,e,s){const i={fromValues:t,toValues:e,frames:typeof s?.frames=="number"?s.frames:1,delay:typeof s?.delay=="number"?s.delay:this.tweens.length,easeFunction:s?.easeFunction||O.Linear.None,interpolationFunction:s?.interpolationFunction||pe.Linear,repeat:typeof s?.repeat=="number"?s.repeat:0,yoyo:s?.yoyo||!1,onStart:s?.onStart||(()=>{}),onUpdate:s?.onUpdate||(()=>{}),onComplete:s?.onComplete||(()=>{})};return this.tweens.push(i),this}cancelRequestAnimationCycle=()=>{};runTweens(t){this.cancelRequestAnimationCycle();const e=new Fr,s=this.frameDuration;return new Promise(i=>{this.onGroupStart?.(),this.cancelRequestAnimationCycle=Ir(r=>{if(!this.isPaused){const a=Math.max(0,r-this.pausedDuration),h=Math.max(0,e.getElapsedTime()-this.pausedDuration);t.filter(c=>c.delay*s<=h).forEach(c=>{c.tween||(c.tween=new Nr({...c.fromValues}).to({...c.toValues},c.frames*s).easing(c.easeFunction).interpolation(c.interpolationFunction).repeat(c.repeat).yoyo(c.yoyo).onStart(c.onStart).onUpdate(c.onUpdate).onComplete(c.onComplete),c.tween.start(a)),(c.delay+c.frames*(c.repeat+1))*s>h?c.tween.update(a):(c.tween.isPlaying()&&c.tween.end(),ki(t,c))})}const o=!!t.length;return o||(this.onGroupComplete?.(),i()),o})})}isPaused=!1;pausedClock=new Fr;pausedDuration=0;play(t=this.cloneTweens(this.tweens)){this.isPaused=!1,this.pausedDuration=0,this.runTweens(t)}reverse(){const t=this.cloneTweens(this.tweens);let e=0;t.forEach(s=>{e=Math.max(e,s.delay+s.frames),s.easeFunction=yc(s.easeFunction);const i={...s.toValues};s.toValues={...s.fromValues},s.fromValues={...i}}),t.forEach(s=>{s.delay=e-s.frames}),this.play(t)}pause(){this.pausedClock.start(),this.isPaused=!0}resume(){this.pausedDuration+=this.pausedClock.getElapsedTime(),this.pausedClock.stop(),this.isPaused=!1}}const Vs=new Pf({objectSignature:n=>n.name});function Yr(n,t=Vs){let e=t?.find(s=>s.el==n);return e||(e=ci(n),t.put(e),e)}function qn(n,t,e=Vs){const s=Yr(n,e);s.alternate||(s.alternate=ci(n),as(s.alternate.props,s.props,!0)),t(s.alternate)}function Cc(n=Vs){n.update(t=>{const e=t.alternate;return e&&(li(t,e),t.props=e.props,t.alternate=void 0),!0})}function Tg(n=Vs){Cc(n)}function Xr(n=Vs){gc(()=>Cc(n),{name:"PATCH_VNODES",timeout:50})}function q(n){return n*Math.PI/180}function mt(n){return n*180/Math.PI}function ms(n,t,e=0){return Math.sqrt(n*n+t*t+e*e)}function Ae(n,t,e,s){return ms(e-n,s-t)}function zt(n,t,e,s){let i=Math.atan2(s-t,e-n);return i<0&&(i+=Math.PI*2),i}function Ie(n,t){return{dx:Math.cos(n)*t,dy:Math.sin(n)*t}}function Pg(n,t,e){if(typeof e=="number"){const s=ms(n,t,e);return{x:n/=s,y:t/=s,z:e/=s}}else{const s=ms(n,t);return{x:n/=s,y:t/=s}}}function Eg(n,t,e,s,i=10){if(Math.abs(e-n)<i&&Math.abs(s-t)<i)return"no";const r=mt(zt(n,t,e,s));return r>=-135&&r<=-45?"up":r>45&&r<135?"down":r>=135&&r<=180||r>=-180&&r<-135?"left":"right"}const Tc=Mg("50,nbsp,51,iexcl,52,cent,53,pound,54,curren,55,yen,56,brvbar,57,sect,58,uml,59,copy,5a,ordf,5b,laquo,5c,not,5d,shy,5e,reg,5f,macr,5g,deg,5h,plusmn,5i,sup2,5j,sup3,5k,acute,5l,micro,5m,para,5n,middot,5o,cedil,5p,sup1,5q,ordm,5r,raquo,5s,frac14,5t,frac12,5u,frac34,5v,iquest,60,Agrave,61,Aacute,62,Acirc,63,Atilde,64,Auml,65,Aring,66,AElig,67,Ccedil,68,Egrave,69,Eacute,6a,Ecirc,6b,Euml,6c,Igrave,6d,Iacute,6e,Icirc,6f,Iuml,6g,ETH,6h,Ntilde,6i,Ograve,6j,Oacute,6k,Ocirc,6l,Otilde,6m,Ouml,6n,times,6o,Oslash,6p,Ugrave,6q,Uacute,6r,Ucirc,6s,Uuml,6t,Yacute,6u,THORN,6v,szlig,70,agrave,71,aacute,72,acirc,73,atilde,74,auml,75,aring,76,aelig,77,ccedil,78,egrave,79,eacute,7a,ecirc,7b,euml,7c,igrave,7d,iacute,7e,icirc,7f,iuml,7g,eth,7h,ntilde,7i,ograve,7j,oacute,7k,ocirc,7l,otilde,7m,ouml,7n,divide,7o,oslash,7p,ugrave,7q,uacute,7r,ucirc,7s,uuml,7t,yacute,7u,thorn,7v,yuml,ci,fnof,sh,Alpha,si,Beta,sj,Gamma,sk,Delta,sl,Epsilon,sm,Zeta,sn,Eta,so,Theta,sp,Iota,sq,Kappa,sr,Lambda,ss,Mu,st,Nu,su,Xi,sv,Omicron,t0,Pi,t1,Rho,t3,Sigma,t4,Tau,t5,Upsilon,t6,Phi,t7,Chi,t8,Psi,t9,Omega,th,alpha,ti,beta,tj,gamma,tk,delta,tl,epsilon,tm,zeta,tn,eta,to,theta,tp,iota,tq,kappa,tr,lambda,ts,mu,tt,nu,tu,xi,tv,omicron,u0,pi,u1,rho,u2,sigmaf,u3,sigma,u4,tau,u5,upsilon,u6,phi,u7,chi,u8,psi,u9,omega,uh,thetasym,ui,upsih,um,piv,812,bull,816,hellip,81i,prime,81j,Prime,81u,oline,824,frasl,88o,weierp,88h,image,88s,real,892,trade,89l,alefsym,8cg,larr,8ch,uarr,8ci,rarr,8cj,darr,8ck,harr,8dl,crarr,8eg,lArr,8eh,uArr,8ei,rArr,8ej,dArr,8ek,hArr,8g0,forall,8g2,part,8g3,exist,8g5,empty,8g7,nabla,8g8,isin,8g9,notin,8gb,ni,8gf,prod,8gh,sum,8gi,minus,8gn,lowast,8gq,radic,8gt,prop,8gu,infin,8h0,ang,8h7,and,8h8,or,8h9,cap,8ha,cup,8hb,int,8hk,there4,8hs,sim,8i5,cong,8i8,asymp,8j0,ne,8j1,equiv,8j4,le,8j5,ge,8k2,sub,8k3,sup,8k4,nsub,8k6,sube,8k7,supe,8kl,oplus,8kn,otimes,8l5,perp,8m5,sdot,8o8,lceil,8o9,rceil,8oa,lfloor,8ob,rfloor,8p9,lang,8pa,rang,9ea,loz,9j0,spades,9j3,clubs,9j5,hearts,9j6,diams,ai,OElig,aj,oelig,b0,Scaron,b1,scaron,bo,Yuml,m6,circ,ms,tilde,802,ensp,803,emsp,809,thinsp,80c,zwnj,80d,zwj,80e,lrm,80f,rlm,80j,ndash,80k,mdash,80o,lsquo,80p,rsquo,80q,sbquo,80s,ldquo,80t,rdquo,80u,bdquo,810,dagger,811,Dagger,81g,permil,81p,lsaquo,81q,rsaquo,85c,euro",32);function Mg(n,t=10){const e={},s=n.split(",");for(let i=0;i<s.length;i+=2){const r="&"+s[i+1]+";",o=parseInt(s[i],t);e[r]="&#"+o+";"}return e["\\xa0"]="&#160;",e}function Pt(n,t){const e=Object.keys(t);for(let s=0;s<e.length;s++)n=n.replace(new RegExp("{"+e[s]+"}","gi"),""+t[e[s]]);return n}function jn(n){let t,e;if(!n)throw new Error("cannot create a random attribute name for an undefined object");const s="ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz";t="";do for(t="",e=0;e<12;e++)t+=s[Math.floor(Math.random()*s.length)];while(n[t]);return t}function Ag(n){const t={left:"start",right:"end",center:"middle",start:"start",end:"end"};return t[n]||t.start}function Ig(n){const t={alphabetic:"alphabetic",hanging:"hanging",top:"text-before-edge",bottom:"text-after-edge",middle:"central"};return t[n]||t.alphabetic}const Gs={strokeStyle:{svgAttr:"stroke",canvas:"#000000",svg:"none",apply:"stroke"},fillStyle:{svgAttr:"fill",canvas:"#000000",svg:null,apply:"fill"},lineCap:{svgAttr:"stroke-linecap",canvas:"butt",svg:"butt",apply:"stroke"},lineJoin:{svgAttr:"stroke-linejoin",canvas:"miter",svg:"miter",apply:"stroke"},miterLimit:{svgAttr:"stroke-miterlimit",canvas:10,svg:4,apply:"stroke"},lineWidth:{svgAttr:"stroke-width",canvas:1,svg:1,apply:"stroke"},globalAlpha:{svgAttr:"opacity",canvas:1,svg:1,apply:"fill stroke"},font:{canvas:"10px sans-serif"},shadowColor:{canvas:"#000000"},shadowOffsetX:{canvas:0},shadowOffsetY:{canvas:0},shadowBlur:{canvas:0},textAlign:{canvas:"start"},textBaseline:{canvas:"alphabetic"},lineDash:{svgAttr:"stroke-dasharray",canvas:[],svg:null,apply:"stroke"},lineDashOffset:{svgAttr:"stroke-dashoffset",canvas:0,svg:0,apply:"stroke"}};let Hn=class{__root;__ctx;constructor(t,e){this.__root=t,this.__ctx=e}addColorStop(t,e){const s=this.__ctx.__createElement("stop");if(s.setAttribute("offset",""+t),e.indexOf("rgba")!==-1){const r=/rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d?\.?\d*)\s*\)/gi.exec(e);r&&(s.setAttribute("stop-color",Pt("rgb({r},{g},{b})",{r:r[1],g:r[2],b:r[3]})),s.setAttribute("stop-opacity",r[4]))}else s.setAttribute("stop-color",e);this.__root.appendChild(s)}},Ur=class{__root;__ctx;constructor(t,e){this.__root=t,this.__ctx=e}},Pc=class pa{__document=document;__canvas;__ctx;width;height;__styleStack;__groupStack;__rootSVG;__ids;__SVGdefs;__currentElement;__currentElementsToStyle=null;constructor({canvas:t,width:e=500,height:s=500}){t?(this.__canvas=t,this.__ctx=t.getContext("2d"),this.width=t.width,this.height=t.height):(this.__canvas=this.__document.createElement("canvas"),this.__ctx=this.__canvas.getContext("2d"),this.width=e,this.height=s),this.__setDefaultStyles(),this.__styleStack=[this.__getStyleState()],this.__groupStack=[],this.__rootSVG=this.__document.createElementNS("http://www.w3.org/2000/svg","svg"),this.__rootSVG.setAttribute("version","1.1"),this.__rootSVG.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.__rootSVG.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink","http://www.w3.org/1999/xlink"),this.__rootSVG.setAttribute("width",""+this.width),this.__rootSVG.setAttribute("height",""+this.height),this.__ids={},this.__SVGdefs=this.__document.createElementNS("http://www.w3.org/2000/svg","defs"),this.__rootSVG.appendChild(this.__SVGdefs),this.__currentElement=this.__document.createElementNS("http://www.w3.org/2000/svg","g"),this.__rootSVG.appendChild(this.__currentElement)}__setDefaultStyles(){const t=Object.keys(Gs);for(let e=0,s=t.length;e<s;e++){const i=t[e];this[i]=Gs[i].canvas}}__getStyleState(){const t={},e=Object.keys(Gs);for(let s=0,i=e.length;s<i;s++){const r=e[s];t[r]=this[r]}return t}__applyStyleState(t){const e=Object.keys(t);for(let s=0,i=e.length;s<i;s++){const r=e[s];this[r]=t[r]}}__createElement(t,e={},s=!1){const i=this.__document.createElementNS("http://www.w3.org/2000/svg",t),r=Object.keys(e);s&&(i.setAttribute("fill","none"),i.setAttribute("stroke","none"));for(let o=0;o<r.length;o++){const a=r[o];i.setAttribute(a,e[a])}return i}__applyStyleToCurrentElement(t){let e=this.__currentElement;const s=this.__currentElementsToStyle;s&&(e.setAttribute(t,""),e=s.element,s.children.forEach(r=>{r.setAttribute(t,"")}));const i=Object.keys(Gs);for(let r=0;r<i.length;r++){const o=Gs[i[r]],a=this[i[r]];if(o.apply){if(a instanceof Ur){if(a.__ctx)for(;a.__ctx.__SVGdefs.childNodes.length;){const h=a.__ctx.__SVGdefs.childNodes[0].getAttribute("id");this.__ids[h]=h,this.__SVGdefs.appendChild(a.__ctx.__SVGdefs.childNodes[0])}e.setAttribute(o.apply,Pt("url(#{id})",{id:a.__root.getAttribute("id")}))}else if(a instanceof Hn)e.setAttribute(o.apply,Pt("url(#{id})",{id:a.__root.getAttribute("id")}));else if(o.apply.indexOf(t)!==-1&&o.svg!==a)if((o.svgAttr==="stroke"||o.svgAttr==="fill")&&a.indexOf("rgba")!==-1){const c=/rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d?\.?\d*)\s*\)/gi.exec(a);if(c){e.setAttribute(o.svgAttr,Pt("rgb({r},{g},{b})",{r:c[1],g:c[2],b:c[3]}));let l=parseFloat(c[4]);const u=this.globalAlpha;u!=null&&(l*=u),e.setAttribute(o.svgAttr+"-opacity",""+l)}}else{let h=o.svgAttr;if(i[r]==="globalAlpha"&&(h=t+"-"+o.svgAttr,e.getAttribute(h)))continue;h&&e.setAttribute(h,a)}}}}__closestGroupOrSvg(t){return t=t||this.__currentElement,t.nodeName==="g"||t.nodeName==="svg"?t:this.__closestGroupOrSvg(t.parentNode)}getSerializedSvg(t){let e=new XMLSerializer().serializeToString(this.__rootSVG);if(/xmlns="http:\/\/www\.w3\.org\/2000\/svg".+xmlns="http:\/\/www\.w3\.org\/2000\/svg/gi.test(e)&&(e=e.replace('xmlns="http://www.w3.org/2000/svg','xmlns:xlink="http://www.w3.org/1999/xlink')),t){const i=Object.keys(Tc);for(let r=0,o=i.length;r<o;r++){const a=i[r],h=Tc[a],c=new RegExp(a,"gi");c.test(e)&&(e=e.replace(c,h))}}return e}getSvg(){return this.__rootSVG}save(){const t=this.__createElement("g"),e=this.__closestGroupOrSvg();this.__groupStack.push(e),e.appendChild(t),this.__currentElement=t,this.__styleStack.push(this.__getStyleState())}restore(){this.__currentElementsToStyle=null;const t=this.__groupStack.pop();t?this.__currentElement=t:this.__currentElement=this.__rootSVG.childNodes[1];const e=this.__styleStack.pop();e&&this.__applyStyleState(e)}__addTransform(t){const e=this.__closestGroupOrSvg();if(e.childNodes.length>0){this.__currentElement.nodeName==="path"&&(this.__currentElementsToStyle||(this.__currentElementsToStyle={element:e,children:[]}),this.__currentElementsToStyle.children.push(this.__currentElement),this.__applyCurrentDefaultPath());const i=this.__createElement("g");e.appendChild(i),this.__currentElement=i}let s=this.__currentElement.getAttribute("transform");s?s+=" ":s="",s+=t,this.__currentElement.setAttribute("transform",s)}scale(t,e){e===void 0&&(e=t),this.__addTransform(Pt("scale({x},{y})",{x:t,y:e}))}rotate(t){const e=t*180/Math.PI;this.__addTransform(Pt("rotate({angle},{cx},{cy})",{angle:e,cx:0,cy:0}))}translate(t,e){this.__addTransform(Pt("translate({x},{y})",{x:t,y:e}))}transform(t,e,s,i,r,o){this.__addTransform(Pt("matrix({a},{b},{c},{d},{e},{f})",{a:t,b:e,c:s,d:i,e:r,f:o}))}beginPath(){this.__currentDefaultPath="",this.__currentPosition={};const t=this.__createElement("path",{},!0);this.__closestGroupOrSvg().appendChild(t),this.__currentElement=t}__applyCurrentDefaultPath(){const t=this.__currentElement;t.nodeName==="path"&&t.setAttribute("d",this.__currentDefaultPath)}__addPathCommand(t){this.__currentDefaultPath+=" ",this.__currentDefaultPath+=t}moveTo(t,e){this.__currentElement.nodeName!=="path"&&this.beginPath(),this.__currentPosition={x:t,y:e},this.__addPathCommand(Pt("M {x} {y}",this.__currentPosition))}closePath(){this.__currentDefaultPath&&this.__addPathCommand("Z")}lineTo(t,e){this.__currentPosition={x:t,y:e},this.__currentDefaultPath.indexOf("M")>-1?this.__addPathCommand(Pt("L {x} {y}",this.__currentPosition)):this.__addPathCommand(Pt("M {x} {y}",this.__currentPosition))}bezierCurveTo(t,e,s,i,r,o){this.__currentPosition={x:r,y:o},this.__addPathCommand(Pt("C {cp1x} {cp1y} {cp2x} {cp2y} {x} {y}",{cp1x:t,cp1y:e,cp2x:s,cp2y:i,x:r,y:o}))}quadraticCurveTo(t,e,s,i){this.__currentPosition={x:s,y:i},this.__addPathCommand(Pt("Q {cpx} {cpy} {x} {y}",{cpx:t,cpy:e,x:s,y:i}))}normalize(t){const e=Math.sqrt(t[0]*t[0]+t[1]*t[1]);return[t[0]/e,t[1]/e]}arcTo(t,e,s,i,r){const o=this.__currentPosition&&this.__currentPosition.x,a=this.__currentPosition&&this.__currentPosition.y;if(typeof o>"u"||typeof a>"u")return;if(r<0)throw new Error("IndexSizeError: The radius provided ("+r+") is negative.");if(o===t&&a===e||t===s&&e===i||r===0){this.lineTo(t,e);return}const h=this.normalize([o-t,a-e]),c=this.normalize([s-t,i-e]);if(h[0]*c[1]===h[1]*c[0]){this.lineTo(t,e);return}const l=h[0]*c[0]+h[1]*c[1],u=Math.acos(Math.abs(l)),m=this.normalize([h[0]+c[0],h[1]+c[1]]),f=r/Math.sin(u/2),p=t+f*m[0],y=e+f*m[1],S=[-h[1],h[0]],w=[c[1],-c[0]],v=function(P){const C=P[0];return P[1]>=0?Math.acos(C):-Math.acos(C)},x=v(S),b=v(w);this.lineTo(p+S[0]*r,y+S[1]*r),this.arc(p,y,r,x,b)}stroke(){this.__currentElement.nodeName==="path"&&this.__currentElement.setAttribute("paint-order","fill stroke markers"),this.__applyCurrentDefaultPath(),this.__applyStyleToCurrentElement("stroke")}fill(){this.__currentElement.nodeName==="path"&&this.__currentElement.setAttribute("paint-order","stroke fill markers"),this.__applyCurrentDefaultPath(),this.__applyStyleToCurrentElement("fill")}rect(t,e,s,i){this.__currentElement.nodeName!=="path"&&this.beginPath(),this.moveTo(t,e),this.lineTo(t+s,e),this.lineTo(t+s,e+i),this.lineTo(t,e+i),this.lineTo(t,e),this.closePath()}fillRect(t,e,s,i){const r=this.__createElement("rect",{x:t,y:e,width:s,height:i},!0);this.__closestGroupOrSvg().appendChild(r),this.__currentElement=r,this.__applyStyleToCurrentElement("fill")}strokeRect(t,e,s,i){const r=this.__createElement("rect",{x:t,y:e,width:s,height:i},!0);this.__closestGroupOrSvg().appendChild(r),this.__currentElement=r,this.__applyStyleToCurrentElement("stroke")}__clearCanvas(){const e=this.__closestGroupOrSvg().getAttribute("transform"),s=this.__rootSVG.childNodes[1],i=s.childNodes;for(let r=i.length-1;r>=0;r--)i[r]&&s.removeChild(i[r]);this.__currentElement=s,this.__groupStack=[],e&&this.__addTransform(e)}clearRect(t,e,s,i){if(t===0&&e===0&&s===this.width&&i===this.height){this.__clearCanvas();return}const r=this.__closestGroupOrSvg(),o=this.__createElement("rect",{x:t,y:e,width:s,height:i,fill:"#FFFFFF"},!0);r.appendChild(o)}createLinearGradient(t,e,s,i){const r=this.__createElement("linearGradient",{id:jn(this.__ids),x1:t+"px",x2:s+"px",y1:e+"px",y2:i+"px",gradientUnits:"userSpaceOnUse"},!1);return this.__SVGdefs.appendChild(r),new Hn(r,this)}createRadialGradient(t,e,s,i,r,o){const a=this.__createElement("radialGradient",{id:jn(this.__ids),cx:i+"px",cy:r+"px",r:o+"px",fx:t+"px",fy:e+"px",gradientUnits:"userSpaceOnUse"},!1);return this.__SVGdefs.appendChild(a),new Hn(a,this)}__parseFont(){const e=/^\s*(?=(?:(?:[-a-z]+\s*){0,2}(italic|oblique))?)(?=(?:(?:[-a-z]+\s*){0,2}(small-caps))?)(?=(?:(?:[-a-z]+\s*){0,2}(bold(?:er)?|lighter|[1-9]00))?)(?:(?:normal|\1|\2|\3)\s*){0,3}((?:xx?-)?(?:small|large)|medium|smaller|larger|[.\d]+(?:%|in|[cem]m|ex|p[CustomCanvasContext]))(?:\s*\/\s*(normal|[.\d]+(?:%|in|[cem]m|ex|p[CustomCanvasContext])))?\s*([-,'"\sa-z0-9]+?)\s*$/i.exec(this.font),s={style:e[1]||"normal",size:e[4]||"10px",family:e[6]||"sans-serif",weight:e[3]||"normal",decoration:e[2]||"normal",href:null};return this.__fontUnderline==="underline"&&(s.decoration="underline"),this.__fontHref&&(s.href=this.__fontHref),s}__wrapTextLink(t,e){if(t.href){const s=this.__createElement("a");return s.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",t.href),s.appendChild(e),s}return e}__applyText(t,e,s,i){const r=this.__parseFont(),o=this.__closestGroupOrSvg(),a=this.__createElement("text",{"font-family":r.family,"font-size":r.size,"font-style":r.style,"font-weight":r.weight,"text-decoration":r.decoration,x:e,y:s,"text-anchor":Ag(this.textAlign),"dominant-baseline":Ig(this.textBaseline)},!0);a.appendChild(this.__document.createTextNode(t)),this.__currentElement=a,this.__applyStyleToCurrentElement(i),o.appendChild(this.__wrapTextLink(r,a))}fillText(t,e,s){this.__applyText(t,e,s,"fill")}strokeText(t,e,s){this.__applyText(t,e,s,"stroke")}measureText(t){return this.__ctx.font=this.font,this.__ctx.measureText(t)}arc(t,e,s,i,r,o){if(i===r)return;i=i%(2*Math.PI),r=r%(2*Math.PI),i===r&&(r=(r+2*Math.PI-.001*(o?-1:1))%(2*Math.PI));const a=t+s*Math.cos(r),h=e+s*Math.sin(r),c=t+s*Math.cos(i),l=e+s*Math.sin(i),u=o?0:1;let m=0,f=r-i;f<0&&(f+=2*Math.PI),o?m=f>Math.PI?0:1:m=f>Math.PI?1:0,this.lineTo(c,l),this.__addPathCommand(Pt("A {rx} {ry} {xAxisRotation} {largeArcFlag} {sweepFlag} {endX} {endY}",{rx:s,ry:s,xAxisRotation:0,largeArcFlag:m,sweepFlag:u,endX:a,endY:h})),this.__currentPosition={x:a,y:h}}clip(){const t=this.__closestGroupOrSvg(),e=this.__createElement("clipPath"),s=jn(this.__ids),i=this.__createElement("g");this.__applyCurrentDefaultPath(),t.removeChild(this.__currentElement),e.setAttribute("id",s),e.appendChild(this.__currentElement),this.__SVGdefs.appendChild(e),t.setAttribute("clip-path",Pt("url(#{id})",{id:s})),t.appendChild(i),this.__currentElement=i}drawImage(...t){let e=t[0],s,i,r,o,a=0,h=0,c,l,u,m,f,p,y,S;if(t.length===3)s=t[1],i=t[2],c=e.width,l=e.height,r=c,o=l;else if(t.length===5)s=t[1],i=t[2],r=t[3],o=t[4],c=e.width,l=e.height;else if(t.length===9)a=t[1],h=t[2],c=t[3],l=t[4],s=t[5],i=t[6],r=t[7],o=t[8];else throw new Error("Invalid number of arguments passed to drawImage: "+arguments.length);const w=this.__closestGroupOrSvg();this.__currentElement;const v="translate("+s+", "+i+")";if(e instanceof pa){if(u=e.getSvg().cloneNode(!0),u.childNodes&&u.childNodes.length>1){for(m=u.childNodes[0];m.childNodes.length;)S=m.childNodes[0].getAttribute("id"),this.__ids[S]=S,this.__SVGdefs.appendChild(m.childNodes[0]);if(f=u.childNodes[1],f){const x=f.getAttribute("transform");let b;x?b=x+" "+v:b=v,f.setAttribute("transform",b),w.appendChild(f)}}}else(e.nodeName==="CANVAS"||e.nodeName==="IMG")&&(p=this.__createElement("image"),p.setAttribute("width",r),p.setAttribute("height",o),p.setAttribute("preserveAspectRatio","none"),(a||h||c!==e.width||l!==e.height)&&(y=this.__document.createElement("canvas"),y.width=r,y.height=o,y.getContext("2d")?.drawImage(e,a,h,c,l,0,0,r,o),e=y),p.setAttribute("transform",v),p.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",e.nodeName==="CANVAS"?e.toDataURL():e.getAttribute("src")),w.appendChild(p))}createPattern(t,e){const s=this.__document.createElementNS("http://www.w3.org/2000/svg","pattern"),i=jn(this.__ids);let r;return s.setAttribute("id",i),t.nodeName==="CANVAS"||t.nodeName==="IMG"?(r=this.__document.createElementNS("http://www.w3.org/2000/svg","image"),r.setAttribute("width",""+t.width),r.setAttribute("height",""+t.height),r.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",t.nodeName==="CANVAS"?t.toDataURL():t.getAttribute("src")),s.appendChild(r),this.__SVGdefs.appendChild(s)):t instanceof pa&&(s.setAttribute("width",""+t.width),s.setAttribute("height",""+t.height),s.appendChild(t.__rootSVG.childNodes[1]),this.__SVGdefs.appendChild(s)),new Ur(s,this)}setLineDash(t){t&&t.length>0?this.lineDash=t.join(","):this.lineDash=null}drawFocusRing(){}createImageData(){}getImageData(){}putImageData(){}globalCompositeOperation(){}setTransform(){}},$r=class{canvas;context;customContext;currentPath2D=new Path2D;path2Ds=[];currentMatrix=new DOMMatrix;hasSetCustomStrokeStyle=!1;hasSetCustomFillStyle=!1;constructor(t,e,s,i=!1){this.canvas=t,this.context=t.getContext("2d",{willReadFrequently:!0}),i&&(this.customContext=new Pc({canvas:this.canvas,width:e||this.canvas.width,height:s||this.canvas.height}))}set lineWidth(t){this.hasSetCustomStrokeStyle=!0,this.context.lineWidth=t,this.customContext&&(this.customContext.lineWidth=t)}get lineWidth(){return this.context.lineWidth}set lineCap(t){this.hasSetCustomStrokeStyle=!0,this.context.lineCap=t,this.customContext&&(this.customContext.lineCap=t)}get lineCap(){return this.context.lineCap}set lineJoin(t){this.hasSetCustomStrokeStyle=!0,this.context.lineJoin=t,this.customContext&&(this.customContext.lineCap=t)}get lineJoin(){return this.context.lineJoin}set lineDashOffset(t){this.hasSetCustomStrokeStyle=!0,this.context.lineDashOffset=t,this.customContext&&(this.customContext.lineDashOffset=t)}get lineDashOffset(){return this.context.lineDashOffset}set miterLimit(t){this.hasSetCustomStrokeStyle=!0,this.context.miterLimit=t,this.customContext&&(this.customContext.miterLimit=t)}get miterLimit(){return this.context.miterLimit}set globalAlpha(t){this.context.globalAlpha=t,this.customContext&&(this.customContext.globalAlpha=t)}get globalAlpha(){return this.context.globalAlpha}set fillStyle(t){this.hasSetCustomFillStyle=!0,typeof t=="string"||t instanceof CanvasGradient||t instanceof CanvasPattern?(this.context.fillStyle=t,this.customContext&&(this.customContext.fillStyle=t)):(this.context.fillStyle=t.gradient,this.customContext&&(this.customContext.fillStyle=t.gradientCustom))}get fillStyle(){return this.context.fillStyle}set strokeStyle(t){this.hasSetCustomStrokeStyle=!0,typeof t=="string"||t instanceof CanvasGradient||t instanceof CanvasPattern?(this.context.strokeStyle=t,this.customContext&&(this.customContext.strokeStyle=t)):(this.context.strokeStyle=t.gradient,this.customContext&&(this.customContext.strokeStyle=t.gradientCustom))}get strokeStyle(){return this.context.strokeStyle}set font(t){this.context.font=t,this.customContext&&(this.customContext.font=t)}get font(){return this.context.font}set textBaseline(t){this.context.textBaseline=t,this.customContext&&(this.customContext.textBaseline=t)}get textBaseline(){return this.context.textBaseline}set textAlign(t){this.context.textAlign=t,this.customContext&&(this.customContext.textAlign=t)}get textAlign(){return this.context.textAlign}fill(t){return t?this.context.fill(t):(this.context.fill(),this.customContext&&this.customContext.fill()),this}fillRect(t,e,s,i){return this.context.fillRect(t,e,s,i),this.customContext&&this.customContext.fillRect(t,e,s,i),this}fillText(t,e,s,i){return this.hasSetCustomFillStyle=!1,this.context.fillText(t,e,s,i),this.customContext&&this.customContext.fillText(t,e,s),this}setLineDash(t){return this.context.setLineDash(t),this.customContext&&this.customContext.setLineDash(t),this}stroke(t){return t?this.context.stroke(t):(this.context.stroke(),this.customContext&&this.customContext.stroke()),this}strokeText(t,e,s,i){return this.context.strokeText(t,e,s,i),this.customContext&&this.customContext.strokeText(t,e,s),this}strokeRect(t,e,s,i){return this.context.strokeRect(t,e,s,i),this.customContext&&this.customContext.strokeRect(t,e,s,i),this}measureText(t){return this.context.measureText(t)}clearRect(t=0,e=0,s=this.canvas.width,i=this.canvas.height){return this.context.clearRect(t,e,s,i),this.customContext&&this.customContext.clearRect(t,e,s,i),this}save(){return this.context.save(),this.customContext&&this.customContext.save(),this.currentMatrix=new DOMMatrix,this.path2Ds.push(this.currentPath2D),this.currentPath2D=new Path2D,this}restore(){return this.context.restore(),this.customContext&&this.customContext.restore(),this.hasSetCustomStrokeStyle=!1,this.hasSetCustomFillStyle=!1,this.currentMatrix=new DOMMatrix,this.currentPath2D=this.path2Ds.pop()||new Path2D,this}beginPath(){return this.context.beginPath(),this.customContext&&this.customContext.beginPath(),this}closePath(){return this.context.closePath(),this.customContext&&this.customContext.closePath(),this.currentPath2D.closePath(),this}changePath2D(t=this.currentPath2D,e=this.currentMatrix){const s=new Path2D;s.addPath(t,e),this.currentPath2D=s}isPointInStroke(...t){return t[0]instanceof Path2D?this.context.isPointInStroke(t[0],t[1],t[2]):this.context.isPointInStroke(t[0],t[1])}isPointInPath(...t){return t[0]instanceof Path2D?this.context.isPointInPath(t[0],t[1],t[2]):this.context.isPointInPath(t[0],t[1])}translate(t,e){return this.context.translate(t,e),this.customContext&&this.customContext.translate(t,e),this.currentMatrix.translate(t,e),this.changePath2D(),this}rotate(t,e=0,s=0){return this.translate(e,s),this.context.rotate(t),this.customContext&&this.customContext.rotate(t),this.currentMatrix.rotate(t),this.translate(-e,-s),this.changePath2D(),this}scale(t,e=t,s=0,i=0){return this.translate(s,i),this.context.scale(t,e),this.customContext&&this.customContext.scale(t,e),this.currentMatrix.scale(t,e),this.translate(-s,-i),this.changePath2D(),this}moveTo(t,e){return this.context.moveTo(t,e),this.customContext&&this.customContext.moveTo(t,e),this.currentPath2D.moveTo(t,e),this}lineTo(t,e){return this.context.lineTo(t,e),this.customContext&&this.customContext.lineTo(t,e),this.currentPath2D.lineTo(t,e),this}arc(t,e,s,i,r,o){return this.context.arc(t,e,s,i,r,o),this.customContext&&this.customContext.arc(t,e,s,i,r,o?-1:1),this.currentPath2D.arc(t,e,s,i,r,o),this}arcTo(t,e,s,i,r){return this.context.arcTo(t,e,s,i,r),this.customContext&&this.customContext.arcTo(t,e,s,i,r),this.currentPath2D.arcTo(t,e,s,i,r),this}ellipse(t,e,s,i,r,o,a,h){return this.context.ellipse(t,e,s,i,r,o,a,h),this.currentPath2D.ellipse(t,e,s,i,r,o,a,h),this}quadraticCurveTo(t,e,s,i){return this.context.quadraticCurveTo(t,e,s,i),this.customContext&&this.customContext.quadraticCurveTo(t,e,s,i),this.currentPath2D.quadraticCurveTo(t,e,s,i),this}bezierCurveTo(t,e,s,i,r,o){return this.context.bezierCurveTo(t,e,s,i,r,o),this.customContext&&this.customContext.bezierCurveTo(t,e,s,i,r,o),this.currentPath2D.bezierCurveTo(t,e,s,i,r,o),this}rect(t,e,s,i){return this.context.rect(t,e,s,i),this.customContext&&this.customContext.rect(t,e,s,i),this.currentPath2D.rect(t,e,s,i),this}createLinearGradient(t,e,s,i,r){const o=this.context.createLinearGradient(t,e,s,i);return r&&Object.entries(r).forEach(([a,h])=>{o.addColorStop(parseFloat(a),h)}),o}createRadialGradient(t,e,s,i,r,o,a){const h=this.context.createRadialGradient(t,e,s,i,r,o);return a&&Object.entries(a).forEach(([c,l])=>{h.addColorStop(parseFloat(c),l)}),h}drawImage(t,...e){if(e.length===0)this.context.drawImage(t,0,0);else if(e.length===2){const s=e[0],i=e[1];this.context.drawImage(t,s,i)}else if(e.length===4){const s=e[0],i=e[1],r=e[2],o=e[3];this.context.drawImage(t,s,i,r,o)}else if(e.length===8){const s=e[0],i=e[1],r=e[2],o=e[3],a=e[4],h=e[5],c=e[6],l=e[7];this.context.drawImage(t,s,i,r,o,a,h,c,l)}else throw new Error("Invalid number of arguments passed to drawImage: "+e.length);return this.customContext&&this.customContext.drawImage(t,...e),this}getImageData(t=0,e=0,s=this.canvas.width,i=this.canvas.height,r){return this.context.getImageData(t,e,s,i,r)}putImageData(t,e=0,s=0){return this.context.putImageData(t,e,s)}createPattern(t,e){return this.context.createPattern(t,e)}toRawSVG(){if(this.customContext){const t=this.customContext.getSerializedSvg(!0),e=this.customContext.getSvg();return{raw:t,element:e}}else return{raw:"",element:null}}},Vr=class{x;y;toX;toY;constructor(t){this.x=t?.x||0,this.y=t?.y||0,this.toX=t?.toX||0,this.toY=t?.toY||0}toSVGPathData(){return[["L",this.toX,this.toY]]}toCanvasContext(t){t.lineTo(this.toX,this.toY)}getBoundingClientRect(){const t=zt(this.x,this.y,this.toX,this.toY);if(t===0){const e=Math.min(this.x,this.toX),s=Math.min(this.y,this.toY),i=Math.max(this.x,this.toX),r=Math.max(this.y,this.toY);return{x:e,y:s,width:i-e,height:r-s}}else{const e=Math.sin(t),s=Math.cos(t),i=s*this.x-e*this.y,r=s*this.toX-e*this.toY,o=s*this.y+e*this.x,a=s*this.toY+e*this.toX;return{x:Math.min(i,r),y:Math.min(o,a),width:Math.max(i,r)-Math.min(i,r),height:Math.max(o,a)-Math.min(o,a)}}}interpolate(t){return{x:this.x+t*(this.toX-this.x),y:this.y+t*(this.toY-this.y)}}intersection(t){const e=this.x,s=this.y,i=t.toX,r=t.toY,o=this.toX-e,a=t.x-i;if(!o&&!a)return null;const h=(this.toY-s)/o,c=(t.y-r)/a;if(o){if(!a)return{x:i,y:h*(i-e)+s}}else return{x:e,y:c*(e-i)+r};const l=(-c*i+r+h*e-s)/(h-c),u=h*(l-e)+s;return isNaN(l)||isNaN(u)?null:{x:l,y:u}}};const kg=class extends Vr{rx;ry;xAxisRotate;largeArcFlag;sweepFlag;constructor(t){super(t),this.rx=t.rx,this.ry=t.ry,this.xAxisRotate=t?.xAxisRotate??0,this.largeArcFlag=t?.largeArcFlag??1,this.sweepFlag=t?.sweepFlag??1,this.toX=t.toX,this.toY=t.toY}toSVGPathData(){return[["A",this.rx,this.ry,this.xAxisRotate,this.largeArcFlag,this.sweepFlag,this.toX,this.toY]]}toCanvasContext(t){const[e,s,i,r,o,a,h]=this.convert(this.x,this.y,this.toX,this.toY,this.rx,this.ry,this.xAxisRotate,this.largeArcFlag,this.sweepFlag);t.ellipse(e,s,i,r,o,a,h,!this.sweepFlag)}convert(t,e,s,i,r,o,a,h,c){const l=a/180*Math.PI,u=(t-s)/2,m=(e-i)/2,f=Math.cos(l)*u+Math.sin(l)*m,p=-Math.sin(l)*u+Math.cos(l)*m,y=f*f/(r*r)+p*p/(o*o);if(y>1){const G=Math.sqrt(y);throw r=G*r,o=G*o,new Error(`Radii are too small to build an arc. Correcting them to ${r}/${o}.`)}const S=Math.sqrt((r*r*o*o-r*r*p*p-o*o*f*f)/(r*r*p*p+o*o*f*f)),w=h!=c?1:-1,v=w*S*r*p/o,x=w*S*-o*f/r,b=(t+s)/2,P=(e+i)/2,C=Math.cos(l)*v-Math.sin(l)*x+b,D=Math.sin(l)*v+Math.cos(l)*x+P,B=(G,J,it,tt)=>(G*tt>=J*it?1:-1)*Math.acos((G*it+J*tt)/(Math.sqrt(G*G+J*J)*Math.sqrt(it*it+tt*tt))),Y=B(1,0,t-C,e-D)-l,V=B(t-C,e-D,s-C,i-D);return[C,D,r,o,l,Y,Y+V]}},Dg=class extends Vr{cx;cy;isLineThrough;constructor(t){super(t),this.cx=t.cx,this.cy=t.cy,this.isLineThrough=typeof t.isLineThrough=="boolean"?t.isLineThrough:!1}toSVGPathData(){if(this.isLineThrough){const t=this.cx*2-(this.x+this.toX)/2,e=this.cy*2-(this.y+this.toY)/2;return[["Q",t,e,this.toX,this.toY]]}else return[["Q",this.cx,this.cy,this.toX,this.toY]]}toCanvasContext(t){if(this.isLineThrough){const e=this.cx*2-(this.x+this.toX)/2,s=this.cy*2-(this.y+this.toY)/2;t.quadraticCurveTo(e,s,this.toX,this.toY)}else t.quadraticCurveTo(this.cx,this.cy,this.toX,this.toY)}getBoundingClientRect(){const t=[this.x,this.toX],e=[this.y,this.toY];let s,i,r,o;for(let c=0;c<2;++c)s=c==0?this.x-2*this.cx+this.toX:this.y-2*this.cy+this.toY,i=c==0?-2*this.x+2*this.cx:-2*this.y+2*this.cy,r=c==0?this.x:this.y,Math.abs(s)>1e-12&&(o=-i/(2*s),0<o&&o<1&&[t,e][c].push(s*o*o+i*o+r));const a={x:Math.min.apply(0,t),y:Math.min.apply(0,e)},h={x:Math.max.apply(0,t),y:Math.max.apply(0,e)};return{x:a.x,y:a.y,width:h.x-a.x,height:h.y-a.y}}interpolate(t){return{x:(1-t)*(1-t)*this.x+2*(1-t)*t*this.cx+t*t*this.toX,y:(1-t)*(1-t)*this.y+2*(1-t)*t*this.cy+t*t*this.toY}}},ke=class dn extends Vr{c1x;c1y;c2x;c2y;constructor(t){super(t),this.c1x=t.c1x,this.c1y=t.c1y,this.c2x=t.c2x,this.c2y=t.c2y}toSVGPathData(){return[["C",this.c1x,this.c1y,this.c2x,this.c2y,this.toX,this.toY]]}toCanvasContext(t){t.bezierCurveTo(this.c1x,this.c1y,this.c2x,this.c2y,this.toX,this.toY)}getBoundingClientRect(){let t=this.c2x-2*this.c1x+this.x-(this.toX-2*this.c2x+this.c1x),e=2*(this.c1x-this.x)-2*(this.c2x-this.c1x),s=this.x-this.c1x,i=(-e+Math.sqrt(e*e-4*t*s))/2/t,r=(-e-Math.sqrt(e*e-4*t*s))/2/t;const o=[this.y,this.toY],a=[this.x,this.toX];let h;const c=[];Math.abs(i)>1e12&&(i=.5),Math.abs(r)>1e12&&(r=.5),i>=0&&i<=1&&(h=this.interpolate(i),a.push(h.x),o.push(h.y),c.push({X:h.x,Y:h.y})),r>=0&&r<=1&&(h=this.interpolate(r),a.push(h.x),o.push(h.y),c.push({X:h.x,Y:h.y})),t=this.c2y-2*this.c1y+this.y-(this.toY-2*this.c2y+this.c1y),e=2*(this.c1y-this.y)-2*(this.c2y-this.c1y),s=this.y-this.c1y,i=(-e+Math.sqrt(e*e-4*t*s))/2/t,r=(-e-Math.sqrt(e*e-4*t*s))/2/t,Math.abs(i)>1e12&&(i=.5),Math.abs(r)>1e12&&(r=.5),i>=0&&i<=1&&(h=this.interpolate(i),a.push(h.x),o.push(h.y),c.push({X:h.x,Y:h.y})),r>=0&&r<=1&&(h=this.interpolate(r),a.push(h.x),o.push(h.y),c.push({X:h.x,Y:h.y}));const l=[],u=c.length;for(let p=0;p<u;p++){for(let y=p+1;y<u;y++)c[p].X===c[y].X&&c[p].Y===c[y].Y&&(y=++p);l.push({X:c[p].X,Y:c[p].Y})}const m={x:Math.min.apply(Math,a),y:Math.min.apply(Math,o)},f={x:Math.max.apply(Math,a),y:Math.max.apply(Math,o)};return{x:m.x,y:m.y,width:f.x-m.x,height:f.y-m.y,dots:l}}interpolate(t){return{x:Math.pow(1-t,3)*this.x+3*Math.pow(1-t,2)*t*this.c1x+3*Math.pow(1-t,1)*Math.pow(t,2)*this.c2x+Math.pow(t,3)*this.toX,y:Math.pow(1-t,3)*this.y+3*Math.pow(1-t,2)*t*this.c1y+3*Math.pow(1-t,1)*Math.pow(t,2)*this.c2y+Math.pow(t,3)*this.toY}}static base3(t,e,s,i,r){const o=-3*e+9*s-9*i+3*r,a=t*o+6*e-12*s+6*i;return t*a-3*e+3*s}static bezlen(t,e,s,i,r,o,a,h,c=1){c=Math.max(0,Math.min(c,1));const l=c/2,u=[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816],m=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472];let f=0;for(let p=0;p<12;p++){const y=l*u[p]+l,S=this.base3(y,t,s,r,a),w=this.base3(y,e,i,o,h);f+=m[p]*Math.sqrt(S*S+w*w)}return l*f}length(t=1){return dn.bezlen(this.x,this.y,this.c1x,this.c1y,this.c2x,this.c2y,this.toX,this.toY,t)}getTatLen(t){const e=this.x,s=this.y,i=this.c1x,r=this.c1y,o=this.c2x,a=this.c2y,h=this.toX,c=this.toY;if(t<0||dn.bezlen(e,s,i,r,o,a,h,c)<t)return 0;const l=1;let u=l/2,m=l-u,f=dn.bezlen(e,s,i,r,o,a,h,c,m);for(;Math.abs(f-t)>.01;)u/=2,m+=(f<t?1:-1)*u,f=dn.bezlen(e,s,i,r,o,a,h,c,m);return m}getPointAtSegmentLength(t){const e=this.getTatLen(t),s=1-e,i=Math.pow(s,3),r=Math.pow(s,2),o=e*e,a=o*e,h=i*this.x+r*3*e*this.c1x+s*3*e*e*this.c2x+a*this.toX,c=i*this.y+r*3*e*this.c1y+s*3*e*e*this.c2y+a*this.toY,l=this.x+2*e*(this.c1x-this.x)+o*(this.c2x-2*this.c1x+this.x),u=this.y+2*e*(this.c1y-this.y)+o*(this.c2y-2*this.c1y+this.y),m=this.c1x+2*e*(this.c2x-this.c1x)+o*(this.toX-2*this.c2x+this.c1x),f=this.c1y+2*e*(this.c2y-this.c1y)+o*(this.toY-2*this.c2y+this.c1y),p=s*this.x+e*this.c1x,y=s*this.y+e*this.c1y,S=s*this.c2x+e*this.toX,w=s*this.c2y+e*this.toY,v=90-Math.atan2(l-m,u-f)*180/Math.PI;return{x:h,y:c,m:{x:l,y:u},n:{x:m,y:f},start:{x:p,y},end:{x:S,y:w},alpha:v}}},qs=Math.PI*2;function Ec(n,t,e,s){const i=n*s-t*e<0?-1:1;let r=n*e+t*s;return r>1&&(r=1),r<-1&&(r=-1),i*Math.acos(r)}function Lg(n,t,e,s,i,r,o,a,h,c){const l=c*(n-e)/2+h*(t-s)/2,u=-h*(n-e)/2+c*(t-s)/2,m=o*o,f=a*a,p=l*l,y=u*u;let S=m*f-m*y-f*p;S<0&&(S=0),S/=m*y+f*p,S=Math.sqrt(S)*(i===r?-1:1);const w=S*o/a*u,v=S*-a/o*l,x=c*w-h*v+(n+e)/2,b=h*w+c*v+(t+s)/2,P=(l-w)/o,C=(u-v)/a,D=(-l-w)/o,B=(-u-v)/a,Y=Ec(1,0,P,C);let V=Ec(P,C,D,B);return r===0&&V>0&&(V-=qs),r===1&&V<0&&(V+=qs),[x,b,Y,V]}function Rg(n,t){const e=1.3333333333333333*Math.tan(t/4),s=Math.cos(n),i=Math.sin(n),r=Math.cos(n+t),o=Math.sin(n+t);return[s,i,s-i*e,i+s*e,r+o*e,o-r*e,r,o]}function Mc(n,t,e,s,i,r,o,a,h){const c=Math.sin(h*qs/360),l=Math.cos(h*qs/360),u=l*(n-e)/2+c*(t-s)/2,m=-c*(n-e)/2+l*(t-s)/2;if(u===0&&m===0)return[];if(o===0||a===0)return[];o=Math.abs(o),a=Math.abs(a);const f=u*u/(o*o)+m*m/(a*a);f>1&&(o*=Math.sqrt(f),a*=Math.sqrt(f));const p=Lg(n,t,e,s,i,r,o,a,c,l),y=[];let S=p[2],w=p[3];const v=Math.max(Math.ceil(Math.abs(w)/(qs/4)),1);w/=v;for(let x=0;x<v;x++)y.push(Rg(S,w)),S+=w;return y.map(x=>{for(let b=0;b<x.length;b+=2){let P=x[b+0],C=x[b+1];P*=o,C*=a;const D=l*P-c*C,B=c*P+l*C;x[b+0]=D+p[0],x[b+1]=B+p[1]}return x})}function Gr(n,t,e,s,i,r){return[n/3+.6666666666666666*e,t/3+.6666666666666666*s,i/3+.6666666666666666*e,r/3+.6666666666666666*s,i,r]}function js(n,t,e,s){return[n,t,e,s,e,s]}const Hs={a:7,c:6,s:4,q:4,t:2,m:2,l:2,h:1,v:1,z:0};class He{static createSVGElement(t="path",e){const s=document.createElementNS.call(document,"http://www.w3.org/2000/svg",t);return e&&oe(s,e),s}static createSvgPath(t,e){return this.createSVGElement("path",{d:t,id:e||Ms()})}static downloadFromSVGElement(t,e="shape"){return Kn(fr(t),`${e}.svg`)}static downloadFromSVGString(t,e="shape"){return Kn(Oi(t),`${e}.svg`)}static getSVGRawStringFromElement(t){return ur(t)}static isSVGPath(t){return typeof t!="string"?!1:(t=t.trim(),/^[mlhvzaqtcs]\s*[-+.0-9][^mlhvzaqtcs]+/i.test(t)&&/[\dz]$/i.test(t))}static SVGPathDataToD(t){return t.map(e=>{if(!e[0])return"";switch(e[0].toLowerCase()){case"a":return`${e[0]} ${e[1]},${e[2]} ${e[3]} ${e[4]},${e[5]} ${e[6]},${e[7]}`;case"c":return`${e[0]} ${e[1]},${e[2]} ${e[3]},${e[4]} ${e[5]},${e[6]}`;case"s":case"q":return`${e[0]} ${e[1]},${e[2]} ${e[3]},${e[4]}`;default:return e[0]+" "+e.slice(1).join(",")}}).join(" ")}static parseSVGPath(t){const e=[];return He.isSVGPath(t)&&t.replace(/([mlhvzaqtcs])([^mlhvzaqtcs]*)/gi,(s,i,r)=>{let o=i.toLowerCase();const a=Li(r);for(o=="m"&&a.length>Hs[o]&&(e.push([i,...a.splice(0,Hs[o])]),o="l",i=i=="m"?"l":"L");a.length;){if(a.length<Hs[o])throw new Error(`parseSVGPath substring:{ ${s} } command:{ ${i} } args:{ ${a} }`);e.push([i,...a.splice(0,Hs[o])])}return o=="z"&&e.push([i]),""}),e}static absolutizeSVGPath(t){let e=0,s=0,i=0,r=0;return t.map(function(o){const a=o[0],h=a.toUpperCase();if(a!=h)switch(o[0]=h,a){case"a":o[6]+=i,o[7]+=r;break;case"v":o[1]+=r;break;case"h":o[1]+=i;break;default:for(let c=1;c<o.length;)o[c++]+=i,o[c++]+=r}switch(h){case"Z":i=e,r=s;break;case"H":i=o[1];break;case"V":r=o[1];break;case"M":i=e=o[1],r=s=o[2];break;default:i=o[o.length-2],r=o[o.length-1]}return o})}static relativeSVGPath(t){let e=0,s=0,i=0,r=0;return t.map(function(o){const a=o[0],h=a.toLowerCase();if(a!=h)switch(o[0]=h,a){case"A":o[6]-=i,o[7]-=r;break;case"V":o[1]-=r;break;case"H":o[1]-=i;break;default:for(let c=1;c<o.length;)o[c++]-=i,o[c++]-=r}switch(h){case"z":i=e,r=s;break;case"h":i+=o[1];break;case"v":r+=o[1];break;case"m":i+=o[1],r+=o[2],e+=o[1],s+=o[2];break;default:i+=o[o.length-2],r+=o[o.length-1]}return o})}static normalizeSVGPath(t){const e=[];let s=0,i=0,r=0,o=0,a=0,h=0,c=0,l=0,u;for(let m=0,f=t.length;m<f;m++){let p=t[m];const y=p[0];switch(y){case"M":s=p[1],i=p[2];break;case"A":const S=Mc(r,o,p[6],p[7],p[4],p[5],p[1],p[2],p[3]);if(!S.length)continue;S.forEach((x,b)=>{const[P,C,D,B,Y,V,G,J]=x;p=["C",D,B,Y,V,G,J],b<S.length-1&&e.push(p)});break;case"S":let w=r,v=o;(u=="C"||u=="S")&&(w+=w-c,v+=v-l),p=["C",w,v,p[1],p[2],p[3],p[4]];break;case"T":u=="Q"||u=="T"?(a=r*2-a,h=o*2-h):(a=r,h=o),p=["C",...Gr(r,o,a,h,p[1],p[2])];break;case"Q":a=p[1],h=p[2],p=["C",...Gr(r,o,p[1],p[2],p[3],p[4])];break;case"L":p=["C",...js(r,o,p[1],p[2])];break;case"H":p=["C",...js(r,o,p[1],o)];break;case"V":p=["C",...js(r,o,r,p[1])];break;case"Z":p=["C",...js(r,o,s,i)];break}u=y,r=p[p.length-2],o=p[p.length-1],p.length>4?(c=p[p.length-4],l=p[p.length-3]):(c=r,l=o),e.push(p)}return e}static catmullRom2bezier(t){const e=[];for(let s=0,i=t.length;i-2>s;s+=2){let r;s==0?r=[{x:t[s],y:t[s+1]},{x:t[s],y:t[s+1]},{x:t[s+2],y:t[s+3]},{x:t[s+4],y:t[s+5]}]:i-4==s?r=[{x:t[s-2],y:t[s-1]},{x:t[s],y:t[s+1]},{x:t[s+2],y:t[s+3]},{x:t[s+2],y:t[s+3]}]:r=[{x:t[s-2],y:t[s-1]},{x:t[s],y:t[s+1]},{x:t[s+2],y:t[s+3]},{x:t[s+4],y:t[s+5]}];const o=[{x:r[1].x,y:r[1].y},{x:(-r[0].x+6*r[1].x+r[2].x)/6,y:(-r[0].y+6*r[1].y+r[2].y)/6},{x:(r[1].x+6*r[2].x-r[3].x)/6,y:(r[1].y+6*r[2].y-r[3].y)/6},{x:r[2].x,y:r[2].y}];e.push(["C",o[1].x,o[1].y,o[2].x,o[2].y,o[3].x,o[3].y])}return e}static zvhToLSVGPath(t){const e=[];let s=["L",0,0],i;for(let r=0,o=t.length;r<o;r++){const a=t[r];switch(a[0]){case"M":s=["L",a[1],a[2]],e.push(a);break;case"Z":e.push(s);break;case"H":i=e[e.length-1]||["L",0,0],e.push(["L",a[1],i[i.length-1]]);break;case"V":i=e[e.length-1]||["L",0,0],e.push(["L",i[i.length-2],a[1]]);break;default:e.push(a)}}return e}static longhandSVGPath(t){const e={S:{to:"C",x:3},T:{to:"Q",x:1}};let s,i=0,r=0;for(let o=0,a=t.length;o<a;o++){const h=t[o],c=e[h[0]];c&&(h[0]=c.to,s&&(s[0]===c.to?(i=2*Number(s[c.x+2])-Number(s[c.x]),r=2*Number(s[c.x+3])-Number(s[c.x+1])):(i=Number(s[s.length-2]),r=Number(s[s.length-1]))),h.splice(1,0,i,r)),s=h}return t}}let Og=class _e{cX;cY;x;y;degree;scalarX;scalarY;startPathX=0;startPathY=0;prevPathX=0;prevPathY=0;normalizedLines=[];constructor(t){this.cX=0,this.cY=0,this.x=t?.x||0,this.y=t?.y||0,typeof t?.centerX=="number"&&typeof t?.centerY=="number"&&(this.cX=t.centerX-this.x,this.cY=t.centerY-this.y),this.degree=t?.degree||0,this.scalarX=1,this.scalarY=1,t?.scalar!==void 0&&(this.scalarX=t.scalar,this.scalarY=t.scalar),t?.scalarX!==void 0&&(this.scalarX=t.scalarX),t?.scalarY!==void 0&&(this.scalarY=t.scalarY),this.reset(t?.d,t?.originMatrix)}reset(t,e){typeof t=="string"?this.resetFromSVGPathData(He.parseSVGPath(t),e):t instanceof _e?this.resetFromSVGPathData(t.toSVGPathData(),e):this.resetFromSVGPathData(t||[],e)}resetFromSVGPathData(t,e){this.normalizedLines=[];const s=He.normalizeSVGPath(He.absolutizeSVGPath(t));this.prevPathX=this.startPathX=0,this.prevPathY=this.startPathY=0;let i=!1;for(let r=0,o=s.length;r<o;r++){const a=s[r];if(a[0]=="M"){i||(i=!0,this.startPathX=a[1],this.startPathY=a[2]),this.prevPathX=a[1],this.prevPathY=a[2];continue}this.appendLine(new ke({c1x:a[1],c1y:a[2],c2x:a[3],c2y:a[4],toX:a[5],toY:a[6]}))}e&&({x:this.startPathX,y:this.startPathY}=e.transformPoint({x:this.startPathX,y:this.startPathY}),{x:this.prevPathX,y:this.prevPathY}=e.transformPoint({x:this.prevPathX,y:this.prevPathY}),this.normalizedLines.forEach(r=>{({x:r.x,y:r.y}=e.transformPoint({x:r.x,y:r.y})),{x:r.c1x,y:r.c1y}=e.transformPoint({x:r.c1x,y:r.c1y}),{x:r.c2x,y:r.c2y}=e.transformPoint({x:r.c2x,y:r.c2y}),{x:r.toX,y:r.toY}=e.transformPoint({x:r.toX,y:r.toY})}))}static fromPolymorphPoints(t){const e=new _e;e.prevPathX=e.startPathX=t[0]||0,e.prevPathY=e.startPathY=t[1]||0;for(let s=2,i=t.length;s+5<i;s+=6)e.appendLine(new ke({c1x:t[s],c1y:t[s+1],c2x:t[s+2],c2y:t[s+3],toX:t[s+4],toY:t[s+5]}));return e}static fromLines(t){const e=new _e;e.prevPathX=e.startPathX=t[0].x||0,e.prevPathY=e.startPathY=t[0].y||0;for(let s=0,i=t.length;s<i;s++)e.appendLine(t[s]);return e}appendLine(t){if(t instanceof kg){Mc(this.prevPathX,this.prevPathY,t.toX,t.toY,t.largeArcFlag,t.sweepFlag,t.rx,t.ry,t.xAxisRotate).forEach(c=>{const[l,u,m,f,p,y,S,w]=c;this.normalizedLines.push(new ke({x:this.prevPathX,y:this.prevPathY,c1x:m,c1y:f,c2x:p,c2y:y,toX:S,toY:w})),this.prevPathX=S,this.prevPathY=w});return}let e,s,i,r,o,a;t instanceof ke?(e=t.c1x,s=t.c1y,i=t.c2x,r=t.c2y,o=t.toX,a=t.toY):t instanceof Dg?[e,s,i,r,o,a]=Gr(this.prevPathX,this.prevPathY,t.cx,t.cy,t.toX,t.toY):[e,s,i,r,o,a]=js(this.prevPathX,this.prevPathY,t.toX,t.toY),this.normalizedLines.push(new ke({x:this.prevPathX,y:this.prevPathY,c1x:e,c1y:s,c2x:i,c2y:r,toX:o,toY:a})),this.prevPathX=o,this.prevPathY=a}toSVGPathData(){const{startPathX:t,startPathY:e,normalizedLines:s}=this.updateTransform(),i=[];i.push(["M",t,e]);for(let r=0,o=s.length;r<o;r++)i.push(...s[r].toSVGPathData());return i}toSVGPathD(){return He.SVGPathDataToD(this.toSVGPathData())}toCanvasContext(t){const{startPathX:e,startPathY:s,normalizedLines:i}=this.updateTransform();t.beginPath(),t.moveTo(e,s),i.forEach(r=>{r.toCanvasContext(t)})}getBoundingClientRect(){const{normalizedLines:t}=this.updateTransform(),e=[],s=[];if(t.forEach(h=>{const c=h.getBoundingClientRect();e.push(c.x,c.x+c.width),s.push(c.y,c.y+c.height)}),e.length==0||s.length==0)return{x:0,y:0,width:0,height:0};const i=Math.min.apply(0,e),r=Math.min.apply(0,s),o=Math.max.apply(0,e),a=Math.max.apply(0,s);return{x:i,y:r,width:o-i,height:a-r}}update(t){this.cX=typeof t.cX=="number"?t.cX:this.cX,this.cY=typeof t.cY=="number"?t.cY:this.cY,this.x=t.x,this.y=t.y,this.degree=t.degree,this.scalarX=t.scalarX,this.scalarY=t.scalarY}updateTransform(){const t=new wt;if(t.translate(this.x+this.cX,this.y+this.cY),t.rotate(this.degree),t.scale(this.scalarX,this.scalarY),t.translate(-this.cX,-this.cY),t.isIdentity)return{startPathX:this.startPathX,startPathY:this.startPathY,normalizedLines:this.normalizedLines};{let e=this.startPathX,s=this.startPathY;({x:e,y:s}=t.transformPoint({x:e,y:s}));const i=[];return this.normalizedLines.forEach(r=>{let o=r.x,a=r.y,h=r.c1x,c=r.c1y,l=r.c2x,u=r.c2y,m=r.toX,f=r.toY;({x:o,y:a}=t.transformPoint({x:o,y:a})),{x:h,y:c}=t.transformPoint({x:h,y:c}),{x:l,y:u}=t.transformPoint({x:l,y:u}),{x:m,y:f}=t.transformPoint({x:m,y:f}),i.push(new ke({x:o,y:a,c1x:h,c1y:c,c2x:l,c2y:u,toX:m,toY:f}))}),{startPathX:e,startPathY:s,normalizedLines:i}}}getTotalLength(){const{normalizedLines:t}=this.updateTransform();return t.reduce((e,s)=>e+=s.length(),0)}getPointAtLength(t){const{normalizedLines:e}=this.updateTransform();let s=0;const i=e.length;for(let r=0;r<i;r++){const o=e[r],a=o.length();if(s+a>=t)return o.getPointAtSegmentLength(t-s);s+=a}return e[i-1].getPointAtSegmentLength(1)}interpolate(t){const{startPathX:e,startPathY:s,normalizedLines:i}=this.updateTransform(),r=i.length;if(r===0)return{x:e,y:s};if(r===1)return i[0].interpolate(t);{let o=t*r,a=i[0];if(o--,o>1)for(let h=1;h<r&&(a=i[h],o>1);h++)o-=1;return a.interpolate(o)}}getSubpath(t,e){if(this.getTotalLength()-e<1e-6)return this.getSubpathsAtLength(this,t);{const s=this.getSubpathsAtLength(this,e,1);return t?this.getSubpathsAtLength(s,t):s}}getSubpathsAtLength(t,e,s){const{startPathX:i,startPathY:r,normalizedLines:o}=t.updateTransform();let a=null,h=0;const c=new _e;c.prevPathX=c.startPathX=i,c.prevPathY=c.startPathY=r;for(let l=0,u=o.length;l<u;l++){const m=o[l],f=m.length();if(h+f>e&&!a){const p=m.getPointAtSegmentLength(e-h);if(c.appendLine(new ke({c1x:p.start.x,c1y:p.start.y,c2x:p.m.x,c2y:p.m.y,toX:p.x,toY:p.y})),s)return c;a=c,c.appendLine(new ke({c1x:p.n.x,c1y:p.n.y,c2x:p.end.x,c2y:p.end.y,toX:m.x,toY:m.y})),h+=f;continue}h+=f,c.appendLine(m)}return c}closestPoint(t,e){const s=this.getTotalLength();let i={x:t,y:e},r=0,o=1/0,a=8;for(let c=0;c<=s;c+=a){const l=this.getPointAtLength(c),u=Math.pow(Ae(l.x,l.y,t,e),2);u<o&&(i=l,r=c,o=u)}for(a/=2;a>.5;){const c=r-a,l=this.getPointAtLength(c),u=Math.pow(Ae(l.x,l.y,t,e),2),m=r+a,f=this.getPointAtLength(m),p=Math.pow(Ae(f.x,f.y,t,e),2);c>=0&&u<o?(i=l,r=c,o=u):m<=s&&p<o?(i=f,r=m,o=p):a/=2}const h=this.getPointAtLength(r+(r===s?-.1:.1));return{point:i,rotation:r>=s?zt(h.x,h.y,i.x,i.y):zt(i.x,i.y,h.x,h.y),distance:Math.sqrt(o)}}get polymorphPoints(){const{startPathX:t,startPathY:e,normalizedLines:s}=this.updateTransform();return[t,e].concat(s.reduce((i,r)=>i.concat([r.c1x,r.c1y,r.c2x,r.c2y,r.toX,r.toY]),[]))}perimeterPoints(){const t=this.polymorphPoints,e=t.length;let s=t[e-2],i=t[e-1],r=0;for(let o=0;o<e;o+=6)r+=Ae(t[o],t[o+1],s,i),s=t[o],i=t[o+1];return Math.floor(r)}expendFill(t){const e=this.polymorphPoints,s=e.length;let i=t-s;const r=Math.ceil(t/s),o=[];o.push(["M",e[0],e[1]]);let a=2;for(;a+5<=s-1;){const h=e[a++],c=e[a++],l=e[a++],u=e[a++],m=e[a++],f=e[a++];o.push(["C",h,c,l,u,m,f]);let p=0;for(;p<r&&i>0;)o.push(["C",m,f,m,f,m,f]),i-=6,p++}return o}static mixPoints(t,e,s){const i=t.length,r=new Array(i);for(let o=0;o<i;o++)r[o]=F(t[o]+(e[o]-t[o])*s,6);return r}static getPathInterpolator(t,e){return s=>Math.abs(s-0)<Number.EPSILON?t:Math.abs(s-1)<Number.EPSILON?e:_e.fromPolymorphPoints(_e.mixPoints(new _e({d:t}).polymorphPoints,new _e({d:e}).polymorphPoints,s)).toSVGPathData()}},zg=class extends _n{id;originD;originMatrix;independentTransformInGroup;forceCXY=!1;cX;cY;x;y;degree;scalarX;scalarY;diffXInGroup;diffYInGroup;diffDegreeInGroup;diffScalarXInGroup;diffScalarYInGroup;vx;vy;ax;ay;mass;attrs;enableDrag;alongPath;isDragging=!1;isMouseIn=!1;targetToAfterDragFree;followMouse;strokeArmyAnts;strokeArmyAntsOffset=0;strokeDashTotalLength=0;isShow=!0;el;pathd;usePathDtoCanvasContext=!1;parent;shapes=[];constructor(t){if(super(),this.id=Ms(),t?.d&&(this.originD=t?.d),t?.originMatrix&&(this.originMatrix=t.originMatrix),this.independentTransformInGroup=typeof t?.independentTransformInGroup=="boolean"?t.independentTransformInGroup:!1,this.x=t?.x||0,this.y=t?.y||0,this.cX=0,this.cY=0,typeof t?.centerX=="number"&&typeof t?.centerY=="number"&&this.forceSetCXY(t.centerX-this.x,t.centerY-this.y),this.degree=t?.degree||0,this.scalarX=1,this.scalarY=1,t?.scalar!==void 0&&(this.scalarX=t.scalar,this.scalarY=t.scalar),t?.scalarX!==void 0&&(this.scalarX=t.scalarX),t?.scalarY!==void 0&&(this.scalarY=t.scalarY),this.diffXInGroup=t?.diffXInGroup||0,this.diffYInGroup=t?.diffYInGroup||0,this.diffDegreeInGroup=t?.diffDegreeInGroup||0,this.diffScalarXInGroup=t?.diffScalarXInGroup||1,this.diffScalarYInGroup=t?.diffScalarYInGroup||1,this.vx=t?.vx||0,this.vy=t?.vy||0,this.ax=t?.ax||0,this.ay=t?.ay||0,this.mass=t?.mass||1,this.attrs={stroke:"none",fill:"none"},t?.attrs&&this.setAttr(t?.attrs),this.enableDrag=t?.enableDrag||!1,this.alongPath=t?.alongPath,this.targetToAfterDragFree=t?.targetToAfterDragFree,this.followMouse=t?.followMouse||!1,this.isShow=typeof t?.isShow=="boolean"?t?.isShow:!0,this.strokeArmyAnts=t?.strokeArmyAnts||!1,this.strokeArmyAnts){const s=this.getAttr("stroke-dasharray","4 4");this.setAttr("stroke-dasharray",s),this.strokeDashTotalLength=Li(s).reduce((i,r)=>i+r,0)}return Ga(this)}forceSetCXY(t,e){this.cX=t,this.cY=e,this.forceCXY=!0}shapeInit(){}initPathD(){if(!this.pathd){if(this.pathd=new Og,Ht(()=>{this.pathd?.reset(this.originD||this.toSVGPathData(),this.originMatrix)}),this.pathd&&!this.forceCXY){const t=this.shapes.length==0?this.pathd.getBoundingClientRect():this.getBoundingClientRect();t&&(this.pathd.cX=this.cX=t.x+t.width/2-this.pathd.x,this.pathd.cY=this.cY=t.y+t.height/2-this.pathd.y)}this.shapeInit()}return this.pathd}frameStart(t){}frameUpdate(t,e){this.pathd=this.initPathD(),this.pathd.update(this),this.strokeArmyAnts&&(this.isMouseIn||(this.setAttr("stroke-dashoffset",String(this.strokeArmyAntsOffset++)),this.strokeArmyAntsOffset>this.strokeDashTotalLength&&(this.strokeArmyAntsOffset=0)))}frameEnd(t){}toSVGPathData(){return[]}toSVGPathD(){return this.pathd?.toSVGPathD()||""}toCanvasContext(t){this.usePathDtoCanvasContext=!0,this.pathd?.toCanvasContext(t)}getBoundingClientRect(){return this.pathd?.getBoundingClientRect()||null}get center(){const t=this.getBoundingClientRect(),e={x:this.x,y:this.y};return t&&(e.x=t.x+t.width/2,e.y=t.y+t.height/2),e}trim(){if(this.parent)return;const t=this.getBoundingClientRect();if(!t)return;this.shapes.forEach(s=>{const i=s.originMatrix?s.originMatrix.clone():new wt;i.translate(-t.x+s.x,-t.y+s.y),s.originMatrix=i});const e=this.originMatrix?this.originMatrix.clone():new wt;e.translate(-t.x+this.x,-t.y+this.y),this.originMatrix=e}isPointInPath(t,e,s){if(s instanceof $r)return s.isPointInPath(new Path2D(this.toSVGPathD()),t,e);let i;try{i=new SVGPoint(t,e)}catch{i=s.createSVGPoint(),i.x=t,i.y=e}if(this.el instanceof SVGGeometryElement)return this.el.isPointInFill(i);{const r=this.getBoundingClientRect();if(r)return t>=r.x&&t<=r.x+r.width&&e>=r.y&&e<=r.y+r.height}return!1}isPointInStroke(t,e,s){if(s instanceof $r)return s.isPointInStroke(new Path2D(this.toSVGPathD()),t,e);let i;try{i=new SVGPoint(t,e)}catch{i=s.createSVGPoint(),i.x=t,i.y=e}return this.el instanceof SVGGeometryElement?this.el.isPointInStroke(i):!1}clone(){return Pa(this).copy(this)}copy(t){return this.id=t.id,this.originD=t.originD,this.originMatrix=t.originMatrix,this.independentTransformInGroup=t.independentTransformInGroup,this.x=t.x,this.y=t.y,this.cX=t.cX,this.cY=t.cY,this.degree=t.degree,this.scalarX=t.scalarX,this.scalarY=t.scalarY,this.diffXInGroup=t.diffXInGroup,this.diffYInGroup=t.diffYInGroup,this.diffDegreeInGroup=t.diffDegreeInGroup,this.diffScalarXInGroup=t.diffScalarXInGroup,this.diffScalarYInGroup=t.diffScalarYInGroup,this.vx=t.vx,this.vy=t.vy,this.ax=t.ax,this.ay=t.ay,this.mass=t.mass,this.attrs={...t.attrs},this.enableDrag=t.enableDrag,this.alongPath=t.alongPath,this.targetToAfterDragFree=t.targetToAfterDragFree,this.followMouse=t.followMouse,this.isShow=t.isShow,this.strokeArmyAnts=t.strokeArmyAnts,this.strokeDashTotalLength=t.strokeDashTotalLength,this}save(){}restore(){}setAttr(t,e){typeof t!="string"?Object.assign(this.attrs,Object.fromEntries(Object.entries(t).map(([s,i])=>[lt(s),i]))):e&&(this.attrs[lt(t)]=e)}getAttr(t,e){return this.attrs[t]||this.attrs[lt(t)]||e}getAttrs(){return this.attrs}hasAttr(t){return!!this.attrs[t]||!!this.attrs[lt(t)]}distance(t){return Ae(this.x,this.y,t.x,t.y)}rotateTo(t){this.degree=mt(zt(this.x,this.y,t.x,t.y))}followTo(t,e=3){this.rotateTo(t);const{dx:s,dy:i}=Ie(q(this.degree),e);this.vx=s,this.vy=i,this.run()}followAccelerationTo(t,e=.05){this.rotateTo(t);const{dx:s,dy:i}=Ie(q(this.degree),e);this.ax=s,this.ay=i,this.run()}checkCollision(t){}checkWall(t){}gravitateTo(t){const e=t.x-this.x,s=t.y-this.y,i=e*e+s*s,r=Math.sqrt(i),o=this.mass*t.mass/i,a=o*e/r,h=o*s/r;this.vx+=a/this.mass,this.vy+=h/this.mass,t.vx-=a/t.mass,t.vy-=h/t.mass}run(t){this.vx+=this.ax,this.vy+=this.ay;const e=jt(t?.gravity,0);this.vy+=e;const s=jt(t?.friction,1);this.vx*=s,this.vy*=s,this.x+=this.vx,this.y+=this.vy}runEaseTo(t,e){const s=jt(e?.easing,.05),i=t.x-this.cX-this.x,r=t.y-this.cY-this.y;this.vx=i*s,this.vy=r*s,this.run(e)}runSpringTo(t,e){const s=jt(e?.spring,.03);(Array.isArray(t)?t:[t]).forEach(i=>{const r=i.x-this.cX-this.x,o=i.y-this.cY-this.y,a=r*s,h=o*s;this.vx+=a,this.vy+=h}),this.run({friction:.9,...e})}springMassTo(t,e){const s=jt(e?.springLength,100),i=jt(e?.spring,1e-4),r=t.x-this.x,o=t.y-this.y,a=Math.sqrt(r*r+o*o);if(a<s){const h=r*i,c=o*i;return this.vx+=h/this.mass,this.vy+=c/this.mass,t.vx-=h/t.mass,t.vy-=c/t.mass,1-a/s}return 0}getTotalLength(){return this.initPathD().getTotalLength()}interpolate(t){return this.initPathD().interpolate(t)}getPointAtLength(t){return this.initPathD().getPointAtLength(t)}trailPath(t,e=0){const s=this.getTotalLength();return t.originD=this.initPathD().getSubpath(0,e*s),this.getPointAtLength(e*s)}strokeDashTween(t=1e3,e){const s=this.initPathD(),i=F(s.getTotalLength(),0);this.setAttr({strokeDasharray:`${i} ${i}`,strokeDashoffset:`${i}`});const r=e?.onUpdate,o=new $s({frameDuration:t});o.addTween({offset:i},{offset:0},Object.assign(e||{},{onUpdate:(a,h)=>{this.setAttr("strokeDashoffset",""+F(a.offset,2)),r?.(a,h)}})),o.play()}};class Bg extends zg{x;y;z;fl;vpX;vpY;cX;cY;cZ;radius;constructor(t){super(t),this.x=t?.x||0,this.y=t?.y||0,this.z=t?.z||0,this.fl=t?.fl||250,this.vpX=t?.vpX||0,this.vpY=t?.vpY||0,this.cX=t?.cX||0,this.cY=t?.cY||0,this.cZ=t?.cZ||0,this.radius=t?.radius||0}toSVGPathData(){return this.radius?[["M",this.getScreenX(),this.getScreenY()-this.radius],["a",this.radius,this.radius,0,1,1,0,2*this.radius],["a",this.radius,this.radius,0,1,1,0,-2*this.radius],["z"]]:[["M",this.getScreenX(),this.getScreenY()]]}toCanvasContext(t){t.beginPath(),t.arc(0,0,this.radius,0,Math.PI*2,!0),t.closePath()}setVanishingPoint(t,e){this.vpX=t,this.vpY=e}setCenter(t,e,s){this.cX=t,this.cY=e,this.cZ=s}rotateX(t){({x:this.y,y:this.z}=Qt(q(t),this.y,this.z))}rotateY(t){({x:this.x,y:this.z}=Qt(q(t),this.x,this.z))}rotateZ(t){({x:this.x,y:this.y}=Qt(q(t),this.x,this.y))}getScreenX(){const t=this.fl/(this.fl+this.z+this.cZ);return this.vpX+(this.cX+this.x)*t}getScreenY(){const t=this.fl/(this.fl+this.z+this.cZ);return this.vpY+(this.cY+this.y)*t}eq(t){return this.x===t.x&&this.y===t.y&&this.z===t.z&&this.radius===t.radius&&this.mass===t.mass}length(){return ms(this.x,this.y,this.z)}distance(t){const e=t.x-this.x,s=t.y-this.y,i=t.z-this.z;return Math.sqrt(e*e+s*s+i*i)}scalar(t){return this.x*=t,this.y*=t,this.z*=t,this}normalize(t=1){const e=this.length();if(e){const s=t/e;this.scalar(s)}return this}clamp(t){const e=this.length();return e&&e>t&&this.scalar(t/e),this}cross(t){const e=this.x,s=this.y,i=this.z;return{x:s*t.z-i*t.y,y:i*t.x-e*t.z,z:e*t.y-s*t.x}}multiply(t){return{x:this.x*t.x,y:this.y*t.y,z:this.z*t.z}}div(t){return{x:this.x/t.x,y:this.y/t.y,z:this.z/t.z}}add(t){return{x:this.x+t.x,y:this.y+t.y,z:this.z+t.z}}sub(t){return{x:this.x-t.x,y:this.y-t.y,z:this.z-t.z}}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z}reflect(t){const e=this.dot(t);return{x:this.x-2*e*t.x,y:this.y-2*e*t.y,z:this.z-2*e*t.z}}}const Wn=Bg;class qr{_x;_y;_z;_w;constructor(t=0,e=0,s=0,i=1){this._x=t,this._y=e,this._z=s,this._w=i}static slerpFlat(t,e,s,i,r,o,a){let h=s[i+0],c=s[i+1],l=s[i+2],u=s[i+3];const m=r[o+0],f=r[o+1],p=r[o+2],y=r[o+3];if(a===0){t[e+0]=h,t[e+1]=c,t[e+2]=l,t[e+3]=u;return}if(a===1){t[e+0]=m,t[e+1]=f,t[e+2]=p,t[e+3]=y;return}if(u!==y||h!==m||c!==f||l!==p){let S=1-a;const w=h*m+c*f+l*p+u*y,v=w>=0?1:-1,x=1-w*w;if(x>Number.EPSILON){const P=Math.sqrt(x),C=Math.atan2(P,w*v);S=Math.sin(S*C)/P,a=Math.sin(a*C)/P}const b=a*v;if(h=h*S+m*b,c=c*S+f*b,l=l*S+p*b,u=u*S+y*b,S===1-a){const P=1/Math.sqrt(h*h+c*c+l*l+u*u);h*=P,c*=P,l*=P,u*=P}}t[e]=h,t[e+1]=c,t[e+2]=l,t[e+3]=u}static multiplyQuaternionsFlat(t,e,s,i,r,o){const a=s[i],h=s[i+1],c=s[i+2],l=s[i+3],u=r[o],m=r[o+1],f=r[o+2],p=r[o+3];return t[e]=a*p+l*u+h*f-c*m,t[e+1]=h*p+l*m+c*u-a*f,t[e+2]=c*p+l*f+a*m-h*u,t[e+3]=l*p-a*u-h*m-c*f,t}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get w(){return this._w}set w(t){this._w=t,this._onChangeCallback()}set(t=this._x,e=this._y,s=this._z,i=this._w){return this._x=t,this._y=e,this._z=s,this._w=i,this._onChangeCallback(),this}clone(){return new qr(this._x,this._y,this._z,this._w)}copy(t){return this._x=t.x,this._y=t.y,this._z=t.z,this._w=t.w,this._onChangeCallback(),this}setFromEuler(t,e=!0){const s=t.x,i=t.y,r=t.z,o=t.order,a=Math.cos,h=Math.sin,c=a(s/2),l=a(i/2),u=a(r/2),m=h(s/2),f=h(i/2),p=h(r/2);switch(o){case"XYZ":this._x=m*l*u+c*f*p,this._y=c*f*u-m*l*p,this._z=c*l*p+m*f*u,this._w=c*l*u-m*f*p;break;case"YXZ":this._x=m*l*u+c*f*p,this._y=c*f*u-m*l*p,this._z=c*l*p-m*f*u,this._w=c*l*u+m*f*p;break;case"ZXY":this._x=m*l*u-c*f*p,this._y=c*f*u+m*l*p,this._z=c*l*p+m*f*u,this._w=c*l*u-m*f*p;break;case"ZYX":this._x=m*l*u-c*f*p,this._y=c*f*u+m*l*p,this._z=c*l*p-m*f*u,this._w=c*l*u+m*f*p;break;case"YZX":this._x=m*l*u+c*f*p,this._y=c*f*u+m*l*p,this._z=c*l*p-m*f*u,this._w=c*l*u-m*f*p;break;case"XZY":this._x=m*l*u-c*f*p,this._y=c*f*u-m*l*p,this._z=c*l*p+m*f*u,this._w=c*l*u+m*f*p;break;default:console.warn("Quaternion: .setFromEuler() encountered an unknown order: "+o)}return e===!0&&this._onChangeCallback(),this}setFromAxisAngle(t,e){const s=e/2,i=Math.sin(s);return this._x=t.x*i,this._y=t.y*i,this._z=t.z*i,this._w=Math.cos(s),this._onChangeCallback(),this}setFromRotationMatrix4(t){const e=t.value,s=e[0],i=e[4],r=e[8],o=e[1],a=e[5],h=e[9],c=e[2],l=e[6],u=e[10],m=s+a+u;if(m>0){const f=.5/Math.sqrt(m+1);this._w=.25/f,this._x=(l-h)*f,this._y=(r-c)*f,this._z=(o-i)*f}else if(s>a&&s>u){const f=2*Math.sqrt(1+s-a-u);this._w=(l-h)/f,this._x=.25*f,this._y=(i+o)/f,this._z=(r+c)/f}else if(a>u){const f=2*Math.sqrt(1+a-s-u);this._w=(r-c)/f,this._x=(i+o)/f,this._y=.25*f,this._z=(h+l)/f}else{const f=2*Math.sqrt(1+u-s-a);this._w=(o-i)/f,this._x=(r+c)/f,this._y=(h+l)/f,this._z=.25*f}return this._onChangeCallback(),this}setFromUnitVectors(t,e){let s=t.dot(e)+1;return s<Number.EPSILON?(s=0,Math.abs(t.x)>Math.abs(t.z)?(this._x=-t.y,this._y=t.x,this._z=0,this._w=s):(this._x=0,this._y=-t.z,this._z=t.y,this._w=s)):(this._x=t.y*e.z-t.z*e.y,this._y=t.z*e.x-t.x*e.z,this._z=t.x*e.y-t.y*e.x,this._w=s),this.normalize()}angleTo(t){return 2*Math.acos(Math.abs(N(this.dot(t),-1,1)))}rotateTowards(t,e){const s=this.angleTo(t);if(s===0)return this;const i=Math.min(1,e/s);return this.slerp(t,i),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(t){return this._x*t._x+this._y*t._y+this._z*t._z+this._w*t._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let t=this.length();return t===0?(this._x=0,this._y=0,this._z=0,this._w=1):(t=1/t,this._x=this._x*t,this._y=this._y*t,this._z=this._z*t,this._w=this._w*t),this._onChangeCallback(),this}multiply(t){return this.multiplyQuaternions(this,t)}premultiply(t){return this.multiplyQuaternions(t,this)}multiplyQuaternions(t,e){const s=t._x,i=t._y,r=t._z,o=t._w,a=e._x,h=e._y,c=e._z,l=e._w;return this._x=s*l+o*a+i*c-r*h,this._y=i*l+o*h+r*a-s*c,this._z=r*l+o*c+s*h-i*a,this._w=o*l-s*a-i*h-r*c,this._onChangeCallback(),this}slerp(t,e){if(e===0)return this;if(e===1)return this.copy(t);const s=this._x,i=this._y,r=this._z,o=this._w;let a=o*t._w+s*t._x+i*t._y+r*t._z;if(a<0?(this._w=-t._w,this._x=-t._x,this._y=-t._y,this._z=-t._z,a=-a):this.copy(t),a>=1)return this._w=o,this._x=s,this._y=i,this._z=r,this;const h=1-a*a;if(h<=Number.EPSILON){const f=1-e;return this._w=f*o+e*this._w,this._x=f*s+e*this._x,this._y=f*i+e*this._y,this._z=f*r+e*this._z,this.normalize(),this}const c=Math.sqrt(h),l=Math.atan2(c,a),u=Math.sin((1-e)*l)/c,m=Math.sin(e*l)/c;return this._w=o*u+this._w*m,this._x=s*u+this._x*m,this._y=i*u+this._y*m,this._z=r*u+this._z*m,this._onChangeCallback(),this}slerpQuaternions(t,e,s){return this.copy(t).slerp(e,s)}random(){const t=2*Math.PI*Math.random(),e=2*Math.PI*Math.random(),s=Math.random(),i=Math.sqrt(1-s),r=Math.sqrt(s);return this.set(i*Math.sin(t),i*Math.cos(t),r*Math.sin(e),r*Math.cos(e))}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._w===this._w}fromArray(t,e=0){return this._x=t[e],this._y=t[e+1],this._z=t[e+2],this._w=t[e+3],this._onChangeCallback(),this}toArray(t=[],e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._w,t}fromBufferAttribute(t,e){return this._x=t.getX(e),this._y=t.getY(e),this._z=t.getZ(e),this._w=t.getW(e),this._onChangeCallback(),this}toJSON(){return this.toArray()}onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class Ws{x=0;y=0;constructor(t=0,e=0){this.x=t,this.y=e}get width(){return this.x}set width(t){this.x=t}get height(){return this.y}set height(t){this.y=t}set(t=0,e=0){return this.x=t,this.y=e,this}setScalar(t){return this.x=t,this.y=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+t)}}copy(t){return this.x=t.x,this.y=t.y,this}clone(){return new Ws(this.x,this.y)}add(t){return this.x+=t.x,this.y+=t.y,this}addScalar(t){return this.x+=t,this.y+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this}subScalar(t){return this.x-=t,this.y-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this}multiply(t){return this.x*=t.x,this.y*=t.y,this}multiplyScalar(t){return this.x*=t,this.y*=t,this}divide(t){return this.x/=t.x,this.y/=t.y,this}divideScalar(t){return this.multiplyScalar(1/t)}applyMatrix3(t){const e=this.x,s=this.y;return this.x=t.m11*e+t.m21*s+t.m31,this.y=t.m12*e+t.m22*s+t.m32,this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this}clamp(t,e){return this.x=N(this.x,t.x,e.x),this.y=N(this.y,t.y,e.y),this}clampScalar(t,e){return this.x=N(this.x,t,e),this.y=N(this.y,t,e),this}clampLength(t,e){const s=this.length();return this.divideScalar(s||1).multiplyScalar(N(s,t,e))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(t){return this.x*t.x+this.y*t.y}cross(t){return this.x*t.y-this.y*t.x}projectOnVector(t){const e=t.lengthSq();if(e===0)return this.set(0,0);const s=t.dot(this)/e;return this.copy(t).multiplyScalar(s)}perpendOnVector(t){return Ac.copy(this).projectOnVector(t),this.sub(Ac)}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}lengthSq(){return this.x*this.x+this.y*this.y}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(t){const e=Math.sqrt(this.lengthSq()*t.lengthSq());if(e===0)return Math.PI/2;const s=this.dot(t)/e;return Math.acos(N(s,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,s=this.y-t.y;return e*e+s*s}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this}lerpVectors(t,e,s){return this.x=t.x+(e.x-t.x)*s,this.y=t.y+(e.y-t.y)*s,this}equals(t){return t.x===this.x&&t.y===this.y}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this}rotateAround(t,e){const s=Math.cos(e),i=Math.sin(e),r=this.x-t.x,o=this.y-t.y;return this.x=r*s-o*i+t.x,this.y=r*i+o*s+t.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class Bt{x=0;y=0;z=0;constructor(t=0,e=0,s=0){this.x=t,this.y=e,this.z=s}set(t=0,e=0,s=0){return this.x=t,this.y=e,this.z=s,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+t)}}clone(){return new Bt(this.x,this.y,this.z)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this}multiplyVectors(t,e){return this.x=t.x*e.x,this.y=t.y*e.y,this.z=t.z*e.z,this}applyEuler(t){return this.applyQuaternion(Ic.setFromEuler(t))}applyAxisAngle(t,e){return this.applyQuaternion(Ic.setFromAxisAngle(t,e))}applyMatrix3(t){const e=this.x,s=this.y,i=this.z,r=t.value;return this.x=r[0]*e+r[3]*s+r[6]*i,this.y=r[1]*e+r[4]*s+r[7]*i,this.z=r[2]*e+r[5]*s+r[8]*i,this}applyNormalMatrix(t){return this.applyMatrix3(t).normalize()}applyMatrix4(t){const e=this.x,s=this.y,i=this.z,r=t.value,o=1/(r[3]*e+r[7]*s+r[11]*i+r[15]);return this.x=(r[0]*e+r[4]*s+r[8]*i+r[12])*o,this.y=(r[1]*e+r[5]*s+r[9]*i+r[13])*o,this.z=(r[2]*e+r[6]*s+r[10]*i+r[14])*o,this}applyQuaternion(t){const e=this.x,s=this.y,i=this.z,r=t.x,o=t.y,a=t.z,h=t.w,c=2*(o*i-a*s),l=2*(a*e-r*i),u=2*(r*s-o*e);return this.x=e+h*c+o*u-a*l,this.y=s+h*l+a*c-r*u,this.z=i+h*u+r*l-o*c,this}transformDirection(t){const e=this.x,s=this.y,i=this.z,r=t.value;return this.x=r[0]*e+r[4]*s+r[8]*i,this.y=r[1]*e+r[5]*s+r[9]*i,this.z=r[2]*e+r[6]*s+r[10]*i,this.normalize()}divide(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this}divideScalar(t){return this.multiplyScalar(1/t)}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this}clamp(t,e){return this.x=N(this.x,t.x,e.x),this.y=N(this.y,t.y,e.y),this.z=N(this.z,t.z,e.z),this}clampScalar(t,e){return this.x=N(this.x,t,e),this.y=N(this.y,t,e),this.z=N(this.z,t,e),this}clampLength(t,e){const s=this.length();return this.divideScalar(s||1).multiplyScalar(N(s,t,e))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this}lerpVectors(t,e,s){return this.x=t.x+(e.x-t.x)*s,this.y=t.y+(e.y-t.y)*s,this.z=t.z+(e.z-t.z)*s,this}cross(t){return this.crossVectors(this,t)}crossVectors(t,e){const s=t.x,i=t.y,r=t.z,o=e.x,a=e.y,h=e.z;return this.x=i*h-r*a,this.y=r*o-s*h,this.z=s*a-i*o,this}projectOnVector(t){const e=t.lengthSq();if(e===0)return this.set(0,0,0);const s=t.dot(this)/e;return this.copy(t).multiplyScalar(s)}perpendOnVector(t){return Hr.copy(this).projectOnVector(t),this.sub(Hr)}projectOnPlane(t){return this.perpendOnVector(t)}reflect(t){return this.sub(Hr.copy(t).multiplyScalar(2*this.dot(t)))}angleTo(t){const e=Math.sqrt(this.lengthSq()*t.lengthSq());if(e===0)return Math.PI/2;const s=this.dot(t)/e;return Math.acos(N(s,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,s=this.y-t.y,i=this.z-t.z;return e*e+s*s+i*i}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)+Math.abs(this.z-t.z)}setFromMatrix4Position(t){const e=t.value;return this.x=e[12],this.y=e[13],this.z=e[14],this}setFromMatrix4Scale(t){const e=this.setFromMatrix4Column(t,0).length(),s=this.setFromMatrix4Column(t,1).length(),i=this.setFromMatrix4Column(t,2).length();return this.x=e,this.y=s,this.z=i,this}setFromMatrix4Column(t,e){return this.fromArray(t.value,e*4)}setFromMatrix3Column(t,e){return this.fromArray(t.value,e*3)}setFromEuler(t){return this.x=t.x,this.y=t.y,this.z=t.z,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const t=Math.random()*Math.PI*2,e=Math.random()*2-1,s=Math.sqrt(1-e*e);return this.x=s*Math.cos(t),this.y=e,this.z=s*Math.sin(t),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}class jr{x=0;y=0;z=0;w=1;constructor(t=0,e=0,s=0,i=1){this.x=t,this.y=e,this.z=s,this.w=i}get width(){return this.z}set width(t){this.z=t}get height(){return this.w}set height(t){this.w=t}set(t=0,e=0,s=0,i=1){return this.x=t,this.y=e,this.z=s,this.w=i,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this.w=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setW(t){return this.w=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;case 3:this.w=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+t)}}clone(){return new jr(this.x,this.y,this.z,this.w)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=t.w,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this.w+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this.w=t.w+e.w,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this.w+=t.w*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this.w-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this.w=t.w-e.w,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this.w*=t.w,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this}applyMatrix4(t){const e=this.x,s=this.y,i=this.z,r=this.w,o=t.value;return this.x=o[0]*e+o[4]*s+o[8]*i+o[12]*r,this.y=o[1]*e+o[5]*s+o[9]*i+o[13]*r,this.z=o[2]*e+o[6]*s+o[10]*i+o[14]*r,this.w=o[3]*e+o[7]*s+o[11]*i+o[15]*r,this}divide(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this.w/=t.w,this}divideScalar(t){return this.multiplyScalar(1/t)}setAxisAngleFromQuaternion(t){this.w=2*Math.acos(t.w);const e=Math.sqrt(1-t.w*t.w);return e<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=t.x/e,this.y=t.y/e,this.z=t.z/e),this}setAxisAngleFromRotationMatrix4(t){let e,s,i,r;const h=t.value,c=h[0],l=h[4],u=h[8],m=h[1],f=h[5],p=h[9],y=h[2],S=h[6],w=h[10];if(Math.abs(l-m)<.01&&Math.abs(u-y)<.01&&Math.abs(p-S)<.01){if(Math.abs(l+m)<.1&&Math.abs(u+y)<.1&&Math.abs(p+S)<.1&&Math.abs(c+f+w-3)<.1)return this.set(1,0,0,0),this;e=Math.PI;const x=(c+1)/2,b=(f+1)/2,P=(w+1)/2,C=(l+m)/4,D=(u+y)/4,B=(p+S)/4;return x>b&&x>P?x<.01?(s=0,i=.707106781,r=.707106781):(s=Math.sqrt(x),i=C/s,r=D/s):b>P?b<.01?(s=.707106781,i=0,r=.707106781):(i=Math.sqrt(b),s=C/i,r=B/i):P<.01?(s=.707106781,i=.707106781,r=0):(r=Math.sqrt(P),s=D/r,i=B/r),this.set(s,i,r,e),this}let v=Math.sqrt((S-p)*(S-p)+(u-y)*(u-y)+(m-l)*(m-l));return Math.abs(v)<.001&&(v=1),this.x=(S-p)/v,this.y=(u-y)/v,this.z=(m-l)/v,this.w=Math.acos((c+f+w-1)/2),this}setFromMatrix4Position(t){const e=t.value;return this.x=e[12],this.y=e[13],this.z=e[14],this.w=e[15],this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this.w=Math.min(this.w,t.w),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this.w=Math.max(this.w,t.w),this}clamp(t,e){return this.x=N(this.x,t.x,e.x),this.y=N(this.y,t.y,e.y),this.z=N(this.z,t.z,e.z),this.w=N(this.w,t.w,e.w),this}clampScalar(t,e){return this.x=N(this.x,t,e),this.y=N(this.y,t,e),this.z=N(this.z,t,e),this.w=N(this.w,t,e),this}clampLength(t,e){const s=this.length();return this.divideScalar(s||1).multiplyScalar(N(s,t,e))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}projectOnVector(t){const e=t.lengthSq();if(e===0)return this.set(0,0,0,1);const s=t.dot(this)/e;return this.copy(t).multiplyScalar(s)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this.w+=(t.w-this.w)*e,this}lerpVectors(t,e,s){return this.x=t.x+(e.x-t.x)*s,this.y=t.y+(e.y-t.y)*s,this.z=t.z+(e.z-t.z)*s,this.w=t.w+(e.w-t.w)*s,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z&&t.w===this.w}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this.w=t[e+3],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t[e+3]=this.w,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this.w=t.getW(e),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}const Ac=new Ws,Hr=new Bt,Ic=new qr,Js=2e3,Wr=2001,kc=[1,0,0,1],Dc=[1,0,0,1,0,0],Lc=[1,0,0,0,1,0,0,0,1],Rc=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];class Jr{value;constructor(t=kc){this.value=Array.from(t)}get m11(){return this.value[0]}get m12(){return this.value[1]}get m21(){return this.value[2]}get m22(){return this.value[3]}set m11(t){this.value[0]=t}set m12(t){this.value[1]=t}set m21(t){this.value[2]=t}set m22(t){this.value[3]=t}set(t=1,e=0,s=0,i=1){return this.m11=t,this.m21=e,this.m12=s,this.m22=i,this}identity(){return this.value=Array.from(kc),this}get isIdentity(){return this.m11==1&&this.m12==0&&this.m21==0&&this.m22==1}copy(t){return this.m11=t.m11,this.m12=t.m12,this.m21=t.m21,this.m22=t.m22,this}clone(){return new Jr(this.value)}fromArray(t,e=0){for(let s=0;s<4;s++)this.value[s]=t[s+e];return this}toArray(t=[],e=0){return t[e]=this.m11,t[e+1]=this.m12,t[e+2]=this.m21,t[e+3]=this.m22,t}multiplyMatrices(t,e){const s=t.value,i=e.value,r=this.value,o=s[0],a=s[2],h=s[1],c=s[3],l=i[0],u=i[2],m=i[1],f=i[3];return r[0]=o*l+a*m,r[2]=o*u+a*f,r[1]=h*l+c*m,r[3]=h*u+c*f,this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyScalar(t){return this.m11*=t,this.m12*=t,this.m21*=t,this.m22*=t,this}determinant(){return this.m11*this.m22-this.m21*this.m12}}class ps{value;constructor(t=Lc){this.value=Array.from(t)}get m11(){return this.value[0]}get m12(){return this.value[1]}get m13(){return this.value[2]}get m21(){return this.value[3]}get m22(){return this.value[4]}get m23(){return this.value[5]}get m31(){return this.value[6]}get m32(){return this.value[7]}get m33(){return this.value[8]}set m11(t){this.value[0]=t}set m12(t){this.value[1]=t}set m13(t){this.value[2]=t}set m21(t){this.value[3]=t}set m22(t){this.value[4]=t}set m23(t){this.value[5]=t}set m31(t){this.value[6]=t}set m32(t){this.value[7]=t}set m33(t){this.value[8]=t}set(t=1,e=0,s=0,i=0,r=1,o=0,a=0,h=0,c=1){const l=this.value;return l[0]=t,l[1]=i,l[2]=a,l[3]=e,l[4]=r,l[5]=h,l[6]=s,l[7]=o,l[8]=c,this}identity(){return this.value=Array.from(Lc),this}get isIdentity(){return this.m11==1&&this.m12==0&&this.m13==0&&this.m21==0&&this.m22==1&&this.m23==0&&this.m31==0&&this.m32==0&&this.m33==1}copy(t){return this.m11=t.m11,this.m12=t.m12,this.m13=t.m13,this.m21=t.m21,this.m22=t.m22,this.m23=t.m23,this.m31=t.m31,this.m32=t.m32,this.m33=t.m33,this}clone(){return new ps(this.value)}fromArray(t,e=0){for(let s=0;s<9;s++)this.value[s]=t[s+e];return this}toArray(t=[],e=0){return t[e]=this.m11,t[e+1]=this.m12,t[e+2]=this.m13,t[e+3]=this.m21,t[e+4]=this.m22,t[e+5]=this.m23,t[e+6]=this.m31,t[e+7]=this.m32,t[e+8]=this.m33,t}extractBasis(t,e,s){return t.setFromMatrix3Column(this,0),e.setFromMatrix3Column(this,1),s.setFromMatrix3Column(this,2),this}setFromMatrix4(t){return this.set(t.m11,t.m21,t.m31,t.m12,t.m22,t.m32,t.m13,t.m23,t.m33),this}multiplyMatrices(t,e){const s=t.value,i=e.value,r=this.value,o=s[0],a=s[3],h=s[6],c=s[1],l=s[4],u=s[7],m=s[2],f=s[5],p=s[8],y=i[0],S=i[3],w=i[6],v=i[1],x=i[4],b=i[7],P=i[2],C=i[5],D=i[8];return r[0]=o*y+a*v+h*P,r[3]=o*S+a*x+h*C,r[6]=o*w+a*b+h*D,r[1]=c*y+l*v+u*P,r[4]=c*S+l*x+u*C,r[7]=c*w+l*b+u*D,r[2]=m*y+f*v+p*P,r[5]=m*S+f*x+p*C,r[8]=m*w+f*b+p*D,this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyScalar(t){return this.m11*=t,this.m12*=t,this.m13*=t,this.m21*=t,this.m22*=t,this.m23*=t,this.m31*=t,this.m32*=t,this.m33*=t,this}determinant(){const t=this.value,e=t[0],s=t[1],i=t[2],r=t[3],o=t[4],a=t[5],h=t[6],c=t[7],l=t[8];return e*o*l-e*a*c-s*r*l+s*a*h+i*r*c-i*o*h}inverse(){const t=this.value,e=t[0],s=t[1],i=t[2],r=t[3],o=t[4],a=t[5],h=t[6],c=t[7],l=t[8],u=l*o-a*c,m=a*h-l*r,f=c*r-o*h,p=e*u+s*m+i*f;if(p===0)return this.set(0,0,0,0,0,0,0,0,0);const y=1/p;return t[0]=u*y,t[1]=(i*c-l*s)*y,t[2]=(a*s-i*o)*y,t[3]=m*y,t[4]=(l*e-i*h)*y,t[5]=(i*r-a*e)*y,t[6]=f*y,t[7]=(s*h-c*e)*y,t[8]=(o*e-s*r)*y,this}transpose(){let t;const e=this.value;return t=e[1],e[1]=e[3],e[3]=t,t=e[2],e[2]=e[6],e[6]=t,t=e[5],e[5]=e[7],e[7]=t,this}getNormalMatrix(t){return this.setFromMatrix4(t).inverse().transpose()}transposeIntoArray(t){const e=this.value;return t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],this}setUvTransform(t,e,s,i,r,o,a){const h=Math.cos(r),c=Math.sin(r);return this.set(s*h,s*c,-s*(h*o+c*a)+o+t,-i*c,i*h,-i*(-c*o+h*a)+a+e,0,0,1),this}scale(t,e){return this.premultiply(Zr.makeScale(t,e)),this}rotate(t){return this.premultiply(Zr.makeRotation(-t)),this}translate(t,e){return this.premultiply(Zr.makeTranslation(t,e)),this}makeTranslation(t,e){return typeof t=="number"?this.set(1,0,t,0,1,e,0,0,1):this.set(1,0,t.x,0,1,t.y,0,0,1),this}makeRotation(t){const e=Math.cos(t),s=Math.sin(t);return this.set(e,-s,0,s,e,0,0,0,1),this}makeScale(t,e){return this.set(t,0,0,0,e,0,0,0,1),this}equals(t){for(let e=0;e<9;e++)if(this.value[e]!==t.value[e])return!1;return!0}}class kt{value;is3dSpecial=!1;constructor(t=Rc){this.value=Array.from(t)}get m11(){return this.value[0]}get m12(){return this.value[1]}get m13(){return this.value[2]}get m14(){return this.value[3]}get m21(){return this.value[4]}get m22(){return this.value[5]}get m23(){return this.value[6]}get m24(){return this.value[7]}get m31(){return this.value[8]}get m32(){return this.value[9]}get m33(){return this.value[10]}get m34(){return this.value[11]}get m41(){return this.value[12]}get m42(){return this.value[13]}get m43(){return this.value[14]}get m44(){return this.value[15]}set m11(t){this.value[0]=t}set m12(t){this.value[1]=t}set m13(t){this.value[2]=t}set m14(t){this.value[3]=t}set m21(t){this.value[4]=t}set m22(t){this.value[5]=t}set m23(t){this.value[6]=t}set m24(t){this.value[7]=t}set m31(t){this.value[8]=t}set m32(t){this.value[9]=t}set m33(t){this.value[10]=t}set m34(t){this.value[11]=t}set m41(t){this.value[12]=t}set m42(t){this.value[13]=t}set m43(t){this.value[14]=t}set m44(t){this.value[15]=t}set(t=1,e=0,s=0,i=0,r=0,o=1,a=0,h=0,c=0,l=0,u=1,m=0,f=0,p=0,y=0,S=1){const w=this.value;return w[0]=t,w[4]=e,w[8]=s,w[12]=i,w[1]=r,w[5]=o,w[9]=a,w[13]=h,w[2]=c,w[6]=l,w[10]=u,w[14]=m,w[3]=f,w[7]=p,w[11]=y,w[15]=S,this}is2D(){return!this.is3dSpecial&&this.m31==0&&this.m32==0&&this.m33==1&&this.m34==0&&this.m43==0&&this.m44==1}is3D(){return!this.is2D()}identity(){return this.value=Array.from(Rc),this}get isIdentity(){return this.m11==1&&this.m12==0&&this.m13==0&&this.m14==0&&this.m21==0&&this.m22==1&&this.m23==0&&this.m24==0&&this.m31==0&&this.m32==0&&this.m33==1&&this.m34==0&&this.m41==0&&this.m42==0&&this.m43==0&&this.m44==1}copy(t){return this.m11=t.m11,this.m12=t.m12,this.m13=t.m13,this.m14=t.m14,this.m21=t.m21,this.m22=t.m22,this.m23=t.m23,this.m24=t.m24,this.m31=t.m31,this.m32=t.m32,this.m33=t.m33,this.m34=t.m34,this.m41=t.m41,this.m42=t.m42,this.m43=t.m43,this.m44=t.m44,this}clone(){return new kt(this.value)}static fromString(t){const e=new kt,s=xa("number",t);return s.length===16&&s.forEach((i,r)=>{i.fullMatch&&(e.value[r]=parseFloat(i.fullMatch))}),e}fromArray(t,e=0){for(let s=0;s<16;s++)this.value[s]=t[s+e];return this}toArray(t=[],e=0){const s=this.value;return t[e]=s[0],t[e+1]=s[1],t[e+2]=s[2],t[e+3]=s[3],t[e+4]=s[4],t[e+5]=s[5],t[e+6]=s[6],t[e+7]=s[7],t[e+8]=s[8],t[e+9]=s[9],t[e+10]=s[10],t[e+11]=s[11],t[e+12]=s[12],t[e+13]=s[13],t[e+14]=s[14],t[e+15]=s[15],t}copyPosition(t){const e=this.value,s=t.value;return e[12]=s[12],e[13]=s[13],e[14]=s[14],this}setFromMatrix3(t){const e=t.value;return this.set(e[0],e[3],e[6],0,e[1],e[4],e[7],0,e[2],e[5],e[8],0,0,0,0,1),this}extractBasis(t,e,s){return t.setFromMatrix4Column(this,0),e.setFromMatrix4Column(this,1),s.setFromMatrix4Column(this,2),this}makeBasis(t,e,s){return this.set(t.x,e.x,s.x,0,t.y,e.y,s.y,0,t.z,e.z,s.z,0,0,0,0,1),this}normalize(){return this.multiplyScalar(1/(this.m44||1e-4))}transformPoint(t){const e=t.z||1,s=t.w||1;return{x:t.x*this.m11+t.y*this.m21+e*this.m31+s*this.m41,y:t.x*this.m12+t.y*this.m22+e*this.m32+s*this.m42,z:t.x*this.m13+t.y*this.m23+e*this.m33+s*this.m43,w:t.x*this.m14+t.y*this.m24+e*this.m34+s*this.m44}}toMatrix(t){const{scalarX:e,scalarY:s,skewX:i,skewY:r,x:o,y:a}=this.split(),h=[e,r,i,s,o,a];return t?(t.value=h,t):new wt(h)}flatten(){return this.m31=0,this.m32=0,this.m33=1,this.m34=0,this.m14=0,this.m24=0,this.m43=0,this.m44=1,this}toString(t=6){return`matrix3d(${this.value.map(e=>F(e,t)).join(",")})`}split(){const t=Math.sqrt(this.m11*this.m11+this.m12*this.m12+this.m13*this.m13),e=Math.sqrt(this.m21*this.m21+this.m22*this.m22+this.m23*this.m23),s=Math.sqrt(this.m31*this.m31+this.m32*this.m32+this.m33*this.m33),i=mt(N(Math.asin(-this.m13),-1,1));let r=mt(Math.atan2(this.m23,this.m33));Math.cos(q(i))===0&&(r=mt(Math.atan2(-this.m31,this.m22)));let o=mt(Math.atan2(this.m12,this.m11));return this.m11<0&&this.m22>=0&&(o+=180),{x:this.m41,y:this.m42,z:this.m43,scalarX:t,scalarY:e,scalarZ:s,degreeX:r,degreeY:i,degreeZ:o,skewX:mt(this.m14),skewY:mt(this.m24),skewZ:mt(this.m34),skewW:this.m44,perspective:this.m34?-(1/this.m34):0}}extractRotation(t){const e=this.value,s=t.value,i=1/gs.setFromMatrix4Column(t,0).length(),r=1/gs.setFromMatrix4Column(t,1).length(),o=1/gs.setFromMatrix4Column(t,2).length();return e[0]=s[0]*i,e[1]=s[1]*i,e[2]=s[2]*i,e[3]=0,e[4]=s[4]*r,e[5]=s[5]*r,e[6]=s[6]*r,e[7]=0,e[8]=s[8]*o,e[9]=s[9]*o,e[10]=s[10]*o,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromEuler(t){const e=this.value,s=t.x,i=t.y,r=t.z,o=Math.cos(s),a=Math.sin(s),h=Math.cos(i),c=Math.sin(i),l=Math.cos(r),u=Math.sin(r);if(t.order==="XYZ"){const m=o*l,f=o*u,p=a*l,y=a*u;e[0]=h*l,e[4]=-h*u,e[8]=c,e[1]=f+p*c,e[5]=m-y*c,e[9]=-a*h,e[2]=y-m*c,e[6]=p+f*c,e[10]=o*h}else if(t.order==="YXZ"){const m=h*l,f=h*u,p=c*l,y=c*u;e[0]=m+y*a,e[4]=p*a-f,e[8]=o*c,e[1]=o*u,e[5]=o*l,e[9]=-a,e[2]=f*a-p,e[6]=y+m*a,e[10]=o*h}else if(t.order==="ZXY"){const m=h*l,f=h*u,p=c*l,y=c*u;e[0]=m-y*a,e[4]=-o*u,e[8]=p+f*a,e[1]=f+p*a,e[5]=o*l,e[9]=y-m*a,e[2]=-o*c,e[6]=a,e[10]=o*h}else if(t.order==="ZYX"){const m=o*l,f=o*u,p=a*l,y=a*u;e[0]=h*l,e[4]=p*c-f,e[8]=m*c+y,e[1]=h*u,e[5]=y*c+m,e[9]=f*c-p,e[2]=-c,e[6]=a*h,e[10]=o*h}else if(t.order==="YZX"){const m=o*h,f=o*c,p=a*h,y=a*c;e[0]=h*l,e[4]=y-m*u,e[8]=p*u+f,e[1]=u,e[5]=o*l,e[9]=-a*l,e[2]=-c*l,e[6]=f*u+p,e[10]=m-y*u}else if(t.order==="XZY"){const m=o*h,f=o*c,p=a*h,y=a*c;e[0]=h*l,e[4]=-u,e[8]=c*l,e[1]=m*u+y,e[5]=o*l,e[9]=f*u-p,e[2]=p*u-f,e[6]=a*l,e[10]=y*u+m}return e[3]=0,e[7]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromQuaternion(t){return this.compose(Ng,t,Fg)}lookAt(t,e,s){const i=this.value;return Nt.subVectors(t,e),Nt.lengthSq()===0&&(Nt.z=1),Nt.normalize(),De.crossVectors(s,Nt),De.lengthSq()===0&&(Math.abs(s.z)===1?Nt.x+=1e-4:Nt.z+=1e-4,Nt.normalize(),De.crossVectors(s,Nt)),De.normalize(),Jn.crossVectors(Nt,De),i[0]=De.x,i[4]=Jn.x,i[8]=Nt.x,i[1]=De.y,i[5]=Jn.y,i[9]=Nt.y,i[2]=De.z,i[6]=Jn.z,i[10]=Nt.z,this}multiplyMatrices(t,e){const s=t.value,i=e.value,r=this.value,o=s[0],a=s[4],h=s[8],c=s[12],l=s[1],u=s[5],m=s[9],f=s[13],p=s[2],y=s[6],S=s[10],w=s[14],v=s[3],x=s[7],b=s[11],P=s[15],C=i[0],D=i[4],B=i[8],Y=i[12],V=i[1],G=i[5],J=i[9],it=i[13],tt=i[2],Kt=i[6],Xt=i[10],Vt=i[14],te=i[3],R=i[7],L=i[11],U=i[15];return r[0]=o*C+a*V+h*tt+c*te,r[4]=o*D+a*G+h*Kt+c*R,r[8]=o*B+a*J+h*Xt+c*L,r[12]=o*Y+a*it+h*Vt+c*U,r[1]=l*C+u*V+m*tt+f*te,r[5]=l*D+u*G+m*Kt+f*R,r[9]=l*B+u*J+m*Xt+f*L,r[13]=l*Y+u*it+m*Vt+f*U,r[2]=p*C+y*V+S*tt+w*te,r[6]=p*D+y*G+S*Kt+w*R,r[10]=p*B+y*J+S*Xt+w*L,r[14]=p*Y+y*it+S*Vt+w*U,r[3]=v*C+x*V+b*tt+P*te,r[7]=v*D+x*G+b*Kt+P*R,r[11]=v*B+x*J+b*Xt+P*L,r[15]=v*Y+x*it+b*Vt+P*U,this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyScalar(t){return this.m11*=t,this.m12*=t,this.m13*=t,this.m14*=t,this.m21*=t,this.m22*=t,this.m23*=t,this.m24*=t,this.m31*=t,this.m32*=t,this.m33*=t,this.m34*=t,this}determinant(){const t=this.value,e=t[0],s=t[4],i=t[8],r=t[12],o=t[1],a=t[5],h=t[9],c=t[13],l=t[2],u=t[6],m=t[10],f=t[14],p=t[3],y=t[7],S=t[11],w=t[15];return p*(+r*h*u-i*c*u-r*a*m+s*c*m+i*a*f-s*h*f)+y*(+e*h*f-e*c*m+r*o*m-i*o*f+i*c*l-r*h*l)+S*(+e*c*u-e*a*f-r*o*u+s*o*f+r*a*l-s*c*l)+w*(-i*a*l-e*h*u+e*a*m+i*o*u-s*o*m+s*h*l)}transpose(){const t=this.value;let e;return e=t[1],t[1]=t[4],t[4]=e,e=t[2],t[2]=t[8],t[8]=e,e=t[6],t[6]=t[9],t[9]=e,e=t[3],t[3]=t[12],t[12]=e,e=t[7],t[7]=t[13],t[13]=e,e=t[11],t[11]=t[14],t[14]=e,this}setPosition(t,e,s){const i=this.value;return t instanceof Bt?(i[12]=t.x,i[13]=t.y,i[14]=t.z):typeof t=="number"&&typeof e=="number"&&typeof s=="number"&&(i[12]=t,i[13]=e,i[14]=s),this}inverse(){const t=this.value,e=t[0],s=t[1],i=t[2],r=t[3],o=t[4],a=t[5],h=t[6],c=t[7],l=t[8],u=t[9],m=t[10],f=t[11],p=t[12],y=t[13],S=t[14],w=t[15],v=u*S*c-y*m*c+y*h*f-a*S*f-u*h*w+a*m*w,x=p*m*c-l*S*c-p*h*f+o*S*f+l*h*w-o*m*w,b=l*y*c-p*u*c+p*a*f-o*y*f-l*a*w+o*u*w,P=p*u*h-l*y*h-p*a*m+o*y*m+l*a*S-o*u*S,C=e*v+s*x+i*b+r*P;if(C===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const D=1/C;return t[0]=v*D,t[1]=(y*m*r-u*S*r-y*i*f+s*S*f+u*i*w-s*m*w)*D,t[2]=(a*S*r-y*h*r+y*i*c-s*S*c-a*i*w+s*h*w)*D,t[3]=(u*h*r-a*m*r-u*i*c+s*m*c+a*i*f-s*h*f)*D,t[4]=x*D,t[5]=(l*S*r-p*m*r+p*i*f-e*S*f-l*i*w+e*m*w)*D,t[6]=(p*h*r-o*S*r-p*i*c+e*S*c+o*i*w-e*h*w)*D,t[7]=(o*m*r-l*h*r+l*i*c-e*m*c-o*i*f+e*h*f)*D,t[8]=b*D,t[9]=(p*u*r-l*y*r-p*s*f+e*y*f+l*s*w-e*u*w)*D,t[10]=(o*y*r-p*a*r+p*s*c-e*y*c-o*s*w+e*a*w)*D,t[11]=(l*a*r-o*u*r-l*s*c+e*u*c+o*s*f-e*a*f)*D,t[12]=P*D,t[13]=(l*y*i-p*u*i+p*s*m-e*y*m-l*s*S+e*u*S)*D,t[14]=(p*a*i-o*y*i-p*s*h+e*y*h+o*s*S-e*a*S)*D,t[15]=(o*u*i-l*a*i+l*s*h-e*u*h-o*s*m+e*a*m)*D,this}getMaxScaleOnAxis(){const t=this.value,e=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],s=t[4]*t[4]+t[5]*t[5]+t[6]*t[6],i=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(e,s,i))}makeTranslation(t,e,s){return t instanceof Bt?this.set(1,0,0,t.x,0,1,0,t.y,0,0,1,t.z,0,0,0,1):this.set(1,0,0,t,0,1,0,e,0,0,1,s,0,0,0,1),this}makeRotationX(t){const e=Math.cos(t),s=Math.sin(t);return this.set(1,0,0,0,0,e,-s,0,0,s,e,0,0,0,0,1),this}makeRotationY(t){const e=Math.cos(t),s=Math.sin(t);return this.set(e,0,s,0,0,1,0,0,-s,0,e,0,0,0,0,1),this}makeRotationZ(t){const e=Math.cos(t),s=Math.sin(t);return this.set(e,-s,0,0,s,e,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(t,e){const s=Math.cos(e),i=Math.sin(e),r=1-s,o=t.x,a=t.y,h=t.z,c=r*o,l=r*a;return this.set(c*o+s,c*a-i*h,c*h+i*a,0,c*a+i*h,l*a+s,l*h-i*o,0,c*h-i*a,l*h+i*o,r*h*h+s,0,0,0,0,1),this}makeScale(t,e,s){return this.set(t,0,0,0,0,e,0,0,0,0,s,0,0,0,0,1),this}makeShear(t,e,s,i,r,o){return this.set(1,s,r,0,t,1,o,0,e,i,1,0,0,0,0,1),this}makePerspective(t,e,s,i,r,o,a=Js){const h=this.value,c=2*r/(e-t),l=2*r/(s-i),u=(e+t)/(e-t),m=(s+i)/(s-i);let f,p;if(a===Js)f=-(o+r)/(o-r),p=-2*o*r/(o-r);else if(a===Wr)f=-o/(o-r),p=-o*r/(o-r);else throw new Error("Matrix4.makePerspective(): Invalid coordinate system: "+a);return h[0]=c,h[4]=0,h[8]=u,h[12]=0,h[1]=0,h[5]=l,h[9]=m,h[13]=0,h[2]=0,h[6]=0,h[10]=f,h[14]=p,h[3]=0,h[7]=0,h[11]=-1,h[15]=0,this}makeOrthographic(t,e,s,i,r,o,a=Js){const h=this.value,c=1/(e-t),l=1/(s-i),u=1/(o-r),m=(e+t)*c,f=(s+i)*l;let p,y;if(a===Js)p=(o+r)*u,y=-2*u;else if(a===Wr)p=r*u,y=-1*u;else throw new Error("Matrix4.makeOrthographic(): Invalid coordinate system: "+a);return h[0]=2*c,h[4]=0,h[8]=0,h[12]=-m,h[1]=0,h[5]=2*l,h[9]=0,h[13]=-f,h[2]=0,h[6]=0,h[10]=y,h[14]=-p,h[3]=0,h[7]=0,h[11]=0,h[15]=1,this}compose(t,e,s){const i=this.value,r=e.x,o=e.y,a=e.z,h=e.w,c=r+r,l=o+o,u=a+a,m=r*c,f=r*l,p=r*u,y=o*l,S=o*u,w=a*u,v=h*c,x=h*l,b=h*u,P=s.x,C=s.y,D=s.z;return i[0]=(1-(y+w))*P,i[1]=(f+b)*P,i[2]=(p-x)*P,i[3]=0,i[4]=(f-b)*C,i[5]=(1-(m+w))*C,i[6]=(S+v)*C,i[7]=0,i[8]=(p+x)*D,i[9]=(S-v)*D,i[10]=(1-(m+y))*D,i[11]=0,i[12]=t.x,i[13]=t.y,i[14]=t.z,i[15]=1,this}decompose(t,e,s){const i=this.value;let r=gs.set(i[0],i[1],i[2]).length();const o=gs.set(i[4],i[5],i[6]).length(),a=gs.set(i[8],i[9],i[10]).length();this.determinant()<0&&(r=-r),t.x=i[12],t.y=i[13],t.z=i[14],Zt.copy(this);const c=1/r,l=1/o,u=1/a;return Zt.value[0]*=c,Zt.value[1]*=c,Zt.value[2]*=c,Zt.value[4]*=l,Zt.value[5]*=l,Zt.value[6]*=l,Zt.value[8]*=u,Zt.value[9]*=u,Zt.value[10]*=u,e.setFromRotationMatrix4(Zt),s.x=r,s.y=o,s.z=a,this}equals(t){for(let e=0;e<16;e++)if(this.value[e]!==t.value[e])return!1;return!0}translate(t=0,e=0,s=0){return this.multiply(new kt([1,0,0,0,0,1,0,0,0,0,1,0,t,e,s,1]))}scale(t=1,e=1,s=1){return this.multiply(new kt([t,0,0,0,0,e,0,0,0,0,s,0,0,0,0,1]))}scaleVector3(t){const e=this.value,s=t.x,i=t.y,r=t.z;return e[0]*=s,e[4]*=i,e[8]*=r,e[1]*=s,e[5]*=i,e[9]*=r,e[2]*=s,e[6]*=i,e[10]*=r,e[3]*=s,e[7]*=i,e[11]*=r,this}rotateX(t){const e=q(t),s=Math.cos(e),i=Math.sin(e);return this.multiply(new kt([1,0,0,0,0,s,i,0,0,-i,s,0,0,0,0,1]))}rotateY(t){const e=q(t),s=Math.cos(e),i=Math.sin(e);return this.multiply(new kt([s,0,-i,0,0,1,0,0,i,0,s,0,0,0,0,1]))}rotateZ(t){this.is3dSpecial=!0;const e=q(t),s=Math.cos(e),i=Math.sin(e);return this.multiply(new kt([s,i,0,0,-i,s,0,0,0,0,1,0,0,0,0,1]))}skew(t=0,e=0,s=0){return this.multiply(new kt([1,0,0,q(t),0,1,0,q(e),0,0,1,q(s),0,0,0,1]))}perspective(t){return this.multiply(new kt([1,0,0,0,0,1,0,0,0,0,1,t?-(1/t):0,0,0,0,1]))}unproject(t){let e=t.x*this.m11+t.y*this.m21+this.m41,s=t.x*this.m12+t.y*this.m22+this.m42,i=t.x*this.m13+t.y*this.m23+this.m43,r=t.x*this.m14+t.y*this.m24+this.m44,o=e+this.m31,a=s+this.m32,h=i+this.m33,c=r+this.m34;r==0&&(r=1e-4),e/=r,s/=r,i/=r,c==0&&(c=1e-4),o/=c,a/=c,h/=c;const l=h-i;if(l==0)return{x:e,y:s,z:i,mass:r};const u=-i/l;return e+=u*(o-e),s+=u*(a-s),{x:e,y:s,z:i,mass:r}}project(t){const e=t.z;let s=t.x*this.m11+t.y*this.m21+e*this.m31+this.m41,i=t.x*this.m12+t.y*this.m22+e*this.m32+this.m42,r=t.x*this.m14+t.y*this.m24+e*this.m34+this.m44;return r==0&&(r=1e-4),s/=r,i/=r,r<0&&(s-=this.m41,i-=this.m42,s*=1/r,i*=1/r,s+=this.m41,i+=this.m42),{x:s,y:i,z:e,mass:r}}bounds(t,e,s,i){const r=new Wn({x:t,y:e}),o=new Wn({x:t+s,y:e}),a=new Wn({x:t+s,y:e+i}),h=new Wn({x:t,y:e+i});({x:r.x,y:r.y,z:r.z,mass:r.mass}=this.project(r)),{x:o.x,y:o.y,z:o.z,mass:o.mass}=this.project(o),{x:a.x,y:a.y,z:a.z,mass:a.mass}=this.project(a),{x:h.x,y:h.y,z:h.z,mass:h.mass}=this.project(h);const c=Math.min(r.x,o.x,a.x,h.x),l=Math.min(r.y,o.y,a.y,h.y),u=Math.max(r.x,o.x,a.x,h.x)-c,m=Math.max(r.y,o.y,a.y,h.y)-l;return{x:c,y:l,width:u,height:m}}}class wt{value;_m13=0;_m23=0;_m33=1;matrix4;constructor(t=Dc){this.value=Array.from(t),this.matrix4=this.toMatrix4()}get m11(){return this.value[0]}get m12(){return this.value[1]}get m13(){return this._m13}get m21(){return this.value[2]}get m22(){return this.value[3]}get m23(){return this._m23}get m31(){return this.value[4]}get m32(){return this.value[5]}get m33(){return this._m33}set m11(t){this.value[0]=t}set m12(t){this.value[1]=t}set m13(t){this._m13=t}set m21(t){this.value[2]=t}set m22(t){this.value[3]=t}set m23(t){this._m23=t}set m31(t){this.value[4]=t}set m32(t){this.value[5]=t}set m33(t){this._m33=t}static fromString(t){const e=new wt,s=xa("number",t);return s.length===6&&s.forEach((i,r)=>{i.fullMatch&&(e.value[r]=parseFloat(i.fullMatch))}),e}toMatrix4(t=this.matrix4){const e=[this.m11,this.m12,0,this.m13,this.m21,this.m22,0,this.m23,0,0,1,0,this.m31,this.m32,0,this.m33];return t?(t.value=e,t):new kt(e)}identity(){return this.value=Array.from(Dc),this.m13=0,this.m23=0,this.m33=1,this.matrix4=this.toMatrix4(),this}get isIdentity(){return this.m11==1&&this.m12==0&&this.m13==0&&this.m21==0&&this.m22==1&&this.m23==0&&this.m31==0&&this.m32==0&&this.m33==1}multiplyScalar(t){return this.m11*=t,this.m12*=t,this.m13*=t,this.m21*=t,this.m22*=t,this.m23*=t,this.m31*=t,this.m32*=t,this.m33*=t,this}normalize(){const t=this.m33||1e-4;return this.multiplyScalar(1/t)}transformPoint(t){const e=t.z||1;return{x:t.x*this.m11+t.y*this.m21+e*this.m31,y:t.x*this.m12+t.y*this.m22+e*this.m32,z:t.x*this.m13+t.y*this.m23+e*this.m33}}clone(){return new wt(this.value)}multiply(t){const e=this.clone(),s=t instanceof wt?t:new wt(t);return this.m11=s.m11*e.m11+s.m12*e.m21+s.m13*e.m31,this.m12=s.m11*e.m12+s.m12*e.m22+s.m13*e.m32,this.m13=s.m11*e.m13+s.m12*e.m23+s.m13*e.m33,this.m21=s.m21*e.m11+s.m22*e.m21+s.m23*e.m31,this.m22=s.m21*e.m12+s.m22*e.m22+s.m23*e.m32,this.m23=s.m21*e.m13+s.m22*e.m23+s.m23*e.m33,this.m31=s.m31*e.m11+s.m32*e.m21+s.m33*e.m31,this.m32=s.m31*e.m12+s.m32*e.m22+s.m33*e.m32,this.m33=s.m31*e.m13+s.m32*e.m23+s.m33*e.m33,this}append(t){return this.multiply(t)}prepend(t){return t.multiply(this),this}inverse(){const t=this.m11,e=this.m12,s=this.m13,i=this.m21,r=this.m22,o=this.m23,a=this.m31,h=this.m32,c=this.m33,l=c*r-o*h,u=-c*i+o*a,m=h*i-r*a;let f=t*l+e*u+s*m;return f?(f=1/f,this.m11=l*f,this.m12=(-c*e+s*h)*f,this.m13=(o*e-s*r)*f,this.m21=u*f,this.m22=(c*t-s*a)*f,this.m23=(-o*t+s*i)*f,this.m31=m*f,this.m32=(-h*t+e*a)*f,this.m33=(r*t-e*i)*f,this):null}adjugate(){const t=new wt;return t.m11=this.m22*this.m33-this.m32*this.m23,t.m12=this.m32*this.m13-this.m12*this.m33,t.m13=this.m12*this.m23-this.m22*this.m13,t.m21=this.m31*this.m23-this.m21*this.m33,t.m22=this.m11*this.m33-this.m31*this.m13,t.m23=this.m21*this.m13-this.m11*this.m23,t.m31=this.m21*this.m32-this.m31*this.m22,t.m32=this.m31*this.m12-this.m11*this.m32,t.m33=this.m11*this.m22-this.m21*this.m12,t}split(){let t=mt(Math.atan2(this.m12,this.m11));return this.m11<0&&this.m22>=0&&(t+=180),{x:this.m31,y:this.m32,degree:t,scaleX:Math.sqrt(this.m11*this.m11+this.m12*this.m12),scaleY:Math.sqrt(this.m21*this.m21+this.m22*this.m22),skewX:mt(Math.atan2(-this.m21,this.m22)),skewY:mt(Math.atan2(this.m12,this.m11))}}getGroupCoords(t){const e=this.value[0],s=this.value[1],i=this.value[2],r=this.value[3],o=this.value[4],a=this.value[5],h=t.value[0],c=t.value[1],l=t.value[2],u=t.value[3],m=t.value[4],f=t.value[5],p=h*u,y=c*l,S=(l*s-e*u)/(y-p),w=(h*s-e*c)/(p-y),v=(l*r-i*u)/(y-p),x=(h*r-i*c)/(p-y),b=(l*(a-f)+u*(m-o))/(y-p),P=(h*(a-f)+c*(m-o))/(p-y),C=[S,w,v,x,b,P];return new wt(C)}toString(t=6){return this.matrix4.is2D()?`matrix(${this.value.map(e=>F(e,t)).join(",")})`:this.matrix4.toString()}translate(t,e){return this.multiply([1,0,0,1,t,e]),this.toMatrix4(),this}translateTo(t,e){return this.translate(t-this.m31,e-this.m32)}translateX(t){return this.translate(t,0)}translateXTo(t){return this.translateTo(t,this.m32)}translateY(t){return this.translate(0,t)}translateYTo(t){return this.translateTo(this.m31,t)}translateZ(t){return this.matrix4.translate(0,0,t),this.matrix4.toMatrix(this),this}translateZTo(t){return this.translateZ(t-this.matrix4.m43),this}translate3d(t,e,s){return this.matrix4.translate(t,e,s),this.matrix4.toMatrix(this),this}translate3dTo(t,e,s){return this.translate3d(t-this.matrix4.m41,e-this.matrix4.m42,s-this.matrix4.m43),this}rotate(t,e=0,s=0){const i=q(t),r=Math.cos(i),o=Math.sin(i);return this.translate(e,s),this.multiply([r,o,-o,r,0,0]),this.translate(-e,-s),this.toMatrix4(),this}rotateTo(t,e=0,s=0){const{degree:i}=this.split();return this.rotate(t-i,e,s),this}rotateX(t){return this.matrix4.rotateX(t),this.matrix4.toMatrix(this),this}rotateXTo(t){const{degreeX:e}=this.matrix4.split();return this.rotateX(t-e),this}rotateY(t){return this.matrix4.rotateY(t),this.matrix4.toMatrix(this),this}rotateYTo(t){const{degreeY:e}=this.matrix4.split();return this.rotateY(t-e),this}rotateZ(t){return this.matrix4.rotateZ(t),this.matrix4.toMatrix(this),this}rotateZTo(t){const{degreeZ:e}=this.matrix4.split();return this.rotateZ(t-e),this}rotate3d(t,e,s){return this.matrix4.rotateX(t).rotateY(e).rotateZ(s),this.matrix4.toMatrix(this),this}rotate3dTo(t,e,s){const{degreeX:i,degreeY:r,degreeZ:o}=this.matrix4.split();return this.rotate3d(t-i,e-r,s-o),this}scale(t,e=t,s=0,i=0){return this.translate(s,i),this.multiply([t,0,0,e,0,0]),this.translate(-s,-i),this.toMatrix4(),this}scaleTo(t,e=t,s=0,i=0){return this.scale(t/this.m11,e/this.m22,s,i)}scaleX(t){return this.scale(t,1)}scaleXTo(t){return this.scale(t/this.m11,1)}scaleY(t){return this.scale(1,t)}scaleYTo(t){return this.scale(1,t/this.m22)}scaleZ(t){return this.matrix4.scale(1,1,t),this.matrix4.toMatrix(this),this}scaleZTo(t){const{scalarZ:e}=this.matrix4.split();return this.scaleZ(t/e),this}scale3d(t,e=t,s=t){return this.matrix4.scale(t,e,s),this.matrix4.toMatrix(this),this}scale3dTo(t,e=t,s=t){const{scalarX:i,scalarY:r,scalarZ:o}=this.matrix4.split();return this.scale3d(t/i,e/r,s/o),this}skew(t,e=t){return this.multiply([Math.cos(q(e)),Math.sin(q(e)),-Math.sin(q(t)),Math.cos(q(t)),0,0]),this.toMatrix4(),this}skewTo(t,e=t){const{skewX:s,skewY:i}=this.split();return this.skew(t-s,e-i)}skewX(t){const{skewY:e}=this.split();return this.skew(t,e)}skewXTo(t){const{skewY:e}=this.split();return this.skewTo(t,e)}skewY(t){const{skewX:e}=this.split();return this.skew(e,t)}skewYTo(t){const{skewX:e}=this.split();return this.skewTo(e,t)}skewZ(t){return this}skewZTo(t){return this}skew3d(t,e,s){return this}skew3dTo(t,e,s){return this}perspective(t){return this.matrix4.perspective(t),this.matrix4.toMatrix(this),this}}const Ng=new Bt(0,0,0),Fg=new Bt(1,1,1),De=new Bt,Jn=new Bt,Nt=new Bt,gs=new Bt,Zr=new ps,Zt=new kt;function Qr(n){const t=new wt;return n.replace(/([a-z0-9]+)\s*\(?\s*((-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)*[a-z%]*\s*,?\s*)+)\)?/gi,function(e,s,i){i.indexOf(",")>=0?i=i.split(/\s*,\s*/):i=i.split(/\s+/);const r=[];for(let o=0,a=i.length;o<a;o++)i[o].trim()&&r.push(parseFloat(""+i[o]));switch(s.toLowerCase()){case"t":case"translate":t.translate(r[0],r[1]);break;case"translatex":t.translateX(r[0]);break;case"translatey":t.translateY(r[0]);break;case"translatez":t.translateZ(r[0]);break;case"translate3d":t.translate3d(r[0],r[1],r[2]);break;case"r":case"rotate":t.rotate(r[0],r[1]??0,r[2]??0);break;case"rotatex":t.rotateX(r[0]);break;case"rotatey":t.rotateY(r[0]);break;case"rotatez":t.rotateZ(r[0]);break;case"rotate3d":t.rotate3d(r[0],r[1],r[2]);break;case"s":case"scale":t.scale(r[0],r[1]??r[0]);break;case"scalex":t.scaleX(r[0]);break;case"scaley":t.scaleY(r[0]);break;case"scalez":t.scaleZ(r[0]);break;case"scale3d":t.scale3d(r[0],r[1],r[2]);break;case"skew":t.skew(r[0],r[1]??0);break;case"skewx":t.skewX(r[0]);break;case"skewy":t.skewY(r[0]);break;case"skewz":t.skewZ(r[0]);break;case"skew3d":t.skew3d(r[0],r[1],r[2]);break;case"m":case"matrix":t.multiply([r[0],r[1],r[2],r[3],r[4],r[5]]),t.toMatrix4();break;case"matrix3d":t.matrix4.multiply(new kt(r)),t.matrix4.toMatrix(t);break}return""}),t}function Qt(n,t,e){const s=new wt;return s.rotate(mt(n)),s.transformPoint({x:t,y:e})}function Kr(n){const t=typeof n?.x=="number"?n?.x:0,e=typeof n?.y=="number"?n?.y:0,s=typeof n?.degree=="number"?n?.degree:0,i=typeof n?.scalarX=="number"?n?.scalarX:1,r=typeof n?.scalarY=="number"?n?.scalarY:1,o=q(s),a=Math.cos(o),h=Math.sin(o),c=new DOMMatrix([a*i,h*i,-h*r,a*r,t,e]);return c.multiplySelf(new DOMMatrix(n?.originMatrix||"")),c}function Yg(n,t){const e=new Path2D(n),s=new Path2D;return s.addPath(e,Kr(t)),s}function We(n,t,e){const s=Yr(n);return s.props.style=s.props.style||{},t?s.props.style[t]||s.props.style[va(t)]||s.props.style[lt(t)]||"":s.props.style}function ys(n,t,e){qn(n,s=>{s.props.style=s.props.style||{},typeof t=="string"&&e?s.props.style[t]=e:t instanceof Object&&Object.keys(t).forEach(i=>{s.props.style[i]=t[i]})}),Xr()}function to(n,t=!1){const e={};if(!t)if(getComputedStyle){const s=getComputedStyle(n);for(let i=0,r=s.length;i<r;i++){const o=s[i];e[o]=s.getPropertyValue(o)}}else{const s=n.currentStyle;for(const i in s)Object.prototype.hasOwnProperty.call(s,i)&&(e[i]=s[i])}return n.style.cssText&&n.style.cssText.split(";").forEach(s=>{const[i,r]=s.split(":").map(o=>o.trim());i&&r&&(e[i]=r)}),e}function Xg(n,t,e){let s=n.style[t]||"";if(!s&&getComputedStyle){t=lt(t);const i=getComputedStyle(n,e),r=i.getPropertyPriority(t);s=i.getPropertyValue(t).trim()+(r?"!"+r:"")}return s||(s=n.currentStyle[t]||""),s}function Zn(n,t,e){typeof t=="string"&&e?n.style.setProperty(lt(t),e.replace(/!important/i,""),e.toLowerCase().includes("!important")?"important":""):t instanceof Object&&Object.keys(t).forEach(s=>{Zn(n,s,t[s])})}function eo(n,t){typeof t=="string"?n.style.removeProperty(lt(t)):Object.keys(t).forEach(e=>{eo(n,e)})}function Oc(n,t){let e;if(typeof t=="string"){const s=document.querySelector(t)?.shadowRoot;s?e=s:e=document.querySelector(t)}else e=t||document.getElementsByTagName("head")[0];if(e){const s=document.createElement("style");return s.innerHTML=n,e.appendChild(s),()=>{(e instanceof HTMLElement||e instanceof ShadowRoot)&&e.removeChild(s)}}else{const s=document.styleSheets[0].insertRule(n);return()=>{document.styleSheets[0].deleteRule(s)}}}function Ug(n,t,e={}){Object.prototype.hasOwnProperty.call(e,"transform")||Object.assign(e,{transform:We(n,"transform")||""});const s=Qr(e.transform),i={};for(const r in t){const o=t[r];switch(r){case"transform":break;case"translate":s.translate(o[0]||0,o[1]||0);break;case"translateTo":s.translateTo(o[0]||0,o[1]||0);break;case"translateX":s.translateX(o||0);break;case"translateXTo":s.translateXTo(o||0);break;case"translateY":s.translateY(o||0);break;case"translateYTo":s.translateYTo(o||0);break;case"translateZ":s.translateZ(o||0);break;case"translateZTo":s.translateZTo(o||0);break;case"translate3d":s.translate3d(o[0]||0,o[1]||0,o[2]||0);break;case"translate3dTo":s.translate3dTo(o[0]||0,o[1]||0,o[2]||0);break;case"rotate":typeof o=="number"?s.rotate(o||0):s.rotate(o[0]||0,o[1]||0,o[2]||0);break;case"rotateTo":typeof o=="number"?s.rotateTo(o||0):s.rotateTo(o[0]||0,o[1]||0,o[2]||0);break;case"rotateX":s.rotateX(o||0);break;case"rotateXTo":s.rotateXTo(o||0);break;case"rotateY":s.rotateY(o||0);break;case"rotateYTo":s.rotateYTo(o||0);break;case"rotateZ":s.rotateZ(o||0);break;case"rotateZTo":s.rotateZTo(o||0);break;case"rotate3d":s.rotate3d(o[0]||0,o[1]||0,o[2]||0);break;case"rotate3dTo":s.rotate3dTo(o[0]||0,o[1]||0,o[2]||0);break;case"scale":typeof o=="number"?s.scale(o||1):s.scale(o[0]||1,o[1]||1,o[2]||0,o[3]||0);break;case"scaleTo":typeof o=="number"?s.scaleTo(o||1):s.scaleTo(o[0]||1,o[1]||1,o[2]||0,o[3]||0);break;case"scaleX":s.scaleX(o||1);break;case"scaleXTo":s.scaleXTo(o||1);break;case"scaleY":s.scaleY(o||1);break;case"scaleYTo":s.scaleYTo(o||1);break;case"scaleZ":s.scaleZ(o||1);break;case"scaleZTo":s.scaleZTo(o||1);break;case"scale3d":typeof o=="number"?s.scale3d(o||1):s.scale3d(o[0]||1,o[1]||1,o[2]||1);break;case"scale3dTo":typeof o=="number"?s.scale3dTo(o||1):s.scale3dTo(o[0]||1,o[1]||1,o[2]||1);break;case"skew":typeof o=="number"?s.skew(o||0):s.skew(o[0]||0,o[1]||0);break;case"skewTo":typeof o=="number"?s.skewTo(o||0):s.skewTo(o[0]||0,o[1]||0);break;case"skewX":s.skewX(o||0);break;case"skewXTo":s.skewXTo(o||0);break;case"skewY":s.skewY(o||0);break;case"skewYTo":s.skewYTo(o||0);break;case"skewZ":break;case"skewZTo":break;case"skew3d":break;case"skew3dTo":break;case"perspective":s.perspective(o||0);break;default:Object.prototype.hasOwnProperty.call(e,r)||(e[r]=We(n,r)),Object.assign(i,{[r]:`${o}`});break}}return Object.assign(i,{transform:s.toString()}),i}function oe(n,t,e){if(t===void 0&&e===void 0)return so(n);if(typeof t=="string"&&e===void 0)return zc(n,t);typeof t=="object"?qn(n,s=>{for(const i in t)i=="style"?ys(n,i,t[i]):Object.prototype.hasOwnProperty.call(t,i)&&(s.props[i]=""+t[i])}):typeof t=="string"&&typeof e=="string"&&(t=="style"?ys(n,t,e):qn(n,s=>{s.props[t]=""+e})),Xr()}const $g=["-o-","-ms-","-moz-","-webkit-",""];function so(n){const t={};for(let e=0,s=n.attributes,i=s.length;e<i;e++){const r=s[e];r.nodeName&&r.nodeValue&&(r.nodeName==="style"?t[r.nodeName]=to(n,!0):t[r.nodeName]=r.nodeValue)}return t}function zc(n,t){return t==="style"?to(n,!0):n.getAttribute(lt(t))}function ws(n,t,e){return n.setAttribute(lt(t),""+e)}function Vg(n,t){t.split(/[,\s]+/i).forEach(e=>{const s=lt(e.trim());s!=""&&n.removeAttribute(s)})}function Bc(n,t){for(const e in t){const s=t[e];switch(e){case"fill":s!=="none"&&(n.fillStyle=s);break;case"stroke":s!=="none"&&(n.strokeStyle=s);break;case"stroke-width":case"strokeWidth":n.lineWidth=Number(s);break;case"stroke-linecap":case"strokeLinecap":n.lineCap=s;break;case"stroke-linejoin":case"strokeLinejoin":switch(s){case"round":case"bevel":case"miter":n.lineJoin=s;break;default:n.lineJoin="miter";break}break;case"stroke-miterlimit":case"strokeMiterlimit":n.miterLimit=Number(s);break;case"stroke-opacity":case"strokeOpacity":break;case"stroke-dashoffset":case"strokeDashoffset":n.lineDashOffset=Number(s);break;case"stroke-dasharray":case"strokeDasharray":typeof s=="string"&&n.setLineDash(s.split(/\s+/).map(i=>Number(i)));break;case"cursor":break;case"font":typeof s=="string"&&(n.font=s);break;case"font-size":case"fontSize":n.font+=` ${s}`;break;case"font-family":case"fontFamily":n.font+=` ${s}`;break;case"font-weight":case"fontWeight":break;case"font-style":case"fontStyle":break;case"text-anchor":case"textAnchor":switch(s){case"middle":n.textAlign="center";break;case"end":n.textAlign="end";break;case"start":n.textAlign="start";break}break;case"alignment-baseline":case"alignmentBaseline":switch(s){case"middle":case"bottom":case"top":case"alphabetic":case"hanging":case"ideographic":n.textBaseline=s;break;default:n.textBaseline="alphabetic";break}break}}}function Gg(n,t,e,s,i){const r=t/e;let o=0,a=0;switch(n){case"aspectFit":r>=1?(o=s,a=o/r,a>i&&(a=i,o=a*r)):(a=i,o=a*r,o>s&&(o=s,a=o/r));break;case"aspectFill":r>=1?(a=i,o=a*r):(o=s,a=o/r);break;case"widthFix":o=s,a=o/r;break;case"heightFix":a=i,o=a*r;break;case"scaleToFill":default:o=s,a=i;break}return{width:o,height:a}}function Nc(n){try{const t=document.createElement("canvas"),e=t.getContext("2d");return t.width=n.width,t.height=n.height,e.drawImage(n,0,0,t.width,t.height),e.getImageData(0,0,t.width,t.height)}catch{return new ImageData(n.width,n.height)}}const qg=n=>{const t=n.width,e=n.height,s=t*e*3,i=s+54,r=[66,77,i&255,i>>8&255,i>>16&255,i>>24&255,0,0,0,0,54,0,0,0],o=[40,0,0,0,t&255,t>>8&255,t>>16&255,t>>24&255,e&255,e>>8&255,e>>16&255,e>>24&255,1,0,24,0,0,0,0,0,s&255,s>>8&255,s>>16&255,s>>24&255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],a=(4-t*3%4)%4,h=n.data;let c="";const l=t<<2;let u=e;const m=String.fromCharCode;do{const p=l*(u-1);let y="";for(let S=0;S<t;S++){const w=S<<2;y+=m(h[p+w+2])+m(h[p+w+1])+m(h[p+w])}for(let S=0;S<a;S++)y+=String.fromCharCode(0);c+=y}while(--u);function f(p){if(!window.btoa)throw"btoa undefined";let y="";if(typeof p=="string")y=p;else for(let S=0;S<p.length;S++)y+=String.fromCharCode(p[S]);return btoa(y)}return f(r.concat(o))+f(c)};function jg(n){const{width:t,height:e}=n,s=document.createElement("canvas"),i=s.getContext("2d");return s.width=t,s.height=e,i.putImageData(n,0,0,0,0,t,e),s.toDataURL("image/png")}const Hg=(n,t,e)=>{const{width:s,height:i}=n,r=document.createElement("canvas"),o=r.getContext("2d");r.width=s,r.height=i,o.putImageData(n,0,0,0,0,s,i);const a=`image/${t?t.toLowerCase():"png"}`;r.toBlob(h=>{e?.(null,h)},a,1)};function Wg(n,t){return createImageBitmap(n,t)}function Jg(n){const t=[],e=[],s=[];let i=0;for(let h=0,c=n.data.length;h<c;h+=4)t[i]=n.data[h],e[i]=n.data[h+1],s[i]=n.data[h+2],i+=1;const r=no(t),o=no(e),a=no(s);return"rgb("+r+","+o+","+a+")"}function no(n){const t={},e=[],s=[];for(let a=0;a<n.length;a++)t[n[a]]?e.push(n[a]):t[n[a]]=1;let i=0;for(let a=0;a<e.length;a++){i=0;for(let h=0;h<e.length;h++)e[a]===e[h]&&(i+=1),s[a]=i}const r=Math.max.apply(null,s);let o=0;for(;o<s.length;o++)if(s[o]===r)return;return e[o]}const Zg=n=>{const{data:t,width:e,height:s}=n,i=new Uint8ClampedArray(t.length);for(let o=0;o<s;o++)for(let a=0;a<e;a++){const h=(o*e+a)*4;i[h]=t[(o*e+e-a-1)*4],i[h+1]=t[(o*e+e-a-1)*4+1],i[h+2]=t[(o*e+e-a-1)*4+2],i[h+3]=t[(o*e+e-a-1)*4+3]}return new ImageData(i,e,s)},Qg=n=>{const{data:t,width:e,height:s}=n,i=new Uint8ClampedArray(t.length);for(let o=0;o<s;o++)for(let a=0;a<e;a++){const h=(o*e+a)*4;i[h]=t[((s-o-1)*e+a)*4],i[h+1]=t[((s-o-1)*e+a)*4+1],i[h+2]=t[((s-o-1)*e+a)*4+2],i[h+3]=t[((s-o-1)*e+a)*4+3]}return new ImageData(i,e,s)},Kg=n=>{const{data:t,width:e,height:s}=n,i=new Uint8ClampedArray(t.length);for(let o=0;o<e;o++)for(let a=0;a<s;a++){const h=(o*s+a)*4;i[h]=t[(a*e+e-o-1)*4],i[h+1]=t[(a*e+e-o-1)*4+1],i[h+2]=t[(a*e+e-o-1)*4+2],i[h+3]=t[(a*e+e-o-1)*4+3]}return new ImageData(i,s,e)},t0=n=>{const{data:t,width:e,height:s}=n,i=new Uint8ClampedArray(t.length);for(let o=0;o<e;o++)for(let a=0;a<s;a++){const h=(o*s+a)*4;i[h]=t[((s-a-1)*e+o)*4],i[h+1]=t[((s-a-1)*e+o)*4+1],i[h+2]=t[((s-a-1)*e+o)*4+2],i[h+3]=t[((s-a-1)*e+o)*4+3]}return new ImageData(i,s,e)},e0=n=>{const{data:t,width:e,height:s}=n,i=new Uint8ClampedArray(t.length);for(let o=0;o<s;o++)for(let a=0;a<e;a++){const h=(o*e+a)*4,c=(t[h]+t[h+1]+t[h+2])/3;i[h]=c,i[h+1]=c,i[h+2]=c,i[h+3]=t[h+3]}return new ImageData(i,e,s)},s0=n=>{const{data:t,width:e,height:s}=n,i=new Uint8ClampedArray(t.length);for(let o=0;o<s;o++)for(let a=0;a<e;a++){const h=(o*e+a)*4,c=.2126*t[h]+.7152*t[h+1]+.0722*t[h+2];i[h]=c,i[h+1]=c,i[h+2]=c,i[h+3]=t[h+3]}return new ImageData(i,e,s)},n0=n=>{const{data:t,width:e,height:s}=n,i=new Uint8ClampedArray(t.length);for(let o=0;o<s;o++)for(let a=0;a<e;a++){const h=(o*e+a)*4,l=(t[h]+t[h+1]+t[h+2])/3>127?255:0;i[h]=l,i[h+1]=l,i[h+2]=l,i[h+3]=t[h+3]}return new ImageData(i,e,s)},i0=n=>{const{data:t,width:e,height:s}=n,i=new Uint8ClampedArray(t.length);for(let o=0;o<s;o++)for(let a=0;a<e;a++){const h=(o*e+a)*4;i[h]=255-t[h],i[h+1]=255-t[h+1],i[h+2]=255-t[h+2],i[h+3]=t[h+3]}return new ImageData(i,e,s)},r0=n=>{const{data:t,width:e,height:s}=n,i=new Uint8ClampedArray(t.length);for(let o=0;o<s;o++)for(let a=0;a<e;a++){const h=(o*e+a)*4;i[h]=t[h],i[h+1]=0,i[h+2]=0,i[h+3]=t[h+3]}return new ImageData(i,e,s)},o0=n=>{const{data:t,width:e,height:s}=n,i=new Uint8ClampedArray(t.length);for(let o=0;o<s;o++)for(let a=0;a<e;a++){const h=(o*e+a)*4;i[h]=0,i[h+1]=t[h+1],i[h+2]=0,i[h+3]=t[h+3]}return new ImageData(i,e,s)},a0=n=>{const{data:t,width:e,height:s}=n,i=new Uint8ClampedArray(t.length);for(let o=0;o<s;o++)for(let a=0;a<e;a++){const h=(o*e+a)*4;i[h]=0,i[h+1]=0,i[h+2]=t[h+2],i[h+3]=t[h+3]}return new ImageData(i,e,s)},h0=n=>{const{data:t,width:e,height:s}=n,i=new Uint8ClampedArray(t.length);for(let o=0;o<s;o++)for(let a=0;a<e;a++){const h=(o*e+a)*4;i[h]=t[h],i[h+1]=t[h+1],i[h+2]=0,i[h+3]=t[h+3]}return new ImageData(i,e,s)},c0=n=>{const{data:t,width:e,height:s}=n,i=new Uint8ClampedArray(t.length);for(let o=0;o<s;o++)for(let a=0;a<e;a++){const h=(o*e+a)*4;i[h]=t[h],i[h+1]=0,i[h+2]=t[h+1],i[h+3]=t[h+3]}return new ImageData(i,e,s)},l0=n=>{const{data:t,width:e,height:s}=n,i=new Uint8ClampedArray(t.length);for(let o=0;o<s;o++)for(let a=0;a<e;a++){const h=(o*e+a)*4;i[h]=0,i[h+1]=t[h+1],i[h+2]=t[h+1],i[h+3]=t[h+3]}return new ImageData(i,e,s)},u0=n=>{const{data:t,width:e,height:s}=n,i=new Uint8ClampedArray(t.length);for(let o=0;o<s;o++)for(let a=0;a<e;a++){const h=(o*e+a)*4,c=(t[h+1]+t[h+2])/2;i[h]=t[h],i[h+1]=c,i[h+2]=c,i[h+3]=t[h+3]}return new ImageData(i,e,s)},f0=n=>{const{data:t,width:e,height:s}=n,i=new Uint8ClampedArray(t.length);for(let o=0;o<s;o++)for(let a=0;a<e;a++){const h=(o*e+a)*4,c=(t[h]+t[h+2])/2;i[h]=c,i[h+1]=t[h+1],i[h+2]=c,i[h+3]=t[h+3]}return new ImageData(i,e,s)},d0=n=>{const{data:t,width:e,height:s}=n,i=new Uint8ClampedArray(t.length);for(let o=0;o<s;o++)for(let a=0;a<e;a++){const h=(o*e+a)*4,c=(t[h]+t[h+1])/2;i[h]=c,i[h+1]=c,i[h+2]=t[h+2],i[h+3]=t[h+3]}return new ImageData(i,e,s)},m0=n=>Fc(n,[-1,-1,-1,-1,9,-1,-1,-1,-1]),p0=n=>Fc(n,[-1,-1,-1,-1,8,-1,-1,-1,-1]),g0=n=>{const{data:t,width:e,height:s}=n,i=new Uint8ClampedArray(t.length);for(let o=0;o<s;o++)for(let a=0;a<e;a++){const h=(o*e+a)*4;i[h]=t[h],i[h+1]=t[h+1],i[h+2]=t[h+2],i[h+3]=255}return new ImageData(i,e,s)},y0=n=>{const{data:t,width:e,height:s}=n,i=new Uint8ClampedArray(t.length);for(let o=0;o<s;o++)for(let a=0;a<e;a++){const h=(o*e+a)*4;if(t[h+3]===0)i[h]=255,i[h+1]=255,i[h+2]=255,i[h+3]=255;else{const c=Yc([t[h],t[h+1],t[h+2],t[h+3]],[255,255,255,255]);i[h]=c[0],i[h+1]=c[1],i[h+2]=c[2],i[h+3]=c[3]}}return new ImageData(i,e,s)};function w0(n,t,e,s,i,r=!1,o){const{data:a,width:h,height:c}=n;let l=i,u=s,m=t,f=e;if(l<0?l=0:l>h&&(l=h),u<0?u=0:u>c&&(u=c),m<1?m=1:m>h&&(m=h),f<1?f=1:f>c&&(f=c),l+m>h&&(m=h-l),u+f>c&&(f=c-u),r){const p=new Uint8ClampedArray(a.length);for(let S=0;S<c;S++)for(let w=0;w<h;w++){const v=(S*h+w)*4;w>=l&&w<=l+m&&S>=u&&S<=u+f?(p[v]=a[v],p[v+1]=a[v+1],p[v+2]=a[v+2],p[v+3]=a[v+3]):(p[v]=255,p[v+1]=255,p[v+2]=255,p[v+3]=o&&["JPG","JPEG"].includes(o.toUpperCase())?255:0)}return new ImageData(p,h,c)}else{const p=new Uint8ClampedArray(m*f*4);for(let S=u;S<=u+f;S++)for(let w=l;w<=l+m;w++){const v=((S-u)*m+w-l)*4,x=(S*h+w)*4;p[v]=a[x],p[v+1]=a[x+1],p[v+2]=a[x+2],p[v+3]=a[x+3]}return new ImageData(p,m,f)}}function x0(n,t,e,s){const{data:i,width:r,height:o}=n;let a=t;a>Math.floor(r/2)&&(a=Math.floor(r/2)),a>Math.floor(o/2)&&(a=Math.floor(o/2)),a<0&&(a=0);const h=new Uint8ClampedArray(i.length);for(let l=0;l<o;l++)for(let u=0;u<r;u++){const m=(l*r+u)*4;let f=-1;u<a?l<a?f=Math.sqrt(Math.pow(a-u-1,2)+Math.pow(a-l-1,2)):l>o-a-1&&(f=Math.sqrt(Math.pow(a-u-1,2)+Math.pow(l-(o-a),2))):u>r-a-1&&(l<a?f=Math.sqrt(Math.pow(u-(r-a),2)+Math.pow(a-l-1,2)):l>o-a-1&&(f=Math.sqrt(Math.pow(u-(r-a),2)+Math.pow(l-(o-a),2)))),Math.round(f)>a?(h[m]=255,h[m+1]=255,h[m+2]=255,h[m+3]=s||e.toUpperCase()==="PNG"?0:255):(h[m]=i[m],h[m+1]=i[m+1],h[m+2]=i[m+2],h[m+3]=s||e.toUpperCase()==="PNG"?i[m+3]:255)}return new ImageData(h,r,o)}function b0(n,t,e,s,i,r=1e4){const o=new Image;o.src=n;const a=document.createElement("canvas"),h=a.getContext("2d");return a.width=r,a.height=r,h.drawImage(o,0,0,t,e,0,0,s,i),h.getImageData(0,0,s,i)}function v0(n,t){const{data:e,width:s,height:i}=n,r=new Uint8ClampedArray(e.length);for(let a=0;a<i;a++)for(let h=0;h<s;h++){const c=(a*s+h)*4;r[c]=Math.max(Math.min(e[c]+t,255),0),r[c+1]=Math.max(Math.min(e[c+1]+t,255),0),r[c+2]=Math.max(Math.min(e[c+2]+t,255),0),r[c+3]=e[c+3]}return new ImageData(r,s,i)}function S0(n,t,e=!1){const{data:s,width:i,height:r}=n,o=new Uint8ClampedArray(s.length);for(let h=0;h<r;h++)for(let c=0;c<i;c++){const l=(h*i+c)*4;s[l+3]===0?(o[l]=255,o[l+1]=255,o[l+2]=255):(o[l]=s[l],o[l+1]=s[l+1],o[l+2]=s[l+2]);let u=s[l+3];e?u=Math.max(Math.min(Math.floor(255*t),255),0):u=Math.max(Math.min(Math.floor(u+255*t),255),0),o[l+3]=u}return new ImageData(o,i,r)}function _0(n,t,e,s){const{data:i,width:r,height:o}=n,{data:a,width:h,height:c}=t;let l=e,u=s;e+c>o&&(l=o-c),s+h>r&&(u=r-h);const m=new Uint8ClampedArray(i.length);for(let p=0;p<o;p++)for(let y=0;y<r;y++){const S=(p*r+y)*4;if(y<u||y>u+h||p<=l||p>=l+c)m[S]=i[S],m[S+1]=i[S+1],m[S+2]=i[S+2],m[S+3]=i[S+3];else{const w=(p*r+y-((l+1)*r+(p-(l+1))*(r-h))+h-u-1)*4,v=[a[w],a[w+1],a[w+2],a[w+3]],x=[i[S],i[S+1],i[S+2],i[S+3]],b=Yc(v,x);m[S]=b[0],m[S+1]=b[1],m[S+2]=b[2],m[S+3]=b[3]}}return new ImageData(m,r,o)}function C0(n,t,e,s,i,r=10){const{data:o,width:a,height:h}=n;let c=i,l=s,u=t,m=e;c<0?c=0:c>a&&(c=a),l<0?l=0:l>h&&(l=h),u<1?u=1:u>a&&(u=a),m<1?m=1:m>h&&(m=h),c+u>a&&(u=a-c),l+m>h&&(m=h-l);const f=new Uint8ClampedArray(o.length);for(let y=0;y<h;y++)for(let S=0;S<a;S++){const w=(y*a+S)*4;if(S>=c&&S<=c+u&&y>=l&&y<=l+m){const v=Math.floor((S-c)/r),x=Math.floor((y-l)/r);let b=Math.floor(r*(v+1)-r/2+c),P=Math.floor(r*(x+1)-r/2+l);b>a-1&&(b=a-1),P>h-1&&(P=h-1);const C=(P*a+b)*4;f[w]=o[C],f[w+1]=o[C+1],f[w+2]=o[C+2],f[w+3]=o[C+3]}else f[w]=o[w],f[w+1]=o[w+1],f[w+2]=o[w+2],f[w+3]=o[w+3]}return new ImageData(f,a,h)}function T0(n,t,e={backgroundColor:{r:0,g:0,b:0,a:255},changeIntoColor:{r:0,g:0,b:0,a:0}}){if(t&&e){const{data:s,width:i,height:r}=n,{data:o}=t,a=new Uint8ClampedArray(s.length),{backgroundColor:h,changeIntoColor:c}=e;for(let u=0;u<r;u++)for(let m=0;m<i;m++){const f=(u*i+m)*4,p=o[f],y=o[f+1],S=o[f+2],w=o[f+3];p===h.r&&y===h.g&&S===h.b&&w===h.a&&c.a!==0?(a[f]=c.r,a[f+1]=c.g,a[f+2]=c.b,a[f+3]=c.a):(a[f]=s[f],a[f+1]=s[f+1],a[f+2]=s[f+2],a[f+3]=s[f+3])}return new ImageData(a,i,r)}return n}function Fc(n,t){const{data:e,width:s,height:i}=n,r=new Uint8ClampedArray(e.length);for(let a=0;a<i;a++)for(let h=0;h<s;h++){const c=(a*s+h)*4;for(let l=0;l<3;l++){const u=c+l;h===0||h===s-1||a===0||a===i-1?r[u]=e[u]:r[u]=t[0]*e[u-s*4-4]+t[1]*e[u-s*4]+t[2]*e[u-s*4+4]+t[3]*e[u-4]+t[4]*e[u]+t[5]*e[u+4]+t[6]*e[u+s*4-4]+t[7]*e[u+s*4]+t[8]*e[u+s*4+4]}r[c+3]=e[c+3]}return new ImageData(r,s,i)}function Yc(n,t){if(n&&n.length===4&&t&&t.length===4){const e=n[3],s=t[3];if(e===255||s===0)return n;if(e===0)return t;{const i=e/255,r=s/255,o=Math.max(Math.min(Math.floor(n[0]*i+t[0]*r*(1-i)),255),0),a=Math.max(Math.min(Math.floor(n[1]*i+t[1]*r*(1-i)),255),0),h=Math.max(Math.min(Math.floor(n[2]*i+t[2]*r*(1-i)),255),0),c=Math.max(Math.min(Math.floor((i+r*(1-i))*255),255),0);return[o,a,h,c]}}return[255,255,255,255]}const io=function(){const n=[];return{writeByte(t){n.push(t&255)},writeShort(t){this.writeByte(t),this.writeByte(t>>>8)},writeBytes(t,e=0,s=t.length){for(let i=0;i<s;i++)this.writeByte(t[i+e])},writeString(t){for(let e=0,s=t.length;e<s;e++)this.writeByte(t.charCodeAt(e))},toByteArray(){return n},toString(){let t="[";for(let e=0,s=n.length;e<s;e++)e>0&&(t+=","),t+=n[e];return t+="]",t}}},Xc=function(){let n=0,t=0,e=0,s="";const i=function(o){if(!(o<0)){if(o<26)return 65+o;if(o<52)return 97+(o-26);if(o<62)return 48+(o-52);if(o==62)return 43;if(o==63)return 47}throw new Error("n:"+o)},r=function(o){s+=String.fromCharCode(i(o&63))};return{writeByte(o){for(n=n<<8|o&255,t+=8,e+=1;t>=6;)r(n>>>t-6),t-=6},flush(){if(t>0&&(r(n<<6-t),n=0,t=0),e%3!=0){const o=3-e%3;for(let a=0;a<o;a++)s+="="}},toString(){return s}}},Uc=function(n,t,e){const s=new Array(n*n),i=function(a){const h=a;let c=0,l=0;return{write(u,m){if(u>>>m)throw new Error("length over");for(;c+m>=8;)h.writeByte(255&(u<<c|l)),m-=8-c,u>>>=8-c,l=0,c=0;l=u<<c|l,c=c+m},flush(){c>0&&h.writeByte(l)}}},r=function(a){const h=1<<a,c=(1<<a)+1;let l=a+1;const u=o();for(let S=0;S<h;S++)u.add(String.fromCharCode(S));u.add(String.fromCharCode(h)),u.add(String.fromCharCode(c));const m=io(),f=i(m);f.write(h,l);let p=0,y=String.fromCharCode(s[p]);for(p+=1;p<s.length;){const S=String.fromCharCode(s[p]);p+=1,u.contains(y+S)?y=y+S:(f.write(u.indexOf(y),l),u.size()<4095&&(u.size()==1<<l&&(l+=1),u.add(y+S)),y=S)}return f.write(u.indexOf(y),l),f.write(c,l),f.flush(),m.toByteArray()},o=function(){const a={};let h=0;return{add(c){if(this.contains(c))throw new Error("dup key:"+c);a[c]=h,h+=1},size(){return h},indexOf(c){return a[c]},contains(c){return typeof a[c]<"u"}}};return{setPixel(a,h,c){s[h*n+a]=c},write(a){a.writeString("GIF87a"),a.writeShort(n),a.writeShort(n),a.writeByte(128),a.writeByte(0),a.writeByte(0),a.writeByte(hs("0x"+t[1]+t[2])),a.writeByte(hs("0x"+t[3]+t[4])),a.writeByte(hs("0x"+t[5]+t[6])),a.writeByte(hs("0x"+e[1]+e[2])),a.writeByte(hs("0x"+e[3]+e[4])),a.writeByte(hs("0x"+e[5]+e[6])),a.writeString(","),a.writeShort(0),a.writeShort(0),a.writeShort(n),a.writeShort(n),a.writeByte(0);const h=2,c=r(h);a.writeByte(h);let l=0;for(;c.length-l>255;)a.writeByte(255),a.writeBytes(c,l,255),l+=255;a.writeByte(c.length-l),a.writeBytes(c,l,c.length-l),a.writeByte(0),a.writeString(";")}}},$c=function(n,t,e,s){const i=Uc(n,t,e);for(let c=0;c<n;c++)for(let l=0;l<n;l++)i.setPixel(l,c,s(l,c));const r=io();i.write(r);const o=Xc(),a=r.toByteArray();for(let c=0,l=a.length;c<l;c++)o.writeByte(a[c]);o.flush();let h="";return h+="data:image/gif;base64,",h+=o,h},Ft={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},Zs={M:0,L:1,H:2,Q:3},Le={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},pt={glog:function(n){if(n<1)throw new Error("glog("+n+")");return pt.LOG_TABLE[n]},gexp:function(n){for(;n<0;)n+=255;for(;n>=256;)n-=255;return pt.EXP_TABLE[n]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)};for(let n=0;n<8;n++)pt.EXP_TABLE[n]=1<<n;for(let n=8;n<256;n++)pt.EXP_TABLE[n]=pt.EXP_TABLE[n-4]^pt.EXP_TABLE[n-5]^pt.EXP_TABLE[n-6]^pt.EXP_TABLE[n-8];for(let n=0;n<255;n++)pt.LOG_TABLE[pt.EXP_TABLE[n]]=n;const Q={PATTERN_POSITION_TABLE:[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],G15:1335,G18:7973,G15_MASK:21522,getBCHTypeInfo:function(n){let t=n<<10;for(;Q.getBCHDigit(t)-Q.getBCHDigit(Q.G15)>=0;)t^=Q.G15<<Q.getBCHDigit(t)-Q.getBCHDigit(Q.G15);return(n<<10|t)^Q.G15_MASK},getBCHTypeNumber:function(n){let t=n<<12;for(;Q.getBCHDigit(t)-Q.getBCHDigit(Q.G18)>=0;)t^=Q.G18<<Q.getBCHDigit(t)-Q.getBCHDigit(Q.G18);return n<<12|t},getBCHDigit:function(n){let t=0;for(;n!=0;)t++,n>>>=1;return t},getPatternPosition:function(n){return Q.PATTERN_POSITION_TABLE[n-1]},getMask:function(n,t,e){switch(n){case Le.PATTERN000:return(t+e)%2==0;case Le.PATTERN001:return t%2==0;case Le.PATTERN010:return e%3==0;case Le.PATTERN011:return(t+e)%3==0;case Le.PATTERN100:return(Math.floor(t/2)+Math.floor(e/3))%2==0;case Le.PATTERN101:return t*e%2+t*e%3==0;case Le.PATTERN110:return(t*e%2+t*e%3)%2==0;case Le.PATTERN111:return(t*e%3+(t+e)%2)%2==0;default:throw new Error("bad maskPattern:"+n)}},getErrorCorrectPolynomial:function(n){let t=new xs([1],0);for(let e=0;e<n;e++)t=t.multiply(new xs([1,pt.gexp(e)],0));return t},getLengthInBits:function(n,t){if(1<=t&&t<10)switch(n){case Ft.MODE_NUMBER:return 10;case Ft.MODE_ALPHA_NUM:return 9;case Ft.MODE_8BIT_BYTE:return 8;case Ft.MODE_KANJI:return 8;default:throw new Error("mode:"+n)}else if(t<27)switch(n){case Ft.MODE_NUMBER:return 12;case Ft.MODE_ALPHA_NUM:return 11;case Ft.MODE_8BIT_BYTE:return 16;case Ft.MODE_KANJI:return 10;default:throw new Error("mode:"+n)}else if(t<41)switch(n){case Ft.MODE_NUMBER:return 14;case Ft.MODE_ALPHA_NUM:return 13;case Ft.MODE_8BIT_BYTE:return 16;case Ft.MODE_KANJI:return 12;default:throw new Error("mode:"+n)}else throw new Error("type:"+t)},getLostPoint:function(n){const t=n.getModuleCount();let e=0;for(let r=0;r<t;r++)for(let o=0;o<t;o++){let a=0;const h=n.isDark(r,o);for(let c=-1;c<=1;c++)if(!(r+c<0||t<=r+c))for(let l=-1;l<=1;l++)o+l<0||t<=o+l||c==0&&l==0||h==n.isDark(r+c,o+l)&&a++;a>5&&(e+=3+a-5)}for(let r=0;r<t-1;r++)for(let o=0;o<t-1;o++){let a=0;n.isDark(r,o)&&a++,n.isDark(r+1,o)&&a++,n.isDark(r,o+1)&&a++,n.isDark(r+1,o+1)&&a++,(a==0||a==4)&&(e+=3)}for(let r=0;r<t;r++)for(let o=0;o<t-6;o++)n.isDark(r,o)&&!n.isDark(r,o+1)&&n.isDark(r,o+2)&&n.isDark(r,o+3)&&n.isDark(r,o+4)&&!n.isDark(r,o+5)&&n.isDark(r,o+6)&&(e+=40);for(let r=0;r<t;r++)for(let o=0;o<t-6;o++)n.isDark(o,r)&&!n.isDark(o+1,r)&&n.isDark(o+2,r)&&n.isDark(o+3,r)&&n.isDark(o+4,r)&&!n.isDark(o+5,r)&&n.isDark(o+6,r)&&(e+=40);let s=0;for(let r=0;r<t;r++)for(let o=0;o<t;o++)n.isDark(o,r)&&s++;const i=Math.abs(100*s/t/t-50)/5;return e+=i*10,e}};class xs{num;constructor(t,e){if(t.length==null)throw new Error(t.length+"/"+e);let s=0;for(;s<t.length&&t[s]==0;)s++;this.num=new Array(t.length-s+e);for(let i=0;i<t.length-s;i++)this.num[i]=t[i+s]}get(t){return this.num[t]}getLength(){return this.num.length}multiply(t){const e=new Array(this.getLength()+t.getLength()-1);for(let s=0;s<this.getLength();s++)for(let i=0;i<t.getLength();i++)e[s+i]^=pt.gexp(pt.glog(this.get(s))+pt.glog(t.get(i)));return new xs(e,0)}mod(t){if(this.getLength()-t.getLength()<0)return this;const e=pt.glog(this.get(0))-pt.glog(t.get(0)),s=new Array(this.getLength());for(let i=0;i<this.getLength();i++)s[i]=this.get(i);for(let i=0;i<t.getLength();i++)s[i]^=pt.gexp(pt.glog(t.get(i))+e);return new xs(s,0).mod(t)}}class ge{totalCount;dataCount;constructor(t,e){this.totalCount=t,this.dataCount=e}static RS_BLOCK_TABLE=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]];static getRSBlocks(t,e){const s=ge.getRsBlockTable(t,e);if(s==null)throw new Error("bad rs block @ typeNumber:"+t+"/errorCorrectLevel:"+e);const i=s.length/3,r=[];for(let o=0;o<i;o++){const a=s[o*3+0],h=s[o*3+1],c=s[o*3+2];for(let l=0;l<a;l++)r.push(new ge(h,c))}return r}static getRsBlockTable(t,e){switch(e){case Zs.L:return ge.RS_BLOCK_TABLE[(t-1)*4+0];case Zs.M:return ge.RS_BLOCK_TABLE[(t-1)*4+1];case Zs.Q:return ge.RS_BLOCK_TABLE[(t-1)*4+2];case Zs.H:return ge.RS_BLOCK_TABLE[(t-1)*4+3];default:return}}}class Vc{buffer;length;constructor(){this.buffer=[],this.length=0}get(t){const e=Math.floor(t/8);return(this.buffer[e]>>>7-t%8&1)==1}put(t,e){for(let s=0;s<e;s++)this.putBit((t>>>e-s-1&1)==1)}getLengthInBits(){return this.length}putBit(t){const e=Math.floor(this.length/8);this.buffer.length<=e&&this.buffer.push(0),t&&(this.buffer[e]|=128>>>this.length%8),this.length++}}class P0{mode;data;constructor(t){this.mode=Ft.MODE_8BIT_BYTE,this.data=t}getLength(){return this.data.length}write(t){for(let e=0,s=this.data.length;e<s;e++)t.put(this.data.charCodeAt(e),8)}}class Re{static PAD0=236;static PAD1=17;typeNumber;errorCorrectLevel;modules;moduleCount;dataCache;dataList;constructor(t,e){this.typeNumber=t,this.errorCorrectLevel=Zs[e],this.modules=[],this.moduleCount=0,this.dataCache=null,this.dataList=[]}addData(t){const e=new P0(t);this.dataList.push(e),this.dataCache=null}isDark(t,e){if(t<0||this.moduleCount<=t||e<0||this.moduleCount<=e)throw new Error(t+","+e);return this.modules[t][e]}getModuleCount(){return this.moduleCount}make(){if(this.typeNumber<1){let t=1;for(t=1;t<40;t++){const e=ge.getRSBlocks(t,this.errorCorrectLevel),s=new Vc;let i=0;for(let r=0;r<e.length;r++)i+=e[r].dataCount;for(let r=0;r<this.dataList.length;r++){const o=this.dataList[r];s.put(o.mode,4),s.put(o.getLength(),Q.getLengthInBits(o.mode,t)),o.write(s)}if(s.getLengthInBits()<=i*8)break}this.typeNumber=t}this.makeImpl(!1,this.getBestMaskPattern())}makeImpl(t,e){this.moduleCount=this.typeNumber*4+17,this.modules=new Array(this.moduleCount);for(let s=0;s<this.moduleCount;s++){this.modules[s]=new Array(this.moduleCount);for(let i=0;i<this.moduleCount;i++)this.modules[s][i]=null}this.setupPositionProbePattern(0,0),this.setupPositionProbePattern(this.moduleCount-7,0),this.setupPositionProbePattern(0,this.moduleCount-7),this.setupPositionAdjustPattern(),this.setupTimingPattern(),this.setupTypeInfo(t,e),this.typeNumber>=7&&this.setupTypeNumber(t),this.dataCache==null&&(this.dataCache=Re.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,e)}setupPositionProbePattern(t,e){for(let s=-1;s<=7;s++)if(!(t+s<=-1||this.moduleCount<=t+s))for(let i=-1;i<=7;i++)e+i<=-1||this.moduleCount<=e+i||(0<=s&&s<=6&&(i==0||i==6)||0<=i&&i<=6&&(s==0||s==6)||2<=s&&s<=4&&2<=i&&i<=4?this.modules[t+s][e+i]=!0:this.modules[t+s][e+i]=!1)}getBestMaskPattern(){let t=0,e=0;for(let s=0;s<8;s++){this.makeImpl(!0,s);const i=Q.getLostPoint(this);(s==0||t>i)&&(t=i,e=s)}return e}createMovieClip(t,e,s){const i=t.createEmptyMovieClip(e,s),r=1;this.make();for(let o=0;o<this.modules.length;o++){const a=o*r;for(let h=0;h<this.modules[o].length;h++){const c=h*r;this.modules[o][h]&&(i.beginFill(0,100),i.moveTo(c,a),i.lineTo(c+r,a),i.lineTo(c+r,a+r),i.lineTo(c,a+r),i.endFill())}}return i}setupTimingPattern(){for(let t=8;t<this.moduleCount-8;t++)this.modules[t][6]==null&&(this.modules[t][6]=t%2==0);for(let t=8;t<this.moduleCount-8;t++)this.modules[6][t]==null&&(this.modules[6][t]=t%2==0)}setupPositionAdjustPattern(){const t=Q.getPatternPosition(this.typeNumber);for(let e=0;e<t.length;e++)for(let s=0;s<t.length;s++){const i=t[e],r=t[s];if(this.modules[i][r]==null)for(let o=-2;o<=2;o++)for(let a=-2;a<=2;a++)o==-2||o==2||a==-2||a==2||o==0&&a==0?this.modules[i+o][r+a]=!0:this.modules[i+o][r+a]=!1}}setupTypeNumber(t){const e=Q.getBCHTypeNumber(this.typeNumber);for(let s=0;s<18;s++){const i=!t&&(e>>s&1)==1;this.modules[Math.floor(s/3)][s%3+this.moduleCount-8-3]=i}for(let s=0;s<18;s++){const i=!t&&(e>>s&1)==1;this.modules[s%3+this.moduleCount-8-3][Math.floor(s/3)]=i}}setupTypeInfo(t,e){const s=this.errorCorrectLevel<<3|e,i=Q.getBCHTypeInfo(s);for(let r=0;r<15;r++){const o=!t&&(i>>r&1)==1;r<6?this.modules[r][8]=o:r<8?this.modules[r+1][8]=o:this.modules[this.moduleCount-15+r][8]=o}for(let r=0;r<15;r++){const o=!t&&(i>>r&1)==1;r<8?this.modules[8][this.moduleCount-r-1]=o:r<9?this.modules[8][15-r-1+1]=o:this.modules[8][15-r-1]=o}this.modules[this.moduleCount-8][8]=!t}mapData(t,e){let s=-1,i=this.moduleCount-1,r=7,o=0;for(let a=this.moduleCount-1;a>0;a-=2)for(a==6&&a--;;){for(let h=0;h<2;h++)if(this.modules[i][a-h]==null){let c=!1;o<t.length&&(c=(t[o]>>>r&1)==1),Q.getMask(e,i,a-h)&&(c=!c),this.modules[i][a-h]=c,r--,r==-1&&(o++,r=7)}if(i+=s,i<0||this.moduleCount<=i){i-=s,s=-s;break}}}static createData(t,e,s){const i=ge.getRSBlocks(t,e),r=new Vc;for(let a=0;a<s.length;a++){const h=s[a];r.put(h.mode,4),r.put(h.getLength(),Q.getLengthInBits(h.mode,t)),h.write(r)}let o=0;for(let a=0;a<i.length;a++)o+=i[a].dataCount;if(r.getLengthInBits()>o*8)throw new Error("code length overflow. ("+r.getLengthInBits()+">"+o*8+")");for(r.getLengthInBits()+4<=o*8&&r.put(0,4);r.getLengthInBits()%8!=0;)r.putBit(!1);for(;!(r.getLengthInBits()>=o*8||(r.put(Re.PAD0,8),r.getLengthInBits()>=o*8));)r.put(Re.PAD1,8);return Re.createBytes(r,i)}static createBytes(t,e){let s=0,i=0,r=0;const o=new Array(e.length),a=new Array(e.length);for(let u=0;u<e.length;u++){const m=e[u].dataCount,f=e[u].totalCount-m;i=Math.max(i,m),r=Math.max(r,f),o[u]=new Array(m);for(let w=0;w<o[u].length;w++)o[u][w]=255&t.buffer[w+s];s+=m;const p=Q.getErrorCorrectPolynomial(f),S=new xs(o[u],p.getLength()-1).mod(p);a[u]=new Array(p.getLength()-1);for(let w=0;w<a[u].length;w++){const v=w+S.getLength()-a[u].length;a[u][w]=v>=0?S.get(v):0}}let h=0;for(let u=0;u<e.length;u++)h+=e[u].totalCount;const c=new Array(h);let l=0;for(let u=0;u<i;u++)for(let m=0;m<e.length;m++)u<o[m].length&&(c[l++]=o[m][u]);for(let u=0;u<r;u++)for(let m=0;m<e.length;m++)u<a[m].length&&(c[l++]=a[m][u]);return c}}const Gc=Math.ceil,Qs=Math.floor,qc=Math.round;function E0(n,t){const e=Sa(n),s=t?.ecc||"H",i=t?.size||256,r=-1,o=t?.padding||0,a=t?.color||"#000000",h=t?.background||"#ffffff",c=new Re(r,s);c.addData(e),c.make();const l=c.getModuleCount(),u=(i-o*2)/l,m=o,f=i-o;return $c(i,a,h,function(p,y){if(m<=p&&p<f&&m<=y&&y<f){const S=Qs((p-m)/u),w=Qs((y-m)/u);return c.isDark(w,S)?0:1}else return 1})}function M0(n,t){const e=t.x||0,s=t.y||0,i=Sa(n),r=t.ctx,o=t.ecc||"H",a=typeof t.size=="number"?Qs(t.size):256,h=t.padding||0,c=-1,l=t.color||"#000000",u=t.background||"#ffffff",m=new Re(c,o);m.addData(i),m.make();const f=m.getModuleCount(),p=(a-h*2)/f;r.fillStyle=u,r.fillRect(e,s,a,a);for(let y=0;y<f;y++)for(let S=0;S<f;S++){const w=Gc((S+1)*p)-Qs(S*p),v=Gc((y+1)*p)-Qs(y*p);r.fillStyle=m.isDark(y,S)?l:u,r.fillRect(e+qc(S*p)+h,s+qc(y*p)+h,w,v)}}const Qn=new Ws,ct=new Bt;function Ks(n,t){switch(t.constructor){case Float32Array:return n;case Uint32Array:return n/4294967295;case Uint16Array:return n/65535;case Uint8Array:return n/255;case Int32Array:return Math.max(n/2147483647,-1);case Int16Array:return Math.max(n/32767,-1);case Int8Array:return Math.max(n/127,-1);default:throw new Error("Invalid component type.")}}function Dt(n,t){switch(t.constructor){case Float32Array:return n;case Uint32Array:return Math.round(n*4294967295);case Uint16Array:return Math.round(n*65535);case Uint8Array:return Math.round(n*255);case Int32Array:return Math.round(n*2147483647);case Int16Array:return Math.round(n*32767);case Int8Array:return Math.round(n*127);default:throw new Error("Invalid component type.")}}class ye{array;itemSize;count;normalized;updateRanges;version;constructor(t,e,s=!1){if(Array.isArray(t))throw new TypeError("BufferAttribute: array should be a Typed Array.");this.array=t,this.itemSize=e,this.count=t.length/e,this.normalized=s,this.updateRanges=[],this.version=0}_onChangeCallback(){}set needsUpdate(t){t===!0&&this.version++}addUpdateRange(t,e){this.updateRanges.push({start:t,count:e})}clearUpdateRanges(){this.updateRanges.length=0}copy(t){return this.array=Gu(t.array),this.itemSize=t.itemSize,this.count=t.count,this.normalized=t.normalized,this}copyAt(t,e,s){t*=this.itemSize,s*=e.itemSize;for(let i=0,r=this.itemSize;i<r;i++)this.array[t+i]=e.array[s+i];return this}copyArray(t){return this.array.set(t),this}applyMatrix3(t){if(this.itemSize===2)for(let e=0,s=this.count;e<s;e++)Qn.fromBufferAttribute(this,e),Qn.applyMatrix3(t),this.setXY(e,Qn.x,Qn.y);else if(this.itemSize===3)for(let e=0,s=this.count;e<s;e++)ct.fromBufferAttribute(this,e),ct.applyMatrix3(t),this.setXYZ(e,ct.x,ct.y,ct.z);return this}applyMatrix4(t){for(let e=0,s=this.count;e<s;e++)ct.fromBufferAttribute(this,e),ct.applyMatrix4(t),this.setXYZ(e,ct.x,ct.y,ct.z);return this}applyNormalMatrix(t){for(let e=0,s=this.count;e<s;e++)ct.fromBufferAttribute(this,e),ct.applyNormalMatrix(t),this.setXYZ(e,ct.x,ct.y,ct.z);return this}transformDirection(t){for(let e=0,s=this.count;e<s;e++)ct.fromBufferAttribute(this,e),ct.transformDirection(t),this.setXYZ(e,ct.x,ct.y,ct.z);return this}set(t,e=0){return this.array.set(t,e),this}getComponent(t,e){let s=this.array[t*this.itemSize+e];return this.normalized&&(s=Ks(s,this.array)),s}setComponent(t,e,s){return this.normalized&&(s=Dt(s,this.array)),this.array[t*this.itemSize+e]=s,this}getX(t){let e=this.array[t*this.itemSize];return this.normalized&&(e=Ks(e,this.array)),e}setX(t,e){return this.normalized&&(e=Dt(e,this.array)),this.array[t*this.itemSize]=e,this}getY(t){let e=this.array[t*this.itemSize+1];return this.normalized&&(e=Ks(e,this.array)),e}setY(t,e){return this.normalized&&(e=Dt(e,this.array)),this.array[t*this.itemSize+1]=e,this}getZ(t){let e=this.array[t*this.itemSize+2];return this.normalized&&(e=Ks(e,this.array)),e}setZ(t,e){return this.normalized&&(e=Dt(e,this.array)),this.array[t*this.itemSize+2]=e,this}getW(t){let e=this.array[t*this.itemSize+3];return this.normalized&&(e=Ks(e,this.array)),e}setW(t,e){return this.normalized&&(e=Dt(e,this.array)),this.array[t*this.itemSize+3]=e,this}setXY(t,e,s){return t*=this.itemSize,this.normalized&&(e=Dt(e,this.array),s=Dt(s,this.array)),this.array[t+0]=e,this.array[t+1]=s,this}setXYZ(t,e,s,i){return t*=this.itemSize,this.normalized&&(e=Dt(e,this.array),s=Dt(s,this.array),i=Dt(i,this.array)),this.array[t+0]=e,this.array[t+1]=s,this.array[t+2]=i,this}setXYZW(t,e,s,i,r){return t*=this.itemSize,this.normalized&&(e=Dt(e,this.array),s=Dt(s,this.array),i=Dt(i,this.array),r=Dt(r,this.array)),this.array[t+0]=e,this.array[t+1]=s,this.array[t+2]=i,this.array[t+3]=r,this}onChange(t){return this._onChangeCallback=t,this}clone(){return Pa(this,this.array,this.itemSize,this.normalized).copy(this)}toJSON(){return{itemSize:this.itemSize,type:this.array.constructor.name,array:Array.from(this.array),normalized:this.normalized}}}class A0 extends ye{constructor(t,e,s=!1){super(new Int8Array(t),e,s)}}class I0 extends ye{constructor(t,e,s=!1){super(new Uint8Array(t),e,s)}}class k0 extends ye{constructor(t,e,s=!1){super(new Uint8ClampedArray(t),e,s)}}class D0 extends ye{constructor(t,e,s=!1){super(new Int16Array(t),e,s)}}class L0 extends ye{constructor(t,e,s=!1){super(new Uint16Array(t),e,s)}}class R0 extends ye{constructor(t,e,s=!1){super(new Int32Array(t),e,s)}}class O0 extends ye{constructor(t,e,s=!1){super(new Uint32Array(t),e,s)}}class z0 extends ye{constructor(t,e,s=!1){super(new Float32Array(t),e,s)}}const jc={map:new Map,transform:function(n){if(vf)return n;if(this.map.has(n))return this.map.get(n);const t=new OffscreenCanvas(n.width,n.height);return t.getContext("2d")?.drawImage(n,0,0),this.map.set(n,t),t},clear:function(){this.map.clear()}};function B0(n,t,e){const s=new OffscreenCanvas(n,t),i=s.getContext("2d");if(i)return e(i),s.transferToImageBitmap()}function N0(n,t,e){const s=n.createPattern(jc.transform(t),"no-repeat");if(s){const i=Kr(e);s.setTransform(i),n.fillStyle=s}}function Hc(n){return window.URL.createObjectURL(n)}function F0(n){return window.URL.revokeObjectURL(n)}function Wc(n){let t=!1,e;function s(){document.readyState==="loading"||t||(n(),e?.(),t=!0)}try{e=W(document,"DOMContentLoaded",s)}catch{e=W(window,"load",s)}return s(),()=>{t||e()}}function Jc(n){return W(window,"beforeunload",t=>{n(t)})}async function Y0(n,t=6e4){return new Promise((e,s)=>{const i=document.createElement("script");i.type="text/javascript",i.async=!1,i.onload=o=>{clearTimeout(r),e(o),i.onerror=i.onload=null},i.onerror=o=>{clearTimeout(r),s(o)},i.src=n;const r=setTimeout(()=>{s("Timeout!")},t);document.body.appendChild(i)})}function Kn(n,t){const e=document.createElement("a");e.style.visibility="hidden",e.download=t,typeof n=="string"?e.href=n:e.href=window.URL.createObjectURL(n),e.click()}async function X0(n,t=document.getElementsByTagName("head")[0],e=6e4){return new Promise((s,i)=>{const r=document.createElement("link");r.setAttribute("type","text/css"),r.setAttribute("rel","stylesheet"),r.onload=a=>{clearTimeout(o),s(a),r.onerror=r.onload=null},r.onerror=a=>{clearTimeout(o),i(a)},r.setAttribute("href",n);const o=setTimeout(()=>{i("Timeout!")},e);t.appendChild(r)})}function U0(){return new Promise(n=>{const t=Array.from(document.querySelectorAll("link[rel=stylesheet]"));let e=document.styleSheets.length||0;const s=()=>e>=t.length?(n(),!0):!1;s()||t.forEach(i=>{i.onload=()=>{e+=1,s()}})})}const Zc=new ks;async function Qc(n,t=6e4){return new Promise((e,s)=>{const i=typeof n=="string"?n:Hc(n),r=Zc.get(i);if(r)return e(r);const o=setTimeout(()=>{s("Timeout!")},t),a=document.createElement("img");a.onload=()=>{clearTimeout(o),a.onerror=a.onload=null;const h=a.naturalWidth||a.width,c=a.naturalHeight||a.height,l={width:h,height:c,aspectRatio:h/c,element:a,imageData:Nc(a)};Zc.set(i,l),e(l)},a.onerror=h=>{clearTimeout(o),s(h)},a.src=i})}async function Kc(n=Ut.text,t=["*"]){const s=(await dr(t))[0],i=await zs(s,n);return{type:s.type,name:s.name,size:s.size,data:i}}async function $0(n=["image/*"]){const e=(await dr(n))[0];if(!e.type.match(/image\/*/))return new Error("Not Image Type!");const s=await zs(e,Ut.arraybuffer),i=Oi(s),r=await Qc(i);return{type:e.type,name:e.name,size:e.size,data:s,width:r.width,height:r.height,aspectRatio:r.aspectRatio,imageData:r.imageData}}function V0(){return window.getSelection()?.toString()||""}function G0(n){document.getElementsByTagName("title")[0].innerText=n,document.title=n}function q0(n=200){"vibrate"in navigator?window.navigator.vibrate(n):console.error("Your device is not support vibrate on this browser.")}async function j0(n){if(navigator.clipboard)return await navigator.clipboard.writeText(n);{const t=document.createElement("textarea");return t.value=n,t.style.opacity="0",t.style.position="fixed",t.style.top="0",t.style.left="0",t.focus(),t.select(),document.execCommand("copy")}}function H0(n,t){window.scrollTo(n,t)}function W0(){let n=Oa,t=Oa;return"scrollRestoration"in window.history&&(window.history.scrollRestoration="manual",n=Jc(()=>{window.history.scrollRestoration="auto"}),t=Wc(()=>{window.history.scrollRestoration="manual"})),()=>{n(),t()}}function J0(n){return/(html|body)/i.test(n.tagName)||n===document.documentElement}const Z0=n=>n===document.activeElement&&(n.type||n.href),ro=function(){return parseFloat(getComputedStyle(document.documentElement).fontSize)};function Q0(n){return n*ro()}function K0(n){return n.parentElement?parseFloat(getComputedStyle(n.parentElement).fontSize):ro()}const ty=n=>{let t=n;for(;t&&t.nodeType!==1&&t.parentElement;)t=t.parentElement;return t},ey=n=>n.parentElement,oo=(n,t=[])=>!n||n.parentElement===null&&n.parentNode===null?t:oo(n.parentElement,t.concat([n]));function sy(n){const t=oo(n);for(let e=0,s=t.length;e<s;e++)if(/(auto|scroll)/.test(We(t[e],"overflow")+We(t[e],"overflow-y")+We(t[e],"overflow-x")))return t[e];return document.scrollingElement||document.documentElement}const ny=(n,t)=>n.contains?n!=t&&n.contains(t):!!(n.compareDocumentPosition(t)&16),iy=n=>Array.prototype.slice.call(n.parentElement?.children).filter(t=>t!==n),ry=n=>n.nextElementSibling,oy=n=>n.previousElementSibling,ay=(n,t)=>n.closest(t),hy=n=>n.shadowRoot,tn=n=>n.tagName==="INPUT"||n instanceof HTMLInputElement,ao=n=>n.tagName==="SELECT"||n instanceof HTMLSelectElement,cy=n=>n.tagName==="TEXTAREA"||n instanceof HTMLTextAreaElement,ho=n=>tn(n)&&n.getAttribute("type")==="checkbox",co=n=>tn(n)&&n.getAttribute("type")==="radio",ly=n=>tn(n)&&n.getAttribute("type")==="text",uy=n=>tn(n)&&n.getAttribute("type")==="number";function fy(n,t){if(ao(n)){const e=n.options;for(let s=0,i=e.length;s<i;s++)e[s].selected=e[s].value==t}}function dy(n,t){if(co(n)){const e=document.getElementsByName(n.name);for(let s=0,i=e.length;s<i;s++){const r=e[s];r.checked=r.value==t}}}function my(n,t){ho(n)&&(n.checked=t)}function bs(n,t,e="append"){typeof t=="string"?n[e](il(t)):n[e](t)}function tl(n,t){if(typeof t=="string"){n.innerHTML=t;const e=ol(n);e!=n&&(n=e)}else bs(t,"replaceWith")}const el=function(n){tl(n,"")},py=(n,t)=>{n.textContent=t},gy=n=>{if(n instanceof SVGElement)return"";let t=n.innerText;if(!t){const e=n.querySelector("slot")?.assignedNodes()||[];let s=0;for(;!t&&s<=e.length-1;)"innerText"in e[s]&&(t=e[s].innerText),s++}return t},yy=n=>n.remove();function wy(n,t){We(n,"display")=="none"&&t===void 0||t===!0?sl(n):nl(n)}function sl(n){ys(n,"display",n instanceof HTMLTableRowElement?"table-row":n instanceof HTMLTableCellElement?"table-cell":"block")}function nl(n){ys(n,"display","none")}function lo(n,t,e="toggle"){const s=t.split(/[,\s]+/);if(n.classList)s.forEach(i=>{const r=i.trim();r!==""&&n.classList[e](r)});else{const i=n.className.split(/ +/);let r=!1;s.forEach(o=>{const a=o.trim();if(a!==""){const h=i.indexOf(a);switch(e){case"add":h===-1&&(i.push(a),r=!0);break;case"remove":h!==-1&&(i.splice(h,1),r=!0);break;case"toggle":h===-1?i.push(a):i.splice(h,1),r=!0;break}}}),r&&oe(n,"class",i.join(" ").replace(/^\s+/,"").replace(/\s+$/,""))}}function xy(n,t){lo(n,t,"add")}function by(n,t){lo(n,t,"remove")}function vy(n,t){return new RegExp("(?:^|\\s+)"+t+"(?:\\s+|$)").test(n.className)||!1}function il(n,t=!1){const e=document.createElement("template");return e.innerHTML=n,t&&e.content.childNodes.forEach(s=>{const i=ol(s);i!=s&&e.content.replaceChild(i,s)}),e.content}function rl(n){return document.createElement.call(document,n)}function Sy(n){return document.createElementNS("http://www.w3.org/1999/xhtml",n)}function _y(n){return document.createTextNode.call(document,n)}function ol(n){return n.tagName=="SCRIPT"&&(n=al(n)),n.querySelectorAll&&n.querySelectorAll("script").forEach(t=>{t.parentNode?.replaceChild(al(t),t)}),n}function al(n){const t=n.ownerDocument.createElement("script");t.text=n.text;const e=n.attributes;for(let s=0,i=e.length;s<i;s++)t.setAttribute(e[s].name,e[s].value);return t}function Cy(n,t="http://test.com/localstorage.html"){const e=document.createElement("iframe");e.src=t,document.body.append(e),setTimeout(function(){e.contentWindow?.postMessage(n,t)},4e3),setTimeout(function(){e.remove()},6e3)}function Ty(n){const t=new Proxy(window,{get(e,s,i){if(typeof s=="string"&&["open","location","document"].includes(s))throw new Error(`禁止访问 key: ${s}`);return s==="window"?t:Reflect.get(e,s,i)},set(e,s,i,r){return Reflect.set(e,s,i,r)}});new Function("window",`with(window) { ${n} }`)(t,null)}function uo(){return{x:0,y:0,isDown:!1}}function Je(){const n=uo(),t=uo();return{start:n,current:t,setStart:function(e,s){n.x=e.x,n.y=e.y,n.isDown=typeof s=="boolean"?s:typeof e.isDown=="boolean"?e.isDown:!1,this.setCurrent(e,s)},setCurrent:(e,s)=>{t.x=e.x,t.y=e.y,t.isDown=typeof s=="boolean"?s:typeof e.isDown=="boolean"?e.isDown:!1}}}function ti(n=document.documentElement,t=!1){return $(n,"mousemove",t)}function hl(n=document.documentElement,t=!1){return $(n,"mousedown",t)}function cl(n=document.documentElement,t=!1){return $(n,"mouseup",t)}function Py(n=document.documentElement,t=!1){return $(n,"mouseover",t)}function Ey(n=document.documentElement,t=!1){return $(n,"mouseout",t)}function My(n=document.documentElement,t=!1){return $(n,"mouseenter",t)}function Ay(n=document.documentElement,t=!1){return $(n,"mouseleave",t)}function Iy(n=document.documentElement,t=!1){return $(n,"click",t)}function ky(n=document.documentElement,t=!1){return $(n,"dblclick",t)}function Dy(n=document.documentElement,t=!1){return $(n,"onwheel"in document.createElement("div")?"wheel":document.onmousewheel!==void 0?"mousewheel":"DOMMouseScroll",t)}function Ly(n=document.documentElement,t=!1){return $(n,"contextmenu",t)}function ll(n=document.documentElement,t=!1){return $(n,"touchmove",t)}function ul(n=document.documentElement,t=!1){return $(n,"touchstart",t)}function fl(n=document.documentElement,t=!1){return $(n,"touchend",t)}function dl(n=document.documentElement,t=!1){return $(n,"touchcancel",t)}function fo(n=document.documentElement,t=!1){return $(n,"pointermove",t)}function mo(n=document.documentElement,t=!1){return $(n,"pointerdown",t)}function po(n=document.documentElement,t=!1){return $(n,"pointerup",t)}function go(n=document.documentElement,t=!1){return $(n,"pointercancel",t)}function Ry(n=document.documentElement){const t=new et(n);return nt(e=>{t.on("pan",e)},e=>{t.off("pan",e)})}function Oy(n=document.documentElement){const t=new et(n);return nt(e=>{t.on("panmove",e)},e=>{t.off("panmove",e)})}function zy(n=document.documentElement){const t=new et(n);return nt(e=>{t.on("panstart",e)},e=>{t.off("panstart",e)})}function By(n=document.documentElement){const t=new et(n);return nt(e=>{t.on("panend",e)},e=>{t.off("panend",e)})}function Ny(n=document.documentElement){const t=new et(n);return nt(e=>{t.on("pancancel",e)},e=>{t.off("pancancel",e)})}function Fy(n=document.documentElement){const t=new et(n);return nt(e=>{t.on("panleft",e)},e=>{t.off("panleft",e)})}function Yy(n=document.documentElement){const t=new et(n);return nt(e=>{t.on("panright",e)},e=>{t.off("panright",e)})}function Xy(n=document.documentElement){const t=new et(n);return nt(e=>{t.on("panup",e)},e=>{t.off("panup",e)})}function Uy(n=document.documentElement){const t=new et(n);return nt(e=>{t.on("pandown",e)},e=>{t.off("pandown",e)})}function $y(n=document.documentElement){const t=new et(n);return nt(e=>{t.on("pinch",e)},e=>{t.off("pinch",e)})}function Vy(n=document.documentElement){const t=new et(n);return nt(e=>{t.on("pinchin",e)},e=>{t.off("pinchin",e)})}function Gy(n=document.documentElement){const t=new et(n);return nt(e=>{t.on("pinchout",e)},e=>{t.off("pinchout",e)})}function qy(n=document.documentElement){const t=new et(n);return nt(e=>{t.on("press",e)},e=>{t.off("press",e)})}function jy(n=document.documentElement){const t=new et(n);return nt(e=>{t.on("rotate",e)},e=>{t.off("rotate",e)})}function Hy(n=document.documentElement){const t=new et(n);return nt(e=>{t.on("swipe",e)},e=>{t.off("swipe",e)})}function Wy(n=document.documentElement){const t=new et(n);return nt(e=>{t.on("swipeleft",e)},e=>{t.off("swipeleft",e)})}function Jy(n=document.documentElement){const t=new et(n);return nt(e=>{t.on("swiperight",e)},e=>{t.off("swiperight",e)})}function Zy(n=document.documentElement){const t=new et(n);return nt(e=>{t.on("swipeup",e)},e=>{t.off("swipeup",e)})}function Qy(n=document.documentElement){const t=new et(n);return nt(e=>{t.on("swipedown",e)},e=>{t.off("swipedown",e)})}function ml(n=document.documentElement){const t=new et(n);return nt(e=>{t.on("tap",e)},e=>{t.off("tap",e)})}function Ky(n=document.documentElement){const t=new et(document.documentElement);return nt(e=>{const s=i=>{!i.target||n==i.target||n.contains(i.target)||e(i)};return t.on("tap",s),s},(e,s)=>{t.off("tap",s)})}function t1(n=document.documentElement,t=!1){return $(n,"transitionstart",t)}function e1(n=document.documentElement,t=!1){return $(n,"transitionend",t)}function s1(n=document.documentElement,t=!1){return $(n,"animationstart",t)}function n1(n=document.documentElement,t=!1){return $(n,"animationend",t)}function pl(n=document.documentElement,t=!1){return $(n,"drag",t)}function gl(n=document.documentElement,t=!1){return $(n,"dragstart",t)}function yl(n=document.documentElement,t=!1){return $(n,"dragend",t)}function wl(n=document.documentElement,t=!1){return $(n,"drop",t)}function xl(n=document.documentElement,t=!1){return $(n,"dragenter",t)}function bl(n=document.documentElement,t=!1){return $(n,"dragleave",t)}function vl(n=document.documentElement,t=!1){return $(n,"dragover",t)}function Sl(n=document.documentElement,t=!1){return $(n,"keydown",t)}function _l(n=document.documentElement,t=!1){return $(n,"keyup",t)}function i1(n=document.documentElement,t=!1){return $(n,"keypress",t)}function r1(n=document.documentElement,t){const e=t?.useMousePoint||Je();return ti(n).pipe(ot(s=>(e.setCurrent(dt(s,n)),e)))}function o1(n=document.documentElement,t){const e=t?.useMousePoint||Je();return ti(n).pipe(qp(hl(n).pipe(qe(s=>{e.setStart(dt(s,n),!0),t?.start?.(s,e)})),()=>cl(n).pipe(qe(s=>{e.setCurrent(dt(s,n),!1),t?.end?.(s,e)}))),$p(),ot(s=>(e.setCurrent(dt(s,n),!0),e)))}function a1(n=document.documentElement,t){const e=t?.useMousePoint||Je();return ul(n).pipe(qe(s=>{const i=s.changedTouches[0];e.setStart(dt(i,n),!0),t?.start?.(i,e)}),Un(()=>ll(n).pipe(Ar(Mr(fl(n),dl(n)).pipe(qe(s=>{const i=s.changedTouches[0];e.setCurrent(dt(i,n),!1),t?.end?.(i,e)}))))),ot(s=>{const i=s.changedTouches[0];return e.setCurrent(dt(i,n),!0),e}))}function ei(n=document.documentElement,t){const e=t?.useMousePoint||Je();return mo(n).pipe(qe(s=>{e.setStart(dt(s,n),!0),t?.start?.(s,e)}),Un(()=>fo(n).pipe(Ar(Mr(po(n),go(n)).pipe(qe(s=>{e.setCurrent(dt(s,n),!1),t?.end?.(s,e)}))))),ot(s=>(e.setCurrent(dt(s,n),!0),e)))}function Cl(n=document.documentElement,t){const e=t?.useMousePoint||Je();return Np(ti(n),mo(n)).pipe(uc(s=>s instanceof PointerEvent?(e.setStart(dt(s,n),!0),t?.start?.(s,e),fo(n).pipe(Ar(Mr(po(n),go(n)).pipe(qe(i=>{e.setCurrent(dt(i,n),!1),t?.end?.(i,e)}))))):s instanceof MouseEvent?mp(s):jh),ot(s=>(e.setCurrent(dt(s,n),s instanceof PointerEvent),e)))}function h1(n){return new st(t=>ei(n,{start:()=>{t.next(0)},end:(s,i)=>{t.next(i.current.x-i.start.x)}}).subscribe(s=>{t.next(s.current.y-s.start.y)}).unsubscribe).pipe(Te())}function c1(n,t){ws(n,"draggable","true");const e=gl(n,!0).subscribe(r=>{Ee(r),fc(r);const o=r.dataTransfer;o&&(o.effectAllowed="move",o.setData("text/plain","some-data")),t?.onStart?.(r)}),s=pl(n).subscribe(r=>{Ee(r),t?.onDrag?.(r)}),i=yl(n).subscribe(r=>{Ee(r),t?.onEnd?.(r)});return()=>{e.unsubscribe(),s.unsubscribe(),i.unsubscribe()}}function l1(n,t){const e=xl(n).subscribe(o=>{Ee(o),t?.onEnter?.(o)}),s=vl(n).subscribe(o=>{Ee(o);const a=o.dataTransfer;a&&(a.dropEffect="move"),t?.onOver?.(o)}),i=bl(n).subscribe(o=>{Ee(o),t?.onLeave?.(o)}),r=wl(n).subscribe(o=>{Ee(o);const a=o.dataTransfer;if(!a){t?.onDrop?.(o,[]);return}t?.onDrop?.(o,[...a.files])});return()=>{e.unsubscribe(),s.unsubscribe(),i.unsubscribe(),r.unsubscribe()}}function Tl(n=10){return $(window,"scroll",!0).pipe(Gp(n))}function u1(){return $(document,"visibilitychange",!0).pipe(ot(()=>document.visibilityState==="visible"),Te())}function f1(){return{screenWidth:window.screen.width,screenHeight:window.screen.height,screenX:window.screenX,screenY:window.screenY}}function en(){const n=document.documentElement;return{clientWidth:n.clientWidth,clientHeight:n.clientHeight,clientTop:n.clientTop,clientLeft:n.clientLeft,scrollWidth:n.scrollWidth,scrollHeight:n.scrollHeight,scrollTop:n.scrollTop,scrollLeft:n.scrollLeft,offsetWidth:n.offsetWidth,offsetHeight:n.offsetHeight,offsetTop:n.offsetTop,offsetLeft:n.offsetLeft,offsetParent:n.offsetParent}}function d1(){const n=document.body;return{clientWidth:n.clientWidth,clientHeight:n.clientHeight,clientTop:n.clientTop,clientLeft:n.clientLeft,scrollWidth:n.scrollWidth,scrollHeight:n.scrollHeight,scrollTop:n.scrollTop,scrollLeft:n.scrollLeft,offsetWidth:n.offsetWidth,offsetHeight:n.offsetHeight,offsetTop:n.offsetTop,offsetLeft:n.offsetLeft,offsetParent:n.offsetParent}}function Pl(){return typeof window.innerWidth=="number"?{width:window.innerWidth,height:window.innerHeight}:document.compatMode==="CSS1Compat"?{width:document.documentElement.clientWidth,height:document.documentElement.clientHeight}:{width:document.body.clientWidth,height:document.body.clientHeight}}function m1(){const{scrollWidth:n,scrollHeight:t}=en();return{width:n,height:t}}function yo(n){const{top:t,left:e,width:s,height:i}=n.getBoundingClientRect(),{scrollLeft:r,scrollTop:o}=en();return{x:e+r,y:t+o,width:s,height:i}}function p1(n){let t=n,e=0,s=0;for(;t!==null;)e+=t.offsetLeft,s+=t.offsetTop,t.offsetParent instanceof HTMLElement?t=t.offsetParent:t=null;return{x:e,y:s,width:n.offsetWidth,height:n.offsetHeight}}function El(n){return n.getBoundingClientRect()}function g1(n){const t=n.getBoundingClientRect();return{x:n.offsetLeft,y:n.offsetTop,width:t.width||t.right-t.left,height:t.height||t.bottom-t.top}}function y1(){const{clientHeight:n,scrollTop:t,scrollHeight:e}=en(),s=e-n;return s<=0?0:t/s*100}function w1(n){if("center"in n){const t=n.center,e=El(n.target);return{x:t.x-e.x,y:t.y-e.y}}return{x:n.clientX,y:n.clientY}}function wo(n){if("center"in n)return n.center;if(typeof n.pageX=="number"&&typeof n.pageY=="number")return{x:n.pageX,y:n.pageY};const{scrollLeft:t,scrollTop:e}=en();return{x:n.clientX+t,y:n.clientY+e}}function dt(n,t){const e={x:0,y:0};if(t){const s=wo(n),i=yo(t);e.x=N(s.x-i.x,0,i.width),e.y=N(s.y-i.y,0,i.height)}else{let s=0,i=0;if("currentTarget"in n&&n.currentTarget&&n.target&&n.currentTarget!=n.target){const r=n.currentTarget.getBoundingClientRect(),o=n.target.getBoundingClientRect();s=o.left-r.left,i=o.top-r.top}if("offsetX"in n)e.x=n.offsetX+s,e.y=n.offsetY+i;else{const r=wo(n),o=yo(n.target);e.x=N(r.x-o.x+s,0,o.width),e.y=N(r.y-o.y+i,0,o.height)}}return e}function x1(n){if(document.implementation.hasFeature("MouseEvents","2.0"))return n.button;switch(n.button){case 0:case 1:case 3:case 5:case 7:return 0;case 2:case 6:return 2;case 4:return 1}}const b1={BACKSPACE:8,TAB:9,COMMA:188,DELETE:46,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,UP:38,DOWN:40,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32};function v1(n){if(n.key)return n.key;if(n.keyCode)return n.keyCode;if(n.which)return n.which}function Ml(n,t){const e=t.ctrl||!1,s=t.shift||!1,i=t.alt||!1;return(e===n.metaKey||e===n.ctrlKey)&&s===n.shiftKey&&i===n.altKey&&t.keys.map(r=>r.toLowerCase()).includes(n.key.toLowerCase())}function Al(n){return Sl(n.target||document||window).pipe(lc(t=>Ml(t,n)),ot(t=>{t.stopPropagation(),t.preventDefault()}))}function S1(n){return _l(n.target||document||window).pipe(lc(t=>Ml(t,n)),ot(t=>{t.stopPropagation(),t.preventDefault()}))}function Il(n={keys:["o"]},t=Ut.text){return Al(n).pipe(Un(async()=>await Kc(t)))}async function _1(n={keys:["o"]},t=Ut.text){return gp(Il(n,t))}async function kl(n,t){return new Promise(e=>{const s=new ResizeObserver(i=>{const r=n.getBoundingClientRect();t(r),e(()=>{s.unobserve(n)})});s.observe(n)})}function xo(n=document.documentElement,t){return new st(e=>{const s=n.getBoundingClientRect();let i=s.x,r=s.y,o=s.width,a=s.height;e.next(s);const h=new ResizeObserver(c=>{const l=n.getBoundingClientRect();(i!=l.x||r!=l.y||o!=l.width||a!=l.height)&&(i=l.x,r=l.y,o=l.width,a=l.height,e.next(l))});return h.observe(n,t),()=>{h.unobserve(n),h.disconnect()}})}function C1(){return $(window,"orientationchange"in window?"orientationchange":"resize").pipe(ot(n=>({width:n.target.innerWidth,height:n.target.innerHeight})),Pe({width:window.innerWidth,height:window.innerHeight}))}function T1(){const n={x:0,y:0,dx:0,dy:0,dStartX:0,dStartY:0,isDown:!1},t={x:0,y:0,dx:0,dy:0,dStartX:0,dStartY:0,isDown:!1};return{mousePoint:t,setStartMousePoint:function(e,s){n.x=e.x,n.y=e.y,n.isDown=typeof s=="boolean"?s:!1,this.setCurrentMousePoint(e,s)},setCurrentMousePoint:(e,s)=>{const i=t.x,r=t.y;t.x=e.x,t.y=e.y,t.dx=t.x-i,t.dy=t.y-r,t.dStartX=t.x-n.x,t.dStartY=t.y-n.y,t.isDown=typeof s=="boolean"?s:!1}}}function P1(n=document.documentElement){const t=new _n,e=new et(n);let s=[];const i=T1(),r=i.mousePoint,o=I=>{t.emit("mouseDown",I)},a=I=>{t.emit("mouseUp",I)},h=I=>{r.isDown||i.setCurrentMousePoint(dt(I,n)),t.emit("mouseMove",I)},c=I=>{t.emit("mouseOver",I)},l=I=>{t.emit("mouseOut",I)},u=I=>{t.emit("mouseEnter",I)},m=I=>{t.emit("mouseLeave",I)},f=I=>{t.emit("mouseClick",I)},p=I=>{t.emit("mouseDoubleClick",I)},y=I=>{t.emit("mouseWheel",I)},S=I=>{t.emit("mouseContextMenu",I)},w=I=>{t.emit("touchStart",I)},v=I=>{t.emit("touchEnd",I)},x=I=>{t.emit("touchCancel",I)},b=I=>{const at=I.changedTouches[0];r.isDown||i.setCurrentMousePoint(dt(at,n)),t.emit("touchMove",I)},P=I=>{t.emit("pointerDown",I)},C=I=>{t.emit("pointerUp",I)},D=I=>{t.emit("pointerCancel",I)},B=I=>{t.emit("pointerMove",I)},Y=I=>{t.emit("pan",I)},V=I=>{t.emit("panStart",I)},G=I=>{t.emit("panMove",I)},J=I=>{t.emit("panEnd",I)},it=I=>{t.emit("panCancel",I)},tt=I=>{t.emit("panLeft",I)},Kt=I=>{t.emit("panRight",I)},Xt=I=>{t.emit("panUp",I)},Vt=I=>{t.emit("panDown",I)},te=I=>{t.emit("pinch",I)},R=I=>{t.emit("pinchin",I)},L=I=>{t.emit("pinchout",I)},U=I=>{t.emit("press",I)},Z=I=>{t.emit("rotate",I)},At=I=>{t.emit("swipe",I)},ee=I=>{t.emit("swipeLeft",I)},fi=I=>{t.emit("swipeRight",I)},di=I=>{t.emit("swipeUp",I)},gt=I=>{t.emit("swipeDown",I)},he=I=>{t.emit("tap",I)},rt=I=>{!I.target||n==I.target||n.contains(I.target)||t.emit("tapOutSide",I)},Ct=I=>{t.emit("transitionstart",I)},Cs=I=>{t.emit("transitionend",I)},ns=I=>{t.emit("animationstart",I)},is=I=>{t.emit("animationend",I)};let Ne={...n.getBoundingClientRect(),width:n.offsetWidth,height:n.offsetHeight};return{el:n,get rect(){return Ne},mousePoint:r,eb:t,start:async function(){s.push(W(n,"mousedown",o)),s.push(W(n,"mouseup",a)),s.push(W(n,"mousemove",h)),s.push(W(n,"mouseover",c)),s.push(W(n,"mouseout",l)),s.push(W(n,"mouseenter",u)),s.push(W(n,"mouseleave",m)),s.push(W(n,"click",f)),s.push(W(n,"dblclick",p)),s.push(W(n,"onwheel"in document.createElement("div")?"wheel":document.onmousewheel!==void 0?"mousewheel":"DOMMouseScroll",y)),s.push(W(n,"contextmenu",S)),s.push(W(n,"touchstart",w)),s.push(W(n,"touchend",v)),s.push(W(n,"touchcancel",x)),s.push(W(n,"touchmove",b)),s.push(W(n,"pointerdown",P)),s.push(W(n,"pointerup",C)),s.push(W(n,"pointercancel",D)),s.push(W(n,"pointermove",B)),e.on("pan",Y),e.on("panstart",V),e.on("panmove",G),e.on("panend",J),e.on("pancancel",it),e.on("panleft",tt),e.on("panright",Kt),e.on("panup",Xt),e.on("pandown",Vt),e.on("pinch",te),e.on("pinchin",R),e.on("pinchout",L),e.on("press",U),e.on("rotate",Z),e.on("swipe",At),e.on("swipeleft",ee),e.on("swiperight",fi),e.on("swipeup",di),e.on("swipedown",gt),e.on("tap",he),s.push(W(document,"pointerdown",rt)),s.push(W(n,"transitionstart",Ct)),s.push(W(n,"transitionend",Cs)),s.push(W(n,"animationstart",ns)),s.push(W(n,"animationend",is));const I=await kl(n,at=>{Ne=at,t.emit("resize",at)});s.push(I),s.push(Dl(this,{start:at=>{i.setStartMousePoint(dt(at,n),!0)},move:at=>{i.setCurrentMousePoint(dt(at,n))},end:at=>{i.setCurrentMousePoint(dt(at,n),!1)}}))},end:()=>{t.removeAllListeners(),s.forEach(I=>I()),s=[],e.off("pan",Y),e.off("panstart",V),e.off("panmove",G),e.off("panend",J),e.off("pancancel",it),e.off("panleft",tt),e.off("panright",Kt),e.off("panup",Xt),e.off("pandown",Vt),e.off("pinch",te),e.off("pinchin",R),e.off("pinchout",L),e.off("press",U),e.off("rotate",Z),e.off("swipe",At),e.off("swipeleft",ee),e.off("swiperight",fi),e.off("swipeup",di),e.off("swipedown",gt),e.off("tap",he)}}}function Dl(n,t){return Ll(n,t)}function Ll(n,t){const e=n.eb,s=o=>{e.on("pointerMove",r),e.on("pointerUp",i),e.on("pointerCancel",i),t?.start?.(o)},i=o=>{e.off("pointerMove",r),e.off("pointerUp",i),e.off("pointerCancel",i),t?.end?.(o)},r=o=>{t?.move?.(o)};return e.on("pointerDown",s),()=>e.off("pointerDown",s)}function E1(n,t){const e=n.eb,s=o=>{document.addEventListener("mousemove",r,!1),document.addEventListener("mouseup",i,!1),t?.start?.(o)},i=o=>{document.removeEventListener("mousemove",r,!1),document.removeEventListener("mouseup",i,!1),t?.end?.(o)},r=o=>{t?.move?.(o)};return e.on("mouseDown",s),()=>e.off("mouseDown",s)}function M1(n,t){const e=n.eb,s=o=>{e.on("touchMove",r),e.on("touchEnd",i),e.on("touchCancel",i);const a=o.changedTouches[0];t?.start?.(a)},i=o=>{e.off("touchMove",r),e.off("touchEnd",i),e.off("touchCancel",i);const a=o.changedTouches[0];t?.end?.(a)},r=o=>{const a=o.changedTouches[0];t?.move?.(a)};return e.on("touchStart",s),()=>e.off("touchStart",s)}let bo=class{x;y;toX;toY;constructor(t){this.x=F(t?.x||0,2),this.y=F(t?.y||0,2),this.toX=F(t?.toX||0,2),this.toY=F(t?.toY||0,2)}toSVGPathData(){return[["L",this.toX,this.toY]]}toCanvasContext(t){t.lineTo(this.toX,this.toY)}getBoundingClientRect(t=2){const e=zt(this.x,this.y,this.toX,this.toY);if(e===0){const s=Math.min(this.x,this.toX),i=Math.min(this.y,this.toY),r=Math.max(this.x,this.toX),o=Math.max(this.y,this.toY);return{x:s,y:i,width:r-s,height:o-i}}else{const s=Math.sin(e),i=Math.cos(e),r=i*this.x-s*this.y,o=i*this.toX-s*this.toY,a=i*this.y+s*this.x,h=i*this.toY+s*this.toX;return{x:F(Math.min(r,o),t),y:F(Math.min(a,h),t),width:F(Math.max(r,o)-Math.min(r,o),t),height:F(Math.max(a,h)-Math.min(a,h),t)}}}interpolate(t){return{x:this.x+t*(this.toX-this.x),y:this.y+t*(this.toY-this.y)}}intersection(t){const e=this.x,s=this.y,i=t.toX,r=t.toY,o=this.toX-e,a=t.x-i;if(!o&&!a)return null;const h=(this.toY-s)/o,c=(t.y-r)/a;if(o){if(!a)return{x:i,y:h*(i-e)+s}}else return{x:e,y:c*(e-i)+r};const l=(-c*i+r+h*e-s)/(h-c),u=h*(l-e)+s;return isNaN(l)||isNaN(u)?null:{x:l,y:u}}};class vo extends bo{rx;ry;xAxisRotate;largeArcFlag;sweepFlag;constructor(t){super(t),this.rx=F(t.rx,2),this.ry=F(t.ry,2),this.xAxisRotate=typeof t?.xAxisRotate=="number"?t?.xAxisRotate:0,this.largeArcFlag=typeof t?.largeArcFlag=="number"?t?.largeArcFlag:1,this.sweepFlag=typeof t?.sweepFlag=="number"?t?.sweepFlag:1}toSVGPathData(){return[["A",this.rx,this.ry,this.xAxisRotate,this.largeArcFlag,this.sweepFlag,this.toX,this.toY]]}toCanvasContext(t){const[e,s,i,r,o,a,h]=this.convert(this.x,this.y,this.toX,this.toY,this.rx,this.ry,this.xAxisRotate,this.largeArcFlag,this.sweepFlag);t.ellipse(e,s,i,r,o,a,h,!this.sweepFlag)}convert(t,e,s,i,r,o,a,h,c){const l=a/180*Math.PI,u=(t-s)/2,m=(e-i)/2,f=Math.cos(l)*u+Math.sin(l)*m,p=-Math.sin(l)*u+Math.cos(l)*m,y=f*f/(r*r)+p*p/(o*o);if(y>1){const G=Math.sqrt(y);throw r=G*r,o=G*o,new Error(`Radii are too small to build an arc. Correcting them to ${r}/${o}.`)}const S=Math.sqrt((r*r*o*o-r*r*p*p-o*o*f*f)/(r*r*p*p+o*o*f*f)),w=h!=c?1:-1,v=w*S*r*p/o,x=w*S*-o*f/r,b=(t+s)/2,P=(e+i)/2,C=Math.cos(l)*v-Math.sin(l)*x+b,D=Math.sin(l)*v+Math.cos(l)*x+P,B=(G,J,it,tt)=>(G*tt>=J*it?1:-1)*Math.acos((G*it+J*tt)/(Math.sqrt(G*G+J*J)*Math.sqrt(it*it+tt*tt))),Y=B(1,0,t-C,e-D)-l,V=B(t-C,e-D,s-C,i-D);return[C,D,r,o,l,Y,Y+V]}}class A1 extends bo{cx;cy;isLineThrough;constructor(t){super(t),this.cx=F(t.cx,2),this.cy=F(t.cy,2),this.isLineThrough=typeof t.isLineThrough=="boolean"?t.isLineThrough:!1}toSVGPathData(){if(this.isLineThrough){const t=this.cx*2-(this.x+this.toX)/2,e=this.cy*2-(this.y+this.toY)/2;return[["Q",t,e,this.toX,this.toY]]}else return[["Q",this.cx,this.cy,this.toX,this.toY]]}toCanvasContext(t){if(this.isLineThrough){const e=this.cx*2-(this.x+this.toX)/2,s=this.cy*2-(this.y+this.toY)/2;t.quadraticCurveTo(e,s,this.toX,this.toY)}else t.quadraticCurveTo(this.cx,this.cy,this.toX,this.toY)}getBoundingClientRect(t=2){const e=[this.x,this.toX],s=[this.y,this.toY];let i,r,o,a;for(let l=0;l<2;++l)i=l==0?this.x-2*this.cx+this.toX:this.y-2*this.cy+this.toY,r=l==0?-2*this.x+2*this.cx:-2*this.y+2*this.cy,o=l==0?this.x:this.y,Math.abs(i)>1e-12&&(a=-r/(2*i),0<a&&a<1&&[e,s][l].push(i*a*a+r*a+o));const h={x:Math.min(0,...e),y:Math.min(0,...s)},c={x:Math.max(0,...e),y:Math.max(0,...s)};return{x:F(h.x,t),y:F(h.y,t),width:F(c.x-h.x,t),height:F(c.y-h.y,t)}}interpolate(t){return{x:(1-t)*(1-t)*this.x+2*(1-t)*t*this.cx+t*t*this.toX,y:(1-t)*(1-t)*this.y+2*(1-t)*t*this.cy+t*t*this.toY}}}const I1=A1;class xt extends bo{c1x;c1y;c2x;c2y;constructor(t){super(t),this.c1x=F(t.c1x,2),this.c1y=F(t.c1y,2),this.c2x=F(t.c2x,2),this.c2y=F(t.c2y,2)}clone(){return new xt({x:this.x,y:this.y,c1x:this.c1x,c1y:this.c1y,c2x:this.c2x,c2y:this.c2y,toX:this.toX,toY:this.toY})}toSVGPathData(){return[["C",this.c1x,this.c1y,this.c2x,this.c2y,this.toX,this.toY]]}toCanvasContext(t){t.bezierCurveTo(this.c1x,this.c1y,this.c2x,this.c2y,this.toX,this.toY)}getBoundingClientRect(t=2){let e=this.c2x-2*this.c1x+this.x-(this.toX-2*this.c2x+this.c1x),s=2*(this.c1x-this.x)-2*(this.c2x-this.c1x),i=this.x-this.c1x,r=(-s+Math.sqrt(s*s-4*e*i))/2/e,o=(-s-Math.sqrt(s*s-4*e*i))/2/e;const a=[this.y,this.toY],h=[this.x,this.toX];let c;const l=[];Math.abs(r)>1e12&&(r=.5),Math.abs(o)>1e12&&(o=.5),r>=0&&r<=1&&(c=this.interpolate(r),h.push(c.x),a.push(c.y),l.push({X:c.x,Y:c.y})),o>=0&&o<=1&&(c=this.interpolate(o),h.push(c.x),a.push(c.y),l.push({X:c.x,Y:c.y})),e=this.c2y-2*this.c1y+this.y-(this.toY-2*this.c2y+this.c1y),s=2*(this.c1y-this.y)-2*(this.c2y-this.c1y),i=this.y-this.c1y,r=(-s+Math.sqrt(s*s-4*e*i))/2/e,o=(-s-Math.sqrt(s*s-4*e*i))/2/e,Math.abs(r)>1e12&&(r=.5),Math.abs(o)>1e12&&(o=.5),r>=0&&r<=1&&(c=this.interpolate(r),h.push(c.x),a.push(c.y),l.push({X:c.x,Y:c.y})),o>=0&&o<=1&&(c=this.interpolate(o),h.push(c.x),a.push(c.y),l.push({X:c.x,Y:c.y}));const u=[],m=l.length;for(let y=0;y<m;y++){for(let S=y+1;S<m;S++)l[y].X===l[S].X&&l[y].Y===l[S].Y&&(S=++y);u.push({X:l[y].X,Y:l[y].Y})}const f={x:Math.min(...h),y:Math.min(...a)},p={x:Math.max(...h),y:Math.max(...a)};return{x:F(f.x,t),y:F(f.y,t),width:F(p.x-f.x,t),height:F(p.y-f.y,t),dots:u}}static base3(t,e,s,i,r){const o=-3*e+9*s-9*i+3*r,a=t*o+6*e-12*s+6*i;return t*a-3*e+3*s}static bezlen(t,e,s,i,r,o,a,h,c=1){c=Math.max(0,Math.min(c,1));const l=c/2,u=[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816],m=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472];let f=0;for(let p=0;p<12;p++){const y=l*u[p]+l,S=xt.base3(y,t,s,r,a),w=xt.base3(y,e,i,o,h);f+=m[p]*Math.sqrt(S*S+w*w)}return l*f}length(t=1){return xt.bezlen(this.x,this.y,this.c1x,this.c1y,this.c2x,this.c2y,this.toX,this.toY,t)}getPointAtSegmentLength(t){const e=this.getTatLen(t),s=1-e,i=Math.pow(s,3),r=Math.pow(s,2),o=e*e,a=o*e,h=i*this.x+r*3*e*this.c1x+s*3*e*e*this.c2x+a*this.toX,c=i*this.y+r*3*e*this.c1y+s*3*e*e*this.c2y+a*this.toY,l=this.x+2*e*(this.c1x-this.x)+o*(this.c2x-2*this.c1x+this.x),u=this.y+2*e*(this.c1y-this.y)+o*(this.c2y-2*this.c1y+this.y),m=this.c1x+2*e*(this.c2x-this.c1x)+o*(this.toX-2*this.c2x+this.c1x),f=this.c1y+2*e*(this.c2y-this.c1y)+o*(this.toY-2*this.c2y+this.c1y),p=s*this.x+e*this.c1x,y=s*this.y+e*this.c1y,S=s*this.c2x+e*this.toX,w=s*this.c2y+e*this.toY,v=90-Math.atan2(l-m,u-f)*180/Math.PI;return{x:h,y:c,m:{x:l,y:u},n:{x:m,y:f},start:{x:p,y},end:{x:S,y:w},alpha:v}}getTatLen(t){const e=this.x,s=this.y,i=this.c1x,r=this.c1y,o=this.c2x,a=this.c2y,h=this.toX,c=this.toY;if(t<0||xt.bezlen(e,s,i,r,o,a,h,c)<t)return 0;const l=1;let u=l/2,m=l-u,f=xt.bezlen(e,s,i,r,o,a,h,c,m);for(;Math.abs(f-t)>.01;)u/=2,m+=(f<t?1:-1)*u,f=xt.bezlen(e,s,i,r,o,a,h,c,m);return m}interpolate(t){return{x:Math.pow(1-t,3)*this.x+3*Math.pow(1-t,2)*t*this.c1x+3*Math.pow(1-t,1)*Math.pow(t,2)*this.c2x+Math.pow(t,3)*this.toX,y:Math.pow(1-t,3)*this.y+3*Math.pow(1-t,2)*t*this.c1y+3*Math.pow(1-t,1)*Math.pow(t,2)*this.c2y+Math.pow(t,3)*this.toY}}}const sn=Math.PI*2;function Rl(n,t,e,s){const i=n*s-t*e<0?-1:1;let r=n*e+t*s;return r>1&&(r=1),r<-1&&(r=-1),i*Math.acos(r)}function k1(n,t,e,s,i,r,o,a,h,c){const l=c*(n-e)/2+h*(t-s)/2,u=-h*(n-e)/2+c*(t-s)/2,m=o*o,f=a*a,p=l*l,y=u*u;let S=m*f-m*y-f*p;S<0&&(S=0),S/=m*y+f*p,S=Math.sqrt(S)*(i===r?-1:1);const w=S*o/a*u,v=S*-a/o*l,x=c*w-h*v+(n+e)/2,b=h*w+c*v+(t+s)/2,P=(l-w)/o,C=(u-v)/a,D=(-l-w)/o,B=(-u-v)/a,Y=Rl(1,0,P,C);let V=Rl(P,C,D,B);return r===0&&V>0&&(V-=sn),r===1&&V<0&&(V+=sn),[x,b,Y,V]}function D1(n,t){const e=1.3333333333333333*Math.tan(t/4),s=Math.cos(n),i=Math.sin(n),r=Math.cos(n+t),o=Math.sin(n+t);return[s,i,s-i*e,i+s*e,r+o*e,o-r*e,r,o]}function Ol(n,t,e,s,i,r,o,a,h){const c=Math.sin(h*sn/360),l=Math.cos(h*sn/360),u=l*(n-e)/2+c*(t-s)/2,m=-c*(n-e)/2+l*(t-s)/2;if(u===0&&m===0)return[];if(o===0||a===0)return[];o=Math.abs(o),a=Math.abs(a);const f=u*u/(o*o)+m*m/(a*a);f>1&&(o*=Math.sqrt(f),a*=Math.sqrt(f));const p=k1(n,t,e,s,i,r,o,a,c,l),y=[];let S=p[2],w=p[3];const v=Math.max(Math.ceil(Math.abs(w)/(sn/4)),1);w/=v;for(let x=0;x<v;x++)y.push(D1(S,w)),S+=w;return y.map(x=>{for(let b=0;b<x.length;b+=2){let P=x[b+0],C=x[b+1];P*=o,C*=a;const D=l*P-c*C,B=c*P+l*C;x[b+0]=D+p[0],x[b+1]=B+p[1]}return x})}function So(n,t,e,s,i,r){return[n/3+.6666666666666666*e,t/3+.6666666666666666*s,i/3+.6666666666666666*e,r/3+.6666666666666666*s,i,r]}function nn(n,t,e,s){return[n,t,e,s,e,s]}const si={a:7,c:6,s:4,q:4,t:2,m:2,l:2,h:1,v:1,z:0};function Ze(n="path"){return document.createElementNS.call(document,"http://www.w3.org/2000/svg",n)}function zl(){return Ze("path")}const L1=n=>n instanceof SVGElement&&n.tagName==="path";function R1(n,t="shape"){return Kn(fr(n),`${t}.svg`)}function Bl(n){return typeof n!="string"?!1:(n=n.trim(),/^[mlhvzaqtcs]\s*[-+.0-9][^mlhvzaqtcs]+/i.test(n)&&/[\dz]$/i.test(n))}function O1(n){return n.map(t=>{if(!t[0])return"";switch(t[0].toLowerCase()){case"a":return`${t[0]} ${t[1]},${t[2]} ${t[3]} ${t[4]},${t[5]} ${t[6]},${t[7]}`;case"c":return`${t[0]} ${t[1]},${t[2]} ${t[3]},${t[4]} ${t[5]},${t[6]}`;case"s":case"q":return`${t[0]} ${t[1]},${t[2]} ${t[3]},${t[4]}`;default:return t[0]+" "+t.slice(1).join(",")}}).join(" ")}function Nl(n){const t=[];return Bl(n)&&n.replace(/([mlhvzaqtcs])([^mlhvzaqtcs]*)/gi,(e,s,i)=>{let r=s.toLowerCase();const o=Li(i);for(r=="m"&&o.length>si[r]&&(t.push([s,...o.splice(0,si[r])]),r="l",s=s=="m"?"l":"L");o.length;){if(o.length<si[r])throw new Error(`parseSVGPath substring:{ ${e} } command:{ ${s} } args:{ ${o} }`);t.push([s,...o.splice(0,si[r])])}return r=="z"&&t.push([s]),""}),t}function Fl(n){let t=0,e=0,s=0,i=0;return n.map(function(r){const o=r[0],a=o.toUpperCase();if(o!=a)switch(r[0]=a,o){case"a":r[6]+=s,r[7]+=i;break;case"v":r[1]+=i;break;case"h":r[1]+=s;break;default:for(let h=1;h<r.length;)r[h++]+=s,r[h++]+=i}switch(a){case"Z":s=t,i=e;break;case"H":s=r[1];break;case"V":i=r[1];break;case"M":s=t=r[1],i=e=r[2];break;default:s=r[r.length-2],i=r[r.length-1]}return r})}function z1(n){const t=[];let e=0,s=0,i=0,r=0,o=0,a=0,h=0,c=0,l;for(let u=0,m=n.length;u<m;u++){let f=n[u];const p=f[0];switch(p){case"M":e=f[1],s=f[2];break;case"A":const y=Ol(i,r,f[6],f[7],f[4],f[5],f[1],f[2],f[3]);if(!y.length)continue;y.forEach((v,x)=>{const[b,P,C,D,B,Y,V,G]=v;f=["C",C,D,B,Y,V,G],x<y.length-1&&t.push(f)});break;case"S":let S=i,w=r;(l=="C"||l=="S")&&(S+=S-h,w+=w-c),f=["C",S,w,f[1],f[2],f[3],f[4]];break;case"T":l=="Q"||l=="T"?(o=i*2-o,a=r*2-a):(o=i,a=r),f=["C",...So(i,r,o,a,f[1],f[2])];break;case"Q":o=f[1],a=f[2],f=["C",...So(i,r,f[1],f[2],f[3],f[4])];break;case"L":f=["C",...nn(i,r,f[1],f[2])];break;case"H":f=["C",...nn(i,r,f[1],r)];break;case"V":f=["C",...nn(i,r,i,f[1])];break;case"Z":f=["C",...nn(i,r,e,s)];break}l=p,i=f[f.length-2],r=f[f.length-1],f.length>4?(h=f[f.length-4],c=f[f.length-3]):(h=i,c=r),t.push(f)}return t}class rn{video;constructor(t){this.video=t}setSrcObject(t){this.video.addEventListener("loadedmetadata",e=>{e.target}),this.video.srcObject=t}captureWebCamera(){navigator.mediaDevices.getUserMedia({video:!0}).then(t=>{this.setSrcObject(t)})}static async videoMediaChangeSupport(){return new Promise(t=>{const e=document.createElement("iframe"),s=document.createElement("video"),i=document.createElement("source"),r=new MediaSource;r.addEventListener("sourceopen",()=>t(!0)),i.src=URL.createObjectURL(r),i.media="(min-width:10px)",s.append(i),e.width="5",e.style.cssText="position: absolute; visibility: hidden;",document.documentElement.append(e),e.contentDocument?.body.append(s),setTimeout(()=>{e.width="15"}),setTimeout(()=>{e.remove(),t(!1)},1e3)})}static tryAutoPlayOrAutoPlayAfterClick(t){return new Promise(e=>{t.play().then(()=>{t.autoplay=!0,e(!0)}).catch(()=>{rn.setAutoPlayWhenClick(t),e(!1)})})}static setAutoPlayWhenClick(t){function e(){t.autoplay=!0,t.play(),document.removeEventListener("click",e),document.removeEventListener("touchend",e)}document.addEventListener("click",e),document.addEventListener("touchend",e)}}class _o extends _n{source;raw="";mode="text";tagname="";nodename="";textchunk="";entity="";quote="";attrs={};constructor(t){super(),this.source=t}parse(){const t=Xu(this.source);if(t===0){this.emit("finish");return}let e,s,i=ba(this.source,0);for(let r=1;r<t;r++)e=s,s=i,i=ba(this.source,r),this.raw+=s,s&&this.step(s,i,e);i&&this.step(i,void 0,s),this.emit("finish")}step(t,e,s){t==`
27
+ `&&this.emit("newline"),this.act(t,e,s)}act(t,e,s){switch(this.mode){case"text":switch(t){case"<":case"eof":this.nodename="",this.attrs={},this.mode="tag name start",this.raw=this.raw.slice(0,-1),this.textchunk&&this.emit("text",this.textchunk),this.raw+=t,this.textchunk="";break;case"&":this.mode="entity",this.entity="";break;default:this.textchunk+=t;break}break;case"entity":ue("whitespace",t)?(this.textchunk+=Yl(this.entity),this.mode="text"):t==";"?(this.textchunk+=Yl(this.entity+t),this.mode="text"):this.entity+=t;break;case"special":if(s=="!"&&t=="-"&&e=="-"){this.mode="comment start";break}if(this.textchunk=="[CDATA"&&t=="["){this.mode="cdata",this.textchunk="";break}if(t==">"||t=="eof"){this.emit("special",this.textchunk),this.mode="text",this.textchunk="";break}this.textchunk+=t;break;case"cdata":if(s=="]"&&t=="]"&&e==">"){this.mode="cdata end",this.textchunk=this.textchunk.slice(0,-1);break}t=="eof"&&(this.mode="cdata end",this.act(t,e,s)),this.textchunk+=t;break;case"cdata end":this.emit("cdata",this.textchunk),this.textchunk="",this.mode="text";break;case"comment start":e==">"||t=="eof"?(this.emit("comment",""),this.mode="skip"):this.mode="comment";break;case"skip":this.mode="text";break;case"comment":t=="-"&&s=="-"&&e==">"?(this.mode="comment end",this.textchunk=this.textchunk.slice(0,-1)):t=="eof"?this.emit("comment",this.textchunk):this.textchunk+=t;break;case"comment end":this.emit("comment",this.textchunk),this.textchunk="",this.mode="text";break;case"declaration":if(t=="?"&&e==">"){this.mode="declaration end";break}t=="eof"&&this.emit("comment",this.textchunk),this.textchunk+=t;break;case"declaration end":this.emit("comment",this.textchunk),this.textchunk="",this.mode="text";break;case"tag name start":if(t=="eof"){this.emit("text","<");break}if(!ue("whitespace",t)){if(this.mode="tag name",t=="/"){this.mode="close tag name start";break}else if(t=="!"){this.mode="special",this.textchunk="";break}else if(t=="?"){this.mode="declaration";break}this.act(t,e,s)}break;case"close tag name start":ue("whitespace",t)||(this.mode="close tag name",this.tagname="",this.nodename="",this.act(t,e,s));break;case"close tag name":if(ue("whitespace",t))this.tagname=this.nodename;else switch(t){case">":this.emit("/tag",this.tagname||this.nodename,this.attrs),this.mode="text";break;default:!this.tagname&&(this.nodename+=t);break}break;case"tag name":if(ue("whitespace",t))this.tagname=this.nodename,this.nodename="",this.mode="attr start";else switch(t){case">":this.emit("tag",this.nodename,this.attrs),this.mode="text";break;case"/":this.raw+=e,this.emit("tag",this.nodename,this.attrs),this.emit("/tag",this.nodename,this.attrs),this.mode="skip";break;default:this.nodename+=t;break}break;case"attr start":ue("whitespace",t)||(this.mode="attr",this.nodename="",this.act(t,e,s));break;case"attr":if(ue("whitespace",t)||t=="=")this.attrs[this.nodename]="",this.mode="attr value start";else switch(t){case">":this.nodename=="/"?(delete this.attrs["/"],this.emit("tag",this.tagname,this.attrs),this.emit("/tag",this.tagname,this.attrs)):(this.nodename&&(this.attrs[this.nodename]=""),this.emit("tag",this.tagname,this.attrs)),this.mode="text";break;default:this.nodename+=t;break}break;case"attr value start":if(!ue("whitespace",t)){if(this.mode="attr value",this.quote="",t=="'"||t=='"'){this.quote=t;return}this.act(t,e,s)}break;case"attr value":if(ue("whitespace",t)&&!this.quote)this.mode="attr start";else if(t==">"&&!this.quote)this.emit("tag",this.tagname,this.attrs),this.mode="text";else switch(t){case'"':case"'":this.quote==t&&s!="\\"&&(this.mode="attr start");break;default:this.attrs[this.nodename]+=t;break}break}}}function Yl(n){const t={lt:60,"lt;":60,"AMP;":38,AMP:38,"GT;":62,GT:62,"QUOT;":34,QUOT:34,"apos;":39,"bull;":8226,"bullet;":8226,"copy;":169,copy:169,"deg;":176,deg:176};let e;return n.charAt(0)=="#"?n.charAt(1).toLowerCase()=="x"?e=parseInt(n.substring(2),16):e=parseInt(n.substring(1),10):e=t[n],e?String.fromCharCode(e):"&"+n}var Xl=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function Co(n,t={}){var e=1,s=1;function i(R){var L=R.match(/\n/g);L&&(e+=L.length);var U=R.lastIndexOf(`
28
+ `);s=~U?R.length-U:s+R.length}function r(){var R={line:e,column:s};return function(L){return L.position=new o(R),p(),L}}function o(R){this.start=R,this.end={line:e,column:s},this.source=t.source}o.prototype.content=n;var a=[];function h(R){var L=new Error(t.source+":"+e+":"+s+": "+R);if(L.reason=R,L.filename=t.source,L.line=e,L.column=s,L.source=n,t.silent)a.push(L);else throw L}function c(){var R=m();return{type:"stylesheet",stylesheet:{source:t.source,rules:R,parsingErrors:a}}}function l(){return f(/^{\s*/)}function u(){return f(/^}/)}function m(){var R,L=[];for(p(),y(L);n.length&&n.charAt(0)!="}"&&(R=Vt()||te());)R!==!1&&(L.push(R),y(L));return L}function f(R){var L=R.exec(n);if(L){var U=L[0];return i(U),n=n.slice(U.length),L}}function p(){f(/^\s*/)}function y(R){var L;for(R=R||[];L=S();)L!==!1&&R.push(L);return R}function S(){var R=r();if(!(n.charAt(0)!="/"||n.charAt(1)!="*")){for(var L=2;n.charAt(L)!=""&&(n.charAt(L)!="*"||n.charAt(L+1)!="/");)++L;if(L+=2,n.charAt(L-1)==="")return h("End of comment missing");var U=n.slice(2,L-2);return s+=2,i(U),n=n.slice(L),s+=2,R({type:"comment",comment:U})}}function w(){var R=f(/^([^{]+)/);if(R)return we(R[0]).replace(/\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*\/+/g,"").replace(/"(?:\\"|[^"])*"|'(?:\\'|[^'])*'/g,function(L){return L.replace(/,/g,"‌")}).split(/\s*(?![^(]*\)),\s*/).map(function(L){return L.replace(/\u200C/g,",")})}function v(){var R=r(),L=f(/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(L){if(L=we(L[0]),!f(/^:\s*/))return h("property missing ':'");var U=f(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/),Z=R({type:"declaration",property:L.replace(Xl,""),value:U?we(U[0]).replace(Xl,""):""});return f(/^[;\s]*/),Z}}function x(){var R=[];if(!l())return h("missing '{'");y(R);for(var L;L=v();)L!==!1&&(R.push(L),y(R));return u()?R:h("missing '}'")}function b(){for(var R,L=[],U=r();R=f(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/);)L.push(R[1]),f(/^,\s*/);if(L.length)return U({type:"keyframe",values:L,declarations:x()})}function P(){var R=r(),L=f(/^@([-\w]+)?keyframes\s*/);if(L){var U=L[1];if(L=f(/^([-\w]+)\s*/),!L)return h("@keyframes missing name");var Z=L[1];if(!l())return h("@keyframes missing '{'");for(var At,ee=y();At=b();)ee.push(At),ee=ee.concat(y());return u()?R({type:"keyframes",name:Z,vendor:U,keyframes:ee}):h("@keyframes missing '}'")}}function C(){var R=r(),L=f(/^@supports *([^{]+)/);if(L){var U=we(L[1]);if(!l())return h("@supports missing '{'");var Z=y().concat(m());return u()?R({type:"supports",supports:U,rules:Z}):h("@supports missing '}'")}}function D(){var R=r(),L=f(/^@host\s*/);if(L){if(!l())return h("@host missing '{'");var U=y().concat(m());return u()?R({type:"host",rules:U}):h("@host missing '}'")}}function B(){var R=r(),L=f(/^@media *([^{]+)/);if(L){var U=we(L[1]);if(!l())return h("@media missing '{'");var Z=y().concat(m());return u()?R({type:"media",media:U,rules:Z}):h("@media missing '}'")}}function Y(){var R=r(),L=f(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(L)return R({type:"custom-media",name:we(L[1]),media:we(L[2])})}function V(){var R=r(),L=f(/^@page */);if(L){var U=w()||[];if(!l())return h("@page missing '{'");for(var Z=y(),At;At=v();)Z.push(At),Z=Z.concat(y());return u()?R({type:"page",selectors:U,declarations:Z}):h("@page missing '}'")}}function G(){var R=r(),L=f(/^@([-\w]+)?document *([^{]+)/);if(L){var U=we(L[1]),Z=we(L[2]);if(!l())return h("@document missing '{'");var At=y().concat(m());return u()?R({type:"document",document:Z,vendor:U,rules:At}):h("@document missing '}'")}}function J(){var R=r(),L=f(/^@font-face\s*/);if(L){if(!l())return h("@font-face missing '{'");for(var U=y(),Z;Z=v();)U.push(Z),U=U.concat(y());return u()?R({type:"font-face",declarations:U}):h("@font-face missing '}'")}}var it=Xt("import"),tt=Xt("charset"),Kt=Xt("namespace");function Xt(R){var L=new RegExp("^@"+R+"\\s*([^;]+);");return function(){var U=r(),Z=f(L);if(Z){var At={type:R};return At[R]=Z[1].trim(),U(At)}}}function Vt(){if(n[0]=="@")return P()||B()||Y()||C()||it()||tt()||Kt()||G()||V()||D()||J()}function te(){var R=r(),L=w();return L?(y(),R({type:"rule",selectors:L,declarations:x()})):h("selector missing")}return To(c())}function we(n){return n?n.replace(/^\s+|\s+$/g,""):""}function To(n,t){var e=n&&typeof n.type=="string",s=e?n:t;for(var i in n){var r=n[i];Array.isArray(r)?r.forEach(function(o){To(o,s)}):r&&typeof r=="object"&&To(r,s)}return e&&Object.defineProperty(n,"parent",{configurable:!0,writable:!0,enumerable:!1,value:t||null}),n}let B1=class extends _o{currentItem={};items=[];groups=[];globalStyles={};grad={};idtops={};text="";constructor(t){super(t),this.on("tag",(e,s)=>{switch(this.text="",this.currentItem={type:e},e){case"g":this.groups.push(this.currentItem);break}this.processAttrs(e,s)}),this.on("text",e=>{if(this.currentItem.type=="style"){try{const s=Co(e);for(const i of s.stylesheet.rules)for(const r of i.declarations)for(const o of i.selectors)this.globalStyles[o]=this.globalStyles[o]||[],this.globalStyles[o].push(`${r.property}:${r.value}`)}catch{console.error("CAN'T parse css text: "+e)}return}this.text+=e}),this.on("/tag",(e,s)=>{let i=this.groups.length;for(;i--;)if(this.groups[i]!=this.currentItem){let r="",o="";for(const a in this.groups[i])a=="transform"?r=this.groups[i].transform:a=="class"&&this.globalStyles["."+this.groups[i][a]]?o=this.globalStyles["."+this.groups[i][a]].join(";")+";"+o:a=="id"&&this.globalStyles["#"+this.groups[i][a]]?o=this.globalStyles["#"+this.groups[i][a]].join(";")+";"+o:typeof this.currentItem[a]>"u"&&(this.currentItem[a]=this.groups[i][a]);typeof this.currentItem.transform>"u"?this.currentItem.transform=r:this.currentItem.transform+=" "+r,typeof this.currentItem.style>"u"?this.currentItem.style=o:this.currentItem.style=o+this.currentItem.style,this.currentItem.class&&this.globalStyles["."+this.currentItem.class]?this.currentItem.style=this.globalStyles["."+this.currentItem.class].join(";")+";"+this.currentItem.style:this.currentItem.id&&this.globalStyles["#"+this.currentItem.id]&&(this.currentItem.style=this.globalStyles["#"+this.currentItem.id].join(";")+";"+this.currentItem.style),Eo(this.currentItem.style,this.currentItem,Mo)}switch(this.processAttrs(e,s),e){case"g":this.groups.pop();break;case"cirlce":this.addToItems();break;case"ellipse":this.addToItems();break;case"polygon":this.addToItems();break;case"path":this.addToItems();break;case"line":this.addToItems();break;case"rect":this.addToItems();break;case"image":this.addToItems();break;case"text":this.currentItem.text=this.text,this.currentItem["text-anchor"]=this.currentItem["text-anchor"]||"start",this.addToItems();break}}),this.on("finish",()=>{this.emit("result",this.items)})}parse(){return super.parse(),this.items}processAttrs(t,e){let s=[],i;switch(t){case"svg":let r="",o="";if(e.width&&e.height)r=e.width,o=e.height;else if(e.viewBox){const a=e.viewBox.split(/\s+/gi);a.length==4&&(r=String(parseFloat(a[2])-parseFloat(a[0])),o=String(parseFloat(a[3])-parseFloat(a[1])))}r&&o&&this.items.push({type:"viewbox",width:r,height:o});break;case"line":typeof e.x1=="number"&&typeof e.y1=="number"&&typeof e.x2=="number"&&typeof e.y2=="number"&&(this.currentItem.path="M"+[e.x1,e.y1,e.x2,e.y2]);break;case"stop":i={},e.style&&Eo(e.style,i),i.offset=i.offset||e.offset,i.color=i["stop-color"]||e["stop-color"],i.opacity=i["stop-opacity"]||e["stop-opacity"],~(i.offset+"").indexOf("%")?i.offset=parseFloat(i.offset):i.offset=parseFloat(i.offset)*100,i.offset=+i.offset.toFixed(2),this.grad.stops.push(i);break;case"linearGradient":this.grad.angle=(360+Po(parseFloat(e.x1),parseFloat(e.y1),parseFloat(e.x2),parseFloat(e.y2),parseFloat(e.x1)+100,parseFloat(e.y1))).toFixed(2),s=[this.grad.angle];for(let a=0,h=this.grad.stops.length;a<h;a++)i=this.grad.stops[a],a&&a!=h-1?s.push(i.color+":"+i.offset):s.push(i.color);this.idtops[this.grad.id]=s.join("-"),this.items.forEach(a=>{a.fillid==this.grad.id&&(a.fill=this.idtops[this.grad.id])});break;case"radialGradient":s=[];for(let a=0,h=this.grad.stops.length;a<h;a++)i=this.grad.stops[a],a&&a!=h-1?s.push(i.color+":"+i.offset):s.push(i.color);this.idtops[this.grad.id]=s.join("-"),this.items.forEach(a=>{a.fillid==this.grad.id&&(a.fill=this.idtops[this.grad.id])});break}for(const r in e){const o=e[r];if(Mo.includes(r)&&(this.currentItem[r]=o),r==="id"&&(this.currentItem.type==="linearGradient"&&(this.grad={id:r,stops:[]}),this.currentItem.type==="radialGradient"&&(this.grad={id:r,stops:[]})),r==="style"&&Eo(o,this.currentItem,Mo),r==="transform"&&(this.currentItem.transform=o+(this.currentItem.transform||" ")),r==="fill"){const a=o.match(/url\(#([^)]+)\)/);if(a){const h=a[1];this.currentItem.fillid=h,this.idtops[h]&&(this.currentItem.fill=this.idtops[h])}}r==="points"&&this.currentItem.type=="polygon"&&(this.currentItem.path="M"+o+"z"),r==="d"&&this.currentItem.type=="path"&&(this.currentItem.path=o),r==="xlink:href"&&this.currentItem.type=="image"&&(this.currentItem.src=o)}}addToItems(){this.items.push(this.currentItem)}};function Po(n,t,e,s,i,r){if(typeof i>"u"||typeof r>"u"){const o=n-e,a=t-s;return!o&&!a?0:(180+Math.atan2(-a,-o)*180/Math.PI+360)%360}else return Po(n,t,i,r)-Po(e,s,i,r)}function Eo(n,t,e){const s=(n+"").split(";"),i=/^\s+|\s+$/g;for(let r=0,o=s.length;r<o;r++){const a=s[r].split(":"),h=a[0].replace(i,"").replace(/[A-Z]/g,function(c){return"-"+c.toLowerCase()});(!e||e.includes(h))&&(t[h]=a[1].replace(i,""))}}const Mo=["id","class","viewBox","width","height","x","y","cx","cy","r","rx","ry","cursor","opacity","src","fill","fill-opacity","stroke","stroke-dasharray","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-anchor","font","font-family","font-size","font-style","font-weight","letter-spacing"];class Et{prevPathX=0;prevPathY=0;isUpdatedSVGPathData=!0;isUpdatedSVGPathD=!0;isUpdatedBoundingClientRect=!0;isUpdatedPolymorphPoints=!0;isUpdatedTotalLength=!0;normalizedLines=[];constructor(t){const e=typeof t=="string"?Nl(t):t||[],s=z1(Fl(e));for(let i=0,r=s.length;i<r;i++){const o=s[i];o[0]=="M"?(this.prevPathX=o[1],this.prevPathY=o[2]):this._appendLine(new xt({x:this.prevPathX,y:this.prevPathY,c1x:o[1],c1y:o[2],c2x:o[3],c2y:o[4],toX:o[5],toY:o[6]}))}}_appendLine(t){if(this.isUpdatedSVGPathData=!0,this.isUpdatedSVGPathD=!0,this.isUpdatedBoundingClientRect=!0,this.isUpdatedPolymorphPoints=!0,this.isUpdatedTotalLength=!0,t instanceof vo){Ol(this.prevPathX,this.prevPathY,t.toX,t.toY,t.largeArcFlag,t.sweepFlag,t.rx,t.ry,t.xAxisRotate).forEach(c=>{const[l,u,m,f,p,y,S,w]=c;this.normalizedLines.push(new xt({x:this.prevPathX,y:this.prevPathY,c1x:m,c1y:f,c2x:p,c2y:y,toX:S,toY:w})),this.prevPathX=S,this.prevPathY=w});return}if(t instanceof xt){this.normalizedLines.push(t.clone()),this.prevPathX=t.toX,this.prevPathY=t.toY;return}let e,s,i,r,o,a;t instanceof I1?[e,s,i,r,o,a]=So(this.prevPathX,this.prevPathY,t.cx,t.cy,t.toX,t.toY):[e,s,i,r,o,a]=nn(this.prevPathX,this.prevPathY,t.toX,t.toY),this.normalizedLines.push(new xt({x:this.prevPathX,y:this.prevPathY,c1x:e,c1y:s,c2x:i,c2y:r,toX:o,toY:a})),this.prevPathX=o,this.prevPathY=a}static fromPolymorphPoints(t){const e=new Et,s=t.length;if(s){e.prevPathX=t[0],e.prevPathY=t[1];for(let i=2;i+5<s;i+=6)e._appendLine(new xt({x:e.prevPathX,y:e.prevPathY,c1x:t[i],c1y:t[i+1],c2x:t[i+2],c2y:t[i+3],toX:t[i+4],toY:t[i+5]}))}return e}static fromLines(t){const e=new Et,s=t.length;if(s){e.prevPathX=t[0].x,e.prevPathY=t[0].y;for(let i=0;i<s;i++)e._appendLine(t[i])}return e}clone(){return Et.fromLines(this.normalizedLines)}cachedSVGPathData=[];toSVGPathData(){if(this.isUpdatedSVGPathData){const t=[];for(let e=0,s=this.normalizedLines.length;e<s;e++){const i=this.normalizedLines[e];e==0&&t.push(["M",i.x,i.y]),t.push(...i.toSVGPathData())}this.cachedSVGPathData=t,this.isUpdatedSVGPathData=!1}return this.cachedSVGPathData}cachedSVGPathD="";toSVGPathD(){return this.isUpdatedSVGPathD&&(this.cachedSVGPathD=O1(this.toSVGPathData()),this.isUpdatedSVGPathD=!1),this.cachedSVGPathD}toCanvasContext(t){t.beginPath();for(let e=0,s=this.normalizedLines.length;e<s;e++){const i=this.normalizedLines[e];e==0&&t.moveTo(i.x,i.y),i.toCanvasContext(t)}}cachedBoundingClientRect={x:0,y:0,width:0,height:0};getBoundingClientRect(t=2){if(this.isUpdatedBoundingClientRect){const e=[],s=[];if(this.normalizedLines.forEach(i=>{const r=i.getBoundingClientRect(t);e.push(r.x,r.x+r.width),s.push(r.y,r.y+r.height)}),e.length==0||s.length==0)this.cachedBoundingClientRect={x:0,y:0,width:0,height:0};else{const i=Math.min(...e),r=Math.min(...s),o=Math.max(...e),a=Math.max(...s);this.cachedBoundingClientRect={x:F(i,t),y:F(r,t),width:F(o-i,t),height:F(a-r,t)}}this.isUpdatedBoundingClientRect=!1}return this.cachedBoundingClientRect}getBoundingClientRectCenter(t=2){const e=this.getBoundingClientRect(t);return{x:F(e.x+e.width*.5,t),y:F(e.y+e.height*.5,t)}}transform(t){let e;return t.m?e=t.m:(e=new wt,e.translate(t.x||0,t.y||0),e.rotate(t.degree||0,t.centerX,t.centerY),e.scale(t.scaleX||1,t.scaleY||1,t.centerX,t.centerY)),e.isIdentity?this.clone():Et.fromLines(this.normalizedLines.map(s=>{let i=s.x,r=s.y,o=s.c1x,a=s.c1y,h=s.c2x,c=s.c2y,l=s.toX,u=s.toY;return{x:i,y:r}=e.transformPoint({x:i,y:r}),{x:o,y:a}=e.transformPoint({x:o,y:a}),{x:h,y:c}=e.transformPoint({x:h,y:c}),{x:l,y:u}=e.transformPoint({x:l,y:u}),new xt({x:i,y:r,c1x:o,c1y:a,c2x:h,c2y:c,toX:l,toY:u})}))}cachedTotalLength;getTotalLength(){return(typeof this.cachedTotalLength!="number"||this.isUpdatedTotalLength)&&(this.cachedTotalLength=Math.round(this.normalizedLines.reduce((t,e)=>t+=e.length(),0)),this.isUpdatedTotalLength=!1),this.cachedTotalLength}getPointAtLength(t){let e=0,s=0;const i=this.normalizedLines.length;for(let r=0;r<i;r++){const o=this.normalizedLines[r];if(s=o.length(),e+s>=t)return o.getPointAtSegmentLength(t-e);e+=s}return this.normalizedLines[i-1].getPointAtSegmentLength(s)}interpolate(t){const e=this.normalizedLines.length;if(e===0)return{x:0,y:0};if(e===1)return this.normalizedLines[0].interpolate(t);{let s=t*e,i=this.normalizedLines[0];if(s--,s>1)for(let r=1;r<e&&(i=this.normalizedLines[r],s>1);r++)s-=1;return i.interpolate(s)}}getSubPathD(t,e,s=1e-6){const i=this.getSubPathDAtLength(e,!0);return As(t,0,s)?i:i.getSubPathDAtLength(t,!1)}getSubPathDAtLength(t,e=!1){const s=new Et;let i=0,r=!1;for(let o=0,a=this.normalizedLines.length;o<a;o++){const h=this.normalizedLines[o];o==0&&(s.prevPathX=h.x,s.prevPathY=h.y);const c=h.length();if(i+c>t&&!r){r=!0;const l=h.getPointAtSegmentLength(t-i);if(s._appendLine(new xt({x:s.prevPathX,y:s.prevPathY,c1x:l.start.x,c1y:l.start.y,c2x:l.m.x,c2y:l.m.y,toX:l.x,toY:l.y})),e)return s;s.normalizedLines=[],s._appendLine(new xt({x:s.prevPathX,y:s.prevPathY,c1x:l.n.x,c1y:l.n.y,c2x:l.end.x,c2y:l.end.y,toX:h.toX,toY:h.toY})),i+=c;continue}s._appendLine(h),i+=c}return s}closestPoint(t,e){const s=this.getTotalLength();let i={x:t,y:e},r=0,o=1/0,a=8;for(let c=0;c<=s;c+=a){const l=this.getPointAtLength(c),u=(t-l.x)*(t-l.x)+(e-l.y)*(e-l.y);u<o&&(i=l,r=c,o=u)}for(a/=2;a>.5;){const c=r-a,l=this.getPointAtLength(c),u=(t-l.x)*(t-l.x)+(e-l.y)*(e-l.y),m=r+a,f=this.getPointAtLength(m),p=(t-f.x)*(t-f.x)+(e-f.y)*(e-f.y);c>=0&&u<o?(i=l,r=c,o=u):m<=s&&p<o?(i=f,r=m,o=p):a/=2}const h=this.getPointAtLength(r+(r===s?-.1:.1));return{point:i,rotation:r>=s?zt(h.x,h.y,i.x,i.y):zt(i.x,i.y,h.x,h.y),distance:Math.sqrt(o)}}cachedPolymorphPoints=[];getPolymorphPoints(){if(this.isUpdatedPolymorphPoints){if(this.normalizedLines.length){const t=this.normalizedLines[0];this.cachedPolymorphPoints=[t.x,t.y].concat(this.normalizedLines.reduce((e,s)=>e.concat([s.c1x,s.c1y,s.c2x,s.c2y,s.toX,s.toY]),[]))}this.isUpdatedPolymorphPoints=!1}return[...this.cachedPolymorphPoints]}getPolymorphPointsPerimeter(){let t=0;const e=this.getPolymorphPoints(),s=e.length;if(s){let i=e[s-2],r=e[s-1];for(let o=0;o<s;o+=6)t+=Ae(e[o],e[o+1],i,r),i=e[o],r=e[o+1]}return Math.floor(t)}expendToPolymorphPoints(t){const e=t.length,s=this.getPolymorphPoints(),i=s.length;if(i){const r=[];let o=e-i;const a=Math.ceil(e/i);r.push(["M",s[0],s[1]]);let h=2;for(;h+5<=i-1;){const c=s[h++],l=s[h++],u=s[h++],m=s[h++],f=s[h++],p=s[h++];r.push(["C",c,l,u,m,f,p]);let y=0;for(;y<a&&o>0;)r.push(["C",f,p,f,p,f,p]),o-=6,y++}return new Et(r)}else return Et.fromPolymorphPoints(t)}static getInterpolator(t,e){return s=>As(s,0,Number.EPSILON)?t.clone():As(s,1,Number.EPSILON)?e.clone():Et.fromPolymorphPoints(df(t.getPolymorphPoints(),e.getPolymorphPoints(),s).map(i=>F(i,2)))}}const Ul=N1("50,nbsp,51,iexcl,52,cent,53,pound,54,curren,55,yen,56,brvbar,57,sect,58,uml,59,copy,5a,ordf,5b,laquo,5c,not,5d,shy,5e,reg,5f,macr,5g,deg,5h,plusmn,5i,sup2,5j,sup3,5k,acute,5l,micro,5m,para,5n,middot,5o,cedil,5p,sup1,5q,ordm,5r,raquo,5s,frac14,5t,frac12,5u,frac34,5v,iquest,60,Agrave,61,Aacute,62,Acirc,63,Atilde,64,Auml,65,Aring,66,AElig,67,Ccedil,68,Egrave,69,Eacute,6a,Ecirc,6b,Euml,6c,Igrave,6d,Iacute,6e,Icirc,6f,Iuml,6g,ETH,6h,Ntilde,6i,Ograve,6j,Oacute,6k,Ocirc,6l,Otilde,6m,Ouml,6n,times,6o,Oslash,6p,Ugrave,6q,Uacute,6r,Ucirc,6s,Uuml,6t,Yacute,6u,THORN,6v,szlig,70,agrave,71,aacute,72,acirc,73,atilde,74,auml,75,aring,76,aelig,77,ccedil,78,egrave,79,eacute,7a,ecirc,7b,euml,7c,igrave,7d,iacute,7e,icirc,7f,iuml,7g,eth,7h,ntilde,7i,ograve,7j,oacute,7k,ocirc,7l,otilde,7m,ouml,7n,divide,7o,oslash,7p,ugrave,7q,uacute,7r,ucirc,7s,uuml,7t,yacute,7u,thorn,7v,yuml,ci,fnof,sh,Alpha,si,Beta,sj,Gamma,sk,Delta,sl,Epsilon,sm,Zeta,sn,Eta,so,Theta,sp,Iota,sq,Kappa,sr,Lambda,ss,Mu,st,Nu,su,Xi,sv,Omicron,t0,Pi,t1,Rho,t3,Sigma,t4,Tau,t5,Upsilon,t6,Phi,t7,Chi,t8,Psi,t9,Omega,th,alpha,ti,beta,tj,gamma,tk,delta,tl,epsilon,tm,zeta,tn,eta,to,theta,tp,iota,tq,kappa,tr,lambda,ts,mu,tt,nu,tu,xi,tv,omicron,u0,pi,u1,rho,u2,sigmaf,u3,sigma,u4,tau,u5,upsilon,u6,phi,u7,chi,u8,psi,u9,omega,uh,thetasym,ui,upsih,um,piv,812,bull,816,hellip,81i,prime,81j,Prime,81u,oline,824,frasl,88o,weierp,88h,image,88s,real,892,trade,89l,alefsym,8cg,larr,8ch,uarr,8ci,rarr,8cj,darr,8ck,harr,8dl,crarr,8eg,lArr,8eh,uArr,8ei,rArr,8ej,dArr,8ek,hArr,8g0,forall,8g2,part,8g3,exist,8g5,empty,8g7,nabla,8g8,isin,8g9,notin,8gb,ni,8gf,prod,8gh,sum,8gi,minus,8gn,lowast,8gq,radic,8gt,prop,8gu,infin,8h0,ang,8h7,and,8h8,or,8h9,cap,8ha,cup,8hb,int,8hk,there4,8hs,sim,8i5,cong,8i8,asymp,8j0,ne,8j1,equiv,8j4,le,8j5,ge,8k2,sub,8k3,sup,8k4,nsub,8k6,sube,8k7,supe,8kl,oplus,8kn,otimes,8l5,perp,8m5,sdot,8o8,lceil,8o9,rceil,8oa,lfloor,8ob,rfloor,8p9,lang,8pa,rang,9ea,loz,9j0,spades,9j3,clubs,9j5,hearts,9j6,diams,ai,OElig,aj,oelig,b0,Scaron,b1,scaron,bo,Yuml,m6,circ,ms,tilde,802,ensp,803,emsp,809,thinsp,80c,zwnj,80d,zwj,80e,lrm,80f,rlm,80j,ndash,80k,mdash,80o,lsquo,80p,rsquo,80q,sbquo,80s,ldquo,80t,rdquo,80u,bdquo,810,dagger,811,Dagger,81g,permil,81p,lsaquo,81q,rsaquo,85c,euro",32);function N1(n,t=10){const e={},s=n.split(",");for(let i=0;i<s.length;i+=2){const r="&"+s[i+1]+";",o=parseInt(s[i],t);e[r]="&#"+o+";"}return e["\\xa0"]="&#160;",e}function Mt(n,t){const e=Object.keys(t);for(let s=0;s<e.length;s++)n=n.replace(new RegExp("{"+e[s]+"}","gi"),""+t[e[s]]);return n}function ni(n){let t,e;if(!n)throw new Error("cannot create a random attribute name for an undefined object");const s="ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz";t="";do for(t="",e=0;e<12;e++)t+=s[Math.floor(Math.random()*s.length)];while(n[t]);return t}function F1(n){const t={left:"start",right:"end",center:"middle",start:"start",end:"end"};return t[n]||t.start}function Y1(n){const t={alphabetic:"alphabetic",hanging:"hanging",top:"text-before-edge",bottom:"text-after-edge",middle:"central"};return t[n]||t.alphabetic}const on={strokeStyle:{svgAttr:"stroke",canvas:"#000000",svg:"none",apply:"stroke"},fillStyle:{svgAttr:"fill",canvas:"#000000",svg:null,apply:"fill"},lineCap:{svgAttr:"stroke-linecap",canvas:"butt",svg:"butt",apply:"stroke"},lineJoin:{svgAttr:"stroke-linejoin",canvas:"miter",svg:"miter",apply:"stroke"},miterLimit:{svgAttr:"stroke-miterlimit",canvas:10,svg:4,apply:"stroke"},lineWidth:{svgAttr:"stroke-width",canvas:1,svg:1,apply:"stroke"},globalAlpha:{svgAttr:"opacity",canvas:1,svg:1,apply:"fill stroke"},font:{canvas:"10px sans-serif"},shadowColor:{canvas:"#000000"},shadowOffsetX:{canvas:0},shadowOffsetY:{canvas:0},shadowBlur:{canvas:0},textAlign:{canvas:"start"},textBaseline:{canvas:"alphabetic"},lineDash:{svgAttr:"stroke-dasharray",canvas:[],svg:null,apply:"stroke"},lineDashOffset:{svgAttr:"stroke-dashoffset",canvas:0,svg:0,apply:"stroke"}};class Ao{__root;__ctx;constructor(t,e){this.__root=t,this.__ctx=e}addColorStop(t,e){const s=this.__ctx.__createElement("stop");if(s.setAttribute("offset",""+t),e.indexOf("rgba")!==-1){const r=/rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d?\.?\d*)\s*\)/gi.exec(e);r&&(s.setAttribute("stop-color",Mt("rgb({r},{g},{b})",{r:r[1],g:r[2],b:r[3]})),s.setAttribute("stop-opacity",r[4]))}else s.setAttribute("stop-color",e);this.__root.appendChild(s)}}class $l{__root;__ctx;constructor(t,e){this.__root=t,this.__ctx=e}}class ii{__document=document;__canvas;__ctx;width;height;__styleStack;__groupStack;__rootSVG;__ids;__SVGdefs;__currentElement;__currentElementsToStyle=null;constructor({canvas:t,width:e=500,height:s=500}){t?(this.__canvas=t,this.__ctx=t.getContext("2d")):(this.__canvas=this.__document.createElement("canvas"),this.__ctx=this.__canvas.getContext("2d")),this.width=e||t?.width||0,this.height=s||t?.height||0,this.__setDefaultStyles(),this.__styleStack=[this.__getStyleState()],this.__groupStack=[],this.__rootSVG=this.__document.createElementNS("http://www.w3.org/2000/svg","svg"),this.__rootSVG.setAttribute("version","1.1"),this.__rootSVG.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.__rootSVG.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink","http://www.w3.org/1999/xlink"),this.__rootSVG.setAttribute("width",""+this.width),this.__rootSVG.setAttribute("height",""+this.height),this.__ids={},this.__SVGdefs=this.__document.createElementNS("http://www.w3.org/2000/svg","defs"),this.__rootSVG.appendChild(this.__SVGdefs),this.__currentElement=this.__document.createElementNS("http://www.w3.org/2000/svg","g"),this.__rootSVG.appendChild(this.__currentElement)}__setDefaultStyles(){const t=Object.keys(on);for(let e=0,s=t.length;e<s;e++){const i=t[e];this[i]=on[i].canvas}}__getStyleState(){const t={},e=Object.keys(on);for(let s=0,i=e.length;s<i;s++){const r=e[s];t[r]=this[r]}return t}__applyStyleState(t){const e=Object.keys(t);for(let s=0,i=e.length;s<i;s++){const r=e[s];this[r]=t[r]}}__createElement(t,e={},s=!1){const i=this.__document.createElementNS("http://www.w3.org/2000/svg",t),r=Object.keys(e);s&&(i.setAttribute("fill","none"),i.setAttribute("stroke","none"));for(let o=0;o<r.length;o++){const a=r[o];i.setAttribute(a,e[a])}return i}__applyStyleToCurrentElement(t){let e=this.__currentElement;const s=this.__currentElementsToStyle;s&&(e.setAttribute(t,""),e=s.element,s.children.forEach(r=>{r.setAttribute(t,"")}));const i=Object.keys(on);for(let r=0;r<i.length;r++){const o=on[i[r]],a=this[i[r]];if(o.apply){if(a instanceof $l){if(a.__ctx)for(;a.__ctx.__SVGdefs.childNodes.length;){const h=a.__ctx.__SVGdefs.childNodes[0].getAttribute("id");this.__ids[h]=h,this.__SVGdefs.appendChild(a.__ctx.__SVGdefs.childNodes[0])}e.setAttribute(o.apply,Mt("url(#{id})",{id:a.__root.getAttribute("id")}))}else if(a instanceof Ao)e.setAttribute(o.apply,Mt("url(#{id})",{id:a.__root.getAttribute("id")}));else if(o.apply.indexOf(t)!==-1&&o.svg!==a)if((o.svgAttr==="stroke"||o.svgAttr==="fill")&&a.indexOf("rgba")!==-1){const c=/rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d?\.?\d*)\s*\)/gi.exec(a);if(c){e.setAttribute(o.svgAttr,Mt("rgb({r},{g},{b})",{r:c[1],g:c[2],b:c[3]}));let l=parseFloat(c[4]);const u=this.globalAlpha;u!=null&&(l*=u),e.setAttribute(o.svgAttr+"-opacity",""+l)}}else{let h=o.svgAttr;if(i[r]==="globalAlpha"&&(h=t+"-"+o.svgAttr,e.getAttribute(h)))continue;h&&e.setAttribute(h,a)}}}}__closestGroupOrSvg(t){return t=t||this.__currentElement,t.nodeName==="g"||t.nodeName==="svg"?t:this.__closestGroupOrSvg(t.parentNode)}getSerializedSvg(t){let e=new XMLSerializer().serializeToString(this.__rootSVG);if(/xmlns="http:\/\/www\.w3\.org\/2000\/svg".+xmlns="http:\/\/www\.w3\.org\/2000\/svg/gi.test(e)&&(e=e.replace('xmlns="http://www.w3.org/2000/svg','xmlns:xlink="http://www.w3.org/1999/xlink')),t){const i=Object.keys(Ul);for(let r=0,o=i.length;r<o;r++){const a=i[r],h=Ul[a],c=new RegExp(a,"gi");c.test(e)&&(e=e.replace(c,h))}}return e}getSvg(){return this.__rootSVG}save(){const t=this.__createElement("g"),e=this.__closestGroupOrSvg();this.__groupStack.push(e),e.appendChild(t),this.__currentElement=t,this.__styleStack.push(this.__getStyleState())}restore(){this.__currentElementsToStyle=null;const t=this.__groupStack.pop();t?this.__currentElement=t:this.__currentElement=this.__rootSVG.childNodes[1];const e=this.__styleStack.pop();e&&this.__applyStyleState(e)}__addTransform(t){const e=this.__closestGroupOrSvg();if(e.childNodes.length>0){this.__currentElement.nodeName==="path"&&(this.__currentElementsToStyle||(this.__currentElementsToStyle={element:e,children:[]}),this.__currentElementsToStyle.children.push(this.__currentElement),this.__applyCurrentDefaultPath());const i=this.__createElement("g");e.appendChild(i),this.__currentElement=i}let s=this.__currentElement.getAttribute("transform");s?s+=" ":s="",s+=t,this.__currentElement.setAttribute("transform",s)}scale(t,e){e===void 0&&(e=t),this.__addTransform(Mt("scale({x},{y})",{x:t,y:e}))}rotate(t){const e=t*180/Math.PI;this.__addTransform(Mt("rotate({angle},{cx},{cy})",{angle:e,cx:0,cy:0}))}translate(t,e){this.__addTransform(Mt("translate({x},{y})",{x:t,y:e}))}transform(t,e,s,i,r,o){this.__addTransform(Mt("matrix({a},{b},{c},{d},{e},{f})",{a:t,b:e,c:s,d:i,e:r,f:o}))}beginPath(){this.__currentDefaultPath="",this.__currentPosition={};const t=this.__createElement("path",{},!0);this.__closestGroupOrSvg().appendChild(t),this.__currentElement=t}__applyCurrentDefaultPath(){const t=this.__currentElement;t.nodeName==="path"&&t.setAttribute("d",this.__currentDefaultPath)}__addPathCommand(t){this.__currentDefaultPath+=" ",this.__currentDefaultPath+=t}moveTo(t,e){this.__currentElement.nodeName!=="path"&&this.beginPath(),this.__currentPosition={x:t,y:e},this.__addPathCommand(Mt("M {x} {y}",this.__currentPosition))}closePath(){this.__currentDefaultPath&&this.__addPathCommand("Z")}lineTo(t,e){this.__currentPosition={x:t,y:e},this.__currentDefaultPath.indexOf("M")>-1?this.__addPathCommand(Mt("L {x} {y}",this.__currentPosition)):this.__addPathCommand(Mt("M {x} {y}",this.__currentPosition))}bezierCurveTo(t,e,s,i,r,o){this.__currentPosition={x:r,y:o},this.__addPathCommand(Mt("C {cp1x} {cp1y} {cp2x} {cp2y} {x} {y}",{cp1x:t,cp1y:e,cp2x:s,cp2y:i,x:r,y:o}))}quadraticCurveTo(t,e,s,i){this.__currentPosition={x:s,y:i},this.__addPathCommand(Mt("Q {cpx} {cpy} {x} {y}",{cpx:t,cpy:e,x:s,y:i}))}normalize(t){const e=Math.sqrt(t[0]*t[0]+t[1]*t[1]);return[t[0]/e,t[1]/e]}arcTo(t,e,s,i,r){const o=this.__currentPosition&&this.__currentPosition.x,a=this.__currentPosition&&this.__currentPosition.y;if(typeof o>"u"||typeof a>"u")return;if(r<0)throw new Error("IndexSizeError: The radius provided ("+r+") is negative.");if(o===t&&a===e||t===s&&e===i||r===0){this.lineTo(t,e);return}const h=this.normalize([o-t,a-e]),c=this.normalize([s-t,i-e]);if(h[0]*c[1]===h[1]*c[0]){this.lineTo(t,e);return}const l=h[0]*c[0]+h[1]*c[1],u=Math.acos(Math.abs(l)),m=this.normalize([h[0]+c[0],h[1]+c[1]]),f=r/Math.sin(u/2),p=t+f*m[0],y=e+f*m[1],S=[-h[1],h[0]],w=[c[1],-c[0]],v=function(P){const C=P[0];return P[1]>=0?Math.acos(C):-Math.acos(C)},x=v(S),b=v(w);this.lineTo(p+S[0]*r,y+S[1]*r),this.arc(p,y,r,x,b)}stroke(){this.__currentElement.nodeName==="path"&&this.__currentElement.setAttribute("paint-order","fill stroke markers"),this.__applyCurrentDefaultPath(),this.__applyStyleToCurrentElement("stroke")}fill(){this.__currentElement.nodeName==="path"&&this.__currentElement.setAttribute("paint-order","stroke fill markers"),this.__applyCurrentDefaultPath(),this.__applyStyleToCurrentElement("fill")}rect(t,e,s,i){this.__currentElement.nodeName!=="path"&&this.beginPath(),this.moveTo(t,e),this.lineTo(t+s,e),this.lineTo(t+s,e+i),this.lineTo(t,e+i),this.lineTo(t,e),this.closePath()}fillRect(t,e,s,i){const r=this.__createElement("rect",{x:t,y:e,width:s,height:i},!0);this.__closestGroupOrSvg().appendChild(r),this.__currentElement=r,this.__applyStyleToCurrentElement("fill")}strokeRect(t,e,s,i){const r=this.__createElement("rect",{x:t,y:e,width:s,height:i},!0);this.__closestGroupOrSvg().appendChild(r),this.__currentElement=r,this.__applyStyleToCurrentElement("stroke")}__clearCanvas(){const e=this.__closestGroupOrSvg().getAttribute("transform"),s=this.__rootSVG.childNodes[1],i=s.childNodes;for(let r=i.length-1;r>=0;r--)i[r]&&s.removeChild(i[r]);this.__currentElement=s,this.__groupStack=[],e&&this.__addTransform(e)}clearRect(t,e,s,i){if(t===0&&e===0&&s===this.width&&i===this.height){this.__clearCanvas();return}const r=this.__closestGroupOrSvg(),o=this.__createElement("rect",{x:t,y:e,width:s,height:i,fill:"#FFFFFF"},!0);r.appendChild(o)}createLinearGradient(t,e,s,i){const r=this.__createElement("linearGradient",{id:ni(this.__ids),x1:t+"px",x2:s+"px",y1:e+"px",y2:i+"px",gradientUnits:"userSpaceOnUse"},!1);return this.__SVGdefs.appendChild(r),new Ao(r,this)}createRadialGradient(t,e,s,i,r,o){const a=this.__createElement("radialGradient",{id:ni(this.__ids),cx:i+"px",cy:r+"px",r:o+"px",fx:t+"px",fy:e+"px",gradientUnits:"userSpaceOnUse"},!1);return this.__SVGdefs.appendChild(a),new Ao(a,this)}__parseFont(){const e=/^\s*(?=(?:(?:[-a-z]+\s*){0,2}(italic|oblique))?)(?=(?:(?:[-a-z]+\s*){0,2}(small-caps))?)(?=(?:(?:[-a-z]+\s*){0,2}(bold(?:er)?|lighter|[1-9]00))?)(?:(?:normal|\1|\2|\3)\s*){0,3}((?:xx?-)?(?:small|large)|medium|smaller|larger|[.\d]+(?:%|in|[cem]m|ex|p[CustomCanvasContext]))(?:\s*\/\s*(normal|[.\d]+(?:%|in|[cem]m|ex|p[CustomCanvasContext])))?\s*([-,'"\sa-z0-9]+?)\s*$/i.exec(this.font),s={style:e[1]||"normal",size:e[4]||"10px",family:e[6]||"sans-serif",weight:e[3]||"normal",decoration:e[2]||"normal",href:null};return this.__fontUnderline==="underline"&&(s.decoration="underline"),this.__fontHref&&(s.href=this.__fontHref),s}__wrapTextLink(t,e){if(t.href){const s=this.__createElement("a");return s.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",t.href),s.appendChild(e),s}return e}__applyText(t,e,s,i){const r=this.__parseFont(),o=this.__closestGroupOrSvg(),a=this.__createElement("text",{"font-family":r.family,"font-size":r.size,"font-style":r.style,"font-weight":r.weight,"text-decoration":r.decoration,x:e,y:s,"text-anchor":F1(this.textAlign),"dominant-baseline":Y1(this.textBaseline)},!0);a.appendChild(this.__document.createTextNode(t)),this.__currentElement=a,this.__applyStyleToCurrentElement(i),o.appendChild(this.__wrapTextLink(r,a))}fillText(t,e,s){this.__applyText(t,e,s,"fill")}strokeText(t,e,s){this.__applyText(t,e,s,"stroke")}measureText(t){return this.__ctx.font=this.font,this.__ctx.measureText(t)}arc(t,e,s,i,r,o){if(i===r)return;i=i%(2*Math.PI),r=r%(2*Math.PI),i===r&&(r=(r+2*Math.PI-.001*(o?-1:1))%(2*Math.PI));const a=t+s*Math.cos(r),h=e+s*Math.sin(r),c=t+s*Math.cos(i),l=e+s*Math.sin(i),u=o?0:1;let m=0,f=r-i;f<0&&(f+=2*Math.PI),o?m=f>Math.PI?0:1:m=f>Math.PI?1:0,this.lineTo(c,l),this.__addPathCommand(Mt("A {rx} {ry} {xAxisRotation} {largeArcFlag} {sweepFlag} {endX} {endY}",{rx:s,ry:s,xAxisRotation:0,largeArcFlag:m,sweepFlag:u,endX:a,endY:h})),this.__currentPosition={x:a,y:h}}clip(){const t=this.__closestGroupOrSvg(),e=this.__createElement("clipPath"),s=ni(this.__ids),i=this.__createElement("g");this.__applyCurrentDefaultPath(),t.removeChild(this.__currentElement),e.setAttribute("id",s),e.appendChild(this.__currentElement),this.__SVGdefs.appendChild(e),t.setAttribute("clip-path",Mt("url(#{id})",{id:s})),t.appendChild(i),this.__currentElement=i}drawImage(...t){let e=t[0],s,i,r,o,a=0,h=0,c,l,u,m,f,p,y,S;if(t.length===3)s=t[1],i=t[2],c=e.width,l=e.height,r=c,o=l;else if(t.length===5)s=t[1],i=t[2],r=t[3],o=t[4],c=e.width,l=e.height;else if(t.length===9)a=t[1],h=t[2],c=t[3],l=t[4],s=t[5],i=t[6],r=t[7],o=t[8];else throw new Error("Invalid number of arguments passed to drawImage: "+arguments.length);const w=this.__closestGroupOrSvg();this.__currentElement;const v="translate("+s+", "+i+")";if(e instanceof ii){if(u=e.getSvg().cloneNode(!0),u.childNodes&&u.childNodes.length>1){for(m=u.childNodes[0];m.childNodes.length;)S=m.childNodes[0].getAttribute("id"),this.__ids[S]=S,this.__SVGdefs.appendChild(m.childNodes[0]);if(f=u.childNodes[1],f){const x=f.getAttribute("transform");let b;x?b=x+" "+v:b=v,f.setAttribute("transform",b),w.appendChild(f)}}}else(e.nodeName==="CANVAS"||e.nodeName==="IMG")&&(p=this.__createElement("image"),p.setAttribute("width",r),p.setAttribute("height",o),p.setAttribute("preserveAspectRatio","none"),(a||h||c!==e.width||l!==e.height)&&(y=this.__document.createElement("canvas"),y.width=r,y.height=o,y.getContext("2d")?.drawImage(e,a,h,c,l,0,0,r,o),e=y),p.setAttribute("transform",v),p.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",e.nodeName==="CANVAS"?e.toDataURL():e.getAttribute("src")),w.appendChild(p))}createPattern(t,e){const s=this.__document.createElementNS("http://www.w3.org/2000/svg","pattern"),i=ni(this.__ids);let r;return s.setAttribute("id",i),t.nodeName==="CANVAS"||t.nodeName==="IMG"?(r=this.__document.createElementNS("http://www.w3.org/2000/svg","image"),r.setAttribute("width",""+t.width),r.setAttribute("height",""+t.height),r.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",t.nodeName==="CANVAS"?t.toDataURL():t.getAttribute("src")),s.appendChild(r),this.__SVGdefs.appendChild(s)):t instanceof ii&&(s.setAttribute("width",""+t.width),s.setAttribute("height",""+t.height),s.appendChild(t.__rootSVG.childNodes[1]),this.__SVGdefs.appendChild(s)),new $l(s,this)}setLineDash(t){t&&t.length>0?this.lineDash=t.join(","):this.lineDash=null}drawFocusRing(){}createImageData(){}getImageData(){}putImageData(){}globalCompositeOperation(){}setTransform(){}}class Io{canvas;context;customContext;enablePath2D=!1;currentPath2D=new Path2D;path2Ds=[];currentMatrix=new DOMMatrix;hasSetCustomStrokeStyle=!1;hasSetCustomFillStyle=!1;constructor(t,e,s,i=!1,r=!1){this.canvas=t,this.context=t.getContext("2d",{willReadFrequently:!0}),i&&(this.customContext=new ii({canvas:this.canvas,width:e||this.canvas.width,height:s||this.canvas.height})),this.enablePath2D=typeof r=="boolean"?r:!1}set lineWidth(t){this.hasSetCustomStrokeStyle=!0,this.context.lineWidth=t,this.customContext&&(this.customContext.lineWidth=t)}get lineWidth(){return this.context.lineWidth}set lineCap(t){this.hasSetCustomStrokeStyle=!0,this.context.lineCap=t,this.customContext&&(this.customContext.lineCap=t)}get lineCap(){return this.context.lineCap}set lineJoin(t){this.hasSetCustomStrokeStyle=!0,this.context.lineJoin=t,this.customContext&&(this.customContext.lineCap=t)}get lineJoin(){return this.context.lineJoin}set lineDashOffset(t){this.hasSetCustomStrokeStyle=!0,this.context.lineDashOffset=t,this.customContext&&(this.customContext.lineDashOffset=t)}get lineDashOffset(){return this.context.lineDashOffset}set miterLimit(t){this.hasSetCustomStrokeStyle=!0,this.context.miterLimit=t,this.customContext&&(this.customContext.miterLimit=t)}get miterLimit(){return this.context.miterLimit}set globalAlpha(t){this.context.globalAlpha=t,this.customContext&&(this.customContext.globalAlpha=t)}get globalAlpha(){return this.context.globalAlpha}set fillStyle(t){this.hasSetCustomFillStyle=!0,typeof t=="string"||t instanceof CanvasGradient||t instanceof CanvasPattern?(this.context.fillStyle=t,this.customContext&&(this.customContext.fillStyle=t)):(this.context.fillStyle=t.gradient,this.customContext&&(this.customContext.fillStyle=t.gradientCustom))}get fillStyle(){return this.context.fillStyle}set strokeStyle(t){this.hasSetCustomStrokeStyle=!0,typeof t=="string"||t instanceof CanvasGradient||t instanceof CanvasPattern?(this.context.strokeStyle=t,this.customContext&&(this.customContext.strokeStyle=t)):(this.context.strokeStyle=t.gradient,this.customContext&&(this.customContext.strokeStyle=t.gradientCustom))}get strokeStyle(){return this.context.strokeStyle}set font(t){this.context.font=t,this.customContext&&(this.customContext.font=t)}get font(){return this.context.font}set textBaseline(t){this.context.textBaseline=t,this.customContext&&(this.customContext.textBaseline=t)}get textBaseline(){return this.context.textBaseline}set textAlign(t){this.context.textAlign=t,this.customContext&&(this.customContext.textAlign=t)}get textAlign(){return this.context.textAlign}fill(t){return t?this.context.fill(t):(this.context.fill(),this.customContext&&this.customContext.fill()),this}fillRect(t,e,s,i){return this.context.fillRect(t,e,s,i),this.customContext&&this.customContext.fillRect(t,e,s,i),this}fillText(t,e,s,i){return this.hasSetCustomFillStyle=!1,this.context.fillText(t,e,s,i),this.customContext&&this.customContext.fillText(t,e,s),this}setLineDash(t){return this.context.setLineDash(t),this.customContext&&this.customContext.setLineDash(t),this}stroke(t){return t?this.context.stroke(t):(this.context.stroke(),this.customContext&&this.customContext.stroke()),this}strokeText(t,e,s,i){return this.context.strokeText(t,e,s,i),this.customContext&&this.customContext.strokeText(t,e,s),this}strokeRect(t,e,s,i){return this.context.strokeRect(t,e,s,i),this.customContext&&this.customContext.strokeRect(t,e,s,i),this}measureText(t){return this.context.measureText(t)}clearRect(t=0,e=0,s=this.canvas.width,i=this.canvas.height){return this.context.clearRect(t,e,s,i),this.customContext&&this.customContext.clearRect(t,e,s,i),this}save(){return this.context.save(),this.customContext&&this.customContext.save(),this.currentMatrix=new DOMMatrix,this.enablePath2D&&(this.path2Ds.push(this.currentPath2D),this.currentPath2D=new Path2D),this}restore(){return this.context.restore(),this.customContext&&this.customContext.restore(),this.hasSetCustomStrokeStyle=!1,this.hasSetCustomFillStyle=!1,this.currentMatrix=new DOMMatrix,this.enablePath2D&&(this.currentPath2D=this.path2Ds.pop()||new Path2D),this}beginPath(){return this.context.beginPath(),this.customContext&&this.customContext.beginPath(),this}closePath(){return this.context.closePath(),this.customContext&&this.customContext.closePath(),this.enablePath2D&&this.currentPath2D.closePath(),this}changePath2D(t=this.currentPath2D,e=this.currentMatrix){if(this.enablePath2D){const s=new Path2D;s.addPath(t,e),this.currentPath2D=s}}isPointInStroke(...t){return t[0]instanceof Path2D?this.context.isPointInStroke(t[0],t[1],t[2]):this.context.isPointInStroke(t[0],t[1])}isPointInPath(...t){return t[0]instanceof Path2D?this.context.isPointInPath(t[0],t[1],t[2]):this.context.isPointInPath(t[0],t[1])}translate(t,e){return this.context.translate(t,e),this.customContext&&this.customContext.translate(t,e),this.currentMatrix=this.currentMatrix.translate(t,e),this.changePath2D(),this}rotate(t,e=0,s=0){return this.translate(e,s),this.context.rotate(t),this.customContext&&this.customContext.rotate(t),this.currentMatrix=this.currentMatrix.rotate(t),this.translate(-e,-s),this.changePath2D(),this}scale(t,e=t,s=0,i=0){return this.translate(s,i),this.context.scale(t,e),this.customContext&&this.customContext.scale(t,e),this.currentMatrix=this.currentMatrix.scale(t,e),this.translate(-s,-i),this.changePath2D(),this}moveTo(t,e){return this.context.moveTo(t,e),this.customContext&&this.customContext.moveTo(t,e),this.enablePath2D&&this.currentPath2D.moveTo(t,e),this}lineTo(t,e){return this.context.lineTo(t,e),this.customContext&&this.customContext.lineTo(t,e),this.enablePath2D&&this.currentPath2D.lineTo(t,e),this}arc(t,e,s,i,r,o){return this.context.arc(t,e,s,i,r,o),this.customContext&&this.customContext.arc(t,e,s,i,r,o?-1:1),this.enablePath2D&&this.currentPath2D.arc(t,e,s,i,r,o),this}arcTo(t,e,s,i,r){return this.context.arcTo(t,e,s,i,r),this.customContext&&this.customContext.arcTo(t,e,s,i,r),this.enablePath2D&&this.currentPath2D.arcTo(t,e,s,i,r),this}ellipse(t,e,s,i,r,o,a,h){return this.context.ellipse(t,e,s,i,r,o,a,h),this.enablePath2D&&this.currentPath2D.ellipse(t,e,s,i,r,o,a,h),this}quadraticCurveTo(t,e,s,i){return this.context.quadraticCurveTo(t,e,s,i),this.customContext&&this.customContext.quadraticCurveTo(t,e,s,i),this.enablePath2D&&this.currentPath2D.quadraticCurveTo(t,e,s,i),this}bezierCurveTo(t,e,s,i,r,o){return this.context.bezierCurveTo(t,e,s,i,r,o),this.customContext&&this.customContext.bezierCurveTo(t,e,s,i,r,o),this.enablePath2D&&this.currentPath2D.bezierCurveTo(t,e,s,i,r,o),this}rect(t,e,s,i){return this.context.rect(t,e,s,i),this.customContext&&this.customContext.rect(t,e,s,i),this.enablePath2D&&this.currentPath2D.rect(t,e,s,i),this}createLinearGradient(t,e,s,i,r){const o=this.context.createLinearGradient(t,e,s,i);return r&&Object.entries(r).forEach(([a,h])=>{o.addColorStop(parseFloat(a),h)}),o}createRadialGradient(t,e,s,i,r,o,a){const h=this.context.createRadialGradient(t,e,s,i,r,o);return a&&Object.entries(a).forEach(([c,l])=>{h.addColorStop(parseFloat(c),l)}),h}drawImage(t,...e){if(e.length===0)this.context.drawImage(t,0,0);else if(e.length===2){const s=e[0],i=e[1];this.context.drawImage(t,s,i)}else if(e.length===4){const s=e[0],i=e[1],r=e[2],o=e[3];this.context.drawImage(t,s,i,r,o)}else if(e.length===8){const s=e[0],i=e[1],r=e[2],o=e[3],a=e[4],h=e[5],c=e[6],l=e[7];this.context.drawImage(t,s,i,r,o,a,h,c,l)}else throw new Error("Invalid number of arguments passed to drawImage: "+e.length);return this.customContext&&this.customContext.drawImage(t,...e),this}getImageData(t=0,e=0,s=this.canvas.width,i=this.canvas.height,r){return this.context.getImageData(t,e,s,i,r)}putImageData(t,e=0,s=0){return this.context.putImageData(t,e,s)}createPattern(t,e){return this.context.createPattern(t,e)}toRawSVG(){if(this.customContext){const t=this.customContext.getSerializedSvg(!0),e=this.customContext.getSvg();return{raw:t,element:e}}else return{raw:"",element:null}}}class K{shouldUpdatePathD=!1;shouldUpdateTransformPathD=!1;shouldUpdateSVGElInDraw=!1;shouldUpdateMInDraw=!0;shouldUpdateAttrsInDraw=!0;shouldUpdateStyleInDraw=!0;id;initD;d;parent;attrs={};style={};initCenterX;initCenterY;_x;_y;_degree;_scaleX;_scaleY;vx;vy;ax;ay;mass;interactive;drag;transform$=new ds;transformSubscription;isMouseIn=!1;isDragging=!1;m;el;constructor(t){this.id=Ms(4),this.initD=t?.initD,this.setAttr({stroke:"none",fill:"none"}),t?.attrs&&this.setAttr(t.attrs),t?.style&&this.setStyle(t.style),this.initCenterX=t?.centerX,this.initCenterY=t?.centerY,this._x=t?.x||0,this._y=t?.y||0,this._degree=t?.degree||0,this._scaleX=1,this._scaleY=1,t?.scale!==void 0&&(this._scaleX=t.scale,this._scaleY=t.scale),t?.scaleX!==void 0&&(this._scaleX=t.scaleX),t?.scaleY!==void 0&&(this._scaleY=t.scaleY),this.vx=t?.vx||0,this.vy=t?.vy||0,this.ax=t?.ax||0,this.ay=t?.ay||0,this.mass=t?.mass||1,this.interactive=typeof t?.interactive=="boolean"?t?.interactive:!0,this.drag=t?.drag,this.transformSubscription=this.transform$.subscribe(()=>{this.shouldUpdateTransformPathD=!0,this.shouldUpdateMInDraw=!0})}destroy(){this.transformSubscription.unsubscribe()}moveTo(t,e){const s=this._x,i=this._y;(s!==t||i!==e)&&(this._x=t,this._y=e,this.transform$.next({dX:t-s,dY:e-i}))}move(t,e=0){this.moveTo(this._x+t,this._y+e)}moveXTo(t){this.moveTo(t,this._y)}moveX(t){this.moveTo(this._x+t,this._y)}moveYTo(t){this.moveTo(this._x,t)}moveY(t){this.moveTo(this._x,this._y+t)}get x(){return this._x}set x(t){this._x!==t&&(this.transform$.next({dX:t-this._x}),this._x=t)}get y(){return this._y}set y(t){this._y!==t&&(this.transform$.next({dY:t-this._y}),this._y=t)}rotateTo(t){this._degree!==t&&(this.transform$.next({dDegree:t-this._degree}),this._degree=t)}rotate(t){this.rotateTo(this._degree+t)}get degree(){return this._degree}set degree(t){this._degree!==t&&(this.transform$.next({dDegree:t-this._degree}),this._degree=t)}scaleTo(t,e){const s=this._scaleX,i=this._scaleY;(this._scaleX!==t||this._scaleY!==(e||t))&&(this._scaleX=t,this._scaleY=e||t,this.transform$.next({dScaleX:this._scaleX/s,dScaleY:this._scaleY/i}))}scale(t,e){this.scaleTo(this._scaleX*t,this._scaleY*(e||t))}get scaleX(){return this._scaleX}set scaleX(t){this._scaleX!==t&&(this.transform$.next({dScaleX:t/this._scaleX}),this._scaleX=t)}get scaleY(){return this._scaleY}set scaleY(t){this._scaleY!==t&&(this.transform$.next({dScaleY:t/this._scaleY}),this._scaleY=t)}pathD(t){return t?(this.d=t,this.shouldUpdateTransformPathD=!0,this.shouldUpdateSVGElInDraw=!0):this.initD?this.d||(this.d=this.initD instanceof Et?this.initD:new Et(this.initD)):(!this.d||this.shouldUpdatePathD)&&(this.d=new Et(this.toSVGPathData()),this.shouldUpdatePathD=!1,this.shouldUpdateTransformPathD=!0,this.shouldUpdateSVGElInDraw=!0),this.d}cachedTransformedPathD;transformPathD(){if(!this.m){const{x:t,y:e}=this.transformOrigin();let s=0,i=0;if(this.parent?.dDegree||this.parent?.dScaleX!==1||this.parent?.dScaleY!==1){const o=this.transformOrigin(!0);s=o.x,i=o.y}const r=new wt;r.translate(this.x+(this.parent?.dX||0),this.y+(this.parent?.dY||0)),r.rotate(this.degree,t,e),r.scale(this.scaleX,this.scaleY,t,e),this.parent?.dDegree&&r.rotate(this.parent.dDegree,s,i),(this.parent?.dScaleX!==1||this.parent?.dScaleY!==1)&&r.scale(this.parent?.dScaleX||1,this.parent?.dScaleY||1,s,i),this.m=r}return(this.shouldUpdateTransformPathD||!this.cachedTransformedPathD)&&(this.cachedTransformedPathD=this.pathD().transform({m:this.m}),this.shouldUpdateTransformPathD=!1),this.cachedTransformedPathD}getBaseOptions(){return{initD:this.initD,attrs:{...this.attrs},style:{...this.style},centerX:this.initCenterX,centerY:this.initCenterY,x:this._x,y:this._y,degree:this._degree,scaleX:this._scaleX,scaleY:this._scaleY,vx:this.vx,vy:this.vy,ax:this.ax,ay:this.ay,mass:this.mass,interactive:this.interactive,drag:{...this.drag}}}clone(){return this.cloneShape()}cloneShape(){return new K(this.getBaseOptions())}update(t){this.shouldUpdatePathD=!0}toSVGEl(){return null}toSVGPathData(){return[]}toSVGPathD(){return this.pathD().toSVGPathD()}toCanvasContext(t){this.pathD().toCanvasContext(t)}getBoundingClientRect(t=2){return this.pathD().getBoundingClientRect(t)}getRealBoundingClientRect(t=2){return this.transformPathD().getBoundingClientRect(t)}getBoundingClientRectCenter(t=2){return this.pathD().getBoundingClientRectCenter(t)}getRealBoundingClientRectCenter(t=2){return this.transformPathD().getBoundingClientRectCenter(t)}transformOrigin(t=!1,e=2){let s=0,i=0;if(this.parent&&!t){const r=this.parent.combo.getBoundingClientRectCenter(e);s=r.x-this.parent.dX,i=r.y-this.parent.dY}else if(typeof this.initCenterX>"u"&&typeof this.initCenterY>"u"){const r=this.getBoundingClientRectCenter(e);s=r.x,i=r.y}else s=this.initCenterX||0,i=this.initCenterY||0;return{x:s,y:i}}isPointInPath(t,e,s){if(t instanceof Io)return t.isPointInPath(new Path2D(this.toSVGPathD()),e,s);if(this.el instanceof SVGGeometryElement){const i=this.el.getCTM();if(i){const r=i.inverse();return this.el.isPointInFill({x:r.a*e+r.c*s+r.e,y:r.b*e+r.d*s+r.f})}}return!1}isPointInStroke(t,e,s){if(t instanceof Io)return t.isPointInStroke(new Path2D(this.toSVGPathD()),e,s);if(this.el instanceof SVGGeometryElement){const i=this.el.getCTM();if(i){const r=i.inverse();return this.el.isPointInStroke({x:r.a*e+r.c*s+r.e,y:r.b*e+r.d*s+r.f})}}return!1}setStyle(t){Object.assign(this.style,t),this.shouldUpdateStyleInDraw=!0}setAttr(t,e){if(typeof t!="string")for(const s in t){const i=t[s];i&&i!=this.getAttr(s)&&(this.attrs[lt(s)]=i,this.shouldUpdateAttrsInDraw=!0)}else e&&e!=this.getAttr(t)&&(this.attrs[lt(t)]=e,this.shouldUpdateAttrsInDraw=!0)}getAttr(t,e){return this.attrs[t]||this.attrs[lt(t)]||e}hasAttr(t){return!!this.getAttr(t)}animate(t){this.vx+=this.ax,this.vy+=this.ay;const e=t?.gravity||0;this.vy+=e;const s=t?.friction||1;this.vx*=s,this.vy*=s,this.move(this.vx,this.vy)}animateEaseTo(t,e){const s=e?.easing||.05,i=t.x-this.x,r=t.y-this.y;this.vx=i*s,this.vy=r*s,this.animate(e)}animateSpringTo(t,e){const s=e?.spring||.03;(Array.isArray(t)?t:[t]).forEach(i=>{const r=i.x-this.x,o=i.y-this.y,a=r*s,h=o*s;this.vx+=a,this.vy+=h}),this.animate({friction:.9,...e})}getSpringMassAlphaTo(t,e){const s=e?.springLength||100,i=e?.spring||5e-4,r=t.x-this.x,o=t.y-this.y,a=Math.sqrt(r*r+o*o);if(a<s){const h=r*i,c=o*i;return this.vx+=h/this.mass,this.vy+=c/this.mass,t.vx-=h/t.mass,t.vy-=c/t.mass,1-a/s}return 0}followTo(t,e=3){this.rotateTo(mt(zt(this.x,this.y,t.x,t.y)));const{dx:s,dy:i}=Ie(q(this.degree),e);this.vx=s,this.vy=i,this.animate()}followAccelerationTo(t,e=.05){this.rotateTo(mt(zt(this.x,this.y,t.x,t.y)));const{dx:s,dy:i}=Ie(q(this.degree),e);this.ax=s,this.ay=i,this.animate()}gravitateTo(t){const e=t.x-this.x,s=t.y-this.y,i=e*e+s*s,r=Math.sqrt(i),o=this.mass*t.mass/i,a=o*e/r,h=o*s/r;this.vx+=a/this.mass,this.vy+=h/this.mass,t.vx-=a/t.mass,t.vy-=h/t.mass}checkCollision(t){const e=t.x-this.x,s=t.y-this.y,i=Math.sqrt(e*e+s*s),{x:r,y:o,width:a,height:h}=t.getBoundingClientRect(),{x:c,y:l}=t.getBoundingClientRectCenter(),{x:u,y:m,width:f,height:p}=this.getBoundingClientRect(),{x:y,y:S}=this.getBoundingClientRectCenter();if(i<Math.abs(c-r)+Math.abs(y-u)||i<Math.abs(l-o)+Math.abs(S-m)){const w=Math.atan2(s,e),v={x:0,y:0},x=Qt(-w,e,s),b=Qt(-w,this.vx,this.vy),P=Qt(-w,t.vx,t.vy),C=b.x-P.x;b.x=((this.mass-t.mass)*b.x+2*t.mass*P.x)/(this.mass+t.mass),P.x=C+b.x;const D=Math.abs(b.x)+Math.abs(P.x),B=this.ballRadius+t.ballRadius-Math.abs(v.x-x.x);v.x+=b.x/D*B,x.x+=P.x/D*B;const Y=Qt(w,v.x,v.y),V=Qt(w,x.x,x.y);t.moveTo(this.x+V.x,this.y+V.y),this.moveTo(this.x+Y.x,this.y+Y.y);const G=Qt(w,b.x,b.y),J=Qt(w,P.x,P.y);this.vx=G.x,this.vy=G.y,t.vx=J.x,t.vy=J.y}}checkWall(t){if(!t?.wall)return;const e=typeof t.wall.bounce=="number"?t.wall.bounce:-1,s=t.wall.x,i=t.wall.y,r=t.wall.x+t.wall.width,o=t.wall.y+t.wall.height,{x:a,y:h,width:c,height:l}=this.getBoundingClientRect();t.wall.cycle||!1?(this.x+a>r?this.moveXTo(s-(a+c)):this.x+a+c<s&&this.moveXTo(r-a),this.y+h>o?this.moveYTo(i-(h+l)):this.y+h+l<i&&this.moveYTo(o-h)):(this.x+a+c>r?(this.moveXTo(r-(a+c)),this.vx*=e):this.x+a<s&&(this.moveXTo(s+(a+c)),this.vx*=e),this.y+h+l>o?(this.moveYTo(o-(h+l)),this.vy*=e):this.y+h<i&&(this.moveYTo(i+(h+l)),this.vy*=e))}getTotalLength(){return this.transformPathD().getTotalLength()}getPointAtLength(t){return this.transformPathD().getPointAtLength(t)}interpolate(t){return this.transformPathD().interpolate(t)}trailPath(t=0,e=1){const s=this.getTotalLength(),i=t*s,r=e*s;return{subPathD:this.transformPathD().getSubPathD(i,r),point:this.getPointAtLength(r)}}strokeDashTween(t=1e3,e){const s=this.pathD().getTotalLength();this.setAttr({strokeDasharray:`${s} ${s}`,strokeDashoffset:`${s}`});const i=e?.onUpdate,r=new $s({frameDuration:t});r.addTween({offset:s},{offset:0},Object.assign(e||{},{onUpdate:(o,a)=>{this.setAttr("strokeDashoffset",""+F(o.offset,2)),i?.(o,a)}})),r.play()}static generateRosetta(t,e,s,i,r){if(r==0)throw new Error("no dividing by zero, please");const o=[],a=360/r;for(let h=0;h<r;h+=1){const c=a*h*Math.PI/180,l=t+2*s*Math.cos(c),u=e+2*s*Math.sin(c);o.push(new vo({x:t,y:e,rx:s,ry:i,xAxisRotate:a*h,largeArcFlag:1,sweepFlag:1,toX:l,toY:u})),o.push(new vo({x:l,y:u,rx:s,ry:i,xAxisRotate:a*h,largeArcFlag:1,sweepFlag:1,toX:t,toY:e}))}return new K({initD:Et.fromLines(o)})}}class Lt{shapes=[];svg;forceWidth;attrs={};style={};initCenterX;initCenterY;x;y;degree;scaleX;scaleY;interactive;drag;constructor(t){if(this.initCenterX=t?.centerX,this.initCenterY=t?.centerY,this.x=t?.x||0,this.y=t?.y||0,this.degree=t?.degree||0,this.scaleX=1,this.scaleY=1,t?.scale!==void 0&&(this.scaleX=t.scale,this.scaleY=t.scale),t?.scaleX!==void 0&&(this.scaleX=t.scaleX),t?.scaleY!==void 0&&(this.scaleY=t.scaleY),t?.attrs&&this.setAttr(t.attrs),t?.style&&this.setStyle(t.style),this.interactive=typeof t?.interactive=="boolean"?t?.interactive:!0,this.drag=t?.drag,this.svg=t?.svg,this.forceWidth=t?.forceWidth,t?.svg){this.initCenterX=0,this.initCenterY=0;let e=0,s=0,i=0,r=0;const o=new B1(t.svg).parse();for(let a=0,h=o.length;a<h;a++){const c=o[a];if(c.type=="viewbox"&&c.width&&c.height){if(e=parseFloat(c.width),s=parseFloat(c.height),t.forceWidth){const p=e/s;i=t.forceWidth,r=i/p}else i=e,r=s;continue}if(c.type!="path"||!Bl(c.path))continue;const l={};for(const p in c)p==="type"||p==="path"||p==="transform"||(l[p]=c[p]);const u=Fl(Nl(c.path)),m=[];let f=[];for(let p=0,y=u.length;p<y;p++){const S=u[p];f.push(S),S[0].toLowerCase()=="z"&&(m.push(f),f=[])}f.length&&m.push(f),m.forEach(p=>{const y=new K({attrs:l,initD:p});if(c.transform){const w=Qr(c.transform).split();y.moveTo(w.x,w.y),y.rotateTo(w.degree),y.scaleTo(w.scaleX,w.scaleY)}this.addShape(y)})}i&&e&&r&&s&&this.comboScale(i/e,r/s,!0)}}destroy(){this.shapes.forEach(t=>t.destroy())}getBaseOptions(){return{svg:this.svg,forceWidth:this.forceWidth,attrs:{...this.attrs},style:{...this.style},centerX:this.initCenterX,centerY:this.initCenterY,x:this.x,y:this.y,degree:this.degree,scaleX:this.scaleX,scaleY:this.scaleY,interactive:this.interactive,drag:{...this.drag}}}clone(){const t=this.cloneShapeCombo();return t.shapes=this.shapes.map(e=>{const s=e.clone();return e.parent&&(s.parent={...e.parent,combo:t}),s}),t}cloneShapeCombo(){return new Lt(this.getBaseOptions())}update(t){this.shapes.forEach(e=>e.update(t))}addShape(t,e){e?.notCopyFromCombo!==!0&&(t.setAttr(this.attrs),t.setStyle(this.style),t.interactive=t.interactive||this.interactive,t.drag={...this.drag,...t.drag}),t.parent={combo:this,dX:e?.dX||0,dY:e?.dY||0,dDegree:e?.dDegree||0,dScaleX:e?.dScaleX||1,dScaleY:e?.dScaleY||1},this.shapes.push(t)}comboMove(t,e,s=!1){s||(this.x+=t,this.y+=e),this.shapes.forEach(i=>{i.move(t,e)})}comboRotate(t,e=!1){e||(this.degree+=t),this.shapes.forEach(s=>{s.rotate(t)})}comboScale(t,e,s=!1){s||(this.scaleX*=t,this.scaleY*=e||t),this.shapes.forEach(i=>{i.scale(t,e)})}comboTransform(t,e=!1){(typeof t?.x=="number"||typeof t?.y=="number")&&this.comboMove(t?.x||0,t?.y||0,e),typeof t?.degree=="number"&&this.comboRotate(t?.degree||0,e),(typeof t?.scale=="number"||typeof t?.scaleX=="number"||typeof t?.scaleY=="number")&&this.comboScale(t?.scaleX||t?.scale||1,t?.scaleY||t?.scale||1,e)}getBoundingClientRect(t=2){const e=[],s=[];if(this.shapes.forEach(h=>{const c=h.getBoundingClientRect(t);e.push(c.x,c.x+c.width),s.push(c.y,c.y+c.height)}),e.length==0||s.length==0)return{x:0,y:0,width:0,height:0};const i=Math.min(...e),r=Math.min(...s),o=Math.max(...e),a=Math.max(...s);return{x:F(i,t),y:F(r,t),width:F(o-i,t),height:F(a-r,t)}}getBoundingClientRectCenter(t=2){if(typeof this.initCenterX=="number"&&typeof this.initCenterY=="number")return{x:this.initCenterX,y:this.initCenterY};const e=this.getBoundingClientRect(t);return{x:F(e.x+e.width*.5,t),y:F(e.y+e.height*.5,t)}}setStyle(t){Object.assign(this.style,t),this.shapes.forEach(e=>{e.setStyle(t)})}setAttr(t,e){if(typeof t!="string"){for(const s in t){const i=t[s];i&&i!=this.getAttr(s)&&(this.attrs[lt(s)]=i)}this.shapes.forEach(s=>{s.setAttr(t)})}else e&&e!=this.getAttr(t)&&(this.attrs[lt(t)]=e,this.shapes.forEach(s=>{s.setAttr(t,e)}))}getAttr(t,e){return this.attrs[t]||this.attrs[lt(t)]||e}hasAttr(t){return!!this.getAttr(t)}sort(){this.shapes.map(t=>({shape:t,perimeter:t.transformPathD().getPolymorphPointsPerimeter()})).sort((t,e)=>e.perimeter-t.perimeter).map(t=>t.shape)}expendTo(t){const e=t.shapes.length,s=this.shapes.length;if(e<s)return t.expendTo(this);for(let i=s;i<e;i++){const r=t.shapes[i];this.addShape(new K({initD:r.pathD().clone()}),{dX:r.x-this.x,dY:r.y-this.y,dDegree:r.degree-this.degree,dScaleX:r.scaleX/this.scaleX,dScaleY:r.scaleY/this.scaleY,notCopyFromCombo:!0})}}strokeDashTween(t,e){switch(e?.type){case"sequence":this.shapes.forEach((o,a)=>{o.strokeDashTween(t,{...e,delay:a,onStart:()=>{a==0&&e?.onGroupStart?.()},onUpdate:()=>{e?.onGroupUpdate?.()},onComplete:()=>{a==this.shapes.length-1&&e?.onGroupComplete?.()}})});break;case"parallel":default:const s=new $s({frameDuration:t}),i={},r={};this.shapes.forEach((o,a)=>{const h=o.pathD().getTotalLength();i[`offset_${a}`]=h,r[`offset_${a}`]=0,o.setAttr({strokeDasharray:`${h} ${h}`,strokeDashoffset:`${h}`})}),s.addTween(i,r,Object.assign(e||{},{onStart:()=>{e?.onGroupStart?.()},onUpdate:(o,a)=>{for(const h in o){const c=Di(h).number;this.shapes[c].setAttr("strokeDashoffset",""+F(o[h],2))}e?.onGroupUpdate?.()},onComplete:()=>{e?.onGroupComplete?.()}})),s.play();break}}}function X1(n,t,e=5){(!As(n.x,t.current.x,e)||!As(n.y,t.current.y,e))&&n.followTo(t.current)}function U1(n,t,e){n.drag&&n.drag.enable&&!n.isDragging&&n.animateEaseTo(t,e)}function $1(n,t){const e=[],s=n.length;for(let i=0;i<s;i++){const r=n[i];if(t?.springLength){const o=t?.springLength||100;r.isDragging||n.filter(a=>a.id!==r.id).forEach(a=>{const h=zt(r.x,r.y,a.x,a.y);r.animateSpringTo({x:a.x-Math.cos(h)*o,y:a.y-Math.sin(h)*o},t)})}else t?.spring?i>0&&r.animateSpringTo(n[i-1],t):r.animate(t);if(t?.wall&&r.checkWall(t),t?.enableCollision||t?.enableGravityBetweenObjects||t?.enableSpringMassAlpha)for(let o=i+1;o<s;o++)t?.enableCollision&&r.checkCollision(n[o]),t?.enableGravityBetweenObjects&&r.gravitateTo(n[o]),t?.enableSpringMassAlpha&&e.push([r.x,r.y,n[o].x,n[o].y,r.getSpringMassAlphaTo(n[o],t)])}return e}function Vl(n){if(n.length<2)throw new Error("shapes个数必须大于等于2");const t=n.length-1,e=new Array(t);for(let i=0;i<t;i++){const r=n[i].transformPathD(),o=n[i+1].transformPathD(),a=r.getPolymorphPoints(),h=o.getPolymorphPoints(),c=a.length>=h.length?a:h;e[i]=Et.getInterpolator(r.expendToPolymorphPoints(c),o.expendToPolymorphPoints(c))}const s=new K({initD:""});return i=>{const r=F(t*i,6),o=Math.min(Math.floor(r),t-1),a=F(r-o,6);return s.pathD(e[o](a)),s.setAttr(n[o+1].attrs),s}}function V1(n){if(n.length<2)throw new Error("shapeCombos个数必须大于等于2");let t;const e=[];n.forEach(o=>{let a;o instanceof Lt?(a=o,a.sort()):(a=new Lt,a.addShape(o)),e.push(a),(!t||t.shapes.length<a.shapes.length)&&(t=a)});const s=[];e.forEach((o,a)=>{o!==t&&o.expendTo(t),o.shapes.forEach((h,c)=>{s[c]=s[c]||[],s[c][a]=h})});const i=[];s.forEach(o=>{i.push(Vl(o))});const r=new Lt;return i.forEach(o=>{r.addShape(o(0))}),o=>(i.forEach(a=>{a(o)}),r)}function G1(n,t=6e3,e){const s=n.findIndex(a=>a instanceof Lt)>=0?V1(n):Vl(n),i=s(0),r=e?.onUpdate,o=new $s({frameDuration:t});return o.addTween({t:0},{t:1},Object.assign(e||{},{onUpdate:(a,h)=>{r?.(a,h),s(a.t),e?.shapeOrCombo?.(i,a.t)}})),o.play(),i}const an={1:705234,2:8108026,3:6346665,4:16630114,5:16607842,6:16158139,7:2542847,8:10640125,9:16735870,10:8978266,11:16580418,12:16754221,13:16725759,14:14436630,15:6844849,16:13744437,17:1817755,18:16744272,19:4964291,20:16750848,d:14540253,aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};class Yt{_color={r:0,g:0,b:0,a:1};constructor(t,e){t&&this.setColor(t),this.setAlpha(e)}get color(){return this._color}set color(t){const e=`Color: Unknown color(${t}) type(${typeof t})`;if(typeof t=="number")this.setHEX(t);else if(typeof t=="string"){let s;if(s=/^(\w+)\(([^)]*)\)/.exec(t)){const i=s[2];let r;switch(s[1]){case"rgb":case"rgba":(r=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(i))?(this.r=parseInt(r[1],10),this.g=parseInt(r[2],10),this.b=parseInt(r[3],10),this.a=r[4]?parseFloat(r[4]):1):(r=/^\s*(\d+)%\s*,\s*(\d+)%\s*,\s*(\d+)%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(i))?(this.r=N(parseFloat(r[1]),0,100)*255/100,this.g=N(parseFloat(r[2]),0,100)*255/100,this.b=N(parseFloat(r[3]),0,100)*255/100,this.a=r[4]?parseFloat(r[4]):1):console.warn(e);break;case"hsl":case"hsla":(r=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)%\s*,\s*(\d*\.?\d+)%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(i))?this.setHSL(parseFloat(r[1])/360,parseFloat(r[2])/100,parseFloat(r[3])/100,r[4]?parseFloat(r[4]):1):console.warn(e);break;case"hsv":case"hsva":case"hsb":case"hsba":(r=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)%\s*,\s*(\d*\.?\d+)%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(i))?this.setHSV(parseFloat(r[1])/360,parseFloat(r[2])/100,parseFloat(r[3])/100,r[4]?parseFloat(r[4]):1):console.warn(e);break;default:console.warn(e)}}else if(s=/#([A-Fa-f0-9]+)/.exec(t)){const i=s[1],r=i.length;r===3?this.setRGB(parseInt(i.charAt(0),16),parseInt(i.charAt(1),16),parseInt(i.charAt(2),16),1):r===6||r===8?this.setHEX(parseInt(i,16)):console.warn(e)}else if(t&&t.length>0)try{this.setColorName(t)}catch{console.warn(e)}else console.warn(e)}else t instanceof Yt?this.setRGB(t.r,t.g,t.b,t.a):Object.prototype.hasOwnProperty.call(t,"r")&&Object.prototype.hasOwnProperty.call(t,"g")&&Object.prototype.hasOwnProperty.call(t,"b")?this.setRGB(t.r,t.g,t.b,Object.prototype.hasOwnProperty.call(t,"a")?t.a:1):Object.prototype.hasOwnProperty.call(t,"h")&&Object.prototype.hasOwnProperty.call(t,"s")&&Object.prototype.hasOwnProperty.call(t,"l")?this.setHSL(t.h,t.s,t.l,Object.prototype.hasOwnProperty.call(t,"a")?t.a:1):Object.prototype.hasOwnProperty.call(t,"h")&&Object.prototype.hasOwnProperty.call(t,"s")&&Object.prototype.hasOwnProperty.call(t,"v")?this.setHSV(t.h,t.s,t.v,Object.prototype.hasOwnProperty.call(t,"a")?t.a:1):Object.prototype.hasOwnProperty.call(t,"h")&&Object.prototype.hasOwnProperty.call(t,"s")&&Object.prototype.hasOwnProperty.call(t,"b")?this.setHSV(t.h,t.s,t.b,Object.prototype.hasOwnProperty.call(t,"a")?t.a:1):console.warn(e)}setColor(t){return this.color=t,this}set(t){return this.setColor(t)}get r(){return this._color.r}set r(t){try{this._color.r=N(Math.round(jt(t)),0,255)}catch{}}get g(){return this._color.g}set g(t){try{this._color.g=N(Math.round(jt(t)),0,255)}catch{}}get b(){return this._color.b}set b(t){try{this._color.b=N(Math.round(jt(t)),0,255)}catch{}}get a(){return this._color.a}set a(t){try{this._color.a=N(jt(t),0,1)}catch{}}setAlpha(t){return this.a=t,this}setFromVector3(t){return this.r=t.x,this.g=t.y,this.b=t.z,this}applyMatrix3(t){const e=this.r,s=this.g,i=this.b,r=t.value;return this.r=r[0]*e+r[3]*s+r[6]*i,this.g=r[1]*e+r[4]*s+r[7]*i,this.b=r[2]*e+r[5]*s+r[8]*i,this}fromBufferAttribute(t,e){return this.r=t.getX(e),this.g=t.getY(e),this.b=t.getZ(e),this}fromArray(t,e=0){return this.r=t[e],this.g=t[e+1],this.b=t[e+2],this.a=t[e+3],this}toArray(t=[],e=0){return t[e]=this.r,t[e+1]=this.g,t[e+2]=this.b,t[e+3]=this.a,t}toRGBString(){return this.a===1?`rgb(${this.r},${this.g},${this.b})`:`rgba(${this.r},${this.g},${this.b},${F(this.a,6)})`}toHexString(){return this.a===1?("000000"+this.hex.toString(16)).slice(-6):("00000000"+this.hex.toString(16)).slice(-8)}toString(){return this.a===1?"#"+this.toHexString():this.toRGBString()}toColorSpaceString(t=Qe){Lo.fromWorkingColorSpace(xe.copy(this),t);const e=xe.r,s=xe.g,i=xe.b;return t!==Qe?`color(${t} ${e.toFixed(3)} ${s.toFixed(3)} ${i.toFixed(3)})`:this.toRGBString()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b,yield this.a}clone(){return new Yt(this.color)}copy(t){return this.setColor(t.color),this}copySRGBToLinear(t){return this.r=Ke(t.r),this.g=Ke(t.g),this.b=Ke(t.b),this}copyLinearToSRGB(t){return this.r=ts(t.r),this.g=ts(t.g),this.b=ts(t.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}equals(t){return t.r===this.r&&t.g===this.g&&t.b===this.b&&t.a===this.a}add(t){return this.r=this.r+t.r,this.g=this.g+t.g,this.b=this.b+t.b,this}addColors(t,e){return this.r=t.r+e.r,this.g=t.g+e.g,this.b=t.b+e.b,this}addScalar(t){return this.r=this.r+t,this.g=this.g+t,this.b=this.b+t,this}setScalar(t){return this.r=t,this.g=t,this.b=t,this}sub(t){return this.r=this.r-t.r,this.g=this.g-t.g,this.b=this.b-t.b,this}multiply(t){return this.r=this.r*t.r,this.g=this.g*t.g,this.b=this.b*t.b,this}multiplyScalar(t){return this.r=this.r*t,this.g=this.g*t,this.b=this.b*t,this}opposite(t=!0,e="#000000",s="#ffffff"){if(t)return this.setColor(this.r*.299+this.g*.587+this.b*.114>186?e:s);{const{r:i,g:r,b:o}=this.color;return this.r=255-i,this.g=255-r,this.b=255-o,this}}lighten(t){t=N(t,0,1);const{r:e,g:s,b:i}=this.color;return this.r=e+(255-e)*t,this.g=s+(255-s)*t,this.b=i+(255-i)*t,this}darken(t){t=N(t,0,1);const{r:e,g:s,b:i}=this.color;return this.r=e*(1-t),this.g=s*(1-t),this.b=i*(1-t),this}lerp(t,e){e=N(e,0,1);const{r:s,g:i,b:r}=this.color;return this.r=s+(t.r-s)*e,this.g=i+(t.g-i)*e,this.b=r+(t.b-r)*e,this}lerpColors(t,e,s){return s=N(s,0,1),this.r=t.r+(e.r-t.r)*s,this.g=t.g+(e.g-t.g)*s,this.b=t.b+(e.b-t.b)*s,this}static gradient(t,e,s){try{return xe.lerpColors(new Yt(t),new Yt(e),s).toString()}catch{return e}}static random(){return xe.setHEX(Math.random()*16777215).toString()}static nextIndex=0;static next(t=Yt.nextIndex){Yt.nextIndex=t;const e=Object.keys(an),s=e.length;return xe.setHEX(an[e[Yt.nextIndex++%s]]).toString()}setColorName(t){const e=an[t.toLowerCase()];return e!==void 0?this.setHEX(e):t==="none"?this.a=0:(this.a=1,console.warn("Color.setColorName: Unknown color "+t)),this}static getColors(){return Object.values(an).map(t=>xe.setHEX(t).toString())}setRGB(t,e,s,i=1){return this.r=t,this.g=e,this.b=s,this.a=i,this}get rgb(){return{r:this.r,g:this.g,b:this.b,a:this.a}}setHEX(t){return t=Math.floor(t),t<16777216?(this.r=t>>16&255,this.g=t>>8&255,this.b=t&255,this.a=1):(this.r=t>>24&255,this.g=t>>16&255,this.b=t>>8&255,this.a=(t&255)/255),this}get hex(){let t=(this.r<<16)+(this.g<<8)+this.b;return this.a!==1&&(t=t<<8,t+=Math.round(this.a*255)),t}setHSL(t,e,s,i=1){const r=ff(t,1),o=N(e,0,1),a=N(s,0,1);if(o===0)this.r=a*255,this.g=a*255,this.b=a*255;else{const h=a<=.5?a*(1+o):a+o-a*o,c=2*a-h;this.r=Ro(c,h,r+.3333333333333333)*255,this.g=Ro(c,h,r)*255,this.b=Ro(c,h,r-.3333333333333333)*255}return this.a=i,this}getHSL(t){const e=this.r,s=this.g,i=this.b,r=Math.max(e,s,i)/255,o=Math.min(e,s,i)/255;let a,h;const c=(o+r)/2;if(o===r)a=0,h=0;else{const l=r-o;switch(h=c<=.5?l/(r+o):l/(2-r-o),r){case e:a=(s-i)/l+(s<i?6:0);break;case s:a=(i-e)/l+2;break;case i:default:a=(e-s)/l+4;break}a/=6}return t&&t.setHSL(a,h,c,this.a),{h:a,s:h,l:c,a:this.a}}offsetHSL(t,e,s){const i=this.getHSL();return this.setHSL(i.h+t,i.s+e,i.l+s)}lerpHSL(t,e){const s=this.getHSL(),i=t.getHSL(),r=xn(s.h,i.h,e),o=xn(s.s,i.s,e),a=xn(s.l,i.l,e);return this.setHSL(r,o,a),this}setHSV(t,e,s,i=1){const r=N(t,0,1)*360,o=N(e,0,1),a=N(s,0,1),h=Math.floor(r/60)%6,c=r/60-Math.floor(r/60),l=a*(1-o),u=a*(1-c*o),m=a*(1-(1-c)*o),f=[[a,m,l],[u,a,l],[l,a,m],[l,u,a],[m,l,a],[a,l,u]][h];return this.r=f[0]*255,this.g=f[1]*255,this.b=f[2]*255,this.a=i,this}setHSB(t,e,s,i=1){this.setHSV(t,e,s,i)}getHSV(t){const{r:e,g:s,b:i,a:r}=this.color,o=Math.max(e,s,i),a=Math.min(e,s,i),h=o-a;let c;e===o?c=(s-i)/h:s===o?c=2+(i-e)/h:c=4+(e-s)/h,c/=6,c<0&&(c+=1);const l=h==0?0:c,u=o===0?0:h/o,m=o/255;return t&&t.setHSV(l,u,m,r),{h:l,s:u,v:m,a:r}}getHSB(t){const{h:e,s,v:i,a:r}=this.getHSV(t);return{h:e,s,b:i,a:r}}}const xe=new Yt,Gl="",Qe="srgb",ko="srgb-linear",Do="linear",ri="srgb";function Ke(n){return n<.04045?n*.0773993808:Math.pow(n*.9478672986+.0521327014,2.4)}function ts(n){return n<.0031308?n*12.92:1.055*Math.pow(n,.41666)-.055}const ql=new ps().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),jl=new ps().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715),Hl=[.64,.33,.3,.6,.15,.06],Wl=[.2126,.7152,.0722],Jl=[.3127,.329],Lo={enabled:!0,workingColorSpace:ko,spaces:{},convert:function(n,t,e){return this.enabled===!1||t===e||!t||!e||(this.spaces[t].transfer===ri&&(n.r=Ke(n.r),n.g=Ke(n.g),n.b=Ke(n.b)),this.spaces[t].primaries!==this.spaces[e].primaries&&(n.applyMatrix3(this.spaces[t].toXYZ),n.applyMatrix3(this.spaces[e].fromXYZ)),this.spaces[e].transfer===ri&&(n.r=ts(n.r),n.g=ts(n.g),n.b=ts(n.b))),n},fromWorkingColorSpace:function(n,t){return this.convert(n,this.workingColorSpace,t)},toWorkingColorSpace:function(n,t){return this.convert(n,t,this.workingColorSpace)},getPrimaries:function(n){return this.spaces[n].primaries},getTransfer:function(n){return n===Gl?Do:this.spaces[n].transfer},getLuminanceCoefficients:function(n,t=this.workingColorSpace){return n.fromArray(this.spaces[t].luminanceCoefficients)},define:function(n){Object.assign(this.spaces,n)},_getMatrix:function(n,t,e){return n.copy(this.spaces[t].toXYZ).multiply(this.spaces[e].fromXYZ)},_getDrawingBufferColorSpace:function(n){return this.spaces[n].outputColorSpaceConfig.drawingBufferColorSpace},_getUnpackColorSpace:function(n=this.workingColorSpace){return this.spaces[n].workingColorSpaceConfig.unpackColorSpace}};Lo.define({[ko]:{primaries:Hl,whitePoint:Jl,transfer:Do,toXYZ:ql,fromXYZ:jl,luminanceCoefficients:Wl,workingColorSpaceConfig:{unpackColorSpace:Qe},outputColorSpaceConfig:{drawingBufferColorSpace:Qe}},[Qe]:{primaries:Hl,whitePoint:Jl,transfer:ri,toXYZ:ql,fromXYZ:jl,luminanceCoefficients:Wl,outputColorSpaceConfig:{drawingBufferColorSpace:Qe}}});function Ro(n,t,e){return e<0&&(e+=1),e>1&&(e-=1),e<.16666666666666666?n+(t-n)*6*e:e<.5?t:e<.6666666666666666?n+(t-n)*6*(.6666666666666666-e):n}class q1{PARENT_EL;SVG_EL=null;CANVAS_EL=null;ctx=null;rect={x:0,y:0,width:0,height:0};size$=new Vh(null);resizeSubscription;mpg=Je();mouseSubscription;shapes=[];shapeTap$=new Vh(null);tapSubscription;lastMouseInShapeId="";draggingShapeId="";prevCursor="default";constructor(t=document.documentElement,e="canvas",s=!1){this.PARENT_EL=t,(e=="svg"||e=="canvas")&&el(this.PARENT_EL),e=="svg"&&(this.SVG_EL=Ze("svg"),bs(this.PARENT_EL,this.SVG_EL)),e=="canvas"&&(this.CANVAS_EL=rl("canvas"),bs(this.PARENT_EL,this.CANVAS_EL)),this.resizeSubscription=xo(this.PARENT_EL).subscribe(i=>{this.rect.x=i.x,this.rect.y=i.y,this.rect.width=i.width,this.rect.height=i.height,this.SVG_EL&&oe(this.SVG_EL,{viewBox:`0 0 ${this.rect.width} ${this.rect.height}`,width:`${this.rect.width}`,height:`${this.rect.height}`}),this.CANVAS_EL&&(oe(this.CANVAS_EL,{width:`${this.rect.width}`,height:`${this.rect.height}`}),this.ctx=new Io(this.CANVAS_EL,this.rect.width,this.rect.height,s)),this.size$.next(i)}),this.mouseSubscription=Cl(this.SVG_EL||this.CANVAS_EL||this.PARENT_EL,{useMousePoint:this.mpg}).subscribe(()=>{}),this.tapSubscription=ml(this.PARENT_EL).subscribe(i=>{for(const r of this.shapes)if(r.isMouseIn){this.shapeTap$.next(r);break}})}destroy(){this.resizeSubscription.unsubscribe(),this.mouseSubscription.unsubscribe(),this.tapSubscription.unsubscribe()}setCursor(t="default"){t!=this.prevCursor&&(this.PARENT_EL.style.cursor=t,this.prevCursor=t)}draw(...t){if(t.length){const e=[];t.forEach(s=>{s instanceof Lt?e.push(...s.shapes):e.push(s)}),this.SVG_EL&&this.shapes.filter(s=>e.findIndex(i=>i.id==s.id)==-1).forEach(s=>{s.el&&(s.el.remove(),delete s.el)}),hf(this.shapes,e)}this.ctx&&this.ctx.clearRect(),this.lastMouseInShapeId="",this.mpg.current.isDown||(this.draggingShapeId="");for(const e of this.shapes){const{x:s,y:i}=e.transformOrigin();let r=0,o=0;if(e.parent?.dDegree||e.parent?.dScaleX!==1||e.parent?.dScaleY!==1){const a=e.transformOrigin(!0);r=a.x,o=a.y}if(e.shouldUpdatePathD&&e.pathD(),this.SVG_EL){if(!e.el||e.shouldUpdateSVGElInDraw){const a=e.toSVGEl();e.el?a&&(e.el.remove(),e.el=a,bs(this.SVG_EL,e.el),oe(e.el,{id:e.id})):(e.el=a||zl(),bs(this.SVG_EL,e.el),oe(e.el,{id:e.id})),L1(e.el)&&oe(e.el,{d:e.toSVGPathD()}),e.shouldUpdateSVGElInDraw=!1,e.shouldUpdateAttrsInDraw=!0,e.shouldUpdateStyleInDraw=!0,e.shouldUpdateMInDraw=!0}if(e.shouldUpdateAttrsInDraw&&(Ta(e.attrs)||oe(e.el,e.attrs),e.shouldUpdateAttrsInDraw=!1),e.shouldUpdateStyleInDraw&&(Ta(e.style)||ys(e.el,e.style),e.shouldUpdateStyleInDraw=!1),e.shouldUpdateMInDraw||!e.m){const a=new wt;a.translate(e.x+(e.parent?.dX||0),e.y+(e.parent?.dY||0)),a.rotate(e.degree,s,i),a.scale(e.scaleX,e.scaleY,s,i),e.parent?.dDegree&&a.rotate(e.parent.dDegree,r,o),(e.parent?.dScaleX!==1||e.parent?.dScaleY!==1)&&a.scale(e.parent?.dScaleX||1,e.parent?.dScaleY||1,r,o),oe(e.el,{transform:a.toString()}),e.m=a,e.shouldUpdateMInDraw=!1}}if(this.ctx&&(this.ctx.save(),this.ctx.translate(e.x+(e.parent?.dX||0),e.y+(e.parent?.dY||0)),this.ctx.rotate(q(e.degree),s,i),this.ctx.scale(e.scaleX,e.scaleY,s,i),e.parent?.dDegree&&this.ctx.rotate(q(e.parent.dDegree),r,o),(e.parent?.dScaleX!==1||e.parent?.dScaleY!==1)&&this.ctx.scale(e.parent?.dScaleX||1,e.parent?.dScaleY||1,r,o),e.m=this.ctx.currentMatrix,Bc(this.ctx,e.attrs),e.toCanvasContext(this.ctx),this.ctx.hasSetCustomStrokeStyle&&this.ctx.stroke(),this.ctx.hasSetCustomFillStyle&&this.ctx.fill()),e.interactive?this.SVG_EL?e.isMouseIn=e.isPointInPath(this.SVG_EL,this.mpg.current.x,this.mpg.current.y)||e.isPointInStroke(this.SVG_EL,this.mpg.current.x,this.mpg.current.y):this.ctx?e.isMouseIn=e.isPointInPath(this.ctx,this.mpg.current.x,this.mpg.current.y)||e.isPointInStroke(this.ctx,this.mpg.current.x,this.mpg.current.y):e.isMouseIn=!1:e.isMouseIn=!1,e.isMouseIn&&(this.setCursor("pointer"),this.lastMouseInShapeId=e.id),e.isDragging=e.id==this.draggingShapeId,this.mpg.current.isDown&&(e.isDragging||!this.draggingShapeId&&e.isMouseIn&&e.drag&&e.drag.enable)){this.setCursor("grabbing"),e.isDragging=!0,this.draggingShapeId=e.id;let a=this.mpg.current.x-this.mpg.start.x,h=this.mpg.current.y-this.mpg.start.y;if(a||h){if(e.drag&&e.drag.enable&&e.drag.alongPath){const c=e.drag.alongPath.transform({m:e.m}).closestPoint(this.mpg.current.x,this.mpg.current.y);a=c.point.x-e.x,h=c.point.y-e.y}(a||h)&&(e.move(a,h),e.parent?.combo.shapes.forEach(c=>{c.drag?.followSibling&&c!==e&&c.move(a,h)}))}this.mpg.setStart(this.mpg.current)}else e.isMouseIn&&e.drag&&e.drag.enable&&this.setCursor("grab");this.ctx&&this.ctx.restore()}!this.lastMouseInShapeId&&!this.draggingShapeId&&this.setCursor("default")}clear(){this.shapes.forEach(t=>{t.el&&(t.el.remove(),delete t.el)}),this.shapes=[]}drawMouseMoveLine(t){const e=t?.brushSize||4,s=t?.brushColor||"#000000";let i=!1;const r=ei(this.SVG_EL||this.CANVAS_EL||this.PARENT_EL,{start:()=>{i=!1,this.ctx&&(this.ctx.save(),this.ctx.lineWidth=e,this.ctx.strokeStyle=s,this.ctx.beginPath())},end:()=>{this.ctx&&this.ctx.restore()}}).subscribe(o=>{this.ctx&&(i?this.ctx.lineTo(o.current.x,o.current.y):(i=!0,this.ctx.moveTo(o.current.x,o.current.y)),this.ctx.stroke())});return()=>{r.unsubscribe()}}drawMouseMoveBrush(t){const e=t?.brushSize||10,s=t?.brushDensity||50,i=t?.brushColor||"#000000",r=new Yt(i),o=r.r,a=r.g,h=r.b,c=ei(this.SVG_EL||this.CANVAS_EL||this.PARENT_EL).subscribe(l=>{if(this.ctx){const u=this.ctx.getImageData(0,0,this.ctx.canvas.width,this.ctx.canvas.height),m=u.data;for(let f=0;f<s;f++){const p=Math.random()*Math.PI*2,y=Math.random()*e,S=l.current.x+Math.cos(p)*y|0,w=l.current.y+Math.sin(p)*y|0,v=(S+w*u.width)*4;m[v]=o,m[v+1]=a,m[v+2]=h,m[v+3]=255}this.ctx.putImageData(u)}});return()=>{c.unsubscribe()}}downloadSVG=()=>{this.SVG_EL&&R1(this.SVG_EL)}}class es extends K{lineLength;startColor;endColor;constructor(t){super({...t,centerX:0,centerY:0}),this.lineLength=t?.lineLength||0,this.startColor=t?.startColor,this.endColor=t?.endColor,this.setAttr({strokeWidth:this.getAttr("strokeWidth")||"1",stroke:this.startColor||this.getAttr("stroke")||"#000000"})}cloneShape(){return new es({...super.getBaseOptions(),lineLength:this.lineLength,startColor:this.startColor,endColor:this.endColor})}lineToAbsolutePoint(t){const e=mt(zt(this.x,this.y,t.x,t.y)),s=Ae(this.x,this.y,t.x,t.y);(e!=this.degree||s!=this.lineLength)&&(e!=this.degree&&this.rotateTo(e),s!=this.lineLength&&(this.lineLength=s),this.shouldUpdatePathD=!0)}enableGradient(t,e){this.startColor=t,this.endColor=e,this.setAttr({stroke:this.startColor})}disableGradient(t){this.startColor=t,this.endColor=void 0,this.setAttr({stroke:this.startColor})}getBoundingClientRect(){return{x:0,y:0,width:this.lineLength,height:parseFloat(this.getAttr("strokeWidth"))}}toSVGPathData(){return[["m",0,0],["l",this.lineLength,0]]}toCanvasContext(t){this.startColor&&this.endColor&&this.setAttr({stroke:t.createLinearGradient(0,0,this.lineLength,0,{0:this.startColor,1:this.endColor})}),t.beginPath(),t.moveTo(0,0),t.lineTo(this.lineLength,0)}intersection(t){const e=this.transformPathD().normalizedLines[0],s=t.transformPathD().normalizedLines[0];return e.intersection(s)}}class Oo extends K{cx;cy;toX;toY;isLineThrough;constructor(t){super(t),this.cx=t?.cx||0,this.cy=t?.cy||0,this.toX=t?.toX||0,this.toY=t?.toY||0,this.isLineThrough=typeof t?.isLineThrough=="boolean"?t.isLineThrough:!1,this.setAttr({strokeWidth:this.getAttr("strokeWidth")||"1",stroke:this.getAttr("stroke")||"#000000"})}cloneShape(){return new Oo({...super.getBaseOptions(),cx:this.cx,cy:this.cy,toX:this.toX,toY:this.toY,isLineThrough:this.isLineThrough})}update(t){typeof t.cx=="number"&&(this.cx=t.cx,this.shouldUpdatePathD=!0),typeof t.cy=="number"&&(this.cy=t.cy,this.shouldUpdatePathD=!0),typeof t.toX=="number"&&(this.toX=t.toX,this.shouldUpdatePathD=!0),typeof t.toY=="number"&&(this.toY=t.toY,this.shouldUpdatePathD=!0),typeof t.isLineThrough=="boolean"&&(this.isLineThrough=t.isLineThrough,this.shouldUpdatePathD=!0)}toSVGPathData(){if(this.isLineThrough){const t=this.cx*2-(0+this.toX)/2,e=this.cy*2-(0+this.toY)/2;return[["m",0,0],["q",t,e,this.toX,this.toY]]}else return[["m",0,0],["q",this.cx,this.cy,this.toX,this.toY]]}toCanvasContext(t){if(t.beginPath(),t.moveTo(0,0),this.isLineThrough){const e=this.cx*2-(0+this.toX)/2,s=this.cy*2-(0+this.toY)/2;t.quadraticCurveTo(e,s,this.toX,this.toY)}else t.quadraticCurveTo(this.cx,this.cy,this.toX,this.toY)}}class oi extends K{points;isStraight;constructor(t){super(t),this.points=t?.points||[],this.isStraight=typeof t?.isStraight=="boolean"?t.isStraight:!0,this.setAttr({strokeWidth:this.getAttr("strokeWidth")||"1",stroke:this.getAttr("stroke")||"#000000"})}cloneShape(){return new oi({...super.getBaseOptions(),points:[...this.points],isStraight:this.isStraight})}update(t){"points"in t&&(this.points=[...t.points||this.points],this.shouldUpdatePathD=!0),typeof t.isStraight=="boolean"&&(this.isStraight=t.isStraight,this.shouldUpdatePathD=!0)}toSVGPathData(){const t=[];if(this.points.length<3)return t;const e=this.points.length;if(this.isStraight){t.push(["m",this.points[0].x,this.points[0].y]);for(let s=1;s<=e-1;s++)t.push(["l",this.points[s].x-this.points[s-1].x,this.points[s].y-this.points[s-1].y]);t.push(["z"])}else{const s=(this.points[0].x+this.points[e-1].x)/2,i=(this.points[0].y+this.points[e-1].y)/2;let r=s,o=i;t.push(["m",r,o]);for(let a=0;a<e-1;a++){const h=(this.points[a].x+this.points[a+1].x)/2,c=(this.points[a].y+this.points[a+1].y)/2;t.push(["q",this.points[a].x-r,this.points[a].y-o,h-r,c-o]),r=h,o=c}t.push(["q",this.points[e-1].x-r,this.points[e-1].y-o,s-r,i-o])}return t}toCanvasContext(t){if(this.points.length<3)return;t.beginPath();const e=this.points.length;if(this.isStraight){t.moveTo(this.points[0].x,this.points[0].y);for(let s=1;s<=e-1;s++)t.lineTo(this.points[s].x,this.points[s].y);t.closePath()}else{const s=(this.points[0].x+this.points[e-1].x)/2,i=(this.points[0].y+this.points[e-1].y)/2;t.moveTo(s,i);for(let r=0;r<e-1;r++){const o=(this.points[r].x+this.points[r+1].x)/2,a=(this.points[r].y+this.points[r+1].y)/2;t.quadraticCurveTo(this.points[r].x,this.points[r].y,o,a)}t.quadraticCurveTo(this.points[e-1].x,this.points[e-1].y,s,i)}}isPointInShape(t){const e=this.points.length;let s=!1;const i=2e-10;for(let r=0,o=e-1;r<e;o=r,r++){const a=this.points[r].x,h=this.points[r].y,c=this.points[o].x,l=this.points[o].y;if(a===t.x&&h===t.y||c===t.x&&l===t.y||t.y===h&&t.y===l)return!0;if(t.y>=h&&t.y<l||t.y<h&&t.y>=l){const u=(c-a)/(l-h),m=a+u*(t.y-h);if(m===t.x||Math.abs(m-t.x)<i)return!0;m>t.x&&(s=!s)}}return s}[Symbol.iterator](){let t=-1;return{next:()=>({value:t<=this.points.length-1?this.points[++t]:void 0,done:t>=this.points.length})}}static generate(t,e,s,i){const r=[];for(let o=0;o<i;o++){const a=o/i*2*Math.PI,{dx:h,dy:c}=Ie(a,s);r.push({x:t+h,y:e+c})}return new oi({points:r})}}class zo extends Lt{length=100;constructor(t){super(t);const e=new es({drag:{followSibling:!0},lineLength:this.length});this.addShape(e);const s=new es({drag:{followSibling:!0},lineLength:20+Math.random()*20});this.addShape(s,{dX:90-Math.random()*40,dDegree:Math.random()*70});const i=new es({drag:{followSibling:!0},lineLength:20+Math.random()*20});this.addShape(i,{dX:90-Math.random()*40,dDegree:-Math.random()*70}),this.comboRotate(-90,!0)}cloneShapeCombo(){return new zo(super.getBaseOptions())}}class vs extends K{ballRadius;constructor(t){super(t),this.ballRadius=t?.ballRadius||0}cloneShape(){return new vs({...super.getBaseOptions(),ballRadius:this.ballRadius})}update(t){typeof t.ballRadius=="number"&&(this.ballRadius=t.ballRadius,this.shouldUpdatePathD=!0)}getBoundingClientRect(){return{x:-this.ballRadius,y:-this.ballRadius,width:this.ballRadius*2,height:this.ballRadius*2}}toSVGEl(){const t=Ze("circle");return this.setAttr({cx:"0",cy:"0",r:String(this.ballRadius)}),t}toSVGPathData(){return this.ballRadius?[["m",0,-this.ballRadius],["a",this.ballRadius,this.ballRadius,0,1,1,0,2*this.ballRadius],["a",this.ballRadius,this.ballRadius,0,1,1,0,-2*this.ballRadius],["z"]]:[["m",0,0]]}toCanvasContext(t){t.beginPath(),t.arc(0,0,this.ballRadius,0,Math.PI*2,!0),t.closePath()}eq(t){return this.x===t.x&&this.y===t.y&&this.ballRadius===t.ballRadius&&this.mass===t.mass}midPointBtw(t){return{x:this.x+(t.x-this.x)/2,y:this.y+(t.y-this.y)/2}}length(){return ms(this.x,this.y)}scalar(t){return this.moveTo(this.x*t,this.y*t),this}normalize(t=1){const e=this.length();if(e){const s=t/e;this.scalar(s)}return this}clamp(t){const e=this.length();return e&&e>t&&this.scalar(t/e),this}cross(t){const e=this.x,s=this.y;return{x:s*t.x-e*t.y,y:e*t.y-s*t.x}}multiply(t){return{x:this.x*t.x,y:this.y*t.y}}div(t){return{x:this.x/t.x,y:this.y/t.y}}add(t){return{x:this.x+t.x,y:this.y+t.y}}sub(t){return{x:this.x-t.x,y:this.y-t.y}}dot(t){return this.x*t.x+this.y*t.y}reflect(t){const e=this.dot(t);return{x:this.x-2*e*t.x,y:this.y-2*e*t.y}}}class Bo extends K{constructor(t){super(t)}cloneShape(){return new Bo({...super.getBaseOptions()})}toSVGPathData(){return[["m",-50,-25],["l",50,0],["l",0,-25],["l",50,50],["l",-50,50],["l",0,-25],["l",-50,0],["l",0,-50],["z"]]}toCanvasContext(t){t.beginPath(),t.moveTo(-50,-25),t.lineTo(0,-25),t.lineTo(0,-50),t.lineTo(50,0),t.lineTo(0,50),t.lineTo(0,25),t.lineTo(-50,25),t.lineTo(-50,-25),t.closePath()}}class Oe extends K{rectWidth;rectHeight;rectBorderRadius;constructor(t){super(t),this.rectWidth=t.rectWidth||0,this.rectHeight=t.rectHeight||0,this.rectBorderRadius=t.rectBorderRadius||0}cloneShape(){return new Oe({...super.getBaseOptions(),rectWidth:this.rectWidth,rectHeight:this.rectHeight,rectBorderRadius:this.rectBorderRadius})}update(t){typeof t.rectWidth=="number"&&(this.rectWidth=t.rectWidth,this.shouldUpdatePathD=!0),typeof t.rectHeight=="number"&&(this.rectHeight=t.rectHeight,this.shouldUpdatePathD=!0),typeof t.rectBorderRadius=="number"&&(this.rectBorderRadius=t.rectBorderRadius,this.shouldUpdatePathD=!0)}getBoundingClientRect(){return{x:0,y:0,width:this.rectWidth,height:this.rectHeight}}toSVGEl(){const t=Ze("rect");return this.setAttr({x:"0",y:"0",width:String(this.rectWidth),height:String(this.rectHeight),rx:String(this.rectBorderRadius),ry:String(this.rectBorderRadius)}),t}toSVGPathData(){return this.rectBorderRadius?[["m",this.rectBorderRadius,0],["l",this.rectWidth-this.rectBorderRadius*2,0],["a",this.rectBorderRadius,this.rectBorderRadius,0,0,1,this.rectBorderRadius,this.rectBorderRadius],["l",0,this.rectHeight-this.rectBorderRadius*2],["a",this.rectBorderRadius,this.rectBorderRadius,0,0,1,-this.rectBorderRadius,this.rectBorderRadius],["l",this.rectBorderRadius*2-this.rectWidth,0],["a",this.rectBorderRadius,this.rectBorderRadius,0,0,1,-this.rectBorderRadius,-this.rectBorderRadius],["l",0,this.rectBorderRadius*2-this.rectHeight],["a",this.rectBorderRadius,this.rectBorderRadius,0,0,1,this.rectBorderRadius,-this.rectBorderRadius],["z"]]:[["m",0,0],["l",this.rectWidth,0],["l",0,this.rectHeight],["l",-this.rectWidth,0],["z"]]}toCanvasContext(t){t.beginPath(),this.rectBorderRadius<=0?t.rect(0,0,this.rectWidth,this.rectHeight):(t.moveTo(0,this.rectBorderRadius),t.lineTo(0,this.rectHeight-this.rectBorderRadius),t.quadraticCurveTo(0,this.rectHeight,this.rectBorderRadius,this.rectHeight),t.lineTo(this.rectWidth-this.rectBorderRadius,this.rectHeight),t.quadraticCurveTo(this.rectWidth,this.rectHeight,this.rectWidth,this.rectHeight-this.rectBorderRadius),t.lineTo(this.rectWidth,this.rectBorderRadius),t.quadraticCurveTo(this.rectWidth,0,this.rectWidth-this.rectBorderRadius,0),t.lineTo(this.rectBorderRadius,0),t.quadraticCurveTo(0,0,0,this.rectBorderRadius)),t.closePath()}static fromCubicBezier(t,e,s,i,r,o,a,h){const l=new xt({x:t,y:e,c1x:s,c1y:i,c2x:r,c2y:o,toX:a,toY:h}).getBoundingClientRect();return new Oe({x:l.x,y:l.y,rectWidth:l.width,rectHeight:l.height})}eq(t){return this.x===t.x&&this.y===t.y&&this.rectWidth===t.rectWidth&&this.rectHeight===t.rectHeight&&this.rectBorderRadius===t.rectBorderRadius}intersection(t){return!(this.x+this.rectWidth<t.x||t.x+t.rectWidth<this.x||this.y+this.rectHeight<t.y||t.y+t.rectHeight<this.y)}isPointInShape(t){return t.x>=this.x&&t.x<=this.x+this.rectWidth&&t.y>=this.y&&t.y<=this.y+this.rectHeight}}class No extends K{rx;ry;constructor(t){super(t),this.rx=t?.heartRx||10,this.ry=t?.heartRy||10}cloneShape(){return new No({...super.getBaseOptions(),heartRx:this.rx,heartRy:this.ry})}toSVGPathData(){return[["m",0,0],["l",this.rx*2.4,-this.ry*3.14],["a",this.rx/2,this.ry/2,0,0,0,-this.rx*2.4,-this.ry*1.5],["a",this.rx/2,this.ry/2,0,0,0,-this.rx*2.4,this.ry*1.5],["l",this.rx*2.4,this.ry*3.14],["z"]]}}class Fo extends K{rx;ry;constructor(t){super(t),this.rx=t?.heartRx||50,this.ry=t?.heartRy||50}cloneShape(){return new Fo({...super.getBaseOptions(),heartRx:this.rx,heartRy:this.ry})}toSVGPathData(){return[["m",0,0+this.ry*.3],["C",0,0,0-this.rx/2,0,0-this.rx/2,0+this.ry*.3],["C",0-this.rx/2,0+(this.ry+this.ry*.3)/2,0,0+(this.ry+this.ry*.3)/1.4,0,0+this.ry],["C",0,0+(this.ry+this.ry*.3)/1.8,0+this.rx/2,0+(this.ry+this.ry*.3)/2,0+this.rx/2,0+this.ry*.3],["C",0+this.rx/2,0,0,0,0,0+this.ry*.3],["z"]]}}class Yo extends K{r;constructor(t){super(t),this.r=t?.starR||20}cloneShape(){return new Yo({...super.getBaseOptions(),starR:this.r})}toSVGPathData(){const t=[["m",0,-this.r]];for(let e=0;e<6;e+=1){const s=288+e*144,i=this.r*Math.cos(q(s)),r=this.r*Math.sin(q(s));t.push(["l",i,r])}return t}}class Xo extends K{constructor(t){super(t)}cloneShape(){return new Xo({...super.getBaseOptions()})}toSVGPathData(){return[["m",4,24],["l",4,-8],["l",6,-6],["l",1,-10],["l",-6,-10],["l",-7,10],["l",-4,0],["l",-7,-10],["l",-6,10],["l",1,10],["l",6,6],["l",4,8],["z"]]}toCanvasContext(t){t.beginPath(),t.moveTo(4,24),t.lineTo(8,16),t.lineTo(14,10),t.lineTo(15,0),t.lineTo(9,-10),t.lineTo(2,0),t.lineTo(-2,0),t.lineTo(-9,-10),t.lineTo(-15,0),t.lineTo(-14,10),t.lineTo(-8,16),t.lineTo(-4,24),t.closePath()}}class Uo extends K{constructor(t){super(t)}cloneShape(){return new Uo({...super.getBaseOptions()})}toSVGPathData(){return[["M",0,0],["C",15,0,15,-40,5,-30],["L",0,0],["C",-15,0,-15,-40,-5,-30],["L",0,0],["a",15,15,0,1,1,0,30],["a",15,15,0,1,1,0,-30]]}}class $o extends K{constructor(t){super({...t,initD:"m5.068 9.267-3.08-.77a.512.512 0 0 1 0-.994l3.08-.77a2.289 2.289 0 0 0 1.665-1.665l.77-3.08a.512.512 0 0 1 .994 0l.77 3.08c.205.82.845 1.46 1.665 1.665l3.08.77a.512.512 0 0 1 0 .994l-3.08.77a2.29 2.29 0 0 0-1.665 1.665l-.77 3.08a.512.512 0 0 1-.994 0l-.77-3.08a2.289 2.289 0 0 0-1.665-1.665Z"})}cloneShape(){return new $o({...super.getBaseOptions()})}}class Vo extends K{rx;ry;constructor(t){super(t),this.rx=t?.rx||0,this.ry=t?.ry||0}cloneShape(){return new Vo({...super.getBaseOptions(),rx:this.rx,ry:this.ry})}getBoundingClientRect(){return{x:this.x-this.rx,y:this.y-this.ry,width:this.rx*2,height:this.ry*2}}toSVGEl(){const t=Ze("ellipse");return this.setAttr({cx:"0",cy:"0",rx:String(this.rx),ry:String(this.ry)}),t}toSVGPathData(){return[["m",0,-this.ry],["a",this.rx,this.ry,0,1,1,0,2*this.ry],["a",this.rx,this.ry,0,1,1,0,-2*this.ry],["z"]]}toCanvasContext(t){t.beginPath(),t.ellipse(0,0,this.rx,this.ry,0,0,2*Math.PI,!0),t.closePath()}}class Go extends Lt{showFlame;flame;ship;constructor(t){super(t),this.showFlame=typeof t?.showFlame=="boolean"?t?.showFlame:!0,this.flame=new K({initD:[["M",-15,0],["L",-2.5,-5],["L",-2.5,5],["Z"]],drag:{followSibling:!0}}),this.showFlame&&this.addShape(this.flame),this.ship=new K({initD:[["M",10,0],["L",-10,10],["L",-5,0],["L",-10,-10],["L",10,0],["Z"]],drag:{followSibling:!0}}),this.addShape(this.ship)}cloneShapeCombo(){return new Go({...super.getBaseOptions(),showFlame:this.showFlame})}update(t){typeof t?.showFlame=="boolean"&&(this.shapes=[],this.showFlame=t?.showFlame,this.showFlame&&this.addShape(this.flame),this.addShape(this.ship))}}class qo extends Lt{width;height;cornerRadius;constructor(t){super(t),this.width=t.segmentWidth,this.height=t.segmentHeight,this.cornerRadius=typeof t.segmentCornerRadius=="number"?t.segmentCornerRadius:this.height*.5;const e=new Oe({drag:{followSibling:!0},rectWidth:this.width+this.cornerRadius*2,rectHeight:this.height,rectBorderRadius:this.cornerRadius});this.addShape(e,{dX:0-this.cornerRadius,dY:0-this.height*.5});const s=new vs({drag:{followSibling:!0},ballRadius:2});this.addShape(s);const i=new vs({drag:{followSibling:!0},ballRadius:2});this.addShape(i,{dX:0+this.width})}cloneShapeCombo(){return new qo({...super.getBaseOptions(),segmentWidth:this.width,segmentHeight:this.height,segmentCornerRadius:this.cornerRadius})}getBoundingClientRectCenter(){return{x:0,y:0}}getPin(){const t=this.shapes[1];return{x:t.x+Math.cos(q(t.degree))*this.width,y:t.y+Math.sin(q(t.degree))*this.width}}}class jo extends Lt{options;value$=new ds;subscription;constructor(t){super(t),this.options=t;const e=t?.sliderMin||0,s=t?.sliderMax||100,i=t?.sliderStep||1,r=mf(e,s,i),o=r(typeof t?.sliderDefaultValue=="number"?N(t.sliderDefaultValue,e,s):e);this.value$.next(o);const a=o/(s-e),h=t?.sliderWidth||100,c=t?.sliderHeight||4,l=c*.5,u=c*2.5,m=t?.sliderBackgroundColor||"#f5f5f5",f=t?.sliderForegroundColor||"#5a82f0",p=new Oe({rectWidth:h,rectHeight:c,rectBorderRadius:l,attrs:{fill:m},drag:{enable:!1}});this.addShape(p);const y=new Oe({rectWidth:h*a,rectHeight:c,rectBorderRadius:l,attrs:{fill:f},drag:{enable:!1}});this.addShape(y);const S=new vs({x:h*a,y:l,ballRadius:u,attrs:{fill:f},drag:{enable:!0,alongPath:new Et([["m",0,0],["l",h,0]])}});this.addShape(S),this.subscription=S.transform$.subscribe(({dX:w})=>{console.log(w);const v=(S.x-p.x)/h;y.update({rectWidth:h*v}),this.value$.next(r(v*(s-e)+e))})}destroy(){super.destroy(),this.subscription.unsubscribe()}cloneShapeCombo(){return new jo({...super.getBaseOptions(),...this.options})}}class hn extends K{half;lineWidth;radius;startDegree;endDegree;percent=0;percentDegree=0;startColor;endColor;constructor(t){super(t),this.half=typeof t?.half=="boolean"?t?.half:!1,this.lineWidth=t.lineWidth;const e=t.width||0,s=t.height||0,i=(t.endDegree-t.startDegree-180)/2;if(t.radius)this.radius=t.radius;else if(this.half){const r=Math.min(e/2,s)-this.lineWidth;this.radius=Math.max(0,r-r*Math.sin(q(i)))}else this.radius=Math.max(0,Math.min(e/2,s/2)-this.lineWidth);t.x||(this.x=e/2),t.y||(this.half?this.y=s-this.lineWidth-this.radius*Math.sin(q(i)):this.y=s/2),t.forceCoordinate?(this.startDegree=t.startDegree,this.endDegree=t.endDegree):(this.startDegree=-90+t.startDegree,this.endDegree=-90+t.endDegree),this.startColor=t?.startColor,this.endColor=t?.endColor,this.setAttr({"stroke-linecap":"round","stroke-width":String(this.lineWidth),stroke:this.startColor||"#000000"}),this.setPercent(t.percent||1)}cloneShape(){return new hn({...super.getBaseOptions(),half:this.half,lineWidth:this.lineWidth,radius:this.radius,forceCoordinate:!0,startDegree:this.startDegree,endDegree:this.endDegree,startColor:this.startColor,endColor:this.endColor,percent:this.percent})}setPercent(t){this.percent=Math.max(0,t),this.percentDegree=this.startDegree+(this.endDegree-this.startDegree)*t}enableGradient(t,e){this.startColor=t,this.endColor=e,this.setAttr({stroke:this.startColor})}disableGradient(t){this.startColor=t,this.endColor=void 0,this.setAttr({stroke:this.startColor})}toSVGPathData(){const{dx:t,dy:e}=Ie(q(this.startDegree),this.radius),{dx:s,dy:i}=Ie(q(this.percentDegree),this.radius);return[["m",t,e],["a",this.radius,this.radius,0,Math.abs(this.percentDegree-this.startDegree)>=180?1:0,1,s-t,i-e]]}toCanvasContext(t){if(this.startColor&&this.endColor){let e;if(this.half){const s=this.radius-this.radius*Math.cos(Math.PI*this.percent),i=this.radius*Math.sin(Math.PI*this.percent);e=t.createLinearGradient(-this.radius,0,-this.radius+s,-i,{0:this.startColor,1:this.endColor})}else{const s=this.radius*Math.sin(2*Math.PI*this.percent),i=this.radius*Math.cos(2*Math.PI*this.percent);e=t.createLinearGradient(0,-this.radius,s,-i,{0:this.startColor,1:this.endColor})}this.setAttr({stroke:e})}t.beginPath(),t.arc(0,0,this.radius,q(this.startDegree),q(this.percentDegree),!1)}}class Ho extends Lt{half;lineWidth;width;height;bgColor;startColor;endColor;startDegree;endDegree;percent=0;ringBg;ring;lines=[];indicatorLineCount;constructor(t){if(super(t),this.half=typeof t?.half=="boolean"?t?.half:!1,this.lineWidth=t?.lineWidth||12,this.width=t.width,this.height=t.height,this.bgColor=t?.bgColor,this.startColor=t?.startColor,this.endColor=t?.endColor,this.half?(this.startDegree=t?.startDegree||-105,this.endDegree=t?.endDegree||105):(this.startDegree=t?.startDegree||0,this.endDegree=t?.endDegree||360),this.percent=t?.percent||0,this.ringBg=new hn({half:this.half,lineWidth:this.lineWidth,width:t.width,height:t.height,startDegree:this.startDegree,endDegree:this.endDegree,startColor:this.bgColor,percent:1}),this.addShape(this.ringBg),this.ring=new hn({half:this.half,lineWidth:this.lineWidth,width:t.width,height:t.height,startDegree:this.startDegree,endDegree:this.endDegree,startColor:this.startColor,endColor:this.endColor,percent:0}),this.addShape(this.ring),this.indicatorLineCount=23,this.half){const r=this.ringBg.radius-20-17;for(let o=0;o<this.indicatorLineCount;o++){const a=new es({lineLength:17,startColor:this.startColor,endColor:this.endColor,attrs:{"stroke-linecap":"round","stroke-width":String(2),stroke:this.bgColor}});this.lines.push(a);const h=-90+this.startDegree+(this.endDegree-this.startDegree)/(this.indicatorLineCount-1)*o;this.addShape(a,{dX:this.ringBg.x+Math.cos(q(h))*r,dY:this.ringBg.y+Math.sin(q(h))*r,dDegree:h})}}this.setPercent(t.percent||0)}cloneShapeCombo(){return new Ho({...super.getBaseOptions(),half:this.half,lineWidth:this.lineWidth,width:this.width,height:this.height,bgColor:this.bgColor,startColor:this.startColor,endColor:this.endColor,startDegree:this.startDegree,endDegree:this.endDegree,percent:this.percent})}setPercent(t){if(this.percent=Math.max(0,t),this.ring.setPercent(t),this.half)for(let e=0;e<this.indicatorLineCount;e++)e/(this.indicatorLineCount-1)<=this.percent?this.lines[e].enableGradient(this.startColor,this.endColor):this.lines[e].disableGradient(this.bgColor)}}class Ss extends K{text;width=0;height=0;constructor(t){super(t),this.text=t.text,this.setAttr({fontSize:"10px",fontFamily:'system-ui, Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", Roboto, Oxygen, Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif',emojiFontFamily:'"Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji", "EmojiOne Color", "Android Emoji", "Twemoji Mozilla", "system emoji", sans-serif',fill:"#666666",stroke:"none","alignment-baseline":"middle",textAnchor:"start",...this.attrs});const e=Di(this.getAttr("fontSize"),10).number,s=Di(this.getAttr("fontWeight"),400).number,i=Ss.measureText(this.text,e,s);this.width=i.width,this.height=i.height}cloneShape(){return new Ss({...super.getBaseOptions(),text:this.text})}toSVGEl(){const t=Ze("text");t.setAttribute("x","0"),t.setAttribute("y","0"),t.style.alignmentBaseline="middle";const e=this.text.split(`
29
+ `);if(e.length<=1)t.innerHTML=this.text;else{const s=this.getAttr("line-height","1.2em");e.forEach((i,r)=>{if(i.trim()){const o=Ze("tspan");o.setAttribute("x","0"),o.setAttribute("dy",r>0?s:"0"),o.innerHTML=i.trim(),o.style.alignmentBaseline="middle",t.append(o)}})}return t}toSVGPathData(){return[]}toCanvasContext(t){const e=this.text.split(`
30
+ `);if(e.length<=1)t.fillText(this.text,0,0);else{const s=t.measureText(this.text),r=(s.actualBoundingBoxAscent+s.actualBoundingBoxDescent)*parseFloat(this.getAttr("line-height","1.2em"));let o=0;e.forEach((a,h)=>{a.trim()&&(o+=h>0?r:0,t.fillText(a.trim(),0,o))})}}static measureText(t,e=12,s=400){const i=document.createElement("span");i.style.visibility="hidden",i.style.margin="0",i.style.padding="0",i.style.inset="0",i.style.whiteSpace="nowrap",i.style.overflow="visible",i.style.fontSize=e+"px",i.style.fontWeight=s.toString(),i.innerText=t,document.body.appendChild(i);const r=i.offsetWidth,o=i.offsetHeight;return document.body.removeChild(i),{width:r,height:o}}static getFixedWidthText(t,e,s=12,i=400,r="..."){let o="";if(!t||e<s)return o;const a=t.split("");let h=r?Ss.measureText(r,s,i).width:0;for(let c=0,l=a.length;c<l;c++)if(h+=Ss.measureText(a[c],s,i).width,h>e){r&&(o+=r);break}else o+=a[c];return o}}class Wo extends Lt{options;constructor(t){super(t),this.options=t;const{shapeCreator:e,width:s,height:i,x:r,y:o,particleCount:a,angle:h,spread:c,startVelocity:l,decay:u,gravity:m,drift:f,ticks:p,colors:y,scalar:S,flat:w}=Object.assign({shapeCreator:()=>new Oe({rectWidth:10,rectHeight:10}),width:100,height:100,x:.5,y:.6,particleCount:100,angle:90,spread:70,startVelocity:45,decay:.9,gravity:1,drift:0,ticks:200,colors:Yt.getColors(),scalar:1,flat:!1},t||{}),v=(C,D)=>{C.x=s*r,C.y=i*o,C.scaleX=S,C.scaleY=S;const B=y[D%y.length];C.setAttr({fill:B}),C.interactive=!1,C.wobble=Math.random()*10,C.wobbleSpeed=Math.min(.11,Math.random()*.1+.05),C.velocity=l*.5+Math.random()*l,C.angle2D=-x+(.5*b-Math.random()*b),C.tiltAngle=(Math.random()*(.75-.25)+.25)*Math.PI,C.tick=0,C.totalTicks=p,C.decay=u,C.drift=f,C.random=Math.random()+2,C.tiltSin=0,C.tiltCos=0,C.wobbleX=0,C.wobbleY=0,C.gravity=m*3,C.scalar=S,C.flat=w,C.color=new Yt(B)},x=q(h),b=q(c);let P=a;for(;P;){const C=e();v(C,P),C.clone=(D=>()=>{const B=e();return v(B,D),B})(P),this.addShape(C),P--}}cloneShapeCombo(){return new Wo(this.options)}update(){return this.shapes=this.shapes.filter(t=>{t.x+=Math.cos(t.angle2D)*t.velocity+t.drift,t.y+=Math.sin(t.angle2D)*t.velocity+t.gravity,t.velocity*=t.decay,t.flat?(t.wobble=0,t.wobbleX=t.x+10*t.scalar,t.wobbleY=t.y+10*t.scalar,t.tiltSin=0,t.tiltCos=0,t.random=1):(t.wobble+=t.wobbleSpeed,t.wobbleX=t.x+10*t.scalar*Math.cos(t.wobble),t.wobbleY=t.y+10*t.scalar*Math.sin(t.wobble),t.tiltAngle+=.1,t.tiltSin=Math.sin(t.tiltAngle),t.tiltCos=Math.cos(t.tiltAngle),t.random=Math.random()+2);const e=t.tick++/t.totalTicks,s=t.x+t.random*t.tiltCos,i=t.y+t.random*t.tiltSin,r=t.wobbleX+t.random*t.tiltCos,o=t.wobbleY+t.random*t.tiltSin;return t.setAttr("fill",t.color.setAlpha(1-e).toString()),t.degree=mt(Math.PI/10*t.wobble),t.scaleX=Math.abs(r-s)*.1,t.scaleY=Math.abs(o-i)*.1,t.tick<t.totalTicks}),this.shapes.length>0}}function Zl(n,t={attributes:!0,childList:!0,subtree:!0}){return new st(e=>{const s=new MutationObserver((i,r)=>{e.next(i)});return s.observe(n,t),()=>{s.disconnect()}})}function j1(n,t){return new Promise(e=>{new MutationObserver((i,r)=>{for(const o of i)o.type==="childList"&&o.addedNodes.forEach(a=>{a.isEqualNode(t)&&(r.disconnect(),e(!0))})}).observe(n,{childList:!0})})}function Ql(n,t={root:null}){return new st(e=>{const s=new IntersectionObserver((i,r)=>{if(i.length){const o=i[i.length-1];o&&e.next(o)}},t);return s.observe(n),()=>{s.unobserve(n),s.disconnect()}})}function H1(n,t){return Tl().pipe(Pe(null),ot(()=>{const{width:e,height:s}=t?.root?.getBoundingClientRect()||Pl(),{top:i,left:r,right:o,bottom:a}=n.getBoundingClientRect();return(i>=0&&i<=s||a>=0&&a<=s)&&(r>=0&&r<=e||o>=0&&o<=e)}),Te())}function W1(n,t){const e=typeof t?.threshold=="number"?t.threshold:.5;return Ql(n,{threshold:e,root:t?.root}).pipe(ot(s=>s.isIntersecting&&s.intersectionRatio>=e),Te())}let Kl=!1;function J1(){Kl||(Kl=!0,Oc(`
28
31
  :root {
29
32
  --sat:env(safe-area-inset-top, 0px);
30
33
  --sar:env(safe-area-inset-right, 0px);
@@ -37,27 +40,27 @@ var ZYZGroupCoreWeb=function(d){"use strict";const Pl={};function Ml(){return ty
37
40
  --sab:env(safe-area-inset-bottom, 0px);
38
41
  --sal:env(safe-area-inset-left, 0px);
39
42
  }
40
- `))}nw();function sw(){return fo(document.documentElement).pipe(mr(lr),rt(()=>{const s=getComputedStyle(document.documentElement);return{bottom:s.getPropertyValue("--sab"),top:s.getPropertyValue("--sat"),right:s.getPropertyValue("--sar"),left:s.getPropertyValue("--sal")}}))}function iw(s={enableHighAccuracy:!0,timeout:5e3,maximumAge:0}){return new et(t=>{if(!("geolocation"in navigator))return t.error("navigator.geolocation is not available.");let e;return new Promise((n,i)=>{navigator.geolocation.getCurrentPosition(r=>{t.next({longitude:r.coords.longitude,latitude:r.coords.latitude}),n()},r=>{i(r)})}).then(()=>{e=navigator.geolocation.watchPosition(n=>{t.next({longitude:n.coords.longitude,latitude:n.coords.latitude})},n=>{t.error(n)},s)}).catch(n=>{t.error(n)}),()=>{typeof e=="number"&&navigator.geolocation.clearWatch(e)}})}function ju(s="(prefers-color-scheme: dark)"){const t=window.matchMedia(s);return X(t,"change").pipe(rt(e=>e.matches),Te(t.matches),Ce())}function Hu(){return Vu(document).pipe(rt(()=>location),Te(location))}function rw(){return Hu().pipe(rt(s=>s.href),Te(location.href),Ce())}function ow(){return X(window,"hashchange").pipe(rt(s=>s.target.location.hash.replace("#","")),Te(window.location.hash.replace("#","")),Ce())}function aw(){return X(window,"popstate").pipe(rt(s=>s.state),Te(null),Ce())}function hw(s,t,e){if(typeof t=="string"&&(t=ma(t)),(typeof t=="string"||t===void 0)&&e===void 0){const n=Object.assign({},s.dataset);return Object.keys(n).forEach(i=>{if(n[i]?.startsWith("[")||n[i]?.startsWith("{"))try{n[i]=JSON.parse(n[i]||"")}catch{}}),typeof t=="string"?n[t]:n}else{let n={};typeof t=="object"?n=t:typeof t=="string"&&(n[t]=e),Object.entries(n).forEach(([i,r])=>{r?s.dataset[i]=r instanceof Object?JSON.stringify(r):r:delete s.dataset[i]})}}function cw(s,t){t.split(/[,\s]+/).forEach(e=>{e.trim()!=""&&delete s.dataset[e.trim()]})}function Uo(s,t){const e=typeof t?.aliveInSeconds=="number"?Math.max(t.aliveInSeconds,0):-1,n=typeof t?.aliveUntilTimestamp=="number"?Math.max(t.aliveUntilTimestamp,0):-1;function i(o,a=!1){return jl(o)||!Il(o,Cn)?{v:o,[Cn]:se()}:a?o:{...o,[Cn]:se()}}let r=i(s,!0);return{get:()=>{let o=r.v;return(e>=0&&se()>r[Cn]+e*1e3||n>=0&&se()>n)&&(o=void 0),{value:typeof o<"u"?r:void 0,rawValue:o}},set:o=>r=i(o)}}function Wu(s,t){const e=typeof s=="string"?s:s.toString();let n=t?.initValue;if(typeof n>"u")try{const a=window.localStorage.getItem(e);a&&(n=ua(a))}catch{}const{get:i,set:r}=Uo(n,{aliveInSeconds:t?.aliveInSeconds,aliveUntilTimestamp:t?.aliveUntilTimestamp}),o=Ni(i().value);return jt(()=>{if(typeof o.value<"u")try{window.localStorage.setItem(e,_i(o.value))}catch{}else window.localStorage.removeItem(e)}),{get:()=>{const a=i();return o.value=a.value,a.rawValue},set:a=>o.value=r(a)}}function uw(){window.localStorage.clear()}const{get:Ju,set:lw}=Wu(cs("theme")),Zu=new mn,fw=Zu.pipe(Te(void 0));function Qu(s){switch(lw(s),s){case"dark":document.documentElement.classList.add("dark"),wn(document.documentElement,"data-theme","dark");break;case"light":default:document.documentElement.classList.remove("dark"),wn(document.documentElement,"data-theme","light");break}return Zu.next(s),s}function dw(){return Qu(Ju()=="dark"?"light":"dark")}function mw(){return dp([fw,ju("(prefers-color-scheme: dark)")]).pipe(rt(([s,t])=>{if(s)return s;const e=Ju();return e||(t?"dark":"light")}))}function pw(s,t=""){return getComputedStyle(document.documentElement).getPropertyValue(s)||t}function gw(s,t){document.documentElement.style.setProperty(s,t)}function yw(s,t){const e=typeof s=="string"?s:s.toString();let n=t?.initValue;if(typeof n>"u")try{const a=window.sessionStorage.getItem(e);a&&(n=ua(a))}catch{}const{get:i,set:r}=Uo(n,{aliveInSeconds:t?.aliveInSeconds,aliveUntilTimestamp:t?.aliveUntilTimestamp}),o=Ni(i().value);return jt(()=>{if(typeof o.value<"u")try{window.sessionStorage.setItem(e,_i(o.value))}catch{}else window.sessionStorage.removeItem(e)}),{get:()=>{const a=i();return o.value=a.value,a.rawValue},set:a=>o.value=r(a)}}function ww(){window.sessionStorage.clear()}function xw(s,t){const e=Ni(t?.value||"");if(!e.value){const n=`; ${document.cookie}`.split(`; ${s}=`).pop()?.split(";").shift();n&&(e.value=decodeURIComponent(n))}return jt(()=>{if(e.value&&t?.days){const n="; expires="+new Date(Date.now()+t.days*864e5).toUTCString(),i=t?.domain?"; domain="+t?.domain:"",r=t?.path?"; path="+t?.path:"",o=t?.secure==!0?"; secure":"";document.cookie=s+"="+encodeURIComponent(e.value)+n+i+r+o}}),{get:()=>e.value,set:n=>e.value=n}}function bw(){const s=document.cookie.split("; ");for(let t=0;t<s.length;t++){const e=window.location.hostname.split(".");for(;e.length>0;){const n=encodeURIComponent(s[t].split(";")[0].split("=")[0])+"=; expires=Thu, 01-Jan-1970 00:00:01 GMT; domain="+e.join(".")+" ;path=",i=location.pathname.split("/");for(document.cookie=n+"/";i.length>0;)document.cookie=n+i.join("/"),i.pop();e.shift()}}}function vw(s,t){let e;return s.objectStoreNames.contains(t)||(e=s.createObjectStore(t,{keyPath:"id"})),e}function _w(s,t=1,e){return new Promise((n,i)=>{let r;const o=window.indexedDB.open(s,t);o.onerror=()=>{i("无法使用IndexDB!")},o.onsuccess=a=>{r=a.target.result,vw(r,e),n(r)}})}function Sw(s,t,e={id:1,name:"xxx"}){return new Promise((n,i)=>{const r=s.transaction([t],"readwrite");r.objectStore(t).add(e),r.oncomplete=a=>{n(a)},r.onerror=a=>{i(a)}})}const Vo=new cn;function Go(s,t){return Si({url:s,...t})}async function ti(s,t){if(typeof fetch>"u")throw new Error("fetch() not supported!");if(typeof AbortController>"u")throw new Error("AbortController not supported!");const e=Go(s,t),n=new AbortController;Vo.set(e,n);const{responseType:i,onProgress:r,timeout:o}={responseType:"json",timeout:6e4,...t},a=setTimeout(()=>{throw n.abort(),new Error(`${o} ms Timeout!`)},o);let h=await fetch(new Request(s,{...t,signal:n.signal}));if(Vo.delete(e),clearTimeout(a),h.status===200||h.status===0){if(h.status===0&&ds("useFetch: HTTP Status 0 received."),typeof ReadableStream<"u"&&h.body&&h.body.getReader&&r){const c=h.body.getReader(),u=h.headers.get("X-File-Size")||h.headers.get("Content-Length"),l=u?parseInt(u):0,m=l!==0;let f=0;const p=new ReadableStream({start(y){function v(){c.read().then(({done:w,value:_})=>{w?y.close():(f+=_.byteLength,r?.(new ProgressEvent("progress",{lengthComputable:m,loaded:f,total:l})),y.enqueue(_),v())}).catch(w=>{y.error(w)})}v()}});h=new Response(p)}switch(i){case"arraybuffer":return await h.arrayBuffer();case"blob":return await h.blob();case"json":return await h.json();case"text":default:return await h.text()}}else return Promise.reject(h)}function Cw(s,t){const e=Vo.get(Go(s,t));e&&e.abort()}function Tw(s=3,t){return Ei(ti,s,t)}function Ew(s=6e4){return Pi(ti,s)}function Pw(s=6e4,t=3,e){return Pi(Ei(ti,t,e),s)}const Mw={name:"zh-cn",weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"周日_周一_周二_周三_周四_周五_周六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),ordinal:(s,t)=>{switch(t){case"W":return`${s}周`;default:return`${s}日`}},weekStart:1,yearStart:4,formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日Ah点mm分",LLLL:"YYYY年M月D日ddddAh点mm分",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},relativeTime:{future:"%s内",past:"%s前",s:"几秒",m:"1 分钟",mm:"%d 分钟",h:"1 小时",hh:"%d 小时",d:"1 天",dd:"%d 天",M:"1 个月",MM:"%d 个月",y:"1 年",yy:"%d 年"},meridiem:(s,t)=>{const e=s*100+t;return e<600?"凌晨":e<900?"早上":e<1100?"上午":e<1300?"中午":e<1800?"下午":"晚上"}},Aw={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:s=>{const t=["th","st","nd","rd"],e=s%100;return`[${s}${t[(e-20)%10]||t[e]||t[0]}]`}},Re=new cn;let ei="zh-cn";qo(Aw),qo(Mw);function qo(s,t){if(!s)return Re.get(ei);let e;if(typeof s=="string"){const n=s.toLowerCase();if(Re.get(n))e=n;else if(t)Re.set(n,t),e=n;else return Re.get(ei)}else{const{name:n}=s;Re.set(n,s),e=n}return e&&(ei=e),Re.get(e)||Re.get(ei)}let kw=0;function tn(s,t={},e=[],n){return{name:String(++kw),tag:s,props:t,children:e,el:n}}function ni(s){return tn(s.tagName,Hr(s),Array.from(s.children).map(t=>ni(t)),s)}function vn(s,t=document.documentElement){if(s.el)return s.el;if(s.el=document.createElement(s.tag),s.props)for(const e in s.props){const n=s.props[e];e.startsWith("on")?s.el.addEventListener(e.slice(2).toLowerCase(),n):e==="style"?Vs(s.el,s.props[e]):wn(s.el,e,n)}return s.children&&(typeof s.children=="string"?s.el.appendChild(document.createTextNode(s.children)):s.children.forEach(e=>{vn(e,s.el)})),t.appendChild(s.el),s.el}function si(s,t){if(!s.el)return;if(s.tag!==t.tag){(s.el.parentElement||document.body).replaceChild(vn(t),s.el);return}const e=t.el=s.el,n=s.props,i=t.props;for(const a in n)a in i||(a.startsWith("on")?e.removeEventListener(a.slice(2).toLowerCase(),n[a]):e.removeAttribute(a));for(const a in i){const h=n[a],c=i[a];if(c!=h)if(a.startsWith("on")){const u=a.slice(2).toLowerCase();e.removeEventListener(u,h),e.addEventListener(u,c)}else if(a==="style"){for(const u in h)u in c||jr(e,u);Vs(e,c)}else wn(e,a,c)}const r=s.children||[],o=t.children||[];if(typeof o=="string")e.innerHTML=o;else if(typeof r=="string")e.innerHTML="",o.forEach(a=>{vn(a,e)});else{const a=Math.min(r.length,o.length);for(let h=0;h<a;h++)si(r[h],o[h]);o.length>r.length&&o.slice(r.length).forEach(h=>{vn(h,e)}),o.length<r.length&&r.slice(o.length).forEach(h=>{h.el&&e.removeChild(h.el)})}}class Iw{state;el;constructor(t,e){this.state=Ra(t,!0),this.el=e,this.compile(this.el)}compile(t){t.childNodes.forEach(e=>{switch(e.nodeType){case 1:const n=e;[...n.attributes].forEach(a=>{const h=a.name,c=a.value;if(h==="v-model")if(so(n)){const u=n;jt(()=>{u.checked=this.getStateValue(c)==u.value}),u.addEventListener("change",l=>{this.setStateValue(c,l.target.value)})}else if(no(n)){const u=n;jt(()=>{u.checked=wa(this.getStateValue(c),u.value)}),u.addEventListener("change",l=>{const m=l.target,f=m.value;m.checked?Kl(this.getStateValue(c),f):Ne(this.getStateValue(c),f)})}else if(eo(n)){const u=n;jt(()=>{u.value=this.getStateValue(c)}),u.addEventListener("change",l=>{this.setStateValue(c,l.target.value)})}else{const u=n;jt(()=>{u.value=this.getStateValue(c)});const l=m=>{this.setStateValue(c,m.target.value)};u.addEventListener("input",l)}else h==="v-text"?jt(()=>{n.innerText=this.getStateValue(c)}):h==="v-html"&&jt(()=>{n.innerHTML=this.getStateValue(c)})}),n.childNodes.length>0&&this.compile(n);break;case 3:const i=e.textContent||"",r=/\{\{\s*([^{}\s]+)\s*\}\}/g,o=r.exec(i);o&&o[1]&&jt(()=>{e.textContent=i.replace(r,this.getStateValue(o[1]))});break}})}getStateValue(t){let e=this.state;return t.split(".").forEach(n=>{e=e[n]}),e}setStateValue(t,e){let n=this.state;const i=t.split("."),r=i.length;for(let o=0;o<r-1;o++)n=n[i[o]];n[i[r-1]]=e}static compileTemplate(t){return t=t.replace(/<%=(.+?)%>/g,"`); \n echo( $1 ); \n echo(`").replace(/<%([\s\S]+?)%>/g,"`); \n $1 \n echo(`"),t="echo(`"+t+"`);",`(function parse(data){
43
+ `))}J1();function Z1(){return xo(document.documentElement).pipe(Cr(vr),ot(()=>{const n=getComputedStyle(document.documentElement);return{bottom:n.getPropertyValue("--sab"),top:n.getPropertyValue("--sat"),right:n.getPropertyValue("--sar"),left:n.getPropertyValue("--sal")}}))}function Q1(n={enableHighAccuracy:!0,timeout:5e3,maximumAge:0}){return new st(t=>{if(!("geolocation"in navigator))return t.error("navigator.geolocation is not available.");let e;return new Promise((s,i)=>{navigator.geolocation.getCurrentPosition(r=>{t.next({longitude:r.coords.longitude,latitude:r.coords.latitude}),s()},r=>{i(r)})}).then(()=>{e=navigator.geolocation.watchPosition(s=>{t.next({longitude:s.coords.longitude,latitude:s.coords.latitude})},s=>{t.error(s)},n)}).catch(s=>{t.error(s)}),()=>{typeof e=="number"&&navigator.geolocation.clearWatch(e)}})}function tu(n="(prefers-color-scheme: dark)"){const t=window.matchMedia(n);return $(t,"change").pipe(ot(e=>e.matches),Pe(t.matches),Te())}function eu(){return Zl(document).pipe(ot(()=>location),Pe(location))}function K1(){return eu().pipe(ot(n=>n.href),Pe(location.href),Te())}function tw(){return $(window,"hashchange").pipe(ot(n=>n.target.location.hash.replace("#","")),Pe(window.location.hash.replace("#","")),Te())}function ew(){return $(window,"popstate").pipe(ot(n=>n.state),Pe(null),Te())}function sw(n,t,e){if(typeof t=="string"&&(t=va(t)),(typeof t=="string"||t===void 0)&&e===void 0){const s=Object.assign({},n.dataset);return Object.keys(s).forEach(i=>{if(s[i]?.startsWith("[")||s[i]?.startsWith("{"))try{s[i]=JSON.parse(s[i]||"")}catch{}}),typeof t=="string"?s[t]:s}else{let s={};typeof t=="object"?s=t:typeof t=="string"&&(s[t]=e),Object.entries(s).forEach(([i,r])=>{r?n.dataset[i]=r instanceof Object?JSON.stringify(r):r:delete n.dataset[i]})}}function nw(n,t){t.split(/[,\s]+/).forEach(e=>{e.trim()!=""&&delete n.dataset[e.trim()]})}function su(n,t){const e=typeof n=="string"?n:n.toString();let s=t?.initValue;if(typeof s>"u")try{const a=window.localStorage.getItem(e);a&&(s=ya(a))}catch{}const{get:i,set:r}=Ma(s,{aliveInSeconds:t?.aliveInSeconds,aliveUntilTimestamp:t?.aliveUntilTimestamp}),o=ji(i());return Ht(()=>{if(typeof o.value<"u")try{window.localStorage.setItem(e,Mi(o.value))}catch{}else window.localStorage.removeItem(e)}),{get:()=>(o.value=i(),o.value.v),set:a=>o.value=r(a)}}function iw(){window.localStorage.clear()}const{get:nu,set:rw}=su(mn("theme")),iu=new ds,ow=iu.pipe(Pe(void 0));function ru(n){switch(rw(n),n){case"dark":document.documentElement.classList.add("dark"),ws(document.documentElement,"data-theme","dark");break;case"light":default:document.documentElement.classList.remove("dark"),ws(document.documentElement,"data-theme","light");break}return iu.next(n),n}function aw(){return ru(nu()=="dark"?"light":"dark")}function hw(){return Ep([ow,tu("(prefers-color-scheme: dark)")]).pipe(ot(([n,t])=>{if(n)return n;const e=nu();return e||(t?"dark":"light")}))}function cw(n,t=""){return getComputedStyle(document.documentElement).getPropertyValue(n)||t}function lw(n,t){document.documentElement.style.setProperty(n,t)}function uw(n,t){const e=typeof n=="string"?n:n.toString();let s=t?.initValue;if(typeof s>"u")try{const a=window.sessionStorage.getItem(e);a&&(s=ya(a))}catch{}const{get:i,set:r}=Ma(s,{aliveInSeconds:t?.aliveInSeconds,aliveUntilTimestamp:t?.aliveUntilTimestamp}),o=ji(i());return Ht(()=>{if(typeof o.value<"u")try{window.sessionStorage.setItem(e,Mi(o.value))}catch{}else window.sessionStorage.removeItem(e)}),{get:()=>(o.value=i(),o.value.v),set:a=>o.value=r(a)}}function fw(){window.sessionStorage.clear()}function dw(n,t){const e=ji(t?.value||"");if(!e.value){const s=`; ${document.cookie}`.split(`; ${n}=`).pop()?.split(";").shift();s&&(e.value=decodeURIComponent(s))}return Ht(()=>{if(e.value&&t?.days){const s="; expires="+new Date(Date.now()+t.days*864e5).toUTCString(),i=t?.domain?"; domain="+t?.domain:"",r=t?.path?"; path="+t?.path:"",o=t?.secure==!0?"; secure":"";document.cookie=n+"="+encodeURIComponent(e.value)+s+i+r+o}}),{get:()=>e.value,set:s=>e.value=s}}function mw(){const n=document.cookie.split("; ");for(let t=0;t<n.length;t++){const e=window.location.hostname.split(".");for(;e.length>0;){const s=encodeURIComponent(n[t].split(";")[0].split("=")[0])+"=; expires=Thu, 01-Jan-1970 00:00:01 GMT; domain="+e.join(".")+" ;path=",i=location.pathname.split("/");for(document.cookie=s+"/";i.length>0;)document.cookie=s+i.join("/"),i.pop();e.shift()}}}function pw(n,t){let e;return n.objectStoreNames.contains(t)||(e=n.createObjectStore(t,{keyPath:"id"})),e}function gw(n,t=1,e){return new Promise((s,i)=>{let r;const o=window.indexedDB.open(n,t);o.onerror=()=>{i("无法使用IndexDB!")},o.onsuccess=a=>{r=a.target.result,pw(r,e),s(r)}})}function yw(n,t,e={id:1,name:"xxx"}){return new Promise((s,i)=>{const r=n.transaction([t],"readwrite");r.objectStore(t).add(e),r.oncomplete=a=>{s(a)},r.onerror=a=>{i(a)}})}const Jo=new ks;function Zo(n,t){return Ai({url:n,...t})}async function ai(n,t){if(typeof fetch>"u")throw new Error("fetch() not supported!");if(typeof AbortController>"u")throw new Error("AbortController not supported!");const e=Zo(n,t),s=new AbortController;Jo.set(e,s);const{responseType:i,onProgress:r,timeout:o}={responseType:"json",timeout:6e4,...t},a=setTimeout(()=>{throw s.abort(),new Error(`${o} ms Timeout!`)},o);let h=await fetch(new Request(n,{...t,signal:s.signal}));if(Jo.delete(e),clearTimeout(a),h.status===200||h.status===0){if(h.status===0&&bn("useFetch: HTTP Status 0 received."),typeof ReadableStream<"u"&&h.body&&h.body.getReader&&r){const c=h.body.getReader(),l=h.headers.get("X-File-Size")||h.headers.get("Content-Length"),u=l?parseInt(l):0,m=u!==0;let f=0;const p=new ReadableStream({start(y){function S(){c.read().then(({done:w,value:v})=>{w?y.close():(f+=v.byteLength,r?.(new ProgressEvent("progress",{lengthComputable:m,loaded:f,total:u})),y.enqueue(v),S())}).catch(w=>{y.error(w)})}S()}});h=new Response(p)}switch(i){case"arraybuffer":return await h.arrayBuffer();case"blob":return await h.blob();case"json":return await h.json();case"text":default:return await h.text()}}else return Promise.reject(h)}function ww(n,t){const e=Jo.get(Zo(n,t));e&&e.abort()}function xw(n=3,t){return zi(ai,n,t)}function bw(n=6e4){return Bi(ai,n)}function vw(n=6e4,t=3,e){return Bi(zi(ai,t,e),n)}const Sw={name:"zh-cn",weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"周日_周一_周二_周三_周四_周五_周六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),ordinal:(n,t)=>{switch(t){case"W":return`${n}周`;default:return`${n}日`}},weekStart:1,yearStart:4,formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日Ah点mm分",LLLL:"YYYY年M月D日ddddAh点mm分",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},relativeTime:{future:"%s内",past:"%s前",s:"几秒",m:"1 分钟",mm:"%d 分钟",h:"1 小时",hh:"%d 小时",d:"1 天",dd:"%d 天",M:"1 个月",MM:"%d 个月",y:"1 年",yy:"%d 年"},meridiem:(n,t)=>{const e=n*100+t;return e<600?"凌晨":e<900?"早上":e<1100?"上午":e<1300?"中午":e<1800?"下午":"晚上"}},_w={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:n=>{const t=["th","st","nd","rd"],e=n%100;return`[${n}${t[(e-20)%10]||t[e]||t[0]}]`}},ze=new ks;let hi="zh-cn";Qo(_w),Qo(Sw);function Qo(n,t){if(!n)return ze.get(hi);let e;if(typeof n=="string"){const s=n.toLowerCase();if(ze.get(s))e=s;else if(t)ze.set(s,t),e=s;else return ze.get(hi)}else{const{name:s}=n;ze.set(s,n),e=s}return e&&(hi=e),ze.get(e)||ze.get(hi)}let Cw=0;function ss(n,t={},e=[],s){return{name:String(++Cw),tag:n,props:t,children:e,el:s}}function ci(n){return ss(n.tagName,so(n),Array.from(n.children).map(t=>ci(t)),n)}function _s(n,t=document.documentElement){if(n.el)return n.el;if(n.el=n.tag=="path"?zl():document.createElement(n.tag),n.props)for(const e in n.props){const s=n.props[e];e.startsWith("on")?n.el.addEventListener(e.slice(2).toLowerCase(),s):e==="style"?Zn(n.el,n.props[e]):ws(n.el,e,s)}return n.children&&(typeof n.children=="string"?n.el.appendChild(document.createTextNode(n.children)):n.children.forEach(e=>{_s(e,n.el)})),t.appendChild(n.el),n.el}function li(n,t){if(!n.el)return;if(n.tag!==t.tag){(n.el.parentElement||document.body).replaceChild(_s(t),n.el);return}const e=t.el=n.el,s=n.props,i=t.props;for(const a in s)a in i||(a.startsWith("on")?e.removeEventListener(a.slice(2).toLowerCase(),s[a]):e.removeAttribute(a));for(const a in i){const h=s[a],c=i[a];if(c!=h)if(a.startsWith("on")){const l=a.slice(2).toLowerCase();e.removeEventListener(l,h),e.addEventListener(l,c)}else if(a==="style"){for(const l in h)l in c||eo(e,l);Zn(e,c)}else ws(e,a,c)}const r=n.children||[],o=t.children||[];if(typeof o=="string")e.innerHTML=o;else if(typeof r=="string")e.innerHTML="",o.forEach(a=>{_s(a,e)});else{const a=Math.min(r.length,o.length);for(let h=0;h<a;h++)li(r[h],o[h]);o.length>r.length&&o.slice(r.length).forEach(h=>{_s(h,e)}),o.length<r.length&&r.slice(o.length).forEach(h=>{h.el&&e.removeChild(h.el)})}}class Tw{state;el;constructor(t,e){this.state=Ga(t,!0),this.el=e,this.compile(this.el)}compile(t){t.childNodes.forEach(e=>{switch(e.nodeType){case 1:const s=e;[...s.attributes].forEach(a=>{const h=a.name,c=a.value;if(h==="v-model")if(co(s)){const l=s;Ht(()=>{l.checked=this.getStateValue(c)==l.value}),l.addEventListener("change",u=>{this.setStateValue(c,u.target.value)})}else if(ho(s)){const l=s;Ht(()=>{l.checked=Ea(this.getStateValue(c),l.value)}),l.addEventListener("change",u=>{const m=u.target,f=m.value;m.checked?cf(this.getStateValue(c),f):ki(this.getStateValue(c),f)})}else if(ao(s)){const l=s;Ht(()=>{l.value=this.getStateValue(c)}),l.addEventListener("change",u=>{this.setStateValue(c,u.target.value)})}else{const l=s;Ht(()=>{l.value=this.getStateValue(c)});const u=m=>{this.setStateValue(c,m.target.value)};l.addEventListener("input",u)}else h==="v-text"?Ht(()=>{s.innerText=this.getStateValue(c)}):h==="v-html"&&Ht(()=>{s.innerHTML=this.getStateValue(c)})}),s.childNodes.length>0&&this.compile(s);break;case 3:const i=e.textContent||"",r=/\{\{\s*([^{}\s]+)\s*\}\}/g,o=r.exec(i);o&&o[1]&&Ht(()=>{e.textContent=i.replace(r,this.getStateValue(o[1]))});break}})}getStateValue(t){let e=this.state;return t.split(".").forEach(s=>{e=e[s]}),e}setStateValue(t,e){let s=this.state;const i=t.split("."),r=i.length;for(let o=0;o<r-1;o++)s=s[i[o]];s[i[r-1]]=e}static compileTemplate(t){return t=t.replace(/<%=(.+?)%>/g,"`); \n echo( $1 ); \n echo(`").replace(/<%([\s\S]+?)%>/g,"`); \n $1 \n echo(`"),t="echo(`"+t+"`);",`(function parse(data){
41
44
  let output = "";
42
45
  function echo(html){
43
46
  output += html;
44
47
  }
45
48
  ${t}
46
49
  return output;
47
- })`}}function Ku(s,t,e){return new WebSocket(s)}function Dw(s){return`${s}eventbus/${on(3,"number")}/${on(8)}/websocket`}class oe{static CONNECTING=WebSocket.CONNECTING;static OPEN=WebSocket.OPEN;static CLOSING=WebSocket.CLOSING;static CLOSED=WebSocket.CLOSED;url;socketCreatorProtocols;socketCreatorOptions;socketCreator;socket;state=oe.CONNECTING;messageQueue=[];pingInterval;pingTimerID;reconnect;reconnectAttempts=0;maxReconnectAttempts;reconnectTimerID;onopen;onclose;onerror;requestid=0;waitings={};listeners={};constructor(t="",e){this.url=t,this.socketCreatorProtocols=e?.socketCreatorProtocols,this.socketCreatorOptions=e?.socketCreatorOptions||{},this.socketCreator=e?.socketCreator||Ku,this.pingInterval=e?.pingInterval||5e3,this.onopen=e?.onopen,this.onclose=e?.onclose,this.onerror=e?.onerror,this.reconnect=typeof e?.reconnect=="boolean"?e.reconnect:!0,this.maxReconnectAttempts=typeof e?.maxReconnectAttempts=="number"?e.maxReconnectAttempts:1/0,this._connect()}open(){this.reconnectAttempts=0,this._connect()}close(){this.state=oe.CLOSING,this.socket?.close()}_connect(){this.socket?.readyState===oe.CONNECTING||this.socket?.readyState===oe.OPEN||(this.state=oe.CONNECTING,this.socket=this.socketCreator(this.url,this.socketCreatorProtocols,this.socketCreatorOptions),this.socket.onopen=()=>{ie(`ws(${this.url}) onopen`),this.state=oe.OPEN,this.reconnectTimerID&&(clearTimeout(this.reconnectTimerID),this.reconnectTimerID=void 0);const t=this.messageQueue.slice();this.messageQueue=[],t.forEach(this._send.bind(this)),this.ping(),this.pingTimerID=setInterval(this.ping.bind(this),this.pingInterval),this.onopen?.()},this.socket.onclose=t=>{const{code:e,reason:n,wasClean:i}=t;ie(`ws(${this.url}) onclose: code(${e}) reason(${n}) wasClean(${i})`),this.state=oe.CLOSED,this.pingTimerID&&(clearInterval(this.pingTimerID),this.pingTimerID=void 0),this.onclose?.(t),this.reconnect&&this.reconnectAttempts<this.maxReconnectAttempts&&(this.socket=void 0,this.reconnectTimerID=setTimeout(this._connect.bind(this),Ta(this.reconnectAttempts++)))},this.socket.onerror=t=>{ie(`ws(${this.url}) onerror: ${t}`),this.onerror?.(t)},this.socket.onmessage=t=>{if(ie(`ws(${this.url}) onmessage: { type: ${t.type}, data: ${t.data} }`),typeof t.data=="string"){let e;try{e=JSON.parse(t.data.substring(1))}catch(n){e=[JSON.stringify({type:"err",failureType:n.toString(),message:t.data})]}e.forEach(n=>{const i=JSON.parse(n);if(i.body&&Object.prototype.hasOwnProperty.call(i.body,"requestid")){const r=this.waitings[i.body.requestid];r?r.resolve?.(i.body):ds(`ws(${this.url}) onmessage: found no associated request, already timed out`)}else if(this.listeners[i.address]){const r=this.listeners[i.address];for(let o=0;o<r.length;o++)i.type==="err"?r[o]({failureCode:i.failureCode,failureType:i.failureType,message:i.message}):r[o](null,i.body)}else this.onunhandled(i)})}else t.data instanceof ArrayBuffer?ds(`ws(${this.url}) onmessage: unhandle ArrayBuffer`):t.data instanceof Blob&&ds(`ws(${this.url}) onmessage: unhandle Blob`)})}onunhandled(t){try{t.type==="err"?this.onerror?.(t):t.event?console.warn("No handler found for event: %o. Message: %O",t.event,t):console.warn("No handler found for message: ",t)}catch{}}_send(t){this.socket?.readyState===oe.OPEN?this.socket.send(JSON.stringify([JSON.stringify(t)])):(this.messageQueue.push(t),this._connect())}ping(){this._send({type:"ping"})}register(t,e,n={}){this.listeners[t]||(this.listeners[t]=[],this._send({type:"register",address:t,headers:En(n,this.socketCreatorOptions.headers)})),this.listeners[t].push(e)}unregister(t,e,n={}){const i=this.listeners[t];if(i){const r=i.indexOf(e);r!=-1&&(i.splice(r,1),i.length===0&&(this._send({type:"unregister",address:t,headers:En(n,this.socketCreatorOptions.headers)}),delete this.listeners[t]))}}publish(t,e,n={}){this._send({type:"publish",address:t,headers:En(n,this.socketCreatorOptions.headers),body:e})}async send(t,e,n={},i=3e4){this.requestid++;const r=this.waitings[this.requestid]={requestid:this.requestid},o=await new Promise((a,h)=>{r.resolve=a,this._send({type:"send",address:t,headers:En(n,this.socketCreatorOptions.headers),body:{requestid:r.requestid,...e}}),setTimeout(()=>{h(`ws(${this.url}) send(${r.requestid}: ${an(e)}) Timeout!`)},i)});return delete this.waitings[r.requestid],o}}function Lw(s){const t=document.documentElement,e=window.top===window.self?window.devicePixelRatio:1;t.dataset.dpr=e;let n=100;const i=function(){const r=Math.min(t.clientWidth,s);t.dataset.width=r,t.dataset.rem=n=Math.round(100*(r/s)),t.style.fontSize=n+"px"};i(),window.rem2px=function(r){return r=parseFloat(r),r*n},window.px2rem=function(r){return r=parseFloat(r),r/n},window.addEventListener&&window.addEventListener("orientationchange"in window?"orientationchange":"resize",i,!1)}function ii(s=window.location.href){try{return new URL(s)}catch{const e="(?<protocol>https?:)",n="(?<host>(?<hostname>[^/#?:]+)(?::(?<port>\\d+))?)",i="(?<pathname>(?:\\/[^/#?]+)*\\/?)",r="(?<search>(?:\\?[^#]*)?)",o="(?<hash>(?:#.*)?)",h=new RegExp(`^${e}//${n}${i}${r}${o}$`).exec(s);return{href:s,protocol:h?.groups?.protocol??"",host:h?.groups?.host??"",hostname:h?.groups?.hostname??"",port:h?.groups?.port??"",pathname:h?.groups?.pathname??"",search:h?.groups?.search??"",hash:h?.groups?.hash??""}}}function Rw(s){const t=ii(s);return t.protocol==="http:"||t.protocol==="https:"}function tl(s=window.location.href){const t=ii(s),e=t.href.indexOf(t.hash);return t.hash&&e>=0?t.href.substring(0,e):t.href}function Ow(s=ii().search){s=decodeURIComponent(s).replace(/^[#?&]/,"");const t={};if(!s)return t;const e=/(?:^|&)([^&=]*)=?([^&]*?)(?=&|$)/y;let n=e.exec(s);for(;n;)t[n[1]]=n[2],n=e.exec(s);return t}const zw=(s=window.location.href)=>JSON.parse('{"'+decodeURI(s.split("?")[1]).replace(/"/g,'\\"').replace(/&/g,'","').replace(/=/g,'":"')+'"}');function ri(s){return"?"+Object.entries(s).map(([t,e])=>`${encodeURIComponent(t)}=${encodeURIComponent(e)}`).join("&")}function el(s){return"?"+[...s.entries()].map(t=>encodeURIComponent(t[0])+"="+encodeURIComponent(t[1]instanceof File?t[1].name:t[1])).join("&")}function nl(s,t){return s.replace(/(?:\?.*)?$/,t.replace(/^[&?]/,"?"))}function Nw(s,t){return nl(s,ri(t))}function jo(s,t){return s+t.replace(/^[&?]/,s.indexOf("?")>=0?"&":"?")}function Bw(s,t){return jo(s,ri(t))}class Fw{worker;cbs={};constructor(t){if(Fc)try{this.worker=new Worker(URL.createObjectURL(new Blob([t])))}catch(e){throw typeof console!==void 0&&typeof console.warn=="function"&&console.warn("🎊 Could not load worker",e),e}else throw new Error("Your environment do not support Worker !")}postMessage(t,e=[]){this.worker.postMessage(t,e)}onmessage(t){this.worker.addEventListener("message",t)}offmessage(t){this.worker.removeEventListener("message",t)}onmessageerror(t){this.worker.addEventListener("messageerror",t)}offmessageerror(t){this.worker.removeEventListener("messageerror",t)}postCanvas(t){const e=t.transferControlToOffscreen();this.worker.postMessage({canvas:e},[e])}postPort(t){this.worker.postMessage({port:t},[t])}postReset(){this.worker.postMessage({reset:!0});for(const t in this.cbs)this.cbs[t](),delete this.cbs[t]}fire(t,e){return new Promise(n=>{if(e){const i=Math.random().toString(36).slice(2),r=o=>{o.data.id===i&&(this.worker.removeEventListener("message",r),delete this.cbs[i],e(),n())};this.cbs[i]=r.bind(this,{data:{id:i}}),this.worker.addEventListener("message",r),this.worker.postMessage({...t,id:i})}else this.worker.postMessage(t),n()})}}class Yw{port1;port2;port1MessageCbs=[];port2MessageCbs=[];port1MessageErrorCbs=[];port2MessageErrorCbs=[];constructor(){const{port1:t,port2:e}=new MessageChannel;this.port1=t,this.port2=e,this.port1.addEventListener("message",n=>{this.port1MessageCbs.forEach(i=>i(this.port1,n))}),this.port1.addEventListener("messageerror",n=>{this.port1MessageErrorCbs.forEach(i=>i(this.port1,n))}),this.port1.start(),this.port2.addEventListener("message",n=>{this.port2MessageCbs.forEach(i=>i(this.port2,n))}),this.port2.addEventListener("messageerror",n=>{this.port2MessageErrorCbs.forEach(i=>i(this.port2,n))}),this.port2.start()}close(){this.port1.close(),this.port2.close()}onPort1Message(t){this.port1MessageCbs.push(t)}onPort1MessageError(t){this.port1MessageErrorCbs.push(t)}offPort1Message(t){Ne(this.port1MessageCbs,t)}offPort1MessageError(t){Ne(this.port1MessageErrorCbs,t)}onPort2Message(t){this.port2MessageCbs.push(t)}onPort2MessageError(t){this.port2MessageErrorCbs.push(t)}offPort2Message(t){Ne(this.port2MessageCbs,t)}offPort2MessageError(t){Ne(this.port2MessageErrorCbs,t)}}function sl(){let s=null;if(window.ActiveXObject){const t=["Microsoft.XMLHTTP","MSXML6.XMLHTTP","MSXML5.XMLHTTP","MSXML4.XMLHTTP","MSXML3.XMLHTTP","MSXML2.XMLHTTP","MSXML.XMLHTTP"];for(let e=0,n=t.length;e<n;e++)try{s=new window.ActiveXObject(t[e]);break}catch{continue}}else s=new XMLHttpRequest;return s}function $w(s,t){return new Promise((e,n)=>{const{method:i="GET",data:r={},multipartFormDataString:o="",boundary:a="",headers:h={},withCredentials:c=!1,responseType:u="json",timeout:l=3e4}=t||{},m=sl();m.timeout=l,m.responseType=u,m.onreadystatechange=function(_){m.readyState===4&&(m.status===200?e(m.response):n(m.statusText))},m.ontimeout=()=>{n(`${s} is timed out for ${l}ms.`)},m.addEventListener("load",_=>t?.load?.(_,m),!1),m.addEventListener("loadstart",_=>t?.loadstart?.(_,m),!1),m.addEventListener("loadend",_=>t?.loadend?.(_,m),!1),m.addEventListener("progress",_=>{if(_.lengthComputable){const x=Math.round(_.loaded*100/_.total);t?.progress?.(_,m,x)}},!1),m.addEventListener("error",_=>t?.error?.(_,m),!1),m.addEventListener("abort",_=>t?.abort?.(_,m),!1);const f=i.toUpperCase();Object.assign(h,{Accept:"*/*"});let p=!1,y=!1,v=!1;function w(){c&&(m.withCredentials=!0);for(const _ in h)xt(_).toLowerCase()=="content-type"&&h[_].toLowerCase()=="multipart/form-data"?(p=!0,m.setRequestHeader("Content-Type","multipart/form-data; boundary="+a)):(xt(_).toLowerCase()=="content-type"&&(h[_].toLowerCase().indexOf("text/plain")>=0?y=!0:h[_].toLowerCase().indexOf("application/json")>=0&&(v=!0)),m.setRequestHeader(_,h[_]))}switch(f){case"GET":let _="";r instanceof FormData?_=el(r):_=ri(r),m.open("GET",jo(s,_),!0),w(),m.send(null);break;default:m.open(f,s,!0),w(),p?m.sendAsBinary(o):v?m.send(JSON.stringify(r)):y?m.send(Object.entries(r).map(([x,b])=>`${x}=${b}`).join(`\r
48
- `)):m.send(Object.entries(r).map(([x,b])=>`${encodeURIComponent(x)}=${encodeURIComponent(b)}`).join("&"));break}})}async function Xw(s){const t={url:s.action||"",data:{},contentType:s.method.toLowerCase()==="post"&&s.enctype?s.enctype:"application/x-www-form-urlencoded",multipartFormDataString:"",boundary:"---------------------------"+Date.now().toString(16)},e=[],n=t.contentType=="multipart/form-data";for(let i=0;i<s.elements.length;i++){const r=s.elements[i];if(!r.hasAttribute("name"))continue;const o=r.getAttribute("type");switch(r.nodeName.toUpperCase()==="INPUT"&&o?o.toUpperCase():""){case"FILE":const h=r;if(n)for(let l=0,m=h.files?.length||0;l<m;l++){const f=h.files?.[l];if(f){const p=await Dn(f,$t.binaryString);e.push('Content-Disposition: form-data; name="'+h.name+'"; filename="'+f.name+`"\r
50
+ })`}}function ou(n,t,e){return new WebSocket(n)}function Pw(n){return`${n}eventbus/${Ms(3,"number")}/${Ms(8)}/websocket`}class ae{static CONNECTING=WebSocket.CONNECTING;static OPEN=WebSocket.OPEN;static CLOSING=WebSocket.CLOSING;static CLOSED=WebSocket.CLOSED;url;socketCreatorProtocols;socketCreatorOptions;socketCreator;socket;state=ae.CONNECTING;messageQueue=[];pingInterval;pingTimerID;reconnect;reconnectAttempts=0;maxReconnectAttempts;reconnectTimerID;onopen;onclose;onerror;requestid=0;waitings={};listeners={};constructor(t="",e){this.url=t,this.socketCreatorProtocols=e?.socketCreatorProtocols,this.socketCreatorOptions=e?.socketCreatorOptions||{},this.socketCreator=e?.socketCreator||ou,this.pingInterval=e?.pingInterval||5e3,this.onopen=e?.onopen,this.onclose=e?.onclose,this.onerror=e?.onerror,this.reconnect=typeof e?.reconnect=="boolean"?e.reconnect:!0,this.maxReconnectAttempts=typeof e?.maxReconnectAttempts=="number"?e.maxReconnectAttempts:1/0,this._connect()}open(){this.reconnectAttempts=0,this._connect()}close(){this.state=ae.CLOSING,this.socket?.close()}_connect(){this.socket?.readyState===ae.CONNECTING||this.socket?.readyState===ae.OPEN||(this.state=ae.CONNECTING,this.socket=this.socketCreator(this.url,this.socketCreatorProtocols,this.socketCreatorOptions),this.socket.onopen=()=>{ie(`(${this.url}) onopen`),this.state=ae.OPEN,this.reconnectTimerID&&(clearTimeout(this.reconnectTimerID),this.reconnectTimerID=void 0);const t=this.messageQueue.slice();this.messageQueue=[],t.forEach(this._send.bind(this)),this.ping(),this.pingTimerID=setInterval(this.ping.bind(this),this.pingInterval),this.onopen?.()},this.socket.onclose=t=>{const{code:e,reason:s,wasClean:i}=t;ie(`(${this.url}) onclose: code(${e}) reason(${s}) wasClean(${i})`),this.state=ae.CLOSED,this.socket=void 0,this.pingTimerID&&(clearInterval(this.pingTimerID),this.pingTimerID=void 0),this.onclose?.(t),this.reconnect&&this.reconnectAttempts<this.maxReconnectAttempts&&(this.reconnectTimerID=setTimeout(this._connect.bind(this),za(this.reconnectAttempts++)))},this.socket.onerror=t=>{ie(`(${this.url}) onerror: ${t}`),this.onerror?.(t)},this.socket.onmessage=t=>{if(ie(`(${this.url}) onmessage: { type: ${t.type}, data: ${t.data} }`),typeof t.data=="string"){let e;const s=t.data.substring(1);try{e=JSON.parse(s)}catch(i){e=[JSON.stringify({type:"err",failureCode:"fe-json-parse-error",failureType:i.toString(),message:s})]}e.forEach(i=>{const r=JSON.parse(i);if(r.body&&Object.prototype.hasOwnProperty.call(r.body,"requestid")){const o=this.waitings[r.body.requestid];o?o.resolve?.(r.body):bn(`(${this.url}) onmessage: found no associated request, already timed out`)}else if(this.listeners[r.address]){const o=this.listeners[r.address];for(let a=0;a<o.length;a++)r.type==="err"?o[a]({failureCode:r.failureCode,failureType:r.failureType,message:r.message}):o[a](null,r.body)}else this.onunhandled(r)})}else t.data instanceof ArrayBuffer?bn(`(${this.url}) onmessage: unhandle ArrayBuffer`):t.data instanceof Blob&&bn(`(${this.url}) onmessage: unhandle Blob`)})}onunhandled(t){try{t.type==="err"?this.onerror?.(t):t.event?console.warn("No handler found for event: %o. Message: %O",t.event,t):console.warn("No handler found for message: ",t)}catch{}}_send(t){this.socket?.readyState===ae.OPEN?this.socket.send(JSON.stringify([JSON.stringify(t)])):(this.messageQueue.push(t),this._connect())}ping(){this._send({type:"ping"})}register(t,e,s={}){this.listeners[t]||(this.listeners[t]=[],this._send({type:"register",address:t,headers:as(s,this.socketCreatorOptions.headers)})),this.listeners[t].push(e)}unregister(t,e,s={}){const i=this.listeners[t];if(i){const r=i.indexOf(e);r!=-1&&(i.splice(r,1),i.length===0&&(this._send({type:"unregister",address:t,headers:as(s,this.socketCreatorOptions.headers)}),delete this.listeners[t]))}}publish(t,e,s={}){this._send({type:"publish",address:t,headers:as(s,this.socketCreatorOptions.headers),body:e})}async send(t,e,s={},i=3e4){this.requestid++;const r=this.waitings[this.requestid]={requestid:this.requestid},o=await new Promise((a,h)=>{r.resolve=a,this._send({type:"send",address:t,headers:as(s,this.socketCreatorOptions.headers),body:{requestid:r.requestid,...e}}),setTimeout(()=>{h(`(${this.url}) send(${r.requestid}: ${Ye(e)}) Timeout!`)},i)});return delete this.waitings[r.requestid],o}}const ui=()=>{const n=navigator.userAgent.toLowerCase();let t="Unknown";return/iphone|ipad|ipod/i.test(n)?t="iOS":/android/i.test(n)?t="Android":/BlackBerry/i.test(n)?t="BlackBerry":/mac/i.test(n)?t="macOS":/win/i.test(n)?t="Windows":/linux/i.test(n)?t="Linux":/bsd/i.test(n)&&(t="BSD"),t.toLowerCase()};function Ew(n=navigator.userAgent){let t="Unknown";if(/iPhone|iPad|iPod/i.test(n)){const e=n.match(/OS (\d+_\d+)/i);e&&(t=e[1].replace("_","."))}else if(/Android/i.test(n)){const e=n.match(/Android (\d+\.\d+)/i);e&&(t=e[1])}else if(/Mac OS X/i.test(n)){const e=n.match(/Mac OS X (\d+_\d+)/i);e&&(t=e[1].replace("_","."))}else if(/Windows NT/i.test(n)){const e=n.match(/Windows NT (\d+\.\d+)/i);e&&(t=e[1])}return t.toLowerCase()}function Ko(){const n=navigator.userAgent.toLowerCase();let t="Unknown";return/opr/i.test(n)||/opera/i.test(n)?t="Opera":/chrome/i.test(n)?t="Chrome":/firefox/i.test(n)?t="Firefox":/safari/i.test(n)?t="Safari":/edge/i.test(n)?t="Edge":/msie|trident/i.test(n)?t="IE":/MicroMessenger/i.test(n)?t="Wechat":/alipay/i.test(n)&&(t="Ali"),t.toLowerCase()}const Mw=()=>{const n=navigator.userAgent;let t="Unknown";if(/Chrome/.test(n)){const e=n.match(/Chrome\/(\d+\.\d+)/);e&&(t=e[1])}else if(/Firefox/.test(n)){const e=n.match(/Firefox\/(\d+\.\d+)/);e&&(t=e[1])}else if(/Safari/.test(n)){const e=n.match(/Version\/(\d+\.\d+)/);e&&(t=e[1])}else if(/Edge/.test(n)){const e=n.match(/Edge\/(\d+\.\d+)/);e&&(t=e[1])}else if(/MSIE|Trident/.test(n)){const e=n.match(/(?:MSIE|rv:)(\d+\.\d+)/);e&&(t=e[1])}return t};function Aw(){return(navigator.browserLanguage||navigator.language).toLowerCase()}function Iw(){return Intl.DateTimeFormat().resolvedOptions().timeZone.toLowerCase()}function ta(){return ui()==="ios"}function au(){return ui()==="macos"}function kw(){return ta()|au()}function hu(){return ui()==="android"}function Dw(){return ta()||hu()}function cu(){const n=window.navigator.userAgent,t=n.indexOf("MSIE ");if(t>0)return parseInt(n.substring(t+5,n.indexOf(".",t)),10);if(n.indexOf("Trident/")>0){const i=n.indexOf("rv:");return parseInt(n.substring(i+3,n.indexOf(".",i)),10)}const s=n.indexOf("Edge/");return s>0?parseInt(n.substring(s+5,n.indexOf(".",s)),10):-1}const Lw=cu()!==-1,Rw=document.documentMode?document.documentMode===9:!1,Ow=document.documentMode?document.documentMode===10:!1,zw=document.documentMode?document.documentMode===11:!1;function lu(){return Ko()==="wechat"}function uu(){return Ko()==="ali"}function Bw(){return lu()&&navigator.userAgent.match(/miniprogram/i)||window.__wxjs_environment==="miniprogram"}function Nw(){return uu()&&navigator.userAgent.match(/miniprogram/i)}const Fw=bf&&window.File&&window.FileReader&&window.FileList&&window.Blob,Yw=typeof Path2D=="function"&&typeof DOMMatrix=="function",Xw=typeof HTMLElement=="object"?function(t){return t instanceof HTMLElement}:function(t){return t&&typeof t=="object"&&t.nodeType===1&&typeof t.nodeName=="string"},Uw="webkit moz ms o".split(" ");function $w(){return"ontouchstart"in window||"ontouchend"in document||navigator.maxTouchPoints>0}function Vw(n=750){const t=document.documentElement,e=window.top===window.self?window.devicePixelRatio:1;t.dataset.dpr=e;let s=100;const i=function(){t.style.height=window.innerHeight+"px";const r=t.clientWidth;t.dataset.width=r,t.dataset.layout=r>n?"pc":"mobile",t.dataset.rem=s=Math.min(100,Math.round(100*(r/n))),t.style.fontSize=s+"px"};i(),window.rem2px=function(r){return parseFloat(r)*s},window.px2rem=function(r){return parseFloat(r)/s},window.addEventListener&&window.addEventListener("orientationchange"in window?"orientationchange":"resize",i,!1)}function fu(){let n=null;if(window.ActiveXObject){const t=["Microsoft.XMLHTTP","MSXML6.XMLHTTP","MSXML5.XMLHTTP","MSXML4.XMLHTTP","MSXML3.XMLHTTP","MSXML2.XMLHTTP","MSXML.XMLHTTP"];for(let e=0,s=t.length;e<s;e++)try{n=new window.ActiveXObject(t[e]);break}catch{continue}}else n=new XMLHttpRequest;return n}function Gw(n,t){return new Promise((e,s)=>{const{method:i="GET",data:r={},multipartFormDataString:o="",boundary:a="",headers:h={},withCredentials:c=!1,responseType:l="json",timeout:u=3e4}=t||{},m=fu();m.timeout=u,m.responseType=l,m.onreadystatechange=function(v){m.readyState===4&&(m.status===200?e(m.response):s(m.statusText))},m.ontimeout=()=>{s(`${n} is timed out for ${u}ms.`)},m.addEventListener("load",v=>t?.load?.(v,m),!1),m.addEventListener("loadstart",v=>t?.loadstart?.(v,m),!1),m.addEventListener("loadend",v=>t?.loadend?.(v,m),!1),m.addEventListener("progress",v=>{if(v.lengthComputable){const x=Math.round(v.loaded*100/v.total);t?.progress?.(v,m,x)}},!1),m.addEventListener("error",v=>t?.error?.(v,m),!1),m.addEventListener("abort",v=>t?.abort?.(v,m),!1);const f=i.toUpperCase();Object.assign(h,{Accept:"*/*"});let p=!1,y=!1,S=!1;function w(){c&&(m.withCredentials=!0);for(const v in h)lt(v).toLowerCase()=="content-type"&&h[v].toLowerCase()=="multipart/form-data"?(p=!0,m.setRequestHeader("Content-Type","multipart/form-data; boundary="+a)):(lt(v).toLowerCase()=="content-type"&&(h[v].toLowerCase().indexOf("text/plain")>=0?y=!0:h[v].toLowerCase().indexOf("application/json")>=0&&(S=!0)),m.setRequestHeader(v,h[v]))}switch(f){case"GET":let v="";r instanceof FormData?v=Kf(r):v=Qf(r),m.open("GET",Zf(n,v),!0),w(),m.send(null);break;default:m.open(f,n,!0),w(),p?m.sendAsBinary(o):S?m.send(JSON.stringify(r)):y?m.send(Object.entries(r).map(([x,b])=>`${x}=${b}`).join(`\r
51
+ `)):m.send(Object.entries(r).map(([x,b])=>`${encodeURIComponent(x)}=${encodeURIComponent(b)}`).join("&"));break}})}async function qw(n){const t={url:n.action||"",data:{},contentType:n.method.toLowerCase()==="post"&&n.enctype?n.enctype:"application/x-www-form-urlencoded",multipartFormDataString:"",boundary:"---------------------------"+Date.now().toString(16)},e=[],s=t.contentType=="multipart/form-data";for(let i=0;i<n.elements.length;i++){const r=n.elements[i];if(!r.hasAttribute("name"))continue;const o=r.getAttribute("type");switch(r.nodeName.toUpperCase()==="INPUT"&&o?o.toUpperCase():""){case"FILE":const h=r;if(s)for(let u=0,m=h.files?.length||0;u<m;u++){const f=h.files?.[u];if(f){const p=await zs(f,Ut.binaryString);e.push('Content-Disposition: form-data; name="'+h.name+'"; filename="'+f.name+`"\r
49
52
  Content-Type: `+f.type+`\r
50
53
  \r
51
54
  `+p+`\r
52
- `)}}break;case"RADIO":case"CHECKBOX":if(!r.checked)break;default:const u=r;n?e.push('Content-Disposition: form-data; name="'+u.name+`"\r
55
+ `)}}break;case"RADIO":case"CHECKBOX":if(!r.checked)break;default:const l=r;s?e.push('Content-Disposition: form-data; name="'+l.name+`"\r
53
56
  \r
54
- `+u.value+`\r
55
- `):t.data[u.name]=u.value;break}}return t.multipartFormDataString="--"+t.boundary+`\r
57
+ `+l.value+`\r
58
+ `):t.data[l.name]=l.value;break}}return t.multipartFormDataString="--"+t.boundary+`\r
56
59
  `+e.join("--"+t.boundary+`\r
57
60
  `)+"--"+t.boundary+`--\r
58
- `,t}class Uw extends yo{currentItem={};items=[];groups=[];globalStyles={};grad={};idtops={};text="";constructor(t){super(t),this.on("tag",(e,n)=>{switch(this.text="",this.currentItem={type:e},e){case"g":this.groups.push(this.currentItem);break}this.processAttrs(e,n)}),this.on("text",e=>{if(this.currentItem.type=="style"){try{const n=wo(e);for(const i of n.stylesheet.rules)for(const r of i.declarations)for(const o of i.selectors)this.globalStyles[o]=this.globalStyles[o]||[],this.globalStyles[o].push(`${r.property}:${r.value}`)}catch{console.error("CAN'T parse css text: "+e)}return}this.text+=e}),this.on("/tag",(e,n)=>{let i=this.groups.length;for(;i--;)if(this.groups[i]!=this.currentItem){let r="",o="";for(const a in this.groups[i])a=="transform"?r=this.groups[i].transform:a=="class"&&this.globalStyles["."+this.groups[i][a]]?o=this.globalStyles["."+this.groups[i][a]].join(";")+";"+o:a=="id"&&this.globalStyles["#"+this.groups[i][a]]?o=this.globalStyles["#"+this.groups[i][a]].join(";")+";"+o:typeof this.currentItem[a]>"u"&&(this.currentItem[a]=this.groups[i][a]);typeof this.currentItem.transform>"u"?this.currentItem.transform=r:this.currentItem.transform+=" "+r,typeof this.currentItem.style>"u"?this.currentItem.style=o:this.currentItem.style=o+this.currentItem.style,this.currentItem.class&&this.globalStyles["."+this.currentItem.class]?this.currentItem.style=this.globalStyles["."+this.currentItem.class].join(";")+";"+this.currentItem.style:this.currentItem.id&&this.globalStyles["#"+this.currentItem.id]&&(this.currentItem.style=this.globalStyles["#"+this.currentItem.id].join(";")+";"+this.currentItem.style),Wo(this.currentItem.style,this.currentItem,Jo)}switch(this.processAttrs(e,n),e){case"g":this.groups.pop();break;case"cirlce":this.addToItems();break;case"ellipse":this.addToItems();break;case"polygon":this.addToItems();break;case"path":this.addToItems();break;case"line":this.addToItems();break;case"rect":this.addToItems();break;case"image":this.addToItems();break;case"text":this.currentItem.text=this.text,this.currentItem["text-anchor"]=this.currentItem["text-anchor"]||"start",this.addToItems();break}}),this.on("finish",()=>{this.emit("result",this.items)})}parse(){return super.parse(),this.items}processAttrs(t,e){let n=[],i;switch(t){case"svg":let r="",o="";if(e.width&&e.height)r=e.width,o=e.height;else if(e.viewBox){const a=e.viewBox.split(/\s+/gi);a.length==4&&(r=String(parseFloat(a[2])-parseFloat(a[0])),o=String(parseFloat(a[3])-parseFloat(a[1])))}r&&o&&this.items.push({type:"viewbox",width:r,height:o});break;case"line":typeof e.x1=="number"&&typeof e.y1=="number"&&typeof e.x2=="number"&&typeof e.y2=="number"&&(this.currentItem.path="M"+[e.x1,e.y1,e.x2,e.y2]);break;case"stop":i={},e.style&&Wo(e.style,i),i.offset=i.offset||e.offset,i.color=i["stop-color"]||e["stop-color"],i.opacity=i["stop-opacity"]||e["stop-opacity"],~(i.offset+"").indexOf("%")?i.offset=parseFloat(i.offset):i.offset=parseFloat(i.offset)*100,i.offset=+i.offset.toFixed(2),this.grad.stops.push(i);break;case"linearGradient":this.grad.angle=(360+Ho(parseFloat(e.x1),parseFloat(e.y1),parseFloat(e.x2),parseFloat(e.y2),parseFloat(e.x1)+100,parseFloat(e.y1))).toFixed(2),n=[this.grad.angle];for(let a=0,h=this.grad.stops.length;a<h;a++)i=this.grad.stops[a],a&&a!=h-1?n.push(i.color+":"+i.offset):n.push(i.color);this.idtops[this.grad.id]=n.join("-"),this.items.forEach(a=>{a.fillid==this.grad.id&&(a.fill=this.idtops[this.grad.id])});break;case"radialGradient":n=[];for(let a=0,h=this.grad.stops.length;a<h;a++)i=this.grad.stops[a],a&&a!=h-1?n.push(i.color+":"+i.offset):n.push(i.color);this.idtops[this.grad.id]=n.join("-"),this.items.forEach(a=>{a.fillid==this.grad.id&&(a.fill=this.idtops[this.grad.id])});break}for(const r in e){const o=e[r];if(Jo.includes(r)&&(this.currentItem[r]=o),r==="id"&&(this.currentItem.type==="linearGradient"&&(this.grad={id:r,stops:[]}),this.currentItem.type==="radialGradient"&&(this.grad={id:r,stops:[]})),r==="style"&&Wo(o,this.currentItem,Jo),r==="transform"&&(this.currentItem.transform=o+(this.currentItem.transform||" ")),r==="fill"){const a=o.match(/url\(#([^)]+)\)/);if(a){const h=a[1];this.currentItem.fillid=h,this.idtops[h]&&(this.currentItem.fill=this.idtops[h])}}r==="points"&&this.currentItem.type=="polygon"&&(this.currentItem.path="M"+o+"z"),r==="d"&&this.currentItem.type=="path"&&(this.currentItem.path=o),r==="xlink:href"&&this.currentItem.type=="image"&&(this.currentItem.src=o)}}addToItems(){this.items.push(this.currentItem)}}function Ho(s,t,e,n,i,r){if(typeof i>"u"||typeof r>"u"){const o=s-e,a=t-n;return!o&&!a?0:(180+Math.atan2(-a,-o)*180/Math.PI+360)%360}else return Ho(s,t,i,r)-Ho(e,n,i,r)}function Wo(s,t,e){const n=(s+"").split(";"),i=/^\s+|\s+$/g;for(let r=0,o=n.length;r<o;r++){const a=n[r].split(":"),h=a[0].replace(i,"").replace(/[A-Z]/g,function(c){return"-"+c.toLowerCase()});(!e||e.includes(h))&&(t[h]=a[1].replace(i,""))}}const Jo=["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 Vw{localVideoUtil;remoteVideoUtil;localPeerConnection=null;remotePeerConnection=null;constructor(t,e){this.localVideoUtil=new ts(t),this.remoteVideoUtil=new ts(e)}start(){this.getLocalMediaStream().then(t=>{this.call(t)})}end(){this.localPeerConnection?.close(),this.remotePeerConnection?.close(),this.localPeerConnection=null,this.remotePeerConnection=null,this.trace("Ending call.")}getLocalMediaStream(){return new Promise((t,e)=>{navigator.mediaDevices.getUserMedia({audio:!0,video:!0}).then(n=>{this.localVideoUtil.setSrcObject(n),t(n)}).catch(n=>{this.trace(`navigator.getUserMedia error: ${n}.`),e(n)})})}gotRemoteMediaStream(t){const e=t.streams[0];this.remoteVideoUtil.setSrcObject(e),this.trace("Remote peer connection received remote stream.")}call(t){const e=t.getVideoTracks(),n=t.getAudioTracks();e.length>0&&this.trace(`Using video device: ${e[0].label}.`),n.length>0&&this.trace(`Using audio device: ${n[0].label}.`);const i=void 0,r=new RTCPeerConnection(i);this.localPeerConnection=r,this.trace("Created local peer connection object localPeerConnection."),r.addEventListener("icecandidate",this.handleConnection),r.addEventListener("iceconnectionstatechange",this.handleConnectionChange);const o=new RTCPeerConnection(i);this.remotePeerConnection=o,this.trace("Created remote peer connection object remotePeerConnection."),o.addEventListener("icecandidate",this.handleConnection),o.addEventListener("iceconnectionstatechange",this.handleConnectionChange),o.addEventListener("track",this.gotRemoteMediaStream),this.trace("Add local localStream to localPeerConnection."),r.addTrack(e[0],t),r.addTrack(n[0],t),this.trace("localPeerConnection createOffer start."),r.createOffer({offerToReceiveVideo:!0}).then(a=>this.createdOffer(a)).catch(a=>this.setSessionDescriptionError(a))}handleConnection(t){const e=t.target,n=t.candidate;if(e&&n){const i=new RTCIceCandidate(n),r=this.getOtherPeer(e);r&&(r.addIceCandidate(i).then(()=>{this.handleConnectionSuccess(e)}).catch(o=>{this.handleConnectionFailure(e,o)}),this.trace(`${this.getPeerName(e)} ICE candidate:
61
+ `,t}class jw extends _o{currentItem={};items=[];groups=[];globalStyles={};grad={};idtops={};text="";constructor(t){super(t),this.on("tag",(e,s)=>{switch(this.text="",this.currentItem={type:e},e){case"g":this.groups.push(this.currentItem);break}this.processAttrs(e,s)}),this.on("text",e=>{if(this.currentItem.type=="style"){try{const s=Co(e);for(const i of s.stylesheet.rules)for(const r of i.declarations)for(const o of i.selectors)this.globalStyles[o]=this.globalStyles[o]||[],this.globalStyles[o].push(`${r.property}:${r.value}`)}catch{console.error("CAN'T parse css text: "+e)}return}this.text+=e}),this.on("/tag",(e,s)=>{let i=this.groups.length;for(;i--;)if(this.groups[i]!=this.currentItem){let r="",o="";for(const a in this.groups[i])a=="transform"?r=this.groups[i].transform:a=="class"&&this.globalStyles["."+this.groups[i][a]]?o=this.globalStyles["."+this.groups[i][a]].join(";")+";"+o:a=="id"&&this.globalStyles["#"+this.groups[i][a]]?o=this.globalStyles["#"+this.groups[i][a]].join(";")+";"+o:typeof this.currentItem[a]>"u"&&(this.currentItem[a]=this.groups[i][a]);typeof this.currentItem.transform>"u"?this.currentItem.transform=r:this.currentItem.transform+=" "+r,typeof this.currentItem.style>"u"?this.currentItem.style=o:this.currentItem.style=o+this.currentItem.style,this.currentItem.class&&this.globalStyles["."+this.currentItem.class]?this.currentItem.style=this.globalStyles["."+this.currentItem.class].join(";")+";"+this.currentItem.style:this.currentItem.id&&this.globalStyles["#"+this.currentItem.id]&&(this.currentItem.style=this.globalStyles["#"+this.currentItem.id].join(";")+";"+this.currentItem.style),sa(this.currentItem.style,this.currentItem,na)}switch(this.processAttrs(e,s),e){case"g":this.groups.pop();break;case"cirlce":this.addToItems();break;case"ellipse":this.addToItems();break;case"polygon":this.addToItems();break;case"path":this.addToItems();break;case"line":this.addToItems();break;case"rect":this.addToItems();break;case"image":this.addToItems();break;case"text":this.currentItem.text=this.text,this.currentItem["text-anchor"]=this.currentItem["text-anchor"]||"start",this.addToItems();break}}),this.on("finish",()=>{this.emit("result",this.items)})}parse(){return super.parse(),this.items}processAttrs(t,e){let s=[],i;switch(t){case"svg":let r="",o="";if(e.width&&e.height)r=e.width,o=e.height;else if(e.viewBox){const a=e.viewBox.split(/\s+/gi);a.length==4&&(r=String(parseFloat(a[2])-parseFloat(a[0])),o=String(parseFloat(a[3])-parseFloat(a[1])))}r&&o&&this.items.push({type:"viewbox",width:r,height:o});break;case"line":typeof e.x1=="number"&&typeof e.y1=="number"&&typeof e.x2=="number"&&typeof e.y2=="number"&&(this.currentItem.path="M"+[e.x1,e.y1,e.x2,e.y2]);break;case"stop":i={},e.style&&sa(e.style,i),i.offset=i.offset||e.offset,i.color=i["stop-color"]||e["stop-color"],i.opacity=i["stop-opacity"]||e["stop-opacity"],~(i.offset+"").indexOf("%")?i.offset=parseFloat(i.offset):i.offset=parseFloat(i.offset)*100,i.offset=+i.offset.toFixed(2),this.grad.stops.push(i);break;case"linearGradient":this.grad.angle=(360+ea(parseFloat(e.x1),parseFloat(e.y1),parseFloat(e.x2),parseFloat(e.y2),parseFloat(e.x1)+100,parseFloat(e.y1))).toFixed(2),s=[this.grad.angle];for(let a=0,h=this.grad.stops.length;a<h;a++)i=this.grad.stops[a],a&&a!=h-1?s.push(i.color+":"+i.offset):s.push(i.color);this.idtops[this.grad.id]=s.join("-"),this.items.forEach(a=>{a.fillid==this.grad.id&&(a.fill=this.idtops[this.grad.id])});break;case"radialGradient":s=[];for(let a=0,h=this.grad.stops.length;a<h;a++)i=this.grad.stops[a],a&&a!=h-1?s.push(i.color+":"+i.offset):s.push(i.color);this.idtops[this.grad.id]=s.join("-"),this.items.forEach(a=>{a.fillid==this.grad.id&&(a.fill=this.idtops[this.grad.id])});break}for(const r in e){const o=e[r];if(na.includes(r)&&(this.currentItem[r]=o),r==="id"&&(this.currentItem.type==="linearGradient"&&(this.grad={id:r,stops:[]}),this.currentItem.type==="radialGradient"&&(this.grad={id:r,stops:[]})),r==="style"&&sa(o,this.currentItem,na),r==="transform"&&(this.currentItem.transform=o+(this.currentItem.transform||" ")),r==="fill"){const a=o.match(/url\(#([^)]+)\)/);if(a){const h=a[1];this.currentItem.fillid=h,this.idtops[h]&&(this.currentItem.fill=this.idtops[h])}}r==="points"&&this.currentItem.type=="polygon"&&(this.currentItem.path="M"+o+"z"),r==="d"&&this.currentItem.type=="path"&&(this.currentItem.path=o),r==="xlink:href"&&this.currentItem.type=="image"&&(this.currentItem.src=o)}}addToItems(){this.items.push(this.currentItem)}}function ea(n,t,e,s,i,r){if(typeof i>"u"||typeof r>"u"){const o=n-e,a=t-s;return!o&&!a?0:(180+Math.atan2(-a,-o)*180/Math.PI+360)%360}else return ea(n,t,i,r)-ea(e,s,i,r)}function sa(n,t,e){const s=(n+"").split(";"),i=/^\s+|\s+$/g;for(let r=0,o=s.length;r<o;r++){const a=s[r].split(":"),h=a[0].replace(i,"").replace(/[A-Z]/g,function(c){return"-"+c.toLowerCase()});(!e||e.includes(h))&&(t[h]=a[1].replace(i,""))}}const na=["id","class","viewBox","width","height","x","y","cx","cy","r","rx","ry","cursor","opacity","src","fill","fill-opacity","stroke","stroke-dasharray","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-anchor","font","font-family","font-size","font-style","font-weight","letter-spacing"];class Hw{localVideoUtil;remoteVideoUtil;localPeerConnection=null;remotePeerConnection=null;constructor(t,e){this.localVideoUtil=new rn(t),this.remoteVideoUtil=new rn(e)}start(){this.getLocalMediaStream().then(t=>{this.call(t)})}end(){this.localPeerConnection?.close(),this.remotePeerConnection?.close(),this.localPeerConnection=null,this.remotePeerConnection=null,this.trace("Ending call.")}getLocalMediaStream(){return new Promise((t,e)=>{navigator.mediaDevices.getUserMedia({audio:!0,video:!0}).then(s=>{this.localVideoUtil.setSrcObject(s),t(s)}).catch(s=>{this.trace(`navigator.getUserMedia error: ${s}.`),e(s)})})}gotRemoteMediaStream(t){const e=t.streams[0];this.remoteVideoUtil.setSrcObject(e),this.trace("Remote peer connection received remote stream.")}call(t){const e=t.getVideoTracks(),s=t.getAudioTracks();e.length>0&&this.trace(`Using video device: ${e[0].label}.`),s.length>0&&this.trace(`Using audio device: ${s[0].label}.`);const i=void 0,r=new RTCPeerConnection(i);this.localPeerConnection=r,this.trace("Created local peer connection object localPeerConnection."),r.addEventListener("icecandidate",this.handleConnection),r.addEventListener("iceconnectionstatechange",this.handleConnectionChange);const o=new RTCPeerConnection(i);this.remotePeerConnection=o,this.trace("Created remote peer connection object remotePeerConnection."),o.addEventListener("icecandidate",this.handleConnection),o.addEventListener("iceconnectionstatechange",this.handleConnectionChange),o.addEventListener("track",this.gotRemoteMediaStream),this.trace("Add local localStream to localPeerConnection."),r.addTrack(e[0],t),r.addTrack(s[0],t),this.trace("localPeerConnection createOffer start."),r.createOffer({offerToReceiveVideo:!0}).then(a=>this.createdOffer(a)).catch(a=>this.setSessionDescriptionError(a))}handleConnection(t){const e=t.target,s=t.candidate;if(e&&s){const i=new RTCIceCandidate(s),r=this.getOtherPeer(e);r&&(r.addIceCandidate(i).then(()=>{this.handleConnectionSuccess(e)}).catch(o=>{this.handleConnectionFailure(e,o)}),this.trace(`${this.getPeerName(e)} ICE candidate:
59
62
  ${t.candidate.candidate}.`))}}handleConnectionSuccess(t){this.trace(`${this.getPeerName(t)} addIceCandidate success.`)}handleConnectionFailure(t,e){this.trace(`${this.getPeerName(t)} failed to add ICE Candidate:
60
63
  ${e.toString()}.`)}handleConnectionChange(t){const e=t.target;console.log("ICE state change event: ",t),e&&this.trace(`${this.getPeerName(e)} ICE state: ${e.iceConnectionState}.`)}createdOffer(t){this.trace(`Offer from localPeerConnection:
61
64
  ${t.sdp}`),this.localPeerConnection&&(this.trace("localPeerConnection setLocalDescription start."),this.localPeerConnection.setLocalDescription(t).then(()=>{this.setLocalDescriptionSuccess(this.localPeerConnection)}).catch(e=>this.setSessionDescriptionError(e))),this.remotePeerConnection&&(this.trace("remotePeerConnection setRemoteDescription start."),this.remotePeerConnection.setRemoteDescription(t).then(()=>{this.setRemoteDescriptionSuccess(this.remotePeerConnection)}).catch(e=>this.setSessionDescriptionError(e)),this.trace("remotePeerConnection createAnswer start."),this.remotePeerConnection.createAnswer().then(e=>this.createdAnswer(e)).catch(e=>this.setSessionDescriptionError(e)))}createdAnswer(t){this.trace(`Answer from remotePeerConnection:
62
- ${t.sdp}.`),this.remotePeerConnection&&(this.trace("remotePeerConnection setLocalDescription start."),this.remotePeerConnection.setLocalDescription(t).then(()=>{this.setLocalDescriptionSuccess(this.remotePeerConnection)}).catch(e=>this.setSessionDescriptionError(e))),this.localPeerConnection&&(this.trace("localPeerConnection setRemoteDescription start."),this.localPeerConnection.setRemoteDescription(t).then(()=>{this.setRemoteDescriptionSuccess(this.localPeerConnection)}).catch(e=>this.setSessionDescriptionError(e)))}setSessionDescriptionError(t){this.trace(`Failed to create session description: ${t.toString()}.`)}setDescriptionSuccess(t,e){const n=this.getPeerName(t);this.trace(`${n} ${e} complete.`)}setLocalDescriptionSuccess(t){this.setDescriptionSuccess(t,"setLocalDescription")}setRemoteDescriptionSuccess(t){this.setDescriptionSuccess(t,"setRemoteDescription")}trace(t){t=t.trim();const e=(window.performance.now()/1e3).toFixed(3);console.log(e,t);const n=document.createElement("div");n.innerHTML=`<div>${e}, ${t}</div>`,document.getElementById("trace")?.appendChild(n)}getOtherPeer(t){return t===this.localPeerConnection?this.remotePeerConnection:this.localPeerConnection}getPeerName(t){return t===this.localPeerConnection?"localPeerConnection":"remotePeerConnection"}}class Gw{canvas;gl;constructor(t){this.canvas=t;const e={alpha:!0,premultipliedAlpha:!1};if(this.gl=this.canvas.getContext("webgl",e),!this.gl)throw new Error("WebGL failed to initialize.")}}const il=[],rl={};function Zo(s){il.push(s)}function qw(s,t=!1){const e=tl();if(rl[e])return;wx.error(r=>{console.log(r.errMsg||JSON.stringify(r))}),wx.ready(()=>{il.forEach(r=>r())});const n=["updateAppMessageShareData","updateTimelineShareData","onMenuShareWeibo","onMenuShareQZone","startRecord","stopRecord","onVoiceRecordEnd","playVoice","pauseVoice","stopVoice","onVoicePlayEnd","uploadVoice","downloadVoice","chooseImage","previewImage","uploadImage","downloadImage","getLocalImgData","translateVoice","getNetworkType","openLocation","getLocation","hideOptionMenu","showOptionMenu","hideMenuItems","showMenuItems","hideAllNonBaseMenuItem","showAllNonBaseMenuItem","closeWindow","scanQRCode","openProductSpecificView","addCard","chooseCard","openCard"],i=["wx-open-launch-app","wx-open-launch-app","wx-open-subscribe","wx-open-audio"];wx.config(Object.assign(s,{debug:t,jsApiList:n,openTagList:i})),rl[e]=!0}function jw(s){return new Promise((t,e)=>{wx.checkJsApi({jsApiList:[s],success:function(n){n.checkResult[s]?t(!0):e(!1)},fail:function(){e(!1)}})})}function Hw(s){Zo(function(){wx.updateAppMessageShareData(s)})}function Ww(s){Zo(function(){wx.updateTimelineShareData(s)})}function Jw(s){wx.chooseImage(s)}function Zw(s){wx.previewImage(s)}function Qw(s){wx.uploadImage(s)}function Kw(s){wx.downloadImage(s)}function t2(s){wx.getLocalImgData(s)}function e2(){wx.startRecord()}function n2(s){wx.stopRecord(s)}function s2(s){wx.onVoiceRecordEnd(s)}function i2(s){wx.playVoice(s)}function r2(s){wx.pauseVoice(s)}function o2(s){wx.stopVoice(s)}function a2(s){wx.onVoicePlayEnd(s)}function h2(s){wx.uploadVoice(s)}function c2(s){wx.downloadVoice(s)}function u2(s){wx.translateVoice(s)}function l2(s){wx.getNetworkType(s)}function f2(s){wx.openLocation(s)}function d2(s){wx.getLocation(s)}function m2(s){wx.scanQRCode(s)}function p2(s,t,e){function n(){WeixinJSBridge.invoke("getBrandWCPayRequest",s,function(i){i.err_msg=="get_brand_wcpay_request:ok"?t():e(i.err_msg)})}typeof WeixinJSBridge>"u"?document.addEventListener?document.addEventListener("WeixinJSBridgeReady",n,!1):document.attachEvent&&(document.attachEvent("WeixinJSBridgeReady",n),document.attachEvent("onWeixinJSBridgeReady",n)):n()}function g2(s,t,e="snsapi_userinfo",n=""){return`https://open.weixin.qq.com/connect/oauth2/authorize?appid=${s}&redirect_uri=${encodeURIComponent(t)}&response_type=code&scope=${e}&state=${n}#wechat_redirect`}function y2(s){window.AlipayJSBridge?s&&s():document.addEventListener("AlipayJSBridgeReady",s,!1)}function is(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 w2(s,t,e){ap.tradePay(Object.assign(s,{}),function(n){let i="未知错误";switch(n.resultCode){case 9e3:return i="订单支付成功",t?.(i);case 8e3:i="正在处理中";break;case 4e3:i="订单支付失败";break;case 6001:i="用户中途取消";break;case 6002:i="网络连接出错";break;case 99:i="用户点击忘记密码导致快捷界面退出(only iOS)";break}e?.(i)})}function x2(s,t,e){ap.scan(Object.assign(s,{fail:n=>{e?.(is(n))}}),function(n){t?.(n.code)})}function b2(s,t,e){ap.getLocation(Object.assign(s,{fail:n=>{e?.(is(n))}}),function(n){t?.(n)})}function v2(s,t,e){ap.openLocation(Object.assign(s,{fail:n=>{e?.(is(n))}}),function(){t?.()})}function _2(s,t,e){ap.chooseImage(Object.assign(s,{fail:n=>{e?.(is(n,"chooseImage"))}}),function(n){t?.(n)})}function S2(s,t,e){ap.previewImage(Object.assign(s,{fail:n=>{e?.(is(n))}}),function(){t?.()})}class C2{map;constructor(t,e=120.619585,n=31.299379,i=18){this.map=new T.Map(t),this.map.centerAndZoom(new T.LngLat(e,n),i)}}const ol=window.crypto.subtle;ol||console.warn("Crypto API not supported");async function al(s,t="SHA-256"){const e=await ol.digest(t,of(s));return af(e)}async function T2(s,t="SHA-256"){const e=JSON.stringify(Zl(s));return al(e,t)}class E2{currentPage;itemsPerPage;entriesInterval;entriesEdge;linkTo;prevText;nextText;ellipseText;prevShowAlways;nextShowAlways;callback;totalPages;parentVNode;constructor(t,e,n){this.currentPage=n?.currentPage||0,this.itemsPerPage=n?.itemsPerPage||10,this.entriesInterval=n?.entriesInterval||5,this.entriesEdge=n?.entriesEdge||1,this.linkTo=n?.linkTo||"javascript:;",this.prevText=n?.prevText||"上一页",this.nextText=n?.nextText||"下一页",this.ellipseText=n?.ellipseText||"...",this.prevShowAlways=typeof n?.prevShowAlways=="boolean"?n?.prevShowAlways:!0,this.nextShowAlways=typeof n?.nextShowAlways=="boolean"?n?.nextShowAlways:!0,this.callback=n?.callback||(i=>!1),this.totalPages=Math.ceil(e/this.itemsPerPage),this.parentVNode=this.createParentVNode(),vn(this.parentVNode,t),this.selectPage(this.currentPage)}createParentVNode(){return tn("div",{class:"pagination"},[])}appendVNode(t,e,n){e=e<0?0:e<this.totalPages?e:this.totalPages-1;const i=n?.text||String(e+1),r=n?.classes||"";t.children.push(e==this.currentPage&&r.indexOf("prev")==-1&&r.indexOf("next")==-1?tn("span",{class:`current ${r}`},i):tn("a",{class:r,href:this.linkTo.replace(/__id__/,String(e)),onClick:o=>this.selectPage(e,o)},i))}drawLinks(){const t=this.createParentVNode(),e=Math.ceil(this.entriesInterval/2),n=this.currentPage>e?Math.max(Math.min(this.currentPage-e,this.totalPages-this.entriesInterval),0):0,i=this.currentPage>e?Math.min(this.currentPage+e,this.totalPages):Math.min(this.entriesInterval,this.totalPages);if(this.prevText&&(this.currentPage>0||this.prevShowAlways)&&this.appendVNode(t,this.currentPage-1,{text:this.prevText,classes:"prev"}),n>0&&this.entriesEdge>0){const r=Math.min(this.entriesEdge,n);for(let o=0;o<r;o++)this.appendVNode(t,o);this.entriesEdge<n&&this.ellipseText&&t.children.push(tn("span",{},this.ellipseText))}for(let r=n;r<i;r++)this.appendVNode(t,r);if(i<this.totalPages&&this.entriesEdge>0){this.totalPages-this.entriesEdge>i&&this.ellipseText&&t.children.push(tn("span",{},this.ellipseText));const r=Math.max(this.totalPages-this.entriesEdge,i);for(let o=r;o<this.totalPages;o++)this.appendVNode(t,o)}this.nextText&&(this.currentPage<this.totalPages-1||this.nextShowAlways)&&this.appendVNode(t,this.currentPage+1,{text:this.nextText,classes:"next"}),si(this.parentVNode,t),this.parentVNode=t}selectPage(t,e){this.currentPage=t=t<0?0:t<this.totalPages?t:this.totalPages-1,this.drawLinks();const n=this.callback(t);return e&&(n||(e.stopPropagation?e.stopPropagation():e.cancelBubble=!0)),n}prevPage(){return this.selectPage(this.currentPage-1)}nextPage(){return this.selectPage(this.currentPage+1)}}class P2{config;store;eb;axios;constructor(t={}){this.config=t,this.config.static=this.config.static||{};const e=this.config.store?.state||{};this.store=Oa(this.config.store?.reducer||(()=>e),e,this.config.store?.enhancer),this.eb=new gs,this.axios=new tr({baseURL:this.config.axios?.baseURL,timeout:this.config.axios?.timeout,headers:this.config.axios?.headers,responseType:this.config.axios?.responseType,responseEncoding:this.config.axios?.responseEncoding,interceptor:this.config.axios?.interceptor,retry:this.config.axios?.retry,cache:this.config.axios?.cache})}}return d.ArrowShape=Io,d.BallShape=bn,d.BezierEasing=Er,d.BufferAttribute=ge,d.COLOR_NAMES=ns,d.CSSToJSEasing=tg,d.Clock=Ar,d.Color=Ft,d.ColorManagement=Po,d.CommonKeyCode=T1,d.Context=P2,d.CrossShape=No,d.CustomCanvasContext=fc,d.CustomCanvasGradient=$s,d.CustomCanvasPattern=Lr,d.DOMParse=yo,d.DOMSVGUtil=Ge,d.DOMToBlob=nr,d.DOMToString=er,d.DOMVideo=ts,d.DrawContext=K1,d.Easing=O,d.EllipseShape=Bo,d.FetchWithAxios=tr,d.FileUpload=wm,d.Float32BufferAttribute=Y0,d.FoxShape=Oo,d.HeartShape=Do,d.HeartVariantShape=Lo,d.Int16BufferAttribute=z0,d.Int32BufferAttribute=B0,d.Int8BufferAttribute=L0,d.Interpolation=me,d.LineShape=Qe,d.LinearSRGBColorSpace=To,d.LinearToSRGB=Ze,d.LinearTransfer=Eo,d.Ls=Re,d.MVVM=Iw,d.Matrix=_t,d.Matrix2=$r,d.Matrix3=gn,d.Matrix4=It,d.NoColorSpace=Nu,d.Pagination=E2,d.QRCode=Le,d.RabbitShape=zo,d.RectShape=Ke,d.RingIndicatorShapeCombo=Xo,d.RingShape=ss,d.SRGBColorSpace=We,d.SRGBToLinear=Je,d.SRGBTransfer=Ks,d.SVGParse=Uw,d.SVGParsedPathArgsLength=Un,d.SegmentShapeCombo=Yo,d.Shape=ot,d.ShapeCombo=Lt,d.ShipShapeCombo=Fo,d.SliderShapeCombo=$o,d.StarShape=Ro,d.TWEEN=hg,d.Timeline=Fn,d.TreeShapeCombo=ko,d.Tween=Mr,d.Uint16BufferAttribute=N0,d.Uint32BufferAttribute=F0,d.Uint8BufferAttribute=R0,d.Uint8ClampedBufferAttribute=O0,d.Vector2=Vn,d.Vector3=zt,d.Vector4=Br,d.WebGLCoordinateSystem=Gn,d.WebGLRenderer=Gw,d.WebGPUCoordinateSystem=Yr,d.WebRTCClient=Vw,d.WebSocketClient=oe,d.YZCanvasContext=Rr,d.YZMessageChannel=Yw,d.YZWorker=Fw,d.__color=we,d.addClass=Sy,d.addWatermark=a0,d.addWxJsReadyFnBeforeConfig=Zo,d.ajax=$w,d.aliJsChooseImage=_2,d.aliJsGetLocation=b2,d.aliJsOpenLocation=v2,d.aliJsPreviewImage=S2,d.aliJsReady=y2,d.aliJsScan=x2,d.aliJsTradePay=w2,d.angle=Jt,d.animateShapes=q1,d.animateSpringChainShapes=H1,d.animateSpringConnectShapes=W1,d.animateSpringMassShapes=J1,d.animationEnd$=h1,d.animationStart$=a1,d.appendURL=jo,d.appendURLRecord=Bw,d.atomReadAttribute=_c,d.atomReadAttributes=Hr,d.atomReadStyle=Tg,d.atomReadStyles=qr,d.atomRemoveAttribute=Mg,d.atomRemoveDataset=cw,d.atomRemoveStyle=jr,d.atomWriteAttribute=wn,d.atomWriteStyle=Vs,d.base64EncodeOutputStream=Pc,d.bitmapMapper=$c,d.blobToImageData=Lg,d.byteArrayOutputStream=Jr,d.canDrawBitmap=Yc,d.canUsePaths=A0,d.canUseWorker=Fc,d.cancelBubble=Qh,d.cancelFetch=Cw,d.changeBrightness=r0,d.changeCheckboxChecked=wy,d.changeDiaphaneity=o0,d.changeRadioChecked=yy,d.changeSelected=gy,d.changeSize=i0,d.checkWxJsApi=jw,d.clearCookies=bw,d.clearLocalStorage=uw,d.clearSessionStorage=ww,d.closeLog=yf,d.closest=ly,d.combineTransformToMatrix=Eg,d.compareVersion=m0,d.computeImageDisplayRect=Ag,d.containsChild=ay,d.createDefaultMousePoint=ro,d.createElement=Kc,d.createElementNS=Ey,d.createFragment=Qc,d.createIndexDB=_w,d.createObjectURL=Xc,d.createRunCycleInMaxRate=Up,d.createTextNode=Py,d.createWebSocket=Ku,d.createXMLHttpRequest=sl,d.cssAttrsToCanvasAttrs=Sc,d.distance=Me,d.domPrefixes=Pg,d.drag$=hu,d.dragEnd$=uu,d.dragEnter$=fu,d.dragLeave$=du,d.dragOver$=mu,d.dragStart$=cu,d.drawBitmapInCanvas=X0,d.drawQRCodeToCanvas=f0,d.drop$=lu,d.easeNameToCubicBezier=Pr,d.empty=Wc,d.fireEvent=Fp,d.flipSideToSide=Og,d.flipUpsideDown=zg,d.flushURL=nl,d.flushURLRecord=Nw,d.formDataToSearch=el,d.generateRosettaShape=Q1,d.getBitmapFromCanvas=$0,d.getBodyPosition=w1,d.getBrowserClient=Zr,d.getBrowserClientVersion=p0,d.getBrowserLanguage=g0,d.getCSSVar=pw,d.getDOMMatrix=Vr,d.getDirection=lg,d.getDocumentElementPosition=Zn,d.getElementPositionInPage=uo,d.getElementPositionInPage2=b1,d.getElementPositionInViewport=bu,d.getEmSize=sy,d.getFetchId=Go,d.getFileExtension=gm,d.getFileMD5Hash=vh,d.getFileTypeFromFile=pm,d.getFormSubmitData=Xw,d.getImageData=Cc,d.getImageDataByAIData=c0,d.getImageMainColor=Rg,d.getInnerText=by,d.getInternetExplorerVersion=Oc,d.getKeyCode=E1,d.getMIME=ym,d.getMouseButton=C1,d.getMousePositionInElement=ft,d.getMousePositionInPage=lo,d.getMousePositionInViewport=S1,d.getOperatingSystem=Gs,d.getOperatingSystemVersion=d0,d.getPageSize=x1,d.getParameters=zw,d.getPolymorphShapeCombosInterpolator=Uu,d.getPolymorphShapesInterpolator=Ao,d.getRelativeBoundingClientRect=v1,d.getRemSize=Kr,d.getScreenPosition=y1,d.getSelectedText=H0,d.getStyle=qe,d.getTheme$=mw,d.getTimeZone=y0,d.getURL=ii,d.getVerticalScrollTopPercentInPage=_1,d.getVertxRegisterBaseUrl=Dw,d.getViewportSize=xu,d.getVnode=kr,d.gifImage=Mc,d.gravitateShapes=j1,d.h=tn,d.hFromEl=ni,d.hasClass=Ty,d.hasDocument=E0,d.hasHistory=P0,d.hasWindow=Bc,d.hideEl=Zc,d.html=Hc,d.iframePostMessage=My,d.imageDataToBitmap=kg,d.imageDataToBlob=Dg,d.imageDataToDataURL=Ig,d.injectStyle=vc,d.injectWxJsConfig=qw,d.insert=Jn,d.isActiveEl=ey,d.isAliBrowser=Nc,d.isAliMiniProgram=T0,d.isAndroid=Rc,d.isAppleDevice=w0,d.isBrowserSupportFileAPI=M0,d.isElement=k0,d.isEventSupported=$p,d.isIE=b0,d.isIE10=_0,d.isIE11=S0,d.isIE9=v0,d.isIOS=Qr,d.isInput=Wn,d.isInputCheckbox=no,d.isInputNumber=py,d.isInputRadio=so,d.isInputText=my,d.isMacOS=Lc,d.isMobile=x0,d.isRootEl=ty,d.isSelect=eo,d.isTextArea=dy,d.isTouchSupport=D0,d.isURL=Rw,d.isWxBrowser=zc,d.isWxMiniProgram=C0,d.jpgToPng=t0,d.keyDown$=pu,d.keyPress$=c1,d.keyUp$=gu,d.leftRotate=Ng,d.length=pn,d.mapTDTJSSDK=C2,d.marginSharpen=Kg,d.mosaic=h0,d.mount=vn,d.mouseClick$=Ry,d.mouseContextMenu$=Ny,d.mouseDoubleClick$=Oy,d.mouseDown$=nu,d.mouseEnter$=Dy,d.mouseLeave$=Ly,d.mouseMove$=Hs,d.mouseOut$=Iy,d.mouseOver$=ky,d.mouseUp$=su,d.mouseWheel$=zy,d.nearestElement=iy,d.nextElementSibling=cy,d.normalizePoint=ug,d.objectSignature=T2,d.onBeforeUnload=Vc,d.onDocumentReady=Uc,d.openLog=gf,d.outputGifBase64=Ac,d.outputQRCodeBase64=l0,d.pan$=By,d.panCancel$=Xy,d.panDown$=qy,d.panEnd$=$y,d.panLeft$=Uy,d.panMove$=Fy,d.panRight$=Vy,d.panStart$=Yy,d.panUp$=Gy,d.parent=ry,d.parents=to,d.parseCSS=wo,d.parseTransformToMatrix=Ur,d.patch=si,d.pinch$=jy,d.pinchIn$=Hy,d.pinchOut$=Wy,d.pngToJpg=e0,d.pointerCancel$=co,d.pointerDown$=ao,d.pointerMove$=oo,d.pointerUp$=ho,d.polar=Ae,d.polymorphShapesTween=Z1,d.prefixes=I0,d.press$=Jy,d.preventDefault=Ee,d.previousElementSibling=uy,d.radiusClip=s0,d.readFileInBrowser=Dn,d.recordToSearch=ri,d.rectClip=n0,d.rem2px=ny,d.remove=vy,d.removeClass=Cy,d.requestAnimationFrameCycle=br,d.reverseCSSToJSEasing=eg,d.reverseEaseNameToCubicBezier=hc,d.reverseEasing=sc,d.revokeObjectURL=U0,d.rightRotate=Bg,d.rotate$=Zy,d.rotatePoint=Qt,d.scheduleIdle=Kh,d.scheduleIdleAsap=nc,d.scheduleVnodeAsap=Dr,d.scheduleVnodeImmediately=cg,d.scrollParent=oy,d.scrollTo=Q0,d.searchToRecord=Ow,d.selectFileInBrowser=sr,d.setCSSVar=gw,d.setIntervalAccurate=Xp,d.setLogUploadFn=wf,d.setManualScroll=K0,d.setRem=Lw,d.setStyle=Gr,d.setTheme=Qu,d.setTimeoutAccurate=vr,d.setWindowTitle=W0,d.shadowRoot=fy,d.sharpen=Qg,d.showEl=Jc,d.siblings=hy,d.signature=al,d.simulateMouseEventFromTouch=Yp,d.stringToDOM=mm,d.swipe$=Qy,d.swipeDown$=n1,d.swipeLeft$=Ky,d.swipeRight$=t1,d.swipeUp$=e1,d.tap$=s1,d.tapOutSide$=i1,d.text=xy,d.toBlackAndWhite=$g,d.toBlue=Gg,d.toBlueAndGreen=Hg,d.toBlueAndGrey=Zg,d.toDegree=Et,d.toGreen=Vg,d.toGreenAndGrey=Jg,d.toGrey=Fg,d.toGrey2=Yg,d.toOpposite=Xg,d.toRadian=q,d.toRed=Ug,d.toRedAndBlue=jg,d.toRedAndGreen=qg,d.toRedAndGrey=Wg,d.toggleClass=io,d.toggleElDisplay=_y,d.toggleTheme=dw,d.touchCancel$=au,d.touchEnd$=ou,d.touchMove$=iu,d.touchStart$=ru,d.transformPath2D=Cg,d.transitionEnd$=o1,d.transitionStart$=r1,d.trimHash=tl,d.updateVnode=Ir,d.useAttribute=je,d.useClickA=js,d.useClipboard=Z0,d.useCookie=xw,d.useCoords$=iw,d.useDataset=hw,d.useDocumentVisible$=g1,d.useDraggable=m1,d.useDrop=p1,d.useElementEventBus=I1,d.useEvent$=X,d.useEventListener=W,d.useFetch=ti,d.useFetchCache=Ew,d.useFetchRetry=Tw,d.useFetchRetryCache=Pw,d.useHashChange$=ow,d.useHotKeyDown$=_u,d.useHotKeyFile=M1,d.useHotKeyFile$=Su,d.useHotKeyUp$=P1,d.useIntersection$=Gu,d.useLoadImage=qc,d.useLoadLink=G0,d.useLoadScript=V0,d.useLocalStorage=Wu,d.useLocale=qo,d.useLocation$=Hu,d.useMatchMedia$=ju,d.useMouseAndPointerDownMovePoint$=yu,d.useMouseDownMovePoint$=l1,d.useMouseMovePoint$=u1,d.useMousePoint=He,d.useMutation$=Vu,d.usePointerDownMovePoint$=Ws,d.usePopStateChange$=aw,d.usePressDownMove=Tu,d.usePressDownMoveWithMouse=D1,d.usePressDownMoveWithPointer=Eu,d.usePressDownMoveWithTouch=L1,d.usePull$=d1,d.useResize=Cu,d.useResize$=fo,d.useRunInSandbox=Ay,d.useSafeArea$=sw,d.useScroll$=wu,d.useSelectFile=jc,d.useSelectFileImage=j0,d.useSessionStorage=yw,d.useTimestampValue=Uo,d.useTouchDownMovePoint$=f1,d.useUrlChange$=rw,d.useVisible$=ew,d.useVisibleSimple$=tw,d.useWindowResize$=A1,d.vibrate=J0,d.waitForStyleSheetsLoaded=q0,d.writeToIndexDB=Sw,d.wxJsChooseImage=Jw,d.wxJsDownloadImage=Kw,d.wxJsDownloadVoice=c2,d.wxJsGetLocalImgData=t2,d.wxJsGetLocation=d2,d.wxJsGetNetworkType=l2,d.wxJsLogin=g2,d.wxJsOnVoicePlayEnd=a2,d.wxJsOnVoiceRecordEnd=s2,d.wxJsOpenLocation=f2,d.wxJsPauseVoice=r2,d.wxJsPay=p2,d.wxJsPlayVoice=i2,d.wxJsPreviewImage=Zw,d.wxJsScanQRCode=m2,d.wxJsStartRecord=e2,d.wxJsStopRecord=n2,d.wxJsStopVoice=o2,d.wxJsTranslateVoice=u2,d.wxJsUpdateAppMessageShareData=Hw,d.wxJsUpdateTimelineShareData=Ww,d.wxJsUploadImage=Qw,d.wxJsUploadVoice=h2,Object.defineProperty(d,Symbol.toStringTag,{value:"Module"}),d}({});
65
+ ${t.sdp}.`),this.remotePeerConnection&&(this.trace("remotePeerConnection setLocalDescription start."),this.remotePeerConnection.setLocalDescription(t).then(()=>{this.setLocalDescriptionSuccess(this.remotePeerConnection)}).catch(e=>this.setSessionDescriptionError(e))),this.localPeerConnection&&(this.trace("localPeerConnection setRemoteDescription start."),this.localPeerConnection.setRemoteDescription(t).then(()=>{this.setRemoteDescriptionSuccess(this.localPeerConnection)}).catch(e=>this.setSessionDescriptionError(e)))}setSessionDescriptionError(t){this.trace(`Failed to create session description: ${t.toString()}.`)}setDescriptionSuccess(t,e){const s=this.getPeerName(t);this.trace(`${s} ${e} complete.`)}setLocalDescriptionSuccess(t){this.setDescriptionSuccess(t,"setLocalDescription")}setRemoteDescriptionSuccess(t){this.setDescriptionSuccess(t,"setRemoteDescription")}trace(t){t=t.trim();const e=(window.performance.now()/1e3).toFixed(3);console.log(e,t);const s=document.createElement("div");s.innerHTML=`<div>${e}, ${t}</div>`,document.getElementById("trace")?.appendChild(s)}getOtherPeer(t){return t===this.localPeerConnection?this.remotePeerConnection:this.localPeerConnection}getPeerName(t){return t===this.localPeerConnection?"localPeerConnection":"remotePeerConnection"}}class Ww{canvas;gl;constructor(t){this.canvas=t;const e={alpha:!0,premultipliedAlpha:!1};if(this.gl=this.canvas.getContext("webgl",e),!this.gl)throw new Error("WebGL failed to initialize.")}}const du=[],mu={};function ia(n){du.push(n)}function Jw(n,t=!1){const e=Jf();if(mu[e])return;wx.error(r=>{console.log(r.errMsg||JSON.stringify(r))}),wx.ready(()=>{du.forEach(r=>r())});const s=["updateAppMessageShareData","updateTimelineShareData","onMenuShareWeibo","onMenuShareQZone","startRecord","stopRecord","onVoiceRecordEnd","playVoice","pauseVoice","stopVoice","onVoicePlayEnd","uploadVoice","downloadVoice","chooseImage","previewImage","uploadImage","downloadImage","getLocalImgData","translateVoice","getNetworkType","openLocation","getLocation","hideOptionMenu","showOptionMenu","hideMenuItems","showMenuItems","hideAllNonBaseMenuItem","showAllNonBaseMenuItem","closeWindow","scanQRCode","openProductSpecificView","addCard","chooseCard","openCard"],i=["wx-open-launch-app","wx-open-launch-app","wx-open-subscribe","wx-open-audio"];wx.config(Object.assign(n,{debug:t,jsApiList:s,openTagList:i})),mu[e]=!0}function Zw(n){return new Promise((t,e)=>{wx.checkJsApi({jsApiList:[n],success:function(s){s.checkResult[n]?t(!0):e(!1)},fail:function(){e(!1)}})})}function Qw(n){ia(function(){wx.updateAppMessageShareData(n)})}function Kw(n){ia(function(){wx.updateTimelineShareData(n)})}function tx(n){wx.chooseImage(n)}function ex(n){wx.previewImage(n)}function sx(n){wx.uploadImage(n)}function nx(n){wx.downloadImage(n)}function ix(n){wx.getLocalImgData(n)}function rx(){wx.startRecord()}function ox(n){wx.stopRecord(n)}function ax(n){wx.onVoiceRecordEnd(n)}function hx(n){wx.playVoice(n)}function cx(n){wx.pauseVoice(n)}function lx(n){wx.stopVoice(n)}function ux(n){wx.onVoicePlayEnd(n)}function fx(n){wx.uploadVoice(n)}function dx(n){wx.downloadVoice(n)}function mx(n){wx.translateVoice(n)}function px(n){wx.getNetworkType(n)}function gx(n){wx.openLocation(n)}function yx(n){wx.getLocation(n)}function xx(n){wx.scanQRCode(n)}function bx(n,t,e){function s(){WeixinJSBridge.invoke("getBrandWCPayRequest",n,function(i){i.err_msg=="get_brand_wcpay_request:ok"?t():e(i.err_msg)})}typeof WeixinJSBridge>"u"?document.addEventListener?document.addEventListener("WeixinJSBridgeReady",s,!1):document.attachEvent&&(document.attachEvent("WeixinJSBridgeReady",s),document.attachEvent("onWeixinJSBridgeReady",s)):s()}function vx(n,t,e="snsapi_userinfo",s=""){return`https://open.weixin.qq.com/connect/oauth2/authorize?appid=${n}&redirect_uri=${encodeURIComponent(t)}&response_type=code&scope=${e}&state=${s}#wechat_redirect`}function Sx(n){window.AlipayJSBridge?n&&n():document.addEventListener("AlipayJSBridgeReady",n,!1)}function cn(n,t){let e="未知错误";switch(n.error){case 1:e="接口不存在";break;case 2:e="参数无效";break;case 3:e="发生未知错误";break;case 4:e="接口无权限";break;case 10:e="用户取消";break;case 11:e="操作失败",t==="chooseImage"&&(e="操作失败(权限不够)");break;case 12:e="GPS打开,但定位失败";break;case 13:e="获取地理位置信息失败";break;case 14:e="定位超时";break;case 15:e="网络错误";break;case 16:e="GPS未打开或用户未授权";break}return`${n.error}(${e}): ${n.errorMessage}`}function _x(n,t,e){ap.tradePay(Object.assign(n,{}),function(s){let i="未知错误";switch(s.resultCode){case 9e3:return i="订单支付成功",t?.(i);case 8e3:i="正在处理中";break;case 4e3:i="订单支付失败";break;case 6001:i="用户中途取消";break;case 6002:i="网络连接出错";break;case 99:i="用户点击忘记密码导致快捷界面退出(only iOS)";break}e?.(i)})}function Cx(n,t,e){ap.scan(Object.assign(n,{fail:s=>{e?.(cn(s))}}),function(s){t?.(s.code)})}function Tx(n,t,e){ap.getLocation(Object.assign(n,{fail:s=>{e?.(cn(s))}}),function(s){t?.(s)})}function Px(n,t,e){ap.openLocation(Object.assign(n,{fail:s=>{e?.(cn(s))}}),function(){t?.()})}function Ex(n,t,e){ap.chooseImage(Object.assign(n,{fail:s=>{e?.(cn(s,"chooseImage"))}}),function(s){t?.(s)})}function Mx(n,t,e){ap.previewImage(Object.assign(n,{fail:s=>{e?.(cn(s))}}),function(){t?.()})}class Ax{map;constructor(t,e=120.619585,s=31.299379,i=18){this.map=new T.Map(t),this.map.centerAndZoom(new T.LngLat(e,s),i)}}const Be=window.crypto.subtle;Be||console.warn("Crypto API not supported");async function pu(n,t=Es.SHA256){const e=await Be.digest(t,Ri(n));return ka(e)}async function Ix(n,t=Es.SHA256){return pu(JSON.stringify(af(n)),t)}async function kx(n,t=Es.AESGCM){const e=crypto.getRandomValues(new Uint8Array(12)),s=await Be.generateKey({name:t,length:256},!1,["encrypt","decrypt"]),i=await Be.encrypt({name:t,iv:e},s,Ri(n));return{algorithm:t,iv:e,key:s,encryptedData:i}}async function Dx(n){const t=await Be.decrypt({name:n.algorithm,iv:n.iv},n.key,n.encryptedData);return ka(t)}async function Lx(n,t=Es.ECDSA,e="SHA-384"){const{privateKey:s,publicKey:i}=await Be.generateKey({name:t,namedCurve:"P-384"},!1,["sign","verify"]),r=Ri(JSON.stringify(n)),o=await Be.sign({name:t,hash:{name:e}},s,r);return{algorithm:t,hash:e,publicKey:i,signature:o,encodedData:r}}async function Rx(n){return await Be.verify({name:n.algorithm,hash:{name:n.hash}},n.publicKey,n.signature,n.encodedData)}class Ox{currentPage;itemsPerPage;entriesInterval;entriesEdge;linkTo;prevText;nextText;ellipseText;prevShowAlways;nextShowAlways;callback;totalPages;parentVNode;constructor(t,e,s){this.currentPage=s?.currentPage||0,this.itemsPerPage=s?.itemsPerPage||10,this.entriesInterval=s?.entriesInterval||5,this.entriesEdge=s?.entriesEdge||1,this.linkTo=s?.linkTo||"javascript:;",this.prevText=s?.prevText||"上一页",this.nextText=s?.nextText||"下一页",this.ellipseText=s?.ellipseText||"...",this.prevShowAlways=typeof s?.prevShowAlways=="boolean"?s?.prevShowAlways:!0,this.nextShowAlways=typeof s?.nextShowAlways=="boolean"?s?.nextShowAlways:!0,this.callback=s?.callback||(i=>!1),this.totalPages=Math.ceil(e/this.itemsPerPage),this.parentVNode=this.createParentVNode(),_s(this.parentVNode,t),this.selectPage(this.currentPage)}createParentVNode(){return ss("div",{class:"pagination"},[])}appendVNode(t,e,s){e=e<0?0:e<this.totalPages?e:this.totalPages-1;const i=s?.text||String(e+1),r=s?.classes||"";t.children.push(e==this.currentPage&&r.indexOf("prev")==-1&&r.indexOf("next")==-1?ss("span",{class:`current ${r}`},i):ss("a",{class:r,href:this.linkTo.replace(/__id__/,String(e)),onClick:o=>this.selectPage(e,o)},i))}drawLinks(){const t=this.createParentVNode(),e=Math.ceil(this.entriesInterval/2),s=this.currentPage>e?Math.max(Math.min(this.currentPage-e,this.totalPages-this.entriesInterval),0):0,i=this.currentPage>e?Math.min(this.currentPage+e,this.totalPages):Math.min(this.entriesInterval,this.totalPages);if(this.prevText&&(this.currentPage>0||this.prevShowAlways)&&this.appendVNode(t,this.currentPage-1,{text:this.prevText,classes:"prev"}),s>0&&this.entriesEdge>0){const r=Math.min(this.entriesEdge,s);for(let o=0;o<r;o++)this.appendVNode(t,o);this.entriesEdge<s&&this.ellipseText&&t.children.push(ss("span",{},this.ellipseText))}for(let r=s;r<i;r++)this.appendVNode(t,r);if(i<this.totalPages&&this.entriesEdge>0){this.totalPages-this.entriesEdge>i&&this.ellipseText&&t.children.push(ss("span",{},this.ellipseText));const r=Math.max(this.totalPages-this.entriesEdge,i);for(let o=r;o<this.totalPages;o++)this.appendVNode(t,o)}this.nextText&&(this.currentPage<this.totalPages-1||this.nextShowAlways)&&this.appendVNode(t,this.currentPage+1,{text:this.nextText,classes:"next"}),li(this.parentVNode,t),this.parentVNode=t}selectPage(t,e){this.currentPage=t=t<0?0:t<this.totalPages?t:this.totalPages-1,this.drawLinks();const s=this.callback(t);return e&&(s||(e.stopPropagation?e.stopPropagation():e.cancelBubble=!0)),s}prevPage(){return this.selectPage(this.currentPage-1)}nextPage(){return this.selectPage(this.currentPage+1)}}class zx{static;store;eb;axios;ds;constructor(t={}){this.static=t.static||{};const e=t.store?.state||{};this.store=Ha(t.store?.reducer||(()=>e),e,t.store?.enhancer),this.eb=new _n,this.axios=new lr({baseURL:t.axios?.baseURL,timeout:t.axios?.timeout,headers:t.axios?.headers,responseType:t.axios?.responseType,responseEncoding:t.axios?.responseEncoding,interceptor:t.axios?.interceptor,retry:t.axios?.retry,cache:t.axios?.cache}),this.ds=new Hf({concurrency:1})}}return d.ArrowShape=Bo,d.BallShape=vs,d.BezierEasing=zr,d.BufferAttribute=ye,d.COLOR_NAMES=an,d.CSSToJSEasing=gg,d.Clock=Fr,d.Color=Yt,d.ColorManagement=Lo,d.CommonKeyCode=b1,d.ConfettiShapeCombo=Wo,d.Context=zx,d.CrossShape=$o,d.CurveShape=Oo,d.CustomCanvasContext=Pc,d.CustomCanvasGradient=Hn,d.CustomCanvasPattern=Ur,d.DOMParse=_o,d.DOMSVGUtil=He,d.DOMToBlob=fr,d.DOMToString=ur,d.DOMVideo=rn,d.DrawContext=q1,d.Easing=O,d.EllipseShape=Vo,d.FetchWithAxios=lr,d.FileUpload=Lm,d.Float32BufferAttribute=z0,d.FoxShape=Xo,d.HeartShape=No,d.HeartVariantShape=Fo,d.Int16BufferAttribute=D0,d.Int32BufferAttribute=R0,d.Int8BufferAttribute=A0,d.Interpolation=pe,d.LineShape=es,d.LinearSRGBColorSpace=ko,d.LinearToSRGB=ts,d.LinearTransfer=Do,d.Ls=ze,d.MVVM=Tw,d.Matrix=wt,d.Matrix2=Jr,d.Matrix3=ps,d.Matrix4=kt,d.NoColorSpace=Gl,d.Pagination=Ox,d.PointsShape=oi,d.QRCode=Re,d.RabbitShape=Uo,d.RectShape=Oe,d.RingIndicatorShapeCombo=Ho,d.RingShape=hn,d.SRGBColorSpace=Qe,d.SRGBToLinear=Ke,d.SRGBTransfer=ri,d.SVGParse=jw,d.SVGParsedPathArgsLength=Hs,d.SegmentShapeCombo=qo,d.Shape=K,d.ShapeCombo=Lt,d.ShipShapeCombo=Go,d.SliderShapeCombo=jo,d.StarShape=Yo,d.TWEEN=Cg,d.TextShape=Ss,d.Timeline=$s,d.TreeShapeCombo=zo,d.Tween=Nr,d.Uint16BufferAttribute=L0,d.Uint32BufferAttribute=O0,d.Uint8BufferAttribute=I0,d.Uint8ClampedBufferAttribute=k0,d.Vector2=Ws,d.Vector3=Bt,d.Vector4=jr,d.WebGLCoordinateSystem=Js,d.WebGLRenderer=Ww,d.WebGPUCoordinateSystem=Wr,d.WebRTCClient=Hw,d.WebSocketClient=ae,d.YZCanvasContext=$r,d.__color=xe,d.addClass=xy,d.addWatermark=_0,d.addWxJsReadyFnBeforeConfig=ia,d.ajax=Gw,d.aliJsChooseImage=Ex,d.aliJsGetLocation=Tx,d.aliJsOpenLocation=Px,d.aliJsPreviewImage=Mx,d.aliJsReady=Sx,d.aliJsScan=Cx,d.aliJsTradePay=_x,d.angle=zt,d.animateShapes=$1,d.animationEnd$=n1,d.animationStart$=s1,d.atomReadAttribute=zc,d.atomReadAttributes=so,d.atomReadStyle=Xg,d.atomReadStyles=to,d.atomRemoveAttribute=Vg,d.atomRemoveDataset=nw,d.atomRemoveStyle=eo,d.atomWriteAttribute=ws,d.atomWriteStyle=Zn,d.base64EncodeOutputStream=Xc,d.bitmapMapper=jc,d.blobToImageData=Wg,d.byteArrayOutputStream=io,d.canUsePaths=Yw,d.cancelBubble=fc,d.cancelFetch=ww,d.changeBrightness=v0,d.changeCheckboxChecked=my,d.changeDiaphaneity=S0,d.changeRadioChecked=dy,d.changeSelected=fy,d.changeSize=b0,d.checkWxJsApi=Zw,d.clearCookies=mw,d.clearLocalStorage=iw,d.clearSessionStorage=fw,d.closeLog=Mf,d.closest=ay,d.combineTransformToMatrix=Ug,d.computeImageDisplayRect=Gg,d.containsChild=ny,d.createDefaultMousePoint=uo,d.createElement=rl,d.createElementNS=Sy,d.createFragment=il,d.createIndexDB=gw,d.createObjectURL=Hc,d.createRunCycleInMaxRate=rg,d.createTextNode=_y,d.createWebSocket=ou,d.createXMLHttpRequest=fu,d.cssAttrsToCanvasAttrs=Bc,d.decrypt=Dx,d.distance=Ae,d.domPrefixes=$g,d.drag$=pl,d.dragEnd$=yl,d.dragEnter$=xl,d.dragLeave$=bl,d.dragOver$=vl,d.dragStart$=gl,d.drawBitmapInCanvas=N0,d.drawQRCodeToCanvas=M0,d.drop$=wl,d.easeNameToCubicBezier=Br,d.empty=el,d.encrypt=kx,d.fireEvent=eg,d.flipSideToSide=Zg,d.flipUpsideDown=Qg,d.followMouseShape=X1,d.getBitmapFromCanvas=B0,d.getBodyPosition=d1,d.getBrowserClient=Ko,d.getBrowserClientVersion=Mw,d.getBrowserLanguage=Aw,d.getCSSVar=cw,d.getDOMMatrix=Kr,d.getDirection=Eg,d.getDocumentElementPosition=en,d.getElementPositionInPage=yo,d.getElementPositionInPage2=p1,d.getElementPositionInViewport=El,d.getEmSize=K0,d.getFetchId=Zo,d.getFileExtension=km,d.getFileMD5Hash=Rh,d.getFileTypeFromFile=Im,d.getFormSubmitData=qw,d.getImageData=Nc,d.getImageDataByAIData=T0,d.getImageMainColor=Jg,d.getInnerText=gy,d.getInternetExplorerVersion=cu,d.getKeyCode=v1,d.getMIME=Dm,d.getMouseButton=x1,d.getMousePositionInElement=dt,d.getMousePositionInPage=wo,d.getMousePositionInViewport=w1,d.getOperatingSystem=ui,d.getOperatingSystemVersion=Ew,d.getPageSize=m1,d.getRelativeBoundingClientRect=g1,d.getRemSize=ro,d.getScreenPosition=f1,d.getSelectedText=V0,d.getStyle=We,d.getTheme$=hw,d.getTimeZone=Iw,d.getVerticalScrollTopPercentInPage=y1,d.getVertxRegisterBaseUrl=Pw,d.getViewportSize=Pl,d.getVnode=Yr,d.gifImage=Uc,d.h=ss,d.hFromEl=ci,d.hasClass=vy,d.hideEl=nl,d.html=tl,d.iframePostMessage=Cy,d.imageDataToBitmap=qg,d.imageDataToBlob=Hg,d.imageDataToDataURL=jg,d.injectStyle=Oc,d.injectWxJsConfig=Jw,d.insert=bs,d.isActiveEl=Z0,d.isAliBrowser=uu,d.isAliMiniProgram=Nw,d.isAndroid=hu,d.isAppleDevice=kw,d.isBrowserSupportFileAPI=Fw,d.isElement=Xw,d.isEventSupported=ng,d.isIE=Lw,d.isIE10=Ow,d.isIE11=zw,d.isIE9=Rw,d.isIOS=ta,d.isInput=tn,d.isInputCheckbox=ho,d.isInputNumber=uy,d.isInputRadio=co,d.isInputText=ly,d.isMacOS=au,d.isMobile=Dw,d.isRootEl=J0,d.isSelect=ao,d.isTextArea=cy,d.isTouchSupport=$w,d.isWxBrowser=lu,d.isWxMiniProgram=Bw,d.jpgToPng=g0,d.keyDown$=Sl,d.keyPress$=i1,d.keyUp$=_l,d.leftRotate=Kg,d.length=ms,d.mapTDTJSSDK=Ax,d.marginSharpen=p0,d.mosaic=C0,d.mount=_s,d.mouseClick$=Iy,d.mouseContextMenu$=Ly,d.mouseDoubleClick$=ky,d.mouseDown$=hl,d.mouseEnter$=My,d.mouseLeave$=Ay,d.mouseMove$=ti,d.mouseOut$=Ey,d.mouseOver$=Py,d.mouseUp$=cl,d.mouseWheel$=Dy,d.nearestElement=ty,d.nextElementSibling=ry,d.normalizePoint=Pg,d.objectSignature=Ix,d.onBeforeUnload=Jc,d.onDocumentReady=Wc,d.openLog=Ef,d.outputGifBase64=$c,d.outputQRCodeBase64=E0,d.pan$=Ry,d.panCancel$=Ny,d.panDown$=Uy,d.panEnd$=By,d.panLeft$=Fy,d.panMove$=Oy,d.panRight$=Yy,d.panStart$=zy,d.panUp$=Xy,d.parent=ey,d.parents=oo,d.parseCSS=Co,d.parseTransformToMatrix=Qr,d.patch=li,d.pinch$=$y,d.pinchIn$=Vy,d.pinchOut$=Gy,d.pngToJpg=y0,d.pointerCancel$=go,d.pointerDown$=mo,d.pointerMove$=fo,d.pointerUp$=po,d.polar=Ie,d.polymorphTween=G1,d.prefixes=Uw,d.press$=qy,d.preventDefault=Ee,d.previousElementSibling=oy,d.radiusClip=x0,d.readFileInBrowser=zs,d.rectClip=w0,d.rem2px=Q0,d.remove=yy,d.removeAllEventListeners=Hp,d.removeClass=by,d.requestAnimationFrameCycle=Ir,d.reverseCSSToJSEasing=yg,d.reverseEaseNameToCubicBezier=Sc,d.reverseEasing=yc,d.revokeObjectURL=F0,d.rightRotate=t0,d.rotate$=jy,d.rotatePoint=Qt,d.scheduleIdle=dc,d.scheduleIdleAsap=gc,d.scheduleVnodeAsap=Xr,d.scheduleVnodeImmediately=Tg,d.scrollParent=sy,d.scrollTo=H0,d.selectFileInBrowser=dr,d.setCSSVar=lw,d.setIntervalAccurate=ig,d.setLogUploadFn=Af,d.setManualScroll=W0,d.setRem=Vw,d.setStyle=ys,d.setTheme=ru,d.setTimeoutAccurate=kr,d.setWindowTitle=G0,d.shadowRoot=hy,d.sharpen=m0,d.showEl=sl,d.siblings=iy,d.signEncrypt=Lx,d.signature=pu,d.simulateMouseEventFromTouch=sg,d.stringToDOM=Am,d.swipe$=Hy,d.swipeDown$=Qy,d.swipeLeft$=Wy,d.swipeRight$=Jy,d.swipeUp$=Zy,d.tap$=ml,d.tapOutSide$=Ky,d.targetToAfterDropShape=U1,d.text=py,d.toBlackAndWhite=n0,d.toBlue=a0,d.toBlueAndGreen=l0,d.toBlueAndGrey=d0,d.toDegree=mt,d.toGreen=o0,d.toGreenAndGrey=f0,d.toGrey=e0,d.toGrey2=s0,d.toOpposite=i0,d.toRadian=q,d.toRed=r0,d.toRedAndBlue=c0,d.toRedAndGreen=h0,d.toRedAndGrey=u0,d.toggleClass=lo,d.toggleElDisplay=wy,d.toggleTheme=aw,d.touchCancel$=dl,d.touchEnd$=fl,d.touchMove$=ll,d.touchStart$=ul,d.transformPath2D=Yg,d.transitionEnd$=e1,d.transitionStart$=t1,d.updateVnode=qn,d.useAttribute=oe,d.useClickA=Kn,d.useClipboard=j0,d.useCookie=dw,d.useCoords$=Q1,d.useDataset=sw,d.useDocumentVisible$=u1,d.useDraggable=c1,d.useDrop=l1,d.useElementEventBus=P1,d.useEvent$=$,d.useEventListener=W,d.useFetch=ai,d.useFetchCache=bw,d.useFetchRetry=xw,d.useFetchRetryCache=vw,d.useHashChange$=tw,d.useHotKeyDown$=Al,d.useHotKeyFile=_1,d.useHotKeyFile$=Il,d.useHotKeyUp$=S1,d.useIntersection$=Ql,d.useLoadImage=Qc,d.useLoadLink=X0,d.useLoadScript=Y0,d.useLocalStorage=su,d.useLocale=Qo,d.useLocation$=eu,d.useMatchMedia$=tu,d.useMouseAndPointerDownMovePoint$=Cl,d.useMouseDownMovePoint$=o1,d.useMouseMovePoint$=r1,d.useMousePoint=Je,d.useMutation$=Zl,d.useParentEventListener=jp,d.usePointerDownMovePoint$=ei,d.usePopStateChange$=ew,d.usePressDownMove=Dl,d.usePressDownMoveWithMouse=E1,d.usePressDownMoveWithPointer=Ll,d.usePressDownMoveWithTouch=M1,d.usePull$=h1,d.useResize=kl,d.useResize$=xo,d.useRunInSandbox=Ty,d.useSafeArea$=Z1,d.useScroll$=Tl,d.useSelectFile=Kc,d.useSelectFileImage=$0,d.useSessionStorage=uw,d.useTouchDownMovePoint$=a1,d.useUrlChange$=K1,d.useVisible$=W1,d.useVisibleSimple$=H1,d.useWindowResize$=C1,d.verifyDecrypt=Rx,d.vibrate=q0,d.waitElementAddedInDOM=j1,d.waitForStyleSheetsLoaded=U0,d.writeToIndexDB=yw,d.wxJsChooseImage=tx,d.wxJsDownloadImage=nx,d.wxJsDownloadVoice=dx,d.wxJsGetLocalImgData=ix,d.wxJsGetLocation=yx,d.wxJsGetNetworkType=px,d.wxJsLogin=vx,d.wxJsOnVoicePlayEnd=ux,d.wxJsOnVoiceRecordEnd=ax,d.wxJsOpenLocation=gx,d.wxJsPauseVoice=cx,d.wxJsPay=bx,d.wxJsPlayVoice=hx,d.wxJsPreviewImage=ex,d.wxJsScanQRCode=xx,d.wxJsStartRecord=rx,d.wxJsStopRecord=ox,d.wxJsStopVoice=lx,d.wxJsTranslateVoice=mx,d.wxJsUpdateAppMessageShareData=Qw,d.wxJsUpdateTimelineShareData=Kw,d.wxJsUploadImage=sx,d.wxJsUploadVoice=fx,Object.defineProperty(d,Symbol.toStringTag,{value:"Module"}),d}({});
63
66
  //# sourceMappingURL=zyzgroup_core_web.iife.js.map